diff --git a/dist/kaltura-player.js b/dist/kaltura-player.js index dfe269b02..6e1747fc1 100644 --- a/dist/kaltura-player.js +++ b/dist/kaltura-player.js @@ -70,7 +70,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 1); +/******/ return __webpack_require__(__webpack_require__.s = 2); /******/ }) /************************************************************************/ /******/ ([ @@ -95,9 +95,9 @@ return /******/ (function(modules) { // webpackBootstrap /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { +/******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; -/******/ } +/******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, @@ -1050,6 +1050,8 @@ 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; }; }(); var _eventManager = __webpack_require__(6); @@ -1108,6 +1110,10 @@ var _textTrack = __webpack_require__(4); var _textTrack2 = _interopRequireDefault(_textTrack); +var _playerConfig = __webpack_require__(26); + +var _playerConfig2 = _interopRequireDefault(_playerConfig); + 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"); } } @@ -1129,26 +1135,9 @@ var Player = function (_FakeEventTarget) { */ /** - * The player ready promise - * @type {Promise<*>} - * @private - */ - - /** - * The state manager of the player. - * @type {StateManager} - * @private - */ - - /** - * The runtime configuration of the player. - * @type {Object} - * @private - */ - - /** - * The plugin manager of the player. - * @type {PluginManager} + * The player class logger. + * @type {any} + * @static * @private */ function Player(config) { @@ -1158,7 +1147,6 @@ var Player = function (_FakeEventTarget) { _this._tracks = []; _this._firstPlay = true; - _this._logger = _logger2.default.getLogger('Player'); _this._stateManager = new _stateManager2.default(_this); _this._pluginManager = new _pluginManager2.default(); _this._eventManager = new _eventManager2.default(); @@ -1179,14 +1167,26 @@ var Player = function (_FakeEventTarget) { */ /** - * Whether the play is the first or not - * @type {boolean} + * The available engines of the player. + * @type {Array} * @private */ /** - * The tracks of the player. - * @type {Array} + * The plugin manager of the player. + * @type {PluginManager} + * @private + */ + + /** + * The event manager of the player. + * @type {EventManager} + * @private + */ + + /** + * The runtime configuration of the player. + * @type {Object} * @private */ @@ -1197,14 +1197,26 @@ var Player = function (_FakeEventTarget) { */ /** - * The event manager of the player. - * @type {EventManager} + * The state manager of the player. + * @type {StateManager} * @private */ /** - * The player class logger. - * @type {any} + * The tracks of the player. + * @type {Array} + * @private + */ + + /** + * The player ready promise + * @type {Promise<*>} + * @private + */ + + /** + * Whether the play is the first or not + * @type {boolean} * @private */ @@ -1212,10 +1224,14 @@ var Player = function (_FakeEventTarget) { _createClass(Player, [{ key: 'configure', value: function configure(config) { - this._config = (0, _util.merge)([this._config, config || Player._defaultConfig()]); - this._loadPlugins(this._config); - this._selectEngine(this._config); - this._attachMedia(); + this._config = (0, _util.mergeDeep)(Player._defaultConfig(), config); + if (this._selectEngine()) { + this._attachMedia(); + this._loadPlugins(); + this._handlePlaybackConfig(); + } else { + Player._logger.warn("No playable engines was found to play the given sources"); + } } /** @@ -1227,7 +1243,9 @@ var Player = function (_FakeEventTarget) { }, { key: 'destroy', value: function destroy() { - this._engine.destroy(); + if (this._engine) { + this._engine.destroy(); + } this._eventManager.destroy(); this._pluginManager.destroy(); this._stateManager.destroy(); @@ -1248,55 +1266,109 @@ var Player = function (_FakeEventTarget) { /** - * - * @param {Object} config - The configuration of the player instance. + * Loads the configured plugins. * @private * @returns {void} */ - value: function _loadPlugins(config) { - var plugins = config.plugins; + value: function _loadPlugins() { + var plugins = this._config.plugins; for (var name in plugins) { this._pluginManager.load(name, this, plugins[name]); } } /** - * Select the engine to create based on the given configured sources. - * @param {Object} config - The configuration of the player instance. + * Selects the engine to create based on a given configuration. * @private - * @returns {void} + * @returns {boolean} - Whether a proper engine was found. */ }, { key: '_selectEngine', - value: function _selectEngine(config) { - if (config && config.sources) { - var sources = config.sources; - for (var i = 0; i < sources.length; i++) { - if (_html2.default.canPlayType(sources[i].mimetype)) { - this.dispatchEvent(new _fakeEvent2.default(_events.CUSTOM_EVENTS.SOURCE_SELECTED, { selectedSource: sources[i] })); - this._loadEngine(sources[i], config); - break; + value: function _selectEngine() { + if (this._config.sources && this._config.playback && this._config.playback.streamPriority) { + return this._selectEngineByPriority(); + } + return false; + } + + /** + * Selects an engine to play a source according to a given stream priority. + * @return {boolean} - Whether a proper engine was found to play the given sources + * according to the priority. + * @private + */ + + }, { + key: '_selectEngineByPriority', + value: function _selectEngineByPriority() { + var _this2 = this; + + var streamPriority = this._config.playback.streamPriority; + var sources = this._config.sources; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + var _loop = function _loop() { + var priority = _step.value; + + var engineId = typeof priority.engine === 'string' ? priority.engine.toLowerCase() : ''; + var format = typeof priority.format === 'string' ? priority.format.toLowerCase() : ''; + var engine = Player._engines.find(function (engine) { + return engine.id === engineId; + }); + if (engine) { + var formatSources = sources[format]; + if (formatSources && formatSources.length > 0) { + var source = formatSources[0]; + if (engine.canPlayType(source.mimetype)) { + _this2._loadEngine(engine, source); + return { + v: true + }; + } + } + } + }; + + for (var _iterator = streamPriority[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ret = _loop(); + + if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; } } } + + return false; } /** * Loads the selected engine. + * @param {IEngine} engine - The selected engine. * @param {Source} source - The selected source object. - * @param {Object} config - The configuration of the player instance. * @private * @returns {void} */ }, { key: '_loadEngine', - value: function _loadEngine(source, config) { - this._engine = new _html2.default(source, config); - if (config.preload === "auto") { - this.load(); - } + value: function _loadEngine(engine, source) { + this.dispatchEvent(new _fakeEvent2.default(_events.CUSTOM_EVENTS.SOURCE_SELECTED, { selectedSource: source })); + this._engine = engine.createEngine(source, this._config); } /** @@ -1308,29 +1380,44 @@ var Player = function (_FakeEventTarget) { }, { key: '_attachMedia', value: function _attachMedia() { - var _this2 = this; + var _this3 = this; if (this._engine) { for (var playerEvent in _events.HTML5_EVENTS) { this._eventManager.listen(this._engine, _events.HTML5_EVENTS[playerEvent], function (event) { - return _this2.dispatchEvent(event); + return _this3.dispatchEvent(event); }); } this._eventManager.listen(this._engine, _events.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED, function (event) { - _this2._markActiveTrack(event.payload.selectedVideoTrack); - return _this2.dispatchEvent(event); + _this3._markActiveTrack(event.payload.selectedVideoTrack); + return _this3.dispatchEvent(event); }); this._eventManager.listen(this._engine, _events.CUSTOM_EVENTS.AUDIO_TRACK_CHANGED, function (event) { - _this2._markActiveTrack(event.payload.selectedAudioTrack); - return _this2.dispatchEvent(event); + _this3._markActiveTrack(event.payload.selectedAudioTrack); + return _this3.dispatchEvent(event); }); this._eventManager.listen(this._engine, _events.CUSTOM_EVENTS.TEXT_TRACK_CHANGED, function (event) { - _this2._markActiveTrack(event.payload.selectedTextTrack); - return _this2.dispatchEvent(event); + _this3._markActiveTrack(event.payload.selectedTextTrack); + return _this3.dispatchEvent(event); }); this._eventManager.listen(this, _events.HTML5_EVENTS.PLAY, this._onPlay.bind(this)); } } + }, { + key: '_handlePlaybackConfig', + value: function _handlePlaybackConfig() { + if (this._config.playback) { + if (this._config.playback.muted) { + this.muted = true; + } + if (this._config.playback.preload === "auto") { + this.load(); + } + if (this._config.playback.autoplay) { + this.play(); + } + } + } /** * Returns the tracks according to the filter. if no filter given returns the all tracks. @@ -1392,6 +1479,24 @@ var Player = function (_FakeEventTarget) { } } + /** + * Hide the text track + * @function hideTextTrack + * @returns {void} + * @public + */ + + }, { + key: 'hideTextTrack', + value: function hideTextTrack() { + if (this._engine) { + this._engine.hideTextTrack(); + this._getTracksByType(_trackTypes2.default.TEXT).map(function (track) { + return track.active = false; + }); + } + } + /** * Enables adaptive bitrate switching. * @function enableAdaptiveBitrate @@ -1478,14 +1583,14 @@ var Player = function (_FakeEventTarget) { }, { key: 'load', value: function load() { - var _this3 = this; + var _this4 = this; if (this._engine) { this._engine.load().then(function (data) { - _this3._tracks = data.tracks; - _this3.dispatchEvent(new _fakeEvent2.default(_events.CUSTOM_EVENTS.TRACKS_CHANGED, { tracks: _this3._tracks })); + _this4._tracks = data.tracks; + _this4.dispatchEvent(new _fakeEvent2.default(_events.CUSTOM_EVENTS.TRACKS_CHANGED, { tracks: _this4._tracks })); }).catch(function (error) { - _this3.dispatchEvent(new _fakeEvent2.default(_events.HTML5_EVENTS.ERROR, error)); + _this4.dispatchEvent(new _fakeEvent2.default(_events.HTML5_EVENTS.ERROR, error)); }); } } @@ -1499,7 +1604,7 @@ var Player = function (_FakeEventTarget) { }, { key: 'play', value: function play() { - var _this4 = this; + var _this5 = this; if (this._engine) { if (this._engine.src) { @@ -1507,7 +1612,7 @@ var Player = function (_FakeEventTarget) { } else { this.load(); this.ready().then(function () { - _this4._engine.play(); + _this5._engine.play(); }); } } @@ -1747,13 +1852,15 @@ var Player = function (_FakeEventTarget) { }], [{ key: '_defaultConfig', value: function _defaultConfig() { - return {}; + return (0, _util.copyDeep)(_playerConfig2.default); } }]); return Player; }(_fakeEventTarget2.default); +Player._logger = _logger2.default.getLogger('Player'); +Player._engines = [_html2.default]; exports.default = Player; /***/ }), @@ -1975,6 +2082,13 @@ exports.default = PlayerError; 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 _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); } } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + function isNumber(n) { return Number(n) === n; } @@ -2029,10 +2143,74 @@ function merge(objects) { return target; } +/** + * @param {any} item - The item to check. + * @returns {boolean} - Whether the item is an object. + */ +function isObject(item) { + return item && (typeof item === "undefined" ? "undefined" : _typeof(item)) === 'object' && !Array.isArray(item); +} + +/** + * @param {any} target - The target object. + * @param {any} sources - The objects to merge. + * @returns {Object} - The merged object. + */ +function mergeDeep(target) { + for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + sources[_key - 1] = arguments[_key]; + } + + if (!sources.length) { + return target; + } + var source = sources.shift(); + if (isObject(target) && isObject(source)) { + for (var key in source) { + if (isObject(source[key])) { + if (!target[key]) Object.assign(target, _defineProperty({}, key, {})); + mergeDeep(target[key], source[key]); + } else { + Object.assign(target, _defineProperty({}, key, source[key])); + } + } + } + return mergeDeep.apply(undefined, [target].concat(_toConsumableArray(sources))); +} + +/** + * @param {any} data - The data to copy. + * @returns {any} - The copied data. + */ +function copyDeep(data) { + var node = void 0; + if (Array.isArray(data)) { + node = data.length > 0 ? data.slice(0) : []; + node.forEach(function (e, i) { + if ((typeof e === "undefined" ? "undefined" : _typeof(e)) === "object" && e !== {} || Array.isArray(e) && e.length > 0) { + node[i] = copyDeep(e); + } + }); + } else if ((typeof data === "undefined" ? "undefined" : _typeof(data)) === "object") { + node = Object.assign({}, data); + Object.keys(node).forEach(function (key) { + if (_typeof(node[key]) === "object" && node[key] !== {} || Array.isArray(node[key]) && node[key].length > 0) { + node[key] = copyDeep(node[key]); + } + }); + } else { + node = data; + } + return node; +} + exports.isNumber = isNumber; exports.isInt = isInt; exports.isFloat = isFloat; +exports.isObject = isObject; exports.merge = merge; +exports.mergeDeep = mergeDeep; +exports.copyDeep = copyDeep; /***/ }), /* 12 */ @@ -2245,6 +2423,11 @@ var BaseMediaSourceAdapter = function (_FakeEventTarget) { value: function selectTextTrack(textTrack) { throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'selectTextTrack').getError(); } + }, { + key: 'hideTextTrack', + value: function hideTextTrack() { + throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'hideTextTrack').getError(); + } }, { key: 'enableAdaptiveBitrate', value: function enableAdaptiveBitrate() { @@ -2309,15 +2492,15 @@ var MediaSourceProvider = function () { /** - * Add a media source adapter to the registry + * Add a media source adapter to the registry. * @function register - * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to register + * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to register. * @static * @returns {void} */ /** - * The media source adapter registry + * The media source adapter registry. * @member {Array} _mediaSourceAdapters * @static * @private @@ -2334,22 +2517,22 @@ var MediaSourceProvider = function () { } /** - * Remove a media source adapter from the registry + * Remove a media source adapter from the registry. * @function unRegister - * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to unRegister + * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to unRegister. * @static * @returns {void} */ /** - * The selected adapter for playback + * The selected adapter for playback. * @type {null|IMediaSourceAdapter} * @static * @private */ /** - * The logger of the media source provider + * The logger of the media source provider. * @member {any} _logger * @static * @private @@ -2366,11 +2549,11 @@ var MediaSourceProvider = function () { } /** - * Checks if one of the registered media source adapters can play a given mime type + * Checks if one of the registered media source adapters can play a given mime type. * @function canPlayType - * @param {string} mimeType - The mime type to check + * @param {string} mimeType - The mime type to check. * @static - * @returns {boolean} - If one of the adapters can play the specific mime type + * @returns {boolean} - If one of the adapters can play the specific mime type. */ }, { @@ -2388,12 +2571,12 @@ var MediaSourceProvider = function () { } /** - * Get the appropriate media source adapter to the video source + * Get the appropriate media source adapter to the video source. * @function getMediaSourceAdapter - * @param {HTMLVideoElement} videoElement - The video element which requires adapter for a given mimeType - * @param {Source} source - The selected source object - * @param {Object} config - The player configuration - * @returns {IMediaSourceAdapter|null} - The selected media source adapter, or null if such doesn't exists + * @param {HTMLVideoElement} videoElement - The video element which requires adapter for a given mimeType. + * @param {Source} source - The selected source object. + * @param {Object} config - The player configuration. + * @returns {IMediaSourceAdapter|null} - The selected media source adapter, or null if such doesn't exists. * @static */ @@ -2404,10 +2587,22 @@ var MediaSourceProvider = function () { if (!MediaSourceProvider._selectedAdapter) { MediaSourceProvider.canPlayType(source.mimetype); } - return MediaSourceProvider._selectedAdapter ? MediaSourceProvider._selectedAdapter.createAdapter(videoElement, source, config.engines) : null; + return MediaSourceProvider._selectedAdapter ? MediaSourceProvider._selectedAdapter.createAdapter(videoElement, source, config) : null; } return null; } + + /** + * Destroys the media source adapter provider necessary props. + * @static + * @returns {void} + */ + + }, { + key: 'destroy', + value: function destroy() { + MediaSourceProvider._selectedAdapter = null; + } }]); return MediaSourceProvider; @@ -3160,13 +3355,16 @@ var Html5 = function (_FakeEventTarget) { _inherits(Html5, _FakeEventTarget); _createClass(Html5, null, [{ - key: 'canPlayType', + key: 'createEngine', /** - * Checks if the engine can play a given mime type. - * @param {string} mimeType - The mime type to check. - * @returns {boolean} - Whether the engine can play the mime type. + * Factory method to create an engine. + * @param {Source} source - The selected source object. + * @param {Object} config - The player configuration. + * @returns {IEngine} - New instance of the run time engine. + * @public + * @static */ /** @@ -3180,19 +3378,21 @@ var Html5 = function (_FakeEventTarget) { * @type {HTMLVideoElement} * @private */ - value: function canPlayType(mimeType) { - return _mediaSourceProvider2.default.canPlayType(mimeType); + value: function createEngine(source, config) { + return new this(source, config); } /** - * @constructor - * @param {Source} source - The selected source object. - * @param {Object} config - The player configuration. + * Checks if the engine can play a given mime type. + * @param {string} mimeType - The mime type to check. + * @returns {boolean} - Whether the engine can play the mime type. + * @public + * @static */ /** - * @type {string} - The engine name. + * @type {string} - The engine id. */ /** @@ -3201,6 +3401,18 @@ var Html5 = function (_FakeEventTarget) { * @private */ + }, { + key: 'canPlayType', + value: function canPlayType(mimeType) { + return _mediaSourceProvider2.default.canPlayType(mimeType); + } + + /** + * @constructor + * @param {Source} source - The selected source object. + * @param {Object} config - The player configuration. + */ + }]); function Html5(source, config) { @@ -3208,8 +3420,8 @@ var Html5 = function (_FakeEventTarget) { var _this = _possibleConstructorReturn(this, (Html5.__proto__ || Object.getPrototypeOf(Html5)).call(this)); - _this._createVideoElement(); _this._eventManager = new _eventManager2.default(); + _this._createVideoElement(); _this._loadMediaSourceAdapter(source, config); _this.attach(); return _this; @@ -3228,6 +3440,7 @@ var Html5 = function (_FakeEventTarget) { this.detach(); if (this._mediaSourceAdapter) { this._mediaSourceAdapter.destroy(); + _mediaSourceProvider2.default.destroy(); } if (this._el) { this.pause(); @@ -3260,7 +3473,6 @@ var Html5 = function (_FakeEventTarget) { _loop(playerEvent); } if (this._mediaSourceAdapter) { - // listen and dispatch adaptive bitrate changed event this._eventManager.listen(this._mediaSourceAdapter, _events.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED, function (event) { _this2.dispatchEvent(event); }); @@ -3380,6 +3592,21 @@ var Html5 = function (_FakeEventTarget) { } } + /** + * Hide the text track + * @function hideTextTrack + * @returns {void} + * @public + */ + + }, { + key: 'hideTextTrack', + value: function hideTextTrack() { + if (this._mediaSourceAdapter) { + this._mediaSourceAdapter.hideTextTrack(); + } + } + /** * Enables adaptive bitrate switching according to the media source extension logic. * @function enableAdaptiveBitrate @@ -3876,7 +4103,7 @@ var Html5 = function (_FakeEventTarget) { return Html5; }(_fakeEventTarget2.default); -Html5.EngineName = "html5"; +Html5.id = "html5"; exports.default = Html5; /***/ }), @@ -4205,6 +4432,19 @@ var NativeAdapter = function (_BaseMediaSourceAdapt) { } } + /** + * Hide the text track + * @function hideTextTrack + * @returns {void} + * @public + */ + + }, { + key: 'hideTextTrack', + value: function hideTextTrack() { + this._disableTextTracks(); + } + /** * Enables adaptive bitrate * @function enableAdaptiveBitrate @@ -5051,62 +5291,40 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! }(this)); -/***/ }) -/******/ ]); -}); - - /***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; +/* 26 */ +/***/ (function(module, exports) { +module.exports = { + "playback": { + "preload": "none", + "autoplay": false, + "muted": false, + "streamPriority": [ + { + "engine": "html5", + "format": "hls" + }, + { + "engine": "html5", + "format": "dash" + }, + { + "engine": "html5", + "format": "progressive" + } + ] + }, + "plugins": {} +}; -Object.defineProperty(exports, "__esModule", { - value: true +/***/ }) +/******/ ]); }); -exports.PlaykitUI = exports.OvpProvider = exports.Playkit = undefined; -var _playkitJs = __webpack_require__(0); - -var Playkit = _interopRequireWildcard(_playkitJs); - -var _ovpProvider = __webpack_require__(2); - -var _ovpProvider2 = _interopRequireDefault(_ovpProvider); - -var _playkitJsUi = __webpack_require__(3); - -var _playkitJsUi2 = _interopRequireDefault(_playkitJsUi); - -__webpack_require__(4); - -__webpack_require__(9); - -__webpack_require__(11); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -// TODO: Import plugins - -// Import media source adapters - - -// Import UI - - -// Import core -exports.Playkit = Playkit; -exports.OvpProvider = _ovpProvider2.default; -exports.PlaykitUI = _playkitJsUi2.default; - -// Import OVP and OTT providers /***/ }), -/* 2 */ +/* 1 */ /***/ (function(module, exports, __webpack_require__) { (function webpackUniversalModuleDefinition(root, factory) { @@ -5184,7 +5402,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 24); +/******/ return __webpack_require__(__webpack_require__.s = 25); /******/ }) /************************************************************************/ /******/ ([ @@ -5375,7 +5593,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.UIConfCreationMode = exports.UIConfType = exports.MediaEntryType = exports.MediaType = exports.EntryType = exports.EntryModerationStatus = exports.EntryStatus = exports.MetadataStatus = exports.MetadataObjectType = exports.Status = exports.KalturaRuleActionType = exports.Scheme = undefined; -var _enumify = __webpack_require__(16); +var _enumify = __webpack_require__(18); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -6036,48 +6254,86 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _drm = __webpack_require__(10); +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 _drm2 = _interopRequireDefault(_drm); +var _mediaSource = __webpack_require__(12); + +var _mediaSource2 = _interopRequireDefault(_mediaSource); + +var _mediaFormat = __webpack_require__(11); 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"); } } /** - * Media source + * Container for the media sources aggregated by stream format. * @classdesc */ -var MediaSource = +var MediaSources = function () { -/** - * @constructor - */ + /** + * @constructor + */ -/** - * @member - media source mimetype - * @type {string} - */ + /** + * Dash media sources container. + * @type {Array} + * @public + */ + function MediaSources() { + _classCallCheck(this, MediaSources); -/** - * @member - media source ID - * @type {string} - */ -function MediaSource() { - _classCallCheck(this, MediaSource); -} -/** - * @member - media source drm data - * @type {Array} - */ + this.progressive = []; + this.dash = []; + this.hls = []; + } -/** - * @member - media source URL - * @type {string} - */ -; + /** + * Maps the source to one of the containers according to his media format. + * @param {MediaSource} source - The source to add to one of the containers. + * @param {MediaFormat} mediaFormat - The media format of the source. + * @returns {void} + */ -exports.default = MediaSource; + /** + * Hls media sources container. + * @type {Array} + * @public + */ + + /** + * Progressive download media sources container. + * @type {Array} + * @public + */ + + + _createClass(MediaSources, [{ + key: 'map', + value: function map(source, mediaFormat) { + if (mediaFormat) { + switch (mediaFormat.name) { + case 'mp4': + this.progressive.push(source); + break; + case 'dash': + this.dash.push(source); + break; + case 'hls': + this.hls.push(source); + break; + default: + break; + } + } + } + }]); + + return MediaSources; +}(); + +exports.default = MediaSources; /***/ }), /* 8 */ @@ -6357,11 +6613,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _mediaSource = __webpack_require__(7); +var _enums = __webpack_require__(2); -var _mediaSource2 = _interopRequireDefault(_mediaSource); +var _mediaSources = __webpack_require__(7); -var _enums = __webpack_require__(2); +var _mediaSources2 = _interopRequireDefault(_mediaSources); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6384,7 +6640,7 @@ var MediaEntry = /** * @member - entry sources - * @type {Array} + * @type {MediaSources} */ function MediaEntry() { _classCallCheck(this, MediaEntry); @@ -6464,6 +6720,135 @@ exports.default = Drm; "use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.MediaFormat = undefined; + +var _enumify = __webpack_require__(18); + +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; } + +var MediaFormat = exports.MediaFormat = function (_Enum) { + _inherits(MediaFormat, _Enum); + + function MediaFormat() { + _classCallCheck(this, MediaFormat); + + return _possibleConstructorReturn(this, (MediaFormat.__proto__ || Object.getPrototypeOf(MediaFormat)).apply(this, arguments)); + } + + return MediaFormat; +}(_enumify.Enum); + +MediaFormat.initEnum({ + dash: { + get mimeType() { + return "application/dash+xml"; + }, + get pathExt() { + return "mpd"; + } + }, + hls: { + get mimeType() { + return "application/x-mpegURL"; + }, + get pathExt() { + return "m3u8"; + } + }, + wvm: { + get mimeType() { + return "video/wvm"; + }, + get pathExt() { + return "wvm"; + } + }, + mp4: { + get mimeType() { + return "video/mp4"; + }, + get pathExt() { + return "mp4"; + } + }, + mp3: { + get mimeType() { + return "audio/mpeg"; + }, + get pathExt() { + return "mp3"; + } + } +}); + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _drm = __webpack_require__(10); + +var _drm2 = _interopRequireDefault(_drm); + +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"); } } + +/** + * Media source + * @classdesc + */ +var MediaSource = + +/** + * @constructor + */ + +/** + * @member - media source mimetype + * @type {string} + */ + +/** + * @member - media source ID + * @type {string} + */ +function MediaSource() { + _classCallCheck(this, MediaSource); +} +/** + * @member - media source drm data + * @type {Array} + */ + +/** + * @member - media source URL + * @type {string} + */ +; + +exports.default = MediaSource; + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + Object.defineProperty(exports, "__esModule", { value: true }); @@ -6575,7 +6960,7 @@ function KalturaFlavorAsset(data) { exports.default = KalturaFlavorAsset; /***/ }), -/* 12 */ +/* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6649,7 +7034,7 @@ function KalturaMediaEntry(entry) { exports.default = KalturaMediaEntry; /***/ }), -/* 13 */ +/* 15 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6663,7 +7048,7 @@ var _baseServiceResult = __webpack_require__(4); var _baseServiceResult2 = _interopRequireDefault(_baseServiceResult); -var _kalturaMetadata = __webpack_require__(29); +var _kalturaMetadata = __webpack_require__(30); var _kalturaMetadata2 = _interopRequireDefault(_kalturaMetadata); @@ -6714,7 +7099,7 @@ var KalturaMetadataListResponse = function (_ServiceResult) { exports.default = KalturaMetadataListResponse; /***/ }), -/* 14 */ +/* 16 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6728,19 +7113,19 @@ var _baseServiceResult = __webpack_require__(4); var _baseServiceResult2 = _interopRequireDefault(_baseServiceResult); -var _kalturaAccessControlMessage = __webpack_require__(26); +var _kalturaAccessControlMessage = __webpack_require__(27); var _kalturaAccessControlMessage2 = _interopRequireDefault(_kalturaAccessControlMessage); -var _kalturaPlaybackSource = __webpack_require__(15); +var _kalturaPlaybackSource = __webpack_require__(17); var _kalturaPlaybackSource2 = _interopRequireDefault(_kalturaPlaybackSource); -var _kalturaRuleAction = __webpack_require__(30); +var _kalturaRuleAction = __webpack_require__(31); var _kalturaRuleAction2 = _interopRequireDefault(_kalturaRuleAction); -var _kalturaFlavorAsset = __webpack_require__(11); +var _kalturaFlavorAsset = __webpack_require__(13); var _kalturaFlavorAsset2 = _interopRequireDefault(_kalturaFlavorAsset); @@ -6833,7 +7218,7 @@ var KalturaPlaybackContext = function (_ServiceResult) { exports.default = KalturaPlaybackContext; /***/ }), -/* 15 */ +/* 17 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -6845,7 +7230,7 @@ Object.defineProperty(exports, "__esModule", { 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 _kalturaDrmPlaybackPluginData = __webpack_require__(28); +var _kalturaDrmPlaybackPluginData = __webpack_require__(29); var _kalturaDrmPlaybackPluginData2 = _interopRequireDefault(_kalturaDrmPlaybackPluginData); @@ -6968,7 +7353,7 @@ var KalturaPlaybackSource = function () { exports.default = KalturaPlaybackSource; /***/ }), -/* 16 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7183,7 +7568,7 @@ function copyProperties(target, source) { } /***/ }), -/* 17 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7340,7 +7725,7 @@ DataLoaderManager._loadersResponseMap = new Map(); exports.default = DataLoaderManager; /***/ }), -/* 18 */ +/* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7356,11 +7741,11 @@ var _requestBuilder = __webpack_require__(0); var _requestBuilder2 = _interopRequireDefault(_requestBuilder); -var _baseEntryService = __webpack_require__(32); +var _baseEntryService = __webpack_require__(33); var _baseEntryService2 = _interopRequireDefault(_baseEntryService); -var _metaDataService = __webpack_require__(33); +var _metaDataService = __webpack_require__(34); var _metaDataService2 = _interopRequireDefault(_metaDataService); @@ -7368,15 +7753,15 @@ var _config = __webpack_require__(1); var _config2 = _interopRequireDefault(_config); -var _kalturaPlaybackContext = __webpack_require__(14); +var _kalturaPlaybackContext = __webpack_require__(16); var _kalturaPlaybackContext2 = _interopRequireDefault(_kalturaPlaybackContext); -var _kalturaMetadataListResponse = __webpack_require__(13); +var _kalturaMetadataListResponse = __webpack_require__(15); var _kalturaMetadataListResponse2 = _interopRequireDefault(_kalturaMetadataListResponse); -var _kalturaBaseEntryListResponse = __webpack_require__(27); +var _kalturaBaseEntryListResponse = __webpack_require__(28); var _kalturaBaseEntryListResponse2 = _interopRequireDefault(_kalturaBaseEntryListResponse); @@ -7469,7 +7854,7 @@ var MediaEntryLoader = function () { exports.default = MediaEntryLoader; /***/ }), -/* 19 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7481,7 +7866,7 @@ Object.defineProperty(exports, "__esModule", { 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 _sessionService = __webpack_require__(34); +var _sessionService = __webpack_require__(35); var _sessionService2 = _interopRequireDefault(_sessionService); @@ -7583,7 +7968,7 @@ var SessionLoader = function () { exports.default = SessionLoader; /***/ }), -/* 20 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7595,13 +7980,13 @@ Object.defineProperty(exports, "__esModule", { 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 _uiConfService = __webpack_require__(36); +var _uiConfService = __webpack_require__(37); var _uiConfService2 = _interopRequireDefault(_uiConfService); -var _kalturaUIConfResponse = __webpack_require__(31); +var _kalturaUiConfResponse = __webpack_require__(32); -var _kalturaUIConfResponse2 = _interopRequireDefault(_kalturaUIConfResponse); +var _kalturaUiConfResponse2 = _interopRequireDefault(_kalturaUiConfResponse); var _config = __webpack_require__(1); @@ -7684,7 +8069,7 @@ var UiConfigLoader = function () { }, { key: 'response', set: function set(response) { - this._response.uiConf = new _kalturaUIConfResponse2.default(response[0].data); + this._response.uiConf = new _kalturaUiConfResponse2.default(response[0].data); }, get: function get() { if (this._response != null && this._response.uiConf != null && this._response.uiConf.config != null) try { @@ -7701,7 +8086,7 @@ var UiConfigLoader = function () { exports.default = UiConfigLoader; /***/ }), -/* 21 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7713,31 +8098,31 @@ Object.defineProperty(exports, "__esModule", { 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 _kalturaMediaEntry = __webpack_require__(12); +var _kalturaMediaEntry = __webpack_require__(14); var _kalturaMediaEntry2 = _interopRequireDefault(_kalturaMediaEntry); -var _kalturaPlaybackContext = __webpack_require__(14); +var _kalturaPlaybackContext = __webpack_require__(16); var _kalturaPlaybackContext2 = _interopRequireDefault(_kalturaPlaybackContext); -var _kalturaPlaybackSource = __webpack_require__(15); +var _kalturaPlaybackSource = __webpack_require__(17); var _kalturaPlaybackSource2 = _interopRequireDefault(_kalturaPlaybackSource); -var _kalturaFlavorAsset = __webpack_require__(11); +var _kalturaFlavorAsset = __webpack_require__(13); var _kalturaFlavorAsset2 = _interopRequireDefault(_kalturaFlavorAsset); -var _kalturaMetadataListResponse = __webpack_require__(13); +var _kalturaMetadataListResponse = __webpack_require__(15); var _kalturaMetadataListResponse2 = _interopRequireDefault(_kalturaMetadataListResponse); -var _playSourceUrlBuilder = __webpack_require__(25); +var _playSourceUrlBuilder = __webpack_require__(26); var _playSourceUrlBuilder2 = _interopRequireDefault(_playSourceUrlBuilder); -var _xmlParser = __webpack_require__(37); +var _xmlParser = __webpack_require__(38); var _xmlParser2 = _interopRequireDefault(_xmlParser); @@ -7751,7 +8136,7 @@ var _config = __webpack_require__(1); var _config2 = _interopRequireDefault(_config); -var _mediaFormat = __webpack_require__(22); +var _mediaFormat = __webpack_require__(11); var _mediaEntry = __webpack_require__(9); @@ -7761,10 +8146,14 @@ var _drm = __webpack_require__(10); var _drm2 = _interopRequireDefault(_drm); -var _mediaSource = __webpack_require__(7); +var _mediaSource = __webpack_require__(12); var _mediaSource2 = _interopRequireDefault(_mediaSource); +var _mediaSources = __webpack_require__(7); + +var _mediaSources2 = _interopRequireDefault(_mediaSources); + 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"); } } @@ -7813,14 +8202,13 @@ var ProviderParser = function () { var playbackContext = mediaEntryResponse.playBackContextResult; var metadataList = mediaEntryResponse.metadataListResult; var kalturaSources = playbackContext.sources; - var sources = []; - + var sources = new _mediaSources2.default(); if (kalturaSources && kalturaSources.length > 0) { kalturaSources.forEach(function (source) { - sources.push(_this.parseSource(source, ks, partnerID, uiConfId, entry, playbackContext)); + var parsedSource = _this.parseSource(source, ks, partnerID, uiConfId, entry, playbackContext); + var mediaFormat = SUPPORTED_FORMATS.get(source.format); + sources.map(parsedSource, mediaFormat); }); - } else { - sources = []; } mediaEntry.sources = sources; @@ -7967,83 +8355,8 @@ var ProviderParser = function () { exports.default = ProviderParser; /***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.MediaFormat = undefined; - -var _enumify = __webpack_require__(16); - -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; } - -var MediaFormat = exports.MediaFormat = function (_Enum) { - _inherits(MediaFormat, _Enum); - - function MediaFormat() { - _classCallCheck(this, MediaFormat); - - return _possibleConstructorReturn(this, (MediaFormat.__proto__ || Object.getPrototypeOf(MediaFormat)).apply(this, arguments)); - } - - return MediaFormat; -}(_enumify.Enum); - -MediaFormat.initEnum({ - dash: { - get mimeType() { - return "application/dash+xml"; - }, - get pathExt() { - return "mpd"; - } - }, - hls: { - get mimeType() { - return "application/x-mpegURL"; - }, - get pathExt() { - return "m3u8"; - } - }, - wvm: { - get mimeType() { - return "video/wvm"; - }, - get pathExt() { - return "wvm"; - } - }, - mp4: { - get mimeType() { - return "video/mp4"; - }, - get pathExt() { - return "mp4"; - } - }, - mp3: { - get mimeType() { - return "audio/mpeg"; - }, - get pathExt() { - return "mp3"; - } - } -}); - -/***/ }), -/* 23 */, -/* 24 */ +/* 24 */, +/* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8060,23 +8373,23 @@ var _logger = __webpack_require__(5); var _logger2 = _interopRequireDefault(_logger); -var _providerParser = __webpack_require__(21); +var _providerParser = __webpack_require__(23); var _providerParser2 = _interopRequireDefault(_providerParser); -var _dataLoaderManager = __webpack_require__(17); +var _dataLoaderManager = __webpack_require__(19); var _dataLoaderManager2 = _interopRequireDefault(_dataLoaderManager); -var _mediaEntryLoader = __webpack_require__(18); +var _mediaEntryLoader = __webpack_require__(20); var _mediaEntryLoader2 = _interopRequireDefault(_mediaEntryLoader); -var _sessionLoader = __webpack_require__(19); +var _sessionLoader = __webpack_require__(21); var _sessionLoader2 = _interopRequireDefault(_sessionLoader); -var _uiConfigLoader = __webpack_require__(20); +var _uiConfigLoader = __webpack_require__(22); var _uiConfigLoader2 = _interopRequireDefault(_uiConfigLoader); @@ -8088,9 +8401,9 @@ var _mediaEntry = __webpack_require__(9); var _mediaEntry2 = _interopRequireDefault(_mediaEntry); -var _mediaSource = __webpack_require__(7); +var _mediaSources = __webpack_require__(7); -var _mediaSource2 = _interopRequireDefault(_mediaSource); +var _mediaSources2 = _interopRequireDefault(_mediaSources); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -8208,7 +8521,7 @@ var OvpProvider = exports.OvpProvider = function () { partnerID: this.partnerID, uiConfID: this._uiConfId }, - sources: [], + sources: new _mediaSources2.default(), duration: 0, type: "Unknown", metadata: {}, @@ -8267,7 +8580,7 @@ var OvpProvider = exports.OvpProvider = function () { exports.default = OvpProvider; /***/ }), -/* 25 */ +/* 26 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8377,7 +8690,7 @@ var PlaySourceUrlBuilder = function () { exports.default = PlaySourceUrlBuilder; /***/ }), -/* 26 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8419,7 +8732,7 @@ function KalturaAccessControlMessage(data) { exports.default = KalturaAccessControlMessage; /***/ }), -/* 27 */ +/* 28 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8433,7 +8746,7 @@ var _baseServiceResult = __webpack_require__(4); var _baseServiceResult2 = _interopRequireDefault(_baseServiceResult); -var _kalturaMediaEntry = __webpack_require__(12); +var _kalturaMediaEntry = __webpack_require__(14); var _kalturaMediaEntry2 = _interopRequireDefault(_kalturaMediaEntry); @@ -8489,7 +8802,7 @@ var KalturaBaseEntryListResponse = function (_ServiceResult) { exports.default = KalturaBaseEntryListResponse; /***/ }), -/* 28 */ +/* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8534,7 +8847,7 @@ function KalturaDrmPlaybackPluginData(drm) { exports.default = KalturaDrmPlaybackPluginData; /***/ }), -/* 29 */ +/* 30 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8584,7 +8897,7 @@ function KalturaMetadata(data) { exports.default = KalturaMetadata; /***/ }), -/* 30 */ +/* 31 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8622,7 +8935,7 @@ function KalturaRuleAction(data) { exports.default = KalturaRuleAction; /***/ }), -/* 31 */ +/* 32 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8713,7 +9026,7 @@ var KalturaUiConfResponse = function (_ServiceResult) { exports.default = KalturaUiConfResponse; /***/ }), -/* 32 */ +/* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8833,7 +9146,7 @@ var BaseEntryService = function (_OvpService) { exports.default = BaseEntryService; /***/ }), -/* 33 */ +/* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8909,7 +9222,7 @@ var MetaDataService = function (_OvpService) { exports.default = MetaDataService; /***/ }), -/* 34 */ +/* 35 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8982,8 +9295,8 @@ var SessionService = function (_OvpService) { exports.default = SessionService; /***/ }), -/* 35 */, -/* 36 */ +/* 36 */, +/* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9061,7 +9374,7 @@ var UiConfService = function (_OvpService) { exports.default = UiConfService; /***/ }), -/* 37 */ +/* 38 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -9136,6 +9449,60 @@ exports.default = XmlParser; }); +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setup = exports.PlaykitUI = exports.OvpProvider = exports.Playkit = undefined; + +var _playkitJs = __webpack_require__(0); + +var Playkit = _interopRequireWildcard(_playkitJs); + +var _ovpProvider = __webpack_require__(1); + +var _ovpProvider2 = _interopRequireDefault(_ovpProvider); + +var _playkitJsUi = __webpack_require__(3); + +var _playkitJsUi2 = _interopRequireDefault(_playkitJsUi); + +__webpack_require__(4); + +__webpack_require__(9); + +__webpack_require__(11); + +var _setup = __webpack_require__(13); + +var _setup2 = _interopRequireDefault(_setup); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +// TODO: Import plugins + +// Import OVP and OTT providers +exports.Playkit = Playkit; +exports.OvpProvider = _ovpProvider2.default; +exports.PlaykitUI = _playkitJsUi2.default; +exports.setup = _setup2.default; + +// Import media source adapters + + +// Import UI + + +// Import core + /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { @@ -10983,11 +11350,11 @@ function n(n){return n&&"object"==typeof n&&"default"in n?n.default:n}function t "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(12); +/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(13); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(41); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(42); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(43); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(16); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(17); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(7); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return __WEBPACK_IMPORTED_MODULE_0__createStore__["b"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return __WEBPACK_IMPORTED_MODULE_1__combineReducers__["a"]; }); @@ -11012,7 +11379,7 @@ if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' } -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(11))) +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(12))) /***/ }), /* 7 */ @@ -11192,6 +11559,48 @@ var actions = exports.actions = { /***/ }), /* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var types = exports.types = { + TOGGLE_CVAA_OVERLAY: 'share/TOGGLE_CVAA_OVERLAY' +}; + +var initialState = exports.initialState = { + overlayOpen: false +}; + +exports.default = function () { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + var action = arguments[1]; + + switch (action.type) { + case types.TOGGLE_CVAA_OVERLAY: + return _extends({}, state, { + overlayOpen: action.show + }); + + default: + return state; + } +}; + +var actions = exports.actions = { + toggleCVAAOverlay: function toggleCVAAOverlay(show) { + return { type: types.TOGGLE_CVAA_OVERLAY, show: show }; + } +}; + +/***/ }), +/* 12 */ /***/ (function(module, exports) { // shim for using process in browser @@ -11381,13 +11790,13 @@ process.umask = function() { return 0; }; /***/ }), -/* 12 */ +/* 13 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionTypes; }); /* harmony export (immutable) */ __webpack_exports__["b"] = createStore; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(14); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(37); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_symbol_observable__); @@ -11640,7 +12049,7 @@ var ActionTypes = { } /***/ }), -/* 13 */ +/* 14 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -11712,7 +12121,7 @@ function isPlainObject(value) { /***/ }), -/* 14 */ +/* 15 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -11726,7 +12135,7 @@ var Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].Symbol; /***/ }), -/* 15 */ +/* 16 */ /***/ (function(module, exports) { var g; @@ -11753,7 +12162,7 @@ module.exports = g; /***/ }), -/* 16 */ +/* 17 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -11792,7 +12201,7 @@ function compose() { } /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11927,7 +12336,7 @@ var actions = exports.actions = { }; /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11989,7 +12398,7 @@ var actions = exports.actions = { }; /***/ }), -/* 19 */ +/* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12051,7 +12460,7 @@ var actions = exports.actions = { }; /***/ }), -/* 20 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12092,7 +12501,7 @@ var actions = exports.actions = { }; /***/ }), -/* 21 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12133,48 +12542,6 @@ var actions = exports.actions = { } }; -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var types = exports.types = { - TOGGLE_CVAA_OVERLAY: 'share/TOGGLE_CVAA_OVERLAY' -}; - -var initialState = exports.initialState = { - overlayOpen: false -}; - -exports.default = function () { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; - var action = arguments[1]; - - switch (action.type) { - case types.TOGGLE_CVAA_OVERLAY: - return _extends({}, state, { - overlayOpen: action.show - }); - - default: - return state; - } -}; - -var actions = exports.actions = { - toggleCVAAOverlay: function toggleCVAAOverlay(show) { - return { type: types.TOGGLE_CVAA_OVERLAY, show: show }; - } -}; - /***/ }), /* 23 */ /***/ (function(module, exports, __webpack_require__) { @@ -12410,9 +12777,14 @@ var Overlay = (_dec = (0, _preactRedux.connect)(null, (0, _bindActions.bindActio } _createClass(Overlay, [{ - key: 'componentDidUpdate', - value: function componentDidUpdate() { - this.props.open ? this.props.addPlayerClass('overlay-active') : this.props.removePlayerClass('overlay-active'); + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.props.removePlayerClass('overlay-active'); + } + }, { + key: 'componentWillMount', + value: function componentWillMount() { + this.props.addPlayerClass('overlay-active'); } }, { key: 'render', @@ -12669,7 +13041,7 @@ exports.default = UIManager; /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(14); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(15); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(33); @@ -12729,14 +13101,14 @@ var freeGlobal = typeof global == 'object' && global && global.Object === Object /* harmony default export */ __webpack_exports__["a"] = (freeGlobal); -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(15))) +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(16))) /***/ }), /* 32 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(14); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(15); /** Used for built-in method references. */ @@ -12927,7 +13299,7 @@ if (typeof self !== 'undefined') { var result = (0, _ponyfill2['default'])(root); exports['default'] = result; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15), __webpack_require__(39)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16), __webpack_require__(39)(module))) /***/ }), /* 39 */ @@ -12992,8 +13364,8 @@ function symbolObservablePonyfill(root) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = combineReducers; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(12); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(14); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(7); @@ -13125,7 +13497,7 @@ function combineReducers(reducers) { return hasChanged ? nextState : state; }; } -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(11))) +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(12))) /***/ }), /* 42 */ @@ -13192,7 +13564,7 @@ function bindActionCreators(actionCreators, dispatch) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = applyMiddleware; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(16); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(17); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -13261,7 +13633,7 @@ Object.defineProperty(exports, "__esModule", { var _redux = __webpack_require__(6); -var _engine = __webpack_require__(17); +var _engine = __webpack_require__(18); var _engine2 = _interopRequireDefault(_engine); @@ -13273,19 +13645,19 @@ var _playPause = __webpack_require__(9); var _playPause2 = _interopRequireDefault(_playPause); -var _seekbar = __webpack_require__(18); +var _seekbar = __webpack_require__(19); var _seekbar2 = _interopRequireDefault(_seekbar); -var _volume = __webpack_require__(19); +var _volume = __webpack_require__(20); var _volume2 = _interopRequireDefault(_volume); -var _fullscreen = __webpack_require__(20); +var _fullscreen = __webpack_require__(21); var _fullscreen2 = _interopRequireDefault(_fullscreen); -var _loading = __webpack_require__(21); +var _loading = __webpack_require__(22); var _loading2 = _interopRequireDefault(_loading); @@ -13293,7 +13665,7 @@ var _share = __webpack_require__(10); var _share2 = _interopRequireDefault(_share); -var _cvaa = __webpack_require__(22); +var _cvaa = __webpack_require__(11); var _cvaa2 = _interopRequireDefault(_cvaa); @@ -13345,8 +13717,8 @@ module.exports = { "advanced_captions_settings": "Advanced captions settings" }, "share": { - "share_title": "Partager", - "link_options": "Options de lien" + "share_title": "Share", + "link_options": "Link options" } }; @@ -13371,7 +13743,7 @@ var _preactRedux = __webpack_require__(1); var _bindActions = __webpack_require__(3); -var _engine = __webpack_require__(17); +var _engine = __webpack_require__(18); var _engine2 = _interopRequireDefault(_engine); @@ -13414,9 +13786,17 @@ var EngineConnector = (_dec = (0, _preactRedux.connect)(_engine2.default, (0, _b _this2.props.updateMetadataLoadingStatus(true); var TrackType = _this2.player.Track; - var audioTracks = _this2.player.getTracks(TrackType.AUDIO); - var videoTracks = _this2.player.getTracks(TrackType.VIDEO); - var textTracks = _this2.player.getTracks(TrackType.TEXT); + var tracks = _this2.player.getTracks(); + var audioTracks = tracks.filter(function (t) { + return t.constructor.name === 'AudioTrack'; + }); + var videoTracks = tracks.filter(function (t) { + return t.constructor.name === 'VideoTrack'; + }); + var textTracks = tracks.filter(function (t) { + return t.constructor.name === 'TextTrack'; + }); + _this2.props.updateAudioTracks(audioTracks); _this2.props.updateVideoTracks(videoTracks); _this2.props.updateTextTracks(textTracks); @@ -13986,7 +14366,7 @@ var _preactRedux = __webpack_require__(1); var _bindActions = __webpack_require__(3); -var _loading = __webpack_require__(21); +var _loading = __webpack_require__(22); var _base = __webpack_require__(2); @@ -14172,7 +14552,7 @@ var _preactRedux = __webpack_require__(1); var _bindActions = __webpack_require__(3); -var _seekbar = __webpack_require__(18); +var _seekbar = __webpack_require__(19); var _base = __webpack_require__(2); @@ -14347,7 +14727,7 @@ var _preactRedux = __webpack_require__(1); var _bindActions = __webpack_require__(3); -var _volume = __webpack_require__(19); +var _volume = __webpack_require__(20); var _base = __webpack_require__(2); @@ -14455,8 +14835,6 @@ var VolumeControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bind if (this.props.isDraggingActive) controlButtonClass += ' dragging-active'; if (this.props.muted || this.props.volume === 0) controlButtonClass += ' is-muted'; - if (!this.props.isMobile) return false; - return (0, _preact.h)( 'div', { className: controlButtonClass }, @@ -14657,6 +15035,10 @@ var SettingsControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bi var _this2 = this; var speedOptions = [{ value: 1, label: 'Auto (360)', active: true }, { value: 2, label: '240' }, { value: 3, label: '144' }]; + var qualityOptions = props.videoTracks.map(function (t) { + return { label: t.label || t.language, active: t.active, value: t }; + }); + return (0, _preact.h)( 'div', { className: 'control-button-container control-settings' }, @@ -14746,9 +15128,17 @@ var DropDownMenu = function (_Component) { }, { key: 'onSelect', value: function onSelect(o) { - this.props.onSelect(o); + this.props.onSelect(o.value); this.setState({ dropMenuActive: false }); } + }, { + key: 'getActiveOptionLabel', + value: function getActiveOptionLabel() { + var activeOptions = this.props.options.filter(function (t) { + return t.active; + }); + return activeOptions.length > 0 ? activeOptions[0].label : this.props.options[0].label; + } }, { key: 'render', value: function render(props) { @@ -14762,11 +15152,7 @@ var DropDownMenu = function (_Component) { { className: 'dropdown-button', onClick: function onClick() { return _this2.setState({ dropMenuActive: !_this2.state.dropMenuActive }); } }, - props.options.filter(function (t) { - return t.active; - }).length > 0 ? props.options.filter(function (t) { - return t.active; - })[0].label : '' + this.getActiveOptionLabel() ), !this.state.dropMenuActive ? '' : (0, _preact.h)( 'div', @@ -14816,6 +15202,10 @@ var _preactI18n = __webpack_require__(5); var _preactRedux = __webpack_require__(1); +var _bindActions = __webpack_require__(3); + +var _cvaa = __webpack_require__(11); + var _base = __webpack_require__(2); var _base2 = _interopRequireDefault(_base); @@ -14843,11 +15233,12 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" var mapStateToProps = function mapStateToProps(state) { return { audioTracks: state.engine.audioTracks, - textTracks: state.engine.textTracks + textTracks: state.engine.textTracks, + overlayOpen: state.cvaa.overlayOpen }; }; -var LanguageControl = (_dec = (0, _preactRedux.connect)(mapStateToProps), _dec(_class = function (_BaseComponent) { +var LanguageControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_cvaa.actions)), _dec(_class = function (_BaseComponent) { _inherits(LanguageControl, _BaseComponent); function LanguageControl(obj) { @@ -14883,6 +15274,13 @@ var LanguageControl = (_dec = (0, _preactRedux.connect)(mapStateToProps), _dec(_ value: function render(props) { var _this2 = this; + var audioOptions = props.audioTracks.map(function (t) { + return { label: t.label || t.language, active: t.active, value: t }; + }); + var textOptions = props.textTracks.map(function (t) { + return { label: t.label || t.language, active: t.active, value: t }; + }); + return props.audioTracks.length === 0 && props.audioTracks.length === 0 ? false : (0, _preact.h)( 'div', { className: 'control-button-container control-language' }, @@ -14903,14 +15301,14 @@ var LanguageControl = (_dec = (0, _preactRedux.connect)(mapStateToProps), _dec(_ props.audioTracks.length <= 0 ? '' : (0, _preact.h)( _preactI18n.Localizer, null, - (0, _preact.h)(_smartContainerItem2.default, { label: (0, _preact.h)(_preactI18n.Text, { id: 'language.audio' }), options: props.audioTracks, onSelect: function onSelect(audioTrack) { + (0, _preact.h)(_smartContainerItem2.default, { label: (0, _preact.h)(_preactI18n.Text, { id: 'language.audio' }), options: audioOptions, onSelect: function onSelect(audioTrack) { return _this2.onAudioChange(audioTrack); } }) ), props.textTracks.length <= 0 ? '' : (0, _preact.h)( _preactI18n.Localizer, null, - (0, _preact.h)(_smartContainerItem2.default, { label: (0, _preact.h)(_preactI18n.Text, { id: 'language.captions' }), options: props.textTracks, onSelect: function onSelect(textTrack) { + (0, _preact.h)(_smartContainerItem2.default, { label: (0, _preact.h)(_preactI18n.Text, { id: 'language.captions' }), options: textOptions, onSelect: function onSelect(textTrack) { return _this2.onCaptionsChange(textTrack); } }) ), @@ -14919,7 +15317,9 @@ var LanguageControl = (_dec = (0, _preactRedux.connect)(mapStateToProps), _dec(_ { className: 'smart-container-item' }, (0, _preact.h)( 'a', - { href: '#' }, + { onClick: function onClick() { + return props.toggleCVAAOverlay(!props.overlayOpen); + } }, (0, _preact.h)( _preactI18n.Text, { id: 'language.advanced_captions_settings' }, @@ -14959,7 +15359,7 @@ var _preactRedux = __webpack_require__(1); var _bindActions = __webpack_require__(3); -var _fullscreen = __webpack_require__(20); +var _fullscreen = __webpack_require__(21); var _base = __webpack_require__(2); @@ -15396,7 +15796,7 @@ var _preactRedux = __webpack_require__(1); var _bindActions = __webpack_require__(3); -var _cvaa = __webpack_require__(22); +var _cvaa = __webpack_require__(11); var _base = __webpack_require__(2); @@ -15434,7 +15834,9 @@ var CVAAOverlay = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindAc value: function render(props) { return !props.open ? '' : (0, _preact.h)( _overlay2.default, - { type: 'cvaa' }, + { open: props.open, onClose: function onClose() { + return props.toggleCVAAOverlay(false); + }, type: 'cvaa' }, (0, _preact.h)( 'div', { className: 'title' }, @@ -15442,18 +15844,27 @@ var CVAAOverlay = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindAc ), (0, _preact.h)( 'div', - { className: 'sample' }, - 'Sample' - ), - (0, _preact.h)( - 'div', - { className: 'sample black-bg' }, - 'Sample' + null, + (0, _preact.h)( + 'div', + { className: 'sample' }, + 'Sample' + ), + (0, _preact.h)( + 'div', + { className: 'sample black-bg' }, + 'Sample' + ), + (0, _preact.h)( + 'div', + { className: 'sample yellow-text' }, + 'Sample' + ) ), (0, _preact.h)( - 'div', - { className: 'sample yellow-text' }, - 'Sample' + 'a', + { className: 'button-save-cvaa' }, + 'Set custom caption' ) ); } @@ -15618,7 +16029,7 @@ exports = module.exports = __webpack_require__(6)(undefined); // module -exports.push([module.i, ".row{display:block}.row:after{content:'';clear:both;display:block}.form-group{margin:10px auto;position:relative;max-width:100%}.form-group.has-error .form-control{border-color:#db1f26}.form-group.has-error .form-control:focus{border-color:#fff}.form-group.has-icon .form-control{padding-left:34px}.form-group .icon{position:absolute;top:2px;left:2px;fill:rgba(255,255,255,0.4)}.form-control{height:36px;width:100%;min-width:72px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(0,0,0,0.4);font-size:15px;line-height:18px;color:#fff;padding:8px 10px;text-overflow:ellipsis}.form-control::-webkit-input-placeholder{color:rgba(255,255,255,0.6)}.form-control:focus{background-color:#fff;border-color:#fff;color:#333}.form-control:focus::-webkit-input-placeholder{color:#ccc}.form-control:focus+.icon{fill:#999}textarea.form-control{min-height:72px}@-webkit-keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.dropdown{position:relative}.dropdown.active .dropdown-menu{display:block;opacity:1}.dropdown.top .dropdown-menu{margin-bottom:10px;bottom:100%}.dropdown.bottom .dropdown-menu{margin-top:10px;top:100%}.dropdown.right .dropdown-menu{left:0}.dropdown.left .dropdown-menu{right:0}.dropdown .dropdown-button{font-size:15px;font-weight:bold;line-height:18px;color:#fff;cursor:pointer}.dropdown .dropdown-menu{display:block;opacity:1;position:absolute;background-color:#333333;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;padding:6px 0;z-index:5;-webkit-animation:openDropmenu 100ms ease-out forwards;animation:openDropmenu 100ms ease-out forwards;max-height:173px;overflow-y:auto}.dropdown .dropdown-menu .dropdown-menu-item{padding:2px 10px 2px 16px;white-space:nowrap;min-height:30px;cursor:pointer}.dropdown .dropdown-menu .dropdown-menu-item:hover{color:#fff}.dropdown .dropdown-menu .dropdown-menu-item.active{color:#01ACCD;fill:#01ACCD}.dropdown .dropdown-menu .dropdown-menu-item .check-icon{display:inline-block;margin-left:16px;vertical-align:middle;width:24px;height:24px}.dropdown .dropdown-menu .dropdown-menu-item span{vertical-align:middle;line-height:26px}.tooltip{display:inline-block;height:22px;border-radius:4px;background-color:#FFFFFF;padding:3px 13px;color:#333333;font-size:13px;font-weight:bold;line-height:16px;box-shadow:0 0 8px 0 rgba(0,0,0,0.3)}.player .control-button{width:32px;height:32px;background:transparent;display:inline-block;opacity:0.8;border:none;padding:0;cursor:pointer;fill:#fff}.player .control-button svg{width:32px;height:32px}.player .control-button:hover,.player .control-button.active{opacity:1}.player .control-button.control-button-rounded{width:36px;height:36px;padding:2px}.player .control-button.control-button-rounded:hover{background-color:rgba(0,0,0,0.4);border-radius:18px}.player .control-button-container{display:inline-block;position:relative;vertical-align:top}a{color:#01ACCD;text-decoration:underline;font-size:15px;line-height:18px}a:hover{color:#01819a}a:active{opacity:0.7}.player{position:relative;max-width:854px;width:100%;background-color:#000;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.player:-webkit-full-screen{width:100%;height:100%;max-width:none}.player *{box-sizing:border-box;outline:none}.player ::-moz-selection{background-color:rgba(0,0,0,0.1)}.player ::selection{background-color:rgba(0,0,0,0.1)}.player video{width:100%}.player .player-gui{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;overflow:hidden;font-size:0;font-family:\"Lato\",sans-serif}.player .player-gui input,.player .player-gui textarea{font-family:\"Lato\",sans-serif}.player.metadata-loaded .player-gui,.player.state-paused .player-gui,.player.overlay-active .player-gui,.player.menu-active .player-gui{opacity:1}video::-webkit-media-controls{display:none !important}video::-webkit-media-controls-start-playback-button{display:none !important;-webkit-appearance:none}@-webkit-keyframes openOverlay{from{opacity:0}to{opacity:1}}@keyframes openOverlay{from{opacity:0}to{opacity:1}}.overlay{position:absolute;display:none;opacity:0;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.42);z-index:4;text-align:center;color:#fff;padding:80px 20px 0;-webkit-animation:openOverlay 100ms ease-in-out forwards;animation:openOverlay 100ms ease-in-out forwards}.overlay.active{display:block;opacity:1}.overlay .title{font-size:24px;font-weight:bold;line-height:29px;margin-bottom:60px}.overlay .close-overlay{position:absolute;top:48px;right:48px;z-index:5;fill:#fff;cursor:pointer}.overlay .close-overlay .icon-close{width:24px;height:24px}@media screen and (max-width: 768px){.overlay{padding:36px 20px 0}.overlay .close-overlay{top:38px}.overlay .title{margin-bottom:24px}}@media screen and (max-width: 480px){.overlay{padding:16px 24px 0}.overlay .close-overlay{top:15px;right:24px}.overlay .title{font-size:16px;line-height:19px;margin-bottom:36px}}@-webkit-keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.smart-container{background-color:#222222;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;position:absolute;right:0px;min-width:193px;font-size:15px;z-index:5;display:block;-webkit-animation:openSmartContainer 100ms ease-out forwards;animation:openSmartContainer 100ms ease-out forwards}.smart-container.top{bottom:100%;margin-bottom:6px}.smart-container.top:before{display:block;content:' ';position:absolute;bottom:-6px;left:0;width:100%;height:6px}.smart-container.bottom{top:100%;margin-top:6px}.smart-container.right{left:0px}.smart-container.left{right:0px}.smart-container .smart-container-item{margin:16px;color:rgba(244,244,244,0.8);white-space:nowrap}.smart-container .smart-container-item:after{display:block;content:' ';clear:both}.smart-container .smart-container-item.select-menu-item label{float:left}.smart-container .smart-container-item.select-menu-item .dropdown{float:right}.overlay.share-overlay .share-icons{margin:60px 0}.overlay.share-overlay .share-btn{height:36px;width:36px;border-radius:18px;background-color:rgba(0,0,0,0.4);display:inline-block;margin:0 8px;-webkit-transition:-webkit-transform 100ms;transition:transform 100ms;will-change:transform;padding:2px}.overlay.share-overlay .share-btn:hover{-webkit-transform:scale(1.1667);-ms-transform:scale(1.1667);transform:scale(1.1667)}.overlay.share-overlay .share-btn.facebook-share-btn{background-color:#3B5998}.overlay.share-overlay .share-btn.twitter-share-btn{background-color:#1DA1F2}.overlay.share-overlay .share-btn.google-plus-share-btn{background-color:#DD4B39}.overlay.share-overlay .share-btn.linkedin-share-btn{background-color:#00A0DC}@media screen and (max-width: 768px){.overlay.share-overlay .share-icons{margin:40px 0}}@media screen and (max-width: 480px){.overlay.share-overlay .share-icons{margin:20px 0}}.overlay.cvaa-overlay .sample{border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:36px;text-align:center;padding:0 28px;display:inline-block;margin:0 12px;cursor:pointer}.overlay.cvaa-overlay .sample.black-bg{background-color:#000}.overlay.cvaa-overlay .sample.yellow-text{color:#FAFF00}@-webkit-keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}@keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}.loading-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.3);-webkit-transition:100ms opacity;transition:100ms opacity;opacity:0}.loading-backdrop.show{opacity:1}.loading-backdrop.show .spinner-container{display:block}.loading-backdrop .spinner-container{display:none;position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50px, -50px, 0);transform:translate3d(-50px, -50px, 0)}.spinner{width:100px;height:100px;position:relative;-webkit-animation:kaltura-spinner 2.5s infinite;animation:kaltura-spinner 2.5s infinite}.spinner span{width:8px;height:8px;background-color:#fff;display:block;border-radius:8px;position:absolute;top:50%;left:50%;margin-top:-4px;margin-left:-4px}.spinner span:nth-child(1){-webkit-transform:rotate(45deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(45deg) translateX(-25px) translateY(-25px);transform:rotate(45deg) translateX(-25px) translateY(-25px);background-color:#da1f26}.spinner span:nth-child(2){-webkit-transform:rotate(90deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(90deg) translateX(-25px) translateY(-25px);transform:rotate(90deg) translateX(-25px) translateY(-25px);background-color:#06a885}.spinner span:nth-child(3){-webkit-transform:rotate(135deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(135deg) translateX(-25px) translateY(-25px);transform:rotate(135deg) translateX(-25px) translateY(-25px);background-color:#009344}.spinner span:nth-child(4){-webkit-transform:rotate(180deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(180deg) translateX(-25px) translateY(-25px);transform:rotate(180deg) translateX(-25px) translateY(-25px);background-color:#f8a61a}.spinner span:nth-child(5){-webkit-transform:rotate(225deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(225deg) translateX(-25px) translateY(-25px);transform:rotate(225deg) translateX(-25px) translateY(-25px);background-color:#1b4a97}.spinner span:nth-child(6){-webkit-transform:rotate(270deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(270deg) translateX(-25px) translateY(-25px);transform:rotate(270deg) translateX(-25px) translateY(-25px);background-color:#00abcc}.spinner span:nth-child(7){-webkit-transform:rotate(315deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(315deg) translateX(-25px) translateY(-25px);transform:rotate(315deg) translateX(-25px) translateY(-25px);background-color:#b1d238}.spinner span:nth-child(8){-webkit-transform:rotate(360deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(360deg) translateX(-25px) translateY(-25px);transform:rotate(360deg) translateX(-25px) translateY(-25px);background-color:#fcd203}.control-button-container.control-play-pause .control-button{-webkit-transition:400ms -webkit-transform;transition:400ms transform}.control-button-container.control-play-pause .control-button .icon-pause{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:0;display:none}.control-button-container.control-play-pause .control-button .icon-play{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}.control-button-container.control-play-pause .control-button.is-playing .icon-pause{opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing .icon-play{opacity:0;display:none}@media screen and (max-width: 480px){.control-button-container.control-play-pause{display:none}}.control-button-container.volume-control:hover .volume-control-bar{display:block !important}.control-button-container.volume-control.is-muted .volume-waves{opacity:0;-webkit-transform:translateX(-5px);-ms-transform:translateX(-5px);transform:translateX(-5px)}.control-button-container.volume-control.is-muted .volume-mute{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.volume-control.dragging-active .volume-control-bar{display:block}.control-button-container.volume-control .volume-waves{-webkit-transform:translateX(0px);-ms-transform:translateX(0px);transform:translateX(0px)}.control-button-container.volume-control .volume-mute{opacity:1;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.control-button-container.volume-control .volume-waves,.control-button-container.volume-control .volume-mute{-webkit-transition:300ms -webkit-transform, 300ms opacity;transition:300ms transform, 300ms opacity}.control-button-container.volume-control svg{position:absolute;top:0;left:0}.volume-control-bar{position:absolute;z-index:2;bottom:38px;left:0px;display:block;height:112px;width:34px;border-radius:4px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);background-color:#333333;padding:6px;display:none}.volume-control-bar:before{position:absolute;width:34px;height:14px;bottom:-8px;left:0;content:' ';display:block}.volume-control-bar .bar{background-color:#424242;height:100%;position:relative;cursor:ns-resize}.volume-control-bar .progress{position:absolute;bottom:0px;left:0px;width:100%;border-radius:0 0 2px 2px;background-color:#01ACCD}.control-button-container.control-fullscreen .control-button{-webkit-transition:100ms -webkit-transform;transition:100ms transform;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.control-fullscreen .control-button .icon-minimize{display:none}.control-button-container.control-fullscreen .control-button:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-maximize{display:none}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-minimize{display:block}.player .seek-bar{padding:6px 0;cursor:pointer}.player .seek-bar:hover .progress-bar .scrubber,.player .seek-bar.dragging-active .progress-bar .scrubber{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.player .seek-bar:hover .progress-bar .virtual-progress,.player .seek-bar.dragging-active .progress-bar .virtual-progress{display:block}.player .seek-bar .progress-bar{height:4px;background-color:rgba(255,255,255,0.3);border-radius:2px;position:relative}.player .seek-bar .progress-bar .progress{position:absolute;top:0;left:0;height:100%;z-index:2;border-radius:2px 0 0 2px;background-color:#01ACCD}.player .seek-bar .progress-bar .virtual-progress{display:none}.player .seek-bar .progress-bar .buffered,.player .seek-bar .progress-bar .virtual-progress{position:absolute;top:0;left:0;height:100%;z-index:1;border-radius:2px 0 0 2px;background-color:rgba(255,255,255,0.3)}.player .seek-bar .progress-bar .buffered .frame-preview-img,.player .seek-bar .progress-bar .virtual-progress .frame-preview-img{background-size:auto 100%;width:100%;height:100%;position:relative}.player .seek-bar .progress-bar .buffered .frame-preview,.player .seek-bar .progress-bar .virtual-progress .frame-preview{position:absolute;bottom:16px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:94px;width:164px;border:2px solid rgba(255,255,255,0.2);border-radius:4px}.player .seek-bar .progress-bar .buffered .time-preview,.player .seek-bar .progress-bar .virtual-progress .time-preview{position:absolute;bottom:22px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:22px;min-width:48px;padding:0 3px;text-align:center;border-radius:3px;background-color:rgba(0,0,0,0.7);font-size:13px;font-weight:bold;line-height:22px;color:#fff}.player .seek-bar .progress-bar .scrubber{position:absolute;z-index:3;cursor:pointer;display:block;top:-6px;right:-8px;border-radius:8px;height:16px;width:16px;background-color:#FFFFFF;box-shadow:0 0 31px 0 rgba(0,0,0,0.3);-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:100ms -webkit-transform;transition:100ms transform}.player .seek-bar .progress-bar .scrubber:active{opacity:1;cursor:-webkit-grabbing;cursor:grabbing}@media screen and (max-width: 480px){.virtual-progress{display:none}}.player .time-display{display:inline-block;line-height:32px;vertical-align:top;font-size:14px;padding:0 23px;font-weight:bold}@media screen and (max-width: 480px){.player .time-display{padding:0 12px 0 0}}.player .video-playing-title{font-size:15px;font-weight:bold;line-height:18px;padding:6px 0}.player .bottom-bar{position:absolute;bottom:0;left:0;width:100%;background:-webkit-linear-gradient(270deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:6px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .bottom-bar .left-controls{float:left;text-align:left}.player .bottom-bar .right-controls{float:right;text-align:left}.player .bottom-bar .right-controls .control-button-container{margin:0 6px}.player .bottom-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .bottom-bar,.player.hover .bottom-bar,.player.state-paused .bottom-bar,.player.menu-active .bottom-bar{opacity:1}.player.overlay-active .bottom-bar{opacity:0}@media screen and (max-width: 480px){.player .bottom-bar{padding:6px 8px}}.player .top-bar{position:absolute;top:0;left:0;width:100%;background:-webkit-linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(0deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:14px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .top-bar .left-controls{float:left;text-align:left}.player .top-bar .right-controls{float:right;text-align:left}.player .top-bar .right-controls .control-button-container{margin:0 6px}.player .top-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .top-bar,.player.hover .top-bar,.player.state-paused .top-bar,.player.menu-active .top-bar{opacity:1}.player.overlay-active .top-bar{opacity:0}@media screen and (max-width: 480px){.player .top-bar{padding:8px 8px 20px 8px}}@-webkit-keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}@keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}.overlay-play{position:absolute;top:0;left:0;width:100%;height:100%}.overlay-play.in .icon{-webkit-animation:overlayPlayIconIn 400ms linear forwards;animation:overlayPlayIconIn 400ms linear forwards}.overlay-play .icon{width:144px;height:144px;fill:#fff;position:absolute;top:50%;left:50%;margin:-72px 0 0 -72px;opacity:0}", ""]); +exports.push([module.i, ".row{display:block}.row:after{content:'';clear:both;display:block}.form-group{margin:10px auto;position:relative;max-width:100%}.form-group.has-error .form-control{border-color:#db1f26}.form-group.has-error .form-control:focus{border-color:#fff}.form-group.has-icon .form-control{padding-left:34px}.form-group .icon{position:absolute;top:2px;left:2px;fill:rgba(255,255,255,0.4)}.form-control{height:36px;width:100%;min-width:72px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(0,0,0,0.4);font-size:15px;line-height:18px;color:#fff;padding:8px 10px;text-overflow:ellipsis}.form-control::-webkit-input-placeholder{color:rgba(255,255,255,0.6)}.form-control:focus{background-color:#fff;border-color:#fff;color:#333}.form-control:focus::-webkit-input-placeholder{color:#ccc}.form-control:focus+.icon{fill:#999}textarea.form-control{min-height:72px}@-webkit-keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.dropdown{position:relative}.dropdown.active .dropdown-menu{display:block;opacity:1}.dropdown.top .dropdown-menu{margin-bottom:10px;bottom:100%}.dropdown.bottom .dropdown-menu{margin-top:10px;top:100%}.dropdown.right .dropdown-menu{left:0}.dropdown.left .dropdown-menu{right:0}.dropdown .dropdown-button{font-size:15px;font-weight:bold;line-height:18px;color:#fff;cursor:pointer}.dropdown .dropdown-menu{display:block;opacity:1;position:absolute;background-color:#333333;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;padding:6px 0;z-index:5;-webkit-animation:openDropmenu 100ms ease-out forwards;animation:openDropmenu 100ms ease-out forwards;max-height:173px;overflow-y:auto}.dropdown .dropdown-menu .dropdown-menu-item{padding:2px 10px 2px 16px;white-space:nowrap;min-height:30px;cursor:pointer}.dropdown .dropdown-menu .dropdown-menu-item:hover{color:#fff}.dropdown .dropdown-menu .dropdown-menu-item.active{color:#01ACCD;fill:#01ACCD}.dropdown .dropdown-menu .dropdown-menu-item .check-icon{display:inline-block;margin-left:16px;vertical-align:middle;width:24px;height:24px}.dropdown .dropdown-menu .dropdown-menu-item span{vertical-align:middle;line-height:26px}.tooltip{display:inline-block;height:22px;border-radius:4px;background-color:#FFFFFF;padding:3px 13px;color:#333333;font-size:13px;font-weight:bold;line-height:16px;box-shadow:0 0 8px 0 rgba(0,0,0,0.3)}.player .control-button{width:32px;height:32px;background:transparent;display:inline-block;opacity:0.8;border:none;padding:0;cursor:pointer;fill:#fff}.player .control-button svg{width:32px;height:32px}.player .control-button:hover,.player .control-button.active{opacity:1}.player .control-button.control-button-rounded{width:36px;height:36px;padding:2px}.player .control-button.control-button-rounded:hover{background-color:rgba(0,0,0,0.4);border-radius:18px}.player .control-button-container{display:inline-block;position:relative;vertical-align:top}a{color:#01ACCD;text-decoration:underline;font-size:15px;line-height:18px}a:hover{color:#01819a}a:active{opacity:0.7}.player{position:relative;max-width:854px;width:100%;background-color:#000;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.player:-webkit-full-screen{width:100%;height:100%;max-width:none}.player *{box-sizing:border-box;outline:none}.player ::-moz-selection{background-color:rgba(0,0,0,0.1)}.player ::selection{background-color:rgba(0,0,0,0.1)}.player video{width:100%}.player .player-gui{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;overflow:hidden;font-size:0;font-family:\"Lato\",sans-serif}.player .player-gui input,.player .player-gui textarea{font-family:\"Lato\",sans-serif}.player.metadata-loaded .player-gui,.player.state-paused .player-gui,.player.overlay-active .player-gui,.player.menu-active .player-gui{opacity:1}video::-webkit-media-controls{display:none !important}video::-webkit-media-controls-start-playback-button{display:none !important;-webkit-appearance:none}video::cue{background-color:transparent}.player.captions-yellow-text video::cue{color:#FAFF00}.player.captions-black-bg video::cue{background-color:#000}@-webkit-keyframes openOverlay{from{opacity:0}to{opacity:1}}@keyframes openOverlay{from{opacity:0}to{opacity:1}}.overlay{position:absolute;display:none;opacity:0;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.42);z-index:4;text-align:center;color:#fff;padding:80px 20px 0;-webkit-animation:openOverlay 100ms ease-in-out forwards;animation:openOverlay 100ms ease-in-out forwards}.overlay.active{display:block;opacity:1}.overlay .title{font-size:24px;font-weight:bold;line-height:29px;margin-bottom:60px}.overlay .close-overlay{position:absolute;top:48px;right:48px;z-index:5;fill:#fff;cursor:pointer}.overlay .close-overlay .icon-close{width:24px;height:24px}@media screen and (max-width: 768px){.overlay{padding:36px 20px 0}.overlay .close-overlay{top:38px}.overlay .title{margin-bottom:24px}}@media screen and (max-width: 480px){.overlay{padding:16px 24px 0}.overlay .close-overlay{top:15px;right:24px}.overlay .title{font-size:16px;line-height:19px;margin-bottom:36px}}@-webkit-keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.smart-container{background-color:#222222;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;position:absolute;right:0px;min-width:193px;font-size:15px;z-index:5;display:block;-webkit-animation:openSmartContainer 100ms ease-out forwards;animation:openSmartContainer 100ms ease-out forwards}.smart-container.top{bottom:100%;margin-bottom:6px}.smart-container.top:before{display:block;content:' ';position:absolute;bottom:-6px;left:0;width:100%;height:6px}.smart-container.bottom{top:100%;margin-top:6px}.smart-container.right{left:0px}.smart-container.left{right:0px}.smart-container .smart-container-item{margin:16px;color:rgba(244,244,244,0.8);white-space:nowrap}.smart-container .smart-container-item:after{display:block;content:' ';clear:both}.smart-container .smart-container-item.select-menu-item label{float:left}.smart-container .smart-container-item.select-menu-item .dropdown{float:right}.overlay.share-overlay .share-icons{margin:60px 0}.overlay.share-overlay .share-btn{height:36px;width:36px;border-radius:18px;background-color:rgba(0,0,0,0.4);display:inline-block;margin:0 8px;-webkit-transition:-webkit-transform 100ms;transition:transform 100ms;will-change:transform;padding:2px}.overlay.share-overlay .share-btn:hover{-webkit-transform:scale(1.1667);-ms-transform:scale(1.1667);transform:scale(1.1667)}.overlay.share-overlay .share-btn.facebook-share-btn{background-color:#3B5998}.overlay.share-overlay .share-btn.twitter-share-btn{background-color:#1DA1F2}.overlay.share-overlay .share-btn.google-plus-share-btn{background-color:#DD4B39}.overlay.share-overlay .share-btn.linkedin-share-btn{background-color:#00A0DC}@media screen and (max-width: 768px){.overlay.share-overlay .share-icons{margin:40px 0}}@media screen and (max-width: 480px){.overlay.share-overlay .share-icons{margin:20px 0}}.overlay.cvaa-overlay .sample{border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:36px;text-align:center;padding:0 31px;display:inline-block;margin:0 12px;cursor:pointer}.overlay.cvaa-overlay .sample.black-bg{background-color:#000}.overlay.cvaa-overlay .sample.yellow-text{color:#FAFF00}.overlay.cvaa-overlay .button-save-cvaa{margin-top:50px;height:40px;width:400px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:38px;text-align:center;display:inline-block;color:#fff;text-decoration:none;cursor:pointer}@-webkit-keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}@keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}.loading-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.3);-webkit-transition:100ms opacity;transition:100ms opacity;opacity:0}.loading-backdrop.show{opacity:1}.loading-backdrop.show .spinner-container{display:block}.loading-backdrop .spinner-container{display:none;position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50px, -50px, 0);transform:translate3d(-50px, -50px, 0)}.spinner{width:100px;height:100px;position:relative;-webkit-animation:kaltura-spinner 2.5s infinite;animation:kaltura-spinner 2.5s infinite}.spinner span{width:8px;height:8px;background-color:#fff;display:block;border-radius:8px;position:absolute;top:50%;left:50%;margin-top:-4px;margin-left:-4px}.spinner span:nth-child(1){-webkit-transform:rotate(45deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(45deg) translateX(-25px) translateY(-25px);transform:rotate(45deg) translateX(-25px) translateY(-25px);background-color:#da1f26}.spinner span:nth-child(2){-webkit-transform:rotate(90deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(90deg) translateX(-25px) translateY(-25px);transform:rotate(90deg) translateX(-25px) translateY(-25px);background-color:#06a885}.spinner span:nth-child(3){-webkit-transform:rotate(135deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(135deg) translateX(-25px) translateY(-25px);transform:rotate(135deg) translateX(-25px) translateY(-25px);background-color:#009344}.spinner span:nth-child(4){-webkit-transform:rotate(180deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(180deg) translateX(-25px) translateY(-25px);transform:rotate(180deg) translateX(-25px) translateY(-25px);background-color:#f8a61a}.spinner span:nth-child(5){-webkit-transform:rotate(225deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(225deg) translateX(-25px) translateY(-25px);transform:rotate(225deg) translateX(-25px) translateY(-25px);background-color:#1b4a97}.spinner span:nth-child(6){-webkit-transform:rotate(270deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(270deg) translateX(-25px) translateY(-25px);transform:rotate(270deg) translateX(-25px) translateY(-25px);background-color:#00abcc}.spinner span:nth-child(7){-webkit-transform:rotate(315deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(315deg) translateX(-25px) translateY(-25px);transform:rotate(315deg) translateX(-25px) translateY(-25px);background-color:#b1d238}.spinner span:nth-child(8){-webkit-transform:rotate(360deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(360deg) translateX(-25px) translateY(-25px);transform:rotate(360deg) translateX(-25px) translateY(-25px);background-color:#fcd203}.control-button-container.control-play-pause .control-button{-webkit-transition:400ms -webkit-transform;transition:400ms transform}.control-button-container.control-play-pause .control-button .icon-pause{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:0;display:none}.control-button-container.control-play-pause .control-button .icon-play{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}.control-button-container.control-play-pause .control-button.is-playing .icon-pause{opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing .icon-play{opacity:0;display:none}@media screen and (max-width: 480px){.control-button-container.control-play-pause{display:none}}.control-button-container.volume-control:hover .volume-control-bar{display:block !important}.control-button-container.volume-control.is-muted .volume-waves{opacity:0;-webkit-transform:translateX(-5px);-ms-transform:translateX(-5px);transform:translateX(-5px)}.control-button-container.volume-control.is-muted .volume-mute{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.volume-control.dragging-active .volume-control-bar{display:block}.control-button-container.volume-control .volume-waves{-webkit-transform:translateX(0px);-ms-transform:translateX(0px);transform:translateX(0px)}.control-button-container.volume-control .volume-mute{opacity:1;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.control-button-container.volume-control .volume-waves,.control-button-container.volume-control .volume-mute{-webkit-transition:300ms -webkit-transform, 300ms opacity;transition:300ms transform, 300ms opacity}.control-button-container.volume-control svg{position:absolute;top:0;left:0}.volume-control-bar{position:absolute;z-index:2;bottom:38px;left:0px;display:block;height:112px;width:34px;border-radius:4px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);background-color:#333333;padding:6px;display:none}.volume-control-bar:before{position:absolute;width:34px;height:14px;bottom:-8px;left:0;content:' ';display:block}.volume-control-bar .bar{background-color:#424242;height:100%;position:relative;cursor:ns-resize}.volume-control-bar .progress{position:absolute;bottom:0px;left:0px;width:100%;border-radius:0 0 2px 2px;background-color:#01ACCD}.control-button-container.control-fullscreen .control-button{-webkit-transition:100ms -webkit-transform;transition:100ms transform;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.control-fullscreen .control-button .icon-minimize{display:none}.control-button-container.control-fullscreen .control-button:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-maximize{display:none}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-minimize{display:block}.player .seek-bar{padding:6px 0;cursor:pointer}.player .seek-bar:hover .progress-bar .scrubber,.player .seek-bar.dragging-active .progress-bar .scrubber{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.player .seek-bar:hover .progress-bar .virtual-progress,.player .seek-bar.dragging-active .progress-bar .virtual-progress{display:block}.player .seek-bar .progress-bar{height:4px;background-color:rgba(255,255,255,0.3);border-radius:2px;position:relative}.player .seek-bar .progress-bar .progress{position:absolute;top:0;left:0;height:100%;z-index:2;border-radius:2px 0 0 2px;background-color:#01ACCD}.player .seek-bar .progress-bar .virtual-progress{display:none}.player .seek-bar .progress-bar .buffered,.player .seek-bar .progress-bar .virtual-progress{position:absolute;top:0;left:0;height:100%;z-index:1;border-radius:2px 0 0 2px;background-color:rgba(255,255,255,0.3)}.player .seek-bar .progress-bar .buffered .frame-preview-img,.player .seek-bar .progress-bar .virtual-progress .frame-preview-img{background-size:auto 100%;width:100%;height:100%;position:relative}.player .seek-bar .progress-bar .buffered .frame-preview,.player .seek-bar .progress-bar .virtual-progress .frame-preview{position:absolute;bottom:16px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:94px;width:164px;border:2px solid rgba(255,255,255,0.2);border-radius:4px}.player .seek-bar .progress-bar .buffered .time-preview,.player .seek-bar .progress-bar .virtual-progress .time-preview{position:absolute;bottom:22px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:22px;min-width:48px;padding:0 3px;text-align:center;border-radius:3px;background-color:rgba(0,0,0,0.7);font-size:13px;font-weight:bold;line-height:22px;color:#fff}.player .seek-bar .progress-bar .scrubber{position:absolute;z-index:3;cursor:pointer;display:block;top:-6px;right:-8px;border-radius:8px;height:16px;width:16px;background-color:#FFFFFF;box-shadow:0 0 31px 0 rgba(0,0,0,0.3);-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:100ms -webkit-transform;transition:100ms transform}.player .seek-bar .progress-bar .scrubber:active{opacity:1;cursor:-webkit-grabbing;cursor:grabbing}@media screen and (max-width: 480px){.virtual-progress{display:none}}.player .time-display{display:inline-block;line-height:32px;vertical-align:top;font-size:14px;padding:0 23px;font-weight:bold}@media screen and (max-width: 480px){.player .time-display{padding:0 12px 0 0}}.player .video-playing-title{font-size:15px;font-weight:bold;line-height:18px;padding:6px 0}.player .bottom-bar{position:absolute;bottom:0;left:0;width:100%;background:-webkit-linear-gradient(270deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:6px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .bottom-bar .left-controls{float:left;text-align:left}.player .bottom-bar .right-controls{float:right;text-align:left}.player .bottom-bar .right-controls .control-button-container{margin:0 6px}.player .bottom-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .bottom-bar,.player.hover .bottom-bar,.player.state-paused .bottom-bar,.player.menu-active .bottom-bar{opacity:1}.player.overlay-active .bottom-bar{opacity:0}@media screen and (max-width: 480px){.player .bottom-bar{padding:6px 8px}}.player .top-bar{position:absolute;top:0;left:0;width:100%;background:-webkit-linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(0deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:14px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .top-bar .left-controls{float:left;text-align:left}.player .top-bar .right-controls{float:right;text-align:left}.player .top-bar .right-controls .control-button-container{margin:0 6px}.player .top-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .top-bar,.player.hover .top-bar,.player.state-paused .top-bar,.player.menu-active .top-bar{opacity:1}.player.overlay-active .top-bar{opacity:0}@media screen and (max-width: 480px){.player .top-bar{padding:8px 8px 20px 8px}}@-webkit-keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}@keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}.overlay-play{position:absolute;top:0;left:0;width:100%;height:100%}.overlay-play.in .icon{-webkit-animation:overlayPlayIconIn 400ms linear forwards;animation:overlayPlayIconIn 400ms linear forwards}.overlay-play .icon{width:144px;height:144px;fill:#fff;position:absolute;top:50%;left:50%;margin:-72px 0 0 -72px;opacity:0}", ""]); // exports @@ -16571,6 +16982,18 @@ var HlsAdapter = function (_BaseMediaSourceAdapt) { } } + /** Hide the text track + * @function hideTextTrack + * @returns {void} + * @public + */ + + }, { + key: 'hideTextTrack', + value: function hideTextTrack() { + this._disableAllTextTracks(); + } + /** * Enables adaptive bitrate switching according to hls.js logic. * @function enableAdaptiveBitrate @@ -17333,7 +17756,7 @@ var _fpsController = _dereq_(10); var _fpsController2 = _interopRequireDefault(_fpsController); -var _xhrLoader = _dereq_(58); +var _xhrLoader = _dereq_(59); var _xhrLoader2 = _interopRequireDefault(_xhrLoader); @@ -17454,7 +17877,7 @@ var hlsDefaultConfig = exports.hlsDefaultConfig = { minAutoBitrate: 0 // used by hls }; -},{"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){ +},{"10":10,"14":14,"15":15,"16":16,"5":5,"50":50,"59":59,"6":6,"7":7,"8":8,"9":9}],5:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -17477,9 +17900,9 @@ var _bufferHelper2 = _interopRequireDefault(_bufferHelper); var _errors = _dereq_(33); -var _logger = _dereq_(53); +var _logger = _dereq_(54); -var _ewmaBandwidthEstimator = _dereq_(51); +var _ewmaBandwidthEstimator = _dereq_(52); var _ewmaBandwidthEstimator2 = _interopRequireDefault(_ewmaBandwidthEstimator); @@ -17506,6 +17929,8 @@ var AbrController = function (_EventHandler) { _this.lastLoadedFragLevel = 0; _this._nextAutoLevel = -1; _this.hls = hls; + _this.timer = null; + _this._bwEstimator = null; _this.onCheck = _this._abandonRulesCheck.bind(_this); return _this; } @@ -17690,10 +18115,8 @@ var AbrController = function (_EventHandler) { }, { key: 'clearTimer', value: function clearTimer() { - if (this.timer) { - clearInterval(this.timer); - this.timer = null; - } + clearInterval(this.timer); + this.timer = null; } // return next auto level @@ -17814,7 +18237,7 @@ var AbrController = function (_EventHandler) { exports.default = AbrController; -},{"33":33,"34":34,"35":35,"37":37,"51":51,"53":53}],6:[function(_dereq_,module,exports){ +},{"33":33,"34":34,"35":35,"37":37,"52":52,"54":54}],6:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -17847,13 +18270,15 @@ var _levelHelper = _dereq_(38); var _levelHelper2 = _interopRequireDefault(_levelHelper); -var _timeRanges = _dereq_(54); +var _timeRanges = _dereq_(55); var _timeRanges2 = _interopRequireDefault(_timeRanges); var _errors = _dereq_(33); -var _logger = _dereq_(53); +var _logger = _dereq_(54); + +var _discontinuities = _dereq_(51); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -17897,6 +18322,7 @@ var AudioStreamController = function (_EventHandler) { _this.ontick = _this.tick.bind(_this); _this.initPTS = []; _this.waitingFragment = null; + _this.videoTrackCC = null; return _this; } @@ -17924,18 +18350,13 @@ var AudioStreamController = function (_EventHandler) { //Always update the new INIT PTS //Can change due level switch this.initPTS[cc] = initPTS; + this.videoTrackCC = cc; _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; + this.tick(); } } } @@ -18032,6 +18453,9 @@ var AudioStreamController = function (_EventHandler) { pos = this.media.currentTime; } else { pos = this.nextLoadPosition; + if (pos === undefined) { + break; + } } var media = this.mediaBuffer ? this.mediaBuffer : this.media, bufferInfo = _bufferHelper2.default.bufferInfo(media, pos, config.maxBufferHole), @@ -18096,6 +18520,10 @@ var AudioStreamController = function (_EventHandler) { // 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 = (0, _discontinuities.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 @@ -18168,7 +18596,7 @@ var AudioStreamController = function (_EventHandler) { 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)); + _logger.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++; @@ -18217,6 +18645,28 @@ var AudioStreamController = function (_EventHandler) { } break; case State.WAITING_INIT_PTS: + if (this.initPTS[this.videoTrackCC] === undefined) { + break; + } + + // 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 (this.videoTrackCC !== waitingFragCC) { + _logger.logger.warn('Waiting fragment CC (' + waitingFragCC + ') does not match video track CC (' + this.videoTrackCC + ')'); + this.waitingFragment = null; + this.state = State.IDLE; + } else { + this.state = State.FRAG_LOADING; + this.onFragLoaded(this.waitingFragment); + this.waitingFragment = null; + } + } else { + this.state = State.IDLE; + } + + break; case State.STOPPED: case State.FRAG_LOADING: case State.PARSING: @@ -18306,7 +18756,6 @@ var AudioStreamController = function (_EventHandler) { // 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; @@ -18463,7 +18912,7 @@ var AudioStreamController = function (_EventHandler) { // include levelCodec in audio and video tracks track = tracks.audio; if (track) { - track.levelCodec = 'mp4a.40.2'; + track.levelCodec = track.codec; 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 + ']'); @@ -18731,7 +19180,7 @@ var AudioStreamController = function (_EventHandler) { exports.default = AudioStreamController; -},{"25":25,"33":33,"34":34,"35":35,"37":37,"38":38,"48":48,"53":53,"54":54}],7:[function(_dereq_,module,exports){ +},{"25":25,"33":33,"34":34,"35":35,"37":37,"38":38,"48":48,"51":51,"54":54,"55":55}],7:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -18748,7 +19197,7 @@ var _eventHandler = _dereq_(34); var _eventHandler2 = _interopRequireDefault(_eventHandler); -var _logger = _dereq_(53); +var _logger = _dereq_(54); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -18928,7 +19377,7 @@ var AudioTrackController = function (_EventHandler) { exports.default = AudioTrackController; -},{"34":34,"35":35,"53":53}],8:[function(_dereq_,module,exports){ +},{"34":34,"35":35,"54":54}],8:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -18945,7 +19394,7 @@ var _eventHandler = _dereq_(34); var _eventHandler2 = _interopRequireDefault(_eventHandler); -var _logger = _dereq_(53); +var _logger = _dereq_(54); var _errors = _dereq_(33); @@ -19556,7 +20005,7 @@ var BufferController = function (_EventHandler) { exports.default = BufferController; -},{"33":33,"34":34,"35":35,"53":53}],9:[function(_dereq_,module,exports){ +},{"33":33,"34":34,"35":35,"54":54}],9:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -19606,10 +20055,8 @@ var CapLevelController = function (_EventHandler) { }, { key: 'onFpsDropLevelCapping', value: function onFpsDropLevelCapping(data) { - if (!this.restrictedLevels) { - this.restrictedLevels = []; - } - if (!this.isLevelRestricted(data.droppedLevel)) { + // Don't add a restricted level more than once + if (CapLevelController.isLevelAllowed(data.droppedLevel, this.restrictedLevels)) { this.restrictedLevels.push(data.droppedLevel); } } @@ -19622,6 +20069,7 @@ var CapLevelController = function (_EventHandler) { key: 'onManifestParsed', value: function onManifestParsed(data) { var hls = this.hls; + this.restrictedLevels = []; if (hls.config.capLevelToPlayerSize) { this.autoLevelCapping = Number.POSITIVE_INFINITY; this.levels = data.levels; @@ -19656,41 +20104,17 @@ var CapLevelController = function (_EventHandler) { }, { 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; - } + var _this2 = this; + + if (!this.levels) { + return -1; } - 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; + + var validLevels = this.levels.filter(function (level, index) { + return CapLevelController.isLevelAllowed(index, _this2.restrictedLevels) && index <= capLevelIndex; + }); + + return CapLevelController.getMaxLevelByMediaSize(validLevels, this.mediaWidth, this.mediaHeight); } }, { key: 'mediaWidth', @@ -19699,7 +20123,7 @@ var CapLevelController = function (_EventHandler) { var media = this.media; if (media) { width = media.width || media.clientWidth || media.offsetWidth; - width *= this.contentScaleFactor; + width *= CapLevelController.contentScaleFactor; } return width; } @@ -19710,10 +20134,56 @@ var CapLevelController = function (_EventHandler) { var media = this.media; if (media) { height = media.height || media.clientHeight || media.offsetHeight; - height *= this.contentScaleFactor; + height *= CapLevelController.contentScaleFactor; } return height; } + }], [{ + key: 'isLevelAllowed', + value: function isLevelAllowed(level) { + var restrictedLevels = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + return restrictedLevels.indexOf(level) === -1; + } + }, { + key: 'getMaxLevelByMediaSize', + value: function getMaxLevelByMediaSize(levels, width, height) { + if (!levels || levels && !levels.length) { + return -1; + } + + // 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; + }; + + // 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; + } + } + + return maxLevelIndex; + } + }, { + key: 'contentScaleFactor', + get: function get() { + var pixelRatio = 1; + try { + pixelRatio = window.devicePixelRatio; + } catch (e) {} + return pixelRatio; + } }]); return CapLevelController; @@ -19738,7 +20208,7 @@ var _eventHandler = _dereq_(34); var _eventHandler2 = _interopRequireDefault(_eventHandler); -var _logger = _dereq_(53); +var _logger = _dereq_(54); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -19831,7 +20301,7 @@ var FPSController = function (_EventHandler) { exports.default = FPSController; -},{"34":34,"35":35,"53":53}],11:[function(_dereq_,module,exports){ +},{"34":34,"35":35,"54":54}],11:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -19848,6 +20318,10 @@ var _eventHandler = _dereq_(34); var _eventHandler2 = _interopRequireDefault(_eventHandler); +var _id = _dereq_(27); + +var _id2 = _interopRequireDefault(_id); + 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"); } } @@ -19900,12 +20374,6 @@ var ID3TrackController = function (_EventHandler) { 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 @@ -19913,164 +20381,27 @@ var ID3TrackController = function (_EventHandler) { var Cue = window.WebKitDataCue || window.VTTCue || window.TextTrackCue; 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); - } - } - } - }, { - key: 'parseID3Frame', - value: function parseID3Frame(data) { - if (data.length < 21) { - return undefined; - } - - /* 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 - - var type = String.fromCharCode(data[10], data[11], data[12], data[13]); - data = data.subarray(20); - return { type: type, data: data }; - } - } - }, { - 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); - } else { - return undefined; - } - } - }, { - key: 'decodeTxxxFrame', - value: function decodeTxxxFrame(frame) { - /* - Format: - [0] = {Text Encoding} - [1-?] = {Description}\0{Value} - */ - - if (frame.size < 2) { - return undefined; - } - - if (frame.data[0] !== 3) { - //only support UTF-8 - return undefined; - } - - var index = 1; - var description = this.utf8ArrayToStr(frame.data.subarray(index)); - - index += description.length + 1; - var value = this.utf8ArrayToStr(frame.data.subarray(index)); - - return { key: 'TXXX', description: description, data: value }; - } - }, { - key: 'decodeTextFrame', - value: function decodeTextFrame(frame) { - /* - Format: - [0] = {Text Encoding} - [1-?] = {Value} - */ - - if (frame.size < 2) { - return undefined; - } - - 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: \0 - */ - - if (frame.size < 2) { - return undefined; - } - - var owner = this.utf8ArrayToStr(frame.data); - var privateData = frame.data.subarray(owner.length + 1); - - return { key: 'PRIV', info: owner, data: privateData.buffer }; - } - - // 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 - * Version: 1.0 - * LastModified: Dec 25 1999 - * This library is free. You can redistribute it and/or modify it. - */ - - }, { - key: 'utf8ArrayToStr', - value: function utf8ArrayToStr(array) { - - var char2 = void 0; - var char3 = void 0; - var out = ''; - var i = 0; - var length = array.length; + var frames = _id2.default.getID3Frames(samples[i].data); + if (frames) { + var startTime = samples[i].pts; + var endTime = i < samples.length - 1 ? samples[i + 1].pts : fragment.endPTS; + + // 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; + } - 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; + for (var j = 0; j < frames.length; j++) { + var frame = frames[j]; + // Safari doesn't put the timestamp frame in the TextTrack + if (!_id2.default.isTimeStampFrame(frame)) { + var cue = new Cue(startTime, endTime, ''); + cue.value = frame; + this.id3Track.addCue(cue); + } + } } } - - return out; } }]); @@ -20079,7 +20410,7 @@ var ID3TrackController = function (_EventHandler) { exports.default = ID3TrackController; -},{"34":34,"35":35}],12:[function(_dereq_,module,exports){ +},{"27":27,"34":34,"35":35}],12:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -20096,7 +20427,7 @@ var _eventHandler = _dereq_(34); var _eventHandler2 = _interopRequireDefault(_eventHandler); -var _logger = _dereq_(53); +var _logger = _dereq_(54); var _errors = _dereq_(33); @@ -20500,7 +20831,7 @@ var LevelController = function (_EventHandler) { exports.default = LevelController; -},{"33":33,"34":34,"35":35,"37":37,"53":53}],13:[function(_dereq_,module,exports){ +},{"33":33,"34":34,"35":35,"37":37,"54":54}],13:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -20533,13 +20864,13 @@ var _levelHelper = _dereq_(38); var _levelHelper2 = _interopRequireDefault(_levelHelper); -var _timeRanges = _dereq_(54); +var _timeRanges = _dereq_(55); var _timeRanges2 = _interopRequireDefault(_timeRanges); var _errors = _dereq_(33); -var _logger = _dereq_(53); +var _logger = _dereq_(54); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -20776,9 +21107,11 @@ var StreamController = function (_EventHandler) { return; } - // we just got done loading the final fragment, check if we need to finalize media stream + // we just got done loading the final fragment, and currentPos is buffered, and there is no other buffered range after ... + // rationale is that in case there are any buffered rangesafter, it means that there are unbuffered portion in between + // so we should not switch to ENDED in that case, to be able to buffer themx var fragPrevious = this.fragPrevious; - if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN) { + if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN && bufferLen && !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); @@ -20870,6 +21203,7 @@ var StreamController = function (_EventHandler) { if (media && media.readyState && media.duration > liveSyncPosition) { media.currentTime = liveSyncPosition; } + this.nextLoadPosition = liveSyncPosition; } // if end of buffer greater than live edge, don't load any fragment @@ -20998,7 +21332,8 @@ var StreamController = function (_EventHandler) { } frag = prevFrag; frag.backtracked = true; - } else { + } else if (curSNIdx) { + // can't backtrack on very first fragment frag = null; } } @@ -21220,8 +21555,10 @@ var StreamController = function (_EventHandler) { fragCurrent.loader.abort(); } this.fragCurrent = null; - // flush position is the start position of this new buffer - this.flushMainBuffer(nextBufferedFrag.startPTS, Number.POSITIVE_INFINITY); + // 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); } } } @@ -21921,7 +22258,8 @@ var StreamController = function (_EventHandler) { }, { key: '_checkBuffer', value: function _checkBuffer() { - var media = this.media; + 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, @@ -21933,13 +22271,14 @@ var StreamController = function (_EventHandler) { // 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); + startPositionBuffered = _bufferHelper2.default.isBuffered(mediaBuffer, startPosition), + firstbufferedPosition = buffered.start(0); // if currentTime not matching with expected startPosition or startPosition not buffered - if (currentTime !== startPosition || !startPositionBuffered) { + if (currentTime !== startPosition || !startPositionBuffered && Math.abs(startPosition - firstbufferedPosition) < config.maxSeekHole) { _logger.logger.log('target start position:' + startPosition); // if startPosition not buffered, let's seek to buffered.start(0) if (!startPositionBuffered) { - startPosition = buffered.start(0); + startPosition = firstbufferedPosition; _logger.logger.log('target start position not buffered, seek to buffered.start(0) ' + startPosition); } _logger.logger.log('adjust currentTime from ' + currentTime + ' to ' + startPosition); @@ -21955,8 +22294,7 @@ var StreamController = function (_EventHandler) { // 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; + playheadMoving = currentTime !== this.lastCurrentTime; if (playheadMoving) { // played moving, but was previously stalled => now not stuck anymore @@ -22135,7 +22473,7 @@ var StreamController = function (_EventHandler) { exports.default = StreamController; -},{"25":25,"33":33,"34":34,"35":35,"37":37,"38":38,"48":48,"53":53,"54":54}],14:[function(_dereq_,module,exports){ +},{"25":25,"33":33,"34":34,"35":35,"37":37,"38":38,"48":48,"54":54,"55":55}],14:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -22152,7 +22490,7 @@ var _eventHandler = _dereq_(34); var _eventHandler2 = _interopRequireDefault(_eventHandler); -var _logger = _dereq_(53); +var _logger = _dereq_(54); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -22297,7 +22635,7 @@ var SubtitleStreamController = function (_EventHandler) { exports.default = SubtitleStreamController; -},{"34":34,"35":35,"53":53}],15:[function(_dereq_,module,exports){ +},{"34":34,"35":35,"54":54}],15:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -22314,7 +22652,7 @@ var _eventHandler = _dereq_(34); var _eventHandler2 = _interopRequireDefault(_eventHandler); -var _logger = _dereq_(53); +var _logger = _dereq_(54); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -22351,6 +22689,25 @@ var SubtitleTrackController = function (_EventHandler) { } _createClass(SubtitleTrackController, [{ + key: '_onTextTracksChanged', + value: 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; + } + }, { key: 'destroy', value: function destroy() { _eventHandler2.default.prototype.destroy.call(this); @@ -22361,34 +22718,23 @@ var SubtitleTrackController = function (_EventHandler) { }, { key: 'onMediaAttached', value: function onMediaAttached(data) { - var _this2 = this; - this.media = data.media; if (!this.media) { return; } - this.media.textTracks.addEventListener('change', function () { - // Media is undefined when switching streams via loadSource() - if (!_this2.media) { - return; - } - - var trackId = -1; - var tracks = filterSubtitleTracks(_this2.media.textTracks); - for (var id = 0; id < tracks.length; id++) { - if (tracks[id].mode === 'showing') { - trackId = id; - } - } - // Setting current subtitleTrack will invoke code. - _this2.subtitleTrack = trackId; - }); + this.trackChangeListener = this._onTextTracksChanged.bind(this); + this.media.textTracks.addEventListener('change', this.trackChangeListener); } }, { key: 'onMediaDetaching', value: function onMediaDetaching() { - // TODO: Remove event listeners. + if (!this.media) { + return; + } + + this.media.textTracks.removeEventListener('change', this.trackChangeListener); + this.media = undefined; } @@ -22406,7 +22752,7 @@ var SubtitleTrackController = function (_EventHandler) { }, { key: 'onManifestLoaded', value: function onManifestLoaded(data) { - var _this3 = this; + var _this2 = this; var tracks = data.subtitles || []; var defaultFound = false; @@ -22418,7 +22764,7 @@ var SubtitleTrackController = function (_EventHandler) { // TODO: improve selection logic to handle forced, etc tracks.forEach(function (track) { if (track.default) { - _this3.subtitleTrack = track.id; + _this2.subtitleTrack = track.id; defaultFound = true; } }); @@ -22446,7 +22792,7 @@ var SubtitleTrackController = function (_EventHandler) { }, { key: 'onSubtitleTrackLoaded', value: function onSubtitleTrackLoaded(data) { - var _this4 = this; + var _this3 = this; if (data.id < this.tracks.length) { _logger.logger.log('subtitle track ' + data.id + ' loaded'); @@ -22456,7 +22802,7 @@ var SubtitleTrackController = function (_EventHandler) { // if live playlist we will have to reload it periodically // set reload period to playlist target duration this.timer = setInterval(function () { - _this4.onTick(); + _this3.onTick(); }, 1000 * data.details.targetduration, this); } if (!data.details.live && this.timer) { @@ -22521,7 +22867,7 @@ var SubtitleTrackController = function (_EventHandler) { exports.default = SubtitleTrackController; -},{"34":34,"35":35,"53":53}],16:[function(_dereq_,module,exports){ +},{"34":34,"35":35,"54":54}],16:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -22542,11 +22888,11 @@ var _cea608Parser = _dereq_(49); var _cea608Parser2 = _interopRequireDefault(_cea608Parser); -var _webvttParser = _dereq_(57); +var _webvttParser = _dereq_(58); var _webvttParser2 = _interopRequireDefault(_webvttParser); -var _logger = _dereq_(53); +var _logger = _dereq_(54); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -22897,7 +23243,7 @@ var TimelineController = function (_EventHandler) { exports.default = TimelineController; -},{"34":34,"35":35,"49":49,"53":53,"57":57}],17:[function(_dereq_,module,exports){ +},{"34":34,"35":35,"49":49,"54":54,"58":58}],17:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -23258,7 +23604,7 @@ var _aesDecryptor2 = _interopRequireDefault(_aesDecryptor); var _errors = _dereq_(33); -var _logger = _dereq_(53); +var _logger = _dereq_(54); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -23354,7 +23700,7 @@ var Decrypter = function () { exports.default = Decrypter; -},{"17":17,"18":18,"20":20,"33":33,"53":53}],20:[function(_dereq_,module,exports){ +},{"17":17,"18":18,"20":20,"33":33,"54":54}],20:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -23401,7 +23747,7 @@ var _adts = _dereq_(22); var _adts2 = _interopRequireDefault(_adts); -var _logger = _dereq_(53); +var _logger = _dereq_(54); var _id = _dereq_(27); @@ -23434,65 +23780,39 @@ var AACDemuxer = function () { // 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; - } + var track = this._audioTrack, + id3Data = _id2.default.getID3Data(data, 0), + pts = 90 * _id2.default.getTimeStamp(id3Data), + frameIndex = 0, + stamp = pts, + length = data.length, + offset = id3Data.length; + + var id3Samples = [{ pts: stamp, dts: stamp, data: id3Data }]; + + while (offset < length - 1) { + if (_adts2.default.isHeader(data, offset) && offset + 5 < length) { + _adts2.default.initTrackConfig(track, this.observer, data, offset, track.manifestCodec); + var frame = _adts2.default.appendFrame(track, data, offset, pts, frameIndex); + if (frame) { + offset += frame.length; + stamp = frame.sample.pts; + frameIndex++; + } else { + _logger.logger.log('Unable to parse AAC frame'); + break; } + } else if (_id2.default.isHeader(data, offset)) { + id3Data = _id2.default.getID3Data(data, offset); + id3Samples.push({ pts: stamp, dts: stamp, data: id3Data }); + offset += id3Data.length; } else { - break; + //nothing found, keep looking + offset++; } } - this.remuxer.remux(track, { samples: [] }, { samples: [{ pts: pts, dts: pts, data: id3.payload }], inputTimeScale: 90000 }, { samples: [] }, timeOffset, contiguous, accurateTimeOffset); + + this.remuxer.remux(track, { samples: [] }, { samples: id3Samples, inputTimeScale: 90000 }, { samples: [] }, timeOffset, contiguous, accurateTimeOffset); } }, { key: 'destroy', @@ -23501,16 +23821,15 @@ var AACDemuxer = function () { 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) { + var offset, length; + var id3Data = _id2.default.getID3Data(data, 0); + if (id3Data && _id2.default.getTimeStamp(id3Data) !== undefined) { // 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 !'); + for (offset = id3Data.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) { + if (_adts2.default.probe(data, offset)) { + _logger.logger.log('ADTS sync word found !'); return true; } } @@ -23524,10 +23843,10 @@ var AACDemuxer = function () { exports.default = AACDemuxer; -},{"22":22,"27":27,"53":53}],22:[function(_dereq_,module,exports){ +},{"22":22,"27":27,"54":54}],22:[function(_dereq_,module,exports){ 'use strict'; -var _logger = _dereq_(53); +var _logger = _dereq_(54); var _errors = _dereq_(33); @@ -23650,12 +23969,108 @@ var ADTS = { config[3] = 0; } return { config: config, samplerate: adtsSampleingRates[adtsSampleingIndex], channelCount: adtsChanelConfig, codec: 'mp4a.40.' + adtsObjectType, manifestCodec: manifestCodec }; + }, + + isHeaderPattern: function isHeaderPattern(data, offset) { + return data[offset] === 0xff && (data[offset + 1] & 0xf6) === 0xf0; + }, + + getHeaderLength: function getHeaderLength(data, offset) { + return !!(data[offset + 1] & 0x01) ? 7 : 9; + }, + + getFullFrameLength: function getFullFrameLength(data, offset) { + return (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5; + }, + + isHeader: 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 && this.isHeaderPattern(data, offset)) { + return true; + } + return false; + }, + + probe: function 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 && this.isHeaderPattern(data, offset)) { + // ADTS header Length + var headerLength = this.getHeaderLength(data, offset); + // ADTS frame Length + var frameLength = headerLength; + if (offset + 5 < data.length) { + frameLength = this.getFullFrameLength(data, offset); + } + var newOffset = offset + frameLength; + if (newOffset === data.length || newOffset + 1 < data.length && this.isHeaderPattern(data, newOffset)) { + return true; + } + } + return false; + }, + + initTrackConfig: function initTrackConfig(track, observer, data, offset, audioCodec) { + if (!track.samplerate) { + var config = this.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.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount); + } + }, + + getFrameDuration: function getFrameDuration(samplerate) { + return 1024 * 90000 / samplerate; + }, + + appendFrame: function appendFrame(track, data, offset, pts, frameIndex) { + var frameDuration = this.getFrameDuration(track.samplerate); + var header = this.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 }; + + track.samples.push(aacSample); + track.len += frameLength; + + return { sample: aacSample, length: frameLength + headerLength }; + } + + return undefined; + }, + + parseFrameHeader: function parseFrameHeader(data, offset, pts, frameIndex, frameDuration) { + var headerLength, frameLength, stamp; + var length = data.length; + + // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header + headerLength = this.getHeaderLength(data, offset); + // retrieve frame size + frameLength = this.getFullFrameLength(data, offset); + frameLength -= headerLength; + + 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 }; + } + + return undefined; } }; module.exports = ADTS; -},{"33":33,"53":53}],23:[function(_dereq_,module,exports){ +},{"33":33,"54":54}],23:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -23763,10 +24178,11 @@ var DemuxerInline = function () { 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 }]; + // probing order is AAC/MP3/TS/MP4 + var muxConfig = [{ demux: _aacdemuxer2.default, remux: _mp4Remuxer2.default }, { demux: _mp3demuxer2.default, remux: _mp4Remuxer2.default }, { demux: _tsdemuxer2.default, remux: _mp4Remuxer2.default }, { demux: _mp4demuxer2.default, remux: _passthroughRemuxer2.default }]; // probe for content type - for (var i in muxConfig) { + for (var i = 0, len = muxConfig.length; i < len; i++) { var mux = muxConfig[i]; var probe = mux.demux.probe; if (probe(data)) { @@ -23789,7 +24205,7 @@ var DemuxerInline = function () { remuxer.resetInitSegment(); } if (discontinuity) { - demuxer.resetTimeStamp(); + demuxer.resetTimeStamp(defaultInitPTS); remuxer.resetTimeStamp(defaultInitPTS); } if (typeof demuxer.setDecryptData === 'function') { @@ -23819,7 +24235,7 @@ var _events = _dereq_(35); var _events2 = _interopRequireDefault(_events); -var _logger = _dereq_(53); +var _logger = _dereq_(54); var _events3 = _dereq_(1); @@ -23907,7 +24323,7 @@ var DemuxerWorker = function DemuxerWorker(self) { exports.default = DemuxerWorker; -},{"1":1,"23":23,"35":35,"53":53}],25:[function(_dereq_,module,exports){ +},{"1":1,"23":23,"35":35,"54":54}],25:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -23928,7 +24344,7 @@ var _demuxerWorker = _dereq_(24); var _demuxerWorker2 = _interopRequireDefault(_demuxerWorker); -var _logger = _dereq_(53); +var _logger = _dereq_(54); var _errors = _dereq_(33); @@ -24098,7 +24514,7 @@ var Demuxer = function () { exports.default = Demuxer; -},{"1":1,"23":23,"24":24,"3":3,"33":33,"35":35,"53":53}],26:[function(_dereq_,module,exports){ +},{"1":1,"23":23,"24":24,"3":3,"33":33,"35":35,"54":54}],26:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -24109,7 +24525,7 @@ var _createClass = function () { function defineProperties(target, props) { for * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264. */ -var _logger = _dereq_(53); +var _logger = _dereq_(54); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -24470,152 +24886,372 @@ var ExpGolomb = function () { exports.default = ExpGolomb; -},{"53":53}],27:[function(_dereq_,module,exports){ +},{"54":54}],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); +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"); } } -//import Hex from '../utils/hex'; - +/** + * ID3 parser + */ var ID3 = function () { - function ID3(data) { + function ID3() { _classCallCheck(this, ID3); + } - 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'); + _createClass(ID3, null, [{ + key: 'isHeader', + + /** + * 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 + */ + value: 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; + } } - this._length = len; - this._payload = data.subarray(0, len); } - return; } - } while (true); - } - _createClass(ID3, [{ - key: 'readUTF', - value: function readUTF(data, start, len) { + return false; + } - var result = '', - offset = start, - end = start + len; - do { - result += String.fromCharCode(data[offset++]); - } while (offset < end); - return result; + /** + * 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 + */ + + }, { + key: 'isFooter', + value: 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 + */ + }, { - 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; + key: 'getID3Data', + value: function getID3Data(data, offset) { + var front = offset; + var length = 0; - tagLen = data[offset++] << 24 + data[offset++] << 16 + data[offset++] << 8 + data[offset++]; + while (ID3.isHeader(data, offset)) { + //ID3 header is 10 bytes + length += 10; - tagFlags = data[offset++] << 8 + data[offset++]; + var size = ID3._readSize(data, offset + 6); + length += size; - 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; + if (ID3.isFooter(data, offset + 10)) { + //ID3 footer is 10 bytes + length += 10; + } - // 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; + offset += length; + } - timestamp = ((data[offset++] << 23) + (data[offset++] << 15) + (data[offset++] << 7) + data[offset++]) / 45; + if (length > 0) { + return data.subarray(front, front + length); + } - 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; + return undefined; + } + }, { + key: '_readSize', + value: 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 + */ + + }, { + key: 'getTimeStamp', + value: 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 + */ + }, { - key: 'hasTimeStamp', - get: function get() { - return this._hasTimeStamp; + key: 'isTimeStampFrame', + value: function isTimeStampFrame(frame) { + return frame && frame.key === 'PRIV' && frame.info === 'com.apple.streaming.transportStreamTimestamp'; } }, { - key: 'timeStamp', - get: function get() { - return this._timeStamp; + key: '_getFrameData', + value: 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 + */ + }, { - key: 'length', - get: function get() { - return this._length; + key: 'getID3Frames', + value: 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; } }, { - key: 'payload', - get: function get() { - return this._payload; + key: '_decodeFrame', + value: 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; + } + }, { + key: '_readTimeStamp', + value: 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; + } + }, { + key: '_decodePrivFrame', + value: function _decodePrivFrame(frame) { + /* + Format: \0 + */ + if (frame.size < 2) { + return undefined; + } + + var owner = ID3._utf8ArrayToStr(frame.data); + var privateData = new Uint8Array(frame.data.subarray(owner.length + 1)); + + return { key: frame.type, info: owner, data: privateData.buffer }; + } + }, { + key: '_decodeTextFrame', + value: 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 }; + } + } + }, { + key: '_decodeURLFrame', + value: 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 + * Version: 1.0 + * LastModified: Dec 25 1999 + * This library is free. You can redistribute it and/or modify it. + */ + + }, { + 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; + } + } + + return out; } }]); @@ -24624,7 +25260,7 @@ var ID3 = function () { exports.default = ID3; -},{"53":53}],28:[function(_dereq_,module,exports){ +},{}],28:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -24640,6 +25276,8 @@ var _id = _dereq_(27); var _id2 = _interopRequireDefault(_id); +var _logger = _dereq_(54); + var _mpegaudio = _dereq_(30); var _mpegaudio2 = _interopRequireDefault(_mpegaudio); @@ -24671,21 +25309,38 @@ var MP3Demuxer = function () { // 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; + var id3Data = _id2.default.getID3Data(data, 0); + var pts = 90 * _id2.default.getTimeStamp(id3Data); + var offset = id3Data.length; + var length = data.length; + var frameIndex = 0, + stamp = 0; + var track = this._audioTrack; + + var id3Samples = [{ pts: pts, dts: pts, data: id3Data }]; + + while (offset < length) { + if (_mpegaudio2.default.isHeader(data, offset)) { + var frame = _mpegaudio2.default.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 (_id2.default.isHeader(data, offset)) { + id3Data = _id2.default.getID3Data(data, offset); + id3Samples.push({ pts: stamp, dts: stamp, data: id3Data }); + offset += id3Data.length; + } else { + //nothing found, keep looking + offset++; } } - _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); + this.remuxer.remux(track, { samples: [] }, { samples: id3Samples, inputTimeScale: 90000 }, { samples: [] }, timeOffset, contiguous, accurateTimeOffset); } }, { key: 'destroy', @@ -24694,16 +25349,15 @@ var MP3Demuxer = function () { 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) { + var offset, length; + var id3Data = _id2.default.getID3Data(data, 0); + if (id3Data && _id2.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 = 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 !'); + for (offset = id3Data.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) { + if (_mpegaudio2.default.probe(data, offset)) { + _logger.logger.log('MPEG Audio sync word found !'); return true; } } @@ -24717,7 +25371,7 @@ var MP3Demuxer = function () { exports.default = MP3Demuxer; -},{"27":27,"30":30}],29:[function(_dereq_,module,exports){ +},{"27":27,"30":30,"54":54}],29:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -24738,6 +25392,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var UINT32_MAX = Math.pow(2, 32) - 1; + var MP4Demuxer = function () { function MP4Demuxer(observer, remuxer) { _classCallCheck(this, MP4Demuxer); @@ -24748,20 +25404,31 @@ var MP4Demuxer = function () { _createClass(MP4Demuxer, [{ key: 'resetTimeStamp', - value: function resetTimeStamp() {} + value: function resetTimeStamp(initPTS) { + this.initPTS = initPTS; + } }, { 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 }; - } - if (initData.video) { - tracks.video = { container: 'video/mp4', codec: videoCodec, initSegment: initSegment }; + if (initSegment && initSegment.byteLength) { + var initData = this.initData = MP4Demuxer.parseInitSegment(initSegment); + var tracks = {}; + 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(_events2.default.FRAG_PARSING_INIT_SEGMENT, { tracks: tracks }); + } else { + if (audioCodec) { + this.audioCodec = audioCodec; + } + if (videoCodec) { + this.videoCodec = videoCodec; + } } - this.observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, { tracks: tracks }); } }, { key: 'append', @@ -24770,7 +25437,19 @@ var MP4Demuxer = function () { // 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); + 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(_events2.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); } }, { @@ -24793,9 +25472,26 @@ var MP4Demuxer = function () { }, { key: 'readUint32', value: function readUint32(buffer, offset) { + if (buffer.data) { + offset += buffer.start; + buffer = buffer.data; + } + var val = buffer[offset] << 24 | buffer[offset + 1] << 16 | buffer[offset + 2] << 8 | buffer[offset + 3]; return val < 0 ? 4294967296 + val : val; } + }, { + key: 'writeUint32', + value: function writeUint32(buffer, offset, value) { + if (buffer.data) { + offset += buffer.start; + buffer = buffer.data; + } + 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 @@ -24807,33 +25503,44 @@ var MP4Demuxer = function () { size, type, end, - subresults; + subresults, + start, + endbox; + + if (data.data) { + start = data.start; + end = data.end; + data = data.data; + } else { + start = 0; + end = data.byteLength; + } if (!path.length) { // short-circuit the search for empty paths return null; } - for (i = 0; i < data.byteLength;) { + for (i = start; i < end;) { size = MP4Demuxer.readUint32(data, i); type = MP4Demuxer.bin2str(data.subarray(i + 4, i + 8)); - - end = size > 1 ? i + size : data.byteLength; + endbox = size > 1 ? i + size : end; 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)); + results.push({ data: data, start: i + 8, end: endbox }); } else { // recursively search for the next box along the path - subresults = MP4Demuxer.findBox(data.subarray(i + 8, end), path.slice(1)); + subresults = MP4Demuxer.findBox({ data: data, start: i + 8, end: endbox }, path.slice(1)); if (subresults.length) { results = results.concat(subresults); } } } - i = end; + i = endbox; } // we've finished searching all of data @@ -24869,19 +25576,19 @@ var MP4Demuxer = function () { traks.forEach(function (trak) { var tkhd = MP4Demuxer.findBox(trak, ['tkhd'])[0]; if (tkhd) { - var version = tkhd[0]; + 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[0]; + 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.subarray(8, 12)); + var hdlrType = MP4Demuxer.bin2str(hdlr.data.subarray(hdlr.start + 8, hdlr.start + 12)); var type = { 'soun': 'audio', 'vide': 'video' }[hdlrType]; if (type) { result[trackId] = { timescale: timescale, type: type }; @@ -24912,8 +25619,8 @@ var MP4Demuxer = function () { */ }, { - key: 'startDTS', - value: function startDTS(initData, fragment) { + key: 'getStartDTS', + value: function getStartDTS(initData, fragment) { var trafs, baseTimes, result; // we need info from two childrend of each track fragment box @@ -24933,7 +25640,7 @@ var MP4Demuxer = function () { baseTime = MP4Demuxer.findBox(traf, ['tfdt']).map(function (tfdt) { var version, result; - version = tfdt[0]; + version = tfdt.data[tfdt.start]; result = MP4Demuxer.readUint32(tfdt, 4); if (version === 1) { result *= Math.pow(2, 32); @@ -24953,6 +25660,35 @@ var MP4Demuxer = function () { result = Math.min.apply(null, baseTimes); return isFinite(result) ? result : 0; } + }, { + key: 'offsetStartDTS', + value: 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; + 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); + } + }); + }); + }); + } }]); return MP4Demuxer; @@ -24961,92 +25697,101 @@ var MP4Demuxer = function () { exports.default = MP4Demuxer; },{"35":35}],30:[function(_dereq_,module,exports){ -'use strict'; +"use strict"; -var _logger = _dereq_(53); +/** + * MPEG parser helper + */ var MpegAudio = { - onFrame: function onFrame(track, data, bitRate, sampleRate, channelCount, frameIndex, pts) { - var frameDuration = 1152 * 90000 / sampleRate; - var stamp = pts + frameIndex * frameDuration; + 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], - track.config = []; - track.channelCount = channelCount; - track.samplerate = sampleRate; - track.samples.push({ unit: data, pts: stamp, dts: stamp }); - track.len += data.length; - }, + SamplingRateMap: [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000], - onNoise: function onNoise(data) { - _logger.logger.warn('mpeg audio has noise: ' + data.length + ' bytes'); - }, + 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 = 1152 * 90000 / header.sampleRate; + var stamp = pts + frameIndex * frameDuration; + var sample = { unit: data.subarray(offset, offset + header.frameLength), pts: stamp, dts: stamp }; - 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]; + track.config = []; + track.channelCount = header.channelCount; + track.samplerate = header.sampleRate; + track.samples.push(sample); + track.len += header.frameLength; - if (start + 2 > end) { - return -1; // we need at least 2 bytes to detect sync pattern + return { sample: sample, length: header.frameLength }; } - 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; - } - this.onFrame(track, data.subarray(start, start + frameLength), bitRate, sampleRate, channelCount, frameIndex, pts); + return undefined; + }, - return frameLength; - } - } - // 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)); + 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] & 2); + 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 padding = headerG ? 1 : 0; + var channelCount = data[offset + 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; - return offset - start - 1; - } - offset++; + return { sampleRate: sampleRate, channelCount: channelCount, frameLength: frameLength }; } - return -1; + + return undefined; }, - parse: function parse(track, data, offset, pts) { - var length = data.length; - var frameIndex = 0; - var parsed; + isHeaderPattern: function isHeaderPattern(data, offset) { + return data[offset] === 0xff && (data[offset + 1] & 0xe0) === 0xe0 && (data[offset + 1] & 0x06) !== 0x00; + }, - while (offset < length && (parsed = this.parseFrames(track, data, offset, length, frameIndex++, pts)) > 0) { - offset += parsed; + 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; } - } -}; /** - * MPEG parser helper - */ + return false; + }, + 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; + } +}; module.exports = MpegAudio; -},{"53":53}],31:[function(_dereq_,module,exports){ +},{}],31:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -25238,7 +25983,7 @@ var _sampleAes = _dereq_(31); var _sampleAes2 = _interopRequireDefault(_sampleAes); -var _logger = _dereq_(53); +var _logger = _dereq_(54); var _errors = _dereq_(33); @@ -25729,6 +26474,7 @@ var TSDemuxer = function () { expGolombDecoder, avcSample = this.avcSample, push, + spsfound = false, i; //free pes.data to save up some memory pes.data = null; @@ -25742,9 +26488,10 @@ var TSDemuxer = function () { 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) { + // 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 _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. @@ -25846,6 +26593,7 @@ var TSDemuxer = function () { //SPS case 7: push = true; + spsfound = true; if (debug && avcSample) { avcSample.debug += 'SPS '; } @@ -26111,15 +26859,11 @@ var TSDemuxer = function () { startOffset = 0, aacOverFlow = this.aacOverFlow, aacLastPTS = this.aacLastPTS, - config, - frameLength, frameDuration, frameIndex, offset, - headerLength, stamp, - len, - aacSample; + len; if (aacOverFlow) { var tmp = new Uint8Array(aacOverFlow.byteLength + data.byteLength); tmp.set(aacOverFlow, 0); @@ -26129,7 +26873,7 @@ var TSDemuxer = function () { } // look for ADTS header (0xFFFx) for (offset = startOffset, len = data.length; offset < len - 1; offset++) { - if (data[offset] === 0xff && (data[offset + 1] & 0xf0) === 0xf0) { + if (_adts2.default.isHeader(data, offset)) { break; } } @@ -26149,18 +26893,10 @@ var TSDemuxer = function () { 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); - } + + _adts2.default.initTrackConfig(track, this.observer, data, offset, this.audioCodec); frameIndex = 0; - frameDuration = 1024 * 90000 / track.samplerate; + frameDuration = _adts2.default.getFrameDuration(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 @@ -26172,32 +26908,25 @@ var TSDemuxer = function () { } } - 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; - } + //scan for aac samples + while (offset < len) { + if (_adts2.default.isHeader(data, offset) && offset + 5 < len) { + var frame = _adts2.default.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 { - break; + //nothing found, keep looking + offset++; } } + if (offset < len) { aacOverFlow = data.subarray(offset, len); //logger.log(`AAC: overflow detected:${len-offset}`); @@ -26210,7 +26939,27 @@ var TSDemuxer = function () { }, { key: '_parseMPEGPES', value: function _parseMPEGPES(pes) { - _mpegaudio2.default.parse(this._audioTrack, pes.data, 0, pes.pts); + var data = pes.data; + var length = data.length; + var frameIndex = 0; + var offset = 0; + var pts = pes.pts; + + while (offset < length) { + if (_mpegaudio2.default.isHeader(data, offset)) { + var frame = _mpegaudio2.default.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++; + } + } } }, { key: '_parseID3PES', @@ -26234,7 +26983,7 @@ var TSDemuxer = function () { exports.default = TSDemuxer; -},{"22":22,"26":26,"30":30,"31":31,"33":33,"35":35,"53":53}],33:[function(_dereq_,module,exports){ +},{"22":22,"26":26,"30":30,"31":31,"33":33,"35":35,"54":54}],33:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -26322,7 +27071,7 @@ var _createClass = function () { function defineProperties(target, props) { for * */ -var _logger = _dereq_(53); +var _logger = _dereq_(54); var _errors = _dereq_(33); @@ -26370,7 +27119,7 @@ var EventHandler = function () { throw new Error('Forbidden event name: ' + event); } this.hls.on(event, this.onEvent); - }.bind(this)); + }, this); } } }, { @@ -26379,7 +27128,7 @@ var EventHandler = function () { if (this.isEventHandler()) { this.handledEvents.forEach(function (event) { this.hls.off(event, this.onEvent); - }.bind(this)); + }, this); } } @@ -26416,7 +27165,7 @@ var EventHandler = function () { exports.default = EventHandler; -},{"33":33,"35":35,"53":53}],35:[function(_dereq_,module,exports){ +},{"33":33,"35":35,"54":54}],35:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -26690,7 +27439,7 @@ module.exports = BufferHelper; },{}],38:[function(_dereq_,module,exports){ 'use strict'; -var _logger = _dereq_(53); +var _logger = _dereq_(54); var LevelHelper = { @@ -26755,6 +27504,7 @@ var LevelHelper = { updateFragPTSDTS: 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); @@ -26763,6 +27513,7 @@ var LevelHelper = { } 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); @@ -26771,6 +27522,7 @@ var LevelHelper = { var drift = startPTS - frag.start; frag.start = frag.startPTS = startPTS; + frag.maxStartPTS = maxStartPTS; frag.endPTS = endPTS; frag.startDTS = startDTS; frag.endDTS = endDTS; @@ -26834,17 +27586,17 @@ var LevelHelper = { module.exports = LevelHelper; -},{"53":53}],39:[function(_dereq_,module,exports){ -/** - * HLS interface - */ +},{"54":54}],39:[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 _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; }; }(); /** + * HLS interface + */ + var _urlToolkit = _dereq_(2); @@ -26880,7 +27632,7 @@ var _id3TrackController = _dereq_(11); var _id3TrackController2 = _interopRequireDefault(_id3TrackController); -var _logger = _dereq_(53); +var _logger = _dereq_(54); var _events3 = _dereq_(1); @@ -26909,7 +27661,7 @@ var Hls = function () { key: 'version', get: function get() { // replaced with browserify-versionify transform - return '0.7.9'; + return '0.7.10'; } }, { key: 'Events', @@ -27370,7 +28122,7 @@ var Hls = function () { 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){ +},{"1":1,"11":11,"12":12,"13":13,"2":2,"33":33,"35":35,"4":4,"41":41,"42":42,"43":43,"54":54}],40:[function(_dereq_,module,exports){ 'use strict'; // This is mostly for support of the es6 module export @@ -27397,7 +28149,7 @@ var _eventHandler2 = _interopRequireDefault(_eventHandler); var _errors = _dereq_(33); -var _logger = _dereq_(53); +var _logger = _dereq_(54); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -27466,32 +28218,38 @@ var FragmentLoader = function (_EventHandler) { }, { key: 'loadsuccess', value: function loadsuccess(response, stats, context) { + var networkDetails = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; + 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 }); + this.hls.trigger(_events2.default.FRAG_LOADED, { payload: payload, frag: frag, stats: stats, networkDetails: networkDetails }); } }, { key: 'loaderror', value: function loaderror(response, context) { + var networkDetails = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + 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_ERROR, fatal: false, frag: context.frag, response: response }); + this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_ERROR, fatal: false, frag: context.frag, response: response, networkDetails: networkDetails }); } }, { key: 'loadtimeout', value: function loadtimeout(stats, context) { + var networkDetails = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + 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 }); + this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.FRAG_LOAD_TIMEOUT, fatal: false, frag: context.frag, networkDetails: networkDetails }); } // data will be used for progressive parsing @@ -27499,10 +28257,11 @@ var FragmentLoader = function (_EventHandler) { }, { key: 'loadprogress', value: 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(_events2.default.FRAG_LOAD_PROGRESS, { frag: frag, stats: stats }); + this.hls.trigger(_events2.default.FRAG_LOAD_PROGRESS, { frag: frag, stats: stats, networkDetails: networkDetails }); } }]); @@ -27511,7 +28270,7 @@ var FragmentLoader = function (_EventHandler) { exports.default = FragmentLoader; -},{"33":33,"34":34,"35":35,"53":53}],42:[function(_dereq_,module,exports){ +},{"33":33,"34":34,"35":35,"54":54}],42:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -27530,7 +28289,7 @@ var _eventHandler2 = _interopRequireDefault(_eventHandler); var _errors = _dereq_(33); -var _logger = _dereq_(53); +var _logger = _dereq_(54); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -27640,7 +28399,7 @@ var KeyLoader = function (_EventHandler) { exports.default = KeyLoader; -},{"33":33,"34":34,"35":35,"53":53}],43:[function(_dereq_,module,exports){ +},{"33":33,"34":34,"35":35,"54":54}],43:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -27669,7 +28428,7 @@ var _attrList = _dereq_(47); var _attrList2 = _interopRequireDefault(_attrList); -var _logger = _dereq_(53); +var _logger = _dereq_(54); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -27682,7 +28441,14 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons // 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_FAST = new RegExp([/#EXTINF:(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source, // duration (#EXTINF:,), 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'); + 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?/; var LevelKey = function () { @@ -27940,6 +28706,8 @@ var PlaylistLoader = function (_EventHandler) { var codec = codecs[i]; if (codec.indexOf('avc1') !== -1) { level.videoCodec = this.avc1toavcoti(codec); + } else if (codec.indexOf('hvc1') !== -1) { + level.videoCodec = codec; } else { level.audioCodec = codec; } @@ -27953,6 +28721,8 @@ var PlaylistLoader = function (_EventHandler) { }, { key: 'parseMasterPlaylistMedia', value: function parseMasterPlaylistMedia(string, baseurl, type) { + var audioCodec = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; + var result = void 0, medias = [], id = 0; @@ -27974,6 +28744,9 @@ var PlaylistLoader = function (_EventHandler) { if (!media.name) { media.name = media.lang; } + if (audioCodec) { + media.audioCodec = audioCodec; + } media.id = id++; medias.push(media); } @@ -28152,6 +28925,8 @@ var PlaylistLoader = function (_EventHandler) { }, { key: 'loadsuccess', value: 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, @@ -28176,27 +28951,27 @@ var PlaylistLoader = function (_EventHandler) { 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 }); + hls.trigger(_events2.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(_events2.default.LEVEL_LOADED, { details: levelDetails, level: level || 0, id: id || 0, stats: stats }); + hls.trigger(_events2.default.LEVEL_LOADED, { details: levelDetails, level: level || 0, id: id || 0, stats: stats, networkDetails: networkDetails }); } else { if (type === 'audioTrack') { - hls.trigger(_events2.default.AUDIO_TRACK_LOADED, { details: levelDetails, id: id, stats: stats }); + hls.trigger(_events2.default.AUDIO_TRACK_LOADED, { details: levelDetails, id: id, stats: stats, networkDetails: networkDetails }); } else if (type === 'subtitleTrack') { - hls.trigger(_events2.default.SUBTITLE_TRACK_LOADED, { details: levelDetails, id: id, stats: stats }); + hls.trigger(_events2.default.SUBTITLE_TRACK_LOADED, { details: levelDetails, id: id, stats: stats, networkDetails: networkDetails }); } } } else { - hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'invalid targetduration' }); + hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'invalid targetduration', networkDetails: networkDetails }); } } else { var levels = this.parseMasterPlaylist(string, url); // multi level playlist, parse level info if (levels.length) { - var audioTracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO'); + var audioTracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO', levels[0].audioCodec); 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) @@ -28213,18 +28988,20 @@ var PlaylistLoader = function (_EventHandler) { audioTracks.unshift({ type: 'main', name: 'main' }); } } - hls.trigger(_events2.default.MANIFEST_LOADED, { levels: levels, audioTracks: audioTracks, subtitles: subtitles, url: url, stats: stats }); + hls.trigger(_events2.default.MANIFEST_LOADED, { levels: levels, audioTracks: audioTracks, subtitles: subtitles, url: url, stats: stats, networkDetails: networkDetails }); } 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' }); + 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', networkDetails: networkDetails }); } } } 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' }); + hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: _errors.ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter', networkDetails: networkDetails }); } } }, { key: 'loaderror', value: function loaderror(response, context) { + var networkDetails = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + var details, fatal, loader = context.loader; @@ -28246,11 +29023,13 @@ var PlaylistLoader = function (_EventHandler) { 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 }); + this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, response: response, context: context, networkDetails: networkDetails }); } }, { key: 'loadtimeout', value: function loadtimeout(stats, context) { + var networkDetails = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + var details, fatal, loader = context.loader; @@ -28272,7 +29051,7 @@ var PlaylistLoader = function (_EventHandler) { 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 }); + this.hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, context: context, networkDetails: networkDetails }); } }]); @@ -28281,7 +29060,7 @@ var PlaylistLoader = function (_EventHandler) { exports.default = PlaylistLoader; -},{"2":2,"33":33,"34":34,"35":35,"47":47,"53":53}],44:[function(_dereq_,module,exports){ +},{"2":2,"33":33,"34":34,"35":35,"47":47,"54":54}],44:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -28835,7 +29614,7 @@ var _events = _dereq_(35); var _events2 = _interopRequireDefault(_events); -var _logger = _dereq_(53); +var _logger = _dereq_(54); var _mp4Generator = _dereq_(44); @@ -28881,6 +29660,34 @@ var MP4Remuxer = function () { // generate Init Segment if needed if (!this.ISGenerated) { this.generateIS(audioTrack, videoTrack, timeOffset); + } else { + if (accurateTimeOffset) { + // check timestamp consistency. it there is more than 10s gap between expected PTS/DTS, recompute initPTS/DTS + var refPTS = this._initPTS; + var ptsNormalize = this._PTSNormalize; + var timeScale = audioTrack.inputTimeScale || videoTrack.inputTimeScale; + var initPTS = Infinity, + initDTS = Infinity; + var samples = audioTrack.samples; + if (samples.length) { + initPTS = initDTS = ptsNormalize(samples[0].pts - timeScale * timeOffset, refPTS); + } + samples = videoTrack.samples; + if (samples.length) { + var sample = samples[0]; + initPTS = Math.min(initPTS, ptsNormalize(sample.pts - timeScale * timeOffset, refPTS)); + initDTS = Math.min(initDTS, ptsNormalize(sample.dts - timeScale * timeOffset, refPTS)); + } + if (initPTS !== Infinity) { + var initPTSDelta = refPTS - initPTS; + if (Math.abs(initPTSDelta) > 10 * timeScale) { + _logger.logger.warn('timestamp inconsistency, ' + (initPTSDelta / timeScale).toFixed(3) + 's delta against expected value: missing discontinuity ? reset initPTS/initDTS'); + this._initPTS = initPTS; + this._initDTS = initDTS; + this.observer.trigger(_events2.default.INIT_PTS_FOUND, { initPTS: initPTS }); + } + } + } } if (this.ISGenerated) { @@ -29635,7 +30442,7 @@ var MP4Remuxer = function () { exports.default = MP4Remuxer; -},{"33":33,"35":35,"36":36,"44":44,"53":53}],46:[function(_dereq_,module,exports){ +},{"33":33,"35":35,"36":36,"44":44,"54":54}],46:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -31185,7 +31992,7 @@ exports.default = Cea608Parser; },{}],50:[function(_dereq_,module,exports){ 'use strict'; -var _vttparser = _dereq_(56); +var _vttparser = _dereq_(57); var Cues = { @@ -31247,7 +32054,33 @@ var Cues = { module.exports = Cues; -},{"56":56}],51:[function(_dereq_,module,exports){ +},{"57":57}],51:[function(_dereq_,module,exports){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.findFragWithCC = findFragWithCC; + +var _binarySearch = _dereq_(48); + +var _binarySearch2 = _interopRequireDefault(_binarySearch); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function findFragWithCC(fragments, CC) { + return _binarySearch2.default.search(fragments, function (candidate) { + if (candidate.cc < CC) { + return 1; + } else if (candidate.cc > CC) { + return -1; + } else { + return 0; + } + }); +} + +},{"48":48}],52:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -31262,7 +32095,7 @@ var _createClass = function () { function defineProperties(target, props) { for * different half-lives. */ -var _ewma = _dereq_(52); +var _ewma = _dereq_(53); var _ewma2 = _interopRequireDefault(_ewma); @@ -31323,7 +32156,7 @@ var EwmaBandWidthEstimator = function () { exports.default = EwmaBandWidthEstimator; -},{"52":52}],52:[function(_dereq_,module,exports){ +},{"53":53}],53:[function(_dereq_,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -31381,7 +32214,7 @@ var EWMA = function () { exports.default = EWMA; -},{}],53:[function(_dereq_,module,exports){ +},{}],54:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -31466,7 +32299,7 @@ var enableLogs = exports.enableLogs = function enableLogs(debugConfig) { var logger = exports.logger = exportedLogger; -},{}],54:[function(_dereq_,module,exports){ +},{}],55:[function(_dereq_,module,exports){ 'use strict'; /** @@ -31486,7 +32319,7 @@ var TimeRanges = { module.exports = TimeRanges; -},{}],55:[function(_dereq_,module,exports){ +},{}],56:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -31798,7 +32631,7 @@ exports.default = function () { return VTTCue; }(); -},{}],56:[function(_dereq_,module,exports){ +},{}],57:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -31806,7 +32639,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.fixLineBreaks = undefined; -var _vttcue = _dereq_(55); +var _vttcue = _dereq_(56); var _vttcue2 = _interopRequireDefault(_vttcue); @@ -32244,10 +33077,10 @@ VTTParser.prototype = { exports.fixLineBreaks = fixLineBreaks; exports.default = VTTParser; -},{"55":55}],57:[function(_dereq_,module,exports){ +},{"56":56}],58:[function(_dereq_,module,exports){ 'use strict'; -var _vttparser = _dereq_(56); +var _vttparser = _dereq_(57); var _vttparser2 = _interopRequireDefault(_vttparser); @@ -32420,7 +33253,7 @@ var WebVTTParser = { module.exports = WebVTTParser; -},{"56":56}],58:[function(_dereq_,module,exports){ +},{"57":57}],59:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -32431,7 +33264,7 @@ var _createClass = function () { function defineProperties(target, props) { for * XHR based logger */ -var _logger = _dereq_(53); +var _logger = _dereq_(54); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -32506,7 +33339,7 @@ var XhrLoader = function () { } } 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); + this.callbacks.onError({ code: xhr.status, text: e.message }, context, xhr); return; } @@ -32558,12 +33391,12 @@ var XhrLoader = function () { } stats.loaded = stats.total = len; var response = { url: xhr.responseURL, data: data }; - this.callbacks.onSuccess(response, stats, context); + 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.logger.error(status + ' while loading ' + context.url); - this.callbacks.onError({ code: status, text: xhr.statusText }, context); + this.callbacks.onError({ code: status, text: xhr.statusText }, context, xhr); } else { // retry _logger.logger.warn(status + ' while loading ' + context.url + ', retrying in ' + this.retryDelay + '...'); @@ -32586,20 +33419,22 @@ var XhrLoader = function () { key: 'loadtimeout', value: function loadtimeout() { _logger.logger.warn('timeout while loading ' + this.context.url); - this.callbacks.onTimeout(this.stats, this.context); + this.callbacks.onTimeout(this.stats, this.context, null); } }, { key: 'loadprogress', value: function loadprogress(event) { - var stats = this.stats; + var xhr = event.currentTarget, + stats = this.stats; + stats.loaded = event.loaded; if (event.lengthComputable) { stats.total = event.total; } var onProgress = this.callbacks.onProgress; if (onProgress) { - // last args is to provide on progress data - onProgress(stats, this.context, null); + // third arg is to provide on progress data + onProgress(stats, this.context, null, xhr); } } }]); @@ -32609,7 +33444,7 @@ var XhrLoader = function () { exports.default = XhrLoader; -},{"53":53}]},{},[40])(40) +},{"54":54}]},{},[40])(40) }); @@ -33083,10 +33918,24 @@ var DashAdapter = function (_BaseMediaSourceAdapt) { value: function selectTextTrack(textTrack) { if (textTrack instanceof _playkitJs.TextTrack && !textTrack.active && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions')) { this._shaka.selectTextLanguage(textTrack.language); + this._shaka.setTextTrackVisibility(true); this._onTrackChanged(textTrack); } } + /** + * Hide the text track + * @function hideTextTrack + * @returns {void} + * @public + */ + + }, { + key: 'hideTextTrack', + value: function hideTextTrack() { + this._shaka.setTextTrackVisibility(false); + } + /** * Enables adaptive bitrate switching * @function enableAdaptiveBitrate @@ -33557,6 +34406,134 @@ else this.shaka=g.shaka; +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = setup; + +var _playkitJs = __webpack_require__(0); + +var Playkit = _interopRequireWildcard(_playkitJs); + +var _ovpProvider = __webpack_require__(1); + +var _ovpProvider2 = _interopRequireDefault(_ovpProvider); + +var _sessionId = __webpack_require__(14); + +var _sessionId2 = _interopRequireDefault(_sessionId); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +/** + * + * @param {Object} config - contains partnerId and entryID + * @return {Promise<*>} - player promise + */ +function setup(config) { + var player = Playkit.playkit(); + player.addEventListener(player.Event.SOURCE_SELECTED, function (event) { + (0, _sessionId2.default)(event.payload.selectedSource, player); + }); + if (config) { + var provider = new _ovpProvider2.default(config.partnerId); + return provider.getConfig(config.entryID).then(function (data) { + player.configure(data); + return Promise.resolve(player); + }).catch(function (error) { + return Promise.reject(error); + }); + } else { + return Promise.resolve(player); + } +} + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/** + * @return {string} - GUID + * @private + */ +function _generateGUID() { + var S4 = function S4() { + return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1); + }; + return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4(); +} + +/** + * @param {Object} selectedSource - selected source + * @param {Player} player - player + * @return {void} + * @private + */ +function _addSessionId(selectedSource, player) { + var delimiter = selectedSource.url.indexOf('?') === -1 ? '?' : '&'; + var primaryGUID = _generateGUID(); + var secondGUID = _generateGUID(); + var sessionId = primaryGUID + ':' + secondGUID; + selectedSource.url += delimiter + 'playSessionId=' + sessionId; + player.sessionId = sessionId; +} + +/** + * @param {Object} selectedSource - selected source + * @param {string} sessionId - session id + * @param {Player} player - player + * @return {void} + * @private + */ +function _replaceSecondGUID(selectedSource, sessionId, player) { + var secondGUIDRegex = /:((?:[a-z0-9]|-)*)/i; + var secondGUID = secondGUIDRegex.exec(sessionId); + if (secondGUID && secondGUID[1]) { + var newSessionId = sessionId.replace(secondGUID[1], _generateGUID()); + selectedSource.url = selectedSource.url.replace(sessionId, newSessionId); + player.sessionId = newSessionId; + } +} + +/** + * @param {Object} selectedSource - selected source + * @param {Player} player - player + * @return {void} + * @public + */ +function handleSessionId() { + var selectedSource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var player = arguments[1]; + + if (typeof selectedSource.url === 'string' && selectedSource.url.toLowerCase().indexOf('playmanifest/') !== -1) { + var sessionIdRegex = /playSessionId=((?:[a-z0-9]|-|:)*)/i; + var sessionId = sessionIdRegex.exec(selectedSource.url); + if (sessionId && sessionId[1]) { + _replaceSecondGUID(selectedSource, sessionId[1], player); + } else { + _addSessionId(selectedSource, player); + } + } +} + +exports.default = handleSessionId; + /***/ }) /******/ ]); }); diff --git a/dist/kaltura-player.js.map b/dist/kaltura-player.js.map index 91fbf552d..5bf771aad 100644 --- a/dist/kaltura-player.js.map +++ b/dist/kaltura-player.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap ed28f8eddfad2a507e6c","webpack:///webpack:///core/webpack/universalModuleDefinition","webpack:///webpack:/core/webpack/bootstrap dbf76349fddd4414c1d5","webpack:///webpack:///core/track/track.js","webpack:///webpack:///core/utils/logger.js","webpack:///webpack:///core/event/fake-event.js","webpack:///webpack:///core/track/audio-track.js","webpack:///webpack:///core/track/text-track.js","webpack:///webpack:///core/track/video-track.js","webpack:///webpack:///core/event/event-manager.js","webpack:///webpack:///core/event/events.js","webpack:///webpack:///core/player.js","webpack:///webpack:///core/event/fake-event-target.js","webpack:///webpack:///core/utils/player-error.js","webpack:///webpack:///core/utils/util.js","webpack:///webpack:///core/engines/html5/media-source/base-media-source-adapter.js","webpack:///webpack:///core/engines/html5/media-source/media-source-provider.js","webpack:///webpack:///core/plugin/base-plugin.js","webpack:///webpack:///core/plugin/plugin-manager.js","webpack:///webpack:///core/state/state-types.js","webpack:///webpack:///core/utils/multi-map.js","webpack:///webpack:///package.json","webpack:///webpack:///core/engines/html5/html5.js","webpack:///webpack:///core/engines/html5/media-source/adapters/native-adapter.js","webpack:///webpack:///core/playkit.js","webpack:///webpack:///core/state/state-manager.js","webpack:///webpack:///core/state/state.js","webpack:///webpack:///core/track/track-types.js","webpack:///webpack:///~/js-logger/src/logger.js","webpack:///./index.js","webpack:///webpack:///providers/webpack/universalModuleDefinition","webpack:///webpack:/providers/webpack/bootstrap c25ced737c8594c7041b","webpack:///webpack:///providers/k-provider/request-builder.js","webpack:///webpack:///providers/k-provider/ovp/config.js","webpack:///webpack:///providers/k-provider/enums.js","webpack:///webpack:///providers/k-provider/ovp/services/ovp-service.js","webpack:///webpack:///providers/k-provider/base-service-result.js","webpack:///webpack:///providers/util/logger.js","webpack:///webpack:///providers/k-provider/multi-request-builder.js","webpack:///webpack:///providers/entities/media-source.js","webpack:///webpack:///providers/entities/media-entry.js","webpack:///webpack:///providers/entities/drm.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-flavor-asset.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-media-entry.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-metadata-list-response.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-playback-context.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-playback-source.js","webpack:///webpack:///~/enumify/lib/enumify.js","webpack:///webpack:///providers/k-provider/ovp/loaders/data-loader-manager.js","webpack:///webpack:///providers/k-provider/ovp/loaders/media-entry-loader.js","webpack:///webpack:///providers/k-provider/ovp/loaders/session-loader.js","webpack:///webpack:///providers/k-provider/ovp/loaders/ui-config-loader.js","webpack:///webpack:///providers/k-provider/ovp/provider-parser.js","webpack:///webpack:///providers/entities/media-format.js","webpack:///webpack:///providers/k-provider/ovp/ovp-provider.js","webpack:///webpack:///providers/k-provider/ovp/play-source-url-builder.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-access-control-message.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-base-entry-list-response.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-drm-playback-plugin-data.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-metadata.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-rule-action.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kalturaUIConfResponse.js","webpack:///webpack:///providers/k-provider/ovp/services/base-entry-service.js","webpack:///webpack:///providers/k-provider/ovp/services/meta-data-service.js","webpack:///webpack:///providers/k-provider/ovp/services/session-service.js","webpack:///webpack:///providers/k-provider/ovp/services/ui-conf-service.js","webpack:///webpack:///providers/k-provider/xml-parser.js","webpack:///webpack:///ui/webpack/universalModuleDefinition","webpack:///webpack:/ui/webpack/bootstrap 22c3c46a80b1c7885159","webpack:///webpack:///node_modules/preact/dist/preact.js","webpack:///webpack:///node_modules/preact-redux/dist/preact-redux.js","webpack:///webpack:///ui/components/base.js","webpack:///webpack:///ui/utils/bind-actions.js","webpack:///webpack:///ui/components/icon/icon.js","webpack:///webpack:///node_modules/preact-i18n/dist/preact-i18n.js","webpack:///webpack:///node_modules/redux/es/index.js","webpack:///webpack:///node_modules/redux/es/utils/warning.js","webpack:///webpack:///ui/reducers/shell.js","webpack:///webpack:///ui/reducers/play-pause.js","webpack:///webpack:///ui/reducers/share.js","webpack:///webpack:///node_modules/process/browser.js","webpack:///webpack:///node_modules/redux/es/createStore.js","webpack:///webpack:///node_modules/lodash-es/isPlainObject.js","webpack:///webpack:///node_modules/lodash-es/_Symbol.js","webpack:///webpack:///node_modules/webpack/buildin/global.js","webpack:///webpack:///node_modules/redux/es/compose.js","webpack:///webpack:///ui/reducers/engine.js","webpack:///webpack:///ui/reducers/seekbar.js","webpack:///webpack:///ui/reducers/volume.js","webpack:///webpack:///ui/reducers/fullscreen.js","webpack:///webpack:///ui/reducers/loading.js","webpack:///webpack:///ui/reducers/cvaa.js","webpack:///webpack:///ui/reducers/settings.js","webpack:///webpack:///ui/utils/time-format.js","webpack:///webpack:///ui/components/smart-container/smart-container.js","webpack:///webpack:///ui/components/smart-container/smart-container-item.js","webpack:///webpack:///ui/components/overlay/overlay.js","webpack:///webpack:///ui/ui-manager.js","webpack:///webpack:///node_modules/lodash-es/_baseGetTag.js","webpack:///webpack:///node_modules/lodash-es/_root.js","webpack:///webpack:///node_modules/lodash-es/_freeGlobal.js","webpack:///webpack:///node_modules/lodash-es/_getRawTag.js","webpack:///webpack:///node_modules/lodash-es/_objectToString.js","webpack:///webpack:///node_modules/lodash-es/_getPrototype.js","webpack:///webpack:///node_modules/lodash-es/_overArg.js","webpack:///webpack:///node_modules/lodash-es/isObjectLike.js","webpack:///webpack:///node_modules/symbol-observable/index.js","webpack:///webpack:///node_modules/symbol-observable/lib/index.js","webpack:///webpack:///node_modules/webpack/buildin/module.js","webpack:///webpack:///node_modules/symbol-observable/lib/ponyfill.js","webpack:///webpack:///node_modules/redux/es/combineReducers.js","webpack:///webpack:///node_modules/redux/es/bindActionCreators.js","webpack:///webpack:///node_modules/redux/es/applyMiddleware.js","webpack:///webpack:///node_modules/dlv/dist/dlv.umd.js","webpack:///webpack:///ui/store.js","webpack:///webpack:///ui/fr.json","webpack:///webpack:///ui/components/engine-connector/engine-connector.js","webpack:///webpack:/ui/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","webpack:///webpack:///ui/utils/logger.js","webpack:///webpack:///node_modules/js-logger/src/logger.js","webpack:///webpack:///ui/components/shell/shell.js","webpack:///webpack:///ui/utils/is-mobile.js","webpack:///webpack:///ui/components/overlay-play/overlay-play.js","webpack:///webpack:///ui/components/loading/loading.js","webpack:///webpack:///ui/components/play-pause/play-pause.js","webpack:///webpack:///ui/components/seekbar/seekbar.js","webpack:///webpack:///ui/components/volume/volume.js","webpack:///webpack:///ui/components/share/share.js","webpack:///webpack:///ui/components/settings/settings.js","webpack:///webpack:///ui/components/dropdown-menu/dropdown-menu.js","webpack:///webpack:///ui/components/language/language.js","webpack:///webpack:///ui/components/fullscreen/fullscreen.js","webpack:///webpack:///ui/components/time-display/time-display.js","webpack:///webpack:///ui/components/top-bar/top-bar.js","webpack:///webpack:///ui/components/bottom-bar/bottom-bar.js","webpack:///webpack:///ui/components/share-overlay/share-overlay.js","webpack:///webpack:///ui/components/cvaa-overlay/cvaa-overlay.js","webpack:///webpack:///ui/components/keyboard.js","webpack:///../node_modules/playkit-js-ui/src/styles/style.css?b4f7","webpack:///../node_modules/playkit-js-ui/src/styles/style.css","webpack:///../node_modules/css-loader/lib/css-base.js","webpack:///../node_modules/style-loader/lib/addStyles.js","webpack:///../node_modules/style-loader/lib/urls.js","webpack:///webpack:///hls/webpack/universalModuleDefinition","webpack:///webpack:/hls/webpack/bootstrap 3d553f6cfbde57d4496a","webpack:///webpack:///hls/hls-adapter.js","webpack:///webpack:/hls/external {\"commonjs\":\"hls.js\",\"commonjs2\":\"hls.js\",\"amd\":\"hls.js\",\"root\":\"Hls\"}","webpack:///webpack:/hls/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","webpack:///node_modules/browser-pack/_prelude.js","webpack:///node_modules/events/events.js","webpack:///node_modules/url-toolkit/src/url-toolkit.js","webpack:///node_modules/webworkify/index.js","webpack:///src/config.js","webpack:///src/controller/abr-controller.js","webpack:///src/controller/audio-stream-controller.js","webpack:///src/controller/audio-track-controller.js","webpack:///src/controller/buffer-controller.js","webpack:///src/controller/cap-level-controller.js","webpack:///src/controller/fps-controller.js","webpack:///src/controller/id3-track-controller.js","webpack:///src/controller/level-controller.js","webpack:///src/controller/stream-controller.js","webpack:///src/controller/subtitle-stream-controller.js","webpack:///src/controller/subtitle-track-controller.js","webpack:///src/controller/timeline-controller.js","webpack:///src/crypt/aes-crypto.js","webpack:///src/crypt/aes-decryptor.js","webpack:///src/crypt/decrypter.js","webpack:///src/crypt/fast-aes-key.js","webpack:///src/demux/aacdemuxer.js","webpack:///src/demux/adts.js","webpack:///src/demux/demuxer-inline.js","webpack:///src/demux/demuxer-worker.js","webpack:///src/demux/demuxer.js","webpack:///src/demux/exp-golomb.js","webpack:///src/demux/id3.js","webpack:///src/demux/mp3demuxer.js","webpack:///src/demux/mp4demuxer.js","webpack:///src/demux/mpegaudio.js","webpack:///src/demux/sample-aes.js","webpack:///src/demux/tsdemuxer.js","webpack:///src/errors.js","webpack:///src/event-handler.js","webpack:///src/events.js","webpack:///src/helper/aac.js","webpack:///src/helper/buffer-helper.js","webpack:///src/helper/level-helper.js","webpack:///src/hls.js","webpack:///src/index.js","webpack:///src/loader/fragment-loader.js","webpack:///src/loader/key-loader.js","webpack:///src/loader/playlist-loader.js","webpack:///src/remux/mp4-generator.js","webpack:///src/remux/mp4-remuxer.js","webpack:///src/remux/passthrough-remuxer.js","webpack:///src/utils/attr-list.js","webpack:///src/utils/binary-search.js","webpack:///src/utils/cea-608-parser.js","webpack:///src/utils/cues.js","webpack:///src/utils/ewma-bandwidth-estimator.js","webpack:///src/utils/ewma.js","webpack:///src/utils/logger.js","webpack:///src/utils/timeRanges.js","webpack:///src/utils/vttcue.js","webpack:///src/utils/vttparser.js","webpack:///src/utils/webvtt-parser.js","webpack:///src/utils/xhr-loader.js","webpack:///webpack:///dash/webpack/universalModuleDefinition","webpack:///webpack:/dash/webpack/bootstrap 37792bb50222e2c929fb","webpack:///webpack:///dash/dash-adapter.js","webpack:///webpack:/dash/external {\"commonjs\":\"shaka-player\",\"commonjs2\":\"shaka-player\",\"amd\":\"shaka-player\",\"root\":\"shaka\"}","webpack:///webpack:/dash/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","webpack:///../node_modules/shaka-player/third_party/closure/goog/base.js","webpack:///../node_modules/shaka-player/lib/cast/cast_proxy.js","webpack:///../node_modules/shaka-player/lib/abr/ewma.js","webpack:///../node_modules/shaka-player/lib/abr/ewma_bandwidth_estimator.js","webpack:///../node_modules/shaka-player/lib/debug/log.js","webpack:///../node_modules/shaka-player/lib/util/error.js","webpack:///../node_modules/shaka-player/third_party/closure/goog/uri/utils.js","webpack:///../node_modules/shaka-player/third_party/closure/goog/uri/uri.js","webpack:///../node_modules/shaka-player/lib/util/functional.js","webpack:///../node_modules/shaka-player/lib/util/manifest_parser_utils.js","webpack:///../node_modules/shaka-player/lib/util/config_utils.js","webpack:///../node_modules/shaka-player/lib/util/public_promise.js","webpack:///../node_modules/shaka-player/lib/net/networking_engine.js","webpack:///../node_modules/shaka-player/lib/util/array_utils.js","webpack:///../node_modules/shaka-player/lib/util/multi_map.js","webpack:///../node_modules/shaka-player/lib/util/event_manager.js","webpack:///../node_modules/shaka-player/lib/util/map_utils.js","webpack:///../node_modules/shaka-player/lib/util/string_utils.js","webpack:///../node_modules/shaka-player/lib/util/timer.js","webpack:///../node_modules/shaka-player/lib/util/uint8array_utils.js","webpack:///../node_modules/shaka-player/lib/media/drm_engine.js","webpack:///../node_modules/shaka-player/lib/media/text_engine.js","webpack:///../node_modules/shaka-player/lib/media/time_ranges_utils.js","webpack:///../node_modules/shaka-player/lib/media/media_source_engine.js","webpack:///../node_modules/shaka-player/lib/util/language_utils.js","webpack:///../node_modules/shaka-player/lib/util/stream_utils.js","webpack:///../node_modules/shaka-player/lib/abr/simple_abr_manager.js","webpack:///../node_modules/shaka-player/lib/util/fake_event.js","webpack:///../node_modules/shaka-player/lib/cast/cast_utils.js","webpack:///../node_modules/shaka-player/lib/cast/cast_sender.js","webpack:///../node_modules/shaka-player/lib/util/fake_event_target.js","webpack:///../node_modules/shaka-player/lib/player.js","webpack:///../node_modules/shaka-player/lib/cast/cast_receiver.js","webpack:///../node_modules/shaka-player/lib/util/xml_utils.js","webpack:///../node_modules/shaka-player/lib/dash/content_protection.js","webpack:///../node_modules/shaka-player/lib/dash/mpd_utils.js","webpack:///../node_modules/shaka-player/lib/media/segment_reference.js","webpack:///../node_modules/shaka-player/lib/util/data_view_reader.js","webpack:///../node_modules/shaka-player/lib/util/mp4_parser.js","webpack:///../node_modules/shaka-player/lib/media/mp4_segment_index_parser.js","webpack:///../node_modules/shaka-player/lib/media/segment_index.js","webpack:///../node_modules/shaka-player/lib/util/ebml_parser.js","webpack:///../node_modules/shaka-player/lib/media/webm_segment_index_parser.js","webpack:///../node_modules/shaka-player/lib/dash/segment_base.js","webpack:///../node_modules/shaka-player/lib/dash/segment_list.js","webpack:///../node_modules/shaka-player/lib/dash/segment_template.js","webpack:///../node_modules/shaka-player/lib/media/manifest_parser.js","webpack:///../node_modules/shaka-player/lib/media/presentation_timeline.js","webpack:///../node_modules/shaka-player/lib/dash/dash_parser.js","webpack:///../node_modules/shaka-player/lib/hls/hls_classes.js","webpack:///../node_modules/shaka-player/lib/hls/hls_utils.js","webpack:///../node_modules/shaka-player/lib/util/text_parser.js","webpack:///../node_modules/shaka-player/lib/hls/manifest_text_parser.js","webpack:///../node_modules/shaka-player/lib/net/data_uri_plugin.js","webpack:///../node_modules/shaka-player/lib/hls/hls_parser.js","webpack:///../node_modules/shaka-player/lib/media/ttml_text_parser.js","webpack:///../node_modules/shaka-player/lib/media/mp4_ttml_parser.js","webpack:///../node_modules/shaka-player/lib/media/vtt_text_parser.js","webpack:///../node_modules/shaka-player/lib/media/mp4_vtt_parser.js","webpack:///../node_modules/shaka-player/lib/media/playhead.js","webpack:///../node_modules/shaka-player/lib/media/playhead_observer.js","webpack:///../node_modules/shaka-player/lib/media/streaming_engine.js","webpack:///../node_modules/shaka-player/lib/net/http_plugin.js","webpack:///../node_modules/shaka-player/lib/offline/db_engine.js","webpack:///../node_modules/shaka-player/lib/offline/download_manager.js","webpack:///../node_modules/shaka-player/lib/offline/offline_utils.js","webpack:///../node_modules/shaka-player/lib/offline/offline_manifest_parser.js","webpack:///../node_modules/shaka-player/lib/offline/offline_scheme.js","webpack:///../node_modules/shaka-player/lib/util/cancelable_chain.js","webpack:///../node_modules/shaka-player/lib/offline/storage.js","webpack:///../node_modules/shaka-player/lib/polyfill/all.js","webpack:///../node_modules/shaka-player/lib/polyfill/fullscreen.js","webpack:///../node_modules/shaka-player/lib/polyfill/indexed_db.js","webpack:///../node_modules/shaka-player/lib/polyfill/mathround.js","webpack:///../node_modules/shaka-player/lib/util/pssh.js","webpack:///../node_modules/shaka-player/lib/polyfill/patchedmediakeys_ms.js","webpack:///../node_modules/shaka-player/lib/polyfill/patchedmediakeys_nop.js","webpack:///../node_modules/shaka-player/lib/polyfill/patchedmediakeys_webkit.js","webpack:///../node_modules/shaka-player/lib/polyfill/mediakeys.js","webpack:///../node_modules/shaka-player/lib/polyfill/mediasource.js","webpack:///../node_modules/shaka-player/lib/polyfill/promise.js","webpack:///../node_modules/shaka-player/lib/polyfill/video_play_promise.js","webpack:///../node_modules/shaka-player/lib/polyfill/videoplaybackquality.js","webpack:///../node_modules/shaka-player/lib/polyfill/vttcue.js"],"names":["Track","_id","_active","value","_label","_language","_index","settings","id","active","label","language","index","JsLogger","LOG_LEVEL","DEBUG","INFO","TIME","WARN","ERROR","OFF","LoggerFactory","options","useDefaults","name","get","lf","defaultLevel","FakeEvent","type","payload","bubbles","cancelable","defaultPrevented","timeStamp","window","performance","now","Date","isTrusted","currentTarget","target","stopped","AudioTrack","TextTrack","_kind","kind","VideoTrack","_bandwidth","bandwidth","EventManager","_bindingMap","removeAll","Promise","resolve","listener","binding","Binding_","push","list","i","length","unlisten","remove","listeners","getAll","clear","addEventListener","removeEventListener","HTML5_EVENTS","ABORT","CAN_PLAY","CAN_PLAY_THROUGH","DURATION_CHANGE","EMPTIED","ENDED","LOADED_DATA","LOADED_METADATA","LOAD_START","PAUSE","PLAY","PLAYING","PROGRESS","RATE_CHANGE","SEEKED","SEEKING","STALLED","SUSPEND","TIME_UPDATE","VOLUME_CHANGE","WAITING","CUSTOM_EVENTS","VIDEO_TRACK_CHANGED","AUDIO_TRACK_CHANGED","TEXT_TRACK_CHANGED","TRACKS_CHANGED","PLAYER_STATE_CHANGED","FIRST_PLAY","SOURCE_SELECTED","PLAYER_EVENTS","Player","config","_tracks","_firstPlay","_logger","getLogger","_stateManager","_pluginManager","_eventManager","_readyPromise","reject","listen","configure","_config","_defaultConfig","_loadPlugins","_selectEngine","_attachMedia","_engine","destroy","plugins","load","sources","canPlayType","mimetype","dispatchEvent","selectedSource","_loadEngine","source","preload","playerEvent","event","_markActiveTrack","selectedVideoTrack","selectedAudioTrack","selectedTextTrack","_onPlay","bind","_getTracksByType","filter","track","VIDEO","AUDIO","TEXT","selectVideoTrack","selectAudioTrack","selectTextTrack","enableAdaptiveBitrate","tracks","getTracks","then","data","catch","error","src","play","ready","pause","sessionId","session","to","boundedTo","duration","currentTime","vol","boundedVol","volume","paused","seeking","mute","muted","FakeEventTarget","_listeners","dispatchTarget","handleEvent","call","exception","PlayerError","param","message","TYPE","NOT_REGISTERED_PLUGIN","NOT_VALID_HANDLER","NOT_IMPLEMENTED_METHOD","method","isNumber","n","Number","isInt","isFloat","merge","objects","obj","Object","assign","BaseMediaSourceAdapter","videoElement","_videoElement","_sourceObj","_trigger","CustomEvents","getError","videoTrack","audioTrack","textTrack","mimeType","MediaSourceProvider","mediaSourceAdapter","_mediaSourceAdapters","includes","debug","indexOf","splice","mediaSourceAdapters","_selectedAdapter","createAdapter","engines","registerMediaSourceAdapter","register","BasePlugin","player","eventManager","logger","constructor","defaultConfig","attr","update","PluginManager","_plugins","Map","_registry","has","pluginClass","isValid","set","createPlugin","forEach","_destroy","plugin","delete","handler","prototype","registerPlugin","PLAYER_STATE_TYPES","IDLE","LOADING","PAUSED","BUFFERING","MultiMap","_map","key","Array","isArray","values","slice","concat","keys","Html5","_createVideoElement","_loadMediaSourceAdapter","attach","detach","_mediaSourceAdapter","_el","removeAttribute","parentNode","removeChild","document","createElement","style","width","height","backgroundColor","controls","body","appendChild","getMediaSourceAdapter","getVideoElement","seekable","played","buffered","defaultMuted","poster","autoplay","loop","playbackRate","defaultPlaybackRate","ended","networkState","readyState","videoHeight","videoWidth","TEST_VID","e","EngineName","NativeAdapter","toLowerCase","toString","_loadPromise","_getParsedTracks","url","videoTracks","_getParsedVideoTracks","audioTracks","_getParsedAudioTracks","textTracks","_getParsedTextTracks","parsedTracks","selected","enabled","mode","_disableVideoTracks","_onTrackChanged","_disableAudioTracks","_disableTextTracks","playkit","packageData","VERSION","version","log","StateManager","_transitions","_updateState","_dispatchEvent","_player","autoPlay","_history","_prevState","_curState","_attachListeners","_doTransition","transition","State","_duration","_timestamp","endTime","TRACK_TYPES","Playkit","OvpProvider","PlaykitUI","RequestBuilder","headers","baseUrl","Error","service","action","request","XMLHttpRequest","onreadystatechange","status","jsonResponse","JSON","parse","responseText","code","open","getUrl","setRequestHeader","send","params","beUrl","serviceParams","clientTag","apiVersion","format","Configuration","clientConfig","Scheme","initEnum","PLAYREADY_CENC","WIDEVINE_CENC","FAIRPLAY","PLAYREADY","WIDEVINE","KalturaRuleActionType","DRM_POLICY","BLOCK","PREVIEW","LIMIT_FLAVORS","ADD_TO_STORAGE","LIMIT_DELIVERY_PROFILES","SERVE_FROM_REMOTE_SERVER","REQUEST_HOST_REGEX","LIMIT_THUMBNAIL_CAPTURE","Status","QUEUED","CONVERTING","READY","DELETED","NOT_APPLICABLE","TEMP","WAIT_FOR_CONVERT","IMPORTING","VALIDATING","EXPORTING","MetadataObjectType","AD_CUE_POINT","ANNOTATION","CODE_CUE_POINT","THUMB_CUE_POINT","ENTRY","CATEGORY","USER","PARTNER","DYNAMIC_OBJECT","MetadataStatus","VALID","INVALID","EntryStatus","ERROR_IMPORTING","ERROR_CONVERTING","SCAN_FAILURE","IMPORT","INFECTED","PRECONVERT","PENDING","MODERATE","BLOCKED","NO_CONTENT","EntryModerationStatus","PENDING_MODERATION","APPROVED","REJECTED","FLAGGED_FOR_REVIEW","AUTO_APPROVED","EntryType","AUTOMATIC","EXTERNAL_MEDIA","MEDIA_CLIP","MIX","PLAYLIST","DATA","LIVE_STREAM","LIVE_CHANNEL","DOCUMENT","MediaType","IMAGE","LIVE_STREAM_FLASH","LIVE_STREAM_WINDOWS_MEDIA","LIVE_STREAM_REAL_MEDIA","LIVE_STREAM_QUICKTIME","MediaEntryType","UIConfType","PLAYER","CONTRIBUTION_WIZARD","SIMPLE_EDITOR","ADVANCED_EDITOR","APP_STUDIO","KRECORD","PLAYER_V3","KMC_ACCOUNT","KMC_ANALYTICS","KMC_CONTENT","KMC_DASHBOARD","KMC_LOGIN","PLAYER_SL","CLIENTSIDE_ENCODER","KMC_GENERAL","KMC_ROLES_AND_PERMISSIONS","CLIPPER","KSR","KUPLOAD","WEBCASTING","UIConfCreationMode","WIZARD","ADVANCED","SERVICE_NAME","OvpService","ks","partnerId","ovpParams","multiReq","ServiceResult","response","hasError","objectType","ServiceError","Logger","MultiRequestBuilder","requests","requestParams","serviceDef","stringify","err","doHttpRequest","MultiRequestResult","errorText","results","success","result","serviceResult","MediaSource","MediaEntry","metaData","Unknown","Drm","licenseUrl","scheme","KalturaFlavorAsset","flavorParamsId","fileExt","bitrate","frameRate","isOriginal","isWeb","containerFormat","videoCodecId","KalturaMediaEntry","entry","dataUrl","entryType","mediaType","flavorParamsIds","KalturaMetadataListResponse","responseObj","totalCount","metas","map","meta","KalturaPlaybackContext","actions","messages","flavorAssets","flavor","KalturaPlaybackSource","drm","deliveryProfileId","protocols","flavorIds","protocol","returnValue","protocolsArr","split","p","DataLoaderManager","partnerID","_loaders","_multiRequest","getMultirequest","loader","execution_loader","startIndex","add","executionLoaderResponseMap","from","val","_loadersResponseMap","execute","_multiResponse","preparedData","prepareData","loaderDataIndexes","MediaEntryLoader","_response","buildRequests","_entryId","entryId","getPlaybackContext","_requests","mediaEntryResponse","entries","playBackContextResult","metadataListResult","SessionLoader","_partnerId","anonymousSession","UiConfigLoader","_uiConfId","uiConfId","uiConf","SUPPORTED_FORMATS","dash","hls","mp4","ProviderParser","mediaEntry","playbackContext","metadataList","kalturaSources","parseSource","metadata","parseMetaData","Image","Audio","Vod","Live","playUrl","mediaFormat","mediaSource","hasFlavorIds","splittedUrl","baseProtocol","substring","extension","flavorIdsArr","flavors","pathExt","build","getProtocol","hasDrmData","drmParams","licenseURL","drmData","metaXml","domParser","DOMParser","xml","replace","parseFromString","metasObj","xmlToJson","metaKeys","MediaFormat","wvm","mp3","_isAnonymous","_dataLoader","validateParams","fetchData","parseDataFromResponse","uiConfID","sessionLoader","uiConfLoader","pluginsJson","mediaLoader","getMediaEntry","PlaySourceUrlBuilder","urlParams","endsWith","string","searchString","KalturaAccessControlMessage","KalturaBaseEntryListResponse","KalturaDrmPlaybackPluginData","KalturaMetadata","metadataProfileId","metadataProfileVersion","metadataObjectType","objectId","created","setUTCSeconds","createdAt","updated","updatedAt","KalturaRuleAction","KalturaUiConfResponse","description","objTypeAsString","htmlParams","swfUrl","confFilePath","confFile","confFileFeatures","confVars","useCdn","tags","swfUrlVersion","html5Url","partnerTags","objType","creationMode","BaseEntryService","tag","contextDataParams","flavorTags","getEntryListReqParams","filterParams","redirectFromEntryId","responseProfileParams","fields","responseProfile","MetaDataService","objectIdEqual","metadataObjectTypeEqual","SessionService","widgetId","UiConfService","XmlParser","nodeType","attributes","j","attribute","item","nodeName","nodeValue","hasChildNodes","childNodes","old","BaseComponent","bindActions","dispatch","Icon","props","types","ADD_PLAYER_CLASS","REMOVE_PLAYER_CLASS","UPDATE_IS_MOBILE","initialState","playerClasses","state","className","c","isMobile","addPlayerClass","removePlayerClass","updateIsMobile","TOGGLE_PLAY","isPlaying","toggleIsPlaying","TOGGLE_SHARE_OVERLAY","overlayOpen","show","toggleShareOverlay","UPDATE_PLAYER_STATE","UPDATE_IS_PLAYING","UPDATE_CURRENT_TIME","UPDATE_DURATION","UPDATE_VOLUME","UPDATE_MUTED","UPDATE_METADATA_LOADING_STATUS","UPDATE_AUDIO_TRACKS","UPDATE_VIDEO_TRACKS","UPDATE_TEXT_TRACKS","metadataLoaded","playerState","previousState","currentState","updatePlayerState","prevoiusState","updateIsPlaying","updateCurrentTime","updateDuration","updateVolume","updateMuted","updateMetadataLoadingStatus","updateAudioTracks","updateVideoTracks","updateTextTracks","UPDATE_SEEKBAR_DRAGGING_STATUS","draggingActive","updateSeekbarDraggingStatus","UPDATE_VOLUME_DRAGGING_STATUS","updateVolumeDraggingStatus","UPDATE_FULLSCREEN","fullscreen","updateFullscreen","UPDATE_LOADING_SPINNER_STATE","showLoadingSpinner","updateLoadingSpinnerState","TOGGLE_CVAA_OVERLAY","toggleCVAAOverlay","UPDATE_QUALITY","UPDATE_SPEED","quality","speed","updateQuality","updateSpeed","toHHMMSS","input","sec_num","parseInt","hours","Math","floor","minutes","seconds","SmartContainer","children","onSelect","o","Overlay","overlayClass","onClose","UIManager","ui","template","_buildUI","store","devToolsExtension","instanceId","playerWrapper","playerElement","getElementsByTagName","getElementsByClassName","reducer","engine","shell","seekbar","loading","playPause","share","cvaa","EngineConnector","Event","oldState","newState","TrackType","mapStateToProps","Shell","join","orientation","navigator","userAgent","OverlayPlay","setState","animation","setTimeout","togglePlayPause","Loading","PlayPauseControl","controlButtonClass","virtualProgress","virtualTime","isDraggingActive","SeekBarControl","onSeekbarMouseDown","time","getTime","updateSeekBarProgress","onSeekbarMouseUp","onSeekbarMouseMove","_playerElement","_seekBarElement","virtual","clientX","offsetLeft","clientWidth","parseFloat","toFixed","ceil","virtualProgressWidth","progressWidth","framePreviewStyle","getThumbSpriteOffset","round","showFramePreview","showTimeBubble","VolumeControl","_volumeControlElement","_volumeProgressBarElement","changeVolume","barHeight","clientHeight","topY","getCoords","top","clickY","clientY","el","box","getBoundingClientRect","pageYOffset","left","pageXOffset","onVolumeControlButtonClick","onVolumeProgressBarMouseDown","onVolumeProgressBarClick","getVolumeProgessHeight","ShareControl","SettingsControl","smartContainerOpen","speedOptions","onControlButtonClick","qualityOptions","onQualityChange","onSpeedChange","DropDownMenu","dropMenuActive","t","isSelected","LanguageControl","onAudioChange","onCaptionsChange","FullscreenControl","webkitIsFullScreen","webkitRequestFullscreen","webkitCancelFullScreen","exitFullscreen","enterFullscreen","toggleFullscreen","TimeDisplay","current","total","getTimeDisplay","TopBar","BottomBar","ShareOverlay","CVAAOverlay","KeyboardControl","onkeydown","newVolume","which","disableKeyboardCommandsOnControls","controlButtonsElements","element","preventDefault","HlsAdapter","canHlsPlayType","_hlsMimeTypes","isHlsSupported","isSupported","_hls","_addBindings","on","Events","_onError","LEVEL_SWITCHED","_onLevelSwitched","AUDIO_TRACK_SWITCHED","_onAudioTrackSwitched","MANIFEST_LOADED","_playerTracks","_parseTracks","loadSource","attachMedia","_removeBindings","detachMedia","_parseAudioTracks","_parseVideoTracks","levels","_parseTextTracks","hlsAudioTracks","lang","hlsVideoTracks","startLevel","vidTextTracks","autoLevelEnabled","nextLevel","_disableAllTextTracks","find","level","errorType","errorDetails","details","errorFatal","fatal","ErrorTypes","NETWORK_ERROR","startLoad","MEDIA_ERROR","recoverMediaError","ErrorDetails","MANIFEST_LOAD_ERROR","MANIFEST_LOAD_TIMEOUT","MANIFEST_PARSING_ERROR","LEVEL_LOAD_ERROR","LEVEL_LOAD_TIMEOUT","LEVEL_SWITCH_ERROR","FRAG_LOAD_ERROR","FRAG_LOOP_LOADING_ERROR","FRAG_LOAD_TIMEOUT","FRAG_PARSING_ERROR","BUFFER_APPEND_ERROR","BUFFER_APPENDING_ERROR","off","DashAdapter","_dashMimeType","polyfill","installAll","isBrowserSupported","_shaka","_onAdaptation","variantTracks","getVariantTracks","activeVariantTrack","variantTrack","audioId","videoId","_getVideoTracks","_getAudioTracks","getTextTracks","abr","selectVariantTrack","selectAudioLanguage","selectTextLanguage","goog.global","goog.global.CLOSURE_NO_DEPS","CLOSURE_NO_DEPS","goog.exportSymbol","publicPath","object","parts","cur","execScript","part","shift","goog.inherits","childCtor","shaka.util.FakeEventTarget","tempCtor","parentCtor","superClass_","base","childCtor.base","me","methodName","var_args","apply","args","arguments","shaka.abr.Ewma","halfLife","alpha_","exp","totalWeight_","estimate_","shaka.abr.Ewma.prototype.sample","weight","adjAlpha","pow","newEstimate","isNaN","shaka.abr.Ewma.prototype.getEstimate","shaka.abr.EwmaBandwidthEstimator","fast_","slow_","bytesSampled_","defaultEstimate_","shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE","setDefaultEstimate","shaka.abr.EwmaBandwidthEstimator.prototype.setDefaultEstimate","estimate","getBandwidthEstimate","shaka.abr.EwmaBandwidthEstimator.prototype.getBandwidthEstimate","minTotalBytes_","min","getEstimate","shaka.log.error","shaka.util.Error","severity","category","shaka.util.Error.prototype.toString","shaka.util.Error.Severity","shaka.util.Error.Category","shaka.util.Error.Code","goog.uri.utils.splitRe_","goog.Uri","opt_uri","m","setScheme","scheme_","setUserInfo","userInfo_","setDomain","domain_","setPort","port_","setPath","path_","setQueryData","clone","queryData_","setFragment","fragment_","String","uri","match","SCHEME","goog.Uri.decodeOrEmpty_","USER_INFO","DOMAIN","PORT","PATH","QUERY_DATA","FRAGMENT","goog.Uri.QueryData","goog$Uri.prototype","goog.Uri.prototype","goog.Uri.prototype.toString","out","getScheme","goog.Uri.encodeSpecialChars_","goog.Uri.reDisallowedInSchemeOrUserInfo_","domain","getDomain","userInfo","getUserInfo","encodeURIComponent","doubleEncodedString","port","getPort","path","getPath","hasDomain","charAt","goog.Uri.reDisallowedInAbsolutePath_","goog.Uri.reDisallowedInRelativePath_","query","getEncodedQuery","fragment","getFragment","goog.Uri.reDisallowedInFragment_","goog.Uri.prototype.resolve","relativeUri","absoluteUri","overridden","hasPath","lastSlashIndex","lastIndexOf","substr","leadingSlash","segments","pos","segment","pop","goog.Uri.prototype.setScheme","newScheme","opt_decode","goog.Uri.prototype.setPort","newPort","goog.Uri.prototype.setQueryData","queryData","goog.Uri.reDisallowedInQuery_","opt_preserveReserved","decodeURI","decodeURIComponent","unescapedPart","extra","opt_removeDoubleEncoding","encoded","encodeURI","goog.Uri.encodeChar_","ch","charCodeAt","opt_query","encodedQuery_","keyMap_","count_","goog.Uri.QueryData.prototype.toString","sb","encodedKey","goog.Uri.QueryData.prototype.clone","rv","cloneMap","shaka.util.Functional.createFallbackPromiseChain","array","callback","reduce","promise","elem","shaka.util.Functional.collapseArrays","all","shaka.util.Functional.noop","shaka.util.Functional.isNotNull","shaka.util.Functional.isNotEqualFunc","compare","a","shaka.util.Functional.isNotDuplicate","position","self","shaka.util.ManifestParserUtils.resolveUris","baseUris","relativeUris","relativeAsGoog","shaka.util.ManifestParserUtils.createDrmInfo","keySystem","initData","licenseServerUri","distinctiveIdentifierRequired","persistentStateRequired","audioRobustness","videoRobustness","serverCertificate","keyIds","shaka.util.ConfigUtils.mergeConfigObjects","destination","overrides","ignoreKeys","k","subPath","subTemplate","copyObject","undefined","shaka.util.ConfigUtils.cloneObject","arg","shaka.util.PublicPromise","resolvePromise","rejectPromise","shaka.net.NetworkingEngine","opt_onSegmentDownloaded","destroyed_","requests_","requestFilters_","responseFilters_","onSegmentDownloaded_","NetworkingEngine","shaka.net.NetworkingEngine.RequestType","shaka.net.NetworkingEngine.schemes_","shaka.net.NetworkingEngine.registerScheme","shaka.net.NetworkingEngine.unregisterScheme","registerRequestFilter","shaka.net.NetworkingEngine.prototype.registerRequestFilter","goog.exportProperty","unregisterRequestFilter","shaka.net.NetworkingEngine.prototype.unregisterRequestFilter","filters","clearAllRequestFilters","shaka.net.NetworkingEngine.prototype.clearAllRequestFilters","registerResponseFilter","shaka.net.NetworkingEngine.prototype.registerResponseFilter","unregisterResponseFilter","shaka.net.NetworkingEngine.prototype.unregisterResponseFilter","clearAllResponseFilters","shaka.net.NetworkingEngine.prototype.clearAllResponseFilters","shaka.net.NetworkingEngine.defaultRetryParameters","maxAttempts","baseDelay","backoffFactor","fuzzFactor","timeout","shaka.net.NetworkingEngine.makeRequest","uris","retryParams","allowCrossSiteCredentials","retryParameters","shaka.net.NetworkingEngine.prototype.destroy","cleanup","shaka.net.NetworkingEngine.prototype.request","filterStartMs","requestFilter","shaka.util.Error.Severity.CRITICAL","shaka.util.Error.Category.NETWORK","shaka.util.Error.Code.REQUEST_FILTER_ERROR","filterTimeMs","retry","delay","send_","shaka.util.Error.Severity.RECOVERABLE","random","resend_","fromCache","shaka.net.NetworkingEngine.RequestType.SEGMENT","timeMs","byteLength","shaka.net.NetworkingEngine.prototype.send_","requestFilterTime","location","shaka.util.Error.Code.UNSUPPORTED_SCHEME","startTimeMs","responseFilter","shaka.util.Error.Code.RESPONSE_FILTER_ERROR","shaka.util.ArrayUtils.removeDuplicates","opt_compareFn","matchFound","shaka.util.ArrayUtils.indexOf","compareFn","shaka.util.MultiMap","map_","shaka.util.MultiMap.prototype.push","hasOwnProperty","shaka.util.MultiMap.prototype.get","shaka.util.MultiMap.prototype.remove","shaka.util.EventManager","bindingMap_","shaka.util.EventManager.prototype.destroy","shaka.util.EventManager.prototype.listen","shaka.util.EventManager.Binding_","shaka.util.EventManager.prototype.listenOnce","shaka.util.EventManager.prototype.unlisten","shaka.util.EventManager.prototype.removeAll","shaka.util.EventManager.Binding_.prototype.unlisten","shaka.util.MapUtils.empty","shaka.util.MapUtils.values","shaka.util.MapUtils.map","ret","shaka.util.MapUtils.every","every","shaka.util.MapUtils.forEach","shaka.util.StringUtils.fromUTF8","uint8","Uint8Array","subarray","escaped","escape","shaka.util.StringUtils.fromCharCode_","utf8","shaka.util.Error.Category.TEXT","shaka.util.Error.Code.BAD_ENCODING","fromUTF8","shaka.util.StringUtils.fromUTF16","littleEndian","opt_noThrow","ArrayBuffer","buffer","temp","arr","Uint16Array","dataView","DataView","getUint16","fromUTF16","shaka.util.StringUtils.fromBytesAutoDetect","isAscii","shaka.util.Error.Code.UNABLE_TO_DETECT_ENCODING","fromBytesAutoDetect","shaka.util.StringUtils.toUTF8","str","unescape","toUTF8","max","fromCharCode","subArray","shaka.util.Timer","id_","callback_","cancel","shaka.util.Timer.prototype.cancel","clearTimeout","shaka.util.Timer.prototype.schedule","shaka.util.Uint8ArrayUtils.toBase64","opt_padding","padding","base64","btoa","bytes","toBase64","shaka.util.Uint8ArrayUtils.fromBase64","atob","fromBase64","shaka.util.Uint8ArrayUtils.fromHex","fromHex","shaka.util.Uint8ArrayUtils.toHex","hex","toHex","shaka.util.Uint8ArrayUtils.equal","arr1","arr2","equal","shaka.util.Uint8ArrayUtils.concat","totalLength","offset","shaka.media.DrmEngine","networkingEngine","onError","onKeyStatus","onExpirationUpdated","video_","mediaKeys_","supportedTypes_","initialized_","currentDrmInfo_","eventManager_","activeSessions_","offlineSessionIds_","allSessionsLoaded_","networkingEngine_","config_","onError_","keyStatusByKeyId_","onKeyStatus_","onExpirationUpdated_","keyStatusTimer_","processKeyStatusChanges_","isOffline_","mediaKeyMessageEvents_","initialRequestsSent_","expirationInterval_","setInterval","pollExpiration_","shaka$media$DrmEngine.prototype","shaka.media.DrmEngine.prototype","shaka.media.DrmEngine.prototype.destroy","async","activeSession","close","setMediaKeys","clearInterval","shaka.media.DrmEngine.prototype.configure","init","shaka.media.DrmEngine.prototype.init","manifest","offline","configsByKeySystem","keySystemsInOrder","offlineSessionIds","prepareMediaKeyConfigs_","queryMediaKeys_","shaka.media.DrmEngine.prototype.attach","video","listenOnce","shaka.util.Error.Category.DRM","shaka.util.Error.Code.ENCRYPTED_CONTENT_WITHOUT_DRM_INFO","onPlay_","shaka.util.Error.Code.FAILED_TO_ATTACH_TO_VIDEO","setServerCertificate","shaka.util.Error.Code.INVALID_SERVER_CERTIFICATE","createOrLoad","onEncrypted_","onEncrypted","shaka.media.DrmEngine.prototype.removeSessions","sessions","loadOfflineSession_","updatePromise","shaka.media.DrmEngine.prototype.createOrLoad","initDatas","initDataOverride","createTemporarySession_","initDataType","shaka.media.DrmEngine.prototype.keySystem","shaka.media.DrmEngine.prototype.getSessionIds","getExpiration","shaka.media.DrmEngine.prototype.getExpiration","expirations","expiration","Infinity","shaka.media.DrmEngine.prototype.prepareMediaKeyConfigs_","clearKeyDrmInfo","configureClearKey_","periods","period","variants","variant","drmInfos","drmInfo","fillInDrmInfoDefaults_","cast","__platform__","audioCapabilities","videoCapabilities","distinctiveIdentifier","persistentState","sessionTypes","streams","audio","stream","capabilities","robustness","fullMimeType","codecs","contentType","shaka.media.DrmEngine.prototype.queryMediaKeys_","shaka.util.Error.Code.NO_RECOGNIZED_KEY_SYSTEMS","instigator","shouldHaveLicenseServer","some","hasLicenseServer","info","requestMediaKeySystemAccess","shaka.util.Error.Code.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE","mediaKeySystemAccess","isEdge","realConfig","getConfiguration","caps","originalConfig","createCurrentDrmInfo_","createMediaKeys","shaka.util.Error.Code.NO_LICENSE_SERVER_GIVEN","mediaKeys","shaka.util.Error.Code.FAILED_TO_CREATE_CDM","shaka.media.DrmEngine.prototype.fillInDrmInfoDefaults_","server","servers","advanced","shaka.media.DrmEngine.prototype.configureClearKey_","clearKeys","keyIdHex","keyHex","keyId","keyObj","kty","kid","license","jwkSet","initDataStr","shaka.media.DrmEngine.prototype.createCurrentDrmInfo_","licenseServers","serverCerts","processDrmInfos_","shaka.media.DrmEngine.prototype.processDrmInfos_","initDataOverrideEqual","b","shaka.media.DrmEngine.prototype.onEncrypted_","shaka.media.DrmEngine.prototype.loadOfflineSession_","createSession","shaka.util.Error.Code.FAILED_TO_CREATE_SESSION","onSessionMessage_","onKeyStatusesChange_","loaded","oldExpiration","present","s","shaka.util.Error.Code.OFFLINE_SESSION_REMOVED","shaka.media.DrmEngine.prototype.createTemporarySession_","generateRequest","shaka.util.Error.Code.FAILED_TO_GENERATE_LICENSE_REQUEST","shaka.media.DrmEngine.prototype.onSessionMessage_","delayLicenseRequest_","delayLicenseRequestUntilPlayed","sendLicenseRequest_","shaka.media.DrmEngine.prototype.sendLicenseRequest_","unpackPlayReadyRequest_","shaka.net.NetworkingEngine.RequestType.LICENSE","shakaErr","shaka.util.Error.Code.LICENSE_REQUEST_FAILED","shaka.util.Error.Code.LICENSE_RESPONSE_REJECTED","shaka.media.DrmEngine.prototype.unpackPlayReadyRequest_","dom","querySelector","textContent","challenge","shaka.media.DrmEngine.prototype.onKeyStatusesChange_","hasExpiredKeys","keyStatuses","tmp","part0","getUint32","part1","part2","setUint32","setUint16","msUntilExpiration","schedule","shaka.media.DrmEngine.prototype.processKeyStatusChanges_","isExpired","shaka.util.Error.Code.EXPIRED","shaka.media.DrmEngine.probeSupport","tests","basicVideoCapabilities","configs","offlineConfig","basicConfig","support","testKeySystems","access","shaka.media.DrmEngine.prototype.onPlay_","shaka.media.DrmEngine.prototype.isSupportedByKeySystem","shaka.media.DrmEngine.getCommonDrmInfos","drms1","drms2","commonDrms","drm1","drm2","mergedDrm","shaka.media.DrmEngine.prototype.pollExpiration_","new_","shaka.media.TextEngine","parser_","track_","timestampOffset_","appendWindowEnd_","bufferEnd_","bufferStart_","shaka.media.TextEngine.parserMap_","shaka.media.TextEngine.registerParser","shaka.media.TextEngine.TextParserWrapper_.bind","registerParser","unregisterParser","shaka.media.TextEngine.unregisterParser","shaka.media.TextEngine.makeCue","startTime","VTTCue","makeCue","shaka.media.TextEngine.prototype.destroy","removeWhere_","shaka.media.TextEngine.prototype.appendBuffer","parseInit","cues","parseMedia","periodStart","segmentStart","segmentEnd","addCue","shaka.media.TextEngine.prototype.remove","start","end","cue","shaka.media.TextEngine.prototype.removeWhere_","predicate","removeMe","removeCue","shaka.media.TextEngine.TextParserWrapper_","parser","shaka.media.TextEngine.TextParserWrapper_.prototype.parseInit","shaka.media.TextEngine.TextParserWrapper_.prototype.parseMedia","shaka.media.TimeRangesUtils.bufferEnd","shaka.media.TimeRangesUtils.isBuffered","shaka.media.TimeRangesUtils.bufferedAheadOf","shaka.media.MediaSourceEngine","mediaSource_","textTrack_","sourceBuffers_","textEngine_","queues_","shaka.media.MediaSourceEngine.probeSupport","testMimeTypes","isTypeSupported","basicType","shaka$media$MediaSourceEngine.prototype","shaka.media.MediaSourceEngine.prototype","shaka.media.MediaSourceEngine.prototype.destroy","q","inProgress","shaka.media.MediaSourceEngine.prototype.init","typeConfig","reinitText","sourceBuffer","addSourceBuffer","onUpdateEnd_","shaka.media.MediaSourceEngine.prototype.reinitText","factory","shaka.media.MediaSourceEngine.prototype.bufferStart","shaka.media.MediaSourceEngine.prototype.getBuffered_","shaka.media.MediaSourceEngine.prototype.appendBuffer","appendBuffer","enqueueOperation_","append_","shaka.media.MediaSourceEngine.prototype.remove","remove_","shaka.media.MediaSourceEngine.prototype.clear","shaka.media.MediaSourceEngine.prototype.setStreamProperties","timestampOffset","appendWindowEnd","abort_","setTimestampOffset_","setAppendWindowEnd_","endOfStream","shaka.media.MediaSourceEngine.prototype.endOfStream","opt_reason","enqueueBlockingOperation_","setDuration","shaka.media.MediaSourceEngine.prototype.setDuration","getDuration","shaka.media.MediaSourceEngine.prototype.getDuration","shaka_media_MediaSourceEngine_prototype$append_","shaka.media.MediaSourceEngine.prototype.append_","shaka.media.MediaSourceEngine.prototype.remove_","shaka.media.MediaSourceEngine.prototype.abort_","abort","flush_","shaka.media.MediaSourceEngine.prototype.flush_","shaka.media.MediaSourceEngine.prototype.setTimestampOffset_","shaka.media.MediaSourceEngine.prototype.setAppendWindowEnd_","fudge","shaka_media_MediaSourceEngine_prototype$onError_","shaka.media.MediaSourceEngine.prototype.onError_","operation","shaka.util.Error.Category.MEDIA","shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_FAILED","shaka.media.MediaSourceEngine.prototype.onUpdateEnd_","popFromQueue_","shaka.media.MediaSourceEngine.prototype.enqueueOperation_","shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR","shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW","shaka.media.MediaSourceEngine.prototype.enqueueBlockingOperation_","run","allWaiters","shaka.media.MediaSourceEngine.prototype.popFromQueue_","next","shaka.util.LanguageUtils.match","fuzz","preference","candidate","shaka.util.LanguageUtils.MatchType.BASE_LANGUAGE_OKAY","shaka.util.LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY","BASE_LANGUAGE_OKAY","OTHER_SUB_LANGUAGE_OKAY","shaka.util.LanguageUtils.normalize","replacement","shaka.util.LanguageUtils.isoMap_","shaka.util.StreamUtils.meetsRestrictions","restrictions","maxHwRes","minWidth","maxWidth","minHeight","maxHeight","minPixels","maxPixels","minBandwidth","maxBandwidth","shaka.util.StreamUtils.applyRestrictions","tracksChanged","originalAllowed","allowedByApplication","shaka.util.StreamUtils.filterPeriod","drmEngine","activeStreams","activeVideo","activeAudio","isSupportedByKeySystem","shaka.util.StreamUtils.streamIsCompatible_","textStreams","shaka.util.StreamUtils.getFullMimeType","activeStream","drmSupportedMimeTypes","encrypted","shaka.util.StreamUtils.getVariantTracks","activeAudioId","activeVideoId","shaka.util.StreamUtils.getPlayableVariants","isActive","audioCodec","videoCodec","roles","audioRoles","videoRoles","primary","shaka.util.StreamUtils.getTextTracks","activeStreamId","shaka.util.StreamUtils.findVariantForTrack","shaka.util.StreamUtils.findTextStreamForTrack","allowedByKeySystem","shaka.util.StreamUtils.filterVariantsByRoleAndLanguage","preferredLanguage","opt_languageMatches","opt_role","chosen","primaryVariants","pref","EXACT","matchType","betterLangMatchFound","role","chosenWithRoles","shaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage","primaryStreams","shaka.util.StreamUtils.getVariantByStreams","shaka.util.StreamUtils.getVariantByStreamIds","matchesId","opt_codecs","shaka.util.StreamUtils.findPeriodContainingTime","shaka.util.StreamUtils.findPeriodContainingStream","periodIdx","textStream","trickModeVideo","shaka.abr.SimpleAbrManager","switch_","enabled_","bandwidthEstimator_","variants_","textStreams_","startupComplete_","lastTimeChosenMs_","restrictions_","SimpleAbrManager","stop","shaka.abr.SimpleAbrManager.prototype.stop","shaka.abr.SimpleAbrManager.prototype.init","switchCallback","chooseStreams","shaka.abr.SimpleAbrManager.prototype.chooseStreams","mediaTypesToUpdate","sortedVariants","shaka.abr.SimpleAbrManager.filterAndSortVariants_","chooseVariant_","currentBandwidth","shaka.util.Error.Category.MANIFEST","shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET","shaka.abr.SimpleAbrManager.BANDWIDTH_UPGRADE_TARGET_","shaka.abr.SimpleAbrManager.BANDWIDTH_DOWNGRADE_TARGET_","enable","shaka.abr.SimpleAbrManager.prototype.enable","disable","shaka.abr.SimpleAbrManager.prototype.disable","segmentDownloaded","shaka.abr.SimpleAbrManager.prototype.segmentDownloaded","deltaTimeMs","numBytes","minBytes_","sample","suggestStreams_","shaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS","shaka.abr.SimpleAbrManager.prototype.getBandwidthEstimate","shaka.abr.SimpleAbrManager.prototype.setDefaultEstimate","setRestrictions","shaka.abr.SimpleAbrManager.prototype.setRestrictions","setVariants","shaka.abr.SimpleAbrManager.prototype.setVariants","setTextStreams","shaka.abr.SimpleAbrManager.prototype.setTextStreams","sort","v1","v2","shaka.util.FakeEvent","opt_dict","dict","shaka.util.FakeEvent.prototype.preventDefault","stopImmediatePropagation","shaka.util.FakeEvent.prototype.stopImmediatePropagation","stopPropagation","shaka.util.FakeEvent.prototype.stopPropagation","shaka.cast.CastUtils.VideoEvents","shaka.cast.CastUtils.VideoAttributes","shaka.cast.CastUtils.VideoInitStateAttributes","shaka.cast.CastUtils.VideoVoidMethods","shaka.cast.CastUtils.PlayerEvents","shaka.cast.CastUtils.PlayerGetterMethods","shaka.cast.CastUtils.PlayerInitState","shaka.cast.CastUtils.PlayerInitAfterLoadState","shaka.cast.CastUtils.PlayerVoidMethods","shaka.cast.CastUtils.PlayerPromiseMethods","shaka.cast.CastUtils.serialize","thing","simpleEvent","eventKey","eventValue","TimeRanges","ranges","shaka.cast.CastUtils.deserialize","NaN","shaka.cast.CastUtils.simulateTimeRanges_","shaka.cast.CastSender","receiverAppId","onStatusChanged","onRemoteEvent","onResumeLocal","onInitStateRequired","receiverAppId_","onStatusChanged_","onRemoteEvent_","onResumeLocal_","onInitStateRequired_","isCasting_","hasReceivers_","apiReady_","receiverName_","session_","appData_","cachedProperties_","nextAsyncCallId_","asyncCallPromises_","castPromise_","shaka$cast$CastSender.prototype","shaka.cast.CastSender.prototype","shaka.cast.CastSender.prototype.destroy","rejectAllPromises_","leave","isCasting","shaka.cast.CastSender.prototype.isCasting","receiverName","shaka.cast.CastSender.prototype.receiverName","shaka.cast.CastSender.prototype.init","chrome","isAvailable","__onGCastApiAvailable","sessionRequest","SessionRequest","apiConfig","ApiConfig","onExistingSessionJoined_","onReceiverStatusChanged_","initialize","setAppData","shaka.cast.CastSender.prototype.setAppData","appData","sendMessage_","shaka.cast.CastSender.prototype.cast","initState","shaka.util.Error.Category.CAST","shaka.util.Error.Code.CAST_API_UNAVAILABLE","shaka.util.Error.Code.NO_CAST_RECEIVERS","shaka.util.Error.Code.ALREADY_CASTING","requestSession","onSessionInitiated_","onConnectionError_","forceDisconnect","shaka.cast.CastSender.prototype.forceDisconnect","shaka.cast.CastSender.prototype.get","targetName","property","shaka.cast.CastUtils.VideoVoidMethods.indexOf","remoteCall_","shaka.cast.CastUtils.PlayerVoidMethods.indexOf","shaka.cast.CastUtils.PlayerPromiseMethods.indexOf","remoteAsyncCall_","shaka.cast.CastUtils.PlayerGetterMethods.indexOf","propertyGetter_","shaka.cast.CastSender.prototype.set","shaka.cast.CastSender.prototype.onSessionInitiated_","onSessionCreated_","addUpdateListener","onConnectionStatusChanged_","addMessageListener","shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE","onMessageReceived_","shaka.cast.CastSender.prototype.onConnectionError_","shaka.util.Error.Code.UNEXPECTED_CAST_ERROR","shaka.util.Error.Code.CAST_CANCELED_BY_USER","shaka.util.Error.Code.CAST_CONNECTION_TIMED_OUT","shaka.util.Error.Code.CAST_RECEIVER_APP_UNAVAILABLE","shaka.cast.CastSender.prototype.propertyGetter_","shaka.cast.CastSender.prototype.remoteCall_","shaka.cast.CastSender.prototype.remoteAsyncCall_","shaka.cast.CastSender.prototype.onExistingSessionJoined_","shaka.cast.CastSender.prototype.onReceiverStatusChanged_","availability","shaka.cast.CastSender.prototype.onConnectionStatusChanged_","connected","receiver","friendlyName","shaka.cast.CastSender.prototype.rejectAllPromises_","shaka.util.Error.Category.PLAYER","shaka.util.Error.Code.LOAD_INTERRUPTED","shaka.cast.CastSender.prototype.onMessageReceived_","namespace","serialized","fakeEvent","reconstructedError","shaka.cast.CastSender.prototype.sendMessage_","sendMessage","listeners_","shaka.util.FakeEventTarget.prototype.addEventListener","shaka.util.FakeEventTarget.prototype.removeEventListener","shaka.util.FakeEventTarget.prototype.dispatchEvent","shaka.cast.CastProxy","shaka.util.FakeEventTarget.call","localVideo_","localPlayer_","playerEventTarget_","videoEventTarget_","playerProxy_","videoProxy_","sender_","onCastStatusChanged_","getInitState_","init_","CastProxy","shaka.cast.CastProxy.prototype.destroy","opt_forceDisconnect","getVideo","shaka.cast.CastProxy.prototype.getVideo","getPlayer","shaka.cast.CastProxy.prototype.getPlayer","canCast","shaka.cast.CastProxy.prototype.canCast","shaka.cast.CastProxy.prototype.isCasting","shaka.cast.CastProxy.prototype.receiverName","shaka.cast.CastProxy.prototype.cast","unload","shaka.cast.CastProxy.prototype.setAppData","suggestDisconnect","shaka.cast.CastProxy.prototype.suggestDisconnect","shaka.cast.CastProxy.prototype.forceDisconnect","shaka.cast.CastProxy.prototype.init_","shaka.cast.CastUtils.VideoEvents.forEach","videoProxyLocalEvent_","shaka.cast.CastUtils.PlayerEvents.forEach","playerProxyLocalEvent_","defineProperty","configurable","enumerable","videoProxyGet_","videoProxySet_","playerProxyGet_","shaka$cast$CastProxy.prototype","shaka.cast.CastProxy.prototype","shaka.cast.CastProxy.prototype.getInitState_","manifestUri_","shaka.cast.CastUtils.VideoInitStateAttributes.forEach","shaka.cast.CastUtils.PlayerInitState.forEach","pair","setter","getter","shaka.cast.CastUtils.PlayerInitAfterLoadState.forEach","shaka_cast_CastProxy_prototype$onCastStatusChanged_","shaka.cast.CastProxy.prototype.onCastStatusChanged_","shaka_cast_CastProxy_prototype$onResumeLocal_","shaka.cast.CastProxy.prototype.onResumeLocal_","manifestUri","manifestReady","videoState","shaka.cast.CastProxy.prototype.videoProxyGet_","shaka.cast.CastProxy.prototype.videoProxySet_","shaka.cast.CastProxy.prototype.videoProxyLocalEvent_","shaka.cast.CastProxy.prototype.playerProxyGet_","getNetworkingEngine","shaka.cast.CastProxy.prototype.playerProxyLocalEvent_","shaka_cast_CastProxy_prototype$onRemoteEvent_","shaka.cast.CastProxy.prototype.onRemoteEvent_","shaka.cast.CastReceiver","opt_appDataCallback","opt_contentIdCallback","player_","targets_","appDataCallback_","opt_contentIdCallback_","contentId","isConnected_","isIdle_","pollTimerId_","genericBus_","shakaBus_","CastReceiver","isConnected","shaka.cast.CastReceiver.prototype.isConnected","isIdle","shaka.cast.CastReceiver.prototype.isIdle","shaka.cast.CastReceiver.prototype.destroy","CastReceiverManager","getInstance","manager","shaka.cast.CastReceiver.prototype.init_","onSenderConnected","onSendersChanged_","onSenderDisconnected","onSystemVolumeChanged","fakeVolumeChangeEvent_","getCastMessageBus","shaka.cast.CastUtils.GENERIC_MESSAGE_NAMESPACE","onMessage","onGenericMessage_","onShakaMessage_","proxyEvent_","canDisplayType","setMaxHardwareResolution","shaka$cast$CastReceiver.prototype","shaka.cast.CastReceiver.prototype","shaka.cast.CastReceiver.prototype.onSendersChanged_","getSenders","shaka.cast.CastReceiver.prototype.onCastStatusChanged_","sendMediaStatus_","shaka.cast.CastReceiver.prototype.initState_","v","shaka.cast.CastReceiver.prototype.proxyEvent_","pollAttributes_","shaka.cast.CastReceiver.prototype.pollAttributes_","shaka.cast.CastUtils.VideoAttributes.forEach","shaka.cast.CastUtils.PlayerGetterMethods.forEach","systemVolume","getSystemVolume","shaka.cast.CastReceiver.prototype.fakeVolumeChangeEvent_","shaka.cast.CastReceiver.prototype.onShakaMessage_","initState_","setSystemVolumeLevel","setSystemVolumeMuted","senderId","sendAsyncComplete_","shaka.cast.CastReceiver.prototype.onGenericMessage_","resumeState","volumeObject","oldVolumeLevel","oldVolumeMuted","mediaInfo","media","isLive","shaka.cast.CastReceiver.prototype.sendAsyncComplete_","shaka.cast.CastReceiver.prototype.sendMessage_","bus","opt_senderId","getCastChannel","broadcast","shaka.cast.CastReceiver.prototype.sendMediaStatus_","requestId","opt_media","playState","shaka.cast.CastReceiver.PLAY_STATE","mediaStatus","getPlayState_","buffering_","shaka.util.XmlUtils.findChild","shaka.util.XmlUtils.findChildren","child","tagName","shaka.util.XmlUtils.getContents","contents","firstChild","Node","TEXT_NODE","trim","shaka.util.XmlUtils.parseAttr","parseFunction","opt_defaultValue","parsedValue","getAttribute","shaka.util.XmlUtils.parseDate","dateString","shaka.util.XmlUtils.parseDuration","durationString","matches","exec","d","years","months","days","isFinite","shaka.util.XmlUtils.parseRange","rangeString","shaka.util.XmlUtils.parseInt","intString","shaka.util.XmlUtils.parsePositiveInt","shaka.util.XmlUtils.parseNonNegativeInt","shaka.util.XmlUtils.evalDivision","exprString","res","shaka.dash.ContentProtection.defaultKeySystems_","shaka.dash.ContentProtection.parseFromAdaptationSet","elems","ignoreDrmInfo","parsed","shaka.dash.ContentProtection.parseElements_","defaultInit","defaultKeyId","parsedNonCenc","shaka.util.Error.Code.DASH_CONFLICTING_KEY_IDS","shaka.dash.ContentProtection.MP4Protection_","schemeUri","shaka.dash.ContentProtection.convertElements_","firstRepresentation","shaka.dash.ContentProtection.parseFromRepresentation","context","repContext","asUnknown","repUnencrypted","asInfo","repInfo","shaka.util.Error.Code.DASH_NO_COMMON_KEY_SYSTEM","elements","node","psshs","shaka.util.Error.Code.DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED","pssh","shaka.util.Error.Code.DASH_PSSH_BAD_ENCODING","shaka.dash.MpdUtils.fillUriTemplate","uriTemplate","representationId","number","valueTable","re","widthString","valueString","paddingSize","shaka.dash.MpdUtils.parseSegmentInfo","timescaleStr","shaka.dash.MpdUtils.inheritAttribute","timescale","durationStr","segmentDuration","startNumberStr","presentationTimeOffset","startNumber","timelineNode","shaka.dash.MpdUtils.inheritChild","timeline","periodInfo","timePoints","lastEndTime","timePoint","r","repeat","nextStartTime","nextTimePoint","periodDuration","unscaledStart","unscaledPresentationTimeOffset","representation","adaptationSet","nodes","shaka.media.InitSegmentReference","startByte","endByte","getUris","InitSegmentReference","shaka.media.SegmentReference","SegmentReference","shaka.util.DataViewReader","endianness","dataView_","littleEndian_","shaka.util.DataViewReader.Endianness.LITTLE_ENDIAN","position_","DataViewReader","LITTLE_ENDIAN","shaka.util.DataViewReader.Endianness","BIG_ENDIAN","hasMoreData","shaka.util.DataViewReader.prototype.hasMoreData","getPosition","shaka.util.DataViewReader.prototype.getPosition","getLength","shaka.util.DataViewReader.prototype.getLength","readUint8","shaka.util.DataViewReader.prototype.readUint8","getUint8","throwOutOfBounds_","readUint16","shaka.util.DataViewReader.prototype.readUint16","readUint32","shaka.util.DataViewReader.prototype.readUint32","readInt32","shaka.util.DataViewReader.prototype.readInt32","getInt32","readUint64","shaka.util.DataViewReader.prototype.readUint64","low","high","shaka.util.Error.Code.JS_INTEGER_OVERFLOW","readBytes","shaka.util.DataViewReader.prototype.readBytes","skip","shaka.util.DataViewReader.prototype.skip","readTerminatedString","shaka.util.DataViewReader.prototype.readTerminatedString","shaka.util.DataViewReader.prototype.throwOutOfBounds_","shaka.util.Error.Code.BUFFER_READ_OUT_OF_BOUNDS","shaka.util.Mp4Parser","headers_","boxDefinitions_","Mp4Parser","shaka.util.Mp4Parser.prototype.box","definition","typeCode","shaka.util.Mp4Parser.typeFromString_","BASIC_BOX","fullBox","shaka.util.Mp4Parser.prototype.fullBox","FULL_BOX","shaka.util.Mp4Parser.prototype.parse","reader","parseNext","shaka.util.Mp4Parser.prototype.parseNext","absStart","size","boxDefinition","flags","versionAndFlags","payloadSize","payloadReader","shaka.util.Mp4Parser.children","shaka.util.Mp4Parser.sampleDescription","count","shaka.util.Mp4Parser.allData","shaka.media.Mp4SegmentIndexParser","sidxData","sidxOffset","references","shaka.media.Mp4SegmentIndexParser.parseSIDX_","shaka.util.Error.Code.MP4_SIDX_WRONG_BOX_TYPE","shaka.util.Error.Code.MP4_SIDX_INVALID_TIMESCALE","earliestPresentationTime","firstOffset","referenceCount","unscaledStartTime","chunk","referenceType","referenceSize","subsegmentDuration","shaka.util.Error.Code.MP4_SIDX_TYPE_NOT_SUPPORTED","shaka.media.SegmentIndex","references_","SegmentIndex","shaka.media.SegmentIndex.prototype.destroy","shaka.media.SegmentIndex.prototype.find","shaka.media.SegmentIndex.prototype.get","shaka.media.SegmentIndex.prototype.merge","nextPosition","newReferences","r1","r2","abs","evict","shaka.media.SegmentIndex.prototype.evict","shaka.media.SegmentIndex.prototype.fit","lastReference","shaka.util.EbmlParser","reader_","shaka.util.EbmlParser.DYNAMIC_SIZES","shaka.util.EbmlParser.prototype.hasMoreData","shaka.util.EbmlParser.prototype.parseElement","vint","parseVint_","parseId_","shaka.util.Error.Code.EBML_OVERFLOW","shaka.util.EbmlParser.DYNAMIC_SIZES.length","elementSize","byteOffset","shaka.util.EbmlElement","shaka.util.EbmlParser.prototype.parseVint_","firstByte","shaka.util.EbmlElement.prototype.getUint","shaka.media.WebmSegmentIndexParser","shaka.media.WebmSegmentIndexParser.prototype.parse","cuesData","shaka.media.WebmSegmentIndexParser.EBML_ID","parseElement","ebmlElement","shaka.util.Error.Code.WEBM_EBML_HEADER_ELEMENT_MISSING","segmentElement","shaka.media.WebmSegmentIndexParser.SEGMENT_ID","shaka.util.Error.Code.WEBM_SEGMENT_ELEMENT_MISSING","segmentOffset","infoElement","shaka.media.WebmSegmentIndexParser.INFO_ID","shaka.util.Error.Code.WEBM_INFO_ELEMENT_MISSING","timecodeScaleNanoseconds","durationScale","shaka.media.WebmSegmentIndexParser.TIMECODE_SCALE_ID","getUint","shaka.media.WebmSegmentIndexParser.DURATION_ID","getFloat32","getFloat64","shaka.util.Error.Code.EBML_BAD_FLOATING_POINT_SIZE","shaka.util.Error.Code.WEBM_DURATION_ELEMENT_MISSING","timecodeScale","cuesElement","shaka.media.WebmSegmentIndexParser.CUES_ID","shaka.util.Error.Code.WEBM_CUES_ELEMENT_MISSING","parseCues_","shaka.media.WebmSegmentIndexParser.prototype.parseCues_","lastTime","lastOffset","shaka.media.WebmSegmentIndexParser.CUE_POINT_ID","tuple","parseCuePoint_","unscaledTime","currentOffset","relativeOffset","shaka.media.WebmSegmentIndexParser.prototype.parseCuePoint_","cuePointElement","cueTimeElement","shaka.media.WebmSegmentIndexParser.CUE_TIME_ID","shaka.util.Error.Code.WEBM_CUE_TIME_ELEMENT_MISSING","cueTrackPositionsElement","shaka.media.WebmSegmentIndexParser.CUE_TRACK_POSITIONS_ID","shaka.util.Error.Code.WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING","cueTrackParser","shaka.media.WebmSegmentIndexParser.CUE_CLUSTER_POSITION","shaka.dash.SegmentBase.createInitSegment","initialization","resolvedUris","range","shaka.dash.SegmentBase.createStream","requestInitSegment","shaka.dash.SegmentBase.fromInheritance_","containerType","shaka.util.Error.Code.DASH_UNSUPPORTED_CONTAINER","shaka.util.Error.Code.DASH_WEBM_MISSING_INIT","representationIndex","indexRangeElem","indexUris","indexRange","representationUri","shaka.util.Error.Code.DASH_NO_SEGMENT_INFO","shaka.dash.SegmentBase.createSegmentIndexFromUris","createSegmentIndex","findSegmentPosition","getSegmentReference","initSegmentReference","presentationTimeline","fitLast","dynamic","isLastPeriod","localRequest","segmentIndex","create","indexData","notifySegments","periodStartTime","fit","frame","segmentBase","shaka.dash.SegmentList.createStream","segmentIndexMap","shaka.dash.SegmentList.fromInheritance_","mediaSegments","shaka.dash.SegmentList.parseMediaSegments_","segmentInfo","shaka.dash.SegmentList.createSegmentReferences_","getSegmentAvailabilityStart","segmentList","prevEndTime","mediaUri","segmentLists","urlNode","indexRangeWarningGiven","shaka.dash.SegmentTemplate.createStream","isUpdate","shaka.dash.SegmentTemplate.createInitSegment_","shaka.dash.SegmentTemplate.fromInheritance_","mediaTemplate","indexTemplate","filledTemplate","notifyMaxSegmentDuration","segmentIndexFunctions","shaka.dash.SegmentTemplate.createFromDuration_","shaka.dash.SegmentTemplate.createFromTimeline_","segmentTemplate","periodTime","segmentReplacement","repId","segmentId","g","createUris","shaka.media.ManifestParser.parsersByMime","shaka.media.ManifestParser.parsersByExtension","registerParserByExtension","shaka.media.ManifestParser.registerParserByExtension","parserFactory","registerParserByMime","shaka.media.ManifestParser.registerParserByMime","shaka.media.ManifestParser.probeSupport","testExtensions","shaka.media.ManifestParser.getFactory","netEngine","opt_manifestParserFactory","filenamePieces","uriObj","uriPieces","uriFilename","headRequest","shaka.net.NetworkingEngine.RequestType.MANIFEST","shaka.util.Error.Code.UNABLE_TO_GUESS_MANIFEST_TYPE","shaka.media.PresentationTimeline","presentationStartTime","presentationDelay","presentationStartTime_","presentationDelay_","segmentAvailabilityDuration_","duration_","maxSegmentDuration_","clockOffset_","static_","PresentationTimeline","shaka.media.PresentationTimeline.prototype.getDuration","shaka.media.PresentationTimeline.prototype.setDuration","getPresentationStartTime","shaka.media.PresentationTimeline.prototype.getPresentationStartTime","setClockOffset","shaka.media.PresentationTimeline.prototype.setClockOffset","setStatic","shaka.media.PresentationTimeline.prototype.setStatic","isStatic","getSegmentAvailabilityDuration","shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityDuration","setSegmentAvailabilityDuration","shaka.media.PresentationTimeline.prototype.setSegmentAvailabilityDuration","segmentAvailabilityDuration","shaka.media.PresentationTimeline.prototype.notifySegments","shaka.media.PresentationTimeline.prototype.notifyMaxSegmentDuration","maxSegmentDuration","shaka.media.PresentationTimeline.prototype.isLive","isInProgress","shaka.media.PresentationTimeline.prototype.isInProgress","shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityStart","getSafeAvailabilityStart","shaka.media.PresentationTimeline.prototype.getSafeAvailabilityStart","getSegmentAvailabilityEnd","shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityEnd","getLiveEdge_","getSeekRangeEnd","shaka.media.PresentationTimeline.prototype.getSeekRangeEnd","shaka.dash.DashParser","playerInterface_","manifestUris_","manifest_","periodIds_","globalId_","segmentIndexMap_","updatePeriod_","updateTimer_","DashParser","shaka$dash$DashParser.prototype","shaka.dash.DashParser.prototype","shaka.dash.DashParser.prototype.configure","shaka.dash.DashParser.prototype.start","playerInterface","requestManifest_","setUpdateTimer_","shaka.dash.DashParser.prototype.stop","shaka.dash.DashParser.prototype.update","shaka.dash.DashParser.prototype.onExpirationUpdated","shaka.dash.DashParser.prototype.requestManifest_","parseManifest_","shaka.dash.DashParser.prototype.parseManifest_","finalManifestUri","mpd","documentElement","shaka.util.Error.Code.DASH_INVALID_XML","manifestBaseUris","locations","minBufferTime","suggestedPresentationDelay","mpdType","defaultPresentationDelay","shaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_","periodsAndDuration","parsePeriods_","timingElements","parseUtcTiming_","shaka.dash.DashParser.prototype.parsePeriods_","presentationDuration","prevEnd","periodNodes","givenDuration","nextStart","nextPeriod","parsePeriod_","periodId","filterPeriod","shaka.dash.DashParser.prototype.parsePeriod_","createFrame_","eventStreamNodes","parseEventStream_","adaptationSets","adaptationSetNodes","parseAdaptationSet_","representationIds","as","uniqueRepIds","shaka.util.Error.Code.DASH_DUPLICATE_REPRESENTATION_ID","normalAdaptationSets","trickModeFor","trickModeAdaptationSets","trickModeSet","targetId","normalSet","videoSets","getSetsOfType_","audioSets","shaka.util.Error.Code.DASH_EMPTY_PERIOD","createVariants_","audioSet","videoSet","textSets","shaka.dash.DashParser.prototype.getSetsOfType_","shaka.dash.DashParser.prototype.createVariants_","main","shaka.dash.DashParser.prototype.parseAdaptationSet_","roleElements","roleValues","SUBTITLE","unrecognizedEssentialProperty","essentialProperties","prop","schemeId","contentProtectionElems","contentProtection","customScheme","representations","parseRepresentation_","shaka.util.Error.Code.DASH_EMPTY_ADAPTATION_SET","APPLICATION","shaka.dash.DashParser.guessContentType_","repIds","shaka.dash.DashParser.prototype.parseRepresentation_","isPrimary","verifyRepresentation_","requestInitSegment_","streamInfo","ref","containsEmsgBoxes","shaka_dash_DashParser_prototype$onUpdate_","shaka.dash.DashParser.prototype.onUpdate_","shaka.dash.DashParser.prototype.setUpdateTimer_","onUpdate_","interval","shaka.dash.DashParser.MIN_UPDATE_PERIOD_","shaka.dash.DashParser.prototype.createFrame_","parent","shaka.dash.DashParser.prototype.verifyRepresentation_","shaka.dash.DashParser.prototype.requestForTiming_","requestUris","text","date","shaka.dash.DashParser.prototype.parseUtcTiming_","schemesAndValues","clockSyncUri","sv","requestForTiming_","shaka.dash.DashParser.prototype.parseEventStream_","schemeIdUri","eventNode","presentationTime","region","eventElement","onTimelineRegionAdded","shaka.dash.DashParser.prototype.requestInitSegment_","shaka.hls.Playlist","opt_segments","shaka.hls.Tag","opt_value","shaka.hls.Tag.prototype.toString","attr_to_str","shaka.hls.Attribute","shaka.hls.Tag.prototype.getAttribute","shaka.hls.Tag.prototype.getAttributeValue","defaultValue","shaka.hls.Segment","shaka.hls.Utils.filterTagsByName","shaka.hls.Utils.getFirstTagWithName","tagsWithName","shaka.hls.Utils.findMediaTags","groupId","typeAttr","groupIdAttr","shaka.util.TextParser","data_","shaka.util.TextParser.prototype.readRegex","regex","lastIndex","indexOf_","atEnd","shaka.util.TextParser.prototype.readRegexReturnCapture_","readRegex","shaka.hls.ManifestTextParser","shaka.hls.ManifestTextParser.prototype.parsePlaylist","lines","test","shaka.util.Error.Code.HLS_PLAYLIST_HEADER_MISSING","playlistType","MASTER","line","shaka.hls.ManifestTextParser.parseTag","parseTag_","word","shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS.indexOf","MEDIA","shaka.hls.ManifestTextParser.SEGMENT_TAGS.indexOf","shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY","segmentsData","parseSegments_","tagUri","shaka.hls.ManifestTextParser.prototype.parseSegments_","blocks","shaka.util.Error.Code.INVALID_HLS_TAG","blockAttrs","attrName","shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS","shaka.hls.ManifestTextParser.SEGMENT_TAGS","shaka.net.DataUriPlugin","shaka.net.DataUriPlugin.parse","DataUriPlugin","shaka.util.Error.Code.MALFORMED_DATA_URI","infoAndData","dataStr","typeAndEncoding","encoding","shaka.util.Error.Code.UNKNOWN_DATA_URI_ENCODING","shaka.hls.HlsParser","mediaTagsToStreamInfosMap_","streamsToIndexMap_","presentationTimeline_","manifestTextParser_","HlsParser","shaka$hls$HlsParser.prototype","shaka.hls.HlsParser.prototype","shaka.hls.HlsParser.prototype.configure","shaka.hls.HlsParser.prototype.start","shaka.hls.HlsParser.prototype.stop","shaka.hls.HlsParser.prototype.update","shaka.hls.HlsParser.prototype.onExpirationUpdated","shaka.hls.HlsParser.prototype.parseManifest_","playlist","parsePlaylist","shaka.util.Error.Code.HLS_MASTER_PLAYLIST_NOT_PROVIDED","createPeriod_","shaka.hls.HlsParser.prototype.createPeriod_","variantsPromises","variantTags","createVariantsForTag_","textStreamPromises","mediaTags","textStreamTags","shaka.hls.HlsParser.getRequiredAttributeValue_","createTextStream_","allVariants","fitSegments_","shaka.hls.HlsParser.prototype.createVariantsForTag_","getAttributeValue","defaultCodecs","resolutionAttr","resBlocks","timeOffset","getTimeOffset_","audioGroupId","videoGroupId","promises","createStreamInfoFromMediaTag_","audioStreamInfos","videoStreamInfos","createStreamInfo_","createStreamInfoFromVariantTag_","allCodecs","shaka.hls.HlsParser.prototype.createVariants_","audioInfos","videoInfos","audioStream","videoStream","audioDrmInfos","videoDrmInfos","createVariant_","shaka.hls.HlsParser.prototype.createVariant_","shaka.hls.HlsParser.prototype.createTextStream_","shaka.hls.HlsParser.prototype.createStreamInfoFromMediaTag_","defaultAttr","autoselectAttr","shaka.hls.HlsParser.prototype.createStreamInfo_","mediaPlaylistTimeOffset","createInitSegmentReference_","mediaSequenceTag","createSegments_","startPosition","guessCodecs_","drmTags","segmentKeyTags","drmTag","keyFormat","drmParser","shaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_","shaka.util.Error.Code.HLS_KEYFORMATS_NOT_SUPPORTED","guessMimeType_","shaka.hls.HlsParser.prototype.createInitSegmentReference_","mapTags","shaka.util.Error.Code.HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND","mapTag","initUri","byterange","shaka.hls.HlsParser.prototype.createSegments_","hlsSegments","extinfValues","getRequiredTag_","extinfTag","shaka.hls.HlsParser.prototype.fitSegments_","shaka.hls.HlsParser.prototype.guessCodecs_","formats","shaka.hls.HlsParser.VIDEO_CODEC_FORMATS_","shaka.hls.HlsParser.AUDIO_CODEC_FORMATS_","shaka.util.Error.Code.HLS_COULD_NOT_GUESS_CODECS","shaka.hls.HlsParser.prototype.guessMimeType_","shaka.hls.HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_","shaka.hls.HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_","shaka.util.Error.Code.HLS_COULD_NOT_GUESS_MIME_TYPE","shaka.hls.HlsParser.prototype.getTimeOffset_","startTag","defaultTimeOffset","attributeName","shaka.util.Error.Code.HLS_REQUIRED_ATTRIBUTE_MISSING","shaka.hls.HlsParser.prototype.getRequiredTag_","shaka.util.Error.Code.HLS_REQUIRED_TAG_MISSING","shaka.hls.HlsParser.widevineDrmParser_","parsedData","shaka.media.TtmlTextParser","shaka.media.TtmlTextParser.prototype.parseInit","shaka.media.TtmlTextParser.prototype.parseMedia","shaka.util.Error.Code.INVALID_XML","tt","tts","subFrameRate","frameRateMultiplier","tickRate","spaceStyle","whitespaceTrim","rateInfo","shaka.media.TtmlTextParser.RateInfo_","styles","shaka.media.TtmlTextParser.getLeafNodes_","regions","textNodes","cueElement","hasAttribute","shaka.media.TtmlTextParser.addNewLines_","shaka.media.TtmlTextParser.parseTime_","shaka.util.Error.Code.INVALID_TEXT_CUE","shaka.media.TtmlTextParser.getElementFromCollection_","extent","shaka.media.TtmlTextParser.getStyleAttribute_","shaka.media.TtmlTextParser.percentValues_.exec","writingMode","isVerticalText","vertical","origin","snapToLines","align","positionAlign","shaka.media.TtmlTextParser.textAlignToPositionAlign_","lineAlign","shaka.media.TtmlTextParser.textAlignToLineAlign_","shaka.media.TtmlTextParser.timeColonFormatFrames_","shaka.media.TtmlTextParser.timeColonFormat_","shaka.media.TtmlTextParser.timeColonFormatMilliseconds_","shaka.media.TtmlTextParser.timeFramesFormat_","shaka.media.TtmlTextParser.timeTickFormat_","shaka.media.TtmlTextParser.timeHMSFormat_","shaka.media.TtmlTextParser.percentValues_","isSpanChildOfP","ELEMENT_NODE","leafChildren","trimmed","regionChildren","getElementFromCollection_","collection","Element","itemName","shaka.media.TtmlTextParser.timeColonFormatFrames_.test","shaka.media.TtmlTextParser.timeColonFormatFrames_.exec","frames","shaka.media.TtmlTextParser.timeColonFormat_.test","shaka.media.TtmlTextParser.parseTimeFromRegex_","shaka.media.TtmlTextParser.timeColonFormatMilliseconds_.test","shaka.media.TtmlTextParser.timeFramesFormat_.test","shaka.media.TtmlTextParser.timeFramesFormat_.exec","shaka.media.TtmlTextParser.timeTickFormat_.test","shaka.media.TtmlTextParser.timeTickFormat_.exec","ticks","shaka.media.TtmlTextParser.timeHMSFormat_.test","multiplierResults","numerator","denominator","shaka.media.Mp4TtmlParser","shaka.media.Mp4TtmlParser.prototype.parseInit","sawSTPP","shaka.util.Error.Code.INVALID_MP4_TTML","shaka.media.Mp4TtmlParser.prototype.parseMedia","sawMDAT","shaka.media.VttTextParser","shaka.media.VttTextParser.prototype.parseInit","shaka.media.VttTextParser.prototype.parseMedia","shaka.util.Error.Code.INVALID_TEXT_HEADER","cueTimeMatch","mpegTimeMatch","cueTime","shaka.media.VttTextParser.parseTime_","mpegTime","shaka.media.VttTextParser.MPEG_TIMESCALE_","expect","readRegexReturnCapture_","shaka.media.VttTextParser.parseSetting","miliseconds","shaka.media.Mp4VttParser","timescale_","shaka.media.Mp4VttParser.prototype.parseInit","sawWVTT","shaka.util.Error.Code.INVALID_MP4_VTT","shaka.media.Mp4VttParser.prototype.parseMedia","baseTime","presentations","payloads","sawTFDT","sawTRUN","sampleCount","samples","sampleIndex","presentation","shaka.media.Mp4VttParser.parseVTTC_","shaka.media.Mp4VttParser.assembleCue_","shaka.media.Playhead","onSeek","onEvent","startTime_","onSeek_","onEvent_","playbackRate_","gapJumpIntervalId_","trickPlayIntervalId_","prevReadyState_","didFireLargeGap_","stallPlayheadTime_","stallWallTime_","hadSegmentAppended_","onLoadedMetadata_","pollGap","onPollGapJump_","onRateChange_","shaka$media$Playhead.prototype","shaka.media.Playhead.prototype","shaka.media.Playhead.prototype.destroy","shaka.media.Playhead.prototype.setStartTime","clampTime_","shaka.media.Playhead.prototype.getTime","getStartTime_","shaka.media.Playhead.prototype.getStartTime_","getPlaybackRate","shaka.media.Playhead.prototype.getPlaybackRate","shaka.media.Playhead.prototype.setPlaybackRate","rate","onSegmentAppended","shaka.media.Playhead.prototype.onSegmentAppended","shaka.media.Playhead.prototype.onRateChange_","expectedRate","setPlaybackRate","shaka.media.Playhead.prototype.onLoadedMetadata_","targetTime","onSeeking_","onPlaying_","onSeekingToStartTime_","shaka.media.Playhead.prototype.onSeekingToStartTime_","shaka.media.Playhead.prototype.onPollGapJump_","smallGapLimit","threshold","gapIndex","jumpTo","seekEnd","jumpSize","isGapSmall","jumpLargeGap","jumpLargeGaps","movePlayhead_","shaka.media.Playhead.prototype.onSeeking_","reposition_","shaka.media.Playhead.prototype.onPlaying_","shaka.media.Playhead.prototype.reposition_","isBuffered","shaka.media.TimeRangesUtils.isBuffered.bind","rebufferingGoal","scaleFactor","safe","seekStart","seekSafe","shaka.media.Playhead.prototype.movePlayhead_","tries","recheck","shaka.media.Playhead.prototype.clampTime_","shaka.media.PlayheadObserver","onBuffering","onChangePeriod","onBuffering_","onChangePeriod_","timelineRegions_","curPeriodIndex_","watchdogTimer_","startWatchdogTimer_","shaka.media.PlayheadObserver.prototype.destroy","cancelWatchdogTimer_","addTimelineRegion","shaka.media.PlayheadObserver.prototype.addTimelineRegion","regionInfo","hasExistingRegion","existing","FUTURE_REGION","detail","shaka.media.PlayheadObserver.cloneTimelineInfo_","updateTimelineRegion_","copy","shaka.media.PlayheadObserver.prototype.updateTimelineRegion_","isSeek","newStatus","PAST_REGION","INSIDE","wasInside","isInside","shaka.media.PlayheadObserver.prototype.startWatchdogTimer_","onWatchdogTimer_","shaka.media.PlayheadObserver.prototype.cancelWatchdogTimer_","shaka.media.PlayheadObserver.prototype.onWatchdogTimer_","newPeriod","bufferedAhead","bufferEnd","shaka.media.PlayheadObserver.FUDGE_FACTOR_","buffering","setBuffering_","shaka.media.PlayheadObserver.UNDERFLOW_THRESHOLD_","shaka.media.StreamingEngine","bufferingGoalScale_","setupPeriodPromise_","canSwitchPeriod_","canSwitchStream_","mediaStates_","fatalError_","shaka$media$StreamingEngine.prototype","shaka.media.StreamingEngine.prototype","shaka.media.StreamingEngine.prototype.destroy","cancelUpdate_","shaka.media.StreamingEngine.prototype.configure","shaka.media.StreamingEngine.prototype.init","streamsByType","onChooseStreams","needPeriodIndex","findPeriodContainingTime_","playheadTime","playhead","shaka.util.Error.Category.STREAMING","shaka.util.Error.Code.INVALID_STREAMS_CHOSEN","initStreams_","onInitialStreamsSetup","shaka.media.StreamingEngine.prototype.getCurrentPeriod","shaka.media.StreamingEngine.prototype.getActiveStreams","restoreStreamAfterTrickPlay","shaka.media.StreamingEngine.prototype.notifyNewTextStream","shaka.media.StreamingEngine.prototype.setTrickPlay","normalVideo","mediaState","switch","shaka.media.StreamingEngine.prototype.switch","clearBuffer","ignoreTextStreamFailures","notifyNewTextStream","periodIndex","findPeriodContainingStream_","clearAllBuffers_","mediaSourceEngine","canSwitchRecord","resolved","needInitSegment","clearingBuffer","waitingToFlushBuffer","performingUpdate","waitingToClearBuffer","clearBuffer_","shaka.media.StreamingEngine.prototype.seeked","isAllBuffered","getBuffered_","shaka.media.StreamingEngine.prototype.clearAllBuffers_","bufferStart","updateTimer","scheduleUpdate_","shaka.media.StreamingEngine.prototype.initStreams_","opt_resumeAt","setDuration_","setupStreams_","lastStream","lastSegmentReference","recovering","resumeAt","shaka.media.StreamingEngine.prototype.setupPeriod_","shaka.media.StreamingEngine.prototype.setupStreams_","shaka.media.StreamingEngine.prototype.setDuration_","shaka_media_StreamingEngine_prototype$onUpdate_","shaka.media.StreamingEngine.prototype.onUpdate_","update_","mediaStates","handlePeriodTransition_","ms","shaka.media.StreamingEngine.prototype.update_","timeNeeded","getTimeNeeded_","lastPeriod","lastPeriodIndex","currentPeriodIndex","bufferingGoal","getBufferingGoal_","getSegmentReferenceIfAvailable_","getSegmentReferenceNeeded_","lookupTime","currentPeriod","reference","optimalPosition","fetchAndAppend_","shaka.media.StreamingEngine.prototype.getSegmentReferenceIfAvailable_","availabilityEnd","availabilityStart","shaka.media.StreamingEngine.prototype.fetchAndAppend_","followingPeriod","initSourceBuffer","initSourceBuffer_","fetchSegment","fetch_","handleStartup_","infiniteRetriesForLiveStreams","shaka.util.Error.Code.BAD_HTTP_STATUS","shaka.util.Error.Code.HTTP_ERROR","shaka.util.Error.Code.TIMEOUT","handleNetworkError_","handleQuotaExceeded_","shaka.media.StreamingEngine.prototype.handleQuotaExceeded_","waitingForAnotherStreamToRecover","percentBefore","shaka.media.StreamingEngine.prototype.initSourceBuffer_","setStreamProperties","appendInit","fetchInit","initSegment","shaka.media.StreamingEngine.prototype.append_","parseEMSG_","evict_","shaka.media.StreamingEngine.prototype.parseEMSG_","presentationTimeDelta","eventDuration","messageData","onManifestUpdate","emsg","shaka.media.StreamingEngine.prototype.evict_","overflow","bufferBehind","shaka.media.StreamingEngine.prototype.handleStartup_","setupPeriod_","onCanSwitch","onStartupComplete","shaka.media.StreamingEngine.prototype.handlePeriodTransition_","needSamePeriod","allAreIdle","shaka.media.StreamingEngine.isIdle_","allReady","needPeriod","shaka.media.StreamingEngine.prototype.fetch_","shaka.media.StreamingEngine.prototype.clearBuffer_","flush","shaka.media.StreamingEngine.prototype.scheduleUpdate_","shaka.media.StreamingEngine.prototype.cancelUpdate_","shaka.net.HttpPlugin","xhr","responseType","withCredentials","onload","xhr.onload","getAllResponseHeaders","header","responseURL","onerror","xhr.onerror","ontimeout","xhr.ontimeout","HttpPlugin","shaka.offline.DBEngine","db_","operations_","currentIdMap_","shaka$offline$DBEngine.prototype","shaka.offline.DBEngine.prototype","shaka.offline.DBEngine.prototype.init","storeMap","opt_retryCount","createConnection_","stores","getNextId_","shaka.offline.DBEngine.prototype.destroy","op","transaction","shaka.offline.DBEngine.prototype.get","storeName","createTransaction_","shaka.offline.DBEngine.prototype.forEach","openCursor","onsuccess","request.onsuccess","cursor","continue","shaka.offline.DBEngine.prototype.insert","put","shaka.offline.DBEngine.prototype.remove","shaka.offline.DBEngine.prototype.removeKeys","opt_onKeyRemoved","shaka.offline.DBEngine.prototype.getNextId_","shaka.offline.DBEngine.prototype.createTransaction_","oncomplete","closeOperation_","onabort","shaka.offline.DBEngine.onError_","objectStore","shaka.offline.DBEngine.prototype.createConnection_","indexedDB","shaka.offline.DBEngine.DB_NAME_","shaka.offline.DBEngine.DB_VERSION_","upgraded","createPromise","onupgradeneeded","request.onupgradeneeded","db","createObjectStore","keyPath","shaka.offline.DBEngine.onError_.bind","errorSource","shaka.util.Error.Category.STORAGE","shaka.util.Error.Code.INDEXED_DB_ERROR","shaka.util.Error.Code.OPERATION_ABORTED","shaka.offline.OfflineUtils.DB_SCHEME","shaka.offline.OfflineUtils.getStoredContent","shaka.offline.OfflineUtils.reconstructPeriod","offlineUri","originalManifestUri","appMetadata","textStreamsDb","streamDb","audioStreamsDb","videoStreamsDb","shaka.offline.OfflineUtils.createVariants_","shaka.offline.OfflineUtils.createStream_","refs","shaka.offline.OfflineUtils.getSegmentReferences_","audios","videos","shaka.offline.OfflineUtils.areCompatible_","stream1","stream2","variantIds","containsId","initSegmentUri","initRef","shaka.offline.OfflineUtils.createStorageEngine","shaka.offline.DownloadManager","storageEngine","segments_","storedSegments_","storageEngine_","netEngine_","retryParams_","promise_","bandwidthBytesDownloaded_","bandwidthBytesTotal_","givenBytesDownloaded_","givenBytesTotal_","shaka.offline.DownloadManager.prototype.destroy","storage","removeKeys","shaka.offline.DownloadManager.prototype.addSegment","bandwidthSize","segmentDb","shaka.offline.DownloadManager.prototype.downloadAndStore","downloadNext","downloadSegment_","insert","shaka.offline.DownloadManager.prototype.downloadSegment_","byteCount","progress","updateProgress_","progressCallback","shaka.offline.OfflineManifestParser","manifestId_","shaka$offline$OfflineManifestParser.prototype","shaka.offline.OfflineManifestParser.prototype","shaka.offline.OfflineManifestParser.prototype.configure","shaka.offline.OfflineManifestParser.prototype.start","shaka.util.Error.Code.MALFORMED_OFFLINE_URI","manifestId","shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND","shaka.offline.OfflineManifestParser.reconstructManifest","shaka.util.Error.Code.STORAGE_NOT_SUPPORTED","shaka.offline.OfflineManifestParser.prototype.stop","shaka.offline.OfflineManifestParser.prototype.update","shaka.offline.OfflineManifestParser.prototype.onExpirationUpdated","sessionIds","shaka.offline.OfflineScheme","manifestParts","segmentParts","OfflineScheme","shaka.util.CancelableChain","canceled_","complete_","final_","cancelPromise_","onCancelComplete_","shaka.util.CancelableChain.prototype.then","rejectionValue_","shaka.util.CancelableChain.prototype.finalize","shaka.util.CancelableChain.prototype.cancel","reason","shaka.Player","opt_dependencyInjector","defaultAbrManager_","streamingEngine_","playheadObserver_","playhead_","mediaSourceOpen_","mediaSourceEngine_","drmEngine_","nextExternalStreamId_","loadingTextStreamIds_","switchingPeriods_","unloadChain_","loadChain_","deferredSwitches_","pendingTimelineRegions_","activeStreamsByPeriod_","defaultConfig_","maxHwRes_","stats_","getCleanStats_","lastTimeStatsUpdateTimestamp_","currentAudioLanguage_","preferredAudioLanguage","currentTextLanguage_","preferredTextLanguage","currentTextRole_","currentVariantRole_","createNetworkingEngine","initialize_","createMediaSource","shaka.Player.TextTrackLabel_","addTextTrack","onVideoError_","shaka.Player.prototype.destroy","cancelation","destroyStreaming_","GIT_VERSION","shaka.Player.supportPlugins_","shaka.Player.registerSupportPlugin","shaka.Player.isBrowserSupported","MediaKeys","MediaKeySystemAccess","shaka.Player.probeSupport","shaka.Player.prototype.load","opt_startTime","unloadPromise","loadChain","finalize","updateState_","filterPeriod_","onTimelineRegionAdded_","shaka.util.Error.Code.NO_PERIODS","createDrmEngine","createPlayhead","streaming","createPlayheadObserver","createMediaSourceEngine","createStreamingEngine","onChooseStreams_","canSwitch_","onManifestUpdate_","onSegmentAppended_","chooseCodecsAndFilterManifest_","startAtSegmentBoundary","adjustStartTime_","setStartTime","onTracksChanged_","onAdaptation_","getCurrentPeriod","loadLatency","shaka.Player.prototype.chooseCodecsAndFilterManifest_","variantCodecs","baseVideoCodec","baseAudioCodec","variantsByCodecs","bestCodecs","lowestAverageBandwidth","sum","num","averageBandwidth","shaka.Player.prototype.createMediaSource","URL","createObjectURL","shaka.Player.prototype.configure","configOverrides_","applyConfig_","shaka.Player.prototype.applyConfig_","chooseStreamsAndSwitch_","defaultBandwidthEstimate","shaka.Player.prototype.getConfiguration","resetConfiguration","shaka.Player.prototype.resetConfiguration","getMediaElement","shaka.Player.prototype.getMediaElement","shaka.Player.prototype.getNetworkingEngine","getManifestUri","shaka.Player.prototype.getManifestUri","shaka.Player.prototype.isLive","shaka.Player.prototype.isInProgress","seekRange","shaka.Player.prototype.seekRange","shaka.Player.prototype.keySystem","shaka.Player.prototype.drmInfo","shaka.Player.prototype.getExpiration","isBuffering","shaka.Player.prototype.isBuffering","shaka.Player.prototype.unload","interrupt","resetStreaming_","shaka.Player.prototype.getPlaybackRate","trickPlay","shaka.Player.prototype.trickPlay","setTrickPlay","cancelTrickPlay","shaka.Player.prototype.cancelTrickPlay","shaka.Player.prototype.getTracks","selectTrack","shaka.Player.prototype.selectTrack","opt_clearBuffer","shaka.Player.prototype.getVariantTracks","shaka.Player.prototype.getTextTracks","shaka.Player.prototype.selectTextTrack","addToSwitchHistory_","streamsToSwitch","deferredSwitch_","shaka.Player.prototype.selectVariantTrack","getActiveStreams","updateActiveStreams_","currentTextStream","getAudioLanguages","shaka.Player.prototype.getAudioLanguages","getTextLanguages","shaka.Player.prototype.getTextLanguages","shaka.Player.prototype.selectAudioLanguage","shaka.Player.prototype.selectTextLanguage","isTextTrackVisible","shaka.Player.prototype.isTextTrackVisible","setTextTrackVisibility","shaka.Player.prototype.setTextTrackVisibility","onTextTrackVisibility_","getPlayheadTimeAsDate","shaka.Player.prototype.getPlayheadTimeAsDate","getStats","shaka.Player.prototype.getStats","updateTimeStats_","videoInfo","getVideoPlaybackQuality","streamBandwidth","decodedFrames","totalVideoFrames","droppedFrames","droppedVideoFrames","estimatedBandwidth","playTime","bufferingTime","switchHistory","stateHistory","shaka.Player.prototype.addTextTrack","mime","opt_codec","opt_label","curPeriodIdx","shaka.Player.prototype.setMaxHardwareResolution","shaka.Player.prototype.addToSwitchHistory_","fromAdaptation","timestamp","shaka.Player.prototype.updateActiveStreams_","shaka.Player.prototype.destroyStreaming_","shaka.Player.prototype.resetStreaming_","shaka.Player.prototype.configOverrides_","shaka.Player.prototype.defaultConfig_","shaka.Player.prototype.getCleanStats_","shaka$Player.prototype","shaka.Player.prototype","shaka_Player_prototype$filterPeriod_","shaka.Player.prototype.filterPeriod_","hasPlayableVariants","allVariantsRestricted","shaka.util.Error.Code.UNPLAYABLE_PERIOD","shaka.Player.prototype.deferredSwitch_","shaka.Player.prototype.updateTimeStats_","shaka.Player.prototype.adjustStartTime_","getAdjustedTime","idx","videoStartTime","audioStartTime","shaka_Player_prototype$onSegmentDownloaded_","shaka.Player.prototype.onSegmentDownloaded_","shaka_Player_prototype$onBuffering_","shaka.Player.prototype.onBuffering_","shaka_Player_prototype$onChangePeriod_","shaka.Player.prototype.onChangePeriod_","shaka.Player.prototype.updateState_","lastEntry","shaka_Player_prototype$onSeek_","shaka.Player.prototype.onSeek_","seeked","shaka.Player.prototype.chooseStreams_","opt_chooseAll","needsUpdate","anyMediaState","activeVariant","activePeriod","shaka.Player.prototype.chooseStreamsAndSwitch_","languageMatches","chooseStreams_","shaka.Player.prototype.onChooseStreams_","shaka.Player.prototype.canSwitch_","shaka.Player.prototype.onManifestUpdate_","shaka.Player.prototype.onSegmentAppended_","shaka_Player_prototype$switch_","shaka.Player.prototype.switch_","oldActive","shaka.Player.prototype.onAdaptation_","shaka.Player.prototype.onTracksChanged_","shaka.Player.prototype.onTextTrackVisibility_","shaka_Player_prototype$onError_","shaka.Player.prototype.onError_","shaka.Player.prototype.onTimelineRegionAdded_","shaka_Player_prototype$onEvent_","shaka.Player.prototype.onEvent_","shaka.Player.prototype.onVideoError_","extended","msExtendedCode","shaka.util.Error.Code.VIDEO_ERROR","shaka_Player_prototype$onKeyStatus_","shaka.Player.prototype.onKeyStatus_","keyStatusMap","restrictedStatuses","keyStatus","shaka_Player_prototype$onExpirationUpdated_","shaka.Player.prototype.onExpirationUpdated_","shaka.offline.Storage","shaka.util.Error.Code.LOCAL_PLAYER_INSTANCE_REQUIRED","storeInProgress_","firstPeriodTracks_","downloadManager_","Storage","shaka.offline.Storage.support","shaka.offline.Storage.prototype.destroy","shaka.offline.Storage.prototype.configure","shaka.offline.Storage.prototype.store","shaka.util.Error.Code.STORE_ALREADY_IN_PROGRESS","manifestDb","initIfNeeded_","checkDestroyed_","loadInternal","shaka.util.Error.Code.CANNOT_STORE_LIVE_OFFLINE","createOfflineManifest_","getSessionIds","shaka.util.Error.Code.NO_INIT_DATA_FOR_OFFLINE","downloadAndStore","cleanup_","shaka.offline.Storage.prototype.remove","content","removeSessions","deleteCount","segmentCount","shaka.offline.Storage.prototype.list","storedContents","shaka.offline.Storage.prototype.loadInternal","onKeyStatusChange","manifestParser","createSegmentIndex_","defaultTrackSelect_","shaka.offline.Storage.prototype.defaultTrackSelect_","selectedTracks","audioLangPref","matchTypes","allVariantTracks","tracksByMatchType","primaryTracks","languages","tracksByHeight","shaka.offline.Storage.prototype.defaultConfig_","trackSelectionCallback","storedContent","percent","shaka.offline.Storage.prototype.initIfNeeded_","shaka.offline.Storage.prototype.filterPeriod_","shaka.offline.Storage.prototype.cleanup_","shaka.offline.Storage.prototype.createSegmentIndex_","variantStreams","shaka.offline.Storage.prototype.createPeriod_","chosenTracks","allTracks","foundSimilarTracks","bandwidthEstimation","createStream_","shaka.offline.Storage.prototype.createStream_","estimatedStreamBandwidth","opt_variantId","segmentsDb","addSegment","segmentDataDb","manifestKey","streamNumber","segmentNumber","initDataDb","shaka.offline.Storage.prototype.checkDestroyed_","shaka.polyfill.installAll","shaka.polyfill.polyfills_.length","shaka.polyfill.polyfills_","shaka.polyfill.register","shaka.polyfill.polyfills_.push","shaka.polyfill.Fullscreen.proxyEvent_","eventType","newEvent","createEvent","initEvent","shaka.polyfill.Fullscreen.install","Document","proto","requestFullscreen","mozRequestFullScreen","msRequestFullscreen","mozCancelFullScreen","msExitFullscreen","webkitExitFullscreen","mozFullScreenElement","msFullscreenElement","webkitFullscreenElement","mozFullScreenEnabled","msFullscreenEnabled","webkitFullscreenEnabled","shaka.polyfill.IndexedDB.install","agent","shaka.polyfill.MathRound.install","testNumber","original_mathRound","Math.round","shaka.polyfill.MathRound.MAX_ACCURATE_INPUT_","shaka.util.Pssh","psshBox","systemIds","cencKeyIds","dataBoundaries","parseBox_","shaka.util.Pssh.prototype.parseBox_","systemId","numKeyIds","dataSize","shaka.polyfill.PatchedMediaKeysMs.requestMediaKeySystemAccess","supportedConfigurations","shaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess","cfg","newCfg","initDataTypes","ranAnyTests","cap","MSMediaKeys","configuration_","unsupportedKeySystemError","DOMException","NOT_SUPPORTED_ERR","shaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.createMediaKeys","shaka.polyfill.PatchedMediaKeysMs.MediaKeys","shaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.getConfiguration","shaka.polyfill.PatchedMediaKeysMs.setMediaKeys","oldMediaKeys","setMedia","nativeMediaKeys_","shaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.createSession","opt_sessionType","TypeError","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession","shaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.setServerCertificate","shaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.setMedia","setMediaKeysDeferred","msSetMediaKeys","shaka.polyfill.PatchedMediaKeysMs.onMsNeedKey_","nativeMediaKeys","nativeMediaKeySession_","updatePromise_","generateRequestPromise_","closed","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap","shaka$polyfill$PatchedMediaKeysMs$MediaKeySession.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.generateRequest","onMsKeyMessage_","onMsKeyAdded_","onMsKeyError_","updateKeyStatus_","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.load","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.update","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.close","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.remove","event2","initCustomEvent","unfilteredInitDatas","currPssh","dedupedInitDatas","shaka.polyfill.PatchedMediaKeysMs.compareInitDatas_","targetLength","normalisedInitData","initDataA","initDataB","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.onMsKeyMessage_","messageType","getStatus","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.onMsKeyAdded_","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.onMsKeyError_","errorCode","MSMediaKeyError","MS_MEDIA_KEYERR_OUTPUT","MS_MEDIA_KEYERR_HARDWARECHANGE","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.updateKeyStatus_","setStatus","status_","shaka$polyfill$PatchedMediaKeysMs$MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.setStatus","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.getStatus","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.forEach","fn","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.get","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.has","fakeKeyId","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.entries","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.keys","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.values","shaka.polyfill.PatchedMediaKeysNop.requestMediaKeySystemAccess","shaka.polyfill.PatchedMediaKeysNop.setMediaKeys","shaka.polyfill.PatchedMediaKeysNop.MediaKeys","shaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.createSession","shaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.setServerCertificate","shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess","shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.getConfiguration","shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.createMediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.prefix_","shaka.polyfill.PatchedMediaKeysWebkit.install","prefix","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_","shaka.polyfill.PatchedMediaKeysWebkit.requestMediaKeySystemAccess","HTMLMediaElement","shaka.polyfill.PatchedMediaKeysWebkit.setMediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess","shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_","api","toUpperCase","internalKeySystem_","allowPersistentState","tmpVideo","unsupportedError","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.createMediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.getConfiguration","keySystem_","media_","newSessions_","sessionMap_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setMedia","onWebkitNeedKey_","onWebkitKeyMessage_","onWebkitKeyAdded_","onWebkitKeyError_","shaka$polyfill$PatchedMediaKeysWebkit$MediaKeys.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.createSession","sessionType","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setServerCertificate","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitNeedKey_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyMessage_","findSession_","generatePromise_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyAdded_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyError_","systemCode","MediaKeyError","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.findSession_","type_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generate_","offlineSessionId","mangledInitData","generateKeyRequestName","shaka$polyfill$PatchedMediaKeysWebkit$MediaKeySession.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype","shaka_polyfill_PatchedMediaKeysWebkit_MediaKeySession_prototype$update_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update_","licenseString","addKeyName","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.updateKeyStatus_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generateRequest","generate_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.load","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update","nextUpdatePromise","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.close","cancelKeyRequestName","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.remove","shaka$polyfill$PatchedMediaKeysWebkit$MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.setStatus","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.getStatus","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.forEach","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.get","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.has","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.entries","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.keys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.values","shaka.polyfill.MediaKeys.install","HTMLVideoElement","webkitGenerateKeyRequest","generateKeyRequest","shaka.polyfill.MediaSource.stubAbort_","MediaSource.prototype.addSourceBuffer","sourceBuffer.abort","shaka.polyfill.MediaSource.patchEndOfStreamEvents_","MediaSource.prototype.endOfStream","newDuration","sourceBuffers","ignoreUpdateEnd_","eventSuppressed_","shaka.polyfill.MediaSource.ignoreUpdateEnd_","cleanUpHandlerInstalled_","shaka.polyfill.MediaSource.cleanUpListeners_","shaka.polyfill.MediaSource.install","vendor","appVersion","shaka.polyfill.Promise","opt_callback","thens_","catches_","state_","shaka.polyfill.Promise.State.PENDING","resolve_","reject_","shaka.polyfill.Promise.resolve","shaka.polyfill.Promise.reject","shaka.polyfill.Promise.all","others","newValue","shaka.polyfill.Promise.race","shaka.polyfill.Promise.prototype.then","opt_successCallback","opt_failCallback","RESOLVED","schedule_","shaka.polyfill.Promise.prototype.catch","shaka.polyfill.Promise.prototype.resolve_","value_","shaka.polyfill.Promise.prototype.reject_","shaka.polyfill.Promise.prototype.schedule_","shaka.polyfill.Promise.q_.push","wrapper","shaka.polyfill.Promise.handleThenable_","shaka.polyfill.Promise.flushTimer_","shaka.polyfill.Promise.setImmediate_","shaka.polyfill.Promise.flush","thenable","sealed","nextThen","shaka.polyfill.Promise.q_.length","shaka.polyfill.Promise.clearImmediate_","shaka.polyfill.Promise.q_","shaka.polyfill.Promise.install","opt_force","setImmediate","clearImmediate","race","shaka.polyfill.VideoPlayPromise.install","originalPlay","HTMLMediaElement.prototype.play","shaka.polyfill.VideoPlaybackQuality.webkit_","webkitDroppedFrameCount","webkitDecodedFrameCount","shaka.polyfill.VideoPlaybackQuality.install","shaka.polyfill.VTTCue.from3ArgsTextTrackCue_","TextTrackCue","shaka.polyfill.VTTCue.from6ArgsTextTrackCue_","shaka.polyfill.VTTCue.install","constructorLength"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;AC9DA;;;;IAIqBA,K;;;;;AAqCnB;;;;;;AAfA;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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,E;;;;;;;;;;;;;;;AC5FA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEqBS,K;;;;;;;AAyBnB;;;;;;AAZA;;;;;;AAZA;;;;;gCA6BmBpD,Q,EAAU;AAC3B,aAAO,8BAAoBlF,WAApB,CAAgCkF,QAAhC,CAAP;AACD;;AAED;;;;;;;AAdA;;;;AAbA;;;;;;;;AAgCA,iBAAY7E,MAAZ,EAA4B3B,MAA5B,EAA4C;AAAA;;AAAA;;AAE1C,UAAK6J,mBAAL;AACA,UAAKtJ,aAAL,GAAqB,4BAArB;AACA,UAAKuJ,uBAAL,CAA6BnI,MAA7B,EAAqC3B,MAArC;AACA,UAAK+J,MAAL;AAL0C;AAM3C;;AAED;;;;;;;;;8BAKgB;AACd,WAAKC,MAAL;AACA,UAAI,KAAKC,mBAAT,EAA8B;AAC5B,aAAKA,mBAAL,CAAyB/I,OAAzB;AACD;AACD,UAAI,KAAKgJ,GAAT,EAAc;AACZ,aAAK1G,KAAL;AACA,aAAK0G,GAAL,CAASC,eAAT,CAAyB,KAAzB;AACA,YAAI,KAAKD,GAAL,CAASE,UAAb,EAAyB;AACvB,eAAKF,GAAL,CAASE,UAA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uB;AACrB,aAAO,KAAKwS,SAAZ;AACD;;AAED;;;;;sBAIaE,O,EAAuB;AAClC,WAAKF,SAAL,GAAiBE,UAAU,KAAKD,UAAhC;AACD;;;;;;kBAhDkBF,K;;;;;;;;;;;;ACLrB,IAAMI,cAAyC;AAC7CnM,SAAO,OADsC;AAE7CC,SAAO,OAFsC;AAG7CC,QAAM;AAHuC,CAA/C;;kBAMeiM,W;;;;;;ACPf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;;AAEf;AACA;;AAEA;AACA;;AAEA,8CAA8C;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4CAA4C;AAC5C;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oDAAoD;AACpD;AACA;AACA;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;;AAEA;AACA,0CAA0C,0BAA0B;;AAEpE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mEAAmE,aAAa;AAChF;;AAEA;AACA,sDAAsD;AACtD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;;;;;;;;;;;;;AC7PD;;IAAYC,O;;AAGZ;;;;AAGA;;;;AACA;;AAGA;;AACA;;;;;;AAEA;;AAJA;;;AAJA;;;AANA;QAgBQA,O,GAAAA,O;QAASC,W;QAAaC,S;;AAb9B,+B;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;AC9DA;;;;IAIqBC,c;;AAsCnB;;;;;AAXA;;;;;AAVA;;;;;AAVA;;;;AAmCA,4BAAsD;AAAA,QAA1CC,OAA0C,uEAAX,IAAIhH,GAAJ,EAAW;;AAAA;;AACpD,SAAKgH,OAAL,GAAeA,OAAf;AACA,SAAKA,OAAL,CAAa3G,GAAb,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AEA,8CAA8C;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4CAA4C;AAC5C;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oDAAoD;AACpD;AACA;AACA;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;;AAEA;AACA,0CAA0C,0BAA0B;;AAEpE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mEAAmE,aAAa;AAChF;;AAEA;AACA,sDAAsD;AACtD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAC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rB;;AAEA,oGAAoG,mBAAmB,EAAE,mBAAmB,kGAAkG;;AAE9O,gCAAgC,2CAA2C,gBAAgB,kBAAkB,OAAO,2BAA2B,wDAAwD,gCAAgC,uDAAuD,2DAA2D,EAAE,EAAE,yDAAyD,qEAAqE,6DAA6D,oBAAoB,GAAG,EAAE;;AAEjjB;AACA;AACA,CAAC;AACD;;AAEA,iDAAiD,0CAA0C,0DAA0D,EAAE;;AAEvJ;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA,mEAAmE,gEAAgE;AACnI;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA,kFAAkF,mEAAmE;AACrJ;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4FAA4F,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;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA,kCAAkC,SAAS;AAC3C;AACA;AACA;AACA;AACA,sGAAsG,KAAK,wBAAwB;AACnI;AACA,sFAAsF,0DAA0D;AAChJ,6EAA6E,4DAA4D;AACzI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uHAAuH;AACvH;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,SAAS,mEAAmE;AAC5E;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,uCAAuC;AACvC,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,kIAAkI,iCAAiC,6HAA6H;AAChS;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qFAAqF;AACrF;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,6FAA6F;AAC7F,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,uCAAuC,UAAU;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,oDAAoD,iBAAiB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,gHAAgH;AAC7L;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,2CAA2C,KAAK;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8IAA8I;AAC9I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8IAA8I;AAC9I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA,uJAAuJ;AACvJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAA8D;AAC9D,CAAC;AACD,kC;;;;;;AC/YA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;;;;;;AAMA;AACA;AACA;AACA;AACA;;;;;;;;;;AAUA;AACA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;;;;AAUA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;AAIA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY;AACZ;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qEAAqE;;AAErE;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wCAAwC;AACxC,kDAAkD;;AAElD;AACA;;AAEA;;AAEA;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAyB;AACzB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uFAAuF,gBAAgB;AACvG;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,YAAY;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ,GAAG;AACH;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA,oBAAoB;AACpB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA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;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;;ACvLtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,yBAAyB;AACvC;;AAEA;AACA;AACA,eAAe,WAAW;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,YAAY,yBAAyB;;AAErC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,C;;;;;;;;;;ACvPA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;A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;;;ACLA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AC5BA;;;;;;;;sDCAA;;AAEA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA,sCAAsC,uCAAuC,kBAAkB;;AAE/F,SAAS;;;AAGT;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;;AAEA;AACA,4B;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;ACrBA;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA,E;;;;;;;;;;;ACtBsB;AACtB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,mEAAmE;AACnE;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C,+EAAyB;;AAEpE;AACA;AACA;;AAEA;AACA,mCAAmC,aAAa;AAChD;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,8BAA8B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;ACjIA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA,aAAa,gBAAgB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,C;;;;;;;;AClDA;AAAA,mDAAmD,gBAAgB,sBAAsB,OAAO,2BAA2B,0BAA0B,yDAAyD,2BAA2B,EAAE,EAAE,EAAE,eAAe;;AAE9P;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,SAAS;AACtB;AACA;AACA,wEAAwE,aAAa;AACrF;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,wBAAwB;AACxB;AACA,OAAO;AACP;AACA;AACA,C;;;;;;AC/CA,eAAe,mFAAkI,iBAAiB,oBAAoB,iCAAiC,cAAc,aAAa,sBAAsB,SAAS,E;;;;;;;;;;;;;ACCjR;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;AAEA,IAAMW,UAAU,4BAAgB;AAC9BC,0BAD8B;AAE9BC,wBAF8B;AA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;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mEAAmE,aAAa;AAChF;;AAEA;AACA,sDAAsD;AACtD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;;;;;;;;;;;AC/PD;;AACA;;;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAM+wB,kBAAkB,SAAlBA,eAAkB;AAAA,SAAU;AAChC1E,oBAAgBxB,MAAMsF,MAAN,CAAa9D,cADG;AAEhCG,kBAAc3B,MAAMsF,MAAN,CAAa7D,WAAb,CAAyBE,YAFP;AAGhC5B,mBAAeC,MAAMuF,KAAN,CAAYxF,aAHK;AAIhCI,cAAUH,MAAMuF,KAAN,CAAYpF;AAJU,GAAV;AAAA,CAAxB;;IAQMgG,K,WADL,0BAAQD,eAAR,EAAyB,6CAAzB,C;;;AAEC,mBAAc;AAAA;;AAAA,yGACN,EAACrwB,MAAM,OAAP,EADM;AAEb;;;;wCAEmB;AAClB,WAAK4pB,KAAL,CAAWa,cAAX,CAA0B,yBAA1B;AACD;;;2BAEMb,K,EAAO;AACZ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BAAmB,GAAG,UAAU,2BAA2B,oBAAoB,6BAA6B,KAAK,UAAU,2BAA2B,mBAAmB,GAAG,UAAU,2BAA2B,oBAAoB,cAAc,kBAAkB,MAAM,OAAO,WAAW,YAAY,uBAAuB,0DAA0D,kDAAkD,oBAAoB,YAAY,aAAa,UAAU,kBAAkB,QAAQ,SAAS,uBAAuB,UAAU;;AAE/mmB;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,IAAI;AACJ;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,oDAAoD,cAAc;;AAElE;AACA;;;;;;;AC3EA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA,CAAC;;AAED;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,iBAAiB,mBAAmB;AACpC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA,mBAAmB,2BAA2B;;AAE9C;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,mBAAmB;AACnC;AACA;;AAEA;AACA;;AAEA,iBAAiB,2BAA2B;AAC5C;AACA;;AAEA,QAAQ,uBAAuB;AAC/B;AACA;AACA,GAAG;AACH;;AAEA,iBAAiB,uBAAuB;AACxC;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA;AACA,cAAc;;AAEd,kDAAkD,sBAAsB;AACxE;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD;AACvD;;AAEA,6BAA6B,mBAAmB;;AAEhD;;AAEA;;AAEA;AACA;;;;;;;;AC/VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,WAAW,EAAE;AACrD,wCAAwC,WAAW,EAAE;;AAErD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,sCAAsC;AACtC,GAAG;AACH;AACA,8DAA8D;AAC9D;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;;;;;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;AC5DA;;;;AACA;;;;;;;;;;AAGA;;;;IAIqBQ,U;;;;;;;AAmDnB;;;;;;;;AArBA;;;;;;AAMA;;;;;;;AAOA;;;;;;;AAnCA;;;;;;gCAkDmBnrB,Q,EAA2B;AAC5C,UAAIorB,iBAAkB,OAAOprB,QAAP,KAAoB,QAArB,GAAiCmrB,WAAWE,aAAX,CAAyBjrB,QAAzB,CAAkCJ,SAAS2F,WAAT,EAAlC,CAAj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AuBC,SAAvB,CAAiCuxB,WAAWx3B,EAA5C,C;AAdEw3B,U,CAqBZE,a,GAA+B,CACpC,uBADoC,EAEpC,+BAFoC,EAGpC,eAHoC,EAIpC,iBAJoC,EAKpC,iBALoC,EAMpC,eANoC,EAOpC,qBAPoC,C;kBArBnBF,U;AAmYrB,IAAIA,WAAWI,WAAX,EAAJ,EAA8B;AAC5B,6CAA2BJ,UAA3B;AACD,C;;;;;;AC9YD,+C;;;;;;ACAA,+C;;;;;;;;;;;YCAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjFA;;;AAGA;;;;;;;AAEA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AAGA;;;;AACA;;;;AAIA;;;;AACA;;;;AACA;;;;AACA;;;;;;AACA;;AAPA;;AAEA;;AANA;AACA;AAYO,IAAI,8CAAmB;AACxB,qBAAe,IADS,EACgB;AACxC,qBAAe,CAAC,CAFQ,EAEgB;AACxC,yBAAmB,SAHK,EAGgB;AACxC,aAAO,KAJiB,EAIgB;AACxC,yBAAmB,KALK,EAKgB;AACxC,4BAAsB,KANE,EAMgB;AACxC,+BAAyB,CAPD,EAOgB;AACxC,uBAAiB,EARO,EAQgB;AACxC,qBAAe,KAAK,IAAL,GAAY,IATH,EASgB;AACxC,qBAAe,GAVS,EAUgB;AACxC,mBAAa,CAXW,EAWgB;AACxC,+BAAyB,GAZD,EAYgB;AACxC,gCAA0B,CAbF,EAagB;AACxC,mBAAa,GAdW,EAcgB;AACxC,qBAAgB,CAfQ,EAegB;AACxC,8BAAwB,IAhBA,EAgBgB;AACxC,6BAAsB,CAjBE,EAiBgB;AACxC,mCAA6B,QAlBL,EAkBgB;AACxC,wBAAkB,SAnBM,EAmBgB;AACxC,8BAAwB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CAAE,CAAAF,EAAA,CAA6C,CAA7C,CAAgD,CAAhD,CAAmD,EAAnD,CADP,CAEF,MAAO5jH,CAAP,CAAc,CACd,EAAO,EADO,CArDL,CAAJ,GAELtH,MAAA4+C,OAFK,CAEWssE,EAFX,EAZP,CANyC,CA6E3C","file":"kaltura-player.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(\"KalturaPlayer\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"KalturaPlayer\"] = factory();\n\telse\n\t\troot[\"KalturaPlayer\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap ed28f8eddfad2a507e6c","(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(\"Playkit\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Playkit\"] = factory();\n\telse\n\t\troot[\"Playkit\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///core/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 21);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap dbf76349fddd4414c1d5\n\n\n// WEBPACK FOOTER //\n// webpack:/core/webpack/bootstrap dbf76349fddd4414c1d5","//@flow\n\n/**\n * General track representation of the player.\n * @classdesc\n */\nexport default class Track {\n /**\n * The id of the track.\n * @member\n * @type {string}\n * @private\n */\n _id: ?string;\n /**\n * The active mode of the track.\n * @member\n * @type {boolean}\n * @private\n */\n _active: boolean;\n /**\n * The label of the track.\n * @member\n * @type {string}\n * @private\n */\n _label: string;\n /**\n * The language of the track.\n * @member\n * @type {string}\n * @private\n */\n _language: string;\n /**\n * The index of the track.\n * @member\n * @type {number}\n * @private\n */\n _index: number;\n\n /**\n * Getter for the track id.\n * @public\n * @returns {?string} - The track id.\n */\n get id(): ?string {\n return this._id;\n }\n\n /**\n * Getter for the active mode of the track.\n * @public\n * @returns {boolean} - The active mode of the track.\n */\n get active(): boolean {\n return this._active;\n }\n\n /**\n * Setter for the active mode of the track.\n * @public\n * @param {boolean} value - Whether the track is active or not.\n */\n set active(value: boolean) {\n this._active = value;\n }\n\n /**\n * Getter for the label of the track.\n * @public\n * @returns {string} - The label of the track.\n */\n get label(): string {\n return this._label;\n }\n\n /**\n * Getter for the language of the track.\n * @public\n * @returns {string} - The language of the track.\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Getter for the index of the track.\n * @public\n * @returns {number} - The index of the track.\n */\n get index(): number {\n return this._index;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n constructor(settings: Object = {}) {\n this._id = settings.id;\n this._active = settings.active;\n this._label = settings.label;\n this._language = settings.language;\n this._index = settings.index;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./track/track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/track.js","//@flow\nimport * as JsLogger from 'js-logger';\n\nconst LOG_LEVEL: { [level: string]: Object } = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nclass LoggerFactory {\n constructor(options?: Object) {\n JsLogger.useDefaults(options || {});\n }\n\n getLogger(name?: string) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n}\n\nconst lf = new LoggerFactory({defaultLevel: JsLogger.DEBUG});\n\nexport default lf;\nexport {LOG_LEVEL};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/logger.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/logger.js","//@flow\n/**\n * Create an Event work-alike object based on the dictionary.\n * The event should contain all of the same properties from the dict.\n * @param {string} type -\n * @param {Object=} opt_dict -\n * @constructor\n * @extends {Event}\n */\nclass FakeEvent {\n /** @const {boolean} */\n bubbles: boolean;\n\n /** @const {boolean} */\n cancelable: boolean;\n\n /** @const {boolean} */\n defaultPrevented: boolean;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n timeStamp: number | Date;\n\n /** @const {string} */\n type: string;\n\n /** @const {boolean} */\n isTrusted: boolean;\n\n /** @type {EventTarget} */\n currentTarget: any;\n\n /** @type {EventTarget} */\n target: any;\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n stopped: boolean;\n\n payload: any;\n\n constructor(type: string, payload: any) {\n // These Properties below cannot be set by dict. They are all provided for\n // compatibility with native events.\n\n /** @const {boolean} */\n this.bubbles = false;\n\n /** @const {boolean} */\n this.cancelable = false;\n\n /** @const {boolean} */\n this.defaultPrevented = false;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n this.timeStamp = window.performance ? window.performance.now() : Date.now();\n\n /** @const {string} */\n this.type = type;\n\n /** @const {boolean} */\n this.isTrusted = false;\n\n /** @type {EventTarget} */\n this.currentTarget = null;\n\n /** @type {EventTarget} */\n this.target = null;\n\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n this.stopped = false;\n\n this.payload = payload;\n }\n\n /**\n * Does nothing, since FakeEvents have no default. Provided for compatibility\n * with native Events.\n * @override\n */\n preventDefault() {\n }\n\n /**\n * Stops processing event listeners for this event. Provided for compatibility\n * with native Events.\n * @override\n */\n stopImmediatePropagation() {\n this.stopped = true;\n }\n\n /**\n * Does nothing, since FakeEvents do not bubble. Provided for compatibility\n * with native Events.\n * @override\n */\n stopPropagation() {\n }\n}\n\nexport default FakeEvent;\n\n\n\n// WEBPACK FOOTER //\n// ./event/fake-event.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/fake-event.js","//@flow\nimport Track from './track'\n\n/**\n * Audio track representation of the player.\n * @classdesc\n */\nexport default class AudioTrack extends Track {}\n\n\n\n// WEBPACK FOOTER //\n// ./track/audio-track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/audio-track.js","//@flow\nimport Track from './track'\n\n/**\n * Text track representation of the player.\n * @classdesc\n */\nexport default class TextTrack extends Track {\n /**\n * The kind of the text track:\n * subtitles/captions/metadata.\n * @member\n * @type {string}\n * @private\n */\n _kind: string;\n\n /**\n * Getter for the kind of the text track.\n * @public\n * @returns {string} - The kind of the text track.\n */\n get kind(): string {\n return this._kind;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n constructor(settings: Object = {}) {\n super(settings);\n this._kind = settings.kind;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./track/text-track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/text-track.js","//@flow\nimport Track from './track'\n\n/**\n * Video track representation of the player.\n * @classdesc\n */\nexport default class VideoTrack extends Track {\n /**\n * The kind of the text track:\n * subtitles/captions/metadata.\n * @member\n * @type {string}\n * @private\n */\n _bandwidth: string;\n\n /**\n * Getter for the kind of the text track.\n * @public\n * @returns {string} - The kind of the text track.\n */\n get bandwidth(): string {\n return this._bandwidth;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n constructor(settings: Object = {}) {\n super(settings);\n this._bandwidth = settings.bandwidth;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./track/video-track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/video-track.js","//@flow\nimport MultiMap from '../utils/multi-map'\nimport FakeEvent from './fake-event'\n\n/**\n * Creates a new EventManager. An EventManager maintains a collection of \"event\n * bindings\" between event targets and event listeners.\n *\n * @struct\n * @constructor\n * @implements {IDestroyable}\n */\nclass EventManager {\n _bindingMap: MultiMap<Binding_> | null;\n\n constructor() {\n /**\n * Maps an event type to an array of event bindings.\n * @private {MultiMap.<!EventManager.Binding_>}\n */\n this._bindingMap = new MultiMap();\n }\n\n /**\n * Detaches all event listeners.\n * @override\n */\n destroy() {\n this.removeAll();\n this._bindingMap = null;\n return Promise.resolve();\n }\n\n\n /**\n * Attaches an event listener to an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {EventManager.ListenerType} listener The event listener.\n * @returns {void}\n */\n listen(target: any, type: string, listener: ListenerType): void {\n let binding = new Binding_(target, type, listener);\n if (this._bindingMap) {\n this._bindingMap.push(type, binding);\n }\n }\n\n\n /**\n * Detaches an event listener from an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @returns {void}\n */\n unlisten(target: any, type: string): void {\n if (this._bindingMap) {\n let list = this._bindingMap.get(type);\n\n for (let i = 0; i < list.length; ++i) {\n let binding = list[i];\n\n if (binding.target == target) {\n binding.unlisten();\n if (this._bindingMap) {\n this._bindingMap.remove(type, binding);\n }\n }\n }\n }\n }\n\n /**\n * Detaches all event listeners from all targets.\n * @returns {void}\n */\n removeAll(): void {\n if (this._bindingMap) {\n let listeners = this._bindingMap.getAll();\n\n for (let listener of listeners) {\n listener.unlisten();\n }\n if (this._bindingMap) {\n this._bindingMap.clear();\n }\n }\n }\n}\n\n/**\n * @typedef {function(!Event)}\n */\ntype ListenerType = (event: FakeEvent) => any;\n\n/**\n * Creates a new Binding_ and attaches the event listener to the event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {EventManager.ListenerType} listener The event listener.\n * @constructor\n * @private\n */\nclass Binding_ {\n target: any;\n type: string;\n listener: ?ListenerType;\n\n constructor(target, type, listener) {\n /** @type {EventTarget} */\n this.target = target;\n\n /** @type {string} */\n this.type = type;\n\n /** @type {?EventManager.ListenerType} */\n this.listener = listener;\n\n this.target.addEventListener(type, listener, false);\n }\n\n\n /**\n * Detaches the event listener from the event target. This does nothing if the\n * event listener is already detached.\n * @returns {void}\n */\n unlisten(): void {\n if (!this.target)\n return;\n\n this.target.removeEventListener(this.type, this.listener, false);\n\n this.target = null;\n this.listener = null;\n }\n}\n\nexport default EventManager;\n\n\n\n// WEBPACK FOOTER //\n// ./event/event-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/event-manager.js","//@flow\nimport {merge} from '../utils/util'\n\nconst HTML5_EVENTS: { [event: string]: string } = {\n /**\n * Fires when the loading of an audio/video is aborted\n */\n ABORT: 'abort',\n /**\n * Fires when the browser can start playing the audio/video\n */\n CAN_PLAY: 'canplay',\n /**\n * Fires when the browser can play through the audio/video without stopping for buffering\n */\n CAN_PLAY_THROUGH: 'canplaythrough',\n /**\n * Fires when the duration of the audio/video is changed\n */\n DURATION_CHANGE: 'durationchange',\n /**\n * Fires when the current playlist is empty\n */\n EMPTIED: 'emptied',\n /**\n * Fires when the current playlist is ended\n */\n ENDED: 'ended',\n /**\n * Fires when an error occurred during the loading of an audio/video\n */\n ERROR: 'error',\n /**\n * Fires when the browser has loaded the current frame of the audio/video\n */\n LOADED_DATA: 'loadeddata',\n /**\n * Fires when the browser has loaded meta data for the audio/video\n */\n LOADED_METADATA: 'loadedmetadata',\n /**\n * Fires when the browser starts looking for the audio/video\n */\n LOAD_START: 'loadstart',\n /**\n * Fires when the audio/video has been paused\n */\n PAUSE: 'pause',\n /**\n * Fires when the audio/video has been started or is no longer paused\n */\n PLAY: 'play',\n /**\n * Fires when the audio/video is playing after having been paused or stopped for buffering\n */\n PLAYING: 'playing',\n /**\n * Fires when the browser is downloading the audio/video\n */\n PROGRESS: 'progress',\n /**\n * Fires when the playing speed of the audio/video is changed\n */\n RATE_CHANGE: 'ratechange',\n /**\n * Fires when the user is finished moving/skipping to a new position in the audio/video\n */\n SEEKED: 'seeked',\n /**\n * Fires when the user starts moving/skipping to a new position in the audio/video\n */\n SEEKING: 'seeking',\n /**\n * Fires when the browser is trying to get media data, but data is not available\n */\n STALLED: 'stalled',\n /**\n * Fires when the browser is intentionally not getting media data\n */\n SUSPEND: 'suspend',\n /**\n * Fires when the current playback position has changed\n */\n TIME_UPDATE: 'timeupdate',\n /**\n * Fires when the volume has been changed\n */\n VOLUME_CHANGE: 'volumechange',\n /**\n * Fires when the video stops because it needs to buffer the next frame\n */\n WAITING: 'waiting',\n};\n\nconst CUSTOM_EVENTS: { [event: string]: string } = {\n /**\n * Fires when the active video track has been changed\n */\n VIDEO_TRACK_CHANGED: 'videotrackchanged',\n /**\n * Fires when the active audio track has been changed\n */\n AUDIO_TRACK_CHANGED: 'audiotrackchanged',\n /**\n * Fires when the active text track has been changed\n */\n TEXT_TRACK_CHANGED: 'texttrackchanged',\n /**\n * Fires when the player tracks have been changed\n */\n TRACKS_CHANGED: 'trackschanged',\n /**\n * Fires when the player state has been changed\n */\n PLAYER_STATE_CHANGED: 'playerstatechanged',\n /**\n * Fires on the first play\n */\n FIRST_PLAY: 'firstplay',\n /**\n * Fires when the player has selected the source to play\n */\n SOURCE_SELECTED: 'sourceselected'\n};\n\nconst PLAYER_EVENTS: { [event: string]: string } = merge([HTML5_EVENTS, CUSTOM_EVENTS]);\n\nexport {PLAYER_EVENTS, HTML5_EVENTS, CUSTOM_EVENTS};\n\n\n\n// WEBPACK FOOTER //\n// ./event/events.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/events.js","//@flow\nimport EventManager from './event/event-manager'\nimport FakeEvent from './event/fake-event'\nimport FakeEventTarget from './event/fake-event-target'\nimport {PLAYER_EVENTS as PlayerEvents, HTML5_EVENTS as Html5Events, CUSTOM_EVENTS as CustomEvents} from './event/events'\nimport PlayerStates from './state/state-types'\nimport {isNumber, isFloat, merge} from './utils/util'\nimport LoggerFactory from './utils/logger'\nimport Html5 from './engines/html5/html5'\nimport PluginManager from './plugin/plugin-manager'\nimport StateManager from './state/state-manager'\nimport TrackTypes from './track/track-types'\nimport Track from './track/track'\nimport VideoTrack from './track/video-track'\nimport AudioTrack from './track/audio-track'\nimport TextTrack from './track/text-track'\n\n/**\n * The HTML5 player class.\n * @classdesc\n */\nclass Player extends FakeEventTarget {\n /**\n * The player class logger.\n * @type {any}\n * @private\n */\n _logger: any;\n /**\n * The plugin manager of the player.\n * @type {PluginManager}\n * @private\n */\n _pluginManager: PluginManager;\n /**\n * The event manager of the player.\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * The runtime configuration of the player.\n * @type {Object}\n * @private\n */\n _config: Object;\n /**\n * The playback engine.\n * @type {IEngine}\n * @private\n */\n _engine: IEngine;\n /**\n * The state manager of the player.\n * @type {StateManager}\n * @private\n */\n _stateManager: StateManager;\n /**\n * The tracks of the player.\n * @type {Array<Track>}\n * @private\n */\n _tracks: Array<Track>;\n /**\n * The player ready promise\n * @type {Promise<*>}\n * @private\n */\n _readyPromise: ?Promise<*>;\n /**\n * Whether the play is the first or not\n * @type {boolean}\n * @private\n */\n _firstPlay: boolean;\n\n /**\n * @param {Object} config - The configuration for the player instance.\n * @constructor\n */\n constructor(config: Object) {\n super();\n this._tracks = [];\n this._firstPlay = true;\n this._logger = LoggerFactory.getLogger('Player');\n this._stateManager = new StateManager(this);\n this._pluginManager = new PluginManager();\n this._eventManager = new EventManager();\n this._readyPromise = new Promise((resolve, reject) => {\n this._eventManager.listen(this, CustomEvents.TRACKS_CHANGED, () => {\n resolve();\n });\n this._eventManager.listen(this, Html5Events.ERROR, reject);\n });\n this.configure(config);\n }\n\n /**\n * Configures the player according to given configuration.\n * @param {Object} config - The configuration for the player instance.\n * @returns {void}\n */\n configure(config: Object): void {\n this._config = merge([this._config, config || Player._defaultConfig()]);\n this._loadPlugins(this._config);\n this._selectEngine(this._config);\n this._attachMedia();\n }\n\n /**\n * Destroys the player.\n * @returns {void}\n * @public\n */\n destroy(): void {\n this._engine.destroy();\n this._eventManager.destroy();\n this._pluginManager.destroy();\n this._stateManager.destroy();\n this._config = {};\n this._tracks = [];\n this._readyPromise = null;\n this._firstPlay = true;\n }\n\n /**\n * @returns {Object} - The default configuration of the player.\n * @private\n * @static\n */\n static _defaultConfig(): Object {\n return {};\n }\n\n /**\n *\n * @param {Object} config - The configuration of the player instance.\n * @private\n * @returns {void}\n */\n _loadPlugins(config: Object): void {\n let plugins = config.plugins;\n for (let name in plugins) {\n this._pluginManager.load(name, this, plugins[name]);\n }\n }\n\n /**\n * Select the engine to create based on the given configured sources.\n * @param {Object} config - The configuration of the player instance.\n * @private\n * @returns {void}\n */\n _selectEngine(config: Object): void {\n if (config && config.sources) {\n let sources = config.sources;\n for (let i = 0; i < sources.length; i++) {\n if (Html5.canPlayType(sources[i].mimetype)) {\n this.dispatchEvent(new FakeEvent(CustomEvents.SOURCE_SELECTED, {selectedSource: sources[i]}));\n this._loadEngine(sources[i], config);\n break;\n }\n }\n }\n }\n\n /**\n * Loads the selected engine.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The configuration of the player instance.\n * @private\n * @returns {void}\n */\n _loadEngine(source: Source, config: Object): void {\n this._engine = new Html5(source, config);\n if (config.preload === \"auto\") {\n this.load();\n }\n }\n\n /**\n * Listen to all HTML5 defined events and trigger them on the player\n * @private\n * @returns {void}\n */\n _attachMedia(): void {\n if (this._engine) {\n for (let playerEvent in Html5Events) {\n this._eventManager.listen(this._engine, Html5Events[playerEvent], (event: FakeEvent) => {\n return this.dispatchEvent(event);\n });\n }\n this._eventManager.listen(this._engine, CustomEvents.VIDEO_TRACK_CHANGED, (event: FakeEvent) => {\n this._markActiveTrack(event.payload.selectedVideoTrack);\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this._engine, CustomEvents.AUDIO_TRACK_CHANGED, (event: FakeEvent) => {\n this._markActiveTrack(event.payload.selectedAudioTrack);\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this._engine, CustomEvents.TEXT_TRACK_CHANGED, (event: FakeEvent) => {\n this._markActiveTrack(event.payload.selectedTextTrack);\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this, Html5Events.PLAY, this._onPlay.bind(this));\n }\n }\n\n /**\n * Returns the tracks according to the filter. if no filter given returns the all tracks.\n * @function getTracks\n * @param {string} [type] - a tracks filter, should be 'video', 'audio' or 'text'.\n * @returns {Array<Track>} - The parsed tracks.\n * @public\n */\n getTracks(type?: string): Array<Track> {\n return this._getTracksByType(type);\n }\n\n /**\n * Returns the tracks according to the filter. if no filter given returns the all tracks.\n * @function _getTracksByType\n * @param {string} [type] - a tracks filter, should be 'video', 'audio' or 'text'.\n * @returns {Array<Track>} - The parsed tracks.\n * @private\n */\n _getTracksByType(type?: string): Array<Track> {\n return !type ? this._tracks : this._tracks.filter((track: Track) => {\n if (type === TrackTypes.VIDEO) {\n return track instanceof VideoTrack;\n } else if (type === TrackTypes.AUDIO) {\n return track instanceof AudioTrack;\n } else if (type === TrackTypes.TEXT) {\n return track instanceof TextTrack;\n } else {\n return true;\n }\n });\n }\n\n /**\n * Select a track\n * @function selectTrack\n * @param {Track} track - the track to select\n * @returns {void}\n * @public\n */\n selectTrack(track: Track): void {\n if (this._engine) {\n if (track instanceof VideoTrack) {\n this._engine.selectVideoTrack(track);\n } else if (track instanceof AudioTrack) {\n this._engine.selectAudioTrack(track);\n } else if (track instanceof TextTrack) {\n this._engine.selectTextTrack(track);\n }\n }\n }\n\n /**\n * Enables adaptive bitrate switching.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n if (this._engine) {\n this._engine.enableAdaptiveBitrate();\n }\n }\n\n /**\n * Mark the selected track as active\n * @function _markActiveTrack\n * @param {Track} track - the track to mark\n * @returns {void}\n * @private\n */\n _markActiveTrack(track: Track) {\n let type;\n if (track instanceof VideoTrack) {\n type = TrackTypes.VIDEO;\n } else if (track instanceof AudioTrack) {\n type = TrackTypes.AUDIO;\n } else if (track instanceof TextTrack) {\n type = TrackTypes.TEXT;\n }\n if (type) {\n let tracks = this.getTracks(type);\n for (let i = 0; i < tracks.length; i++) {\n tracks[i].active = track.index === i;\n }\n }\n }\n\n /**\n * @function _onPlay\n * @return {void}\n * @private\n */\n _onPlay(): void {\n if (this._firstPlay) {\n this._firstPlay = false;\n this.dispatchEvent(new FakeEvent(CustomEvents.FIRST_PLAY));\n }\n }\n\n /**\n * Get the player config.\n * @returns {Object} - The player configuration.\n * @public\n */\n get config(): Object {\n return this._config;\n }\n\n /**\n * Set player session id\n * @param {string} sessionId - the player session id to set\n * @returns {void}\n * @public\n */\n set sessionId(sessionId: string): void {\n this._config.session = this._config.session || {};\n this._config.session.id = sessionId;\n }\n\n // <editor-fold desc=\"Playback Interface\">\n /**\n * The player readiness\n * @public\n * @returns {Promise<*>} - The ready promise\n */\n ready(): Promise<*> {\n return this._readyPromise ? this._readyPromise : Promise.resolve();\n }\n\n /**\n * Load media\n * @public\n * @returns {void}\n */\n load(): void {\n if (this._engine) {\n this._engine.load().then((data) => {\n this._tracks = data.tracks;\n this.dispatchEvent(new FakeEvent(CustomEvents.TRACKS_CHANGED, {tracks: this._tracks}));\n }).catch((error) => {\n this.dispatchEvent(new FakeEvent(Html5Events.ERROR, error));\n });\n }\n }\n\n /**\n * Start/resume playback.\n * @returns {void}\n * @public\n */\n play(): void {\n if (this._engine) {\n if (this._engine.src) {\n this._engine.play();\n } else {\n this.load();\n this.ready().then(() => {\n this._engine.play();\n });\n }\n }\n }\n\n /**\n * Pause playback.\n * @returns {void}\n * @public\n */\n pause(): void {\n if (this._engine) {\n return this._engine.pause();\n }\n }\n\n /**\n * Set the current time in seconds.\n * @param {Number} to - The number to set in seconds.\n * @public\n */\n set currentTime(to: number): void {\n if (this._engine) {\n if (isNumber(to)) {\n let boundedTo = to;\n if (to < 0) {\n boundedTo = 0;\n }\n if (boundedTo > this._engine.duration) {\n boundedTo = this._engine.duration;\n }\n this._engine.currentTime = boundedTo;\n }\n }\n }\n\n /**\n * Get the current time in seconds.\n * @returns {?Number} - The playback current time.\n * @public\n */\n get currentTime(): ?number {\n if (this._engine) {\n return this._engine.currentTime;\n }\n }\n\n /**\n * Get the duration in seconds.\n * @returns {?Number} - The playback duration.\n * @public\n */\n get duration(): ?number {\n if (this._engine) {\n return this._engine.duration;\n }\n }\n\n /**\n * Set playback volume.\n * @param {Number} vol - The volume to set.\n * @returns {void}\n * @public\n */\n set volume(vol: number): void {\n if (this._engine) {\n if (isFloat(vol)) {\n let boundedVol = vol;\n if (boundedVol < 0) {\n boundedVol = 0;\n }\n if (boundedVol > 1) {\n boundedVol = 1;\n }\n this._engine.volume = boundedVol;\n }\n }\n }\n\n /**\n * Get playback volume.\n * @returns {?Number} - The playback volume.\n * @public\n */\n get volume(): ?number {\n if (this._engine) {\n return this._engine.volume;\n }\n }\n\n // </editor-fold>\n\n // <editor-fold desc=\"State\">\n /**\n * Get paused state.\n * @returns {?boolean} - Whether the video is paused or not.\n * @public\n */\n get paused(): ?boolean {\n if (this._engine) {\n return this._engine.paused;\n }\n }\n\n /**\n * Get seeking state.\n * @returns {?boolean} - Whether the video is seeking or not.\n * @public\n */\n get seeking(): ?boolean {\n if (this._engine) {\n return this._engine.seeking;\n }\n }\n\n buffered() {\n }\n\n /**\n * Set player muted state.\n * @param {boolean} mute - The mute value.\n * @returns {void}\n * @public\n */\n set muted(mute: boolean): void {\n if (this._engine) {\n this._engine.muted = mute;\n }\n }\n\n /**\n * Get player muted state.\n * @returns {?boolean} - Whether the video is muted or not.\n * @public\n */\n get muted(): ?boolean {\n if (this._engine) {\n return this._engine.muted;\n }\n }\n\n /**\n * Get the player source.\n * @returns {?string} - The current source of the player.\n * @public\n */\n get src(): ?string {\n if (this._engine) {\n return this._engine.src;\n }\n }\n\n /**\n * Get the player events.\n * @returns {Object} - The events of the player.\n * @public\n */\n get Event(): { [event: string]: string } {\n return PlayerEvents;\n }\n\n /**\n * Get the player states.\n * @returns {Object} - The states of the player.\n * @public\n */\n get State(): { [state: string]: string } {\n return PlayerStates;\n }\n\n /**\n * Get the player tracks types.\n * @returns {Object} - The tracks types of the player.\n * @public\n */\n get Track(): { [track: string]: string } {\n return TrackTypes;\n }\n\n// </editor-fold>\n}\n\nexport default Player;\n\n\n\n// WEBPACK FOOTER //\n// ./player.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/player.js","//@flow\nimport FakeEvent from './fake-event'\nimport MultiMap from '../utils/multi-map'\n\n/**\n * A work-alike for EventTarget. Only DOM elements may be true EventTargets,\n * but this can be used as a base class to provide event dispatch to non-DOM\n * classes. Only FakeEvents should be dispatched.\n *\n * @struct\n * @constructor\n * @implements {EventTarget}\n * @export\n */\nclass FakeEventTarget {\n _listeners: MultiMap<ListenerType>;\n dispatchTarget: FakeEventTarget;\n\n constructor() {\n /**\n * @private {!MultiMap.<FakeEventTarget.ListenerType>}\n */\n this._listeners = new MultiMap();\n\n /**\n * The target of all dispatched events. Defaults to |this|.\n * @type {EventTarget}\n */\n this.dispatchTarget = this;\n }\n\n /**\n * Add an event listener to this object.\n *\n * @param {string} type The event type to listen for.\n * @param {FakeEventTarget.ListenerType} listener The callback or\n * listener object to invoke.\n * @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have\n * parents, so events neither capture nor bubble.\n * @override\n * @export\n */\n addEventListener(type: string, listener: ListenerType) {\n this._listeners.push(type, listener);\n }\n\n /**\n * Remove an event listener from this object.\n *\n * @param {string} type The event type for which you wish to remove a listener.\n * @param {FakeEventTarget.ListenerType} listener The callback or\n * listener object to remove.\n * @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have\n * parents, so events neither capture nor bubble.\n * @override\n * @export\n */\n removeEventListener(type: string, listener: ListenerType) {\n this._listeners.remove(type, listener);\n }\n\n /**\n * Dispatch an event from this object.\n *\n * @param {!Event} event The event to be dispatched from this object.\n * @return {boolean} True if the default action was prevented.\n * @override\n * @export\n */\n dispatchEvent(event: FakeEvent) {\n // In many browsers, it is complex to overwrite properties of actual Events.\n // Here we expect only to dispatch FakeEvents, which are simpler.\n //goog.asserts.assert(event instanceof FakeEvent,\n // 'FakeEventTarget can only dispatch FakeEvents!');\n\n let list = this._listeners.get(event.type) || [];\n\n for (let i = 0; i < list.length; ++i) {\n // Do this every time, since events can be re-dispatched from handlers.\n event.target = this.dispatchTarget;\n event.currentTarget = this.dispatchTarget;\n\n let listener = list[i];\n try {\n if (listener.handleEvent) {\n listener.handleEvent(event);\n } else {\n listener.call(this, event);\n }\n } catch (exception) {\n // Exceptions during event handlers should not affect the caller,\n // but should appear on the console as uncaught, according to MDN:\n // http://goo.gl/N6Ff27\n // TODO: add log\n }\n\n if (event.stopped) {\n break;\n }\n }\n\n return event.defaultPrevented;\n }\n}\n\n/**\n * These are the listener types defined in the closure extern for EventTarget.\n * @typedef {EventListener|function(!Event):(boolean|undefined)}\n */\ndeclare function ListenerType(event: FakeEvent): (boolean | void);\n\nexport default FakeEventTarget;\n\n\n\n// WEBPACK FOOTER //\n// ./event/fake-event-target.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/fake-event-target.js","//@flow\nexport default class PlayerError {\n static TYPE: {[name: string]: Object} = {\n NOT_REGISTERED_PLUGIN: {\n name: \"PluginNotRegisteredException\",\n message: function (name) {\n return `Cannot load ${name} plugin. Name not found in the registry`;\n }\n },\n NOT_VALID_HANDLER: {\n name: \"PluginHandlerIsNotValidException\",\n message: function () {\n return \"To activate plugin you must provide a class derived from BasePlugin\";\n }\n },\n NOT_IMPLEMENTED_METHOD: {\n name: \"NotImplementedException\",\n message: function (method) {\n return `${method} method not implemented`;\n }\n }\n };\n\n name: string;\n message: string;\n\n constructor(error: Object, param?: any) {\n this.name = error.name;\n this.message = error.message(param);\n }\n\n getError() {\n return {\n name: this.name,\n message: this.message\n };\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./utils/player-error.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/player-error.js","//@flow\n\"use strict\";\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is a number\n */\nfunction isNumber(n: number): boolean {\n return Number(n) === n;\n}\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is an integer\n */\nfunction isInt(n: number): boolean {\n return isNumber(n) && n % 1 === 0;\n}\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is a float\n */\nfunction isFloat(n: number): boolean {\n return isNumber(n) && n % 1 !== 0;\n}\n\n/**\n * @param {Array<Object>} objects - The objects to merge\n * @returns {Object} - The merged object.\n */\nfunction merge(objects: Array<Object>): Object {\n let target = {};\n for (let obj of objects) {\n Object.assign(target, obj);\n }\n return target;\n}\n\nexport {isNumber, isInt, isFloat, merge};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/util.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/util.js","//@flow\n/* eslint-disable no-unused-vars */\nimport FakeEvent from '../../../event/fake-event'\nimport FakeEventTarget from '../../../event/fake-event-target'\nimport PlayerError from '../../../utils/player-error'\nimport {CUSTOM_EVENTS} from '../../../event/events'\nimport LoggerFactory from '../../../utils/logger'\nimport Track from '../../../track/track'\nimport VideoTrack from '../../../track/video-track'\nimport AudioTrack from '../../../track/audio-track'\nimport TextTrack from '../../../track/text-track'\n\nexport default class BaseMediaSourceAdapter extends FakeEventTarget implements IMediaSourceAdapter {\n /**\n * Passing the custom events to the actual media source adapter.\n * @static\n */\n static CustomEvents: { [event: string]: string } = CUSTOM_EVENTS;\n\n /**\n * Passing the getLogger function to the actual media source adapter.\n * @type {Function}\n * @static\n */\n static getLogger: Function = LoggerFactory.getLogger;\n\n /**\n * The adapter config.\n * @member {Object} _config\n * @private\n */\n _config: ?Object;\n\n /**\n * The source object.\n * @member {Source} _sourceObj\n * @private\n */\n _sourceObj: ?Source;\n\n /**\n * The dom video element.\n * @member {HTMLVideoElement} _videoElement\n * @private\n */\n _videoElement: HTMLVideoElement;\n\n /**\n * Checks if the media source adapter is supported.\n * @function isSupported\n * @returns {boolean} - Whether the media source adapter is supported.\n * @static\n */\n static isSupported(): boolean {\n return true;\n }\n\n /**\n * Factory method to create media source adapter.\n * @function createAdapter\n * @param {HTMLVideoElement} videoElement - The video element that the media source adapter work with.\n * @param {Object} source - The source Object.\n * @param {Object} config - The media source adapter configuration.\n * @returns {IMediaSourceAdapter} - New instance of the run time media source adapter.\n * @static\n */\n static createAdapter(videoElement: HTMLVideoElement, source: Source, config: Object): IMediaSourceAdapter {\n return new this(videoElement, source, config);\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to media source adapter.\n * @param {Source} source - The source object.\n * @param {Object} config - The media source adapter configuration.\n */\n constructor(videoElement: HTMLVideoElement, source: Source, config: Object) {\n super();\n this._videoElement = videoElement;\n this._sourceObj = source;\n this._config = config;\n }\n\n /**\n * Destroys the media source adapter.\n * @function destroy\n * @returns {void}\n */\n destroy(): void {\n this._sourceObj = null;\n this._config = null;\n }\n\n /**\n * Triggers the appropriate track changed event.\n * @param {Track} track - The selected track.\n * @private\n * @returns {void}\n */\n _onTrackChanged(track: Track): void {\n if (track instanceof VideoTrack) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.VIDEO_TRACK_CHANGED, {selectedVideoTrack: track});\n } else if (track instanceof AudioTrack) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.AUDIO_TRACK_CHANGED, {selectedAudioTrack: track});\n } else if (track instanceof TextTrack) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.TEXT_TRACK_CHANGED, {selectedTextTrack: track});\n }\n }\n\n /**\n * Dispatch an adapter event forward.\n * @param {string} name - The name of the event.\n * @param {Object} payload - The event payload.\n * @returns {void}\n */\n _trigger(name: string, payload: Object): void {\n this.dispatchEvent(new FakeEvent(name, payload));\n }\n\n /** Must implemented methods by the derived media source adapter **/\n\n static canPlayType(mimeType: string): boolean {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'static canPlayType').getError();\n }\n\n load(): Promise<Object> {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'load').getError();\n }\n\n selectVideoTrack(videoTrack: VideoTrack): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'selectVideoTrack').getError();\n }\n\n selectAudioTrack(audioTrack: AudioTrack): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'selectAudioTrack').getError();\n }\n\n selectTextTrack(textTrack: TextTrack): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'selectTextTrack').getError();\n }\n\n enableAdaptiveBitrate(): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'enableAdaptiveBitrate').getError();\n }\n\n get src(): string {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'get src').getError();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/media-source/base-media-source-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/media-source/base-media-source-adapter.js","//@flow\nimport NativeAdapter from './adapters/native-adapter'\nimport LoggerFactory from '../../../utils/logger'\n\n/**\n * Media source provider\n * @classdesc\n */\nexport default class MediaSourceProvider {\n /**\n * The logger of the media source provider\n * @member {any} _logger\n * @static\n * @private\n */\n static _logger: any = LoggerFactory.getLogger('MediaSourceProvider');\n /**\n * The media source adapter registry\n * @member {Array<IMediaSourceAdapter>} _mediaSourceAdapters\n * @static\n * @private\n */\n static _mediaSourceAdapters: Array<typeof IMediaSourceAdapter> = [NativeAdapter];\n /**\n * The selected adapter for playback\n * @type {null|IMediaSourceAdapter}\n * @static\n * @private\n */\n static _selectedAdapter: ?(typeof IMediaSourceAdapter) = null;\n\n /**\n * Add a media source adapter to the registry\n * @function register\n * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to register\n * @static\n * @returns {void}\n */\n static register(mediaSourceAdapter: typeof IMediaSourceAdapter): void {\n if (mediaSourceAdapter) {\n if (!MediaSourceProvider._mediaSourceAdapters.includes(mediaSourceAdapter)) {\n MediaSourceProvider._logger.debug(`Adapter <${mediaSourceAdapter.id}> has been registered successfully`);\n MediaSourceProvider._mediaSourceAdapters.push(mediaSourceAdapter);\n } else {\n MediaSourceProvider._logger.debug(`Adapter <${mediaSourceAdapter.id}> is already registered, do not register again`);\n }\n }\n }\n\n /**\n * Remove a media source adapter from the registry\n * @function unRegister\n * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to unRegister\n * @static\n * @returns {void}\n */\n static unRegister(mediaSourceAdapter: typeof IMediaSourceAdapter): void {\n let index = MediaSourceProvider._mediaSourceAdapters.indexOf(mediaSourceAdapter);\n if (index > -1) {\n MediaSourceProvider._logger.debug(`Unregistered <${mediaSourceAdapter.id}> adapter`);\n MediaSourceProvider._mediaSourceAdapters.splice(index, 1);\n }\n }\n\n /**\n * Checks if one of the registered media source adapters can play a given mime type\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @static\n * @returns {boolean} - If one of the adapters can play the specific mime type\n */\n static canPlayType(mimeType: string): boolean {\n let mediaSourceAdapters = MediaSourceProvider._mediaSourceAdapters;\n for (let i = 0; i < mediaSourceAdapters.length; i++) {\n if (mediaSourceAdapters[i].canPlayType(mimeType)) {\n MediaSourceProvider._selectedAdapter = mediaSourceAdapters[i];\n MediaSourceProvider._logger.debug(`Selected adapter is <${MediaSourceProvider._selectedAdapter.id}>`);\n return true;\n }\n }\n return false;\n }\n\n /**\n * Get the appropriate media source adapter to the video source\n * @function getMediaSourceAdapter\n * @param {HTMLVideoElement} videoElement - The video element which requires adapter for a given mimeType\n * @param {Source} source - The selected source object\n * @param {Object} config - The player configuration\n * @returns {IMediaSourceAdapter|null} - The selected media source adapter, or null if such doesn't exists\n * @static\n */\n static getMediaSourceAdapter(videoElement: HTMLVideoElement, source: Source, config: Object): ?IMediaSourceAdapter {\n if (videoElement && source && config) {\n if (!MediaSourceProvider._selectedAdapter) {\n MediaSourceProvider.canPlayType(source.mimetype);\n }\n return MediaSourceProvider._selectedAdapter ? MediaSourceProvider._selectedAdapter.createAdapter(videoElement, source, config.engines) : null;\n }\n return null;\n }\n}\n\nconst registerMediaSourceAdapter = MediaSourceProvider.register;\nexport {registerMediaSourceAdapter};\n\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/media-source/media-source-provider.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/media-source/media-source-provider.js","//@flow\nimport Player from '../player'\nimport LoggerFactory from '../utils/logger'\nimport {merge} from '../utils/util'\nimport EventManager from '../event/event-manager'\nimport PlayerError from '../utils/player-error'\n\n/** The BasePlugin responsible to implement the plugin interface.\n * Contains several default implementations.\n * Other plugins should extend this class.\n * @classdesc\n */\nexport default class BasePlugin implements IPlugin {\n /**\n * The runtime configuration of the plugin.\n * @member\n */\n config: Object;\n /**\n * The name of the plugin.\n * @member\n */\n name: string;\n /**\n * The logger of the plugin.\n * @member\n */\n logger: any;\n /**\n * Reference to the actual player.\n * @member\n */\n player: Player;\n /**\n * The event manager of the plugin.\n * @member\n */\n eventManager: EventManager;\n /**\n * The default configuration of the plugin.\n * Inherited plugins should override this property.\n * @type {Object}\n * @static\n * @member\n */\n static defaultConfig: Object = {};\n\n /**\n * Factory method to create the actual plugin.\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} config - The plugin configuration\n * @returns {BasePlugin} - New runtime plugin instance\n * @static\n * @public\n */\n static createPlugin(name: string, player: Player, config: Object = {}): BasePlugin {\n return new this(name, player, config);\n }\n\n /**\n * Returns under what conditions the plugin is valid.\n * Plugin must implement this method.\n * @returns {boolean} - Whether the plugin is valid and can be initiated. Default implementation is true\n * @static\n * @public\n * @abstract\n */\n static isValid(): boolean {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'isValid()').getError();\n }\n\n /**\n * constructor\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} config - The plugin configuration\n * @constructor\n * @private\n */\n constructor(name: string, player: Player, config: Object) {\n this.name = name;\n this.player = player;\n this.eventManager = new EventManager();\n this.logger = LoggerFactory.getLogger(this.name);\n this.config = merge([this.constructor.defaultConfig, config]);\n }\n\n /**\n * Getter for the configuration of the plugin.\n * @param {string} attr - The key in the plugin configuration (optional).\n * @returns {*} - If attribute is provided, returns its value. Else, Returns the config of the plugin.\n * @public\n */\n getConfig(attr?: string): any {\n if (attr) {\n return this.config[attr];\n }\n return this.config;\n }\n\n /**\n * Updates the config of the plugin.\n * @param {Object} update - The updated configuration.\n * @public\n * @returns {void}\n */\n updateConfig(update: Object): void {\n this.config = merge([this.config, update]);\n }\n\n /**\n * Runs the destroy logic of the plugin.\n * plugin must implement this method.\n * @public\n * @abstract\n * @returns {void}\n */\n destroy(): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'destroy()').getError();\n }\n\n /**\n * Getter for the plugin's name.\n * @returns {string} - The name of the plugin.\n * @public\n */\n getName(): string {\n return this.name;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./plugin/base-plugin.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/plugin/base-plugin.js","//@flow\nimport BasePlugin from './base-plugin'\nimport PlayerError from '../utils/player-error'\nimport Player from '../player'\nimport LoggerFactory from '../utils/logger'\n\n/**\n * The logger of the PluginManager class.\n * @private\n * @const\n */\nconst logger = LoggerFactory.getLogger(\"PluginManager\");\n\n/** The PluginManager responsible for register plugins definitions and store plugins instances.\n * @classdesc\n */\nexport default class PluginManager {\n /**\n * The registry of the plugins.\n * Maps plugin's name to his class.\n * @type {Map}\n * @static\n * @private\n */\n static _registry: Map<string, Function> = new Map();\n /**\n * The active plugins in the player.\n * Maps plugin's name to his instance.\n * @type {Map}\n * @private\n */\n _plugins: Map<string, BasePlugin> = new Map();\n\n /**\n * Writes the plugin in the registry.\n * Maps: plugin name -> plugin class.\n * @param {string} name - The plugin name\n * @param {Function} handler - The plugin class\n * @returns {boolean} - If the registration request succeeded\n * @static\n * @public\n */\n static register(name: string, handler: Function): boolean {\n if (typeof handler !== 'function' || handler.prototype instanceof BasePlugin === false) {\n throw new PlayerError(PlayerError.TYPE.NOT_VALID_HANDLER).getError();\n }\n if (!PluginManager._registry.has(name)) {\n PluginManager._registry.set(name, handler);\n logger.debug(`Plugin <${name}> has been registered successfully`);\n return true;\n }\n logger.debug(`Plugin <${name}> is already registered, do not register again`);\n return false;\n }\n\n /**\n * Removes the plugin from the registry.\n * @param {string} name - The plugin name\n * @static\n * @public\n * @returns {void}\n */\n static unRegister(name: string): void {\n if (PluginManager._registry.has(name)) {\n PluginManager._registry.delete(name);\n logger.debug(`Unregistered <${name}> plugin.`);\n }\n }\n\n /**\n * Creates and store new instance of the plugin in case isValid() of the plugin returns true.\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} [config={}] - The plugin configuration\n * @returns {boolean} - Whether the plugin load was successful\n * @public\n */\n load(name: string, player: Player, config: Object = {}): boolean {\n if (!PluginManager._registry.has(name)) {\n throw new PlayerError(PlayerError.TYPE.NOT_REGISTERED_PLUGIN, name).getError();\n }\n let pluginClass = PluginManager._registry.get(name);\n if (pluginClass != null && pluginClass.isValid()) {\n this._plugins.set(name, pluginClass.createPlugin(name, player, config));\n logger.debug(`Plugin <${name}> has been loaded`);\n return true;\n }\n logger.debug(`Plugin <${name}> isn\\'t loaded, isValid()=false`);\n return false;\n }\n\n /**\n * Iterates over all the plugins and calls private _destroy.\n * @public\n * @returns {void}\n */\n destroy(): void {\n this._plugins.forEach(this._destroy.bind(this));\n }\n\n /**\n * Calls destroy() method of the plugin's impl.\n * @param {BasePlugin} plugin - The plugin instance\n * @param {string} name - The plugin name\n * @private\n * @returns {void}\n */\n _destroy(plugin: BasePlugin, name: string): void {\n plugin.destroy();\n this._plugins.delete(name);\n }\n\n /**\n * Returns the plugin's instance.\n * @param {string} name - The plugin name\n * @returns {BasePlugin} - The plugin instance\n * @public\n */\n get(name: string): ?BasePlugin {\n return this._plugins.get(name);\n }\n}\n\n/**\n * Export the register method.\n * @type {function}\n * @constant\n */\nconst registerPlugin = PluginManager.register;\nexport {registerPlugin};\n\n\n\n// WEBPACK FOOTER //\n// ./plugin/plugin-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/plugin/plugin-manager.js","//@flow\n\n/**\n * The possible player state types.\n * @const\n * @type {{IDLE: string, LOADING: string, PLAYING: string, PAUSED: string, BUFFERING: string}}\n */\nconst PLAYER_STATE_TYPES: { [state: string]: string } = {\n IDLE: \"idle\",\n LOADING: \"loading\",\n PLAYING: \"playing\",\n PAUSED: \"paused\",\n BUFFERING: \"buffering\"\n};\n\nexport default PLAYER_STATE_TYPES;\n\n\n\n// WEBPACK FOOTER //\n// ./state/state-types.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/state/state-types.js","//@flow\n\n/**\n * A simple multimap template.\n * @constructor\n * @struct\n * @template T\n */\nclass MultiMap<T> {\n _map: Map<string, T[]>;\n\n constructor() {\n /** @private {!Object.<string, !Array.<T>>} */\n this._map = new Map();\n }\n\n /**\n * Add a key, value pair to the map.\n * @param {string} key -\n * @param {T} value -\n * @returns {void}\n */\n push(key: string, value: T): void {\n if (this._map.has(key)) {\n let list = this._map.get(key);\n if (Array.isArray(list)) {\n list.push(value);\n this._map.set(key, list);\n }\n } else {\n this._map.set(key, [value]);\n }\n }\n\n /**\n * Set an array of values for the key, overwriting any previous data.\n * @param {string} key -\n * @param {!Array.<T>} values -\n * @returns {void}\n */\n set(key: string, values: T[]): void {\n this._map.set(key, values);\n }\n\n /**\n * Check for a key.\n * @param {string} key -\n * @return {boolean} true if the key exists.\n */\n has(key: string): boolean {\n return this._map.has(key);\n }\n\n /**\n * Get a list of values by key.\n * @param {string} key -\n * @return {Array.<T>} or null if no suZch key exists.\n */\n get(key: string): Array<T> {\n let list = this._map.get(key);\n // slice() clones the list so that it and the map can each be modified\n // without affecting the other.\n return list ? list.slice() : [];\n }\n\n /**\n * Get a list of all values.\n * @returns {!Array.<T>} -\n */\n getAll(): T[] {\n let list: T[] = [];\n for (var value of this._map.values()) {\n list = list.concat(value);\n }\n return list;\n }\n\n /**\n * Remove a specific value, if it exists.\n * @param {string} key -\n * @param {T} value -\n * @returns {void}\n */\n remove(key: string, value: T): void {\n if (!this._map.has(key)) return;\n let list = this._map.get(key);\n if (Array.isArray(list)) {\n for (let i = 0; i < list.length; ++i) {\n if (list[i] == value) {\n list.splice(i, 1);\n --i;\n }\n }\n }\n }\n\n /**\n * Get all keys from the multimap.\n * @return {!Array.<string>}\n */\n // eslint-disable-next-line no-undef\n keys(): Iterator<string> {\n return this._map.keys();\n }\n\n\n /**\n * Clear all keys and values from the multimap.\n * @returns {void}\n */\n clear(): void {\n this._map.clear();\n }\n}\n\nexport default MultiMap;\n\n\n\n// WEBPACK FOOTER //\n// ./utils/multi-map.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/multi-map.js","module.exports = {\n\t\"name\": \"playkit-js\",\n\t\"version\": \"0.2.0\",\n\t\"main\": \"dist/playkit.js\",\n\t\"scripts\": {\n\t\t\"clean\": \"rm -rf ./dist\",\n\t\t\"prebuild\": \"npm run clean\",\n\t\t\"build:prod\": \"NODE_ENV=production webpack\",\n\t\t\"build\": \"webpack\",\n\t\t\"dev\": \"webpack --progress --colors --watch\",\n\t\t\"test\": \"NODE_ENV=test karma start --color\",\n\t\t\"test:chrome\": \"NODE_ENV=test karma start --color --browsers Chrome\",\n\t\t\"test:chrome:dots\": \"NODE_ENV=test karma start --color --browsers Chrome --reporters dots\",\n\t\t\"test:firefox\": \"NODE_ENV=test karma start --color --browsers Firefox\",\n\t\t\"test:safari\": \"NODE_ENV=test karma start --color --browsers Safari\",\n\t\t\"test:watch\": \"NODE_ENV=test karma start --color --auto-watch\",\n\t\t\"start\": \"webpack-dev-server\",\n\t\t\"release\": \"npm run build:prod && npm run commit:dist && standard-version\",\n\t\t\"publish\": \"git push --follow-tags --no-verify origin develop\",\n\t\t\"eslint\": \"eslint . --color\",\n\t\t\"flow\": \"flow check\",\n\t\t\"eslint:flow:test\": \"npm run eslint && npm run flow && npm run test\",\n\t\t\"commit:dist\": \"git add --all dist && (git commit -m 'chore: update dist' || exit 0)\",\n\t\t\"prepush-msg:build\": \"echo '\\nRunning build before push...\\n' && exit 0\",\n\t\t\"prepush-msg:dist\": \"echo '\\nAdding dist files to a seperate commit...\\n' && exit 0\",\n\t\t\"prepush-msg:done\": \"echo '\\nPre push tasks are done.\\n' && exit 0\"\n\t},\n\t\"pre-push\": [\n\t\t\"prepush-msg:build\",\n\t\t\"prebuild\",\n\t\t\"build\",\n\t\t\"build:prod\",\n\t\t\"prepush-msg:dist\",\n\t\t\"commit:dist\",\n\t\t\"prepush-msg:done\"\n\t],\n\t\"devDependencies\": {\n\t\t\"babel-cli\": \"^6.18.0\",\n\t\t\"babel-core\": \"^6.18.2\",\n\t\t\"babel-eslint\": \"^7.1.1\",\n\t\t\"babel-loader\": \"^6.2.7\",\n\t\t\"babel-plugin-istanbul\": \"^4.0.0\",\n\t\t\"babel-plugin-transform-class-properties\": \"^6.22.0\",\n\t\t\"babel-plugin-transform-flow-strip-types\": \"^6.22.0\",\n\t\t\"babel-preset-es2015\": \"^6.18.0\",\n\t\t\"babel-register\": \"^6.23.0\",\n\t\t\"chai\": \"^3.5.0\",\n\t\t\"cross-env\": \"^3.1.4\",\n\t\t\"eslint\": \"^3.10.0\",\n\t\t\"eslint-loader\": \"^1.6.1\",\n\t\t\"eslint-plugin-flowtype\": \"^2.30.0\",\n\t\t\"eslint-plugin-import\": \"^2.2.0\",\n\t\t\"eslint-plugin-mocha-no-only\": \"^0.0.5\",\n\t\t\"flow-bin\": \"latest\",\n\t\t\"istanbul\": \"^0.4.5\",\n\t\t\"karma\": \"^1.5.0\",\n\t\t\"karma-chai\": \"^0.1.0\",\n\t\t\"karma-chrome-launcher\": \"^2.0.0\",\n\t\t\"karma-cli\": \"^1.0.1\",\n\t\t\"karma-coverage\": \"^1.1.1\",\n\t\t\"karma-firefox-launcher\": \"^1.0.1\",\n\t\t\"karma-ie-launcher\": \"^1.0.0\",\n\t\t\"karma-mocha\": \"^1.3.0\",\n\t\t\"karma-safari-launcher\": \"^1.0.0\",\n\t\t\"karma-sourcemap-loader\": \"^0.3.7\",\n\t\t\"karma-webpack\": \"^2.0.2\",\n\t\t\"mocha\": \"^3.2.0\",\n\t\t\"mocha-cli\": \"^1.0.1\",\n\t\t\"pre-push\": \"^0.1.1\",\n\t\t\"sinon\": \"^2.0.0\",\n\t\t\"sinon-chai\": \"^2.8.0\",\n\t\t\"standard-version\": \"^4.0.0\",\n\t\t\"uglifyjs-webpack-plugin\": \"^0.4.3\",\n\t\t\"webpack\": \"latest\",\n\t\t\"webpack-dev-server\": \"latest\"\n\t},\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/kaltura/playkit-js\"\n\t},\n\t\"keywords\": [\n\t\t\"kaltura\",\n\t\t\"player\",\n\t\t\"html5 player\"\n\t],\n\t\"license\": \"AGPLV3\",\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/kaltura/playkit-js/issues\"\n\t},\n\t\"homepage\": \"https://github.com/kaltura/playkit-js\",\n\t\"dependencies\": {\n\t\t\"js-logger\": \"^1.3.0\"\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../package.json\n// module id = 18\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///package.json","//@flow\nimport FakeEventTarget from '../../event/fake-event-target'\nimport FakeEvent from '../../event/fake-event'\nimport EventManager from '../../event/event-manager'\nimport {HTML5_EVENTS as Html5Events, CUSTOM_EVENTS as CustomEvents} from '../../event/events'\nimport MediaSourceProvider from './media-source/media-source-provider'\nimport VideoTrack from '../../track/video-track'\nimport AudioTrack from '../../track/audio-track'\nimport TextTrack from '../../track/text-track'\n\nexport default class Html5 extends FakeEventTarget implements IEngine {\n /**\n * The video element.\n * @type {HTMLVideoElement}\n * @private\n */\n _el: HTMLVideoElement;\n /**\n * The event manager of the engine.\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * The selected media source adapter of the engine.\n * @type {IMediaSourceAdapter}\n * @private\n */\n _mediaSourceAdapter: ?IMediaSourceAdapter;\n\n /**\n * @type {string} - The engine name.\n */\n static EngineName: string = \"html5\";\n\n /**\n * Checks if the engine can play a given mime type.\n * @param {string} mimeType - The mime type to check.\n * @returns {boolean} - Whether the engine can play the mime type.\n */\n static canPlayType(mimeType) {\n return MediaSourceProvider.canPlayType(mimeType);\n }\n\n /**\n * @constructor\n * @param {Source} source - The selected source object.\n * @param {Object} config - The player configuration.\n */\n constructor(source: Source, config: Object) {\n super();\n this._createVideoElement();\n this._eventManager = new EventManager();\n this._loadMediaSourceAdapter(source, config);\n this.attach();\n }\n\n /**\n * Destroys the engine.\n * @public\n * @returns {void}\n */\n destroy(): void {\n this.detach();\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.destroy();\n }\n if (this._el) {\n this.pause();\n this._el.removeAttribute('src');\n if (this._el.parentNode) {\n this._el.parentNode.removeChild(this._el);\n }\n }\n this._eventManager.destroy();\n }\n\n /**\n * Listen to the video element events and triggers them from the engine.\n * @public\n * @returns {void}\n */\n attach(): void {\n for (let playerEvent in Html5Events) {\n this._eventManager.listen(this._el, Html5Events[playerEvent], () => {\n this.dispatchEvent(new FakeEvent(Html5Events[playerEvent]));\n });\n }\n if (this._mediaSourceAdapter) { // listen and dispatch adaptive bitrate changed event\n this._eventManager.listen(this._mediaSourceAdapter, CustomEvents.VIDEO_TRACK_CHANGED, (event: FakeEvent) => {\n this.dispatchEvent(event);\n });\n this._eventManager.listen(this._mediaSourceAdapter, CustomEvents.AUDIO_TRACK_CHANGED, (event: FakeEvent) => {\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this._mediaSourceAdapter, CustomEvents.TEXT_TRACK_CHANGED, (event: FakeEvent) => {\n return this.dispatchEvent(event);\n });\n }\n }\n\n /**\n * Remove the listeners of the video element events.\n * @public\n * @returns {void}\n */\n detach(): void {\n for (let playerEvent in Html5Events) {\n this._eventManager.unlisten(this._el, Html5Events[playerEvent]);\n }\n if (this._mediaSourceAdapter) { // unlisten to adaptive bitrate changed\n this._eventManager.unlisten(this._mediaSourceAdapter, CustomEvents.VIDEO_TRACK_CHANGED);\n this._eventManager.unlisten(this._mediaSourceAdapter, CustomEvents.AUDIO_TRACK_CHANGED);\n this._eventManager.unlisten(this._mediaSourceAdapter, CustomEvents.TEXT_TRACK_CHANGED);\n }\n }\n\n /**\n * @returns {HTMLVideoElement} - The video element.\n * @public\n */\n getVideoElement(): HTMLVideoElement {\n return this._el;\n }\n\n /**\n * Creates a video element dom object.\n * @private\n * @returns {void}\n */\n _createVideoElement(): void {\n this._el = document.createElement(\"video\");\n //Set attributes\n this._el.style.width = \"640px\";\n this._el.style.height = \"360px\";\n this._el.style.backgroundColor = \"black\";\n this._el.controls = true;\n if (document && document.body) {\n document.body.appendChild(this._el);\n }\n }\n\n /**\n * Loads the appropriate media source extension adapter.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The media source extension configuration.\n * @private\n * @returns {void}\n */\n _loadMediaSourceAdapter(source: Source, config: Object): void {\n this._mediaSourceAdapter = MediaSourceProvider.getMediaSourceAdapter(this.getVideoElement(), source, config);\n }\n\n /**\n * Select a new video track.\n * @param {VideoTrack} videoTrack - The video track object to set.\n * @returns {void}\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectVideoTrack(videoTrack);\n }\n }\n\n /**\n * Select a new audio track.\n * @param {AudioTrack} audioTrack - The video track object to set.\n * @returns {void}\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectAudioTrack(audioTrack);\n }\n }\n\n /**\n * Select a new text track.\n * @param {TextTrack} textTrack - The text track object to set.\n * @returns {void}\n */\n selectTextTrack(textTrack: TextTrack): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectTextTrack(textTrack);\n }\n }\n\n /**\n * Enables adaptive bitrate switching according to the media source extension logic.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.enableAdaptiveBitrate();\n }\n }\n\n /**\n * Set a source.\n * @param {string} source - Source to set.\n * @public\n * @returns {void}\n */\n set src(source: string): void {\n this._el.src = source;\n }\n\n /**\n * Get the source url.\n * @returns {string} - The source url.\n * @public\n */\n get src(): string {\n if (this._mediaSourceAdapter) {\n return this._mediaSourceAdapter.src;\n }\n return \"\";\n }\n\n //playback interface\n /**\n * Start/resume playback.\n * @public\n * @returns {void}\n */\n play(): void {\n return this._el.play();\n }\n\n /**\n * Pause playback.\n * @public\n * @returns {void}\n */\n pause(): void {\n return this._el.pause();\n }\n\n /**\n * Load media.\n * @public\n * @returns {Promise<Object>} - The loaded data\n */\n load(): Promise<Object> {\n return this._mediaSourceAdapter ? this._mediaSourceAdapter.load() : Promise.resolve({});\n }\n\n /**\n * Get the current time in seconds.\n * @returns {Number} - The current playback time.\n * @public\n */\n get currentTime(): number {\n return this._el.currentTime;\n }\n\n /**\n * Set the current time in seconds.\n * @param {Number} to - The number to set in seconds.\n * @public\n * @returns {void}\n */\n set currentTime(to: number): void {\n this._el.currentTime = to;\n }\n\n /**\n * Get the duration in seconds.\n * @returns {Number} - The playback duration.\n * @public\n */\n get duration(): number {\n return this._el.duration;\n }\n\n /**\n * Set playback volume.\n * @param {Number} vol - The volume to set.\n * @public\n * @returns {void}\n */\n set volume(vol: number): void {\n this._el.volume = vol;\n }\n\n /**\n * Get playback volume.\n * @returns {Number} - The volume value of the video element.\n * @public\n */\n get volume(): number {\n return this._el.volume;\n }\n\n ready() {\n }\n\n /**\n * Get paused state.\n * @returns {boolean} - The paused value of the video element.\n * @public\n */\n get paused(): boolean {\n return this._el.paused;\n }\n\n /**\n * Get seeking state.\n * @returns {boolean} - The seeking value of the video element.\n * @public\n */\n get seeking(): boolean {\n return this._el.seeking;\n }\n\n /**\n * Get the first seekable range (part) of the video in seconds.\n * @returns {TimeRanges} - First seekable range (part) of the video in seconds.\n * @public\n */\n get seekable(): TimeRanges {\n return this._el.seekable;\n }\n\n /**\n * Get the first played range (part) of the video in seconds.\n * @returns {TimeRanges} - First played range (part) of the video in seconds.\n * @public\n */\n get played(): TimeRanges {\n return this._el.played;\n }\n\n /**\n * Get the first buffered range (part) of the video in seconds.\n * @returns {TimeRanges} - First buffered range (part) of the video in seconds.\n * @public\n */\n get buffered(): TimeRanges {\n return this._el.buffered;\n }\n\n /**\n * Set player muted state.\n * @param {boolean} mute - The new mute value.\n * @public\n * @returns {void}\n */\n set muted(mute: boolean): void {\n this._el.muted = mute;\n }\n\n /**\n * Get player muted state.\n * @returns {boolean} - The muted value of the video element.\n * @public\n */\n get muted(): boolean {\n return this._el.muted;\n }\n\n /**\n * Get the default mute value.\n * @returns {boolean} - The defaultMuted of the video element.\n * @public\n */\n get defaultMuted(): boolean {\n return this._el.defaultMuted;\n }\n\n /**\n * Sets an image to be shown while the video is downloading, or until the user hits the play button.\n * @param {string} poster - The image url to be shown.\n * @returns {void}\n * @public\n */\n set poster(poster: string): void {\n this._el.poster = poster;\n }\n\n /**\n * Gets an image to be shown while the video is downloading, or until the user hits the play button.\n * @returns {poster} - The image url.\n * @public\n */\n get poster(): string {\n return this._el.poster;\n }\n\n /**\n * Specifies if and how the author thinks that the video should be loaded when the page loads.\n * @param {string} preload - The preload value.\n * @public\n * @returns {void}\n */\n set preload(preload: string): void {\n this._el.preload = preload;\n }\n\n /**\n * Gets the preload value of the video element.\n * @returns {string} - The preload value.\n * @public\n */\n get preload(): string {\n return this._el.preload;\n }\n\n /**\n * Set if the video will automatically start playing as soon as it can do so without stopping.\n * @param {boolean} autoplay - The autoplay value.\n * @public\n * @returns {void}\n */\n set autoplay(autoplay: boolean): void {\n this._el.autoplay = autoplay;\n }\n\n /**\n * Gets the autoplay value of the video element.\n * @returns {boolean} - The autoplay value.\n * @public\n */\n get autoplay(): boolean {\n return this._el.autoplay;\n }\n\n /**\n * Set to specifies that the video will start over again, every time it is finished.\n * @param {boolean} loop - the loop value.\n * @public\n * @returns {void}\n */\n set loop(loop: boolean) {\n this._el.loop = loop;\n }\n\n /**\n * Gets the loop value of the video element.\n * @returns {boolean} - The loop value.\n * @public\n */\n get loop(): boolean {\n return this._el.loop;\n }\n\n /**\n * Set to specifies that video controls should be displayed.\n * @param {boolean} controls - the controls value.\n * @public\n * @returns {void}\n */\n set controls(controls: boolean): void {\n this._el.controls = controls;\n }\n\n /**\n * Gets the controls value of the video element.\n * @returns {boolean} - The controls value.\n * @public\n */\n get controls(): boolean {\n return this._el.controls;\n }\n\n /**\n * Sets the current playback speed of the audio/video.\n * @param {Number} playbackRate - The playback speed value.\n * @public\n * @returns {void}\n */\n set playbackRate(playbackRate: number): void {\n this._el.playbackRate = playbackRate;\n }\n\n /**\n * Gets the current playback speed of the audio/video.\n * @returns {Number} - The current playback speed value.\n * @public\n */\n get playbackRate(): number {\n return this._el.playbackRate;\n }\n\n /**\n * Sets the default playback speed of the audio/video.\n * @param {Number} defaultPlaybackRate - The default playback speed value.\n * @public\n * @returns {void}\n */\n set defaultPlaybackRate(defaultPlaybackRate: number) {\n this._el.defaultPlaybackRate = defaultPlaybackRate;\n }\n\n /**\n * Gets the default playback speed of the audio/video.\n * @returns {Number} - The default playback speed value.\n * @public\n */\n get defaultPlaybackRate(): number {\n return this._el.defaultPlaybackRate;\n }\n\n /**\n * The ended property returns whether the playback of the audio/video has ended.\n * @returns {boolean} - The ended value.\n * @public\n */\n get ended(): boolean {\n return this._el.ended;\n }\n\n /**\n * The error property returns a MediaError object.\n * @returns {MediaError} - The MediaError object has a code property containing the error state of the audio/video.\n * @public\n */\n get error(): ?MediaError {\n return this._el.error;\n }\n\n /**\n * @returns {Number} - The current network state (activity) of the audio/video.\n * @public\n */\n get networkState(): number {\n return this._el.networkState;\n }\n\n /**\n * Indicates if the audio/video is ready to play or not.\n * @returns {Number} - The current ready state of the audio/video.\n * 0 = HAVE_NOTHING - no information whether or not the audio/video is ready.\n * 1 = HAVE_METADATA - metadata for the audio/video is ready.\n * 2 = HAVE_CURRENT_DATA - data for the current playback position is available, but not enough data to play next frame/millisecond.\n * 3 = HAVE_FUTURE_DATA - data for the current and at least the next frame is available.\n * 4 = HAVE_ENOUGH_DATA - enough data available to start playing.\n */\n get readyState(): number {\n return this._el.readyState;\n }\n\n /**\n * @returns {Number} - The height of the video player, in pixels.\n * @public\n */\n get videoHeight(): number {\n return this._el.videoHeight;\n }\n\n /**\n * @returns {Number} - The width of the video player, in pixels.\n * @public\n */\n get videoWidth(): number {\n return this._el.videoWidth;\n }\n\n /**\n * Test video element to check if html5 engine is supported.\n */\n static TEST_VID: HTMLVideoElement;\n\n /**\n * Checks if the html5 engine is supported.\n * @returns {boolean} - The isSupported result.\n * @static\n * @public\n */\n static isSupported() {\n try {\n Html5.TEST_VID = document.createElement('video');\n Html5.TEST_VID.volume = 0.5;\n } catch (e) {\n return false;\n }\n return !!Html5.TEST_VID.canPlayType;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/html5.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/html5.js","//@flow\nimport EventManager from '../../../../event/event-manager'\nimport {HTML5_EVENTS as Html5Events} from '../../../../event/events'\nimport Track from '../../../../track/track'\nimport VideoTrack from '../../../../track/video-track'\nimport AudioTrack from '../../../../track/audio-track'\nimport TextTrack from '../../../../track/text-track'\nimport BaseMediaSourceAdapter from '../base-media-source-adapter'\n\n/**\n * An illustration of media source extension for progressive download\n * @classdesc\n * @implements {IMediaSourceAdapter}\n */\nexport default class NativeAdapter extends BaseMediaSourceAdapter {\n /**\n * The id of the Adapter\n * @member {string} id\n * @static\n * @public\n */\n static id: string = 'NativeAdapter';\n\n /**\n * The adapter logger\n * @member {any} _logger\n * @private\n * @static\n */\n static _logger = BaseMediaSourceAdapter.getLogger(NativeAdapter.id);\n /**\n * The event manager of the class.\n * @member {EventManager} - _eventManager\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n _loadPromise: ?Promise<Object>;\n\n /**\n * Checks if NativeAdapter can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @returns {boolean} - Whether the native adapter can play a specific mime type\n * @static\n */\n static canPlayType(mimeType: string): boolean {\n let canPlayType = (typeof mimeType === 'string') ? !!(document.createElement(\"video\").canPlayType(mimeType.toLowerCase())) : false;\n NativeAdapter._logger.debug('canPlayType result for mimeType:' + mimeType + ' is ' + canPlayType.toString());\n return canPlayType;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to NativeAdapter\n * @param {Source} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n constructor(videoElement: HTMLVideoElement, source: Source, config: Object) {\n NativeAdapter._logger.debug('Creating adapter');\n super(videoElement, source, config);\n this._eventManager = new EventManager();\n }\n\n /**\n * Load the video source\n * @function load\n * @returns {Promise<Object>} - The loaded data\n */\n load(): Promise<Object> {\n if (!this._loadPromise) {\n this._loadPromise = new Promise((resolve, reject) => {\n // We're using 'loadeddata' event for native hls (on 'loadedmetadata' native hls doesn't have tracks yet).\n this._eventManager.listen(this._videoElement, Html5Events.LOADED_DATA, () => {\n this._eventManager.unlisten(this._videoElement, Html5Events.LOADED_DATA);\n let data = {tracks: this._getParsedTracks()};\n NativeAdapter._logger.debug('The source has been loaded successfully');\n resolve(data);\n });\n this._eventManager.listen(this._videoElement, Html5Events.ERROR, (error) => {\n this._eventManager.unlisten(this._videoElement, Html5Events.ERROR);\n NativeAdapter._logger.error(error);\n reject(error);\n });\n if (this._sourceObj && this._sourceObj.url) {\n this._videoElement.src = this._sourceObj.url;\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroys the native adapter.\n * @function destroy\n * @returns {void}\n */\n destroy(): void {\n NativeAdapter._logger.debug('destroy');\n super.destroy();\n this._eventManager.destroy();\n this._loadPromise = null;\n }\n\n /**\n * Get the parsed tracks\n * @function _getParsedTracks\n * @returns {Array<Track>} - The parsed tracks\n * @private\n */\n _getParsedTracks(): Array<Track> {\n let videoTracks = this._getParsedVideoTracks();\n let audioTracks = this._getParsedAudioTracks();\n let textTracks = this._getParsedTextTracks();\n return videoTracks.concat(audioTracks).concat(textTracks);\n }\n\n /**\n * Get the parsed video tracks\n * @function _getParsedVideoTracks\n * @returns {Array<Track>} - The parsed video tracks\n * @private\n */\n _getParsedVideoTracks(): Array<Track> {\n let videoTracks = this._videoElement.videoTracks;\n let parsedTracks = [];\n if (videoTracks) {\n for (let i = 0; i < videoTracks.length; i++) {\n let settings = {\n id: videoTracks[i].id,\n active: videoTracks[i].selected,\n label: videoTracks[i].label,\n language: videoTracks[i].language,\n index: i\n };\n parsedTracks.push(new VideoTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed audio tracks\n * @function _getParsedAudioTracks\n * @returns {Array<Track>} - The parsed audio tracks\n * @private\n */\n _getParsedAudioTracks(): Array<Track> {\n let audioTracks = this._videoElement.audioTracks;\n let parsedTracks = [];\n if (audioTracks) {\n for (let i = 0; i < audioTracks.length; i++) {\n let settings = {\n id: audioTracks[i].id,\n active: audioTracks[i].enabled,\n label: audioTracks[i].label,\n language: audioTracks[i].language,\n index: i\n };\n parsedTracks.push(new AudioTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed text tracks\n * @function _getParsedTextTracks\n * @returns {Array<Track>} - The parsed text tracks\n * @private\n */\n _getParsedTextTracks(): Array<Track> {\n let textTracks = this._videoElement.textTracks;\n let parsedTracks = [];\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n let settings = {\n kind: textTracks[i].kind,\n active: textTracks[i].mode === 'showing',\n label: textTracks[i].label,\n language: textTracks[i].language,\n index: i\n };\n parsedTracks.push(new TextTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Select a video track\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the track to select\n * @returns {void}\n * @public\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n let videoTracks = this._videoElement.videoTracks;\n if ((videoTrack instanceof VideoTrack) && videoTracks && videoTracks[videoTrack.index]) {\n this._disableVideoTracks();\n videoTracks[videoTrack.index].selected = true;\n this._onTrackChanged(videoTrack);\n }\n }\n\n /**\n * Select an audio track\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select\n * @returns {void}\n * @public\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n let audioTracks = this._videoElement.audioTracks;\n if ((audioTrack instanceof AudioTrack) && audioTracks && audioTracks[audioTrack.index]) {\n this._disableAudioTracks();\n audioTracks[audioTrack.index].enabled = true;\n this._onTrackChanged(audioTrack);\n }\n }\n\n /**\n * Select a text track\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select\n * @returns {void}\n * @public\n */\n selectTextTrack(textTrack: TextTrack): void {\n let textTracks = this._videoElement.textTracks;\n if ((textTrack instanceof TextTrack) && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions') && textTracks && textTracks[textTrack.index]) {\n this._disableTextTracks();\n textTracks[textTrack.index].mode = 'showing';\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Enables adaptive bitrate\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n NativeAdapter._logger.debug('Enabling adaptive bitrate not supported');\n }\n\n /**\n * Disables all the existing video tracks.\n * @private\n * @returns {void}\n */\n _disableVideoTracks(): void {\n let videoTracks = this._videoElement.videoTracks;\n if (videoTracks) {\n for (let i = 0; i < videoTracks.length; i++) {\n videoTracks[i].selected = false;\n }\n }\n }\n\n /**\n * Disables all the existing audio tracks.\n * @private\n * @returns {void}\n */\n _disableAudioTracks(): void {\n let audioTracks = this._videoElement.audioTracks;\n if (audioTracks) {\n for (let i = 0; i < audioTracks.length; i++) {\n audioTracks[i].enabled = false;\n }\n }\n }\n\n /**\n * Disables all the existing text tracks.\n * @private\n * @returns {void}\n */\n _disableTextTracks(): void {\n let textTracks = this._videoElement.textTracks;\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n textTracks[i].mode = 'disabled';\n }\n }\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * @public\n * @returns {string} - The src url.\n */\n get src(): string {\n return this._videoElement.src;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/media-source/adapters/native-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/media-source/adapters/native-adapter.js","//@flow\nimport Player from './player'\nimport LoggerFactory from './utils/logger'\nimport * as packageData from '../package.json'\nimport BaseMediaSourceAdapter from './engines/html5/media-source/base-media-source-adapter'\nimport {registerMediaSourceAdapter} from './engines/html5/media-source/media-source-provider'\nimport {registerPlugin} from './plugin/plugin-manager'\nimport BasePlugin from './plugin/base-plugin'\nimport Track from './track/track'\nimport VideoTrack from './track/video-track'\nimport AudioTrack from './track/audio-track'\nimport TextTrack from './track/text-track'\n\n// Playkit version\nlet VERSION = packageData.version;\n\nLoggerFactory.getLogger().log(\"%c Playkit \" + VERSION, \"color: yellow; font-size: large\");\nLoggerFactory.getLogger().log(\"%c For more details see https://github.com/kaltura/playkit-js\", \"color: yellow;\");\n\n/**\n * @param {Object} config - The configuration of the player\n * @returns {Player} - The player instance\n */\nexport function playkit(config: Object = {}) {\n return new Player(config);\n}\n\n// Export the media source adapters necessary utils\nexport {registerMediaSourceAdapter, BaseMediaSourceAdapter};\n\n// Export the plugin framework\nexport {registerPlugin, BasePlugin};\n\n// Export the tracks classes\nexport {Track, VideoTrack, AudioTrack, TextTrack};\n\n//export version\nexport {VERSION};\nexport default playkit;\n\n\n\n// WEBPACK FOOTER //\n// ./playkit.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/playkit.js","//@flow\nimport Player from '../player'\nimport EventManager from '../event/event-manager'\nimport State from './state'\nimport PlayerStates from './state-types'\nimport {HTML5_EVENTS as Html5Events, CUSTOM_EVENTS as CustomEvents} from '../event/events'\nimport FakeEvent from '../event/fake-event'\nimport LoggerFactory from '../utils/logger'\n\n/**\n * Define a transition object.\n */\ntype Transition = {\n [state: string]: {\n [event: string]: Function\n }\n}\n\n/**\n * This class responsible to manage all the state machine of the player.\n * @classdesc\n */\nexport default class StateManager {\n /**\n * The logger of the class.\n * @member\n * @type {any}\n * @private\n */\n _logger: any;\n /**\n * Reference to the actual player.\n * @member\n * @type {Player}\n * @private\n */\n _player: Player;\n /**\n * The event manager of the class.\n * @member\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * Holds the current state of the player.\n * @member\n * @type {State}\n * @private\n */\n _curState: State;\n /**\n * Holds the previous state of the player.\n * @member\n * @type {State | null}\n * @private\n */\n _prevState: State | null;\n /**\n * Holds the state history of the player.\n * @member\n * @type {Array<State>}\n * @private\n */\n _history: Array<State>;\n /**\n * The possible transitions from one state to another.\n * @type {Array<Transition>}\n * @private\n */\n _transitions: Transition = {\n [PlayerStates.IDLE]: {\n [Html5Events.LOAD_START]: () => {\n this._updateState(PlayerStates.LOADING);\n this._dispatchEvent();\n },\n [Html5Events.PLAY]: () => {\n this._updateState(PlayerStates.BUFFERING);\n this._dispatchEvent();\n }\n },\n [PlayerStates.LOADING]: {\n [Html5Events.LOADED_METADATA]: () => {\n if (this._player.config.autoPlay) {\n this._updateState(PlayerStates.PLAYING);\n } else {\n this._updateState(PlayerStates.PAUSED);\n }\n this._dispatchEvent();\n },\n [Html5Events.ERROR]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n }\n },\n [PlayerStates.PAUSED]: {\n [Html5Events.PLAY]: () => {\n this._updateState(PlayerStates.PLAYING);\n this._dispatchEvent();\n },\n [Html5Events.PLAYING]: () => {\n this._updateState(PlayerStates.PLAYING);\n this._dispatchEvent();\n },\n [Html5Events.ENDED]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n }\n },\n [PlayerStates.PLAYING]: {\n [Html5Events.PAUSE]: () => {\n this._updateState(PlayerStates.PAUSED);\n this._dispatchEvent();\n },\n [Html5Events.WAITING]: () => {\n this._updateState(PlayerStates.BUFFERING);\n this._dispatchEvent();\n },\n [Html5Events.ENDED]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n },\n [Html5Events.ERROR]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n }\n },\n [PlayerStates.BUFFERING]: {\n [Html5Events.PLAYING]: () => {\n this._updateState(PlayerStates.PLAYING);\n this._dispatchEvent();\n },\n [Html5Events.PAUSE]: () => {\n this._updateState(PlayerStates.PAUSED);\n this._dispatchEvent();\n }\n }\n };\n\n /**\n * @constructor\n * @param {Player} player - Reference to the player.\n */\n constructor(player: Player) {\n this._player = player;\n this._logger = LoggerFactory.getLogger(\"StateManager\");\n this._eventManager = new EventManager();\n this._history = [];\n this._prevState = null;\n this._curState = new State(PlayerStates.IDLE);\n this._attachListeners();\n }\n\n /**\n * Register to all necessary events which impacts on the player state.\n * @private\n * @returns {void}\n */\n _attachListeners(): void {\n this._eventManager.listen(this._player, Html5Events.ERROR, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.ENDED, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.PLAY, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.LOAD_START, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.PLAYING, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.LOADED_METADATA, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.PAUSE, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.WAITING, this._doTransition.bind(this));\n }\n\n /**\n * Performs a state transition depends on the event which occurs in the player system.\n * @param {FakeEvent} event - The event occurs in the player system.\n * @private\n * @returns {void}\n */\n _doTransition(event: FakeEvent): void {\n this._logger.debug('Do transition request', event);\n let transition = this._transitions[this._curState.type];\n if (typeof transition[event.type] === 'function') {\n transition[event.type]();\n }\n }\n\n /**\n * Updates the player's state.\n * @param {string} type - The type of the new state.\n * @private\n * @returns {void}\n */\n _updateState(type: string): void {\n if (this._curState.type !== type) {\n this._curState.duration = Date.now() / 1000;\n this._history.push(this._curState);\n this._prevState = this._curState;\n this._curState = new State(type);\n this._logger.debug(`Switch player state: from ${this._prevState.type} to ${this._curState.type}`)\n }\n }\n\n /**\n * Fires the playerStateChanged event after state has been changed.\n * @private\n * @returns {void}\n */\n _dispatchEvent(): void {\n let event = new FakeEvent(CustomEvents.PLAYER_STATE_CHANGED, {\n 'oldState': this._prevState,\n 'newState': this._curState\n });\n this._player.dispatchEvent(event);\n }\n\n /**\n * Destroys the state manager.\n * @public\n * @returns {void}\n */\n destroy(): void {\n this._history = [];\n this._eventManager.destroy();\n }\n\n /**\n * Getter to the current state of the player.\n * @public\n * @returns {State} - The current state object\n */\n get currentState(): State {\n return this._curState;\n }\n\n /**\n * Getter to the previous state of the player.\n * @public\n * @returns {State|null} - The previous state object, or null if such doesn't exists\n */\n get previousState(): State | null {\n return this._prevState;\n }\n\n /**\n * Getter to the state history of the player.\n * @public\n * @returns {Array.<State>} - The full states history objects\n */\n get history(): Array<State> {\n return this._history;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./state/state-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/state/state-manager.js","//@flow\n\n/**\n * This class describes a player state.\n * @classdesc\n */\nexport default class State {\n /**\n * The type of the state.\n * Can be one of those describes in states.js\n * @member\n * @type {string}\n * @public\n */\n type: string;\n /**\n * The duration that the player was in this state.\n * @member\n * @type {number}\n * @private\n */\n _duration: number;\n /**\n * The timestamp that this state started.\n * @member\n * @type {number}\n * @private\n */\n _timestamp: number;\n\n /**\n * @constructor\n * @param {string} type - The type of the state.\n */\n constructor(type: string) {\n this.type = type;\n this._duration = 0;\n this._timestamp = Date.now() / 1000;\n }\n\n /**\n * Getter for the duration of the state.\n * @returns {number} - The duration of the state\n */\n get duration(): number {\n return this._duration;\n }\n\n /**\n * Setter for the duration of the state.\n * @param {number} endTime - The timestamp of the next state.\n */\n set duration(endTime: number): void {\n this._duration = endTime - this._timestamp;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./state/state.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/state/state.js","//@flow\nconst TRACK_TYPES: {[track: string]: string} = {\n VIDEO: \"video\",\n AUDIO: \"audio\",\n TEXT: \"text\"\n};\n\nexport default TRACK_TYPES;\n\n\n\n// WEBPACK FOOTER //\n// ./track/track-types.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/track-types.js","/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (typeof define === 'function' && define.amd) {\r\n\t\tdefine(Logger);\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/js-logger/src/logger.js\n// module id = 8\n// module chunks = 0 1\n\n\n// WEBPACK FOOTER //\n// webpack:///~/js-logger/src/logger.js","// @flow\n\n// Import core\nimport * as Playkit from 'playkit-js';\n\n// Import OVP and OTT providers\nimport OvpProvider from 'playkit-js-providers/dist/ovpProvider';\n\n// Import UI\nimport PlaykitUI from 'playkit-js-ui';\nimport '../node_modules/playkit-js-ui/src/styles/style.css';\n\n// Import media source adapters\nimport 'playkit-js-hls';\nimport 'playkit-js-dash';\n\n// TODO: Import plugins\n\nexport {Playkit, OvpProvider, PlaykitUI};\n\n\n\n\n// WEBPACK FOOTER //\n// ./index.js","(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[\"PlaykitJsProviders\"] = factory();\n\telse\n\t\troot[\"PlaykitJsProviders\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 24);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap c25ced737c8594c7041b\n\n\n// WEBPACK FOOTER //\n// webpack:/providers/webpack/bootstrap c25ced737c8594c7041b","//@flow\n\n/**\n * Request builder\n * @classdesc\n */\nexport default class RequestBuilder {\n\n /**\n * @member - Service name\n * @type {string}\n */\n service: string;\n /**\n * @member - Service action\n * @type {string}\n */\n action: string;\n /**\n * @member - Service params\n * @type {any}\n */\n params: any;\n /**\n * @member - Service headers\n * @type {Map<string, string>}\n */\n headers: Map<string, string>;\n /**\n * @member - Service base url\n * @type {Map<string, string>}\n */\n baseUrl: string;\n /**\n * @member - Service method (POST,GET,DELETE etc..)\n * @type {string}\n */\n method: string;\n /**\n * @member - Service tag\n * @type {string}\n */\n tag: string;\n\n /**\n * @constructor\n * @param {Map<string, string>} headers The request headers\n */\n constructor(headers: Map<string, string> = new Map()) {\n this.headers = headers;\n this.headers.set(\"Content-Type\", \"application/json\");\n }\n\n /**\n * Builds restful service URL\n * @function getUrl\n * @returns {string} The service URL\n */\n getUrl(): string {\n if (!this.baseUrl) {\n throw new Error(\"baseUrl is mandatory for request builder\");\n }\n let url = this.baseUrl + '/service/' + this.service + (this.action ? '/action/' + this.action : '');\n return url;\n }\n\n /**\n * Executes service\n * @function doHttpRequest\n * @returns {Promise.<any>} Service response as promise\n */\n doHttpRequest(): Promise<any> {\n let request = new XMLHttpRequest();\n return new Promise((resolve, reject) => {\n request.onreadystatechange = function () {\n if (request.readyState === 4) {\n if (request.status === 200) {\n let jsonResponse = JSON.parse(request.responseText);\n if (jsonResponse && typeof(jsonResponse) === 'object' && jsonResponse.code && jsonResponse.message)\n reject(jsonResponse);\n else\n resolve(jsonResponse);\n } else {\n reject(request.responseText);\n }\n }\n };\n request.open(this.method, this.getUrl());\n this.headers.forEach((value, key) => {\n request.setRequestHeader(key, value);\n });\n request.send(this.params);\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/request-builder.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/request-builder.js","//@flow\n\nconst defaultConfig: Object = {\n beUrl: \"http://www.kaltura.com/api_v3\",\n baseUrl: \"https://cdnapisec.kaltura.com\",\n serviceParams: {\n clientTag: \"playkit-js\",\n apiVersion: '3.3.0',\n format: 1\n }\n};\n\nexport default class Configuration {\n\n static set(clientConfig?: Object) {\n if (clientConfig) {\n Object.assign(defaultConfig, clientConfig);\n }\n }\n\n static get(): Object {\n return defaultConfig;\n }\n}\n\nexport {Configuration};\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/config.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/config.js","//@flow\n\nimport {Enum} from 'enumify';\n\nexport class Scheme extends Enum {\n}\nScheme.initEnum({\n PLAYREADY_CENC: \"drm.PLAYREADY_CENC\",\n WIDEVINE_CENC: \"drm.WIDEVINE_CENC\",\n FAIRPLAY: \"fairplay.FAIRPLAY\",\n PLAYREADY: \"playReady.PLAYREADY\",\n WIDEVINE: \"widevine.WIDEVINE\"\n});\n\n\nexport class KalturaRuleActionType extends Enum {\n}\nKalturaRuleActionType.initEnum({\n DRM_POLICY: \"drm.DRM_POLICY\",\n BLOCK: 1,\n PREVIEW: 2,\n LIMIT_FLAVORS: 3,\n ADD_TO_STORAGE: 4,\n LIMIT_DELIVERY_PROFILES: 5,\n SERVE_FROM_REMOTE_SERVER: 6,\n REQUEST_HOST_REGEX: 7,\n LIMIT_THUMBNAIL_CAPTURE: 8\n});\n\nexport class Status extends Enum {\n}\nStatus.initEnum({\n ERROR: -1,\n QUEUED: 0,\n CONVERTING: 1,\n READY: 2,\n DELETED: 3,\n NOT_APPLICABLE: 4,\n TEMP: 5,\n WAIT_FOR_CONVERT: 6,\n IMPORTING: 7,\n VALIDATING: 8,\n EXPORTING: 9\n});\n\nexport class MetadataObjectType extends Enum {\n}\nMetadataObjectType.initEnum({\n AD_CUE_POINT: \"adCuePointMetadata.AdCuePoint\",\n ANNOTATION: \"annotationMetadata.Annotation\",\n CODE_CUE_POINT: \"codeCuePointMetadata.CodeCuePoint\",\n THUMB_CUE_POINT: \"thumbCuePointMetadata.thumbCuePoint\",\n ENTRY: 1,\n CATEGORY: 2,\n USER: 3,\n PARTNER: 4,\n DYNAMIC_OBJECT: 5\n});\n\nexport class MetadataStatus extends Enum {\n}\nMetadataStatus.initEnum({\n VALID: 1,\n INVALID: 2,\n DELETED: 3\n});\n\n\nexport class EntryStatus extends Enum {\n}\nEntryStatus.initEnum({\n ERROR_IMPORTING: -2,\n ERROR_CONVERTING: -1,\n SCAN_FAILURE: \"virusScan.ScanFailure\",\n IMPORT: 0,\n INFECTED: \"virusScan.Infected\",\n PRECONVERT: 1,\n READY: 2,\n DELETED: 3,\n PENDING: 4,\n MODERATE: 5,\n BLOCKED: 6,\n NO_CONTENT: 7\n});\n\nexport class EntryModerationStatus extends Enum {\n}\nEntryModerationStatus.initEnum({\n PENDING_MODERATION: 1,\n APPROVED: 2,\n REJECTED: 3,\n FLAGGED_FOR_REVIEW: 4,\n MODERATE: 5,\n AUTO_APPROVED: 6\n});\n\nexport class EntryType extends Enum {\n}\nEntryType.initEnum({\n AUTOMATIC: {value: -1},\n EXTERNAL_MEDIA: {value: \"externalMedia.externalMedia\"},\n MEDIA_CLIP: {value: 1},\n MIX: {value: 2},\n PLAYLIST: {value: 5},\n DATA: {value: 6},\n LIVE_STREAM: {value: 7},\n LIVE_CHANNEL: {value: 8},\n DOCUMENT: {value: 10}\n});\n\nexport class MediaType extends Enum {\n}\nMediaType.initEnum({\n VIDEO: {value: 1},\n IMAGE: {value: 2},\n AUDIO: {value: 5},\n LIVE_STREAM_FLASH: {value: 201},\n LIVE_STREAM_WINDOWS_MEDIA: {value: 202},\n LIVE_STREAM_REAL_MEDIA: {value: 203},\n LIVE_STREAM_QUICKTIME: {value: 204}\n});\n\n\nexport class MediaEntryType extends Enum {\n}\nMediaEntryType.initEnum(['Vod', 'Live', 'Image', 'Audio', 'Unknown']);\n\nexport class UIConfType extends Enum {\n}\nUIConfType.initEnum({\n PLAYER: 1,\n CONTRIBUTION_WIZARD: 2,\n SIMPLE_EDITOR: 3,\n ADVANCED_EDITOR: 4,\n PLAYLIST: 5,\n APP_STUDIO: 6,\n KRECORD: 7,\n PLAYER_V3: 8,\n KMC_ACCOUNT: 9,\n KMC_ANALYTICS: 10,\n KMC_CONTENT: 11,\n KMC_DASHBOARD: 12,\n KMC_LOGIN: 13,\n PLAYER_SL: 14,\n CLIENTSIDE_ENCODER: 15,\n KMC_GENERAL: 16,\n KMC_ROLES_AND_PERMISSIONS: 17,\n CLIPPER: 18,\n KSR: 19,\n KUPLOAD: 20,\n WEBCASTING: 21\n});\n\nexport class UIConfCreationMode extends Enum {\n}\nUIConfCreationMode.initEnum({\n WIZARD: 2,\n ADVANCED: 3\n});\n\n\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/enums.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/enums.js","//@flow\nimport MultiRequestBuilder from '../../multi-request-builder'\nimport Configuration from '../config'\n\nconst config = Configuration.get();\nconst SERVICE_NAME: string = \"multirequest\";\n\n/**\n * Base for all ovp services\n * @classdesc\n */\nexport default class OvpService {\n /**\n * Gets a new instance of MultiRequestBuilder with ovp params\n * @function getMultirequest\n * @param {string} ks The ks\n * @param {string} partnerId The partner ID\n * @returns {MultiRequestBuilder} The multi request builder\n * @static\n */\n static getMultirequest(ks: string, partnerId?: number): MultiRequestBuilder {\n let ovpParams = config.serviceParams;\n Object.assign(ovpParams, {ks: ks});\n if (partnerId) {\n Object.assign(ovpParams, {partnerId: partnerId});\n }\n let multiReq = new MultiRequestBuilder();\n multiReq.method = \"POST\";\n multiReq.service = SERVICE_NAME;\n multiReq.baseUrl = config.beUrl;\n multiReq.params = ovpParams;\n return multiReq;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/ovp-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/ovp-service.js","//@flow\n\n/**\n * Base service result\n * @classdesc\n */\nexport default class ServiceResult {\n\n /**\n * @member - Is service returned an error\n * @type {boolean}\n */\n hasError: boolean = false;\n /**\n * @member - The service error\n * @type {ServiceError}\n */\n error: ServiceError;\n /**\n * @member - The service result data\n * @type {Object}\n */\n data: Object;\n\n /**\n * @constructor\n * @param {Object} response - Service response\n */\n constructor(response: Object) {\n if (response.objectType === \"KalturaAPIException\") {\n this.hasError = true;\n this.error = new ServiceError(response.code, response.message);\n }\n else {\n this.data = response;\n }\n }\n}\n\n/**\n * Service error\n * @classdesc\n */\nclass ServiceError {\n /**\n * @member - The error code\n * @type {string}\n */\n code: string;\n /**\n * @member - The error message\n * @type {string}\n */\n message: string;\n\n /**\n * @constructor\n * @param {string} code - The result code\n * @param {string} message - The result message\n */\n constructor(code: string, message: string) {\n this.code = code;\n this.message = message;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/base-service-result.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/base-service-result.js","//@flow\nimport * as JsLogger from 'js-logger';\n\nclass LoggerFactory {\n constructor(options?: Object) {\n JsLogger.useDefaults(options || {});\n }\n\n get(name?: string) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n}\n\nlet Logger = new LoggerFactory({defaultLevel: JsLogger.DEBUG});\nconst LOG_LEVEL: {[level: string]: Object} = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nexport default Logger;\nexport {LOG_LEVEL};\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./util/logger.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/util/logger.js","//@flow\nimport RequestBuilder from './request-builder'\nimport ServiceResult from './base-service-result'\nimport Logger from \"../util/logger\";\n/**\n * @constant\n */\nconst logger = Logger.get(\"OvpProvider\");\n\n/**\n * Multi Request builder\n * @classdesc\n */\nexport default class MultiRequestBuilder extends RequestBuilder {\n\n /**\n * @member - Array of requests\n * @type {Array<RequestBuilder>}\n */\n requests: Array<RequestBuilder> = [];\n\n /**\n * @constructor\n */\n constructor() {\n super();\n }\n\n /**\n * Adds request to requests array\n * @function add\n * @param {RequestBuilder} request The request\n * @returns {MultiRequestBuilder} The multiRequest\n */\n add(request: RequestBuilder): MultiRequestBuilder {\n this.requests.push(request);\n let requestParams = {};\n let serviceDef: Object = {service: request.service, action: request.action};\n Object.assign(requestParams, {[this.requests.length]: Object.assign(serviceDef, request.params)});\n Object.assign(requestParams, this.params);\n this.params = requestParams;\n return this;\n }\n\n /**\n * Executes a multi request\n * @function execute\n * @returns {Promise} The multirequest execution promisie\n */\n execute(): Promise<Object> {\n try {\n this.params = JSON.stringify(this.params);\n }\n catch (err) {\n logger.error(`${err.message}`);\n }\n return new Promise((resolve, reject) => {\n this.doHttpRequest().then(data => {\n resolve(new MultiRequestResult(data));\n },\n err => {\n let errorText: string = `Error on multiRequest execution, error <${err}>.`;\n reject(errorText);\n\n });\n });\n }\n\n}\n\n/**\n * Multi Request result object\n * @classdesc\n */\nexport class MultiRequestResult {\n\n /**\n * @member - Is success\n * @type {boolean}\n */\n success: boolean;\n /**\n * @member - Multi request response data\n * @type {Object}\n */\n results: Array<ServiceResult> = [];\n\n /**\n * @constructor\n * @param {Object} response data\n */\n constructor(response: Object) {\n this.success = true;\n response.forEach((result) => {\n let serviceResult: ServiceResult = new ServiceResult(result);\n this.results.push(serviceResult);\n if (serviceResult.hasError) {\n logger.error(`Service returned an error with error code: ${serviceResult.error.code} and message: ${serviceResult.error.message}.`);\n this.success = false;\n return;\n }\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/multi-request-builder.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/multi-request-builder.js","//@flow\nimport Drm from '../entities/drm'\n\n/**\n * Media source\n * @classdesc\n */\nexport default class MediaSource {\n /**\n * @member - media source ID\n * @type {string}\n */\n id: string;\n /**\n * @member - media source URL\n * @type {string}\n */\n url: string;\n /**\n * @member - media source mimetype\n * @type {string}\n */\n mimetype: string;\n /**\n * @member - media source drm data\n * @type {Array<Drm>}\n */\n drmData: Array<Drm>;\n\n /**\n * @constructor\n */\n constructor(){}\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-source.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-source.js","//@flow\nimport MediaSource from './media-source'\nimport {MediaEntryType} from '../k-provider/enums'\n\n/**\n * Media entry\n * @classdesc\n */\nexport default class MediaEntry {\n\n /**\n * @member - entry ID\n * @type {string}\n */\n id: string;\n /**\n * @member - entry sources\n * @type {Array<MediaSource>}\n */\n sources: Array<MediaSource>;\n /**\n * @member - entry duration\n * @type {number}\n */\n duration: number;\n /**\n * @member - entry type\n * @type {MediaEntryType}\n */\n type: MediaEntryType;\n /**\n * @member - entry metadata\n * @type {Map<string,string>}\n */\n metaData: Map<string,string>;\n\n /**\n * @constructor\n */\n constructor() {\n this.metaData = new Map();\n this.type = MediaEntryType.Unknown;\n }\n\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-entry.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-entry.js","//@flow\n\nimport {Scheme} from '../k-provider/enums';\n\n/**\n * Drm data\n * @classdesc\n */\nexport default class Drm {\n\n /**\n * @member - license URL\n * @type {string}\n */\n licenseUrl: string;\n /**\n * @member - drm scheme\n * @type {Scheme}\n */\n scheme: Scheme;\n\n /**\n * @constructor\n * @param {string} licenseUrl - the license URL\n * @param {Scheme} scheme - the drm scheme\n */\n constructor(licenseUrl: string, scheme: Scheme) {\n this.licenseUrl = licenseUrl;\n this.scheme = scheme;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./entities/drm.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/drm.js","//@flow\nimport {Status} from '../../enums'\n\n/**\n * Ovp BE FlavorAsset\n * @classdesc\n */\nexport default class KalturaFlavorAsset {\n /**\n * @member - The ID of the Flavor Asset\n * @type {string}\n */\n id: string;\n /**\n * @member -The Flavor Params used to create this Flavor Asset\n * @type {string}\n */\n flavorParamsId: string;\n /**\n * @member -The file extension\n * @type {string}\n */\n fileExt: string;\n /**\n * @member - The overall bitrate (in KBits) of the Flavor Asset\n * @type {string}\n */\n bitrate: number;\n /**\n * @member - The width of the Flavor Asset\n * @type {number}\n */\n width: number;\n /**\n * @member - The height of the Flavor Asset\n * @type {number}\n */\n height: number;\n /**\n * @member - The frame rate (in FPS) of the Flavor Asset\n * @type {number}\n */\n frameRate: number;\n /**\n * @member - True if this Flavor Asset is the original source\n * @type {number}\n */\n isOriginal: boolean;\n /**\n * @member - True if this Flavor Asset is playable in KDP\n * @type {boolean}\n */\n isWeb: boolean;\n /**\n * @member - The container format\n * @type {boolean}\n */\n containerFormat: string;\n /**\n *@member - The video codec\n * @type {boolean}\n */\n videoCodecId: string;\n /**\n * @member - The status of the Flavor Asset\n * @type {string}\n */\n status: Status;\n /**\n * @member - The language of the flavor asset\n * @type {Status}\n */\n language: string;\n /**\n * @member - The label of the flavor asset\n * @type {string}\n */\n label: string;\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n constructor(data: any) {\n this.id = data.id;\n this.flavorParamsId = data.flavorParamsId;\n this.fileExt = data.fileExt;\n this.bitrate = data.bitrate;\n this.width = data.width;\n this.height = data.height;\n this.id = data.id;\n this.frameRate = data.frameRate;\n this.isOriginal = data.isOriginal;\n this.isWeb = data.isWeb;\n this.containerFormat = data.containerFormat;\n this.videoCodecId = data.videoCodecId;\n this.status = data.status;\n this.language = data.language;\n this.label = data.label;\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-flavor-asset.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-flavor-asset.js","//@flow\nimport {EntryType, MediaType} from '../../enums'\n\n/**\n * Ovp BE MediaEntry\n * @classdesc\n */\nexport default class KalturaMediaEntry {\n /**\n * @member - The entry id\n * @type {string}\n */\n id: string;\n /**\n * @member - Entry name (Min 1 chars)\n * @type {string}\n */\n name: string;\n /**\n * @member - The URL used for playback. This is not the download URL.\n * @type {string}\n */\n dataUrl: string;\n /**\n * @member - Comma separated flavor params ids that exists for this media entry\n * @type {string}\n */\n flavorParamsIds: string;\n /**\n * @member - The entry duration\n * @type {number}\n */\n duration: number;\n /**\n * @member - The type of the entry, this is auto filled by the derived entry object\n * @type {EntryType}\n */\n type: EntryType;\n /**\n * @member - The type of the entry, this is auto filled by the derived entry object (Image, Audio etc.)\n * @type {MediaType}\n */\n entryType: MediaType;\n\n /**\n * @constructor\n * @param {Object} entry The json response\n */\n constructor(entry: Object) {\n this.id = entry.id;\n this.name = entry.name;\n this.dataUrl = entry.dataUrl;\n this.type = entry.type;\n this.entryType = entry.mediaType;\n this.flavorParamsIds = entry.flavorParamsIds;\n this.duration = entry.duration;\n }\n}\n\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-media-entry.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-media-entry.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport KalturaMetadata from './kaltura-metadata'\n\n/**\n * Ovp BE Metadata list response\n * @classdesc\n */\nexport default class KalturaMetadataListResponse extends ServiceResult {\n totalCount: number;\n /**\n * @member -The mata data array\n * @type {Array<KalturaMetadata>}\n */\n metas: Array<KalturaMetadata>;\n\n /**\n * @constructor\n * @param {Object} responseObj The response\n */\n constructor(responseObj: Object) {\n super(responseObj);\n if (!this.hasError) {\n this.totalCount = responseObj.totalCount;\n if (this.totalCount > 0) {\n this.metas = [];\n responseObj.objects.map(meta => this.metas.push(new KalturaMetadata(meta)));\n }\n\n }\n }\n}\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-metadata-list-response.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-metadata-list-response.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport KalturaAccessControlMessage from './kaltura-access-control-message'\nimport KalturaPlaybackSource from './kaltura-playback-source'\nimport KalturaRuleAction from './kaltura-rule-action'\nimport KalturaFlavorAsset from './kaltura-flavor-asset'\n\n/**\n * Ovp BE playback context response\n * @classdesc\n */\nexport default class KalturaPlaybackContext extends ServiceResult {\n /**\n * @member - The playback sources\n * @type {Array<KalturaPlaybackSource>}\n */\n sources: Array<KalturaPlaybackSource> = [];\n /**\n * @member - Array of actions as received from the rules that invalidated\n * @type {Array<KalturaRuleAction>}\n */\n actions: Array<KalturaRuleAction> = [];\n /**\n * @member - Array of actions as received from the rules that invalidated\n * @type {Array<KalturaAccessControlMessage>}\n */\n messages: Array<KalturaAccessControlMessage> = [];\n /**\n * @member - The flavor assets\n * @type {Array<KalturaFlavorAsset>}\n */\n flavorAssets: Array<KalturaFlavorAsset> = [];\n\n /**\n * @constructor\n * @param {Object} response The response\n */\n constructor(response: Object) {\n super(response);\n if (!this.hasError) {\n\n let messages = response.messages;\n if (messages) {\n messages.map(message => this.messages.push(new KalturaAccessControlMessage(message)));\n }\n\n let actions = response.actions;\n if (actions) {\n actions.map(action => this.actions.push(new KalturaRuleAction(action)));\n }\n\n let sources = response.sources;\n if (sources) {\n sources.map(source => this.sources.push(new KalturaPlaybackSource(source)));\n }\n\n let flavorAssets = response.flavorAssets;\n if (flavorAssets) {\n flavorAssets.map(flavor => this.flavorAssets.push(new KalturaFlavorAsset(flavor)));\n }\n }\n\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-playback-context.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-playback-context.js","//@flow\nimport KalturaDrmPlaybackPluginData from './kaltura-drm-playback-plugin-data'\n\n/**\n * Ovp BE playback source\n * @classdesc\n */\nexport default class KalturaPlaybackSource {\n /**\n * @member - source format according to delivery profile streamer type (applehttp, mpegdash etc.)\n * @type {string}\n */\n format: string;\n /**\n * @member - delivery profile Id\n * @type {string}\n */\n deliveryProfileId: string;\n /**\n * @member - The source URL\n * @type {string}\n */\n url: string;\n /**\n * @member - comma separated string according to deliveryProfile media protocols ('http,https' etc.)\n * @type {string}\n */\n protocols: string;\n /**\n * @member - comma separated string of flavor ids\n * @type {string}\n */\n flavorIds: string;\n /**\n * @member - drm data object containing relevant license url ,scheme name and certificate\n * @type {Array<KalturaDrmPlaybackPluginData>}\n */\n drm: Array<KalturaDrmPlaybackPluginData> = [];\n\n /**\n * @constructor\n * @param {Object} source The response\n */\n constructor(source: Object) {\n this.format = source.format;\n this.deliveryProfileId = source.deliveryProfileId;\n this.url = source.url;\n this.protocols = source.protocols;\n this.flavorIds = source.flavorIds;\n\n if (source.drm) {\n source.drm.map(drm => this.drm.push(new KalturaDrmPlaybackPluginData(drm)));\n }\n\n\n }\n\n /**\n * Checks if source has DRM data\n * @function hasDrmData\n * @returns {boolean} Is source has DRM\n */\n hasDrmData(): boolean {\n return this.drm && this.drm.length > 0;\n }\n\n /**\n * Checks if source has flavor IDs\n * @function hasFlavorIds\n * @returns {boolean} Is source ha flavor IDs\n */\n hasFlavorIds(): boolean {\n return !!this.flavorIds && this.flavorIds.length > 0;\n }\n\n /**\n * Returns source desired protocol if supported\n * @param {string} protocol - the desired protocol for the source (base play url protocol)\n * @returns {string} - protocol if protocol is in the protocols list - if not empty string returned\n */\n getProtocol(protocol: string): string {\n let returnValue: string = \"\";\n if (this.protocols && this.protocols.length > 0) {\n let protocolsArr: Array<string> = this.protocols.split(\",\");\n protocolsArr.forEach((p) => {\n if (p == protocol) {\n returnValue = p;\n }\n });\n }\n else if (protocol == \"http\") {\n return protocol;\n }\n return returnValue;\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-playback-source.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-playback-source.js","'use strict';\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\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.copyProperties = copyProperties;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar INITIALIZED = Symbol();\n\n/**\n * This is an abstract class that is not intended to be\n * used directly. Extend it to turn your class into an enum\n * (initialization is performed via `MyClass.initEnum()`).\n */\n\nvar Enum = exports.Enum = function () {\n /**\n * `initEnum()` closes the class. Then calling this constructor\n * throws an exception.\n * \n * If your subclass has a constructor then you can control\n * what properties are added to `this` via the argument you\n * pass to `super()`. No arguments are fine, too.\n */\n\n function Enum() {\n var instanceProperties = arguments.length <= 0 || arguments[0] === undefined ? undefined : arguments[0];\n\n _classCallCheck(this, Enum);\n\n // new.target would be better than this.constructor,\n // but isn’t supported by Babel\n if ({}.hasOwnProperty.call(this.constructor, INITIALIZED)) {\n throw new Error('Enum classes can’t be instantiated');\n }\n if ((typeof instanceProperties === 'undefined' ? 'undefined' : _typeof(instanceProperties)) === 'object' && instanceProperties !== null) {\n copyProperties(this, instanceProperties);\n }\n }\n /**\n * Set up the enum, close the class.\n * \n * @param arg Either an object whose properties provide the names\n * and values (which must be mutable objects) of the enum constants.\n * Or an Array whose elements are used as the names of the enum constants\n * The values are create by instantiating the current class.\n */\n\n _createClass(Enum, [{\n key: 'toString',\n\n /**\n * Default `toString()` method for enum constant.\n */\n value: function toString() {\n return this.constructor.name + '.' + this.name;\n }\n }], [{\n key: 'initEnum',\n value: function initEnum(arg) {\n Object.defineProperty(this, 'enumValues', {\n value: [],\n configurable: false,\n writable: false,\n enumerable: true\n });\n if (Array.isArray(arg)) {\n this._enumValuesFromArray(arg);\n } else {\n this._enumValuesFromObject(arg);\n }\n Object.freeze(this.enumValues);\n this[INITIALIZED] = true;\n return this;\n }\n }, {\n key: '_enumValuesFromArray',\n value: function _enumValuesFromArray(arr) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = arr[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n\n this._pushEnumValue(new this(), key);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n }, {\n key: '_enumValuesFromObject',\n value: function _enumValuesFromObject(obj) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = Object.keys(obj)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n\n var value = new this(obj[key]);\n this._pushEnumValue(value, key);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n }, {\n key: '_pushEnumValue',\n value: function _pushEnumValue(enumValue, name) {\n enumValue.name = name;\n enumValue.ordinal = this.enumValues.length;\n Object.defineProperty(this, name, {\n value: enumValue,\n configurable: false,\n writable: false,\n enumerable: true\n });\n this.enumValues.push(enumValue);\n }\n\n /**\n * Given the name of an enum constant, return its value.\n */\n\n }, {\n key: 'enumValueOf',\n value: function enumValueOf(name) {\n return this.enumValues.find(function (x) {\n return x.name === name;\n });\n }\n\n /**\n * Make enum classes iterable\n */\n\n }, {\n key: Symbol.iterator,\n value: function value() {\n return this.enumValues[Symbol.iterator]();\n }\n }]);\n\n return Enum;\n}();\n\nfunction copyProperties(target, source) {\n // Ideally, we’d use Reflect.ownKeys() here,\n // but I don’t want to depend on a polyfill\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = Object.getOwnPropertyNames(source)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var key = _step3.value;\n\n var desc = Object.getOwnPropertyDescriptor(source, key);\n Object.defineProperty(target, key, desc);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return target;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/enumify/lib/enumify.js\n// module id = 16\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///~/enumify/lib/enumify.js","//@flow\nimport OvpService from '../services/ovp-service'\nimport MultiRequestBuilder from '../../multi-request-builder'\nimport {MultiRequestResult} from '../../multi-request-builder'\n\n/**\n * Data loaders manager\n * @classdesc\n */\nexport default class DataLoaderManager {\n /**\n * @member - Lodaers response map index\n * @type {Map<string,Array<number>>}\n * @private\n * @static\n */\n static _loadersResponseMap: Map<string, Array<number>> = new Map();\n /**\n * @member - Loaders multi request\n * @type {MultiRequestBuilder}\n * @private\n */\n _multiRequest: MultiRequestBuilder;\n /**\n * @member - Loaders multi response\n * @type {MultiRequestResult}\n * @private\n */\n _multiResponse: MultiRequestResult;\n /**\n * @member - Loaders to execute\n * @type {Map<string,Function>}\n * @private\n */\n _loaders: Map<string, ILoader> = new Map();\n\n /**\n * @constructor\n * @param {string} partnerID Then partner ID\n * @param {string} ks The ks\n */\n constructor(partnerID: number, ks: string = \"\") {\n this._multiRequest = OvpService.getMultirequest(ks, partnerID);\n }\n\n /**\n * Add loader too execution loaders map\n * @function\n * @param {Function} loader Loader to add\n * @param {Object} params Loader params\n * @returns {void}\n */\n add(loader: typeof ILoader, params: Object): void {\n let execution_loader = new loader(params);\n if (execution_loader.isValid()) {\n this._loaders.set(loader.name, execution_loader);\n //Get the start index from the multiReqeust before adding current execution_loader requests\n let startIndex = this._multiRequest.requests.length;\n //Get the requests\n let requests = execution_loader.requests;\n //Add requests to muktiRequest queue\n requests.forEach((request) => {\n this._multiRequest.add(request);\n });\n //Create range array of current execution_loader requests\n let executionLoaderResponseMap = Array.from(new Array(requests.length), (val, index) => index + startIndex);\n //Add to map\n DataLoaderManager._loadersResponseMap.set(loader.name, executionLoaderResponseMap);\n }\n }\n\n /**\n * Get data from all loaders using multi request\n * @function\n * @returns {Promise} Promise\n */\n fetchData(): Promise<any> {\n return new Promise((resolve, reject) => {\n this._multiRequest.execute()\n .then(response => {\n this._multiResponse = response;\n if (!response.success) {\n reject(response);\n }\n else {\n let preparedData: Object = this.prepareData(response);\n if (preparedData.success) {\n resolve(this._loaders);\n }\n else {\n reject({success: false, data: preparedData.error});\n }\n }\n },\n err => {\n reject(err);\n });\n });\n }\n\n prepareData(response: MultiRequestResult): Object {\n this._loaders.forEach(function (loader, name) {\n let loaderDataIndexes = DataLoaderManager._loadersResponseMap.get(name);\n try {\n if (loaderDataIndexes != null) {\n loader.response = (response.results.slice(loaderDataIndexes[0], loaderDataIndexes[loaderDataIndexes.length - 1] + 1));\n }\n }\n catch (err) {\n return {success: false, error: err};\n }\n });\n return {success: true, data: this._loaders};\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/data-loader-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/data-loader-manager.js","//@flow\n\nimport RequestBuilder from '../../request-builder'\nimport BaseEntryService from '../services/base-entry-service'\nimport MetaDataService from '../services/meta-data-service'\nimport Configuration from '../config'\nimport KalturaPlaybackContext from '../response-types/kaltura-playback-context'\nimport KalturaMetadataListResponse from '../response-types/kaltura-metadata-list-response'\nimport KalturaBaseEntryListResponse from '../response-types/kaltura-base-entry-list-response'\n\nconst config = Configuration.get();\n\n/**\n * Media entry loader\n * @classdesc\n */\nexport default class MediaEntryLoader implements ILoader {\n static get name(): string {\n return \"media\";\n }\n\n _entryId: string;\n _requests: Array<RequestBuilder>;\n _response: any = {};\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n constructor(params: Object) {\n this.requests = this.buildRequests(params);\n this._entryId = params.entryId;\n }\n\n set requests(requests: Array<RequestBuilder>) {\n this._requests = requests;\n }\n\n get requests(): Array<RequestBuilder> {\n return this._requests;\n }\n\n set response(response: any) {\n let mediaEntryResponse: KalturaBaseEntryListResponse = new KalturaBaseEntryListResponse(response[0].data);\n this._response.entry = mediaEntryResponse.entries[0];\n this._response.playBackContextResult = new KalturaPlaybackContext(response[1].data);\n this._response.metadataListResult = new KalturaMetadataListResponse(response[2].data);\n }\n\n get response(): any {\n return this._response;\n }\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n buildRequests(params: Object): Array<RequestBuilder> {\n let requests: Array<RequestBuilder> = [];\n requests.push(BaseEntryService.list(config.beUrl, params.ks, params.entryId));\n requests.push(BaseEntryService.getPlaybackContext(config.beUrl, params.ks, params.entryId));\n requests.push(MetaDataService.list(config.beUrl, params.ks, params.entryId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n isValid(): boolean {\n return !!this._entryId;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/media-entry-loader.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/media-entry-loader.js","//@flow\nimport SessionService from '../services/session-service'\nimport Configuration from '../config'\nimport RequestBuilder from '../../request-builder'\n\nconst config = Configuration.get();\n/**\n * Media entry loader\n * @classdesc\n */\nexport default class SessionLoader implements ILoader {\n static get name(): string {\n return \"session\";\n }\n\n /**\n * @member - partner ID\n * @type {number}\n * @private\n */\n _partnerId: number;\n _requests: Array<RequestBuilder>;\n _response: any = {};\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n constructor(params: Object) {\n this.requests = this.buildRequests(params);\n this._partnerId = params.partnerId;\n }\n\n set requests(requests: Array<RequestBuilder>) {\n this._requests = requests;\n }\n\n get requests(): Array<RequestBuilder> {\n return this._requests;\n }\n\n set response(response: any) {\n this._response.ks = response[0].data.ks;\n }\n\n get response(): any {\n return this._response.ks;\n }\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n buildRequests(params: Object): Array<RequestBuilder> {\n let requests: Array<RequestBuilder> = [];\n requests.push(SessionService.anonymousSession(config.beUrl, params.partnerId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n isValid(): boolean {\n return !!this._partnerId;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/session-loader.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/session-loader.js","//@flow\nimport UiConfService from '../services/ui-conf-service'\nimport KalturaUiConfResponse from '../response-types/kalturaUIConfResponse'\nimport Configuration from '../config'\nimport RequestBuilder from '../../request-builder'\n\nconst config = Configuration.get();\n\nexport default class UiConfigLoader implements ILoader {\n static get name(): string {\n return \"uiConf\";\n }\n\n /**\n * @member - uiConf ID\n * @type {number}\n * @private\n */\n _uiConfId: number;\n _requests: Array<RequestBuilder>;\n _response: any = {};\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n constructor(params: Object) {\n this.requests = this.buildRequests(params);\n this._uiConfId = params.uiConfId;\n }\n\n set requests(requests: Array<RequestBuilder>) {\n this._requests = requests;\n }\n\n get requests(): Array<RequestBuilder> {\n return this._requests;\n }\n\n set response(response: any) {\n this._response.uiConf = new KalturaUiConfResponse(response[0].data);\n }\n\n get response(): any {\n if (this._response != null && this._response.uiConf != null && this._response.uiConf.config != null)\n try {\n return JSON.parse(this._response.uiConf.config).plugins;\n }\n catch (err) {\n return null;\n }\n else\n return null;\n }\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n buildRequests(params: Object): Array<RequestBuilder> {\n let requests: Array<RequestBuilder> = [];\n requests.push(UiConfService.get(config.beUrl, params.ks, params.uiConfId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n isValid(): boolean {\n return !!this._uiConfId;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/ui-config-loader.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/ui-config-loader.js","//@flow\nimport KalturaMediaEntry from './response-types/kaltura-media-entry'\nimport KalturaPlaybackContext from './response-types/kaltura-playback-context'\nimport KalturaPlaybackSource from './response-types/kaltura-playback-source'\nimport KalturaFlavorAsset from './response-types/kaltura-flavor-asset'\nimport KalturaMetadataListResponse from './response-types/kaltura-metadata-list-response'\nimport PlaySourceUrlBuilder from \"./play-source-url-builder\"\nimport XmlParser from '../xml-parser'\nimport {MediaEntryType, EntryType, MediaType} from '../enums'\nimport Logger from '../../util/logger'\nimport Configuration from './config'\nimport {MediaFormat} from '../../entities/media-format'\nimport MediaEntry from '../../entities/media-entry'\nimport Drm from '../../entities/drm'\nimport MediaSource from '../../entities/media-source'\n\nconst config = Configuration.get();\n/**\n * @constant\n */\nconst logger = Logger.get(\"OvpProvider\");\n\n/**\n * @constant\n * @type {Map<string, MediaFormat>}\n */\nconst SUPPORTED_FORMATS: Map<string, MediaFormat> = new Map([\n [\"mpegdash\", MediaFormat.dash],\n [\"applehttp\", MediaFormat.hls],\n [\"url\", MediaFormat.mp4]\n]);\n\n/**\n * Ovp provider parser\n * @classdesc\n */\nexport default class ProviderParser {\n\n /**\n * Returns parsed media entry by given OVP response objects\n * @function getMediaEntry\n * @param {string} ks The ks\n * @param {number} partnerID The partner ID\n * @param {number} uiConfId The uiConf ID\n * @param {any} mediaEntryResponse The media entry response\n * @returns {MediaEntry} The media entry\n * @static\n */\n static getMediaEntry(ks: string, partnerID: number, uiConfId: number, mediaEntryResponse: any): MediaEntry {\n let mediaEntry: MediaEntry = new MediaEntry();\n let entry = mediaEntryResponse.entry;\n let playbackContext = mediaEntryResponse.playBackContextResult;\n let metadataList = mediaEntryResponse.metadataListResult;\n let kalturaSources: Array<KalturaPlaybackSource> = playbackContext.sources;\n let sources: Array<MediaSource> = [];\n\n if (kalturaSources && kalturaSources.length > 0) {\n kalturaSources.forEach((source) => {\n sources.push(this.parseSource(source, ks, partnerID, uiConfId, entry, playbackContext));\n });\n }\n else {\n sources = [];\n }\n\n mediaEntry.sources = sources;\n\n let metadata: Map<string,string> = this.parseMetaData(metadataList);\n mediaEntry.metaData = metadata;\n mediaEntry.id = entry.id;\n mediaEntry.duration = entry.duration;\n\n let type: MediaEntryType = MediaEntryType.Unknown;\n\n switch (entry.entryType) {\n case MediaType.IMAGE.value:\n type = MediaEntryType.Image;\n break;\n case MediaType.AUDIO.value:\n type = MediaEntryType.Audio;\n break;\n default:\n switch (entry.type) {\n case EntryType.MEDIA_CLIP.value:\n type = MediaEntryType.Vod;\n break;\n case EntryType.LIVE_STREAM.value:\n case EntryType.LIVE_CHANNEL.value:\n type = MediaEntryType.Live;\n break;\n default:\n type = MediaEntryType.Unknown;\n }\n }\n mediaEntry.type = type;\n\n return mediaEntry;\n }\n\n /**\n *\n * @param {KalturaPlaybackSource} source The source\n * @param {string} ks The ks\n * @param {number} partnerID The partner ID\n * @param {number} uiConfId The uiConf ID\n * @param {KalturaMediaEntry} entry The entry\n * @param {KalturaPlaybackContext} playbackContext The playback context\n * @returns {MediaSource} The parsed media source\n * @static\n */\n static parseSource(source: KalturaPlaybackSource, ks: string, partnerID: number, uiConfId: number, entry: KalturaMediaEntry, playbackContext: KalturaPlaybackContext): MediaSource {\n let playUrl: string = \"\";\n let mediaFormat = SUPPORTED_FORMATS.get(source.format);\n let mediaSource: MediaSource = new MediaSource();\n // in case playbackSource doesn't have flavors we don't need to build the url and we'll use the provided one.\n if (source.hasFlavorIds()) {\n let splittedUrl: Array<string> = config.baseUrl.split(\"/\");\n let baseProtocol: string;\n if (splittedUrl && splittedUrl.length > 0) {\n baseProtocol = splittedUrl[0].substring(0, splittedUrl[0].length - 1);\n }\n else {\n baseProtocol = \"http\";\n }\n\n let extension: string = \"\";\n if (!mediaFormat) {\n let flavorIdsArr = source.flavorIds.split(\",\");\n let flavors: Array<KalturaFlavorAsset> = playbackContext.flavorAssets.filter(flavor => flavorIdsArr.indexOf(flavor.id) != -1);\n if (flavors && flavors.length > 0) {\n extension = flavors[0].fileExt;\n }\n }\n else {\n extension = mediaFormat.pathExt;\n mediaSource.mimetype = mediaFormat.mimeType;\n }\n\n playUrl = PlaySourceUrlBuilder.build({\n entryId: entry.id,\n flavorIds: source.flavorIds,\n format: source.format,\n ks: ks,\n partnerId: partnerID,\n uiConfId: uiConfId,\n extension: extension,\n protocol: source.getProtocol(baseProtocol)\n });\n\n }\n else {\n playUrl = source.url;\n }\n\n if (playUrl == \"\") {\n logger.error(`failed to create play url from source, discarding source: (${entry.id}_${source.deliveryProfileId}), ${source.format}.`);\n return mediaSource;\n }\n\n\n mediaSource.url = playUrl;\n mediaSource.id = entry.id + \"_\" + source.deliveryProfileId + \",\" + source.format;\n if (source.hasDrmData()) {\n let drmParams: Array<Drm> = [];\n source.drm.forEach((drm) => {\n drmParams.push(new Drm(drm.licenseURL, drm.scheme));\n });\n mediaSource.drmData = drmParams;\n }\n return mediaSource;\n }\n\n /**\n * Ovp metadata parser\n * @function parseMetaData\n * @param {KalturaMetadataListResponse} metadataList The metadata list\n * @returns {Map<string,string>} Parsed metadata\n * @static\n */\n static parseMetaData(metadataList: KalturaMetadataListResponse): Map<string,string> {\n let metadata: Object = {};\n if (metadataList && metadataList.metas && metadataList.metas.length > 0) {\n metadataList.metas.forEach((meta) => {\n let metaXml: Object;\n let domParser: DOMParser = new DOMParser();\n meta.xml = meta.xml.replace(/\\r?\\n|\\r/g, \"\");\n meta.xml = meta.xml.replace(/>\\s*/g, '>');\n meta.xml = meta.xml.replace(/>\\s*/g, '>');\n metaXml = domParser.parseFromString(meta.xml, 'text/xml');\n let metasObj: Object = XmlParser.xmlToJson(metaXml);\n let metaKeys = Object.keys(metasObj.metadata);\n metaKeys.forEach((key) => {\n metadata[key] = metasObj.metadata[key][\"#text\"];\n })\n\n })\n }\n return metadata;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/provider-parser.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/provider-parser.js","//@flow\nimport {Enum} from 'enumify';\n\nexport class MediaFormat extends Enum {\n}\nMediaFormat.initEnum({\n dash: {\n get mimeType() {\n return \"application/dash+xml\";\n },\n get pathExt() {\n return \"mpd\";\n }\n },\n hls: {\n get mimeType() {\n return \"application/x-mpegURL\";\n },\n get pathExt() {\n return \"m3u8\";\n }\n },\n wvm: {\n get mimeType() {\n return \"video/wvm\";\n },\n get pathExt() {\n return \"wvm\";\n }\n },\n mp4: {\n get mimeType() {\n return \"video/mp4\";\n },\n get pathExt() {\n return \"mp4\";\n }\n },\n mp3: {\n get mimeType() {\n return \"audio/mpeg\";\n },\n get pathExt() {\n return \"mp3\";\n }\n }\n});\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-format.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-format.js","//@flow\nimport Logger from '../../util/logger'\nimport ProviderParser from './provider-parser'\nimport DataLoaderManager from './loaders/data-loader-manager'\nimport MediaEntryLoader from './loaders/media-entry-loader'\nimport SessionLoader from './loaders/session-loader'\nimport UiConfigLoader from './loaders/ui-config-loader'\nimport Configuration from './config'\nimport MediaEntry from '../../entities/media-entry'\nimport MediaSource from '../../entities/media-source'\n\n/**\n * @constant\n */\nconst logger = Logger.get(\"OvpProvider\");\n\ntype playerConfig = {\n id: string,\n session: Object,\n sources: Array<MediaSource>,\n duration: number,\n type: string,\n metadata: Object,\n plugins: Object\n};\n\n/**\n * Ovp provider\n * @classdesc\n */\nexport class OvpProvider {\n /**\n * @member - ks\n * @type {string}\n */\n ks: string;\n /**\n * @member - partner ID\n * @type {number}\n */\n partnerID: number;\n /**\n * @member - is anonymous\n * @type {boolean}\n * @private\n */\n _isAnonymous: boolean;\n /**\n * @member - uiConf ID\n * @type {number}\n * @private\n */\n _uiConfId: number;\n /**\n * @member - Data loader\n * @type {DataLoaderManager}\n * @private\n */\n _dataLoader: DataLoaderManager;\n\n /**\n * @constructor\n * @param {number} partnerID The partner ID\n * @param {string} [ks=\"\"] The provider ks (has empty string as default value)\n * @param {Object} [config] The provider config(optional)\n */\n constructor(partnerID: number, ks: string = \"\", config?: Object) {\n this.partnerID = partnerID;\n this.ks = ks;\n this._isAnonymous = !this.ks;\n Configuration.set(config);\n }\n\n /**\n * Returns player json configuration\n * @function getConfig\n * @param {string} entryId The entry ID\n * @param {number} uiConfId The uiConf ID\n * @returns {Promise} The provider config object as promise\n */\n getConfig(entryId?: string, uiConfId?: number): Promise<Object> {\n if (uiConfId != null) {\n this._uiConfId = uiConfId;\n }\n this._dataLoader = new DataLoaderManager(this.partnerID, this.ks);\n return new Promise((resolve, reject) => {\n if (this.validateParams(entryId, uiConfId)) {\n let ks: string = this.ks;\n if (this._isAnonymous) {\n ks = \"{1:result:ks}\";\n this._dataLoader.add(SessionLoader, {partnerId: this.partnerID});\n }\n this._dataLoader.add(MediaEntryLoader, {entryId: entryId, ks: ks});\n this._dataLoader.add(UiConfigLoader, {uiConfId: uiConfId, ks: ks});\n this._dataLoader.fetchData()\n .then(response => {\n resolve(this.parseDataFromResponse(response));\n },\n err => {\n reject(err);\n });\n }\n else {\n reject({success: false, data: \"Missing mandatory parameter\"});\n }\n });\n }\n\n /**\n * Parses BE data to json configuration object\n * @function parseDataFromResponse\n * @param {Map<string,Function>} data The data to parse\n * @returns {Object} The parsed config object\n */\n parseDataFromResponse(data: Map<string, Function>): Object {\n logger.debug(\"Data parsing started\");\n let config: playerConfig = {\n id: \"\",\n session: {\n partnerID: this.partnerID,\n uiConfID: this._uiConfId,\n },\n sources: [],\n duration: 0,\n type: \"Unknown\",\n metadata: {},\n plugins: {}\n };\n if (data != null) {\n if (data.has(SessionLoader.name)) {\n let sessionLoader = data.get(SessionLoader.name);\n if (sessionLoader != null && sessionLoader.response != null) {\n this.ks = sessionLoader.response;\n this._isAnonymous = !this.ks;\n config.session.ks = this.ks;\n }\n }\n if (data.has(UiConfigLoader.name)) {\n let uiConfLoader = data.get(UiConfigLoader.name);\n let pluginsJson: Object = {};\n if (uiConfLoader != null) {\n pluginsJson = uiConfLoader.response;\n }\n config.plugins = pluginsJson;\n }\n if (data.has(MediaEntryLoader.name)) {\n let mediaLoader = data.get(MediaEntryLoader.name);\n if (mediaLoader != null && mediaLoader.response != null) {\n let mediaEntry: MediaEntry = ProviderParser.getMediaEntry(this.ks, this.partnerID, this._uiConfId, mediaLoader.response);\n config.id = mediaEntry.id;\n config.sources = mediaEntry.sources;\n config.duration = mediaEntry.duration;\n config.type = mediaEntry.type.name;\n config.metadata = mediaEntry.metaData;\n }\n }\n }\n logger.debug(\"Data parsing finished\", config);\n return (config);\n }\n\n /**\n * Parameters validation function\n * @param {string} entryId The entry ID\n * @param {number} uiConfId The uiConfID\n * @returns {boolean} Is valid params\n */\n validateParams(entryId?: string, uiConfId?: number): boolean {\n return !!entryId || !!uiConfId;\n }\n\n}\n\nexport default OvpProvider;\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/ovp-provider.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/ovp-provider.js","//@flow\nimport Configuration from './config'\n\nconst config = Configuration.get();\n\n/**\n * Media source url builder\n * @classdesc\n */\nexport default class PlaySourceUrlBuilder {\n\n /**\n * Returns source url by given url params\n * @function build\n * @param {Object} urlParams The params\n * @returns {string} The URL\n * @static\n */\n static build(urlParams: Object): string {\n let baseUrl: string = config.baseUrl;\n let partnerId: string = urlParams.partnerId;\n let entryId: string = urlParams.entryId;\n let ks: string = urlParams.ks;\n let uiConfId: string = urlParams.uiConfId;\n let format: string = urlParams.format;\n let protocol: string = urlParams.protocol;\n let extension: string = urlParams.extension;\n let flavorIds: string = urlParams.flavorIds;\n\n if (baseUrl == \"\" && partnerId == \"\" && entryId == \"\" && extension == \"\" && format == \"\") {\n return \"\";\n }\n\n let playUrl = baseUrl;\n if (!PlaySourceUrlBuilder.endsWith(baseUrl, \"/\")) {\n playUrl += \"/\";\n }\n playUrl += \"p/\" + partnerId + \"/sp/\" + partnerId + \"00\" + \"/playManifest/entryId/\" + entryId + \"/protocol/\" + protocol + \"/format/\" + format;\n\n if (flavorIds != \"\") {\n playUrl += \"/falvorIds/\" + flavorIds;\n }\n else if (uiConfId != \"\") {\n playUrl += \"/uiConfId/\" + uiConfId;\n }\n\n if (this.ks != \"\") {\n playUrl += \"/ks/\" + ks;\n }\n\n playUrl += \"/a.\" + extension;\n\n if (uiConfId && flavorIds != \"\") {\n playUrl += \"?uiConfId=.\" + uiConfId;\n }\n\n return playUrl;\n }\n\n /**\n * Checks if given string end with search string\n * @param {string} string The given string\n * @param {string} searchString The string to search\n * @returns {boolean} Is given string end with search string\n */\n static endsWith(string: string, searchString: string): boolean {\n if (typeof string !== 'string') {\n return false;\n }\n if (typeof searchString !== 'string') {\n return false;\n }\n\n return string.indexOf(searchString, string.length - searchString.length) != -1;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/play-source-url-builder.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/play-source-url-builder.js","//@flow\n\n/**\n * Ovp BE access control message\n * @classdesc\n */\nexport default class KalturaAccessControlMessage {\n /**\n * @member - The access control message\n * @type {string}\n */\n message: string;\n /**\n * @member - The access control message code\n * @@type {string}\n */\n code: string;\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n constructor(data: Object) {\n this.message = data.message;\n this.code = data.code\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-access-control-message.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-access-control-message.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport KalturaMediaEntry from './kaltura-media-entry'\n\n/**\n * Ovp BE BaseEntryList service response\n * @classdesc\n */\nexport default class KalturaBaseEntryListResponse extends ServiceResult {\n /**\n * @member - The total count\n * @type {number}\n */\n totalCount: number;\n /**\n * @member - The entries\n * @type {Array<KalturaMediaEntry>}\n */\n entries: Array<KalturaMediaEntry>;\n\n /**\n * @constructor\n * @param {Object} responseObj The json response\n */\n constructor(responseObj: Object) {\n super(responseObj);\n if (!this.hasError) {\n this.totalCount = responseObj.totalCount;\n if (this.totalCount > 0) {\n this.entries = [];\n responseObj.objects.map(entry => this.entries.push(new KalturaMediaEntry(entry)));\n }\n }\n }\n}\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-base-entry-list-response.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-base-entry-list-response.js","//@flow\nimport {Scheme} from '../../enums'\n\n/**\n * Ovp BE DrmPlaybackPluginData\n * @classdesc\n */\nexport default class KalturaDrmPlaybackPluginData {\n /**\n * @member - The drm scheme\n * @type {Scheme}\n */\n scheme: Scheme;\n\n /**\n * @member - The license URL\n * @type {string}\n */\n licenseURL: string;\n\n /**\n * @constructor\n * @param {Object} drm The json response\n */\n constructor(drm: any) {\n this.scheme = drm.scheme;\n this.licenseURL = drm.licenseURL;\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-drm-playback-plugin-data.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-drm-playback-plugin-data.js","//@flow\nimport {MetadataObjectType, MetadataStatus} from '../../enums'\n\n/**\n * Ovp BE Metadata\n * @classdesc\n */\nexport default class KalturaMetadata {\n id: number;\n metadataProfileId: number;\n metadataProfileVersion: number;\n metadataObjectType: MetadataObjectType;\n objectId: string;\n version: number;\n created: Date;\n updated: Date;\n status: MetadataStatus;\n /**\n * @member - The Metadata xml - represented as XML string\n * @type {string}\n */\n xml: string;\n\n /**\n * @constructor\n * @param {Object} data The response\n */\n constructor(data: Object) {\n this.id = data.id;\n this.metadataProfileId = data.metadataProfileId;\n this.metadataProfileVersion = data.metadataProfileVersion;\n this.metadataProfileId = data.metadataProfileId;\n this.metadataObjectType = data.metadataObjectType;\n this.objectId = data.objectId;\n this.version = data.version;\n this.created = new Date(0);\n this.created.setUTCSeconds(data.createdAt);\n this.updated = new Date(0);\n this.updated.setUTCSeconds(data.updatedAt);\n this.status = data.status;\n this.xml = data.xml;\n\n }\n}\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-metadata.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-metadata.js","//@flow\nimport {KalturaRuleActionType} from '../../enums'\n\n/**\n * Ovp BE rule action\n * @classdesc\n */\nexport default class KalturaRuleAction {\n /**\n * @member - The type of the action\n * @type {KalturaRuleActionType}\n */\n type: KalturaRuleActionType;\n\n /**\n * @constructor\n * @param {Object} data The response\n */\n constructor(data: Object) {\n this.type = data.type;\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-rule-action.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-rule-action.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport {UIConfType, UIConfCreationMode} from '../../enums';\n\n/**\n * Ovp BE Ui config response\n * @classdesc\n */\nexport default class KalturaUiConfResponse extends ServiceResult {\n /**\n * @member -Name of the uiConf, this is not a primary key\n * @type {string}\n */\n name: string;\n /**\n * @member -Name of the uiConf, this is not a primary key\n * @type {string}\n */\n description: string;\n objTypeAsString: string;\n width: number;\n height: number;\n htmlParams: string;\n swfUrl: string;\n confFilePath: string;\n confFile: string;\n confFileFeatures: string;\n name: string;\n /**\n * @member -plugins configuration represented as Json string\n * @type {string}\n */\n config: string;\n confVars: string;\n useCdn: boolean;\n tags: string;\n swfUrlVersion: string;\n created: Date;\n updated: Date;\n html5Url: string;\n version: string;\n partnerTags: string;\n objType: UIConfType;\n creationMode: UIConfCreationMode;\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n constructor(data: Object) {\n super(data);\n if (!this.hasError) {\n this.name = data.name;\n\n this.description = data.description;\n this.objTypeAsString = data.objTypeAsString;\n this.width = data.width;\n this.height = data.height;\n this.htmlParams = data.htmlParams;\n this.swfUrl = data.swfUrl;\n this.confFilePath = data.confFilePath;\n this.confFile = data.confFile;\n this.confFileFeatures = data.confFileFeatures;\n this.config = data.config;\n this.confVars = data.confVars;\n this.useCdn = data.useCdn;\n this.tags = data.tags;\n this.swfUrlVersion = data.swfUrlVersion;\n this.created = new Date(0);\n this.created.setUTCSeconds(data.createdAt);\n this.updated = new Date(0);\n this.updated.setUTCSeconds(data.updatedAt);\n this.html5Url = data.description;\n this.version = data.description;\n this.partnerTags = data.description;\n this.objType = data.description;\n this.creationMode = data.description;\n\n }\n }\n}\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kalturaUIConfResponse.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kalturaUIConfResponse.js","//@flow\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"baseEntry\";\n\n/**\n * Ovp BaseEntry service methods\n * @classdesc\n */\nexport default class BaseEntryService extends OvpService {\n\n /**\n * Creates an instance of RequestBuilder for baseentry.getPlaybackContext\n * @function getPlaybackContext\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static getPlaybackContext(baseUrl: string, ks: string, entryId: string): RequestBuilder {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"getPlaybackContext\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"baseEntry-getPlaybackContext\";\n let contextDataParams = {objectType: \"KalturaContextDataParams\", flavorTags: \"all\"};\n let params = {entryId: entryId, ks: ks, contextDataParams: contextDataParams};\n request.params = params;\n return request;\n }\n\n /**\n * Creates an instance of RequestBuilder for baseentry.list\n * @function list\n * @param {string} baseUrl The base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static list(baseUrl: string, ks: string, entryId: string): RequestBuilder {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"list\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"list\";\n request.params = BaseEntryService.getEntryListReqParams(entryId, ks);\n return request;\n }\n\n /**\n * Gets baseentry.list service params\n * @function getEntryListReqParams\n * @param {string} entryId The entry ID\n * @param {string} ks The ks\n * @returns {{ks: string, filter: {redirectFromEntryId: string}, responseProfile: {fields: string, type: number}}} The service params object\n * @static\n */\n static getEntryListReqParams(entryId: string, ks: string): any {\n let filterParams = {redirectFromEntryId: entryId};\n let responseProfileParams = {\n fields: \"id,name,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags\",\n type: 1\n };\n return {ks: ks, filter: filterParams, responseProfile: responseProfileParams};\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/base-entry-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/base-entry-service.js","//@flow\n\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"metadata_metadata\";\n\n/**\n * Ovp metadata_metadata service methods\n * @classdesc\n */\nexport default class MetaDataService extends OvpService {\n /**\n * Creates an instance of RequestBuilder for metadata_metadata.list\n * @function getPlaybackContext\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static list(baseUrl: string, ks: string, entryId: string) {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"list\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"metadata_metadata-list\";\n let filter = {objectType: \"KalturaMetadataFilter\", objectIdEqual: entryId, metadataObjectTypeEqual: \"1\"};\n let params = {filter: filter, ks: ks};\n request.params = params;\n return request;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/meta-data-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/meta-data-service.js","//@flow\n\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"session\";\n\n/**\n * Ovp session service methods\n * @classdesc\n */\nexport default class SessionService extends OvpService {\n /**\n * Creates an instance of RequestBuilder for session.startWidgetSession\n * @function anonymousSession\n * @param {string} baseUrl The service base URL\n * @param {string} partnerId The partner ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static anonymousSession(baseUrl: string, partnerId: number) {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"startWidgetSession\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"session-startWidget\";\n request.params = {widgetId: \"_\" + partnerId};\n return request;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/session-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/session-service.js","//@flow\n\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"uiconf\";\n\n/**\n * Ovp uiconf service methods\n * @classdesc\n */\nexport default class UiConfService extends OvpService {\n /**\n * Creates an instance of RequestBuilder for uiconf.get\n * @function get\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} uiConfID The uiConf ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static get(baseUrl: string, ks: string, uiConfID: number) {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"get\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"uiconf-get\";\n let responseProfileParams = {\n fields: \"config\",\n type: 1\n };\n request.params = {id: uiConfID, responseProfile: responseProfileParams, ks: ks};\n return request;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/ui-conf-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/ui-conf-service.js","//@flow\n\n/**\n * Xml parser\n * @classdesc\n */\nexport default class XmlParser {\n /**\n * Parses xml string to json object\n * @param {string} xml The xml to parse\n * @returns {{}} The parsed xml as Json object\n * @static\n */\n static xmlToJson(xml: Object) {\n let obj = {};\n if (xml.nodeType == 1) {\n if (xml.attributes.length > 0) {\n obj[\"@attributes\"] = {};\n for (let j = 0; j < xml.attributes.length; j++) {\n let attribute = xml.attributes.item(j);\n obj[\"@attributes\"][attribute.nodeName] = attribute.nodeValue;\n }\n }\n }\n else if (xml.nodeType == 3) {\n obj = xml.nodeValue;\n }\n if (xml.hasChildNodes()) {\n for (let i = 0; i < xml.childNodes.length; i++) {\n let item = xml.childNodes.item(i);\n let nodeName = item.nodeName;\n if (typeof (obj[nodeName]) == \"undefined\") {\n obj[nodeName] = this.xmlToJson(item);\n }\n else {\n if (typeof (obj[nodeName].push) == \"undefined\") {\n let old = obj[nodeName];\n obj[nodeName] = [];\n obj[nodeName].push(old);\n }\n obj[nodeName].push(this.xmlToJson(item));\n }\n }\n }\n return obj;\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/xml-parser.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/xml-parser.js","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"playkit-js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsUi\"] = factory(require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsUi\"] = factory(root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_48__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 28);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 22c3c46a80b1c7885159\n\n\n// WEBPACK FOOTER //\n// webpack:/ui/webpack/bootstrap 22c3c46a80b1c7885159","!function() {\n 'use strict';\n function VNode() {}\n function h(nodeName, attributes) {\n var lastSimple, child, simple, i, children = EMPTY_CHILDREN;\n for (i = arguments.length; i-- > 2; ) stack.push(arguments[i]);\n if (attributes && null != attributes.children) {\n if (!stack.length) stack.push(attributes.children);\n delete attributes.children;\n }\n while (stack.length) if ((child = stack.pop()) && void 0 !== child.pop) for (i = child.length; i--; ) stack.push(child[i]); else {\n if (child === !0 || child === !1) child = null;\n if (simple = 'function' != typeof nodeName) if (null == child) child = ''; else if ('number' == typeof child) child = String(child); else if ('string' != typeof child) simple = !1;\n if (simple && lastSimple) children[children.length - 1] += child; else if (children === EMPTY_CHILDREN) children = [ child ]; else children.push(child);\n lastSimple = simple;\n }\n var p = new VNode();\n p.nodeName = nodeName;\n p.children = children;\n p.attributes = null == attributes ? void 0 : attributes;\n p.key = null == attributes ? void 0 : attributes.key;\n if (void 0 !== options.vnode) options.vnode(p);\n return p;\n }\n function extend(obj, props) {\n for (var i in props) obj[i] = props[i];\n return obj;\n }\n function cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n }\n function enqueueRender(component) {\n if (!component.__d && (component.__d = !0) && 1 == items.push(component)) (options.debounceRendering || setTimeout)(rerender);\n }\n function rerender() {\n var p, list = items;\n items = [];\n while (p = list.pop()) if (p.__d) renderComponent(p);\n }\n function isSameNodeType(node, vnode, hydrating) {\n if ('string' == typeof vnode || 'number' == typeof vnode) return void 0 !== node.splitText;\n if ('string' == typeof vnode.nodeName) return !node._componentConstructor && isNamedNode(node, vnode.nodeName); else return hydrating || node._componentConstructor === vnode.nodeName;\n }\n function isNamedNode(node, nodeName) {\n return node.__n === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n }\n function getNodeProps(vnode) {\n var props = extend({}, vnode.attributes);\n props.children = vnode.children;\n var defaultProps = vnode.nodeName.defaultProps;\n if (void 0 !== defaultProps) for (var i in defaultProps) if (void 0 === props[i]) props[i] = defaultProps[i];\n return props;\n }\n function createNode(nodeName, isSvg) {\n var node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n node.__n = nodeName;\n return node;\n }\n function removeNode(node) {\n if (node.parentNode) node.parentNode.removeChild(node);\n }\n function setAccessor(node, name, old, value, isSvg) {\n if ('className' === name) name = 'class';\n if ('key' === name) ; else if ('ref' === name) {\n if (old) old(null);\n if (value) value(node);\n } else if ('class' === name && !isSvg) node.className = value || ''; else if ('style' === name) {\n if (!value || 'string' == typeof value || 'string' == typeof old) node.style.cssText = value || '';\n if (value && 'object' == typeof value) {\n if ('string' != typeof old) for (var i in old) if (!(i in value)) node.style[i] = '';\n for (var i in value) node.style[i] = 'number' == typeof value[i] && IS_NON_DIMENSIONAL.test(i) === !1 ? value[i] + 'px' : value[i];\n }\n } else if ('dangerouslySetInnerHTML' === name) {\n if (value) node.innerHTML = value.__html || '';\n } else if ('o' == name[0] && 'n' == name[1]) {\n var useCapture = name !== (name = name.replace(/Capture$/, ''));\n name = name.toLowerCase().substring(2);\n if (value) {\n if (!old) node.addEventListener(name, eventProxy, useCapture);\n } else node.removeEventListener(name, eventProxy, useCapture);\n (node.__l || (node.__l = {}))[name] = value;\n } else if ('list' !== name && 'type' !== name && !isSvg && name in node) {\n setProperty(node, name, null == value ? '' : value);\n if (null == value || value === !1) node.removeAttribute(name);\n } else {\n var ns = isSvg && name !== (name = name.replace(/^xlink\\:?/, ''));\n if (null == value || value === !1) if (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase()); else node.removeAttribute(name); else if ('function' != typeof value) if (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value); else node.setAttribute(name, value);\n }\n }\n function setProperty(node, name, value) {\n try {\n node[name] = value;\n } catch (e) {}\n }\n function eventProxy(e) {\n return this.__l[e.type](options.event && options.event(e) || e);\n }\n function flushMounts() {\n var c;\n while (c = mounts.pop()) {\n if (options.afterMount) options.afterMount(c);\n if (c.componentDidMount) c.componentDidMount();\n }\n }\n function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n if (!diffLevel++) {\n isSvgMode = null != parent && void 0 !== parent.ownerSVGElement;\n hydrating = null != dom && !('__preactattr_' in dom);\n }\n var ret = idiff(dom, vnode, context, mountAll, componentRoot);\n if (parent && ret.parentNode !== parent) parent.appendChild(ret);\n if (!--diffLevel) {\n hydrating = !1;\n if (!componentRoot) flushMounts();\n }\n return ret;\n }\n function idiff(dom, vnode, context, mountAll, componentRoot) {\n var out = dom, prevSvgMode = isSvgMode;\n if (null == vnode) vnode = '';\n if ('string' == typeof vnode) {\n if (dom && void 0 !== dom.splitText && dom.parentNode && (!dom._component || componentRoot)) {\n if (dom.nodeValue != vnode) dom.nodeValue = vnode;\n } else {\n out = document.createTextNode(vnode);\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n recollectNodeTree(dom, !0);\n }\n }\n out.__preactattr_ = !0;\n return out;\n }\n if ('function' == typeof vnode.nodeName) return buildComponentFromVNode(dom, vnode, context, mountAll);\n isSvgMode = 'svg' === vnode.nodeName ? !0 : 'foreignObject' === vnode.nodeName ? !1 : isSvgMode;\n if (!dom || !isNamedNode(dom, String(vnode.nodeName))) {\n out = createNode(String(vnode.nodeName), isSvgMode);\n if (dom) {\n while (dom.firstChild) out.appendChild(dom.firstChild);\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n recollectNodeTree(dom, !0);\n }\n }\n var fc = out.firstChild, props = out.__preactattr_ || (out.__preactattr_ = {}), vchildren = vnode.children;\n if (!hydrating && vchildren && 1 === vchildren.length && 'string' == typeof vchildren[0] && null != fc && void 0 !== fc.splitText && null == fc.nextSibling) {\n if (fc.nodeValue != vchildren[0]) fc.nodeValue = vchildren[0];\n } else if (vchildren && vchildren.length || null != fc) innerDiffNode(out, vchildren, context, mountAll, hydrating || null != props.dangerouslySetInnerHTML);\n diffAttributes(out, vnode.attributes, props);\n isSvgMode = prevSvgMode;\n return out;\n }\n function innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n var j, c, vchild, child, originalChildren = dom.childNodes, children = [], keyed = {}, keyedLen = 0, min = 0, len = originalChildren.length, childrenLen = 0, vlen = vchildren ? vchildren.length : 0;\n if (0 !== len) for (var i = 0; i < len; i++) {\n var _child = originalChildren[i], props = _child.__preactattr_, key = vlen && props ? _child._component ? _child._component.__k : props.key : null;\n if (null != key) {\n keyedLen++;\n keyed[key] = _child;\n } else if (props || (void 0 !== _child.splitText ? isHydrating ? _child.nodeValue.trim() : !0 : isHydrating)) children[childrenLen++] = _child;\n }\n if (0 !== vlen) for (var i = 0; i < vlen; i++) {\n vchild = vchildren[i];\n child = null;\n var key = vchild.key;\n if (null != key) {\n if (keyedLen && void 0 !== keyed[key]) {\n child = keyed[key];\n keyed[key] = void 0;\n keyedLen--;\n }\n } else if (!child && min < childrenLen) for (j = min; j < childrenLen; j++) if (void 0 !== children[j] && isSameNodeType(c = children[j], vchild, isHydrating)) {\n child = c;\n children[j] = void 0;\n if (j === childrenLen - 1) childrenLen--;\n if (j === min) min++;\n break;\n }\n child = idiff(child, vchild, context, mountAll);\n if (child && child !== dom) if (i >= len) dom.appendChild(child); else if (child !== originalChildren[i]) if (child === originalChildren[i + 1]) removeNode(originalChildren[i]); else dom.insertBefore(child, originalChildren[i] || null);\n }\n if (keyedLen) for (var i in keyed) if (void 0 !== keyed[i]) recollectNodeTree(keyed[i], !1);\n while (min <= childrenLen) if (void 0 !== (child = children[childrenLen--])) recollectNodeTree(child, !1);\n }\n function recollectNodeTree(node, unmountOnly) {\n var component = node._component;\n if (component) unmountComponent(component); else {\n if (null != node.__preactattr_ && node.__preactattr_.ref) node.__preactattr_.ref(null);\n if (unmountOnly === !1 || null == node.__preactattr_) removeNode(node);\n removeChildren(node);\n }\n }\n function removeChildren(node) {\n node = node.lastChild;\n while (node) {\n var next = node.previousSibling;\n recollectNodeTree(node, !0);\n node = next;\n }\n }\n function diffAttributes(dom, attrs, old) {\n var name;\n for (name in old) if ((!attrs || null == attrs[name]) && null != old[name]) setAccessor(dom, name, old[name], old[name] = void 0, isSvgMode);\n for (name in attrs) if (!('children' === name || 'innerHTML' === name || name in old && attrs[name] === ('value' === name || 'checked' === name ? dom[name] : old[name]))) setAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n }\n function collectComponent(component) {\n var name = component.constructor.name;\n (components[name] || (components[name] = [])).push(component);\n }\n function createComponent(Ctor, props, context) {\n var inst, list = components[Ctor.name];\n if (Ctor.prototype && Ctor.prototype.render) {\n inst = new Ctor(props, context);\n Component.call(inst, props, context);\n } else {\n inst = new Component(props, context);\n inst.constructor = Ctor;\n inst.render = doRender;\n }\n if (list) for (var i = list.length; i--; ) if (list[i].constructor === Ctor) {\n inst.__b = list[i].__b;\n list.splice(i, 1);\n break;\n }\n return inst;\n }\n function doRender(props, state, context) {\n return this.constructor(props, context);\n }\n function setComponentProps(component, props, opts, context, mountAll) {\n if (!component.__x) {\n component.__x = !0;\n if (component.__r = props.ref) delete props.ref;\n if (component.__k = props.key) delete props.key;\n if (!component.base || mountAll) {\n if (component.componentWillMount) component.componentWillMount();\n } else if (component.componentWillReceiveProps) component.componentWillReceiveProps(props, context);\n if (context && context !== component.context) {\n if (!component.__c) component.__c = component.context;\n component.context = context;\n }\n if (!component.__p) component.__p = component.props;\n component.props = props;\n component.__x = !1;\n if (0 !== opts) if (1 === opts || options.syncComponentUpdates !== !1 || !component.base) renderComponent(component, 1, mountAll); else enqueueRender(component);\n if (component.__r) component.__r(component);\n }\n }\n function renderComponent(component, opts, mountAll, isChild) {\n if (!component.__x) {\n var rendered, inst, cbase, props = component.props, state = component.state, context = component.context, previousProps = component.__p || props, previousState = component.__s || state, previousContext = component.__c || context, isUpdate = component.base, nextBase = component.__b, initialBase = isUpdate || nextBase, initialChildComponent = component._component, skip = !1;\n if (isUpdate) {\n component.props = previousProps;\n component.state = previousState;\n component.context = previousContext;\n if (2 !== opts && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === !1) skip = !0; else if (component.componentWillUpdate) component.componentWillUpdate(props, state, context);\n component.props = props;\n component.state = state;\n component.context = context;\n }\n component.__p = component.__s = component.__c = component.__b = null;\n component.__d = !1;\n if (!skip) {\n rendered = component.render(props, state, context);\n if (component.getChildContext) context = extend(extend({}, context), component.getChildContext());\n var toUnmount, base, childComponent = rendered && rendered.nodeName;\n if ('function' == typeof childComponent) {\n var childProps = getNodeProps(rendered);\n inst = initialChildComponent;\n if (inst && inst.constructor === childComponent && childProps.key == inst.__k) setComponentProps(inst, childProps, 1, context, !1); else {\n toUnmount = inst;\n component._component = inst = createComponent(childComponent, childProps, context);\n inst.__b = inst.__b || nextBase;\n inst.__u = component;\n setComponentProps(inst, childProps, 0, context, !1);\n renderComponent(inst, 1, mountAll, !0);\n }\n base = inst.base;\n } else {\n cbase = initialBase;\n toUnmount = initialChildComponent;\n if (toUnmount) cbase = component._component = null;\n if (initialBase || 1 === opts) {\n if (cbase) cbase._component = null;\n base = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, !0);\n }\n }\n if (initialBase && base !== initialBase && inst !== initialChildComponent) {\n var baseParent = initialBase.parentNode;\n if (baseParent && base !== baseParent) {\n baseParent.replaceChild(base, initialBase);\n if (!toUnmount) {\n initialBase._component = null;\n recollectNodeTree(initialBase, !1);\n }\n }\n }\n if (toUnmount) unmountComponent(toUnmount);\n component.base = base;\n if (base && !isChild) {\n var componentRef = component, t = component;\n while (t = t.__u) (componentRef = t).base = base;\n base._component = componentRef;\n base._componentConstructor = componentRef.constructor;\n }\n }\n if (!isUpdate || mountAll) mounts.unshift(component); else if (!skip) {\n flushMounts();\n if (component.componentDidUpdate) component.componentDidUpdate(previousProps, previousState, previousContext);\n if (options.afterUpdate) options.afterUpdate(component);\n }\n if (null != component.__h) while (component.__h.length) component.__h.pop().call(component);\n if (!diffLevel && !isChild) flushMounts();\n }\n }\n function buildComponentFromVNode(dom, vnode, context, mountAll) {\n var c = dom && dom._component, originalComponent = c, oldDom = dom, isDirectOwner = c && dom._componentConstructor === vnode.nodeName, isOwner = isDirectOwner, props = getNodeProps(vnode);\n while (c && !isOwner && (c = c.__u)) isOwner = c.constructor === vnode.nodeName;\n if (c && isOwner && (!mountAll || c._component)) {\n setComponentProps(c, props, 3, context, mountAll);\n dom = c.base;\n } else {\n if (originalComponent && !isDirectOwner) {\n unmountComponent(originalComponent);\n dom = oldDom = null;\n }\n c = createComponent(vnode.nodeName, props, context);\n if (dom && !c.__b) {\n c.__b = dom;\n oldDom = null;\n }\n setComponentProps(c, props, 1, context, mountAll);\n dom = c.base;\n if (oldDom && dom !== oldDom) {\n oldDom._component = null;\n recollectNodeTree(oldDom, !1);\n }\n }\n return dom;\n }\n function unmountComponent(component) {\n if (options.beforeUnmount) options.beforeUnmount(component);\n var base = component.base;\n component.__x = !0;\n if (component.componentWillUnmount) component.componentWillUnmount();\n component.base = null;\n var inner = component._component;\n if (inner) unmountComponent(inner); else if (base) {\n if (base.__preactattr_ && base.__preactattr_.ref) base.__preactattr_.ref(null);\n component.__b = base;\n removeNode(base);\n collectComponent(component);\n removeChildren(base);\n }\n if (component.__r) component.__r(null);\n }\n function Component(props, context) {\n this.__d = !0;\n this.context = context;\n this.props = props;\n this.state = this.state || {};\n }\n function render(vnode, parent, merge) {\n return diff(merge, vnode, {}, !1, parent, !1);\n }\n var options = {};\n var stack = [];\n var EMPTY_CHILDREN = [];\n var IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n var items = [];\n var mounts = [];\n var diffLevel = 0;\n var isSvgMode = !1;\n var hydrating = !1;\n var components = {};\n extend(Component.prototype, {\n setState: function(state, callback) {\n var s = this.state;\n if (!this.__s) this.__s = extend({}, s);\n extend(s, 'function' == typeof state ? state(s, this.props) : state);\n if (callback) (this.__h = this.__h || []).push(callback);\n enqueueRender(this);\n },\n forceUpdate: function(callback) {\n if (callback) (this.__h = this.__h || []).push(callback);\n renderComponent(this, 2);\n },\n render: function() {}\n });\n var preact = {\n h: h,\n createElement: h,\n cloneElement: cloneElement,\n Component: Component,\n render: render,\n rerender: rerender,\n options: options\n };\n if ('undefined' != typeof module) module.exports = preact; else self.preact = preact;\n}();\n//# sourceMappingURL=preact.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/preact/dist/preact.js\n// module id = 0\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/preact/dist/preact.js","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('preact'), require('redux')) :\n\ttypeof define === 'function' && define.amd ? define(['preact', 'redux'], factory) :\n\t(global.preactRedux = factory(global.preact,global.Redux));\n}(this, (function (preact,redux) {\n\nvar Children = {\n\tonly: function only(children) {\n\t\treturn children && children[0] || null;\n\t}\n};\n\nfunction proptype() {}\nproptype.isRequired = proptype;\n\nvar PropTypes = {\n\telement: proptype,\n\tfunc: proptype,\n\tshape: function shape() {\n\t\treturn proptype;\n\t},\n\tinstanceOf: function instanceOf() {\n\t\treturn proptype;\n\t}\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n};\n\n\n\n\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\n\n\n\n\n\n\n\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar get = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\nvar objectWithoutProperties = function (obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n};\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n\n\nvar set = function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if (\"value\" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n};\n\n// encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nvar CLEARED = null;\nvar nullListeners = {\n notify: function notify() {}\n};\n\nfunction createListenerCollection() {\n // the current/next pattern is copied from redux's createStore code.\n // TODO: refactor+expose that code to be reusable here?\n var current = [];\n var next = [];\n\n return {\n clear: function clear() {\n next = CLEARED;\n current = CLEARED;\n },\n notify: function notify() {\n var listeners = current = next;\n for (var i = 0; i < listeners.length; i++) {\n listeners[i]();\n }\n },\n subscribe: function subscribe(listener) {\n var isSubscribed = true;\n if (next === current) next = current.slice();\n next.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed || current === CLEARED) return;\n isSubscribed = false;\n\n if (next === current) next = current.slice();\n next.splice(next.indexOf(listener), 1);\n };\n }\n };\n}\n\nvar Subscription = function () {\n function Subscription(store, parentSub) {\n classCallCheck(this, Subscription);\n\n this.store = store;\n this.parentSub = parentSub;\n this.unsubscribe = null;\n this.listeners = nullListeners;\n }\n\n Subscription.prototype.addNestedSub = function addNestedSub(listener) {\n this.trySubscribe();\n return this.listeners.subscribe(listener);\n };\n\n Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() {\n this.listeners.notify();\n };\n\n Subscription.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.unsubscribe);\n };\n\n Subscription.prototype.trySubscribe = function trySubscribe() {\n if (!this.unsubscribe) {\n // this.onStateChange is set by connectAdvanced.initSubscription()\n this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);\n\n this.listeners = createListenerCollection();\n }\n };\n\n Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n this.listeners.clear();\n this.listeners = nullListeners;\n }\n };\n\n return Subscription;\n}();\n\nvar storeShape = PropTypes.shape({\n subscribe: PropTypes.func.isRequired,\n dispatch: PropTypes.func.isRequired,\n getState: PropTypes.func.isRequired\n});\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}\n\nvar didWarnAboutReceivingStore = false;\nfunction warnAboutReceivingStore() {\n if (didWarnAboutReceivingStore) {\n return;\n }\n didWarnAboutReceivingStore = true;\n\n warning('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');\n}\n\nvar Provider = function (_Component) {\n inherits(Provider, _Component);\n\n Provider.prototype.getChildContext = function getChildContext() {\n return { store: this.store, storeSubscription: null };\n };\n\n function Provider(props, context) {\n classCallCheck(this, Provider);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.store = props.store;\n return _this;\n }\n\n Provider.prototype.render = function render() {\n return Children.only(this.props.children);\n };\n\n return Provider;\n}(preact.Component);\n\n{\n Provider.prototype.componentWillReceiveProps = function (nextProps) {\n var store = this.store;\n var nextStore = nextProps.store;\n\n\n if (store !== nextStore) {\n warnAboutReceivingStore();\n }\n };\n}\n\nProvider.childContextTypes = {\n store: storeShape.isRequired,\n storeSubscription: PropTypes.instanceOf(Subscription)\n};\nProvider.displayName = 'Provider';\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\n\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n arguments: true,\n arity: true\n};\n\nvar isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function';\n\nvar index = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n var keys = Object.getOwnPropertyNames(sourceComponent);\n\n /* istanbul ignore else */\n if (isGetOwnPropertySymbolsAvailable) {\n keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent));\n }\n\n for (var i = 0; i < keys.length; ++i) {\n if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) {\n try {\n targetComponent[keys[i]] = sourceComponent[keys[i]];\n } catch (error) {}\n }\n }\n }\n\n return targetComponent;\n};\n\nvar invariant = function () {}\n\nvar hotReloadingVersion = 0;\nfunction connectAdvanced(\n/*\n selectorFactory is a func that is responsible for returning the selector function used to\n compute new props from state, props, and dispatch. For example:\n export default connectAdvanced((dispatch, options) => (state, props) => ({\n thing: state.things[props.thingId],\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\n }))(YourComponent)\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\n props. Do not use connectAdvanced directly without memoizing results between calls to your\n selector, otherwise the Connect component will re-render on every state or props change.\n*/\nselectorFactory) {\n var _contextTypes, _childContextTypes;\n\n var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n var _ref$getDisplayName = _ref.getDisplayName;\n var getDisplayName = _ref$getDisplayName === undefined ? function (name) {\n return 'ConnectAdvanced(' + name + ')';\n } : _ref$getDisplayName;\n var _ref$methodName = _ref.methodName;\n var methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName;\n var _ref$renderCountProp = _ref.renderCountProp;\n var renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp;\n var _ref$shouldHandleStat = _ref.shouldHandleStateChanges;\n var shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat;\n var _ref$storeKey = _ref.storeKey;\n var storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey;\n var _ref$withRef = _ref.withRef;\n var withRef = _ref$withRef === undefined ? false : _ref$withRef;\n var connectOptions = objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']);\n\n var subscriptionKey = storeKey + 'Subscription';\n var version = hotReloadingVersion++;\n\n var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = storeShape, _contextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _contextTypes);\n var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _childContextTypes);\n\n return function wrapWithConnect(WrappedComponent) {\n invariant(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + WrappedComponent));\n\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n withRef: withRef,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent\n });\n\n var Connect = function (_Component) {\n inherits(Connect, _Component);\n\n function Connect(props, context) {\n classCallCheck(this, Connect);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.version = version;\n _this.state = {};\n _this.renderCount = 0;\n _this.store = _this.props[storeKey] || _this.context[storeKey];\n _this.parentSub = props[subscriptionKey] || context[subscriptionKey];\n\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n\n invariant(_this.store, 'Could not find \"' + storeKey + '\" in either the context or ' + ('props of \"' + displayName + '\". ') + 'Either wrap the root component in a <Provider>, ' + ('or explicitly pass \"' + storeKey + '\" as a prop to \"' + displayName + '\".'));\n\n // make sure `getState` is properly bound in order to avoid breaking\n // custom store implementations that rely on the store's context\n _this.getState = _this.store.getState.bind(_this.store);\n\n _this.initSelector();\n _this.initSubscription();\n return _this;\n }\n\n Connect.prototype.getChildContext = function getChildContext() {\n var _ref2;\n\n return _ref2 = {}, _ref2[subscriptionKey] = this.subscription || this.parentSub, _ref2;\n };\n\n Connect.prototype.componentDidMount = function componentDidMount() {\n if (!shouldHandleStateChanges) return;\n\n // componentWillMount fires during server side rendering, but componentDidMount and\n // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.\n // Otherwise, unsubscription would never take place during SSR, causing a memory leak.\n // To handle the case where a child component may have triggered a state change by\n // dispatching an action in its componentWillMount, we have to re-run the select and maybe\n // re-render.\n this.subscription.trySubscribe();\n this.selector.run(this.props);\n if (this.selector.shouldComponentUpdate) this.forceUpdate();\n };\n\n Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n this.selector.run(nextProps);\n };\n\n Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() {\n return this.selector.shouldComponentUpdate;\n };\n\n Connect.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.subscription) this.subscription.tryUnsubscribe();\n // these are just to guard against extra memory leakage if a parent element doesn't\n // dereference this instance properly, such as an async callback that never finishes\n this.subscription = null;\n this.store = null;\n this.parentSub = null;\n this.selector.run = function () {};\n };\n\n Connect.prototype.getWrappedInstance = function getWrappedInstance() {\n invariant(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.'));\n return this.wrappedInstance;\n };\n\n Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) {\n this.wrappedInstance = ref;\n };\n\n Connect.prototype.initSelector = function initSelector() {\n var dispatch = this.store.dispatch;\n var getState = this.getState;\n\n var sourceSelector = selectorFactory(dispatch, selectorFactoryOptions);\n\n // wrap the selector in an object that tracks its results between runs\n var selector = this.selector = {\n shouldComponentUpdate: true,\n props: sourceSelector(getState(), this.props),\n run: function runComponentSelector(props) {\n try {\n var nextProps = sourceSelector(getState(), props);\n if (selector.error || nextProps !== selector.props) {\n selector.shouldComponentUpdate = true;\n selector.props = nextProps;\n selector.error = null;\n }\n } catch (error) {\n selector.shouldComponentUpdate = true;\n selector.error = error;\n }\n }\n };\n };\n\n Connect.prototype.initSubscription = function initSubscription() {\n var _this2 = this;\n\n if (shouldHandleStateChanges) {\n (function () {\n var subscription = _this2.subscription = new Subscription(_this2.store, _this2.parentSub);\n var dummyState = {};\n\n subscription.onStateChange = function onStateChange() {\n this.selector.run(this.props);\n\n if (!this.selector.shouldComponentUpdate) {\n subscription.notifyNestedSubs();\n } else {\n this.componentDidUpdate = function componentDidUpdate() {\n this.componentDidUpdate = undefined;\n subscription.notifyNestedSubs();\n };\n\n this.setState(dummyState);\n }\n }.bind(_this2);\n })();\n }\n };\n\n Connect.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.subscription) && this.subscription.isSubscribed();\n };\n\n Connect.prototype.addExtraProps = function addExtraProps(props) {\n if (!withRef && !renderCountProp) return props;\n // make a shallow copy so that fields added don't leak to the original selector.\n // this is especially important for 'ref' since that's a reference back to the component\n // instance. a singleton memoized selector would then be holding a reference to the\n // instance, preventing the instance from being garbage collected, and that would be bad\n var withExtras = _extends({}, props);\n if (withRef) withExtras.ref = this.setWrappedInstance;\n if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;\n return withExtras;\n };\n\n Connect.prototype.render = function render() {\n var selector = this.selector;\n selector.shouldComponentUpdate = false;\n\n if (selector.error) {\n throw selector.error;\n } else {\n return preact.h(WrappedComponent, this.addExtraProps(selector.props));\n }\n };\n\n return Connect;\n }(preact.Component);\n\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = displayName;\n Connect.childContextTypes = childContextTypes;\n Connect.contextTypes = contextTypes;\n\n\n {\n Connect.prototype.componentWillUpdate = function componentWillUpdate() {\n // We are hot reloading!\n if (this.version !== version) {\n this.version = version;\n this.initSelector();\n\n if (this.subscription) this.subscription.tryUnsubscribe();\n this.initSubscription();\n if (shouldHandleStateChanges) this.subscription.trySubscribe();\n }\n };\n }\n\n return index(Connect, WrappedComponent);\n };\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n\n var countA = 0;\n var countB = 0;\n\n for (var key in a) {\n if (hasOwn.call(a, key) && a[key] !== b[key]) return false;\n countA++;\n }\n\n for (var _key in b) {\n if (hasOwn.call(b, _key)) countB++;\n }\n\n return countA === countB;\n}\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetPrototype = Object.getPrototypeOf;\n\n/**\n * Gets the `[[Prototype]]` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {null|Object} Returns the `[[Prototype]]`.\n */\nfunction getPrototype(value) {\n return nativeGetPrototype(Object(value));\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 * 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 === 'undefined' ? 'undefined' : _typeof(value)) == 'object';\n}\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = Function.prototype.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/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\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,\n * 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) || 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' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;\n}\n\nfunction verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.');\n }\n}\n\nfunction wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n}\n\n// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n// \n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\nfunction getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\n\n// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n// \n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n// \n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n// \n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n// \nfunction wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}\n\nfunction whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\n\nfunction whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return { dispatch: dispatch };\n }) : undefined;\n}\n\nfunction whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && (typeof mapDispatchToProps === 'undefined' ? 'undefined' : _typeof(mapDispatchToProps)) === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return redux.bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\n\nvar defaultMapDispatchToPropsFactories = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];\n\nfunction whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\n\nfunction whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\n\nvar defaultMapStateToPropsFactories = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];\n\nfunction defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, stateProps, dispatchProps);\n}\n\nfunction wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName;\n var pure = _ref.pure;\n var areMergedPropsEqual = _ref.areMergedPropsEqual;\n\n var hasRunOnce = false;\n var mergedProps = void 0;\n\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n\n verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\n\nfunction whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\n\nfunction whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\n\nvar defaultMergePropsFactories = [whenMergePropsIsFunction, whenMergePropsIsOmitted];\n\nfunction verify(selector, methodName, displayName) {\n if (!selector) {\n throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.');\n } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {\n if (!selector.hasOwnProperty('dependsOnOwnProps')) {\n warning('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.');\n }\n }\n}\n\nfunction verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {\n verify(mapStateToProps, 'mapStateToProps', displayName);\n verify(mapDispatchToProps, 'mapDispatchToProps', displayName);\n verify(mergeProps, 'mergeProps', displayName);\n}\n\nfunction impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\n\nfunction pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual;\n var areOwnPropsEqual = _ref.areOwnPropsEqual;\n var areStatePropsEqual = _ref.areStatePropsEqual;\n\n var hasRunAtLeastOnce = false;\n var state = void 0;\n var ownProps = void 0;\n var stateProps = void 0;\n var dispatchProps = void 0;\n var mergedProps = void 0;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state);\n state = nextState;\n ownProps = nextOwnProps;\n\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n}\n\n// TODO: Add more comments\n\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nfunction finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps;\n var initMapDispatchToProps = _ref2.initMapDispatchToProps;\n var initMergeProps = _ref2.initMergeProps;\n var options = objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}\n\n/*\n connect is a facade over connectAdvanced. It turns its args into a compatible\n selectorFactory, which has the signature:\n\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\n \n connect passes its args to connectAdvanced as options, which will in turn pass them to\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\n\n selectorFactory returns a final props selector from its mapStateToProps,\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\n mergePropsFactories, and pure args.\n\n The resulting final props selector is called by the Connect component instance whenever\n it receives new props or store state.\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error('Invalid value of type ' + (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.');\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n}\n\n// createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\nfunction createConnect() {\n var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var _ref$connectHOC = _ref.connectHOC;\n var connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC;\n var _ref$mapStateToPropsF = _ref.mapStateToPropsFactories;\n var mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF;\n var _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories;\n var mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro;\n var _ref$mergePropsFactor = _ref.mergePropsFactories;\n var mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor;\n var _ref$selectorFactory = _ref.selectorFactory;\n var selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];\n\n var _ref2$pure = _ref2.pure;\n var pure = _ref2$pure === undefined ? true : _ref2$pure;\n var _ref2$areStatesEqual = _ref2.areStatesEqual;\n var areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual;\n var _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual;\n var areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua;\n var _ref2$areStatePropsEq = _ref2.areStatePropsEqual;\n var areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq;\n var _ref2$areMergedPropsE = _ref2.areMergedPropsEqual;\n var areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE;\n var extraOptions = objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}\n\nvar connect$1 = createConnect();\n\n\n\nvar lib$1 = {\n\tProvider: Provider,\n\tconnect: connect$1,\n\tconnectAdvanced: connectAdvanced\n};\n\nreturn lib$1;\n\n})));\n//# sourceMappingURL=preact-redux.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/preact-redux/dist/preact-redux.js\n// module id = 1\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/preact-redux/dist/preact-redux.js","//@flow\nimport { Component } from 'preact';\nimport Player from 'playkit-js';\nimport LoggerFactory from '../utils/logger';\n\nclass BaseComponent extends Component {\n player: Player;\n name: string;\n config: Object;\n logger: any;\n\n constructor(obj?: IControlParams = { config: {} }) {\n super();\n\n this.name = obj.name;\n this.player = obj.player;\n this.config = obj.config;\n this.logger = LoggerFactory.getLogger(`UI ${this.name}`);\n this.logger.debug(`Initialized`);\n }\n\n getConfig(attr?: string): any {\n if (attr) {\n return this.config[attr];\n }\n return this.config;\n }\n\n get defaultConfig() {\n return {}\n }\n}\n\nexport default BaseComponent;\n\n\n\n// WEBPACK FOOTER //\n// ./components/base.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/base.js","//@flow\nimport { bindActionCreators } from 'redux';\n\nexport function bindActions(actions) {\n\treturn dispatch => ({\n\t\t...bindActionCreators(actions, dispatch)\n\t});\n}\n\n\n\n// WEBPACK FOOTER //\n// ./utils/bind-actions.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/bind-actions.js","import { h, Component } from 'preact';\n\nclass Icon extends Component {\n\n render(props) {\n switch (props.type) {\n case 'maximize':\n return (\n <svg className='icon icon-maximize' viewBox='0 0 1024 1024'>\n <path d='M800 269.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z' />\n <path d='M224 754.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z' />\n </svg>\n )\n case 'minimize':\n return (\n <svg className='icon icon-minimize' viewBox='0 0 1024 1024'>\n <path d='M672 306.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z' />\n <path d='M352 717.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z' />\n </svg>\n )\n\n case 'play':\n return (\n <svg className='icon icon-play' viewBox='0 0 1024 1024'>\n <path d='M796.806 461.202c44.919 28.075 44.739 73.706 0 101.668l-459.472 287.171c-44.919 28.075-81.334 7.915-81.334-45.305v-585.4c0-53.096 36.595-73.266 81.334-45.305l459.472 287.171z' />\n </svg>\n )\n\n case 'pause':\n return (\n <svg className='icon icon-pause' viewBox='0 0 1024 1024'>\n <path d='M256 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314zM640 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314z' />\n </svg>\n )\n\n case 'volume-base':\n return (\n <svg className='icon volume-base' viewBox='0 0 1024 1024'>\n <path d='M224 352l234.504-156.336c29.545-19.697 53.496-7.194 53.496 28.053v576.566c0 35.19-24.059 47.677-53.496 28.053l-234.504-156.336h-127.906c-17.725 0-32.094-14.581-32.094-31.853v-256.295c0-17.592 14.012-31.853 32.094-31.853h127.906zM288 637.748l160 106.667v-464.83l-160 106.667v251.496zM128 416v192h96v-192h-96z' />\n </svg>\n )\n\n case 'volume-waves':\n return (\n <svg className='icon volume-waves' viewBox='0 0 1024 1024'>\n <path d='M802.017 837.177c82.359-86.627 129.183-201.774 129.183-324.26 0-123.976-47.976-240.409-132.127-327.329-12.293-12.697-32.552-13.025-45.249-0.732s-13.025 32.552-0.732 45.249c72.692 75.084 114.109 175.597 114.109 282.812 0 105.928-40.422 205.331-111.566 280.162-12.177 12.808-11.666 33.063 1.143 45.24s33.063 11.666 45.24-1.143z' />\n <path d='M667.436 743.221c67.761-60.884 107.273-147.888 107.273-241.233 0-87.318-34.552-169.203-94.836-229.446-12.501-12.493-32.762-12.486-45.255 0.015s-12.486 32.762 0.015 45.255c48.375 48.342 76.075 113.989 76.075 184.176 0 75.021-31.679 144.776-86.048 193.627-13.146 11.812-14.227 32.044-2.416 45.19s32.044 14.227 45.19 2.416z' />\n </svg>\n )\n\n case 'volume-mute':\n return (\n <svg className='icon volume-mute' viewBox='0 0 1024 1024'>\n <path d='M768 466.745l-67.986-67.986c-12.213-12.213-32.654-12.393-45.151 0.104-12.584 12.584-12.543 32.711-0.104 45.151l67.986 67.986-67.986 67.986c-12.213 12.213-12.393 32.654 0.104 45.151 12.584 12.584 32.711 12.543 45.151 0.104l67.986-67.986 67.986 67.986c12.213 12.213 32.654 12.393 45.151-0.104 12.584-12.584 12.543-32.711 0.104-45.151l-67.986-67.986 67.986-67.986c12.213-12.213 12.393-32.654-0.104-45.151-12.584-12.584-32.711-12.543-45.151-0.104l-67.986 67.986z' />\n </svg>\n )\n\n case 'close':\n return (\n <svg className='icon icon-close' viewBox='0 0 1024 1024'>\n <path d='M573.162 512l214.269-214.269c16.772-16.772 16.688-44.071-0.202-60.96-17.007-17.007-44.182-16.98-60.96-0.202l-214.269 214.269-214.269-214.269c-16.772-16.772-44.071-16.688-60.96 0.202-17.007 17.007-16.98 44.182-0.202 60.96l214.269 214.269-214.269 214.269c-16.772 16.772-16.688 44.071 0.202 60.96 17.007 17.007 44.182 16.98 60.96 0.202l214.269-214.269 214.269 214.269c16.772 16.772 44.071 16.688 60.96-0.202 17.007-17.007 16.98-44.182 0.202-60.96l-214.269-214.269z' />\n </svg>\n )\n\n case 'share':\n return (\n <svg className='icon icon-share' viewBox='0 0 1024 1024'>\n <path d='M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.129-5.295 0-58.91 47.756-106.667 106.667-106.667s106.667 47.756 106.667 106.667c0 58.91-47.756 106.667-106.667 106.667-33.894 0-64.095-15.808-83.633-40.454l-236.467 142.445c-0.132-3.064-0.394-6.095-0.779-9.087l7.271-12.835-0.117 53.333-7.183-12.743c0.399-3.046 0.67-6.131 0.806-9.252l236.467 142.383c19.538-24.648 49.741-40.457 83.636-40.457 58.91 0 106.667 47.756 106.667 106.667s-47.756 106.667-106.667 106.667c-58.91 0-106.667-47.756-106.667-106.667 0-1.775 0.043-3.539 0.129-5.293l-236.19-142.216c-19.528 24.867-49.868 40.841-83.939 40.841-58.91 0-106.667-47.756-106.667-106.667s47.756-106.667 106.667-106.667c34.091 0 64.447 15.993 83.974 40.886zM234.667 554.667c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 341.333c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 768c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667z' />\n </svg>\n )\n\n case 'settings':\n return (\n <svg className='icon icon-share' viewBox='0 0 1024 1024'>\n <path d='M829.945 549.126c2.784-24.116 2.784-48.445 0.269-70.702-1.182-6.772-7.090-11.696-13.674-11.641-33.039 0.582-62.975-19.389-75.126-50.118s-3.971-65.772 20.504-87.92c4.293-3.894 4.818-10.455 1.003-15.228-14.831-18.927-31.796-36.079-50.521-51.087-4.614-3.687-11.301-3.148-16.127 2.145-15.732 16.059-37.322 25.023-59.382 24.831-9.828 0.044-19.574-1.802-29.307-5.686-30.997-13.082-50.429-44.232-48.535-78.046 0.365-5.803-3.87-10.878-9.583-11.551-23.919-2.769-48.074-2.831-71.958-0.192-5.836 0.654-10.191 5.68-10.009 11.47 1.121 33.146-18.329 63.547-49.925 76.834-8.987 3.423-18.538 5.129-27.498 5.028-22.472 0.224-44.067-8.707-60.526-25.487-2.197-2.386-5.29-3.748-8.24-3.758-2.663 0.016-5.248 0.905-7.105 2.334-19.136 15.052-36.496 32.233-51.558 50.977-3.729 4.732-3.187 11.536 1.058 15.449 24.89 22.573 32.935 58.34 19.426 90.928-14.22 29.886-44.875 48.43-77.941 47.151-5.576-0.215-10.363 3.934-11.003 10.013-2.916 24.025-2.916 48.315-0.231 70.764 1.178 6.84 7.155 11.808 14.518 11.713l2.428 0.007c31.565 0.659 59.701 20.063 71.6 49.499 12.239 30.769 4.278 65.898-20.252 88.586-4.217 3.829-4.736 10.275-0.976 14.991 14.777 18.932 31.665 36.115 50.227 51.128 4.694 3.762 11.505 3.223 16.349-2.081 15.725-16.101 37.337-25.092 59.378-24.895 9.894-0.057 19.705 1.819 29.5 5.78 30.753 13.169 50.063 44.084 48.378 77.965-0.373 5.795 3.857 10.867 9.602 11.539 23.908 2.78 48.053 2.842 71.923 0.192 5.851-0.659 10.215-5.702 10.027-11.562-1.088-33.118 18.371-63.473 49.584-76.583 9.014-3.552 18.622-5.354 27.841-5.307 22.555-0.225 44.218 8.804 60.434 25.505 2.224 2.395 5.343 3.76 8.371 3.769 2.474-0.012 4.874-0.847 6.896-2.43 19.227-14.971 36.653-32.121 51.726-50.848 3.737-4.743 3.194-11.563-0.941-15.379-24.391-21.907-32.789-56.564-21.134-87.207s40.964-50.957 73.904-51.116h5.704c5.586-0.028 10.269-4.227 10.905-9.777zM893.526 556.438c-4.321 37.715-36.171 66.271-74.323 66.464h-5.711c-6.33 0.031-11.99 3.953-14.24 9.87s-0.629 12.609 4.385 17.116c29.020 26.748 32.567 71.325 7.936 102.582-18.378 22.837-39.342 43.468-62.397 61.42-13.128 10.284-29.303 15.909-46.22 15.991-21.004-0.056-41.043-8.825-54.839-23.692-3.514-3.616-8.356-5.634-13.867-5.583-1.555-0.007-3.097 0.282-3.877 0.581-6.088 2.559-9.967 8.609-9.749 15.235 1.257 39.227-27.828 72.841-66.88 77.241-28.725 3.189-57.719 3.114-86.45-0.227-39.585-4.631-68.615-39.444-66.083-78.749 0.331-6.679-3.529-12.859-9.057-15.234-1.449-0.585-2.998-0.881-5.025-0.873-5.074-0.045-9.947 1.982-12.693 4.763-26.775 29.494-71.875 33.067-103.071 8.066-22.458-18.164-42.771-38.831-60.335-61.337-24.602-30.847-21.012-75.5 7.982-101.818 4.881-4.515 6.479-11.568 4.088-17.58-2.239-5.538-7.562-9.209-12.866-9.327-39.748 0.506-72.828-26.991-79.581-66.425-3.538-29.147-3.538-58.616-0.060-87.234 4.085-39.084 37.791-68.296 77.064-66.784 7.502 0.29 14.456-3.916 17.001-9.164 2.519-6.098 0.94-13.122-4.133-17.724-29.022-26.738-32.57-71.311-7.956-102.538 18.292-22.765 39.115-43.375 62.322-61.626 13.199-10.169 29.368-15.731 46.323-15.833 21.063 0.065 41.146 8.908 54.704 23.656 3.559 3.623 8.44 5.642 14.175 5.592 1.605 0.017 3.199-0.268 3.668-0.426 6.11-2.574 9.998-8.651 9.771-15.356-1.228-39.209 27.864-72.786 66.897-77.161 28.715-3.173 57.697-3.098 86.456 0.231 39.539 4.653 68.54 39.409 66.051 78.92-0.369 6.596 3.446 12.713 8.931 15.035 1.507 0.6 3.114 0.905 5.156 0.898 5.087 0.044 9.973-1.985 12.671-4.704 26.66-29.444 71.625-33.068 102.694-8.244 22.604 18.117 43.043 38.781 60.715 61.337 24.728 30.927 21.142 75.751-8.215 102.378-4.724 4.275-6.301 11.031-3.958 16.955s8.114 9.775 14.774 9.659c38.18-0.325 70.992 27.018 77.822 66.463 3.343 28.966 3.343 58.22 0 87.185zM511.951 597.037c47.144-0.118 85.24-38.367 85.169-85.511 0-34.617-20.872-65.819-52.867-79.034s-68.802-5.836-93.231 18.69c-24.429 24.527-31.66 61.363-18.317 93.305s44.628 52.688 79.245 52.55zM512.158 661.036c-60.477 0.242-115.178-36.032-138.507-91.881s-10.686-120.254 32.026-163.138c42.712-42.884 107.066-55.785 163.008-32.679s92.434 77.661 92.434 138.139c0.124 82.417-66.545 149.353-148.962 149.559z' />\n </svg>\n )\n\n case 'check':\n return (\n <svg className='icon check-icon' viewBox='0 0 1024 1024'>\n <path d='M342.481 563.894c-12.577-12.416-32.838-12.285-45.254 0.292s-12.285 32.838 0.292 45.254l118.857 117.333c13.275 13.105 34.901 12.123 46.933-2.131l297.143-352c11.4-13.505 9.694-33.694-3.811-45.094s-33.694-9.694-45.094 3.811l-274.828 325.566-94.238-93.030z' />\n </svg>\n )\n case 'language':\n return (\n <svg className='icon language-icon' viewBox='0 0 1024 1024'>\n <path d='M625.773 808.031c29.752-39.944 63.443-97.069 83.311-168.977 41.798-3.715 74.872-8.022 98.271-11.57-32.456 82.71-98.638 148.558-181.582 180.547zM216.562 627.283c23.516 3.506 56.799 7.797 98.279 11.528 19.868 72.017 53.601 129.224 83.378 169.219-83.002-32.014-149.226-97.945-181.657-180.747zM400.147 215.201c-29.835 40.32-64.161 98.037-84.572 169.695-42.123 3.731-75.423 8.072-98.938 11.629 32.698-83.353 99.656-149.61 183.51-181.323zM807.438 396.725c-23.641-3.523-57.158-7.847-98.947-11.587-20.402-71.766-54.778-129.567-84.639-169.937 83.912 31.73 150.912 98.070 183.585 181.523zM720.095 436.644c48.952 4.817 84.472 10.209 102.995 13.331 3.99 20.068 6.127 40.796 6.127 62.024 0 21.262-2.137 42.031-6.152 62.141-18.248 3.172-53.376 8.615-102.753 13.448 3.84-23.908 6.069-49.102 6.069-75.59 0-26.296-2.304-51.431-6.286-75.356zM537.043 597.206v-170.396c48.576 0.551 92.653 2.646 131.178 5.426 5.050 25.119 8.072 51.74 8.072 79.763 0 28.216-2.913 54.87-7.789 79.939-38.283 2.713-82.343 4.742-131.462 5.267zM486.957 195.859v180.856c-43.175 0.442-82.443 1.995-117.429 4.149 31.939-95.382 89.99-161.656 112.237-184.612 1.72-0.159 3.464-0.259 5.192-0.392zM542.286 196.26c22.297 22.906 80.456 89.080 112.345 184.771-35.261-2.229-74.646-3.848-117.587-4.307v-180.864c1.745 0.142 3.506 0.234 5.242 0.401zM347.706 512c0-28.074 3.047-54.762 8.156-79.955 38.191-2.696 82.134-4.708 131.094-5.234v170.387c-48.71-0.551-92.895-2.655-131.495-5.443-4.858-25.018-7.755-51.606-7.755-79.755zM194.783 512c0-21.262 2.137-42.031 6.144-62.125 18.282-3.181 53.501-8.64 103.012-13.482-4.007 24-6.319 49.219-6.319 75.606 0 26.396 2.221 51.506 6.027 75.339-48.826-4.808-84.246-10.184-102.737-13.306-3.99-20.068-6.127-40.804-6.127-62.033zM481.338 827.706c-22.389-22.314-81.016-87.469-112.662-184.779 35.437 2.262 75.047 3.898 118.28 4.366v180.839c-1.87-0.142-3.757-0.25-5.618-0.426zM542.653 827.706c-1.862 0.175-3.74 0.284-5.61 0.426v-180.839c43.509-0.442 83.044-2.012 118.222-4.199-31.672 97.244-90.265 162.349-112.612 184.612zM512 128c-211.734 0-384 172.257-384 384 0 211.734 172.266 384 384 384s384-172.266 384-384c0-211.743-172.266-384-384-384z' />\n </svg>\n )\n\n default:\n break;\n }\n }\n}\n\nexport default Icon;\n\n\n\n// WEBPACK FOOTER //\n// ./components/icon/icon.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/icon/icon.js","function n(n){return n&&\"object\"==typeof n&&\"default\"in n?n.default:n}function t(n){return null!==n&&void 0!==n}function r(n,t){var o=e({},n);for(var i in t)t.hasOwnProperty(i)&&(o[i]=n[i]&&t[i]&&\"object\"==typeof n[i]&&\"object\"==typeof t[i]?r(n[i],t[i]):n[i]||t[i]);return o}function e(n,t){for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function o(n){if(n=n||{},\"string\"==typeof n&&(n=n.split(\",\")),\"join\"in n){for(var t={},r=0;r<n.length;r++){var e=n[r].trim();e&&(t[e.split(\".\").pop()]=e)}return t}return n}function i(n,t){return v=t||h,n&&n.replace(/\\{\\{([\\w.-]+)\\}\\}/g,u)}function u(n,t){for(var r=t.split(\".\"),e=v,o=0;o<r.length;o++)if(null==(e=e[r[o]]))return\"\";return\"string\"==typeof e&&e.match(/\\{\\{/)&&(e=i(e,v)),e}function c(n,r,e,o,u,c){r&&(n=r+\".\"+n);var a=e&&f(e,n);return(u||0===u)&&a&&\"object\"==typeof a&&(a=a.splice?a[u]||a[0]:0===u&&t(a.none)?a.none:1===u&&t(a.one||a.singular)?a.one||a.singular:a.some||a.many||a.plural||a.other||a),a&&i(a,o)||c||null}function a(n,t,r){var i={};t=t||{},n=o(n);for(var u in n)if(n.hasOwnProperty(u)&&n[u]){var a=n[u];r||\"string\"!=typeof a?a.nodeName===g&&(a=e({fallback:a.children&&a.children[0]},a.attributes),i[u]=c(a.id,t.scope,t.dictionary,a.fields,a.plural,a.fallback)):i[u]=c(a,t.scope,t.dictionary)}return i}var l=require(\"preact\"),f=n(require(\"dlv\")),p=/[?&#]intl=show/,s=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getChildContext=function(){var n=this.props,t=n.scope,o=n.definition,i=n.mark,u=e({},this.context.intl||{});return t&&(u.scope=t),o&&(u.dictionary=r(u.dictionary||{},o)),(i||\"undefined\"!=typeof location&&String(location).match(p))&&(u.mark=!0),{intl:u}},t.prototype.render=function(n){var t=n.children;return t&&t[0]||null},t}(l.Component),d=function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];if(n.length>1){return y(n[0],n[1])}var r=n[0];return function(n){return y(n,r)}},y=function(n,t){return function(r){return l.h(s,t||{},l.h(n,r))}},h={},v,g=function(n,t){var r=n.id,e=n.children,o=n.plural,i=n.fields,u=t.intl,a=e&&e[0],p=c(r,u&&u.scope,u&&u.dictionary,i,o,a);if(u&&u.mark){var s=\"dictionary\"+(u&&u.scope?\".\"+u.scope:\"\")+\".\"+r;return l.h(\"mark\",{style:\"background: \"+(p?f(u,s)?\"rgba(119,231,117,.5)\":\"rgba(229,226,41,.5)\":\"rgba(228,147,51,.5)\"),title:r},p)}return p},b=function(n,t){var r=n.children,e=t.intl,o=r&&r[0];return o&&l.cloneElement(o,a(o.attributes,e,!0))},m=function(n){return function(t){return function(r,e){var o=\"function\"==typeof n?n(r):n,i=a(o,e.intl);return l.h(t,assign({},r,i))}}};d.intl=d,d.IntlProvider=s,d.Text=g,d.Localizer=b,d.withText=m,module.exports=d;\n//# sourceMappingURL=preact-i18n.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/preact-i18n/dist/preact-i18n.js\n// module id = 5\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/preact-i18n/dist/preact-i18n.js","import createStore from './createStore';\nimport combineReducers from './combineReducers';\nimport bindActionCreators from './bindActionCreators';\nimport applyMiddleware from './applyMiddleware';\nimport compose from './compose';\nimport warning from './utils/warning';\n\n/*\n* This is a dummy function to check if the function name has been altered by minification.\n* If the function has been minified and NODE_ENV !== 'production', warn the user.\n*/\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \\'production\\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { createStore, combineReducers, bindActionCreators, applyMiddleware, compose };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/index.js\n// module id = 6\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/index.js","/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nexport default function warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/utils/warning.js\n// module id = 7\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/utils/warning.js","//@flow\n\nexport const types = {\n ADD_PLAYER_CLASS: 'shell/ADD_PLAYER_CLASS',\n REMOVE_PLAYER_CLASS: 'shell/REMOVE_PLAYER_CLASS',\n UPDATE_IS_MOBILE: 'shell/UPDATE_IS_MOBILE'\n}\n\nexport const initialState = {\n playerClasses: []\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.ADD_PLAYER_CLASS:\n return {\n ...state,\n playerClasses: [...state.playerClasses, action.className]\n }\n\n case types.REMOVE_PLAYER_CLASS:\n return {\n ...state,\n playerClasses: state.playerClasses.filter(c => c !== action.className)\n }\n\n case types.UPDATE_IS_MOBILE:\n return {\n ...state,\n isMobile: action.isMobile\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n addPlayerClass: (className: string) => ({ type: types.ADD_PLAYER_CLASS, className }),\n removePlayerClass: (className: string) => ({ type: types.REMOVE_PLAYER_CLASS, className }),\n updateIsMobile: (isMobile: boolean) => ({ type: types.UPDATE_IS_MOBILE, isMobile })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/shell.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/shell.js","//@flow\n\nexport const types = {\n TOGGLE_PLAY: 'play-pause/TOGGLE_PLAY'\n}\n\nexport const initialState = {\n isPlaying: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.TOGGLE_PLAY:\n return {\n ...state,\n isPlaying: action.isPlaying\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n toggleIsPlaying: (isPlaying: boolean) => ({ type: types.TOGGLE_PLAY, isPlaying })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/play-pause.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/play-pause.js","//@flow\n\nexport const types = {\n TOGGLE_SHARE_OVERLAY: 'share/TOGGLE_SHARE_OVERLAY'\n}\n\nexport const initialState = {\n overlayOpen: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.TOGGLE_SHARE_OVERLAY:\n return {\n ...state,\n overlayOpen: action.show\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n toggleShareOverlay: (show: boolean) => ({ type: types.TOGGLE_SHARE_OVERLAY, show })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/share.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/share.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;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\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// ../node_modules/process/browser.js\n// module id = 11\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/process/browser.js","import isPlainObject from 'lodash-es/isPlainObject';\nimport $$observable from 'symbol-observable';\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nexport var ActionTypes = {\n INIT: '@@redux/INIT'\n\n /**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n};export default function createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n function getState() {\n return currentState;\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected listener to be a function.');\n }\n\n var isSubscribed = true;\n\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n isSubscribed = false;\n\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer;\n dispatch({ type: ActionTypes.INIT });\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object') {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return { unsubscribe: unsubscribe };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch({ type: ActionTypes.INIT });\n\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/createStore.js\n// module id = 12\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/createStore.js","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\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 * 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) || baseGetTag(value) != objectTag) {\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' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/isPlainObject.js\n// module id = 13\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/isPlainObject.js","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_Symbol.js\n// module id = 14\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_Symbol.js","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/webpack/buildin/global.js\n// module id = 15\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/webpack/buildin/global.js","/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nexport default function compose() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(undefined, arguments));\n };\n });\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/compose.js\n// module id = 16\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/compose.js","//@flow\nexport const types = {\n UPDATE_PLAYER_STATE: 'engine/UPDATE_PLAYER_STATE',\n UPDATE_IS_PLAYING: 'engine/UPDATE_IS_PLAYING',\n UPDATE_CURRENT_TIME: 'engine/UPDATE_CURRENT_TIME',\n UPDATE_DURATION: 'engine/UPDATE_DURATION',\n UPDATE_VOLUME: 'engine/UPDATE_VOLUME',\n UPDATE_MUTED: 'engine/UPDATE_MUTED',\n UPDATE_METADATA_LOADING_STATUS: 'engine/UPDATE_METADATA_LOADING_STATUS',\n UPDATE_AUDIO_TRACKS: 'engine/UPDATE_AUDIO_TRACKS',\n UPDATE_VIDEO_TRACKS: 'engine/UPDATE_VIDEO_TRACKS',\n UPDATE_TEXT_TRACKS: 'engine/UPDATE_TEXT_TRACKS'\n}\n\nexport const initialState = {\n\tisPlaying: false,\n metadataLoaded: false,\n playerState: {\n previousState: '',\n currentState: ''\n },\n currentTime: 0,\n duration: 0,\n volume: 1,\n muted: false,\n videoTracks: [],\n audioTracks: [],\n textTracks: []\n}\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_PLAYER_STATE:\n return {\n ...state,\n playerState: action.playerState\n }\n\n case types.UPDATE_IS_PLAYING:\n return {\n ...state,\n isPlaying: action.isPlaying\n }\n\n case types.UPDATE_CURRENT_TIME:\n return {\n ...state,\n currentTime: action.currentTime\n }\n\n case types.UPDATE_DURATION:\n return {\n ...state,\n duration: action.duration\n }\n\n case types.UPDATE_VOLUME:\n return {\n ...state,\n volume: action.volume\n }\n\n case types.UPDATE_MUTED:\n return {\n ...state,\n muted: action.muted\n }\n\n case types.UPDATE_METADATA_LOADING_STATUS:\n return {\n ...state,\n metadataLoaded: action.metadataLoaded\n }\n\n case types.UPDATE_AUDIO_TRACKS:\n return {\n ...state,\n audioTracks: action.tracks\n }\n\n case types.UPDATE_VIDEO_TRACKS:\n return {\n ...state,\n videoTracks: action.tracks\n }\n\n case types.UPDATE_TEXT_TRACKS:\n return {\n ...state,\n textTracks: action.tracks\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updatePlayerState: (prevoiusState: string, currentState: string) => ({ type: types.UPDATE_PLAYER_STATE, playerState: {prevoiusState, currentState} }),\n updateIsPlaying: (isPlaying: boolean) => ({ type: types.UPDATE_IS_PLAYING, isPlaying }),\n updateCurrentTime: (currentTime: number) => ({ type: types.UPDATE_CURRENT_TIME, currentTime }),\n updateDuration: (duration: number) => ({ type: types.UPDATE_DURATION, duration }),\n updateVolume: (volume: number) => ({ type: types.UPDATE_VOLUME, volume }),\n updateMuted: (muted: boolean) => ({ type: types.UPDATE_MUTED, muted }),\n updateMetadataLoadingStatus: (metadataLoaded: boolean) => ({ type: types.UPDATE_METADATA_LOADING_STATUS, metadataLoaded }),\n updateAudioTracks: (tracks) => ({ type: types.UPDATE_AUDIO_TRACKS, tracks }),\n updateVideoTracks: (tracks) => ({ type: types.UPDATE_VIDEO_TRACKS, tracks }),\n updateTextTracks: (tracks) => ({ type: types.UPDATE_TEXT_TRACKS, tracks })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/engine.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/engine.js","//@flow\n\nexport const types = {\n UPDATE_SEEKBAR_DRAGGING_STATUS: 'seekbar/UPDATE_SEEKBAR_DRAGGING_STATUS',\n UPDATE_CURRENT_TIME: 'seekbar/UPDATE_CURRENT_TIME',\n UPDATE_DURATION: 'seekbar/UPDATE_DURATION'\n}\n\nexport const initialState = {\n\tcurrentTime: 0,\n duration: 0,\n draggingActive: false\n}\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_SEEKBAR_DRAGGING_STATUS:\n return {\n ...state,\n draggingActive: action.draggingActive\n }\n\n case types.UPDATE_CURRENT_TIME:\n return {\n ...state,\n currentTime: action.currentTime\n }\n\n case types.UPDATE_DURATION:\n return {\n ...state,\n duration: action.duration\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateSeekbarDraggingStatus: (draggingActive: boolean) => ({ type: types.UPDATE_SEEKBAR_DRAGGING_STATUS, draggingActive }),\n updateDuration: (duration: number) => ({ type: types.UPDATE_DURATION, duration }),\n updateCurrentTime: (currentTime: number) => ({ type: types.UPDATE_CURRENT_TIME, currentTime })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/seekbar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/seekbar.js","//@flow\n\nexport const types = {\n UPDATE_VOLUME: 'volume/UPDATE_VOLUME',\n UPDATE_VOLUME_DRAGGING_STATUS: 'volume/UPDATE_VOLUME_DRAGGING_STATUS',\n UPDATE_MUTED: 'volume/UPDATE_MUTED'\n}\n\nexport const initialState = {\n draggingActive: false,\n volume: 1,\n muted: false\n}\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_VOLUME:\n return {\n ...state,\n volume: action.volume\n }\n\n case types.UPDATE_VOLUME_DRAGGING_STATUS:\n return {\n ...state,\n draggingActive: action.draggingActive\n }\n\n case types.UPDATE_MUTED:\n return {\n ...state,\n muted: action.muted\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateVolume: (volume: number) => ({ type: types.UPDATE_VOLUME, volume }),\n updateVolumeDraggingStatus: (draggingActive: boolean) => ({ type: types.UPDATE_VOLUME_DRAGGING_STATUS, draggingActive }),\n updateMuted: (muted: boolean) => ({ type: types.UPDATE_MUTED, muted })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/volume.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/volume.js","//@flow\nexport const types = {\n UPDATE_FULLSCREEN: 'fullscreen/UPDATE_FULLSCREEN'\n}\n\nexport const initialState = {\n fullscreen: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_FULLSCREEN:\n return {\n ...state,\n fullscreen: action.fullscreen\n }\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateFullscreen: (fullscreen: boolean) => ({ type: types.UPDATE_FULLSCREEN, fullscreen })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/fullscreen.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/fullscreen.js","//@flow\n\nexport const types = {\n UPDATE_LOADING_SPINNER_STATE: 'loading/UPDATE_LOADING_SPINNER_STATE'\n}\n\nexport const initialState = {\n showLoadingSpinner: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_LOADING_SPINNER_STATE:\n return {\n ...state,\n show: action.show\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateLoadingSpinnerState: (show: boolean) => ({ type: types.UPDATE_LOADING_SPINNER_STATE, show })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/loading.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/loading.js","//@flow\n\nexport const types = {\n TOGGLE_CVAA_OVERLAY: 'share/TOGGLE_CVAA_OVERLAY'\n}\n\nexport const initialState = {\n overlayOpen: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.TOGGLE_CVAA_OVERLAY:\n return {\n ...state,\n overlayOpen: action.show\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n toggleCVAAOverlay: (show: boolean) => ({ type: types.TOGGLE_CVAA_OVERLAY, show })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/cvaa.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/cvaa.js","//@flow\n\nexport const types = {\n UPDATE_QUALITY: 'settings/UPDATE_QUALITY',\n UPDATE_SPEED: 'settings/UPDATE_SPEED'\n}\n\nexport const initialState = {\n quality: 1,\n speed: 2\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_QUALITY:\n return {\n ...state,\n quality: action.quality\n }\n\n case types.UPDATE_SPEED:\n return {\n ...state,\n speed: action.speed\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateQuality: (quality: string) => ({ type: types.UPDATE_QUALITY, quality }),\n updateSpeed: (speed: string) => ({ type: types.UPDATE_SPEED, speed })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/settings.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/settings.js","//@flow\n\nfunction toHHMMSS(input) {\n var sec_num = parseInt(input, 10);\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n var seconds = sec_num - (hours * 3600) - (minutes * 60);\n\n if (hours < 10) {hours = \"0\"+hours;}\n if (minutes < 10) {minutes = \"0\"+minutes;}\n if (seconds < 10) {seconds = \"0\"+seconds;}\n\n return `${minutes}:${seconds}`;\n}\n\nexport {toHHMMSS};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/time-format.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/time-format.js","//@flow\nimport { h, Component } from 'preact';\n\nclass SmartContainer extends Component {\n render(props) {\n return (\n <div className='smart-container top left'>\n {props.children}\n </div>\n )\n }\n}\n\nexport default SmartContainer;\n\n\n\n// WEBPACK FOOTER //\n// ./components/smart-container/smart-container.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/smart-container/smart-container.js","//@flow\nimport { h, Component } from 'preact';\nimport DropDownMenu from '../dropdown-menu/dropdown-menu';\n\nclass SmartContainer extends Component {\n render(props) {\n return (\n <div className='smart-container-item select-menu-item'>\n <label htmlFor='quality'>{props.label}</label>\n <DropDownMenu onSelect={o => props.onSelect(o)} options={props.options} />\n </div>\n )\n }\n}\n\nexport default SmartContainer;\n\n\n\n// WEBPACK FOOTER //\n// ./components/smart-container/smart-container-item.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/smart-container/smart-container-item.js","//@flow\nimport { h, Component } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/shell';\nimport Icon from '../icon/icon';\n\n@connect(null, bindActions(actions))\nclass Overlay extends Component {\n\n componentDidUpdate() {\n this.props.open ? this.props.addPlayerClass('overlay-active') : this.props.removePlayerClass('overlay-active');\n }\n\n render(props) {\n var overlayClass = 'overlay';\n if (props.type) overlayClass += ` ${props.type}-overlay`;\n if (props.open) overlayClass += ' active'\n\n return (\n <div className={overlayClass} role='dialog'>\n <Localizer>\n <a onClick={() => props.onClose()} aria-label={<Text id='core.close' />} className='close-overlay'><Icon type='close' /></a>\n </Localizer>\n { props.children }\n </div>\n )\n }\n}\n\nexport default Overlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/overlay/overlay.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/overlay/overlay.js","//@flow\nimport {h, render} from 'preact';\nimport {Provider} from 'preact-redux';\nimport {IntlProvider} from 'preact-i18n';\nimport { createStore } from 'redux';\n\nimport reducer from './store';\nimport definition from './fr.json';\n\nimport EngineConnector from './components/engine-connector/engine-connector';\nimport Shell from './components/shell/shell';\nimport OverlayPlay from './components/overlay-play/overlay-play';\nimport Loading from './components/loading/loading';\nimport PlayPauseControl from './components/play-pause/play-pause';\nimport SeekBarControl from './components/seekbar/seekbar';\nimport VolumeControl from './components/volume/volume';\nimport ShareControl from './components/share/share'\nimport SettingsControl from './components/settings/settings';\nimport LanguageControl from './components/language/language';\nimport FullscreenControl from './components/fullscreen/fullscreen';\nimport TimeDisplay from './components/time-display/time-display';\nimport TopBar from './components/top-bar/top-bar';\nimport BottomBar from './components/bottom-bar/bottom-bar';\nimport ShareOverlay from './components/share-overlay/share-overlay';\nimport CVAAOverlay from './components/cvaa-overlay/cvaa-overlay';\nimport KeyboardControl from './components/keyboard';\n\nclass UIManager {\n player: any;\n config: any;\n\n constructor(player, config) {\n this.player = player;\n this.config = config;\n this.config.ui = {\n \"translations\": {\n \"controls\": {\n \"language\": \"שפה\"\n }\n },\n \"components\": {\n \"Loading\": {\n \"enabled\": true\n },\n \"OverlayPlay\": {\n \"enabled\": true\n }\n }\n }\n }\n\n buildCustomUI(template): void {\n this._buildUI(template);\n }\n\n buildDefaultUI(): void {\n const store = createStore(reducer, window.devToolsExtension && window.devToolsExtension({ name: `playkit #${this.config.target}`, instanceId: this.config.target }));\n\n let template = (\n <Provider store={store}>\n <IntlProvider definition={definition}>\n <Shell>\n <div className='player-holder' />\n <EngineConnector player={this.player} />\n <KeyboardControl player={this.player} />\n <Loading player={this.player} />\n <div className='player-gui'>\n <OverlayPlay player={this.player} />\n <TopBar>\n <div className='left-controls'>\n <div className='video-playing-title'>L21 Earth Time Lapse View from Space, ISS</div>\n </div>\n <div className='right-controls'>\n <ShareControl player={this.player} />\n </div>\n </TopBar>\n <BottomBar>\n <SeekBarControl showFramePreview showTimeBubble player={this.player} />\n <div className='left-controls'>\n <PlayPauseControl player={this.player} />\n <TimeDisplay format='current / total' player={this.player} />\n </div>\n <div className='right-controls'>\n <VolumeControl player={this.player} />\n <LanguageControl player={this.player} />\n <SettingsControl player={this.player} />\n <FullscreenControl player={this.player} />\n </div>\n </BottomBar>\n <ShareOverlay />\n <CVAAOverlay />\n </div>\n </Shell>\n </IntlProvider>\n </Provider>\n );\n this._buildUI(template);\n }\n\n _buildUI(template) {\n if (!this.player) return;\n\n let playerWrapper = document.createElement('div');\n document.body.appendChild(playerWrapper);\n render(template, playerWrapper);\n\n let playerElement = document.getElementsByTagName('video')[this.config.target === 'player1' ? 0 : 1];\n // let playerElement = document.getElementById(this.config.target); // the right way\n playerElement.removeAttribute('style');\n playerWrapper.getElementsByClassName('player-holder')[0].appendChild(playerElement);\n }\n\n release(): void { }\n\n}\n\nexport default UIManager;\n\n\n\n\n// WEBPACK FOOTER //\n// ./ui-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/ui-manager.js","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_baseGetTag.js\n// module id = 29\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_baseGetTag.js","import freeGlobal from './_freeGlobal.js';\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\nexport default root;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_root.js\n// module id = 30\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_root.js","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_freeGlobal.js\n// module id = 31\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_freeGlobal.js","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\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 nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_getRawTag.js\n// module id = 32\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_getRawTag.js","/** 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 nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_objectToString.js\n// module id = 33\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_objectToString.js","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_getPrototype.js\n// module id = 34\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_getPrototype.js","/**\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\nexport default overArg;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_overArg.js\n// module id = 35\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_overArg.js","/**\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 != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/isObjectLike.js\n// module id = 36\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/isObjectLike.js","module.exports = require('./lib/index');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/symbol-observable/index.js\n// module id = 37\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/symbol-observable/index.js","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _ponyfill = require('./ponyfill');\n\nvar _ponyfill2 = _interopRequireDefault(_ponyfill);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar root; /* global window */\n\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = (0, _ponyfill2['default'])(root);\nexports['default'] = result;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/symbol-observable/lib/index.js\n// module id = 38\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/symbol-observable/lib/index.js","module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tif(!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, \"loaded\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"id\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/webpack/buildin/module.js\n// module id = 39\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/webpack/buildin/module.js","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\nexports['default'] = symbolObservablePonyfill;\nfunction symbolObservablePonyfill(root) {\n\tvar result;\n\tvar _Symbol = root.Symbol;\n\n\tif (typeof _Symbol === 'function') {\n\t\tif (_Symbol.observable) {\n\t\t\tresult = _Symbol.observable;\n\t\t} else {\n\t\t\tresult = _Symbol('observable');\n\t\t\t_Symbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/symbol-observable/lib/ponyfill.js\n// module id = 40\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/symbol-observable/lib/ponyfill.js","import { ActionTypes } from './createStore';\nimport isPlainObject from 'lodash-es/isPlainObject';\nimport warning from './utils/warning';\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionName = actionType && '\"' + actionType.toString() + '\"' || 'an action';\n\n return 'Given action ' + actionName + ', reducer \"' + key + '\" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return 'The ' + argumentName + ' has unexpected type of \"' + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + '\". Expected argument to be an object with the following ' + ('keys: \"' + reducerKeys.join('\", \"') + '\"');\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n\n if (unexpectedKeys.length > 0) {\n return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('\"' + unexpectedKeys.join('\", \"') + '\" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('\"' + reducerKeys.join('\", \"') + '\". Unexpected keys will be ignored.');\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, { type: ActionTypes.INIT });\n\n if (typeof initialState === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');\n }\n\n var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');\n if (typeof reducer(undefined, { type: type }) === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined when probed with a random type. ' + ('Don\\'t try to handle ' + ActionTypes.INIT + ' or other actions in \"redux/*\" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');\n }\n });\n}\n\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\nexport default function combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning('No reducer provided for key \"' + key + '\"');\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n var finalReducerKeys = Object.keys(finalReducers);\n\n var unexpectedKeyCache = void 0;\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError = void 0;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments[1];\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n return hasChanged ? nextState : state;\n };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/combineReducers.js\n// module id = 41\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/combineReducers.js","import warning from './utils/warning';\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(undefined, arguments));\n };\n}\n\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass a single function as the first argument,\n * and get a function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\nexport default function bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?');\n }\n\n var keys = Object.keys(actionCreators);\n var boundActionCreators = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var actionCreator = actionCreators[key];\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n } else {\n warning('bindActionCreators expected a function actionCreator for key \\'' + key + '\\', instead received type \\'' + typeof actionCreator + '\\'.');\n }\n }\n return boundActionCreators;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/bindActionCreators.js\n// module id = 42\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/bindActionCreators.js","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nimport compose from './compose';\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\nexport default function applyMiddleware() {\n for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function (reducer, preloadedState, enhancer) {\n var store = createStore(reducer, preloadedState, enhancer);\n var _dispatch = store.dispatch;\n var chain = [];\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch(action) {\n return _dispatch(action);\n }\n };\n chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(undefined, chain)(store.dispatch);\n\n return _extends({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/applyMiddleware.js\n// module id = 43\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/applyMiddleware.js","!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):e.dlv=n()}(this,function(){function e(e,n,t,o){for(o=0,n=n.split?n.split(\".\"):n;e&&o<n.length;)e=e[n[o++]];return void 0===e?t:e}return e});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/dlv/dist/dlv.umd.js\n// module id = 44\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/dlv/dist/dlv.umd.js","//@flow\nimport { combineReducers } from 'redux';\nimport engine from './reducers/engine';\nimport shell from './reducers/shell';\nimport playPause from './reducers/play-pause';\nimport seekbar from './reducers/seekbar';\nimport volume from './reducers/volume';\nimport fullscreen from './reducers/fullscreen';\nimport loading from './reducers/loading';\nimport share from './reducers/share';\nimport cvaa from './reducers/cvaa';\nimport settings from './reducers/settings';\n\nconst reducer = combineReducers({\n engine,\n shell,\n seekbar,\n volume,\n fullscreen,\n loading,\n playPause,\n share,\n cvaa,\n settings\n});\n\nexport default reducer;\n\n\n\n// WEBPACK FOOTER //\n// ./store.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/store.js","module.exports = {\n\t\"core\": {\n\t\t\"disable\": \"Disable\",\n\t\t\"auto\": \"Auto\",\n\t\t\"close\": \"Close\"\n\t},\n\t\"controls\": {\n\t\t\"play\": \"Play\",\n\t\t\"pause\": \"Pause\",\n\t\t\"share\": \"Share\",\n\t\t\"language\": \"Language\",\n\t\t\"settings\": \"Settings\",\n\t\t\"fullscreen\": \"Fullscreen\"\n\t},\n\t\"settings\": {\n\t\t\"quality\": \"Quality\",\n\t\t\"speed\": \"Speed\"\n\t},\n\t\"language\": {\n\t\t\"audio\": \"Audio\",\n\t\t\"captions\": \"Captions\",\n\t\t\"advanced_captions_settings\": \"Advanced captions settings\"\n\t},\n\t\"share\": {\n\t\t\"share_title\": \"Partager\",\n\t\t\"link_options\": \"Options de lien\"\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./fr.json\n// module id = 46\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/fr.json","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { default as reduce, actions } from '../../reducers/engine';\nimport BaseComponent from '../base';\n\n@connect(reduce, bindActions(actions))\nclass EngineConnector extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'EngineConnector', player: obj.player});\n }\n\n componentDidMount() {\n this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED, (e) => {\n this.props.updatePlayerState(e.payload.oldState.type, e.payload.newState.type);\n });\n\n this.player.addEventListener(this.player.Event.TIME_UPDATE, () => {\n this.props.updateCurrentTime(this.player.currentTime);\n });\n\n this.player.addEventListener(this.player.Event.LOADED_METADATA, () => {\n this.props.updateDuration(this.player.duration);\n this.props.updateMetadataLoadingStatus(true);\n\n const TrackType = this.player.Track;\n let audioTracks = this.player.getTracks(TrackType.AUDIO);\n let videoTracks = this.player.getTracks(TrackType.VIDEO);\n let textTracks = this.player.getTracks(TrackType.TEXT);\n this.props.updateAudioTracks(audioTracks);\n this.props.updateVideoTracks(videoTracks);\n this.props.updateTextTracks(textTracks);\n });\n\n this.player.addEventListener(this.player.Event.VOLUME_CHANGE, () => {\n this.props.updateVolume(this.player.volume);\n });\n\n this.player.addEventListener(this.player.Event.PLAY, () => {\n this.props.updateIsPlaying(true);\n });\n\n this.player.addEventListener(this.player.Event.PAUSE, () => {\n this.props.updateIsPlaying(false);\n });\n }\n\n shouldComponentUpdate() { return false; }\n\n render() {\n return <span />\n }\n}\n\nexport default EngineConnector;\n\n\n\n// WEBPACK FOOTER //\n// ./components/engine-connector/engine-connector.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/engine-connector/engine-connector.js","module.exports = __WEBPACK_EXTERNAL_MODULE_48__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}\n// module id = 48\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/ui/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","//@flow\nimport * as JsLogger from 'js-logger';\n\nconst LOG_LEVEL: { [level: string]: Object } = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nclass LoggerFactory {\n constructor(options?: Object) {\n JsLogger.useDefaults(options || {});\n }\n\n getLogger(name?: string) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n}\n\nconst lf = new LoggerFactory({defaultLevel: JsLogger.DEBUG});\n\nexport default lf;\nexport {LOG_LEVEL};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/logger.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/logger.js","/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (typeof define === 'function' && define.amd) {\r\n\t\tdefine(Logger);\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/js-logger/src/logger.js\n// module id = 50\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/js-logger/src/logger.js","//@flow\nimport { h } from 'preact';\nimport BaseComponent from '../base';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/shell';\nimport { isMobile } from '../../utils/is-mobile';\n\nconst mapStateToProps = state => ({\n metadataLoaded: state.engine.metadataLoaded,\n currentState: state.engine.playerState.currentState,\n playerClasses: state.shell.playerClasses,\n isMobile: state.shell.isMobile\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass Shell extends BaseComponent {\n constructor() {\n super({name: 'Shell'});\n }\n\n componentDidMount() {\n this.props.updateIsMobile(isMobile());\n }\n\n render(props) {\n var playerClasses = 'player skin-default';\n playerClasses += ` ${props.playerClasses.join(' ')}`;\n\n if (this.props.metadataLoaded) playerClasses += ` metadata-loaded`;\n if (this.props.metadataLoaded) playerClasses += ` state-${this.props.currentState}`;\n\n return (\n <div className={playerClasses}>\n { props.children }\n </div>\n )\n }\n}\n\nexport default Shell;\n\n\n\n// WEBPACK FOOTER //\n// ./components/shell/shell.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/shell/shell.js","//@flow\n\nfunction isMobile() {\n return typeof window.orientation !== \"undefined\" || navigator.userAgent.indexOf(\"IEMobile\") !== -1;\n}\n\nexport {isMobile}\n\n\n\n// WEBPACK FOOTER //\n// ./utils/is-mobile.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/is-mobile.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/play-pause';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n isPlaying: state.engine.isPlaying\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass OverlayPlay extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'OverlayPlay', player: obj.player});\n }\n\n togglePlayPause() {\n this.logger.debug('Toggle play');\n this.setState({animation: true});\n setTimeout(() => {\n this.setState({animation: false});\n }, 400);\n if (this.player.paused) {\n this.player.play();\n }\n else {\n this.player.pause();\n }\n }\n\n render(props) {\n return (\n <div className={`overlay-play ${this.state.animation ? 'in' : ''}`} onClick={() => this.togglePlayPause()}>\n { props.isPlaying ? <Icon type='play' /> : <Icon type='pause' /> }\n </div>\n )\n }\n}\n\nexport default OverlayPlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/overlay-play/overlay-play.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/overlay-play/overlay-play.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/loading';\nimport BaseComponent from '../base';\n\nconst mapStateToProps = state => ({\n show: state.loading.show\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass Loading extends BaseComponent {\n constructor(obj: IControlParams) {\n super({name: 'Loading', player: obj.player});\n }\n\n componentDidMount() {\n this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED, e => {\n if (e.payload.newState.type === 'idle' || e.payload.newState.type === 'playing' || e.payload.newState.type === 'paused') {\n this.props.updateLoadingSpinnerState(false);\n }\n else {\n this.props.updateLoadingSpinnerState(true);\n }\n });\n }\n\n render(props) {\n return (\n <div className={props.show ? 'loading-backdrop show' : 'loading-backdrop'}>\n <div className='spinner-container'>\n <div className='spinner'>\n {[...Array(8)].map(() => <span />)}\n </div>\n </div>\n </div>\n )\n }\n\n}\n\nexport default Loading;\n\n\n\n// WEBPACK FOOTER //\n// ./components/loading/loading.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/loading/loading.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/play-pause';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n isPlaying: state.engine.isPlaying\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass PlayPauseControl extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'PlayPause', player: obj.player});\n }\n\n togglePlayPause() {\n this.logger.debug('Toggle play');\n if (this.player.paused) {\n this.player.play();\n }\n else {\n this.player.pause();\n }\n }\n\n render() {\n var controlButtonClass = this.props.isPlaying ? 'control-button is-playing' : 'control-button';\n\n return (\n <div className='control-button-container control-play-pause'>\n <Localizer>\n <button aria-label={<Text id={this.props.isPlaying ? 'controls.pause' : 'controls.play'} />} className={controlButtonClass} onClick={() => this.togglePlayPause()}>\n <Icon type='play' />\n <Icon type='pause' />\n </button>\n </Localizer>\n </div>\n )\n }\n}\n\nexport default PlayPauseControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/play-pause/play-pause.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/play-pause/play-pause.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/seekbar';\nimport BaseComponent from '../base';\nimport { toHHMMSS } from '../../utils/time-format';\n\nconst mapStateToProps = state => ({\n virtualProgress: state.seekbar.virtualTime,\n currentTime: state.seekbar.currentTime,\n duration: state.engine.duration,\n isDraggingActive: state.seekbar.draggingActive\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass SeekBarControl extends BaseComponent {\n _seekBarElement: HTMLElement;\n _playerElement: HTMLElement;\n\n constructor(obj: IControlParams) {\n super({name: 'SeekBar', player: obj.player});\n }\n\n componentDidMount() {\n this._playerElement = document.getElementsByClassName('player')[0];\n this._seekBarElement = document.getElementsByClassName('seek-bar')[0];\n\n this.setState({virtualTime: 0});\n\n this.player.addEventListener(this.player.Event.TIME_UPDATE, () => {\n this.props.updateCurrentTime(this.player.currentTime);\n });\n }\n\n onSeekbarMouseDown = e => {\n this.props.updateSeekbarDraggingStatus(true);\n if (this.props.isDraggingActive) {\n let time = this.getTime(e);\n this.updateSeekBarProgress(time, this.player.duration);\n }\n }\n\n onSeekbarMouseUp = e => {\n let time = this.getTime(e);\n this.player.currentTime = time;\n this.updateSeekBarProgress(time, this.player.duration);\n this.props.updateSeekbarDraggingStatus(false);\n this.logger.debug(`Seek to ${time}s`);\n }\n\n onSeekbarMouseMove = e => {\n let time = this.getTime(e);\n this.updateSeekBarProgress(time, this.player.duration, true);\n\n if (this.props.isDraggingActive) {\n this.updateSeekBarProgress(time, this.player.duration);\n }\n }\n\n updateSeekBarProgress(currentTime: number, duration: number, virtual: boolean = false) {\n if (virtual) {\n this.setState({virtualTime: currentTime});\n }\n else {\n this.props.updateCurrentTime(currentTime);\n }\n }\n\n getTime(e: Event): Number {\n let time = this.player.duration * ((e.clientX - this._seekBarElement.offsetLeft - this._playerElement.offsetLeft) / this._seekBarElement.clientWidth);\n time = parseFloat(time.toFixed(2));\n if (time < 0) return 0;\n if (time > this.player.duration) return this.player.duration;\n return time;\n }\n\n getThumbSpriteOffset() {\n return - (Math.ceil(100 * this.state.virtualTime / this.player.duration) * 160) + 'px 0px';\n }\n\n render(props) {\n var virtualProgressWidth = `${this.state.virtualTime / props.duration * 100}%`;\n var progressWidth = `${props.currentTime / props.duration * 100}%`;\n var framePreviewStyle = 'background-image: url(http://cfvod.kaltura.com/p/1914121/sp/191412100/thumbnail/entry_id/1_fet8ffop/version/100001/width/160/vid_slices/100); ';\n framePreviewStyle += `background-position: ${this.getThumbSpriteOffset()}`\n\n return (\n <div className='seek-bar' role='slider'\n aria-label='Seek slider' aria-valuemin='0' aria-valuemax={Math.round(this.player.duration)} aria-valuenow={Math.round(this.player.currentTime)}\n aria-valuetext={`${toHHMMSS(this.player.currentTime)} of ${toHHMMSS(this.player.duration)}`}\n onMouseMove={e => this.onSeekbarMouseMove(e)} onMouseDown={e => this.onSeekbarMouseDown(e)} onMouseUp={e => this.onSeekbarMouseUp(e)}>\n <div className='progress-bar'>\n <div className='progress' style={{width: progressWidth}}>\n <a className='scrubber' />\n </div>\n <div className='virtual-progress' style={{width: virtualProgressWidth}}>\n {\n props.showFramePreview ?\n (<div className='frame-preview'>\n <div className='frame-preview-img' style={framePreviewStyle} />\n </div>) : ''\n }\n { this.props.showTimeBubble ? <div className='time-preview'>{ toHHMMSS(this.state.virtualTime)}</div> : '' }\n </div>\n <div className='buffered' style='width: 60%;' />\n </div>\n </div>\n )\n }\n\n}\nexport default SeekBarControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/seekbar/seekbar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/seekbar/seekbar.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/volume';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n isDraggingActive: state.volume.isDraggingActive,\n volume: state.volume.volume,\n muted: state.volume.muted,\n isMobile: state.shell.isMobile\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass VolumeControl extends BaseComponent {\n _volumeControlElement: HTMLElement;\n _volumeProgressBarElement: HTMLElement;\n\n constructor(obj: IControlParams) {\n super({name: 'Volume', player: obj.player});\n }\n\n componentDidMount() {\n this._volumeControlElement = document.getElementsByClassName('volume-control')[0];\n this._volumeProgressBarElement = this._volumeControlElement.getElementsByClassName('bar')[0];\n\n this.player.addEventListener(this.player.Event.LOADED_METADATA, () => {\n this.props.updateVolume(this.player.volume);\n })\n\n this.player.addEventListener(this.player.Event.VOLUME_CHANGE, () => {\n this.props.updateVolume(this.player.volume);\n });\n }\n\n getVolumeProgessHeight(): string {\n return this.props.muted ? '0%' : Math.round(this.props.volume * 100) + '%';\n }\n\n onVolumeProgressBarMouseDown() {\n this.props.updateVolumeDraggingStatus(true);\n }\n\n onVolumeProgressBarClick(e: Event) {\n this.changeVolume(e);\n }\n\n onVolumeControlButtonClick() {\n this.logger.debug(`Toggle mute. ${this.player.muted} => ${!this.player.muted}`);\n this.props.updateMuted(!this.props.muted);\n this.player.muted = !this.player.muted;\n }\n\n changeVolume(e: Event) {\n let barHeight = this._volumeProgressBarElement.clientHeight;\n let topY = this.getCoords(this._volumeProgressBarElement).top;\n let clickY = e.clientY;\n let volume = 1 - ((clickY - topY) / barHeight);\n volume = parseFloat(volume.toFixed(2));\n this.logger.debug(`Change volume from ${this.player.volume} => ${volume}`);\n this.player.volume = volume;\n if (this.props.muted) {\n this.player.muted = false;\n this.props.updateMuted(false);\n }\n }\n\n getCoords(el: HTMLElement): {top: number, left: number} {\n let box = el.getBoundingClientRect();\n\n return {\n top: box.top + pageYOffset,\n left: box.left + pageXOffset\n }\n }\n\n render() {\n var controlButtonClass = 'control-button-container volume-control';\n if (this.props.isDraggingActive) controlButtonClass += ' dragging-active';\n if (this.props.muted || this.props.volume === 0) controlButtonClass += ' is-muted';\n\n if (!this.props.isMobile) return false;\n\n return (\n <div className={controlButtonClass}>\n <button className='control-button' onClick={() => this.onVolumeControlButtonClick()} aria-label='Volume'>\n <Icon type='volume-base' />\n <Icon type='volume-waves' />\n <Icon type='volume-mute' />\n </button>\n <div className='volume-control-bar' role='slider'\n aria-valuemin='0' aria-valuemaz='100' aria-valuenow={this.player.volume * 100}\n aria-valuetext={`${this.player.volume * 100}% volume ${this.player.muted ? 'muted' : ''}`}>\n <div className='bar' onMouseDown={() => this.onVolumeProgressBarMouseDown()} onClick={e => this.onVolumeProgressBarClick(e)}>\n <div className='progress' style={{height: this.getVolumeProgessHeight()}} />\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default VolumeControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/volume/volume.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/volume/volume.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/share';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n overlayOpen: state.share.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass ShareControl extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'Share', player: obj.player});\n }\n\n render(props) {\n return (\n <div className='control-button-container control-share'>\n <button className='control-button control-button-rounded' onClick={() => props.toggleShareOverlay(!props.overlayOpen)} aria-label='Share'>\n <Icon type='share' />\n </button>\n </div>\n )\n }\n}\n\nexport default ShareControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/share/share.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/share/share.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/settings';\nimport BaseComponent from '../base';\nimport SmartContainer from '../smart-container/smart-container';\nimport SmartContainerItem from '../smart-container/smart-container-item';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n videoTracks: state.engine.videoTracks\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass SettingsControl extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'Settings', player: obj.player});\n }\n\n componentDidMount() {\n this.setState({smartContainerOpen: false});\n }\n\n onControlButtonClick() {\n this.setState({smartContainerOpen: !this.state.smartContainerOpen});\n }\n\n onSpeedChange(o) {\n this.props.updateSpeed(o.value);\n }\n\n onQualityChange(o) {\n this.props.updateQuality(o.value);\n }\n\n render(props) {\n var speedOptions = [\n { value: 1, label: 'Auto (360)', active: true },\n { value: 2, label: '240' },\n { value: 3, label: '144' }\n ]\n return (\n <div className='control-button-container control-settings'>\n <Localizer>\n <button aria-label={<Text id='controls.settings' />} className={this.state.smartContainerOpen ? 'control-button active' : 'control-button'} onClick={() => this.onControlButtonClick()}>\n <Icon type='settings' />\n </button>\n </Localizer>\n { !this.state.smartContainerOpen ? '' :\n <SmartContainer>\n {\n props.videoTracks.length <= 0 ? '' :\n <Localizer>\n <SmartContainerItem label={<Text id='settings.quality' />} options={qualityOptions} onSelect={(o) => this.onQualityChange(o)} />\n </Localizer>\n }\n <Localizer>\n <SmartContainerItem label={<Text id='settings.speed' />} options={speedOptions} onSelect={(o) => this.onSpeedChange(o)} />\n </Localizer>\n </SmartContainer>\n }\n </div>\n )\n }\n}\n\nexport default SettingsControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/settings/settings.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/settings/settings.js","//@flow\nimport { h, Component } from 'preact';\nimport Icon from '../icon/icon';\n\nclass DropDownMenu extends Component {\n\n componentWillMount() {\n this.setState({dropMenuActive: false});\n }\n\n isSelected(o): boolean {\n return o.active;\n }\n\n onSelect(o) {\n this.props.onSelect(o);\n this.setState({dropMenuActive: false});\n }\n\n render(props) {\n return (\n <div className='dropdown top left'>\n <div className='dropdown-button' onClick={() => this.setState({dropMenuActive: !this.state.dropMenuActive})}>\n {props.options.filter(t => t.active).length > 0 ? props.options.filter(t => t.active)[0].label : ''}\n </div>\n {\n !this.state.dropMenuActive ? '' :\n <div className='dropdown-menu'>\n {\n props.options.map(o => (\n <div className={this.isSelected(o) ? 'dropdown-menu-item active' : 'dropdown-menu-item'} onClick={() => this.onSelect(o)}>\n <span>{o.label}</span>\n { this.isSelected(o) ? <Icon type='check' /> : '' }\n </div>\n ))\n }\n </div>\n }\n </div>\n )\n }\n}\n\nexport default DropDownMenu;\n\n\n\n// WEBPACK FOOTER //\n// ./components/dropdown-menu/dropdown-menu.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/dropdown-menu/dropdown-menu.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport BaseComponent from '../base';\nimport SmartContainer from '../smart-container/smart-container';\nimport SmartContainerItem from '../smart-container/smart-container-item';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n audioTracks: state.engine.audioTracks,\n textTracks: state.engine.textTracks\n});\n\n@connect(mapStateToProps)\nclass LanguageControl extends BaseComponent {\n constructor(obj: IControlParams) {\n super({name: 'LanguageControl', player: obj.player});\n }\n\n componentDidMount() {\n this.setState({smartContainerOpen: false});\n }\n\n onControlButtonClick() {\n this.setState({smartContainerOpen: !this.state.smartContainerOpen});\n }\n\n onAudioChange(audioTrack) {\n // this.player.selectTrack(audioTrack);\n this.player._engine.selectTextTrack(audioTrack); // workaround untill bug fixed in playkit-js\n }\n\n onCaptionsChange(textTrack) {\n // this.player.selectTrack(textTrack);\n this.player._engine.selectTextTrack(textTrack); // workaround untill bug fixed in playkit-js\n }\n\n render(props) {\n return props.audioTracks.length === 0 && props.audioTracks.length === 0 ? false : (\n <div className='control-button-container control-language'>\n <Localizer>\n <button aria-label={<Text id='controls.language' />} className={this.state.smartContainerOpen ? 'control-button active' : 'control-button'} onClick={() => this.onControlButtonClick()}>\n <Icon type='language' />\n </button>\n </Localizer>\n { !this.state.smartContainerOpen ? '' :\n <SmartContainer>\n {\n props.audioTracks.length <= 0 ? '' :\n <Localizer>\n <SmartContainerItem label={<Text id='language.audio' />} options={props.audioTracks} onSelect={audioTrack => this.onAudioChange(audioTrack)} />\n </Localizer>\n }\n {\n props.textTracks.length <= 0 ? '' :\n <Localizer>\n <SmartContainerItem label={<Text id='language.captions' />} options={props.textTracks} onSelect={textTrack => this.onCaptionsChange(textTrack)} />\n </Localizer>\n }\n {\n props.textTracks.length <= 0 ? '' :\n <div className='smart-container-item'>\n <a href='#'><Text id='language.advanced_captions_settings'>Advanced captions settings</Text></a>\n </div>\n }\n </SmartContainer>\n }\n </div>\n )\n }\n}\n\nexport default LanguageControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/language/language.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/language/language.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/fullscreen';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n fullscreen: state.fullscreen.fullscreen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass FullscreenControl extends BaseComponent {\n _playerElement: HTMLElement;\n\n constructor() {\n super({name: 'Fullscreen'});\n }\n\n componentDidMount() {\n this._playerElement = document.getElementsByClassName('player')[0];\n\n document.addEventListener('webkitfullscreenchange', () => {\n this.props.updateFullscreen(document.webkitIsFullScreen);\n });\n }\n\n enterFullscreen() {\n this._playerElement.webkitRequestFullscreen();\n }\n exitFullscreen() {\n document.webkitCancelFullScreen();\n }\n\n toggleFullscreen() {\n this.logger.debug(`Toggle fullscreen`);\n this.props.fullscreen ? this.exitFullscreen() : this.enterFullscreen();\n }\n\n render() {\n return (\n <div className='control-button-container control-fullscreen'>\n <Localizer>\n <button aria-label={<Text id='controls.fullscreen' />} className={this.props.fullscreen ? 'control-button is-fullscreen' : 'control-button'} onClick={() => this.toggleFullscreen()}>\n <Icon type='maximize' />\n <Icon type='minimize' />\n </button>\n </Localizer>\n </div>\n )\n }\n}\n\nexport default FullscreenControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/fullscreen/fullscreen.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/fullscreen/fullscreen.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport BaseComponent from '../base';\nimport { toHHMMSS } from '../../utils/time-format';\n\nconst mapStateToProps = state => ({\n currentTime: state.seekbar.currentTime,\n duration: state.engine.duration\n});\n\n@connect(mapStateToProps)\nclass TimeDisplay extends BaseComponent {\n constructor(obj: IControlParams) {\n super({name: 'TimeDisplay', player: obj.player, config: obj.config});\n }\n\n getTimeDisplay(): string {\n var result = this.props.format ? this.props.format : 'current / total',\n current = toHHMMSS(this.props.currentTime),\n total = toHHMMSS(this.props.duration),\n left = toHHMMSS(this.props.duration - this.props.currentTime);\n\n result = result.replace(/current/g, current);\n result = result.replace(/total/g, total);\n result = result.replace(/left/g, left);\n\n return result;\n }\n\n render() {\n return (\n <div className='time-display'>\n <span>{this.getTimeDisplay()}</span>\n </div>\n )\n }\n}\n\nexport default TimeDisplay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/time-display/time-display.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/time-display/time-display.js","import { h, Component } from 'preact';\n\nclass TopBar extends Component {\n render(props) {\n return (\n <div className='top-bar'>{ props.children }</div>\n )\n }\n}\n\nexport default TopBar;\n\n\n\n// WEBPACK FOOTER //\n// ./components/top-bar/top-bar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/top-bar/top-bar.js","import { h, Component } from 'preact';\n\nclass BottomBar extends Component {\n render(props) {\n return (\n <div className='bottom-bar'>{ props.children }</div>\n )\n }\n}\n\nexport default BottomBar;\n\n\n\n// WEBPACK FOOTER //\n// ./components/bottom-bar/bottom-bar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/bottom-bar/bottom-bar.js","//@flow\nimport { h } from 'preact';\nimport { Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/share';\nimport BaseComponent from '../base';\nimport Overlay from '../overlay/overlay';\n\nconst mapStateToProps = state => ({\n open: state.share.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass ShareOverlay extends BaseComponent {\n constructor() {\n super({name: 'ShareOverlay'});\n }\n\n render(props) {\n return !props.open ? '' : (\n <Overlay open={props.open} onClose={() => props.toggleShareOverlay(false)} type='share'>\n <div className='title'>\n <Text id='share.share_title' />\n </div>\n <div className='share-icons'>\n <a className='share-btn facebook-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M432 405.333h-80v106.667h80v320h133.333v-320h97.12l9.547-106.667h-106.667v-44.453c0-25.467 5.12-35.547 29.733-35.547h76.933v-133.333h-101.547c-95.893 0-138.453 42.213-138.453 123.067v90.267z' />\n </svg>\n </a>\n <a className='share-btn twitter-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M832 316.614c-23.547 10.29-48.853 17.221-75.413 20.345 27.12-15.987 47.947-41.319 57.733-71.508-25.36 14.806-53.467 25.568-83.387 31.37-23.92-25.122-58.080-40.82-95.84-40.82-84.773 0-147.067 77.861-127.92 158.687-109.093-5.381-205.84-56.833-270.613-135.035-34.4 58.094-17.84 134.090 40.613 172.574-21.493-0.683-41.76-6.484-59.44-16.171-1.44 59.879 42.16 115.898 105.307 128.368-18.48 4.935-38.72 6.090-59.307 2.205 16.693 51.347 65.173 88.702 122.667 89.752-55.2 42.605-124.747 61.637-194.4 53.552 58.107 36.673 127.147 58.067 201.28 58.067 243.787 0 381.52-202.684 373.2-384.473 25.653-18.244 47.92-41.004 65.52-66.914v0z' />\n </svg>\n </a>\n <a className='share-btn google-plus-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M352 556.8h127.040c-5.12 32.928-38.4 96.64-127.040 96.64-76.48 0-138.88-63.328-138.88-141.44 0-78.080 62.4-141.44 138.88-141.44 43.52 0 72.64 18.56 89.28 34.56l60.8-58.56c-39.040-36.48-89.6-58.56-150.080-58.56-123.84 0-224 100.16-224 224s100.16 224 224 224c129.28 0 215.072-90.88 215.072-218.88 0-14.72-1.632-25.92-3.552-37.12h-211.52v76.8zM800 544v96h-64v-96h-96v-64h96v-96h64v96h96v64h-96z' />\n </svg>\n </a>\n <a className='share-btn linkedin-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M324.8 290.087c0 36.506-29.6 66.087-66.133 66.087s-66.133-29.581-66.133-66.087c0-36.48 29.6-66.087 66.133-66.087s66.133 29.607 66.133 66.087zM325.333 409.043h-133.333v422.957h133.333v-422.957zM538.187 409.043h-132.48v422.957h132.507v-222.026c0-123.45 160.773-133.549 160.773 0v222.026h133.013v-267.811c0-208.306-237.92-200.719-293.813-98.179v-56.967z' />\n </svg>\n </a>\n <a className='share-btn email-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M256 768c-35.346 0-64-28.654-64-64v-352c0-35.346 28.654-64 64-64h512c35.346 0 64 28.654 64 64v352c0 35.346-28.654 64-64 64h-512zM512 467.488l147.52-115.488h-295.040l147.52 115.488zM748.48 352l-211.2 179.2c-0.713 1.308-1.572 2.532-2.56 3.648-12.707 12.158-32.733 12.158-45.44 0-0.988-1.116-1.847-2.34-2.56-3.648l-211.2-179.2h-19.52v352h512v-352h-19.52z' />\n </svg>\n </a>\n <a className='share-btn embed-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M377.989 579.335c12.669 12.904 12.669 33.777 0 46.68-12.733 12.969-33.427 12.969-46.16 0l-104.727-106.667c-12.669-12.904-12.669-33.777 0-46.68l104.727-106.667c12.733-12.969 33.427-12.969 46.16 0 12.669 12.904 12.669 33.777 0 46.68l-81.812 83.327 81.812 83.327zM646.011 412.68c-12.669-12.904-12.669-33.777 0-46.68 12.733-12.969 33.427-12.969 46.16 0l104.727 106.667c12.669 12.904 12.669 33.777 0 46.68l-104.727 106.667c-12.733 12.969-33.427 12.969-46.16 0-12.669-12.904-12.669-33.777 0-46.68l81.812-83.327-81.812-83.327zM572.293 250.6c17.455 4.445 28.025 22.388 23.686 40.066l-104.727 426.669c-4.349 17.719-22.048 28.535-39.545 24.079-17.455-4.445-28.025-22.388-23.686-40.066l104.727-426.669c4.349-17.719 22.048-28.535 39.545-24.079z' />\n </svg>\n </a>\n </div>\n <div>\n <div className='form-group has-icon' style='width: 300px;'>\n <input type='text' placeholder='Share URL' className='form-control' value='https://cdnapisec.kaltura.com/index.php?assetId=123456' readOnly />\n <svg className='icon' style='width:32px;height:32px;' viewBox='0 0 1024 1024'>\n <path d='M355.028 445.537c12.497 12.497 12.497 32.758 0 45.255s-32.758 12.497-45.255 0l-24.141-24.141c-49.92-49.92-49.832-130.999 0.094-180.925 49.984-49.984 130.995-50.025 180.955-0.064l113.266 113.266c49.964 49.964 49.935 130.955-0.064 180.955-12.497 12.497-32.758 12.497-45.255 0s-12.497-32.758 0-45.255c25.013-25.013 25.027-65.482 0.064-90.445l-113.266-113.266c-24.957-24.957-65.445-24.936-90.445 0.064-24.955 24.955-24.998 65.511-0.094 90.416l24.141 24.141zM668.972 578.463c-12.497-12.497-12.497-32.758 0-45.255s32.758-12.497 45.255 0l24.141 24.141c49.92 49.92 49.832 130.999-0.094 180.925-49.984 49.984-130.995 50.025-180.955 0.064l-113.266-113.266c-49.964-49.964-49.935-130.955 0.064-180.955 12.497-12.497 32.758-12.497 45.255 0s12.497 32.758 0 45.255c-25.013 25.013-25.027 65.482-0.064 90.445l113.266 113.266c24.957 24.957 65.445 24.936 90.445-0.064 24.955-24.955 24.998-65.511 0.094-90.416l-24.141-24.141z' />\n </svg>\n </div>\n </div>\n <a><Text id='share.link_options' /></a>\n </Overlay>\n )\n }\n}\n\nexport default ShareOverlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/share-overlay/share-overlay.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/share-overlay/share-overlay.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/cvaa';\nimport BaseComponent from '../base';\nimport Overlay from '../overlay/overlay';\n\nconst mapStateToProps = state => ({\n open: state.cvaa.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass CVAAOverlay extends BaseComponent {\n constructor() {\n super({name: 'CVAAOverlay'});\n }\n\n render(props) {\n return !props.open ? '' : (\n <Overlay type='cvaa'>\n <div className='title'>\n Advanced captions settings\n </div>\n <div className='sample'>Sample</div>\n <div className='sample black-bg'>Sample</div>\n <div className='sample yellow-text'>Sample</div>\n </Overlay>\n )\n }\n}\n\nexport default CVAAOverlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/cvaa-overlay/cvaa-overlay.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/cvaa-overlay/cvaa-overlay.js","//@flow\nimport BaseComponent from './base';\n\nclass KeyboardControl extends BaseComponent {\n // _playerElement: HTMLElement;\n\n constructor(obj: IControlParams) {\n super({name: 'Keyboard', player: obj.player});\n\n // this._playerElement = document.getElementsByClassName('player')[0];\n\n document.body.onkeydown = (e) => {\n let time, newVolume;\n switch(e.which) {\n case 32: // space\n this.logger.debug(\"Keydown space\");\n this.player.paused ? this.player.play() : this.player.pause();\n break;\n\n case 38: // up\n this.logger.debug(\"Keydown up\");\n newVolume = Math.round(this.player.volume * 100) + 5;\n this.logger.debug(`Changing volume. ${this.player.volume} => ${newVolume}`);\n if (this.player.muted) {\n this.player.muted = false;\n }\n this.player.volume = newVolume / 100;\n break;\n\n case 40: // down\n this.logger.debug(\"Keydown down\");\n newVolume = Math.round(this.player.volume * 100) - 5;\n if (newVolume < 5) {\n this.player.muted = true;\n return;\n }\n this.logger.debug(`Changing volume. ${this.player.volume} => ${newVolume}`);\n this.player.volume = newVolume / 100;\n break;\n\n case 37: // left\n this.logger.debug(\"Keydown left\");\n time = (this.player.currentTime - 5) > 0 ? this.player.currentTime - 5 : 0;\n this.player.currentTime = time;\n break;\n\n case 39: // right\n this.logger.debug(\"Keydown right\");\n time = (this.player.currentTime + 5) > this.player.duration ? this.player.duration : this.player.currentTime + 5;\n this.player.currentTime = time;\n break;\n\n default: return;\n }\n }\n\n this.disableKeyboardCommandsOnControls();\n }\n\n disableKeyboardCommandsOnControls() {\n let controlButtonsElements = Array.from(document.getElementsByClassName('control-button'));\n controlButtonsElements.forEach((element) => {\n element.onkeydown = (e) => e.preventDefault();\n });\n }\n}\n\nexport default KeyboardControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/keyboard.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/keyboard.js","// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!../../../css-loader/index.js!./style.css\");\nif(typeof content === 'string') content = [[module.id, content, '']];\n// Prepare cssTransformation\nvar transform;\n\nvar options = {}\noptions.transform = transform\n// add the styles to the DOM\nvar update = require(\"!../../../style-loader/lib/addStyles.js\")(content, options);\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(module.hot) {\n\t// When the styles change, update the <style> tags\n\tif(!content.locals) {\n\t\tmodule.hot.accept(\"!!../../../css-loader/index.js!./style.css\", function() {\n\t\t\tvar newContent = require(\"!!../../../css-loader/index.js!./style.css\");\n\t\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\t\t\tupdate(newContent);\n\t\t});\n\t}\n\t// When the module is disposed, remove the <style> tags\n\tmodule.hot.dispose(function() { update(); });\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/playkit-js-ui/src/styles/style.css\n// module id = 4\n// module chunks = 0","exports = module.exports = require(\"../../../css-loader/lib/css-base.js\")(undefined);\n// imports\n\n\n// module\nexports.push([module.id, \".row{display:block}.row:after{content:'';clear:both;display:block}.form-group{margin:10px auto;position:relative;max-width:100%}.form-group.has-error .form-control{border-color:#db1f26}.form-group.has-error .form-control:focus{border-color:#fff}.form-group.has-icon .form-control{padding-left:34px}.form-group .icon{position:absolute;top:2px;left:2px;fill:rgba(255,255,255,0.4)}.form-control{height:36px;width:100%;min-width:72px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(0,0,0,0.4);font-size:15px;line-height:18px;color:#fff;padding:8px 10px;text-overflow:ellipsis}.form-control::-webkit-input-placeholder{color:rgba(255,255,255,0.6)}.form-control:focus{background-color:#fff;border-color:#fff;color:#333}.form-control:focus::-webkit-input-placeholder{color:#ccc}.form-control:focus+.icon{fill:#999}textarea.form-control{min-height:72px}@-webkit-keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.dropdown{position:relative}.dropdown.active .dropdown-menu{display:block;opacity:1}.dropdown.top .dropdown-menu{margin-bottom:10px;bottom:100%}.dropdown.bottom .dropdown-menu{margin-top:10px;top:100%}.dropdown.right .dropdown-menu{left:0}.dropdown.left .dropdown-menu{right:0}.dropdown .dropdown-button{font-size:15px;font-weight:bold;line-height:18px;color:#fff;cursor:pointer}.dropdown .dropdown-menu{display:block;opacity:1;position:absolute;background-color:#333333;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;padding:6px 0;z-index:5;-webkit-animation:openDropmenu 100ms ease-out forwards;animation:openDropmenu 100ms ease-out forwards;max-height:173px;overflow-y:auto}.dropdown .dropdown-menu .dropdown-menu-item{padding:2px 10px 2px 16px;white-space:nowrap;min-height:30px;cursor:pointer}.dropdown .dropdown-menu .dropdown-menu-item:hover{color:#fff}.dropdown .dropdown-menu .dropdown-menu-item.active{color:#01ACCD;fill:#01ACCD}.dropdown .dropdown-menu .dropdown-menu-item .check-icon{display:inline-block;margin-left:16px;vertical-align:middle;width:24px;height:24px}.dropdown .dropdown-menu .dropdown-menu-item span{vertical-align:middle;line-height:26px}.tooltip{display:inline-block;height:22px;border-radius:4px;background-color:#FFFFFF;padding:3px 13px;color:#333333;font-size:13px;font-weight:bold;line-height:16px;box-shadow:0 0 8px 0 rgba(0,0,0,0.3)}.player .control-button{width:32px;height:32px;background:transparent;display:inline-block;opacity:0.8;border:none;padding:0;cursor:pointer;fill:#fff}.player .control-button svg{width:32px;height:32px}.player .control-button:hover,.player .control-button.active{opacity:1}.player .control-button.control-button-rounded{width:36px;height:36px;padding:2px}.player .control-button.control-button-rounded:hover{background-color:rgba(0,0,0,0.4);border-radius:18px}.player .control-button-container{display:inline-block;position:relative;vertical-align:top}a{color:#01ACCD;text-decoration:underline;font-size:15px;line-height:18px}a:hover{color:#01819a}a:active{opacity:0.7}.player{position:relative;max-width:854px;width:100%;background-color:#000;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.player:-webkit-full-screen{width:100%;height:100%;max-width:none}.player *{box-sizing:border-box;outline:none}.player ::-moz-selection{background-color:rgba(0,0,0,0.1)}.player ::selection{background-color:rgba(0,0,0,0.1)}.player video{width:100%}.player .player-gui{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;overflow:hidden;font-size:0;font-family:\\\"Lato\\\",sans-serif}.player .player-gui input,.player .player-gui textarea{font-family:\\\"Lato\\\",sans-serif}.player.metadata-loaded .player-gui,.player.state-paused .player-gui,.player.overlay-active .player-gui,.player.menu-active .player-gui{opacity:1}video::-webkit-media-controls{display:none !important}video::-webkit-media-controls-start-playback-button{display:none !important;-webkit-appearance:none}@-webkit-keyframes openOverlay{from{opacity:0}to{opacity:1}}@keyframes openOverlay{from{opacity:0}to{opacity:1}}.overlay{position:absolute;display:none;opacity:0;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.42);z-index:4;text-align:center;color:#fff;padding:80px 20px 0;-webkit-animation:openOverlay 100ms ease-in-out forwards;animation:openOverlay 100ms ease-in-out forwards}.overlay.active{display:block;opacity:1}.overlay .title{font-size:24px;font-weight:bold;line-height:29px;margin-bottom:60px}.overlay .close-overlay{position:absolute;top:48px;right:48px;z-index:5;fill:#fff;cursor:pointer}.overlay .close-overlay .icon-close{width:24px;height:24px}@media screen and (max-width: 768px){.overlay{padding:36px 20px 0}.overlay .close-overlay{top:38px}.overlay .title{margin-bottom:24px}}@media screen and (max-width: 480px){.overlay{padding:16px 24px 0}.overlay .close-overlay{top:15px;right:24px}.overlay .title{font-size:16px;line-height:19px;margin-bottom:36px}}@-webkit-keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.smart-container{background-color:#222222;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;position:absolute;right:0px;min-width:193px;font-size:15px;z-index:5;display:block;-webkit-animation:openSmartContainer 100ms ease-out forwards;animation:openSmartContainer 100ms ease-out forwards}.smart-container.top{bottom:100%;margin-bottom:6px}.smart-container.top:before{display:block;content:' ';position:absolute;bottom:-6px;left:0;width:100%;height:6px}.smart-container.bottom{top:100%;margin-top:6px}.smart-container.right{left:0px}.smart-container.left{right:0px}.smart-container .smart-container-item{margin:16px;color:rgba(244,244,244,0.8);white-space:nowrap}.smart-container .smart-container-item:after{display:block;content:' ';clear:both}.smart-container .smart-container-item.select-menu-item label{float:left}.smart-container .smart-container-item.select-menu-item .dropdown{float:right}.overlay.share-overlay .share-icons{margin:60px 0}.overlay.share-overlay .share-btn{height:36px;width:36px;border-radius:18px;background-color:rgba(0,0,0,0.4);display:inline-block;margin:0 8px;-webkit-transition:-webkit-transform 100ms;transition:transform 100ms;will-change:transform;padding:2px}.overlay.share-overlay .share-btn:hover{-webkit-transform:scale(1.1667);-ms-transform:scale(1.1667);transform:scale(1.1667)}.overlay.share-overlay .share-btn.facebook-share-btn{background-color:#3B5998}.overlay.share-overlay .share-btn.twitter-share-btn{background-color:#1DA1F2}.overlay.share-overlay .share-btn.google-plus-share-btn{background-color:#DD4B39}.overlay.share-overlay .share-btn.linkedin-share-btn{background-color:#00A0DC}@media screen and (max-width: 768px){.overlay.share-overlay .share-icons{margin:40px 0}}@media screen and (max-width: 480px){.overlay.share-overlay .share-icons{margin:20px 0}}.overlay.cvaa-overlay .sample{border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:36px;text-align:center;padding:0 28px;display:inline-block;margin:0 12px;cursor:pointer}.overlay.cvaa-overlay .sample.black-bg{background-color:#000}.overlay.cvaa-overlay .sample.yellow-text{color:#FAFF00}@-webkit-keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}@keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}.loading-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.3);-webkit-transition:100ms opacity;transition:100ms opacity;opacity:0}.loading-backdrop.show{opacity:1}.loading-backdrop.show .spinner-container{display:block}.loading-backdrop .spinner-container{display:none;position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50px, -50px, 0);transform:translate3d(-50px, -50px, 0)}.spinner{width:100px;height:100px;position:relative;-webkit-animation:kaltura-spinner 2.5s infinite;animation:kaltura-spinner 2.5s infinite}.spinner span{width:8px;height:8px;background-color:#fff;display:block;border-radius:8px;position:absolute;top:50%;left:50%;margin-top:-4px;margin-left:-4px}.spinner span:nth-child(1){-webkit-transform:rotate(45deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(45deg) translateX(-25px) translateY(-25px);transform:rotate(45deg) translateX(-25px) translateY(-25px);background-color:#da1f26}.spinner span:nth-child(2){-webkit-transform:rotate(90deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(90deg) translateX(-25px) translateY(-25px);transform:rotate(90deg) translateX(-25px) translateY(-25px);background-color:#06a885}.spinner span:nth-child(3){-webkit-transform:rotate(135deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(135deg) translateX(-25px) translateY(-25px);transform:rotate(135deg) translateX(-25px) translateY(-25px);background-color:#009344}.spinner span:nth-child(4){-webkit-transform:rotate(180deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(180deg) translateX(-25px) translateY(-25px);transform:rotate(180deg) translateX(-25px) translateY(-25px);background-color:#f8a61a}.spinner span:nth-child(5){-webkit-transform:rotate(225deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(225deg) translateX(-25px) translateY(-25px);transform:rotate(225deg) translateX(-25px) translateY(-25px);background-color:#1b4a97}.spinner span:nth-child(6){-webkit-transform:rotate(270deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(270deg) translateX(-25px) translateY(-25px);transform:rotate(270deg) translateX(-25px) translateY(-25px);background-color:#00abcc}.spinner span:nth-child(7){-webkit-transform:rotate(315deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(315deg) translateX(-25px) translateY(-25px);transform:rotate(315deg) translateX(-25px) translateY(-25px);background-color:#b1d238}.spinner span:nth-child(8){-webkit-transform:rotate(360deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(360deg) translateX(-25px) translateY(-25px);transform:rotate(360deg) translateX(-25px) translateY(-25px);background-color:#fcd203}.control-button-container.control-play-pause .control-button{-webkit-transition:400ms -webkit-transform;transition:400ms transform}.control-button-container.control-play-pause .control-button .icon-pause{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:0;display:none}.control-button-container.control-play-pause .control-button .icon-play{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}.control-button-container.control-play-pause .control-button.is-playing .icon-pause{opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing .icon-play{opacity:0;display:none}@media screen and (max-width: 480px){.control-button-container.control-play-pause{display:none}}.control-button-container.volume-control:hover .volume-control-bar{display:block !important}.control-button-container.volume-control.is-muted .volume-waves{opacity:0;-webkit-transform:translateX(-5px);-ms-transform:translateX(-5px);transform:translateX(-5px)}.control-button-container.volume-control.is-muted .volume-mute{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.volume-control.dragging-active .volume-control-bar{display:block}.control-button-container.volume-control .volume-waves{-webkit-transform:translateX(0px);-ms-transform:translateX(0px);transform:translateX(0px)}.control-button-container.volume-control .volume-mute{opacity:1;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.control-button-container.volume-control .volume-waves,.control-button-container.volume-control .volume-mute{-webkit-transition:300ms -webkit-transform, 300ms opacity;transition:300ms transform, 300ms opacity}.control-button-container.volume-control svg{position:absolute;top:0;left:0}.volume-control-bar{position:absolute;z-index:2;bottom:38px;left:0px;display:block;height:112px;width:34px;border-radius:4px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);background-color:#333333;padding:6px;display:none}.volume-control-bar:before{position:absolute;width:34px;height:14px;bottom:-8px;left:0;content:' ';display:block}.volume-control-bar .bar{background-color:#424242;height:100%;position:relative;cursor:ns-resize}.volume-control-bar .progress{position:absolute;bottom:0px;left:0px;width:100%;border-radius:0 0 2px 2px;background-color:#01ACCD}.control-button-container.control-fullscreen .control-button{-webkit-transition:100ms -webkit-transform;transition:100ms transform;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.control-fullscreen .control-button .icon-minimize{display:none}.control-button-container.control-fullscreen .control-button:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-maximize{display:none}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-minimize{display:block}.player .seek-bar{padding:6px 0;cursor:pointer}.player .seek-bar:hover .progress-bar .scrubber,.player .seek-bar.dragging-active .progress-bar .scrubber{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.player .seek-bar:hover .progress-bar .virtual-progress,.player .seek-bar.dragging-active .progress-bar .virtual-progress{display:block}.player .seek-bar .progress-bar{height:4px;background-color:rgba(255,255,255,0.3);border-radius:2px;position:relative}.player .seek-bar .progress-bar .progress{position:absolute;top:0;left:0;height:100%;z-index:2;border-radius:2px 0 0 2px;background-color:#01ACCD}.player .seek-bar .progress-bar .virtual-progress{display:none}.player .seek-bar .progress-bar .buffered,.player .seek-bar .progress-bar .virtual-progress{position:absolute;top:0;left:0;height:100%;z-index:1;border-radius:2px 0 0 2px;background-color:rgba(255,255,255,0.3)}.player .seek-bar .progress-bar .buffered .frame-preview-img,.player .seek-bar .progress-bar .virtual-progress .frame-preview-img{background-size:auto 100%;width:100%;height:100%;position:relative}.player .seek-bar .progress-bar .buffered .frame-preview,.player .seek-bar .progress-bar .virtual-progress .frame-preview{position:absolute;bottom:16px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:94px;width:164px;border:2px solid rgba(255,255,255,0.2);border-radius:4px}.player .seek-bar .progress-bar .buffered .time-preview,.player .seek-bar .progress-bar .virtual-progress .time-preview{position:absolute;bottom:22px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:22px;min-width:48px;padding:0 3px;text-align:center;border-radius:3px;background-color:rgba(0,0,0,0.7);font-size:13px;font-weight:bold;line-height:22px;color:#fff}.player .seek-bar .progress-bar .scrubber{position:absolute;z-index:3;cursor:pointer;display:block;top:-6px;right:-8px;border-radius:8px;height:16px;width:16px;background-color:#FFFFFF;box-shadow:0 0 31px 0 rgba(0,0,0,0.3);-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:100ms -webkit-transform;transition:100ms transform}.player .seek-bar .progress-bar .scrubber:active{opacity:1;cursor:-webkit-grabbing;cursor:grabbing}@media screen and (max-width: 480px){.virtual-progress{display:none}}.player .time-display{display:inline-block;line-height:32px;vertical-align:top;font-size:14px;padding:0 23px;font-weight:bold}@media screen and (max-width: 480px){.player .time-display{padding:0 12px 0 0}}.player .video-playing-title{font-size:15px;font-weight:bold;line-height:18px;padding:6px 0}.player .bottom-bar{position:absolute;bottom:0;left:0;width:100%;background:-webkit-linear-gradient(270deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:6px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .bottom-bar .left-controls{float:left;text-align:left}.player .bottom-bar .right-controls{float:right;text-align:left}.player .bottom-bar .right-controls .control-button-container{margin:0 6px}.player .bottom-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .bottom-bar,.player.hover .bottom-bar,.player.state-paused .bottom-bar,.player.menu-active .bottom-bar{opacity:1}.player.overlay-active .bottom-bar{opacity:0}@media screen and (max-width: 480px){.player .bottom-bar{padding:6px 8px}}.player .top-bar{position:absolute;top:0;left:0;width:100%;background:-webkit-linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(0deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:14px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .top-bar .left-controls{float:left;text-align:left}.player .top-bar .right-controls{float:right;text-align:left}.player .top-bar .right-controls .control-button-container{margin:0 6px}.player .top-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .top-bar,.player.hover .top-bar,.player.state-paused .top-bar,.player.menu-active .top-bar{opacity:1}.player.overlay-active .top-bar{opacity:0}@media screen and (max-width: 480px){.player .top-bar{padding:8px 8px 20px 8px}}@-webkit-keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}@keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}.overlay-play{position:absolute;top:0;left:0;width:100%;height:100%}.overlay-play.in .icon{-webkit-animation:overlayPlayIconIn 400ms linear forwards;animation:overlayPlayIconIn 400ms linear forwards}.overlay-play .icon{width:144px;height:144px;fill:#fff;position:absolute;top:50%;left:50%;margin:-72px 0 0 -72px;opacity:0}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/css-loader!../node_modules/playkit-js-ui/src/styles/style.css\n// module id = 5\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/css-loader/lib/css-base.js\n// module id = 6\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tmemo[selector] = fn.call(this, selector);\n\t\t}\n\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n\t// tags it will allow on a page\n\tif (!options.singleton) options.singleton = isOldIE();\n\n\t// By default, add <style> tags to the <head> element\n\tif (!options.insertInto) options.insertInto = \"head\";\n\n\t// By default, add <style> tags to the bottom of the target\n\tif (!options.insertAt) options.insertAt = \"bottom\";\n\n\tvar styles = listToStyles(list, options);\n\n\taddStylesToDom(styles, options);\n\n\treturn function update (newList) {\n\t\tvar mayRemove = [];\n\n\t\tfor (var i = 0; i < styles.length; i++) {\n\t\t\tvar item = styles[i];\n\t\t\tvar domStyle = stylesInDom[item.id];\n\n\t\t\tdomStyle.refs--;\n\t\t\tmayRemove.push(domStyle);\n\t\t}\n\n\t\tif(newList) {\n\t\t\tvar newStyles = listToStyles(newList, options);\n\t\t\taddStylesToDom(newStyles, options);\n\t\t}\n\n\t\tfor (var i = 0; i < mayRemove.length; i++) {\n\t\t\tvar domStyle = mayRemove[i];\n\n\t\t\tif(domStyle.refs === 0) {\n\t\t\t\tfor (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();\n\n\t\t\t\tdelete stylesInDom[domStyle.id];\n\t\t\t}\n\t\t}\n\t};\n};\n\nfunction addStylesToDom (styles, options) {\n\tfor (var i = 0; i < styles.length; i++) {\n\t\tvar item = styles[i];\n\t\tvar domStyle = stylesInDom[item.id];\n\n\t\tif(domStyle) {\n\t\t\tdomStyle.refs++;\n\n\t\t\tfor(var j = 0; j < domStyle.parts.length; j++) {\n\t\t\t\tdomStyle.parts[j](item.parts[j]);\n\t\t\t}\n\n\t\t\tfor(; j < item.parts.length; j++) {\n\t\t\t\tdomStyle.parts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\t\t} else {\n\t\t\tvar parts = [];\n\n\t\t\tfor(var j = 0; j < item.parts.length; j++) {\n\t\t\t\tparts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\n\t\t\tstylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};\n\t\t}\n\t}\n}\n\nfunction listToStyles (list, options) {\n\tvar styles = [];\n\tvar newStyles = {};\n\n\tfor (var i = 0; i < list.length; i++) {\n\t\tvar item = list[i];\n\t\tvar id = options.base ? item[0] + options.base : item[0];\n\t\tvar css = item[1];\n\t\tvar media = item[2];\n\t\tvar sourceMap = item[3];\n\t\tvar part = {css: css, media: media, sourceMap: sourceMap};\n\n\t\tif(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});\n\t\telse newStyles[id].parts.push(part);\n\t}\n\n\treturn styles;\n}\n\nfunction insertStyleElement (options, style) {\n\tvar target = getElement(options.insertInto)\n\n\tif (!target) {\n\t\tthrow new Error(\"Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.\");\n\t}\n\n\tvar lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];\n\n\tif (options.insertAt === \"top\") {\n\t\tif (!lastStyleElementInsertedAtTop) {\n\t\t\ttarget.insertBefore(style, target.firstChild);\n\t\t} else if (lastStyleElementInsertedAtTop.nextSibling) {\n\t\t\ttarget.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);\n\t\t} else {\n\t\t\ttarget.appendChild(style);\n\t\t}\n\t\tstylesInsertedAtTop.push(style);\n\t} else if (options.insertAt === \"bottom\") {\n\t\ttarget.appendChild(style);\n\t} else {\n\t\tthrow new Error(\"Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.\");\n\t}\n}\n\nfunction removeStyleElement (style) {\n\tif (style.parentNode === null) return false;\n\tstyle.parentNode.removeChild(style);\n\n\tvar idx = stylesInsertedAtTop.indexOf(style);\n\tif(idx >= 0) {\n\t\tstylesInsertedAtTop.splice(idx, 1);\n\t}\n}\n\nfunction createStyleElement (options) {\n\tvar style = document.createElement(\"style\");\n\n\toptions.attrs.type = \"text/css\";\n\n\taddAttrs(style, options.attrs);\n\tinsertStyleElement(options, style);\n\n\treturn style;\n}\n\nfunction createLinkElement (options) {\n\tvar link = document.createElement(\"link\");\n\n\toptions.attrs.type = \"text/css\";\n\toptions.attrs.rel = \"stylesheet\";\n\n\taddAttrs(link, options.attrs);\n\tinsertStyleElement(options, link);\n\n\treturn link;\n}\n\nfunction addAttrs (el, attrs) {\n\tObject.keys(attrs).forEach(function (key) {\n\t\tel.setAttribute(key, attrs[key]);\n\t});\n}\n\nfunction addStyle (obj, options) {\n\tvar style, update, remove, result;\n\n\t// If a transform function was defined, run it on the css\n\tif (options.transform && obj.css) {\n\t result = options.transform(obj.css);\n\n\t if (result) {\n\t \t// If transform returns a value, use that instead of the original css.\n\t \t// This allows running runtime transformations on the css.\n\t \tobj.css = result;\n\t } else {\n\t \t// If the transform function returns a falsy value, don't add this css.\n\t \t// This allows conditional loading of css\n\t \treturn function() {\n\t \t\t// noop\n\t \t};\n\t }\n\t}\n\n\tif (options.singleton) {\n\t\tvar styleIndex = singletonCounter++;\n\n\t\tstyle = singleton || (singleton = createStyleElement(options));\n\n\t\tupdate = applyToSingletonTag.bind(null, style, styleIndex, false);\n\t\tremove = applyToSingletonTag.bind(null, style, styleIndex, true);\n\n\t} else if (\n\t\tobj.sourceMap &&\n\t\ttypeof URL === \"function\" &&\n\t\ttypeof URL.createObjectURL === \"function\" &&\n\t\ttypeof URL.revokeObjectURL === \"function\" &&\n\t\ttypeof Blob === \"function\" &&\n\t\ttypeof btoa === \"function\"\n\t) {\n\t\tstyle = createLinkElement(options);\n\t\tupdate = updateLink.bind(null, style, options);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\n\t\t\tif(style.href) URL.revokeObjectURL(style.href);\n\t\t};\n\t} else {\n\t\tstyle = createStyleElement(options);\n\t\tupdate = applyToTag.bind(null, style);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\t\t};\n\t}\n\n\tupdate(obj);\n\n\treturn function updateStyle (newObj) {\n\t\tif (newObj) {\n\t\t\tif (\n\t\t\t\tnewObj.css === obj.css &&\n\t\t\t\tnewObj.media === obj.media &&\n\t\t\t\tnewObj.sourceMap === obj.sourceMap\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdate(obj = newObj);\n\t\t} else {\n\t\t\tremove();\n\t\t}\n\t};\n}\n\nvar replaceText = (function () {\n\tvar textStore = [];\n\n\treturn function (index, replacement) {\n\t\ttextStore[index] = replacement;\n\n\t\treturn textStore.filter(Boolean).join('\\n');\n\t};\n})();\n\nfunction applyToSingletonTag (style, index, remove, obj) {\n\tvar css = remove ? \"\" : obj.css;\n\n\tif (style.styleSheet) {\n\t\tstyle.styleSheet.cssText = replaceText(index, css);\n\t} else {\n\t\tvar cssNode = document.createTextNode(css);\n\t\tvar childNodes = style.childNodes;\n\n\t\tif (childNodes[index]) style.removeChild(childNodes[index]);\n\n\t\tif (childNodes.length) {\n\t\t\tstyle.insertBefore(cssNode, childNodes[index]);\n\t\t} else {\n\t\t\tstyle.appendChild(cssNode);\n\t\t}\n\t}\n}\n\nfunction applyToTag (style, obj) {\n\tvar css = obj.css;\n\tvar media = obj.media;\n\n\tif(media) {\n\t\tstyle.setAttribute(\"media\", media)\n\t}\n\n\tif(style.styleSheet) {\n\t\tstyle.styleSheet.cssText = css;\n\t} else {\n\t\twhile(style.firstChild) {\n\t\t\tstyle.removeChild(style.firstChild);\n\t\t}\n\n\t\tstyle.appendChild(document.createTextNode(css));\n\t}\n}\n\nfunction updateLink (link, options, obj) {\n\tvar css = obj.css;\n\tvar sourceMap = obj.sourceMap;\n\n\t/*\n\t\tIf convertToAbsoluteUrls isn't defined, but sourcemaps are enabled\n\t\tand there is no publicPath defined then lets turn convertToAbsoluteUrls\n\t\ton by default. Otherwise default to the convertToAbsoluteUrls option\n\t\tdirectly\n\t*/\n\tvar autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;\n\n\tif (options.convertToAbsoluteUrls || autoFixUrls) {\n\t\tcss = fixUrls(css);\n\t}\n\n\tif (sourceMap) {\n\t\t// http://stackoverflow.com/a/26603875\n\t\tcss += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\n\t}\n\n\tvar blob = new Blob([css], { type: \"text/css\" });\n\n\tvar oldSrc = link.href;\n\n\tlink.href = URL.createObjectURL(blob);\n\n\tif(oldSrc) URL.revokeObjectURL(oldSrc);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/style-loader/lib/addStyles.js\n// module id = 7\n// module chunks = 0","\n/**\n * When source maps are enabled, `style-loader` uses a link element with a data-uri to\n * embed the css on the page. This breaks all relative urls because now they are relative to a\n * bundle instead of the current page.\n *\n * One solution is to only use full urls, but that may be impossible.\n *\n * Instead, this function \"fixes\" the relative urls to be absolute according to the current page location.\n *\n * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.\n *\n */\n\nmodule.exports = function (css) {\n // get current location\n var location = typeof window !== \"undefined\" && window.location;\n\n if (!location) {\n throw new Error(\"fixUrls requires window.location\");\n }\n\n\t// blank or null?\n\tif (!css || typeof css !== \"string\") {\n\t return css;\n }\n\n var baseUrl = location.protocol + \"//\" + location.host;\n var currentDir = baseUrl + location.pathname.replace(/\\/[^\\/]*$/, \"/\");\n\n\t// convert each url(...)\n\t/*\n\tThis regular expression is just a way to recursively match brackets within\n\ta string.\n\n\t /url\\s*\\( = Match on the word \"url\" with any whitespace after it and then a parens\n\t ( = Start a capturing group\n\t (?: = Start a non-capturing group\n\t [^)(] = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t (?: = Start another non-capturing groups\n\t [^)(]+ = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t [^)(]* = Match anything that isn't a parentheses\n\t \\) = Match a end parentheses\n\t ) = End Group\n *\\) = Match anything and then a close parens\n ) = Close non-capturing group\n * = Match anything\n ) = Close capturing group\n\t \\) = Match a close parens\n\n\t /gi = Get all matches, not the first. Be case insensitive.\n\t */\n\tvar fixedCss = css.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi, function(fullMatch, origUrl) {\n\t\t// strip quotes (if they exist)\n\t\tvar unquotedOrigUrl = origUrl\n\t\t\t.trim()\n\t\t\t.replace(/^\"(.*)\"$/, function(o, $1){ return $1; })\n\t\t\t.replace(/^'(.*)'$/, function(o, $1){ return $1; });\n\n\t\t// already a full url? no change\n\t\tif (/^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/)/i.test(unquotedOrigUrl)) {\n\t\t return fullMatch;\n\t\t}\n\n\t\t// convert the url to a full url\n\t\tvar newUrl;\n\n\t\tif (unquotedOrigUrl.indexOf(\"//\") === 0) {\n\t\t \t//TODO: should we add protocol?\n\t\t\tnewUrl = unquotedOrigUrl;\n\t\t} else if (unquotedOrigUrl.indexOf(\"/\") === 0) {\n\t\t\t// path should be relative to the base url\n\t\t\tnewUrl = baseUrl + unquotedOrigUrl; // already starts with '/'\n\t\t} else {\n\t\t\t// path should be relative to current directory\n\t\t\tnewUrl = currentDir + unquotedOrigUrl.replace(/^\\.\\//, \"\"); // Strip leading './'\n\t\t}\n\n\t\t// send back the fixed url(...)\n\t\treturn \"url(\" + JSON.stringify(newUrl) + \")\";\n\t});\n\n\t// send back the fixed css\n\treturn fixedCss;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/style-loader/lib/urls.js\n// module id = 8\n// module chunks = 0","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"hls.js\"), require(\"playkit-js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"hls.js\", \"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsHls\"] = factory(require(\"hls.js\"), require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsHls\"] = factory(root[\"Hls\"], root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///hls/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 3d553f6cfbde57d4496a\n\n\n// WEBPACK FOOTER //\n// webpack:/hls/webpack/bootstrap 3d553f6cfbde57d4496a","//@flow\nimport Hlsjs from 'hls.js'\nimport {registerMediaSourceAdapter, BaseMediaSourceAdapter} from 'playkit-js'\nimport {Track, VideoTrack, AudioTrack, TextTrack} from 'playkit-js'\n\n/**\n * Adapter of hls.js lib for hls content\n * @classdesc\n */\nexport default class HlsAdapter extends BaseMediaSourceAdapter {\n /**\n * The id of the adapter.\n * @member {string} id\n * @static\n * @private\n */\n static id: string = 'HlsAdapter';\n /**\n * The adapter logger.\n * @member {any} _logger\n * @static\n * @private\n */\n static _logger = BaseMediaSourceAdapter.getLogger(HlsAdapter.id);\n /**\n * The supported mime types by the hls adapter.\n * @member {Array<string>} _hlsMimeType\n * @static\n * @private\n */\n static _hlsMimeTypes: Array<string> = [\n 'application/x-mpegurl',\n 'application/vnd.apple.mpegurl',\n 'audio/mpegurl',\n 'audio/x-mpegurl',\n 'video/x-mpegurl',\n 'video/mpegurl',\n 'application/mpegurl'\n ];\n /**\n * The hls player instance.\n * @member {any} _hls\n * @private\n */\n _hls: any;\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n _loadPromise: ?Promise<Object>;\n /**\n * Reference to the player tracks.\n * @member {Array<Track>} - _playerTracks\n * @type {Array<Track>}\n * @private\n */\n _playerTracks: Array<Track>;\n\n /**\n * Checks if hls adapter can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check.\n * @returns {boolean} - Whether the hls adapter can play a specific mime type.\n * @static\n */\n static canPlayType(mimeType: string): boolean {\n let canHlsPlayType = (typeof mimeType === 'string') ? HlsAdapter._hlsMimeTypes.includes(mimeType.toLowerCase()) : false;\n HlsAdapter._logger.debug('canPlayType result for mimeType:' + mimeType + ' is ' + canHlsPlayType.toString());\n return canHlsPlayType;\n }\n\n /**\n * Checks if the hls adapter is supported.\n * @function isSupported\n * @returns {boolean} - Whether hls is supported.\n * @static\n */\n static isSupported(): boolean {\n let isHlsSupported = Hlsjs.isSupported();\n HlsAdapter._logger.debug('isSupported:' + isHlsSupported);\n return isHlsSupported;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which will bind to the hls adapter\n * @param {Object} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n constructor(videoElement: HTMLVideoElement, source: Source, config: Object) {\n HlsAdapter._logger.debug('Creating adapter. Hls version: ' + Hlsjs.version);\n super(videoElement, source, config);\n this._hls = new Hlsjs(this._config);\n this._addBindings();\n }\n\n /**\n * Adds the required bindings with hls.js.\n * @function _addBindings\n * @private\n * @returns {void}\n */\n _addBindings(): void {\n this._hls.on(Hlsjs.Events.ERROR, this._onError.bind(this));\n this._hls.on(Hlsjs.Events.LEVEL_SWITCHED, this._onLevelSwitched.bind(this));\n this._hls.on(Hlsjs.Events.AUDIO_TRACK_SWITCHED, this._onAudioTrackSwitched.bind(this));\n }\n\n /**\n * Load the video source\n * @function load\n * @returns {Promise<Object>} - The loaded data\n * @override\n */\n load(): Promise<Object> {\n if (!this._loadPromise) {\n this._loadPromise = new Promise((resolve) => {\n this._hls.on(Hlsjs.Events.MANIFEST_LOADED, (event: string, data: any) => {\n HlsAdapter._logger.debug('The source has been loaded successfully');\n this._playerTracks = this._parseTracks(data);\n resolve({tracks: this._playerTracks});\n });\n if (this._sourceObj && this._sourceObj.url) {\n this._hls.loadSource(this._sourceObj.url);\n this._hls.attachMedia(this._videoElement);\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroying the hls adapter.\n * @function destroy\n * @override\n */\n destroy(): void {\n HlsAdapter._logger.debug('destroy');\n super.destroy();\n this._loadPromise = null;\n this._removeBindings();\n this._hls.detachMedia();\n this._hls.destroy();\n }\n\n /**\n * Parse the hls tracks into player tracks.\n * @param {any} data - The event data.\n * @returns {Array<Track>} - The parsed tracks.\n * @private\n */\n _parseTracks(data: any): Array<Track> {\n let audioTracks = this._parseAudioTracks(data.audioTracks || []);\n let videoTracks = this._parseVideoTracks(data.levels || []);\n let textTracks = this._parseTextTracks(this._videoElement.textTracks || []);\n return audioTracks.concat(videoTracks).concat(textTracks);\n }\n\n /**\n * Parse hls audio tracks into player audio tracks.\n * @param {Array<Object>} hlsAudioTracks - The hls audio tracks.\n * @returns {Array<AudioTrack>} - The parsed audio tracks.\n * @private\n */\n _parseAudioTracks(hlsAudioTracks: Array<Object>): Array<AudioTrack> {\n let audioTracks = [];\n for (let i = 0; i < hlsAudioTracks.length; i++) {\n // Create audio tracks\n let settings = {\n id: hlsAudioTracks[i].id,\n active: this._hls.audioTrack === hlsAudioTracks[i].id,\n label: hlsAudioTracks[i].name,\n language: hlsAudioTracks[i].lang,\n index: i\n };\n audioTracks.push(new AudioTrack(settings));\n }\n return audioTracks;\n }\n\n /**\n * Parse hls video tracks into player video tracks.\n * @param {Array<Object>} hlsVideoTracks - The hls video tracks.\n * @returns {Array<VideoTrack>} - The parsed video tracks.\n * @private\n */\n _parseVideoTracks(hlsVideoTracks: Array<Object>): Array<VideoTrack> {\n let videoTracks = [];\n for (let i = 0; i < hlsVideoTracks.length; i++) {\n // Create video tracks\n let settings = {\n active: this._hls.startLevel === i,\n label: hlsVideoTracks[i].name,\n bandwidth: hlsVideoTracks[i].bitrate,\n language: '',\n index: i\n };\n videoTracks.push(new VideoTrack(settings));\n }\n return videoTracks;\n }\n\n /**\n * Parse native video tag text tracks into player text tracks.\n * @param {TextTrackList} vidTextTracks - The native video tag text tracks.\n * @returns {Array<TextTrack>} - The parsed text tracks.\n * @private\n */\n _parseTextTracks(vidTextTracks: TextTrackList | Array<Object>): Array<TextTrack> {\n let textTracks = [];\n for (let i = 0; i < vidTextTracks.length; i++) {\n // Create text tracks\n let settings = {\n active: vidTextTracks[i].mode === 'showing',\n label: vidTextTracks[i].label,\n kind: vidTextTracks[i].kind,\n language: vidTextTracks[i].language,\n index: i\n };\n textTracks.push(new TextTrack(settings));\n }\n return textTracks;\n }\n\n /**\n * Select an audio track.\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select.\n * @returns {void}\n * @public\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n if (audioTrack instanceof AudioTrack && !audioTrack.active && this._hls.audioTracks) {\n this._hls.audioTrack = audioTrack.id;\n }\n }\n\n /**\n * Select a video track.\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the track to select.\n * @returns {void}\n * @public\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n if (videoTrack instanceof VideoTrack && (!videoTrack.active || this._hls.autoLevelEnabled) && this._hls.levels) {\n this._hls.nextLevel = videoTrack.index;\n }\n }\n\n /**\n * Select a text track.\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select.\n * @returns {void}\n * @public\n */\n selectTextTrack(textTrack: TextTrack): void {\n if (textTrack instanceof TextTrack && !textTrack.active && this._videoElement.textTracks) {\n this._disableAllTextTracks();\n this._videoElement.textTracks[textTrack.index].mode = 'showing';\n HlsAdapter._logger.debug('Text track changed', textTrack);\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Enables adaptive bitrate switching according to hls.js logic.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n this._hls.nextLevel = -1;\n }\n\n /**\n * Triggers on video track selection (auto or manually) the 'videotrackchanged' event forward.\n * @function _onLevelSwitched\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n _onLevelSwitched(event: string, data: any): void {\n let videoTrack = this._playerTracks.find((track) => {\n return (track instanceof VideoTrack && track.index === data.level);\n });\n HlsAdapter._logger.debug('Video track changed', videoTrack);\n this._onTrackChanged(videoTrack);\n }\n\n /**\n * Triggers on audio track selection (auto or manually) the 'audiotrackchanged' event forward.\n * @function _onAudioTrackSwitched\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n _onAudioTrackSwitched(event: string, data: any): void {\n let audioTrack = this._playerTracks.find((track) => {\n return (track instanceof AudioTrack && track.id === data.id);\n });\n HlsAdapter._logger.debug('Audio track changed', audioTrack);\n this._onTrackChanged(audioTrack);\n }\n\n /**\n * Disables all the video tag text tracks.\n * @returns {void}\n * @private\n */\n _disableAllTextTracks() {\n let vidTextTracks = this._videoElement.textTracks;\n for (let i = 0; i < vidTextTracks.length; i++) {\n vidTextTracks[i].mode = 'hidden';\n }\n }\n\n /**\n * Handles hls errors.\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n _onError(event: string, data: any): void {\n let errorType = data.type;\n let errorDetails = data.details;\n let errorFatal = data.fatal;\n if (errorFatal) {\n switch (errorType) {\n case Hlsjs.ErrorTypes.NETWORK_ERROR:\n HlsAdapter._logger.error(\"fatal network error encountered, try to recover\");\n this._hls.startLoad();\n break;\n case Hlsjs.ErrorTypes.MEDIA_ERROR:\n HlsAdapter._logger.error(\"fatal media error encountered, try to recover\");\n this._hls.recoverMediaError();\n break;\n default:\n HlsAdapter._logger.error(\"fatal error, cannot recover\");\n this.destroy();\n break;\n }\n } else {\n switch (errorDetails) {\n case Hlsjs.ErrorDetails.MANIFEST_LOAD_ERROR:\n case Hlsjs.ErrorDetails.MANIFEST_LOAD_TIMEOUT:\n case Hlsjs.ErrorDetails.MANIFEST_PARSING_ERROR:\n case Hlsjs.ErrorDetails.LEVEL_LOAD_ERROR:\n case Hlsjs.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n case Hlsjs.ErrorDetails.LEVEL_SWITCH_ERROR:\n case Hlsjs.ErrorDetails.FRAG_LOAD_ERROR:\n case Hlsjs.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case Hlsjs.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case Hlsjs.ErrorDetails.FRAG_PARSING_ERROR:\n case Hlsjs.ErrorDetails.BUFFER_APPEND_ERROR:\n case Hlsjs.ErrorDetails.BUFFER_APPENDING_ERROR:\n HlsAdapter._logger.error(errorType, errorDetails);\n break;\n default:\n break;\n }\n }\n }\n\n /**\n * Removes hls.js bindings.\n * @returns {void}\n * @private\n */\n _removeBindings(): void {\n this._hls.off(Hlsjs.Events.ERROR, this._onError);\n this._hls.off(Hlsjs.Events.LEVEL_SWITCHED, this._onLevelSwitched);\n this._hls.off(Hlsjs.Events.AUDIO_TRACK_SWITCHED, this._onAudioTrackSwitched);\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * In case the adapter preformed a load it will return the manifest url.\n * @public\n * @returns {string} - The src url.\n */\n get src(): string {\n if (this._loadPromise && this._sourceObj) {\n return this._sourceObj.url;\n }\n return \"\";\n }\n}\n\n// Register hls adapter to the media source adapter provider.\nif (HlsAdapter.isSupported()) {\n registerMediaSourceAdapter(HlsAdapter);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./hls-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///hls/hls-adapter.js","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"hls.js\",\"commonjs2\":\"hls.js\",\"amd\":\"hls.js\",\"root\":\"Hls\"}\n// module id = 1\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/hls/external {\"commonjs\":\"hls.js\",\"commonjs2\":\"hls.js\",\"amd\":\"hls.js\",\"root\":\"Hls\"}","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}\n// module id = 2\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/hls/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","(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})\n\n\n// WEBPACK FOOTER //\n// node_modules/browser-pack/_prelude.js","// 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 } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\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\n\n// WEBPACK FOOTER //\n// node_modules/events/events.js","// see https://tools.ietf.org/html/rfc1808\r\n\r\n/* jshint ignore:start */\r\n(function(root) { \r\n/* jshint ignore:end */\r\n\r\n var URL_REGEX = /^((?:[^\\/;?#]+:)?)(\\/\\/[^\\/\\;?#]*)?(.*?)??(;.*?)?(\\?.*?)?(#.*?)?$/;\r\n var FIRST_SEGMENT_REGEX = /^([^\\/;?#]*)(.*)$/;\r\n var SLASH_DOT_REGEX = /(?:\\/|^)\\.(?=\\/)/g;\r\n var SLASH_DOT_DOT_REGEX = /(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/).*?(?=\\/)/g;\r\n\r\n var URLToolkit = { // jshint ignore:line\r\n // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //\r\n // E.g\r\n // With opts.alwaysNormalize = false (default, spec compliant)\r\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g\r\n // With opts.alwaysNormalize = true (default, not spec compliant)\r\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/g\r\n buildAbsoluteURL: function(baseURL, relativeURL, opts) {\r\n opts = opts || {};\r\n // remove any remaining space and CRLF\r\n baseURL = baseURL.trim();\r\n relativeURL = relativeURL.trim();\r\n if (!relativeURL) {\r\n // 2a) If the embedded URL is entirely empty, it inherits the\r\n // entire base URL (i.e., is set equal to the base URL)\r\n // and we are done.\r\n if (!opts.alwaysNormalize) {\r\n return baseURL;\r\n }\r\n var basePartsForNormalise = this.parseURL(baseURL);\r\n if (!baseParts) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n basePartsForNormalise.path = URLToolkit.normalizePath(basePartsForNormalise.path);\r\n return URLToolkit.buildURLFromParts(basePartsForNormalise);\r\n }\r\n var relativeParts = this.parseURL(relativeURL);\r\n if (!relativeParts) {\r\n throw new Error('Error trying to parse relative URL.');\r\n }\r\n if (relativeParts.scheme) {\r\n // 2b) If the embedded URL starts with a scheme name, it is\r\n // interpreted as an absolute URL and we are done.\r\n if (!opts.alwaysNormalize) {\r\n return relativeURL;\r\n }\r\n relativeParts.path = URLToolkit.normalizePath(relativeParts.path);\r\n return URLToolkit.buildURLFromParts(relativeParts);\r\n }\r\n var baseParts = this.parseURL(baseURL);\r\n if (!baseParts) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== '/') {\r\n // If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc\r\n // This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'\r\n var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);\r\n baseParts.netLoc = pathParts[1];\r\n baseParts.path = pathParts[2];\r\n }\r\n if (baseParts.netLoc && !baseParts.path) {\r\n baseParts.path = '/';\r\n }\r\n var builtParts = {\r\n // 2c) Otherwise, the embedded URL inherits the scheme of\r\n // the base URL.\r\n scheme: baseParts.scheme,\r\n netLoc: relativeParts.netLoc,\r\n path: null,\r\n params: relativeParts.params,\r\n query: relativeParts.query,\r\n fragment: relativeParts.fragment\r\n };\r\n if (!relativeParts.netLoc) {\r\n // 3) If the embedded URL's <net_loc> is non-empty, we skip to\r\n // Step 7. Otherwise, the embedded URL inherits the <net_loc>\r\n // (if any) of the base URL.\r\n builtParts.netLoc = baseParts.netLoc;\r\n // 4) If the embedded URL path is preceded by a slash \"/\", the\r\n // path is not relative and we skip to Step 7.\r\n if (relativeParts.path[0] !== '/') {\r\n if (!relativeParts.path) {\r\n // 5) If the embedded URL path is empty (and not preceded by a\r\n // slash), then the embedded URL inherits the base URL path\r\n builtParts.path = baseParts.path;\r\n // 5a) if the embedded URL's <params> is non-empty, we skip to\r\n // step 7; otherwise, it inherits the <params> of the base\r\n // URL (if any) and\r\n if (!relativeParts.params) {\r\n builtParts.params = baseParts.params;\r\n // 5b) if the embedded URL's <query> is non-empty, we skip to\r\n // step 7; otherwise, it inherits the <query> of the base\r\n // URL (if any) and we skip to step 7.\r\n if (!relativeParts.query) {\r\n builtParts.query = baseParts.query;\r\n }\r\n }\r\n } else {\r\n // 6) The last segment of the base URL's path (anything\r\n // following the rightmost slash \"/\", or the entire path if no\r\n // slash is present) is removed and the embedded URL's path is\r\n // appended in its place.\r\n var baseURLPath = baseParts.path;\r\n var newPath = baseURLPath.substring(0, baseURLPath.lastIndexOf('/') + 1) + relativeParts.path;\r\n builtParts.path = URLToolkit.normalizePath(newPath);\r\n }\r\n }\r\n }\r\n if (builtParts.path === null) {\r\n builtParts.path = opts.alwaysNormalize ? URLToolkit.normalizePath(relativeParts.path) : relativeParts.path;\r\n }\r\n return URLToolkit.buildURLFromParts(builtParts);\r\n },\r\n parseURL: function(url) {\r\n var parts = URL_REGEX.exec(url);\r\n if (!parts) {\r\n return null;\r\n }\r\n return {\r\n scheme: parts[1] || '',\r\n netLoc: parts[2] || '',\r\n path: parts[3] || '',\r\n params: parts[4] || '',\r\n query: parts[5] || '',\r\n fragment: parts[6] || ''\r\n };\r\n },\r\n normalizePath: function(path) {\r\n // The following operations are\r\n // then applied, in order, to the new path:\r\n // 6a) All occurrences of \"./\", where \".\" is a complete path\r\n // segment, are removed.\r\n // 6b) If the path ends with \".\" as a complete path segment,\r\n // that \".\" is removed.\r\n path = path.split('').reverse().join('').replace(SLASH_DOT_REGEX, '');\r\n // 6c) All occurrences of \"<segment>/../\", where <segment> is a\r\n // complete path segment not equal to \"..\", are removed.\r\n // Removal of these path segments is performed iteratively,\r\n // removing the leftmost matching pattern on each iteration,\r\n // until no matching pattern remains.\r\n // 6d) If the path ends with \"<segment>/..\", where <segment> is a\r\n // complete path segment not equal to \"..\", that\r\n // \"<segment>/..\" is removed.\r\n while (path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, '')).length) {} // jshint ignore:line\r\n return path.split('').reverse().join('');\r\n },\r\n buildURLFromParts: function(parts) {\r\n return parts.scheme + parts.netLoc + parts.path + parts.params + parts.query + parts.fragment;\r\n }\r\n };\r\n\r\n/* jshint ignore:start */\r\n if(typeof exports === 'object' && typeof module === 'object')\r\n module.exports = URLToolkit;\r\n else if(typeof define === 'function' && define.amd)\r\n define([], function() { return URLToolkit; });\r\n else if(typeof exports === 'object')\r\n exports[\"URLToolkit\"] = URLToolkit;\r\n else\r\n root[\"URLToolkit\"] = URLToolkit;\r\n})(this);\r\n/* jshint ignore:end */\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/url-toolkit/src/url-toolkit.js","var 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\n\n// WEBPACK FOOTER //\n// node_modules/webworkify/index.js","/**\n * HLS config\n */\n'use strict';\n\nimport AbrController from './controller/abr-controller';\nimport BufferController from './controller/buffer-controller';\nimport CapLevelController from './controller/cap-level-controller';\nimport FPSController from './controller/fps-controller';\nimport XhrLoader from './utils/xhr-loader';\n//import FetchLoader from './utils/fetch-loader';\n//#if altaudio\nimport AudioTrackController from './controller/audio-track-controller';\nimport AudioStreamController from './controller/audio-stream-controller';\n//#endif\n\n//#if subtitle\nimport Cues from './utils/cues';\nimport TimelineController from './controller/timeline-controller';\nimport SubtitleTrackController from './controller/subtitle-track-controller';\nimport SubtitleStreamController from './controller/subtitle-stream-controller';\n//#endif\n\nexport var hlsDefaultConfig = {\n autoStartLoad: true, // used by stream-controller\n startPosition: -1, // used by stream-controller\n defaultAudioCodec: undefined, // used by stream-controller\n debug: false, // used by logger\n capLevelOnFPSDrop: false, // used by fps-controller\n capLevelToPlayerSize: false, // used by cap-level-controller\n initialLiveManifestSize: 1, // used by stream-controller\n maxBufferLength: 30, // used by stream-controller\n maxBufferSize: 60 * 1000 * 1000, // used by stream-controller\n maxBufferHole: 0.5, // used by stream-controller\n maxSeekHole: 2, // used by stream-controller\n lowBufferWatchdogPeriod: 0.5, // used by stream-controller\n highBufferWatchdogPeriod: 3, // used by stream-controller\n nudgeOffset: 0.1, // used by stream-controller\n nudgeMaxRetry : 3, // used by stream-controller\n maxFragLookUpTolerance: 0.25, // used by stream-controller\n liveSyncDurationCount:3, // used by stream-controller\n liveMaxLatencyDurationCount: Infinity, // used by stream-controller\n liveSyncDuration: undefined, // used by stream-controller\n liveMaxLatencyDuration: undefined, // used by stream-controller\n maxMaxBufferLength: 600, // used by stream-controller\n enableWorker: true, // used by demuxer\n enableSoftwareAES: true, // used by decrypter\n manifestLoadingTimeOut: 10000, // used by playlist-loader\n manifestLoadingMaxRetry: 1, // used by playlist-loader\n manifestLoadingRetryDelay: 1000, // used by playlist-loader\n manifestLoadingMaxRetryTimeout: 64000, // used by playlist-loader\n startLevel: undefined, // used by level-controller\n levelLoadingTimeOut: 10000, // used by playlist-loader\n levelLoadingMaxRetry: 4, // used by playlist-loader\n levelLoadingRetryDelay: 1000, // used by playlist-loader\n levelLoadingMaxRetryTimeout: 64000, // used by playlist-loader\n fragLoadingTimeOut: 20000, // used by fragment-loader\n fragLoadingMaxRetry: 6, // used by fragment-loader\n fragLoadingRetryDelay: 1000, // used by fragment-loader\n fragLoadingMaxRetryTimeout: 64000, // used by fragment-loader\n fragLoadingLoopThreshold: 3, // used by stream-controller\n startFragPrefetch: false, // used by stream-controller\n fpsDroppedMonitoringPeriod: 5000, // used by fps-controller\n fpsDroppedMonitoringThreshold: 0.2, // used by fps-controller\n appendErrorMaxRetry: 3, // used by buffer-controller\n loader: XhrLoader,\n //loader: FetchLoader,\n fLoader: undefined,\n pLoader: undefined,\n xhrSetup: undefined,\n fetchSetup: undefined,\n abrController: AbrController,\n bufferController: BufferController,\n capLevelController: CapLevelController,\n fpsController: FPSController,\n//#if altaudio\n audioStreamController: AudioStreamController,\n audioTrackController : AudioTrackController,\n//#endif\n//#if subtitle\n subtitleStreamController: SubtitleStreamController,\n subtitleTrackController: SubtitleTrackController,\n timelineController: TimelineController,\n cueHandler: Cues,\n enableCEA708Captions: true, // used by timeline-controller\n enableWebVTT: true, // used by timeline-controller\n captionsTextTrack1Label: 'English', // used by timeline-controller\n captionsTextTrack1LanguageCode: 'en', // used by timeline-controller\n captionsTextTrack2Label: 'Spanish', // used by timeline-controller\n captionsTextTrack2LanguageCode: 'es', // used by timeline-controller\n//#endif\n stretchShortVideoTrack: false, // used by mp4-remuxer\n forceKeyFrameOnDiscontinuity: true, // used by ts-demuxer\n abrEwmaFastLive: 3, // used by abr-controller\n abrEwmaSlowLive: 9, // used by abr-controller\n abrEwmaFastVoD: 3, // used by abr-controller\n abrEwmaSlowVoD: 9, // used by abr-controller\n abrEwmaDefaultEstimate: 5e5, // 500 kbps // used by abr-controller\n abrBandWidthFactor : 0.95, // used by abr-controller\n abrBandWidthUpFactor : 0.7, // used by abr-controller\n abrMaxWithRealBitrate : false, // used by abr-controller\n maxStarvationDelay : 4, // used by abr-controller\n maxLoadingDelay : 4, // used by abr-controller\n minAutoBitrate: 0 // used by hls\n };\n\n\n\n// WEBPACK FOOTER //\n// src/config.js","/*\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\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport BufferHelper from '../helper/buffer-helper';\nimport {ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\nimport EwmaBandWidthEstimator from '../utils/ewma-bandwidth-estimator';\n\nclass AbrController extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.FRAG_LOADING,\n Event.FRAG_LOADED,\n Event.FRAG_BUFFERED,\n Event.ERROR);\n this.lastLoadedFragLevel = 0;\n this._nextAutoLevel = -1;\n this.hls = hls;\n this.onCheck = this._abandonRulesCheck.bind(this);\n }\n\n destroy() {\n this.clearTimer();\n EventHandler.prototype.destroy.call(this);\n }\n\n onFragLoading(data) {\n let 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 let hls = this.hls,\n level = data.frag.level,\n isLive = hls.levels[level].details.live,\n config = hls.config,\n ewmaFast, ewmaSlow;\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 EwmaBandWidthEstimator(hls,ewmaSlow,ewmaFast,config.abrEwmaDefaultEstimate);\n }\n this.fragCurrent = frag;\n }\n }\n\n _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 let hls = this.hls, v = hls.media,frag = this.fragCurrent, loader = frag.loader, minAutoLevel = hls.minAutoLevel;\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.warn('frag loader destroy or aborted, disarm abandonRules');\n this.clearTimer();\n return;\n }\n let 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 let 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 let levels = hls.levels,\n 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\n // compute expected fragment length using frag duration and level bitrate. also ensure that expected len is gte than already loaded size\n level = levels[frag.level],\n levelBitrate = level.realBitrate ? Math.max(level.realBitrate,level.bitrate) : level.bitrate,\n expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levelBitrate / 8)),\n pos = v.currentTime,\n fragLoadedDelay = (expectedLen - stats.loaded) / loadRate,\n bufferStarvationDelay = (BufferHelper.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 let fragLevelNextLoadedDelay, nextLoadLevel;\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 > minAutoLevel ; 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 let levelNextBitrate = levels[nextLoadLevel].realBitrate ? Math.max(levels[nextLoadLevel].realBitrate,levels[nextLoadLevel].bitrate) : levels[nextLoadLevel].bitrate;\n fragLevelNextLoadedDelay = frag.duration * levelNextBitrate / (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 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(Event.FRAG_LOAD_EMERGENCY_ABORTED, {frag: frag, stats: stats });\n }\n }\n }\n }\n }\n\n onFragLoaded(data) {\n let frag = data.frag;\n if (frag.type === 'main' && !isNaN(frag.sn)) {\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\n // compute level average bitrate\n if (this.hls.config.abrMaxWithRealBitrate) {\n const level = this.hls.levels[frag.level];\n let loadedBytes = (level.loaded ? level.loaded.bytes : 0) + data.stats.loaded;\n let loadedDuration = (level.loaded ? level.loaded.duration : 0) + data.frag.duration;\n level.loaded = { bytes : loadedBytes, duration : loadedDuration };\n level.realBitrate = Math.round(8*loadedBytes/loadedDuration);\n }\n // if fragment has been loaded to perform a bitrate test,\n if (data.frag.bitrateTest) {\n let stats = data.stats;\n stats.tparsed = stats.tbuffered = stats.tload;\n this.onFragBuffered(data);\n }\n }\n }\n\n onFragBuffered(data) {\n var stats = data.stats, 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' && !isNaN(frag.sn) && ((!frag.bitrateTest || stats.tload === stats.tbuffered))) {\n // use tparsed-trequest instead of tbuffered-trequest to compute fragLoadingProcessing; rationale is that buffer appending only happens once media is attached\n // 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\n // as a consequence it could happen really late in the process. meaning that appending duration might appears huge ... leading to underestimated throughput estimation\n let fragLoadingProcessingMs = stats.tparsed - stats.trequest;\n 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 stats.bwEstimate = this._bwEstimator.getEstimate();\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 onError(data) {\n // stop timer in case of frag loading error\n switch(data.details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n this.clearTimer();\n break;\n default:\n break;\n }\n }\n\n clearTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n }\n\n // return next auto level\n get nextAutoLevel() {\n const forcedAutoLevel = this._nextAutoLevel;\n const bwEstimator = this._bwEstimator;\n // in case next auto level has been forced, and bw not available or not reliable, return forced value\n if (forcedAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {\n return forcedAutoLevel;\n }\n // compute next level using ABR logic\n let nextABRAutoLevel = this._nextABRAutoLevel;\n // if forced auto level has been defined, use it to cap ABR computed quality level\n if (forcedAutoLevel !== -1) {\n nextABRAutoLevel = Math.min(forcedAutoLevel,nextABRAutoLevel);\n }\n return nextABRAutoLevel;\n }\n get _nextABRAutoLevel() {\n var hls = this.hls, maxAutoLevel = hls.maxAutoLevel, levels = hls.levels, config = hls.config, minAutoLevel = hls.minAutoLevel;\n const v = hls.media,\n currentLevel = this.lastLoadedFragLevel,\n currentFragDuration = this.fragCurrent ? this.fragCurrent.duration : 0,\n pos = (v ? v.currentTime : 0),\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 // bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.\n bufferStarvationDelay = (BufferHelper.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 let 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.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 let maxStarvationDelay = currentFragDuration ? Math.min(currentFragDuration,config.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 let 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 // cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration\n const maxLoadingDelay = currentFragDuration ? Math.min(currentFragDuration,config.maxLoadingDelay) : config.maxLoadingDelay;\n maxStarvationDelay = maxLoadingDelay - bitrateTestDelay;\n 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 _findBestLevel(currentLevel,currentFragDuration,currentBw,minAutoLevel,maxAutoLevel,maxFetchDuration,bwFactor,bwUpFactor,levels) {\n for (let i = maxAutoLevel; i >= minAutoLevel; i--) {\n let levelInfo = levels[i],\n levelDetails = levelInfo.details,\n avgDuration = levelDetails ? levelDetails.totalduration/levelDetails.fragments.length : currentFragDuration,\n live = levelDetails ? levelDetails.live : false,\n adjustedbw;\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 const bitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate,levels[i].bitrate) : levels[i].bitrate,\n fetchDuration = bitrate * avgDuration / adjustedbw;\n\n 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 live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches\n // 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 ...\n // special case to support startLevel = -1 (bitrateTest) on live streams : in that case we should not exit loop so that _findBestLevel will return -1\n (!fetchDuration || (live && !this.bitrateTestDelay) || fetchDuration < maxFetchDuration) ) {\n // as we are looping from highest to lowest, this will return the best achievable quality level\n return i;\n }\n }\n // not enough time budget even with quality level 0 ... rebuffering might happen\n return -1;\n }\n\n set nextAutoLevel(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n}\n\nexport default AbrController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/abr-controller.js","/*\n * Audio Stream Controller\n*/\n\nimport BinarySearch from '../utils/binary-search';\nimport BufferHelper from '../helper/buffer-helper';\nimport Demuxer from '../demux/demuxer';\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport LevelHelper from '../helper/level-helper';\nimport TimeRanges from '../utils/timeRanges';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nconst 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 BUFFER_FLUSHING : 'BUFFER_FLUSHING',\n ENDED : 'ENDED',\n ERROR : 'ERROR',\n WAITING_INIT_PTS : 'WAITING_INIT_PTS'\n};\n\nclass AudioStreamController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.AUDIO_TRACKS_UPDATED,\n Event.AUDIO_TRACK_SWITCHING,\n Event.AUDIO_TRACK_LOADED,\n Event.KEY_LOADED,\n Event.FRAG_LOADED,\n Event.FRAG_PARSING_INIT_SEGMENT,\n Event.FRAG_PARSING_DATA,\n Event.FRAG_PARSED,\n Event.ERROR,\n Event.BUFFER_CREATED,\n Event.BUFFER_APPENDED,\n Event.BUFFER_FLUSHED,\n Event.INIT_PTS_FOUND);\n\n this.config = hls.config;\n this.audioCodecSwap = false;\n this.ticks = 0;\n this._state = State.STOPPED;\n this.ontick = this.tick.bind(this);\n this.initPTS=[];\n this.waitingFragment=null;\n }\n\n destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n EventHandler.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n\n //Signal that video PTS was found\n onInitPtsFound(data) {\n var demuxerId=data.id, cc = data.frag.cc, initPTS = data.initPTS;\n if(demuxerId === 'main') {\n //Always update the new INIT PTS\n //Can change due level switch\n this.initPTS[cc] = initPTS;\n logger.log(`InitPTS for cc:${cc} found from video track:${initPTS}`);\n\n //If we are waiting we need to demux/remux the waiting frag\n //With the new initPTS\n if (this.state === State.WAITING_INIT_PTS) {\n logger.log('sending pending audio frag to demuxer');\n this.state = State.FRAG_LOADING;\n //We have audio frag waiting or video pts\n //Let process it\n this.onFragLoaded(this.waitingFragment);\n //Lets clean the waiting frag\n this.waitingFragment = null;\n }\n }\n }\n\n startLoad(startPosition) {\n if (this.tracks) {\n var lastCurrentTime = this.lastCurrentTime;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.fragLoadError = 0;\n if (lastCurrentTime > 0 && startPosition === -1) {\n logger.log(`audio:override startPosition with lastCurrentTime @${lastCurrentTime.toFixed(3)}`);\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 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 set state(nextState) {\n if (this.state !== nextState) {\n const previousState = this.state;\n this._state = nextState;\n logger.log(`audio stream:${previousState}->${nextState}`);\n }\n }\n\n get state() {\n return this._state;\n }\n\n 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 doTick() {\n var pos, track, trackDetails, hls = this.hls, 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 case State.BUFFER_FLUSHING:\n break;\n case State.STARTING:\n this.state = State.WAITING_TRACK;\n this.loadedmetadata = false;\n break;\n case State.IDLE:\n const tracks = this.tracks;\n // audio tracks not received => exit loop\n if (!tracks) {\n break;\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 (!this.media &&\n (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 let media = this.mediaBuffer ? this.mediaBuffer : this.media,\n bufferInfo = BufferHelper.bufferInfo(media,pos,config.maxBufferHole),\n bufferLen = bufferInfo.len,\n bufferEnd = bufferInfo.end,\n fragPrevious = this.fragPrevious,\n maxBufLen = config.maxMaxBufferLength,\n audioSwitch = this.audioSwitch,\n trackId = this.trackId;\n\n // if buffer length is less than maxBufLen try to load a new fragment\n if ((bufferLen < maxBufLen || audioSwitch) && trackId < tracks.length) {\n trackDetails = tracks[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 (!audioSwitch && !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(Event.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 let fragments = trackDetails.fragments,\n fragLen = fragments.length,\n start = fragments[0].start,\n end = fragments[fragLen-1].start + fragments[fragLen-1].duration,\n frag;\n\n // When switching audio track, reload audio as close as possible to currentTime\n if(audioSwitch){\n if (trackDetails.live && !trackDetails.PTSKnown) {\n logger.log(`switching audiotrack, live stream, unknown PTS,load first fragment`);\n bufferEnd = 0;\n } else {\n bufferEnd = pos;\n // if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime\n if (trackDetails.PTSKnown && pos < start) {\n // if everything is buffered from pos to start or if audio buffer upfront, let's seek to start\n if (bufferInfo.end > start || bufferInfo.nextStart) {\n logger.log('alt audio track ahead of main track, seek to start of alt audio track');\n this.media.currentTime = start + 0.05;\n } else {\n return;\n }\n }\n }\n }\n if (trackDetails.initSegment && !trackDetails.initSegment.data) {\n frag = trackDetails.initSegment;\n }\n // if bufferEnd before start of playlist, load first fragment\n else if (bufferEnd <= start) {\n frag = fragments[0];\n if (trackDetails.live && frag.loadIdx && frag.loadIdx === this.fragLoadIdx) {\n // we just loaded this first fragment, and we are still lagging behind the start of the live playlist\n // let's force seek to start\n const nextBuffered = bufferInfo.nextStart ? bufferInfo.nextStart : start;\n logger.log(`no alt audio available @currentTime:${this.media.currentTime}, seeking @${nextBuffered + 0.05}`);\n this.media.currentTime = nextBuffered + 0.05;\n return;\n }\n } else {\n let foundFrag;\n let maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n const fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;\n let fragmentWithinToleranceTest = (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 // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments\n let candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);\n if ((candidate.start + candidate.duration - candidateLookupTolerance) <= bufferEnd) {\n return 1;\n }// if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n };\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n // Prefer the next fragment if it's within tolerance\n if (fragNext && !fragmentWithinToleranceTest(fragNext)) {\n foundFrag = fragNext;\n } else {\n foundFrag = BinarySearch.search(fragments, fragmentWithinToleranceTest);\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.log(`SN just loaded, load next one: ${frag.sn}`);\n } else {\n frag = null;\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 && (frag.decryptdata.uri != null) && (frag.decryptdata.key == null)) {\n logger.log(`Loading key for ${frag.sn} of [${trackDetails.startSN} ,${trackDetails.endSN}],track ${trackId}`);\n this.state = State.KEY_LOADING;\n hls.trigger(Event.KEY_LOADING, {frag: frag});\n } else {\n logger.log(`Loading ${frag.sn} of [${trackDetails.startSN} ,${trackDetails.endSN}],track ${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 let 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 if (!isNaN(frag.sn)) {\n this.nextLoadPosition = frag.start + frag.duration;\n }\n hls.trigger(Event.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.log(`audioStreamController: retryDate reached, switch back to IDLE state`);\n this.state = State.IDLE;\n }\n break;\n case State.WAITING_INIT_PTS:\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 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 let config = this.config;\n if(this.tracks && config.autoStartLoad) {\n this.startLoad(config.startPosition);\n }\n }\n\n onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n 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(track => {\n if(track.details) {\n track.details.fragments.forEach(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 = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n\n 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 onMediaEnded() {\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n\n onAudioTracksUpdated(data) {\n logger.log('audio tracks updated');\n this.tracks = data.audioTracks;\n }\n\n onAudioTrackSwitching(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 this.waitingFragment=null;\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\n //should we switch tracks ?\n if(altAudio){\n this.audioSwitch = true;\n //main audio track are handled by stream-controller, just do something if switching to alt audio track\n this.state=State.IDLE;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n }\n this.tick();\n }\n\n onAudioTrackLoaded(data) {\n var newDetails = data.details,\n trackId = data.id,\n track = this.tracks[trackId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n logger.log(`track ${trackId} loaded [${newDetails.startSN},${newDetails.endSN}],duration:${duration}`);\n\n if (newDetails.live) {\n var curDetails = track.details;\n if (curDetails && newDetails.fragments.length > 0) {\n // we already have details for that level, merge them\n LevelHelper.mergeDetails(curDetails,newDetails);\n sliding = newDetails.fragments[0].start;\n // TODO\n //this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n logger.log(`live audio playlist sliding:${sliding.toFixed(3)}`);\n } else {\n logger.log('live audio playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n logger.log('live audio playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n track.details = newDetails;\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 let startTimeOffset = newDetails.startTimeOffset;\n if(!isNaN(startTimeOffset)) {\n 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 onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n\n onFragLoaded(data) {\n var fragCurrent = this.fragCurrent,\n fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING &&\n fragCurrent &&\n fragLoaded.type === 'audio' &&\n fragLoaded.level === fragCurrent.level &&\n fragLoaded.sn === fragCurrent.sn) {\n var track = this.tracks[this.trackId],\n details = track.details,\n duration = details.totalduration,\n trackId = fragCurrent.level,\n sn = fragCurrent.sn,\n cc = fragCurrent.cc,\n audioCodec = this.config.defaultAudioCodec || track.audioCodec || 'mp4a.40.2',\n stats = this.stats = data.stats;\n if (sn === 'initSegment') {\n this.state = State.IDLE;\n\n stats.tparsed = stats.tbuffered = performance.now();\n details.initSegment.data = data.payload;\n this.hls.trigger(Event.FRAG_BUFFERED, {stats: stats, frag: fragCurrent, id : 'audio'});\n this.tick();\n } else {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.appended = false;\n if(!this.demuxer) {\n this.demuxer = new Demuxer(this.hls,'audio');\n }\n //Check if we have video initPTS\n // If not we need to wait for it\n let initPTS = this.initPTS[cc];\n let initSegmentData = details.initSegment ? details.initSegment.data : [];\n if (details.initSegment || initPTS !== undefined){\n this.pendingBuffering = true;\n 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 let accurateTimeOffset = false; //details.PTSKnown || !details.live;\n this.demuxer.push(data.payload, initSegmentData, audioCodec, null, fragCurrent, duration, accurateTimeOffset, initPTS);\n } else {\n 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}`);\n this.waitingFragment=data;\n this.state=State.WAITING_INIT_PTS;\n }\n }\n }\n this.fragLoadError = 0;\n }\n\n onFragParsingInitSegment(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'audio' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n let tracks = data.tracks, track;\n\n // delete any video track found on audio demuxer\n if (tracks.video) {\n delete tracks.video;\n }\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(Event.BUFFER_CODECS,tracks);\n logger.log(`audio track:audio,container:${track.container},codecs[level/parsed]=[${track.levelCodec}/${track.codec}]`);\n let initSegment = track.initSegment;\n if (initSegment) {\n let appendObj = {type: 'audio', data: initSegment, parent : 'audio',content : 'initSegment'};\n if (this.audioSwitch) {\n this.pendingData = [appendObj];\n } else {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(Event.BUFFER_APPENDING, appendObj);\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n }\n\n onFragParsingData(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'audio' &&\n data.type === 'audio' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n let trackId= this.trackId,\n track = this.tracks[trackId],\n hls = this.hls;\n\n if (isNaN(data.endPTS)) {\n data.endPTS = data.startPTS + fragCurrent.duration;\n data.endDTS = data.startDTS + fragCurrent.duration;\n }\n\n 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 LevelHelper.updateFragPTSDTS(track.details,fragCurrent,data.startPTS,data.endPTS);\n\n let audioSwitch = this.audioSwitch, media = this.media, appendOnBufferFlush = false;\n //Only flush audio from old audio tracks when PTS is known on new audio track\n if(audioSwitch && media) {\n if (media.readyState) {\n let currentTime = media.currentTime;\n logger.log('switching audio track : currentTime:'+ currentTime);\n if (currentTime >= data.startPTS) {\n logger.log('switching audio track : flushing all audio');\n this.state = State.BUFFER_FLUSHING;\n hls.trigger(Event.BUFFER_FLUSHING, {startOffset: 0 , endOffset: Number.POSITIVE_INFINITY, type : 'audio'});\n appendOnBufferFlush = true;\n //Lets announce that the initial audio track switch flush occur\n this.audioSwitch = false;\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : trackId});\n }\n } else {\n //Lets announce that the initial audio track switch flush occur\n this.audioSwitch=false;\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : trackId});\n }\n }\n\n\n let pendingData = this.pendingData;\n if(!this.audioSwitch) {\n [data.data1, data.data2].forEach(buffer => {\n if (buffer && buffer.length) {\n pendingData.push({type: data.type, data: buffer, parent : 'audio',content : 'data'});\n }\n });\n if (!appendOnBufferFlush && pendingData.length) {\n pendingData.forEach(appendObj => {\n // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)\n // in that case it is useless to append following segments\n if (this.state === State.PARSING) {\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(Event.BUFFER_APPENDING, appendObj);\n }\n });\n this.pendingData = [];\n this.appended = true;\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsed(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'audio' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n\n\n onBufferCreated(data) {\n let audioTrack = data.tracks.audio;\n if (audioTrack) {\n this.mediaBuffer = audioTrack.buffer;\n this.loadedmetadata = true;\n }\n }\n\n onBufferAppended(data) {\n if (data.parent === 'audio') {\n const state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = (data.pending > 0);\n this._checkAppendedParsed();\n }\n }\n }\n\n _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n let frag = this.fragCurrent, stats = this.stats, hls = this.hls;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = performance.now();\n hls.trigger(Event.FRAG_BUFFERED, {stats: stats, frag: frag, id : 'audio'});\n let media = this.mediaBuffer ? this.mediaBuffer : this.media;\n logger.log(`audio buffered : ${TimeRanges.toString(media.buffered)}`);\n if (this.audioSwitch && this.appended) {\n this.audioSwitch = false;\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : this.trackId});\n }\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n\n onError(data) {\n let 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 ErrorDetails.FRAG_LOAD_ERROR:\n case 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 let 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.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.error(`audioStreamController: ${data.details} reaches max retry, redispatch as fatal ...`);\n // switch error to fatal\n data.fatal = true;\n this.state = State.ERROR;\n }\n }\n break;\n case ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case ErrorDetails.AUDIO_TRACK_LOAD_ERROR:\n case ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:\n case ErrorDetails.KEY_LOAD_ERROR:\n case 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.warn(`audioStreamController: ${data.details} while loading frag,switch to ${this.state} state ...`);\n }\n break;\n case ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (data.parent === 'audio' && (this.state === State.PARSING || this.state === State.PARSED)) {\n const media = this.mediaBuffer,\n currentTime = this.media.currentTime,\n mediaBuffered = media && BufferHelper.isBuffered(media,currentTime) && BufferHelper.isBuffered(media,currentTime+0.5);\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n const config = this.config;\n if(config.maxMaxBufferLength >= config.maxBufferLength) {\n // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...\n config.maxMaxBufferLength/=2;\n logger.warn(`audio:reduce max buffer length to ${config.maxMaxBufferLength}s`);\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\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/video-dev/hls.js/pull/708\n // in that case flush the whole audio buffer to recover\n logger.warn('buffer full error also media.currentTime is not buffered, flush audio buffer');\n this.fragCurrent = null;\n // flush everything\n this.state = State.BUFFER_FLUSHING;\n this.hls.trigger(Event.BUFFER_FLUSHING, {startOffset: 0 , endOffset: Number.POSITIVE_INFINITY, type : 'audio'});\n }\n }\n break;\n default:\n break;\n }\n }\n\n onBufferFlushed() {\n let pendingData = this.pendingData;\n if (pendingData && pendingData.length) {\n logger.log('appending pending audio data on Buffer Flushed');\n pendingData.forEach(appendObj => {\n this.hls.trigger(Event.BUFFER_APPENDING, appendObj);\n });\n this.appended = true;\n this.pendingData = [];\n this.state = State.PARSED;\n } else {\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}\nexport default AudioStreamController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/audio-stream-controller.js","/*\n * audio track controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nclass AudioTrackController extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.MANIFEST_LOADING,\n Event.MANIFEST_LOADED,\n Event.AUDIO_TRACK_LOADED);\n this.ticks = 0;\n this.ontick = this.tick.bind(this);\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n 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 doTick() {\n this.updateTrack(this.trackId);\n }\n onManifestLoading() {\n // reset audio tracks on manifest loading\n this.tracks = [];\n this.trackId = -1;\n }\n\n onManifestLoaded(data) {\n let tracks = data.audioTracks || [];\n let defaultFound = false;\n this.tracks = tracks;\n this.hls.trigger(Event.AUDIO_TRACKS_UPDATED, {audioTracks : tracks});\n // loop through available audio tracks and autoselect default if needed\n let id = 0;\n tracks.forEach(track => {\n if(track.default) {\n this.audioTrack = id;\n defaultFound = true;\n return;\n }\n id++;\n });\n if (defaultFound === false && tracks.length) {\n logger.log('no default audio track defined, use first audio track as default');\n this.audioTrack = 0;\n }\n }\n\n onAudioTrackLoaded(data) {\n if (data.id < this.tracks.length) {\n 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 get audioTracks() {\n return this.tracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n get audioTrack() {\n return this.trackId;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n set audioTrack(audioTrackId) {\n if (this.trackId !== audioTrackId || this.tracks[audioTrackId].details === undefined) {\n this.setAudioTrackInternal(audioTrackId);\n }\n }\n\n 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.log(`switching to audioTrack ${newId}`);\n let audioTrack = this.tracks[newId],\n hls = this.hls,\n type = audioTrack.type,\n url = audioTrack.url,\n eventObj = {id: newId, type : type, url : url};\n // keep AUDIO_TRACK_SWITCH for legacy reason\n hls.trigger(Event.AUDIO_TRACK_SWITCH, eventObj);\n hls.trigger(Event.AUDIO_TRACK_SWITCHING, eventObj);\n // check if we need to load playlist for this audio Track\n let 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.log(`(re)loading playlist for audioTrack ${newId}`);\n hls.trigger(Event.AUDIO_TRACK_LOADING, {url: url, id: newId});\n }\n }\n }\n\n updateTrack(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.log(`updating audioTrack ${newId}`);\n let audioTrack = this.tracks[newId], url = audioTrack.url;\n // check if we need to load playlist for this audio Track\n let 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.log(`(re)loading playlist for audioTrack ${newId}`);\n this.hls.trigger(Event.AUDIO_TRACK_LOADING, {url: url, id: newId});\n }\n }\n }\n}\n\nexport default AudioTrackController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/audio-track-controller.js","/*\n * Buffer Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n\n\nclass BufferController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHING,\n Event.MEDIA_DETACHING,\n Event.MANIFEST_PARSED,\n Event.BUFFER_RESET,\n Event.BUFFER_APPENDING,\n Event.BUFFER_CODECS,\n Event.BUFFER_EOS,\n Event.BUFFER_FLUSHING,\n Event.LEVEL_PTS_UPDATED,\n Event.LEVEL_UPDATED);\n\n // the value that we have set mediasource.duration to\n // (the actual duration may be tweaked slighly by the browser)\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 this.tracks = {};\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n onLevelPtsUpdated(data) {\n let type = data.type;\n let audioTrack = this.tracks.audio;\n\n // Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)\n // in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`\n // 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\n // `SourceBuffer.abort()` and adjusting `SourceBuffer.timestampOffset` if `SourceBuffer.updating` is false or awaiting `updateend`\n // event if SB is in updating state.\n // More info here: https://github.com/video-dev/hls.js/issues/332#issuecomment-257986486\n\n if (type === 'audio' && audioTrack && audioTrack.container === 'audio/mpeg') { // Chrome audio mp3 track\n let audioBuffer = this.sourceBuffer.audio;\n let delta = Math.abs(audioBuffer.timestampOffset - data.start);\n\n // adjust timestamp offset if time delta is greater than 100ms\n if (delta > 0.1) {\n let updating = audioBuffer.updating;\n\n try {\n audioBuffer.abort();\n } catch (err) {\n updating = true;\n logger.warn('can not abort audio buffer: ' + err);\n }\n\n if (!updating) {\n logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + data.start);\n audioBuffer.timestampOffset = data.start;\n } else {\n this.audioTimestampOffset = data.start;\n }\n }\n }\n }\n\n onManifestParsed(data) {\n let 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.log(`${sourceBufferNb} sourceBuffer(s) expected`);\n }\n this.sourceBufferNb = sourceBufferNb;\n }\n\n onMediaAttaching(data) {\n let 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 onMediaDetaching() {\n 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.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 URL.revokeObjectURL(this.media.src);\n this.media.removeAttribute('src');\n this.media.load();\n }\n\n this.mediaSource = null;\n this.media = null;\n this.pendingTracks = {};\n this.tracks = {};\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(Event.MEDIA_DETACHED);\n }\n\n onMediaSourceOpen() {\n logger.log('media source opened');\n this.hls.trigger(Event.MEDIA_ATTACHED, { media : this.media });\n let 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 checkPendingTracks() {\n // if any buffer codecs pending, check if we have enough to create sourceBuffers\n let 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 && (\n this.sourceBufferNb <= pendingTracksNb ||\n 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 onMediaSourceClose() {\n logger.log('media source closed');\n }\n\n onMediaSourceEnded() {\n logger.log('media source ended');\n }\n\n\n onSBUpdateEnd() {\n // update timestampOffset\n if (this.audioTimestampOffset) {\n let audioBuffer = this.sourceBuffer.audio;\n logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + this.audioTimestampOffset);\n audioBuffer.timestampOffset = this.audioTimestampOffset;\n delete this.audioTimestampOffset;\n }\n\n if (this._needsFlush) {\n this.doFlush();\n }\n\n if (this._needsEos) {\n this.checkEos();\n }\n this.appending = false;\n let parent = this.parent;\n // count nb of pending segments waiting for appending on this sourcebuffer\n let pending = this.segments.reduce( (counter, segment) => (segment.parent === parent) ? counter + 1 : counter , 0);\n this.hls.trigger(Event.BUFFER_APPENDED, { parent : parent, pending : pending });\n\n // don't append in flushing mode\n if (!this._needsFlush) {\n this.doAppending();\n }\n\n this.updateMediaElementDuration();\n }\n\n onSBUpdateError(event) {\n 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 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 }\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n\n 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) { this.pendingTracks[trackName] = tracks[trackName]; }\n let 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\n createSourceBuffers(tracks) {\n var sourceBuffer = this.sourceBuffer,mediaSource = this.mediaSource;\n\n for (let trackName in tracks) {\n if(!sourceBuffer[trackName]) {\n let track = tracks[trackName];\n // use levelCodec as first priority\n let codec = track.levelCodec || track.codec;\n let mimeType = `${track.container};codecs=${codec}`;\n logger.log(`creating sourceBuffer(${mimeType})`);\n try {\n let sb = sourceBuffer[trackName] = mediaSource.addSourceBuffer(mimeType);\n sb.addEventListener('updateend', this.onsbue);\n sb.addEventListener('error', this.onsbe);\n this.tracks[trackName] = {codec: codec, container: track.container};\n track.buffer = sb;\n } catch(err) {\n logger.error(`error while trying to add sourceBuffer:${err.message}`);\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_ADD_CODEC_ERROR, fatal: false, err: err, mimeType : mimeType});\n }\n }\n }\n this.hls.trigger(Event.BUFFER_CREATED, { tracks : tracks } );\n }\n\n 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 onBufferAppendFail(data) {\n 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false});\n }\n\n // on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()\n onBufferEos(data) {\n var sb = this.sourceBuffer;\n let dataType = data.type;\n for(let type in sb) {\n if (!dataType || type === dataType) {\n if (!sb[type].ended) {\n sb[type].ended = true;\n 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 checkEos() {\n var sb = this.sourceBuffer, mediaSource = this.mediaSource;\n if (!mediaSource || mediaSource.readyState !== 'open') {\n this._needsEos = false;\n return;\n }\n for(let type in sb) {\n let sbobj = sb[type];\n if (!sbobj.ended) {\n return;\n }\n if(sbobj.updating) {\n this._needsEos = true;\n return;\n }\n }\n 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 try {\n mediaSource.endOfStream();\n } catch(e) {\n logger.warn('exception while calling mediaSource.endOfStream()');\n }\n this._needsEos = false;\n }\n\n\n 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 onLevelUpdated(event) {\n let 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/video-dev/hls.js/issues/355\n updateMediaElementDuration() {\n let media = this.media,\n mediaSource = this.mediaSource,\n sourceBuffer = this.sourceBuffer,\n levelDuration = this._levelDuration;\n if (levelDuration === null || !media || !mediaSource || !sourceBuffer || media.readyState === 0 || mediaSource.readyState !== 'open') {\n return;\n }\n for (let 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 let duration = media.duration;\n // 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\n if ((levelDuration > this._msDuration && levelDuration > duration) || (duration === Infinity || isNaN(duration) )) {\n logger.log(`Updating mediasource duration to ${levelDuration.toFixed(3)}`);\n this._msDuration = mediaSource.duration = levelDuration;\n }\n }\n\n 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 try {\n for (var type in sourceBuffer) {\n appended += sourceBuffer[type].buffered.length;\n }\n } catch(error) {\n // error could be thrown while accessing buffered, in case sourcebuffer has already been removed from MediaSource\n // this is harmess at this stage, catch this to avoid reporting an internal exception\n logger.error('error while accessing sourceBuffer.buffered');\n }\n this.appended = appended;\n this.hls.trigger(Event.BUFFER_FLUSHED);\n }\n }\n\n doAppending() {\n var hls = this.hls, sourceBuffer = this.sourceBuffer, segments = this.segments;\n if (Object.keys(sourceBuffer).length) {\n if (this.media.error) {\n this.segments = [];\n 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 let segment = segments.shift();\n try {\n let type = segment.type, sb = sourceBuffer[type];\n if(sb) {\n if(!sb.updating) {\n // reset sourceBuffer ended flag before appending segment\n sb.ended = false;\n //logger.log(`appending ${segment.content} ${type} SB, size:${segment.data.length}, ${segment.parent}`);\n this.parent = segment.parent;\n sb.appendBuffer(segment.data);\n this.appendError = 0;\n this.appended++;\n this.appending = true;\n } else {\n segments.unshift(segment);\n }\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.error(`error while trying to append buffer:${err.message}`);\n segments.unshift(segment);\n var event = {type: ErrorTypes.MEDIA_ERROR, parent : segment.parent};\n if(err.code !== 22) {\n if (this.appendError) {\n this.appendError++;\n } else {\n this.appendError = 1;\n }\n event.details = ErrorDetails.BUFFER_APPEND_ERROR;\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.log(`fail ${hls.config.appendErrorMaxRetry} times to append segment in sourceBuffer`);\n segments = [];\n event.fatal = true;\n hls.trigger(Event.ERROR, event);\n return;\n } else {\n event.fatal = false;\n hls.trigger(Event.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 = ErrorDetails.BUFFER_FULL_ERROR;\n event.fatal = false;\n hls.trigger(Event.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 flushBuffer(startOffset, endOffset, typeIn) {\n var sb, i, bufStart, bufEnd, flushStart, flushEnd, sourceBuffer = this.sourceBuffer;\n if (Object.keys(sourceBuffer).length) {\n logger.log(`flushBuffer,pos/start/end: ${this.media.currentTime.toFixed(3)}/${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 try {\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.log(`flush ${type} [${flushStart},${flushEnd}], of [${bufStart},${bufEnd}], pos:${this.media.currentTime}`);\n sb.remove(flushStart, flushEnd);\n return false;\n }\n }\n } catch(e) {\n logger.warn('exception while accessing sourcebuffer, it might have been removed from MediaSource');\n }\n } else {\n //logger.log('abort ' + type + ' append in progress');\n // this will abort any appending in progress\n //sb.abort();\n logger.warn('cannot flush, sb updating in progress');\n return false;\n }\n }\n } else {\n logger.warn('abort flushing too many retries');\n }\n logger.log('buffer flushed');\n }\n // everything flushed !\n return true;\n }\n}\n\nexport default BufferController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/buffer-controller.js","/*\n * cap stream level to media size dimension controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\n\nclass CapLevelController extends EventHandler {\n\tconstructor(hls) {\n super(hls,\n Event.FPS_DROP_LEVEL_CAPPING,\n Event.MEDIA_ATTACHING,\n Event.MANIFEST_PARSED);\n\t}\n\n\tdestroy() {\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 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\tonMediaAttaching(data) {\n this.media = data.media instanceof HTMLVideoElement ? data.media : null;\n }\n\n onManifestParsed(data) {\n const hls = this.hls;\n if (hls.config.capLevelToPlayerSize) {\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n this.levels = data.levels;\n 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 detectPlayerSize() {\n if (this.media) {\n let levelsLength = this.levels ? this.levels.length : 0;\n if (levelsLength) {\n const hls = this.hls;\n hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);\n if (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 hls.streamController.nextLevelSwitch();\n }\n this.autoLevelCapping = 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 getMaxLevel(capLevelIndex) {\n let result = 0,\n i,\n level,\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 isLevelRestricted(level) {\n return (this.restrictedLevels && this.restrictedLevels.indexOf(level) !== -1) ? true : false;\n }\n\n get contentScaleFactor() {\n let pixelRatio = 1;\n try {\n pixelRatio = window.devicePixelRatio;\n } catch(e) {}\n return pixelRatio;\n }\n\n get mediaWidth() {\n let width;\n const media = this.media;\n if (media) {\n width = media.width || media.clientWidth || media.offsetWidth;\n width *= this.contentScaleFactor;\n }\n return width;\n }\n\n get mediaHeight() {\n let height;\n const media = this.media;\n if (media) {\n height = media.height || media.clientHeight || media.offsetHeight;\n height *= this.contentScaleFactor;\n }\n return height;\n }\n}\n\nexport default CapLevelController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/cap-level-controller.js","/*\n * FPS Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nclass FPSController extends EventHandler{\n\n constructor(hls) {\n super(hls, Event.MEDIA_ATTACHING);\n }\n\n destroy() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.isVideoPlaybackQualityAvailable = false;\n }\n\n onMediaAttaching(data) {\n const config = this.hls.config;\n if (config.capLevelOnFPSDrop) {\n const video = this.video = data.media instanceof HTMLVideoElement ? data.media : null;\n if (typeof video.getVideoPlaybackQuality === 'function') {\n this.isVideoPlaybackQualityAvailable = true;\n }\n clearInterval(this.timer);\n this.timer = setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod);\n }\n }\n\n checkFPS(video, decodedFrames, droppedFrames) {\n let currentTime = performance.now();\n if (decodedFrames) {\n if (this.lastTime) {\n let currentPeriod = currentTime - this.lastTime,\n currentDropped = droppedFrames - this.lastDroppedFrames,\n currentDecoded = decodedFrames - this.lastDecodedFrames,\n droppedFPS = 1000 * currentDropped / currentPeriod,\n hls = this.hls;\n hls.trigger(Event.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 > hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {\n let currentLevel = hls.currentLevel;\n logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);\n if (currentLevel > 0 && (hls.autoLevelCapping === -1 || hls.autoLevelCapping >= currentLevel)) {\n currentLevel = currentLevel - 1;\n hls.trigger(Event.FPS_DROP_LEVEL_CAPPING, {level: currentLevel, droppedLevel: hls.currentLevel});\n hls.autoLevelCapping = currentLevel;\n hls.streamController.nextLevelSwitch();\n }\n }\n }\n }\n this.lastTime = currentTime;\n this.lastDroppedFrames = droppedFrames;\n this.lastDecodedFrames = decodedFrames;\n }\n }\n\n checkFPSInterval() {\n const video = this.video;\n if (video) {\n if (this.isVideoPlaybackQualityAvailable) {\n let videoPlaybackQuality = video.getVideoPlaybackQuality();\n this.checkFPS(video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);\n } else {\n this.checkFPS(video, video.webkitDecodedFrameCount, video.webkitDroppedFrameCount);\n }\n }\n }\n}\n\nexport default FPSController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/fps-controller.js","/*\n * id3 metadata track controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\n\nclass ID3TrackController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.FRAG_PARSING_METADATA);\n this.id3Track = undefined;\n this.media = undefined;\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n // Add ID3 metatadata text track.\n onMediaAttached(data) {\n this.media = data.media;\n if (!this.media) {\n return;\n }\n\n this.id3Track = this.media.addTextTrack('metadata', 'id3');\n this.id3Track.mode = 'hidden';\n }\n\n onMediaDetaching() {\n this.media = undefined;\n }\n\n onFragParsingMetadata(data) {\n const fragment = data.frag;\n const samples = data.samples;\n const startTime = fragment.start;\n let endTime = fragment.start + fragment.duration;\n // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE\n if (startTime === endTime) {\n endTime += 0.0001;\n }\n\n // Attempt to recreate Safari functionality by creating\n // WebKitDataCue objects when available and store the decoded\n // ID3 data in the value property of the cue\n let Cue = window.WebKitDataCue || window.VTTCue || window.TextTrackCue;\n\n for (let i = 0; i < samples.length; i++) {\n let id3Frame = this.parseID3Frame(samples[i].data);\n let frame = this.decodeID3Frame(id3Frame);\n if (frame) {\n let cue = new Cue(startTime, endTime, '');\n cue.value = frame;\n this.id3Track.addCue(cue);\n }\n }\n }\n\n parseID3Frame(data) {\n if (data.length < 21) {\n return undefined;\n }\n\n /* http://id3.org/id3v2.3.0\n [0] = 'I'\n [1] = 'D'\n [2] = '3'\n [3,4] = {Version}\n [5] = {Flags}\n [6-9] = {ID3 Size}\n [10-13] = {Frame ID}\n [14-17] = {Frame Size}\n [18,19] = {Frame Flags}\n */\n if (data[0] === 73 && // I\n data[1] === 68 && // D\n data[2] === 51) { // 3\n\n let type = String.fromCharCode(data[10], data[11], data[12], data[13]);\n data = data.subarray(20);\n return { type, data };\n }\n }\n\n decodeID3Frame(frame) {\n if (frame.type === 'TXXX') {\n return this.decodeTxxxFrame(frame);\n } else if (frame.type === 'PRIV') {\n return this.decodePrivFrame(frame);\n } else if (frame.type[0] === 'T') {\n return this.decodeTextFrame(frame);\n } else {\n return undefined;\n }\n }\n\n decodeTxxxFrame(frame) {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Description}\\0{Value}\n */\n\n if (frame.size < 2) {\n return undefined;\n }\n\n if (frame.data[0] !== 3) {\n //only support UTF-8\n return undefined;\n }\n\n let index = 1;\n let description = this.utf8ArrayToStr(frame.data.subarray(index));\n\n index += description.length + 1;\n let value = this.utf8ArrayToStr(frame.data.subarray(index));\n\n return { key: 'TXXX', description, data: value };\n }\n\n decodeTextFrame(frame) {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Value}\n */\n\n if (frame.size < 2) {\n return undefined;\n }\n\n if (frame.data[0] !== 3) {\n //only support UTF-8\n return undefined;\n }\n\n let data = frame.data.subarray(1);\n return { key: frame.type, data: this.utf8ArrayToStr(data) };\n }\n\n decodePrivFrame(frame) {\n /*\n Format: <text string>\\0<binary data>\n */\n\n if (frame.size < 2) {\n return undefined;\n }\n\n let owner = this.utf8ArrayToStr(frame.data);\n let privateData = frame.data.subarray(owner.length + 1);\n\n return { key: 'PRIV', info: owner, data: privateData.buffer };\n }\n\n // http://stackoverflow.com/questions/8936984/uint8array-to-string-in-javascript/22373197\n // http://www.onicos.com/staff/iz/amuse/javascript/expert/utf.txt\n /* utf.js - UTF-8 <=> UTF-16 convertion\n *\n * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>\n * Version: 1.0\n * LastModified: Dec 25 1999\n * This library is free. You can redistribute it and/or modify it.\n */\n utf8ArrayToStr(array) {\n\n let char2;\n let char3;\n let out = '';\n let i = 0;\n let length = array.length;\n\n while (i < length) {\n let c = array[i++];\n switch (c >> 4) {\n case 0:\n return out;\n case 1: case 2: case 3: case 4: case 5: case 6: case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12: case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode(((c & 0x0F) << 12) |\n ((char2 & 0x3F) << 6) |\n ((char3 & 0x3F) << 0));\n break;\n }\n }\n\n return out;\n }\n}\n\nexport default ID3TrackController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/id3-track-controller.js","/*\n * Level Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport BufferHelper from '../helper/buffer-helper';\n\nclass LevelController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MANIFEST_LOADED,\n Event.LEVEL_LOADED,\n Event.FRAG_LOADED,\n Event.ERROR);\n this.ontick = this.tick.bind(this);\n this._manualLevel = -1;\n }\n\n destroy() {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n this._manualLevel = -1;\n }\n\n startLoad() {\n this.canload = true;\n let levels = this._levels;\n // clean up live level details to force reload them, and reset load errors\n if(levels) {\n levels.forEach(level => {\n level.loadError = 0;\n const levelDetails = level.details;\n if (levelDetails && levelDetails.live) {\n level.details = undefined;\n }\n });\n }\n // speed up live playlist refresh if timer exists\n if (this.timer) {\n this.tick();\n }\n }\n\n stopLoad() {\n this.canload = false;\n }\n\n onManifestLoaded(data) {\n var levels0 = [],\n levels = [],\n bitrateStart,\n bitrateSet = {},\n videoCodecFound = false,\n audioCodecFound = false,\n hls = this.hls,\n brokenmp4inmp3 = /chrome|firefox/.test(navigator.userAgent.toLowerCase()),\n checkSupported = function(type,codec) { return MediaSource.isTypeSupported(`${type}/mp4;codecs=${codec}`);};\n\n // regroup redundant level together\n data.levels.forEach(level => {\n if(level.videoCodec) {\n videoCodecFound = true;\n }\n // erase audio codec info if browser does not support mp4a.40.34. demuxer will autodetect codec and fallback to mpeg/audio\n if(brokenmp4inmp3 && level.audioCodec && level.audioCodec.indexOf('mp4a.40.34') !== -1) {\n level.audioCodec = undefined;\n }\n if(level.audioCodec || (level.attrs && level.attrs.AUDIO)) {\n audioCodecFound = true;\n }\n let 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(level => {\n if(level.videoCodec) {\n levels.push(level);\n }\n });\n } else {\n levels = levels0;\n }\n // only keep level with supported audio/video codecs\n levels = levels.filter(function(level) {\n let audioCodec = level.audioCodec, videoCodec = level.videoCodec;\n return (!audioCodec || checkSupported('audio',audioCodec)) &&\n (!videoCodec || checkSupported('video',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 (let i = 0; i < levels.length; i++) {\n if (levels[i].bitrate === bitrateStart) {\n this._firstLevel = i;\n logger.log(`manifest loaded,${levels.length} level(s) found, first bitrate:${bitrateStart}`);\n break;\n }\n }\n hls.trigger(Event.MANIFEST_PARSED, {levels: levels, firstLevel: this._firstLevel, stats: data.stats, audio : audioCodecFound, video : videoCodecFound, altAudio : data.audioTracks.length > 0});\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 get levels() {\n return this._levels;\n }\n\n get level() {\n return this._level;\n }\n\n set level(newLevel) {\n let 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 setLevelInternal(newLevel) {\n const levels = this._levels;\n const hls = this.hls;\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.log(`switching to level ${newLevel}`);\n this._level = newLevel;\n var levelProperties = levels[newLevel];\n levelProperties.level = newLevel;\n // LEVEL_SWITCH to be deprecated in next major release\n hls.trigger(Event.LEVEL_SWITCH, levelProperties);\n hls.trigger(Event.LEVEL_SWITCHING, levelProperties);\n }\n var level = levels[newLevel], 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 hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: newLevel, id: urlId});\n }\n } else {\n // invalid level id given, trigger error\n hls.trigger(Event.ERROR, {type : ErrorTypes.OTHER_ERROR, details: ErrorDetails.LEVEL_SWITCH_ERROR, level: newLevel, fatal: false, reason: 'invalid level idx'});\n }\n }\n\n get manualLevel() {\n return this._manualLevel;\n }\n\n set manualLevel(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 get firstLevel() {\n return this._firstLevel;\n }\n\n set firstLevel(newLevel) {\n this._firstLevel = newLevel;\n }\n\n get startLevel() {\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 let 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\n set startLevel(newLevel) {\n this._startLevel = newLevel;\n }\n\n onError(data) {\n if(data.fatal) {\n return;\n }\n\n let details = data.details, hls = this.hls, levelId, level, levelError = false;\n // try to recover not fatal errors\n switch(details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n case ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case ErrorDetails.KEY_LOAD_ERROR:\n case ErrorDetails.KEY_LOAD_TIMEOUT:\n levelId = data.frag.level;\n break;\n case ErrorDetails.LEVEL_LOAD_ERROR:\n case ErrorDetails.LEVEL_LOAD_TIMEOUT:\n levelId = data.context.level;\n levelError = true;\n break;\n case ErrorDetails.REMUX_ALLOC_ERROR:\n levelId = data.level;\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.loadError) {\n level.loadError = 1;\n } else {\n level.loadError++;\n }\n // if any redundant streams available and if we haven't try them all (level.loadError is reseted on successful frag/level load.\n // if level.loadError reaches nbRedundantLevel it means that we tried them all, no hope => let's switch down\n const nbRedundantLevel = level.url.length;\n if (nbRedundantLevel > 1 && level.loadError < nbRedundantLevel) {\n level.urlId = (level.urlId + 1) % nbRedundantLevel;\n level.details = undefined;\n 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 let recoverable = ((this._manualLevel === -1) && levelId);\n if (recoverable) {\n logger.warn(`level controller,${details}: switch-down for next fragment`);\n hls.nextAutoLevel = Math.max(0,levelId-1);\n } else if(level && level.details && level.details.live) {\n 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 === ErrorDetails.LEVEL_LOAD_ERROR ||\n details === ErrorDetails.LEVEL_LOAD_TIMEOUT) {\n let media = hls.media,\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && BufferHelper.isBuffered(media,media.currentTime) && BufferHelper.isBuffered(media,media.currentTime+0.5);\n if (mediaBuffered) {\n let retryDelay = hls.config.levelLoadingRetryDelay;\n logger.warn(`level controller,${details}, but media buffered, retry in ${retryDelay}ms`);\n this.timer = setTimeout(this.ontick,retryDelay);\n // boolean used to inform stream controller not to switch back to IDLE on non fatal error\n data.levelRetry = true;\n } else {\n 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 // switch error to fatal\n data.fatal = true;\n }\n }\n }\n }\n }\n\n // reset level load error counter on successful frag loaded\n onFragLoaded(data) {\n const fragLoaded = data.frag;\n if (fragLoaded && fragLoaded.type === 'main') {\n const level = this._levels[fragLoaded.level];\n if (level) {\n level.loadError = 0;\n }\n }\n }\n\n onLevelLoaded(data) {\n const levelId = data.level;\n // only process level loaded events matching with expected level\n if (levelId === this._level) {\n let curLevel = this._levels[levelId];\n // reset level load error counter on successful level loaded\n curLevel.loadError = 0;\n let newDetails = data.details;\n // if current playlist is a live playlist, arm a timer to reload it\n if (newDetails.live) {\n let reloadInterval = 1000*( newDetails.averagetargetduration ? newDetails.averagetargetduration : newDetails.targetduration),\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.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.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 tick() {\n var levelId = this._level;\n if (levelId !== undefined && this.canload) {\n var level = this._levels[levelId];\n if (level && level.url) {\n var urlId = level.urlId;\n this.hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: levelId, id: urlId});\n }\n }\n }\n\n get nextLoadLevel() {\n if (this._manualLevel !== -1) {\n return this._manualLevel;\n } else {\n return this.hls.nextAutoLevel;\n }\n }\n\n set nextLoadLevel(nextLevel) {\n this.level = nextLevel;\n if (this._manualLevel === -1) {\n this.hls.nextAutoLevel = nextLevel;\n }\n }\n}\n\nexport default LevelController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/level-controller.js","/*\n * Stream Controller\n*/\n\nimport BinarySearch from '../utils/binary-search';\nimport BufferHelper from '../helper/buffer-helper';\nimport Demuxer from '../demux/demuxer';\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport LevelHelper from '../helper/level-helper';\nimport TimeRanges from '../utils/timeRanges';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nconst State = {\n STOPPED : 'STOPPED',\n IDLE : 'IDLE',\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 BUFFER_FLUSHING : 'BUFFER_FLUSHING',\n ENDED : 'ENDED',\n ERROR : 'ERROR'\n};\n\nclass StreamController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.MANIFEST_LOADING,\n Event.MANIFEST_PARSED,\n Event.LEVEL_LOADED,\n Event.KEY_LOADED,\n Event.FRAG_LOADED,\n Event.FRAG_LOAD_EMERGENCY_ABORTED,\n Event.FRAG_PARSING_INIT_SEGMENT,\n Event.FRAG_PARSING_DATA,\n Event.FRAG_PARSED,\n Event.ERROR,\n Event.AUDIO_TRACK_SWITCHING,\n Event.AUDIO_TRACK_SWITCHED,\n Event.BUFFER_CREATED,\n Event.BUFFER_APPENDED,\n Event.BUFFER_FLUSHED);\n\n this.config = hls.config;\n this.audioCodecSwap = false;\n this.ticks = 0;\n this._state = State.STOPPED;\n this.ontick = this.tick.bind(this);\n }\n\n destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n EventHandler.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n\n startLoad(startPosition) {\n if (this.levels) {\n let lastCurrentTime = this.lastCurrentTime, 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 (!this.startFragRequested) {\n // determine load level\n let 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 // if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime\n if (lastCurrentTime > 0 && startPosition === -1) {\n logger.log(`override startPosition with lastCurrentTime @${lastCurrentTime.toFixed(3)}`);\n startPosition = lastCurrentTime;\n }\n this.state = State.IDLE;\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime = startPosition;\n this.tick();\n } else {\n this.forceStartLoad = true;\n this.state = State.STOPPED;\n }\n }\n\n 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 this.forceStartLoad = false;\n }\n\n 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 doTick() {\n switch(this.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n break;\n case State.BUFFER_FLUSHING:\n // in buffer flushing state, reset fragLoadError counter\n this.fragLoadError = 0;\n break;\n case State.IDLE:\n this._doTickIdle();\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.log(`mediaController: retryDate reached, switch back to IDLE state`);\n this.state = State.IDLE;\n }\n break;\n case State.ERROR:\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 _doTickIdle() {\n const 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 start level loaded and media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (this.levelLastLoaded !== undefined && !media &&\n (this.startFragRequested || !config.startFragPrefetch)) {\n return;\n }\n\n // if we have not yet loaded any fragment, start loading from start position\n let pos;\n if (this.loadedmetadata) {\n pos = media.currentTime;\n } else {\n pos = this.nextLoadPosition;\n }\n // determine next load level\n let level = hls.nextLoadLevel,\n levelInfo = this.levels[level];\n\n if (!levelInfo) {\n return;\n }\n\n let levelBitrate = levelInfo.bitrate,\n maxBufLen;\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 if (levelBitrate) {\n maxBufLen = Math.max(8 * config.maxBufferSize / levelBitrate, 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 const bufferInfo = BufferHelper.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;\n }\n\n // if buffer length is less than maxBufLen try to load a new fragment ...\n 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 this.level = hls.nextLoadLevel = level;\n\n const levelDetails = levelInfo.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;\n }\n\n // we just got done loading the final fragment, check if we need to finalize media stream\n let fragPrevious = this.fragPrevious;\n if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN) {\n // fragPrevious is last fragment. retrieve level duration using last frag start offset + duration\n // real duration might be lower than initial duration if there are drifts between real frag duration and playlist signaling\n const duration = Math.min(media.duration,fragPrevious.start + fragPrevious.duration);\n // if 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 (audio/video offsets...)\n // tolerate up to one frag duration to cope with these cases.\n // 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\n if (duration - Math.max(bufferInfo.end,fragPrevious.start) <= Math.max(0.2,fragPrevious.duration)) {\n // Finalize the media stream\n let data = {};\n if (this.altAudio) {\n data.type = 'video';\n }\n this.hls.trigger(Event.BUFFER_EOS,data);\n this.state = State.ENDED;\n return;\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 this._fetchPayloadOrEos(pos, bufferInfo, levelDetails);\n }\n\n _fetchPayloadOrEos(pos, bufferInfo, levelDetails) {\n const 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;\n }\n\n // find fragment index, contiguous with end of buffer position\n let start = fragments[0].start,\n end = fragments[fragLen-1].start + fragments[fragLen-1].duration,\n bufferEnd = bufferInfo.end,\n frag;\n\n if (levelDetails.initSegment && !levelDetails.initSegment.data) {\n frag = levelDetails.initSegment;\n } else {\n // in case of live playlist we need to ensure that requested position is not located before playlist start\n if (levelDetails.live) {\n let initialLiveManifestSize = this.config.initialLiveManifestSize;\n if(fragLen < initialLiveManifestSize){\n logger.warn(`Can not start playback of a level, reason: not enough fragments ${fragLen} < ${initialLiveManifestSize}`);\n return;\n }\n\n frag = this._ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen);\n // if it explicitely returns null don't load any fragment and exit function now\n if (frag === null) {\n return;\n }\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 }\n if (!frag) {\n frag = this._findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails);\n }\n if(frag) {\n this._loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd);\n }\n return;\n }\n\n _ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen) {\n const config = this.hls.config, media = this.media;\n\n let frag;\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 let maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount*levelDetails.targetduration;\n\n if (bufferEnd < Math.max(start-config.maxFragLookUpTolerance, end - maxLatency)) {\n let liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);\n 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.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.log(`live playlist, switching playlist, unknown, load middle frag : ${frag.sn}`);\n }\n }\n return frag;\n }\n\n _findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails) {\n const config = this.hls.config;\n let frag;\n let foundFrag;\n let maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n const fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;\n let fragmentWithinToleranceTest = (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 // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments\n let candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);\n if (candidate.start + candidate.duration - candidateLookupTolerance <= bufferEnd) {\n return 1;\n } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n };\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n // Prefer the next fragment if it's within tolerance\n if (fragNext && !fragmentWithinToleranceTest(fragNext)) {\n foundFrag = fragNext;\n } else {\n foundFrag = BinarySearch.search(fragments, fragmentWithinToleranceTest);\n }\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen-1];\n }\n if (foundFrag) {\n frag = foundFrag;\n const curSNIdx = frag.sn - levelDetails.startSN;\n const sameLevel = fragPrevious && frag.level === fragPrevious.level;\n const prevFrag = fragments[curSNIdx - 1];\n const nextFrag = fragments[curSNIdx + 1];\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.sn === fragPrevious.sn) {\n if (sameLevel && !frag.backtracked) {\n if (frag.sn < levelDetails.endSN) {\n let deltaPTS = fragPrevious.deltaPTS;\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 = prevFrag;\n 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 = nextFrag;\n logger.log(`SN just loaded, load next one: ${frag.sn}`);\n }\n } else {\n frag = null;\n }\n } else if (frag.backtracked) {\n // Only backtrack a max of 1 consecutive fragment to prevent sliding back too far when little or no frags start with keyframes\n if (nextFrag && nextFrag.backtracked) {\n logger.warn(`Already backtracked from fragment ${nextFrag.sn}, will not backtrack to fragment ${frag.sn}. Loading fragment ${nextFrag.sn}`);\n frag = nextFrag;\n } else {\n // If a fragment has dropped frames and it's in a same level/sequence, load the previous fragment to try and find the keyframe\n // 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\n logger.warn('Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe');\n frag.dropped = 0;\n if (prevFrag) {\n if (prevFrag.loadCounter) {\n prevFrag.loadCounter--;\n }\n frag = prevFrag;\n frag.backtracked = true;\n } else {\n frag = null;\n }\n }\n }\n }\n }\n return frag;\n }\n\n _loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd) {\n const 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 && frag.decryptdata.uri != null) && (frag.decryptdata.key == null)) {\n logger.log(`Loading key for ${frag.sn} of [${levelDetails.startSN} ,${levelDetails.endSN}],level ${level}`);\n this.state = State.KEY_LOADING;\n hls.trigger(Event.KEY_LOADING, {frag: frag});\n } else {\n 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 let 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 if (!isNaN(frag.sn)) {\n this.nextLoadPosition = frag.start + frag.duration;\n }\n frag.autoLevel = hls.autoLevelEnabled;\n frag.bitrateTest = this.bitrateTest;\n hls.trigger(Event.FRAG_LOADING, {frag: frag});\n // lazy demuxer init, as this could take some time ... do it during frag loading\n if (!this.demuxer) {\n this.demuxer = new Demuxer(hls,'main');\n }\n this.state = State.FRAG_LOADING;\n return;\n }\n }\n\n set state(nextState) {\n if (this.state !== nextState) {\n const previousState = this.state;\n this._state = nextState;\n logger.log(`main stream:${previousState}->${nextState}`);\n this.hls.trigger(Event.STREAM_STATE_TRANSITION, {previousState, nextState});\n }\n }\n\n get state() {\n return this._state;\n }\n\n getBufferedFrag(position) {\n return BinarySearch.search(this._bufferedFrags, function(frag) {\n if (position < frag.startPTS) {\n return -1;\n } else if (position > frag.endPTS) {\n return 1;\n }\n return 0;\n });\n }\n\n get currentLevel() {\n let media = this.media;\n if (media) {\n const frag = this.getBufferedFrag(media.currentTime);\n if (frag) {\n return frag.level;\n }\n }\n return -1;\n }\n\n get nextBufferedFrag() {\n let media = this.media;\n if (media) {\n // first get end range of current fragment\n return this.followingBufferedFrag(this.getBufferedFrag(media.currentTime));\n } else {\n return null;\n }\n }\n\n followingBufferedFrag(frag) {\n if (frag) {\n // try to get range of next fragment (500ms after this range)\n return this.getBufferedFrag(frag.endPTS + 0.5);\n }\n return null;\n }\n\n get nextLevel() {\n const frag = this.nextBufferedFrag;\n if (frag) {\n return frag.level;\n } else {\n return -1;\n }\n }\n\n _checkFragmentChanged() {\n var fragPlayingCurrent, currentTime, 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 (BufferHelper.isBuffered(video,currentTime)) {\n fragPlayingCurrent = this.getBufferedFrag(currentTime);\n } else if (BufferHelper.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 fragPlayingCurrent = this.getBufferedFrag(currentTime + 0.1);\n }\n if (fragPlayingCurrent) {\n var fragPlaying = fragPlayingCurrent;\n if (fragPlaying !== this.fragPlaying) {\n this.hls.trigger(Event.FRAG_CHANGED, {frag: fragPlaying});\n const fragPlayingLevel = fragPlaying.level;\n if (!this.fragPlaying || this.fragPlaying.level !== fragPlayingLevel) {\n this.hls.trigger(Event.LEVEL_SWITCHED, {level: fragPlayingLevel});\n }\n this.fragPlaying = 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 immediateLevelSwitch() {\n logger.log('immediateLevelSwitch');\n if (!this.immediateSwitch) {\n this.immediateSwitch = true;\n let media = this.media, previouslyPaused;\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 // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // flush everything\n this.flushMainBuffer(0,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 immediateLevelSwitchEnd() {\n let media = this.media;\n if (media && media.buffered.length) {\n this.immediateSwitch = false;\n if(BufferHelper.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 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 let media = this.media;\n // ensure that media is defined and that metadata are available (to retrieve currentTime)\n if (media && media.readyState) {\n let fetchdelay, fragPlayingCurrent, nextBufferedFrag;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n fragPlayingCurrent = this.getBufferedFrag(media.currentTime);\n if (fragPlayingCurrent && fragPlayingCurrent.startPTS > 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.flushMainBuffer(0,fragPlayingCurrent.startPTS - 1);\n }\n if (!media.paused) {\n // add a safety delay of 1s\n var nextLevelId = this.hls.nextLoadLevel,nextLevel = this.levels[nextLevelId], 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 nextBufferedFrag = this.getBufferedFrag(media.currentTime + fetchdelay);\n if (nextBufferedFrag) {\n // we can flush buffer range following this one without stalling playback\n nextBufferedFrag = this.followingBufferedFrag(nextBufferedFrag);\n if (nextBufferedFrag) {\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.flushMainBuffer(nextBufferedFrag.startPTS , Number.POSITIVE_INFINITY);\n }\n }\n }\n }\n\n flushMainBuffer(startOffset,endOffset) {\n this.state = State.BUFFER_FLUSHING;\n let flushScope = {startOffset: startOffset, endOffset: endOffset};\n // if alternate audio tracks are used, only flush video, otherwise flush everything\n if (this.altAudio) {\n flushScope.type = 'video';\n }\n this.hls.trigger(Event.BUFFER_FLUSHING, flushScope);\n }\n\n 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 let config = this.config;\n if(this.levels && config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n\n onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n 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(level => {\n if(level.details) {\n level.details.fragments.forEach(fragment => {\n fragment.loadCounter = undefined;\n fragment.backtracked = 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 = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n\n onMediaSeeking() {\n let media = this.media, currentTime = media ? media.currentTime : undefined, config = this.config;\n if (!isNaN(currentTime)) {\n logger.log(`media seeking to ${currentTime.toFixed(3)}`);\n }\n let mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media;\n let bufferInfo = BufferHelper.bufferInfo(mediaBuffer,currentTime,this.config.maxBufferHole);\n if (this.state === State.FRAG_LOADING) {\n let 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 let 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.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.log('seeking outside of buffer but within currently loaded fragment range');\n }\n }\n } else if (this.state === State.ENDED) {\n // if seeking to unbuffered area, clean up fragPrevious\n if (bufferInfo.len === 0) {\n this.fragPrevious = 0;\n }\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 // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target\n if(!this.loadedmetadata) {\n this.nextLoadPosition = this.startPosition = currentTime;\n }\n // tick to speed up processing\n this.tick();\n }\n\n onMediaSeeked() {\n const media = this.media, currentTime = media ? media.currentTime : undefined;\n if (!isNaN(currentTime)) {\n logger.log(`media seeked to ${currentTime.toFixed(3)}`);\n }\n // tick to speed up FRAGMENT_PLAYING triggering\n this.tick();\n }\n\n onMediaEnded() {\n logger.log('media ended');\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n\n onManifestLoading() {\n // reset buffer on manifest loading\n logger.log('trigger BUFFER_RESET');\n this.hls.trigger(Event.BUFFER_RESET);\n this._bufferedFrags = [];\n this.stalled = false;\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n onManifestParsed(data) {\n var aac = false, heaac = false, codec;\n data.levels.forEach(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.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 let config = this.config;\n if (config.autoStartLoad || this.forceStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n\n 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.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 LevelHelper.mergeDetails(curDetails,newDetails);\n sliding = newDetails.fragments[0].start;\n this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n logger.log(`live playlist sliding:${sliding.toFixed(3)}`);\n } else {\n logger.log('live playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n 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(Event.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 let startTimeOffset = newDetails.startTimeOffset;\n if(!isNaN(startTimeOffset)) {\n if (startTimeOffset < 0) {\n logger.log(`negative start time offset ${startTimeOffset}, count from end of last fragment`);\n startTimeOffset = sliding + duration + startTimeOffset;\n }\n 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.log(`configure startPosition to ${this.startPosition}`);\n } else {\n this.startPosition = 0;\n }\n }\n this.lastCurrentTime = this.startPosition;\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 onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n\n onFragLoaded(data) {\n var fragCurrent = this.fragCurrent,\n fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING &&\n fragCurrent &&\n fragLoaded.type === 'main' &&\n fragLoaded.level === fragCurrent.level &&\n fragLoaded.sn === fragCurrent.sn) {\n let stats = data.stats,\n currentLevel = this.levels[fragCurrent.level],\n details = currentLevel.details;\n 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 this.stats = stats;\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(Event.FRAG_BUFFERED, {stats: stats, frag: fragCurrent, id : 'main'});\n this.tick();\n } else if (fragLoaded.sn === 'initSegment') {\n this.state = State.IDLE;\n stats.tparsed = stats.tbuffered = performance.now();\n details.initSegment.data = data.payload;\n this.hls.trigger(Event.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 let duration = details.totalduration,\n level = fragCurrent.level,\n sn = fragCurrent.sn,\n audioCodec = this.config.defaultAudioCodec || currentLevel.audioCodec;\n if(this.audioCodecSwap) {\n 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.pendingBuffering = true;\n this.appended = false;\n logger.log(`Parsing ${sn} of [${details.startSN} ,${details.endSN}],level ${level}, cc ${fragCurrent.cc}`);\n let demuxer = this.demuxer;\n if (!demuxer) {\n demuxer = this.demuxer = new Demuxer(this.hls,'main');\n }\n // 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)\n let media = this.media;\n let mediaSeeking = media && media.seeking;\n let accurateTimeOffset = !mediaSeeking && (details.PTSKnown || !details.live);\n let initSegmentData = details.initSegment ? details.initSegment.data : [];\n demuxer.push(data.payload, initSegmentData,audioCodec, currentLevel.videoCodec, fragCurrent, duration, accurateTimeOffset,undefined);\n }\n }\n this.fragLoadError = 0;\n }\n\n onFragParsingInitSegment(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'main' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n var tracks = data.tracks, trackName, 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.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 && track.container !== 'audio/mpeg') { // Exclude mpeg audio\n audioCodec = 'mp4a.40.2';\n 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 this.hls.trigger(Event.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.log(`main track:${trackName},container:${track.container},codecs[level/parsed]=[${track.levelCodec}/${track.codec}]`);\n var initSegment = track.initSegment;\n if (initSegment) {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(Event.BUFFER_APPENDING, {type: trackName, data: initSegment, parent : 'main', content : 'initSegment'});\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsingData(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'main' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n !(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 = fragCurrent;\n if (isNaN(data.endPTS)) {\n data.endPTS = data.startPTS + fragCurrent.duration;\n data.endDTS = data.startDTS + fragCurrent.duration;\n }\n\n 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 // Detect gaps in a fragment and try to fix it by finding a keyframe in the previous fragment (see _findFragments)\n if(data.type === 'video') {\n frag.dropped = data.dropped;\n if (frag.dropped) {\n if (!frag.backtracked) {\n logger.warn('missing video frame(s), backtracking fragment');\n // Return back to the IDLE state without appending to buffer\n // Causes findFragments to backtrack a segment and find the keyframe\n // Audio fragments arriving before video sets the nextLoadPosition, causing _findFragments to skip the backtracked fragment\n frag.backtracked = true;\n this.nextLoadPosition = data.startPTS;\n this.state = State.IDLE;\n this.fragPrevious = frag;\n this.tick();\n return;\n } else {\n logger.warn('Already backtracked on this fragment, appending with the gap');\n }\n } else {\n // Only reset the backtracked flag if we've loaded the frag without any dropped frames\n frag.backtracked = false;\n }\n }\n\n var drift = LevelHelper.updateFragPTSDTS(level.details,frag,data.startPTS,data.endPTS,data.startDTS,data.endDTS),\n hls = this.hls;\n hls.trigger(Event.LEVEL_PTS_UPDATED, {details: level.details, level: this.level, drift: drift, type: data.type, start: data.startPTS, end: data.endPTS});\n\n // has remuxer dropped video frames located before first keyframe ?\n [data.data1, data.data2].forEach(buffer => {\n // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)\n // in that case it is useless to append following segments\n if (buffer && buffer.length && this.state === State.PARSING) {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n hls.trigger(Event.BUFFER_APPENDING, {type: data.type, data: buffer, parent : 'main',content : 'data'});\n }\n });\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsed(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'main' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n\n onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url,\n trackId = data.id;\n // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered\n // don't do anything if we switch to alt audio: audio stream controller is handling it.\n // we will just have to change buffer scheduling on audioTrackSwitched\n if (!altAudio) {\n if (this.mediaBuffer !== this.media) {\n logger.log(`switching on main audio, use media.buffered to schedule main fragment loading`);\n this.mediaBuffer = this.media;\n let 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.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 let hls = this.hls;\n // switching to main audio, flush all audio and trigger track switched\n hls.trigger(Event.BUFFER_FLUSHING, {startOffset: 0 , endOffset: Number.POSITIVE_INFINITY, type : 'audio'});\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : trackId});\n this.altAudio = false;\n }\n }\n\n onAudioTrackSwitched(data) {\n var trackId = data.id,\n altAudio = !!this.hls.audioTracks[trackId].url;\n if (altAudio) {\n let videoBuffer = this.videoBuffer;\n // if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered\n if (videoBuffer && this.mediaBuffer !== videoBuffer) {\n logger.log(`switching on alternate audio, use video.buffered to schedule main fragment loading`);\n this.mediaBuffer = videoBuffer;\n }\n }\n this.altAudio = altAudio;\n this.tick();\n }\n\n\n\n onBufferCreated(data) {\n let tracks = data.tracks, mediaTrack, name, alternate = false;\n for(var type in tracks) {\n let 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.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 onBufferAppended(data) {\n if (data.parent === 'main') {\n const state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = (data.pending > 0);\n this._checkAppendedParsed();\n }\n }\n }\n\n _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n const frag = this.fragCurrent;\n if (frag) {\n const media = this.mediaBuffer ? this.mediaBuffer : this.media;\n logger.log(`main buffered : ${TimeRanges.toString(media.buffered)}`);\n // filter fragments potentially evicted from buffer. this is to avoid memleak on live streams\n let bufferedFrags = this._bufferedFrags.filter(frag => {return BufferHelper.isBuffered(media,(frag.startPTS + frag.endPTS) / 2);});\n // push new range\n bufferedFrags.push(frag);\n // sort frags, as we use BinarySearch for lookup in getBufferedFrag ...\n this._bufferedFrags = bufferedFrags.sort(function(a,b) {return (a.startPTS - b.startPTS);});\n this.fragPrevious = frag;\n const stats = this.stats;\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(Event.FRAG_BUFFERED, {stats: stats, frag: frag, id : 'main'});\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n\n onError(data) {\n let 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 let media = this.media,\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && BufferHelper.isBuffered(media,media.currentTime) && BufferHelper.isBuffered(media,media.currentTime+0.5);\n switch(data.details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n case ErrorDetails.KEY_LOAD_ERROR:\n case ErrorDetails.KEY_LOAD_TIMEOUT:\n if(!data.fatal) {\n var loadError = this.fragLoadError;\n if(loadError) {\n loadError++;\n } else {\n loadError=1;\n }\n let config = this.config;\n // keep retrying / don't raise fatal network error if current position is buffered or if in automode with current level not 0\n if (loadError <= config.fragLoadingMaxRetry || mediaBuffered || (frag.autoLevel && frag.level)) {\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.warn(`mediaController: frag loading failed, retry in ${delay} ms`);\n this.retryDate = performance.now() + delay;\n // retry loading state\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 this.nextLoadPosition = this.startPosition;\n }\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n logger.error(`mediaController: ${data.details} reaches max retry, redispatch as fatal ...`);\n // switch error to fatal\n data.fatal = true;\n this.state = State.ERROR;\n }\n }\n break;\n case 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 // switch error to fatal\n data.fatal = true;\n this.state = State.ERROR;\n }\n }\n }\n break;\n case ErrorDetails.LEVEL_LOAD_ERROR:\n case ErrorDetails.LEVEL_LOAD_TIMEOUT:\n if(this.state !== State.ERROR) {\n if (data.fatal) {\n // if fatal error, stop processing\n this.state = State.ERROR;\n logger.warn(`streamController: ${data.details},switch to ${this.state} state ...`);\n } else {\n // in case of non fatal error while loading level, if level controller is not retrying to load level , switch back to IDLE\n if (!data.levelRetry && this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n }\n }\n break;\n case ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (data.parent === 'main' && (this.state === State.PARSING || this.state === State.PARSED)) {\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n this._reduceMaxBufferLength(this.config.maxBufferLength);\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/video-dev/hls.js/pull/708\n // in that case flush the whole buffer to recover\n logger.warn('buffer full error also media.currentTime is not buffered, flush everything');\n this.fragCurrent = null;\n // flush everything\n this.flushMainBuffer(0,Number.POSITIVE_INFINITY);\n }\n }\n break;\n default:\n break;\n }\n }\n\n _reduceMaxBufferLength(minLength) {\n let 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.warn(`main:reduce max buffer length to ${config.maxMaxBufferLength}s`);\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n }\n\n_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 let currentTime = media.currentTime,\n mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media,\n buffered = mediaBuffer.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 let startPosition = media.seeking ? currentTime : this.startPosition,\n startPositionBuffered = BufferHelper.isBuffered(mediaBuffer,startPosition);\n // if currentTime not matching with expected startPosition or startPosition not buffered\n if (currentTime !== startPosition || !startPositionBuffered) {\n 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.log(`target start position not buffered, seek to buffered.start(0) ${startPosition}`);\n }\n logger.log(`adjust currentTime from ${currentTime} to ${startPosition}`);\n media.currentTime = startPosition;\n }\n } else if (this.immediateSwitch) {\n this.immediateLevelSwitchEnd();\n } else {\n let bufferInfo = BufferHelper.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), // not playing if nothing buffered\n jumpThreshold = 0.5, // tolerance needed as some browsers stalls playback before reaching buffered range end\n playheadMoving = currentTime !== this.lastCurrentTime,\n config = this.config;\n\n if (playheadMoving) {\n // played moving, but was previously stalled => now not stuck anymore\n if (this.stallReported) {\n logger.warn(`playback not stuck anymore @${currentTime}, after ${Math.round(performance.now()-this.stalled)}ms`);\n this.stallReported = false;\n }\n this.stalled = undefined;\n this.nudgeRetry = 0;\n } else {\n // playhead not moving\n if(expectedPlaying) {\n // playhead not moving BUT media expected to play\n const tnow = performance.now();\n const hls = this.hls;\n if(!this.stalled) {\n // stall just detected, store current time\n this.stalled = tnow;\n this.stallReported = false;\n } else {\n // playback already stalled, check stalling duration\n // if stalling for more than a given threshold, let's try to recover\n const stalledDuration = tnow - this.stalled;\n const bufferLen = bufferInfo.len;\n let nudgeRetry = this.nudgeRetry || 0;\n // have we reached stall deadline ?\n if (bufferLen <= jumpThreshold && stalledDuration > config.lowBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n logger.warn(`playback stalling in low buffer @${currentTime}`);\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer : bufferLen});\n }\n // if buffer len is below threshold, try to jump to start of next buffer range if close\n // no buffer available @ currentTime, check if next buffer is close (within a config.maxSeekHole second range)\n var nextBufferStart = bufferInfo.nextStart, delta = nextBufferStart-currentTime;\n if(nextBufferStart &&\n (delta < config.maxSeekHole) &&\n (delta > 0)) {\n this.nudgeRetry = ++nudgeRetry;\n const nudgeOffset = nudgeRetry * config.nudgeOffset;\n // next buffer is close ! adjust currentTime to nextBufferStart\n // this will ensure effective video decoding\n logger.log(`adjust currentTime from ${media.currentTime} to next buffered @ ${nextBufferStart} + nudge ${nudgeOffset}`);\n media.currentTime = nextBufferStart + nudgeOffset;\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole : nextBufferStart + nudgeOffset - currentTime});\n }\n } else if (bufferLen > jumpThreshold && stalledDuration > config.highBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n logger.warn(`playback stalling in high buffer @${currentTime}`);\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer : bufferLen});\n }\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n this.nudgeRetry = ++nudgeRetry;\n if (nudgeRetry < config.nudgeMaxRetry) {\n const currentTime = media.currentTime;\n const targetTime = currentTime + nudgeRetry * config.nudgeOffset;\n logger.log(`adjust currentTime from ${currentTime} to ${targetTime}`);\n // playback stalled in buffered area ... let's nudge currentTime to try to overcome this\n media.currentTime = targetTime;\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_NUDGE_ON_STALL, fatal: false});\n } else {\n logger.error(`still stuck in high buffer @${currentTime} after ${config.nudgeMaxRetry}, raise fatal error`);\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: true});\n }\n }\n }\n }\n }\n }\n }\n }\n\n 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 this.nextLoadPosition = this.startPosition;\n }\n this.tick();\n }\n\n onBufferFlushed() {\n /* after successful buffer flushing, filter flushed fragments from bufferedFrags\n use mediaBuffered instead of media (so that we will check against video.buffered ranges in case of alt audio track)\n */\n const media = this.mediaBuffer ? this.mediaBuffer : this.media;\n this._bufferedFrags = this._bufferedFrags.filter(frag => {return BufferHelper.isBuffered(media,(frag.startPTS + frag.endPTS) / 2);});\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 swapAudioCodec() {\n this.audioCodecSwap = !this.audioCodecSwap;\n }\n\n computeLivePosition(sliding, levelDetails) {\n let 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 get liveSyncPosition() {\n return this._liveSyncPosition;\n }\n\n set liveSyncPosition(value) {\n this._liveSyncPosition = value;\n }\n}\nexport default StreamController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/stream-controller.js","/*\n * Subtitle Stream Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nclass SubtitleStreamController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.ERROR,\n Event.SUBTITLE_TRACKS_UPDATED,\n Event.SUBTITLE_TRACK_SWITCH,\n Event.SUBTITLE_TRACK_LOADED,\n Event.SUBTITLE_FRAG_PROCESSED);\n this.config = hls.config;\n this.vttFragSNsProcessed = {};\n this.vttFragQueues = undefined;\n this.currentlyProcessing = null;\n this.currentTrackId = -1;\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n // Remove all queued items and create a new, empty queue for each track.\n clearVttFragQueues() {\n this.vttFragQueues = {};\n this.tracks.forEach(track => {\n this.vttFragQueues[track.id] = [];\n });\n }\n\n // If no frag is being processed and queue isn't empty, initiate processing of next frag in line.\n nextFrag() {\n if(this.currentlyProcessing === null && this.currentTrackId > -1 && this.vttFragQueues[this.currentTrackId].length) {\n let frag = this.currentlyProcessing = this.vttFragQueues[this.currentTrackId].shift();\n this.hls.trigger(Event.FRAG_LOADING, {frag});\n }\n }\n\n // When fragment has finished processing, add sn to list of completed if successful.\n onSubtitleFragProcessed(data) {\n if(data.success) {\n this.vttFragSNsProcessed[data.frag.trackId].push(data.frag.sn);\n }\n this.currentlyProcessing = null;\n this.nextFrag();\n }\n\n // If something goes wrong, procede to next frag, if we were processing one.\n onError(data) {\n let frag = data.frag;\n // don't handle frag error not related to subtitle fragment\n if (frag && frag.type !== 'subtitle') {\n return;\n }\n if(this.currentlyProcessing) {\n this.currentlyProcessing = null;\n this.nextFrag();\n }\n }\n\n // Got all new subtitle tracks.\n onSubtitleTracksUpdated(data) {\n logger.log('subtitle tracks updated');\n this.tracks = data.subtitleTracks;\n this.clearVttFragQueues();\n this.vttFragSNsProcessed = {};\n this.tracks.forEach(track => {\n this.vttFragSNsProcessed[track.id] = [];\n });\n }\n\n onSubtitleTrackSwitch(data) {\n this.currentTrackId = data.id;\n this.clearVttFragQueues();\n }\n\n // Got a new set of subtitle fragments.\n onSubtitleTrackLoaded(data) {\n const processedFragSNs = this.vttFragSNsProcessed[data.id],\n fragQueue = this.vttFragQueues[data.id],\n currentFragSN = !!this.currentlyProcessing ? this.currentlyProcessing.sn : -1;\n\n const alreadyProcessed = function(frag) {\n return processedFragSNs.indexOf(frag.sn) > -1;\n };\n\n const alreadyInQueue = function(frag) {\n return fragQueue.some(fragInQueue => {return fragInQueue.sn === frag.sn;});\n };\n\n // Add all fragments that haven't been, aren't currently being and aren't waiting to be processed, to queue.\n data.details.fragments.forEach(frag => {\n if(!(alreadyProcessed(frag) || frag.sn === currentFragSN || alreadyInQueue(frag))) {\n // Frags don't know their subtitle track ID, so let's just add that...\n frag.trackId = data.id;\n fragQueue.push(frag);\n }\n });\n\n this.nextFrag();\n }\n}\nexport default SubtitleStreamController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/subtitle-stream-controller.js","/*\n * audio track controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nfunction filterSubtitleTracks(textTrackList) {\n let tracks = [];\n for (let i = 0; i < textTrackList.length; i++) {\n if (textTrackList[i].kind === 'subtitles') {\n tracks.push(textTrackList[i]);\n }\n }\n return tracks;\n}\n\nclass SubtitleTrackController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.MANIFEST_LOADING,\n Event.MANIFEST_LOADED,\n Event.SUBTITLE_TRACK_LOADED);\n this.tracks = [];\n this.trackId = -1;\n this.media = undefined;\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n // Listen for subtitle track change, then extract the current track ID.\n onMediaAttached(data) {\n this.media = data.media;\n if (!this.media) {\n return;\n }\n\n this.media.textTracks.addEventListener('change', () => {\n // Media is undefined when switching streams via loadSource()\n if (!this.media) {\n return;\n }\n\n let trackId = -1;\n let tracks = filterSubtitleTracks(this.media.textTracks);\n for (let id = 0; id < tracks.length; id++) {\n if (tracks[id].mode === 'showing') {\n trackId = id;\n }\n }\n // Setting current subtitleTrack will invoke code.\n this.subtitleTrack = trackId;\n });\n }\n\n onMediaDetaching() {\n // TODO: Remove event listeners.\n this.media = undefined;\n }\n\n // Reset subtitle tracks on manifest loading\n onManifestLoading() {\n this.tracks = [];\n this.trackId = -1;\n }\n\n // Fired whenever a new manifest is loaded.\n onManifestLoaded(data) {\n let tracks = data.subtitles || [];\n let defaultFound = false;\n this.tracks = tracks;\n this.trackId = -1;\n this.hls.trigger(Event.SUBTITLE_TRACKS_UPDATED, {subtitleTracks : tracks});\n\n // loop through available subtitle tracks and autoselect default if needed\n // TODO: improve selection logic to handle forced, etc\n tracks.forEach(track => {\n if (track.default) {\n this.subtitleTrack = track.id;\n defaultFound = true;\n }\n });\n }\n\n // Trigger subtitle track playlist reload.\n onTick() {\n const trackId = this.trackId;\n const subtitleTrack = this.tracks[trackId];\n if (!subtitleTrack) {\n return;\n }\n\n const details = subtitleTrack.details;\n // check if we need to load playlist for this subtitle Track\n if (details === undefined || details.live === true) {\n // track not retrieved yet, or live playlist we need to (re)load it\n logger.log(`(re)loading playlist for subtitle track ${trackId}`);\n this.hls.trigger(Event.SUBTITLE_TRACK_LOADING, {url: subtitleTrack.url, id: trackId});\n }\n }\n\n onSubtitleTrackLoaded(data) {\n if (data.id < this.tracks.length) {\n logger.log(`subtitle track ${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(() => {\n this.onTick();\n }, 1000 * data.details.targetduration, this);\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 subtitle tracks list from playlist **/\n get subtitleTracks() {\n return this.tracks;\n }\n\n /** get index of the selected subtitle track (index in subtitle track lists) **/\n get subtitleTrack() {\n return this.trackId;\n }\n\n /** select a subtitle track, based on its index in subtitle track lists**/\n set subtitleTrack(subtitleTrackId) {\n if (this.trackId !== subtitleTrackId) {// || this.tracks[subtitleTrackId].details === undefined) {\n this.setSubtitleTrackInternal(subtitleTrackId);\n }\n }\n\n setSubtitleTrackInternal(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.log(`switching to subtitle track ${newId}`);\n let subtitleTrack = this.tracks[newId];\n this.hls.trigger(Event.SUBTITLE_TRACK_SWITCH, {id: newId});\n // check if we need to load playlist for this subtitle Track\n let details = subtitleTrack.details;\n if (details === undefined || details.live === true) {\n // track not retrieved yet, or live playlist we need to (re)load it\n logger.log(`(re)loading playlist for subtitle track ${newId}`);\n this.hls.trigger(Event.SUBTITLE_TRACK_LOADING, {url: subtitleTrack.url, id: newId});\n }\n }\n }\n}\n\nexport default SubtitleTrackController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/subtitle-track-controller.js","/*\n * Timeline Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport Cea608Parser from '../utils/cea-608-parser';\nimport WebVTTParser from '../utils/webvtt-parser';\nimport {logger} from '../utils/logger';\n\nfunction clearCurrentCues(track) {\n if (track && track.cues) {\n while (track.cues.length > 0) {\n track.removeCue(track.cues[0]);\n }\n }\n}\n\nfunction reuseVttTextTrack(inUseTrack, manifestTrack) {\n return inUseTrack && inUseTrack.label === manifestTrack.name && !(inUseTrack.textTrack1 || inUseTrack.textTrack2);\n}\n\nfunction intersection(x1, x2, y1, y2) {\n return Math.min(x2, y2) - Math.max(x1, y1);\n}\n\nclass TimelineController extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.MEDIA_ATTACHING,\n Event.MEDIA_DETACHING,\n Event.FRAG_PARSING_USERDATA,\n Event.MANIFEST_LOADING,\n Event.MANIFEST_LOADED,\n Event.FRAG_LOADED,\n Event.LEVEL_SWITCHING,\n Event.INIT_PTS_FOUND);\n\n this.hls = hls;\n this.config = hls.config;\n this.enabled = true;\n this.Cues = hls.config.cueHandler;\n this.textTracks = [];\n this.tracks = [];\n this.unparsedVttFrags = [];\n this.initPTS = undefined;\n this.cueRanges = [];\n\n if (this.config.enableCEA708Captions)\n {\n var self = this;\n var sendAddTrackEvent = function (track, media)\n {\n var e = null;\n try {\n e = new window.Event('addtrack');\n } catch (err) {\n //for IE11\n e = document.createEvent('Event');\n e.initEvent('addtrack', false, false);\n }\n e.track = track;\n media.dispatchEvent(e);\n };\n\n var channel1 =\n {\n 'newCue': function(startTime, endTime, screen)\n {\n if (!self.textTrack1)\n {\n //Enable reuse of existing text track.\n var existingTrack1 = self.getExistingTrack('1');\n if (!existingTrack1)\n {\n const textTrack1 = self.createTextTrack('captions', self.config.captionsTextTrack1Label, self.config.captionsTextTrack1LanguageCode);\n if (textTrack1) {\n textTrack1.textTrack1 = true;\n self.textTrack1 = textTrack1;\n }\n }\n else\n {\n self.textTrack1 = existingTrack1;\n clearCurrentCues(self.textTrack1);\n\n sendAddTrackEvent(self.textTrack1, self.media);\n }\n }\n self.addCues('textTrack1', startTime, endTime, screen);\n }\n };\n\n var channel2 =\n {\n 'newCue': function(startTime, endTime, screen)\n {\n if (!self.textTrack2)\n {\n //Enable reuse of existing text track.\n var existingTrack2 = self.getExistingTrack('2');\n if (!existingTrack2)\n {\n const textTrack2 = self.createTextTrack('captions', self.config.captionsTextTrack2Label, self.config.captionsTextTrack1LanguageCode);\n if (textTrack2) {\n textTrack2.textTrack2 = true;\n self.textTrack2 = textTrack2;\n }\n }\n else\n {\n self.textTrack2 = existingTrack2;\n clearCurrentCues(self.textTrack2);\n\n sendAddTrackEvent(self.textTrack2, self.media);\n }\n }\n self.addCues('textTrack2', startTime, endTime, screen);\n }\n };\n\n this.cea608Parser = new Cea608Parser(0, channel1, channel2);\n }\n }\n\n addCues(channel, startTime, endTime, screen) {\n // skip cues which overlap more than 50% with previously parsed time ranges\n const ranges = this.cueRanges;\n let merged = false;\n for (let i = ranges.length; i--;) {\n let cueRange = ranges[i];\n let overlap = intersection(cueRange[0], cueRange[1], startTime, endTime);\n if (overlap >= 0) {\n cueRange[0] = Math.min(cueRange[0], startTime);\n cueRange[1] = Math.max(cueRange[1], endTime);\n merged = true;\n if ((overlap / (endTime - startTime)) > 0.5) {\n return;\n }\n }\n }\n if (!merged) {\n ranges.push([startTime, endTime]);\n }\n this.Cues.newCue(this[channel], startTime, endTime, screen);\n }\n\n // Triggered when an initial PTS is found; used for synchronisation of WebVTT.\n onInitPtsFound(data) {\n if (typeof this.initPTS === 'undefined') {\n this.initPTS = data.initPTS;\n }\n\n // Due to asynchrony, initial PTS may arrive later than the first VTT fragments are loaded.\n // Parse any unparsed fragments upon receiving the initial PTS.\n if (this.unparsedVttFrags.length) {\n this.unparsedVttFrags.forEach(frag => {\n this.onFragLoaded(frag);\n });\n this.unparsedVttFrags = [];\n }\n }\n\n getExistingTrack(channelNumber) {\n const media = this.media;\n if (media) {\n for (let i = 0; i < media.textTracks.length; i++) {\n let textTrack = media.textTracks[i];\n let propName = 'textTrack' + channelNumber;\n if (textTrack[propName] === true) {\n return textTrack;\n }\n }\n }\n return null;\n }\n\n createTextTrack(kind, label, lang) {\n const media = this.media;\n if (media)\n {\n return media.addTextTrack(kind, label, lang);\n }\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n onMediaAttaching(data) {\n this.media = data.media;\n }\n\n onMediaDetaching() {\n clearCurrentCues(this.textTrack1);\n clearCurrentCues(this.textTrack2);\n }\n\n onManifestLoading()\n {\n this.lastSn = -1; // Detect discontiguity in fragment parsing\n this.prevCC = -1;\n this.vttCCs = {ccOffset: 0, presentationOffset: 0}; // Detect discontinuity in subtitle manifests\n\n // clear outdated subtitles\n const media = this.media;\n if (media) {\n const textTracks = media.textTracks;\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n clearCurrentCues(textTracks[i]);\n }\n }\n }\n }\n\n onManifestLoaded(data) {\n this.textTracks = [];\n this.unparsedVttFrags = this.unparsedVttFrags || [];\n this.initPTS = undefined;\n this.cueRanges = [];\n\n if (this.config.enableWebVTT) {\n this.tracks = data.subtitles || [];\n const inUseTracks = this.media ? this.media.textTracks : [];\n\n this.tracks.forEach((track, index) => {\n let textTrack;\n if (index < inUseTracks.length) {\n const inUseTrack = inUseTracks[index];\n // Reuse tracks with the same label, but do not reuse 608/708 tracks\n if (reuseVttTextTrack(inUseTrack, track)) {\n textTrack = inUseTrack;\n }\n }\n if (!textTrack) {\n textTrack = this.createTextTrack('subtitles', track.name, track.lang);\n }\n textTrack.mode = track.default ? 'showing' : 'hidden';\n this.textTracks.push(textTrack);\n });\n }\n }\n\n onLevelSwitching() {\n this.enabled = this.hls.currentLevel.closedCaptions !== 'NONE';\n }\n\n onFragLoaded(data) {\n let frag = data.frag,\n payload = data.payload;\n if (frag.type === 'main') {\n var sn = frag.sn;\n // if this frag isn't contiguous, clear the parser so cues with bad start/end times aren't added to the textTrack\n if (sn !== this.lastSn + 1) {\n const cea608Parser = this.cea608Parser;\n if (cea608Parser) {\n cea608Parser.reset();\n }\n }\n this.lastSn = sn;\n }\n // If fragment is subtitle type, parse as WebVTT.\n else if (frag.type === 'subtitle') {\n if (payload.byteLength) {\n // We need an initial synchronisation PTS. Store fragments as long as none has arrived.\n if (typeof this.initPTS === 'undefined') {\n this.unparsedVttFrags.push(data);\n return;\n }\n let vttCCs = this.vttCCs;\n if (!vttCCs[frag.cc]) {\n vttCCs[frag.cc] = { start: frag.start, prevCC: this.prevCC, new: true };\n this.prevCC = frag.cc;\n }\n let textTracks = this.textTracks,\n hls = this.hls;\n\n // Parse the WebVTT file contents.\n WebVTTParser.parse(payload, this.initPTS, vttCCs, frag.cc, function (cues) {\n const currentTrack = textTracks[frag.trackId];\n // Add cues and trigger event with success true.\n cues.forEach(cue => {\n // Sometimes there are cue overlaps on segmented vtts so the same\n // cue can appear more than once in different vtt files.\n // This avoid showing duplicated cues with same timecode and text.\n if (!currentTrack.cues.getCueById(cue.id)) {\n currentTrack.addCue(cue);\n }\n });\n hls.trigger(Event.SUBTITLE_FRAG_PROCESSED, {success: true, frag: frag});\n },\n function (e) {\n // Something went wrong while parsing. Trigger event with success false.\n logger.log(`Failed to parse VTT cue: ${e}`);\n hls.trigger(Event.SUBTITLE_FRAG_PROCESSED, {success: false, frag: frag});\n });\n }\n else {\n // In case there is no payload, finish unsuccessfully.\n this.hls.trigger(Event.SUBTITLE_FRAG_PROCESSED, {success: false, frag: frag});\n }\n }\n }\n\n 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 && this.config.enableCEA708Captions) {\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 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;\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\nexport default TimelineController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/timeline-controller.js","export default class AESCrypto {\n constructor(subtle,iv) {\n this.subtle = subtle;\n this.aesIV = iv;\n }\n\n decrypt(data, key) {\n return this.subtle.decrypt({name: 'AES-CBC', iv: this.aesIV}, key, data);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/aes-crypto.js","class AESDecryptor {\n constructor() {\n // Static after running initTable\n this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n this.subMix = [new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];\n this.invSubMix = [new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];\n this.sBox = new Uint32Array(256);\n this.invSBox = new Uint32Array(256);\n\n // Changes during runtime\n this.key = new Uint32Array(0);\n\n this.initTable();\n }\n\n // Using view.getUint32() also swaps the byte order.\n uint8ArrayToUint32Array_(arrayBuffer) {\n let view = new DataView(arrayBuffer);\n let newArray = new Uint32Array(4);\n for (let i = 0; i < 4; i++) {\n newArray[i] = view.getUint32(i * 4);\n }\n return newArray;\n }\n\n initTable() {\n let sBox = this.sBox;\n let invSBox = this.invSBox;\n let subMix = this.subMix;\n let subMix0 = subMix[0];\n let subMix1 = subMix[1];\n let subMix2 = subMix[2];\n let subMix3 = subMix[3];\n let invSubMix = this.invSubMix;\n let invSubMix0 = invSubMix[0];\n let invSubMix1 = invSubMix[1];\n let invSubMix2 = invSubMix[2];\n let invSubMix3 = invSubMix[3];\n\n let d = new Uint32Array(256);\n let x = 0;\n let xi = 0;\n let i = 0;\n for (i = 0; i < 256; i++) {\n if (i < 128) {\n d[i] = i << 1;\n } else {\n d[i] = (i << 1) ^ 0x11b;\n }\n }\n\n for (i = 0; i < 256; i++) {\n let sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);\n sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;\n sBox[x] = sx;\n invSBox[sx] = x;\n\n // Compute multiplication\n let x2 = d[x];\n let x4 = d[x2];\n let x8 = d[x4];\n\n // Compute sub/invSub bytes, mix columns tables\n let t = (d[sx] * 0x101) ^ (sx * 0x1010100);\n subMix0[x] = (t << 24) | (t >>> 8);\n subMix1[x] = (t << 16) | (t >>> 16);\n subMix2[x] = (t << 8) | (t >>> 24);\n subMix3[x] = t;\n\n // Compute inv sub bytes, inv mix columns tables\n t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);\n invSubMix0[sx] = (t << 24) | (t >>> 8);\n invSubMix1[sx] = (t << 16) | (t >>> 16);\n invSubMix2[sx] = (t << 8) | (t >>> 24);\n invSubMix3[sx] = t;\n\n // Compute next counter\n if (!x) {\n x = xi = 1;\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]];\n xi ^= d[d[xi]];\n }\n }\n }\n\n expandKey(keyBuffer) {\n // convert keyBuffer to Uint32Array\n let key = this.uint8ArrayToUint32Array_(keyBuffer);\n let sameKey = true;\n let offset = 0;\n\n while (offset < key.length && sameKey) {\n sameKey = (key[offset] === this.key[offset]);\n offset++;\n }\n\n if (sameKey) {\n return;\n }\n\n this.key = key;\n let keySize = this.keySize = key.length;\n\n if (keySize !== 4 && keySize !== 6 && keySize !== 8) {\n throw new Error('Invalid aes key size=' + keySize);\n }\n\n let ksRows = this.ksRows = (keySize + 6 + 1) * 4;\n let ksRow;\n let invKsRow;\n\n let keySchedule = this.keySchedule = new Uint32Array(ksRows);\n let invKeySchedule = this.invKeySchedule = new Uint32Array(ksRows);\n let sbox = this.sBox;\n let rcon = this.rcon;\n\n let invSubMix = this.invSubMix;\n let invSubMix0 = invSubMix[0];\n let invSubMix1 = invSubMix[1];\n let invSubMix2 = invSubMix[2];\n let invSubMix3 = invSubMix[3];\n\n let prev;\n let t;\n\n for (ksRow = 0; ksRow < ksRows; ksRow++) {\n if (ksRow < keySize) {\n prev = keySchedule[ksRow] = key[ksRow];\n continue;\n }\n t = prev;\n\n if (ksRow % keySize === 0) {\n // Rot word\n t = (t << 8) | (t >>> 24);\n\n // Sub word\n t = (sbox[t >>> 24] << 24) | (sbox[(t >>> 16) & 0xff] << 16) | (sbox[(t >>> 8) & 0xff] << 8) | sbox[t & 0xff];\n\n // Mix Rcon\n t ^= rcon[(ksRow / keySize) | 0] << 24;\n } else if (keySize > 6 && ksRow % keySize === 4) {\n // Sub word\n t = (sbox[t >>> 24] << 24) | (sbox[(t >>> 16) & 0xff] << 16) | (sbox[(t >>> 8) & 0xff] << 8) | sbox[t & 0xff];\n }\n\n keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;\n }\n\n for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n ksRow = ksRows - invKsRow;\n if (invKsRow & 3) {\n t = keySchedule[ksRow];\n } else {\n t = keySchedule[ksRow - 4];\n }\n\n if (invKsRow < 4 || ksRow <= 4) {\n invKeySchedule[invKsRow] = t;\n } else {\n invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[(t >>> 16) & 0xff]] ^ invSubMix2[sbox[(t >>> 8) & 0xff]] ^ invSubMix3[sbox[t & 0xff]];\n }\n\n invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;\n }\n }\n\n // Adding this as a method greatly improves performance.\n networkToHostOrderSwap(word) {\n return (word << 24) | ((word & 0xff00) << 8) | ((word & 0xff0000) >> 8) | (word >>> 24);\n }\n\n decrypt(inputArrayBuffer, offset, aesIV) {\n let nRounds = this.keySize + 6;\n let invKeySchedule = this.invKeySchedule;\n let invSBOX = this.invSBox;\n\n let invSubMix = this.invSubMix;\n let invSubMix0 = invSubMix[0];\n let invSubMix1 = invSubMix[1];\n let invSubMix2 = invSubMix[2];\n let invSubMix3 = invSubMix[3];\n\n let initVector = this.uint8ArrayToUint32Array_(aesIV);\n let initVector0 = initVector[0];\n let initVector1 = initVector[1];\n let initVector2 = initVector[2];\n let initVector3 = initVector[3];\n\n let inputInt32 = new Int32Array(inputArrayBuffer);\n let outputInt32 = new Int32Array(inputInt32.length);\n\n let t0, t1, t2, t3;\n let s0, s1, s2, s3;\n let inputWords0, inputWords1, inputWords2, inputWords3;\n\n var ksRow, i;\n let swapWord = this.networkToHostOrderSwap;\n\n while (offset < inputInt32.length) {\n inputWords0 = swapWord(inputInt32[offset]);\n inputWords1 = swapWord(inputInt32[offset + 1]);\n inputWords2 = swapWord(inputInt32[offset + 2]);\n inputWords3 = swapWord(inputInt32[offset + 3]);\n\n s0 = inputWords0 ^ invKeySchedule[0];\n s1 = inputWords3 ^ invKeySchedule[1];\n s2 = inputWords2 ^ invKeySchedule[2];\n s3 = inputWords1 ^ invKeySchedule[3];\n\n ksRow = 4;\n\n // Iterate through the rounds of decryption\n for (i = 1; i < nRounds; i++) {\n t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[(s1 >> 16) & 0xff] ^ invSubMix2[(s2 >> 8) & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[(s2 >> 16) & 0xff] ^ invSubMix2[(s3 >> 8) & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[(s3 >> 16) & 0xff] ^ invSubMix2[(s0 >> 8) & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[(s0 >> 16) & 0xff] ^ invSubMix2[(s1 >> 8) & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n // Update state\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n\n ksRow = ksRow + 4;\n }\n\n // Shift rows, sub bytes, add round key\n t0 = ((invSBOX[s0 >>> 24] << 24) ^ (invSBOX[(s1 >> 16) & 0xff] << 16) ^ (invSBOX[(s2 >> 8) & 0xff] << 8) ^ invSBOX[s3 & 0xff]) ^ invKeySchedule[ksRow];\n t1 = ((invSBOX[s1 >>> 24] << 24) ^ (invSBOX[(s2 >> 16) & 0xff] << 16) ^ (invSBOX[(s3 >> 8) & 0xff] << 8) ^ invSBOX[s0 & 0xff]) ^ invKeySchedule[ksRow + 1];\n t2 = ((invSBOX[s2 >>> 24] << 24) ^ (invSBOX[(s3 >> 16) & 0xff] << 16) ^ (invSBOX[(s0 >> 8) & 0xff] << 8) ^ invSBOX[s1 & 0xff]) ^ invKeySchedule[ksRow + 2];\n t3 = ((invSBOX[s3 >>> 24] << 24) ^ (invSBOX[(s0 >> 16) & 0xff] << 16) ^ (invSBOX[(s1 >> 8) & 0xff] << 8) ^ invSBOX[s2 & 0xff]) ^ invKeySchedule[ksRow + 3];\n ksRow = ksRow + 3;\n\n // Write\n outputInt32[offset] = swapWord(t0 ^ initVector0);\n outputInt32[offset + 1] = swapWord(t3 ^ initVector1);\n outputInt32[offset + 2] = swapWord(t2 ^ initVector2);\n outputInt32[offset + 3] = swapWord(t1 ^ initVector3);\n\n // reset initVector to last 4 unsigned int\n initVector0 = inputWords0;\n initVector1 = inputWords1;\n initVector2 = inputWords2;\n initVector3 = inputWords3;\n\n offset = offset + 4;\n }\n\n return outputInt32.buffer;\n }\n\n destroy() {\n this.key = undefined;\n this.keySize = undefined;\n this.ksRows = undefined;\n\n this.sBox = undefined;\n this.invSBox = undefined;\n this.subMix = undefined;\n this.invSubMix = undefined;\n this.keySchedule = undefined;\n this.invKeySchedule = undefined;\n\n this.rcon = undefined;\n }\n}\n\nexport default AESDecryptor;\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/aes-decryptor.js","import AESCrypto from './aes-crypto';\nimport FastAESKey from './fast-aes-key';\nimport AESDecryptor from './aes-decryptor';\n\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\n/*globals self: false */\n\nclass Decrypter {\n constructor(observer,config) {\n this.observer = observer;\n this.config = config;\n this.logEnabled = true;\n try {\n const browserCrypto = crypto ? crypto : self.crypto;\n this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;\n } catch (e) {}\n this.disableWebCrypto = !this.subtle;\n }\n\n isSync() {\n return (this.disableWebCrypto && this.config.enableSoftwareAES);\n }\n\n decrypt(data, key, iv, callback) {\n if (this.disableWebCrypto && this.config.enableSoftwareAES) {\n if (this.logEnabled) {\n logger.log('JS AES decrypt');\n this.logEnabled = false;\n }\n let decryptor = this.decryptor;\n if (!decryptor) {\n this.decryptor = decryptor = new AESDecryptor();\n }\n decryptor.expandKey(key);\n callback(decryptor.decrypt(data, 0, iv));\n }\n else {\n if (this.logEnabled) {\n logger.log('WebCrypto AES decrypt');\n this.logEnabled = false;\n }\n const subtle = this.subtle;\n if (this.key !== key) {\n this.key = key;\n this.fastAesKey = new FastAESKey(subtle,key);\n }\n\n this.fastAesKey.expandKey().\n then((aesKey) => {\n // decrypt using web crypto\n let crypto = new AESCrypto(subtle,iv);\n crypto.decrypt(data, aesKey).\n catch ((err) => {\n this.onWebCryptoError(err, data, key, iv, callback);\n }).\n then((result) => {\n callback(result);\n });\n }).\n catch ((err) => {\n this.onWebCryptoError(err, data, key, iv, callback);\n });\n }\n }\n\n onWebCryptoError(err, data, key, iv, callback) {\n if (this.config.enableSoftwareAES) {\n logger.log('WebCrypto Error, disable WebCrypto API');\n this.disableWebCrypto = true;\n this.logEnabled = true;\n this.decrypt(data, key, iv, callback);\n }\n else {\n logger.error(`decrypting error : ${err.message}`);\n this.observer.trigger(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details : ErrorDetails.FRAG_DECRYPT_ERROR, fatal : true, reason : err.message});\n }\n }\n\n destroy() {\n let decryptor = this.decryptor;\n if (decryptor) {\n decryptor.destroy();\n this.decryptor = undefined;\n }\n }\n}\n\nexport default Decrypter;\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/decrypter.js","class FastAESKey {\n constructor(subtle,key) {\n this.subtle = subtle;\n this.key = key;\n }\n\n expandKey() {\n return this.subtle.importKey('raw', this.key, {name: 'AES-CBC'}, false, ['encrypt', 'decrypt']);\n }\n}\n\nexport default FastAESKey;\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/fast-aes-key.js","/**\n * AAC demuxer\n */\nimport ADTS from './adts';\nimport {logger} from '../utils/logger';\nimport ID3 from '../demux/id3';\n\n class AACDemuxer {\n\n constructor(observer, remuxer, config) {\n this.observer = observer;\n this.config = config;\n this.remuxer = remuxer;\n }\n\n resetInitSegment(initSegment,audioCodec,videoCodec, duration) {\n this._audioTrack = {container : 'audio/adts', type: 'audio', id :-1, sequenceNumber: 0, isAAC : true , samples : [], len : 0, manifestCodec : audioCodec, duration : duration, inputTimeScale : 90000};\n }\n\n resetTimeStamp() {\n }\n\n static probe(data) {\n // check if data contains ID3 timestamp and ADTS sync word\n var id3 = new ID3(data), offset, length;\n if(id3.hasTimeStamp) {\n // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1\n // Layer bits (position 14 and 15) in header should be always 0 for ADTS\n // More info https://wiki.multimedia.cx/index.php?title=ADTS\n for (offset = id3.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {\n if ((data[offset] === 0xff) && (data[offset+1] & 0xf6) === 0xf0) {\n //logger.log('ADTS sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset, contiguous,accurateTimeOffset) {\n var track,\n id3 = new ID3(data),\n pts = 90*id3.timeStamp,\n config, frameLength, frameDuration, frameIndex, offset, headerLength, stamp, length, aacSample;\n\n track = this._audioTrack;\n\n // Look for ADTS header\n for (offset = id3.length, length = data.length; offset < length - 1; offset++) {\n if ((data[offset] === 0xff) && (data[offset+1] & 0xf6) === 0xf0) {\n break;\n }\n }\n\n if (!track.samplerate) {\n config = ADTS.getAudioConfig(this.observer,data, offset, track.manifestCodec);\n track.config = config.config;\n track.samplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n logger.log(`parsed codec:${track.codec},rate:${config.samplerate},nb channel:${config.channelCount}`);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.samplerate;\n while ((offset + 5) < length) {\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) |\n (data[offset + 4] << 3) |\n ((data[offset + 5] & 0xE0) >>> 5);\n frameLength -= headerLength;\n //stamp = pes.pts;\n\n if ((frameLength > 0) && ((offset + headerLength + frameLength) <= length)) {\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 < (length - 1); offset++) {\n if ((data[offset] === 0xff) && ((data[offset + 1] & 0xf6) === 0xf0)) {\n break;\n }\n }\n } else {\n break;\n }\n }\n this.remuxer.remux(track,\n {samples : []},\n {samples : [ { pts: pts, dts : pts, data : id3.payload}], inputTimeScale : 90000},\n {samples : []},\n timeOffset,\n contiguous,\n accurateTimeOffset);\n }\n\n destroy() {\n }\n\n}\n\nexport default AACDemuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/aacdemuxer.js","/**\n * ADTS parser helper\n */\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n\n const ADTS = {\n getAudioConfig : function(observer, data, offset, audioCodec) {\n var adtsObjectType, // :int\n adtsSampleingIndex, // :int\n adtsExtensionSampleingIndex, // :int\n adtsChanelConfig, // :int\n config,\n userAgent = navigator.userAgent.toLowerCase(),\n manifestCodec = audioCodec,\n adtsSampleingRates = [\n 96000, 88200,\n 64000, 48000,\n 44100, 32000,\n 24000, 22050,\n 16000, 12000,\n 11025, 8000,\n 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: ErrorTypes.MEDIA_ERROR, details: 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.log(`manifest codec:${audioCodec},ADTS data:type:${adtsObjectType},sampleingIndex:${adtsSampleingIndex}[${adtsSampleingRates[adtsSampleingIndex]}Hz],channelConfig:${adtsChanelConfig}`);\n // firefox: freq less than 24kHz = AAC SBR (HE-AAC)\n if (/firefox/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/Opera ...)\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) ||\n (audioCodec.indexOf('mp4a.40.5') !== -1))) ||\n (!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) ||\n (!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), manifestCodec : manifestCodec};\n }\n};\n\nmodule.exports = ADTS;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/adts.js","/* inline demuxer.\n * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)\n */\n\nimport Event from '../events';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport Decrypter from '../crypt/decrypter';\nimport AACDemuxer from '../demux/aacdemuxer';\nimport MP4Demuxer from '../demux/mp4demuxer';\nimport TSDemuxer from '../demux/tsdemuxer';\nimport MP3Demuxer from '../demux/mp3demuxer';\nimport MP4Remuxer from '../remux/mp4-remuxer';\nimport PassThroughRemuxer from '../remux/passthrough-remuxer';\n\nclass DemuxerInline {\n\n constructor(observer,typeSupported, config, vendor) {\n this.observer = observer;\n this.typeSupported = typeSupported;\n this.config = config;\n this.vendor = vendor;\n }\n\n destroy() {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n }\n }\n\n push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {\n if ((data.byteLength > 0) && (decryptdata != null) && (decryptdata.key != null) && (decryptdata.method === 'AES-128')) {\n let decrypter = this.decrypter;\n if (decrypter == null) {\n decrypter = this.decrypter = new Decrypter(this.observer, this.config);\n }\n var localthis = this;\n // performance.now() not available on WebWorker, at least on Safari Desktop\n var startTime;\n try {\n startTime = performance.now();\n } catch(error) {\n startTime = Date.now();\n }\n decrypter.decrypt(data, decryptdata.key.buffer, decryptdata.iv.buffer, function (decryptedData) {\n var endTime;\n try {\n endTime = performance.now();\n } catch(error) {\n endTime = Date.now();\n }\n localthis.observer.trigger(Event.FRAG_DECRYPTED, { stats: { tstart: startTime, tdecrypt: endTime } });\n localthis.pushDecrypted(new Uint8Array(decryptedData), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset,defaultInitPTS);\n });\n } else {\n this.pushDecrypted(new Uint8Array(data), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration,accurateTimeOffset,defaultInitPTS);\n }\n }\n\n pushDecrypted(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration,accurateTimeOffset,defaultInitPTS) {\n var demuxer = this.demuxer;\n if (!demuxer || \n // in case of continuity change, we might switch from content type (AAC container to TS container for example)\n // so let's check that current demuxer is still valid\n (discontinuity && !this.probe(data))) {\n const observer = this.observer;\n const typeSupported = this.typeSupported;\n const config = this.config;\n const muxConfig = [ {demux : TSDemuxer, remux : MP4Remuxer},\n {demux : MP3Demuxer, remux : MP4Remuxer},\n {demux : AACDemuxer, remux : MP4Remuxer},\n {demux : MP4Demuxer, remux : PassThroughRemuxer}];\n\n // probe for content type\n for (let i in muxConfig) {\n const mux = muxConfig[i];\n const probe = mux.demux.probe;\n if(probe(data)) {\n const remuxer = this.remuxer = new mux.remux(observer,config,typeSupported, this.vendor);\n demuxer = new mux.demux(observer,remuxer,config,typeSupported);\n this.probe = probe;\n break;\n }\n }\n if(!demuxer) {\n observer.trigger(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'no demux matching with content found'});\n return;\n }\n this.demuxer = demuxer;\n }\n const remuxer = this.remuxer;\n\n if (discontinuity || trackSwitch) {\n demuxer.resetInitSegment(initSegment,audioCodec,videoCodec,duration);\n remuxer.resetInitSegment();\n }\n if (discontinuity) {\n demuxer.resetTimeStamp();\n remuxer.resetTimeStamp(defaultInitPTS);\n }\n if (typeof demuxer.setDecryptData === 'function') {\n demuxer.setDecryptData(decryptdata);\n }\n demuxer.append(data,timeOffset,contiguous,accurateTimeOffset);\n }\n}\n\nexport default DemuxerInline;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/demuxer-inline.js","/* 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\n import DemuxerInline from '../demux/demuxer-inline';\n import Event from '../events';\n import {enableLogs} from '../utils/logger';\n import EventEmitter from 'events';\n\nvar DemuxerWorker = function (self) {\n // observer setup\n var observer = new EventEmitter();\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...data);\n };\n\n var forwardMessage = function(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 let config = JSON.parse(data.config);\n self.demuxer = new DemuxerInline(observer, data.typeSupported, config, data.vendor);\n try {\n enableLogs(config.debug === true);\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(data.data, data.decryptdata, data.initSegment, data.audioCodec, data.videoCodec, data.timeOffset,data.discontinuity, data.trackSwitch,data.contiguous,data.duration,data.accurateTimeOffset,data.defaultInitPTS);\n break;\n default:\n break;\n }\n });\n\n // forward events to main thread\n observer.on(Event.FRAG_DECRYPTED, forwardMessage);\n observer.on(Event.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(Event.FRAG_PARSED, forwardMessage);\n observer.on(Event.ERROR, forwardMessage);\n observer.on(Event.FRAG_PARSING_METADATA, forwardMessage);\n observer.on(Event.FRAG_PARSING_USERDATA, forwardMessage);\n observer.on(Event.INIT_PTS_FOUND, forwardMessage);\n\n // special case for FRAG_PARSING_DATA: pass data1/data2 as transferable object (no copy)\n observer.on(Event.FRAG_PARSING_DATA, function(ev, data) {\n let transferable = [];\n let message = {event: ev, data:data};\n if (data.data1) {\n message.data1 = data.data1.buffer;\n transferable.push(data.data1.buffer);\n delete data.data1;\n }\n if (data.data2) {\n message.data2 = data.data2.buffer;\n transferable.push(data.data2.buffer);\n delete data.data2;\n }\n self.postMessage(message,transferable);\n });\n};\n\nexport default DemuxerWorker;\n\n\n\n\n// WEBPACK FOOTER //\n// src/demux/demuxer-worker.js","import Event from '../events';\nimport DemuxerInline from '../demux/demuxer-inline';\nimport DemuxerWorker from '../demux/demuxer-worker';\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport EventEmitter from 'events';\n\nclass Demuxer {\n\n constructor(hls, id) {\n this.hls = hls;\n this.id = id;\n // observer setup\n const observer = this.observer = new EventEmitter();\n const config = hls.config;\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...data);\n };\n\n var forwardMessage = function(ev,data) {\n data = data || {};\n data.frag = this.frag;\n data.id = this.id;\n hls.trigger(ev,data);\n }.bind(this);\n\n // forward events to main thread\n observer.on(Event.FRAG_DECRYPTED, forwardMessage);\n observer.on(Event.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(Event.FRAG_PARSING_DATA, forwardMessage);\n observer.on(Event.FRAG_PARSED, forwardMessage);\n observer.on(Event.ERROR, forwardMessage);\n observer.on(Event.FRAG_PARSING_METADATA, forwardMessage);\n observer.on(Event.FRAG_PARSING_USERDATA, forwardMessage);\n observer.on(Event.INIT_PTS_FOUND, forwardMessage);\n\n const typeSupported = {\n mp4 : MediaSource.isTypeSupported('video/mp4'),\n mpeg: MediaSource.isTypeSupported('audio/mpeg'),\n mp3: MediaSource.isTypeSupported('audio/mp4; codecs=\"mp3\"')\n };\n // navigator.vendor is not always available in Web Worker\n // refer to https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/navigator\n const vendor = navigator.vendor;\n if (config.enableWorker && (typeof(Worker) !== 'undefined')) {\n logger.log('demuxing in webworker');\n let w;\n try {\n let work = require('webworkify');\n w = this.w = work(DemuxerWorker);\n this.onwmsg = this.onWorkerMessage.bind(this);\n w.addEventListener('message', this.onwmsg);\n w.onerror = function(event) { hls.trigger(Event.ERROR, {type: ErrorTypes.OTHER_ERROR, details: ErrorDetails.INTERNAL_EXCEPTION, fatal: true, event : 'demuxerWorker', err : { message : event.message + ' (' + event.filename + ':' + event.lineno + ')' }});};\n w.postMessage({cmd: 'init', typeSupported : typeSupported, vendor : vendor, id : id, config: JSON.stringify(config)});\n } catch(err) {\n 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 DemuxerInline(observer,typeSupported,config,vendor);\n this.w = undefined;\n }\n } else {\n this.demuxer = new DemuxerInline(observer,typeSupported,config, vendor);\n }\n }\n\n destroy() {\n let w = this.w;\n if (w) {\n w.removeEventListener('message', this.onwmsg);\n w.terminate();\n this.w = null;\n } else {\n let demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n this.demuxer = null;\n }\n }\n let observer = this.observer;\n if (observer) {\n observer.removeAllListeners();\n this.observer = null;\n }\n }\n\n push(data, initSegment, audioCodec, videoCodec, frag, duration,accurateTimeOffset,defaultInitPTS) {\n const w = this.w;\n const timeOffset = !isNaN(frag.startDTS) ? frag.startDTS : frag.start;\n const decryptdata = frag.decryptdata;\n const lastFrag = this.frag;\n const discontinuity = !(lastFrag && (frag.cc === lastFrag.cc));\n const trackSwitch = !(lastFrag && (frag.level === lastFrag.level));\n const nextSN = lastFrag && (frag.sn === (lastFrag.sn+1));\n const contiguous = !trackSwitch && nextSN;\n if (discontinuity) {\n logger.log(`${this.id}:discontinuity detected`);\n }\n if (trackSwitch) {\n logger.log(`${this.id}:switch detected`);\n }\n this.frag = frag;\n if (w) {\n // post fragment payload as transferable objects (no copy)\n w.postMessage({cmd: 'demux', data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset,defaultInitPTS}, [data]);\n } else {\n let demuxer = this.demuxer;\n if (demuxer) {\n demuxer.push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset,defaultInitPTS);\n }\n }\n }\n\n onWorkerMessage(ev) {\n let 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 Event.FRAG_PARSING_DATA:\n data.data.data1 = new Uint8Array(data.data1);\n if (data.data2) {\n data.data.data2 = new Uint8Array(data.data2);\n }\n /* falls through */\n default:\n data.data = data.data || {};\n data.data.frag = this.frag;\n data.data.id = this.id;\n hls.trigger(data.event, data.data);\n break;\n }\n }\n}\n\nexport default Demuxer;\n\n\n\n\n// WEBPACK FOOTER //\n// src/demux/demuxer.js","/**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.\n*/\n\nimport {logger} from '../utils/logger';\n\nclass ExpGolomb {\n\n constructor(data) {\n this.data = data;\n // the number of bytes left to examine in this.data\n this.bytesAvailable = 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 loadWord() {\n var\n data = this.data,\n bytesAvailable = this.bytesAvailable,\n position = data.byteLength - bytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, bytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(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 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 readBits(size) {\n var\n bits = Math.min(this.bitsAvailable, size), // :uint\n valu = this.word >>> (32 - bits); // :uint\n if (size > 32) {\n 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 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 skipUEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():void\n skipEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():uint\n readUEG() {\n var clz = this.skipLZ(); // :uint\n return this.readBits(clz + 1) - 1;\n }\n\n // ():int\n 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 readBoolean() {\n return 1 === this.readBits(1);\n }\n\n // ():int\n readUByte() {\n return this.readBits(8);\n }\n\n // ():int\n readUShort() {\n return this.readBits(16);\n }\n // ():int\n 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 skipScalingList(count) {\n var\n 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 readSPS() {\n var\n frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n profileIdc,profileCompat,levelIdc,\n numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n i,\n readUByte = this.readUByte.bind(this),\n readBits = this.readBits.bind(this),\n readUEG = this.readUEG.bind(this),\n readBoolean = this.readBoolean.bind(this),\n skipBits = this.skipBits.bind(this),\n skipEG = this.skipEG.bind(this),\n skipUEG = this.skipUEG.bind(this),\n skipScalingList = this.skipScalingList.bind(this);\n\n readUByte();\n profileIdc = readUByte(); // profile_idc\n profileCompat = readBits(5); // constraint_set[0-4]_flag, u(5)\n skipBits(3); // reserved_zero_3bits u(3),\n levelIdc = readUByte(); //level_idc u(8)\n skipUEG(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n if (profileIdc === 100 ||\n profileIdc === 110 ||\n profileIdc === 122 ||\n profileIdc === 244 ||\n profileIdc === 44 ||\n profileIdc === 83 ||\n profileIdc === 86 ||\n profileIdc === 118 ||\n profileIdc === 128) {\n var chromaFormatIdc = readUEG();\n if (chromaFormatIdc === 3) {\n skipBits(1); // separate_colour_plane_flag\n }\n skipUEG(); // bit_depth_luma_minus8\n skipUEG(); // bit_depth_chroma_minus8\n skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (readBoolean()) { // seq_scaling_matrix_present_flag\n scalingListCount = (chromaFormatIdc !== 3) ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (readBoolean()) { // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16);\n } else {\n skipScalingList(64);\n }\n }\n }\n }\n }\n skipUEG(); // log2_max_frame_num_minus4\n var picOrderCntType = readUEG();\n if (picOrderCntType === 0) {\n readUEG(); //log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n skipBits(1); // delta_pic_order_always_zero_flag\n skipEG(); // offset_for_non_ref_pic\n skipEG(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = readUEG();\n for(i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n skipEG(); // offset_for_ref_frame[ i ]\n }\n }\n skipUEG(); // max_num_ref_frames\n skipBits(1); // gaps_in_frame_num_value_allowed_flag\n picWidthInMbsMinus1 = readUEG();\n picHeightInMapUnitsMinus1 = readUEG();\n frameMbsOnlyFlag = readBits(1);\n if (frameMbsOnlyFlag === 0) {\n skipBits(1); // mb_adaptive_frame_field_flag\n }\n skipBits(1); // direct_8x8_inference_flag\n if (readBoolean()) { // frame_cropping_flag\n frameCropLeftOffset = readUEG();\n frameCropRightOffset = readUEG();\n frameCropTopOffset = readUEG();\n frameCropBottomOffset = readUEG();\n }\n let pixelRatio = [1,1];\n if (readBoolean()) {\n // vui_parameters_present_flag\n if (readBoolean()) {\n // aspect_ratio_info_present_flag\n const aspectRatioIdc = readUByte();\n switch (aspectRatioIdc) {\n case 1: pixelRatio = [1,1]; break;\n case 2: pixelRatio = [12,11]; break;\n case 3: pixelRatio = [10,11]; break;\n case 4: pixelRatio = [16,11]; break;\n case 5: pixelRatio = [40,33]; break;\n case 6: pixelRatio = [24,11]; break;\n case 7: pixelRatio = [20,11]; break;\n case 8: pixelRatio = [32,11]; break;\n case 9: pixelRatio = [80,33]; break;\n case 10: pixelRatio = [18,11]; break;\n case 11: pixelRatio = [15,11]; break;\n case 12: pixelRatio = [64,33]; break;\n case 13: pixelRatio = [160,99]; break;\n case 14: pixelRatio = [4,3]; break;\n case 15: pixelRatio = [3,2]; break;\n case 16: pixelRatio = [2,1]; break;\n case 255: {\n pixelRatio = [readUByte() << 8 | readUByte(), readUByte() << 8 | readUByte()];\n break;\n }\n }\n }\n }\n return {\n width: Math.ceil((((picWidthInMbsMinus1 + 1) * 16) - frameCropLeftOffset * 2 - frameCropRightOffset * 2)),\n height: ((2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16) - ((frameMbsOnlyFlag? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset)),\n pixelRatio : pixelRatio\n };\n }\n\n 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\nexport default ExpGolomb;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/exp-golomb.js","/**\n * ID3 parser\n */\nimport {logger} from '../utils/logger';\n//import Hex from '../utils/hex';\n\n class ID3 {\n\n constructor(data) {\n this._hasTimeStamp = false;\n this._length = 0;\n var offset = 0, byte1,byte2,byte3,byte4,tagSize,endPos,header,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.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.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 readUTF(data,start,len) {\n\n var result = '',offset = start, end = start + len;\n do {\n result += String.fromCharCode(data[offset++]);\n } while(offset < end);\n return result;\n }\n\n _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 +\n data[offset++] << 16 +\n data[offset++] << 8 +\n data[offset++];\n\n tagFlags = data[offset++] << 8 +\n 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) +\n (data[offset++] << 15) +\n (data[offset++] << 7) +\n data[offset++]) /45;\n\n if (pts33Bit) {\n timestamp += 47721858.84; // 2^32 / 90\n }\n timestamp = Math.round(timestamp);\n logger.trace(`ID3 timestamp found: ${timestamp}`);\n this._timeStamp = timestamp;\n }\n break;\n default:\n break;\n }\n }\n }\n\n get hasTimeStamp() {\n return this._hasTimeStamp;\n }\n\n get timeStamp() {\n return this._timeStamp;\n }\n\n get length() {\n return this._length;\n }\n\n get payload() {\n return this._payload;\n }\n\n}\n\nexport default ID3;\n\n\n\n\n// WEBPACK FOOTER //\n// src/demux/id3.js","/**\n * MP3 demuxer\n */\nimport ID3 from '../demux/id3';\nimport MpegAudio from './mpegaudio';\n\n class MP3Demuxer {\n\n constructor(observer, remuxer, config) {\n this.observer = observer;\n this.config = config;\n this.remuxer = remuxer;\n }\n\n resetInitSegment(initSegment,audioCodec,videoCodec, duration) {\n this._audioTrack = {container : 'audio/mpeg', type: 'audio', id :-1, sequenceNumber: 0, isAAC : false , samples : [], len : 0, manifestCodec : audioCodec, duration : duration, inputTimeScale : 90000};\n }\n\n resetTimeStamp() {\n }\n\n static probe(data) {\n // check if data contains ID3 timestamp and MPEG sync word\n var id3 = new ID3(data), offset, length;\n if (id3.hasTimeStamp) {\n // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1\n // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)\n // More info http://www.mp3-tech.org/programmer/frame_header.html\n for (offset = id3.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {\n if ((data[offset] === 0xff) && (data[offset+1] & 0xe0) === 0xe0 && (data[offset+1] & 0x06) !== 0x00) {\n //logger.log('MPEG sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset,contiguous,accurateTimeOffset) {\n var id3 = new ID3(data);\n var pts = 90*id3.timeStamp;\n var afterID3 = id3.length;\n var offset, length;\n\n // Look for MPEG header\n for (offset = afterID3, length = data.length; offset < length - 1; offset++) {\n if ((data[offset] === 0xff) && (data[offset+1] & 0xe0) === 0xe0 && (data[offset+1] & 0x06) !== 0x00) {\n break;\n }\n }\n\n MpegAudio.parse(this._audioTrack, data, id3.length, pts);\n\n this.remuxer.remux(this._audioTrack,\n {samples : []},\n {samples : [ { pts: pts, dts : pts, data : id3.payload}], inputTimeScale : 90000},\n {samples : []},\n timeOffset,\n contiguous,\n accurateTimeOffset);\n }\n\n destroy() {\n }\n}\n\nexport default MP3Demuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/mp3demuxer.js","/**\n * MP4 demuxer\n */\n//import {logger} from '../utils/logger';\nimport Event from '../events';\n\n\n class MP4Demuxer {\n\n constructor(observer, remuxer) {\n this.observer = observer;\n this.remuxer = remuxer;\n }\n\n resetTimeStamp() {\n\n }\n\n resetInitSegment(initSegment,audioCodec,videoCodec, duration) {\n //jshint unused:false\n const initData = this.initData = MP4Demuxer.parseInitSegment(initSegment);\n var tracks = {};\n if (initData.audio) {\n tracks.audio = { container : 'audio/mp4', codec : audioCodec, initSegment : initSegment};\n }\n if (initData.video) {\n tracks.video = { container : 'video/mp4', codec : videoCodec, initSegment : initSegment};\n }\n this.observer.trigger(Event.FRAG_PARSING_INIT_SEGMENT,{ tracks : tracks });\n }\n\n static probe(data) {\n if (data.length >= 8) {\n const dataType = MP4Demuxer.bin2str(data.subarray(4,8));\n return (['moof','ftyp','styp'].indexOf(dataType) >= 0);\n }\n return false;\n }\n\n\n static bin2str(buffer) {\n return String.fromCharCode.apply(null, buffer);\n }\n\n static readUint32(buffer, offset) {\n const val = buffer[offset] << 24 |\n buffer[offset + 1] << 16 |\n buffer[offset + 2] << 8 |\n buffer[offset + 3];\n return val < 0 ? 4294967296 + val : val;\n }\n\n // Find the data for a box specified by its path\n static findBox(data, path) {\n var results = [],\n i, size, type, end, subresults;\n\n if (!path.length) {\n // short-circuit the search for empty paths\n return null;\n }\n\n for (i = 0; i < data.byteLength;) {\n size = MP4Demuxer.readUint32(data, i);\n type = MP4Demuxer.bin2str(data.subarray(i + 4, i + 8));\n\n end = size > 1 ? i + size : data.byteLength;\n\n if (type === path[0]) {\n if (path.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push(data.subarray(i + 8, end));\n } else {\n // recursively search for the next box along the path\n subresults = MP4Demuxer.findBox(data.subarray(i + 8, end), path.slice(1));\n if (subresults.length) {\n results = results.concat(subresults);\n }\n }\n }\n i = end;\n }\n\n // we've finished searching all of data\n return results;\n }\n\n\n\n/**\n * Parses an MP4 initialization segment and extracts stream type and\n * timescale values for any declared tracks. Timescale values indicate the\n * number of clock ticks per second to assume for time-based values\n * elsewhere in the MP4.\n *\n * To determine the start time of an MP4, you need two pieces of\n * information: the timescale unit and the earliest base media decode\n * time. Multiple timescales can be specified within an MP4 but the\n * base media decode time is always expressed in the timescale from\n * the media header box for the track:\n * ```\n * moov > trak > mdia > mdhd.timescale\n * moov > trak > mdia > hdlr\n * ```\n * @param init {Uint8Array} the bytes of the init segment\n * @return {object} a hash of track type to timescale values or null if\n * the init segment is malformed.\n */\n static parseInitSegment(initSegment) {\n var result = [];\n var traks = MP4Demuxer.findBox(initSegment, ['moov', 'trak']);\n\n traks.forEach(trak => {\n const tkhd = MP4Demuxer.findBox(trak, ['tkhd'])[0];\n if (tkhd) {\n let version = tkhd[0];\n let index = version === 0 ? 12 : 20;\n let trackId = MP4Demuxer.readUint32(tkhd, index);\n\n const mdhd = MP4Demuxer.findBox(trak, ['mdia', 'mdhd'])[0];\n if (mdhd) {\n version = mdhd[0];\n index = version === 0 ? 12 : 20;\n const timescale = MP4Demuxer.readUint32(mdhd, index);\n\n const hdlr = MP4Demuxer.findBox(trak, ['mdia', 'hdlr'])[0];\n if (hdlr) {\n const hdlrType = MP4Demuxer.bin2str(hdlr.subarray(8, 12));\n let type = { 'soun' : 'audio', 'vide' : 'video'}[hdlrType];\n if (type) {\n result[trackId] = { timescale : timescale , type : type};\n result[type] = { timescale : timescale , id : trackId};\n }\n }\n }\n }\n });\n return result;\n }\n\n\n/**\n * Determine the base media decode start time, in seconds, for an MP4\n * fragment. If multiple fragments are specified, the earliest time is\n * returned.\n *\n * The base media decode time can be parsed from track fragment\n * metadata:\n * ```\n * moof > traf > tfdt.baseMediaDecodeTime\n * ```\n * It requires the timescale value from the mdhd to interpret.\n *\n * @param timescale {object} a hash of track ids to timescale values.\n * @return {number} the earliest base media decode start time for the\n * fragment, in seconds\n */\nstatic startDTS(initData, fragment) {\n var trafs, baseTimes, result;\n\n // we need info from two childrend of each track fragment box\n trafs = MP4Demuxer.findBox(fragment, ['moof', 'traf']);\n\n // determine the start times for each track\n baseTimes = [].concat.apply([], trafs.map(function(traf) {\n return MP4Demuxer.findBox(traf, ['tfhd']).map(function(tfhd) {\n var id, scale, baseTime;\n\n // get the track id from the tfhd\n id = MP4Demuxer.readUint32(tfhd, 4);\n // assume a 90kHz clock if no timescale was specified\n scale = initData[id].timescale || 90e3;\n\n // get the base media decode time from the tfdt\n baseTime = MP4Demuxer.findBox(traf, ['tfdt']).map(function(tfdt) {\n var version, result;\n\n version = tfdt[0];\n result = MP4Demuxer.readUint32(tfdt, 4);\n if (version === 1) {\n result *= Math.pow(2, 32);\n\n result += MP4Demuxer.readUint32(tfdt, 8);\n }\n return result;\n })[0];\n baseTime = baseTime || Infinity;\n\n // convert base time to seconds\n return baseTime / scale;\n });\n }));\n\n // return the minimum\n result = Math.min.apply(null, baseTimes);\n return isFinite(result) ? result : 0;\n}\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset,contiguous,accurateTimeOffset) {\n const initData = this.initData;\n const startDTS = MP4Demuxer.startDTS(initData,data);\n this.remuxer.remux(initData.audio, initData.video, null, null, startDTS, contiguous,accurateTimeOffset,data);\n }\n\n destroy() {\n }\n\n}\n\nexport default MP4Demuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/mp4demuxer.js","/**\n * MPEG parser helper\n */\nimport {logger} from '../utils/logger';\n\nconst MpegAudio = {\n\n onFrame: function(track, data, bitRate, sampleRate, channelCount, frameIndex, pts) {\n var frameDuration = 1152 * 90000 / sampleRate;\n var stamp = pts + frameIndex * frameDuration;\n\n track.config = [];\n track.channelCount = channelCount;\n track.samplerate = sampleRate;\n track.samples.push({unit: data, pts: stamp, dts: stamp});\n track.len += data.length;\n },\n\n onNoise: function(data) {\n logger.warn('mpeg audio has noise: ' + data.length + ' bytes');\n },\n\n parseFrames: function(track, data, start, end, frameIndex, pts) {\n var BitratesMap = [\n 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448,\n 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384,\n 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320,\n 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256,\n 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160];\n var SamplingRateMap = [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000];\n\n if (start + 2 > end) {\n return -1; // we need at least 2 bytes to detect sync pattern\n }\n if (data[start] === 0xFF || (data[start + 1] & 0xE0) === 0xE0) {\n // Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference\n if (start + 24 > end) {\n return -1;\n }\n var headerB = (data[start + 1] >> 3) & 3;\n var headerC = (data[start + 1] >> 1) & 3;\n var headerE = (data[start + 2] >> 4) & 15;\n var headerF = (data[start + 2] >> 2) & 3;\n var headerG = !!(data[start + 2] & 2);\n if (headerB !== 1 && headerE !== 0 && headerE !== 15 && headerF !== 3) {\n var columnInBitrates = headerB === 3 ? (3 - headerC) : (headerC === 3 ? 3 : 4);\n var bitRate = BitratesMap[columnInBitrates * 14 + headerE - 1] * 1000;\n var columnInSampleRates = headerB === 3 ? 0 : headerB === 2 ? 1 : 2;\n var sampleRate = SamplingRateMap[columnInSampleRates * 3 + headerF];\n var padding = headerG ? 1 : 0;\n var channelCount = data[start + 3] >> 6 === 3 ? 1 : 2; // If bits of channel mode are `11` then it is a single channel (Mono)\n var frameLength = headerC === 3 ?\n ((headerB === 3 ? 12 : 6) * bitRate / sampleRate + padding) << 2 :\n ((headerB === 3 ? 144 : 72) * bitRate / sampleRate + padding) | 0;\n if (start + frameLength > end) {\n return -1;\n }\n\n this.onFrame(track, data.subarray(start, start + frameLength), bitRate, sampleRate, channelCount, frameIndex, pts);\n\n return frameLength;\n }\n }\n // noise or ID3, trying to skip\n var offset = start + 2;\n while (offset < end) {\n if (data[offset - 1] === 0xFF && (data[offset] & 0xE0) === 0xE0) {\n // sync pattern is found\n this.onNoise(data.subarray(start, offset - 1));\n\n return offset - start - 1;\n }\n offset++;\n }\n return -1;\n },\n\n parse: function(track, data, offset, pts) {\n var length = data.length;\n var frameIndex = 0;\n var parsed;\n\n while (offset < length &&\n (parsed = this.parseFrames(track, data, offset, length, frameIndex++, pts)) > 0) {\n offset += parsed;\n }\n }\n};\n\nmodule.exports = MpegAudio;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/mpegaudio.js","/**\n * SAMPLE-AES decrypter\n*/\n\n import Decrypter from '../crypt/decrypter';\n\n class SampleAesDecrypter {\n\n constructor(observer, config, decryptdata, discardEPB) {\n this.decryptdata = decryptdata;\n this.discardEPB = discardEPB;\n this.decrypter = new Decrypter(observer, config);\n }\n\n decryptBuffer(encryptedData, callback) {\n this.decrypter.decrypt(encryptedData, this.decryptdata.key.buffer, this.decryptdata.iv.buffer, callback);\n }\n\n // AAC - encrypt all full 16 bytes blocks starting from offset 16\n decryptAacSample(samples, sampleIndex, callback, sync) {\n let curUnit = samples[sampleIndex].unit;\n let encryptedData = curUnit.subarray(16, curUnit.length - curUnit.length % 16);\n let encryptedBuffer = encryptedData.buffer.slice(\n encryptedData.byteOffset,\n encryptedData.byteOffset + encryptedData.length);\n\n let localthis = this;\n this.decryptBuffer(encryptedBuffer, function (decryptedData) {\n decryptedData = new Uint8Array(decryptedData);\n curUnit.set(decryptedData, 16);\n\n if (!sync) {\n localthis.decryptAacSamples(samples, sampleIndex + 1, callback);\n }\n });\n }\n\n decryptAacSamples(samples, sampleIndex, callback) {\n for (;; sampleIndex++) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n\n if (samples[sampleIndex].unit.length < 32) {\n continue;\n }\n\n let sync = this.decrypter.isSync();\n\n this.decryptAacSample(samples, sampleIndex, callback, sync);\n\n if (!sync) {\n return;\n }\n }\n }\n\n // AVC - encrypt one 16 bytes block out of ten, starting from offset 32\n getAvcEncryptedData(decodedData) {\n let encryptedDataLen = Math.floor((decodedData.length - 48) / 160) * 16 + 16;\n let encryptedData = new Int8Array(encryptedDataLen);\n let outputPos = 0;\n for (let inputPos = 32; inputPos <= decodedData.length - 16; inputPos += 160, outputPos += 16) {\n encryptedData.set(decodedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return encryptedData;\n }\n\n getAvcDecryptedUnit(decodedData, decryptedData) {\n decryptedData = new Uint8Array(decryptedData);\n let inputPos = 0;\n for (let outputPos = 32; outputPos <= decodedData.length - 16; outputPos += 160, inputPos += 16) {\n decodedData.set(decryptedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return decodedData;\n }\n\n decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync) {\n let decodedData = this.discardEPB(curUnit.data);\n let encryptedData = this.getAvcEncryptedData(decodedData);\n let localthis = this;\n\n this.decryptBuffer(encryptedData.buffer, function (decryptedData) {\n curUnit.data = localthis.getAvcDecryptedUnit(decodedData, decryptedData);\n\n if (!sync) {\n localthis.decryptAvcSamples(samples, sampleIndex, unitIndex + 1, callback);\n }\n });\n }\n\n decryptAvcSamples(samples, sampleIndex, unitIndex, callback) {\n for (;; sampleIndex++, unitIndex = 0) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n\n let curUnits = samples[sampleIndex].units;\n for (;; unitIndex++) {\n if (unitIndex >= curUnits.length) {\n break;\n }\n\n let curUnit = curUnits[unitIndex];\n if (curUnit.length <= 48 || (curUnit.type !== 1 && curUnit.type !== 5)) {\n continue;\n }\n\n let sync = this.decrypter.isSync();\n\n this.decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync);\n\n if (!sync) {\n return;\n }\n }\n }\n }\n }\n\n export default SampleAesDecrypter;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/sample-aes.js","/**\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 ADTS from './adts';\n import MpegAudio from './mpegaudio';\n import Event from '../events';\n import ExpGolomb from './exp-golomb';\n import SampleAesDecrypter from './sample-aes';\n// import Hex from '../utils/hex';\n import {logger} from '../utils/logger';\n import {ErrorTypes, ErrorDetails} from '../errors';\n\n class TSDemuxer {\n\n constructor(observer, remuxer, config, typeSupported) {\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n this.remuxer = remuxer;\n this.sampleAes = null;\n }\n\n setDecryptData(decryptdata) {\n if ((decryptdata != null) && (decryptdata.key != null) && (decryptdata.method === 'SAMPLE-AES')) {\n this.sampleAes = new SampleAesDecrypter(this.observer, this.config, decryptdata, this.discardEPB);\n } else {\n this.sampleAes = null;\n }\n }\n\n static 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 resetInitSegment(initSegment,audioCodec,videoCodec, duration) {\n this.pmtParsed = false;\n this._pmtId = -1;\n this._avcTrack = {container : 'video/mp2t', type: 'video', id :-1, inputTimeScale : 90000, sequenceNumber: 0, samples : [], len : 0, dropped : 0};\n this._audioTrack = {container : 'video/mp2t', type: 'audio', id :-1, inputTimeScale : 90000, duration: duration, sequenceNumber: 0, samples : [], len : 0, isAAC: true};\n this._id3Track = {type: 'id3', id :-1, inputTimeScale : 90000, sequenceNumber: 0, samples : [], len : 0};\n this._txtTrack = {type: 'text', id: -1, inputTimeScale : 90000, sequenceNumber: 0, samples : [], len : 0};\n // flush any partial content\n this.aacOverFlow = null;\n this.aacLastPTS = null;\n this.avcSample = null;\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this._duration = duration;\n }\n\n resetTimeStamp() {\n }\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset, contiguous,accurateTimeOffset) {\n var start, len = data.length, stt, pid, atf, offset,pes,\n unknownPIDs = false;\n this.contiguous = contiguous;\n var pmtParsed = this.pmtParsed,\n avcTrack = this._avcTrack,\n audioTrack = this._audioTrack,\n id3Track = this._id3Track,\n avcId = avcTrack.id,\n audioId = audioTrack.id,\n id3Id = id3Track.id,\n pmtId = this._pmtId,\n avcData = avcTrack.pesData,\n audioData = audioTrack.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 parseMPEGPES = this._parseMPEGPES.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 }\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 audioId:\n if (stt) {\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n }\n audioData = {data: [], size: 0};\n }\n if (audioData) {\n audioData.data.push(data.subarray(offset, start + 188));\n audioData.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 let parsedPIDs = parsePMT(data, offset, this.typeSupported.mpeg === true || this.typeSupported.mp3 === true, this.sampleAes != null);\n\n // only update track id if track PID found while parsing PMT\n // this is to avoid resetting the PID to -1 in case\n // track PID transiently disappears from the stream\n // this could happen in case of transient missing audio samples for example\n avcId = parsedPIDs.avc;\n if (avcId > 0) {\n avcTrack.id = avcId;\n }\n audioId = parsedPIDs.audio;\n if (audioId > 0) {\n audioTrack.id = audioId;\n audioTrack.isAAC = parsedPIDs.isAAC;\n }\n id3Id = parsedPIDs.id3;\n if (id3Id > 0) {\n id3Track.id = id3Id;\n }\n if (unknownPIDs && !pmtParsed) {\n 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(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details: 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 (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n audioTrack.pesData = null;\n } else {\n if (audioData && audioData.size) {\n logger.log('last AAC PES packet truncated,might overlap between fragments');\n }\n // either audioData null or PES truncated, keep it for next frag parsing\n audioTrack.pesData = audioData;\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\n if (this.sampleAes == null) {\n this.remuxer.remux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);\n } else {\n this.decryptAndRemux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n\n decryptAndRemux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n if (audioTrack.samples && audioTrack.isAAC) {\n let localthis = this;\n this.sampleAes.decryptAacSamples(audioTrack.samples, 0, function() {\n localthis.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n });\n } else {\n this.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n\n decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n if (videoTrack.samples) {\n let localthis = this;\n this.sampleAes.decryptAvcSamples(videoTrack.samples, 0, 0, function () {\n localthis.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n });\n } else {\n this.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n\n destroy() {\n this._initPTS = this._initDTS = undefined;\n this._duration = 0;\n }\n\n _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 _parsePMT(data, offset, mpegSupported, isSampleAes) {\n var sectionLength, tableEnd, programInfoLength, pid, result = { audio : -1, avc : -1, id3 : -1, isAAC : true};\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 case 0xcf: // SAMPLE-AES AAC\n if (!isSampleAes) {\n logger.log('unkown stream type:' + data[offset]);\n break;\n }\n /* falls through */\n\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.audio === -1) {\n result.audio = pid;\n }\n break;\n\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\n case 0xdb: // SAMPLE-AES AVC\n if (!isSampleAes) {\n logger.log('unkown stream type:' + data[offset]);\n break;\n }\n /* falls through */\n\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\n // ISO/IEC 11172-3 (MPEG-1 audio)\n // or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)\n case 0x03:\n case 0x04:\n //logger.log('MPEG PID:' + pid);\n if (!mpegSupported) {\n logger.log('MPEG audio found, not supported in this browser for now');\n } else if (result.audio === -1) {\n result.audio = pid;\n result.isAAC = false;\n }\n break;\n\n case 0x24:\n logger.warn('HEVC stream type found, not supported for now');\n break;\n\n default:\n 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 _parsePES(stream) {\n var i = 0, frag, pesFlags, pesPrefix, pesLen, pesHdrLen, pesData, pesPts, pesDts, payloadStartOffset, 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 let 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 parsed length is not zero and greater than total received length, 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 if (pesPts - pesDts > 60*90000) {\n logger.warn(`${Math.round((pesPts - pesDts)/90000)}s delta between PTS and DTS, align them`);\n pesPts = pesDts;\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 for( let j = 0, dataLen = data.length; j < dataLen ; j++) {\n frag = data[j];\n let 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 pushAccesUnit(avcSample,avcTrack) {\n if (avcSample.units.length && avcSample.frame) {\n const samples = avcTrack.samples;\n const nbSamples = samples.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 ||\n avcSample.key === true ||\n (avcTrack.sps && (nbSamples || this.contiguous))) {\n avcSample.id = nbSamples;\n samples.push(avcSample);\n } else {\n // dropped samples, track it\n avcTrack.dropped++;\n }\n }\n if(avcSample.debug.length) {\n logger.log(avcSample.pts + '/' + avcSample.dts + ':' + avcSample.debug);\n }\n }\n\n _parseAVCPES(pes,last) {\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(unit => {\n switch(unit.type) {\n //NDR\n case 1:\n push = true;\n if(debug && avcSample) {\n avcSample.debug += 'NDR ';\n }\n avcSample.frame = true;\n // retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR\n let data = unit.data;\n if (data.length > 4) {\n let sliceType = new ExpGolomb(data).readSliceType();\n // 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice\n // SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.\n // An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.\n // I slice: A slice that is not an SI slice that is decoded using intra prediction only.\n //if (sliceType === 2 || sliceType === 7) {\n if (sliceType === 2 || sliceType === 4 || sliceType === 7 || sliceType === 9) {\n avcSample.key = true;\n }\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 avcSample.frame = true;\n break;\n //SEI\n case 6:\n push = true;\n if(debug && avcSample) {\n avcSample.debug += 'SEI ';\n }\n expGolombDecoder = new ExpGolomb(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 }\n else if (payloadSize < expGolombDecoder.bytesAvailable)\n {\n for (i = 0; i<payloadSize; i++)\n {\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 ExpGolomb(unit.data);\n var config = expGolombDecoder.readSPS();\n track.width = config.width;\n track.height = config.height;\n track.pixelRatio = config.pixelRatio;\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 let units = avcSample.units;\n 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 _createAVCSample(key,pts,dts,debug) {\n return { key : key, pts : pts, dts : dts, units : [], debug : debug};\n }\n\n _insertSampleInOrder(arr, data) {\n var len = arr.length;\n if (len > 0) {\n if (data.pts >= arr[len-1].pts)\n {\n arr.push(data);\n }\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 }\n else {\n arr.push(data);\n }\n }\n\n _getLastNalUnit() {\n let avcSample = this.avcSample, lastUnit;\n // try to fallback to previous sample if current one is empty\n if (!avcSample || avcSample.units.length === 0) {\n let track = this._avcTrack, samples = track.samples;\n avcSample = samples[samples.length-1];\n }\n if (avcSample) {\n let units = avcSample.units;\n lastUnit = units[units.length - 1];\n }\n return lastUnit;\n }\n\n _parseAVCNALu(array) {\n var i = 0, len = array.byteLength, value, overflow, track = this._avcTrack, state = track.naluState || 0, lastState = state;\n var units = [], unit, unitType, lastUnitStart = -1, lastUnitType;\n //logger.log('PES:' + Hex.hexDump(array));\n\n if (state === -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 = array[0] & 0x1f;\n state = 0;\n i = 1;\n }\n\n while (i < len) {\n value = array[i++];\n // optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case\n if (!state) {\n state = value ? 0 : 1;\n continue;\n }\n if (state === 1) {\n state = value ? 0 : 2;\n continue;\n }\n // here we have state either equal to 2 or 3\n if(!value) {\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 let 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 let 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 }\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 let lastUnit = this._getLastNalUnit();\n if (lastUnit) {\n let 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 discardEPB(data) {\n var length = data.byteLength,\n EPBPositions = [],\n i = 1,\n newLength, newData;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 &&\n data[i + 1] === 0 &&\n 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 _parseAACPES(pes) {\n var track = this._audioTrack,\n data = pes.data,\n pts = pes.pts,\n startOffset = 0,\n aacOverFlow = this.aacOverFlow,\n aacLastPTS = this.aacLastPTS,\n config, frameLength, frameDuration, frameIndex, offset, headerLength, stamp, len, 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.warn(`parsing error:${reason}`);\n this.observer.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason});\n if (fatal) {\n return;\n }\n }\n if (!track.samplerate) {\n const audioCodec = this.audioCodec;\n config = ADTS.getAudioConfig(this.observer,data, offset, audioCodec);\n track.config = config.config;\n track.samplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n logger.log(`parsed codec:${track.codec},rate:${config.samplerate},nb channel:${config.channelCount}`);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.samplerate;\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.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) |\n (data[offset + 4] << 3) |\n ((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 _parseMPEGPES(pes) {\n MpegAudio.parse(this._audioTrack, pes.data, 0, pes.pts);\n }\n\n _parseID3PES(pes) {\n this._id3Track.samples.push(pes);\n }\n}\n\nexport default TSDemuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/tsdemuxer.js","export const 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 a mux Error (demuxing/remuxing)\n MUX_ERROR: 'muxError',\n // Identifier for all other errors\n OTHER_ERROR: 'otherError'\n};\n\nexport const 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: {id : demuxer Id,frag: fragment object, reason : parsing error description }\n FRAG_DECRYPT_ERROR: 'fragDecryptError',\n // Identifier for a fragment parsing error event - data: { id : demuxer Id, reason : parsing error description }\n // will be renamed DEMUX_PARSING_ERROR and switched to MUX_ERROR in the next major release\n FRAG_PARSING_ERROR: 'fragParsingError',\n // 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 }\n REMUX_ALLOC_ERROR : 'remuxAllocError',\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 a buffer nudge on stall (playback is stuck although currentTime is in a buffered area)\n BUFFER_NUDGE_ON_STALL : 'bufferNudgeOnStall',\n // Identifier for an internal exception happening inside hls.js while handling an event\n INTERNAL_EXCEPTION: 'internalException',\n // Malformed WebVTT contents\n WEBVTT_EXCEPTION: 'webVTTException'\n};\n\n\n\n// WEBPACK FOOTER //\n// src/errors.js","/*\n*\n* All objects in the event handling chain should inherit from this class\n*\n*/\n\nimport {logger} from './utils/logger';\nimport {ErrorTypes, ErrorDetails} from './errors';\nimport Event from './events';\n\nclass EventHandler {\n\n constructor(hls, ...events) {\n this.hls = hls;\n this.onEvent = this.onEvent.bind(this);\n this.handledEvents = events;\n this.useGenericHandler = true;\n\n this.registerListeners();\n }\n\n destroy() {\n this.unregisterListeners();\n }\n\n isEventHandler() {\n return typeof this.handledEvents === 'object' && this.handledEvents.length && typeof this.onEvent === 'function';\n }\n\n 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 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 onEvent(event, data) {\n this.onEventGeneric(event, data);\n }\n\n onEventGeneric(event, data) {\n var eventToFunction = function(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.error(`internal error happened while processing ${event}:${err.message}`);\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.OTHER_ERROR, details: ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event : event, err : err});\n }\n }\n}\n\nexport default EventHandler;\n\n\n\n// WEBPACK FOOTER //\n// src/event-handler.js","module.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 reset - data: { }\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, pending : nb of segments waiting for appending for this segment parent}\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 - 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 buffer has been flushed - data: { }\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 switch is requested - data: { level : id of new level } // deprecated in favor LEVEL_SWITCHING\n LEVEL_SWITCH: 'hlsLevelSwitch',\n // fired when a level switch is requested - data: { level : id of new level }\n LEVEL_SWITCHING: 'hlsLevelSwitching',\n // fired when a level switch is effective - data: { level : id of new level }\n LEVEL_SWITCHED: 'hlsLevelSwitched',\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 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 } // deprecated in favor AUDIO_TRACK_SWITCHING\n AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',\n // fired when an audio track switching is requested - data: { id : audio track id }\n AUDIO_TRACK_SWITCHING: 'hlsAudioTrackSwitching',\n // fired when an audio track switch actually occurs - data: { id : audio track id }\n AUDIO_TRACK_SWITCHED: 'hlsAudioTrackSwitched',\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 to notify that subtitle track lists has been updated - data: { subtitleTracks : subtitleTracks }\n SUBTITLE_TRACKS_UPDATED: 'hlsSubtitleTracksUpdated',\n // fired when an subtitle track switch occurs - data: { id : subtitle track id }\n SUBTITLE_TRACK_SWITCH: 'hlsSubtitleTrackSwitch',\n // fired when a subtitle track loading starts - data: { url : subtitle track URL, id : subtitle track id }\n SUBTITLE_TRACK_LOADING: 'hlsSubtitleTrackLoading',\n // fired when a subtitle track loading finishes - data: { details : levelDetails object, id : subtitle track id, stats : { trequest, tfirst, tload, mtime } }\n SUBTITLE_TRACK_LOADED: 'hlsSubtitleTrackLoaded',\n // fired when a subtitle fragment has been processed - data: { success : boolean, frag : the processed frag }\n SUBTITLE_FRAG_PROCESSED: 'hlsSubtitleFragProcessed',\n // fired when the first timestamp is found - data: { id : demuxer id, initPTS: initPTS, frag : fragment object }\n INIT_PTS_FOUND: 'hlsInitPtsFound',\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 a fragment has finished decrypting - data: { id : demuxer id, frag: fragment object, stats : { tstart, tdecrypt } }\n FRAG_DECRYPTED: 'hlsFragDecrypted',\n // 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 }\n FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',\n // fired when parsing sei text is completed - data: { id : demuxer id, frag: fragment object, samples : [ sei samples pes ] }\n FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',\n // fired when parsing id3 is completed - data: { id : demuxer id, frag: fragment object, samples : [ id3 samples pes ] }\n FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',\n // 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}\n FRAG_PARSING_DATA: 'hlsFragParsingData',\n // fired when fragment parsing is completed - data: { id : demuxer id, frag: fragment object }\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, bwEstimate } }\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 - data: { }\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\n\n// WEBPACK FOOTER //\n// src/events.js","/**\n * AAC helper\n */\n\nclass AAC {\n static getSilentFrame(codec,channelCount) {\n switch(codec) {\n case 'mp4a.40.2':\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 break;\n // handle HE-AAC below (mp4a.40.5 / mp4a.40.29)\n default:\n if (channelCount === 1) {\n // 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\n 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]);\n } else if (channelCount === 2) {\n // 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\n 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]);\n } else if (channelCount === 3) {\n // 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\n 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]);\n }\n break;\n }\n return null;\n }\n}\n\nexport default AAC;\n\n\n\n// WEBPACK FOOTER //\n// src/helper/aac.js","/**\n * Buffer Helper utils, providing methods dealing buffer length retrieval\n*/\n\nconst BufferHelper = {\n isBuffered : function(media,position) {\n if (media) {\n let buffered = media.buffered;\n for (let 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 bufferInfo : function(media, pos,maxHoleDuration) {\n if (media) {\n var vbuffered = media.buffered, buffered = [],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: pos, end: pos, nextStart : undefined} ;\n }\n },\n\n bufferedInfo : function(buffered,pos,maxHoleDuration) {\n var buffered2 = [],\n // bufferStart and bufferEnd are buffer boundaries around current video position\n bufferLen,bufferStart, bufferEnd,bufferStartNext,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\nmodule.exports = BufferHelper;\n\n\n\n// WEBPACK FOOTER //\n// src/helper/buffer-helper.js","/**\n * Level Helper class, providing methods dealing with playlist sliding and drift\n*/\n\nimport {logger} from '../utils/logger';\n\nconst LevelHelper = {\n\n mergeDetails : function(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 newFrag.backtracked = oldFrag.backtracked;\n newFrag.dropped = oldFrag.dropped;\n PTSFrag = newFrag;\n }\n }\n }\n\n if(ccOffset) {\n 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,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 updateFragPTSDTS : function(details,frag,startPTS,endPTS,startDTS,endDTS) {\n // update frag PTS/DTS\n if(!isNaN(frag.startPTS)) {\n // delta PTS between audio and video\n let 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 const drift = startPTS - frag.start;\n frag.start = frag.startPTS = startPTS;\n frag.endPTS = endPTS;\n frag.startDTS = startDTS;\n frag.endDTS = endDTS;\n frag.duration = endPTS - startPTS;\n\n const sn = frag.sn;\n // exit if sn out of range\n if (!details || sn < details.startSN || sn > details.endSN) {\n return 0;\n }\n var fragIdx, fragments, i;\n fragIdx = sn - details.startSN;\n fragments = details.fragments;\n frag = fragments[fragIdx];\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 updatePTS : function(fragments,fromIdx, toIdx) {\n var fragFrom = fragments[fromIdx],fragTo = fragments[toIdx], 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.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.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 = Math.max(fragFrom.start - fragTo.duration, 0);\n }\n }\n }\n};\n\nmodule.exports = LevelHelper;\n\n\n\n// WEBPACK FOOTER //\n// src/helper/level-helper.js","/**\n * HLS interface\n */\n'use strict';\n\nimport URLToolkit from 'url-toolkit';\nimport Event from './events';\nimport {ErrorTypes, ErrorDetails} from './errors';\nimport PlaylistLoader from './loader/playlist-loader';\nimport FragmentLoader from './loader/fragment-loader';\nimport KeyLoader from './loader/key-loader';\n\nimport StreamController from './controller/stream-controller';\nimport LevelController from './controller/level-controller';\nimport ID3TrackController from './controller/id3-track-controller';\n\nimport {logger, enableLogs} from './utils/logger';\nimport EventEmitter from 'events';\nimport {hlsDefaultConfig} from './config';\n\nclass Hls {\n\n static get version() {\n // replaced with browserify-versionify transform\n return '0.7.9';\n }\n\n static isSupported() {\n const mediaSource = window.MediaSource = window.MediaSource || window.WebKitMediaSource;\n const sourceBuffer = window.SourceBuffer = window.SourceBuffer || window.WebKitSourceBuffer;\n const isTypeSupported = mediaSource &&\n typeof mediaSource.isTypeSupported === 'function' &&\n mediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"');\n\n // if SourceBuffer is exposed ensure its API is valid\n // safari and old version of Chrome doe not expose SourceBuffer globally so checking SourceBuffer.prototype is impossible\n const sourceBufferValidAPI = !sourceBuffer ||\n (sourceBuffer.prototype &&\n typeof sourceBuffer.prototype.appendBuffer === 'function' &&\n typeof sourceBuffer.prototype.remove === 'function');\n return isTypeSupported && sourceBufferValidAPI;\n }\n\n static get Events() {\n return Event;\n }\n\n static get ErrorTypes() {\n return ErrorTypes;\n }\n\n static get ErrorDetails() {\n return ErrorDetails;\n }\n\n static get DefaultConfig() {\n if(!Hls.defaultConfig) {\n return hlsDefaultConfig;\n }\n return Hls.defaultConfig;\n }\n\n static set DefaultConfig(defaultConfig) {\n Hls.defaultConfig = defaultConfig;\n }\n\n constructor(config = {}) {\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) { continue; }\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 enableLogs(config.debug);\n this.config = config;\n this._autoLevelCapping = -1;\n // observer setup\n var observer = this.observer = new EventEmitter();\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...data);\n };\n this.on = observer.on.bind(observer);\n this.off = observer.off.bind(observer);\n this.trigger = observer.trigger.bind(observer);\n\n // core controllers and network loaders\n const abrController = this.abrController = new config.abrController(this);\n const bufferController = new config.bufferController(this);\n const capLevelController = new config.capLevelController(this);\n const fpsController = new config.fpsController(this);\n const playListLoader = new PlaylistLoader(this);\n const fragmentLoader = new FragmentLoader(this);\n const keyLoader = new KeyLoader(this);\n const id3TrackController = new ID3TrackController(this);\n\n // network controllers\n const levelController = this.levelController = new LevelController(this);\n const streamController = this.streamController = new StreamController(this);\n let networkControllers = [levelController, streamController];\n\n // optional audio stream controller\n let Controller = config.audioStreamController;\n if (Controller) {\n networkControllers.push(new Controller(this));\n }\n this.networkControllers = networkControllers;\n\n let coreComponents = [ playListLoader, fragmentLoader, keyLoader, abrController, bufferController, capLevelController, fpsController, id3TrackController ];\n\n // optional audio track and subtitle controller\n Controller = config.audioTrackController;\n if (Controller) {\n let audioTrackController = new Controller(this);\n this.audioTrackController = audioTrackController;\n coreComponents.push(audioTrackController);\n }\n\n Controller = config.subtitleTrackController;\n if (Controller) {\n let subtitleTrackController = new Controller(this);\n this.subtitleTrackController = subtitleTrackController;\n coreComponents.push(subtitleTrackController);\n }\n\n // optional subtitle controller\n [config.subtitleStreamController, config.timelineController].forEach(Controller => {\n if (Controller) {\n coreComponents.push(new Controller(this));\n }\n });\n this.coreComponents = coreComponents;\n }\n\n destroy() {\n logger.log('destroy');\n this.trigger(Event.DESTROYING);\n this.detachMedia();\n this.coreComponents.concat(this.networkControllers).forEach(component => {component.destroy();});\n this.url = null;\n this.observer.removeAllListeners();\n this._autoLevelCapping = -1;\n }\n\n attachMedia(media) {\n logger.log('attachMedia');\n this.media = media;\n this.trigger(Event.MEDIA_ATTACHING, {media: media});\n }\n\n detachMedia() {\n logger.log('detachMedia');\n this.trigger(Event.MEDIA_DETACHING);\n this.media = null;\n }\n\n loadSource(url) {\n url = URLToolkit.buildAbsoluteURL(window.location.href, url, { alwaysNormalize: true });\n logger.log(`loadSource:${url}`);\n this.url = url;\n // when attaching to a source URL, trigger a playlist load\n this.trigger(Event.MANIFEST_LOADING, {url: url});\n }\n\n startLoad(startPosition=-1) {\n logger.log(`startLoad(${startPosition})`);\n this.networkControllers.forEach(controller => {controller.startLoad(startPosition);});\n }\n\n stopLoad() {\n logger.log('stopLoad');\n this.networkControllers.forEach(controller => {controller.stopLoad();});\n }\n\n swapAudioCodec() {\n logger.log('swapAudioCodec');\n this.streamController.swapAudioCodec();\n }\n\n recoverMediaError() {\n logger.log('recoverMediaError');\n var media = this.media;\n this.detachMedia();\n this.attachMedia(media);\n }\n\n /** Return all quality levels **/\n get levels() {\n return this.levelController.levels;\n }\n\n /** Return current playback quality level **/\n get currentLevel() {\n return this.streamController.currentLevel;\n }\n\n /* set quality level immediately (-1 for automatic level selection) */\n set currentLevel(newLevel) {\n 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 get nextLevel() {\n return this.streamController.nextLevel;\n }\n\n /* set quality level for next fragment (-1 for automatic level selection) */\n set nextLevel(newLevel) {\n 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 get loadLevel() {\n return this.levelController.level;\n }\n\n /* set quality level for current/next loaded fragment (-1 for automatic level selection) */\n set loadLevel(newLevel) {\n logger.log(`set loadLevel:${newLevel}`);\n this.levelController.manualLevel = newLevel;\n }\n\n /** Return the quality level of next loaded fragment **/\n get nextLoadLevel() {\n return this.levelController.nextLoadLevel;\n }\n\n /** set quality level of next loaded fragment **/\n set nextLoadLevel(level) {\n this.levelController.nextLoadLevel = level;\n }\n\n /** Return first level (index of first level referenced in manifest)\n **/\n get firstLevel() {\n return Math.max(this.levelController.firstLevel, this.minAutoLevel);\n }\n\n /** set first level (index of first level referenced in manifest)\n **/\n set firstLevel(newLevel) {\n 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 get startLevel() {\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 set startLevel(newLevel) {\n logger.log(`set startLevel:${newLevel}`);\n const hls = this;\n // if not in automatic start level detection, ensure startLevel is greater than minAutoLevel\n if (newLevel !== -1) {\n newLevel = Math.max(newLevel,hls.minAutoLevel);\n }\n hls.levelController.startLevel = newLevel;\n }\n\n /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n get autoLevelCapping() {\n return this._autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n set autoLevelCapping(newLevel) {\n logger.log(`set autoLevelCapping:${newLevel}`);\n this._autoLevelCapping = newLevel;\n }\n\n /* check if we are in automatic level selection mode */\n get autoLevelEnabled() {\n return (this.levelController.manualLevel === -1);\n }\n\n /* return manual level */\n get manualLevel() {\n return this.levelController.manualLevel;\n }\n\n /* return min level selectable in auto mode according to config.minAutoBitrate */\n get minAutoLevel() {\n let hls = this, levels = hls.levels, minAutoBitrate = hls.config.minAutoBitrate, len = levels ? levels.length : 0;\n for (let i = 0; i < len; i++) {\n const levelNextBitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate,levels[i].bitrate) : levels[i].bitrate;\n if (levelNextBitrate > minAutoBitrate) {\n return i;\n }\n }\n return 0;\n }\n\n /* return max level selectable in auto mode according to autoLevelCapping */\n get maxAutoLevel() {\n const hls = this;\n const levels = hls.levels;\n const autoLevelCapping = hls.autoLevelCapping;\n let 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 // return next auto level\n get nextAutoLevel() {\n const hls = this;\n // ensure next auto level is between min and max auto level\n return Math.min(Math.max(hls.abrController.nextAutoLevel,hls.minAutoLevel),hls.maxAutoLevel);\n }\n\n // this setter is used to force next auto level\n // 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)\n // forced value is valid for one fragment. upon succesful frag loading at forced level, this value will be resetted to -1 by ABR controller\n set nextAutoLevel(nextLevel) {\n const hls = this;\n hls.abrController.nextAutoLevel = Math.max(hls.minAutoLevel,nextLevel);\n }\n\n /** get alternate audio tracks list from playlist **/\n get audioTracks() {\n const audioTrackController = this.audioTrackController;\n return audioTrackController ? audioTrackController.audioTracks : [];\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n get audioTrack() {\n const audioTrackController = this.audioTrackController;\n return audioTrackController ? audioTrackController.audioTrack : -1;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n set audioTrack(audioTrackId) {\n const audioTrackController = this.audioTrackController;\n if (audioTrackController) {\n audioTrackController.audioTrack = audioTrackId;\n }\n }\n\n get liveSyncPosition() {\n return this.streamController.liveSyncPosition;\n }\n\n /** get alternate subtitle tracks list from playlist **/\n get subtitleTracks() {\n const subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTracks : [];\n }\n\n /** get index of the selected subtitle track (index in subtitle track lists) **/\n get subtitleTrack() {\n const subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTrack : -1;\n }\n\n /** select an subtitle track, based on its index in subtitle track lists**/\n set subtitleTrack(subtitleTrackId) {\n const subtitleTrackController = this.subtitleTrackController;\n if (subtitleTrackController) {\n subtitleTrackController.subtitleTrack = subtitleTrackId;\n }\n }\n}\n\nexport default Hls;\n\n\n\n// WEBPACK FOOTER //\n// src/hls.js","// 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 = require('./hls.js').default;\n\n\n\n// WEBPACK FOOTER //\n// src/index.js","/*\n * Fragment Loader\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nclass FragmentLoader extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.FRAG_LOADING);\n this.loaders = {};\n }\n\n destroy() {\n let loaders = this.loaders;\n for (let loaderName in loaders) {\n let loader = loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n EventHandler.prototype.destroy.call(this);\n }\n\n onFragLoading(data) {\n let 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.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 let loaderContext, loaderConfig, loaderCallbacks;\n loaderContext = { url : frag.url, frag : frag, responseType : 'arraybuffer', progressData : false};\n let start = frag.byteRangeStartOffset, 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 loadsuccess(response, stats, context) {\n let payload = response.data, frag = context.frag;\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[frag.type] = undefined;\n this.hls.trigger(Event.FRAG_LOADED, {payload: payload, frag: frag, stats: stats});\n }\n\n loaderror(response, context) {\n let loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.FRAG_LOAD_ERROR, fatal: false, frag: context.frag, response: response});\n }\n\n loadtimeout(stats, context) {\n let loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.FRAG_LOAD_TIMEOUT, fatal: false, frag: context.frag});\n }\n\n // data will be used for progressive parsing\n loadprogress(stats, context, data) { // jshint ignore:line\n let frag = context.frag;\n frag.loaded = stats.loaded;\n this.hls.trigger(Event.FRAG_LOAD_PROGRESS, {frag: frag, stats: stats});\n }\n}\n\nexport default FragmentLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/loader/fragment-loader.js","/*\n * Decrypt key Loader\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nclass KeyLoader extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.KEY_LOADING);\n this.loaders = {};\n this.decryptkey = null;\n this.decrypturl = null;\n }\n\n destroy() {\n for (let loaderName in this.loaders) {\n let loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n EventHandler.prototype.destroy.call(this);\n }\n\n onKeyLoading(data) {\n let 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 let config = this.hls.config;\n\n if (loader) {\n logger.warn(`abort previous key 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 let loaderContext, loaderConfig, loaderCallbacks;\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(Event.KEY_LOADED, {frag: frag});\n }\n }\n\n loadsuccess(response, stats, context) {\n let 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[frag.type] = undefined;\n this.hls.trigger(Event.KEY_LOADED, {frag: frag});\n }\n\n loaderror(response, context) {\n let frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.KEY_LOAD_ERROR, fatal: false, frag: frag, response: response});\n }\n\n loadtimeout(stats, context) {\n let frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.KEY_LOAD_TIMEOUT, fatal: false, frag: frag});\n }\n}\n\nexport default KeyLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/loader/key-loader.js","/**\n * Playlist Loader\n*/\n\nimport URLToolkit from 'url-toolkit';\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport AttrList from '../utils/attr-list';\nimport {logger} from '../utils/logger';\n\n// https://regex101.com is your friend\nconst MASTER_PLAYLIST_REGEX = /#EXT-X-STREAM-INF:([^\\n\\r]*)[\\r\\n]+([^\\r\\n]+)/g;\nconst MASTER_PLAYLIST_MEDIA_REGEX = /#EXT-X-MEDIA:(.*)/g;\nconst LEVEL_PLAYLIST_REGEX_FAST = /#EXTINF:(\\d*(?:\\.\\d+)?)(?:,(.*))?|(?!#)(\\S.+)|#EXT-X-BYTERANGE: *(.+)|#EXT-X-PROGRAM-DATE-TIME:(.+)|#.*/g;\nconst 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?/;\n\nclass LevelKey {\n\n constructor() {\n this.method = null;\n this.key = null;\n this.iv = null;\n this._uri = null;\n }\n\n get uri() {\n if (!this._uri && this.reluri) {\n this._uri = URLToolkit.buildAbsoluteURL(this.baseuri, this.reluri, { alwaysNormalize: true });\n }\n return this._uri;\n }\n\n}\n\nclass Fragment {\n\n constructor() {\n this._url = null;\n this._byteRange = null;\n this._decryptdata = null;\n this.tagList = [];\n }\n\n get url() {\n if (!this._url && this.relurl) {\n this._url = URLToolkit.buildAbsoluteURL(this.baseurl, this.relurl, { alwaysNormalize: true });\n }\n return this._url;\n }\n\n set url(value) {\n this._url = value;\n }\n\n get programDateTime() {\n if (!this._programDateTime && this.rawProgramDateTime) {\n this._programDateTime = new Date(Date.parse(this.rawProgramDateTime));\n }\n return this._programDateTime;\n }\n\n get byteRange() {\n if (!this._byteRange) {\n let byteRange = this._byteRange = [];\n if (this.rawByteRange) {\n const params = this.rawByteRange.split('@', 2);\n if (params.length === 1) {\n const lastByteRangeEndOffset = this.lastByteRangeEndOffset;\n byteRange[0] = lastByteRangeEndOffset ? lastByteRangeEndOffset : 0;\n } else {\n byteRange[0] = parseInt(params[1]);\n }\n byteRange[1] = parseInt(params[0]) + byteRange[0];\n }\n }\n return this._byteRange;\n }\n\n get byteRangeStartOffset() {\n return this.byteRange[0];\n }\n\n get byteRangeEndOffset() {\n return this.byteRange[1];\n }\n\n get decryptdata() {\n if (!this._decryptdata) {\n this._decryptdata = this.fragmentDecryptdataFromLevelkey(this.levelkey, this.sn);\n }\n return this._decryptdata;\n }\n\n /**\n * Utility method for parseLevelPlaylist to create an initialization vector for a given segment\n * @returns {Uint8Array}\n */\n 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 fragmentDecryptdataFromLevelkey(levelkey, segmentNumber) {\n var decryptdata = levelkey;\n\n if (levelkey && levelkey.method && levelkey.uri && !levelkey.iv) {\n decryptdata = new LevelKey();\n decryptdata.method = levelkey.method;\n decryptdata.baseuri = levelkey.baseuri;\n decryptdata.reluri = levelkey.reluri;\n decryptdata.iv = this.createInitializationVector(segmentNumber);\n }\n\n return decryptdata;\n }\n\n cloneObj(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n}\n\nclass PlaylistLoader extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MANIFEST_LOADING,\n Event.LEVEL_LOADING,\n Event.AUDIO_TRACK_LOADING,\n Event.SUBTITLE_TRACK_LOADING);\n this.loaders = {};\n }\n\n destroy() {\n for (let loaderName in this.loaders) {\n let loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n EventHandler.prototype.destroy.call(this);\n }\n\n onManifestLoading(data) {\n this.load(data.url, { type : 'manifest'});\n }\n\n onLevelLoading(data) {\n this.load(data.url, { type : 'level', level : data.level, id : data.id});\n }\n\n onAudioTrackLoading(data) {\n this.load(data.url, { type : 'audioTrack', id : data.id});\n }\n\n onSubtitleTrackLoading(data) {\n this.load(data.url, { type : 'subtitleTrack', id : data.id});\n }\n\n load(url, context) {\n let loader = this.loaders[context.type];\n if (loader) {\n let loaderContext = loader.context;\n if (loaderContext && loaderContext.url === url) {\n logger.trace(`playlist request ongoing`);\n return;\n } else {\n logger.warn(`abort previous loader for type:${context.type}`);\n loader.abort();\n }\n }\n let config = this.hls.config,\n retry,\n timeout,\n retryDelay,\n maxRetryDelay;\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.log(`loading playlist for ${context.type} ${context.level || context.id}`);\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 let loaderConfig, loaderCallbacks;\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 resolve(url, baseUrl) {\n return URLToolkit.buildAbsoluteURL(baseUrl, url, { alwaysNormalize: true });\n }\n\n parseMasterPlaylist(string, baseurl) {\n let levels = [], result;\n MASTER_PLAYLIST_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_REGEX.exec(string)) != null){\n const level = {};\n\n var attrs = level.attrs = new AttrList(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 (let i = 0; i < codecs.length; i++) {\n const 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 parseMasterPlaylistMedia(string, baseurl, type) {\n let result, medias = [], id = 0;\n MASTER_PLAYLIST_MEDIA_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_MEDIA_REGEX.exec(string)) != null){\n const media = {};\n var attrs = new AttrList(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 media.id = id++;\n medias.push(media);\n }\n }\n return medias;\n }\n\n avc1toavcoti(codec) {\n var result, 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 parseLevelPlaylist(string, baseurl, id, type) {\n var currentSN = 0,\n totalduration = 0,\n level = {type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0},\n levelkey = new LevelKey(),\n cc = 0,\n prevFrag = null,\n frag = new Fragment(),\n result,\n i;\n\n LEVEL_PLAYLIST_REGEX_FAST.lastIndex = 0;\n\n while ((result = LEVEL_PLAYLIST_REGEX_FAST.exec(string)) !== null) {\n const duration = result[1];\n if (duration) { // INF\n frag.duration = parseFloat(duration);\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n const title = (' ' + result[2]).slice(1);\n frag.title = title ? title : null;\n frag.tagList.push(title ? [ 'INF',duration,title ] : [ 'INF',duration ]);\n } else if (result[3]) { // url\n if (!isNaN(frag.duration)) {\n const sn = currentSN++;\n frag.type = type;\n frag.start = totalduration;\n frag.levelkey = levelkey;\n frag.sn = sn;\n frag.level = id;\n frag.cc = cc;\n frag.baseurl = baseurl;\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.relurl = (' ' + result[3]).slice(1);\n\n level.fragments.push(frag);\n prevFrag = frag;\n totalduration += frag.duration;\n\n frag = new Fragment();\n }\n } else if (result[4]) { // X-BYTERANGE\n frag.rawByteRange = (' ' + result[4]).slice(1);\n if (prevFrag) {\n const lastByteRangeEndOffset = prevFrag.byteRangeEndOffset;\n if (lastByteRangeEndOffset) {\n frag.lastByteRangeEndOffset = lastByteRangeEndOffset;\n }\n }\n } else if (result[5]) { // PROGRAM-DATE-TIME\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.rawProgramDateTime = (' ' + result[5]).slice(1);\n frag.tagList.push(['PROGRAM-DATE-TIME', frag.rawProgramDateTime]);\n } else {\n result = result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);\n for (i = 1; i < result.length; i++) {\n if (result[i] !== undefined) {\n break;\n }\n }\n\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n const value1 = (' ' + result[i+1]).slice(1);\n const value2 = (' ' + result[i+2]).slice(1);\n\n switch (result[i]) {\n case '#':\n frag.tagList.push(value2 ? [ value1,value2 ] : [ value1 ]);\n break;\n case 'PLAYLIST-TYPE':\n level.type = value1.toUpperCase();\n break;\n case 'MEDIA-SEQUENCE':\n currentSN = level.startSN = parseInt(value1);\n break;\n case 'TARGETDURATION':\n level.targetduration = parseFloat(value1);\n break;\n case 'VERSION':\n level.version = parseInt(value1);\n break;\n case 'EXTM3U':\n break;\n case 'ENDLIST':\n level.live = false;\n break;\n case 'DIS':\n cc++;\n frag.tagList.push(['DIS']);\n break;\n case 'DISCONTINUITY-SEQ':\n cc = parseInt(value1);\n break;\n case 'KEY':\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4\n var decryptparams = value1;\n var keyAttrs = new AttrList(decryptparams);\n var decryptmethod = keyAttrs.enumeratedString('METHOD'),\n decrypturi = keyAttrs.URI,\n decryptiv = keyAttrs.hexadecimalInteger('IV');\n if (decryptmethod) {\n levelkey = new LevelKey();\n if ((decrypturi) && (['AES-128', 'SAMPLE-AES'].indexOf(decryptmethod) >= 0)) {\n levelkey.method = decryptmethod;\n // URI to get the key\n levelkey.baseuri = baseurl;\n levelkey.reluri = decrypturi;\n levelkey.key = null;\n // Initialization Vector (IV)\n levelkey.iv = decryptiv;\n }\n }\n break;\n case 'START':\n let startParams = value1;\n let startAttrs = new AttrList(startParams);\n let startTimeOffset = startAttrs.decimalFloatingPoint('TIME-OFFSET');\n //TIME-OFFSET can be 0\n if ( !isNaN(startTimeOffset) ) {\n level.startTimeOffset = startTimeOffset;\n }\n break;\n case 'MAP':\n let mapAttrs = new AttrList(value1);\n frag.relurl = mapAttrs.URI;\n frag.rawByteRange = mapAttrs.BYTERANGE;\n frag.baseurl = baseurl;\n frag.level = id;\n frag.type = type;\n frag.sn = 'initSegment';\n level.initSegment = frag;\n frag = new Fragment();\n break;\n default:\n logger.warn(`line parsed but not handled: ${result}`);\n break;\n }\n }\n }\n frag = prevFrag;\n //logger.log('found ' + level.fragments.length + ' fragments');\n if(frag && !frag.relurl) {\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 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 let isLevel = (type !== 'audioTrack' && type !== 'subtitleTrack'),\n levelId = !isNaN(level) ? level : !isNaN(id) ? id : 0,\n levelDetails = this.parseLevelPlaylist(string, url, levelId, (type === 'audioTrack' ? 'audio' : (type === 'subtitleTrack' ? 'subtitle' : 'main') ));\n levelDetails.tload = stats.tload;\n if (type === 'manifest') {\n // first request, stream manifest (no master playlist), fire manifest loaded event with level details\n hls.trigger(Event.MANIFEST_LOADED, {levels: [{url: url, details : levelDetails}], audioTracks : [], url: url, stats: stats});\n }\n stats.tparsed = performance.now();\n if (levelDetails.targetduration) {\n if (isLevel) {\n hls.trigger(Event.LEVEL_LOADED, {details: levelDetails, level: level || 0, id: id || 0, stats: stats});\n } else {\n if (type === 'audioTrack') {\n hls.trigger(Event.AUDIO_TRACK_LOADED, {details: levelDetails, id: id, stats: stats});\n }\n else if (type === 'subtitleTrack') {\n hls.trigger(Event.SUBTITLE_TRACK_LOADED, {details: levelDetails, id: id, stats: stats});\n }\n }\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'invalid targetduration'});\n }\n } else {\n let levels = this.parseMasterPlaylist(string, url);\n // multi level playlist, parse level info\n if (levels.length) {\n let audioTracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO');\n let subtitles = this.parseMasterPlaylistMedia(string, url, 'SUBTITLES');\n if (audioTracks.length) {\n // check if we have found an audio track embedded in main playlist (audio track without URI attribute)\n let embeddedAudioFound = false;\n audioTracks.forEach(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.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(Event.MANIFEST_LOADED, {levels, audioTracks, subtitles, url, stats});\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no level found in manifest'});\n }\n }\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter'});\n }\n }\n\n loaderror(response, context) {\n var details, fatal,loader = context.loader;\n switch(context.type) {\n case 'manifest':\n details = ErrorDetails.MANIFEST_LOAD_ERROR;\n fatal = true;\n break;\n case 'level':\n details = ErrorDetails.LEVEL_LOAD_ERROR;\n fatal = false;\n break;\n case 'audioTrack':\n details = 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(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, response: response, context : context});\n }\n\n loadtimeout(stats, context) {\n var details, fatal, loader = context.loader;\n switch(context.type) {\n case 'manifest':\n details = ErrorDetails.MANIFEST_LOAD_TIMEOUT;\n fatal = true;\n break;\n case 'level':\n details = ErrorDetails.LEVEL_LOAD_TIMEOUT;\n fatal = false;\n break;\n case 'audioTrack':\n details = 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(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, context : context});\n }\n}\n\nexport default PlaylistLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/loader/playlist-loader.js","/**\n * Generate MP4 Box\n*/\n\n//import Hex from '../utils/hex';\n\nconst UINT32_MAX = Math.pow(2, 32) - 1;\n\nclass MP4 {\n static 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 '.mp3': [],\n mvex: [],\n mvhd: [],\n pasp: [],\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] = [\n i.charCodeAt(0),\n i.charCodeAt(1),\n i.charCodeAt(2),\n i.charCodeAt(3)\n ];\n }\n }\n\n var videoHdlr = new Uint8Array([\n 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,\n 0x6f, 0x48, 0x61, 0x6e,\n 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n\n var audioHdlr = new Uint8Array([\n 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,\n 0x64, 0x48, 0x61, 0x6e,\n 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([\n 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([\n 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([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00, // sample_count\n ]);\n MP4.VMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00,\n 0x00, 0x00,\n 0x00, 0x00 // opcolor\n ]);\n MP4.SMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance\n 0x00, 0x00 // reserved\n ]);\n\n MP4.STSD = new Uint8Array([\n 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 static box(type) {\n var\n 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 static hdlr(type) {\n return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);\n }\n\n static mdat(data) {\n return MP4.box(MP4.types.mdat, data);\n }\n\n static mdhd(timescale, duration) {\n duration *= timescale;\n const upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n const lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.mdhd, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n (timescale >> 24) & 0xFF,\n (timescale >> 16) & 0xFF,\n (timescale >> 8) & 0xFF,\n timescale & 0xFF, // timescale\n (upperWordDuration >> 24),\n (upperWordDuration >> 16) & 0xFF,\n (upperWordDuration >> 8) & 0xFF,\n upperWordDuration & 0xFF,\n (lowerWordDuration >> 24),\n (lowerWordDuration >> 16) & 0xFF,\n (lowerWordDuration >> 8) & 0xFF,\n lowerWordDuration & 0xFF,\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00\n ]));\n }\n\n static 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 static mfhd(sequenceNumber) {\n return MP4.box(MP4.types.mfhd, new Uint8Array([\n 0x00,\n 0x00, 0x00, 0x00, // flags\n (sequenceNumber >> 24),\n (sequenceNumber >> 16) & 0xFF,\n (sequenceNumber >> 8) & 0xFF,\n sequenceNumber & 0xFF, // sequence_number\n ]));\n }\n\n static 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 static 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 static moov(tracks) {\n var\n 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 static mvex(tracks) {\n var\n 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 static mvhd(timescale,duration) {\n duration*=timescale;\n const upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n const lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n var\n bytes = new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n (timescale >> 24) & 0xFF,\n (timescale >> 16) & 0xFF,\n (timescale >> 8) & 0xFF,\n timescale & 0xFF, // timescale\n (upperWordDuration >> 24),\n (upperWordDuration >> 16) & 0xFF,\n (upperWordDuration >> 8) & 0xFF,\n upperWordDuration & 0xFF,\n (lowerWordDuration >> 24),\n (lowerWordDuration >> 16) & 0xFF,\n (lowerWordDuration >> 8) & 0xFF,\n lowerWordDuration & 0xFF,\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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 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 static sdtp(track) {\n var\n 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) |\n (flags.isDependedOn << 2) |\n (flags.hasRedundancy);\n }\n\n return MP4.box(MP4.types.sdtp, bytes);\n }\n\n static 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 static avc1(track) {\n var sps = [], pps = [], i, data, 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([\n 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([\n track.pps.length // numOfPictureParameterSets\n ]).concat(pps))), // \"PPS\"\n width = track.width,\n height = track.height,\n hSpacing = track.pixelRatio[0],\n vSpacing = track.pixelRatio[1];\n //console.log('avcc:' + Hex.hexDump(avcc));\n return MP4.box(MP4.types.avc1, new Uint8Array([\n 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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n (width >> 8) & 0xFF,\n width & 0xff, // width\n (height >> 8) & 0xFF,\n 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,\n 0x64, 0x61, 0x69, 0x6C, //dailymotion/hls.js\n 0x79, 0x6D, 0x6F, 0x74,\n 0x69, 0x6F, 0x6E, 0x2F,\n 0x68, 0x6C, 0x73, 0x2E,\n 0x6A, 0x73, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11]), // pre_defined = -1\n avcc,\n MP4.box(MP4.types.btrt, new Uint8Array([\n 0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0])), // avgBitrate\n MP4.box(MP4.types.pasp, new Uint8Array([\n (hSpacing >> 24), // hSpacing\n (hSpacing >> 16) & 0xFF,\n (hSpacing >> 8) & 0xFF,\n hSpacing & 0xFF,\n (vSpacing >> 24), // vSpacing\n (vSpacing >> 16) & 0xFF,\n (vSpacing >> 8) & 0xFF,\n vSpacing & 0xFF]))\n );\n }\n\n static esds(track) {\n var configlen = track.config.length;\n return new Uint8Array([\n 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 static mp4a(track) {\n var samplerate = track.samplerate;\n return MP4.box(MP4.types.mp4a, new Uint8Array([\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n (samplerate >> 8) & 0xFF,\n samplerate & 0xff, //\n 0x00, 0x00]),\n MP4.box(MP4.types.esds, MP4.esds(track)));\n }\n\n static mp3(track) {\n var samplerate = track.samplerate;\n return MP4.box(MP4.types['.mp3'], new Uint8Array([\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n (samplerate >> 8) & 0xFF,\n samplerate & 0xff, //\n 0x00, 0x00]));\n }\n\n static stsd(track) {\n if (track.type === 'audio') {\n if (!track.isAAC && track.codec === 'mp3') {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));\n }\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 static tkhd(track) {\n var id = track.id,\n duration = track.duration*track.timescale,\n width = track.width,\n height = track.height,\n upperWordDuration = Math.floor(duration / (UINT32_MAX + 1)),\n lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.tkhd, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n (id >> 24) & 0xFF,\n (id >> 16) & 0xFF,\n (id >> 8) & 0xFF,\n id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n (upperWordDuration >> 24),\n (upperWordDuration >> 16) & 0xFF,\n (upperWordDuration >> 8) & 0xFF,\n upperWordDuration & 0xFF,\n (lowerWordDuration >> 24),\n (lowerWordDuration >> 16) & 0xFF,\n (lowerWordDuration >> 8) & 0xFF,\n lowerWordDuration & 0xFF,\n 0x00, 0x00, 0x00, 0x00,\n 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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n (width >> 8) & 0xFF,\n width & 0xFF,\n 0x00, 0x00, // width\n (height >> 8) & 0xFF,\n height & 0xFF,\n 0x00, 0x00 // height\n ]));\n }\n\n static traf(track,baseMediaDecodeTime) {\n var sampleDependencyTable = MP4.sdtp(track),\n id = track.id,\n upperWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime / (UINT32_MAX + 1)),\n lowerWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime % (UINT32_MAX + 1));\n return MP4.box(MP4.types.traf,\n MP4.box(MP4.types.tfhd, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (id >> 24),\n (id >> 16) & 0XFF,\n (id >> 8) & 0XFF,\n (id & 0xFF) // track_ID\n ])),\n MP4.box(MP4.types.tfdt, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n (upperWordBaseMediaDecodeTime >>24),\n (upperWordBaseMediaDecodeTime >> 16) & 0XFF,\n (upperWordBaseMediaDecodeTime >> 8) & 0XFF,\n (upperWordBaseMediaDecodeTime & 0xFF),\n (lowerWordBaseMediaDecodeTime >>24),\n (lowerWordBaseMediaDecodeTime >> 16) & 0XFF,\n (lowerWordBaseMediaDecodeTime >> 8) & 0XFF,\n (lowerWordBaseMediaDecodeTime & 0xFF)\n ])),\n MP4.trun(track,\n sampleDependencyTable.length +\n 16 + // tfhd\n 20 + // 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 static trak(track) {\n track.duration = track.duration || 0xffffffff;\n return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));\n }\n\n static trex(track) {\n var id = track.id;\n return MP4.box(MP4.types.trex, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (id >> 24),\n (id >> 16) & 0XFF,\n (id >> 8) & 0XFF,\n (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 static trun(track, offset) {\n var samples= track.samples || [],\n len = samples.length,\n arraylen = 12 + (16 * len),\n array = new Uint8Array(arraylen),\n i,sample,duration,size,flags,cts;\n offset += 8 + arraylen;\n array.set([\n 0x00, // version 0\n 0x00, 0x0f, 0x01, // flags\n (len >>> 24) & 0xFF,\n (len >>> 16) & 0xFF,\n (len >>> 8) & 0xFF,\n len & 0xFF, // sample_count\n (offset >>> 24) & 0xFF,\n (offset >>> 16) & 0xFF,\n (offset >>> 8) & 0xFF,\n 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([\n (duration >>> 24) & 0xFF,\n (duration >>> 16) & 0xFF,\n (duration >>> 8) & 0xFF,\n duration & 0xFF, // sample_duration\n (size >>> 24) & 0xFF,\n (size >>> 16) & 0xFF,\n (size >>> 8) & 0xFF,\n size & 0xFF, // sample_size\n (flags.isLeading << 2) | flags.dependsOn,\n (flags.isDependedOn << 6) |\n (flags.hasRedundancy << 4) |\n (flags.paddingValue << 1) |\n flags.isNonSync,\n flags.degradPrio & 0xF0 << 8,\n flags.degradPrio & 0x0F, // sample_flags\n (cts >>> 24) & 0xFF,\n (cts >>> 16) & 0xFF,\n (cts >>> 8) & 0xFF,\n cts & 0xFF // sample_composition_time_offset\n ],12+16*i);\n }\n return MP4.box(MP4.types.trun, array);\n }\n\n static initSegment(tracks) {\n if (!MP4.types) {\n MP4.init();\n }\n var movie = MP4.moov(tracks), 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\nexport default MP4;\n\n\n\n// WEBPACK FOOTER //\n// src/remux/mp4-generator.js"," /**\n * fMP4 remuxer\n*/\n\n\nimport AAC from '../helper/aac';\nimport Event from '../events';\nimport {logger} from '../utils/logger';\nimport MP4 from '../remux/mp4-generator';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n\n// 10 seconds\nconst MAX_SILENT_FRAME_DURATION = 10 * 1000;\n\nclass MP4Remuxer {\n constructor(observer, config, typeSupported, vendor) {\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n const userAgent = navigator.userAgent;\n this.isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');\n this.ISGenerated = false;\n }\n\n destroy() {\n }\n\n resetTimeStamp(defaultTimeStamp) {\n this._initPTS = this._initDTS = defaultTimeStamp;\n }\n\n resetInitSegment() {\n this.ISGenerated = false;\n }\n\n remux(audioTrack,videoTrack,id3Track,textTrack,timeOffset, contiguous,accurateTimeOffset) {\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 nextAudioPts, which is\n // calculated in remuxAudio.\n //logger.log('nb AAC samples:' + audioTrack.samples.length);\n if (audioTrack.samples.length) {\n // if initSegment was generated without video samples, regenerate it again\n if (!audioTrack.timescale) {\n logger.warn('regenerate InitSegment as audio detected');\n this.generateIS(audioTrack,videoTrack,timeOffset);\n }\n let audioData = this.remuxAudio(audioTrack,timeOffset,contiguous,accurateTimeOffset);\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n let audioTrackLength;\n if (audioData) {\n audioTrackLength = audioData.endPTS - audioData.startPTS;\n }\n // if initSegment was generated without video samples, regenerate it again\n if (!videoTrack.timescale) {\n logger.warn('regenerate InitSegment as video detected');\n this.generateIS(audioTrack,videoTrack,timeOffset);\n }\n this.remuxVideo(videoTrack,timeOffset,contiguous,audioTrackLength, accurateTimeOffset);\n }\n } else {\n let videoData;\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n videoData = this.remuxVideo(videoTrack,timeOffset,contiguous, accurateTimeOffset);\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(Event.FRAG_PARSED);\n }\n\n generateIS(audioTrack,videoTrack,timeOffset) {\n var observer = this.observer,\n audioSamples = audioTrack.samples,\n videoSamples = videoTrack.samples,\n typeSupported = this.typeSupported,\n container = 'audio/mp4',\n tracks = {},\n data = { tracks : tracks },\n computePTSDTS = (this._initPTS === undefined),\n initPTS, initDTS;\n\n if (computePTSDTS) {\n initPTS = initDTS = Infinity;\n }\n if (audioTrack.config && audioSamples.length) {\n // let's use audio sampling rate as MP4 time scale.\n // rationale is that there is a integer nb of audio frames per audio sample (1024 for AAC)\n // using audio sampling rate here helps having an integer MP4 frame duration\n // this avoids potential rounding issue and AV sync issue\n audioTrack.timescale = audioTrack.samplerate;\n logger.log (`audio sampling rate : ${audioTrack.samplerate}`);\n if (!audioTrack.isAAC) {\n if (typeSupported.mpeg) { // Chrome and Safari\n container = 'audio/mpeg';\n audioTrack.codec = '';\n } else if (typeSupported.mp3) { // Firefox\n audioTrack.codec = 'mp3';\n }\n }\n tracks.audio = {\n container : container,\n codec : audioTrack.codec,\n initSegment : !audioTrack.isAAC && typeSupported.mpeg ? new Uint8Array() : MP4.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 - audioTrack.inputTimeScale * timeOffset;\n }\n }\n\n if (videoTrack.sps && videoTrack.pps && videoSamples.length) {\n // let's use input time scale as MP4 video timescale\n // we use input time scale straight away to avoid rounding issues on frame duration / cts computation\n const inputTimeScale = videoTrack.inputTimeScale;\n videoTrack.timescale = inputTimeScale;\n tracks.video = {\n container : 'video/mp4',\n codec : videoTrack.codec,\n initSegment : MP4.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 - inputTimeScale * timeOffset);\n initDTS = Math.min(initDTS,videoSamples[0].dts - inputTimeScale * timeOffset);\n this.observer.trigger(Event.INIT_PTS_FOUND, { initPTS: initPTS});\n }\n }\n\n if(Object.keys(tracks).length) {\n observer.trigger(Event.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(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'no audio/video samples found'});\n }\n }\n\n remuxVideo(track, timeOffset, contiguous, audioTrackLength, accurateTimeOffset) {\n var offset = 8,\n timeScale = track.timescale,\n mp4SampleDuration,\n mdat, moof,\n firstPTS, firstDTS,\n nextDTS,\n lastPTS, lastDTS,\n inputSamples = track.samples,\n outputSamples = [],\n nbSamples = inputSamples.length,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS;\n\n // for (let i = 0; i < track.samples.length; i++) {\n // let avcSample = track.samples[i];\n // let units = avcSample.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 // if parsed fragment is contiguous with last one, let's use last DTS value as reference\n let nextAvcDts = this.nextAvcDts;\n\n const isSafari = this.isSafari;\n\n // Safari does not like overlapping DTS on consecutive fragments. let's use nextAvcDts to overcome this if fragments are consecutive\n if (isSafari) {\n // also consider consecutive fragments as being contiguous (even if a level switch occurs),\n // for sake of clarity:\n // consecutive fragments are frags with\n // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR\n // - less than 200 ms PTS gaps (timeScale/5)\n contiguous |= (inputSamples.length && nextAvcDts &&\n ((accurateTimeOffset && Math.abs(timeOffset-nextAvcDts/timeScale) < 0.1) ||\n Math.abs((inputSamples[0].pts-nextAvcDts-initDTS)) < timeScale/5)\n );\n }\n\n if (!contiguous) {\n // if not contiguous, let's use target timeOffset\n nextAvcDts = timeOffset*timeScale;\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 inputSamples.forEach(function(sample) {\n sample.pts = ptsNormalize(sample.pts-initDTS, nextAvcDts);\n sample.dts = ptsNormalize(sample.dts-initDTS, nextAvcDts);\n });\n\n // sort video samples by DTS then PTS then demux id order\n inputSamples.sort(function(a, b) {\n const deltadts = a.dts - b.dts;\n const deltapts = a.pts - b.pts;\n return deltadts ? deltadts : deltapts ? deltapts : (a.id - b.id);\n });\n\n // handle broken streams with PTS < DTS, tolerance up 200ms (18000 in 90kHz timescale)\n let PTSDTSshift = inputSamples.reduce( (prev, curr) => Math.max(Math.min(prev,curr.pts-curr.dts),-18000),0);\n if (PTSDTSshift < 0) {\n logger.warn(`PTS < DTS detected in video samples, shifting DTS by ${Math.round(PTSDTSshift/90)} ms to overcome this issue`);\n for (let i = 0; i < inputSamples.length; i++) {\n inputSamples[i].dts += PTSDTSshift;\n }\n }\n\n // compute first DTS and last DTS, normalize them against reference value\n let sample = inputSamples[0];\n firstDTS = Math.max(sample.dts,0);\n firstPTS = Math.max(sample.pts,0);\n\n // check timestamp continuity accross consecutive fragments (this is to remove inter-fragment gap/hole)\n let 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.log(`AVC:${delta} ms hole between fragments detected,filling it`);\n } else if (delta < -1) {\n 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;\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;\n 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(sample.dts,0);\n lastPTS = Math.max(sample.pts,0,lastDTS);\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)/(inputSamples.length-1));\n }\n\n let nbNalu = 0, naluLen = 0;\n for (let i = 0 ; i < nbSamples; i++) {\n // compute total/avc sample length and nb of NAL units\n let sample = inputSamples[i], units = sample.units, nbUnits = units.length, sampleLen = 0;\n for (let j = 0; j < nbUnits; j++) {\n sampleLen += units[j].data.length;\n }\n naluLen += sampleLen;\n nbNalu += nbUnits;\n sample.length = sampleLen;\n\n // normalize PTS/DTS\n if (isSafari) {\n // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples\n sample.dts = firstDTS + i*mp4SampleDuration;\n } else {\n // ensure sample monotonic DTS\n sample.dts = Math.max(sample.dts,firstDTS);\n }\n // ensure that computed value is greater or equal than sample DTS\n sample.pts = Math.max(sample.pts , sample.dts);\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 let mdatSize = naluLen + (4 * nbNalu) + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch(err) {\n this.observer.trigger(Event.ERROR, {type : ErrorTypes.MUX_ERROR, details: ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes : mdatSize, reason: `fail allocating video mdat ${mdatSize}`});\n return;\n }\n let view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(MP4.types.mdat, 4);\n\n for (let i = 0 ; i < nbSamples; i++) {\n let avcSample = inputSamples[i],\n avcSampleUnits = avcSample.units,\n mp4SampleLength = 0,\n compositionTimeOffset;\n // convert NALU bitstream to MP4 format (prepend NALU with size field)\n for(let j = 0, nbUnits = avcSampleUnits.length; j < nbUnits ; j++) {\n let unit = avcSampleUnits[j],\n unitData = unit.data,\n unitDataLen = unit.data.byteLength;\n view.setUint32(offset, unitDataLen);\n offset += 4;\n mdat.set(unitData, offset);\n offset += unitDataLen;\n mp4SampleLength += 4 + unitDataLen;\n }\n\n if(!isSafari) {\n // expected sample duration is the Decoding Timestamp diff of consecutive samples\n if (i < nbSamples - 1) {\n mp4SampleDuration = inputSamples[i+1].dts - avcSample.dts;\n } else {\n let config = this.config,\n lastFrameDuration = avcSample.dts - inputSamples[i > 0 ? i-1 : i].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 let maxBufferHole = config.maxBufferHole,\n maxSeekHole = config.maxSeekHole,\n gapTolerance = Math.floor(Math.min(maxBufferHole, maxSeekHole) * timeScale),\n deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * timeScale : this.nextAudioPts) - 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.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 compositionTimeOffset = Math.round(avcSample.pts - avcSample.dts);\n } else {\n compositionTimeOffset = Math.max(0,mp4SampleDuration*Math.round((avcSample.pts - avcSample.dts)/mp4SampleDuration));\n }\n\n\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${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;\n let 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 let 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 = MP4.moof(track.sequenceNumber++, firstDTS , track);\n track.samples = [];\n\n let data = {\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / timeScale,\n endPTS: (lastPTS + mp4SampleDuration) / timeScale,\n startDTS: firstDTS / timeScale,\n endDTS: this.nextAvcDts / timeScale,\n type: 'video',\n nb: outputSamples.length,\n dropped : dropped\n };\n this.observer.trigger(Event.FRAG_PARSING_DATA, data);\n return data;\n }\n\n remuxAudio(track, timeOffset, contiguous,accurateTimeOffset) {\n const inputTimeScale = track.inputTimeScale,\n mp4timeScale = track.timescale,\n scaleFactor = inputTimeScale/mp4timeScale,\n mp4SampleDuration = track.isAAC ? 1024 : 1152,\n inputSampleDuration = mp4SampleDuration * scaleFactor,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS,\n rawMPEG = !track.isAAC && this.typeSupported.mpeg;\n\n var offset,\n mp4Sample,\n fillFrame,\n mdat, moof,\n firstPTS, lastPTS,\n inputSamples = track.samples,\n outputSamples = [],\n nextAudioPts = this.nextAudioPts;\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\n // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR\n // - less than 20 audio frames distance\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 contiguous |= (inputSamples.length && nextAudioPts &&\n ((accurateTimeOffset && Math.abs(timeOffset-nextAudioPts/inputTimeScale) < 0.1) ||\n Math.abs((inputSamples[0].pts-nextAudioPts-initDTS)) < 20*inputSampleDuration)\n );\n\n if (!contiguous) {\n // if fragments are not contiguous, let's use timeOffset to compute next Audio PTS\n nextAudioPts = timeOffset*inputTimeScale;\n }\n\n // compute normalized PTS\n inputSamples.forEach(function(sample) {\n sample.pts = sample.dts = ptsNormalize(sample.pts - initDTS, nextAudioPts);\n });\n\n // sort based on normalized PTS (this is to avoid sorting issues in case timestamp\n // reloop in the middle of our samples array)\n inputSamples.sort(function(a, b) {\n return a.pts - b.pts;\n });\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\n // only inject/drop audio frames in case time offset is accurate\n if (accurateTimeOffset && track.isAAC) {\n for (let i = 0, nextPts = nextAudioPts; i < inputSamples.length; ) {\n // First, let's see how far off this frame is from where we expect it to be\n var sample = inputSamples[i], delta;\n let pts = sample.pts;\n delta = pts - nextPts;\n\n const duration = Math.abs(1000*delta/inputTimeScale);\n\n // If we're overlapping by more than a duration, drop this sample\n if (delta <= -inputSampleDuration) {\n logger.warn(`Dropping 1 audio frame @ ${(nextPts/inputTimeScale).toFixed(3)}s due to ${duration} ms overlap.`);\n inputSamples.splice(i, 1);\n track.len -= sample.unit.length;\n // Don't touch nextPtsNorm or i\n }\n\n // Insert missing frames if:\n // 1: We're more than one frame away\n // 2: Not more than MAX_SILENT_FRAME_DURATION away\n // 3: currentTime (aka nextPtsNorm) is not 0\n else if (delta >= inputSampleDuration && duration < MAX_SILENT_FRAME_DURATION && nextPts) {\n var missing = Math.round(delta / inputSampleDuration);\n logger.warn(`Injecting ${missing} audio frame @ ${(nextPts/inputTimeScale).toFixed(3)}s due to ${Math.round(1000*delta/inputTimeScale)} ms gap.`);\n for (var j = 0; j < missing; j++) {\n let newStamp = Math.max(nextPts,0);\n fillFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n if (!fillFrame) {\n logger.log('Unable to get silent frame for given audio codec; duplicating last frame instead.');\n fillFrame = sample.unit.subarray();\n }\n inputSamples.splice(i, 0, {unit: fillFrame, pts: newStamp, dts: newStamp});\n track.len += fillFrame.length;\n nextPts += inputSampleDuration;\n i++;\n }\n\n // Adjust sample to next expected pts\n sample.pts = sample.dts = nextPts;\n nextPts += inputSampleDuration;\n i++;\n } else {\n // Otherwise, just adjust pts\n if (Math.abs(delta) > (0.1 * inputSampleDuration)) {\n //logger.log(`Invalid frame delta ${Math.round(delta + inputSampleDuration)} at PTS ${Math.round(pts / 90)} (should be ${Math.round(inputSampleDuration)}).`);\n }\n sample.pts = sample.dts = nextPts;\n nextPts += inputSampleDuration;\n i++;\n }\n }\n }\n\n\n for (let j =0 , nbSamples = inputSamples.length; j < nbSamples ; j++) {\n let audioSample = inputSamples[j];\n let unit = audioSample.unit;\n let pts = audioSample.pts;\n //logger.log(`Audio/PTS:${Math.round(pts/90)}`);\n // if not first sample\n if (lastPTS !== undefined) {\n mp4Sample.duration = Math.round((pts - lastPTS) / scaleFactor);\n } else {\n let delta = Math.round(1000 * (pts - nextAudioPts) / inputTimeScale),\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 && track.isAAC) {\n // log delta\n if (delta) {\n if (delta > 0 && delta < MAX_SILENT_FRAME_DURATION) {\n numMissingFrames = Math.round((pts - nextAudioPts) / inputSampleDuration);\n logger.log(`${delta} ms hole between AAC samples detected,filling it`);\n if (numMissingFrames > 0) {\n fillFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n if (!fillFrame) {\n fillFrame = unit.subarray();\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.log(`drop overlapping AAC sample, expected/parsed/delta:${(nextAudioPts/inputTimeScale).toFixed(3)}s/${(pts/inputTimeScale).toFixed(3)}s/${(-delta)}ms`);\n track.len -= unit.byteLength;\n continue;\n }\n // set PTS/DTS to expected PTS/DTS\n pts = nextAudioPts;\n }\n }\n // remember first PTS of our audioSamples, ensure value is positive\n firstPTS = Math.max(0, pts);\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 let mdatSize = rawMPEG ? track.len : track.len + 8;\n offset = rawMPEG ? 0 : 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch(err) {\n this.observer.trigger(Event.ERROR, {type : ErrorTypes.MUX_ERROR, details: ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes : mdatSize, reason: `fail allocating audio mdat ${mdatSize}`});\n return;\n }\n if (!rawMPEG) {\n const view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(MP4.types.mdat, 4);\n }\n } else {\n // no audio samples\n return;\n }\n for (let i = 0; i < numMissingFrames; i++) {\n fillFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n if (!fillFrame) {\n logger.log('Unable to get silent frame for given audio codec; duplicating this frame instead.');\n fillFrame = unit.subarray();\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 outputSamples.push(mp4Sample);\n }\n }\n mdat.set(unit, offset);\n let unitLen = unit.byteLength;\n offset += unitLen;\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${audioSample.pts}/${audioSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(audioSample.pts/4294967296).toFixed(3)}');\n mp4Sample = {\n size: unitLen,\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 outputSamples.push(mp4Sample);\n lastPTS = pts;\n }\n var lastSampleDuration = 0;\n var nbSamples = outputSamples.length;\n //set last sample duration as being identical to previous sample\n if (nbSamples >= 2) {\n lastSampleDuration = outputSamples[nbSamples - 2].duration;\n mp4Sample.duration = lastSampleDuration;\n }\n if (nbSamples) {\n // next audio sample PTS should be equal to last sample PTS + duration\n this.nextAudioPts = nextAudioPts = lastPTS + scaleFactor * lastSampleDuration;\n //logger.log('Audio/PTS/PTSend:' + audioSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));\n track.len = 0;\n track.samples = outputSamples;\n if (rawMPEG) {\n moof = new Uint8Array();\n } else {\n moof = MP4.moof(track.sequenceNumber++, firstPTS / scaleFactor, track);\n }\n track.samples = [];\n const start = firstPTS / inputTimeScale;\n const end = nextAudioPts / inputTimeScale;\n const audioData = {\n data1: moof,\n data2: mdat,\n startPTS: start,\n endPTS: end,\n startDTS: start,\n endDTS: end,\n type: 'audio',\n nb: nbSamples\n };\n this.observer.trigger(Event.FRAG_PARSING_DATA, audioData);\n return audioData;\n }\n return null;\n }\n\n remuxEmptyAudio(track, timeOffset, contiguous, videoData) {\n let inputTimeScale = track.inputTimeScale,\n mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale,\n scaleFactor = inputTimeScale/mp4timeScale,\n nextAudioPts = this.nextAudioPts,\n\n // sync with video's timestamp\n startDTS = (nextAudioPts !== undefined ? nextAudioPts : videoData.startDTS * inputTimeScale) + this._initDTS,\n endDTS = videoData.endDTS * inputTimeScale + this._initDTS,\n // one sample's duration value\n sampleDuration = 1024,\n frameDuration = scaleFactor * sampleDuration,\n\n // samples count of this segment's duration\n nbSamples = Math.ceil((endDTS - startDTS) / frameDuration),\n\n // silent frame\n silentFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n\n logger.warn('remux empty Audio');\n // Can't remux if we can't generate a silent frame...\n if (!silentFrame) {\n logger.trace('Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!');\n return;\n }\n\n let samples = [];\n for(var i = 0; i < nbSamples; i++) {\n var stamp = startDTS + i * frameDuration;\n samples.push({unit: silentFrame, pts: stamp, dts: stamp});\n track.len += silentFrame.length;\n }\n track.samples = samples;\n\n this.remuxAudio(track, timeOffset, contiguous);\n }\n\n remuxID3(track,timeOffset) {\n var length = track.samples.length, sample;\n const inputTimeScale = track.inputTimeScale;\n const initPTS = this._initPTS;\n const initDTS = this._initDTS;\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 - initPTS) / inputTimeScale);\n sample.dts = ((sample.dts - initDTS) / inputTimeScale);\n }\n this.observer.trigger(Event.FRAG_PARSING_METADATA, {\n samples:track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n\n remuxText(track,timeOffset) {\n track.samples.sort(function(a, b) {\n return (a.pts-b.pts);\n });\n\n var length = track.samples.length, sample;\n const inputTimeScale = track.inputTimeScale;\n const initPTS = this._initPTS;\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 - initPTS) / inputTimeScale);\n }\n this.observer.trigger(Event.FRAG_PARSING_USERDATA, {\n samples:track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n\n _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}\n\nexport default MP4Remuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/remux/mp4-remuxer.js","/**\n * passthrough remuxer\n*/\nimport Event from '../events';\n\nclass PassThroughRemuxer {\n constructor(observer) {\n this.observer = observer;\n }\n\n destroy() {\n }\n\n resetTimeStamp() {\n }\n\n resetInitSegment() {\n }\n\n remux(audioTrack,videoTrack,id3Track,textTrack,timeOffset, contiguous,accurateTimeOffset,rawData) {\n var observer = this.observer;\n var streamType = '';\n if (audioTrack) {\n streamType += 'audio';\n }\n if (videoTrack) {\n streamType += 'video';\n }\n observer.trigger(Event.FRAG_PARSING_DATA, {\n data1: rawData,\n startPTS: timeOffset,\n startDTS: timeOffset,\n type: streamType,\n nb: 1,\n dropped : 0\n });\n //notify end of parsing\n observer.trigger(Event.FRAG_PARSED);\n }\n}\n\nexport default PassThroughRemuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/remux/passthrough-remuxer.js","const DECIMAL_RESOLUTION_REGEX = /^(\\d+)x(\\d+)$/;\nconst ATTR_LIST_REGEX = /\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g;\n\n// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js\nclass AttrList {\n\n constructor(attrs) {\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 decimalInteger(attrName) {\n const intValue = parseInt(this[attrName], 10);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n\n hexadecimalInteger(attrName) {\n if(this[attrName]) {\n let stringValue = (this[attrName] || '0x').slice(2);\n stringValue = ((stringValue.length & 1) ? '0' : '') + stringValue;\n\n const value = new Uint8Array(stringValue.length / 2);\n for (let 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 hexadecimalIntegerAsNumber(attrName) {\n const intValue = parseInt(this[attrName], 16);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n\n decimalFloatingPoint(attrName) {\n return parseFloat(this[attrName]);\n }\n\n enumeratedString(attrName) {\n return this[attrName];\n }\n\n decimalResolution(attrName) {\n const res = DECIMAL_RESOLUTION_REGEX.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 static parseAttrList(input) {\n var match, attrs = {};\n ATTR_LIST_REGEX.lastIndex = 0;\n while ((match = ATTR_LIST_REGEX.exec(input)) !== null) {\n var value = match[2], quote = '\"';\n\n if (value.indexOf(quote) === 0 &&\n 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\nexport default AttrList;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/attr-list.js","var 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(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 }\n else if (comparisonResult < 0) {\n maxIndex = currentIndex - 1;\n }\n else {\n return currentElement;\n }\n }\n \n return null;\n }\n};\n\nmodule.exports = BinarySearch;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/binary-search.js","/**\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(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 = 100;\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(newTime) {\n this.time = newTime;\n },\n log : function(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(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\nclass PenState {\n\n constructor(foreground, underline, italics, background, flash) {\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 reset() {\n this.foreground = 'white';\n this.underline = false;\n this.italics = false;\n this.background = 'black';\n this.flash = false;\n }\n\n 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 isDefault() {\n return (this.foreground === 'white' && !this.underline && !this.italics &&\n this.background === 'black' && !this.flash);\n }\n\n equals(other) {\n return ( (this.foreground === other.foreground) &&\n (this.underline === other.underline) &&\n (this.italics === other.italics) &&\n (this.background === other.background) &&\n (this.flash === other.flash) );\n }\n\n 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 toString() {\n return ('color=' + this.foreground + ', underline=' + this.underline + ', italics=' + this.italics +\n ', background=' + this.background + ', flash=' + this.flash);\n }\n}\n\n/**\n * Unicode character with styling and background.\n * @constructor\n */\nclass StyledUnicodeChar\n{\n\n constructor(uchar, foreground, underline, italics, background, flash) {\n this.uchar = uchar || ' '; // unicode character\n this.penState = new PenState(foreground, underline,italics, background, flash);\n }\n\n reset() {\n this.uchar = ' ';\n this.penState.reset();\n }\n\n setChar(uchar, newPenState) {\n this.uchar = uchar;\n this.penState.copy(newPenState);\n }\n\n setPenState(newPenState) {\n this.penState.copy(newPenState);\n }\n\n equals(other) {\n return this.uchar === other.uchar && this.penState.equals(other.penState);\n }\n\n copy(newChar) {\n this.uchar = newChar.uchar;\n this.penState.copy(newChar.penState);\n }\n\n isEmpty() {\n return this.uchar === ' ' && this.penState.isDefault();\n }\n}\n\n/**\n * CEA-608 row consisting of NR_COLS instances of StyledUnicodeChar.\n * @constructor\n */\nclass Row {\n constructor() {\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 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 copy(other) {\n for (var i = 0 ; i < NR_COLS; i ++) {\n this.chars[i].copy(other.chars[i]);\n }\n }\n\n 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 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 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 backSpace() {\n this.moveCursor(-1);\n this.chars[this.pos].setChar(' ', this.currPenState);\n }\n\n insertChar(byte) {\n if (byte >= 0x90) { //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) +\n ' (' + 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 clearFromPos(startPos) {\n var i;\n for (i = startPos ; i < NR_COLS ; i++) {\n this.chars[i].reset();\n }\n }\n\n clear() {\n this.clearFromPos(0);\n this.pos = 0;\n this.currPenState.reset();\n }\n\n clearToEndOfRow() {\n this.clearFromPos(this.pos);\n }\n\n 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 setPenStyles(styles) {\n this.currPenState.setStyles(styles);\n var currChar = this.chars[this.pos];\n currChar.setPenState(this.currPenState);\n }\n}\n\n/**\n * Keep a CEA-608 screen of 32x15 styled characters\n * @constructor\n*/\nclass CaptionScreen {\n\n constructor() {\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 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 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 copy(other) {\n for (var i = 0 ; i < NR_ROWS ; i++) {\n this.rows[i].copy(other.rows[i]);\n }\n }\n\n 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 backSpace() {\n var row = this.rows[this.currRow];\n row.backSpace();\n }\n\n 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 insertChar(char) {\n var row = this.rows[this.currRow];\n row.insertChar(char);\n }\n\n setPen(styles) {\n var row = this.rows[this.currRow];\n row.setPenStyles(styles);\n }\n\n moveCursor(relPos) {\n var row = this.rows[this.currRow];\n row.moveCursor(relPos);\n }\n\n setCursor(absPos) {\n logger.log('INFO', 'setCursor: ' + absPos);\n var row = this.rows[this.currRow];\n row.setCursor(absPos);\n }\n\n 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\n //Make sure this only affects Roll-up Captions by checking this.nrRollUpRows\n if (this.nrRollUpRows && this.currRow !== newRow) {\n //clear all rows first\n for (let i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n\n //Copy this.nrRollUpRows rows from lastOutputScreen and place it in the newRow location\n //topRowIndex - the start of rows to copy (inclusive index)\n var topRowIndex = this.currRow + 1 - (this.nrRollUpRows);\n //We only copy if the last position was already shown.\n //We use the cueStartTime value to check this.\n const lastOutputScreen = this.lastOutputScreen;\n if (lastOutputScreen) {\n var prevLineTime = lastOutputScreen.rows[topRowIndex].cueStartTime;\n if(prevLineTime && prevLineTime < logger.time) {\n for (let i = 0; i < this.nrRollUpRows; i++) {\n this.rows[newRow-this.nrRollUpRows+i+1].copy(lastOutputScreen.rows[topRowIndex+i]);\n }\n }\n }\n }\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 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 setRollUpRows(nrRows) {\n this.nrRollUpRows = nrRows;\n }\n\n 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 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 getTextAndFormat() {\n return this.rows;\n }\n}\n\n//var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];\n\nclass Cea608Channel\n{\n constructor(channelNumber, outputFilter) {\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 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 getHandler() {\n return this.outputFilter;\n }\n\n setHandler(newHandler) {\n this.outputFilter = newHandler;\n }\n\n setPAC(pacData) {\n this.writeScreen.setPAC(pacData);\n }\n\n setBkgData(bkgData) {\n this.writeScreen.setBkgData(bkgData);\n }\n\n 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 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 ccRCL() { // 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 ccBS() { // 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 ccAOF() { // Reserved (formerly Alarm Off)\n return;\n }\n\n ccAON() { // Reserved (formerly Alarm On)\n return;\n }\n\n ccDER() { // 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 ccRU(nrRows) { //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 ccFON() { //Flash On\n logger.log('INFO', 'FON - Flash On');\n this.writeScreen.setPen({flash : true});\n }\n\n ccRDC() { // Resume Direct Captioning (switch mode to PaintOn)\n logger.log('INFO', 'RDC - Resume Direct Captioning');\n this.setMode('MODE_PAINT-ON');\n }\n\n ccTR() { // Text Restart in text mode (not supported, however)\n logger.log('INFO', 'TR');\n this.setMode('MODE_TEXT');\n }\n\n ccRTD() { // Resume Text Display in Text mode (not supported, however)\n logger.log('INFO', 'RTD');\n this.setMode('MODE_TEXT');\n }\n\n ccEDM() { // Erase Displayed Memory\n logger.log('INFO', 'EDM - Erase Displayed Memory');\n this.displayedMemory.reset();\n this.outputDataUpdate();\n }\n\n ccCR() { // Carriage Return\n logger.log('CR - Carriage Return');\n this.writeScreen.rollUp();\n this.outputDataUpdate();\n }\n\n ccENM() { //Erase Non-Displayed Memory\n logger.log('INFO', 'ENM - Erase Non-displayed Memory');\n this.nonDisplayedMemory.reset();\n }\n\n ccEOC() { //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 ccTO(nrCols) { // Tab Offset 1,2, or 3 columns\n logger.log('INFO', 'TO(' + nrCols + ') - Tab Offset');\n this.writeScreen.moveCursor(nrCols);\n }\n\n ccMIDROW(secondByte) { // 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 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()) { // 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 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\nclass Cea608Parser {\n\n constructor(field, out1, out2) {\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 getHandler(index) {\n return this.channels[index].getHandler();\n }\n\n 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 addData(t, byteList) {\n var cmdFound, a, 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]) +\n ' 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 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 { //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 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 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 { // 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 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 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 parseBackgroundAttributes(a, b) {\n var bkgData,\n index,\n chNr,\n 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 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 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\nexport default Cea608Parser;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/cea-608-parser.js","import { fixLineBreaks } from './vttparser';\n\nconst Cues = {\n\n newCue: function(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 {\n row = captionScreen.rows[r];\n indenting = true;\n indent = 0;\n text = '';\n\n if (!row.isEmpty())\n {\n for (var c=0; c<row.chars.length; c++)\n {\n if (row.chars[c].uchar.match(/\\s/) && indenting)\n {\n indent++;\n }\n else\n {\n text += row.chars[c].uchar;\n indenting = false;\n }\n }\n //To be used for cleaning-up orphaned roll-up captions\n row.cueStartTime = startTime;\n\n // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE\n if (startTime === endTime)\n {\n endTime += 0.0001;\n }\n\n cue = new VTTCue(startTime, endTime, fixLineBreaks(text.trim()));\n\n if (indent >= 16)\n {\n indent--;\n }\n else\n {\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 {\n cue.line = r + 1;\n }\n else\n {\n cue.line = (r > 7 ? r - 2 : r + 1);\n }\n cue.align = 'left';\n // Clamp the position between 0 and 100 - if out of these bounds, Firefox throws an exception and captions break\n cue.position = Math.max(0, Math.min(100, 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\\//) ? 50 : 0)));\n track.addCue(cue);\n }\n }\n }\n\n};\n\nmodule.exports = Cues;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/cues.js","/*\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\nimport EWMA from '../utils/ewma';\n\n\nclass EwmaBandWidthEstimator {\n\n constructor(hls,slow,fast,defaultEstimate) {\n this.hls = hls;\n this.defaultEstimate_ = defaultEstimate;\n this.minWeight_ = 0.001;\n this.minDelayMs_ = 50;\n this.slow_ = new EWMA(slow);\n this.fast_ = new EWMA(fast);\n }\n\n sample(durationMs,numBytes) {\n durationMs = Math.max(durationMs, this.minDelayMs_);\n var bandwidth = 8000* numBytes / durationMs,\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 canEstimate() {\n let fast = this.fast_;\n return (fast && fast.getTotalWeight() >= this.minWeight_);\n }\n\n\n 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 destroy() {\n }\n}\nexport default EwmaBandWidthEstimator;\n\n\n\n\n// WEBPACK FOOTER //\n// src/utils/ewma-bandwidth-estimator.js","/*\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\nclass EWMA {\n\n // About half of the estimated value will be from the last |halfLife| samples by weight.\n constructor(halfLife) {\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 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 getTotalWeight() {\n return this.totalWeight_;\n }\n\n 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\nexport default EWMA;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/ewma.js","'use strict';\n\nfunction noop() {}\n\nconst fakeLogger = {\n trace: noop,\n debug: noop,\n log: noop,\n warn: noop,\n info: noop,\n error: noop\n};\n\nlet 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 const func = self.console[type];\n if (func) {\n return function(...args) {\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, ...functions) {\n functions.forEach(function(type) {\n exportedLogger[type] = debugConfig[type] ? debugConfig[type].bind(debugConfig) : consolePrintFn(type);\n });\n}\n\nexport var enableLogs = function(debugConfig) {\n if (debugConfig === true || typeof debugConfig === 'object') {\n exportLoggerFunctions(debugConfig,\n // Remove out from list here to hard-disable a log-level\n //'trace',\n 'debug',\n 'log',\n 'info',\n 'warn',\n 'error'\n );\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 }\n else {\n exportedLogger = fakeLogger;\n }\n};\n\nexport var logger = exportedLogger;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/logger.js","/**\n * TimeRanges to string helper\n */\n\nconst TimeRanges = {\n toString : function(r) {\n var log = '', 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\nmodule.exports = TimeRanges;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/timeRanges.js","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport default (function() {\n if (typeof window !== 'undefined' && window.VTTCue) {\n return window.VTTCue;\n }\n\n var autoKeyword = 'auto';\n var directionSetting = {\n '': true,\n lr: true,\n rl: true\n };\n var alignSetting = {\n start: true,\n middle: true,\n end: true,\n left: true,\n right: true\n };\n\n function findDirectionSetting(value) {\n if (typeof value !== 'string') {\n return false;\n }\n var dir = directionSetting[value.toLowerCase()];\n return dir ? value.toLowerCase() : false;\n }\n\n function findAlignSetting(value) {\n if (typeof value !== 'string') {\n return false;\n }\n var align = alignSetting[value.toLowerCase()];\n return align ? value.toLowerCase() : false;\n }\n\n function extend(obj) {\n var i = 1;\n for (; i < arguments.length; i++) {\n var cobj = arguments[i];\n for (var p in cobj) {\n obj[p] = cobj[p];\n }\n }\n\n return obj;\n }\n\n function VTTCue(startTime, endTime, text) {\n var cue = this;\n var isIE8 = (function () {\n if (typeof navigator === 'undefined') {\n return;\n }\n return (/MSIE\\s8\\.0/).test(navigator.userAgent);\n })();\n var baseObj = {};\n\n if (isIE8) {\n cue = document.createElement('custom');\n } else {\n baseObj.enumerable = true;\n }\n\n /**\n * Shim implementation specific properties. These properties are not in\n * the spec.\n */\n\n // Lets us know when the VTTCue's data has changed in such a way that we need\n // to recompute its display state. This lets us compute its display state\n // lazily.\n cue.hasBeenReset = false;\n\n /**\n * VTTCue and TextTrackCue properties\n * http://dev.w3.org/html5/webvtt/#vttcue-interface\n */\n\n var _id = '';\n var _pauseOnExit = false;\n var _startTime = startTime;\n var _endTime = endTime;\n var _text = text;\n var _region = null;\n var _vertical = '';\n var _snapToLines = true;\n var _line = 'auto';\n var _lineAlign = 'start';\n var _position = 50;\n var _positionAlign = 'middle';\n var _size = 50;\n var _align = 'middle';\n\n Object.defineProperty(cue, 'id', extend({}, baseObj, {\n get: function () {\n return _id;\n },\n set: function (value) {\n _id = '' + value;\n }\n }));\n\n Object.defineProperty(cue, 'pauseOnExit', extend({}, baseObj, {\n get: function () {\n return _pauseOnExit;\n },\n set: function (value) {\n _pauseOnExit = !!value;\n }\n }));\n\n Object.defineProperty(cue, 'startTime', extend({}, baseObj, {\n get: function () {\n return _startTime;\n },\n set: function (value) {\n if (typeof value !== 'number') {\n throw new TypeError('Start time must be set to a number.');\n }\n _startTime = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'endTime', extend({}, baseObj, {\n get: function () {\n return _endTime;\n },\n set: function (value) {\n if (typeof value !== 'number') {\n throw new TypeError('End time must be set to a number.');\n }\n _endTime = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'text', extend({}, baseObj, {\n get: function () {\n return _text;\n },\n set: function (value) {\n _text = '' + value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'region', extend({}, baseObj, {\n get: function () {\n return _region;\n },\n set: function (value) {\n _region = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'vertical', extend({}, baseObj, {\n get: function () {\n return _vertical;\n },\n set: function (value) {\n var setting = findDirectionSetting(value);\n // Have to check for false because the setting an be an empty string.\n if (setting === false) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _vertical = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'snapToLines', extend({}, baseObj, {\n get: function () {\n return _snapToLines;\n },\n set: function (value) {\n _snapToLines = !!value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'line', extend({}, baseObj, {\n get: function () {\n return _line;\n },\n set: function (value) {\n if (typeof value !== 'number' && value !== autoKeyword) {\n throw new SyntaxError('An invalid number or illegal string was specified.');\n }\n _line = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'lineAlign', extend({}, baseObj, {\n get: function () {\n return _lineAlign;\n },\n set: function (value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _lineAlign = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'position', extend({}, baseObj, {\n get: function () {\n return _position;\n },\n set: function (value) {\n if (value < 0 || value > 100) {\n throw new Error('Position must be between 0 and 100.');\n }\n _position = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'positionAlign', extend({}, baseObj, {\n get: function () {\n return _positionAlign;\n },\n set: function (value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _positionAlign = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'size', extend({}, baseObj, {\n get: function () {\n return _size;\n },\n set: function (value) {\n if (value < 0 || value > 100) {\n throw new Error('Size must be between 0 and 100.');\n }\n _size = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'align', extend({}, baseObj, {\n get: function () {\n return _align;\n },\n set: function (value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _align = setting;\n this.hasBeenReset = true;\n }\n }));\n\n /**\n * Other <track> spec defined properties\n */\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state\n cue.displayState = undefined;\n\n if (isIE8) {\n return cue;\n }\n }\n\n /**\n * VTTCue methods\n */\n\n VTTCue.prototype.getCueAsHTML = function () {\n // Assume WebVTT.convertCueToDOMTree is on the global.\n var WebVTT = window.WebVTT;\n return WebVTT.convertCueToDOMTree(window, this.text);\n };\n\n return VTTCue;\n})();\n\n\n\n// WEBPACK FOOTER //\n// src/utils/vttcue.js","/*\n * Source: https://github.com/mozilla/vtt.js/blob/master/dist/vtt.js#L1716\n */\n\nimport VTTCue from './vttcue';\n\nconst StringDecoder = function StringDecoder() {\n return {\n decode: function(data) {\n if (!data) {\n return '';\n }\n if (typeof data !== 'string') {\n throw new Error('Error - expected string data.');\n }\n return decodeURIComponent(encodeURIComponent(data));\n },\n };\n };\n\nfunction VTTParser() {\n this.window = window;\n this.state = 'INITIAL';\n this.buffer = '';\n this.decoder = new StringDecoder();\n this.regionList = [];\n}\n\n\n// Try to parse input as a time stamp.\nfunction parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(':', ''), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}\n\n// A settings object holds key/value pairs and will ignore anything but the first\n// assignment to a specific key.\nfunction Settings() {\n this.values = Object.create(null);\n}\n\nSettings.prototype = {\n // Only accept the first assignment to any key.\n set: function(k, v) {\n if (!this.get(k) && v !== '') {\n this.values[k] = v;\n }\n },\n // Return the value for a key, or a default value.\n // If 'defaultKey' is passed then 'dflt' is assumed to be an object with\n // a number of possible default values as properties where 'defaultKey' is\n // the key of the property that will be chosen; otherwise it's assumed to be\n // a single value.\n get: function(k, dflt, defaultKey) {\n if (defaultKey) {\n return this.has(k) ? this.values[k] : dflt[defaultKey];\n }\n return this.has(k) ? this.values[k] : dflt;\n },\n // Check whether we have a value for a key.\n has: function(k) {\n return k in this.values;\n },\n // Accept a setting if its one of the given alternatives.\n alt: function(k, v, a) {\n for (var n = 0; n < a.length; ++n) {\n if (v === a[n]) {\n this.set(k, v);\n break;\n }\n }\n },\n // Accept a setting if its a valid (signed) integer.\n integer: function(k, v) {\n if (/^-?\\d+$/.test(v)) { // integer\n this.set(k, parseInt(v, 10));\n }\n },\n // Accept a setting if its a valid percentage.\n percent: function(k, v) {\n var m;\n if ((m = v.match(/^([\\d]{1,3})(\\.[\\d]*)?%$/))) {\n v = parseFloat(v);\n if (v >= 0 && v <= 100) {\n this.set(k, v);\n return true;\n }\n }\n return false;\n }\n};\n\n// Helper function to parse input into groups separated by 'groupDelim', and\n// interprete each group as a key/value pair separated by 'keyValueDelim'.\nfunction parseOptions(input, callback, keyValueDelim, groupDelim) {\n var groups = groupDelim ? input.split(groupDelim) : [input];\n for (var i in groups) {\n if (typeof groups[i] !== 'string') {\n continue;\n }\n var kv = groups[i].split(keyValueDelim);\n if (kv.length !== 2) {\n continue;\n }\n var k = kv[0];\n var v = kv[1];\n callback(k, v);\n }\n}\n\nvar defaults = new VTTCue(0, 0, 0);\n// 'middle' was changed to 'center' in the spec: https://github.com/w3c/webvtt/pull/244\n// Chrome and Safari don't yet support this change, but FF does\nvar center = defaults.align === 'middle' ? 'middle' : 'center';\n\nfunction parseCue(input, cue, regionList) {\n // Remember the original input if we need to throw an error.\n var oInput = input;\n // 4.1 WebVTT timestamp\n function consumeTimeStamp() {\n var ts = parseTimeStamp(input);\n if (ts === null) {\n throw new Error('Malformed timestamp: ' + oInput);\n }\n // Remove time stamp from input.\n input = input.replace(/^[^\\sa-zA-Z-]+/, '');\n return ts;\n }\n\n // 4.4.2 WebVTT cue settings\n function consumeCueSettings(input, cue) {\n var settings = new Settings();\n\n parseOptions(input, function(k, v) {\n switch (k) {\n case 'region':\n // Find the last region we parsed with the same region id.\n for (var i = regionList.length - 1; i >= 0; i--) {\n if (regionList[i].id === v) {\n settings.set(k, regionList[i].region);\n break;\n }\n }\n break;\n case 'vertical':\n settings.alt(k, v, ['rl', 'lr']);\n break;\n case 'line':\n var vals = v.split(','),\n vals0 = vals[0];\n settings.integer(k, vals0);\n if (settings.percent(k, vals0)) {\n settings.set('snapToLines', false);\n }\n settings.alt(k, vals0, ['auto']);\n if (vals.length === 2) {\n settings.alt('lineAlign', vals[1], ['start', center, 'end']);\n }\n break;\n case 'position':\n vals = v.split(',');\n settings.percent(k, vals[0]);\n if (vals.length === 2) {\n settings.alt('positionAlign', vals[1], ['start', center, 'end', 'line-left', 'line-right', 'auto']);\n }\n break;\n case 'size':\n settings.percent(k, v);\n break;\n case 'align':\n settings.alt(k, v, ['start', center, 'end', 'left', 'right']);\n break;\n }\n }, /:/, /\\s/);\n\n // Apply default values for any missing fields.\n cue.region = settings.get('region', null);\n cue.vertical = settings.get('vertical', '');\n var line = settings.get('line', 'auto');\n if (line === 'auto' && defaults.line === -1) {\n // set numeric line number for Safari\n line = -1;\n }\n cue.line = line;\n cue.lineAlign = settings.get('lineAlign', 'start');\n cue.snapToLines = settings.get('snapToLines', true);\n cue.size = settings.get('size', 100);\n cue.align = settings.get('align', center);\n var position = settings.get('position', 'auto');\n if (position === 'auto' && defaults.position === 50) {\n // set numeric position for Safari\n position = cue.align === 'start' || cue.align === 'left' ? 0 : cue.align === 'end' || cue.align === 'right' ? 100 : 50;\n }\n cue.position = position;\n }\n\n function skipWhitespace() {\n input = input.replace(/^\\s+/, '');\n }\n\n // 4.1 WebVTT cue timings.\n skipWhitespace();\n cue.startTime = consumeTimeStamp(); // (1) collect cue start time\n skipWhitespace();\n if (input.substr(0, 3) !== '-->') { // (3) next characters must match '-->'\n throw new Error('Malformed time stamp (time stamps must be separated by \\'-->\\'): ' +\n oInput);\n }\n input = input.substr(3);\n skipWhitespace();\n cue.endTime = consumeTimeStamp(); // (5) collect cue end time\n\n // 4.1 WebVTT cue settings list.\n skipWhitespace();\n consumeCueSettings(input, cue);\n}\n\nfunction fixLineBreaks(input) {\n return input.replace(/<br(?: \\/)?>/gi, '\\n');\n}\n\nVTTParser.prototype = {\n parse: function(data) {\n var self = this;\n\n // If there is no data then we won't decode it, but will just try to parse\n // whatever is in buffer already. This may occur in circumstances, for\n // example when flush() is called.\n if (data) {\n // Try to decode the data that we received.\n self.buffer += self.decoder.decode(data, {stream: true});\n }\n\n function collectNextLine() {\n var buffer = self.buffer;\n var pos = 0;\n\n buffer = fixLineBreaks(buffer);\n\n while (pos < buffer.length && buffer[pos] !== '\\r' && buffer[pos] !== '\\n') {\n ++pos;\n }\n var line = buffer.substr(0, pos);\n // Advance the buffer early in case we fail below.\n if (buffer[pos] === '\\r') {\n ++pos;\n }\n if (buffer[pos] === '\\n') {\n ++pos;\n }\n self.buffer = buffer.substr(pos);\n return line;\n }\n\n // 3.2 WebVTT metadata header syntax\n function parseHeader(input) {\n parseOptions(input, function(k, v) {\n switch (k) {\n case 'Region':\n // 3.3 WebVTT region metadata header syntax\n console.log('parse region', v);\n //parseRegion(v);\n break;\n }\n }, /:/);\n }\n\n // 5.1 WebVTT file parsing.\n try {\n var line;\n if (self.state === 'INITIAL') {\n // We can't start parsing until we have the first line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n line = collectNextLine();\n\n var m = line.match(/^WEBVTT([ \\t].*)?$/);\n if (!m || !m[0]) {\n throw new Error('Malformed WebVTT signature.');\n }\n\n self.state = 'HEADER';\n }\n\n var alreadyCollectedLine = false;\n while (self.buffer) {\n // We can't parse a line until we have the full line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n if (!alreadyCollectedLine) {\n line = collectNextLine();\n } else {\n alreadyCollectedLine = false;\n }\n\n switch (self.state) {\n case 'HEADER':\n // 13-18 - Allow a header (metadata) under the WEBVTT line.\n if (/:/.test(line)) {\n parseHeader(line);\n } else if (!line) {\n // An empty line terminates the header and starts the body (cues).\n self.state = 'ID';\n }\n continue;\n case 'NOTE':\n // Ignore NOTE blocks.\n if (!line) {\n self.state = 'ID';\n }\n continue;\n case 'ID':\n // Check for the start of NOTE blocks.\n if (/^NOTE($|[ \\t])/.test(line)) {\n self.state = 'NOTE';\n break;\n }\n // 19-29 - Allow any number of line terminators, then initialize new cue values.\n if (!line) {\n continue;\n }\n self.cue = new VTTCue(0, 0, '');\n self.state = 'CUE';\n // 30-39 - Check if self line contains an optional identifier or timing data.\n if (line.indexOf('-->') === -1) {\n self.cue.id = line;\n continue;\n }\n // Process line as start of a cue.\n /*falls through*/\n case 'CUE':\n // 40 - Collect cue timings and settings.\n try {\n parseCue(line, self.cue, self.regionList);\n } catch (e) {\n // In case of an error ignore rest of the cue.\n self.cue = null;\n self.state = 'BADCUE';\n continue;\n }\n self.state = 'CUETEXT';\n continue;\n case 'CUETEXT':\n var hasSubstring = line.indexOf('-->') !== -1;\n // 34 - If we have an empty line then report the cue.\n // 35 - If we have the special substring '-->' then report the cue,\n // but do not collect the line as we need to process the current\n // one as a new cue.\n if (!line || hasSubstring && (alreadyCollectedLine = true)) {\n // We are done parsing self cue.\n if (self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n self.state = 'ID';\n continue;\n }\n if (self.cue.text) {\n self.cue.text += '\\n';\n }\n self.cue.text += line;\n continue;\n case 'BADCUE': // BADCUE\n // 54-62 - Collect and discard the remaining cue.\n if (!line) {\n self.state = 'ID';\n }\n continue;\n }\n }\n } catch (e) {\n\n // If we are currently parsing a cue, report what we have.\n if (self.state === 'CUETEXT' && self.cue && self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n // Enter BADWEBVTT state if header was not parsed correctly otherwise\n // another exception occurred so enter BADCUE state.\n self.state = self.state === 'INITIAL' ? 'BADWEBVTT' : 'BADCUE';\n }\n return this;\n },\n flush: function() {\n var self = this;\n try {\n // Finish decoding the stream.\n self.buffer += self.decoder.decode();\n // Synthesize the end of the current cue or region.\n if (self.cue || self.state === 'HEADER') {\n self.buffer += '\\n\\n';\n self.parse();\n }\n // If we've flushed, parsed, and we're still on the INITIAL state then\n // that means we don't have enough of the stream to parse the first\n // line.\n if (self.state === 'INITIAL') {\n throw new Error('Malformed WebVTT signature.');\n }\n } catch (e) {\n throw e;\n }\n if (self.onflush) {\n self.onflush();\n }\n return this;\n }\n};\n\nexport { fixLineBreaks };\n\nexport default VTTParser;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/vttparser.js","import VTTParser from './vttparser';\n\n// String.prototype.startsWith is not supported in IE11\nconst startsWith = function(inputString, searchString, position) {\n return inputString.substr(position || 0, searchString.length) === searchString;\n};\n\nconst cueString2millis = function(timeString) {\n let ts = parseInt(timeString.substr(-3));\n let secs = parseInt(timeString.substr(-6,2));\n let mins = parseInt(timeString.substr(-9,2));\n let hours = timeString.length > 9 ? parseInt(timeString.substr(0, timeString.indexOf(':'))) : 0;\n\n if (isNaN(ts) || isNaN(secs) || isNaN(mins) || isNaN(hours)) {\n return -1;\n }\n\n ts += 1000 * secs;\n ts += 60*1000 * mins;\n ts += 60*60*1000 * hours;\n\n return ts;\n};\n\n// From https://github.com/darkskyapp/string-hash\nconst hash = function(text) {\n let hash = 5381;\n let i = text.length;\n while (i) {\n hash = (hash * 33) ^ text.charCodeAt(--i);\n }\n return (hash >>> 0).toString();\n};\n\nconst calculateOffset = function(vttCCs, cc, presentationTime) {\n let currCC = vttCCs[cc];\n let prevCC = vttCCs[currCC.prevCC];\n\n // This is the first discontinuity or cues have been processed since the last discontinuity\n // Offset = current discontinuity time\n if (!prevCC || (!prevCC.new && currCC.new)) {\n vttCCs.ccOffset = vttCCs.presentationOffset = currCC.start;\n currCC.new = false;\n return;\n }\n\n // There have been discontinuities since cues were last parsed.\n // Offset = time elapsed\n while (prevCC && prevCC.new) {\n vttCCs.ccOffset += currCC.start - prevCC.start;\n currCC.new = false;\n currCC = prevCC;\n prevCC = vttCCs[currCC.prevCC];\n }\n\n vttCCs.presentationOffset = presentationTime;\n};\n\nconst WebVTTParser = {\n parse: function(vttByteArray, syncPTS, vttCCs, cc, callBack, errorCallBack) {\n // Convert byteArray into string, replacing any somewhat exotic linefeeds with \"\\n\", then split on that character.\n let re = /\\r\\n|\\n\\r|\\n|\\r/g;\n let vttLines = String.fromCharCode.apply(null, new Uint8Array(vttByteArray)).trim().replace(re, '\\n').split('\\n');\n let cueTime = '00:00.000';\n let mpegTs = 0;\n let localTime = 0;\n let presentationTime = 0;\n let cues = [];\n let parsingError;\n let inHeader = true;\n // let VTTCue = VTTCue || window.TextTrackCue;\n\n // Create parser object using VTTCue with TextTrackCue fallback on certain browsers.\n let parser = new VTTParser();\n\n parser.oncue = function(cue) {\n // Adjust cue timing; clamp cues to start no earlier than - and drop cues that don't end after - 0 on timeline.\n let currCC = vttCCs[cc];\n let cueOffset = vttCCs.ccOffset;\n\n // Update offsets for new discontinuities\n if (currCC && currCC.new) {\n if (localTime !== undefined) {\n // When local time is provided, offset = discontinuity start time - local time\n cueOffset = vttCCs.ccOffset = currCC.start;\n } else {\n calculateOffset(vttCCs, cc, presentationTime);\n }\n }\n\n if (presentationTime) {\n // If we have MPEGTS, offset = presentation time + discontinuity offset\n cueOffset = presentationTime + vttCCs.ccOffset - vttCCs.presentationOffset;\n }\n\n cue.startTime += cueOffset - localTime;\n cue.endTime += cueOffset - localTime;\n\n // Create a unique hash id for a cue based on start/end times and text.\n // This helps timeline-controller to avoid showing repeated captions.\n cue.id = hash(cue.startTime) + hash(cue.endTime) + hash(cue.text);\n\n // Fix encoding of special characters. TODO: Test with all sorts of weird characters.\n cue.text = decodeURIComponent(escape(cue.text));\n if (cue.endTime > 0) {\n cues.push(cue);\n }\n };\n\n parser.onparsingerror = function(e) {\n parsingError = e;\n };\n\n parser.onflush = function() {\n if (parsingError && errorCallBack) {\n errorCallBack(parsingError);\n return;\n }\n callBack(cues);\n };\n\n // Go through contents line by line.\n vttLines.forEach(line => {\n if (inHeader) {\n // Look for X-TIMESTAMP-MAP in header.\n if (startsWith(line, 'X-TIMESTAMP-MAP=')) {\n // Once found, no more are allowed anyway, so stop searching.\n inHeader = false;\n // Extract LOCAL and MPEGTS.\n line.substr(16).split(',').forEach(timestamp => {\n if (startsWith(timestamp, 'LOCAL:')) {\n cueTime = timestamp.substr(6);\n } else if (startsWith(timestamp, 'MPEGTS:')) {\n mpegTs = parseInt(timestamp.substr(7));\n }\n });\n try {\n // Calculate subtitle offset in milliseconds.\n // If sync PTS is less than zero, we have a 33-bit wraparound, which is fixed by adding 2^33 = 8589934592.\n syncPTS = syncPTS < 0 ? syncPTS + 8589934592 : syncPTS;\n // Adjust MPEGTS by sync PTS.\n mpegTs -= syncPTS;\n // Convert cue time to seconds\n localTime = cueString2millis(cueTime) / 1000;\n // Convert MPEGTS to seconds from 90kHz.\n presentationTime = mpegTs / 90000;\n\n if (localTime === -1) {\n parsingError = new Error(`Malformed X-TIMESTAMP-MAP: ${line}`);\n }\n }\n catch(e) {\n parsingError = new Error(`Malformed X-TIMESTAMP-MAP: ${line}`);\n }\n // Return without parsing X-TIMESTAMP-MAP line.\n return;\n } else if (line === '') {\n inHeader = false;\n }\n }\n // Parse line by default.\n parser.parse(line+'\\n');\n });\n\n parser.flush();\n }\n};\n\n\nmodule.exports = WebVTTParser;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/webvtt-parser.js","/**\n * XHR based logger\n*/\n\nimport {logger} from '../utils/logger';\n\nclass XhrLoader {\n\n constructor(config) {\n if (config && config.xhrSetup) {\n this.xhrSetup = config.xhrSetup;\n }\n }\n\n destroy() {\n this.abort();\n this.loader = null;\n }\n\n 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 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 loadInternal() {\n var xhr, 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 let stats = this.stats;\n stats.tfirst = 0;\n stats.loaded = 0;\n const xhrSetup = this.xhrSetup;\n\n try {\n if (xhrSetup) {\n try {\n xhrSetup(xhr, context.url);\n } catch (e) {\n // fix xhrSetup: (xhr, url) => {xhr.setRequestHeader(\"Content-Language\", \"test\");}\n // not working, as xhr.setRequestHeader expects xhr.readyState === OPEN\n xhr.open('GET', context.url, true);\n xhrSetup(xhr, context.url);\n }\n }\n if (!xhr.readyState) {\n xhr.open('GET', context.url, true);\n }\n } catch (e) {\n // IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS\n this.callbacks.onError({ code : xhr.status, text: e.message }, context);\n return;\n }\n\n if (context.rangeEnd) {\n xhr.setRequestHeader('Range','bytes=' + context.rangeStart + '-' + (context.rangeEnd-1));\n }\n xhr.onreadystatechange = this.readystatechange.bind(this);\n xhr.onprogress = this.loadprogress.bind(this);\n xhr.responseType = context.responseType;\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 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 // >= HEADERS_RECEIVED\n if (readyState >=2) {\n // clear xhr timeout and rearm it if readyState less than 4\n window.clearTimeout(this.requestTimeout);\n if (stats.tfirst === 0) {\n stats.tfirst = Math.max(performance.now(), stats.trequest);\n }\n if (readyState === 4) {\n let 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 let data,len;\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 let 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.error(`${status} while loading ${context.url}` );\n this.callbacks.onError({ code : status, text : xhr.statusText}, context);\n } else {\n // retry\n 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 } else {\n // readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout);\n }\n }\n }\n\n loadtimeout() {\n logger.warn(`timeout while loading ${this.context.url}` );\n this.callbacks.onTimeout(this.stats, this.context);\n }\n\n loadprogress(event) {\n var stats = this.stats;\n stats.loaded = event.loaded;\n if (event.lengthComputable) {\n stats.total = event.total;\n }\n let 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\nexport default XhrLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/xhr-loader.js","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"shaka-player\"), require(\"playkit-js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"shaka-player\", \"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsDash\"] = factory(require(\"shaka-player\"), require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsDash\"] = factory(root[\"shaka\"], root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///dash/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 37792bb50222e2c929fb\n\n\n// WEBPACK FOOTER //\n// webpack:/dash/webpack/bootstrap 37792bb50222e2c929fb","// @flow\nimport shaka from 'shaka-player';\nimport {registerMediaSourceAdapter, BaseMediaSourceAdapter} from 'playkit-js'\nimport {Track, VideoTrack, AudioTrack, TextTrack} from 'playkit-js'\n\n/**\n * Adapter of shaka lib for dash content\n * @classdesc\n */\nexport default class DashAdapter extends BaseMediaSourceAdapter {\n /**\n * The id of Adapter\n * @member {string} id\n * @static\n * @public\n */\n static id = 'DashAdapter';\n /**\n * The adapter logger\n * @member {any} _logger\n * @private\n * @static\n */\n static _logger = BaseMediaSourceAdapter.getLogger(DashAdapter.id);\n /**\n * The supported mime type by the dash adapter\n * @member {string} _dashMimeType\n * @static\n * @private\n */\n static _dashMimeType = 'application/dash+xml';\n /**\n * The shaka player instance\n * @member {any} _shaka\n * @private\n */\n _shaka: any;\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n _loadPromise: ?Promise<Object>;\n\n /**\n * Checks if dash adapter can play a given mime type\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @returns {boolean} - Whether the dash adapter can play a specific mime type\n * @static\n */\n static canPlayType(mimeType: string): boolean {\n let canPlayType = typeof mimeType === 'string' ? mimeType.toLowerCase() === DashAdapter._dashMimeType : false;\n DashAdapter._logger.debug('canPlayType result for mimeType: ' + mimeType + ' is ' + canPlayType.toString());\n return canPlayType;\n }\n\n /**\n * Checks if the dash adapter is supported\n * @function isSupported\n * @returns {boolean} - Whether dash is supported.\n * @static\n */\n static isSupported(): boolean {\n shaka.polyfill.installAll();\n let isSupported = shaka.Player.isBrowserSupported();\n DashAdapter._logger.debug('isSupported:' + isSupported);\n return isSupported;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to the dash adapter\n * @param {Object} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n constructor(videoElement: HTMLVideoElement, source: Object, config: Object = {}) {\n DashAdapter._logger.debug('Creating adapter. Shaka version: ' + shaka.Player.version);\n super(videoElement, source, config);\n this._shaka = new shaka.Player(videoElement);\n this._shaka.configure(config);\n this._addBindings();\n }\n\n /**\n * Add the required bindings to shaka.\n * @function _addBindings\n * @private\n * @returns {void}\n */\n _addBindings(): void {\n this._shaka.addEventListener('adaptation', this._onAdaptation.bind(this));\n this._shaka.addEventListener('error', this._onError.bind(this));\n }\n\n /**\n * Remove the bindings to shaka.\n * @function _removeBindings\n * @private\n * @returns {void}\n */\n _removeBindings(): void {\n this._shaka.removeEventListener('adaptation', this._onAdaptation);\n this._shaka.removeEventListener('error', this._onError);\n }\n\n /**\n * Load the video source\n * @function load\n * @override\n */\n load(): Promise<Object> {\n if (!this._loadPromise) {\n this._loadPromise = new Promise((resolve, reject) => {\n if (this._sourceObj && this._sourceObj.url) {\n this._shaka.load(this._sourceObj.url).then(() => {\n let data = {tracks: this._getParsedTracks()};\n DashAdapter._logger.debug('The source has been loaded successfully');\n resolve(data);\n }).catch((error) => {\n reject(error);\n this._onError(error);\n });\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroying the dash adapter\n * @function destroy\n * @override\n */\n destroy(): void {\n DashAdapter._logger.debug('destroy');\n super.destroy();\n this._loadPromise = null;\n this._removeBindings();\n this._shaka.destroy();\n }\n\n /**\n * Get the original video tracks\n * @function _getVideoTracks\n * @returns {Array<Object>} - The original video tracks\n * @private\n */\n _getVideoTracks(): Array<Object> {\n let variantTracks = this._shaka.getVariantTracks();\n let activeVariantTrack = variantTracks.filter((variantTrack) => {\n return variantTrack.active;\n })[0];\n let videoTracks = variantTracks.filter((variantTrack) => {\n return variantTrack.audioId === activeVariantTrack.audioId;\n });\n return videoTracks;\n }\n\n /**\n * Get the original audio tracks\n * @function _getAudioTracks\n * @returns {Array<Object>} - The original audio tracks\n * @private\n */\n _getAudioTracks(): Array<Object> {\n let variantTracks = this._shaka.getVariantTracks();\n let activeVariantTrack = variantTracks.filter((variantTrack) => {\n return variantTrack.active;\n })[0];\n let audioTracks = variantTracks.filter((variantTrack) => {\n return variantTrack.videoId === activeVariantTrack.videoId;\n });\n return audioTracks;\n }\n\n /**\n * Get the parsed tracks\n * @function _getParsedTracks\n * @returns {Array<Track>} - The parsed tracks\n * @private\n */\n _getParsedTracks(): Array<Track> {\n let videoTracks = this._getParsedVideoTracks();\n let audioTracks = this._getParsedAudioTracks();\n let textTracks = this._getParsedTextTracks();\n return videoTracks.concat(audioTracks).concat(textTracks);\n }\n\n /**\n * Get the parsed video tracks\n * @function _getParsedVideoTracks\n * @returns {Array<VideoTrack>} - The parsed video tracks\n * @private\n */\n _getParsedVideoTracks(): Array<VideoTrack> {\n let videoTracks = this._getVideoTracks();\n let parsedTracks = [];\n if (videoTracks) {\n for (let i = 0; i < videoTracks.length; i++) {\n let settings = {\n id: videoTracks[i].id,\n bandwidth: videoTracks[i].bandwidth,\n active: videoTracks[i].active,\n label: videoTracks[i].label,\n index: i\n };\n parsedTracks.push(new VideoTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed audio tracks\n * @function _getParsedAudioTracks\n * @returns {Array<AudioTrack>} - The parsed audio tracks\n * @private\n */\n _getParsedAudioTracks(): Array<AudioTrack> {\n let audioTracks = this._getAudioTracks();\n let parsedTracks = [];\n if (audioTracks) {\n for (let i = 0; i < audioTracks.length; i++) {\n let settings = {\n id: audioTracks[i].id,\n active: audioTracks[i].active,\n label: audioTracks[i].label,\n language: audioTracks[i].language,\n index: i\n };\n parsedTracks.push(new AudioTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed text tracks\n * @function _getParsedTextTracks\n * @returns {Array<TextTrack>} - The parsed text tracks\n * @private\n */\n _getParsedTextTracks(): Array<TextTrack> {\n let textTracks = this._shaka.getTextTracks();\n let parsedTracks = [];\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n let settings = {\n kind: textTracks[i].kind ? textTracks[i].kind + 's' : \"\",\n active: textTracks[i].active,\n label: textTracks[i].label,\n language: textTracks[i].language,\n index: i\n };\n parsedTracks.push(new TextTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Select a video track\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the video track to select\n * @returns {void}\n * @public\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n let videoTracks = this._getVideoTracks();\n if ((videoTrack instanceof VideoTrack) && videoTracks) {\n let selectedVideoTrack = videoTracks[videoTrack.index];\n if (selectedVideoTrack) {\n this._shaka.configure({abr:{enabled: false}});\n if (!selectedVideoTrack.active) {\n this._shaka.selectVariantTrack(videoTracks[videoTrack.index], true);\n this._onTrackChanged(videoTrack);\n }\n }\n }\n }\n\n /**\n * Select an audio track\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select\n * @returns {void}\n * @public\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n if ((audioTrack instanceof AudioTrack) && !audioTrack.active) {\n this._shaka.selectAudioLanguage(audioTrack.language);\n this._onTrackChanged(audioTrack);\n }\n }\n\n /**\n * Select a text track\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select\n * @returns {void}\n * @public\n */\n selectTextTrack(textTrack: TextTrack): void {\n if ((textTrack instanceof TextTrack) && !textTrack.active && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions')) {\n this._shaka.selectTextLanguage(textTrack.language);\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Enables adaptive bitrate switching\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n this._shaka.configure({abr:{enabled: true}});\n }\n\n /**\n * An handler to shaka adaptation event\n * @function _onAdaptation\n * @returns {void}\n * @private\n */\n _onAdaptation(): void {\n let selectedVideoTrack = this._getParsedVideoTracks().filter(function (videoTrack) {\n return videoTrack.active;\n })[0];\n this._onTrackChanged(selectedVideoTrack);\n }\n\n /**\n * An handler to shaka error event\n * @function _onError\n * @param {any} error - the error\n * @returns {void}\n * @private\n */\n _onError(error: any): void {\n DashAdapter._logger.error(error);\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * In case the adapter preformed a load it will return the manifest url.\n * @public\n * @returns {string} - The src url.\n */\n get src(): string {\n if (this._loadPromise && this._sourceObj) {\n return this._sourceObj.url;\n }\n return \"\";\n }\n}\n\n// Register DashAdapter to the media source adapter manager\nif (DashAdapter.isSupported()) {\n registerMediaSourceAdapter(DashAdapter);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./dash-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///dash/dash-adapter.js","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"shaka-player\",\"commonjs2\":\"shaka-player\",\"amd\":\"shaka-player\",\"root\":\"shaka\"}\n// module id = 1\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/dash/external {\"commonjs\":\"shaka-player\",\"commonjs2\":\"shaka-player\",\"amd\":\"shaka-player\",\"root\":\"shaka\"}","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}\n// module id = 2\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/dash/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","// Copyright 2006 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Bootstrap for the Google JS Library (Closure).\n *\n * In uncompiled mode base.js will write out Closure's deps file, unless the\n * global <code>CLOSURE_NO_DEPS</code> is set to true. This allows projects to\n * include their own deps file(s) from different locations.\n *\n *\n * @provideGoog\n */\n\n\n/**\n * @define {boolean} Overridden to true by the compiler when --closure_pass\n * or --mark_as_compiled is specified.\n */\nvar COMPILED = false;\n\n\n/**\n * Base namespace for the Closure library. Checks to see goog is already\n * defined in the current scope before assigning to prevent clobbering if\n * base.js is loaded more than once.\n *\n * @const\n */\nvar goog = goog || {};\n\n\n/**\n * Reference to the global context. In most cases this will be 'window'.\n */\ngoog.global = this;\n\n\n/**\n * A hook for overriding the define values in uncompiled mode.\n *\n * In uncompiled mode, {@code CLOSURE_UNCOMPILED_DEFINES} may be defined before\n * loading base.js. If a key is defined in {@code CLOSURE_UNCOMPILED_DEFINES},\n * {@code goog.define} will use the value instead of the default value. This\n * allows flags to be overwritten without compilation (this is normally\n * accomplished with the compiler's \"define\" flag).\n *\n * Example:\n * <pre>\n * var CLOSURE_UNCOMPILED_DEFINES = {'goog.DEBUG': false};\n * </pre>\n *\n * @type {Object.<string, (string|number|boolean)>|undefined}\n */\ngoog.global.CLOSURE_UNCOMPILED_DEFINES;\n\n\n/**\n * A hook for overriding the define values in uncompiled or compiled mode,\n * like CLOSURE_UNCOMPILED_DEFINES but effective in compiled code. In\n * uncompiled code CLOSURE_UNCOMPILED_DEFINES takes precedence.\n *\n * Also unlike CLOSURE_UNCOMPILED_DEFINES the values must be number, boolean or\n * string literals or the compiler will emit an error.\n *\n * While any @define value may be set, only those set with goog.define will be\n * effective for uncompiled code.\n *\n * Example:\n * <pre>\n * var CLOSURE_DEFINES = {'goog.DEBUG': false};\n * </pre>\n *\n * @type {Object.<string, (string|number|boolean)>|undefined}\n */\ngoog.global.CLOSURE_DEFINES;\n\n\n/**\n * Returns true if the specified value is not undefined.\n * WARNING: Do not use this to test if an object has a property. Use the in\n * operator instead.\n *\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is defined.\n */\ngoog.isDef = function(val) {\n // void 0 always evaluates to undefined and hence we do not need to depend on\n // the definition of the global variable named 'undefined'.\n return val !== void 0;\n};\n\n\n/**\n * Builds an object structure for the provided namespace path, ensuring that\n * names that already exist are not overwritten. For example:\n * \"a.b.c\" -> a = {};a.b={};a.b.c={};\n * Used by goog.provide and goog.exportSymbol.\n * @param {string} name name of the object that this file defines.\n * @param {*=} opt_object the object to expose at the end of the path.\n * @param {Object=} opt_objectToExportTo The object to add the path to; default\n * is |goog.global|.\n * @private\n */\ngoog.exportPath_ = function(name, opt_object, opt_objectToExportTo) {\n var parts = name.split('.');\n var cur = opt_objectToExportTo || goog.global;\n\n // Internet Explorer exhibits strange behavior when throwing errors from\n // methods externed in this manner. See the testExportSymbolExceptions in\n // base_test.html for an example.\n if (!(parts[0] in cur) && cur.execScript) {\n cur.execScript('var ' + parts[0]);\n }\n\n // Certain browsers cannot parse code in the form for((a in b); c;);\n // This pattern is produced by the JSCompiler when it collapses the\n // statement above into the conditional loop below. To prevent this from\n // happening, use a for-loop and reserve the init logic as below.\n\n // Parentheses added to eliminate strict JS warning in Firefox.\n for (var part; parts.length && (part = parts.shift());) {\n if (!parts.length && goog.isDef(opt_object)) {\n // last part and we have an object; use it\n cur[part] = opt_object;\n } else if (cur[part]) {\n cur = cur[part];\n } else {\n cur = cur[part] = {};\n }\n }\n};\n\n\n/**\n * Defines a named value. In uncompiled mode, the value is retreived from\n * CLOSURE_DEFINES or CLOSURE_UNCOMPILED_DEFINES if the object is defined and\n * has the property specified, and otherwise used the defined defaultValue.\n * When compiled, the default can be overridden using compiler command-line\n * options.\n *\n * @param {string} name The distinguished name to provide.\n * @param {string|number|boolean} defaultValue\n */\ngoog.define = function(name, defaultValue) {\n var value = defaultValue;\n if (!COMPILED) {\n if (goog.global.CLOSURE_UNCOMPILED_DEFINES &&\n Object.prototype.hasOwnProperty.call(\n goog.global.CLOSURE_UNCOMPILED_DEFINES, name)) {\n value = goog.global.CLOSURE_UNCOMPILED_DEFINES[name];\n } else if (goog.global.CLOSURE_DEFINES &&\n Object.prototype.hasOwnProperty.call(\n goog.global.CLOSURE_DEFINES, name)) {\n value = goog.global.CLOSURE_DEFINES[name];\n }\n }\n goog.exportPath_(name, value);\n};\n\n\n/**\n * @define {boolean} DEBUG is provided as a convenience so that debugging code\n * that should not be included in a production js_binary can be easily stripped\n * by specifying --define goog.DEBUG=false to the JSCompiler. For example, most\n * toString() methods should be declared inside an \"if (goog.DEBUG)\" conditional\n * because they are generally used for debugging purposes and it is difficult\n * for the JSCompiler to statically determine whether they are used.\n */\ngoog.DEBUG = true;\n\n\n/**\n * @define {string} LOCALE defines the locale being used for compilation. It is\n * used to select locale specific data to be compiled in js binary. BUILD rule\n * can specify this value by \"--define goog.LOCALE=<locale_name>\" as JSCompiler\n * option.\n *\n * Take into account that the locale code format is important. You should use\n * the canonical Unicode format with hyphen as a delimiter. Language must be\n * lowercase, Language Script - Capitalized, Region - UPPERCASE.\n * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN.\n *\n * See more info about locale codes here:\n * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers\n *\n * For language codes you should use values defined by ISO 693-1. See it here\n * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from\n * this rule: the Hebrew language. For legacy reasons the old code (iw) should\n * be used instead of the new code (he), see http://wiki/Main/IIISynonyms.\n */\ngoog.define('goog.LOCALE', 'en'); // default to en\n\n\n/**\n * @define {boolean} Whether this code is running on trusted sites.\n *\n * On untrusted sites, several native functions can be defined or overridden by\n * external libraries like Prototype, Datejs, and JQuery and setting this flag\n * to false forces closure to use its own implementations when possible.\n *\n * If your JavaScript can be loaded by a third party site and you are wary about\n * relying on non-standard implementations, specify\n * \"--define goog.TRUSTED_SITE=false\" to the JSCompiler.\n */\ngoog.define('goog.TRUSTED_SITE', true);\n\n\n/**\n * @define {boolean} Whether a project is expected to be running in strict mode.\n *\n * This define can be used to trigger alternate implementations compatible with\n * running in EcmaScript Strict mode or warn about unavailable functionality.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode\n */\ngoog.define('goog.STRICT_MODE_COMPATIBLE', false);\n\n\n/**\n * Creates object stubs for a namespace. The presence of one or more\n * goog.provide() calls indicate that the file defines the given\n * objects/namespaces. Provided objects must not be null or undefined.\n * Build tools also scan for provide/require statements\n * to discern dependencies, build dependency files (see deps.js), etc.\n * @see goog.require\n * @param {string} name Namespace provided by this file in the form\n * \"goog.package.part\".\n */\ngoog.provide = function(name) {\n if (!COMPILED) {\n // Ensure that the same namespace isn't provided twice.\n // A goog.module/goog.provide maps a goog.require to a specific file\n if (goog.isProvided_(name)) {\n throw Error('Namespace \"' + name + '\" already declared.');\n }\n delete goog.implicitNamespaces_[name];\n\n var namespace = name;\n while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) {\n if (goog.getObjectByName(namespace)) {\n break;\n }\n goog.implicitNamespaces_[namespace] = true;\n }\n }\n\n goog.exportPath_(name);\n};\n\n\n/**\n * Forward declares a symbol. This is an indication to the compiler that the\n * symbol may be used in the source yet is not required and may not be provided\n * in compilation.\n *\n * The most common usage of forward declaration is code that takes a type as a\n * function parameter but does not need to require it. By forward declaring\n * instead of requiring, no hard dependency is made, and (if not required\n * elsewhere) the namespace may never be required and thus, not be pulled\n * into the JavaScript binary. If it is required elsewhere, it will be type\n * checked as normal.\n *\n *\n * @param {string} name The namespace to forward declare in the form of\n * \"goog.package.part\".\n */\ngoog.forwardDeclare = function(name) {};\n\n\nif (!COMPILED) {\n\n /**\n * Check if the given name has been goog.provided. This will return false for\n * names that are available only as implicit namespaces.\n * @param {string} name name of the object to look for.\n * @return {boolean} Whether the name has been provided.\n * @private\n */\n goog.isProvided_ = function(name) {\n return (!goog.implicitNamespaces_[name] &&\n goog.isDefAndNotNull(goog.getObjectByName(name)));\n };\n\n /**\n * Namespaces implicitly defined by goog.provide. For example,\n * goog.provide('goog.events.Event') implicitly declares that 'goog' and\n * 'goog.events' must be namespaces.\n *\n * @type {Object.<string, (boolean|undefined)>}\n * @private\n */\n goog.implicitNamespaces_ = {};\n}\n\n\n/**\n * Returns an object based on its fully qualified external name. The object\n * is not found if null or undefined. If you are using a compilation pass that\n * renames property names beware that using this function will not find renamed\n * properties.\n *\n * @param {string} name The fully qualified name.\n * @param {Object=} opt_obj The object within which to look; default is\n * |goog.global|.\n * @return {?} The value (object or primitive) or, if not found, null.\n */\ngoog.getObjectByName = function(name, opt_obj) {\n var parts = name.split('.');\n var cur = opt_obj || goog.global;\n for (var part; part = parts.shift(); ) {\n if (goog.isDefAndNotNull(cur[part])) {\n cur = cur[part];\n } else {\n return null;\n }\n }\n return cur;\n};\n\n\n/**\n * Globalizes a whole namespace, such as goog or goog.lang.\n *\n * @param {Object} obj The namespace to globalize.\n * @param {Object=} opt_global The object to add the properties to.\n * @deprecated Properties may be explicitly exported to the global scope, but\n * this should no longer be done in bulk.\n */\ngoog.globalize = function(obj, opt_global) {\n var global = opt_global || goog.global;\n for (var x in obj) {\n global[x] = obj[x];\n }\n};\n\n\n/**\n * Adds a dependency from a file to the files it requires.\n * @param {string} relPath The path to the js file.\n * @param {Array} provides An array of strings with the names of the objects\n * this file provides.\n * @param {Array} requires An array of strings with the names of the objects\n * this file requires.\n */\ngoog.addDependency = function(relPath, provides, requires) {\n if (goog.DEPENDENCIES_ENABLED) {\n var provide, require;\n var path = relPath.replace(/\\\\/g, '/');\n var deps = goog.dependencies_;\n for (var i = 0; provide = provides[i]; i++) {\n deps.nameToPath[provide] = path;\n }\n for (var j = 0; require = requires[j]; j++) {\n if (!(path in deps.requires)) {\n deps.requires[path] = {};\n }\n deps.requires[path][require] = true;\n }\n }\n};\n\n\n\n\n// NOTE(nnaze): The debug DOM loader was included in base.js as an original way\n// to do \"debug-mode\" development. The dependency system can sometimes be\n// confusing, as can the debug DOM loader's asynchronous nature.\n//\n// With the DOM loader, a call to goog.require() is not blocking -- the script\n// will not load until some point after the current script. If a namespace is\n// needed at runtime, it needs to be defined in a previous script, or loaded via\n// require() with its registered dependencies.\n// User-defined namespaces may need their own deps file. See http://go/js_deps,\n// http://go/genjsdeps, or, externally, DepsWriter.\n// https://developers.google.com/closure/library/docs/depswriter\n//\n// Because of legacy clients, the DOM loader can't be easily removed from\n// base.js. Work is being done to make it disableable or replaceable for\n// different environments (DOM-less JavaScript interpreters like Rhino or V8,\n// for example). See bootstrap/ for more information.\n\n\n/**\n * @define {boolean} Whether to enable the debug loader.\n *\n * If enabled, a call to goog.require() will attempt to load the namespace by\n * appending a script tag to the DOM (if the namespace has been registered).\n *\n * If disabled, goog.require() will simply assert that the namespace has been\n * provided (and depend on the fact that some outside tool correctly ordered\n * the script).\n */\ngoog.define('goog.ENABLE_DEBUG_LOADER', true);\n\n\n/**\n * @param {string} msg\n * @private\n */\ngoog.logToConsole_ = function(msg) {\n if (goog.global.console) {\n goog.global.console['error'](msg);\n }\n};\n\n\n/**\n * Implements a system for the dynamic resolution of dependencies that works in\n * parallel with the BUILD system. Note that all calls to goog.require will be\n * stripped by the JSCompiler when the --closure_pass option is used.\n * @see goog.provide\n * @param {string} name Namespace to include (as was given in goog.provide()) in\n * the form \"goog.package.part\".\n * @return {?} If called within a goog.module file, the associated namespace or\n * module otherwise null.\n */\ngoog.require = function(name) {\n\n // If the object already exists we do not need do do anything.\n if (!COMPILED) {\n if (goog.isProvided_(name)) {\n return null;\n }\n\n if (goog.ENABLE_DEBUG_LOADER) {\n var path = goog.getPathFromDeps_(name);\n if (path) {\n goog.included_[path] = true;\n goog.writeScripts_();\n return null;\n }\n }\n\n var errorMessage = 'goog.require could not find: ' + name;\n goog.logToConsole_(errorMessage);\n\n throw Error(errorMessage);\n }\n};\n\n\n/**\n * Path for included scripts.\n * @type {string}\n */\ngoog.basePath = '';\n\n\n/**\n * A hook for overriding the base path.\n * @type {string|undefined}\n */\ngoog.global.CLOSURE_BASE_PATH;\n\n\n/**\n * Whether to load Closure's deps file automatically.\n * Shaka sets this to true since we are placing deps.js in a non-standard\n * location. Running Shaka in uncompiled mode will require loading deps.js\n * explicitly.\n * @type {boolean|undefined}\n */\ngoog.global.CLOSURE_NO_DEPS = true;\n\n\n/**\n * A function to import a single script. This is meant to be overridden when\n * Closure is being run in non-HTML contexts, such as web workers. It's defined\n * in the global scope so that it can be set before base.js is loaded, which\n * allows deps.js to be imported properly.\n *\n * The function is passed the script source, which is a relative URI. It should\n * return true if the script was imported, false otherwise.\n * @type {(function(string): boolean)|undefined}\n */\ngoog.global.CLOSURE_IMPORT_SCRIPT;\n\n\n/**\n * True if goog.dependencies_ is available.\n * @const {boolean}\n */\ngoog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;\n\n\nif (goog.DEPENDENCIES_ENABLED) {\n /**\n * Object used to keep track of urls that have already been added. This record\n * allows the prevention of circular dependencies.\n * @type {Object}\n * @private\n */\n goog.included_ = {};\n\n\n /**\n * This object is used to keep track of dependencies and other data that is\n * used for loading scripts.\n * @private\n * @type {Object}\n */\n goog.dependencies_ = {\n nameToPath: {}, // many to 1\n requires: {}, // 1 to many\n // Used when resolving dependencies to prevent us from visiting file twice.\n visited: {},\n written: {} // Used to keep track of script files we have written.\n };\n\n\n /**\n * Tries to detect whether is in the context of an HTML document.\n * @return {boolean} True if it looks like HTML document.\n * @private\n */\n goog.inHtmlDocument_ = function() {\n var doc = goog.global.document;\n return typeof doc != 'undefined' &&\n 'write' in doc; // XULDocument misses write.\n };\n\n\n /**\n * Tries to detect the base path of base.js script that bootstraps Closure.\n * @private\n */\n goog.findBasePath_ = function() {\n if (goog.global.CLOSURE_BASE_PATH) {\n goog.basePath = goog.global.CLOSURE_BASE_PATH;\n return;\n } else if (!goog.inHtmlDocument_()) {\n return;\n }\n var doc = goog.global.document;\n var scripts = doc.getElementsByTagName('script');\n // Search backwards since the current script is in almost all cases the one\n // that has base.js.\n for (var i = scripts.length - 1; i >= 0; --i) {\n var src = scripts[i].src;\n var qmark = src.lastIndexOf('?');\n var l = qmark == -1 ? src.length : qmark;\n if (src.substr(l - 7, 7) == 'base.js') {\n goog.basePath = src.substr(0, l - 7);\n return;\n }\n }\n };\n\n\n /**\n * Imports a script if, and only if, that script hasn't already been imported.\n * (Must be called at execution time)\n * @param {string} src Script source.\n * @param {string=} opt_sourceText The optionally source text to evaluate\n * @private\n */\n goog.importScript_ = function(src, opt_sourceText) {\n var importScript = goog.global.CLOSURE_IMPORT_SCRIPT ||\n goog.writeScriptTag_;\n if (importScript(src, opt_sourceText)) {\n goog.dependencies_.written[src] = true;\n }\n };\n\n\n /**\n * The default implementation of the import function. Writes a script tag to\n * import the script.\n *\n * @param {string} src The script url.\n * @param {string=} opt_sourceText The optionally source text to evaluate\n * @return {boolean} True if the script was imported, false otherwise.\n * @private\n */\n goog.writeScriptTag_ = function(src, opt_sourceText) {\n if (goog.inHtmlDocument_()) {\n var doc = goog.global.document;\n\n // If the user tries to require a new symbol after document load,\n // something has gone terribly wrong. Doing a document.write would\n // wipe out the page.\n if (doc.readyState == 'complete') {\n // Certain test frameworks load base.js multiple times, which tries\n // to write deps.js each time. If that happens, just fail silently.\n // These frameworks wipe the page between each load of base.js, so this\n // is OK.\n var isDeps = /\\bdeps.js$/.test(src);\n if (isDeps) {\n return false;\n } else {\n throw Error('Cannot write \"' + src + '\" after document load');\n }\n }\n\n if (opt_sourceText === undefined) {\n doc.write(\n '<script type=\"text/javascript\" src=\"' +\n src + '\"></' + 'script>');\n } else {\n doc.write(\n '<script type=\"text/javascript\">' +\n opt_sourceText + '</' + 'script>');\n }\n return true;\n } else {\n return false;\n }\n };\n\n\n /**\n * Resolves dependencies based on the dependencies added using addDependency\n * and calls importScript_ in the correct order.\n * @private\n */\n goog.writeScripts_ = function() {\n // The scripts we need to write this time.\n var scripts = [];\n var seenScript = {};\n var deps = goog.dependencies_;\n\n function visitNode(path) {\n if (path in deps.written) {\n return;\n }\n\n // We have already visited this one. We can get here if we have cyclic\n // dependencies.\n if (path in deps.visited) {\n if (!(path in seenScript)) {\n seenScript[path] = true;\n scripts.push(path);\n }\n return;\n }\n\n deps.visited[path] = true;\n\n if (path in deps.requires) {\n for (var requireName in deps.requires[path]) {\n // If the required name is defined, we assume that it was already\n // bootstrapped by other means.\n if (!goog.isProvided_(requireName)) {\n if (requireName in deps.nameToPath) {\n visitNode(deps.nameToPath[requireName]);\n } else {\n throw Error('Undefined nameToPath for ' + requireName);\n }\n }\n }\n }\n\n if (!(path in seenScript)) {\n seenScript[path] = true;\n scripts.push(path);\n }\n }\n\n for (var path in goog.included_) {\n if (!deps.written[path]) {\n visitNode(path);\n }\n }\n\n // record that we are going to load all these scripts.\n for (var i = 0; i < scripts.length; i++) {\n var path = scripts[i];\n goog.dependencies_.written[path] = true;\n }\n\n for (var i = 0; i < scripts.length; i++) {\n var path = scripts[i];\n if (path) {\n goog.importScript_(goog.basePath + path);\n }\n }\n };\n\n\n /**\n * Looks at the dependency rules and tries to determine the script file that\n * fulfills a particular rule.\n * @param {string} rule In the form goog.namespace.Class or project.script.\n * @return {?string} Url corresponding to the rule, or null.\n * @private\n */\n goog.getPathFromDeps_ = function(rule) {\n if (rule in goog.dependencies_.nameToPath) {\n return goog.dependencies_.nameToPath[rule];\n } else {\n return null;\n }\n };\n\n goog.findBasePath_();\n\n // Allow projects to manage the deps files themselves.\n if (!goog.global.CLOSURE_NO_DEPS) {\n goog.importScript_(goog.basePath + 'deps.js');\n }\n}\n\n\n\n//==============================================================================\n// Language Enhancements\n//==============================================================================\n\n\n/**\n * Returns true if the specified value is defined and not null.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is defined and not null.\n */\ngoog.isDefAndNotNull = function(val) {\n // Note that undefined == null.\n return val != null;\n};\n\n\n/**\n * Returns true if the specified value is a string.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is a string.\n */\ngoog.isString = function(val) {\n return typeof val == 'string';\n};\n\n\n/**\n * Exposes an unobfuscated global namespace path for the given object.\n * Note that fields of the exported object *will* be obfuscated, unless they are\n * exported in turn via this function or goog.exportProperty.\n *\n * Also handy for making public items that are defined in anonymous closures.\n *\n * ex. goog.exportSymbol('public.path.Foo', Foo);\n *\n * ex. goog.exportSymbol('public.path.Foo.staticFunction', Foo.staticFunction);\n * public.path.Foo.staticFunction();\n *\n * ex. goog.exportSymbol('public.path.Foo.prototype.myMethod',\n * Foo.prototype.myMethod);\n * new public.path.Foo().myMethod();\n *\n * @param {string} publicPath Unobfuscated name to export.\n * @param {*} object Object the name should point to.\n * @param {Object=} opt_objectToExportTo The object to add the path to; default\n * is goog.global.\n */\ngoog.exportSymbol = function(publicPath, object, opt_objectToExportTo) {\n goog.exportPath_(publicPath, object, opt_objectToExportTo);\n};\n\n\n/**\n * Exports a property unobfuscated into the object's namespace.\n * ex. goog.exportProperty(Foo, 'staticFunction', Foo.staticFunction);\n * ex. goog.exportProperty(Foo.prototype, 'myMethod', Foo.prototype.myMethod);\n * @param {Object} object Object whose static property is being exported.\n * @param {string} publicName Unobfuscated name to export.\n * @param {*} symbol Object the name should point to.\n */\ngoog.exportProperty = function(object, publicName, symbol) {\n object[publicName] = symbol;\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * Usage:\n * <pre>\n * function ParentClass(a, b) { }\n * ParentClass.prototype.foo = function(a) { };\n *\n * function ChildClass(a, b, c) {\n * ChildClass.base(this, 'constructor', a, b);\n * }\n * goog.inherits(ChildClass, ParentClass);\n *\n * var child = new ChildClass('a', 'b', 'see');\n * child.foo(); // This works.\n * </pre>\n *\n * @param {Function} childCtor Child class.\n * @param {Function} parentCtor Parent class.\n */\ngoog.inherits = function(childCtor, parentCtor) {\n /** @constructor */\n function tempCtor() {}\n tempCtor.prototype = parentCtor.prototype;\n childCtor.superClass_ = parentCtor.prototype;\n childCtor.prototype = new tempCtor();\n /** @override */\n childCtor.prototype.constructor = childCtor;\n\n /**\n * Calls superclass constructor/method.\n *\n * This function is only available if you use goog.inherits to\n * express inheritance relationships between classes.\n *\n * NOTE: This is a replacement for goog.base and for superClass_\n * property defined in childCtor.\n *\n * @param {!Object} me Should always be \"this\".\n * @param {string} methodName The method name to call. Calling\n * superclass constructor can be done with the special string\n * 'constructor'.\n * @param {...*} var_args The arguments to pass to superclass\n * method/constructor.\n * @return {*} The return value of the superclass method/constructor.\n */\n childCtor.base = function(me, methodName, var_args) {\n var args = Array.prototype.slice.call(arguments, 2);\n return parentCtor.prototype[methodName].apply(me, args);\n };\n};\n\n\n/*\n * To support uncompiled, strict mode bundles that use eval to divide source\n * like so:\n * eval('someSource;//# sourceUrl sourcefile.js');\n * We need to export the globally defined symbols \"goog\" and \"COMPILED\".\n * Exporting \"goog\" breaks the compiler optimizations, so we required that\n * be defined externally.\n * NOTE: We don't use goog.exportSymbol here because we don't want to trigger\n * extern generation when that compiler option is enabled.\n */\nif (!COMPILED) {\n goog.global['COMPILED'] = COMPILED;\n}\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/third_party/closure/goog/base.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastProxy');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.cast.CastSender');\ngoog.require('shaka.cast.CastUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.IDestroyable');\n\n\n\n/**\n * A proxy to switch between local and remote playback for Chromecast in a way\n * that is transparent to the app's controls.\n *\n * @constructor\n * @struct\n * @param {!HTMLMediaElement} video The local video element associated with the\n * local Player instance.\n * @param {!shaka.Player} player A local Player instance.\n * @param {string} receiverAppId The ID of the cast receiver application.\n * @implements {shaka.util.IDestroyable}\n * @extends {shaka.util.FakeEventTarget}\n * @export\n */\nshaka.cast.CastProxy = function(video, player, receiverAppId) {\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {HTMLMediaElement} */\n this.localVideo_ = video;\n\n /** @private {shaka.Player} */\n this.localPlayer_ = player;\n\n /** @private {Object} */\n this.videoProxy_ = null;\n\n /** @private {Object} */\n this.playerProxy_ = null;\n\n /** @private {shaka.util.FakeEventTarget} */\n this.videoEventTarget_ = null;\n\n /** @private {shaka.util.FakeEventTarget} */\n this.playerEventTarget_ = null;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = null;\n\n /** @private {shaka.cast.CastSender} */\n this.sender_ = new shaka.cast.CastSender(\n receiverAppId,\n this.onCastStatusChanged_.bind(this),\n this.onRemoteEvent_.bind(this),\n this.onResumeLocal_.bind(this),\n this.getInitState_.bind(this));\n\n this.init_();\n};\ngoog.inherits(shaka.cast.CastProxy, shaka.util.FakeEventTarget);\n\n\n/**\n * Destroys the proxy and the underlying local Player.\n *\n * @param {boolean=} opt_forceDisconnect If true, force the receiver app to shut\n * down by disconnecting. Does nothing if not connected.\n * @override\n * @export\n */\nshaka.cast.CastProxy.prototype.destroy = function(opt_forceDisconnect) {\n if (opt_forceDisconnect && this.sender_) {\n this.sender_.forceDisconnect();\n }\n\n var async = [\n this.eventManager_ ? this.eventManager_.destroy() : null,\n this.localPlayer_ ? this.localPlayer_.destroy() : null,\n this.sender_ ? this.sender_.destroy() : null\n ];\n\n this.localVideo_ = null;\n this.localPlayer_ = null;\n this.videoProxy_ = null;\n this.playerProxy_ = null;\n this.eventManager_ = null;\n this.sender_ = null;\n\n return Promise.all(async);\n};\n\n\n/**\n * @event shaka.cast.CastProxy.CastStatusChangedEvent\n * @description Fired when cast status changes. The status change will be\n * reflected in canCast() and isCasting().\n * @property {string} type\n * 'caststatuschanged'\n * @exportDoc\n */\n\n\n/**\n * Get a proxy for the video element that delegates to local and remote video\n * elements as appropriate.\n *\n * @suppress {invalidCasts} to cast proxy Objects to unrelated types\n * @return {HTMLMediaElement}\n * @export\n */\nshaka.cast.CastProxy.prototype.getVideo = function() {\n return /** @type {HTMLMediaElement} */(this.videoProxy_);\n};\n\n\n/**\n * Get a proxy for the Player that delegates to local and remote Player objects\n * as appropriate.\n *\n * @suppress {invalidCasts} to cast proxy Objects to unrelated types\n * @return {shaka.Player}\n * @export\n */\nshaka.cast.CastProxy.prototype.getPlayer = function() {\n return /** @type {shaka.Player} */(this.playerProxy_);\n};\n\n\n/**\n * @return {boolean} True if the cast API is available and there are receivers.\n * @export\n */\nshaka.cast.CastProxy.prototype.canCast = function() {\n return this.sender_ ?\n this.sender_.apiReady() && this.sender_.hasReceivers() :\n false;\n};\n\n\n/**\n * @return {boolean} True if we are currently casting.\n * @export\n */\nshaka.cast.CastProxy.prototype.isCasting = function() {\n return this.sender_ ? this.sender_.isCasting() : false;\n};\n\n\n/**\n * @return {string} The name of the Cast receiver device, if isCasting().\n * @export\n */\nshaka.cast.CastProxy.prototype.receiverName = function() {\n return this.sender_ ? this.sender_.receiverName() : '';\n};\n\n\n/**\n * @return {!Promise} Resolved when connected to a receiver. Rejected if the\n * connection fails or is canceled by the user.\n * @export\n */\nshaka.cast.CastProxy.prototype.cast = function() {\n var initState = this.getInitState_();\n\n // TODO: transfer manually-selected tracks?\n // TODO: transfer side-loaded text tracks?\n\n return this.sender_.cast(initState).then(function() {\n // Unload the local manifest when casting succeeds.\n return this.localPlayer_.unload();\n }.bind(this));\n};\n\n\n/**\n * Set application-specific data.\n *\n * @param {Object} appData Application-specific data to relay to the receiver.\n * @export\n */\nshaka.cast.CastProxy.prototype.setAppData = function(appData) {\n this.sender_.setAppData(appData);\n};\n\n\n/**\n * Show a dialog where user can choose to disconnect from the cast connection.\n * @export\n */\nshaka.cast.CastProxy.prototype.suggestDisconnect = function() {\n this.sender_.showDisconnectDialog();\n};\n\n\n/**\n * Force the receiver app to shut down by disconnecting.\n * @export\n */\nshaka.cast.CastProxy.prototype.forceDisconnect = function() {\n this.sender_.forceDisconnect();\n};\n\n\n/**\n * Initialize the Proxies and the Cast sender.\n * @private\n */\nshaka.cast.CastProxy.prototype.init_ = function() {\n this.sender_.init();\n\n this.eventManager_ = new shaka.util.EventManager();\n\n shaka.cast.CastUtils.VideoEvents.forEach(function(name) {\n this.eventManager_.listen(this.localVideo_, name,\n this.videoProxyLocalEvent_.bind(this));\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerEvents.forEach(function(name) {\n this.eventManager_.listen(this.localPlayer_, name,\n this.playerProxyLocalEvent_.bind(this));\n }.bind(this));\n\n // We would like to use Proxy here, but it is not supported on IE11 or Safari.\n this.videoProxy_ = {};\n for (var k in this.localVideo_) {\n Object.defineProperty(this.videoProxy_, k, {\n configurable: false,\n enumerable: true,\n get: this.videoProxyGet_.bind(this, k),\n set: this.videoProxySet_.bind(this, k)\n });\n }\n\n this.playerProxy_ = {};\n for (var k in /** @type {Object} */(this.localPlayer_)) {\n Object.defineProperty(this.playerProxy_, k, {\n configurable: false,\n enumerable: true,\n get: this.playerProxyGet_.bind(this, k)\n });\n }\n\n this.videoEventTarget_ = new shaka.util.FakeEventTarget();\n this.videoEventTarget_.dispatchTarget =\n /** @type {EventTarget} */(this.videoProxy_);\n\n this.playerEventTarget_ = new shaka.util.FakeEventTarget();\n this.playerEventTarget_.dispatchTarget =\n /** @type {EventTarget} */(this.playerProxy_);\n};\n\n\n/**\n * @return {shaka.cast.CastUtils.InitStateType} initState Video and player state\n * to be sent to the receiver.\n * @private\n */\nshaka.cast.CastProxy.prototype.getInitState_ = function() {\n var initState = {\n 'video': {},\n 'player': {},\n 'playerAfterLoad': {},\n 'manifest': this.localPlayer_.getManifestUri(),\n 'startTime': null\n };\n\n // Pause local playback before capturing state.\n this.localVideo_.pause();\n\n shaka.cast.CastUtils.VideoInitStateAttributes.forEach(function(name) {\n initState['video'][name] = this.localVideo_[name];\n }.bind(this));\n\n // If the video is still playing, set the startTime.\n // Has no effect if nothing is loaded.\n if (!this.localVideo_.ended) {\n initState['startTime'] = this.localVideo_.currentTime;\n }\n\n shaka.cast.CastUtils.PlayerInitState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = /** @type {Object} */(this.localPlayer_)[getter]();\n\n initState['player'][setter] = value;\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerInitAfterLoadState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = /** @type {Object} */(this.localPlayer_)[getter]();\n\n initState['playerAfterLoad'][setter] = value;\n }.bind(this));\n\n return initState;\n};\n\n\n/**\n * Dispatch an event to notify the app that the status has changed.\n * @private\n */\nshaka.cast.CastProxy.prototype.onCastStatusChanged_ = function() {\n var event = new shaka.util.FakeEvent('caststatuschanged');\n this.dispatchEvent(event);\n};\n\n\n/**\n * Transfer remote state back and resume local playback.\n * @private\n */\nshaka.cast.CastProxy.prototype.onResumeLocal_ = function() {\n // Transfer back the player state.\n shaka.cast.CastUtils.PlayerInitState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = this.sender_.get('player', getter)();\n /** @type {Object} */(this.localPlayer_)[setter](value);\n }.bind(this));\n\n // Get the most recent manifest URI and ended state.\n var manifestUri = this.sender_.get('player', 'getManifestUri')();\n var ended = this.sender_.get('video', 'ended');\n\n var manifestReady = Promise.resolve();\n var autoplay = this.localVideo_.autoplay;\n\n var startTime = null;\n\n // If the video is still playing, set the startTime.\n // Has no effect if nothing is loaded.\n if (!ended) {\n startTime = this.sender_.get('video', 'currentTime');\n }\n\n // Now load the manifest, if present.\n if (manifestUri) {\n // Don't autoplay the content until we finish setting up initial state.\n this.localVideo_.autoplay = false;\n manifestReady = this.localPlayer_.load(manifestUri, startTime);\n // Pass any errors through to the app.\n manifestReady.catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong error type!');\n var event = new shaka.util.FakeEvent('error', { 'detail': error });\n this.localPlayer_.dispatchEvent(event);\n }.bind(this));\n }\n\n // Get the video state into a temp variable since we will apply it async.\n var videoState = {};\n shaka.cast.CastUtils.VideoInitStateAttributes.forEach(function(name) {\n videoState[name] = this.sender_.get('video', name);\n }.bind(this));\n\n // Finally, take on video state and player's \"after load\" state.\n manifestReady.then(function() {\n shaka.cast.CastUtils.VideoInitStateAttributes.forEach(function(name) {\n this.localVideo_[name] = videoState[name];\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerInitAfterLoadState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = this.sender_.get('player', getter)();\n /** @type {Object} */(this.localPlayer_)[setter](value);\n }.bind(this));\n\n // Restore original autoplay setting.\n this.localVideo_.autoplay = autoplay;\n if (manifestUri) {\n // Resume playback with transferred state.\n this.localVideo_.play();\n }\n }.bind(this));\n};\n\n\n/**\n * @param {string} name\n * @return {?}\n * @private\n */\nshaka.cast.CastProxy.prototype.videoProxyGet_ = function(name) {\n if (name == 'addEventListener') {\n return this.videoEventTarget_.addEventListener.bind(\n this.videoEventTarget_);\n }\n if (name == 'removeEventListener') {\n return this.videoEventTarget_.removeEventListener.bind(\n this.videoEventTarget_);\n }\n\n // If we are casting, but the first update has not come in yet, use local\n // values, but not local methods.\n if (this.sender_.isCasting() && !this.sender_.hasRemoteProperties()) {\n var value = this.localVideo_[name];\n if (typeof value != 'function') {\n return value;\n }\n }\n\n // Use local values and methods if we are not casting.\n if (!this.sender_.isCasting()) {\n var value = this.localVideo_[name];\n if (typeof value == 'function') {\n value = value.bind(this.localVideo_);\n }\n return value;\n }\n\n return this.sender_.get('video', name);\n};\n\n\n/**\n * @param {string} name\n * @param {?} value\n * @private\n */\nshaka.cast.CastProxy.prototype.videoProxySet_ = function(name, value) {\n if (!this.sender_.isCasting()) {\n this.localVideo_[name] = value;\n return;\n }\n\n this.sender_.set('video', name, value);\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.cast.CastProxy.prototype.videoProxyLocalEvent_ = function(event) {\n if (this.sender_.isCasting()) {\n // Ignore any unexpected local events while casting. Events can still be\n // fired by the local video and Player when we unload() after the Cast\n // connection is complete.\n return;\n }\n\n // Convert this real Event into a FakeEvent for dispatch from our\n // FakeEventListener.\n var fakeEvent = new shaka.util.FakeEvent(event.type, event);\n this.videoEventTarget_.dispatchEvent(fakeEvent);\n};\n\n\n/**\n * @param {string} name\n * @return {?}\n * @private\n */\nshaka.cast.CastProxy.prototype.playerProxyGet_ = function(name) {\n if (name == 'addEventListener') {\n return this.playerEventTarget_.addEventListener.bind(\n this.playerEventTarget_);\n }\n if (name == 'removeEventListener') {\n return this.playerEventTarget_.removeEventListener.bind(\n this.playerEventTarget_);\n }\n\n if (name == 'getNetworkingEngine') {\n // Always returns a local instance, in case you need to make a request.\n // Issues a warning, in case you think you are making a remote request\n // or affecting remote filters.\n if (this.sender_.isCasting()) {\n shaka.log.warning('NOTE: getNetworkingEngine() is always local!');\n }\n return this.localPlayer_.getNetworkingEngine.bind(this.localPlayer_);\n }\n\n // If we are casting, but the first update has not come in yet, use local\n // getters, but not local methods.\n if (this.sender_.isCasting() && !this.sender_.hasRemoteProperties()) {\n if (shaka.cast.CastUtils.PlayerGetterMethods.indexOf(name) >= 0) {\n var value = /** @type {Object} */(this.localPlayer_)[name];\n goog.asserts.assert(typeof value == 'function', 'only methods on Player');\n return value.bind(this.localPlayer_);\n }\n }\n\n // Use local getters and methods if we are not casting.\n if (!this.sender_.isCasting()) {\n var value = /** @type {Object} */(this.localPlayer_)[name];\n goog.asserts.assert(typeof value == 'function', 'only methods on Player');\n return value.bind(this.localPlayer_);\n }\n\n return this.sender_.get('player', name);\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.cast.CastProxy.prototype.playerProxyLocalEvent_ = function(event) {\n if (this.sender_.isCasting()) {\n // Ignore any unexpected local events while casting.\n return;\n }\n\n this.playerEventTarget_.dispatchEvent(event);\n};\n\n\n/**\n * @param {string} targetName\n * @param {!shaka.util.FakeEvent} event\n * @private\n */\nshaka.cast.CastProxy.prototype.onRemoteEvent_ = function(targetName, event) {\n goog.asserts.assert(this.sender_.isCasting(),\n 'Should only receive remote events while casting');\n if (!this.sender_.isCasting()) {\n // Ignore any unexpected remote events.\n return;\n }\n\n if (targetName == 'video') {\n this.videoEventTarget_.dispatchEvent(event);\n } else if (targetName == 'player') {\n this.playerEventTarget_.dispatchEvent(event);\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_proxy.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.abr.Ewma');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Computes an exponentionally-weighted moving average.\n *\n * @param {number} halfLife About half of the estimated value will be from the\n * last |halfLife| samples by weight.\n * @struct\n * @constructor\n */\nshaka.abr.Ewma = function(halfLife) {\n goog.asserts.assert(halfLife > 0, 'expected halfLife to be positive');\n\n /**\n * Larger values of alpha expire historical data more slowly.\n * @private {number}\n */\n this.alpha_ = Math.exp(Math.log(0.5) / halfLife);\n\n /** @private {number} */\n this.estimate_ = 0;\n\n /** @private {number} */\n this.totalWeight_ = 0;\n};\n\n\n/**\n * Takes a sample.\n *\n * @param {number} weight\n * @param {number} value\n */\nshaka.abr.Ewma.prototype.sample = function(weight, value) {\n var adjAlpha = Math.pow(this.alpha_, weight);\n var newEstimate = value * (1 - adjAlpha) + adjAlpha * this.estimate_;\n\n if (!isNaN(newEstimate)) {\n this.estimate_ = newEstimate;\n this.totalWeight_ += weight;\n }\n};\n\n\n/**\n * @return {number}\n */\nshaka.abr.Ewma.prototype.getEstimate = function() {\n var zeroFactor = 1 - Math.pow(this.alpha_, this.totalWeight_);\n return this.estimate_ / zeroFactor;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/abr/ewma.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.abr.EwmaBandwidthEstimator');\n\ngoog.require('shaka.abr.Ewma');\n\n\n\n/**\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 * @constructor\n * @struct\n */\nshaka.abr.EwmaBandwidthEstimator = function() {\n /**\n * A fast-moving average.\n * Half of the estimate is based on the last 2 seconds of sample history.\n * @private {!shaka.abr.Ewma}\n */\n this.fast_ = new shaka.abr.Ewma(2);\n\n /**\n * A slow-moving average.\n * Half of the estimate is based on the last 5 seconds of sample history.\n * @private {!shaka.abr.Ewma}\n */\n this.slow_ = new shaka.abr.Ewma(5);\n\n /**\n * Number of bytes sampled.\n * @private {number}\n */\n this.bytesSampled_ = 0;\n\n /**\n * Initial estimate used when there is not enough data.\n * @see shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE\n * @private {number}\n */\n this.defaultEstimate_ = shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE;\n\n /**\n * Minimum number of bytes sampled before we trust the estimate. If we have\n * not sampled much data, our estimate may not be accurate enough to trust.\n * If bytesSampled_ is less than minTotalBytes_, we use defaultEstimate_.\n * This specific value is based on experimentation.\n *\n * @private {number}\n * @const\n */\n this.minTotalBytes_ = 128e3; // 128kB\n\n /**\n * Minimum number of bytes, under which samples are discarded. Our models do\n * not include latency information, so connection startup time (time to first\n * byte) is considered part of the download time. Because of this, we should\n * ignore very small downloads which would cause our estimate to be too low.\n * This specific value is based on experimentation.\n *\n * @private {number}\n * @const\n */\n this.minBytes_ = 16e3; // 16kB\n};\n\n\n/**\n * Contains the default estimate to use when there is not enough data.\n * This is a relatively safe default, since 3G cell connections are faster than\n * this. For slower connections, such as 2G, the default estimate may be too\n * high. This default can be changed at runtime using\n * {@link shaka.Player#configure} and {@link shakaExtern.AbrConfiguration}.\n * @const {number}\n */\nshaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE = 500e3; // 500kbps\n\n\n/**\n * Takes a bandwidth sample.\n *\n * @param {number} durationMs The amount of time, in milliseconds, for a\n * particular request.\n * @param {number} numBytes The total number of bytes transferred in that\n * request.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.sample = function(\n durationMs, numBytes) {\n if (numBytes < this.minBytes_) {\n return;\n }\n\n var bandwidth = 8000 * numBytes / durationMs;\n var weight = durationMs / 1000;\n\n this.bytesSampled_ += numBytes;\n this.fast_.sample(weight, bandwidth);\n this.slow_.sample(weight, bandwidth);\n};\n\n\n/**\n * Sets the default bandwidth estimate to use if there is not enough data.\n *\n * @param {number} estimate The default bandwidth estimate, in bit/sec.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.setDefaultEstimate = function(\n estimate) {\n this.defaultEstimate_ = estimate;\n};\n\n\n/**\n * Gets the current bandwidth estimate.\n *\n * @return {number} The bandwidth estimate in bits per second.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.getBandwidthEstimate = function() {\n if (this.bytesSampled_ < this.minTotalBytes_) {\n return this.defaultEstimate_;\n }\n\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};\n\n\n/**\n * @return {boolean} True if there is enough data to produce a meaningful\n * estimate.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.hasGoodEstimate = function() {\n return this.bytesSampled_ >= this.minTotalBytes_;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/abr/ewma_bandwidth_estimator.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.log');\n\n\n/**\n * @namespace shaka.log\n * @summary\n * A console logging framework which is compiled out for deployment. This is\n * only available when using the uncompiled version.\n * @exportDoc\n */\n\n\n/**\n * Log levels.\n * @enum {number}\n * @exportDoc\n */\nshaka.log.Level = {\n NONE: 0,\n ERROR: 1,\n WARNING: 2,\n INFO: 3,\n DEBUG: 4,\n V1: 5,\n V2: 6\n};\n\n\n/**\n * @define {number} the maximum log level.\n */\ngoog.define('shaka.log.MAX_LOG_LEVEL', 3);\n\n\n/** @type {function(*, ...*)} */\nshaka.log.error = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.warning = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.info = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.debug = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.v1 = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.v2 = function() {};\n\n\n// IE8 has no console unless it is opened in advance.\n// IE9 console methods are not Functions and have no bind.\nif (window.console && window.console.log.bind) {\n if (!COMPILED) {\n /** @type {number} */\n shaka.log.currentLevel;\n\n /**\n * Change the log level. Useful for debugging in uncompiled mode.\n *\n * @param {number} level\n * @exportDoc\n */\n shaka.log.setLevel = function(level) {\n var nop = function() {};\n var log = shaka.log;\n var Level = shaka.log.Level;\n\n shaka.log.currentLevel = level;\n\n log.error = (level >= Level.ERROR) ? console.error.bind(console) : nop;\n log.warning = (level >= Level.WARNING) ? console.warn.bind(console) : nop;\n log.info = (level >= Level.INFO) ? console.info.bind(console) : nop;\n log.debug = (level >= Level.DEBUG) ? console.log.bind(console) : nop;\n log.v1 = (level >= Level.V1) ? console.debug.bind(console) : nop;\n log.v2 = (level >= Level.V2) ? console.debug.bind(console) : nop;\n };\n\n shaka.log.setLevel(shaka.log.MAX_LOG_LEVEL);\n } else {\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.ERROR) {\n shaka.log.error = console.error.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.WARNING) {\n shaka.log.warning = console.warn.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.INFO) {\n shaka.log.info = console.info.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.DEBUG) {\n shaka.log.debug = console.log.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.V1) {\n shaka.log.v1 = console.debug.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.V2) {\n shaka.log.v2 = console.debug.bind(console);\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/debug/log.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Error');\n\n\n\n/**\n * Creates a new Error.\n *\n * @param {shaka.util.Error.Severity} severity\n * @param {shaka.util.Error.Category} category\n * @param {shaka.util.Error.Code} code\n * @param {...*} var_args\n *\n * @constructor\n * @struct\n * @export\n * @extends {Error}\n */\nshaka.util.Error = function(severity, category, code, var_args) {\n this.severity = severity;\n this.category = category;\n this.code = code;\n this.data = Array.prototype.slice.call(arguments, 3);\n\n // This improves formatting of Errors in failure messages in the tests.\n if (!COMPILED) {\n var categoryName = 'UNKNOWN';\n var codeName = 'UNKNOWN';\n\n for (var k in shaka.util.Error.Category) {\n if (shaka.util.Error.Category[k] == this.category)\n categoryName = k;\n }\n for (var k in shaka.util.Error.Code) {\n if (shaka.util.Error.Code[k] == this.code)\n codeName = k;\n }\n\n /**\n * A human-readable version of the category and code.\n * <i>(Only available in uncompiled mode.)</i>\n *\n * @const {string}\n * @exportDoc\n */\n this.message = 'Shaka Error ' + categoryName + '.' + codeName +\n ' (' + this.data.toString() + ')';\n try {\n throw new Error(this.message);\n } catch (e) {\n /**\n * A stack-trace showing where the error occurred.\n * <i>(Only available in uncompiled mode.)</i>\n *\n * @const {string}\n * @exportDoc\n */\n this.stack = e.stack;\n }\n }\n};\n\n\n/**\n * @type {shaka.util.Error.Severity}\n * @expose\n */\nshaka.util.Error.prototype.severity;\n\n\n/**\n * @const {shaka.util.Error.Category}\n * @expose\n */\nshaka.util.Error.prototype.category;\n\n\n/**\n * @const {shaka.util.Error.Code}\n * @expose\n */\nshaka.util.Error.prototype.code;\n\n\n/**\n * @const {!Array.<*>}\n * @expose\n */\nshaka.util.Error.prototype.data;\n\n\n/**\n * @return {string}\n * @override\n */\nshaka.util.Error.prototype.toString = function() {\n return 'shaka.util.Error ' + JSON.stringify(this, null, ' ');\n};\n\n\n/**\n * @enum {number}\n * @export\n */\nshaka.util.Error.Severity = {\n /**\n * An error occurred, but the Player is attempting to recover from the error.\n *\n * If the Player cannot ultimately recover, it still may not throw a CRITICAL\n * error. For example, retrying for a media segment will never result in\n * a CRITICAL error (the Player will just retry forever).\n */\n 'RECOVERABLE': 1,\n\n /**\n * A critical error that the library cannot recover from. These usually cause\n * the Player to stop loading or updating. A new manifest must be loaded\n * to reset the library.\n */\n 'CRITICAL': 2\n};\n\n\n/**\n * @enum {number}\n * @export\n */\nshaka.util.Error.Category = {\n /** Errors from the network stack. */\n 'NETWORK': 1,\n\n /** Errors parsing text streams. */\n 'TEXT': 2,\n\n /** Errors parsing or processing audio or video streams. */\n 'MEDIA': 3,\n\n /** Errors parsing the Manifest. */\n 'MANIFEST': 4,\n\n /** Errors related to streaming. */\n 'STREAMING': 5,\n\n /** Errors related to DRM. */\n 'DRM': 6,\n\n /** Miscellaneous errors from the player. */\n 'PLAYER': 7,\n\n /** Errors related to cast. */\n 'CAST': 8,\n\n /** Errors in the database storage (offline). */\n 'STORAGE': 9\n};\n\n\n/**\n * @enum {number}\n * @export\n */\nshaka.util.Error.Code = {\n /**\n * A network request was made using an unsupported URI scheme.\n * <br> error.data[0] is the URI.\n */\n 'UNSUPPORTED_SCHEME': 1000,\n\n /**\n * An HTTP network request returned an HTTP status that indicated a failure.\n * <br> error.data[0] is the URI.\n * <br> error.data[1] is the status code.\n * <br> error.data[2] is the response text, or null if the response could not\n * be interpretted as text.\n * <br> error.data[3] is the map of response headers.\n */\n 'BAD_HTTP_STATUS': 1001,\n\n /**\n * An HTTP network request failed with an error, but not from the server.\n * <br> error.data[0] is the URI.\n */\n 'HTTP_ERROR': 1002,\n\n /**\n * A network request timed out.\n * <br> error.data[0] is the URI.\n */\n 'TIMEOUT': 1003,\n\n /**\n * A network request was made with a malformed data URI.\n * <br> error.data[0] is the URI.\n */\n 'MALFORMED_DATA_URI': 1004,\n\n /**\n * A network request was made with a data URI using an unknown encoding.\n * <br> error.data[0] is the URI.\n */\n 'UNKNOWN_DATA_URI_ENCODING': 1005,\n\n /**\n * A request filter threw an error.\n * <br> error.data[0] is the original error.\n */\n 'REQUEST_FILTER_ERROR': 1006,\n\n /**\n * A response filter threw an error.\n * <br> error.data[0] is the original error.\n */\n 'RESPONSE_FILTER_ERROR': 1007,\n\n\n /** The text parser failed to parse a text stream due to an invalid header. */\n 'INVALID_TEXT_HEADER': 2000,\n\n /** The text parser failed to parse a text stream due to an invalid cue. */\n 'INVALID_TEXT_CUE': 2001,\n\n // RETIRED: 'INVALID_TEXT_SETTINGS': 2002,\n\n /**\n * Was unable to detect the encoding of the response text. Suggest adding\n * byte-order-markings to the response data.\n */\n 'UNABLE_TO_DETECT_ENCODING': 2003,\n\n /** The response data contains invalid Unicode character encoding. */\n 'BAD_ENCODING': 2004,\n\n /**\n * The XML parser failed to parse an xml stream, or the XML lacks mandatory\n * elements for TTML.\n */\n 'INVALID_XML': 2005,\n\n // RETIRED: 'INVALID_TTML': 2006,\n\n /**\n * MP4 segment does not contain TTML.\n */\n 'INVALID_MP4_TTML': 2007,\n\n /**\n * MP4 segment does not contain VTT.\n */\n 'INVALID_MP4_VTT': 2008,\n\n\n /**\n * Some component tried to read past the end of a buffer. The segment index,\n * init segment, or PSSH may be malformed.\n */\n 'BUFFER_READ_OUT_OF_BOUNDS': 3000,\n\n /**\n * Some component tried to parse an integer that was too large to fit in a\n * JavaScript number without rounding error. JavaScript can only natively\n * represent integers up to 53 bits.\n */\n 'JS_INTEGER_OVERFLOW': 3001,\n\n /**\n * The EBML parser used to parse the WebM container encountered an integer,\n * ID, or other field larger than the maximum supported by the parser.\n */\n 'EBML_OVERFLOW': 3002,\n\n /**\n * The EBML parser used to parse the WebM container encountered a floating-\n * point field of a size not supported by the parser.\n */\n 'EBML_BAD_FLOATING_POINT_SIZE': 3003,\n\n /**\n * The MP4 SIDX parser found the wrong box type.\n * Either the segment index range is incorrect or the data is corrupt.\n */\n 'MP4_SIDX_WRONG_BOX_TYPE': 3004,\n\n /**\n * The MP4 SIDX parser encountered an invalid timescale.\n * The segment index data may be corrupt.\n */\n 'MP4_SIDX_INVALID_TIMESCALE': 3005,\n\n /** The MP4 SIDX parser encountered a type of SIDX that is not supported. */\n 'MP4_SIDX_TYPE_NOT_SUPPORTED': 3006,\n\n /**\n * The WebM Cues parser was unable to locate the Cues element.\n * The segment index data may be corrupt.\n */\n 'WEBM_CUES_ELEMENT_MISSING': 3007,\n\n /**\n * The WebM header parser was unable to locate the Ebml element.\n * The init segment data may be corrupt.\n */\n 'WEBM_EBML_HEADER_ELEMENT_MISSING': 3008,\n\n /**\n * The WebM header parser was unable to locate the Segment element.\n * The init segment data may be corrupt.\n */\n 'WEBM_SEGMENT_ELEMENT_MISSING': 3009,\n\n /**\n * The WebM header parser was unable to locate the Info element.\n * The init segment data may be corrupt.\n */\n 'WEBM_INFO_ELEMENT_MISSING': 3010,\n\n /**\n * The WebM header parser was unable to locate the Duration element.\n * The init segment data may be corrupt or may have been incorrectly encoded.\n * Shaka requires a duration in WebM DASH content.\n */\n 'WEBM_DURATION_ELEMENT_MISSING': 3011,\n\n /**\n * The WebM Cues parser was unable to locate the Cue Track Positions element.\n * The segment index data may be corrupt.\n */\n 'WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING': 3012,\n\n /**\n * The WebM Cues parser was unable to locate the Cue Time element.\n * The segment index data may be corrupt.\n */\n 'WEBM_CUE_TIME_ELEMENT_MISSING': 3013,\n\n /**\n * A MediaSource operation failed.\n * <br> error.data[0] is a MediaError code from the video element.\n */\n 'MEDIA_SOURCE_OPERATION_FAILED': 3014,\n\n /**\n * A MediaSource operation threw an exception.\n * <br> error.data[0] is the exception that was thrown.\n */\n 'MEDIA_SOURCE_OPERATION_THREW': 3015,\n\n /**\n * The video element reported an error.\n * <br> error.data[0] is a MediaError code from the video element.\n * <br> On Edge & IE, error.data[1] is a Microsoft extended error code in hex.\n */\n 'VIDEO_ERROR': 3016,\n\n /**\n * A MediaSource operation threw QuotaExceededError and recovery failed. The\n * content cannot be played correctly because the segments are too large for\n * the browser/platform. This may occur when attempting to play very high\n * quality, very high bitrate content on low-end devices.\n * <br> error.data[0] is the type of content which caused the error.\n */\n 'QUOTA_EXCEEDED_ERROR': 3017,\n\n\n /**\n * The Player was unable to guess the manifest type based on file extension\n * or MIME type. To fix, try one of the following:\n * <br><ul>\n * <li>Rename the manifest so that the URI ends in a well-known extension.\n * <li>Configure the server to send a recognizable Content-Type header.\n * <li>Configure the server to accept a HEAD request for the manifest.\n * </ul>\n * <br> error.data[0] is the manifest URI.\n */\n 'UNABLE_TO_GUESS_MANIFEST_TYPE': 4000,\n\n /** The DASH Manifest contained invalid XML markup. */\n 'DASH_INVALID_XML': 4001,\n\n /**\n * The DASH Manifest contained a Representation with insufficient segment\n * information.\n */\n 'DASH_NO_SEGMENT_INFO': 4002,\n\n /** The DASH Manifest contained an AdaptationSet with no Representations. */\n 'DASH_EMPTY_ADAPTATION_SET': 4003,\n\n /** The DASH Manifest contained an Period with no AdaptationSets. */\n 'DASH_EMPTY_PERIOD': 4004,\n\n /**\n * The DASH Manifest does not specify an init segment with a WebM container.\n */\n 'DASH_WEBM_MISSING_INIT': 4005,\n\n /** The DASH Manifest contained an unsupported container format. */\n 'DASH_UNSUPPORTED_CONTAINER': 4006,\n\n /** The embedded PSSH data has invalid encoding. */\n 'DASH_PSSH_BAD_ENCODING': 4007,\n\n /**\n * There is an AdaptationSet whose Representations do not have any common\n * key-systems.\n */\n 'DASH_NO_COMMON_KEY_SYSTEM': 4008,\n\n /** Having multiple key IDs per Representation is not supported. */\n 'DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED': 4009,\n\n /** The DASH Manifest specifies conflicting key IDs. */\n 'DASH_CONFLICTING_KEY_IDS': 4010,\n\n /**\n * The manifest contains a period with no playable streams.\n * Either the period was originally empty, or the streams within cannot be\n * played on this browser or platform.\n */\n 'UNPLAYABLE_PERIOD': 4011,\n\n /**\n * There exist some streams that could be decoded, but restrictions imposed\n * by the application or the key system prevent us from playing. This may\n * happen under the following conditions:\n * <ul>\n * <li>The application has given restrictions to the Player that restrict\n * at least one content type completely (e.g. no playable audio).\n * <li>The key system has imposed output restrictions that cannot be met\n * (such as HDCP) and there are no unrestricted alternatives.\n * </ul>\n */\n 'RESTRICTIONS_CANNOT_BE_MET': 4012,\n\n // RETIRED: 'INTERNAL_ERROR_KEY_STATUS': 4013,\n\n /**\n * No valid periods were found in the manifest. Please check that your\n * manifest is correct and free of typos.\n */\n 'NO_PERIODS': 4014,\n\n /**\n * HLS playlist doesn't start with a mandory #EXTM3U tag.\n */\n 'HLS_PLAYLIST_HEADER_MISSING': 4015,\n\n /**\n * HLS tag has an invalid name that doesn't start with '#EXT'\n */\n 'INVALID_HLS_TAG': 4016,\n\n /**\n * HLS playlist has both Master and Media/Segment tags.\n */\n 'HLS_INVALID_PLAYLIST_HIERARCHY': 4017,\n\n /**\n * A Representation has an id that is the same as another Representation in\n * the same Period. This makes manifest updates impossible since we cannot\n * map the updated Representation to the old one.\n */\n 'DASH_DUPLICATE_REPRESENTATION_ID': 4018,\n\n // RETIRED: 'HLS_MEDIA_INIT_SECTION_INFO_MISSING': 4019,\n\n /**\n * HLS manifest has several #EXT-X-MAP tags. We can only\n * support one at the moment.\n */\n 'HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND': 4020,\n\n /**\n * HLS parser was unable to guess mime type of a stream.\n * <br> error.data[0] is the stream file's extension.\n */\n 'HLS_COULD_NOT_GUESS_MIME_TYPE': 4021,\n\n /**\n * No Master Playlist has been provided. Master playlist provides\n * vital information about the streams (like codecs) that is\n * required for MediaSource. We don't support directly providing\n * a Media Playlist.\n */\n 'HLS_MASTER_PLAYLIST_NOT_PROVIDED': 4022,\n\n /**\n * One of the required attributes was not provided.\n * HLS manifest is invalid.\n * <br> error.data[0] is the missing attribute's name.\n */\n 'HLS_REQUIRED_ATTRIBUTE_MISSING': 4023,\n\n /**\n * One of the required tags was not provided.\n * HLS manifest is invalid.\n * <br> error.data[0] is the missing tag's name.\n */\n 'HLS_REQUIRED_TAG_MISSING': 4024,\n\n /**\n * HLS parser was unable to guess codecs of a stream.\n * <br> error.data[0] is the list of all codecs for the variant.\n */\n 'HLS_COULD_NOT_GUESS_CODECS': 4025,\n\n /**\n * HLS parser has encountered encrypted content with unsupported\n * KEYFORMAT attributes.\n */\n 'HLS_KEYFORMATS_NOT_SUPPORTED': 4026,\n\n\n // RETIRED: 'INCONSISTENT_BUFFER_STATE': 5000,\n // RETIRED: 'INVALID_SEGMENT_INDEX': 5001,\n // RETIRED: 'SEGMENT_DOES_NOT_EXIST': 5002,\n // RETIRED: 'CANNOT_SATISFY_BYTE_LIMIT': 5003,\n // RETIRED: 'BAD_SEGMENT': 5004,\n\n /**\n * The StreamingEngine called onChooseStreams() but the callback receiver\n * did not return the correct number or type of Streams.\n *\n * This can happen when there is multi-Period content where one Period is\n * video+audio and another is video-only or audio-only. We don't support this\n * case because it is incompatible with MSE. When the browser reaches the\n * transition, it will pause, waiting for the audio stream.\n */\n 'INVALID_STREAMS_CHOSEN': 5005,\n\n\n /**\n * The manifest indicated protected content, but the manifest parser was\n * unable to determine what key systems should be used.\n */\n 'NO_RECOGNIZED_KEY_SYSTEMS': 6000,\n\n /**\n * None of the requested key system configurations are available. This may\n * happen under the following conditions:\n * <ul>\n * <li> The key system is not supported.\n * <li> The key system does not support the features requested (e.g.\n * persistent state).\n * <li> A user prompt was shown and the user denied access.\n * <li> The key system is not available from unsecure contexts. (ie.\n requires HTTPS) See https://goo.gl/EEhZqT.\n * </ul>\n */\n 'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,\n\n /**\n * The browser found one of the requested key systems, but it failed to\n * create an instance of the CDM for some unknown reason.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_CREATE_CDM': 6002,\n\n /**\n * The browser found one of the requested key systems and created an instance\n * of the CDM, but it failed to attach the CDM to the video for some unknown\n * reason.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_ATTACH_TO_VIDEO': 6003,\n\n /**\n * The CDM rejected the server certificate supplied by the application.\n * The certificate may be malformed or in an unsupported format.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'INVALID_SERVER_CERTIFICATE': 6004,\n\n /**\n * The CDM refused to create a session for some unknown reason.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_CREATE_SESSION': 6005,\n\n /**\n * The CDM was unable to generate a license request for the init data it was\n * given. The init data may be malformed or in an unsupported format.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_GENERATE_LICENSE_REQUEST': 6006,\n\n /**\n * The license request failed. This could be a timeout, a network failure, or\n * a rejection by the server.\n * <br> error.data[0] is a shaka.util.Error from the networking engine.\n */\n 'LICENSE_REQUEST_FAILED': 6007,\n\n /**\n * The license response was rejected by the CDM. The server's response may be\n * invalid or malformed for this CDM.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'LICENSE_RESPONSE_REJECTED': 6008,\n\n // RETIRED: 'NO_LICENSE_SERVER_SPECIFIED': 6009,\n\n /**\n * The manifest does not specify any DRM info, but the content is encrypted.\n * Either the manifest or the manifest parser are broken.\n */\n 'ENCRYPTED_CONTENT_WITHOUT_DRM_INFO': 6010,\n\n // RETIRED: 'WRONG_KEYS': 6011,\n\n /**\n * No license server was given for the key system signaled by the manifest.\n * A license server URI is required for every key system.\n */\n 'NO_LICENSE_SERVER_GIVEN': 6012,\n\n /**\n * A required offline session was removed. The content is not playable.\n */\n 'OFFLINE_SESSION_REMOVED': 6013,\n\n /**\n * The license has expired. This is triggered when playback is stalled on a\n * 'waitingforkeys' event and there are any expired keys in the key status map\n * of any active session.\n */\n 'EXPIRED': 6014,\n\n\n /**\n * The call to Player.load() was interrupted by a call to Player.unload()\n * or another call to Player.load().\n */\n 'LOAD_INTERRUPTED': 7000,\n\n\n /**\n * The Cast API is unavailable. This may be because of one of the following:\n * - The browser may not have Cast support\n * - The browser may be missing a necessary Cast extension\n * - The Cast sender library may not be loaded in your app\n */\n 'CAST_API_UNAVAILABLE': 8000,\n\n /**\n * No cast receivers are available at this time.\n */\n 'NO_CAST_RECEIVERS': 8001,\n\n /**\n * The library is already casting.\n */\n 'ALREADY_CASTING': 8002,\n\n /**\n * A Cast SDK error that we did not explicitly plan for has occurred.\n * Check data[0] and refer to the Cast SDK documentation for details.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'UNEXPECTED_CAST_ERROR': 8003,\n\n /**\n * The cast operation was canceled by the user.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'CAST_CANCELED_BY_USER': 8004,\n\n /**\n * The cast connection timed out.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'CAST_CONNECTION_TIMED_OUT': 8005,\n\n /**\n * The requested receiver app ID does not exist or is unavailable.\n * Check the requested app ID for typos.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'CAST_RECEIVER_APP_UNAVAILABLE': 8006,\n\n\n /**\n * Offline storage is not supported on this browser; it is required for\n * offline support.\n */\n 'STORAGE_NOT_SUPPORTED': 9000,\n\n /**\n * An unknown error occurred in the IndexedDB.\n * <br> On Firefox, one common source for UnknownError calls is reverting\n * Firefox to an old version. This makes the indexedDB storage inaccessible\n * for older versions. The only way to fix this is to delete the storage\n * data in your profile. See https://goo.gl/eKVPPe.\n * <br> error.data[0] is the error object.\n */\n 'INDEXED_DB_ERROR': 9001,\n\n /**\n * The operation was aborted. For example, by a call to destroy().\n */\n 'OPERATION_ABORTED': 9002,\n\n /**\n * The specified item was not found in the IndexedDB.\n * <br> error.data[0] is the offline URI.\n */\n 'REQUESTED_ITEM_NOT_FOUND': 9003,\n\n /**\n * A network request was made with a malformed offline URI.\n * <br> error.data[0] is the URI.\n */\n 'MALFORMED_OFFLINE_URI': 9004,\n\n /**\n * The specified content is live or in-progress.\n * Live and in-progress streams cannot be stored offline.\n * <br> error.data[0] is the URI.\n */\n 'CANNOT_STORE_LIVE_OFFLINE': 9005,\n\n /**\n * There is already a store operation in-progress, wait until it completes\n * before starting another.\n */\n 'STORE_ALREADY_IN_PROGRESS': 9006,\n\n /**\n * The specified manifest is encrypted but does not specify any init data.\n * Without init data specified in the manifest, the content will not be\n * playable offline.\n * <br> error.data[0] is the URI.\n */\n 'NO_INIT_DATA_FOR_OFFLINE': 9007,\n\n /**\n * shaka.offline.Storage was constructed with a Player proxy instead of a\n * local player instance. To fix this, use Player directly with Storage\n * instead of the results of CastProxy.prototype.getPlayer().\n */\n 'LOCAL_PLAYER_INSTANCE_REQUIRED': 9008\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/error.js","// Copyright 2008 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Simple utilities for splitting URI strings.\n *\n * Uses features of RFC 3986 for parsing/formatting URIs:\n * http://www.ietf.org/rfc/rfc3986.txt\n *\n * @author gboyer@google.com (Garrett Boyer) - The \"lightened\" design.\n * @author msamuel@google.com (Mike Samuel) - Domain knowledge and regexes.\n */\n\ngoog.provide('goog.uri.utils');\ngoog.provide('goog.uri.utils.ComponentIndex');\n\n\n/**\n * A regular expression for breaking a URI into its component parts.\n *\n * {@link http://www.ietf.org/rfc/rfc3986.txt} says in Appendix B\n * As the \"first-match-wins\" algorithm is identical to the \"greedy\"\n * disambiguation method used by POSIX regular expressions, it is natural and\n * commonplace to use a regular expression for parsing the potential five\n * components of a URI reference.\n *\n * The following line is the regular expression for breaking-down a\n * well-formed URI reference into its components.\n *\n * <pre>\n * ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\n * 12 3 4 5 6 7 8 9\n * </pre>\n *\n * The numbers in the second line above are only to assist readability; they\n * indicate the reference points for each subexpression (i.e., each paired\n * parenthesis). We refer to the value matched for subexpression <n> as $<n>.\n * For example, matching the above expression to\n * <pre>\n * http://www.ics.uci.edu/pub/ietf/uri/#Related\n * </pre>\n * results in the following subexpression matches:\n * <pre>\n * $1 = http:\n * $2 = http\n * $3 = //www.ics.uci.edu\n * $4 = www.ics.uci.edu\n * $5 = /pub/ietf/uri/\n * $6 = <undefined>\n * $7 = <undefined>\n * $8 = #Related\n * $9 = Related\n * </pre>\n * where <undefined> indicates that the component is not present, as is the\n * case for the query component in the above example. Therefore, we can\n * determine the value of the five components as\n * <pre>\n * scheme = $2\n * authority = $4\n * path = $5\n * query = $7\n * fragment = $9\n * </pre>\n *\n * The regular expression has been modified slightly to expose the\n * userInfo, domain, and port separately from the authority.\n * The modified version yields\n * <pre>\n * $1 = http scheme\n * $2 = <undefined> userInfo -\\\n * $3 = www.ics.uci.edu domain | authority\n * $4 = <undefined> port -/\n * $5 = /pub/ietf/uri/ path\n * $6 = <undefined> query without ?\n * $7 = Related fragment without #\n * </pre>\n * @type {!RegExp}\n * @private\n */\ngoog.uri.utils.splitRe_ = new RegExp(\n '^' +\n '(?:' +\n '([^:/?#.]+)' + // scheme - ignore special characters\n // used by other URL parts such as :,\n // ?, /, #, and .\n ':)?' +\n '(?://' +\n '(?:([^/?#]*)@)?' + // userInfo\n '([^/#?]*?)' + // domain\n '(?::([0-9]+))?' + // port\n '(?=[/#?]|$)' + // authority-terminating character\n ')?' +\n '([^?#]+)?' + // path\n '(?:\\\\?([^#]*))?' + // query\n '(?:#(.*))?' + // fragment\n '$');\n\n\n/**\n * The index of each URI component in the return value of goog.uri.utils.split.\n * @enum {number}\n */\ngoog.uri.utils.ComponentIndex = {\n SCHEME: 1,\n USER_INFO: 2,\n DOMAIN: 3,\n PORT: 4,\n PATH: 5,\n QUERY_DATA: 6,\n FRAGMENT: 7\n};\n\n\n/**\n * Splits a URI into its component parts.\n *\n * Each component can be accessed via the component indices; for example:\n * <pre>\n * goog.uri.utils.split(someStr)[goog.uri.utils.CompontentIndex.QUERY_DATA];\n * </pre>\n *\n * @param {string} uri The URI string to examine.\n * @return {!Array.<string|undefined>} Each component still URI-encoded.\n * Each component that is present will contain the encoded value, whereas\n * components that are not present will be undefined or empty, depending\n * on the browser's regular expression implementation. Never null, since\n * arbitrary strings may still look like path names.\n */\ngoog.uri.utils.split = function(uri) {\n // See @return comment -- never null.\n return /** @type {!Array.<string|undefined>} */ (\n uri.match(goog.uri.utils.splitRe_));\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/third_party/closure/goog/uri/utils.js","// Copyright 2006 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Class for parsing and formatting URIs.\n *\n * Use new goog.Uri(string) to parse a URI string.\n *\n * e.g: <code>var myUri = new goog.Uri(window.location);</code>\n *\n * Implements RFC 3986 for parsing/formatting URIs.\n * http://www.ietf.org/rfc/rfc3986.txt\n *\n * Some changes have been made to the interface (more like .NETs), though the\n * internal representation is now of un-encoded parts, this will change the\n * behavior slightly.\n *\n */\n\ngoog.provide('goog.Uri');\ngoog.provide('goog.Uri.QueryData');\n\ngoog.require('goog.uri.utils');\ngoog.require('goog.uri.utils.ComponentIndex');\n\n\n\n/**\n * This class contains setters and getters for the parts of the URI.\n * The <code>getXyz</code>/<code>setXyz</code> methods return the decoded part\n * -- so<code>new goog.Uri('/foo%20bar').getPath()</code> will return the\n * decoded path, <code>/foo bar</code>.\n *\n * Reserved characters (see RFC 3986 section 2.2) can be present in\n * their percent-encoded form in scheme, domain, and path URI components and\n * will not be auto-decoded. For example:\n * <code>new goog.Uri('rel%61tive/path%2fto/resource').getPath()</code> will\n * return <code>relative/path%2fto/resource</code>.\n *\n * The constructor accepts an optional unparsed, raw URI string. The parser\n * is relaxed, so special characters that aren't escaped but don't cause\n * ambiguities will not cause parse failures.\n *\n * All setters return <code>this</code> and so may be chained, a la\n * <code>new goog.Uri('/foo').setFragment('part').toString()</code>.\n *\n * @param {*=} opt_uri Optional string URI to parse, or if a goog.Uri is\n * passed, a clone is created.\n *\n * @constructor\n */\ngoog.Uri = function(opt_uri) {\n // Parse in the uri string\n var m;\n if (opt_uri instanceof goog.Uri) {\n this.setScheme(opt_uri.getScheme());\n this.setUserInfo(opt_uri.getUserInfo());\n this.setDomain(opt_uri.getDomain());\n this.setPort(opt_uri.getPort());\n this.setPath(opt_uri.getPath());\n this.setQueryData(opt_uri.getQueryData().clone());\n this.setFragment(opt_uri.getFragment());\n } else if (opt_uri && (m = goog.uri.utils.split(String(opt_uri)))) {\n // Set the parts -- decoding as we do so.\n // COMPATABILITY NOTE - In IE, unmatched fields may be empty strings,\n // whereas in other browsers they will be undefined.\n this.setScheme(m[goog.uri.utils.ComponentIndex.SCHEME] || '', true);\n this.setUserInfo(m[goog.uri.utils.ComponentIndex.USER_INFO] || '', true);\n this.setDomain(m[goog.uri.utils.ComponentIndex.DOMAIN] || '', true);\n this.setPort(m[goog.uri.utils.ComponentIndex.PORT]);\n this.setPath(m[goog.uri.utils.ComponentIndex.PATH] || '', true);\n this.setQueryData(m[goog.uri.utils.ComponentIndex.QUERY_DATA] || '', true);\n this.setFragment(m[goog.uri.utils.ComponentIndex.FRAGMENT] || '', true);\n } else {\n this.queryData_ = new goog.Uri.QueryData(null, null);\n }\n};\n\n\n/**\n * Scheme such as \"http\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.scheme_ = '';\n\n\n/**\n * User credentials in the form \"username:password\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.userInfo_ = '';\n\n\n/**\n * Domain part, e.g. \"www.google.com\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.domain_ = '';\n\n\n/**\n * Port, e.g. 8080.\n * @type {?number}\n * @private\n */\ngoog.Uri.prototype.port_ = null;\n\n\n/**\n * Path, e.g. \"/tests/img.png\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.path_ = '';\n\n\n/**\n * Object representing query data.\n * @type {!goog.Uri.QueryData}\n * @private\n */\ngoog.Uri.prototype.queryData_;\n\n\n/**\n * The fragment without the #.\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.fragment_ = '';\n\n\n/**\n * @return {string} The string form of the url.\n * @override\n */\ngoog.Uri.prototype.toString = function() {\n var out = [];\n\n var scheme = this.getScheme();\n if (scheme) {\n out.push(goog.Uri.encodeSpecialChars_(\n scheme, goog.Uri.reDisallowedInSchemeOrUserInfo_, true), ':');\n }\n\n var domain = this.getDomain();\n if (domain) {\n out.push('//');\n\n var userInfo = this.getUserInfo();\n if (userInfo) {\n out.push(goog.Uri.encodeSpecialChars_(\n userInfo, goog.Uri.reDisallowedInSchemeOrUserInfo_, true), '@');\n }\n\n out.push(goog.Uri.removeDoubleEncoding_(encodeURIComponent(domain)));\n\n var port = this.getPort();\n if (port != null) {\n out.push(':', String(port));\n }\n }\n\n var path = this.getPath();\n if (path) {\n if (this.hasDomain() && path.charAt(0) != '/') {\n out.push('/');\n }\n out.push(goog.Uri.encodeSpecialChars_(\n path,\n path.charAt(0) == '/' ?\n goog.Uri.reDisallowedInAbsolutePath_ :\n goog.Uri.reDisallowedInRelativePath_,\n true));\n }\n\n var query = this.getEncodedQuery();\n if (query) {\n out.push('?', query);\n }\n\n var fragment = this.getFragment();\n if (fragment) {\n out.push('#', goog.Uri.encodeSpecialChars_(\n fragment, goog.Uri.reDisallowedInFragment_));\n }\n return out.join('');\n};\n\n\n/**\n * Resolves the given relative URI (a goog.Uri object), using the URI\n * represented by this instance as the base URI.\n *\n * There are several kinds of relative URIs:<br>\n * 1. foo - replaces the last part of the path, the whole query and fragment<br>\n * 2. /foo - replaces the the path, the query and fragment<br>\n * 3. //foo - replaces everything from the domain on. foo is a domain name<br>\n * 4. ?foo - replace the query and fragment<br>\n * 5. #foo - replace the fragment only\n *\n * Additionally, if relative URI has a non-empty path, all \"..\" and \".\"\n * segments will be resolved, as described in RFC 3986.\n *\n * @param {goog.Uri} relativeUri The relative URI to resolve.\n * @return {!goog.Uri} The resolved URI.\n */\ngoog.Uri.prototype.resolve = function(relativeUri) {\n\n var absoluteUri = this.clone();\n if (absoluteUri.scheme_ === 'data') {\n // Cannot have a relative URI to a data URI.\n absoluteUri = new goog.Uri();\n }\n\n // we satisfy these conditions by looking for the first part of relativeUri\n // that is not blank and applying defaults to the rest\n\n var overridden = relativeUri.hasScheme();\n\n if (overridden) {\n absoluteUri.setScheme(relativeUri.getScheme());\n } else {\n overridden = relativeUri.hasUserInfo();\n }\n\n if (overridden) {\n absoluteUri.setUserInfo(relativeUri.getUserInfo());\n } else {\n overridden = relativeUri.hasDomain();\n }\n\n if (overridden) {\n absoluteUri.setDomain(relativeUri.getDomain());\n } else {\n overridden = relativeUri.hasPort();\n }\n\n var path = relativeUri.getPath();\n if (overridden) {\n absoluteUri.setPort(relativeUri.getPort());\n } else {\n overridden = relativeUri.hasPath();\n if (overridden) {\n // resolve path properly\n if (path.charAt(0) != '/') {\n // path is relative\n if (this.hasDomain() && !this.hasPath()) {\n // RFC 3986, section 5.2.3, case 1\n path = '/' + path;\n } else {\n // RFC 3986, section 5.2.3, case 2\n var lastSlashIndex = absoluteUri.getPath().lastIndexOf('/');\n if (lastSlashIndex != -1) {\n path = absoluteUri.getPath().substr(0, lastSlashIndex + 1) + path;\n }\n }\n }\n path = goog.Uri.removeDotSegments(path);\n }\n }\n\n if (overridden) {\n absoluteUri.setPath(path);\n } else {\n overridden = relativeUri.hasQuery();\n }\n\n if (overridden) {\n absoluteUri.setQueryData(relativeUri.getQueryData().clone());\n } else {\n overridden = relativeUri.hasFragment();\n }\n\n if (overridden) {\n absoluteUri.setFragment(relativeUri.getFragment());\n }\n\n return absoluteUri;\n};\n\n\n/**\n * Clones the URI instance.\n * @return {!goog.Uri} New instance of the URI object.\n */\ngoog.Uri.prototype.clone = function() {\n return new goog.Uri(this);\n};\n\n\n/**\n * @return {string} The encoded scheme/protocol for the URI.\n */\ngoog.Uri.prototype.getScheme = function() {\n return this.scheme_;\n};\n\n\n/**\n * Sets the scheme/protocol.\n * @param {string} newScheme New scheme value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setScheme = function(newScheme, opt_decode) {\n this.scheme_ = opt_decode ? goog.Uri.decodeOrEmpty_(newScheme, true) :\n newScheme;\n\n // remove an : at the end of the scheme so somebody can pass in\n // window.location.protocol\n if (this.scheme_) {\n this.scheme_ = this.scheme_.replace(/:$/, '');\n }\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the scheme has been set.\n */\ngoog.Uri.prototype.hasScheme = function() {\n return !!this.scheme_;\n};\n\n\n/**\n * @return {string} The decoded user info.\n */\ngoog.Uri.prototype.getUserInfo = function() {\n return this.userInfo_;\n};\n\n\n/**\n * Sets the userInfo.\n * @param {string} newUserInfo New userInfo value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setUserInfo = function(newUserInfo, opt_decode) {\n this.userInfo_ = opt_decode ? goog.Uri.decodeOrEmpty_(newUserInfo) :\n newUserInfo;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the user info has been set.\n */\ngoog.Uri.prototype.hasUserInfo = function() {\n return !!this.userInfo_;\n};\n\n\n/**\n * @return {string} The decoded domain.\n */\ngoog.Uri.prototype.getDomain = function() {\n return this.domain_;\n};\n\n\n/**\n * Sets the domain.\n * @param {string} newDomain New domain value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setDomain = function(newDomain, opt_decode) {\n this.domain_ = opt_decode ? goog.Uri.decodeOrEmpty_(newDomain, true) :\n newDomain;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the domain has been set.\n */\ngoog.Uri.prototype.hasDomain = function() {\n return !!this.domain_;\n};\n\n\n/**\n * @return {?number} The port number.\n */\ngoog.Uri.prototype.getPort = function() {\n return this.port_;\n};\n\n\n/**\n * Sets the port number.\n * @param {*} newPort Port number. Will be explicitly casted to a number.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setPort = function(newPort) {\n if (newPort) {\n newPort = Number(newPort);\n if (isNaN(newPort) || newPort < 0) {\n throw Error('Bad port number ' + newPort);\n }\n this.port_ = newPort;\n } else {\n this.port_ = null;\n }\n\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the port has been set.\n */\ngoog.Uri.prototype.hasPort = function() {\n return this.port_ != null;\n};\n\n\n/**\n * @return {string} The decoded path.\n */\ngoog.Uri.prototype.getPath = function() {\n return this.path_;\n};\n\n\n/**\n * Sets the path.\n * @param {string} newPath New path value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setPath = function(newPath, opt_decode) {\n this.path_ = opt_decode ? goog.Uri.decodeOrEmpty_(newPath, true) : newPath;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the path has been set.\n */\ngoog.Uri.prototype.hasPath = function() {\n return !!this.path_;\n};\n\n\n/**\n * @return {boolean} Whether the query string has been set.\n */\ngoog.Uri.prototype.hasQuery = function() {\n return this.queryData_.toString() !== '';\n};\n\n\n/**\n * Sets the query data.\n * @param {goog.Uri.QueryData|string|undefined} queryData QueryData object.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * Applies only if queryData is a string.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setQueryData = function(queryData, opt_decode) {\n if (queryData instanceof goog.Uri.QueryData) {\n this.queryData_ = queryData;\n } else {\n if (!opt_decode) {\n // QueryData accepts encoded query string, so encode it if\n // opt_decode flag is not true.\n queryData = goog.Uri.encodeSpecialChars_(queryData,\n goog.Uri.reDisallowedInQuery_);\n }\n this.queryData_ = new goog.Uri.QueryData(queryData, null);\n }\n\n return this;\n};\n\n\n/**\n * @return {string} The encoded URI query, not including the ?.\n */\ngoog.Uri.prototype.getEncodedQuery = function() {\n return this.queryData_.toString();\n};\n\n\n/**\n * @return {string} The decoded URI query, not including the ?.\n */\ngoog.Uri.prototype.getDecodedQuery = function() {\n return this.queryData_.toDecodedString();\n};\n\n\n/**\n * Returns the query data.\n * @return {!goog.Uri.QueryData} QueryData object.\n */\ngoog.Uri.prototype.getQueryData = function() {\n return this.queryData_;\n};\n\n\n/**\n * @return {string} The URI fragment, not including the #.\n */\ngoog.Uri.prototype.getFragment = function() {\n return this.fragment_;\n};\n\n\n/**\n * Sets the URI fragment.\n * @param {string} newFragment New fragment value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setFragment = function(newFragment, opt_decode) {\n this.fragment_ = opt_decode ? goog.Uri.decodeOrEmpty_(newFragment) :\n newFragment;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the URI has a fragment set.\n */\ngoog.Uri.prototype.hasFragment = function() {\n return !!this.fragment_;\n};\n\n\n//==============================================================================\n// Static members\n//==============================================================================\n\n\n/**\n * Removes dot segments in given path component, as described in\n * RFC 3986, section 5.2.4.\n *\n * @param {string} path A non-empty path component.\n * @return {string} Path component with removed dot segments.\n */\ngoog.Uri.removeDotSegments = function(path) {\n if (path == '..' || path == '.') {\n return '';\n\n } else if (path.indexOf('./') == -1 &&\n path.indexOf('/.') == -1) {\n // This optimization detects uris which do not contain dot-segments,\n // and as a consequence do not require any processing.\n return path;\n\n } else {\n var leadingSlash = (path.lastIndexOf('/', 0) == 0);\n var segments = path.split('/');\n var out = [];\n\n for (var pos = 0; pos < segments.length; ) {\n var segment = segments[pos++];\n\n if (segment == '.') {\n if (leadingSlash && pos == segments.length) {\n out.push('');\n }\n } else if (segment == '..') {\n if (out.length > 1 || out.length == 1 && out[0] != '') {\n out.pop();\n }\n if (leadingSlash && pos == segments.length) {\n out.push('');\n }\n } else {\n out.push(segment);\n leadingSlash = true;\n }\n }\n\n return out.join('/');\n }\n};\n\n\n/**\n * Decodes a value or returns the empty string if it isn't defined or empty.\n * @param {string|undefined} val Value to decode.\n * @param {boolean=} opt_preserveReserved If true, restricted characters will\n * not be decoded.\n * @return {string} Decoded value.\n * @private\n */\ngoog.Uri.decodeOrEmpty_ = function(val, opt_preserveReserved) {\n // Don't use UrlDecode() here because val is not a query parameter.\n if (!val) {\n return '';\n }\n\n return opt_preserveReserved ? decodeURI(val) : decodeURIComponent(val);\n};\n\n\n/**\n * If unescapedPart is non null, then escapes any characters in it that aren't\n * valid characters in a url and also escapes any special characters that\n * appear in extra.\n *\n * @param {*} unescapedPart The string to encode.\n * @param {RegExp} extra A character set of characters in [\\01-\\177].\n * @param {boolean=} opt_removeDoubleEncoding If true, remove double percent\n * encoding.\n * @return {?string} null iff unescapedPart == null.\n * @private\n */\ngoog.Uri.encodeSpecialChars_ = function(unescapedPart, extra,\n opt_removeDoubleEncoding) {\n if (goog.isString(unescapedPart)) {\n var encoded = encodeURI(unescapedPart).\n replace(extra, goog.Uri.encodeChar_);\n if (opt_removeDoubleEncoding) {\n // encodeURI double-escapes %XX sequences used to represent restricted\n // characters in some URI components, remove the double escaping here.\n encoded = goog.Uri.removeDoubleEncoding_(encoded);\n }\n return encoded;\n }\n return null;\n};\n\n\n/**\n * Converts a character in [\\01-\\177] to its unicode character equivalent.\n * @param {string} ch One character string.\n * @return {string} Encoded string.\n * @private\n */\ngoog.Uri.encodeChar_ = function(ch) {\n var n = ch.charCodeAt(0);\n return '%' + ((n >> 4) & 0xf).toString(16) + (n & 0xf).toString(16);\n};\n\n\n/**\n * Removes double percent-encoding from a string.\n * @param {string} doubleEncodedString String\n * @return {string} String with double encoding removed.\n * @private\n */\ngoog.Uri.removeDoubleEncoding_ = function(doubleEncodedString) {\n return doubleEncodedString.replace(/%25([0-9a-fA-F]{2})/g, '%$1');\n};\n\n\n/**\n * Regular expression for characters that are disallowed in the scheme or\n * userInfo part of the URI.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInSchemeOrUserInfo_ = /[#\\/\\?@]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in a relative path.\n * Colon is included due to RFC 3986 3.3.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInRelativePath_ = /[\\#\\?:]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in an absolute path.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInAbsolutePath_ = /[\\#\\?]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in the query.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInQuery_ = /[\\#\\?@]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in the fragment.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInFragment_ = /#/g;\n\n\n\n/**\n * Class used to represent URI query parameters. It is essentially a hash of\n * name-value pairs, though a name can be present more than once.\n *\n * Has the same interface as the collections in goog.structs.\n *\n * @param {?string=} opt_query Optional encoded query string to parse into\n * the object.\n * @param {goog.Uri=} opt_uri Optional uri object that should have its\n * cache invalidated when this object updates. Deprecated -- this\n * is no longer required.\n * @constructor\n * @final\n */\ngoog.Uri.QueryData = function(opt_query, opt_uri) {\n /**\n * Encoded query string, or null if it requires computing from the key map.\n * @type {?string}\n * @private\n */\n this.encodedQuery_ = opt_query || null;\n};\n\n\n/**\n * If the underlying key map is not yet initialized, it parses the\n * query string and fills the map with parsed data.\n * @private\n */\ngoog.Uri.QueryData.prototype.ensureKeyMapInitialized_ = function() {\n if (!this.keyMap_) {\n this.keyMap_ = {};\n this.count_ = 0;\n\n if (this.encodedQuery_) {\n var pairs = this.encodedQuery_.split('&');\n for (var i = 0; i < pairs.length; i++) {\n var indexOfEquals = pairs[i].indexOf('=');\n var name = null;\n var value = null;\n if (indexOfEquals >= 0) {\n name = pairs[i].substring(0, indexOfEquals);\n value = pairs[i].substring(indexOfEquals + 1);\n } else {\n name = pairs[i];\n }\n name = decodeURIComponent(name.replace(/\\+/g, ' '));\n value = value || '';\n this.add(name, decodeURIComponent(value.replace(/\\+/g, ' ')));\n }\n }\n }\n};\n\n\n/**\n * The map containing name/value or name/array-of-values pairs.\n * May be null if it requires parsing from the query string.\n *\n * We need to use a Map because we cannot guarantee that the key names will\n * not be problematic for IE.\n *\n * @type {Object.<string, !Array.<string>>}\n * @private\n */\ngoog.Uri.QueryData.prototype.keyMap_ = null;\n\n\n/**\n * The number of params, or null if it requires computing.\n * @type {?number}\n * @private\n */\ngoog.Uri.QueryData.prototype.count_ = null;\n\n\n/**\n * @return {?number} The number of parameters.\n */\ngoog.Uri.QueryData.prototype.getCount = function() {\n this.ensureKeyMapInitialized_();\n return this.count_;\n};\n\n\n/**\n * Adds a key value pair.\n * @param {string} key Name.\n * @param {*} value Value.\n * @return {!goog.Uri.QueryData} Instance of this object.\n */\ngoog.Uri.QueryData.prototype.add = function(key, value) {\n this.ensureKeyMapInitialized_();\n // Invalidate the cache.\n this.encodedQuery_ = null;\n\n var values = this.keyMap_.hasOwnProperty(key) && this.keyMap_[key];\n if (!values) {\n this.keyMap_[key] = (values = []);\n }\n values.push(value);\n this.count_++;\n return this;\n};\n\n\n/**\n * @return {string} Encoded query string.\n * @override\n */\ngoog.Uri.QueryData.prototype.toString = function() {\n if (this.encodedQuery_) {\n return this.encodedQuery_;\n }\n\n if (!this.keyMap_) {\n return '';\n }\n\n var sb = [];\n\n for (var key in this.keyMap_) {\n var encodedKey = encodeURIComponent(key);\n var val = this.keyMap_[key];\n for (var j = 0; j < val.length; j++) {\n var param = encodedKey;\n // Ensure that null and undefined are encoded into the url as\n // literal strings.\n if (val[j] !== '') {\n param += '=' + encodeURIComponent(val[j]);\n }\n sb.push(param);\n }\n }\n\n return this.encodedQuery_ = sb.join('&');\n};\n\n\n/**\n * @return {string} Decoded query string.\n */\ngoog.Uri.QueryData.prototype.toDecodedString = function() {\n return goog.Uri.decodeOrEmpty_(this.toString());\n};\n\n\n/**\n * Clone the query data instance.\n * @return {!goog.Uri.QueryData} New instance of the QueryData object.\n */\ngoog.Uri.QueryData.prototype.clone = function() {\n var rv = new goog.Uri.QueryData();\n rv.encodedQuery_ = this.encodedQuery_;\n if (this.keyMap_) {\n var cloneMap = {};\n for (var key in this.keyMap_) {\n cloneMap[key] = this.keyMap_[key].concat();\n }\n rv.keyMap_ = cloneMap;\n rv.count_ = this.count_;\n }\n return rv;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/third_party/closure/goog/uri/uri.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Functional');\n\n\n/**\n * @namespace shaka.util.Functional\n * @summary A set of functional utility functions.\n */\n\n\n/**\n * Creates a promise chain that calls the given callback for each element in\n * the array in a catch of a promise.\n *\n * e.g.:\n * Promise.reject().catch(callback(array[0])).catch(callback(array[1]));\n *\n * @param {!Array.<ELEM>} array\n * @param {function(ELEM):!Promise.<RESULT>} callback\n * @return {!Promise.<RESULT>}\n * @template ELEM,RESULT\n */\nshaka.util.Functional.createFallbackPromiseChain = function(array, callback) {\n return array.reduce(function(callback, promise, elem) {\n return promise.catch(callback.bind(null, elem));\n }.bind(null, callback), Promise.reject());\n};\n\n\n/**\n * Returns the first array concatenated to the second; used to collapse an\n * array of arrays into a single array.\n *\n * @param {!Array.<T>} all\n * @param {!Array.<T>} part\n * @return {!Array.<T>}\n * @template T\n */\nshaka.util.Functional.collapseArrays = function(all, part) {\n return all.concat(part);\n};\n\n\n/**\n * A no-op function. Useful in promise chains.\n */\nshaka.util.Functional.noop = function() {};\n\n\n/**\n * Returns if the given value is not null; useful for filtering out null values.\n *\n * @param {T} value\n * @return {boolean}\n * @template T\n */\nshaka.util.Functional.isNotNull = function(value) {\n return value != null;\n};\n\n\n/**\n * Creates a function that returns whether the given value is equal to the given\n * value.\n *\n * @param {T} compare\n * @return {function(T):boolean}\n * @template T\n */\nshaka.util.Functional.isEqualFunc = function(compare) {\n return function(a) { return a == compare; };\n};\n\n\n/**\n * Creates a function that returns whether the given value is not equal to the\n * given value.\n *\n * @param {T} compare\n * @return {function(T):boolean}\n * @template T\n */\nshaka.util.Functional.isNotEqualFunc = function(compare) {\n return function(a) { return a != compare; };\n};\n\n\n/**\n * Used to filter out duplicates in an array.\n * Returns true the first time the element is encountered. Returns false\n * for all the subsequent encounters.\n *\n * @param {T} item\n * @param {number} position\n * @param {!Array.<T>} self\n * @return {boolean}\n * @template T\n * @example [1, 1, 2].filter(shaka.util.Functional.isNotDuplicate) -> [1, 2]\n */\nshaka.util.Functional.isNotDuplicate = function(item, position, self) {\n return self.indexOf(item) == position;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/functional.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.ManifestParserUtils');\n\ngoog.require('goog.Uri');\ngoog.require('shaka.util.Functional');\n\n\n/**\n * @namespace shaka.util.ManifestParserUtils\n * @summary Utility functions for manifest parsing.\n */\n\n\n/**\n * Resolves an array of relative URIs to the given base URIs. This will result\n * in M*N number of URIs.\n *\n * @param {!Array.<string>} baseUris\n * @param {!Array.<string>} relativeUris\n * @return {!Array.<string>}\n */\nshaka.util.ManifestParserUtils.resolveUris = function(baseUris, relativeUris) {\n var Functional = shaka.util.Functional;\n if (relativeUris.length == 0)\n return baseUris;\n\n var relativeAsGoog =\n relativeUris.map(function(uri) { return new goog.Uri(uri); });\n // Resolve each URI relative to each base URI, creating an Array of Arrays.\n // Then flatten the Arrays into a single Array.\n return baseUris.map(function(uri) { return new goog.Uri(uri); })\n .map(function(base) { return relativeAsGoog.map(base.resolve.bind(base)); })\n .reduce(Functional.collapseArrays, [])\n .map(function(uri) { return uri.toString(); });\n};\n\n\n/**\n * Creates a DrmInfo object from the given info.\n *\n * @param {string} keySystem\n * @param {Array.<shakaExtern.InitDataOverride>} initData\n * @return {shakaExtern.DrmInfo}\n */\nshaka.util.ManifestParserUtils.createDrmInfo = function(keySystem, initData) {\n return {\n keySystem: keySystem,\n licenseServerUri: '',\n distinctiveIdentifierRequired: false,\n persistentStateRequired: false,\n audioRobustness: '',\n videoRobustness: '',\n serverCertificate: null,\n initData: initData || [],\n keyIds: []\n };\n};\n\n\n/**\n * @enum {string}\n */\nshaka.util.ManifestParserUtils.ContentType = {\n VIDEO: 'video',\n AUDIO: 'audio',\n TEXT: 'text',\n APPLICATION: 'application'\n};\n\n\n/**\n * @enum {string}\n */\nshaka.util.ManifestParserUtils.TextStreamKind = {\n SUBTITLE: 'subtitle',\n CLOSED_CAPTION: 'caption'\n};\n\n\n/**\n * Specifies how tolerant the player is to inaccurate segment start times and\n * end times within a manifest. For example, gaps or overlaps between segments\n * in a SegmentTimeline which are greater than or equal to this value will\n * result in a warning message.\n *\n * @const {number}\n */\nshaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS = 1 / 15;\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/manifest_parser_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.ConfigUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\n\n\n/**\n * @param {!Object} destination\n * @param {!Object} source\n * @param {!Object} template supplies default values\n * @param {!Object} overrides\n * Supplies override type checking. When the current path matches the key in\n * this object, each sub-value must match the type in this object. If this\n * contains an Object, it is used as the template.\n * @param {string} path to this part of the config\n */\nshaka.util.ConfigUtils.mergeConfigObjects =\n function(destination, source, template, overrides, path) {\n goog.asserts.assert(destination, 'Destination config must not be null!');\n\n /**\n * @type {boolean}\n * If true, don't validate the keys in the next level.\n */\n var ignoreKeys = path in overrides;\n\n for (var k in source) {\n var subPath = path + '.' + k;\n var subTemplate = ignoreKeys ? overrides[path] : template[k];\n\n /**\n * @type {boolean}\n * If true, simply copy the object over and don't verify.\n */\n var copyObject = !!({\n '.abr.manager': true\n })[subPath] || !!({\n 'serverCertificate': true\n })[k];\n\n // The order of these checks is important.\n if (!ignoreKeys && !(k in destination)) {\n shaka.log.error('Invalid config, unrecognized key ' + subPath);\n } else if (source[k] === undefined) {\n // An explicit 'undefined' value causes the key to be deleted from the\n // destination config and replaced with a default from the template if\n // possible.\n if (subTemplate === undefined || ignoreKeys) {\n delete destination[k];\n } else {\n destination[k] = subTemplate;\n }\n } else if (copyObject) {\n destination[k] = source[k];\n } else if (typeof destination[k] == 'object' &&\n typeof source[k] == 'object') {\n shaka.util.ConfigUtils.mergeConfigObjects(\n destination[k], source[k], subTemplate, overrides, subPath);\n } else if (typeof source[k] != typeof subTemplate) {\n shaka.log.error('Invalid config, wrong type for ' + subPath);\n } else if (typeof destination[k] == 'function' &&\n destination[k].length != source[k].length) {\n shaka.log.warning(\n 'Invalid config, wrong number of arguments for ' + subPath);\n destination[k] = source[k];\n } else {\n destination[k] = source[k];\n }\n }\n};\n\n\n/**\n * Performs a deep clone of the given simple object. This does not copy\n * prototypes, custom properties (e.g. read-only), or multiple references to\n * the same object. This uses JSON to clone.\n *\n * @template T\n * @param {T} arg\n * @return {T}\n */\nshaka.util.ConfigUtils.cloneObject = function(arg) {\n return JSON.parse(JSON.stringify(arg));\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/config_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.PublicPromise');\n\n\n\n/**\n * A utility to create Promises with convenient public resolve and reject\n * methods.\n *\n * @constructor\n * @struct\n * @extends {Promise.<T>}\n * @return {Promise.<T>}\n * @template T\n */\nshaka.util.PublicPromise = function() {\n var resolvePromise;\n var rejectPromise;\n\n // Promise.call causes an error. It seems that inheriting from a native\n // Promise is not permitted by JavaScript interpreters.\n\n // The work-around is to construct a Promise object, modify it to look like\n // the compiler's picture of PublicPromise, then return it. The caller of\n // new PublicPromise will receive |promise| instead of |this|, and the\n // compiler will be aware of the additional properties |resolve| and\n // |reject|.\n\n var promise = new Promise(function(resolve, reject) {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n\n promise.resolve = resolvePromise;\n promise.reject = rejectPromise;\n\n return promise;\n};\n\n\n/** @type {function(T=)} */\nshaka.util.PublicPromise.prototype.resolve;\n\n\n/** @type {function(*=)} */\nshaka.util.PublicPromise.prototype.reject;\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/public_promise.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.net.NetworkingEngine');\n\ngoog.require('goog.Uri');\ngoog.require('goog.asserts');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * NetworkingEngine wraps all networking operations. This accepts plugins that\n * handle the actual request. A plugin is registered using registerScheme.\n * Each scheme has at most one plugin to handle the request.\n *\n * @param {function(number, number)=} opt_onSegmentDownloaded Called\n * when a segment is downloaded. Passed the duration, in milliseconds, that\n * the request took; and the total number of bytes transferred.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n * @export\n */\nshaka.net.NetworkingEngine = function(opt_onSegmentDownloaded) {\n /** @private {boolean} */\n this.destroyed_ = false;\n\n /** @private {!Array.<!Promise>} */\n this.requests_ = [];\n\n /** @private {!Array.<shakaExtern.RequestFilter>} */\n this.requestFilters_ = [];\n\n /** @private {!Array.<shakaExtern.ResponseFilter>} */\n this.responseFilters_ = [];\n\n /** @private {?function(number, number)} */\n this.onSegmentDownloaded_ = opt_onSegmentDownloaded || null;\n};\n\n\n/**\n * Request types. Allows a filter to decide which requests to read/alter.\n *\n * @enum {number}\n * @export\n */\nshaka.net.NetworkingEngine.RequestType = {\n 'MANIFEST': 0,\n 'SEGMENT': 1,\n 'LICENSE': 2,\n 'APP': 3\n};\n\n\n/**\n * Contains the scheme plugins.\n *\n * @private {!Object.<string, ?shakaExtern.SchemePlugin>}\n */\nshaka.net.NetworkingEngine.schemes_ = {};\n\n\n/**\n * Registers a scheme plugin. This plugin will handle all requests with the\n * given scheme. If a plugin with the same scheme already exists, it is\n * replaced.\n *\n * @param {string} scheme\n * @param {shakaExtern.SchemePlugin} plugin\n * @export\n */\nshaka.net.NetworkingEngine.registerScheme = function(scheme, plugin) {\n shaka.net.NetworkingEngine.schemes_[scheme] = plugin;\n};\n\n\n/**\n * Removes a scheme plugin.\n *\n * @param {string} scheme\n * @export\n */\nshaka.net.NetworkingEngine.unregisterScheme = function(scheme) {\n delete shaka.net.NetworkingEngine.schemes_[scheme];\n};\n\n\n/**\n * Registers a new request filter. All filters are applied in the order they\n * are registered.\n *\n * @param {shakaExtern.RequestFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.registerRequestFilter = function(filter) {\n this.requestFilters_.push(filter);\n};\n\n\n/**\n * Removes a request filter.\n *\n * @param {shakaExtern.RequestFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.unregisterRequestFilter =\n function(filter) {\n var filters = this.requestFilters_;\n var i = filters.indexOf(filter);\n if (i >= 0) {\n filters.splice(i, 1);\n }\n};\n\n\n/**\n * Clear all request filters.\n *\n * @export\n */\nshaka.net.NetworkingEngine.prototype.clearAllRequestFilters = function() {\n this.requestFilters_ = [];\n};\n\n\n/**\n * Registers a new response filter. All filters are applied in the order they\n * are registered.\n *\n * @param {shakaExtern.ResponseFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.registerResponseFilter = function(filter) {\n this.responseFilters_.push(filter);\n};\n\n\n/**\n * Removes a response filter.\n *\n * @param {shakaExtern.ResponseFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.unregisterResponseFilter =\n function(filter) {\n var filters = this.responseFilters_;\n var i = filters.indexOf(filter);\n if (i >= 0) {\n filters.splice(i, 1);\n }\n};\n\n\n/**\n * Clear all response filters.\n *\n * @export\n */\nshaka.net.NetworkingEngine.prototype.clearAllResponseFilters = function() {\n this.responseFilters_ = [];\n};\n\n\n/**\n * Gets a copy of the default retry parameters.\n *\n * @return {shakaExtern.RetryParameters}\n */\nshaka.net.NetworkingEngine.defaultRetryParameters = function() {\n // Use a function rather than a constant member so the calling code can\n // modify the values without affecting other call results.\n return {\n maxAttempts: 2,\n baseDelay: 1000,\n backoffFactor: 2,\n fuzzFactor: 0.5,\n timeout: 0\n };\n};\n\n\n/**\n * Makes a simple network request for the given URIs.\n *\n * @param {!Array.<string>} uris\n * @param {shakaExtern.RetryParameters} retryParams\n * @return {shakaExtern.Request}\n */\nshaka.net.NetworkingEngine.makeRequest = function(\n uris, retryParams) {\n return {\n uris: uris,\n method: 'GET',\n body: null,\n headers: {},\n allowCrossSiteCredentials: false,\n retryParameters: retryParams\n };\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.net.NetworkingEngine.prototype.destroy = function() {\n var Functional = shaka.util.Functional;\n this.destroyed_ = true;\n this.requestFilters_ = [];\n this.responseFilters_ = [];\n\n var cleanup = [];\n for (var i = 0; i < this.requests_.length; ++i) {\n cleanup.push(this.requests_[i].catch(Functional.noop));\n }\n return Promise.all(cleanup);\n};\n\n\n/**\n * Makes a network request and returns the resulting data.\n *\n * @param {shaka.net.NetworkingEngine.RequestType} type\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.net.NetworkingEngine.prototype.request = function(type, request) {\n var cloneObject = shaka.util.ConfigUtils.cloneObject;\n\n // New requests made after destroy is called are rejected.\n if (this.destroyed_)\n return Promise.reject();\n\n goog.asserts.assert(request.uris && request.uris.length,\n 'Request without URIs!');\n\n // If a request comes from outside the library, some parameters may be left\n // undefined. To make it easier for application developers, we will fill them\n // in with defaults if necessary.\n //\n // We clone retryParameters and uris so that if a filter modifies the request,\n // then it doesn't contaminate future requests.\n request.method = request.method || 'GET';\n request.headers = request.headers || {};\n request.retryParameters = request.retryParameters ?\n cloneObject(request.retryParameters) :\n shaka.net.NetworkingEngine.defaultRetryParameters();\n request.uris = cloneObject(request.uris);\n\n var filterStartMs = Date.now();\n\n // Send to the filter first, in-case they change the URI.\n var p = Promise.resolve();\n this.requestFilters_.forEach(function(requestFilter) {\n // Request filters are resolved sequentially.\n p = p.then(requestFilter.bind(null, type, request));\n });\n\n // Catch any errors thrown by request filters, and substitute\n // them with a Shaka-native error.\n p = p.catch(function(e) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.REQUEST_FILTER_ERROR, e);\n });\n\n // Send out the request, and get a response.\n // The entire code is inside a then clause; thus, if a filter\n // rejects or errors, the networking engine will never send.\n p = p.then(function() {\n var filterTimeMs = (Date.now() - filterStartMs);\n\n var retry = request.retryParameters || {};\n var maxAttempts = retry.maxAttempts || 1;\n var backoffFactor = retry.backoffFactor || 2.0;\n var delay = (retry.baseDelay == null ? 1000 : retry.baseDelay);\n\n var p = this.send_(type, request, 0, filterTimeMs);\n for (var i = 1; i < maxAttempts; i++) {\n var index = i % request.uris.length;\n p = p.catch(function(delay, index, err) {\n if (err && err.severity == shaka.util.Error.Severity.RECOVERABLE)\n return this.resend_(type, request, delay, index, filterTimeMs);\n throw err;\n }.bind(this, delay, index));\n delay *= backoffFactor;\n }\n\n return p;\n }.bind(this));\n\n // Add the request to the array.\n this.requests_.push(p);\n return p.then(function(response) {\n if (this.requests_.indexOf(p) >= 0) {\n this.requests_.splice(this.requests_.indexOf(p), 1);\n }\n if (this.onSegmentDownloaded_ && !response.fromCache &&\n type == shaka.net.NetworkingEngine.RequestType.SEGMENT) {\n this.onSegmentDownloaded_(response.timeMs, response.data.byteLength);\n }\n return response;\n }.bind(this)).catch(function(e) {\n // Ignore if using |Promise.reject()| to signal destroy.\n if (e) {\n goog.asserts.assert(e instanceof shaka.util.Error, 'Wrong error type');\n e.severity = shaka.util.Error.Severity.CRITICAL;\n }\n\n if (this.requests_.indexOf(p) >= 0) {\n this.requests_.splice(this.requests_.indexOf(p), 1);\n }\n return Promise.reject(e);\n }.bind(this));\n};\n\n\n/**\n * Sends the given request to the correct plugin. This does not handle retry.\n *\n * @param {shaka.net.NetworkingEngine.RequestType} type\n * @param {shakaExtern.Request} request\n * @param {number} index\n * @param {number} requestFilterTime\n * @return {!Promise.<shakaExtern.Response>}\n * @private\n */\nshaka.net.NetworkingEngine.prototype.send_ = function(\n type, request, index, requestFilterTime) {\n // Retries sent after destroy is called are rejected.\n if (this.destroyed_)\n return Promise.reject();\n\n var uri = new goog.Uri(request.uris[index]);\n var scheme = uri.getScheme();\n\n if (!scheme) {\n // If there is no scheme, infer one from the location.\n scheme = shaka.net.NetworkingEngine.getLocationProtocol_();\n goog.asserts.assert(scheme[scheme.length - 1] == ':',\n 'location.protocol expected to end with a colon!');\n // Drop the colon.\n scheme = scheme.slice(0, -1);\n\n // Override the original URI to make the scheme explicit.\n uri.setScheme(scheme);\n request.uris[index] = uri.toString();\n }\n\n var plugin = shaka.net.NetworkingEngine.schemes_[scheme];\n if (!plugin) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.UNSUPPORTED_SCHEME,\n uri));\n }\n\n var startTimeMs = Date.now();\n return plugin(request.uris[index], request, type).then(function(response) {\n if (response.timeMs == undefined)\n response.timeMs = Date.now() - startTimeMs;\n var filterStartMs = Date.now();\n\n var p = Promise.resolve();\n this.responseFilters_.forEach(function(responseFilter) {\n // Response filters are resolved sequentially.\n p = p.then(function() {\n return Promise.resolve(responseFilter(type, response));\n }.bind(this));\n });\n\n // Catch any errors thrown by response filters, and substitute\n // them with a Shaka-native error.\n p = p.catch(function(e) {\n var severity = shaka.util.Error.Severity.CRITICAL;\n if (e instanceof shaka.util.Error)\n severity = e.severity;\n\n throw new shaka.util.Error(\n severity,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.RESPONSE_FILTER_ERROR, e);\n });\n\n return p.then(function() {\n response.timeMs += Date.now() - filterStartMs;\n response.timeMs += requestFilterTime;\n\n return response;\n });\n }.bind(this));\n};\n\n\n/**\n * Resends the request after applying a delay. This does not handle retry.\n *\n * @param {shaka.net.NetworkingEngine.RequestType} type\n * @param {shakaExtern.Request} request\n * @param {number} delayMs The current base delay.\n * @param {number} index\n * @param {number} requestFilterTime\n * @return {!Promise.<shakaExtern.Response>}\n * @private\n */\nshaka.net.NetworkingEngine.prototype.resend_ =\n function(type, request, delayMs, index, requestFilterTime) {\n var p = new shaka.util.PublicPromise();\n\n // Fuzz the delay to avoid tons of clients hitting the server at once\n // after it recovers from whatever is causing it to fail.\n var retry = request.retryParameters || {};\n var fuzzFactor = (retry.fuzzFactor == null ? 0.5 : retry.fuzzFactor);\n var negToPosOne = (Math.random() * 2.0) - 1.0;\n var negToPosFuzzFactor = negToPosOne * fuzzFactor;\n var fuzzedDelay = delayMs * (1.0 + negToPosFuzzFactor);\n shaka.net.NetworkingEngine.setTimeout_(p.resolve, fuzzedDelay);\n\n return p.then(this.send_.bind(this, type, request, index, requestFilterTime));\n};\n\n\n/**\n * This is here only for testability. We can't mock location in our tests on\n * all browsers, so instead we mock this.\n *\n * @return {string} The value of location.protocol.\n * @private\n */\nshaka.net.NetworkingEngine.getLocationProtocol_ = function() {\n return location.protocol;\n};\n\n\n/**\n * This is here only for testability. Mocking global setTimeout can lead to\n * unintended interactions with other tests. So instead, we mock this.\n *\n * @param {Function} fn The callback to invoke when the timeout expires.\n * @param {number} timeoutMs The timeout in milliseconds.\n * @return {number} The timeout ID.\n * @private\n */\nshaka.net.NetworkingEngine.setTimeout_ = function(fn, timeoutMs) {\n return window.setTimeout(fn, timeoutMs);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/net/networking_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.ArrayUtils');\n\n\n/**\n * @namespace shaka.util.ArrayUtils\n * @summary Array utility functions.\n */\n\n\n/**\n * Remove duplicate entries from an array. Order N^2, so use with caution.\n * @param {!Array.<T>} array\n * @param {function(T, T): boolean=} opt_compareFn An optional function which\n * will be used to compare items in the array.\n * @return {!Array.<T>}\n * @template T\n */\nshaka.util.ArrayUtils.removeDuplicates = function(array, opt_compareFn) {\n var result = [];\n for (var i = 0; i < array.length; ++i) {\n var matchFound = false;\n for (var j = 0; j < result.length; ++j) {\n matchFound = opt_compareFn ? opt_compareFn(array[i], result[j]) :\n array[i] === result[j];\n if (matchFound) break;\n }\n if (!matchFound) {\n result.push(array[i]);\n }\n }\n return result;\n};\n\n\n/**\n * Find an item in an array. For use when comparison of entries via == will\n * not suffice.\n * @param {!Array.<T>} array\n * @param {T} value\n * @param {function(T, T): boolean} compareFn A function which will be used to\n * compare items in the array.\n * @return {number} The index, or -1 if not found.\n * @template T\n */\nshaka.util.ArrayUtils.indexOf = function(array, value, compareFn) {\n for (var i = 0; i < array.length; ++i) {\n if (compareFn(array[i], value)) {\n return i;\n }\n }\n return -1;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/array_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.MultiMap');\n\n\n\n/**\n * A simple multimap template.\n * @constructor\n * @struct\n * @template T\n */\nshaka.util.MultiMap = function() {\n /** @private {!Object.<string, !Array.<T>>} */\n this.map_ = {};\n};\n\n\n/**\n * Add a key, value pair to the map.\n * @param {string} key\n * @param {T} value\n */\nshaka.util.MultiMap.prototype.push = function(key, value) {\n if (this.map_.hasOwnProperty(key)) {\n this.map_[key].push(value);\n } else {\n this.map_[key] = [value];\n }\n};\n\n\n/**\n * Get a list of values by key.\n * @param {string} key\n * @return {Array.<T>} or null if no such key exists.\n */\nshaka.util.MultiMap.prototype.get = function(key) {\n var list = this.map_[key];\n // slice() clones the list so that it and the map can each be modified\n // without affecting the other.\n return list ? list.slice() : null;\n};\n\n\n/**\n * Get a list of all values.\n * @return {!Array.<T>}\n */\nshaka.util.MultiMap.prototype.getAll = function() {\n var list = [];\n for (var key in this.map_) {\n list.push.apply(list, this.map_[key]);\n }\n return list;\n};\n\n\n/**\n * Remove a specific value, if it exists.\n * @param {string} key\n * @param {T} value\n */\nshaka.util.MultiMap.prototype.remove = function(key, value) {\n var list = this.map_[key];\n if (!list) return;\n for (var i = 0; i < list.length; ++i) {\n if (list[i] == value) {\n list.splice(i, 1);\n --i;\n }\n }\n};\n\n\n/**\n * Clear all keys and values from the multimap.\n */\nshaka.util.MultiMap.prototype.clear = function() {\n this.map_ = {};\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/multi_map.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.EventManager');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.MultiMap');\n\n\n\n/**\n * Creates a new EventManager. An EventManager maintains a collection of \"event\n * bindings\" between event targets and event listeners.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n */\nshaka.util.EventManager = function() {\n /**\n * Maps an event type to an array of event bindings.\n * @private {shaka.util.MultiMap.<!shaka.util.EventManager.Binding_>}\n */\n this.bindingMap_ = new shaka.util.MultiMap();\n};\n\n\n/**\n * @typedef {function(!Event)}\n */\nshaka.util.EventManager.ListenerType;\n\n\n/**\n * Detaches all event listeners.\n * @override\n */\nshaka.util.EventManager.prototype.destroy = function() {\n this.removeAll();\n this.bindingMap_ = null;\n return Promise.resolve();\n};\n\n\n/**\n * Attaches an event listener to an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {shaka.util.EventManager.ListenerType} listener The event listener.\n */\nshaka.util.EventManager.prototype.listen = function(target, type, listener) {\n if (!this.bindingMap_) return;\n\n var binding = new shaka.util.EventManager.Binding_(target, type, listener);\n this.bindingMap_.push(type, binding);\n};\n\n\n/**\n * Attaches an event listener to an event target. The listener will be removed\n * when the first instance of the event is fired.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {shaka.util.EventManager.ListenerType} listener The event listener.\n */\nshaka.util.EventManager.prototype.listenOnce =\n function(target, type, listener) {\n // Install a shim listener that will stop listening after the first event.\n this.listen(target, type, function(event) {\n // Stop listening to this event.\n this.unlisten(target, type);\n // Call the original listener.\n listener(event);\n }.bind(this));\n};\n\n\n/**\n * Detaches an event listener from an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n */\nshaka.util.EventManager.prototype.unlisten = function(target, type) {\n if (!this.bindingMap_) return;\n\n var list = this.bindingMap_.get(type) || [];\n\n for (var i = 0; i < list.length; ++i) {\n var binding = list[i];\n\n if (binding.target == target) {\n binding.unlisten();\n this.bindingMap_.remove(type, binding);\n }\n }\n};\n\n\n/**\n * Detaches all event listeners from all targets.\n */\nshaka.util.EventManager.prototype.removeAll = function() {\n if (!this.bindingMap_) return;\n\n var list = this.bindingMap_.getAll();\n\n for (var i = 0; i < list.length; ++i) {\n list[i].unlisten();\n }\n\n this.bindingMap_.clear();\n};\n\n\n\n/**\n * Creates a new Binding_ and attaches the event listener to the event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {shaka.util.EventManager.ListenerType} listener The event listener.\n * @constructor\n * @private\n */\nshaka.util.EventManager.Binding_ = function(target, type, listener) {\n /** @type {EventTarget} */\n this.target = target;\n\n /** @type {string} */\n this.type = type;\n\n /** @type {?shaka.util.EventManager.ListenerType} */\n this.listener = listener;\n\n this.target.addEventListener(type, listener, false);\n};\n\n\n/**\n * Detaches the event listener from the event target. This does nothing if the\n * event listener is already detached.\n */\nshaka.util.EventManager.Binding_.prototype.unlisten = function() {\n goog.asserts.assert(this.target, 'Missing target');\n this.target.removeEventListener(this.type, this.listener, false);\n\n this.target = null;\n this.listener = null;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/event_manager.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.MapUtils');\n\n\n/**\n * @namespace shaka.util.MapUtils\n * @summary A set of map/object utility functions.\n */\n\n\n/**\n * Returns true if the map is empty; otherwise, returns false.\n *\n * @param {Object.<KEY, VALUE>} object\n * @return {boolean}\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.empty = function(object) {\n return !object || Object.keys(object).length == 0;\n};\n\n\n/**\n * Gets the map's values.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @return {!Array.<VALUE>}\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.values = function(object) {\n return Object.keys(object).map(function(key) { return object[key]; });\n};\n\n\n/**\n * Converts the values in the given Map to a different value.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @param {function(VALUE, KEY=):OUTPUT} callback\n * @return {!Object.<KEY, OUTPUT>}\n * @template KEY,VALUE,OUTPUT\n */\nshaka.util.MapUtils.map = function(object, callback) {\n return Object.keys(object).reduce(function(ret, key) {\n var value = object[key];\n ret[key] = callback(value, key);\n return ret;\n }, {});\n};\n\n\n/**\n * Returns true if every entry matches the predicate.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @param {function(KEY, VALUE):boolean} callback\n * @return {boolean}\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.every = function(object, callback) {\n return Object.keys(object).every(function(key) {\n return callback(key, object[key]);\n });\n};\n\n\n/**\n * Invokes the callback for each entry in the map.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @param {function(KEY, VALUE)} callback\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.forEach = function(object, callback) {\n Object.keys(object).forEach(function(key) {\n callback(key, object[key]);\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/map_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.StringUtils');\n\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\n\n\n/**\n * @namespace shaka.util.StringUtils\n * @summary A set of string utility functions.\n * @exportDoc\n */\n\n\n/**\n * Creates a string from the given buffer as UTF-8 encoding.\n *\n * @param {?BufferSource} data\n * @return {string}\n * @throws {shaka.util.Error}\n * @export\n */\nshaka.util.StringUtils.fromUTF8 = function(data) {\n if (!data) return '';\n\n var uint8 = new Uint8Array(data);\n // If present, strip off the UTF-8 BOM.\n if (uint8[0] == 0xef && uint8[1] == 0xbb && uint8[2] == 0xbf) {\n uint8 = uint8.subarray(3);\n }\n\n // http://stackoverflow.com/a/13691499\n var utf8 = shaka.util.StringUtils.fromCharCode_(uint8);\n // This converts each character in the string to an escape sequence. If the\n // character is in the ASCII range, it is not converted; otherwise it is\n // converted to a URI escape sequence.\n // Example: '\\x67\\x35\\xe3\\x82\\xac' -> 'g#%E3%82%AC'\n var escaped = escape(utf8);\n // Decode the escaped sequence. This will interpret UTF-8 sequences into the\n // correct character.\n // Example: 'g#%E3%82%AC' -> 'g#€'\n try {\n return decodeURIComponent(escaped);\n } catch (e) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.BAD_ENCODING);\n }\n};\n\n\n/**\n * Creates a string from the given buffer as UTF-16 encoding.\n *\n * @param {?BufferSource} data\n * @param {boolean} littleEndian true to read little endian, false to read big.\n * @param {boolean=} opt_noThrow true to avoid throwing in cases where we may\n * expect invalid input. If noThrow is true and the data has an odd length,\n * it will be truncated.\n * @return {string}\n * @throws {shaka.util.Error}\n * @export\n */\nshaka.util.StringUtils.fromUTF16 = function(data, littleEndian, opt_noThrow) {\n if (!data) return '';\n\n if (!opt_noThrow && data.byteLength % 2 != 0) {\n shaka.log.error('Data has an incorrect length, must be even.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.BAD_ENCODING);\n }\n\n /** @type {ArrayBuffer} */\n var buffer;\n if (data instanceof ArrayBuffer) {\n buffer = data;\n } else {\n // Have to create a new buffer because the argument may be a smaller\n // view on a larger ArrayBuffer. We cannot use an ArrayBufferView in\n // a DataView.\n var temp = new Uint8Array(data.byteLength);\n temp.set(new Uint8Array(data));\n buffer = temp.buffer;\n }\n\n // Use a DataView to ensure correct endianness.\n var length = Math.floor(data.byteLength / 2);\n var arr = new Uint16Array(length);\n var dataView = new DataView(buffer);\n for (var i = 0; i < length; i++) {\n arr[i] = dataView.getUint16(i * 2, littleEndian);\n }\n return shaka.util.StringUtils.fromCharCode_(arr);\n};\n\n\n/**\n * Creates a string from the given buffer, auto-detecting the encoding that is\n * being used. If it cannot detect the encoding, it will throw an exception.\n *\n * @param {?BufferSource} data\n * @return {string}\n * @throws {shaka.util.Error}\n * @export\n */\nshaka.util.StringUtils.fromBytesAutoDetect = function(data) {\n var StringUtils = shaka.util.StringUtils;\n\n var uint8 = new Uint8Array(data);\n if (uint8[0] == 0xef && uint8[1] == 0xbb && uint8[2] == 0xbf)\n return StringUtils.fromUTF8(uint8);\n else if (uint8[0] == 0xfe && uint8[1] == 0xff)\n return StringUtils.fromUTF16(uint8.subarray(2), false /* littleEndian */);\n else if (uint8[0] == 0xff && uint8[1] == 0xfe)\n return StringUtils.fromUTF16(uint8.subarray(2), true /* littleEndian */);\n\n var isAscii = (function(arr, i) {\n // arr[i] >= ' ' && arr[i] <= '~';\n return arr.byteLength <= i || (arr[i] >= 0x20 && arr[i] <= 0x7e);\n }.bind(null, uint8));\n\n shaka.log.debug('Unable to find byte-order-mark, making an educated guess.');\n if (uint8[0] == 0 && uint8[2] == 0)\n return StringUtils.fromUTF16(data, false /* littleEndian */);\n else if (uint8[1] == 0 && uint8[3] == 0)\n return StringUtils.fromUTF16(data, true /* littleEndian */);\n else if (isAscii(0) && isAscii(1) && isAscii(2) && isAscii(3))\n return StringUtils.fromUTF8(data);\n\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.UNABLE_TO_DETECT_ENCODING);\n};\n\n\n/**\n * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.\n *\n * @param {string} str\n * @return {!ArrayBuffer}\n * @export\n */\nshaka.util.StringUtils.toUTF8 = function(str) {\n // http://stackoverflow.com/a/13691499\n // Converts the given string to a URI encoded string. If a character falls\n // in the ASCII range, it is not converted; otherwise it will be converted to\n // a series of URI escape sequences according to UTF-8.\n // Example: 'g#€' -> 'g#%E3%82%AC'\n var encoded = encodeURIComponent(str);\n // Convert each escape sequence individually into a character. Each escape\n // sequence is interpreted as a code-point, so if an escape sequence happens\n // to be part of a multi-byte sequence, each byte will be converted to a\n // single character.\n // Example: 'g#%E3%82%AC' -> '\\x67\\x35\\xe3\\x82\\xac'\n var utf8 = unescape(encoded);\n\n var result = new Uint8Array(utf8.length);\n for (var i = 0; i < utf8.length; ++i) {\n result[i] = utf8.charCodeAt(i);\n }\n return result.buffer;\n};\n\n\n/**\n * Creates a new string from the given array of char codes.\n *\n * @param {!TypedArray} args\n * @return {string}\n * @private\n */\nshaka.util.StringUtils.fromCharCode_ = function(args) {\n var max = 16000;\n var ret = '';\n for (var i = 0; i < args.length; i += max) {\n var subArray = args.subarray(i, i + max);\n ret += String.fromCharCode.apply(null, subArray);\n }\n\n return ret;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/string_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Timer');\n\n\n\n/**\n * A simple cancelable timer.\n * @param {Function} callback\n * @constructor\n * @struct\n */\nshaka.util.Timer = function(callback) {\n /** @private {?number} */\n this.id_ = null;\n\n /** @private {Function} */\n this.callback_ = (function() {\n this.id_ = null;\n callback();\n }.bind(this));\n};\n\n\n/**\n * Cancel the timer, if it's running.\n */\nshaka.util.Timer.prototype.cancel = function() {\n if (this.id_ != null) {\n clearTimeout(this.id_);\n this.id_ = null;\n }\n};\n\n\n/**\n * Schedule the timer, canceling any previous scheduling.\n * @param {number} seconds\n */\nshaka.util.Timer.prototype.schedule = function(seconds) {\n this.cancel();\n this.id_ = setTimeout(this.callback_, seconds * 1000);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/timer.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * @namespace shaka.util.Uint8ArrayUtils\n * @summary A set of Uint8Array utility functions.\n * @exportDoc\n */\n\n\n/**\n * Convert a Uint8Array to a base64 string. The output will always use the\n * alternate encoding/alphabet also known as \"base64url\".\n * @param {!Uint8Array} arr\n * @param {boolean=} opt_padding If true, pad the output with equals signs.\n * Defaults to true.\n * @return {string}\n * @export\n */\nshaka.util.Uint8ArrayUtils.toBase64 = function(arr, opt_padding) {\n // btoa expects a \"raw string\" where each character is interpreted as a byte.\n var bytes = String.fromCharCode.apply(null, arr);\n var padding = (opt_padding == undefined) ? true : opt_padding;\n var base64 = window.btoa(bytes).replace(/\\+/g, '-').replace(/\\//g, '_');\n return padding ? base64 : base64.replace(/=*$/, '');\n};\n\n\n/**\n * Convert a base64 string to a Uint8Array. Accepts either the standard\n * alphabet or the alternate \"base64url\" alphabet.\n * @param {string} str\n * @return {!Uint8Array}\n * @export\n */\nshaka.util.Uint8ArrayUtils.fromBase64 = function(str) {\n // atob creates a \"raw string\" where each character is interpreted as a byte.\n var bytes = window.atob(str.replace(/-/g, '+').replace(/_/g, '/'));\n var result = new Uint8Array(bytes.length);\n for (var i = 0; i < bytes.length; ++i) {\n result[i] = bytes.charCodeAt(i);\n }\n return result;\n};\n\n\n/**\n * Convert a hex string to a Uint8Array.\n * @param {string} str\n * @return {!Uint8Array}\n * @export\n */\nshaka.util.Uint8ArrayUtils.fromHex = function(str) {\n var arr = new Uint8Array(str.length / 2);\n for (var i = 0; i < str.length; i += 2) {\n arr[i / 2] = window.parseInt(str.substr(i, 2), 16);\n }\n return arr;\n};\n\n\n/**\n * Convert a Uint8Array to a hex string.\n * @param {!Uint8Array} arr\n * @return {string}\n * @export\n */\nshaka.util.Uint8ArrayUtils.toHex = function(arr) {\n var hex = '';\n for (var i = 0; i < arr.length; ++i) {\n var value = arr[i].toString(16);\n if (value.length == 1) value = '0' + value;\n hex += value;\n }\n return hex;\n};\n\n\n/**\n * Compare two Uint8Arrays for equality.\n * @param {Uint8Array} arr1\n * @param {Uint8Array} arr2\n * @return {boolean}\n * @export\n */\nshaka.util.Uint8ArrayUtils.equal = function(arr1, arr2) {\n if (!arr1 && !arr2) return true;\n if (!arr1 || !arr2) return false;\n if (arr1.length != arr2.length) return false;\n for (var i = 0; i < arr1.length; ++i) {\n if (arr1[i] != arr2[i]) return false;\n }\n return true;\n};\n\n\n/**\n * Concatenate Uint8Arrays.\n * @param {...Uint8Array} var_args\n * @return {Uint8Array}\n * @export\n */\nshaka.util.Uint8ArrayUtils.concat = function(var_args) {\n var totalLength = 0;\n for (var i = 0; i < arguments.length; ++i) {\n totalLength += arguments[i].length;\n }\n\n var result = new Uint8Array(totalLength);\n var offset = 0;\n for (var i = 0; i < arguments.length; ++i) {\n result.set(arguments[i], offset);\n offset += arguments[i].length;\n }\n return result;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/uint8array_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.DrmEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.ArrayUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.Timer');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n\n/**\n * @constructor\n * @param {!shaka.net.NetworkingEngine} networkingEngine\n * @param {function(!shaka.util.Error)} onError Called when an error occurs.\n * @param {function(!Object.<string, string>)} onKeyStatus Called when key\n * status changes. Argument is a map of hex key IDs to statuses.\n * @param {function(string, number)} onExpirationUpdated\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.DrmEngine = function(\n networkingEngine, onError, onKeyStatus, onExpirationUpdated) {\n /** @private {Array.<string>} */\n this.supportedTypes_ = null;\n\n /** @private {MediaKeys} */\n this.mediaKeys_ = null;\n\n /** @private {HTMLMediaElement} */\n this.video_ = null;\n\n /** @private {boolean} */\n this.initialized_ = false;\n\n /** @private {?shakaExtern.DrmInfo} */\n this.currentDrmInfo_ = null;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {!Array.<shaka.media.DrmEngine.ActiveSession>} */\n this.activeSessions_ = [];\n\n /** @private {!Array.<string>} */\n this.offlineSessionIds_ = [];\n\n /** @private {!shaka.util.PublicPromise} */\n this.allSessionsLoaded_ = new shaka.util.PublicPromise();\n\n /** @private {shaka.net.NetworkingEngine} */\n this.networkingEngine_ = networkingEngine;\n\n /** @private {?shakaExtern.DrmConfiguration} */\n this.config_ = null;\n\n /** @private {?function(!shaka.util.Error)} */\n this.onError_ = (function(err) {\n this.allSessionsLoaded_.reject(err);\n onError(err);\n }.bind(this));\n\n /** @private {!Object.<string, string>} */\n this.keyStatusByKeyId_ = {};\n\n /** @private {?function(!Object.<string, string>)} */\n this.onKeyStatus_ = onKeyStatus;\n\n /** @private {?function(string, number)} */\n this.onExpirationUpdated_ = onExpirationUpdated;\n\n /** @private {shaka.util.Timer} */\n this.keyStatusTimer_ = new shaka.util.Timer(\n this.processKeyStatusChanges_.bind(this));\n\n /** @private {boolean} */\n this.destroyed_ = false;\n\n /** @private {boolean} */\n this.isOffline_ = false;\n\n /** @private {!Array.<!MediaKeyMessageEvent>} */\n this.mediaKeyMessageEvents_ = [];\n\n /** @private {boolean} */\n this.initialRequestsSent_ = false;\n\n /** @private {?number} */\n this.expirationInterval_ = setInterval(this.pollExpiration_.bind(this), 1000);\n\n // Add a catch to the Promise to avoid console logs about uncaught errors.\n this.allSessionsLoaded_.catch(function() {});\n};\n\n\n/**\n * @typedef {{\n * loaded: boolean,\n * initData: Uint8Array,\n * session: !MediaKeySession,\n * oldExpiration: number,\n * updatePromise: shaka.util.PublicPromise\n * }}\n *\n * @description A record to track sessions and suppress duplicate init data.\n * @property {boolean} loaded\n * True once the key status has been updated (to a non-pending state). This\n * does not mean the session is 'usable'.\n * @property {Uint8Array} initData\n * The init data used to create the session.\n * @property {!MediaKeySession} session\n * The session object.\n * @property {number} oldExpiration\n * The expiration of the session on the last check. This is used to fire\n * an event when it changes.\n * @property {shaka.util.PublicPromise} updatePromise\n * An optional Promise that will be resolved/rejected on the next update()\n * call. This is used to track the 'license-release' message when calling\n * remove().\n */\nshaka.media.DrmEngine.ActiveSession;\n\n\n/** @override */\nshaka.media.DrmEngine.prototype.destroy = function() {\n var Functional = shaka.util.Functional;\n this.destroyed_ = true;\n\n var async = this.activeSessions_.map(function(activeSession) {\n // Ignore any errors when closing the sessions. One such error would be\n // an invalid state error triggered by closing a session which has not\n // generated any key requests.\n // Chrome sometimes returns |undefined|: https://crbug.com/690664\n var p = activeSession.session.close() || Promise.resolve();\n return p.catch(Functional.noop);\n });\n this.allSessionsLoaded_.reject();\n\n if (this.eventManager_)\n async.push(this.eventManager_.destroy());\n\n if (this.video_) {\n goog.asserts.assert(!this.video_.src, 'video src must be removed first!');\n async.push(this.video_.setMediaKeys(null).catch(Functional.noop));\n }\n\n if (this.expirationInterval_) {\n clearInterval(this.expirationInterval_);\n this.expirationInterval_ = null;\n }\n\n if (this.keyStatusTimer_) {\n this.keyStatusTimer_.cancel();\n }\n this.keyStatusTimer_ = null;\n\n this.currentDrmInfo_ = null;\n this.supportedTypes_ = null;\n this.mediaKeys_ = null;\n this.video_ = null;\n this.eventManager_ = null;\n this.activeSessions_ = [];\n this.offlineSessionIds_ = [];\n this.networkingEngine_ = null; // We don't own it, don't destroy() it.\n this.config_ = null;\n this.onError_ = null;\n this.onExpirationUpdated_ = null;\n\n return Promise.all(async);\n};\n\n\n/**\n * Called by the Player to provide an updated configuration any time it changes.\n * Must be called at least once before init().\n *\n * @param {shakaExtern.DrmConfiguration} config\n */\nshaka.media.DrmEngine.prototype.configure = function(config) {\n this.config_ = config;\n};\n\n\n/**\n * Negotiate for a key system and set up MediaKeys.\n * @param {!shakaExtern.Manifest} manifest The manifest is read for MIME type\n * and DRM information to query EME. If the 'clearKeys' configuration is\n * used, the manifest will be modified to force the use of Clear Key.\n * @param {boolean} offline True if we are storing or loading offline content.\n * @return {!Promise} Resolved if/when a key system has been chosen.\n */\nshaka.media.DrmEngine.prototype.init = function(manifest, offline) {\n goog.asserts.assert(this.config_,\n 'DrmEngine configure() must be called before init()!');\n\n /** @type {!Object.<string, MediaKeySystemConfiguration>} */\n var configsByKeySystem = {};\n\n /** @type {!Array.<string>} */\n var keySystemsInOrder = [];\n\n // |isOffline_| determines what kind of session to create. The argument to\n // |prepareMediaKeyConfigs_| determines the kind of CDM to query for. So\n // we still need persistent state when we are loading offline sessions.\n this.isOffline_ = offline;\n this.offlineSessionIds_ = manifest.offlineSessionIds;\n this.prepareMediaKeyConfigs_(\n manifest, offline || manifest.offlineSessionIds.length > 0,\n configsByKeySystem, keySystemsInOrder);\n\n if (!keySystemsInOrder.length) {\n // Unencrypted.\n this.initialized_ = true;\n return Promise.resolve();\n }\n\n return this.queryMediaKeys_(configsByKeySystem, keySystemsInOrder);\n};\n\n\n/**\n * Attach MediaKeys to the video element and start processing events.\n * @param {HTMLMediaElement} video\n * @return {!Promise}\n */\nshaka.media.DrmEngine.prototype.attach = function(video) {\n if (!this.mediaKeys_) {\n // Unencrypted, or so we think. We listen for encrypted events in order to\n // warn when the stream is encrypted, even though the manifest does not know\n // it.\n // Don't complain about this twice, so just listenOnce().\n this.eventManager_.listenOnce(video, 'encrypted', function(event) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.ENCRYPTED_CONTENT_WITHOUT_DRM_INFO));\n }.bind(this));\n return Promise.resolve();\n }\n\n this.video_ = video;\n\n this.eventManager_.listenOnce(this.video_, 'play', this.onPlay_.bind(this));\n\n var setMediaKeys = this.video_.setMediaKeys(this.mediaKeys_);\n setMediaKeys = setMediaKeys.catch(function(exception) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_ATTACH_TO_VIDEO,\n exception.message));\n });\n\n var setServerCertificate = null;\n if (this.currentDrmInfo_.serverCertificate) {\n setServerCertificate = this.mediaKeys_.setServerCertificate(\n this.currentDrmInfo_.serverCertificate).then(function(supported) {\n if (!supported) {\n shaka.log.warning('Server certificates are not supported by the key' +\n ' system. The server certificate has been ignored.');\n }\n }).catch(function(exception) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.INVALID_SERVER_CERTIFICATE,\n exception.message));\n });\n }\n\n return Promise.all([setMediaKeys, setServerCertificate]).then(function() {\n if (this.destroyed_) return Promise.reject();\n\n this.createOrLoad();\n if (!this.currentDrmInfo_.initData.length &&\n !this.offlineSessionIds_.length) {\n // Explicit init data for any one stream or an offline session is\n // sufficient to suppress 'encrypted' events for all streams.\n var onEncrypted = /** @type {shaka.util.EventManager.ListenerType} */(\n this.onEncrypted_.bind(this));\n this.eventManager_.listen(this.video_, 'encrypted', onEncrypted);\n }\n }.bind(this)).catch(function(error) {\n if (this.destroyed_) return Promise.resolve(); // Ignore destruction errors\n return Promise.reject(error);\n }.bind(this));\n};\n\n\n/**\n * Removes the given offline sessions and deletes their data. Must call init()\n * before this. This will wait until the 'license-release' message is handled\n * and the resulting Promise will be rejected if there is an error with that.\n *\n * @param {!Array.<string>} sessions\n * @return {!Promise}\n */\nshaka.media.DrmEngine.prototype.removeSessions = function(sessions) {\n goog.asserts.assert(this.mediaKeys_ || !sessions.length,\n 'Must call init() before removeSessions');\n return Promise.all(sessions.map(function(sessionId) {\n return this.loadOfflineSession_(sessionId).then(function(session) {\n // This will be null on error, such as session not found.\n if (session) {\n var p = new shaka.util.PublicPromise();\n // TODO: Consider adding a timeout to get the 'message' event.\n // Note that the 'message' event will get raised after the remove()\n // promise resolves.\n\n for (var i = 0; i < this.activeSessions_.length; i++) {\n if (this.activeSessions_[i].session == session) {\n this.activeSessions_[i].updatePromise = p;\n break;\n }\n }\n return Promise.all([session.remove(), p]);\n }\n }.bind(this));\n }.bind(this)));\n};\n\n\n/**\n * Creates the sessions for the init data and waits for them to become ready.\n *\n * @return {!Promise}\n */\nshaka.media.DrmEngine.prototype.createOrLoad = function() {\n var initDatas = this.currentDrmInfo_ ? this.currentDrmInfo_.initData : [];\n initDatas.forEach(function(initDataOverride) {\n this.createTemporarySession_(\n initDataOverride.initDataType, initDataOverride.initData);\n }.bind(this));\n this.offlineSessionIds_.forEach(function(sessionId) {\n this.loadOfflineSession_(sessionId);\n }.bind(this));\n\n if (!initDatas.length && !this.offlineSessionIds_.length)\n this.allSessionsLoaded_.resolve();\n return this.allSessionsLoaded_;\n};\n\n\n/** @return {boolean} */\nshaka.media.DrmEngine.prototype.initialized = function() {\n return this.initialized_;\n};\n\n\n/** @return {string} */\nshaka.media.DrmEngine.prototype.keySystem = function() {\n return this.currentDrmInfo_ ? this.currentDrmInfo_.keySystem : '';\n};\n\n\n/**\n * Returns an array of the media types supported by the current key system.\n * These will be full mime types (e.g. 'video/webm; codecs=\"vp8\"').\n *\n * @return {Array.<string>}\n */\nshaka.media.DrmEngine.prototype.getSupportedTypes = function() {\n return this.supportedTypes_;\n};\n\n\n/**\n * Returns the ID of the sessions currently active.\n *\n * @return {!Array.<string>}\n */\nshaka.media.DrmEngine.prototype.getSessionIds = function() {\n return this.activeSessions_.map(function(session) {\n return session.session.sessionId;\n });\n};\n\n\n/**\n * Returns the next expiration time, or Infinity.\n * @return {number}\n */\nshaka.media.DrmEngine.prototype.getExpiration = function() {\n var expirations = this.activeSessions_.map(function(session) {\n var expiration = session.session.expiration;\n return isNaN(expiration) ? Infinity : expiration;\n });\n // This will equal Infinity if there are no entries.\n return Math.min.apply(Math, expirations);\n};\n\n\n/**\n * Returns the DrmInfo that was used to initialize the current key system.\n *\n * @return {?shakaExtern.DrmInfo}\n */\nshaka.media.DrmEngine.prototype.getDrmInfo = function() {\n return this.currentDrmInfo_;\n};\n\n\n/**\n * @param {!shakaExtern.Manifest} manifest\n * @param {boolean} offline True if we are storing or loading offline content.\n * @param {!Object.<string, MediaKeySystemConfiguration>} configsByKeySystem\n * (Output parameter.) A dictionary of configs, indexed by key system.\n * @param {!Array.<string>} keySystemsInOrder\n * (Output parameter.) A list of key systems in the order in which we\n * encounter them.\n * @see https://goo.gl/nwdYnY for MediaKeySystemConfiguration spec\n * @private\n */\nshaka.media.DrmEngine.prototype.prepareMediaKeyConfigs_ =\n function(manifest, offline, configsByKeySystem, keySystemsInOrder) {\n var clearKeyDrmInfo = this.configureClearKey_();\n\n manifest.periods.forEach(function(period) {\n period.variants.forEach(function(variant) {\n // clearKey config overrides manifest DrmInfo if present.\n // The manifest is modified so that filtering in Player still works.\n if (clearKeyDrmInfo) {\n variant.drmInfos = [clearKeyDrmInfo];\n }\n\n variant.drmInfos.forEach(function(drmInfo) {\n this.fillInDrmInfoDefaults_(drmInfo);\n\n // Chromecast has a variant of PlayReady that uses a different key\n // system ID. Since manifest parsers convert the standard PlayReady\n // UUID to the standard PlayReady key system ID, here we will switch\n // to the Chromecast version if we are running on that platform.\n // Note that this must come after fillInDrmInfoDefaults_, since the\n // player config uses the standard PlayReady ID for license server\n // configuration.\n if (window.cast && window.cast.__platform__) {\n if (drmInfo.keySystem == 'com.microsoft.playready') {\n drmInfo.keySystem = 'com.chromecast.playready';\n }\n }\n\n var config = configsByKeySystem[drmInfo.keySystem];\n if (!config) {\n config = {\n // ignore initDataTypes\n audioCapabilities: [],\n videoCapabilities: [],\n distinctiveIdentifier: 'optional',\n persistentState: offline ? 'required' : 'optional',\n sessionTypes: [offline ? 'persistent-license' : 'temporary'],\n label: drmInfo.keySystem,\n drmInfos: [] // tracked by us, ignored by EME\n };\n configsByKeySystem[drmInfo.keySystem] = config;\n keySystemsInOrder.push(drmInfo.keySystem);\n }\n\n config.drmInfos.push(drmInfo);\n\n if (drmInfo.distinctiveIdentifierRequired)\n config.distinctiveIdentifier = 'required';\n\n if (drmInfo.persistentStateRequired)\n config.persistentState = 'required';\n\n var streams = [];\n if (variant.video) streams.push(variant.video);\n if (variant.audio) streams.push(variant.audio);\n\n streams.forEach(function(stream) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n /** @type {!Array.<!MediaKeySystemMediaCapability>} */\n var capabilities = (stream.type == ContentType.VIDEO) ?\n config.videoCapabilities : config.audioCapabilities;\n /** @type {string} */\n var robustness = ((stream.type == ContentType.VIDEO) ?\n drmInfo.videoRobustness : drmInfo.audioRobustness) || '';\n\n var fullMimeType = stream.mimeType;\n if (stream.codecs) {\n fullMimeType += '; codecs=\"' + stream.codecs + '\"';\n }\n\n capabilities.push({\n robustness: robustness,\n contentType: fullMimeType\n });\n }.bind(this)); // streams.forEach (variant.video, variant.audio)\n }.bind(this)); // variant.drmInfos.forEach\n }.bind(this)); // periods.variants.forEach\n }.bind(this)); // manifest.perios.forEach\n};\n\n\n/**\n * @param {!Object.<string, MediaKeySystemConfiguration>} configsByKeySystem\n * A dictionary of configs, indexed by key system.\n * @param {!Array.<string>} keySystemsInOrder\n * A list of key systems in the order in which we should query them.\n * On a browser which supports multiple key systems, the order may indicate\n * a real preference for the application.\n * @return {!Promise} Resolved if/when a key system has been chosen.\n * @private\n */\nshaka.media.DrmEngine.prototype.queryMediaKeys_ =\n function(configsByKeySystem, keySystemsInOrder) {\n if (keySystemsInOrder.length == 1 && keySystemsInOrder[0] == '') {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.NO_RECOGNIZED_KEY_SYSTEMS));\n }\n\n // Wait to reject this initial Promise until we have built the entire chain.\n var instigator = new shaka.util.PublicPromise();\n var p = instigator;\n\n // Try key systems with configured license servers first. We only have to try\n // key systems without configured license servers for diagnostic reasons, so\n // that we can differentiate between \"none of these key systems are available\"\n // and \"some are available, but you did not configure them properly.\" The\n // former takes precedence.\n [true, false].forEach(function(shouldHaveLicenseServer) {\n keySystemsInOrder.forEach(function(keySystem) {\n var config = configsByKeySystem[keySystem];\n\n var hasLicenseServer = config.drmInfos.some(function(info) {\n return !!info.licenseServerUri;\n });\n if (hasLicenseServer != shouldHaveLicenseServer) return;\n\n // If there are no tracks of a type, these should be not present.\n // Otherwise the query will fail.\n if (config.audioCapabilities.length == 0) {\n delete config.audioCapabilities;\n }\n if (config.videoCapabilities.length == 0) {\n delete config.videoCapabilities;\n }\n\n p = p.catch(function() {\n if (this.destroyed_) return Promise.reject();\n return navigator.requestMediaKeySystemAccess(keySystem, [config]);\n }.bind(this));\n }.bind(this));\n }.bind(this));\n\n p = p.catch(function() {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE));\n });\n\n p = p.then(function(mediaKeySystemAccess) {\n if (this.destroyed_) return Promise.reject();\n\n // TODO: Remove once Edge has released a fix for https://goo.gl/qMeV7v\n var isEdge = navigator.userAgent.indexOf('Edge/') >= 0;\n\n // Store the capabilities of the key system.\n var realConfig = mediaKeySystemAccess.getConfiguration();\n var audioCaps = realConfig.audioCapabilities || [];\n var videoCaps = realConfig.videoCapabilities || [];\n var caps = audioCaps.concat(videoCaps);\n this.supportedTypes_ = caps.map(function(c) { return c.contentType; });\n if (isEdge) {\n // Edge 14 does not report correct capabilities. It will only report the\n // first MIME type even if the others are supported. To work around this,\n // set the supported types to null, which Player will use as a signal that\n // the information is not available.\n // See: https://goo.gl/qMeV7v\n this.supportedTypes_ = null;\n }\n goog.asserts.assert(!this.supportedTypes_ || this.supportedTypes_.length,\n 'We should get at least one supported MIME type');\n\n var originalConfig = configsByKeySystem[mediaKeySystemAccess.keySystem];\n this.createCurrentDrmInfo_(\n mediaKeySystemAccess.keySystem, originalConfig,\n originalConfig.drmInfos);\n\n if (!this.currentDrmInfo_.licenseServerUri) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.NO_LICENSE_SERVER_GIVEN));\n }\n\n return mediaKeySystemAccess.createMediaKeys();\n }.bind(this)).then(function(mediaKeys) {\n if (this.destroyed_) return Promise.reject();\n\n this.mediaKeys_ = mediaKeys;\n this.initialized_ = true;\n }.bind(this)).catch(function(exception) {\n if (this.destroyed_) return Promise.resolve(); // Ignore destruction errors\n\n // Don't rewrap a shaka.util.Error from earlier in the chain:\n this.currentDrmInfo_ = null;\n this.supportedTypes_ = null;\n if (exception instanceof shaka.util.Error) {\n return Promise.reject(exception);\n }\n\n // We failed to create MediaKeys. This generally shouldn't happen.\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_CDM,\n exception.message));\n }.bind(this));\n\n instigator.reject();\n return p;\n};\n\n\n/**\n * Use this.config_ to fill in missing values in drmInfo.\n * @param {shakaExtern.DrmInfo} drmInfo\n * @private\n */\nshaka.media.DrmEngine.prototype.fillInDrmInfoDefaults_ = function(drmInfo) {\n var keySystem = drmInfo.keySystem;\n\n if (!keySystem) {\n // This is a placeholder from the manifest parser for an unrecognized key\n // system. Skip this entry, to avoid logging nonsensical errors.\n return;\n }\n\n if (!drmInfo.licenseServerUri) {\n var server = this.config_.servers[keySystem];\n if (server) {\n drmInfo.licenseServerUri = server;\n } else {\n shaka.log.error('No license server configured for ' + keySystem);\n }\n }\n\n if (!drmInfo.keyIds) {\n drmInfo.keyIds = [];\n }\n\n var advanced = this.config_.advanced[keySystem];\n if (advanced) {\n if (!drmInfo.distinctiveIdentifierRequired) {\n drmInfo.distinctiveIdentifierRequired =\n advanced.distinctiveIdentifierRequired;\n }\n\n if (!drmInfo.persistentStateRequired) {\n drmInfo.persistentStateRequired = advanced.persistentStateRequired;\n }\n\n if (!drmInfo.videoRobustness) {\n drmInfo.videoRobustness = advanced.videoRobustness;\n }\n\n if (!drmInfo.audioRobustness) {\n drmInfo.audioRobustness = advanced.audioRobustness;\n }\n\n if (!drmInfo.serverCertificate) {\n drmInfo.serverCertificate = advanced.serverCertificate;\n }\n }\n};\n\n\n/**\n * Create a DrmInfo using configured clear keys.\n * The server URI will be a data URI which decodes to a clearkey license.\n * @return {?shakaExtern.DrmInfo} or null if clear keys are not configured.\n * @private\n * @see https://goo.gl/6nPdhF for the spec on the clearkey license format.\n */\nshaka.media.DrmEngine.prototype.configureClearKey_ = function() {\n var hasClearKeys = !shaka.util.MapUtils.empty(this.config_.clearKeys);\n if (!hasClearKeys) return null;\n\n var StringUtils = shaka.util.StringUtils;\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n var keys = [];\n var keyIds = [];\n\n for (var keyIdHex in this.config_.clearKeys) {\n var keyHex = this.config_.clearKeys[keyIdHex];\n\n var keyId = Uint8ArrayUtils.fromHex(keyIdHex);\n var key = Uint8ArrayUtils.fromHex(keyHex);\n var keyObj = {\n kty: 'oct',\n kid: Uint8ArrayUtils.toBase64(keyId, false),\n k: Uint8ArrayUtils.toBase64(key, false)\n };\n\n keys.push(keyObj);\n keyIds.push(keyObj.kid);\n }\n\n var jwkSet = {keys: keys};\n var license = JSON.stringify(jwkSet);\n\n // Use the keyids init data since is suggested by EME.\n // Suggestion: https://goo.gl/R72xp4\n // Format: https://goo.gl/75RCP6\n var initDataStr = JSON.stringify({'kids': keyIds});\n var initData = new Uint8Array(StringUtils.toUTF8(initDataStr));\n var initDatas = [{initData: initData, initDataType: 'keyids'}];\n\n return {\n keySystem: 'org.w3.clearkey',\n licenseServerUri: 'data:application/json;base64,' + window.btoa(license),\n distinctiveIdentifierRequired: false,\n persistentStateRequired: false,\n audioRobustness: '',\n videoRobustness: '',\n serverCertificate: null,\n initData: initDatas,\n keyIds: []\n };\n};\n\n\n/**\n * Creates a DrmInfo object describing the settings used to initialize the\n * engine.\n *\n * @param {string} keySystem\n * @param {MediaKeySystemConfiguration} config\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @private\n */\nshaka.media.DrmEngine.prototype.createCurrentDrmInfo_ = function(\n keySystem, config, drmInfos) {\n /** @type {!Array.<string>} */\n var licenseServers = [];\n\n /** @type {!Array.<!Uint8Array>} */\n var serverCerts = [];\n\n /** @type {!Array.<!shakaExtern.InitDataOverride>} */\n var initDatas = [];\n\n /** @type {!Array.<string>} */\n var keyIds = [];\n\n this.processDrmInfos_(drmInfos, licenseServers, serverCerts, initDatas,\n keyIds);\n\n if (serverCerts.length > 1) {\n shaka.log.warning('Multiple unique server certificates found! ' +\n 'Only the first will be used.');\n }\n\n if (licenseServers.length > 1) {\n shaka.log.warning('Multiple unique license server URIs found! ' +\n 'Only the first will be used.');\n }\n\n // TODO: This only works when all DrmInfo have the same robustness.\n var audioRobustness =\n config.audioCapabilities ? config.audioCapabilities[0].robustness : '';\n var videoRobustness =\n config.videoCapabilities ? config.videoCapabilities[0].robustness : '';\n this.currentDrmInfo_ = {\n keySystem: keySystem,\n licenseServerUri: licenseServers[0],\n distinctiveIdentifierRequired: (config.distinctiveIdentifier == 'required'),\n persistentStateRequired: (config.persistentState == 'required'),\n audioRobustness: audioRobustness,\n videoRobustness: videoRobustness,\n serverCertificate: serverCerts[0],\n initData: initDatas,\n keyIds: keyIds\n };\n};\n\n\n/**\n * Extract license server, server cert, and init data from DrmInfos, taking\n * care to eliminate duplicates.\n *\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @param {!Array.<string>} licenseServers\n * @param {!Array.<!Uint8Array>} serverCerts\n * @param {!Array.<!shakaExtern.InitDataOverride>} initDatas\n * @param {!Array.<string>} keyIds\n * @private\n */\nshaka.media.DrmEngine.prototype.processDrmInfos_ =\n function(drmInfos, licenseServers, serverCerts, initDatas, keyIds) {\n /**\n * @param {shakaExtern.InitDataOverride} a\n * @param {shakaExtern.InitDataOverride} b\n * @return {boolean}\n */\n function initDataOverrideEqual(a, b) {\n if (a.keyId && a.keyId == b.keyId) {\n // Two initDatas with the same keyId are considered to be the same,\n // unless that \"same keyId\" is null.\n return true;\n }\n return a.initDataType == b.initDataType &&\n shaka.util.Uint8ArrayUtils.equal(a.initData, b.initData);\n }\n\n drmInfos.forEach(function(drmInfo) {\n // Aliases:\n var ArrayUtils = shaka.util.ArrayUtils;\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n\n // Build an array of unique license servers.\n if (licenseServers.indexOf(drmInfo.licenseServerUri) == -1) {\n licenseServers.push(drmInfo.licenseServerUri);\n }\n\n // Build an array of unique server certs.\n if (drmInfo.serverCertificate) {\n if (ArrayUtils.indexOf(serverCerts, drmInfo.serverCertificate,\n Uint8ArrayUtils.equal) == -1) {\n serverCerts.push(drmInfo.serverCertificate);\n }\n }\n\n // Build an array of unique init datas.\n if (drmInfo.initData) {\n drmInfo.initData.forEach(function(initDataOverride) {\n if (ArrayUtils.indexOf(initDatas, initDataOverride,\n initDataOverrideEqual) == -1) {\n initDatas.push(initDataOverride);\n }\n });\n }\n\n if (drmInfo.keyIds) {\n for (var i = 0; i < drmInfo.keyIds.length; ++i) {\n if (keyIds.indexOf(drmInfo.keyIds[i]) == -1) {\n keyIds.push(drmInfo.keyIds[i]);\n }\n }\n }\n });\n};\n\n\n/**\n * @param {!MediaEncryptedEvent} event\n * @private\n */\nshaka.media.DrmEngine.prototype.onEncrypted_ = function(event) {\n // Aliases:\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n\n var initData = new Uint8Array(event.initData);\n\n // Suppress duplicate init data.\n // Note that some init data are extremely large and can't portably be used as\n // keys in a dictionary.\n for (var i = 0; i < this.activeSessions_.length; ++i) {\n if (Uint8ArrayUtils.equal(initData, this.activeSessions_[i].initData)) {\n shaka.log.debug('Ignoring duplicate init data.');\n return;\n }\n }\n\n this.createTemporarySession_(event.initDataType, initData);\n};\n\n\n/**\n * @param {string} sessionId\n * @return {!Promise.<MediaKeySession>}\n * @private\n */\nshaka.media.DrmEngine.prototype.loadOfflineSession_ = function(sessionId) {\n var session;\n try {\n session = this.mediaKeys_.createSession('persistent-license');\n } catch (exception) {\n var error = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_SESSION,\n exception.message);\n this.onError_(error);\n return Promise.reject(error);\n }\n\n this.eventManager_.listen(session, 'message',\n /** @type {shaka.util.EventManager.ListenerType} */(\n this.onSessionMessage_.bind(this)));\n this.eventManager_.listen(session, 'keystatuseschange',\n this.onKeyStatusesChange_.bind(this));\n\n var activeSession = {\n initData: null,\n session: session,\n loaded: false,\n oldExpiration: Infinity,\n updatePromise: null\n };\n this.activeSessions_.push(activeSession);\n\n return session.load(sessionId).then(function(present) {\n if (this.destroyed_) return;\n\n if (!present) {\n var i = this.activeSessions_.indexOf(activeSession);\n goog.asserts.assert(i >= 0, 'Session must be in the array');\n this.activeSessions_.splice(i, 1);\n\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.OFFLINE_SESSION_REMOVED));\n return;\n }\n\n // TODO: We should get a key status change event. Remove once Chrome CDM\n // is fixed.\n activeSession.loaded = true;\n if (this.activeSessions_.every(function(s) { return s.loaded; }))\n this.allSessionsLoaded_.resolve();\n\n return session;\n }.bind(this), function(error) {\n if (this.destroyed_) return;\n\n var i = this.activeSessions_.indexOf(activeSession);\n goog.asserts.assert(i >= 0, 'Session must be in the array');\n this.activeSessions_.splice(i, 1);\n\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_SESSION,\n error.message));\n }.bind(this));\n};\n\n\n/**\n * @param {string} initDataType\n * @param {!Uint8Array} initData\n * @private\n */\nshaka.media.DrmEngine.prototype.createTemporarySession_ =\n function(initDataType, initData) {\n var session;\n try {\n if (this.isOffline_) {\n session = this.mediaKeys_.createSession('persistent-license');\n } else {\n session = this.mediaKeys_.createSession();\n }\n } catch (exception) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_SESSION,\n exception.message));\n return;\n }\n\n this.eventManager_.listen(session, 'message',\n /** @type {shaka.util.EventManager.ListenerType} */(\n this.onSessionMessage_.bind(this)));\n this.eventManager_.listen(session, 'keystatuseschange',\n this.onKeyStatusesChange_.bind(this));\n this.activeSessions_.push({\n initData: initData,\n session: session,\n loaded: false,\n oldExpiration: Infinity,\n updatePromise: null\n });\n\n session.generateRequest(initDataType, initData.buffer).catch(function(error) {\n if (this.destroyed_) return;\n\n for (var i = 0; i < this.activeSessions_.length; ++i) {\n if (this.activeSessions_[i].session == session) {\n this.activeSessions_.splice(i, 1);\n break;\n }\n }\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_GENERATE_LICENSE_REQUEST,\n error.message));\n }.bind(this));\n};\n\n\n/**\n * @param {!MediaKeyMessageEvent} event\n * @private\n */\nshaka.media.DrmEngine.prototype.onSessionMessage_ = function(event) {\n if (this.delayLicenseRequest_())\n this.mediaKeyMessageEvents_.push(event);\n else\n this.sendLicenseRequest_(event);\n};\n\n\n/**\n * @return {boolean}\n * @private\n */\nshaka.media.DrmEngine.prototype.delayLicenseRequest_ = function() {\n return (this.config_.delayLicenseRequestUntilPlayed &&\n this.video_.paused && !this.initialRequestsSent_);\n};\n\n\n/**\n * Sends a license request.\n * @param {!MediaKeyMessageEvent} event\n * @private\n */\nshaka.media.DrmEngine.prototype.sendLicenseRequest_ = function(event) {\n /** @type {!MediaKeySession} */\n var session = event.target;\n\n var updatePromise;\n for (var i = 0; i < this.activeSessions_.length; i++) {\n if (this.activeSessions_[i].session == session) {\n updatePromise = this.activeSessions_[i].updatePromise;\n break;\n }\n }\n\n var requestType = shaka.net.NetworkingEngine.RequestType.LICENSE;\n var request = shaka.net.NetworkingEngine.makeRequest(\n [this.currentDrmInfo_.licenseServerUri], this.config_.retryParameters);\n request.body = event.message;\n request.method = 'POST';\n // NOTE: allowCrossSiteCredentials can be set in a request filter.\n\n if (this.currentDrmInfo_.keySystem == 'com.microsoft.playready' ||\n this.currentDrmInfo_.keySystem == 'com.chromecast.playready') {\n this.unpackPlayReadyRequest_(request);\n }\n\n this.networkingEngine_.request(requestType, request)\n .then(function(response) {\n if (this.destroyed_) return Promise.reject();\n\n // Request succeeded, now pass the response to the CDM.\n return session.update(response.data).then(function() {\n if (updatePromise)\n updatePromise.resolve();\n });\n }.bind(this), function(error) {\n // Ignore destruction errors\n if (this.destroyed_) return Promise.resolve();\n\n // Request failed!\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong NetworkingEngine error type!');\n var shakaErr = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.LICENSE_REQUEST_FAILED,\n error);\n this.onError_(shakaErr);\n if (updatePromise)\n updatePromise.reject(shakaErr);\n }.bind(this)).catch(function(error) {\n // Ignore destruction errors\n if (this.destroyed_) return Promise.resolve();\n\n // Session update failed!\n var shakaErr = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.LICENSE_RESPONSE_REJECTED,\n error.message);\n this.onError_(shakaErr);\n if (updatePromise)\n updatePromise.reject(shakaErr);\n }.bind(this));\n};\n\n\n/**\n * Unpack PlayReady license requests. Modifies the request object.\n * @param {shakaExtern.Request} request\n * @private\n */\nshaka.media.DrmEngine.prototype.unpackPlayReadyRequest_ = function(request) {\n // On IE and Edge, the raw license message is UTF-16-encoded XML. We need to\n // unpack the Challenge element (base64-encoded string containing the actual\n // license request) and any HttpHeader elements (sent as request headers).\n\n // Example XML:\n\n // <PlayReadyKeyMessage type=\"LicenseAcquisition\">\n // <LicenseAcquisition Version=\"1\">\n // <Challenge encoding=\"base64encoded\">{Base64Data}</Challenge>\n // <HttpHeaders>\n // <HttpHeader>\n // <name>Content-Type</name>\n // <value>text/xml; charset=utf-8</value>\n // </HttpHeader>\n // <HttpHeader>\n // <name>SOAPAction</name>\n // <value>http://schemas.microsoft.com/DRM/etc/etc</value>\n // </HttpHeader>\n // </HttpHeaders>\n // </LicenseAcquisition>\n // </PlayReadyKeyMessage>\n\n var xml = shaka.util.StringUtils.fromUTF16(\n request.body, true /* littleEndian */, true /* noThrow */);\n if (xml.indexOf('PlayReadyKeyMessage') == -1) {\n // This does not appear to be a wrapped message as on IE and Edge. Some\n // clients do not need this unwrapping, so we will assume this is one of\n // them. Note that \"xml\" at this point probably looks like random garbage,\n // since we interpreted UTF-8 as UTF-16.\n shaka.log.debug('PlayReady request is already unwrapped.');\n request.headers['Content-Type'] = 'text/xml; charset=utf-8';\n return;\n }\n shaka.log.debug('Unwrapping PlayReady request.');\n var dom = new DOMParser().parseFromString(xml, 'application/xml');\n\n // Set request headers.\n var headers = dom.getElementsByTagName('HttpHeader');\n for (var i = 0; i < headers.length; ++i) {\n var name = headers[i].querySelector('name');\n var value = headers[i].querySelector('value');\n goog.asserts.assert(name && value, 'Malformed PlayReady headers!');\n request.headers[name.textContent] = value.textContent;\n }\n\n // Unpack the base64-encoded challenge.\n var challenge = dom.querySelector('Challenge');\n goog.asserts.assert(challenge, 'Malformed PlayReady challenge!');\n goog.asserts.assert(challenge.getAttribute('encoding') == 'base64encoded',\n 'Unexpected PlayReady challenge encoding!');\n request.body =\n shaka.util.Uint8ArrayUtils.fromBase64(challenge.textContent).buffer;\n};\n\n\n/**\n * @param {!Event} event\n * @private\n * @suppress {invalidCasts} to swap keyId and status\n */\nshaka.media.DrmEngine.prototype.onKeyStatusesChange_ = function(event) {\n var session = /** @type {!MediaKeySession} */(event.target);\n\n // Locate the session in the active sessions list.\n var i;\n for (i = 0; i < this.activeSessions_.length; ++i) {\n if (this.activeSessions_[i].session == session) {\n break;\n }\n }\n goog.asserts.assert(i < this.activeSessions_.length,\n 'Key status change for inactive session!');\n if (i == this.activeSessions_.length) return;\n\n var keyStatusMap = session.keyStatuses;\n var hasExpiredKeys = false;\n\n keyStatusMap.forEach(function(status, keyId) {\n // The spec has changed a few times on the exact order of arguments here.\n // As of 2016-06-30, Edge has the order reversed compared to the current\n // EME spec. Given the back and forth in the spec, it may not be the only\n // one. Try to detect this and compensate:\n if (typeof keyId == 'string') {\n var tmp = keyId;\n keyId = /** @type {ArrayBuffer} */(status);\n status = /** @type {string} */(tmp);\n }\n\n // Microsoft's implementation in Edge seems to present key IDs as\n // little-endian UUIDs, rather than big-endian or just plain array of bytes.\n // standard: 6e 5a 1d 26 - 27 57 - 47 d7 - 80 46 ea a5 d1 d3 4b 5a\n // on Edge: 26 1d 5a 6e - 57 27 - d7 47 - 80 46 ea a5 d1 d3 4b 5a\n // Bug filed: https://goo.gl/gnRSkJ\n\n // NOTE that we skip this if byteLength != 16. This is used for the IE11\n // and Edge 12 EME polyfill, which uses single-byte dummy key IDs.\n if (this.currentDrmInfo_.keySystem == 'com.microsoft.playready' &&\n keyId.byteLength == 16) {\n // Read out some fields in little-endian:\n var dataView = new DataView(keyId);\n var part0 = dataView.getUint32(0, true /* LE */);\n var part1 = dataView.getUint16(4, true /* LE */);\n var part2 = dataView.getUint16(6, true /* LE */);\n // Write it back in big-endian:\n dataView.setUint32(0, part0, false /* BE */);\n dataView.setUint16(4, part1, false /* BE */);\n dataView.setUint16(6, part2, false /* BE */);\n }\n\n // Microsoft's implementation in IE11 and Edge seems to never set key\n // status to 'usable'. It is stuck forever at 'status-pending'. In spite\n // of this, the keys do seem to be usable and content plays correctly.\n // Bug filed: https://goo.gl/fcXEy1\n if (this.currentDrmInfo_.keySystem == 'com.microsoft.playready' &&\n status == 'status-pending') {\n status = 'usable';\n }\n\n if (status != 'status-pending') {\n this.activeSessions_[i].loaded = true;\n if (this.activeSessions_.every(function(s) { return s.loaded; }))\n this.allSessionsLoaded_.resolve();\n }\n\n if (status == 'expired') {\n hasExpiredKeys = true;\n }\n\n var keyIdHex = shaka.util.Uint8ArrayUtils.toHex(new Uint8Array(keyId));\n\n this.keyStatusByKeyId_[keyIdHex] = status;\n }.bind(this));\n\n // If the session has expired, close it.\n // Some CDMs do not have sub-second time resolution, so the key status may\n // fire with hundreds of milliseconds left until the stated expiration time.\n var msUntilExpiration = session.expiration - Date.now();\n if (msUntilExpiration < 0 || (hasExpiredKeys && msUntilExpiration < 1000)) {\n // If this is part of a remove(), we don't want to close the session until\n // the update is complete. Otherwise, we will orphan the session.\n if (!this.activeSessions_[i].updatePromise) {\n shaka.log.debug('Session has expired', session);\n this.activeSessions_.splice(i, 1);\n session.close();\n }\n }\n\n // Batch up key status changes before checking them or notifying Player.\n // This handles cases where the statuses of multiple sessions are set\n // simultaneously by the browser before dispatching key status changes for\n // each of them. By batching these up, we only send one status change event\n // and at most one EXPIRED error on expiration.\n this.keyStatusTimer_.schedule(0.5);\n};\n\n\n/**\n * @private\n */\nshaka.media.DrmEngine.prototype.processKeyStatusChanges_ = function() {\n // If all keys are expired, fire an error.\n function isExpired(keyId, status) {\n return status == 'expired';\n }\n var MapUtils = shaka.util.MapUtils;\n // Note that every() is always true for an empty map,\n // but we shouldn't fire an error for a lack of key status info.\n var allExpired = !MapUtils.empty(this.keyStatusByKeyId_) &&\n MapUtils.every(this.keyStatusByKeyId_, isExpired);\n\n if (allExpired) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.EXPIRED));\n }\n\n this.onKeyStatus_(this.keyStatusByKeyId_);\n};\n\n\n/**\n * Returns true if the browser has recent EME APIs.\n *\n * @return {boolean}\n */\nshaka.media.DrmEngine.isBrowserSupported = function() {\n var basic =\n !!window.MediaKeys &&\n !!window.navigator &&\n !!window.navigator.requestMediaKeySystemAccess &&\n !!window.MediaKeySystemAccess &&\n !!window.MediaKeySystemAccess.prototype.getConfiguration;\n\n return basic;\n};\n\n\n/**\n * Returns a Promise to a map of EME support for well-known key systems.\n *\n * @return {!Promise.<!Object.<string, ?shakaExtern.DrmSupportType>>}\n */\nshaka.media.DrmEngine.probeSupport = function() {\n goog.asserts.assert(shaka.media.DrmEngine.isBrowserSupported(),\n 'Must have basic EME support');\n\n var tests = [];\n var testKeySystems = [\n 'org.w3.clearkey',\n 'com.widevine.alpha',\n 'com.microsoft.playready',\n 'com.apple.fps.2_0',\n 'com.apple.fps.1_0',\n 'com.apple.fps',\n 'com.adobe.primetime'\n ];\n\n var basicVideoCapabilities = [\n { contentType: 'video/mp4; codecs=\"avc1.42E01E\"' },\n { contentType: 'video/webm; codecs=\"vp8\"' }\n ];\n\n var basicConfig = {\n videoCapabilities: basicVideoCapabilities\n };\n var offlineConfig = {\n videoCapabilities: basicVideoCapabilities,\n persistentState: 'required',\n sessionTypes: ['persistent-license']\n };\n\n // Try the offline config first, then fall back to the basic config.\n var configs = [offlineConfig, basicConfig];\n\n var support = {};\n testKeySystems.forEach(function(keySystem) {\n var p = navigator.requestMediaKeySystemAccess(keySystem, configs)\n .then(function(access) {\n // Edge doesn't return supported session types, but current versions\n // do not support persistent-license. If sessionTypes is missing,\n // assume no support for persistent-license.\n // TODO: polyfill Edge to return known supported session types.\n // Edge bug: https://goo.gl/z0URJ0\n // Firefox does return supported session types, but will still let you\n // create a session even if the type is unsupported.\n // Firefox bug: https://goo.gl/lB4H3i\n var sessionTypes = access.getConfiguration().sessionTypes;\n var persistentState = sessionTypes ?\n sessionTypes.indexOf('persistent-license') >= 0 : false;\n support[keySystem] = {persistentState: persistentState};\n return access.createMediaKeys();\n }).catch(function() {\n // Either the request failed or createMediaKeys failed.\n // Either way, write null to the support object.\n support[keySystem] = null;\n });\n tests.push(p);\n });\n\n return Promise.all(tests).then(function() {\n return support;\n });\n};\n\n\n/**\n * @private\n */\nshaka.media.DrmEngine.prototype.onPlay_ = function() {\n for (var i = 0; i < this.mediaKeyMessageEvents_.length; i++) {\n this.sendLicenseRequest_(this.mediaKeyMessageEvents_[i]);\n }\n\n this.initialRequestsSent_ = true;\n this.mediaKeyMessageEvents_ = [];\n};\n\n\n/**\n * Checks if a variant is compatible with the key system.\n * @param {!shakaExtern.Variant} variant\n * @return {boolean}\n**/\nshaka.media.DrmEngine.prototype.isSupportedByKeySystem = function(variant) {\n var keySystem = this.keySystem();\n return variant.drmInfos.length == 0 ||\n variant.drmInfos.some(function(drmInfo) {\n return drmInfo.keySystem == keySystem;\n });\n};\n\n\n/**\n * Checks if two DrmInfos can be decrypted using the\n * same key system. Clear content is considered compatible\n * with every key system.\n *\n * @param {!Array.<!shakaExtern.DrmInfo>} drms1\n * @param {!Array.<!shakaExtern.DrmInfo>} drms2\n * @return {boolean}\n */\nshaka.media.DrmEngine.areDrmCompatible = function(drms1, drms2) {\n if (!drms1.length || !drms2.length) return true;\n\n return shaka.media.DrmEngine.getCommonDrmInfos(\n drms1, drms2).length > 0;\n};\n\n\n/**\n * Returns an array of drm infos that are present in both input arrays.\n * If one of the arrays is empty, returns the other one since clear\n * content is considered compatible with every drm info.\n *\n * @param {!Array.<!shakaExtern.DrmInfo>} drms1\n * @param {!Array.<!shakaExtern.DrmInfo>} drms2\n * @return {!Array.<!shakaExtern.DrmInfo>}\n */\nshaka.media.DrmEngine.getCommonDrmInfos = function(drms1, drms2) {\n if (!drms1.length) return drms2;\n if (!drms2.length) return drms1;\n\n var commonDrms = [];\n\n for (var i = 0; i < drms1.length; i++) {\n for (var j = 0; j < drms2.length; j++) {\n // This method is only called to compare drmInfos of a video\n // and an audio adaptations, so we shouldn't have to worry about\n // checking robustness.\n if (drms1[i].keySystem == drms2[j].keySystem) {\n var drm1 = drms1[i];\n var drm2 = drms2[j];\n var initData = [];\n initData = initData.concat(drm1.initData || []);\n initData = initData.concat(drm2.initData || []);\n var keyIds = [];\n keyIds = keyIds.concat(drm1.keyIds);\n keyIds = keyIds.concat(drm2.keyIds);\n var mergedDrm = {\n keySystem: drm1.keySystem,\n licenseServerUri: drm1.licenseServerUri || drm2.licenseServerUri,\n distinctiveIdentifierRequired: drm1.distinctiveIdentifierRequired ||\n drm2.distinctiveIdentifierRequired,\n persistentStateRequired: drm1.persistentStateRequired ||\n drm2.persistentStateRequired,\n videoRobustness: drm1.videoRobustness || drm2.videoRobustness,\n audioRobustness: drm1.audioRobustness || drm2.audioRobustness,\n serverCertificate: drm1.serverCertificate || drm2.serverCertificate,\n initData: initData,\n keyIds: keyIds\n };\n commonDrms.push(mergedDrm);\n break;\n }\n }\n }\n\n return commonDrms;\n};\n\n\n/**\n * Called in an interval timer to poll the expiration times of the sessions. We\n * don't get an event from EME when the expiration updates, so we poll it so we\n * can fire an event when it happens.\n * @private\n */\nshaka.media.DrmEngine.prototype.pollExpiration_ = function() {\n this.activeSessions_.forEach(function(session) {\n var old = session.oldExpiration;\n var new_ = session.session.expiration;\n if (isNaN(new_))\n new_ = Infinity;\n\n if (new_ != old) {\n this.onExpirationUpdated_(session.session.sessionId, new_);\n session.oldExpiration = new_;\n }\n }.bind(this));\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/drm_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.TextEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.IDestroyable');\n\n\n\n/**\n * Manages text parsers and cues.\n *\n * @struct\n * @constructor\n * @param {TextTrack} track\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.TextEngine = function(track) {\n /** @private {shakaExtern.TextParser} */\n this.parser_ = null;\n\n /** @private {TextTrack} */\n this.track_ = track;\n\n /** @private {number} */\n this.timestampOffset_ = 0;\n\n /** @private {number} */\n this.appendWindowEnd_ = Infinity;\n\n /** @private {?number} */\n this.bufferStart_ = null;\n\n /** @private {?number} */\n this.bufferEnd_ = null;\n};\n\n\n/** @private {!Object.<string, !shakaExtern.TextParserPlugin>} */\nshaka.media.TextEngine.parserMap_ = {};\n\n\n/**\n * @param {string} mimeType\n * @param {!shakaExtern.TextParserPlugin} plugin\n * @export\n */\nshaka.media.TextEngine.registerParser = function(mimeType, plugin) {\n // Assume that if the function is expecting no parameters, it must be\n // a stateful text parser factory. Otherwise, assume that it is a\n // stateless text parser.\n if (plugin.length == 0) {\n shaka.media.TextEngine.parserMap_[mimeType] = plugin;\n } else {\n shaka.log.warning('The use of stateless text parsers is deprecated.');\n shaka.media.TextEngine.parserMap_[mimeType] =\n shaka.media.TextEngine.TextParserWrapper_.bind(null, plugin);\n }\n};\n\n\n/**\n * @param {string} mimeType\n * @export\n */\nshaka.media.TextEngine.unregisterParser = function(mimeType) {\n delete shaka.media.TextEngine.parserMap_[mimeType];\n};\n\n\n/**\n * @param {string} mimeType\n * @return {boolean}\n */\nshaka.media.TextEngine.isTypeSupported = function(mimeType) {\n return !!shaka.media.TextEngine.parserMap_[mimeType];\n};\n\n\n/**\n * Creates a cue using the best platform-specific interface available.\n *\n * @param {number} startTime\n * @param {number} endTime\n * @param {string} payload\n * @return {TextTrackCue} or null if the parameters were invalid.\n * @export\n */\nshaka.media.TextEngine.makeCue = function(startTime, endTime, payload) {\n if (startTime >= endTime) {\n // IE/Edge will throw in this case.\n // See issue #501\n shaka.log.warning('Invalid cue times: ' + startTime + ' - ' + endTime);\n return null;\n }\n\n return new VTTCue(startTime, endTime, payload);\n};\n\n\n/** @override */\nshaka.media.TextEngine.prototype.destroy = function() {\n if (this.track_) {\n this.removeWhere_(function(cue) { return true; });\n }\n\n this.parser_ = null;\n this.track_ = null;\n\n return Promise.resolve();\n};\n\n\n/**\n * Initialize the parser. This can be called multiple times, but must be called\n * at least once before appendBuffer.\n *\n * @param {string} mimeType\n */\nshaka.media.TextEngine.prototype.initParser = function(mimeType) {\n var factory = shaka.media.TextEngine.parserMap_[mimeType];\n goog.asserts.assert(\n factory,\n 'Text type negotiation should have happened already');\n this.parser_ = new factory();\n};\n\n\n/**\n * @param {!ArrayBuffer} buffer\n * @param {?number} startTime\n * @param {?number} endTime\n * @return {!Promise}\n */\nshaka.media.TextEngine.prototype.appendBuffer =\n function(buffer, startTime, endTime) {\n goog.asserts.assert(this.parser_, 'The parser should already be initialized');\n\n // Start the operation asynchronously to avoid blocking the caller.\n return Promise.resolve().then(function() {\n // Check that TextEngine hasn't been destroyed.\n if (!this.track_) return;\n\n if (startTime == null || endTime == null) {\n this.parser_.parseInit(buffer);\n return;\n }\n\n /** @type {shakaExtern.TextParser.TimeContext} **/\n var time = {\n periodStart: this.timestampOffset_,\n segmentStart: startTime,\n segmentEnd: endTime\n };\n\n // Parse the buffer and add the new cues.\n var cues = this.parser_.parseMedia(buffer, time);\n\n for (var i = 0; i < cues.length; ++i) {\n if (cues[i].startTime >= this.appendWindowEnd_) break;\n this.track_.addCue(cues[i]);\n }\n\n // NOTE: We update the buffered range from the start and end times passed\n // down from the segment reference, not with the start and end times of the\n // parsed cues. This is important because some segments may contain no\n // cues, but we must still consider those ranges buffered.\n if (this.bufferStart_ == null) {\n this.bufferStart_ = startTime;\n } else {\n // We already had something in buffer, and we assume we are extending the\n // range from the end.\n goog.asserts.assert((startTime - this.bufferEnd_) <= 1,\n 'There should not be a gap in text references >1s');\n }\n this.bufferEnd_ = Math.min(endTime, this.appendWindowEnd_);\n }.bind(this));\n};\n\n\n/**\n * @param {number} start\n * @param {number} end\n * @return {!Promise}\n */\nshaka.media.TextEngine.prototype.remove = function(start, end) {\n // Start the operation asynchronously to avoid blocking the caller.\n return Promise.resolve().then(function() {\n // Check that TextEngine hasn't been destroyed.\n if (!this.track_) return;\n\n this.removeWhere_(function(cue) {\n if (cue.startTime >= end || cue.endTime <= start) {\n // Outside the remove range. Hang on to it.\n return false;\n }\n return true;\n });\n\n if (this.bufferStart_ == null) {\n goog.asserts.assert(this.bufferEnd_ == null,\n 'end must be null if start is null');\n } else {\n goog.asserts.assert(this.bufferEnd_ != null,\n 'end must be non-null if start is non-null');\n\n // Update buffered range.\n if (end <= this.bufferStart_ || start >= this.bufferEnd_) {\n // No intersection. Nothing was removed.\n } else if (start <= this.bufferStart_ && end >= this.bufferEnd_) {\n // We wiped out everything.\n goog.asserts.assert(\n this.track_.cues.length == 0, 'should be no cues left');\n this.bufferStart_ = this.bufferEnd_ = null;\n } else if (start <= this.bufferStart_ && end < this.bufferEnd_) {\n // We removed from the beginning of the range.\n this.bufferStart_ = end;\n } else if (start > this.bufferStart_ && end >= this.bufferEnd_) {\n // We removed from the end of the range.\n this.bufferEnd_ = start;\n } else {\n // We removed from the middle? StreamingEngine isn't supposed to.\n goog.asserts.assert(\n false, 'removal from the middle is not supported by TextEngine');\n }\n }\n }.bind(this));\n};\n\n\n/** @param {number} timestampOffset */\nshaka.media.TextEngine.prototype.setTimestampOffset =\n function(timestampOffset) {\n this.timestampOffset_ = timestampOffset;\n};\n\n\n/** @param {number} windowEnd */\nshaka.media.TextEngine.prototype.setAppendWindowEnd =\n function(windowEnd) {\n this.appendWindowEnd_ = windowEnd;\n};\n\n\n/**\n * @return {?number} Time in seconds of the beginning of the buffered range,\n * or null if nothing is buffered.\n */\nshaka.media.TextEngine.prototype.bufferStart = function() {\n return this.bufferStart_;\n};\n\n\n/**\n * @return {?number} Time in seconds of the end of the buffered range,\n * or null if nothing is buffered.\n */\nshaka.media.TextEngine.prototype.bufferEnd = function() {\n return this.bufferEnd_;\n};\n\n\n/**\n * @param {number} t A timestamp\n * @return {boolean}\n */\nshaka.media.TextEngine.prototype.isBuffered = function(t) {\n return t >= this.bufferStart_ && t < this.bufferEnd_;\n};\n\n\n/**\n * @param {number} t A timestamp\n * @return {number} Number of seconds ahead of 't' we have buffered\n */\nshaka.media.TextEngine.prototype.bufferedAheadOf = function(t) {\n if (this.bufferEnd_ == null || this.bufferEnd_ < t) return 0;\n\n goog.asserts.assert(\n this.bufferStart_ != null, 'start should not be null if end is not null');\n\n return this.bufferEnd_ - Math.max(t, this.bufferStart_);\n};\n\n\n/**\n * Remove all cues for which the matching function returns true.\n *\n * @param {function(!TextTrackCue):boolean} predicate\n * @private\n */\nshaka.media.TextEngine.prototype.removeWhere_ = function(predicate) {\n var cues = this.track_.cues;\n var removeMe = [];\n\n // Remove these in another loop to avoid mutating the TextTrackCueList\n // while iterating over it. This allows us to avoid making assumptions\n // about whether or not this.track_.remove() will alter that list.\n for (var i = 0; i < cues.length; ++i) {\n if (predicate(cues[i])) {\n removeMe.push(cues[i]);\n }\n }\n\n for (var i = 0; i < removeMe.length; ++i) {\n this.track_.removeCue(removeMe[i]);\n }\n};\n\n\n\n/**\n * @param {Function} parser\n * @constructor\n * @implements {shakaExtern.TextParser}\n * @private\n */\nshaka.media.TextEngine.TextParserWrapper_ = function(parser) {\n this.parser = parser;\n};\n\n\n/** @override **/\nshaka.media.TextEngine.TextParserWrapper_.prototype.parseInit = function(data) {\n this.parser(data, 0, null, null);\n};\n\n\n/** @override **/\nshaka.media.TextEngine.TextParserWrapper_.prototype.parseMedia = function(\n data, time) {\n return this.parser(data,\n time.periodStart,\n time.segmentStart,\n time.segmentEnd);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/text_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.TimeRangesUtils');\n\n\n/**\n * @namespace shaka.media.TimeRangesUtils\n * @summary A set of utility functions for dealing with TimeRanges objects.\n */\n\n\n/**\n * Gets the first timestamp in buffer.\n *\n * @param {TimeRanges} b\n * @return {?number} The first buffered timestamp, in seconds, if |buffered|\n * is non-empty; otherwise, return null.\n */\nshaka.media.TimeRangesUtils.bufferStart = function(b) {\n if (!b) return null;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return null;\n // Workaround Edge bug: https://goo.gl/BtxKgb\n if (b.length == 1 && b.start(0) < 0) return 0;\n return b.length ? b.start(0) : null;\n};\n\n\n/**\n * Gets the last timestamp in buffer.\n *\n * @param {TimeRanges} b\n * @return {?number} The last buffered timestamp, in seconds, if |buffered|\n * is non-empty; otherwise, return null.\n */\nshaka.media.TimeRangesUtils.bufferEnd = function(b) {\n if (!b) return null;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return null;\n return b.length ? b.end(b.length - 1) : null;\n};\n\n\n/**\n * Determines if the given time is inside a buffered range. This includes gaps,\n * meaning if the playhead is in a gap, it is considered buffered.\n *\n * @param {TimeRanges} b\n * @param {number} time\n * @return {boolean}\n */\nshaka.media.TimeRangesUtils.isBuffered = function(b, time) {\n if (!b || !b.length) return false;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return false;\n\n return time >= b.start(0) && time <= b.end(b.length - 1);\n};\n\n\n/**\n * Computes how far ahead of the given timestamp is buffered. To provide smooth\n * playback while jumping gaps, we don't include the gaps when calculating this.\n * This only includes the amount of content that is buffered.\n *\n * @param {TimeRanges} b\n * @param {number} time\n * @return {number} The number of seconds buffered, in seconds, ahead of the\n * given time.\n */\nshaka.media.TimeRangesUtils.bufferedAheadOf = function(b, time) {\n if (!b || !b.length) return 0;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return 0;\n\n // NOTE: On IE11, buffered ranges may show appended data before the associated\n // append operation is complete.\n\n // We calculate buffered amount by ONLY accounting for the content buffered\n // (i.e. we ignore the times of the gaps). We also buffer through all gaps.\n // So start at the end and add up all buffers until |time|.\n var result = 0;\n for (var i = b.length - 1; i >= 0 && b.end(i) > time; --i) {\n result += b.end(i) - Math.max(b.start(i), time);\n }\n\n return result;\n};\n\n\n/**\n * Determines if the given time is inside a gap between buffered ranges. If it\n * is, this returns the index of the buffer that is *ahead* of the gap.\n *\n * @param {TimeRanges} b\n * @param {number} time\n * @return {?number} The index of the buffer after the gap, or null if not in a\n * gap.\n */\nshaka.media.TimeRangesUtils.getGapIndex = function(b, time) {\n if (!b || !b.length) return null;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return null;\n\n // IE/Edge stops 0.5 seconds before a gap, so it needs a much larger\n // threshold, but we don't want to punish other browsers that stop closer.\n // See: https://goo.gl/cuAcYd\n var threshold = 0.1;\n if (/(Edge|Trident)\\//.test(navigator.userAgent))\n threshold = 0.5;\n\n for (var i = 0; i < b.length; i++) {\n if (b.start(i) > time && (i == 0 || b.end(i - 1) - time <= threshold)) {\n return i;\n }\n }\n\n return null;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/time_ranges_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.MediaSourceEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.media.TimeRangesUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * MediaSourceEngine wraps all operations on MediaSource and SourceBuffers.\n * All asynchronous operations return a Promise, and all operations are\n * internally synchronized and serialized as needed. Operations that can\n * be done in parallel will be done in parallel.\n *\n * @param {HTMLMediaElement} video The video element, used to read error codes\n * when MediaSource operations fail.\n * @param {MediaSource} mediaSource The MediaSource, which must be in the\n * 'open' state.\n * @param {TextTrack} textTrack The TextTrack to use for subtitles/captions.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.MediaSourceEngine = function(video, mediaSource, textTrack) {\n goog.asserts.assert(mediaSource.readyState == 'open',\n 'The MediaSource should be in the \\'open\\' state.');\n\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {MediaSource} */\n this.mediaSource_ = mediaSource;\n\n /** @private {TextTrack} */\n this.textTrack_ = textTrack;\n\n /** @private {!Object.<shaka.util.ManifestParserUtils.ContentType,\n SourceBuffer>} */\n this.sourceBuffers_ = {};\n\n /** @private {shaka.media.TextEngine} */\n this.textEngine_ = null;\n\n /**\n * @private {!Object.<string,\n * !Array.<shaka.media.MediaSourceEngine.Operation>>}\n */\n this.queues_ = {};\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {boolean} */\n this.destroyed_ = false;\n};\n\n\n/**\n * @typedef {{\n * start: function(),\n * p: !shaka.util.PublicPromise\n * }}\n *\n * @summary An operation in queue.\n * @property {function()} start\n * The function which starts the operation.\n * @property {!shaka.util.PublicPromise} p\n * The PublicPromise which is associated with this operation.\n */\nshaka.media.MediaSourceEngine.Operation;\n\n\n/**\n * Checks if a certain type is supported.\n *\n * @param {string} mimeType\n * @return {boolean}\n */\nshaka.media.MediaSourceEngine.isTypeSupported = function(mimeType) {\n return shaka.media.TextEngine.isTypeSupported(mimeType) ||\n MediaSource.isTypeSupported(mimeType);\n};\n\n\n/**\n * Returns true if the browser has the basic APIs we need.\n *\n * @return {boolean}\n */\nshaka.media.MediaSourceEngine.isBrowserSupported = function() {\n return !!window.MediaSource && !!window.MediaSource.isTypeSupported;\n};\n\n\n/**\n * Returns a map of MediaSource support for well-known types.\n *\n * @return {!Object.<string, boolean>}\n */\nshaka.media.MediaSourceEngine.probeSupport = function() {\n goog.asserts.assert(shaka.media.MediaSourceEngine.isBrowserSupported(),\n 'Requires basic support');\n var support = {};\n var testMimeTypes = [\n // MP4 types\n 'video/mp4; codecs=\"avc1.42E01E\"',\n 'video/mp4; codecs=\"avc3.42E01E\"',\n 'video/mp4; codecs=\"hvc1.1.6.L93.90\"',\n 'audio/mp4; codecs=\"mp4a.40.2\"',\n 'audio/mp4; codecs=\"ac-3\"',\n 'audio/mp4; codecs=\"ec-3\"',\n // WebM types\n 'video/webm; codecs=\"vp8\"',\n 'video/webm; codecs=\"vp9\"',\n 'video/webm; codecs=\"av1\"',\n 'audio/webm; codecs=\"vorbis\"',\n 'audio/webm; codecs=\"opus\"',\n // MPEG2 TS types (video/ is also used for audio: http://goo.gl/tYHXiS)\n 'video/mp2t; codecs=\"avc1.42E01E\"',\n 'video/mp2t; codecs=\"avc3.42E01E\"',\n 'video/mp2t; codecs=\"hvc1.1.6.L93.90\"',\n 'video/mp2t; codecs=\"mp4a.40.2\"',\n 'video/mp2t; codecs=\"ac-3\"',\n 'video/mp2t; codecs=\"ec-3\"',\n 'video/mp2t; codecs=\"mp4a.40.2\"',\n // WebVTT types\n 'text/vtt',\n 'application/mp4; codecs=\"wvtt\"',\n // TTML types\n 'application/ttml+xml',\n 'application/mp4; codecs=\"stpp\"'\n ];\n\n testMimeTypes.forEach(function(type) {\n support[type] = shaka.media.MediaSourceEngine.isTypeSupported(type);\n var basicType = type.split(';')[0];\n support[basicType] = support[basicType] || support[type];\n });\n\n return support;\n};\n\n\n/**\n * @override\n */\nshaka.media.MediaSourceEngine.prototype.destroy = function() {\n var Functional = shaka.util.Functional;\n this.destroyed_ = true;\n\n var cleanup = [];\n\n for (var contentType in this.queues_) {\n // Make a local copy of the queue and the first item.\n var q = this.queues_[contentType];\n var inProgress = q[0];\n\n // Drop everything else out of the queue.\n this.queues_[contentType] = q.slice(0, 1);\n\n // We will wait for this item to complete/fail.\n if (inProgress) {\n cleanup.push(inProgress.p.catch(Functional.noop));\n }\n\n // The rest will be rejected silently if possible.\n for (var i = 1; i < q.length; ++i) {\n q[i].p.catch(Functional.noop);\n q[i].p.reject();\n }\n }\n\n if (this.textEngine_) {\n cleanup.push(this.textEngine_.destroy());\n }\n\n return Promise.all(cleanup).then(function() {\n this.eventManager_.destroy();\n this.eventManager_ = null;\n this.video_ = null;\n this.mediaSource_ = null;\n this.textTrack_ = null;\n this.textEngine_ = null;\n this.sourceBuffers_ = {};\n if (!COMPILED) {\n for (var contentType in this.queues_) {\n goog.asserts.assert(\n this.queues_[contentType].length == 0,\n contentType + ' queue should be empty after destroy!');\n }\n }\n this.queues_ = {};\n }.bind(this));\n};\n\n\n/**\n * Initialize MediaSourceEngine.\n *\n * Note that it is not valid to call this multiple times, except to add or\n * reinitialize text streams.\n *\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType, string>}\n * typeConfig A map of content types to full MIME types.\n * For example: { 'audio': 'audio/webm; codecs=\"vorbis\"',\n * 'video': 'video/webm; codecs=\"vp9\"', 'text': 'text/vtt' }.\n * All types given must be supported.\n *\n * @throws InvalidAccessError if blank MIME types are given\n * @throws NotSupportedError if unsupported MIME types are given\n * @throws QuotaExceededError if the browser can't support that many buffers\n */\nshaka.media.MediaSourceEngine.prototype.init = function(typeConfig) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n for (var contentType in typeConfig) {\n var mimeType = typeConfig[contentType];\n goog.asserts.assert(\n shaka.media.MediaSourceEngine.isTypeSupported(mimeType),\n 'Type negotiation should happen before MediaSourceEngine.init!');\n\n if (contentType == ContentType.TEXT) {\n this.reinitText(mimeType);\n } else {\n var sourceBuffer = this.mediaSource_.addSourceBuffer(mimeType);\n this.eventManager_.listen(\n sourceBuffer, 'error', this.onError_.bind(this, contentType));\n this.eventManager_.listen(\n sourceBuffer, 'updateend', this.onUpdateEnd_.bind(this, contentType));\n this.sourceBuffers_[contentType] = sourceBuffer;\n this.queues_[contentType] = [];\n }\n }\n};\n\n\n/**\n * Reinitialize the TextEngine for a new text type.\n * @param {string} mimeType\n */\nshaka.media.MediaSourceEngine.prototype.reinitText = function(mimeType) {\n if (!this.textEngine_) {\n this.textEngine_ = new shaka.media.TextEngine(this.textTrack_);\n }\n this.textEngine_.initParser(mimeType);\n};\n\n\n/**\n * Gets the first timestamp in buffer for the given content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {?number} The timestamp in seconds, or null if nothing is buffered.\n */\nshaka.media.MediaSourceEngine.prototype.bufferStart = function(contentType) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.bufferStart();\n }\n return shaka.media.TimeRangesUtils.bufferStart(\n this.getBuffered_(contentType));\n};\n\n\n/**\n * Gets the last timestamp in buffer for the given content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {?number} The timestamp in seconds, or null if nothing is buffered.\n */\nshaka.media.MediaSourceEngine.prototype.bufferEnd = function(contentType) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.bufferEnd();\n }\n return shaka.media.TimeRangesUtils.bufferEnd(this.getBuffered_(contentType));\n};\n\n\n/**\n * Determines if the given time is inside the buffered range of the given\n * content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} time\n * @return {boolean}\n */\nshaka.media.MediaSourceEngine.prototype.isBuffered = function(\n contentType, time) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.isBuffered(time);\n } else {\n var buffered = this.getBuffered_(contentType);\n return shaka.media.TimeRangesUtils.isBuffered(buffered, time);\n }\n};\n\n\n/**\n * Computes how far ahead of the given timestamp is buffered for the given\n * content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} time\n * @return {number} The amount of time buffered ahead in seconds.\n */\nshaka.media.MediaSourceEngine.prototype.bufferedAheadOf =\n function(contentType, time) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.bufferedAheadOf(time);\n } else {\n var buffered = this.getBuffered_(contentType);\n return shaka.media.TimeRangesUtils.bufferedAheadOf(buffered, time);\n }\n};\n\n\n/**\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {TimeRanges} The buffered ranges for the given content type, or\n * null if the buffered ranges could not be obtained.\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.getBuffered_ = function(contentType) {\n try {\n return this.sourceBuffers_[contentType].buffered;\n } catch (exception) {\n // Note: previous MediaSource errors may cause access to |buffered| to\n // throw.\n shaka.log.error('failed to get buffered range for ' + contentType,\n exception);\n return null;\n }\n};\n\n\n/**\n * Enqueue an operation to append data to the SourceBuffer.\n * Start and end times are needed for TextEngine, but not for MediaSource.\n * Start and end times may be null for initialization segments, if present they\n * are relative to the presentation timeline.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {!ArrayBuffer} data\n * @param {?number} startTime\n * @param {?number} endTime\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.appendBuffer =\n function(contentType, data, startTime, endTime) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.appendBuffer(data, startTime, endTime);\n }\n return this.enqueueOperation_(\n contentType,\n this.append_.bind(this, contentType, data));\n};\n\n\n/**\n * Enqueue an operation to remove data from the SourceBuffer.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} startTime\n * @param {number} endTime\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.remove =\n function(contentType, startTime, endTime) {\n // On IE11, this operation would be permitted, but would have no effect!\n // See https://github.com/google/shaka-player/issues/251\n goog.asserts.assert(endTime < Number.MAX_VALUE,\n 'remove() with MAX_VALUE or Infinity is not IE-compatible!');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.remove(startTime, endTime);\n }\n return this.enqueueOperation_(\n contentType,\n this.remove_.bind(this, contentType, startTime, endTime));\n};\n\n\n/**\n * Enqueue an operation to clear the SourceBuffer.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.clear = function(contentType) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.remove(0, Infinity);\n }\n // Note that not all platforms allow clearing to Infinity.\n return this.enqueueOperation_(\n contentType,\n this.remove_.bind(this, contentType, 0, this.mediaSource_.duration));\n};\n\n\n/**\n * Enqueue an operation to flush the SourceBuffer.\n * This is a workaround for what we believe is a Chromecast bug.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.flush = function(contentType) {\n // Flush the pipeline. Necessary on Chromecast, even though we have removed\n // everything.\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n // Nothing to flush for text.\n return Promise.resolve();\n }\n return this.enqueueOperation_(\n contentType,\n this.flush_.bind(this, contentType));\n};\n\n\n/**\n * Sets the timestamp offset and append window end for the given content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} timestampOffset The timestamp offset. Segments which start\n * at time t will be inserted at time t + timestampOffset instead. This\n * value does not affect segments which have already been inserted.\n * @param {?number} appendWindowEnd The timestamp to set the append window end\n * to. Media beyond this value will be truncated.\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.setStreamProperties = function(\n contentType, timestampOffset, appendWindowEnd) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n this.textEngine_.setTimestampOffset(timestampOffset);\n if (appendWindowEnd != null)\n this.textEngine_.setAppendWindowEnd(appendWindowEnd);\n return Promise.resolve();\n }\n\n if (appendWindowEnd == null)\n appendWindowEnd = Infinity;\n\n return Promise.all([\n // Queue an abort() to help MSE splice together overlapping segments.\n // We set appendWindowEnd when we change periods in DASH content, and the\n // period transition may result in overlap.\n //\n // An abort() also helps with MPEG2-TS. When we append a TS segment, we\n // always enter a PARSING_MEDIA_SEGMENT state and we can't change the\n // timestamp offset. By calling abort(), we reset the state so we can\n // set it.\n //\n // Note that abort() resets both appendWindowStart and appendWindowEnd;\n // however, we don't use appendWindowStart.\n this.enqueueOperation_(\n contentType,\n this.abort_.bind(this, contentType)),\n this.enqueueOperation_(\n contentType,\n this.setTimestampOffset_.bind(this, contentType, timestampOffset)),\n this.enqueueOperation_(\n contentType,\n this.setAppendWindowEnd_.bind(this, contentType, appendWindowEnd))\n ]);\n};\n\n\n/**\n * @param {string=} opt_reason Valid reasons are 'network' and 'decode'.\n * @return {!Promise}\n * @see http://w3c.github.io/media-source/#idl-def-EndOfStreamError\n */\nshaka.media.MediaSourceEngine.prototype.endOfStream = function(opt_reason) {\n return this.enqueueBlockingOperation_(function() {\n // Chrome won't let me pass undefined, but it will let me omit the\n // argument. Firefox does not have this problem.\n // TODO: File a bug about this.\n if (opt_reason) {\n this.mediaSource_.endOfStream(opt_reason);\n } else {\n this.mediaSource_.endOfStream();\n }\n }.bind(this));\n};\n\n\n/**\n * We only support increasing duration at this time. Decreasing duration\n * causes the MSE removal algorithm to run, which results in an 'updateend'\n * event. Supporting this scenario would be complicated, and is not currently\n * needed.\n *\n * @param {number} duration\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.setDuration = function(duration) {\n goog.asserts.assert(\n isNaN(this.mediaSource_.duration) ||\n this.mediaSource_.duration <= duration,\n 'duration cannot decrease: ' + this.mediaSource_.duration + ' -> ' +\n duration);\n return this.enqueueBlockingOperation_(function() {\n this.mediaSource_.duration = duration;\n }.bind(this));\n};\n\n\n/**\n * Get the current MediaSource duration.\n *\n * @return {number}\n */\nshaka.media.MediaSourceEngine.prototype.getDuration = function() {\n return this.mediaSource_.duration;\n};\n\n\n/**\n * Append data to the SourceBuffer.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {!ArrayBuffer} data\n * @throws QuotaExceededError if the browser's buffer is full\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.append_ =\n function(contentType, data) {\n // This will trigger an 'updateend' event.\n this.sourceBuffers_[contentType].appendBuffer(data);\n};\n\n\n/**\n * Remove data from the SourceBuffer.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} startTime\n * @param {number} endTime\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.remove_ =\n function(contentType, startTime, endTime) {\n if (endTime <= startTime) {\n // Ignore removal of inverted or empty ranges.\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n return;\n }\n\n // This will trigger an 'updateend' event.\n this.sourceBuffers_[contentType].remove(startTime, endTime);\n};\n\n\n/**\n * Call abort() on the SourceBuffer.\n * This resets MSE's last_decode_timestamp on all track buffers, which should\n * trigger the splicing logic for overlapping segments.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.abort_ = function(contentType) {\n // Save the append window end, which is reset on abort().\n var appendWindowEnd = this.sourceBuffers_[contentType].appendWindowEnd;\n\n // This will not trigger an 'updateend' event, since nothing is happening.\n // This is only to reset MSE internals, not to abort an actual operation.\n this.sourceBuffers_[contentType].abort();\n\n // Restore the append window end.\n this.sourceBuffers_[contentType].appendWindowEnd = appendWindowEnd;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * Nudge the playhead to force the media pipeline to be flushed.\n * This seems to be necessary on Chromecast to get new content to replace old\n * content.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.flush_ = function(contentType) {\n // Never use flush_ if there's data. It causes a hiccup in playback.\n goog.asserts.assert(\n this.video_.buffered.length == 0,\n 'MediaSourceEngine.flush_ should only be used after clearing all data!');\n\n // Seeking forces the pipeline to be flushed.\n this.video_.currentTime -= 0.001;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * Set the SourceBuffer's timestamp offset.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} timestampOffset\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.setTimestampOffset_ =\n function(contentType, timestampOffset) {\n this.sourceBuffers_[contentType].timestampOffset = timestampOffset;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * Set the SourceBuffer's append window end.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} appendWindowEnd\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.setAppendWindowEnd_ =\n function(contentType, appendWindowEnd) {\n var fudge = 1 / 25; // one frame, assuming a low framerate\n this.sourceBuffers_[contentType].appendWindowEnd = appendWindowEnd + fudge;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {!Event} event\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.onError_ =\n function(contentType, event) {\n var operation = this.queues_[contentType][0];\n goog.asserts.assert(operation, 'Spurious error event!');\n goog.asserts.assert(!this.sourceBuffers_[contentType].updating,\n 'SourceBuffer should not be updating on error!');\n var code = this.video_.error ? this.video_.error.code : 0;\n operation.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_FAILED,\n code));\n // Do not pop from queue. An 'updateend' event will fire next, and to avoid\n // synchronizing these two event handlers, we will allow that one to pop from\n // the queue as normal. Note that because the operation has already been\n // rejected, the call to resolve() in the 'updateend' handler will have no\n // effect.\n};\n\n\n/**\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.onUpdateEnd_ = function(contentType) {\n var operation = this.queues_[contentType][0];\n goog.asserts.assert(operation, 'Spurious updateend event!');\n if (!operation) return;\n goog.asserts.assert(!this.sourceBuffers_[contentType].updating,\n 'SourceBuffer should not be updating on updateend!');\n operation.p.resolve();\n this.popFromQueue_(contentType);\n};\n\n\n/**\n * Enqueue an operation and start it if appropriate.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {function()} start\n * @return {!Promise}\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.enqueueOperation_ =\n function(contentType, start) {\n if (this.destroyed_) return Promise.reject();\n\n var operation = {\n start: start,\n p: new shaka.util.PublicPromise()\n };\n this.queues_[contentType].push(operation);\n\n if (this.queues_[contentType].length == 1) {\n try {\n operation.start();\n } catch (exception) {\n if (exception.name == 'QuotaExceededError') {\n operation.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR,\n contentType));\n } else {\n operation.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW,\n exception));\n }\n this.popFromQueue_(contentType);\n }\n }\n return operation.p;\n};\n\n\n/**\n * Enqueue an operation which must block all other operations on all\n * SourceBuffers.\n *\n * @param {function()} run\n * @return {!Promise}\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.enqueueBlockingOperation_ =\n function(run) {\n if (this.destroyed_) return Promise.reject();\n\n var allWaiters = [];\n\n // Enqueue a 'wait' operation onto each queue.\n // This operation signals its readiness when it starts.\n // When all wait operations are ready, the real operation takes place.\n for (var contentType in this.sourceBuffers_) {\n var ready = new shaka.util.PublicPromise();\n var operation = {\n start: function(ready) { ready.resolve(); }.bind(null, ready),\n p: ready\n };\n\n this.queues_[contentType].push(operation);\n allWaiters.push(ready);\n\n if (this.queues_[contentType].length == 1) {\n operation.start();\n }\n }\n\n // Return a Promise to the real operation, which waits to begin until there\n // are no other in-progress operations on any SourceBuffers.\n return Promise.all(allWaiters).then(function() {\n if (!COMPILED) {\n // If we did it correctly, nothing is updating.\n for (var contentType in this.sourceBuffers_) {\n goog.asserts.assert(\n this.sourceBuffers_[contentType].updating == false,\n 'SourceBuffers should not be updating after a blocking op!');\n }\n }\n\n var ret;\n // Run the real operation, which is synchronous.\n try {\n run();\n } catch (exception) {\n ret = Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW,\n exception));\n }\n\n // Unblock the queues.\n for (var contentType in this.sourceBuffers_) {\n this.popFromQueue_(contentType);\n }\n\n return ret;\n }.bind(this), function() {\n // One of the waiters failed, which means we've been destroyed.\n goog.asserts.assert(this.destroyed_, 'Should be destroyed by now');\n // We haven't popped from the queue. Canceled waiters have been removed by\n // destroy. What's left now should just be resolved waiters. In uncompiled\n // mode, we will maintain good hygiene and make sure the assert at the end\n // of destroy passes. In compiled mode, the queues are wiped in destroy.\n if (!COMPILED) {\n for (var contentType in this.sourceBuffers_) {\n if (this.queues_[contentType].length) {\n goog.asserts.assert(\n this.queues_[contentType].length == 1,\n 'Should be at most one item in queue!');\n goog.asserts.assert(\n allWaiters.indexOf(this.queues_[contentType][0].p) != -1,\n 'The item in queue should be one of our waiters!');\n this.queues_[contentType].shift();\n }\n }\n }\n return Promise.reject();\n }.bind(this));\n};\n\n\n/**\n * Pop from the front of the queue and start a new operation.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.popFromQueue_ = function(contentType) {\n // Remove the in-progress operation, which is now complete.\n this.queues_[contentType].shift();\n // Retrieve the next operation, if any, from the queue and start it.\n var next = this.queues_[contentType][0];\n if (next) {\n try {\n next.start();\n } catch (exception) {\n next.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW,\n exception));\n this.popFromQueue_(contentType);\n }\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/media_source_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.LanguageUtils');\n\ngoog.require('goog.asserts');\n\n\n/**\n * @namespace shaka.util.LanguageUtils\n * @summary A set of language utility functions.\n */\n\n\n/**\n * Compares two language tags as defined by RFC 5646 and ISO 639. The\n * comparison takes sublanguages into account via the |fuzz| parameter.\n * The caller is expected to normalize the inputs first.\n *\n * @see shaka.util.LanguageUtils.normalize()\n * @see IETF RFC 5646\n * @see ISO 639\n *\n * @param {shaka.util.LanguageUtils.MatchType} fuzz What kind of match is\n * acceptable.\n * @param {string} preference The user's preferred language tag.\n * @param {string} candidate An available language tag.\n * @return {boolean}\n */\nshaka.util.LanguageUtils.match = function(fuzz, preference, candidate) {\n // Alias.\n var LanguageUtils = shaka.util.LanguageUtils;\n\n goog.asserts.assert(preference == LanguageUtils.normalize(preference),\n 'Language pref should be normalized first');\n goog.asserts.assert(candidate == LanguageUtils.normalize(candidate),\n 'Language candidate should be normalized first');\n\n if (candidate == preference) {\n return true;\n }\n\n if (fuzz >= shaka.util.LanguageUtils.MatchType.BASE_LANGUAGE_OKAY &&\n candidate == preference.split('-')[0]) {\n return true;\n }\n\n if (fuzz >= shaka.util.LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY &&\n candidate.split('-')[0] == preference.split('-')[0]) {\n return true;\n }\n\n return false;\n};\n\n\n/**\n * A match type for fuzzy-matching logic.\n *\n * @enum {number}\n */\nshaka.util.LanguageUtils.MatchType = {\n /** Accepts an exact match. */\n EXACT: 0,\n /** Accepts a less-specific version of the preferred sublanguage. */\n BASE_LANGUAGE_OKAY: 1,\n /** Accepts a different sublanguage of the preferred base language. */\n OTHER_SUB_LANGUAGE_OKAY: 2\n};\n\n\n/**\n * Normalize the language tag.\n *\n * RFC 5646 specifies that language tags are case insensitive and that the\n * shortest representation of the base language should always be used.\n * This will convert the tag to lower-case and map 3-letter codes (ISO 639-2)\n * to 2-letter codes (ISO 639-1) whenever possible.\n *\n * @param {string} lang\n * @return {string}\n *\n * @see IETF RFC 5646\n * @see ISO 639\n */\nshaka.util.LanguageUtils.normalize = function(lang) {\n var fields = lang.toLowerCase().split('-');\n var base = fields[0];\n var replacement = shaka.util.LanguageUtils.isoMap_[base];\n if (replacement) {\n fields[0] = replacement;\n }\n return fields.join('-');\n};\n\n\n/**\n * A map from 3-letter language codes (ISO 639-2) to 2-letter language codes\n * (ISO 639-1) for all languages which have both in the registry.\n *\n * @const {!Object.<string, string>}\n * @private\n */\nshaka.util.LanguageUtils.isoMap_ = {\n 'aar': 'aa', 'abk': 'ab', 'afr': 'af', 'aka': 'ak', 'alb': 'sq', 'amh': 'am',\n 'ara': 'ar', 'arg': 'an', 'arm': 'hy', 'asm': 'as', 'ava': 'av', 'ave': 'ae',\n 'aym': 'ay', 'aze': 'az', 'bak': 'ba', 'bam': 'bm', 'baq': 'eu', 'bel': 'be',\n 'ben': 'bn', 'bih': 'bh', 'bis': 'bi', 'bod': 'bo', 'bos': 'bs', 'bre': 'br',\n 'bul': 'bg', 'bur': 'my', 'cat': 'ca', 'ces': 'cs', 'cha': 'ch', 'che': 'ce',\n 'chi': 'zh', 'chu': 'cu', 'chv': 'cv', 'cor': 'kw', 'cos': 'co', 'cre': 'cr',\n 'cym': 'cy', 'cze': 'cs', 'dan': 'da', 'deu': 'de', 'div': 'dv', 'dut': 'nl',\n 'dzo': 'dz', 'ell': 'el', 'eng': 'en', 'epo': 'eo', 'est': 'et', 'eus': 'eu',\n 'ewe': 'ee', 'fao': 'fo', 'fas': 'fa', 'fij': 'fj', 'fin': 'fi', 'fra': 'fr',\n 'fre': 'fr', 'fry': 'fy', 'ful': 'ff', 'geo': 'ka', 'ger': 'de', 'gla': 'gd',\n 'gle': 'ga', 'glg': 'gl', 'glv': 'gv', 'gre': 'el', 'grn': 'gn', 'guj': 'gu',\n 'hat': 'ht', 'hau': 'ha', 'heb': 'he', 'her': 'hz', 'hin': 'hi', 'hmo': 'ho',\n 'hrv': 'hr', 'hun': 'hu', 'hye': 'hy', 'ibo': 'ig', 'ice': 'is', 'ido': 'io',\n 'iii': 'ii', 'iku': 'iu', 'ile': 'ie', 'ina': 'ia', 'ind': 'id', 'ipk': 'ik',\n 'isl': 'is', 'ita': 'it', 'jav': 'jv', 'jpn': 'ja', 'kal': 'kl', 'kan': 'kn',\n 'kas': 'ks', 'kat': 'ka', 'kau': 'kr', 'kaz': 'kk', 'khm': 'km', 'kik': 'ki',\n 'kin': 'rw', 'kir': 'ky', 'kom': 'kv', 'kon': 'kg', 'kor': 'ko', 'kua': 'kj',\n 'kur': 'ku', 'lao': 'lo', 'lat': 'la', 'lav': 'lv', 'lim': 'li', 'lin': 'ln',\n 'lit': 'lt', 'ltz': 'lb', 'lub': 'lu', 'lug': 'lg', 'mac': 'mk', 'mah': 'mh',\n 'mal': 'ml', 'mao': 'mi', 'mar': 'mr', 'may': 'ms', 'mkd': 'mk', 'mlg': 'mg',\n 'mlt': 'mt', 'mon': 'mn', 'mri': 'mi', 'msa': 'ms', 'mya': 'my', 'nau': 'na',\n 'nav': 'nv', 'nbl': 'nr', 'nde': 'nd', 'ndo': 'ng', 'nep': 'ne', 'nld': 'nl',\n 'nno': 'nn', 'nob': 'nb', 'nor': 'no', 'nya': 'ny', 'oci': 'oc', 'oji': 'oj',\n 'ori': 'or', 'orm': 'om', 'oss': 'os', 'pan': 'pa', 'per': 'fa', 'pli': 'pi',\n 'pol': 'pl', 'por': 'pt', 'pus': 'ps', 'que': 'qu', 'roh': 'rm', 'ron': 'ro',\n 'rum': 'ro', 'run': 'rn', 'rus': 'ru', 'sag': 'sg', 'san': 'sa', 'sin': 'si',\n 'slk': 'sk', 'slo': 'sk', 'slv': 'sl', 'sme': 'se', 'smo': 'sm', 'sna': 'sn',\n 'snd': 'sd', 'som': 'so', 'sot': 'st', 'spa': 'es', 'sqi': 'sq', 'srd': 'sc',\n 'srp': 'sr', 'ssw': 'ss', 'sun': 'su', 'swa': 'sw', 'swe': 'sv', 'tah': 'ty',\n 'tam': 'ta', 'tat': 'tt', 'tel': 'te', 'tgk': 'tg', 'tgl': 'tl', 'tha': 'th',\n 'tib': 'bo', 'tir': 'ti', 'ton': 'to', 'tsn': 'tn', 'tso': 'ts', 'tuk': 'tk',\n 'tur': 'tr', 'twi': 'tw', 'uig': 'ug', 'ukr': 'uk', 'urd': 'ur', 'uzb': 'uz',\n 'ven': 've', 'vie': 'vi', 'vol': 'vo', 'wel': 'cy', 'wln': 'wa', 'wol': 'wo',\n 'xho': 'xh', 'yid': 'yi', 'yor': 'yo', 'zha': 'za', 'zho': 'zh', 'zul': 'zu'\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/language_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.StreamUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.MediaSourceEngine');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.util.ArrayUtils');\ngoog.require('shaka.util.LanguageUtils');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n/**\n * @param {shakaExtern.Variant} variant\n * @param {shakaExtern.Restrictions} restrictions\n * Configured restrictions from the user.\n * @param {{width: number, height: number}} maxHwRes\n * The maximum resolution the hardware can handle.\n * This is applied separately from user restrictions because the setting\n * should not be easily replaced by the user's configuration.\n * @return {boolean}\n */\nshaka.util.StreamUtils.meetsRestrictions = function(\n variant, restrictions, maxHwRes) {\n var video = variant.video;\n if (video) {\n if (video.width < restrictions.minWidth ||\n video.width > restrictions.maxWidth || video.width > maxHwRes.width ||\n video.height < restrictions.minHeight ||\n video.height > restrictions.maxHeight ||\n video.height > maxHwRes.height ||\n (video.width * video.height) < restrictions.minPixels ||\n (video.width * video.height) > restrictions.maxPixels) {\n return false;\n }\n }\n\n if (variant.bandwidth < restrictions.minBandwidth ||\n variant.bandwidth > restrictions.maxBandwidth) {\n return false;\n }\n\n return true;\n};\n\n\n/**\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Restrictions} restrictions\n * @param {{width: number, height: number}} maxHwRes\n * @return {boolean} Whether the tracks changed.\n */\nshaka.util.StreamUtils.applyRestrictions =\n function(period, restrictions, maxHwRes) {\n var tracksChanged = false;\n\n period.variants.forEach(function(variant) {\n var originalAllowed = variant.allowedByApplication;\n variant.allowedByApplication = shaka.util.StreamUtils.meetsRestrictions(\n variant, restrictions, maxHwRes);\n\n if (originalAllowed != variant.allowedByApplication) {\n tracksChanged = true;\n }\n });\n\n return tracksChanged;\n};\n\n\n/**\n * Alters the given Period to filter out any unplayable streams.\n *\n * @param {shaka.media.DrmEngine} drmEngine\n * @param {!Object.<string, shakaExtern.Stream>} activeStreams\n * @param {shakaExtern.Period} period\n */\nshaka.util.StreamUtils.filterPeriod = function(\n drmEngine, activeStreams, period) {\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var activeVideo = activeStreams[ContentType.VIDEO];\n var activeAudio = activeStreams[ContentType.AUDIO];\n\n // Filter variants\n for (var i = 0; i < period.variants.length; ++i) {\n var variant = period.variants[i];\n if (!StreamUtils.variantIsCompatible_(\n variant, drmEngine, activeAudio, activeVideo)) {\n shaka.log.debug('Dropping Variant (not compatible with key system, ' +\n 'platform, or active Variant)', variant);\n period.variants.splice(i, 1);\n --i;\n continue;\n }\n }\n\n // Filter text streams\n for (var i = 0; i < period.textStreams.length; ++i) {\n var stream = period.textStreams[i];\n var fullMimeType = StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n if (!shaka.media.TextEngine.isTypeSupported(fullMimeType)) {\n shaka.log.debug('Dropping text stream. Is not supported by the ' +\n 'platform.', stream);\n period.textStreams.splice(i, 1);\n --i;\n }\n }\n};\n\n\n/**\n * Checks if a stream is compatible with the key system, platform,\n * and active stream.\n *\n * @param {?shakaExtern.Stream} stream\n * @param {shaka.media.DrmEngine} drmEngine\n * @param {?shakaExtern.Stream} activeStream\n * @return {boolean}\n * @private\n */\nshaka.util.StreamUtils.streamIsCompatible_ =\n function(stream, drmEngine, activeStream) {\n if (!stream) return true;\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n goog.asserts.assert(stream.type != ContentType.TEXT,\n 'Should not be called on a text stream!');\n\n var drmSupportedMimeTypes = null;\n if (drmEngine && drmEngine.initialized()) {\n drmSupportedMimeTypes = drmEngine.getSupportedTypes();\n }\n\n // Check if stream can be played by the platform\n var fullMimeType = shaka.util.StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n\n if (!shaka.media.MediaSourceEngine.isTypeSupported(fullMimeType))\n return false;\n\n // Check if stream can be handled by the key system.\n // There's no need to check that the stream is supported by the\n // chosen key system since the caller has already verified that.\n if (drmSupportedMimeTypes && stream.encrypted &&\n drmSupportedMimeTypes.indexOf(fullMimeType) < 0) {\n return false;\n }\n\n // Lastly, check if active stream can switch to the stream\n // Basic mime types and basic codecs need to match.\n // For example, we can't adapt between WebM and MP4,\n // nor can we adapt between mp4a.* to ec-3.\n // We can switch between text types on the fly,\n // so don't run this check on text.\n if (activeStream) {\n if (stream.mimeType != activeStream.mimeType ||\n stream.codecs.split('.')[0] != activeStream.codecs.split('.')[0]) {\n return false;\n }\n }\n\n return true;\n};\n\n\n/**\n * Checks if a variant is compatible with the key system, platform,\n * and active stream.\n *\n * @param {!shakaExtern.Variant} variant\n * @param {shaka.media.DrmEngine} drmEngine\n * @param {shakaExtern.Stream} activeAudio\n * @param {shakaExtern.Stream} activeVideo\n * @return {boolean}\n * @private\n */\nshaka.util.StreamUtils.variantIsCompatible_ =\n function(variant, drmEngine, activeAudio, activeVideo) {\n var StreamUtils = shaka.util.StreamUtils;\n if (drmEngine && drmEngine.initialized()) {\n if (!drmEngine.isSupportedByKeySystem(variant)) return false;\n }\n\n return StreamUtils.streamIsCompatible_(variant.audio,\n drmEngine,\n activeAudio) &&\n StreamUtils.streamIsCompatible_(variant.video, drmEngine, activeVideo);\n};\n\n\n/**\n * Gets an array of Track objects for the given Period\n *\n * @param {shakaExtern.Period} period\n * @param {?number} activeAudioId\n * @param {?number} activeVideoId\n * @return {!Array.<shakaExtern.Track>}\n */\nshaka.util.StreamUtils.getVariantTracks =\n function(period, activeAudioId, activeVideoId) {\n var StreamUtils = shaka.util.StreamUtils;\n var variants = StreamUtils.getPlayableVariants(period.variants);\n var label = null;\n var tracks = variants.map(function(variant) {\n var isActive;\n if (variant.video && variant.audio) {\n isActive = activeVideoId == variant.video.id &&\n activeAudioId == variant.audio.id;\n } else {\n isActive = (variant.video && activeVideoId == variant.video.id) ||\n (variant.audio && activeAudioId == variant.audio.id);\n }\n var codecs = '';\n if (variant.video) codecs += variant.video.codecs;\n if (variant.audio) {\n if (codecs != '') codecs += ', ';\n codecs += variant.audio.codecs;\n label = variant.audio.label;\n }\n\n var audioCodec = variant.audio ? variant.audio.codecs : null;\n var videoCodec = variant.video ? variant.video.codecs : null;\n var mimeType = null;\n if (variant.video) mimeType = variant.video.mimeType;\n else if (variant.audio) mimeType = variant.audio.mimeType;\n\n var kind = null;\n if (variant.audio) kind = variant.audio.kind;\n else if (variant.video) kind = variant.video.kind;\n\n var audioRoles = variant.audio ? variant.audio.roles : [];\n var videoRoles = variant.video ? variant.video.roles : [];\n var roles = shaka.util.ArrayUtils.removeDuplicates(\n audioRoles.concat(videoRoles));\n return {\n id: variant.id,\n active: isActive,\n type: 'variant',\n bandwidth: variant.bandwidth,\n language: variant.language,\n label: label,\n kind: kind || null,\n width: variant.video ? variant.video.width : null,\n height: variant.video ? variant.video.height : null,\n frameRate: variant.video ? variant.video.frameRate : undefined,\n mimeType: mimeType,\n codecs: codecs,\n audioCodec: audioCodec,\n videoCodec: videoCodec,\n primary: variant.primary,\n roles: roles,\n videoId: variant.video ? variant.video.id : null,\n audioId: variant.audio ? variant.audio.id : null\n };\n });\n\n return tracks;\n};\n\n\n/**\n * Gets an array of text Track objects for the given Period.\n *\n * @param {shakaExtern.Period} period\n * @param {?number} activeStreamId\n * @return {!Array.<shakaExtern.Track>}\n */\nshaka.util.StreamUtils.getTextTracks = function(period, activeStreamId) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n return period.textStreams.map(function(stream) {\n return {\n id: stream.id,\n active: activeStreamId == stream.id,\n type: ContentType.TEXT,\n language: stream.language,\n label: stream.label,\n kind: stream.kind,\n mimeType: stream.mimeType,\n codecs: stream.codecs || null,\n audioCodec: null,\n videoCodec: null,\n primary: stream.primary,\n roles: stream.roles\n };\n });\n};\n\n\n/**\n * Find the Variant for the given track.\n *\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Track} track\n * @return {?shakaExtern.Variant}\n */\nshaka.util.StreamUtils.findVariantForTrack = function(period, track) {\n for (var i = 0; i < period.variants.length; i++) {\n if (period.variants[i].id == track.id)\n return period.variants[i];\n }\n return null;\n};\n\n\n/**\n * Find the text stream for the given track.\n *\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Track} track\n * @return {?shakaExtern.Stream}\n */\nshaka.util.StreamUtils.findTextStreamForTrack = function(period, track) {\n for (var i = 0; i < period.textStreams.length; i++) {\n if (period.textStreams[i].id == track.id)\n return period.textStreams[i];\n }\n return null;\n};\n\n\n/**\n * Determines if the given variant is playable.\n * @param {!shakaExtern.Variant} variant\n * @return {boolean}\n */\nshaka.util.StreamUtils.isPlayable = function(variant) {\n return variant.allowedByApplication && variant.allowedByKeySystem;\n};\n\n\n/**\n * Filters out not playable variants.\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @return {!Array.<!shakaExtern.Variant>}\n */\nshaka.util.StreamUtils.getPlayableVariants = function(variants) {\n return variants.filter(function(variant) {\n return shaka.util.StreamUtils.isPlayable(variant);\n });\n};\n\n\n/**\n * Chooses variants according to the given config.\n *\n * @param {shakaExtern.Period} period\n * @param {string} preferredLanguage\n * @param {!Object=} opt_languageMatches\n * @param {string=} opt_role\n * @return {!Array.<!shakaExtern.Variant>}\n */\nshaka.util.StreamUtils.filterVariantsByRoleAndLanguage = function(\n period, preferredLanguage, opt_languageMatches, opt_role) {\n var LanguageUtils = shaka.util.LanguageUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var variants = shaka.util.StreamUtils.getPlayableVariants(period.variants);\n\n // Initially choose the first language in the list.\n /** @type {!Array.<!shakaExtern.Variant>} */\n var chosen = variants.filter(function(variant) {\n return variant.language == variants[0].language;\n });\n\n // Prefer primary variants.\n var primaryVariants = variants.filter(function(variant) {\n return variant.primary;\n });\n if (primaryVariants.length) chosen = primaryVariants;\n\n // Choose based on language preference. Favor exact matches, then\n // base matches, finally different subtags. Execute in reverse order so\n // the later steps override the previous ones.\n if (preferredLanguage) {\n var pref = LanguageUtils.normalize(preferredLanguage);\n [LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY,\n LanguageUtils.MatchType.BASE_LANGUAGE_OKAY,\n LanguageUtils.MatchType.EXACT]\n .forEach(function(matchType) {\n var betterLangMatchFound = false;\n variants.forEach(function(variant) {\n pref = LanguageUtils.normalize(pref);\n var lang = LanguageUtils.normalize(variant.language);\n if (LanguageUtils.match(matchType, pref, lang)) {\n if (betterLangMatchFound) {\n chosen.push(variant);\n } else {\n chosen = [variant];\n betterLangMatchFound = true;\n }\n if (opt_languageMatches) {\n opt_languageMatches[ContentType.AUDIO] = true;\n }\n }\n }); // forEach(variant)\n }); // forEach(matchType)\n } // if (preferredLanguage)\n\n // Choose based on role preference. If there's no exact match, return\n // what was chosen based on the language preference.\n var role = opt_role || '';\n if (role) {\n var chosenWithRoles = chosen.filter(function(variant) {\n return (variant.audio && (variant.audio.roles.indexOf(role) > - 1)) ||\n (variant.video && (variant.video.roles.indexOf(role) > - 1));\n });\n if (chosenWithRoles.length) return chosenWithRoles;\n else {\n shaka.log.warning(\n 'No exact match for the role is found. Returning the selection ' +\n 'based on language preference.');\n }\n }\n return chosen;\n};\n\n\n/**\n * Chooses text streams according to the given config.\n *\n * @param {shakaExtern.Period} period\n * @param {string} preferredLanguage\n * @param {!Object=} opt_languageMatches\n * @param {string=} opt_role\n * @return {!Array.<!shakaExtern.Stream>}\n */\nshaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage = function(\n period, preferredLanguage, opt_languageMatches, opt_role) {\n var LanguageUtils = shaka.util.LanguageUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var streams = period.textStreams;\n\n // Choose all the streams.\n /** @type {!Array.<!shakaExtern.Stream>} */\n var chosen = streams;\n\n // Prefer primary text streams.\n var primaryStreams = streams.filter(function(stream) {\n return stream.primary;\n });\n if (primaryStreams.length) chosen = primaryStreams;\n\n // Override based on language preference. Favor exact matches, then\n // base matches, finally different subtags. Execute in reverse order so\n // the later steps override the previous ones.\n if (preferredLanguage) {\n var pref = LanguageUtils.normalize(preferredLanguage);\n [LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY,\n LanguageUtils.MatchType.BASE_LANGUAGE_OKAY,\n LanguageUtils.MatchType.EXACT]\n .forEach(function(matchType) {\n var betterLangMatchFound = false;\n streams.forEach(function(stream) {\n var lang = LanguageUtils.normalize(stream.language);\n if (LanguageUtils.match(matchType, pref, lang)) {\n if (betterLangMatchFound) {\n chosen.push(stream);\n } else {\n chosen = [stream];\n betterLangMatchFound = true;\n }\n if (opt_languageMatches)\n opt_languageMatches[ContentType.TEXT] = true;\n }\n }); // forEach(stream)\n }); // forEach(matchType)\n } // if (preferredLanguage)\n // Choose based on role preference. If there's no exact match, return\n // what was chosen based on the language preference.\n var role = opt_role || '';\n if (role) {\n var chosenWithRoles = chosen.filter(function(stream) {\n return (stream && (stream.roles.indexOf(role) > - 1));\n });\n if (chosenWithRoles.length) return chosenWithRoles;\n else {\n shaka.log.warning(\n 'No exact match for the role is found. Returning the selection ' +\n 'based on language preference.');\n }\n }\n return chosen;\n};\n\n\n/**\n * Finds a Variant with given audio and video streams.\n * Returns null if none was found.\n *\n * @param {?shakaExtern.Stream} audio\n * @param {?shakaExtern.Stream} video\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @return {?shakaExtern.Variant}\n */\nshaka.util.StreamUtils.getVariantByStreams = function(audio, video, variants) {\n for (var i = 0; i < variants.length; i++) {\n if (variants[i].audio == audio && variants[i].video == video)\n return variants[i];\n }\n\n return null;\n};\n\n\n/**\n * Finds a Variant with the given video and audio streams, by stream ID.\n * Returns null if none were found.\n *\n * @param {?number} audioId\n * @param {?number} videoId\n * @param {!Array.<shakaExtern.Variant>} variants\n * @return {?shakaExtern.Variant}\n */\nshaka.util.StreamUtils.getVariantByStreamIds = function(\n audioId, videoId, variants) {\n function matchesId(id, stream) {\n if (id == null)\n return stream == null;\n else\n return stream.id == id;\n }\n\n for (var i = 0; i < variants.length; i++) {\n if (matchesId(audioId, variants[i].audio) &&\n matchesId(videoId, variants[i].video)) {\n return variants[i];\n }\n }\n\n return null;\n};\n\n\n/**\n * Takes a MIME type and optional codecs string and produces the full MIME type.\n *\n * @param {string} mimeType\n * @param {string=} opt_codecs\n * @return {string}\n */\nshaka.util.StreamUtils.getFullMimeType = function(mimeType, opt_codecs) {\n var fullMimeType = mimeType;\n if (opt_codecs) {\n fullMimeType += '; codecs=\"' + opt_codecs + '\"';\n }\n return fullMimeType;\n};\n\n\n/**\n * Gets the index of the Period that contains the given time.\n * @param {shakaExtern.Manifest} manifest\n * @param {number} time The time in seconds from the start of the presentation.\n * @return {number}\n */\nshaka.util.StreamUtils.findPeriodContainingTime = function(manifest, time) {\n for (var i = manifest.periods.length - 1; i > 0; --i) {\n var period = manifest.periods[i];\n if (time >= period.startTime)\n return i;\n }\n return 0;\n};\n\n\n/**\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.Stream} stream\n * @return {number} The index of the Period which contains |stream|, or -1 if\n * no Period contains |stream|.\n */\nshaka.util.StreamUtils.findPeriodContainingStream = function(manifest, stream) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n for (var periodIdx = 0; periodIdx < manifest.periods.length; ++periodIdx) {\n var period = manifest.periods[periodIdx];\n if (stream.type == ContentType.TEXT) {\n for (var j = 0; j < period.textStreams.length; ++j) {\n var textStream = period.textStreams[j];\n if (textStream == stream)\n return periodIdx;\n }\n } else {\n for (var j = 0; j < period.variants.length; ++j) {\n var variant = period.variants[j];\n if (variant.audio == stream || variant.video == stream ||\n (variant.video && variant.video.trickModeVideo == stream)) {\n return periodIdx;\n }\n }\n }\n }\n return -1;\n};\n\n\n/**\n * Gets the rebuffering goal from the manifest and configuration.\n *\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.StreamingConfiguration} config\n * @param {number} scaleFactor\n *\n * @return {number}\n */\nshaka.util.StreamUtils.getRebufferingGoal = function(\n manifest, config, scaleFactor) {\n return scaleFactor *\n Math.max(manifest.minBufferTime || 0, config.rebufferingGoal);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/stream_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.abr.SimpleAbrManager');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.abr.EwmaBandwidthEstimator');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * <p>\n * This defines the default ABR manager for the Player. An instance of this\n * class is used when no ABR manager is given.\n * </p>\n * <p>\n * The behavior of this class is to take throughput samples using\n * segmentDownloaded to estimate the current network bandwidth. Then it will\n * use that to choose the streams that best fit the current bandwidth. It will\n * always pick the highest bandwidth variant it thinks can be played.\n * </p>\n * <p>\n * After the initial choice (in chooseStreams), this class will call\n * switchCallback() when there is a better choice. switchCallback() will not\n * be called more than once per\n * ({@link shaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS}).\n * </p>\n * <p>\n * This does not adapt for text streams, it will always select the first one.\n * </p>\n *\n * @constructor\n * @struct\n * @implements {shakaExtern.AbrManager}\n * @export\n */\nshaka.abr.SimpleAbrManager = function() {\n /** @private {?shakaExtern.AbrManager.SwitchCallback} */\n this.switch_ = null;\n\n /** @private {boolean} */\n this.enabled_ = false;\n\n /** @private {shaka.abr.EwmaBandwidthEstimator} */\n this.bandwidthEstimator_ = new shaka.abr.EwmaBandwidthEstimator();\n\n /**\n * A filtered list of Variants to choose from.\n * @private {!Array.<!shakaExtern.Variant>}\n */\n this.variants_ = [];\n\n /**\n * A filtered list of text streams to choose from.\n * @private {!Array.<!shakaExtern.Stream>}\n */\n this.textStreams_ = [];\n\n /** @private {boolean} */\n this.startupComplete_ = false;\n\n /**\n * The last wall-clock time, in milliseconds, when Streams were chosen via\n * chooseStreams() or switch_().\n *\n * @private {?number}\n */\n this.lastTimeChosenMs_ = null;\n\n /** @private {shakaExtern.Restrictions} */\n this.restrictions_ = {\n minWidth: 0,\n maxWidth: Infinity,\n minHeight: 0,\n maxHeight: Infinity,\n minPixels: 0,\n maxPixels: Infinity,\n minBandwidth: 0,\n maxBandwidth: Infinity\n };\n};\n\n\n/**\n * The minimum amount of time that must pass between switches, in milliseconds.\n * This keeps us from changing too often and annoying the user.\n *\n * @const {number}\n */\nshaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS = 8000;\n\n\n/**\n * The fraction of the estimated bandwidth which we should try to use when\n * upgrading.\n *\n * @private\n * @const {number}\n */\nshaka.abr.SimpleAbrManager.BANDWIDTH_UPGRADE_TARGET_ = 0.85;\n\n\n/**\n * The largest fraction of the estimated bandwidth we should use. We should\n * downgrade to avoid this.\n *\n * @private\n * @const {number}\n */\nshaka.abr.SimpleAbrManager.BANDWIDTH_DOWNGRADE_TARGET_ = 0.95;\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.stop = function() {\n this.switch_ = null;\n this.enabled_ = false;\n this.variants_ = [];\n this.textStreams_ = [];\n this.lastTimeChosenMs_ = null;\n\n // Don't reset |startupComplete_|: if we've left the startup interval then we\n // can start using bandwidth estimates right away if init() is called again.\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.init = function(switchCallback) {\n this.switch_ = switchCallback;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.chooseStreams = function(\n mediaTypesToUpdate) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n // Choose streams for the specific types requested.\n var chosen = {};\n\n if (mediaTypesToUpdate.indexOf(ContentType.AUDIO) > -1 ||\n mediaTypesToUpdate.indexOf(ContentType.VIDEO) > -1) {\n // Choose a new Variant\n var variant = this.chooseVariant_(this.variants_);\n if (variant && variant.video)\n chosen[ContentType.VIDEO] = variant.video;\n\n if (variant && variant.audio)\n chosen[ContentType.AUDIO] = variant.audio;\n }\n\n if (mediaTypesToUpdate.indexOf(ContentType.TEXT) > -1) {\n // We don't adapt text, so just choose stream 0.\n chosen[ContentType.TEXT] = this.textStreams_[0];\n }\n\n this.lastTimeChosenMs_ = Date.now();\n return chosen;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.enable = function() {\n this.enabled_ = true;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.disable = function() {\n this.enabled_ = false;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.segmentDownloaded = function(\n deltaTimeMs, numBytes) {\n shaka.log.v2('Segment downloaded:',\n 'deltaTimeMs=' + deltaTimeMs,\n 'numBytes=' + numBytes);\n goog.asserts.assert(deltaTimeMs >= 0, 'expected a non-negative duration');\n this.bandwidthEstimator_.sample(deltaTimeMs, numBytes);\n\n if ((this.lastTimeChosenMs_ != null) && this.enabled_)\n this.suggestStreams_();\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.getBandwidthEstimate = function() {\n return this.bandwidthEstimator_.getBandwidthEstimate();\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setDefaultEstimate = function(estimate) {\n this.bandwidthEstimator_.setDefaultEstimate(estimate);\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setRestrictions = function(restrictions) {\n this.restrictions_ = restrictions;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setVariants = function(variants) {\n this.variants_ = variants;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setTextStreams = function(streams) {\n this.textStreams_ = streams;\n};\n\n\n/**\n * Calls switch_() with which Streams to switch to.\n *\n * @private\n */\nshaka.abr.SimpleAbrManager.prototype.suggestStreams_ = function() {\n shaka.log.v2('Suggesting Streams...');\n goog.asserts.assert(this.lastTimeChosenMs_ != null,\n 'lastTimeChosenMs_ should not be null');\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n if (!this.startupComplete_) {\n // Check if we've got enough data yet.\n if (!this.bandwidthEstimator_.hasGoodEstimate()) {\n shaka.log.v2('Still waiting for a good estimate...');\n return;\n }\n this.startupComplete_ = true;\n } else {\n // Check if we've left the switch interval.\n var now = Date.now();\n var delta = now - this.lastTimeChosenMs_;\n if (delta < shaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS) {\n shaka.log.v2('Still within switch interval...');\n return;\n }\n }\n\n var chosen = this.chooseStreams([ContentType.AUDIO, ContentType.VIDEO]);\n var currentBandwidthKbps =\n Math.round(this.bandwidthEstimator_.getBandwidthEstimate() / 1000.0);\n shaka.log.debug(\n 'Calling switch_(), bandwidth=' + currentBandwidthKbps + ' kbps');\n // If any of these chosen streams are already chosen, Player will filter them\n // out before passing the choices on to StreamingEngine.\n this.switch_(chosen);\n};\n\n\n/**\n * Chooses a Variant with an optimal bandwidth.\n *\n * @param {!Array.<shakaExtern.Variant>} variants\n * @return {shakaExtern.Variant}\n * @private\n */\nshaka.abr.SimpleAbrManager.prototype.chooseVariant_ = function(variants) {\n // Alias.\n var SimpleAbrManager = shaka.abr.SimpleAbrManager;\n\n // Get sorted Streams.\n var sortedVariants = SimpleAbrManager.filterAndSortVariants_(\n this.restrictions_, variants);\n var currentBandwidth = this.bandwidthEstimator_.getBandwidthEstimate();\n\n if (variants.length && !sortedVariants.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET);\n }\n\n // Start by assuming that we will use the first Stream.\n var chosen = sortedVariants[0];\n\n for (var i = 0; i < sortedVariants.length; ++i) {\n var variant = sortedVariants[i];\n var nextVariant = sortedVariants[i + 1] || {bandwidth: Infinity};\n\n var minBandwidth = variant.bandwidth /\n SimpleAbrManager.BANDWIDTH_DOWNGRADE_TARGET_;\n var maxBandwidth = nextVariant.bandwidth /\n SimpleAbrManager.BANDWIDTH_UPGRADE_TARGET_;\n shaka.log.v2('Bandwidth ranges:',\n (variant.bandwidth / 1e6).toFixed(3),\n (minBandwidth / 1e6).toFixed(3),\n (maxBandwidth / 1e6).toFixed(3));\n\n if (currentBandwidth >= minBandwidth && currentBandwidth <= maxBandwidth)\n chosen = variant;\n }\n\n return chosen;\n};\n\n\n/**\n * @param {shakaExtern.Restrictions} restrictions\n * @param {!Array.<shakaExtern.Variant>} variants\n * @return {!Array.<shakaExtern.Variant>} variants filtered according to\n * |restrictions| and sorted in ascending order of bandwidth.\n * @private\n */\nshaka.abr.SimpleAbrManager.filterAndSortVariants_ = function(\n restrictions, variants) {\n return variants\n .filter(function(variant) {\n return shaka.util.StreamUtils.meetsRestrictions(\n variant, restrictions,\n /* maxHwRes */ {width: Infinity, height: Infinity});\n })\n .sort(function(v1, v2) {\n return v1.bandwidth - v2.bandwidth;\n });\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/abr/simple_abr_manager.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.FakeEvent');\n\n\n\n/**\n * Create an Event work-alike object based on the dictionary.\n * The event should contain all of the same properties from the dict.\n *\n * @param {string} type\n * @param {Object=} opt_dict\n * @constructor\n * @extends {Event}\n */\nshaka.util.FakeEvent = function(type, opt_dict) {\n // Take properties from dict if present.\n var dict = opt_dict || {};\n for (var key in dict) {\n this[key] = dict[key];\n }\n\n\n // These Properties below cannot be set by dict. They are all provided for\n // compatibility with native events.\n\n /** @const {boolean} */\n this.bubbles = false;\n\n /** @type {boolean} */\n this.cancelable = false;\n\n /** @type {boolean} */\n this.defaultPrevented = false;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n this.timeStamp = window.performance && window.performance.now ?\n window.performance.now() : Date.now();\n\n /** @const {string} */\n this.type = type;\n\n /** @const {boolean} */\n this.isTrusted = false;\n\n /** @type {EventTarget} */\n this.currentTarget = null;\n\n /** @type {EventTarget} */\n this.target = null;\n\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n this.stopped = false;\n};\n\n\n/**\n * Prevents the default action of the event. Has no effect if the event isn't\n * cancellable.\n * @override\n */\nshaka.util.FakeEvent.prototype.preventDefault = function() {\n if (this.cancelable)\n this.defaultPrevented = true;\n};\n\n\n/**\n * Stops processing event listeners for this event. Provided for compatibility\n * with native Events.\n * @override\n */\nshaka.util.FakeEvent.prototype.stopImmediatePropagation = function() {\n this.stopped = true;\n};\n\n\n/**\n * Does nothing, since FakeEvents do not bubble. Provided for compatibility\n * with native Events.\n * @override\n */\nshaka.util.FakeEvent.prototype.stopPropagation = function() {};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/fake_event.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastUtils');\n\ngoog.require('shaka.util.FakeEvent');\n\n\n/**\n * @namespace shaka.cast.CastUtils\n * @summary A set of cast utility functions and variables shared between sender\n * and receiver.\n */\n\n\n/**\n * HTMLMediaElement events that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoEvents = [\n 'ended',\n 'play',\n 'playing',\n 'pause',\n 'pausing',\n 'ratechange',\n 'seeked',\n 'seeking',\n 'timeupdate',\n 'volumechange'\n];\n\n\n/**\n * HTMLMediaElement attributes that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoAttributes = [\n 'buffered',\n 'currentTime',\n 'duration',\n 'ended',\n 'loop',\n 'muted',\n 'paused',\n 'playbackRate',\n 'seeking',\n 'videoHeight',\n 'videoWidth',\n 'volume'\n];\n\n\n/**\n * HTMLMediaElement attributes that are transferred when casting begins.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoInitStateAttributes = [\n 'loop',\n 'playbackRate'\n];\n\n\n/**\n * HTMLMediaElement methods with no return value that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoVoidMethods = [\n 'pause',\n 'play'\n];\n\n\n/**\n * Player events that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerEvents = [\n 'adaptation',\n 'buffering',\n 'emsg',\n 'error',\n 'loading',\n 'unloading',\n 'texttrackvisibility',\n 'timelineregionadded',\n 'timelineregionenter',\n 'timelineregionexit',\n 'trackschanged'\n];\n\n\n/**\n * Player getter methods that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerGetterMethods = [\n 'drmInfo',\n 'getAudioLanguages',\n 'getConfiguration',\n 'getExpiration',\n 'getManifestUri',\n 'getPlaybackRate',\n 'getPlayheadTimeAsDate',\n 'getTextLanguages',\n 'getTextTracks',\n 'getTracks',\n 'getStats',\n 'getVariantTracks',\n 'isBuffering',\n 'isInProgress',\n 'isLive',\n 'isTextTrackVisible',\n 'keySystem',\n 'seekRange'\n];\n\n\n/**\n * Player getter and setter methods that are used to transfer state when casting\n * begins.\n * @const {!Array.<!Array.<string>>}\n */\nshaka.cast.CastUtils.PlayerInitState = [\n ['getConfiguration', 'configure']\n];\n\n\n/**\n * Player getter and setter methods that are used to transfer state after\n * after load() is resolved.\n * @const {!Array.<!Array.<string>>}\n */\nshaka.cast.CastUtils.PlayerInitAfterLoadState = [\n ['isTextTrackVisible', 'setTextTrackVisibility']\n];\n\n\n/**\n * Player methods with no return value that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerVoidMethods = [\n 'addTextTrack',\n 'cancelTrickPlay',\n 'configure',\n 'resetConfiguration',\n 'selectAudioLanguage',\n 'selectTextLanguage',\n 'selectTextTrack',\n 'selectTrack',\n 'selectVariantTrack',\n 'setTextTrackVisibility',\n 'trickPlay'\n];\n\n\n/**\n * Player methods returning a Promise that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerPromiseMethods = [\n // The opt_manifestFactory method is not supported.\n 'load',\n 'unload'\n];\n\n\n/**\n * @typedef {{\n * video: Object,\n * player: Object,\n * manifest: ?string,\n * startTime: ?number\n * }}\n * @property {Object} video\n * Dictionary of video properties to be set.\n * @property {Object} player\n * Dictionary of player setters to be called.\n * @property {?string} manifest\n * The currently-selected manifest, if present.\n * @property {?number} startTime\n * The playback start time, if currently playing.\n */\nshaka.cast.CastUtils.InitStateType;\n\n\n/**\n * The namespace for Shaka messages on the cast bus.\n * @const {string}\n */\nshaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE = 'urn:x-cast:com.google.shaka.v2';\n\n\n/**\n * The namespace for generic messages on the cast bus.\n * @const {string}\n */\nshaka.cast.CastUtils.GENERIC_MESSAGE_NAMESPACE =\n 'urn:x-cast:com.google.cast.media';\n\n\n/**\n * Serialize as JSON, but specially encode things JSON will not otherwise\n * represent.\n * @param {?} thing\n * @return {string}\n */\nshaka.cast.CastUtils.serialize = function(thing) {\n return JSON.stringify(thing, function(key, value) {\n if (key == 'manager') {\n // ABR manager can't be serialized.\n return undefined;\n }\n if (typeof value == 'function') {\n // Functions can't be (safely) serialized.\n return undefined;\n }\n if (value instanceof Event || value instanceof shaka.util.FakeEvent) {\n // Events don't serialize to JSON well because of the DOM objects\n // and other complex objects they contain. So we strip these out.\n // Note that using Object.keys or JSON.stringify directly on the event\n // will not capture its properties. We must use a for loop.\n var simpleEvent = {};\n for (var eventKey in value) {\n var eventValue = value[eventKey];\n if (eventValue && typeof eventValue == 'object') {\n // Strip out non-null object types because they are complex and we\n // don't need them.\n } else if (eventKey in Event) {\n // Strip out keys that are found on Event itself because they are\n // class-level constants we don't need, like Event.MOUSEMOVE == 16.\n } else {\n simpleEvent[eventKey] = eventValue;\n }\n }\n return simpleEvent;\n }\n if (value instanceof TimeRanges) {\n // TimeRanges must be unpacked into plain data for serialization.\n return shaka.cast.CastUtils.unpackTimeRanges_(value);\n }\n if (typeof value == 'number') {\n // NaN and infinity cannot be represented directly in JSON.\n if (isNaN(value)) return 'NaN';\n if (isFinite(value)) return value;\n if (value < 0) return '-Infinity';\n return 'Infinity';\n }\n return value;\n });\n};\n\n\n/**\n * Deserialize JSON using our special encodings.\n * @param {string} str\n * @return {?}\n */\nshaka.cast.CastUtils.deserialize = function(str) {\n return JSON.parse(str, function(key, value) {\n if (value == 'NaN') {\n return NaN;\n } else if (value == '-Infinity') {\n return -Infinity;\n } else if (value == 'Infinity') {\n return Infinity;\n } else if (value && typeof value == 'object' &&\n value['__type__'] == 'TimeRanges') {\n // TimeRanges objects have been unpacked and sent as plain data.\n // Simulate the original TimeRanges object.\n return shaka.cast.CastUtils.simulateTimeRanges_(value);\n }\n return value;\n });\n};\n\n\n/**\n * @param {!TimeRanges} ranges\n * @return {Object}\n * @private\n */\nshaka.cast.CastUtils.unpackTimeRanges_ = function(ranges) {\n var obj = {\n '__type__': 'TimeRanges', // a signal to deserialize\n 'length': ranges.length,\n 'start': [],\n 'end': []\n };\n\n for (var i = 0; i < ranges.length; ++i) {\n obj['start'].push(ranges.start(i));\n obj['end'].push(ranges.end(i));\n }\n\n return obj;\n};\n\n\n/**\n * Creates a simulated TimeRanges object from data sent by the cast receiver.\n * @param {?} obj\n * @return {{\n * length: number,\n * start: function(number): number,\n * end: function(number): number\n * }}\n * @private\n */\nshaka.cast.CastUtils.simulateTimeRanges_ = function(obj) {\n return {\n length: obj.length,\n // NOTE: a more complete simulation would throw when |i| was out of range,\n // but for simplicity we will assume a well-behaved application that uses\n // length instead of catch to stop iterating.\n start: function(i) { return obj.start[i]; },\n end: function(i) { return obj.end[i]; }\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastSender');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.cast.CastUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * @constructor\n * @struct\n * @param {string} receiverAppId The ID of the cast receiver application.\n * @param {function()} onStatusChanged A callback invoked when the cast status\n * changes.\n * @param {function(string, !shaka.util.FakeEvent)} onRemoteEvent A callback\n * invoked with target name and event when a remote event is received.\n * @param {function()} onResumeLocal A callback invoked when the local player\n * should resume playback. Called before cached remote state is wiped.\n * @param {function()} onInitStateRequired A callback to get local player's.\n * state. Invoked when casting is initiated from Chrome's cast button.\n * @implements {shaka.util.IDestroyable}\n */\nshaka.cast.CastSender =\n function(receiverAppId, onStatusChanged, onRemoteEvent, onResumeLocal,\n onInitStateRequired) {\n /** @private {string} */\n this.receiverAppId_ = receiverAppId;\n\n /** @private {?function()} */\n this.onStatusChanged_ = onStatusChanged;\n\n /** @private {?function(string, !shaka.util.FakeEvent)} */\n this.onRemoteEvent_ = onRemoteEvent;\n\n /** @private {?function()} */\n this.onResumeLocal_ = onResumeLocal;\n\n /** @private {?function()} */\n this.onInitStateRequired_ = onInitStateRequired;\n\n /** @private {boolean} */\n this.apiReady_ = false;\n\n /** @private {boolean} */\n this.hasReceivers_ = false;\n\n /** @private {boolean} */\n this.isCasting_ = false;\n\n /** @private {string} */\n this.receiverName_ = '';\n\n /** @private {Object} */\n this.appData_ = null;\n\n /** @private {chrome.cast.Session} */\n this.session_ = null;\n\n /** @private {Object} */\n this.cachedProperties_ = {\n 'video': {},\n 'player': {}\n };\n\n /** @private {number} */\n this.nextAsyncCallId_ = 0;\n\n /** @private {Object.<string, !shaka.util.PublicPromise>} */\n this.asyncCallPromises_ = {};\n\n /** @private {shaka.util.PublicPromise} */\n this.castPromise_ = null;\n};\n\n\n/** @override */\nshaka.cast.CastSender.prototype.destroy = function() {\n this.rejectAllPromises_();\n if (this.session_) {\n this.session_.leave(function() {}, function() {});\n this.session_ = null;\n }\n\n this.onStatusChanged_ = null;\n this.onRemoteEvent_ = null;\n this.onResumeLocal_ = null;\n this.apiReady_ = false;\n this.hasReceivers_ = false;\n this.isCasting_ = false;\n this.appData_ = null;\n this.cachedProperties_ = null;\n this.asyncCallPromises_ = null;\n this.castPromise_ = null;\n\n return Promise.resolve();\n};\n\n\n/**\n * @return {boolean} True if the cast API is available.\n */\nshaka.cast.CastSender.prototype.apiReady = function() {\n return this.apiReady_;\n};\n\n\n/**\n * @return {boolean} True if there are receivers.\n */\nshaka.cast.CastSender.prototype.hasReceivers = function() {\n return this.hasReceivers_;\n};\n\n\n/**\n * @return {boolean} True if we are currently casting.\n */\nshaka.cast.CastSender.prototype.isCasting = function() {\n return this.isCasting_;\n};\n\n\n/**\n * @return {string} The name of the Cast receiver device, if isCasting().\n */\nshaka.cast.CastSender.prototype.receiverName = function() {\n return this.receiverName_;\n};\n\n\n/**\n * @return {boolean} True if we have a cache of remote properties from the\n * receiver.\n */\nshaka.cast.CastSender.prototype.hasRemoteProperties = function() {\n return Object.keys(this.cachedProperties_['video']).length != 0;\n};\n\n\n/**\n * Initialize the Cast API.\n */\nshaka.cast.CastSender.prototype.init = function() {\n // Check for the cast extension.\n if (!window.chrome || !chrome.cast || !chrome.cast.isAvailable) {\n // Not available yet, so wait to be notified if/when it is available.\n window.__onGCastApiAvailable = (function(loaded) {\n if (loaded) {\n this.init();\n }\n }).bind(this);\n return;\n }\n\n // The API is now available.\n delete window.__onGCastApiAvailable;\n this.apiReady_ = true;\n this.onStatusChanged_();\n\n var sessionRequest = new chrome.cast.SessionRequest(this.receiverAppId_);\n var apiConfig = new chrome.cast.ApiConfig(sessionRequest,\n this.onExistingSessionJoined_.bind(this),\n this.onReceiverStatusChanged_.bind(this),\n 'origin_scoped');\n\n // TODO: have never seen this fail. when would it and how should we react?\n chrome.cast.initialize(apiConfig,\n function() { shaka.log.debug('CastSender: init'); },\n function(error) { shaka.log.error('CastSender: init error', error); });\n};\n\n\n/**\n * Set application-specific data.\n *\n * @param {Object} appData Application-specific data to relay to the receiver.\n */\nshaka.cast.CastSender.prototype.setAppData = function(appData) {\n this.appData_ = appData;\n if (this.isCasting_) {\n this.sendMessage_({\n 'type': 'appData',\n 'appData': this.appData_\n });\n }\n};\n\n\n/**\n * @param {shaka.cast.CastUtils.InitStateType} initState Video and player state\n * to be sent to the receiver.\n * @return {!Promise} Resolved when connected to a receiver. Rejected if the\n * connection fails or is canceled by the user.\n */\nshaka.cast.CastSender.prototype.cast = function(initState) {\n if (!this.apiReady_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.CAST,\n shaka.util.Error.Code.CAST_API_UNAVAILABLE));\n }\n if (!this.hasReceivers_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.CAST,\n shaka.util.Error.Code.NO_CAST_RECEIVERS));\n }\n if (this.isCasting_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.CAST,\n shaka.util.Error.Code.ALREADY_CASTING));\n }\n\n this.castPromise_ = new shaka.util.PublicPromise();\n chrome.cast.requestSession(\n this.onSessionInitiated_.bind(this, initState),\n this.onConnectionError_.bind(this));\n return this.castPromise_;\n};\n\n\n/**\n * Shows user a cast dialog where they can choose to stop\n * casting. Relies on Chrome to perform disconnect if they do.\n * Doesn't do anything if not connected.\n */\nshaka.cast.CastSender.prototype.showDisconnectDialog = function() {\n if (!this.isCasting_) {\n return;\n }\n var initState = this.onInitStateRequired_();\n\n chrome.cast.requestSession(\n this.onSessionInitiated_.bind(this, initState),\n this.onConnectionError_.bind(this));\n};\n\n\n/**\n * Forces the receiver app to shut down by disconnecting. Does nothing if not\n * connected.\n */\nshaka.cast.CastSender.prototype.forceDisconnect = function() {\n if (!this.isCasting_) {\n return;\n }\n\n this.rejectAllPromises_();\n if (this.session_) {\n this.session_.stop(function() {}, function() {});\n this.session_ = null;\n }\n};\n\n\n/**\n * Getter for properties of remote objects.\n * @param {string} targetName\n * @param {string} property\n * @return {?}\n */\nshaka.cast.CastSender.prototype.get = function(targetName, property) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n if (targetName == 'video') {\n if (shaka.cast.CastUtils.VideoVoidMethods.indexOf(property) >= 0) {\n return this.remoteCall_.bind(this, targetName, property);\n }\n } else if (targetName == 'player') {\n if (shaka.cast.CastUtils.PlayerVoidMethods.indexOf(property) >= 0) {\n return this.remoteCall_.bind(this, targetName, property);\n }\n if (shaka.cast.CastUtils.PlayerPromiseMethods.indexOf(property) >= 0) {\n return this.remoteAsyncCall_.bind(this, targetName, property);\n }\n if (shaka.cast.CastUtils.PlayerGetterMethods.indexOf(property) >= 0) {\n return this.propertyGetter_.bind(this, targetName, property);\n }\n }\n\n return this.propertyGetter_(targetName, property);\n};\n\n\n/**\n * Setter for properties of remote objects.\n * @param {string} targetName\n * @param {string} property\n * @param {?} value\n */\nshaka.cast.CastSender.prototype.set = function(targetName, property, value) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n\n this.cachedProperties_[targetName][property] = value;\n this.sendMessage_({\n 'type': 'set',\n 'targetName': targetName,\n 'property': property,\n 'value': value\n });\n};\n\n\n/**\n * @param {shaka.cast.CastUtils.InitStateType} initState\n * @param {chrome.cast.Session} session\n * @private\n */\nshaka.cast.CastSender.prototype.onSessionInitiated_ =\n function(initState, session) {\n shaka.log.debug('CastSender: onSessionInitiated');\n this.onSessionCreated_(session);\n\n this.sendMessage_({\n 'type': 'init',\n 'initState': initState,\n 'appData': this.appData_\n });\n\n this.castPromise_.resolve();\n};\n\n\n/**\n * @param {chrome.cast.Error} error\n * @private\n */\nshaka.cast.CastSender.prototype.onConnectionError_ = function(error) {\n // Default error code:\n var code = shaka.util.Error.Code.UNEXPECTED_CAST_ERROR;\n\n switch (error.code) {\n case 'cancel':\n code = shaka.util.Error.Code.CAST_CANCELED_BY_USER;\n break;\n case 'timeout':\n code = shaka.util.Error.Code.CAST_CONNECTION_TIMED_OUT;\n break;\n case 'receiver_unavailable':\n code = shaka.util.Error.Code.CAST_RECEIVER_APP_UNAVAILABLE;\n break;\n }\n\n this.castPromise_.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.CAST,\n code,\n error));\n};\n\n\n/**\n * @param {string} targetName\n * @param {string} property\n * @return {?}\n * @private\n */\nshaka.cast.CastSender.prototype.propertyGetter_ =\n function(targetName, property) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n return this.cachedProperties_[targetName][property];\n};\n\n\n/**\n * @param {string} targetName\n * @param {string} methodName\n * @private\n */\nshaka.cast.CastSender.prototype.remoteCall_ =\n function(targetName, methodName) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n var args = Array.prototype.slice.call(arguments, 2);\n this.sendMessage_({\n 'type': 'call',\n 'targetName': targetName,\n 'methodName': methodName,\n 'args': args\n });\n};\n\n\n/**\n * @param {string} targetName\n * @param {string} methodName\n * @return {!Promise}\n * @private\n */\nshaka.cast.CastSender.prototype.remoteAsyncCall_ =\n function(targetName, methodName) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n var args = Array.prototype.slice.call(arguments, 2);\n\n var p = new shaka.util.PublicPromise();\n var id = this.nextAsyncCallId_.toString();\n this.nextAsyncCallId_++;\n this.asyncCallPromises_[id] = p;\n\n this.sendMessage_({\n 'type': 'asyncCall',\n 'targetName': targetName,\n 'methodName': methodName,\n 'args': args,\n 'id': id\n });\n return p;\n};\n\n\n/**\n * @param {chrome.cast.Session} session\n * @private\n */\nshaka.cast.CastSender.prototype.onExistingSessionJoined_ = function(session) {\n shaka.log.debug('CastSender: onExistingSessionJoined');\n\n var initState = this.onInitStateRequired_();\n\n this.castPromise_ = new shaka.util.PublicPromise();\n\n this.onSessionInitiated_(initState, session);\n};\n\n\n/**\n * @param {string} availability\n * @private\n */\nshaka.cast.CastSender.prototype.onReceiverStatusChanged_ =\n function(availability) {\n // The cast extension is telling us whether there are any cast receiver\n // devices available.\n shaka.log.debug('CastSender: receiver status', availability);\n this.hasReceivers_ = availability == 'available';\n this.onStatusChanged_();\n};\n\n\n/**\n * @param {chrome.cast.Session} session\n * @private\n */\nshaka.cast.CastSender.prototype.onSessionCreated_ = function(session) {\n this.session_ = session;\n this.session_.addUpdateListener(this.onConnectionStatusChanged_.bind(this));\n this.session_.addMessageListener(\n shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE,\n this.onMessageReceived_.bind(this));\n this.onConnectionStatusChanged_();\n};\n\n\n/**\n * @private\n */\nshaka.cast.CastSender.prototype.onConnectionStatusChanged_ = function() {\n var connected = this.session_ ? this.session_.status == 'connected' : false;\n shaka.log.debug('CastSender: connection status', connected);\n if (this.isCasting_ && !connected) {\n // Tell CastProxy to transfer state back to local player.\n this.onResumeLocal_();\n\n // Clear whatever we have cached.\n for (var targetName in this.cachedProperties_) {\n this.cachedProperties_[targetName] = {};\n }\n\n this.rejectAllPromises_();\n }\n\n this.isCasting_ = connected;\n this.receiverName_ = connected ? this.session_.receiver.friendlyName : '';\n this.onStatusChanged_();\n};\n\n\n/**\n * Reject any async call promises that are still pending.\n * @private\n */\nshaka.cast.CastSender.prototype.rejectAllPromises_ = function() {\n for (var id in this.asyncCallPromises_) {\n var p = this.asyncCallPromises_[id];\n delete this.asyncCallPromises_[id];\n\n // Reject pending async operations as if they were interrupted.\n // At the moment, load() is the only async operation we are worried\n // about.\n p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.PLAYER,\n shaka.util.Error.Code.LOAD_INTERRUPTED));\n }\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages are\n * read with quoted properties.\n * @param {string} namespace\n * @param {string} serialized\n * @private\n */\nshaka.cast.CastSender.prototype.onMessageReceived_ =\n function(namespace, serialized) {\n var message = shaka.cast.CastUtils.deserialize(serialized);\n shaka.log.v2('CastSender: message', message);\n\n switch (message['type']) {\n case 'event':\n var targetName = message['targetName'];\n var event = message['event'];\n var fakeEvent = new shaka.util.FakeEvent(event['type'], event);\n this.onRemoteEvent_(targetName, fakeEvent);\n break;\n case 'update':\n var update = message['update'];\n for (var targetName in update) {\n var target = this.cachedProperties_[targetName] || {};\n for (var property in update[targetName]) {\n target[property] = update[targetName][property];\n }\n }\n break;\n case 'asyncComplete':\n var id = message['id'];\n var error = message['error'];\n var p = this.asyncCallPromises_[id];\n delete this.asyncCallPromises_[id];\n\n goog.asserts.assert(p, 'Unexpected async id');\n if (!p) break;\n\n if (error) {\n // This is a hacky way to reconstruct the serialized error.\n var reconstructedError = new shaka.util.Error(\n error.severity, error.category, error.code);\n for (var k in error) {\n (/** @type {Object} */(reconstructedError))[k] = error[k];\n }\n p.reject(reconstructedError);\n } else {\n p.resolve();\n }\n break;\n }\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages passed\n * in here were created with quoted property names.\n * @param {!Object} message\n * @private\n */\nshaka.cast.CastSender.prototype.sendMessage_ = function(message) {\n var serialized = shaka.cast.CastUtils.serialize(message);\n // TODO: have never seen this fail. When would it and how should we react?\n this.session_.sendMessage(shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE,\n serialized,\n function() {}, // success callback\n shaka.log.error); // error callback\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_sender.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.FakeEventTarget');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.MultiMap');\n\n\n\n/**\n * A work-alike for EventTarget. Only DOM elements may be true EventTargets,\n * but this can be used as a base class to provide event dispatch to non-DOM\n * classes. Only FakeEvents should be dispatched.\n *\n * @struct\n * @constructor\n * @implements {EventTarget}\n * @exportInterface\n */\nshaka.util.FakeEventTarget = function() {\n /**\n * @private {!shaka.util.MultiMap.<shaka.util.FakeEventTarget.ListenerType>}\n */\n this.listeners_ = new shaka.util.MultiMap();\n\n /**\n * The target of all dispatched events. Defaults to |this|.\n * @type {EventTarget}\n */\n this.dispatchTarget = this;\n};\n\n\n/**\n * These are the listener types defined in the closure extern for EventTarget.\n * @typedef {EventListener|function(!Event):(boolean|undefined)}\n * @exportInterface\n */\nshaka.util.FakeEventTarget.ListenerType;\n\n\n/**\n * Add an event listener to this object.\n *\n * @param {string} type The event type to listen for.\n * @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or\n * listener object to invoke.\n * @param {(EventListenerOptions|boolean)=} opt_options Ignored.\n * @override\n * @exportInterface\n */\nshaka.util.FakeEventTarget.prototype.addEventListener =\n function(type, listener, opt_options) {\n this.listeners_.push(type, listener);\n};\n\n\n/**\n * Remove an event listener from this object.\n *\n * @param {string} type The event type for which you wish to remove a listener.\n * @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or\n * listener object to remove.\n * @param {(EventListenerOptions|boolean)=} opt_options Ignored.\n * @override\n * @exportInterface\n */\nshaka.util.FakeEventTarget.prototype.removeEventListener =\n function(type, listener, opt_options) {\n this.listeners_.remove(type, listener);\n};\n\n\n/**\n * Dispatch an event from this object.\n *\n * @param {!Event} event The event to be dispatched from this object.\n * @return {boolean} True if the default action was prevented.\n * @override\n * @exportInterface\n */\nshaka.util.FakeEventTarget.prototype.dispatchEvent = function(event) {\n // In many browsers, it is complex to overwrite properties of actual Events.\n // Here we expect only to dispatch FakeEvents, which are simpler.\n goog.asserts.assert(event instanceof shaka.util.FakeEvent,\n 'FakeEventTarget can only dispatch FakeEvents!');\n\n var list = this.listeners_.get(event.type) || [];\n\n for (var i = 0; i < list.length; ++i) {\n // Do this every time, since events can be re-dispatched from handlers.\n event.target = this.dispatchTarget;\n event.currentTarget = this.dispatchTarget;\n\n var listener = list[i];\n try {\n if (listener.handleEvent) {\n listener.handleEvent(event);\n } else {\n listener.call(this, event);\n }\n } catch (exception) {\n // Exceptions during event handlers should not affect the caller,\n // but should appear on the console as uncaught, according to MDN:\n // http://goo.gl/N6Ff27\n shaka.log.error('Uncaught exception in event handler', exception);\n }\n\n if (event.stopped) {\n break;\n }\n }\n\n return event.defaultPrevented;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/fake_event_target.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.Player');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.abr.EwmaBandwidthEstimator');\ngoog.require('shaka.abr.SimpleAbrManager');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.MediaSourceEngine');\ngoog.require('shaka.media.Playhead');\ngoog.require('shaka.media.PlayheadObserver');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.media.StreamingEngine');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.CancelableChain');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * Construct a Player.\n *\n * @param {!HTMLMediaElement} video Any existing TextTracks attached to this\n * element that were not created by Shaka will be disabled. A new TextTrack\n * may be created to display captions or subtitles.\n * @param {function(shaka.Player)=} opt_dependencyInjector Optional callback\n * which is called to inject mocks into the Player. Used for testing.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n * @extends {shaka.util.FakeEventTarget}\n * @export\n */\nshaka.Player = function(video, opt_dependencyInjector) {\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {boolean} */\n this.destroyed_ = false;\n\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {TextTrack} */\n this.textTrack_ = null;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {shakaExtern.AbrManager} */\n this.defaultAbrManager_ = new shaka.abr.SimpleAbrManager();\n\n /** @private {shaka.net.NetworkingEngine} */\n this.networkingEngine_ = null;\n\n /** @private {shaka.media.DrmEngine} */\n this.drmEngine_ = null;\n\n /** @private {MediaSource} */\n this.mediaSource_ = null;\n\n /** @private {shaka.media.MediaSourceEngine} */\n this.mediaSourceEngine_ = null;\n\n /** @private {Promise} */\n this.mediaSourceOpen_ = null;\n\n /** @private {shaka.media.Playhead} */\n this.playhead_ = null;\n\n /** @private {shaka.media.PlayheadObserver} */\n this.playheadObserver_ = null;\n\n /** @private {shaka.media.StreamingEngine} */\n this.streamingEngine_ = null;\n\n /** @private {shakaExtern.ManifestParser} */\n this.parser_ = null;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = null;\n\n /** @private {?string} */\n this.manifestUri_ = null;\n\n /**\n * Contains an ID for use with creating streams. The manifest parser should\n * start with small IDs, so this starts with a large one.\n * @private {number}\n */\n this.nextExternalStreamId_ = 1e9;\n\n /** @private {!Array.<number>} */\n this.loadingTextStreamIds_ = [];\n\n /** @private {boolean} */\n this.buffering_ = false;\n\n /** @private {boolean} */\n this.switchingPeriods_ = true;\n\n /** @private {shaka.util.CancelableChain} */\n this.loadChain_ = null;\n\n /** @private {Promise} */\n this.unloadChain_ = null;\n\n /**\n * @private {!Object.<shaka.util.ManifestParserUtils.ContentType, {\n * stream: shakaExtern.Stream,\n * clearBuffer: boolean\n * }>}\n */\n this.deferredSwitches_ = {};\n\n /** @private {!Array.<shakaExtern.TimelineRegionInfo>} */\n this.pendingTimelineRegions_ = [];\n\n /**\n * A map of Period number to a map of content type to stream id.\n * @private {!Object.<number, !Object.<string, number>>}\n */\n this.activeStreamsByPeriod_ = {};\n\n /** @private {?shakaExtern.PlayerConfiguration} */\n this.config_ = this.defaultConfig_();\n\n /** @private {{width: number, height: number}} */\n this.maxHwRes_ = { width: Infinity, height: Infinity };\n\n /** @private {shakaExtern.Stats} */\n this.stats_ = this.getCleanStats_();\n\n /** @private {number} */\n this.lastTimeStatsUpdateTimestamp_ = 0;\n\n /** @private {string} */\n this.currentAudioLanguage_ = this.config_.preferredAudioLanguage;\n\n /** @private {string} */\n this.currentTextLanguage_ = this.config_.preferredTextLanguage;\n\n /** @private {string} */\n this.currentVariantRole_ = '';\n\n /** @private {string} */\n this.currentTextRole_ = '';\n\n if (opt_dependencyInjector)\n opt_dependencyInjector(this);\n\n this.networkingEngine_ = this.createNetworkingEngine();\n this.initialize_();\n};\ngoog.inherits(shaka.Player, shaka.util.FakeEventTarget);\n\n\n/**\n * After destruction, a Player object cannot be used again.\n *\n * @override\n * @export\n */\nshaka.Player.prototype.destroy = function() {\n this.destroyed_ = true;\n\n var cancelation = Promise.resolve();\n if (this.loadChain_) {\n // A load is in progress. Cancel it.\n cancelation = this.loadChain_.cancel(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.PLAYER,\n shaka.util.Error.Code.LOAD_INTERRUPTED));\n }\n\n return cancelation.then(function() {\n var p = Promise.all([\n // We need to destroy the current fields as well as waiting for an\n // existing unload to complete. It is fine to call destroyStreaming_ if\n // there is an unload since it resets the fields immediately.\n this.unloadChain_,\n this.destroyStreaming_(),\n this.eventManager_ ? this.eventManager_.destroy() : null,\n this.networkingEngine_ ? this.networkingEngine_.destroy() : null\n ]);\n\n this.video_ = null;\n this.textTrack_ = null;\n this.eventManager_ = null;\n this.defaultAbrManager_ = null;\n this.networkingEngine_ = null;\n this.config_ = null;\n\n return p;\n }.bind(this));\n};\n\n\n/**\n * @define {string} A version number taken from git at compile time.\n */\ngoog.define('GIT_VERSION', 'v2.1.4-debug');\n\n\n/**\n * @const {string}\n * @export\n */\nshaka.Player.version = GIT_VERSION;\n\n\n/**\n * @event shaka.Player.ErrorEvent\n * @description Fired when a playback error occurs.\n * @property {string} type\n * 'error'\n * @property {!shaka.util.Error} detail\n * An object which contains details on the error. The error's 'category' and\n * 'code' properties will identify the specific error that occured. In an\n * uncompiled build, you can also use the 'message' and 'stack' properties\n * to debug.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.EmsgEvent\n * @description Fired when a non-typical emsg is found in a segment.\n * @property {string} type\n * 'emsg'\n * @property {shakaExtern.EmsgInfo} detail\n * An object which contains the content of the emsg box.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TimelineRegionAdded\n * @description Fired when a media timeline region is added.\n * @property {string} type\n * 'timelineregionadded'\n * @property {shakaExtern.TimelineRegionInfo} detail\n * An object which contains a description of the region.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TimelineRegionEnter\n * @description Fired when the playhead enters a timeline region.\n * @property {string} type\n * 'timelineregionenter'\n * @property {shakaExtern.TimelineRegionInfo} detail\n * An object which contains a description of the region.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TimelineRegionExit\n * @description Fired when the playhead exits a timeline region.\n * @property {string} type\n * 'timelineregionexit'\n * @property {shakaExtern.TimelineregionInfo} detail\n * An object which contains a description of the region.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.BufferingEvent\n * @description Fired when the player's buffering state changes.\n * @property {string} type\n * 'buffering'\n * @property {boolean} buffering\n * True when the Player enters the buffering state.\n * False when the Player leaves the buffering state.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.LoadingEvent\n * @description Fired when the player begins loading.\n * Used by the Cast receiver to determine idle state.\n * @property {string} type\n * 'loading'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.UnloadingEvent\n * @description Fired when the player unloads or fails to load.\n * Used by the Cast receiver to determine idle state.\n * @property {string} type\n * 'unloading'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TextTrackVisibilityEvent\n * @description Fired when text track visibility changes.\n * @property {string} type\n * 'texttrackvisibility'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TracksChangedEvent\n * @description Fired when the list of tracks changes. For example, this will\n * happen when changing periods or when track restrictions change.\n * @property {string} type\n * 'trackschanged'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.AdaptationEvent\n * @description Fired when an automatic adaptation causes the active tracks\n * to change. Does not fire when the application calls selectVariantTrack()\n * selectTextTrack(), selectAudioLanguage() or selectTextLanguage().\n * @property {string} type\n * 'adaptation'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.ExpirationUpdatedEvent\n * @description Fired when there is a change in the expiration times of an\n * EME session.\n * @property {string} type\n * 'expirationupdated'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.LargeGapEvent\n * @description Fired when the playhead enters a large gap. If\n * |config.streaming.jumpLargeGaps| is set, the default action of this event\n * is to jump the gap; this can be prevented by calling preventDefault() on\n * the event object.\n * @property {string} type\n * 'largegap'\n * @property {number} currentTime\n * The current time of the playhead.\n * @property {number} gapSize\n * The size of the gap, in seconds.\n * @exportDoc\n */\n\n\n/** @private {!Object.<string, function():*>} */\nshaka.Player.supportPlugins_ = {};\n\n\n/**\n * Registers a plugin callback that will be called with support(). The\n * callback will return the value that will be stored in the return value from\n * support().\n *\n * @param {string} name\n * @param {function():*} callback\n * @export\n */\nshaka.Player.registerSupportPlugin = function(name, callback) {\n shaka.Player.supportPlugins_[name] = callback;\n};\n\n\n/**\n * Return whether the browser provides basic support. If this returns false,\n * Shaka Player cannot be used at all. In this case, do not construct a Player\n * instance and do not use the library.\n *\n * @return {boolean}\n * @export\n */\nshaka.Player.isBrowserSupported = function() {\n // Basic features needed for the library to be usable.\n var basic = !!window.Promise && !!window.Uint8Array &&\n !!Array.prototype.forEach;\n\n return basic &&\n shaka.media.MediaSourceEngine.isBrowserSupported() &&\n shaka.media.DrmEngine.isBrowserSupported();\n};\n\n\n/**\n * Probes the browser to determine what features are supported. This makes a\n * number of requests to EME/MSE/etc which may result in user prompts. This\n * should only be used for diagnostics.\n *\n * NOTE: This may show a request to the user for permission.\n *\n * @see https://goo.gl/ovYLvl\n * @return {!Promise.<shakaExtern.SupportType>}\n * @export\n */\nshaka.Player.probeSupport = function() {\n goog.asserts.assert(shaka.Player.isBrowserSupported(),\n 'Must have basic support');\n return shaka.media.DrmEngine.probeSupport().then(function(drm) {\n var manifest = shaka.media.ManifestParser.probeSupport();\n var media = shaka.media.MediaSourceEngine.probeSupport();\n var ret = {\n manifest: manifest,\n media: media,\n drm: drm\n };\n\n var plugins = shaka.Player.supportPlugins_;\n for (var name in plugins) {\n ret[name] = plugins[name]();\n }\n\n return ret;\n });\n};\n\n\n/**\n * Load a manifest.\n *\n * @param {string} manifestUri\n * @param {number=} opt_startTime Optional start time, in seconds, to begin\n * playback. Defaults to 0 for VOD and to the live edge for live.\n * @param {shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * Optional manifest parser factory to override auto-detection or use an\n * unregistered parser.\n * @return {!Promise} Resolved when the manifest has been loaded and playback\n * has begun; rejected when an error occurs or the call was interrupted by\n * destroy(), unload() or another call to load().\n * @export\n */\nshaka.Player.prototype.load = function(manifestUri, opt_startTime,\n opt_manifestParserFactory) {\n var unloadPromise = this.unload();\n var loadChain = new shaka.util.CancelableChain();\n this.loadChain_ = loadChain;\n this.dispatchEvent(new shaka.util.FakeEvent('loading'));\n\n var startTime = Date.now();\n\n return loadChain.then(function() {\n return unloadPromise;\n }).then(function() {\n // Not tracked in stats because it should be insignificant.\n // Logged in case it is not.\n shaka.log.debug('Unload latency:', (Date.now() - startTime) / 1000);\n\n this.stats_ = this.getCleanStats_();\n\n this.eventManager_.listen(this.video_, 'playing',\n this.updateState_.bind(this));\n this.eventManager_.listen(this.video_, 'pause',\n this.updateState_.bind(this));\n this.eventManager_.listen(this.video_, 'ended',\n this.updateState_.bind(this));\n\n goog.asserts.assert(this.networkingEngine_, 'Must not be destroyed');\n return shaka.media.ManifestParser.getFactory(\n manifestUri,\n this.networkingEngine_,\n this.config_.manifest.retryParameters,\n opt_manifestParserFactory);\n }.bind(this)).then(function(factory) {\n\n this.parser_ = new factory();\n this.parser_.configure(this.config_.manifest);\n goog.asserts.assert(this.networkingEngine_, 'Must not be destroyed');\n var playerInterface = {\n networkingEngine: this.networkingEngine_,\n filterPeriod: this.filterPeriod_.bind(this),\n onTimelineRegionAdded: this.onTimelineRegionAdded_.bind(this),\n onEvent: this.onEvent_.bind(this),\n onError: this.onError_.bind(this)\n };\n\n if (this.parser_.start.length > 2) {\n goog.asserts.assert(false, 'Old ManifestParser interface is deprecated');\n shaka.log.warning(\n 'The ManifestParser interface has changed. Please upgrade your ' +\n 'plugin to accept the PlayerInterface structure. See the ' +\n 'ManifestParser documentation for details.');\n // Use a string index here so the compiler doesn't complain about the\n // incorrect arguments.\n return this.parser_['start'](\n manifestUri, this.networkingEngine_, playerInterface.filterPeriod,\n playerInterface.onError, playerInterface.onEvent);\n }\n\n return this.parser_.start(manifestUri, playerInterface);\n }.bind(this)).then(function(manifest) {\n\n if (manifest.periods.length == 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.NO_PERIODS);\n }\n\n this.manifest_ = manifest;\n this.manifestUri_ = manifestUri;\n this.drmEngine_ = this.createDrmEngine();\n this.drmEngine_.configure(this.config_.drm);\n return this.drmEngine_.init(manifest, false /* isOffline */);\n }.bind(this)).then(function() {\n\n // Re-filter the manifest after DRM has been initialized.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n\n this.lastTimeStatsUpdateTimestamp_ = Date.now() / 1000;\n\n // Copy preferred languages from the config again, in case the config was\n // changed between construction and playback.\n this.currentAudioLanguage_ = this.config_.preferredAudioLanguage;\n this.currentTextLanguage_ = this.config_.preferredTextLanguage;\n\n // Wait for MediaSource to open before continuing.\n return Promise.all([\n this.drmEngine_.attach(this.video_),\n this.mediaSourceOpen_\n ]);\n }.bind(this)).then(function() {\n this.config_.abr.manager.init(this.switch_.bind(this));\n\n // MediaSource is open, so create the Playhead, MediaSourceEngine, and\n // StreamingEngine.\n this.playhead_ = this.createPlayhead(opt_startTime);\n this.playheadObserver_ = this.createPlayheadObserver();\n this.mediaSourceEngine_ = this.createMediaSourceEngine();\n\n this.streamingEngine_ = this.createStreamingEngine();\n this.streamingEngine_.configure(this.config_.streaming);\n\n // If the content is multi-codec and the browser can play more than one of\n // them, choose codecs now before we initialize streaming.\n this.chooseCodecsAndFilterManifest_();\n\n return this.streamingEngine_.init();\n }.bind(this)).then(function() {\n if (this.config_.streaming.startAtSegmentBoundary) {\n var time = this.adjustStartTime_(this.playhead_.getTime());\n this.playhead_.setStartTime(time);\n }\n\n // Re-filter the manifest after streams have been chosen.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n // Dispatch a 'trackschanged' event now that all initial filtering is done.\n this.onTracksChanged_();\n // Since the first streams just became active, send an adaptation event.\n this.onAdaptation_();\n\n // Now that we've filtered out variants that aren't compatible with the\n // active one, update abr manager with filtered variants for the current\n // period.\n var currentPeriod = this.streamingEngine_.getCurrentPeriod();\n var variants = shaka.util.StreamUtils.filterVariantsByRoleAndLanguage(\n currentPeriod, this.currentAudioLanguage_);\n this.config_.abr.manager.setVariants(variants);\n\n var hasPrimary = currentPeriod.variants.some(function(variant) {\n return variant.primary;\n });\n if (!this.currentAudioLanguage_ && !hasPrimary) {\n shaka.log.warning('No preferred audio language set. We will choose an ' +\n 'arbitrary language initially');\n }\n\n this.pendingTimelineRegions_.forEach(\n this.playheadObserver_.addTimelineRegion.bind(this.playheadObserver_));\n this.pendingTimelineRegions_ = [];\n\n // Wait for the 'loadeddata' event to measure load() latency.\n this.eventManager_.listenOnce(this.video_, 'loadeddata', function() {\n // Compute latency in seconds (Date.now() gives ms):\n var latency = (Date.now() - startTime) / 1000;\n this.stats_.loadLatency = latency;\n shaka.log.debug('Load latency:', latency);\n }.bind(this));\n\n this.loadChain_ = null;\n }.bind(this)).finalize().catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong error type!');\n shaka.log.debug('load() failed:', error);\n\n // If we haven't started another load, clear the loadChain_ member.\n if (this.loadChain_ == loadChain) {\n this.loadChain_ = null;\n this.dispatchEvent(new shaka.util.FakeEvent('unloading'));\n }\n return Promise.reject(error);\n }.bind(this));\n};\n\n\n/**\n * In case of multiple usable codecs, choose one based on lowest average\n * bandwidth and filter out the rest.\n * @private\n */\nshaka.Player.prototype.chooseCodecsAndFilterManifest_ = function() {\n function variantCodecs(variant) {\n // Only consider the base of the codec string. For example, these should\n // both be considered the same codec: avc1.42c01e, avc1.4d401f\n var baseVideoCodec =\n variant.video ? variant.video.codecs.split('.')[0] : '';\n var baseAudioCodec =\n variant.audio ? variant.audio.codecs.split('.')[0] : '';\n return baseVideoCodec + '-' + baseAudioCodec;\n }\n\n // Organize variants into buckets by codecs.\n var variantsByCodecs = {};\n this.manifest_.periods.forEach(function(period) {\n period.variants.forEach(function(variant) {\n var codecs = variantCodecs(variant);\n if (!(codecs in variantsByCodecs)) {\n variantsByCodecs[codecs] = [];\n }\n variantsByCodecs[codecs].push(variant);\n });\n });\n\n // Compute the average bandwidth for each group of variants.\n // Choose the lowest-bandwidth codecs.\n var bestCodecs = null;\n var lowestAverageBandwidth = Infinity;\n shaka.util.MapUtils.forEach(variantsByCodecs, function(codecs, variants) {\n var sum = 0;\n var num = 0;\n variants.forEach(function(variant) {\n sum += variant.bandwidth;\n ++num;\n });\n var averageBandwidth = sum / num;\n shaka.log.debug('codecs', codecs, 'avg bandwidth', averageBandwidth);\n\n if (averageBandwidth < lowestAverageBandwidth) {\n bestCodecs = codecs;\n lowestAverageBandwidth = averageBandwidth;\n }\n });\n goog.asserts.assert(bestCodecs != null, 'Should have chosen codecs!');\n goog.asserts.assert(!isNaN(lowestAverageBandwidth),\n 'Bandwidth should be a number!');\n\n // Filter out any variants that don't match, forcing AbrManager to choose from\n // the most efficient variants possible.\n this.manifest_.periods.forEach(function(period) {\n period.variants = period.variants.filter(function(variant) {\n var codecs = variantCodecs(variant);\n if (codecs == bestCodecs) return true;\n\n shaka.log.debug('Dropping Variant (better codec available)', variant);\n return false;\n });\n });\n};\n\n\n/**\n * Creates a new instance of DrmEngine. This can be replaced by tests to\n * create fake instances instead.\n *\n * @return {!shaka.media.DrmEngine}\n */\nshaka.Player.prototype.createDrmEngine = function() {\n goog.asserts.assert(this.networkingEngine_, 'Must not be destroyed');\n return new shaka.media.DrmEngine(\n this.networkingEngine_,\n this.onError_.bind(this),\n this.onKeyStatus_.bind(this),\n this.onExpirationUpdated_.bind(this));\n};\n\n\n/**\n * Creates a new instance of NetworkingEngine. This can be replaced by tests\n * to create fake instances instead.\n *\n * @return {!shaka.net.NetworkingEngine}\n */\nshaka.Player.prototype.createNetworkingEngine = function() {\n return new shaka.net.NetworkingEngine(this.onSegmentDownloaded_.bind(this));\n};\n\n\n/**\n * Creates a new instance of Playhead. This can be replaced by tests to create\n * fake instances instead.\n *\n * @param {number=} opt_startTime\n * @return {!shaka.media.Playhead}\n */\nshaka.Player.prototype.createPlayhead = function(opt_startTime) {\n goog.asserts.assert(this.manifest_, 'Must have manifest');\n return new shaka.media.Playhead(\n this.video_, this.manifest_, this.config_.streaming,\n opt_startTime || null, this.onSeek_.bind(this), this.onEvent_.bind(this));\n};\n\n\n/**\n * Creates a new instance of PlayheadOvserver. This can be replaced by tests to\n * create fake instances instead.\n *\n * @return {!shaka.media.PlayheadObserver}\n */\nshaka.Player.prototype.createPlayheadObserver = function() {\n goog.asserts.assert(this.manifest_, 'Must have manifest');\n return new shaka.media.PlayheadObserver(\n this.video_, this.manifest_, this.config_.streaming,\n this.onBuffering_.bind(this), this.onEvent_.bind(this),\n this.onChangePeriod_.bind(this));\n};\n\n\n/**\n * Create and open MediaSource. Potentially slow.\n *\n * @return {!Promise}\n */\nshaka.Player.prototype.createMediaSource = function() {\n this.mediaSource_ = new MediaSource();\n var ret = new shaka.util.PublicPromise();\n this.eventManager_.listen(this.mediaSource_, 'sourceopen', ret.resolve);\n this.video_.src = window.URL.createObjectURL(this.mediaSource_);\n return ret;\n};\n\n\n/**\n * Creates a new instance of MediaSourceEngine. This can be replaced by tests\n * to create fake instances instead.\n *\n * @return {!shaka.media.MediaSourceEngine}\n */\nshaka.Player.prototype.createMediaSourceEngine = function() {\n return new shaka.media.MediaSourceEngine(\n this.video_, this.mediaSource_, this.textTrack_);\n};\n\n\n/**\n * Creates a new instance of StreamingEngine. This can be replaced by tests\n * to create fake instances instead.\n *\n * @return {!shaka.media.StreamingEngine}\n */\nshaka.Player.prototype.createStreamingEngine = function() {\n goog.asserts.assert(\n this.playhead_ && this.playheadObserver_ && this.mediaSourceEngine_ &&\n this.manifest_,\n 'Must not be destroyed');\n\n var playerInterface = {\n playhead: this.playhead_,\n mediaSourceEngine: this.mediaSourceEngine_,\n netEngine: this.networkingEngine_,\n onChooseStreams: this.onChooseStreams_.bind(this),\n onCanSwitch: this.canSwitch_.bind(this),\n onError: this.onError_.bind(this),\n onEvent: this.onEvent_.bind(this),\n onManifestUpdate: this.onManifestUpdate_.bind(this),\n onSegmentAppended: this.onSegmentAppended_.bind(this)\n };\n return new shaka.media.StreamingEngine(this.manifest_, playerInterface);\n};\n\n\n/**\n * Configure the Player instance.\n *\n * The config object passed in need not be complete. It will be merged with\n * the existing Player configuration.\n *\n * Config keys and types will be checked. If any problems with the config\n * object are found, errors will be reported through logs.\n *\n * @param {!Object} config This should follow the form of\n * {@link shakaExtern.PlayerConfiguration}, but you may omit any field you do\n * not wish to change.\n * @export\n */\nshaka.Player.prototype.configure = function(config) {\n goog.asserts.assert(this.config_, 'Config must not be null!');\n\n if (config.abr && config.abr.manager &&\n config.abr.manager != this.config_.abr.manager) {\n this.config_.abr.manager.stop();\n config.abr.manager.init(this.switch_.bind(this));\n }\n\n shaka.util.ConfigUtils.mergeConfigObjects(\n this.config_, config, this.defaultConfig_(), this.configOverrides_(), '');\n\n this.applyConfig_();\n};\n\n\n/**\n * Apply config changes.\n * @private\n */\nshaka.Player.prototype.applyConfig_ = function() {\n if (this.parser_) {\n this.parser_.configure(this.config_.manifest);\n }\n if (this.drmEngine_) {\n this.drmEngine_.configure(this.config_.drm);\n }\n if (this.streamingEngine_) {\n this.streamingEngine_.configure(this.config_.streaming);\n\n // Need to apply the restrictions to every period.\n try {\n // this.filterPeriod_() may throw.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n } catch (error) {\n this.onError_(error);\n }\n\n // May need to choose new streams.\n shaka.log.debug('Choosing new streams after changing configuration');\n var period = this.streamingEngine_.getCurrentPeriod();\n this.chooseStreamsAndSwitch_(period);\n }\n\n // Simply enable/disable ABR with each call, since multiple calls to these\n // methods have no effect.\n if (this.config_.abr.enabled && !this.switchingPeriods_) {\n this.config_.abr.manager.enable();\n } else {\n this.config_.abr.manager.disable();\n }\n\n this.config_.abr.manager.setDefaultEstimate(\n this.config_.abr.defaultBandwidthEstimate);\n this.config_.abr.manager.setRestrictions(this.config_.abr.restrictions);\n};\n\n\n/**\n * Return a copy of the current configuration. Modifications of the returned\n * value will not affect the Player's active configuration. You must call\n * player.configure() to make changes.\n *\n * @return {shakaExtern.PlayerConfiguration}\n * @export\n */\nshaka.Player.prototype.getConfiguration = function() {\n goog.asserts.assert(this.config_, 'Config must not be null!');\n\n var ret = this.defaultConfig_();\n shaka.util.ConfigUtils.mergeConfigObjects(\n ret, this.config_, this.defaultConfig_(), this.configOverrides_(), '');\n return ret;\n};\n\n\n/**\n * Reset configuration to default.\n * @export\n */\nshaka.Player.prototype.resetConfiguration = function() {\n var config = this.defaultConfig_();\n\n if (config.abr && config.abr.manager &&\n config.abr.manager != this.config_.abr.manager) {\n this.config_.abr.manager.stop();\n config.abr.manager.init(this.switch_.bind(this));\n }\n\n // Don't call mergeConfigObjects_(), since that would not reset open-ended\n // dictionaries like drm.servers.\n this.config_ = this.defaultConfig_();\n\n this.applyConfig_();\n};\n\n\n/**\n * @return {HTMLMediaElement} A reference to the HTML Media Element passed\n * in during initialization.\n * @export\n */\nshaka.Player.prototype.getMediaElement = function() {\n return this.video_;\n};\n\n\n/**\n * @return {shaka.net.NetworkingEngine} A reference to the Player's networking\n * engine. Applications may use this to make requests through Shaka's\n * networking plugins.\n * @export\n */\nshaka.Player.prototype.getNetworkingEngine = function() {\n return this.networkingEngine_;\n};\n\n\n/**\n * @return {?string} If a manifest is loaded, returns the manifest URI given in\n * the last call to load(). Otherwise, returns null.\n * @export\n */\nshaka.Player.prototype.getManifestUri = function() {\n return this.manifestUri_;\n};\n\n\n/**\n * @return {boolean} True if the current stream is live. False otherwise.\n * @export\n */\nshaka.Player.prototype.isLive = function() {\n return this.manifest_ ?\n this.manifest_.presentationTimeline.isLive() :\n false;\n};\n\n\n/**\n * @return {boolean} True if the current stream is in-progress VOD.\n * False otherwise.\n * @export\n */\nshaka.Player.prototype.isInProgress = function() {\n return this.manifest_ ?\n this.manifest_.presentationTimeline.isInProgress() :\n false;\n};\n\n\n/**\n * Get the seekable range for the current stream.\n * @return {{start: number, end: number}}\n * @export\n */\nshaka.Player.prototype.seekRange = function() {\n var start = 0;\n var end = 0;\n if (this.manifest_) {\n var timeline = this.manifest_.presentationTimeline;\n start = timeline.getSegmentAvailabilityStart();\n end = timeline.getSeekRangeEnd();\n }\n return {'start': start, 'end': end};\n};\n\n\n/**\n * Get the key system currently being used by EME. This returns the empty\n * string if not using EME.\n *\n * @return {string}\n * @export\n */\nshaka.Player.prototype.keySystem = function() {\n return this.drmEngine_ ? this.drmEngine_.keySystem() : '';\n};\n\n\n/**\n * Get the DrmInfo used to initialize EME. This returns null when not using\n * EME.\n *\n * @return {?shakaExtern.DrmInfo}\n * @export\n */\nshaka.Player.prototype.drmInfo = function() {\n return this.drmEngine_ ? this.drmEngine_.getDrmInfo() : null;\n};\n\n\n/**\n * The next known expiration time for any EME session. If the sessions never\n * expire, or there are no EME sessions, this returns Infinity.\n *\n * @return {number}\n * @export\n */\nshaka.Player.prototype.getExpiration = function() {\n return this.drmEngine_ ? this.drmEngine_.getExpiration() : Infinity;\n};\n\n\n/**\n * @return {boolean} True if the Player is in a buffering state.\n * @export\n */\nshaka.Player.prototype.isBuffering = function() {\n return this.buffering_;\n};\n\n\n/**\n * Unload the current manifest and make the Player available for re-use.\n *\n * @return {!Promise} Resolved when streaming has stopped and the previous\n * content, if any, has been unloaded.\n * @export\n */\nshaka.Player.prototype.unload = function() {\n if (this.destroyed_) return Promise.resolve();\n this.dispatchEvent(new shaka.util.FakeEvent('unloading'));\n\n var p = Promise.resolve();\n if (this.loadChain_) {\n // A load is in progress, cancel it.\n var interrupt = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.PLAYER,\n shaka.util.Error.Code.LOAD_INTERRUPTED);\n p = this.loadChain_.cancel(interrupt);\n }\n\n return p.then(function() {\n // If there is an existing unload operation, use that.\n if (!this.unloadChain_) {\n this.unloadChain_ = this.resetStreaming_().then(function() {\n this.unloadChain_ = null;\n }.bind(this));\n }\n return this.unloadChain_;\n }.bind(this));\n};\n\n\n/**\n * Gets the current effective playback rate. If using trick play, it will\n * return the current trick play rate; otherwise, it will return the video\n * playback rate.\n * @return {number}\n * @export\n */\nshaka.Player.prototype.getPlaybackRate = function() {\n return this.playhead_ ? this.playhead_.getPlaybackRate() : 0;\n};\n\n\n/**\n * Skip through the content without playing. Simulated using repeated seeks.\n *\n * Trick play will be canceled automatically if the playhead hits the beginning\n * or end of the seekable range for the content.\n *\n * @param {number} rate The playback rate to simulate. For example, a rate of\n * 2.5 would result in 2.5 seconds of content being skipped every second.\n * To trick-play backward, use a negative rate.\n * @export\n */\nshaka.Player.prototype.trickPlay = function(rate) {\n shaka.log.debug('Trick play rate', rate);\n if (this.playhead_)\n this.playhead_.setPlaybackRate(rate);\n\n if (this.streamingEngine_)\n this.streamingEngine_.setTrickPlay(rate != 1);\n};\n\n\n/**\n * Cancel trick-play.\n * @export\n */\nshaka.Player.prototype.cancelTrickPlay = function() {\n shaka.log.debug('Trick play canceled');\n if (this.playhead_)\n this.playhead_.setPlaybackRate(1);\n\n if (this.streamingEngine_)\n this.streamingEngine_.setTrickPlay(false);\n};\n\n\n/**\n * Return a list of variant and text tracks available for the current Period.\n * If there are multiple Periods, then you must seek to the Period before\n * being able to switch.\n *\n * @return {!Array.<shakaExtern.Track>}\n * @export\n * @deprecated Use getVariantTracks() or getTextTracks()\n */\nshaka.Player.prototype.getTracks = function() {\n shaka.log.warning('shaka.Player.getTracks() is being deprecated and will ' +\n 'be removed in v2.2. Use getVariantTracks() to get a ' +\n 'list of variant tracks or getTextTracks() for text.');\n\n var tracks = this.getVariantTracks();\n return tracks.concat(this.getTextTracks());\n};\n\n\n/**\n * Select a specific track. For variant tracks, this disables adaptation.\n * Note that AdaptationEvents are not fired for manual track selections.\n *\n * @param {shakaExtern.Track} track\n * @param {boolean=} opt_clearBuffer\n * @export\n * @deprecated Use selectVariantTrack() or selectTextTrack()\n */\nshaka.Player.prototype.selectTrack = function(track, opt_clearBuffer) {\n shaka.log.warning('shaka.Player.selectTrack() is being deprecated and will ' +\n 'be removed in v2.2. Use selectVariantTrack() to select ' +\n 'a new variant track or selectTextTrack() for text.');\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (track.type == ContentType.TEXT) {\n this.selectTextTrack(track);\n } else {\n // Disable ABR for variant track changes.\n var config = {abr: {enabled: false}};\n this.configure(config);\n this.selectVariantTrack(track, opt_clearBuffer);\n }\n};\n\n\n/**\n * Return a list of variant tracks available for the current\n * Period. If there are multiple Periods, then you must seek to the Period\n * before being able to switch.\n *\n * @return {!Array.<shakaExtern.Track>}\n * @export\n */\nshaka.Player.prototype.getVariantTracks = function() {\n if (!this.manifest_)\n return [];\n this.assertCorrectActiveStreams_();\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var currentPeriod = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.playhead_.getTime());\n var activeStreams = this.activeStreamsByPeriod_[currentPeriod] || {};\n return shaka.util.StreamUtils.getVariantTracks(\n this.manifest_.periods[currentPeriod], activeStreams[ContentType.AUDIO],\n activeStreams[ContentType.VIDEO]);\n};\n\n\n/**\n * Return a list of text tracks available for the current\n * Period. If there are multiple Periods, then you must seek to the Period\n * before being able to switch.\n *\n * @return {!Array.<shakaExtern.Track>}\n * @export\n */\nshaka.Player.prototype.getTextTracks = function() {\n if (!this.manifest_)\n return [];\n this.assertCorrectActiveStreams_();\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var currentPeriod = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.playhead_.getTime());\n var activeStreams = this.activeStreamsByPeriod_[currentPeriod] || {};\n return shaka.util.StreamUtils\n .getTextTracks(\n this.manifest_.periods[currentPeriod],\n activeStreams[ContentType.TEXT])\n .filter(function(track) {\n // Don't show any tracks that are being loaded still.\n return this.loadingTextStreamIds_.indexOf(track.id) < 0;\n }.bind(this));\n};\n\n\n/**\n * Select a specific text track. Note that AdaptationEvents are not\n * fired for manual track selections.\n *\n * @param {shakaExtern.Track} track\n * @export\n */\nshaka.Player.prototype.selectTextTrack = function(track) {\n if (!this.streamingEngine_)\n return;\n\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var period = this.streamingEngine_.getCurrentPeriod();\n var stream = StreamUtils.findTextStreamForTrack(period, track);\n\n if (!stream) {\n shaka.log.error('Unable to find the track with id \"' + track.id +\n '\"; did we change Periods?');\n return;\n }\n\n this.addToSwitchHistory_(stream, /* fromAdaptation */ false);\n\n // Create empty object first and initialize the fields through\n // [] to allow field names to be expressions.\n var streamsToSwitch = {};\n streamsToSwitch[ContentType.TEXT] = stream;\n this.deferredSwitch_(streamsToSwitch, /* opt_clearBuffer */ true);\n};\n\n\n/**\n * Select a specific track. Note that AdaptationEvents are not fired for manual\n * track selections.\n *\n * @param {shakaExtern.Track} track\n * @param {boolean=} opt_clearBuffer\n * @export\n */\nshaka.Player.prototype.selectVariantTrack = function(track, opt_clearBuffer) {\n if (!this.streamingEngine_)\n return;\n\n if (this.config_.abr.enabled) {\n shaka.log.warning('Changing tracks while abr manager is enabled will ' +\n 'likely result in the selected track being overriden. ' +\n 'Consider disabling abr before calling ' +\n 'selectVariantTrack().');\n }\n\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var streamsToSwitch = {};\n\n var period = this.streamingEngine_.getCurrentPeriod();\n var variant = StreamUtils.findVariantForTrack(period, track);\n var activeStreams = this.streamingEngine_.getActiveStreams();\n if (variant) {\n // Double check that the track is allowed to be played.\n // The track list should only contain playable variants,\n // but if resctrictions change and selectVariantTrack()\n // is called before the track list is updated, we could\n // get a now-restricted variant.\n var variantIsPlayable = StreamUtils.isPlayable(variant);\n if (!variantIsPlayable) {\n shaka.log.error('Unable to switch to track with id \"' + track.id +\n '\" because it is restricted.');\n return;\n }\n\n if (variant.audio) {\n // Update active streams even if we're not switching\n // in case active streams haven't been set up yet.\n this.updateActiveStreams_(variant.audio);\n if (variant.audio != activeStreams[ContentType.AUDIO])\n streamsToSwitch[ContentType.AUDIO] = variant.audio;\n }\n if (variant.video) {\n this.updateActiveStreams_(variant.video);\n if (variant.video != activeStreams[ContentType.VIDEO])\n streamsToSwitch[ContentType.VIDEO] = variant.video;\n }\n }\n\n // Add entries to the history.\n shaka.util.MapUtils.values(streamsToSwitch).forEach(function(stream) {\n this.addToSwitchHistory_(stream, /* fromAdaptation */ false);\n }.bind(this));\n\n // Save current text stream to ensure that it doesn't get overridden\n // by a default one inside shaka.Player.configure()\n var currentTextStream = activeStreams[ContentType.TEXT];\n\n if (currentTextStream) {\n streamsToSwitch[ContentType.TEXT] = currentTextStream;\n }\n\n this.deferredSwitch_(streamsToSwitch, opt_clearBuffer);\n};\n\n\n/**\n * Return a list of audio languages available for the current\n * Period.\n *\n * @return {!Array.<string>}\n * @export\n */\nshaka.Player.prototype.getAudioLanguages = function() {\n if (!this.streamingEngine_) {\n return [];\n }\n\n var StreamUtils = shaka.util.StreamUtils;\n var period = this.streamingEngine_.getCurrentPeriod();\n var variants = StreamUtils.getPlayableVariants(period.variants);\n return variants.map(function(variant) {\n return variant.language;\n }).filter(shaka.util.Functional.isNotDuplicate);\n};\n\n\n/**\n * Return a list of text languages available for the current\n * Period.\n *\n * @return {!Array.<string>}\n * @export\n */\nshaka.Player.prototype.getTextLanguages = function() {\n if (!this.streamingEngine_) {\n return [];\n }\n\n var period = this.streamingEngine_.getCurrentPeriod();\n return period.textStreams.map(function(stream) {\n return stream.language;\n }).filter(shaka.util.Functional.isNotDuplicate);\n};\n\n\n/**\n * Sets currentAudioLanguage to the selected language and chooses\n * new variant in that language if need be.\n *\n * @param {!string} language\n * @param {string=} opt_role\n * @export\n */\nshaka.Player.prototype.selectAudioLanguage = function(language, opt_role) {\n if (!this.streamingEngine_) return;\n var period = this.streamingEngine_.getCurrentPeriod();\n this.currentAudioLanguage_ = language;\n this.currentVariantRole_ = opt_role || '';\n this.chooseStreamsAndSwitch_(period);\n};\n\n\n/**\n * Sets currentTextLanguage to the selected language and chooses\n * new text stream in that language if need be.\n *\n * @param {!string} language\n * @param {string=} opt_role\n * @export\n */\nshaka.Player.prototype.selectTextLanguage = function(language, opt_role) {\n if (!this.streamingEngine_) return;\n var period = this.streamingEngine_.getCurrentPeriod();\n this.currentTextLanguage_ = language;\n this.currentTextRole_ = opt_role || '';\n this.chooseStreamsAndSwitch_(period);\n};\n\n\n/**\n * @return {boolean} True if the current text track is visible.\n * @export\n */\nshaka.Player.prototype.isTextTrackVisible = function() {\n return this.textTrack_.mode == 'showing';\n};\n\n\n/**\n * Set the visibility of the current text track, if any.\n *\n * @param {boolean} on\n * @export\n */\nshaka.Player.prototype.setTextTrackVisibility = function(on) {\n this.textTrack_.mode = on ? 'showing' : 'hidden';\n this.onTextTrackVisibility_();\n};\n\n\n/**\n * Returns current playhead time as a Date.\n *\n * @return {Date}\n * @export\n */\nshaka.Player.prototype.getPlayheadTimeAsDate = function() {\n if (!this.manifest_) return null;\n goog.asserts.assert(this.isLive(),\n 'getPlayheadTimeInUTC should be called on a live stream!');\n var time =\n this.manifest_.presentationTimeline.getPresentationStartTime() * 1000 +\n this.video_.currentTime * 1000;\n\n return new Date(time);\n};\n\n\n/**\n * Return playback and adaptation stats.\n *\n * @return {shakaExtern.Stats}\n * @export\n */\nshaka.Player.prototype.getStats = function() {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n this.updateTimeStats_();\n this.updateState_();\n\n var video = null;\n var variant = null;\n var videoInfo = this.video_ && this.video_.getVideoPlaybackQuality ?\n this.video_.getVideoPlaybackQuality() : {};\n\n if (this.playhead_ && this.manifest_) {\n var periodIdx = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.playhead_.getTime());\n var period = this.manifest_.periods[periodIdx];\n var activeStreams = this.activeStreamsByPeriod_[periodIdx];\n\n variant = shaka.util.StreamUtils.getVariantByStreamIds(\n activeStreams[ContentType.AUDIO],\n activeStreams[ContentType.VIDEO],\n period.variants);\n\n video = variant.video || {};\n }\n\n if (!video) video = {};\n if (!variant) variant = {};\n\n // Clone the internal object so our state cannot be tampered with.\n var cloneObject = shaka.util.ConfigUtils.cloneObject;\n return {\n // Not tracked in this.stats_:\n width: video.width || 0,\n height: video.height || 0,\n streamBandwidth: variant.bandwidth || 0,\n decodedFrames: Number(videoInfo.totalVideoFrames),\n droppedFrames: Number(videoInfo.droppedVideoFrames),\n estimatedBandwidth: this.config_.abr.manager.getBandwidthEstimate(),\n\n loadLatency: this.stats_.loadLatency,\n playTime: this.stats_.playTime,\n bufferingTime: this.stats_.bufferingTime,\n // Deep-clone the objects as well as the arrays that contain them:\n switchHistory: cloneObject(this.stats_.switchHistory),\n stateHistory: cloneObject(this.stats_.stateHistory)\n };\n};\n\n\n/**\n * Adds the given text track to the current Period. Load() must resolve before\n * calling. The current Period or the presentation must have a duration. This\n * returns a Promise that will resolve when the track can be switched to and\n * will resolve with the track that was created.\n *\n * @param {string} uri\n * @param {string} language\n * @param {string} kind\n * @param {string} mime\n * @param {string=} opt_codec\n * @param {string=} opt_label\n * @return {!Promise.<shakaExtern.Track>}\n * @export\n */\nshaka.Player.prototype.addTextTrack = function(\n uri, language, kind, mime, opt_codec, opt_label) {\n if (!this.streamingEngine_) {\n shaka.log.error(\n 'Must call load() and wait for it to resolve before adding text ' +\n 'tracks.');\n return Promise.reject();\n }\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Get the Period duration.\n var period = this.streamingEngine_.getCurrentPeriod();\n /** @type {number} */\n var periodDuration;\n for (var i = 0; i < this.manifest_.periods.length; i++) {\n if (this.manifest_.periods[i] == period) {\n if (i == this.manifest_.periods.length - 1) {\n periodDuration = this.manifest_.presentationTimeline.getDuration() -\n period.startTime;\n if (periodDuration == Infinity) {\n shaka.log.error(\n 'The current Period or the presentation must have a duration ' +\n 'to add external text tracks.');\n return Promise.reject();\n }\n } else {\n var nextPeriod = this.manifest_.periods[i + 1];\n periodDuration = nextPeriod.startTime - period.startTime;\n }\n break;\n }\n }\n\n /** @type {shakaExtern.Stream} */\n var stream = {\n id: this.nextExternalStreamId_++,\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: function(time) { return 1; },\n getSegmentReference: function(ref) {\n if (ref != 1) return null;\n return new shaka.media.SegmentReference(\n 1, 0, periodDuration, function() { return [uri]; }, 0, null);\n },\n initSegmentReference: null,\n presentationTimeOffset: 0,\n mimeType: mime,\n codecs: opt_codec || '',\n kind: kind,\n encrypted: false,\n keyId: null,\n language: language,\n label: opt_label || null,\n type: ContentType.TEXT,\n primary: false,\n trickModeVideo: null,\n containsEmsgBoxes: false,\n roles: []\n };\n\n // Add the stream to the loading list to ensure it isn't switched to while it\n // is initializing.\n this.loadingTextStreamIds_.push(stream.id);\n period.textStreams.push(stream);\n\n return this.streamingEngine_.notifyNewTextStream(stream).then(function() {\n if (this.destroyed_) return;\n\n // If this was the first text stream, StreamingEngine will start streaming\n // it in notifyNewTextStream. So update the active stream.\n var curPeriodIdx = this.manifest_.periods.indexOf(period);\n var activeStreams = this.streamingEngine_.getActiveStreams();\n if (activeStreams[ContentType.TEXT]) {\n this.activeStreamsByPeriod_[curPeriodIdx][ContentType.TEXT] =\n activeStreams[ContentType.TEXT].id;\n }\n\n // Remove the stream from the loading list.\n this.loadingTextStreamIds_.splice(\n this.loadingTextStreamIds_.indexOf(stream.id), 1);\n\n shaka.log.debug('Choosing new streams after adding a text stream');\n this.chooseStreamsAndSwitch_(period);\n this.onTracksChanged_();\n\n return {\n id: stream.id,\n active: false,\n type: ContentType.TEXT,\n bandwidth: 0,\n language: language,\n label: opt_label || null,\n kind: kind,\n width: null,\n height: null\n };\n }.bind(this));\n};\n\n\n/**\n * Set the maximum resolution that the platform's hardware can handle.\n * This will be called automatically by shaka.cast.CastReceiver to enforce\n * limitations of the Chromecast hardware.\n *\n * @param {number} width\n * @param {number} height\n * @export\n */\nshaka.Player.prototype.setMaxHardwareResolution = function(width, height) {\n this.maxHwRes_.width = width;\n this.maxHwRes_.height = height;\n};\n\n\n/**\n * Initialize the Player.\n * @private\n */\nshaka.Player.prototype.initialize_ = function() {\n // Start the (potentially slow) process of opening MediaSource now.\n this.mediaSourceOpen_ = this.createMediaSource();\n\n // If the video element has TextTracks, disable them. If we see one that\n // was created by a previous instance of Shaka Player, reuse it.\n for (var i = 0; i < this.video_.textTracks.length; ++i) {\n var track = this.video_.textTracks[i];\n track.mode = 'disabled';\n\n if (track.label == shaka.Player.TextTrackLabel_) {\n this.textTrack_ = track;\n }\n }\n\n if (!this.textTrack_) {\n // As far as I can tell, there is no observable difference between setting\n // kind to 'subtitles' or 'captions' when creating the TextTrack object.\n // The individual text tracks from the manifest will still have their own\n // kinds which can be displayed in the app's UI.\n this.textTrack_ = this.video_.addTextTrack(\n 'subtitles', shaka.Player.TextTrackLabel_);\n }\n this.textTrack_.mode = 'hidden';\n\n // TODO: test that in all cases, the built-in CC controls in the video element\n // are toggling our TextTrack.\n\n // Listen for video errors.\n this.eventManager_.listen(this.video_, 'error',\n this.onVideoError_.bind(this));\n};\n\n\n/**\n * @param {!shakaExtern.Stream} stream\n * @param {boolean} fromAdaptation\n * @private\n */\nshaka.Player.prototype.addToSwitchHistory_ = function(stream, fromAdaptation) {\n this.stats_.switchHistory.push({\n timestamp: Date.now() / 1000,\n id: stream.id,\n type: stream.type,\n fromAdaptation: fromAdaptation\n });\n\n this.updateActiveStreams_(stream);\n};\n\n\n/**\n * @param {!shakaExtern.Stream} stream\n * @private\n */\nshaka.Player.prototype.updateActiveStreams_ = function(stream) {\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n var periodIndex =\n shaka.util.StreamUtils.findPeriodContainingStream(this.manifest_, stream);\n if (!this.activeStreamsByPeriod_[periodIndex])\n this.activeStreamsByPeriod_[periodIndex] = {};\n this.activeStreamsByPeriod_[periodIndex][stream.type] = stream.id;\n};\n\n\n/**\n * Destroy members responsible for streaming.\n *\n * @return {!Promise}\n * @private\n */\nshaka.Player.prototype.destroyStreaming_ = function() {\n if (this.eventManager_) {\n this.eventManager_.unlisten(this.mediaSource_, 'sourceopen');\n this.eventManager_.unlisten(this.video_, 'loadeddata');\n this.eventManager_.unlisten(this.video_, 'playing');\n this.eventManager_.unlisten(this.video_, 'pause');\n this.eventManager_.unlisten(this.video_, 'ended');\n }\n\n if (this.video_) {\n this.video_.removeAttribute('src');\n this.video_.load();\n }\n\n var p = Promise.all([\n this.config_ ? this.config_.abr.manager.stop() : null,\n this.drmEngine_ ? this.drmEngine_.destroy() : null,\n this.mediaSourceEngine_ ? this.mediaSourceEngine_.destroy() : null,\n this.playhead_ ? this.playhead_.destroy() : null,\n this.playheadObserver_ ? this.playheadObserver_.destroy() : null,\n this.streamingEngine_ ? this.streamingEngine_.destroy() : null,\n this.parser_ ? this.parser_.stop() : null\n ]);\n\n this.drmEngine_ = null;\n this.mediaSourceEngine_ = null;\n this.playhead_ = null;\n this.playheadObserver_ = null;\n this.streamingEngine_ = null;\n this.parser_ = null;\n this.manifest_ = null;\n this.manifestUri_ = null;\n this.mediaSourceOpen_ = null;\n this.mediaSource_ = null;\n this.pendingTimelineRegions_ = [];\n this.activeStreamsByPeriod_ = {};\n this.deferredSwitches_ = {};\n this.stats_ = this.getCleanStats_();\n\n return p;\n};\n\n\n/**\n * Reset the streaming system.\n * @return {!Promise}\n * @private\n */\nshaka.Player.prototype.resetStreaming_ = function() {\n if (!this.parser_) {\n // Nothing is playing, so this is effectively a no-op.\n return Promise.resolve();\n }\n\n // Destroy the streaming system before we recreate everything.\n return this.destroyStreaming_().then(function() {\n if (this.destroyed_) return;\n\n // Force an exit from the buffering state.\n this.onBuffering_(false);\n\n // Start the (potentially slow) process of opening MediaSource now.\n this.mediaSourceOpen_ = this.createMediaSource();\n }.bind(this));\n};\n\n\n/**\n * @const {string}\n * @private\n */\nshaka.Player.TextTrackLabel_ = 'Shaka Player TextTrack';\n\n\n/**\n * @return {!Object}\n * @private\n */\nshaka.Player.prototype.configOverrides_ = function() {\n return {\n '.drm.servers': '',\n '.drm.clearKeys': '',\n '.drm.advanced': {\n distinctiveIdentifierRequired: false,\n persistentStateRequired: false,\n videoRobustness: '',\n audioRobustness: '',\n serverCertificate: null\n }\n };\n};\n\n\n/**\n * @return {shakaExtern.PlayerConfiguration}\n * @private\n */\nshaka.Player.prototype.defaultConfig_ = function() {\n return {\n drm: {\n retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(),\n // These will all be verified by special cases in mergeConfigObjects_():\n servers: {}, // key is arbitrary key system ID, value must be string\n clearKeys: {}, // key is arbitrary key system ID, value must be string\n advanced: {}, // key is arbitrary key system ID, value is a record type\n delayLicenseRequestUntilPlayed: false\n },\n manifest: {\n retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(),\n dash: {\n customScheme: function(node) {\n // Reference node to keep closure from removing it.\n // If the argument is removed, it breaks our function length check\n // in mergeConfigObjects_().\n // TODO: Find a better solution if possible.\n // NOTE: Chrome App Content Security Policy prohibits usage of new\n // Function()\n\n if (node) return null;\n },\n clockSyncUri: '',\n ignoreDrmInfo: false\n },\n hls: {\n defaultTimeOffset: 0\n }\n },\n streaming: {\n retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(),\n infiniteRetriesForLiveStreams: true,\n rebufferingGoal: 2,\n bufferingGoal: 10,\n bufferBehind: 30,\n ignoreTextStreamFailures: false,\n startAtSegmentBoundary: false,\n smallGapLimit: 0.5,\n jumpLargeGaps: false\n },\n abr: {\n manager: this.defaultAbrManager_,\n enabled: true,\n defaultBandwidthEstimate:\n shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE,\n restrictions: {\n minWidth: 0,\n maxWidth: Infinity,\n minHeight: 0,\n maxHeight: Infinity,\n minPixels: 0,\n maxPixels: Infinity,\n minBandwidth: 0,\n maxBandwidth: Infinity\n }\n },\n preferredAudioLanguage: '',\n preferredTextLanguage: '',\n restrictions: {\n minWidth: 0,\n maxWidth: Infinity,\n minHeight: 0,\n maxHeight: Infinity,\n minPixels: 0,\n maxPixels: Infinity,\n minBandwidth: 0,\n maxBandwidth: Infinity\n }\n };\n};\n\n\n/**\n * @return {shakaExtern.Stats}\n * @private\n */\nshaka.Player.prototype.getCleanStats_ = function() {\n return {\n // These are not tracked in the private stats structure and are only here to\n // satisfy the compiler.\n width: NaN,\n height: NaN,\n streamBandwidth: NaN,\n decodedFrames: NaN,\n droppedFrames: NaN,\n estimatedBandwidth: NaN,\n\n // These are tracked in the private stats structure to avoid the need for\n // many private member variables.\n loadLatency: NaN,\n playTime: 0,\n bufferingTime: 0,\n switchHistory: [],\n stateHistory: []\n };\n};\n\n\n/**\n * @param {shakaExtern.Period} period\n * @private\n */\nshaka.Player.prototype.filterPeriod_ = function(period) {\n goog.asserts.assert(this.video_, 'Must not be destroyed');\n var StreamUtils = shaka.util.StreamUtils;\n\n var activeStreams =\n this.streamingEngine_ ? this.streamingEngine_.getActiveStreams() : {};\n StreamUtils.filterPeriod(this.drmEngine_, activeStreams, period);\n\n // Check for playable variants before restrictions to give a different error\n // if we have restricted all the tracks rather than there being none.\n var hasPlayableVariants =\n StreamUtils.getPlayableVariants(period.variants).length > 0;\n\n var tracksChanged = shaka.util.StreamUtils.applyRestrictions(\n period, this.config_.restrictions, this.maxHwRes_);\n if (tracksChanged && this.streamingEngine_ &&\n this.streamingEngine_.getCurrentPeriod() == period) {\n this.onTracksChanged_();\n }\n\n // Check for playable variants again. If the first check found variants, but\n // not the second, then all variants are restricted.\n var allVariantsRestricted =\n StreamUtils.getPlayableVariants(period.variants).length < 1;\n\n if (!hasPlayableVariants) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.UNPLAYABLE_PERIOD);\n } else if (allVariantsRestricted) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET);\n }\n};\n\n\n/**\n * Switches to the given streams, deferring switches if needed.\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType,\n shakaExtern.Stream>} streamsByType\n * @param {boolean=} opt_clearBuffer\n * @private\n */\nshaka.Player.prototype.deferredSwitch_ = function(\n streamsByType, opt_clearBuffer) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n for (var type in streamsByType) {\n var stream = streamsByType[type];\n var clearBuffer = opt_clearBuffer || false;\n // TODO: consider adding a cue replacement algorithm to TextEngine to remove\n // this special case for text:\n if (type == ContentType.TEXT) clearBuffer = true;\n if (this.switchingPeriods_) {\n this.deferredSwitches_[type] = {stream: stream, clearBuffer: clearBuffer};\n } else {\n this.streamingEngine_.switch(type, stream, clearBuffer);\n }\n }\n};\n\n\n/**\n * Verifies that the active streams according to the player match those in\n * StreamingEngine.\n * @private\n */\nshaka.Player.prototype.assertCorrectActiveStreams_ = function() {\n if (!this.streamingEngine_ || !this.manifest_ || COMPILED) return;\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var streamingActive = this.streamingEngine_.getActiveStreams();\n var mainStream =\n streamingActive[ContentType.VIDEO] || streamingActive[ContentType.AUDIO];\n if (!mainStream)\n return;\n\n var streamingPeriodIndex =\n StreamUtils.findPeriodContainingStream(this.manifest_, mainStream);\n var currentPeriodIndex =\n this.manifest_.periods.indexOf(this.streamingEngine_.getCurrentPeriod());\n if (streamingPeriodIndex < 0 || streamingPeriodIndex != currentPeriodIndex)\n return;\n\n var playerActive = this.activeStreamsByPeriod_[currentPeriodIndex] || {};\n for (var type in streamingActive) {\n var activeId = streamingActive[type].id;\n if (this.deferredSwitches_[type])\n activeId = this.deferredSwitches_[type].stream.id;\n goog.asserts.assert(activeId == playerActive[type],\n 'Inconsistent active stream');\n }\n};\n\n\n/** @private */\nshaka.Player.prototype.updateTimeStats_ = function() {\n // Only count while we're loaded.\n if (!this.manifest_)\n return;\n\n var now = Date.now() / 1000;\n if (this.buffering_)\n this.stats_.bufferingTime += (now - this.lastTimeStatsUpdateTimestamp_);\n else\n this.stats_.playTime += (now - this.lastTimeStatsUpdateTimestamp_);\n\n this.lastTimeStatsUpdateTimestamp_ = now;\n};\n\n\n/**\n * @param {number} time\n * @return {number}\n * @private\n */\nshaka.Player.prototype.adjustStartTime_ = function(time) {\n var activeStreams = this.streamingEngine_.getActiveStreams();\n var period = this.streamingEngine_.getCurrentPeriod();\n\n // This method is called after StreamingEngine.init resolves, this means that\n // all the active streams have had createSegmentIndex called.\n function getAdjustedTime(stream, time) {\n if (!stream) return null;\n var idx = stream.findSegmentPosition(time - period.startTime);\n if (idx == null) return null;\n var ref = stream.getSegmentReference(idx);\n if (!ref) return null;\n var refTime = ref.startTime + period.startTime;\n goog.asserts.assert(refTime <= time, 'Segment should start before time');\n return refTime;\n }\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var videoStartTime = getAdjustedTime(activeStreams[ContentType.VIDEO], time);\n var audioStartTime = getAdjustedTime(activeStreams[ContentType.AUDIO], time);\n\n // If we have both video and audio times, pick the larger one. If we picked\n // the smaller one, that one will download an entire segment to buffer the\n // difference.\n if (videoStartTime != null && audioStartTime != null)\n return Math.max(videoStartTime, audioStartTime);\n else if (videoStartTime != null)\n return videoStartTime;\n else if (audioStartTime != null)\n return audioStartTime;\n else\n return time;\n};\n\n\n/**\n * Callback from NetworkingEngine.\n *\n * @param {number} deltaTimeMs\n * @param {number} numBytes\n * @private\n */\nshaka.Player.prototype.onSegmentDownloaded_ = function(deltaTimeMs, numBytes) {\n this.config_.abr.manager.segmentDownloaded(deltaTimeMs, numBytes);\n};\n\n\n/**\n * Callback from PlayheadObserver.\n *\n * @param {boolean} buffering\n * @private\n */\nshaka.Player.prototype.onBuffering_ = function(buffering) {\n // Before setting |buffering_|, update the time spent in the previous state.\n this.updateTimeStats_();\n this.buffering_ = buffering;\n this.updateState_();\n\n if (this.playhead_)\n this.playhead_.setBuffering(buffering);\n\n var event = new shaka.util.FakeEvent('buffering', { 'buffering': buffering });\n this.dispatchEvent(event);\n};\n\n\n/**\n * Callback from PlayheadObserver.\n * @private\n */\nshaka.Player.prototype.onChangePeriod_ = function() {\n this.onTracksChanged_();\n};\n\n\n/**\n * Called from potential initiators of state change, or before returning stats\n * to the user.\n *\n * This method decides if state has actually changed, updates the last entry,\n * and adds a new one if needed.\n *\n * @private\n */\nshaka.Player.prototype.updateState_ = function() {\n if (this.destroyed_) return;\n\n var newState;\n if (this.buffering_) {\n newState = 'buffering';\n } else if (this.video_.ended) {\n newState = 'ended';\n } else if (this.video_.paused) {\n newState = 'paused';\n } else {\n newState = 'playing';\n }\n\n var now = Date.now() / 1000;\n if (this.stats_.stateHistory.length) {\n var lastIndex = this.stats_.stateHistory.length - 1;\n var lastEntry = this.stats_.stateHistory[lastIndex];\n lastEntry.duration = now - lastEntry.timestamp;\n\n if (newState == lastEntry.state) {\n // The state has not changed, so do not add anything to the history.\n return;\n }\n }\n\n this.stats_.stateHistory.push({\n timestamp: now,\n state: newState,\n duration: 0\n });\n};\n\n\n/**\n * Callback from Playhead.\n *\n * @private\n */\nshaka.Player.prototype.onSeek_ = function() {\n if (this.playheadObserver_)\n this.playheadObserver_.seeked();\n if (this.streamingEngine_)\n this.streamingEngine_.seeked();\n};\n\n\n/**\n * Chooses streams from the given Period.\n *\n * @param {!shakaExtern.Period} period\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @param {!Array.<!shakaExtern.Stream>} textStreams\n * @param {boolean=} opt_chooseAll If true, choose streams of every type.\n * @return {!Object.<string, !shakaExtern.Stream>} A map of stream types to\n * chosen streams.\n * @private\n */\nshaka.Player.prototype.chooseStreams_ =\n function(period, variants, textStreams, opt_chooseAll) {\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Issue an error if there are no playable variants\n if (!variants || variants.length < 1) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET));\n return {};\n }\n\n // Update abr manager with newly filtered streams and variants.\n this.config_.abr.manager.setVariants(variants);\n this.config_.abr.manager.setTextStreams(textStreams);\n\n var needsUpdate = [];\n if (opt_chooseAll) {\n needsUpdate = [ContentType.VIDEO, ContentType.AUDIO];\n if (period.textStreams.length) needsUpdate.push(ContentType.TEXT);\n }\n\n // Check if any of the active streams is no longer available\n // or is using the wrong language.\n var activeStreams = this.streamingEngine_.getActiveStreams();\n // activePeriod may reasonably be null before StreamingEngine is streaming.\n var activePeriod = this.streamingEngine_.getActivePeriod();\n var activeVariant = shaka.util.StreamUtils.getVariantByStreams(\n activeStreams[ContentType.AUDIO],\n activeStreams[ContentType.VIDEO],\n activePeriod ? activePeriod.variants : period.variants);\n\n if (activeVariant) {\n if (!activeVariant.allowedByApplication ||\n !activeVariant.allowedByKeySystem) {\n needsUpdate.push(ContentType.AUDIO);\n needsUpdate.push(ContentType.VIDEO);\n }\n\n for (var type in activeStreams) {\n var stream = activeStreams[type];\n if (stream.type == ContentType.AUDIO &&\n stream.language != variants[0].language) {\n needsUpdate.push(type);\n } else if (stream.type == ContentType.TEXT && textStreams.length > 0 &&\n stream.language != textStreams[0].language) {\n needsUpdate.push(type);\n }\n }\n }\n\n needsUpdate = needsUpdate.filter(shaka.util.Functional.isNotDuplicate);\n\n if (needsUpdate.length > 0) {\n shaka.log.debug('Choosing new streams for', needsUpdate);\n var chosen = {};\n try {\n chosen = this.config_.abr.manager.chooseStreams(needsUpdate);\n } catch (err) {\n this.onError_(err);\n }\n\n return chosen;\n } else {\n shaka.log.debug('No new streams need to be chosen.');\n return {};\n }\n};\n\n\n/**\n * Chooses streams from the given Period and switches to them.\n * Called after a config change, a new text stream, or a key status event.\n *\n * @param {!shakaExtern.Period} period\n * @private\n */\nshaka.Player.prototype.chooseStreamsAndSwitch_ = function(period) {\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Create empty object first and initialize the fields through\n // [] to allow field names to be expressions.\n var languageMatches = {};\n languageMatches[ContentType.AUDIO] = false;\n languageMatches[ContentType.TEXT] = false;\n\n var variants = shaka.util.StreamUtils.filterVariantsByRoleAndLanguage(\n period, this.currentAudioLanguage_, languageMatches,\n this.currentVariantRole_);\n var textStreams = shaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage(\n period, this.currentTextLanguage_, languageMatches,\n this.currentTextRole_);\n\n // chooseStreams_ filters out choices which are already active.\n var chosen = this.chooseStreams_(period, variants, textStreams);\n\n for (var type in chosen) {\n this.addToSwitchHistory_(chosen[type], /* fromAdaptation */ true);\n }\n\n // Because we're running this after a config change (manual language change),\n // a new text stream, or a key status event, and because active streams have\n // been filtered out already, it is always okay to clear the buffer for what\n // remains.\n this.deferredSwitch_(chosen, /* opt_clearBuffer */ true);\n\n // Send an adaptation event so that the UI can show the new language/tracks.\n this.onAdaptation_();\n\n if (chosen[ContentType.TEXT]) {\n // If audio and text tracks have different languages, and the text track\n // matches the user's preference, then show the captions.\n if (chosen[ContentType.AUDIO] &&\n languageMatches[ContentType.TEXT] &&\n chosen[ContentType.TEXT].language !=\n chosen[ContentType.AUDIO].language) {\n this.textTrack_.mode = 'showing';\n this.onTextTrackVisibility_();\n }\n }\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @param {!shakaExtern.Period} period\n * @return {!Object.<string, !shakaExtern.Stream>} A map of stream types to\n * chosen streams.\n * @private\n */\nshaka.Player.prototype.onChooseStreams_ = function(period) {\n shaka.log.debug('onChooseStreams_', period);\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n\n // We are switching Periods, so the AbrManager will be disabled. But if we\n // want to abr.enabled, we do not want to call AbrManager.enable before\n // canSwitch_ is called.\n this.switchingPeriods_ = true;\n this.config_.abr.manager.disable();\n\n shaka.log.debug('Choosing new streams after period changed');\n var variants = shaka.util.StreamUtils.filterVariantsByRoleAndLanguage(\n period, this.currentAudioLanguage_, /* opt_languageMatches */ undefined,\n this.currentVariantRole_);\n\n var textStreams = shaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage(\n period, this.currentTextLanguage_, /* opt_languageMatches */ undefined,\n this.currentTextRole_);\n\n shaka.log.v2('onChooseStreams_, variants and text streams: ',\n variants, textStreams);\n\n var chosen = this.chooseStreams_(\n period, variants, textStreams, /* opt_chooseAll */ true);\n shaka.log.v2('onChooseStreams_, chosen=', chosen);\n\n // Override the chosen streams with the ones picked in\n // selectVariant/TextTrack. NOTE: The apparent race between\n // selectVariant/TextTrack and period transition is handled by\n // StreamingEngine, which will re-request tracks for thetransition if any\n // of these deferred selections are from the wrong period.\n for (var type in this.deferredSwitches_) {\n // We are choosing initial tracks, so no segments from this Period have\n // been downloaded yet. Therefore, it is okay to ignore the .clearBuffer\n // member of this structure.\n chosen[type] = this.deferredSwitches_[type].stream;\n }\n this.deferredSwitches_ = {};\n\n for (var type in chosen) {\n this.addToSwitchHistory_(chosen[type], /* fromAdaptation */ true);\n }\n\n // Don't fire a tracks-changed event since we aren't inside the new Period\n // yet.\n\n return chosen;\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @private\n */\nshaka.Player.prototype.canSwitch_ = function() {\n shaka.log.debug('canSwitch_');\n this.switchingPeriods_ = false;\n if (this.config_.abr.enabled)\n this.config_.abr.manager.enable();\n\n // If we still have deferred switches, switch now.\n for (var type in this.deferredSwitches_) {\n var info = this.deferredSwitches_[type];\n this.streamingEngine_.switch(type, info.stream, info.clearBuffer);\n }\n this.deferredSwitches_ = {};\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @private\n */\nshaka.Player.prototype.onManifestUpdate_ = function() {\n if (this.parser_ && this.parser_.update)\n this.parser_.update();\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @private\n */\nshaka.Player.prototype.onSegmentAppended_ = function() {\n if (this.playhead_)\n this.playhead_.onSegmentAppended();\n};\n\n\n/**\n * Callback from AbrManager.\n *\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType,\n * !shakaExtern.Stream>} streamsByType\n * @param {boolean=} opt_clearBuffer\n * @private\n */\nshaka.Player.prototype.switch_ = function(streamsByType, opt_clearBuffer) {\n shaka.log.debug('switch_');\n goog.asserts.assert(this.config_.abr.enabled,\n 'AbrManager should not call switch while disabled!');\n goog.asserts.assert(!this.switchingPeriods_,\n 'AbrManager should not call switch while transitioning between Periods!');\n\n // We have adapted to a new stream, record it in the history. Only add if\n // we are actually switching the stream.\n var oldActive = this.streamingEngine_.getActiveStreams();\n for (var type in streamsByType) {\n var stream = streamsByType[type];\n if (oldActive[type] != stream) {\n this.addToSwitchHistory_(stream, /* fromAdaptation */ true);\n } else {\n // If it's the same, remove it from the map.\n // This allows us to avoid onAdaptation_() when nothing has changed.\n delete streamsByType[type];\n }\n }\n\n if (shaka.util.MapUtils.empty(streamsByType)) {\n // There's nothing to change.\n return;\n }\n\n if (!this.streamingEngine_) {\n // There's no way to change it.\n return;\n }\n\n for (var type in streamsByType) {\n var clearBuffer = opt_clearBuffer || false;\n this.streamingEngine_.switch(type, streamsByType[type], clearBuffer);\n }\n this.onAdaptation_();\n};\n\n\n/**\n * Dispatches a 'adaptation' event.\n * @private\n */\nshaka.Player.prototype.onAdaptation_ = function() {\n // In the next frame, dispatch a 'adaptation' event.\n // This gives StreamingEngine time to absorb the changes before the user\n // tries to query them.\n Promise.resolve().then(function() {\n if (this.destroyed_) return;\n var event = new shaka.util.FakeEvent('adaptation');\n this.dispatchEvent(event);\n }.bind(this));\n};\n\n\n/**\n * Dispatches a 'trackschanged' event.\n * @private\n */\nshaka.Player.prototype.onTracksChanged_ = function() {\n // In the next frame, dispatch a 'trackschanged' event.\n // This gives StreamingEngine time to absorb the changes before the user\n // tries to query them.\n Promise.resolve().then(function() {\n if (this.destroyed_) return;\n var event = new shaka.util.FakeEvent('trackschanged');\n this.dispatchEvent(event);\n }.bind(this));\n};\n\n\n/** @private */\nshaka.Player.prototype.onTextTrackVisibility_ = function() {\n var event = new shaka.util.FakeEvent('texttrackvisibility');\n this.dispatchEvent(event);\n};\n\n\n/**\n * @param {!shaka.util.Error} error\n * @private\n */\nshaka.Player.prototype.onError_ = function(error) {\n // Errors dispatched after destroy is called are irrelevant.\n if (this.destroyed_) return;\n\n goog.asserts.assert(error instanceof shaka.util.Error, 'Wrong error type!');\n\n var event = new shaka.util.FakeEvent('error', { 'detail': error });\n this.dispatchEvent(event);\n};\n\n\n/**\n * @param {shakaExtern.TimelineRegionInfo} region\n * @private\n */\nshaka.Player.prototype.onTimelineRegionAdded_ = function(region) {\n if (this.playheadObserver_) {\n this.playheadObserver_.addTimelineRegion(region);\n } else {\n this.pendingTimelineRegions_.push(region);\n }\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.Player.prototype.onEvent_ = function(event) {\n this.dispatchEvent(event);\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.Player.prototype.onVideoError_ = function(event) {\n if (!this.video_.error) return;\n\n var code = this.video_.error.code;\n if (code == 1 /* MEDIA_ERR_ABORTED */) {\n // Ignore this error code, which should only occur when navigating away or\n // deliberately stopping playback of HTTP content.\n return;\n }\n\n // Extra error information from MS Edge and IE11:\n var extended = this.video_.error.msExtendedCode;\n if (extended) {\n // Convert to unsigned:\n if (extended < 0) {\n extended += Math.pow(2, 32);\n }\n // Format as hex:\n extended = extended.toString(16);\n }\n\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.VIDEO_ERROR,\n code, extended));\n};\n\n\n/**\n * @param {!Object.<string, string>} keyStatusMap A map of hex key IDs to\n * statuses.\n * @private\n */\nshaka.Player.prototype.onKeyStatus_ = function(keyStatusMap) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n goog.asserts.assert(this.streamingEngine_, 'Should have been initialized.');\n // 'usable', 'released', 'output-downscaled', 'status-pending' are statuses\n // of the usable keys.\n // 'expired' status is being handled separately in DrmEngine.\n var restrictedStatuses = ['output-restricted', 'internal-error'];\n\n var period = this.streamingEngine_.getCurrentPeriod();\n var tracksChanged = false;\n\n period.variants.forEach(function(variant) {\n var streams = [];\n if (variant.audio) streams.push(variant.audio);\n if (variant.video) streams.push(variant.video);\n\n streams.forEach(function(stream) {\n var originalAllowed = variant.allowedByKeySystem;\n\n // Only update if we have a key ID for the stream. If the key isn't\n // present, then we don't have that key and it should be restricted.\n if (stream.keyId) {\n var keyStatus = keyStatusMap[stream.keyId];\n variant.allowedByKeySystem =\n !!keyStatus && restrictedStatuses.indexOf(keyStatus) < 0;\n }\n\n if (originalAllowed != variant.allowedByKeySystem) {\n tracksChanged = true;\n }\n });\n });\n\n var activeStreams = this.streamingEngine_.getActiveStreams();\n var activeVariant = shaka.util.StreamUtils.getVariantByStreams(\n activeStreams[ContentType.AUDIO], activeStreams[ContentType.VIDEO],\n period.variants);\n if (activeVariant && !activeVariant.allowedByKeySystem) {\n shaka.log.debug('Choosing new streams after key status changed');\n this.chooseStreamsAndSwitch_(period);\n }\n\n if (tracksChanged)\n this.onTracksChanged_();\n};\n\n\n/**\n * Callback from DrmEngine\n * @param {string} keyId\n * @param {number} expiration\n * @private\n */\nshaka.Player.prototype.onExpirationUpdated_ = function(keyId, expiration) {\n if (this.parser_ && this.parser_.onExpirationUpdated)\n this.parser_.onExpirationUpdated(keyId, expiration);\n\n var event = new shaka.util.FakeEvent('expirationupdated');\n this.dispatchEvent(event);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/player.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastReceiver');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.cast.CastUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.IDestroyable');\n\n\n\n/**\n * A receiver to communicate between the Chromecast-hosted player and the\n * sender application.\n *\n * @constructor\n * @struct\n * @param {!HTMLMediaElement} video The local video element associated with the\n * local Player instance.\n * @param {!shaka.Player} player A local Player instance.\n * @param {function(Object)=} opt_appDataCallback A callback to handle\n * application-specific data passed from the sender.\n * @param {function(string):string=} opt_contentIdCallback A callback to\n * retrieve manifest URI from the provided content id.\n * @implements {shaka.util.IDestroyable}\n * @extends {shaka.util.FakeEventTarget}\n * @export\n */\nshaka.cast.CastReceiver =\n function(video, player, opt_appDataCallback, opt_contentIdCallback) {\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {shaka.Player} */\n this.player_ = player;\n\n /** @private {Object} */\n this.targets_ = {\n 'video': video,\n 'player': player\n };\n\n /** @private {?function(Object)} */\n this.appDataCallback_ = opt_appDataCallback || function() {};\n\n /** @private {?function(string):string} */\n this.opt_contentIdCallback_ = opt_contentIdCallback ||\n /** @param {string} contentId\n @return {string} */\n function(contentId) { return contentId; };\n\n /** @private {boolean} */\n this.isConnected_ = false;\n\n /** @private {boolean} */\n this.isIdle_ = true;\n\n /** @private {cast.receiver.CastMessageBus} */\n this.shakaBus_ = null;\n\n /** @private {cast.receiver.CastMessageBus} */\n this.genericBus_ = null;\n\n /** @private {?number} */\n this.pollTimerId_ = null;\n\n this.init_();\n};\ngoog.inherits(shaka.cast.CastReceiver, shaka.util.FakeEventTarget);\n\n\n/**\n * @return {boolean} True if the cast API is available and there are receivers.\n * @export\n */\nshaka.cast.CastReceiver.prototype.isConnected = function() {\n return this.isConnected_;\n};\n\n\n/**\n * @return {boolean} True if the receiver is not currently doing loading or\n * playing anything.\n * @export\n */\nshaka.cast.CastReceiver.prototype.isIdle = function() {\n return this.isIdle_;\n};\n\n\n/**\n * Destroys the underlying Player, then terminates the cast receiver app.\n *\n * @override\n * @export\n */\nshaka.cast.CastReceiver.prototype.destroy = function() {\n var p = this.player_ ? this.player_.destroy() : Promise.resolve();\n\n if (this.pollTimerId_ != null) {\n window.clearTimeout(this.pollTimerId_);\n }\n\n this.video_ = null;\n this.player_ = null;\n this.targets_ = null;\n this.appDataCallback_ = null;\n this.isConnected_ = false;\n this.isIdle_ = true;\n this.shakaBus_ = null;\n this.genericBus_ = null;\n this.pollTimerId_ = null;\n\n return p.then(function() {\n var manager = cast.receiver.CastReceiverManager.getInstance();\n manager.stop();\n });\n};\n\n\n/** @private */\nshaka.cast.CastReceiver.prototype.init_ = function() {\n var manager = cast.receiver.CastReceiverManager.getInstance();\n manager.onSenderConnected = this.onSendersChanged_.bind(this);\n manager.onSenderDisconnected = this.onSendersChanged_.bind(this);\n manager.onSystemVolumeChanged = this.fakeVolumeChangeEvent_.bind(this);\n\n this.genericBus_ = manager.getCastMessageBus(\n shaka.cast.CastUtils.GENERIC_MESSAGE_NAMESPACE);\n this.genericBus_.onMessage = this.onGenericMessage_.bind(this);\n\n this.shakaBus_ = manager.getCastMessageBus(\n shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE);\n this.shakaBus_.onMessage = this.onShakaMessage_.bind(this);\n\n if (!COMPILED) {\n // Sometimes it is useful to load the receiver app in Chrome to work on the\n // UI. To avoid log spam caused by the SDK trying to connect to web sockets\n // that don't exist, in uncompiled mode we check if the hosting browser is a\n // Chromecast before starting the receiver manager. We wouldn't do browser\n // detection except for debugging, so only do this in uncompiled mode.\n var isChromecast = navigator.userAgent.indexOf('CrKey') >= 0;\n if (isChromecast) {\n manager.start();\n }\n } else {\n manager.start();\n }\n\n shaka.cast.CastUtils.VideoEvents.forEach(function(name) {\n this.video_.addEventListener(name, this.proxyEvent_.bind(this, 'video'));\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerEvents.forEach(function(name) {\n this.player_.addEventListener(name, this.proxyEvent_.bind(this, 'player'));\n }.bind(this));\n\n // In our tests, the original Chromecast seems to have trouble decoding above\n // 1080p. It would be a waste to select a higher res anyway, given that the\n // device only outputs 1080p to begin with.\n\n // Chromecast has an extension to query the device/display's resolution.\n if (cast.__platform__ && cast.__platform__.canDisplayType(\n 'video/mp4; codecs=\"avc1.640028\"; width=3840; height=2160')) {\n // The device & display can both do 4k. Assume a 4k limit.\n this.player_.setMaxHardwareResolution(3840, 2160);\n } else {\n // Chromecast has always been able to do 1080p. Assume a 1080p limit.\n this.player_.setMaxHardwareResolution(1920, 1080);\n }\n\n // Maintain idle state.\n this.player_.addEventListener('loading', function() {\n // No longer idle once loading. This allows us to show the spinner during\n // the initial buffering phase.\n this.isIdle_ = false;\n this.onCastStatusChanged_();\n }.bind(this));\n this.video_.addEventListener('playing', function() {\n // No longer idle once playing. This allows us to replay a video without\n // reloading.\n this.isIdle_ = false;\n this.onCastStatusChanged_();\n }.bind(this));\n this.video_.addEventListener('pause', function() {\n this.onCastStatusChanged_();\n }.bind(this));\n this.player_.addEventListener('unloading', function() {\n // Go idle when unloading content.\n this.isIdle_ = true;\n this.onCastStatusChanged_();\n }.bind(this));\n this.video_.addEventListener('ended', function() {\n // Go idle 5 seconds after 'ended', assuming we haven't started again or\n // been destroyed.\n window.setTimeout(function() {\n if (this.video_ && this.video_.ended) {\n this.isIdle_ = true;\n this.onCastStatusChanged_();\n }\n }.bind(this), 5000);\n }.bind(this));\n\n // Do not start polling until after the sender's 'init' message is handled.\n};\n\n\n/** @private */\nshaka.cast.CastReceiver.prototype.onSendersChanged_ = function() {\n var manager = cast.receiver.CastReceiverManager.getInstance();\n this.isConnected_ = manager.getSenders().length != 0;\n this.onCastStatusChanged_();\n};\n\n\n/**\n * Dispatch an event to notify the receiver app that the status has changed.\n * @private\n */\nshaka.cast.CastReceiver.prototype.onCastStatusChanged_ = function() {\n // Do this asynchronously so that synchronous changes to idle state (such as\n // Player calling unload() as part of load()) are coalesced before the event\n // goes out.\n Promise.resolve().then(function() {\n var event = new shaka.util.FakeEvent('caststatuschanged');\n this.dispatchEvent(event);\n this.sendMediaStatus_(0);\n }.bind(this));\n};\n\n\n/**\n * Take on initial state from the sender.\n * @param {shaka.cast.CastUtils.InitStateType} initState\n * @param {Object} appData\n * @private\n */\nshaka.cast.CastReceiver.prototype.initState_ = function(initState, appData) {\n // Take on player state first.\n for (var k in initState['player']) {\n var v = initState['player'][k];\n // All player state vars are setters to be called.\n /** @type {Object} */(this.player_)[k](v);\n }\n\n // Now process custom app data, which may add additional player configs:\n this.appDataCallback_(appData);\n\n var manifestReady = Promise.resolve();\n var autoplay = this.video_.autoplay;\n\n // Now load the manifest, if present.\n if (initState['manifest']) {\n // Don't autoplay the content until we finish setting up initial state.\n this.video_.autoplay = false;\n manifestReady = this.player_.load(\n initState['manifest'], initState['startTime']);\n // Pass any errors through to the app.\n manifestReady.catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong error type!');\n var event = new shaka.util.FakeEvent('error', { 'detail': error });\n this.player_.dispatchEvent(event);\n }.bind(this));\n }\n\n // Finally, take on video state and player's \"after load\" state.\n manifestReady.then(function() {\n for (var k in initState['video']) {\n var v = initState['video'][k];\n this.video_[k] = v;\n }\n\n for (var k in initState['playerAfterLoad']) {\n var v = initState['playerAfterLoad'][k];\n // All player state vars are setters to be called.\n /** @type {Object} */(this.player_)[k](v);\n }\n\n // Restore original autoplay setting.\n this.video_.autoplay = autoplay;\n if (initState['manifest']) {\n // Resume playback with transferred state.\n this.video_.play();\n // Notify generic controllers of the state change.\n this.sendMediaStatus_(0);\n }\n }.bind(this));\n};\n\n\n/**\n * @param {string} targetName\n * @param {!Event} event\n * @private\n */\nshaka.cast.CastReceiver.prototype.proxyEvent_ = function(targetName, event) {\n // Poll and send an update right before we send the event. Some events\n // indicate an attribute change, so that change should be visible when the\n // event is handled.\n this.pollAttributes_();\n\n this.sendMessage_({\n 'type': 'event',\n 'targetName': targetName,\n 'event': event\n }, this.shakaBus_);\n};\n\n\n/** @private */\nshaka.cast.CastReceiver.prototype.pollAttributes_ = function() {\n // The poll timer may have been pre-empted by an event.\n // To avoid polling too often, we clear it here.\n if (this.pollTimerId_ != null) {\n window.clearTimeout(this.pollTimerId_);\n }\n // Since we know the timer has been cleared, start a new one now.\n // This will be preempted by events, including 'timeupdate'.\n this.pollTimerId_ = window.setTimeout(this.pollAttributes_.bind(this), 500);\n\n var update = {\n 'video': {},\n 'player': {}\n };\n\n shaka.cast.CastUtils.VideoAttributes.forEach(function(name) {\n update['video'][name] = this.video_[name];\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerGetterMethods.forEach(function(name) {\n update['player'][name] = /** @type {Object} */(this.player_)[name]();\n }.bind(this));\n\n // Volume attributes are tied to the system volume.\n var manager = cast.receiver.CastReceiverManager.getInstance();\n var systemVolume = manager.getSystemVolume();\n if (systemVolume) {\n update['video']['volume'] = systemVolume.level;\n update['video']['muted'] = systemVolume.muted;\n }\n\n this.sendMessage_({\n 'type': 'update',\n 'update': update\n }, this.shakaBus_);\n};\n\n\n/**\n * Dispatch a fake 'volumechange' event to mimic the video element, since volume\n * changes are routed to the system volume on the receiver.\n * @private\n */\nshaka.cast.CastReceiver.prototype.fakeVolumeChangeEvent_ = function() {\n // Volume attributes are tied to the system volume.\n var manager = cast.receiver.CastReceiverManager.getInstance();\n var systemVolume = manager.getSystemVolume();\n goog.asserts.assert(systemVolume, 'System volume should not be null!');\n\n if (systemVolume) {\n // Send an update message with just the latest volume level and muted state.\n this.sendMessage_({\n 'type': 'update',\n 'update': {\n 'video': {\n 'volume': systemVolume.level,\n 'muted': systemVolume.muted\n }\n }\n }, this.shakaBus_);\n }\n\n // Send another message with a 'volumechange' event to update the sender's UI.\n this.sendMessage_({\n 'type': 'event',\n 'targetName': 'video',\n 'event': {'type': 'volumechange'}\n }, this.shakaBus_);\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages are\n * read with quoted properties.\n * @param {cast.receiver.CastMessageBus.Event} event\n * @private\n */\nshaka.cast.CastReceiver.prototype.onShakaMessage_ = function(event) {\n var message = shaka.cast.CastUtils.deserialize(event.data);\n shaka.log.debug('CastReceiver: message', message);\n\n switch (message['type']) {\n case 'init':\n this.initState_(message['initState'], message['appData']);\n // The sender is supposed to reflect the cast system volume after\n // connecting. Using fakeVolumeChangeEvent_() would create a race on the\n // sender side, since it would have volume properties, but no others.\n // This would lead to hasRemoteProperties() being true, even though a\n // complete set had never been sent.\n // Now that we have init state, this is a good time for the first update\n // message anyway.\n this.pollAttributes_();\n break;\n case 'appData':\n this.appDataCallback_(message['appData']);\n break;\n case 'set':\n var targetName = message['targetName'];\n var property = message['property'];\n var value = message['value'];\n\n if (targetName == 'video') {\n // Volume attributes must be rerouted to the system.\n var manager = cast.receiver.CastReceiverManager.getInstance();\n if (property == 'volume') {\n manager.setSystemVolumeLevel(value);\n break;\n } else if (property == 'muted') {\n manager.setSystemVolumeMuted(value);\n break;\n }\n }\n\n this.targets_[targetName][property] = value;\n break;\n case 'call':\n var targetName = message['targetName'];\n var methodName = message['methodName'];\n var args = message['args'];\n var target = this.targets_[targetName];\n target[methodName].apply(target, args);\n break;\n case 'asyncCall':\n var targetName = message['targetName'];\n var methodName = message['methodName'];\n var args = message['args'];\n var id = message['id'];\n var senderId = event.senderId;\n var target = this.targets_[targetName];\n var p = target[methodName].apply(target, args);\n // Replies must go back to the specific sender who initiated, so that we\n // don't have to deal with conflicting IDs between senders.\n p.then(this.sendAsyncComplete_.bind(this, senderId, id, /* error */ null),\n this.sendAsyncComplete_.bind(this, senderId, id));\n break;\n }\n};\n\n\n/**\n * @param {cast.receiver.CastMessageBus.Event} event\n * @private\n */\nshaka.cast.CastReceiver.prototype.onGenericMessage_ = function(event) {\n var message = shaka.cast.CastUtils.deserialize(event.data);\n shaka.log.debug('CastReceiver: message', message);\n // TODO(ismena): error message on duplicate request id from the same sender\n switch (message['type']) {\n case 'PLAY':\n this.video_.play();\n // Notify generic controllers that the player state changed.\n // requestId=0 (the parameter) means that the message was not\n // triggered by a GET_STATUS request.\n this.sendMediaStatus_(0);\n break;\n case 'PAUSE':\n this.video_.pause();\n this.sendMediaStatus_(0);\n break;\n case 'SEEK':\n var currentTime = message['currentTime'];\n var resumeState = message['resumeState'];\n if (currentTime != null)\n this.video_.currentTime = Number(currentTime);\n if (resumeState && resumeState == 'PLAYBACK_START') {\n this.video_.play();\n this.sendMediaStatus_(0);\n } else if (resumeState && resumeState == 'PLAYBACK_PAUSE') {\n this.video_.pause();\n this.sendMediaStatus_(0);\n }\n break;\n case 'STOP':\n this.player_.unload().then(function() {\n this.sendMediaStatus_(0);\n }.bind(this));\n break;\n case 'GET_STATUS':\n // TODO(ismena): According to the SDK this is supposed to be a\n // unicast message to the sender that requested the status,\n // but it doesn't appear to be working.\n // Look into what's going on there and change this to be a\n // unicast.\n this.sendMediaStatus_(Number(message['requestId']));\n break;\n case 'VOLUME':\n var volumeObject = message['volume'];\n var level = volumeObject['level'];\n var muted = volumeObject['muted'];\n var oldVolumeLevel = this.video_.volume;\n var oldVolumeMuted = this.video_.muted;\n if (level != null)\n this.video_.volume = Number(level);\n if (muted != null)\n this.video_.muted = muted;\n // Notify generic controllers if the volume changed.\n if (oldVolumeLevel != this.video_.volume ||\n oldVolumeMuted != this.video_.muted) {\n this.sendMediaStatus_(0);\n }\n break;\n case 'LOAD':\n var mediaInfo = message['media'];\n var contentId = mediaInfo['contentId'];\n var currentTime = message['currentTime'];\n var manifestUri = this.opt_contentIdCallback_(contentId);\n var autoplay = message['autoplay'] || true;\n if (autoplay)\n this.video_.autoplay = true;\n this.player_.load(manifestUri, currentTime).then(function() {\n // Notify generic controllers that the media has changed.\n var media = {\n 'contentId': manifestUri,\n 'streamType': this.player_.isLive() ? 'LIVE' : 'BUFFERED',\n // TODO: Is there a use case when this would be required?\n // Sending an empty string for now since it's a mandatory\n // field.\n 'contentType': ''\n };\n this.sendMediaStatus_(0, media);\n }.bind(this)).catch(function(error) {\n // Load failed. Dispatch the error message to the sender.\n var type = 'LOAD_FAILED';\n if (error.category == shaka.util.Error.Category.PLAYER &&\n error.code == shaka.util.Error.Code.LOAD_INTERRUPTED) {\n type = 'LOAD_CANCELLED';\n }\n\n this.sendMessage_({\n 'requestId': Number(message['requestId']),\n 'type': type\n }, this.genericBus_);\n }.bind(this));\n break;\n default:\n shaka.log.warning(\n 'Unrecognized message type from the generic Chromecast controller!',\n message['type']);\n // Dispatch an error to the sender.\n this.sendMessage_({\n 'requestId': Number(message['requestId']),\n 'type': 'INVALID_REQUEST',\n 'reason': 'INVALID_COMMAND'\n }, this.genericBus_);\n break;\n }\n};\n\n\n/**\n * Tell the sender that the async operation is complete.\n * @param {string} senderId\n * @param {string} id\n * @param {shaka.util.Error} error\n * @private\n */\nshaka.cast.CastReceiver.prototype.sendAsyncComplete_ =\n function(senderId, id, error) {\n this.sendMessage_({\n 'type': 'asyncComplete',\n 'id': id,\n 'error': error\n }, this.shakaBus_, senderId);\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages passed\n * in here were created with quoted property names.\n * @param {!Object} message\n * @param {cast.receiver.CastMessageBus} bus\n * @param {string=} opt_senderId\n * @private\n */\nshaka.cast.CastReceiver.prototype.sendMessage_ =\n function(message, bus, opt_senderId) {\n // Cuts log spam when debugging the receiver UI in Chrome.\n if (!this.isConnected_) return;\n\n var serialized = shaka.cast.CastUtils.serialize(message);\n if (opt_senderId) {\n bus.getCastChannel(opt_senderId).send(serialized);\n } else {\n bus.broadcast(serialized);\n }\n};\n\n\n/**\n * @return {string}\n * @private\n */\nshaka.cast.CastReceiver.prototype.getPlayState_ = function() {\n var playState = shaka.cast.CastReceiver.PLAY_STATE;\n if (this.isIdle_)\n return playState.IDLE;\n else if (this.player_.isBuffering())\n return playState.BUFFERING;\n else if (this.video_.paused)\n return playState.PAUSED;\n else\n return playState.PLAYING;\n};\n\n\n/**\n * @param {number} requestId\n * @param {Object=} opt_media\n * @private\n */\nshaka.cast.CastReceiver.prototype.sendMediaStatus_ =\n function(requestId, opt_media) {\n var mediaStatus = {\n // mediaSessionId is a unique ID for the playback of this specific session.\n // It's used to identify a specific instance of a playback.\n // We don't support multiple playbacks, so just return 0.\n 'mediaSessionId': 0,\n 'playbackRate': this.video_.playbackRate,\n 'playerState': this.getPlayState_(),\n 'currentTime': this.video_.currentTime,\n // supportedMediaCommands is a sum of all the flags of commands that the\n // player supports.\n // The list of comands with respective flags is:\n // 1 - Pause\n // 2 - Seek\n // 4 - Stream volume\n // 8 - Stream mute\n // 16 - Skip forward\n // 32 - Skip backward\n // We support pause, seek, volume and mute which gives a value of\n // 1+2+4+8=15\n 'supportedMediaCommands': 15,\n 'volume': {\n 'level': this.video_.volume,\n 'muted': this.video_.muted\n }\n };\n\n if (opt_media)\n mediaStatus['media'] = opt_media;\n\n var ret = {\n 'requestId': requestId,\n 'type': 'MEDIA_STATUS',\n 'status': [mediaStatus]\n };\n\n this.sendMessage_(ret, this.genericBus_);\n};\n\n\n/**\n * @enum {string}\n */\nshaka.cast.CastReceiver.PLAY_STATE = {\n IDLE: 'IDLE',\n PLAYING: 'PLAYING',\n BUFFERING: 'BUFFERING',\n PAUSED: 'PAUSED'\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_receiver.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.XmlUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\n\n\n/**\n * @namespace shaka.util.XmlUtils\n * @summary A set of XML utility functions.\n */\n\n\n/**\n * Finds a child XML element.\n * @param {!Element} elem The parent XML element.\n * @param {string} name The child XML element's tag name.\n * @return {Element} The child XML element, or null if a child XML element does\n * not exist with the given tag name OR if there exists more than one\n * child XML element with the given tag name.\n */\nshaka.util.XmlUtils.findChild = function(elem, name) {\n var children = shaka.util.XmlUtils.findChildren(elem, name);\n if (children.length != 1)\n return null;\n return children[0];\n};\n\n\n/**\n * Finds child XML elements.\n * @param {!Element} elem The parent XML element.\n * @param {string} name The child XML element's tag name.\n * @return {!Array.<!Element>} The child XML elements.\n */\nshaka.util.XmlUtils.findChildren = function(elem, name) {\n return Array.prototype.filter.call(elem.childNodes, function(child) {\n goog.asserts.assert(\n child.tagName != name || child instanceof Element,\n 'child element should be an Element');\n return child.tagName == name;\n });\n};\n\n\n/**\n * Gets the text contents of a node.\n * @param {!Element} elem The XML element.\n * @return {?string} The text contents, or null if there are none.\n */\nshaka.util.XmlUtils.getContents = function(elem) {\n var contents = elem.firstChild;\n\n // check content\n if (!contents || contents.nodeType != Node.TEXT_NODE)\n return null;\n\n // read merged text content from all text nodes (fixes MSIE 11 bug)\n return elem.textContent.trim();\n};\n\n\n/**\n * Parses an attribute by its name.\n * @param {!Element} elem The XML element.\n * @param {string} name The attribute name.\n * @param {function(string): (T|null)} parseFunction A function that parses\n * the attribute.\n * @param {(T|null)=} opt_defaultValue The attribute's default value, if not\n * specified, the attibute's default value is null.\n * @return {(T|null)} The parsed attribute on success, or the attribute's\n * default value if the attribute does not exist or could not be parsed.\n * @template T\n */\nshaka.util.XmlUtils.parseAttr = function(\n elem, name, parseFunction, opt_defaultValue) {\n var parsedValue = null;\n\n var value = elem.getAttribute(name);\n if (value != null)\n parsedValue = parseFunction(value);\n\n if (parsedValue == null)\n return opt_defaultValue != undefined ? opt_defaultValue : null;\n\n return parsedValue;\n};\n\n\n/**\n * Parses an XML date string.\n * @param {string} dateString\n * @return {?number} The parsed date in seconds on success; otherwise, return\n * null.\n */\nshaka.util.XmlUtils.parseDate = function(dateString) {\n if (!dateString)\n return null;\n\n var result = Date.parse(dateString);\n return (!isNaN(result) ? Math.floor(result / 1000.0) : null);\n};\n\n\n/**\n * Parses an XML duration string.\n * Negative values are not supported. Years and months are treated as exactly\n * 365 and 30 days respectively.\n * @param {string} durationString The duration string, e.g., \"PT1H3M43.2S\",\n * which means 1 hour, 3 minutes, and 43.2 seconds.\n * @return {?number} The parsed duration in seconds on success; otherwise,\n * return null.\n * @see {@link http://www.datypic.com/sc/xsd/t-xsd_duration.html}\n */\nshaka.util.XmlUtils.parseDuration = function(durationString) {\n if (!durationString)\n return null;\n\n var re = '^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?' +\n '(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$';\n var matches = new RegExp(re).exec(durationString);\n\n if (!matches) {\n shaka.log.warning('Invalid duration string:', durationString);\n return null;\n }\n\n // Note: Number(null) == 0 but Number(undefined) == NaN.\n var years = Number(matches[1] || null);\n var months = Number(matches[2] || null);\n var days = Number(matches[3] || null);\n var hours = Number(matches[4] || null);\n var minutes = Number(matches[5] || null);\n var seconds = Number(matches[6] || null);\n\n // Assume a year always has 365 days and a month always has 30 days.\n var d = (60 * 60 * 24 * 365) * years +\n (60 * 60 * 24 * 30) * months +\n (60 * 60 * 24) * days +\n (60 * 60) * hours +\n 60 * minutes +\n seconds;\n return isFinite(d) ? d : null;\n};\n\n\n/**\n * Parses a range string.\n * @param {string} rangeString The range string, e.g., \"101-9213\".\n * @return {?{start: number, end: number}} The parsed range on success;\n * otherwise, return null.\n */\nshaka.util.XmlUtils.parseRange = function(rangeString) {\n var matches = /([0-9]+)-([0-9]+)/.exec(rangeString);\n\n if (!matches)\n return null;\n\n var start = Number(matches[1]);\n if (!isFinite(start))\n return null;\n\n var end = Number(matches[2]);\n if (!isFinite(end))\n return null;\n\n return {start: start, end: end};\n};\n\n\n/**\n * Parses an integer.\n * @param {string} intString The integer string.\n * @return {?number} The parsed integer on success; otherwise, return null.\n */\nshaka.util.XmlUtils.parseInt = function(intString) {\n var n = Number(intString);\n return (n % 1 === 0) ? n : null;\n};\n\n\n/**\n * Parses a positive integer.\n * @param {string} intString The integer string.\n * @return {?number} The parsed positive integer on success; otherwise,\n * return null.\n */\nshaka.util.XmlUtils.parsePositiveInt = function(intString) {\n var n = Number(intString);\n return (n % 1 === 0) && (n > 0) ? n : null;\n};\n\n\n/**\n * Parses a non-negative integer.\n * @param {string} intString The integer string.\n * @return {?number} The parsed non-negative integer on success; otherwise,\n * return null.\n */\nshaka.util.XmlUtils.parseNonNegativeInt = function(intString) {\n var n = Number(intString);\n return (n % 1 === 0) && (n >= 0) ? n : null;\n};\n\n\n/**\n * Parses a floating point number.\n * @param {string} floatString The floating point number string.\n * @return {?number} The parsed floating point number on success; otherwise,\n * return null. May return -Infinity or Infinity.\n */\nshaka.util.XmlUtils.parseFloat = function(floatString) {\n var n = Number(floatString);\n return !isNaN(n) ? n : null;\n};\n\n\n/**\n * Evaluate a division expressed as a string\n * @param {string} exprString\n * The expression to evaluate, e.g. \"200/2\". Can also be a single number\n * @return {?number} The evaluated expression as floating point number on\n * success; otherwise return null.\n */\nshaka.util.XmlUtils.evalDivision = function(exprString) {\n var res;\n var n;\n if (res = exprString.match(/^(\\d+)\\/(\\d+)$/)) {\n n = Number(res[1] / res[2]);\n } else {\n n = Number(exprString);\n }\n return !isNaN(n) ? n : null;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/xml_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.ContentProtection');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.Uint8ArrayUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.ContentProtection\n * @summary A set of functions for parsing and interpreting ContentProtection\n * elements.\n */\n\n\n/**\n * @typedef {{\n * defaultKeyId: ?string,\n * defaultInit: Array.<shakaExtern.InitDataOverride>,\n * drmInfos: !Array.<shakaExtern.DrmInfo>,\n * firstRepresentation: boolean\n * }}\n *\n * @description\n * Contains information about the ContentProtection elements found at the\n * AdaptationSet level.\n *\n * @property {?string} defaultKeyId\n * The default key ID to use. This is used by parseKeyIds as a default. This\n * can be null to indicate that there is no default.\n * @property {Array.<shakaExtern.InitDataOverride>} defaultInit\n * The default init data override. This can be null to indicate that there\n * is no default.\n * @property {!Array.<shakaExtern.DrmInfo>} drmInfos\n * The DrmInfo objects.\n * @property {boolean} firstRepresentation\n * True when first parsed; changed to false after the first call to\n * parseKeyIds. This is used to determine if a dummy key-system should be\n * overwritten; namely that the first representation can replace the dummy\n * from the AdaptationSet.\n */\nshaka.dash.ContentProtection.Context;\n\n\n/**\n * @typedef {{\n * node: !Element,\n * schemeUri: string,\n * keyId: ?string,\n * init: Array.<shakaExtern.InitDataOverride>\n * }}\n *\n * @description\n * The parsed result of a single ContentProtection element.\n *\n * @property {!Element} node\n * The ContentProtection XML element.\n * @property {string} schemeUri\n * The scheme URI.\n * @property {?string} keyId\n * The default key ID, if present.\n * @property {Array.<shakaExtern.InitDataOverride>} init\n * The init data, if present. If there is no init data, it will be null. If\n * this is non-null, there is at least one element.\n */\nshaka.dash.ContentProtection.Element;\n\n\n/**\n * A map of scheme URI to key system name.\n *\n * @const {!Object.<string, string>}\n * @private\n */\nshaka.dash.ContentProtection.defaultKeySystems_ = {\n 'urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b': 'org.w3.clearkey',\n 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed': 'com.widevine.alpha',\n 'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95': 'com.microsoft.playready',\n 'urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb': 'com.adobe.primetime'\n};\n\n\n/**\n * @const {string}\n * @private\n */\nshaka.dash.ContentProtection.MP4Protection_ =\n 'urn:mpeg:dash:mp4protection:2011';\n\n\n/**\n * Parses info from the ContentProtection elements at the AdaptationSet level.\n *\n * @param {!Array.<!Element>} elems\n * @param {shakaExtern.DashContentProtectionCallback} callback\n * @param {boolean} ignoreDrmInfo\n * @return {shaka.dash.ContentProtection.Context}\n */\nshaka.dash.ContentProtection.parseFromAdaptationSet = function(\n elems, callback, ignoreDrmInfo) {\n var ContentProtection = shaka.dash.ContentProtection;\n var Functional = shaka.util.Functional;\n var MapUtils = shaka.util.MapUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var parsed = ContentProtection.parseElements_(elems);\n /** @type {Array.<shakaExtern.InitDataOverride>} */\n var defaultInit = null;\n /** @type {?string} */\n var defaultKeyId = null;\n /** @type {!Array.<shakaExtern.DrmInfo>} */\n var drmInfos = [];\n var parsedNonCenc = [];\n\n // Get the default key ID; if there are multiple, they must all match.\n var keyIds = parsed.map(function(elem) { return elem.keyId; })\n .filter(Functional.isNotNull);\n if (keyIds.length > 0) {\n defaultKeyId = keyIds[0];\n if (keyIds.some(Functional.isNotEqualFunc(defaultKeyId))) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_CONFLICTING_KEY_IDS);\n }\n }\n\n if (!ignoreDrmInfo) {\n // Find the default key ID and init data. Create a new array of all the\n // non-CENC elements.\n parsedNonCenc = parsed.filter(function(elem) {\n if (elem.schemeUri == ContentProtection.MP4Protection_) {\n goog.asserts.assert(!elem.init || elem.init.length,\n 'Init data must be null or non-empty.');\n defaultInit = elem.init || defaultInit;\n return false;\n } else {\n return true;\n }\n });\n\n if (parsedNonCenc.length > 0) {\n drmInfos = ContentProtection.convertElements_(\n defaultInit, callback, parsedNonCenc);\n\n // If there are no drmInfos after parsing, then add a dummy entry.\n // This may be removed in parseKeyIds.\n if (drmInfos.length == 0) {\n drmInfos = [ManifestParserUtils.createDrmInfo('', defaultInit)];\n }\n }\n }\n\n // If there are only CENC element(s) or ignoreDrmInfo flag is set, assume all\n // key-systems are supported.\n if (parsed.length > 0 && (ignoreDrmInfo || !parsedNonCenc.length)) {\n var keySystems = ContentProtection.defaultKeySystems_;\n drmInfos =\n MapUtils.values(keySystems)\n .map(function(keySystem) {\n return ManifestParserUtils.createDrmInfo(keySystem, defaultInit);\n });\n }\n\n // attach the default keyId, if it exists, to every initData\n if (defaultKeyId) {\n drmInfos.forEach(function(drmInfo) {\n drmInfo.initData.forEach(function(initData) {\n initData.keyId = defaultKeyId;\n });\n });\n }\n\n return {\n defaultKeyId: defaultKeyId,\n defaultInit: defaultInit,\n drmInfos: drmInfos,\n firstRepresentation: true\n };\n};\n\n\n/**\n * Parses the given ContentProtection elements found at the Representation\n * level. This may update the |context|.\n *\n * @param {!Array.<!Element>} elems\n * @param {shakaExtern.DashContentProtectionCallback} callback\n * @param {shaka.dash.ContentProtection.Context} context\n * @param {boolean} ignoreDrmInfo\n * @return {?string} The parsed key ID\n */\nshaka.dash.ContentProtection.parseFromRepresentation = function(\n elems, callback, context, ignoreDrmInfo) {\n var ContentProtection = shaka.dash.ContentProtection;\n var repContext = ContentProtection.parseFromAdaptationSet(\n elems, callback, ignoreDrmInfo);\n\n if (context.firstRepresentation) {\n var asUnknown = context.drmInfos.length == 1 &&\n !context.drmInfos[0].keySystem;\n var asUnencrypted = context.drmInfos.length == 0;\n var repUnencrypted = repContext.drmInfos.length == 0;\n\n // There are two cases when we need to replace the |drmInfos| in the context\n // with those in the Representation:\n // * The AdaptationSet does not list any ContentProtection.\n // * The AdaptationSet only lists unknown key-systems.\n if (asUnencrypted || (asUnknown && !repUnencrypted)) {\n context.drmInfos = repContext.drmInfos;\n }\n context.firstRepresentation = false;\n } else if (repContext.drmInfos.length > 0) {\n // If this is not the first Representation, then we need to remove entries\n // from the context that do not appear in this Representation.\n context.drmInfos = context.drmInfos.filter(function(asInfo) {\n return repContext.drmInfos.some(function(repInfo) {\n return repInfo.keySystem == asInfo.keySystem;\n });\n });\n // If we have filtered out all key-systems, throw an error.\n if (context.drmInfos.length == 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_COMMON_KEY_SYSTEM);\n }\n }\n\n return repContext.defaultKeyId || context.defaultKeyId;\n};\n\n\n/**\n * Creates DrmInfo objects from the given element.\n *\n * @param {Array.<shakaExtern.InitDataOverride>} defaultInit\n * @param {shakaExtern.DashContentProtectionCallback} callback\n * @param {!Array.<shaka.dash.ContentProtection.Element>} elements\n * @return {!Array.<shakaExtern.DrmInfo>}\n * @private\n */\nshaka.dash.ContentProtection.convertElements_ = function(\n defaultInit, callback, elements) {\n var Functional = shaka.util.Functional;\n return elements.map(\n /**\n * @param {shaka.dash.ContentProtection.Element} element\n * @return {!Array.<shakaExtern.DrmInfo>}\n */\n function(element) {\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var ContentProtection = shaka.dash.ContentProtection;\n var keySystem = ContentProtection.defaultKeySystems_[element.schemeUri];\n if (keySystem) {\n goog.asserts.assert(!element.init || element.init.length,\n 'Init data must be null or non-empty.');\n var initData = element.init || defaultInit;\n return [ManifestParserUtils.createDrmInfo(keySystem, initData)];\n } else {\n goog.asserts.assert(\n callback, 'ContentProtection callback is required');\n return callback(element.node) || [];\n }\n }).reduce(Functional.collapseArrays, []);\n};\n\n\n/**\n * Parses the given ContentProtection elements. If there is an error, it\n * removes those elements.\n *\n * @param {!Array.<!Element>} elems\n * @return {!Array.<shaka.dash.ContentProtection.Element>}\n * @private\n */\nshaka.dash.ContentProtection.parseElements_ = function(elems) {\n var Functional = shaka.util.Functional;\n return elems.map(\n /**\n * @param {!Element} elem\n * @return {?shaka.dash.ContentProtection.Element}\n */\n function(elem) {\n /** @type {?string} */\n var schemeUri = elem.getAttribute('schemeIdUri');\n /** @type {?string} */\n var keyId = elem.getAttribute('cenc:default_KID');\n /** @type {!Array.<string>} */\n var psshs = shaka.util.XmlUtils.findChildren(elem, 'cenc:pssh')\n .map(shaka.util.XmlUtils.getContents);\n\n if (!schemeUri) {\n shaka.log.error('Missing required schemeIdUri attribute on',\n 'ContentProtection element', elem);\n return null;\n }\n\n schemeUri = schemeUri.toLowerCase();\n if (keyId) {\n keyId = keyId.replace(/-/g, '').toLowerCase();\n if (keyId.indexOf(' ') >= 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED);\n }\n }\n\n /** @type {!Array.<shakaExtern.InitDataOverride>} */\n var init = [];\n try {\n init = psshs.map(function(pssh) {\n /** @type {shakaExtern.InitDataOverride} */\n var ret = {\n initDataType: 'cenc',\n initData: shaka.util.Uint8ArrayUtils.fromBase64(pssh),\n keyId: null\n };\n return ret;\n });\n } catch (e) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_PSSH_BAD_ENCODING);\n }\n\n /** @type {shaka.dash.ContentProtection.Element} */\n var element = {\n node: elem,\n schemeUri: schemeUri,\n keyId: keyId,\n init: (init.length > 0 ? init : null)\n };\n return element;\n }).filter(Functional.isNotNull);\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/content_protection.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.MpdUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.MpdUtils\n * @summary MPD processing utility functions.\n */\n\n\n/**\n * @typedef {{\n * start: number,\n * unscaledStart: number,\n * end: number\n * }}\n *\n * @description\n * Defines a time range of a media segment. Times are in seconds.\n *\n * @property {number} start\n * The start time of the range.\n * @property {number} unscaledStart\n * The start time of the range in representation timescale units.\n * @property {number} end\n * The end time (exclusive) of the range.\n */\nshaka.dash.MpdUtils.TimeRange;\n\n\n/**\n * @typedef {{\n * timescale: number,\n * segmentDuration: ?number,\n * startNumber: number,\n * presentationTimeOffset: number,\n * unscaledPresentationTimeOffset: number,\n * timeline: Array.<shaka.dash.MpdUtils.TimeRange>\n * }}\n *\n * @description\n * Contains common information between SegmentList and SegmentTemplate items.\n *\n * @property {number} timescale\n * The time-scale of the representation.\n * @property {?number} segmentDuration\n * The duration of the segments in seconds, if given.\n * @property {number} startNumber\n * The start number of the segments; 1 or greater.\n * @property {number} presentationTimeOffset\n * The presentationTimeOffset of the representation, in seconds.\n * @property {number} unscaledPresentationTimeOffset\n * The presentationTimeOffset of the representation, in timescale units.\n * @property {Array.<shaka.dash.MpdUtils.TimeRange>} timeline\n * The timeline of the representation, if given. Times in seconds.\n */\nshaka.dash.MpdUtils.SegmentInfo;\n\n\n/**\n * Fills a SegmentTemplate URI template. This function does not validate the\n * resulting URI.\n *\n * @param {string} uriTemplate\n * @param {?string} representationId\n * @param {?number} number\n * @param {?number} bandwidth\n * @param {?number} time\n * @return {string} A URI string.\n * @see ISO/IEC 23009-1:2014 section 5.3.9.4.4\n */\nshaka.dash.MpdUtils.fillUriTemplate = function(\n uriTemplate, representationId, number, bandwidth, time) {\n if (time != null) {\n goog.asserts.assert(Math.abs(time - Math.round(time)) < 0.2,\n 'Calculated $Time$ values must be close to integers!');\n time = Math.round(time);\n }\n\n /** @type {!Object.<string, ?number|?string>} */\n var valueTable = {\n 'RepresentationID': representationId,\n 'Number': number,\n 'Bandwidth': bandwidth,\n 'Time': time\n };\n\n var re = /\\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)d)?\\$/g;\n var uri = uriTemplate.replace(re, function(match, name, widthString) {\n if (match == '$$') {\n return '$';\n }\n\n var value = valueTable[name];\n goog.asserts.assert(value !== undefined, 'Unrecognized identifier');\n\n // Note that |value| may be 0 or ''.\n if (value == null) {\n shaka.log.warning(\n 'URL template does not have an available substitution for identifier',\n '\"' + name + '\":',\n uriTemplate);\n return match;\n }\n\n if (name == 'RepresentationID' && widthString) {\n shaka.log.warning(\n 'URL template should not contain a width specifier for identifier',\n '\"RepresentationID\":',\n uriTemplate);\n widthString = undefined;\n }\n\n var valueString = value.toString();\n\n // Create padding string.\n var width = window.parseInt(widthString, 10) || 1;\n var paddingSize = Math.max(0, width - valueString.length);\n var padding = (new Array(paddingSize + 1)).join('0');\n\n return padding + valueString;\n });\n\n return uri;\n};\n\n\n/**\n * Expands a SegmentTimeline into an array-based timeline. The results are in\n * seconds.\n *\n * @param {!Element} segmentTimeline\n * @param {number} timescale\n * @param {number} presentationTimeOffset\n * @param {number} periodDuration The Period's duration in seconds.\n * Infinity indicates that the Period continues indefinitely.\n * @return {!Array.<shaka.dash.MpdUtils.TimeRange>}\n */\nshaka.dash.MpdUtils.createTimeline = function(\n segmentTimeline, timescale, presentationTimeOffset, periodDuration) {\n goog.asserts.assert(\n timescale > 0 && timescale < Infinity,\n 'timescale must be a positive, finite integer');\n goog.asserts.assert(periodDuration > 0,\n 'period duration must be a positive integer');\n\n // Alias.\n var XmlUtils = shaka.util.XmlUtils;\n\n var timePoints = XmlUtils.findChildren(segmentTimeline, 'S');\n\n /** @type {!Array.<shaka.dash.MpdUtils.TimeRange>} */\n var timeline = [];\n var lastEndTime = 0;\n\n for (var i = 0; i < timePoints.length; ++i) {\n var timePoint = timePoints[i];\n var t = XmlUtils.parseAttr(timePoint, 't', XmlUtils.parseNonNegativeInt);\n var d = XmlUtils.parseAttr(timePoint, 'd', XmlUtils.parseNonNegativeInt);\n var r = XmlUtils.parseAttr(timePoint, 'r', XmlUtils.parseInt);\n\n // Adjust start considering the presentation time offset\n if (t != null)\n t -= presentationTimeOffset;\n\n if (!d) {\n shaka.log.warning(\n '\"S\" element must have a duration:',\n 'ignoring the remaining \"S\" elements.',\n timePoint);\n return timeline;\n }\n\n var startTime = t != null ? t : lastEndTime;\n\n var repeat = r || 0;\n if (repeat < 0) {\n if (i + 1 < timePoints.length) {\n var nextTimePoint = timePoints[i + 1];\n var nextStartTime = XmlUtils.parseAttr(\n nextTimePoint, 't', XmlUtils.parseNonNegativeInt);\n if (nextStartTime == null) {\n shaka.log.warning(\n '\"S\" element cannot have a negative repeat',\n 'if the next \"S\" element does not have a valid start time:',\n 'ignoring the remaining \"S\" elements.',\n timePoint);\n return timeline;\n } else if (startTime >= nextStartTime) {\n shaka.log.warning(\n '\"S\" element cannot have a negative repeat',\n 'if its start time exceeds the next \"S\" element\\'s start time:',\n 'ignoring the remaining \"S\" elements.',\n timePoint);\n return timeline;\n }\n repeat = Math.ceil((nextStartTime - startTime) / d) - 1;\n } else {\n if (periodDuration == Infinity) {\n // The DASH spec. actually allows the last \"S\" element to have a\n // negative repeat value even when the Period has an infinite\n // duration. No one uses this feature and no one ever should, ever.\n shaka.log.warning(\n 'The last \"S\" element cannot have a negative repeat',\n 'if the Period has an infinite duration:',\n 'ignoring the last \"S\" element.',\n timePoint);\n return timeline;\n } else if (startTime / timescale >= periodDuration) {\n shaka.log.warning(\n 'The last \"S\" element cannot have a negative repeat',\n 'if its start time exceeds the Period\\'s duration:',\n 'igoring the last \"S\" element.',\n timePoint);\n return timeline;\n }\n repeat = Math.ceil((periodDuration * timescale - startTime) / d) - 1;\n }\n }\n\n // The end of the last segment may end before the start of the current\n // segment (a gap) or may end after the start of the current segment (an\n // overlap). If there is a gap/overlap then stretch/compress the end of\n // the last segment to the start of the current segment.\n //\n // Note: it is possible to move the start of the current segment to the\n // end of the last segment, but this would complicate the computation of\n // the $Time$ placeholder later on.\n if ((timeline.length > 0) && (startTime != lastEndTime)) {\n var delta = startTime - lastEndTime;\n\n if (Math.abs(delta / timescale) >=\n shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS) {\n shaka.log.warning(\n 'SegmentTimeline contains a large gap/overlap:',\n 'the content may have errors in it.',\n timePoint);\n }\n\n timeline[timeline.length - 1].end = startTime / timescale;\n }\n\n for (var j = 0; j <= repeat; ++j) {\n var endTime = startTime + d;\n var item = {\n start: startTime / timescale,\n end: endTime / timescale,\n unscaledStart: startTime\n };\n timeline.push(item);\n\n startTime = endTime;\n lastEndTime = endTime;\n }\n }\n\n return timeline;\n};\n\n\n/**\n * Parses common segment info for SegmentList and SegmentTemplate.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * Gets the element that contains the segment info.\n * @return {shaka.dash.MpdUtils.SegmentInfo}\n */\nshaka.dash.MpdUtils.parseSegmentInfo = function(context, callback) {\n goog.asserts.assert(\n callback(context.representation),\n 'There must be at least one element of the given type.');\n var MpdUtils = shaka.dash.MpdUtils;\n var XmlUtils = shaka.util.XmlUtils;\n\n var timescaleStr = MpdUtils.inheritAttribute(context, callback, 'timescale');\n var timescale = 1;\n if (timescaleStr) {\n timescale = XmlUtils.parsePositiveInt(timescaleStr) || 1;\n }\n\n var durationStr = MpdUtils.inheritAttribute(context, callback, 'duration');\n var segmentDuration = XmlUtils.parsePositiveInt(durationStr || '');\n if (segmentDuration) {\n segmentDuration /= timescale;\n }\n\n var startNumberStr =\n MpdUtils.inheritAttribute(context, callback, 'startNumber');\n var presentationTimeOffset =\n MpdUtils.inheritAttribute(context, callback, 'presentationTimeOffset');\n var startNumber = XmlUtils.parseNonNegativeInt(startNumberStr || '');\n if (startNumberStr == null || startNumber == null)\n startNumber = 1;\n\n var timelineNode =\n MpdUtils.inheritChild(context, callback, 'SegmentTimeline');\n /** @type {Array.<shaka.dash.MpdUtils.TimeRange>} */\n var timeline = null;\n if (timelineNode) {\n timeline = MpdUtils.createTimeline(\n timelineNode, timescale, Number(presentationTimeOffset),\n context.periodInfo.duration || Infinity);\n }\n\n var pto = (Number(presentationTimeOffset) / timescale) || 0;\n return {\n timescale: timescale,\n segmentDuration: segmentDuration,\n startNumber: startNumber,\n presentationTimeOffset: pto,\n unscaledPresentationTimeOffset: Number(presentationTimeOffset),\n timeline: timeline\n };\n};\n\n\n/**\n * Searches the inheritance for a Segment* with the given attribute.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * Gets the Element that contains the attribute to inherit.\n * @param {string} attribute\n * @return {?string}\n */\nshaka.dash.MpdUtils.inheritAttribute = function(context, callback, attribute) {\n var Functional = shaka.util.Functional;\n goog.asserts.assert(\n callback(context.representation),\n 'There must be at least one element of the given type');\n\n /** @type {!Array.<!Element>} */\n var nodes = [\n callback(context.representation),\n callback(context.adaptationSet),\n callback(context.period)\n ].filter(Functional.isNotNull);\n\n return nodes\n .map(function(s) { return s.getAttribute(attribute); })\n .reduce(function(all, part) { return all || part; });\n};\n\n\n/**\n * Searches the inheritance for a Segment* with the given child.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * Gets the Element that contains the child to inherit.\n * @param {string} child\n * @return {Element}\n */\nshaka.dash.MpdUtils.inheritChild = function(context, callback, child) {\n var Functional = shaka.util.Functional;\n goog.asserts.assert(\n callback(context.representation),\n 'There must be at least one element of the given type');\n\n /** @type {!Array.<!Element>} */\n var nodes = [\n callback(context.representation),\n callback(context.adaptationSet),\n callback(context.period)\n ].filter(Functional.isNotNull);\n\n var XmlUtils = shaka.util.XmlUtils;\n return nodes\n .map(function(s) { return XmlUtils.findChild(s, child); })\n .reduce(function(all, part) { return all || part; });\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/mpd_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.InitSegmentReference');\ngoog.provide('shaka.media.SegmentReference');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Creates an InitSegmentReference, which provides the location to an\n * initialization segment.\n *\n * @param {function():!Array.<string>} uris\n * A function that creates the URIs of the resource containing the segment.\n * @param {number} startByte The offset from the start of the resource to the\n * start of the segment.\n * @param {?number} endByte The offset from the start of the resource to the\n * end of the segment, inclusive. null indicates that the segment extends\n * to the end of the resource.\n *\n * @constructor\n * @struct\n * @export\n */\nshaka.media.InitSegmentReference = function(uris, startByte, endByte) {\n /** @type {function():!Array.<string>} */\n this.getUris = uris;\n\n /** @const {number} */\n this.startByte = startByte;\n\n /** @const {?number} */\n this.endByte = endByte;\n};\n\n\n\n/**\n * Creates a SegmentReference, which provides the start time, end time, and\n * location to a media segment.\n *\n * @param {number} position The segment's position within a particular Period.\n * The following should hold true between any two SegmentReferences from the\n * same Period, r1 and r2:\n * IF r2.position > r1.position THEN\n * [ (r2.startTime > r1.startTime) OR\n * (r2.startTime == r1.startTime AND r2.endTime >= r1.endTime) ]\n * @param {number} startTime The segment's start time in seconds, relative to\n * the start of a particular Period.\n * @param {number} endTime The segment's end time in seconds, relative to\n * the start of a particular Period. The segment ends the instant before\n * this time, so |endTime| must be strictly greater than |startTime|.\n * @param {function():!Array.<string>} uris\n * A function that creates the URIs of the resource containing the segment.\n * @param {number} startByte The offset from the start of the resource to the\n * start of the segment.\n * @param {?number} endByte The offset from the start of the resource to the\n * end of the segment, inclusive. null indicates that the segment extends\n * to the end of the resource.\n *\n * @constructor\n * @struct\n * @export\n */\nshaka.media.SegmentReference = function(\n position, startTime, endTime, uris, startByte, endByte) {\n goog.asserts.assert(startTime < endTime,\n 'startTime must be less than endTime');\n goog.asserts.assert((startByte < endByte) || (endByte == null),\n 'startByte must be < endByte');\n /** @const {number} */\n this.position = position;\n\n /** @const {number} */\n this.startTime = startTime;\n\n /** @const {number} */\n this.endTime = endTime;\n\n /** @type {function():!Array.<string>} */\n this.getUris = uris;\n\n /** @const {number} */\n this.startByte = startByte;\n\n /** @const {?number} */\n this.endByte = endByte;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/segment_reference.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.DataViewReader');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\n\n\n\n/**\n * Creates a DataViewReader, which abstracts a DataView object.\n *\n * @param {!DataView} dataView The DataView.\n * @param {shaka.util.DataViewReader.Endianness} endianness The endianness.\n *\n * @struct\n * @constructor\n * @export\n */\nshaka.util.DataViewReader = function(dataView, endianness) {\n /** @private {!DataView} */\n this.dataView_ = dataView;\n\n /** @private {boolean} */\n this.littleEndian_ =\n endianness == shaka.util.DataViewReader.Endianness.LITTLE_ENDIAN;\n\n /** @private {number} */\n this.position_ = 0;\n};\n\n\n/**\n * Endianness.\n * @enum {number}\n * @export\n */\nshaka.util.DataViewReader.Endianness = {\n BIG_ENDIAN: 0,\n LITTLE_ENDIAN: 1\n};\n\n\n/**\n * @return {boolean} True if the reader has more data, false otherwise.\n * @export\n */\nshaka.util.DataViewReader.prototype.hasMoreData = function() {\n return this.position_ < this.dataView_.byteLength;\n};\n\n\n/**\n * Gets the current byte position.\n * @return {number}\n * @export\n */\nshaka.util.DataViewReader.prototype.getPosition = function() {\n return this.position_;\n};\n\n\n/**\n * Gets the byte length of the DataView.\n * @return {number}\n * @export\n */\nshaka.util.DataViewReader.prototype.getLength = function() {\n return this.dataView_.byteLength;\n};\n\n\n/**\n * Reads an unsigned 8 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint8 = function() {\n try {\n var value = this.dataView_.getUint8(this.position_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 1;\n return value;\n};\n\n\n/**\n * Reads an unsigned 16 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint16 = function() {\n try {\n var value = this.dataView_.getUint16(this.position_, this.littleEndian_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 2;\n return value;\n};\n\n\n/**\n * Reads an unsigned 32 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint32 = function() {\n try {\n var value = this.dataView_.getUint32(this.position_, this.littleEndian_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 4;\n return value;\n};\n\n\n/**\n * Reads a signed 32 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readInt32 = function() {\n try {\n var value = this.dataView_.getInt32(this.position_, this.littleEndian_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 4;\n return value;\n};\n\n\n/**\n * Reads an unsigned 64 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view or\n * when reading an integer too large to store accurately in JavaScript.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint64 = function() {\n var low, high;\n\n try {\n if (this.littleEndian_) {\n low = this.dataView_.getUint32(this.position_, true);\n high = this.dataView_.getUint32(this.position_ + 4, true);\n } else {\n high = this.dataView_.getUint32(this.position_, false);\n low = this.dataView_.getUint32(this.position_ + 4, false);\n }\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n\n if (high > 0x1FFFFF) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.JS_INTEGER_OVERFLOW);\n }\n\n this.position_ += 8;\n\n // NOTE: This is subtle, but in JavaScript you can't shift left by 32 and get\n // the full range of 53-bit values possible. You must multiply by 2^32.\n return (high * Math.pow(2, 32)) + low;\n};\n\n\n/**\n * Reads the specified number of raw bytes.\n * @param {number} bytes The number of bytes to read.\n * @return {!Uint8Array}\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readBytes = function(bytes) {\n goog.asserts.assert(bytes > 0, 'Bad call to DataViewReader.readBytes');\n if (this.position_ + bytes > this.dataView_.byteLength) {\n this.throwOutOfBounds_();\n }\n var value = this.dataView_.buffer.slice(\n this.position_, this.position_ + bytes);\n this.position_ += bytes;\n return new Uint8Array(value);\n};\n\n\n/**\n * Skips the specified number of bytes.\n * @param {number} bytes The number of bytes to skip.\n * @throws {shaka.util.Error} when skipping past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.skip = function(bytes) {\n goog.asserts.assert(bytes >= 0, 'Bad call to DataViewReader.skip');\n if (this.position_ + bytes > this.dataView_.byteLength) {\n this.throwOutOfBounds_();\n }\n this.position_ += bytes;\n};\n\n\n/**\n * Keeps reading until it reaches a byte that equals to zero. The text is\n * assumed to be UTF-8.\n * @return {string}\n * @export\n */\nshaka.util.DataViewReader.prototype.readTerminatedString = function() {\n var start = this.position_;\n while (this.hasMoreData()) {\n var value = this.dataView_.getUint8(this.position_);\n if (value == 0) break;\n this.position_ += 1;\n }\n\n var ret = this.dataView_.buffer.slice(start, this.position_);\n // skip string termination\n this.position_ += 1;\n return shaka.util.StringUtils.fromUTF8(ret);\n};\n\n\n/**\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.util.DataViewReader.prototype.throwOutOfBounds_ = function() {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.BUFFER_READ_OUT_OF_BOUNDS);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/data_view_reader.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Mp4Parser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.DataViewReader');\n\n\n\n/**\n * Create a new MP4 Parser\n * @struct\n * @constructor\n * @export\n */\nshaka.util.Mp4Parser = function() {\n /**\n * @type {!Object.<number, shaka.util.Mp4Parser.BoxType_>}\n * @private\n */\n this.headers_ = [];\n\n /**\n * @type {!Object.<number, !shaka.util.Mp4Parser.CallbackType>}\n * @private\n */\n this.boxDefinitions_ = [];\n};\n\n\n/**\n * @typedef {{\n * parser: !shaka.util.Mp4Parser,\n * start: number,\n * size: number,\n * version: ?number,\n * flags: ?number,\n * reader: !shaka.util.DataViewReader\n * }}\n *\n * @property {!shaka.util.Mp4Parser} parser\n * The parser that parsed this box. The parser can be used to parse child\n * boxes where the configuration of the current parser is needed to parsed\n * other boxes.\n * @property {number} start\n * The start of this box (before the header) in the original buffer. This\n * start position is the absolute position.\n * @property {number} size\n * The size of this box (including the header).\n * @property {?number} version\n * The version for a full box, null for basic boxes.\n * @property {?number} flags\n * The flags for a full box, null for basic boxes.\n * @property {!shaka.util.DataViewReader} reader\n * The reader for this box is only for this box. Reading or not reading to\n * the end will have no affect on the parser reading other sibling boxes.\n * @exportInterface\n */\nshaka.util.Mp4Parser.ParsedBox;\n\n\n/**\n * @typedef {function(!shaka.util.Mp4Parser.ParsedBox)}\n * @exportInterface\n */\nshaka.util.Mp4Parser.CallbackType;\n\n\n/**\n * An enum used to track the type of box so that the correct values can be\n * read from the header.\n *\n * @enum {number}\n * @private\n */\nshaka.util.Mp4Parser.BoxType_ = {\n BASIC_BOX: 0,\n FULL_BOX: 1\n};\n\n\n/**\n * Delcare a box type as a Box.\n *\n * @param {string} type\n * @param {!shaka.util.Mp4Parser.CallbackType} definition\n * @return {!shaka.util.Mp4Parser}\n * @export\n */\nshaka.util.Mp4Parser.prototype.box = function(type, definition) {\n var typeCode = shaka.util.Mp4Parser.typeFromString_(type);\n this.headers_[typeCode] = shaka.util.Mp4Parser.BoxType_.BASIC_BOX;\n this.boxDefinitions_[typeCode] = definition;\n return this;\n};\n\n\n/**\n * Declare a box type as a Full Box.\n *\n * @param {string} type\n * @param {!shaka.util.Mp4Parser.CallbackType} definition\n * @return {!shaka.util.Mp4Parser}\n * @export\n */\nshaka.util.Mp4Parser.prototype.fullBox = function(type, definition) {\n var typeCode = shaka.util.Mp4Parser.typeFromString_(type);\n this.headers_[typeCode] = shaka.util.Mp4Parser.BoxType_.FULL_BOX;\n this.boxDefinitions_[typeCode] = definition;\n return this;\n};\n\n\n/**\n * Parse the given data using the added callbacks.\n *\n * @param {!ArrayBuffer} data\n * @export\n */\nshaka.util.Mp4Parser.prototype.parse = function(data) {\n var reader = new shaka.util.DataViewReader(\n new DataView(data),\n shaka.util.DataViewReader.Endianness.BIG_ENDIAN);\n\n while (reader.hasMoreData()) {\n this.parseNext(0, reader);\n }\n};\n\n\n/**\n * Parse the next box on the current level.\n *\n * @param {number} absStart The absolute start position in the original\n * byte array\n * @param {!shaka.util.DataViewReader} reader\n * @export\n */\nshaka.util.Mp4Parser.prototype.parseNext = function(absStart, reader) {\n var start = reader.getPosition();\n\n var size = reader.readUint32();\n var type = reader.readUint32();\n\n switch (size) {\n case 0:\n size = reader.getLength() - start;\n break;\n case 1:\n size = reader.readUint64();\n break;\n }\n\n var boxDefinition = this.boxDefinitions_[type];\n\n if (boxDefinition) {\n var version = null;\n var flags = null;\n\n if (this.headers_[type] == shaka.util.Mp4Parser.BoxType_.FULL_BOX) {\n var versionAndFlags = reader.readUint32();\n version = versionAndFlags >>> 24;\n flags = versionAndFlags & 0xFFFFFF;\n }\n\n // Read the whole payload so that the current level can be safely read\n // regardless of how the payload is parsed.\n var payloadSize = start + size - reader.getPosition();\n var payload = (payloadSize > 0) ?\n reader.readBytes(payloadSize).buffer :\n new ArrayBuffer(0);\n\n var payloadReader = new shaka.util.DataViewReader(\n new DataView(payload),\n shaka.util.DataViewReader.Endianness.BIG_ENDIAN);\n\n /** @type {shaka.util.Mp4Parser.ParsedBox } */\n var box = {\n parser: this,\n version: version,\n flags: flags,\n reader: payloadReader,\n size: size,\n start: start + absStart\n };\n\n boxDefinition(box);\n } else {\n // Move the read head to be at the end of the box.\n reader.skip(start + size - reader.getPosition());\n }\n};\n\n\n/**\n * A callback that tells the Mp4 parser to treat the body of a box as a series\n * of boxes. The number of boxes is limited by the size of the parent box.\n *\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @export\n */\nshaka.util.Mp4Parser.children = function(box) {\n while (box.reader.hasMoreData()) {\n box.parser.parseNext(box.start, box.reader);\n }\n};\n\n\n/**\n * A callback that tells the Mp4 parser to treat the body of a box as a sample\n * description. A sample description box has a fixed number of children. The\n * number of children is represented by a 4 byte unsigned integer. Each child\n * is a box.\n *\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @export\n */\nshaka.util.Mp4Parser.sampleDescription = function(box) {\n for (var count = box.reader.readUint32(); count > 0; count -= 1) {\n box.parser.parseNext(box.start, box.reader);\n }\n};\n\n\n/**\n * Create a callback that tells the Mp4 parser to treat the body of a box as a\n * binary blob and how to handle it.\n *\n * @param {!function(!Uint8Array)} callback\n * @return {!shaka.util.Mp4Parser.CallbackType}\n * @export\n */\nshaka.util.Mp4Parser.allData = function(callback) {\n return function(box) {\n var all = box.reader.getLength() - box.reader.getPosition();\n callback(box.reader.readBytes(all));\n };\n};\n\n\n/**\n * Convert an ascii string name to the integer type for a box.\n *\n * @param {string} name The name of the box. The name must be four\n * characters long.\n * @return {number}\n * @private\n */\nshaka.util.Mp4Parser.typeFromString_ = function(name) {\n goog.asserts.assert(\n name.length == 4,\n 'Mp4 box names must be 4 characters long');\n\n var code = 0;\n for (var i = 0; i < name.length; i++) {\n code = (code << 8) | name.charCodeAt(i);\n }\n return code;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/mp4_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Mp4SegmentIndexParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Mp4Parser');\n\n\n/**\n * Parses SegmentReferences from an ISO BMFF SIDX structure.\n * @param {!ArrayBuffer} sidxData The MP4's container's SIDX.\n * @param {number} sidxOffset The SIDX's offset, in bytes, from the start of\n * the MP4 container.\n * @param {!Array.<string>} uris The possible locations of the MP4 file that\n * contains the segments.\n * @param {number} presentationTimeOffset\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @throws {shaka.util.Error}\n */\nshaka.media.Mp4SegmentIndexParser = function(\n sidxData, sidxOffset, uris, presentationTimeOffset) {\n\n var Mp4SegmentIndexParser = shaka.media.Mp4SegmentIndexParser;\n\n var references;\n\n var parser = new shaka.util.Mp4Parser()\n .fullBox('sidx', function(box) {\n references = Mp4SegmentIndexParser.parseSIDX_(\n sidxOffset,\n presentationTimeOffset,\n uris,\n box);\n });\n\n if (sidxData) {\n parser.parse(sidxData);\n }\n\n if (references) {\n return references;\n } else {\n shaka.log.error('Invalid box type, expected \"sidx\".');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MP4_SIDX_WRONG_BOX_TYPE);\n }\n};\n\n\n/**\n * Parse a SIDX box from the given reader.\n *\n * @param {number} sidxOffset\n * @param {number} presentationTimeOffset\n * @param {!Array.<string>} uris The possible locations of the MP4 file that\n * contains the segments.\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.media.Mp4SegmentIndexParser.parseSIDX_ = function(\n sidxOffset,\n presentationTimeOffset,\n uris,\n box) {\n\n goog.asserts.assert(\n box.version != null,\n 'SIDX is a full box and should have a valid version.');\n\n var references = [];\n\n // Parse the SIDX structure.\n // Skip reference_ID (32 bits).\n box.reader.skip(4);\n\n var timescale = box.reader.readUint32();\n\n if (timescale == 0) {\n shaka.log.error('Invalid timescale.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MP4_SIDX_INVALID_TIMESCALE);\n }\n\n var earliestPresentationTime;\n var firstOffset;\n\n if (box.version == 0) {\n earliestPresentationTime = box.reader.readUint32();\n firstOffset = box.reader.readUint32();\n } else {\n earliestPresentationTime = box.reader.readUint64();\n firstOffset = box.reader.readUint64();\n }\n\n // Skip reserved (16 bits).\n box.reader.skip(2);\n\n // Add references.\n var referenceCount = box.reader.readUint16();\n\n // Substract the presentationTimeOffset\n var unscaledStartTime = earliestPresentationTime - presentationTimeOffset;\n var startByte = sidxOffset + box.size + firstOffset;\n\n for (var i = 0; i < referenceCount; i++) {\n // |chunk| is 1 bit for |referenceType|, and 31 bits for |referenceSize|.\n var chunk = box.reader.readUint32();\n var referenceType = (chunk & 0x80000000) >>> 31;\n var referenceSize = chunk & 0x7FFFFFFF;\n\n var subsegmentDuration = box.reader.readUint32();\n\n // Skipping 1 bit for |startsWithSap|, 3 bits for |sapType|, and 28 bits\n // for |sapDelta|.\n box.reader.skip(4);\n\n // If |referenceType| is 1 then the reference is to another SIDX.\n // We do not support this.\n if (referenceType == 1) {\n shaka.log.error('Heirarchical SIDXs are not supported.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MP4_SIDX_TYPE_NOT_SUPPORTED);\n }\n\n references.push(\n new shaka.media.SegmentReference(\n references.length,\n unscaledStartTime / timescale,\n (unscaledStartTime + subsegmentDuration) / timescale,\n function() { return uris; },\n startByte,\n startByte + referenceSize - 1));\n\n unscaledStartTime += subsegmentDuration;\n startByte += referenceSize;\n }\n\n return references;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/mp4_segment_index_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.SegmentIndex');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n\n/**\n * Creates a SegmentIndex.\n *\n * @param {!Array.<!shaka.media.SegmentReference>} references The list of\n * SegmentReferences, which must be sorted first by their start times\n * (ascending) and second by their end times (ascending), and have\n * continuous, increasing positions.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n * @export\n */\nshaka.media.SegmentIndex = function(references) {\n if (!COMPILED) {\n shaka.media.SegmentIndex.assertCorrectReferences_(references);\n }\n\n /** @private {Array.<!shaka.media.SegmentReference>} */\n this.references_ = references;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.media.SegmentIndex.prototype.destroy = function() {\n this.references_ = null;\n return Promise.resolve();\n};\n\n\n/**\n * Finds the position of the segment for the given time, in seconds, relative\n * to the start of a particular Period. Returns the position of the segment\n * with the largest end time if more than one segment is known for the given\n * time.\n *\n * @param {number} time\n * @return {?number} The position of the segment, or null\n * if the position of the segment could not be determined.\n * @export\n */\nshaka.media.SegmentIndex.prototype.find = function(time) {\n // For live streams, searching from the end is faster. For VOD, it balances\n // out either way. In both cases, references_.length is small enough that the\n // difference isn't huge.\n for (var i = this.references_.length - 1; i >= 0; --i) {\n var r = this.references_[i];\n // Note that a segment ends immediately before the end time.\n if ((time >= r.startTime) && (time < r.endTime)) {\n return r.position;\n }\n }\n if (this.references_.length && time < this.references_[0].startTime)\n return this.references_[0].position;\n\n return null;\n};\n\n\n/**\n * Gets the SegmentReference for the segment at the given position.\n *\n * @param {number} position The position of the segment.\n * @return {shaka.media.SegmentReference} The SegmentReference, or null if\n * no such SegmentReference exists.\n * @export\n */\nshaka.media.SegmentIndex.prototype.get = function(position) {\n if (this.references_.length == 0)\n return null;\n\n var index = position - this.references_[0].position;\n if (index < 0 || index >= this.references_.length)\n return null;\n\n return this.references_[index];\n};\n\n\n/**\n * Merges the given SegmentReferences. Supports extending the original\n * references only. Will not replace old references or interleave new ones.\n *\n * @param {!Array.<!shaka.media.SegmentReference>} references The list of\n * SegmentReferences, which must be sorted first by their start times\n * (ascending) and second by their end times (ascending), and have\n * continuous, increasing positions.\n * @export\n */\nshaka.media.SegmentIndex.prototype.merge = function(references) {\n if (!COMPILED) {\n shaka.media.SegmentIndex.assertCorrectReferences_(references);\n }\n\n var newReferences = [];\n var i = 0;\n var j = 0;\n\n while ((i < this.references_.length) && (j < references.length)) {\n var r1 = this.references_[i];\n var r2 = references[j];\n\n if (r1.startTime < r2.startTime) {\n newReferences.push(r1);\n i++;\n } else if (r1.startTime > r2.startTime) {\n // Drop the new reference if it would have to be interleaved with the\n // old one. Issue a warning, since this is not a supported update.\n shaka.log.warning('Refusing to rewrite original references on update!');\n j++;\n } else {\n // When period is changed, fitSegmentReference will expand the last\n // segment to the start of the next period. So, it is valid to have end\n // time updated to the last segment reference in a period\n if (Math.abs(r1.endTime - r2.endTime) > 0.1) {\n goog.asserts.assert(r2.endTime > r1.endTime &&\n i == this.references_.length - 1 &&\n j == references.length - 1,\n 'This should be an update of the last segment in a period');\n newReferences.push(r2);\n } else {\n // Drop the new reference if there's an old reference with the\n // same time.\n newReferences.push(r1);\n }\n i++;\n j++;\n }\n }\n\n while (i < this.references_.length) {\n newReferences.push(this.references_[i++]);\n }\n\n if (newReferences.length) {\n // The rest of these refs may need to be renumbered.\n var nextPosition = newReferences[newReferences.length - 1].position + 1;\n while (j < references.length) {\n var r = references[j++];\n var r2 = new shaka.media.SegmentReference(nextPosition++,\n r.startTime, r.endTime, r.getUris, r.startByte, r.endByte);\n newReferences.push(r2);\n }\n } else {\n newReferences = references;\n }\n\n if (!COMPILED) {\n shaka.media.SegmentIndex.assertCorrectReferences_(newReferences);\n }\n\n this.references_ = newReferences;\n};\n\n\n/**\n * Removes all SegmentReferences that end before the given time.\n *\n * @param {number} time The time in seconds.\n * @export\n */\nshaka.media.SegmentIndex.prototype.evict = function(time) {\n for (var i = 0; i < this.references_.length; ++i) {\n if (this.references_[i].endTime > time)\n break;\n }\n this.references_.splice(0, i);\n};\n\n\n/**\n * Expands the first SegmentReference so it begins at the start of its Period\n * if it already begins close to the start of its Period, and expands or\n * contracts the last SegmentReference so it ends at the end of its Period for\n * VOD presentations.\n *\n * @param {?number} periodDuration\n */\nshaka.media.SegmentIndex.prototype.fit = function(periodDuration) {\n if (this.references_.length == 0)\n return;\n\n /** @const {number} */\n var tolerance = shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS;\n\n goog.asserts.assert(periodDuration != null,\n 'Period duration must be known for static content!');\n goog.asserts.assert(periodDuration != Infinity,\n 'Period duration must be finite for static content!');\n\n var lastReference = this.references_[this.references_.length - 1];\n\n // Sanity check.\n goog.asserts.assert(\n lastReference.startTime < periodDuration,\n 'lastReference cannot begin after the end of the Period');\n if (lastReference.startTime > periodDuration) return;\n\n // Log warning if necessary.\n if (lastReference.endTime <= periodDuration - tolerance) {\n shaka.log.warning(\n 'The last segment should not end before the end of the Period.',\n lastReference);\n } else if (lastReference.endTime >= periodDuration + tolerance) {\n shaka.log.warning(\n 'The last segment should not end after the end of the Period.',\n lastReference);\n }\n\n // Adjust the last SegmentReference.\n this.references_[this.references_.length - 1] =\n new shaka.media.SegmentReference(\n lastReference.position,\n lastReference.startTime, periodDuration,\n lastReference.getUris,\n lastReference.startByte, lastReference.endByte);\n};\n\n\nif (!COMPILED) {\n /**\n * Asserts that the given SegmentReferences are sorted and have continuous,\n * increasing positions.\n *\n * @param {!Array.<shaka.media.SegmentReference>} references\n * @private\n */\n shaka.media.SegmentIndex.assertCorrectReferences_ = function(references) {\n goog.asserts.assert(references.every(function(r2, i) {\n if (i == 0) return true;\n var r1 = references[i - 1];\n if (r2.position != r1.position + 1) return false;\n if (r1.startTime < r2.startTime) {\n return true;\n } else if (r1.startTime > r2.startTime) {\n return false;\n } else {\n if (r1.endTime <= r2.endTime) {\n return true;\n } else {\n return false;\n }\n }\n }), 'SegmentReferences are incorrect');\n };\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/segment_index.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.EbmlElement');\ngoog.provide('shaka.util.EbmlParser');\n\ngoog.require('shaka.util.DataViewReader');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n\n/**\n * Creates an Extensible Binary Markup Language (EBML) parser.\n * @param {!DataView} dataView The EBML data.\n * @constructor\n * @struct\n */\nshaka.util.EbmlParser = function(dataView) {\n /** @private {!DataView} */\n this.dataView_ = dataView;\n\n /** @private {!shaka.util.DataViewReader} */\n this.reader_ = new shaka.util.DataViewReader(\n dataView,\n shaka.util.DataViewReader.Endianness.BIG_ENDIAN);\n\n // If not already constructed, build a list of EBML dynamic size constants.\n // This is not done at load-time to avoid exceptions on unsupported browsers.\n if (!shaka.util.EbmlParser.DYNAMIC_SIZES) {\n shaka.util.EbmlParser.DYNAMIC_SIZES = [\n new Uint8Array([0xff]),\n new Uint8Array([0x7f, 0xff]),\n new Uint8Array([0x3f, 0xff, 0xff]),\n new Uint8Array([0x1f, 0xff, 0xff, 0xff]),\n new Uint8Array([0x0f, 0xff, 0xff, 0xff, 0xff]),\n new Uint8Array([0x07, 0xff, 0xff, 0xff, 0xff, 0xff]),\n new Uint8Array([0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]),\n new Uint8Array([0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])\n ];\n }\n};\n\n\n/** @const {!Array.<!Uint8Array>} */\nshaka.util.EbmlParser.DYNAMIC_SIZES;\n\n\n/**\n * @return {boolean} True if the parser has more data, false otherwise.\n */\nshaka.util.EbmlParser.prototype.hasMoreData = function() {\n return this.reader_.hasMoreData();\n};\n\n\n/**\n * Parses an EBML element from the parser's current position, and advances\n * the parser.\n * @return {!shaka.util.EbmlElement} The EBML element.\n * @throws {shaka.util.Error}\n * @see http://matroska.org/technical/specs/rfc/index.html\n */\nshaka.util.EbmlParser.prototype.parseElement = function() {\n var id = this.parseId_();\n\n // Parse the element's size.\n var vint = this.parseVint_();\n var size;\n if (shaka.util.EbmlParser.isDynamicSizeValue_(vint)) {\n // If this has an unknown size, assume that it takes up the rest of the\n // data.\n size = this.dataView_.byteLength - this.reader_.getPosition();\n } else {\n size = shaka.util.EbmlParser.getVintValue_(vint);\n }\n\n // Note that if the element's size is larger than the buffer then we are\n // parsing a \"partial element\". This may occur if for example we are\n // parsing the beginning of some WebM container data, but our buffer does\n // not contain the entire WebM container data.\n var elementSize =\n this.reader_.getPosition() + size <= this.dataView_.byteLength ?\n size :\n this.dataView_.byteLength - this.reader_.getPosition();\n\n var dataView = new DataView(\n this.dataView_.buffer,\n this.dataView_.byteOffset + this.reader_.getPosition(), elementSize);\n\n this.reader_.skip(elementSize);\n\n return new shaka.util.EbmlElement(id, dataView);\n};\n\n\n/**\n * Parses an EBML ID from the parser's current position, and advances the\n * parser.\n * @throws {shaka.util.Error}\n * @return {number} The EBML ID.\n * @private\n */\nshaka.util.EbmlParser.prototype.parseId_ = function() {\n var vint = this.parseVint_();\n\n if (vint.length > 7) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_OVERFLOW);\n }\n\n var id = 0;\n for (var i = 0; i < vint.length; i++) {\n // Note that we cannot use << since |value| may exceed 32 bits.\n id = (256 * id) + vint[i];\n }\n\n return id;\n};\n\n\n/**\n * Parses a variable sized integer from the parser's current position, and\n * advances the parser.\n * For example:\n * 1 byte wide: 1xxx xxxx\n * 2 bytes wide: 01xx xxxx xxxx xxxx\n * 3 bytes wide: 001x xxxx xxxx xxxx xxxx xxxx\n * @throws {shaka.util.Error}\n * @return {!Uint8Array} The variable sized integer.\n * @private\n */\nshaka.util.EbmlParser.prototype.parseVint_ = function() {\n var firstByte = this.reader_.readUint8();\n var numBytes;\n\n // Determine the byte width of the variable sized integer.\n for (numBytes = 1; numBytes <= 8; numBytes++) {\n var mask = 0x1 << (8 - numBytes);\n if (firstByte & mask) {\n break;\n }\n }\n\n if (numBytes > 8) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_OVERFLOW);\n }\n\n var vint = new Uint8Array(numBytes);\n vint[0] = firstByte;\n\n // Include the remaining bytes.\n for (var i = 1; i < numBytes; i++) {\n vint[i] = this.reader_.readUint8();\n }\n\n return vint;\n};\n\n\n/**\n * Gets the value of a variable sized integer.\n * For example, the x's below are part of the vint's value.\n * 7-bit value: 1xxx xxxx\n * 14-bit value: 01xx xxxx xxxx xxxx\n * 21-bit value: 001x xxxx xxxx xxxx xxxx xxxx\n * @param {!Uint8Array} vint The variable sized integer.\n * @throws {shaka.util.Error}\n * @return {number} The value of the variable sized integer.\n * @private\n */\nshaka.util.EbmlParser.getVintValue_ = function(vint) {\n // If |vint| is 8 bytes wide then we must ensure that it does not have more\n // than 53 meaningful bits. For example, assume |vint| is 8 bytes wide,\n // so it has the following structure,\n // 0000 0001 | xxxx xxxx ...\n // Thus, the first 3 bits following the first byte of |vint| must be 0.\n if ((vint.length == 8) && (vint[1] & 0xe0)) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.JS_INTEGER_OVERFLOW);\n }\n\n // Mask out the first few bits of |vint|'s first byte to get the most\n // significant bits of |vint|'s value. If |vint| is 8 bytes wide then |value|\n // will be set to 0.\n var mask = 0x1 << (8 - vint.length);\n var value = vint[0] & (mask - 1);\n\n // Add the remaining bytes.\n for (var i = 1; i < vint.length; i++) {\n // Note that we cannot use << since |value| may exceed 32 bits.\n value = (256 * value) + vint[i];\n }\n\n return value;\n};\n\n\n/**\n * Checks if the given variable sized integer represents a dynamic size value.\n * @param {!Uint8Array} vint The variable sized integer.\n * @return {boolean} true if |vint| represents a dynamic size value,\n * false otherwise.\n * @private\n */\nshaka.util.EbmlParser.isDynamicSizeValue_ = function(vint) {\n var EbmlParser = shaka.util.EbmlParser;\n var uint8ArrayEqual = shaka.util.Uint8ArrayUtils.equal;\n\n for (var i = 0; i < EbmlParser.DYNAMIC_SIZES.length; i++) {\n if (uint8ArrayEqual(vint, EbmlParser.DYNAMIC_SIZES[i])) {\n return true;\n }\n }\n\n return false;\n};\n\n\n\n/**\n * Creates an EbmlElement.\n * @param {number} id The ID.\n * @param {!DataView} dataView The DataView.\n * @constructor\n */\nshaka.util.EbmlElement = function(id, dataView) {\n /** @type {number} */\n this.id = id;\n\n /** @private {!DataView} */\n this.dataView_ = dataView;\n};\n\n\n/**\n * Gets the element's offset from the beginning of the buffer.\n * @return {number}\n */\nshaka.util.EbmlElement.prototype.getOffset = function() {\n return this.dataView_.byteOffset;\n};\n\n\n/**\n * Interpret the element's data as a list of sub-elements.\n * @throws {shaka.util.Error}\n * @return {!shaka.util.EbmlParser} A parser over the sub-elements.\n */\nshaka.util.EbmlElement.prototype.createParser = function() {\n return new shaka.util.EbmlParser(this.dataView_);\n};\n\n\n/**\n * Interpret the element's data as an unsigned integer.\n * @throws {shaka.util.Error}\n * @return {number}\n */\nshaka.util.EbmlElement.prototype.getUint = function() {\n if (this.dataView_.byteLength > 8) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_OVERFLOW);\n }\n\n // Ensure we have at most 53 meaningful bits.\n if ((this.dataView_.byteLength == 8) && (this.dataView_.getUint8(0) & 0xe0)) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.JS_INTEGER_OVERFLOW);\n }\n\n var value = 0;\n\n for (var i = 0; i < this.dataView_.byteLength; i++) {\n var chunk = this.dataView_.getUint8(i);\n value = (256 * value) + chunk;\n }\n\n return value;\n};\n\n\n/**\n * Interpret the element's data as a floating point number (32 bits or 64 bits).\n * 80-bit floating point numbers are not supported.\n * @throws {shaka.util.Error}\n * @return {number}\n */\nshaka.util.EbmlElement.prototype.getFloat = function() {\n if (this.dataView_.byteLength == 4) {\n return this.dataView_.getFloat32(0);\n } else if (this.dataView_.byteLength == 8) {\n return this.dataView_.getFloat64(0);\n } else {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_BAD_FLOATING_POINT_SIZE);\n }\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/ebml_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.WebmSegmentIndexParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.EbmlElement');\ngoog.require('shaka.util.EbmlParser');\ngoog.require('shaka.util.Error');\n\n\n\n/**\n * Creates a WebM Cues element parser.\n *\n * @constructor\n * @struct\n */\nshaka.media.WebmSegmentIndexParser = function() {};\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.EBML_ID = 0x1a45dfa3;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.SEGMENT_ID = 0x18538067;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.INFO_ID = 0x1549a966;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.TIMECODE_SCALE_ID = 0x2ad7b1;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.DURATION_ID = 0x4489;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUES_ID = 0x1c53bb6b;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_POINT_ID = 0xbb;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_TIME_ID = 0xb3;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_TRACK_POSITIONS_ID = 0xb7;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_CLUSTER_POSITION = 0xf1;\n\n\n/**\n * Parses SegmentReferences from a WebM container.\n * @param {!ArrayBuffer} cuesData The WebM container's \"Cueing Data\" section.\n * @param {!ArrayBuffer} initData The WebM container's headers.\n * @param {!Array.<string>} uris The possible locations of the WebM file that\n * contains the segments.\n * @param {number} presentationTimeOffset\n\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @throws {shaka.util.Error}\n * @see http://www.matroska.org/technical/specs/index.html\n * @see http://www.webmproject.org/docs/container/\n */\nshaka.media.WebmSegmentIndexParser.prototype.parse = function(\n cuesData, initData, uris, presentationTimeOffset) {\n var tuple = this.parseWebmContainer_(initData);\n var parser = new shaka.util.EbmlParser(new DataView(cuesData));\n var cuesElement = parser.parseElement();\n if (cuesElement.id != shaka.media.WebmSegmentIndexParser.CUES_ID) {\n shaka.log.error('Not a Cues element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_CUES_ELEMENT_MISSING);\n }\n\n return this.parseCues_(\n cuesElement, tuple.segmentOffset, tuple.timecodeScale, tuple.duration,\n uris, presentationTimeOffset);\n};\n\n\n/**\n * Parses a WebM container to get the segment's offset, timecode scale, and\n * duration.\n *\n * @param {!ArrayBuffer} initData\n * @return {{segmentOffset: number, timecodeScale: number, duration: number}}\n * The segment's offset in bytes, the segment's timecode scale in seconds,\n * and the duration in seconds.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseWebmContainer_ = function(\n initData) {\n var parser = new shaka.util.EbmlParser(new DataView(initData));\n\n // Check that the WebM container data starts with the EBML header, but\n // skip its contents.\n var ebmlElement = parser.parseElement();\n if (ebmlElement.id != shaka.media.WebmSegmentIndexParser.EBML_ID) {\n shaka.log.error('Not an EBML element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_EBML_HEADER_ELEMENT_MISSING);\n }\n\n var segmentElement = parser.parseElement();\n if (segmentElement.id != shaka.media.WebmSegmentIndexParser.SEGMENT_ID) {\n shaka.log.error('Not a Segment element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_SEGMENT_ELEMENT_MISSING);\n }\n\n // This value is used as the initial offset to the first referenced segment.\n var segmentOffset = segmentElement.getOffset();\n\n // Parse the Segment element to get the segment info.\n var segmentInfo = this.parseSegment_(segmentElement);\n return {\n segmentOffset: segmentOffset,\n timecodeScale: segmentInfo.timecodeScale,\n duration: segmentInfo.duration\n };\n};\n\n\n/**\n * Parses a WebM Info element to get the segment's timecode scale and duration.\n * @param {!shaka.util.EbmlElement} segmentElement\n * @return {{timecodeScale: number, duration: number}} The segment's timecode\n * scale in seconds and duration in seconds.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseSegment_ = function(\n segmentElement) {\n var parser = segmentElement.createParser();\n\n // Find the Info element.\n var infoElement = null;\n while (parser.hasMoreData()) {\n var elem = parser.parseElement();\n if (elem.id != shaka.media.WebmSegmentIndexParser.INFO_ID) {\n continue;\n }\n\n infoElement = elem;\n\n break;\n }\n\n if (!infoElement) {\n shaka.log.error('Not an Info element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_INFO_ELEMENT_MISSING);\n }\n\n return this.parseInfo_(infoElement);\n};\n\n\n/**\n * Parses a WebM Info element to get the segment's timecode scale and duration.\n * @param {!shaka.util.EbmlElement} infoElement\n * @return {{timecodeScale: number, duration: number}} The segment's timecode\n * scale in seconds and duration in seconds.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseInfo_ = function(\n infoElement) {\n var parser = infoElement.createParser();\n\n // The timecode scale factor in units of [nanoseconds / T], where [T] are the\n // units used to express all other time values in the WebM container. By\n // default it's assumed that [T] == [milliseconds].\n var timecodeScaleNanoseconds = 1000000;\n /** @type {?number} */\n var durationScale = null;\n\n while (parser.hasMoreData()) {\n var elem = parser.parseElement();\n if (elem.id == shaka.media.WebmSegmentIndexParser.TIMECODE_SCALE_ID) {\n timecodeScaleNanoseconds = elem.getUint();\n } else if (elem.id == shaka.media.WebmSegmentIndexParser.DURATION_ID) {\n durationScale = elem.getFloat();\n }\n }\n if (durationScale == null) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_DURATION_ELEMENT_MISSING);\n }\n\n // The timecode scale factor in units of [seconds / T].\n var timecodeScale = timecodeScaleNanoseconds / 1000000000;\n // The duration is stored in units of [T]\n var durationSeconds = durationScale * timecodeScale;\n\n return {timecodeScale: timecodeScale, duration: durationSeconds};\n};\n\n\n/**\n * Parses a WebM CuesElement.\n * @param {!shaka.util.EbmlElement} cuesElement\n * @param {number} segmentOffset\n * @param {number} timecodeScale\n * @param {number} duration\n * @param {!Array.<string>} uris\n * @param {number} presentationTimeOffset\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseCues_ = function(\n cuesElement, segmentOffset, timecodeScale, duration, uris,\n presentationTimeOffset) {\n var references = [];\n var getUris = function() { return uris; };\n\n var parser = cuesElement.createParser();\n\n var lastTime = -1;\n var lastOffset = -1;\n\n while (parser.hasMoreData()) {\n var elem = parser.parseElement();\n if (elem.id != shaka.media.WebmSegmentIndexParser.CUE_POINT_ID) {\n continue;\n }\n\n var tuple = this.parseCuePoint_(elem);\n if (!tuple) {\n continue;\n }\n\n // Substract presentationTimeOffset from unscalled time\n var currentTime = timecodeScale *\n (tuple.unscaledTime - presentationTimeOffset);\n var currentOffset = segmentOffset + tuple.relativeOffset;\n\n if (lastTime >= 0) {\n goog.asserts.assert(lastOffset >= 0, 'last offset cannot be 0');\n\n references.push(\n new shaka.media.SegmentReference(\n references.length,\n lastTime, currentTime,\n getUris,\n lastOffset, currentOffset - 1));\n }\n\n lastTime = currentTime;\n lastOffset = currentOffset;\n }\n\n if (lastTime >= 0) {\n goog.asserts.assert(lastOffset >= 0, 'last offset cannot be 0');\n\n references.push(\n new shaka.media.SegmentReference(\n references.length, lastTime, duration, getUris, lastOffset, null));\n }\n\n return references;\n};\n\n\n/**\n * Parses a WebM CuePointElement to get an \"unadjusted\" segment reference.\n * @param {shaka.util.EbmlElement} cuePointElement\n * @return {{unscaledTime: number, relativeOffset: number}} The referenced\n * segment's start time in units of [T] (see parseInfo_()), and the\n * referenced segment's offset in bytes, relative to a WebM Segment\n * element.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseCuePoint_ = function(\n cuePointElement) {\n var parser = cuePointElement.createParser();\n\n // Parse CueTime element.\n var cueTimeElement = parser.parseElement();\n if (cueTimeElement.id != shaka.media.WebmSegmentIndexParser.CUE_TIME_ID) {\n shaka.log.warning('Not a CueTime element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_CUE_TIME_ELEMENT_MISSING);\n }\n var unscaledTime = cueTimeElement.getUint();\n\n // Parse CueTrackPositions element.\n var cueTrackPositionsElement = parser.parseElement();\n if (cueTrackPositionsElement.id !=\n shaka.media.WebmSegmentIndexParser.CUE_TRACK_POSITIONS_ID) {\n shaka.log.warning('Not a CueTrackPositions element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING);\n }\n\n var cueTrackParser = cueTrackPositionsElement.createParser();\n var relativeOffset = 0;\n\n while (cueTrackParser.hasMoreData()) {\n var elem = cueTrackParser.parseElement();\n if (elem.id != shaka.media.WebmSegmentIndexParser.CUE_CLUSTER_POSITION) {\n continue;\n }\n\n relativeOffset = elem.getUint();\n break;\n }\n\n return { unscaledTime: unscaledTime, relativeOffset: relativeOffset };\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/webm_segment_index_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.SegmentBase');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.MpdUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.Mp4SegmentIndexParser');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.WebmSegmentIndexParser');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.SegmentBase\n * @summary A set of functions for parsing SegmentBase elements.\n */\n\n\n/**\n * Creates an init segment reference from a Context object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * @return {shaka.media.InitSegmentReference}\n */\nshaka.dash.SegmentBase.createInitSegment = function(context, callback) {\n var MpdUtils = shaka.dash.MpdUtils;\n var XmlUtils = shaka.util.XmlUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var initialization =\n MpdUtils.inheritChild(context, callback, 'Initialization');\n if (!initialization)\n return null;\n\n var resolvedUris = context.representation.baseUris;\n var uri = initialization.getAttribute('sourceURL');\n if (uri) {\n resolvedUris =\n ManifestParserUtils.resolveUris(context.representation.baseUris, [uri]);\n }\n\n var startByte = 0;\n var endByte = null;\n var range = XmlUtils.parseAttr(initialization, 'range', XmlUtils.parseRange);\n if (range) {\n startByte = range.start;\n endByte = range.end;\n }\n\n var getUris = function() { return resolvedUris; };\n return new shaka.media.InitSegmentReference(getUris, startByte, endByte);\n};\n\n\n/**\n * Creates a new Stream object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @throws shaka.util.Error When there is a parsing error.\n * @return {shaka.dash.DashParser.StreamInfo}\n */\nshaka.dash.SegmentBase.createStream = function(context, requestInitSegment) {\n goog.asserts.assert(context.representation.segmentBase,\n 'Should only be called with SegmentBase');\n // Since SegmentBase does not need updates, simply treat any call as\n // the initial parse.\n var MpdUtils = shaka.dash.MpdUtils;\n var SegmentBase = shaka.dash.SegmentBase;\n\n var presentationTimeOffset = MpdUtils.inheritAttribute(\n context, SegmentBase.fromInheritance_, 'presentationTimeOffset');\n\n var init =\n SegmentBase.createInitSegment(context, SegmentBase.fromInheritance_);\n var index = SegmentBase.createSegmentIndex_(\n context, requestInitSegment, init, Number(presentationTimeOffset));\n\n return {\n createSegmentIndex: index.createSegmentIndex,\n findSegmentPosition: index.findSegmentPosition,\n getSegmentReference: index.getSegmentReference,\n initSegmentReference: init,\n presentationTimeOffset: Number(presentationTimeOffset) || 0\n };\n};\n\n\n/**\n * Creates segment index info for the given info.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {shaka.media.InitSegmentReference} init\n * @param {!Array.<string>} uris\n * @param {number} startByte\n * @param {?number} endByte\n * @param {string} containerType\n * @param {number} presentationTimeOffset\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n */\nshaka.dash.SegmentBase.createSegmentIndexFromUris = function(\n context, requestInitSegment, init, uris,\n startByte, endByte, containerType, presentationTimeOffset) {\n var presentationTimeline = context.presentationTimeline;\n var fitLast = !context.dynamic || !context.periodInfo.isLastPeriod;\n var periodStartTime = context.periodInfo.start;\n var periodDuration = context.periodInfo.duration;\n\n // Create a local variable to bind to so we can set to null to help the GC.\n var localRequest = requestInitSegment;\n var segmentIndex = null;\n var create = function() {\n var async = [\n localRequest(uris, startByte, endByte),\n containerType == 'webm' ?\n localRequest(init.getUris(), init.startByte, init.endByte) :\n null\n ];\n\n localRequest = null;\n return Promise.all(async).then(function(results) {\n var indexData = results[0];\n var initData = results[1] || null;\n var references = null;\n\n if (containerType == 'mp4') {\n references = shaka.media.Mp4SegmentIndexParser(\n indexData, startByte, uris, presentationTimeOffset);\n } else {\n goog.asserts.assert(initData, 'WebM requires init data');\n var parser = new shaka.media.WebmSegmentIndexParser();\n references = parser.parse(indexData, initData, uris,\n presentationTimeOffset);\n }\n\n presentationTimeline.notifySegments(periodStartTime, references);\n\n // Since containers are never updated, we don't need to store the\n // segmentIndex in the map.\n goog.asserts.assert(!segmentIndex,\n 'Should not call createSegmentIndex twice');\n\n segmentIndex = new shaka.media.SegmentIndex(references);\n if (fitLast)\n segmentIndex.fit(periodDuration);\n });\n };\n var get = function(i) {\n goog.asserts.assert(segmentIndex, 'Must call createSegmentIndex first');\n return segmentIndex.get(i);\n };\n var find = function(t) {\n goog.asserts.assert(segmentIndex, 'Must call createSegmentIndex first');\n return segmentIndex.find(t);\n };\n\n return {\n createSegmentIndex: create,\n findSegmentPosition: find,\n getSegmentReference: get\n };\n};\n\n\n/**\n * @param {?shaka.dash.DashParser.InheritanceFrame} frame\n * @return {Element}\n * @private\n */\nshaka.dash.SegmentBase.fromInheritance_ = function(frame) {\n return frame.segmentBase;\n};\n\n\n/**\n * Creates segment index info from a Context object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {shaka.media.InitSegmentReference} init\n * @param {number} presentationTimeOffset\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.SegmentBase.createSegmentIndex_ = function(\n context, requestInitSegment, init, presentationTimeOffset) {\n var MpdUtils = shaka.dash.MpdUtils;\n var SegmentBase = shaka.dash.SegmentBase;\n var XmlUtils = shaka.util.XmlUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var contentType = context.representation.contentType;\n var containerType = context.representation.mimeType.split('/')[1];\n if (contentType != ContentType.TEXT && containerType != 'mp4' &&\n containerType != 'webm') {\n shaka.log.error(\n 'SegmentBase specifies an unsupported container type.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_UNSUPPORTED_CONTAINER);\n }\n\n if ((containerType == 'webm') && !init) {\n shaka.log.error(\n 'SegmentBase does not contain sufficient segment information:',\n 'the SegmentBase uses a WebM container,',\n 'but does not contain an Initialization element.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_WEBM_MISSING_INIT);\n }\n\n var representationIndex = MpdUtils.inheritChild(\n context, SegmentBase.fromInheritance_, 'RepresentationIndex');\n var indexRangeElem = MpdUtils.inheritAttribute(\n context, SegmentBase.fromInheritance_, 'indexRange');\n\n var indexUris = context.representation.baseUris;\n var indexRange = XmlUtils.parseRange(indexRangeElem || '');\n if (representationIndex) {\n var representationUri = representationIndex.getAttribute('sourceURL');\n if (representationUri) {\n indexUris = ManifestParserUtils.resolveUris(\n context.representation.baseUris, [representationUri]);\n }\n\n indexRange = XmlUtils.parseAttr(\n representationIndex, 'range', XmlUtils.parseRange, indexRange);\n }\n\n if (!indexRange) {\n shaka.log.error(\n 'SegmentBase does not contain sufficient segment information:',\n 'the SegmentBase does not contain @indexRange',\n 'or a RepresentationIndex element.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n\n return shaka.dash.SegmentBase.createSegmentIndexFromUris(\n context, requestInitSegment, init, indexUris, indexRange.start,\n indexRange.end, containerType, presentationTimeOffset);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/segment_base.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.SegmentList');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.MpdUtils');\ngoog.require('shaka.dash.SegmentBase');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.SegmentList\n * @summary A set of functions for parsing SegmentList elements.\n */\n\n\n/**\n * Creates a new Stream object or updates the Stream in the manifest.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Object.<string, !shaka.media.SegmentIndex>} segmentIndexMap\n * @return {shaka.dash.DashParser.StreamInfo}\n */\nshaka.dash.SegmentList.createStream = function(context, segmentIndexMap) {\n goog.asserts.assert(context.representation.segmentList,\n 'Should only be called with SegmentList');\n var SegmentList = shaka.dash.SegmentList;\n\n var init = shaka.dash.SegmentBase.createInitSegment(\n context, SegmentList.fromInheritance_);\n var info = SegmentList.parseSegmentListInfo_(context);\n\n SegmentList.checkSegmentListInfo_(context, info);\n\n /** @type {shaka.media.SegmentIndex} */\n var segmentIndex = null;\n var id = null;\n if (context.period.id && context.representation.id) {\n // Only check/store the index if period and representation IDs are set.\n id = context.period.id + ',' + context.representation.id;\n segmentIndex = segmentIndexMap[id];\n }\n\n var references = SegmentList.createSegmentReferences_(\n context.periodInfo.duration, info.startNumber,\n context.representation.baseUris, info);\n\n if (segmentIndex) {\n segmentIndex.merge(references);\n var start = context.presentationTimeline.getSegmentAvailabilityStart();\n segmentIndex.evict(start - context.periodInfo.start);\n } else {\n context.presentationTimeline.notifySegments(\n context.periodInfo.start, references);\n segmentIndex = new shaka.media.SegmentIndex(references);\n if (id && context.dynamic)\n segmentIndexMap[id] = segmentIndex;\n }\n\n if (!context.dynamic || !context.periodInfo.isLastPeriod)\n segmentIndex.fit(context.periodInfo.duration);\n\n return {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex),\n initSegmentReference: init,\n presentationTimeOffset: info.presentationTimeOffset\n };\n};\n\n\n/**\n * @typedef {{\n * mediaUri: string,\n * start: number,\n * end: ?number\n * }}\n *\n * @property {string} mediaUri\n * The URI of the segment.\n * @property {number} start\n * The start byte of the segment.\n * @property {?number} end\n * The end byte of the segment, or null.\n */\nshaka.dash.SegmentList.MediaSegment;\n\n\n/**\n * @typedef {{\n * segmentDuration: ?number,\n * startTime: number,\n * startNumber: number,\n * presentationTimeOffset: number,\n * timeline: Array.<shaka.dash.MpdUtils.TimeRange>,\n * mediaSegments: !Array.<shaka.dash.SegmentList.MediaSegment>\n * }}\n * @private\n *\n * @description\n * Contains information about a SegmentList.\n *\n * @property {?number} segmentDuration\n * The duration of the segments, if given.\n * @property {number} startTime\n * The start time of the first segment, in seconds.\n * @property {number} startNumber\n * The start number of the segments; 1 or greater.\n * @property {number} presentationTimeOffset\n * The presentationTimeOffset of the representation, in seconds.\n * @property {Array.<shaka.dash.MpdUtils.TimeRange>} timeline\n * The timeline of the representation, if given. Times in seconds.\n * @property {!Array.<shaka.dash.SegmentList.MediaSegment>} mediaSegments\n * The URI and byte-ranges of the media segments.\n */\nshaka.dash.SegmentList.SegmentListInfo;\n\n\n/**\n * @param {?shaka.dash.DashParser.InheritanceFrame} frame\n * @return {Element}\n * @private\n */\nshaka.dash.SegmentList.fromInheritance_ = function(frame) {\n return frame.segmentList;\n};\n\n\n/**\n * Parses the SegmentList items to create an info object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {shaka.dash.SegmentList.SegmentListInfo}\n * @private\n */\nshaka.dash.SegmentList.parseSegmentListInfo_ = function(context) {\n var SegmentList = shaka.dash.SegmentList;\n var MpdUtils = shaka.dash.MpdUtils;\n\n var mediaSegments = SegmentList.parseMediaSegments_(context);\n var segmentInfo =\n MpdUtils.parseSegmentInfo(context, SegmentList.fromInheritance_);\n\n var startNumber = segmentInfo.startNumber;\n if (startNumber == 0) {\n shaka.log.warning('SegmentList@startNumber must be > 0');\n startNumber = 1;\n }\n\n var startTime = 0;\n if (segmentInfo.segmentDuration) {\n // See DASH sec. 5.3.9.5.3\n // Don't use presentationTimeOffset for @duration.\n startTime = segmentInfo.segmentDuration * (startNumber - 1);\n } else if (segmentInfo.timeline && segmentInfo.timeline.length > 0) {\n // The presentationTimeOffset was considered in timeline creation\n startTime = segmentInfo.timeline[0].start;\n }\n\n return {\n segmentDuration: segmentInfo.segmentDuration,\n startTime: startTime,\n startNumber: startNumber,\n presentationTimeOffset: segmentInfo.presentationTimeOffset,\n timeline: segmentInfo.timeline,\n mediaSegments: mediaSegments\n };\n};\n\n\n/**\n * Checks whether a SegmentListInfo object is valid.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentList.SegmentListInfo} info\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.SegmentList.checkSegmentListInfo_ = function(context, info) {\n if (!info.segmentDuration && !info.timeline &&\n info.mediaSegments.length > 1) {\n shaka.log.warning(\n 'SegmentList does not contain sufficient segment information:',\n 'the SegmentList specifies multiple segments,',\n 'but does not specify a segment duration or timeline.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n\n if (!info.segmentDuration && !context.periodInfo.duration && !info.timeline &&\n info.mediaSegments.length == 1) {\n shaka.log.warning(\n 'SegmentList does not contain sufficient segment information:',\n 'the SegmentList specifies one segment,',\n 'but does not specify a segment duration, period duration,',\n 'or timeline.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n\n if (info.timeline && info.timeline.length == 0) {\n shaka.log.warning(\n 'SegmentList does not contain sufficient segment information:',\n 'the SegmentList has an empty timeline.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n};\n\n\n/**\n * Creates an array of segment references for the given data.\n *\n * @param {?number} periodDuration in seconds.\n * @param {number} startNumber\n * @param {!Array.<string>} baseUris\n * @param {shaka.dash.SegmentList.SegmentListInfo} info\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.dash.SegmentList.createSegmentReferences_ = function(\n periodDuration, startNumber, baseUris, info) {\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var max = info.mediaSegments.length;\n if (info.timeline && info.timeline.length != info.mediaSegments.length) {\n max = Math.min(info.timeline.length, info.mediaSegments.length);\n shaka.log.warning(\n 'The number of items in the segment timeline and the number of segment',\n 'URLs do not match, truncating', info.mediaSegments.length, 'to', max);\n }\n\n /** @type {!Array.<!shaka.media.SegmentReference>} */\n var references = [];\n var prevEndTime = info.startTime;\n for (var i = 0; i < max; i++) {\n var segment = info.mediaSegments[i];\n var mediaUri = ManifestParserUtils.resolveUris(\n baseUris, [segment.mediaUri]);\n\n var startTime = prevEndTime;\n var endTime;\n\n if (info.segmentDuration != null) {\n endTime = startTime + info.segmentDuration;\n } else if (info.timeline) {\n // Ignore the timepoint start since they are continuous.\n endTime = info.timeline[i].end;\n } else {\n // If segmentDuration and timeline are null then there must\n // only be one segment.\n goog.asserts.assert(\n info.mediaSegments.length == 1 && periodDuration,\n 'There should only be one segment with a Period duration.');\n endTime = startTime + periodDuration;\n }\n\n var getUris = (function(uris) { return uris; }.bind(null, mediaUri));\n references.push(\n new shaka.media.SegmentReference(\n i + startNumber, startTime, endTime, getUris, segment.start,\n segment.end));\n prevEndTime = endTime;\n }\n\n return references;\n};\n\n\n/**\n * Parses the media URIs from the context.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {!Array.<shaka.dash.SegmentList.MediaSegment>}\n * @private\n */\nshaka.dash.SegmentList.parseMediaSegments_ = function(context) {\n var Functional = shaka.util.Functional;\n /** @type {!Array.<!Element>} */\n var segmentLists = [\n context.representation.segmentList,\n context.adaptationSet.segmentList,\n context.period.segmentList\n ].filter(Functional.isNotNull);\n\n var XmlUtils = shaka.util.XmlUtils;\n // Search each SegmentList for one with at least one SegmentURL element,\n // select the first one, and convert each SegmentURL element to a tuple.\n return segmentLists\n .map(function(node) { return XmlUtils.findChildren(node, 'SegmentURL'); })\n .reduce(function(all, part) { return all.length > 0 ? all : part; })\n .map(function(urlNode) {\n if (urlNode.getAttribute('indexRange') &&\n !context.indexRangeWarningGiven) {\n context.indexRangeWarningGiven = true;\n shaka.log.warning(\n 'We do not support the SegmentURL@indexRange attribute on ' +\n 'SegmentList. We only use the SegmentList@duration attribute ' +\n 'or SegmentTimeline, which must be accurate.');\n }\n\n var uri = urlNode.getAttribute('media');\n var range = XmlUtils.parseAttr(\n urlNode, 'mediaRange', XmlUtils.parseRange, {start: 0, end: null});\n return {mediaUri: uri, start: range.start, end: range.end};\n });\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/segment_list.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.SegmentTemplate');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.MpdUtils');\ngoog.require('shaka.dash.SegmentBase');\ngoog.require('shaka.log');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n/**\n * @namespace shaka.dash.SegmentTemplate\n * @summary A set of functions for parsing SegmentTemplate elements.\n */\n\n\n/**\n * Creates a new Stream object or updates the Stream in the manifest.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {!Object.<string, !shaka.media.SegmentIndex>} segmentIndexMap\n * @param {boolean} isUpdate True if the manifest is being updated.\n * @throws shaka.util.Error When there is a parsing error.\n * @return {shaka.dash.DashParser.StreamInfo}\n */\nshaka.dash.SegmentTemplate.createStream = function(\n context, requestInitSegment, segmentIndexMap, isUpdate) {\n goog.asserts.assert(context.representation.segmentTemplate,\n 'Should only be called with SegmentTemplate');\n var SegmentTemplate = shaka.dash.SegmentTemplate;\n\n var init = SegmentTemplate.createInitSegment_(context);\n var info = SegmentTemplate.parseSegmentTemplateInfo_(context);\n\n SegmentTemplate.checkSegmentTemplateInfo_(context, info);\n\n /** @type {?shaka.dash.DashParser.SegmentIndexFunctions} */\n var segmentIndexFunctions = null;\n if (info.indexTemplate) {\n segmentIndexFunctions = SegmentTemplate.createFromIndexTemplate_(\n context, requestInitSegment, init, info);\n } else if (info.segmentDuration) {\n if (!isUpdate) {\n context.presentationTimeline.notifyMaxSegmentDuration(\n info.segmentDuration);\n }\n segmentIndexFunctions = SegmentTemplate.createFromDuration_(context, info);\n } else {\n /** @type {shaka.media.SegmentIndex} */\n var segmentIndex = null;\n var id = null;\n if (context.period.id && context.representation.id) {\n // Only check/store the index if period and representation IDs are set.\n id = context.period.id + ',' + context.representation.id;\n segmentIndex = segmentIndexMap[id];\n }\n\n var references = SegmentTemplate.createFromTimeline_(context, info);\n\n if (segmentIndex) {\n segmentIndex.merge(references);\n var start = context.presentationTimeline.getSegmentAvailabilityStart();\n segmentIndex.evict(start - context.periodInfo.start);\n } else {\n context.presentationTimeline.notifySegments(\n context.periodInfo.start, references);\n segmentIndex = new shaka.media.SegmentIndex(references);\n if (id && context.dynamic)\n segmentIndexMap[id] = segmentIndex;\n }\n\n if (!context.dynamic || !context.periodInfo.isLastPeriod)\n segmentIndex.fit(context.periodInfo.duration);\n\n segmentIndexFunctions = {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex)\n };\n }\n\n return {\n createSegmentIndex: segmentIndexFunctions.createSegmentIndex,\n findSegmentPosition: segmentIndexFunctions.findSegmentPosition,\n getSegmentReference: segmentIndexFunctions.getSegmentReference,\n initSegmentReference: init,\n presentationTimeOffset: info.presentationTimeOffset\n };\n};\n\n\n/**\n * @typedef {{\n * timescale: number,\n * segmentDuration: ?number,\n * startNumber: number,\n * presentationTimeOffset: number,\n * unscaledPresentationTimeOffset: number,\n * timeline: Array.<shaka.dash.MpdUtils.TimeRange>,\n * mediaTemplate: ?string,\n * indexTemplate: ?string\n * }}\n * @private\n *\n * @description\n * Contains information about a SegmentTemplate.\n *\n * @property {number} timescale\n * The time-scale of the representation.\n * @property {?number} segmentDuration\n * The duration of the segments in seconds, if given.\n * @property {number} startNumber\n * The start number of the segments; 1 or greater.\n * @property {number} presentationTimeOffset\n * The presentationTimeOffset of the representation, in seconds.\n * @property {number} unscaledPresentationTimeOffset\n * The presentationTimeOffset of the representation, in timescale units.\n * @property {Array.<shaka.dash.MpdUtils.TimeRange>} timeline\n * The timeline of the representation, if given. Times in seconds.\n * @property {?string} mediaTemplate\n * The media URI template, if given.\n * @property {?string} indexTemplate\n * The index URI template, if given.\n */\nshaka.dash.SegmentTemplate.SegmentTemplateInfo;\n\n\n/**\n * @param {?shaka.dash.DashParser.InheritanceFrame} frame\n * @return {Element}\n * @private\n */\nshaka.dash.SegmentTemplate.fromInheritance_ = function(frame) {\n return frame.segmentTemplate;\n};\n\n\n/**\n * Parses a SegmentTemplate element into an info object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {shaka.dash.SegmentTemplate.SegmentTemplateInfo}\n * @private\n */\nshaka.dash.SegmentTemplate.parseSegmentTemplateInfo_ = function(context) {\n var SegmentTemplate = shaka.dash.SegmentTemplate;\n var MpdUtils = shaka.dash.MpdUtils;\n var segmentInfo =\n MpdUtils.parseSegmentInfo(context, SegmentTemplate.fromInheritance_);\n\n var media = MpdUtils.inheritAttribute(\n context, SegmentTemplate.fromInheritance_, 'media');\n var index = MpdUtils.inheritAttribute(\n context, SegmentTemplate.fromInheritance_, 'index');\n\n return {\n segmentDuration: segmentInfo.segmentDuration,\n timescale: segmentInfo.timescale,\n startNumber: segmentInfo.startNumber,\n presentationTimeOffset: segmentInfo.presentationTimeOffset,\n unscaledPresentationTimeOffset: segmentInfo.unscaledPresentationTimeOffset,\n timeline: segmentInfo.timeline,\n mediaTemplate: media,\n indexTemplate: index\n };\n};\n\n\n/**\n * Verifies a SegmentTemplate info object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.SegmentTemplate.checkSegmentTemplateInfo_ = function(context, info) {\n var n = 0;\n n += info.indexTemplate ? 1 : 0;\n n += info.timeline ? 1 : 0;\n n += info.segmentDuration ? 1 : 0;\n\n if (n == 0) {\n shaka.log.error(\n 'SegmentTemplate does not contain any segment information:',\n 'the SegmentTemplate must contain either an index URL template',\n 'a SegmentTimeline, or a segment duration.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n } else if (n != 1) {\n shaka.log.warning(\n 'SegmentTemplate containes multiple segment information sources:',\n 'the SegmentTemplate should only contain an index URL template,',\n 'a SegmentTimeline or a segment duration.',\n context.representation);\n if (info.indexTemplate) {\n shaka.log.info('Using the index URL template by default.');\n info.timeline = null;\n info.segmentDuration = null;\n } else {\n goog.asserts.assert(info.timeline, 'There should be a timeline');\n shaka.log.info('Using the SegmentTimeline by default.');\n info.segmentDuration = null;\n }\n }\n\n if (!info.indexTemplate && !info.mediaTemplate) {\n shaka.log.error(\n 'SegmentTemplate does not contain sufficient segment information:',\n 'the SegmentTemplate\\'s media URL template is missing.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n};\n\n\n/**\n * Creates segment index functions from a index URL template.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {shaka.media.InitSegmentReference} init\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @throws shaka.util.Error When there is a parsing error.\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n * @private\n */\nshaka.dash.SegmentTemplate.createFromIndexTemplate_ = function(\n context, requestInitSegment, init, info) {\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n // Determine the container type.\n var containerType = context.representation.mimeType.split('/')[1];\n if ((containerType != 'mp4') && (containerType != 'webm')) {\n shaka.log.error(\n 'SegmentTemplate specifies an unsupported container type.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_UNSUPPORTED_CONTAINER);\n }\n\n if ((containerType == 'webm') && !init) {\n shaka.log.error(\n 'SegmentTemplate does not contain sufficient segment information:',\n 'the SegmentTemplate uses a WebM container,',\n 'but does not contain an initialization URL template.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_WEBM_MISSING_INIT);\n }\n\n goog.asserts.assert(info.indexTemplate, 'must be using index template');\n var filledTemplate = MpdUtils.fillUriTemplate(\n info.indexTemplate, context.representation.id,\n null, context.bandwidth || null, null);\n\n var resolvedUris = ManifestParserUtils.resolveUris(\n context.representation.baseUris, [filledTemplate]);\n\n return shaka.dash.SegmentBase.createSegmentIndexFromUris(\n context, requestInitSegment, init, resolvedUris, 0, null, containerType,\n info.presentationTimeOffset);\n};\n\n\n/**\n * Creates segment index functions from a segment duration.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n * @private\n */\nshaka.dash.SegmentTemplate.createFromDuration_ = function(context, info) {\n goog.asserts.assert(info.mediaTemplate,\n 'There should be a media template with duration');\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var periodDuration = context.periodInfo.duration;\n var segmentDuration = info.segmentDuration;\n var startNumber = info.startNumber;\n var timescale = info.timescale;\n\n var template = info.mediaTemplate;\n var bandwidth = context.bandwidth || null;\n var id = context.representation.id;\n var baseUris = context.representation.baseUris;\n\n var find = function(periodTime) {\n if (periodTime < 0)\n return null;\n else if (periodDuration && periodTime >= periodDuration)\n return null;\n\n return Math.floor(periodTime / segmentDuration);\n };\n var get = function(position) {\n var segmentStart = position * segmentDuration;\n\n // Do not construct segments references that should not exist.\n if (segmentStart < 0)\n return null;\n else if (periodDuration && segmentStart >= periodDuration)\n return null;\n\n var getUris = function() {\n var mediaUri = MpdUtils.fillUriTemplate(\n template, id, position + startNumber, bandwidth,\n segmentStart * timescale);\n return ManifestParserUtils.resolveUris(baseUris, [mediaUri]);\n };\n\n return new shaka.media.SegmentReference(\n position, segmentStart, segmentStart + segmentDuration, getUris, 0,\n null);\n };\n\n return {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: find,\n getSegmentReference: get\n };\n};\n\n\n/**\n * Creates segment references from a timeline.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.dash.SegmentTemplate.createFromTimeline_ = function(context, info) {\n goog.asserts.assert(info.mediaTemplate,\n 'There should be a media template with a timeline');\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n /** @type {!Array.<!shaka.media.SegmentReference>} */\n var references = [];\n for (var i = 0; i < info.timeline.length; i++) {\n var start = info.timeline[i].start;\n var unscaledStart = info.timeline[i].unscaledStart;\n var end = info.timeline[i].end;\n\n // Note: i = k - 1, where k indicates the k'th segment listed in the MPD.\n // (See section 5.3.9.5.3 of the DASH spec.)\n var segmentReplacement = i + info.startNumber;\n\n // Consider the presentation time offset in segment uri computation\n var timeReplacement = unscaledStart +\n info.unscaledPresentationTimeOffset;\n var createUris = (function(\n template, repId, bandwidth, baseUris, segmentId, time) {\n var mediaUri = MpdUtils.fillUriTemplate(\n template, repId, segmentId, bandwidth, time);\n return ManifestParserUtils.resolveUris(baseUris, [mediaUri])\n .map(function(g) { return g.toString(); });\n }.bind(null, info.mediaTemplate, context.representation.id,\n context.bandwidth || null, context.representation.baseUris,\n segmentReplacement, timeReplacement));\n\n references.push(new shaka.media.SegmentReference(\n segmentReplacement, start, end, createUris, 0, null));\n }\n\n return references;\n};\n\n\n/**\n * Creates an init segment reference from a context object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {shaka.media.InitSegmentReference}\n * @private\n */\nshaka.dash.SegmentTemplate.createInitSegment_ = function(context) {\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var SegmentTemplate = shaka.dash.SegmentTemplate;\n\n var initialization = MpdUtils.inheritAttribute(\n context, SegmentTemplate.fromInheritance_, 'initialization');\n if (!initialization)\n return null;\n\n var repId = context.representation.id;\n var bandwidth = context.bandwidth || null;\n var baseUris = context.representation.baseUris;\n var getUris = function() {\n goog.asserts.assert(initialization, 'Should have returned earler');\n var filledTemplate = MpdUtils.fillUriTemplate(\n initialization, repId, null, bandwidth, null);\n var resolvedUris = ManifestParserUtils.resolveUris(\n baseUris, [filledTemplate]);\n return resolvedUris;\n };\n\n return new shaka.media.InitSegmentReference(getUris, 0, null);\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/segment_template.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.ManifestParser');\n\ngoog.require('goog.Uri');\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\n\n\n/**\n * @namespace shaka.media.ManifestParser\n * @summary An interface to register manifest parsers.\n * @exportDoc\n */\n\n\n/**\n * Contains the parser factory functions indexed by MIME type.\n *\n * @type {!Object.<string, shakaExtern.ManifestParser.Factory>}\n */\nshaka.media.ManifestParser.parsersByMime = {};\n\n\n/**\n * Contains the parser factory functions indexed by file extension.\n *\n * @type {!Object.<string, shakaExtern.ManifestParser.Factory>}\n */\nshaka.media.ManifestParser.parsersByExtension = {};\n\n\n/**\n * Registers a manifest parser by file extension.\n *\n * @param {string} extension The file extension of the manifest.\n * @param {shakaExtern.ManifestParser.Factory} parserFactory The factory\n * used to create parser instances.\n * @export\n */\nshaka.media.ManifestParser.registerParserByExtension = function(\n extension, parserFactory) {\n shaka.media.ManifestParser.parsersByExtension[extension] = parserFactory;\n};\n\n\n/**\n * Registers a manifest parser by MIME type.\n *\n * @param {string} mimeType The MIME type of the manifest.\n * @param {shakaExtern.ManifestParser.Factory} parserFactory The factory\n * used to create parser instances.\n * @export\n */\nshaka.media.ManifestParser.registerParserByMime = function(\n mimeType, parserFactory) {\n shaka.media.ManifestParser.parsersByMime[mimeType] = parserFactory;\n};\n\n\n/**\n * Returns a map of manifest support for well-known types.\n *\n * @return {!Object.<string, boolean>}\n */\nshaka.media.ManifestParser.probeSupport = function() {\n // Make sure all registered parsers are shown.\n var support = {};\n for (var type in shaka.media.ManifestParser.parsersByMime) {\n support[type] = true;\n }\n for (var type in shaka.media.ManifestParser.parsersByExtension) {\n support[type] = true;\n }\n\n // Make sure all well-known types are tested as well, just to show an explicit\n // false for things people might be expecting.\n var testMimeTypes = [\n // DASH\n 'application/dash+xml',\n // HLS\n 'application/x-mpegurl',\n 'application/vnd.apple.mpegurl',\n // SmoothStreaming\n 'application/vnd.ms-sstr+xml'\n ];\n var testExtensions = [\n // DASH\n 'mpd',\n // HLS\n 'm3u8',\n // SmoothStreaming\n 'ism'\n ];\n\n testMimeTypes.forEach(function(type) {\n support[type] = !!shaka.media.ManifestParser.parsersByMime[type];\n });\n testExtensions.forEach(function(type) {\n support[type] = !!shaka.media.ManifestParser.parsersByExtension[type];\n });\n\n return support;\n};\n\n\n/**\n * Finds a manifest parser factory to parse the given manifest.\n *\n * @param {string} manifestUri\n * @param {!shaka.net.NetworkingEngine} netEngine\n * @param {shakaExtern.RetryParameters} retryParams\n * @param {shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * @return {!Promise.<shakaExtern.ManifestParser.Factory>}\n */\nshaka.media.ManifestParser.getFactory = function(\n manifestUri, netEngine, retryParams, opt_manifestParserFactory) {\n var factory = opt_manifestParserFactory;\n var extension;\n\n if (!factory) {\n // Try to choose a manifest parser by file extension.\n var uriObj = new goog.Uri(manifestUri);\n var uriPieces = uriObj.getPath().split('/');\n var uriFilename = uriPieces.pop();\n var filenamePieces = uriFilename.split('.');\n // Only one piece means there is no extension.\n if (filenamePieces.length > 1) {\n extension = filenamePieces.pop().toLowerCase();\n factory = shaka.media.ManifestParser.parsersByExtension[extension];\n }\n }\n\n if (factory)\n return Promise.resolve(factory);\n\n // Try to choose a manifest parser by MIME type.\n var headRequest =\n shaka.net.NetworkingEngine.makeRequest([manifestUri], retryParams);\n headRequest.method = 'HEAD';\n var type = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n\n return netEngine.request(type, headRequest).then(\n function(response) {\n var mimeType = response.headers['content-type'];\n // https://goo.gl/yzKDRx says this header should always be available,\n // but just to be safe:\n if (mimeType) {\n mimeType = mimeType.toLowerCase();\n }\n factory = shaka.media.ManifestParser.parsersByMime[mimeType];\n if (!factory) {\n shaka.log.error(\n 'Unable to guess manifest type by file extension ' +\n 'or by MIME type.', extension, mimeType);\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.UNABLE_TO_GUESS_MANIFEST_TYPE,\n manifestUri));\n }\n return factory;\n }, function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Incorrect error type');\n shaka.log.error('HEAD request to guess manifest type failed!', error);\n error.severity = shaka.util.Error.Severity.CRITICAL;\n return Promise.reject(error);\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/manifest_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.PresentationTimeline');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\n\n\n\n/**\n * Creates a PresentationTimeline.\n *\n * @param {?number} presentationStartTime The wall-clock time, in seconds,\n * when the presentation started or will start. Only required for live.\n * @param {number} presentationDelay The delay to give the presentation, in\n * seconds. Only required for live.\n *\n * @see {shakaExtern.Manifest}\n * @see {@tutorial architecture}\n *\n * @constructor\n * @struct\n * @export\n */\nshaka.media.PresentationTimeline = function(\n presentationStartTime, presentationDelay) {\n /** @private {?number} */\n this.presentationStartTime_ = presentationStartTime;\n\n /** @private {number} */\n this.presentationDelay_ = presentationDelay;\n\n /** @private {number} */\n this.duration_ = Infinity;\n\n /** @private {number} */\n this.segmentAvailabilityDuration_ = Infinity;\n\n /** @private {?number} */\n this.maxSegmentDuration_ = 1;\n\n /** @private {number} */\n this.clockOffset_ = 0;\n\n /** @private {boolean} */\n this.static_ = true;\n};\n\n\n/**\n * @return {number} The presentation's duration in seconds.\n * Infinity indicates that the presentation continues indefinitely.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getDuration = function() {\n return this.duration_;\n};\n\n\n/**\n * Sets the presentation's duration.\n *\n * @param {number} duration The presentation's duration in seconds.\n * Infinity indicates that the presentation continues indefinitely.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setDuration = function(duration) {\n goog.asserts.assert(duration > 0, 'duration must be > 0');\n this.duration_ = duration;\n};\n\n\n/**\n * @return {?number} The presentation's start time in seconds.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getPresentationStartTime =\n function() {\n return this.presentationStartTime_;\n};\n\n\n/**\n * Sets the clock offset, which is the the difference between the client's clock\n * and the server's clock, in milliseconds (i.e., serverTime = Date.now() +\n * clockOffset).\n *\n * @param {number} offset The clock offset, in ms.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setClockOffset = function(offset) {\n this.clockOffset_ = offset;\n};\n\n\n/**\n * Sets the presentation's static flag.\n *\n * @param {boolean} isStatic If true, the presentation is static, meaning all\n * segments are available at once.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setStatic = function(isStatic) {\n // NOTE: the argument name is not \"static\" because that's a keyword in ES6\n this.static_ = isStatic;\n};\n\n\n/**\n * Gets the presentation's segment availability duration, which is the amount\n * of time, in seconds, that the start of a segment remains available after the\n * live-edge moves past the end of that segment. Infinity indicates that\n * segments remain available indefinitely. For example, if your live\n * presentation has a 5 minute DVR window and your segments are 10 seconds long\n * then the segment availability duration should be 4 minutes and 50 seconds.\n *\n * @return {number} The presentation's segment availability duration.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSegmentAvailabilityDuration =\n function() {\n return this.segmentAvailabilityDuration_;\n};\n\n\n/**\n * Sets the presentation's segment availability duration. The segment\n * availability duration should only be set for live.\n *\n * @param {number} segmentAvailabilityDuration The presentation's new segment\n * availability duration in seconds.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setSegmentAvailabilityDuration =\n function(segmentAvailabilityDuration) {\n goog.asserts.assert(segmentAvailabilityDuration >= 0,\n 'segmentAvailabilityDuration must be >= 0');\n this.segmentAvailabilityDuration_ = segmentAvailabilityDuration;\n};\n\n\n/**\n * Gives PresentationTimeline a Stream's segments so it can size and position\n * the segment availability window, and account for missing segment\n * information. This function should be called once for each Stream (no more,\n * no less).\n *\n * @param {number} periodStartTime\n * @param {!Array.<!shaka.media.SegmentReference>} references\n * @export\n */\nshaka.media.PresentationTimeline.prototype.notifySegments = function(\n periodStartTime, references) {\n if (references.length == 0)\n return;\n\n this.maxSegmentDuration_ = references.reduce(\n function(max, r) { return Math.max(max, r.endTime - r.startTime); },\n this.maxSegmentDuration_);\n\n shaka.log.v1('notifySegments:',\n 'maxSegmentDuration=' + this.maxSegmentDuration_);\n};\n\n\n/**\n * Gives PresentationTimeline a Stream's maximum segment duration so it can\n * size and position the segment availability window. This function should be\n * called once for each Stream (no more, no less), but does not have to be\n * called if notifySegments() is called instead for a particular stream.\n *\n * @param {number} maxSegmentDuration The maximum segment duration for a\n * particular stream.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.notifyMaxSegmentDuration = function(\n maxSegmentDuration) {\n this.maxSegmentDuration_ = Math.max(\n this.maxSegmentDuration_, maxSegmentDuration);\n\n shaka.log.v1('notifyNewSegmentDuration:',\n 'maxSegmentDuration=' + this.maxSegmentDuration_);\n};\n\n\n/**\n * @return {boolean} True if the presentation is live; otherwise, return\n * false.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.isLive = function() {\n return this.duration_ == Infinity &&\n !this.static_;\n};\n\n\n/**\n * @return {boolean} True if the presentation is in progress (meaning not live,\n * but also not completely available); otherwise, return false.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.isInProgress = function() {\n return this.duration_ != Infinity &&\n !this.static_;\n};\n\n\n/**\n * Gets the presentation's current segment availability start time. Segments\n * ending at or before this time should be assumed to be unavailable.\n *\n * @return {number} The current segment availability start time, in seconds,\n * relative to the start of the presentation.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSegmentAvailabilityStart =\n function() {\n return this.getSafeAvailabilityStart(0 /* delay */);\n};\n\n\n/**\n * Gets the presentation's current segment availability start time, offset by\n * the given amount. This is used to ensure that we don't \"fall\" back out of\n * the availability window while we are buffering.\n *\n * @param {number} offset The offset to add to the start time.\n * @return {number} The current segment availability start time, in seconds,\n * relative to the start of the presentation.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSafeAvailabilityStart =\n function(offset) {\n if (this.segmentAvailabilityDuration_ == Infinity)\n return 0;\n\n var end = this.getSegmentAvailabilityEnd();\n var start = Math.min(end - this.segmentAvailabilityDuration_ + offset, end);\n return Math.max(0, start);\n};\n\n\n/**\n * Gets the presentation's current segment availability end time. Segments\n * starting after this time should be assumed to be unavailable.\n *\n * @return {number} The current segment availability end time, in seconds,\n * relative to the start of the presentation. Always returns the\n * presentation's duration for video-on-demand.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSegmentAvailabilityEnd =\n function() {\n if (!this.isLive() && !this.isInProgress())\n return this.duration_;\n\n return Math.min(this.getLiveEdge_(), this.duration_);\n};\n\n\n/**\n * Gets the seek range end.\n *\n * @return {number}\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSeekRangeEnd = function() {\n var useDelay = this.isLive() || this.isInProgress();\n var delay = useDelay ? this.presentationDelay_ : 0;\n return Math.max(0, this.getSegmentAvailabilityEnd() - delay);\n};\n\n\n/**\n * @return {number} The current presentation time in seconds.\n * @private\n */\nshaka.media.PresentationTimeline.prototype.getLiveEdge_ = function() {\n goog.asserts.assert(this.presentationStartTime_ != null,\n 'Cannot compute timeline live edge without start time');\n var now = (Date.now() + this.clockOffset_) / 1000.0;\n return Math.max(\n 0, now - this.maxSegmentDuration_ - this.presentationStartTime_);\n};\n\n\nif (!COMPILED) {\n /**\n * Debug only: assert that the timeline parameters make sense for the type of\n * presentation (VOD, IPR, live).\n */\n shaka.media.PresentationTimeline.prototype.assertIsValid = function() {\n if (this.isLive()) {\n // Implied by isLive(): infinite and dynamic.\n // Live streams should have a start time.\n goog.asserts.assert(this.presentationStartTime_ != null,\n 'Detected as live stream, but does not match our model of live!');\n } else if (this.isInProgress()) {\n // Implied by isInProgress(): finite and dynamic.\n // IPR streams should have a start time, and segments should not expire.\n goog.asserts.assert(this.presentationStartTime_ != null &&\n this.segmentAvailabilityDuration_ == Infinity,\n 'Detected as IPR stream, but does not match our model of IPR!');\n } else { // VOD\n // VOD segments should not expire and the presentation should be finite\n // and static.\n goog.asserts.assert(this.segmentAvailabilityDuration_ == Infinity &&\n this.duration_ != Infinity &&\n this.static_,\n 'Detected as VOD stream, but does not match our model of VOD!');\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/presentation_timeline.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.DashParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.ContentProtection');\ngoog.require('shaka.dash.SegmentBase');\ngoog.require('shaka.dash.SegmentList');\ngoog.require('shaka.dash.SegmentTemplate');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.LanguageUtils');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n\n/**\n * Creates a new DASH parser.\n *\n * @struct\n * @constructor\n * @implements {shakaExtern.ManifestParser}\n * @export\n */\nshaka.dash.DashParser = function() {\n /** @private {?shakaExtern.ManifestConfiguration} */\n this.config_ = null;\n\n /** @private {?shakaExtern.ManifestParser.PlayerInterface} */\n this.playerInterface_ = null;\n\n /** @private {!Array.<string>} */\n this.manifestUris_ = [];\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = null;\n\n /** @private {!Array.<string>} */\n this.periodIds_ = [];\n\n /** @private {number} */\n this.globalId_ = 1;\n\n /**\n * A map of IDs to SegmentIndex objects.\n * ID: Period@id,AdaptationSet@id,@Representation@id\n * e.g.: '1,5,23'\n * @private {!Object.<string, !shaka.media.SegmentIndex>}\n */\n this.segmentIndexMap_ = {};\n\n /**\n * The update period in seconds; or 0 for no updates.\n * @private {number}\n */\n this.updatePeriod_ = 0;\n\n /** @private {?number} */\n this.updateTimer_ = null;\n};\n\n\n/**\n * Contains the minimum amount of time, in seconds, between manifest update\n * requests.\n *\n * @private\n * @const {number}\n */\nshaka.dash.DashParser.MIN_UPDATE_PERIOD_ = 3;\n\n\n/**\n * The default MPD@suggestedPresentationDelay in seconds.\n *\n * @private\n * @const {number}\n */\nshaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_ = 10;\n\n\n/**\n * @typedef {\n * !function(!Array.<string>, ?number, ?number):!Promise.<!ArrayBuffer>\n * }\n */\nshaka.dash.DashParser.RequestInitSegmentCallback;\n\n\n/**\n * @typedef {{\n * segmentBase: Element,\n * segmentList: Element,\n * segmentTemplate: Element,\n * baseUris: !Array.<string>,\n * width: (number|undefined),\n * height: (number|undefined),\n * contentType: string,\n * mimeType: string,\n * codecs: string,\n * frameRate: (number|undefined),\n * containsEmsgBoxes: boolean,\n * id: string\n * }}\n *\n * @description\n * A collection of elements and properties which are inherited across levels\n * of a DASH manifest.\n *\n * @property {Element} segmentBase\n * The XML node for SegmentBase.\n * @property {Element} segmentList\n * The XML node for SegmentList.\n * @property {Element} segmentTemplate\n * The XML node for SegmentTemplate.\n * @property {!Array.<string>} baseUris\n * An array of absolute base URIs for the frame.\n * @property {(number|undefined)} width\n * The inherited width value.\n * @property {(number|undefined)} height\n * The inherited height value.\n * @property {string} contentType\n * The inherited media type.\n * @property {string} mimeType\n * The inherited MIME type value.\n * @property {string} codecs\n * The inherited codecs value.\n * @property {(number|undefined)} frameRate\n * The inherited framerate value.\n * @property {boolean} containsEmsgBoxes\n * Whether there are 'emsg' boxes.\n * @property {string} id\n * The ID of the element.\n */\nshaka.dash.DashParser.InheritanceFrame;\n\n\n/**\n * @typedef {{\n * dynamic: boolean,\n * presentationTimeline: !shaka.media.PresentationTimeline,\n * period: ?shaka.dash.DashParser.InheritanceFrame,\n * periodInfo: ?shaka.dash.DashParser.PeriodInfo,\n * adaptationSet: ?shaka.dash.DashParser.InheritanceFrame,\n * representation: ?shaka.dash.DashParser.InheritanceFrame,\n * bandwidth: (number|undefined),\n * indexRangeWarningGiven: boolean\n * }}\n *\n * @description\n * Contains context data for the streams.\n *\n * @property {boolean} dynamic\n * True if the MPD is dynamic (not all segments available at once)\n * @property {!shaka.media.PresentationTimeline} presentationTimeline\n * The PresentationTimeline.\n * @property {?shaka.dash.DashParser.InheritanceFrame} period\n * The inheritance from the Period element.\n * @property {?shaka.dash.DashParser.PeriodInfo} periodInfo\n * The Period info for the current Period.\n * @property {?shaka.dash.DashParser.InheritanceFrame} adaptationSet\n * The inheritance from the AdaptationSet element.\n * @property {?shaka.dash.DashParser.InheritanceFrame} representation\n * The inheritance from the Representation element.\n * @property {(number|undefined)} bandwidth\n * The bandwidth of the Representation.\n * @property {boolean} indexRangeWarningGiven\n * True if the warning about SegmentURL@indexRange has been printed.\n */\nshaka.dash.DashParser.Context;\n\n\n/**\n * @typedef {{\n * start: number,\n * duration: ?number,\n * node: !Element,\n * isLastPeriod: boolean\n * }}\n *\n * @description\n * Contains information about a Period element.\n *\n * @property {number} start\n * The start time of the period.\n * @property {?number} duration\n * The duration of the period; or null if the duration is not given. This\n * will be non-null for all periods except the last.\n * @property {!Element} node\n * The XML Node for the Period.\n * @property {boolean} isLastPeriod\n * Whether this Period is the last one in the manifest.\n */\nshaka.dash.DashParser.PeriodInfo;\n\n\n/**\n * @typedef {{\n * id: string,\n * contentType: ?string,\n * language: string,\n * main: boolean,\n * streams: !Array.<shakaExtern.Stream>,\n * drmInfos: !Array.<shakaExtern.DrmInfo>,\n * trickModeFor: ?string,\n * representationIds: !Array.<string>\n * }}\n *\n * @description\n * Contains information about an AdaptationSet element.\n *\n * @property {string} id\n * The unique ID of the adaptation set.\n * @property {?string} contentType\n * The content type of the AdaptationSet.\n * @property {string} language\n * The language of the AdaptationSet.\n * @property {boolean} main\n * Whether the AdaptationSet has the 'main' type.\n * @property {!Array.<shakaExtern.Stream>} streams\n * The streams this AdaptationSet contains.\n * @property {!Array.<shakaExtern.DrmInfo>} drmInfos\n * The DRM info for the AdaptationSet.\n * @property {?string} trickModeFor\n * If non-null, this AdaptationInfo represents trick mode tracks. This\n * property is the ID of the normal AdaptationSet these tracks should be\n * associated with.\n * @property {!Array.<string>} representationIds\n * An array of the IDs of the Representations this AdaptationSet contains.\n */\nshaka.dash.DashParser.AdaptationInfo;\n\n\n/**\n * @typedef {{\n * createSegmentIndex: shakaExtern.CreateSegmentIndexFunction,\n * findSegmentPosition: shakaExtern.FindSegmentPositionFunction,\n * getSegmentReference: shakaExtern.GetSegmentReferenceFunction\n * }}\n *\n * @description\n * Contains functions used to create and find segment references.\n *\n * @property {shakaExtern.CreateSegmentIndexFunction} createSegmentIndex\n * The createSegmentIndex function.\n * @property {shakaExtern.FindSegmentPositionFunction} findSegmentPosition\n * The findSegmentPosition function.\n * @property {shakaExtern.GetSegmentReferenceFunction} getSegmentReference\n * The getSegmentReference function.\n */\nshaka.dash.DashParser.SegmentIndexFunctions;\n\n\n/**\n * @typedef {{\n * createSegmentIndex: shakaExtern.CreateSegmentIndexFunction,\n * findSegmentPosition: shakaExtern.FindSegmentPositionFunction,\n * getSegmentReference: shakaExtern.GetSegmentReferenceFunction,\n * initSegmentReference: shaka.media.InitSegmentReference,\n * presentationTimeOffset: (number|undefined)\n * }}\n *\n * @description\n * Contains information about a Stream. This is passed from the createStream\n * methods.\n *\n * @property {shakaExtern.CreateSegmentIndexFunction} createSegmentIndex\n * The createSegmentIndex function for the stream.\n * @property {shakaExtern.FindSegmentPositionFunction} findSegmentPosition\n * The findSegmentPosition function for the stream.\n * @property {shakaExtern.GetSegmentReferenceFunction} getSegmentReference\n * The getSegmentReference function for the stream.\n * @property {shaka.media.InitSegmentReference} initSegmentReference\n * The init segment for the stream.\n * @property {(number|undefined)} presentationTimeOffset\n * The presentationTimeOffset for the stream.\n */\nshaka.dash.DashParser.StreamInfo;\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.configure = function(config) {\n goog.asserts.assert(config.dash != null,\n 'DashManifestConfiguration should not be null!');\n\n this.config_ = config;\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.start = function(uri, playerInterface) {\n goog.asserts.assert(this.config_, 'Must call configure() before start()!');\n this.manifestUris_ = [uri];\n this.playerInterface_ = playerInterface;\n return this.requestManifest_().then(function() {\n if (this.playerInterface_)\n this.setUpdateTimer_(0);\n return this.manifest_;\n }.bind(this));\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.stop = function() {\n this.playerInterface_ = null;\n this.config_ = null;\n\n this.manifestUris_ = [];\n this.manifest_ = null;\n this.periodIds_ = [];\n this.segmentIndexMap_ = {};\n if (this.updateTimer_ != null) {\n window.clearTimeout(this.updateTimer_);\n this.updateTimer_ = null;\n }\n\n return Promise.resolve();\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.update = function() {\n this.requestManifest_().catch(function(error) {\n if (!this.playerInterface_) return;\n this.playerInterface_.onError(error);\n }.bind(this));\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.onExpirationUpdated = function(\n sessionId, expiration) {\n // No-op\n};\n\n\n/**\n * Makes a network request for the manifest and parses the resulting data.\n *\n * @return {!Promise}\n * @private\n */\nshaka.dash.DashParser.prototype.requestManifest_ = function() {\n var requestType = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n var request = shaka.net.NetworkingEngine.makeRequest(\n this.manifestUris_, this.config_.retryParameters);\n return this.playerInterface_.networkingEngine.request(requestType, request)\n .then(function(response) {\n // Detect calls to stop().\n if (!this.playerInterface_)\n return;\n\n // This may throw; but it will result in a failed promise.\n return this.parseManifest_(response.data, response.uri);\n }.bind(this));\n};\n\n\n/**\n * Parses the manifest XML. This also handles updates and will update the\n * stored manifest.\n *\n * @param {!ArrayBuffer} data\n * @param {string} finalManifestUri The final manifest URI, which may\n * differ from this.manifestUri_ if there has been a redirect.\n * @return {!Promise}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parseManifest_ =\n function(data, finalManifestUri) {\n var Error = shaka.util.Error;\n var Functional = shaka.util.Functional;\n var XmlUtils = shaka.util.XmlUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var string = shaka.util.StringUtils.fromUTF8(data);\n var parser = new DOMParser();\n var xml = null;\n var mpd = null;\n\n try {\n xml = parser.parseFromString(string, 'text/xml');\n } catch (exception) {}\n if (xml) {\n // parseFromString returns a Document object. A Document is a Node but not\n // an Element, so it cannot be used in XmlUtils (technically it can but the\n // types don't match). The |documentElement| member defines the top-level\n // element in the document.\n if (xml.documentElement.tagName == 'MPD')\n mpd = xml.documentElement;\n }\n if (mpd && mpd.getElementsByTagName('parsererror').length > 0)\n mpd = null; // It had a parser error in it.\n if (!mpd) {\n throw new Error(\n Error.Severity.CRITICAL, Error.Category.MANIFEST,\n Error.Code.DASH_INVALID_XML);\n }\n\n // Get any Location elements. This will update the manifest location and\n // the base URI.\n /** @type {!Array.<string>} */\n var manifestBaseUris = [finalManifestUri];\n /** @type {!Array.<string>} */\n var locations = XmlUtils.findChildren(mpd, 'Location')\n .map(XmlUtils.getContents)\n .filter(Functional.isNotNull);\n if (locations.length > 0) {\n this.manifestUris_ = locations;\n manifestBaseUris = locations;\n }\n\n var uris = XmlUtils.findChildren(mpd, 'BaseURL').map(XmlUtils.getContents);\n var baseUris = ManifestParserUtils.resolveUris(manifestBaseUris, uris);\n\n var minBufferTime =\n XmlUtils.parseAttr(mpd, 'minBufferTime', XmlUtils.parseDuration);\n this.updatePeriod_ = /** @type {number} */ (XmlUtils.parseAttr(\n mpd, 'minimumUpdatePeriod', XmlUtils.parseDuration, -1));\n\n var presentationStartTime = XmlUtils.parseAttr(\n mpd, 'availabilityStartTime', XmlUtils.parseDate);\n var segmentAvailabilityDuration = XmlUtils.parseAttr(\n mpd, 'timeShiftBufferDepth', XmlUtils.parseDuration);\n var suggestedPresentationDelay = XmlUtils.parseAttr(\n mpd, 'suggestedPresentationDelay', XmlUtils.parseDuration);\n var maxSegmentDuration = XmlUtils.parseAttr(\n mpd, 'maxSegmentDuration', XmlUtils.parseDuration);\n var mpdType = mpd.getAttribute('type') || 'static';\n\n var presentationTimeline;\n if (this.manifest_) {\n presentationTimeline = this.manifest_.presentationTimeline;\n } else {\n // DASH IOP v3.0 suggests using a default delay between minBufferTime and\n // timeShiftBufferDepth. This is literally the range of all feasible\n // choices for the value. Nothing older than timeShiftBufferDepth is still\n // available, and anything less than minBufferTime will cause buffering\n // issues.\n //\n // We have decided that our default will be 1.5 * minBufferTime, or 10s,\n // whichever is larger. This is fairly conservative. Content providers\n // should provide a suggestedPresentationDelay whenever possible to optimize\n // the live streaming experience.\n var defaultPresentationDelay = Math.max(\n shaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_,\n minBufferTime * 1.5);\n var presentationDelay = suggestedPresentationDelay != null ?\n suggestedPresentationDelay : defaultPresentationDelay;\n presentationTimeline = new shaka.media.PresentationTimeline(\n presentationStartTime, presentationDelay);\n }\n\n /** @type {shaka.dash.DashParser.Context} */\n var context = {\n // Don't base on updatePeriod_ since emsg boxes can cause manifest updates.\n dynamic: mpdType != 'static',\n presentationTimeline: presentationTimeline,\n period: null,\n periodInfo: null,\n adaptationSet: null,\n representation: null,\n bandwidth: undefined,\n indexRangeWarningGiven: false\n };\n\n var periodsAndDuration = this.parsePeriods_(context, baseUris, mpd);\n var duration = periodsAndDuration.duration;\n var periods = periodsAndDuration.periods;\n\n presentationTimeline.setStatic(mpdType == 'static');\n presentationTimeline.setDuration(duration || Infinity);\n presentationTimeline.setSegmentAvailabilityDuration(\n segmentAvailabilityDuration != null ?\n segmentAvailabilityDuration :\n Infinity);\n // Use @maxSegmentDuration to override smaller, derived values.\n presentationTimeline.notifyMaxSegmentDuration(maxSegmentDuration || 1);\n if (!COMPILED) presentationTimeline.assertIsValid();\n\n if (this.manifest_) {\n // This is a manifest update, so we're done.\n return Promise.resolve();\n }\n\n // This is the first manifest parse, so we cannot return until we calculate\n // the clock offset.\n var timingElements = XmlUtils.findChildren(mpd, 'UTCTiming');\n\n var isLive = presentationTimeline.isLive();\n\n return this.parseUtcTiming_(\n baseUris, timingElements, isLive).then(function(offset) {\n // Detect calls to stop().\n if (!this.playerInterface_)\n return;\n\n presentationTimeline.setClockOffset(offset);\n\n this.manifest_ = {\n presentationTimeline: presentationTimeline,\n periods: periods,\n offlineSessionIds: [],\n minBufferTime: minBufferTime || 0\n };\n }.bind(this));\n};\n\n\n/**\n * Reads and parses the periods from the manifest. This first does some\n * partial parsing so the start and duration is available when parsing children.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Array.<string>} baseUris\n * @param {!Element} mpd\n * @return {{periods: !Array.<shakaExtern.Period>, duration: ?number}}\n * @private\n */\nshaka.dash.DashParser.prototype.parsePeriods_ = function(\n context, baseUris, mpd) {\n var Functional = shaka.util.Functional;\n var XmlUtils = shaka.util.XmlUtils;\n var presentationDuration = XmlUtils.parseAttr(\n mpd, 'mediaPresentationDuration', XmlUtils.parseDuration);\n\n var periods = [];\n var prevEnd = 0;\n var periodNodes = XmlUtils.findChildren(mpd, 'Period');\n for (var i = 0; i < periodNodes.length; i++) {\n var elem = periodNodes[i];\n var start = /** @type {number} */ (\n XmlUtils.parseAttr(elem, 'start', XmlUtils.parseDuration, prevEnd));\n var givenDuration =\n XmlUtils.parseAttr(elem, 'duration', XmlUtils.parseDuration);\n\n var periodDuration = null;\n if (i != periodNodes.length - 1) {\n // \"The difference between the start time of a Period and the start time\n // of the following Period is the duration of the media content\n // represented by this Period.\"\n var nextPeriod = periodNodes[i + 1];\n var nextStart =\n XmlUtils.parseAttr(nextPeriod, 'start', XmlUtils.parseDuration);\n if (nextStart != null)\n periodDuration = nextStart - start;\n } else if (presentationDuration != null) {\n // \"The Period extends until the Period.start of the next Period, or\n // until the end of the Media Presentation in the case of the last\n // Period.\"\n periodDuration = presentationDuration - start;\n }\n\n if (periodDuration && givenDuration && periodDuration != givenDuration) {\n shaka.log.warning('There is a gap/overlap between Periods', elem);\n }\n // Only use the @duration in the MPD if we can't calculate it. We should\n // favor the @start of the following Period. This ensures that there aren't\n // gaps between Periods.\n if (periodDuration == null)\n periodDuration = givenDuration;\n\n\n // Parse child nodes.\n var info = {\n start: start,\n duration: periodDuration,\n node: elem,\n isLastPeriod: periodDuration == null || i == periodNodes.length - 1\n };\n var period = this.parsePeriod_(context, baseUris, info);\n periods.push(period);\n\n // If there are any new periods, call the callback and add them to the\n // manifest. If this is the first parse, it will see all of them as new.\n var periodId = context.period.id;\n if (this.periodIds_.every(Functional.isNotEqualFunc(periodId))) {\n this.playerInterface_.filterPeriod(period);\n this.periodIds_.push(periodId);\n if (this.manifest_)\n this.manifest_.periods.push(period);\n }\n\n\n if (periodDuration == null) {\n if (i != periodNodes.length - 1) {\n // If the duration is still null and we aren't at the end, then we will\n // skip any remaining periods.\n shaka.log.warning(\n 'Skipping Period', i + 1, 'and any subsequent Periods:', 'Period',\n i + 1, 'does not have a valid start time.', periods[i + 1]);\n }\n\n // The duration is unknown, so the end is unknown.\n prevEnd = null;\n break;\n }\n\n prevEnd = start + periodDuration;\n }\n\n if (presentationDuration != null) {\n if (prevEnd != presentationDuration) {\n shaka.log.warning(\n '@mediaPresentationDuration does not match the total duration of all',\n 'Periods.');\n // Assume @mediaPresentationDuration is correct.\n }\n return {\n periods: periods,\n duration: presentationDuration\n };\n } else {\n return {\n periods: periods,\n duration: prevEnd\n };\n }\n};\n\n\n/**\n * Parses a Period XML element. Unlike the other parse methods, this is not\n * given the Node; it is given a PeriodInfo structure. Also, partial parsing\n * was done before this was called so start and duration are valid.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Array.<string>} baseUris\n * @param {shaka.dash.DashParser.PeriodInfo} periodInfo\n * @return {shakaExtern.Period}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parsePeriod_ = function(\n context, baseUris, periodInfo) {\n var Functional = shaka.util.Functional;\n var XmlUtils = shaka.util.XmlUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n context.period = this.createFrame_(periodInfo.node, null, baseUris);\n context.periodInfo = periodInfo;\n\n // If the period doesn't have an ID, give it one based on its start time.\n if (!context.period.id) {\n shaka.log.info(\n 'No Period ID given for Period with start time ' + periodInfo.start +\n ', Assigning a default');\n context.period.id = '__shaka_period_' + periodInfo.start;\n }\n\n var eventStreamNodes = XmlUtils.findChildren(periodInfo.node, 'EventStream');\n eventStreamNodes.forEach(\n this.parseEventStream_.bind(this, periodInfo.start, periodInfo.duration));\n\n var adaptationSetNodes =\n XmlUtils.findChildren(periodInfo.node, 'AdaptationSet');\n var adaptationSets = adaptationSetNodes\n .map(this.parseAdaptationSet_.bind(this, context))\n .filter(Functional.isNotNull);\n\n var representationIds = adaptationSets\n .map(function(as) { return as.representationIds; })\n .reduce(Functional.collapseArrays, []);\n var uniqueRepIds = representationIds.filter(Functional.isNotDuplicate);\n if (context.dynamic && representationIds.length != uniqueRepIds.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_DUPLICATE_REPRESENTATION_ID);\n }\n\n var normalAdaptationSets = adaptationSets\n .filter(function(as) { return !as.trickModeFor; });\n\n var trickModeAdaptationSets = adaptationSets\n .filter(function(as) { return as.trickModeFor; });\n\n // Attach trick mode tracks to normal tracks.\n trickModeAdaptationSets.forEach(function(trickModeSet) {\n // There may be multiple trick mode streams, but we do not currently\n // support that. Just choose one.\n var trickModeVideo = trickModeSet.streams[0];\n var targetId = trickModeSet.trickModeFor;\n normalAdaptationSets.forEach(function(normalSet) {\n if (normalSet.id == targetId) {\n normalSet.streams.forEach(function(stream) {\n stream.trickModeVideo = trickModeVideo;\n });\n }\n });\n });\n\n var videoSets = this.getSetsOfType_(normalAdaptationSets, ContentType.VIDEO);\n var audioSets = this.getSetsOfType_(normalAdaptationSets, ContentType.AUDIO);\n\n if (!videoSets.length && !audioSets.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_EMPTY_PERIOD);\n }\n\n // In case of audio-only or video-only content, we create an array of one item\n // containing a null. This way, the double-loop works for all kinds of\n // content.\n if (!audioSets.length) {\n audioSets = [null];\n }\n if (!videoSets.length) {\n videoSets = [null];\n }\n\n // TODO: Limit number of combinations. Come up with a heuristic\n // to decide which audio tracks to combine with which video tracks.\n var variants = [];\n for (var i = 0; i < audioSets.length; i++) {\n for (var j = 0; j < videoSets.length; j++) {\n var audioSet = audioSets[i];\n var videoSet = videoSets[j];\n this.createVariants_(audioSet, videoSet, variants);\n }\n }\n\n var textSets = this.getSetsOfType_(normalAdaptationSets, ContentType.TEXT);\n var textStreams = [];\n for (var i = 0; i < textSets.length; i++) {\n textStreams.push.apply(textStreams, textSets[i].streams);\n }\n\n return {\n startTime: periodInfo.start,\n textStreams: textStreams,\n variants: variants\n };\n};\n\n\n/**\n * @param {!Array.<!shaka.dash.DashParser.AdaptationInfo>} adaptationSets\n * @param {string} type\n * @return {!Array.<!shaka.dash.DashParser.AdaptationInfo>}\n * @private\n */\nshaka.dash.DashParser.prototype.getSetsOfType_ = function(\n adaptationSets, type) {\n return adaptationSets.filter(function(as) {\n return as.contentType == type;\n });\n};\n\n\n/**\n * Combines Streams into Variants\n *\n * @param {?shaka.dash.DashParser.AdaptationInfo} audio\n * @param {?shaka.dash.DashParser.AdaptationInfo} video\n * @param {!Array.<shakaExtern.Variant>} variants New variants are pushed onto\n * this array.\n * @private\n */\nshaka.dash.DashParser.prototype.createVariants_ =\n function(audio, video, variants) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Since both audio and video are of the same type, this assertion will catch\n // certain mistakes at runtime that the compiler would miss.\n goog.asserts.assert(!audio || audio.contentType == ContentType.AUDIO,\n 'Audio parameter mismatch!');\n goog.asserts.assert(!video || video.contentType == ContentType.VIDEO,\n 'Video parameter mismatch!');\n\n /** @type {number} */\n var bandwidth;\n /** @type {shakaExtern.Variant} */\n var variant;\n\n if (!audio && !video) {\n return;\n } else if (audio && video) {\n // Audio+video variants\n var DrmEngine = shaka.media.DrmEngine;\n if (DrmEngine.areDrmCompatible(audio.drmInfos, video.drmInfos)) {\n var drmInfos = DrmEngine.getCommonDrmInfos(audio.drmInfos,\n video.drmInfos);\n\n for (var i = 0; i < audio.streams.length; i++) {\n for (var j = 0; j < video.streams.length; j++) {\n // Explicit cast, followed by assertion. These should both be defined\n // in the case of DASH, but the type of Stream.bandwidth allows for\n // undefined in order to support HLS.\n bandwidth = /** @type {number} */(\n video.streams[j].bandwidth +\n audio.streams[i].bandwidth);\n goog.asserts.assert(bandwidth,\n 'Bandwidth must be defined and non-zero!');\n variant = {\n id: this.globalId_++,\n language: audio.language,\n primary: audio.main || video.main,\n audio: audio.streams[i],\n video: video.streams[j],\n bandwidth: bandwidth,\n drmInfos: drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n\n variants.push(variant);\n }\n }\n }\n } else {\n // Audio or video only variants\n var set = audio || video;\n for (var i = 0; i < set.streams.length; i++) {\n // Explicit cast, followed by assertion. These should both be defined\n // in the case of DASH, but the type allows for undefined in order to\n // support HLS.\n bandwidth = /** @type {number} */(set.streams[i].bandwidth);\n goog.asserts.assert(bandwidth,\n 'Bandwidth must be defined and non-zero!');\n variant = {\n id: this.globalId_++,\n language: set.language || 'und',\n primary: set.main,\n audio: audio ? set.streams[i] : null,\n video: video ? set.streams[i] : null,\n bandwidth: bandwidth,\n drmInfos: set.drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n\n variants.push(variant);\n }\n }\n};\n\n\n/**\n * Parses an AdaptationSet XML element.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Element} elem The AdaptationSet element.\n * @return {?shaka.dash.DashParser.AdaptationInfo}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parseAdaptationSet_ = function(context, elem) {\n var XmlUtils = shaka.util.XmlUtils;\n var Functional = shaka.util.Functional;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var ContentType = ManifestParserUtils.ContentType;\n\n context.adaptationSet = this.createFrame_(elem, context.period, null);\n\n var main = false;\n var roleElements = XmlUtils.findChildren(elem, 'Role');\n var roleValues = roleElements.map(function(role) {\n return role.getAttribute('value');\n }).filter(Functional.isNotNull);\n\n // Default kind for text streams is 'subtitle' if unspecified in the manifest.\n var kind = undefined;\n if (context.adaptationSet.contentType == ManifestParserUtils.ContentType.TEXT)\n kind = ManifestParserUtils.TextStreamKind.SUBTITLE;\n\n for (var i = 0; i < roleElements.length; i++) {\n var scheme = roleElements[i].getAttribute('schemeIdUri');\n if (scheme == null || scheme == 'urn:mpeg:dash:role:2011') {\n // These only apply for the given scheme, but allow them to be specified\n // if there is no scheme specified.\n // See: DASH section 5.8.5.5\n var value = roleElements[i].getAttribute('value');\n switch (value) {\n case 'main':\n main = true;\n break;\n case 'caption':\n case 'subtitle':\n kind = value;\n break;\n }\n }\n }\n\n var essentialProperties = XmlUtils.findChildren(elem, 'EssentialProperty');\n // ID of real AdaptationSet if this is a trick mode set:\n var trickModeFor = null;\n var unrecognizedEssentialProperty = false;\n essentialProperties.forEach(function(prop) {\n var schemeId = prop.getAttribute('schemeIdUri');\n if (schemeId == 'http://dashif.org/guidelines/trickmode') {\n trickModeFor = prop.getAttribute('value');\n } else {\n unrecognizedEssentialProperty = true;\n }\n });\n\n // According to DASH spec (2014) section 5.8.4.8, \"the successful processing\n // of the descriptor is essential to properly use the information in the\n // parent element\". According to DASH IOP v3.3, section 3.3.4, \"if the scheme\n // or the value\" for EssentialProperty is not recognized, \"the DASH client\n // shall ignore the parent element.\"\n if (unrecognizedEssentialProperty) {\n // Stop parsing this AdaptationSet and let the caller filter out the nulls.\n return null;\n }\n\n var contentProtectionElems = XmlUtils.findChildren(elem, 'ContentProtection');\n var contentProtection = shaka.dash.ContentProtection.parseFromAdaptationSet(\n contentProtectionElems, this.config_.dash.customScheme,\n this.config_.dash.ignoreDrmInfo);\n\n var language =\n shaka.util.LanguageUtils.normalize(elem.getAttribute('lang') || 'und');\n\n // non-standard attribute(yet) supported by Kaltura\n var label = elem.getAttribute('label');\n\n // Parse Representations into Streams.\n var representations = XmlUtils.findChildren(elem, 'Representation');\n var streams = representations\n .map(this.parseRepresentation_.bind(this, context, contentProtection,\n kind, language, label, main, roleValues))\n .filter(function(s) { return !!s; });\n\n if (streams.length == 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_EMPTY_ADAPTATION_SET);\n }\n\n // If AdaptationSet's type is unknown or is ambiguously \"application\",\n // guess based on the information in the first stream. If the attributes\n // mimeType and codecs are split across levels, they will both be inherited\n // down to the stream level by this point, so the stream will have all the\n // necessary information.\n if (!context.adaptationSet.contentType ||\n context.adaptationSet.contentType == ContentType.APPLICATION) {\n var mimeType = streams[0].mimeType;\n var codecs = streams[0].codecs;\n context.adaptationSet.contentType =\n shaka.dash.DashParser.guessContentType_(mimeType, codecs);\n\n streams.forEach(function(stream) {\n stream.type = context.adaptationSet.contentType;\n });\n }\n\n streams.forEach(function(stream) {\n // Some DRM license providers require that we have a default\n // key ID from the manifest in the wrapped license request.\n // Thus, it should be put in drmInfo to be accessible to request filters.\n contentProtection.drmInfos.forEach(function(drmInfo) {\n if (stream.keyId) {\n drmInfo.keyIds.push(stream.keyId);\n }\n });\n });\n\n var repIds = representations\n .map(function(node) { return node.getAttribute('id'); })\n .filter(shaka.util.Functional.isNotNull);\n\n return {\n id: context.adaptationSet.id || ('__fake__' + this.globalId_++),\n contentType: context.adaptationSet.contentType,\n language: language,\n main: main,\n streams: streams,\n drmInfos: contentProtection.drmInfos,\n trickModeFor: trickModeFor,\n representationIds: repIds\n };\n};\n\n\n/**\n * Parses a Representation XML element.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.ContentProtection.Context} contentProtection\n * @param {(string|undefined)} kind\n * @param {string} language\n * @param {string} label\n * @param {boolean} isPrimary\n * @param {!Array.<string>} roles\n * @param {!Element} node\n * @return {?shakaExtern.Stream} The Stream, or null when there is a\n * non-critical parsing error.\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parseRepresentation_ = function(\n context, contentProtection, kind, language, label, isPrimary, roles, node) {\n var XmlUtils = shaka.util.XmlUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n context.representation = this.createFrame_(node, context.adaptationSet, null);\n if (!this.verifyRepresentation_(context.representation)) {\n shaka.log.warning('Skipping Representation', context.representation);\n return null;\n }\n\n context.bandwidth =\n XmlUtils.parseAttr(node, 'bandwidth', XmlUtils.parsePositiveInt) ||\n undefined;\n\n /** @type {?shaka.dash.DashParser.StreamInfo} */\n var streamInfo;\n var requestInitSegment = this.requestInitSegment_.bind(this);\n if (context.representation.segmentBase) {\n streamInfo = shaka.dash.SegmentBase.createStream(\n context, requestInitSegment);\n } else if (context.representation.segmentList) {\n streamInfo = shaka.dash.SegmentList.createStream(\n context, this.segmentIndexMap_);\n } else if (context.representation.segmentTemplate) {\n streamInfo = shaka.dash.SegmentTemplate.createStream(\n context, requestInitSegment, this.segmentIndexMap_, !!this.manifest_);\n } else {\n goog.asserts.assert(\n context.representation.contentType == ContentType.TEXT ||\n context.representation.contentType == ContentType.APPLICATION,\n 'Must have Segment* with non-text streams.');\n\n var baseUris = context.representation.baseUris;\n var duration = context.periodInfo.duration || 0;\n streamInfo = {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition:\n /** @return {?number} */ function(/** number */ time) {\n if (time >= 0 && time < duration)\n return 1;\n else\n return null;\n },\n getSegmentReference:\n /** @return {shaka.media.SegmentReference} */\n function(/** number */ ref) {\n if (ref != 1)\n return null;\n\n return new shaka.media.SegmentReference(\n 1, 0, duration, function() { return baseUris; }, 0, null);\n },\n initSegmentReference: null,\n presentationTimeOffset: 0\n };\n }\n\n var contentProtectionElems = XmlUtils.findChildren(node, 'ContentProtection');\n var keyId = shaka.dash.ContentProtection.parseFromRepresentation(\n contentProtectionElems, this.config_.dash.customScheme,\n contentProtection, this.config_.dash.ignoreDrmInfo);\n\n return {\n id: this.globalId_++,\n createSegmentIndex: streamInfo.createSegmentIndex,\n findSegmentPosition: streamInfo.findSegmentPosition,\n getSegmentReference: streamInfo.getSegmentReference,\n initSegmentReference: streamInfo.initSegmentReference,\n presentationTimeOffset: streamInfo.presentationTimeOffset,\n mimeType: context.representation.mimeType,\n codecs: context.representation.codecs,\n frameRate: context.representation.frameRate,\n bandwidth: context.bandwidth,\n width: context.representation.width,\n height: context.representation.height,\n kind: kind,\n encrypted: contentProtection.drmInfos.length > 0,\n keyId: keyId,\n language: language,\n label: label,\n type: context.adaptationSet.contentType,\n primary: isPrimary,\n trickModeVideo: null,\n containsEmsgBoxes: context.representation.containsEmsgBoxes,\n roles: roles\n };\n};\n\n\n/**\n * Called when the update timer ticks.\n *\n * @private\n */\nshaka.dash.DashParser.prototype.onUpdate_ = function() {\n goog.asserts.assert(this.updateTimer_, 'Should only be called by timer');\n goog.asserts.assert(this.updatePeriod_ >= 0,\n 'There should be an update period');\n\n shaka.log.info('Updating manifest...');\n\n this.updateTimer_ = null;\n var startTime = Date.now();\n\n this.requestManifest_().then(function() {\n // Detect a call to stop()\n if (!this.playerInterface_)\n return;\n\n // Ensure the next update occurs within |updatePeriod_| seconds by taking\n // into account the time it took to update the manifest.\n var endTime = Date.now();\n this.setUpdateTimer_((endTime - startTime) / 1000.0);\n }.bind(this)).catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Should only receive a Shaka error');\n\n // Try updating again, but ensure we haven't been destroyed.\n if (this.playerInterface_) {\n // We will retry updating, so override the severity of the error.\n error.severity = shaka.util.Error.Severity.RECOVERABLE;\n this.playerInterface_.onError(error);\n\n this.setUpdateTimer_(0);\n }\n }.bind(this));\n};\n\n\n/**\n * Sets the update timer. Does nothing if the manifest does not specify an\n * update period.\n *\n * @param {number} offset An offset, in seconds, to apply to the manifest's\n * update period.\n * @private\n */\nshaka.dash.DashParser.prototype.setUpdateTimer_ = function(offset) {\n // NOTE: An updatePeriod_ of -1 means the attribute was missing.\n // An attribute which is present and set to 0 should still result in periodic\n // updates. For more, see: https://github.com/google/shaka-player/issues/331\n if (this.updatePeriod_ < 0)\n return;\n goog.asserts.assert(this.updateTimer_ == null,\n 'Timer should not be already set');\n\n var period =\n Math.max(shaka.dash.DashParser.MIN_UPDATE_PERIOD_, this.updatePeriod_);\n var interval = Math.max(period - offset, 0);\n shaka.log.debug('updateInterval', interval);\n\n var callback = this.onUpdate_.bind(this);\n this.updateTimer_ = window.setTimeout(callback, 1000 * interval);\n};\n\n\n/**\n * Creates a new inheritance frame for the given element.\n *\n * @param {!Element} elem\n * @param {?shaka.dash.DashParser.InheritanceFrame} parent\n * @param {Array.<string>} baseUris\n * @return {shaka.dash.DashParser.InheritanceFrame}\n * @private\n */\nshaka.dash.DashParser.prototype.createFrame_ = function(\n elem, parent, baseUris) {\n goog.asserts.assert(parent || baseUris,\n 'Must provide either parent or baseUris');\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var XmlUtils = shaka.util.XmlUtils;\n parent = parent || /** @type {shaka.dash.DashParser.InheritanceFrame} */ ({\n contentType: '',\n mimeType: '',\n codecs: '',\n containsEmsgBoxes: false,\n frameRate: undefined\n });\n baseUris = baseUris || parent.baseUris;\n\n var parseNumber = XmlUtils.parseNonNegativeInt;\n var evalDivision = XmlUtils.evalDivision;\n var uris = XmlUtils.findChildren(elem, 'BaseURL').map(XmlUtils.getContents);\n\n var contentType = elem.getAttribute('contentType') || parent.contentType;\n var mimeType = elem.getAttribute('mimeType') || parent.mimeType;\n var codecs = elem.getAttribute('codecs') || parent.codecs;\n var frameRate =\n XmlUtils.parseAttr(elem, 'frameRate', evalDivision) || parent.frameRate;\n var containsEmsgBoxes =\n !!XmlUtils.findChildren(elem, 'InbandEventStream').length;\n\n if (!contentType) {\n contentType = shaka.dash.DashParser.guessContentType_(mimeType, codecs);\n }\n\n return {\n baseUris: ManifestParserUtils.resolveUris(baseUris, uris),\n segmentBase: XmlUtils.findChild(elem, 'SegmentBase') || parent.segmentBase,\n segmentList: XmlUtils.findChild(elem, 'SegmentList') || parent.segmentList,\n segmentTemplate:\n XmlUtils.findChild(elem, 'SegmentTemplate') || parent.segmentTemplate,\n width: XmlUtils.parseAttr(elem, 'width', parseNumber) || parent.width,\n height: XmlUtils.parseAttr(elem, 'height', parseNumber) || parent.height,\n contentType: contentType,\n mimeType: mimeType,\n codecs: codecs,\n frameRate: frameRate,\n containsEmsgBoxes: containsEmsgBoxes || parent.containsEmsgBoxes,\n id: elem.getAttribute('id')\n };\n};\n\n\n/**\n * Verifies that a Representation has exactly one Segment* element. Prints\n * warnings if there is a problem.\n *\n * @param {shaka.dash.DashParser.InheritanceFrame} frame\n * @return {boolean} True if the Representation is usable; otherwise return\n * false.\n * @private\n */\nshaka.dash.DashParser.prototype.verifyRepresentation_ = function(frame) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var n = 0;\n n += frame.segmentBase ? 1 : 0;\n n += frame.segmentList ? 1 : 0;\n n += frame.segmentTemplate ? 1 : 0;\n\n if (n == 0) {\n // TODO: extend with the list of MIME types registered to TextEngine.\n if (frame.contentType == ContentType.TEXT ||\n frame.contentType == ContentType.APPLICATION) {\n return true;\n } else {\n shaka.log.warning(\n 'Representation does not contain a segment information source:',\n 'the Representation must contain one of SegmentBase, SegmentList,',\n 'SegmentTemplate, or explicitly indicate that it is \"text\".',\n frame);\n return false;\n }\n }\n\n if (n != 1) {\n shaka.log.warning(\n 'Representation contains multiple segment information sources:',\n 'the Representation should only contain one of SegmentBase,',\n 'SegmentList, or SegmentTemplate.',\n frame);\n if (frame.segmentBase) {\n shaka.log.info('Using SegmentBase by default.');\n frame.segmentList = null;\n frame.segmentTemplate = null;\n } else {\n goog.asserts.assert(frame.segmentList, 'There should be a SegmentList');\n shaka.log.info('Using SegmentList by default.');\n frame.segmentTemplate = null;\n }\n }\n\n return true;\n};\n\n\n/**\n * Makes a request to the given URI and calculates the clock offset.\n *\n * @param {!Array.<string>} baseUris\n * @param {string} uri\n * @param {string} method\n * @return {!Promise.<number>}\n * @private\n */\nshaka.dash.DashParser.prototype.requestForTiming_ =\n function(baseUris, uri, method) {\n var requestUris = shaka.util.ManifestParserUtils.resolveUris(baseUris, [uri]);\n var request = shaka.net.NetworkingEngine.makeRequest(\n requestUris, this.config_.retryParameters);\n request.method = method;\n var type = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n return this.playerInterface_.networkingEngine.request(type, request)\n .then(function(response) {\n var text;\n if (method == 'HEAD') {\n if (!response.headers || !response.headers['date']) return 0;\n\n text = response.headers['date'];\n } else {\n text = shaka.util.StringUtils.fromUTF8(response.data);\n }\n\n var date = Date.parse(text);\n return isNaN(date) ? 0 : (date - Date.now());\n });\n};\n\n\n/**\n * Parses an array of UTCTiming elements.\n *\n * @param {!Array.<string>} baseUris\n * @param {!Array.<!Element>} elems\n * @param {boolean} isLive\n * @return {!Promise.<number>}\n * @private\n */\nshaka.dash.DashParser.prototype.parseUtcTiming_ =\n function(baseUris, elems, isLive) {\n var schemesAndValues = elems.map(function(elem) {\n return {\n scheme: elem.getAttribute('schemeIdUri'),\n value: elem.getAttribute('value')\n };\n });\n\n // If there's nothing specified in the manifest, but we have a default from\n // the config, use that.\n var clockSyncUri = this.config_.dash.clockSyncUri;\n if (isLive && !schemesAndValues.length && clockSyncUri) {\n schemesAndValues.push({\n scheme: 'urn:mpeg:dash:utc:http-head:2014',\n value: clockSyncUri\n });\n }\n\n var Functional = shaka.util.Functional;\n return Functional.createFallbackPromiseChain(schemesAndValues, function(sv) {\n var scheme = sv.scheme;\n var value = sv.value;\n switch (scheme) {\n // See DASH IOP Guidelines Section 4.7\n // http://goo.gl/CQFNJT\n case 'urn:mpeg:dash:utc:http-head:2014':\n // Some old ISO23009-1 drafts used 2012.\n case 'urn:mpeg:dash:utc:http-head:2012':\n return this.requestForTiming_(baseUris, value, 'HEAD');\n case 'urn:mpeg:dash:utc:http-xsdate:2014':\n case 'urn:mpeg:dash:utc:http-iso:2014':\n case 'urn:mpeg:dash:utc:http-xsdate:2012':\n case 'urn:mpeg:dash:utc:http-iso:2012':\n return this.requestForTiming_(baseUris, value, 'GET');\n case 'urn:mpeg:dash:utc:direct:2014':\n case 'urn:mpeg:dash:utc:direct:2012':\n var date = Date.parse(value);\n return isNaN(date) ? 0 : (date - Date.now());\n\n case 'urn:mpeg:dash:utc:http-ntp:2014':\n case 'urn:mpeg:dash:utc:ntp:2014':\n case 'urn:mpeg:dash:utc:sntp:2014':\n shaka.log.warning('NTP UTCTiming scheme is not supported');\n return Promise.reject();\n default:\n shaka.log.warning(\n 'Unrecognized scheme in UTCTiming element', scheme);\n return Promise.reject();\n }\n }.bind(this)).catch(function() {\n if (isLive) {\n shaka.log.warning(\n 'A UTCTiming element should always be given in live manifests! ' +\n 'This content may not play on clients with bad clocks!');\n }\n return 0;\n });\n};\n\n\n/**\n * Parses an EventStream element.\n *\n * @param {number} periodStart\n * @param {?number} periodDuration\n * @param {!Element} elem\n * @private\n */\nshaka.dash.DashParser.prototype.parseEventStream_ = function(\n periodStart, periodDuration, elem) {\n var XmlUtils = shaka.util.XmlUtils;\n var parseNumber = XmlUtils.parseNonNegativeInt;\n\n var schemeIdUri = elem.getAttribute('schemeIdUri') || '';\n var value = elem.getAttribute('value') || '';\n var timescale = XmlUtils.parseAttr(elem, 'timescale', parseNumber) || 1;\n\n XmlUtils.findChildren(elem, 'Event').forEach(function(eventNode) {\n var presentationTime =\n XmlUtils.parseAttr(eventNode, 'presentationTime', parseNumber) || 0;\n var duration = XmlUtils.parseAttr(eventNode, 'duration', parseNumber) || 0;\n\n var startTime = presentationTime / timescale + periodStart;\n var endTime = startTime + (duration / timescale);\n if (periodDuration != null) {\n // An event should not go past the Period, even if the manifest says so.\n // See: Dash sec. 5.10.2.1\n startTime = Math.min(startTime, periodStart + periodDuration);\n endTime = Math.min(endTime, periodStart + periodDuration);\n }\n\n /** @type {shakaExtern.TimelineRegionInfo} */\n var region = {\n schemeIdUri: schemeIdUri,\n value: value,\n startTime: startTime,\n endTime: endTime,\n id: eventNode.getAttribute('id') || '',\n eventElement: eventNode\n };\n\n this.playerInterface_.onTimelineRegionAdded(region);\n }.bind(this));\n};\n\n\n/**\n * Makes a network request on behalf of SegmentBase.createStream.\n *\n * @param {!Array.<string>} uris\n * @param {?number} startByte\n * @param {?number} endByte\n * @return {!Promise.<!ArrayBuffer>}\n * @private\n */\nshaka.dash.DashParser.prototype.requestInitSegment_ = function(\n uris, startByte, endByte) {\n var requestType = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n var request = shaka.net.NetworkingEngine.makeRequest(\n uris, this.config_.retryParameters);\n if (startByte != null) {\n var end = (endByte != null ? endByte : '');\n request.headers['Range'] = 'bytes=' + startByte + '-' + end;\n }\n\n return this.playerInterface_.networkingEngine.request(requestType, request)\n .then(function(response) { return response.data; });\n};\n\n\n/**\n * Guess the content type based on MIME type and codecs.\n *\n * @param {string} mimeType\n * @param {string} codecs\n * @return {string}\n * @private\n */\nshaka.dash.DashParser.guessContentType_ = function(mimeType, codecs) {\n var fullMimeType = shaka.util.StreamUtils.getFullMimeType(mimeType, codecs);\n\n if (shaka.media.TextEngine.isTypeSupported(fullMimeType)) {\n // If it's supported by TextEngine, it's definitely text.\n // We don't check MediaSourceEngine, because that would report support\n // for platform-supported video and audio types as well.\n return shaka.util.ManifestParserUtils.ContentType.TEXT;\n }\n\n // Otherwise, just split the MIME type. This handles video and audio\n // types well.\n return mimeType.split('/')[0];\n};\n\n\nshaka.media.ManifestParser.registerParserByExtension(\n 'mpd', shaka.dash.DashParser);\nshaka.media.ManifestParser.registerParserByMime(\n 'application/dash+xml', shaka.dash.DashParser);\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/dash_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.hls.Attribute');\ngoog.provide('shaka.hls.Playlist');\ngoog.provide('shaka.hls.PlaylistType');\ngoog.provide('shaka.hls.Segment');\ngoog.provide('shaka.hls.Tag');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Creates an HLS playlist object.\n *\n * @param {!string} uri\n * @param {!shaka.hls.PlaylistType} type\n * @param {!Array.<shaka.hls.Tag>} tags\n * @param {!Array.<shaka.hls.Segment>=} opt_segments\n *\n * @constructor\n * @struct\n */\nshaka.hls.Playlist = function(uri, type, tags, opt_segments) {\n /** @const {!string} */\n this.uri = uri;\n\n /** @const {shaka.hls.PlaylistType} */\n this.type = type;\n\n /** @const {!Array.<!shaka.hls.Tag>} */\n this.tags = tags;\n\n /** @const {Array.<!shaka.hls.Segment>} */\n this.segments = opt_segments || null;\n};\n\n\n/**\n * @enum {number}\n */\nshaka.hls.PlaylistType = {\n MASTER: 0,\n MEDIA: 1\n};\n\n\n\n/**\n * Creates an HLS tag object.\n *\n * @param {number} id\n * @param {!string} name\n * @param {!Array.<shaka.hls.Attribute>} attributes\n * @param {?string=} opt_value\n *\n * @constructor\n * @struct\n */\nshaka.hls.Tag = function(id, name, attributes, opt_value) {\n\n goog.asserts.assert(\n (attributes.length == 0 && opt_value) ||\n (attributes.length > 0 && !opt_value) ||\n (attributes.length == 0 && !opt_value),\n 'Tags can only take the form ' +\n '(1) <NAME>:<VALUE> ' +\n '(2) <NAME>:<ATTRIBUTE_LIST> ' +\n ' (3) <NAME>');\n\n /** @const {number} */\n this.id = id;\n\n /** @const {!string} */\n this.name = name;\n\n /** @const {Array.<shaka.hls.Attribute>} */\n this.attributes = attributes;\n\n /** @const {?string} */\n this.value = opt_value || null;\n};\n\n\n/**\n * Create the string representation of the tag.\n *\n * For the DRM system - the full tag needs to be passed down to the CDM. There\n * are two ways of doing this (1) save the original tag or (2) recreate the tag.\n * As with some cases (like in tests) the tag never existed in string form, it\n * is far easier to recreate the tag from the parsed form.\n *\n * @return {string}\n * @override\n */\nshaka.hls.Tag.prototype.toString = function() {\n\n /**\n * @param {shaka.hls.Attribute} attr\n * @return {!string}\n */\n var attr_to_str = function(attr) {\n return attr.name + '=\"' + attr.value + '\"';\n };\n\n\n // A valid tag can only follow 1 of 3 patterns.\n // 1) <NAME>:<VALUE>\n // 2) <NAME>:<ATTRIBUTE LIST>\n // 3) <NAME>\n\n if (this.value) {\n return '#' + this.name + ':' + this.value;\n }\n\n if (this.attributes.length > 0) {\n return '#' + this.name + ':' + this.attributes.map(attr_to_str).join(',');\n }\n\n return '#' + this.name;\n};\n\n\n\n/**\n * Creates an HLS attribute object.\n *\n * @param {!string} name\n * @param {!string} value\n *\n * @constructor\n * @struct\n */\nshaka.hls.Attribute = function(name, value) {\n /** @const {!string} */\n this.name = name;\n\n /** @const {!string} */\n this.value = value;\n};\n\n\n/**\n * Adds an attribute to an HLS Tag.\n *\n * @param {!shaka.hls.Attribute} attribute\n */\nshaka.hls.Tag.prototype.addAttribute = function(attribute) {\n this.attributes.push(attribute);\n};\n\n\n/**\n * Gets the first attribute of the tag with a specified name.\n *\n * @param {!string} name\n * @return {?shaka.hls.Attribute} attribute\n */\nshaka.hls.Tag.prototype.getAttribute = function(name) {\n var attributes = this.attributes.filter(function(attr) {\n return attr.name == name;\n });\n\n goog.asserts.assert(attributes.length < 2,\n 'A tag should not have multiple attributes ' +\n 'with the same name!');\n\n if (attributes.length)\n return attributes[0];\n else\n return null;\n};\n\n\n/**\n * Gets the value of the first attribute of the tag with a specified name.\n * If not found, returns an optional default value.\n *\n * @param {!string} name\n * @param {string=} opt_defaultValue\n * @return {?string}\n */\nshaka.hls.Tag.prototype.getAttributeValue = function(name, opt_defaultValue) {\n var defaultValue = opt_defaultValue || null;\n var attribute = this.getAttribute(name);\n return attribute ? attribute.value : defaultValue;\n};\n\n\n\n/**\n * Creates an HLS segment object.\n *\n * @param {!string} uri\n * @param {!Array.<shaka.hls.Tag>} tags\n *\n * @constructor\n * @struct\n */\nshaka.hls.Segment = function(uri, tags) {\n /** @const {!Array.<shaka.hls.Tag>} */\n this.tags = tags;\n\n /** @const {!string} */\n this.uri = uri;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/hls_classes.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.hls.Utils');\n\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n/**\n *\n * @param {!Array.<!shaka.hls.Tag>} tags\n * @param {!string} name\n * @return {!Array.<!shaka.hls.Tag>}\n */\nshaka.hls.Utils.filterTagsByName = function(tags, name) {\n return tags.filter(function(tag) {\n return tag.name == name;\n });\n};\n\n\n/**\n *\n * @param {!Array.<!shaka.hls.Tag>} tags\n * @param {!string} name\n * @return {?shaka.hls.Tag}\n */\nshaka.hls.Utils.getFirstTagWithName = function(tags, name) {\n var tagsWithName = shaka.hls.Utils.filterTagsByName(tags, name);\n if (!tagsWithName.length) return null;\n\n return tagsWithName[0];\n};\n\n\n/**\n * Expects an array of EXT-X-MEDIA tags. Returns the first tag that\n * has given media type and group id.\n *\n * @param {!Array.<!shaka.hls.Tag>} tags\n * @param {!string} type\n * @param {!string} groupId\n * @return {!Array<!shaka.hls.Tag>}\n */\nshaka.hls.Utils.findMediaTags = function(tags, type, groupId) {\n return tags.filter(function(tag) {\n var typeAttr = tag.getAttribute('TYPE');\n var groupIdAttr = tag.getAttribute('GROUP-ID');\n return typeAttr.value == type && groupIdAttr.value == groupId;\n });\n};\n\n\n/**\n * @param {!string} parentAbsoluteUri\n * @param {!string} uri\n * @return {!string}\n */\nshaka.hls.Utils.constructAbsoluteUri = function(parentAbsoluteUri, uri) {\n var uris = shaka.util.ManifestParserUtils.resolveUris(\n [parentAbsoluteUri], [uri]);\n\n return uris[0];\n};\n\n\n/**\n * Matches a string to an HLS comment format and returns the result.\n *\n * @param {!string} line\n * @return {boolean}\n */\nshaka.hls.Utils.isComment = function(line) {\n return /^#(?!EXT)/m.test(line);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/hls_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.TextParser');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Reads elements from strings.\n *\n * @param {string} data\n * @constructor\n * @struct\n */\nshaka.util.TextParser = function(data) {\n /**\n * @const\n * @private {string}\n */\n this.data_ = data;\n\n /** @private {number} */\n this.position_ = 0;\n};\n\n\n/** @return {boolean} Whether it is at the end of the string. */\nshaka.util.TextParser.prototype.atEnd = function() {\n return this.position_ == this.data_.length;\n};\n\n\n/**\n * Reads a line from the parser. This will read but not return the newline.\n * Returns null at the end.\n *\n * @return {?string}\n */\nshaka.util.TextParser.prototype.readLine = function() {\n return this.readRegexReturnCapture_(/(.*?)(\\n|$)/gm, 1);\n};\n\n\n/**\n * Reads a word from the parser. This will not read or return any whitespace\n * before or after the word (including newlines). Returns null at the end.\n *\n * @return {?string}\n */\nshaka.util.TextParser.prototype.readWord = function() {\n return this.readRegexReturnCapture_(/[^ \\t\\n]*/gm, 0);\n};\n\n\n/**\n * Skips any continuous whitespace from the parser. Returns null at the end.\n */\nshaka.util.TextParser.prototype.skipWhitespace = function() {\n this.readRegex(/[ \\t]+/gm);\n};\n\n\n/**\n * Reads the given regular expression from the parser. This requires the match\n * to be at the current position; there is no need to include a head anchor.\n * This requires that the regex have the global flag to be set so that it can\n * set lastIndex to start the search at the current position. Returns null at\n * the end or if the regex does not match the current position.\n *\n * @param {!RegExp} regex\n * @return {Array.<string>}\n */\nshaka.util.TextParser.prototype.readRegex = function(regex) {\n var index = this.indexOf_(regex);\n if (this.atEnd() || index == null || index.position != this.position_)\n return null;\n\n this.position_ += index.length;\n return index.results;\n};\n\n\n/**\n * Reads a regex from the parser and returns the given capture.\n *\n * @param {!RegExp} regex\n * @param {number} index\n * @return {?string}\n * @private\n */\nshaka.util.TextParser.prototype.readRegexReturnCapture_ =\n function(regex, index) {\n if (this.atEnd())\n return null;\n\n var ret = this.readRegex(regex);\n if (!ret)\n return null;\n else\n return ret[index];\n};\n\n\n/**\n * Returns the index info about a regular expression match.\n *\n * @param {!RegExp} regex\n * @return {?{position: number, length: number, results: !Array.<string>}}\n * @private\n */\nshaka.util.TextParser.prototype.indexOf_ = function(regex) {\n // The global flag is required to use lastIndex.\n goog.asserts.assert(regex.global, 'global flag should be set');\n\n regex.lastIndex = this.position_;\n var results = regex.exec(this.data_);\n if (results == null)\n return null;\n else\n return {\n position: results.index,\n length: results[0].length,\n results: results\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.hls.ManifestTextParser');\n\ngoog.require('shaka.hls.Attribute');\ngoog.require('shaka.hls.Playlist');\ngoog.require('shaka.hls.PlaylistType');\ngoog.require('shaka.hls.Segment');\ngoog.require('shaka.hls.Tag');\ngoog.require('shaka.hls.Utils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.TextParser');\n\n\n\n/**\n * Creates a new ManifestTextParser.\n *\n * @constructor\n * @struct\n */\nshaka.hls.ManifestTextParser = function() {\n /** @private {number} */\n this.globalId_ = 0;\n};\n\n\n/**\n * @param {!ArrayBuffer} data\n * @param {!string} uri\n * @return {!shaka.hls.Playlist}\n * @throws {shaka.util.Error}\n */\nshaka.hls.ManifestTextParser.prototype.parsePlaylist = function(data, uri) {\n // Get the input as a string. Normalize newlines to \\n.\n var str = shaka.util.StringUtils.fromUTF8(data);\n str = str.replace(/\\r\\n|\\r(?=[^\\n]|$)/gm, '\\n').trim();\n\n var lines = str.split(/\\n+/m);\n\n if (!/^#EXTM3U($|[ \\t\\n])/m.test(lines[0])) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_PLAYLIST_HEADER_MISSING);\n }\n\n /** shaka.hls.PlaylistType */\n var playlistType = shaka.hls.PlaylistType.MASTER;\n\n /** {Array.<shaka.hls.Tag>} */\n var tags = [];\n var i = 1;\n while (i < lines.length) {\n // Skip comments\n if (shaka.hls.Utils.isComment(lines[i])) {\n i += 1;\n continue;\n }\n\n var tag = this.parseTag_(lines[i]);\n\n if (shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS\n .indexOf(tag.name) >= 0) {\n playlistType = shaka.hls.PlaylistType.MEDIA;\n } else if (shaka.hls.ManifestTextParser.SEGMENT_TAGS\n .indexOf(tag.name) >= 0) {\n if (playlistType != shaka.hls.PlaylistType.MEDIA) {\n // Only media playlist should contain segment tags\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY);\n }\n\n var segmentsData = lines.splice(i, lines.length - i);\n var segments = this.parseSegments_(segmentsData);\n return new shaka.hls.Playlist(uri, playlistType, tags, segments);\n }\n\n tags.push(tag);\n i += 1;\n\n // EXT-X-STREAM-INF tag is followed by a uri of a media playlist.\n // Add uri to the tag object.\n if (tag.name == 'EXT-X-STREAM-INF') {\n var tagUri = new shaka.hls.Attribute('URI', lines[i]);\n tag.addAttribute(tagUri);\n i += 1;\n }\n }\n\n return new shaka.hls.Playlist(uri, playlistType, tags);\n};\n\n\n/**\n * Parses an array of strings into an HLS Segment objects.\n *\n * @param {!Array.<string>} lines\n * @return {!Array.<shaka.hls.Segment>}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.ManifestTextParser.prototype.parseSegments_ = function(lines) {\n var segments = [];\n var tags = [];\n lines.forEach(function(line) {\n if (/^(#EXT)/.test(line)) {\n var tag = this.parseTag_(line);\n tags.push(tag);\n } else if (shaka.hls.Utils.isComment(line)) {\n // Skip comments\n return;\n } else {\n var uri = line.trim();\n // Uri appears after all the tags describing the segment.\n var segment = new shaka.hls.Segment(uri, tags);\n segments.push(segment);\n tags = [];\n }\n }.bind(this));\n\n return segments;\n};\n\n\n/**\n * Parses a string into an HLS Tag object while tracking what id to use next.\n *\n * @param {!string} word\n * @return {!shaka.hls.Tag}\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.hls.ManifestTextParser.prototype.parseTag_ = function(word) {\n return shaka.hls.ManifestTextParser.parseTag(this.globalId_++, word);\n};\n\n\n/**\n * Parses a string into an HLS Tag object.\n *\n * @param {number} id\n * @param {!string} word\n * @return {!shaka.hls.Tag}\n * @throws {shaka.util.Error}\n */\nshaka.hls.ManifestTextParser.parseTag = function(id, word) {\n /* HLS tags start with '#EXT'. A tag can have a set of attributes\n (#EXT-<tagname>:<attribute list>) or a value (#EXT-<tagname>:<value>).\n Attributes' format is 'AttributeName=AttributeValue'.\n The parsing logic goes like this:\n 1) Everything before ':' is a name (we ignore '#').\n 2) Everything after should be parsed as attributes if it contains '='.\n 3) Otherwise, this is a value.\n 4) If there is no \":\", it's a simple tag with no attributes and no value */\n var blocks = word.match(/^#(EXT[^:]*)(?::(.*))?$/);\n if (!blocks) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.INVALID_HLS_TAG);\n }\n var name = blocks[1];\n var data = blocks[2];\n var attributes = [];\n\n if (data && data.indexOf('=') >= 0) {\n var parser = new shaka.util.TextParser(data);\n var blockAttrs;\n\n // Regex:\n // 1. Key name ([1])\n // 2. Equals sign\n // 3. Either:\n // a. A quoted string (everything up to the next quote, [2])\n // b. An unquoted string\n // (everything up to the next comma or end of line, [3])\n // 4. Either:\n // a. A comma\n // b. End of line\n var regex = /([^=]+)=(?:\"([^\"]*)\"|([^\",]*))(?:,|$)/g;\n while (blockAttrs = parser.readRegex(regex)) {\n var attrName = blockAttrs[1];\n var attrValue = blockAttrs[2] || blockAttrs[3];\n var attribute = new shaka.hls.Attribute(attrName, attrValue);\n attributes.push(attribute);\n }\n } else if (data) {\n return new shaka.hls.Tag(id, name, attributes, data);\n }\n\n return new shaka.hls.Tag(id, name, attributes);\n};\n\n\n/**\n * HLS tags that only appear on Media Playlists.\n * Used to determine a playlist type.\n *\n * @const {!Array<!string>}\n */\nshaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS = [\n 'EXT-X-TARGETDURATION',\n 'EXT-X-MEDIA-SEQUENCE',\n 'EXT-X-DISCONTINUITY-SEQUENCE',\n 'EXT-X-PLAYLIST-TYPE',\n 'EXT-X-MAP',\n 'EXT-X-I-FRAMES-ONLY'\n];\n\n\n/**\n * HLS tags that only appear on Segments in a Media Playlists.\n * Used to determine the start of the segments info.\n *\n * @const {!Array<!string>}\n */\nshaka.hls.ManifestTextParser.SEGMENT_TAGS = [\n 'EXTINF',\n 'EXT-X-BYTERANGE',\n 'EXT-X-DISCONTINUITY',\n 'EXT-X-PROGRAM-DATE-TIME',\n 'EXT-X-KEY',\n 'EXT-X-DATERANGE'\n];\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/manifest_text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.net.DataUriPlugin');\n\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * @namespace\n * @summary A networking plugin to handle data URIs.\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs\n * @param {string} uri\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.net.DataUriPlugin = function(uri, request) {\n return new Promise(function(resolve, reject) {\n var parsed = shaka.net.DataUriPlugin.parse(uri);\n\n /** @type {shakaExtern.Response} */\n var response = {\n uri: uri,\n data: parsed.data,\n headers: {\n 'content-type': parsed.contentType\n }\n };\n\n resolve(response);\n });\n};\n\n\n/**\n * @param {string} uri\n * @return {{data: ArrayBuffer, contentType: string}}\n */\nshaka.net.DataUriPlugin.parse = function(uri) {\n // Extract the scheme.\n var parts = uri.split(':');\n if (parts.length < 2 || parts[0] != 'data') {\n shaka.log.error('Bad data URI, failed to parse scheme');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_DATA_URI,\n uri);\n }\n var path = parts.slice(1).join(':');\n\n // Extract the encoding and MIME type (required but can be empty).\n var infoAndData = path.split(',');\n if (infoAndData.length < 2) {\n shaka.log.error('Bad data URI, failed to extract encoding and MIME type');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_DATA_URI,\n uri);\n }\n var info = infoAndData[0];\n var dataStr = window.decodeURIComponent(infoAndData.slice(1).join(','));\n\n // Extract the encoding (optional).\n var typeAndEncoding = info.split(';');\n var encoding = null;\n if (typeAndEncoding.length > 1)\n encoding = typeAndEncoding[1];\n\n // Convert the data.\n /** @type {ArrayBuffer} */\n var data;\n if (encoding == 'base64') {\n data = shaka.util.Uint8ArrayUtils.fromBase64(dataStr).buffer;\n } else if (encoding) {\n shaka.log.error('Bad data URI, unknown encoding');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.UNKNOWN_DATA_URI_ENCODING,\n uri);\n } else {\n data = shaka.util.StringUtils.toUTF8(dataStr);\n }\n\n return {data: data, contentType: typeAndEncoding[0]};\n};\n\n\nshaka.net.NetworkingEngine.registerScheme('data', shaka.net.DataUriPlugin);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/net/data_uri_plugin.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\ngoog.provide('shaka.hls.HlsParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.hls.ManifestTextParser');\ngoog.require('shaka.hls.Playlist');\ngoog.require('shaka.hls.PlaylistType');\ngoog.require('shaka.hls.Tag');\ngoog.require('shaka.hls.Utils');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.net.DataUriPlugin');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n\n/**\n * Creates a new HLS parser.\n *\n * @struct\n * @constructor\n * @implements {shakaExtern.ManifestParser}\n * @export\n */\nshaka.hls.HlsParser = function() {\n /** @private {?shakaExtern.ManifestParser.PlayerInterface} */\n this.playerInterface_ = null;\n\n /** @private {?shakaExtern.ManifestConfiguration} */\n this.config_ = null;\n\n /** @private {number} */\n this.globalId_ = 1;\n\n /** @private {!Object.<number, shaka.hls.HlsParser.StreamInfo>} */\n this.mediaTagsToStreamInfosMap_ = {};\n\n /** @private {!Object.<number, !shaka.media.SegmentIndex>} */\n this.streamsToIndexMap_ = {};\n\n /** @private {?shaka.media.PresentationTimeline} */\n this.presentationTimeline_ = null;\n\n /** @private {string} */\n this.manifestUri_ = '';\n\n /** @private {shaka.hls.ManifestTextParser} */\n this.manifestTextParser_ = new shaka.hls.ManifestTextParser();\n};\n\n\n/**\n * @typedef {{\n * stream: !shakaExtern.Stream,\n * segmentIndex: !shaka.media.SegmentIndex,\n * drmInfos: !Array.<shakaExtern.DrmInfo>\n * }}\n *\n * @description\n * Contains a stream and information about it.\n *\n * @property {!shakaExtern.Stream} stream\n * The Stream itself.\n * @property {!shaka.media.SegmentIndex} segmentIndex\n * SegmentIndex of the stream.\n * @property {!Array.<shakaExtern.DrmInfo>} drmInfos\n * DrmInfos of the stream. There may be multiple for multi-DRM content.\n */\nshaka.hls.HlsParser.StreamInfo;\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.configure = function(config) {\n this.config_ = config;\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.start = function(uri, playerInterface) {\n goog.asserts.assert(this.config_, 'Must call configure() before start()!');\n this.playerInterface_ = playerInterface;\n this.manifestUri_ = uri;\n return this.requestManifest_(uri).then(function(response) {\n return this.parseManifest_(response.data, uri);\n }.bind(this));\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.stop = function() {\n this.playerInterface_ = null;\n this.config_ = null;\n this.mediaTagsToStreamInfosMap_ = {};\n\n return Promise.resolve();\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.update = function() {\n // TODO: Implement support for live content.\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.onExpirationUpdated = function(\n sessionId, expiration) {\n // No-op\n};\n\n\n/**\n * Parses the manifest.\n *\n * @param {!ArrayBuffer} data\n * @param {string} uri\n * @return {!Promise.<!shakaExtern.Manifest>}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.hls.HlsParser.prototype.parseManifest_ = function(data, uri) {\n var playlist = this.manifestTextParser_.parsePlaylist(data, uri);\n\n // We don't support directly providing a Media Playlist.\n // See error code for details.\n if (playlist.type != shaka.hls.PlaylistType.MASTER) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_MASTER_PLAYLIST_NOT_PROVIDED);\n }\n\n // TODO: Implement support for live content.\n this.presentationTimeline_ = new shaka.media.PresentationTimeline(null, 0);\n return this.createPeriod_(playlist).then(function(period) {\n // HLS has no notion of periods. We're treating the whole presentation as\n // one period.\n this.playerInterface_.filterPeriod(period);\n return {\n presentationTimeline: this.presentationTimeline_,\n periods: [period],\n offlineSessionIds: [],\n minBufferTime: 0\n };\n }.bind(this));\n};\n\n\n/**\n * Parses a playlist into a Period object.\n *\n * @param {!shaka.hls.Playlist} playlist\n * @return {!Promise.<!shakaExtern.Period>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createPeriod_ = function(playlist) {\n var Utils = shaka.hls.Utils;\n var Functional = shaka.util.Functional;\n var tags = playlist.tags;\n\n // Create Variants for every 'EXT-X-STREAM-INF' tag.\n var variantTags = Utils.filterTagsByName(tags, 'EXT-X-STREAM-INF');\n var variantsPromises = variantTags.map(function(tag) {\n return this.createVariantsForTag_(tag, playlist);\n }.bind(this));\n\n var mediaTags = Utils.filterTagsByName(playlist.tags, 'EXT-X-MEDIA');\n var textStreamTags = mediaTags.filter(function(tag) {\n var type = shaka.hls.HlsParser.getRequiredAttributeValue_(tag, 'TYPE');\n return type == 'SUBTITLES';\n }.bind(this));\n\n // TODO: CLOSED-CAPTIONS requires the parsing of CEA-608 from the video.\n var textStreamPromises = textStreamTags.map(function(tag) {\n return this.createTextStream_(tag, playlist);\n }.bind(this));\n\n return Promise.all(variantsPromises).then(function(allVariants) {\n return Promise.all(textStreamPromises).then(function(textStreams) {\n var variants = allVariants.reduce(Functional.collapseArrays, []);\n this.fitSegments_(variants);\n return {\n startTime: 0,\n variants: variants,\n textStreams: textStreams\n };\n }.bind(this));\n }.bind(this));\n};\n\n\n/**\n * @param {!shaka.hls.Tag} tag\n * @param {!shaka.hls.Playlist} playlist\n * @return {!Promise.<!Array.<!shakaExtern.Variant>>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createVariantsForTag_ = function(tag, playlist) {\n goog.asserts.assert(tag.name == 'EXT-X-STREAM-INF',\n 'Should only be called on variant tags!');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var HlsParser = shaka.hls.HlsParser;\n var Utils = shaka.hls.Utils;\n var bandwidth =\n Number(HlsParser.getRequiredAttributeValue_(tag, 'BANDWIDTH'));\n\n // These are the default codecs to assume if none are specified.\n //\n // The video codec is H.264, with baseline profile and level 3.0.\n // http://blog.pearce.org.nz/2013/11/what-does-h264avc1-codecs-parameters.html\n //\n // The audio codec is \"low-complexity\" AAC.\n var defaultCodecs = 'avc1.42E01E,mp4a.40.2';\n\n var codecs = tag.getAttributeValue('CODECS', defaultCodecs).split(',');\n var resolutionAttr = tag.getAttribute('RESOLUTION');\n var width = null;\n var height = null;\n var frameRate = tag.getAttributeValue('FRAME-RATE');\n\n if (resolutionAttr) {\n var resBlocks = resolutionAttr.value.split('x');\n width = resBlocks[0];\n height = resBlocks[1];\n }\n\n var timeOffset = this.getTimeOffset_(playlist);\n\n var mediaTags = Utils.filterTagsByName(playlist.tags, 'EXT-X-MEDIA');\n\n var audioGroupId = tag.getAttributeValue('AUDIO');\n var videoGroupId = tag.getAttributeValue('VIDEO');\n goog.asserts.assert(audioGroupId == null || videoGroupId == null,\n 'Unexpected: both video and audio described by media tags!');\n\n // Find any associated audio or video groups and create streams for them.\n if (audioGroupId) {\n mediaTags = Utils.findMediaTags(mediaTags, 'AUDIO', audioGroupId);\n } else if (videoGroupId) {\n mediaTags = Utils.findMediaTags(mediaTags, 'VIDEO', videoGroupId);\n }\n var promises = mediaTags.map(function(tag) {\n return this.createStreamInfoFromMediaTag_(tag, codecs, timeOffset);\n }.bind(this));\n\n var audioStreamInfos = [];\n var videoStreamInfos = [];\n\n return Promise.all(promises).then(function(data) {\n if (audioGroupId) {\n audioStreamInfos = data;\n } else if (videoGroupId) {\n videoStreamInfos = data;\n }\n\n // Make an educated guess about the stream type.\n shaka.log.debug('Guessing stream type for', tag.toString());\n var type;\n if (!audioStreamInfos.length && !videoStreamInfos.length) {\n // There are no associated streams. This is either an audio-only stream,\n // a video-only stream, or a multiplexed stream.\n\n if (codecs.length == 1) {\n // There is only one codec, so it shouldn't be multiplexed.\n if (resolutionAttr || frameRate) {\n // Assume video-only.\n shaka.log.debug('Guessing video-only.');\n type = ContentType.VIDEO;\n } else {\n // Assume audio-only.\n shaka.log.debug('Guessing audio-only.');\n type = ContentType.AUDIO;\n }\n } else {\n // There are multiple codecs, so assume multiplexed content.\n // Note that the default used when CODECS is missing assumes multiple\n // (and therefore multiplexed).\n // Recombine the codec strings into one so that MediaSource isn't\n // lied to later. (That would trigger an error in Chrome.)\n shaka.log.debug('Guessing multiplexed audio+video.');\n type = ContentType.VIDEO;\n codecs = [codecs.join(',')];\n }\n } else if (audioStreamInfos.length) {\n // There are associated audio streams. Assume this is video.\n shaka.log.debug('Guessing video.');\n type = ContentType.VIDEO;\n } else {\n // There are associated video streams. Assume this is audio.\n goog.asserts.assert(videoStreamInfos.length,\n 'No video streams! This should have been handled already!');\n shaka.log.debug('Guessing audio.');\n type = ContentType.AUDIO;\n }\n\n goog.asserts.assert(type, 'Type should have been set by now!');\n return this.createStreamInfoFromVariantTag_(tag, codecs, type, timeOffset);\n }.bind(this)).then(function(streamInfo) {\n goog.asserts.assert(streamInfo, 'We should have created a stream!');\n if (streamInfo.stream.type == ContentType.AUDIO) {\n audioStreamInfos = [streamInfo];\n } else {\n videoStreamInfos = [streamInfo];\n }\n\n return this.createVariants_(\n audioStreamInfos,\n videoStreamInfos,\n bandwidth,\n width,\n height,\n frameRate);\n }.bind(this));\n};\n\n\n/**\n * @param {!Array.<!shaka.hls.HlsParser.StreamInfo>} audioInfos\n * @param {!Array.<!shaka.hls.HlsParser.StreamInfo>} videoInfos\n * @param {number} bandwidth\n * @param {?string} width\n * @param {?string} height\n * @param {?string} frameRate\n * @return {!Array.<!shakaExtern.Variant>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createVariants_ =\n function(audioInfos, videoInfos, bandwidth, width, height, frameRate) {\n var DrmEngine = shaka.media.DrmEngine;\n\n videoInfos.forEach(function(info) {\n this.addVideoAttributes_(info.stream, width, height, frameRate);\n }.bind(this));\n\n // In case of audio-only or video-only content, we create an array of\n // one item containing a null. This way, the double-loop works for all\n // kinds of content.\n // NOTE: we currently don't have support for audio-only content.\n if (!audioInfos.length)\n audioInfos = [null];\n if (!videoInfos.length)\n videoInfos = [null];\n\n var variants = [];\n for (var i = 0; i < audioInfos.length; i++) {\n for (var j = 0; j < videoInfos.length; j++) {\n var audioStream = audioInfos[i] ? audioInfos[i].stream : null;\n var videoStream = videoInfos[j] ? videoInfos[j].stream : null;\n var audioDrmInfos = audioInfos[i] ? audioInfos[i].drmInfos : null;\n var videoDrmInfos = videoInfos[j] ? videoInfos[j].drmInfos : null;\n\n var drmInfos;\n if (audioStream && videoStream) {\n if (DrmEngine.areDrmCompatible(audioDrmInfos, videoDrmInfos)) {\n drmInfos = DrmEngine.getCommonDrmInfos(audioDrmInfos, videoDrmInfos);\n } else {\n shaka.log.warning('Incompatible DRM info in HLS variant. Skipping.');\n continue;\n }\n } else if (audioStream) {\n drmInfos = audioDrmInfos;\n } else if (videoStream) {\n drmInfos = videoDrmInfos;\n }\n\n variants.push(this.createVariant_(\n audioStream, videoStream, bandwidth, drmInfos));\n }\n }\n return variants;\n};\n\n\n/**\n * @param {shakaExtern.Stream} audio\n * @param {shakaExtern.Stream} video\n * @param {number} bandwidth\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @return {!shakaExtern.Variant}\n * @private\n */\nshaka.hls.HlsParser.prototype.createVariant_ =\n function(audio, video, bandwidth, drmInfos) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Since both audio and video are of the same type, this assertion will catch\n // certain mistakes at runtime that the compiler would miss.\n goog.asserts.assert(!audio || audio.type == ContentType.AUDIO,\n 'Audio parameter mismatch!');\n goog.asserts.assert(!video || video.type == ContentType.VIDEO,\n 'Video parameter mismatch!');\n\n return {\n id: this.globalId_++,\n language: audio ? audio.language : 'und',\n primary: (!!audio && audio.primary) || (!!video && video.primary),\n audio: audio,\n video: video,\n bandwidth: bandwidth,\n drmInfos: drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n};\n\n\n/**\n * Parses an EXT-X-MEDIA tag with TYPE=\"SUBTITLES\" into a text stream.\n *\n * @param {!shaka.hls.Tag} tag\n * @param {!shaka.hls.Playlist} playlist\n * @return {!Promise.<?shakaExtern.Stream>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createTextStream_ = function(tag, playlist) {\n goog.asserts.assert(tag.name == 'EXT-X-MEDIA',\n 'Should only be called on media tags!');\n\n var type = shaka.hls.HlsParser.getRequiredAttributeValue_(tag, 'TYPE');\n goog.asserts.assert(type == 'SUBTITLES',\n 'Should only be called on tags with TYPE=\"SUBTITLES\"!');\n\n var timeOffset = this.getTimeOffset_(playlist);\n return this.createStreamInfoFromMediaTag_(tag, [], timeOffset)\n .then(function(streamInfo) {\n return streamInfo.stream;\n });\n};\n\n\n/**\n * Parse EXT-X-MEDIA media tag into a Stream object.\n *\n * @param {shaka.hls.Tag} tag\n * @param {!Array.<!string>} allCodecs\n * @param {?number} timeOffset\n * @return {!Promise.<shaka.hls.HlsParser.StreamInfo>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createStreamInfoFromMediaTag_ =\n function(tag, allCodecs, timeOffset) {\n goog.asserts.assert(tag.name == 'EXT-X-MEDIA',\n 'Should only be called on media tags!');\n\n // Check if the stream has already been created as part of another Variant\n // and return it if it has.\n if (this.mediaTagsToStreamInfosMap_[tag.id]) {\n return Promise.resolve().then(function() {\n return this.mediaTagsToStreamInfosMap_[tag.id];\n }.bind(this));\n }\n\n var HlsParser = shaka.hls.HlsParser;\n var type = HlsParser.getRequiredAttributeValue_(tag, 'TYPE').toLowerCase();\n // Shaka recognizes content types 'audio', 'video' and 'text'.\n // HLS 'subtitles' type needs to be mapped to 'text'.\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (type == 'subtitles') type = ContentType.TEXT;\n\n var LanguageUtils = shaka.util.LanguageUtils;\n var language = LanguageUtils.normalize(/** @type {string} */(\n tag.getAttributeValue('LANGUAGE', 'und')));\n var label = tag.getAttributeValue('NAME');\n\n var defaultAttr = tag.getAttribute('DEFAULT');\n var autoselectAttr = tag.getAttribute('AUTOSELECT');\n // TODO: Should we take into account some of the currently ignored attributes:\n // FORCED, INSTREAM-ID, CHARACTERISTICS, CHANNELS?\n // Attribute descriptions:\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-4.3.4.1\n\n var uri = HlsParser.getRequiredAttributeValue_(tag, 'URI');\n var primary = !!defaultAttr || !!autoselectAttr;\n return this.createStreamInfo_(uri, allCodecs, type, timeOffset, language,\n primary, label).then(function(streamInfo) {\n this.mediaTagsToStreamInfosMap_[tag.id] = streamInfo;\n return streamInfo;\n }.bind(this));\n};\n\n\n/**\n * Parse EXT-X-STREAM-INF media tag into a Stream object.\n *\n * @param {!shaka.hls.Tag} tag\n * @param {!Array.<!string>} allCodecs\n * @param {!string} type\n * @param {?number} timeOffset\n * @return {!Promise.<shaka.hls.HlsParser.StreamInfo>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createStreamInfoFromVariantTag_ =\n function(tag, allCodecs, type, timeOffset) {\n goog.asserts.assert(tag.name == 'EXT-X-STREAM-INF',\n 'Should only be called on media tags!');\n\n var uri = shaka.hls.HlsParser.getRequiredAttributeValue_(tag, 'URI');\n return this.createStreamInfo_(uri, allCodecs, type, timeOffset,\n /* language */ 'und', /* primary */ false,\n /* label */ null);\n};\n\n\n/**\n * @param {!string} uri\n * @param {!Array.<!string>} allCodecs\n * @param {!string} type\n * @param {?number} timeOffset\n * @param {!string} language\n * @param {boolean} primary\n * @param {?string} label\n * @return {!Promise.<shaka.hls.HlsParser.StreamInfo>}\n * @throws shaka.util.Error\n * @private\n */\nshaka.hls.HlsParser.prototype.createStreamInfo_ =\n function(uri, allCodecs, type, timeOffset, language, primary, label) {\n var Utils = shaka.hls.Utils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var HlsParser = shaka.hls.HlsParser;\n uri = Utils.constructAbsoluteUri(this.manifestUri_, uri);\n\n return this.requestManifest_(uri).then(function(response) {\n var playlistData = response.data;\n var playlist = this.manifestTextParser_.parsePlaylist(playlistData,\n response.uri);\n if (playlist.type != shaka.hls.PlaylistType.MEDIA) {\n // EXT-X-MEDIA tags should point to media playlists.\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY);\n }\n\n goog.asserts.assert(playlist.segments != null,\n 'Media playlist should have segments!');\n\n // Time offset can be specified on either Master or Media Playlist.\n // If Media Playlist provides it's own value, use that.\n // Otherwise, use value from the Master Playlist. If no offset\n // has been provided it will default to\n // this.config_.hls.defaultTimeOffset.\n var mediaPlaylistTimeOffset = this.getTimeOffset_(playlist);\n timeOffset = mediaPlaylistTimeOffset || timeOffset;\n\n var initSegmentReference = null;\n if (type != ContentType.TEXT) {\n initSegmentReference = this.createInitSegmentReference_(playlist);\n }\n var mediaSequenceTag = Utils.getFirstTagWithName(playlist.tags,\n 'EXT-X-MEDIA-SEQUENCE');\n\n var startPosition = mediaSequenceTag ? Number(mediaSequenceTag.value) : 0;\n var segments = this.createSegments_(playlist, startPosition);\n\n this.presentationTimeline_.notifySegments(0, segments);\n var duration =\n segments[segments.length - 1].endTime - segments[0].startTime;\n var presentationDuration = this.presentationTimeline_.getDuration();\n if (presentationDuration == Infinity || presentationDuration < duration) {\n this.presentationTimeline_.setDuration(duration);\n }\n var codecs = this.guessCodecs_(type, allCodecs);\n\n var kind = undefined;\n\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n if (type == ManifestParserUtils.ContentType.TEXT)\n kind = ManifestParserUtils.TextStreamKind.SUBTITLE;\n // TODO: CLOSED-CAPTIONS requires the parsing of CEA-608 from the video.\n\n var segmentIndex = new shaka.media.SegmentIndex(segments);\n\n var drmTags = [];\n playlist.segments.forEach(function(segment) {\n var segmentKeyTags = Utils.filterTagsByName(segment.tags, 'EXT-X-KEY');\n drmTags.push.apply(drmTags, segmentKeyTags);\n });\n\n var encrypted = false;\n var drmInfos = [];\n var keyId = null;\n\n // TODO: may still need changes to support key rotation\n drmTags.forEach(function(drmTag) {\n var method = HlsParser.getRequiredAttributeValue_(drmTag, 'METHOD');\n if (method != 'NONE') {\n encrypted = true;\n\n var keyFormat =\n HlsParser.getRequiredAttributeValue_(drmTag, 'KEYFORMAT');\n var drmParser =\n shaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_[keyFormat];\n\n var drmInfo = drmParser ? drmParser(drmTag) : null;\n if (drmInfo) {\n if (drmInfo.keyIds.length) {\n keyId = drmInfo.keyIds[0];\n }\n drmInfos.push(drmInfo);\n } else {\n shaka.log.warning('Unsupported HLS KEYFORMAT', keyFormat);\n }\n }\n });\n\n if (encrypted && !drmInfos.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_KEYFORMATS_NOT_SUPPORTED);\n }\n\n return this.guessMimeType_(type, segments[0].getUris()[0])\n .then(function(mimeType) {\n var stream = {\n id: this.globalId_++,\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex),\n initSegmentReference: initSegmentReference,\n presentationTimeOffset: timeOffset || 0,\n mimeType: mimeType,\n codecs: codecs,\n kind: kind,\n encrypted: encrypted,\n keyId: keyId,\n language: language,\n label: label || null,\n type: type,\n primary: primary,\n // TODO: trick mode\n trickModeVideo: null,\n containsEmsgBoxes: false,\n frameRate: undefined,\n width: undefined,\n height: undefined,\n bandwidth: undefined,\n roles: []\n };\n\n this.streamsToIndexMap_[stream.id] = segmentIndex;\n\n return {\n stream: stream,\n segmentIndex: segmentIndex,\n drmInfos: drmInfos\n };\n }.bind(this));\n }.bind(this));\n\n};\n\n\n/**\n * @param {!shaka.hls.Playlist} playlist\n * @return {shaka.media.InitSegmentReference}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.createInitSegmentReference_ = function(playlist) {\n var Utils = shaka.hls.Utils;\n var mapTags = Utils.filterTagsByName(playlist.tags, 'EXT-X-MAP');\n // TODO: Support multiple map tags?\n // For now, we don't support multiple map tags and will throw an error.\n if (!mapTags.length) {\n return null;\n } else if (mapTags.length > 1) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND);\n }\n\n // Map tag example: #EXT-X-MAP:URI=\"main.mp4\",BYTERANGE=\"720@0\"\n var mapTag = mapTags[0];\n var initUri = shaka.hls.HlsParser.getRequiredAttributeValue_(mapTag, 'URI');\n var uri = Utils.constructAbsoluteUri(playlist.uri, initUri);\n var startByte = 0;\n var endByte = null;\n var byterange = mapTag.getAttributeValue('BYTERANGE');\n // If BYTERANGE attribute is not specified, the segment consists\n // of the entire resourse.\n if (byterange) {\n var blocks = byterange.split('@');\n var byteLength = Number(blocks[0]);\n startByte = Number(blocks[1]);\n endByte = startByte + byteLength - 1;\n }\n\n return new shaka.media.InitSegmentReference(function() { return [uri]; },\n startByte,\n endByte);\n};\n\n\n/**\n * Parses shaka.hls.Segment objects into shaka.media.SegmentReferences.\n *\n * @param {!shaka.hls.Playlist} playlist\n * @param {number} startPosition\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createSegments_ =\n function(playlist, startPosition) {\n var hlsSegments = playlist.segments;\n var segments = [];\n\n hlsSegments.forEach(function(segment) {\n var Utils = shaka.hls.Utils;\n var tags = segment.tags;\n var uri = Utils.constructAbsoluteUri(playlist.uri, segment.uri);\n\n // Start and end times\n var extinfTag = this.getRequiredTag_(tags, 'EXTINF');\n // EXTINF tag format is '#EXTINF:<duration>,[<title>]'.\n // We're interested in the duration part.\n var extinfValues = extinfTag.value.split(',');\n var duration = Number(extinfValues[0]);\n var startTime;\n var index = hlsSegments.indexOf(segment);\n if (index == 0) {\n startTime = 0;\n } else {\n startTime = segments[index - 1].endTime;\n }\n var endTime = startTime + duration;\n\n // StartByte and EndByte\n var startByte = 0;\n var endByte = null;\n var byterange = Utils.getFirstTagWithName(tags, 'EXT-X-BYTERANGE');\n // If BYTERANGE is not specified, the segment consists of the\n // entire resourse.\n if (byterange) {\n var blocks = byterange.value.split('@');\n var byteLength = Number(blocks[0]);\n if (blocks[1]) {\n startByte = Number(blocks[1]);\n } else {\n startByte = segments[index - 1].endByte;\n }\n endByte = startByte + byteLength - 1;\n\n // Last segment has endByte of null to indicate that it extends\n // to the end of the resource.\n if (index == hlsSegments.length - 1)\n endByte = null;\n }\n segments.push(new shaka.media.SegmentReference(startPosition + index,\n startTime,\n endTime,\n function() { return [uri]; },\n startByte,\n endByte));\n }.bind(this));\n\n return segments;\n};\n\n\n/**\n * Adjusts segment references of every stream of every variant to the\n * timeline of the presentation.\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @private\n */\nshaka.hls.HlsParser.prototype.fitSegments_ = function(variants) {\n variants.forEach(function(variant) {\n var duration = this.presentationTimeline_.getDuration();\n var video = variant.video;\n var audio = variant.audio;\n if (video && this.streamsToIndexMap_[video.id]) {\n this.streamsToIndexMap_[video.id].fit(duration);\n }\n if (audio && this.streamsToIndexMap_[audio.id]) {\n this.streamsToIndexMap_[audio.id].fit(duration);\n }\n }.bind(this));\n};\n\n\n/**\n * Attempts to guess which codecs from the codecs list belong\n * to a given content type.\n *\n * @param {!string} contentType\n * @param {!Array.<!string>} codecs\n * @return {string}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.guessCodecs_ = function(contentType, codecs) {\n if (codecs.length == 1) {\n return codecs[0];\n }\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return '';\n }\n\n var HlsParser = shaka.hls.HlsParser;\n var formats = HlsParser.VIDEO_CODEC_FORMATS_;\n if (contentType == ContentType.AUDIO)\n formats = HlsParser.AUDIO_CODEC_FORMATS_;\n\n for (var i = 0; i < formats.length; i++) {\n for (var j = 0; j < codecs.length; j++) {\n if (formats[i].test(codecs[j].trim())) {\n return codecs[j].trim();\n }\n }\n }\n\n // Unable to guess codecs.\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_COULD_NOT_GUESS_CODECS,\n codecs);\n};\n\n\n/**\n * Attempts to guess stream's mime type based on content type and uri.\n *\n * @param {!string} contentType\n * @param {!string} uri\n * @return {!Promise.<!string>}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.guessMimeType_ = function(contentType, uri) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var blocks = uri.split('.');\n var extension = blocks[blocks.length - 1];\n\n if (contentType == ContentType.TEXT) {\n // HLS only supports vtt at the moment.\n return Promise.resolve('text/vtt');\n }\n\n var HlsParser = shaka.hls.HlsParser;\n var map = HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_;\n if (contentType == ContentType.VIDEO)\n map = HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_;\n\n var mimeType = map[extension];\n if (mimeType)\n return Promise.resolve(mimeType);\n\n // If unable to guess mime type, request a segment and try getting it\n // from the response.\n var headRequest = shaka.net.NetworkingEngine.makeRequest(\n [uri], this.config_.retryParameters);\n headRequest.method = 'HEAD';\n var requestType = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n return this.playerInterface_.networkingEngine.request(\n requestType, headRequest)\n .then(function(response) {\n var mimeType = response.headers['content-type'];\n if (!mimeType) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_COULD_NOT_GUESS_MIME_TYPE,\n extension);\n }\n\n return mimeType;\n });\n};\n\n\n/**\n * Get presentation time offset of the playlist if it has been specified.\n * Return null otherwise.\n *\n * @param {!shaka.hls.Playlist} playlist\n * @return {?number}\n * @private\n */\nshaka.hls.HlsParser.prototype.getTimeOffset_ = function(playlist) {\n var Utils = shaka.hls.Utils;\n var startTag = Utils.getFirstTagWithName(playlist.tags, 'EXT-X-START');\n // TODO: Should we respect the PRECISE flag?\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-4.3.5.2\n if (startTag)\n return Number(shaka.hls.HlsParser.getRequiredAttributeValue_(\n startTag, 'TIME-OFFSET'));\n\n return this.config_.hls.defaultTimeOffset;\n};\n\n\n/**\n * Find the attribute and returns its value.\n * Throws an error if attribute was not found.\n *\n * @param {shaka.hls.Tag} tag\n * @param {!string} attributeName\n * @return {!string}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.getRequiredAttributeValue_ =\n function(tag, attributeName) {\n var attribute = tag.getAttribute(attributeName);\n if (!attribute) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_REQUIRED_ATTRIBUTE_MISSING,\n attributeName);\n }\n\n return attribute.value;\n};\n\n\n/**\n * Returns a tag with a given name.\n * Throws an error if tag was not found.\n *\n * @param {!Array.<shaka.hls.Tag>} tags\n * @param {!string} tagName\n * @return {!shaka.hls.Tag}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.getRequiredTag_ = function(tags, tagName) {\n var Utils = shaka.hls.Utils;\n var tag = Utils.getFirstTagWithName(tags, tagName);\n if (!tag) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_REQUIRED_TAG_MISSING, tagName);\n }\n\n return tag;\n};\n\n\n/**\n * @param {shakaExtern.Stream} stream\n * @param {?string} width\n * @param {?string} height\n * @param {?string} frameRate\n * @private\n */\nshaka.hls.HlsParser.prototype.addVideoAttributes_ =\n function(stream, width, height, frameRate) {\n if (stream) {\n stream.width = Number(width) || undefined;\n stream.height = Number(height) || undefined;\n stream.frameRate = Number(frameRate) || undefined;\n }\n};\n\n\n/**\n * Makes a network request for the manifest and returns a Promise\n * with the resulting data.\n *\n * @param {!string} uri\n * @return {!Promise.<!shakaExtern.Response>}\n * @private\n */\nshaka.hls.HlsParser.prototype.requestManifest_ = function(uri) {\n var requestType = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n var request = shaka.net.NetworkingEngine.makeRequest(\n [uri], this.config_.retryParameters);\n return this.playerInterface_.networkingEngine.request(requestType, request);\n};\n\n\n/**\n * A list of well-known video codecs formats.\n *\n * @const {!Array<!RegExp>}\n * @private\n */\nshaka.hls.HlsParser.VIDEO_CODEC_FORMATS_ = [\n /^(avc)/,\n /^(hvc)/,\n /^(vp[8-9])$/,\n /^(av1)$/,\n /^(mp4v)/\n];\n\n\n/**\n * A list of well-known audio codecs formats.\n *\n * @const {!Array<!RegExp>}\n * @private\n */\nshaka.hls.HlsParser.AUDIO_CODEC_FORMATS_ = [\n /^(vorbis)/,\n /^(opus)/,\n /^(mp4a)/,\n /^(ac-3)$/,\n /^(ec-3)$/\n];\n\n\n/**\n * @const {!Object<string, string>}\n * @private\n */\nshaka.hls.HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_ = {\n 'mp4': 'audio/mp4',\n 'm4s': 'audio/mp4',\n 'm4i': 'audio/mp4',\n 'm4a': 'audio/mp4',\n // mpeg2 ts aslo uses video/ for audio: http://goo.gl/tYHXiS\n 'ts': 'video/mp2t'\n};\n\n\n/**\n * @const {!Object<string, string>}\n * @private\n */\nshaka.hls.HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_ = {\n 'mp4': 'video/mp4',\n 'm4s': 'video/mp4',\n 'm4i': 'video/mp4',\n 'm4v': 'video/mp4',\n 'ts': 'video/mp2t'\n};\n\n\n/**\n * @typedef {function(!shaka.hls.Tag):?shakaExtern.DrmInfo}\n * @private\n */\nshaka.hls.HlsParser.DrmParser_;\n\n\n/**\n * @param {!shaka.hls.Tag} drmTag\n * @return {?shakaExtern.DrmInfo}\n * @private\n */\nshaka.hls.HlsParser.widevineDrmParser_ = function(drmTag) {\n var HlsParser = shaka.hls.HlsParser;\n var method = HlsParser.getRequiredAttributeValue_(drmTag, 'METHOD');\n if (method != 'SAMPLE-AES-CENC') {\n shaka.log.error(\n 'Widevine in HLS is only supported with SAMPLE-AES-CENC, not', method);\n return null;\n }\n\n var uri = HlsParser.getRequiredAttributeValue_(drmTag, 'URI');\n var parsedData = shaka.net.DataUriPlugin.parse(uri);\n\n // The data encoded in the URI is a PSSH box to be used as init data.\n var pssh = new Uint8Array(parsedData.data);\n var drmInfo = shaka.util.ManifestParserUtils.createDrmInfo(\n 'com.widevine.alpha', [\n {initDataType: 'cenc', initData: pssh}\n ]);\n\n var keyId = drmTag.getAttributeValue('KEYID');\n if (keyId) {\n // This value begins with '0x':\n goog.asserts.assert(keyId.substr(0, 2) == '0x',\n 'Incorrect KEYID format!');\n // But the output does not contain the '0x':\n drmInfo.keyIds = [keyId.substr(2).toLowerCase()];\n }\n return drmInfo;\n};\n\n\n/**\n * @const {!Object.<string, shaka.hls.HlsParser.DrmParser_>}\n * @private\n */\nshaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_ = {\n /* TODO: https://github.com/google/shaka-player/issues/382\n 'com.apple.streamingkeydelivery':\n shaka.hls.HlsParser.fairplayDrmParser_,\n */\n 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed':\n shaka.hls.HlsParser.widevineDrmParser_\n};\n\n\nshaka.media.ManifestParser.registerParserByExtension(\n 'm3u8', shaka.hls.HlsParser);\nshaka.media.ManifestParser.registerParserByMime(\n 'application/x-mpegurl', shaka.hls.HlsParser);\nshaka.media.ManifestParser.registerParserByMime(\n 'application/vnd.apple.mpegurl', shaka.hls.HlsParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/hls_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.TtmlTextParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\n\n\n\n/**\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.TtmlTextParser = function() {};\n\n\n/** @override */\nshaka.media.TtmlTextParser.prototype.parseInit = function(data) {\n goog.asserts.assert(false, 'TTML does not have init segments');\n};\n\n\n/** @override */\nshaka.media.TtmlTextParser.prototype.parseMedia = function(data, time) {\n var str = shaka.util.StringUtils.fromUTF8(data);\n var ret = [];\n var parser = new DOMParser();\n var xml = null;\n\n try {\n xml = parser.parseFromString(str, 'text/xml');\n } catch (exception) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_XML);\n }\n\n if (xml) {\n // Try to get the framerate, subFrameRate and frameRateMultiplier\n // if applicable\n var frameRate = null;\n var subFrameRate = null;\n var frameRateMultiplier = null;\n var tickRate = null;\n var spaceStyle = null;\n var tts = xml.getElementsByTagName('tt');\n var tt = tts[0];\n // TTML should always have tt element\n if (!tt) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_XML);\n } else {\n frameRate = tt.getAttribute('ttp:frameRate');\n subFrameRate = tt.getAttribute('ttp:subFrameRate');\n frameRateMultiplier = tt.getAttribute('ttp:frameRateMultiplier');\n tickRate = tt.getAttribute('ttp:tickRate');\n spaceStyle = tt.getAttribute('xml:space') || 'default';\n }\n\n if (spaceStyle != 'default' && spaceStyle != 'preserve') {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_XML);\n }\n var whitespaceTrim = spaceStyle == 'default';\n\n var rateInfo = new shaka.media.TtmlTextParser.RateInfo_(\n frameRate, subFrameRate, frameRateMultiplier, tickRate);\n\n var styles = shaka.media.TtmlTextParser.getLeafNodes_(\n tt.getElementsByTagName('styling')[0]);\n var regions = shaka.media.TtmlTextParser.getLeafNodes_(\n tt.getElementsByTagName('layout')[0]);\n var textNodes = shaka.media.TtmlTextParser.getLeafNodes_(\n tt.getElementsByTagName('body')[0]);\n\n for (var i = 0; i < textNodes.length; i++) {\n var cue = shaka.media.TtmlTextParser.parseCue_(textNodes[i],\n time.periodStart,\n rateInfo,\n styles,\n regions,\n whitespaceTrim);\n if (cue)\n ret.push(cue);\n }\n }\n\n return ret;\n};\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 00:00:40:07 (7 frames) or 00:00:40:07.1 (7 frames, 1 subframe)\n */\nshaka.media.TtmlTextParser.timeColonFormatFrames_ =\n /^(\\d{2,}):(\\d{2}):(\\d{2}):(\\d{2})\\.?(\\d+)?$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 00:00:40 or 00:40\n */\nshaka.media.TtmlTextParser.timeColonFormat_ =\n /^(?:(\\d{2,}):)?(\\d{2}):(\\d{2})$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * example 01:02:43.0345555 or 02:43.03\n */\nshaka.media.TtmlTextParser.timeColonFormatMilliseconds_ =\n /^(?:(\\d{2,}):)?(\\d{2}):(\\d{2}\\.\\d{2,})$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 75f or 75.5f\n */\nshaka.media.TtmlTextParser.timeFramesFormat_ = /^(\\d*\\.?\\d*)f$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 50t or 50.5t\n */\nshaka.media.TtmlTextParser.timeTickFormat_ = /^(\\d*\\.?\\d*)t$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 3.45h, 3m or 4.20s\n */\nshaka.media.TtmlTextParser.timeHMSFormat_ =\n /^(?:(\\d*\\.?\\d*)h)?(?:(\\d*\\.?\\d*)m)?(?:(\\d*\\.?\\d*)s)?(?:(\\d*\\.?\\d*)ms)?$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 50% 10%\n */\nshaka.media.TtmlTextParser.percentValues_ = /^(\\d{1,2}|100)% (\\d{1,2}|100)%$/;\n\n\n/**\n * @const\n * @private {!Object}\n */\nshaka.media.TtmlTextParser.textAlignToLineAlign_ = {\n 'left': 'start',\n 'center': 'center',\n 'right': 'end',\n 'start': 'start',\n 'end': 'end'\n};\n\n\n/**\n * @const\n * @private {!Object}\n */\nshaka.media.TtmlTextParser.textAlignToPositionAlign_ = {\n 'left': 'line-left',\n 'center': 'center',\n 'right': 'line-right'\n};\n\n\n/**\n * Gets leaf nodes of the xml node tree. Ignores the text, br elements\n * and the spans positioned inside paragraphs\n *\n * @param {Element} element\n * @return {!Array.<!Element>}\n * @private\n */\nshaka.media.TtmlTextParser.getLeafNodes_ = function(element) {\n var result = [];\n if (!element)\n return result;\n\n var childNodes = element.childNodes;\n for (var i = 0; i < childNodes.length; i++) {\n // Currently we don't support styles applicable to span\n // elements, so they are ignored\n var isSpanChildOfP = childNodes[i].nodeName == 'span' &&\n element.nodeName == 'p';\n if (childNodes[i].nodeType == Node.ELEMENT_NODE &&\n childNodes[i].nodeName != 'br' && !isSpanChildOfP) {\n // Get the leafs the child might contain\n goog.asserts.assert(childNodes[i] instanceof Element,\n 'Node should be Element!');\n var leafChildren = shaka.media.TtmlTextParser.getLeafNodes_(\n /** @type {Element} */(childNodes[i]));\n goog.asserts.assert(leafChildren.length > 0,\n 'Only a null Element should return no leaves!');\n result = result.concat(leafChildren);\n }\n }\n\n // if no result at this point, the element itself must be a leaf\n if (!result.length) {\n result.push(element);\n }\n return result;\n};\n\n\n/**\n * Insert \\n where <br> tags are found\n *\n * @param {!Node} element\n * @param {boolean} whitespaceTrim\n * @private\n */\nshaka.media.TtmlTextParser.addNewLines_ = function(element, whitespaceTrim) {\n var childNodes = element.childNodes;\n\n for (var i = 0; i < childNodes.length; i++) {\n if (childNodes[i].nodeName == 'br' && i > 0) {\n childNodes[i - 1].textContent += '\\n';\n } else if (childNodes[i].childNodes.length > 0) {\n shaka.media.TtmlTextParser.addNewLines_(childNodes[i], whitespaceTrim);\n } else if (whitespaceTrim) {\n // Trim leading and trailing whitespace.\n var trimmed = childNodes[i].textContent.trim();\n // Collapse multiple spaces into one.\n trimmed = trimmed.replace(/\\s+/g, ' ');\n\n childNodes[i].textContent = trimmed;\n }\n }\n};\n\n\n/**\n * Parses an Element into a TextTrackCue or VTTCue.\n *\n * @param {!Element} cueElement\n * @param {number} offset\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {!Array.<!Element>} styles\n * @param {!Array.<!Element>} regions\n * @param {boolean} whitespaceTrim\n * @return {TextTrackCue}\n * @private\n */\nshaka.media.TtmlTextParser.parseCue_ = function(\n cueElement, offset, rateInfo, styles, regions, whitespaceTrim) {\n\n // Disregard empty elements:\n // TTML allows for empty elements like <div></div>.\n // If cueElement has neither time attributes, nor\n // non-whitespace text, don't try to make a cue out of it.\n if (!cueElement.hasAttribute('begin') &&\n !cueElement.hasAttribute('end') &&\n /^\\s*$/.test(cueElement.textContent))\n return null;\n\n shaka.media.TtmlTextParser.addNewLines_(cueElement, whitespaceTrim);\n\n // Get time\n var start = shaka.media.TtmlTextParser.parseTime_(\n cueElement.getAttribute('begin'), rateInfo);\n var end = shaka.media.TtmlTextParser.parseTime_(\n cueElement.getAttribute('end'), rateInfo);\n var duration = shaka.media.TtmlTextParser.parseTime_(\n cueElement.getAttribute('dur'), rateInfo);\n var payload = cueElement.textContent;\n\n if (end == null && duration != null)\n end = start + duration;\n\n if (start == null || end == null) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_TEXT_CUE);\n }\n\n start += offset;\n end += offset;\n\n var cue = shaka.media.TextEngine.makeCue(start, end, payload);\n if (!cue)\n return null;\n\n // Get other properties if available\n var region = shaka.media.TtmlTextParser.getElementFromCollection_(\n cueElement, 'region', regions);\n shaka.media.TtmlTextParser.addStyle_(cue, cueElement, region, styles);\n\n return cue;\n};\n\n\n/**\n * Adds applicable style properties to a cue.\n *\n * @param {!TextTrackCue} cue\n * @param {!Element} cueElement\n * @param {Element} region\n * @param {!Array.<!Element>} styles\n * @private\n */\nshaka.media.TtmlTextParser.addStyle_ = function(\n cue, cueElement, region, styles) {\n var TtmlTextParser = shaka.media.TtmlTextParser;\n var results = null;\n\n\n var extent = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:extent');\n if (extent) {\n results = TtmlTextParser.percentValues_.exec(extent);\n if (results != null) {\n // Use width value of the extent attribute for size.\n // Height value is ignored.\n cue.size = Number(results[1]);\n }\n }\n\n var writingMode = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:writingMode');\n var isVerticalText = true;\n if (writingMode == 'tb' || writingMode == 'tblr')\n cue.vertical = 'lr';\n else if (writingMode == 'tbrl')\n cue.vertical = 'rl';\n else\n isVerticalText = false;\n\n var origin = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:origin');\n if (origin) {\n results = TtmlTextParser.percentValues_.exec(origin);\n if (results != null) {\n // for vertical text use first coordinate of tts:origin\n // to represent line of the cue and second - for position.\n // Otherwise (horizontal), use them the other way around.\n if (isVerticalText) {\n cue.position = Number(results[2]);\n cue.line = Number(results[1]);\n } else {\n cue.position = Number(results[1]);\n cue.line = Number(results[2]);\n }\n // A boolean indicating whether the line is an integer\n // number of lines (using the line dimensions of the first\n // line of the cue), or whether it is a percentage of the\n // dimension of the video. The flag is set to true when lines\n // are counted, and false otherwise.\n cue.snapToLines = false;\n }\n }\n\n var align = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:textAlign');\n if (align) {\n cue.align = align;\n if (align == 'center') {\n if (cue.align != 'center') {\n // Workaround for a Chrome bug http://crbug.com/663797\n // Chrome does not support align = 'center'\n cue.align = 'middle';\n }\n cue.position = 'auto';\n }\n cue.positionAlign = TtmlTextParser.textAlignToPositionAlign_[align];\n cue.lineAlign = TtmlTextParser.textAlignToLineAlign_[align];\n }\n};\n\n\n/**\n * Finds a specified attribute on either the original cue element or its\n * associated region and returns the value if the attribute was found.\n *\n * @param {!Element} cueElement\n * @param {Element} region\n * @param {!Array.<!Element>} styles\n * @param {string} attribute\n * @return {?string}\n * @private\n */\nshaka.media.TtmlTextParser.getStyleAttribute_ = function(\n cueElement, region, styles, attribute) {\n\n // An attribute can be specified on region level or in a styling block\n // associated with the region or original element.\n var regionChildren = shaka.media.TtmlTextParser.getLeafNodes_(region);\n for (var i = 0; i < regionChildren.length; i++) {\n var attr = regionChildren[i].getAttribute(attribute);\n if (attr)\n return attr;\n }\n\n var getElementFromCollection_ =\n shaka.media.TtmlTextParser.getElementFromCollection_;\n var style = getElementFromCollection_(region, 'style', styles) ||\n getElementFromCollection_(cueElement, 'style', styles);\n if (style)\n return style.getAttribute(attribute);\n return null;\n};\n\n\n/**\n * Selects an item from |collection| whose id matches |attributeName|\n * from |element|.\n *\n * @param {Element} element\n * @param {string} attributeName\n * @param {!Array.<Element>} collection\n * @return {Element}\n * @private\n */\nshaka.media.TtmlTextParser.getElementFromCollection_ = function(\n element, attributeName, collection) {\n if (!element || collection.length < 1) {\n return null;\n }\n var item = null;\n var itemName = shaka.media.TtmlTextParser.getInheritedAttribute_(\n element, attributeName);\n if (itemName) {\n for (var i = 0; i < collection.length; i++) {\n if (collection[i].getAttribute('xml:id') == itemName) {\n item = collection[i];\n break;\n }\n }\n }\n\n return item;\n};\n\n\n/**\n * Traverses upwards from a given node until a given attribute is found.\n *\n * @param {!Element} element\n * @param {string} attributeName\n * @return {?string}\n * @private\n */\nshaka.media.TtmlTextParser.getInheritedAttribute_ = function(\n element, attributeName) {\n var ret = null;\n while (element) {\n ret = element.getAttribute(attributeName);\n if (ret) {\n break;\n }\n\n // Element.parentNode can lead to XMLDocument, which is not an Element and\n // has no getAttribute().\n var parentNode = element.parentNode;\n if (parentNode instanceof Element) {\n element = parentNode;\n } else {\n break;\n }\n }\n return ret;\n};\n\n\n/**\n * Parses a TTML time from the given word.\n *\n * @param {string} text\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseTime_ = function(text, rateInfo) {\n var ret = null;\n var TtmlTextParser = shaka.media.TtmlTextParser;\n\n if (TtmlTextParser.timeColonFormatFrames_.test(text)) {\n ret = TtmlTextParser.parseColonTimeWithFrames_(rateInfo, text);\n } else if (TtmlTextParser.timeColonFormat_.test(text)) {\n ret = TtmlTextParser.parseTimeFromRegex_(\n TtmlTextParser.timeColonFormat_, text);\n } else if (TtmlTextParser.timeColonFormatMilliseconds_.test(text)) {\n ret = TtmlTextParser.parseTimeFromRegex_(\n TtmlTextParser.timeColonFormatMilliseconds_, text);\n } else if (TtmlTextParser.timeFramesFormat_.test(text)) {\n ret = TtmlTextParser.parseFramesTime_(rateInfo, text);\n } else if (TtmlTextParser.timeTickFormat_.test(text)) {\n ret = TtmlTextParser.parseTickTime_(rateInfo, text);\n } else if (TtmlTextParser.timeHMSFormat_.test(text)) {\n ret = TtmlTextParser.parseTimeFromRegex_(\n TtmlTextParser.timeHMSFormat_, text);\n }\n\n return ret;\n};\n\n\n/**\n * Parses a TTML time in frame format\n *\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseFramesTime_ = function(rateInfo, text) {\n\n // 75f or 75.5f\n var results = shaka.media.TtmlTextParser.timeFramesFormat_.exec(text);\n var frames = Number(results[1]);\n\n return frames / rateInfo.frameRate;\n};\n\n\n/**\n * Parses a TTML time in tick format\n *\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseTickTime_ = function(rateInfo, text) {\n\n // 50t or 50.5t\n var results = shaka.media.TtmlTextParser.timeTickFormat_.exec(text);\n var ticks = Number(results[1]);\n\n return ticks / rateInfo.tickRate;\n};\n\n\n/**\n * Parses a TTML colon formatted time containing frames\n *\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseColonTimeWithFrames_ = function(\n rateInfo, text) {\n\n // 01:02:43:07 ('07' is frames) or 01:02:43:07.1 (subframes)\n var results = shaka.media.TtmlTextParser.timeColonFormatFrames_.exec(text);\n\n var hours = Number(results[1]);\n var minutes = Number(results[2]);\n var seconds = Number(results[3]);\n var frames = Number(results[4]);\n var subframes = Number(results[5]) || 0;\n\n frames += subframes / rateInfo.subFrameRate;\n seconds += frames / rateInfo.frameRate;\n\n return seconds + (minutes * 60) + (hours * 3600);\n};\n\n\n/**\n * Parses a TTML time with a given regex. Expects regex to be some\n * sort of a time-matcher to match hours, minutes, seconds and milliseconds\n *\n * @param {!RegExp} regex\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseTimeFromRegex_ = function(regex, text) {\n var results = regex.exec(text);\n if (results == null || results[0] == '')\n return null;\n // This capture is optional, but will still be in the array as undefined,\n // default to 0.\n var hours = Number(results[1]) || 0;\n var minutes = Number(results[2]) || 0;\n var seconds = Number(results[3]) || 0;\n var miliseconds = Number(results[4]) || 0;\n\n return (miliseconds / 1000) + seconds + (minutes * 60) + (hours * 3600);\n};\n\n\n\n/**\n * Contains information about frame/subframe rate\n * and frame rate multiplier for time in frame format.\n * ex. 01:02:03:04(4 frames) or 01:02:03:04.1(4 frames, 1 subframe)\n *\n * @param {?string} frameRate\n * @param {?string} subFrameRate\n * @param {?string} frameRateMultiplier\n * @param {?string} tickRate\n * @constructor\n * @struct\n * @private\n */\nshaka.media.TtmlTextParser.RateInfo_ = function(\n frameRate, subFrameRate, frameRateMultiplier, tickRate) {\n\n /**\n * @type {number}\n */\n this.frameRate = Number(frameRate) || 30;\n\n /**\n * @type {number}\n */\n this.subFrameRate = Number(subFrameRate) || 1;\n\n /**\n * @type {number}\n */\n this.tickRate = Number(tickRate);\n if (this.tickRate == 0) {\n if (frameRate)\n this.tickRate = this.frameRate * this.subFrameRate;\n else\n this.tickRate = 1;\n }\n\n if (frameRateMultiplier) {\n var multiplierResults = /^(\\d+) (\\d+)$/g.exec(frameRateMultiplier);\n if (multiplierResults) {\n var numerator = multiplierResults[1];\n var denominator = multiplierResults[2];\n var multiplierNum = numerator / denominator;\n this.frameRate *= multiplierNum;\n }\n }\n};\n\n\nshaka.media.TextEngine.registerParser(\n 'application/ttml+xml',\n shaka.media.TtmlTextParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/ttml_text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Mp4TtmlParser');\n\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.media.TtmlTextParser');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Mp4Parser');\n\n\n\n/**\n * @struct\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.Mp4TtmlParser = function() {\n /**\n * @type {!shakaExtern.TextParser}\n * @private\n */\n this.parser_ = new shaka.media.TtmlTextParser();\n};\n\n\n/** @override **/\nshaka.media.Mp4TtmlParser.prototype.parseInit = function(data) {\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var sawSTPP = false;\n\n new Mp4Parser()\n .box('moov', Mp4Parser.children)\n .box('trak', Mp4Parser.children)\n .box('mdia', Mp4Parser.children)\n .box('minf', Mp4Parser.children)\n .box('stbl', Mp4Parser.children)\n .fullBox('stsd', Mp4Parser.sampleDescription)\n .box('stpp', function(box) {\n sawSTPP = true;\n }).parse(data);\n\n if (!sawSTPP) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_TTML);\n }\n};\n\n\n/** @override **/\nshaka.media.Mp4TtmlParser.prototype.parseMedia = function(data, time) {\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var sawMDAT = false;\n var payload = [];\n\n new Mp4Parser()\n .box('mdat', Mp4Parser.allData(function(data) {\n sawMDAT = true;\n payload = this.parser_.parseMedia(data.buffer, time);\n }.bind(this))).parse(data);\n\n if (!sawMDAT) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_TTML);\n }\n\n return payload;\n};\n\n\nshaka.media.TextEngine.registerParser(\n 'application/mp4; codecs=\"stpp\"',\n shaka.media.Mp4TtmlParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/mp4_ttml_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.VttTextParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.TextParser');\n\n\n\n/**\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.VttTextParser = function() { };\n\n\n/** @override */\nshaka.media.VttTextParser.prototype.parseInit = function(data) {\n goog.asserts.assert(false, 'VTT does not have init segments');\n};\n\n\n/**\n * @override\n * @throws {shaka.util.Error}\n */\nshaka.media.VttTextParser.prototype.parseMedia = function(data, time) {\n var VttTextParser = shaka.media.VttTextParser;\n // Get the input as a string. Normalize newlines to \\n.\n var str = shaka.util.StringUtils.fromUTF8(data);\n str = str.replace(/\\r\\n|\\r(?=[^\\n]|$)/gm, '\\n');\n var blocks = str.split(/\\n{2,}/m);\n\n if (!/^WEBVTT($|[ \\t\\n])/m.test(blocks[0])) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_TEXT_HEADER);\n }\n\n var offset = time.segmentStart;\n // Parse X-TIMESTAMP-MAP metadata header if it's present to get\n // time offset information.\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5\n if (blocks[0].indexOf('X-TIMESTAMP-MAP') >= 0) {\n // 'X-TIMESTAMP-MAP' header is used in HLS to align text with\n // the rest of the media.\n // The header format is 'X-TIMESTAMP-MAP=MPEGTS:n,LOCAL:m'\n // (the attributes can go in any order)\n // where n is MPEG-2 time and m is cue time it maps to.\n // For example 'X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000'\n // means an offset of 10 seconds\n // 900000/MPEG_TIMESCALE - cue time.\n var cueTimeMatch =\n blocks[0].match(/LOCAL:((?:(\\d{1,}):)?(\\d{2}):(\\d{2})\\.(\\d{3}))/m);\n\n var mpegTimeMatch = blocks[0].match(/MPEGTS:(\\d+)/m);\n if (cueTimeMatch && mpegTimeMatch) {\n var parser = new shaka.util.TextParser(cueTimeMatch[1]);\n var cueTime = shaka.media.VttTextParser.parseTime_(parser);\n var mpegTime = Number(mpegTimeMatch[1]);\n var mpegTimescale = shaka.media.VttTextParser.MPEG_TIMESCALE_;\n // Apple-encoded HLS content uses absolute timestamps, so assume\n // the presence of the map tag means the content uses absolute\n // timestamps.\n offset = time.periodStart + (mpegTime / mpegTimescale - cueTime);\n }\n }\n\n var ret = [];\n for (var i = 1; i < blocks.length; i++) {\n var lines = blocks[i].split('\\n');\n var cue = VttTextParser.parseCue_(lines, offset);\n if (cue)\n ret.push(cue);\n }\n\n return ret;\n};\n\n\n/**\n * Parses a text block into a Cue object.\n *\n * @param {!Array.<string>} text\n * @param {number} timeOffset\n * @return {?TextTrackCue}\n * @private\n */\nshaka.media.VttTextParser.parseCue_ = function(text, timeOffset) {\n // Skip empty blocks.\n if (text.length == 1 && !text[0])\n return null;\n\n // Skip comment blocks.\n if (/^NOTE($|[ \\t])/.test(text[0]))\n return null;\n\n var id = null;\n var index = text[0].indexOf('-->');\n if (index < 0) {\n id = text[0];\n text.splice(0, 1);\n }\n\n // Parse the times.\n var parser = new shaka.util.TextParser(text[0]);\n var start = shaka.media.VttTextParser.parseTime_(parser);\n var expect = parser.readRegex(/[ \\t]+-->[ \\t]+/g);\n var end = shaka.media.VttTextParser.parseTime_(parser);\n\n if (start == null || expect == null || end == null) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_TEXT_CUE);\n }\n\n start += timeOffset;\n end += timeOffset;\n\n // Get the payload.\n var payload = text.slice(1).join('\\n').trim();\n\n var cue = shaka.media.TextEngine.makeCue(start, end, payload);\n if (!cue)\n return null;\n\n // Parse optional settings.\n parser.skipWhitespace();\n var word = parser.readWord();\n while (word) {\n if (!shaka.media.VttTextParser.parseSetting(cue, word)) {\n shaka.log.warning('VTT parser encountered an invalid VTT setting: ',\n word,\n ' The setting will be ignored.');\n }\n parser.skipWhitespace();\n word = parser.readWord();\n }\n\n if (id != null)\n cue.id = id;\n return cue;\n};\n\n\n/**\n * Parses a WebVTT setting from the given word.\n *\n * @param {!TextTrackCue} cue\n * @param {string} word\n * @return {boolean} True on success.\n */\nshaka.media.VttTextParser.parseSetting = function(cue, word) {\n // NOTE: positionAlign and lineAlign settings are not supported by Chrome\n // at the moment, so setting them will have no effect.\n // The bug on chromium to implement them:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=633690\n\n var results = null;\n if ((results = /^align:(start|middle|center|end|left|right)$/.exec(word))) {\n cue.align = results[1];\n if (results[1] == 'center' && cue.align != 'center') {\n // Workaround for a Chrome bug http://crbug.com/663797\n // Chrome does not support align = 'center'\n cue.position = 'auto';\n cue.align = 'middle';\n }\n } else if ((results = /^vertical:(lr|rl)$/.exec(word))) {\n cue.vertical = results[1];\n } else if ((results = /^size:(\\d{1,2}|100)%$/.exec(word))) {\n cue.size = Number(results[1]);\n }\n // There was a disagreement between a working draft and an editor draft of\n // the WebVTT spec. According to the former, optional position alignment\n // options are 'start', 'end' and 'center'. According to the latter -\n // 'line-left', 'center' and 'line-right'.\n // We are going to support both options for now.\n else if ((results =\n /^position:(\\d{1,2}|100)%(?:,(line-left|line-right|center|start|end))?$/\n .exec(word))) {\n cue.position = Number(results[1]);\n if (results[2])\n cue.positionAlign = results[2];\n } else if ((results =\n /^line:(\\d{1,2}|100)%(?:,(start|end|center))?$/.exec(word))) {\n cue.snapToLines = false;\n cue.line = Number(results[1]);\n if (results[2])\n cue.lineAlign = results[2];\n } else if ((results = /^line:(-?\\d+)(?:,(start|end|center))?$/.exec(word))) {\n cue.snapToLines = true;\n cue.line = Number(results[1]);\n if (results[2])\n cue.lineAlign = results[2];\n } else {\n return false;\n }\n\n return true;\n};\n\n\n/**\n * Parses a WebVTT time from the given parser.\n *\n * @param {!shaka.util.TextParser} parser\n * @return {?number}\n * @private\n */\nshaka.media.VttTextParser.parseTime_ = function(parser) {\n // 00:00.000 or 00:00:00.000 or 0:00:00.000\n var results = parser.readRegex(/(?:(\\d{1,}):)?(\\d{2}):(\\d{2})\\.(\\d{3})/g);\n if (results == null)\n return null;\n // This capture is optional, but will still be in the array as undefined,\n // default to 0.\n var hours = Number(results[1]) || 0;\n var minutes = Number(results[2]);\n var seconds = Number(results[3]);\n var miliseconds = Number(results[4]);\n if (minutes > 59 || seconds > 59)\n return null;\n\n return (miliseconds / 1000) + seconds + (minutes * 60) + (hours * 3600);\n};\n\n\n/**\n * @const {number}\n * @private\n */\nshaka.media.VttTextParser.MPEG_TIMESCALE_ = 90000;\n\nshaka.media.TextEngine.registerParser(\n 'text/vtt',\n shaka.media.VttTextParser);\n\nshaka.media.TextEngine.registerParser(\n 'text/vtt; codecs=\"vtt\"',\n shaka.media.VttTextParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/vtt_text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Mp4VttParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.media.VttTextParser');\ngoog.require('shaka.util.DataViewReader');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Mp4Parser');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.TextParser');\n\n\n\n/**\n * @struct\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.Mp4VttParser = function() {\n /**\n * The current time scale used by the VTT parser.\n *\n * @type {?number}\n * @private\n */\n this.timescale_ = null;\n};\n\n\n/** @override */\nshaka.media.Mp4VttParser.prototype.parseInit = function(data) {\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var sawWVTT = false;\n\n new Mp4Parser()\n .box('moov', Mp4Parser.children)\n .box('trak', Mp4Parser.children)\n .box('mdia', Mp4Parser.children)\n .fullBox('mdhd', function(box) {\n goog.asserts.assert(\n box.version == 0 || box.version == 1,\n 'MDHD version can only be 0 or 1');\n if (box.version == 0) {\n box.reader.skip(4); // skip \"creation_time\"\n box.reader.skip(4); // skip \"modification_time\"\n this.timescale_ = box.reader.readUint32();\n box.reader.skip(4); // skip \"duration\"\n } else {\n box.reader.skip(8); // skip \"creation_time\"\n box.reader.skip(8); // skip \"modification_time\"\n this.timescale_ = box.reader.readUint32();\n box.reader.skip(8); // skip \"duration\"\n }\n box.reader.skip(4); // skip \"pad\", \"language\", and \"pre-defined\"\n }.bind(this))\n .box('minf', Mp4Parser.children)\n .box('stbl', Mp4Parser.children)\n .fullBox('stsd', Mp4Parser.sampleDescription)\n .box('wvtt', function(box) {\n // A valid vtt init segment, no actual subtitles yet\n sawWVTT = true;\n }).parse(data);\n\n if (!this.timescale_) {\n // Missing timescale for VTT content. Should be located in the MDHD\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_VTT);\n }\n\n if (!sawWVTT) {\n // A WVTT box should have been seen (a valid vtt init segment with no\n // actual subtitles).\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_VTT);\n }\n};\n\n\n/** @override */\nshaka.media.Mp4VttParser.prototype.parseMedia = function(data, time) {\n var Mp4VttParser = shaka.media.Mp4VttParser;\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var baseTime = 0;\n var presentations = [];\n var payloads = [];\n var cues = [];\n\n var sawTFDT = false;\n var sawTRUN = false;\n var sawMDAT = false;\n\n new Mp4Parser()\n .box('moof', Mp4Parser.children)\n .box('traf', Mp4Parser.children)\n .fullBox('tfdt', function(box) {\n sawTFDT = true;\n goog.asserts.assert(\n box.version == 0 || box.version == 1,\n 'TFDT version can only be 0 or 1');\n baseTime = (box.version == 0) ?\n box.reader.readUint32() :\n box.reader.readUint64();\n })\n .fullBox('trun', function(box) {\n sawTRUN = true;\n goog.asserts.assert(\n box.version != null,\n 'A TRUN box should have a valid version value');\n goog.asserts.assert(\n box.flags != null,\n 'A TRUN box should have a valid flags value');\n presentations = Mp4VttParser.parseTRUN_(\n box.version, box.flags, box.reader);\n })\n .box('vtte', function(box) {\n // VTTE are empty cues, so there is no need to do any more than insert\n // a place-holder. We must add something or else the ordering between\n // the payloads and presentation times would fall out of order.\n payloads.push(null);\n })\n .box('vttc', Mp4Parser.allData(function(data) {\n payloads.push(data.buffer);\n }))\n .box('mdat', function(box) {\n sawMDAT = true;\n Mp4Parser.children(box);\n }).parse(data);\n\n if (!sawMDAT && !sawTFDT && !sawTRUN) {\n // A required box is missing\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_VTT);\n }\n\n goog.asserts.assert(\n presentations.length == payloads.length,\n 'The number of presentations should equal the number of payloads');\n\n var currentTime = baseTime;\n\n for (var i = 0; i < presentations.length; i++) {\n var presentation = presentations[i];\n var payload = payloads[i];\n\n if (presentation.duration) {\n var startTime = presentation.timeOffset ?\n baseTime + presentation.timeOffset :\n currentTime;\n\n currentTime = startTime + presentation.duration;\n\n // The payload can be null as that would mean that it was a VTTE and\n // was only inserted to keep the presentation times in sync with the\n // payloads.\n if (payload) {\n cues.push(shaka.media.Mp4VttParser.parseVTTC_(\n payload,\n time.periodStart + startTime / this.timescale_,\n time.periodStart + currentTime / this.timescale_));\n }\n }\n }\n\n return cues;\n};\n\n\n/**\n * @typedef {{\n * duration: ?number,\n * timeOffset: ?number\n * }}\n *\n * @property {?number} duration\n * The length of the segment in timescale units.\n * @property {?number} timeOffset\n * The time since the start of the segment in timescale units. Time\n * offset is based of the start of the segment. If this value is\n * missing, the accumated durations preceeding this time segment will\n * be used to create the start time.\n */\nshaka.media.Mp4VttParser.TimeSegment;\n\n\n/**\n * @param {number} version\n * @param {number} flags\n * @param {!shaka.util.DataViewReader} reader\n * @return {!Array.<shaka.media.Mp4VttParser.TimeSegment>}\n * @private\n */\nshaka.media.Mp4VttParser.parseTRUN_ = function(version, flags, reader) {\n var sampleCount = reader.readUint32();\n\n // skip \"data_offset\" if present\n if (flags & 0x000001) { reader.skip(4); }\n\n // skip \"first_sample_flags\" if present\n if (flags & 0x000004) { reader.skip(4); }\n\n var samples = [];\n\n for (var sampleIndex = 0; sampleIndex < sampleCount; sampleIndex++) {\n\n /** @type {shaka.media.Mp4VttParser.TimeSegment} */\n var sample = {\n duration: null,\n timeOffset: null\n };\n\n // read \"sample duration\" if present\n if (flags & 0x000100) { sample.duration = reader.readUint32(); }\n\n // skip \"sample_size\" if present\n if (flags & 0x000200) { reader.skip(4); }\n\n // skip \"sample_flags\" if present\n if (flags & 0x000400) {reader.skip(4); }\n\n // read \"sample_time_offset\" if present\n if (flags & 0x000800) {\n sample.timeOffset = version == 0 ?\n reader.readUint32() :\n reader.readInt32();\n }\n\n samples.push(sample);\n }\n\n return samples;\n};\n\n\n/**\n * Parses a vttc box into a cue.\n *\n * @param {!ArrayBuffer} data\n * @param {number} startTime\n * @param {number} endTime\n * @return {TextTrackCue}\n * @private\n */\nshaka.media.Mp4VttParser.parseVTTC_ = function(data, startTime, endTime) {\n var payload;\n var id;\n var settings;\n\n new shaka.util.Mp4Parser()\n .box('payl', shaka.util.Mp4Parser.allData(function(data) {\n payload = shaka.util.StringUtils.fromUTF8(data);\n }))\n .box('iden', shaka.util.Mp4Parser.allData(function(data) {\n id = shaka.util.StringUtils.fromUTF8(data);\n }))\n .box('sttg', shaka.util.Mp4Parser.allData(function(data) {\n settings = shaka.util.StringUtils.fromUTF8(data);\n }))\n .parse(data);\n\n if (payload) {\n return shaka.media.Mp4VttParser.assembleCue_(payload,\n id,\n settings,\n startTime,\n endTime);\n } else {\n return null;\n }\n};\n\n\n/**\n * Take the individual components that make a cue and create a vttc cue.\n *\n * @param {string} payload\n * @param {?string} id\n * @param {?string} settings\n * @param {number} startTime\n * @param {number} endTime\n * @return {TextTrackCue}\n * @private\n */\nshaka.media.Mp4VttParser.assembleCue_ = function(payload,\n id,\n settings,\n startTime,\n endTime) {\n var cue = shaka.media.TextEngine.makeCue(\n startTime,\n endTime,\n payload);\n\n if (cue && id) {\n cue.id = id;\n }\n\n if (cue && settings) {\n var parser = new shaka.util.TextParser(settings);\n\n var word = parser.readWord();\n\n while (word) {\n\n if (!shaka.media.VttTextParser.parseSetting(cue, word)) {\n shaka.log.warning('VTT parser encountered an invalid VTT setting: ',\n word,\n ' The setting will be ignored.');\n }\n\n parser.skipWhitespace();\n word = parser.readWord();\n }\n }\n\n return cue;\n};\n\n\nshaka.media.TextEngine.registerParser(\n 'application/mp4; codecs=\"wvtt\"',\n shaka.media.Mp4VttParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/mp4_vtt_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Playhead');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TimeRangesUtils');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * Creates a Playhead, which manages the video's current time.\n *\n * The Playhead provides mechanisms for setting the presentation's start time,\n * restricting seeking to valid time ranges, and stopping playback for startup\n * and re- buffering.\n *\n * @param {HTMLMediaElement} video\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.StreamingConfiguration} config\n * @param {?number} startTime The playhead's initial position in seconds. If\n * null, defaults to the start of the presentation for VOD and the live-edge\n * for live.\n * @param {function()} onSeek Called when the user agent seeks to a time within\n * the presentation timeline.\n * @param {function(!Event)} onEvent Called when an event is raised to be sent\n * to the application.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.Playhead = function(\n video, manifest, config, startTime, onSeek, onEvent) {\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = manifest;\n\n /** @private {?shakaExtern.StreamingConfiguration} */\n this.config_ = config;\n\n /**\n * The playhead's initial position in seconds, or null if it should\n * automatically be calculated later.\n * @private {?number}\n */\n this.startTime_ = startTime;\n\n /** @private {?function()} */\n this.onSeek_ = onSeek;\n\n /** @private {?function(!Event)} */\n this.onEvent_ = onEvent;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {boolean} */\n this.buffering_ = false;\n\n /** @private {number} */\n this.playbackRate_ = 1;\n\n /** @private {?number} */\n this.trickPlayIntervalId_ = null;\n\n /** @private {?number} */\n this.gapJumpIntervalId_ = null;\n\n /** @private {number} */\n this.prevReadyState_ = video.readyState;\n\n /** @private {boolean} */\n this.didFireLargeGap_ = false;\n\n /**\n * The wall-clock time (in milliseconds) that the stall occurred. This is\n * used to ensure we don't flush the pipeline too often.\n * @private {number}\n */\n this.stallWallTime_ = -1;\n\n /**\n * The playhead time where we think a stall occurred. When the ready state\n * says we don't have enough data and the playhead stops too long, we assume\n * we have stalled.\n * @private {number}\n */\n this.stallPlayheadTime_ = -1;\n\n /** @private {boolean} */\n this.hadSegmentAppended_ = false;\n\n\n // Check if the video has already loaded some metadata.\n if (video.readyState > 0) {\n this.onLoadedMetadata_();\n } else {\n this.eventManager_.listenOnce(\n video, 'loadedmetadata', this.onLoadedMetadata_.bind(this));\n }\n\n var pollGap = this.onPollGapJump_.bind(this);\n this.eventManager_.listen(video, 'ratechange', this.onRateChange_.bind(this));\n this.eventManager_.listen(video, 'waiting', pollGap);\n\n // We can't trust readyState or 'waiting' events on all platforms. So poll\n // the current time and if we are in a gap, jump it.\n // See: https://goo.gl/sbSHp9 and https://goo.gl/cuAcYd\n this.gapJumpIntervalId_ = setInterval(pollGap, 250);\n};\n\n\n/** @override */\nshaka.media.Playhead.prototype.destroy = function() {\n var p = this.eventManager_.destroy();\n this.eventManager_ = null;\n\n if (this.trickPlayIntervalId_ != null) {\n window.clearInterval(this.trickPlayIntervalId_);\n this.trickPlayIntervalId_ = null;\n }\n\n if (this.gapJumpIntervalId_ != null) {\n window.clearInterval(this.gapJumpIntervalId_);\n this.gapJumpIntervalId_ = null;\n }\n\n this.video_ = null;\n this.manifest_ = null;\n this.config_ = null;\n this.onSeek_ = null;\n this.onEvent_ = null;\n\n return p;\n};\n\n\n/** @param {number} startTime */\nshaka.media.Playhead.prototype.setStartTime = function(startTime) {\n if (this.video_.readyState > 0)\n this.video_.currentTime = this.clampTime_(startTime);\n else\n this.startTime_ = startTime;\n};\n\n\n/**\n * Gets the playhead's current (logical) position.\n *\n * @return {number}\n */\nshaka.media.Playhead.prototype.getTime = function() {\n if (this.video_.readyState > 0) {\n // Although we restrict the video's currentTime elsewhere, clamp it here to\n // ensure any timing issues (e.g., the user agent seeks and calls this\n // function before we receive the 'seeking' event) don't cause us to return\n // a time outside the segment availability window.\n return this.clampTime_(this.video_.currentTime);\n }\n\n return this.getStartTime_();\n};\n\n\n/**\n * Gets the playhead's initial position in seconds.\n *\n * @return {number}\n * @private\n */\nshaka.media.Playhead.prototype.getStartTime_ = function() {\n if (this.startTime_) {\n return this.clampTime_(this.startTime_);\n }\n\n var startTime;\n var timeline = this.manifest_.presentationTimeline;\n if (timeline.getDuration() < Infinity) {\n // If the presentation is VOD, or if the presentation is live but has\n // finished broadcasting, then start from the beginning.\n startTime = timeline.getSegmentAvailabilityStart();\n } else {\n // Otherwise, start near the live-edge.\n startTime = timeline.getSeekRangeEnd();\n }\n return startTime;\n};\n\n\n/**\n * Stops the playhead for buffering, or resumes the playhead after buffering.\n *\n * @param {boolean} buffering True to stop the playhead; false to allow it to\n * continue.\n */\nshaka.media.Playhead.prototype.setBuffering = function(buffering) {\n if (buffering != this.buffering_) {\n this.buffering_ = buffering;\n this.setPlaybackRate(this.playbackRate_);\n }\n};\n\n\n/**\n * Gets the current effective playback rate. This may be negative even if the\n * browser does not directly support rewinding.\n * @return {number}\n */\nshaka.media.Playhead.prototype.getPlaybackRate = function() {\n return this.playbackRate_;\n};\n\n\n/**\n * Sets the playback rate.\n * @param {number} rate\n */\nshaka.media.Playhead.prototype.setPlaybackRate = function(rate) {\n if (this.trickPlayIntervalId_ != null) {\n window.clearInterval(this.trickPlayIntervalId_);\n this.trickPlayIntervalId_ = null;\n }\n\n this.playbackRate_ = rate;\n // All major browsers support playback rates above zero. Only need fake\n // trick play for negative rates.\n this.video_.playbackRate = (this.buffering_ || rate < 0) ? 0 : rate;\n\n if (!this.buffering_ && rate < 0) {\n // Defer creating the timer until we stop buffering. This function will be\n // called again from setBuffering().\n this.trickPlayIntervalId_ = window.setInterval(function() {\n this.video_.currentTime += rate / 4;\n }.bind(this), 250);\n }\n};\n\n\n/**\n * Called when a segment is appended by StreamingEngine, but not when a clear is\n * pending. This means StreamingEngine will continue buffering forward from\n * what is buffered. So we know about any gaps before the start.\n */\nshaka.media.Playhead.prototype.onSegmentAppended = function() {\n this.hadSegmentAppended_ = true;\n this.onPollGapJump_();\n};\n\n\n/**\n * Handles a 'ratechange' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onRateChange_ = function() {\n // NOTE: This will not allow explicitly setting the playback rate to 0 while\n // the playback rate is negative. Pause will still work.\n var expectedRate =\n this.buffering_ || this.playbackRate_ < 0 ? 0 : this.playbackRate_;\n if (this.video_.playbackRate != expectedRate) {\n shaka.log.debug('Video playback rate changed to', this.video_.playbackRate);\n this.setPlaybackRate(this.video_.playbackRate);\n }\n};\n\n\n/**\n * Handles a 'loadedmetadata' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onLoadedMetadata_ = function() {\n // Move the real playhead to the start time.\n var targetTime = this.getStartTime_();\n if (Math.abs(this.video_.currentTime - targetTime) < 0.001) {\n this.eventManager_.listen(\n this.video_, 'seeking', this.onSeeking_.bind(this));\n this.eventManager_.listen(\n this.video_, 'playing', this.onPlaying_.bind(this));\n } else {\n this.eventManager_.listenOnce(\n this.video_, 'seeking', this.onSeekingToStartTime_.bind(this));\n this.video_.currentTime = targetTime;\n }\n};\n\n\n/**\n * Handles the 'seeking' event from the initial jump to the start time (if\n * there is one).\n *\n * @private\n */\nshaka.media.Playhead.prototype.onSeekingToStartTime_ = function() {\n goog.asserts.assert(this.video_.readyState > 0,\n 'readyState should be greater than 0');\n this.eventManager_.listen(this.video_, 'seeking', this.onSeeking_.bind(this));\n this.eventManager_.listen(this.video_, 'playing', this.onPlaying_.bind(this));\n};\n\n\n/**\n * Called on a recurring timer to check for gaps in the media. This is also\n * called in a 'waiting' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onPollGapJump_ = function() {\n if (this.video_.readyState == 0)\n return;\n\n // When the ready state changes, we have moved on, so we should fire the large\n // gap event if we see one.\n if (this.video_.readyState != this.prevReadyState_) {\n this.didFireLargeGap_ = false;\n this.prevReadyState_ = this.video_.readyState;\n }\n\n var smallGapLimit = this.config_.smallGapLimit;\n var currentTime = this.video_.currentTime;\n var buffered = this.video_.buffered;\n\n var gapIndex = shaka.media.TimeRangesUtils.getGapIndex(buffered, currentTime);\n\n // The current time is unbuffered or is too far from a gap.\n if (gapIndex == null) {\n if (this.video_.readyState < 3 && this.video_.playbackRate > 0) {\n // Some platforms/browsers can get stuck in the middle of a buffered range\n // (e.g. when seeking in a background tab). Flush the media pipeline to\n // help.\n //\n // Flush once we have stopped for more than 1 second inside a buffered\n // range. Note that Chromecast takes a few seconds to start playing\n // after any kind of seek, so wait 5 seconds between repeated flushes.\n if (this.stallPlayheadTime_ != currentTime) {\n this.stallPlayheadTime_ = currentTime;\n this.stallWallTime_ = Date.now();\n } else if (this.stallWallTime_ < Date.now() - 1000) {\n // Make the stall appear in the future so we don't flush for 5 seconds.\n this.stallWallTime_ = Date.now() + 5000;\n\n for (var i = 0; i < buffered.length; i++) {\n // Ignore the end of the buffered range since it may not play anymore\n // on all platforms.\n if (currentTime >= buffered.start(i) &&\n currentTime < buffered.end(i) - 0.5) {\n shaka.log.debug(\n 'Flushing media pipeline due to stall inside buffered range');\n this.video_.currentTime = this.video_.currentTime;\n break;\n }\n }\n }\n }\n return;\n }\n // If we are before the first buffered range, this could be an unbuffered\n // seek. So wait until a segment is appended so we are sure it is a gap.\n if (gapIndex == 0 && !this.hadSegmentAppended_)\n return;\n\n // StreamingEngine can buffer past the seek end, but still don't allow seeking\n // past it.\n var jumpTo = buffered.start(gapIndex);\n var seekEnd = this.manifest_.presentationTimeline.getSeekRangeEnd();\n if (jumpTo >= seekEnd)\n return;\n\n var jumpSize = jumpTo - currentTime;\n var isGapSmall = jumpSize <= smallGapLimit;\n var jumpLargeGap = false;\n\n if (!isGapSmall && !this.didFireLargeGap_) {\n this.didFireLargeGap_ = true;\n\n // Event firing is synchronous.\n var event = new shaka.util.FakeEvent(\n 'largegap', {'currentTime': currentTime, 'gapSize': jumpSize});\n event.cancelable = true;\n this.onEvent_(event);\n\n if (this.config_.jumpLargeGaps && !event.defaultPrevented)\n jumpLargeGap = true;\n else\n shaka.log.info('Ignoring large gap at', currentTime);\n }\n\n if (isGapSmall || jumpLargeGap) {\n if (gapIndex == 0) {\n shaka.log.info(\n 'Jumping forward', jumpSize,\n 'seconds because of gap before start time of', jumpTo);\n } else {\n shaka.log.info(\n 'Jumping forward', jumpSize, 'seconds because of gap starting at',\n buffered.end(gapIndex - 1), 'and ending at', jumpTo);\n }\n\n this.movePlayhead_(currentTime, jumpTo);\n }\n};\n\n\n/**\n * Handles a 'seeking' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onSeeking_ = function() {\n goog.asserts.assert(this.video_.readyState > 0,\n 'readyState should be greater than 0');\n\n this.hadSegmentAppended_ = false;\n var currentTime = this.video_.currentTime;\n var targetTime = this.reposition_(currentTime);\n\n if (Math.abs(targetTime - currentTime) > 0.001) {\n this.movePlayhead_(currentTime, targetTime);\n return;\n }\n\n shaka.log.v1('Seek to ' + currentTime);\n this.didFireLargeGap_ = false;\n this.onSeek_();\n};\n\n\n/**\n * Handles a 'playing' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onPlaying_ = function() {\n goog.asserts.assert(this.video_.readyState > 0,\n 'readyState should be greater than 0');\n\n var currentTime = this.video_.currentTime;\n var targetTime = this.reposition_(currentTime);\n\n if (Math.abs(targetTime - currentTime) > 0.001)\n this.movePlayhead_(currentTime, targetTime);\n};\n\n\n/**\n * Computes a new playhead position that's within the presentation timeline.\n *\n * @param {number} currentTime\n * @return {number} The time to reposition the playhead to.\n * @private\n */\nshaka.media.Playhead.prototype.reposition_ = function(currentTime) {\n goog.asserts.assert(this.manifest_ && this.config_, 'Must not be destroyed');\n\n /** @type {function(number)} */\n var isBuffered =\n shaka.media.TimeRangesUtils.isBuffered.bind(null, this.video_.buffered);\n\n var rebufferingGoal = shaka.util.StreamUtils.getRebufferingGoal(\n this.manifest_, this.config_, 1 /* scaleFactor */);\n\n var timeline = this.manifest_.presentationTimeline;\n var start = timeline.getSafeAvailabilityStart(0);\n var end = timeline.getSegmentAvailabilityEnd();\n\n // With live content, the beginning of the availability window is moving\n // forward. This means we cannot seek to it since we will \"fall\" outside the\n // window while we buffer. So we define a \"safe\" region that is far enough\n // away. For VOD, |safe == start|.\n var safe = timeline.getSafeAvailabilityStart(rebufferingGoal);\n\n // These are the times to seek to rather than the exact destinations. When\n // we seek, we will get another event (after a slight delay) and these steps\n // will run again. So if we seeked directly to |start|, |start| would move\n // on the next call and we would loop forever.\n //\n // Offset by 5 seconds since Chromecast takes a few seconds to start playing\n // after a seek, even when buffered.\n var seekStart = timeline.getSafeAvailabilityStart(5);\n var seekSafe = timeline.getSafeAvailabilityStart(rebufferingGoal + 5);\n\n\n if (currentTime > end) {\n shaka.log.v1('Playhead past end.');\n return end;\n }\n\n if (currentTime < start) {\n if (isBuffered(seekStart)) {\n shaka.log.v1('Playhead before start & start is buffered');\n return seekStart;\n } else {\n shaka.log.v1('Playhead before start & start is unbuffered');\n return seekSafe;\n }\n }\n\n if (currentTime >= safe || isBuffered(currentTime)) {\n shaka.log.v1('Playhead in safe region or in buffered region.');\n return currentTime;\n } else {\n shaka.log.v1('Playhead outside safe region & in unbuffered region.');\n return seekSafe;\n }\n};\n\n\n/**\n * Moves the playhead to the target time, triggering a call to onSeeking_().\n *\n * @param {number} currentTime\n * @param {number} targetTime\n * @private\n */\nshaka.media.Playhead.prototype.movePlayhead_ = function(\n currentTime, targetTime) {\n shaka.log.debug('Moving playhead...',\n 'currentTime=' + currentTime,\n 'targetTime=' + targetTime);\n this.video_.currentTime = targetTime;\n\n // Sometimes, IE and Edge ignore re-seeks. Check every 100ms and try\n // again if need be, up to 10 tries.\n // Delay stats over 100 runs of a re-seeking integration test:\n // IE - 0ms - 47%\n // IE - 100ms - 63%\n // Edge - 0ms - 2%\n // Edge - 100ms - 40%\n // Edge - 200ms - 32%\n // Edge - 300ms - 24%\n // Edge - 400ms - 2%\n // Chrome - 0ms - 100%\n // TODO: File a bug on IE/Edge about this.\n var tries = 0;\n var recheck = (function() {\n if (!this.video_) return;\n if (tries++ >= 10) return;\n\n if (this.video_.currentTime == currentTime) {\n // Sigh. Try again.\n this.video_.currentTime = targetTime;\n setTimeout(recheck, 100);\n }\n }).bind(this);\n setTimeout(recheck, 100);\n};\n\n\n/**\n * Clamps the given time to the segment availability window.\n *\n * @param {number} time The time in seconds.\n * @return {number} The clamped time in seconds.\n * @private\n */\nshaka.media.Playhead.prototype.clampTime_ = function(time) {\n var start = this.manifest_.presentationTimeline.getSegmentAvailabilityStart();\n if (time < start) return start;\n\n var end = this.manifest_.presentationTimeline.getSegmentAvailabilityEnd();\n if (time > end) return end;\n\n return time;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/playhead.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.PlayheadObserver');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.media.TimeRangesUtils');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * This observes the current playhead position to raise events. This will only\n * observe the playhead, {@link shaka.media.Playhead} will modify it. This will:\n * <ul>\n * <li>Track buffering state and call |onBuffering|.</li>\n * <li>Track current Period and call |onChangePeriod|.</li>\n * <li>Track timeline regions and raise respective events.</li>\n * </ul>\n *\n * @param {HTMLMediaElement} video\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.StreamingConfiguration} config\n * @param {function(boolean)} onBuffering Called and passed true when stopped\n * for buffering; called and passed false when proceeding after buffering.\n * If passed true, the callback should not set the video's playback rate.\n * @param {function(!Event)} onEvent Called when an event is raised to be sent\n * to the application.\n * @param {function()} onChangePeriod Called when the playhead moves to a\n * different Period.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.PlayheadObserver = function(\n video, manifest, config, onBuffering, onEvent, onChangePeriod) {\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = manifest;\n\n /** @private {?shakaExtern.StreamingConfiguration} */\n this.config_ = config;\n\n /** @private {?function(boolean)} */\n this.onBuffering_ = onBuffering;\n\n /** @private {?function(!Event)} */\n this.onEvent_ = onEvent;\n\n /** @private {?function()} */\n this.onChangePeriod_ = onChangePeriod;\n\n /** @private {!Array.<shaka.media.PlayheadObserver.TimelineRegion>} */\n this.timelineRegions_ = [];\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {boolean} */\n this.buffering_ = false;\n\n /** @private {number} */\n this.curPeriodIndex_ = -1;\n\n /** @private {?number} */\n this.watchdogTimer_ = null;\n\n\n this.startWatchdogTimer_();\n};\n\n\n/**\n * The threshold for underflow, in seconds. If there is less than this amount\n * of data buffered, we will consider the player to be out of data.\n *\n * @private {number}\n * @const\n */\nshaka.media.PlayheadObserver.UNDERFLOW_THRESHOLD_ = 0.5;\n\n\n/**\n * A fudge factor used when comparing buffered ranges to the duration to\n * determine if we have buffered all available content.\n *\n * @private {number}\n * @const\n */\nshaka.media.PlayheadObserver.FUDGE_FACTOR_ = 0.1;\n\n\n/**\n * @enum {number}\n * @private\n */\nshaka.media.PlayheadObserver.RegionLocation_ = {\n FUTURE_REGION: 1,\n INSIDE: 2,\n PAST_REGION: 3\n};\n\n\n/**\n * @typedef {{\n * info: shakaExtern.TimelineRegionInfo,\n * status: shaka.media.PlayheadObserver.RegionLocation_\n * }}\n *\n * @property {shakaExtern.TimelineRegionInfo} info\n * The info for this timeline region.\n * @property {shaka.media.PlayheadObserver.RegionLocation_} status\n * This tracks where the region is relative to the playhead. This tracks\n * whether we are before or after the region so we can raise events if we pass\n * it.\n */\nshaka.media.PlayheadObserver.TimelineRegion;\n\n\n/** @override */\nshaka.media.PlayheadObserver.prototype.destroy = function() {\n var p = this.eventManager_ ? this.eventManager_.destroy() : Promise.resolve();\n\n this.eventManager_ = null;\n this.cancelWatchdogTimer_();\n\n this.video_ = null;\n this.manifest_ = null;\n this.config_ = null;\n this.onBuffering_ = null;\n this.onEvent_ = null;\n this.onChangePeriod_ = null;\n this.timelineRegions_ = [];\n\n return p;\n};\n\n\n/** Called when a seek completes. */\nshaka.media.PlayheadObserver.prototype.seeked = function() {\n this.timelineRegions_.forEach(\n this.updateTimelineRegion_.bind(this, /* isSeek */ true));\n};\n\n\n/**\n * Adds a new timeline region. Events will be raised whenever the playhead\n * enters or exits the given region. This method will raise a\n * 'timelineregionadded' event.\n * @param {shakaExtern.TimelineRegionInfo} regionInfo\n */\nshaka.media.PlayheadObserver.prototype.addTimelineRegion = function(\n regionInfo) {\n // Check there isn't an existing event with the same scheme ID and time range.\n // This ensures that the manifest parser doesn't need to also track which\n // events have already been added.\n var hasExistingRegion = this.timelineRegions_.some(function(existing) {\n return existing.info.schemeIdUri == regionInfo.schemeIdUri &&\n existing.info.startTime == regionInfo.startTime &&\n existing.info.endTime == regionInfo.endTime;\n });\n if (hasExistingRegion) return;\n\n var region = {\n info: regionInfo,\n status: shaka.media.PlayheadObserver.RegionLocation_.FUTURE_REGION\n };\n this.timelineRegions_.push(region);\n\n var cloneTimelineInfo_ = shaka.media.PlayheadObserver.cloneTimelineInfo_;\n var event = new shaka.util.FakeEvent(\n 'timelineregionadded', {detail: cloneTimelineInfo_(regionInfo)});\n this.onEvent_(event);\n\n // Pretend this is a seek so it will ignore if it should be PAST_REGION but\n // still fire an event if it should be INSIDE.\n this.updateTimelineRegion_(/* isSeek */ true, region);\n};\n\n\n/**\n * Clones the given TimelineRegionInfo so the app can modify it without\n * modifying our internal objects.\n * @param {shakaExtern.TimelineRegionInfo} source\n * @return {shakaExtern.TimelineRegionInfo}\n * @private\n */\nshaka.media.PlayheadObserver.cloneTimelineInfo_ = function(source) {\n var copy = shaka.util.ConfigUtils.cloneObject(source);\n // cloneObject uses JSON to clone, which won't copy the DOM element.\n copy.eventElement = source.eventElement;\n return copy;\n};\n\n\n/**\n * Updates the status of a timeline region and fires any enter/exit events.\n * @param {boolean} isSeek\n * @param {shaka.media.PlayheadObserver.TimelineRegion} region\n * @private\n */\nshaka.media.PlayheadObserver.prototype.updateTimelineRegion_ = function(\n isSeek, region) {\n var RegionLocation = shaka.media.PlayheadObserver.RegionLocation_;\n var cloneTimelineInfo_ = shaka.media.PlayheadObserver.cloneTimelineInfo_;\n\n // The events are fired when the playhead enters a region. We fire both\n // events when passing over a region and not seeking since the playhead was\n // in the region but left before we saw it. We don't fire both when seeking\n // since the playhead was never in the region.\n //\n // |--------------------------------------|\n // | From \\ To | FUTURE | INSIDE | PAST |\n // | FUTURE | | enter | both* |\n // | INSIDE | exit | | exit |\n // | PAST | both* | enter | |\n // |--------------------------------------|\n // * Only when not seeking.\n var newStatus = region.info.startTime > this.video_.currentTime ?\n RegionLocation.FUTURE_REGION :\n (region.info.endTime < this.video_.currentTime ?\n RegionLocation.PAST_REGION :\n RegionLocation.INSIDE);\n var wasInside = region.status == RegionLocation.INSIDE;\n var isInside = newStatus == RegionLocation.INSIDE;\n\n if (newStatus != region.status) {\n var passedRegion = !wasInside && !isInside;\n if (!(isSeek && passedRegion)) {\n if (!wasInside) {\n this.onEvent_(new shaka.util.FakeEvent(\n 'timelineregionenter',\n {'detail': cloneTimelineInfo_(region.info)}));\n }\n if (!isInside) {\n this.onEvent_(new shaka.util.FakeEvent(\n 'timelineregionexit', {'detail': cloneTimelineInfo_(region.info)}));\n }\n }\n region.status = newStatus;\n }\n};\n\n\n/**\n * Starts the watchdog timer.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.startWatchdogTimer_ = function() {\n this.cancelWatchdogTimer_();\n this.watchdogTimer_ =\n window.setTimeout(this.onWatchdogTimer_.bind(this), 250);\n};\n\n\n/**\n * Cancels the watchdog timer, if any.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.cancelWatchdogTimer_ = function() {\n if (this.watchdogTimer_) {\n window.clearTimeout(this.watchdogTimer_);\n this.watchdogTimer_ = null;\n }\n};\n\n\n/**\n * Called on a recurring timer to detect buffering events and Period changes.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.onWatchdogTimer_ = function() {\n this.watchdogTimer_ = null;\n this.startWatchdogTimer_();\n\n goog.asserts.assert(this.manifest_ && this.config_, 'Must not be destroyed');\n var newPeriod = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.video_.currentTime);\n if (newPeriod != this.curPeriodIndex_) {\n // Ignore seek to start time, the first 'trackschanged' event is handled\n // during player.load().\n if (this.curPeriodIndex_ != -1)\n this.onChangePeriod_();\n this.curPeriodIndex_ = newPeriod;\n }\n\n // This uses an intersection of buffered ranges for both audio and video, so\n // it's an accurate way to determine if we are buffering or not.\n var bufferedAhead = shaka.media.TimeRangesUtils.bufferedAheadOf(\n this.video_.buffered, this.video_.currentTime);\n var bufferEnd = shaka.media.TimeRangesUtils.bufferEnd(this.video_.buffered);\n\n var fudgeFactor = shaka.media.PlayheadObserver.FUDGE_FACTOR_;\n var threshold = shaka.media.PlayheadObserver.UNDERFLOW_THRESHOLD_;\n\n var timeline = this.manifest_.presentationTimeline;\n var duration = timeline.getSegmentAvailabilityEnd() - fudgeFactor;\n\n var atEnd = (bufferEnd >= duration) || (this.video_.ended);\n if (!this.buffering_) {\n // If there are no buffered ranges but the playhead is at the end of\n // the video then we shouldn't enter a buffering state.\n if (!atEnd && bufferedAhead < threshold) {\n this.setBuffering_(true);\n }\n } else {\n var rebufferingGoal = shaka.util.StreamUtils.getRebufferingGoal(\n this.manifest_, this.config_, 1 /* scaleFactor */);\n if (atEnd || bufferedAhead >= rebufferingGoal) {\n this.setBuffering_(false);\n }\n }\n\n this.timelineRegions_.forEach(\n this.updateTimelineRegion_.bind(this, /* isSeek */ false));\n};\n\n\n/**\n * Stops the playhead for buffering, or resumes the playhead after buffering.\n *\n * @param {boolean} buffering True to stop the playhead; false to allow it to\n * continue.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.setBuffering_ = function(buffering) {\n if (buffering != this.buffering_) {\n this.buffering_ = buffering;\n this.onBuffering_(buffering);\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/playhead_observer.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.StreamingEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.MediaSourceEngine');\ngoog.require('shaka.media.Playhead');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.Mp4Parser');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * Creates a StreamingEngine.\n *\n * The StreamingEngine is responsible for setting up the Manifest's Streams\n * (i.e., for calling each Stream's createSegmentIndex() function), for\n * downloading segments, for co-ordinating audio, video, and text buffering,\n * and for handling Period transitions. The StreamingEngine provides an\n * interface to switch between Streams, but it does not choose which Streams to\n * switch to.\n *\n * The StreamingEngine notifies its owner when it needs to buffer a new Period,\n * so its owner can choose which Streams within that Period to initially\n * buffer. Moreover, the StreamingEngine also notifies its owner when any\n * Stream within the current Period may be switched to, so its owner can switch\n * bitrates, resolutions, or languages.\n *\n * The StreamingEngine does not need to be notified about changes to the\n * Manifest's SegmentIndexes; however, it does need to be notified when new\n * Periods are added to the Manifest, so it can set up that Period's Streams.\n *\n * To start the StreamingEngine the owner must first call configure() followed\n * by init(). The StreamingEngine will then call onChooseStreams(p) when it\n * needs to buffer Period p; it will then switch to the Streams returned from\n * that function. The StreamingEngine will call onCanSwitch() when any\n * Stream within the current Period may be switched to.\n *\n * The owner must call seeked() each time the playhead moves to a new location\n * within the presentation timeline; however, the owner may forego calling\n * seeked() when the playhead moves outside the presentation timeline.\n *\n * @param {shakaExtern.Manifest} manifest\n * @param {shaka.media.StreamingEngine.PlayerInterface} playerInterface\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.StreamingEngine = function(manifest, playerInterface) {\n /** @private {?shaka.media.StreamingEngine.PlayerInterface} */\n this.playerInterface_ = playerInterface;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = manifest;\n\n /** @private {?shakaExtern.StreamingConfiguration} */\n this.config_ = null;\n\n /** @private {number} */\n this.bufferingGoalScale_ = 1;\n\n /** @private {Promise} */\n this.setupPeriodPromise_ = Promise.resolve();\n\n /**\n * Maps a Period's index to an object that indicates that either\n * 1. the Period has not been set up (undefined)\n * 2. the Period is being set up ([a PublicPromise, false]),\n * 3. the Period is set up (i.e., all Streams within the Period are set up)\n * and can be switched to ([a PublicPromise, true]).\n *\n * @private {Array.<?{promise: shaka.util.PublicPromise, resolved: boolean}>}\n */\n this.canSwitchPeriod_ = [];\n\n /**\n * Maps a Stream's ID to an object that indicates that either\n * 1. the Stream has not been set up (undefined)\n * 2. the Stream is being set up ([a Promise instance, false]),\n * 3. the Stream is set up and can be switched to\n * ([a Promise instance, true]).\n *\n * @private {Object.<number,\n * ?{promise: shaka.util.PublicPromise, resolved: boolean}>}\n */\n this.canSwitchStream_ = {};\n\n /**\n * Maps a content type, e.g., 'audio', 'video', or 'text', to a MediaState.\n *\n * @private {Object.<shaka.util.ManifestParserUtils.ContentType,\n !shaka.media.StreamingEngine.MediaState_>}\n */\n this.mediaStates_ = {};\n\n /**\n * Set to true once one segment of each content type has been buffered.\n *\n * @private {boolean}\n */\n this.startupComplete_ = false;\n\n /**\n * Set to true on fatal error. Interrupts fetchAndAppend_().\n *\n * @private {boolean}\n */\n this.fatalError_ = false;\n\n /** @private {boolean} */\n this.destroyed_ = false;\n};\n\n\n/**\n * @typedef {{\n * playhead: !shaka.media.Playhead,\n * mediaSourceEngine: !shaka.media.MediaSourceEngine,\n * netEngine: shaka.net.NetworkingEngine,\n * onChooseStreams: function(!shakaExtern.Period):\n * !Object.<shaka.util.ManifestParserUtils.ContentType,\n * shakaExtern.Stream>,\n * onCanSwitch: function(),\n * onError: function(!shaka.util.Error),\n * onEvent: function(!Event),\n * onManifestUpdate: function(),\n * onSegmentAppended: function(),\n * onInitialStreamsSetup: (function()|undefined),\n * onStartupComplete: (function()|undefined)}\n * }}\n *\n * @property {!shaka.media.Playhead} playhead\n * The Playhead. The caller retains ownership.\n * @property {!shaka.media.MediaSourceEngine} mediaSourceEngine\n * The MediaSourceEngine. The caller retains ownership.\n * @property {shaka.net.NetworkingEngine} netEngine\n * The NetworkingEngine instance to use. The caller retains ownership.\n * @property {function(!shakaExtern.Period):\n * !Object.<shaka.util.ManifestParserUtils.ContentType,\n * shakaExtern.Stream>} onChooseStreams\n * Called when the given Period needs to be buffered. The\n * StreamingEngine will switch to the Streams returned from this function.\n * The caller cannot call switch() directly until the StreamingEngine calls\n * onCanSwitch()\n * @property {function()} onCanSwitch\n * Called when any Stream within the current Period may be switched to.\n * @property {function(!shaka.util.Error)} onError\n * Called when an error occurs. If the error is recoverable (see\n * @link{shaka.util.Error}) then the caller may invoke either\n * StreamingEngine.switch() or StreamingEngine.seeked() to attempt recovery.\n * @property {function(!Event)} onEvent\n * Called when an event occurs that should be sent to the app.\n * @property {function()} onManifestUpdate\n * Called when an embedded 'emsg' box should trigger a manifest update.\n * @property {function()} onSegmentAppended\n * Called after a segment is successfully appended to a MediaSource.\n * @property {(function()|undefined)} onInitialStreamsSetup\n * Optional callback which is called when the initial set of Streams have been\n * setup. Intended to be used by tests.\n * @property {(function()|undefined)} onStartupComplete\n * Optional callback which is called when startup has completed. Intended to\n * be used by tests.\n */\nshaka.media.StreamingEngine.PlayerInterface;\n\n\n/**\n * @typedef {{\n * type: shaka.util.ManifestParserUtils.ContentType,\n * stream: shakaExtern.Stream,\n * lastStream: ?shakaExtern.Stream,\n * lastSegmentReference: shaka.media.SegmentReference,\n * restoreStreamAfterTrickPlay: ?shakaExtern.Stream,\n * needInitSegment: boolean,\n * needPeriodIndex: number,\n * endOfStream: boolean,\n * performingUpdate: boolean,\n * updateTimer: ?number,\n * waitingToClearBuffer: boolean,\n * waitingToFlushBuffer: boolean,\n * clearingBuffer: boolean,\n * recovering: boolean,\n * hasError: boolean,\n * resumeAt: number\n * }}\n *\n * @description\n * Contains the state of a logical stream, i.e., a sequence of segmented data\n * for a particular content type. At any given time there is a Stream object\n * associated with the state of the logical stream.\n *\n * @property {shaka.util.ManifestParserUtils.ContentType} type\n * The stream's content type, e.g., 'audio', 'video', or 'text'.\n * @property {shakaExtern.Stream} stream\n * The current Stream.\n * @property {?shakaExtern.Stream} lastStream\n * The Stream of the last segment that was appended.\n * @property {shaka.media.SegmentReference} lastSegmentReference\n * The SegmentReference of the last segment that was appended.\n * @property {?shakaExtern.Stream} restoreStreamAfterTrickPlay\n * The Stream to restore after trick play mode is turned off.\n * @property {boolean} needInitSegment\n * True indicates that |stream|'s init segment must be inserted before the\n * next media segment is appended.\n * @property {boolean} endOfStream\n * True indicates that the end of the buffer has hit the end of the\n * presentation.\n * @property {number} needPeriodIndex\n * The index of the Period which needs to be buffered.\n * @property {boolean} performingUpdate\n * True indicates that an update is in progress.\n * @property {?number} updateTimer\n * A non-null value indicates that an update is scheduled.\n * @property {boolean} waitingToClearBuffer\n * True indicates that the buffer must be cleared after the current update\n * finishes.\n * @property {boolean} waitingToFlushBuffer\n * True indicates that the buffer must be flushed after it is cleared.\n * @property {boolean} clearingBuffer\n * True indicates that the buffer is being cleared.\n * @property {boolean} recovering\n * True indicates that the last segment was not appended because it could not\n * fit in the buffer.\n * @property {boolean} hasError\n * True indicates that the stream has encountered an error and has stopped\n * updates.\n * @property {number} resumeAt\n * An override for the time to start performing updates at. If the playhead\n * is behind this time, update_() will still start fetching segments from\n * this time. If the playhead is ahead of the time, this field is ignored.\n */\nshaka.media.StreamingEngine.MediaState_;\n\n\n/**\n * The minimum number seconds that will remain buffered after evicting media.\n *\n * @const {number}\n */\nshaka.media.StreamingEngine.prototype.MIN_BUFFER_LENGTH = 2;\n\n\n/** @override */\nshaka.media.StreamingEngine.prototype.destroy = function() {\n for (var type in this.mediaStates_) {\n this.cancelUpdate_(this.mediaStates_[type]);\n }\n\n this.playerInterface_ = null;\n this.manifest_ = null;\n this.setupPeriodPromise_ = null;\n this.canSwitchPeriod_ = null;\n this.canSwitchStream_ = null;\n this.mediaStates_ = null;\n this.config_ = null;\n\n this.destroyed_ = true;\n\n return Promise.resolve();\n};\n\n\n/**\n * Called by the Player to provide an updated configuration any time it changes.\n * Will be called at least once before init().\n *\n * @param {shakaExtern.StreamingConfiguration} config\n */\nshaka.media.StreamingEngine.prototype.configure = function(config) {\n this.config_ = config;\n};\n\n\n/**\n * Initializes the StreamingEngine.\n *\n * After this function is called the StreamingEngine will call\n * onChooseStreams(p) when it needs to buffer Period p and onCanSwitch() when\n * any Stream within that Period may be switched to.\n *\n * After the StreamingEngine calls onChooseStreams(p) for the first time, it\n * will begin setting up the Streams returned from that function and\n * subsequently switch to them. However, the StreamingEngine will not begin\n * setting up any other Streams until at least one segment from each of the\n * initial set of Streams has been buffered (this reduces startup latency).\n * After the StreamingEngine completes this startup phase it will begin setting\n * up each Period's Streams (while buffering in parrallel).\n *\n * When the StreamingEngine needs to buffer the next Period it will have\n * already set up that Period's Streams. So, when the StreamingEngine calls\n * onChooseStreams(p) after the first time, the StreamingEngine will\n * immediately switch to the Streams returned from that function.\n *\n * @return {!Promise}\n */\nshaka.media.StreamingEngine.prototype.init = function() {\n var MapUtils = shaka.util.MapUtils;\n goog.asserts.assert(this.config_,\n 'StreamingEngine configure() must be called before init()!');\n\n // Determine which Period we must buffer.\n var playheadTime = this.playerInterface_.playhead.getTime();\n var needPeriodIndex = this.findPeriodContainingTime_(playheadTime);\n\n // Get the initial set of Streams.\n var streamsByType = this.playerInterface_.onChooseStreams(\n this.manifest_.periods[needPeriodIndex]);\n if (MapUtils.empty(streamsByType)) {\n shaka.log.error('init: no Streams chosen');\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STREAMING,\n shaka.util.Error.Code.INVALID_STREAMS_CHOSEN));\n }\n\n // Setup the initial set of Streams and then begin each update cycle. After\n // startup completes onUpdate_() will set up the remaining Periods.\n return this.initStreams_(streamsByType).then(function() {\n shaka.log.debug('init: completed initial Stream setup');\n\n // Subtlety: onInitialStreamsSetup() may call switch() or seeked(), so we\n // must schedule an update beforehand so |updateTimer| is set.\n if (this.playerInterface_ && this.playerInterface_.onInitialStreamsSetup) {\n shaka.log.v1('init: calling onInitialStreamsSetup()...');\n this.playerInterface_.onInitialStreamsSetup();\n }\n }.bind(this));\n};\n\n\n/**\n * Gets the current Period the stream is in. This Period may not be initialized\n * yet if canSwitch(period) has not been called yet.\n * @return {shakaExtern.Period}\n */\nshaka.media.StreamingEngine.prototype.getCurrentPeriod = function() {\n var playheadTime = this.playerInterface_.playhead.getTime();\n var needPeriodIndex = this.findPeriodContainingTime_(playheadTime);\n return this.manifest_.periods[needPeriodIndex];\n};\n\n\n/**\n * Gets the Period in which we are currently buffering. This may be different\n * from the Period which contains the Playhead.\n * @return {?shakaExtern.Period}\n */\nshaka.media.StreamingEngine.prototype.getActivePeriod = function() {\n goog.asserts.assert(this.mediaStates_, 'Must be initialized');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var anyMediaState = this.mediaStates_[ContentType.VIDEO] ||\n this.mediaStates_[ContentType.AUDIO];\n return anyMediaState ?\n this.manifest_.periods[anyMediaState.needPeriodIndex] : null;\n};\n\n\n/**\n * Gets a map of all the active streams.\n * @return {!Object.<shaka.util.ManifestParserUtils.ContentType,\n * shakaExtern.Stream>}\n */\nshaka.media.StreamingEngine.prototype.getActiveStreams = function() {\n goog.asserts.assert(this.mediaStates_, 'Must be initialized');\n var MapUtils = shaka.util.MapUtils;\n return MapUtils.map(\n this.mediaStates_, function(state) {\n // Don't tell the caller about trick play streams. If we're in trick\n // play, return the stream we will go back to after we exit trick play.\n return state.restoreStreamAfterTrickPlay || state.stream;\n });\n};\n\n\n/**\n * Notifies StreamingEngine that a new text stream was added to the manifest.\n * This initializes the given stream. This returns a Promise that resolves when\n * the stream has been set up.\n *\n * @param {shakaExtern.Stream} stream\n * @return {!Promise}\n */\nshaka.media.StreamingEngine.prototype.notifyNewTextStream = function(stream) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n // Create empty object first and initialize the fields through\n // [] to allow field names to be expressions.\n /** @type {!Object.<string, shakaExtern.Stream>} */\n var streamsByType = {};\n streamsByType[ContentType.TEXT] = stream;\n return this.initStreams_(streamsByType);\n};\n\n\n/**\n * Set trick play on or off.\n * If trick play is on, related trick play streams will be used when possible.\n * @param {boolean} on\n */\nshaka.media.StreamingEngine.prototype.setTrickPlay = function(on) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var mediaState = this.mediaStates_[ContentType.VIDEO];\n if (!mediaState) return;\n\n var stream = mediaState.stream;\n if (!stream) return;\n\n shaka.log.debug('setTrickPlay', on);\n if (on) {\n var trickModeVideo = stream.trickModeVideo;\n if (!trickModeVideo) return; // Can't engage trick play.\n\n var normalVideo = mediaState.restoreStreamAfterTrickPlay;\n if (normalVideo) return; // Already in trick play.\n\n shaka.log.debug('Engaging trick mode stream', trickModeVideo);\n this.switch(ContentType.VIDEO, trickModeVideo, false);\n mediaState.restoreStreamAfterTrickPlay = stream;\n } else {\n var normalVideo = mediaState.restoreStreamAfterTrickPlay;\n if (!normalVideo) return;\n\n shaka.log.debug('Restoring non-trick-mode stream', normalVideo);\n mediaState.restoreStreamAfterTrickPlay = null;\n this.switch(ContentType.VIDEO, normalVideo, true);\n }\n};\n\n\n/**\n * Switches to the given Stream. |stream| may be from any Variant or any\n * Period.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * |stream|'s content type.\n * @param {shakaExtern.Stream} stream\n * @param {boolean} clearBuffer\n */\nshaka.media.StreamingEngine.prototype.switch = function(\n contentType, stream, clearBuffer) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var mediaState = this.mediaStates_[contentType];\n if (!mediaState && contentType == ContentType.TEXT &&\n this.config_.ignoreTextStreamFailures) {\n this.notifyNewTextStream(stream);\n return;\n }\n goog.asserts.assert(mediaState, 'switch: expected mediaState to exist');\n if (!mediaState) return;\n\n // If we are selecting a stream from a different Period, then we need to\n // handle a Period transition. Simply ignore the given stream, assuming that\n // Player will select the same track in onChooseStreams.\n var periodIndex = this.findPeriodContainingStream_(stream);\n if (clearBuffer && periodIndex != mediaState.needPeriodIndex) {\n shaka.log.debug('switch: switching to stream in another Period; clearing ' +\n 'buffer and changing Periods');\n // handlePeriodTransition_ will be called on the next update because the\n // current Period won't match the playhead Period.\n this.clearAllBuffers_();\n return;\n }\n\n if (mediaState.restoreStreamAfterTrickPlay) {\n shaka.log.debug('switch during trick play mode', stream);\n\n // Already in trick play mode, so stick with trick mode tracks if possible.\n if (stream.trickModeVideo) {\n // Use the trick mode stream, but revert to the new selection later.\n mediaState.restoreStreamAfterTrickPlay = stream;\n stream = stream.trickModeVideo;\n shaka.log.debug('switch found trick play stream', stream);\n } else {\n // No special trick mode video for this stream!\n mediaState.restoreStreamAfterTrickPlay = null;\n shaka.log.debug('switch found no special trick play stream');\n }\n }\n\n if (contentType == ContentType.TEXT) {\n // Mime types are allowed to change for text streams.\n // Reinitialize the text parser.\n var fullMimeType = shaka.util.StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n this.playerInterface_.mediaSourceEngine.reinitText(fullMimeType);\n }\n\n // Ensure the Period is ready.\n var canSwitchRecord = this.canSwitchPeriod_[periodIndex];\n goog.asserts.assert(\n canSwitchRecord && canSwitchRecord.resolved,\n 'switch: expected Period ' + periodIndex + ' to be ready');\n if (!canSwitchRecord || !canSwitchRecord.resolved) return;\n\n // Sanity check. If the Period is ready then the Stream should be ready too.\n canSwitchRecord = this.canSwitchStream_[stream.id];\n goog.asserts.assert(canSwitchRecord && canSwitchRecord.resolved,\n 'switch: expected Stream ' + stream.id + ' to be ready');\n if (!canSwitchRecord || !canSwitchRecord.resolved) return;\n\n if (mediaState.stream == stream) {\n var streamTag = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.debug('switch: Stream ' + streamTag + ' already active');\n return;\n }\n\n mediaState.stream = stream;\n mediaState.needInitSegment = true;\n\n var streamTag = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.debug('switch: switching to Stream ' + streamTag);\n\n if (clearBuffer) {\n if (mediaState.clearingBuffer) {\n // We are already going to clear the buffer, but make sure it is also\n // flushed.\n mediaState.waitingToFlushBuffer = true;\n } else if (mediaState.performingUpdate) {\n // We are performing an update, so we have to wait until it's finished.\n // onUpdate_() will call clearBuffer_() when the update has\n // finished.\n mediaState.waitingToClearBuffer = true;\n mediaState.waitingToFlushBuffer = true;\n } else {\n // Cancel the update timer, if any.\n this.cancelUpdate_(mediaState);\n // Clear right away.\n this.clearBuffer_(mediaState, /* flush */ true);\n }\n }\n};\n\n\n/**\n * Notifies the StreamingEngine that the playhead has moved to a valid time\n * within the presentation timeline.\n */\nshaka.media.StreamingEngine.prototype.seeked = function() {\n goog.asserts.assert(this.mediaStates_, 'Must not be destroyed');\n\n var playheadTime = this.playerInterface_.playhead.getTime();\n var isAllBuffered = Object.keys(this.mediaStates_).every(function(type) {\n return this.playerInterface_.mediaSourceEngine.isBuffered(\n type, playheadTime);\n }.bind(this));\n\n // Only treat as a buffered seek if every media state has a buffer. For\n // example, if we have buffered text but not video, we should still clear\n // every buffer so all media states need the same Period.\n if (isAllBuffered) {\n shaka.log.debug(\n '(all): seeked: buffered seek: playheadTime=' + playheadTime);\n return;\n }\n\n // This was an unbuffered seek (for at least one stream), clear all buffers.\n // Don't clear only some of the buffers because we can become stalled since\n // the media states are waiting for different Periods.\n shaka.log.debug('(all): seeked: unbuffered seek: clearing all buffers');\n this.clearAllBuffers_();\n};\n\n\n/**\n * Clears the buffer for every stream. Unlike clearBuffer_, this will handle\n * cases where a MediaState is performing an update. After this runs, every\n * MediaState will have a pending update.\n * @private\n */\nshaka.media.StreamingEngine.prototype.clearAllBuffers_ = function() {\n for (var type in this.mediaStates_) {\n var mediaState = this.mediaStates_[type];\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n if (mediaState.clearingBuffer) {\n // We're already clearing the buffer, so we don't need to clear the\n // buffer again.\n shaka.log.debug(logPrefix, 'clear: already clearing the buffer');\n continue;\n }\n\n if (mediaState.waitingToClearBuffer) {\n // May not be performing an update, but an update will still happen.\n // See: https://github.com/google/shaka-player/issues/334\n shaka.log.debug(logPrefix, 'clear: already waiting');\n continue;\n }\n\n if (mediaState.performingUpdate) {\n // We are performing an update, so we have to wait until it's finished.\n // onUpdate_() will call clearBuffer_() when the update has\n // finished.\n shaka.log.debug(logPrefix, 'clear: currently updating');\n mediaState.waitingToClearBuffer = true;\n continue;\n }\n\n if (this.playerInterface_.mediaSourceEngine.bufferStart(type) == null) {\n // Nothing buffered.\n shaka.log.debug(logPrefix, 'clear: nothing buffered');\n if (mediaState.updateTimer == null) {\n // Note: an update cycle stops when we buffer to the end of the\n // presentation or Period, or when we raise an error.\n this.scheduleUpdate_(mediaState, 0);\n }\n continue;\n }\n\n // An update may be scheduled, but we can just cancel it and clear the\n // buffer right away. Note: clearBuffer_() will schedule the next update.\n shaka.log.debug(logPrefix, 'clear: handling right now');\n this.cancelUpdate_(mediaState);\n this.clearBuffer_(mediaState, /* flush */ false);\n }\n};\n\n\n/**\n * Initializes the given streams and media states if required. This will\n * schedule updates for the given types.\n *\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType,\n shakaExtern.Stream>} streamsByType\n * @param {number=} opt_resumeAt\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.initStreams_ = function(\n streamsByType, opt_resumeAt) {\n var MapUtils = shaka.util.MapUtils;\n goog.asserts.assert(this.config_,\n 'StreamingEngine configure() must be called before init()!');\n\n // Determine which Period we must buffer.\n var playheadTime = this.playerInterface_.playhead.getTime();\n var needPeriodIndex = this.findPeriodContainingTime_(playheadTime);\n\n // Init MediaSourceEngine.\n var typeConfig = MapUtils.map(streamsByType, function(stream) {\n return shaka.util.StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n });\n\n this.playerInterface_.mediaSourceEngine.init(typeConfig);\n this.setDuration_();\n\n // Setup the initial set of Streams and then begin each update cycle. After\n // startup completes onUpdate_() will set up the remaining Periods.\n var streams = MapUtils.values(streamsByType);\n return this.setupStreams_(streams).then(function() {\n if (this.destroyed_) return;\n\n for (var type in streamsByType) {\n var stream = streamsByType[type];\n if (!this.mediaStates_[type]) {\n this.mediaStates_[type] = {\n stream: stream,\n type: type,\n lastStream: null,\n lastSegmentReference: null,\n restoreStreamAfterTrickPlay: null,\n needInitSegment: true,\n needPeriodIndex: needPeriodIndex,\n endOfStream: false,\n performingUpdate: false,\n updateTimer: null,\n waitingToClearBuffer: false,\n waitingToFlushBuffer: false,\n clearingBuffer: false,\n recovering: false,\n hasError: false,\n resumeAt: opt_resumeAt || 0\n };\n this.scheduleUpdate_(this.mediaStates_[type], 0);\n }\n }\n }.bind(this));\n};\n\n\n/**\n * Sets up the given Period if necessary. Calls onError() if an error\n * occurs.\n *\n * @param {number} periodIndex The Period's index.\n * @return {!Promise} A Promise which is resolved when the given Period is\n * setup.\n * @private\n */\nshaka.media.StreamingEngine.prototype.setupPeriod_ = function(periodIndex) {\n var Functional = shaka.util.Functional;\n var canSwitchRecord = this.canSwitchPeriod_[periodIndex];\n if (canSwitchRecord) {\n shaka.log.debug(\n '(all) Period ' + periodIndex + ' is being or has been set up');\n goog.asserts.assert(canSwitchRecord.promise, 'promise must not be null');\n return canSwitchRecord.promise;\n }\n\n shaka.log.debug('(all) setting up Period ' + periodIndex);\n canSwitchRecord = {\n promise: new shaka.util.PublicPromise(),\n resolved: false\n };\n this.canSwitchPeriod_[periodIndex] = canSwitchRecord;\n\n var streams = this.manifest_.periods[periodIndex].variants\n .map(function(variant) {\n var result = [];\n if (variant.audio)\n result.push(variant.audio);\n if (variant.video)\n result.push(variant.video);\n if (variant.video && variant.video.trickModeVideo)\n result.push(variant.video.trickModeVideo);\n return result;\n })\n .reduce(Functional.collapseArrays, [])\n .filter(Functional.isNotDuplicate);\n\n // Add text streams\n streams.push.apply(streams, this.manifest_.periods[periodIndex].textStreams);\n\n // Serialize Period set up.\n this.setupPeriodPromise_ = this.setupPeriodPromise_.then(function() {\n if (this.destroyed_) return;\n return this.setupStreams_(streams);\n }.bind(this)).then(function() {\n if (this.destroyed_) return;\n this.canSwitchPeriod_[periodIndex].promise.resolve();\n this.canSwitchPeriod_[periodIndex].resolved = true;\n shaka.log.v1('(all) setup Period ' + periodIndex);\n }.bind(this)).catch(function(error) {\n if (this.destroyed_) return;\n this.canSwitchPeriod_[periodIndex].promise.reject();\n delete this.canSwitchPeriod_[periodIndex];\n shaka.log.warning('(all) failed to setup Period ' + periodIndex);\n this.playerInterface_.onError(error);\n // Don't stop other Periods from being set up.\n }.bind(this));\n\n return canSwitchRecord.promise;\n};\n\n\n/**\n * Sets up the given Streams if necessary. Does NOT call onError() if an\n * error occurs.\n *\n * @param {!Array.<!shakaExtern.Stream>} streams\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.setupStreams_ = function(streams) {\n // Make sure that all the streams have unique ids.\n // (Duplicate ids will cause the player to hang).\n var uniqueStreamIds = streams.map(function(s) { return s.id; })\n .filter(shaka.util.Functional.isNotDuplicate);\n\n goog.asserts.assert(uniqueStreamIds.length == streams.length,\n 'streams should have unique ids');\n // Parallelize Stream set up.\n var async = [];\n\n for (var i = 0; i < streams.length; ++i) {\n var stream = streams[i];\n var canSwitchRecord = this.canSwitchStream_[stream.id];\n\n if (canSwitchRecord) {\n shaka.log.debug(\n '(all) Stream ' + stream.id + ' is being or has been set up');\n async.push(canSwitchRecord.promise);\n } else {\n shaka.log.v1('(all) setting up Stream ' + stream.id);\n this.canSwitchStream_[stream.id] = {\n promise: new shaka.util.PublicPromise(),\n resolved: false\n };\n async.push(stream.createSegmentIndex());\n }\n }\n\n return Promise.all(async).then(function() {\n if (this.destroyed_) return;\n\n for (var i = 0; i < streams.length; ++i) {\n var stream = streams[i];\n var canSwitchRecord = this.canSwitchStream_[stream.id];\n if (!canSwitchRecord.resolved) {\n canSwitchRecord.promise.resolve();\n canSwitchRecord.resolved = true;\n shaka.log.v1('(all) setup Stream ' + stream.id);\n }\n }\n }.bind(this)).catch(function(error) {\n if (this.destroyed_) return;\n this.canSwitchStream_[stream.id].promise.reject();\n delete this.canSwitchStream_[stream.id];\n return Promise.reject(error);\n }.bind(this));\n};\n\n\n/**\n * Sets the MediaSource's duration.\n * @private\n */\nshaka.media.StreamingEngine.prototype.setDuration_ = function() {\n var duration = this.manifest_.presentationTimeline.getDuration();\n if (duration < Infinity) {\n this.playerInterface_.mediaSourceEngine.setDuration(duration);\n } else {\n // Not all platforms support infinite durations, so set a finite duration\n // so we can append segments and so the user agent can seek.\n this.playerInterface_.mediaSourceEngine.setDuration(Math.pow(2, 32));\n }\n};\n\n\n/**\n * Called when |mediaState|'s update timer has expired.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @private\n */\nshaka.media.StreamingEngine.prototype.onUpdate_ = function(mediaState) {\n var MapUtils = shaka.util.MapUtils;\n if (this.destroyed_) return;\n\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n // Sanity check.\n goog.asserts.assert(\n !mediaState.performingUpdate && (mediaState.updateTimer != null),\n logPrefix + ' unexpected call to onUpdate_()');\n if (mediaState.performingUpdate || (mediaState.updateTimer == null)) return;\n\n goog.asserts.assert(\n !mediaState.clearingBuffer,\n logPrefix + ' onUpdate_() should not be called when clearing the buffer');\n if (mediaState.clearingBuffer) return;\n\n mediaState.updateTimer = null;\n\n // Handle pending buffer clears.\n if (mediaState.waitingToClearBuffer) {\n // Note: clearBuffer_() will schedule the next update.\n shaka.log.debug(logPrefix, 'skipping update and clearing the buffer');\n this.clearBuffer_(mediaState, mediaState.waitingToFlushBuffer);\n return;\n }\n\n // Update the MediaState.\n try {\n var delay = this.update_(mediaState);\n if (delay != null) {\n this.scheduleUpdate_(mediaState, delay);\n mediaState.hasError = false;\n }\n } catch (error) {\n this.playerInterface_.onError(error);\n return;\n }\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n\n var mediaStates = MapUtils.values(this.mediaStates_);\n\n // Check if we've buffered to the end of the Period.\n this.handlePeriodTransition_(mediaState);\n\n // Check if we've buffered to the end of the presentation.\n if (mediaStates.every(function(ms) { return ms.endOfStream; })) {\n shaka.log.v1(logPrefix, 'calling endOfStream()...');\n this.playerInterface_.mediaSourceEngine.endOfStream().then(function() {\n // If the media segments don't reach the end, then we need to update the\n // timeline duration to match the final media duration to avoid buffering\n // forever at the end.\n var duration = this.playerInterface_.mediaSourceEngine.getDuration();\n this.manifest_.presentationTimeline.setDuration(duration);\n }.bind(this));\n }\n};\n\n\n/**\n * Updates the given MediaState.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @return {?number} The number of seconds to wait until updating again or\n * null if another update does not need to be scheduled.\n * @throws {!shaka.util.Error} if an error occurs.\n * @private\n */\nshaka.media.StreamingEngine.prototype.update_ = function(mediaState) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n // Compute how far we've buffered ahead of the playhead.\n var playheadTime = this.playerInterface_.playhead.getTime();\n\n // Get the next timestamp we need.\n var timeNeeded = this.getTimeNeeded_(mediaState, playheadTime);\n shaka.log.v2(logPrefix, 'timeNeeded=' + timeNeeded);\n mediaState.resumeAt = 0;\n\n var currentPeriodIndex = this.findPeriodContainingStream_(mediaState.stream);\n var needPeriodIndex = this.findPeriodContainingTime_(timeNeeded);\n\n // Get the amount of content we have buffered, accounting for drift. This\n // is only used to determine if we have meet the buffering goal. This should\n // be the same way that PlayheadObserver uses.\n var bufferedAhead = this.playerInterface_.mediaSourceEngine.bufferedAheadOf(\n mediaState.type, playheadTime);\n\n shaka.log.v2(logPrefix,\n 'update_:',\n 'playheadTime=' + playheadTime,\n 'bufferedAhead=' + bufferedAhead);\n\n var bufferingGoal = this.getBufferingGoal_();\n\n // Check if we've buffered to the end of the presentation.\n if (timeNeeded >= this.manifest_.presentationTimeline.getDuration()) {\n // We shouldn't rebuffer if the playhead is close to the end of the\n // presentation.\n shaka.log.debug(logPrefix, 'buffered to end of presentation');\n mediaState.endOfStream = true;\n return null;\n }\n mediaState.endOfStream = false;\n\n // Check if we've buffered to the end of the Period. This should be done\n // before checking segment availability because the new Period may become\n // available once it's switched to. Note that we don't use the non-existence\n // of SegmentReferences as an indicator to determine Period boundaries\n // because SegmentIndexes can provide SegmentReferences outside its Period.\n mediaState.needPeriodIndex = needPeriodIndex;\n if (needPeriodIndex != currentPeriodIndex) {\n shaka.log.debug(logPrefix,\n 'need Period ' + needPeriodIndex,\n 'playheadTime=' + playheadTime,\n 'timeNeeded=' + timeNeeded,\n 'currentPeriodIndex=' + currentPeriodIndex);\n return null;\n }\n\n // If we've buffered to the buffering goal then schedule an update.\n if (bufferedAhead >= bufferingGoal) {\n shaka.log.v2(logPrefix, 'buffering goal met');\n\n // Do not try to predict the next update. Just poll twice every second.\n // The playback rate can change at any time, so any prediction we make now\n // could be terribly invalid soon.\n return 0.5;\n }\n\n var bufferEnd =\n this.playerInterface_.mediaSourceEngine.bufferEnd(mediaState.type);\n var reference = this.getSegmentReferenceNeeded_(\n mediaState, playheadTime, bufferEnd, currentPeriodIndex);\n if (!reference) {\n // The segment could not be found, does not exist, or is not available. In\n // any case just try again... if the manifest is incomplete or is not being\n // updated then we'll idle forever; otherwise, we'll end up getting a\n // SegmentReference eventually.\n return 1;\n }\n\n this.fetchAndAppend_(mediaState, playheadTime, currentPeriodIndex, reference);\n return null;\n};\n\n\n/**\n * Computes buffering goal.\n *\n * @return {number}\n * @private\n */\nshaka.media.StreamingEngine.prototype.getBufferingGoal_ = function() {\n goog.asserts.assert(this.manifest_, 'manifest_ should not be null');\n goog.asserts.assert(this.config_, 'config_ should not be null');\n\n var rebufferingGoal = shaka.util.StreamUtils.getRebufferingGoal(\n this.manifest_, this.config_, this.bufferingGoalScale_);\n\n return Math.max(\n rebufferingGoal,\n this.bufferingGoalScale_ * this.config_.bufferingGoal);\n};\n\n\n/**\n * Gets the next timestamp needed. Returns the playhead's position if the\n * buffer is empty; otherwise, returns the time at which the last segment\n * appended ends.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @return {number} The next timestamp needed.\n * @throws {!shaka.util.Error} if the buffer is inconsistent with our\n * expectations.\n * @private\n */\nshaka.media.StreamingEngine.prototype.getTimeNeeded_ = function(\n mediaState, playheadTime) {\n // Get the next timestamp we need. We must use |lastSegmentReference|\n // to determine this and not the actual buffer for two reasons:\n // 1. actual segments end slightly before their advertised end times, so\n // the next timestamp we need is actually larger than |bufferEnd|; and\n // 2. there may be drift (the timestamps in the segments are ahead/behind\n // of the timestamps in the manifest), but we need drift free times when\n // comparing times against presentation and Period boundaries.\n if (!mediaState.lastStream || !mediaState.lastSegmentReference) {\n return Math.max(playheadTime, mediaState.resumeAt);\n }\n\n var lastPeriodIndex =\n this.findPeriodContainingStream_(mediaState.lastStream);\n var lastPeriod = this.manifest_.periods[lastPeriodIndex];\n return lastPeriod.startTime + mediaState.lastSegmentReference.endTime;\n};\n\n\n/**\n * Gets the SegmentReference of the next segment needed.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @param {?number} bufferEnd\n * @param {number} currentPeriodIndex\n * @return {shaka.media.SegmentReference} The SegmentReference of the\n * next segment needed, or null if a segment could not be found, does not\n * exist, or is not available.\n * @private\n */\nshaka.media.StreamingEngine.prototype.getSegmentReferenceNeeded_ = function(\n mediaState, playheadTime, bufferEnd, currentPeriodIndex) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n if (mediaState.lastSegmentReference &&\n mediaState.stream == mediaState.lastStream) {\n // Something is buffered from the same Stream.\n var position = mediaState.lastSegmentReference.position + 1;\n shaka.log.v2(logPrefix, 'next position known:', 'position=' + position);\n\n return this.getSegmentReferenceIfAvailable_(\n mediaState, currentPeriodIndex, position);\n }\n\n var position;\n\n if (mediaState.lastSegmentReference) {\n // Something is buffered from another Stream.\n goog.asserts.assert(mediaState.lastStream, 'lastStream should not be null');\n shaka.log.v1(logPrefix, 'next position unknown: another Stream buffered');\n var lastPeriodIndex =\n this.findPeriodContainingStream_(mediaState.lastStream);\n var lastPeriod = this.manifest_.periods[lastPeriodIndex];\n position = this.lookupSegmentPosition_(\n mediaState,\n lastPeriod.startTime + mediaState.lastSegmentReference.endTime,\n currentPeriodIndex);\n } else {\n // Either nothing is buffered, or we have cleared part of the buffer. If\n // we still have some buffered, use that time to find the segment, otherwise\n // start at the playhead time.\n goog.asserts.assert(!mediaState.lastStream, 'lastStream should be null');\n shaka.log.v1(logPrefix, 'next position unknown: nothing buffered');\n position = this.lookupSegmentPosition_(\n mediaState, bufferEnd || playheadTime, currentPeriodIndex);\n }\n\n if (position == null)\n return null;\n\n var reference = null;\n if (bufferEnd == null) {\n // If there's positive drift then we need to get the previous segment;\n // however, we don't actually know how much drift there is, so we must\n // unconditionally get the previous segment. If it turns out that there's\n // non-positive drift then we'll just end up buffering beind the playhead a\n // little more than we needed.\n var optimalPosition = Math.max(0, position - 1);\n reference = this.getSegmentReferenceIfAvailable_(\n mediaState, currentPeriodIndex, optimalPosition);\n }\n return reference ||\n this.getSegmentReferenceIfAvailable_(\n mediaState, currentPeriodIndex, position);\n};\n\n\n/**\n * Looks up the position of the segment containing the given timestamp.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} presentationTime The timestamp needed, relative to the\n * start of the presentation.\n * @param {number} currentPeriodIndex\n * @return {?number} A segment position, or null if a segment was not be found.\n * @private\n */\nshaka.media.StreamingEngine.prototype.lookupSegmentPosition_ = function(\n mediaState, presentationTime, currentPeriodIndex) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n shaka.log.debug(logPrefix,\n 'looking up segment:',\n 'presentationTime=' + presentationTime,\n 'currentPeriod.startTime=' + currentPeriod.startTime);\n\n var lookupTime = Math.max(0, presentationTime - currentPeriod.startTime);\n var position = mediaState.stream.findSegmentPosition(lookupTime);\n\n if (position == null) {\n shaka.log.warning(logPrefix,\n 'cannot find segment:',\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'lookupTime=' + lookupTime);\n }\n\n return position;\n};\n\n\n/**\n * Gets the SegmentReference at the given position if it's available.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} currentPeriodIndex\n * @param {number} position\n * @return {shaka.media.SegmentReference}\n *\n * @private\n */\nshaka.media.StreamingEngine.prototype.getSegmentReferenceIfAvailable_ =\n function(mediaState, currentPeriodIndex, position) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n var reference = mediaState.stream.getSegmentReference(position);\n if (!reference) {\n shaka.log.v1(logPrefix,\n 'segment does not exist:',\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'position=' + position);\n return null;\n }\n\n var timeline = this.manifest_.presentationTimeline;\n var availabilityStart = timeline.getSegmentAvailabilityStart();\n var availabilityEnd = timeline.getSegmentAvailabilityEnd();\n\n if ((currentPeriod.startTime + reference.endTime < availabilityStart) ||\n (currentPeriod.startTime + reference.startTime > availabilityEnd)) {\n shaka.log.v2(logPrefix,\n 'segment is not available:',\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'reference.startTime=' + reference.startTime,\n 'reference.endTime=' + reference.endTime,\n 'availabilityStart=' + availabilityStart,\n 'availabilityEnd=' + availabilityEnd);\n return null;\n }\n\n return reference;\n};\n\n\n/**\n * Fetches and appends the given segment; sets up the given MediaState's\n * associated SourceBuffer and evicts segments if either are required\n * beforehand. Schedules another update after completing successfully.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @param {number} currentPeriodIndex The index of the current Period.\n * @param {!shaka.media.SegmentReference} reference\n * @private\n */\nshaka.media.StreamingEngine.prototype.fetchAndAppend_ = function(\n mediaState, playheadTime, currentPeriodIndex, reference) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n shaka.log.v1(logPrefix,\n 'fetchAndAppend_:',\n 'playheadTime=' + playheadTime,\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'reference.position=' + reference.position,\n 'reference.startTime=' + reference.startTime,\n 'reference.endTime=' + reference.endTime);\n\n // Subtlety: The playhead may move while asynchronous update operations are\n // in progress, so we should avoid calling playhead.getTime() in any\n // callbacks. Furthermore, switch() may be called at any time, so we should\n // also avoid using mediaState.stream or mediaState.needInitSegment in any\n // callbacks too.\n var stream = mediaState.stream;\n\n // Compute the append window end.\n var followingPeriod = this.manifest_.periods[currentPeriodIndex + 1];\n var appendWindowEnd = null;\n if (followingPeriod) {\n appendWindowEnd = followingPeriod.startTime;\n } else {\n appendWindowEnd = this.manifest_.presentationTimeline.getDuration();\n }\n goog.asserts.assert(\n (appendWindowEnd == null) || (reference.startTime <= appendWindowEnd),\n logPrefix + ' segment should start before append window end');\n\n var initSourceBuffer =\n this.initSourceBuffer_(mediaState, currentPeriodIndex, appendWindowEnd);\n\n mediaState.performingUpdate = true;\n\n // We may set |needInitSegment| to true in switch(), so set it to false here,\n // since we want it to remain true if switch() is called.\n mediaState.needInitSegment = false;\n\n shaka.log.v2(logPrefix, 'fetching segment');\n var fetchSegment = this.fetch_(reference);\n\n Promise.all([initSourceBuffer, fetchSegment]).then(function(results) {\n if (this.destroyed_ || this.fatalError_) return;\n return this.append_(mediaState,\n playheadTime,\n currentPeriod,\n stream,\n reference,\n results[1]);\n }.bind(this)).then(function() {\n if (this.destroyed_ || this.fatalError_) return;\n\n mediaState.performingUpdate = false;\n mediaState.recovering = false;\n\n if (!mediaState.waitingToClearBuffer)\n this.playerInterface_.onSegmentAppended();\n\n // Update right away.\n this.scheduleUpdate_(mediaState, 0);\n\n // Subtlety: handleStartup_() calls onStartupComplete() which may call\n // switch() or seeked(), so we must schedule an update beforehand so\n // |updateTimer| is set.\n this.handleStartup_(mediaState, stream);\n\n shaka.log.v1(logPrefix, 'finished fetch and append');\n }.bind(this)).catch(function(error) {\n if (this.destroyed_ || this.fatalError_) return;\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Should only receive a Shaka error');\n\n mediaState.performingUpdate = false;\n\n if (this.manifest_.presentationTimeline.isLive() &&\n this.config_.infiniteRetriesForLiveStreams &&\n (error.code == shaka.util.Error.Code.BAD_HTTP_STATUS ||\n error.code == shaka.util.Error.Code.HTTP_ERROR ||\n error.code == shaka.util.Error.Code.TIMEOUT)) {\n this.handleNetworkError_(mediaState, error);\n } else if (error.code == shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR) {\n this.handleQuotaExceeded_(mediaState, error);\n } else {\n shaka.log.error(logPrefix, 'failed fetch and append: code=' + error.code);\n if (mediaState.type == ContentType.TEXT &&\n this.config_.ignoreTextStreamFailures) {\n shaka.log.warning(logPrefix,\n 'Text stream failed to parse. Proceeding without it.');\n delete this.mediaStates_[ContentType.TEXT];\n } else {\n mediaState.hasError = true;\n error.severity = shaka.util.Error.Severity.CRITICAL;\n this.playerInterface_.onError(error);\n }\n }\n }.bind(this));\n};\n\n\n/**\n * Handles a network error.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {!shaka.util.Error} error\n * @private\n */\nshaka.media.StreamingEngine.prototype.handleNetworkError_ = function(\n mediaState, error) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n if (mediaState.type == ContentType.TEXT &&\n this.config_.ignoreTextStreamFailures &&\n error.code == shaka.util.Error.Code.BAD_HTTP_STATUS) {\n shaka.log.warning(logPrefix,\n 'Text stream failed to download. Proceeding without it.');\n delete this.mediaStates_[ContentType.TEXT];\n } else {\n error.severity = shaka.util.Error.Severity.RECOVERABLE;\n this.playerInterface_.onError(error);\n\n shaka.log.warning(logPrefix, 'Network error. Retrying...');\n this.scheduleUpdate_(mediaState, 4);\n }\n};\n\n\n/**\n * Handles a QUOTA_EXCEEDED_ERROR.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {!shaka.util.Error} error\n * @private\n */\nshaka.media.StreamingEngine.prototype.handleQuotaExceeded_ = function(\n mediaState, error) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n // The segment cannot fit into the SourceBuffer. Ideally, MediaSource would\n // have evicted old data to accommodate the segment; however, it may have\n // failed to do this if the segment is very large, or if it could not find\n // a suitable time range to remove.\n //\n // We can overcome the latter by trying to append the segment again;\n // however, to avoid continuous QuotaExceededErrors we must reduce the size\n // of the buffer going forward.\n //\n // If we've recently reduced the buffering goals, wait until the stream\n // which caused the first QuotaExceededError recovers. Doing this ensures\n // we don't reduce the buffering goals too quickly.\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n var mediaStates = shaka.util.MapUtils.values(this.mediaStates_);\n var waitingForAnotherStreamToRecover = mediaStates.some(function(ms) {\n return ms != mediaState && ms.recovering;\n });\n\n if (!waitingForAnotherStreamToRecover) {\n // Reduction schedule: 80%, 60%, 40%, 20%, 16%, 12%, 8%, 4%, fail.\n // Note: percentages are used for comparisons to avoid rounding errors.\n var percentBefore = Math.round(100 * this.bufferingGoalScale_);\n if (percentBefore > 20) {\n this.bufferingGoalScale_ -= 0.2;\n } else if (percentBefore > 4) {\n this.bufferingGoalScale_ -= 0.04;\n } else {\n shaka.log.error(\n logPrefix, 'MediaSource threw QuotaExceededError too many times');\n mediaState.hasError = true;\n this.fatalError_ = true;\n this.playerInterface_.onError(error);\n return;\n }\n var percentAfter = Math.round(100 * this.bufferingGoalScale_);\n shaka.log.warning(\n logPrefix,\n 'MediaSource threw QuotaExceededError:',\n 'reducing buffering goals by ' + (100 - percentAfter) + '%');\n mediaState.recovering = true;\n } else {\n shaka.log.debug(\n logPrefix,\n 'MediaSource threw QuotaExceededError:',\n 'waiting for another stream to recover...');\n }\n\n // QuotaExceededError gets thrown if evication didn't help to make room\n // for a segment. We want to wait for a while (4 seconds is just an\n // arbitrary number) before updating to give the playhead a chance to\n // advance, so we don't immidiately throw again.\n this.scheduleUpdate_(mediaState, 4);\n};\n\n\n/**\n * Sets the given MediaState's associated SourceBuffer's timestamp offset and\n * init segment if either are required. If an error occurs then neither the\n * timestamp offset or init segment are unset, since another call to switch()\n * will end up superseding them.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} currentPeriodIndex\n * @param {?number} appendWindowEnd\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.initSourceBuffer_ = function(\n mediaState, currentPeriodIndex, appendWindowEnd) {\n if (!mediaState.needInitSegment)\n return Promise.resolve();\n\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n // If we need an init segment then the Stream switched, so we've either\n // changed bitrates, Periods, or both. If we've changed Periods then we must\n // set a new timestamp offset and append window end. Note that by setting\n // these values here, we avoid having to co-ordinate ongoing updates, which\n // we would have to do if we instead set them in switch().\n var timestampOffset =\n currentPeriod.startTime - mediaState.stream.presentationTimeOffset;\n shaka.log.v1(logPrefix, 'setting timestamp offset to ' + timestampOffset);\n shaka.log.v1(logPrefix, 'setting append window end to ' + appendWindowEnd);\n var setStreamProperties =\n this.playerInterface_.mediaSourceEngine.setStreamProperties(\n mediaState.type, timestampOffset, appendWindowEnd);\n\n if (!mediaState.stream.initSegmentReference) {\n // The Stream is self initializing.\n return setStreamProperties;\n }\n\n shaka.log.v1(logPrefix, 'fetching init segment');\n var fetchInit = this.fetch_(mediaState.stream.initSegmentReference);\n var appendInit = fetchInit.then(function(initSegment) {\n if (this.destroyed_) return;\n shaka.log.v1(logPrefix, 'appending init segment');\n\n return this.playerInterface_.mediaSourceEngine.appendBuffer(\n mediaState.type, initSegment, null /* startTime */, null /* endTime */);\n }.bind(this)).catch(function(error) {\n mediaState.needInitSegment = true;\n return Promise.reject(error);\n });\n\n return Promise.all([setStreamProperties, appendInit]);\n};\n\n\n/**\n * Appends the given segment and evicts content if required to append.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Stream} stream\n * @param {!shaka.media.SegmentReference} reference\n * @param {!ArrayBuffer} segment\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.append_ = function(\n mediaState, playheadTime, period, stream, reference, segment) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n if (stream.containsEmsgBoxes) {\n new shaka.util.Mp4Parser()\n .fullBox('emsg', this.parseEMSG_.bind(this, period, reference))\n .parse(segment);\n }\n\n return this.evict_(mediaState, playheadTime).then(function() {\n if (this.destroyed_) return;\n shaka.log.v1(logPrefix, 'appending media segment');\n\n return this.playerInterface_.mediaSourceEngine.appendBuffer(\n mediaState.type, segment, reference.startTime + period.startTime,\n reference.endTime + period.startTime);\n }.bind(this)).then(function() {\n if (this.destroyed_) return;\n shaka.log.v2(logPrefix, 'appended media segment');\n\n // We must use |stream| because switch() may have been called.\n mediaState.lastStream = stream;\n mediaState.lastSegmentReference = reference;\n\n return Promise.resolve();\n }.bind(this));\n};\n\n\n/**\n * Parse the EMSG box from a MP4 container.\n *\n * @param {!shakaExtern.Period} period\n * @param {!shaka.media.SegmentReference} reference\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @private\n */\nshaka.media.StreamingEngine.prototype.parseEMSG_ = function(\n period, reference, box) {\n\n var schemeId = box.reader.readTerminatedString();\n // read rest of the data and dispatch event to the application\n var value = box.reader.readTerminatedString();\n var timescale = box.reader.readUint32();\n var presentationTimeDelta = box.reader.readUint32();\n var eventDuration = box.reader.readUint32();\n var id = box.reader.readUint32();\n var messageData = box.reader.readBytes(\n box.reader.getLength() - box.reader.getPosition());\n\n var startTime = period.startTime + reference.startTime +\n (presentationTimeDelta / timescale);\n\n // See DASH sec. 5.10.4.1\n // A special scheme in DASH used to signal manifest updates.\n if (schemeId == 'urn:mpeg:dash:event:2012') {\n this.playerInterface_.onManifestUpdate();\n } else {\n /** @type {shakaExtern.EmsgInfo} */\n var emsg = {\n startTime: startTime,\n endTime: startTime + (eventDuration / timescale),\n schemeIdUri: schemeId,\n value: value,\n timescale: timescale,\n presentationTimeDelta: presentationTimeDelta,\n eventDuration: eventDuration,\n id: id,\n messageData: messageData\n };\n\n var event = new shaka.util.FakeEvent('emsg', {'detail': emsg});\n this.playerInterface_.onEvent(event);\n }\n};\n\n\n/**\n * Evicts media to meet the max buffer behind limit.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.evict_ = function(\n mediaState, playheadTime) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.v2(logPrefix, 'checking buffer length');\n\n var startTime =\n this.playerInterface_.mediaSourceEngine.bufferStart(mediaState.type);\n if (startTime == null) {\n shaka.log.v2(logPrefix,\n 'buffer behind okay because nothing buffered:',\n 'playheadTime=' + playheadTime,\n 'bufferBehind=' + this.config_.bufferBehind);\n return Promise.resolve();\n }\n var bufferedBehind = playheadTime - startTime;\n\n var overflow = bufferedBehind - this.config_.bufferBehind;\n if (overflow <= 0) {\n shaka.log.v2(logPrefix,\n 'buffer behind okay:',\n 'playheadTime=' + playheadTime,\n 'bufferedBehind=' + bufferedBehind,\n 'bufferBehind=' + this.config_.bufferBehind,\n 'underflow=' + (-overflow));\n return Promise.resolve();\n }\n\n shaka.log.v1(logPrefix,\n 'buffer behind too large:',\n 'playheadTime=' + playheadTime,\n 'bufferedBehind=' + bufferedBehind,\n 'bufferBehind=' + this.config_.bufferBehind,\n 'overflow=' + overflow);\n\n return this.playerInterface_.mediaSourceEngine.remove(\n mediaState.type, startTime, startTime + overflow).then(function() {\n if (this.destroyed_) return;\n shaka.log.v1(logPrefix, 'evicted ' + overflow + ' seconds');\n }.bind(this));\n};\n\n\n/**\n * Sets up all known Periods when startup completes; otherwise, does nothing.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState The last\n * MediaState updated.\n * @param {shakaExtern.Stream} stream\n * @private\n */\nshaka.media.StreamingEngine.prototype.handleStartup_ = function(\n mediaState, stream) {\n var Functional = shaka.util.Functional;\n var MapUtils = shaka.util.MapUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (this.startupComplete_)\n return;\n\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n var mediaStates = MapUtils.values(this.mediaStates_);\n this.startupComplete_ = mediaStates.every(function(ms) {\n // Startup completes once we have buffered at least one segment from each\n // MediaState, not counting text.\n if (ms.type == ContentType.TEXT) return true;\n return !ms.waitingToClearBuffer &&\n !ms.clearingBuffer &&\n ms.lastSegmentReference;\n });\n\n if (!this.startupComplete_)\n return;\n\n shaka.log.debug(logPrefix, 'startup complete');\n\n // We must use |stream| because switch() may have been called.\n var currentPeriodIndex = this.findPeriodContainingStream_(stream);\n\n goog.asserts.assert(\n mediaStates.every(function(ms) {\n // It is possible for one stream (usually text) to buffer the whole\n // Period and need the next one.\n return ms.needPeriodIndex == currentPeriodIndex ||\n ms.needPeriodIndex == currentPeriodIndex + 1;\n }),\n logPrefix + ' expected all MediaStates to need same Period');\n\n // Setup the current Period if necessary, which is likely since the current\n // Period is probably the initial one.\n if (!this.canSwitchPeriod_[currentPeriodIndex]) {\n this.setupPeriod_(currentPeriodIndex).then(function() {\n shaka.log.v1(logPrefix, 'calling onCanSwitch()...');\n this.playerInterface_.onCanSwitch();\n }.bind(this)).catch(Functional.noop);\n }\n\n // Now setup all known Periods.\n for (var i = 0; i < this.manifest_.periods.length; ++i) {\n this.setupPeriod_(i).catch(Functional.noop);\n }\n\n if (this.playerInterface_.onStartupComplete) {\n shaka.log.v1(logPrefix, 'calling onStartupComplete()...');\n this.playerInterface_.onStartupComplete();\n }\n};\n\n\n/**\n * Calls onChooseStreams() when necessary.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState The last\n * MediaState updated.\n * @private\n */\nshaka.media.StreamingEngine.prototype.handlePeriodTransition_ = function(\n mediaState) {\n var Functional = shaka.util.Functional;\n var MapUtils = shaka.util.MapUtils;\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var currentPeriodIndex = this.findPeriodContainingStream_(mediaState.stream);\n if (mediaState.needPeriodIndex == currentPeriodIndex)\n return;\n\n var needPeriodIndex = mediaState.needPeriodIndex;\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n var mediaStates = MapUtils.values(this.mediaStates_);\n\n // For a Period transition to work, all media states must need the same\n // Period. If a stream needs a different Period than the one it currently\n // has, it will try to transition or stop updates assuming that another stream\n // will handle it. This only works when all streams either need the same\n // Period or are still performing updates.\n goog.asserts.assert(\n mediaStates.every(function(ms) {\n return ms.needPeriodIndex == needPeriodIndex || ms.hasError ||\n !shaka.media.StreamingEngine.isIdle_(ms);\n }),\n 'All MediaStates should need the same Period or be performing updates.');\n\n // Only call onChooseStreams() when all MediaStates need the same Period.\n var needSamePeriod = mediaStates.every(function(ms) {\n return ms.needPeriodIndex == needPeriodIndex;\n });\n if (!needSamePeriod) {\n shaka.log.debug(\n logPrefix, 'not all MediaStates need Period ' + needPeriodIndex);\n return;\n }\n\n // Only call onChooseStreams() once per Period transition.\n var allAreIdle = mediaStates.every(shaka.media.StreamingEngine.isIdle_);\n if (!allAreIdle) {\n shaka.log.debug(\n logPrefix,\n 'all MediaStates need Period ' + needPeriodIndex + ', ' +\n 'but not all MediaStates are idle');\n return;\n }\n\n shaka.log.debug(logPrefix, 'all need Period ' + needPeriodIndex);\n\n // Ensure the Period which we need to buffer is setup and then call\n // onChooseStreams().\n this.setupPeriod_(needPeriodIndex).then(function() {\n if (this.destroyed_) return;\n\n // If we seek during a Period transition, we can start another transition.\n // So we need to verify that:\n // - We are still in need of the same Period.\n // - All streams are still idle.\n // - The current stream is not in the needed Period (another transition\n // handled it).\n var allReady = mediaStates.every(function(ms) {\n var isIdle = shaka.media.StreamingEngine.isIdle_(ms);\n var currentPeriodIndex = this.findPeriodContainingStream_(ms.stream);\n return isIdle && ms.needPeriodIndex == needPeriodIndex &&\n currentPeriodIndex != needPeriodIndex;\n }.bind(this));\n if (!allReady) {\n // TODO: Write unit tests for this case.\n shaka.log.debug(logPrefix, 'ignoring transition to Period',\n needPeriodIndex, 'since another is happening');\n return;\n }\n\n var needPeriod = this.manifest_.periods[needPeriodIndex];\n\n shaka.log.v1(logPrefix, 'calling onChooseStreams()...');\n var streamsByType = this.playerInterface_.onChooseStreams(needPeriod);\n\n // Vet |streamsByType| before switching.\n for (var type in this.mediaStates_) {\n if (streamsByType[type] || type == ContentType.TEXT) continue;\n\n shaka.log.error(logPrefix,\n 'invalid Streams chosen: missing ' + type + ' Stream');\n this.playerInterface_.onError(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STREAMING,\n shaka.util.Error.Code.INVALID_STREAMS_CHOSEN));\n return;\n }\n\n for (var type in streamsByType) {\n if (this.mediaStates_[type]) continue;\n if (type == ContentType.TEXT) {\n // initStreams_ will switch streams and schedule an update.\n this.initStreams_(\n {text: streamsByType[ContentType.TEXT]}, needPeriod.startTime);\n delete streamsByType[type];\n continue;\n }\n\n shaka.log.error(logPrefix,\n 'invalid Streams chosen: unusable ' + type + ' Stream');\n this.playerInterface_.onError(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STREAMING,\n shaka.util.Error.Code.INVALID_STREAMS_CHOSEN));\n return;\n }\n\n for (var type in this.mediaStates_) {\n var stream = streamsByType[type];\n if (stream) {\n this.switch(type, stream, /* clearBuffer */ false);\n this.scheduleUpdate_(this.mediaStates_[type], 0);\n } else {\n goog.asserts.assert(type == ContentType.TEXT, 'Invalid streams chosen');\n delete this.mediaStates_[type];\n }\n }\n\n // We've already set up the Period so call onCanSwitch() right now.\n shaka.log.v1(logPrefix, 'calling onCanSwitch()...');\n this.playerInterface_.onCanSwitch();\n }.bind(this)).catch(Functional.noop);\n};\n\n\n/**\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @return {boolean} True if the given MediaState is idle; otherwise, return\n * false.\n * @private\n */\nshaka.media.StreamingEngine.isIdle_ = function(mediaState) {\n return !mediaState.performingUpdate &&\n (mediaState.updateTimer == null) &&\n !mediaState.waitingToClearBuffer &&\n !mediaState.clearingBuffer;\n};\n\n\n/**\n * @param {number} time The time, in seconds, relative to the start of the\n * presentation.\n * @return {number} The index of the Period which starts after |time|\n * @private\n */\nshaka.media.StreamingEngine.prototype.findPeriodContainingTime_ = function(\n time) {\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n return shaka.util.StreamUtils.findPeriodContainingTime(this.manifest_, time);\n};\n\n\n/**\n * @param {!shakaExtern.Stream} stream\n * @return {number} The index of the Period which contains |stream|, or -1 if\n * no Period contains |stream|.\n * @private\n */\nshaka.media.StreamingEngine.prototype.findPeriodContainingStream_ = function(\n stream) {\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n return shaka.util.StreamUtils.findPeriodContainingStream(\n this.manifest_, stream);\n};\n\n\n/**\n * Fetches the given segment.\n *\n * @param {(!shaka.media.InitSegmentReference|!shaka.media.SegmentReference)}\n * reference\n *\n * @return {!Promise.<!ArrayBuffer>}\n * @private\n */\nshaka.media.StreamingEngine.prototype.fetch_ = function(reference) {\n var requestType = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n var request = shaka.net.NetworkingEngine.makeRequest(\n reference.getUris(), this.config_.retryParameters);\n\n // Set Range header. Note that some web servers don't accept Range headers,\n // so don't set one if it's not strictly required.\n if ((reference.startByte != 0) || (reference.endByte != null)) {\n var range = 'bytes=' + reference.startByte + '-';\n if (reference.endByte != null) range += reference.endByte;\n request.headers['Range'] = range;\n }\n\n shaka.log.v2('fetching: reference=' + reference);\n var p = this.playerInterface_.netEngine.request(requestType, request);\n return p.then(function(response) {\n return response.data;\n });\n};\n\n\n/**\n * Clears the buffer and schedules another update.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {boolean} flush\n * @private\n */\nshaka.media.StreamingEngine.prototype.clearBuffer_ =\n function(mediaState, flush) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n goog.asserts.assert(\n !mediaState.performingUpdate && (mediaState.updateTimer == null),\n logPrefix + ' unexpected call to clearBuffer_()');\n\n mediaState.waitingToClearBuffer = false;\n mediaState.waitingToFlushBuffer = false;\n mediaState.clearingBuffer = true;\n\n shaka.log.debug(logPrefix, 'clearing buffer');\n var p = this.playerInterface_.mediaSourceEngine.clear(mediaState.type);\n p.then(function() {\n if (!this.destroyed_ && flush) {\n return this.playerInterface_.mediaSourceEngine.flush(mediaState.type);\n }\n }.bind(this)).then(function() {\n if (this.destroyed_) return;\n shaka.log.debug(logPrefix, 'cleared buffer');\n mediaState.lastStream = null;\n mediaState.lastSegmentReference = null;\n mediaState.clearingBuffer = false;\n mediaState.endOfStream = false;\n this.scheduleUpdate_(mediaState, 0);\n }.bind(this));\n};\n\n\n/**\n * Schedules |mediaState|'s next update.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} delay The delay in seconds.\n * @private\n */\nshaka.media.StreamingEngine.prototype.scheduleUpdate_ = function(\n mediaState, delay) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.v2(logPrefix, 'updating in ' + delay + ' seconds');\n goog.asserts.assert(mediaState.updateTimer == null,\n logPrefix + ' did not expect update to be scheduled');\n mediaState.updateTimer = window.setTimeout(\n this.onUpdate_.bind(this, mediaState), delay * 1000);\n};\n\n\n/**\n * Cancels |mediaState|'s next update if one exists.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @private\n */\nshaka.media.StreamingEngine.prototype.cancelUpdate_ = function(mediaState) {\n if (mediaState.updateTimer != null) {\n window.clearTimeout(mediaState.updateTimer);\n mediaState.updateTimer = null;\n }\n};\n\n\n/**\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @return {string} A log prefix of the form ($CONTENT_TYPE:$STREAM_ID), e.g.,\n * \"(audio:5)\" or \"(video:hd)\".\n * @private\n */\nshaka.media.StreamingEngine.logPrefix_ = function(mediaState) {\n return '(' + mediaState.type + ':' + mediaState.stream.id + ')';\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/streaming_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.net.HttpPlugin');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\n\n\n/**\n * @namespace\n * @summary A networking plugin to handle http and https URIs via XHR.\n * @param {string} uri\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.net.HttpPlugin = function(uri, request) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n\n xhr.open(request.method, uri, true);\n xhr.responseType = 'arraybuffer';\n xhr.timeout = request.retryParameters.timeout;\n xhr.withCredentials = request.allowCrossSiteCredentials;\n\n xhr.onload = function(event) {\n var target = event.target;\n goog.asserts.assert(target, 'XHR onload has no target!');\n\n var headers = target.getAllResponseHeaders().split('\\r\\n').reduce(\n function(all, part) {\n var header = part.split(': ');\n all[header[0].toLowerCase()] = header.slice(1).join(': ');\n return all;\n },\n {});\n if (target.status >= 200 && target.status <= 299 &&\n target.status != 202) {\n // Most 2xx HTTP codes are success cases.\n if (target.responseURL) {\n uri = target.responseURL;\n }\n /** @type {shakaExtern.Response} */\n var response = {\n uri: uri,\n data: target.response,\n headers: headers,\n fromCache: !!headers['x-shaka-from-cache']\n };\n resolve(response);\n } else {\n var responseText = null;\n try {\n responseText = shaka.util.StringUtils.fromBytesAutoDetect(\n target.response);\n } catch (exception) {}\n shaka.log.debug('HTTP error text:', responseText);\n\n var severity = target.status == 401 || target.status == 403 ?\n shaka.util.Error.Severity.CRITICAL :\n shaka.util.Error.Severity.RECOVERABLE;\n reject(new shaka.util.Error(\n severity,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.BAD_HTTP_STATUS,\n uri,\n target.status,\n responseText,\n headers));\n }\n };\n xhr.onerror = function(event) {\n reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.HTTP_ERROR,\n uri));\n };\n xhr.ontimeout = function(event) {\n reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.TIMEOUT,\n uri));\n };\n\n for (var k in request.headers) {\n xhr.setRequestHeader(k, request.headers[k]);\n }\n xhr.send(request.body);\n });\n};\n\n\nshaka.net.NetworkingEngine.registerScheme('http', shaka.net.HttpPlugin);\nshaka.net.NetworkingEngine.registerScheme('https', shaka.net.HttpPlugin);\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/net/http_plugin.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.DBEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.offline.IStorageEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * This manages all operations on an IndexedDB. This wraps all operations\n * in Promises. All Promises will resolve once the transaction has completed.\n * Depending on the browser, this may or may not be after the data is flushed\n * to disk. https://goo.gl/zMOeJc\n *\n * @struct\n * @constructor\n * @implements {shaka.offline.IStorageEngine}\n */\nshaka.offline.DBEngine = function() {\n goog.asserts.assert(\n shaka.offline.DBEngine.isSupported(),\n 'DBEngine should not be called when DBEngine is not supported');\n\n /** @private {IDBDatabase} */\n this.db_ = null;\n\n /** @private {!Array.<shaka.offline.DBEngine.Operation>} */\n this.operations_ = [];\n\n /** @private {!Object.<string, number>} */\n this.currentIdMap_ = {};\n};\n\n\n/**\n * @typedef {{\n * transaction: !IDBTransaction,\n * promise: !shaka.util.PublicPromise\n * }}\n *\n * @property {!IDBTransaction} transaction\n * The transaction that this operation is using.\n * @property {!shaka.util.PublicPromise} promise\n * The promise associated with the operation.\n */\nshaka.offline.DBEngine.Operation;\n\n\n/** @private {string} */\nshaka.offline.DBEngine.DB_NAME_ = 'shaka_offline_db';\n\n\n/** @private @const {number} */\nshaka.offline.DBEngine.DB_VERSION_ = 1;\n\n\n/**\n * Determines if the browsers supports IndexedDB.\n * @return {boolean}\n */\nshaka.offline.DBEngine.isSupported = function() {\n return window.indexedDB != null;\n};\n\n\n/**\n * Delete the database. There must be no open connections to the database.\n * @return {!Promise}\n */\nshaka.offline.DBEngine.deleteDatabase = function() {\n if (!window.indexedDB)\n return Promise.resolve();\n var request =\n window.indexedDB.deleteDatabase(shaka.offline.DBEngine.DB_NAME_);\n\n var p = new shaka.util.PublicPromise();\n request.onsuccess = function(event) {\n goog.asserts.assert(event.newVersion == null, 'Unexpected database update');\n p.resolve();\n };\n request.onerror = shaka.offline.DBEngine.onError_.bind(null, request, p);\n return p;\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.initialized = function() {\n return this.db_ != null;\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.init = function(storeMap, opt_retryCount) {\n goog.asserts.assert(!this.db_, 'Already initialized');\n\n return this.createConnection_(storeMap, opt_retryCount).then(function() {\n // For each store, get the next ID and store in the map.\n var stores = Object.keys(storeMap);\n return Promise.all(stores.map(function(store) {\n return this.getNextId_(store).then(function(id) {\n this.currentIdMap_[store] = id;\n }.bind(this));\n }.bind(this)));\n }.bind(this));\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.destroy = function() {\n return Promise.all(this.operations_.map(function(op) {\n try {\n // If the transaction is considered finished but has not called the\n // callbacks yet, it will still be in the list and this call will fail.\n // Simply ignore errors.\n op.transaction.abort();\n } catch (e) {}\n\n var Functional = shaka.util.Functional;\n return op.promise.catch(Functional.noop);\n })).then(function() {\n goog.asserts.assert(this.operations_.length == 0,\n 'All operations should have been closed');\n if (this.db_) {\n this.db_.close();\n this.db_ = null;\n }\n }.bind(this));\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.get = function(storeName, key) {\n var request;\n return this.createTransaction_(storeName, 'readonly', function(store) {\n request = store.get(key);\n }).then(function() { return request.result; });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.forEach = function(storeName, callback) {\n return this.createTransaction_(storeName, 'readonly', function(store) {\n var request = store.openCursor();\n request.onsuccess = function(event) {\n var cursor = event.target.result;\n if (cursor) {\n callback(cursor.value);\n cursor.continue();\n }\n };\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.insert = function(storeName, value) {\n return this.createTransaction_(storeName, 'readwrite', function(store) {\n store.put(value);\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.remove = function(storeName, key) {\n return this.createTransaction_(storeName, 'readwrite', function(store) {\n store.delete(key);\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.removeKeys = function(storeName,\n keys,\n opt_onKeyRemoved) {\n return this.createTransaction_(storeName, 'readwrite', function(store) {\n for (var i = 0; i < keys.length; i++) {\n var request = store.delete(keys[i]);\n request.onsuccess = opt_onKeyRemoved || function(event) { };\n }\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.reserveId = function(storeName) {\n goog.asserts.assert(storeName in this.currentIdMap_,\n 'Store name must be passed to init()');\n return this.currentIdMap_[storeName]++;\n};\n\n\n/**\n * Gets the ID to start at.\n *\n * @param {string} storeName\n * @return {!Promise.<number>}\n * @private\n */\nshaka.offline.DBEngine.prototype.getNextId_ = function(storeName) {\n var id = 0;\n return this.createTransaction_(storeName, 'readonly', function(store) {\n var request = store.openCursor(null, 'prev');\n request.onsuccess = function(event) {\n var cursor = event.target.result;\n if (cursor) {\n id = cursor.key + 1;\n }\n };\n }).then(function() { return id; });\n};\n\n\n/**\n * Creates a new transaction for the given store name and calls |action| to\n * modify the store. The transaction will resolve or reject the promise\n * returned by this function.\n *\n * @param {string} storeName\n * @param {string} type\n * @param {!function(IDBObjectStore)} action\n *\n * @return {!Promise}\n * @private\n */\nshaka.offline.DBEngine.prototype.createTransaction_ = function(storeName,\n type,\n action) {\n\n goog.asserts.assert(this.db_, 'Must not be destroyed');\n goog.asserts.assert(type == 'readonly' || type == 'readwrite',\n 'Type must be \"readonly\" or \"readwrite\"');\n\n var op = {\n transaction: this.db_.transaction([storeName], type),\n promise: new shaka.util.PublicPromise()\n };\n\n op.transaction.oncomplete = (function(event) {\n this.closeOperation_(op);\n op.promise.resolve();\n }.bind(this));\n\n // We will see an onabort call via:\n // 1. request error -> transaction error -> transaction abort\n // 2. transaction commit fail -> transaction abort\n // As any transaction error will result in an abort, it is better to listen\n // for an abort so that we will catch all failed transaction operations.\n op.transaction.onabort = (function(event) {\n this.closeOperation_(op);\n shaka.offline.DBEngine.onError_(op.transaction, op.promise, event);\n }.bind(this));\n\n // We need to prevent default on the onerror event or else Firefox will\n // raise an error which will cause a karma failure. This will not stop the\n // onabort callback from firing.\n op.transaction.onerror = (function(event) {\n event.preventDefault();\n }.bind(this));\n\n var store = op.transaction.objectStore(storeName);\n action(store);\n\n this.operations_.push(op);\n\n return op.promise;\n};\n\n\n/**\n * Close an open operation.\n *\n * @param {!shaka.offline.DBEngine.Operation} op\n * @private\n */\nshaka.offline.DBEngine.prototype.closeOperation_ = function(op) {\n var i = this.operations_.indexOf(op);\n goog.asserts.assert(i >= 0, 'Operation must be in the list.');\n this.operations_.splice(i, 1);\n};\n\n\n/**\n * Creates a new connection to the database.\n *\n * On IE/Edge, it is possible for the database to not be deleted when the\n * success callback is fired. This means that when we delete the database and\n * immediately create a new connection, we will connect to the old database.\n * If this happens, we need to close the connection and retry.\n *\n * @see https://goo.gl/hOYJvN\n *\n * @param {!Object.<string, string>} storeMap\n * @param {number=} opt_retryCount\n * @return {!Promise}\n * @private\n */\nshaka.offline.DBEngine.prototype.createConnection_ = function(\n storeMap, opt_retryCount) {\n var DBEngine = shaka.offline.DBEngine;\n\n var indexedDB = window.indexedDB;\n var request = indexedDB.open(DBEngine.DB_NAME_, DBEngine.DB_VERSION_);\n\n var upgraded = false;\n var createPromise = new shaka.util.PublicPromise();\n request.onupgradeneeded = function(event) {\n upgraded = true;\n var db = event.target.result;\n goog.asserts.assert(event.oldVersion == 0,\n 'Must be upgrading from version 0');\n goog.asserts.assert(db.objectStoreNames.length == 0,\n 'Version 0 database should be empty');\n for (var name in storeMap) {\n db.createObjectStore(name, {keyPath: storeMap[name]});\n }\n };\n request.onsuccess = (function(event) {\n if (opt_retryCount && !upgraded) {\n event.target.result.close();\n\n shaka.log.info('Didn\\'t get an upgrade event... trying again.');\n setTimeout(function() {\n var p = this.createConnection_(storeMap, opt_retryCount - 1);\n p.then(createPromise.resolve, createPromise.reject);\n }.bind(this), 1000);\n return;\n }\n\n\n goog.asserts.assert(opt_retryCount == undefined || upgraded,\n 'Should get upgrade event');\n this.db_ = event.target.result;\n createPromise.resolve();\n }.bind(this));\n request.onerror = DBEngine.onError_.bind(null, request, createPromise);\n\n return createPromise;\n};\n\n\n/**\n * Rejects the given Promise using the error fromt the transaction.\n *\n * @param {!IDBTransaction|!IDBRequest} errorSource\n * @param {!shaka.util.PublicPromise} promise\n * @param {Event} event\n * @private\n */\nshaka.offline.DBEngine.onError_ = function(errorSource, promise, event) {\n\n if (errorSource.error) {\n promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.INDEXED_DB_ERROR, errorSource.error));\n } else {\n promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n\n // Firefox will raise an error which will cause a karma failure.\n event.preventDefault();\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/db_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.DownloadManager');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.MapUtils');\n\n\n\n/**\n * This manages downloading segments and notifying the app of progress.\n *\n * @param {shaka.offline.IStorageEngine} storageEngine\n * @param {!shaka.net.NetworkingEngine} netEngine\n * @param {shakaExtern.RetryParameters} retryParams\n * @param {shakaExtern.OfflineConfiguration} config\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n */\nshaka.offline.DownloadManager = function(\n storageEngine, netEngine, retryParams, config) {\n /**\n * @private {!Object.<\n * string, !Array.<shaka.offline.DownloadManager.Segment>>}\n */\n this.segments_ = {};\n\n /**\n * The IDs of the segments that have been stored for an in-progress\n * download(). This is used to cleanup in destroy().\n * @private {!Array.<number>}\n */\n this.storedSegments_ = [];\n\n /** @private {?shakaExtern.OfflineConfiguration} */\n this.config_ = config;\n\n /** @private {shaka.offline.IStorageEngine} */\n this.storageEngine_ = storageEngine;\n\n /** @private {shaka.net.NetworkingEngine} */\n this.netEngine_ = netEngine;\n\n /** @private {?shakaExtern.RetryParameters} */\n this.retryParams_ = retryParams;\n\n /** @private {?shakaExtern.ManifestDB} */\n this.manifest_ = null;\n\n /** @private {Promise} */\n this.promise_ = null;\n\n /**\n * The total number of bytes for segments that include a byte range.\n * @private {number}\n */\n this.givenBytesTotal_ = 0;\n\n /**\n * The number of bytes downloaded for segments that include a byte range.\n * @private {number}\n */\n this.givenBytesDownloaded_ = 0;\n\n /**\n * The total number of bytes estimated based on bandwidth for segments that\n * do not include a byte range.\n * @private {number}\n */\n this.bandwidthBytesTotal_ = 0;\n\n /**\n * The estimated number of bytes downloaded for segments that do not have\n * a byte range.\n * @private {number}\n */\n this.bandwidthBytesDownloaded_ = 0;\n};\n\n\n/**\n * @typedef {{\n * uris: !Array.<string>,\n * startByte: number,\n * endByte: ?number,\n * bandwidthSize: number,\n * segmentDb: shakaExtern.SegmentDataDB\n * }}\n *\n * @property {!Array.<string>} uris\n * The URIs to download the segment.\n * @property {number} startByte\n * The byte index the segment starts at.\n * @property {?number} endByte\n * The byte index the segment ends at, if present.\n * @property {number} bandwidthSize\n * The size of the segment as estimated by the bandwidth and segment duration.\n * @property {shakaExtern.SegmentDataDB} segmentDb\n * The data to store in the database.\n */\nshaka.offline.DownloadManager.Segment;\n\n\n/** @override */\nshaka.offline.DownloadManager.prototype.destroy = function() {\n var storage = this.storageEngine_;\n var segments = this.storedSegments_;\n var p = this.promise_ || Promise.resolve();\n p = p.then(function() { return storage.removeKeys('segment', segments); });\n\n // Don't destroy() storageEngine since it is owned by Storage.\n\n this.segments_ = {};\n this.storedSegments_ = [];\n this.config_ = null;\n this.storageEngine_ = null;\n this.netEngine_ = null;\n this.retryParams_ = null;\n this.manifest_ = null;\n this.promise_ = null;\n return p;\n};\n\n\n/**\n * Adds a segment to the list to be downloaded.\n *\n * @param {string} type\n * @param {!shaka.media.SegmentReference|!shaka.media.InitSegmentReference} ref\n * @param {number} bandwidthSize\n * @param {shakaExtern.SegmentDataDB} segmentDb\n * The data to store in the database with the data. The |data| field of this\n * object will contain the downloaded data.\n */\nshaka.offline.DownloadManager.prototype.addSegment = function(\n type, ref, bandwidthSize, segmentDb) {\n this.segments_[type] = this.segments_[type] || [];\n this.segments_[type].push({\n uris: ref.getUris(),\n startByte: ref.startByte,\n endByte: ref.endByte,\n bandwidthSize: bandwidthSize,\n segmentDb: segmentDb\n });\n};\n\n\n/**\n * Downloads all the segments, stores them in the database, and stores the given\n * manifest object.\n *\n * @param {shakaExtern.ManifestDB} manifest\n * @return {!Promise}\n */\nshaka.offline.DownloadManager.prototype.downloadAndStore = function(manifest) {\n var MapUtils = shaka.util.MapUtils;\n // Calculate progress estimates.\n this.givenBytesTotal_ = 0;\n this.givenBytesDownloaded_ = 0;\n this.bandwidthBytesTotal_ = 0;\n this.bandwidthBytesDownloaded_ = 0;\n MapUtils.values(this.segments_).forEach(function(segments) {\n segments.forEach(function(segment) {\n if (segment.endByte != null)\n this.givenBytesTotal_ += (segment.endByte - segment.startByte + 1);\n else\n this.bandwidthBytesTotal_ += segment.bandwidthSize;\n }.bind(this));\n }.bind(this));\n\n this.manifest_ = manifest;\n // Will be updated as we download for segments without a byte-range.\n this.manifest_.size = this.givenBytesTotal_;\n\n // Create separate download chains for different content types. This will\n // allow audio and video to be downloaded in parallel.\n var async = MapUtils.values(this.segments_).map(function(segments) {\n var i = 0;\n var downloadNext = (function() {\n if (!this.config_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n if (i >= segments.length) return Promise.resolve();\n var segment = segments[i++];\n return this.downloadSegment_(segment).then(downloadNext);\n }.bind(this));\n return downloadNext();\n }.bind(this));\n this.segments_ = {};\n\n this.promise_ = Promise.all(async).then(function() {\n return this.storageEngine_.insert('manifest', manifest);\n }.bind(this)).then(function() {\n this.storedSegments_ = [];\n }.bind(this));\n return this.promise_;\n};\n\n\n/**\n * Downloads the given segment and calls the callback.\n *\n * @param {shaka.offline.DownloadManager.Segment} segment\n * @return {!Promise}\n * @private\n */\nshaka.offline.DownloadManager.prototype.downloadSegment_ = function(segment) {\n goog.asserts.assert(this.retryParams_, 'Must not be destroyed');\n var type = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n var request =\n shaka.net.NetworkingEngine.makeRequest(segment.uris, this.retryParams_);\n if (segment.startByte != 0 || segment.endByte != null) {\n var end = segment.endByte == null ? '' : segment.endByte;\n request.headers['Range'] = 'bytes=' + segment.startByte + '-' + end;\n }\n\n var byteCount;\n return this.netEngine_.request(type, request)\n .then(function(response) {\n if (!this.manifest_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n byteCount = response.data.byteLength;\n\n this.storedSegments_.push(segment.segmentDb.key);\n segment.segmentDb.data = response.data;\n return this.storageEngine_.insert('segment', segment.segmentDb);\n }.bind(this))\n .then(function() {\n if (!this.manifest_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n if (segment.endByte == null) {\n // We didn't know the size, so it was an estimate.\n this.manifest_.size += byteCount;\n this.bandwidthBytesDownloaded_ += segment.bandwidthSize;\n } else {\n goog.asserts.assert(\n byteCount == (segment.endByte - segment.startByte + 1),\n 'Incorrect download size');\n this.givenBytesDownloaded_ += byteCount;\n }\n this.updateProgress_();\n }.bind(this));\n};\n\n\n/**\n * Calls the progress callback.\n * @private\n */\nshaka.offline.DownloadManager.prototype.updateProgress_ = function() {\n var progress = (this.givenBytesDownloaded_ + this.bandwidthBytesDownloaded_) /\n (this.givenBytesTotal_ + this.bandwidthBytesTotal_);\n\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n var manifest = shaka.offline.OfflineUtils.getStoredContent(this.manifest_);\n this.config_.progressCallback(manifest, progress);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/download_manager.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.OfflineUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.offline.DBEngine');\ngoog.require('shaka.offline.IStorageEngine');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\n\n\n/** @const {!Object.<string, string>} */\nshaka.offline.OfflineUtils.DB_SCHEME = {'manifest': 'key', 'segment': 'key'};\n\n\n/**\n * Converts the given database manifest to a storedContent structure.\n *\n * @param {shakaExtern.ManifestDB} manifest\n * @return {shakaExtern.StoredContent}\n */\nshaka.offline.OfflineUtils.getStoredContent = function(manifest) {\n goog.asserts.assert(manifest.periods.length > 0,\n 'Must be at least one Period.');\n\n // Reconstruct the first period to get the variants\n var timeline = new shaka.media.PresentationTimeline(null, 0);\n var period = shaka.offline.OfflineUtils.reconstructPeriod(\n manifest.periods[0], [], timeline);\n\n var tracks = shaka.util.StreamUtils.getVariantTracks(period, null, null);\n var textTracks = shaka.util.StreamUtils.getTextTracks(period, null);\n\n tracks.push.apply(tracks, textTracks);\n\n return {\n offlineUri: 'offline:' + manifest.key,\n originalManifestUri: manifest.originalManifestUri,\n duration: manifest.duration,\n size: manifest.size,\n expiration: manifest.expiration == undefined ? Infinity :\n manifest.expiration,\n tracks: tracks,\n appMetadata: manifest.appMetadata\n };\n};\n\n\n/**\n * Reconstructs a period object from the given database period.\n *\n * @param {shakaExtern.PeriodDB} period\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @param {shaka.media.PresentationTimeline} timeline\n * @return {shakaExtern.Period}\n */\nshaka.offline.OfflineUtils.reconstructPeriod = function(\n period, drmInfos, timeline) {\n var OfflineUtils = shaka.offline.OfflineUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var textStreamsDb = period.streams.filter(function(streamDb) {\n return streamDb.contentType == ContentType.TEXT;\n });\n\n var audioStreamsDb = period.streams.filter(function(streamDb) {\n return streamDb.contentType == ContentType.AUDIO;\n });\n\n var videoStreamsDb = period.streams.filter(function(streamDb) {\n return streamDb.contentType == ContentType.VIDEO;\n });\n\n var variants =\n OfflineUtils.createVariants_(audioStreamsDb, videoStreamsDb, drmInfos);\n var textStreams = textStreamsDb.map(OfflineUtils.createStream_);\n\n period.streams.forEach(function(streamDb) {\n var refs = OfflineUtils.getSegmentReferences_(streamDb);\n timeline.notifySegments(period.startTime, refs);\n });\n\n return {\n startTime: period.startTime,\n variants: variants,\n textStreams: textStreams\n };\n};\n\n\n/**\n * @param {!shakaExtern.StreamDB} streamDb\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.offline.OfflineUtils.getSegmentReferences_ = function(streamDb) {\n return streamDb.segments.map(function(segment, i) {\n var getUris = function() { return [segment.uri]; };\n return new shaka.media.SegmentReference(\n i, segment.startTime, segment.endTime, getUris, 0, null);\n });\n};\n\n\n/**\n * Creates Variants from audio and video StreamDB collections.\n *\n * @param {!Array.<!shakaExtern.StreamDB>} audios\n * @param {!Array.<!shakaExtern.StreamDB>} videos\n * @param {!Array.<!shakaExtern.DrmInfo>} drmInfos\n * @return {!Array.<!shakaExtern.Variant>}\n * @private\n */\nshaka.offline.OfflineUtils.createVariants_ = function(\n audios, videos, drmInfos) {\n var variants = [];\n if (!audios.length && !videos.length) return variants;\n\n // Create a single null element so the double loop will work for audio-only or\n // video-only variants.\n if (!audios.length) {\n audios = [null];\n } else if (!videos.length) {\n videos = [null];\n }\n\n var OfflineUtils = shaka.offline.OfflineUtils;\n var id = 0;\n for (var i = 0; i < audios.length; i++) {\n for (var j = 0; j < videos.length; j++) {\n if (OfflineUtils.areCompatible_(audios[i], videos[j])) {\n var variant =\n OfflineUtils.createVariant_(audios[i], videos[j], drmInfos, id++);\n variants.push(variant);\n }\n }\n }\n\n return variants;\n};\n\n\n/**\n * Checks if two streams can be combined into a variant.\n *\n * @param {?shakaExtern.StreamDB} stream1\n * @param {?shakaExtern.StreamDB} stream2\n * @return {boolean}\n * @private\n */\nshaka.offline.OfflineUtils.areCompatible_ = function(stream1, stream2) {\n // Treat content that doesn't have variantIds as compatible\n // with anything for compatibility with content stored before\n // the variants were introduced.\n if (!stream1 || !stream2 || !stream1.variantIds || !stream2.variantIds)\n return true;\n\n for (var i = 0; i < stream1.variantIds.length; i++) {\n var containsId = stream2.variantIds.some(function(id) {\n return id == stream1.variantIds[i];\n });\n if (containsId) {\n return true;\n }\n }\n\n return false;\n};\n\n\n/**\n * Creates a Variant from an audio and a video StreamDBs.\n * If one of the streams is null, it creates a Variant from the other.\n *\n * @param {?shakaExtern.StreamDB} audio\n * @param {?shakaExtern.StreamDB} video\n * @param {!Array.<!shakaExtern.DrmInfo>} drmInfos\n * @param {number} id\n * @return {!shakaExtern.Variant}\n * @private\n */\nshaka.offline.OfflineUtils.createVariant_ = function(\n audio, video, drmInfos, id) {\n return {\n id: id,\n language: audio ? audio.language : '',\n // Use !! to get the compiler to use a boolean type. Otherwise it will\n // deduce the type as {boolean|shakaExtern.StreamDB} even though |audio|\n // will only be returned if it is falsy, so the type would be {boolean|null}\n primary: (!!audio && audio.primary) || (!!video && video.primary),\n audio: shaka.offline.OfflineUtils.createStream_(audio),\n video: shaka.offline.OfflineUtils.createStream_(video),\n bandwidth: 0,\n drmInfos: drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n};\n\n\n/**\n * Creates a shakaExtern.Stream from a StreamDB.\n *\n * @param {?shakaExtern.StreamDB} streamDb\n * @return {?shakaExtern.Stream}\n * @private\n */\nshaka.offline.OfflineUtils.createStream_ = function(streamDb) {\n if (!streamDb) return null;\n\n var refs =\n shaka.offline.OfflineUtils.getSegmentReferences_(streamDb);\n\n var segmentIndex = new shaka.media.SegmentIndex(refs);\n\n var initRef = streamDb.initSegmentUri ?\n new shaka.media.InitSegmentReference(\n function() { return [streamDb.initSegmentUri]; }, 0, null) :\n null;\n return {\n id: streamDb.id,\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex),\n initSegmentReference: initRef,\n presentationTimeOffset: streamDb.presentationTimeOffset,\n mimeType: streamDb.mimeType,\n codecs: streamDb.codecs,\n width: streamDb.width || undefined,\n height: streamDb.height || undefined,\n frameRate: streamDb.frameRate || undefined,\n kind: streamDb.kind,\n encrypted: streamDb.encrypted,\n keyId: streamDb.keyId,\n language: streamDb.language,\n label: streamDb.label || null,\n type: streamDb.contentType,\n primary: streamDb.primary,\n trickModeVideo: null,\n // TODO(modmaker): Store offline?\n containsEmsgBoxes: false,\n roles: []\n };\n};\n\n\n/**\n * Determines if this platform supports any form of storage engine.\n * @return {boolean}\n */\nshaka.offline.OfflineUtils.isStorageEngineSupported = function() {\n return shaka.offline.DBEngine.isSupported();\n};\n\n\n/**\n * Create a new instance of the supported storage engine. The created instance\n * will be uninitialized. If this platform does not support any storage\n * engines, this function will return null.\n * @return {shaka.offline.IStorageEngine}\n */\nshaka.offline.OfflineUtils.createStorageEngine = function() {\n return shaka.offline.DBEngine.isSupported() ?\n new shaka.offline.DBEngine() :\n null;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/offline_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.OfflineManifestParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.Error');\n\n\n\n/**\n * Creates a new offline manifest parser.\n * @struct\n * @constructor\n * @implements {shakaExtern.ManifestParser}\n */\nshaka.offline.OfflineManifestParser = function() {\n /** @private {number} */\n this.manifestId_ = -1;\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.configure = function(config) {\n // No-op\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.start =\n function(uri, playerInterface) {\n var parts = /^offline:([0-9]+)$/.exec(uri);\n if (!parts) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_OFFLINE_URI, uri));\n }\n var manifestId = Number(parts[1]);\n var storageEngine = shaka.offline.OfflineUtils.createStorageEngine();\n this.manifestId_ = manifestId;\n\n if (!storageEngine) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORAGE_NOT_SUPPORTED));\n }\n\n return storageEngine.init(shaka.offline.OfflineUtils.DB_SCHEME)\n .then(function() { return storageEngine.get('manifest', manifestId); })\n .then(function(manifest) {\n if (!manifest) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND, manifestId);\n }\n\n var OfflineManifestParser = shaka.offline.OfflineManifestParser;\n return OfflineManifestParser.reconstructManifest(manifest);\n })\n .then(\n function(ret) {\n return storageEngine.destroy().then(function() { return ret; });\n },\n function(err) {\n return storageEngine.destroy().then(function() { throw err; });\n });\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.stop = function() {\n return Promise.resolve();\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.update = function() {\n // No-op\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.onExpirationUpdated = function(\n sessionId, expiration) {\n var storageEngine = shaka.offline.OfflineUtils.createStorageEngine();\n goog.asserts.assert(storageEngine, 'Must support offline storage');\n\n storageEngine.init(shaka.offline.OfflineUtils.DB_SCHEME)\n .then(function() {\n return storageEngine.get('manifest', this.manifestId_);\n }.bind(this))\n .then(function(manifest) {\n if (!manifest) {\n // Manifest was deleted, ignore update.\n return;\n }\n if (manifest.sessionIds.indexOf(sessionId) < 0) {\n shaka.log.debug('Ignoring updated expiration for unknown session');\n return;\n }\n\n if (manifest.expiration == undefined ||\n manifest.expiration > expiration) {\n shaka.log.debug('Updating expiration for stored content');\n manifest.expiration = expiration;\n return storageEngine.insert('manifest', manifest);\n }\n })\n .catch(function(error) {\n shaka.log.error('Error updating offline manifest expiration', error);\n })\n .then(function() {\n return storageEngine.destroy();\n });\n};\n\n\n/**\n * Reconstructs a manifest object from the given database manifest.\n *\n * @param {shakaExtern.ManifestDB} manifest\n * @return {shakaExtern.Manifest}\n */\nshaka.offline.OfflineManifestParser.reconstructManifest = function(manifest) {\n var timeline = new shaka.media.PresentationTimeline(null, 0);\n timeline.setDuration(manifest.duration);\n var drmInfos = manifest.drmInfo ? [manifest.drmInfo] : [];\n return {\n presentationTimeline: timeline,\n minBufferTime: 10,\n offlineSessionIds: manifest.sessionIds,\n periods: manifest.periods.map(function(period) {\n return shaka.offline.OfflineUtils.reconstructPeriod(period,\n drmInfos,\n timeline);\n })\n };\n};\n\n\nshaka.media.ManifestParser.registerParserByMime(\n 'application/x-offline-manifest', shaka.offline.OfflineManifestParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/offline_manifest_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.OfflineScheme');\n\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.Error');\n\n\n/**\n * @namespace\n * @summary A plugin that handles requests for offline content.\n * @param {string} uri\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.offline.OfflineScheme = function(uri, request) {\n var manifestParts = /^offline:([0-9]+)$/.exec(uri);\n if (manifestParts) {\n /** @type {shakaExtern.Response} */\n var response = {\n uri: uri,\n data: new ArrayBuffer(0),\n headers: {'content-type': 'application/x-offline-manifest'}\n };\n return Promise.resolve(response);\n }\n\n var segmentParts = /^offline:[0-9]+\\/[0-9]+\\/([0-9]+)$/.exec(uri);\n if (segmentParts) {\n var segmentId = Number(segmentParts[1]);\n var scheme = shaka.offline.OfflineUtils.DB_SCHEME;\n var storageEngine = shaka.offline.OfflineUtils.createStorageEngine();\n\n if (!storageEngine) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORAGE_NOT_SUPPORTED));\n }\n\n return storageEngine.init(scheme)\n .then(function() { return storageEngine.get('segment', segmentId); })\n .then(function(segment) {\n return storageEngine.destroy().then(function() {\n if (!segment) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND, segmentId);\n }\n return {uri: uri, data: segment.data, headers: {}};\n });\n });\n }\n\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_OFFLINE_URI, uri));\n};\n\n\nshaka.net.NetworkingEngine.registerScheme(\n 'offline', shaka.offline.OfflineScheme);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/offline_scheme.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.CancelableChain');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.Error');\n\n\n\n/**\n * A Promise-based abstraction that creates cancelable Promise chains.\n * When canceled, subsequent stages of the internal Promise chain will stop.\n * A canceled chain is rejected with a user-specified value.\n *\n * A CancelableChain only supports linear Promise chains. Chains which branch\n * (more than one then() handler chained to a particular stage) are not\n * supported. You will not be prevented from treating this as if branching\n * were supported, but everything will be serialized into a linear chain.\n * Be careful!\n *\n * @constructor\n * @struct\n */\nshaka.util.CancelableChain = function() {\n /** @private {!Promise} */\n this.promise_ = Promise.resolve();\n\n /** @private {boolean} */\n this.final_ = false;\n\n /** @private {boolean} */\n this.complete_ = false;\n\n /** @private {boolean} */\n this.canceled_ = false;\n\n /** @private {shaka.util.Error} */\n this.rejectionValue_;\n\n /** @private {function()} */\n this.onCancelComplete_;\n\n /** @private {!Promise} */\n this.cancelPromise_ = new Promise(function(resolve) {\n this.onCancelComplete_ = resolve;\n }.bind(this));\n};\n\n\n/**\n * @param {function(*)} callback\n * @return {!shaka.util.CancelableChain} the chain itself.\n */\nshaka.util.CancelableChain.prototype.then = function(callback) {\n goog.asserts.assert(!this.final_, 'Chain should not be final!');\n\n this.promise_ = this.promise_.then(callback).then(function(data) {\n if (this.canceled_) {\n this.onCancelComplete_();\n return Promise.reject(this.rejectionValue_);\n }\n return Promise.resolve(data);\n }.bind(this));\n return this;\n};\n\n\n/**\n * Finalize the chain.\n * Converts the chain into a simple Promise and stops accepting new stages.\n *\n * @return {!Promise}\n */\nshaka.util.CancelableChain.prototype.finalize = function() {\n if (!this.final_) {\n this.promise_ = this.promise_.then(function(data) {\n this.complete_ = true;\n return Promise.resolve(data);\n }.bind(this), function(error) {\n this.complete_ = true;\n if (this.canceled_) {\n this.onCancelComplete_();\n return Promise.reject(this.rejectionValue_);\n }\n\n return Promise.reject(error);\n }.bind(this));\n }\n this.final_ = true;\n return this.promise_;\n};\n\n\n/**\n * Cancel the Promise chain and reject with the given value.\n *\n * @param {!shaka.util.Error} reason\n * @return {!Promise} resolved when the cancelation has been processed by the\n * the chain and no more stages will execute. Note that this may be before\n * the owner of the finalized chain has seen the rejection.\n */\nshaka.util.CancelableChain.prototype.cancel = function(reason) {\n if (this.complete_) return Promise.resolve();\n\n this.canceled_ = true;\n this.rejectionValue_ = reason;\n return this.cancelPromise_;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/cancelable_chain.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.Storage');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.Player');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.offline.DownloadManager');\ngoog.require('shaka.offline.IStorageEngine');\ngoog.require('shaka.offline.OfflineManifestParser');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.LanguageUtils');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * This manages persistent offline data including storage, listing, and deleting\n * stored manifests. Playback of offline manifests are done using Player\n * using the special URI (e.g. 'offline:12').\n *\n * First, check support() to see if offline is supported by the platform.\n * Second, configure() the storage object with callbacks to your application.\n * Third, call store(), remove(), or list() as needed.\n * When done, call destroy().\n *\n * @param {shaka.Player} player\n * The player instance to pull configuration data from.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n * @export\n */\nshaka.offline.Storage = function(player) {\n // It is an easy mistake to make to pass a Player proxy from CastProxy.\n // Rather than throw a vague exception later, throw an explicit and clear one\n // now.\n if (!player || player.constructor != shaka.Player) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.LOCAL_PLAYER_INSTANCE_REQUIRED);\n }\n\n /** @private {shaka.offline.IStorageEngine} */\n this.storageEngine_ = shaka.offline.OfflineUtils.createStorageEngine();\n\n /** @private {shaka.Player} */\n this.player_ = player;\n\n /** @private {?shakaExtern.OfflineConfiguration} */\n this.config_ = this.defaultConfig_();\n\n /** @private {shaka.media.DrmEngine} */\n this.drmEngine_ = null;\n\n /** @private {boolean} */\n this.storeInProgress_ = false;\n\n /** @private {Array.<shakaExtern.Track>} */\n this.firstPeriodTracks_ = null;\n\n /** @private {number} */\n this.manifestId_ = -1;\n\n /** @private {number} */\n this.duration_ = 0;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = null;\n\n var netEngine = player.getNetworkingEngine();\n goog.asserts.assert(netEngine, 'Player must not be destroyed');\n\n /** @private {shaka.offline.DownloadManager} */\n this.downloadManager_ = new shaka.offline.DownloadManager(\n this.storageEngine_, netEngine,\n player.getConfiguration().streaming.retryParameters, this.config_);\n};\n\n\n/**\n * Gets whether offline storage is supported. Returns true if offline storage\n * is supported for clear content. Support for offline storage of encrypted\n * content will not be determined until storage is attempted.\n *\n * @return {boolean}\n * @export\n */\nshaka.offline.Storage.support = function() {\n return shaka.offline.OfflineUtils.isStorageEngineSupported();\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.offline.Storage.prototype.destroy = function() {\n var storageEngine = this.storageEngine_;\n // Destroy the download manager first since it needs the StorageEngine to\n // clean up old segments.\n var ret = !this.downloadManager_ ?\n Promise.resolve() :\n this.downloadManager_.destroy()\n .catch(function() {})\n .then(function() {\n if (storageEngine) return storageEngine.destroy();\n });\n\n this.storageEngine_ = null;\n this.downloadManager_ = null;\n this.player_ = null;\n this.config_ = null;\n return ret;\n};\n\n\n/**\n * Sets configuration values for Storage. This is not associated with\n * Player.configure and will not change Player.\n *\n * There are two important callbacks configured here: one for download progress,\n * and one to decide which tracks to store.\n *\n * The default track selection callback will store the largest SD video track.\n * Provide your own callback to choose the tracks you want to store.\n *\n * @param {shakaExtern.OfflineConfiguration} config\n * @export\n */\nshaka.offline.Storage.prototype.configure = function(config) {\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n shaka.util.ConfigUtils.mergeConfigObjects(\n this.config_, config, this.defaultConfig_(), {}, '');\n};\n\n\n/**\n * Stores the given manifest. If the content is encrypted, and encrypted\n * content cannot be stored on this platform, the Promise will be rejected with\n * error code 6001, REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE.\n *\n * @param {string} manifestUri The URI of the manifest to store.\n * @param {!Object} appMetadata An arbitrary object from the application that\n * will be stored along-side the offline content. Use this for any\n * application-specific metadata you need associated with the stored content.\n * For details on the data types that can be stored here, please refer to\n * https://goo.gl/h62coS\n * @param {!shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * @return {!Promise.<shakaExtern.StoredContent>} A Promise to a structure\n * representing what was stored. The \"offlineUri\" member is the URI that\n * should be given to Player.load() to play this piece of content offline.\n * The \"appMetadata\" member is the appMetadata argument you passed to store().\n * @export\n */\nshaka.offline.Storage.prototype.store = function(\n manifestUri, appMetadata, opt_manifestParserFactory) {\n if (this.storeInProgress_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORE_ALREADY_IN_PROGRESS));\n }\n this.storeInProgress_ = true;\n\n /** @type {shakaExtern.ManifestDB} */\n var manifestDb;\n\n var error = null;\n var onError = function(e) { error = e; };\n return this.initIfNeeded_()\n .then(function() {\n this.checkDestroyed_();\n return this.loadInternal(\n manifestUri, onError, opt_manifestParserFactory);\n }.bind(this)).then((\n /**\n * @param {{manifest: shakaExtern.Manifest,\n * drmEngine: !shaka.media.DrmEngine}} data\n * @return {!Promise}\n */\n function(data) {\n this.checkDestroyed_();\n this.manifest_ = data.manifest;\n this.drmEngine_ = data.drmEngine;\n\n if (this.manifest_.presentationTimeline.isLive() ||\n this.manifest_.presentationTimeline.isInProgress()) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.CANNOT_STORE_LIVE_OFFLINE, manifestUri);\n }\n\n // Re-filter now that DrmEngine is initialized.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n\n this.manifestId_ = this.storageEngine_.reserveId('manifest');\n this.duration_ = 0;\n manifestDb = this.createOfflineManifest_(manifestUri, appMetadata);\n return this.downloadManager_.downloadAndStore(manifestDb);\n })\n .bind(this))\n .then(function() {\n this.checkDestroyed_();\n // Throw any errors from the manifest parser or DrmEngine.\n if (error)\n throw error;\n\n return this.cleanup_();\n }.bind(this))\n .then(function() {\n return shaka.offline.OfflineUtils.getStoredContent(manifestDb);\n }.bind(this))\n .catch(function(err) {\n var Functional = shaka.util.Functional;\n return this.cleanup_().catch(Functional.noop).then(function() {\n throw err;\n });\n }.bind(this));\n};\n\n\n/**\n * Removes the given stored content.\n *\n * @param {shakaExtern.StoredContent} content\n * @return {!Promise}\n * @export\n */\nshaka.offline.Storage.prototype.remove = function(content) {\n var uri = content.offlineUri;\n var parts = /^offline:([0-9]+)$/.exec(uri);\n if (!parts) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.MALFORMED_OFFLINE_URI, uri));\n }\n\n var error = null;\n var onError = function(e) {\n // Ignore errors if the session was already removed.\n if (e.code != shaka.util.Error.Code.OFFLINE_SESSION_REMOVED)\n error = e;\n };\n\n /** @type {shakaExtern.ManifestDB} */\n var manifestDb;\n /** @type {!shaka.media.DrmEngine} */\n var drmEngine;\n var manifestId = Number(parts[1]);\n return this.initIfNeeded_().then(function() {\n this.checkDestroyed_();\n return this.storageEngine_.get('manifest', manifestId);\n }.bind(this)).then((\n /**\n * @param {?shakaExtern.ManifestDB} data\n * @return {!Promise}\n */\n function(data) {\n this.checkDestroyed_();\n if (!data) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND, uri);\n }\n manifestDb = data;\n var manifest =\n shaka.offline.OfflineManifestParser.reconstructManifest(manifestDb);\n var netEngine = this.player_.getNetworkingEngine();\n goog.asserts.assert(netEngine, 'Player must not be destroyed');\n drmEngine = new shaka.media.DrmEngine(\n netEngine, onError, function() {}, function() {});\n drmEngine.configure(this.player_.getConfiguration().drm);\n return drmEngine.init(manifest, true /* isOffline */);\n })\n .bind(this)).then(function() {\n return drmEngine.removeSessions(manifestDb.sessionIds);\n }.bind(this)).then(function() {\n return drmEngine.destroy();\n }.bind(this)).then(function() {\n this.checkDestroyed_();\n if (error) throw error;\n var Functional = shaka.util.Functional;\n // Get every segment for every stream in the manifest.\n /** @type {!Array.<number>} */\n var segments = manifestDb.periods.map(function(period) {\n return period.streams.map(function(stream) {\n var segments = stream.segments.map(function(segment) {\n var parts = /^offline:[0-9]+\\/[0-9]+\\/([0-9]+)$/.exec(segment.uri);\n goog.asserts.assert(parts, 'Invalid offline URI');\n return Number(parts[1]);\n });\n if (stream.initSegmentUri) {\n var parts = /^offline:[0-9]+\\/[0-9]+\\/([0-9]+)$/.exec(\n stream.initSegmentUri);\n goog.asserts.assert(parts, 'Invalid offline URI');\n segments.push(Number(parts[1]));\n }\n return segments;\n }).reduce(Functional.collapseArrays, []);\n }).reduce(Functional.collapseArrays, []);\n\n // Delete all the segments.\n var deleteCount = 0;\n var segmentCount = segments.length;\n var callback = this.config_.progressCallback;\n\n return this.storageEngine_.removeKeys('segment', segments, function() {\n deleteCount++;\n callback(content, deleteCount / segmentCount);\n });\n\n }.bind(this)).then(function() {\n this.checkDestroyed_();\n this.config_.progressCallback(content, 1);\n return this.storageEngine_.remove('manifest', manifestId);\n }.bind(this));\n};\n\n\n/**\n * Lists all the stored content available.\n *\n * @return {!Promise.<!Array.<shakaExtern.StoredContent>>} A Promise to an\n * array of structures representing all stored content. The \"offlineUri\"\n * member of the structure is the URI that should be given to Player.load()\n * to play this piece of content offline. The \"appMetadata\" member is the\n * appMetadata argument you passed to store().\n * @export\n */\nshaka.offline.Storage.prototype.list = function() {\n /** @type {!Array.<shakaExtern.StoredContent>} */\n var storedContents = [];\n return this.initIfNeeded_()\n .then(function() {\n this.checkDestroyed_();\n return this.storageEngine_.forEach(\n 'manifest', function(/** shakaExtern.ManifestDB */ manifest) {\n storedContents.push(\n shaka.offline.OfflineUtils.getStoredContent(manifest));\n });\n }.bind(this))\n .then(function() { return storedContents; });\n};\n\n\n/**\n * Loads the given manifest, parses it, and constructs the DrmEngine. This\n * stops the manifest parser. This may be replaced by tests.\n *\n * @param {string} manifestUri\n * @param {function(*)} onError\n * @param {!shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * @return {!Promise.<{\n * manifest: shakaExtern.Manifest,\n * drmEngine: !shaka.media.DrmEngine\n * }>}\n */\nshaka.offline.Storage.prototype.loadInternal = function(\n manifestUri, onError, opt_manifestParserFactory) {\n\n var netEngine = /** @type {!shaka.net.NetworkingEngine} */ (\n this.player_.getNetworkingEngine());\n var config = this.player_.getConfiguration();\n\n /** @type {shakaExtern.Manifest} */\n var manifest;\n /** @type {!shaka.media.DrmEngine} */\n var drmEngine;\n /** @type {!shakaExtern.ManifestParser} */\n var manifestParser;\n\n var onKeyStatusChange = function() {};\n return shaka.media.ManifestParser\n .getFactory(\n manifestUri, netEngine, config.manifest.retryParameters,\n opt_manifestParserFactory)\n .then(function(factory) {\n this.checkDestroyed_();\n manifestParser = new factory();\n manifestParser.configure(config.manifest);\n\n var playerInterface = {\n networkingEngine: netEngine,\n filterPeriod: this.filterPeriod_.bind(this),\n onTimelineRegionAdded: function() {},\n onEvent: function() {},\n onError: onError\n };\n return manifestParser.start(manifestUri, playerInterface);\n }.bind(this))\n .then(function(data) {\n this.checkDestroyed_();\n manifest = data;\n drmEngine = new shaka.media.DrmEngine(\n netEngine, onError, onKeyStatusChange, function() {});\n drmEngine.configure(config.drm);\n return drmEngine.init(manifest, true /* isOffline */);\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return this.createSegmentIndex_(manifest);\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return drmEngine.createOrLoad();\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return manifestParser.stop();\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return {manifest: manifest, drmEngine: drmEngine};\n }.bind(this))\n .catch(function(error) {\n if (manifestParser)\n return manifestParser.stop().then(function() { throw error; });\n else\n throw error;\n });\n};\n\n\n/**\n * The default track selection function.\n *\n * @param {!Array.<shakaExtern.Track>} tracks\n * @return {!Array.<shakaExtern.Track>}\n * @private\n */\nshaka.offline.Storage.prototype.defaultTrackSelect_ = function(tracks) {\n var LanguageUtils = shaka.util.LanguageUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var selectedTracks = [];\n\n // Select variants with best language match.\n var audioLangPref = LanguageUtils.normalize(\n this.player_.getConfiguration().preferredAudioLanguage);\n var matchTypes = [\n LanguageUtils.MatchType.EXACT,\n LanguageUtils.MatchType.BASE_LANGUAGE_OKAY,\n LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY\n ];\n var allVariantTracks =\n tracks.filter(function(track) { return track.type == 'variant'; });\n // For each match type, get the tracks that match the audio preference for\n // that match type.\n var tracksByMatchType = matchTypes.map(function(match) {\n return allVariantTracks.filter(function(track) {\n var lang = LanguageUtils.normalize(track.language);\n return LanguageUtils.match(match, audioLangPref, lang);\n });\n });\n\n // Find the best match type that has any matches.\n var variantTracks;\n for (var i = 0; i < tracksByMatchType.length; i++) {\n if (tracksByMatchType[i].length) {\n variantTracks = tracksByMatchType[i];\n break;\n }\n }\n\n // Fall back to \"primary\" audio tracks, if present.\n if (!variantTracks) {\n var primaryTracks = allVariantTracks.filter(function(track) {\n return track.primary;\n });\n if (primaryTracks.length)\n variantTracks = primaryTracks;\n }\n\n // Otherwise, there is no good way to choose the language, so we don't choose\n // a language at all.\n if (!variantTracks) {\n variantTracks = allVariantTracks;\n // Issue a warning, but only if the content has multiple languages.\n // Otherwise, this warning would just be noise.\n var languages = allVariantTracks\n .map(function(track) { return track.language; })\n .filter(shaka.util.Functional.isNotDuplicate);\n if (languages.length > 1) {\n shaka.log.warning('Could not choose a good audio track based on ' +\n 'language preferences or primary tracks. An ' +\n 'arbitrary language will be stored!');\n }\n }\n\n // From previously selected variants, choose the SD ones (height <= 480).\n var tracksByHeight = variantTracks.filter(function(track) {\n return track.height && track.height <= 480;\n });\n\n // If variants don't have video or no video with height <= 480 was\n // found, proceed with the previously selected tracks.\n if (tracksByHeight.length) {\n // Sort by resolution, then select all variants which match the height\n // of the highest SD res. There may be multiple audio bitrates for the\n // same video resolution.\n tracksByHeight.sort(function(a, b) { return b.height - a.height; });\n variantTracks = tracksByHeight.filter(function(track) {\n return track.height == tracksByHeight[0].height;\n });\n }\n\n // Now sort by bandwidth.\n variantTracks.sort(function(a, b) { return a.bandwidth - b.bandwidth; });\n\n // In case there are multiple matches at different audio bitrates, select the\n // middle bandwidth one.\n if (variantTracks.length)\n selectedTracks.push(variantTracks[Math.floor(variantTracks.length / 2)]);\n\n // Since this default callback is used primarily by our own demo app and by\n // app developers who haven't thought about which tracks they want, we should\n // select all text tracks, regardless of language. This makes for a better\n // demo for us, and does not rely on user preferences for the unconfigured\n // app.\n selectedTracks.push.apply(selectedTracks, tracks.filter(function(track) {\n return track.type == ContentType.TEXT;\n }));\n\n return selectedTracks;\n};\n\n\n/**\n * @return {shakaExtern.OfflineConfiguration}\n * @private\n */\nshaka.offline.Storage.prototype.defaultConfig_ = function() {\n return {\n trackSelectionCallback: this.defaultTrackSelect_.bind(this),\n progressCallback: function(storedContent, percent) {\n // Reference arguments to keep closure from removing it.\n // If the argument is removed, it breaks our function length check\n // in mergeConfigObjects_().\n // NOTE: Chrome App Content Security Policy prohibits usage of new\n // Function().\n if (storedContent || percent) return null;\n }\n };\n};\n\n\n/**\n * Initializes the IStorageEngine if it is not already.\n *\n * @return {!Promise}\n * @private\n */\nshaka.offline.Storage.prototype.initIfNeeded_ = function() {\n if (!this.storageEngine_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORAGE_NOT_SUPPORTED));\n } else if (this.storageEngine_.initialized()) {\n return Promise.resolve();\n } else {\n var scheme = shaka.offline.OfflineUtils.DB_SCHEME;\n return this.storageEngine_.init(scheme);\n }\n};\n\n\n/**\n * @param {shakaExtern.Period} period\n * @private\n */\nshaka.offline.Storage.prototype.filterPeriod_ = function(period) {\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var activeStreams = {};\n if (this.firstPeriodTracks_) {\n var variantTracks = this.firstPeriodTracks_.filter(function(track) {\n return track.type == 'variant';\n });\n var variant = null;\n if (variantTracks.length)\n variant = StreamUtils.findVariantForTrack(period, variantTracks[0]);\n\n if (variant) {\n // Use the first variant as the container of \"active streams\". This\n // is then used to filter out the streams that are not compatible with it.\n // This ensures that in multi-Period content, all Periods have streams\n // with compatible MIME types.\n if (variant.video) activeStreams[ContentType.VIDEO] = variant.video;\n if (variant.audio) activeStreams[ContentType.AUDIO] = variant.audio;\n }\n }\n StreamUtils.filterPeriod(this.drmEngine_, activeStreams, period);\n StreamUtils.applyRestrictions(\n period, this.player_.getConfiguration().restrictions,\n /* maxHwRes */ { width: Infinity, height: Infinity });\n};\n\n\n/**\n * Cleans up the current store and destroys any objects. This object is still\n * usable after this.\n *\n * @return {!Promise}\n * @private\n */\nshaka.offline.Storage.prototype.cleanup_ = function() {\n var ret = this.drmEngine_ ? this.drmEngine_.destroy() : Promise.resolve();\n this.drmEngine_ = null;\n this.manifest_ = null;\n this.storeInProgress_ = false;\n this.firstPeriodTracks_ = null;\n this.manifestId_ = -1;\n return ret;\n};\n\n\n/**\n * Calls createSegmentIndex for all streams in the manifest.\n *\n * @param {shakaExtern.Manifest} manifest\n * @return {!Promise}\n * @private\n */\nshaka.offline.Storage.prototype.createSegmentIndex_ = function(manifest) {\n var Functional = shaka.util.Functional;\n var streams = manifest.periods\n .map(function(period) { return period.variants; })\n .reduce(Functional.collapseArrays, [])\n .map(function(variant) {\n var variantStreams = [];\n if (variant.audio) variantStreams.push(variant.audio);\n if (variant.video) variantStreams.push(variant.video);\n return variantStreams;\n })\n .reduce(Functional.collapseArrays, [])\n .filter(Functional.isNotDuplicate);\n\n var textStreams = manifest.periods\n .map(function(period) { return period.textStreams; })\n .reduce(Functional.collapseArrays, []);\n\n streams.push.apply(streams, textStreams);\n return Promise.all(\n streams.map(function(stream) { return stream.createSegmentIndex(); }));\n};\n\n\n/**\n * Creates an offline 'manifest' for the real manifest. This does not store\n * the segments yet, only adds them to the download manager through\n * createPeriod_.\n *\n * @param {string} originalManifestUri\n * @param {!Object} appMetadata\n * @return {shakaExtern.ManifestDB}\n * @private\n */\nshaka.offline.Storage.prototype.createOfflineManifest_ = function(\n originalManifestUri, appMetadata) {\n var periods = this.manifest_.periods.map(this.createPeriod_.bind(this));\n var drmInfo = this.drmEngine_.getDrmInfo();\n var sessions = this.drmEngine_.getSessionIds();\n if (drmInfo) {\n if (!sessions.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.NO_INIT_DATA_FOR_OFFLINE, originalManifestUri);\n }\n // Don't store init data since we have stored sessions.\n drmInfo.initData = [];\n }\n\n return {\n key: this.manifestId_,\n originalManifestUri: originalManifestUri,\n duration: this.duration_,\n size: 0,\n expiration: this.drmEngine_.getExpiration(),\n periods: periods,\n sessionIds: sessions,\n drmInfo: drmInfo,\n appMetadata: appMetadata\n };\n};\n\n\n/**\n * Converts a manifest Period to a database Period. This will use the current\n * configuration to get the tracks to use, then it will search each segment\n * index and add all the segments to the download manager through createStream_.\n *\n * @param {shakaExtern.Period} period\n * @return {shakaExtern.PeriodDB}\n * @private\n */\nshaka.offline.Storage.prototype.createPeriod_ = function(period) {\n var StreamUtils = shaka.util.StreamUtils;\n\n var variantTracks = StreamUtils.getVariantTracks(period, null, null);\n var textTracks = StreamUtils.getTextTracks(period, null);\n var allTracks = variantTracks.concat(textTracks);\n\n var chosenTracks = this.config_.trackSelectionCallback(allTracks);\n\n if (this.firstPeriodTracks_ == null) {\n this.firstPeriodTracks_ = chosenTracks;\n // Now that the first tracks are chosen, filter again. This ensures all\n // Periods have compatible content types.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n }\n\n for (var i = chosenTracks.length - 1; i > 0; --i) {\n var foundSimilarTracks = false;\n for (var j = i - 1; j >= 0; --j) {\n if (chosenTracks[i].type == chosenTracks[j].type &&\n chosenTracks[i].kind == chosenTracks[j].kind &&\n chosenTracks[i].language == chosenTracks[j].language) {\n shaka.log.warning(\n 'Multiple tracks of the same type/kind/language given.');\n foundSimilarTracks = true;\n break;\n }\n }\n if (foundSimilarTracks) break;\n }\n\n var streams = [];\n\n for (var i = 0; i < chosenTracks.length; i++) {\n var variant = StreamUtils.findVariantForTrack(period, chosenTracks[i]);\n if (variant) {\n // Make a rough estimation of the streams' bandwidth so download manager\n // can track the progress of the download.\n var bandwidthEstimation;\n if (variant.audio) {\n // If the audio stream has already been added to the DB\n // as part of another variant, add the ID to the list.\n // Otherwise, add it to the DB.\n var stream = streams.filter(function(s) {\n return s.id == variant.audio.id;\n })[0];\n if (stream) {\n stream.variantIds.push(variant.id);\n } else {\n // If variant has both audio and video, roughly estimate them\n // both to be 1/2 of the variant's bandwidth.\n // If variant only has one stream, it's bandwidth equals to\n // the bandwidth of the variant.\n bandwidthEstimation =\n variant.video ? variant.bandwidth / 2 : variant.bandwidth;\n streams.push(this.createStream_(period,\n variant.audio,\n bandwidthEstimation,\n variant.id));\n }\n }\n if (variant.video) {\n var stream = streams.filter(function(s) {\n return s.id == variant.video.id;\n })[0];\n if (stream) {\n stream.variantIds.push(variant.id);\n } else {\n bandwidthEstimation =\n variant.audio ? variant.bandwidth / 2 : variant.bandwidth;\n streams.push(this.createStream_(period,\n variant.video,\n bandwidthEstimation,\n variant.id));\n }\n }\n } else {\n var textStream =\n StreamUtils.findTextStreamForTrack(period, chosenTracks[i]);\n goog.asserts.assert(\n textStream, 'Could not find track with id ' + chosenTracks[i].id);\n streams.push(this.createStream_(\n period, textStream, 0 /* estimatedStreamBandwidth */));\n }\n }\n\n return {\n startTime: period.startTime,\n streams: streams\n };\n};\n\n\n/**\n * Converts a manifest stream to a database stream. This will search the\n * segment index and add all the segments to the download manager.\n *\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Stream} stream\n * @param {number} estimatedStreamBandwidth\n * @param {number=} opt_variantId\n * @return {shakaExtern.StreamDB}\n * @private\n */\nshaka.offline.Storage.prototype.createStream_ = function(\n period, stream, estimatedStreamBandwidth, opt_variantId) {\n /** @type {!Array.<shakaExtern.SegmentDB>} */\n var segmentsDb = [];\n var startTime =\n this.manifest_.presentationTimeline.getSegmentAvailabilityStart();\n var endTime = startTime;\n var i = stream.findSegmentPosition(startTime);\n var ref = (i != null ? stream.getSegmentReference(i) : null);\n while (ref) {\n var id = this.storageEngine_.reserveId('segment');\n var bandwidthSize =\n (ref.endTime - ref.startTime) * estimatedStreamBandwidth / 8;\n\n /** @type {shakaExtern.SegmentDataDB} */\n var segmentDataDb = {\n key: id,\n data: null,\n manifestKey: this.manifestId_,\n streamNumber: stream.id,\n segmentNumber: id\n };\n this.downloadManager_.addSegment(\n stream.type, ref, bandwidthSize, segmentDataDb);\n\n segmentsDb.push({\n startTime: ref.startTime,\n endTime: ref.endTime,\n uri: 'offline:' + this.manifestId_ + '/' + stream.id + '/' + id\n });\n\n endTime = ref.endTime + period.startTime;\n ref = stream.getSegmentReference(++i);\n }\n\n this.duration_ = Math.max(this.duration_, (endTime - startTime));\n var initUri = null;\n if (stream.initSegmentReference) {\n var id = this.storageEngine_.reserveId('segment');\n initUri = 'offline:' + this.manifestId_ + '/' + stream.id + '/' + id;\n\n /** @type {shakaExtern.SegmentDataDB} */\n var initDataDb = {\n key: id,\n data: null,\n manifestKey: this.manifestId_,\n streamNumber: stream.id,\n segmentNumber: -1\n };\n\n this.downloadManager_.addSegment(\n stream.contentType, stream.initSegmentReference, 0, initDataDb);\n }\n\n var variantIds = [];\n if (opt_variantId != null) variantIds.push(opt_variantId);\n\n return {\n id: stream.id,\n primary: stream.primary,\n presentationTimeOffset: stream.presentationTimeOffset || 0,\n contentType: stream.type,\n mimeType: stream.mimeType,\n codecs: stream.codecs,\n frameRate: stream.frameRate,\n kind: stream.kind,\n language: stream.language,\n label: stream.label,\n width: stream.width || null,\n height: stream.height || null,\n initSegmentUri: initUri,\n encrypted: stream.encrypted,\n keyId: stream.keyId,\n segments: segmentsDb,\n variantIds: variantIds\n };\n};\n\n\n/**\n * Throws an error if the object is destroyed.\n * @private\n */\nshaka.offline.Storage.prototype.checkDestroyed_ = function() {\n if (!this.player_) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED);\n }\n};\n\n\nshaka.Player.registerSupportPlugin('offline', shaka.offline.Storage.support);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/storage.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.installAll');\ngoog.provide('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill\n * @summary A one-stop installer for all polyfills.\n * @see http://enwp.org/polyfill\n * @exportDoc\n */\n\n\n/**\n * Install all polyfills.\n * @export\n */\nshaka.polyfill.installAll = function() {\n for (var i = 0; i < shaka.polyfill.polyfills_.length; ++i) {\n shaka.polyfill.polyfills_[i]();\n }\n};\n\n\n/**\n * Contains the polyfills that will be installed.\n * @private {!Array.<function()>}\n */\nshaka.polyfill.polyfills_ = [];\n\n\n/**\n * Registers a new polyfill to be installed.\n *\n * @param {function()} polyfill\n * @export\n */\nshaka.polyfill.register = function(polyfill) {\n shaka.polyfill.polyfills_.push(polyfill);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/all.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.Fullscreen');\n\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.Fullscreen\n *\n * @summary A polyfill to unify fullscreen APIs across browsers.\n * Many browsers have prefixed fullscreen methods on Element and document.\n * See {@link http://goo.gl/n7TYl0 Using fullscreen mode} on MDN for more\n * information.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.Fullscreen.install = function() {\n if (!window.Document) {\n // Avoid errors on very old browsers.\n return;\n }\n\n var proto = Element.prototype;\n proto.requestFullscreen = proto.requestFullscreen ||\n proto.mozRequestFullScreen ||\n proto.msRequestFullscreen ||\n proto.webkitRequestFullscreen;\n\n proto = Document.prototype;\n proto.exitFullscreen = proto.exitFullscreen ||\n proto.mozCancelFullScreen ||\n proto.msExitFullscreen ||\n proto.webkitExitFullscreen;\n\n if (!('fullscreenElement' in document)) {\n Object.defineProperty(document, 'fullscreenElement', {\n get: function() {\n return document.mozFullScreenElement ||\n document.msFullscreenElement ||\n document.webkitFullscreenElement;\n }\n });\n Object.defineProperty(document, 'fullscreenEnabled', {\n get: function() {\n return document.mozFullScreenEnabled ||\n document.msFullscreenEnabled ||\n document.webkitFullscreenEnabled;\n }\n });\n }\n\n var proxy = shaka.polyfill.Fullscreen.proxyEvent_;\n document.addEventListener('webkitfullscreenchange', proxy);\n document.addEventListener('webkitfullscreenerror', proxy);\n document.addEventListener('mozfullscreenchange', proxy);\n document.addEventListener('mozfullscreenerror', proxy);\n document.addEventListener('MSFullscreenChange', proxy);\n document.addEventListener('MSFullscreenError', proxy);\n};\n\n\n/**\n * Proxy fullscreen events after changing their name.\n * @param {!Event} event\n * @private\n */\nshaka.polyfill.Fullscreen.proxyEvent_ = function(event) {\n var eventType = event.type.replace(/^(webkit|moz|MS)/, '').toLowerCase();\n\n var newEvent;\n // IE 11 does not have an Event constructor\n if (typeof(Event) === 'function') {\n newEvent = new Event(eventType, /** @type {EventInit} */(event));\n } else {\n newEvent = document.createEvent('Event');\n newEvent.initEvent(eventType, event.bubbles, event.cancelable);\n }\n\n event.target.dispatchEvent(newEvent);\n};\n\n\nshaka.polyfill.register(shaka.polyfill.Fullscreen.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/fullscreen.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.IndexedDB');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.IndexedDB\n *\n * @summary A polyfill to patch indexed db bugs.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.IndexedDB.install = function() {\n shaka.log.debug('IndexedDB.install');\n\n var agent = navigator.userAgent;\n if (agent && agent.indexOf('CrKey') >= 0) {\n shaka.log.debug('Removing IndexedDB from ChromeCast');\n delete window.indexedDB;\n goog.asserts.assert(\n !window.indexedDB, 'Failed to override window.indexedDB');\n }\n};\n\nshaka.polyfill.register(shaka.polyfill.IndexedDB.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/indexed_db.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\ngoog.provide('shaka.polyfill.MathRound');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n/**\n * @namespace shaka.polyfill.MathRound\n *\n * @summary A polyfill to patch math round bug on some browsers.\n */\n\n\n/**\n @const {number}\n @private\n */\nshaka.polyfill.MathRound.MAX_ACCURATE_INPUT_ = 0x10000000000000;\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.MathRound.install = function() {\n shaka.log.debug('mathRound.install');\n\n var testNumber = shaka.polyfill.MathRound.MAX_ACCURATE_INPUT_ + 1;\n if (Math.round(testNumber) != testNumber) {\n shaka.log.debug('polyfill Math.round');\n var original_mathRound = Math.round;\n Math.round = function(number) {\n var result = number;\n // https://stackoverflow.com/questions/12830742/javascript-math-round-bug-in-ie\n // Due to the precision of JavaScript numbers, the number must be integer\n if (number <= shaka.polyfill.MathRound.MAX_ACCURATE_INPUT_) {\n result = original_mathRound(number);\n }\n return result;\n };\n }\n};\n\nshaka.polyfill.register(shaka.polyfill.MathRound.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/mathround.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Pssh');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Mp4Parser');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n\n/**\n * Parse a PSSH box and extract the system IDs.\n *\n * @param {!Uint8Array} psshBox\n * @constructor\n * @struct\n * @throws {shaka.util.Error} if a PSSH box is truncated or contains a size\n * field over 53 bits.\n */\nshaka.util.Pssh = function(psshBox) {\n /**\n * In hex.\n * @type {!Array.<string>}\n */\n this.systemIds = [];\n\n /**\n * In hex.\n * @type {!Array.<string>}\n */\n this.cencKeyIds = [];\n\n /*\n * Array of tuples that define the startIndex + size for each\n * discrete pssh within |psshBox|\n * */\n this.dataBoundaries = [];\n\n new shaka.util.Mp4Parser()\n .fullBox('pssh', this.parseBox_.bind(this)).parse(psshBox.buffer);\n\n if (this.dataBoundaries.length == 0) {\n shaka.log.warning('No pssh box found!');\n }\n};\n\n\n/**\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @private\n */\nshaka.util.Pssh.prototype.parseBox_ = function(box) {\n goog.asserts.assert(\n box.version != null,\n 'PSSH boxes are full boxes and must have a valid version');\n\n goog.asserts.assert(\n box.flags != null,\n 'PSSH boxes are full boxes and must have a valid flag');\n\n if (box.version > 1) {\n shaka.log.warning('Unrecognized PSSH version found!');\n return;\n }\n\n var systemId = shaka.util.Uint8ArrayUtils.toHex(box.reader.readBytes(16));\n var keyIds = [];\n if (box.version > 0) {\n var numKeyIds = box.reader.readUint32();\n for (var i = 0; i < numKeyIds; ++i) {\n var keyId = shaka.util.Uint8ArrayUtils.toHex(box.reader.readBytes(16));\n keyIds.push(keyId);\n }\n }\n\n var dataSize = box.reader.readUint32();\n box.reader.skip(dataSize); // Ignore the data section.\n\n // Now that everything has been succesfully parsed from this box,\n // update member variables.\n this.cencKeyIds.push.apply(this.cencKeyIds, keyIds);\n this.systemIds.push(systemId);\n this.dataBoundaries.push({\n start: box.start,\n end: box.start + box.size - 1\n });\n\n if (box.reader.getPosition() != box.reader.getLength()) {\n shaka.log.warning('Mismatch between box size and data size!');\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/pssh.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.PatchedMediaKeysMs');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.ArrayUtils');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.Pssh');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * Install a polyfill to implement {@link http://goo.gl/blgtZZ EME draft\n * 12 March 2015} on top of ms-prefixed\n * {@link http://www.w3.org/TR/2014/WD-encrypted-media-20140218/ EME v20140218}.\n */\nshaka.polyfill.PatchedMediaKeysMs.install = function() {\n shaka.log.debug('PatchedMediaKeysMs.install');\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n // Construct fake key ID. This is not done at load-time to avoid exceptions\n // on unsupported browsers. This particular fake key ID was suggested in\n // w3c/encrypted-media#32.\n PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_ = (new Uint8Array([0])).buffer;\n\n // Delete mediaKeys to work around strict mode compatibility issues.\n delete HTMLMediaElement.prototype['mediaKeys'];\n // Work around read-only declaration for mediaKeys by using a string.\n HTMLMediaElement.prototype['mediaKeys'] = null;\n HTMLMediaElement.prototype.setMediaKeys = PatchedMediaKeysMs.setMediaKeys;\n\n // Install patches\n window.MediaKeys = PatchedMediaKeysMs.MediaKeys;\n window.MediaKeySystemAccess = PatchedMediaKeysMs.MediaKeySystemAccess;\n navigator.requestMediaKeySystemAccess =\n PatchedMediaKeysMs.requestMediaKeySystemAccess;\n};\n\n\n/**\n * An implementation of navigator.requestMediaKeySystemAccess.\n * Retrieve a MediaKeySystemAccess object.\n *\n * @this {!Navigator}\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @return {!Promise.<!MediaKeySystemAccess>}\n */\nshaka.polyfill.PatchedMediaKeysMs.requestMediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysMs.requestMediaKeySystemAccess');\n goog.asserts.assert(this == navigator,\n 'bad \"this\" for requestMediaKeySystemAccess');\n\n // Alias.\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n try {\n var access = new PatchedMediaKeysMs.MediaKeySystemAccess(\n keySystem, supportedConfigurations);\n return Promise.resolve(/** @type {!MediaKeySystemAccess} */ (access));\n } catch (exception) {\n return Promise.reject(exception);\n }\n};\n\n\n\n/**\n * An implementation of MediaKeySystemAccess.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @implements {MediaKeySystemAccess}\n * @throws {Error} if the key system is not supported.\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySystemAccess');\n\n /** @type {string} */\n this.keySystem = keySystem;\n\n /** @private {!MediaKeySystemConfiguration} */\n this.configuration_;\n\n var allowPersistentState = true;\n\n var success = false;\n for (var i = 0; i < supportedConfigurations.length; ++i) {\n var cfg = supportedConfigurations[i];\n\n // Create a new config object and start adding in the pieces which we\n // find support for. We will return this from getConfiguration() if\n // asked.\n /** @type {!MediaKeySystemConfiguration} */\n var newCfg = {\n 'audioCapabilities': [],\n 'videoCapabilities': [],\n // It is technically against spec to return these as optional, but we\n // don't truly know their values from the prefixed API:\n 'persistentState': 'optional',\n 'distinctiveIdentifier': 'optional',\n // Pretend the requested init data types are supported, since we don't\n // really know that either:\n 'initDataTypes': cfg.initDataTypes,\n 'sessionTypes': ['temporary'],\n 'label': cfg.label\n };\n\n // PatchedMediaKeysMs tests for key system availability through\n // MSMediaKeys.isTypeSupported\n var ranAnyTests = false;\n if (cfg.audioCapabilities) {\n for (var j = 0; j < cfg.audioCapabilities.length; ++j) {\n var cap = cfg.audioCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n var contentType = cap.contentType.split(';')[0];\n if (MSMediaKeys.isTypeSupported(this.keySystem, contentType)) {\n newCfg.audioCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n if (cfg.videoCapabilities) {\n for (var j = 0; j < cfg.videoCapabilities.length; ++j) {\n var cap = cfg.videoCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n var contentType = cap.contentType.split(';')[0];\n if (MSMediaKeys.isTypeSupported(this.keySystem, contentType)) {\n newCfg.videoCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n\n if (!ranAnyTests) {\n // If no specific types were requested, we check all common types to find\n // out if the key system is present at all.\n success = MSMediaKeys.isTypeSupported(this.keySystem, 'video/mp4');\n }\n if (cfg.persistentState == 'required') {\n if (allowPersistentState) {\n newCfg.persistentState = 'required';\n newCfg.sessionTypes = ['persistent-license'];\n } else {\n success = false;\n }\n }\n\n if (success) {\n this.configuration_ = newCfg;\n return;\n }\n } // for each cfg in supportedConfigurations\n\n // As per the spec, this should be a DOMException, but\n // there is not a public constructor for this\n var unsupportedKeySystemError = new Error('Unsupported keySystem');\n unsupportedKeySystemError.name = 'NotSupportedError';\n unsupportedKeySystemError.code = DOMException.NOT_SUPPORTED_ERR;\n throw unsupportedKeySystemError;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.\n createMediaKeys = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySystemAccess.createMediaKeys');\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n var mediaKeys = new PatchedMediaKeysMs.MediaKeys(this.keySystem);\n return Promise.resolve(/** @type {!MediaKeys} */ (mediaKeys));\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.\n getConfiguration = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySystemAccess.getConfiguration');\n return this.configuration_;\n};\n\n\n/**\n * An implementation of HTMLMediaElement.prototype.setMediaKeys.\n * Attach a MediaKeys object to the media element.\n *\n * @this {!HTMLMediaElement}\n * @param {MediaKeys} mediaKeys\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysMs.setMediaKeys = function(mediaKeys) {\n shaka.log.debug('PatchedMediaKeysMs.setMediaKeys');\n goog.asserts.assert(this instanceof HTMLMediaElement,\n 'bad \"this\" for setMediaKeys');\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n var newMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysMs.MediaKeys} */ (\n mediaKeys);\n var oldMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysMs.MediaKeys} */ (\n this.mediaKeys);\n\n if (oldMediaKeys && oldMediaKeys != newMediaKeys) {\n goog.asserts.assert(oldMediaKeys instanceof PatchedMediaKeysMs.MediaKeys,\n 'non-polyfill instance of oldMediaKeys');\n // Have the old MediaKeys stop listening to events on the video tag.\n oldMediaKeys.setMedia(null);\n }\n\n delete this['mediaKeys']; // in case there is an existing getter\n this['mediaKeys'] = mediaKeys; // work around read-only declaration\n\n if (newMediaKeys) {\n goog.asserts.assert(newMediaKeys instanceof PatchedMediaKeysMs.MediaKeys,\n 'non-polyfill instance of newMediaKeys');\n return newMediaKeys.setMedia(this);\n }\n\n return Promise.resolve();\n};\n\n\n\n/**\n * An implementation of MediaKeys.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @implements {MediaKeys}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys = function(keySystem) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeys');\n\n /** @private {!MSMediaKeys} */\n this.nativeMediaKeys_ = new MSMediaKeys(keySystem);\n\n /** @private {!shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.\n createSession = function(opt_sessionType) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeys.createSession');\n\n var sessionType = opt_sessionType || 'temporary';\n // For now, only 'temporary' type is supported\n if (sessionType != 'temporary') {\n throw new TypeError('Session type ' + opt_sessionType +\n ' is unsupported on this platform.');\n }\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n return new PatchedMediaKeysMs.MediaKeySession(\n this.nativeMediaKeys_, sessionType);\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.\n setServerCertificate = function(serverCertificate) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeys.setServerCertificate');\n\n // There is no equivalent in PatchedMediaKeysMs, so return failure.\n return Promise.resolve(false);\n};\n\n\n/**\n * @param {HTMLMediaElement} media\n * @protected\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.\n setMedia = function(media) {\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n // Remove any old listeners.\n this.eventManager_.removeAll();\n\n // It is valid for media to be null, it's used to flag that event handlers\n // need to be cleaned up\n if (!media) {\n return Promise.resolve();\n }\n\n // Intercept and translate these prefixed EME events.\n this.eventManager_.listen(media, 'msneedkey',\n /** @type {shaka.util.EventManager.ListenerType} */\n (PatchedMediaKeysMs.onMsNeedKey_));\n\n var self = this;\n function setMediaKeysDeferred() {\n media.msSetMediaKeys(self.nativeMediaKeys_);\n media.removeEventListener('loadedmetadata', setMediaKeysDeferred);\n }\n\n // Wrap native HTMLMediaElement.msSetMediaKeys with Promise\n try {\n // IE11/Edge requires that readyState >=1 before mediaKeys can be set, so\n // check this and wait for loadedmetadata if we are not in the correct state\n if (media.readyState >= 1) {\n media.msSetMediaKeys(this.nativeMediaKeys_);\n } else {\n media.addEventListener('loadedmetadata', setMediaKeysDeferred);\n }\n\n return Promise.resolve();\n\n } catch (exception) {\n return Promise.reject(exception);\n }\n};\n\n\n\n/**\n * An implementation of MediaKeySession.\n *\n * @constructor\n * @struct\n * @param {MSMediaKeys} nativeMediaKeys\n * @param {string} sessionType\n * @implements {MediaKeySession}\n * @extends {shaka.util.FakeEventTarget}\n */\nshaka.polyfill.PatchedMediaKeysMs.\n MediaKeySession = function(nativeMediaKeys, sessionType) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession');\n shaka.util.FakeEventTarget.call(this);\n\n // Native MediaKeySession, which will be created in generateRequest\n /** @private {MSMediaKeySession} */\n this.nativeMediaKeySession_ = null;\n\n /** @private {MSMediaKeys} */\n this.nativeMediaKeys_ = nativeMediaKeys;\n\n // Promises that are resolved later\n /** @private {Promise} */\n this.generateRequestPromise_ = null;\n\n /** @private {Promise} */\n this.updatePromise_ = null;\n\n /** @private {!shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @type {string} */\n this.sessionId = '';\n\n /** @type {number} */\n this.expiration = NaN;\n\n /** @type {!shaka.util.PublicPromise} */\n this.closed = new shaka.util.PublicPromise();\n\n /** @type {!MediaKeyStatusMap} */\n this.keyStatuses =\n new shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap();\n};\ngoog.inherits(shaka.polyfill.PatchedMediaKeysMs.MediaKeySession,\n shaka.util.FakeEventTarget);\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n generateRequest = function(initDataType, initData) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.generateRequest');\n\n this.generateRequestPromise_ = new shaka.util.PublicPromise();\n\n try {\n // This EME spec version requires a MIME content type as the 1st param\n // to createSession, but doesn't seem to matter what the value is.\n\n // NOTE: IE11 takes either Uint8Array or ArrayBuffer, but Edge 12 only\n // accepts Uint8Array.\n this.nativeMediaKeySession_ = this.nativeMediaKeys_\n .createSession('video/mp4', new Uint8Array(initData), null);\n\n // Attach session event handlers here\n this.eventManager_.listen(this.nativeMediaKeySession_, 'mskeymessage',\n /** @type {shaka.util.EventManager.ListenerType} */\n (this.onMsKeyMessage_.bind(this)));\n this.eventManager_.listen(this.nativeMediaKeySession_, 'mskeyadded',\n /** @type {shaka.util.EventManager.ListenerType} */\n (this.onMsKeyAdded_.bind(this)));\n this.eventManager_.listen(this.nativeMediaKeySession_, 'mskeyerror',\n /** @type {shaka.util.EventManager.ListenerType} */\n (this.onMsKeyError_.bind(this)));\n\n this.updateKeyStatus_('status-pending');\n } catch (exception) {\n this.generateRequestPromise_.reject(exception);\n }\n\n return this.generateRequestPromise_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n load = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.load');\n\n return Promise.reject(new Error('MediaKeySession.load not yet supported'));\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n update = function(response) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.update');\n\n this.updatePromise_ = new shaka.util.PublicPromise();\n\n try {\n // Pass through to the native session.\n // NOTE: IE11 takes either Uint8Array or ArrayBuffer, but Edge 12 only\n // accepts Uint8Array.\n this.nativeMediaKeySession_.update(new Uint8Array(response));\n } catch (exception) {\n this.updatePromise_.reject(exception);\n }\n\n return this.updatePromise_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n close = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.close');\n\n try {\n // Pass through to the native session\n // NOTE: IE seems to have spec discrepancy here - v2010218 should have\n // MediaKeySession.release, but actually uses \"close\". The next version\n // of the spec is the initial Promise based one, so it's not the target spec\n // either.\n this.nativeMediaKeySession_.close();\n\n this.closed.resolve();\n this.eventManager_.removeAll();\n } catch (exception) {\n this.closed.reject(exception);\n }\n\n return this.closed;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n remove = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.remove');\n\n return Promise.reject(new Error('MediaKeySession.remove is only ' +\n 'applicable for persistent licenses, which are not supported on ' +\n 'this platform'));\n};\n\n\n/**\n * Handler for the native media elements msNeedKey event.\n *\n * @this {!HTMLMediaElement}\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.onMsNeedKey_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsNeedKey_', event);\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n // NOTE: Because \"this\" is a real EventTarget, on IE, the event we dispatch\n // here must also be a real Event.\n var event2 = /** @type {!CustomEvent} */(document.createEvent('CustomEvent'));\n event2.initCustomEvent('encrypted', false, false, null);\n event2.initDataType = 'cenc';\n event2.initData = PatchedMediaKeysMs.NormaliseInitData_(event.initData);\n\n this.dispatchEvent(event2);\n};\n\n\n/**\n * Normalise the initData array. This is to apply browser specific work-arounds,\n * e.g. removing duplicates which appears to occur intermittently when the\n * native msneedkey event fires (i.e. event.initData contains dupes).\n *\n * @param {?Uint8Array} initData\n * @private\n * @return {?Uint8Array}\n */\nshaka.polyfill.PatchedMediaKeysMs.\n NormaliseInitData_ = function(initData) {\n if (!initData) {\n return initData;\n }\n\n var pssh = new shaka.util.Pssh(initData);\n\n // If there is only a single pssh, return the original array\n if (pssh.dataBoundaries.length <= 1) {\n return initData;\n }\n\n var unfilteredInitDatas = [];\n for (var i = 0; i < pssh.dataBoundaries.length; i++) {\n var currPssh = initData.subarray(\n pssh.dataBoundaries[i].start,\n pssh.dataBoundaries[i].end + 1); // end is exclusive, hence the +1\n\n unfilteredInitDatas.push(currPssh);\n }\n\n // Dedupe psshData\n var dedupedInitDatas = shaka.util.ArrayUtils.removeDuplicates(\n unfilteredInitDatas,\n shaka.polyfill.PatchedMediaKeysMs.compareInitDatas_);\n\n var targetLength = 0;\n for (var i = 0; i < dedupedInitDatas.length; i++) {\n targetLength += dedupedInitDatas[i].length;\n }\n\n // Concat array of Uint8Arrays back into a single Uint8Array\n var normalisedInitData = new Uint8Array(targetLength);\n var offset = 0;\n for (var i = 0; i < dedupedInitDatas.length; i++) {\n normalisedInitData.set(dedupedInitDatas[i], offset);\n offset += dedupedInitDatas[i].length;\n }\n\n return normalisedInitData;\n};\n\n\n/**\n * @param {!Uint8Array} initDataA\n * @param {!Uint8Array} initDataB\n * @return {boolean}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.compareInitDatas_ =\n function(initDataA, initDataB) {\n return shaka.util.Uint8ArrayUtils.equal(initDataA, initDataB);\n};\n\n\n/**\n * Handler for the native keymessage event on MSMediaKeySession.\n *\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n onMsKeyMessage_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsKeyMessage_', event);\n\n // We can now resolve this.generateRequestPromise (it should be non-null)\n goog.asserts.assert(this.generateRequestPromise_,\n 'generateRequestPromise_ not set in onMsKeyMessage_');\n if (this.generateRequestPromise_) {\n this.generateRequestPromise_.resolve();\n this.generateRequestPromise_ = null;\n }\n\n var isNew = this.keyStatuses.getStatus() == undefined;\n\n var event2 = new shaka.util.FakeEvent('message', {\n messageType: isNew ? 'licenserequest' : 'licenserenewal',\n message: event.message.buffer\n });\n\n this.dispatchEvent(event2);\n};\n\n\n/**\n * Handler for the native keyadded event on MSMediaKeySession.\n *\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n onMsKeyAdded_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsKeyAdded_', event);\n\n // PlayReady's concept of persistent licenses makes emulation difficult here.\n // A license policy can say that the license persists, which causes the CDM to\n // store it for use in a later session. The result is that in IE11, the CDM\n // fires 'mskeyadded' without ever firing 'mskeymessage'.\n if (this.generateRequestPromise_) {\n shaka.log.debug('Simulating completion for a PR persistent license.');\n goog.asserts.assert(!this.updatePromise_,\n 'updatePromise_ and generateRequestPromise_ set in onMsKeyAdded_');\n this.updateKeyStatus_('usable');\n this.generateRequestPromise_.resolve();\n this.generateRequestPromise_ = null;\n return;\n }\n\n // We can now resolve this.updatePromise (it should be non-null)\n goog.asserts.assert(this.updatePromise_,\n 'updatePromise_ not set in onMsKeyAdded_');\n if (this.updatePromise_) {\n this.updateKeyStatus_('usable');\n this.updatePromise_.resolve();\n this.updatePromise_ = null;\n }\n};\n\n\n/**\n * Handler for the native keyerror event on MSMediaKeySession.\n *\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n onMsKeyError_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsKeyError_', event);\n\n var error = new Error('EME PatchedMediaKeysMs key error');\n error.errorCode = this.nativeMediaKeySession_.error;\n\n if (this.generateRequestPromise_ != null) {\n this.generateRequestPromise_.reject(error);\n this.generateRequestPromise_ = null;\n } else if (this.updatePromise_ != null) {\n this.updatePromise_.reject(error);\n this.updatePromise_ = null;\n } else {\n /*\n Unexpected error - map native codes to standardised key statuses.\n Possible values of this.nativeMediaKeySession_.error.code\n\n MS_MEDIA_KEYERR_UNKNOWN = 1\n MS_MEDIA_KEYERR_CLIENT = 2\n MS_MEDIA_KEYERR_SERVICE = 3\n MS_MEDIA_KEYERR_OUTPUT = 4\n MS_MEDIA_KEYERR_HARDWARECHANGE = 5\n MS_MEDIA_KEYERR_DOMAIN = 6\n */\n\n switch (this.nativeMediaKeySession_.error.code) {\n case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:\n case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:\n this.updateKeyStatus_('output-not-allowed');\n default:\n this.updateKeyStatus_('internal-error');\n }\n }\n};\n\n\n/**\n * Update key status and dispatch a 'keystatuseschange' event.\n *\n * @param {string} status\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n updateKeyStatus_ = function(status) {\n this.keyStatuses.setStatus(status);\n var event = new shaka.util.FakeEvent('keystatuseschange');\n this.dispatchEvent(event);\n};\n\n\n\n/**\n * An implementation of MediaKeyStatusMap.\n * This fakes a map with a single key ID.\n *\n * @constructor\n * @struct\n * @implements {MediaKeyStatusMap}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap = function() {\n /**\n * @type {number}\n */\n this.size = 0;\n\n /**\n * @private {string|undefined}\n */\n this.status_ = undefined;\n};\n\n\n/**\n * @const {!ArrayBuffer}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_;\n\n\n/**\n * An internal method used by the session to set key status.\n * @param {string|undefined} status\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n setStatus = function(status) {\n this.size = status == undefined ? 0 : 1;\n this.status_ = status;\n};\n\n\n/**\n * An internal method used by the session to get key status.\n * @return {string|undefined}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n getStatus = function() {\n return this.status_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n forEach = function(fn) {\n if (this.status_) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_;\n fn(this.status_, fakeKeyId);\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n get = function(keyId) {\n if (this.has(keyId)) {\n return this.status_;\n }\n return undefined;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n has = function(keyId) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_;\n if (this.status_ &&\n shaka.util.Uint8ArrayUtils.equal(\n new Uint8Array(keyId), new Uint8Array(fakeKeyId))) {\n return true;\n }\n return false;\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n entries = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n keys = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n values = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/patchedmediakeys_ms.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.PatchedMediaKeysNop');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\n\n\n/**\n * Install a polyfill to stub out {@link http://goo.gl/blgtZZ EME draft\n * 12 March 2015} on browsers without EME. All methods will fail.\n */\nshaka.polyfill.PatchedMediaKeysNop.install = function() {\n shaka.log.debug('PatchedMediaKeysNop.install');\n\n // Alias.\n var PatchedMediaKeysNop = shaka.polyfill.PatchedMediaKeysNop;\n\n // Install patches.\n navigator.requestMediaKeySystemAccess =\n PatchedMediaKeysNop.requestMediaKeySystemAccess;\n // Delete mediaKeys to work around strict mode compatibility issues.\n delete HTMLMediaElement.prototype['mediaKeys'];\n // Work around read-only declaration for mediaKeys by using a string.\n HTMLMediaElement.prototype['mediaKeys'] = null;\n HTMLMediaElement.prototype.setMediaKeys = PatchedMediaKeysNop.setMediaKeys;\n // These are not usable, but allow Player.isBrowserSupported to pass.\n window.MediaKeys = PatchedMediaKeysNop.MediaKeys;\n window.MediaKeySystemAccess = PatchedMediaKeysNop.MediaKeySystemAccess;\n};\n\n\n/**\n * An implementation of navigator.requestMediaKeySystemAccess.\n * Retrieve a MediaKeySystemAccess object.\n *\n * @this {!Navigator}\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @return {!Promise.<!MediaKeySystemAccess>}\n */\nshaka.polyfill.PatchedMediaKeysNop.requestMediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysNop.requestMediaKeySystemAccess');\n goog.asserts.assert(this == navigator,\n 'bad \"this\" for requestMediaKeySystemAccess');\n\n\n return Promise.reject(new Error(\n 'The key system specified is not supported.'));\n};\n\n\n/**\n * An implementation of HTMLMediaElement.prototype.setMediaKeys.\n * Attach a MediaKeys object to the media element.\n *\n * @this {!HTMLMediaElement}\n * @param {MediaKeys} mediaKeys\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysNop.setMediaKeys = function(mediaKeys) {\n shaka.log.debug('PatchedMediaKeysNop.setMediaKeys');\n goog.asserts.assert(this instanceof HTMLMediaElement,\n 'bad \"this\" for setMediaKeys');\n\n if (mediaKeys == null) {\n return Promise.resolve();\n }\n\n return Promise.reject(new Error('MediaKeys not supported.'));\n};\n\n\n\n/**\n * An unusable constructor for MediaKeys.\n * @constructor\n * @struct\n * @implements {MediaKeys}\n */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeys = function() {\n throw new TypeError('Illegal constructor.');\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.createSession =\n function() {};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.setServerCertificate =\n function() {};\n\n\n\n/**\n * An unusable constructor for MediaKeySystemAccess.\n * @constructor\n * @struct\n * @implements {MediaKeySystemAccess}\n */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess = function() {\n throw new TypeError('Illegal constructor.');\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.\n getConfiguration = function() {};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.\n createMediaKeys = function() {};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.\n keySystem;\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/patchedmediakeys_nop.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.PatchedMediaKeysWebkit');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * Store api prefix.\n *\n * @private {string}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.prefix_ = '';\n\n\n/**\n * Install a polyfill to implement {@link http://goo.gl/blgtZZ EME draft\n * 12 March 2015} on top of webkit-prefixed\n * {@link http://goo.gl/FSpoAo EME v0.1b}.\n *\n * @param {string} prefix\n */\nshaka.polyfill.PatchedMediaKeysWebkit.install = function(prefix) {\n shaka.log.debug('PatchedMediaKeysWebkit.install');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n PatchedMediaKeysWebkit.prefix_ = prefix;\n var prefixApi = PatchedMediaKeysWebkit.prefixApi_;\n\n goog.asserts.assert(\n HTMLMediaElement.prototype[prefixApi('generateKeyRequest')],\n 'PatchedMediaKeysWebkit APIs not available!');\n\n // Construct fake key ID. This is not done at load-time to avoid exceptions\n // on unsupported browsers. This particular fake key ID was suggested in\n // w3c/encrypted-media#32.\n PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_ =\n (new Uint8Array([0])).buffer;\n\n // Install patches.\n navigator.requestMediaKeySystemAccess =\n PatchedMediaKeysWebkit.requestMediaKeySystemAccess;\n // Delete mediaKeys to work around strict mode compatibility issues.\n delete HTMLMediaElement.prototype['mediaKeys'];\n // Work around read-only declaration for mediaKeys by using a string.\n HTMLMediaElement.prototype['mediaKeys'] = null;\n HTMLMediaElement.prototype.setMediaKeys = PatchedMediaKeysWebkit.setMediaKeys;\n window.MediaKeys = PatchedMediaKeysWebkit.MediaKeys;\n window.MediaKeySystemAccess = PatchedMediaKeysWebkit.MediaKeySystemAccess;\n};\n\n\n/**\n * Prefix api by stored prefix.\n *\n * @param {string} api\n * @return {string}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.prefixApi_ = function(api) {\n var prefix = shaka.polyfill.PatchedMediaKeysWebkit.prefix_;\n if (prefix) {\n return prefix + api.charAt(0).toUpperCase() + api.slice(1);\n }\n return api;\n};\n\n\n/**\n * An implementation of navigator.requestMediaKeySystemAccess.\n * Retrieve a MediaKeySystemAccess object.\n *\n * @this {!Navigator}\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @return {!Promise.<!MediaKeySystemAccess>}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.requestMediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysWebkit.requestMediaKeySystemAccess');\n goog.asserts.assert(this == navigator,\n 'bad \"this\" for requestMediaKeySystemAccess');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n try {\n var access = new PatchedMediaKeysWebkit.MediaKeySystemAccess(\n keySystem, supportedConfigurations);\n return Promise.resolve(/** @type {!MediaKeySystemAccess} */ (access));\n } catch (exception) {\n return Promise.reject(exception);\n }\n};\n\n\n/**\n * An implementation of HTMLMediaElement.prototype.setMediaKeys.\n * Attach a MediaKeys object to the media element.\n *\n * @this {!HTMLMediaElement}\n * @param {MediaKeys} mediaKeys\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.setMediaKeys = function(mediaKeys) {\n shaka.log.debug('PatchedMediaKeysWebkit.setMediaKeys');\n goog.asserts.assert(this instanceof HTMLMediaElement,\n 'bad \"this\" for setMediaKeys');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n\n var newMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys} */ (\n mediaKeys);\n var oldMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys} */ (\n this.mediaKeys);\n\n if (oldMediaKeys && oldMediaKeys != newMediaKeys) {\n goog.asserts.assert(\n oldMediaKeys instanceof PatchedMediaKeysWebkit.MediaKeys,\n 'non-polyfill instance of oldMediaKeys');\n // Have the old MediaKeys stop listening to events on the video tag.\n oldMediaKeys.setMedia(null);\n }\n\n delete this['mediaKeys']; // in case there is an existing getter\n this['mediaKeys'] = mediaKeys; // work around read-only declaration\n\n if (newMediaKeys) {\n goog.asserts.assert(\n newMediaKeys instanceof PatchedMediaKeysWebkit.MediaKeys,\n 'non-polyfill instance of newMediaKeys');\n newMediaKeys.setMedia(this);\n }\n\n return Promise.resolve();\n};\n\n\n/**\n * For some of this polyfill's implementation, we need to query a video element.\n * But for some embedded systems, it is memory-expensive to create multiple\n * video elements. Therefore, we check the document to see if we can borrow one\n * to query before we fall back to creating one temporarily.\n *\n * @return {!HTMLVideoElement}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.getVideoElement_ = function() {\n var videos = document.getElementsByTagName('video');\n var tmpVideo = videos.length ? videos[0] : document.createElement('video');\n return /** @type {!HTMLVideoElement} */(tmpVideo);\n};\n\n\n\n/**\n * An implementation of MediaKeySystemAccess.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @implements {MediaKeySystemAccess}\n * @throws {Error} if the key system is not supported.\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySystemAccess');\n\n /** @type {string} */\n this.keySystem = keySystem;\n\n /** @private {string} */\n this.internalKeySystem_ = keySystem;\n\n /** @private {!MediaKeySystemConfiguration} */\n this.configuration_;\n\n // This is only a guess, since we don't really know from the prefixed API.\n var allowPersistentState = true;\n\n if (keySystem == 'org.w3.clearkey') {\n // ClearKey's string must be prefixed in v0.1b.\n this.internalKeySystem_ = 'webkit-org.w3.clearkey';\n // ClearKey doesn't support persistence.\n allowPersistentState = false;\n }\n\n var success = false;\n var tmpVideo = shaka.polyfill.PatchedMediaKeysWebkit.getVideoElement_();\n for (var i = 0; i < supportedConfigurations.length; ++i) {\n var cfg = supportedConfigurations[i];\n\n // Create a new config object and start adding in the pieces which we\n // find support for. We will return this from getConfiguration() if\n // asked.\n /** @type {!MediaKeySystemConfiguration} */\n var newCfg = {\n 'audioCapabilities': [],\n 'videoCapabilities': [],\n // It is technically against spec to return these as optional, but we\n // don't truly know their values from the prefixed API:\n 'persistentState': 'optional',\n 'distinctiveIdentifier': 'optional',\n // Pretend the requested init data types are supported, since we don't\n // really know that either:\n 'initDataTypes': cfg.initDataTypes,\n 'sessionTypes': ['temporary'],\n 'label': cfg.label\n };\n\n // v0.1b tests for key system availability with an extra argument on\n // canPlayType.\n var ranAnyTests = false;\n if (cfg.audioCapabilities) {\n for (var j = 0; j < cfg.audioCapabilities.length; ++j) {\n var cap = cfg.audioCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n // In Chrome <= 40, if you ask about Widevine-encrypted audio support,\n // you get a false-negative when you specify codec information.\n // Work around this by stripping codec info for audio types.\n var contentType = cap.contentType.split(';')[0];\n if (tmpVideo.canPlayType(contentType, this.internalKeySystem_)) {\n newCfg.audioCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n if (cfg.videoCapabilities) {\n for (var j = 0; j < cfg.videoCapabilities.length; ++j) {\n var cap = cfg.videoCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n if (tmpVideo.canPlayType(cap.contentType, this.internalKeySystem_)) {\n newCfg.videoCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n\n if (!ranAnyTests) {\n // If no specific types were requested, we check all common types to find\n // out if the key system is present at all.\n success = tmpVideo.canPlayType('video/mp4', this.internalKeySystem_) ||\n tmpVideo.canPlayType('video/webm', this.internalKeySystem_);\n }\n if (cfg.persistentState == 'required') {\n if (allowPersistentState) {\n newCfg.persistentState = 'required';\n newCfg.sessionTypes = ['persistent-license'];\n } else {\n success = false;\n }\n }\n\n if (success) {\n this.configuration_ = newCfg;\n return;\n }\n } // for each cfg in supportedConfigurations\n\n var message = 'Unsupported keySystem';\n if (keySystem == 'org.w3.clearkey' || keySystem == 'com.widevine.alpha') {\n message = 'None of the requested configurations were supported.';\n }\n var unsupportedError = new Error(message);\n unsupportedError.name = 'NotSupportedError';\n unsupportedError.code = DOMException.NOT_SUPPORTED_ERR;\n throw unsupportedError;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.\n createMediaKeys = function() {\n shaka.log.debug(\n 'PatchedMediaKeysWebkit.MediaKeySystemAccess.createMediaKeys');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n var mediaKeys = new PatchedMediaKeysWebkit.MediaKeys(this.internalKeySystem_);\n return Promise.resolve(/** @type {!MediaKeys} */ (mediaKeys));\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.\n getConfiguration = function() {\n shaka.log.debug(\n 'PatchedMediaKeysWebkit.MediaKeySystemAccess.getConfiguration');\n return this.configuration_;\n};\n\n\n\n/**\n * An implementation of MediaKeys.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @implements {MediaKeys}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys = function(keySystem) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys');\n\n /** @private {string} */\n this.keySystem_ = keySystem;\n\n /** @private {HTMLMediaElement} */\n this.media_ = null;\n\n /** @private {!shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /**\n * @private {!Array.<!shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession>}\n */\n this.newSessions_ = [];\n\n /**\n * @private {!Object.<string,\n * !shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession>}\n */\n this.sessionMap_ = {};\n};\n\n\n/**\n * @param {HTMLMediaElement} media\n * @protected\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setMedia =\n function(media) {\n this.media_ = media;\n\n // Remove any old listeners.\n this.eventManager_.removeAll();\n\n var prefix = shaka.polyfill.PatchedMediaKeysWebkit.prefix_;\n if (media) {\n // Intercept and translate these prefixed EME events.\n this.eventManager_.listen(media, prefix + 'needkey',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitNeedKey_.bind(this)));\n\n this.eventManager_.listen(media, prefix + 'keymessage',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitKeyMessage_.bind(this)));\n\n this.eventManager_.listen(media, prefix + 'keyadded',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitKeyAdded_.bind(this)));\n\n this.eventManager_.listen(media, prefix + 'keyerror',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitKeyError_.bind(this)));\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.createSession =\n function(opt_sessionType) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.createSession');\n\n var sessionType = opt_sessionType || 'temporary';\n // TODO: Consider adding support for persistent-release once Chrome has\n // implemented it natively. http://crbug.com/448888\n // This is a non-issue if we've deprecated the polyfill by then, since\n // prefixed EME is on its way out.\n if (sessionType != 'temporary' && sessionType != 'persistent-license') {\n throw new TypeError('Session type ' + opt_sessionType +\n ' is unsupported on this platform.');\n }\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n\n // Unprefixed EME allows for session creation without a video tag or src.\n // Prefixed EME requires both a valid HTMLMediaElement and a src.\n var media = this.media_ || /** @type {!HTMLMediaElement} */(\n document.createElement('video'));\n if (!media.src) media.src = 'about:blank';\n\n var session = new PatchedMediaKeysWebkit.MediaKeySession(\n media, this.keySystem_, sessionType);\n this.newSessions_.push(session);\n return session;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setServerCertificate =\n function(serverCertificate) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.setServerCertificate');\n\n // There is no equivalent in v0.1b, so return failure.\n return Promise.resolve(false);\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitNeedKey_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitNeedKey_', event);\n goog.asserts.assert(this.media_, 'media_ not set in onWebkitNeedKey_');\n\n var event2 = document.createEvent('CustomEvent');\n event2.initCustomEvent('encrypted', false, false, null);\n\n // not used by v0.1b EME, but given a valid value\n event2.initDataType = 'webm';\n event2.initData = event.initData;\n\n this.media_.dispatchEvent(event2);\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyMessage_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitKeyMessage_', event);\n\n var session = this.findSession_(event.sessionId);\n if (!session) {\n shaka.log.error('Session not found', event.sessionId);\n return;\n }\n\n var isNew = session.keyStatuses.getStatus() == undefined;\n\n var event2 = new shaka.util.FakeEvent('message', {\n messageType: isNew ? 'licenserequest' : 'licenserenewal',\n message: event.message\n });\n\n session.generated();\n session.dispatchEvent(event2);\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyAdded_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitKeyAdded_', event);\n\n var session = this.findSession_(event.sessionId);\n goog.asserts.assert(session, 'unable to find session in onWebkitKeyAdded_');\n if (session) {\n session.ready();\n }\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyError_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitKeyError_', event);\n\n var session = this.findSession_(event.sessionId);\n goog.asserts.assert(session, 'unable to find session in onWebkitKeyError_');\n if (session) {\n session.handleError(event);\n }\n};\n\n\n/**\n * @param {string} sessionId\n * @return {shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.findSession_ =\n function(sessionId) {\n var session = this.sessionMap_[sessionId];\n if (session) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.findSession_', session);\n return session;\n }\n\n session = this.newSessions_.shift();\n if (session) {\n session.sessionId = sessionId;\n this.sessionMap_[sessionId] = session;\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.findSession_', session);\n return session;\n }\n\n return null;\n};\n\n\n\n/**\n * An implementation of MediaKeySession.\n *\n * @param {!HTMLMediaElement} media\n * @param {string} keySystem\n * @param {string} sessionType\n *\n * @constructor\n * @struct\n * @implements {MediaKeySession}\n * @extends {shaka.util.FakeEventTarget}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession =\n function(media, keySystem, sessionType) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession');\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {!HTMLMediaElement} */\n this.media_ = media;\n\n /** @private {boolean} */\n this.initialized_ = false;\n\n /** @private {shaka.util.PublicPromise} */\n this.generatePromise_ = null;\n\n /** @private {shaka.util.PublicPromise} */\n this.updatePromise_ = null;\n\n /** @private {string} */\n this.keySystem_ = keySystem;\n\n /** @private {string} */\n this.type_ = sessionType;\n\n /** @type {string} */\n this.sessionId = '';\n\n /** @type {number} */\n this.expiration = NaN;\n\n /** @type {!shaka.util.PublicPromise} */\n this.closed = new shaka.util.PublicPromise();\n\n /** @type {!MediaKeyStatusMap} */\n this.keyStatuses =\n new shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap();\n};\ngoog.inherits(shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession,\n shaka.util.FakeEventTarget);\n\n\n/**\n * Signals that the license request has been generated. This resolves the\n * 'generateRequest' promise.\n *\n * @protected\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generated =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.generated');\n\n if (this.generatePromise_) {\n this.generatePromise_.resolve();\n this.generatePromise_ = null;\n }\n};\n\n\n/**\n * Signals that the session is 'ready', which is the terminology used in older\n * versions of EME. The new signal is to resolve the 'update' promise. This\n * translates between the two.\n *\n * @protected\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.ready =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.ready');\n\n this.updateKeyStatus_('usable');\n\n if (this.updatePromise_) {\n this.updatePromise_.resolve();\n }\n this.updatePromise_ = null;\n};\n\n\n/**\n * Either rejects a promise, or dispatches an error event, as appropriate.\n *\n * @param {!MediaKeyEvent} event\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.handleError =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.handleError', event);\n\n // This does not match the DOMException we get in current WD EME, but it will\n // at least provide some information which can be used to look into the\n // problem.\n var error = new Error('EME v0.1b key error');\n error.errorCode = event.errorCode;\n error.errorCode.systemCode = event.systemCode;\n\n // The presence or absence of sessionId indicates whether this corresponds to\n // generateRequest() or update().\n if (!event.sessionId && this.generatePromise_) {\n error.method = 'generateRequest';\n if (event.systemCode == 45) {\n error.message = 'Unsupported session type.';\n }\n this.generatePromise_.reject(error);\n this.generatePromise_ = null;\n } else if (event.sessionId && this.updatePromise_) {\n error.method = 'update';\n this.updatePromise_.reject(error);\n this.updatePromise_ = null;\n } else {\n // This mapping of key statuses is imperfect at best.\n var code = event.errorCode.code;\n var systemCode = event.systemCode;\n if (code == MediaKeyError['MEDIA_KEYERR_OUTPUT']) {\n this.updateKeyStatus_('output-restricted');\n } else if (systemCode == 1) {\n this.updateKeyStatus_('expired');\n } else {\n this.updateKeyStatus_('internal-error');\n }\n }\n};\n\n\n/**\n * Logic which is shared between generateRequest() and load(), both of which\n * are ultimately implemented with webkitGenerateKeyRequest in prefixed EME.\n *\n * @param {?BufferSource} initData\n * @param {?string} offlineSessionId\n * @return {!Promise}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generate_ =\n function(initData, offlineSessionId) {\n if (this.initialized_) {\n return Promise.reject(new Error('The session is already initialized.'));\n }\n\n this.initialized_ = true;\n\n /** @type {!Uint8Array} */\n var mangledInitData;\n\n try {\n if (this.type_ == 'persistent-license') {\n var StringUtils = shaka.util.StringUtils;\n if (!offlineSessionId) {\n // Persisting the initial license.\n // Prefix the init data with a tag to indicate persistence.\n var prefix = StringUtils.toUTF8('PERSISTENT|');\n var result = new Uint8Array(prefix.byteLength + initData.byteLength);\n result.set(new Uint8Array(prefix), 0);\n result.set(new Uint8Array(initData), prefix.byteLength);\n mangledInitData = result;\n } else {\n // Loading a stored license.\n // Prefix the init data (which is really a session ID) with a tag to\n // indicate that we are loading a persisted session.\n mangledInitData = new Uint8Array(\n StringUtils.toUTF8('LOAD_SESSION|' + offlineSessionId));\n }\n } else {\n // Streaming.\n goog.asserts.assert(this.type_ == 'temporary',\n 'expected temporary session');\n goog.asserts.assert(!offlineSessionId,\n 'unexpected offline session ID');\n mangledInitData = new Uint8Array(initData);\n }\n\n goog.asserts.assert(mangledInitData,\n 'init data not set!');\n } catch (exception) {\n return Promise.reject(exception);\n }\n\n goog.asserts.assert(this.generatePromise_ == null,\n 'generatePromise_ should be null');\n this.generatePromise_ = new shaka.util.PublicPromise();\n\n // Because we are hacking media.src in createSession to better emulate\n // unprefixed EME's ability to create sessions and license requests without a\n // video tag, we can get ourselves into trouble. It seems that sometimes,\n // the setting of media.src hasn't been processed by some other thread, and\n // GKR can throw an exception. If this occurs, wait 10 ms and try again at\n // most once. This situation should only occur when init data is available\n // ahead of the 'needkey' event.\n\n var prefixApi = shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_;\n var generateKeyRequestName = prefixApi('generateKeyRequest');\n try {\n this.media_[generateKeyRequestName](this.keySystem_, mangledInitData);\n } catch (exception) {\n if (exception.name != 'InvalidStateError') {\n this.generatePromise_ = null;\n return Promise.reject(exception);\n }\n\n setTimeout(function() {\n try {\n this.media_[generateKeyRequestName](this.keySystem_, mangledInitData);\n } catch (exception) {\n this.generatePromise_.reject(exception);\n this.generatePromise_ = null;\n }\n }.bind(this), 10);\n }\n\n return this.generatePromise_;\n};\n\n\n/**\n * An internal version of update which defers new calls while old ones are in\n * progress.\n *\n * @param {!shaka.util.PublicPromise} promise The promise associated with this\n * call.\n * @param {?BufferSource} response\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update_ =\n function(promise, response) {\n if (this.updatePromise_) {\n // We already have an update in-progress, so defer this one until after the\n // old one is resolved. Execute this whether the original one succeeds or\n // fails.\n this.updatePromise_.then(\n this.update_.bind(this, promise, response)\n ).catch(\n this.update_.bind(this, promise, response)\n );\n return;\n }\n\n this.updatePromise_ = promise;\n\n var key;\n var keyId;\n\n if (this.keySystem_ == 'webkit-org.w3.clearkey') {\n // The current EME version of clearkey wants a structured JSON response.\n // The v0.1b version wants just a raw key. Parse the JSON response and\n // extract the key and key ID.\n var StringUtils = shaka.util.StringUtils;\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n var licenseString = StringUtils.fromUTF8(response);\n var jwkSet = /** @type {JWKSet} */ (JSON.parse(licenseString));\n var kty = jwkSet.keys[0].kty;\n if (kty != 'oct') {\n // Reject the promise.\n var error = new Error('Response is not a valid JSON Web Key Set.');\n this.updatePromise_.reject(error);\n this.updatePromise_ = null;\n }\n key = Uint8ArrayUtils.fromBase64(jwkSet.keys[0].k);\n keyId = Uint8ArrayUtils.fromBase64(jwkSet.keys[0].kid);\n } else {\n // The key ID is not required.\n key = new Uint8Array(response);\n keyId = null;\n }\n\n var prefixApi = shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_;\n var addKeyName = prefixApi('addKey');\n try {\n this.media_[addKeyName](this.keySystem_, key, keyId, this.sessionId);\n } catch (exception) {\n // Reject the promise.\n this.updatePromise_.reject(exception);\n this.updatePromise_ = null;\n }\n};\n\n\n/**\n * Update key status and dispatch a 'keystatuseschange' event.\n *\n * @param {string} status\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.\n updateKeyStatus_ = function(status) {\n this.keyStatuses.setStatus(status);\n var event = new shaka.util.FakeEvent('keystatuseschange');\n this.dispatchEvent(event);\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.\n generateRequest = function(initDataType, initData) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.generateRequest');\n return this.generate_(initData, null);\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.load =\n function(sessionId) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.load');\n if (this.type_ == 'persistent-license') {\n return this.generate_(null, sessionId);\n } else {\n return Promise.reject(new Error('Not a persistent session.'));\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update =\n function(response) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.update', response);\n goog.asserts.assert(this.sessionId, 'update without session ID');\n\n var nextUpdatePromise = new shaka.util.PublicPromise();\n this.update_(nextUpdatePromise, response);\n return nextUpdatePromise;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.close =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.close');\n\n // This will remove a persistent session, but it's also the only way to\n // free CDM resources on v0.1b.\n if (this.type_ != 'persistent-license') {\n // sessionId may reasonably be null if no key request has been generated\n // yet. Unprefixed EME will return a rejected promise in this case.\n // We will use the same error message that Chrome 41 uses in its EME\n // implementation.\n if (!this.sessionId) {\n this.closed.reject(new Error('The session is not callable.'));\n return this.closed;\n }\n\n // This may throw an exception, but we ignore it because we are only using\n // it to clean up resources in v0.1b. We still consider the session closed.\n // We can't let the exception propagate because MediaKeySession.close()\n // should not throw.\n var prefixApi = shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_;\n var cancelKeyRequestName = prefixApi('cancelKeyRequest');\n try {\n this.media_[cancelKeyRequestName](this.keySystem_, this.sessionId);\n } catch (exception) {}\n }\n\n // Resolve the 'closed' promise and return it.\n this.closed.resolve();\n return this.closed;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.remove =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.remove');\n\n if (this.type_ != 'persistent-license') {\n return Promise.reject(new Error('Not a persistent session.'));\n }\n\n return this.close();\n};\n\n\n\n/**\n * An implementation of MediaKeyStatusMap.\n * This fakes a map with a single key ID.\n *\n * @constructor\n * @struct\n * @implements {MediaKeyStatusMap}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap = function() {\n /**\n * @type {number}\n */\n this.size = 0;\n\n /**\n * @private {string|undefined}\n */\n this.status_ = undefined;\n};\n\n\n/**\n * @const {!ArrayBuffer}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_;\n\n\n/**\n * An internal method used by the session to set key status.\n * @param {string|undefined} status\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.setStatus =\n function(status) {\n this.size = status == undefined ? 0 : 1;\n this.status_ = status;\n};\n\n\n/**\n * An internal method used by the session to get key status.\n * @return {string|undefined}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.getStatus =\n function() {\n return this.status_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.forEach =\n function(fn) {\n if (this.status_) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_;\n fn(this.status_, fakeKeyId);\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.get =\n function(keyId) {\n if (this.has(keyId)) {\n return this.status_;\n }\n return undefined;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.has =\n function(keyId) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_;\n if (this.status_ &&\n shaka.util.Uint8ArrayUtils.equal(\n new Uint8Array(keyId), new Uint8Array(fakeKeyId))) {\n return true;\n }\n return false;\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.\n entries = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.\n keys = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.\n values = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/patchedmediakeys_webkit.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.MediaKeys');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.PatchedMediaKeysMs');\ngoog.require('shaka.polyfill.PatchedMediaKeysNop');\ngoog.require('shaka.polyfill.PatchedMediaKeysWebkit');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.MediaKeys\n *\n * @summary A polyfill to unify EME APIs across browser versions.\n *\n * The {@link https://w3c.github.io/encrypted-media/ EME spec} is still a\n * work-in-progress. As such, we need to provide a consistent API to the Shaka\n * Player. Until the spec is completely stable, the API provided by this\n * polyfill may lag behind the latest spec developments.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.MediaKeys.install = function() {\n shaka.log.debug('MediaKeys.install');\n\n if (!window.HTMLVideoElement) {\n // Avoid errors on very old browsers.\n return;\n }\n\n if (navigator.requestMediaKeySystemAccess &&\n MediaKeySystemAccess.prototype.getConfiguration) {\n shaka.log.info('Using native EME as-is.');\n } else if (HTMLMediaElement.prototype.webkitGenerateKeyRequest) {\n shaka.log.info('Using webkit-prefixed EME v0.1b');\n shaka.polyfill.PatchedMediaKeysWebkit.install('webkit');\n } else if (HTMLMediaElement.prototype.generateKeyRequest) {\n shaka.log.info('Using nonprefixed EME v0.1b');\n shaka.polyfill.PatchedMediaKeysWebkit.install('');\n } else if (window.MSMediaKeys) {\n shaka.log.info('Using ms-prefixed EME v20140218');\n shaka.polyfill.PatchedMediaKeysMs.install();\n } else {\n shaka.log.info('EME not available.');\n shaka.polyfill.PatchedMediaKeysNop.install();\n }\n};\n\n\nshaka.polyfill.register(shaka.polyfill.MediaKeys.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/mediakeys.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.MediaSource');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.MediaSource\n *\n * @summary A polyfill to patch MSE bugs.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.MediaSource.install = function() {\n shaka.log.debug('MediaSource.install');\n\n if (!window.MediaSource) {\n shaka.log.info('No MSE implementation available.');\n return;\n }\n\n // Detection is complicated by the fact that Safari does not expose\n // SourceBuffer on window. So we can't detect missing features by accessing\n // SourceBuffer.prototype. That is why we use navigator to detect Safari and\n // particular versions of it.\n var vendor = navigator.vendor;\n var version = navigator.appVersion;\n if (!vendor || !version || vendor.indexOf('Apple') < 0) {\n shaka.log.info('Using native MSE as-is.');\n return;\n }\n\n if (version.indexOf('Version/8') >= 0) {\n // Safari 8 does not implement appendWindowEnd. If we ignore the\n // incomplete MSE implementation, some content (especially multi-period)\n // will fail to play correctly. The best we can do is blacklist Safari 8.\n shaka.log.info('Blacklisting Safari 8 MSE.');\n shaka.polyfill.MediaSource.blacklist_();\n } else if (version.indexOf('Version/9') >= 0) {\n shaka.log.info('Patching Safari 9 MSE bugs.');\n // Safari 9 does not correctly implement abort() on SourceBuffer.\n // Calling abort() causes a decoder failure, rather than resetting the\n // decode timestamp as called for by the spec.\n // Bug filed: http://goo.gl/UZ2rPp\n shaka.polyfill.MediaSource.stubAbort_();\n } else if (version.indexOf('Version/10') >= 0) {\n shaka.log.info('Patching Safari 10 MSE bugs.');\n // Safari 10 does not correctly implement abort() on SourceBuffer.\n // Calling abort() before appending a segment causes that segment to be\n // incomplete in buffer.\n // Bug filed: https://goo.gl/rC3CLj\n shaka.polyfill.MediaSource.stubAbort_();\n // Safari 10 fires spurious 'updateend' events after endOfStream().\n // Bug filed: https://goo.gl/qCeTZr\n shaka.polyfill.MediaSource.patchEndOfStreamEvents_();\n } else {\n shaka.log.info('Using native MSE as-is.');\n }\n};\n\n\n/**\n * Blacklist the current browser by making MediaSourceEngine.isBrowserSupported\n * fail later.\n *\n * @private\n */\nshaka.polyfill.MediaSource.blacklist_ = function() {\n window['MediaSource'] = null;\n};\n\n\n/**\n * Stub out abort(). On some buggy MSE implementations, calling abort() causes\n * various problems.\n *\n * @private\n */\nshaka.polyfill.MediaSource.stubAbort_ = function() {\n var addSourceBuffer = MediaSource.prototype.addSourceBuffer;\n MediaSource.prototype.addSourceBuffer = function() {\n var sourceBuffer = addSourceBuffer.apply(this, arguments);\n sourceBuffer.abort = function() {}; // Stub out for buggy implementations.\n return sourceBuffer;\n };\n};\n\n\n/**\n * Patch endOfStream() to get rid of 'updateend' events that should not fire.\n * These extra events confuse MediaSourceEngine, which relies on correct events\n * to manage SourceBuffer state.\n *\n * @private\n */\nshaka.polyfill.MediaSource.patchEndOfStreamEvents_ = function() {\n var endOfStream = MediaSource.prototype.endOfStream;\n MediaSource.prototype.endOfStream = function() {\n // This bug manifests only when endOfStream() results in the truncation\n // of the MediaSource's duration. So first we must calculate what the\n // new duration will be.\n var newDuration = 0;\n for (var i = 0; i < this.sourceBuffers.length; ++i) {\n var buffer = this.sourceBuffers[i];\n var bufferEnd = buffer.buffered.end(buffer.buffered.length - 1);\n newDuration = Math.max(newDuration, bufferEnd);\n }\n\n // If the duration is going to be reduced, suppress the next 'updateend'\n // event on each SourceBuffer.\n if (!isNaN(this.duration) &&\n newDuration < this.duration) {\n this.ignoreUpdateEnd_ = true;\n for (var i = 0; i < this.sourceBuffers.length; ++i) {\n var buffer = this.sourceBuffers[i];\n buffer.eventSuppressed_ = false;\n }\n }\n\n return endOfStream.apply(this, arguments);\n };\n\n var addSourceBuffer = MediaSource.prototype.addSourceBuffer;\n MediaSource.prototype.addSourceBuffer = function() {\n // After adding a new source buffer, add an event listener to allow us to\n // suppress events.\n var sourceBuffer = addSourceBuffer.apply(this, arguments);\n sourceBuffer.mediaSource_ = this;\n sourceBuffer.addEventListener('updateend',\n shaka.polyfill.MediaSource.ignoreUpdateEnd_, false);\n\n if (!this.cleanUpHandlerInstalled_) {\n // If we haven't already, install an event listener to allow us to clean\n // up listeners when MediaSource is torn down.\n this.addEventListener('sourceclose',\n shaka.polyfill.MediaSource.cleanUpListeners_, false);\n this.cleanUpHandlerInstalled_ = true;\n }\n return sourceBuffer;\n };\n};\n\n\n/**\n * An event listener for 'updateend' which selectively suppresses the events.\n *\n * @see shaka.polyfill.MediaSource.patchEndOfStreamEvents_\n *\n * @param {Event} event\n * @private\n */\nshaka.polyfill.MediaSource.ignoreUpdateEnd_ = function(event) {\n var sourceBuffer = event.target;\n var mediaSource = sourceBuffer.mediaSource_;\n\n if (mediaSource.ignoreUpdateEnd_) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n sourceBuffer.eventSuppressed_ = true;\n\n for (var i = 0; i < mediaSource.sourceBuffers.length; ++i) {\n var buffer = mediaSource.sourceBuffers[i];\n if (buffer.eventSuppressed_ == false) {\n // More events need to be suppressed.\n return;\n }\n }\n\n // All events have been suppressed, all buffers are out of 'updating'\n // mode. Stop suppressing events.\n mediaSource.ignoreUpdateEnd_ = false;\n }\n};\n\n\n/**\n * An event listener for 'sourceclose' which cleans up listeners for 'updateend'\n * to avoid memory leaks.\n *\n * @see shaka.polyfill.MediaSource.patchEndOfStreamEvents_\n * @see shaka.polyfill.MediaSource.ignoreUpdateEnd_\n *\n * @param {Event} event\n * @private\n */\nshaka.polyfill.MediaSource.cleanUpListeners_ = function(event) {\n var mediaSource = event.target;\n for (var i = 0; i < mediaSource.sourceBuffers.length; ++i) {\n var buffer = mediaSource.sourceBuffers[i];\n buffer.removeEventListener('updateend',\n shaka.polyfill.MediaSource.ignoreUpdateEnd_, false);\n }\n mediaSource.removeEventListener('sourceclose',\n shaka.polyfill.MediaSource.cleanUpListeners_, false);\n};\n\n\nshaka.polyfill.register(shaka.polyfill.MediaSource.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/mediasource.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.Promise');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n\n/**\n * @summary A polyfill to implement Promises, primarily for IE.\n * Only partially supports thenables, but otherwise passes the A+ conformance\n * tests.\n * Note that Promise.all() and Promise.race() are not tested by that suite.\n *\n * @constructor\n * @struct\n * @param {function(function(*), function(*))=} opt_callback\n * @template T\n */\nshaka.polyfill.Promise = function(opt_callback) {\n /** @private {!Array.<shaka.polyfill.Promise.Child>} */\n this.thens_ = [];\n\n /** @private {!Array.<shaka.polyfill.Promise.Child>} */\n this.catches_ = [];\n\n /** @private {shaka.polyfill.Promise.State} */\n this.state_ = shaka.polyfill.Promise.State.PENDING;\n\n /** @private {*} */\n this.value_;\n\n // External callers must supply the callback. Internally, we may construct\n // child Promises without it, since we can directly access their resolve_ and\n // reject_ methods when convenient.\n if (opt_callback) {\n try {\n opt_callback(this.resolve_.bind(this), this.reject_.bind(this));\n } catch (e) {\n this.reject_(e);\n }\n }\n};\n\n\n/**\n * @typedef {{\n * promise: !shaka.polyfill.Promise,\n * callback: (function(*)|undefined)\n * }}\n *\n * @summary A child promise, used for chaining.\n * @description\n * Only exists in the context of a then or catch chain.\n * @property {!shaka.polyfill.Promise} promise\n * The child promise.\n * @property {(function(*)|undefined)} callback\n * The then or catch callback to be invoked as part of this chain.\n */\nshaka.polyfill.Promise.Child;\n\n\n/**\n * @enum {number}\n */\nshaka.polyfill.Promise.State = {\n PENDING: 0,\n RESOLVED: 1,\n REJECTED: 2\n};\n\n\n/**\n * Install the polyfill if needed.\n * @param {boolean=} opt_force If true, force the polyfill to be installed.\n * Used in some unit tests.\n */\nshaka.polyfill.Promise.install = function(opt_force) {\n // Decide on the best way to invoke a callback as soon as possible.\n // Precompute the setImmediate/clearImmediate convenience methods to avoid the\n // overhead of this switch every time a callback has to be invoked.\n if (window.setImmediate) {\n // For IE and node.js:\n shaka.polyfill.Promise.setImmediate_ = function(callback) {\n return window.setImmediate(callback);\n };\n shaka.polyfill.Promise.clearImmediate_ = function(id) {\n return window.clearImmediate(id);\n };\n } else {\n // For everyone else:\n shaka.polyfill.Promise.setImmediate_ = function(callback) {\n return window.setTimeout(callback, 0);\n };\n shaka.polyfill.Promise.clearImmediate_ = function(id) {\n return window.clearTimeout(id);\n };\n }\n\n if (window.Promise && !opt_force) {\n shaka.log.info('Using native Promises.');\n return;\n }\n\n shaka.log.info('Using Promises polyfill.');\n // Quoted to work around type-checking, since our then() signature doesn't\n // exactly match that of a native Promise.\n window['Promise'] = shaka.polyfill.Promise;\n\n // Explicitly installed because the compiler won't necessarily attach them\n // to the compiled constructor. Exporting them will only attach them to\n // their original namespace, which isn't the same as attaching them to the\n // constructor unless you also export the constructor.\n window['Promise'].resolve = shaka.polyfill.Promise.resolve;\n window['Promise'].reject = shaka.polyfill.Promise.reject;\n window['Promise'].all = shaka.polyfill.Promise.all;\n window['Promise'].race = shaka.polyfill.Promise.race;\n\n // These are manually exported as well, because allowing the compiler to\n // export them for us will cause the polyfill to end up in our generated\n // externs. Since nobody should be accessing this directly using the\n // shaka.polyfill namespace, it is okay not to @export these methods.\n window['Promise']['prototype']['then'] =\n shaka.polyfill.Promise.prototype.then;\n window['Promise']['prototype']['catch'] =\n shaka.polyfill.Promise.prototype.catch;\n};\n\n\n/**\n * Uninstall the polyfill. Used in some unit tests.\n */\nshaka.polyfill.Promise.uninstall = function() {\n // Do nothing if there is no native implementation.\n if (shaka.polyfill.Promise.nativePromise_) {\n shaka.log.info('Removing Promise polyfill.');\n window['Promise'] = shaka.polyfill.Promise.nativePromise_;\n shaka.polyfill.Promise.q_ = [];\n }\n};\n\n\n/**\n * @param {*} value\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.resolve = function(value) {\n var p = new shaka.polyfill.Promise();\n p.resolve_(undefined);\n return p.then(function() {\n return value;\n });\n};\n\n\n/**\n * @param {*} reason\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.reject = function(reason) {\n var p = new shaka.polyfill.Promise();\n p.reject_(reason);\n return p;\n};\n\n\n/**\n * @param {!Array.<!shaka.polyfill.Promise>} others\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.all = function(others) {\n var p = new shaka.polyfill.Promise();\n if (!others.length) {\n p.resolve_([]);\n return p;\n }\n\n // The array of results must be in the same order as the array of Promises\n // passed to all(). So we pre-allocate the array and keep a count of how\n // many have resolved. Only when all have resolved is the returned Promise\n // itself resolved.\n var count = 0;\n var values = new Array(others.length);\n var resolve = function(p, i, newValue) {\n goog.asserts.assert(p.state_ != shaka.polyfill.Promise.State.RESOLVED,\n 'Invalid Promise state in Promise.all');\n // If one of the Promises in the array was rejected, this Promise was\n // rejected and new values are ignored. In such a case, the values array\n // and its contents continue to be alive in memory until all of the Promises\n // in the array have completed.\n if (p.state_ == shaka.polyfill.Promise.State.PENDING) {\n values[i] = newValue;\n count++;\n if (count == values.length) {\n p.resolve_(values);\n }\n }\n };\n\n var reject = p.reject_.bind(p);\n for (var i = 0; i < others.length; ++i) {\n if (others[i] && others[i].then) {\n others[i].then(resolve.bind(null, p, i), reject);\n } else {\n resolve(p, i, others[i]);\n }\n }\n return p;\n};\n\n\n/**\n * @param {!Array.<!shaka.polyfill.Promise>} others\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.race = function(others) {\n var p = new shaka.polyfill.Promise();\n\n // The returned Promise is resolved or rejected as soon as one of the others\n // is.\n var resolve = p.resolve_.bind(p);\n var reject = p.reject_.bind(p);\n for (var i = 0; i < others.length; ++i) {\n if (others[i] && others[i].then) {\n others[i].then(resolve, reject);\n } else {\n resolve(others[i]);\n }\n }\n return p;\n};\n\n\n/**\n * @param {function(*)=} opt_successCallback\n * @param {function(*)=} opt_failCallback\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.prototype.then = function(opt_successCallback,\n opt_failCallback) {\n // then() returns a child Promise which is chained onto this one.\n var child = new shaka.polyfill.Promise();\n switch (this.state_) {\n case shaka.polyfill.Promise.State.RESOLVED:\n // This is already resolved, so we can chain to the child ASAP.\n this.schedule_(child, opt_successCallback);\n break;\n case shaka.polyfill.Promise.State.REJECTED:\n // This is already rejected, so we can chain to the child ASAP.\n this.schedule_(child, opt_failCallback);\n break;\n case shaka.polyfill.Promise.State.PENDING:\n // This is pending, so we have to track both callbacks and the child\n // in order to chain later.\n this.thens_.push({ promise: child, callback: opt_successCallback});\n this.catches_.push({ promise: child, callback: opt_failCallback});\n break;\n }\n\n return child;\n};\n\n\n/**\n * @param {function(*)=} opt_callback\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.prototype.catch = function(opt_callback) {\n // Devolves into a two-argument call to 'then'.\n return this.then(undefined, opt_callback);\n};\n\n\n/**\n * @param {*} value\n * @private\n */\nshaka.polyfill.Promise.prototype.resolve_ = function(value) {\n // Ignore resolve calls if we aren't still pending.\n if (this.state_ == shaka.polyfill.Promise.State.PENDING) {\n this.value_ = value;\n this.state_ = shaka.polyfill.Promise.State.RESOLVED;\n // Schedule calls to all of the chained callbacks.\n for (var i = 0; i < this.thens_.length; ++i) {\n this.schedule_(this.thens_[i].promise, this.thens_[i].callback);\n }\n this.thens_ = [];\n this.catches_ = [];\n }\n};\n\n\n/**\n * @param {*} reason\n * @private\n */\nshaka.polyfill.Promise.prototype.reject_ = function(reason) {\n // Ignore reject calls if we aren't still pending.\n if (this.state_ == shaka.polyfill.Promise.State.PENDING) {\n this.value_ = reason;\n this.state_ = shaka.polyfill.Promise.State.REJECTED;\n // Schedule calls to all of the chained callbacks.\n for (var i = 0; i < this.catches_.length; ++i) {\n this.schedule_(this.catches_[i].promise, this.catches_[i].callback);\n }\n this.thens_ = [];\n this.catches_ = [];\n }\n};\n\n\n/**\n * @param {!shaka.polyfill.Promise} child\n * @param {function(*)|undefined} callback\n * @private\n */\nshaka.polyfill.Promise.prototype.schedule_ = function(child, callback) {\n goog.asserts.assert(this.state_ != shaka.polyfill.Promise.State.PENDING,\n 'Invalid Promise state in Promise.schedule_');\n var Promise = shaka.polyfill.Promise;\n\n var wrapper = function() {\n if (callback && typeof callback == 'function') {\n // Wrap around the callback. Exceptions thrown by the callback are\n // converted to failures.\n try {\n var value = callback(this.value_);\n } catch (exception) {\n child.reject_(exception);\n return;\n }\n\n // According to the spec, 'then' in a thenable may only be accessed once\n // and any thrown exceptions in the getter must cause the Promise chain\n // to fail.\n var then;\n try {\n then = value && value.then;\n } catch (exception) {\n child.reject_(exception);\n return;\n }\n\n if (value instanceof Promise) {\n // If the returned value is a Promise, we bind it's state to the child.\n if (value == child) {\n // Without this, a bad calling pattern can cause an infinite loop.\n child.reject_(new TypeError('Chaining cycle detected'));\n } else {\n value.then(child.resolve_.bind(child), child.reject_.bind(child));\n }\n } else if (then) {\n // If the returned value is thenable, chain it to the child.\n Promise.handleThenable_(value, then, child);\n } else {\n // If the returned value is not a Promise, the child is resolved with\n // that value.\n child.resolve_(value);\n }\n } else if (this.state_ == Promise.State.RESOLVED) {\n // No callback for this state, so just chain on down the line.\n child.resolve_(this.value_);\n } else {\n // No callback for this state, so just chain on down the line.\n child.reject_(this.value_);\n }\n };\n\n // Enqueue a call to the wrapper.\n Promise.q_.push(wrapper.bind(this));\n if (Promise.flushTimer_ == null) {\n Promise.flushTimer_ = Promise.setImmediate_(Promise.flush);\n }\n};\n\n\n/**\n * @param {!Object} thenable\n * @param {Function} then\n * @param {!shaka.polyfill.Promise} child\n * @private\n */\nshaka.polyfill.Promise.handleThenable_ = function(thenable, then, child) {\n var Promise = shaka.polyfill.Promise;\n try {\n var sealed = false;\n then.call(thenable, function(value) {\n if (sealed) return;\n sealed = true;\n\n var nextThen;\n try {\n nextThen = value && value.then;\n } catch (exception) {\n child.reject_(exception);\n return;\n }\n\n if (nextThen) {\n Promise.handleThenable_(value, nextThen, child);\n } else {\n child.resolve_(value);\n }\n }, child.reject_.bind(child));\n } catch (exception) {\n child.reject_(exception);\n }\n};\n\n\n/**\n * Flush the queue of callbacks.\n * Used directly by some unit tests.\n */\nshaka.polyfill.Promise.flush = function() {\n var Promise = shaka.polyfill.Promise;\n\n // Flush as long as we have callbacks. This means we can finish a chain more\n // quickly, since we avoid the overhead of multiple calls to setTimeout, each\n // of which has a minimum resolution of as much as 15ms on IE11.\n // This helps to fix the out-of-order task bug on IE:\n // https://github.com/google/shaka-player/issues/251#issuecomment-178146242\n while (Promise.q_.length) {\n // Callbacks may enqueue other callbacks, so clear the timer ID and swap the\n // queue before we do anything else.\n if (Promise.flushTimer_ != null) {\n Promise.clearImmediate_(Promise.flushTimer_);\n Promise.flushTimer_ = null;\n }\n var q = Promise.q_;\n Promise.q_ = [];\n\n for (var i = 0; i < q.length; ++i) {\n q[i]();\n }\n }\n};\n\n\n/**\n * @param {function()} callback\n * @return {number}\n * Schedule a callback as soon as possible.\n * Bound in shaka.polyfill.Promise.install() to a specific implementation.\n * @private\n */\nshaka.polyfill.Promise.setImmediate_ = function(callback) { return 0; };\n\n\n/**\n * @param {number} id\n * Clear a scheduled callback.\n * Bound in shaka.polyfill.Promise.install() to a specific implementation.\n * @private\n */\nshaka.polyfill.Promise.clearImmediate_ = function(id) {};\n\n\n/**\n * A timer ID to flush the queue.\n * @private {?number}\n */\nshaka.polyfill.Promise.flushTimer_ = null;\n\n\n/**\n * A queue of callbacks to be invoked ASAP in the next frame.\n * @private {!Array.<function()>}\n */\nshaka.polyfill.Promise.q_ = [];\n\n\n/** @private {?} */\nshaka.polyfill.Promise.nativePromise_ = window.Promise;\n\n\nshaka.polyfill.register(shaka.polyfill.Promise.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/promise.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.VideoPlayPromise');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.VideoPlayPromise\n *\n * @summary A polyfill to silence the play() Promise in HTML5 video.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.VideoPlayPromise.install = function() {\n shaka.log.debug('VideoPlayPromise.install');\n\n if (window.HTMLMediaElement) {\n var originalPlay = HTMLMediaElement.prototype.play;\n HTMLMediaElement.prototype.play = function() {\n var p = originalPlay.apply(this, arguments);\n if (p) {\n // This browser is returning a Promise from play().\n // If the play() call fails or is interrupted, the Promise will be\n // rejected. Some apps, however, don't listen to this Promise,\n // especially since it is not available cross-browser. If the Promise\n // is rejected without anyone listening for the failure, an error will\n // appear in the JS console.\n // To avoid confusion over this innocuous \"error\", we will install a\n // catch handler on the Promise. This does not prevent the app from\n // also catching failures and handling them. It only prevents the\n // console message.\n p.catch(function() {});\n }\n return p;\n };\n }\n};\n\nshaka.polyfill.register(shaka.polyfill.VideoPlayPromise.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/video_play_promise.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.VideoPlaybackQuality');\n\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.VideoPlaybackQuality\n *\n * @summary A polyfill to provide MSE VideoPlaybackQuality metrics.\n * Many browsers do not yet provide this API, and Chrome currently provides\n * similar data through individual prefixed attributes on HTMLVideoElement.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.VideoPlaybackQuality.install = function() {\n if (!window.HTMLVideoElement) {\n // Avoid errors on very old browsers.\n return;\n }\n\n var proto = HTMLVideoElement.prototype;\n if (proto.getVideoPlaybackQuality) {\n // No polyfill needed.\n return;\n }\n\n if ('webkitDroppedFrameCount' in proto) {\n proto.getVideoPlaybackQuality =\n shaka.polyfill.VideoPlaybackQuality.webkit_;\n }\n};\n\n\n/**\n * @this {HTMLVideoElement}\n * @return {!VideoPlaybackQuality}\n * @private\n */\nshaka.polyfill.VideoPlaybackQuality.webkit_ = function() {\n return {\n 'droppedVideoFrames': this.webkitDroppedFrameCount,\n 'totalVideoFrames': this.webkitDecodedFrameCount,\n // Not provided by this polyfill:\n 'corruptedVideoFrames': 0,\n 'creationTime': NaN,\n 'totalFrameDelay': 0\n };\n};\n\n\nshaka.polyfill.register(shaka.polyfill.VideoPlaybackQuality.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/videoplaybackquality.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.VTTCue');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.VTTCue\n *\n * @summary A polyfill to provide VTTCue.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.VTTCue.install = function() {\n if (window.VTTCue) {\n shaka.log.info('Using native VTTCue.');\n return;\n }\n\n if (!window.TextTrackCue) {\n shaka.log.error('VTTCue not available.');\n return;\n }\n\n var constructorLength = TextTrackCue.length;\n if (constructorLength == 3) {\n shaka.log.info('Using VTTCue polyfill from 3 argument TextTrackCue.');\n window.VTTCue = shaka.polyfill.VTTCue.from3ArgsTextTrackCue_;\n } else if (constructorLength == 6) {\n shaka.log.info('Using VTTCue polyfill from 6 argument TextTrackCue.');\n window.VTTCue = shaka.polyfill.VTTCue.from6ArgsTextTrackCue_;\n } else if (shaka.polyfill.VTTCue.canUse3ArgsTextTrackCue_()) {\n shaka.log.info('Using VTTCue polyfill from 3 argument TextTrackCue.');\n window.VTTCue = shaka.polyfill.VTTCue.from3ArgsTextTrackCue_;\n }\n};\n\n\n/**\n * Draft spec TextTrackCue with 3 constructor arguments.\n * See {@link https://goo.gl/ZXBWZi W3C Working Draft 25 October 2012}.\n *\n * @param {number} startTime\n * @param {number} endTime\n * @param {string} text\n * @return {TextTrackCue}\n * @private\n */\nshaka.polyfill.VTTCue.from3ArgsTextTrackCue_ = function(startTime, endTime,\n text) {\n return new window.TextTrackCue(startTime, endTime, text);\n};\n\n\n/**\n * Draft spec TextTrackCue with 6 constructor arguments (5th & 6th are\n * optional).\n * See {@link https://goo.gl/AYFqUh W3C Working Draft 29 March 2012}.\n * Quoting the access to the TextTrackCue object to avoid the compiler\n * complaining.\n *\n * @param {number} startTime\n * @param {number} endTime\n * @param {string} text\n * @return {TextTrackCue}\n * @private\n */\nshaka.polyfill.VTTCue.from6ArgsTextTrackCue_ = function(startTime, endTime,\n text) {\n var id = startTime + '-' + endTime + '-' + text;\n return new window['TextTrackCue'](id, startTime, endTime, text);\n};\n\n\n/**\n * IE10, IE11 and Edge returns TextTrackCue.length = 0 although it accepts 3\n * constructor arguments.\n *\n * @return {boolean}\n * @private\n */\nshaka.polyfill.VTTCue.canUse3ArgsTextTrackCue_ = function() {\n try {\n return !!shaka.polyfill.VTTCue.from3ArgsTextTrackCue_(1, 2, '');\n } catch (error) {\n return false;\n }\n};\n\n\nshaka.polyfill.register(shaka.polyfill.VTTCue.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/vttcue.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 9fe00b4907da334ae6b8","webpack:///webpack:///core/webpack/universalModuleDefinition","webpack:///webpack:/core/webpack/bootstrap 2c6e69a47798e2a1ec2f","webpack:///webpack:///core/track/track.js","webpack:///webpack:///core/utils/logger.js","webpack:///webpack:///core/event/fake-event.js","webpack:///webpack:///core/track/audio-track.js","webpack:///webpack:///core/track/text-track.js","webpack:///webpack:///core/track/video-track.js","webpack:///webpack:///core/event/event-manager.js","webpack:///webpack:///core/event/events.js","webpack:///webpack:///core/player.js","webpack:///webpack:///core/event/fake-event-target.js","webpack:///webpack:///core/utils/player-error.js","webpack:///webpack:///core/utils/util.js","webpack:///webpack:///core/engines/html5/media-source/base-media-source-adapter.js","webpack:///webpack:///core/engines/html5/media-source/media-source-provider.js","webpack:///webpack:///core/plugin/base-plugin.js","webpack:///webpack:///core/plugin/plugin-manager.js","webpack:///webpack:///core/state/state-types.js","webpack:///webpack:///core/utils/multi-map.js","webpack:///webpack:///package.json","webpack:///webpack:///core/engines/html5/html5.js","webpack:///webpack:///core/engines/html5/media-source/adapters/native-adapter.js","webpack:///webpack:///core/playkit.js","webpack:///webpack:///core/state/state-manager.js","webpack:///webpack:///core/state/state.js","webpack:///webpack:///core/track/track-types.js","webpack:///webpack:///~/js-logger/src/logger.js","webpack:///webpack:///core/player-config.json","webpack:///webpack:///providers/webpack/universalModuleDefinition","webpack:///webpack:/providers/webpack/bootstrap 638014c152c6bb21e972","webpack:///webpack:///providers/k-provider/request-builder.js","webpack:///webpack:///providers/k-provider/ovp/config.js","webpack:///webpack:///providers/k-provider/enums.js","webpack:///webpack:///providers/k-provider/ovp/services/ovp-service.js","webpack:///webpack:///providers/k-provider/base-service-result.js","webpack:///webpack:///providers/util/logger.js","webpack:///webpack:///providers/k-provider/multi-request-builder.js","webpack:///webpack:///providers/entities/media-sources.js","webpack:///webpack:///providers/entities/media-entry.js","webpack:///webpack:///providers/entities/drm.js","webpack:///webpack:///providers/entities/media-format.js","webpack:///webpack:///providers/entities/media-source.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-flavor-asset.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-media-entry.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-metadata-list-response.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-playback-context.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-playback-source.js","webpack:///webpack:///~/enumify/lib/enumify.js","webpack:///webpack:///providers/k-provider/ovp/loaders/data-loader-manager.js","webpack:///webpack:///providers/k-provider/ovp/loaders/media-entry-loader.js","webpack:///webpack:///providers/k-provider/ovp/loaders/session-loader.js","webpack:///webpack:///providers/k-provider/ovp/loaders/ui-config-loader.js","webpack:///webpack:///providers/k-provider/ovp/provider-parser.js","webpack:///webpack:///providers/k-provider/ovp/ovp-provider.js","webpack:///webpack:///providers/k-provider/ovp/play-source-url-builder.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-access-control-message.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-base-entry-list-response.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-drm-playback-plugin-data.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-metadata.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-rule-action.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-ui-conf-response.js","webpack:///webpack:///providers/k-provider/ovp/services/base-entry-service.js","webpack:///webpack:///providers/k-provider/ovp/services/meta-data-service.js","webpack:///webpack:///providers/k-provider/ovp/services/session-service.js","webpack:///webpack:///providers/k-provider/ovp/services/ui-conf-service.js","webpack:///webpack:///providers/k-provider/xml-parser.js","webpack:///./index.js","webpack:///webpack:///ui/webpack/universalModuleDefinition","webpack:///webpack:/ui/webpack/bootstrap 8f60fb2e6e6b40ac1263","webpack:///webpack:///node_modules/preact/dist/preact.js","webpack:///webpack:///node_modules/preact-redux/dist/preact-redux.js","webpack:///webpack:///ui/components/base.js","webpack:///webpack:///ui/utils/bind-actions.js","webpack:///webpack:///ui/components/icon/icon.js","webpack:///webpack:///node_modules/preact-i18n/dist/preact-i18n.js","webpack:///webpack:///node_modules/redux/es/index.js","webpack:///webpack:///node_modules/redux/es/utils/warning.js","webpack:///webpack:///ui/reducers/shell.js","webpack:///webpack:///ui/reducers/play-pause.js","webpack:///webpack:///ui/reducers/share.js","webpack:///webpack:///ui/reducers/cvaa.js","webpack:///webpack:///node_modules/process/browser.js","webpack:///webpack:///node_modules/redux/es/createStore.js","webpack:///webpack:///node_modules/lodash-es/isPlainObject.js","webpack:///webpack:///node_modules/lodash-es/_Symbol.js","webpack:///webpack:///node_modules/webpack/buildin/global.js","webpack:///webpack:///node_modules/redux/es/compose.js","webpack:///webpack:///ui/reducers/engine.js","webpack:///webpack:///ui/reducers/seekbar.js","webpack:///webpack:///ui/reducers/volume.js","webpack:///webpack:///ui/reducers/fullscreen.js","webpack:///webpack:///ui/reducers/loading.js","webpack:///webpack:///ui/reducers/settings.js","webpack:///webpack:///ui/utils/time-format.js","webpack:///webpack:///ui/components/smart-container/smart-container.js","webpack:///webpack:///ui/components/smart-container/smart-container-item.js","webpack:///webpack:///ui/components/overlay/overlay.js","webpack:///webpack:///ui/ui-manager.js","webpack:///webpack:///node_modules/lodash-es/_baseGetTag.js","webpack:///webpack:///node_modules/lodash-es/_root.js","webpack:///webpack:///node_modules/lodash-es/_freeGlobal.js","webpack:///webpack:///node_modules/lodash-es/_getRawTag.js","webpack:///webpack:///node_modules/lodash-es/_objectToString.js","webpack:///webpack:///node_modules/lodash-es/_getPrototype.js","webpack:///webpack:///node_modules/lodash-es/_overArg.js","webpack:///webpack:///node_modules/lodash-es/isObjectLike.js","webpack:///webpack:///node_modules/symbol-observable/index.js","webpack:///webpack:///node_modules/symbol-observable/lib/index.js","webpack:///webpack:///node_modules/webpack/buildin/module.js","webpack:///webpack:///node_modules/symbol-observable/lib/ponyfill.js","webpack:///webpack:///node_modules/redux/es/combineReducers.js","webpack:///webpack:///node_modules/redux/es/bindActionCreators.js","webpack:///webpack:///node_modules/redux/es/applyMiddleware.js","webpack:///webpack:///node_modules/dlv/dist/dlv.umd.js","webpack:///webpack:///ui/store.js","webpack:///webpack:///ui/fr.json","webpack:///webpack:///ui/components/engine-connector/engine-connector.js","webpack:///webpack:/ui/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","webpack:///webpack:///ui/utils/logger.js","webpack:///webpack:///node_modules/js-logger/src/logger.js","webpack:///webpack:///ui/components/shell/shell.js","webpack:///webpack:///ui/utils/is-mobile.js","webpack:///webpack:///ui/components/overlay-play/overlay-play.js","webpack:///webpack:///ui/components/loading/loading.js","webpack:///webpack:///ui/components/play-pause/play-pause.js","webpack:///webpack:///ui/components/seekbar/seekbar.js","webpack:///webpack:///ui/components/volume/volume.js","webpack:///webpack:///ui/components/share/share.js","webpack:///webpack:///ui/components/settings/settings.js","webpack:///webpack:///ui/components/dropdown-menu/dropdown-menu.js","webpack:///webpack:///ui/components/language/language.js","webpack:///webpack:///ui/components/fullscreen/fullscreen.js","webpack:///webpack:///ui/components/time-display/time-display.js","webpack:///webpack:///ui/components/top-bar/top-bar.js","webpack:///webpack:///ui/components/bottom-bar/bottom-bar.js","webpack:///webpack:///ui/components/share-overlay/share-overlay.js","webpack:///webpack:///ui/components/cvaa-overlay/cvaa-overlay.js","webpack:///webpack:///ui/components/keyboard.js","webpack:///../node_modules/playkit-js-ui/src/styles/style.css?b4f7","webpack:///../node_modules/playkit-js-ui/src/styles/style.css","webpack:///../node_modules/css-loader/lib/css-base.js","webpack:///../node_modules/style-loader/lib/addStyles.js","webpack:///../node_modules/style-loader/lib/urls.js","webpack:///webpack:///hls/webpack/universalModuleDefinition","webpack:///webpack:/hls/webpack/bootstrap 971dbcb0968c12c8d961","webpack:///webpack:///hls/hls-adapter.js","webpack:///webpack:/hls/external {\"commonjs\":\"hls.js\",\"commonjs2\":\"hls.js\",\"amd\":\"hls.js\",\"root\":\"Hls\"}","webpack:///webpack:/hls/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","webpack:///node_modules/browser-pack/_prelude.js","webpack:///node_modules/events/events.js","webpack:///node_modules/url-toolkit/src/url-toolkit.js","webpack:///node_modules/webworkify/index.js","webpack:///src/config.js","webpack:///src/controller/abr-controller.js","webpack:///src/controller/audio-stream-controller.js","webpack:///src/controller/audio-track-controller.js","webpack:///src/controller/buffer-controller.js","webpack:///src/controller/cap-level-controller.js","webpack:///src/controller/fps-controller.js","webpack:///src/controller/id3-track-controller.js","webpack:///src/controller/level-controller.js","webpack:///src/controller/stream-controller.js","webpack:///src/controller/subtitle-stream-controller.js","webpack:///src/controller/subtitle-track-controller.js","webpack:///src/controller/timeline-controller.js","webpack:///src/crypt/aes-crypto.js","webpack:///src/crypt/aes-decryptor.js","webpack:///src/crypt/decrypter.js","webpack:///src/crypt/fast-aes-key.js","webpack:///src/demux/aacdemuxer.js","webpack:///src/demux/adts.js","webpack:///src/demux/demuxer-inline.js","webpack:///src/demux/demuxer-worker.js","webpack:///src/demux/demuxer.js","webpack:///src/demux/exp-golomb.js","webpack:///src/demux/id3.js","webpack:///src/demux/mp3demuxer.js","webpack:///src/demux/mp4demuxer.js","webpack:///src/demux/mpegaudio.js","webpack:///src/demux/sample-aes.js","webpack:///src/demux/tsdemuxer.js","webpack:///src/errors.js","webpack:///src/event-handler.js","webpack:///src/events.js","webpack:///src/helper/aac.js","webpack:///src/helper/buffer-helper.js","webpack:///src/helper/level-helper.js","webpack:///src/hls.js","webpack:///src/index.js","webpack:///src/loader/fragment-loader.js","webpack:///src/loader/key-loader.js","webpack:///src/loader/playlist-loader.js","webpack:///src/remux/mp4-generator.js","webpack:///src/remux/mp4-remuxer.js","webpack:///src/remux/passthrough-remuxer.js","webpack:///src/utils/attr-list.js","webpack:///src/utils/binary-search.js","webpack:///src/utils/cea-608-parser.js","webpack:///src/utils/cues.js","webpack:///src/utils/discontinuities.js","webpack:///src/utils/ewma-bandwidth-estimator.js","webpack:///src/utils/ewma.js","webpack:///src/utils/logger.js","webpack:///src/utils/timeRanges.js","webpack:///src/utils/vttcue.js","webpack:///src/utils/vttparser.js","webpack:///src/utils/webvtt-parser.js","webpack:///src/utils/xhr-loader.js","webpack:///webpack:///dash/webpack/universalModuleDefinition","webpack:///webpack:/dash/webpack/bootstrap 249eeb77a61a9c7bb545","webpack:///webpack:///dash/dash-adapter.js","webpack:///webpack:/dash/external {\"commonjs\":\"shaka-player\",\"commonjs2\":\"shaka-player\",\"amd\":\"shaka-player\",\"root\":\"shaka\"}","webpack:///webpack:/dash/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","webpack:///../node_modules/shaka-player/third_party/closure/goog/base.js","webpack:///../node_modules/shaka-player/lib/cast/cast_proxy.js","webpack:///../node_modules/shaka-player/lib/abr/ewma.js","webpack:///../node_modules/shaka-player/lib/abr/ewma_bandwidth_estimator.js","webpack:///../node_modules/shaka-player/lib/debug/log.js","webpack:///../node_modules/shaka-player/lib/util/error.js","webpack:///../node_modules/shaka-player/third_party/closure/goog/uri/utils.js","webpack:///../node_modules/shaka-player/third_party/closure/goog/uri/uri.js","webpack:///../node_modules/shaka-player/lib/util/functional.js","webpack:///../node_modules/shaka-player/lib/util/manifest_parser_utils.js","webpack:///../node_modules/shaka-player/lib/util/config_utils.js","webpack:///../node_modules/shaka-player/lib/util/public_promise.js","webpack:///../node_modules/shaka-player/lib/net/networking_engine.js","webpack:///../node_modules/shaka-player/lib/util/array_utils.js","webpack:///../node_modules/shaka-player/lib/util/multi_map.js","webpack:///../node_modules/shaka-player/lib/util/event_manager.js","webpack:///../node_modules/shaka-player/lib/util/map_utils.js","webpack:///../node_modules/shaka-player/lib/util/string_utils.js","webpack:///../node_modules/shaka-player/lib/util/timer.js","webpack:///../node_modules/shaka-player/lib/util/uint8array_utils.js","webpack:///../node_modules/shaka-player/lib/media/drm_engine.js","webpack:///../node_modules/shaka-player/lib/media/text_engine.js","webpack:///../node_modules/shaka-player/lib/media/time_ranges_utils.js","webpack:///../node_modules/shaka-player/lib/media/media_source_engine.js","webpack:///../node_modules/shaka-player/lib/util/language_utils.js","webpack:///../node_modules/shaka-player/lib/util/stream_utils.js","webpack:///../node_modules/shaka-player/lib/abr/simple_abr_manager.js","webpack:///../node_modules/shaka-player/lib/util/fake_event.js","webpack:///../node_modules/shaka-player/lib/cast/cast_utils.js","webpack:///../node_modules/shaka-player/lib/cast/cast_sender.js","webpack:///../node_modules/shaka-player/lib/util/fake_event_target.js","webpack:///../node_modules/shaka-player/lib/player.js","webpack:///../node_modules/shaka-player/lib/cast/cast_receiver.js","webpack:///../node_modules/shaka-player/lib/util/xml_utils.js","webpack:///../node_modules/shaka-player/lib/dash/content_protection.js","webpack:///../node_modules/shaka-player/lib/dash/mpd_utils.js","webpack:///../node_modules/shaka-player/lib/media/segment_reference.js","webpack:///../node_modules/shaka-player/lib/util/data_view_reader.js","webpack:///../node_modules/shaka-player/lib/util/mp4_parser.js","webpack:///../node_modules/shaka-player/lib/media/mp4_segment_index_parser.js","webpack:///../node_modules/shaka-player/lib/media/segment_index.js","webpack:///../node_modules/shaka-player/lib/util/ebml_parser.js","webpack:///../node_modules/shaka-player/lib/media/webm_segment_index_parser.js","webpack:///../node_modules/shaka-player/lib/dash/segment_base.js","webpack:///../node_modules/shaka-player/lib/dash/segment_list.js","webpack:///../node_modules/shaka-player/lib/dash/segment_template.js","webpack:///../node_modules/shaka-player/lib/media/manifest_parser.js","webpack:///../node_modules/shaka-player/lib/media/presentation_timeline.js","webpack:///../node_modules/shaka-player/lib/dash/dash_parser.js","webpack:///../node_modules/shaka-player/lib/hls/hls_classes.js","webpack:///../node_modules/shaka-player/lib/hls/hls_utils.js","webpack:///../node_modules/shaka-player/lib/util/text_parser.js","webpack:///../node_modules/shaka-player/lib/hls/manifest_text_parser.js","webpack:///../node_modules/shaka-player/lib/net/data_uri_plugin.js","webpack:///../node_modules/shaka-player/lib/hls/hls_parser.js","webpack:///../node_modules/shaka-player/lib/media/ttml_text_parser.js","webpack:///../node_modules/shaka-player/lib/media/mp4_ttml_parser.js","webpack:///../node_modules/shaka-player/lib/media/vtt_text_parser.js","webpack:///../node_modules/shaka-player/lib/media/mp4_vtt_parser.js","webpack:///../node_modules/shaka-player/lib/media/playhead.js","webpack:///../node_modules/shaka-player/lib/media/playhead_observer.js","webpack:///../node_modules/shaka-player/lib/media/streaming_engine.js","webpack:///../node_modules/shaka-player/lib/net/http_plugin.js","webpack:///../node_modules/shaka-player/lib/offline/db_engine.js","webpack:///../node_modules/shaka-player/lib/offline/download_manager.js","webpack:///../node_modules/shaka-player/lib/offline/offline_utils.js","webpack:///../node_modules/shaka-player/lib/offline/offline_manifest_parser.js","webpack:///../node_modules/shaka-player/lib/offline/offline_scheme.js","webpack:///../node_modules/shaka-player/lib/util/cancelable_chain.js","webpack:///../node_modules/shaka-player/lib/offline/storage.js","webpack:///../node_modules/shaka-player/lib/polyfill/all.js","webpack:///../node_modules/shaka-player/lib/polyfill/fullscreen.js","webpack:///../node_modules/shaka-player/lib/polyfill/indexed_db.js","webpack:///../node_modules/shaka-player/lib/polyfill/mathround.js","webpack:///../node_modules/shaka-player/lib/util/pssh.js","webpack:///../node_modules/shaka-player/lib/polyfill/patchedmediakeys_ms.js","webpack:///../node_modules/shaka-player/lib/polyfill/patchedmediakeys_nop.js","webpack:///../node_modules/shaka-player/lib/polyfill/patchedmediakeys_webkit.js","webpack:///../node_modules/shaka-player/lib/polyfill/mediakeys.js","webpack:///../node_modules/shaka-player/lib/polyfill/mediasource.js","webpack:///../node_modules/shaka-player/lib/polyfill/promise.js","webpack:///../node_modules/shaka-player/lib/polyfill/video_play_promise.js","webpack:///../node_modules/shaka-player/lib/polyfill/videoplaybackquality.js","webpack:///../node_modules/shaka-player/lib/polyfill/vttcue.js","webpack:///./setup.js","webpack:///./session-id.js"],"names":["Track","_id","_active","value","_label","_language","_index","settings","id","active","label","language","index","JsLogger","LOG_LEVEL","DEBUG","INFO","TIME","WARN","ERROR","OFF","LoggerFactory","options","useDefaults","name","get","lf","defaultLevel","FakeEvent","type","payload","bubbles","cancelable","defaultPrevented","timeStamp","window","performance","now","Date","isTrusted","currentTarget","target","stopped","AudioTrack","TextTrack","_kind","kind","VideoTrack","_bandwidth","bandwidth","EventManager","_bindingMap","removeAll","Promise","resolve","listener","binding","Binding_","push","list","i","length","unlisten","remove","listeners","getAll","clear","addEventListener","removeEventListener","HTML5_EVENTS","ABORT","CAN_PLAY","CAN_PLAY_THROUGH","DURATION_CHANGE","EMPTIED","ENDED","LOADED_DATA","LOADED_METADATA","LOAD_START","PAUSE","PLAY","PLAYING","PROGRESS","RATE_CHANGE","SEEKED","SEEKING","STALLED","SUSPEND","TIME_UPDATE","VOLUME_CHANGE","WAITING","CUSTOM_EVENTS","VIDEO_TRACK_CHANGED","AUDIO_TRACK_CHANGED","TEXT_TRACK_CHANGED","TRACKS_CHANGED","PLAYER_STATE_CHANGED","FIRST_PLAY","SOURCE_SELECTED","PLAYER_EVENTS","Player","config","_tracks","_firstPlay","_stateManager","_pluginManager","_eventManager","_readyPromise","reject","listen","configure","_config","_defaultConfig","_selectEngine","_attachMedia","_loadPlugins","_handlePlaybackConfig","_logger","warn","_engine","destroy","plugins","load","sources","playback","streamPriority","_selectEngineByPriority","priority","engineId","engine","toLowerCase","format","_engines","find","formatSources","source","canPlayType","mimetype","_loadEngine","dispatchEvent","selectedSource","createEngine","playerEvent","event","_markActiveTrack","selectedVideoTrack","selectedAudioTrack","selectedTextTrack","_onPlay","bind","muted","preload","autoplay","play","_getTracksByType","filter","track","VIDEO","AUDIO","TEXT","selectVideoTrack","selectAudioTrack","selectTextTrack","hideTextTrack","map","enableAdaptiveBitrate","tracks","getTracks","then","data","catch","error","src","ready","pause","sessionId","session","to","boundedTo","duration","currentTime","vol","boundedVol","volume","paused","seeking","mute","getLogger","FakeEventTarget","_listeners","dispatchTarget","handleEvent","call","exception","PlayerError","param","message","TYPE","NOT_REGISTERED_PLUGIN","NOT_VALID_HANDLER","NOT_IMPLEMENTED_METHOD","method","isNumber","n","Number","isInt","isFloat","merge","objects","obj","Object","assign","isObject","item","Array","isArray","mergeDeep","shift","key","copyDeep","node","slice","forEach","e","keys","BaseMediaSourceAdapter","videoElement","_videoElement","_sourceObj","_trigger","CustomEvents","getError","videoTrack","audioTrack","textTrack","mimeType","MediaSourceProvider","mediaSourceAdapter","_mediaSourceAdapters","includes","debug","indexOf","splice","mediaSourceAdapters","_selectedAdapter","createAdapter","registerMediaSourceAdapter","register","BasePlugin","player","eventManager","logger","constructor","defaultConfig","attr","update","PluginManager","_plugins","Map","_registry","has","pluginClass","isValid","set","createPlugin","_destroy","plugin","delete","handler","prototype","registerPlugin","PLAYER_STATE_TYPES","IDLE","LOADING","PAUSED","BUFFERING","MultiMap","_map","values","concat","Html5","_createVideoElement","_loadMediaSourceAdapter","attach","detach","_mediaSourceAdapter","_el","removeAttribute","parentNode","removeChild","document","createElement","style","width","height","backgroundColor","controls","body","appendChild","getMediaSourceAdapter","getVideoElement","seekable","played","buffered","defaultMuted","poster","loop","playbackRate","defaultPlaybackRate","ended","networkState","readyState","videoHeight","videoWidth","TEST_VID","NativeAdapter","toString","_loadPromise","_getParsedTracks","url","videoTracks","_getParsedVideoTracks","audioTracks","_getParsedAudioTracks","textTracks","_getParsedTextTracks","parsedTracks","selected","enabled","mode","_disableVideoTracks","_onTrackChanged","_disableAudioTracks","_disableTextTracks","playkit","packageData","VERSION","version","log","StateManager","_transitions","_updateState","_dispatchEvent","_player","autoPlay","_history","_prevState","_curState","_attachListeners","_doTransition","transition","State","_duration","_timestamp","endTime","TRACK_TYPES","RequestBuilder","headers","baseUrl","Error","service","action","request","XMLHttpRequest","onreadystatechange","status","jsonResponse","JSON","parse","responseText","code","open","getUrl","setRequestHeader","send","params","beUrl","serviceParams","clientTag","apiVersion","Configuration","clientConfig","Scheme","initEnum","PLAYREADY_CENC","WIDEVINE_CENC","FAIRPLAY","PLAYREADY","WIDEVINE","KalturaRuleActionType","DRM_POLICY","BLOCK","PREVIEW","LIMIT_FLAVORS","ADD_TO_STORAGE","LIMIT_DELIVERY_PROFILES","SERVE_FROM_REMOTE_SERVER","REQUEST_HOST_REGEX","LIMIT_THUMBNAIL_CAPTURE","Status","QUEUED","CONVERTING","READY","DELETED","NOT_APPLICABLE","TEMP","WAIT_FOR_CONVERT","IMPORTING","VALIDATING","EXPORTING","MetadataObjectType","AD_CUE_POINT","ANNOTATION","CODE_CUE_POINT","THUMB_CUE_POINT","ENTRY","CATEGORY","USER","PARTNER","DYNAMIC_OBJECT","MetadataStatus","VALID","INVALID","EntryStatus","ERROR_IMPORTING","ERROR_CONVERTING","SCAN_FAILURE","IMPORT","INFECTED","PRECONVERT","PENDING","MODERATE","BLOCKED","NO_CONTENT","EntryModerationStatus","PENDING_MODERATION","APPROVED","REJECTED","FLAGGED_FOR_REVIEW","AUTO_APPROVED","EntryType","AUTOMATIC","EXTERNAL_MEDIA","MEDIA_CLIP","MIX","PLAYLIST","DATA","LIVE_STREAM","LIVE_CHANNEL","DOCUMENT","MediaType","IMAGE","LIVE_STREAM_FLASH","LIVE_STREAM_WINDOWS_MEDIA","LIVE_STREAM_REAL_MEDIA","LIVE_STREAM_QUICKTIME","MediaEntryType","UIConfType","PLAYER","CONTRIBUTION_WIZARD","SIMPLE_EDITOR","ADVANCED_EDITOR","APP_STUDIO","KRECORD","PLAYER_V3","KMC_ACCOUNT","KMC_ANALYTICS","KMC_CONTENT","KMC_DASHBOARD","KMC_LOGIN","PLAYER_SL","CLIENTSIDE_ENCODER","KMC_GENERAL","KMC_ROLES_AND_PERMISSIONS","CLIPPER","KSR","KUPLOAD","WEBCASTING","UIConfCreationMode","WIZARD","ADVANCED","SERVICE_NAME","OvpService","ks","partnerId","ovpParams","multiReq","ServiceResult","response","hasError","objectType","ServiceError","Logger","MultiRequestBuilder","requests","requestParams","serviceDef","stringify","err","doHttpRequest","MultiRequestResult","errorText","results","success","result","serviceResult","MediaSources","progressive","dash","hls","mediaFormat","MediaEntry","metaData","Unknown","Drm","licenseUrl","scheme","MediaFormat","pathExt","wvm","mp4","mp3","MediaSource","KalturaFlavorAsset","flavorParamsId","fileExt","bitrate","frameRate","isOriginal","isWeb","containerFormat","videoCodecId","KalturaMediaEntry","entry","dataUrl","entryType","mediaType","flavorParamsIds","KalturaMetadataListResponse","responseObj","totalCount","metas","meta","KalturaPlaybackContext","actions","messages","flavorAssets","flavor","KalturaPlaybackSource","drm","deliveryProfileId","protocols","flavorIds","protocol","returnValue","protocolsArr","split","p","DataLoaderManager","partnerID","_loaders","_multiRequest","getMultirequest","loader","execution_loader","startIndex","add","executionLoaderResponseMap","from","val","_loadersResponseMap","execute","_multiResponse","preparedData","prepareData","loaderDataIndexes","MediaEntryLoader","_response","buildRequests","_entryId","entryId","getPlaybackContext","_requests","mediaEntryResponse","entries","playBackContextResult","metadataListResult","SessionLoader","_partnerId","anonymousSession","UiConfigLoader","_uiConfId","uiConfId","uiConf","SUPPORTED_FORMATS","ProviderParser","mediaEntry","playbackContext","metadataList","kalturaSources","parsedSource","parseSource","metadata","parseMetaData","Image","Audio","Vod","Live","playUrl","mediaSource","hasFlavorIds","splittedUrl","baseProtocol","substring","extension","flavorIdsArr","flavors","build","getProtocol","hasDrmData","drmParams","licenseURL","drmData","metaXml","domParser","DOMParser","xml","replace","parseFromString","metasObj","xmlToJson","metaKeys","OvpProvider","_isAnonymous","_dataLoader","validateParams","fetchData","parseDataFromResponse","uiConfID","sessionLoader","uiConfLoader","pluginsJson","mediaLoader","getMediaEntry","PlaySourceUrlBuilder","urlParams","endsWith","string","searchString","KalturaAccessControlMessage","KalturaBaseEntryListResponse","KalturaDrmPlaybackPluginData","KalturaMetadata","metadataProfileId","metadataProfileVersion","metadataObjectType","objectId","created","setUTCSeconds","createdAt","updated","updatedAt","KalturaRuleAction","KalturaUiConfResponse","description","objTypeAsString","htmlParams","swfUrl","confFilePath","confFile","confFileFeatures","confVars","useCdn","tags","swfUrlVersion","html5Url","partnerTags","objType","creationMode","BaseEntryService","tag","contextDataParams","flavorTags","getEntryListReqParams","filterParams","redirectFromEntryId","responseProfileParams","fields","responseProfile","MetaDataService","objectIdEqual","metadataObjectTypeEqual","SessionService","widgetId","UiConfService","XmlParser","nodeType","attributes","j","attribute","nodeName","nodeValue","hasChildNodes","childNodes","old","Playkit","PlaykitUI","setup","BaseComponent","bindActions","dispatch","Icon","props","types","ADD_PLAYER_CLASS","REMOVE_PLAYER_CLASS","UPDATE_IS_MOBILE","initialState","playerClasses","state","className","c","isMobile","addPlayerClass","removePlayerClass","updateIsMobile","TOGGLE_PLAY","isPlaying","toggleIsPlaying","TOGGLE_SHARE_OVERLAY","overlayOpen","show","toggleShareOverlay","TOGGLE_CVAA_OVERLAY","toggleCVAAOverlay","UPDATE_PLAYER_STATE","UPDATE_IS_PLAYING","UPDATE_CURRENT_TIME","UPDATE_DURATION","UPDATE_VOLUME","UPDATE_MUTED","UPDATE_METADATA_LOADING_STATUS","UPDATE_AUDIO_TRACKS","UPDATE_VIDEO_TRACKS","UPDATE_TEXT_TRACKS","metadataLoaded","playerState","previousState","currentState","updatePlayerState","prevoiusState","updateIsPlaying","updateCurrentTime","updateDuration","updateVolume","updateMuted","updateMetadataLoadingStatus","updateAudioTracks","updateVideoTracks","updateTextTracks","UPDATE_SEEKBAR_DRAGGING_STATUS","draggingActive","updateSeekbarDraggingStatus","UPDATE_VOLUME_DRAGGING_STATUS","updateVolumeDraggingStatus","UPDATE_FULLSCREEN","fullscreen","updateFullscreen","UPDATE_LOADING_SPINNER_STATE","showLoadingSpinner","updateLoadingSpinnerState","UPDATE_QUALITY","UPDATE_SPEED","quality","speed","updateQuality","updateSpeed","toHHMMSS","input","sec_num","parseInt","hours","Math","floor","minutes","seconds","SmartContainer","children","onSelect","o","Overlay","overlayClass","onClose","UIManager","ui","template","_buildUI","store","devToolsExtension","instanceId","playerWrapper","playerElement","getElementsByTagName","getElementsByClassName","reducer","shell","seekbar","loading","playPause","share","cvaa","EngineConnector","Event","oldState","newState","TrackType","t","mapStateToProps","Shell","join","orientation","navigator","userAgent","OverlayPlay","setState","animation","setTimeout","togglePlayPause","Loading","PlayPauseControl","controlButtonClass","virtualProgress","virtualTime","isDraggingActive","SeekBarControl","onSeekbarMouseDown","time","getTime","updateSeekBarProgress","onSeekbarMouseUp","onSeekbarMouseMove","_playerElement","_seekBarElement","virtual","clientX","offsetLeft","clientWidth","parseFloat","toFixed","ceil","virtualProgressWidth","progressWidth","framePreviewStyle","getThumbSpriteOffset","round","showFramePreview","showTimeBubble","VolumeControl","_volumeControlElement","_volumeProgressBarElement","changeVolume","barHeight","clientHeight","topY","getCoords","top","clickY","clientY","el","box","getBoundingClientRect","pageYOffset","left","pageXOffset","onVolumeControlButtonClick","onVolumeProgressBarMouseDown","onVolumeProgressBarClick","getVolumeProgessHeight","ShareControl","SettingsControl","smartContainerOpen","speedOptions","qualityOptions","onControlButtonClick","onQualityChange","onSpeedChange","DropDownMenu","dropMenuActive","activeOptions","getActiveOptionLabel","isSelected","LanguageControl","audioOptions","textOptions","onAudioChange","onCaptionsChange","FullscreenControl","webkitIsFullScreen","webkitRequestFullscreen","webkitCancelFullScreen","exitFullscreen","enterFullscreen","toggleFullscreen","TimeDisplay","current","total","getTimeDisplay","TopBar","BottomBar","ShareOverlay","CVAAOverlay","KeyboardControl","onkeydown","newVolume","which","disableKeyboardCommandsOnControls","controlButtonsElements","element","preventDefault","HlsAdapter","canHlsPlayType","_hlsMimeTypes","isHlsSupported","isSupported","_hls","_addBindings","on","Events","_onError","LEVEL_SWITCHED","_onLevelSwitched","AUDIO_TRACK_SWITCHED","_onAudioTrackSwitched","MANIFEST_LOADED","_playerTracks","_parseTracks","loadSource","attachMedia","_removeBindings","detachMedia","_parseAudioTracks","_parseVideoTracks","levels","_parseTextTracks","hlsAudioTracks","lang","hlsVideoTracks","startLevel","vidTextTracks","autoLevelEnabled","nextLevel","_disableAllTextTracks","level","errorType","errorDetails","details","errorFatal","fatal","ErrorTypes","NETWORK_ERROR","startLoad","MEDIA_ERROR","recoverMediaError","ErrorDetails","MANIFEST_LOAD_ERROR","MANIFEST_LOAD_TIMEOUT","MANIFEST_PARSING_ERROR","LEVEL_LOAD_ERROR","LEVEL_LOAD_TIMEOUT","LEVEL_SWITCH_ERROR","FRAG_LOAD_ERROR","FRAG_LOOP_LOADING_ERROR","FRAG_LOAD_TIMEOUT","FRAG_PARSING_ERROR","BUFFER_APPEND_ERROR","BUFFER_APPENDING_ERROR","off","DashAdapter","_dashMimeType","polyfill","installAll","isBrowserSupported","_shaka","_onAdaptation","variantTracks","getVariantTracks","activeVariantTrack","variantTrack","audioId","videoId","_getVideoTracks","_getAudioTracks","getTextTracks","abr","selectVariantTrack","selectAudioLanguage","selectTextLanguage","setTextTrackVisibility","goog.global","goog.global.CLOSURE_NO_DEPS","CLOSURE_NO_DEPS","goog.exportSymbol","publicPath","object","parts","cur","execScript","part","goog.inherits","childCtor","shaka.util.FakeEventTarget","tempCtor","parentCtor","superClass_","base","childCtor.base","me","methodName","var_args","apply","args","arguments","shaka.abr.Ewma","halfLife","alpha_","exp","totalWeight_","estimate_","shaka.abr.Ewma.prototype.sample","weight","adjAlpha","pow","newEstimate","isNaN","shaka.abr.Ewma.prototype.getEstimate","shaka.abr.EwmaBandwidthEstimator","fast_","slow_","bytesSampled_","defaultEstimate_","shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE","setDefaultEstimate","shaka.abr.EwmaBandwidthEstimator.prototype.setDefaultEstimate","estimate","getBandwidthEstimate","shaka.abr.EwmaBandwidthEstimator.prototype.getBandwidthEstimate","minTotalBytes_","min","getEstimate","shaka.log.error","shaka.util.Error","severity","category","shaka.util.Error.prototype.toString","shaka.util.Error.Severity","shaka.util.Error.Category","shaka.util.Error.Code","goog.uri.utils.splitRe_","goog.Uri","opt_uri","m","setScheme","scheme_","setUserInfo","userInfo_","setDomain","domain_","setPort","port_","setPath","path_","setQueryData","clone","queryData_","setFragment","fragment_","String","uri","match","SCHEME","goog.Uri.decodeOrEmpty_","USER_INFO","DOMAIN","PORT","PATH","QUERY_DATA","FRAGMENT","goog.Uri.QueryData","goog$Uri.prototype","goog.Uri.prototype","goog.Uri.prototype.toString","out","getScheme","goog.Uri.encodeSpecialChars_","goog.Uri.reDisallowedInSchemeOrUserInfo_","domain","getDomain","userInfo","getUserInfo","encodeURIComponent","doubleEncodedString","port","getPort","path","getPath","hasDomain","charAt","goog.Uri.reDisallowedInAbsolutePath_","goog.Uri.reDisallowedInRelativePath_","query","getEncodedQuery","fragment","getFragment","goog.Uri.reDisallowedInFragment_","goog.Uri.prototype.resolve","relativeUri","absoluteUri","overridden","hasPath","lastSlashIndex","lastIndexOf","substr","leadingSlash","segments","pos","segment","pop","goog.Uri.prototype.setScheme","newScheme","opt_decode","goog.Uri.prototype.setPort","newPort","goog.Uri.prototype.setQueryData","queryData","goog.Uri.reDisallowedInQuery_","opt_preserveReserved","decodeURI","decodeURIComponent","unescapedPart","extra","opt_removeDoubleEncoding","encoded","encodeURI","goog.Uri.encodeChar_","ch","charCodeAt","opt_query","encodedQuery_","keyMap_","count_","goog.Uri.QueryData.prototype.toString","sb","encodedKey","goog.Uri.QueryData.prototype.clone","rv","cloneMap","shaka.util.Functional.createFallbackPromiseChain","array","callback","reduce","promise","elem","shaka.util.Functional.collapseArrays","all","shaka.util.Functional.noop","shaka.util.Functional.isNotNull","shaka.util.Functional.isNotEqualFunc","compare","a","shaka.util.Functional.isNotDuplicate","position","self","shaka.util.ManifestParserUtils.resolveUris","baseUris","relativeUris","relativeAsGoog","shaka.util.ManifestParserUtils.createDrmInfo","keySystem","initData","licenseServerUri","distinctiveIdentifierRequired","persistentStateRequired","audioRobustness","videoRobustness","serverCertificate","keyIds","shaka.util.ConfigUtils.mergeConfigObjects","destination","overrides","ignoreKeys","k","subPath","subTemplate","copyObject","undefined","shaka.util.ConfigUtils.cloneObject","arg","shaka.util.PublicPromise","resolvePromise","rejectPromise","shaka.net.NetworkingEngine","opt_onSegmentDownloaded","destroyed_","requests_","requestFilters_","responseFilters_","onSegmentDownloaded_","NetworkingEngine","shaka.net.NetworkingEngine.RequestType","shaka.net.NetworkingEngine.schemes_","shaka.net.NetworkingEngine.registerScheme","shaka.net.NetworkingEngine.unregisterScheme","registerRequestFilter","shaka.net.NetworkingEngine.prototype.registerRequestFilter","goog.exportProperty","unregisterRequestFilter","shaka.net.NetworkingEngine.prototype.unregisterRequestFilter","filters","clearAllRequestFilters","shaka.net.NetworkingEngine.prototype.clearAllRequestFilters","registerResponseFilter","shaka.net.NetworkingEngine.prototype.registerResponseFilter","unregisterResponseFilter","shaka.net.NetworkingEngine.prototype.unregisterResponseFilter","clearAllResponseFilters","shaka.net.NetworkingEngine.prototype.clearAllResponseFilters","shaka.net.NetworkingEngine.defaultRetryParameters","maxAttempts","baseDelay","backoffFactor","fuzzFactor","timeout","shaka.net.NetworkingEngine.makeRequest","uris","retryParams","allowCrossSiteCredentials","retryParameters","shaka.net.NetworkingEngine.prototype.destroy","cleanup","shaka.net.NetworkingEngine.prototype.request","filterStartMs","requestFilter","shaka.util.Error.Severity.CRITICAL","shaka.util.Error.Category.NETWORK","shaka.util.Error.Code.REQUEST_FILTER_ERROR","filterTimeMs","retry","delay","send_","shaka.util.Error.Severity.RECOVERABLE","random","resend_","fromCache","shaka.net.NetworkingEngine.RequestType.SEGMENT","timeMs","byteLength","shaka.net.NetworkingEngine.prototype.send_","requestFilterTime","location","shaka.util.Error.Code.UNSUPPORTED_SCHEME","startTimeMs","responseFilter","shaka.util.Error.Code.RESPONSE_FILTER_ERROR","shaka.util.ArrayUtils.removeDuplicates","opt_compareFn","matchFound","shaka.util.ArrayUtils.indexOf","compareFn","shaka.util.MultiMap","map_","shaka.util.MultiMap.prototype.push","hasOwnProperty","shaka.util.MultiMap.prototype.get","shaka.util.MultiMap.prototype.remove","shaka.util.EventManager","bindingMap_","shaka.util.EventManager.prototype.destroy","shaka.util.EventManager.prototype.listen","shaka.util.EventManager.Binding_","shaka.util.EventManager.prototype.listenOnce","shaka.util.EventManager.prototype.unlisten","shaka.util.EventManager.prototype.removeAll","shaka.util.EventManager.Binding_.prototype.unlisten","shaka.util.MapUtils.empty","shaka.util.MapUtils.values","shaka.util.MapUtils.map","ret","shaka.util.MapUtils.every","every","shaka.util.MapUtils.forEach","shaka.util.StringUtils.fromUTF8","uint8","Uint8Array","subarray","escaped","escape","shaka.util.StringUtils.fromCharCode_","utf8","shaka.util.Error.Category.TEXT","shaka.util.Error.Code.BAD_ENCODING","fromUTF8","shaka.util.StringUtils.fromUTF16","littleEndian","opt_noThrow","ArrayBuffer","buffer","temp","arr","Uint16Array","dataView","DataView","getUint16","fromUTF16","shaka.util.StringUtils.fromBytesAutoDetect","isAscii","shaka.util.Error.Code.UNABLE_TO_DETECT_ENCODING","fromBytesAutoDetect","shaka.util.StringUtils.toUTF8","str","unescape","toUTF8","max","fromCharCode","subArray","shaka.util.Timer","id_","callback_","cancel","shaka.util.Timer.prototype.cancel","clearTimeout","shaka.util.Timer.prototype.schedule","shaka.util.Uint8ArrayUtils.toBase64","opt_padding","padding","base64","btoa","bytes","toBase64","shaka.util.Uint8ArrayUtils.fromBase64","atob","fromBase64","shaka.util.Uint8ArrayUtils.fromHex","fromHex","shaka.util.Uint8ArrayUtils.toHex","hex","toHex","shaka.util.Uint8ArrayUtils.equal","arr1","arr2","equal","shaka.util.Uint8ArrayUtils.concat","totalLength","offset","shaka.media.DrmEngine","networkingEngine","onError","onKeyStatus","onExpirationUpdated","video_","mediaKeys_","supportedTypes_","initialized_","currentDrmInfo_","eventManager_","activeSessions_","offlineSessionIds_","allSessionsLoaded_","networkingEngine_","config_","onError_","keyStatusByKeyId_","onKeyStatus_","onExpirationUpdated_","keyStatusTimer_","processKeyStatusChanges_","isOffline_","mediaKeyMessageEvents_","initialRequestsSent_","expirationInterval_","setInterval","pollExpiration_","shaka$media$DrmEngine.prototype","shaka.media.DrmEngine.prototype","shaka.media.DrmEngine.prototype.destroy","async","activeSession","close","setMediaKeys","clearInterval","shaka.media.DrmEngine.prototype.configure","init","shaka.media.DrmEngine.prototype.init","manifest","offline","configsByKeySystem","keySystemsInOrder","offlineSessionIds","prepareMediaKeyConfigs_","queryMediaKeys_","shaka.media.DrmEngine.prototype.attach","video","listenOnce","shaka.util.Error.Category.DRM","shaka.util.Error.Code.ENCRYPTED_CONTENT_WITHOUT_DRM_INFO","onPlay_","shaka.util.Error.Code.FAILED_TO_ATTACH_TO_VIDEO","setServerCertificate","shaka.util.Error.Code.INVALID_SERVER_CERTIFICATE","createOrLoad","onEncrypted_","onEncrypted","shaka.media.DrmEngine.prototype.removeSessions","sessions","loadOfflineSession_","updatePromise","shaka.media.DrmEngine.prototype.createOrLoad","initDatas","initDataOverride","createTemporarySession_","initDataType","shaka.media.DrmEngine.prototype.keySystem","shaka.media.DrmEngine.prototype.getSessionIds","getExpiration","shaka.media.DrmEngine.prototype.getExpiration","expirations","expiration","Infinity","shaka.media.DrmEngine.prototype.prepareMediaKeyConfigs_","clearKeyDrmInfo","configureClearKey_","periods","period","variants","variant","drmInfos","drmInfo","fillInDrmInfoDefaults_","cast","__platform__","audioCapabilities","videoCapabilities","distinctiveIdentifier","persistentState","sessionTypes","streams","audio","stream","capabilities","robustness","fullMimeType","codecs","contentType","shaka.media.DrmEngine.prototype.queryMediaKeys_","shaka.util.Error.Code.NO_RECOGNIZED_KEY_SYSTEMS","instigator","shouldHaveLicenseServer","some","hasLicenseServer","info","requestMediaKeySystemAccess","shaka.util.Error.Code.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE","mediaKeySystemAccess","isEdge","realConfig","getConfiguration","caps","originalConfig","createCurrentDrmInfo_","createMediaKeys","shaka.util.Error.Code.NO_LICENSE_SERVER_GIVEN","mediaKeys","shaka.util.Error.Code.FAILED_TO_CREATE_CDM","shaka.media.DrmEngine.prototype.fillInDrmInfoDefaults_","server","servers","advanced","shaka.media.DrmEngine.prototype.configureClearKey_","clearKeys","keyIdHex","keyHex","keyId","keyObj","kty","kid","license","jwkSet","initDataStr","shaka.media.DrmEngine.prototype.createCurrentDrmInfo_","licenseServers","serverCerts","processDrmInfos_","shaka.media.DrmEngine.prototype.processDrmInfos_","initDataOverrideEqual","b","shaka.media.DrmEngine.prototype.onEncrypted_","shaka.media.DrmEngine.prototype.loadOfflineSession_","createSession","shaka.util.Error.Code.FAILED_TO_CREATE_SESSION","onSessionMessage_","onKeyStatusesChange_","loaded","oldExpiration","present","s","shaka.util.Error.Code.OFFLINE_SESSION_REMOVED","shaka.media.DrmEngine.prototype.createTemporarySession_","generateRequest","shaka.util.Error.Code.FAILED_TO_GENERATE_LICENSE_REQUEST","shaka.media.DrmEngine.prototype.onSessionMessage_","delayLicenseRequest_","delayLicenseRequestUntilPlayed","sendLicenseRequest_","shaka.media.DrmEngine.prototype.sendLicenseRequest_","unpackPlayReadyRequest_","shaka.net.NetworkingEngine.RequestType.LICENSE","shakaErr","shaka.util.Error.Code.LICENSE_REQUEST_FAILED","shaka.util.Error.Code.LICENSE_RESPONSE_REJECTED","shaka.media.DrmEngine.prototype.unpackPlayReadyRequest_","dom","querySelector","textContent","challenge","shaka.media.DrmEngine.prototype.onKeyStatusesChange_","hasExpiredKeys","keyStatuses","tmp","part0","getUint32","part1","part2","setUint32","setUint16","msUntilExpiration","schedule","shaka.media.DrmEngine.prototype.processKeyStatusChanges_","isExpired","shaka.util.Error.Code.EXPIRED","shaka.media.DrmEngine.probeSupport","tests","basicVideoCapabilities","configs","offlineConfig","basicConfig","support","testKeySystems","access","shaka.media.DrmEngine.prototype.onPlay_","shaka.media.DrmEngine.prototype.isSupportedByKeySystem","shaka.media.DrmEngine.getCommonDrmInfos","drms1","drms2","commonDrms","drm1","drm2","mergedDrm","shaka.media.DrmEngine.prototype.pollExpiration_","new_","shaka.media.TextEngine","parser_","track_","timestampOffset_","appendWindowEnd_","bufferEnd_","bufferStart_","shaka.media.TextEngine.parserMap_","shaka.media.TextEngine.registerParser","shaka.media.TextEngine.TextParserWrapper_.bind","registerParser","unregisterParser","shaka.media.TextEngine.unregisterParser","shaka.media.TextEngine.makeCue","startTime","VTTCue","makeCue","shaka.media.TextEngine.prototype.destroy","removeWhere_","shaka.media.TextEngine.prototype.appendBuffer","parseInit","cues","parseMedia","periodStart","segmentStart","segmentEnd","addCue","shaka.media.TextEngine.prototype.remove","start","end","cue","shaka.media.TextEngine.prototype.removeWhere_","predicate","removeMe","removeCue","shaka.media.TextEngine.TextParserWrapper_","parser","shaka.media.TextEngine.TextParserWrapper_.prototype.parseInit","shaka.media.TextEngine.TextParserWrapper_.prototype.parseMedia","shaka.media.TimeRangesUtils.bufferEnd","shaka.media.TimeRangesUtils.isBuffered","shaka.media.TimeRangesUtils.bufferedAheadOf","shaka.media.MediaSourceEngine","mediaSource_","textTrack_","sourceBuffers_","textEngine_","queues_","shaka.media.MediaSourceEngine.probeSupport","testMimeTypes","isTypeSupported","basicType","shaka$media$MediaSourceEngine.prototype","shaka.media.MediaSourceEngine.prototype","shaka.media.MediaSourceEngine.prototype.destroy","q","inProgress","shaka.media.MediaSourceEngine.prototype.init","typeConfig","reinitText","sourceBuffer","addSourceBuffer","onUpdateEnd_","shaka.media.MediaSourceEngine.prototype.reinitText","factory","shaka.media.MediaSourceEngine.prototype.bufferStart","shaka.media.MediaSourceEngine.prototype.getBuffered_","shaka.media.MediaSourceEngine.prototype.appendBuffer","appendBuffer","enqueueOperation_","append_","shaka.media.MediaSourceEngine.prototype.remove","remove_","shaka.media.MediaSourceEngine.prototype.clear","shaka.media.MediaSourceEngine.prototype.setStreamProperties","timestampOffset","appendWindowEnd","abort_","setTimestampOffset_","setAppendWindowEnd_","endOfStream","shaka.media.MediaSourceEngine.prototype.endOfStream","opt_reason","enqueueBlockingOperation_","setDuration","shaka.media.MediaSourceEngine.prototype.setDuration","getDuration","shaka.media.MediaSourceEngine.prototype.getDuration","shaka_media_MediaSourceEngine_prototype$append_","shaka.media.MediaSourceEngine.prototype.append_","shaka.media.MediaSourceEngine.prototype.remove_","shaka.media.MediaSourceEngine.prototype.abort_","abort","flush_","shaka.media.MediaSourceEngine.prototype.flush_","shaka.media.MediaSourceEngine.prototype.setTimestampOffset_","shaka.media.MediaSourceEngine.prototype.setAppendWindowEnd_","fudge","shaka_media_MediaSourceEngine_prototype$onError_","shaka.media.MediaSourceEngine.prototype.onError_","operation","shaka.util.Error.Category.MEDIA","shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_FAILED","shaka.media.MediaSourceEngine.prototype.onUpdateEnd_","popFromQueue_","shaka.media.MediaSourceEngine.prototype.enqueueOperation_","shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR","shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW","shaka.media.MediaSourceEngine.prototype.enqueueBlockingOperation_","run","allWaiters","shaka.media.MediaSourceEngine.prototype.popFromQueue_","next","shaka.util.LanguageUtils.match","fuzz","preference","candidate","shaka.util.LanguageUtils.MatchType.BASE_LANGUAGE_OKAY","shaka.util.LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY","BASE_LANGUAGE_OKAY","OTHER_SUB_LANGUAGE_OKAY","shaka.util.LanguageUtils.normalize","replacement","shaka.util.LanguageUtils.isoMap_","shaka.util.StreamUtils.meetsRestrictions","restrictions","maxHwRes","minWidth","maxWidth","minHeight","maxHeight","minPixels","maxPixels","minBandwidth","maxBandwidth","shaka.util.StreamUtils.applyRestrictions","tracksChanged","originalAllowed","allowedByApplication","shaka.util.StreamUtils.filterPeriod","drmEngine","activeStreams","activeVideo","activeAudio","isSupportedByKeySystem","shaka.util.StreamUtils.streamIsCompatible_","textStreams","shaka.util.StreamUtils.getFullMimeType","activeStream","drmSupportedMimeTypes","encrypted","shaka.util.StreamUtils.getVariantTracks","activeAudioId","activeVideoId","shaka.util.StreamUtils.getPlayableVariants","isActive","audioCodec","videoCodec","roles","audioRoles","videoRoles","primary","shaka.util.StreamUtils.getTextTracks","activeStreamId","shaka.util.StreamUtils.findVariantForTrack","shaka.util.StreamUtils.findTextStreamForTrack","allowedByKeySystem","shaka.util.StreamUtils.filterVariantsByRoleAndLanguage","preferredLanguage","opt_languageMatches","opt_role","chosen","primaryVariants","pref","EXACT","matchType","betterLangMatchFound","role","chosenWithRoles","shaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage","primaryStreams","shaka.util.StreamUtils.getVariantByStreams","shaka.util.StreamUtils.getVariantByStreamIds","matchesId","opt_codecs","shaka.util.StreamUtils.findPeriodContainingTime","shaka.util.StreamUtils.findPeriodContainingStream","periodIdx","textStream","trickModeVideo","shaka.abr.SimpleAbrManager","switch_","enabled_","bandwidthEstimator_","variants_","textStreams_","startupComplete_","lastTimeChosenMs_","restrictions_","SimpleAbrManager","stop","shaka.abr.SimpleAbrManager.prototype.stop","shaka.abr.SimpleAbrManager.prototype.init","switchCallback","chooseStreams","shaka.abr.SimpleAbrManager.prototype.chooseStreams","mediaTypesToUpdate","sortedVariants","shaka.abr.SimpleAbrManager.filterAndSortVariants_","chooseVariant_","currentBandwidth","shaka.util.Error.Category.MANIFEST","shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET","shaka.abr.SimpleAbrManager.BANDWIDTH_UPGRADE_TARGET_","shaka.abr.SimpleAbrManager.BANDWIDTH_DOWNGRADE_TARGET_","enable","shaka.abr.SimpleAbrManager.prototype.enable","disable","shaka.abr.SimpleAbrManager.prototype.disable","segmentDownloaded","shaka.abr.SimpleAbrManager.prototype.segmentDownloaded","deltaTimeMs","numBytes","minBytes_","sample","suggestStreams_","shaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS","shaka.abr.SimpleAbrManager.prototype.getBandwidthEstimate","shaka.abr.SimpleAbrManager.prototype.setDefaultEstimate","setRestrictions","shaka.abr.SimpleAbrManager.prototype.setRestrictions","setVariants","shaka.abr.SimpleAbrManager.prototype.setVariants","setTextStreams","shaka.abr.SimpleAbrManager.prototype.setTextStreams","sort","v1","v2","shaka.util.FakeEvent","opt_dict","dict","shaka.util.FakeEvent.prototype.preventDefault","stopImmediatePropagation","shaka.util.FakeEvent.prototype.stopImmediatePropagation","stopPropagation","shaka.util.FakeEvent.prototype.stopPropagation","shaka.cast.CastUtils.VideoEvents","shaka.cast.CastUtils.VideoAttributes","shaka.cast.CastUtils.VideoInitStateAttributes","shaka.cast.CastUtils.VideoVoidMethods","shaka.cast.CastUtils.PlayerEvents","shaka.cast.CastUtils.PlayerGetterMethods","shaka.cast.CastUtils.PlayerInitState","shaka.cast.CastUtils.PlayerInitAfterLoadState","shaka.cast.CastUtils.PlayerVoidMethods","shaka.cast.CastUtils.PlayerPromiseMethods","shaka.cast.CastUtils.serialize","thing","simpleEvent","eventKey","eventValue","TimeRanges","ranges","shaka.cast.CastUtils.deserialize","NaN","shaka.cast.CastUtils.simulateTimeRanges_","shaka.cast.CastSender","receiverAppId","onStatusChanged","onRemoteEvent","onResumeLocal","onInitStateRequired","receiverAppId_","onStatusChanged_","onRemoteEvent_","onResumeLocal_","onInitStateRequired_","isCasting_","hasReceivers_","apiReady_","receiverName_","session_","appData_","cachedProperties_","nextAsyncCallId_","asyncCallPromises_","castPromise_","shaka$cast$CastSender.prototype","shaka.cast.CastSender.prototype","shaka.cast.CastSender.prototype.destroy","rejectAllPromises_","leave","isCasting","shaka.cast.CastSender.prototype.isCasting","receiverName","shaka.cast.CastSender.prototype.receiverName","shaka.cast.CastSender.prototype.init","chrome","isAvailable","__onGCastApiAvailable","sessionRequest","SessionRequest","apiConfig","ApiConfig","onExistingSessionJoined_","onReceiverStatusChanged_","initialize","setAppData","shaka.cast.CastSender.prototype.setAppData","appData","sendMessage_","shaka.cast.CastSender.prototype.cast","initState","shaka.util.Error.Category.CAST","shaka.util.Error.Code.CAST_API_UNAVAILABLE","shaka.util.Error.Code.NO_CAST_RECEIVERS","shaka.util.Error.Code.ALREADY_CASTING","requestSession","onSessionInitiated_","onConnectionError_","forceDisconnect","shaka.cast.CastSender.prototype.forceDisconnect","shaka.cast.CastSender.prototype.get","targetName","property","shaka.cast.CastUtils.VideoVoidMethods.indexOf","remoteCall_","shaka.cast.CastUtils.PlayerVoidMethods.indexOf","shaka.cast.CastUtils.PlayerPromiseMethods.indexOf","remoteAsyncCall_","shaka.cast.CastUtils.PlayerGetterMethods.indexOf","propertyGetter_","shaka.cast.CastSender.prototype.set","shaka.cast.CastSender.prototype.onSessionInitiated_","onSessionCreated_","addUpdateListener","onConnectionStatusChanged_","addMessageListener","shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE","onMessageReceived_","shaka.cast.CastSender.prototype.onConnectionError_","shaka.util.Error.Code.UNEXPECTED_CAST_ERROR","shaka.util.Error.Code.CAST_CANCELED_BY_USER","shaka.util.Error.Code.CAST_CONNECTION_TIMED_OUT","shaka.util.Error.Code.CAST_RECEIVER_APP_UNAVAILABLE","shaka.cast.CastSender.prototype.propertyGetter_","shaka.cast.CastSender.prototype.remoteCall_","shaka.cast.CastSender.prototype.remoteAsyncCall_","shaka.cast.CastSender.prototype.onExistingSessionJoined_","shaka.cast.CastSender.prototype.onReceiverStatusChanged_","availability","shaka.cast.CastSender.prototype.onConnectionStatusChanged_","connected","receiver","friendlyName","shaka.cast.CastSender.prototype.rejectAllPromises_","shaka.util.Error.Category.PLAYER","shaka.util.Error.Code.LOAD_INTERRUPTED","shaka.cast.CastSender.prototype.onMessageReceived_","namespace","serialized","fakeEvent","reconstructedError","shaka.cast.CastSender.prototype.sendMessage_","sendMessage","listeners_","shaka.util.FakeEventTarget.prototype.addEventListener","shaka.util.FakeEventTarget.prototype.removeEventListener","shaka.util.FakeEventTarget.prototype.dispatchEvent","shaka.cast.CastProxy","shaka.util.FakeEventTarget.call","localVideo_","localPlayer_","playerEventTarget_","videoEventTarget_","playerProxy_","videoProxy_","sender_","onCastStatusChanged_","getInitState_","init_","CastProxy","shaka.cast.CastProxy.prototype.destroy","opt_forceDisconnect","getVideo","shaka.cast.CastProxy.prototype.getVideo","getPlayer","shaka.cast.CastProxy.prototype.getPlayer","canCast","shaka.cast.CastProxy.prototype.canCast","shaka.cast.CastProxy.prototype.isCasting","shaka.cast.CastProxy.prototype.receiverName","shaka.cast.CastProxy.prototype.cast","unload","shaka.cast.CastProxy.prototype.setAppData","suggestDisconnect","shaka.cast.CastProxy.prototype.suggestDisconnect","shaka.cast.CastProxy.prototype.forceDisconnect","shaka.cast.CastProxy.prototype.init_","shaka.cast.CastUtils.VideoEvents.forEach","videoProxyLocalEvent_","shaka.cast.CastUtils.PlayerEvents.forEach","playerProxyLocalEvent_","defineProperty","configurable","enumerable","videoProxyGet_","videoProxySet_","playerProxyGet_","shaka$cast$CastProxy.prototype","shaka.cast.CastProxy.prototype","shaka.cast.CastProxy.prototype.getInitState_","manifestUri_","shaka.cast.CastUtils.VideoInitStateAttributes.forEach","shaka.cast.CastUtils.PlayerInitState.forEach","pair","setter","getter","shaka.cast.CastUtils.PlayerInitAfterLoadState.forEach","shaka_cast_CastProxy_prototype$onCastStatusChanged_","shaka.cast.CastProxy.prototype.onCastStatusChanged_","shaka_cast_CastProxy_prototype$onResumeLocal_","shaka.cast.CastProxy.prototype.onResumeLocal_","manifestUri","manifestReady","videoState","shaka.cast.CastProxy.prototype.videoProxyGet_","shaka.cast.CastProxy.prototype.videoProxySet_","shaka.cast.CastProxy.prototype.videoProxyLocalEvent_","shaka.cast.CastProxy.prototype.playerProxyGet_","getNetworkingEngine","shaka.cast.CastProxy.prototype.playerProxyLocalEvent_","shaka_cast_CastProxy_prototype$onRemoteEvent_","shaka.cast.CastProxy.prototype.onRemoteEvent_","shaka.cast.CastReceiver","opt_appDataCallback","opt_contentIdCallback","player_","targets_","appDataCallback_","opt_contentIdCallback_","contentId","isConnected_","isIdle_","pollTimerId_","genericBus_","shakaBus_","CastReceiver","isConnected","shaka.cast.CastReceiver.prototype.isConnected","isIdle","shaka.cast.CastReceiver.prototype.isIdle","shaka.cast.CastReceiver.prototype.destroy","CastReceiverManager","getInstance","manager","shaka.cast.CastReceiver.prototype.init_","onSenderConnected","onSendersChanged_","onSenderDisconnected","onSystemVolumeChanged","fakeVolumeChangeEvent_","getCastMessageBus","shaka.cast.CastUtils.GENERIC_MESSAGE_NAMESPACE","onMessage","onGenericMessage_","onShakaMessage_","proxyEvent_","canDisplayType","setMaxHardwareResolution","shaka$cast$CastReceiver.prototype","shaka.cast.CastReceiver.prototype","shaka.cast.CastReceiver.prototype.onSendersChanged_","getSenders","shaka.cast.CastReceiver.prototype.onCastStatusChanged_","sendMediaStatus_","shaka.cast.CastReceiver.prototype.initState_","v","shaka.cast.CastReceiver.prototype.proxyEvent_","pollAttributes_","shaka.cast.CastReceiver.prototype.pollAttributes_","shaka.cast.CastUtils.VideoAttributes.forEach","shaka.cast.CastUtils.PlayerGetterMethods.forEach","systemVolume","getSystemVolume","shaka.cast.CastReceiver.prototype.fakeVolumeChangeEvent_","shaka.cast.CastReceiver.prototype.onShakaMessage_","initState_","setSystemVolumeLevel","setSystemVolumeMuted","senderId","sendAsyncComplete_","shaka.cast.CastReceiver.prototype.onGenericMessage_","resumeState","volumeObject","oldVolumeLevel","oldVolumeMuted","mediaInfo","media","isLive","shaka.cast.CastReceiver.prototype.sendAsyncComplete_","shaka.cast.CastReceiver.prototype.sendMessage_","bus","opt_senderId","getCastChannel","broadcast","shaka.cast.CastReceiver.prototype.sendMediaStatus_","requestId","opt_media","playState","shaka.cast.CastReceiver.PLAY_STATE","mediaStatus","getPlayState_","buffering_","shaka.util.XmlUtils.findChild","shaka.util.XmlUtils.findChildren","child","tagName","shaka.util.XmlUtils.getContents","contents","firstChild","Node","TEXT_NODE","trim","shaka.util.XmlUtils.parseAttr","parseFunction","opt_defaultValue","parsedValue","getAttribute","shaka.util.XmlUtils.parseDate","dateString","shaka.util.XmlUtils.parseDuration","durationString","matches","exec","d","years","months","days","isFinite","shaka.util.XmlUtils.parseRange","rangeString","shaka.util.XmlUtils.parseInt","intString","shaka.util.XmlUtils.parsePositiveInt","shaka.util.XmlUtils.parseNonNegativeInt","shaka.util.XmlUtils.evalDivision","exprString","res","shaka.dash.ContentProtection.defaultKeySystems_","shaka.dash.ContentProtection.parseFromAdaptationSet","elems","ignoreDrmInfo","parsed","shaka.dash.ContentProtection.parseElements_","defaultInit","defaultKeyId","parsedNonCenc","shaka.util.Error.Code.DASH_CONFLICTING_KEY_IDS","shaka.dash.ContentProtection.MP4Protection_","schemeUri","shaka.dash.ContentProtection.convertElements_","firstRepresentation","shaka.dash.ContentProtection.parseFromRepresentation","context","repContext","asUnknown","repUnencrypted","asInfo","repInfo","shaka.util.Error.Code.DASH_NO_COMMON_KEY_SYSTEM","elements","psshs","shaka.util.Error.Code.DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED","pssh","shaka.util.Error.Code.DASH_PSSH_BAD_ENCODING","shaka.dash.MpdUtils.fillUriTemplate","uriTemplate","representationId","number","valueTable","re","widthString","valueString","paddingSize","shaka.dash.MpdUtils.parseSegmentInfo","timescaleStr","shaka.dash.MpdUtils.inheritAttribute","timescale","durationStr","segmentDuration","startNumberStr","presentationTimeOffset","startNumber","timelineNode","shaka.dash.MpdUtils.inheritChild","timeline","periodInfo","timePoints","lastEndTime","timePoint","r","repeat","nextStartTime","nextTimePoint","periodDuration","unscaledStart","unscaledPresentationTimeOffset","representation","adaptationSet","nodes","shaka.media.InitSegmentReference","startByte","endByte","getUris","InitSegmentReference","shaka.media.SegmentReference","SegmentReference","shaka.util.DataViewReader","endianness","dataView_","littleEndian_","shaka.util.DataViewReader.Endianness.LITTLE_ENDIAN","position_","DataViewReader","LITTLE_ENDIAN","shaka.util.DataViewReader.Endianness","BIG_ENDIAN","hasMoreData","shaka.util.DataViewReader.prototype.hasMoreData","getPosition","shaka.util.DataViewReader.prototype.getPosition","getLength","shaka.util.DataViewReader.prototype.getLength","readUint8","shaka.util.DataViewReader.prototype.readUint8","getUint8","throwOutOfBounds_","readUint16","shaka.util.DataViewReader.prototype.readUint16","readUint32","shaka.util.DataViewReader.prototype.readUint32","readInt32","shaka.util.DataViewReader.prototype.readInt32","getInt32","readUint64","shaka.util.DataViewReader.prototype.readUint64","low","high","shaka.util.Error.Code.JS_INTEGER_OVERFLOW","readBytes","shaka.util.DataViewReader.prototype.readBytes","skip","shaka.util.DataViewReader.prototype.skip","readTerminatedString","shaka.util.DataViewReader.prototype.readTerminatedString","shaka.util.DataViewReader.prototype.throwOutOfBounds_","shaka.util.Error.Code.BUFFER_READ_OUT_OF_BOUNDS","shaka.util.Mp4Parser","headers_","boxDefinitions_","Mp4Parser","shaka.util.Mp4Parser.prototype.box","definition","typeCode","shaka.util.Mp4Parser.typeFromString_","BASIC_BOX","fullBox","shaka.util.Mp4Parser.prototype.fullBox","FULL_BOX","shaka.util.Mp4Parser.prototype.parse","reader","parseNext","shaka.util.Mp4Parser.prototype.parseNext","absStart","size","boxDefinition","flags","versionAndFlags","payloadSize","payloadReader","shaka.util.Mp4Parser.children","shaka.util.Mp4Parser.sampleDescription","count","shaka.util.Mp4Parser.allData","shaka.media.Mp4SegmentIndexParser","sidxData","sidxOffset","references","shaka.media.Mp4SegmentIndexParser.parseSIDX_","shaka.util.Error.Code.MP4_SIDX_WRONG_BOX_TYPE","shaka.util.Error.Code.MP4_SIDX_INVALID_TIMESCALE","earliestPresentationTime","firstOffset","referenceCount","unscaledStartTime","chunk","referenceType","referenceSize","subsegmentDuration","shaka.util.Error.Code.MP4_SIDX_TYPE_NOT_SUPPORTED","shaka.media.SegmentIndex","references_","SegmentIndex","shaka.media.SegmentIndex.prototype.destroy","shaka.media.SegmentIndex.prototype.find","shaka.media.SegmentIndex.prototype.get","shaka.media.SegmentIndex.prototype.merge","nextPosition","newReferences","r1","r2","abs","evict","shaka.media.SegmentIndex.prototype.evict","shaka.media.SegmentIndex.prototype.fit","lastReference","shaka.util.EbmlParser","reader_","shaka.util.EbmlParser.DYNAMIC_SIZES","shaka.util.EbmlParser.prototype.hasMoreData","shaka.util.EbmlParser.prototype.parseElement","vint","parseVint_","parseId_","shaka.util.Error.Code.EBML_OVERFLOW","shaka.util.EbmlParser.DYNAMIC_SIZES.length","elementSize","byteOffset","shaka.util.EbmlElement","shaka.util.EbmlParser.prototype.parseVint_","firstByte","shaka.util.EbmlElement.prototype.getUint","shaka.media.WebmSegmentIndexParser","shaka.media.WebmSegmentIndexParser.prototype.parse","cuesData","shaka.media.WebmSegmentIndexParser.EBML_ID","parseElement","ebmlElement","shaka.util.Error.Code.WEBM_EBML_HEADER_ELEMENT_MISSING","segmentElement","shaka.media.WebmSegmentIndexParser.SEGMENT_ID","shaka.util.Error.Code.WEBM_SEGMENT_ELEMENT_MISSING","segmentOffset","infoElement","shaka.media.WebmSegmentIndexParser.INFO_ID","shaka.util.Error.Code.WEBM_INFO_ELEMENT_MISSING","timecodeScaleNanoseconds","durationScale","shaka.media.WebmSegmentIndexParser.TIMECODE_SCALE_ID","getUint","shaka.media.WebmSegmentIndexParser.DURATION_ID","getFloat32","getFloat64","shaka.util.Error.Code.EBML_BAD_FLOATING_POINT_SIZE","shaka.util.Error.Code.WEBM_DURATION_ELEMENT_MISSING","timecodeScale","cuesElement","shaka.media.WebmSegmentIndexParser.CUES_ID","shaka.util.Error.Code.WEBM_CUES_ELEMENT_MISSING","parseCues_","shaka.media.WebmSegmentIndexParser.prototype.parseCues_","lastTime","lastOffset","shaka.media.WebmSegmentIndexParser.CUE_POINT_ID","tuple","parseCuePoint_","unscaledTime","currentOffset","relativeOffset","shaka.media.WebmSegmentIndexParser.prototype.parseCuePoint_","cuePointElement","cueTimeElement","shaka.media.WebmSegmentIndexParser.CUE_TIME_ID","shaka.util.Error.Code.WEBM_CUE_TIME_ELEMENT_MISSING","cueTrackPositionsElement","shaka.media.WebmSegmentIndexParser.CUE_TRACK_POSITIONS_ID","shaka.util.Error.Code.WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING","cueTrackParser","shaka.media.WebmSegmentIndexParser.CUE_CLUSTER_POSITION","shaka.dash.SegmentBase.createInitSegment","initialization","resolvedUris","range","shaka.dash.SegmentBase.createStream","requestInitSegment","shaka.dash.SegmentBase.fromInheritance_","containerType","shaka.util.Error.Code.DASH_UNSUPPORTED_CONTAINER","shaka.util.Error.Code.DASH_WEBM_MISSING_INIT","representationIndex","indexRangeElem","indexUris","indexRange","representationUri","shaka.util.Error.Code.DASH_NO_SEGMENT_INFO","shaka.dash.SegmentBase.createSegmentIndexFromUris","createSegmentIndex","findSegmentPosition","getSegmentReference","initSegmentReference","presentationTimeline","fitLast","dynamic","isLastPeriod","localRequest","segmentIndex","create","indexData","notifySegments","periodStartTime","fit","frame","segmentBase","shaka.dash.SegmentList.createStream","segmentIndexMap","shaka.dash.SegmentList.fromInheritance_","mediaSegments","shaka.dash.SegmentList.parseMediaSegments_","segmentInfo","shaka.dash.SegmentList.createSegmentReferences_","getSegmentAvailabilityStart","segmentList","prevEndTime","mediaUri","segmentLists","urlNode","indexRangeWarningGiven","shaka.dash.SegmentTemplate.createStream","isUpdate","shaka.dash.SegmentTemplate.createInitSegment_","shaka.dash.SegmentTemplate.fromInheritance_","mediaTemplate","indexTemplate","filledTemplate","notifyMaxSegmentDuration","segmentIndexFunctions","shaka.dash.SegmentTemplate.createFromDuration_","shaka.dash.SegmentTemplate.createFromTimeline_","segmentTemplate","periodTime","segmentReplacement","repId","segmentId","g","createUris","shaka.media.ManifestParser.parsersByMime","shaka.media.ManifestParser.parsersByExtension","registerParserByExtension","shaka.media.ManifestParser.registerParserByExtension","parserFactory","registerParserByMime","shaka.media.ManifestParser.registerParserByMime","shaka.media.ManifestParser.probeSupport","testExtensions","shaka.media.ManifestParser.getFactory","netEngine","opt_manifestParserFactory","filenamePieces","uriObj","uriPieces","uriFilename","headRequest","shaka.net.NetworkingEngine.RequestType.MANIFEST","shaka.util.Error.Code.UNABLE_TO_GUESS_MANIFEST_TYPE","shaka.media.PresentationTimeline","presentationStartTime","presentationDelay","presentationStartTime_","presentationDelay_","segmentAvailabilityDuration_","duration_","maxSegmentDuration_","clockOffset_","static_","PresentationTimeline","shaka.media.PresentationTimeline.prototype.getDuration","shaka.media.PresentationTimeline.prototype.setDuration","getPresentationStartTime","shaka.media.PresentationTimeline.prototype.getPresentationStartTime","setClockOffset","shaka.media.PresentationTimeline.prototype.setClockOffset","setStatic","shaka.media.PresentationTimeline.prototype.setStatic","isStatic","getSegmentAvailabilityDuration","shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityDuration","setSegmentAvailabilityDuration","shaka.media.PresentationTimeline.prototype.setSegmentAvailabilityDuration","segmentAvailabilityDuration","shaka.media.PresentationTimeline.prototype.notifySegments","shaka.media.PresentationTimeline.prototype.notifyMaxSegmentDuration","maxSegmentDuration","shaka.media.PresentationTimeline.prototype.isLive","isInProgress","shaka.media.PresentationTimeline.prototype.isInProgress","shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityStart","getSafeAvailabilityStart","shaka.media.PresentationTimeline.prototype.getSafeAvailabilityStart","getSegmentAvailabilityEnd","shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityEnd","getLiveEdge_","getSeekRangeEnd","shaka.media.PresentationTimeline.prototype.getSeekRangeEnd","shaka.dash.DashParser","playerInterface_","manifestUris_","manifest_","periodIds_","globalId_","segmentIndexMap_","updatePeriod_","updateTimer_","DashParser","shaka$dash$DashParser.prototype","shaka.dash.DashParser.prototype","shaka.dash.DashParser.prototype.configure","shaka.dash.DashParser.prototype.start","playerInterface","requestManifest_","setUpdateTimer_","shaka.dash.DashParser.prototype.stop","shaka.dash.DashParser.prototype.update","shaka.dash.DashParser.prototype.onExpirationUpdated","shaka.dash.DashParser.prototype.requestManifest_","parseManifest_","shaka.dash.DashParser.prototype.parseManifest_","finalManifestUri","mpd","documentElement","shaka.util.Error.Code.DASH_INVALID_XML","manifestBaseUris","locations","minBufferTime","suggestedPresentationDelay","mpdType","defaultPresentationDelay","shaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_","periodsAndDuration","parsePeriods_","timingElements","parseUtcTiming_","shaka.dash.DashParser.prototype.parsePeriods_","presentationDuration","prevEnd","periodNodes","givenDuration","nextStart","nextPeriod","parsePeriod_","periodId","filterPeriod","shaka.dash.DashParser.prototype.parsePeriod_","createFrame_","eventStreamNodes","parseEventStream_","adaptationSets","adaptationSetNodes","parseAdaptationSet_","representationIds","as","uniqueRepIds","shaka.util.Error.Code.DASH_DUPLICATE_REPRESENTATION_ID","normalAdaptationSets","trickModeFor","trickModeAdaptationSets","trickModeSet","targetId","normalSet","videoSets","getSetsOfType_","audioSets","shaka.util.Error.Code.DASH_EMPTY_PERIOD","createVariants_","audioSet","videoSet","textSets","shaka.dash.DashParser.prototype.getSetsOfType_","shaka.dash.DashParser.prototype.createVariants_","main","shaka.dash.DashParser.prototype.parseAdaptationSet_","roleElements","roleValues","SUBTITLE","unrecognizedEssentialProperty","essentialProperties","prop","schemeId","contentProtectionElems","contentProtection","customScheme","representations","parseRepresentation_","shaka.util.Error.Code.DASH_EMPTY_ADAPTATION_SET","APPLICATION","shaka.dash.DashParser.guessContentType_","repIds","shaka.dash.DashParser.prototype.parseRepresentation_","isPrimary","verifyRepresentation_","requestInitSegment_","streamInfo","ref","containsEmsgBoxes","shaka_dash_DashParser_prototype$onUpdate_","shaka.dash.DashParser.prototype.onUpdate_","shaka.dash.DashParser.prototype.setUpdateTimer_","onUpdate_","interval","shaka.dash.DashParser.MIN_UPDATE_PERIOD_","shaka.dash.DashParser.prototype.createFrame_","parent","shaka.dash.DashParser.prototype.verifyRepresentation_","shaka.dash.DashParser.prototype.requestForTiming_","requestUris","text","date","shaka.dash.DashParser.prototype.parseUtcTiming_","schemesAndValues","clockSyncUri","sv","requestForTiming_","shaka.dash.DashParser.prototype.parseEventStream_","schemeIdUri","eventNode","presentationTime","region","eventElement","onTimelineRegionAdded","shaka.dash.DashParser.prototype.requestInitSegment_","shaka.hls.Playlist","opt_segments","shaka.hls.Tag","opt_value","shaka.hls.Tag.prototype.toString","attr_to_str","shaka.hls.Attribute","shaka.hls.Tag.prototype.getAttribute","shaka.hls.Tag.prototype.getAttributeValue","defaultValue","shaka.hls.Segment","shaka.hls.Utils.filterTagsByName","shaka.hls.Utils.getFirstTagWithName","tagsWithName","shaka.hls.Utils.findMediaTags","groupId","typeAttr","groupIdAttr","shaka.util.TextParser","data_","shaka.util.TextParser.prototype.readRegex","regex","lastIndex","indexOf_","atEnd","shaka.util.TextParser.prototype.readRegexReturnCapture_","readRegex","shaka.hls.ManifestTextParser","shaka.hls.ManifestTextParser.prototype.parsePlaylist","lines","test","shaka.util.Error.Code.HLS_PLAYLIST_HEADER_MISSING","playlistType","MASTER","line","shaka.hls.ManifestTextParser.parseTag","parseTag_","word","shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS.indexOf","MEDIA","shaka.hls.ManifestTextParser.SEGMENT_TAGS.indexOf","shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY","segmentsData","parseSegments_","tagUri","shaka.hls.ManifestTextParser.prototype.parseSegments_","blocks","shaka.util.Error.Code.INVALID_HLS_TAG","blockAttrs","attrName","shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS","shaka.hls.ManifestTextParser.SEGMENT_TAGS","shaka.net.DataUriPlugin","shaka.net.DataUriPlugin.parse","DataUriPlugin","shaka.util.Error.Code.MALFORMED_DATA_URI","infoAndData","dataStr","typeAndEncoding","encoding","shaka.util.Error.Code.UNKNOWN_DATA_URI_ENCODING","shaka.hls.HlsParser","mediaTagsToStreamInfosMap_","streamsToIndexMap_","presentationTimeline_","manifestTextParser_","HlsParser","shaka$hls$HlsParser.prototype","shaka.hls.HlsParser.prototype","shaka.hls.HlsParser.prototype.configure","shaka.hls.HlsParser.prototype.start","shaka.hls.HlsParser.prototype.stop","shaka.hls.HlsParser.prototype.update","shaka.hls.HlsParser.prototype.onExpirationUpdated","shaka.hls.HlsParser.prototype.parseManifest_","playlist","parsePlaylist","shaka.util.Error.Code.HLS_MASTER_PLAYLIST_NOT_PROVIDED","createPeriod_","shaka.hls.HlsParser.prototype.createPeriod_","variantsPromises","variantTags","createVariantsForTag_","textStreamPromises","mediaTags","textStreamTags","shaka.hls.HlsParser.getRequiredAttributeValue_","createTextStream_","allVariants","fitSegments_","shaka.hls.HlsParser.prototype.createVariantsForTag_","getAttributeValue","defaultCodecs","resolutionAttr","resBlocks","timeOffset","getTimeOffset_","audioGroupId","videoGroupId","promises","createStreamInfoFromMediaTag_","audioStreamInfos","videoStreamInfos","createStreamInfo_","createStreamInfoFromVariantTag_","allCodecs","shaka.hls.HlsParser.prototype.createVariants_","audioInfos","videoInfos","audioStream","videoStream","audioDrmInfos","videoDrmInfos","createVariant_","shaka.hls.HlsParser.prototype.createVariant_","shaka.hls.HlsParser.prototype.createTextStream_","shaka.hls.HlsParser.prototype.createStreamInfoFromMediaTag_","defaultAttr","autoselectAttr","shaka.hls.HlsParser.prototype.createStreamInfo_","mediaPlaylistTimeOffset","createInitSegmentReference_","mediaSequenceTag","createSegments_","startPosition","guessCodecs_","drmTags","segmentKeyTags","drmTag","keyFormat","drmParser","shaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_","shaka.util.Error.Code.HLS_KEYFORMATS_NOT_SUPPORTED","guessMimeType_","shaka.hls.HlsParser.prototype.createInitSegmentReference_","mapTags","shaka.util.Error.Code.HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND","mapTag","initUri","byterange","shaka.hls.HlsParser.prototype.createSegments_","hlsSegments","extinfValues","getRequiredTag_","extinfTag","shaka.hls.HlsParser.prototype.fitSegments_","shaka.hls.HlsParser.prototype.guessCodecs_","formats","shaka.hls.HlsParser.VIDEO_CODEC_FORMATS_","shaka.hls.HlsParser.AUDIO_CODEC_FORMATS_","shaka.util.Error.Code.HLS_COULD_NOT_GUESS_CODECS","shaka.hls.HlsParser.prototype.guessMimeType_","shaka.hls.HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_","shaka.hls.HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_","shaka.util.Error.Code.HLS_COULD_NOT_GUESS_MIME_TYPE","shaka.hls.HlsParser.prototype.getTimeOffset_","startTag","defaultTimeOffset","attributeName","shaka.util.Error.Code.HLS_REQUIRED_ATTRIBUTE_MISSING","shaka.hls.HlsParser.prototype.getRequiredTag_","shaka.util.Error.Code.HLS_REQUIRED_TAG_MISSING","shaka.hls.HlsParser.widevineDrmParser_","parsedData","shaka.media.TtmlTextParser","shaka.media.TtmlTextParser.prototype.parseInit","shaka.media.TtmlTextParser.prototype.parseMedia","shaka.util.Error.Code.INVALID_XML","tt","tts","subFrameRate","frameRateMultiplier","tickRate","spaceStyle","whitespaceTrim","rateInfo","shaka.media.TtmlTextParser.RateInfo_","styles","shaka.media.TtmlTextParser.getLeafNodes_","regions","textNodes","cueElement","hasAttribute","shaka.media.TtmlTextParser.addNewLines_","shaka.media.TtmlTextParser.parseTime_","shaka.util.Error.Code.INVALID_TEXT_CUE","shaka.media.TtmlTextParser.getElementFromCollection_","extent","shaka.media.TtmlTextParser.getStyleAttribute_","shaka.media.TtmlTextParser.percentValues_.exec","writingMode","isVerticalText","vertical","origin","snapToLines","align","positionAlign","shaka.media.TtmlTextParser.textAlignToPositionAlign_","lineAlign","shaka.media.TtmlTextParser.textAlignToLineAlign_","shaka.media.TtmlTextParser.timeColonFormatFrames_","shaka.media.TtmlTextParser.timeColonFormat_","shaka.media.TtmlTextParser.timeColonFormatMilliseconds_","shaka.media.TtmlTextParser.timeFramesFormat_","shaka.media.TtmlTextParser.timeTickFormat_","shaka.media.TtmlTextParser.timeHMSFormat_","shaka.media.TtmlTextParser.percentValues_","isSpanChildOfP","ELEMENT_NODE","leafChildren","trimmed","regionChildren","getElementFromCollection_","collection","Element","itemName","shaka.media.TtmlTextParser.timeColonFormatFrames_.test","shaka.media.TtmlTextParser.timeColonFormatFrames_.exec","frames","shaka.media.TtmlTextParser.timeColonFormat_.test","shaka.media.TtmlTextParser.parseTimeFromRegex_","shaka.media.TtmlTextParser.timeColonFormatMilliseconds_.test","shaka.media.TtmlTextParser.timeFramesFormat_.test","shaka.media.TtmlTextParser.timeFramesFormat_.exec","shaka.media.TtmlTextParser.timeTickFormat_.test","shaka.media.TtmlTextParser.timeTickFormat_.exec","ticks","shaka.media.TtmlTextParser.timeHMSFormat_.test","multiplierResults","numerator","denominator","shaka.media.Mp4TtmlParser","shaka.media.Mp4TtmlParser.prototype.parseInit","sawSTPP","shaka.util.Error.Code.INVALID_MP4_TTML","shaka.media.Mp4TtmlParser.prototype.parseMedia","sawMDAT","shaka.media.VttTextParser","shaka.media.VttTextParser.prototype.parseInit","shaka.media.VttTextParser.prototype.parseMedia","shaka.util.Error.Code.INVALID_TEXT_HEADER","cueTimeMatch","mpegTimeMatch","cueTime","shaka.media.VttTextParser.parseTime_","mpegTime","shaka.media.VttTextParser.MPEG_TIMESCALE_","expect","readRegexReturnCapture_","shaka.media.VttTextParser.parseSetting","miliseconds","shaka.media.Mp4VttParser","timescale_","shaka.media.Mp4VttParser.prototype.parseInit","sawWVTT","shaka.util.Error.Code.INVALID_MP4_VTT","shaka.media.Mp4VttParser.prototype.parseMedia","baseTime","presentations","payloads","sawTFDT","sawTRUN","sampleCount","samples","sampleIndex","presentation","shaka.media.Mp4VttParser.parseVTTC_","shaka.media.Mp4VttParser.assembleCue_","shaka.media.Playhead","onSeek","onEvent","startTime_","onSeek_","onEvent_","playbackRate_","gapJumpIntervalId_","trickPlayIntervalId_","prevReadyState_","didFireLargeGap_","stallPlayheadTime_","stallWallTime_","hadSegmentAppended_","onLoadedMetadata_","pollGap","onPollGapJump_","onRateChange_","shaka$media$Playhead.prototype","shaka.media.Playhead.prototype","shaka.media.Playhead.prototype.destroy","shaka.media.Playhead.prototype.setStartTime","clampTime_","shaka.media.Playhead.prototype.getTime","getStartTime_","shaka.media.Playhead.prototype.getStartTime_","getPlaybackRate","shaka.media.Playhead.prototype.getPlaybackRate","shaka.media.Playhead.prototype.setPlaybackRate","rate","onSegmentAppended","shaka.media.Playhead.prototype.onSegmentAppended","shaka.media.Playhead.prototype.onRateChange_","expectedRate","setPlaybackRate","shaka.media.Playhead.prototype.onLoadedMetadata_","targetTime","onSeeking_","onPlaying_","onSeekingToStartTime_","shaka.media.Playhead.prototype.onSeekingToStartTime_","shaka.media.Playhead.prototype.onPollGapJump_","smallGapLimit","threshold","gapIndex","jumpTo","seekEnd","jumpSize","isGapSmall","jumpLargeGap","jumpLargeGaps","movePlayhead_","shaka.media.Playhead.prototype.onSeeking_","reposition_","shaka.media.Playhead.prototype.onPlaying_","shaka.media.Playhead.prototype.reposition_","isBuffered","shaka.media.TimeRangesUtils.isBuffered.bind","rebufferingGoal","scaleFactor","safe","seekStart","seekSafe","shaka.media.Playhead.prototype.movePlayhead_","tries","recheck","shaka.media.Playhead.prototype.clampTime_","shaka.media.PlayheadObserver","onBuffering","onChangePeriod","onBuffering_","onChangePeriod_","timelineRegions_","curPeriodIndex_","watchdogTimer_","startWatchdogTimer_","shaka.media.PlayheadObserver.prototype.destroy","cancelWatchdogTimer_","addTimelineRegion","shaka.media.PlayheadObserver.prototype.addTimelineRegion","regionInfo","hasExistingRegion","existing","FUTURE_REGION","detail","shaka.media.PlayheadObserver.cloneTimelineInfo_","updateTimelineRegion_","copy","shaka.media.PlayheadObserver.prototype.updateTimelineRegion_","isSeek","newStatus","PAST_REGION","INSIDE","wasInside","isInside","shaka.media.PlayheadObserver.prototype.startWatchdogTimer_","onWatchdogTimer_","shaka.media.PlayheadObserver.prototype.cancelWatchdogTimer_","shaka.media.PlayheadObserver.prototype.onWatchdogTimer_","newPeriod","bufferedAhead","bufferEnd","shaka.media.PlayheadObserver.FUDGE_FACTOR_","buffering","setBuffering_","shaka.media.PlayheadObserver.UNDERFLOW_THRESHOLD_","shaka.media.StreamingEngine","bufferingGoalScale_","setupPeriodPromise_","canSwitchPeriod_","canSwitchStream_","mediaStates_","fatalError_","shaka$media$StreamingEngine.prototype","shaka.media.StreamingEngine.prototype","shaka.media.StreamingEngine.prototype.destroy","cancelUpdate_","shaka.media.StreamingEngine.prototype.configure","shaka.media.StreamingEngine.prototype.init","streamsByType","onChooseStreams","needPeriodIndex","findPeriodContainingTime_","playheadTime","playhead","shaka.util.Error.Category.STREAMING","shaka.util.Error.Code.INVALID_STREAMS_CHOSEN","initStreams_","onInitialStreamsSetup","shaka.media.StreamingEngine.prototype.getCurrentPeriod","shaka.media.StreamingEngine.prototype.getActiveStreams","restoreStreamAfterTrickPlay","shaka.media.StreamingEngine.prototype.notifyNewTextStream","shaka.media.StreamingEngine.prototype.setTrickPlay","normalVideo","mediaState","switch","shaka.media.StreamingEngine.prototype.switch","clearBuffer","ignoreTextStreamFailures","notifyNewTextStream","periodIndex","findPeriodContainingStream_","clearAllBuffers_","mediaSourceEngine","canSwitchRecord","resolved","needInitSegment","clearingBuffer","waitingToFlushBuffer","performingUpdate","waitingToClearBuffer","clearBuffer_","shaka.media.StreamingEngine.prototype.seeked","isAllBuffered","getBuffered_","shaka.media.StreamingEngine.prototype.clearAllBuffers_","bufferStart","updateTimer","scheduleUpdate_","shaka.media.StreamingEngine.prototype.initStreams_","opt_resumeAt","setDuration_","setupStreams_","lastStream","lastSegmentReference","recovering","resumeAt","shaka.media.StreamingEngine.prototype.setupPeriod_","shaka.media.StreamingEngine.prototype.setupStreams_","shaka.media.StreamingEngine.prototype.setDuration_","shaka_media_StreamingEngine_prototype$onUpdate_","shaka.media.StreamingEngine.prototype.onUpdate_","update_","mediaStates","handlePeriodTransition_","ms","shaka.media.StreamingEngine.prototype.update_","timeNeeded","getTimeNeeded_","lastPeriod","lastPeriodIndex","currentPeriodIndex","bufferingGoal","getBufferingGoal_","getSegmentReferenceIfAvailable_","getSegmentReferenceNeeded_","lookupTime","currentPeriod","reference","optimalPosition","fetchAndAppend_","shaka.media.StreamingEngine.prototype.getSegmentReferenceIfAvailable_","availabilityEnd","availabilityStart","shaka.media.StreamingEngine.prototype.fetchAndAppend_","followingPeriod","initSourceBuffer","initSourceBuffer_","fetchSegment","fetch_","handleStartup_","infiniteRetriesForLiveStreams","shaka.util.Error.Code.BAD_HTTP_STATUS","shaka.util.Error.Code.HTTP_ERROR","shaka.util.Error.Code.TIMEOUT","handleNetworkError_","handleQuotaExceeded_","shaka.media.StreamingEngine.prototype.handleQuotaExceeded_","waitingForAnotherStreamToRecover","percentBefore","shaka.media.StreamingEngine.prototype.initSourceBuffer_","setStreamProperties","appendInit","fetchInit","initSegment","shaka.media.StreamingEngine.prototype.append_","parseEMSG_","evict_","shaka.media.StreamingEngine.prototype.parseEMSG_","presentationTimeDelta","eventDuration","messageData","onManifestUpdate","emsg","shaka.media.StreamingEngine.prototype.evict_","overflow","bufferBehind","shaka.media.StreamingEngine.prototype.handleStartup_","setupPeriod_","onCanSwitch","onStartupComplete","shaka.media.StreamingEngine.prototype.handlePeriodTransition_","needSamePeriod","allAreIdle","shaka.media.StreamingEngine.isIdle_","allReady","needPeriod","shaka.media.StreamingEngine.prototype.fetch_","shaka.media.StreamingEngine.prototype.clearBuffer_","flush","shaka.media.StreamingEngine.prototype.scheduleUpdate_","shaka.media.StreamingEngine.prototype.cancelUpdate_","shaka.net.HttpPlugin","xhr","responseType","withCredentials","onload","xhr.onload","getAllResponseHeaders","header","responseURL","onerror","xhr.onerror","ontimeout","xhr.ontimeout","HttpPlugin","shaka.offline.DBEngine","db_","operations_","currentIdMap_","shaka$offline$DBEngine.prototype","shaka.offline.DBEngine.prototype","shaka.offline.DBEngine.prototype.init","storeMap","opt_retryCount","createConnection_","stores","getNextId_","shaka.offline.DBEngine.prototype.destroy","op","transaction","shaka.offline.DBEngine.prototype.get","storeName","createTransaction_","shaka.offline.DBEngine.prototype.forEach","openCursor","onsuccess","request.onsuccess","cursor","continue","shaka.offline.DBEngine.prototype.insert","put","shaka.offline.DBEngine.prototype.remove","shaka.offline.DBEngine.prototype.removeKeys","opt_onKeyRemoved","shaka.offline.DBEngine.prototype.getNextId_","shaka.offline.DBEngine.prototype.createTransaction_","oncomplete","closeOperation_","onabort","shaka.offline.DBEngine.onError_","objectStore","shaka.offline.DBEngine.prototype.createConnection_","indexedDB","shaka.offline.DBEngine.DB_NAME_","shaka.offline.DBEngine.DB_VERSION_","upgraded","createPromise","onupgradeneeded","request.onupgradeneeded","db","createObjectStore","keyPath","shaka.offline.DBEngine.onError_.bind","errorSource","shaka.util.Error.Category.STORAGE","shaka.util.Error.Code.INDEXED_DB_ERROR","shaka.util.Error.Code.OPERATION_ABORTED","shaka.offline.OfflineUtils.DB_SCHEME","shaka.offline.OfflineUtils.getStoredContent","shaka.offline.OfflineUtils.reconstructPeriod","offlineUri","originalManifestUri","appMetadata","textStreamsDb","streamDb","audioStreamsDb","videoStreamsDb","shaka.offline.OfflineUtils.createVariants_","shaka.offline.OfflineUtils.createStream_","refs","shaka.offline.OfflineUtils.getSegmentReferences_","audios","videos","shaka.offline.OfflineUtils.areCompatible_","stream1","stream2","variantIds","containsId","initSegmentUri","initRef","shaka.offline.OfflineUtils.createStorageEngine","shaka.offline.DownloadManager","storageEngine","segments_","storedSegments_","storageEngine_","netEngine_","retryParams_","promise_","bandwidthBytesDownloaded_","bandwidthBytesTotal_","givenBytesDownloaded_","givenBytesTotal_","shaka.offline.DownloadManager.prototype.destroy","storage","removeKeys","shaka.offline.DownloadManager.prototype.addSegment","bandwidthSize","segmentDb","shaka.offline.DownloadManager.prototype.downloadAndStore","downloadNext","downloadSegment_","insert","shaka.offline.DownloadManager.prototype.downloadSegment_","byteCount","progress","updateProgress_","progressCallback","shaka.offline.OfflineManifestParser","manifestId_","shaka$offline$OfflineManifestParser.prototype","shaka.offline.OfflineManifestParser.prototype","shaka.offline.OfflineManifestParser.prototype.configure","shaka.offline.OfflineManifestParser.prototype.start","shaka.util.Error.Code.MALFORMED_OFFLINE_URI","manifestId","shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND","shaka.offline.OfflineManifestParser.reconstructManifest","shaka.util.Error.Code.STORAGE_NOT_SUPPORTED","shaka.offline.OfflineManifestParser.prototype.stop","shaka.offline.OfflineManifestParser.prototype.update","shaka.offline.OfflineManifestParser.prototype.onExpirationUpdated","sessionIds","shaka.offline.OfflineScheme","manifestParts","segmentParts","OfflineScheme","shaka.util.CancelableChain","canceled_","complete_","final_","cancelPromise_","onCancelComplete_","shaka.util.CancelableChain.prototype.then","rejectionValue_","shaka.util.CancelableChain.prototype.finalize","shaka.util.CancelableChain.prototype.cancel","reason","shaka.Player","opt_dependencyInjector","defaultAbrManager_","streamingEngine_","playheadObserver_","playhead_","mediaSourceOpen_","mediaSourceEngine_","drmEngine_","nextExternalStreamId_","loadingTextStreamIds_","switchingPeriods_","unloadChain_","loadChain_","deferredSwitches_","pendingTimelineRegions_","activeStreamsByPeriod_","defaultConfig_","maxHwRes_","stats_","getCleanStats_","lastTimeStatsUpdateTimestamp_","currentAudioLanguage_","preferredAudioLanguage","currentTextLanguage_","preferredTextLanguage","currentTextRole_","currentVariantRole_","createNetworkingEngine","initialize_","createMediaSource","shaka.Player.TextTrackLabel_","addTextTrack","onVideoError_","shaka.Player.prototype.destroy","cancelation","destroyStreaming_","GIT_VERSION","shaka.Player.supportPlugins_","shaka.Player.registerSupportPlugin","shaka.Player.isBrowserSupported","MediaKeys","MediaKeySystemAccess","shaka.Player.probeSupport","shaka.Player.prototype.load","opt_startTime","unloadPromise","loadChain","finalize","updateState_","filterPeriod_","onTimelineRegionAdded_","shaka.util.Error.Code.NO_PERIODS","createDrmEngine","createPlayhead","streaming","createPlayheadObserver","createMediaSourceEngine","createStreamingEngine","onChooseStreams_","canSwitch_","onManifestUpdate_","onSegmentAppended_","chooseCodecsAndFilterManifest_","startAtSegmentBoundary","adjustStartTime_","setStartTime","onTracksChanged_","onAdaptation_","getCurrentPeriod","loadLatency","shaka.Player.prototype.chooseCodecsAndFilterManifest_","variantCodecs","baseVideoCodec","baseAudioCodec","variantsByCodecs","bestCodecs","lowestAverageBandwidth","sum","num","averageBandwidth","shaka.Player.prototype.createMediaSource","URL","createObjectURL","shaka.Player.prototype.configure","configOverrides_","applyConfig_","shaka.Player.prototype.applyConfig_","chooseStreamsAndSwitch_","defaultBandwidthEstimate","shaka.Player.prototype.getConfiguration","resetConfiguration","shaka.Player.prototype.resetConfiguration","getMediaElement","shaka.Player.prototype.getMediaElement","shaka.Player.prototype.getNetworkingEngine","getManifestUri","shaka.Player.prototype.getManifestUri","shaka.Player.prototype.isLive","shaka.Player.prototype.isInProgress","seekRange","shaka.Player.prototype.seekRange","shaka.Player.prototype.keySystem","shaka.Player.prototype.drmInfo","shaka.Player.prototype.getExpiration","isBuffering","shaka.Player.prototype.isBuffering","shaka.Player.prototype.unload","interrupt","resetStreaming_","shaka.Player.prototype.getPlaybackRate","trickPlay","shaka.Player.prototype.trickPlay","setTrickPlay","cancelTrickPlay","shaka.Player.prototype.cancelTrickPlay","shaka.Player.prototype.getTracks","selectTrack","shaka.Player.prototype.selectTrack","opt_clearBuffer","shaka.Player.prototype.getVariantTracks","shaka.Player.prototype.getTextTracks","shaka.Player.prototype.selectTextTrack","addToSwitchHistory_","streamsToSwitch","deferredSwitch_","shaka.Player.prototype.selectVariantTrack","getActiveStreams","updateActiveStreams_","currentTextStream","getAudioLanguages","shaka.Player.prototype.getAudioLanguages","getTextLanguages","shaka.Player.prototype.getTextLanguages","shaka.Player.prototype.selectAudioLanguage","shaka.Player.prototype.selectTextLanguage","isTextTrackVisible","shaka.Player.prototype.isTextTrackVisible","shaka.Player.prototype.setTextTrackVisibility","onTextTrackVisibility_","getPlayheadTimeAsDate","shaka.Player.prototype.getPlayheadTimeAsDate","getStats","shaka.Player.prototype.getStats","updateTimeStats_","videoInfo","getVideoPlaybackQuality","streamBandwidth","decodedFrames","totalVideoFrames","droppedFrames","droppedVideoFrames","estimatedBandwidth","playTime","bufferingTime","switchHistory","stateHistory","shaka.Player.prototype.addTextTrack","mime","opt_codec","opt_label","curPeriodIdx","shaka.Player.prototype.setMaxHardwareResolution","shaka.Player.prototype.addToSwitchHistory_","fromAdaptation","timestamp","shaka.Player.prototype.updateActiveStreams_","shaka.Player.prototype.destroyStreaming_","shaka.Player.prototype.resetStreaming_","shaka.Player.prototype.configOverrides_","shaka.Player.prototype.defaultConfig_","shaka.Player.prototype.getCleanStats_","shaka$Player.prototype","shaka.Player.prototype","shaka_Player_prototype$filterPeriod_","shaka.Player.prototype.filterPeriod_","hasPlayableVariants","allVariantsRestricted","shaka.util.Error.Code.UNPLAYABLE_PERIOD","shaka.Player.prototype.deferredSwitch_","shaka.Player.prototype.updateTimeStats_","shaka.Player.prototype.adjustStartTime_","getAdjustedTime","idx","videoStartTime","audioStartTime","shaka_Player_prototype$onSegmentDownloaded_","shaka.Player.prototype.onSegmentDownloaded_","shaka_Player_prototype$onBuffering_","shaka.Player.prototype.onBuffering_","shaka_Player_prototype$onChangePeriod_","shaka.Player.prototype.onChangePeriod_","shaka.Player.prototype.updateState_","lastEntry","shaka_Player_prototype$onSeek_","shaka.Player.prototype.onSeek_","seeked","shaka.Player.prototype.chooseStreams_","opt_chooseAll","needsUpdate","anyMediaState","activeVariant","activePeriod","shaka.Player.prototype.chooseStreamsAndSwitch_","languageMatches","chooseStreams_","shaka.Player.prototype.onChooseStreams_","shaka.Player.prototype.canSwitch_","shaka.Player.prototype.onManifestUpdate_","shaka.Player.prototype.onSegmentAppended_","shaka_Player_prototype$switch_","shaka.Player.prototype.switch_","oldActive","shaka.Player.prototype.onAdaptation_","shaka.Player.prototype.onTracksChanged_","shaka.Player.prototype.onTextTrackVisibility_","shaka_Player_prototype$onError_","shaka.Player.prototype.onError_","shaka.Player.prototype.onTimelineRegionAdded_","shaka_Player_prototype$onEvent_","shaka.Player.prototype.onEvent_","shaka.Player.prototype.onVideoError_","extended","msExtendedCode","shaka.util.Error.Code.VIDEO_ERROR","shaka_Player_prototype$onKeyStatus_","shaka.Player.prototype.onKeyStatus_","keyStatusMap","restrictedStatuses","keyStatus","shaka_Player_prototype$onExpirationUpdated_","shaka.Player.prototype.onExpirationUpdated_","shaka.offline.Storage","shaka.util.Error.Code.LOCAL_PLAYER_INSTANCE_REQUIRED","storeInProgress_","firstPeriodTracks_","downloadManager_","Storage","shaka.offline.Storage.support","shaka.offline.Storage.prototype.destroy","shaka.offline.Storage.prototype.configure","shaka.offline.Storage.prototype.store","shaka.util.Error.Code.STORE_ALREADY_IN_PROGRESS","manifestDb","initIfNeeded_","checkDestroyed_","loadInternal","shaka.util.Error.Code.CANNOT_STORE_LIVE_OFFLINE","createOfflineManifest_","getSessionIds","shaka.util.Error.Code.NO_INIT_DATA_FOR_OFFLINE","downloadAndStore","cleanup_","shaka.offline.Storage.prototype.remove","content","removeSessions","deleteCount","segmentCount","shaka.offline.Storage.prototype.list","storedContents","shaka.offline.Storage.prototype.loadInternal","onKeyStatusChange","manifestParser","createSegmentIndex_","defaultTrackSelect_","shaka.offline.Storage.prototype.defaultTrackSelect_","selectedTracks","audioLangPref","matchTypes","allVariantTracks","tracksByMatchType","primaryTracks","languages","tracksByHeight","shaka.offline.Storage.prototype.defaultConfig_","trackSelectionCallback","storedContent","percent","shaka.offline.Storage.prototype.initIfNeeded_","shaka.offline.Storage.prototype.filterPeriod_","shaka.offline.Storage.prototype.cleanup_","shaka.offline.Storage.prototype.createSegmentIndex_","variantStreams","shaka.offline.Storage.prototype.createPeriod_","chosenTracks","allTracks","foundSimilarTracks","bandwidthEstimation","createStream_","shaka.offline.Storage.prototype.createStream_","estimatedStreamBandwidth","opt_variantId","segmentsDb","addSegment","segmentDataDb","manifestKey","streamNumber","segmentNumber","initDataDb","shaka.offline.Storage.prototype.checkDestroyed_","shaka.polyfill.installAll","shaka.polyfill.polyfills_.length","shaka.polyfill.polyfills_","shaka.polyfill.register","shaka.polyfill.polyfills_.push","shaka.polyfill.Fullscreen.proxyEvent_","eventType","newEvent","createEvent","initEvent","shaka.polyfill.Fullscreen.install","Document","proto","requestFullscreen","mozRequestFullScreen","msRequestFullscreen","mozCancelFullScreen","msExitFullscreen","webkitExitFullscreen","mozFullScreenElement","msFullscreenElement","webkitFullscreenElement","mozFullScreenEnabled","msFullscreenEnabled","webkitFullscreenEnabled","shaka.polyfill.IndexedDB.install","agent","shaka.polyfill.MathRound.install","testNumber","original_mathRound","Math.round","shaka.polyfill.MathRound.MAX_ACCURATE_INPUT_","shaka.util.Pssh","psshBox","systemIds","cencKeyIds","dataBoundaries","parseBox_","shaka.util.Pssh.prototype.parseBox_","systemId","numKeyIds","dataSize","shaka.polyfill.PatchedMediaKeysMs.requestMediaKeySystemAccess","supportedConfigurations","shaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess","cfg","newCfg","initDataTypes","ranAnyTests","cap","MSMediaKeys","configuration_","unsupportedKeySystemError","DOMException","NOT_SUPPORTED_ERR","shaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.createMediaKeys","shaka.polyfill.PatchedMediaKeysMs.MediaKeys","shaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.getConfiguration","shaka.polyfill.PatchedMediaKeysMs.setMediaKeys","oldMediaKeys","setMedia","nativeMediaKeys_","shaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.createSession","opt_sessionType","TypeError","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession","shaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.setServerCertificate","shaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.setMedia","setMediaKeysDeferred","msSetMediaKeys","shaka.polyfill.PatchedMediaKeysMs.onMsNeedKey_","nativeMediaKeys","nativeMediaKeySession_","updatePromise_","generateRequestPromise_","closed","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap","shaka$polyfill$PatchedMediaKeysMs$MediaKeySession.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.generateRequest","onMsKeyMessage_","onMsKeyAdded_","onMsKeyError_","updateKeyStatus_","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.load","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.update","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.close","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.remove","event2","initCustomEvent","unfilteredInitDatas","currPssh","dedupedInitDatas","shaka.polyfill.PatchedMediaKeysMs.compareInitDatas_","targetLength","normalisedInitData","initDataA","initDataB","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.onMsKeyMessage_","messageType","getStatus","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.onMsKeyAdded_","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.onMsKeyError_","errorCode","MSMediaKeyError","MS_MEDIA_KEYERR_OUTPUT","MS_MEDIA_KEYERR_HARDWARECHANGE","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.updateKeyStatus_","setStatus","status_","shaka$polyfill$PatchedMediaKeysMs$MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.setStatus","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.getStatus","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.forEach","fn","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.get","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.has","fakeKeyId","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.entries","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.keys","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.values","shaka.polyfill.PatchedMediaKeysNop.requestMediaKeySystemAccess","shaka.polyfill.PatchedMediaKeysNop.setMediaKeys","shaka.polyfill.PatchedMediaKeysNop.MediaKeys","shaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.createSession","shaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.setServerCertificate","shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess","shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.getConfiguration","shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.createMediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.prefix_","shaka.polyfill.PatchedMediaKeysWebkit.install","prefix","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_","shaka.polyfill.PatchedMediaKeysWebkit.requestMediaKeySystemAccess","HTMLMediaElement","shaka.polyfill.PatchedMediaKeysWebkit.setMediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess","shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_","api","toUpperCase","internalKeySystem_","allowPersistentState","tmpVideo","unsupportedError","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.createMediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.getConfiguration","keySystem_","media_","newSessions_","sessionMap_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setMedia","onWebkitNeedKey_","onWebkitKeyMessage_","onWebkitKeyAdded_","onWebkitKeyError_","shaka$polyfill$PatchedMediaKeysWebkit$MediaKeys.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.createSession","sessionType","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setServerCertificate","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitNeedKey_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyMessage_","findSession_","generatePromise_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyAdded_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyError_","systemCode","MediaKeyError","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.findSession_","type_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generate_","offlineSessionId","mangledInitData","generateKeyRequestName","shaka$polyfill$PatchedMediaKeysWebkit$MediaKeySession.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype","shaka_polyfill_PatchedMediaKeysWebkit_MediaKeySession_prototype$update_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update_","licenseString","addKeyName","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.updateKeyStatus_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generateRequest","generate_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.load","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update","nextUpdatePromise","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.close","cancelKeyRequestName","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.remove","shaka$polyfill$PatchedMediaKeysWebkit$MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.setStatus","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.getStatus","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.forEach","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.get","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.has","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.entries","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.keys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.values","shaka.polyfill.MediaKeys.install","HTMLVideoElement","webkitGenerateKeyRequest","generateKeyRequest","shaka.polyfill.MediaSource.stubAbort_","MediaSource.prototype.addSourceBuffer","sourceBuffer.abort","shaka.polyfill.MediaSource.patchEndOfStreamEvents_","MediaSource.prototype.endOfStream","newDuration","sourceBuffers","ignoreUpdateEnd_","eventSuppressed_","shaka.polyfill.MediaSource.ignoreUpdateEnd_","cleanUpHandlerInstalled_","shaka.polyfill.MediaSource.cleanUpListeners_","shaka.polyfill.MediaSource.install","vendor","appVersion","shaka.polyfill.Promise","opt_callback","thens_","catches_","state_","shaka.polyfill.Promise.State.PENDING","resolve_","reject_","shaka.polyfill.Promise.resolve","shaka.polyfill.Promise.reject","shaka.polyfill.Promise.all","others","newValue","shaka.polyfill.Promise.race","shaka.polyfill.Promise.prototype.then","opt_successCallback","opt_failCallback","RESOLVED","schedule_","shaka.polyfill.Promise.prototype.catch","shaka.polyfill.Promise.prototype.resolve_","value_","shaka.polyfill.Promise.prototype.reject_","shaka.polyfill.Promise.prototype.schedule_","shaka.polyfill.Promise.q_.push","wrapper","shaka.polyfill.Promise.handleThenable_","shaka.polyfill.Promise.flushTimer_","shaka.polyfill.Promise.setImmediate_","shaka.polyfill.Promise.flush","thenable","sealed","nextThen","shaka.polyfill.Promise.q_.length","shaka.polyfill.Promise.clearImmediate_","shaka.polyfill.Promise.q_","shaka.polyfill.Promise.install","opt_force","setImmediate","clearImmediate","race","shaka.polyfill.VideoPlayPromise.install","originalPlay","HTMLMediaElement.prototype.play","shaka.polyfill.VideoPlaybackQuality.webkit_","webkitDroppedFrameCount","webkitDecodedFrameCount","shaka.polyfill.VideoPlaybackQuality.install","shaka.polyfill.VTTCue.from3ArgsTextTrackCue_","TextTrackCue","shaka.polyfill.VTTCue.from6ArgsTextTrackCue_","shaka.polyfill.VTTCue.install","constructorLength","provider","getConfig","entryID","_generateGUID","S4","_addSessionId","delimiter","primaryGUID","secondGUID","_replaceSecondGUID","secondGUIDRegex","newSessionId","handleSessionId","sessionIdRegex"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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Ad,CAAX;AACA,UAAIJ,MAAMC,OAAN,CAAc5J,IAAd,CAAJ,EAAyB;AACvB,aAAK,IAAIC,IAAI,CAAb,EAAgBA,IAAID,KAAKE,MAAzB,EAAiC,EAAED,CAAnC,EAAsC;AACpC,cAAID,KAAKC,CAAL,KAAWzD,KAAf,EAAsB;AACpBwD,iBAAKuL,MAAL,CAAYtL,CAAZ,EAAe,CAAf;AACA,cAAEA,CAAF;AACD;AACF;AACF;AACF;;AAED;;;;AAIA;;;;2BACyB;AACvB,aAAO,KAAKyN,IAAL,CAAUrD,IAAV,EAAP;AACD;;AAGD;;;;;;;4BAIc;AACZ,WAAKqD,IAAL,CAAUnN,KAAV;AACD;;;;;;kBAGYkN,Q;;;;;;ACnHf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,E;;;;;;;;;;;;;;;AC5FA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEqBI,K;;;;;;;AAyBnB;;;;;;;;;AAZA;;;;;;AAZA;;;;;iCAgCoBjJ,M,EAAgBlC,M,EAAyB;AAC3D,aAAO,IAAI,IAAJ,CAASkC,MAAT,EAAiBlC,MAAjB,CAAP;AACD;;AAED;;;;;;;;;AAjBA;;;;AAbA;;;;;;;;g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AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4CAA4C;AAC5C;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oDAAoD;AACpD;AACA;AACA;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;;AAEA;AACA,0CAA0C,0BAA0B;;AAEpE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mEAAmE,aAAa;AAChF;;AAEA;AACA,sDAAsD;AACtD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA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A,eAAe;;AAEf;AACA;;AAEA;AACA;;AAEA,8CAA8C;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4CAA4C;AAC5C;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oDAAoD;AACpD;AACA;AACA;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;;AAEA;AACA,0CAA0C,0BAA0B;;AAEpE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mEAAmE,aAAa;AAChF;;AAEA;AACA,sDAAsD;AACtD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;A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AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA,mEAAmE,gEAAgE;AACnI;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA,kFAAkF,mEAAmE;AACrJ;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4FAA4F,mEAAmE;AAC/J;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;;;;AC/MA;;;;AACA;;;;;;;;AAGA;;;;IAIqBU,iB;;AA2BnB;;;;;;AA1BA;;;;;;AA+BA,6BAAYC,SAAZ,EAAgD;AAAA,QAAjB5E,EAAiB,uEAAJ,EAA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AOJ,GAAP;AACD;;;;;;kBAvCkBse,S;;;;;;;;;;;;;;;;;;;ACHrB;;IAAYU,O;;AAGZ;;;;AAGA;;;;AACA;;AAGA;;AACA;;AAEA;;;;;;;;AACA;;AAZA;QAcQA,O,GAAAA,O;QAASzE,W;QAAa0E,S;QAAWC,K;;AAPzC;;;AAJA;;;AANA,c;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA,kCAAkC,SAAS;AAC3C;AACA;AACA;AACA;AACA,sGAAsG,KAAK,wBAAwB;AACnI;AACA,sFAAsF,0DAA0D;AAChJ,6EAA6E,4DAA4D;AACzI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uHAAuH;AACvH;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,SAAS,mEAAmE;AAC5E;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,uCAAuC;AACvC,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,kIAAkI,iCAAiC,6HAA6H;AAChS;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qFAAqF;AACrF;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,6FAA6F;AAC7F,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,uCAAuC,UAAU;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,oDAAoD,iBAAiB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,gHAAgH;AAC7L;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,2CAA2C,KAAK;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8IAA8I;AAC9I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8IAA8I;AAC9I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA,uJAAuJ;AACvJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAA8D;AAC9D,CAAC;AACD,kC;;;;;;AC/YA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;;;;;;AAMA;AACA;AACA;AACA;AACA;;;;;;;;;;AAUA;AACA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;;;;AAUA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;AAIA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY;AACZ;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qEAAqE;;AAErE;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,wCAAwC;AACxC,kDAAkD;;AAElD;AACA;;AAEA;;AAEA;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAyB;AACzB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uFAAuF,gBAAgB;AACvG;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,YAAY;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ,GAAG;AACH;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA,oBAAoB;AACpB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,qEAAqE;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wEAAwE;;AAExE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,CAAC;AACD;;;;;;;;;;;;;;;;AChmCA;;AACA;;;;AACA;;;;;;;;;;;;IAEMC,a;;;AAMJ,2BAAmD;AAAA,QAAvCnf,GAAuC,uEAAhB,EAAE5G,QAAQ,EAAV,EAAgB;;AAAA;;AAAA;;AAGjD,UAAK7E,IAAL,GAAYyL,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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;;ACvLtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc,yBAAyB;AACvC;;AAEA;AACA;AACA,eAAe,WAAW;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,YAAY,yBAAyB;;AAErC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,C;;;;;;;;;;ACvPA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;AC7DA;;AAEA;AACA;;AAEA;;;;;;;ACLA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;ACpBA;AAAA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,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A;AACA;;AAEA;;;;;;;;;;ACHA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;AC7CA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;;;;;;;;;ACrBA;;AAEA;AACA;;AAEA;;;;;;;;ACLA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AC5BA;;;;;;;;sDCAA;;AAEA;AACA;AACA,CAAC;;AAED;;AAEA;;AAEA,sCAAsC,uCAAuC,kBAAkB;;AAE/F,SAAS;;;AAGT;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;;AAEA;AACA,4B;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;ACrBA;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA,E;;;;;;;;;;;ACtBsB;AACtB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,mEAAmE;AACnE;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C,+EAAyB;;AAEpE;AACA;AACA;;AAEA;AACA,mCAAmC,aAAa;AAChD;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,8BAA8B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;ACjIA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA,aAAa,gBAAgB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,C;;;;;;;;AClDA;AAAA,mDAAmD,gBAAgB,sBAAsB,OAAO,2BAA2B,0BAA0B,yDAAyD,2BAA2B,EAAE,EAAE,EAAE,eAAe;;AAE9P;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB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EA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4CAA4C;AAC5C;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oDAAoD;AACpD;AACA;AACA;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;;AAEA;AACA,0CAA0C,0BAA0B;;AAEpE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mEAAmE,aAAa;AAChF;;AAEA;AACA,sDAAsD;AACtD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;A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AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA,CAAC;;AAED;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,iBAAiB,mBAAmB;AACpC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA,mBAAmB,2BAA2B;;AAE9C;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,mBAAmB;AACnC;AACA;;AAEA;AACA;;AAEA,iBAAiB,2BAA2B;AAC5C;AACA;;AAEA,QAAQ,uBAAuB;AAC/B;AACA;AACA,GAAG;AACH;;AAEA,iBAAiB,uBAAuB;AACxC;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA;AACA,cAAc;;AAEd,kDAAkD,sBAAsB;AACxE;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD;AACvD;;AAEA,6BAA6B,mBAAmB;;AAEhD;;AAEA;;AAEA;AACA;;;;;;;;AC/VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,WAAW,EAAE;AACrD,wCAAwC,WAAW,EAAE;;AAErD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,sCAAsC;AACtC,GAAG;AACH;AACA,8DAA8D;AAC9D;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;;;;;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AA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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjFA;;;AAGA;;;;;;;AAEA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AAGA;;;;AACA;;;;AAIA;;;;AACA;;;;AACA;;;;AACA;;;;;;AACA;;AAPA;;AAEA;;AANA;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AO1E,SAAP,GAAmBA,SAAnB;AACD;;AAED;;;;;;;AAOA,SAASwkH,kBAAT,CAA4B3mH,cAA5B,EAAoDmC,SAApD,EAAuE0E,MAAvE,EAA6F;AAC3F,MAAI+/G,kBAAkB,qBAAtB;AACA,MAAIF,aAAaE,gBAAgB5sD,IAAhB,CAAqB73D,SAArB,CAAjB;AACA,MAAIukH,cAAcA,WAAW,CAAX,CAAlB,EAAiC;AAC/B,QAAIG,eAAe1kH,UAAUoc,OAAV,CAAkBmoG,WAAW,CAAX,CAAlB,EAAiCL,eAAjC,CAAnB;AACArmH,mBAAemL,GAAf,GAAqBnL,eAAemL,GAAf,CAAmBoT,OAAnB,CAA2Bpc,SAA3B,EAAsC0kH,YAAtC,CAArB;AACAhgH,WAAO1E,SAAP,GAAmB0kH,YAAnB;AACD;AACF;;AAED;;;;;;AAMA,SAASC,eAAT,GAA4E;AAAA,MAAnD9mH,cAAmD,uEAA1B,EAA0B;AAAA,MAAtB6G,MAAsB;;AAC1E,MAAI,OAAO7G,eAAemL,GAAtB,KAA8B,QAA9B,IAA0CnL,eAAemL,GAAf,CAAmB7L,WAAnB,GAAiC+G,OAAjC,CAAyC,eAAzC,MAA8D,CAAC,CAA7G,EAAgH;AAC9G,QAAI0gH,iBAAiB,oCAArB;AACA,QAAI5kH,YAAY4kH,eAAe/sD,IAAf,CAAoBh6D,eAAemL,GAAnC,CAAhB;AACA,QAAIhJ,aAAaA,UAAU,CAAV,CAAjB,EAA+B;AAC7BwkH,yBAAmB3mH,cAAnB,EAAmCmC,UAAU,CAAV,CAAnC,EAAiD0E,MAAjD;AACD,KAFD,MAEO;AACL0/G,oBAAcvmH,cAAd,EAA8B6G,MAA9B;AACD;AACF;AACF;;kBAEcigH,e","file":"kaltura-player.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(\"KalturaPlayer\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"KalturaPlayer\"] = factory();\n\telse\n\t\troot[\"KalturaPlayer\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 9fe00b4907da334ae6b8","(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(\"Playkit\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Playkit\"] = factory();\n\telse\n\t\troot[\"Playkit\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///core/webpack/universalModuleDefinition"," \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\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 21);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2c6e69a47798e2a1ec2f\n\n\n// WEBPACK FOOTER //\n// webpack:/core/webpack/bootstrap 2c6e69a47798e2a1ec2f","//@flow\n\n/**\n * General track representation of the player.\n * @classdesc\n */\nexport default class Track {\n /**\n * The id of the track.\n * @member\n * @type {string}\n * @private\n */\n _id: ?string;\n /**\n * The active mode of the track.\n * @member\n * @type {boolean}\n * @private\n */\n _active: boolean;\n /**\n * The label of the track.\n * @member\n * @type {string}\n * @private\n */\n _label: string;\n /**\n * The language of the track.\n * @member\n * @type {string}\n * @private\n */\n _language: string;\n /**\n * The index of the track.\n * @member\n * @type {number}\n * @private\n */\n _index: number;\n\n /**\n * Getter for the track id.\n * @public\n * @returns {?string} - The track id.\n */\n get id(): ?string {\n return this._id;\n }\n\n /**\n * Getter for the active mode of the track.\n * @public\n * @returns {boolean} - The active mode of the track.\n */\n get active(): boolean {\n return this._active;\n }\n\n /**\n * Setter for the active mode of the track.\n * @public\n * @param {boolean} value - Whether the track is active or not.\n */\n set active(value: boolean) {\n this._active = value;\n }\n\n /**\n * Getter for the label of the track.\n * @public\n * @returns {string} - The label of the track.\n */\n get label(): string {\n return this._label;\n }\n\n /**\n * Getter for the language of the track.\n * @public\n * @returns {string} - The language of the track.\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Getter for the index of the track.\n * @public\n * @returns {number} - The index of the track.\n */\n get index(): number {\n return this._index;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n constructor(settings: Object = {}) {\n this._id = settings.id;\n this._active = settings.active;\n this._label = settings.label;\n this._language = settings.language;\n this._index = settings.index;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./track/track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/track.js","//@flow\nimport * as JsLogger from 'js-logger';\n\nconst LOG_LEVEL: { [level: string]: Object } = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nclass LoggerFactory {\n constructor(options?: Object) {\n JsLogger.useDefaults(options || {});\n }\n\n getLogger(name?: string) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n}\n\nconst lf = new LoggerFactory({defaultLevel: JsLogger.DEBUG});\n\nexport default lf;\nexport {LOG_LEVEL};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/logger.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/logger.js","//@flow\n/**\n * Create an Event work-alike object based on the dictionary.\n * The event should contain all of the same properties from the dict.\n * @param {string} type -\n * @param {Object=} opt_dict -\n * @constructor\n * @extends {Event}\n */\nclass FakeEvent {\n /** @const {boolean} */\n bubbles: boolean;\n\n /** @const {boolean} */\n cancelable: boolean;\n\n /** @const {boolean} */\n defaultPrevented: boolean;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n timeStamp: number | Date;\n\n /** @const {string} */\n type: string;\n\n /** @const {boolean} */\n isTrusted: boolean;\n\n /** @type {EventTarget} */\n currentTarget: any;\n\n /** @type {EventTarget} */\n target: any;\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n stopped: boolean;\n\n payload: any;\n\n constructor(type: string, payload: any) {\n // These Properties below cannot be set by dict. They are all provided for\n // compatibility with native events.\n\n /** @const {boolean} */\n this.bubbles = false;\n\n /** @const {boolean} */\n this.cancelable = false;\n\n /** @const {boolean} */\n this.defaultPrevented = false;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n this.timeStamp = window.performance ? window.performance.now() : Date.now();\n\n /** @const {string} */\n this.type = type;\n\n /** @const {boolean} */\n this.isTrusted = false;\n\n /** @type {EventTarget} */\n this.currentTarget = null;\n\n /** @type {EventTarget} */\n this.target = null;\n\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n this.stopped = false;\n\n this.payload = payload;\n }\n\n /**\n * Does nothing, since FakeEvents have no default. Provided for compatibility\n * with native Events.\n * @override\n */\n preventDefault() {\n }\n\n /**\n * Stops processing event listeners for this event. Provided for compatibility\n * with native Events.\n * @override\n */\n stopImmediatePropagation() {\n this.stopped = true;\n }\n\n /**\n * Does nothing, since FakeEvents do not bubble. Provided for compatibility\n * with native Events.\n * @override\n */\n stopPropagation() {\n }\n}\n\nexport default FakeEvent;\n\n\n\n// WEBPACK FOOTER //\n// ./event/fake-event.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/fake-event.js","//@flow\nimport Track from './track'\n\n/**\n * Audio track representation of the player.\n * @classdesc\n */\nexport default class AudioTrack extends Track {}\n\n\n\n// WEBPACK FOOTER //\n// ./track/audio-track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/audio-track.js","//@flow\nimport Track from './track'\n\n/**\n * Text track representation of the player.\n * @classdesc\n */\nexport default class TextTrack extends Track {\n /**\n * The kind of the text track:\n * subtitles/captions/metadata.\n * @member\n * @type {string}\n * @private\n */\n _kind: string;\n\n /**\n * Getter for the kind of the text track.\n * @public\n * @returns {string} - The kind of the text track.\n */\n get kind(): string {\n return this._kind;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n constructor(settings: Object = {}) {\n super(settings);\n this._kind = settings.kind;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./track/text-track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/text-track.js","//@flow\nimport Track from './track'\n\n/**\n * Video track representation of the player.\n * @classdesc\n */\nexport default class VideoTrack extends Track {\n /**\n * The kind of the text track:\n * subtitles/captions/metadata.\n * @member\n * @type {string}\n * @private\n */\n _bandwidth: string;\n\n /**\n * Getter for the kind of the text track.\n * @public\n * @returns {string} - The kind of the text track.\n */\n get bandwidth(): string {\n return this._bandwidth;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n constructor(settings: Object = {}) {\n super(settings);\n this._bandwidth = settings.bandwidth;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./track/video-track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/video-track.js","//@flow\nimport MultiMap from '../utils/multi-map'\nimport FakeEvent from './fake-event'\n\n/**\n * Creates a new EventManager. An EventManager maintains a collection of \"event\n * bindings\" between event targets and event listeners.\n *\n * @struct\n * @constructor\n * @implements {IDestroyable}\n */\nclass EventManager {\n _bindingMap: MultiMap<Binding_> | null;\n\n constructor() {\n /**\n * Maps an event type to an array of event bindings.\n * @private {MultiMap.<!EventManager.Binding_>}\n */\n this._bindingMap = new MultiMap();\n }\n\n /**\n * Detaches all event listeners.\n * @override\n */\n destroy() {\n this.removeAll();\n this._bindingMap = null;\n return Promise.resolve();\n }\n\n\n /**\n * Attaches an event listener to an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {EventManager.ListenerType} listener The event listener.\n * @returns {void}\n */\n listen(target: any, type: string, listener: ListenerType): void {\n let binding = new Binding_(target, type, listener);\n if (this._bindingMap) {\n this._bindingMap.push(type, binding);\n }\n }\n\n\n /**\n * Detaches an event listener from an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @returns {void}\n */\n unlisten(target: any, type: string): void {\n if (this._bindingMap) {\n let list = this._bindingMap.get(type);\n\n for (let i = 0; i < list.length; ++i) {\n let binding = list[i];\n\n if (binding.target == target) {\n binding.unlisten();\n if (this._bindingMap) {\n this._bindingMap.remove(type, binding);\n }\n }\n }\n }\n }\n\n /**\n * Detaches all event listeners from all targets.\n * @returns {void}\n */\n removeAll(): void {\n if (this._bindingMap) {\n let listeners = this._bindingMap.getAll();\n\n for (let listener of listeners) {\n listener.unlisten();\n }\n if (this._bindingMap) {\n this._bindingMap.clear();\n }\n }\n }\n}\n\n/**\n * @typedef {function(!Event)}\n */\ntype ListenerType = (event: FakeEvent) => any;\n\n/**\n * Creates a new Binding_ and attaches the event listener to the event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {EventManager.ListenerType} listener The event listener.\n * @constructor\n * @private\n */\nclass Binding_ {\n target: any;\n type: string;\n listener: ?ListenerType;\n\n constructor(target, type, listener) {\n /** @type {EventTarget} */\n this.target = target;\n\n /** @type {string} */\n this.type = type;\n\n /** @type {?EventManager.ListenerType} */\n this.listener = listener;\n\n this.target.addEventListener(type, listener, false);\n }\n\n\n /**\n * Detaches the event listener from the event target. This does nothing if the\n * event listener is already detached.\n * @returns {void}\n */\n unlisten(): void {\n if (!this.target)\n return;\n\n this.target.removeEventListener(this.type, this.listener, false);\n\n this.target = null;\n this.listener = null;\n }\n}\n\nexport default EventManager;\n\n\n\n// WEBPACK FOOTER //\n// ./event/event-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/event-manager.js","//@flow\nimport {merge} from '../utils/util'\n\nconst HTML5_EVENTS: { [event: string]: string } = {\n /**\n * Fires when the loading of an audio/video is aborted\n */\n ABORT: 'abort',\n /**\n * Fires when the browser can start playing the audio/video\n */\n CAN_PLAY: 'canplay',\n /**\n * Fires when the browser can play through the audio/video without stopping for buffering\n */\n CAN_PLAY_THROUGH: 'canplaythrough',\n /**\n * Fires when the duration of the audio/video is changed\n */\n DURATION_CHANGE: 'durationchange',\n /**\n * Fires when the current playlist is empty\n */\n EMPTIED: 'emptied',\n /**\n * Fires when the current playlist is ended\n */\n ENDED: 'ended',\n /**\n * Fires when an error occurred during the loading of an audio/video\n */\n ERROR: 'error',\n /**\n * Fires when the browser has loaded the current frame of the audio/video\n */\n LOADED_DATA: 'loadeddata',\n /**\n * Fires when the browser has loaded meta data for the audio/video\n */\n LOADED_METADATA: 'loadedmetadata',\n /**\n * Fires when the browser starts looking for the audio/video\n */\n LOAD_START: 'loadstart',\n /**\n * Fires when the audio/video has been paused\n */\n PAUSE: 'pause',\n /**\n * Fires when the audio/video has been started or is no longer paused\n */\n PLAY: 'play',\n /**\n * Fires when the audio/video is playing after having been paused or stopped for buffering\n */\n PLAYING: 'playing',\n /**\n * Fires when the browser is downloading the audio/video\n */\n PROGRESS: 'progress',\n /**\n * Fires when the playing speed of the audio/video is changed\n */\n RATE_CHANGE: 'ratechange',\n /**\n * Fires when the user is finished moving/skipping to a new position in the audio/video\n */\n SEEKED: 'seeked',\n /**\n * Fires when the user starts moving/skipping to a new position in the audio/video\n */\n SEEKING: 'seeking',\n /**\n * Fires when the browser is trying to get media data, but data is not available\n */\n STALLED: 'stalled',\n /**\n * Fires when the browser is intentionally not getting media data\n */\n SUSPEND: 'suspend',\n /**\n * Fires when the current playback position has changed\n */\n TIME_UPDATE: 'timeupdate',\n /**\n * Fires when the volume has been changed\n */\n VOLUME_CHANGE: 'volumechange',\n /**\n * Fires when the video stops because it needs to buffer the next frame\n */\n WAITING: 'waiting',\n};\n\nconst CUSTOM_EVENTS: { [event: string]: string } = {\n /**\n * Fires when the active video track has been changed\n */\n VIDEO_TRACK_CHANGED: 'videotrackchanged',\n /**\n * Fires when the active audio track has been changed\n */\n AUDIO_TRACK_CHANGED: 'audiotrackchanged',\n /**\n * Fires when the active text track has been changed\n */\n TEXT_TRACK_CHANGED: 'texttrackchanged',\n /**\n * Fires when the player tracks have been changed\n */\n TRACKS_CHANGED: 'trackschanged',\n /**\n * Fires when the player state has been changed\n */\n PLAYER_STATE_CHANGED: 'playerstatechanged',\n /**\n * Fires on the first play\n */\n FIRST_PLAY: 'firstplay',\n /**\n * Fires when the player has selected the source to play\n */\n SOURCE_SELECTED: 'sourceselected'\n};\n\nconst PLAYER_EVENTS: { [event: string]: string } = merge([HTML5_EVENTS, CUSTOM_EVENTS]);\n\nexport {PLAYER_EVENTS, HTML5_EVENTS, CUSTOM_EVENTS};\n\n\n\n// WEBPACK FOOTER //\n// ./event/events.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/events.js","//@flow\nimport EventManager from './event/event-manager'\nimport FakeEvent from './event/fake-event'\nimport FakeEventTarget from './event/fake-event-target'\nimport {PLAYER_EVENTS as PlayerEvents, HTML5_EVENTS as Html5Events, CUSTOM_EVENTS as CustomEvents} from './event/events'\nimport PlayerStates from './state/state-types'\nimport {isNumber, isFloat, mergeDeep, copyDeep} from './utils/util'\nimport LoggerFactory from './utils/logger'\nimport Html5 from './engines/html5/html5'\nimport PluginManager from './plugin/plugin-manager'\nimport StateManager from './state/state-manager'\nimport TrackTypes from './track/track-types'\nimport Track from './track/track'\nimport VideoTrack from './track/video-track'\nimport AudioTrack from './track/audio-track'\nimport TextTrack from './track/text-track'\nimport DefaultPlayerConfig from './player-config.json'\n\n/**\n * The HTML5 player class.\n * @classdesc\n */\nexport default class Player extends FakeEventTarget {\n /**\n * The player class logger.\n * @type {any}\n * @static\n * @private\n */\n static _logger: any = LoggerFactory.getLogger('Player');\n /**\n * The plugin manager of the player.\n * @type {PluginManager}\n * @private\n */\n _pluginManager: PluginManager;\n /**\n * The event manager of the player.\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * The runtime configuration of the player.\n * @type {Object}\n * @private\n */\n _config: Object;\n /**\n * The playback engine.\n * @type {IEngine}\n * @private\n */\n _engine: IEngine;\n /**\n * The state manager of the player.\n * @type {StateManager}\n * @private\n */\n _stateManager: StateManager;\n /**\n * The tracks of the player.\n * @type {Array<Track>}\n * @private\n */\n _tracks: Array<Track>;\n /**\n * The player ready promise\n * @type {Promise<*>}\n * @private\n */\n _readyPromise: ?Promise<*>;\n /**\n * Whether the play is the first or not\n * @type {boolean}\n * @private\n */\n _firstPlay: boolean;\n /**\n * The available engines of the player.\n * @type {Array<typeof IEngine>}\n * @private\n */\n static _engines: Array<typeof IEngine> = [Html5];\n\n /**\n * @param {Object} config - The configuration for the player instance.\n * @constructor\n */\n constructor(config: Object) {\n super();\n this._tracks = [];\n this._firstPlay = true;\n this._stateManager = new StateManager(this);\n this._pluginManager = new PluginManager();\n this._eventManager = new EventManager();\n this._readyPromise = new Promise((resolve, reject) => {\n this._eventManager.listen(this, CustomEvents.TRACKS_CHANGED, () => {\n resolve();\n });\n this._eventManager.listen(this, Html5Events.ERROR, reject);\n });\n this.configure(config);\n }\n\n /**\n * Configures the player according to given configuration.\n * @param {Object} config - The configuration for the player instance.\n * @returns {void}\n */\n configure(config: Object): void {\n this._config = mergeDeep(Player._defaultConfig(), config);\n if (this._selectEngine()) {\n this._attachMedia();\n this._loadPlugins();\n this._handlePlaybackConfig();\n } else {\n Player._logger.warn(\"No playable engines was found to play the given sources\");\n }\n }\n\n /**\n * Destroys the player.\n * @returns {void}\n * @public\n */\n destroy(): void {\n if (this._engine) {\n this._engine.destroy();\n }\n this._eventManager.destroy();\n this._pluginManager.destroy();\n this._stateManager.destroy();\n this._config = {};\n this._tracks = [];\n this._readyPromise = null;\n this._firstPlay = true;\n }\n\n /**\n * @returns {Object} - The default configuration of the player.\n * @private\n * @static\n */\n static _defaultConfig(): Object {\n return copyDeep(DefaultPlayerConfig);\n }\n\n /**\n * Loads the configured plugins.\n * @private\n * @returns {void}\n */\n _loadPlugins(): void {\n let plugins = this._config.plugins;\n for (let name in plugins) {\n this._pluginManager.load(name, this, plugins[name]);\n }\n }\n\n /**\n * Selects the engine to create based on a given configuration.\n * @private\n * @returns {boolean} - Whether a proper engine was found.\n */\n _selectEngine(): boolean {\n if (this._config.sources && this._config.playback && this._config.playback.streamPriority) {\n return this._selectEngineByPriority();\n }\n return false;\n }\n\n /**\n * Selects an engine to play a source according to a given stream priority.\n * @return {boolean} - Whether a proper engine was found to play the given sources\n * according to the priority.\n * @private\n */\n _selectEngineByPriority(): boolean {\n let streamPriority = this._config.playback.streamPriority;\n let sources = this._config.sources;\n for (let priority of streamPriority) {\n let engineId = (typeof priority.engine === 'string') ? priority.engine.toLowerCase() : '';\n let format = (typeof priority.format === 'string') ? priority.format.toLowerCase() : '';\n let engine = Player._engines.find((engine) => engine.id === engineId);\n if (engine) {\n let formatSources = sources[format];\n if (formatSources && formatSources.length > 0) {\n let source = formatSources[0];\n if (engine.canPlayType(source.mimetype)) {\n this._loadEngine(engine, source);\n return true;\n }\n }\n }\n }\n return false;\n }\n\n /**\n * Loads the selected engine.\n * @param {IEngine} engine - The selected engine.\n * @param {Source} source - The selected source object.\n * @private\n * @returns {void}\n */\n _loadEngine(engine: typeof IEngine, source: Source): void {\n this.dispatchEvent(new FakeEvent(CustomEvents.SOURCE_SELECTED, {selectedSource: source}));\n this._engine = engine.createEngine(source, this._config);\n }\n\n /**\n * Listen to all HTML5 defined events and trigger them on the player\n * @private\n * @returns {void}\n */\n _attachMedia(): void {\n if (this._engine) {\n for (let playerEvent in Html5Events) {\n this._eventManager.listen(this._engine, Html5Events[playerEvent], (event: FakeEvent) => {\n return this.dispatchEvent(event);\n });\n }\n this._eventManager.listen(this._engine, CustomEvents.VIDEO_TRACK_CHANGED, (event: FakeEvent) => {\n this._markActiveTrack(event.payload.selectedVideoTrack);\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this._engine, CustomEvents.AUDIO_TRACK_CHANGED, (event: FakeEvent) => {\n this._markActiveTrack(event.payload.selectedAudioTrack);\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this._engine, CustomEvents.TEXT_TRACK_CHANGED, (event: FakeEvent) => {\n this._markActiveTrack(event.payload.selectedTextTrack);\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this, Html5Events.PLAY, this._onPlay.bind(this));\n }\n }\n\n _handlePlaybackConfig(): void {\n if (this._config.playback) {\n if (this._config.playback.muted) {\n this.muted = true;\n }\n if (this._config.playback.preload === \"auto\") {\n this.load();\n }\n if (this._config.playback.autoplay) {\n this.play();\n }\n }\n }\n\n /**\n * Returns the tracks according to the filter. if no filter given returns the all tracks.\n * @function getTracks\n * @param {string} [type] - a tracks filter, should be 'video', 'audio' or 'text'.\n * @returns {Array<Track>} - The parsed tracks.\n * @public\n */\n getTracks(type?: string): Array<Track> {\n return this._getTracksByType(type);\n }\n\n /**\n * Returns the tracks according to the filter. if no filter given returns the all tracks.\n * @function _getTracksByType\n * @param {string} [type] - a tracks filter, should be 'video', 'audio' or 'text'.\n * @returns {Array<Track>} - The parsed tracks.\n * @private\n */\n _getTracksByType(type?: string): Array<Track> {\n return !type ? this._tracks : this._tracks.filter((track: Track) => {\n if (type === TrackTypes.VIDEO) {\n return track instanceof VideoTrack;\n } else if (type === TrackTypes.AUDIO) {\n return track instanceof AudioTrack;\n } else if (type === TrackTypes.TEXT) {\n return track instanceof TextTrack;\n } else {\n return true;\n }\n });\n }\n\n /**\n * Select a track\n * @function selectTrack\n * @param {Track} track - the track to select\n * @returns {void}\n * @public\n */\n selectTrack(track: Track): void {\n if (this._engine) {\n if (track instanceof VideoTrack) {\n this._engine.selectVideoTrack(track);\n } else if (track instanceof AudioTrack) {\n this._engine.selectAudioTrack(track);\n } else if (track instanceof TextTrack) {\n this._engine.selectTextTrack(track);\n }\n }\n }\n\n /**\n * Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n hideTextTrack(): void {\n if (this._engine) {\n this._engine.hideTextTrack();\n this._getTracksByType(TrackTypes.TEXT).map(track => track.active = false);\n }\n }\n\n /**\n * Enables adaptive bitrate switching.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n if (this._engine) {\n this._engine.enableAdaptiveBitrate();\n }\n }\n\n /**\n * Mark the selected track as active\n * @function _markActiveTrack\n * @param {Track} track - the track to mark\n * @returns {void}\n * @private\n */\n _markActiveTrack(track: Track) {\n let type;\n if (track instanceof VideoTrack) {\n type = TrackTypes.VIDEO;\n } else if (track instanceof AudioTrack) {\n type = TrackTypes.AUDIO;\n } else if (track instanceof TextTrack) {\n type = TrackTypes.TEXT;\n }\n if (type) {\n let tracks = this.getTracks(type);\n for (let i = 0; i < tracks.length; i++) {\n tracks[i].active = track.index === i;\n }\n }\n }\n\n /**\n * @function _onPlay\n * @return {void}\n * @private\n */\n _onPlay(): void {\n if (this._firstPlay) {\n this._firstPlay = false;\n this.dispatchEvent(new FakeEvent(CustomEvents.FIRST_PLAY));\n }\n }\n\n /**\n * Get the player config.\n * @returns {Object} - The player configuration.\n * @public\n */\n get config(): Object {\n return this._config;\n }\n\n /**\n * Set player session id\n * @param {string} sessionId - the player session id to set\n * @returns {void}\n * @public\n */\n set sessionId(sessionId: string): void {\n this._config.session = this._config.session || {};\n this._config.session.id = sessionId;\n }\n\n // <editor-fold desc=\"Playback Interface\">\n /**\n * The player readiness\n * @public\n * @returns {Promise<*>} - The ready promise\n */\n ready(): Promise<*> {\n return this._readyPromise ? this._readyPromise : Promise.resolve();\n }\n\n /**\n * Load media\n * @public\n * @returns {void}\n */\n load(): void {\n if (this._engine) {\n this._engine.load().then((data) => {\n this._tracks = data.tracks;\n this.dispatchEvent(new FakeEvent(CustomEvents.TRACKS_CHANGED, {tracks: this._tracks}));\n }).catch((error) => {\n this.dispatchEvent(new FakeEvent(Html5Events.ERROR, error));\n });\n }\n }\n\n /**\n * Start/resume playback.\n * @returns {void}\n * @public\n */\n play(): void {\n if (this._engine) {\n if (this._engine.src) {\n this._engine.play();\n } else {\n this.load();\n this.ready().then(() => {\n this._engine.play();\n });\n }\n }\n }\n\n /**\n * Pause playback.\n * @returns {void}\n * @public\n */\n pause(): void {\n if (this._engine) {\n return this._engine.pause();\n }\n }\n\n /**\n * Set the current time in seconds.\n * @param {Number} to - The number to set in seconds.\n * @public\n */\n set currentTime(to: number): void {\n if (this._engine) {\n if (isNumber(to)) {\n let boundedTo = to;\n if (to < 0) {\n boundedTo = 0;\n }\n if (boundedTo > this._engine.duration) {\n boundedTo = this._engine.duration;\n }\n this._engine.currentTime = boundedTo;\n }\n }\n }\n\n /**\n * Get the current time in seconds.\n * @returns {?Number} - The playback current time.\n * @public\n */\n get currentTime(): ?number {\n if (this._engine) {\n return this._engine.currentTime;\n }\n }\n\n /**\n * Get the duration in seconds.\n * @returns {?Number} - The playback duration.\n * @public\n */\n get duration(): ?number {\n if (this._engine) {\n return this._engine.duration;\n }\n }\n\n /**\n * Set playback volume.\n * @param {Number} vol - The volume to set.\n * @returns {void}\n * @public\n */\n set volume(vol: number): void {\n if (this._engine) {\n if (isFloat(vol)) {\n let boundedVol = vol;\n if (boundedVol < 0) {\n boundedVol = 0;\n }\n if (boundedVol > 1) {\n boundedVol = 1;\n }\n this._engine.volume = boundedVol;\n }\n }\n }\n\n /**\n * Get playback volume.\n * @returns {?Number} - The playback volume.\n * @public\n */\n get volume(): ?number {\n if (this._engine) {\n return this._engine.volume;\n }\n }\n\n // </editor-fold>\n\n // <editor-fold desc=\"State\">\n /**\n * Get paused state.\n * @returns {?boolean} - Whether the video is paused or not.\n * @public\n */\n get paused(): ?boolean {\n if (this._engine) {\n return this._engine.paused;\n }\n }\n\n /**\n * Get seeking state.\n * @returns {?boolean} - Whether the video is seeking or not.\n * @public\n */\n get seeking(): ?boolean {\n if (this._engine) {\n return this._engine.seeking;\n }\n }\n\n buffered() {\n }\n\n /**\n * Set player muted state.\n * @param {boolean} mute - The mute value.\n * @returns {void}\n * @public\n */\n set muted(mute: boolean): void {\n if (this._engine) {\n this._engine.muted = mute;\n }\n }\n\n /**\n * Get player muted state.\n * @returns {?boolean} - Whether the video is muted or not.\n * @public\n */\n get muted(): ?boolean {\n if (this._engine) {\n return this._engine.muted;\n }\n }\n\n /**\n * Get the player source.\n * @returns {?string} - The current source of the player.\n * @public\n */\n get src(): ?string {\n if (this._engine) {\n return this._engine.src;\n }\n }\n\n /**\n * Get the player events.\n * @returns {Object} - The events of the player.\n * @public\n */\n get Event(): { [event: string]: string } {\n return PlayerEvents;\n }\n\n /**\n * Get the player states.\n * @returns {Object} - The states of the player.\n * @public\n */\n get State(): { [state: string]: string } {\n return PlayerStates;\n }\n\n /**\n * Get the player tracks types.\n * @returns {Object} - The tracks types of the player.\n * @public\n */\n get Track(): { [track: string]: string } {\n return TrackTypes;\n }\n\n// </editor-fold>\n}\n\n\n\n// WEBPACK FOOTER //\n// ./player.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/player.js","//@flow\nimport FakeEvent from './fake-event'\nimport MultiMap from '../utils/multi-map'\n\n/**\n * A work-alike for EventTarget. Only DOM elements may be true EventTargets,\n * but this can be used as a base class to provide event dispatch to non-DOM\n * classes. Only FakeEvents should be dispatched.\n *\n * @struct\n * @constructor\n * @implements {EventTarget}\n * @export\n */\nclass FakeEventTarget {\n _listeners: MultiMap<ListenerType>;\n dispatchTarget: FakeEventTarget;\n\n constructor() {\n /**\n * @private {!MultiMap.<FakeEventTarget.ListenerType>}\n */\n this._listeners = new MultiMap();\n\n /**\n * The target of all dispatched events. Defaults to |this|.\n * @type {EventTarget}\n */\n this.dispatchTarget = this;\n }\n\n /**\n * Add an event listener to this object.\n *\n * @param {string} type The event type to listen for.\n * @param {FakeEventTarget.ListenerType} listener The callback or\n * listener object to invoke.\n * @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have\n * parents, so events neither capture nor bubble.\n * @override\n * @export\n */\n addEventListener(type: string, listener: ListenerType) {\n this._listeners.push(type, listener);\n }\n\n /**\n * Remove an event listener from this object.\n *\n * @param {string} type The event type for which you wish to remove a listener.\n * @param {FakeEventTarget.ListenerType} listener The callback or\n * listener object to remove.\n * @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have\n * parents, so events neither capture nor bubble.\n * @override\n * @export\n */\n removeEventListener(type: string, listener: ListenerType) {\n this._listeners.remove(type, listener);\n }\n\n /**\n * Dispatch an event from this object.\n *\n * @param {!Event} event The event to be dispatched from this object.\n * @return {boolean} True if the default action was prevented.\n * @override\n * @export\n */\n dispatchEvent(event: FakeEvent) {\n // In many browsers, it is complex to overwrite properties of actual Events.\n // Here we expect only to dispatch FakeEvents, which are simpler.\n //goog.asserts.assert(event instanceof FakeEvent,\n // 'FakeEventTarget can only dispatch FakeEvents!');\n\n let list = this._listeners.get(event.type) || [];\n\n for (let i = 0; i < list.length; ++i) {\n // Do this every time, since events can be re-dispatched from handlers.\n event.target = this.dispatchTarget;\n event.currentTarget = this.dispatchTarget;\n\n let listener = list[i];\n try {\n if (listener.handleEvent) {\n listener.handleEvent(event);\n } else {\n listener.call(this, event);\n }\n } catch (exception) {\n // Exceptions during event handlers should not affect the caller,\n // but should appear on the console as uncaught, according to MDN:\n // http://goo.gl/N6Ff27\n // TODO: add log\n }\n\n if (event.stopped) {\n break;\n }\n }\n\n return event.defaultPrevented;\n }\n}\n\n/**\n * These are the listener types defined in the closure extern for EventTarget.\n * @typedef {EventListener|function(!Event):(boolean|undefined)}\n */\ndeclare function ListenerType(event: FakeEvent): (boolean | void);\n\nexport default FakeEventTarget;\n\n\n\n// WEBPACK FOOTER //\n// ./event/fake-event-target.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/fake-event-target.js","//@flow\nexport default class PlayerError {\n static TYPE: {[name: string]: Object} = {\n NOT_REGISTERED_PLUGIN: {\n name: \"PluginNotRegisteredException\",\n message: function (name) {\n return `Cannot load ${name} plugin. Name not found in the registry`;\n }\n },\n NOT_VALID_HANDLER: {\n name: \"PluginHandlerIsNotValidException\",\n message: function () {\n return \"To activate plugin you must provide a class derived from BasePlugin\";\n }\n },\n NOT_IMPLEMENTED_METHOD: {\n name: \"NotImplementedException\",\n message: function (method) {\n return `${method} method not implemented`;\n }\n }\n };\n\n name: string;\n message: string;\n\n constructor(error: Object, param?: any) {\n this.name = error.name;\n this.message = error.message(param);\n }\n\n getError() {\n return {\n name: this.name,\n message: this.message\n };\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./utils/player-error.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/player-error.js","//@flow\n\"use strict\";\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is a number\n */\nfunction isNumber(n: number): boolean {\n return Number(n) === n;\n}\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is an integer\n */\nfunction isInt(n: number): boolean {\n return isNumber(n) && n % 1 === 0;\n}\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is a float\n */\nfunction isFloat(n: number): boolean {\n return isNumber(n) && n % 1 !== 0;\n}\n\n/**\n * @param {Array<Object>} objects - The objects to merge\n * @returns {Object} - The merged object.\n */\nfunction merge(objects: Array<Object>): Object {\n let target = {};\n for (let obj of objects) {\n Object.assign(target, obj);\n }\n return target;\n}\n\n/**\n * @param {any} item - The item to check.\n * @returns {boolean} - Whether the item is an object.\n */\nfunction isObject(item: any) {\n return (item && typeof item === 'object' && !Array.isArray(item));\n}\n\n/**\n * @param {any} target - The target object.\n * @param {any} sources - The objects to merge.\n * @returns {Object} - The merged object.\n */\nfunction mergeDeep(target: any, ...sources: any): Object {\n if (!sources.length) {\n return target;\n }\n const source = sources.shift();\n if (isObject(target) && isObject(source)) {\n for (const key in source) {\n if (isObject(source[key])) {\n if (!target[key]) Object.assign(target, {[key]: {}});\n mergeDeep(target[key], source[key]);\n } else {\n Object.assign(target, {[key]: source[key]});\n }\n }\n }\n return mergeDeep(target, ...sources);\n}\n\n/**\n * @param {any} data - The data to copy.\n * @returns {any} - The copied data.\n */\nfunction copyDeep(data: any): any {\n let node;\n if (Array.isArray(data)) {\n node = data.length > 0 ? data.slice(0) : [];\n node.forEach((e, i) => {\n if (\n (typeof e === \"object\" && e !== {}) ||\n (Array.isArray(e) && e.length > 0)\n ) {\n node[i] = copyDeep(e);\n }\n });\n } else if (typeof data === \"object\") {\n node = Object.assign({}, data);\n Object.keys(node).forEach((key) => {\n if (\n (typeof node[key] === \"object\" && node[key] !== {}) ||\n (Array.isArray(node[key]) && node[key].length > 0)\n ) {\n node[key] = copyDeep(node[key]);\n }\n });\n } else {\n node = data;\n }\n return node;\n}\n\nexport {isNumber, isInt, isFloat, isObject, merge, mergeDeep, copyDeep};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/util.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/util.js","//@flow\n/* eslint-disable no-unused-vars */\nimport FakeEvent from '../../../event/fake-event'\nimport FakeEventTarget from '../../../event/fake-event-target'\nimport PlayerError from '../../../utils/player-error'\nimport {CUSTOM_EVENTS} from '../../../event/events'\nimport LoggerFactory from '../../../utils/logger'\nimport Track from '../../../track/track'\nimport VideoTrack from '../../../track/video-track'\nimport AudioTrack from '../../../track/audio-track'\nimport TextTrack from '../../../track/text-track'\n\nexport default class BaseMediaSourceAdapter extends FakeEventTarget implements IMediaSourceAdapter {\n /**\n * Passing the custom events to the actual media source adapter.\n * @static\n */\n static CustomEvents: { [event: string]: string } = CUSTOM_EVENTS;\n\n /**\n * Passing the getLogger function to the actual media source adapter.\n * @type {Function}\n * @static\n */\n static getLogger: Function = LoggerFactory.getLogger;\n\n /**\n * The adapter config.\n * @member {Object} _config\n * @private\n */\n _config: ?Object;\n\n /**\n * The source object.\n * @member {Source} _sourceObj\n * @private\n */\n _sourceObj: ?Source;\n\n /**\n * The dom video element.\n * @member {HTMLVideoElement} _videoElement\n * @private\n */\n _videoElement: HTMLVideoElement;\n\n /**\n * Checks if the media source adapter is supported.\n * @function isSupported\n * @returns {boolean} - Whether the media source adapter is supported.\n * @static\n */\n static isSupported(): boolean {\n return true;\n }\n\n /**\n * Factory method to create media source adapter.\n * @function createAdapter\n * @param {HTMLVideoElement} videoElement - The video element that the media source adapter work with.\n * @param {Object} source - The source Object.\n * @param {Object} config - The media source adapter configuration.\n * @returns {IMediaSourceAdapter} - New instance of the run time media source adapter.\n * @static\n */\n static createAdapter(videoElement: HTMLVideoElement, source: Source, config: Object): IMediaSourceAdapter {\n return new this(videoElement, source, config);\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to media source adapter.\n * @param {Source} source - The source object.\n * @param {Object} config - The media source adapter configuration.\n */\n constructor(videoElement: HTMLVideoElement, source: Source, config: Object) {\n super();\n this._videoElement = videoElement;\n this._sourceObj = source;\n this._config = config;\n }\n\n /**\n * Destroys the media source adapter.\n * @function destroy\n * @returns {void}\n */\n destroy(): void {\n this._sourceObj = null;\n this._config = null;\n }\n\n /**\n * Triggers the appropriate track changed event.\n * @param {Track} track - The selected track.\n * @private\n * @returns {void}\n */\n _onTrackChanged(track: Track): void {\n if (track instanceof VideoTrack) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.VIDEO_TRACK_CHANGED, {selectedVideoTrack: track});\n } else if (track instanceof AudioTrack) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.AUDIO_TRACK_CHANGED, {selectedAudioTrack: track});\n } else if (track instanceof TextTrack) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.TEXT_TRACK_CHANGED, {selectedTextTrack: track});\n }\n }\n\n /**\n * Dispatch an adapter event forward.\n * @param {string} name - The name of the event.\n * @param {Object} payload - The event payload.\n * @returns {void}\n */\n _trigger(name: string, payload: Object): void {\n this.dispatchEvent(new FakeEvent(name, payload));\n }\n\n /** Must implemented methods by the derived media source adapter **/\n\n static canPlayType(mimeType: string): boolean {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'static canPlayType').getError();\n }\n\n load(): Promise<Object> {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'load').getError();\n }\n\n selectVideoTrack(videoTrack: VideoTrack): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'selectVideoTrack').getError();\n }\n\n selectAudioTrack(audioTrack: AudioTrack): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'selectAudioTrack').getError();\n }\n\n selectTextTrack(textTrack: TextTrack): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'selectTextTrack').getError();\n }\n\n hideTextTrack(): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'hideTextTrack').getError();\n }\n\n enableAdaptiveBitrate(): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'enableAdaptiveBitrate').getError();\n }\n\n get src(): string {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'get src').getError();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/media-source/base-media-source-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/media-source/base-media-source-adapter.js","//@flow\nimport NativeAdapter from './adapters/native-adapter'\nimport LoggerFactory from '../../../utils/logger'\n\n/**\n * Media source provider\n * @classdesc\n */\nexport default class MediaSourceProvider {\n /**\n * The logger of the media source provider.\n * @member {any} _logger\n * @static\n * @private\n */\n static _logger: any = LoggerFactory.getLogger('MediaSourceProvider');\n /**\n * The media source adapter registry.\n * @member {Array<IMediaSourceAdapter>} _mediaSourceAdapters\n * @static\n * @private\n */\n static _mediaSourceAdapters: Array<typeof IMediaSourceAdapter> = [NativeAdapter];\n /**\n * The selected adapter for playback.\n * @type {null|IMediaSourceAdapter}\n * @static\n * @private\n */\n static _selectedAdapter: ?(typeof IMediaSourceAdapter) = null;\n\n /**\n * Add a media source adapter to the registry.\n * @function register\n * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to register.\n * @static\n * @returns {void}\n */\n static register(mediaSourceAdapter: typeof IMediaSourceAdapter): void {\n if (mediaSourceAdapter) {\n if (!MediaSourceProvider._mediaSourceAdapters.includes(mediaSourceAdapter)) {\n MediaSourceProvider._logger.debug(`Adapter <${mediaSourceAdapter.id}> has been registered successfully`);\n MediaSourceProvider._mediaSourceAdapters.push(mediaSourceAdapter);\n } else {\n MediaSourceProvider._logger.debug(`Adapter <${mediaSourceAdapter.id}> is already registered, do not register again`);\n }\n }\n }\n\n /**\n * Remove a media source adapter from the registry.\n * @function unRegister\n * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to unRegister.\n * @static\n * @returns {void}\n */\n static unRegister(mediaSourceAdapter: typeof IMediaSourceAdapter): void {\n let index = MediaSourceProvider._mediaSourceAdapters.indexOf(mediaSourceAdapter);\n if (index > -1) {\n MediaSourceProvider._logger.debug(`Unregistered <${mediaSourceAdapter.id}> adapter`);\n MediaSourceProvider._mediaSourceAdapters.splice(index, 1);\n }\n }\n\n /**\n * Checks if one of the registered media source adapters can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check.\n * @static\n * @returns {boolean} - If one of the adapters can play the specific mime type.\n */\n static canPlayType(mimeType: string): boolean {\n let mediaSourceAdapters = MediaSourceProvider._mediaSourceAdapters;\n for (let i = 0; i < mediaSourceAdapters.length; i++) {\n if (mediaSourceAdapters[i].canPlayType(mimeType)) {\n MediaSourceProvider._selectedAdapter = mediaSourceAdapters[i];\n MediaSourceProvider._logger.debug(`Selected adapter is <${MediaSourceProvider._selectedAdapter.id}>`);\n return true;\n }\n }\n return false;\n }\n\n /**\n * Get the appropriate media source adapter to the video source.\n * @function getMediaSourceAdapter\n * @param {HTMLVideoElement} videoElement - The video element which requires adapter for a given mimeType.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The player configuration.\n * @returns {IMediaSourceAdapter|null} - The selected media source adapter, or null if such doesn't exists.\n * @static\n */\n static getMediaSourceAdapter(videoElement: HTMLVideoElement, source: Source, config: Object): ?IMediaSourceAdapter {\n if (videoElement && source && config) {\n if (!MediaSourceProvider._selectedAdapter) {\n MediaSourceProvider.canPlayType(source.mimetype);\n }\n return MediaSourceProvider._selectedAdapter ? MediaSourceProvider._selectedAdapter.createAdapter(videoElement, source, config) : null;\n }\n return null;\n }\n\n /**\n * Destroys the media source adapter provider necessary props.\n * @static\n * @returns {void}\n */\n static destroy(): void {\n MediaSourceProvider._selectedAdapter = null;\n }\n}\n\nconst registerMediaSourceAdapter = MediaSourceProvider.register;\nexport {registerMediaSourceAdapter};\n\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/media-source/media-source-provider.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/media-source/media-source-provider.js","//@flow\nimport Player from '../player'\nimport LoggerFactory from '../utils/logger'\nimport {merge} from '../utils/util'\nimport EventManager from '../event/event-manager'\nimport PlayerError from '../utils/player-error'\n\n/** The BasePlugin responsible to implement the plugin interface.\n * Contains several default implementations.\n * Other plugins should extend this class.\n * @classdesc\n */\nexport default class BasePlugin implements IPlugin {\n /**\n * The runtime configuration of the plugin.\n * @member\n */\n config: Object;\n /**\n * The name of the plugin.\n * @member\n */\n name: string;\n /**\n * The logger of the plugin.\n * @member\n */\n logger: any;\n /**\n * Reference to the actual player.\n * @member\n */\n player: Player;\n /**\n * The event manager of the plugin.\n * @member\n */\n eventManager: EventManager;\n /**\n * The default configuration of the plugin.\n * Inherited plugins should override this property.\n * @type {Object}\n * @static\n * @member\n */\n static defaultConfig: Object = {};\n\n /**\n * Factory method to create the actual plugin.\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} config - The plugin configuration\n * @returns {BasePlugin} - New runtime plugin instance\n * @static\n * @public\n */\n static createPlugin(name: string, player: Player, config: Object = {}): BasePlugin {\n return new this(name, player, config);\n }\n\n /**\n * Returns under what conditions the plugin is valid.\n * Plugin must implement this method.\n * @returns {boolean} - Whether the plugin is valid and can be initiated. Default implementation is true\n * @static\n * @public\n * @abstract\n */\n static isValid(): boolean {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'isValid()').getError();\n }\n\n /**\n * constructor\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} config - The plugin configuration\n * @constructor\n * @private\n */\n constructor(name: string, player: Player, config: Object) {\n this.name = name;\n this.player = player;\n this.eventManager = new EventManager();\n this.logger = LoggerFactory.getLogger(this.name);\n this.config = merge([this.constructor.defaultConfig, config]);\n }\n\n /**\n * Getter for the configuration of the plugin.\n * @param {string} attr - The key in the plugin configuration (optional).\n * @returns {*} - If attribute is provided, returns its value. Else, Returns the config of the plugin.\n * @public\n */\n getConfig(attr?: string): any {\n if (attr) {\n return this.config[attr];\n }\n return this.config;\n }\n\n /**\n * Updates the config of the plugin.\n * @param {Object} update - The updated configuration.\n * @public\n * @returns {void}\n */\n updateConfig(update: Object): void {\n this.config = merge([this.config, update]);\n }\n\n /**\n * Runs the destroy logic of the plugin.\n * plugin must implement this method.\n * @public\n * @abstract\n * @returns {void}\n */\n destroy(): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'destroy()').getError();\n }\n\n /**\n * Getter for the plugin's name.\n * @returns {string} - The name of the plugin.\n * @public\n */\n getName(): string {\n return this.name;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./plugin/base-plugin.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/plugin/base-plugin.js","//@flow\nimport BasePlugin from './base-plugin'\nimport PlayerError from '../utils/player-error'\nimport Player from '../player'\nimport LoggerFactory from '../utils/logger'\n\n/**\n * The logger of the PluginManager class.\n * @private\n * @const\n */\nconst logger = LoggerFactory.getLogger(\"PluginManager\");\n\n/** The PluginManager responsible for register plugins definitions and store plugins instances.\n * @classdesc\n */\nexport default class PluginManager {\n /**\n * The registry of the plugins.\n * Maps plugin's name to his class.\n * @type {Map}\n * @static\n * @private\n */\n static _registry: Map<string, Function> = new Map();\n /**\n * The active plugins in the player.\n * Maps plugin's name to his instance.\n * @type {Map}\n * @private\n */\n _plugins: Map<string, BasePlugin> = new Map();\n\n /**\n * Writes the plugin in the registry.\n * Maps: plugin name -> plugin class.\n * @param {string} name - The plugin name\n * @param {Function} handler - The plugin class\n * @returns {boolean} - If the registration request succeeded\n * @static\n * @public\n */\n static register(name: string, handler: Function): boolean {\n if (typeof handler !== 'function' || handler.prototype instanceof BasePlugin === false) {\n throw new PlayerError(PlayerError.TYPE.NOT_VALID_HANDLER).getError();\n }\n if (!PluginManager._registry.has(name)) {\n PluginManager._registry.set(name, handler);\n logger.debug(`Plugin <${name}> has been registered successfully`);\n return true;\n }\n logger.debug(`Plugin <${name}> is already registered, do not register again`);\n return false;\n }\n\n /**\n * Removes the plugin from the registry.\n * @param {string} name - The plugin name\n * @static\n * @public\n * @returns {void}\n */\n static unRegister(name: string): void {\n if (PluginManager._registry.has(name)) {\n PluginManager._registry.delete(name);\n logger.debug(`Unregistered <${name}> plugin.`);\n }\n }\n\n /**\n * Creates and store new instance of the plugin in case isValid() of the plugin returns true.\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} [config={}] - The plugin configuration\n * @returns {boolean} - Whether the plugin load was successful\n * @public\n */\n load(name: string, player: Player, config: Object = {}): boolean {\n if (!PluginManager._registry.has(name)) {\n throw new PlayerError(PlayerError.TYPE.NOT_REGISTERED_PLUGIN, name).getError();\n }\n let pluginClass = PluginManager._registry.get(name);\n if (pluginClass != null && pluginClass.isValid()) {\n this._plugins.set(name, pluginClass.createPlugin(name, player, config));\n logger.debug(`Plugin <${name}> has been loaded`);\n return true;\n }\n logger.debug(`Plugin <${name}> isn\\'t loaded, isValid()=false`);\n return false;\n }\n\n /**\n * Iterates over all the plugins and calls private _destroy.\n * @public\n * @returns {void}\n */\n destroy(): void {\n this._plugins.forEach(this._destroy.bind(this));\n }\n\n /**\n * Calls destroy() method of the plugin's impl.\n * @param {BasePlugin} plugin - The plugin instance\n * @param {string} name - The plugin name\n * @private\n * @returns {void}\n */\n _destroy(plugin: BasePlugin, name: string): void {\n plugin.destroy();\n this._plugins.delete(name);\n }\n\n /**\n * Returns the plugin's instance.\n * @param {string} name - The plugin name\n * @returns {BasePlugin} - The plugin instance\n * @public\n */\n get(name: string): ?BasePlugin {\n return this._plugins.get(name);\n }\n}\n\n/**\n * Export the register method.\n * @type {function}\n * @constant\n */\nconst registerPlugin = PluginManager.register;\nexport {registerPlugin};\n\n\n\n// WEBPACK FOOTER //\n// ./plugin/plugin-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/plugin/plugin-manager.js","//@flow\n\n/**\n * The possible player state types.\n * @const\n * @type {{IDLE: string, LOADING: string, PLAYING: string, PAUSED: string, BUFFERING: string}}\n */\nconst PLAYER_STATE_TYPES: { [state: string]: string } = {\n IDLE: \"idle\",\n LOADING: \"loading\",\n PLAYING: \"playing\",\n PAUSED: \"paused\",\n BUFFERING: \"buffering\"\n};\n\nexport default PLAYER_STATE_TYPES;\n\n\n\n// WEBPACK FOOTER //\n// ./state/state-types.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/state/state-types.js","//@flow\n\n/**\n * A simple multimap template.\n * @constructor\n * @struct\n * @template T\n */\nclass MultiMap<T> {\n _map: Map<string, T[]>;\n\n constructor() {\n /** @private {!Object.<string, !Array.<T>>} */\n this._map = new Map();\n }\n\n /**\n * Add a key, value pair to the map.\n * @param {string} key -\n * @param {T} value -\n * @returns {void}\n */\n push(key: string, value: T): void {\n if (this._map.has(key)) {\n let list = this._map.get(key);\n if (Array.isArray(list)) {\n list.push(value);\n this._map.set(key, list);\n }\n } else {\n this._map.set(key, [value]);\n }\n }\n\n /**\n * Set an array of values for the key, overwriting any previous data.\n * @param {string} key -\n * @param {!Array.<T>} values -\n * @returns {void}\n */\n set(key: string, values: T[]): void {\n this._map.set(key, values);\n }\n\n /**\n * Check for a key.\n * @param {string} key -\n * @return {boolean} true if the key exists.\n */\n has(key: string): boolean {\n return this._map.has(key);\n }\n\n /**\n * Get a list of values by key.\n * @param {string} key -\n * @return {Array.<T>} or null if no suZch key exists.\n */\n get(key: string): Array<T> {\n let list = this._map.get(key);\n // slice() clones the list so that it and the map can each be modified\n // without affecting the other.\n return list ? list.slice() : [];\n }\n\n /**\n * Get a list of all values.\n * @returns {!Array.<T>} -\n */\n getAll(): T[] {\n let list: T[] = [];\n for (var value of this._map.values()) {\n list = list.concat(value);\n }\n return list;\n }\n\n /**\n * Remove a specific value, if it exists.\n * @param {string} key -\n * @param {T} value -\n * @returns {void}\n */\n remove(key: string, value: T): void {\n if (!this._map.has(key)) return;\n let list = this._map.get(key);\n if (Array.isArray(list)) {\n for (let i = 0; i < list.length; ++i) {\n if (list[i] == value) {\n list.splice(i, 1);\n --i;\n }\n }\n }\n }\n\n /**\n * Get all keys from the multimap.\n * @return {!Array.<string>}\n */\n // eslint-disable-next-line no-undef\n keys(): Iterator<string> {\n return this._map.keys();\n }\n\n\n /**\n * Clear all keys and values from the multimap.\n * @returns {void}\n */\n clear(): void {\n this._map.clear();\n }\n}\n\nexport default MultiMap;\n\n\n\n// WEBPACK FOOTER //\n// ./utils/multi-map.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/multi-map.js","module.exports = {\n\t\"name\": \"playkit-js\",\n\t\"version\": \"0.2.0\",\n\t\"main\": \"dist/playkit.js\",\n\t\"scripts\": {\n\t\t\"clean\": \"rm -rf ./dist\",\n\t\t\"prebuild\": \"npm run clean\",\n\t\t\"build:prod\": \"NODE_ENV=production webpack\",\n\t\t\"build\": \"webpack\",\n\t\t\"dev\": \"webpack --progress --colors --watch\",\n\t\t\"test\": \"NODE_ENV=test karma start --color\",\n\t\t\"test:chrome\": \"NODE_ENV=test karma start --color --browsers Chrome\",\n\t\t\"test:chrome:dots\": \"NODE_ENV=test karma start --color --browsers Chrome --reporters dots\",\n\t\t\"test:firefox\": \"NODE_ENV=test karma start --color --browsers Firefox\",\n\t\t\"test:safari\": \"NODE_ENV=test karma start --color --browsers Safari\",\n\t\t\"test:watch\": \"NODE_ENV=test karma start --color --auto-watch\",\n\t\t\"start\": \"webpack-dev-server\",\n\t\t\"release\": \"npm run build:prod && npm run commit:dist && standard-version\",\n\t\t\"publish\": \"git push --follow-tags --no-verify origin develop\",\n\t\t\"eslint\": \"eslint . --color\",\n\t\t\"flow\": \"flow check\",\n\t\t\"eslint:flow:test\": \"npm run eslint && npm run flow && npm run test\",\n\t\t\"commit:dist\": \"git add --all dist && (git commit -m 'chore: update dist' || exit 0)\",\n\t\t\"prepush-msg:build\": \"echo '\\nRunning build before push...\\n' && exit 0\",\n\t\t\"prepush-msg:dist\": \"echo '\\nAdding dist files to a seperate commit...\\n' && exit 0\",\n\t\t\"prepush-msg:done\": \"echo '\\nPre push tasks are done.\\n' && exit 0\"\n\t},\n\t\"pre-push\": [\n\t\t\"prepush-msg:build\",\n\t\t\"prebuild\",\n\t\t\"build\",\n\t\t\"build:prod\",\n\t\t\"prepush-msg:dist\",\n\t\t\"commit:dist\",\n\t\t\"prepush-msg:done\"\n\t],\n\t\"devDependencies\": {\n\t\t\"babel-cli\": \"^6.18.0\",\n\t\t\"babel-core\": \"^6.18.2\",\n\t\t\"babel-eslint\": \"^7.1.1\",\n\t\t\"babel-loader\": \"^6.2.7\",\n\t\t\"babel-plugin-istanbul\": \"^4.0.0\",\n\t\t\"babel-plugin-transform-class-properties\": \"^6.22.0\",\n\t\t\"babel-plugin-transform-flow-strip-types\": \"^6.22.0\",\n\t\t\"babel-preset-es2015\": \"^6.18.0\",\n\t\t\"babel-register\": \"^6.23.0\",\n\t\t\"chai\": \"^3.5.0\",\n\t\t\"cross-env\": \"^3.1.4\",\n\t\t\"eslint\": \"^3.10.0\",\n\t\t\"eslint-loader\": \"^1.6.1\",\n\t\t\"eslint-plugin-flowtype\": \"^2.30.0\",\n\t\t\"eslint-plugin-import\": \"^2.2.0\",\n\t\t\"eslint-plugin-mocha-no-only\": \"^0.0.5\",\n\t\t\"flow-bin\": \"latest\",\n\t\t\"istanbul\": \"^0.4.5\",\n\t\t\"karma\": \"^1.5.0\",\n\t\t\"karma-chai\": \"^0.1.0\",\n\t\t\"karma-chrome-launcher\": \"^2.0.0\",\n\t\t\"karma-cli\": \"^1.0.1\",\n\t\t\"karma-coverage\": \"^1.1.1\",\n\t\t\"karma-firefox-launcher\": \"^1.0.1\",\n\t\t\"karma-ie-launcher\": \"^1.0.0\",\n\t\t\"karma-mocha\": \"^1.3.0\",\n\t\t\"karma-safari-launcher\": \"^1.0.0\",\n\t\t\"karma-sourcemap-loader\": \"^0.3.7\",\n\t\t\"karma-webpack\": \"^2.0.2\",\n\t\t\"mocha\": \"^3.2.0\",\n\t\t\"mocha-cli\": \"^1.0.1\",\n\t\t\"pre-push\": \"^0.1.1\",\n\t\t\"sinon\": \"^2.0.0\",\n\t\t\"sinon-chai\": \"^2.8.0\",\n\t\t\"standard-version\": \"^4.0.0\",\n\t\t\"uglifyjs-webpack-plugin\": \"^0.4.3\",\n\t\t\"webpack\": \"latest\",\n\t\t\"webpack-dev-server\": \"latest\"\n\t},\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/kaltura/playkit-js\"\n\t},\n\t\"keywords\": [\n\t\t\"kaltura\",\n\t\t\"player\",\n\t\t\"html5 player\"\n\t],\n\t\"license\": \"AGPLV3\",\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/kaltura/playkit-js/issues\"\n\t},\n\t\"homepage\": \"https://github.com/kaltura/playkit-js\",\n\t\"dependencies\": {\n\t\t\"js-logger\": \"^1.3.0\"\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../package.json\n// module id = 18\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///package.json","//@flow\nimport FakeEventTarget from '../../event/fake-event-target'\nimport FakeEvent from '../../event/fake-event'\nimport EventManager from '../../event/event-manager'\nimport {HTML5_EVENTS as Html5Events, CUSTOM_EVENTS as CustomEvents} from '../../event/events'\nimport MediaSourceProvider from './media-source/media-source-provider'\nimport VideoTrack from '../../track/video-track'\nimport AudioTrack from '../../track/audio-track'\nimport TextTrack from '../../track/text-track'\n\nexport default class Html5 extends FakeEventTarget implements IEngine {\n /**\n * The video element.\n * @type {HTMLVideoElement}\n * @private\n */\n _el: HTMLVideoElement;\n /**\n * The event manager of the engine.\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * The selected media source adapter of the engine.\n * @type {IMediaSourceAdapter}\n * @private\n */\n _mediaSourceAdapter: ?IMediaSourceAdapter;\n\n /**\n * @type {string} - The engine id.\n */\n static id: string = \"html5\";\n\n /**\n * Factory method to create an engine.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The player configuration.\n * @returns {IEngine} - New instance of the run time engine.\n * @public\n * @static\n */\n static createEngine(source: Source, config: Object): IEngine {\n return new this(source, config);\n }\n\n /**\n * Checks if the engine can play a given mime type.\n * @param {string} mimeType - The mime type to check.\n * @returns {boolean} - Whether the engine can play the mime type.\n * @public\n * @static\n */\n static canPlayType(mimeType): boolean {\n return MediaSourceProvider.canPlayType(mimeType);\n }\n\n /**\n * @constructor\n * @param {Source} source - The selected source object.\n * @param {Object} config - The player configuration.\n */\n constructor(source: Source, config: Object) {\n super();\n this._eventManager = new EventManager();\n this._createVideoElement();\n this._loadMediaSourceAdapter(source, config);\n this.attach();\n }\n\n /**\n * Destroys the engine.\n * @public\n * @returns {void}\n */\n destroy(): void {\n this.detach();\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.destroy();\n MediaSourceProvider.destroy();\n }\n if (this._el) {\n this.pause();\n this._el.removeAttribute('src');\n if (this._el.parentNode) {\n this._el.parentNode.removeChild(this._el);\n }\n }\n this._eventManager.destroy();\n }\n\n /**\n * Listen to the video element events and triggers them from the engine.\n * @public\n * @returns {void}\n */\n attach(): void {\n for (let playerEvent in Html5Events) {\n this._eventManager.listen(this._el, Html5Events[playerEvent], () => {\n this.dispatchEvent(new FakeEvent(Html5Events[playerEvent]));\n });\n }\n if (this._mediaSourceAdapter) {\n this._eventManager.listen(this._mediaSourceAdapter, CustomEvents.VIDEO_TRACK_CHANGED, (event: FakeEvent) => {\n this.dispatchEvent(event);\n });\n this._eventManager.listen(this._mediaSourceAdapter, CustomEvents.AUDIO_TRACK_CHANGED, (event: FakeEvent) => {\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this._mediaSourceAdapter, CustomEvents.TEXT_TRACK_CHANGED, (event: FakeEvent) => {\n return this.dispatchEvent(event);\n });\n }\n }\n\n /**\n * Remove the listeners of the video element events.\n * @public\n * @returns {void}\n */\n detach(): void {\n for (let playerEvent in Html5Events) {\n this._eventManager.unlisten(this._el, Html5Events[playerEvent]);\n }\n if (this._mediaSourceAdapter) { // unlisten to adaptive bitrate changed\n this._eventManager.unlisten(this._mediaSourceAdapter, CustomEvents.VIDEO_TRACK_CHANGED);\n this._eventManager.unlisten(this._mediaSourceAdapter, CustomEvents.AUDIO_TRACK_CHANGED);\n this._eventManager.unlisten(this._mediaSourceAdapter, CustomEvents.TEXT_TRACK_CHANGED);\n }\n }\n\n /**\n * @returns {HTMLVideoElement} - The video element.\n * @public\n */\n getVideoElement(): HTMLVideoElement {\n return this._el;\n }\n\n /**\n * Creates a video element dom object.\n * @private\n * @returns {void}\n */\n _createVideoElement(): void {\n this._el = document.createElement(\"video\");\n //Set attributes\n this._el.style.width = \"640px\";\n this._el.style.height = \"360px\";\n this._el.style.backgroundColor = \"black\";\n this._el.controls = true;\n if (document && document.body) {\n document.body.appendChild(this._el);\n }\n }\n\n /**\n * Loads the appropriate media source extension adapter.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The media source extension configuration.\n * @private\n * @returns {void}\n */\n _loadMediaSourceAdapter(source: Source, config: Object): void {\n this._mediaSourceAdapter = MediaSourceProvider.getMediaSourceAdapter(this.getVideoElement(), source, config);\n }\n\n /**\n * Select a new video track.\n * @param {VideoTrack} videoTrack - The video track object to set.\n * @returns {void}\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectVideoTrack(videoTrack);\n }\n }\n\n /**\n * Select a new audio track.\n * @param {AudioTrack} audioTrack - The video track object to set.\n * @returns {void}\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectAudioTrack(audioTrack);\n }\n }\n\n /**\n * Select a new text track.\n * @param {TextTrack} textTrack - The text track object to set.\n * @returns {void}\n */\n selectTextTrack(textTrack: TextTrack): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectTextTrack(textTrack);\n }\n }\n\n /**\n * Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n hideTextTrack(): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.hideTextTrack();\n }\n }\n\n /**\n * Enables adaptive bitrate switching according to the media source extension logic.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.enableAdaptiveBitrate();\n }\n }\n\n /**\n * Set a source.\n * @param {string} source - Source to set.\n * @public\n * @returns {void}\n */\n set src(source: string): void {\n this._el.src = source;\n }\n\n /**\n * Get the source url.\n * @returns {string} - The source url.\n * @public\n */\n get src(): string {\n if (this._mediaSourceAdapter) {\n return this._mediaSourceAdapter.src;\n }\n return \"\";\n }\n\n //playback interface\n /**\n * Start/resume playback.\n * @public\n * @returns {void}\n */\n play(): void {\n return this._el.play();\n }\n\n /**\n * Pause playback.\n * @public\n * @returns {void}\n */\n pause(): void {\n return this._el.pause();\n }\n\n /**\n * Load media.\n * @public\n * @returns {Promise<Object>} - The loaded data\n */\n load(): Promise<Object> {\n return this._mediaSourceAdapter ? this._mediaSourceAdapter.load() : Promise.resolve({});\n }\n\n /**\n * Get the current time in seconds.\n * @returns {Number} - The current playback time.\n * @public\n */\n get currentTime(): number {\n return this._el.currentTime;\n }\n\n /**\n * Set the current time in seconds.\n * @param {Number} to - The number to set in seconds.\n * @public\n * @returns {void}\n */\n set currentTime(to: number): void {\n this._el.currentTime = to;\n }\n\n /**\n * Get the duration in seconds.\n * @returns {Number} - The playback duration.\n * @public\n */\n get duration(): number {\n return this._el.duration;\n }\n\n /**\n * Set playback volume.\n * @param {Number} vol - The volume to set.\n * @public\n * @returns {void}\n */\n set volume(vol: number): void {\n this._el.volume = vol;\n }\n\n /**\n * Get playback volume.\n * @returns {Number} - The volume value of the video element.\n * @public\n */\n get volume(): number {\n return this._el.volume;\n }\n\n ready() {\n }\n\n /**\n * Get paused state.\n * @returns {boolean} - The paused value of the video element.\n * @public\n */\n get paused(): boolean {\n return this._el.paused;\n }\n\n /**\n * Get seeking state.\n * @returns {boolean} - The seeking value of the video element.\n * @public\n */\n get seeking(): boolean {\n return this._el.seeking;\n }\n\n /**\n * Get the first seekable range (part) of the video in seconds.\n * @returns {TimeRanges} - First seekable range (part) of the video in seconds.\n * @public\n */\n get seekable(): TimeRanges {\n return this._el.seekable;\n }\n\n /**\n * Get the first played range (part) of the video in seconds.\n * @returns {TimeRanges} - First played range (part) of the video in seconds.\n * @public\n */\n get played(): TimeRanges {\n return this._el.played;\n }\n\n /**\n * Get the first buffered range (part) of the video in seconds.\n * @returns {TimeRanges} - First buffered range (part) of the video in seconds.\n * @public\n */\n get buffered(): TimeRanges {\n return this._el.buffered;\n }\n\n /**\n * Set player muted state.\n * @param {boolean} mute - The new mute value.\n * @public\n * @returns {void}\n */\n set muted(mute: boolean): void {\n this._el.muted = mute;\n }\n\n /**\n * Get player muted state.\n * @returns {boolean} - The muted value of the video element.\n * @public\n */\n get muted(): boolean {\n return this._el.muted;\n }\n\n /**\n * Get the default mute value.\n * @returns {boolean} - The defaultMuted of the video element.\n * @public\n */\n get defaultMuted(): boolean {\n return this._el.defaultMuted;\n }\n\n /**\n * Sets an image to be shown while the video is downloading, or until the user hits the play button.\n * @param {string} poster - The image url to be shown.\n * @returns {void}\n * @public\n */\n set poster(poster: string): void {\n this._el.poster = poster;\n }\n\n /**\n * Gets an image to be shown while the video is downloading, or until the user hits the play button.\n * @returns {poster} - The image url.\n * @public\n */\n get poster(): string {\n return this._el.poster;\n }\n\n /**\n * Specifies if and how the author thinks that the video should be loaded when the page loads.\n * @param {string} preload - The preload value.\n * @public\n * @returns {void}\n */\n set preload(preload: string): void {\n this._el.preload = preload;\n }\n\n /**\n * Gets the preload value of the video element.\n * @returns {string} - The preload value.\n * @public\n */\n get preload(): string {\n return this._el.preload;\n }\n\n /**\n * Set if the video will automatically start playing as soon as it can do so without stopping.\n * @param {boolean} autoplay - The autoplay value.\n * @public\n * @returns {void}\n */\n set autoplay(autoplay: boolean): void {\n this._el.autoplay = autoplay;\n }\n\n /**\n * Gets the autoplay value of the video element.\n * @returns {boolean} - The autoplay value.\n * @public\n */\n get autoplay(): boolean {\n return this._el.autoplay;\n }\n\n /**\n * Set to specifies that the video will start over again, every time it is finished.\n * @param {boolean} loop - the loop value.\n * @public\n * @returns {void}\n */\n set loop(loop: boolean) {\n this._el.loop = loop;\n }\n\n /**\n * Gets the loop value of the video element.\n * @returns {boolean} - The loop value.\n * @public\n */\n get loop(): boolean {\n return this._el.loop;\n }\n\n /**\n * Set to specifies that video controls should be displayed.\n * @param {boolean} controls - the controls value.\n * @public\n * @returns {void}\n */\n set controls(controls: boolean): void {\n this._el.controls = controls;\n }\n\n /**\n * Gets the controls value of the video element.\n * @returns {boolean} - The controls value.\n * @public\n */\n get controls(): boolean {\n return this._el.controls;\n }\n\n /**\n * Sets the current playback speed of the audio/video.\n * @param {Number} playbackRate - The playback speed value.\n * @public\n * @returns {void}\n */\n set playbackRate(playbackRate: number): void {\n this._el.playbackRate = playbackRate;\n }\n\n /**\n * Gets the current playback speed of the audio/video.\n * @returns {Number} - The current playback speed value.\n * @public\n */\n get playbackRate(): number {\n return this._el.playbackRate;\n }\n\n /**\n * Sets the default playback speed of the audio/video.\n * @param {Number} defaultPlaybackRate - The default playback speed value.\n * @public\n * @returns {void}\n */\n set defaultPlaybackRate(defaultPlaybackRate: number) {\n this._el.defaultPlaybackRate = defaultPlaybackRate;\n }\n\n /**\n * Gets the default playback speed of the audio/video.\n * @returns {Number} - The default playback speed value.\n * @public\n */\n get defaultPlaybackRate(): number {\n return this._el.defaultPlaybackRate;\n }\n\n /**\n * The ended property returns whether the playback of the audio/video has ended.\n * @returns {boolean} - The ended value.\n * @public\n */\n get ended(): boolean {\n return this._el.ended;\n }\n\n /**\n * The error property returns a MediaError object.\n * @returns {MediaError} - The MediaError object has a code property containing the error state of the audio/video.\n * @public\n */\n get error(): ?MediaError {\n return this._el.error;\n }\n\n /**\n * @returns {Number} - The current network state (activity) of the audio/video.\n * @public\n */\n get networkState(): number {\n return this._el.networkState;\n }\n\n /**\n * Indicates if the audio/video is ready to play or not.\n * @returns {Number} - The current ready state of the audio/video.\n * 0 = HAVE_NOTHING - no information whether or not the audio/video is ready.\n * 1 = HAVE_METADATA - metadata for the audio/video is ready.\n * 2 = HAVE_CURRENT_DATA - data for the current playback position is available, but not enough data to play next frame/millisecond.\n * 3 = HAVE_FUTURE_DATA - data for the current and at least the next frame is available.\n * 4 = HAVE_ENOUGH_DATA - enough data available to start playing.\n */\n get readyState(): number {\n return this._el.readyState;\n }\n\n /**\n * @returns {Number} - The height of the video player, in pixels.\n * @public\n */\n get videoHeight(): number {\n return this._el.videoHeight;\n }\n\n /**\n * @returns {Number} - The width of the video player, in pixels.\n * @public\n */\n get videoWidth(): number {\n return this._el.videoWidth;\n }\n\n /**\n * Test video element to check if html5 engine is supported.\n */\n static TEST_VID: HTMLVideoElement;\n\n /**\n * Checks if the html5 engine is supported.\n * @returns {boolean} - The isSupported result.\n * @static\n * @public\n */\n static isSupported() {\n try {\n Html5.TEST_VID = document.createElement('video');\n Html5.TEST_VID.volume = 0.5;\n } catch (e) {\n return false;\n }\n return !!Html5.TEST_VID.canPlayType;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/html5.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/html5.js","//@flow\nimport EventManager from '../../../../event/event-manager'\nimport {HTML5_EVENTS as Html5Events} from '../../../../event/events'\nimport Track from '../../../../track/track'\nimport VideoTrack from '../../../../track/video-track'\nimport AudioTrack from '../../../../track/audio-track'\nimport TextTrack from '../../../../track/text-track'\nimport BaseMediaSourceAdapter from '../base-media-source-adapter'\n\n/**\n * An illustration of media source extension for progressive download\n * @classdesc\n * @implements {IMediaSourceAdapter}\n */\nexport default class NativeAdapter extends BaseMediaSourceAdapter {\n /**\n * The id of the Adapter\n * @member {string} id\n * @static\n * @public\n */\n static id: string = 'NativeAdapter';\n\n /**\n * The adapter logger\n * @member {any} _logger\n * @private\n * @static\n */\n static _logger = BaseMediaSourceAdapter.getLogger(NativeAdapter.id);\n /**\n * The event manager of the class.\n * @member {EventManager} - _eventManager\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n _loadPromise: ?Promise<Object>;\n\n /**\n * Checks if NativeAdapter can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @returns {boolean} - Whether the native adapter can play a specific mime type\n * @static\n */\n static canPlayType(mimeType: string): boolean {\n let canPlayType = (typeof mimeType === 'string') ? !!(document.createElement(\"video\").canPlayType(mimeType.toLowerCase())) : false;\n NativeAdapter._logger.debug('canPlayType result for mimeType:' + mimeType + ' is ' + canPlayType.toString());\n return canPlayType;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to NativeAdapter\n * @param {Source} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n constructor(videoElement: HTMLVideoElement, source: Source, config: Object) {\n NativeAdapter._logger.debug('Creating adapter');\n super(videoElement, source, config);\n this._eventManager = new EventManager();\n }\n\n /**\n * Load the video source\n * @function load\n * @returns {Promise<Object>} - The loaded data\n */\n load(): Promise<Object> {\n if (!this._loadPromise) {\n this._loadPromise = new Promise((resolve, reject) => {\n // We're using 'loadeddata' event for native hls (on 'loadedmetadata' native hls doesn't have tracks yet).\n this._eventManager.listen(this._videoElement, Html5Events.LOADED_DATA, () => {\n this._eventManager.unlisten(this._videoElement, Html5Events.LOADED_DATA);\n let data = {tracks: this._getParsedTracks()};\n NativeAdapter._logger.debug('The source has been loaded successfully');\n resolve(data);\n });\n this._eventManager.listen(this._videoElement, Html5Events.ERROR, (error) => {\n this._eventManager.unlisten(this._videoElement, Html5Events.ERROR);\n NativeAdapter._logger.error(error);\n reject(error);\n });\n if (this._sourceObj && this._sourceObj.url) {\n this._videoElement.src = this._sourceObj.url;\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroys the native adapter.\n * @function destroy\n * @returns {void}\n */\n destroy(): void {\n NativeAdapter._logger.debug('destroy');\n super.destroy();\n this._eventManager.destroy();\n this._loadPromise = null;\n }\n\n /**\n * Get the parsed tracks\n * @function _getParsedTracks\n * @returns {Array<Track>} - The parsed tracks\n * @private\n */\n _getParsedTracks(): Array<Track> {\n let videoTracks = this._getParsedVideoTracks();\n let audioTracks = this._getParsedAudioTracks();\n let textTracks = this._getParsedTextTracks();\n return videoTracks.concat(audioTracks).concat(textTracks);\n }\n\n /**\n * Get the parsed video tracks\n * @function _getParsedVideoTracks\n * @returns {Array<Track>} - The parsed video tracks\n * @private\n */\n _getParsedVideoTracks(): Array<Track> {\n let videoTracks = this._videoElement.videoTracks;\n let parsedTracks = [];\n if (videoTracks) {\n for (let i = 0; i < videoTracks.length; i++) {\n let settings = {\n id: videoTracks[i].id,\n active: videoTracks[i].selected,\n label: videoTracks[i].label,\n language: videoTracks[i].language,\n index: i\n };\n parsedTracks.push(new VideoTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed audio tracks\n * @function _getParsedAudioTracks\n * @returns {Array<Track>} - The parsed audio tracks\n * @private\n */\n _getParsedAudioTracks(): Array<Track> {\n let audioTracks = this._videoElement.audioTracks;\n let parsedTracks = [];\n if (audioTracks) {\n for (let i = 0; i < audioTracks.length; i++) {\n let settings = {\n id: audioTracks[i].id,\n active: audioTracks[i].enabled,\n label: audioTracks[i].label,\n language: audioTracks[i].language,\n index: i\n };\n parsedTracks.push(new AudioTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed text tracks\n * @function _getParsedTextTracks\n * @returns {Array<Track>} - The parsed text tracks\n * @private\n */\n _getParsedTextTracks(): Array<Track> {\n let textTracks = this._videoElement.textTracks;\n let parsedTracks = [];\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n let settings = {\n kind: textTracks[i].kind,\n active: textTracks[i].mode === 'showing',\n label: textTracks[i].label,\n language: textTracks[i].language,\n index: i\n };\n parsedTracks.push(new TextTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Select a video track\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the track to select\n * @returns {void}\n * @public\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n let videoTracks = this._videoElement.videoTracks;\n if ((videoTrack instanceof VideoTrack) && videoTracks && videoTracks[videoTrack.index]) {\n this._disableVideoTracks();\n videoTracks[videoTrack.index].selected = true;\n this._onTrackChanged(videoTrack);\n }\n }\n\n /**\n * Select an audio track\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select\n * @returns {void}\n * @public\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n let audioTracks = this._videoElement.audioTracks;\n if ((audioTrack instanceof AudioTrack) && audioTracks && audioTracks[audioTrack.index]) {\n this._disableAudioTracks();\n audioTracks[audioTrack.index].enabled = true;\n this._onTrackChanged(audioTrack);\n }\n }\n\n /**\n * Select a text track\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select\n * @returns {void}\n * @public\n */\n selectTextTrack(textTrack: TextTrack): void {\n let textTracks = this._videoElement.textTracks;\n if ((textTrack instanceof TextTrack) && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions') && textTracks && textTracks[textTrack.index]) {\n this._disableTextTracks();\n textTracks[textTrack.index].mode = 'showing';\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n hideTextTrack(): void {\n this._disableTextTracks();\n }\n\n /**\n * Enables adaptive bitrate\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n NativeAdapter._logger.debug('Enabling adaptive bitrate not supported');\n }\n\n /**\n * Disables all the existing video tracks.\n * @private\n * @returns {void}\n */\n _disableVideoTracks(): void {\n let videoTracks = this._videoElement.videoTracks;\n if (videoTracks) {\n for (let i = 0; i < videoTracks.length; i++) {\n videoTracks[i].selected = false;\n }\n }\n }\n\n /**\n * Disables all the existing audio tracks.\n * @private\n * @returns {void}\n */\n _disableAudioTracks(): void {\n let audioTracks = this._videoElement.audioTracks;\n if (audioTracks) {\n for (let i = 0; i < audioTracks.length; i++) {\n audioTracks[i].enabled = false;\n }\n }\n }\n\n /**\n * Disables all the existing text tracks.\n * @private\n * @returns {void}\n */\n _disableTextTracks(): void {\n let textTracks = this._videoElement.textTracks;\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n textTracks[i].mode = 'disabled';\n }\n }\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * @public\n * @returns {string} - The src url.\n */\n get src(): string {\n return this._videoElement.src;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/media-source/adapters/native-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/media-source/adapters/native-adapter.js","//@flow\nimport Player from './player'\nimport LoggerFactory from './utils/logger'\nimport * as packageData from '../package.json'\nimport BaseMediaSourceAdapter from './engines/html5/media-source/base-media-source-adapter'\nimport {registerMediaSourceAdapter} from './engines/html5/media-source/media-source-provider'\nimport {registerPlugin} from './plugin/plugin-manager'\nimport BasePlugin from './plugin/base-plugin'\nimport Track from './track/track'\nimport VideoTrack from './track/video-track'\nimport AudioTrack from './track/audio-track'\nimport TextTrack from './track/text-track'\n\n// Playkit version\nlet VERSION = packageData.version;\n\nLoggerFactory.getLogger().log(\"%c Playkit \" + VERSION, \"color: yellow; font-size: large\");\nLoggerFactory.getLogger().log(\"%c For more details see https://github.com/kaltura/playkit-js\", \"color: yellow;\");\n\n/**\n * @param {Object} config - The configuration of the player\n * @returns {Player} - The player instance\n */\nexport function playkit(config: Object = {}) {\n return new Player(config);\n}\n\n// Export the media source adapters necessary utils\nexport {registerMediaSourceAdapter, BaseMediaSourceAdapter};\n\n// Export the plugin framework\nexport {registerPlugin, BasePlugin};\n\n// Export the tracks classes\nexport {Track, VideoTrack, AudioTrack, TextTrack};\n\n//export version\nexport {VERSION};\nexport default playkit;\n\n\n\n// WEBPACK FOOTER //\n// ./playkit.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/playkit.js","//@flow\nimport Player from '../player'\nimport EventManager from '../event/event-manager'\nimport State from './state'\nimport PlayerStates from './state-types'\nimport {HTML5_EVENTS as Html5Events, CUSTOM_EVENTS as CustomEvents} from '../event/events'\nimport FakeEvent from '../event/fake-event'\nimport LoggerFactory from '../utils/logger'\n\n/**\n * Define a transition object.\n */\ntype Transition = {\n [state: string]: {\n [event: string]: Function\n }\n}\n\n/**\n * This class responsible to manage all the state machine of the player.\n * @classdesc\n */\nexport default class StateManager {\n /**\n * The logger of the class.\n * @member\n * @type {any}\n * @private\n */\n _logger: any;\n /**\n * Reference to the actual player.\n * @member\n * @type {Player}\n * @private\n */\n _player: Player;\n /**\n * The event manager of the class.\n * @member\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * Holds the current state of the player.\n * @member\n * @type {State}\n * @private\n */\n _curState: State;\n /**\n * Holds the previous state of the player.\n * @member\n * @type {State | null}\n * @private\n */\n _prevState: State | null;\n /**\n * Holds the state history of the player.\n * @member\n * @type {Array<State>}\n * @private\n */\n _history: Array<State>;\n /**\n * The possible transitions from one state to another.\n * @type {Array<Transition>}\n * @private\n */\n _transitions: Transition = {\n [PlayerStates.IDLE]: {\n [Html5Events.LOAD_START]: () => {\n this._updateState(PlayerStates.LOADING);\n this._dispatchEvent();\n },\n [Html5Events.PLAY]: () => {\n this._updateState(PlayerStates.BUFFERING);\n this._dispatchEvent();\n }\n },\n [PlayerStates.LOADING]: {\n [Html5Events.LOADED_METADATA]: () => {\n if (this._player.config.autoPlay) {\n this._updateState(PlayerStates.PLAYING);\n } else {\n this._updateState(PlayerStates.PAUSED);\n }\n this._dispatchEvent();\n },\n [Html5Events.ERROR]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n }\n },\n [PlayerStates.PAUSED]: {\n [Html5Events.PLAY]: () => {\n this._updateState(PlayerStates.PLAYING);\n this._dispatchEvent();\n },\n [Html5Events.PLAYING]: () => {\n this._updateState(PlayerStates.PLAYING);\n this._dispatchEvent();\n },\n [Html5Events.ENDED]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n }\n },\n [PlayerStates.PLAYING]: {\n [Html5Events.PAUSE]: () => {\n this._updateState(PlayerStates.PAUSED);\n this._dispatchEvent();\n },\n [Html5Events.WAITING]: () => {\n this._updateState(PlayerStates.BUFFERING);\n this._dispatchEvent();\n },\n [Html5Events.ENDED]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n },\n [Html5Events.ERROR]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n }\n },\n [PlayerStates.BUFFERING]: {\n [Html5Events.PLAYING]: () => {\n this._updateState(PlayerStates.PLAYING);\n this._dispatchEvent();\n },\n [Html5Events.PAUSE]: () => {\n this._updateState(PlayerStates.PAUSED);\n this._dispatchEvent();\n }\n }\n };\n\n /**\n * @constructor\n * @param {Player} player - Reference to the player.\n */\n constructor(player: Player) {\n this._player = player;\n this._logger = LoggerFactory.getLogger(\"StateManager\");\n this._eventManager = new EventManager();\n this._history = [];\n this._prevState = null;\n this._curState = new State(PlayerStates.IDLE);\n this._attachListeners();\n }\n\n /**\n * Register to all necessary events which impacts on the player state.\n * @private\n * @returns {void}\n */\n _attachListeners(): void {\n this._eventManager.listen(this._player, Html5Events.ERROR, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.ENDED, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.PLAY, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.LOAD_START, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.PLAYING, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.LOADED_METADATA, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.PAUSE, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.WAITING, this._doTransition.bind(this));\n }\n\n /**\n * Performs a state transition depends on the event which occurs in the player system.\n * @param {FakeEvent} event - The event occurs in the player system.\n * @private\n * @returns {void}\n */\n _doTransition(event: FakeEvent): void {\n this._logger.debug('Do transition request', event);\n let transition = this._transitions[this._curState.type];\n if (typeof transition[event.type] === 'function') {\n transition[event.type]();\n }\n }\n\n /**\n * Updates the player's state.\n * @param {string} type - The type of the new state.\n * @private\n * @returns {void}\n */\n _updateState(type: string): void {\n if (this._curState.type !== type) {\n this._curState.duration = Date.now() / 1000;\n this._history.push(this._curState);\n this._prevState = this._curState;\n this._curState = new State(type);\n this._logger.debug(`Switch player state: from ${this._prevState.type} to ${this._curState.type}`)\n }\n }\n\n /**\n * Fires the playerStateChanged event after state has been changed.\n * @private\n * @returns {void}\n */\n _dispatchEvent(): void {\n let event = new FakeEvent(CustomEvents.PLAYER_STATE_CHANGED, {\n 'oldState': this._prevState,\n 'newState': this._curState\n });\n this._player.dispatchEvent(event);\n }\n\n /**\n * Destroys the state manager.\n * @public\n * @returns {void}\n */\n destroy(): void {\n this._history = [];\n this._eventManager.destroy();\n }\n\n /**\n * Getter to the current state of the player.\n * @public\n * @returns {State} - The current state object\n */\n get currentState(): State {\n return this._curState;\n }\n\n /**\n * Getter to the previous state of the player.\n * @public\n * @returns {State|null} - The previous state object, or null if such doesn't exists\n */\n get previousState(): State | null {\n return this._prevState;\n }\n\n /**\n * Getter to the state history of the player.\n * @public\n * @returns {Array.<State>} - The full states history objects\n */\n get history(): Array<State> {\n return this._history;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./state/state-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/state/state-manager.js","//@flow\n\n/**\n * This class describes a player state.\n * @classdesc\n */\nexport default class State {\n /**\n * The type of the state.\n * Can be one of those describes in states.js\n * @member\n * @type {string}\n * @public\n */\n type: string;\n /**\n * The duration that the player was in this state.\n * @member\n * @type {number}\n * @private\n */\n _duration: number;\n /**\n * The timestamp that this state started.\n * @member\n * @type {number}\n * @private\n */\n _timestamp: number;\n\n /**\n * @constructor\n * @param {string} type - The type of the state.\n */\n constructor(type: string) {\n this.type = type;\n this._duration = 0;\n this._timestamp = Date.now() / 1000;\n }\n\n /**\n * Getter for the duration of the state.\n * @returns {number} - The duration of the state\n */\n get duration(): number {\n return this._duration;\n }\n\n /**\n * Setter for the duration of the state.\n * @param {number} endTime - The timestamp of the next state.\n */\n set duration(endTime: number): void {\n this._duration = endTime - this._timestamp;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./state/state.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/state/state.js","//@flow\nconst TRACK_TYPES: {[track: string]: string} = {\n VIDEO: \"video\",\n AUDIO: \"audio\",\n TEXT: \"text\"\n};\n\nexport default TRACK_TYPES;\n\n\n\n// WEBPACK FOOTER //\n// ./track/track-types.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/track-types.js","/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (typeof define === 'function' && define.amd) {\r\n\t\tdefine(Logger);\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/js-logger/src/logger.js\n// module id = 8\n// module chunks = 0 1\n\n\n// WEBPACK FOOTER //\n// webpack:///~/js-logger/src/logger.js","module.exports = {\n\t\"playback\": {\n\t\t\"preload\": \"none\",\n\t\t\"autoplay\": false,\n\t\t\"muted\": false,\n\t\t\"streamPriority\": [\n\t\t\t{\n\t\t\t\t\"engine\": \"html5\",\n\t\t\t\t\"format\": \"hls\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"engine\": \"html5\",\n\t\t\t\t\"format\": \"dash\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"engine\": \"html5\",\n\t\t\t\t\"format\": \"progressive\"\n\t\t\t}\n\t\t]\n\t},\n\t\"plugins\": {}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./player-config.json\n// module id = 26\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///core/player-config.json","(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[\"PlaykitJsProviders\"] = factory();\n\telse\n\t\troot[\"PlaykitJsProviders\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 25);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 638014c152c6bb21e972\n\n\n// WEBPACK FOOTER //\n// webpack:/providers/webpack/bootstrap 638014c152c6bb21e972","//@flow\n\n/**\n * Request builder\n * @classdesc\n */\nexport default class RequestBuilder {\n\n /**\n * @member - Service name\n * @type {string}\n */\n service: string;\n /**\n * @member - Service action\n * @type {string}\n */\n action: string;\n /**\n * @member - Service params\n * @type {any}\n */\n params: any;\n /**\n * @member - Service headers\n * @type {Map<string, string>}\n */\n headers: Map<string, string>;\n /**\n * @member - Service base url\n * @type {Map<string, string>}\n */\n baseUrl: string;\n /**\n * @member - Service method (POST,GET,DELETE etc..)\n * @type {string}\n */\n method: string;\n /**\n * @member - Service tag\n * @type {string}\n */\n tag: string;\n\n /**\n * @constructor\n * @param {Map<string, string>} headers The request headers\n */\n constructor(headers: Map<string, string> = new Map()) {\n this.headers = headers;\n this.headers.set(\"Content-Type\", \"application/json\");\n }\n\n /**\n * Builds restful service URL\n * @function getUrl\n * @returns {string} The service URL\n */\n getUrl(): string {\n if (!this.baseUrl) {\n throw new Error(\"baseUrl is mandatory for request builder\");\n }\n let url = this.baseUrl + '/service/' + this.service + (this.action ? '/action/' + this.action : '');\n return url;\n }\n\n /**\n * Executes service\n * @function doHttpRequest\n * @returns {Promise.<any>} Service response as promise\n */\n doHttpRequest(): Promise<any> {\n let request = new XMLHttpRequest();\n return new Promise((resolve, reject) => {\n request.onreadystatechange = function () {\n if (request.readyState === 4) {\n if (request.status === 200) {\n let jsonResponse = JSON.parse(request.responseText);\n if (jsonResponse && typeof(jsonResponse) === 'object' && jsonResponse.code && jsonResponse.message)\n reject(jsonResponse);\n else\n resolve(jsonResponse);\n } else {\n reject(request.responseText);\n }\n }\n };\n request.open(this.method, this.getUrl());\n this.headers.forEach((value, key) => {\n request.setRequestHeader(key, value);\n });\n request.send(this.params);\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/request-builder.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/request-builder.js","//@flow\n\nconst defaultConfig: Object = {\n beUrl: \"http://www.kaltura.com/api_v3\",\n baseUrl: \"https://cdnapisec.kaltura.com\",\n serviceParams: {\n clientTag: \"playkit-js\",\n apiVersion: '3.3.0',\n format: 1\n }\n};\n\nexport default class Configuration {\n\n static set(clientConfig?: Object) {\n if (clientConfig) {\n Object.assign(defaultConfig, clientConfig);\n }\n }\n\n static get(): Object {\n return defaultConfig;\n }\n}\n\nexport {Configuration};\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/config.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/config.js","//@flow\n\nimport {Enum} from 'enumify';\n\nexport class Scheme extends Enum {\n}\nScheme.initEnum({\n PLAYREADY_CENC: \"drm.PLAYREADY_CENC\",\n WIDEVINE_CENC: \"drm.WIDEVINE_CENC\",\n FAIRPLAY: \"fairplay.FAIRPLAY\",\n PLAYREADY: \"playReady.PLAYREADY\",\n WIDEVINE: \"widevine.WIDEVINE\"\n});\n\n\nexport class KalturaRuleActionType extends Enum {\n}\nKalturaRuleActionType.initEnum({\n DRM_POLICY: \"drm.DRM_POLICY\",\n BLOCK: 1,\n PREVIEW: 2,\n LIMIT_FLAVORS: 3,\n ADD_TO_STORAGE: 4,\n LIMIT_DELIVERY_PROFILES: 5,\n SERVE_FROM_REMOTE_SERVER: 6,\n REQUEST_HOST_REGEX: 7,\n LIMIT_THUMBNAIL_CAPTURE: 8\n});\n\nexport class Status extends Enum {\n}\nStatus.initEnum({\n ERROR: -1,\n QUEUED: 0,\n CONVERTING: 1,\n READY: 2,\n DELETED: 3,\n NOT_APPLICABLE: 4,\n TEMP: 5,\n WAIT_FOR_CONVERT: 6,\n IMPORTING: 7,\n VALIDATING: 8,\n EXPORTING: 9\n});\n\nexport class MetadataObjectType extends Enum {\n}\nMetadataObjectType.initEnum({\n AD_CUE_POINT: \"adCuePointMetadata.AdCuePoint\",\n ANNOTATION: \"annotationMetadata.Annotation\",\n CODE_CUE_POINT: \"codeCuePointMetadata.CodeCuePoint\",\n THUMB_CUE_POINT: \"thumbCuePointMetadata.thumbCuePoint\",\n ENTRY: 1,\n CATEGORY: 2,\n USER: 3,\n PARTNER: 4,\n DYNAMIC_OBJECT: 5\n});\n\nexport class MetadataStatus extends Enum {\n}\nMetadataStatus.initEnum({\n VALID: 1,\n INVALID: 2,\n DELETED: 3\n});\n\n\nexport class EntryStatus extends Enum {\n}\nEntryStatus.initEnum({\n ERROR_IMPORTING: -2,\n ERROR_CONVERTING: -1,\n SCAN_FAILURE: \"virusScan.ScanFailure\",\n IMPORT: 0,\n INFECTED: \"virusScan.Infected\",\n PRECONVERT: 1,\n READY: 2,\n DELETED: 3,\n PENDING: 4,\n MODERATE: 5,\n BLOCKED: 6,\n NO_CONTENT: 7\n});\n\nexport class EntryModerationStatus extends Enum {\n}\nEntryModerationStatus.initEnum({\n PENDING_MODERATION: 1,\n APPROVED: 2,\n REJECTED: 3,\n FLAGGED_FOR_REVIEW: 4,\n MODERATE: 5,\n AUTO_APPROVED: 6\n});\n\nexport class EntryType extends Enum {\n}\nEntryType.initEnum({\n AUTOMATIC: {value: -1},\n EXTERNAL_MEDIA: {value: \"externalMedia.externalMedia\"},\n MEDIA_CLIP: {value: 1},\n MIX: {value: 2},\n PLAYLIST: {value: 5},\n DATA: {value: 6},\n LIVE_STREAM: {value: 7},\n LIVE_CHANNEL: {value: 8},\n DOCUMENT: {value: 10}\n});\n\nexport class MediaType extends Enum {\n}\nMediaType.initEnum({\n VIDEO: {value: 1},\n IMAGE: {value: 2},\n AUDIO: {value: 5},\n LIVE_STREAM_FLASH: {value: 201},\n LIVE_STREAM_WINDOWS_MEDIA: {value: 202},\n LIVE_STREAM_REAL_MEDIA: {value: 203},\n LIVE_STREAM_QUICKTIME: {value: 204}\n});\n\n\nexport class MediaEntryType extends Enum {\n}\nMediaEntryType.initEnum(['Vod', 'Live', 'Image', 'Audio', 'Unknown']);\n\nexport class UIConfType extends Enum {\n}\nUIConfType.initEnum({\n PLAYER: 1,\n CONTRIBUTION_WIZARD: 2,\n SIMPLE_EDITOR: 3,\n ADVANCED_EDITOR: 4,\n PLAYLIST: 5,\n APP_STUDIO: 6,\n KRECORD: 7,\n PLAYER_V3: 8,\n KMC_ACCOUNT: 9,\n KMC_ANALYTICS: 10,\n KMC_CONTENT: 11,\n KMC_DASHBOARD: 12,\n KMC_LOGIN: 13,\n PLAYER_SL: 14,\n CLIENTSIDE_ENCODER: 15,\n KMC_GENERAL: 16,\n KMC_ROLES_AND_PERMISSIONS: 17,\n CLIPPER: 18,\n KSR: 19,\n KUPLOAD: 20,\n WEBCASTING: 21\n});\n\nexport class UIConfCreationMode extends Enum {\n}\nUIConfCreationMode.initEnum({\n WIZARD: 2,\n ADVANCED: 3\n});\n\n\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/enums.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/enums.js","//@flow\nimport MultiRequestBuilder from '../../multi-request-builder'\nimport Configuration from '../config'\n\nconst config = Configuration.get();\nconst SERVICE_NAME: string = \"multirequest\";\n\n/**\n * Base for all ovp services\n * @classdesc\n */\nexport default class OvpService {\n /**\n * Gets a new instance of MultiRequestBuilder with ovp params\n * @function getMultirequest\n * @param {string} ks The ks\n * @param {string} partnerId The partner ID\n * @returns {MultiRequestBuilder} The multi request builder\n * @static\n */\n static getMultirequest(ks: string, partnerId?: number): MultiRequestBuilder {\n let ovpParams = config.serviceParams;\n Object.assign(ovpParams, {ks: ks});\n if (partnerId) {\n Object.assign(ovpParams, {partnerId: partnerId});\n }\n let multiReq = new MultiRequestBuilder();\n multiReq.method = \"POST\";\n multiReq.service = SERVICE_NAME;\n multiReq.baseUrl = config.beUrl;\n multiReq.params = ovpParams;\n return multiReq;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/ovp-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/ovp-service.js","//@flow\n\n/**\n * Base service result\n * @classdesc\n */\nexport default class ServiceResult {\n\n /**\n * @member - Is service returned an error\n * @type {boolean}\n */\n hasError: boolean = false;\n /**\n * @member - The service error\n * @type {ServiceError}\n */\n error: ServiceError;\n /**\n * @member - The service result data\n * @type {Object}\n */\n data: Object;\n\n /**\n * @constructor\n * @param {Object} response - Service response\n */\n constructor(response: Object) {\n if (response.objectType === \"KalturaAPIException\") {\n this.hasError = true;\n this.error = new ServiceError(response.code, response.message);\n }\n else {\n this.data = response;\n }\n }\n}\n\n/**\n * Service error\n * @classdesc\n */\nclass ServiceError {\n /**\n * @member - The error code\n * @type {string}\n */\n code: string;\n /**\n * @member - The error message\n * @type {string}\n */\n message: string;\n\n /**\n * @constructor\n * @param {string} code - The result code\n * @param {string} message - The result message\n */\n constructor(code: string, message: string) {\n this.code = code;\n this.message = message;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/base-service-result.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/base-service-result.js","//@flow\nimport * as JsLogger from 'js-logger';\n\nclass LoggerFactory {\n constructor(options?: Object) {\n JsLogger.useDefaults(options || {});\n }\n\n get(name?: string) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n}\n\nlet Logger = new LoggerFactory({defaultLevel: JsLogger.DEBUG});\nconst LOG_LEVEL: {[level: string]: Object} = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nexport default Logger;\nexport {LOG_LEVEL};\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./util/logger.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/util/logger.js","//@flow\nimport RequestBuilder from './request-builder'\nimport ServiceResult from './base-service-result'\nimport Logger from \"../util/logger\";\n/**\n * @constant\n */\nconst logger = Logger.get(\"OvpProvider\");\n\n/**\n * Multi Request builder\n * @classdesc\n */\nexport default class MultiRequestBuilder extends RequestBuilder {\n\n /**\n * @member - Array of requests\n * @type {Array<RequestBuilder>}\n */\n requests: Array<RequestBuilder> = [];\n\n /**\n * @constructor\n */\n constructor() {\n super();\n }\n\n /**\n * Adds request to requests array\n * @function add\n * @param {RequestBuilder} request The request\n * @returns {MultiRequestBuilder} The multiRequest\n */\n add(request: RequestBuilder): MultiRequestBuilder {\n this.requests.push(request);\n let requestParams = {};\n let serviceDef: Object = {service: request.service, action: request.action};\n Object.assign(requestParams, {[this.requests.length]: Object.assign(serviceDef, request.params)});\n Object.assign(requestParams, this.params);\n this.params = requestParams;\n return this;\n }\n\n /**\n * Executes a multi request\n * @function execute\n * @returns {Promise} The multirequest execution promisie\n */\n execute(): Promise<Object> {\n try {\n this.params = JSON.stringify(this.params);\n }\n catch (err) {\n logger.error(`${err.message}`);\n }\n return new Promise((resolve, reject) => {\n this.doHttpRequest().then(data => {\n resolve(new MultiRequestResult(data));\n },\n err => {\n let errorText: string = `Error on multiRequest execution, error <${err}>.`;\n reject(errorText);\n\n });\n });\n }\n\n}\n\n/**\n * Multi Request result object\n * @classdesc\n */\nexport class MultiRequestResult {\n\n /**\n * @member - Is success\n * @type {boolean}\n */\n success: boolean;\n /**\n * @member - Multi request response data\n * @type {Object}\n */\n results: Array<ServiceResult> = [];\n\n /**\n * @constructor\n * @param {Object} response data\n */\n constructor(response: Object) {\n this.success = true;\n response.forEach((result) => {\n let serviceResult: ServiceResult = new ServiceResult(result);\n this.results.push(serviceResult);\n if (serviceResult.hasError) {\n logger.error(`Service returned an error with error code: ${serviceResult.error.code} and message: ${serviceResult.error.message}.`);\n this.success = false;\n return;\n }\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/multi-request-builder.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/multi-request-builder.js","// @flow\nimport MediaSource from './media-source'\nimport {MediaFormat} from './media-format'\n\n/**\n * Container for the media sources aggregated by stream format.\n * @classdesc\n */\nexport default class MediaSources {\n /**\n * Progressive download media sources container.\n * @type {Array<MediaSource>}\n * @public\n */\n progressive: Array<MediaSource>;\n /**\n * Dash media sources container.\n * @type {Array<MediaSource>}\n * @public\n */\n dash: Array<MediaSource>;\n /**\n * Hls media sources container.\n * @type {Array<MediaSource>}\n * @public\n */\n hls: Array<MediaSource>;\n\n /**\n * @constructor\n */\n constructor() {\n this.progressive = [];\n this.dash = [];\n this.hls = [];\n }\n\n /**\n * Maps the source to one of the containers according to his media format.\n * @param {MediaSource} source - The source to add to one of the containers.\n * @param {MediaFormat} mediaFormat - The media format of the source.\n * @returns {void}\n */\n map(source: MediaSource, mediaFormat: ?MediaFormat) {\n if (mediaFormat) {\n switch (mediaFormat.name) {\n case 'mp4':\n this.progressive.push(source);\n break;\n case 'dash':\n this.dash.push(source);\n break;\n case 'hls':\n this.hls.push(source);\n break;\n default:\n break;\n }\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-sources.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-sources.js","//@flow\nimport {MediaEntryType} from '../k-provider/enums'\nimport MediaSources from './media-sources'\n\n/**\n * Media entry\n * @classdesc\n */\nexport default class MediaEntry {\n\n /**\n * @member - entry ID\n * @type {string}\n */\n id: string;\n /**\n * @member - entry sources\n * @type {MediaSources}\n */\n sources: MediaSources;\n /**\n * @member - entry duration\n * @type {number}\n */\n duration: number;\n /**\n * @member - entry type\n * @type {MediaEntryType}\n */\n type: MediaEntryType;\n /**\n * @member - entry metadata\n * @type {Map<string,string>}\n */\n metaData: Map<string, string>;\n\n /**\n * @constructor\n */\n constructor() {\n this.metaData = new Map();\n this.type = MediaEntryType.Unknown;\n }\n\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-entry.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-entry.js","//@flow\n\nimport {Scheme} from '../k-provider/enums';\n\n/**\n * Drm data\n * @classdesc\n */\nexport default class Drm {\n\n /**\n * @member - license URL\n * @type {string}\n */\n licenseUrl: string;\n /**\n * @member - drm scheme\n * @type {Scheme}\n */\n scheme: Scheme;\n\n /**\n * @constructor\n * @param {string} licenseUrl - the license URL\n * @param {Scheme} scheme - the drm scheme\n */\n constructor(licenseUrl: string, scheme: Scheme) {\n this.licenseUrl = licenseUrl;\n this.scheme = scheme;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./entities/drm.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/drm.js","//@flow\nimport {Enum} from 'enumify';\n\nexport class MediaFormat extends Enum {\n}\nMediaFormat.initEnum({\n dash: {\n get mimeType() {\n return \"application/dash+xml\";\n },\n get pathExt() {\n return \"mpd\";\n }\n },\n hls: {\n get mimeType() {\n return \"application/x-mpegURL\";\n },\n get pathExt() {\n return \"m3u8\";\n }\n },\n wvm: {\n get mimeType() {\n return \"video/wvm\";\n },\n get pathExt() {\n return \"wvm\";\n }\n },\n mp4: {\n get mimeType() {\n return \"video/mp4\";\n },\n get pathExt() {\n return \"mp4\";\n }\n },\n mp3: {\n get mimeType() {\n return \"audio/mpeg\";\n },\n get pathExt() {\n return \"mp3\";\n }\n }\n});\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-format.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-format.js","//@flow\nimport Drm from '../entities/drm'\n\n/**\n * Media source\n * @classdesc\n */\nexport default class MediaSource {\n /**\n * @member - media source ID\n * @type {string}\n */\n id: string;\n /**\n * @member - media source URL\n * @type {string}\n */\n url: string;\n /**\n * @member - media source mimetype\n * @type {string}\n */\n mimetype: string;\n /**\n * @member - media source drm data\n * @type {Array<Drm>}\n */\n drmData: Array<Drm>;\n\n /**\n * @constructor\n */\n constructor(){}\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-source.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-source.js","//@flow\nimport {Status} from '../../enums'\n\n/**\n * Ovp BE FlavorAsset\n * @classdesc\n */\nexport default class KalturaFlavorAsset {\n /**\n * @member - The ID of the Flavor Asset\n * @type {string}\n */\n id: string;\n /**\n * @member -The Flavor Params used to create this Flavor Asset\n * @type {string}\n */\n flavorParamsId: string;\n /**\n * @member -The file extension\n * @type {string}\n */\n fileExt: string;\n /**\n * @member - The overall bitrate (in KBits) of the Flavor Asset\n * @type {string}\n */\n bitrate: number;\n /**\n * @member - The width of the Flavor Asset\n * @type {number}\n */\n width: number;\n /**\n * @member - The height of the Flavor Asset\n * @type {number}\n */\n height: number;\n /**\n * @member - The frame rate (in FPS) of the Flavor Asset\n * @type {number}\n */\n frameRate: number;\n /**\n * @member - True if this Flavor Asset is the original source\n * @type {number}\n */\n isOriginal: boolean;\n /**\n * @member - True if this Flavor Asset is playable in KDP\n * @type {boolean}\n */\n isWeb: boolean;\n /**\n * @member - The container format\n * @type {boolean}\n */\n containerFormat: string;\n /**\n *@member - The video codec\n * @type {boolean}\n */\n videoCodecId: string;\n /**\n * @member - The status of the Flavor Asset\n * @type {string}\n */\n status: Status;\n /**\n * @member - The language of the flavor asset\n * @type {Status}\n */\n language: string;\n /**\n * @member - The label of the flavor asset\n * @type {string}\n */\n label: string;\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n constructor(data: any) {\n this.id = data.id;\n this.flavorParamsId = data.flavorParamsId;\n this.fileExt = data.fileExt;\n this.bitrate = data.bitrate;\n this.width = data.width;\n this.height = data.height;\n this.id = data.id;\n this.frameRate = data.frameRate;\n this.isOriginal = data.isOriginal;\n this.isWeb = data.isWeb;\n this.containerFormat = data.containerFormat;\n this.videoCodecId = data.videoCodecId;\n this.status = data.status;\n this.language = data.language;\n this.label = data.label;\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-flavor-asset.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-flavor-asset.js","//@flow\nimport {EntryType, MediaType} from '../../enums'\n\n/**\n * Ovp BE MediaEntry\n * @classdesc\n */\nexport default class KalturaMediaEntry {\n /**\n * @member - The entry id\n * @type {string}\n */\n id: string;\n /**\n * @member - Entry name (Min 1 chars)\n * @type {string}\n */\n name: string;\n /**\n * @member - The URL used for playback. This is not the download URL.\n * @type {string}\n */\n dataUrl: string;\n /**\n * @member - Comma separated flavor params ids that exists for this media entry\n * @type {string}\n */\n flavorParamsIds: string;\n /**\n * @member - The entry duration\n * @type {number}\n */\n duration: number;\n /**\n * @member - The type of the entry, this is auto filled by the derived entry object\n * @type {EntryType}\n */\n type: EntryType;\n /**\n * @member - The type of the entry, this is auto filled by the derived entry object (Image, Audio etc.)\n * @type {MediaType}\n */\n entryType: MediaType;\n\n /**\n * @constructor\n * @param {Object} entry The json response\n */\n constructor(entry: Object) {\n this.id = entry.id;\n this.name = entry.name;\n this.dataUrl = entry.dataUrl;\n this.type = entry.type;\n this.entryType = entry.mediaType;\n this.flavorParamsIds = entry.flavorParamsIds;\n this.duration = entry.duration;\n }\n}\n\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-media-entry.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-media-entry.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport KalturaMetadata from './kaltura-metadata'\n\n/**\n * Ovp BE Metadata list response\n * @classdesc\n */\nexport default class KalturaMetadataListResponse extends ServiceResult {\n totalCount: number;\n /**\n * @member -The mata data array\n * @type {Array<KalturaMetadata>}\n */\n metas: Array<KalturaMetadata>;\n\n /**\n * @constructor\n * @param {Object} responseObj The response\n */\n constructor(responseObj: Object) {\n super(responseObj);\n if (!this.hasError) {\n this.totalCount = responseObj.totalCount;\n if (this.totalCount > 0) {\n this.metas = [];\n responseObj.objects.map(meta => this.metas.push(new KalturaMetadata(meta)));\n }\n\n }\n }\n}\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-metadata-list-response.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-metadata-list-response.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport KalturaAccessControlMessage from './kaltura-access-control-message'\nimport KalturaPlaybackSource from './kaltura-playback-source'\nimport KalturaRuleAction from './kaltura-rule-action'\nimport KalturaFlavorAsset from './kaltura-flavor-asset'\n\n/**\n * Ovp BE playback context response\n * @classdesc\n */\nexport default class KalturaPlaybackContext extends ServiceResult {\n /**\n * @member - The playback sources\n * @type {Array<KalturaPlaybackSource>}\n */\n sources: Array<KalturaPlaybackSource> = [];\n /**\n * @member - Array of actions as received from the rules that invalidated\n * @type {Array<KalturaRuleAction>}\n */\n actions: Array<KalturaRuleAction> = [];\n /**\n * @member - Array of actions as received from the rules that invalidated\n * @type {Array<KalturaAccessControlMessage>}\n */\n messages: Array<KalturaAccessControlMessage> = [];\n /**\n * @member - The flavor assets\n * @type {Array<KalturaFlavorAsset>}\n */\n flavorAssets: Array<KalturaFlavorAsset> = [];\n\n /**\n * @constructor\n * @param {Object} response The response\n */\n constructor(response: Object) {\n super(response);\n if (!this.hasError) {\n\n let messages = response.messages;\n if (messages) {\n messages.map(message => this.messages.push(new KalturaAccessControlMessage(message)));\n }\n\n let actions = response.actions;\n if (actions) {\n actions.map(action => this.actions.push(new KalturaRuleAction(action)));\n }\n\n let sources = response.sources;\n if (sources) {\n sources.map(source => this.sources.push(new KalturaPlaybackSource(source)));\n }\n\n let flavorAssets = response.flavorAssets;\n if (flavorAssets) {\n flavorAssets.map(flavor => this.flavorAssets.push(new KalturaFlavorAsset(flavor)));\n }\n }\n\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-playback-context.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-playback-context.js","//@flow\nimport KalturaDrmPlaybackPluginData from './kaltura-drm-playback-plugin-data'\n\n/**\n * Ovp BE playback source\n * @classdesc\n */\nexport default class KalturaPlaybackSource {\n /**\n * @member - source format according to delivery profile streamer type (applehttp, mpegdash etc.)\n * @type {string}\n */\n format: string;\n /**\n * @member - delivery profile Id\n * @type {string}\n */\n deliveryProfileId: string;\n /**\n * @member - The source URL\n * @type {string}\n */\n url: string;\n /**\n * @member - comma separated string according to deliveryProfile media protocols ('http,https' etc.)\n * @type {string}\n */\n protocols: string;\n /**\n * @member - comma separated string of flavor ids\n * @type {string}\n */\n flavorIds: string;\n /**\n * @member - drm data object containing relevant license url ,scheme name and certificate\n * @type {Array<KalturaDrmPlaybackPluginData>}\n */\n drm: Array<KalturaDrmPlaybackPluginData> = [];\n\n /**\n * @constructor\n * @param {Object} source The response\n */\n constructor(source: Object) {\n this.format = source.format;\n this.deliveryProfileId = source.deliveryProfileId;\n this.url = source.url;\n this.protocols = source.protocols;\n this.flavorIds = source.flavorIds;\n\n if (source.drm) {\n source.drm.map(drm => this.drm.push(new KalturaDrmPlaybackPluginData(drm)));\n }\n\n\n }\n\n /**\n * Checks if source has DRM data\n * @function hasDrmData\n * @returns {boolean} Is source has DRM\n */\n hasDrmData(): boolean {\n return this.drm && this.drm.length > 0;\n }\n\n /**\n * Checks if source has flavor IDs\n * @function hasFlavorIds\n * @returns {boolean} Is source ha flavor IDs\n */\n hasFlavorIds(): boolean {\n return !!this.flavorIds && this.flavorIds.length > 0;\n }\n\n /**\n * Returns source desired protocol if supported\n * @param {string} protocol - the desired protocol for the source (base play url protocol)\n * @returns {string} - protocol if protocol is in the protocols list - if not empty string returned\n */\n getProtocol(protocol: string): string {\n let returnValue: string = \"\";\n if (this.protocols && this.protocols.length > 0) {\n let protocolsArr: Array<string> = this.protocols.split(\",\");\n protocolsArr.forEach((p) => {\n if (p == protocol) {\n returnValue = p;\n }\n });\n }\n else if (protocol == \"http\") {\n return protocol;\n }\n return returnValue;\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-playback-source.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-playback-source.js","'use strict';\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\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.copyProperties = copyProperties;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar INITIALIZED = Symbol();\n\n/**\n * This is an abstract class that is not intended to be\n * used directly. Extend it to turn your class into an enum\n * (initialization is performed via `MyClass.initEnum()`).\n */\n\nvar Enum = exports.Enum = function () {\n /**\n * `initEnum()` closes the class. Then calling this constructor\n * throws an exception.\n * \n * If your subclass has a constructor then you can control\n * what properties are added to `this` via the argument you\n * pass to `super()`. No arguments are fine, too.\n */\n\n function Enum() {\n var instanceProperties = arguments.length <= 0 || arguments[0] === undefined ? undefined : arguments[0];\n\n _classCallCheck(this, Enum);\n\n // new.target would be better than this.constructor,\n // but isn’t supported by Babel\n if ({}.hasOwnProperty.call(this.constructor, INITIALIZED)) {\n throw new Error('Enum classes can’t be instantiated');\n }\n if ((typeof instanceProperties === 'undefined' ? 'undefined' : _typeof(instanceProperties)) === 'object' && instanceProperties !== null) {\n copyProperties(this, instanceProperties);\n }\n }\n /**\n * Set up the enum, close the class.\n * \n * @param arg Either an object whose properties provide the names\n * and values (which must be mutable objects) of the enum constants.\n * Or an Array whose elements are used as the names of the enum constants\n * The values are create by instantiating the current class.\n */\n\n _createClass(Enum, [{\n key: 'toString',\n\n /**\n * Default `toString()` method for enum constant.\n */\n value: function toString() {\n return this.constructor.name + '.' + this.name;\n }\n }], [{\n key: 'initEnum',\n value: function initEnum(arg) {\n Object.defineProperty(this, 'enumValues', {\n value: [],\n configurable: false,\n writable: false,\n enumerable: true\n });\n if (Array.isArray(arg)) {\n this._enumValuesFromArray(arg);\n } else {\n this._enumValuesFromObject(arg);\n }\n Object.freeze(this.enumValues);\n this[INITIALIZED] = true;\n return this;\n }\n }, {\n key: '_enumValuesFromArray',\n value: function _enumValuesFromArray(arr) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = arr[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n\n this._pushEnumValue(new this(), key);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n }, {\n key: '_enumValuesFromObject',\n value: function _enumValuesFromObject(obj) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = Object.keys(obj)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n\n var value = new this(obj[key]);\n this._pushEnumValue(value, key);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n }, {\n key: '_pushEnumValue',\n value: function _pushEnumValue(enumValue, name) {\n enumValue.name = name;\n enumValue.ordinal = this.enumValues.length;\n Object.defineProperty(this, name, {\n value: enumValue,\n configurable: false,\n writable: false,\n enumerable: true\n });\n this.enumValues.push(enumValue);\n }\n\n /**\n * Given the name of an enum constant, return its value.\n */\n\n }, {\n key: 'enumValueOf',\n value: function enumValueOf(name) {\n return this.enumValues.find(function (x) {\n return x.name === name;\n });\n }\n\n /**\n * Make enum classes iterable\n */\n\n }, {\n key: Symbol.iterator,\n value: function value() {\n return this.enumValues[Symbol.iterator]();\n }\n }]);\n\n return Enum;\n}();\n\nfunction copyProperties(target, source) {\n // Ideally, we’d use Reflect.ownKeys() here,\n // but I don’t want to depend on a polyfill\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = Object.getOwnPropertyNames(source)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var key = _step3.value;\n\n var desc = Object.getOwnPropertyDescriptor(source, key);\n Object.defineProperty(target, key, desc);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return target;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/enumify/lib/enumify.js\n// module id = 18\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///~/enumify/lib/enumify.js","//@flow\nimport OvpService from '../services/ovp-service'\nimport MultiRequestBuilder from '../../multi-request-builder'\nimport {MultiRequestResult} from '../../multi-request-builder'\n\n/**\n * Data loaders manager\n * @classdesc\n */\nexport default class DataLoaderManager {\n /**\n * @member - Lodaers response map index\n * @type {Map<string,Array<number>>}\n * @private\n * @static\n */\n static _loadersResponseMap: Map<string, Array<number>> = new Map();\n /**\n * @member - Loaders multi request\n * @type {MultiRequestBuilder}\n * @private\n */\n _multiRequest: MultiRequestBuilder;\n /**\n * @member - Loaders multi response\n * @type {MultiRequestResult}\n * @private\n */\n _multiResponse: MultiRequestResult;\n /**\n * @member - Loaders to execute\n * @type {Map<string,Function>}\n * @private\n */\n _loaders: Map<string, ILoader> = new Map();\n\n /**\n * @constructor\n * @param {string} partnerID Then partner ID\n * @param {string} ks The ks\n */\n constructor(partnerID: number, ks: string = \"\") {\n this._multiRequest = OvpService.getMultirequest(ks, partnerID);\n }\n\n /**\n * Add loader too execution loaders map\n * @function\n * @param {Function} loader Loader to add\n * @param {Object} params Loader params\n * @returns {void}\n */\n add(loader: typeof ILoader, params: Object): void {\n let execution_loader = new loader(params);\n if (execution_loader.isValid()) {\n this._loaders.set(loader.name, execution_loader);\n //Get the start index from the multiReqeust before adding current execution_loader requests\n let startIndex = this._multiRequest.requests.length;\n //Get the requests\n let requests = execution_loader.requests;\n //Add requests to muktiRequest queue\n requests.forEach((request) => {\n this._multiRequest.add(request);\n });\n //Create range array of current execution_loader requests\n let executionLoaderResponseMap = Array.from(new Array(requests.length), (val, index) => index + startIndex);\n //Add to map\n DataLoaderManager._loadersResponseMap.set(loader.name, executionLoaderResponseMap);\n }\n }\n\n /**\n * Get data from all loaders using multi request\n * @function\n * @returns {Promise} Promise\n */\n fetchData(): Promise<any> {\n return new Promise((resolve, reject) => {\n this._multiRequest.execute()\n .then(response => {\n this._multiResponse = response;\n if (!response.success) {\n reject(response);\n }\n else {\n let preparedData: Object = this.prepareData(response);\n if (preparedData.success) {\n resolve(this._loaders);\n }\n else {\n reject({success: false, data: preparedData.error});\n }\n }\n },\n err => {\n reject(err);\n });\n });\n }\n\n prepareData(response: MultiRequestResult): Object {\n this._loaders.forEach(function (loader, name) {\n let loaderDataIndexes = DataLoaderManager._loadersResponseMap.get(name);\n try {\n if (loaderDataIndexes != null) {\n loader.response = (response.results.slice(loaderDataIndexes[0], loaderDataIndexes[loaderDataIndexes.length - 1] + 1));\n }\n }\n catch (err) {\n return {success: false, error: err};\n }\n });\n return {success: true, data: this._loaders};\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/data-loader-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/data-loader-manager.js","//@flow\n\nimport RequestBuilder from '../../request-builder'\nimport BaseEntryService from '../services/base-entry-service'\nimport MetaDataService from '../services/meta-data-service'\nimport Configuration from '../config'\nimport KalturaPlaybackContext from '../response-types/kaltura-playback-context'\nimport KalturaMetadataListResponse from '../response-types/kaltura-metadata-list-response'\nimport KalturaBaseEntryListResponse from '../response-types/kaltura-base-entry-list-response'\n\nconst config = Configuration.get();\n\n/**\n * Media entry loader\n * @classdesc\n */\nexport default class MediaEntryLoader implements ILoader {\n static get name(): string {\n return \"media\";\n }\n\n _entryId: string;\n _requests: Array<RequestBuilder>;\n _response: any = {};\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n constructor(params: Object) {\n this.requests = this.buildRequests(params);\n this._entryId = params.entryId;\n }\n\n set requests(requests: Array<RequestBuilder>) {\n this._requests = requests;\n }\n\n get requests(): Array<RequestBuilder> {\n return this._requests;\n }\n\n set response(response: any) {\n let mediaEntryResponse: KalturaBaseEntryListResponse = new KalturaBaseEntryListResponse(response[0].data);\n this._response.entry = mediaEntryResponse.entries[0];\n this._response.playBackContextResult = new KalturaPlaybackContext(response[1].data);\n this._response.metadataListResult = new KalturaMetadataListResponse(response[2].data);\n }\n\n get response(): any {\n return this._response;\n }\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n buildRequests(params: Object): Array<RequestBuilder> {\n let requests: Array<RequestBuilder> = [];\n requests.push(BaseEntryService.list(config.beUrl, params.ks, params.entryId));\n requests.push(BaseEntryService.getPlaybackContext(config.beUrl, params.ks, params.entryId));\n requests.push(MetaDataService.list(config.beUrl, params.ks, params.entryId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n isValid(): boolean {\n return !!this._entryId;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/media-entry-loader.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/media-entry-loader.js","//@flow\nimport SessionService from '../services/session-service'\nimport Configuration from '../config'\nimport RequestBuilder from '../../request-builder'\n\nconst config = Configuration.get();\n/**\n * Media entry loader\n * @classdesc\n */\nexport default class SessionLoader implements ILoader {\n static get name(): string {\n return \"session\";\n }\n\n /**\n * @member - partner ID\n * @type {number}\n * @private\n */\n _partnerId: number;\n _requests: Array<RequestBuilder>;\n _response: any = {};\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n constructor(params: Object) {\n this.requests = this.buildRequests(params);\n this._partnerId = params.partnerId;\n }\n\n set requests(requests: Array<RequestBuilder>) {\n this._requests = requests;\n }\n\n get requests(): Array<RequestBuilder> {\n return this._requests;\n }\n\n set response(response: any) {\n this._response.ks = response[0].data.ks;\n }\n\n get response(): any {\n return this._response.ks;\n }\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n buildRequests(params: Object): Array<RequestBuilder> {\n let requests: Array<RequestBuilder> = [];\n requests.push(SessionService.anonymousSession(config.beUrl, params.partnerId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n isValid(): boolean {\n return !!this._partnerId;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/session-loader.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/session-loader.js","//@flow\nimport UiConfService from '../services/ui-conf-service'\nimport KalturaUiConfResponse from '../response-types/kaltura-ui-conf-response'\nimport Configuration from '../config'\nimport RequestBuilder from '../../request-builder'\n\nconst config = Configuration.get();\n\nexport default class UiConfigLoader implements ILoader {\n static get name(): string {\n return \"uiConf\";\n }\n\n /**\n * @member - uiConf ID\n * @type {number}\n * @private\n */\n _uiConfId: number;\n _requests: Array<RequestBuilder>;\n _response: any = {};\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n constructor(params: Object) {\n this.requests = this.buildRequests(params);\n this._uiConfId = params.uiConfId;\n }\n\n set requests(requests: Array<RequestBuilder>) {\n this._requests = requests;\n }\n\n get requests(): Array<RequestBuilder> {\n return this._requests;\n }\n\n set response(response: any) {\n this._response.uiConf = new KalturaUiConfResponse(response[0].data);\n }\n\n get response(): any {\n if (this._response != null && this._response.uiConf != null && this._response.uiConf.config != null)\n try {\n return JSON.parse(this._response.uiConf.config).plugins;\n }\n catch (err) {\n return null;\n }\n else\n return null;\n }\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n buildRequests(params: Object): Array<RequestBuilder> {\n let requests: Array<RequestBuilder> = [];\n requests.push(UiConfService.get(config.beUrl, params.ks, params.uiConfId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n isValid(): boolean {\n return !!this._uiConfId;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/ui-config-loader.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/ui-config-loader.js","//@flow\nimport KalturaMediaEntry from './response-types/kaltura-media-entry'\nimport KalturaPlaybackContext from './response-types/kaltura-playback-context'\nimport KalturaPlaybackSource from './response-types/kaltura-playback-source'\nimport KalturaFlavorAsset from './response-types/kaltura-flavor-asset'\nimport KalturaMetadataListResponse from './response-types/kaltura-metadata-list-response'\nimport PlaySourceUrlBuilder from \"./play-source-url-builder\"\nimport XmlParser from '../xml-parser'\nimport {MediaEntryType, EntryType, MediaType} from '../enums'\nimport Logger from '../../util/logger'\nimport Configuration from './config'\nimport {MediaFormat} from '../../entities/media-format'\nimport MediaEntry from '../../entities/media-entry'\nimport Drm from '../../entities/drm'\nimport MediaSource from '../../entities/media-source'\nimport MediaSources from '../../entities/media-sources'\n\nconst config = Configuration.get();\n/**\n * @constant\n */\nconst logger = Logger.get(\"OvpProvider\");\n\n/**\n * @constant\n * @type {Map<string, MediaFormat>}\n */\nconst SUPPORTED_FORMATS: Map<string, MediaFormat> = new Map([\n [\"mpegdash\", MediaFormat.dash],\n [\"applehttp\", MediaFormat.hls],\n [\"url\", MediaFormat.mp4]\n]);\n\n/**\n * Ovp provider parser\n * @classdesc\n */\nexport default class ProviderParser {\n\n /**\n * Returns parsed media entry by given OVP response objects\n * @function getMediaEntry\n * @param {string} ks The ks\n * @param {number} partnerID The partner ID\n * @param {number} uiConfId The uiConf ID\n * @param {any} mediaEntryResponse The media entry response\n * @returns {MediaEntry} The media entry\n * @static\n */\n static getMediaEntry(ks: string, partnerID: number, uiConfId: number, mediaEntryResponse: any): MediaEntry {\n let mediaEntry: MediaEntry = new MediaEntry();\n let entry = mediaEntryResponse.entry;\n let playbackContext = mediaEntryResponse.playBackContextResult;\n let metadataList = mediaEntryResponse.metadataListResult;\n let kalturaSources: Array<KalturaPlaybackSource> = playbackContext.sources;\n let sources: MediaSources = new MediaSources();\n if (kalturaSources && kalturaSources.length > 0) {\n kalturaSources.forEach((source) => {\n let parsedSource = this.parseSource(source, ks, partnerID, uiConfId, entry, playbackContext);\n let mediaFormat = SUPPORTED_FORMATS.get(source.format);\n sources.map(parsedSource, mediaFormat);\n });\n }\n\n mediaEntry.sources = sources;\n\n let metadata: Map<string, string> = this.parseMetaData(metadataList);\n mediaEntry.metaData = metadata;\n mediaEntry.id = entry.id;\n mediaEntry.duration = entry.duration;\n\n let type: MediaEntryType = MediaEntryType.Unknown;\n\n switch (entry.entryType) {\n case MediaType.IMAGE.value:\n type = MediaEntryType.Image;\n break;\n case MediaType.AUDIO.value:\n type = MediaEntryType.Audio;\n break;\n default:\n switch (entry.type) {\n case EntryType.MEDIA_CLIP.value:\n type = MediaEntryType.Vod;\n break;\n case EntryType.LIVE_STREAM.value:\n case EntryType.LIVE_CHANNEL.value:\n type = MediaEntryType.Live;\n break;\n default:\n type = MediaEntryType.Unknown;\n }\n }\n mediaEntry.type = type;\n\n return mediaEntry;\n }\n\n /**\n *\n * @param {KalturaPlaybackSource} source The source\n * @param {string} ks The ks\n * @param {number} partnerID The partner ID\n * @param {number} uiConfId The uiConf ID\n * @param {KalturaMediaEntry} entry The entry\n * @param {KalturaPlaybackContext} playbackContext The playback context\n * @returns {MediaSource} The parsed media source\n * @static\n */\n static parseSource(source: KalturaPlaybackSource, ks: string, partnerID: number, uiConfId: number, entry: KalturaMediaEntry, playbackContext: KalturaPlaybackContext): MediaSource {\n let playUrl: string = \"\";\n let mediaFormat = SUPPORTED_FORMATS.get(source.format);\n let mediaSource: MediaSource = new MediaSource();\n // in case playbackSource doesn't have flavors we don't need to build the url and we'll use the provided one.\n if (source.hasFlavorIds()) {\n let splittedUrl: Array<string> = config.baseUrl.split(\"/\");\n let baseProtocol: string;\n if (splittedUrl && splittedUrl.length > 0) {\n baseProtocol = splittedUrl[0].substring(0, splittedUrl[0].length - 1);\n }\n else {\n baseProtocol = \"http\";\n }\n\n let extension: string = \"\";\n if (!mediaFormat) {\n let flavorIdsArr = source.flavorIds.split(\",\");\n let flavors: Array<KalturaFlavorAsset> = playbackContext.flavorAssets.filter(flavor => flavorIdsArr.indexOf(flavor.id) != -1);\n if (flavors && flavors.length > 0) {\n extension = flavors[0].fileExt;\n }\n }\n else {\n extension = mediaFormat.pathExt;\n mediaSource.mimetype = mediaFormat.mimeType;\n }\n\n playUrl = PlaySourceUrlBuilder.build({\n entryId: entry.id,\n flavorIds: source.flavorIds,\n format: source.format,\n ks: ks,\n partnerId: partnerID,\n uiConfId: uiConfId,\n extension: extension,\n protocol: source.getProtocol(baseProtocol)\n });\n\n }\n else {\n playUrl = source.url;\n }\n\n if (playUrl == \"\") {\n logger.error(`failed to create play url from source, discarding source: (${entry.id}_${source.deliveryProfileId}), ${source.format}.`);\n return mediaSource;\n }\n\n mediaSource.url = playUrl;\n mediaSource.id = entry.id + \"_\" + source.deliveryProfileId + \",\" + source.format;\n if (source.hasDrmData()) {\n let drmParams: Array<Drm> = [];\n source.drm.forEach((drm) => {\n drmParams.push(new Drm(drm.licenseURL, drm.scheme));\n });\n mediaSource.drmData = drmParams;\n }\n return mediaSource;\n }\n\n /**\n * Ovp metadata parser\n * @function parseMetaData\n * @param {KalturaMetadataListResponse} metadataList The metadata list\n * @returns {Map<string,string>} Parsed metadata\n * @static\n */\n static parseMetaData(metadataList: KalturaMetadataListResponse): Map<string, string> {\n let metadata: Object = {};\n if (metadataList && metadataList.metas && metadataList.metas.length > 0) {\n metadataList.metas.forEach((meta) => {\n let metaXml: Object;\n let domParser: DOMParser = new DOMParser();\n meta.xml = meta.xml.replace(/\\r?\\n|\\r/g, \"\");\n meta.xml = meta.xml.replace(/>\\s*/g, '>');\n meta.xml = meta.xml.replace(/>\\s*/g, '>');\n metaXml = domParser.parseFromString(meta.xml, 'text/xml');\n let metasObj: Object = XmlParser.xmlToJson(metaXml);\n let metaKeys = Object.keys(metasObj.metadata);\n metaKeys.forEach((key) => {\n metadata[key] = metasObj.metadata[key][\"#text\"];\n })\n\n })\n }\n return metadata;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/provider-parser.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/provider-parser.js","//@flow\nimport Logger from '../../util/logger'\nimport ProviderParser from './provider-parser'\nimport DataLoaderManager from './loaders/data-loader-manager'\nimport MediaEntryLoader from './loaders/media-entry-loader'\nimport SessionLoader from './loaders/session-loader'\nimport UiConfigLoader from './loaders/ui-config-loader'\nimport Configuration from './config'\nimport MediaEntry from '../../entities/media-entry'\nimport MediaSources from '../../entities/media-sources'\n/**\n * @constant\n */\nconst logger = Logger.get(\"OvpProvider\");\n\ntype playerConfig = {\n id: string,\n session: Object,\n sources: MediaSources,\n duration: number,\n type: string,\n metadata: Object,\n plugins: Object\n};\n\n/**\n * Ovp provider\n * @classdesc\n */\nexport class OvpProvider {\n /**\n * @member - ks\n * @type {string}\n */\n ks: string;\n /**\n * @member - partner ID\n * @type {number}\n */\n partnerID: number;\n /**\n * @member - is anonymous\n * @type {boolean}\n * @private\n */\n _isAnonymous: boolean;\n /**\n * @member - uiConf ID\n * @type {number}\n * @private\n */\n _uiConfId: number;\n /**\n * @member - Data loader\n * @type {DataLoaderManager}\n * @private\n */\n _dataLoader: DataLoaderManager;\n\n /**\n * @constructor\n * @param {number} partnerID The partner ID\n * @param {string} [ks=\"\"] The provider ks (has empty string as default value)\n * @param {Object} [config] The provider config(optional)\n */\n constructor(partnerID: number, ks: string = \"\", config?: Object) {\n this.partnerID = partnerID;\n this.ks = ks;\n this._isAnonymous = !this.ks;\n Configuration.set(config);\n }\n\n /**\n * Returns player json configuration\n * @function getConfig\n * @param {string} entryId The entry ID\n * @param {number} uiConfId The uiConf ID\n * @returns {Promise} The provider config object as promise\n */\n getConfig(entryId?: string, uiConfId?: number): Promise<Object> {\n if (uiConfId != null) {\n this._uiConfId = uiConfId;\n }\n this._dataLoader = new DataLoaderManager(this.partnerID, this.ks);\n return new Promise((resolve, reject) => {\n if (this.validateParams(entryId, uiConfId)) {\n let ks: string = this.ks;\n if (this._isAnonymous) {\n ks = \"{1:result:ks}\";\n this._dataLoader.add(SessionLoader, {partnerId: this.partnerID});\n }\n this._dataLoader.add(MediaEntryLoader, {entryId: entryId, ks: ks});\n this._dataLoader.add(UiConfigLoader, {uiConfId: uiConfId, ks: ks});\n this._dataLoader.fetchData()\n .then(response => {\n resolve(this.parseDataFromResponse(response));\n },\n err => {\n reject(err);\n });\n }\n else {\n reject({success: false, data: \"Missing mandatory parameter\"});\n }\n });\n }\n\n /**\n * Parses BE data to json configuration object\n * @function parseDataFromResponse\n * @param {Map<string,Function>} data The data to parse\n * @returns {Object} The parsed config object\n */\n parseDataFromResponse(data: Map<string, Function>): Object {\n logger.debug(\"Data parsing started\");\n let config: playerConfig = {\n id: \"\",\n session: {\n partnerID: this.partnerID,\n uiConfID: this._uiConfId,\n },\n sources: new MediaSources(),\n duration: 0,\n type: \"Unknown\",\n metadata: {},\n plugins: {}\n };\n if (data != null) {\n if (data.has(SessionLoader.name)) {\n let sessionLoader = data.get(SessionLoader.name);\n if (sessionLoader != null && sessionLoader.response != null) {\n this.ks = sessionLoader.response;\n this._isAnonymous = !this.ks;\n config.session.ks = this.ks;\n }\n }\n if (data.has(UiConfigLoader.name)) {\n let uiConfLoader = data.get(UiConfigLoader.name);\n let pluginsJson: Object = {};\n if (uiConfLoader != null) {\n pluginsJson = uiConfLoader.response;\n }\n config.plugins = pluginsJson;\n }\n if (data.has(MediaEntryLoader.name)) {\n let mediaLoader = data.get(MediaEntryLoader.name);\n if (mediaLoader != null && mediaLoader.response != null) {\n let mediaEntry: MediaEntry = ProviderParser.getMediaEntry(this.ks, this.partnerID, this._uiConfId, mediaLoader.response);\n config.id = mediaEntry.id;\n config.sources = mediaEntry.sources;\n config.duration = mediaEntry.duration;\n config.type = mediaEntry.type.name;\n config.metadata = mediaEntry.metaData;\n }\n }\n }\n logger.debug(\"Data parsing finished\", config);\n return (config);\n }\n\n /**\n * Parameters validation function\n * @param {string} entryId The entry ID\n * @param {number} uiConfId The uiConfID\n * @returns {boolean} Is valid params\n */\n validateParams(entryId?: string, uiConfId?: number): boolean {\n return !!entryId || !!uiConfId;\n }\n\n}\n\nexport default OvpProvider;\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/ovp-provider.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/ovp-provider.js","//@flow\nimport Configuration from './config'\n\nconst config = Configuration.get();\n\n/**\n * Media source url builder\n * @classdesc\n */\nexport default class PlaySourceUrlBuilder {\n\n /**\n * Returns source url by given url params\n * @function build\n * @param {Object} urlParams The params\n * @returns {string} The URL\n * @static\n */\n static build(urlParams: Object): string {\n let baseUrl: string = config.baseUrl;\n let partnerId: string = urlParams.partnerId;\n let entryId: string = urlParams.entryId;\n let ks: string = urlParams.ks;\n let uiConfId: string = urlParams.uiConfId;\n let format: string = urlParams.format;\n let protocol: string = urlParams.protocol;\n let extension: string = urlParams.extension;\n let flavorIds: string = urlParams.flavorIds;\n\n if (baseUrl == \"\" && partnerId == \"\" && entryId == \"\" && extension == \"\" && format == \"\") {\n return \"\";\n }\n\n let playUrl = baseUrl;\n if (!PlaySourceUrlBuilder.endsWith(baseUrl, \"/\")) {\n playUrl += \"/\";\n }\n playUrl += \"p/\" + partnerId + \"/sp/\" + partnerId + \"00\" + \"/playManifest/entryId/\" + entryId + \"/protocol/\" + protocol + \"/format/\" + format;\n\n if (flavorIds != \"\") {\n playUrl += \"/falvorIds/\" + flavorIds;\n }\n else if (uiConfId != \"\") {\n playUrl += \"/uiConfId/\" + uiConfId;\n }\n\n if (this.ks != \"\") {\n playUrl += \"/ks/\" + ks;\n }\n\n playUrl += \"/a.\" + extension;\n\n if (uiConfId && flavorIds != \"\") {\n playUrl += \"?uiConfId=.\" + uiConfId;\n }\n\n return playUrl;\n }\n\n /**\n * Checks if given string end with search string\n * @param {string} string The given string\n * @param {string} searchString The string to search\n * @returns {boolean} Is given string end with search string\n */\n static endsWith(string: string, searchString: string): boolean {\n if (typeof string !== 'string') {\n return false;\n }\n if (typeof searchString !== 'string') {\n return false;\n }\n\n return string.indexOf(searchString, string.length - searchString.length) != -1;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/play-source-url-builder.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/play-source-url-builder.js","//@flow\n\n/**\n * Ovp BE access control message\n * @classdesc\n */\nexport default class KalturaAccessControlMessage {\n /**\n * @member - The access control message\n * @type {string}\n */\n message: string;\n /**\n * @member - The access control message code\n * @@type {string}\n */\n code: string;\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n constructor(data: Object) {\n this.message = data.message;\n this.code = data.code\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-access-control-message.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-access-control-message.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport KalturaMediaEntry from './kaltura-media-entry'\n\n/**\n * Ovp BE BaseEntryList service response\n * @classdesc\n */\nexport default class KalturaBaseEntryListResponse extends ServiceResult {\n /**\n * @member - The total count\n * @type {number}\n */\n totalCount: number;\n /**\n * @member - The entries\n * @type {Array<KalturaMediaEntry>}\n */\n entries: Array<KalturaMediaEntry>;\n\n /**\n * @constructor\n * @param {Object} responseObj The json response\n */\n constructor(responseObj: Object) {\n super(responseObj);\n if (!this.hasError) {\n this.totalCount = responseObj.totalCount;\n if (this.totalCount > 0) {\n this.entries = [];\n responseObj.objects.map(entry => this.entries.push(new KalturaMediaEntry(entry)));\n }\n }\n }\n}\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-base-entry-list-response.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-base-entry-list-response.js","//@flow\nimport {Scheme} from '../../enums'\n\n/**\n * Ovp BE DrmPlaybackPluginData\n * @classdesc\n */\nexport default class KalturaDrmPlaybackPluginData {\n /**\n * @member - The drm scheme\n * @type {Scheme}\n */\n scheme: Scheme;\n\n /**\n * @member - The license URL\n * @type {string}\n */\n licenseURL: string;\n\n /**\n * @constructor\n * @param {Object} drm The json response\n */\n constructor(drm: any) {\n this.scheme = drm.scheme;\n this.licenseURL = drm.licenseURL;\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-drm-playback-plugin-data.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-drm-playback-plugin-data.js","//@flow\nimport {MetadataObjectType, MetadataStatus} from '../../enums'\n\n/**\n * Ovp BE Metadata\n * @classdesc\n */\nexport default class KalturaMetadata {\n id: number;\n metadataProfileId: number;\n metadataProfileVersion: number;\n metadataObjectType: MetadataObjectType;\n objectId: string;\n version: number;\n created: Date;\n updated: Date;\n status: MetadataStatus;\n /**\n * @member - The Metadata xml - represented as XML string\n * @type {string}\n */\n xml: string;\n\n /**\n * @constructor\n * @param {Object} data The response\n */\n constructor(data: Object) {\n this.id = data.id;\n this.metadataProfileId = data.metadataProfileId;\n this.metadataProfileVersion = data.metadataProfileVersion;\n this.metadataProfileId = data.metadataProfileId;\n this.metadataObjectType = data.metadataObjectType;\n this.objectId = data.objectId;\n this.version = data.version;\n this.created = new Date(0);\n this.created.setUTCSeconds(data.createdAt);\n this.updated = new Date(0);\n this.updated.setUTCSeconds(data.updatedAt);\n this.status = data.status;\n this.xml = data.xml;\n\n }\n}\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-metadata.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-metadata.js","//@flow\nimport {KalturaRuleActionType} from '../../enums'\n\n/**\n * Ovp BE rule action\n * @classdesc\n */\nexport default class KalturaRuleAction {\n /**\n * @member - The type of the action\n * @type {KalturaRuleActionType}\n */\n type: KalturaRuleActionType;\n\n /**\n * @constructor\n * @param {Object} data The response\n */\n constructor(data: Object) {\n this.type = data.type;\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-rule-action.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-rule-action.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport {UIConfType, UIConfCreationMode} from '../../enums';\n\n/**\n * Ovp BE Ui config response\n * @classdesc\n */\nexport default class KalturaUiConfResponse extends ServiceResult {\n /**\n * @member -Name of the uiConf, this is not a primary key\n * @type {string}\n */\n name: string;\n /**\n * @member -Name of the uiConf, this is not a primary key\n * @type {string}\n */\n description: string;\n objTypeAsString: string;\n width: number;\n height: number;\n htmlParams: string;\n swfUrl: string;\n confFilePath: string;\n confFile: string;\n confFileFeatures: string;\n name: string;\n /**\n * @member -plugins configuration represented as Json string\n * @type {string}\n */\n config: string;\n confVars: string;\n useCdn: boolean;\n tags: string;\n swfUrlVersion: string;\n created: Date;\n updated: Date;\n html5Url: string;\n version: string;\n partnerTags: string;\n objType: UIConfType;\n creationMode: UIConfCreationMode;\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n constructor(data: Object) {\n super(data);\n if (!this.hasError) {\n this.name = data.name;\n\n this.description = data.description;\n this.objTypeAsString = data.objTypeAsString;\n this.width = data.width;\n this.height = data.height;\n this.htmlParams = data.htmlParams;\n this.swfUrl = data.swfUrl;\n this.confFilePath = data.confFilePath;\n this.confFile = data.confFile;\n this.confFileFeatures = data.confFileFeatures;\n this.config = data.config;\n this.confVars = data.confVars;\n this.useCdn = data.useCdn;\n this.tags = data.tags;\n this.swfUrlVersion = data.swfUrlVersion;\n this.created = new Date(0);\n this.created.setUTCSeconds(data.createdAt);\n this.updated = new Date(0);\n this.updated.setUTCSeconds(data.updatedAt);\n this.html5Url = data.description;\n this.version = data.description;\n this.partnerTags = data.description;\n this.objType = data.description;\n this.creationMode = data.description;\n\n }\n }\n}\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-ui-conf-response.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-ui-conf-response.js","//@flow\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"baseEntry\";\n\n/**\n * Ovp BaseEntry service methods\n * @classdesc\n */\nexport default class BaseEntryService extends OvpService {\n\n /**\n * Creates an instance of RequestBuilder for baseentry.getPlaybackContext\n * @function getPlaybackContext\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static getPlaybackContext(baseUrl: string, ks: string, entryId: string): RequestBuilder {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"getPlaybackContext\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"baseEntry-getPlaybackContext\";\n let contextDataParams = {objectType: \"KalturaContextDataParams\", flavorTags: \"all\"};\n let params = {entryId: entryId, ks: ks, contextDataParams: contextDataParams};\n request.params = params;\n return request;\n }\n\n /**\n * Creates an instance of RequestBuilder for baseentry.list\n * @function list\n * @param {string} baseUrl The base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static list(baseUrl: string, ks: string, entryId: string): RequestBuilder {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"list\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"list\";\n request.params = BaseEntryService.getEntryListReqParams(entryId, ks);\n return request;\n }\n\n /**\n * Gets baseentry.list service params\n * @function getEntryListReqParams\n * @param {string} entryId The entry ID\n * @param {string} ks The ks\n * @returns {{ks: string, filter: {redirectFromEntryId: string}, responseProfile: {fields: string, type: number}}} The service params object\n * @static\n */\n static getEntryListReqParams(entryId: string, ks: string): any {\n let filterParams = {redirectFromEntryId: entryId};\n let responseProfileParams = {\n fields: \"id,name,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags\",\n type: 1\n };\n return {ks: ks, filter: filterParams, responseProfile: responseProfileParams};\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/base-entry-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/base-entry-service.js","//@flow\n\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"metadata_metadata\";\n\n/**\n * Ovp metadata_metadata service methods\n * @classdesc\n */\nexport default class MetaDataService extends OvpService {\n /**\n * Creates an instance of RequestBuilder for metadata_metadata.list\n * @function getPlaybackContext\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static list(baseUrl: string, ks: string, entryId: string) {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"list\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"metadata_metadata-list\";\n let filter = {objectType: \"KalturaMetadataFilter\", objectIdEqual: entryId, metadataObjectTypeEqual: \"1\"};\n let params = {filter: filter, ks: ks};\n request.params = params;\n return request;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/meta-data-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/meta-data-service.js","//@flow\n\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"session\";\n\n/**\n * Ovp session service methods\n * @classdesc\n */\nexport default class SessionService extends OvpService {\n /**\n * Creates an instance of RequestBuilder for session.startWidgetSession\n * @function anonymousSession\n * @param {string} baseUrl The service base URL\n * @param {string} partnerId The partner ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static anonymousSession(baseUrl: string, partnerId: number) {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"startWidgetSession\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"session-startWidget\";\n request.params = {widgetId: \"_\" + partnerId};\n return request;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/session-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/session-service.js","//@flow\n\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"uiconf\";\n\n/**\n * Ovp uiconf service methods\n * @classdesc\n */\nexport default class UiConfService extends OvpService {\n /**\n * Creates an instance of RequestBuilder for uiconf.get\n * @function get\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} uiConfID The uiConf ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static get(baseUrl: string, ks: string, uiConfID: number) {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"get\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"uiconf-get\";\n let responseProfileParams = {\n fields: \"config\",\n type: 1\n };\n request.params = {id: uiConfID, responseProfile: responseProfileParams, ks: ks};\n return request;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/ui-conf-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/ui-conf-service.js","//@flow\n\n/**\n * Xml parser\n * @classdesc\n */\nexport default class XmlParser {\n /**\n * Parses xml string to json object\n * @param {string} xml The xml to parse\n * @returns {{}} The parsed xml as Json object\n * @static\n */\n static xmlToJson(xml: Object) {\n let obj = {};\n if (xml.nodeType == 1) {\n if (xml.attributes.length > 0) {\n obj[\"@attributes\"] = {};\n for (let j = 0; j < xml.attributes.length; j++) {\n let attribute = xml.attributes.item(j);\n obj[\"@attributes\"][attribute.nodeName] = attribute.nodeValue;\n }\n }\n }\n else if (xml.nodeType == 3) {\n obj = xml.nodeValue;\n }\n if (xml.hasChildNodes()) {\n for (let i = 0; i < xml.childNodes.length; i++) {\n let item = xml.childNodes.item(i);\n let nodeName = item.nodeName;\n if (typeof (obj[nodeName]) == \"undefined\") {\n obj[nodeName] = this.xmlToJson(item);\n }\n else {\n if (typeof (obj[nodeName].push) == \"undefined\") {\n let old = obj[nodeName];\n obj[nodeName] = [];\n obj[nodeName].push(old);\n }\n obj[nodeName].push(this.xmlToJson(item));\n }\n }\n }\n return obj;\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/xml-parser.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/xml-parser.js","// @flow\n\n// Import core\nimport * as Playkit from 'playkit-js';\n\n// Import OVP and OTT providers\nimport OvpProvider from 'playkit-js-providers/dist/ovpProvider';\n\n// Import UI\nimport PlaykitUI from 'playkit-js-ui';\nimport '../node_modules/playkit-js-ui/src/styles/style.css';\n\n// Import media source adapters\nimport 'playkit-js-hls';\nimport 'playkit-js-dash';\n\nimport setup from './setup'\n// TODO: Import plugins\n\nexport {Playkit, OvpProvider, PlaykitUI, setup};\n\n\n\n\n// WEBPACK FOOTER //\n// ./index.js","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"playkit-js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsUi\"] = factory(require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsUi\"] = factory(root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_48__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 28);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 8f60fb2e6e6b40ac1263\n\n\n// WEBPACK FOOTER //\n// webpack:/ui/webpack/bootstrap 8f60fb2e6e6b40ac1263","!function() {\n 'use strict';\n function VNode() {}\n function h(nodeName, attributes) {\n var lastSimple, child, simple, i, children = EMPTY_CHILDREN;\n for (i = arguments.length; i-- > 2; ) stack.push(arguments[i]);\n if (attributes && null != attributes.children) {\n if (!stack.length) stack.push(attributes.children);\n delete attributes.children;\n }\n while (stack.length) if ((child = stack.pop()) && void 0 !== child.pop) for (i = child.length; i--; ) stack.push(child[i]); else {\n if (child === !0 || child === !1) child = null;\n if (simple = 'function' != typeof nodeName) if (null == child) child = ''; else if ('number' == typeof child) child = String(child); else if ('string' != typeof child) simple = !1;\n if (simple && lastSimple) children[children.length - 1] += child; else if (children === EMPTY_CHILDREN) children = [ child ]; else children.push(child);\n lastSimple = simple;\n }\n var p = new VNode();\n p.nodeName = nodeName;\n p.children = children;\n p.attributes = null == attributes ? void 0 : attributes;\n p.key = null == attributes ? void 0 : attributes.key;\n if (void 0 !== options.vnode) options.vnode(p);\n return p;\n }\n function extend(obj, props) {\n for (var i in props) obj[i] = props[i];\n return obj;\n }\n function cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n }\n function enqueueRender(component) {\n if (!component.__d && (component.__d = !0) && 1 == items.push(component)) (options.debounceRendering || setTimeout)(rerender);\n }\n function rerender() {\n var p, list = items;\n items = [];\n while (p = list.pop()) if (p.__d) renderComponent(p);\n }\n function isSameNodeType(node, vnode, hydrating) {\n if ('string' == typeof vnode || 'number' == typeof vnode) return void 0 !== node.splitText;\n if ('string' == typeof vnode.nodeName) return !node._componentConstructor && isNamedNode(node, vnode.nodeName); else return hydrating || node._componentConstructor === vnode.nodeName;\n }\n function isNamedNode(node, nodeName) {\n return node.__n === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n }\n function getNodeProps(vnode) {\n var props = extend({}, vnode.attributes);\n props.children = vnode.children;\n var defaultProps = vnode.nodeName.defaultProps;\n if (void 0 !== defaultProps) for (var i in defaultProps) if (void 0 === props[i]) props[i] = defaultProps[i];\n return props;\n }\n function createNode(nodeName, isSvg) {\n var node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n node.__n = nodeName;\n return node;\n }\n function removeNode(node) {\n if (node.parentNode) node.parentNode.removeChild(node);\n }\n function setAccessor(node, name, old, value, isSvg) {\n if ('className' === name) name = 'class';\n if ('key' === name) ; else if ('ref' === name) {\n if (old) old(null);\n if (value) value(node);\n } else if ('class' === name && !isSvg) node.className = value || ''; else if ('style' === name) {\n if (!value || 'string' == typeof value || 'string' == typeof old) node.style.cssText = value || '';\n if (value && 'object' == typeof value) {\n if ('string' != typeof old) for (var i in old) if (!(i in value)) node.style[i] = '';\n for (var i in value) node.style[i] = 'number' == typeof value[i] && IS_NON_DIMENSIONAL.test(i) === !1 ? value[i] + 'px' : value[i];\n }\n } else if ('dangerouslySetInnerHTML' === name) {\n if (value) node.innerHTML = value.__html || '';\n } else if ('o' == name[0] && 'n' == name[1]) {\n var useCapture = name !== (name = name.replace(/Capture$/, ''));\n name = name.toLowerCase().substring(2);\n if (value) {\n if (!old) node.addEventListener(name, eventProxy, useCapture);\n } else node.removeEventListener(name, eventProxy, useCapture);\n (node.__l || (node.__l = {}))[name] = value;\n } else if ('list' !== name && 'type' !== name && !isSvg && name in node) {\n setProperty(node, name, null == value ? '' : value);\n if (null == value || value === !1) node.removeAttribute(name);\n } else {\n var ns = isSvg && name !== (name = name.replace(/^xlink\\:?/, ''));\n if (null == value || value === !1) if (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase()); else node.removeAttribute(name); else if ('function' != typeof value) if (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value); else node.setAttribute(name, value);\n }\n }\n function setProperty(node, name, value) {\n try {\n node[name] = value;\n } catch (e) {}\n }\n function eventProxy(e) {\n return this.__l[e.type](options.event && options.event(e) || e);\n }\n function flushMounts() {\n var c;\n while (c = mounts.pop()) {\n if (options.afterMount) options.afterMount(c);\n if (c.componentDidMount) c.componentDidMount();\n }\n }\n function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n if (!diffLevel++) {\n isSvgMode = null != parent && void 0 !== parent.ownerSVGElement;\n hydrating = null != dom && !('__preactattr_' in dom);\n }\n var ret = idiff(dom, vnode, context, mountAll, componentRoot);\n if (parent && ret.parentNode !== parent) parent.appendChild(ret);\n if (!--diffLevel) {\n hydrating = !1;\n if (!componentRoot) flushMounts();\n }\n return ret;\n }\n function idiff(dom, vnode, context, mountAll, componentRoot) {\n var out = dom, prevSvgMode = isSvgMode;\n if (null == vnode) vnode = '';\n if ('string' == typeof vnode) {\n if (dom && void 0 !== dom.splitText && dom.parentNode && (!dom._component || componentRoot)) {\n if (dom.nodeValue != vnode) dom.nodeValue = vnode;\n } else {\n out = document.createTextNode(vnode);\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n recollectNodeTree(dom, !0);\n }\n }\n out.__preactattr_ = !0;\n return out;\n }\n if ('function' == typeof vnode.nodeName) return buildComponentFromVNode(dom, vnode, context, mountAll);\n isSvgMode = 'svg' === vnode.nodeName ? !0 : 'foreignObject' === vnode.nodeName ? !1 : isSvgMode;\n if (!dom || !isNamedNode(dom, String(vnode.nodeName))) {\n out = createNode(String(vnode.nodeName), isSvgMode);\n if (dom) {\n while (dom.firstChild) out.appendChild(dom.firstChild);\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n recollectNodeTree(dom, !0);\n }\n }\n var fc = out.firstChild, props = out.__preactattr_ || (out.__preactattr_ = {}), vchildren = vnode.children;\n if (!hydrating && vchildren && 1 === vchildren.length && 'string' == typeof vchildren[0] && null != fc && void 0 !== fc.splitText && null == fc.nextSibling) {\n if (fc.nodeValue != vchildren[0]) fc.nodeValue = vchildren[0];\n } else if (vchildren && vchildren.length || null != fc) innerDiffNode(out, vchildren, context, mountAll, hydrating || null != props.dangerouslySetInnerHTML);\n diffAttributes(out, vnode.attributes, props);\n isSvgMode = prevSvgMode;\n return out;\n }\n function innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n var j, c, vchild, child, originalChildren = dom.childNodes, children = [], keyed = {}, keyedLen = 0, min = 0, len = originalChildren.length, childrenLen = 0, vlen = vchildren ? vchildren.length : 0;\n if (0 !== len) for (var i = 0; i < len; i++) {\n var _child = originalChildren[i], props = _child.__preactattr_, key = vlen && props ? _child._component ? _child._component.__k : props.key : null;\n if (null != key) {\n keyedLen++;\n keyed[key] = _child;\n } else if (props || (void 0 !== _child.splitText ? isHydrating ? _child.nodeValue.trim() : !0 : isHydrating)) children[childrenLen++] = _child;\n }\n if (0 !== vlen) for (var i = 0; i < vlen; i++) {\n vchild = vchildren[i];\n child = null;\n var key = vchild.key;\n if (null != key) {\n if (keyedLen && void 0 !== keyed[key]) {\n child = keyed[key];\n keyed[key] = void 0;\n keyedLen--;\n }\n } else if (!child && min < childrenLen) for (j = min; j < childrenLen; j++) if (void 0 !== children[j] && isSameNodeType(c = children[j], vchild, isHydrating)) {\n child = c;\n children[j] = void 0;\n if (j === childrenLen - 1) childrenLen--;\n if (j === min) min++;\n break;\n }\n child = idiff(child, vchild, context, mountAll);\n if (child && child !== dom) if (i >= len) dom.appendChild(child); else if (child !== originalChildren[i]) if (child === originalChildren[i + 1]) removeNode(originalChildren[i]); else dom.insertBefore(child, originalChildren[i] || null);\n }\n if (keyedLen) for (var i in keyed) if (void 0 !== keyed[i]) recollectNodeTree(keyed[i], !1);\n while (min <= childrenLen) if (void 0 !== (child = children[childrenLen--])) recollectNodeTree(child, !1);\n }\n function recollectNodeTree(node, unmountOnly) {\n var component = node._component;\n if (component) unmountComponent(component); else {\n if (null != node.__preactattr_ && node.__preactattr_.ref) node.__preactattr_.ref(null);\n if (unmountOnly === !1 || null == node.__preactattr_) removeNode(node);\n removeChildren(node);\n }\n }\n function removeChildren(node) {\n node = node.lastChild;\n while (node) {\n var next = node.previousSibling;\n recollectNodeTree(node, !0);\n node = next;\n }\n }\n function diffAttributes(dom, attrs, old) {\n var name;\n for (name in old) if ((!attrs || null == attrs[name]) && null != old[name]) setAccessor(dom, name, old[name], old[name] = void 0, isSvgMode);\n for (name in attrs) if (!('children' === name || 'innerHTML' === name || name in old && attrs[name] === ('value' === name || 'checked' === name ? dom[name] : old[name]))) setAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n }\n function collectComponent(component) {\n var name = component.constructor.name;\n (components[name] || (components[name] = [])).push(component);\n }\n function createComponent(Ctor, props, context) {\n var inst, list = components[Ctor.name];\n if (Ctor.prototype && Ctor.prototype.render) {\n inst = new Ctor(props, context);\n Component.call(inst, props, context);\n } else {\n inst = new Component(props, context);\n inst.constructor = Ctor;\n inst.render = doRender;\n }\n if (list) for (var i = list.length; i--; ) if (list[i].constructor === Ctor) {\n inst.__b = list[i].__b;\n list.splice(i, 1);\n break;\n }\n return inst;\n }\n function doRender(props, state, context) {\n return this.constructor(props, context);\n }\n function setComponentProps(component, props, opts, context, mountAll) {\n if (!component.__x) {\n component.__x = !0;\n if (component.__r = props.ref) delete props.ref;\n if (component.__k = props.key) delete props.key;\n if (!component.base || mountAll) {\n if (component.componentWillMount) component.componentWillMount();\n } else if (component.componentWillReceiveProps) component.componentWillReceiveProps(props, context);\n if (context && context !== component.context) {\n if (!component.__c) component.__c = component.context;\n component.context = context;\n }\n if (!component.__p) component.__p = component.props;\n component.props = props;\n component.__x = !1;\n if (0 !== opts) if (1 === opts || options.syncComponentUpdates !== !1 || !component.base) renderComponent(component, 1, mountAll); else enqueueRender(component);\n if (component.__r) component.__r(component);\n }\n }\n function renderComponent(component, opts, mountAll, isChild) {\n if (!component.__x) {\n var rendered, inst, cbase, props = component.props, state = component.state, context = component.context, previousProps = component.__p || props, previousState = component.__s || state, previousContext = component.__c || context, isUpdate = component.base, nextBase = component.__b, initialBase = isUpdate || nextBase, initialChildComponent = component._component, skip = !1;\n if (isUpdate) {\n component.props = previousProps;\n component.state = previousState;\n component.context = previousContext;\n if (2 !== opts && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === !1) skip = !0; else if (component.componentWillUpdate) component.componentWillUpdate(props, state, context);\n component.props = props;\n component.state = state;\n component.context = context;\n }\n component.__p = component.__s = component.__c = component.__b = null;\n component.__d = !1;\n if (!skip) {\n rendered = component.render(props, state, context);\n if (component.getChildContext) context = extend(extend({}, context), component.getChildContext());\n var toUnmount, base, childComponent = rendered && rendered.nodeName;\n if ('function' == typeof childComponent) {\n var childProps = getNodeProps(rendered);\n inst = initialChildComponent;\n if (inst && inst.constructor === childComponent && childProps.key == inst.__k) setComponentProps(inst, childProps, 1, context, !1); else {\n toUnmount = inst;\n component._component = inst = createComponent(childComponent, childProps, context);\n inst.__b = inst.__b || nextBase;\n inst.__u = component;\n setComponentProps(inst, childProps, 0, context, !1);\n renderComponent(inst, 1, mountAll, !0);\n }\n base = inst.base;\n } else {\n cbase = initialBase;\n toUnmount = initialChildComponent;\n if (toUnmount) cbase = component._component = null;\n if (initialBase || 1 === opts) {\n if (cbase) cbase._component = null;\n base = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, !0);\n }\n }\n if (initialBase && base !== initialBase && inst !== initialChildComponent) {\n var baseParent = initialBase.parentNode;\n if (baseParent && base !== baseParent) {\n baseParent.replaceChild(base, initialBase);\n if (!toUnmount) {\n initialBase._component = null;\n recollectNodeTree(initialBase, !1);\n }\n }\n }\n if (toUnmount) unmountComponent(toUnmount);\n component.base = base;\n if (base && !isChild) {\n var componentRef = component, t = component;\n while (t = t.__u) (componentRef = t).base = base;\n base._component = componentRef;\n base._componentConstructor = componentRef.constructor;\n }\n }\n if (!isUpdate || mountAll) mounts.unshift(component); else if (!skip) {\n flushMounts();\n if (component.componentDidUpdate) component.componentDidUpdate(previousProps, previousState, previousContext);\n if (options.afterUpdate) options.afterUpdate(component);\n }\n if (null != component.__h) while (component.__h.length) component.__h.pop().call(component);\n if (!diffLevel && !isChild) flushMounts();\n }\n }\n function buildComponentFromVNode(dom, vnode, context, mountAll) {\n var c = dom && dom._component, originalComponent = c, oldDom = dom, isDirectOwner = c && dom._componentConstructor === vnode.nodeName, isOwner = isDirectOwner, props = getNodeProps(vnode);\n while (c && !isOwner && (c = c.__u)) isOwner = c.constructor === vnode.nodeName;\n if (c && isOwner && (!mountAll || c._component)) {\n setComponentProps(c, props, 3, context, mountAll);\n dom = c.base;\n } else {\n if (originalComponent && !isDirectOwner) {\n unmountComponent(originalComponent);\n dom = oldDom = null;\n }\n c = createComponent(vnode.nodeName, props, context);\n if (dom && !c.__b) {\n c.__b = dom;\n oldDom = null;\n }\n setComponentProps(c, props, 1, context, mountAll);\n dom = c.base;\n if (oldDom && dom !== oldDom) {\n oldDom._component = null;\n recollectNodeTree(oldDom, !1);\n }\n }\n return dom;\n }\n function unmountComponent(component) {\n if (options.beforeUnmount) options.beforeUnmount(component);\n var base = component.base;\n component.__x = !0;\n if (component.componentWillUnmount) component.componentWillUnmount();\n component.base = null;\n var inner = component._component;\n if (inner) unmountComponent(inner); else if (base) {\n if (base.__preactattr_ && base.__preactattr_.ref) base.__preactattr_.ref(null);\n component.__b = base;\n removeNode(base);\n collectComponent(component);\n removeChildren(base);\n }\n if (component.__r) component.__r(null);\n }\n function Component(props, context) {\n this.__d = !0;\n this.context = context;\n this.props = props;\n this.state = this.state || {};\n }\n function render(vnode, parent, merge) {\n return diff(merge, vnode, {}, !1, parent, !1);\n }\n var options = {};\n var stack = [];\n var EMPTY_CHILDREN = [];\n var IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n var items = [];\n var mounts = [];\n var diffLevel = 0;\n var isSvgMode = !1;\n var hydrating = !1;\n var components = {};\n extend(Component.prototype, {\n setState: function(state, callback) {\n var s = this.state;\n if (!this.__s) this.__s = extend({}, s);\n extend(s, 'function' == typeof state ? state(s, this.props) : state);\n if (callback) (this.__h = this.__h || []).push(callback);\n enqueueRender(this);\n },\n forceUpdate: function(callback) {\n if (callback) (this.__h = this.__h || []).push(callback);\n renderComponent(this, 2);\n },\n render: function() {}\n });\n var preact = {\n h: h,\n createElement: h,\n cloneElement: cloneElement,\n Component: Component,\n render: render,\n rerender: rerender,\n options: options\n };\n if ('undefined' != typeof module) module.exports = preact; else self.preact = preact;\n}();\n//# sourceMappingURL=preact.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/preact/dist/preact.js\n// module id = 0\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/preact/dist/preact.js","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('preact'), require('redux')) :\n\ttypeof define === 'function' && define.amd ? define(['preact', 'redux'], factory) :\n\t(global.preactRedux = factory(global.preact,global.Redux));\n}(this, (function (preact,redux) {\n\nvar Children = {\n\tonly: function only(children) {\n\t\treturn children && children[0] || null;\n\t}\n};\n\nfunction proptype() {}\nproptype.isRequired = proptype;\n\nvar PropTypes = {\n\telement: proptype,\n\tfunc: proptype,\n\tshape: function shape() {\n\t\treturn proptype;\n\t},\n\tinstanceOf: function instanceOf() {\n\t\treturn proptype;\n\t}\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n};\n\n\n\n\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\n\n\n\n\n\n\n\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar get = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\nvar objectWithoutProperties = function (obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n};\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n\n\nvar set = function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if (\"value\" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n};\n\n// encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nvar CLEARED = null;\nvar nullListeners = {\n notify: function notify() {}\n};\n\nfunction createListenerCollection() {\n // the current/next pattern is copied from redux's createStore code.\n // TODO: refactor+expose that code to be reusable here?\n var current = [];\n var next = [];\n\n return {\n clear: function clear() {\n next = CLEARED;\n current = CLEARED;\n },\n notify: function notify() {\n var listeners = current = next;\n for (var i = 0; i < listeners.length; i++) {\n listeners[i]();\n }\n },\n subscribe: function subscribe(listener) {\n var isSubscribed = true;\n if (next === current) next = current.slice();\n next.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed || current === CLEARED) return;\n isSubscribed = false;\n\n if (next === current) next = current.slice();\n next.splice(next.indexOf(listener), 1);\n };\n }\n };\n}\n\nvar Subscription = function () {\n function Subscription(store, parentSub) {\n classCallCheck(this, Subscription);\n\n this.store = store;\n this.parentSub = parentSub;\n this.unsubscribe = null;\n this.listeners = nullListeners;\n }\n\n Subscription.prototype.addNestedSub = function addNestedSub(listener) {\n this.trySubscribe();\n return this.listeners.subscribe(listener);\n };\n\n Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() {\n this.listeners.notify();\n };\n\n Subscription.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.unsubscribe);\n };\n\n Subscription.prototype.trySubscribe = function trySubscribe() {\n if (!this.unsubscribe) {\n // this.onStateChange is set by connectAdvanced.initSubscription()\n this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);\n\n this.listeners = createListenerCollection();\n }\n };\n\n Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n this.listeners.clear();\n this.listeners = nullListeners;\n }\n };\n\n return Subscription;\n}();\n\nvar storeShape = PropTypes.shape({\n subscribe: PropTypes.func.isRequired,\n dispatch: PropTypes.func.isRequired,\n getState: PropTypes.func.isRequired\n});\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}\n\nvar didWarnAboutReceivingStore = false;\nfunction warnAboutReceivingStore() {\n if (didWarnAboutReceivingStore) {\n return;\n }\n didWarnAboutReceivingStore = true;\n\n warning('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');\n}\n\nvar Provider = function (_Component) {\n inherits(Provider, _Component);\n\n Provider.prototype.getChildContext = function getChildContext() {\n return { store: this.store, storeSubscription: null };\n };\n\n function Provider(props, context) {\n classCallCheck(this, Provider);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.store = props.store;\n return _this;\n }\n\n Provider.prototype.render = function render() {\n return Children.only(this.props.children);\n };\n\n return Provider;\n}(preact.Component);\n\n{\n Provider.prototype.componentWillReceiveProps = function (nextProps) {\n var store = this.store;\n var nextStore = nextProps.store;\n\n\n if (store !== nextStore) {\n warnAboutReceivingStore();\n }\n };\n}\n\nProvider.childContextTypes = {\n store: storeShape.isRequired,\n storeSubscription: PropTypes.instanceOf(Subscription)\n};\nProvider.displayName = 'Provider';\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\n\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n arguments: true,\n arity: true\n};\n\nvar isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function';\n\nvar index = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n var keys = Object.getOwnPropertyNames(sourceComponent);\n\n /* istanbul ignore else */\n if (isGetOwnPropertySymbolsAvailable) {\n keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent));\n }\n\n for (var i = 0; i < keys.length; ++i) {\n if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) {\n try {\n targetComponent[keys[i]] = sourceComponent[keys[i]];\n } catch (error) {}\n }\n }\n }\n\n return targetComponent;\n};\n\nvar invariant = function () {}\n\nvar hotReloadingVersion = 0;\nfunction connectAdvanced(\n/*\n selectorFactory is a func that is responsible for returning the selector function used to\n compute new props from state, props, and dispatch. For example:\n export default connectAdvanced((dispatch, options) => (state, props) => ({\n thing: state.things[props.thingId],\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\n }))(YourComponent)\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\n props. Do not use connectAdvanced directly without memoizing results between calls to your\n selector, otherwise the Connect component will re-render on every state or props change.\n*/\nselectorFactory) {\n var _contextTypes, _childContextTypes;\n\n var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n var _ref$getDisplayName = _ref.getDisplayName;\n var getDisplayName = _ref$getDisplayName === undefined ? function (name) {\n return 'ConnectAdvanced(' + name + ')';\n } : _ref$getDisplayName;\n var _ref$methodName = _ref.methodName;\n var methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName;\n var _ref$renderCountProp = _ref.renderCountProp;\n var renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp;\n var _ref$shouldHandleStat = _ref.shouldHandleStateChanges;\n var shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat;\n var _ref$storeKey = _ref.storeKey;\n var storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey;\n var _ref$withRef = _ref.withRef;\n var withRef = _ref$withRef === undefined ? false : _ref$withRef;\n var connectOptions = objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']);\n\n var subscriptionKey = storeKey + 'Subscription';\n var version = hotReloadingVersion++;\n\n var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = storeShape, _contextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _contextTypes);\n var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _childContextTypes);\n\n return function wrapWithConnect(WrappedComponent) {\n invariant(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + WrappedComponent));\n\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n withRef: withRef,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent\n });\n\n var Connect = function (_Component) {\n inherits(Connect, _Component);\n\n function Connect(props, context) {\n classCallCheck(this, Connect);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.version = version;\n _this.state = {};\n _this.renderCount = 0;\n _this.store = _this.props[storeKey] || _this.context[storeKey];\n _this.parentSub = props[subscriptionKey] || context[subscriptionKey];\n\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n\n invariant(_this.store, 'Could not find \"' + storeKey + '\" in either the context or ' + ('props of \"' + displayName + '\". ') + 'Either wrap the root component in a <Provider>, ' + ('or explicitly pass \"' + storeKey + '\" as a prop to \"' + displayName + '\".'));\n\n // make sure `getState` is properly bound in order to avoid breaking\n // custom store implementations that rely on the store's context\n _this.getState = _this.store.getState.bind(_this.store);\n\n _this.initSelector();\n _this.initSubscription();\n return _this;\n }\n\n Connect.prototype.getChildContext = function getChildContext() {\n var _ref2;\n\n return _ref2 = {}, _ref2[subscriptionKey] = this.subscription || this.parentSub, _ref2;\n };\n\n Connect.prototype.componentDidMount = function componentDidMount() {\n if (!shouldHandleStateChanges) return;\n\n // componentWillMount fires during server side rendering, but componentDidMount and\n // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.\n // Otherwise, unsubscription would never take place during SSR, causing a memory leak.\n // To handle the case where a child component may have triggered a state change by\n // dispatching an action in its componentWillMount, we have to re-run the select and maybe\n // re-render.\n this.subscription.trySubscribe();\n this.selector.run(this.props);\n if (this.selector.shouldComponentUpdate) this.forceUpdate();\n };\n\n Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n this.selector.run(nextProps);\n };\n\n Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() {\n return this.selector.shouldComponentUpdate;\n };\n\n Connect.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.subscription) this.subscription.tryUnsubscribe();\n // these are just to guard against extra memory leakage if a parent element doesn't\n // dereference this instance properly, such as an async callback that never finishes\n this.subscription = null;\n this.store = null;\n this.parentSub = null;\n this.selector.run = function () {};\n };\n\n Connect.prototype.getWrappedInstance = function getWrappedInstance() {\n invariant(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.'));\n return this.wrappedInstance;\n };\n\n Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) {\n this.wrappedInstance = ref;\n };\n\n Connect.prototype.initSelector = function initSelector() {\n var dispatch = this.store.dispatch;\n var getState = this.getState;\n\n var sourceSelector = selectorFactory(dispatch, selectorFactoryOptions);\n\n // wrap the selector in an object that tracks its results between runs\n var selector = this.selector = {\n shouldComponentUpdate: true,\n props: sourceSelector(getState(), this.props),\n run: function runComponentSelector(props) {\n try {\n var nextProps = sourceSelector(getState(), props);\n if (selector.error || nextProps !== selector.props) {\n selector.shouldComponentUpdate = true;\n selector.props = nextProps;\n selector.error = null;\n }\n } catch (error) {\n selector.shouldComponentUpdate = true;\n selector.error = error;\n }\n }\n };\n };\n\n Connect.prototype.initSubscription = function initSubscription() {\n var _this2 = this;\n\n if (shouldHandleStateChanges) {\n (function () {\n var subscription = _this2.subscription = new Subscription(_this2.store, _this2.parentSub);\n var dummyState = {};\n\n subscription.onStateChange = function onStateChange() {\n this.selector.run(this.props);\n\n if (!this.selector.shouldComponentUpdate) {\n subscription.notifyNestedSubs();\n } else {\n this.componentDidUpdate = function componentDidUpdate() {\n this.componentDidUpdate = undefined;\n subscription.notifyNestedSubs();\n };\n\n this.setState(dummyState);\n }\n }.bind(_this2);\n })();\n }\n };\n\n Connect.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.subscription) && this.subscription.isSubscribed();\n };\n\n Connect.prototype.addExtraProps = function addExtraProps(props) {\n if (!withRef && !renderCountProp) return props;\n // make a shallow copy so that fields added don't leak to the original selector.\n // this is especially important for 'ref' since that's a reference back to the component\n // instance. a singleton memoized selector would then be holding a reference to the\n // instance, preventing the instance from being garbage collected, and that would be bad\n var withExtras = _extends({}, props);\n if (withRef) withExtras.ref = this.setWrappedInstance;\n if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;\n return withExtras;\n };\n\n Connect.prototype.render = function render() {\n var selector = this.selector;\n selector.shouldComponentUpdate = false;\n\n if (selector.error) {\n throw selector.error;\n } else {\n return preact.h(WrappedComponent, this.addExtraProps(selector.props));\n }\n };\n\n return Connect;\n }(preact.Component);\n\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = displayName;\n Connect.childContextTypes = childContextTypes;\n Connect.contextTypes = contextTypes;\n\n\n {\n Connect.prototype.componentWillUpdate = function componentWillUpdate() {\n // We are hot reloading!\n if (this.version !== version) {\n this.version = version;\n this.initSelector();\n\n if (this.subscription) this.subscription.tryUnsubscribe();\n this.initSubscription();\n if (shouldHandleStateChanges) this.subscription.trySubscribe();\n }\n };\n }\n\n return index(Connect, WrappedComponent);\n };\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n\n var countA = 0;\n var countB = 0;\n\n for (var key in a) {\n if (hasOwn.call(a, key) && a[key] !== b[key]) return false;\n countA++;\n }\n\n for (var _key in b) {\n if (hasOwn.call(b, _key)) countB++;\n }\n\n return countA === countB;\n}\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetPrototype = Object.getPrototypeOf;\n\n/**\n * Gets the `[[Prototype]]` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {null|Object} Returns the `[[Prototype]]`.\n */\nfunction getPrototype(value) {\n return nativeGetPrototype(Object(value));\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 * 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 === 'undefined' ? 'undefined' : _typeof(value)) == 'object';\n}\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = Function.prototype.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/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\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,\n * 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) || 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' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;\n}\n\nfunction verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.');\n }\n}\n\nfunction wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n}\n\n// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n// \n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\nfunction getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\n\n// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n// \n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n// \n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n// \n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n// \nfunction wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}\n\nfunction whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\n\nfunction whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return { dispatch: dispatch };\n }) : undefined;\n}\n\nfunction whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && (typeof mapDispatchToProps === 'undefined' ? 'undefined' : _typeof(mapDispatchToProps)) === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return redux.bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\n\nvar defaultMapDispatchToPropsFactories = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];\n\nfunction whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\n\nfunction whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\n\nvar defaultMapStateToPropsFactories = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];\n\nfunction defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, stateProps, dispatchProps);\n}\n\nfunction wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName;\n var pure = _ref.pure;\n var areMergedPropsEqual = _ref.areMergedPropsEqual;\n\n var hasRunOnce = false;\n var mergedProps = void 0;\n\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n\n verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\n\nfunction whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\n\nfunction whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\n\nvar defaultMergePropsFactories = [whenMergePropsIsFunction, whenMergePropsIsOmitted];\n\nfunction verify(selector, methodName, displayName) {\n if (!selector) {\n throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.');\n } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {\n if (!selector.hasOwnProperty('dependsOnOwnProps')) {\n warning('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.');\n }\n }\n}\n\nfunction verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {\n verify(mapStateToProps, 'mapStateToProps', displayName);\n verify(mapDispatchToProps, 'mapDispatchToProps', displayName);\n verify(mergeProps, 'mergeProps', displayName);\n}\n\nfunction impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\n\nfunction pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual;\n var areOwnPropsEqual = _ref.areOwnPropsEqual;\n var areStatePropsEqual = _ref.areStatePropsEqual;\n\n var hasRunAtLeastOnce = false;\n var state = void 0;\n var ownProps = void 0;\n var stateProps = void 0;\n var dispatchProps = void 0;\n var mergedProps = void 0;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state);\n state = nextState;\n ownProps = nextOwnProps;\n\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n}\n\n// TODO: Add more comments\n\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nfunction finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps;\n var initMapDispatchToProps = _ref2.initMapDispatchToProps;\n var initMergeProps = _ref2.initMergeProps;\n var options = objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}\n\n/*\n connect is a facade over connectAdvanced. It turns its args into a compatible\n selectorFactory, which has the signature:\n\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\n \n connect passes its args to connectAdvanced as options, which will in turn pass them to\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\n\n selectorFactory returns a final props selector from its mapStateToProps,\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\n mergePropsFactories, and pure args.\n\n The resulting final props selector is called by the Connect component instance whenever\n it receives new props or store state.\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error('Invalid value of type ' + (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.');\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n}\n\n// createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\nfunction createConnect() {\n var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var _ref$connectHOC = _ref.connectHOC;\n var connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC;\n var _ref$mapStateToPropsF = _ref.mapStateToPropsFactories;\n var mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF;\n var _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories;\n var mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro;\n var _ref$mergePropsFactor = _ref.mergePropsFactories;\n var mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor;\n var _ref$selectorFactory = _ref.selectorFactory;\n var selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];\n\n var _ref2$pure = _ref2.pure;\n var pure = _ref2$pure === undefined ? true : _ref2$pure;\n var _ref2$areStatesEqual = _ref2.areStatesEqual;\n var areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual;\n var _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual;\n var areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua;\n var _ref2$areStatePropsEq = _ref2.areStatePropsEqual;\n var areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq;\n var _ref2$areMergedPropsE = _ref2.areMergedPropsEqual;\n var areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE;\n var extraOptions = objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}\n\nvar connect$1 = createConnect();\n\n\n\nvar lib$1 = {\n\tProvider: Provider,\n\tconnect: connect$1,\n\tconnectAdvanced: connectAdvanced\n};\n\nreturn lib$1;\n\n})));\n//# sourceMappingURL=preact-redux.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/preact-redux/dist/preact-redux.js\n// module id = 1\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/preact-redux/dist/preact-redux.js","//@flow\nimport { Component } from 'preact';\nimport Player from 'playkit-js';\nimport LoggerFactory from '../utils/logger';\n\nclass BaseComponent extends Component {\n player: Player;\n name: string;\n config: Object;\n logger: any;\n\n constructor(obj?: IControlParams = { config: {} }) {\n super();\n\n this.name = obj.name;\n this.player = obj.player;\n this.config = obj.config;\n this.logger = LoggerFactory.getLogger(`UI ${this.name}`);\n this.logger.debug(`Initialized`);\n }\n\n getConfig(attr?: string): any {\n if (attr) {\n return this.config[attr];\n }\n return this.config;\n }\n\n get defaultConfig() {\n return {}\n }\n}\n\nexport default BaseComponent;\n\n\n\n// WEBPACK FOOTER //\n// ./components/base.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/base.js","//@flow\nimport { bindActionCreators } from 'redux';\n\nexport function bindActions(actions) {\n\treturn dispatch => ({\n\t\t...bindActionCreators(actions, dispatch)\n\t});\n}\n\n\n\n// WEBPACK FOOTER //\n// ./utils/bind-actions.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/bind-actions.js","import { h, Component } from 'preact';\n\nclass Icon extends Component {\n\n render(props) {\n switch (props.type) {\n case 'maximize':\n return (\n <svg className='icon icon-maximize' viewBox='0 0 1024 1024'>\n <path d='M800 269.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z' />\n <path d='M224 754.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z' />\n </svg>\n )\n case 'minimize':\n return (\n <svg className='icon icon-minimize' viewBox='0 0 1024 1024'>\n <path d='M672 306.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z' />\n <path d='M352 717.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z' />\n </svg>\n )\n\n case 'play':\n return (\n <svg className='icon icon-play' viewBox='0 0 1024 1024'>\n <path d='M796.806 461.202c44.919 28.075 44.739 73.706 0 101.668l-459.472 287.171c-44.919 28.075-81.334 7.915-81.334-45.305v-585.4c0-53.096 36.595-73.266 81.334-45.305l459.472 287.171z' />\n </svg>\n )\n\n case 'pause':\n return (\n <svg className='icon icon-pause' viewBox='0 0 1024 1024'>\n <path d='M256 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314zM640 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314z' />\n </svg>\n )\n\n case 'volume-base':\n return (\n <svg className='icon volume-base' viewBox='0 0 1024 1024'>\n <path d='M224 352l234.504-156.336c29.545-19.697 53.496-7.194 53.496 28.053v576.566c0 35.19-24.059 47.677-53.496 28.053l-234.504-156.336h-127.906c-17.725 0-32.094-14.581-32.094-31.853v-256.295c0-17.592 14.012-31.853 32.094-31.853h127.906zM288 637.748l160 106.667v-464.83l-160 106.667v251.496zM128 416v192h96v-192h-96z' />\n </svg>\n )\n\n case 'volume-waves':\n return (\n <svg className='icon volume-waves' viewBox='0 0 1024 1024'>\n <path d='M802.017 837.177c82.359-86.627 129.183-201.774 129.183-324.26 0-123.976-47.976-240.409-132.127-327.329-12.293-12.697-32.552-13.025-45.249-0.732s-13.025 32.552-0.732 45.249c72.692 75.084 114.109 175.597 114.109 282.812 0 105.928-40.422 205.331-111.566 280.162-12.177 12.808-11.666 33.063 1.143 45.24s33.063 11.666 45.24-1.143z' />\n <path d='M667.436 743.221c67.761-60.884 107.273-147.888 107.273-241.233 0-87.318-34.552-169.203-94.836-229.446-12.501-12.493-32.762-12.486-45.255 0.015s-12.486 32.762 0.015 45.255c48.375 48.342 76.075 113.989 76.075 184.176 0 75.021-31.679 144.776-86.048 193.627-13.146 11.812-14.227 32.044-2.416 45.19s32.044 14.227 45.19 2.416z' />\n </svg>\n )\n\n case 'volume-mute':\n return (\n <svg className='icon volume-mute' viewBox='0 0 1024 1024'>\n <path d='M768 466.745l-67.986-67.986c-12.213-12.213-32.654-12.393-45.151 0.104-12.584 12.584-12.543 32.711-0.104 45.151l67.986 67.986-67.986 67.986c-12.213 12.213-12.393 32.654 0.104 45.151 12.584 12.584 32.711 12.543 45.151 0.104l67.986-67.986 67.986 67.986c12.213 12.213 32.654 12.393 45.151-0.104 12.584-12.584 12.543-32.711 0.104-45.151l-67.986-67.986 67.986-67.986c12.213-12.213 12.393-32.654-0.104-45.151-12.584-12.584-32.711-12.543-45.151-0.104l-67.986 67.986z' />\n </svg>\n )\n\n case 'close':\n return (\n <svg className='icon icon-close' viewBox='0 0 1024 1024'>\n <path d='M573.162 512l214.269-214.269c16.772-16.772 16.688-44.071-0.202-60.96-17.007-17.007-44.182-16.98-60.96-0.202l-214.269 214.269-214.269-214.269c-16.772-16.772-44.071-16.688-60.96 0.202-17.007 17.007-16.98 44.182-0.202 60.96l214.269 214.269-214.269 214.269c-16.772 16.772-16.688 44.071 0.202 60.96 17.007 17.007 44.182 16.98 60.96 0.202l214.269-214.269 214.269 214.269c16.772 16.772 44.071 16.688 60.96-0.202 17.007-17.007 16.98-44.182 0.202-60.96l-214.269-214.269z' />\n </svg>\n )\n\n case 'share':\n return (\n <svg className='icon icon-share' viewBox='0 0 1024 1024'>\n <path d='M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.129-5.295 0-58.91 47.756-106.667 106.667-106.667s106.667 47.756 106.667 106.667c0 58.91-47.756 106.667-106.667 106.667-33.894 0-64.095-15.808-83.633-40.454l-236.467 142.445c-0.132-3.064-0.394-6.095-0.779-9.087l7.271-12.835-0.117 53.333-7.183-12.743c0.399-3.046 0.67-6.131 0.806-9.252l236.467 142.383c19.538-24.648 49.741-40.457 83.636-40.457 58.91 0 106.667 47.756 106.667 106.667s-47.756 106.667-106.667 106.667c-58.91 0-106.667-47.756-106.667-106.667 0-1.775 0.043-3.539 0.129-5.293l-236.19-142.216c-19.528 24.867-49.868 40.841-83.939 40.841-58.91 0-106.667-47.756-106.667-106.667s47.756-106.667 106.667-106.667c34.091 0 64.447 15.993 83.974 40.886zM234.667 554.667c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 341.333c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 768c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667z' />\n </svg>\n )\n\n case 'settings':\n return (\n <svg className='icon icon-share' viewBox='0 0 1024 1024'>\n <path d='M829.945 549.126c2.784-24.116 2.784-48.445 0.269-70.702-1.182-6.772-7.090-11.696-13.674-11.641-33.039 0.582-62.975-19.389-75.126-50.118s-3.971-65.772 20.504-87.92c4.293-3.894 4.818-10.455 1.003-15.228-14.831-18.927-31.796-36.079-50.521-51.087-4.614-3.687-11.301-3.148-16.127 2.145-15.732 16.059-37.322 25.023-59.382 24.831-9.828 0.044-19.574-1.802-29.307-5.686-30.997-13.082-50.429-44.232-48.535-78.046 0.365-5.803-3.87-10.878-9.583-11.551-23.919-2.769-48.074-2.831-71.958-0.192-5.836 0.654-10.191 5.68-10.009 11.47 1.121 33.146-18.329 63.547-49.925 76.834-8.987 3.423-18.538 5.129-27.498 5.028-22.472 0.224-44.067-8.707-60.526-25.487-2.197-2.386-5.29-3.748-8.24-3.758-2.663 0.016-5.248 0.905-7.105 2.334-19.136 15.052-36.496 32.233-51.558 50.977-3.729 4.732-3.187 11.536 1.058 15.449 24.89 22.573 32.935 58.34 19.426 90.928-14.22 29.886-44.875 48.43-77.941 47.151-5.576-0.215-10.363 3.934-11.003 10.013-2.916 24.025-2.916 48.315-0.231 70.764 1.178 6.84 7.155 11.808 14.518 11.713l2.428 0.007c31.565 0.659 59.701 20.063 71.6 49.499 12.239 30.769 4.278 65.898-20.252 88.586-4.217 3.829-4.736 10.275-0.976 14.991 14.777 18.932 31.665 36.115 50.227 51.128 4.694 3.762 11.505 3.223 16.349-2.081 15.725-16.101 37.337-25.092 59.378-24.895 9.894-0.057 19.705 1.819 29.5 5.78 30.753 13.169 50.063 44.084 48.378 77.965-0.373 5.795 3.857 10.867 9.602 11.539 23.908 2.78 48.053 2.842 71.923 0.192 5.851-0.659 10.215-5.702 10.027-11.562-1.088-33.118 18.371-63.473 49.584-76.583 9.014-3.552 18.622-5.354 27.841-5.307 22.555-0.225 44.218 8.804 60.434 25.505 2.224 2.395 5.343 3.76 8.371 3.769 2.474-0.012 4.874-0.847 6.896-2.43 19.227-14.971 36.653-32.121 51.726-50.848 3.737-4.743 3.194-11.563-0.941-15.379-24.391-21.907-32.789-56.564-21.134-87.207s40.964-50.957 73.904-51.116h5.704c5.586-0.028 10.269-4.227 10.905-9.777zM893.526 556.438c-4.321 37.715-36.171 66.271-74.323 66.464h-5.711c-6.33 0.031-11.99 3.953-14.24 9.87s-0.629 12.609 4.385 17.116c29.020 26.748 32.567 71.325 7.936 102.582-18.378 22.837-39.342 43.468-62.397 61.42-13.128 10.284-29.303 15.909-46.22 15.991-21.004-0.056-41.043-8.825-54.839-23.692-3.514-3.616-8.356-5.634-13.867-5.583-1.555-0.007-3.097 0.282-3.877 0.581-6.088 2.559-9.967 8.609-9.749 15.235 1.257 39.227-27.828 72.841-66.88 77.241-28.725 3.189-57.719 3.114-86.45-0.227-39.585-4.631-68.615-39.444-66.083-78.749 0.331-6.679-3.529-12.859-9.057-15.234-1.449-0.585-2.998-0.881-5.025-0.873-5.074-0.045-9.947 1.982-12.693 4.763-26.775 29.494-71.875 33.067-103.071 8.066-22.458-18.164-42.771-38.831-60.335-61.337-24.602-30.847-21.012-75.5 7.982-101.818 4.881-4.515 6.479-11.568 4.088-17.58-2.239-5.538-7.562-9.209-12.866-9.327-39.748 0.506-72.828-26.991-79.581-66.425-3.538-29.147-3.538-58.616-0.060-87.234 4.085-39.084 37.791-68.296 77.064-66.784 7.502 0.29 14.456-3.916 17.001-9.164 2.519-6.098 0.94-13.122-4.133-17.724-29.022-26.738-32.57-71.311-7.956-102.538 18.292-22.765 39.115-43.375 62.322-61.626 13.199-10.169 29.368-15.731 46.323-15.833 21.063 0.065 41.146 8.908 54.704 23.656 3.559 3.623 8.44 5.642 14.175 5.592 1.605 0.017 3.199-0.268 3.668-0.426 6.11-2.574 9.998-8.651 9.771-15.356-1.228-39.209 27.864-72.786 66.897-77.161 28.715-3.173 57.697-3.098 86.456 0.231 39.539 4.653 68.54 39.409 66.051 78.92-0.369 6.596 3.446 12.713 8.931 15.035 1.507 0.6 3.114 0.905 5.156 0.898 5.087 0.044 9.973-1.985 12.671-4.704 26.66-29.444 71.625-33.068 102.694-8.244 22.604 18.117 43.043 38.781 60.715 61.337 24.728 30.927 21.142 75.751-8.215 102.378-4.724 4.275-6.301 11.031-3.958 16.955s8.114 9.775 14.774 9.659c38.18-0.325 70.992 27.018 77.822 66.463 3.343 28.966 3.343 58.22 0 87.185zM511.951 597.037c47.144-0.118 85.24-38.367 85.169-85.511 0-34.617-20.872-65.819-52.867-79.034s-68.802-5.836-93.231 18.69c-24.429 24.527-31.66 61.363-18.317 93.305s44.628 52.688 79.245 52.55zM512.158 661.036c-60.477 0.242-115.178-36.032-138.507-91.881s-10.686-120.254 32.026-163.138c42.712-42.884 107.066-55.785 163.008-32.679s92.434 77.661 92.434 138.139c0.124 82.417-66.545 149.353-148.962 149.559z' />\n </svg>\n )\n\n case 'check':\n return (\n <svg className='icon check-icon' viewBox='0 0 1024 1024'>\n <path d='M342.481 563.894c-12.577-12.416-32.838-12.285-45.254 0.292s-12.285 32.838 0.292 45.254l118.857 117.333c13.275 13.105 34.901 12.123 46.933-2.131l297.143-352c11.4-13.505 9.694-33.694-3.811-45.094s-33.694-9.694-45.094 3.811l-274.828 325.566-94.238-93.030z' />\n </svg>\n )\n case 'language':\n return (\n <svg className='icon language-icon' viewBox='0 0 1024 1024'>\n <path d='M625.773 808.031c29.752-39.944 63.443-97.069 83.311-168.977 41.798-3.715 74.872-8.022 98.271-11.57-32.456 82.71-98.638 148.558-181.582 180.547zM216.562 627.283c23.516 3.506 56.799 7.797 98.279 11.528 19.868 72.017 53.601 129.224 83.378 169.219-83.002-32.014-149.226-97.945-181.657-180.747zM400.147 215.201c-29.835 40.32-64.161 98.037-84.572 169.695-42.123 3.731-75.423 8.072-98.938 11.629 32.698-83.353 99.656-149.61 183.51-181.323zM807.438 396.725c-23.641-3.523-57.158-7.847-98.947-11.587-20.402-71.766-54.778-129.567-84.639-169.937 83.912 31.73 150.912 98.070 183.585 181.523zM720.095 436.644c48.952 4.817 84.472 10.209 102.995 13.331 3.99 20.068 6.127 40.796 6.127 62.024 0 21.262-2.137 42.031-6.152 62.141-18.248 3.172-53.376 8.615-102.753 13.448 3.84-23.908 6.069-49.102 6.069-75.59 0-26.296-2.304-51.431-6.286-75.356zM537.043 597.206v-170.396c48.576 0.551 92.653 2.646 131.178 5.426 5.050 25.119 8.072 51.74 8.072 79.763 0 28.216-2.913 54.87-7.789 79.939-38.283 2.713-82.343 4.742-131.462 5.267zM486.957 195.859v180.856c-43.175 0.442-82.443 1.995-117.429 4.149 31.939-95.382 89.99-161.656 112.237-184.612 1.72-0.159 3.464-0.259 5.192-0.392zM542.286 196.26c22.297 22.906 80.456 89.080 112.345 184.771-35.261-2.229-74.646-3.848-117.587-4.307v-180.864c1.745 0.142 3.506 0.234 5.242 0.401zM347.706 512c0-28.074 3.047-54.762 8.156-79.955 38.191-2.696 82.134-4.708 131.094-5.234v170.387c-48.71-0.551-92.895-2.655-131.495-5.443-4.858-25.018-7.755-51.606-7.755-79.755zM194.783 512c0-21.262 2.137-42.031 6.144-62.125 18.282-3.181 53.501-8.64 103.012-13.482-4.007 24-6.319 49.219-6.319 75.606 0 26.396 2.221 51.506 6.027 75.339-48.826-4.808-84.246-10.184-102.737-13.306-3.99-20.068-6.127-40.804-6.127-62.033zM481.338 827.706c-22.389-22.314-81.016-87.469-112.662-184.779 35.437 2.262 75.047 3.898 118.28 4.366v180.839c-1.87-0.142-3.757-0.25-5.618-0.426zM542.653 827.706c-1.862 0.175-3.74 0.284-5.61 0.426v-180.839c43.509-0.442 83.044-2.012 118.222-4.199-31.672 97.244-90.265 162.349-112.612 184.612zM512 128c-211.734 0-384 172.257-384 384 0 211.734 172.266 384 384 384s384-172.266 384-384c0-211.743-172.266-384-384-384z' />\n </svg>\n )\n\n default:\n break;\n }\n }\n}\n\nexport default Icon;\n\n\n\n// WEBPACK FOOTER //\n// ./components/icon/icon.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/icon/icon.js","function n(n){return n&&\"object\"==typeof n&&\"default\"in n?n.default:n}function t(n){return null!==n&&void 0!==n}function r(n,t){var o=e({},n);for(var i in t)t.hasOwnProperty(i)&&(o[i]=n[i]&&t[i]&&\"object\"==typeof n[i]&&\"object\"==typeof t[i]?r(n[i],t[i]):n[i]||t[i]);return o}function e(n,t){for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function o(n){if(n=n||{},\"string\"==typeof n&&(n=n.split(\",\")),\"join\"in n){for(var t={},r=0;r<n.length;r++){var e=n[r].trim();e&&(t[e.split(\".\").pop()]=e)}return t}return n}function i(n,t){return v=t||h,n&&n.replace(/\\{\\{([\\w.-]+)\\}\\}/g,u)}function u(n,t){for(var r=t.split(\".\"),e=v,o=0;o<r.length;o++)if(null==(e=e[r[o]]))return\"\";return\"string\"==typeof e&&e.match(/\\{\\{/)&&(e=i(e,v)),e}function c(n,r,e,o,u,c){r&&(n=r+\".\"+n);var a=e&&f(e,n);return(u||0===u)&&a&&\"object\"==typeof a&&(a=a.splice?a[u]||a[0]:0===u&&t(a.none)?a.none:1===u&&t(a.one||a.singular)?a.one||a.singular:a.some||a.many||a.plural||a.other||a),a&&i(a,o)||c||null}function a(n,t,r){var i={};t=t||{},n=o(n);for(var u in n)if(n.hasOwnProperty(u)&&n[u]){var a=n[u];r||\"string\"!=typeof a?a.nodeName===g&&(a=e({fallback:a.children&&a.children[0]},a.attributes),i[u]=c(a.id,t.scope,t.dictionary,a.fields,a.plural,a.fallback)):i[u]=c(a,t.scope,t.dictionary)}return i}var l=require(\"preact\"),f=n(require(\"dlv\")),p=/[?&#]intl=show/,s=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getChildContext=function(){var n=this.props,t=n.scope,o=n.definition,i=n.mark,u=e({},this.context.intl||{});return t&&(u.scope=t),o&&(u.dictionary=r(u.dictionary||{},o)),(i||\"undefined\"!=typeof location&&String(location).match(p))&&(u.mark=!0),{intl:u}},t.prototype.render=function(n){var t=n.children;return t&&t[0]||null},t}(l.Component),d=function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];if(n.length>1){return y(n[0],n[1])}var r=n[0];return function(n){return y(n,r)}},y=function(n,t){return function(r){return l.h(s,t||{},l.h(n,r))}},h={},v,g=function(n,t){var r=n.id,e=n.children,o=n.plural,i=n.fields,u=t.intl,a=e&&e[0],p=c(r,u&&u.scope,u&&u.dictionary,i,o,a);if(u&&u.mark){var s=\"dictionary\"+(u&&u.scope?\".\"+u.scope:\"\")+\".\"+r;return l.h(\"mark\",{style:\"background: \"+(p?f(u,s)?\"rgba(119,231,117,.5)\":\"rgba(229,226,41,.5)\":\"rgba(228,147,51,.5)\"),title:r},p)}return p},b=function(n,t){var r=n.children,e=t.intl,o=r&&r[0];return o&&l.cloneElement(o,a(o.attributes,e,!0))},m=function(n){return function(t){return function(r,e){var o=\"function\"==typeof n?n(r):n,i=a(o,e.intl);return l.h(t,assign({},r,i))}}};d.intl=d,d.IntlProvider=s,d.Text=g,d.Localizer=b,d.withText=m,module.exports=d;\n//# sourceMappingURL=preact-i18n.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/preact-i18n/dist/preact-i18n.js\n// module id = 5\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/preact-i18n/dist/preact-i18n.js","import createStore from './createStore';\nimport combineReducers from './combineReducers';\nimport bindActionCreators from './bindActionCreators';\nimport applyMiddleware from './applyMiddleware';\nimport compose from './compose';\nimport warning from './utils/warning';\n\n/*\n* This is a dummy function to check if the function name has been altered by minification.\n* If the function has been minified and NODE_ENV !== 'production', warn the user.\n*/\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \\'production\\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { createStore, combineReducers, bindActionCreators, applyMiddleware, compose };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/index.js\n// module id = 6\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/index.js","/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nexport default function warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/utils/warning.js\n// module id = 7\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/utils/warning.js","//@flow\n\nexport const types = {\n ADD_PLAYER_CLASS: 'shell/ADD_PLAYER_CLASS',\n REMOVE_PLAYER_CLASS: 'shell/REMOVE_PLAYER_CLASS',\n UPDATE_IS_MOBILE: 'shell/UPDATE_IS_MOBILE'\n}\n\nexport const initialState = {\n playerClasses: []\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.ADD_PLAYER_CLASS:\n return {\n ...state,\n playerClasses: [...state.playerClasses, action.className]\n }\n\n case types.REMOVE_PLAYER_CLASS:\n return {\n ...state,\n playerClasses: state.playerClasses.filter(c => c !== action.className)\n }\n\n case types.UPDATE_IS_MOBILE:\n return {\n ...state,\n isMobile: action.isMobile\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n addPlayerClass: (className: string) => ({ type: types.ADD_PLAYER_CLASS, className }),\n removePlayerClass: (className: string) => ({ type: types.REMOVE_PLAYER_CLASS, className }),\n updateIsMobile: (isMobile: boolean) => ({ type: types.UPDATE_IS_MOBILE, isMobile })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/shell.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/shell.js","//@flow\n\nexport const types = {\n TOGGLE_PLAY: 'play-pause/TOGGLE_PLAY'\n}\n\nexport const initialState = {\n isPlaying: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.TOGGLE_PLAY:\n return {\n ...state,\n isPlaying: action.isPlaying\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n toggleIsPlaying: (isPlaying: boolean) => ({ type: types.TOGGLE_PLAY, isPlaying })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/play-pause.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/play-pause.js","//@flow\n\nexport const types = {\n TOGGLE_SHARE_OVERLAY: 'share/TOGGLE_SHARE_OVERLAY'\n}\n\nexport const initialState = {\n overlayOpen: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.TOGGLE_SHARE_OVERLAY:\n return {\n ...state,\n overlayOpen: action.show\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n toggleShareOverlay: (show: boolean) => ({ type: types.TOGGLE_SHARE_OVERLAY, show })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/share.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/share.js","//@flow\n\nexport const types = {\n TOGGLE_CVAA_OVERLAY: 'share/TOGGLE_CVAA_OVERLAY'\n}\n\nexport const initialState = {\n overlayOpen: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.TOGGLE_CVAA_OVERLAY:\n return {\n ...state,\n overlayOpen: action.show\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n toggleCVAAOverlay: (show: boolean) => ({ type: types.TOGGLE_CVAA_OVERLAY, show })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/cvaa.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/cvaa.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;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\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// ../node_modules/process/browser.js\n// module id = 12\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/process/browser.js","import isPlainObject from 'lodash-es/isPlainObject';\nimport $$observable from 'symbol-observable';\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nexport var ActionTypes = {\n INIT: '@@redux/INIT'\n\n /**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n};export default function createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n function getState() {\n return currentState;\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected listener to be a function.');\n }\n\n var isSubscribed = true;\n\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n isSubscribed = false;\n\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer;\n dispatch({ type: ActionTypes.INIT });\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object') {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return { unsubscribe: unsubscribe };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch({ type: ActionTypes.INIT });\n\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/createStore.js\n// module id = 13\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/createStore.js","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\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 * 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) || baseGetTag(value) != objectTag) {\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' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/isPlainObject.js\n// module id = 14\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/isPlainObject.js","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_Symbol.js\n// module id = 15\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_Symbol.js","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/webpack/buildin/global.js\n// module id = 16\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/webpack/buildin/global.js","/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nexport default function compose() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(undefined, arguments));\n };\n });\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/compose.js\n// module id = 17\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/compose.js","//@flow\nexport const types = {\n UPDATE_PLAYER_STATE: 'engine/UPDATE_PLAYER_STATE',\n UPDATE_IS_PLAYING: 'engine/UPDATE_IS_PLAYING',\n UPDATE_CURRENT_TIME: 'engine/UPDATE_CURRENT_TIME',\n UPDATE_DURATION: 'engine/UPDATE_DURATION',\n UPDATE_VOLUME: 'engine/UPDATE_VOLUME',\n UPDATE_MUTED: 'engine/UPDATE_MUTED',\n UPDATE_METADATA_LOADING_STATUS: 'engine/UPDATE_METADATA_LOADING_STATUS',\n UPDATE_AUDIO_TRACKS: 'engine/UPDATE_AUDIO_TRACKS',\n UPDATE_VIDEO_TRACKS: 'engine/UPDATE_VIDEO_TRACKS',\n UPDATE_TEXT_TRACKS: 'engine/UPDATE_TEXT_TRACKS'\n}\n\nexport const initialState = {\n\tisPlaying: false,\n metadataLoaded: false,\n playerState: {\n previousState: '',\n currentState: ''\n },\n currentTime: 0,\n duration: 0,\n volume: 1,\n muted: false,\n videoTracks: [],\n audioTracks: [],\n textTracks: []\n}\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_PLAYER_STATE:\n return {\n ...state,\n playerState: action.playerState\n }\n\n case types.UPDATE_IS_PLAYING:\n return {\n ...state,\n isPlaying: action.isPlaying\n }\n\n case types.UPDATE_CURRENT_TIME:\n return {\n ...state,\n currentTime: action.currentTime\n }\n\n case types.UPDATE_DURATION:\n return {\n ...state,\n duration: action.duration\n }\n\n case types.UPDATE_VOLUME:\n return {\n ...state,\n volume: action.volume\n }\n\n case types.UPDATE_MUTED:\n return {\n ...state,\n muted: action.muted\n }\n\n case types.UPDATE_METADATA_LOADING_STATUS:\n return {\n ...state,\n metadataLoaded: action.metadataLoaded\n }\n\n case types.UPDATE_AUDIO_TRACKS:\n return {\n ...state,\n audioTracks: action.tracks\n }\n\n case types.UPDATE_VIDEO_TRACKS:\n return {\n ...state,\n videoTracks: action.tracks\n }\n\n case types.UPDATE_TEXT_TRACKS:\n return {\n ...state,\n textTracks: action.tracks\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updatePlayerState: (prevoiusState: string, currentState: string) => ({ type: types.UPDATE_PLAYER_STATE, playerState: {prevoiusState, currentState} }),\n updateIsPlaying: (isPlaying: boolean) => ({ type: types.UPDATE_IS_PLAYING, isPlaying }),\n updateCurrentTime: (currentTime: number) => ({ type: types.UPDATE_CURRENT_TIME, currentTime }),\n updateDuration: (duration: number) => ({ type: types.UPDATE_DURATION, duration }),\n updateVolume: (volume: number) => ({ type: types.UPDATE_VOLUME, volume }),\n updateMuted: (muted: boolean) => ({ type: types.UPDATE_MUTED, muted }),\n updateMetadataLoadingStatus: (metadataLoaded: boolean) => ({ type: types.UPDATE_METADATA_LOADING_STATUS, metadataLoaded }),\n updateAudioTracks: (tracks) => ({ type: types.UPDATE_AUDIO_TRACKS, tracks }),\n updateVideoTracks: (tracks) => ({ type: types.UPDATE_VIDEO_TRACKS, tracks }),\n updateTextTracks: (tracks) => ({ type: types.UPDATE_TEXT_TRACKS, tracks })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/engine.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/engine.js","//@flow\n\nexport const types = {\n UPDATE_SEEKBAR_DRAGGING_STATUS: 'seekbar/UPDATE_SEEKBAR_DRAGGING_STATUS',\n UPDATE_CURRENT_TIME: 'seekbar/UPDATE_CURRENT_TIME',\n UPDATE_DURATION: 'seekbar/UPDATE_DURATION'\n}\n\nexport const initialState = {\n\tcurrentTime: 0,\n duration: 0,\n draggingActive: false\n}\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_SEEKBAR_DRAGGING_STATUS:\n return {\n ...state,\n draggingActive: action.draggingActive\n }\n\n case types.UPDATE_CURRENT_TIME:\n return {\n ...state,\n currentTime: action.currentTime\n }\n\n case types.UPDATE_DURATION:\n return {\n ...state,\n duration: action.duration\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateSeekbarDraggingStatus: (draggingActive: boolean) => ({ type: types.UPDATE_SEEKBAR_DRAGGING_STATUS, draggingActive }),\n updateDuration: (duration: number) => ({ type: types.UPDATE_DURATION, duration }),\n updateCurrentTime: (currentTime: number) => ({ type: types.UPDATE_CURRENT_TIME, currentTime })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/seekbar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/seekbar.js","//@flow\n\nexport const types = {\n UPDATE_VOLUME: 'volume/UPDATE_VOLUME',\n UPDATE_VOLUME_DRAGGING_STATUS: 'volume/UPDATE_VOLUME_DRAGGING_STATUS',\n UPDATE_MUTED: 'volume/UPDATE_MUTED'\n}\n\nexport const initialState = {\n draggingActive: false,\n volume: 1,\n muted: false\n}\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_VOLUME:\n return {\n ...state,\n volume: action.volume\n }\n\n case types.UPDATE_VOLUME_DRAGGING_STATUS:\n return {\n ...state,\n draggingActive: action.draggingActive\n }\n\n case types.UPDATE_MUTED:\n return {\n ...state,\n muted: action.muted\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateVolume: (volume: number) => ({ type: types.UPDATE_VOLUME, volume }),\n updateVolumeDraggingStatus: (draggingActive: boolean) => ({ type: types.UPDATE_VOLUME_DRAGGING_STATUS, draggingActive }),\n updateMuted: (muted: boolean) => ({ type: types.UPDATE_MUTED, muted })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/volume.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/volume.js","//@flow\nexport const types = {\n UPDATE_FULLSCREEN: 'fullscreen/UPDATE_FULLSCREEN'\n}\n\nexport const initialState = {\n fullscreen: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_FULLSCREEN:\n return {\n ...state,\n fullscreen: action.fullscreen\n }\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateFullscreen: (fullscreen: boolean) => ({ type: types.UPDATE_FULLSCREEN, fullscreen })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/fullscreen.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/fullscreen.js","//@flow\n\nexport const types = {\n UPDATE_LOADING_SPINNER_STATE: 'loading/UPDATE_LOADING_SPINNER_STATE'\n}\n\nexport const initialState = {\n showLoadingSpinner: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_LOADING_SPINNER_STATE:\n return {\n ...state,\n show: action.show\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateLoadingSpinnerState: (show: boolean) => ({ type: types.UPDATE_LOADING_SPINNER_STATE, show })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/loading.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/loading.js","//@flow\n\nexport const types = {\n UPDATE_QUALITY: 'settings/UPDATE_QUALITY',\n UPDATE_SPEED: 'settings/UPDATE_SPEED'\n}\n\nexport const initialState = {\n quality: 1,\n speed: 2\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_QUALITY:\n return {\n ...state,\n quality: action.quality\n }\n\n case types.UPDATE_SPEED:\n return {\n ...state,\n speed: action.speed\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateQuality: (quality: string) => ({ type: types.UPDATE_QUALITY, quality }),\n updateSpeed: (speed: string) => ({ type: types.UPDATE_SPEED, speed })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/settings.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/settings.js","//@flow\n\nfunction toHHMMSS(input) {\n var sec_num = parseInt(input, 10);\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n var seconds = sec_num - (hours * 3600) - (minutes * 60);\n\n if (hours < 10) {hours = \"0\"+hours;}\n if (minutes < 10) {minutes = \"0\"+minutes;}\n if (seconds < 10) {seconds = \"0\"+seconds;}\n\n return `${minutes}:${seconds}`;\n}\n\nexport {toHHMMSS};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/time-format.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/time-format.js","//@flow\nimport { h, Component } from 'preact';\n\nclass SmartContainer extends Component {\n render(props) {\n return (\n <div className='smart-container top left'>\n {props.children}\n </div>\n )\n }\n}\n\nexport default SmartContainer;\n\n\n\n// WEBPACK FOOTER //\n// ./components/smart-container/smart-container.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/smart-container/smart-container.js","//@flow\nimport { h, Component } from 'preact';\nimport DropDownMenu from '../dropdown-menu/dropdown-menu';\n\nclass SmartContainer extends Component {\n render(props) {\n return (\n <div className='smart-container-item select-menu-item'>\n <label htmlFor='quality'>{props.label}</label>\n <DropDownMenu onSelect={o => props.onSelect(o)} options={props.options} />\n </div>\n )\n }\n}\n\nexport default SmartContainer;\n\n\n\n// WEBPACK FOOTER //\n// ./components/smart-container/smart-container-item.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/smart-container/smart-container-item.js","//@flow\nimport { h, Component } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/shell';\nimport Icon from '../icon/icon';\n\n@connect(null, bindActions(actions))\nclass Overlay extends Component {\n\n componentWillUnmount() {\n this.props.removePlayerClass('overlay-active');\n }\n\n componentWillMount() {\n this.props.addPlayerClass('overlay-active');\n }\n\n render(props) {\n var overlayClass = 'overlay';\n if (props.type) overlayClass += ` ${props.type}-overlay`;\n if (props.open) overlayClass += ' active'\n\n return (\n <div className={overlayClass} role='dialog'>\n <Localizer>\n <a onClick={() => props.onClose()} aria-label={<Text id='core.close' />} className='close-overlay'><Icon type='close' /></a>\n </Localizer>\n { props.children }\n </div>\n )\n }\n}\n\nexport default Overlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/overlay/overlay.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/overlay/overlay.js","//@flow\nimport {h, render} from 'preact';\nimport {Provider} from 'preact-redux';\nimport {IntlProvider} from 'preact-i18n';\nimport { createStore } from 'redux';\n\nimport reducer from './store';\nimport definition from './fr.json';\n\nimport EngineConnector from './components/engine-connector/engine-connector';\nimport Shell from './components/shell/shell';\nimport OverlayPlay from './components/overlay-play/overlay-play';\nimport Loading from './components/loading/loading';\nimport PlayPauseControl from './components/play-pause/play-pause';\nimport SeekBarControl from './components/seekbar/seekbar';\nimport VolumeControl from './components/volume/volume';\nimport ShareControl from './components/share/share'\nimport SettingsControl from './components/settings/settings';\nimport LanguageControl from './components/language/language';\nimport FullscreenControl from './components/fullscreen/fullscreen';\nimport TimeDisplay from './components/time-display/time-display';\nimport TopBar from './components/top-bar/top-bar';\nimport BottomBar from './components/bottom-bar/bottom-bar';\nimport ShareOverlay from './components/share-overlay/share-overlay';\nimport CVAAOverlay from './components/cvaa-overlay/cvaa-overlay';\nimport KeyboardControl from './components/keyboard';\n\nclass UIManager {\n player: any;\n config: any;\n\n constructor(player, config) {\n this.player = player;\n this.config = config;\n this.config.ui = {\n \"translations\": {\n \"controls\": {\n \"language\": \"שפה\"\n }\n },\n \"components\": {\n \"Loading\": {\n \"enabled\": true\n },\n \"OverlayPlay\": {\n \"enabled\": true\n }\n }\n }\n }\n\n buildCustomUI(template): void {\n this._buildUI(template);\n }\n\n buildDefaultUI(): void {\n const store = createStore(reducer, window.devToolsExtension && window.devToolsExtension({ name: `playkit #${this.config.target}`, instanceId: this.config.target }));\n\n let template = (\n <Provider store={store}>\n <IntlProvider definition={definition}>\n <Shell>\n <div className='player-holder' />\n <EngineConnector player={this.player} />\n <KeyboardControl player={this.player} />\n <Loading player={this.player} />\n <div className='player-gui'>\n <OverlayPlay player={this.player} />\n <TopBar>\n <div className='left-controls'>\n <div className='video-playing-title'>L21 Earth Time Lapse View from Space, ISS</div>\n </div>\n <div className='right-controls'>\n <ShareControl player={this.player} />\n </div>\n </TopBar>\n <BottomBar>\n <SeekBarControl showFramePreview showTimeBubble player={this.player} />\n <div className='left-controls'>\n <PlayPauseControl player={this.player} />\n <TimeDisplay format='current / total' player={this.player} />\n </div>\n <div className='right-controls'>\n <VolumeControl player={this.player} />\n <LanguageControl player={this.player} />\n <SettingsControl player={this.player} />\n <FullscreenControl player={this.player} />\n </div>\n </BottomBar>\n <ShareOverlay />\n <CVAAOverlay />\n </div>\n </Shell>\n </IntlProvider>\n </Provider>\n );\n this._buildUI(template);\n }\n\n _buildUI(template) {\n if (!this.player) return;\n\n let playerWrapper = document.createElement('div');\n document.body.appendChild(playerWrapper);\n render(template, playerWrapper);\n\n let playerElement = document.getElementsByTagName('video')[this.config.target === 'player1' ? 0 : 1];\n // let playerElement = document.getElementById(this.config.target); // the right way\n playerElement.removeAttribute('style');\n playerWrapper.getElementsByClassName('player-holder')[0].appendChild(playerElement);\n }\n\n release(): void { }\n\n}\n\nexport default UIManager;\n\n\n\n\n// WEBPACK FOOTER //\n// ./ui-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/ui-manager.js","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_baseGetTag.js\n// module id = 29\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_baseGetTag.js","import freeGlobal from './_freeGlobal.js';\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\nexport default root;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_root.js\n// module id = 30\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_root.js","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_freeGlobal.js\n// module id = 31\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_freeGlobal.js","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\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 nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_getRawTag.js\n// module id = 32\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_getRawTag.js","/** 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 nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_objectToString.js\n// module id = 33\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_objectToString.js","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_getPrototype.js\n// module id = 34\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_getPrototype.js","/**\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\nexport default overArg;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_overArg.js\n// module id = 35\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_overArg.js","/**\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 != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/isObjectLike.js\n// module id = 36\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/isObjectLike.js","module.exports = require('./lib/index');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/symbol-observable/index.js\n// module id = 37\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/symbol-observable/index.js","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _ponyfill = require('./ponyfill');\n\nvar _ponyfill2 = _interopRequireDefault(_ponyfill);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar root; /* global window */\n\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = (0, _ponyfill2['default'])(root);\nexports['default'] = result;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/symbol-observable/lib/index.js\n// module id = 38\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/symbol-observable/lib/index.js","module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tif(!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, \"loaded\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"id\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/webpack/buildin/module.js\n// module id = 39\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/webpack/buildin/module.js","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\nexports['default'] = symbolObservablePonyfill;\nfunction symbolObservablePonyfill(root) {\n\tvar result;\n\tvar _Symbol = root.Symbol;\n\n\tif (typeof _Symbol === 'function') {\n\t\tif (_Symbol.observable) {\n\t\t\tresult = _Symbol.observable;\n\t\t} else {\n\t\t\tresult = _Symbol('observable');\n\t\t\t_Symbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/symbol-observable/lib/ponyfill.js\n// module id = 40\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/symbol-observable/lib/ponyfill.js","import { ActionTypes } from './createStore';\nimport isPlainObject from 'lodash-es/isPlainObject';\nimport warning from './utils/warning';\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionName = actionType && '\"' + actionType.toString() + '\"' || 'an action';\n\n return 'Given action ' + actionName + ', reducer \"' + key + '\" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return 'The ' + argumentName + ' has unexpected type of \"' + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + '\". Expected argument to be an object with the following ' + ('keys: \"' + reducerKeys.join('\", \"') + '\"');\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n\n if (unexpectedKeys.length > 0) {\n return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('\"' + unexpectedKeys.join('\", \"') + '\" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('\"' + reducerKeys.join('\", \"') + '\". Unexpected keys will be ignored.');\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, { type: ActionTypes.INIT });\n\n if (typeof initialState === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');\n }\n\n var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');\n if (typeof reducer(undefined, { type: type }) === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined when probed with a random type. ' + ('Don\\'t try to handle ' + ActionTypes.INIT + ' or other actions in \"redux/*\" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');\n }\n });\n}\n\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\nexport default function combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning('No reducer provided for key \"' + key + '\"');\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n var finalReducerKeys = Object.keys(finalReducers);\n\n var unexpectedKeyCache = void 0;\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError = void 0;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments[1];\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n return hasChanged ? nextState : state;\n };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/combineReducers.js\n// module id = 41\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/combineReducers.js","import warning from './utils/warning';\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(undefined, arguments));\n };\n}\n\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass a single function as the first argument,\n * and get a function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\nexport default function bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?');\n }\n\n var keys = Object.keys(actionCreators);\n var boundActionCreators = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var actionCreator = actionCreators[key];\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n } else {\n warning('bindActionCreators expected a function actionCreator for key \\'' + key + '\\', instead received type \\'' + typeof actionCreator + '\\'.');\n }\n }\n return boundActionCreators;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/bindActionCreators.js\n// module id = 42\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/bindActionCreators.js","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nimport compose from './compose';\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\nexport default function applyMiddleware() {\n for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function (reducer, preloadedState, enhancer) {\n var store = createStore(reducer, preloadedState, enhancer);\n var _dispatch = store.dispatch;\n var chain = [];\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch(action) {\n return _dispatch(action);\n }\n };\n chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(undefined, chain)(store.dispatch);\n\n return _extends({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/applyMiddleware.js\n// module id = 43\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/applyMiddleware.js","!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):e.dlv=n()}(this,function(){function e(e,n,t,o){for(o=0,n=n.split?n.split(\".\"):n;e&&o<n.length;)e=e[n[o++]];return void 0===e?t:e}return e});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/dlv/dist/dlv.umd.js\n// module id = 44\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/dlv/dist/dlv.umd.js","//@flow\nimport { combineReducers } from 'redux';\nimport engine from './reducers/engine';\nimport shell from './reducers/shell';\nimport playPause from './reducers/play-pause';\nimport seekbar from './reducers/seekbar';\nimport volume from './reducers/volume';\nimport fullscreen from './reducers/fullscreen';\nimport loading from './reducers/loading';\nimport share from './reducers/share';\nimport cvaa from './reducers/cvaa';\nimport settings from './reducers/settings';\n\nconst reducer = combineReducers({\n engine,\n shell,\n seekbar,\n volume,\n fullscreen,\n loading,\n playPause,\n share,\n cvaa,\n settings\n});\n\nexport default reducer;\n\n\n\n// WEBPACK FOOTER //\n// ./store.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/store.js","module.exports = {\n\t\"core\": {\n\t\t\"disable\": \"Disable\",\n\t\t\"auto\": \"Auto\",\n\t\t\"close\": \"Close\"\n\t},\n\t\"controls\": {\n\t\t\"play\": \"Play\",\n\t\t\"pause\": \"Pause\",\n\t\t\"share\": \"Share\",\n\t\t\"language\": \"Language\",\n\t\t\"settings\": \"Settings\",\n\t\t\"fullscreen\": \"Fullscreen\"\n\t},\n\t\"settings\": {\n\t\t\"quality\": \"Quality\",\n\t\t\"speed\": \"Speed\"\n\t},\n\t\"language\": {\n\t\t\"audio\": \"Audio\",\n\t\t\"captions\": \"Captions\",\n\t\t\"advanced_captions_settings\": \"Advanced captions settings\"\n\t},\n\t\"share\": {\n\t\t\"share_title\": \"Share\",\n\t\t\"link_options\": \"Link options\"\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./fr.json\n// module id = 46\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/fr.json","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { default as reduce, actions } from '../../reducers/engine';\nimport BaseComponent from '../base';\n\n@connect(reduce, bindActions(actions))\nclass EngineConnector extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'EngineConnector', player: obj.player});\n }\n\n componentDidMount() {\n this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED, (e) => {\n this.props.updatePlayerState(e.payload.oldState.type, e.payload.newState.type);\n });\n\n this.player.addEventListener(this.player.Event.TIME_UPDATE, () => {\n this.props.updateCurrentTime(this.player.currentTime);\n });\n\n this.player.addEventListener(this.player.Event.LOADED_METADATA, () => {\n this.props.updateDuration(this.player.duration);\n this.props.updateMetadataLoadingStatus(true);\n\n const TrackType = this.player.Track;\n var tracks = this.player.getTracks();\n let audioTracks = tracks.filter(t => t.constructor.name === 'AudioTrack');\n let videoTracks = tracks.filter(t => t.constructor.name === 'VideoTrack');\n let textTracks = tracks.filter(t => t.constructor.name === 'TextTrack');\n\n this.props.updateAudioTracks(audioTracks);\n this.props.updateVideoTracks(videoTracks);\n this.props.updateTextTracks(textTracks);\n });\n\n this.player.addEventListener(this.player.Event.VOLUME_CHANGE, () => {\n this.props.updateVolume(this.player.volume);\n });\n\n this.player.addEventListener(this.player.Event.PLAY, () => {\n this.props.updateIsPlaying(true);\n });\n\n this.player.addEventListener(this.player.Event.PAUSE, () => {\n this.props.updateIsPlaying(false);\n });\n }\n\n shouldComponentUpdate() { return false; }\n\n render() {\n return <span />\n }\n}\n\nexport default EngineConnector;\n\n\n\n// WEBPACK FOOTER //\n// ./components/engine-connector/engine-connector.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/engine-connector/engine-connector.js","module.exports = __WEBPACK_EXTERNAL_MODULE_48__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}\n// module id = 48\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/ui/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","//@flow\nimport * as JsLogger from 'js-logger';\n\nconst LOG_LEVEL: { [level: string]: Object } = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nclass LoggerFactory {\n constructor(options?: Object) {\n JsLogger.useDefaults(options || {});\n }\n\n getLogger(name?: string) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n}\n\nconst lf = new LoggerFactory({defaultLevel: JsLogger.DEBUG});\n\nexport default lf;\nexport {LOG_LEVEL};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/logger.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/logger.js","/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (typeof define === 'function' && define.amd) {\r\n\t\tdefine(Logger);\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/js-logger/src/logger.js\n// module id = 50\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/js-logger/src/logger.js","//@flow\nimport { h } from 'preact';\nimport BaseComponent from '../base';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/shell';\nimport { isMobile } from '../../utils/is-mobile';\n\nconst mapStateToProps = state => ({\n metadataLoaded: state.engine.metadataLoaded,\n currentState: state.engine.playerState.currentState,\n playerClasses: state.shell.playerClasses,\n isMobile: state.shell.isMobile\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass Shell extends BaseComponent {\n constructor() {\n super({name: 'Shell'});\n }\n\n componentDidMount() {\n this.props.updateIsMobile(isMobile());\n }\n\n render(props) {\n var playerClasses = 'player skin-default';\n playerClasses += ` ${props.playerClasses.join(' ')}`;\n\n if (this.props.metadataLoaded) playerClasses += ` metadata-loaded`;\n if (this.props.metadataLoaded) playerClasses += ` state-${this.props.currentState}`;\n\n return (\n <div className={playerClasses}>\n { props.children }\n </div>\n )\n }\n}\n\nexport default Shell;\n\n\n\n// WEBPACK FOOTER //\n// ./components/shell/shell.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/shell/shell.js","//@flow\n\nfunction isMobile() {\n return typeof window.orientation !== \"undefined\" || navigator.userAgent.indexOf(\"IEMobile\") !== -1;\n}\n\nexport {isMobile}\n\n\n\n// WEBPACK FOOTER //\n// ./utils/is-mobile.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/is-mobile.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/play-pause';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n isPlaying: state.engine.isPlaying\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass OverlayPlay extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'OverlayPlay', player: obj.player});\n }\n\n togglePlayPause() {\n this.logger.debug('Toggle play');\n this.setState({animation: true});\n setTimeout(() => {\n this.setState({animation: false});\n }, 400);\n if (this.player.paused) {\n this.player.play();\n }\n else {\n this.player.pause();\n }\n }\n\n render(props) {\n return (\n <div className={`overlay-play ${this.state.animation ? 'in' : ''}`} onClick={() => this.togglePlayPause()}>\n { props.isPlaying ? <Icon type='play' /> : <Icon type='pause' /> }\n </div>\n )\n }\n}\n\nexport default OverlayPlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/overlay-play/overlay-play.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/overlay-play/overlay-play.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/loading';\nimport BaseComponent from '../base';\n\nconst mapStateToProps = state => ({\n show: state.loading.show\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass Loading extends BaseComponent {\n constructor(obj: IControlParams) {\n super({name: 'Loading', player: obj.player});\n }\n\n componentDidMount() {\n this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED, e => {\n if (e.payload.newState.type === 'idle' || e.payload.newState.type === 'playing' || e.payload.newState.type === 'paused') {\n this.props.updateLoadingSpinnerState(false);\n }\n else {\n this.props.updateLoadingSpinnerState(true);\n }\n });\n }\n\n render(props) {\n return (\n <div className={props.show ? 'loading-backdrop show' : 'loading-backdrop'}>\n <div className='spinner-container'>\n <div className='spinner'>\n {[...Array(8)].map(() => <span />)}\n </div>\n </div>\n </div>\n )\n }\n\n}\n\nexport default Loading;\n\n\n\n// WEBPACK FOOTER //\n// ./components/loading/loading.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/loading/loading.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/play-pause';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n isPlaying: state.engine.isPlaying\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass PlayPauseControl extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'PlayPause', player: obj.player});\n }\n\n togglePlayPause() {\n this.logger.debug('Toggle play');\n if (this.player.paused) {\n this.player.play();\n }\n else {\n this.player.pause();\n }\n }\n\n render() {\n var controlButtonClass = this.props.isPlaying ? 'control-button is-playing' : 'control-button';\n\n return (\n <div className='control-button-container control-play-pause'>\n <Localizer>\n <button aria-label={<Text id={this.props.isPlaying ? 'controls.pause' : 'controls.play'} />} className={controlButtonClass} onClick={() => this.togglePlayPause()}>\n <Icon type='play' />\n <Icon type='pause' />\n </button>\n </Localizer>\n </div>\n )\n }\n}\n\nexport default PlayPauseControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/play-pause/play-pause.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/play-pause/play-pause.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/seekbar';\nimport BaseComponent from '../base';\nimport { toHHMMSS } from '../../utils/time-format';\n\nconst mapStateToProps = state => ({\n virtualProgress: state.seekbar.virtualTime,\n currentTime: state.seekbar.currentTime,\n duration: state.engine.duration,\n isDraggingActive: state.seekbar.draggingActive\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass SeekBarControl extends BaseComponent {\n _seekBarElement: HTMLElement;\n _playerElement: HTMLElement;\n\n constructor(obj: IControlParams) {\n super({name: 'SeekBar', player: obj.player});\n }\n\n componentDidMount() {\n this._playerElement = document.getElementsByClassName('player')[0];\n this._seekBarElement = document.getElementsByClassName('seek-bar')[0];\n\n this.setState({virtualTime: 0});\n\n this.player.addEventListener(this.player.Event.TIME_UPDATE, () => {\n this.props.updateCurrentTime(this.player.currentTime);\n });\n }\n\n onSeekbarMouseDown = e => {\n this.props.updateSeekbarDraggingStatus(true);\n if (this.props.isDraggingActive) {\n let time = this.getTime(e);\n this.updateSeekBarProgress(time, this.player.duration);\n }\n }\n\n onSeekbarMouseUp = e => {\n let time = this.getTime(e);\n this.player.currentTime = time;\n this.updateSeekBarProgress(time, this.player.duration);\n this.props.updateSeekbarDraggingStatus(false);\n this.logger.debug(`Seek to ${time}s`);\n }\n\n onSeekbarMouseMove = e => {\n let time = this.getTime(e);\n this.updateSeekBarProgress(time, this.player.duration, true);\n\n if (this.props.isDraggingActive) {\n this.updateSeekBarProgress(time, this.player.duration);\n }\n }\n\n updateSeekBarProgress(currentTime: number, duration: number, virtual: boolean = false) {\n if (virtual) {\n this.setState({virtualTime: currentTime});\n }\n else {\n this.props.updateCurrentTime(currentTime);\n }\n }\n\n getTime(e: Event): Number {\n let time = this.player.duration * ((e.clientX - this._seekBarElement.offsetLeft - this._playerElement.offsetLeft) / this._seekBarElement.clientWidth);\n time = parseFloat(time.toFixed(2));\n if (time < 0) return 0;\n if (time > this.player.duration) return this.player.duration;\n return time;\n }\n\n getThumbSpriteOffset() {\n return - (Math.ceil(100 * this.state.virtualTime / this.player.duration) * 160) + 'px 0px';\n }\n\n render(props) {\n var virtualProgressWidth = `${this.state.virtualTime / props.duration * 100}%`;\n var progressWidth = `${props.currentTime / props.duration * 100}%`;\n var framePreviewStyle = 'background-image: url(http://cfvod.kaltura.com/p/1914121/sp/191412100/thumbnail/entry_id/1_fet8ffop/version/100001/width/160/vid_slices/100); ';\n framePreviewStyle += `background-position: ${this.getThumbSpriteOffset()}`\n\n return (\n <div className='seek-bar' role='slider'\n aria-label='Seek slider' aria-valuemin='0' aria-valuemax={Math.round(this.player.duration)} aria-valuenow={Math.round(this.player.currentTime)}\n aria-valuetext={`${toHHMMSS(this.player.currentTime)} of ${toHHMMSS(this.player.duration)}`}\n onMouseMove={e => this.onSeekbarMouseMove(e)} onMouseDown={e => this.onSeekbarMouseDown(e)} onMouseUp={e => this.onSeekbarMouseUp(e)}>\n <div className='progress-bar'>\n <div className='progress' style={{width: progressWidth}}>\n <a className='scrubber' />\n </div>\n <div className='virtual-progress' style={{width: virtualProgressWidth}}>\n {\n props.showFramePreview ?\n (<div className='frame-preview'>\n <div className='frame-preview-img' style={framePreviewStyle} />\n </div>) : ''\n }\n { this.props.showTimeBubble ? <div className='time-preview'>{ toHHMMSS(this.state.virtualTime)}</div> : '' }\n </div>\n <div className='buffered' style='width: 60%;' />\n </div>\n </div>\n )\n }\n\n}\nexport default SeekBarControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/seekbar/seekbar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/seekbar/seekbar.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/volume';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n isDraggingActive: state.volume.isDraggingActive,\n volume: state.volume.volume,\n muted: state.volume.muted,\n isMobile: state.shell.isMobile\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass VolumeControl extends BaseComponent {\n _volumeControlElement: HTMLElement;\n _volumeProgressBarElement: HTMLElement;\n\n constructor(obj: IControlParams) {\n super({name: 'Volume', player: obj.player});\n }\n\n componentDidMount() {\n this._volumeControlElement = document.getElementsByClassName('volume-control')[0];\n this._volumeProgressBarElement = this._volumeControlElement.getElementsByClassName('bar')[0];\n\n this.player.addEventListener(this.player.Event.LOADED_METADATA, () => {\n this.props.updateVolume(this.player.volume);\n })\n\n this.player.addEventListener(this.player.Event.VOLUME_CHANGE, () => {\n this.props.updateVolume(this.player.volume);\n });\n }\n\n getVolumeProgessHeight(): string {\n return this.props.muted ? '0%' : Math.round(this.props.volume * 100) + '%';\n }\n\n onVolumeProgressBarMouseDown() {\n this.props.updateVolumeDraggingStatus(true);\n }\n\n onVolumeProgressBarClick(e: Event) {\n this.changeVolume(e);\n }\n\n onVolumeControlButtonClick() {\n this.logger.debug(`Toggle mute. ${this.player.muted} => ${!this.player.muted}`);\n this.props.updateMuted(!this.props.muted);\n this.player.muted = !this.player.muted;\n }\n\n changeVolume(e: Event) {\n let barHeight = this._volumeProgressBarElement.clientHeight;\n let topY = this.getCoords(this._volumeProgressBarElement).top;\n let clickY = e.clientY;\n let volume = 1 - ((clickY - topY) / barHeight);\n volume = parseFloat(volume.toFixed(2));\n this.logger.debug(`Change volume from ${this.player.volume} => ${volume}`);\n this.player.volume = volume;\n if (this.props.muted) {\n this.player.muted = false;\n this.props.updateMuted(false);\n }\n }\n\n getCoords(el: HTMLElement): {top: number, left: number} {\n let box = el.getBoundingClientRect();\n\n return {\n top: box.top + pageYOffset,\n left: box.left + pageXOffset\n }\n }\n\n render() {\n var controlButtonClass = 'control-button-container volume-control';\n if (this.props.isDraggingActive) controlButtonClass += ' dragging-active';\n if (this.props.muted || this.props.volume === 0) controlButtonClass += ' is-muted';\n\n return (\n <div className={controlButtonClass}>\n <button className='control-button' onClick={() => this.onVolumeControlButtonClick()} aria-label='Volume'>\n <Icon type='volume-base' />\n <Icon type='volume-waves' />\n <Icon type='volume-mute' />\n </button>\n <div className='volume-control-bar' role='slider'\n aria-valuemin='0' aria-valuemaz='100' aria-valuenow={this.player.volume * 100}\n aria-valuetext={`${this.player.volume * 100}% volume ${this.player.muted ? 'muted' : ''}`}>\n <div className='bar' onMouseDown={() => this.onVolumeProgressBarMouseDown()} onClick={e => this.onVolumeProgressBarClick(e)}>\n <div className='progress' style={{height: this.getVolumeProgessHeight()}} />\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default VolumeControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/volume/volume.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/volume/volume.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/share';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n overlayOpen: state.share.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass ShareControl extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'Share', player: obj.player});\n }\n\n render(props) {\n return (\n <div className='control-button-container control-share'>\n <button className='control-button control-button-rounded' onClick={() => props.toggleShareOverlay(!props.overlayOpen)} aria-label='Share'>\n <Icon type='share' />\n </button>\n </div>\n )\n }\n}\n\nexport default ShareControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/share/share.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/share/share.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/settings';\nimport BaseComponent from '../base';\nimport SmartContainer from '../smart-container/smart-container';\nimport SmartContainerItem from '../smart-container/smart-container-item';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n videoTracks: state.engine.videoTracks\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass SettingsControl extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'Settings', player: obj.player});\n }\n\n componentDidMount() {\n this.setState({smartContainerOpen: false});\n }\n\n onControlButtonClick() {\n this.setState({smartContainerOpen: !this.state.smartContainerOpen});\n }\n\n onSpeedChange(o) {\n this.props.updateSpeed(o.value);\n }\n\n onQualityChange(o) {\n this.props.updateQuality(o.value);\n }\n\n render(props) {\n var speedOptions = [\n { value: 1, label: 'Auto (360)', active: true },\n { value: 2, label: '240' },\n { value: 3, label: '144' }\n ];\n var qualityOptions = props.videoTracks.map(t => ({ label: t.label || t.language, active: t.active, value: t }));\n\n return (\n <div className='control-button-container control-settings'>\n <Localizer>\n <button aria-label={<Text id='controls.settings' />} className={this.state.smartContainerOpen ? 'control-button active' : 'control-button'} onClick={() => this.onControlButtonClick()}>\n <Icon type='settings' />\n </button>\n </Localizer>\n { !this.state.smartContainerOpen ? '' :\n <SmartContainer>\n {\n props.videoTracks.length <= 0 ? '' :\n <Localizer>\n <SmartContainerItem label={<Text id='settings.quality' />} options={qualityOptions} onSelect={(o) => this.onQualityChange(o)} />\n </Localizer>\n }\n <Localizer>\n <SmartContainerItem label={<Text id='settings.speed' />} options={speedOptions} onSelect={(o) => this.onSpeedChange(o)} />\n </Localizer>\n </SmartContainer>\n }\n </div>\n )\n }\n}\n\nexport default SettingsControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/settings/settings.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/settings/settings.js","//@flow\nimport { h, Component } from 'preact';\nimport Icon from '../icon/icon';\n\nclass DropDownMenu extends Component {\n\n componentWillMount() {\n this.setState({dropMenuActive: false});\n }\n\n isSelected(o): boolean {\n return o.active;\n }\n\n onSelect(o) {\n this.props.onSelect(o.value);\n this.setState({dropMenuActive: false});\n }\n\n getActiveOptionLabel(): string {\n let activeOptions = this.props.options.filter(t => t.active);\n return activeOptions.length > 0 ? activeOptions[0].label : this.props.options[0].label;\n }\n\n render(props) {\n return (\n <div className='dropdown top left'>\n <div className='dropdown-button' onClick={() => this.setState({dropMenuActive: !this.state.dropMenuActive})}>\n {this.getActiveOptionLabel()}\n </div>\n {\n !this.state.dropMenuActive ? '' :\n <div className='dropdown-menu'>\n {\n props.options.map(o => (\n <div className={this.isSelected(o) ? 'dropdown-menu-item active' : 'dropdown-menu-item'} onClick={() => this.onSelect(o)}>\n <span>{o.label}</span>\n { this.isSelected(o) ? <Icon type='check' /> : '' }\n </div>\n ))\n }\n </div>\n }\n </div>\n )\n }\n}\n\nexport default DropDownMenu;\n\n\n\n// WEBPACK FOOTER //\n// ./components/dropdown-menu/dropdown-menu.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/dropdown-menu/dropdown-menu.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/cvaa';\nimport BaseComponent from '../base';\nimport SmartContainer from '../smart-container/smart-container';\nimport SmartContainerItem from '../smart-container/smart-container-item';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n audioTracks: state.engine.audioTracks,\n textTracks: state.engine.textTracks,\n overlayOpen: state.cvaa.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass LanguageControl extends BaseComponent {\n constructor(obj: IControlParams) {\n super({name: 'LanguageControl', player: obj.player});\n }\n\n componentDidMount() {\n this.setState({smartContainerOpen: false});\n }\n\n onControlButtonClick() {\n this.setState({smartContainerOpen: !this.state.smartContainerOpen});\n }\n\n onAudioChange(audioTrack) {\n // this.player.selectTrack(audioTrack);\n this.player._engine.selectTextTrack(audioTrack); // workaround untill bug fixed in playkit-js\n }\n\n onCaptionsChange(textTrack) {\n // this.player.selectTrack(textTrack);\n this.player._engine.selectTextTrack(textTrack); // workaround untill bug fixed in playkit-js\n }\n\n render(props) {\n var audioOptions = props.audioTracks.map(t => ({ label: t.label || t.language, active: t.active, value: t }));\n var textOptions = props.textTracks.map(t => ({ label: t.label || t.language, active: t.active, value: t }));\n\n return props.audioTracks.length === 0 && props.audioTracks.length === 0 ? false : (\n <div className='control-button-container control-language'>\n <Localizer>\n <button aria-label={<Text id='controls.language' />} className={this.state.smartContainerOpen ? 'control-button active' : 'control-button'} onClick={() => this.onControlButtonClick()}>\n <Icon type='language' />\n </button>\n </Localizer>\n { !this.state.smartContainerOpen ? '' :\n <SmartContainer>\n {\n props.audioTracks.length <= 0 ? '' :\n <Localizer>\n <SmartContainerItem label={<Text id='language.audio' />} options={audioOptions} onSelect={audioTrack => this.onAudioChange(audioTrack)} />\n </Localizer>\n }\n {\n props.textTracks.length <= 0 ? '' :\n <Localizer>\n <SmartContainerItem label={<Text id='language.captions' />} options={textOptions} onSelect={textTrack => this.onCaptionsChange(textTrack)} />\n </Localizer>\n }\n {\n props.textTracks.length <= 0 ? '' :\n <div className='smart-container-item'>\n <a onClick={() => props.toggleCVAAOverlay(!props.overlayOpen)}><Text id='language.advanced_captions_settings'>Advanced captions settings</Text></a>\n </div>\n }\n </SmartContainer>\n }\n </div>\n )\n }\n}\n\nexport default LanguageControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/language/language.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/language/language.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/fullscreen';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n fullscreen: state.fullscreen.fullscreen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass FullscreenControl extends BaseComponent {\n _playerElement: HTMLElement;\n\n constructor() {\n super({name: 'Fullscreen'});\n }\n\n componentDidMount() {\n this._playerElement = document.getElementsByClassName('player')[0];\n\n document.addEventListener('webkitfullscreenchange', () => {\n this.props.updateFullscreen(document.webkitIsFullScreen);\n });\n }\n\n enterFullscreen() {\n this._playerElement.webkitRequestFullscreen();\n }\n exitFullscreen() {\n document.webkitCancelFullScreen();\n }\n\n toggleFullscreen() {\n this.logger.debug(`Toggle fullscreen`);\n this.props.fullscreen ? this.exitFullscreen() : this.enterFullscreen();\n }\n\n render() {\n return (\n <div className='control-button-container control-fullscreen'>\n <Localizer>\n <button aria-label={<Text id='controls.fullscreen' />} className={this.props.fullscreen ? 'control-button is-fullscreen' : 'control-button'} onClick={() => this.toggleFullscreen()}>\n <Icon type='maximize' />\n <Icon type='minimize' />\n </button>\n </Localizer>\n </div>\n )\n }\n}\n\nexport default FullscreenControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/fullscreen/fullscreen.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/fullscreen/fullscreen.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport BaseComponent from '../base';\nimport { toHHMMSS } from '../../utils/time-format';\n\nconst mapStateToProps = state => ({\n currentTime: state.seekbar.currentTime,\n duration: state.engine.duration\n});\n\n@connect(mapStateToProps)\nclass TimeDisplay extends BaseComponent {\n constructor(obj: IControlParams) {\n super({name: 'TimeDisplay', player: obj.player, config: obj.config});\n }\n\n getTimeDisplay(): string {\n var result = this.props.format ? this.props.format : 'current / total',\n current = toHHMMSS(this.props.currentTime),\n total = toHHMMSS(this.props.duration),\n left = toHHMMSS(this.props.duration - this.props.currentTime);\n\n result = result.replace(/current/g, current);\n result = result.replace(/total/g, total);\n result = result.replace(/left/g, left);\n\n return result;\n }\n\n render() {\n return (\n <div className='time-display'>\n <span>{this.getTimeDisplay()}</span>\n </div>\n )\n }\n}\n\nexport default TimeDisplay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/time-display/time-display.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/time-display/time-display.js","import { h, Component } from 'preact';\n\nclass TopBar extends Component {\n render(props) {\n return (\n <div className='top-bar'>{ props.children }</div>\n )\n }\n}\n\nexport default TopBar;\n\n\n\n// WEBPACK FOOTER //\n// ./components/top-bar/top-bar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/top-bar/top-bar.js","import { h, Component } from 'preact';\n\nclass BottomBar extends Component {\n render(props) {\n return (\n <div className='bottom-bar'>{ props.children }</div>\n )\n }\n}\n\nexport default BottomBar;\n\n\n\n// WEBPACK FOOTER //\n// ./components/bottom-bar/bottom-bar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/bottom-bar/bottom-bar.js","//@flow\nimport { h } from 'preact';\nimport { Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/share';\nimport BaseComponent from '../base';\nimport Overlay from '../overlay/overlay';\n\nconst mapStateToProps = state => ({\n open: state.share.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass ShareOverlay extends BaseComponent {\n constructor() {\n super({name: 'ShareOverlay'});\n }\n\n render(props) {\n return !props.open ? '' : (\n <Overlay open={props.open} onClose={() => props.toggleShareOverlay(false)} type='share'>\n <div className='title'>\n <Text id='share.share_title' />\n </div>\n <div className='share-icons'>\n <a className='share-btn facebook-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M432 405.333h-80v106.667h80v320h133.333v-320h97.12l9.547-106.667h-106.667v-44.453c0-25.467 5.12-35.547 29.733-35.547h76.933v-133.333h-101.547c-95.893 0-138.453 42.213-138.453 123.067v90.267z' />\n </svg>\n </a>\n <a className='share-btn twitter-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M832 316.614c-23.547 10.29-48.853 17.221-75.413 20.345 27.12-15.987 47.947-41.319 57.733-71.508-25.36 14.806-53.467 25.568-83.387 31.37-23.92-25.122-58.080-40.82-95.84-40.82-84.773 0-147.067 77.861-127.92 158.687-109.093-5.381-205.84-56.833-270.613-135.035-34.4 58.094-17.84 134.090 40.613 172.574-21.493-0.683-41.76-6.484-59.44-16.171-1.44 59.879 42.16 115.898 105.307 128.368-18.48 4.935-38.72 6.090-59.307 2.205 16.693 51.347 65.173 88.702 122.667 89.752-55.2 42.605-124.747 61.637-194.4 53.552 58.107 36.673 127.147 58.067 201.28 58.067 243.787 0 381.52-202.684 373.2-384.473 25.653-18.244 47.92-41.004 65.52-66.914v0z' />\n </svg>\n </a>\n <a className='share-btn google-plus-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M352 556.8h127.040c-5.12 32.928-38.4 96.64-127.040 96.64-76.48 0-138.88-63.328-138.88-141.44 0-78.080 62.4-141.44 138.88-141.44 43.52 0 72.64 18.56 89.28 34.56l60.8-58.56c-39.040-36.48-89.6-58.56-150.080-58.56-123.84 0-224 100.16-224 224s100.16 224 224 224c129.28 0 215.072-90.88 215.072-218.88 0-14.72-1.632-25.92-3.552-37.12h-211.52v76.8zM800 544v96h-64v-96h-96v-64h96v-96h64v96h96v64h-96z' />\n </svg>\n </a>\n <a className='share-btn linkedin-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M324.8 290.087c0 36.506-29.6 66.087-66.133 66.087s-66.133-29.581-66.133-66.087c0-36.48 29.6-66.087 66.133-66.087s66.133 29.607 66.133 66.087zM325.333 409.043h-133.333v422.957h133.333v-422.957zM538.187 409.043h-132.48v422.957h132.507v-222.026c0-123.45 160.773-133.549 160.773 0v222.026h133.013v-267.811c0-208.306-237.92-200.719-293.813-98.179v-56.967z' />\n </svg>\n </a>\n <a className='share-btn email-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M256 768c-35.346 0-64-28.654-64-64v-352c0-35.346 28.654-64 64-64h512c35.346 0 64 28.654 64 64v352c0 35.346-28.654 64-64 64h-512zM512 467.488l147.52-115.488h-295.040l147.52 115.488zM748.48 352l-211.2 179.2c-0.713 1.308-1.572 2.532-2.56 3.648-12.707 12.158-32.733 12.158-45.44 0-0.988-1.116-1.847-2.34-2.56-3.648l-211.2-179.2h-19.52v352h512v-352h-19.52z' />\n </svg>\n </a>\n <a className='share-btn embed-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M377.989 579.335c12.669 12.904 12.669 33.777 0 46.68-12.733 12.969-33.427 12.969-46.16 0l-104.727-106.667c-12.669-12.904-12.669-33.777 0-46.68l104.727-106.667c12.733-12.969 33.427-12.969 46.16 0 12.669 12.904 12.669 33.777 0 46.68l-81.812 83.327 81.812 83.327zM646.011 412.68c-12.669-12.904-12.669-33.777 0-46.68 12.733-12.969 33.427-12.969 46.16 0l104.727 106.667c12.669 12.904 12.669 33.777 0 46.68l-104.727 106.667c-12.733 12.969-33.427 12.969-46.16 0-12.669-12.904-12.669-33.777 0-46.68l81.812-83.327-81.812-83.327zM572.293 250.6c17.455 4.445 28.025 22.388 23.686 40.066l-104.727 426.669c-4.349 17.719-22.048 28.535-39.545 24.079-17.455-4.445-28.025-22.388-23.686-40.066l104.727-426.669c4.349-17.719 22.048-28.535 39.545-24.079z' />\n </svg>\n </a>\n </div>\n <div>\n <div className='form-group has-icon' style='width: 300px;'>\n <input type='text' placeholder='Share URL' className='form-control' value='https://cdnapisec.kaltura.com/index.php?assetId=123456' readOnly />\n <svg className='icon' style='width:32px;height:32px;' viewBox='0 0 1024 1024'>\n <path d='M355.028 445.537c12.497 12.497 12.497 32.758 0 45.255s-32.758 12.497-45.255 0l-24.141-24.141c-49.92-49.92-49.832-130.999 0.094-180.925 49.984-49.984 130.995-50.025 180.955-0.064l113.266 113.266c49.964 49.964 49.935 130.955-0.064 180.955-12.497 12.497-32.758 12.497-45.255 0s-12.497-32.758 0-45.255c25.013-25.013 25.027-65.482 0.064-90.445l-113.266-113.266c-24.957-24.957-65.445-24.936-90.445 0.064-24.955 24.955-24.998 65.511-0.094 90.416l24.141 24.141zM668.972 578.463c-12.497-12.497-12.497-32.758 0-45.255s32.758-12.497 45.255 0l24.141 24.141c49.92 49.92 49.832 130.999-0.094 180.925-49.984 49.984-130.995 50.025-180.955 0.064l-113.266-113.266c-49.964-49.964-49.935-130.955 0.064-180.955 12.497-12.497 32.758-12.497 45.255 0s12.497 32.758 0 45.255c-25.013 25.013-25.027 65.482-0.064 90.445l113.266 113.266c24.957 24.957 65.445 24.936 90.445-0.064 24.955-24.955 24.998-65.511 0.094-90.416l-24.141-24.141z' />\n </svg>\n </div>\n </div>\n <a><Text id='share.link_options' /></a>\n </Overlay>\n )\n }\n}\n\nexport default ShareOverlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/share-overlay/share-overlay.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/share-overlay/share-overlay.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/cvaa';\nimport BaseComponent from '../base';\nimport Overlay from '../overlay/overlay';\n\nconst mapStateToProps = state => ({\n open: state.cvaa.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass CVAAOverlay extends BaseComponent {\n constructor() {\n super({name: 'CVAAOverlay'});\n }\n\n render(props) {\n return !props.open ? '' : (\n <Overlay open={props.open} onClose={() => props.toggleCVAAOverlay(false)} type='cvaa'>\n <div className='title'>\n Advanced captions settings\n </div>\n <div>\n <div className='sample'>Sample</div>\n <div className='sample black-bg'>Sample</div>\n <div className='sample yellow-text'>Sample</div>\n </div>\n <a className='button-save-cvaa'>Set custom caption</a>\n </Overlay>\n )\n }\n}\n\nexport default CVAAOverlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/cvaa-overlay/cvaa-overlay.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/cvaa-overlay/cvaa-overlay.js","//@flow\nimport BaseComponent from './base';\n\nclass KeyboardControl extends BaseComponent {\n // _playerElement: HTMLElement;\n\n constructor(obj: IControlParams) {\n super({name: 'Keyboard', player: obj.player});\n\n // this._playerElement = document.getElementsByClassName('player')[0];\n\n document.body.onkeydown = (e) => {\n let time, newVolume;\n switch(e.which) {\n case 32: // space\n this.logger.debug(\"Keydown space\");\n this.player.paused ? this.player.play() : this.player.pause();\n break;\n\n case 38: // up\n this.logger.debug(\"Keydown up\");\n newVolume = Math.round(this.player.volume * 100) + 5;\n this.logger.debug(`Changing volume. ${this.player.volume} => ${newVolume}`);\n if (this.player.muted) {\n this.player.muted = false;\n }\n this.player.volume = newVolume / 100;\n break;\n\n case 40: // down\n this.logger.debug(\"Keydown down\");\n newVolume = Math.round(this.player.volume * 100) - 5;\n if (newVolume < 5) {\n this.player.muted = true;\n return;\n }\n this.logger.debug(`Changing volume. ${this.player.volume} => ${newVolume}`);\n this.player.volume = newVolume / 100;\n break;\n\n case 37: // left\n this.logger.debug(\"Keydown left\");\n time = (this.player.currentTime - 5) > 0 ? this.player.currentTime - 5 : 0;\n this.player.currentTime = time;\n break;\n\n case 39: // right\n this.logger.debug(\"Keydown right\");\n time = (this.player.currentTime + 5) > this.player.duration ? this.player.duration : this.player.currentTime + 5;\n this.player.currentTime = time;\n break;\n\n default: return;\n }\n }\n\n this.disableKeyboardCommandsOnControls();\n }\n\n disableKeyboardCommandsOnControls() {\n let controlButtonsElements = Array.from(document.getElementsByClassName('control-button'));\n controlButtonsElements.forEach((element) => {\n element.onkeydown = (e) => e.preventDefault();\n });\n }\n}\n\nexport default KeyboardControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/keyboard.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/keyboard.js","// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!../../../css-loader/index.js!./style.css\");\nif(typeof content === 'string') content = [[module.id, content, '']];\n// Prepare cssTransformation\nvar transform;\n\nvar options = {}\noptions.transform = transform\n// add the styles to the DOM\nvar update = require(\"!../../../style-loader/lib/addStyles.js\")(content, options);\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(module.hot) {\n\t// When the styles change, update the <style> tags\n\tif(!content.locals) {\n\t\tmodule.hot.accept(\"!!../../../css-loader/index.js!./style.css\", function() {\n\t\t\tvar newContent = require(\"!!../../../css-loader/index.js!./style.css\");\n\t\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\t\t\tupdate(newContent);\n\t\t});\n\t}\n\t// When the module is disposed, remove the <style> tags\n\tmodule.hot.dispose(function() { update(); });\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/playkit-js-ui/src/styles/style.css\n// module id = 4\n// module chunks = 0","exports = module.exports = require(\"../../../css-loader/lib/css-base.js\")(undefined);\n// imports\n\n\n// module\nexports.push([module.id, \".row{display:block}.row:after{content:'';clear:both;display:block}.form-group{margin:10px auto;position:relative;max-width:100%}.form-group.has-error .form-control{border-color:#db1f26}.form-group.has-error .form-control:focus{border-color:#fff}.form-group.has-icon .form-control{padding-left:34px}.form-group .icon{position:absolute;top:2px;left:2px;fill:rgba(255,255,255,0.4)}.form-control{height:36px;width:100%;min-width:72px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(0,0,0,0.4);font-size:15px;line-height:18px;color:#fff;padding:8px 10px;text-overflow:ellipsis}.form-control::-webkit-input-placeholder{color:rgba(255,255,255,0.6)}.form-control:focus{background-color:#fff;border-color:#fff;color:#333}.form-control:focus::-webkit-input-placeholder{color:#ccc}.form-control:focus+.icon{fill:#999}textarea.form-control{min-height:72px}@-webkit-keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.dropdown{position:relative}.dropdown.active .dropdown-menu{display:block;opacity:1}.dropdown.top .dropdown-menu{margin-bottom:10px;bottom:100%}.dropdown.bottom .dropdown-menu{margin-top:10px;top:100%}.dropdown.right .dropdown-menu{left:0}.dropdown.left .dropdown-menu{right:0}.dropdown .dropdown-button{font-size:15px;font-weight:bold;line-height:18px;color:#fff;cursor:pointer}.dropdown .dropdown-menu{display:block;opacity:1;position:absolute;background-color:#333333;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;padding:6px 0;z-index:5;-webkit-animation:openDropmenu 100ms ease-out forwards;animation:openDropmenu 100ms ease-out forwards;max-height:173px;overflow-y:auto}.dropdown .dropdown-menu .dropdown-menu-item{padding:2px 10px 2px 16px;white-space:nowrap;min-height:30px;cursor:pointer}.dropdown .dropdown-menu .dropdown-menu-item:hover{color:#fff}.dropdown .dropdown-menu .dropdown-menu-item.active{color:#01ACCD;fill:#01ACCD}.dropdown .dropdown-menu .dropdown-menu-item .check-icon{display:inline-block;margin-left:16px;vertical-align:middle;width:24px;height:24px}.dropdown .dropdown-menu .dropdown-menu-item span{vertical-align:middle;line-height:26px}.tooltip{display:inline-block;height:22px;border-radius:4px;background-color:#FFFFFF;padding:3px 13px;color:#333333;font-size:13px;font-weight:bold;line-height:16px;box-shadow:0 0 8px 0 rgba(0,0,0,0.3)}.player .control-button{width:32px;height:32px;background:transparent;display:inline-block;opacity:0.8;border:none;padding:0;cursor:pointer;fill:#fff}.player .control-button svg{width:32px;height:32px}.player .control-button:hover,.player .control-button.active{opacity:1}.player .control-button.control-button-rounded{width:36px;height:36px;padding:2px}.player .control-button.control-button-rounded:hover{background-color:rgba(0,0,0,0.4);border-radius:18px}.player .control-button-container{display:inline-block;position:relative;vertical-align:top}a{color:#01ACCD;text-decoration:underline;font-size:15px;line-height:18px}a:hover{color:#01819a}a:active{opacity:0.7}.player{position:relative;max-width:854px;width:100%;background-color:#000;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.player:-webkit-full-screen{width:100%;height:100%;max-width:none}.player *{box-sizing:border-box;outline:none}.player ::-moz-selection{background-color:rgba(0,0,0,0.1)}.player ::selection{background-color:rgba(0,0,0,0.1)}.player video{width:100%}.player .player-gui{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;overflow:hidden;font-size:0;font-family:\\\"Lato\\\",sans-serif}.player .player-gui input,.player .player-gui textarea{font-family:\\\"Lato\\\",sans-serif}.player.metadata-loaded .player-gui,.player.state-paused .player-gui,.player.overlay-active .player-gui,.player.menu-active .player-gui{opacity:1}video::-webkit-media-controls{display:none !important}video::-webkit-media-controls-start-playback-button{display:none !important;-webkit-appearance:none}video::cue{background-color:transparent}.player.captions-yellow-text video::cue{color:#FAFF00}.player.captions-black-bg video::cue{background-color:#000}@-webkit-keyframes openOverlay{from{opacity:0}to{opacity:1}}@keyframes openOverlay{from{opacity:0}to{opacity:1}}.overlay{position:absolute;display:none;opacity:0;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.42);z-index:4;text-align:center;color:#fff;padding:80px 20px 0;-webkit-animation:openOverlay 100ms ease-in-out forwards;animation:openOverlay 100ms ease-in-out forwards}.overlay.active{display:block;opacity:1}.overlay .title{font-size:24px;font-weight:bold;line-height:29px;margin-bottom:60px}.overlay .close-overlay{position:absolute;top:48px;right:48px;z-index:5;fill:#fff;cursor:pointer}.overlay .close-overlay .icon-close{width:24px;height:24px}@media screen and (max-width: 768px){.overlay{padding:36px 20px 0}.overlay .close-overlay{top:38px}.overlay .title{margin-bottom:24px}}@media screen and (max-width: 480px){.overlay{padding:16px 24px 0}.overlay .close-overlay{top:15px;right:24px}.overlay .title{font-size:16px;line-height:19px;margin-bottom:36px}}@-webkit-keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.smart-container{background-color:#222222;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;position:absolute;right:0px;min-width:193px;font-size:15px;z-index:5;display:block;-webkit-animation:openSmartContainer 100ms ease-out forwards;animation:openSmartContainer 100ms ease-out forwards}.smart-container.top{bottom:100%;margin-bottom:6px}.smart-container.top:before{display:block;content:' ';position:absolute;bottom:-6px;left:0;width:100%;height:6px}.smart-container.bottom{top:100%;margin-top:6px}.smart-container.right{left:0px}.smart-container.left{right:0px}.smart-container .smart-container-item{margin:16px;color:rgba(244,244,244,0.8);white-space:nowrap}.smart-container .smart-container-item:after{display:block;content:' ';clear:both}.smart-container .smart-container-item.select-menu-item label{float:left}.smart-container .smart-container-item.select-menu-item .dropdown{float:right}.overlay.share-overlay .share-icons{margin:60px 0}.overlay.share-overlay .share-btn{height:36px;width:36px;border-radius:18px;background-color:rgba(0,0,0,0.4);display:inline-block;margin:0 8px;-webkit-transition:-webkit-transform 100ms;transition:transform 100ms;will-change:transform;padding:2px}.overlay.share-overlay .share-btn:hover{-webkit-transform:scale(1.1667);-ms-transform:scale(1.1667);transform:scale(1.1667)}.overlay.share-overlay .share-btn.facebook-share-btn{background-color:#3B5998}.overlay.share-overlay .share-btn.twitter-share-btn{background-color:#1DA1F2}.overlay.share-overlay .share-btn.google-plus-share-btn{background-color:#DD4B39}.overlay.share-overlay .share-btn.linkedin-share-btn{background-color:#00A0DC}@media screen and (max-width: 768px){.overlay.share-overlay .share-icons{margin:40px 0}}@media screen and (max-width: 480px){.overlay.share-overlay .share-icons{margin:20px 0}}.overlay.cvaa-overlay .sample{border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:36px;text-align:center;padding:0 31px;display:inline-block;margin:0 12px;cursor:pointer}.overlay.cvaa-overlay .sample.black-bg{background-color:#000}.overlay.cvaa-overlay .sample.yellow-text{color:#FAFF00}.overlay.cvaa-overlay .button-save-cvaa{margin-top:50px;height:40px;width:400px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:38px;text-align:center;display:inline-block;color:#fff;text-decoration:none;cursor:pointer}@-webkit-keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}@keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}.loading-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.3);-webkit-transition:100ms opacity;transition:100ms opacity;opacity:0}.loading-backdrop.show{opacity:1}.loading-backdrop.show .spinner-container{display:block}.loading-backdrop .spinner-container{display:none;position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50px, -50px, 0);transform:translate3d(-50px, -50px, 0)}.spinner{width:100px;height:100px;position:relative;-webkit-animation:kaltura-spinner 2.5s infinite;animation:kaltura-spinner 2.5s infinite}.spinner span{width:8px;height:8px;background-color:#fff;display:block;border-radius:8px;position:absolute;top:50%;left:50%;margin-top:-4px;margin-left:-4px}.spinner span:nth-child(1){-webkit-transform:rotate(45deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(45deg) translateX(-25px) translateY(-25px);transform:rotate(45deg) translateX(-25px) translateY(-25px);background-color:#da1f26}.spinner span:nth-child(2){-webkit-transform:rotate(90deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(90deg) translateX(-25px) translateY(-25px);transform:rotate(90deg) translateX(-25px) translateY(-25px);background-color:#06a885}.spinner span:nth-child(3){-webkit-transform:rotate(135deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(135deg) translateX(-25px) translateY(-25px);transform:rotate(135deg) translateX(-25px) translateY(-25px);background-color:#009344}.spinner span:nth-child(4){-webkit-transform:rotate(180deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(180deg) translateX(-25px) translateY(-25px);transform:rotate(180deg) translateX(-25px) translateY(-25px);background-color:#f8a61a}.spinner span:nth-child(5){-webkit-transform:rotate(225deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(225deg) translateX(-25px) translateY(-25px);transform:rotate(225deg) translateX(-25px) translateY(-25px);background-color:#1b4a97}.spinner span:nth-child(6){-webkit-transform:rotate(270deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(270deg) translateX(-25px) translateY(-25px);transform:rotate(270deg) translateX(-25px) translateY(-25px);background-color:#00abcc}.spinner span:nth-child(7){-webkit-transform:rotate(315deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(315deg) translateX(-25px) translateY(-25px);transform:rotate(315deg) translateX(-25px) translateY(-25px);background-color:#b1d238}.spinner span:nth-child(8){-webkit-transform:rotate(360deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(360deg) translateX(-25px) translateY(-25px);transform:rotate(360deg) translateX(-25px) translateY(-25px);background-color:#fcd203}.control-button-container.control-play-pause .control-button{-webkit-transition:400ms -webkit-transform;transition:400ms transform}.control-button-container.control-play-pause .control-button .icon-pause{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:0;display:none}.control-button-container.control-play-pause .control-button .icon-play{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}.control-button-container.control-play-pause .control-button.is-playing .icon-pause{opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing .icon-play{opacity:0;display:none}@media screen and (max-width: 480px){.control-button-container.control-play-pause{display:none}}.control-button-container.volume-control:hover .volume-control-bar{display:block !important}.control-button-container.volume-control.is-muted .volume-waves{opacity:0;-webkit-transform:translateX(-5px);-ms-transform:translateX(-5px);transform:translateX(-5px)}.control-button-container.volume-control.is-muted .volume-mute{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.volume-control.dragging-active .volume-control-bar{display:block}.control-button-container.volume-control .volume-waves{-webkit-transform:translateX(0px);-ms-transform:translateX(0px);transform:translateX(0px)}.control-button-container.volume-control .volume-mute{opacity:1;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.control-button-container.volume-control .volume-waves,.control-button-container.volume-control .volume-mute{-webkit-transition:300ms -webkit-transform, 300ms opacity;transition:300ms transform, 300ms opacity}.control-button-container.volume-control svg{position:absolute;top:0;left:0}.volume-control-bar{position:absolute;z-index:2;bottom:38px;left:0px;display:block;height:112px;width:34px;border-radius:4px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);background-color:#333333;padding:6px;display:none}.volume-control-bar:before{position:absolute;width:34px;height:14px;bottom:-8px;left:0;content:' ';display:block}.volume-control-bar .bar{background-color:#424242;height:100%;position:relative;cursor:ns-resize}.volume-control-bar .progress{position:absolute;bottom:0px;left:0px;width:100%;border-radius:0 0 2px 2px;background-color:#01ACCD}.control-button-container.control-fullscreen .control-button{-webkit-transition:100ms -webkit-transform;transition:100ms transform;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.control-fullscreen .control-button .icon-minimize{display:none}.control-button-container.control-fullscreen .control-button:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-maximize{display:none}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-minimize{display:block}.player .seek-bar{padding:6px 0;cursor:pointer}.player .seek-bar:hover .progress-bar .scrubber,.player .seek-bar.dragging-active .progress-bar .scrubber{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.player .seek-bar:hover .progress-bar .virtual-progress,.player .seek-bar.dragging-active .progress-bar .virtual-progress{display:block}.player .seek-bar .progress-bar{height:4px;background-color:rgba(255,255,255,0.3);border-radius:2px;position:relative}.player .seek-bar .progress-bar .progress{position:absolute;top:0;left:0;height:100%;z-index:2;border-radius:2px 0 0 2px;background-color:#01ACCD}.player .seek-bar .progress-bar .virtual-progress{display:none}.player .seek-bar .progress-bar .buffered,.player .seek-bar .progress-bar .virtual-progress{position:absolute;top:0;left:0;height:100%;z-index:1;border-radius:2px 0 0 2px;background-color:rgba(255,255,255,0.3)}.player .seek-bar .progress-bar .buffered .frame-preview-img,.player .seek-bar .progress-bar .virtual-progress .frame-preview-img{background-size:auto 100%;width:100%;height:100%;position:relative}.player .seek-bar .progress-bar .buffered .frame-preview,.player .seek-bar .progress-bar .virtual-progress .frame-preview{position:absolute;bottom:16px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:94px;width:164px;border:2px solid rgba(255,255,255,0.2);border-radius:4px}.player .seek-bar .progress-bar .buffered .time-preview,.player .seek-bar .progress-bar .virtual-progress .time-preview{position:absolute;bottom:22px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:22px;min-width:48px;padding:0 3px;text-align:center;border-radius:3px;background-color:rgba(0,0,0,0.7);font-size:13px;font-weight:bold;line-height:22px;color:#fff}.player .seek-bar .progress-bar .scrubber{position:absolute;z-index:3;cursor:pointer;display:block;top:-6px;right:-8px;border-radius:8px;height:16px;width:16px;background-color:#FFFFFF;box-shadow:0 0 31px 0 rgba(0,0,0,0.3);-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:100ms -webkit-transform;transition:100ms transform}.player .seek-bar .progress-bar .scrubber:active{opacity:1;cursor:-webkit-grabbing;cursor:grabbing}@media screen and (max-width: 480px){.virtual-progress{display:none}}.player .time-display{display:inline-block;line-height:32px;vertical-align:top;font-size:14px;padding:0 23px;font-weight:bold}@media screen and (max-width: 480px){.player .time-display{padding:0 12px 0 0}}.player .video-playing-title{font-size:15px;font-weight:bold;line-height:18px;padding:6px 0}.player .bottom-bar{position:absolute;bottom:0;left:0;width:100%;background:-webkit-linear-gradient(270deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:6px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .bottom-bar .left-controls{float:left;text-align:left}.player .bottom-bar .right-controls{float:right;text-align:left}.player .bottom-bar .right-controls .control-button-container{margin:0 6px}.player .bottom-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .bottom-bar,.player.hover .bottom-bar,.player.state-paused .bottom-bar,.player.menu-active .bottom-bar{opacity:1}.player.overlay-active .bottom-bar{opacity:0}@media screen and (max-width: 480px){.player .bottom-bar{padding:6px 8px}}.player .top-bar{position:absolute;top:0;left:0;width:100%;background:-webkit-linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(0deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:14px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .top-bar .left-controls{float:left;text-align:left}.player .top-bar .right-controls{float:right;text-align:left}.player .top-bar .right-controls .control-button-container{margin:0 6px}.player .top-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .top-bar,.player.hover .top-bar,.player.state-paused .top-bar,.player.menu-active .top-bar{opacity:1}.player.overlay-active .top-bar{opacity:0}@media screen and (max-width: 480px){.player .top-bar{padding:8px 8px 20px 8px}}@-webkit-keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}@keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}.overlay-play{position:absolute;top:0;left:0;width:100%;height:100%}.overlay-play.in .icon{-webkit-animation:overlayPlayIconIn 400ms linear forwards;animation:overlayPlayIconIn 400ms linear forwards}.overlay-play .icon{width:144px;height:144px;fill:#fff;position:absolute;top:50%;left:50%;margin:-72px 0 0 -72px;opacity:0}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/css-loader!../node_modules/playkit-js-ui/src/styles/style.css\n// module id = 5\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/css-loader/lib/css-base.js\n// module id = 6\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tmemo[selector] = fn.call(this, selector);\n\t\t}\n\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n\t// tags it will allow on a page\n\tif (!options.singleton) options.singleton = isOldIE();\n\n\t// By default, add <style> tags to the <head> element\n\tif (!options.insertInto) options.insertInto = \"head\";\n\n\t// By default, add <style> tags to the bottom of the target\n\tif (!options.insertAt) options.insertAt = \"bottom\";\n\n\tvar styles = listToStyles(list, options);\n\n\taddStylesToDom(styles, options);\n\n\treturn function update (newList) {\n\t\tvar mayRemove = [];\n\n\t\tfor (var i = 0; i < styles.length; i++) {\n\t\t\tvar item = styles[i];\n\t\t\tvar domStyle = stylesInDom[item.id];\n\n\t\t\tdomStyle.refs--;\n\t\t\tmayRemove.push(domStyle);\n\t\t}\n\n\t\tif(newList) {\n\t\t\tvar newStyles = listToStyles(newList, options);\n\t\t\taddStylesToDom(newStyles, options);\n\t\t}\n\n\t\tfor (var i = 0; i < mayRemove.length; i++) {\n\t\t\tvar domStyle = mayRemove[i];\n\n\t\t\tif(domStyle.refs === 0) {\n\t\t\t\tfor (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();\n\n\t\t\t\tdelete stylesInDom[domStyle.id];\n\t\t\t}\n\t\t}\n\t};\n};\n\nfunction addStylesToDom (styles, options) {\n\tfor (var i = 0; i < styles.length; i++) {\n\t\tvar item = styles[i];\n\t\tvar domStyle = stylesInDom[item.id];\n\n\t\tif(domStyle) {\n\t\t\tdomStyle.refs++;\n\n\t\t\tfor(var j = 0; j < domStyle.parts.length; j++) {\n\t\t\t\tdomStyle.parts[j](item.parts[j]);\n\t\t\t}\n\n\t\t\tfor(; j < item.parts.length; j++) {\n\t\t\t\tdomStyle.parts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\t\t} else {\n\t\t\tvar parts = [];\n\n\t\t\tfor(var j = 0; j < item.parts.length; j++) {\n\t\t\t\tparts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\n\t\t\tstylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};\n\t\t}\n\t}\n}\n\nfunction listToStyles (list, options) {\n\tvar styles = [];\n\tvar newStyles = {};\n\n\tfor (var i = 0; i < list.length; i++) {\n\t\tvar item = list[i];\n\t\tvar id = options.base ? item[0] + options.base : item[0];\n\t\tvar css = item[1];\n\t\tvar media = item[2];\n\t\tvar sourceMap = item[3];\n\t\tvar part = {css: css, media: media, sourceMap: sourceMap};\n\n\t\tif(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});\n\t\telse newStyles[id].parts.push(part);\n\t}\n\n\treturn styles;\n}\n\nfunction insertStyleElement (options, style) {\n\tvar target = getElement(options.insertInto)\n\n\tif (!target) {\n\t\tthrow new Error(\"Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.\");\n\t}\n\n\tvar lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];\n\n\tif (options.insertAt === \"top\") {\n\t\tif (!lastStyleElementInsertedAtTop) {\n\t\t\ttarget.insertBefore(style, target.firstChild);\n\t\t} else if (lastStyleElementInsertedAtTop.nextSibling) {\n\t\t\ttarget.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);\n\t\t} else {\n\t\t\ttarget.appendChild(style);\n\t\t}\n\t\tstylesInsertedAtTop.push(style);\n\t} else if (options.insertAt === \"bottom\") {\n\t\ttarget.appendChild(style);\n\t} else {\n\t\tthrow new Error(\"Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.\");\n\t}\n}\n\nfunction removeStyleElement (style) {\n\tif (style.parentNode === null) return false;\n\tstyle.parentNode.removeChild(style);\n\n\tvar idx = stylesInsertedAtTop.indexOf(style);\n\tif(idx >= 0) {\n\t\tstylesInsertedAtTop.splice(idx, 1);\n\t}\n}\n\nfunction createStyleElement (options) {\n\tvar style = document.createElement(\"style\");\n\n\toptions.attrs.type = \"text/css\";\n\n\taddAttrs(style, options.attrs);\n\tinsertStyleElement(options, style);\n\n\treturn style;\n}\n\nfunction createLinkElement (options) {\n\tvar link = document.createElement(\"link\");\n\n\toptions.attrs.type = \"text/css\";\n\toptions.attrs.rel = \"stylesheet\";\n\n\taddAttrs(link, options.attrs);\n\tinsertStyleElement(options, link);\n\n\treturn link;\n}\n\nfunction addAttrs (el, attrs) {\n\tObject.keys(attrs).forEach(function (key) {\n\t\tel.setAttribute(key, attrs[key]);\n\t});\n}\n\nfunction addStyle (obj, options) {\n\tvar style, update, remove, result;\n\n\t// If a transform function was defined, run it on the css\n\tif (options.transform && obj.css) {\n\t result = options.transform(obj.css);\n\n\t if (result) {\n\t \t// If transform returns a value, use that instead of the original css.\n\t \t// This allows running runtime transformations on the css.\n\t \tobj.css = result;\n\t } else {\n\t \t// If the transform function returns a falsy value, don't add this css.\n\t \t// This allows conditional loading of css\n\t \treturn function() {\n\t \t\t// noop\n\t \t};\n\t }\n\t}\n\n\tif (options.singleton) {\n\t\tvar styleIndex = singletonCounter++;\n\n\t\tstyle = singleton || (singleton = createStyleElement(options));\n\n\t\tupdate = applyToSingletonTag.bind(null, style, styleIndex, false);\n\t\tremove = applyToSingletonTag.bind(null, style, styleIndex, true);\n\n\t} else if (\n\t\tobj.sourceMap &&\n\t\ttypeof URL === \"function\" &&\n\t\ttypeof URL.createObjectURL === \"function\" &&\n\t\ttypeof URL.revokeObjectURL === \"function\" &&\n\t\ttypeof Blob === \"function\" &&\n\t\ttypeof btoa === \"function\"\n\t) {\n\t\tstyle = createLinkElement(options);\n\t\tupdate = updateLink.bind(null, style, options);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\n\t\t\tif(style.href) URL.revokeObjectURL(style.href);\n\t\t};\n\t} else {\n\t\tstyle = createStyleElement(options);\n\t\tupdate = applyToTag.bind(null, style);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\t\t};\n\t}\n\n\tupdate(obj);\n\n\treturn function updateStyle (newObj) {\n\t\tif (newObj) {\n\t\t\tif (\n\t\t\t\tnewObj.css === obj.css &&\n\t\t\t\tnewObj.media === obj.media &&\n\t\t\t\tnewObj.sourceMap === obj.sourceMap\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdate(obj = newObj);\n\t\t} else {\n\t\t\tremove();\n\t\t}\n\t};\n}\n\nvar replaceText = (function () {\n\tvar textStore = [];\n\n\treturn function (index, replacement) {\n\t\ttextStore[index] = replacement;\n\n\t\treturn textStore.filter(Boolean).join('\\n');\n\t};\n})();\n\nfunction applyToSingletonTag (style, index, remove, obj) {\n\tvar css = remove ? \"\" : obj.css;\n\n\tif (style.styleSheet) {\n\t\tstyle.styleSheet.cssText = replaceText(index, css);\n\t} else {\n\t\tvar cssNode = document.createTextNode(css);\n\t\tvar childNodes = style.childNodes;\n\n\t\tif (childNodes[index]) style.removeChild(childNodes[index]);\n\n\t\tif (childNodes.length) {\n\t\t\tstyle.insertBefore(cssNode, childNodes[index]);\n\t\t} else {\n\t\t\tstyle.appendChild(cssNode);\n\t\t}\n\t}\n}\n\nfunction applyToTag (style, obj) {\n\tvar css = obj.css;\n\tvar media = obj.media;\n\n\tif(media) {\n\t\tstyle.setAttribute(\"media\", media)\n\t}\n\n\tif(style.styleSheet) {\n\t\tstyle.styleSheet.cssText = css;\n\t} else {\n\t\twhile(style.firstChild) {\n\t\t\tstyle.removeChild(style.firstChild);\n\t\t}\n\n\t\tstyle.appendChild(document.createTextNode(css));\n\t}\n}\n\nfunction updateLink (link, options, obj) {\n\tvar css = obj.css;\n\tvar sourceMap = obj.sourceMap;\n\n\t/*\n\t\tIf convertToAbsoluteUrls isn't defined, but sourcemaps are enabled\n\t\tand there is no publicPath defined then lets turn convertToAbsoluteUrls\n\t\ton by default. Otherwise default to the convertToAbsoluteUrls option\n\t\tdirectly\n\t*/\n\tvar autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;\n\n\tif (options.convertToAbsoluteUrls || autoFixUrls) {\n\t\tcss = fixUrls(css);\n\t}\n\n\tif (sourceMap) {\n\t\t// http://stackoverflow.com/a/26603875\n\t\tcss += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\n\t}\n\n\tvar blob = new Blob([css], { type: \"text/css\" });\n\n\tvar oldSrc = link.href;\n\n\tlink.href = URL.createObjectURL(blob);\n\n\tif(oldSrc) URL.revokeObjectURL(oldSrc);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/style-loader/lib/addStyles.js\n// module id = 7\n// module chunks = 0","\n/**\n * When source maps are enabled, `style-loader` uses a link element with a data-uri to\n * embed the css on the page. This breaks all relative urls because now they are relative to a\n * bundle instead of the current page.\n *\n * One solution is to only use full urls, but that may be impossible.\n *\n * Instead, this function \"fixes\" the relative urls to be absolute according to the current page location.\n *\n * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.\n *\n */\n\nmodule.exports = function (css) {\n // get current location\n var location = typeof window !== \"undefined\" && window.location;\n\n if (!location) {\n throw new Error(\"fixUrls requires window.location\");\n }\n\n\t// blank or null?\n\tif (!css || typeof css !== \"string\") {\n\t return css;\n }\n\n var baseUrl = location.protocol + \"//\" + location.host;\n var currentDir = baseUrl + location.pathname.replace(/\\/[^\\/]*$/, \"/\");\n\n\t// convert each url(...)\n\t/*\n\tThis regular expression is just a way to recursively match brackets within\n\ta string.\n\n\t /url\\s*\\( = Match on the word \"url\" with any whitespace after it and then a parens\n\t ( = Start a capturing group\n\t (?: = Start a non-capturing group\n\t [^)(] = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t (?: = Start another non-capturing groups\n\t [^)(]+ = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t [^)(]* = Match anything that isn't a parentheses\n\t \\) = Match a end parentheses\n\t ) = End Group\n *\\) = Match anything and then a close parens\n ) = Close non-capturing group\n * = Match anything\n ) = Close capturing group\n\t \\) = Match a close parens\n\n\t /gi = Get all matches, not the first. Be case insensitive.\n\t */\n\tvar fixedCss = css.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi, function(fullMatch, origUrl) {\n\t\t// strip quotes (if they exist)\n\t\tvar unquotedOrigUrl = origUrl\n\t\t\t.trim()\n\t\t\t.replace(/^\"(.*)\"$/, function(o, $1){ return $1; })\n\t\t\t.replace(/^'(.*)'$/, function(o, $1){ return $1; });\n\n\t\t// already a full url? no change\n\t\tif (/^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/)/i.test(unquotedOrigUrl)) {\n\t\t return fullMatch;\n\t\t}\n\n\t\t// convert the url to a full url\n\t\tvar newUrl;\n\n\t\tif (unquotedOrigUrl.indexOf(\"//\") === 0) {\n\t\t \t//TODO: should we add protocol?\n\t\t\tnewUrl = unquotedOrigUrl;\n\t\t} else if (unquotedOrigUrl.indexOf(\"/\") === 0) {\n\t\t\t// path should be relative to the base url\n\t\t\tnewUrl = baseUrl + unquotedOrigUrl; // already starts with '/'\n\t\t} else {\n\t\t\t// path should be relative to current directory\n\t\t\tnewUrl = currentDir + unquotedOrigUrl.replace(/^\\.\\//, \"\"); // Strip leading './'\n\t\t}\n\n\t\t// send back the fixed url(...)\n\t\treturn \"url(\" + JSON.stringify(newUrl) + \")\";\n\t});\n\n\t// send back the fixed css\n\treturn fixedCss;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/style-loader/lib/urls.js\n// module id = 8\n// module chunks = 0","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"hls.js\"), require(\"playkit-js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"hls.js\", \"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsHls\"] = factory(require(\"hls.js\"), require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsHls\"] = factory(root[\"Hls\"], root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///hls/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 971dbcb0968c12c8d961\n\n\n// WEBPACK FOOTER //\n// webpack:/hls/webpack/bootstrap 971dbcb0968c12c8d961","//@flow\nimport Hlsjs from 'hls.js'\nimport {registerMediaSourceAdapter, BaseMediaSourceAdapter} from 'playkit-js'\nimport {Track, VideoTrack, AudioTrack, TextTrack} from 'playkit-js'\n\n/**\n * Adapter of hls.js lib for hls content\n * @classdesc\n */\nexport default class HlsAdapter extends BaseMediaSourceAdapter {\n /**\n * The id of the adapter.\n * @member {string} id\n * @static\n * @private\n */\n static id: string = 'HlsAdapter';\n /**\n * The adapter logger.\n * @member {any} _logger\n * @static\n * @private\n */\n static _logger = BaseMediaSourceAdapter.getLogger(HlsAdapter.id);\n /**\n * The supported mime types by the hls adapter.\n * @member {Array<string>} _hlsMimeType\n * @static\n * @private\n */\n static _hlsMimeTypes: Array<string> = [\n 'application/x-mpegurl',\n 'application/vnd.apple.mpegurl',\n 'audio/mpegurl',\n 'audio/x-mpegurl',\n 'video/x-mpegurl',\n 'video/mpegurl',\n 'application/mpegurl'\n ];\n /**\n * The hls player instance.\n * @member {any} _hls\n * @private\n */\n _hls: any;\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n _loadPromise: ?Promise<Object>;\n /**\n * Reference to the player tracks.\n * @member {Array<Track>} - _playerTracks\n * @type {Array<Track>}\n * @private\n */\n _playerTracks: Array<Track>;\n\n /**\n * Checks if hls adapter can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check.\n * @returns {boolean} - Whether the hls adapter can play a specific mime type.\n * @static\n */\n static canPlayType(mimeType: string): boolean {\n let canHlsPlayType = (typeof mimeType === 'string') ? HlsAdapter._hlsMimeTypes.includes(mimeType.toLowerCase()) : false;\n HlsAdapter._logger.debug('canPlayType result for mimeType:' + mimeType + ' is ' + canHlsPlayType.toString());\n return canHlsPlayType;\n }\n\n /**\n * Checks if the hls adapter is supported.\n * @function isSupported\n * @returns {boolean} - Whether hls is supported.\n * @static\n */\n static isSupported(): boolean {\n let isHlsSupported = Hlsjs.isSupported();\n HlsAdapter._logger.debug('isSupported:' + isHlsSupported);\n return isHlsSupported;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which will bind to the hls adapter\n * @param {Object} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n constructor(videoElement: HTMLVideoElement, source: Source, config: Object) {\n HlsAdapter._logger.debug('Creating adapter. Hls version: ' + Hlsjs.version);\n super(videoElement, source, config);\n this._hls = new Hlsjs(this._config);\n this._addBindings();\n }\n\n /**\n * Adds the required bindings with hls.js.\n * @function _addBindings\n * @private\n * @returns {void}\n */\n _addBindings(): void {\n this._hls.on(Hlsjs.Events.ERROR, this._onError.bind(this));\n this._hls.on(Hlsjs.Events.LEVEL_SWITCHED, this._onLevelSwitched.bind(this));\n this._hls.on(Hlsjs.Events.AUDIO_TRACK_SWITCHED, this._onAudioTrackSwitched.bind(this));\n }\n\n /**\n * Load the video source\n * @function load\n * @returns {Promise<Object>} - The loaded data\n * @override\n */\n load(): Promise<Object> {\n if (!this._loadPromise) {\n this._loadPromise = new Promise((resolve) => {\n this._hls.on(Hlsjs.Events.MANIFEST_LOADED, (event: string, data: any) => {\n HlsAdapter._logger.debug('The source has been loaded successfully');\n this._playerTracks = this._parseTracks(data);\n resolve({tracks: this._playerTracks});\n });\n if (this._sourceObj && this._sourceObj.url) {\n this._hls.loadSource(this._sourceObj.url);\n this._hls.attachMedia(this._videoElement);\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroying the hls adapter.\n * @function destroy\n * @override\n */\n destroy(): void {\n HlsAdapter._logger.debug('destroy');\n super.destroy();\n this._loadPromise = null;\n this._removeBindings();\n this._hls.detachMedia();\n this._hls.destroy();\n }\n\n /**\n * Parse the hls tracks into player tracks.\n * @param {any} data - The event data.\n * @returns {Array<Track>} - The parsed tracks.\n * @private\n */\n _parseTracks(data: any): Array<Track> {\n let audioTracks = this._parseAudioTracks(data.audioTracks || []);\n let videoTracks = this._parseVideoTracks(data.levels || []);\n let textTracks = this._parseTextTracks(this._videoElement.textTracks || []);\n return audioTracks.concat(videoTracks).concat(textTracks);\n }\n\n /**\n * Parse hls audio tracks into player audio tracks.\n * @param {Array<Object>} hlsAudioTracks - The hls audio tracks.\n * @returns {Array<AudioTrack>} - The parsed audio tracks.\n * @private\n */\n _parseAudioTracks(hlsAudioTracks: Array<Object>): Array<AudioTrack> {\n let audioTracks = [];\n for (let i = 0; i < hlsAudioTracks.length; i++) {\n // Create audio tracks\n let settings = {\n id: hlsAudioTracks[i].id,\n active: this._hls.audioTrack === hlsAudioTracks[i].id,\n label: hlsAudioTracks[i].name,\n language: hlsAudioTracks[i].lang,\n index: i\n };\n audioTracks.push(new AudioTrack(settings));\n }\n return audioTracks;\n }\n\n /**\n * Parse hls video tracks into player video tracks.\n * @param {Array<Object>} hlsVideoTracks - The hls video tracks.\n * @returns {Array<VideoTrack>} - The parsed video tracks.\n * @private\n */\n _parseVideoTracks(hlsVideoTracks: Array<Object>): Array<VideoTrack> {\n let videoTracks = [];\n for (let i = 0; i < hlsVideoTracks.length; i++) {\n // Create video tracks\n let settings = {\n active: this._hls.startLevel === i,\n label: hlsVideoTracks[i].name,\n bandwidth: hlsVideoTracks[i].bitrate,\n language: '',\n index: i\n };\n videoTracks.push(new VideoTrack(settings));\n }\n return videoTracks;\n }\n\n /**\n * Parse native video tag text tracks into player text tracks.\n * @param {TextTrackList} vidTextTracks - The native video tag text tracks.\n * @returns {Array<TextTrack>} - The parsed text tracks.\n * @private\n */\n _parseTextTracks(vidTextTracks: TextTrackList | Array<Object>): Array<TextTrack> {\n let textTracks = [];\n for (let i = 0; i < vidTextTracks.length; i++) {\n // Create text tracks\n let settings = {\n active: vidTextTracks[i].mode === 'showing',\n label: vidTextTracks[i].label,\n kind: vidTextTracks[i].kind,\n language: vidTextTracks[i].language,\n index: i\n };\n textTracks.push(new TextTrack(settings));\n }\n return textTracks;\n }\n\n /**\n * Select an audio track.\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select.\n * @returns {void}\n * @public\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n if (audioTrack instanceof AudioTrack && !audioTrack.active && this._hls.audioTracks) {\n this._hls.audioTrack = audioTrack.id;\n }\n }\n\n /**\n * Select a video track.\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the track to select.\n * @returns {void}\n * @public\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n if (videoTrack instanceof VideoTrack && (!videoTrack.active || this._hls.autoLevelEnabled) && this._hls.levels) {\n this._hls.nextLevel = videoTrack.index;\n }\n }\n\n /**\n * Select a text track.\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select.\n * @returns {void}\n * @public\n */\n selectTextTrack(textTrack: TextTrack): void {\n if (textTrack instanceof TextTrack && !textTrack.active && this._videoElement.textTracks) {\n this._disableAllTextTracks();\n this._videoElement.textTracks[textTrack.index].mode = 'showing';\n HlsAdapter._logger.debug('Text track changed', textTrack);\n this._onTrackChanged(textTrack);\n }\n }\n\n /** Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n hideTextTrack(): void {\n this._disableAllTextTracks();\n }\n\n /**\n * Enables adaptive bitrate switching according to hls.js logic.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n this._hls.nextLevel = -1;\n }\n\n /**\n * Triggers on video track selection (auto or manually) the 'videotrackchanged' event forward.\n * @function _onLevelSwitched\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n _onLevelSwitched(event: string, data: any): void {\n let videoTrack = this._playerTracks.find((track) => {\n return (track instanceof VideoTrack && track.index === data.level);\n });\n HlsAdapter._logger.debug('Video track changed', videoTrack);\n this._onTrackChanged(videoTrack);\n }\n\n /**\n * Triggers on audio track selection (auto or manually) the 'audiotrackchanged' event forward.\n * @function _onAudioTrackSwitched\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n _onAudioTrackSwitched(event: string, data: any): void {\n let audioTrack = this._playerTracks.find((track) => {\n return (track instanceof AudioTrack && track.id === data.id);\n });\n HlsAdapter._logger.debug('Audio track changed', audioTrack);\n this._onTrackChanged(audioTrack);\n }\n\n /**\n * Disables all the video tag text tracks.\n * @returns {void}\n * @private\n */\n _disableAllTextTracks() {\n let vidTextTracks = this._videoElement.textTracks;\n for (let i = 0; i < vidTextTracks.length; i++) {\n vidTextTracks[i].mode = 'hidden';\n }\n }\n\n /**\n * Handles hls errors.\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n _onError(event: string, data: any): void {\n let errorType = data.type;\n let errorDetails = data.details;\n let errorFatal = data.fatal;\n if (errorFatal) {\n switch (errorType) {\n case Hlsjs.ErrorTypes.NETWORK_ERROR:\n HlsAdapter._logger.error(\"fatal network error encountered, try to recover\");\n this._hls.startLoad();\n break;\n case Hlsjs.ErrorTypes.MEDIA_ERROR:\n HlsAdapter._logger.error(\"fatal media error encountered, try to recover\");\n this._hls.recoverMediaError();\n break;\n default:\n HlsAdapter._logger.error(\"fatal error, cannot recover\");\n this.destroy();\n break;\n }\n } else {\n switch (errorDetails) {\n case Hlsjs.ErrorDetails.MANIFEST_LOAD_ERROR:\n case Hlsjs.ErrorDetails.MANIFEST_LOAD_TIMEOUT:\n case Hlsjs.ErrorDetails.MANIFEST_PARSING_ERROR:\n case Hlsjs.ErrorDetails.LEVEL_LOAD_ERROR:\n case Hlsjs.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n case Hlsjs.ErrorDetails.LEVEL_SWITCH_ERROR:\n case Hlsjs.ErrorDetails.FRAG_LOAD_ERROR:\n case Hlsjs.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case Hlsjs.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case Hlsjs.ErrorDetails.FRAG_PARSING_ERROR:\n case Hlsjs.ErrorDetails.BUFFER_APPEND_ERROR:\n case Hlsjs.ErrorDetails.BUFFER_APPENDING_ERROR:\n HlsAdapter._logger.error(errorType, errorDetails);\n break;\n default:\n break;\n }\n }\n }\n\n /**\n * Removes hls.js bindings.\n * @returns {void}\n * @private\n */\n _removeBindings(): void {\n this._hls.off(Hlsjs.Events.ERROR, this._onError);\n this._hls.off(Hlsjs.Events.LEVEL_SWITCHED, this._onLevelSwitched);\n this._hls.off(Hlsjs.Events.AUDIO_TRACK_SWITCHED, this._onAudioTrackSwitched);\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * In case the adapter preformed a load it will return the manifest url.\n * @public\n * @returns {string} - The src url.\n */\n get src(): string {\n if (this._loadPromise && this._sourceObj) {\n return this._sourceObj.url;\n }\n return \"\";\n }\n}\n\n// Register hls adapter to the media source adapter provider.\nif (HlsAdapter.isSupported()) {\n registerMediaSourceAdapter(HlsAdapter);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./hls-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///hls/hls-adapter.js","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"hls.js\",\"commonjs2\":\"hls.js\",\"amd\":\"hls.js\",\"root\":\"Hls\"}\n// module id = 1\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/hls/external {\"commonjs\":\"hls.js\",\"commonjs2\":\"hls.js\",\"amd\":\"hls.js\",\"root\":\"Hls\"}","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}\n// module id = 2\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/hls/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","(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})\n\n\n// WEBPACK FOOTER //\n// node_modules/browser-pack/_prelude.js","// 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 } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\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\n\n// WEBPACK FOOTER //\n// node_modules/events/events.js","// see https://tools.ietf.org/html/rfc1808\r\n\r\n/* jshint ignore:start */\r\n(function(root) { \r\n/* jshint ignore:end */\r\n\r\n var URL_REGEX = /^((?:[^\\/;?#]+:)?)(\\/\\/[^\\/\\;?#]*)?(.*?)??(;.*?)?(\\?.*?)?(#.*?)?$/;\r\n var FIRST_SEGMENT_REGEX = /^([^\\/;?#]*)(.*)$/;\r\n var SLASH_DOT_REGEX = /(?:\\/|^)\\.(?=\\/)/g;\r\n var SLASH_DOT_DOT_REGEX = /(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/).*?(?=\\/)/g;\r\n\r\n var URLToolkit = { // jshint ignore:line\r\n // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //\r\n // E.g\r\n // With opts.alwaysNormalize = false (default, spec compliant)\r\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g\r\n // With opts.alwaysNormalize = true (default, not spec compliant)\r\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/g\r\n buildAbsoluteURL: function(baseURL, relativeURL, opts) {\r\n opts = opts || {};\r\n // remove any remaining space and CRLF\r\n baseURL = baseURL.trim();\r\n relativeURL = relativeURL.trim();\r\n if (!relativeURL) {\r\n // 2a) If the embedded URL is entirely empty, it inherits the\r\n // entire base URL (i.e., is set equal to the base URL)\r\n // and we are done.\r\n if (!opts.alwaysNormalize) {\r\n return baseURL;\r\n }\r\n var basePartsForNormalise = this.parseURL(baseURL);\r\n if (!baseParts) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n basePartsForNormalise.path = URLToolkit.normalizePath(basePartsForNormalise.path);\r\n return URLToolkit.buildURLFromParts(basePartsForNormalise);\r\n }\r\n var relativeParts = this.parseURL(relativeURL);\r\n if (!relativeParts) {\r\n throw new Error('Error trying to parse relative URL.');\r\n }\r\n if (relativeParts.scheme) {\r\n // 2b) If the embedded URL starts with a scheme name, it is\r\n // interpreted as an absolute URL and we are done.\r\n if (!opts.alwaysNormalize) {\r\n return relativeURL;\r\n }\r\n relativeParts.path = URLToolkit.normalizePath(relativeParts.path);\r\n return URLToolkit.buildURLFromParts(relativeParts);\r\n }\r\n var baseParts = this.parseURL(baseURL);\r\n if (!baseParts) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== '/') {\r\n // If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc\r\n // This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'\r\n var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);\r\n baseParts.netLoc = pathParts[1];\r\n baseParts.path = pathParts[2];\r\n }\r\n if (baseParts.netLoc && !baseParts.path) {\r\n baseParts.path = '/';\r\n }\r\n var builtParts = {\r\n // 2c) Otherwise, the embedded URL inherits the scheme of\r\n // the base URL.\r\n scheme: baseParts.scheme,\r\n netLoc: relativeParts.netLoc,\r\n path: null,\r\n params: relativeParts.params,\r\n query: relativeParts.query,\r\n fragment: relativeParts.fragment\r\n };\r\n if (!relativeParts.netLoc) {\r\n // 3) If the embedded URL's <net_loc> is non-empty, we skip to\r\n // Step 7. Otherwise, the embedded URL inherits the <net_loc>\r\n // (if any) of the base URL.\r\n builtParts.netLoc = baseParts.netLoc;\r\n // 4) If the embedded URL path is preceded by a slash \"/\", the\r\n // path is not relative and we skip to Step 7.\r\n if (relativeParts.path[0] !== '/') {\r\n if (!relativeParts.path) {\r\n // 5) If the embedded URL path is empty (and not preceded by a\r\n // slash), then the embedded URL inherits the base URL path\r\n builtParts.path = baseParts.path;\r\n // 5a) if the embedded URL's <params> is non-empty, we skip to\r\n // step 7; otherwise, it inherits the <params> of the base\r\n // URL (if any) and\r\n if (!relativeParts.params) {\r\n builtParts.params = baseParts.params;\r\n // 5b) if the embedded URL's <query> is non-empty, we skip to\r\n // step 7; otherwise, it inherits the <query> of the base\r\n // URL (if any) and we skip to step 7.\r\n if (!relativeParts.query) {\r\n builtParts.query = baseParts.query;\r\n }\r\n }\r\n } else {\r\n // 6) The last segment of the base URL's path (anything\r\n // following the rightmost slash \"/\", or the entire path if no\r\n // slash is present) is removed and the embedded URL's path is\r\n // appended in its place.\r\n var baseURLPath = baseParts.path;\r\n var newPath = baseURLPath.substring(0, baseURLPath.lastIndexOf('/') + 1) + relativeParts.path;\r\n builtParts.path = URLToolkit.normalizePath(newPath);\r\n }\r\n }\r\n }\r\n if (builtParts.path === null) {\r\n builtParts.path = opts.alwaysNormalize ? URLToolkit.normalizePath(relativeParts.path) : relativeParts.path;\r\n }\r\n return URLToolkit.buildURLFromParts(builtParts);\r\n },\r\n parseURL: function(url) {\r\n var parts = URL_REGEX.exec(url);\r\n if (!parts) {\r\n return null;\r\n }\r\n return {\r\n scheme: parts[1] || '',\r\n netLoc: parts[2] || '',\r\n path: parts[3] || '',\r\n params: parts[4] || '',\r\n query: parts[5] || '',\r\n fragment: parts[6] || ''\r\n };\r\n },\r\n normalizePath: function(path) {\r\n // The following operations are\r\n // then applied, in order, to the new path:\r\n // 6a) All occurrences of \"./\", where \".\" is a complete path\r\n // segment, are removed.\r\n // 6b) If the path ends with \".\" as a complete path segment,\r\n // that \".\" is removed.\r\n path = path.split('').reverse().join('').replace(SLASH_DOT_REGEX, '');\r\n // 6c) All occurrences of \"<segment>/../\", where <segment> is a\r\n // complete path segment not equal to \"..\", are removed.\r\n // Removal of these path segments is performed iteratively,\r\n // removing the leftmost matching pattern on each iteration,\r\n // until no matching pattern remains.\r\n // 6d) If the path ends with \"<segment>/..\", where <segment> is a\r\n // complete path segment not equal to \"..\", that\r\n // \"<segment>/..\" is removed.\r\n while (path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, '')).length) {} // jshint ignore:line\r\n return path.split('').reverse().join('');\r\n },\r\n buildURLFromParts: function(parts) {\r\n return parts.scheme + parts.netLoc + parts.path + parts.params + parts.query + parts.fragment;\r\n }\r\n };\r\n\r\n/* jshint ignore:start */\r\n if(typeof exports === 'object' && typeof module === 'object')\r\n module.exports = URLToolkit;\r\n else if(typeof define === 'function' && define.amd)\r\n define([], function() { return URLToolkit; });\r\n else if(typeof exports === 'object')\r\n exports[\"URLToolkit\"] = URLToolkit;\r\n else\r\n root[\"URLToolkit\"] = URLToolkit;\r\n})(this);\r\n/* jshint ignore:end */\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/url-toolkit/src/url-toolkit.js","var 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\n\n// WEBPACK FOOTER //\n// node_modules/webworkify/index.js","/**\n * HLS config\n */\n'use strict';\n\nimport AbrController from './controller/abr-controller';\nimport BufferController from './controller/buffer-controller';\nimport CapLevelController from './controller/cap-level-controller';\nimport FPSController from './controller/fps-controller';\nimport XhrLoader from './utils/xhr-loader';\n//import FetchLoader from './utils/fetch-loader';\n//#if altaudio\nimport AudioTrackController from './controller/audio-track-controller';\nimport AudioStreamController from './controller/audio-stream-controller';\n//#endif\n\n//#if subtitle\nimport Cues from './utils/cues';\nimport TimelineController from './controller/timeline-controller';\nimport SubtitleTrackController from './controller/subtitle-track-controller';\nimport SubtitleStreamController from './controller/subtitle-stream-controller';\n//#endif\n\nexport var hlsDefaultConfig = {\n autoStartLoad: true, // used by stream-controller\n startPosition: -1, // used by stream-controller\n defaultAudioCodec: undefined, // used by stream-controller\n debug: false, // used by logger\n capLevelOnFPSDrop: false, // used by fps-controller\n capLevelToPlayerSize: false, // used by cap-level-controller\n initialLiveManifestSize: 1, // used by stream-controller\n maxBufferLength: 30, // used by stream-controller\n maxBufferSize: 60 * 1000 * 1000, // used by stream-controller\n maxBufferHole: 0.5, // used by stream-controller\n maxSeekHole: 2, // used by stream-controller\n lowBufferWatchdogPeriod: 0.5, // used by stream-controller\n highBufferWatchdogPeriod: 3, // used by stream-controller\n nudgeOffset: 0.1, // used by stream-controller\n nudgeMaxRetry : 3, // used by stream-controller\n maxFragLookUpTolerance: 0.25, // used by stream-controller\n liveSyncDurationCount:3, // used by stream-controller\n liveMaxLatencyDurationCount: Infinity, // used by stream-controller\n liveSyncDuration: undefined, // used by stream-controller\n liveMaxLatencyDuration: undefined, // used by stream-controller\n maxMaxBufferLength: 600, // used by stream-controller\n enableWorker: true, // used by demuxer\n enableSoftwareAES: true, // used by decrypter\n manifestLoadingTimeOut: 10000, // used by playlist-loader\n manifestLoadingMaxRetry: 1, // used by playlist-loader\n manifestLoadingRetryDelay: 1000, // used by playlist-loader\n manifestLoadingMaxRetryTimeout: 64000, // used by playlist-loader\n startLevel: undefined, // used by level-controller\n levelLoadingTimeOut: 10000, // used by playlist-loader\n levelLoadingMaxRetry: 4, // used by playlist-loader\n levelLoadingRetryDelay: 1000, // used by playlist-loader\n levelLoadingMaxRetryTimeout: 64000, // used by playlist-loader\n fragLoadingTimeOut: 20000, // used by fragment-loader\n fragLoadingMaxRetry: 6, // used by fragment-loader\n fragLoadingRetryDelay: 1000, // used by fragment-loader\n fragLoadingMaxRetryTimeout: 64000, // used by fragment-loader\n fragLoadingLoopThreshold: 3, // used by stream-controller\n startFragPrefetch: false, // used by stream-controller\n fpsDroppedMonitoringPeriod: 5000, // used by fps-controller\n fpsDroppedMonitoringThreshold: 0.2, // used by fps-controller\n appendErrorMaxRetry: 3, // used by buffer-controller\n loader: XhrLoader,\n //loader: FetchLoader,\n fLoader: undefined,\n pLoader: undefined,\n xhrSetup: undefined,\n fetchSetup: undefined,\n abrController: AbrController,\n bufferController: BufferController,\n capLevelController: CapLevelController,\n fpsController: FPSController,\n//#if altaudio\n audioStreamController: AudioStreamController,\n audioTrackController : AudioTrackController,\n//#endif\n//#if subtitle\n subtitleStreamController: SubtitleStreamController,\n subtitleTrackController: SubtitleTrackController,\n timelineController: TimelineController,\n cueHandler: Cues,\n enableCEA708Captions: true, // used by timeline-controller\n enableWebVTT: true, // used by timeline-controller\n captionsTextTrack1Label: 'English', // used by timeline-controller\n captionsTextTrack1LanguageCode: 'en', // used by timeline-controller\n captionsTextTrack2Label: 'Spanish', // used by timeline-controller\n captionsTextTrack2LanguageCode: 'es', // used by timeline-controller\n//#endif\n stretchShortVideoTrack: false, // used by mp4-remuxer\n forceKeyFrameOnDiscontinuity: true, // used by ts-demuxer\n abrEwmaFastLive: 3, // used by abr-controller\n abrEwmaSlowLive: 9, // used by abr-controller\n abrEwmaFastVoD: 3, // used by abr-controller\n abrEwmaSlowVoD: 9, // used by abr-controller\n abrEwmaDefaultEstimate: 5e5, // 500 kbps // used by abr-controller\n abrBandWidthFactor : 0.95, // used by abr-controller\n abrBandWidthUpFactor : 0.7, // used by abr-controller\n abrMaxWithRealBitrate : false, // used by abr-controller\n maxStarvationDelay : 4, // used by abr-controller\n maxLoadingDelay : 4, // used by abr-controller\n minAutoBitrate: 0 // used by hls\n };\n\n\n\n// WEBPACK FOOTER //\n// src/config.js","/*\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\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport BufferHelper from '../helper/buffer-helper';\nimport {ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\nimport EwmaBandWidthEstimator from '../utils/ewma-bandwidth-estimator';\n\nclass AbrController extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.FRAG_LOADING,\n Event.FRAG_LOADED,\n Event.FRAG_BUFFERED,\n Event.ERROR);\n this.lastLoadedFragLevel = 0;\n this._nextAutoLevel = -1;\n this.hls = hls;\n this.timer = null;\n this._bwEstimator = null;\n this.onCheck = this._abandonRulesCheck.bind(this);\n }\n\n destroy() {\n this.clearTimer();\n EventHandler.prototype.destroy.call(this);\n }\n\n onFragLoading(data) {\n let 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 let hls = this.hls,\n level = data.frag.level,\n isLive = hls.levels[level].details.live,\n config = hls.config,\n ewmaFast, ewmaSlow;\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 EwmaBandWidthEstimator(hls,ewmaSlow,ewmaFast,config.abrEwmaDefaultEstimate);\n }\n this.fragCurrent = frag;\n }\n }\n\n _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 let hls = this.hls, v = hls.media,frag = this.fragCurrent, loader = frag.loader, minAutoLevel = hls.minAutoLevel;\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.warn('frag loader destroy or aborted, disarm abandonRules');\n this.clearTimer();\n return;\n }\n let 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 let 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 let levels = hls.levels,\n 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\n // compute expected fragment length using frag duration and level bitrate. also ensure that expected len is gte than already loaded size\n level = levels[frag.level],\n levelBitrate = level.realBitrate ? Math.max(level.realBitrate,level.bitrate) : level.bitrate,\n expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levelBitrate / 8)),\n pos = v.currentTime,\n fragLoadedDelay = (expectedLen - stats.loaded) / loadRate,\n bufferStarvationDelay = (BufferHelper.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 let fragLevelNextLoadedDelay, nextLoadLevel;\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 > minAutoLevel ; 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 let levelNextBitrate = levels[nextLoadLevel].realBitrate ? Math.max(levels[nextLoadLevel].realBitrate,levels[nextLoadLevel].bitrate) : levels[nextLoadLevel].bitrate;\n fragLevelNextLoadedDelay = frag.duration * levelNextBitrate / (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 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(Event.FRAG_LOAD_EMERGENCY_ABORTED, {frag: frag, stats: stats });\n }\n }\n }\n }\n }\n\n onFragLoaded(data) {\n let frag = data.frag;\n if (frag.type === 'main' && !isNaN(frag.sn)) {\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\n // compute level average bitrate\n if (this.hls.config.abrMaxWithRealBitrate) {\n const level = this.hls.levels[frag.level];\n let loadedBytes = (level.loaded ? level.loaded.bytes : 0) + data.stats.loaded;\n let loadedDuration = (level.loaded ? level.loaded.duration : 0) + data.frag.duration;\n level.loaded = { bytes : loadedBytes, duration : loadedDuration };\n level.realBitrate = Math.round(8*loadedBytes/loadedDuration);\n }\n // if fragment has been loaded to perform a bitrate test,\n if (data.frag.bitrateTest) {\n let stats = data.stats;\n stats.tparsed = stats.tbuffered = stats.tload;\n this.onFragBuffered(data);\n }\n }\n }\n\n onFragBuffered(data) {\n var stats = data.stats, 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' && !isNaN(frag.sn) && ((!frag.bitrateTest || stats.tload === stats.tbuffered))) {\n // use tparsed-trequest instead of tbuffered-trequest to compute fragLoadingProcessing; rationale is that buffer appending only happens once media is attached\n // 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\n // as a consequence it could happen really late in the process. meaning that appending duration might appears huge ... leading to underestimated throughput estimation\n let fragLoadingProcessingMs = stats.tparsed - stats.trequest;\n 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 stats.bwEstimate = this._bwEstimator.getEstimate();\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 onError(data) {\n // stop timer in case of frag loading error\n switch(data.details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n this.clearTimer();\n break;\n default:\n break;\n }\n }\n\n clearTimer() {\n clearInterval(this.timer);\n this.timer = null;\n }\n\n // return next auto level\n get nextAutoLevel() {\n const forcedAutoLevel = this._nextAutoLevel;\n const bwEstimator = this._bwEstimator;\n // in case next auto level has been forced, and bw not available or not reliable, return forced value\n if (forcedAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {\n return forcedAutoLevel;\n }\n // compute next level using ABR logic\n let nextABRAutoLevel = this._nextABRAutoLevel;\n // if forced auto level has been defined, use it to cap ABR computed quality level\n if (forcedAutoLevel !== -1) {\n nextABRAutoLevel = Math.min(forcedAutoLevel,nextABRAutoLevel);\n }\n return nextABRAutoLevel;\n }\n get _nextABRAutoLevel() {\n var hls = this.hls, maxAutoLevel = hls.maxAutoLevel, levels = hls.levels, config = hls.config, minAutoLevel = hls.minAutoLevel;\n const v = hls.media,\n currentLevel = this.lastLoadedFragLevel,\n currentFragDuration = this.fragCurrent ? this.fragCurrent.duration : 0,\n pos = (v ? v.currentTime : 0),\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 // bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.\n bufferStarvationDelay = (BufferHelper.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 let 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.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 let maxStarvationDelay = currentFragDuration ? Math.min(currentFragDuration,config.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 let 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 // cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration\n const maxLoadingDelay = currentFragDuration ? Math.min(currentFragDuration,config.maxLoadingDelay) : config.maxLoadingDelay;\n maxStarvationDelay = maxLoadingDelay - bitrateTestDelay;\n 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 _findBestLevel(currentLevel,currentFragDuration,currentBw,minAutoLevel,maxAutoLevel,maxFetchDuration,bwFactor,bwUpFactor,levels) {\n for (let i = maxAutoLevel; i >= minAutoLevel; i--) {\n let levelInfo = levels[i],\n levelDetails = levelInfo.details,\n avgDuration = levelDetails ? levelDetails.totalduration/levelDetails.fragments.length : currentFragDuration,\n live = levelDetails ? levelDetails.live : false,\n adjustedbw;\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 const bitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate,levels[i].bitrate) : levels[i].bitrate,\n fetchDuration = bitrate * avgDuration / adjustedbw;\n\n 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 live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches\n // 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 ...\n // special case to support startLevel = -1 (bitrateTest) on live streams : in that case we should not exit loop so that _findBestLevel will return -1\n (!fetchDuration || (live && !this.bitrateTestDelay) || fetchDuration < maxFetchDuration) ) {\n // as we are looping from highest to lowest, this will return the best achievable quality level\n return i;\n }\n }\n // not enough time budget even with quality level 0 ... rebuffering might happen\n return -1;\n }\n\n set nextAutoLevel(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n}\n\nexport default AbrController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/abr-controller.js","/*\n * Audio Stream Controller\n*/\n\nimport BinarySearch from '../utils/binary-search';\nimport BufferHelper from '../helper/buffer-helper';\nimport Demuxer from '../demux/demuxer';\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport LevelHelper from '../helper/level-helper';\nimport TimeRanges from '../utils/timeRanges';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\nimport { findFragWithCC } from '../utils/discontinuities';\n\nconst 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 BUFFER_FLUSHING : 'BUFFER_FLUSHING',\n ENDED : 'ENDED',\n ERROR : 'ERROR',\n WAITING_INIT_PTS : 'WAITING_INIT_PTS'\n};\n\nclass AudioStreamController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.AUDIO_TRACKS_UPDATED,\n Event.AUDIO_TRACK_SWITCHING,\n Event.AUDIO_TRACK_LOADED,\n Event.KEY_LOADED,\n Event.FRAG_LOADED,\n Event.FRAG_PARSING_INIT_SEGMENT,\n Event.FRAG_PARSING_DATA,\n Event.FRAG_PARSED,\n Event.ERROR,\n Event.BUFFER_CREATED,\n Event.BUFFER_APPENDED,\n Event.BUFFER_FLUSHED,\n Event.INIT_PTS_FOUND);\n\n this.config = hls.config;\n this.audioCodecSwap = false;\n this.ticks = 0;\n this._state = State.STOPPED;\n this.ontick = this.tick.bind(this);\n this.initPTS=[];\n this.waitingFragment=null;\n this.videoTrackCC = null;\n }\n\n destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n EventHandler.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n\n //Signal that video PTS was found\n onInitPtsFound(data) {\n var demuxerId=data.id, cc = data.frag.cc, initPTS = data.initPTS;\n if(demuxerId === 'main') {\n //Always update the new INIT PTS\n //Can change due level switch\n this.initPTS[cc] = initPTS;\n this.videoTrackCC = cc;\n logger.log(`InitPTS for cc:${cc} found from video track:${initPTS}`);\n\n //If we are waiting we need to demux/remux the waiting frag\n //With the new initPTS\n if (this.state === State.WAITING_INIT_PTS) {\n this.tick();\n }\n }\n }\n\n startLoad(startPosition) {\n if (this.tracks) {\n var lastCurrentTime = this.lastCurrentTime;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.fragLoadError = 0;\n if (lastCurrentTime > 0 && startPosition === -1) {\n logger.log(`audio:override startPosition with lastCurrentTime @${lastCurrentTime.toFixed(3)}`);\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 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 set state(nextState) {\n if (this.state !== nextState) {\n const previousState = this.state;\n this._state = nextState;\n logger.log(`audio stream:${previousState}->${nextState}`);\n }\n }\n\n get state() {\n return this._state;\n }\n\n 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 doTick() {\n var pos, track, trackDetails, hls = this.hls, 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 case State.BUFFER_FLUSHING:\n break;\n case State.STARTING:\n this.state = State.WAITING_TRACK;\n this.loadedmetadata = false;\n break;\n case State.IDLE:\n const tracks = this.tracks;\n // audio tracks not received => exit loop\n if (!tracks) {\n break;\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 (!this.media &&\n (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 if (pos === undefined) {\n break;\n }\n }\n let media = this.mediaBuffer ? this.mediaBuffer : this.media,\n bufferInfo = BufferHelper.bufferInfo(media,pos,config.maxBufferHole),\n bufferLen = bufferInfo.len,\n bufferEnd = bufferInfo.end,\n fragPrevious = this.fragPrevious,\n maxBufLen = config.maxMaxBufferLength,\n audioSwitch = this.audioSwitch,\n trackId = this.trackId;\n\n // if buffer length is less than maxBufLen try to load a new fragment\n if ((bufferLen < maxBufLen || audioSwitch) && trackId < tracks.length) {\n trackDetails = tracks[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 (!audioSwitch && !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(Event.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 let fragments = trackDetails.fragments,\n fragLen = fragments.length,\n start = fragments[0].start,\n end = fragments[fragLen-1].start + fragments[fragLen-1].duration,\n frag;\n\n // When switching audio track, reload audio as close as possible to currentTime\n if(audioSwitch){\n if (trackDetails.live && !trackDetails.PTSKnown) {\n logger.log(`switching audiotrack, live stream, unknown PTS,load first fragment`);\n bufferEnd = 0;\n } else {\n bufferEnd = pos;\n // if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime\n if (trackDetails.PTSKnown && pos < start) {\n // if everything is buffered from pos to start or if audio buffer upfront, let's seek to start\n if (bufferInfo.end > start || bufferInfo.nextStart) {\n logger.log('alt audio track ahead of main track, seek to start of alt audio track');\n this.media.currentTime = start + 0.05;\n } else {\n return;\n }\n }\n }\n }\n if (trackDetails.initSegment && !trackDetails.initSegment.data) {\n frag = trackDetails.initSegment;\n }\n // if bufferEnd before start of playlist, load first fragment\n else if (bufferEnd <= start) {\n frag = fragments[0];\n if (this.videoTrackCC !== null && frag.cc !== this.videoTrackCC) {\n // Ensure we find a fragment which matches the continuity of the video track\n frag = findFragWithCC(fragments, this.videoTrackCC);\n }\n if (trackDetails.live && frag.loadIdx && frag.loadIdx === this.fragLoadIdx) {\n // we just loaded this first fragment, and we are still lagging behind the start of the live playlist\n // let's force seek to start\n const nextBuffered = bufferInfo.nextStart ? bufferInfo.nextStart : start;\n logger.log(`no alt audio available @currentTime:${this.media.currentTime}, seeking @${nextBuffered + 0.05}`);\n this.media.currentTime = nextBuffered + 0.05;\n return;\n }\n } else {\n let foundFrag;\n let maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n const fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;\n let fragmentWithinToleranceTest = (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 // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments\n let candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);\n if ((candidate.start + candidate.duration - candidateLookupTolerance) <= bufferEnd) {\n return 1;\n }// if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n };\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n // Prefer the next fragment if it's within tolerance\n if (fragNext && !fragmentWithinToleranceTest(fragNext)) {\n foundFrag = fragNext;\n } else {\n foundFrag = BinarySearch.search(fragments, fragmentWithinToleranceTest);\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.log(`SN just loaded, load next one: ${frag.sn}`);\n } else {\n frag = null;\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 && (frag.decryptdata.uri != null) && (frag.decryptdata.key == null)) {\n logger.log(`Loading key for ${frag.sn} of [${trackDetails.startSN} ,${trackDetails.endSN}],track ${trackId}`);\n this.state = State.KEY_LOADING;\n hls.trigger(Event.KEY_LOADING, {frag: frag});\n } else {\n logger.log(`Loading ${frag.sn}, cc: ${frag.cc} of [${trackDetails.startSN} ,${trackDetails.endSN}],track ${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 let 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 if (!isNaN(frag.sn)) {\n this.nextLoadPosition = frag.start + frag.duration;\n }\n hls.trigger(Event.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.log(`audioStreamController: retryDate reached, switch back to IDLE state`);\n this.state = State.IDLE;\n }\n break;\n case State.WAITING_INIT_PTS:\n if (this.initPTS[this.videoTrackCC] === undefined) {\n break;\n }\n\n // Ensure we don't get stuck in the WAITING_INIT_PTS state if the waiting frag CC doesn't match any initPTS\n const waitingFrag = this.waitingFragment;\n if (waitingFrag) {\n const waitingFragCC = waitingFrag.frag.cc;\n if (this.videoTrackCC !== waitingFragCC) {\n logger.warn(`Waiting fragment CC (${waitingFragCC}) does not match video track CC (${this.videoTrackCC})`);\n this.waitingFragment = null;\n this.state = State.IDLE;\n } else {\n this.state = State.FRAG_LOADING;\n this.onFragLoaded(this.waitingFragment);\n this.waitingFragment = null;\n }\n } else {\n this.state = State.IDLE;\n }\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 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 let config = this.config;\n if(this.tracks && config.autoStartLoad) {\n this.startLoad(config.startPosition);\n }\n }\n\n onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n 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(track => {\n if(track.details) {\n track.details.fragments.forEach(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 = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n\n 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 onMediaEnded() {\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n\n onAudioTracksUpdated(data) {\n logger.log('audio tracks updated');\n this.tracks = data.audioTracks;\n }\n\n onAudioTrackSwitching(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\n this.fragCurrent = null;\n this.state = State.PAUSED;\n this.waitingFragment=null;\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\n //should we switch tracks ?\n if(altAudio){\n this.audioSwitch = true;\n //main audio track are handled by stream-controller, just do something if switching to alt audio track\n this.state=State.IDLE;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n }\n this.tick();\n }\n\n onAudioTrackLoaded(data) {\n var newDetails = data.details,\n trackId = data.id,\n track = this.tracks[trackId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n logger.log(`track ${trackId} loaded [${newDetails.startSN},${newDetails.endSN}],duration:${duration}`);\n\n if (newDetails.live) {\n var curDetails = track.details;\n if (curDetails && newDetails.fragments.length > 0) {\n // we already have details for that level, merge them\n LevelHelper.mergeDetails(curDetails,newDetails);\n sliding = newDetails.fragments[0].start;\n // TODO\n //this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n logger.log(`live audio playlist sliding:${sliding.toFixed(3)}`);\n } else {\n logger.log('live audio playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n logger.log('live audio playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n track.details = newDetails;\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 let startTimeOffset = newDetails.startTimeOffset;\n if(!isNaN(startTimeOffset)) {\n 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 onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n\n onFragLoaded(data) {\n var fragCurrent = this.fragCurrent,\n fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING &&\n fragCurrent &&\n fragLoaded.type === 'audio' &&\n fragLoaded.level === fragCurrent.level &&\n fragLoaded.sn === fragCurrent.sn) {\n var track = this.tracks[this.trackId],\n details = track.details,\n duration = details.totalduration,\n trackId = fragCurrent.level,\n sn = fragCurrent.sn,\n cc = fragCurrent.cc,\n audioCodec = this.config.defaultAudioCodec || track.audioCodec || 'mp4a.40.2',\n stats = this.stats = data.stats;\n if (sn === 'initSegment') {\n this.state = State.IDLE;\n\n stats.tparsed = stats.tbuffered = performance.now();\n details.initSegment.data = data.payload;\n this.hls.trigger(Event.FRAG_BUFFERED, {stats: stats, frag: fragCurrent, id : 'audio'});\n this.tick();\n } else {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.appended = false;\n if(!this.demuxer) {\n this.demuxer = new Demuxer(this.hls,'audio');\n }\n //Check if we have video initPTS\n // If not we need to wait for it\n let initPTS = this.initPTS[cc];\n let initSegmentData = details.initSegment ? details.initSegment.data : [];\n if (details.initSegment || initPTS !== undefined) {\n this.pendingBuffering = true;\n 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 let accurateTimeOffset = false; //details.PTSKnown || !details.live;\n this.demuxer.push(data.payload, initSegmentData, audioCodec, null, fragCurrent, duration, accurateTimeOffset, initPTS);\n } else {\n 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}`);\n this.waitingFragment=data;\n this.state=State.WAITING_INIT_PTS;\n }\n }\n }\n this.fragLoadError = 0;\n }\n\n onFragParsingInitSegment(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'audio' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n let tracks = data.tracks, track;\n\n // delete any video track found on audio demuxer\n if (tracks.video) {\n delete tracks.video;\n }\n\n // include levelCodec in audio and video tracks\n track = tracks.audio;\n if(track) {\n track.levelCodec = track.codec;\n track.id = data.id;\n this.hls.trigger(Event.BUFFER_CODECS,tracks);\n logger.log(`audio track:audio,container:${track.container},codecs[level/parsed]=[${track.levelCodec}/${track.codec}]`);\n let initSegment = track.initSegment;\n if (initSegment) {\n let appendObj = {type: 'audio', data: initSegment, parent : 'audio',content : 'initSegment'};\n if (this.audioSwitch) {\n this.pendingData = [appendObj];\n } else {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(Event.BUFFER_APPENDING, appendObj);\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n }\n\n onFragParsingData(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'audio' &&\n data.type === 'audio' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n let trackId= this.trackId,\n track = this.tracks[trackId],\n hls = this.hls;\n\n if (isNaN(data.endPTS)) {\n data.endPTS = data.startPTS + fragCurrent.duration;\n data.endDTS = data.startDTS + fragCurrent.duration;\n }\n\n 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 LevelHelper.updateFragPTSDTS(track.details,fragCurrent,data.startPTS,data.endPTS);\n\n let audioSwitch = this.audioSwitch, media = this.media, appendOnBufferFlush = false;\n //Only flush audio from old audio tracks when PTS is known on new audio track\n if(audioSwitch && media) {\n if (media.readyState) {\n let currentTime = media.currentTime;\n logger.log('switching audio track : currentTime:'+ currentTime);\n if (currentTime >= data.startPTS) {\n logger.log('switching audio track : flushing all audio');\n this.state = State.BUFFER_FLUSHING;\n hls.trigger(Event.BUFFER_FLUSHING, {startOffset: 0 , endOffset: Number.POSITIVE_INFINITY, type : 'audio'});\n appendOnBufferFlush = true;\n //Lets announce that the initial audio track switch flush occur\n this.audioSwitch = false;\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : trackId});\n }\n } else {\n //Lets announce that the initial audio track switch flush occur\n this.audioSwitch=false;\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : trackId});\n }\n }\n\n\n let pendingData = this.pendingData;\n if(!this.audioSwitch) {\n [data.data1, data.data2].forEach(buffer => {\n if (buffer && buffer.length) {\n pendingData.push({type: data.type, data: buffer, parent : 'audio',content : 'data'});\n }\n });\n if (!appendOnBufferFlush && pendingData.length) {\n pendingData.forEach(appendObj => {\n // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)\n // in that case it is useless to append following segments\n if (this.state === State.PARSING) {\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(Event.BUFFER_APPENDING, appendObj);\n }\n });\n this.pendingData = [];\n this.appended = true;\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsed(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'audio' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n\n\n onBufferCreated(data) {\n let audioTrack = data.tracks.audio;\n if (audioTrack) {\n this.mediaBuffer = audioTrack.buffer;\n this.loadedmetadata = true;\n }\n }\n\n onBufferAppended(data) {\n if (data.parent === 'audio') {\n const state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = (data.pending > 0);\n this._checkAppendedParsed();\n }\n }\n }\n\n _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n let frag = this.fragCurrent, stats = this.stats, hls = this.hls;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = performance.now();\n hls.trigger(Event.FRAG_BUFFERED, {stats: stats, frag: frag, id : 'audio'});\n let media = this.mediaBuffer ? this.mediaBuffer : this.media;\n logger.log(`audio buffered : ${TimeRanges.toString(media.buffered)}`);\n if (this.audioSwitch && this.appended) {\n this.audioSwitch = false;\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : this.trackId});\n }\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n\n onError(data) {\n let 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 ErrorDetails.FRAG_LOAD_ERROR:\n case 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 let 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.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.error(`audioStreamController: ${data.details} reaches max retry, redispatch as fatal ...`);\n // switch error to fatal\n data.fatal = true;\n this.state = State.ERROR;\n }\n }\n break;\n case ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case ErrorDetails.AUDIO_TRACK_LOAD_ERROR:\n case ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:\n case ErrorDetails.KEY_LOAD_ERROR:\n case 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.warn(`audioStreamController: ${data.details} while loading frag,switch to ${this.state} state ...`);\n }\n break;\n case ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (data.parent === 'audio' && (this.state === State.PARSING || this.state === State.PARSED)) {\n const media = this.mediaBuffer,\n currentTime = this.media.currentTime,\n mediaBuffered = media && BufferHelper.isBuffered(media,currentTime) && BufferHelper.isBuffered(media,currentTime+0.5);\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n const config = this.config;\n if(config.maxMaxBufferLength >= config.maxBufferLength) {\n // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...\n config.maxMaxBufferLength/=2;\n logger.warn(`audio:reduce max buffer length to ${config.maxMaxBufferLength}s`);\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\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/video-dev/hls.js/pull/708\n // in that case flush the whole audio buffer to recover\n logger.warn('buffer full error also media.currentTime is not buffered, flush audio buffer');\n this.fragCurrent = null;\n // flush everything\n this.state = State.BUFFER_FLUSHING;\n this.hls.trigger(Event.BUFFER_FLUSHING, {startOffset: 0 , endOffset: Number.POSITIVE_INFINITY, type : 'audio'});\n }\n }\n break;\n default:\n break;\n }\n }\n\n onBufferFlushed() {\n let pendingData = this.pendingData;\n if (pendingData && pendingData.length) {\n logger.log('appending pending audio data on Buffer Flushed');\n pendingData.forEach(appendObj => {\n this.hls.trigger(Event.BUFFER_APPENDING, appendObj);\n });\n this.appended = true;\n this.pendingData = [];\n this.state = State.PARSED;\n } else {\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}\nexport default AudioStreamController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/audio-stream-controller.js","/*\n * audio track controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nclass AudioTrackController extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.MANIFEST_LOADING,\n Event.MANIFEST_LOADED,\n Event.AUDIO_TRACK_LOADED);\n this.ticks = 0;\n this.ontick = this.tick.bind(this);\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n 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 doTick() {\n this.updateTrack(this.trackId);\n }\n onManifestLoading() {\n // reset audio tracks on manifest loading\n this.tracks = [];\n this.trackId = -1;\n }\n\n onManifestLoaded(data) {\n let tracks = data.audioTracks || [];\n let defaultFound = false;\n this.tracks = tracks;\n this.hls.trigger(Event.AUDIO_TRACKS_UPDATED, {audioTracks : tracks});\n // loop through available audio tracks and autoselect default if needed\n let id = 0;\n tracks.forEach(track => {\n if(track.default) {\n this.audioTrack = id;\n defaultFound = true;\n return;\n }\n id++;\n });\n if (defaultFound === false && tracks.length) {\n logger.log('no default audio track defined, use first audio track as default');\n this.audioTrack = 0;\n }\n }\n\n onAudioTrackLoaded(data) {\n if (data.id < this.tracks.length) {\n 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 get audioTracks() {\n return this.tracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n get audioTrack() {\n return this.trackId;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n set audioTrack(audioTrackId) {\n if (this.trackId !== audioTrackId || this.tracks[audioTrackId].details === undefined) {\n this.setAudioTrackInternal(audioTrackId);\n }\n }\n\n 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.log(`switching to audioTrack ${newId}`);\n let audioTrack = this.tracks[newId],\n hls = this.hls,\n type = audioTrack.type,\n url = audioTrack.url,\n eventObj = {id: newId, type : type, url : url};\n // keep AUDIO_TRACK_SWITCH for legacy reason\n hls.trigger(Event.AUDIO_TRACK_SWITCH, eventObj);\n hls.trigger(Event.AUDIO_TRACK_SWITCHING, eventObj);\n // check if we need to load playlist for this audio Track\n let 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.log(`(re)loading playlist for audioTrack ${newId}`);\n hls.trigger(Event.AUDIO_TRACK_LOADING, {url: url, id: newId});\n }\n }\n }\n\n updateTrack(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.log(`updating audioTrack ${newId}`);\n let audioTrack = this.tracks[newId], url = audioTrack.url;\n // check if we need to load playlist for this audio Track\n let 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.log(`(re)loading playlist for audioTrack ${newId}`);\n this.hls.trigger(Event.AUDIO_TRACK_LOADING, {url: url, id: newId});\n }\n }\n }\n}\n\nexport default AudioTrackController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/audio-track-controller.js","/*\n * Buffer Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n\n\nclass BufferController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHING,\n Event.MEDIA_DETACHING,\n Event.MANIFEST_PARSED,\n Event.BUFFER_RESET,\n Event.BUFFER_APPENDING,\n Event.BUFFER_CODECS,\n Event.BUFFER_EOS,\n Event.BUFFER_FLUSHING,\n Event.LEVEL_PTS_UPDATED,\n Event.LEVEL_UPDATED);\n\n // the value that we have set mediasource.duration to\n // (the actual duration may be tweaked slighly by the browser)\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 this.tracks = {};\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n onLevelPtsUpdated(data) {\n let type = data.type;\n let audioTrack = this.tracks.audio;\n\n // Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)\n // in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`\n // 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\n // `SourceBuffer.abort()` and adjusting `SourceBuffer.timestampOffset` if `SourceBuffer.updating` is false or awaiting `updateend`\n // event if SB is in updating state.\n // More info here: https://github.com/video-dev/hls.js/issues/332#issuecomment-257986486\n\n if (type === 'audio' && audioTrack && audioTrack.container === 'audio/mpeg') { // Chrome audio mp3 track\n let audioBuffer = this.sourceBuffer.audio;\n let delta = Math.abs(audioBuffer.timestampOffset - data.start);\n\n // adjust timestamp offset if time delta is greater than 100ms\n if (delta > 0.1) {\n let updating = audioBuffer.updating;\n\n try {\n audioBuffer.abort();\n } catch (err) {\n updating = true;\n logger.warn('can not abort audio buffer: ' + err);\n }\n\n if (!updating) {\n logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + data.start);\n audioBuffer.timestampOffset = data.start;\n } else {\n this.audioTimestampOffset = data.start;\n }\n }\n }\n }\n\n onManifestParsed(data) {\n let 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.log(`${sourceBufferNb} sourceBuffer(s) expected`);\n }\n this.sourceBufferNb = sourceBufferNb;\n }\n\n onMediaAttaching(data) {\n let 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 onMediaDetaching() {\n 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.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 URL.revokeObjectURL(this.media.src);\n this.media.removeAttribute('src');\n this.media.load();\n }\n\n this.mediaSource = null;\n this.media = null;\n this.pendingTracks = {};\n this.tracks = {};\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(Event.MEDIA_DETACHED);\n }\n\n onMediaSourceOpen() {\n logger.log('media source opened');\n this.hls.trigger(Event.MEDIA_ATTACHED, { media : this.media });\n let 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 checkPendingTracks() {\n // if any buffer codecs pending, check if we have enough to create sourceBuffers\n let 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 && (\n this.sourceBufferNb <= pendingTracksNb ||\n 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 onMediaSourceClose() {\n logger.log('media source closed');\n }\n\n onMediaSourceEnded() {\n logger.log('media source ended');\n }\n\n\n onSBUpdateEnd() {\n // update timestampOffset\n if (this.audioTimestampOffset) {\n let audioBuffer = this.sourceBuffer.audio;\n logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + this.audioTimestampOffset);\n audioBuffer.timestampOffset = this.audioTimestampOffset;\n delete this.audioTimestampOffset;\n }\n\n if (this._needsFlush) {\n this.doFlush();\n }\n\n if (this._needsEos) {\n this.checkEos();\n }\n this.appending = false;\n let parent = this.parent;\n // count nb of pending segments waiting for appending on this sourcebuffer\n let pending = this.segments.reduce( (counter, segment) => (segment.parent === parent) ? counter + 1 : counter , 0);\n this.hls.trigger(Event.BUFFER_APPENDED, { parent : parent, pending : pending });\n\n // don't append in flushing mode\n if (!this._needsFlush) {\n this.doAppending();\n }\n\n this.updateMediaElementDuration();\n }\n\n onSBUpdateError(event) {\n 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 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 }\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n\n 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) { this.pendingTracks[trackName] = tracks[trackName]; }\n let 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\n createSourceBuffers(tracks) {\n var sourceBuffer = this.sourceBuffer,mediaSource = this.mediaSource;\n\n for (let trackName in tracks) {\n if(!sourceBuffer[trackName]) {\n let track = tracks[trackName];\n // use levelCodec as first priority\n let codec = track.levelCodec || track.codec;\n let mimeType = `${track.container};codecs=${codec}`;\n logger.log(`creating sourceBuffer(${mimeType})`);\n try {\n let sb = sourceBuffer[trackName] = mediaSource.addSourceBuffer(mimeType);\n sb.addEventListener('updateend', this.onsbue);\n sb.addEventListener('error', this.onsbe);\n this.tracks[trackName] = {codec: codec, container: track.container};\n track.buffer = sb;\n } catch(err) {\n logger.error(`error while trying to add sourceBuffer:${err.message}`);\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_ADD_CODEC_ERROR, fatal: false, err: err, mimeType : mimeType});\n }\n }\n }\n this.hls.trigger(Event.BUFFER_CREATED, { tracks : tracks } );\n }\n\n 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 onBufferAppendFail(data) {\n 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false});\n }\n\n // on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()\n onBufferEos(data) {\n var sb = this.sourceBuffer;\n let dataType = data.type;\n for(let type in sb) {\n if (!dataType || type === dataType) {\n if (!sb[type].ended) {\n sb[type].ended = true;\n 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 checkEos() {\n var sb = this.sourceBuffer, mediaSource = this.mediaSource;\n if (!mediaSource || mediaSource.readyState !== 'open') {\n this._needsEos = false;\n return;\n }\n for(let type in sb) {\n let sbobj = sb[type];\n if (!sbobj.ended) {\n return;\n }\n if(sbobj.updating) {\n this._needsEos = true;\n return;\n }\n }\n 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 try {\n mediaSource.endOfStream();\n } catch(e) {\n logger.warn('exception while calling mediaSource.endOfStream()');\n }\n this._needsEos = false;\n }\n\n\n 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 onLevelUpdated(event) {\n let 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/video-dev/hls.js/issues/355\n updateMediaElementDuration() {\n let media = this.media,\n mediaSource = this.mediaSource,\n sourceBuffer = this.sourceBuffer,\n levelDuration = this._levelDuration;\n if (levelDuration === null || !media || !mediaSource || !sourceBuffer || media.readyState === 0 || mediaSource.readyState !== 'open') {\n return;\n }\n for (let 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 let duration = media.duration;\n // 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\n if ((levelDuration > this._msDuration && levelDuration > duration) || (duration === Infinity || isNaN(duration) )) {\n logger.log(`Updating mediasource duration to ${levelDuration.toFixed(3)}`);\n this._msDuration = mediaSource.duration = levelDuration;\n }\n }\n\n 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 try {\n for (var type in sourceBuffer) {\n appended += sourceBuffer[type].buffered.length;\n }\n } catch(error) {\n // error could be thrown while accessing buffered, in case sourcebuffer has already been removed from MediaSource\n // this is harmess at this stage, catch this to avoid reporting an internal exception\n logger.error('error while accessing sourceBuffer.buffered');\n }\n this.appended = appended;\n this.hls.trigger(Event.BUFFER_FLUSHED);\n }\n }\n\n doAppending() {\n var hls = this.hls, sourceBuffer = this.sourceBuffer, segments = this.segments;\n if (Object.keys(sourceBuffer).length) {\n if (this.media.error) {\n this.segments = [];\n 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 let segment = segments.shift();\n try {\n let type = segment.type, sb = sourceBuffer[type];\n if(sb) {\n if(!sb.updating) {\n // reset sourceBuffer ended flag before appending segment\n sb.ended = false;\n //logger.log(`appending ${segment.content} ${type} SB, size:${segment.data.length}, ${segment.parent}`);\n this.parent = segment.parent;\n sb.appendBuffer(segment.data);\n this.appendError = 0;\n this.appended++;\n this.appending = true;\n } else {\n segments.unshift(segment);\n }\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.error(`error while trying to append buffer:${err.message}`);\n segments.unshift(segment);\n var event = {type: ErrorTypes.MEDIA_ERROR, parent : segment.parent};\n if(err.code !== 22) {\n if (this.appendError) {\n this.appendError++;\n } else {\n this.appendError = 1;\n }\n event.details = ErrorDetails.BUFFER_APPEND_ERROR;\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.log(`fail ${hls.config.appendErrorMaxRetry} times to append segment in sourceBuffer`);\n segments = [];\n event.fatal = true;\n hls.trigger(Event.ERROR, event);\n return;\n } else {\n event.fatal = false;\n hls.trigger(Event.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 = ErrorDetails.BUFFER_FULL_ERROR;\n event.fatal = false;\n hls.trigger(Event.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 flushBuffer(startOffset, endOffset, typeIn) {\n var sb, i, bufStart, bufEnd, flushStart, flushEnd, sourceBuffer = this.sourceBuffer;\n if (Object.keys(sourceBuffer).length) {\n logger.log(`flushBuffer,pos/start/end: ${this.media.currentTime.toFixed(3)}/${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 try {\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.log(`flush ${type} [${flushStart},${flushEnd}], of [${bufStart},${bufEnd}], pos:${this.media.currentTime}`);\n sb.remove(flushStart, flushEnd);\n return false;\n }\n }\n } catch(e) {\n logger.warn('exception while accessing sourcebuffer, it might have been removed from MediaSource');\n }\n } else {\n //logger.log('abort ' + type + ' append in progress');\n // this will abort any appending in progress\n //sb.abort();\n logger.warn('cannot flush, sb updating in progress');\n return false;\n }\n }\n } else {\n logger.warn('abort flushing too many retries');\n }\n logger.log('buffer flushed');\n }\n // everything flushed !\n return true;\n }\n}\n\nexport default BufferController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/buffer-controller.js","/*\n * cap stream level to media size dimension controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\n\nclass CapLevelController extends EventHandler {\n\tconstructor(hls) {\n super(hls,\n Event.FPS_DROP_LEVEL_CAPPING,\n Event.MEDIA_ATTACHING,\n Event.MANIFEST_PARSED);\n\t}\n\n\tdestroy() {\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 onFpsDropLevelCapping(data) {\n\t // Don't add a restricted level more than once\n if (CapLevelController.isLevelAllowed(data.droppedLevel, this.restrictedLevels)) {\n this.restrictedLevels.push(data.droppedLevel);\n }\n }\n\n\tonMediaAttaching(data) {\n this.media = data.media instanceof HTMLVideoElement ? data.media : null;\n }\n\n onManifestParsed(data) {\n const hls = this.hls;\n this.restrictedLevels = [];\n if (hls.config.capLevelToPlayerSize) {\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n this.levels = data.levels;\n 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 detectPlayerSize() {\n if (this.media) {\n let levelsLength = this.levels ? this.levels.length : 0;\n if (levelsLength) {\n const hls = this.hls;\n hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);\n if (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 hls.streamController.nextLevelSwitch();\n }\n this.autoLevelCapping = 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 getMaxLevel(capLevelIndex) {\n if (!this.levels) {\n return -1;\n }\n\n const validLevels = this.levels.filter((level, index) =>\n CapLevelController.isLevelAllowed(index, this.restrictedLevels) && index <= capLevelIndex\n );\n\n return CapLevelController.getMaxLevelByMediaSize(validLevels, this.mediaWidth, this.mediaHeight);\n }\n\n get mediaWidth() {\n let width;\n const media = this.media;\n if (media) {\n width = media.width || media.clientWidth || media.offsetWidth;\n width *= CapLevelController.contentScaleFactor;\n }\n return width;\n }\n\n get mediaHeight() {\n let height;\n const media = this.media;\n if (media) {\n height = media.height || media.clientHeight || media.offsetHeight;\n height *= CapLevelController.contentScaleFactor;\n }\n return height;\n }\n\n static get contentScaleFactor() {\n let pixelRatio = 1;\n try {\n pixelRatio = window.devicePixelRatio;\n } catch(e) {}\n return pixelRatio;\n }\n\n static isLevelAllowed(level, restrictedLevels = []) {\n return restrictedLevels.indexOf(level) === -1;\n }\n\n static getMaxLevelByMediaSize(levels, width, height) {\n if (!levels || (levels && !levels.length)) {\n return -1;\n }\n\n // Levels can have the same dimensions but differing bandwidths - since levels are ordered, we can look to the next\n // to determine whether we've chosen the greatest bandwidth for the media's dimensions\n const atGreatestBandiwdth = (curLevel, nextLevel) => {\n if (!nextLevel) {\n return true;\n }\n return curLevel.width !== nextLevel.width || curLevel.height !== nextLevel.height;\n };\n\n // If we run through the loop without breaking, the media's dimensions are greater than every level, so default to\n // the max level\n let maxLevelIndex = levels.length - 1;\n\n for (let i = 0; i < levels.length; i+= 1) {\n const level = levels[i];\n if ((level.width >= width || level.height >= height) && atGreatestBandiwdth(level, levels[i + 1])) {\n maxLevelIndex = i;\n break;\n }\n }\n\n return maxLevelIndex;\n }\n}\n\nexport default CapLevelController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/cap-level-controller.js","/*\n * FPS Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nclass FPSController extends EventHandler{\n\n constructor(hls) {\n super(hls, Event.MEDIA_ATTACHING);\n }\n\n destroy() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.isVideoPlaybackQualityAvailable = false;\n }\n\n onMediaAttaching(data) {\n const config = this.hls.config;\n if (config.capLevelOnFPSDrop) {\n const video = this.video = data.media instanceof HTMLVideoElement ? data.media : null;\n if (typeof video.getVideoPlaybackQuality === 'function') {\n this.isVideoPlaybackQualityAvailable = true;\n }\n clearInterval(this.timer);\n this.timer = setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod);\n }\n }\n\n checkFPS(video, decodedFrames, droppedFrames) {\n let currentTime = performance.now();\n if (decodedFrames) {\n if (this.lastTime) {\n let currentPeriod = currentTime - this.lastTime,\n currentDropped = droppedFrames - this.lastDroppedFrames,\n currentDecoded = decodedFrames - this.lastDecodedFrames,\n droppedFPS = 1000 * currentDropped / currentPeriod,\n hls = this.hls;\n hls.trigger(Event.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 > hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {\n let currentLevel = hls.currentLevel;\n logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);\n if (currentLevel > 0 && (hls.autoLevelCapping === -1 || hls.autoLevelCapping >= currentLevel)) {\n currentLevel = currentLevel - 1;\n hls.trigger(Event.FPS_DROP_LEVEL_CAPPING, {level: currentLevel, droppedLevel: hls.currentLevel});\n hls.autoLevelCapping = currentLevel;\n hls.streamController.nextLevelSwitch();\n }\n }\n }\n }\n this.lastTime = currentTime;\n this.lastDroppedFrames = droppedFrames;\n this.lastDecodedFrames = decodedFrames;\n }\n }\n\n checkFPSInterval() {\n const video = this.video;\n if (video) {\n if (this.isVideoPlaybackQualityAvailable) {\n let videoPlaybackQuality = video.getVideoPlaybackQuality();\n this.checkFPS(video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);\n } else {\n this.checkFPS(video, video.webkitDecodedFrameCount, video.webkitDroppedFrameCount);\n }\n }\n }\n}\n\nexport default FPSController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/fps-controller.js","/*\n * id3 metadata track controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport ID3 from '../demux/id3';\n\nclass ID3TrackController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.FRAG_PARSING_METADATA);\n this.id3Track = undefined;\n this.media = undefined;\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n // Add ID3 metatadata text track.\n onMediaAttached(data) {\n this.media = data.media;\n if (!this.media) {\n return;\n }\n\n this.id3Track = this.media.addTextTrack('metadata', 'id3');\n this.id3Track.mode = 'hidden';\n }\n\n onMediaDetaching() {\n this.media = undefined;\n }\n\n onFragParsingMetadata(data) {\n const fragment = data.frag;\n const samples = data.samples;\n\n // Attempt to recreate Safari functionality by creating\n // WebKitDataCue objects when available and store the decoded\n // ID3 data in the value property of the cue\n let Cue = window.WebKitDataCue || window.VTTCue || window.TextTrackCue;\n\n for (let i = 0; i < samples.length; i++) {\n const frames = ID3.getID3Frames(samples[i].data);\n if (frames) {\n const startTime = samples[i].pts;\n let endTime = i < samples.length - 1 ? samples[i+1].pts : fragment.endPTS;\n\n // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE\n if (startTime === endTime) {\n endTime += 0.0001;\n }\n\n for(let j = 0; j < frames.length; j++) {\n const frame = frames[j];\n // Safari doesn't put the timestamp frame in the TextTrack\n if (!ID3.isTimeStampFrame(frame)) {\n const cue = new Cue(startTime, endTime, '');\n cue.value = frame;\n this.id3Track.addCue(cue);\n }\n }\n }\n }\n }\n}\n\nexport default ID3TrackController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/id3-track-controller.js","/*\n * Level Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport BufferHelper from '../helper/buffer-helper';\n\nclass LevelController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MANIFEST_LOADED,\n Event.LEVEL_LOADED,\n Event.FRAG_LOADED,\n Event.ERROR);\n this.ontick = this.tick.bind(this);\n this._manualLevel = -1;\n }\n\n destroy() {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n this._manualLevel = -1;\n }\n\n startLoad() {\n this.canload = true;\n let levels = this._levels;\n // clean up live level details to force reload them, and reset load errors\n if(levels) {\n levels.forEach(level => {\n level.loadError = 0;\n const levelDetails = level.details;\n if (levelDetails && levelDetails.live) {\n level.details = undefined;\n }\n });\n }\n // speed up live playlist refresh if timer exists\n if (this.timer) {\n this.tick();\n }\n }\n\n stopLoad() {\n this.canload = false;\n }\n\n onManifestLoaded(data) {\n var levels0 = [],\n levels = [],\n bitrateStart,\n bitrateSet = {},\n videoCodecFound = false,\n audioCodecFound = false,\n hls = this.hls,\n brokenmp4inmp3 = /chrome|firefox/.test(navigator.userAgent.toLowerCase()),\n checkSupported = function(type,codec) { return MediaSource.isTypeSupported(`${type}/mp4;codecs=${codec}`);};\n\n // regroup redundant level together\n data.levels.forEach(level => {\n if(level.videoCodec) {\n videoCodecFound = true;\n }\n // erase audio codec info if browser does not support mp4a.40.34. demuxer will autodetect codec and fallback to mpeg/audio\n if(brokenmp4inmp3 && level.audioCodec && level.audioCodec.indexOf('mp4a.40.34') !== -1) {\n level.audioCodec = undefined;\n }\n if(level.audioCodec || (level.attrs && level.attrs.AUDIO)) {\n audioCodecFound = true;\n }\n let 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(level => {\n if(level.videoCodec) {\n levels.push(level);\n }\n });\n } else {\n levels = levels0;\n }\n // only keep level with supported audio/video codecs\n levels = levels.filter(function(level) {\n let audioCodec = level.audioCodec, videoCodec = level.videoCodec;\n return (!audioCodec || checkSupported('audio',audioCodec)) &&\n (!videoCodec || checkSupported('video',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 (let i = 0; i < levels.length; i++) {\n if (levels[i].bitrate === bitrateStart) {\n this._firstLevel = i;\n logger.log(`manifest loaded,${levels.length} level(s) found, first bitrate:${bitrateStart}`);\n break;\n }\n }\n hls.trigger(Event.MANIFEST_PARSED, {levels: levels, firstLevel: this._firstLevel, stats: data.stats, audio : audioCodecFound, video : videoCodecFound, altAudio : data.audioTracks.length > 0});\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 get levels() {\n return this._levels;\n }\n\n get level() {\n return this._level;\n }\n\n set level(newLevel) {\n let 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 setLevelInternal(newLevel) {\n const levels = this._levels;\n const hls = this.hls;\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.log(`switching to level ${newLevel}`);\n this._level = newLevel;\n var levelProperties = levels[newLevel];\n levelProperties.level = newLevel;\n // LEVEL_SWITCH to be deprecated in next major release\n hls.trigger(Event.LEVEL_SWITCH, levelProperties);\n hls.trigger(Event.LEVEL_SWITCHING, levelProperties);\n }\n var level = levels[newLevel], 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 hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: newLevel, id: urlId});\n }\n } else {\n // invalid level id given, trigger error\n hls.trigger(Event.ERROR, {type : ErrorTypes.OTHER_ERROR, details: ErrorDetails.LEVEL_SWITCH_ERROR, level: newLevel, fatal: false, reason: 'invalid level idx'});\n }\n }\n\n get manualLevel() {\n return this._manualLevel;\n }\n\n set manualLevel(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 get firstLevel() {\n return this._firstLevel;\n }\n\n set firstLevel(newLevel) {\n this._firstLevel = newLevel;\n }\n\n get startLevel() {\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 let 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\n set startLevel(newLevel) {\n this._startLevel = newLevel;\n }\n\n onError(data) {\n if(data.fatal) {\n return;\n }\n\n let details = data.details, hls = this.hls, levelId, level, levelError = false;\n // try to recover not fatal errors\n switch(details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n case ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case ErrorDetails.KEY_LOAD_ERROR:\n case ErrorDetails.KEY_LOAD_TIMEOUT:\n levelId = data.frag.level;\n break;\n case ErrorDetails.LEVEL_LOAD_ERROR:\n case ErrorDetails.LEVEL_LOAD_TIMEOUT:\n levelId = data.context.level;\n levelError = true;\n break;\n case ErrorDetails.REMUX_ALLOC_ERROR:\n levelId = data.level;\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.loadError) {\n level.loadError = 1;\n } else {\n level.loadError++;\n }\n // if any redundant streams available and if we haven't try them all (level.loadError is reseted on successful frag/level load.\n // if level.loadError reaches nbRedundantLevel it means that we tried them all, no hope => let's switch down\n const nbRedundantLevel = level.url.length;\n if (nbRedundantLevel > 1 && level.loadError < nbRedundantLevel) {\n level.urlId = (level.urlId + 1) % nbRedundantLevel;\n level.details = undefined;\n 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 let recoverable = ((this._manualLevel === -1) && levelId);\n if (recoverable) {\n logger.warn(`level controller,${details}: switch-down for next fragment`);\n hls.nextAutoLevel = Math.max(0,levelId-1);\n } else if(level && level.details && level.details.live) {\n 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 === ErrorDetails.LEVEL_LOAD_ERROR ||\n details === ErrorDetails.LEVEL_LOAD_TIMEOUT) {\n let media = hls.media,\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && BufferHelper.isBuffered(media,media.currentTime) && BufferHelper.isBuffered(media,media.currentTime+0.5);\n if (mediaBuffered) {\n let retryDelay = hls.config.levelLoadingRetryDelay;\n logger.warn(`level controller,${details}, but media buffered, retry in ${retryDelay}ms`);\n this.timer = setTimeout(this.ontick,retryDelay);\n // boolean used to inform stream controller not to switch back to IDLE on non fatal error\n data.levelRetry = true;\n } else {\n 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 // switch error to fatal\n data.fatal = true;\n }\n }\n }\n }\n }\n\n // reset level load error counter on successful frag loaded\n onFragLoaded(data) {\n const fragLoaded = data.frag;\n if (fragLoaded && fragLoaded.type === 'main') {\n const level = this._levels[fragLoaded.level];\n if (level) {\n level.loadError = 0;\n }\n }\n }\n\n onLevelLoaded(data) {\n const levelId = data.level;\n // only process level loaded events matching with expected level\n if (levelId === this._level) {\n let curLevel = this._levels[levelId];\n // reset level load error counter on successful level loaded\n curLevel.loadError = 0;\n let newDetails = data.details;\n // if current playlist is a live playlist, arm a timer to reload it\n if (newDetails.live) {\n let reloadInterval = 1000*( newDetails.averagetargetduration ? newDetails.averagetargetduration : newDetails.targetduration),\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.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.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 tick() {\n var levelId = this._level;\n if (levelId !== undefined && this.canload) {\n var level = this._levels[levelId];\n if (level && level.url) {\n var urlId = level.urlId;\n this.hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: levelId, id: urlId});\n }\n }\n }\n\n get nextLoadLevel() {\n if (this._manualLevel !== -1) {\n return this._manualLevel;\n } else {\n return this.hls.nextAutoLevel;\n }\n }\n\n set nextLoadLevel(nextLevel) {\n this.level = nextLevel;\n if (this._manualLevel === -1) {\n this.hls.nextAutoLevel = nextLevel;\n }\n }\n}\n\nexport default LevelController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/level-controller.js","/*\n * Stream Controller\n*/\n\nimport BinarySearch from '../utils/binary-search';\nimport BufferHelper from '../helper/buffer-helper';\nimport Demuxer from '../demux/demuxer';\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport LevelHelper from '../helper/level-helper';\nimport TimeRanges from '../utils/timeRanges';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nconst State = {\n STOPPED : 'STOPPED',\n IDLE : 'IDLE',\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 BUFFER_FLUSHING : 'BUFFER_FLUSHING',\n ENDED : 'ENDED',\n ERROR : 'ERROR'\n};\n\nclass StreamController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.MANIFEST_LOADING,\n Event.MANIFEST_PARSED,\n Event.LEVEL_LOADED,\n Event.KEY_LOADED,\n Event.FRAG_LOADED,\n Event.FRAG_LOAD_EMERGENCY_ABORTED,\n Event.FRAG_PARSING_INIT_SEGMENT,\n Event.FRAG_PARSING_DATA,\n Event.FRAG_PARSED,\n Event.ERROR,\n Event.AUDIO_TRACK_SWITCHING,\n Event.AUDIO_TRACK_SWITCHED,\n Event.BUFFER_CREATED,\n Event.BUFFER_APPENDED,\n Event.BUFFER_FLUSHED);\n\n this.config = hls.config;\n this.audioCodecSwap = false;\n this.ticks = 0;\n this._state = State.STOPPED;\n this.ontick = this.tick.bind(this);\n }\n\n destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n EventHandler.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n\n startLoad(startPosition) {\n if (this.levels) {\n let lastCurrentTime = this.lastCurrentTime, 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 (!this.startFragRequested) {\n // determine load level\n let 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 // if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime\n if (lastCurrentTime > 0 && startPosition === -1) {\n logger.log(`override startPosition with lastCurrentTime @${lastCurrentTime.toFixed(3)}`);\n startPosition = lastCurrentTime;\n }\n this.state = State.IDLE;\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime = startPosition;\n this.tick();\n } else {\n this.forceStartLoad = true;\n this.state = State.STOPPED;\n }\n }\n\n 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 this.forceStartLoad = false;\n }\n\n 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 doTick() {\n switch(this.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n break;\n case State.BUFFER_FLUSHING:\n // in buffer flushing state, reset fragLoadError counter\n this.fragLoadError = 0;\n break;\n case State.IDLE:\n this._doTickIdle();\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.log(`mediaController: retryDate reached, switch back to IDLE state`);\n this.state = State.IDLE;\n }\n break;\n case State.ERROR:\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 _doTickIdle() {\n const 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 start level loaded and media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (this.levelLastLoaded !== undefined && !media &&\n (this.startFragRequested || !config.startFragPrefetch)) {\n return;\n }\n\n // if we have not yet loaded any fragment, start loading from start position\n let pos;\n if (this.loadedmetadata) {\n pos = media.currentTime;\n } else {\n pos = this.nextLoadPosition;\n }\n // determine next load level\n let level = hls.nextLoadLevel,\n levelInfo = this.levels[level];\n\n if (!levelInfo) {\n return;\n }\n\n let levelBitrate = levelInfo.bitrate,\n maxBufLen;\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 if (levelBitrate) {\n maxBufLen = Math.max(8 * config.maxBufferSize / levelBitrate, 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 const bufferInfo = BufferHelper.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;\n }\n\n // if buffer length is less than maxBufLen try to load a new fragment ...\n 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 this.level = hls.nextLoadLevel = level;\n\n const levelDetails = levelInfo.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;\n }\n\n // we just got done loading the final fragment, and currentPos is buffered, and there is no other buffered range after ...\n // rationale is that in case there are any buffered rangesafter, it means that there are unbuffered portion in between\n // so we should not switch to ENDED in that case, to be able to buffer themx\n let fragPrevious = this.fragPrevious;\n if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN && bufferLen && !bufferInfo.nextStart) {\n // fragPrevious is last fragment. retrieve level duration using last frag start offset + duration\n // real duration might be lower than initial duration if there are drifts between real frag duration and playlist signaling\n const duration = Math.min(media.duration,fragPrevious.start + fragPrevious.duration);\n // if 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 (audio/video offsets...)\n // tolerate up to one frag duration to cope with these cases.\n // 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\n if (duration - Math.max(bufferInfo.end,fragPrevious.start) <= Math.max(0.2,fragPrevious.duration)) {\n // Finalize the media stream\n let data = {};\n if (this.altAudio) {\n data.type = 'video';\n }\n this.hls.trigger(Event.BUFFER_EOS,data);\n this.state = State.ENDED;\n return;\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 this._fetchPayloadOrEos(pos, bufferInfo, levelDetails);\n }\n\n _fetchPayloadOrEos(pos, bufferInfo, levelDetails) {\n const 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;\n }\n\n // find fragment index, contiguous with end of buffer position\n let start = fragments[0].start,\n end = fragments[fragLen-1].start + fragments[fragLen-1].duration,\n bufferEnd = bufferInfo.end,\n frag;\n\n if (levelDetails.initSegment && !levelDetails.initSegment.data) {\n frag = levelDetails.initSegment;\n } else {\n // in case of live playlist we need to ensure that requested position is not located before playlist start\n if (levelDetails.live) {\n let initialLiveManifestSize = this.config.initialLiveManifestSize;\n if(fragLen < initialLiveManifestSize){\n logger.warn(`Can not start playback of a level, reason: not enough fragments ${fragLen} < ${initialLiveManifestSize}`);\n return;\n }\n\n frag = this._ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen);\n // if it explicitely returns null don't load any fragment and exit function now\n if (frag === null) {\n return;\n }\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 }\n if (!frag) {\n frag = this._findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails);\n }\n if(frag) {\n this._loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd);\n }\n return;\n }\n\n _ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen) {\n const config = this.hls.config, media = this.media;\n\n let frag;\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 let maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount*levelDetails.targetduration;\n\n if (bufferEnd < Math.max(start-config.maxFragLookUpTolerance, end - maxLatency)) {\n let liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);\n 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 this.nextLoadPosition = liveSyncPosition;\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.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.log(`live playlist, switching playlist, unknown, load middle frag : ${frag.sn}`);\n }\n }\n return frag;\n }\n\n _findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails) {\n const config = this.hls.config;\n let frag;\n let foundFrag;\n let maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n const fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;\n let fragmentWithinToleranceTest = (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 // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments\n let candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);\n if (candidate.start + candidate.duration - candidateLookupTolerance <= bufferEnd) {\n return 1;\n } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n };\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n // Prefer the next fragment if it's within tolerance\n if (fragNext && !fragmentWithinToleranceTest(fragNext)) {\n foundFrag = fragNext;\n } else {\n foundFrag = BinarySearch.search(fragments, fragmentWithinToleranceTest);\n }\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen-1];\n }\n if (foundFrag) {\n frag = foundFrag;\n const curSNIdx = frag.sn - levelDetails.startSN;\n const sameLevel = fragPrevious && frag.level === fragPrevious.level;\n const prevFrag = fragments[curSNIdx - 1];\n const nextFrag = fragments[curSNIdx + 1];\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.sn === fragPrevious.sn) {\n if (sameLevel && !frag.backtracked) {\n if (frag.sn < levelDetails.endSN) {\n let deltaPTS = fragPrevious.deltaPTS;\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 = prevFrag;\n 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 = nextFrag;\n logger.log(`SN just loaded, load next one: ${frag.sn}`);\n }\n } else {\n frag = null;\n }\n } else if (frag.backtracked) {\n // Only backtrack a max of 1 consecutive fragment to prevent sliding back too far when little or no frags start with keyframes\n if (nextFrag && nextFrag.backtracked) {\n logger.warn(`Already backtracked from fragment ${nextFrag.sn}, will not backtrack to fragment ${frag.sn}. Loading fragment ${nextFrag.sn}`);\n frag = nextFrag;\n } else {\n // If a fragment has dropped frames and it's in a same level/sequence, load the previous fragment to try and find the keyframe\n // 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\n logger.warn('Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe');\n frag.dropped = 0;\n if (prevFrag) {\n if (prevFrag.loadCounter) {\n prevFrag.loadCounter--;\n }\n frag = prevFrag;\n frag.backtracked = true;\n } else if (curSNIdx) {\n // can't backtrack on very first fragment\n frag = null;\n }\n }\n }\n }\n }\n return frag;\n }\n\n _loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd) {\n const 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 && frag.decryptdata.uri != null) && (frag.decryptdata.key == null)) {\n logger.log(`Loading key for ${frag.sn} of [${levelDetails.startSN} ,${levelDetails.endSN}],level ${level}`);\n this.state = State.KEY_LOADING;\n hls.trigger(Event.KEY_LOADING, {frag: frag});\n } else {\n 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 let 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 if (!isNaN(frag.sn)) {\n this.nextLoadPosition = frag.start + frag.duration;\n }\n frag.autoLevel = hls.autoLevelEnabled;\n frag.bitrateTest = this.bitrateTest;\n hls.trigger(Event.FRAG_LOADING, {frag: frag});\n // lazy demuxer init, as this could take some time ... do it during frag loading\n if (!this.demuxer) {\n this.demuxer = new Demuxer(hls,'main');\n }\n this.state = State.FRAG_LOADING;\n return;\n }\n }\n\n set state(nextState) {\n if (this.state !== nextState) {\n const previousState = this.state;\n this._state = nextState;\n logger.log(`main stream:${previousState}->${nextState}`);\n this.hls.trigger(Event.STREAM_STATE_TRANSITION, {previousState, nextState});\n }\n }\n\n get state() {\n return this._state;\n }\n\n getBufferedFrag(position) {\n return BinarySearch.search(this._bufferedFrags, function(frag) {\n if (position < frag.startPTS) {\n return -1;\n } else if (position > frag.endPTS) {\n return 1;\n }\n return 0;\n });\n }\n\n get currentLevel() {\n let media = this.media;\n if (media) {\n const frag = this.getBufferedFrag(media.currentTime);\n if (frag) {\n return frag.level;\n }\n }\n return -1;\n }\n\n get nextBufferedFrag() {\n let media = this.media;\n if (media) {\n // first get end range of current fragment\n return this.followingBufferedFrag(this.getBufferedFrag(media.currentTime));\n } else {\n return null;\n }\n }\n\n followingBufferedFrag(frag) {\n if (frag) {\n // try to get range of next fragment (500ms after this range)\n return this.getBufferedFrag(frag.endPTS + 0.5);\n }\n return null;\n }\n\n get nextLevel() {\n const frag = this.nextBufferedFrag;\n if (frag) {\n return frag.level;\n } else {\n return -1;\n }\n }\n\n _checkFragmentChanged() {\n var fragPlayingCurrent, currentTime, 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 (BufferHelper.isBuffered(video,currentTime)) {\n fragPlayingCurrent = this.getBufferedFrag(currentTime);\n } else if (BufferHelper.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 fragPlayingCurrent = this.getBufferedFrag(currentTime + 0.1);\n }\n if (fragPlayingCurrent) {\n var fragPlaying = fragPlayingCurrent;\n if (fragPlaying !== this.fragPlaying) {\n this.hls.trigger(Event.FRAG_CHANGED, {frag: fragPlaying});\n const fragPlayingLevel = fragPlaying.level;\n if (!this.fragPlaying || this.fragPlaying.level !== fragPlayingLevel) {\n this.hls.trigger(Event.LEVEL_SWITCHED, {level: fragPlayingLevel});\n }\n this.fragPlaying = 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 immediateLevelSwitch() {\n logger.log('immediateLevelSwitch');\n if (!this.immediateSwitch) {\n this.immediateSwitch = true;\n let media = this.media, previouslyPaused;\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 // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // flush everything\n this.flushMainBuffer(0,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 immediateLevelSwitchEnd() {\n let media = this.media;\n if (media && media.buffered.length) {\n this.immediateSwitch = false;\n if(BufferHelper.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 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 let media = this.media;\n // ensure that media is defined and that metadata are available (to retrieve currentTime)\n if (media && media.readyState) {\n let fetchdelay, fragPlayingCurrent, nextBufferedFrag;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n fragPlayingCurrent = this.getBufferedFrag(media.currentTime);\n if (fragPlayingCurrent && fragPlayingCurrent.startPTS > 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.flushMainBuffer(0,fragPlayingCurrent.startPTS - 1);\n }\n if (!media.paused) {\n // add a safety delay of 1s\n var nextLevelId = this.hls.nextLoadLevel,nextLevel = this.levels[nextLevelId], 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 nextBufferedFrag = this.getBufferedFrag(media.currentTime + fetchdelay);\n if (nextBufferedFrag) {\n // we can flush buffer range following this one without stalling playback\n nextBufferedFrag = this.followingBufferedFrag(nextBufferedFrag);\n if (nextBufferedFrag) {\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 // start flush position is the start PTS of next buffered frag.\n // we use frag.naxStartPTS which is max(audio startPTS, video startPTS).\n // in case there is a small PTS Delta between audio and video, using maxStartPTS avoids flushing last samples from current fragment\n this.flushMainBuffer(nextBufferedFrag.maxStartPTS , Number.POSITIVE_INFINITY);\n }\n }\n }\n }\n\n flushMainBuffer(startOffset,endOffset) {\n this.state = State.BUFFER_FLUSHING;\n let flushScope = {startOffset: startOffset, endOffset: endOffset};\n // if alternate audio tracks are used, only flush video, otherwise flush everything\n if (this.altAudio) {\n flushScope.type = 'video';\n }\n this.hls.trigger(Event.BUFFER_FLUSHING, flushScope);\n }\n\n 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 let config = this.config;\n if(this.levels && config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n\n onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n 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(level => {\n if(level.details) {\n level.details.fragments.forEach(fragment => {\n fragment.loadCounter = undefined;\n fragment.backtracked = 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 = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n\n onMediaSeeking() {\n let media = this.media, currentTime = media ? media.currentTime : undefined, config = this.config;\n if (!isNaN(currentTime)) {\n logger.log(`media seeking to ${currentTime.toFixed(3)}`);\n }\n let mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media;\n let bufferInfo = BufferHelper.bufferInfo(mediaBuffer,currentTime,this.config.maxBufferHole);\n if (this.state === State.FRAG_LOADING) {\n let 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 let 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.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.log('seeking outside of buffer but within currently loaded fragment range');\n }\n }\n } else if (this.state === State.ENDED) {\n // if seeking to unbuffered area, clean up fragPrevious\n if (bufferInfo.len === 0) {\n this.fragPrevious = 0;\n }\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 // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target\n if(!this.loadedmetadata) {\n this.nextLoadPosition = this.startPosition = currentTime;\n }\n // tick to speed up processing\n this.tick();\n }\n\n onMediaSeeked() {\n const media = this.media, currentTime = media ? media.currentTime : undefined;\n if (!isNaN(currentTime)) {\n logger.log(`media seeked to ${currentTime.toFixed(3)}`);\n }\n // tick to speed up FRAGMENT_PLAYING triggering\n this.tick();\n }\n\n onMediaEnded() {\n logger.log('media ended');\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n\n onManifestLoading() {\n // reset buffer on manifest loading\n logger.log('trigger BUFFER_RESET');\n this.hls.trigger(Event.BUFFER_RESET);\n this._bufferedFrags = [];\n this.stalled = false;\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n onManifestParsed(data) {\n var aac = false, heaac = false, codec;\n data.levels.forEach(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.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 let config = this.config;\n if (config.autoStartLoad || this.forceStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n\n 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.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 LevelHelper.mergeDetails(curDetails,newDetails);\n sliding = newDetails.fragments[0].start;\n this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n logger.log(`live playlist sliding:${sliding.toFixed(3)}`);\n } else {\n logger.log('live playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n 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(Event.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 let startTimeOffset = newDetails.startTimeOffset;\n if(!isNaN(startTimeOffset)) {\n if (startTimeOffset < 0) {\n logger.log(`negative start time offset ${startTimeOffset}, count from end of last fragment`);\n startTimeOffset = sliding + duration + startTimeOffset;\n }\n 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.log(`configure startPosition to ${this.startPosition}`);\n } else {\n this.startPosition = 0;\n }\n }\n this.lastCurrentTime = this.startPosition;\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 onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n\n onFragLoaded(data) {\n var fragCurrent = this.fragCurrent,\n fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING &&\n fragCurrent &&\n fragLoaded.type === 'main' &&\n fragLoaded.level === fragCurrent.level &&\n fragLoaded.sn === fragCurrent.sn) {\n let stats = data.stats,\n currentLevel = this.levels[fragCurrent.level],\n details = currentLevel.details;\n 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 this.stats = stats;\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(Event.FRAG_BUFFERED, {stats: stats, frag: fragCurrent, id : 'main'});\n this.tick();\n } else if (fragLoaded.sn === 'initSegment') {\n this.state = State.IDLE;\n stats.tparsed = stats.tbuffered = performance.now();\n details.initSegment.data = data.payload;\n this.hls.trigger(Event.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 let duration = details.totalduration,\n level = fragCurrent.level,\n sn = fragCurrent.sn,\n audioCodec = this.config.defaultAudioCodec || currentLevel.audioCodec;\n if(this.audioCodecSwap) {\n 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.pendingBuffering = true;\n this.appended = false;\n logger.log(`Parsing ${sn} of [${details.startSN} ,${details.endSN}],level ${level}, cc ${fragCurrent.cc}`);\n let demuxer = this.demuxer;\n if (!demuxer) {\n demuxer = this.demuxer = new Demuxer(this.hls,'main');\n }\n // 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)\n let media = this.media;\n let mediaSeeking = media && media.seeking;\n let accurateTimeOffset = !mediaSeeking && (details.PTSKnown || !details.live);\n let initSegmentData = details.initSegment ? details.initSegment.data : [];\n demuxer.push(data.payload, initSegmentData,audioCodec, currentLevel.videoCodec, fragCurrent, duration, accurateTimeOffset,undefined);\n }\n }\n this.fragLoadError = 0;\n }\n\n onFragParsingInitSegment(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'main' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n var tracks = data.tracks, trackName, 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.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 && track.container !== 'audio/mpeg') { // Exclude mpeg audio\n audioCodec = 'mp4a.40.2';\n 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 this.hls.trigger(Event.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.log(`main track:${trackName},container:${track.container},codecs[level/parsed]=[${track.levelCodec}/${track.codec}]`);\n var initSegment = track.initSegment;\n if (initSegment) {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(Event.BUFFER_APPENDING, {type: trackName, data: initSegment, parent : 'main', content : 'initSegment'});\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsingData(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'main' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n !(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 = fragCurrent;\n if (isNaN(data.endPTS)) {\n data.endPTS = data.startPTS + fragCurrent.duration;\n data.endDTS = data.startDTS + fragCurrent.duration;\n }\n\n 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 // Detect gaps in a fragment and try to fix it by finding a keyframe in the previous fragment (see _findFragments)\n if(data.type === 'video') {\n frag.dropped = data.dropped;\n if (frag.dropped) {\n if (!frag.backtracked) {\n logger.warn('missing video frame(s), backtracking fragment');\n // Return back to the IDLE state without appending to buffer\n // Causes findFragments to backtrack a segment and find the keyframe\n // Audio fragments arriving before video sets the nextLoadPosition, causing _findFragments to skip the backtracked fragment\n frag.backtracked = true;\n this.nextLoadPosition = data.startPTS;\n this.state = State.IDLE;\n this.fragPrevious = frag;\n this.tick();\n return;\n } else {\n logger.warn('Already backtracked on this fragment, appending with the gap');\n }\n } else {\n // Only reset the backtracked flag if we've loaded the frag without any dropped frames\n frag.backtracked = false;\n }\n }\n\n var drift = LevelHelper.updateFragPTSDTS(level.details,frag,data.startPTS,data.endPTS,data.startDTS,data.endDTS),\n hls = this.hls;\n hls.trigger(Event.LEVEL_PTS_UPDATED, {details: level.details, level: this.level, drift: drift, type: data.type, start: data.startPTS, end: data.endPTS});\n\n // has remuxer dropped video frames located before first keyframe ?\n [data.data1, data.data2].forEach(buffer => {\n // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)\n // in that case it is useless to append following segments\n if (buffer && buffer.length && this.state === State.PARSING) {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n hls.trigger(Event.BUFFER_APPENDING, {type: data.type, data: buffer, parent : 'main',content : 'data'});\n }\n });\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsed(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'main' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n\n onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url,\n trackId = data.id;\n // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered\n // don't do anything if we switch to alt audio: audio stream controller is handling it.\n // we will just have to change buffer scheduling on audioTrackSwitched\n if (!altAudio) {\n if (this.mediaBuffer !== this.media) {\n logger.log(`switching on main audio, use media.buffered to schedule main fragment loading`);\n this.mediaBuffer = this.media;\n let 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.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 let hls = this.hls;\n // switching to main audio, flush all audio and trigger track switched\n hls.trigger(Event.BUFFER_FLUSHING, {startOffset: 0 , endOffset: Number.POSITIVE_INFINITY, type : 'audio'});\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : trackId});\n this.altAudio = false;\n }\n }\n\n onAudioTrackSwitched(data) {\n var trackId = data.id,\n altAudio = !!this.hls.audioTracks[trackId].url;\n if (altAudio) {\n let videoBuffer = this.videoBuffer;\n // if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered\n if (videoBuffer && this.mediaBuffer !== videoBuffer) {\n logger.log(`switching on alternate audio, use video.buffered to schedule main fragment loading`);\n this.mediaBuffer = videoBuffer;\n }\n }\n this.altAudio = altAudio;\n this.tick();\n }\n\n\n\n onBufferCreated(data) {\n let tracks = data.tracks, mediaTrack, name, alternate = false;\n for(var type in tracks) {\n let 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.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 onBufferAppended(data) {\n if (data.parent === 'main') {\n const state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = (data.pending > 0);\n this._checkAppendedParsed();\n }\n }\n }\n\n _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n const frag = this.fragCurrent;\n if (frag) {\n const media = this.mediaBuffer ? this.mediaBuffer : this.media;\n logger.log(`main buffered : ${TimeRanges.toString(media.buffered)}`);\n // filter fragments potentially evicted from buffer. this is to avoid memleak on live streams\n let bufferedFrags = this._bufferedFrags.filter(frag => {return BufferHelper.isBuffered(media,(frag.startPTS + frag.endPTS) / 2);});\n // push new range\n bufferedFrags.push(frag);\n // sort frags, as we use BinarySearch for lookup in getBufferedFrag ...\n this._bufferedFrags = bufferedFrags.sort(function(a,b) {return (a.startPTS - b.startPTS);});\n this.fragPrevious = frag;\n const stats = this.stats;\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(Event.FRAG_BUFFERED, {stats: stats, frag: frag, id : 'main'});\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n\n onError(data) {\n let 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 let media = this.media,\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && BufferHelper.isBuffered(media,media.currentTime) && BufferHelper.isBuffered(media,media.currentTime+0.5);\n switch(data.details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n case ErrorDetails.KEY_LOAD_ERROR:\n case ErrorDetails.KEY_LOAD_TIMEOUT:\n if(!data.fatal) {\n var loadError = this.fragLoadError;\n if(loadError) {\n loadError++;\n } else {\n loadError=1;\n }\n let config = this.config;\n // keep retrying / don't raise fatal network error if current position is buffered or if in automode with current level not 0\n if (loadError <= config.fragLoadingMaxRetry || mediaBuffered || (frag.autoLevel && frag.level)) {\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.warn(`mediaController: frag loading failed, retry in ${delay} ms`);\n this.retryDate = performance.now() + delay;\n // retry loading state\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 this.nextLoadPosition = this.startPosition;\n }\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n logger.error(`mediaController: ${data.details} reaches max retry, redispatch as fatal ...`);\n // switch error to fatal\n data.fatal = true;\n this.state = State.ERROR;\n }\n }\n break;\n case 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 // switch error to fatal\n data.fatal = true;\n this.state = State.ERROR;\n }\n }\n }\n break;\n case ErrorDetails.LEVEL_LOAD_ERROR:\n case ErrorDetails.LEVEL_LOAD_TIMEOUT:\n if(this.state !== State.ERROR) {\n if (data.fatal) {\n // if fatal error, stop processing\n this.state = State.ERROR;\n logger.warn(`streamController: ${data.details},switch to ${this.state} state ...`);\n } else {\n // in case of non fatal error while loading level, if level controller is not retrying to load level , switch back to IDLE\n if (!data.levelRetry && this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n }\n }\n break;\n case ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (data.parent === 'main' && (this.state === State.PARSING || this.state === State.PARSED)) {\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n this._reduceMaxBufferLength(this.config.maxBufferLength);\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/video-dev/hls.js/pull/708\n // in that case flush the whole buffer to recover\n logger.warn('buffer full error also media.currentTime is not buffered, flush everything');\n this.fragCurrent = null;\n // flush everything\n this.flushMainBuffer(0,Number.POSITIVE_INFINITY);\n }\n }\n break;\n default:\n break;\n }\n }\n\n _reduceMaxBufferLength(minLength) {\n let 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.warn(`main:reduce max buffer length to ${config.maxMaxBufferLength}s`);\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n }\n\n_checkBuffer() {\n var media = this.media,\n config = this.config;\n // if ready state different from HAVE_NOTHING (numeric value 0), we are allowed to seek\n if(media && media.readyState) {\n let currentTime = media.currentTime,\n mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media,\n buffered = mediaBuffer.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 let startPosition = media.seeking ? currentTime : this.startPosition,\n startPositionBuffered = BufferHelper.isBuffered(mediaBuffer,startPosition),\n firstbufferedPosition = buffered.start(0);\n // if currentTime not matching with expected startPosition or startPosition not buffered\n if (currentTime !== startPosition ||\n (!startPositionBuffered && (Math.abs(startPosition-firstbufferedPosition) < config.maxSeekHole))) {\n logger.log(`target start position:${startPosition}`);\n // if startPosition not buffered, let's seek to buffered.start(0)\n if(!startPositionBuffered) {\n startPosition = firstbufferedPosition;\n logger.log(`target start position not buffered, seek to buffered.start(0) ${startPosition}`);\n }\n logger.log(`adjust currentTime from ${currentTime} to ${startPosition}`);\n media.currentTime = startPosition;\n }\n } else if (this.immediateSwitch) {\n this.immediateLevelSwitchEnd();\n } else {\n let bufferInfo = BufferHelper.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), // not playing if nothing buffered\n jumpThreshold = 0.5, // tolerance needed as some browsers stalls playback before reaching buffered range end\n playheadMoving = currentTime !== this.lastCurrentTime;\n\n if (playheadMoving) {\n // played moving, but was previously stalled => now not stuck anymore\n if (this.stallReported) {\n logger.warn(`playback not stuck anymore @${currentTime}, after ${Math.round(performance.now()-this.stalled)}ms`);\n this.stallReported = false;\n }\n this.stalled = undefined;\n this.nudgeRetry = 0;\n } else {\n // playhead not moving\n if(expectedPlaying) {\n // playhead not moving BUT media expected to play\n const tnow = performance.now();\n const hls = this.hls;\n if(!this.stalled) {\n // stall just detected, store current time\n this.stalled = tnow;\n this.stallReported = false;\n } else {\n // playback already stalled, check stalling duration\n // if stalling for more than a given threshold, let's try to recover\n const stalledDuration = tnow - this.stalled;\n const bufferLen = bufferInfo.len;\n let nudgeRetry = this.nudgeRetry || 0;\n // have we reached stall deadline ?\n if (bufferLen <= jumpThreshold && stalledDuration > config.lowBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n logger.warn(`playback stalling in low buffer @${currentTime}`);\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer : bufferLen});\n }\n // if buffer len is below threshold, try to jump to start of next buffer range if close\n // no buffer available @ currentTime, check if next buffer is close (within a config.maxSeekHole second range)\n var nextBufferStart = bufferInfo.nextStart, delta = nextBufferStart-currentTime;\n if(nextBufferStart &&\n (delta < config.maxSeekHole) &&\n (delta > 0)) {\n this.nudgeRetry = ++nudgeRetry;\n const nudgeOffset = nudgeRetry * config.nudgeOffset;\n // next buffer is close ! adjust currentTime to nextBufferStart\n // this will ensure effective video decoding\n logger.log(`adjust currentTime from ${media.currentTime} to next buffered @ ${nextBufferStart} + nudge ${nudgeOffset}`);\n media.currentTime = nextBufferStart + nudgeOffset;\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole : nextBufferStart + nudgeOffset - currentTime});\n }\n } else if (bufferLen > jumpThreshold && stalledDuration > config.highBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n logger.warn(`playback stalling in high buffer @${currentTime}`);\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer : bufferLen});\n }\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n this.nudgeRetry = ++nudgeRetry;\n if (nudgeRetry < config.nudgeMaxRetry) {\n const currentTime = media.currentTime;\n const targetTime = currentTime + nudgeRetry * config.nudgeOffset;\n logger.log(`adjust currentTime from ${currentTime} to ${targetTime}`);\n // playback stalled in buffered area ... let's nudge currentTime to try to overcome this\n media.currentTime = targetTime;\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_NUDGE_ON_STALL, fatal: false});\n } else {\n logger.error(`still stuck in high buffer @${currentTime} after ${config.nudgeMaxRetry}, raise fatal error`);\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: true});\n }\n }\n }\n }\n }\n }\n }\n }\n\n 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 this.nextLoadPosition = this.startPosition;\n }\n this.tick();\n }\n\n onBufferFlushed() {\n /* after successful buffer flushing, filter flushed fragments from bufferedFrags\n use mediaBuffered instead of media (so that we will check against video.buffered ranges in case of alt audio track)\n */\n const media = this.mediaBuffer ? this.mediaBuffer : this.media;\n this._bufferedFrags = this._bufferedFrags.filter(frag => {return BufferHelper.isBuffered(media,(frag.startPTS + frag.endPTS) / 2);});\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 swapAudioCodec() {\n this.audioCodecSwap = !this.audioCodecSwap;\n }\n\n computeLivePosition(sliding, levelDetails) {\n let 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 get liveSyncPosition() {\n return this._liveSyncPosition;\n }\n\n set liveSyncPosition(value) {\n this._liveSyncPosition = value;\n }\n}\nexport default StreamController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/stream-controller.js","/*\n * Subtitle Stream Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nclass SubtitleStreamController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.ERROR,\n Event.SUBTITLE_TRACKS_UPDATED,\n Event.SUBTITLE_TRACK_SWITCH,\n Event.SUBTITLE_TRACK_LOADED,\n Event.SUBTITLE_FRAG_PROCESSED);\n this.config = hls.config;\n this.vttFragSNsProcessed = {};\n this.vttFragQueues = undefined;\n this.currentlyProcessing = null;\n this.currentTrackId = -1;\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n // Remove all queued items and create a new, empty queue for each track.\n clearVttFragQueues() {\n this.vttFragQueues = {};\n this.tracks.forEach(track => {\n this.vttFragQueues[track.id] = [];\n });\n }\n\n // If no frag is being processed and queue isn't empty, initiate processing of next frag in line.\n nextFrag() {\n if(this.currentlyProcessing === null && this.currentTrackId > -1 && this.vttFragQueues[this.currentTrackId].length) {\n let frag = this.currentlyProcessing = this.vttFragQueues[this.currentTrackId].shift();\n this.hls.trigger(Event.FRAG_LOADING, {frag});\n }\n }\n\n // When fragment has finished processing, add sn to list of completed if successful.\n onSubtitleFragProcessed(data) {\n if(data.success) {\n this.vttFragSNsProcessed[data.frag.trackId].push(data.frag.sn);\n }\n this.currentlyProcessing = null;\n this.nextFrag();\n }\n\n // If something goes wrong, procede to next frag, if we were processing one.\n onError(data) {\n let frag = data.frag;\n // don't handle frag error not related to subtitle fragment\n if (frag && frag.type !== 'subtitle') {\n return;\n }\n if(this.currentlyProcessing) {\n this.currentlyProcessing = null;\n this.nextFrag();\n }\n }\n\n // Got all new subtitle tracks.\n onSubtitleTracksUpdated(data) {\n logger.log('subtitle tracks updated');\n this.tracks = data.subtitleTracks;\n this.clearVttFragQueues();\n this.vttFragSNsProcessed = {};\n this.tracks.forEach(track => {\n this.vttFragSNsProcessed[track.id] = [];\n });\n }\n\n onSubtitleTrackSwitch(data) {\n this.currentTrackId = data.id;\n this.clearVttFragQueues();\n }\n\n // Got a new set of subtitle fragments.\n onSubtitleTrackLoaded(data) {\n const processedFragSNs = this.vttFragSNsProcessed[data.id],\n fragQueue = this.vttFragQueues[data.id],\n currentFragSN = !!this.currentlyProcessing ? this.currentlyProcessing.sn : -1;\n\n const alreadyProcessed = function(frag) {\n return processedFragSNs.indexOf(frag.sn) > -1;\n };\n\n const alreadyInQueue = function(frag) {\n return fragQueue.some(fragInQueue => {return fragInQueue.sn === frag.sn;});\n };\n\n // Add all fragments that haven't been, aren't currently being and aren't waiting to be processed, to queue.\n data.details.fragments.forEach(frag => {\n if(!(alreadyProcessed(frag) || frag.sn === currentFragSN || alreadyInQueue(frag))) {\n // Frags don't know their subtitle track ID, so let's just add that...\n frag.trackId = data.id;\n fragQueue.push(frag);\n }\n });\n\n this.nextFrag();\n }\n}\nexport default SubtitleStreamController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/subtitle-stream-controller.js","/*\n * audio track controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nfunction filterSubtitleTracks(textTrackList) {\n let tracks = [];\n for (let i = 0; i < textTrackList.length; i++) {\n if (textTrackList[i].kind === 'subtitles') {\n tracks.push(textTrackList[i]);\n }\n }\n return tracks;\n}\n\nclass SubtitleTrackController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.MANIFEST_LOADING,\n Event.MANIFEST_LOADED,\n Event.SUBTITLE_TRACK_LOADED);\n this.tracks = [];\n this.trackId = -1;\n this.media = undefined;\n }\n\n _onTextTracksChanged() {\n // Media is undefined when switching streams via loadSource()\n if (!this.media) {\n return;\n }\n\n let trackId = -1;\n let tracks = filterSubtitleTracks(this.media.textTracks);\n for (let id = 0; id < tracks.length; id++) {\n if (tracks[id].mode === 'showing') {\n trackId = id;\n }\n }\n\n // Setting current subtitleTrack will invoke code.\n this.subtitleTrack = trackId;\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n // Listen for subtitle track change, then extract the current track ID.\n onMediaAttached(data) {\n this.media = data.media;\n if (!this.media) {\n return;\n }\n\n this.trackChangeListener = this._onTextTracksChanged.bind(this);\n this.media.textTracks.addEventListener('change', this.trackChangeListener);\n }\n\n onMediaDetaching() {\n if (!this.media) {\n return;\n }\n\n this.media.textTracks.removeEventListener('change', this.trackChangeListener);\n\n this.media = undefined;\n }\n\n // Reset subtitle tracks on manifest loading\n onManifestLoading() {\n this.tracks = [];\n this.trackId = -1;\n }\n\n // Fired whenever a new manifest is loaded.\n onManifestLoaded(data) {\n let tracks = data.subtitles || [];\n let defaultFound = false;\n this.tracks = tracks;\n this.trackId = -1;\n this.hls.trigger(Event.SUBTITLE_TRACKS_UPDATED, {subtitleTracks : tracks});\n\n // loop through available subtitle tracks and autoselect default if needed\n // TODO: improve selection logic to handle forced, etc\n tracks.forEach(track => {\n if (track.default) {\n this.subtitleTrack = track.id;\n defaultFound = true;\n }\n });\n }\n\n // Trigger subtitle track playlist reload.\n onTick() {\n const trackId = this.trackId;\n const subtitleTrack = this.tracks[trackId];\n if (!subtitleTrack) {\n return;\n }\n\n const details = subtitleTrack.details;\n // check if we need to load playlist for this subtitle Track\n if (details === undefined || details.live === true) {\n // track not retrieved yet, or live playlist we need to (re)load it\n logger.log(`(re)loading playlist for subtitle track ${trackId}`);\n this.hls.trigger(Event.SUBTITLE_TRACK_LOADING, {url: subtitleTrack.url, id: trackId});\n }\n }\n\n onSubtitleTrackLoaded(data) {\n if (data.id < this.tracks.length) {\n logger.log(`subtitle track ${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(() => {\n this.onTick();\n }, 1000 * data.details.targetduration, this);\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 subtitle tracks list from playlist **/\n get subtitleTracks() {\n return this.tracks;\n }\n\n /** get index of the selected subtitle track (index in subtitle track lists) **/\n get subtitleTrack() {\n return this.trackId;\n }\n\n /** select a subtitle track, based on its index in subtitle track lists**/\n set subtitleTrack(subtitleTrackId) {\n if (this.trackId !== subtitleTrackId) {// || this.tracks[subtitleTrackId].details === undefined) {\n this.setSubtitleTrackInternal(subtitleTrackId);\n }\n }\n\n setSubtitleTrackInternal(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.log(`switching to subtitle track ${newId}`);\n let subtitleTrack = this.tracks[newId];\n this.hls.trigger(Event.SUBTITLE_TRACK_SWITCH, {id: newId});\n // check if we need to load playlist for this subtitle Track\n let details = subtitleTrack.details;\n if (details === undefined || details.live === true) {\n // track not retrieved yet, or live playlist we need to (re)load it\n logger.log(`(re)loading playlist for subtitle track ${newId}`);\n this.hls.trigger(Event.SUBTITLE_TRACK_LOADING, {url: subtitleTrack.url, id: newId});\n }\n }\n }\n}\n\nexport default SubtitleTrackController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/subtitle-track-controller.js","/*\n * Timeline Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport Cea608Parser from '../utils/cea-608-parser';\nimport WebVTTParser from '../utils/webvtt-parser';\nimport {logger} from '../utils/logger';\n\nfunction clearCurrentCues(track) {\n if (track && track.cues) {\n while (track.cues.length > 0) {\n track.removeCue(track.cues[0]);\n }\n }\n}\n\nfunction reuseVttTextTrack(inUseTrack, manifestTrack) {\n return inUseTrack && inUseTrack.label === manifestTrack.name && !(inUseTrack.textTrack1 || inUseTrack.textTrack2);\n}\n\nfunction intersection(x1, x2, y1, y2) {\n return Math.min(x2, y2) - Math.max(x1, y1);\n}\n\nclass TimelineController extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.MEDIA_ATTACHING,\n Event.MEDIA_DETACHING,\n Event.FRAG_PARSING_USERDATA,\n Event.MANIFEST_LOADING,\n Event.MANIFEST_LOADED,\n Event.FRAG_LOADED,\n Event.LEVEL_SWITCHING,\n Event.INIT_PTS_FOUND);\n\n this.hls = hls;\n this.config = hls.config;\n this.enabled = true;\n this.Cues = hls.config.cueHandler;\n this.textTracks = [];\n this.tracks = [];\n this.unparsedVttFrags = [];\n this.initPTS = undefined;\n this.cueRanges = [];\n\n if (this.config.enableCEA708Captions)\n {\n var self = this;\n var sendAddTrackEvent = function (track, media)\n {\n var e = null;\n try {\n e = new window.Event('addtrack');\n } catch (err) {\n //for IE11\n e = document.createEvent('Event');\n e.initEvent('addtrack', false, false);\n }\n e.track = track;\n media.dispatchEvent(e);\n };\n\n var channel1 =\n {\n 'newCue': function(startTime, endTime, screen)\n {\n if (!self.textTrack1)\n {\n //Enable reuse of existing text track.\n var existingTrack1 = self.getExistingTrack('1');\n if (!existingTrack1)\n {\n const textTrack1 = self.createTextTrack('captions', self.config.captionsTextTrack1Label, self.config.captionsTextTrack1LanguageCode);\n if (textTrack1) {\n textTrack1.textTrack1 = true;\n self.textTrack1 = textTrack1;\n }\n }\n else\n {\n self.textTrack1 = existingTrack1;\n clearCurrentCues(self.textTrack1);\n\n sendAddTrackEvent(self.textTrack1, self.media);\n }\n }\n self.addCues('textTrack1', startTime, endTime, screen);\n }\n };\n\n var channel2 =\n {\n 'newCue': function(startTime, endTime, screen)\n {\n if (!self.textTrack2)\n {\n //Enable reuse of existing text track.\n var existingTrack2 = self.getExistingTrack('2');\n if (!existingTrack2)\n {\n const textTrack2 = self.createTextTrack('captions', self.config.captionsTextTrack2Label, self.config.captionsTextTrack1LanguageCode);\n if (textTrack2) {\n textTrack2.textTrack2 = true;\n self.textTrack2 = textTrack2;\n }\n }\n else\n {\n self.textTrack2 = existingTrack2;\n clearCurrentCues(self.textTrack2);\n\n sendAddTrackEvent(self.textTrack2, self.media);\n }\n }\n self.addCues('textTrack2', startTime, endTime, screen);\n }\n };\n\n this.cea608Parser = new Cea608Parser(0, channel1, channel2);\n }\n }\n\n addCues(channel, startTime, endTime, screen) {\n // skip cues which overlap more than 50% with previously parsed time ranges\n const ranges = this.cueRanges;\n let merged = false;\n for (let i = ranges.length; i--;) {\n let cueRange = ranges[i];\n let overlap = intersection(cueRange[0], cueRange[1], startTime, endTime);\n if (overlap >= 0) {\n cueRange[0] = Math.min(cueRange[0], startTime);\n cueRange[1] = Math.max(cueRange[1], endTime);\n merged = true;\n if ((overlap / (endTime - startTime)) > 0.5) {\n return;\n }\n }\n }\n if (!merged) {\n ranges.push([startTime, endTime]);\n }\n this.Cues.newCue(this[channel], startTime, endTime, screen);\n }\n\n // Triggered when an initial PTS is found; used for synchronisation of WebVTT.\n onInitPtsFound(data) {\n if (typeof this.initPTS === 'undefined') {\n this.initPTS = data.initPTS;\n }\n\n // Due to asynchrony, initial PTS may arrive later than the first VTT fragments are loaded.\n // Parse any unparsed fragments upon receiving the initial PTS.\n if (this.unparsedVttFrags.length) {\n this.unparsedVttFrags.forEach(frag => {\n this.onFragLoaded(frag);\n });\n this.unparsedVttFrags = [];\n }\n }\n\n getExistingTrack(channelNumber) {\n const media = this.media;\n if (media) {\n for (let i = 0; i < media.textTracks.length; i++) {\n let textTrack = media.textTracks[i];\n let propName = 'textTrack' + channelNumber;\n if (textTrack[propName] === true) {\n return textTrack;\n }\n }\n }\n return null;\n }\n\n createTextTrack(kind, label, lang) {\n const media = this.media;\n if (media)\n {\n return media.addTextTrack(kind, label, lang);\n }\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n onMediaAttaching(data) {\n this.media = data.media;\n }\n\n onMediaDetaching() {\n clearCurrentCues(this.textTrack1);\n clearCurrentCues(this.textTrack2);\n }\n\n onManifestLoading()\n {\n this.lastSn = -1; // Detect discontiguity in fragment parsing\n this.prevCC = -1;\n this.vttCCs = {ccOffset: 0, presentationOffset: 0}; // Detect discontinuity in subtitle manifests\n\n // clear outdated subtitles\n const media = this.media;\n if (media) {\n const textTracks = media.textTracks;\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n clearCurrentCues(textTracks[i]);\n }\n }\n }\n }\n\n onManifestLoaded(data) {\n this.textTracks = [];\n this.unparsedVttFrags = this.unparsedVttFrags || [];\n this.initPTS = undefined;\n this.cueRanges = [];\n\n if (this.config.enableWebVTT) {\n this.tracks = data.subtitles || [];\n const inUseTracks = this.media ? this.media.textTracks : [];\n\n this.tracks.forEach((track, index) => {\n let textTrack;\n if (index < inUseTracks.length) {\n const inUseTrack = inUseTracks[index];\n // Reuse tracks with the same label, but do not reuse 608/708 tracks\n if (reuseVttTextTrack(inUseTrack, track)) {\n textTrack = inUseTrack;\n }\n }\n if (!textTrack) {\n textTrack = this.createTextTrack('subtitles', track.name, track.lang);\n }\n textTrack.mode = track.default ? 'showing' : 'hidden';\n this.textTracks.push(textTrack);\n });\n }\n }\n\n onLevelSwitching() {\n this.enabled = this.hls.currentLevel.closedCaptions !== 'NONE';\n }\n\n onFragLoaded(data) {\n let frag = data.frag,\n payload = data.payload;\n if (frag.type === 'main') {\n var sn = frag.sn;\n // if this frag isn't contiguous, clear the parser so cues with bad start/end times aren't added to the textTrack\n if (sn !== this.lastSn + 1) {\n const cea608Parser = this.cea608Parser;\n if (cea608Parser) {\n cea608Parser.reset();\n }\n }\n this.lastSn = sn;\n }\n // If fragment is subtitle type, parse as WebVTT.\n else if (frag.type === 'subtitle') {\n if (payload.byteLength) {\n // We need an initial synchronisation PTS. Store fragments as long as none has arrived.\n if (typeof this.initPTS === 'undefined') {\n this.unparsedVttFrags.push(data);\n return;\n }\n let vttCCs = this.vttCCs;\n if (!vttCCs[frag.cc]) {\n vttCCs[frag.cc] = { start: frag.start, prevCC: this.prevCC, new: true };\n this.prevCC = frag.cc;\n }\n let textTracks = this.textTracks,\n hls = this.hls;\n\n // Parse the WebVTT file contents.\n WebVTTParser.parse(payload, this.initPTS, vttCCs, frag.cc, function (cues) {\n const currentTrack = textTracks[frag.trackId];\n // Add cues and trigger event with success true.\n cues.forEach(cue => {\n // Sometimes there are cue overlaps on segmented vtts so the same\n // cue can appear more than once in different vtt files.\n // This avoid showing duplicated cues with same timecode and text.\n if (!currentTrack.cues.getCueById(cue.id)) {\n currentTrack.addCue(cue);\n }\n });\n hls.trigger(Event.SUBTITLE_FRAG_PROCESSED, {success: true, frag: frag});\n },\n function (e) {\n // Something went wrong while parsing. Trigger event with success false.\n logger.log(`Failed to parse VTT cue: ${e}`);\n hls.trigger(Event.SUBTITLE_FRAG_PROCESSED, {success: false, frag: frag});\n });\n }\n else {\n // In case there is no payload, finish unsuccessfully.\n this.hls.trigger(Event.SUBTITLE_FRAG_PROCESSED, {success: false, frag: frag});\n }\n }\n }\n\n 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 && this.config.enableCEA708Captions) {\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 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;\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\nexport default TimelineController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/timeline-controller.js","export default class AESCrypto {\n constructor(subtle,iv) {\n this.subtle = subtle;\n this.aesIV = iv;\n }\n\n decrypt(data, key) {\n return this.subtle.decrypt({name: 'AES-CBC', iv: this.aesIV}, key, data);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/aes-crypto.js","class AESDecryptor {\n constructor() {\n // Static after running initTable\n this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n this.subMix = [new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];\n this.invSubMix = [new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];\n this.sBox = new Uint32Array(256);\n this.invSBox = new Uint32Array(256);\n\n // Changes during runtime\n this.key = new Uint32Array(0);\n\n this.initTable();\n }\n\n // Using view.getUint32() also swaps the byte order.\n uint8ArrayToUint32Array_(arrayBuffer) {\n let view = new DataView(arrayBuffer);\n let newArray = new Uint32Array(4);\n for (let i = 0; i < 4; i++) {\n newArray[i] = view.getUint32(i * 4);\n }\n return newArray;\n }\n\n initTable() {\n let sBox = this.sBox;\n let invSBox = this.invSBox;\n let subMix = this.subMix;\n let subMix0 = subMix[0];\n let subMix1 = subMix[1];\n let subMix2 = subMix[2];\n let subMix3 = subMix[3];\n let invSubMix = this.invSubMix;\n let invSubMix0 = invSubMix[0];\n let invSubMix1 = invSubMix[1];\n let invSubMix2 = invSubMix[2];\n let invSubMix3 = invSubMix[3];\n\n let d = new Uint32Array(256);\n let x = 0;\n let xi = 0;\n let i = 0;\n for (i = 0; i < 256; i++) {\n if (i < 128) {\n d[i] = i << 1;\n } else {\n d[i] = (i << 1) ^ 0x11b;\n }\n }\n\n for (i = 0; i < 256; i++) {\n let sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);\n sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;\n sBox[x] = sx;\n invSBox[sx] = x;\n\n // Compute multiplication\n let x2 = d[x];\n let x4 = d[x2];\n let x8 = d[x4];\n\n // Compute sub/invSub bytes, mix columns tables\n let t = (d[sx] * 0x101) ^ (sx * 0x1010100);\n subMix0[x] = (t << 24) | (t >>> 8);\n subMix1[x] = (t << 16) | (t >>> 16);\n subMix2[x] = (t << 8) | (t >>> 24);\n subMix3[x] = t;\n\n // Compute inv sub bytes, inv mix columns tables\n t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);\n invSubMix0[sx] = (t << 24) | (t >>> 8);\n invSubMix1[sx] = (t << 16) | (t >>> 16);\n invSubMix2[sx] = (t << 8) | (t >>> 24);\n invSubMix3[sx] = t;\n\n // Compute next counter\n if (!x) {\n x = xi = 1;\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]];\n xi ^= d[d[xi]];\n }\n }\n }\n\n expandKey(keyBuffer) {\n // convert keyBuffer to Uint32Array\n let key = this.uint8ArrayToUint32Array_(keyBuffer);\n let sameKey = true;\n let offset = 0;\n\n while (offset < key.length && sameKey) {\n sameKey = (key[offset] === this.key[offset]);\n offset++;\n }\n\n if (sameKey) {\n return;\n }\n\n this.key = key;\n let keySize = this.keySize = key.length;\n\n if (keySize !== 4 && keySize !== 6 && keySize !== 8) {\n throw new Error('Invalid aes key size=' + keySize);\n }\n\n let ksRows = this.ksRows = (keySize + 6 + 1) * 4;\n let ksRow;\n let invKsRow;\n\n let keySchedule = this.keySchedule = new Uint32Array(ksRows);\n let invKeySchedule = this.invKeySchedule = new Uint32Array(ksRows);\n let sbox = this.sBox;\n let rcon = this.rcon;\n\n let invSubMix = this.invSubMix;\n let invSubMix0 = invSubMix[0];\n let invSubMix1 = invSubMix[1];\n let invSubMix2 = invSubMix[2];\n let invSubMix3 = invSubMix[3];\n\n let prev;\n let t;\n\n for (ksRow = 0; ksRow < ksRows; ksRow++) {\n if (ksRow < keySize) {\n prev = keySchedule[ksRow] = key[ksRow];\n continue;\n }\n t = prev;\n\n if (ksRow % keySize === 0) {\n // Rot word\n t = (t << 8) | (t >>> 24);\n\n // Sub word\n t = (sbox[t >>> 24] << 24) | (sbox[(t >>> 16) & 0xff] << 16) | (sbox[(t >>> 8) & 0xff] << 8) | sbox[t & 0xff];\n\n // Mix Rcon\n t ^= rcon[(ksRow / keySize) | 0] << 24;\n } else if (keySize > 6 && ksRow % keySize === 4) {\n // Sub word\n t = (sbox[t >>> 24] << 24) | (sbox[(t >>> 16) & 0xff] << 16) | (sbox[(t >>> 8) & 0xff] << 8) | sbox[t & 0xff];\n }\n\n keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;\n }\n\n for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n ksRow = ksRows - invKsRow;\n if (invKsRow & 3) {\n t = keySchedule[ksRow];\n } else {\n t = keySchedule[ksRow - 4];\n }\n\n if (invKsRow < 4 || ksRow <= 4) {\n invKeySchedule[invKsRow] = t;\n } else {\n invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[(t >>> 16) & 0xff]] ^ invSubMix2[sbox[(t >>> 8) & 0xff]] ^ invSubMix3[sbox[t & 0xff]];\n }\n\n invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;\n }\n }\n\n // Adding this as a method greatly improves performance.\n networkToHostOrderSwap(word) {\n return (word << 24) | ((word & 0xff00) << 8) | ((word & 0xff0000) >> 8) | (word >>> 24);\n }\n\n decrypt(inputArrayBuffer, offset, aesIV) {\n let nRounds = this.keySize + 6;\n let invKeySchedule = this.invKeySchedule;\n let invSBOX = this.invSBox;\n\n let invSubMix = this.invSubMix;\n let invSubMix0 = invSubMix[0];\n let invSubMix1 = invSubMix[1];\n let invSubMix2 = invSubMix[2];\n let invSubMix3 = invSubMix[3];\n\n let initVector = this.uint8ArrayToUint32Array_(aesIV);\n let initVector0 = initVector[0];\n let initVector1 = initVector[1];\n let initVector2 = initVector[2];\n let initVector3 = initVector[3];\n\n let inputInt32 = new Int32Array(inputArrayBuffer);\n let outputInt32 = new Int32Array(inputInt32.length);\n\n let t0, t1, t2, t3;\n let s0, s1, s2, s3;\n let inputWords0, inputWords1, inputWords2, inputWords3;\n\n var ksRow, i;\n let swapWord = this.networkToHostOrderSwap;\n\n while (offset < inputInt32.length) {\n inputWords0 = swapWord(inputInt32[offset]);\n inputWords1 = swapWord(inputInt32[offset + 1]);\n inputWords2 = swapWord(inputInt32[offset + 2]);\n inputWords3 = swapWord(inputInt32[offset + 3]);\n\n s0 = inputWords0 ^ invKeySchedule[0];\n s1 = inputWords3 ^ invKeySchedule[1];\n s2 = inputWords2 ^ invKeySchedule[2];\n s3 = inputWords1 ^ invKeySchedule[3];\n\n ksRow = 4;\n\n // Iterate through the rounds of decryption\n for (i = 1; i < nRounds; i++) {\n t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[(s1 >> 16) & 0xff] ^ invSubMix2[(s2 >> 8) & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[(s2 >> 16) & 0xff] ^ invSubMix2[(s3 >> 8) & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[(s3 >> 16) & 0xff] ^ invSubMix2[(s0 >> 8) & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[(s0 >> 16) & 0xff] ^ invSubMix2[(s1 >> 8) & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n // Update state\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n\n ksRow = ksRow + 4;\n }\n\n // Shift rows, sub bytes, add round key\n t0 = ((invSBOX[s0 >>> 24] << 24) ^ (invSBOX[(s1 >> 16) & 0xff] << 16) ^ (invSBOX[(s2 >> 8) & 0xff] << 8) ^ invSBOX[s3 & 0xff]) ^ invKeySchedule[ksRow];\n t1 = ((invSBOX[s1 >>> 24] << 24) ^ (invSBOX[(s2 >> 16) & 0xff] << 16) ^ (invSBOX[(s3 >> 8) & 0xff] << 8) ^ invSBOX[s0 & 0xff]) ^ invKeySchedule[ksRow + 1];\n t2 = ((invSBOX[s2 >>> 24] << 24) ^ (invSBOX[(s3 >> 16) & 0xff] << 16) ^ (invSBOX[(s0 >> 8) & 0xff] << 8) ^ invSBOX[s1 & 0xff]) ^ invKeySchedule[ksRow + 2];\n t3 = ((invSBOX[s3 >>> 24] << 24) ^ (invSBOX[(s0 >> 16) & 0xff] << 16) ^ (invSBOX[(s1 >> 8) & 0xff] << 8) ^ invSBOX[s2 & 0xff]) ^ invKeySchedule[ksRow + 3];\n ksRow = ksRow + 3;\n\n // Write\n outputInt32[offset] = swapWord(t0 ^ initVector0);\n outputInt32[offset + 1] = swapWord(t3 ^ initVector1);\n outputInt32[offset + 2] = swapWord(t2 ^ initVector2);\n outputInt32[offset + 3] = swapWord(t1 ^ initVector3);\n\n // reset initVector to last 4 unsigned int\n initVector0 = inputWords0;\n initVector1 = inputWords1;\n initVector2 = inputWords2;\n initVector3 = inputWords3;\n\n offset = offset + 4;\n }\n\n return outputInt32.buffer;\n }\n\n destroy() {\n this.key = undefined;\n this.keySize = undefined;\n this.ksRows = undefined;\n\n this.sBox = undefined;\n this.invSBox = undefined;\n this.subMix = undefined;\n this.invSubMix = undefined;\n this.keySchedule = undefined;\n this.invKeySchedule = undefined;\n\n this.rcon = undefined;\n }\n}\n\nexport default AESDecryptor;\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/aes-decryptor.js","import AESCrypto from './aes-crypto';\nimport FastAESKey from './fast-aes-key';\nimport AESDecryptor from './aes-decryptor';\n\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\n/*globals self: false */\n\nclass Decrypter {\n constructor(observer,config) {\n this.observer = observer;\n this.config = config;\n this.logEnabled = true;\n try {\n const browserCrypto = crypto ? crypto : self.crypto;\n this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;\n } catch (e) {}\n this.disableWebCrypto = !this.subtle;\n }\n\n isSync() {\n return (this.disableWebCrypto && this.config.enableSoftwareAES);\n }\n\n decrypt(data, key, iv, callback) {\n if (this.disableWebCrypto && this.config.enableSoftwareAES) {\n if (this.logEnabled) {\n logger.log('JS AES decrypt');\n this.logEnabled = false;\n }\n let decryptor = this.decryptor;\n if (!decryptor) {\n this.decryptor = decryptor = new AESDecryptor();\n }\n decryptor.expandKey(key);\n callback(decryptor.decrypt(data, 0, iv));\n }\n else {\n if (this.logEnabled) {\n logger.log('WebCrypto AES decrypt');\n this.logEnabled = false;\n }\n const subtle = this.subtle;\n if (this.key !== key) {\n this.key = key;\n this.fastAesKey = new FastAESKey(subtle,key);\n }\n\n this.fastAesKey.expandKey().\n then((aesKey) => {\n // decrypt using web crypto\n let crypto = new AESCrypto(subtle,iv);\n crypto.decrypt(data, aesKey).\n catch ((err) => {\n this.onWebCryptoError(err, data, key, iv, callback);\n }).\n then((result) => {\n callback(result);\n });\n }).\n catch ((err) => {\n this.onWebCryptoError(err, data, key, iv, callback);\n });\n }\n }\n\n onWebCryptoError(err, data, key, iv, callback) {\n if (this.config.enableSoftwareAES) {\n logger.log('WebCrypto Error, disable WebCrypto API');\n this.disableWebCrypto = true;\n this.logEnabled = true;\n this.decrypt(data, key, iv, callback);\n }\n else {\n logger.error(`decrypting error : ${err.message}`);\n this.observer.trigger(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details : ErrorDetails.FRAG_DECRYPT_ERROR, fatal : true, reason : err.message});\n }\n }\n\n destroy() {\n let decryptor = this.decryptor;\n if (decryptor) {\n decryptor.destroy();\n this.decryptor = undefined;\n }\n }\n}\n\nexport default Decrypter;\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/decrypter.js","class FastAESKey {\n constructor(subtle,key) {\n this.subtle = subtle;\n this.key = key;\n }\n\n expandKey() {\n return this.subtle.importKey('raw', this.key, {name: 'AES-CBC'}, false, ['encrypt', 'decrypt']);\n }\n}\n\nexport default FastAESKey;\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/fast-aes-key.js","/**\n * AAC demuxer\n */\nimport ADTS from './adts';\nimport { logger } from '../utils/logger';\nimport ID3 from '../demux/id3';\n\nclass AACDemuxer {\n\n constructor(observer, remuxer, config) {\n this.observer = observer;\n this.config = config;\n this.remuxer = remuxer;\n }\n\n resetInitSegment(initSegment, audioCodec, videoCodec, duration) {\n this._audioTrack = { container: 'audio/adts', type: 'audio', id: -1, sequenceNumber: 0, isAAC: true, samples: [], len: 0, manifestCodec: audioCodec, duration: duration, inputTimeScale: 90000 };\n }\n\n resetTimeStamp() {\n }\n\n static probe(data) {\n // check if data contains ID3 timestamp and ADTS sync word\n var offset, length;\n let id3Data = ID3.getID3Data(data, 0);\n if (id3Data && ID3.getTimeStamp(id3Data) !== undefined) {\n // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1\n // Layer bits (position 14 and 15) in header should be always 0 for ADTS\n // More info https://wiki.multimedia.cx/index.php?title=ADTS\n for (offset = id3Data.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {\n if (ADTS.probe(data, offset)) {\n logger.log('ADTS sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset, contiguous, accurateTimeOffset) {\n var track = this._audioTrack,\n id3Data = ID3.getID3Data(data, 0),\n pts = 90 * ID3.getTimeStamp(id3Data),\n frameIndex = 0,\n stamp = pts,\n length = data.length,\n offset = id3Data.length;\n\n let id3Samples = [{ pts: stamp, dts: stamp, data: id3Data }];\n\n while (offset < length - 1) {\n if (ADTS.isHeader(data, offset) && (offset + 5) < length) {\n ADTS.initTrackConfig(track, this.observer, data, offset, track.manifestCodec);\n var frame = ADTS.appendFrame(track, data, offset, pts, frameIndex);\n if (frame) {\n offset += frame.length;\n stamp = frame.sample.pts;\n frameIndex++;\n } else {\n logger.log('Unable to parse AAC frame');\n break;\n }\n } else if (ID3.isHeader(data, offset)) {\n id3Data = ID3.getID3Data(data, offset);\n id3Samples.push({ pts: stamp, dts: stamp, data: id3Data });\n offset += id3Data.length;\n } else {\n //nothing found, keep looking\n offset++;\n }\n }\n\n this.remuxer.remux(track,\n { samples: [] },\n { samples: id3Samples, inputTimeScale: 90000 },\n { samples: [] },\n timeOffset,\n contiguous,\n accurateTimeOffset);\n }\n\n destroy() {\n }\n\n}\n\nexport default AACDemuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/aacdemuxer.js","/**\n * ADTS parser helper\n */\nimport { logger } from '../utils/logger';\nimport { ErrorTypes, ErrorDetails } from '../errors';\n\nconst ADTS = {\n getAudioConfig: function (observer, data, offset, audioCodec) {\n var adtsObjectType, // :int\n adtsSampleingIndex, // :int\n adtsExtensionSampleingIndex, // :int\n adtsChanelConfig, // :int\n config,\n userAgent = navigator.userAgent.toLowerCase(),\n manifestCodec = audioCodec,\n adtsSampleingRates = [\n 96000, 88200,\n 64000, 48000,\n 44100, 32000,\n 24000, 22050,\n 16000, 12000,\n 11025, 8000,\n 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: ErrorTypes.MEDIA_ERROR, details: 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.log(`manifest codec:${audioCodec},ADTS data:type:${adtsObjectType},sampleingIndex:${adtsSampleingIndex}[${adtsSampleingRates[adtsSampleingIndex]}Hz],channelConfig:${adtsChanelConfig}`);\n // firefox: freq less than 24kHz = AAC SBR (HE-AAC)\n if (/firefox/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/Opera ...)\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) ||\n (audioCodec.indexOf('mp4a.40.5') !== -1))) ||\n (!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) ||\n (!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), manifestCodec: manifestCodec };\n },\n\n isHeaderPattern: function (data, offset) {\n return data[offset] === 0xff && (data[offset + 1] & 0xf6) === 0xf0;\n },\n\n getHeaderLength: function (data, offset) {\n return (!!(data[offset + 1] & 0x01) ? 7 : 9);\n },\n\n getFullFrameLength: function (data, offset) {\n return ((data[offset + 3] & 0x03) << 11) |\n (data[offset + 4] << 3) |\n ((data[offset + 5] & 0xE0) >>> 5);\n },\n\n isHeader: function (data, offset) {\n // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1\n // Layer bits (position 14 and 15) in header should be always 0 for ADTS\n // More info https://wiki.multimedia.cx/index.php?title=ADTS\n if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {\n return true;\n }\n return false;\n },\n\n probe: function (data, offset) {\n // same as isHeader but we also check that ADTS frame follows last ADTS frame \n // or end of data is reached\n if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {\n // ADTS header Length\n let headerLength = this.getHeaderLength(data, offset);\n // ADTS frame Length\n let frameLength = headerLength;\n if (offset + 5 < data.length) {\n frameLength = this.getFullFrameLength(data, offset);\n }\n let newOffset = offset + frameLength;\n if (newOffset === data.length || (newOffset + 1 < data.length && this.isHeaderPattern(data, newOffset))) {\n return true;\n }\n }\n return false;\n },\n\n initTrackConfig: function (track, observer, data, offset, audioCodec) {\n if (!track.samplerate) {\n var config = this.getAudioConfig(observer, data, offset, audioCodec);\n track.config = config.config;\n track.samplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n logger.log(`parsed codec:${track.codec},rate:${config.samplerate},nb channel:${config.channelCount}`);\n }\n },\n\n getFrameDuration: function (samplerate) {\n return 1024 * 90000 / samplerate;\n },\n\n appendFrame: function (track, data, offset, pts, frameIndex) {\n var frameDuration = this.getFrameDuration(track.samplerate);\n var header = this.parseFrameHeader(data, offset, pts, frameIndex, frameDuration);\n if (header) {\n var stamp = header.stamp;\n var headerLength = header.headerLength;\n var frameLength = header.frameLength;\n\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n var aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n\n track.samples.push(aacSample);\n track.len += frameLength;\n\n return { sample: aacSample, length: frameLength + headerLength };\n }\n\n return undefined;\n },\n\n parseFrameHeader: function (data, offset, pts, frameIndex, frameDuration) {\n var headerLength, frameLength, stamp;\n var length = data.length;\n\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n headerLength = this.getHeaderLength(data, offset);\n // retrieve frame size\n frameLength = this.getFullFrameLength(data, offset);\n frameLength -= headerLength;\n\n if ((frameLength > 0) && ((offset + headerLength + frameLength) <= length)) {\n stamp = pts + frameIndex * frameDuration;\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n return { headerLength, frameLength, stamp };\n }\n\n return undefined;\n }\n};\n\nmodule.exports = ADTS;\n\n\n// WEBPACK FOOTER //\n// src/demux/adts.js","/* inline demuxer.\n * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)\n */\n\nimport Event from '../events';\nimport { ErrorTypes, ErrorDetails } from '../errors';\nimport Decrypter from '../crypt/decrypter';\nimport AACDemuxer from '../demux/aacdemuxer';\nimport MP4Demuxer from '../demux/mp4demuxer';\nimport TSDemuxer from '../demux/tsdemuxer';\nimport MP3Demuxer from '../demux/mp3demuxer';\nimport MP4Remuxer from '../remux/mp4-remuxer';\nimport PassThroughRemuxer from '../remux/passthrough-remuxer';\n\nclass DemuxerInline {\n\n constructor(observer, typeSupported, config, vendor) {\n this.observer = observer;\n this.typeSupported = typeSupported;\n this.config = config;\n this.vendor = vendor;\n }\n\n destroy() {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n }\n }\n\n push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {\n if ((data.byteLength > 0) && (decryptdata != null) && (decryptdata.key != null) && (decryptdata.method === 'AES-128')) {\n let decrypter = this.decrypter;\n if (decrypter == null) {\n decrypter = this.decrypter = new Decrypter(this.observer, this.config);\n }\n var localthis = this;\n // performance.now() not available on WebWorker, at least on Safari Desktop\n var startTime;\n try {\n startTime = performance.now();\n } catch (error) {\n startTime = Date.now();\n }\n decrypter.decrypt(data, decryptdata.key.buffer, decryptdata.iv.buffer, function (decryptedData) {\n var endTime;\n try {\n endTime = performance.now();\n } catch (error) {\n endTime = Date.now();\n }\n localthis.observer.trigger(Event.FRAG_DECRYPTED, { stats: { tstart: startTime, tdecrypt: endTime } });\n localthis.pushDecrypted(new Uint8Array(decryptedData), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);\n });\n } else {\n this.pushDecrypted(new Uint8Array(data), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);\n }\n }\n\n pushDecrypted(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {\n var demuxer = this.demuxer;\n if (!demuxer ||\n // in case of continuity change, we might switch from content type (AAC container to TS container for example)\n // so let's check that current demuxer is still valid\n (discontinuity && !this.probe(data))) {\n const observer = this.observer;\n const typeSupported = this.typeSupported;\n const config = this.config;\n // probing order is AAC/MP3/TS/MP4\n const muxConfig = [{ demux: AACDemuxer, remux: MP4Remuxer },\n { demux: MP3Demuxer, remux: MP4Remuxer },\n { demux: TSDemuxer, remux: MP4Remuxer },\n { demux: MP4Demuxer, remux: PassThroughRemuxer }];\n\n // probe for content type\n for (let i = 0, len = muxConfig.length; i < len; i++) {\n const mux = muxConfig[i];\n const probe = mux.demux.probe;\n if (probe(data)) {\n const remuxer = this.remuxer = new mux.remux(observer, config, typeSupported, this.vendor);\n demuxer = new mux.demux(observer, remuxer, config, typeSupported);\n this.probe = probe;\n break;\n }\n }\n if (!demuxer) {\n observer.trigger(Event.ERROR, { type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'no demux matching with content found' });\n return;\n }\n this.demuxer = demuxer;\n }\n const remuxer = this.remuxer;\n\n if (discontinuity || trackSwitch) {\n demuxer.resetInitSegment(initSegment, audioCodec, videoCodec, duration);\n remuxer.resetInitSegment();\n }\n if (discontinuity) {\n demuxer.resetTimeStamp(defaultInitPTS);\n remuxer.resetTimeStamp(defaultInitPTS);\n }\n if (typeof demuxer.setDecryptData === 'function') {\n demuxer.setDecryptData(decryptdata);\n }\n demuxer.append(data, timeOffset, contiguous, accurateTimeOffset);\n }\n}\n\nexport default DemuxerInline;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/demuxer-inline.js","/* 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\n import DemuxerInline from '../demux/demuxer-inline';\n import Event from '../events';\n import {enableLogs} from '../utils/logger';\n import EventEmitter from 'events';\n\nvar DemuxerWorker = function (self) {\n // observer setup\n var observer = new EventEmitter();\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...data);\n };\n\n var forwardMessage = function(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 let config = JSON.parse(data.config);\n self.demuxer = new DemuxerInline(observer, data.typeSupported, config, data.vendor);\n try {\n enableLogs(config.debug === true);\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(data.data, data.decryptdata, data.initSegment, data.audioCodec, data.videoCodec, data.timeOffset,data.discontinuity, data.trackSwitch,data.contiguous,data.duration,data.accurateTimeOffset,data.defaultInitPTS);\n break;\n default:\n break;\n }\n });\n\n // forward events to main thread\n observer.on(Event.FRAG_DECRYPTED, forwardMessage);\n observer.on(Event.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(Event.FRAG_PARSED, forwardMessage);\n observer.on(Event.ERROR, forwardMessage);\n observer.on(Event.FRAG_PARSING_METADATA, forwardMessage);\n observer.on(Event.FRAG_PARSING_USERDATA, forwardMessage);\n observer.on(Event.INIT_PTS_FOUND, forwardMessage);\n\n // special case for FRAG_PARSING_DATA: pass data1/data2 as transferable object (no copy)\n observer.on(Event.FRAG_PARSING_DATA, function(ev, data) {\n let transferable = [];\n let message = {event: ev, data:data};\n if (data.data1) {\n message.data1 = data.data1.buffer;\n transferable.push(data.data1.buffer);\n delete data.data1;\n }\n if (data.data2) {\n message.data2 = data.data2.buffer;\n transferable.push(data.data2.buffer);\n delete data.data2;\n }\n self.postMessage(message,transferable);\n });\n};\n\nexport default DemuxerWorker;\n\n\n\n\n// WEBPACK FOOTER //\n// src/demux/demuxer-worker.js","import Event from '../events';\nimport DemuxerInline from '../demux/demuxer-inline';\nimport DemuxerWorker from '../demux/demuxer-worker';\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport EventEmitter from 'events';\n\nclass Demuxer {\n\n constructor(hls, id) {\n this.hls = hls;\n this.id = id;\n // observer setup\n const observer = this.observer = new EventEmitter();\n const config = hls.config;\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...data);\n };\n\n var forwardMessage = function(ev,data) {\n data = data || {};\n data.frag = this.frag;\n data.id = this.id;\n hls.trigger(ev,data);\n }.bind(this);\n\n // forward events to main thread\n observer.on(Event.FRAG_DECRYPTED, forwardMessage);\n observer.on(Event.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(Event.FRAG_PARSING_DATA, forwardMessage);\n observer.on(Event.FRAG_PARSED, forwardMessage);\n observer.on(Event.ERROR, forwardMessage);\n observer.on(Event.FRAG_PARSING_METADATA, forwardMessage);\n observer.on(Event.FRAG_PARSING_USERDATA, forwardMessage);\n observer.on(Event.INIT_PTS_FOUND, forwardMessage);\n\n const typeSupported = {\n mp4 : MediaSource.isTypeSupported('video/mp4'),\n mpeg: MediaSource.isTypeSupported('audio/mpeg'),\n mp3: MediaSource.isTypeSupported('audio/mp4; codecs=\"mp3\"')\n };\n // navigator.vendor is not always available in Web Worker\n // refer to https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/navigator\n const vendor = navigator.vendor;\n if (config.enableWorker && (typeof(Worker) !== 'undefined')) {\n logger.log('demuxing in webworker');\n let w;\n try {\n let work = require('webworkify');\n w = this.w = work(DemuxerWorker);\n this.onwmsg = this.onWorkerMessage.bind(this);\n w.addEventListener('message', this.onwmsg);\n w.onerror = function(event) { hls.trigger(Event.ERROR, {type: ErrorTypes.OTHER_ERROR, details: ErrorDetails.INTERNAL_EXCEPTION, fatal: true, event : 'demuxerWorker', err : { message : event.message + ' (' + event.filename + ':' + event.lineno + ')' }});};\n w.postMessage({cmd: 'init', typeSupported : typeSupported, vendor : vendor, id : id, config: JSON.stringify(config)});\n } catch(err) {\n 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 DemuxerInline(observer,typeSupported,config,vendor);\n this.w = undefined;\n }\n } else {\n this.demuxer = new DemuxerInline(observer,typeSupported,config, vendor);\n }\n }\n\n destroy() {\n let w = this.w;\n if (w) {\n w.removeEventListener('message', this.onwmsg);\n w.terminate();\n this.w = null;\n } else {\n let demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n this.demuxer = null;\n }\n }\n let observer = this.observer;\n if (observer) {\n observer.removeAllListeners();\n this.observer = null;\n }\n }\n\n push(data, initSegment, audioCodec, videoCodec, frag, duration,accurateTimeOffset,defaultInitPTS) {\n const w = this.w;\n const timeOffset = !isNaN(frag.startDTS) ? frag.startDTS : frag.start;\n const decryptdata = frag.decryptdata;\n const lastFrag = this.frag;\n const discontinuity = !(lastFrag && (frag.cc === lastFrag.cc));\n const trackSwitch = !(lastFrag && (frag.level === lastFrag.level));\n const nextSN = lastFrag && (frag.sn === (lastFrag.sn+1));\n const contiguous = !trackSwitch && nextSN;\n if (discontinuity) {\n logger.log(`${this.id}:discontinuity detected`);\n }\n if (trackSwitch) {\n logger.log(`${this.id}:switch detected`);\n }\n this.frag = frag;\n if (w) {\n // post fragment payload as transferable objects (no copy)\n w.postMessage({cmd: 'demux', data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset,defaultInitPTS}, [data]);\n } else {\n let demuxer = this.demuxer;\n if (demuxer) {\n demuxer.push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset,defaultInitPTS);\n }\n }\n }\n\n onWorkerMessage(ev) {\n let 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 Event.FRAG_PARSING_DATA:\n data.data.data1 = new Uint8Array(data.data1);\n if (data.data2) {\n data.data.data2 = new Uint8Array(data.data2);\n }\n /* falls through */\n default:\n data.data = data.data || {};\n data.data.frag = this.frag;\n data.data.id = this.id;\n hls.trigger(data.event, data.data);\n break;\n }\n }\n}\n\nexport default Demuxer;\n\n\n\n\n// WEBPACK FOOTER //\n// src/demux/demuxer.js","/**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.\n*/\n\nimport {logger} from '../utils/logger';\n\nclass ExpGolomb {\n\n constructor(data) {\n this.data = data;\n // the number of bytes left to examine in this.data\n this.bytesAvailable = 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 loadWord() {\n var\n data = this.data,\n bytesAvailable = this.bytesAvailable,\n position = data.byteLength - bytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, bytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(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 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 readBits(size) {\n var\n bits = Math.min(this.bitsAvailable, size), // :uint\n valu = this.word >>> (32 - bits); // :uint\n if (size > 32) {\n 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 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 skipUEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():void\n skipEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():uint\n readUEG() {\n var clz = this.skipLZ(); // :uint\n return this.readBits(clz + 1) - 1;\n }\n\n // ():int\n 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 readBoolean() {\n return 1 === this.readBits(1);\n }\n\n // ():int\n readUByte() {\n return this.readBits(8);\n }\n\n // ():int\n readUShort() {\n return this.readBits(16);\n }\n // ():int\n 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 skipScalingList(count) {\n var\n 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 readSPS() {\n var\n frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n profileIdc,profileCompat,levelIdc,\n numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n i,\n readUByte = this.readUByte.bind(this),\n readBits = this.readBits.bind(this),\n readUEG = this.readUEG.bind(this),\n readBoolean = this.readBoolean.bind(this),\n skipBits = this.skipBits.bind(this),\n skipEG = this.skipEG.bind(this),\n skipUEG = this.skipUEG.bind(this),\n skipScalingList = this.skipScalingList.bind(this);\n\n readUByte();\n profileIdc = readUByte(); // profile_idc\n profileCompat = readBits(5); // constraint_set[0-4]_flag, u(5)\n skipBits(3); // reserved_zero_3bits u(3),\n levelIdc = readUByte(); //level_idc u(8)\n skipUEG(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n if (profileIdc === 100 ||\n profileIdc === 110 ||\n profileIdc === 122 ||\n profileIdc === 244 ||\n profileIdc === 44 ||\n profileIdc === 83 ||\n profileIdc === 86 ||\n profileIdc === 118 ||\n profileIdc === 128) {\n var chromaFormatIdc = readUEG();\n if (chromaFormatIdc === 3) {\n skipBits(1); // separate_colour_plane_flag\n }\n skipUEG(); // bit_depth_luma_minus8\n skipUEG(); // bit_depth_chroma_minus8\n skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (readBoolean()) { // seq_scaling_matrix_present_flag\n scalingListCount = (chromaFormatIdc !== 3) ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (readBoolean()) { // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16);\n } else {\n skipScalingList(64);\n }\n }\n }\n }\n }\n skipUEG(); // log2_max_frame_num_minus4\n var picOrderCntType = readUEG();\n if (picOrderCntType === 0) {\n readUEG(); //log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n skipBits(1); // delta_pic_order_always_zero_flag\n skipEG(); // offset_for_non_ref_pic\n skipEG(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = readUEG();\n for(i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n skipEG(); // offset_for_ref_frame[ i ]\n }\n }\n skipUEG(); // max_num_ref_frames\n skipBits(1); // gaps_in_frame_num_value_allowed_flag\n picWidthInMbsMinus1 = readUEG();\n picHeightInMapUnitsMinus1 = readUEG();\n frameMbsOnlyFlag = readBits(1);\n if (frameMbsOnlyFlag === 0) {\n skipBits(1); // mb_adaptive_frame_field_flag\n }\n skipBits(1); // direct_8x8_inference_flag\n if (readBoolean()) { // frame_cropping_flag\n frameCropLeftOffset = readUEG();\n frameCropRightOffset = readUEG();\n frameCropTopOffset = readUEG();\n frameCropBottomOffset = readUEG();\n }\n let pixelRatio = [1,1];\n if (readBoolean()) {\n // vui_parameters_present_flag\n if (readBoolean()) {\n // aspect_ratio_info_present_flag\n const aspectRatioIdc = readUByte();\n switch (aspectRatioIdc) {\n case 1: pixelRatio = [1,1]; break;\n case 2: pixelRatio = [12,11]; break;\n case 3: pixelRatio = [10,11]; break;\n case 4: pixelRatio = [16,11]; break;\n case 5: pixelRatio = [40,33]; break;\n case 6: pixelRatio = [24,11]; break;\n case 7: pixelRatio = [20,11]; break;\n case 8: pixelRatio = [32,11]; break;\n case 9: pixelRatio = [80,33]; break;\n case 10: pixelRatio = [18,11]; break;\n case 11: pixelRatio = [15,11]; break;\n case 12: pixelRatio = [64,33]; break;\n case 13: pixelRatio = [160,99]; break;\n case 14: pixelRatio = [4,3]; break;\n case 15: pixelRatio = [3,2]; break;\n case 16: pixelRatio = [2,1]; break;\n case 255: {\n pixelRatio = [readUByte() << 8 | readUByte(), readUByte() << 8 | readUByte()];\n break;\n }\n }\n }\n }\n return {\n width: Math.ceil((((picWidthInMbsMinus1 + 1) * 16) - frameCropLeftOffset * 2 - frameCropRightOffset * 2)),\n height: ((2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16) - ((frameMbsOnlyFlag? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset)),\n pixelRatio : pixelRatio\n };\n }\n\n 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\nexport default ExpGolomb;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/exp-golomb.js","/**\n * ID3 parser\n */\n class ID3 {\n /**\n * Returns true if an ID3 header can be found at offset in data\n * @param {Uint8Array} data - The data to search in\n * @param {number} offset - The offset at which to start searching\n * @return {boolean} - True if an ID3 header is found\n */\n static isHeader(data, offset) {\n /*\n * http://id3.org/id3v2.3.0\n * [0] = 'I'\n * [1] = 'D'\n * [2] = '3'\n * [3,4] = {Version}\n * [5] = {Flags}\n * [6-9] = {ID3 Size}\n *\n * An ID3v2 tag can be detected with the following pattern:\n * $49 44 33 yy yy xx zz zz zz zz\n * Where yy is less than $FF, xx is the 'flags' byte and zz is less than $80\n */\n if (offset + 10 <= data.length) {\n //look for 'ID3' identifier\n if (data[offset] === 0x49 && data[offset+1] === 0x44 && data[offset+2] === 0x33) {\n //check version is within range\n if (data[offset+3] < 0xFF && data[offset+4] < 0xFF) {\n //check size is within range\n if (data[offset+6] < 0x80 && data[offset+7] < 0x80 && data[offset+8] < 0x80 && data[offset+9] < 0x80) {\n return true;\n }\n }\n }\n }\n\n return false;\n }\n\n /**\n * Returns true if an ID3 footer can be found at offset in data\n * @param {Uint8Array} data - The data to search in\n * @param {number} offset - The offset at which to start searching\n * @return {boolean} - True if an ID3 footer is found\n */\n static isFooter(data, offset) {\n /*\n * The footer is a copy of the header, but with a different identifier\n */\n if (offset + 10 <= data.length) {\n //look for '3DI' identifier\n if (data[offset] === 0x33 && data[offset+1] === 0x44 && data[offset+2] === 0x49) {\n //check version is within range\n if (data[offset+3] < 0xFF && data[offset+4] < 0xFF) {\n //check size is within range\n if (data[offset+6] < 0x80 && data[offset+7] < 0x80 && data[offset+8] < 0x80 && data[offset+9] < 0x80) {\n return true;\n }\n }\n }\n }\n\n return false;\n }\n\n /**\n * Returns any adjacent ID3 tags found in data starting at offset, as one block of data\n * @param {Uint8Array} data - The data to search in\n * @param {number} offset - The offset at which to start searching\n * @return {Uint8Array} - The block of data containing any ID3 tags found\n */\n static getID3Data(data, offset) {\n const front = offset;\n let length = 0;\n\n while (ID3.isHeader(data, offset)) {\n //ID3 header is 10 bytes\n length += 10;\n\n const size = ID3._readSize(data, offset + 6);\n length += size;\n\n if (ID3.isFooter(data, offset + 10)) {\n //ID3 footer is 10 bytes\n length += 10;\n }\n\n offset += length;\n }\n\n if (length > 0) {\n return data.subarray(front, front + length);\n }\n\n return undefined;\n }\n\n static _readSize(data, offset) {\n let size = 0;\n size = ((data[offset] & 0x7f) << 21);\n size |= ((data[offset+1] & 0x7f) << 14);\n size |= ((data[offset+2] & 0x7f) << 7);\n size |= (data[offset+3] & 0x7f);\n return size;\n }\n\n /**\n * Searches for the Elementary Stream timestamp found in the ID3 data chunk\n * @param {Uint8Array} data - Block of data containing one or more ID3 tags\n * @return {number} - The timestamp\n */\n static getTimeStamp(data) {\n const frames = ID3.getID3Frames(data);\n for(let i = 0; i < frames.length; i++) {\n const frame = frames[i];\n if (ID3.isTimeStampFrame(frame)) {\n return ID3._readTimeStamp(frame);\n }\n }\n\n return undefined;\n }\n\n /**\n * Returns true if the ID3 frame is an Elementary Stream timestamp frame\n * @param {ID3 frame} frame\n */\n static isTimeStampFrame(frame) {\n return (frame && frame.key === 'PRIV' && frame.info === 'com.apple.streaming.transportStreamTimestamp');\n }\n\n static _getFrameData(data) {\n /*\n Frame ID $xx xx xx xx (four characters)\n Size $xx xx xx xx\n Flags $xx xx\n */\n const type = String.fromCharCode(data[0], data[1], data[2], data[3]);\n const size = ID3._readSize(data, 4);\n\n //skip frame id, size, and flags\n let offset = 10;\n\n return { type, size, data: data.subarray(offset, offset + size) };\n }\n\n /**\n * Returns an array of ID3 frames found in all the ID3 tags in the id3Data\n * @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags\n * @return {ID3 frame[]} - Array of ID3 frame objects\n */\n static getID3Frames(id3Data) {\n let offset = 0;\n const frames = [];\n\n while (ID3.isHeader(id3Data, offset)) {\n const size = ID3._readSize(id3Data, offset + 6);\n //skip past ID3 header\n offset += 10;\n const end = offset + size;\n //loop through frames in the ID3 tag\n while (offset + 8 < end) {\n const frameData = ID3._getFrameData(id3Data.subarray(offset));\n const frame = ID3._decodeFrame(frameData);\n if (frame) {\n frames.push(frame);\n }\n //skip frame header and frame data\n offset += frameData.size + 10;\n }\n\n if (ID3.isFooter(id3Data, offset)) {\n offset += 10;\n }\n }\n\n return frames;\n }\n\n static _decodeFrame(frame) {\n if (frame.type === 'PRIV') {\n return ID3._decodePrivFrame(frame);\n } else if (frame.type[0] === 'T') {\n return ID3._decodeTextFrame(frame);\n } else if (frame.type[0] === 'W') {\n return ID3._decodeURLFrame(frame);\n }\n\n return undefined;\n }\n\n static _readTimeStamp(timeStampFrame) {\n if (timeStampFrame.data.byteLength === 8) {\n const data = new Uint8Array(timeStampFrame.data);\n // timestamp is 33 bit expressed as a big-endian eight-octet number,\n // with the upper 31 bits set to zero.\n const pts33Bit = data[3] & 0x1;\n let timestamp = (data[4] << 23) +\n (data[5] << 15) +\n (data[6] << 7) +\n data[7];\n timestamp /= 45;\n\n if (pts33Bit) {\n timestamp += 47721858.84; // 2^32 / 90\n }\n\n return Math.round(timestamp);\n }\n\n return undefined;\n }\n\n static _decodePrivFrame(frame) {\n /*\n Format: <text string>\\0<binary data>\n */\n if (frame.size < 2) {\n return undefined;\n }\n\n const owner = ID3._utf8ArrayToStr(frame.data);\n const privateData = new Uint8Array(frame.data.subarray(owner.length + 1));\n\n return { key: frame.type, info: owner, data: privateData.buffer };\n }\n\n static _decodeTextFrame(frame) {\n if (frame.size < 2) {\n return undefined;\n }\n\n if (frame.type === 'TXXX') {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Description}\\0{Value}\n */\n let index = 1;\n const description = ID3._utf8ArrayToStr(frame.data.subarray(index));\n\n index += description.length + 1;\n const value = ID3._utf8ArrayToStr(frame.data.subarray(index));\n\n return { key: frame.type, info: description, data: value };\n } else {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Value}\n */\n const text = ID3._utf8ArrayToStr(frame.data.subarray(1));\n return { key: frame.type, data: text };\n }\n }\n\n static _decodeURLFrame(frame) {\n if (frame.type === 'WXXX') {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Description}\\0{URL}\n */\n if (frame.size < 2) {\n return undefined;\n }\n\n let index = 1;\n const description = ID3._utf8ArrayToStr(frame.data.subarray(index));\n\n index += description.length + 1;\n const value = ID3._utf8ArrayToStr(frame.data.subarray(index));\n\n return { key: frame.type, info: description, data: value };\n } else {\n /*\n Format:\n [0-?] = {URL}\n */\n const url = ID3._utf8ArrayToStr(frame.data);\n return { key: frame.type, data: url };\n }\n }\n\n // http://stackoverflow.com/questions/8936984/uint8array-to-string-in-javascript/22373197\n // http://www.onicos.com/staff/iz/amuse/javascript/expert/utf.txt\n /* utf.js - UTF-8 <=> UTF-16 convertion\n *\n * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>\n * Version: 1.0\n * LastModified: Dec 25 1999\n * This library is free. You can redistribute it and/or modify it.\n */\n static _utf8ArrayToStr(array) {\n\n let char2;\n let char3;\n let out = '';\n let i = 0;\n let length = array.length;\n\n while (i < length) {\n let c = array[i++];\n switch (c >> 4) {\n case 0:\n return out;\n case 1: case 2: case 3: case 4: case 5: case 6: case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12: case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode(((c & 0x0F) << 12) |\n ((char2 & 0x3F) << 6) |\n ((char3 & 0x3F) << 0));\n break;\n }\n }\n\n return out;\n }\n}\n\nexport default ID3;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/id3.js","/**\n * MP3 demuxer\n */\nimport ID3 from '../demux/id3';\nimport { logger } from '../utils/logger';\nimport MpegAudio from './mpegaudio';\n\nclass MP3Demuxer {\n\n constructor(observer, remuxer, config) {\n this.observer = observer;\n this.config = config;\n this.remuxer = remuxer;\n }\n\n resetInitSegment(initSegment, audioCodec, videoCodec, duration) {\n this._audioTrack = { container: 'audio/mpeg', type: 'audio', id: -1, sequenceNumber: 0, isAAC: false, samples: [], len: 0, manifestCodec: audioCodec, duration: duration, inputTimeScale: 90000 };\n }\n\n resetTimeStamp() {\n }\n\n static probe(data) {\n // check if data contains ID3 timestamp and MPEG sync word\n var offset, length;\n let id3Data = ID3.getID3Data(data, 0);\n if (id3Data && ID3.getTimeStamp(id3Data) !== undefined) {\n // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1\n // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)\n // More info http://www.mp3-tech.org/programmer/frame_header.html\n for (offset = id3Data.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {\n if (MpegAudio.probe(data, offset)) {\n logger.log('MPEG Audio sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset, contiguous, accurateTimeOffset) {\n let id3Data = ID3.getID3Data(data, 0);\n let pts = 90 * ID3.getTimeStamp(id3Data);\n var offset = id3Data.length;\n var length = data.length;\n var frameIndex = 0, stamp = 0;\n var track = this._audioTrack;\n\n let id3Samples = [{ pts: pts, dts: pts, data: id3Data }];\n\n while (offset < length) {\n if (MpegAudio.isHeader(data, offset)) {\n var frame = MpegAudio.appendFrame(track, data, offset, pts, frameIndex);\n if (frame) {\n offset += frame.length;\n stamp = frame.sample.pts;\n frameIndex++;\n } else {\n //logger.log('Unable to parse Mpeg audio frame');\n break;\n }\n } else if (ID3.isHeader(data, offset)) {\n id3Data = ID3.getID3Data(data, offset);\n id3Samples.push({ pts: stamp, dts: stamp, data: id3Data });\n offset += id3Data.length;\n } else {\n //nothing found, keep looking\n offset++;\n }\n }\n\n this.remuxer.remux(track,\n { samples: [] },\n { samples: id3Samples, inputTimeScale: 90000 },\n { samples: [] },\n timeOffset,\n contiguous,\n accurateTimeOffset);\n }\n\n destroy() {\n }\n}\n\nexport default MP3Demuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/mp3demuxer.js","/**\n * MP4 demuxer\n */\n//import {logger} from '../utils/logger';\nimport Event from '../events';\n\nconst UINT32_MAX = Math.pow(2, 32) - 1;\n\n class MP4Demuxer {\n\n constructor(observer, remuxer) {\n this.observer = observer;\n this.remuxer = remuxer;\n }\n\n resetTimeStamp(initPTS) {\n this.initPTS = initPTS;\n }\n\n resetInitSegment(initSegment,audioCodec,videoCodec, duration) {\n //jshint unused:false\n if (initSegment && initSegment.byteLength) {\n const initData = this.initData = MP4Demuxer.parseInitSegment(initSegment);\n var tracks = {};\n if (initData.audio) {\n tracks.audio = { container : 'audio/mp4', codec : audioCodec, initSegment : duration ? initSegment : null };\n }\n if (initData.video) {\n tracks.video = { container : 'video/mp4', codec : videoCodec, initSegment : duration ? initSegment : null };\n }\n this.observer.trigger(Event.FRAG_PARSING_INIT_SEGMENT,{ tracks : tracks });\n } else {\n if (audioCodec) {\n this.audioCodec = audioCodec;\n }\n if (videoCodec) {\n this.videoCodec = videoCodec;\n }\n }\n }\n\n static probe(data) {\n if (data.length >= 8) {\n const dataType = MP4Demuxer.bin2str(data.subarray(4,8));\n return (['moof','ftyp','styp'].indexOf(dataType) >= 0);\n }\n return false;\n }\n\n\n static bin2str(buffer) {\n return String.fromCharCode.apply(null, buffer);\n }\n\n static readUint32(buffer, offset) {\n if (buffer.data) {\n offset += buffer.start;\n buffer = buffer.data;\n }\n\n const val = buffer[offset] << 24 |\n buffer[offset + 1] << 16 |\n buffer[offset + 2] << 8 |\n buffer[offset + 3];\n return val < 0 ? 4294967296 + val : val;\n }\n\n static writeUint32(buffer, offset, value) {\n if (buffer.data) {\n offset += buffer.start;\n buffer = buffer.data;\n }\n buffer[offset] = value >> 24;\n buffer[offset+1] = (value >> 16) & 0xff;\n buffer[offset+2] = (value >> 8) & 0xff;\n buffer[offset+3] = value & 0xff;\n }\n\n\n // Find the data for a box specified by its path\n static findBox(data,path) {\n var results = [],\n i, size, type, end, subresults, start, endbox;\n\n if (data.data) {\n start = data.start;\n end = data.end;\n data = data.data;\n } else {\n start = 0;\n end = data.byteLength;\n }\n\n if (!path.length) {\n // short-circuit the search for empty paths\n return null;\n }\n\n for (i = start; i < end;) {\n size = MP4Demuxer.readUint32(data, i);\n type = MP4Demuxer.bin2str(data.subarray(i + 4, i + 8));\n endbox = size > 1 ? i + size : end;\n\n if (type === path[0]) {\n\n if (path.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push({ data : data, start : i + 8, end : endbox});\n } else {\n // recursively search for the next box along the path\n subresults = MP4Demuxer.findBox({ data : data, start : i +8, end : endbox }, path.slice(1));\n if (subresults.length) {\n results = results.concat(subresults);\n }\n }\n }\n i = endbox;\n }\n\n // we've finished searching all of data\n return results;\n }\n\n\n\n/**\n * Parses an MP4 initialization segment and extracts stream type and\n * timescale values for any declared tracks. Timescale values indicate the\n * number of clock ticks per second to assume for time-based values\n * elsewhere in the MP4.\n *\n * To determine the start time of an MP4, you need two pieces of\n * information: the timescale unit and the earliest base media decode\n * time. Multiple timescales can be specified within an MP4 but the\n * base media decode time is always expressed in the timescale from\n * the media header box for the track:\n * ```\n * moov > trak > mdia > mdhd.timescale\n * moov > trak > mdia > hdlr\n * ```\n * @param init {Uint8Array} the bytes of the init segment\n * @return {object} a hash of track type to timescale values or null if\n * the init segment is malformed.\n */\n static parseInitSegment(initSegment) {\n var result = [];\n var traks = MP4Demuxer.findBox(initSegment, ['moov', 'trak']);\n\n traks.forEach(trak => {\n const tkhd = MP4Demuxer.findBox(trak, ['tkhd'])[0];\n if (tkhd) {\n let version = tkhd.data[tkhd.start];\n let index = version === 0 ? 12 : 20;\n let trackId = MP4Demuxer.readUint32(tkhd, index);\n\n const mdhd = MP4Demuxer.findBox(trak, ['mdia', 'mdhd'])[0];\n if (mdhd) {\n version = mdhd.data[mdhd.start];\n index = version === 0 ? 12 : 20;\n const timescale = MP4Demuxer.readUint32(mdhd, index);\n\n const hdlr = MP4Demuxer.findBox(trak, ['mdia', 'hdlr'])[0];\n if (hdlr) {\n const hdlrType = MP4Demuxer.bin2str(hdlr.data.subarray(hdlr.start+8, hdlr.start+12));\n let type = { 'soun' : 'audio', 'vide' : 'video'}[hdlrType];\n if (type) {\n result[trackId] = { timescale : timescale , type : type};\n result[type] = { timescale : timescale , id : trackId};\n }\n }\n }\n }\n });\n return result;\n }\n\n\n/**\n * Determine the base media decode start time, in seconds, for an MP4\n * fragment. If multiple fragments are specified, the earliest time is\n * returned.\n *\n * The base media decode time can be parsed from track fragment\n * metadata:\n * ```\n * moof > traf > tfdt.baseMediaDecodeTime\n * ```\n * It requires the timescale value from the mdhd to interpret.\n *\n * @param timescale {object} a hash of track ids to timescale values.\n * @return {number} the earliest base media decode start time for the\n * fragment, in seconds\n */\nstatic getStartDTS(initData, fragment) {\n var trafs, baseTimes, result;\n\n // we need info from two childrend of each track fragment box\n trafs = MP4Demuxer.findBox(fragment, ['moof', 'traf']);\n\n // determine the start times for each track\n baseTimes = [].concat.apply([], trafs.map(function(traf) {\n return MP4Demuxer.findBox(traf, ['tfhd']).map(function(tfhd) {\n var id, scale, baseTime;\n\n // get the track id from the tfhd\n id = MP4Demuxer.readUint32(tfhd, 4);\n // assume a 90kHz clock if no timescale was specified\n scale = initData[id].timescale || 90e3;\n\n // get the base media decode time from the tfdt\n baseTime = MP4Demuxer.findBox(traf, ['tfdt']).map(function(tfdt) {\n var version, result;\n\n version = tfdt.data[tfdt.start];\n result = MP4Demuxer.readUint32(tfdt, 4);\n if (version === 1) {\n result *= Math.pow(2, 32);\n\n result += MP4Demuxer.readUint32(tfdt, 8);\n }\n return result;\n })[0];\n baseTime = baseTime || Infinity;\n\n // convert base time to seconds\n return baseTime / scale;\n });\n }));\n\n // return the minimum\n result = Math.min.apply(null, baseTimes);\n return isFinite(result) ? result : 0;\n}\n\n\n\n\nstatic offsetStartDTS(initData,fragment,timeOffset) {\n MP4Demuxer.findBox(fragment, ['moof', 'traf']).map(function(traf) {\n return MP4Demuxer.findBox(traf, ['tfhd']).map(function(tfhd) {\n // get the track id from the tfhd\n var id = MP4Demuxer.readUint32(tfhd, 4);\n // assume a 90kHz clock if no timescale was specified\n var timescale = initData[id].timescale || 90e3;\n\n // get the base media decode time from the tfdt\n MP4Demuxer.findBox(traf, ['tfdt']).map(function(tfdt) {\n var version = tfdt.data[tfdt.start];\n var baseMediaDecodeTime = MP4Demuxer.readUint32(tfdt, 4);\n if (version === 0) {\n MP4Demuxer.writeUint32(tfdt, 4, baseMediaDecodeTime - timeOffset*timescale);\n } else {\n baseMediaDecodeTime *= Math.pow(2, 32);\n baseMediaDecodeTime += MP4Demuxer.readUint32(tfdt, 8);\n baseMediaDecodeTime -= timeOffset*timescale;\n const upper = Math.floor(baseMediaDecodeTime / (UINT32_MAX + 1));\n const lower = Math.floor(baseMediaDecodeTime % (UINT32_MAX + 1));\n MP4Demuxer.writeUint32(tfdt, 4, upper);\n MP4Demuxer.writeUint32(tfdt, 8, lower);\n }\n });\n });\n });\n}\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset,contiguous,accurateTimeOffset) {\n let initData = this.initData;\n if(!initData) {\n this.resetInitSegment(data,this.audioCodec,this.videoCodec);\n initData = this.initData;\n }\n let startDTS, initPTS = this.initPTS;\n if (initPTS === undefined) {\n let startDTS = MP4Demuxer.getStartDTS(initData,data);\n this.initPTS = initPTS = startDTS - timeOffset;\n this.observer.trigger(Event.INIT_PTS_FOUND, { initPTS: initPTS});\n }\n MP4Demuxer.offsetStartDTS(initData,data,initPTS);\n startDTS = MP4Demuxer.getStartDTS(initData,data);\n this.remuxer.remux(initData.audio, initData.video, null, null, startDTS, contiguous,accurateTimeOffset,data);\n }\n\n destroy() {\n }\n\n}\n\nexport default MP4Demuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/mp4demuxer.js","/**\n * MPEG parser helper\n */\n\nconst MpegAudio = {\n\n BitratesMap: [\n 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448,\n 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384,\n 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320,\n 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256,\n 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160],\n\n SamplingRateMap: [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000],\n\n appendFrame: function (track, data, offset, pts, frameIndex) {\n // Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference\n if (offset + 24 > data.length) {\n return undefined;\n }\n\n var header = this.parseHeader(data, offset);\n if (header && offset + header.frameLength <= data.length) {\n var frameDuration = 1152 * 90000 / header.sampleRate;\n var stamp = pts + frameIndex * frameDuration;\n var sample = { unit: data.subarray(offset, offset + header.frameLength), pts: stamp, dts: stamp };\n\n track.config = [];\n track.channelCount = header.channelCount;\n track.samplerate = header.sampleRate;\n track.samples.push(sample);\n track.len += header.frameLength;\n\n return { sample, length: header.frameLength };\n }\n\n return undefined;\n },\n\n parseHeader: function (data, offset) {\n var headerB = (data[offset + 1] >> 3) & 3;\n var headerC = (data[offset + 1] >> 1) & 3;\n var headerE = (data[offset + 2] >> 4) & 15;\n var headerF = (data[offset + 2] >> 2) & 3;\n var headerG = !!(data[offset + 2] & 2);\n if (headerB !== 1 && headerE !== 0 && headerE !== 15 && headerF !== 3) {\n var columnInBitrates = headerB === 3 ? (3 - headerC) : (headerC === 3 ? 3 : 4);\n var bitRate = MpegAudio.BitratesMap[columnInBitrates * 14 + headerE - 1] * 1000;\n var columnInSampleRates = headerB === 3 ? 0 : headerB === 2 ? 1 : 2;\n var sampleRate = MpegAudio.SamplingRateMap[columnInSampleRates * 3 + headerF];\n var padding = headerG ? 1 : 0;\n var channelCount = data[offset + 3] >> 6 === 3 ? 1 : 2; // If bits of channel mode are `11` then it is a single channel (Mono)\n var frameLength = headerC === 3 ?\n ((headerB === 3 ? 12 : 6) * bitRate / sampleRate + padding) << 2 :\n ((headerB === 3 ? 144 : 72) * bitRate / sampleRate + padding) | 0;\n\n return { sampleRate, channelCount, frameLength };\n }\n\n return undefined;\n },\n\n isHeaderPattern: function (data, offset) {\n return data[offset] === 0xff && (data[offset + 1] & 0xe0) === 0xe0 && (data[offset + 1] & 0x06) !== 0x00;\n },\n\n isHeader: function (data, offset) {\n // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1\n // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)\n // More info http://www.mp3-tech.org/programmer/frame_header.html\n if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {\n return true;\n }\n return false;\n },\n\n probe: function (data, offset) {\n // same as isHeader but we also check that MPEG frame follows last MPEG frame \n // or end of data is reached\n if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {\n // MPEG header Length\n let headerLength = 4;\n // MPEG frame Length\n let header = this.parseHeader(data, offset);\n let frameLength = headerLength;\n if (header && header.frameLength) {\n frameLength = header.frameLength;\n }\n let newOffset = offset + frameLength;\n if (newOffset === data.length || (newOffset + 1 < data.length && this.isHeaderPattern(data, newOffset))) {\n return true;\n }\n }\n return false;\n }\n};\n\nmodule.exports = MpegAudio;\n\n\n// WEBPACK FOOTER //\n// src/demux/mpegaudio.js","/**\n * SAMPLE-AES decrypter\n*/\n\n import Decrypter from '../crypt/decrypter';\n\n class SampleAesDecrypter {\n\n constructor(observer, config, decryptdata, discardEPB) {\n this.decryptdata = decryptdata;\n this.discardEPB = discardEPB;\n this.decrypter = new Decrypter(observer, config);\n }\n\n decryptBuffer(encryptedData, callback) {\n this.decrypter.decrypt(encryptedData, this.decryptdata.key.buffer, this.decryptdata.iv.buffer, callback);\n }\n\n // AAC - encrypt all full 16 bytes blocks starting from offset 16\n decryptAacSample(samples, sampleIndex, callback, sync) {\n let curUnit = samples[sampleIndex].unit;\n let encryptedData = curUnit.subarray(16, curUnit.length - curUnit.length % 16);\n let encryptedBuffer = encryptedData.buffer.slice(\n encryptedData.byteOffset,\n encryptedData.byteOffset + encryptedData.length);\n\n let localthis = this;\n this.decryptBuffer(encryptedBuffer, function (decryptedData) {\n decryptedData = new Uint8Array(decryptedData);\n curUnit.set(decryptedData, 16);\n\n if (!sync) {\n localthis.decryptAacSamples(samples, sampleIndex + 1, callback);\n }\n });\n }\n\n decryptAacSamples(samples, sampleIndex, callback) {\n for (;; sampleIndex++) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n\n if (samples[sampleIndex].unit.length < 32) {\n continue;\n }\n\n let sync = this.decrypter.isSync();\n\n this.decryptAacSample(samples, sampleIndex, callback, sync);\n\n if (!sync) {\n return;\n }\n }\n }\n\n // AVC - encrypt one 16 bytes block out of ten, starting from offset 32\n getAvcEncryptedData(decodedData) {\n let encryptedDataLen = Math.floor((decodedData.length - 48) / 160) * 16 + 16;\n let encryptedData = new Int8Array(encryptedDataLen);\n let outputPos = 0;\n for (let inputPos = 32; inputPos <= decodedData.length - 16; inputPos += 160, outputPos += 16) {\n encryptedData.set(decodedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return encryptedData;\n }\n\n getAvcDecryptedUnit(decodedData, decryptedData) {\n decryptedData = new Uint8Array(decryptedData);\n let inputPos = 0;\n for (let outputPos = 32; outputPos <= decodedData.length - 16; outputPos += 160, inputPos += 16) {\n decodedData.set(decryptedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return decodedData;\n }\n\n decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync) {\n let decodedData = this.discardEPB(curUnit.data);\n let encryptedData = this.getAvcEncryptedData(decodedData);\n let localthis = this;\n\n this.decryptBuffer(encryptedData.buffer, function (decryptedData) {\n curUnit.data = localthis.getAvcDecryptedUnit(decodedData, decryptedData);\n\n if (!sync) {\n localthis.decryptAvcSamples(samples, sampleIndex, unitIndex + 1, callback);\n }\n });\n }\n\n decryptAvcSamples(samples, sampleIndex, unitIndex, callback) {\n for (;; sampleIndex++, unitIndex = 0) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n\n let curUnits = samples[sampleIndex].units;\n for (;; unitIndex++) {\n if (unitIndex >= curUnits.length) {\n break;\n }\n\n let curUnit = curUnits[unitIndex];\n if (curUnit.length <= 48 || (curUnit.type !== 1 && curUnit.type !== 5)) {\n continue;\n }\n\n let sync = this.decrypter.isSync();\n\n this.decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync);\n\n if (!sync) {\n return;\n }\n }\n }\n }\n }\n\n export default SampleAesDecrypter;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/sample-aes.js","/**\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 ADTS from './adts';\n import MpegAudio from './mpegaudio';\n import Event from '../events';\n import ExpGolomb from './exp-golomb';\n import SampleAesDecrypter from './sample-aes';\n// import Hex from '../utils/hex';\n import {logger} from '../utils/logger';\n import {ErrorTypes, ErrorDetails} from '../errors';\n\n class TSDemuxer {\n\n constructor(observer, remuxer, config, typeSupported) {\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n this.remuxer = remuxer;\n this.sampleAes = null;\n }\n\n setDecryptData(decryptdata) {\n if ((decryptdata != null) && (decryptdata.key != null) && (decryptdata.method === 'SAMPLE-AES')) {\n this.sampleAes = new SampleAesDecrypter(this.observer, this.config, decryptdata, this.discardEPB);\n } else {\n this.sampleAes = null;\n }\n }\n\n static 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 resetInitSegment(initSegment,audioCodec,videoCodec, duration) {\n this.pmtParsed = false;\n this._pmtId = -1;\n this._avcTrack = {container : 'video/mp2t', type: 'video', id :-1, inputTimeScale : 90000, sequenceNumber: 0, samples : [], len : 0, dropped : 0};\n this._audioTrack = {container : 'video/mp2t', type: 'audio', id :-1, inputTimeScale : 90000, duration: duration, sequenceNumber: 0, samples : [], len : 0, isAAC: true};\n this._id3Track = {type: 'id3', id :-1, inputTimeScale : 90000, sequenceNumber: 0, samples : [], len : 0};\n this._txtTrack = {type: 'text', id: -1, inputTimeScale : 90000, sequenceNumber: 0, samples : [], len : 0};\n // flush any partial content\n this.aacOverFlow = null;\n this.aacLastPTS = null;\n this.avcSample = null;\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this._duration = duration;\n }\n\n resetTimeStamp() {\n }\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset, contiguous,accurateTimeOffset) {\n var start, len = data.length, stt, pid, atf, offset,pes,\n unknownPIDs = false;\n this.contiguous = contiguous;\n var pmtParsed = this.pmtParsed,\n avcTrack = this._avcTrack,\n audioTrack = this._audioTrack,\n id3Track = this._id3Track,\n avcId = avcTrack.id,\n audioId = audioTrack.id,\n id3Id = id3Track.id,\n pmtId = this._pmtId,\n avcData = avcTrack.pesData,\n audioData = audioTrack.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 parseMPEGPES = this._parseMPEGPES.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 }\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 audioId:\n if (stt) {\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n }\n audioData = {data: [], size: 0};\n }\n if (audioData) {\n audioData.data.push(data.subarray(offset, start + 188));\n audioData.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 let parsedPIDs = parsePMT(data, offset, this.typeSupported.mpeg === true || this.typeSupported.mp3 === true, this.sampleAes != null);\n\n // only update track id if track PID found while parsing PMT\n // this is to avoid resetting the PID to -1 in case\n // track PID transiently disappears from the stream\n // this could happen in case of transient missing audio samples for example\n avcId = parsedPIDs.avc;\n if (avcId > 0) {\n avcTrack.id = avcId;\n }\n audioId = parsedPIDs.audio;\n if (audioId > 0) {\n audioTrack.id = audioId;\n audioTrack.isAAC = parsedPIDs.isAAC;\n }\n id3Id = parsedPIDs.id3;\n if (id3Id > 0) {\n id3Track.id = id3Id;\n }\n if (unknownPIDs && !pmtParsed) {\n 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(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details: 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 (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n audioTrack.pesData = null;\n } else {\n if (audioData && audioData.size) {\n logger.log('last AAC PES packet truncated,might overlap between fragments');\n }\n // either audioData null or PES truncated, keep it for next frag parsing\n audioTrack.pesData = audioData;\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\n if (this.sampleAes == null) {\n this.remuxer.remux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);\n } else {\n this.decryptAndRemux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n\n decryptAndRemux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n if (audioTrack.samples && audioTrack.isAAC) {\n let localthis = this;\n this.sampleAes.decryptAacSamples(audioTrack.samples, 0, function() {\n localthis.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n });\n } else {\n this.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n\n decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n if (videoTrack.samples) {\n let localthis = this;\n this.sampleAes.decryptAvcSamples(videoTrack.samples, 0, 0, function () {\n localthis.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n });\n } else {\n this.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n\n destroy() {\n this._initPTS = this._initDTS = undefined;\n this._duration = 0;\n }\n\n _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 _parsePMT(data, offset, mpegSupported, isSampleAes) {\n var sectionLength, tableEnd, programInfoLength, pid, result = { audio : -1, avc : -1, id3 : -1, isAAC : true};\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 case 0xcf: // SAMPLE-AES AAC\n if (!isSampleAes) {\n logger.log('unkown stream type:' + data[offset]);\n break;\n }\n /* falls through */\n\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.audio === -1) {\n result.audio = pid;\n }\n break;\n\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\n case 0xdb: // SAMPLE-AES AVC\n if (!isSampleAes) {\n logger.log('unkown stream type:' + data[offset]);\n break;\n }\n /* falls through */\n\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\n // ISO/IEC 11172-3 (MPEG-1 audio)\n // or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)\n case 0x03:\n case 0x04:\n //logger.log('MPEG PID:' + pid);\n if (!mpegSupported) {\n logger.log('MPEG audio found, not supported in this browser for now');\n } else if (result.audio === -1) {\n result.audio = pid;\n result.isAAC = false;\n }\n break;\n\n case 0x24:\n logger.warn('HEVC stream type found, not supported for now');\n break;\n\n default:\n 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 _parsePES(stream) {\n var i = 0, frag, pesFlags, pesPrefix, pesLen, pesHdrLen, pesData, pesPts, pesDts, payloadStartOffset, 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 let 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 parsed length is not zero and greater than total received length, 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 if (pesPts - pesDts > 60*90000) {\n logger.warn(`${Math.round((pesPts - pesDts)/90000)}s delta between PTS and DTS, align them`);\n pesPts = pesDts;\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 for( let j = 0, dataLen = data.length; j < dataLen ; j++) {\n frag = data[j];\n let 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 pushAccesUnit(avcSample,avcTrack) {\n if (avcSample.units.length && avcSample.frame) {\n const samples = avcTrack.samples;\n const nbSamples = samples.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 ||\n avcSample.key === true ||\n (avcTrack.sps && (nbSamples || this.contiguous))) {\n avcSample.id = nbSamples;\n samples.push(avcSample);\n } else {\n // dropped samples, track it\n avcTrack.dropped++;\n }\n }\n if(avcSample.debug.length) {\n logger.log(avcSample.pts + '/' + avcSample.dts + ':' + avcSample.debug);\n }\n }\n\n _parseAVCPES(pes,last) {\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 spsfound = false,\n i;\n //free pes.data to save up some memory\n pes.data = null;\n\n units.forEach(unit => {\n switch(unit.type) {\n //NDR\n case 1:\n push = true;\n if(debug && avcSample) {\n avcSample.debug += 'NDR ';\n }\n avcSample.frame = true;\n let data = unit.data;\n // only check slice type to detect KF in case SPS found in same packet (any keyframe is preceded by SPS ...)\n if (spsfound && data.length > 4) {\n // retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR\n let sliceType = new ExpGolomb(data).readSliceType();\n // 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice\n // SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.\n // An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.\n // I slice: A slice that is not an SI slice that is decoded using intra prediction only.\n //if (sliceType === 2 || sliceType === 7) {\n if (sliceType === 2 || sliceType === 4 || sliceType === 7 || sliceType === 9) {\n avcSample.key = true;\n }\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 avcSample.frame = true;\n break;\n //SEI\n case 6:\n push = true;\n if(debug && avcSample) {\n avcSample.debug += 'SEI ';\n }\n expGolombDecoder = new ExpGolomb(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 }\n else if (payloadSize < expGolombDecoder.bytesAvailable)\n {\n for (i = 0; i<payloadSize; i++)\n {\n expGolombDecoder.readUByte();\n }\n }\n }\n break;\n //SPS\n case 7:\n push = true;\n spsfound = true;\n if(debug && avcSample) {\n avcSample.debug += 'SPS ';\n }\n if(!track.sps) {\n expGolombDecoder = new ExpGolomb(unit.data);\n var config = expGolombDecoder.readSPS();\n track.width = config.width;\n track.height = config.height;\n track.pixelRatio = config.pixelRatio;\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 let units = avcSample.units;\n 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 _createAVCSample(key,pts,dts,debug) {\n return { key : key, pts : pts, dts : dts, units : [], debug : debug};\n }\n\n _insertSampleInOrder(arr, data) {\n var len = arr.length;\n if (len > 0) {\n if (data.pts >= arr[len-1].pts)\n {\n arr.push(data);\n }\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 }\n else {\n arr.push(data);\n }\n }\n\n _getLastNalUnit() {\n let avcSample = this.avcSample, lastUnit;\n // try to fallback to previous sample if current one is empty\n if (!avcSample || avcSample.units.length === 0) {\n let track = this._avcTrack, samples = track.samples;\n avcSample = samples[samples.length-1];\n }\n if (avcSample) {\n let units = avcSample.units;\n lastUnit = units[units.length - 1];\n }\n return lastUnit;\n }\n\n _parseAVCNALu(array) {\n var i = 0, len = array.byteLength, value, overflow, track = this._avcTrack, state = track.naluState || 0, lastState = state;\n var units = [], unit, unitType, lastUnitStart = -1, lastUnitType;\n //logger.log('PES:' + Hex.hexDump(array));\n\n if (state === -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 = array[0] & 0x1f;\n state = 0;\n i = 1;\n }\n\n while (i < len) {\n value = array[i++];\n // optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case\n if (!state) {\n state = value ? 0 : 1;\n continue;\n }\n if (state === 1) {\n state = value ? 0 : 2;\n continue;\n }\n // here we have state either equal to 2 or 3\n if(!value) {\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 let 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 let 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 }\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 let lastUnit = this._getLastNalUnit();\n if (lastUnit) {\n let 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 discardEPB(data) {\n var length = data.byteLength,\n EPBPositions = [],\n i = 1,\n newLength, newData;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 &&\n data[i + 1] === 0 &&\n 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 _parseAACPES(pes) {\n var track = this._audioTrack,\n data = pes.data,\n pts = pes.pts,\n startOffset = 0,\n aacOverFlow = this.aacOverFlow,\n aacLastPTS = this.aacLastPTS,\n frameDuration, frameIndex, offset, stamp, len;\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 (ADTS.isHeader(data, offset)) {\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.warn(`parsing error:${reason}`);\n this.observer.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason});\n if (fatal) {\n return;\n }\n }\n\n ADTS.initTrackConfig(track, this.observer, data, offset, this.audioCodec);\n frameIndex = 0;\n frameDuration = ADTS.getFrameDuration(track.samplerate);\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.log(`AAC: align PTS for overlapping frames by ${Math.round((newPTS-pts)/90)}`);\n pts=newPTS;\n }\n }\n\n //scan for aac samples\n while (offset < len) {\n if (ADTS.isHeader(data, offset) && (offset + 5) < len) {\n var frame = ADTS.appendFrame(track, data, offset, pts, frameIndex);\n if (frame) {\n //logger.log(`${Math.round(frame.sample.pts)} : AAC`);\n offset += frame.length;\n stamp = frame.sample.pts;\n frameIndex++;\n } else {\n //logger.log('Unable to parse AAC frame');\n break;\n }\n } else {\n //nothing found, keep looking\n offset++;\n }\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 _parseMPEGPES(pes) {\n var data = pes.data;\n var length = data.length;\n var frameIndex = 0;\n var offset = 0;\n var pts = pes.pts;\n\n while (offset < length) {\n if (MpegAudio.isHeader(data, offset)) {\n var frame = MpegAudio.appendFrame(this._audioTrack, data, offset, pts, frameIndex);\n if (frame) {\n offset += frame.length;\n frameIndex++;\n } else {\n //logger.log('Unable to parse Mpeg audio frame');\n break;\n }\n } else {\n //nothing found, keep looking\n offset++;\n }\n }\n }\n\n _parseID3PES(pes) {\n this._id3Track.samples.push(pes);\n }\n}\n\nexport default TSDemuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/tsdemuxer.js","export const 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 a mux Error (demuxing/remuxing)\n MUX_ERROR: 'muxError',\n // Identifier for all other errors\n OTHER_ERROR: 'otherError'\n};\n\nexport const 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: {id : demuxer Id,frag: fragment object, reason : parsing error description }\n FRAG_DECRYPT_ERROR: 'fragDecryptError',\n // Identifier for a fragment parsing error event - data: { id : demuxer Id, reason : parsing error description }\n // will be renamed DEMUX_PARSING_ERROR and switched to MUX_ERROR in the next major release\n FRAG_PARSING_ERROR: 'fragParsingError',\n // 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 }\n REMUX_ALLOC_ERROR : 'remuxAllocError',\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 a buffer nudge on stall (playback is stuck although currentTime is in a buffered area)\n BUFFER_NUDGE_ON_STALL : 'bufferNudgeOnStall',\n // Identifier for an internal exception happening inside hls.js while handling an event\n INTERNAL_EXCEPTION: 'internalException',\n // Malformed WebVTT contents\n WEBVTT_EXCEPTION: 'webVTTException'\n};\n\n\n\n// WEBPACK FOOTER //\n// src/errors.js","/*\n*\n* All objects in the event handling chain should inherit from this class\n*\n*/\n\nimport {logger} from './utils/logger';\nimport {ErrorTypes, ErrorDetails} from './errors';\nimport Event from './events';\n\nclass EventHandler {\n\n constructor(hls, ...events) {\n this.hls = hls;\n this.onEvent = this.onEvent.bind(this);\n this.handledEvents = events;\n this.useGenericHandler = true;\n\n this.registerListeners();\n }\n\n destroy() {\n this.unregisterListeners();\n }\n\n isEventHandler() {\n return typeof this.handledEvents === 'object' && this.handledEvents.length && typeof this.onEvent === 'function';\n }\n\n 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 }, this);\n }\n }\n\n unregisterListeners() {\n if (this.isEventHandler()) {\n this.handledEvents.forEach(function(event) {\n this.hls.off(event, this.onEvent);\n }, this);\n }\n }\n\n /**\n * arguments: event (string), data (any)\n */\n onEvent(event, data) {\n this.onEventGeneric(event, data);\n }\n\n onEventGeneric(event, data) {\n var eventToFunction = function(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.error(`internal error happened while processing ${event}:${err.message}`);\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.OTHER_ERROR, details: ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event : event, err : err});\n }\n }\n}\n\nexport default EventHandler;\n\n\n\n// WEBPACK FOOTER //\n// src/event-handler.js","module.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 reset - data: { }\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, pending : nb of segments waiting for appending for this segment parent}\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 - 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 buffer has been flushed - data: { }\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 switch is requested - data: { level : id of new level } // deprecated in favor LEVEL_SWITCHING\n LEVEL_SWITCH: 'hlsLevelSwitch',\n // fired when a level switch is requested - data: { level : id of new level }\n LEVEL_SWITCHING: 'hlsLevelSwitching',\n // fired when a level switch is effective - data: { level : id of new level }\n LEVEL_SWITCHED: 'hlsLevelSwitched',\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 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 } // deprecated in favor AUDIO_TRACK_SWITCHING\n AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',\n // fired when an audio track switching is requested - data: { id : audio track id }\n AUDIO_TRACK_SWITCHING: 'hlsAudioTrackSwitching',\n // fired when an audio track switch actually occurs - data: { id : audio track id }\n AUDIO_TRACK_SWITCHED: 'hlsAudioTrackSwitched',\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 to notify that subtitle track lists has been updated - data: { subtitleTracks : subtitleTracks }\n SUBTITLE_TRACKS_UPDATED: 'hlsSubtitleTracksUpdated',\n // fired when an subtitle track switch occurs - data: { id : subtitle track id }\n SUBTITLE_TRACK_SWITCH: 'hlsSubtitleTrackSwitch',\n // fired when a subtitle track loading starts - data: { url : subtitle track URL, id : subtitle track id }\n SUBTITLE_TRACK_LOADING: 'hlsSubtitleTrackLoading',\n // fired when a subtitle track loading finishes - data: { details : levelDetails object, id : subtitle track id, stats : { trequest, tfirst, tload, mtime } }\n SUBTITLE_TRACK_LOADED: 'hlsSubtitleTrackLoaded',\n // fired when a subtitle fragment has been processed - data: { success : boolean, frag : the processed frag }\n SUBTITLE_FRAG_PROCESSED: 'hlsSubtitleFragProcessed',\n // fired when the first timestamp is found - data: { id : demuxer id, initPTS: initPTS, frag : fragment object }\n INIT_PTS_FOUND: 'hlsInitPtsFound',\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 a fragment has finished decrypting - data: { id : demuxer id, frag: fragment object, stats : { tstart, tdecrypt } }\n FRAG_DECRYPTED: 'hlsFragDecrypted',\n // 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 }\n FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',\n // fired when parsing sei text is completed - data: { id : demuxer id, frag: fragment object, samples : [ sei samples pes ] }\n FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',\n // fired when parsing id3 is completed - data: { id : demuxer id, frag: fragment object, samples : [ id3 samples pes ] }\n FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',\n // 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}\n FRAG_PARSING_DATA: 'hlsFragParsingData',\n // fired when fragment parsing is completed - data: { id : demuxer id, frag: fragment object }\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, bwEstimate } }\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 - data: { }\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\n\n// WEBPACK FOOTER //\n// src/events.js","/**\n * AAC helper\n */\n\nclass AAC {\n static getSilentFrame(codec,channelCount) {\n switch(codec) {\n case 'mp4a.40.2':\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 break;\n // handle HE-AAC below (mp4a.40.5 / mp4a.40.29)\n default:\n if (channelCount === 1) {\n // 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\n 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]);\n } else if (channelCount === 2) {\n // 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\n 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]);\n } else if (channelCount === 3) {\n // 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\n 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]);\n }\n break;\n }\n return null;\n }\n}\n\nexport default AAC;\n\n\n\n// WEBPACK FOOTER //\n// src/helper/aac.js","/**\n * Buffer Helper utils, providing methods dealing buffer length retrieval\n*/\n\nconst BufferHelper = {\n isBuffered : function(media,position) {\n if (media) {\n let buffered = media.buffered;\n for (let 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 bufferInfo : function(media, pos,maxHoleDuration) {\n if (media) {\n var vbuffered = media.buffered, buffered = [],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: pos, end: pos, nextStart : undefined} ;\n }\n },\n\n bufferedInfo : function(buffered,pos,maxHoleDuration) {\n var buffered2 = [],\n // bufferStart and bufferEnd are buffer boundaries around current video position\n bufferLen,bufferStart, bufferEnd,bufferStartNext,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\nmodule.exports = BufferHelper;\n\n\n\n// WEBPACK FOOTER //\n// src/helper/buffer-helper.js","/**\n * Level Helper class, providing methods dealing with playlist sliding and drift\n*/\n\nimport {logger} from '../utils/logger';\n\nconst LevelHelper = {\n\n mergeDetails : function(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 newFrag.backtracked = oldFrag.backtracked;\n newFrag.dropped = oldFrag.dropped;\n PTSFrag = newFrag;\n }\n }\n }\n\n if(ccOffset) {\n 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,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 updateFragPTSDTS : function(details,frag,startPTS,endPTS,startDTS,endDTS) {\n // update frag PTS/DTS\n let maxStartPTS = startPTS;\n if(!isNaN(frag.startPTS)) {\n // delta PTS between audio and video\n let 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 maxStartPTS = Math.max(startPTS,frag.startPTS);\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 const drift = startPTS - frag.start;\n frag.start = frag.startPTS = startPTS;\n frag.maxStartPTS = maxStartPTS;\n frag.endPTS = endPTS;\n frag.startDTS = startDTS;\n frag.endDTS = endDTS;\n frag.duration = endPTS - startPTS;\n\n const sn = frag.sn;\n // exit if sn out of range\n if (!details || sn < details.startSN || sn > details.endSN) {\n return 0;\n }\n var fragIdx, fragments, i;\n fragIdx = sn - details.startSN;\n fragments = details.fragments;\n frag = fragments[fragIdx];\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 updatePTS : function(fragments,fromIdx, toIdx) {\n var fragFrom = fragments[fromIdx],fragTo = fragments[toIdx], 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.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.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 = Math.max(fragFrom.start - fragTo.duration, 0);\n }\n }\n }\n};\n\nmodule.exports = LevelHelper;\n\n\n\n// WEBPACK FOOTER //\n// src/helper/level-helper.js","/**\n * HLS interface\n */\nimport URLToolkit from 'url-toolkit';\nimport Event from './events';\nimport {ErrorTypes, ErrorDetails} from './errors';\nimport PlaylistLoader from './loader/playlist-loader';\nimport FragmentLoader from './loader/fragment-loader';\nimport KeyLoader from './loader/key-loader';\n\nimport StreamController from './controller/stream-controller';\nimport LevelController from './controller/level-controller';\nimport ID3TrackController from './controller/id3-track-controller';\n\nimport {logger, enableLogs} from './utils/logger';\nimport EventEmitter from 'events';\nimport {hlsDefaultConfig} from './config';\n\nclass Hls {\n\n static get version() {\n // replaced with browserify-versionify transform\n return '0.7.10';\n }\n\n static isSupported() {\n const mediaSource = window.MediaSource = window.MediaSource || window.WebKitMediaSource;\n const sourceBuffer = window.SourceBuffer = window.SourceBuffer || window.WebKitSourceBuffer;\n const isTypeSupported = mediaSource &&\n typeof mediaSource.isTypeSupported === 'function' &&\n mediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"');\n\n // if SourceBuffer is exposed ensure its API is valid\n // safari and old version of Chrome doe not expose SourceBuffer globally so checking SourceBuffer.prototype is impossible\n const sourceBufferValidAPI = !sourceBuffer ||\n (sourceBuffer.prototype &&\n typeof sourceBuffer.prototype.appendBuffer === 'function' &&\n typeof sourceBuffer.prototype.remove === 'function');\n return isTypeSupported && sourceBufferValidAPI;\n }\n\n static get Events() {\n return Event;\n }\n\n static get ErrorTypes() {\n return ErrorTypes;\n }\n\n static get ErrorDetails() {\n return ErrorDetails;\n }\n\n static get DefaultConfig() {\n if(!Hls.defaultConfig) {\n return hlsDefaultConfig;\n }\n return Hls.defaultConfig;\n }\n\n static set DefaultConfig(defaultConfig) {\n Hls.defaultConfig = defaultConfig;\n }\n\n constructor(config = {}) {\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) { continue; }\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 enableLogs(config.debug);\n this.config = config;\n this._autoLevelCapping = -1;\n // observer setup\n var observer = this.observer = new EventEmitter();\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...data);\n };\n this.on = observer.on.bind(observer);\n this.off = observer.off.bind(observer);\n this.trigger = observer.trigger.bind(observer);\n\n // core controllers and network loaders\n const abrController = this.abrController = new config.abrController(this);\n const bufferController = new config.bufferController(this);\n const capLevelController = new config.capLevelController(this);\n const fpsController = new config.fpsController(this);\n const playListLoader = new PlaylistLoader(this);\n const fragmentLoader = new FragmentLoader(this);\n const keyLoader = new KeyLoader(this);\n const id3TrackController = new ID3TrackController(this);\n\n // network controllers\n const levelController = this.levelController = new LevelController(this);\n const streamController = this.streamController = new StreamController(this);\n let networkControllers = [levelController, streamController];\n\n // optional audio stream controller\n let Controller = config.audioStreamController;\n if (Controller) {\n networkControllers.push(new Controller(this));\n }\n this.networkControllers = networkControllers;\n\n let coreComponents = [ playListLoader, fragmentLoader, keyLoader, abrController, bufferController, capLevelController, fpsController, id3TrackController ];\n\n // optional audio track and subtitle controller\n Controller = config.audioTrackController;\n if (Controller) {\n let audioTrackController = new Controller(this);\n this.audioTrackController = audioTrackController;\n coreComponents.push(audioTrackController);\n }\n\n Controller = config.subtitleTrackController;\n if (Controller) {\n let subtitleTrackController = new Controller(this);\n this.subtitleTrackController = subtitleTrackController;\n coreComponents.push(subtitleTrackController);\n }\n\n // optional subtitle controller\n [config.subtitleStreamController, config.timelineController].forEach(Controller => {\n if (Controller) {\n coreComponents.push(new Controller(this));\n }\n });\n this.coreComponents = coreComponents;\n }\n\n destroy() {\n logger.log('destroy');\n this.trigger(Event.DESTROYING);\n this.detachMedia();\n this.coreComponents.concat(this.networkControllers).forEach(component => {component.destroy();});\n this.url = null;\n this.observer.removeAllListeners();\n this._autoLevelCapping = -1;\n }\n\n attachMedia(media) {\n logger.log('attachMedia');\n this.media = media;\n this.trigger(Event.MEDIA_ATTACHING, {media: media});\n }\n\n detachMedia() {\n logger.log('detachMedia');\n this.trigger(Event.MEDIA_DETACHING);\n this.media = null;\n }\n\n loadSource(url) {\n url = URLToolkit.buildAbsoluteURL(window.location.href, url, { alwaysNormalize: true });\n logger.log(`loadSource:${url}`);\n this.url = url;\n // when attaching to a source URL, trigger a playlist load\n this.trigger(Event.MANIFEST_LOADING, {url: url});\n }\n\n startLoad(startPosition=-1) {\n logger.log(`startLoad(${startPosition})`);\n this.networkControllers.forEach(controller => {controller.startLoad(startPosition);});\n }\n\n stopLoad() {\n logger.log('stopLoad');\n this.networkControllers.forEach(controller => {controller.stopLoad();});\n }\n\n swapAudioCodec() {\n logger.log('swapAudioCodec');\n this.streamController.swapAudioCodec();\n }\n\n recoverMediaError() {\n logger.log('recoverMediaError');\n var media = this.media;\n this.detachMedia();\n this.attachMedia(media);\n }\n\n /** Return all quality levels **/\n get levels() {\n return this.levelController.levels;\n }\n\n /** Return current playback quality level **/\n get currentLevel() {\n return this.streamController.currentLevel;\n }\n\n /* set quality level immediately (-1 for automatic level selection) */\n set currentLevel(newLevel) {\n 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 get nextLevel() {\n return this.streamController.nextLevel;\n }\n\n /* set quality level for next fragment (-1 for automatic level selection) */\n set nextLevel(newLevel) {\n 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 get loadLevel() {\n return this.levelController.level;\n }\n\n /* set quality level for current/next loaded fragment (-1 for automatic level selection) */\n set loadLevel(newLevel) {\n logger.log(`set loadLevel:${newLevel}`);\n this.levelController.manualLevel = newLevel;\n }\n\n /** Return the quality level of next loaded fragment **/\n get nextLoadLevel() {\n return this.levelController.nextLoadLevel;\n }\n\n /** set quality level of next loaded fragment **/\n set nextLoadLevel(level) {\n this.levelController.nextLoadLevel = level;\n }\n\n /** Return first level (index of first level referenced in manifest)\n **/\n get firstLevel() {\n return Math.max(this.levelController.firstLevel, this.minAutoLevel);\n }\n\n /** set first level (index of first level referenced in manifest)\n **/\n set firstLevel(newLevel) {\n 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 get startLevel() {\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 set startLevel(newLevel) {\n logger.log(`set startLevel:${newLevel}`);\n const hls = this;\n // if not in automatic start level detection, ensure startLevel is greater than minAutoLevel\n if (newLevel !== -1) {\n newLevel = Math.max(newLevel,hls.minAutoLevel);\n }\n hls.levelController.startLevel = newLevel;\n }\n\n /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n get autoLevelCapping() {\n return this._autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n set autoLevelCapping(newLevel) {\n logger.log(`set autoLevelCapping:${newLevel}`);\n this._autoLevelCapping = newLevel;\n }\n\n /* check if we are in automatic level selection mode */\n get autoLevelEnabled() {\n return (this.levelController.manualLevel === -1);\n }\n\n /* return manual level */\n get manualLevel() {\n return this.levelController.manualLevel;\n }\n\n /* return min level selectable in auto mode according to config.minAutoBitrate */\n get minAutoLevel() {\n let hls = this, levels = hls.levels, minAutoBitrate = hls.config.minAutoBitrate, len = levels ? levels.length : 0;\n for (let i = 0; i < len; i++) {\n const levelNextBitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate,levels[i].bitrate) : levels[i].bitrate;\n if (levelNextBitrate > minAutoBitrate) {\n return i;\n }\n }\n return 0;\n }\n\n /* return max level selectable in auto mode according to autoLevelCapping */\n get maxAutoLevel() {\n const hls = this;\n const levels = hls.levels;\n const autoLevelCapping = hls.autoLevelCapping;\n let 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 // return next auto level\n get nextAutoLevel() {\n const hls = this;\n // ensure next auto level is between min and max auto level\n return Math.min(Math.max(hls.abrController.nextAutoLevel,hls.minAutoLevel),hls.maxAutoLevel);\n }\n\n // this setter is used to force next auto level\n // 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)\n // forced value is valid for one fragment. upon succesful frag loading at forced level, this value will be resetted to -1 by ABR controller\n set nextAutoLevel(nextLevel) {\n const hls = this;\n hls.abrController.nextAutoLevel = Math.max(hls.minAutoLevel,nextLevel);\n }\n\n /** get alternate audio tracks list from playlist **/\n get audioTracks() {\n const audioTrackController = this.audioTrackController;\n return audioTrackController ? audioTrackController.audioTracks : [];\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n get audioTrack() {\n const audioTrackController = this.audioTrackController;\n return audioTrackController ? audioTrackController.audioTrack : -1;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n set audioTrack(audioTrackId) {\n const audioTrackController = this.audioTrackController;\n if (audioTrackController) {\n audioTrackController.audioTrack = audioTrackId;\n }\n }\n\n get liveSyncPosition() {\n return this.streamController.liveSyncPosition;\n }\n\n /** get alternate subtitle tracks list from playlist **/\n get subtitleTracks() {\n const subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTracks : [];\n }\n\n /** get index of the selected subtitle track (index in subtitle track lists) **/\n get subtitleTrack() {\n const subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTrack : -1;\n }\n\n /** select an subtitle track, based on its index in subtitle track lists**/\n set subtitleTrack(subtitleTrackId) {\n const subtitleTrackController = this.subtitleTrackController;\n if (subtitleTrackController) {\n subtitleTrackController.subtitleTrack = subtitleTrackId;\n }\n }\n}\n\nexport default Hls;\n\n\n\n// WEBPACK FOOTER //\n// src/hls.js","// 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 = require('./hls.js').default;\n\n\n\n// WEBPACK FOOTER //\n// src/index.js","/*\n * Fragment Loader\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nclass FragmentLoader extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.FRAG_LOADING);\n this.loaders = {};\n }\n\n destroy() {\n let loaders = this.loaders;\n for (let loaderName in loaders) {\n let loader = loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n EventHandler.prototype.destroy.call(this);\n }\n\n onFragLoading(data) {\n let 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.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 let loaderContext, loaderConfig, loaderCallbacks;\n loaderContext = { url : frag.url, frag : frag, responseType : 'arraybuffer', progressData : false};\n let start = frag.byteRangeStartOffset, 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 loadsuccess(response, stats, context, networkDetails=null) {\n let payload = response.data, frag = context.frag;\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[frag.type] = undefined;\n this.hls.trigger(Event.FRAG_LOADED, {payload: payload, frag: frag, stats: stats, networkDetails: networkDetails});\n }\n\n loaderror(response, context, networkDetails=null) {\n let loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.FRAG_LOAD_ERROR, fatal: false, frag: context.frag, response: response, networkDetails: networkDetails});\n }\n\n loadtimeout(stats, context, networkDetails=null) {\n let loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.FRAG_LOAD_TIMEOUT, fatal: false, frag: context.frag, networkDetails: networkDetails});\n }\n\n // data will be used for progressive parsing\n loadprogress(stats, context, data, networkDetails=null) { // jshint ignore:line\n let frag = context.frag;\n frag.loaded = stats.loaded;\n this.hls.trigger(Event.FRAG_LOAD_PROGRESS, {frag: frag, stats: stats, networkDetails: networkDetails});\n }\n}\n\nexport default FragmentLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/loader/fragment-loader.js","/*\n * Decrypt key Loader\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nclass KeyLoader extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.KEY_LOADING);\n this.loaders = {};\n this.decryptkey = null;\n this.decrypturl = null;\n }\n\n destroy() {\n for (let loaderName in this.loaders) {\n let loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n EventHandler.prototype.destroy.call(this);\n }\n\n onKeyLoading(data) {\n let 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 let config = this.hls.config;\n\n if (loader) {\n logger.warn(`abort previous key 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 let loaderContext, loaderConfig, loaderCallbacks;\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(Event.KEY_LOADED, {frag: frag});\n }\n }\n\n loadsuccess(response, stats, context) {\n let 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[frag.type] = undefined;\n this.hls.trigger(Event.KEY_LOADED, {frag: frag});\n }\n\n loaderror(response, context) {\n let frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.KEY_LOAD_ERROR, fatal: false, frag: frag, response: response});\n }\n\n loadtimeout(stats, context) {\n let frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.KEY_LOAD_TIMEOUT, fatal: false, frag: frag});\n }\n}\n\nexport default KeyLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/loader/key-loader.js","/**\n * Playlist Loader\n*/\n\nimport URLToolkit from 'url-toolkit';\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport AttrList from '../utils/attr-list';\nimport {logger} from '../utils/logger';\n\n// https://regex101.com is your friend\nconst MASTER_PLAYLIST_REGEX = /#EXT-X-STREAM-INF:([^\\n\\r]*)[\\r\\n]+([^\\r\\n]+)/g;\nconst MASTER_PLAYLIST_MEDIA_REGEX = /#EXT-X-MEDIA:(.*)/g;\n\nconst LEVEL_PLAYLIST_REGEX_FAST = new RegExp([\n /#EXTINF:(\\d*(?:\\.\\d+)?)(?:,(.*)\\s+)?/.source, // duration (#EXTINF:<duration>,<title>), group 1 => duration, group 2 => title\n /|(?!#)(\\S+)/.source, // segment URI, group 3 => the URI (note newline is not eaten)\n /|#EXT-X-BYTERANGE:*(.+)/.source, // next segment's byterange, group 4 => range spec (x@y)\n /|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source, // next segment's program date/time group 5 => the datetime spec\n /|#.*/.source // All other non-segment oriented tags will match with all groups empty\n].join(''), 'g');\n\nconst 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?/;\n\nclass LevelKey {\n\n constructor() {\n this.method = null;\n this.key = null;\n this.iv = null;\n this._uri = null;\n }\n\n get uri() {\n if (!this._uri && this.reluri) {\n this._uri = URLToolkit.buildAbsoluteURL(this.baseuri, this.reluri, { alwaysNormalize: true });\n }\n return this._uri;\n }\n\n}\n\nclass Fragment {\n\n constructor() {\n this._url = null;\n this._byteRange = null;\n this._decryptdata = null;\n this.tagList = [];\n }\n\n get url() {\n if (!this._url && this.relurl) {\n this._url = URLToolkit.buildAbsoluteURL(this.baseurl, this.relurl, { alwaysNormalize: true });\n }\n return this._url;\n }\n\n set url(value) {\n this._url = value;\n }\n\n get programDateTime() {\n if (!this._programDateTime && this.rawProgramDateTime) {\n this._programDateTime = new Date(Date.parse(this.rawProgramDateTime));\n }\n return this._programDateTime;\n }\n\n get byteRange() {\n if (!this._byteRange) {\n let byteRange = this._byteRange = [];\n if (this.rawByteRange) {\n const params = this.rawByteRange.split('@', 2);\n if (params.length === 1) {\n const lastByteRangeEndOffset = this.lastByteRangeEndOffset;\n byteRange[0] = lastByteRangeEndOffset ? lastByteRangeEndOffset : 0;\n } else {\n byteRange[0] = parseInt(params[1]);\n }\n byteRange[1] = parseInt(params[0]) + byteRange[0];\n }\n }\n return this._byteRange;\n }\n\n get byteRangeStartOffset() {\n return this.byteRange[0];\n }\n\n get byteRangeEndOffset() {\n return this.byteRange[1];\n }\n\n get decryptdata() {\n if (!this._decryptdata) {\n this._decryptdata = this.fragmentDecryptdataFromLevelkey(this.levelkey, this.sn);\n }\n return this._decryptdata;\n }\n\n /**\n * Utility method for parseLevelPlaylist to create an initialization vector for a given segment\n * @returns {Uint8Array}\n */\n 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 fragmentDecryptdataFromLevelkey(levelkey, segmentNumber) {\n var decryptdata = levelkey;\n\n if (levelkey && levelkey.method && levelkey.uri && !levelkey.iv) {\n decryptdata = new LevelKey();\n decryptdata.method = levelkey.method;\n decryptdata.baseuri = levelkey.baseuri;\n decryptdata.reluri = levelkey.reluri;\n decryptdata.iv = this.createInitializationVector(segmentNumber);\n }\n\n return decryptdata;\n }\n\n cloneObj(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n}\n\nclass PlaylistLoader extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MANIFEST_LOADING,\n Event.LEVEL_LOADING,\n Event.AUDIO_TRACK_LOADING,\n Event.SUBTITLE_TRACK_LOADING);\n this.loaders = {};\n }\n\n destroy() {\n for (let loaderName in this.loaders) {\n let loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n EventHandler.prototype.destroy.call(this);\n }\n\n onManifestLoading(data) {\n this.load(data.url, { type : 'manifest'});\n }\n\n onLevelLoading(data) {\n this.load(data.url, { type : 'level', level : data.level, id : data.id});\n }\n\n onAudioTrackLoading(data) {\n this.load(data.url, { type : 'audioTrack', id : data.id});\n }\n\n onSubtitleTrackLoading(data) {\n this.load(data.url, { type : 'subtitleTrack', id : data.id});\n }\n\n load(url, context) {\n let loader = this.loaders[context.type];\n if (loader) {\n let loaderContext = loader.context;\n if (loaderContext && loaderContext.url === url) {\n logger.trace(`playlist request ongoing`);\n return;\n } else {\n logger.warn(`abort previous loader for type:${context.type}`);\n loader.abort();\n }\n }\n let config = this.hls.config,\n retry,\n timeout,\n retryDelay,\n maxRetryDelay;\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.log(`loading playlist for ${context.type} ${context.level || context.id}`);\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 let loaderConfig, loaderCallbacks;\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 resolve(url, baseUrl) {\n return URLToolkit.buildAbsoluteURL(baseUrl, url, { alwaysNormalize: true });\n }\n\n parseMasterPlaylist(string, baseurl) {\n let levels = [], result;\n MASTER_PLAYLIST_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_REGEX.exec(string)) != null){\n const level = {};\n\n var attrs = level.attrs = new AttrList(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 (let i = 0; i < codecs.length; i++) {\n const codec = codecs[i];\n if (codec.indexOf('avc1') !== -1) {\n level.videoCodec = this.avc1toavcoti(codec);\n } else if (codec.indexOf('hvc1') !== -1) {\n level.videoCodec = codec;\n } else {\n level.audioCodec = codec;\n }\n }\n }\n\n levels.push(level);\n }\n return levels;\n }\n\n parseMasterPlaylistMedia(string, baseurl, type, audioCodec=null) {\n let result, medias = [], id = 0;\n MASTER_PLAYLIST_MEDIA_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_MEDIA_REGEX.exec(string)) != null){\n const media = {};\n var attrs = new AttrList(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 if (audioCodec) {\n media.audioCodec = audioCodec;\n }\n media.id = id++;\n medias.push(media);\n }\n }\n return medias;\n }\n\n avc1toavcoti(codec) {\n var result, 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 parseLevelPlaylist(string, baseurl, id, type) {\n var currentSN = 0,\n totalduration = 0,\n level = {type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0},\n levelkey = new LevelKey(),\n cc = 0,\n prevFrag = null,\n frag = new Fragment(),\n result,\n i;\n\n LEVEL_PLAYLIST_REGEX_FAST.lastIndex = 0;\n\n while ((result = LEVEL_PLAYLIST_REGEX_FAST.exec(string)) !== null) {\n const duration = result[1];\n if (duration) { // INF\n frag.duration = parseFloat(duration);\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n const title = (' ' + result[2]).slice(1);\n frag.title = title ? title : null;\n frag.tagList.push(title ? [ 'INF',duration,title ] : [ 'INF',duration ]);\n } else if (result[3]) { // url\n if (!isNaN(frag.duration)) {\n const sn = currentSN++;\n frag.type = type;\n frag.start = totalduration;\n frag.levelkey = levelkey;\n frag.sn = sn;\n frag.level = id;\n frag.cc = cc;\n frag.baseurl = baseurl;\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.relurl = (' ' + result[3]).slice(1);\n\n level.fragments.push(frag);\n prevFrag = frag;\n totalduration += frag.duration;\n\n frag = new Fragment();\n }\n } else if (result[4]) { // X-BYTERANGE\n frag.rawByteRange = (' ' + result[4]).slice(1);\n if (prevFrag) {\n const lastByteRangeEndOffset = prevFrag.byteRangeEndOffset;\n if (lastByteRangeEndOffset) {\n frag.lastByteRangeEndOffset = lastByteRangeEndOffset;\n }\n }\n } else if (result[5]) { // PROGRAM-DATE-TIME\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.rawProgramDateTime = (' ' + result[5]).slice(1);\n frag.tagList.push(['PROGRAM-DATE-TIME', frag.rawProgramDateTime]);\n } else {\n result = result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);\n for (i = 1; i < result.length; i++) {\n if (result[i] !== undefined) {\n break;\n }\n }\n\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n const value1 = (' ' + result[i+1]).slice(1);\n const value2 = (' ' + result[i+2]).slice(1);\n\n switch (result[i]) {\n case '#':\n frag.tagList.push(value2 ? [ value1,value2 ] : [ value1 ]);\n break;\n case 'PLAYLIST-TYPE':\n level.type = value1.toUpperCase();\n break;\n case 'MEDIA-SEQUENCE':\n currentSN = level.startSN = parseInt(value1);\n break;\n case 'TARGETDURATION':\n level.targetduration = parseFloat(value1);\n break;\n case 'VERSION':\n level.version = parseInt(value1);\n break;\n case 'EXTM3U':\n break;\n case 'ENDLIST':\n level.live = false;\n break;\n case 'DIS':\n cc++;\n frag.tagList.push(['DIS']);\n break;\n case 'DISCONTINUITY-SEQ':\n cc = parseInt(value1);\n break;\n case 'KEY':\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4\n var decryptparams = value1;\n var keyAttrs = new AttrList(decryptparams);\n var decryptmethod = keyAttrs.enumeratedString('METHOD'),\n decrypturi = keyAttrs.URI,\n decryptiv = keyAttrs.hexadecimalInteger('IV');\n if (decryptmethod) {\n levelkey = new LevelKey();\n if ((decrypturi) && (['AES-128', 'SAMPLE-AES'].indexOf(decryptmethod) >= 0)) {\n levelkey.method = decryptmethod;\n // URI to get the key\n levelkey.baseuri = baseurl;\n levelkey.reluri = decrypturi;\n levelkey.key = null;\n // Initialization Vector (IV)\n levelkey.iv = decryptiv;\n }\n }\n break;\n case 'START':\n let startParams = value1;\n let startAttrs = new AttrList(startParams);\n let startTimeOffset = startAttrs.decimalFloatingPoint('TIME-OFFSET');\n //TIME-OFFSET can be 0\n if ( !isNaN(startTimeOffset) ) {\n level.startTimeOffset = startTimeOffset;\n }\n break;\n case 'MAP':\n let mapAttrs = new AttrList(value1);\n frag.relurl = mapAttrs.URI;\n frag.rawByteRange = mapAttrs.BYTERANGE;\n frag.baseurl = baseurl;\n frag.level = id;\n frag.type = type;\n frag.sn = 'initSegment';\n level.initSegment = frag;\n frag = new Fragment();\n break;\n default:\n logger.warn(`line parsed but not handled: ${result}`);\n break;\n }\n }\n }\n frag = prevFrag;\n //logger.log('found ' + level.fragments.length + ' fragments');\n if(frag && !frag.relurl) {\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 loadsuccess(response, stats, context, networkDetails=null) {\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 let isLevel = (type !== 'audioTrack' && type !== 'subtitleTrack'),\n levelId = !isNaN(level) ? level : !isNaN(id) ? id : 0,\n levelDetails = this.parseLevelPlaylist(string, url, levelId, (type === 'audioTrack' ? 'audio' : (type === 'subtitleTrack' ? 'subtitle' : 'main') ));\n levelDetails.tload = stats.tload;\n if (type === 'manifest') {\n // first request, stream manifest (no master playlist), fire manifest loaded event with level details\n hls.trigger(Event.MANIFEST_LOADED, {levels: [{url: url, details : levelDetails}], audioTracks : [], url: url, stats: stats, networkDetails: networkDetails});\n }\n stats.tparsed = performance.now();\n if (levelDetails.targetduration) {\n if (isLevel) {\n hls.trigger(Event.LEVEL_LOADED, {details: levelDetails, level: level || 0, id: id || 0, stats: stats, networkDetails: networkDetails});\n } else {\n if (type === 'audioTrack') {\n hls.trigger(Event.AUDIO_TRACK_LOADED, {details: levelDetails, id: id, stats: stats, networkDetails: networkDetails});\n }\n else if (type === 'subtitleTrack') {\n hls.trigger(Event.SUBTITLE_TRACK_LOADED, {details: levelDetails, id: id, stats: stats, networkDetails: networkDetails});\n }\n }\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'invalid targetduration', networkDetails: networkDetails});\n }\n } else {\n let levels = this.parseMasterPlaylist(string, url);\n // multi level playlist, parse level info\n if (levels.length) {\n let audioTracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO', levels[0].audioCodec);\n let subtitles = this.parseMasterPlaylistMedia(string, url, 'SUBTITLES');\n if (audioTracks.length) {\n // check if we have found an audio track embedded in main playlist (audio track without URI attribute)\n let embeddedAudioFound = false;\n audioTracks.forEach(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.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(Event.MANIFEST_LOADED, {levels, audioTracks, subtitles, url, stats, networkDetails});\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no level found in manifest', networkDetails: networkDetails});\n }\n }\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter', networkDetails: networkDetails});\n }\n }\n\n loaderror(response, context, networkDetails=null) {\n var details, fatal,loader = context.loader;\n switch(context.type) {\n case 'manifest':\n details = ErrorDetails.MANIFEST_LOAD_ERROR;\n fatal = true;\n break;\n case 'level':\n details = ErrorDetails.LEVEL_LOAD_ERROR;\n fatal = false;\n break;\n case 'audioTrack':\n details = 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(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, response: response, context : context, networkDetails: networkDetails});\n }\n\n loadtimeout(stats, context, networkDetails=null) {\n var details, fatal, loader = context.loader;\n switch(context.type) {\n case 'manifest':\n details = ErrorDetails.MANIFEST_LOAD_TIMEOUT;\n fatal = true;\n break;\n case 'level':\n details = ErrorDetails.LEVEL_LOAD_TIMEOUT;\n fatal = false;\n break;\n case 'audioTrack':\n details = 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(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, context : context, networkDetails: networkDetails});\n }\n}\n\nexport default PlaylistLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/loader/playlist-loader.js","/**\n * Generate MP4 Box\n*/\n\n//import Hex from '../utils/hex';\n\nconst UINT32_MAX = Math.pow(2, 32) - 1;\n\nclass MP4 {\n static 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 '.mp3': [],\n mvex: [],\n mvhd: [],\n pasp: [],\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] = [\n i.charCodeAt(0),\n i.charCodeAt(1),\n i.charCodeAt(2),\n i.charCodeAt(3)\n ];\n }\n }\n\n var videoHdlr = new Uint8Array([\n 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,\n 0x6f, 0x48, 0x61, 0x6e,\n 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n\n var audioHdlr = new Uint8Array([\n 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,\n 0x64, 0x48, 0x61, 0x6e,\n 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([\n 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([\n 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([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00, // sample_count\n ]);\n MP4.VMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00,\n 0x00, 0x00,\n 0x00, 0x00 // opcolor\n ]);\n MP4.SMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance\n 0x00, 0x00 // reserved\n ]);\n\n MP4.STSD = new Uint8Array([\n 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 static box(type) {\n var\n 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 static hdlr(type) {\n return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);\n }\n\n static mdat(data) {\n return MP4.box(MP4.types.mdat, data);\n }\n\n static mdhd(timescale, duration) {\n duration *= timescale;\n const upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n const lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.mdhd, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n (timescale >> 24) & 0xFF,\n (timescale >> 16) & 0xFF,\n (timescale >> 8) & 0xFF,\n timescale & 0xFF, // timescale\n (upperWordDuration >> 24),\n (upperWordDuration >> 16) & 0xFF,\n (upperWordDuration >> 8) & 0xFF,\n upperWordDuration & 0xFF,\n (lowerWordDuration >> 24),\n (lowerWordDuration >> 16) & 0xFF,\n (lowerWordDuration >> 8) & 0xFF,\n lowerWordDuration & 0xFF,\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00\n ]));\n }\n\n static 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 static mfhd(sequenceNumber) {\n return MP4.box(MP4.types.mfhd, new Uint8Array([\n 0x00,\n 0x00, 0x00, 0x00, // flags\n (sequenceNumber >> 24),\n (sequenceNumber >> 16) & 0xFF,\n (sequenceNumber >> 8) & 0xFF,\n sequenceNumber & 0xFF, // sequence_number\n ]));\n }\n\n static 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 static 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 static moov(tracks) {\n var\n 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 static mvex(tracks) {\n var\n 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 static mvhd(timescale,duration) {\n duration*=timescale;\n const upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n const lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n var\n bytes = new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n (timescale >> 24) & 0xFF,\n (timescale >> 16) & 0xFF,\n (timescale >> 8) & 0xFF,\n timescale & 0xFF, // timescale\n (upperWordDuration >> 24),\n (upperWordDuration >> 16) & 0xFF,\n (upperWordDuration >> 8) & 0xFF,\n upperWordDuration & 0xFF,\n (lowerWordDuration >> 24),\n (lowerWordDuration >> 16) & 0xFF,\n (lowerWordDuration >> 8) & 0xFF,\n lowerWordDuration & 0xFF,\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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 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 static sdtp(track) {\n var\n 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) |\n (flags.isDependedOn << 2) |\n (flags.hasRedundancy);\n }\n\n return MP4.box(MP4.types.sdtp, bytes);\n }\n\n static 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 static avc1(track) {\n var sps = [], pps = [], i, data, 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([\n 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([\n track.pps.length // numOfPictureParameterSets\n ]).concat(pps))), // \"PPS\"\n width = track.width,\n height = track.height,\n hSpacing = track.pixelRatio[0],\n vSpacing = track.pixelRatio[1];\n //console.log('avcc:' + Hex.hexDump(avcc));\n return MP4.box(MP4.types.avc1, new Uint8Array([\n 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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n (width >> 8) & 0xFF,\n width & 0xff, // width\n (height >> 8) & 0xFF,\n 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,\n 0x64, 0x61, 0x69, 0x6C, //dailymotion/hls.js\n 0x79, 0x6D, 0x6F, 0x74,\n 0x69, 0x6F, 0x6E, 0x2F,\n 0x68, 0x6C, 0x73, 0x2E,\n 0x6A, 0x73, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11]), // pre_defined = -1\n avcc,\n MP4.box(MP4.types.btrt, new Uint8Array([\n 0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0])), // avgBitrate\n MP4.box(MP4.types.pasp, new Uint8Array([\n (hSpacing >> 24), // hSpacing\n (hSpacing >> 16) & 0xFF,\n (hSpacing >> 8) & 0xFF,\n hSpacing & 0xFF,\n (vSpacing >> 24), // vSpacing\n (vSpacing >> 16) & 0xFF,\n (vSpacing >> 8) & 0xFF,\n vSpacing & 0xFF]))\n );\n }\n\n static esds(track) {\n var configlen = track.config.length;\n return new Uint8Array([\n 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 static mp4a(track) {\n var samplerate = track.samplerate;\n return MP4.box(MP4.types.mp4a, new Uint8Array([\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n (samplerate >> 8) & 0xFF,\n samplerate & 0xff, //\n 0x00, 0x00]),\n MP4.box(MP4.types.esds, MP4.esds(track)));\n }\n\n static mp3(track) {\n var samplerate = track.samplerate;\n return MP4.box(MP4.types['.mp3'], new Uint8Array([\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n (samplerate >> 8) & 0xFF,\n samplerate & 0xff, //\n 0x00, 0x00]));\n }\n\n static stsd(track) {\n if (track.type === 'audio') {\n if (!track.isAAC && track.codec === 'mp3') {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));\n }\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 static tkhd(track) {\n var id = track.id,\n duration = track.duration*track.timescale,\n width = track.width,\n height = track.height,\n upperWordDuration = Math.floor(duration / (UINT32_MAX + 1)),\n lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.tkhd, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n (id >> 24) & 0xFF,\n (id >> 16) & 0xFF,\n (id >> 8) & 0xFF,\n id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n (upperWordDuration >> 24),\n (upperWordDuration >> 16) & 0xFF,\n (upperWordDuration >> 8) & 0xFF,\n upperWordDuration & 0xFF,\n (lowerWordDuration >> 24),\n (lowerWordDuration >> 16) & 0xFF,\n (lowerWordDuration >> 8) & 0xFF,\n lowerWordDuration & 0xFF,\n 0x00, 0x00, 0x00, 0x00,\n 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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n (width >> 8) & 0xFF,\n width & 0xFF,\n 0x00, 0x00, // width\n (height >> 8) & 0xFF,\n height & 0xFF,\n 0x00, 0x00 // height\n ]));\n }\n\n static traf(track,baseMediaDecodeTime) {\n var sampleDependencyTable = MP4.sdtp(track),\n id = track.id,\n upperWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime / (UINT32_MAX + 1)),\n lowerWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime % (UINT32_MAX + 1));\n return MP4.box(MP4.types.traf,\n MP4.box(MP4.types.tfhd, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (id >> 24),\n (id >> 16) & 0XFF,\n (id >> 8) & 0XFF,\n (id & 0xFF) // track_ID\n ])),\n MP4.box(MP4.types.tfdt, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n (upperWordBaseMediaDecodeTime >>24),\n (upperWordBaseMediaDecodeTime >> 16) & 0XFF,\n (upperWordBaseMediaDecodeTime >> 8) & 0XFF,\n (upperWordBaseMediaDecodeTime & 0xFF),\n (lowerWordBaseMediaDecodeTime >>24),\n (lowerWordBaseMediaDecodeTime >> 16) & 0XFF,\n (lowerWordBaseMediaDecodeTime >> 8) & 0XFF,\n (lowerWordBaseMediaDecodeTime & 0xFF)\n ])),\n MP4.trun(track,\n sampleDependencyTable.length +\n 16 + // tfhd\n 20 + // 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 static trak(track) {\n track.duration = track.duration || 0xffffffff;\n return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));\n }\n\n static trex(track) {\n var id = track.id;\n return MP4.box(MP4.types.trex, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (id >> 24),\n (id >> 16) & 0XFF,\n (id >> 8) & 0XFF,\n (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 static trun(track, offset) {\n var samples= track.samples || [],\n len = samples.length,\n arraylen = 12 + (16 * len),\n array = new Uint8Array(arraylen),\n i,sample,duration,size,flags,cts;\n offset += 8 + arraylen;\n array.set([\n 0x00, // version 0\n 0x00, 0x0f, 0x01, // flags\n (len >>> 24) & 0xFF,\n (len >>> 16) & 0xFF,\n (len >>> 8) & 0xFF,\n len & 0xFF, // sample_count\n (offset >>> 24) & 0xFF,\n (offset >>> 16) & 0xFF,\n (offset >>> 8) & 0xFF,\n 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([\n (duration >>> 24) & 0xFF,\n (duration >>> 16) & 0xFF,\n (duration >>> 8) & 0xFF,\n duration & 0xFF, // sample_duration\n (size >>> 24) & 0xFF,\n (size >>> 16) & 0xFF,\n (size >>> 8) & 0xFF,\n size & 0xFF, // sample_size\n (flags.isLeading << 2) | flags.dependsOn,\n (flags.isDependedOn << 6) |\n (flags.hasRedundancy << 4) |\n (flags.paddingValue << 1) |\n flags.isNonSync,\n flags.degradPrio & 0xF0 << 8,\n flags.degradPrio & 0x0F, // sample_flags\n (cts >>> 24) & 0xFF,\n (cts >>> 16) & 0xFF,\n (cts >>> 8) & 0xFF,\n cts & 0xFF // sample_composition_time_offset\n ],12+16*i);\n }\n return MP4.box(MP4.types.trun, array);\n }\n\n static initSegment(tracks) {\n if (!MP4.types) {\n MP4.init();\n }\n var movie = MP4.moov(tracks), 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\nexport default MP4;\n\n\n\n// WEBPACK FOOTER //\n// src/remux/mp4-generator.js"," /**\n * fMP4 remuxer\n*/\n\n\nimport AAC from '../helper/aac';\nimport Event from '../events';\nimport {logger} from '../utils/logger';\nimport MP4 from '../remux/mp4-generator';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n\n// 10 seconds\nconst MAX_SILENT_FRAME_DURATION = 10 * 1000;\n\nclass MP4Remuxer {\n constructor(observer, config, typeSupported, vendor) {\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n const userAgent = navigator.userAgent;\n this.isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');\n this.ISGenerated = false;\n }\n\n destroy() {\n }\n\n resetTimeStamp(defaultTimeStamp) {\n this._initPTS = this._initDTS = defaultTimeStamp;\n }\n\n resetInitSegment() {\n this.ISGenerated = false;\n }\n\n remux(audioTrack,videoTrack,id3Track,textTrack,timeOffset, contiguous,accurateTimeOffset) {\n // generate Init Segment if needed\n if (!this.ISGenerated) {\n this.generateIS(audioTrack,videoTrack,timeOffset);\n } else {\n if (accurateTimeOffset) {\n // check timestamp consistency. it there is more than 10s gap between expected PTS/DTS, recompute initPTS/DTS\n const refPTS = this._initPTS;\n const ptsNormalize = this._PTSNormalize;\n const timeScale = audioTrack.inputTimeScale || videoTrack.inputTimeScale;\n let initPTS = Infinity, initDTS = Infinity;\n let samples = audioTrack.samples;\n if (samples.length) {\n initPTS = initDTS = ptsNormalize(samples[0].pts - timeScale * timeOffset, refPTS);\n }\n samples = videoTrack.samples;\n if (samples.length) {\n let sample = samples[0];\n initPTS = Math.min(initPTS,ptsNormalize(sample.pts - timeScale * timeOffset, refPTS));\n initDTS = Math.min(initDTS,ptsNormalize(sample.dts - timeScale * timeOffset, refPTS));\n }\n if (initPTS !== Infinity) {\n const initPTSDelta = refPTS - initPTS;\n if (Math.abs(initPTSDelta) > 10 * timeScale) {\n logger.warn(`timestamp inconsistency, ${(initPTSDelta/timeScale).toFixed(3)}s delta against expected value: missing discontinuity ? reset initPTS/initDTS`);\n this._initPTS = initPTS;\n this._initDTS = initDTS;\n this.observer.trigger(Event.INIT_PTS_FOUND, { initPTS: initPTS});\n }\n }\n }\n }\n\n if (this.ISGenerated) {\n // Purposefully remuxing audio before video, so that remuxVideo can use nextAudioPts, which is\n // calculated in remuxAudio.\n //logger.log('nb AAC samples:' + audioTrack.samples.length);\n if (audioTrack.samples.length) {\n // if initSegment was generated without video samples, regenerate it again\n if (!audioTrack.timescale) {\n logger.warn('regenerate InitSegment as audio detected');\n this.generateIS(audioTrack,videoTrack,timeOffset);\n }\n let audioData = this.remuxAudio(audioTrack,timeOffset,contiguous,accurateTimeOffset);\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n let audioTrackLength;\n if (audioData) {\n audioTrackLength = audioData.endPTS - audioData.startPTS;\n }\n // if initSegment was generated without video samples, regenerate it again\n if (!videoTrack.timescale) {\n logger.warn('regenerate InitSegment as video detected');\n this.generateIS(audioTrack,videoTrack,timeOffset);\n }\n this.remuxVideo(videoTrack,timeOffset,contiguous,audioTrackLength, accurateTimeOffset);\n }\n } else {\n let videoData;\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n videoData = this.remuxVideo(videoTrack,timeOffset,contiguous, accurateTimeOffset);\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(Event.FRAG_PARSED);\n }\n\n generateIS(audioTrack,videoTrack,timeOffset) {\n var observer = this.observer,\n audioSamples = audioTrack.samples,\n videoSamples = videoTrack.samples,\n typeSupported = this.typeSupported,\n container = 'audio/mp4',\n tracks = {},\n data = { tracks : tracks },\n computePTSDTS = (this._initPTS === undefined),\n initPTS, initDTS;\n\n if (computePTSDTS) {\n initPTS = initDTS = Infinity;\n }\n if (audioTrack.config && audioSamples.length) {\n // let's use audio sampling rate as MP4 time scale.\n // rationale is that there is a integer nb of audio frames per audio sample (1024 for AAC)\n // using audio sampling rate here helps having an integer MP4 frame duration\n // this avoids potential rounding issue and AV sync issue\n audioTrack.timescale = audioTrack.samplerate;\n logger.log (`audio sampling rate : ${audioTrack.samplerate}`);\n if (!audioTrack.isAAC) {\n if (typeSupported.mpeg) { // Chrome and Safari\n container = 'audio/mpeg';\n audioTrack.codec = '';\n } else if (typeSupported.mp3) { // Firefox\n audioTrack.codec = 'mp3';\n }\n }\n tracks.audio = {\n container : container,\n codec : audioTrack.codec,\n initSegment : !audioTrack.isAAC && typeSupported.mpeg ? new Uint8Array() : MP4.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 - audioTrack.inputTimeScale * timeOffset;\n }\n }\n\n if (videoTrack.sps && videoTrack.pps && videoSamples.length) {\n // let's use input time scale as MP4 video timescale\n // we use input time scale straight away to avoid rounding issues on frame duration / cts computation\n const inputTimeScale = videoTrack.inputTimeScale;\n videoTrack.timescale = inputTimeScale;\n tracks.video = {\n container : 'video/mp4',\n codec : videoTrack.codec,\n initSegment : MP4.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 - inputTimeScale * timeOffset);\n initDTS = Math.min(initDTS,videoSamples[0].dts - inputTimeScale * timeOffset);\n this.observer.trigger(Event.INIT_PTS_FOUND, { initPTS: initPTS});\n }\n }\n\n if(Object.keys(tracks).length) {\n observer.trigger(Event.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(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'no audio/video samples found'});\n }\n }\n\n remuxVideo(track, timeOffset, contiguous, audioTrackLength, accurateTimeOffset) {\n var offset = 8,\n timeScale = track.timescale,\n mp4SampleDuration,\n mdat, moof,\n firstPTS, firstDTS,\n nextDTS,\n lastPTS, lastDTS,\n inputSamples = track.samples,\n outputSamples = [],\n nbSamples = inputSamples.length,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS;\n\n // for (let i = 0; i < track.samples.length; i++) {\n // let avcSample = track.samples[i];\n // let units = avcSample.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 // if parsed fragment is contiguous with last one, let's use last DTS value as reference\n let nextAvcDts = this.nextAvcDts;\n\n const isSafari = this.isSafari;\n\n // Safari does not like overlapping DTS on consecutive fragments. let's use nextAvcDts to overcome this if fragments are consecutive\n if (isSafari) {\n // also consider consecutive fragments as being contiguous (even if a level switch occurs),\n // for sake of clarity:\n // consecutive fragments are frags with\n // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR\n // - less than 200 ms PTS gaps (timeScale/5)\n contiguous |= (inputSamples.length && nextAvcDts &&\n ((accurateTimeOffset && Math.abs(timeOffset-nextAvcDts/timeScale) < 0.1) ||\n Math.abs((inputSamples[0].pts-nextAvcDts-initDTS)) < timeScale/5)\n );\n }\n\n if (!contiguous) {\n // if not contiguous, let's use target timeOffset\n nextAvcDts = timeOffset*timeScale;\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 inputSamples.forEach(function(sample) {\n sample.pts = ptsNormalize(sample.pts-initDTS, nextAvcDts);\n sample.dts = ptsNormalize(sample.dts-initDTS, nextAvcDts);\n });\n\n // sort video samples by DTS then PTS then demux id order\n inputSamples.sort(function(a, b) {\n const deltadts = a.dts - b.dts;\n const deltapts = a.pts - b.pts;\n return deltadts ? deltadts : deltapts ? deltapts : (a.id - b.id);\n });\n\n // handle broken streams with PTS < DTS, tolerance up 200ms (18000 in 90kHz timescale)\n let PTSDTSshift = inputSamples.reduce( (prev, curr) => Math.max(Math.min(prev,curr.pts-curr.dts),-18000),0);\n if (PTSDTSshift < 0) {\n logger.warn(`PTS < DTS detected in video samples, shifting DTS by ${Math.round(PTSDTSshift/90)} ms to overcome this issue`);\n for (let i = 0; i < inputSamples.length; i++) {\n inputSamples[i].dts += PTSDTSshift;\n }\n }\n\n // compute first DTS and last DTS, normalize them against reference value\n let sample = inputSamples[0];\n firstDTS = Math.max(sample.dts,0);\n firstPTS = Math.max(sample.pts,0);\n\n // check timestamp continuity accross consecutive fragments (this is to remove inter-fragment gap/hole)\n let 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.log(`AVC:${delta} ms hole between fragments detected,filling it`);\n } else if (delta < -1) {\n 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;\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;\n 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(sample.dts,0);\n lastPTS = Math.max(sample.pts,0,lastDTS);\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)/(inputSamples.length-1));\n }\n\n let nbNalu = 0, naluLen = 0;\n for (let i = 0 ; i < nbSamples; i++) {\n // compute total/avc sample length and nb of NAL units\n let sample = inputSamples[i], units = sample.units, nbUnits = units.length, sampleLen = 0;\n for (let j = 0; j < nbUnits; j++) {\n sampleLen += units[j].data.length;\n }\n naluLen += sampleLen;\n nbNalu += nbUnits;\n sample.length = sampleLen;\n\n // normalize PTS/DTS\n if (isSafari) {\n // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples\n sample.dts = firstDTS + i*mp4SampleDuration;\n } else {\n // ensure sample monotonic DTS\n sample.dts = Math.max(sample.dts,firstDTS);\n }\n // ensure that computed value is greater or equal than sample DTS\n sample.pts = Math.max(sample.pts , sample.dts);\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 let mdatSize = naluLen + (4 * nbNalu) + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch(err) {\n this.observer.trigger(Event.ERROR, {type : ErrorTypes.MUX_ERROR, details: ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes : mdatSize, reason: `fail allocating video mdat ${mdatSize}`});\n return;\n }\n let view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(MP4.types.mdat, 4);\n\n for (let i = 0 ; i < nbSamples; i++) {\n let avcSample = inputSamples[i],\n avcSampleUnits = avcSample.units,\n mp4SampleLength = 0,\n compositionTimeOffset;\n // convert NALU bitstream to MP4 format (prepend NALU with size field)\n for(let j = 0, nbUnits = avcSampleUnits.length; j < nbUnits ; j++) {\n let unit = avcSampleUnits[j],\n unitData = unit.data,\n unitDataLen = unit.data.byteLength;\n view.setUint32(offset, unitDataLen);\n offset += 4;\n mdat.set(unitData, offset);\n offset += unitDataLen;\n mp4SampleLength += 4 + unitDataLen;\n }\n\n if(!isSafari) {\n // expected sample duration is the Decoding Timestamp diff of consecutive samples\n if (i < nbSamples - 1) {\n mp4SampleDuration = inputSamples[i+1].dts - avcSample.dts;\n } else {\n let config = this.config,\n lastFrameDuration = avcSample.dts - inputSamples[i > 0 ? i-1 : i].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 let maxBufferHole = config.maxBufferHole,\n maxSeekHole = config.maxSeekHole,\n gapTolerance = Math.floor(Math.min(maxBufferHole, maxSeekHole) * timeScale),\n deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * timeScale : this.nextAudioPts) - 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.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 compositionTimeOffset = Math.round(avcSample.pts - avcSample.dts);\n } else {\n compositionTimeOffset = Math.max(0,mp4SampleDuration*Math.round((avcSample.pts - avcSample.dts)/mp4SampleDuration));\n }\n\n\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${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;\n let 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 let 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 = MP4.moof(track.sequenceNumber++, firstDTS , track);\n track.samples = [];\n\n let data = {\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / timeScale,\n endPTS: (lastPTS + mp4SampleDuration) / timeScale,\n startDTS: firstDTS / timeScale,\n endDTS: this.nextAvcDts / timeScale,\n type: 'video',\n nb: outputSamples.length,\n dropped : dropped\n };\n this.observer.trigger(Event.FRAG_PARSING_DATA, data);\n return data;\n }\n\n remuxAudio(track, timeOffset, contiguous,accurateTimeOffset) {\n const inputTimeScale = track.inputTimeScale,\n mp4timeScale = track.timescale,\n scaleFactor = inputTimeScale/mp4timeScale,\n mp4SampleDuration = track.isAAC ? 1024 : 1152,\n inputSampleDuration = mp4SampleDuration * scaleFactor,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS,\n rawMPEG = !track.isAAC && this.typeSupported.mpeg;\n\n var offset,\n mp4Sample,\n fillFrame,\n mdat, moof,\n firstPTS, lastPTS,\n inputSamples = track.samples,\n outputSamples = [],\n nextAudioPts = this.nextAudioPts;\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\n // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR\n // - less than 20 audio frames distance\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 contiguous |= (inputSamples.length && nextAudioPts &&\n ((accurateTimeOffset && Math.abs(timeOffset-nextAudioPts/inputTimeScale) < 0.1) ||\n Math.abs((inputSamples[0].pts-nextAudioPts-initDTS)) < 20*inputSampleDuration)\n );\n\n if (!contiguous) {\n // if fragments are not contiguous, let's use timeOffset to compute next Audio PTS\n nextAudioPts = timeOffset*inputTimeScale;\n }\n\n // compute normalized PTS\n inputSamples.forEach(function(sample) {\n sample.pts = sample.dts = ptsNormalize(sample.pts - initDTS, nextAudioPts);\n });\n\n // sort based on normalized PTS (this is to avoid sorting issues in case timestamp\n // reloop in the middle of our samples array)\n inputSamples.sort(function(a, b) {\n return a.pts - b.pts;\n });\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\n // only inject/drop audio frames in case time offset is accurate\n if (accurateTimeOffset && track.isAAC) {\n for (let i = 0, nextPts = nextAudioPts; i < inputSamples.length; ) {\n // First, let's see how far off this frame is from where we expect it to be\n var sample = inputSamples[i], delta;\n let pts = sample.pts;\n delta = pts - nextPts;\n\n const duration = Math.abs(1000*delta/inputTimeScale);\n\n // If we're overlapping by more than a duration, drop this sample\n if (delta <= -inputSampleDuration) {\n logger.warn(`Dropping 1 audio frame @ ${(nextPts/inputTimeScale).toFixed(3)}s due to ${duration} ms overlap.`);\n inputSamples.splice(i, 1);\n track.len -= sample.unit.length;\n // Don't touch nextPtsNorm or i\n }\n\n // Insert missing frames if:\n // 1: We're more than one frame away\n // 2: Not more than MAX_SILENT_FRAME_DURATION away\n // 3: currentTime (aka nextPtsNorm) is not 0\n else if (delta >= inputSampleDuration && duration < MAX_SILENT_FRAME_DURATION && nextPts) {\n var missing = Math.round(delta / inputSampleDuration);\n logger.warn(`Injecting ${missing} audio frame @ ${(nextPts/inputTimeScale).toFixed(3)}s due to ${Math.round(1000*delta/inputTimeScale)} ms gap.`);\n for (var j = 0; j < missing; j++) {\n let newStamp = Math.max(nextPts,0);\n fillFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n if (!fillFrame) {\n logger.log('Unable to get silent frame for given audio codec; duplicating last frame instead.');\n fillFrame = sample.unit.subarray();\n }\n inputSamples.splice(i, 0, {unit: fillFrame, pts: newStamp, dts: newStamp});\n track.len += fillFrame.length;\n nextPts += inputSampleDuration;\n i++;\n }\n\n // Adjust sample to next expected pts\n sample.pts = sample.dts = nextPts;\n nextPts += inputSampleDuration;\n i++;\n } else {\n // Otherwise, just adjust pts\n if (Math.abs(delta) > (0.1 * inputSampleDuration)) {\n //logger.log(`Invalid frame delta ${Math.round(delta + inputSampleDuration)} at PTS ${Math.round(pts / 90)} (should be ${Math.round(inputSampleDuration)}).`);\n }\n sample.pts = sample.dts = nextPts;\n nextPts += inputSampleDuration;\n i++;\n }\n }\n }\n\n\n for (let j =0 , nbSamples = inputSamples.length; j < nbSamples ; j++) {\n let audioSample = inputSamples[j];\n let unit = audioSample.unit;\n let pts = audioSample.pts;\n //logger.log(`Audio/PTS:${Math.round(pts/90)}`);\n // if not first sample\n if (lastPTS !== undefined) {\n mp4Sample.duration = Math.round((pts - lastPTS) / scaleFactor);\n } else {\n let delta = Math.round(1000 * (pts - nextAudioPts) / inputTimeScale),\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 && track.isAAC) {\n // log delta\n if (delta) {\n if (delta > 0 && delta < MAX_SILENT_FRAME_DURATION) {\n numMissingFrames = Math.round((pts - nextAudioPts) / inputSampleDuration);\n logger.log(`${delta} ms hole between AAC samples detected,filling it`);\n if (numMissingFrames > 0) {\n fillFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n if (!fillFrame) {\n fillFrame = unit.subarray();\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.log(`drop overlapping AAC sample, expected/parsed/delta:${(nextAudioPts/inputTimeScale).toFixed(3)}s/${(pts/inputTimeScale).toFixed(3)}s/${(-delta)}ms`);\n track.len -= unit.byteLength;\n continue;\n }\n // set PTS/DTS to expected PTS/DTS\n pts = nextAudioPts;\n }\n }\n // remember first PTS of our audioSamples, ensure value is positive\n firstPTS = Math.max(0, pts);\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 let mdatSize = rawMPEG ? track.len : track.len + 8;\n offset = rawMPEG ? 0 : 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch(err) {\n this.observer.trigger(Event.ERROR, {type : ErrorTypes.MUX_ERROR, details: ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes : mdatSize, reason: `fail allocating audio mdat ${mdatSize}`});\n return;\n }\n if (!rawMPEG) {\n const view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(MP4.types.mdat, 4);\n }\n } else {\n // no audio samples\n return;\n }\n for (let i = 0; i < numMissingFrames; i++) {\n fillFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n if (!fillFrame) {\n logger.log('Unable to get silent frame for given audio codec; duplicating this frame instead.');\n fillFrame = unit.subarray();\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 outputSamples.push(mp4Sample);\n }\n }\n mdat.set(unit, offset);\n let unitLen = unit.byteLength;\n offset += unitLen;\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${audioSample.pts}/${audioSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(audioSample.pts/4294967296).toFixed(3)}');\n mp4Sample = {\n size: unitLen,\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 outputSamples.push(mp4Sample);\n lastPTS = pts;\n }\n var lastSampleDuration = 0;\n var nbSamples = outputSamples.length;\n //set last sample duration as being identical to previous sample\n if (nbSamples >= 2) {\n lastSampleDuration = outputSamples[nbSamples - 2].duration;\n mp4Sample.duration = lastSampleDuration;\n }\n if (nbSamples) {\n // next audio sample PTS should be equal to last sample PTS + duration\n this.nextAudioPts = nextAudioPts = lastPTS + scaleFactor * lastSampleDuration;\n //logger.log('Audio/PTS/PTSend:' + audioSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));\n track.len = 0;\n track.samples = outputSamples;\n if (rawMPEG) {\n moof = new Uint8Array();\n } else {\n moof = MP4.moof(track.sequenceNumber++, firstPTS / scaleFactor, track);\n }\n track.samples = [];\n const start = firstPTS / inputTimeScale;\n const end = nextAudioPts / inputTimeScale;\n const audioData = {\n data1: moof,\n data2: mdat,\n startPTS: start,\n endPTS: end,\n startDTS: start,\n endDTS: end,\n type: 'audio',\n nb: nbSamples\n };\n this.observer.trigger(Event.FRAG_PARSING_DATA, audioData);\n return audioData;\n }\n return null;\n }\n\n remuxEmptyAudio(track, timeOffset, contiguous, videoData) {\n let inputTimeScale = track.inputTimeScale,\n mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale,\n scaleFactor = inputTimeScale/mp4timeScale,\n nextAudioPts = this.nextAudioPts,\n\n // sync with video's timestamp\n startDTS = (nextAudioPts !== undefined ? nextAudioPts : videoData.startDTS * inputTimeScale) + this._initDTS,\n endDTS = videoData.endDTS * inputTimeScale + this._initDTS,\n // one sample's duration value\n sampleDuration = 1024,\n frameDuration = scaleFactor * sampleDuration,\n\n // samples count of this segment's duration\n nbSamples = Math.ceil((endDTS - startDTS) / frameDuration),\n\n // silent frame\n silentFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n\n logger.warn('remux empty Audio');\n // Can't remux if we can't generate a silent frame...\n if (!silentFrame) {\n logger.trace('Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!');\n return;\n }\n\n let samples = [];\n for(var i = 0; i < nbSamples; i++) {\n var stamp = startDTS + i * frameDuration;\n samples.push({unit: silentFrame, pts: stamp, dts: stamp});\n track.len += silentFrame.length;\n }\n track.samples = samples;\n\n this.remuxAudio(track, timeOffset, contiguous);\n }\n\n remuxID3(track,timeOffset) {\n var length = track.samples.length, sample;\n const inputTimeScale = track.inputTimeScale;\n const initPTS = this._initPTS;\n const initDTS = this._initDTS;\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 - initPTS) / inputTimeScale);\n sample.dts = ((sample.dts - initDTS) / inputTimeScale);\n }\n this.observer.trigger(Event.FRAG_PARSING_METADATA, {\n samples:track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n\n remuxText(track,timeOffset) {\n track.samples.sort(function(a, b) {\n return (a.pts-b.pts);\n });\n\n var length = track.samples.length, sample;\n const inputTimeScale = track.inputTimeScale;\n const initPTS = this._initPTS;\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 - initPTS) / inputTimeScale);\n }\n this.observer.trigger(Event.FRAG_PARSING_USERDATA, {\n samples:track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n\n _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}\n\nexport default MP4Remuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/remux/mp4-remuxer.js","/**\n * passthrough remuxer\n*/\nimport Event from '../events';\n\nclass PassThroughRemuxer {\n constructor(observer) {\n this.observer = observer;\n }\n\n destroy() {\n }\n\n resetTimeStamp() {\n }\n\n resetInitSegment() {\n }\n\n remux(audioTrack,videoTrack,id3Track,textTrack,timeOffset, contiguous,accurateTimeOffset,rawData) {\n var observer = this.observer;\n var streamType = '';\n if (audioTrack) {\n streamType += 'audio';\n }\n if (videoTrack) {\n streamType += 'video';\n }\n observer.trigger(Event.FRAG_PARSING_DATA, {\n data1: rawData,\n startPTS: timeOffset,\n startDTS: timeOffset,\n type: streamType,\n nb: 1,\n dropped : 0\n });\n //notify end of parsing\n observer.trigger(Event.FRAG_PARSED);\n }\n}\n\nexport default PassThroughRemuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/remux/passthrough-remuxer.js","const DECIMAL_RESOLUTION_REGEX = /^(\\d+)x(\\d+)$/;\nconst ATTR_LIST_REGEX = /\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g;\n\n// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js\nclass AttrList {\n\n constructor(attrs) {\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 decimalInteger(attrName) {\n const intValue = parseInt(this[attrName], 10);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n\n hexadecimalInteger(attrName) {\n if(this[attrName]) {\n let stringValue = (this[attrName] || '0x').slice(2);\n stringValue = ((stringValue.length & 1) ? '0' : '') + stringValue;\n\n const value = new Uint8Array(stringValue.length / 2);\n for (let 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 hexadecimalIntegerAsNumber(attrName) {\n const intValue = parseInt(this[attrName], 16);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n\n decimalFloatingPoint(attrName) {\n return parseFloat(this[attrName]);\n }\n\n enumeratedString(attrName) {\n return this[attrName];\n }\n\n decimalResolution(attrName) {\n const res = DECIMAL_RESOLUTION_REGEX.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 static parseAttrList(input) {\n var match, attrs = {};\n ATTR_LIST_REGEX.lastIndex = 0;\n while ((match = ATTR_LIST_REGEX.exec(input)) !== null) {\n var value = match[2], quote = '\"';\n\n if (value.indexOf(quote) === 0 &&\n 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\nexport default AttrList;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/attr-list.js","var 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(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 }\n else if (comparisonResult < 0) {\n maxIndex = currentIndex - 1;\n }\n else {\n return currentElement;\n }\n }\n \n return null;\n }\n};\n\nmodule.exports = BinarySearch;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/binary-search.js","/**\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(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 = 100;\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(newTime) {\n this.time = newTime;\n },\n log : function(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(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\nclass PenState {\n\n constructor(foreground, underline, italics, background, flash) {\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 reset() {\n this.foreground = 'white';\n this.underline = false;\n this.italics = false;\n this.background = 'black';\n this.flash = false;\n }\n\n 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 isDefault() {\n return (this.foreground === 'white' && !this.underline && !this.italics &&\n this.background === 'black' && !this.flash);\n }\n\n equals(other) {\n return ( (this.foreground === other.foreground) &&\n (this.underline === other.underline) &&\n (this.italics === other.italics) &&\n (this.background === other.background) &&\n (this.flash === other.flash) );\n }\n\n 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 toString() {\n return ('color=' + this.foreground + ', underline=' + this.underline + ', italics=' + this.italics +\n ', background=' + this.background + ', flash=' + this.flash);\n }\n}\n\n/**\n * Unicode character with styling and background.\n * @constructor\n */\nclass StyledUnicodeChar\n{\n\n constructor(uchar, foreground, underline, italics, background, flash) {\n this.uchar = uchar || ' '; // unicode character\n this.penState = new PenState(foreground, underline,italics, background, flash);\n }\n\n reset() {\n this.uchar = ' ';\n this.penState.reset();\n }\n\n setChar(uchar, newPenState) {\n this.uchar = uchar;\n this.penState.copy(newPenState);\n }\n\n setPenState(newPenState) {\n this.penState.copy(newPenState);\n }\n\n equals(other) {\n return this.uchar === other.uchar && this.penState.equals(other.penState);\n }\n\n copy(newChar) {\n this.uchar = newChar.uchar;\n this.penState.copy(newChar.penState);\n }\n\n isEmpty() {\n return this.uchar === ' ' && this.penState.isDefault();\n }\n}\n\n/**\n * CEA-608 row consisting of NR_COLS instances of StyledUnicodeChar.\n * @constructor\n */\nclass Row {\n constructor() {\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 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 copy(other) {\n for (var i = 0 ; i < NR_COLS; i ++) {\n this.chars[i].copy(other.chars[i]);\n }\n }\n\n 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 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 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 backSpace() {\n this.moveCursor(-1);\n this.chars[this.pos].setChar(' ', this.currPenState);\n }\n\n insertChar(byte) {\n if (byte >= 0x90) { //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) +\n ' (' + 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 clearFromPos(startPos) {\n var i;\n for (i = startPos ; i < NR_COLS ; i++) {\n this.chars[i].reset();\n }\n }\n\n clear() {\n this.clearFromPos(0);\n this.pos = 0;\n this.currPenState.reset();\n }\n\n clearToEndOfRow() {\n this.clearFromPos(this.pos);\n }\n\n 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 setPenStyles(styles) {\n this.currPenState.setStyles(styles);\n var currChar = this.chars[this.pos];\n currChar.setPenState(this.currPenState);\n }\n}\n\n/**\n * Keep a CEA-608 screen of 32x15 styled characters\n * @constructor\n*/\nclass CaptionScreen {\n\n constructor() {\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 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 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 copy(other) {\n for (var i = 0 ; i < NR_ROWS ; i++) {\n this.rows[i].copy(other.rows[i]);\n }\n }\n\n 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 backSpace() {\n var row = this.rows[this.currRow];\n row.backSpace();\n }\n\n 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 insertChar(char) {\n var row = this.rows[this.currRow];\n row.insertChar(char);\n }\n\n setPen(styles) {\n var row = this.rows[this.currRow];\n row.setPenStyles(styles);\n }\n\n moveCursor(relPos) {\n var row = this.rows[this.currRow];\n row.moveCursor(relPos);\n }\n\n setCursor(absPos) {\n logger.log('INFO', 'setCursor: ' + absPos);\n var row = this.rows[this.currRow];\n row.setCursor(absPos);\n }\n\n 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\n //Make sure this only affects Roll-up Captions by checking this.nrRollUpRows\n if (this.nrRollUpRows && this.currRow !== newRow) {\n //clear all rows first\n for (let i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n\n //Copy this.nrRollUpRows rows from lastOutputScreen and place it in the newRow location\n //topRowIndex - the start of rows to copy (inclusive index)\n var topRowIndex = this.currRow + 1 - (this.nrRollUpRows);\n //We only copy if the last position was already shown.\n //We use the cueStartTime value to check this.\n const lastOutputScreen = this.lastOutputScreen;\n if (lastOutputScreen) {\n var prevLineTime = lastOutputScreen.rows[topRowIndex].cueStartTime;\n if(prevLineTime && prevLineTime < logger.time) {\n for (let i = 0; i < this.nrRollUpRows; i++) {\n this.rows[newRow-this.nrRollUpRows+i+1].copy(lastOutputScreen.rows[topRowIndex+i]);\n }\n }\n }\n }\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 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 setRollUpRows(nrRows) {\n this.nrRollUpRows = nrRows;\n }\n\n 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 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 getTextAndFormat() {\n return this.rows;\n }\n}\n\n//var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];\n\nclass Cea608Channel\n{\n constructor(channelNumber, outputFilter) {\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 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 getHandler() {\n return this.outputFilter;\n }\n\n setHandler(newHandler) {\n this.outputFilter = newHandler;\n }\n\n setPAC(pacData) {\n this.writeScreen.setPAC(pacData);\n }\n\n setBkgData(bkgData) {\n this.writeScreen.setBkgData(bkgData);\n }\n\n 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 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 ccRCL() { // 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 ccBS() { // 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 ccAOF() { // Reserved (formerly Alarm Off)\n return;\n }\n\n ccAON() { // Reserved (formerly Alarm On)\n return;\n }\n\n ccDER() { // 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 ccRU(nrRows) { //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 ccFON() { //Flash On\n logger.log('INFO', 'FON - Flash On');\n this.writeScreen.setPen({flash : true});\n }\n\n ccRDC() { // Resume Direct Captioning (switch mode to PaintOn)\n logger.log('INFO', 'RDC - Resume Direct Captioning');\n this.setMode('MODE_PAINT-ON');\n }\n\n ccTR() { // Text Restart in text mode (not supported, however)\n logger.log('INFO', 'TR');\n this.setMode('MODE_TEXT');\n }\n\n ccRTD() { // Resume Text Display in Text mode (not supported, however)\n logger.log('INFO', 'RTD');\n this.setMode('MODE_TEXT');\n }\n\n ccEDM() { // Erase Displayed Memory\n logger.log('INFO', 'EDM - Erase Displayed Memory');\n this.displayedMemory.reset();\n this.outputDataUpdate();\n }\n\n ccCR() { // Carriage Return\n logger.log('CR - Carriage Return');\n this.writeScreen.rollUp();\n this.outputDataUpdate();\n }\n\n ccENM() { //Erase Non-Displayed Memory\n logger.log('INFO', 'ENM - Erase Non-displayed Memory');\n this.nonDisplayedMemory.reset();\n }\n\n ccEOC() { //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 ccTO(nrCols) { // Tab Offset 1,2, or 3 columns\n logger.log('INFO', 'TO(' + nrCols + ') - Tab Offset');\n this.writeScreen.moveCursor(nrCols);\n }\n\n ccMIDROW(secondByte) { // 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 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()) { // 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 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\nclass Cea608Parser {\n\n constructor(field, out1, out2) {\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 getHandler(index) {\n return this.channels[index].getHandler();\n }\n\n 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 addData(t, byteList) {\n var cmdFound, a, 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]) +\n ' 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 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 { //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 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 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 { // 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 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 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 parseBackgroundAttributes(a, b) {\n var bkgData,\n index,\n chNr,\n 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 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 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\nexport default Cea608Parser;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/cea-608-parser.js","import { fixLineBreaks } from './vttparser';\n\nconst Cues = {\n\n newCue: function(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 {\n row = captionScreen.rows[r];\n indenting = true;\n indent = 0;\n text = '';\n\n if (!row.isEmpty())\n {\n for (var c=0; c<row.chars.length; c++)\n {\n if (row.chars[c].uchar.match(/\\s/) && indenting)\n {\n indent++;\n }\n else\n {\n text += row.chars[c].uchar;\n indenting = false;\n }\n }\n //To be used for cleaning-up orphaned roll-up captions\n row.cueStartTime = startTime;\n\n // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE\n if (startTime === endTime)\n {\n endTime += 0.0001;\n }\n\n cue = new VTTCue(startTime, endTime, fixLineBreaks(text.trim()));\n\n if (indent >= 16)\n {\n indent--;\n }\n else\n {\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 {\n cue.line = r + 1;\n }\n else\n {\n cue.line = (r > 7 ? r - 2 : r + 1);\n }\n cue.align = 'left';\n // Clamp the position between 0 and 100 - if out of these bounds, Firefox throws an exception and captions break\n cue.position = Math.max(0, Math.min(100, 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\\//) ? 50 : 0)));\n track.addCue(cue);\n }\n }\n }\n\n};\n\nmodule.exports = Cues;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/cues.js","import BinarySearch from './binary-search';\n\nexport function findFragWithCC(fragments, CC) {\n return BinarySearch.search(fragments, (candidate) => {\n if (candidate.cc < CC) {\n return 1;\n } else if (candidate.cc > CC) {\n return -1;\n } else {\n return 0;\n }\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// src/utils/discontinuities.js","/*\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\nimport EWMA from '../utils/ewma';\n\n\nclass EwmaBandWidthEstimator {\n\n constructor(hls,slow,fast,defaultEstimate) {\n this.hls = hls;\n this.defaultEstimate_ = defaultEstimate;\n this.minWeight_ = 0.001;\n this.minDelayMs_ = 50;\n this.slow_ = new EWMA(slow);\n this.fast_ = new EWMA(fast);\n }\n\n sample(durationMs,numBytes) {\n durationMs = Math.max(durationMs, this.minDelayMs_);\n var bandwidth = 8000* numBytes / durationMs,\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 canEstimate() {\n let fast = this.fast_;\n return (fast && fast.getTotalWeight() >= this.minWeight_);\n }\n\n\n 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 destroy() {\n }\n}\nexport default EwmaBandWidthEstimator;\n\n\n\n\n// WEBPACK FOOTER //\n// src/utils/ewma-bandwidth-estimator.js","/*\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\nclass EWMA {\n\n // About half of the estimated value will be from the last |halfLife| samples by weight.\n constructor(halfLife) {\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 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 getTotalWeight() {\n return this.totalWeight_;\n }\n\n 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\nexport default EWMA;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/ewma.js","function noop() {}\n\nconst fakeLogger = {\n trace: noop,\n debug: noop,\n log: noop,\n warn: noop,\n info: noop,\n error: noop\n};\n\nlet 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 const func = self.console[type];\n if (func) {\n return function(...args) {\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, ...functions) {\n functions.forEach(function(type) {\n exportedLogger[type] = debugConfig[type] ? debugConfig[type].bind(debugConfig) : consolePrintFn(type);\n });\n}\n\nexport var enableLogs = function(debugConfig) {\n if (debugConfig === true || typeof debugConfig === 'object') {\n exportLoggerFunctions(debugConfig,\n // Remove out from list here to hard-disable a log-level\n //'trace',\n 'debug',\n 'log',\n 'info',\n 'warn',\n 'error'\n );\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 }\n else {\n exportedLogger = fakeLogger;\n }\n};\n\nexport var logger = exportedLogger;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/logger.js","/**\n * TimeRanges to string helper\n */\n\nconst TimeRanges = {\n toString : function(r) {\n var log = '', 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\nmodule.exports = TimeRanges;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/timeRanges.js","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport default (function() {\n if (typeof window !== 'undefined' && window.VTTCue) {\n return window.VTTCue;\n }\n\n var autoKeyword = 'auto';\n var directionSetting = {\n '': true,\n lr: true,\n rl: true\n };\n var alignSetting = {\n start: true,\n middle: true,\n end: true,\n left: true,\n right: true\n };\n\n function findDirectionSetting(value) {\n if (typeof value !== 'string') {\n return false;\n }\n var dir = directionSetting[value.toLowerCase()];\n return dir ? value.toLowerCase() : false;\n }\n\n function findAlignSetting(value) {\n if (typeof value !== 'string') {\n return false;\n }\n var align = alignSetting[value.toLowerCase()];\n return align ? value.toLowerCase() : false;\n }\n\n function extend(obj) {\n var i = 1;\n for (; i < arguments.length; i++) {\n var cobj = arguments[i];\n for (var p in cobj) {\n obj[p] = cobj[p];\n }\n }\n\n return obj;\n }\n\n function VTTCue(startTime, endTime, text) {\n var cue = this;\n var isIE8 = (function () {\n if (typeof navigator === 'undefined') {\n return;\n }\n return (/MSIE\\s8\\.0/).test(navigator.userAgent);\n })();\n var baseObj = {};\n\n if (isIE8) {\n cue = document.createElement('custom');\n } else {\n baseObj.enumerable = true;\n }\n\n /**\n * Shim implementation specific properties. These properties are not in\n * the spec.\n */\n\n // Lets us know when the VTTCue's data has changed in such a way that we need\n // to recompute its display state. This lets us compute its display state\n // lazily.\n cue.hasBeenReset = false;\n\n /**\n * VTTCue and TextTrackCue properties\n * http://dev.w3.org/html5/webvtt/#vttcue-interface\n */\n\n var _id = '';\n var _pauseOnExit = false;\n var _startTime = startTime;\n var _endTime = endTime;\n var _text = text;\n var _region = null;\n var _vertical = '';\n var _snapToLines = true;\n var _line = 'auto';\n var _lineAlign = 'start';\n var _position = 50;\n var _positionAlign = 'middle';\n var _size = 50;\n var _align = 'middle';\n\n Object.defineProperty(cue, 'id', extend({}, baseObj, {\n get: function () {\n return _id;\n },\n set: function (value) {\n _id = '' + value;\n }\n }));\n\n Object.defineProperty(cue, 'pauseOnExit', extend({}, baseObj, {\n get: function () {\n return _pauseOnExit;\n },\n set: function (value) {\n _pauseOnExit = !!value;\n }\n }));\n\n Object.defineProperty(cue, 'startTime', extend({}, baseObj, {\n get: function () {\n return _startTime;\n },\n set: function (value) {\n if (typeof value !== 'number') {\n throw new TypeError('Start time must be set to a number.');\n }\n _startTime = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'endTime', extend({}, baseObj, {\n get: function () {\n return _endTime;\n },\n set: function (value) {\n if (typeof value !== 'number') {\n throw new TypeError('End time must be set to a number.');\n }\n _endTime = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'text', extend({}, baseObj, {\n get: function () {\n return _text;\n },\n set: function (value) {\n _text = '' + value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'region', extend({}, baseObj, {\n get: function () {\n return _region;\n },\n set: function (value) {\n _region = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'vertical', extend({}, baseObj, {\n get: function () {\n return _vertical;\n },\n set: function (value) {\n var setting = findDirectionSetting(value);\n // Have to check for false because the setting an be an empty string.\n if (setting === false) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _vertical = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'snapToLines', extend({}, baseObj, {\n get: function () {\n return _snapToLines;\n },\n set: function (value) {\n _snapToLines = !!value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'line', extend({}, baseObj, {\n get: function () {\n return _line;\n },\n set: function (value) {\n if (typeof value !== 'number' && value !== autoKeyword) {\n throw new SyntaxError('An invalid number or illegal string was specified.');\n }\n _line = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'lineAlign', extend({}, baseObj, {\n get: function () {\n return _lineAlign;\n },\n set: function (value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _lineAlign = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'position', extend({}, baseObj, {\n get: function () {\n return _position;\n },\n set: function (value) {\n if (value < 0 || value > 100) {\n throw new Error('Position must be between 0 and 100.');\n }\n _position = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'positionAlign', extend({}, baseObj, {\n get: function () {\n return _positionAlign;\n },\n set: function (value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _positionAlign = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'size', extend({}, baseObj, {\n get: function () {\n return _size;\n },\n set: function (value) {\n if (value < 0 || value > 100) {\n throw new Error('Size must be between 0 and 100.');\n }\n _size = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'align', extend({}, baseObj, {\n get: function () {\n return _align;\n },\n set: function (value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _align = setting;\n this.hasBeenReset = true;\n }\n }));\n\n /**\n * Other <track> spec defined properties\n */\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state\n cue.displayState = undefined;\n\n if (isIE8) {\n return cue;\n }\n }\n\n /**\n * VTTCue methods\n */\n\n VTTCue.prototype.getCueAsHTML = function () {\n // Assume WebVTT.convertCueToDOMTree is on the global.\n var WebVTT = window.WebVTT;\n return WebVTT.convertCueToDOMTree(window, this.text);\n };\n\n return VTTCue;\n})();\n\n\n\n// WEBPACK FOOTER //\n// src/utils/vttcue.js","/*\n * Source: https://github.com/mozilla/vtt.js/blob/master/dist/vtt.js#L1716\n */\n\nimport VTTCue from './vttcue';\n\nconst StringDecoder = function StringDecoder() {\n return {\n decode: function(data) {\n if (!data) {\n return '';\n }\n if (typeof data !== 'string') {\n throw new Error('Error - expected string data.');\n }\n return decodeURIComponent(encodeURIComponent(data));\n },\n };\n };\n\nfunction VTTParser() {\n this.window = window;\n this.state = 'INITIAL';\n this.buffer = '';\n this.decoder = new StringDecoder();\n this.regionList = [];\n}\n\n\n// Try to parse input as a time stamp.\nfunction parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(':', ''), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}\n\n// A settings object holds key/value pairs and will ignore anything but the first\n// assignment to a specific key.\nfunction Settings() {\n this.values = Object.create(null);\n}\n\nSettings.prototype = {\n // Only accept the first assignment to any key.\n set: function(k, v) {\n if (!this.get(k) && v !== '') {\n this.values[k] = v;\n }\n },\n // Return the value for a key, or a default value.\n // If 'defaultKey' is passed then 'dflt' is assumed to be an object with\n // a number of possible default values as properties where 'defaultKey' is\n // the key of the property that will be chosen; otherwise it's assumed to be\n // a single value.\n get: function(k, dflt, defaultKey) {\n if (defaultKey) {\n return this.has(k) ? this.values[k] : dflt[defaultKey];\n }\n return this.has(k) ? this.values[k] : dflt;\n },\n // Check whether we have a value for a key.\n has: function(k) {\n return k in this.values;\n },\n // Accept a setting if its one of the given alternatives.\n alt: function(k, v, a) {\n for (var n = 0; n < a.length; ++n) {\n if (v === a[n]) {\n this.set(k, v);\n break;\n }\n }\n },\n // Accept a setting if its a valid (signed) integer.\n integer: function(k, v) {\n if (/^-?\\d+$/.test(v)) { // integer\n this.set(k, parseInt(v, 10));\n }\n },\n // Accept a setting if its a valid percentage.\n percent: function(k, v) {\n var m;\n if ((m = v.match(/^([\\d]{1,3})(\\.[\\d]*)?%$/))) {\n v = parseFloat(v);\n if (v >= 0 && v <= 100) {\n this.set(k, v);\n return true;\n }\n }\n return false;\n }\n};\n\n// Helper function to parse input into groups separated by 'groupDelim', and\n// interprete each group as a key/value pair separated by 'keyValueDelim'.\nfunction parseOptions(input, callback, keyValueDelim, groupDelim) {\n var groups = groupDelim ? input.split(groupDelim) : [input];\n for (var i in groups) {\n if (typeof groups[i] !== 'string') {\n continue;\n }\n var kv = groups[i].split(keyValueDelim);\n if (kv.length !== 2) {\n continue;\n }\n var k = kv[0];\n var v = kv[1];\n callback(k, v);\n }\n}\n\nvar defaults = new VTTCue(0, 0, 0);\n// 'middle' was changed to 'center' in the spec: https://github.com/w3c/webvtt/pull/244\n// Chrome and Safari don't yet support this change, but FF does\nvar center = defaults.align === 'middle' ? 'middle' : 'center';\n\nfunction parseCue(input, cue, regionList) {\n // Remember the original input if we need to throw an error.\n var oInput = input;\n // 4.1 WebVTT timestamp\n function consumeTimeStamp() {\n var ts = parseTimeStamp(input);\n if (ts === null) {\n throw new Error('Malformed timestamp: ' + oInput);\n }\n // Remove time stamp from input.\n input = input.replace(/^[^\\sa-zA-Z-]+/, '');\n return ts;\n }\n\n // 4.4.2 WebVTT cue settings\n function consumeCueSettings(input, cue) {\n var settings = new Settings();\n\n parseOptions(input, function(k, v) {\n switch (k) {\n case 'region':\n // Find the last region we parsed with the same region id.\n for (var i = regionList.length - 1; i >= 0; i--) {\n if (regionList[i].id === v) {\n settings.set(k, regionList[i].region);\n break;\n }\n }\n break;\n case 'vertical':\n settings.alt(k, v, ['rl', 'lr']);\n break;\n case 'line':\n var vals = v.split(','),\n vals0 = vals[0];\n settings.integer(k, vals0);\n if (settings.percent(k, vals0)) {\n settings.set('snapToLines', false);\n }\n settings.alt(k, vals0, ['auto']);\n if (vals.length === 2) {\n settings.alt('lineAlign', vals[1], ['start', center, 'end']);\n }\n break;\n case 'position':\n vals = v.split(',');\n settings.percent(k, vals[0]);\n if (vals.length === 2) {\n settings.alt('positionAlign', vals[1], ['start', center, 'end', 'line-left', 'line-right', 'auto']);\n }\n break;\n case 'size':\n settings.percent(k, v);\n break;\n case 'align':\n settings.alt(k, v, ['start', center, 'end', 'left', 'right']);\n break;\n }\n }, /:/, /\\s/);\n\n // Apply default values for any missing fields.\n cue.region = settings.get('region', null);\n cue.vertical = settings.get('vertical', '');\n var line = settings.get('line', 'auto');\n if (line === 'auto' && defaults.line === -1) {\n // set numeric line number for Safari\n line = -1;\n }\n cue.line = line;\n cue.lineAlign = settings.get('lineAlign', 'start');\n cue.snapToLines = settings.get('snapToLines', true);\n cue.size = settings.get('size', 100);\n cue.align = settings.get('align', center);\n var position = settings.get('position', 'auto');\n if (position === 'auto' && defaults.position === 50) {\n // set numeric position for Safari\n position = cue.align === 'start' || cue.align === 'left' ? 0 : cue.align === 'end' || cue.align === 'right' ? 100 : 50;\n }\n cue.position = position;\n }\n\n function skipWhitespace() {\n input = input.replace(/^\\s+/, '');\n }\n\n // 4.1 WebVTT cue timings.\n skipWhitespace();\n cue.startTime = consumeTimeStamp(); // (1) collect cue start time\n skipWhitespace();\n if (input.substr(0, 3) !== '-->') { // (3) next characters must match '-->'\n throw new Error('Malformed time stamp (time stamps must be separated by \\'-->\\'): ' +\n oInput);\n }\n input = input.substr(3);\n skipWhitespace();\n cue.endTime = consumeTimeStamp(); // (5) collect cue end time\n\n // 4.1 WebVTT cue settings list.\n skipWhitespace();\n consumeCueSettings(input, cue);\n}\n\nfunction fixLineBreaks(input) {\n return input.replace(/<br(?: \\/)?>/gi, '\\n');\n}\n\nVTTParser.prototype = {\n parse: function(data) {\n var self = this;\n\n // If there is no data then we won't decode it, but will just try to parse\n // whatever is in buffer already. This may occur in circumstances, for\n // example when flush() is called.\n if (data) {\n // Try to decode the data that we received.\n self.buffer += self.decoder.decode(data, {stream: true});\n }\n\n function collectNextLine() {\n var buffer = self.buffer;\n var pos = 0;\n\n buffer = fixLineBreaks(buffer);\n\n while (pos < buffer.length && buffer[pos] !== '\\r' && buffer[pos] !== '\\n') {\n ++pos;\n }\n var line = buffer.substr(0, pos);\n // Advance the buffer early in case we fail below.\n if (buffer[pos] === '\\r') {\n ++pos;\n }\n if (buffer[pos] === '\\n') {\n ++pos;\n }\n self.buffer = buffer.substr(pos);\n return line;\n }\n\n // 3.2 WebVTT metadata header syntax\n function parseHeader(input) {\n parseOptions(input, function(k, v) {\n switch (k) {\n case 'Region':\n // 3.3 WebVTT region metadata header syntax\n console.log('parse region', v);\n //parseRegion(v);\n break;\n }\n }, /:/);\n }\n\n // 5.1 WebVTT file parsing.\n try {\n var line;\n if (self.state === 'INITIAL') {\n // We can't start parsing until we have the first line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n line = collectNextLine();\n\n var m = line.match(/^WEBVTT([ \\t].*)?$/);\n if (!m || !m[0]) {\n throw new Error('Malformed WebVTT signature.');\n }\n\n self.state = 'HEADER';\n }\n\n var alreadyCollectedLine = false;\n while (self.buffer) {\n // We can't parse a line until we have the full line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n if (!alreadyCollectedLine) {\n line = collectNextLine();\n } else {\n alreadyCollectedLine = false;\n }\n\n switch (self.state) {\n case 'HEADER':\n // 13-18 - Allow a header (metadata) under the WEBVTT line.\n if (/:/.test(line)) {\n parseHeader(line);\n } else if (!line) {\n // An empty line terminates the header and starts the body (cues).\n self.state = 'ID';\n }\n continue;\n case 'NOTE':\n // Ignore NOTE blocks.\n if (!line) {\n self.state = 'ID';\n }\n continue;\n case 'ID':\n // Check for the start of NOTE blocks.\n if (/^NOTE($|[ \\t])/.test(line)) {\n self.state = 'NOTE';\n break;\n }\n // 19-29 - Allow any number of line terminators, then initialize new cue values.\n if (!line) {\n continue;\n }\n self.cue = new VTTCue(0, 0, '');\n self.state = 'CUE';\n // 30-39 - Check if self line contains an optional identifier or timing data.\n if (line.indexOf('-->') === -1) {\n self.cue.id = line;\n continue;\n }\n // Process line as start of a cue.\n /*falls through*/\n case 'CUE':\n // 40 - Collect cue timings and settings.\n try {\n parseCue(line, self.cue, self.regionList);\n } catch (e) {\n // In case of an error ignore rest of the cue.\n self.cue = null;\n self.state = 'BADCUE';\n continue;\n }\n self.state = 'CUETEXT';\n continue;\n case 'CUETEXT':\n var hasSubstring = line.indexOf('-->') !== -1;\n // 34 - If we have an empty line then report the cue.\n // 35 - If we have the special substring '-->' then report the cue,\n // but do not collect the line as we need to process the current\n // one as a new cue.\n if (!line || hasSubstring && (alreadyCollectedLine = true)) {\n // We are done parsing self cue.\n if (self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n self.state = 'ID';\n continue;\n }\n if (self.cue.text) {\n self.cue.text += '\\n';\n }\n self.cue.text += line;\n continue;\n case 'BADCUE': // BADCUE\n // 54-62 - Collect and discard the remaining cue.\n if (!line) {\n self.state = 'ID';\n }\n continue;\n }\n }\n } catch (e) {\n\n // If we are currently parsing a cue, report what we have.\n if (self.state === 'CUETEXT' && self.cue && self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n // Enter BADWEBVTT state if header was not parsed correctly otherwise\n // another exception occurred so enter BADCUE state.\n self.state = self.state === 'INITIAL' ? 'BADWEBVTT' : 'BADCUE';\n }\n return this;\n },\n flush: function() {\n var self = this;\n try {\n // Finish decoding the stream.\n self.buffer += self.decoder.decode();\n // Synthesize the end of the current cue or region.\n if (self.cue || self.state === 'HEADER') {\n self.buffer += '\\n\\n';\n self.parse();\n }\n // If we've flushed, parsed, and we're still on the INITIAL state then\n // that means we don't have enough of the stream to parse the first\n // line.\n if (self.state === 'INITIAL') {\n throw new Error('Malformed WebVTT signature.');\n }\n } catch (e) {\n throw e;\n }\n if (self.onflush) {\n self.onflush();\n }\n return this;\n }\n};\n\nexport { fixLineBreaks };\n\nexport default VTTParser;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/vttparser.js","import VTTParser from './vttparser';\n\n// String.prototype.startsWith is not supported in IE11\nconst startsWith = function(inputString, searchString, position) {\n return inputString.substr(position || 0, searchString.length) === searchString;\n};\n\nconst cueString2millis = function(timeString) {\n let ts = parseInt(timeString.substr(-3));\n let secs = parseInt(timeString.substr(-6,2));\n let mins = parseInt(timeString.substr(-9,2));\n let hours = timeString.length > 9 ? parseInt(timeString.substr(0, timeString.indexOf(':'))) : 0;\n\n if (isNaN(ts) || isNaN(secs) || isNaN(mins) || isNaN(hours)) {\n return -1;\n }\n\n ts += 1000 * secs;\n ts += 60*1000 * mins;\n ts += 60*60*1000 * hours;\n\n return ts;\n};\n\n// From https://github.com/darkskyapp/string-hash\nconst hash = function(text) {\n let hash = 5381;\n let i = text.length;\n while (i) {\n hash = (hash * 33) ^ text.charCodeAt(--i);\n }\n return (hash >>> 0).toString();\n};\n\nconst calculateOffset = function(vttCCs, cc, presentationTime) {\n let currCC = vttCCs[cc];\n let prevCC = vttCCs[currCC.prevCC];\n\n // This is the first discontinuity or cues have been processed since the last discontinuity\n // Offset = current discontinuity time\n if (!prevCC || (!prevCC.new && currCC.new)) {\n vttCCs.ccOffset = vttCCs.presentationOffset = currCC.start;\n currCC.new = false;\n return;\n }\n\n // There have been discontinuities since cues were last parsed.\n // Offset = time elapsed\n while (prevCC && prevCC.new) {\n vttCCs.ccOffset += currCC.start - prevCC.start;\n currCC.new = false;\n currCC = prevCC;\n prevCC = vttCCs[currCC.prevCC];\n }\n\n vttCCs.presentationOffset = presentationTime;\n};\n\nconst WebVTTParser = {\n parse: function(vttByteArray, syncPTS, vttCCs, cc, callBack, errorCallBack) {\n // Convert byteArray into string, replacing any somewhat exotic linefeeds with \"\\n\", then split on that character.\n let re = /\\r\\n|\\n\\r|\\n|\\r/g;\n let vttLines = String.fromCharCode.apply(null, new Uint8Array(vttByteArray)).trim().replace(re, '\\n').split('\\n');\n let cueTime = '00:00.000';\n let mpegTs = 0;\n let localTime = 0;\n let presentationTime = 0;\n let cues = [];\n let parsingError;\n let inHeader = true;\n // let VTTCue = VTTCue || window.TextTrackCue;\n\n // Create parser object using VTTCue with TextTrackCue fallback on certain browsers.\n let parser = new VTTParser();\n\n parser.oncue = function(cue) {\n // Adjust cue timing; clamp cues to start no earlier than - and drop cues that don't end after - 0 on timeline.\n let currCC = vttCCs[cc];\n let cueOffset = vttCCs.ccOffset;\n\n // Update offsets for new discontinuities\n if (currCC && currCC.new) {\n if (localTime !== undefined) {\n // When local time is provided, offset = discontinuity start time - local time\n cueOffset = vttCCs.ccOffset = currCC.start;\n } else {\n calculateOffset(vttCCs, cc, presentationTime);\n }\n }\n\n if (presentationTime) {\n // If we have MPEGTS, offset = presentation time + discontinuity offset\n cueOffset = presentationTime + vttCCs.ccOffset - vttCCs.presentationOffset;\n }\n\n cue.startTime += cueOffset - localTime;\n cue.endTime += cueOffset - localTime;\n\n // Create a unique hash id for a cue based on start/end times and text.\n // This helps timeline-controller to avoid showing repeated captions.\n cue.id = hash(cue.startTime) + hash(cue.endTime) + hash(cue.text);\n\n // Fix encoding of special characters. TODO: Test with all sorts of weird characters.\n cue.text = decodeURIComponent(escape(cue.text));\n if (cue.endTime > 0) {\n cues.push(cue);\n }\n };\n\n parser.onparsingerror = function(e) {\n parsingError = e;\n };\n\n parser.onflush = function() {\n if (parsingError && errorCallBack) {\n errorCallBack(parsingError);\n return;\n }\n callBack(cues);\n };\n\n // Go through contents line by line.\n vttLines.forEach(line => {\n if (inHeader) {\n // Look for X-TIMESTAMP-MAP in header.\n if (startsWith(line, 'X-TIMESTAMP-MAP=')) {\n // Once found, no more are allowed anyway, so stop searching.\n inHeader = false;\n // Extract LOCAL and MPEGTS.\n line.substr(16).split(',').forEach(timestamp => {\n if (startsWith(timestamp, 'LOCAL:')) {\n cueTime = timestamp.substr(6);\n } else if (startsWith(timestamp, 'MPEGTS:')) {\n mpegTs = parseInt(timestamp.substr(7));\n }\n });\n try {\n // Calculate subtitle offset in milliseconds.\n // If sync PTS is less than zero, we have a 33-bit wraparound, which is fixed by adding 2^33 = 8589934592.\n syncPTS = syncPTS < 0 ? syncPTS + 8589934592 : syncPTS;\n // Adjust MPEGTS by sync PTS.\n mpegTs -= syncPTS;\n // Convert cue time to seconds\n localTime = cueString2millis(cueTime) / 1000;\n // Convert MPEGTS to seconds from 90kHz.\n presentationTime = mpegTs / 90000;\n\n if (localTime === -1) {\n parsingError = new Error(`Malformed X-TIMESTAMP-MAP: ${line}`);\n }\n }\n catch(e) {\n parsingError = new Error(`Malformed X-TIMESTAMP-MAP: ${line}`);\n }\n // Return without parsing X-TIMESTAMP-MAP line.\n return;\n } else if (line === '') {\n inHeader = false;\n }\n }\n // Parse line by default.\n parser.parse(line+'\\n');\n });\n\n parser.flush();\n }\n};\n\n\nmodule.exports = WebVTTParser;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/webvtt-parser.js","/**\n * XHR based logger\n*/\n\nimport {logger} from '../utils/logger';\n\nclass XhrLoader {\n\n constructor(config) {\n if (config && config.xhrSetup) {\n this.xhrSetup = config.xhrSetup;\n }\n }\n\n destroy() {\n this.abort();\n this.loader = null;\n }\n\n 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 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 loadInternal() {\n var xhr, 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 let stats = this.stats;\n stats.tfirst = 0;\n stats.loaded = 0;\n const xhrSetup = this.xhrSetup;\n\n try {\n if (xhrSetup) {\n try {\n xhrSetup(xhr, context.url);\n } catch (e) {\n // fix xhrSetup: (xhr, url) => {xhr.setRequestHeader(\"Content-Language\", \"test\");}\n // not working, as xhr.setRequestHeader expects xhr.readyState === OPEN\n xhr.open('GET', context.url, true);\n xhrSetup(xhr, context.url);\n }\n }\n if (!xhr.readyState) {\n xhr.open('GET', context.url, true);\n }\n } catch (e) {\n // IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS\n this.callbacks.onError({ code : xhr.status, text: e.message }, context, xhr);\n return;\n }\n\n if (context.rangeEnd) {\n xhr.setRequestHeader('Range','bytes=' + context.rangeStart + '-' + (context.rangeEnd-1));\n }\n xhr.onreadystatechange = this.readystatechange.bind(this);\n xhr.onprogress = this.loadprogress.bind(this);\n xhr.responseType = context.responseType;\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 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 // >= HEADERS_RECEIVED\n if (readyState >=2) {\n // clear xhr timeout and rearm it if readyState less than 4\n window.clearTimeout(this.requestTimeout);\n if (stats.tfirst === 0) {\n stats.tfirst = Math.max(performance.now(), stats.trequest);\n }\n if (readyState === 4) {\n let 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 let data,len;\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 let response = { url : xhr.responseURL, data : data };\n this.callbacks.onSuccess(response, stats, context, xhr);\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.error(`${status} while loading ${context.url}` );\n this.callbacks.onError({ code : status, text : xhr.statusText}, context, xhr);\n } else {\n // retry\n 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 } else {\n // readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout);\n }\n }\n }\n\n loadtimeout() {\n logger.warn(`timeout while loading ${this.context.url}` );\n this.callbacks.onTimeout(this.stats, this.context, null);\n }\n\n loadprogress(event) {\n var xhr = event.currentTarget,\n stats = this.stats;\n\n stats.loaded = event.loaded;\n if (event.lengthComputable) {\n stats.total = event.total;\n }\n let onProgress = this.callbacks.onProgress;\n if (onProgress) {\n // third arg is to provide on progress data\n onProgress(stats, this.context, null, xhr);\n }\n }\n}\n\nexport default XhrLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/xhr-loader.js","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"shaka-player\"), require(\"playkit-js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"shaka-player\", \"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsDash\"] = factory(require(\"shaka-player\"), require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsDash\"] = factory(root[\"shaka\"], root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///dash/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 249eeb77a61a9c7bb545\n\n\n// WEBPACK FOOTER //\n// webpack:/dash/webpack/bootstrap 249eeb77a61a9c7bb545","// @flow\nimport shaka from 'shaka-player';\nimport {registerMediaSourceAdapter, BaseMediaSourceAdapter} from 'playkit-js'\nimport {Track, VideoTrack, AudioTrack, TextTrack} from 'playkit-js'\n\n/**\n * Adapter of shaka lib for dash content\n * @classdesc\n */\nexport default class DashAdapter extends BaseMediaSourceAdapter {\n /**\n * The id of Adapter\n * @member {string} id\n * @static\n * @public\n */\n static id = 'DashAdapter';\n /**\n * The adapter logger\n * @member {any} _logger\n * @private\n * @static\n */\n static _logger = BaseMediaSourceAdapter.getLogger(DashAdapter.id);\n /**\n * The supported mime type by the dash adapter\n * @member {string} _dashMimeType\n * @static\n * @private\n */\n static _dashMimeType = 'application/dash+xml';\n /**\n * The shaka player instance\n * @member {any} _shaka\n * @private\n */\n _shaka: any;\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n _loadPromise: ?Promise<Object>;\n\n /**\n * Checks if dash adapter can play a given mime type\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @returns {boolean} - Whether the dash adapter can play a specific mime type\n * @static\n */\n static canPlayType(mimeType: string): boolean {\n let canPlayType = typeof mimeType === 'string' ? mimeType.toLowerCase() === DashAdapter._dashMimeType : false;\n DashAdapter._logger.debug('canPlayType result for mimeType: ' + mimeType + ' is ' + canPlayType.toString());\n return canPlayType;\n }\n\n /**\n * Checks if the dash adapter is supported\n * @function isSupported\n * @returns {boolean} - Whether dash is supported.\n * @static\n */\n static isSupported(): boolean {\n shaka.polyfill.installAll();\n let isSupported = shaka.Player.isBrowserSupported();\n DashAdapter._logger.debug('isSupported:' + isSupported);\n return isSupported;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to the dash adapter\n * @param {Object} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n constructor(videoElement: HTMLVideoElement, source: Object, config: Object = {}) {\n DashAdapter._logger.debug('Creating adapter. Shaka version: ' + shaka.Player.version);\n super(videoElement, source, config);\n this._shaka = new shaka.Player(videoElement);\n this._shaka.configure(config);\n this._addBindings();\n }\n\n /**\n * Add the required bindings to shaka.\n * @function _addBindings\n * @private\n * @returns {void}\n */\n _addBindings(): void {\n this._shaka.addEventListener('adaptation', this._onAdaptation.bind(this));\n this._shaka.addEventListener('error', this._onError.bind(this));\n }\n\n /**\n * Remove the bindings to shaka.\n * @function _removeBindings\n * @private\n * @returns {void}\n */\n _removeBindings(): void {\n this._shaka.removeEventListener('adaptation', this._onAdaptation);\n this._shaka.removeEventListener('error', this._onError);\n }\n\n /**\n * Load the video source\n * @function load\n * @override\n */\n load(): Promise<Object> {\n if (!this._loadPromise) {\n this._loadPromise = new Promise((resolve, reject) => {\n if (this._sourceObj && this._sourceObj.url) {\n this._shaka.load(this._sourceObj.url).then(() => {\n let data = {tracks: this._getParsedTracks()};\n DashAdapter._logger.debug('The source has been loaded successfully');\n resolve(data);\n }).catch((error) => {\n reject(error);\n this._onError(error);\n });\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroying the dash adapter\n * @function destroy\n * @override\n */\n destroy(): void {\n DashAdapter._logger.debug('destroy');\n super.destroy();\n this._loadPromise = null;\n this._removeBindings();\n this._shaka.destroy();\n }\n\n /**\n * Get the original video tracks\n * @function _getVideoTracks\n * @returns {Array<Object>} - The original video tracks\n * @private\n */\n _getVideoTracks(): Array<Object> {\n let variantTracks = this._shaka.getVariantTracks();\n let activeVariantTrack = variantTracks.filter((variantTrack) => {\n return variantTrack.active;\n })[0];\n let videoTracks = variantTracks.filter((variantTrack) => {\n return variantTrack.audioId === activeVariantTrack.audioId;\n });\n return videoTracks;\n }\n\n /**\n * Get the original audio tracks\n * @function _getAudioTracks\n * @returns {Array<Object>} - The original audio tracks\n * @private\n */\n _getAudioTracks(): Array<Object> {\n let variantTracks = this._shaka.getVariantTracks();\n let activeVariantTrack = variantTracks.filter((variantTrack) => {\n return variantTrack.active;\n })[0];\n let audioTracks = variantTracks.filter((variantTrack) => {\n return variantTrack.videoId === activeVariantTrack.videoId;\n });\n return audioTracks;\n }\n\n /**\n * Get the parsed tracks\n * @function _getParsedTracks\n * @returns {Array<Track>} - The parsed tracks\n * @private\n */\n _getParsedTracks(): Array<Track> {\n let videoTracks = this._getParsedVideoTracks();\n let audioTracks = this._getParsedAudioTracks();\n let textTracks = this._getParsedTextTracks();\n return videoTracks.concat(audioTracks).concat(textTracks);\n }\n\n /**\n * Get the parsed video tracks\n * @function _getParsedVideoTracks\n * @returns {Array<VideoTrack>} - The parsed video tracks\n * @private\n */\n _getParsedVideoTracks(): Array<VideoTrack> {\n let videoTracks = this._getVideoTracks();\n let parsedTracks = [];\n if (videoTracks) {\n for (let i = 0; i < videoTracks.length; i++) {\n let settings = {\n id: videoTracks[i].id,\n bandwidth: videoTracks[i].bandwidth,\n active: videoTracks[i].active,\n label: videoTracks[i].label,\n index: i\n };\n parsedTracks.push(new VideoTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed audio tracks\n * @function _getParsedAudioTracks\n * @returns {Array<AudioTrack>} - The parsed audio tracks\n * @private\n */\n _getParsedAudioTracks(): Array<AudioTrack> {\n let audioTracks = this._getAudioTracks();\n let parsedTracks = [];\n if (audioTracks) {\n for (let i = 0; i < audioTracks.length; i++) {\n let settings = {\n id: audioTracks[i].id,\n active: audioTracks[i].active,\n label: audioTracks[i].label,\n language: audioTracks[i].language,\n index: i\n };\n parsedTracks.push(new AudioTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed text tracks\n * @function _getParsedTextTracks\n * @returns {Array<TextTrack>} - The parsed text tracks\n * @private\n */\n _getParsedTextTracks(): Array<TextTrack> {\n let textTracks = this._shaka.getTextTracks();\n let parsedTracks = [];\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n let settings = {\n kind: textTracks[i].kind ? textTracks[i].kind + 's' : \"\",\n active: textTracks[i].active,\n label: textTracks[i].label,\n language: textTracks[i].language,\n index: i\n };\n parsedTracks.push(new TextTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Select a video track\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the video track to select\n * @returns {void}\n * @public\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n let videoTracks = this._getVideoTracks();\n if ((videoTrack instanceof VideoTrack) && videoTracks) {\n let selectedVideoTrack = videoTracks[videoTrack.index];\n if (selectedVideoTrack) {\n this._shaka.configure({abr: {enabled: false}});\n if (!selectedVideoTrack.active) {\n this._shaka.selectVariantTrack(videoTracks[videoTrack.index], true);\n this._onTrackChanged(videoTrack);\n }\n }\n }\n }\n\n /**\n * Select an audio track\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select\n * @returns {void}\n * @public\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n if ((audioTrack instanceof AudioTrack) && !audioTrack.active) {\n this._shaka.selectAudioLanguage(audioTrack.language);\n this._onTrackChanged(audioTrack);\n }\n }\n\n /**\n * Select a text track\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select\n * @returns {void}\n * @public\n */\n selectTextTrack(textTrack: TextTrack): void {\n if ((textTrack instanceof TextTrack) && !textTrack.active && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions')) {\n this._shaka.selectTextLanguage(textTrack.language);\n this._shaka.setTextTrackVisibility(true);\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n hideTextTrack(): void {\n this._shaka.setTextTrackVisibility(false);\n }\n\n /**\n * Enables adaptive bitrate switching\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n this._shaka.configure({abr: {enabled: true}});\n }\n\n /**\n * An handler to shaka adaptation event\n * @function _onAdaptation\n * @returns {void}\n * @private\n */\n _onAdaptation(): void {\n let selectedVideoTrack = this._getParsedVideoTracks().filter(function (videoTrack) {\n return videoTrack.active;\n })[0];\n this._onTrackChanged(selectedVideoTrack);\n }\n\n /**\n * An handler to shaka error event\n * @function _onError\n * @param {any} error - the error\n * @returns {void}\n * @private\n */\n _onError(error: any): void {\n DashAdapter._logger.error(error);\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * In case the adapter preformed a load it will return the manifest url.\n * @public\n * @returns {string} - The src url.\n */\n get src(): string {\n if (this._loadPromise && this._sourceObj) {\n return this._sourceObj.url;\n }\n return \"\";\n }\n}\n\n// Register DashAdapter to the media source adapter manager\nif (DashAdapter.isSupported()) {\n registerMediaSourceAdapter(DashAdapter);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./dash-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///dash/dash-adapter.js","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"shaka-player\",\"commonjs2\":\"shaka-player\",\"amd\":\"shaka-player\",\"root\":\"shaka\"}\n// module id = 1\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/dash/external {\"commonjs\":\"shaka-player\",\"commonjs2\":\"shaka-player\",\"amd\":\"shaka-player\",\"root\":\"shaka\"}","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}\n// module id = 2\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/dash/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","// Copyright 2006 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Bootstrap for the Google JS Library (Closure).\n *\n * In uncompiled mode base.js will write out Closure's deps file, unless the\n * global <code>CLOSURE_NO_DEPS</code> is set to true. This allows projects to\n * include their own deps file(s) from different locations.\n *\n *\n * @provideGoog\n */\n\n\n/**\n * @define {boolean} Overridden to true by the compiler when --closure_pass\n * or --mark_as_compiled is specified.\n */\nvar COMPILED = false;\n\n\n/**\n * Base namespace for the Closure library. Checks to see goog is already\n * defined in the current scope before assigning to prevent clobbering if\n * base.js is loaded more than once.\n *\n * @const\n */\nvar goog = goog || {};\n\n\n/**\n * Reference to the global context. In most cases this will be 'window'.\n */\ngoog.global = this;\n\n\n/**\n * A hook for overriding the define values in uncompiled mode.\n *\n * In uncompiled mode, {@code CLOSURE_UNCOMPILED_DEFINES} may be defined before\n * loading base.js. If a key is defined in {@code CLOSURE_UNCOMPILED_DEFINES},\n * {@code goog.define} will use the value instead of the default value. This\n * allows flags to be overwritten without compilation (this is normally\n * accomplished with the compiler's \"define\" flag).\n *\n * Example:\n * <pre>\n * var CLOSURE_UNCOMPILED_DEFINES = {'goog.DEBUG': false};\n * </pre>\n *\n * @type {Object.<string, (string|number|boolean)>|undefined}\n */\ngoog.global.CLOSURE_UNCOMPILED_DEFINES;\n\n\n/**\n * A hook for overriding the define values in uncompiled or compiled mode,\n * like CLOSURE_UNCOMPILED_DEFINES but effective in compiled code. In\n * uncompiled code CLOSURE_UNCOMPILED_DEFINES takes precedence.\n *\n * Also unlike CLOSURE_UNCOMPILED_DEFINES the values must be number, boolean or\n * string literals or the compiler will emit an error.\n *\n * While any @define value may be set, only those set with goog.define will be\n * effective for uncompiled code.\n *\n * Example:\n * <pre>\n * var CLOSURE_DEFINES = {'goog.DEBUG': false};\n * </pre>\n *\n * @type {Object.<string, (string|number|boolean)>|undefined}\n */\ngoog.global.CLOSURE_DEFINES;\n\n\n/**\n * Returns true if the specified value is not undefined.\n * WARNING: Do not use this to test if an object has a property. Use the in\n * operator instead.\n *\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is defined.\n */\ngoog.isDef = function(val) {\n // void 0 always evaluates to undefined and hence we do not need to depend on\n // the definition of the global variable named 'undefined'.\n return val !== void 0;\n};\n\n\n/**\n * Builds an object structure for the provided namespace path, ensuring that\n * names that already exist are not overwritten. For example:\n * \"a.b.c\" -> a = {};a.b={};a.b.c={};\n * Used by goog.provide and goog.exportSymbol.\n * @param {string} name name of the object that this file defines.\n * @param {*=} opt_object the object to expose at the end of the path.\n * @param {Object=} opt_objectToExportTo The object to add the path to; default\n * is |goog.global|.\n * @private\n */\ngoog.exportPath_ = function(name, opt_object, opt_objectToExportTo) {\n var parts = name.split('.');\n var cur = opt_objectToExportTo || goog.global;\n\n // Internet Explorer exhibits strange behavior when throwing errors from\n // methods externed in this manner. See the testExportSymbolExceptions in\n // base_test.html for an example.\n if (!(parts[0] in cur) && cur.execScript) {\n cur.execScript('var ' + parts[0]);\n }\n\n // Certain browsers cannot parse code in the form for((a in b); c;);\n // This pattern is produced by the JSCompiler when it collapses the\n // statement above into the conditional loop below. To prevent this from\n // happening, use a for-loop and reserve the init logic as below.\n\n // Parentheses added to eliminate strict JS warning in Firefox.\n for (var part; parts.length && (part = parts.shift());) {\n if (!parts.length && goog.isDef(opt_object)) {\n // last part and we have an object; use it\n cur[part] = opt_object;\n } else if (cur[part]) {\n cur = cur[part];\n } else {\n cur = cur[part] = {};\n }\n }\n};\n\n\n/**\n * Defines a named value. In uncompiled mode, the value is retreived from\n * CLOSURE_DEFINES or CLOSURE_UNCOMPILED_DEFINES if the object is defined and\n * has the property specified, and otherwise used the defined defaultValue.\n * When compiled, the default can be overridden using compiler command-line\n * options.\n *\n * @param {string} name The distinguished name to provide.\n * @param {string|number|boolean} defaultValue\n */\ngoog.define = function(name, defaultValue) {\n var value = defaultValue;\n if (!COMPILED) {\n if (goog.global.CLOSURE_UNCOMPILED_DEFINES &&\n Object.prototype.hasOwnProperty.call(\n goog.global.CLOSURE_UNCOMPILED_DEFINES, name)) {\n value = goog.global.CLOSURE_UNCOMPILED_DEFINES[name];\n } else if (goog.global.CLOSURE_DEFINES &&\n Object.prototype.hasOwnProperty.call(\n goog.global.CLOSURE_DEFINES, name)) {\n value = goog.global.CLOSURE_DEFINES[name];\n }\n }\n goog.exportPath_(name, value);\n};\n\n\n/**\n * @define {boolean} DEBUG is provided as a convenience so that debugging code\n * that should not be included in a production js_binary can be easily stripped\n * by specifying --define goog.DEBUG=false to the JSCompiler. For example, most\n * toString() methods should be declared inside an \"if (goog.DEBUG)\" conditional\n * because they are generally used for debugging purposes and it is difficult\n * for the JSCompiler to statically determine whether they are used.\n */\ngoog.DEBUG = true;\n\n\n/**\n * @define {string} LOCALE defines the locale being used for compilation. It is\n * used to select locale specific data to be compiled in js binary. BUILD rule\n * can specify this value by \"--define goog.LOCALE=<locale_name>\" as JSCompiler\n * option.\n *\n * Take into account that the locale code format is important. You should use\n * the canonical Unicode format with hyphen as a delimiter. Language must be\n * lowercase, Language Script - Capitalized, Region - UPPERCASE.\n * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN.\n *\n * See more info about locale codes here:\n * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers\n *\n * For language codes you should use values defined by ISO 693-1. See it here\n * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from\n * this rule: the Hebrew language. For legacy reasons the old code (iw) should\n * be used instead of the new code (he), see http://wiki/Main/IIISynonyms.\n */\ngoog.define('goog.LOCALE', 'en'); // default to en\n\n\n/**\n * @define {boolean} Whether this code is running on trusted sites.\n *\n * On untrusted sites, several native functions can be defined or overridden by\n * external libraries like Prototype, Datejs, and JQuery and setting this flag\n * to false forces closure to use its own implementations when possible.\n *\n * If your JavaScript can be loaded by a third party site and you are wary about\n * relying on non-standard implementations, specify\n * \"--define goog.TRUSTED_SITE=false\" to the JSCompiler.\n */\ngoog.define('goog.TRUSTED_SITE', true);\n\n\n/**\n * @define {boolean} Whether a project is expected to be running in strict mode.\n *\n * This define can be used to trigger alternate implementations compatible with\n * running in EcmaScript Strict mode or warn about unavailable functionality.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode\n */\ngoog.define('goog.STRICT_MODE_COMPATIBLE', false);\n\n\n/**\n * Creates object stubs for a namespace. The presence of one or more\n * goog.provide() calls indicate that the file defines the given\n * objects/namespaces. Provided objects must not be null or undefined.\n * Build tools also scan for provide/require statements\n * to discern dependencies, build dependency files (see deps.js), etc.\n * @see goog.require\n * @param {string} name Namespace provided by this file in the form\n * \"goog.package.part\".\n */\ngoog.provide = function(name) {\n if (!COMPILED) {\n // Ensure that the same namespace isn't provided twice.\n // A goog.module/goog.provide maps a goog.require to a specific file\n if (goog.isProvided_(name)) {\n throw Error('Namespace \"' + name + '\" already declared.');\n }\n delete goog.implicitNamespaces_[name];\n\n var namespace = name;\n while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) {\n if (goog.getObjectByName(namespace)) {\n break;\n }\n goog.implicitNamespaces_[namespace] = true;\n }\n }\n\n goog.exportPath_(name);\n};\n\n\n/**\n * Forward declares a symbol. This is an indication to the compiler that the\n * symbol may be used in the source yet is not required and may not be provided\n * in compilation.\n *\n * The most common usage of forward declaration is code that takes a type as a\n * function parameter but does not need to require it. By forward declaring\n * instead of requiring, no hard dependency is made, and (if not required\n * elsewhere) the namespace may never be required and thus, not be pulled\n * into the JavaScript binary. If it is required elsewhere, it will be type\n * checked as normal.\n *\n *\n * @param {string} name The namespace to forward declare in the form of\n * \"goog.package.part\".\n */\ngoog.forwardDeclare = function(name) {};\n\n\nif (!COMPILED) {\n\n /**\n * Check if the given name has been goog.provided. This will return false for\n * names that are available only as implicit namespaces.\n * @param {string} name name of the object to look for.\n * @return {boolean} Whether the name has been provided.\n * @private\n */\n goog.isProvided_ = function(name) {\n return (!goog.implicitNamespaces_[name] &&\n goog.isDefAndNotNull(goog.getObjectByName(name)));\n };\n\n /**\n * Namespaces implicitly defined by goog.provide. For example,\n * goog.provide('goog.events.Event') implicitly declares that 'goog' and\n * 'goog.events' must be namespaces.\n *\n * @type {Object.<string, (boolean|undefined)>}\n * @private\n */\n goog.implicitNamespaces_ = {};\n}\n\n\n/**\n * Returns an object based on its fully qualified external name. The object\n * is not found if null or undefined. If you are using a compilation pass that\n * renames property names beware that using this function will not find renamed\n * properties.\n *\n * @param {string} name The fully qualified name.\n * @param {Object=} opt_obj The object within which to look; default is\n * |goog.global|.\n * @return {?} The value (object or primitive) or, if not found, null.\n */\ngoog.getObjectByName = function(name, opt_obj) {\n var parts = name.split('.');\n var cur = opt_obj || goog.global;\n for (var part; part = parts.shift(); ) {\n if (goog.isDefAndNotNull(cur[part])) {\n cur = cur[part];\n } else {\n return null;\n }\n }\n return cur;\n};\n\n\n/**\n * Globalizes a whole namespace, such as goog or goog.lang.\n *\n * @param {Object} obj The namespace to globalize.\n * @param {Object=} opt_global The object to add the properties to.\n * @deprecated Properties may be explicitly exported to the global scope, but\n * this should no longer be done in bulk.\n */\ngoog.globalize = function(obj, opt_global) {\n var global = opt_global || goog.global;\n for (var x in obj) {\n global[x] = obj[x];\n }\n};\n\n\n/**\n * Adds a dependency from a file to the files it requires.\n * @param {string} relPath The path to the js file.\n * @param {Array} provides An array of strings with the names of the objects\n * this file provides.\n * @param {Array} requires An array of strings with the names of the objects\n * this file requires.\n */\ngoog.addDependency = function(relPath, provides, requires) {\n if (goog.DEPENDENCIES_ENABLED) {\n var provide, require;\n var path = relPath.replace(/\\\\/g, '/');\n var deps = goog.dependencies_;\n for (var i = 0; provide = provides[i]; i++) {\n deps.nameToPath[provide] = path;\n }\n for (var j = 0; require = requires[j]; j++) {\n if (!(path in deps.requires)) {\n deps.requires[path] = {};\n }\n deps.requires[path][require] = true;\n }\n }\n};\n\n\n\n\n// NOTE(nnaze): The debug DOM loader was included in base.js as an original way\n// to do \"debug-mode\" development. The dependency system can sometimes be\n// confusing, as can the debug DOM loader's asynchronous nature.\n//\n// With the DOM loader, a call to goog.require() is not blocking -- the script\n// will not load until some point after the current script. If a namespace is\n// needed at runtime, it needs to be defined in a previous script, or loaded via\n// require() with its registered dependencies.\n// User-defined namespaces may need their own deps file. See http://go/js_deps,\n// http://go/genjsdeps, or, externally, DepsWriter.\n// https://developers.google.com/closure/library/docs/depswriter\n//\n// Because of legacy clients, the DOM loader can't be easily removed from\n// base.js. Work is being done to make it disableable or replaceable for\n// different environments (DOM-less JavaScript interpreters like Rhino or V8,\n// for example). See bootstrap/ for more information.\n\n\n/**\n * @define {boolean} Whether to enable the debug loader.\n *\n * If enabled, a call to goog.require() will attempt to load the namespace by\n * appending a script tag to the DOM (if the namespace has been registered).\n *\n * If disabled, goog.require() will simply assert that the namespace has been\n * provided (and depend on the fact that some outside tool correctly ordered\n * the script).\n */\ngoog.define('goog.ENABLE_DEBUG_LOADER', true);\n\n\n/**\n * @param {string} msg\n * @private\n */\ngoog.logToConsole_ = function(msg) {\n if (goog.global.console) {\n goog.global.console['error'](msg);\n }\n};\n\n\n/**\n * Implements a system for the dynamic resolution of dependencies that works in\n * parallel with the BUILD system. Note that all calls to goog.require will be\n * stripped by the JSCompiler when the --closure_pass option is used.\n * @see goog.provide\n * @param {string} name Namespace to include (as was given in goog.provide()) in\n * the form \"goog.package.part\".\n * @return {?} If called within a goog.module file, the associated namespace or\n * module otherwise null.\n */\ngoog.require = function(name) {\n\n // If the object already exists we do not need do do anything.\n if (!COMPILED) {\n if (goog.isProvided_(name)) {\n return null;\n }\n\n if (goog.ENABLE_DEBUG_LOADER) {\n var path = goog.getPathFromDeps_(name);\n if (path) {\n goog.included_[path] = true;\n goog.writeScripts_();\n return null;\n }\n }\n\n var errorMessage = 'goog.require could not find: ' + name;\n goog.logToConsole_(errorMessage);\n\n throw Error(errorMessage);\n }\n};\n\n\n/**\n * Path for included scripts.\n * @type {string}\n */\ngoog.basePath = '';\n\n\n/**\n * A hook for overriding the base path.\n * @type {string|undefined}\n */\ngoog.global.CLOSURE_BASE_PATH;\n\n\n/**\n * Whether to load Closure's deps file automatically.\n * Shaka sets this to true since we are placing deps.js in a non-standard\n * location. Running Shaka in uncompiled mode will require loading deps.js\n * explicitly.\n * @type {boolean|undefined}\n */\ngoog.global.CLOSURE_NO_DEPS = true;\n\n\n/**\n * A function to import a single script. This is meant to be overridden when\n * Closure is being run in non-HTML contexts, such as web workers. It's defined\n * in the global scope so that it can be set before base.js is loaded, which\n * allows deps.js to be imported properly.\n *\n * The function is passed the script source, which is a relative URI. It should\n * return true if the script was imported, false otherwise.\n * @type {(function(string): boolean)|undefined}\n */\ngoog.global.CLOSURE_IMPORT_SCRIPT;\n\n\n/**\n * True if goog.dependencies_ is available.\n * @const {boolean}\n */\ngoog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;\n\n\nif (goog.DEPENDENCIES_ENABLED) {\n /**\n * Object used to keep track of urls that have already been added. This record\n * allows the prevention of circular dependencies.\n * @type {Object}\n * @private\n */\n goog.included_ = {};\n\n\n /**\n * This object is used to keep track of dependencies and other data that is\n * used for loading scripts.\n * @private\n * @type {Object}\n */\n goog.dependencies_ = {\n nameToPath: {}, // many to 1\n requires: {}, // 1 to many\n // Used when resolving dependencies to prevent us from visiting file twice.\n visited: {},\n written: {} // Used to keep track of script files we have written.\n };\n\n\n /**\n * Tries to detect whether is in the context of an HTML document.\n * @return {boolean} True if it looks like HTML document.\n * @private\n */\n goog.inHtmlDocument_ = function() {\n var doc = goog.global.document;\n return typeof doc != 'undefined' &&\n 'write' in doc; // XULDocument misses write.\n };\n\n\n /**\n * Tries to detect the base path of base.js script that bootstraps Closure.\n * @private\n */\n goog.findBasePath_ = function() {\n if (goog.global.CLOSURE_BASE_PATH) {\n goog.basePath = goog.global.CLOSURE_BASE_PATH;\n return;\n } else if (!goog.inHtmlDocument_()) {\n return;\n }\n var doc = goog.global.document;\n var scripts = doc.getElementsByTagName('script');\n // Search backwards since the current script is in almost all cases the one\n // that has base.js.\n for (var i = scripts.length - 1; i >= 0; --i) {\n var src = scripts[i].src;\n var qmark = src.lastIndexOf('?');\n var l = qmark == -1 ? src.length : qmark;\n if (src.substr(l - 7, 7) == 'base.js') {\n goog.basePath = src.substr(0, l - 7);\n return;\n }\n }\n };\n\n\n /**\n * Imports a script if, and only if, that script hasn't already been imported.\n * (Must be called at execution time)\n * @param {string} src Script source.\n * @param {string=} opt_sourceText The optionally source text to evaluate\n * @private\n */\n goog.importScript_ = function(src, opt_sourceText) {\n var importScript = goog.global.CLOSURE_IMPORT_SCRIPT ||\n goog.writeScriptTag_;\n if (importScript(src, opt_sourceText)) {\n goog.dependencies_.written[src] = true;\n }\n };\n\n\n /**\n * The default implementation of the import function. Writes a script tag to\n * import the script.\n *\n * @param {string} src The script url.\n * @param {string=} opt_sourceText The optionally source text to evaluate\n * @return {boolean} True if the script was imported, false otherwise.\n * @private\n */\n goog.writeScriptTag_ = function(src, opt_sourceText) {\n if (goog.inHtmlDocument_()) {\n var doc = goog.global.document;\n\n // If the user tries to require a new symbol after document load,\n // something has gone terribly wrong. Doing a document.write would\n // wipe out the page.\n if (doc.readyState == 'complete') {\n // Certain test frameworks load base.js multiple times, which tries\n // to write deps.js each time. If that happens, just fail silently.\n // These frameworks wipe the page between each load of base.js, so this\n // is OK.\n var isDeps = /\\bdeps.js$/.test(src);\n if (isDeps) {\n return false;\n } else {\n throw Error('Cannot write \"' + src + '\" after document load');\n }\n }\n\n if (opt_sourceText === undefined) {\n doc.write(\n '<script type=\"text/javascript\" src=\"' +\n src + '\"></' + 'script>');\n } else {\n doc.write(\n '<script type=\"text/javascript\">' +\n opt_sourceText + '</' + 'script>');\n }\n return true;\n } else {\n return false;\n }\n };\n\n\n /**\n * Resolves dependencies based on the dependencies added using addDependency\n * and calls importScript_ in the correct order.\n * @private\n */\n goog.writeScripts_ = function() {\n // The scripts we need to write this time.\n var scripts = [];\n var seenScript = {};\n var deps = goog.dependencies_;\n\n function visitNode(path) {\n if (path in deps.written) {\n return;\n }\n\n // We have already visited this one. We can get here if we have cyclic\n // dependencies.\n if (path in deps.visited) {\n if (!(path in seenScript)) {\n seenScript[path] = true;\n scripts.push(path);\n }\n return;\n }\n\n deps.visited[path] = true;\n\n if (path in deps.requires) {\n for (var requireName in deps.requires[path]) {\n // If the required name is defined, we assume that it was already\n // bootstrapped by other means.\n if (!goog.isProvided_(requireName)) {\n if (requireName in deps.nameToPath) {\n visitNode(deps.nameToPath[requireName]);\n } else {\n throw Error('Undefined nameToPath for ' + requireName);\n }\n }\n }\n }\n\n if (!(path in seenScript)) {\n seenScript[path] = true;\n scripts.push(path);\n }\n }\n\n for (var path in goog.included_) {\n if (!deps.written[path]) {\n visitNode(path);\n }\n }\n\n // record that we are going to load all these scripts.\n for (var i = 0; i < scripts.length; i++) {\n var path = scripts[i];\n goog.dependencies_.written[path] = true;\n }\n\n for (var i = 0; i < scripts.length; i++) {\n var path = scripts[i];\n if (path) {\n goog.importScript_(goog.basePath + path);\n }\n }\n };\n\n\n /**\n * Looks at the dependency rules and tries to determine the script file that\n * fulfills a particular rule.\n * @param {string} rule In the form goog.namespace.Class or project.script.\n * @return {?string} Url corresponding to the rule, or null.\n * @private\n */\n goog.getPathFromDeps_ = function(rule) {\n if (rule in goog.dependencies_.nameToPath) {\n return goog.dependencies_.nameToPath[rule];\n } else {\n return null;\n }\n };\n\n goog.findBasePath_();\n\n // Allow projects to manage the deps files themselves.\n if (!goog.global.CLOSURE_NO_DEPS) {\n goog.importScript_(goog.basePath + 'deps.js');\n }\n}\n\n\n\n//==============================================================================\n// Language Enhancements\n//==============================================================================\n\n\n/**\n * Returns true if the specified value is defined and not null.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is defined and not null.\n */\ngoog.isDefAndNotNull = function(val) {\n // Note that undefined == null.\n return val != null;\n};\n\n\n/**\n * Returns true if the specified value is a string.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is a string.\n */\ngoog.isString = function(val) {\n return typeof val == 'string';\n};\n\n\n/**\n * Exposes an unobfuscated global namespace path for the given object.\n * Note that fields of the exported object *will* be obfuscated, unless they are\n * exported in turn via this function or goog.exportProperty.\n *\n * Also handy for making public items that are defined in anonymous closures.\n *\n * ex. goog.exportSymbol('public.path.Foo', Foo);\n *\n * ex. goog.exportSymbol('public.path.Foo.staticFunction', Foo.staticFunction);\n * public.path.Foo.staticFunction();\n *\n * ex. goog.exportSymbol('public.path.Foo.prototype.myMethod',\n * Foo.prototype.myMethod);\n * new public.path.Foo().myMethod();\n *\n * @param {string} publicPath Unobfuscated name to export.\n * @param {*} object Object the name should point to.\n * @param {Object=} opt_objectToExportTo The object to add the path to; default\n * is goog.global.\n */\ngoog.exportSymbol = function(publicPath, object, opt_objectToExportTo) {\n goog.exportPath_(publicPath, object, opt_objectToExportTo);\n};\n\n\n/**\n * Exports a property unobfuscated into the object's namespace.\n * ex. goog.exportProperty(Foo, 'staticFunction', Foo.staticFunction);\n * ex. goog.exportProperty(Foo.prototype, 'myMethod', Foo.prototype.myMethod);\n * @param {Object} object Object whose static property is being exported.\n * @param {string} publicName Unobfuscated name to export.\n * @param {*} symbol Object the name should point to.\n */\ngoog.exportProperty = function(object, publicName, symbol) {\n object[publicName] = symbol;\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * Usage:\n * <pre>\n * function ParentClass(a, b) { }\n * ParentClass.prototype.foo = function(a) { };\n *\n * function ChildClass(a, b, c) {\n * ChildClass.base(this, 'constructor', a, b);\n * }\n * goog.inherits(ChildClass, ParentClass);\n *\n * var child = new ChildClass('a', 'b', 'see');\n * child.foo(); // This works.\n * </pre>\n *\n * @param {Function} childCtor Child class.\n * @param {Function} parentCtor Parent class.\n */\ngoog.inherits = function(childCtor, parentCtor) {\n /** @constructor */\n function tempCtor() {}\n tempCtor.prototype = parentCtor.prototype;\n childCtor.superClass_ = parentCtor.prototype;\n childCtor.prototype = new tempCtor();\n /** @override */\n childCtor.prototype.constructor = childCtor;\n\n /**\n * Calls superclass constructor/method.\n *\n * This function is only available if you use goog.inherits to\n * express inheritance relationships between classes.\n *\n * NOTE: This is a replacement for goog.base and for superClass_\n * property defined in childCtor.\n *\n * @param {!Object} me Should always be \"this\".\n * @param {string} methodName The method name to call. Calling\n * superclass constructor can be done with the special string\n * 'constructor'.\n * @param {...*} var_args The arguments to pass to superclass\n * method/constructor.\n * @return {*} The return value of the superclass method/constructor.\n */\n childCtor.base = function(me, methodName, var_args) {\n var args = Array.prototype.slice.call(arguments, 2);\n return parentCtor.prototype[methodName].apply(me, args);\n };\n};\n\n\n/*\n * To support uncompiled, strict mode bundles that use eval to divide source\n * like so:\n * eval('someSource;//# sourceUrl sourcefile.js');\n * We need to export the globally defined symbols \"goog\" and \"COMPILED\".\n * Exporting \"goog\" breaks the compiler optimizations, so we required that\n * be defined externally.\n * NOTE: We don't use goog.exportSymbol here because we don't want to trigger\n * extern generation when that compiler option is enabled.\n */\nif (!COMPILED) {\n goog.global['COMPILED'] = COMPILED;\n}\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/third_party/closure/goog/base.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastProxy');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.cast.CastSender');\ngoog.require('shaka.cast.CastUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.IDestroyable');\n\n\n\n/**\n * A proxy to switch between local and remote playback for Chromecast in a way\n * that is transparent to the app's controls.\n *\n * @constructor\n * @struct\n * @param {!HTMLMediaElement} video The local video element associated with the\n * local Player instance.\n * @param {!shaka.Player} player A local Player instance.\n * @param {string} receiverAppId The ID of the cast receiver application.\n * @implements {shaka.util.IDestroyable}\n * @extends {shaka.util.FakeEventTarget}\n * @export\n */\nshaka.cast.CastProxy = function(video, player, receiverAppId) {\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {HTMLMediaElement} */\n this.localVideo_ = video;\n\n /** @private {shaka.Player} */\n this.localPlayer_ = player;\n\n /** @private {Object} */\n this.videoProxy_ = null;\n\n /** @private {Object} */\n this.playerProxy_ = null;\n\n /** @private {shaka.util.FakeEventTarget} */\n this.videoEventTarget_ = null;\n\n /** @private {shaka.util.FakeEventTarget} */\n this.playerEventTarget_ = null;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = null;\n\n /** @private {shaka.cast.CastSender} */\n this.sender_ = new shaka.cast.CastSender(\n receiverAppId,\n this.onCastStatusChanged_.bind(this),\n this.onRemoteEvent_.bind(this),\n this.onResumeLocal_.bind(this),\n this.getInitState_.bind(this));\n\n this.init_();\n};\ngoog.inherits(shaka.cast.CastProxy, shaka.util.FakeEventTarget);\n\n\n/**\n * Destroys the proxy and the underlying local Player.\n *\n * @param {boolean=} opt_forceDisconnect If true, force the receiver app to shut\n * down by disconnecting. Does nothing if not connected.\n * @override\n * @export\n */\nshaka.cast.CastProxy.prototype.destroy = function(opt_forceDisconnect) {\n if (opt_forceDisconnect && this.sender_) {\n this.sender_.forceDisconnect();\n }\n\n var async = [\n this.eventManager_ ? this.eventManager_.destroy() : null,\n this.localPlayer_ ? this.localPlayer_.destroy() : null,\n this.sender_ ? this.sender_.destroy() : null\n ];\n\n this.localVideo_ = null;\n this.localPlayer_ = null;\n this.videoProxy_ = null;\n this.playerProxy_ = null;\n this.eventManager_ = null;\n this.sender_ = null;\n\n return Promise.all(async);\n};\n\n\n/**\n * @event shaka.cast.CastProxy.CastStatusChangedEvent\n * @description Fired when cast status changes. The status change will be\n * reflected in canCast() and isCasting().\n * @property {string} type\n * 'caststatuschanged'\n * @exportDoc\n */\n\n\n/**\n * Get a proxy for the video element that delegates to local and remote video\n * elements as appropriate.\n *\n * @suppress {invalidCasts} to cast proxy Objects to unrelated types\n * @return {HTMLMediaElement}\n * @export\n */\nshaka.cast.CastProxy.prototype.getVideo = function() {\n return /** @type {HTMLMediaElement} */(this.videoProxy_);\n};\n\n\n/**\n * Get a proxy for the Player that delegates to local and remote Player objects\n * as appropriate.\n *\n * @suppress {invalidCasts} to cast proxy Objects to unrelated types\n * @return {shaka.Player}\n * @export\n */\nshaka.cast.CastProxy.prototype.getPlayer = function() {\n return /** @type {shaka.Player} */(this.playerProxy_);\n};\n\n\n/**\n * @return {boolean} True if the cast API is available and there are receivers.\n * @export\n */\nshaka.cast.CastProxy.prototype.canCast = function() {\n return this.sender_ ?\n this.sender_.apiReady() && this.sender_.hasReceivers() :\n false;\n};\n\n\n/**\n * @return {boolean} True if we are currently casting.\n * @export\n */\nshaka.cast.CastProxy.prototype.isCasting = function() {\n return this.sender_ ? this.sender_.isCasting() : false;\n};\n\n\n/**\n * @return {string} The name of the Cast receiver device, if isCasting().\n * @export\n */\nshaka.cast.CastProxy.prototype.receiverName = function() {\n return this.sender_ ? this.sender_.receiverName() : '';\n};\n\n\n/**\n * @return {!Promise} Resolved when connected to a receiver. Rejected if the\n * connection fails or is canceled by the user.\n * @export\n */\nshaka.cast.CastProxy.prototype.cast = function() {\n var initState = this.getInitState_();\n\n // TODO: transfer manually-selected tracks?\n // TODO: transfer side-loaded text tracks?\n\n return this.sender_.cast(initState).then(function() {\n // Unload the local manifest when casting succeeds.\n return this.localPlayer_.unload();\n }.bind(this));\n};\n\n\n/**\n * Set application-specific data.\n *\n * @param {Object} appData Application-specific data to relay to the receiver.\n * @export\n */\nshaka.cast.CastProxy.prototype.setAppData = function(appData) {\n this.sender_.setAppData(appData);\n};\n\n\n/**\n * Show a dialog where user can choose to disconnect from the cast connection.\n * @export\n */\nshaka.cast.CastProxy.prototype.suggestDisconnect = function() {\n this.sender_.showDisconnectDialog();\n};\n\n\n/**\n * Force the receiver app to shut down by disconnecting.\n * @export\n */\nshaka.cast.CastProxy.prototype.forceDisconnect = function() {\n this.sender_.forceDisconnect();\n};\n\n\n/**\n * Initialize the Proxies and the Cast sender.\n * @private\n */\nshaka.cast.CastProxy.prototype.init_ = function() {\n this.sender_.init();\n\n this.eventManager_ = new shaka.util.EventManager();\n\n shaka.cast.CastUtils.VideoEvents.forEach(function(name) {\n this.eventManager_.listen(this.localVideo_, name,\n this.videoProxyLocalEvent_.bind(this));\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerEvents.forEach(function(name) {\n this.eventManager_.listen(this.localPlayer_, name,\n this.playerProxyLocalEvent_.bind(this));\n }.bind(this));\n\n // We would like to use Proxy here, but it is not supported on IE11 or Safari.\n this.videoProxy_ = {};\n for (var k in this.localVideo_) {\n Object.defineProperty(this.videoProxy_, k, {\n configurable: false,\n enumerable: true,\n get: this.videoProxyGet_.bind(this, k),\n set: this.videoProxySet_.bind(this, k)\n });\n }\n\n this.playerProxy_ = {};\n for (var k in /** @type {Object} */(this.localPlayer_)) {\n Object.defineProperty(this.playerProxy_, k, {\n configurable: false,\n enumerable: true,\n get: this.playerProxyGet_.bind(this, k)\n });\n }\n\n this.videoEventTarget_ = new shaka.util.FakeEventTarget();\n this.videoEventTarget_.dispatchTarget =\n /** @type {EventTarget} */(this.videoProxy_);\n\n this.playerEventTarget_ = new shaka.util.FakeEventTarget();\n this.playerEventTarget_.dispatchTarget =\n /** @type {EventTarget} */(this.playerProxy_);\n};\n\n\n/**\n * @return {shaka.cast.CastUtils.InitStateType} initState Video and player state\n * to be sent to the receiver.\n * @private\n */\nshaka.cast.CastProxy.prototype.getInitState_ = function() {\n var initState = {\n 'video': {},\n 'player': {},\n 'playerAfterLoad': {},\n 'manifest': this.localPlayer_.getManifestUri(),\n 'startTime': null\n };\n\n // Pause local playback before capturing state.\n this.localVideo_.pause();\n\n shaka.cast.CastUtils.VideoInitStateAttributes.forEach(function(name) {\n initState['video'][name] = this.localVideo_[name];\n }.bind(this));\n\n // If the video is still playing, set the startTime.\n // Has no effect if nothing is loaded.\n if (!this.localVideo_.ended) {\n initState['startTime'] = this.localVideo_.currentTime;\n }\n\n shaka.cast.CastUtils.PlayerInitState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = /** @type {Object} */(this.localPlayer_)[getter]();\n\n initState['player'][setter] = value;\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerInitAfterLoadState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = /** @type {Object} */(this.localPlayer_)[getter]();\n\n initState['playerAfterLoad'][setter] = value;\n }.bind(this));\n\n return initState;\n};\n\n\n/**\n * Dispatch an event to notify the app that the status has changed.\n * @private\n */\nshaka.cast.CastProxy.prototype.onCastStatusChanged_ = function() {\n var event = new shaka.util.FakeEvent('caststatuschanged');\n this.dispatchEvent(event);\n};\n\n\n/**\n * Transfer remote state back and resume local playback.\n * @private\n */\nshaka.cast.CastProxy.prototype.onResumeLocal_ = function() {\n // Transfer back the player state.\n shaka.cast.CastUtils.PlayerInitState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = this.sender_.get('player', getter)();\n /** @type {Object} */(this.localPlayer_)[setter](value);\n }.bind(this));\n\n // Get the most recent manifest URI and ended state.\n var manifestUri = this.sender_.get('player', 'getManifestUri')();\n var ended = this.sender_.get('video', 'ended');\n\n var manifestReady = Promise.resolve();\n var autoplay = this.localVideo_.autoplay;\n\n var startTime = null;\n\n // If the video is still playing, set the startTime.\n // Has no effect if nothing is loaded.\n if (!ended) {\n startTime = this.sender_.get('video', 'currentTime');\n }\n\n // Now load the manifest, if present.\n if (manifestUri) {\n // Don't autoplay the content until we finish setting up initial state.\n this.localVideo_.autoplay = false;\n manifestReady = this.localPlayer_.load(manifestUri, startTime);\n // Pass any errors through to the app.\n manifestReady.catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong error type!');\n var event = new shaka.util.FakeEvent('error', { 'detail': error });\n this.localPlayer_.dispatchEvent(event);\n }.bind(this));\n }\n\n // Get the video state into a temp variable since we will apply it async.\n var videoState = {};\n shaka.cast.CastUtils.VideoInitStateAttributes.forEach(function(name) {\n videoState[name] = this.sender_.get('video', name);\n }.bind(this));\n\n // Finally, take on video state and player's \"after load\" state.\n manifestReady.then(function() {\n shaka.cast.CastUtils.VideoInitStateAttributes.forEach(function(name) {\n this.localVideo_[name] = videoState[name];\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerInitAfterLoadState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = this.sender_.get('player', getter)();\n /** @type {Object} */(this.localPlayer_)[setter](value);\n }.bind(this));\n\n // Restore original autoplay setting.\n this.localVideo_.autoplay = autoplay;\n if (manifestUri) {\n // Resume playback with transferred state.\n this.localVideo_.play();\n }\n }.bind(this));\n};\n\n\n/**\n * @param {string} name\n * @return {?}\n * @private\n */\nshaka.cast.CastProxy.prototype.videoProxyGet_ = function(name) {\n if (name == 'addEventListener') {\n return this.videoEventTarget_.addEventListener.bind(\n this.videoEventTarget_);\n }\n if (name == 'removeEventListener') {\n return this.videoEventTarget_.removeEventListener.bind(\n this.videoEventTarget_);\n }\n\n // If we are casting, but the first update has not come in yet, use local\n // values, but not local methods.\n if (this.sender_.isCasting() && !this.sender_.hasRemoteProperties()) {\n var value = this.localVideo_[name];\n if (typeof value != 'function') {\n return value;\n }\n }\n\n // Use local values and methods if we are not casting.\n if (!this.sender_.isCasting()) {\n var value = this.localVideo_[name];\n if (typeof value == 'function') {\n value = value.bind(this.localVideo_);\n }\n return value;\n }\n\n return this.sender_.get('video', name);\n};\n\n\n/**\n * @param {string} name\n * @param {?} value\n * @private\n */\nshaka.cast.CastProxy.prototype.videoProxySet_ = function(name, value) {\n if (!this.sender_.isCasting()) {\n this.localVideo_[name] = value;\n return;\n }\n\n this.sender_.set('video', name, value);\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.cast.CastProxy.prototype.videoProxyLocalEvent_ = function(event) {\n if (this.sender_.isCasting()) {\n // Ignore any unexpected local events while casting. Events can still be\n // fired by the local video and Player when we unload() after the Cast\n // connection is complete.\n return;\n }\n\n // Convert this real Event into a FakeEvent for dispatch from our\n // FakeEventListener.\n var fakeEvent = new shaka.util.FakeEvent(event.type, event);\n this.videoEventTarget_.dispatchEvent(fakeEvent);\n};\n\n\n/**\n * @param {string} name\n * @return {?}\n * @private\n */\nshaka.cast.CastProxy.prototype.playerProxyGet_ = function(name) {\n if (name == 'addEventListener') {\n return this.playerEventTarget_.addEventListener.bind(\n this.playerEventTarget_);\n }\n if (name == 'removeEventListener') {\n return this.playerEventTarget_.removeEventListener.bind(\n this.playerEventTarget_);\n }\n\n if (name == 'getNetworkingEngine') {\n // Always returns a local instance, in case you need to make a request.\n // Issues a warning, in case you think you are making a remote request\n // or affecting remote filters.\n if (this.sender_.isCasting()) {\n shaka.log.warning('NOTE: getNetworkingEngine() is always local!');\n }\n return this.localPlayer_.getNetworkingEngine.bind(this.localPlayer_);\n }\n\n // If we are casting, but the first update has not come in yet, use local\n // getters, but not local methods.\n if (this.sender_.isCasting() && !this.sender_.hasRemoteProperties()) {\n if (shaka.cast.CastUtils.PlayerGetterMethods.indexOf(name) >= 0) {\n var value = /** @type {Object} */(this.localPlayer_)[name];\n goog.asserts.assert(typeof value == 'function', 'only methods on Player');\n return value.bind(this.localPlayer_);\n }\n }\n\n // Use local getters and methods if we are not casting.\n if (!this.sender_.isCasting()) {\n var value = /** @type {Object} */(this.localPlayer_)[name];\n goog.asserts.assert(typeof value == 'function', 'only methods on Player');\n return value.bind(this.localPlayer_);\n }\n\n return this.sender_.get('player', name);\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.cast.CastProxy.prototype.playerProxyLocalEvent_ = function(event) {\n if (this.sender_.isCasting()) {\n // Ignore any unexpected local events while casting.\n return;\n }\n\n this.playerEventTarget_.dispatchEvent(event);\n};\n\n\n/**\n * @param {string} targetName\n * @param {!shaka.util.FakeEvent} event\n * @private\n */\nshaka.cast.CastProxy.prototype.onRemoteEvent_ = function(targetName, event) {\n goog.asserts.assert(this.sender_.isCasting(),\n 'Should only receive remote events while casting');\n if (!this.sender_.isCasting()) {\n // Ignore any unexpected remote events.\n return;\n }\n\n if (targetName == 'video') {\n this.videoEventTarget_.dispatchEvent(event);\n } else if (targetName == 'player') {\n this.playerEventTarget_.dispatchEvent(event);\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_proxy.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.abr.Ewma');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Computes an exponentionally-weighted moving average.\n *\n * @param {number} halfLife About half of the estimated value will be from the\n * last |halfLife| samples by weight.\n * @struct\n * @constructor\n */\nshaka.abr.Ewma = function(halfLife) {\n goog.asserts.assert(halfLife > 0, 'expected halfLife to be positive');\n\n /**\n * Larger values of alpha expire historical data more slowly.\n * @private {number}\n */\n this.alpha_ = Math.exp(Math.log(0.5) / halfLife);\n\n /** @private {number} */\n this.estimate_ = 0;\n\n /** @private {number} */\n this.totalWeight_ = 0;\n};\n\n\n/**\n * Takes a sample.\n *\n * @param {number} weight\n * @param {number} value\n */\nshaka.abr.Ewma.prototype.sample = function(weight, value) {\n var adjAlpha = Math.pow(this.alpha_, weight);\n var newEstimate = value * (1 - adjAlpha) + adjAlpha * this.estimate_;\n\n if (!isNaN(newEstimate)) {\n this.estimate_ = newEstimate;\n this.totalWeight_ += weight;\n }\n};\n\n\n/**\n * @return {number}\n */\nshaka.abr.Ewma.prototype.getEstimate = function() {\n var zeroFactor = 1 - Math.pow(this.alpha_, this.totalWeight_);\n return this.estimate_ / zeroFactor;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/abr/ewma.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.abr.EwmaBandwidthEstimator');\n\ngoog.require('shaka.abr.Ewma');\n\n\n\n/**\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 * @constructor\n * @struct\n */\nshaka.abr.EwmaBandwidthEstimator = function() {\n /**\n * A fast-moving average.\n * Half of the estimate is based on the last 2 seconds of sample history.\n * @private {!shaka.abr.Ewma}\n */\n this.fast_ = new shaka.abr.Ewma(2);\n\n /**\n * A slow-moving average.\n * Half of the estimate is based on the last 5 seconds of sample history.\n * @private {!shaka.abr.Ewma}\n */\n this.slow_ = new shaka.abr.Ewma(5);\n\n /**\n * Number of bytes sampled.\n * @private {number}\n */\n this.bytesSampled_ = 0;\n\n /**\n * Initial estimate used when there is not enough data.\n * @see shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE\n * @private {number}\n */\n this.defaultEstimate_ = shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE;\n\n /**\n * Minimum number of bytes sampled before we trust the estimate. If we have\n * not sampled much data, our estimate may not be accurate enough to trust.\n * If bytesSampled_ is less than minTotalBytes_, we use defaultEstimate_.\n * This specific value is based on experimentation.\n *\n * @private {number}\n * @const\n */\n this.minTotalBytes_ = 128e3; // 128kB\n\n /**\n * Minimum number of bytes, under which samples are discarded. Our models do\n * not include latency information, so connection startup time (time to first\n * byte) is considered part of the download time. Because of this, we should\n * ignore very small downloads which would cause our estimate to be too low.\n * This specific value is based on experimentation.\n *\n * @private {number}\n * @const\n */\n this.minBytes_ = 16e3; // 16kB\n};\n\n\n/**\n * Contains the default estimate to use when there is not enough data.\n * This is a relatively safe default, since 3G cell connections are faster than\n * this. For slower connections, such as 2G, the default estimate may be too\n * high. This default can be changed at runtime using\n * {@link shaka.Player#configure} and {@link shakaExtern.AbrConfiguration}.\n * @const {number}\n */\nshaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE = 500e3; // 500kbps\n\n\n/**\n * Takes a bandwidth sample.\n *\n * @param {number} durationMs The amount of time, in milliseconds, for a\n * particular request.\n * @param {number} numBytes The total number of bytes transferred in that\n * request.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.sample = function(\n durationMs, numBytes) {\n if (numBytes < this.minBytes_) {\n return;\n }\n\n var bandwidth = 8000 * numBytes / durationMs;\n var weight = durationMs / 1000;\n\n this.bytesSampled_ += numBytes;\n this.fast_.sample(weight, bandwidth);\n this.slow_.sample(weight, bandwidth);\n};\n\n\n/**\n * Sets the default bandwidth estimate to use if there is not enough data.\n *\n * @param {number} estimate The default bandwidth estimate, in bit/sec.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.setDefaultEstimate = function(\n estimate) {\n this.defaultEstimate_ = estimate;\n};\n\n\n/**\n * Gets the current bandwidth estimate.\n *\n * @return {number} The bandwidth estimate in bits per second.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.getBandwidthEstimate = function() {\n if (this.bytesSampled_ < this.minTotalBytes_) {\n return this.defaultEstimate_;\n }\n\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};\n\n\n/**\n * @return {boolean} True if there is enough data to produce a meaningful\n * estimate.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.hasGoodEstimate = function() {\n return this.bytesSampled_ >= this.minTotalBytes_;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/abr/ewma_bandwidth_estimator.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.log');\n\n\n/**\n * @namespace shaka.log\n * @summary\n * A console logging framework which is compiled out for deployment. This is\n * only available when using the uncompiled version.\n * @exportDoc\n */\n\n\n/**\n * Log levels.\n * @enum {number}\n * @exportDoc\n */\nshaka.log.Level = {\n NONE: 0,\n ERROR: 1,\n WARNING: 2,\n INFO: 3,\n DEBUG: 4,\n V1: 5,\n V2: 6\n};\n\n\n/**\n * @define {number} the maximum log level.\n */\ngoog.define('shaka.log.MAX_LOG_LEVEL', 3);\n\n\n/** @type {function(*, ...*)} */\nshaka.log.error = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.warning = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.info = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.debug = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.v1 = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.v2 = function() {};\n\n\n// IE8 has no console unless it is opened in advance.\n// IE9 console methods are not Functions and have no bind.\nif (window.console && window.console.log.bind) {\n if (!COMPILED) {\n /** @type {number} */\n shaka.log.currentLevel;\n\n /**\n * Change the log level. Useful for debugging in uncompiled mode.\n *\n * @param {number} level\n * @exportDoc\n */\n shaka.log.setLevel = function(level) {\n var nop = function() {};\n var log = shaka.log;\n var Level = shaka.log.Level;\n\n shaka.log.currentLevel = level;\n\n log.error = (level >= Level.ERROR) ? console.error.bind(console) : nop;\n log.warning = (level >= Level.WARNING) ? console.warn.bind(console) : nop;\n log.info = (level >= Level.INFO) ? console.info.bind(console) : nop;\n log.debug = (level >= Level.DEBUG) ? console.log.bind(console) : nop;\n log.v1 = (level >= Level.V1) ? console.debug.bind(console) : nop;\n log.v2 = (level >= Level.V2) ? console.debug.bind(console) : nop;\n };\n\n shaka.log.setLevel(shaka.log.MAX_LOG_LEVEL);\n } else {\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.ERROR) {\n shaka.log.error = console.error.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.WARNING) {\n shaka.log.warning = console.warn.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.INFO) {\n shaka.log.info = console.info.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.DEBUG) {\n shaka.log.debug = console.log.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.V1) {\n shaka.log.v1 = console.debug.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.V2) {\n shaka.log.v2 = console.debug.bind(console);\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/debug/log.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Error');\n\n\n\n/**\n * Creates a new Error.\n *\n * @param {shaka.util.Error.Severity} severity\n * @param {shaka.util.Error.Category} category\n * @param {shaka.util.Error.Code} code\n * @param {...*} var_args\n *\n * @constructor\n * @struct\n * @export\n * @extends {Error}\n */\nshaka.util.Error = function(severity, category, code, var_args) {\n this.severity = severity;\n this.category = category;\n this.code = code;\n this.data = Array.prototype.slice.call(arguments, 3);\n\n // This improves formatting of Errors in failure messages in the tests.\n if (!COMPILED) {\n var categoryName = 'UNKNOWN';\n var codeName = 'UNKNOWN';\n\n for (var k in shaka.util.Error.Category) {\n if (shaka.util.Error.Category[k] == this.category)\n categoryName = k;\n }\n for (var k in shaka.util.Error.Code) {\n if (shaka.util.Error.Code[k] == this.code)\n codeName = k;\n }\n\n /**\n * A human-readable version of the category and code.\n * <i>(Only available in uncompiled mode.)</i>\n *\n * @const {string}\n * @exportDoc\n */\n this.message = 'Shaka Error ' + categoryName + '.' + codeName +\n ' (' + this.data.toString() + ')';\n try {\n throw new Error(this.message);\n } catch (e) {\n /**\n * A stack-trace showing where the error occurred.\n * <i>(Only available in uncompiled mode.)</i>\n *\n * @const {string}\n * @exportDoc\n */\n this.stack = e.stack;\n }\n }\n};\n\n\n/**\n * @type {shaka.util.Error.Severity}\n * @expose\n */\nshaka.util.Error.prototype.severity;\n\n\n/**\n * @const {shaka.util.Error.Category}\n * @expose\n */\nshaka.util.Error.prototype.category;\n\n\n/**\n * @const {shaka.util.Error.Code}\n * @expose\n */\nshaka.util.Error.prototype.code;\n\n\n/**\n * @const {!Array.<*>}\n * @expose\n */\nshaka.util.Error.prototype.data;\n\n\n/**\n * @return {string}\n * @override\n */\nshaka.util.Error.prototype.toString = function() {\n return 'shaka.util.Error ' + JSON.stringify(this, null, ' ');\n};\n\n\n/**\n * @enum {number}\n * @export\n */\nshaka.util.Error.Severity = {\n /**\n * An error occurred, but the Player is attempting to recover from the error.\n *\n * If the Player cannot ultimately recover, it still may not throw a CRITICAL\n * error. For example, retrying for a media segment will never result in\n * a CRITICAL error (the Player will just retry forever).\n */\n 'RECOVERABLE': 1,\n\n /**\n * A critical error that the library cannot recover from. These usually cause\n * the Player to stop loading or updating. A new manifest must be loaded\n * to reset the library.\n */\n 'CRITICAL': 2\n};\n\n\n/**\n * @enum {number}\n * @export\n */\nshaka.util.Error.Category = {\n /** Errors from the network stack. */\n 'NETWORK': 1,\n\n /** Errors parsing text streams. */\n 'TEXT': 2,\n\n /** Errors parsing or processing audio or video streams. */\n 'MEDIA': 3,\n\n /** Errors parsing the Manifest. */\n 'MANIFEST': 4,\n\n /** Errors related to streaming. */\n 'STREAMING': 5,\n\n /** Errors related to DRM. */\n 'DRM': 6,\n\n /** Miscellaneous errors from the player. */\n 'PLAYER': 7,\n\n /** Errors related to cast. */\n 'CAST': 8,\n\n /** Errors in the database storage (offline). */\n 'STORAGE': 9\n};\n\n\n/**\n * @enum {number}\n * @export\n */\nshaka.util.Error.Code = {\n /**\n * A network request was made using an unsupported URI scheme.\n * <br> error.data[0] is the URI.\n */\n 'UNSUPPORTED_SCHEME': 1000,\n\n /**\n * An HTTP network request returned an HTTP status that indicated a failure.\n * <br> error.data[0] is the URI.\n * <br> error.data[1] is the status code.\n * <br> error.data[2] is the response text, or null if the response could not\n * be interpretted as text.\n * <br> error.data[3] is the map of response headers.\n */\n 'BAD_HTTP_STATUS': 1001,\n\n /**\n * An HTTP network request failed with an error, but not from the server.\n * <br> error.data[0] is the URI.\n */\n 'HTTP_ERROR': 1002,\n\n /**\n * A network request timed out.\n * <br> error.data[0] is the URI.\n */\n 'TIMEOUT': 1003,\n\n /**\n * A network request was made with a malformed data URI.\n * <br> error.data[0] is the URI.\n */\n 'MALFORMED_DATA_URI': 1004,\n\n /**\n * A network request was made with a data URI using an unknown encoding.\n * <br> error.data[0] is the URI.\n */\n 'UNKNOWN_DATA_URI_ENCODING': 1005,\n\n /**\n * A request filter threw an error.\n * <br> error.data[0] is the original error.\n */\n 'REQUEST_FILTER_ERROR': 1006,\n\n /**\n * A response filter threw an error.\n * <br> error.data[0] is the original error.\n */\n 'RESPONSE_FILTER_ERROR': 1007,\n\n\n /** The text parser failed to parse a text stream due to an invalid header. */\n 'INVALID_TEXT_HEADER': 2000,\n\n /** The text parser failed to parse a text stream due to an invalid cue. */\n 'INVALID_TEXT_CUE': 2001,\n\n // RETIRED: 'INVALID_TEXT_SETTINGS': 2002,\n\n /**\n * Was unable to detect the encoding of the response text. Suggest adding\n * byte-order-markings to the response data.\n */\n 'UNABLE_TO_DETECT_ENCODING': 2003,\n\n /** The response data contains invalid Unicode character encoding. */\n 'BAD_ENCODING': 2004,\n\n /**\n * The XML parser failed to parse an xml stream, or the XML lacks mandatory\n * elements for TTML.\n */\n 'INVALID_XML': 2005,\n\n // RETIRED: 'INVALID_TTML': 2006,\n\n /**\n * MP4 segment does not contain TTML.\n */\n 'INVALID_MP4_TTML': 2007,\n\n /**\n * MP4 segment does not contain VTT.\n */\n 'INVALID_MP4_VTT': 2008,\n\n\n /**\n * Some component tried to read past the end of a buffer. The segment index,\n * init segment, or PSSH may be malformed.\n */\n 'BUFFER_READ_OUT_OF_BOUNDS': 3000,\n\n /**\n * Some component tried to parse an integer that was too large to fit in a\n * JavaScript number without rounding error. JavaScript can only natively\n * represent integers up to 53 bits.\n */\n 'JS_INTEGER_OVERFLOW': 3001,\n\n /**\n * The EBML parser used to parse the WebM container encountered an integer,\n * ID, or other field larger than the maximum supported by the parser.\n */\n 'EBML_OVERFLOW': 3002,\n\n /**\n * The EBML parser used to parse the WebM container encountered a floating-\n * point field of a size not supported by the parser.\n */\n 'EBML_BAD_FLOATING_POINT_SIZE': 3003,\n\n /**\n * The MP4 SIDX parser found the wrong box type.\n * Either the segment index range is incorrect or the data is corrupt.\n */\n 'MP4_SIDX_WRONG_BOX_TYPE': 3004,\n\n /**\n * The MP4 SIDX parser encountered an invalid timescale.\n * The segment index data may be corrupt.\n */\n 'MP4_SIDX_INVALID_TIMESCALE': 3005,\n\n /** The MP4 SIDX parser encountered a type of SIDX that is not supported. */\n 'MP4_SIDX_TYPE_NOT_SUPPORTED': 3006,\n\n /**\n * The WebM Cues parser was unable to locate the Cues element.\n * The segment index data may be corrupt.\n */\n 'WEBM_CUES_ELEMENT_MISSING': 3007,\n\n /**\n * The WebM header parser was unable to locate the Ebml element.\n * The init segment data may be corrupt.\n */\n 'WEBM_EBML_HEADER_ELEMENT_MISSING': 3008,\n\n /**\n * The WebM header parser was unable to locate the Segment element.\n * The init segment data may be corrupt.\n */\n 'WEBM_SEGMENT_ELEMENT_MISSING': 3009,\n\n /**\n * The WebM header parser was unable to locate the Info element.\n * The init segment data may be corrupt.\n */\n 'WEBM_INFO_ELEMENT_MISSING': 3010,\n\n /**\n * The WebM header parser was unable to locate the Duration element.\n * The init segment data may be corrupt or may have been incorrectly encoded.\n * Shaka requires a duration in WebM DASH content.\n */\n 'WEBM_DURATION_ELEMENT_MISSING': 3011,\n\n /**\n * The WebM Cues parser was unable to locate the Cue Track Positions element.\n * The segment index data may be corrupt.\n */\n 'WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING': 3012,\n\n /**\n * The WebM Cues parser was unable to locate the Cue Time element.\n * The segment index data may be corrupt.\n */\n 'WEBM_CUE_TIME_ELEMENT_MISSING': 3013,\n\n /**\n * A MediaSource operation failed.\n * <br> error.data[0] is a MediaError code from the video element.\n */\n 'MEDIA_SOURCE_OPERATION_FAILED': 3014,\n\n /**\n * A MediaSource operation threw an exception.\n * <br> error.data[0] is the exception that was thrown.\n */\n 'MEDIA_SOURCE_OPERATION_THREW': 3015,\n\n /**\n * The video element reported an error.\n * <br> error.data[0] is a MediaError code from the video element.\n * <br> On Edge & IE, error.data[1] is a Microsoft extended error code in hex.\n */\n 'VIDEO_ERROR': 3016,\n\n /**\n * A MediaSource operation threw QuotaExceededError and recovery failed. The\n * content cannot be played correctly because the segments are too large for\n * the browser/platform. This may occur when attempting to play very high\n * quality, very high bitrate content on low-end devices.\n * <br> error.data[0] is the type of content which caused the error.\n */\n 'QUOTA_EXCEEDED_ERROR': 3017,\n\n\n /**\n * The Player was unable to guess the manifest type based on file extension\n * or MIME type. To fix, try one of the following:\n * <br><ul>\n * <li>Rename the manifest so that the URI ends in a well-known extension.\n * <li>Configure the server to send a recognizable Content-Type header.\n * <li>Configure the server to accept a HEAD request for the manifest.\n * </ul>\n * <br> error.data[0] is the manifest URI.\n */\n 'UNABLE_TO_GUESS_MANIFEST_TYPE': 4000,\n\n /** The DASH Manifest contained invalid XML markup. */\n 'DASH_INVALID_XML': 4001,\n\n /**\n * The DASH Manifest contained a Representation with insufficient segment\n * information.\n */\n 'DASH_NO_SEGMENT_INFO': 4002,\n\n /** The DASH Manifest contained an AdaptationSet with no Representations. */\n 'DASH_EMPTY_ADAPTATION_SET': 4003,\n\n /** The DASH Manifest contained an Period with no AdaptationSets. */\n 'DASH_EMPTY_PERIOD': 4004,\n\n /**\n * The DASH Manifest does not specify an init segment with a WebM container.\n */\n 'DASH_WEBM_MISSING_INIT': 4005,\n\n /** The DASH Manifest contained an unsupported container format. */\n 'DASH_UNSUPPORTED_CONTAINER': 4006,\n\n /** The embedded PSSH data has invalid encoding. */\n 'DASH_PSSH_BAD_ENCODING': 4007,\n\n /**\n * There is an AdaptationSet whose Representations do not have any common\n * key-systems.\n */\n 'DASH_NO_COMMON_KEY_SYSTEM': 4008,\n\n /** Having multiple key IDs per Representation is not supported. */\n 'DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED': 4009,\n\n /** The DASH Manifest specifies conflicting key IDs. */\n 'DASH_CONFLICTING_KEY_IDS': 4010,\n\n /**\n * The manifest contains a period with no playable streams.\n * Either the period was originally empty, or the streams within cannot be\n * played on this browser or platform.\n */\n 'UNPLAYABLE_PERIOD': 4011,\n\n /**\n * There exist some streams that could be decoded, but restrictions imposed\n * by the application or the key system prevent us from playing. This may\n * happen under the following conditions:\n * <ul>\n * <li>The application has given restrictions to the Player that restrict\n * at least one content type completely (e.g. no playable audio).\n * <li>The key system has imposed output restrictions that cannot be met\n * (such as HDCP) and there are no unrestricted alternatives.\n * </ul>\n */\n 'RESTRICTIONS_CANNOT_BE_MET': 4012,\n\n // RETIRED: 'INTERNAL_ERROR_KEY_STATUS': 4013,\n\n /**\n * No valid periods were found in the manifest. Please check that your\n * manifest is correct and free of typos.\n */\n 'NO_PERIODS': 4014,\n\n /**\n * HLS playlist doesn't start with a mandory #EXTM3U tag.\n */\n 'HLS_PLAYLIST_HEADER_MISSING': 4015,\n\n /**\n * HLS tag has an invalid name that doesn't start with '#EXT'\n */\n 'INVALID_HLS_TAG': 4016,\n\n /**\n * HLS playlist has both Master and Media/Segment tags.\n */\n 'HLS_INVALID_PLAYLIST_HIERARCHY': 4017,\n\n /**\n * A Representation has an id that is the same as another Representation in\n * the same Period. This makes manifest updates impossible since we cannot\n * map the updated Representation to the old one.\n */\n 'DASH_DUPLICATE_REPRESENTATION_ID': 4018,\n\n // RETIRED: 'HLS_MEDIA_INIT_SECTION_INFO_MISSING': 4019,\n\n /**\n * HLS manifest has several #EXT-X-MAP tags. We can only\n * support one at the moment.\n */\n 'HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND': 4020,\n\n /**\n * HLS parser was unable to guess mime type of a stream.\n * <br> error.data[0] is the stream file's extension.\n */\n 'HLS_COULD_NOT_GUESS_MIME_TYPE': 4021,\n\n /**\n * No Master Playlist has been provided. Master playlist provides\n * vital information about the streams (like codecs) that is\n * required for MediaSource. We don't support directly providing\n * a Media Playlist.\n */\n 'HLS_MASTER_PLAYLIST_NOT_PROVIDED': 4022,\n\n /**\n * One of the required attributes was not provided.\n * HLS manifest is invalid.\n * <br> error.data[0] is the missing attribute's name.\n */\n 'HLS_REQUIRED_ATTRIBUTE_MISSING': 4023,\n\n /**\n * One of the required tags was not provided.\n * HLS manifest is invalid.\n * <br> error.data[0] is the missing tag's name.\n */\n 'HLS_REQUIRED_TAG_MISSING': 4024,\n\n /**\n * HLS parser was unable to guess codecs of a stream.\n * <br> error.data[0] is the list of all codecs for the variant.\n */\n 'HLS_COULD_NOT_GUESS_CODECS': 4025,\n\n /**\n * HLS parser has encountered encrypted content with unsupported\n * KEYFORMAT attributes.\n */\n 'HLS_KEYFORMATS_NOT_SUPPORTED': 4026,\n\n\n // RETIRED: 'INCONSISTENT_BUFFER_STATE': 5000,\n // RETIRED: 'INVALID_SEGMENT_INDEX': 5001,\n // RETIRED: 'SEGMENT_DOES_NOT_EXIST': 5002,\n // RETIRED: 'CANNOT_SATISFY_BYTE_LIMIT': 5003,\n // RETIRED: 'BAD_SEGMENT': 5004,\n\n /**\n * The StreamingEngine called onChooseStreams() but the callback receiver\n * did not return the correct number or type of Streams.\n *\n * This can happen when there is multi-Period content where one Period is\n * video+audio and another is video-only or audio-only. We don't support this\n * case because it is incompatible with MSE. When the browser reaches the\n * transition, it will pause, waiting for the audio stream.\n */\n 'INVALID_STREAMS_CHOSEN': 5005,\n\n\n /**\n * The manifest indicated protected content, but the manifest parser was\n * unable to determine what key systems should be used.\n */\n 'NO_RECOGNIZED_KEY_SYSTEMS': 6000,\n\n /**\n * None of the requested key system configurations are available. This may\n * happen under the following conditions:\n * <ul>\n * <li> The key system is not supported.\n * <li> The key system does not support the features requested (e.g.\n * persistent state).\n * <li> A user prompt was shown and the user denied access.\n * <li> The key system is not available from unsecure contexts. (ie.\n requires HTTPS) See https://goo.gl/EEhZqT.\n * </ul>\n */\n 'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,\n\n /**\n * The browser found one of the requested key systems, but it failed to\n * create an instance of the CDM for some unknown reason.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_CREATE_CDM': 6002,\n\n /**\n * The browser found one of the requested key systems and created an instance\n * of the CDM, but it failed to attach the CDM to the video for some unknown\n * reason.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_ATTACH_TO_VIDEO': 6003,\n\n /**\n * The CDM rejected the server certificate supplied by the application.\n * The certificate may be malformed or in an unsupported format.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'INVALID_SERVER_CERTIFICATE': 6004,\n\n /**\n * The CDM refused to create a session for some unknown reason.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_CREATE_SESSION': 6005,\n\n /**\n * The CDM was unable to generate a license request for the init data it was\n * given. The init data may be malformed or in an unsupported format.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_GENERATE_LICENSE_REQUEST': 6006,\n\n /**\n * The license request failed. This could be a timeout, a network failure, or\n * a rejection by the server.\n * <br> error.data[0] is a shaka.util.Error from the networking engine.\n */\n 'LICENSE_REQUEST_FAILED': 6007,\n\n /**\n * The license response was rejected by the CDM. The server's response may be\n * invalid or malformed for this CDM.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'LICENSE_RESPONSE_REJECTED': 6008,\n\n // RETIRED: 'NO_LICENSE_SERVER_SPECIFIED': 6009,\n\n /**\n * The manifest does not specify any DRM info, but the content is encrypted.\n * Either the manifest or the manifest parser are broken.\n */\n 'ENCRYPTED_CONTENT_WITHOUT_DRM_INFO': 6010,\n\n // RETIRED: 'WRONG_KEYS': 6011,\n\n /**\n * No license server was given for the key system signaled by the manifest.\n * A license server URI is required for every key system.\n */\n 'NO_LICENSE_SERVER_GIVEN': 6012,\n\n /**\n * A required offline session was removed. The content is not playable.\n */\n 'OFFLINE_SESSION_REMOVED': 6013,\n\n /**\n * The license has expired. This is triggered when playback is stalled on a\n * 'waitingforkeys' event and there are any expired keys in the key status map\n * of any active session.\n */\n 'EXPIRED': 6014,\n\n\n /**\n * The call to Player.load() was interrupted by a call to Player.unload()\n * or another call to Player.load().\n */\n 'LOAD_INTERRUPTED': 7000,\n\n\n /**\n * The Cast API is unavailable. This may be because of one of the following:\n * - The browser may not have Cast support\n * - The browser may be missing a necessary Cast extension\n * - The Cast sender library may not be loaded in your app\n */\n 'CAST_API_UNAVAILABLE': 8000,\n\n /**\n * No cast receivers are available at this time.\n */\n 'NO_CAST_RECEIVERS': 8001,\n\n /**\n * The library is already casting.\n */\n 'ALREADY_CASTING': 8002,\n\n /**\n * A Cast SDK error that we did not explicitly plan for has occurred.\n * Check data[0] and refer to the Cast SDK documentation for details.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'UNEXPECTED_CAST_ERROR': 8003,\n\n /**\n * The cast operation was canceled by the user.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'CAST_CANCELED_BY_USER': 8004,\n\n /**\n * The cast connection timed out.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'CAST_CONNECTION_TIMED_OUT': 8005,\n\n /**\n * The requested receiver app ID does not exist or is unavailable.\n * Check the requested app ID for typos.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'CAST_RECEIVER_APP_UNAVAILABLE': 8006,\n\n\n /**\n * Offline storage is not supported on this browser; it is required for\n * offline support.\n */\n 'STORAGE_NOT_SUPPORTED': 9000,\n\n /**\n * An unknown error occurred in the IndexedDB.\n * <br> On Firefox, one common source for UnknownError calls is reverting\n * Firefox to an old version. This makes the indexedDB storage inaccessible\n * for older versions. The only way to fix this is to delete the storage\n * data in your profile. See https://goo.gl/eKVPPe.\n * <br> error.data[0] is the error object.\n */\n 'INDEXED_DB_ERROR': 9001,\n\n /**\n * The operation was aborted. For example, by a call to destroy().\n */\n 'OPERATION_ABORTED': 9002,\n\n /**\n * The specified item was not found in the IndexedDB.\n * <br> error.data[0] is the offline URI.\n */\n 'REQUESTED_ITEM_NOT_FOUND': 9003,\n\n /**\n * A network request was made with a malformed offline URI.\n * <br> error.data[0] is the URI.\n */\n 'MALFORMED_OFFLINE_URI': 9004,\n\n /**\n * The specified content is live or in-progress.\n * Live and in-progress streams cannot be stored offline.\n * <br> error.data[0] is the URI.\n */\n 'CANNOT_STORE_LIVE_OFFLINE': 9005,\n\n /**\n * There is already a store operation in-progress, wait until it completes\n * before starting another.\n */\n 'STORE_ALREADY_IN_PROGRESS': 9006,\n\n /**\n * The specified manifest is encrypted but does not specify any init data.\n * Without init data specified in the manifest, the content will not be\n * playable offline.\n * <br> error.data[0] is the URI.\n */\n 'NO_INIT_DATA_FOR_OFFLINE': 9007,\n\n /**\n * shaka.offline.Storage was constructed with a Player proxy instead of a\n * local player instance. To fix this, use Player directly with Storage\n * instead of the results of CastProxy.prototype.getPlayer().\n */\n 'LOCAL_PLAYER_INSTANCE_REQUIRED': 9008\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/error.js","// Copyright 2008 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Simple utilities for splitting URI strings.\n *\n * Uses features of RFC 3986 for parsing/formatting URIs:\n * http://www.ietf.org/rfc/rfc3986.txt\n *\n * @author gboyer@google.com (Garrett Boyer) - The \"lightened\" design.\n * @author msamuel@google.com (Mike Samuel) - Domain knowledge and regexes.\n */\n\ngoog.provide('goog.uri.utils');\ngoog.provide('goog.uri.utils.ComponentIndex');\n\n\n/**\n * A regular expression for breaking a URI into its component parts.\n *\n * {@link http://www.ietf.org/rfc/rfc3986.txt} says in Appendix B\n * As the \"first-match-wins\" algorithm is identical to the \"greedy\"\n * disambiguation method used by POSIX regular expressions, it is natural and\n * commonplace to use a regular expression for parsing the potential five\n * components of a URI reference.\n *\n * The following line is the regular expression for breaking-down a\n * well-formed URI reference into its components.\n *\n * <pre>\n * ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\n * 12 3 4 5 6 7 8 9\n * </pre>\n *\n * The numbers in the second line above are only to assist readability; they\n * indicate the reference points for each subexpression (i.e., each paired\n * parenthesis). We refer to the value matched for subexpression <n> as $<n>.\n * For example, matching the above expression to\n * <pre>\n * http://www.ics.uci.edu/pub/ietf/uri/#Related\n * </pre>\n * results in the following subexpression matches:\n * <pre>\n * $1 = http:\n * $2 = http\n * $3 = //www.ics.uci.edu\n * $4 = www.ics.uci.edu\n * $5 = /pub/ietf/uri/\n * $6 = <undefined>\n * $7 = <undefined>\n * $8 = #Related\n * $9 = Related\n * </pre>\n * where <undefined> indicates that the component is not present, as is the\n * case for the query component in the above example. Therefore, we can\n * determine the value of the five components as\n * <pre>\n * scheme = $2\n * authority = $4\n * path = $5\n * query = $7\n * fragment = $9\n * </pre>\n *\n * The regular expression has been modified slightly to expose the\n * userInfo, domain, and port separately from the authority.\n * The modified version yields\n * <pre>\n * $1 = http scheme\n * $2 = <undefined> userInfo -\\\n * $3 = www.ics.uci.edu domain | authority\n * $4 = <undefined> port -/\n * $5 = /pub/ietf/uri/ path\n * $6 = <undefined> query without ?\n * $7 = Related fragment without #\n * </pre>\n * @type {!RegExp}\n * @private\n */\ngoog.uri.utils.splitRe_ = new RegExp(\n '^' +\n '(?:' +\n '([^:/?#.]+)' + // scheme - ignore special characters\n // used by other URL parts such as :,\n // ?, /, #, and .\n ':)?' +\n '(?://' +\n '(?:([^/?#]*)@)?' + // userInfo\n '([^/#?]*?)' + // domain\n '(?::([0-9]+))?' + // port\n '(?=[/#?]|$)' + // authority-terminating character\n ')?' +\n '([^?#]+)?' + // path\n '(?:\\\\?([^#]*))?' + // query\n '(?:#(.*))?' + // fragment\n '$');\n\n\n/**\n * The index of each URI component in the return value of goog.uri.utils.split.\n * @enum {number}\n */\ngoog.uri.utils.ComponentIndex = {\n SCHEME: 1,\n USER_INFO: 2,\n DOMAIN: 3,\n PORT: 4,\n PATH: 5,\n QUERY_DATA: 6,\n FRAGMENT: 7\n};\n\n\n/**\n * Splits a URI into its component parts.\n *\n * Each component can be accessed via the component indices; for example:\n * <pre>\n * goog.uri.utils.split(someStr)[goog.uri.utils.CompontentIndex.QUERY_DATA];\n * </pre>\n *\n * @param {string} uri The URI string to examine.\n * @return {!Array.<string|undefined>} Each component still URI-encoded.\n * Each component that is present will contain the encoded value, whereas\n * components that are not present will be undefined or empty, depending\n * on the browser's regular expression implementation. Never null, since\n * arbitrary strings may still look like path names.\n */\ngoog.uri.utils.split = function(uri) {\n // See @return comment -- never null.\n return /** @type {!Array.<string|undefined>} */ (\n uri.match(goog.uri.utils.splitRe_));\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/third_party/closure/goog/uri/utils.js","// Copyright 2006 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Class for parsing and formatting URIs.\n *\n * Use new goog.Uri(string) to parse a URI string.\n *\n * e.g: <code>var myUri = new goog.Uri(window.location);</code>\n *\n * Implements RFC 3986 for parsing/formatting URIs.\n * http://www.ietf.org/rfc/rfc3986.txt\n *\n * Some changes have been made to the interface (more like .NETs), though the\n * internal representation is now of un-encoded parts, this will change the\n * behavior slightly.\n *\n */\n\ngoog.provide('goog.Uri');\ngoog.provide('goog.Uri.QueryData');\n\ngoog.require('goog.uri.utils');\ngoog.require('goog.uri.utils.ComponentIndex');\n\n\n\n/**\n * This class contains setters and getters for the parts of the URI.\n * The <code>getXyz</code>/<code>setXyz</code> methods return the decoded part\n * -- so<code>new goog.Uri('/foo%20bar').getPath()</code> will return the\n * decoded path, <code>/foo bar</code>.\n *\n * Reserved characters (see RFC 3986 section 2.2) can be present in\n * their percent-encoded form in scheme, domain, and path URI components and\n * will not be auto-decoded. For example:\n * <code>new goog.Uri('rel%61tive/path%2fto/resource').getPath()</code> will\n * return <code>relative/path%2fto/resource</code>.\n *\n * The constructor accepts an optional unparsed, raw URI string. The parser\n * is relaxed, so special characters that aren't escaped but don't cause\n * ambiguities will not cause parse failures.\n *\n * All setters return <code>this</code> and so may be chained, a la\n * <code>new goog.Uri('/foo').setFragment('part').toString()</code>.\n *\n * @param {*=} opt_uri Optional string URI to parse, or if a goog.Uri is\n * passed, a clone is created.\n *\n * @constructor\n */\ngoog.Uri = function(opt_uri) {\n // Parse in the uri string\n var m;\n if (opt_uri instanceof goog.Uri) {\n this.setScheme(opt_uri.getScheme());\n this.setUserInfo(opt_uri.getUserInfo());\n this.setDomain(opt_uri.getDomain());\n this.setPort(opt_uri.getPort());\n this.setPath(opt_uri.getPath());\n this.setQueryData(opt_uri.getQueryData().clone());\n this.setFragment(opt_uri.getFragment());\n } else if (opt_uri && (m = goog.uri.utils.split(String(opt_uri)))) {\n // Set the parts -- decoding as we do so.\n // COMPATABILITY NOTE - In IE, unmatched fields may be empty strings,\n // whereas in other browsers they will be undefined.\n this.setScheme(m[goog.uri.utils.ComponentIndex.SCHEME] || '', true);\n this.setUserInfo(m[goog.uri.utils.ComponentIndex.USER_INFO] || '', true);\n this.setDomain(m[goog.uri.utils.ComponentIndex.DOMAIN] || '', true);\n this.setPort(m[goog.uri.utils.ComponentIndex.PORT]);\n this.setPath(m[goog.uri.utils.ComponentIndex.PATH] || '', true);\n this.setQueryData(m[goog.uri.utils.ComponentIndex.QUERY_DATA] || '', true);\n this.setFragment(m[goog.uri.utils.ComponentIndex.FRAGMENT] || '', true);\n } else {\n this.queryData_ = new goog.Uri.QueryData(null, null);\n }\n};\n\n\n/**\n * Scheme such as \"http\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.scheme_ = '';\n\n\n/**\n * User credentials in the form \"username:password\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.userInfo_ = '';\n\n\n/**\n * Domain part, e.g. \"www.google.com\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.domain_ = '';\n\n\n/**\n * Port, e.g. 8080.\n * @type {?number}\n * @private\n */\ngoog.Uri.prototype.port_ = null;\n\n\n/**\n * Path, e.g. \"/tests/img.png\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.path_ = '';\n\n\n/**\n * Object representing query data.\n * @type {!goog.Uri.QueryData}\n * @private\n */\ngoog.Uri.prototype.queryData_;\n\n\n/**\n * The fragment without the #.\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.fragment_ = '';\n\n\n/**\n * @return {string} The string form of the url.\n * @override\n */\ngoog.Uri.prototype.toString = function() {\n var out = [];\n\n var scheme = this.getScheme();\n if (scheme) {\n out.push(goog.Uri.encodeSpecialChars_(\n scheme, goog.Uri.reDisallowedInSchemeOrUserInfo_, true), ':');\n }\n\n var domain = this.getDomain();\n if (domain) {\n out.push('//');\n\n var userInfo = this.getUserInfo();\n if (userInfo) {\n out.push(goog.Uri.encodeSpecialChars_(\n userInfo, goog.Uri.reDisallowedInSchemeOrUserInfo_, true), '@');\n }\n\n out.push(goog.Uri.removeDoubleEncoding_(encodeURIComponent(domain)));\n\n var port = this.getPort();\n if (port != null) {\n out.push(':', String(port));\n }\n }\n\n var path = this.getPath();\n if (path) {\n if (this.hasDomain() && path.charAt(0) != '/') {\n out.push('/');\n }\n out.push(goog.Uri.encodeSpecialChars_(\n path,\n path.charAt(0) == '/' ?\n goog.Uri.reDisallowedInAbsolutePath_ :\n goog.Uri.reDisallowedInRelativePath_,\n true));\n }\n\n var query = this.getEncodedQuery();\n if (query) {\n out.push('?', query);\n }\n\n var fragment = this.getFragment();\n if (fragment) {\n out.push('#', goog.Uri.encodeSpecialChars_(\n fragment, goog.Uri.reDisallowedInFragment_));\n }\n return out.join('');\n};\n\n\n/**\n * Resolves the given relative URI (a goog.Uri object), using the URI\n * represented by this instance as the base URI.\n *\n * There are several kinds of relative URIs:<br>\n * 1. foo - replaces the last part of the path, the whole query and fragment<br>\n * 2. /foo - replaces the the path, the query and fragment<br>\n * 3. //foo - replaces everything from the domain on. foo is a domain name<br>\n * 4. ?foo - replace the query and fragment<br>\n * 5. #foo - replace the fragment only\n *\n * Additionally, if relative URI has a non-empty path, all \"..\" and \".\"\n * segments will be resolved, as described in RFC 3986.\n *\n * @param {goog.Uri} relativeUri The relative URI to resolve.\n * @return {!goog.Uri} The resolved URI.\n */\ngoog.Uri.prototype.resolve = function(relativeUri) {\n\n var absoluteUri = this.clone();\n if (absoluteUri.scheme_ === 'data') {\n // Cannot have a relative URI to a data URI.\n absoluteUri = new goog.Uri();\n }\n\n // we satisfy these conditions by looking for the first part of relativeUri\n // that is not blank and applying defaults to the rest\n\n var overridden = relativeUri.hasScheme();\n\n if (overridden) {\n absoluteUri.setScheme(relativeUri.getScheme());\n } else {\n overridden = relativeUri.hasUserInfo();\n }\n\n if (overridden) {\n absoluteUri.setUserInfo(relativeUri.getUserInfo());\n } else {\n overridden = relativeUri.hasDomain();\n }\n\n if (overridden) {\n absoluteUri.setDomain(relativeUri.getDomain());\n } else {\n overridden = relativeUri.hasPort();\n }\n\n var path = relativeUri.getPath();\n if (overridden) {\n absoluteUri.setPort(relativeUri.getPort());\n } else {\n overridden = relativeUri.hasPath();\n if (overridden) {\n // resolve path properly\n if (path.charAt(0) != '/') {\n // path is relative\n if (this.hasDomain() && !this.hasPath()) {\n // RFC 3986, section 5.2.3, case 1\n path = '/' + path;\n } else {\n // RFC 3986, section 5.2.3, case 2\n var lastSlashIndex = absoluteUri.getPath().lastIndexOf('/');\n if (lastSlashIndex != -1) {\n path = absoluteUri.getPath().substr(0, lastSlashIndex + 1) + path;\n }\n }\n }\n path = goog.Uri.removeDotSegments(path);\n }\n }\n\n if (overridden) {\n absoluteUri.setPath(path);\n } else {\n overridden = relativeUri.hasQuery();\n }\n\n if (overridden) {\n absoluteUri.setQueryData(relativeUri.getQueryData().clone());\n } else {\n overridden = relativeUri.hasFragment();\n }\n\n if (overridden) {\n absoluteUri.setFragment(relativeUri.getFragment());\n }\n\n return absoluteUri;\n};\n\n\n/**\n * Clones the URI instance.\n * @return {!goog.Uri} New instance of the URI object.\n */\ngoog.Uri.prototype.clone = function() {\n return new goog.Uri(this);\n};\n\n\n/**\n * @return {string} The encoded scheme/protocol for the URI.\n */\ngoog.Uri.prototype.getScheme = function() {\n return this.scheme_;\n};\n\n\n/**\n * Sets the scheme/protocol.\n * @param {string} newScheme New scheme value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setScheme = function(newScheme, opt_decode) {\n this.scheme_ = opt_decode ? goog.Uri.decodeOrEmpty_(newScheme, true) :\n newScheme;\n\n // remove an : at the end of the scheme so somebody can pass in\n // window.location.protocol\n if (this.scheme_) {\n this.scheme_ = this.scheme_.replace(/:$/, '');\n }\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the scheme has been set.\n */\ngoog.Uri.prototype.hasScheme = function() {\n return !!this.scheme_;\n};\n\n\n/**\n * @return {string} The decoded user info.\n */\ngoog.Uri.prototype.getUserInfo = function() {\n return this.userInfo_;\n};\n\n\n/**\n * Sets the userInfo.\n * @param {string} newUserInfo New userInfo value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setUserInfo = function(newUserInfo, opt_decode) {\n this.userInfo_ = opt_decode ? goog.Uri.decodeOrEmpty_(newUserInfo) :\n newUserInfo;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the user info has been set.\n */\ngoog.Uri.prototype.hasUserInfo = function() {\n return !!this.userInfo_;\n};\n\n\n/**\n * @return {string} The decoded domain.\n */\ngoog.Uri.prototype.getDomain = function() {\n return this.domain_;\n};\n\n\n/**\n * Sets the domain.\n * @param {string} newDomain New domain value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setDomain = function(newDomain, opt_decode) {\n this.domain_ = opt_decode ? goog.Uri.decodeOrEmpty_(newDomain, true) :\n newDomain;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the domain has been set.\n */\ngoog.Uri.prototype.hasDomain = function() {\n return !!this.domain_;\n};\n\n\n/**\n * @return {?number} The port number.\n */\ngoog.Uri.prototype.getPort = function() {\n return this.port_;\n};\n\n\n/**\n * Sets the port number.\n * @param {*} newPort Port number. Will be explicitly casted to a number.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setPort = function(newPort) {\n if (newPort) {\n newPort = Number(newPort);\n if (isNaN(newPort) || newPort < 0) {\n throw Error('Bad port number ' + newPort);\n }\n this.port_ = newPort;\n } else {\n this.port_ = null;\n }\n\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the port has been set.\n */\ngoog.Uri.prototype.hasPort = function() {\n return this.port_ != null;\n};\n\n\n/**\n * @return {string} The decoded path.\n */\ngoog.Uri.prototype.getPath = function() {\n return this.path_;\n};\n\n\n/**\n * Sets the path.\n * @param {string} newPath New path value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setPath = function(newPath, opt_decode) {\n this.path_ = opt_decode ? goog.Uri.decodeOrEmpty_(newPath, true) : newPath;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the path has been set.\n */\ngoog.Uri.prototype.hasPath = function() {\n return !!this.path_;\n};\n\n\n/**\n * @return {boolean} Whether the query string has been set.\n */\ngoog.Uri.prototype.hasQuery = function() {\n return this.queryData_.toString() !== '';\n};\n\n\n/**\n * Sets the query data.\n * @param {goog.Uri.QueryData|string|undefined} queryData QueryData object.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * Applies only if queryData is a string.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setQueryData = function(queryData, opt_decode) {\n if (queryData instanceof goog.Uri.QueryData) {\n this.queryData_ = queryData;\n } else {\n if (!opt_decode) {\n // QueryData accepts encoded query string, so encode it if\n // opt_decode flag is not true.\n queryData = goog.Uri.encodeSpecialChars_(queryData,\n goog.Uri.reDisallowedInQuery_);\n }\n this.queryData_ = new goog.Uri.QueryData(queryData, null);\n }\n\n return this;\n};\n\n\n/**\n * @return {string} The encoded URI query, not including the ?.\n */\ngoog.Uri.prototype.getEncodedQuery = function() {\n return this.queryData_.toString();\n};\n\n\n/**\n * @return {string} The decoded URI query, not including the ?.\n */\ngoog.Uri.prototype.getDecodedQuery = function() {\n return this.queryData_.toDecodedString();\n};\n\n\n/**\n * Returns the query data.\n * @return {!goog.Uri.QueryData} QueryData object.\n */\ngoog.Uri.prototype.getQueryData = function() {\n return this.queryData_;\n};\n\n\n/**\n * @return {string} The URI fragment, not including the #.\n */\ngoog.Uri.prototype.getFragment = function() {\n return this.fragment_;\n};\n\n\n/**\n * Sets the URI fragment.\n * @param {string} newFragment New fragment value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setFragment = function(newFragment, opt_decode) {\n this.fragment_ = opt_decode ? goog.Uri.decodeOrEmpty_(newFragment) :\n newFragment;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the URI has a fragment set.\n */\ngoog.Uri.prototype.hasFragment = function() {\n return !!this.fragment_;\n};\n\n\n//==============================================================================\n// Static members\n//==============================================================================\n\n\n/**\n * Removes dot segments in given path component, as described in\n * RFC 3986, section 5.2.4.\n *\n * @param {string} path A non-empty path component.\n * @return {string} Path component with removed dot segments.\n */\ngoog.Uri.removeDotSegments = function(path) {\n if (path == '..' || path == '.') {\n return '';\n\n } else if (path.indexOf('./') == -1 &&\n path.indexOf('/.') == -1) {\n // This optimization detects uris which do not contain dot-segments,\n // and as a consequence do not require any processing.\n return path;\n\n } else {\n var leadingSlash = (path.lastIndexOf('/', 0) == 0);\n var segments = path.split('/');\n var out = [];\n\n for (var pos = 0; pos < segments.length; ) {\n var segment = segments[pos++];\n\n if (segment == '.') {\n if (leadingSlash && pos == segments.length) {\n out.push('');\n }\n } else if (segment == '..') {\n if (out.length > 1 || out.length == 1 && out[0] != '') {\n out.pop();\n }\n if (leadingSlash && pos == segments.length) {\n out.push('');\n }\n } else {\n out.push(segment);\n leadingSlash = true;\n }\n }\n\n return out.join('/');\n }\n};\n\n\n/**\n * Decodes a value or returns the empty string if it isn't defined or empty.\n * @param {string|undefined} val Value to decode.\n * @param {boolean=} opt_preserveReserved If true, restricted characters will\n * not be decoded.\n * @return {string} Decoded value.\n * @private\n */\ngoog.Uri.decodeOrEmpty_ = function(val, opt_preserveReserved) {\n // Don't use UrlDecode() here because val is not a query parameter.\n if (!val) {\n return '';\n }\n\n return opt_preserveReserved ? decodeURI(val) : decodeURIComponent(val);\n};\n\n\n/**\n * If unescapedPart is non null, then escapes any characters in it that aren't\n * valid characters in a url and also escapes any special characters that\n * appear in extra.\n *\n * @param {*} unescapedPart The string to encode.\n * @param {RegExp} extra A character set of characters in [\\01-\\177].\n * @param {boolean=} opt_removeDoubleEncoding If true, remove double percent\n * encoding.\n * @return {?string} null iff unescapedPart == null.\n * @private\n */\ngoog.Uri.encodeSpecialChars_ = function(unescapedPart, extra,\n opt_removeDoubleEncoding) {\n if (goog.isString(unescapedPart)) {\n var encoded = encodeURI(unescapedPart).\n replace(extra, goog.Uri.encodeChar_);\n if (opt_removeDoubleEncoding) {\n // encodeURI double-escapes %XX sequences used to represent restricted\n // characters in some URI components, remove the double escaping here.\n encoded = goog.Uri.removeDoubleEncoding_(encoded);\n }\n return encoded;\n }\n return null;\n};\n\n\n/**\n * Converts a character in [\\01-\\177] to its unicode character equivalent.\n * @param {string} ch One character string.\n * @return {string} Encoded string.\n * @private\n */\ngoog.Uri.encodeChar_ = function(ch) {\n var n = ch.charCodeAt(0);\n return '%' + ((n >> 4) & 0xf).toString(16) + (n & 0xf).toString(16);\n};\n\n\n/**\n * Removes double percent-encoding from a string.\n * @param {string} doubleEncodedString String\n * @return {string} String with double encoding removed.\n * @private\n */\ngoog.Uri.removeDoubleEncoding_ = function(doubleEncodedString) {\n return doubleEncodedString.replace(/%25([0-9a-fA-F]{2})/g, '%$1');\n};\n\n\n/**\n * Regular expression for characters that are disallowed in the scheme or\n * userInfo part of the URI.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInSchemeOrUserInfo_ = /[#\\/\\?@]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in a relative path.\n * Colon is included due to RFC 3986 3.3.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInRelativePath_ = /[\\#\\?:]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in an absolute path.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInAbsolutePath_ = /[\\#\\?]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in the query.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInQuery_ = /[\\#\\?@]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in the fragment.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInFragment_ = /#/g;\n\n\n\n/**\n * Class used to represent URI query parameters. It is essentially a hash of\n * name-value pairs, though a name can be present more than once.\n *\n * Has the same interface as the collections in goog.structs.\n *\n * @param {?string=} opt_query Optional encoded query string to parse into\n * the object.\n * @param {goog.Uri=} opt_uri Optional uri object that should have its\n * cache invalidated when this object updates. Deprecated -- this\n * is no longer required.\n * @constructor\n * @final\n */\ngoog.Uri.QueryData = function(opt_query, opt_uri) {\n /**\n * Encoded query string, or null if it requires computing from the key map.\n * @type {?string}\n * @private\n */\n this.encodedQuery_ = opt_query || null;\n};\n\n\n/**\n * If the underlying key map is not yet initialized, it parses the\n * query string and fills the map with parsed data.\n * @private\n */\ngoog.Uri.QueryData.prototype.ensureKeyMapInitialized_ = function() {\n if (!this.keyMap_) {\n this.keyMap_ = {};\n this.count_ = 0;\n\n if (this.encodedQuery_) {\n var pairs = this.encodedQuery_.split('&');\n for (var i = 0; i < pairs.length; i++) {\n var indexOfEquals = pairs[i].indexOf('=');\n var name = null;\n var value = null;\n if (indexOfEquals >= 0) {\n name = pairs[i].substring(0, indexOfEquals);\n value = pairs[i].substring(indexOfEquals + 1);\n } else {\n name = pairs[i];\n }\n name = decodeURIComponent(name.replace(/\\+/g, ' '));\n value = value || '';\n this.add(name, decodeURIComponent(value.replace(/\\+/g, ' ')));\n }\n }\n }\n};\n\n\n/**\n * The map containing name/value or name/array-of-values pairs.\n * May be null if it requires parsing from the query string.\n *\n * We need to use a Map because we cannot guarantee that the key names will\n * not be problematic for IE.\n *\n * @type {Object.<string, !Array.<string>>}\n * @private\n */\ngoog.Uri.QueryData.prototype.keyMap_ = null;\n\n\n/**\n * The number of params, or null if it requires computing.\n * @type {?number}\n * @private\n */\ngoog.Uri.QueryData.prototype.count_ = null;\n\n\n/**\n * @return {?number} The number of parameters.\n */\ngoog.Uri.QueryData.prototype.getCount = function() {\n this.ensureKeyMapInitialized_();\n return this.count_;\n};\n\n\n/**\n * Adds a key value pair.\n * @param {string} key Name.\n * @param {*} value Value.\n * @return {!goog.Uri.QueryData} Instance of this object.\n */\ngoog.Uri.QueryData.prototype.add = function(key, value) {\n this.ensureKeyMapInitialized_();\n // Invalidate the cache.\n this.encodedQuery_ = null;\n\n var values = this.keyMap_.hasOwnProperty(key) && this.keyMap_[key];\n if (!values) {\n this.keyMap_[key] = (values = []);\n }\n values.push(value);\n this.count_++;\n return this;\n};\n\n\n/**\n * @return {string} Encoded query string.\n * @override\n */\ngoog.Uri.QueryData.prototype.toString = function() {\n if (this.encodedQuery_) {\n return this.encodedQuery_;\n }\n\n if (!this.keyMap_) {\n return '';\n }\n\n var sb = [];\n\n for (var key in this.keyMap_) {\n var encodedKey = encodeURIComponent(key);\n var val = this.keyMap_[key];\n for (var j = 0; j < val.length; j++) {\n var param = encodedKey;\n // Ensure that null and undefined are encoded into the url as\n // literal strings.\n if (val[j] !== '') {\n param += '=' + encodeURIComponent(val[j]);\n }\n sb.push(param);\n }\n }\n\n return this.encodedQuery_ = sb.join('&');\n};\n\n\n/**\n * @return {string} Decoded query string.\n */\ngoog.Uri.QueryData.prototype.toDecodedString = function() {\n return goog.Uri.decodeOrEmpty_(this.toString());\n};\n\n\n/**\n * Clone the query data instance.\n * @return {!goog.Uri.QueryData} New instance of the QueryData object.\n */\ngoog.Uri.QueryData.prototype.clone = function() {\n var rv = new goog.Uri.QueryData();\n rv.encodedQuery_ = this.encodedQuery_;\n if (this.keyMap_) {\n var cloneMap = {};\n for (var key in this.keyMap_) {\n cloneMap[key] = this.keyMap_[key].concat();\n }\n rv.keyMap_ = cloneMap;\n rv.count_ = this.count_;\n }\n return rv;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/third_party/closure/goog/uri/uri.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Functional');\n\n\n/**\n * @namespace shaka.util.Functional\n * @summary A set of functional utility functions.\n */\n\n\n/**\n * Creates a promise chain that calls the given callback for each element in\n * the array in a catch of a promise.\n *\n * e.g.:\n * Promise.reject().catch(callback(array[0])).catch(callback(array[1]));\n *\n * @param {!Array.<ELEM>} array\n * @param {function(ELEM):!Promise.<RESULT>} callback\n * @return {!Promise.<RESULT>}\n * @template ELEM,RESULT\n */\nshaka.util.Functional.createFallbackPromiseChain = function(array, callback) {\n return array.reduce(function(callback, promise, elem) {\n return promise.catch(callback.bind(null, elem));\n }.bind(null, callback), Promise.reject());\n};\n\n\n/**\n * Returns the first array concatenated to the second; used to collapse an\n * array of arrays into a single array.\n *\n * @param {!Array.<T>} all\n * @param {!Array.<T>} part\n * @return {!Array.<T>}\n * @template T\n */\nshaka.util.Functional.collapseArrays = function(all, part) {\n return all.concat(part);\n};\n\n\n/**\n * A no-op function. Useful in promise chains.\n */\nshaka.util.Functional.noop = function() {};\n\n\n/**\n * Returns if the given value is not null; useful for filtering out null values.\n *\n * @param {T} value\n * @return {boolean}\n * @template T\n */\nshaka.util.Functional.isNotNull = function(value) {\n return value != null;\n};\n\n\n/**\n * Creates a function that returns whether the given value is equal to the given\n * value.\n *\n * @param {T} compare\n * @return {function(T):boolean}\n * @template T\n */\nshaka.util.Functional.isEqualFunc = function(compare) {\n return function(a) { return a == compare; };\n};\n\n\n/**\n * Creates a function that returns whether the given value is not equal to the\n * given value.\n *\n * @param {T} compare\n * @return {function(T):boolean}\n * @template T\n */\nshaka.util.Functional.isNotEqualFunc = function(compare) {\n return function(a) { return a != compare; };\n};\n\n\n/**\n * Used to filter out duplicates in an array.\n * Returns true the first time the element is encountered. Returns false\n * for all the subsequent encounters.\n *\n * @param {T} item\n * @param {number} position\n * @param {!Array.<T>} self\n * @return {boolean}\n * @template T\n * @example [1, 1, 2].filter(shaka.util.Functional.isNotDuplicate) -> [1, 2]\n */\nshaka.util.Functional.isNotDuplicate = function(item, position, self) {\n return self.indexOf(item) == position;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/functional.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.ManifestParserUtils');\n\ngoog.require('goog.Uri');\ngoog.require('shaka.util.Functional');\n\n\n/**\n * @namespace shaka.util.ManifestParserUtils\n * @summary Utility functions for manifest parsing.\n */\n\n\n/**\n * Resolves an array of relative URIs to the given base URIs. This will result\n * in M*N number of URIs.\n *\n * @param {!Array.<string>} baseUris\n * @param {!Array.<string>} relativeUris\n * @return {!Array.<string>}\n */\nshaka.util.ManifestParserUtils.resolveUris = function(baseUris, relativeUris) {\n var Functional = shaka.util.Functional;\n if (relativeUris.length == 0)\n return baseUris;\n\n var relativeAsGoog =\n relativeUris.map(function(uri) { return new goog.Uri(uri); });\n // Resolve each URI relative to each base URI, creating an Array of Arrays.\n // Then flatten the Arrays into a single Array.\n return baseUris.map(function(uri) { return new goog.Uri(uri); })\n .map(function(base) { return relativeAsGoog.map(base.resolve.bind(base)); })\n .reduce(Functional.collapseArrays, [])\n .map(function(uri) { return uri.toString(); });\n};\n\n\n/**\n * Creates a DrmInfo object from the given info.\n *\n * @param {string} keySystem\n * @param {Array.<shakaExtern.InitDataOverride>} initData\n * @return {shakaExtern.DrmInfo}\n */\nshaka.util.ManifestParserUtils.createDrmInfo = function(keySystem, initData) {\n return {\n keySystem: keySystem,\n licenseServerUri: '',\n distinctiveIdentifierRequired: false,\n persistentStateRequired: false,\n audioRobustness: '',\n videoRobustness: '',\n serverCertificate: null,\n initData: initData || [],\n keyIds: []\n };\n};\n\n\n/**\n * @enum {string}\n */\nshaka.util.ManifestParserUtils.ContentType = {\n VIDEO: 'video',\n AUDIO: 'audio',\n TEXT: 'text',\n APPLICATION: 'application'\n};\n\n\n/**\n * @enum {string}\n */\nshaka.util.ManifestParserUtils.TextStreamKind = {\n SUBTITLE: 'subtitle',\n CLOSED_CAPTION: 'caption'\n};\n\n\n/**\n * Specifies how tolerant the player is to inaccurate segment start times and\n * end times within a manifest. For example, gaps or overlaps between segments\n * in a SegmentTimeline which are greater than or equal to this value will\n * result in a warning message.\n *\n * @const {number}\n */\nshaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS = 1 / 15;\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/manifest_parser_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.ConfigUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\n\n\n/**\n * @param {!Object} destination\n * @param {!Object} source\n * @param {!Object} template supplies default values\n * @param {!Object} overrides\n * Supplies override type checking. When the current path matches the key in\n * this object, each sub-value must match the type in this object. If this\n * contains an Object, it is used as the template.\n * @param {string} path to this part of the config\n */\nshaka.util.ConfigUtils.mergeConfigObjects =\n function(destination, source, template, overrides, path) {\n goog.asserts.assert(destination, 'Destination config must not be null!');\n\n /**\n * @type {boolean}\n * If true, don't validate the keys in the next level.\n */\n var ignoreKeys = path in overrides;\n\n for (var k in source) {\n var subPath = path + '.' + k;\n var subTemplate = ignoreKeys ? overrides[path] : template[k];\n\n /**\n * @type {boolean}\n * If true, simply copy the object over and don't verify.\n */\n var copyObject = !!({\n '.abr.manager': true\n })[subPath] || !!({\n 'serverCertificate': true\n })[k];\n\n // The order of these checks is important.\n if (!ignoreKeys && !(k in destination)) {\n shaka.log.error('Invalid config, unrecognized key ' + subPath);\n } else if (source[k] === undefined) {\n // An explicit 'undefined' value causes the key to be deleted from the\n // destination config and replaced with a default from the template if\n // possible.\n if (subTemplate === undefined || ignoreKeys) {\n delete destination[k];\n } else {\n destination[k] = subTemplate;\n }\n } else if (copyObject) {\n destination[k] = source[k];\n } else if (typeof destination[k] == 'object' &&\n typeof source[k] == 'object') {\n shaka.util.ConfigUtils.mergeConfigObjects(\n destination[k], source[k], subTemplate, overrides, subPath);\n } else if (typeof source[k] != typeof subTemplate) {\n shaka.log.error('Invalid config, wrong type for ' + subPath);\n } else if (typeof destination[k] == 'function' &&\n destination[k].length != source[k].length) {\n shaka.log.warning(\n 'Invalid config, wrong number of arguments for ' + subPath);\n destination[k] = source[k];\n } else {\n destination[k] = source[k];\n }\n }\n};\n\n\n/**\n * Performs a deep clone of the given simple object. This does not copy\n * prototypes, custom properties (e.g. read-only), or multiple references to\n * the same object. This uses JSON to clone.\n *\n * @template T\n * @param {T} arg\n * @return {T}\n */\nshaka.util.ConfigUtils.cloneObject = function(arg) {\n return JSON.parse(JSON.stringify(arg));\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/config_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.PublicPromise');\n\n\n\n/**\n * A utility to create Promises with convenient public resolve and reject\n * methods.\n *\n * @constructor\n * @struct\n * @extends {Promise.<T>}\n * @return {Promise.<T>}\n * @template T\n */\nshaka.util.PublicPromise = function() {\n var resolvePromise;\n var rejectPromise;\n\n // Promise.call causes an error. It seems that inheriting from a native\n // Promise is not permitted by JavaScript interpreters.\n\n // The work-around is to construct a Promise object, modify it to look like\n // the compiler's picture of PublicPromise, then return it. The caller of\n // new PublicPromise will receive |promise| instead of |this|, and the\n // compiler will be aware of the additional properties |resolve| and\n // |reject|.\n\n var promise = new Promise(function(resolve, reject) {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n\n promise.resolve = resolvePromise;\n promise.reject = rejectPromise;\n\n return promise;\n};\n\n\n/** @type {function(T=)} */\nshaka.util.PublicPromise.prototype.resolve;\n\n\n/** @type {function(*=)} */\nshaka.util.PublicPromise.prototype.reject;\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/public_promise.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.net.NetworkingEngine');\n\ngoog.require('goog.Uri');\ngoog.require('goog.asserts');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * NetworkingEngine wraps all networking operations. This accepts plugins that\n * handle the actual request. A plugin is registered using registerScheme.\n * Each scheme has at most one plugin to handle the request.\n *\n * @param {function(number, number)=} opt_onSegmentDownloaded Called\n * when a segment is downloaded. Passed the duration, in milliseconds, that\n * the request took; and the total number of bytes transferred.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n * @export\n */\nshaka.net.NetworkingEngine = function(opt_onSegmentDownloaded) {\n /** @private {boolean} */\n this.destroyed_ = false;\n\n /** @private {!Array.<!Promise>} */\n this.requests_ = [];\n\n /** @private {!Array.<shakaExtern.RequestFilter>} */\n this.requestFilters_ = [];\n\n /** @private {!Array.<shakaExtern.ResponseFilter>} */\n this.responseFilters_ = [];\n\n /** @private {?function(number, number)} */\n this.onSegmentDownloaded_ = opt_onSegmentDownloaded || null;\n};\n\n\n/**\n * Request types. Allows a filter to decide which requests to read/alter.\n *\n * @enum {number}\n * @export\n */\nshaka.net.NetworkingEngine.RequestType = {\n 'MANIFEST': 0,\n 'SEGMENT': 1,\n 'LICENSE': 2,\n 'APP': 3\n};\n\n\n/**\n * Contains the scheme plugins.\n *\n * @private {!Object.<string, ?shakaExtern.SchemePlugin>}\n */\nshaka.net.NetworkingEngine.schemes_ = {};\n\n\n/**\n * Registers a scheme plugin. This plugin will handle all requests with the\n * given scheme. If a plugin with the same scheme already exists, it is\n * replaced.\n *\n * @param {string} scheme\n * @param {shakaExtern.SchemePlugin} plugin\n * @export\n */\nshaka.net.NetworkingEngine.registerScheme = function(scheme, plugin) {\n shaka.net.NetworkingEngine.schemes_[scheme] = plugin;\n};\n\n\n/**\n * Removes a scheme plugin.\n *\n * @param {string} scheme\n * @export\n */\nshaka.net.NetworkingEngine.unregisterScheme = function(scheme) {\n delete shaka.net.NetworkingEngine.schemes_[scheme];\n};\n\n\n/**\n * Registers a new request filter. All filters are applied in the order they\n * are registered.\n *\n * @param {shakaExtern.RequestFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.registerRequestFilter = function(filter) {\n this.requestFilters_.push(filter);\n};\n\n\n/**\n * Removes a request filter.\n *\n * @param {shakaExtern.RequestFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.unregisterRequestFilter =\n function(filter) {\n var filters = this.requestFilters_;\n var i = filters.indexOf(filter);\n if (i >= 0) {\n filters.splice(i, 1);\n }\n};\n\n\n/**\n * Clear all request filters.\n *\n * @export\n */\nshaka.net.NetworkingEngine.prototype.clearAllRequestFilters = function() {\n this.requestFilters_ = [];\n};\n\n\n/**\n * Registers a new response filter. All filters are applied in the order they\n * are registered.\n *\n * @param {shakaExtern.ResponseFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.registerResponseFilter = function(filter) {\n this.responseFilters_.push(filter);\n};\n\n\n/**\n * Removes a response filter.\n *\n * @param {shakaExtern.ResponseFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.unregisterResponseFilter =\n function(filter) {\n var filters = this.responseFilters_;\n var i = filters.indexOf(filter);\n if (i >= 0) {\n filters.splice(i, 1);\n }\n};\n\n\n/**\n * Clear all response filters.\n *\n * @export\n */\nshaka.net.NetworkingEngine.prototype.clearAllResponseFilters = function() {\n this.responseFilters_ = [];\n};\n\n\n/**\n * Gets a copy of the default retry parameters.\n *\n * @return {shakaExtern.RetryParameters}\n */\nshaka.net.NetworkingEngine.defaultRetryParameters = function() {\n // Use a function rather than a constant member so the calling code can\n // modify the values without affecting other call results.\n return {\n maxAttempts: 2,\n baseDelay: 1000,\n backoffFactor: 2,\n fuzzFactor: 0.5,\n timeout: 0\n };\n};\n\n\n/**\n * Makes a simple network request for the given URIs.\n *\n * @param {!Array.<string>} uris\n * @param {shakaExtern.RetryParameters} retryParams\n * @return {shakaExtern.Request}\n */\nshaka.net.NetworkingEngine.makeRequest = function(\n uris, retryParams) {\n return {\n uris: uris,\n method: 'GET',\n body: null,\n headers: {},\n allowCrossSiteCredentials: false,\n retryParameters: retryParams\n };\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.net.NetworkingEngine.prototype.destroy = function() {\n var Functional = shaka.util.Functional;\n this.destroyed_ = true;\n this.requestFilters_ = [];\n this.responseFilters_ = [];\n\n var cleanup = [];\n for (var i = 0; i < this.requests_.length; ++i) {\n cleanup.push(this.requests_[i].catch(Functional.noop));\n }\n return Promise.all(cleanup);\n};\n\n\n/**\n * Makes a network request and returns the resulting data.\n *\n * @param {shaka.net.NetworkingEngine.RequestType} type\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.net.NetworkingEngine.prototype.request = function(type, request) {\n var cloneObject = shaka.util.ConfigUtils.cloneObject;\n\n // New requests made after destroy is called are rejected.\n if (this.destroyed_)\n return Promise.reject();\n\n goog.asserts.assert(request.uris && request.uris.length,\n 'Request without URIs!');\n\n // If a request comes from outside the library, some parameters may be left\n // undefined. To make it easier for application developers, we will fill them\n // in with defaults if necessary.\n //\n // We clone retryParameters and uris so that if a filter modifies the request,\n // then it doesn't contaminate future requests.\n request.method = request.method || 'GET';\n request.headers = request.headers || {};\n request.retryParameters = request.retryParameters ?\n cloneObject(request.retryParameters) :\n shaka.net.NetworkingEngine.defaultRetryParameters();\n request.uris = cloneObject(request.uris);\n\n var filterStartMs = Date.now();\n\n // Send to the filter first, in-case they change the URI.\n var p = Promise.resolve();\n this.requestFilters_.forEach(function(requestFilter) {\n // Request filters are resolved sequentially.\n p = p.then(requestFilter.bind(null, type, request));\n });\n\n // Catch any errors thrown by request filters, and substitute\n // them with a Shaka-native error.\n p = p.catch(function(e) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.REQUEST_FILTER_ERROR, e);\n });\n\n // Send out the request, and get a response.\n // The entire code is inside a then clause; thus, if a filter\n // rejects or errors, the networking engine will never send.\n p = p.then(function() {\n var filterTimeMs = (Date.now() - filterStartMs);\n\n var retry = request.retryParameters || {};\n var maxAttempts = retry.maxAttempts || 1;\n var backoffFactor = retry.backoffFactor || 2.0;\n var delay = (retry.baseDelay == null ? 1000 : retry.baseDelay);\n\n var p = this.send_(type, request, 0, filterTimeMs);\n for (var i = 1; i < maxAttempts; i++) {\n var index = i % request.uris.length;\n p = p.catch(function(delay, index, err) {\n if (err && err.severity == shaka.util.Error.Severity.RECOVERABLE)\n return this.resend_(type, request, delay, index, filterTimeMs);\n throw err;\n }.bind(this, delay, index));\n delay *= backoffFactor;\n }\n\n return p;\n }.bind(this));\n\n // Add the request to the array.\n this.requests_.push(p);\n return p.then(function(response) {\n if (this.requests_.indexOf(p) >= 0) {\n this.requests_.splice(this.requests_.indexOf(p), 1);\n }\n if (this.onSegmentDownloaded_ && !response.fromCache &&\n type == shaka.net.NetworkingEngine.RequestType.SEGMENT) {\n this.onSegmentDownloaded_(response.timeMs, response.data.byteLength);\n }\n return response;\n }.bind(this)).catch(function(e) {\n // Ignore if using |Promise.reject()| to signal destroy.\n if (e) {\n goog.asserts.assert(e instanceof shaka.util.Error, 'Wrong error type');\n e.severity = shaka.util.Error.Severity.CRITICAL;\n }\n\n if (this.requests_.indexOf(p) >= 0) {\n this.requests_.splice(this.requests_.indexOf(p), 1);\n }\n return Promise.reject(e);\n }.bind(this));\n};\n\n\n/**\n * Sends the given request to the correct plugin. This does not handle retry.\n *\n * @param {shaka.net.NetworkingEngine.RequestType} type\n * @param {shakaExtern.Request} request\n * @param {number} index\n * @param {number} requestFilterTime\n * @return {!Promise.<shakaExtern.Response>}\n * @private\n */\nshaka.net.NetworkingEngine.prototype.send_ = function(\n type, request, index, requestFilterTime) {\n // Retries sent after destroy is called are rejected.\n if (this.destroyed_)\n return Promise.reject();\n\n var uri = new goog.Uri(request.uris[index]);\n var scheme = uri.getScheme();\n\n if (!scheme) {\n // If there is no scheme, infer one from the location.\n scheme = shaka.net.NetworkingEngine.getLocationProtocol_();\n goog.asserts.assert(scheme[scheme.length - 1] == ':',\n 'location.protocol expected to end with a colon!');\n // Drop the colon.\n scheme = scheme.slice(0, -1);\n\n // Override the original URI to make the scheme explicit.\n uri.setScheme(scheme);\n request.uris[index] = uri.toString();\n }\n\n var plugin = shaka.net.NetworkingEngine.schemes_[scheme];\n if (!plugin) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.UNSUPPORTED_SCHEME,\n uri));\n }\n\n var startTimeMs = Date.now();\n return plugin(request.uris[index], request, type).then(function(response) {\n if (response.timeMs == undefined)\n response.timeMs = Date.now() - startTimeMs;\n var filterStartMs = Date.now();\n\n var p = Promise.resolve();\n this.responseFilters_.forEach(function(responseFilter) {\n // Response filters are resolved sequentially.\n p = p.then(function() {\n return Promise.resolve(responseFilter(type, response));\n }.bind(this));\n });\n\n // Catch any errors thrown by response filters, and substitute\n // them with a Shaka-native error.\n p = p.catch(function(e) {\n var severity = shaka.util.Error.Severity.CRITICAL;\n if (e instanceof shaka.util.Error)\n severity = e.severity;\n\n throw new shaka.util.Error(\n severity,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.RESPONSE_FILTER_ERROR, e);\n });\n\n return p.then(function() {\n response.timeMs += Date.now() - filterStartMs;\n response.timeMs += requestFilterTime;\n\n return response;\n });\n }.bind(this));\n};\n\n\n/**\n * Resends the request after applying a delay. This does not handle retry.\n *\n * @param {shaka.net.NetworkingEngine.RequestType} type\n * @param {shakaExtern.Request} request\n * @param {number} delayMs The current base delay.\n * @param {number} index\n * @param {number} requestFilterTime\n * @return {!Promise.<shakaExtern.Response>}\n * @private\n */\nshaka.net.NetworkingEngine.prototype.resend_ =\n function(type, request, delayMs, index, requestFilterTime) {\n var p = new shaka.util.PublicPromise();\n\n // Fuzz the delay to avoid tons of clients hitting the server at once\n // after it recovers from whatever is causing it to fail.\n var retry = request.retryParameters || {};\n var fuzzFactor = (retry.fuzzFactor == null ? 0.5 : retry.fuzzFactor);\n var negToPosOne = (Math.random() * 2.0) - 1.0;\n var negToPosFuzzFactor = negToPosOne * fuzzFactor;\n var fuzzedDelay = delayMs * (1.0 + negToPosFuzzFactor);\n shaka.net.NetworkingEngine.setTimeout_(p.resolve, fuzzedDelay);\n\n return p.then(this.send_.bind(this, type, request, index, requestFilterTime));\n};\n\n\n/**\n * This is here only for testability. We can't mock location in our tests on\n * all browsers, so instead we mock this.\n *\n * @return {string} The value of location.protocol.\n * @private\n */\nshaka.net.NetworkingEngine.getLocationProtocol_ = function() {\n return location.protocol;\n};\n\n\n/**\n * This is here only for testability. Mocking global setTimeout can lead to\n * unintended interactions with other tests. So instead, we mock this.\n *\n * @param {Function} fn The callback to invoke when the timeout expires.\n * @param {number} timeoutMs The timeout in milliseconds.\n * @return {number} The timeout ID.\n * @private\n */\nshaka.net.NetworkingEngine.setTimeout_ = function(fn, timeoutMs) {\n return window.setTimeout(fn, timeoutMs);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/net/networking_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.ArrayUtils');\n\n\n/**\n * @namespace shaka.util.ArrayUtils\n * @summary Array utility functions.\n */\n\n\n/**\n * Remove duplicate entries from an array. Order N^2, so use with caution.\n * @param {!Array.<T>} array\n * @param {function(T, T): boolean=} opt_compareFn An optional function which\n * will be used to compare items in the array.\n * @return {!Array.<T>}\n * @template T\n */\nshaka.util.ArrayUtils.removeDuplicates = function(array, opt_compareFn) {\n var result = [];\n for (var i = 0; i < array.length; ++i) {\n var matchFound = false;\n for (var j = 0; j < result.length; ++j) {\n matchFound = opt_compareFn ? opt_compareFn(array[i], result[j]) :\n array[i] === result[j];\n if (matchFound) break;\n }\n if (!matchFound) {\n result.push(array[i]);\n }\n }\n return result;\n};\n\n\n/**\n * Find an item in an array. For use when comparison of entries via == will\n * not suffice.\n * @param {!Array.<T>} array\n * @param {T} value\n * @param {function(T, T): boolean} compareFn A function which will be used to\n * compare items in the array.\n * @return {number} The index, or -1 if not found.\n * @template T\n */\nshaka.util.ArrayUtils.indexOf = function(array, value, compareFn) {\n for (var i = 0; i < array.length; ++i) {\n if (compareFn(array[i], value)) {\n return i;\n }\n }\n return -1;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/array_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.MultiMap');\n\n\n\n/**\n * A simple multimap template.\n * @constructor\n * @struct\n * @template T\n */\nshaka.util.MultiMap = function() {\n /** @private {!Object.<string, !Array.<T>>} */\n this.map_ = {};\n};\n\n\n/**\n * Add a key, value pair to the map.\n * @param {string} key\n * @param {T} value\n */\nshaka.util.MultiMap.prototype.push = function(key, value) {\n if (this.map_.hasOwnProperty(key)) {\n this.map_[key].push(value);\n } else {\n this.map_[key] = [value];\n }\n};\n\n\n/**\n * Get a list of values by key.\n * @param {string} key\n * @return {Array.<T>} or null if no such key exists.\n */\nshaka.util.MultiMap.prototype.get = function(key) {\n var list = this.map_[key];\n // slice() clones the list so that it and the map can each be modified\n // without affecting the other.\n return list ? list.slice() : null;\n};\n\n\n/**\n * Get a list of all values.\n * @return {!Array.<T>}\n */\nshaka.util.MultiMap.prototype.getAll = function() {\n var list = [];\n for (var key in this.map_) {\n list.push.apply(list, this.map_[key]);\n }\n return list;\n};\n\n\n/**\n * Remove a specific value, if it exists.\n * @param {string} key\n * @param {T} value\n */\nshaka.util.MultiMap.prototype.remove = function(key, value) {\n var list = this.map_[key];\n if (!list) return;\n for (var i = 0; i < list.length; ++i) {\n if (list[i] == value) {\n list.splice(i, 1);\n --i;\n }\n }\n};\n\n\n/**\n * Clear all keys and values from the multimap.\n */\nshaka.util.MultiMap.prototype.clear = function() {\n this.map_ = {};\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/multi_map.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.EventManager');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.MultiMap');\n\n\n\n/**\n * Creates a new EventManager. An EventManager maintains a collection of \"event\n * bindings\" between event targets and event listeners.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n */\nshaka.util.EventManager = function() {\n /**\n * Maps an event type to an array of event bindings.\n * @private {shaka.util.MultiMap.<!shaka.util.EventManager.Binding_>}\n */\n this.bindingMap_ = new shaka.util.MultiMap();\n};\n\n\n/**\n * @typedef {function(!Event)}\n */\nshaka.util.EventManager.ListenerType;\n\n\n/**\n * Detaches all event listeners.\n * @override\n */\nshaka.util.EventManager.prototype.destroy = function() {\n this.removeAll();\n this.bindingMap_ = null;\n return Promise.resolve();\n};\n\n\n/**\n * Attaches an event listener to an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {shaka.util.EventManager.ListenerType} listener The event listener.\n */\nshaka.util.EventManager.prototype.listen = function(target, type, listener) {\n if (!this.bindingMap_) return;\n\n var binding = new shaka.util.EventManager.Binding_(target, type, listener);\n this.bindingMap_.push(type, binding);\n};\n\n\n/**\n * Attaches an event listener to an event target. The listener will be removed\n * when the first instance of the event is fired.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {shaka.util.EventManager.ListenerType} listener The event listener.\n */\nshaka.util.EventManager.prototype.listenOnce =\n function(target, type, listener) {\n // Install a shim listener that will stop listening after the first event.\n this.listen(target, type, function(event) {\n // Stop listening to this event.\n this.unlisten(target, type);\n // Call the original listener.\n listener(event);\n }.bind(this));\n};\n\n\n/**\n * Detaches an event listener from an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n */\nshaka.util.EventManager.prototype.unlisten = function(target, type) {\n if (!this.bindingMap_) return;\n\n var list = this.bindingMap_.get(type) || [];\n\n for (var i = 0; i < list.length; ++i) {\n var binding = list[i];\n\n if (binding.target == target) {\n binding.unlisten();\n this.bindingMap_.remove(type, binding);\n }\n }\n};\n\n\n/**\n * Detaches all event listeners from all targets.\n */\nshaka.util.EventManager.prototype.removeAll = function() {\n if (!this.bindingMap_) return;\n\n var list = this.bindingMap_.getAll();\n\n for (var i = 0; i < list.length; ++i) {\n list[i].unlisten();\n }\n\n this.bindingMap_.clear();\n};\n\n\n\n/**\n * Creates a new Binding_ and attaches the event listener to the event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {shaka.util.EventManager.ListenerType} listener The event listener.\n * @constructor\n * @private\n */\nshaka.util.EventManager.Binding_ = function(target, type, listener) {\n /** @type {EventTarget} */\n this.target = target;\n\n /** @type {string} */\n this.type = type;\n\n /** @type {?shaka.util.EventManager.ListenerType} */\n this.listener = listener;\n\n this.target.addEventListener(type, listener, false);\n};\n\n\n/**\n * Detaches the event listener from the event target. This does nothing if the\n * event listener is already detached.\n */\nshaka.util.EventManager.Binding_.prototype.unlisten = function() {\n goog.asserts.assert(this.target, 'Missing target');\n this.target.removeEventListener(this.type, this.listener, false);\n\n this.target = null;\n this.listener = null;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/event_manager.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.MapUtils');\n\n\n/**\n * @namespace shaka.util.MapUtils\n * @summary A set of map/object utility functions.\n */\n\n\n/**\n * Returns true if the map is empty; otherwise, returns false.\n *\n * @param {Object.<KEY, VALUE>} object\n * @return {boolean}\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.empty = function(object) {\n return !object || Object.keys(object).length == 0;\n};\n\n\n/**\n * Gets the map's values.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @return {!Array.<VALUE>}\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.values = function(object) {\n return Object.keys(object).map(function(key) { return object[key]; });\n};\n\n\n/**\n * Converts the values in the given Map to a different value.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @param {function(VALUE, KEY=):OUTPUT} callback\n * @return {!Object.<KEY, OUTPUT>}\n * @template KEY,VALUE,OUTPUT\n */\nshaka.util.MapUtils.map = function(object, callback) {\n return Object.keys(object).reduce(function(ret, key) {\n var value = object[key];\n ret[key] = callback(value, key);\n return ret;\n }, {});\n};\n\n\n/**\n * Returns true if every entry matches the predicate.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @param {function(KEY, VALUE):boolean} callback\n * @return {boolean}\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.every = function(object, callback) {\n return Object.keys(object).every(function(key) {\n return callback(key, object[key]);\n });\n};\n\n\n/**\n * Invokes the callback for each entry in the map.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @param {function(KEY, VALUE)} callback\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.forEach = function(object, callback) {\n Object.keys(object).forEach(function(key) {\n callback(key, object[key]);\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/map_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.StringUtils');\n\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\n\n\n/**\n * @namespace shaka.util.StringUtils\n * @summary A set of string utility functions.\n * @exportDoc\n */\n\n\n/**\n * Creates a string from the given buffer as UTF-8 encoding.\n *\n * @param {?BufferSource} data\n * @return {string}\n * @throws {shaka.util.Error}\n * @export\n */\nshaka.util.StringUtils.fromUTF8 = function(data) {\n if (!data) return '';\n\n var uint8 = new Uint8Array(data);\n // If present, strip off the UTF-8 BOM.\n if (uint8[0] == 0xef && uint8[1] == 0xbb && uint8[2] == 0xbf) {\n uint8 = uint8.subarray(3);\n }\n\n // http://stackoverflow.com/a/13691499\n var utf8 = shaka.util.StringUtils.fromCharCode_(uint8);\n // This converts each character in the string to an escape sequence. If the\n // character is in the ASCII range, it is not converted; otherwise it is\n // converted to a URI escape sequence.\n // Example: '\\x67\\x35\\xe3\\x82\\xac' -> 'g#%E3%82%AC'\n var escaped = escape(utf8);\n // Decode the escaped sequence. This will interpret UTF-8 sequences into the\n // correct character.\n // Example: 'g#%E3%82%AC' -> 'g#€'\n try {\n return decodeURIComponent(escaped);\n } catch (e) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.BAD_ENCODING);\n }\n};\n\n\n/**\n * Creates a string from the given buffer as UTF-16 encoding.\n *\n * @param {?BufferSource} data\n * @param {boolean} littleEndian true to read little endian, false to read big.\n * @param {boolean=} opt_noThrow true to avoid throwing in cases where we may\n * expect invalid input. If noThrow is true and the data has an odd length,\n * it will be truncated.\n * @return {string}\n * @throws {shaka.util.Error}\n * @export\n */\nshaka.util.StringUtils.fromUTF16 = function(data, littleEndian, opt_noThrow) {\n if (!data) return '';\n\n if (!opt_noThrow && data.byteLength % 2 != 0) {\n shaka.log.error('Data has an incorrect length, must be even.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.BAD_ENCODING);\n }\n\n /** @type {ArrayBuffer} */\n var buffer;\n if (data instanceof ArrayBuffer) {\n buffer = data;\n } else {\n // Have to create a new buffer because the argument may be a smaller\n // view on a larger ArrayBuffer. We cannot use an ArrayBufferView in\n // a DataView.\n var temp = new Uint8Array(data.byteLength);\n temp.set(new Uint8Array(data));\n buffer = temp.buffer;\n }\n\n // Use a DataView to ensure correct endianness.\n var length = Math.floor(data.byteLength / 2);\n var arr = new Uint16Array(length);\n var dataView = new DataView(buffer);\n for (var i = 0; i < length; i++) {\n arr[i] = dataView.getUint16(i * 2, littleEndian);\n }\n return shaka.util.StringUtils.fromCharCode_(arr);\n};\n\n\n/**\n * Creates a string from the given buffer, auto-detecting the encoding that is\n * being used. If it cannot detect the encoding, it will throw an exception.\n *\n * @param {?BufferSource} data\n * @return {string}\n * @throws {shaka.util.Error}\n * @export\n */\nshaka.util.StringUtils.fromBytesAutoDetect = function(data) {\n var StringUtils = shaka.util.StringUtils;\n\n var uint8 = new Uint8Array(data);\n if (uint8[0] == 0xef && uint8[1] == 0xbb && uint8[2] == 0xbf)\n return StringUtils.fromUTF8(uint8);\n else if (uint8[0] == 0xfe && uint8[1] == 0xff)\n return StringUtils.fromUTF16(uint8.subarray(2), false /* littleEndian */);\n else if (uint8[0] == 0xff && uint8[1] == 0xfe)\n return StringUtils.fromUTF16(uint8.subarray(2), true /* littleEndian */);\n\n var isAscii = (function(arr, i) {\n // arr[i] >= ' ' && arr[i] <= '~';\n return arr.byteLength <= i || (arr[i] >= 0x20 && arr[i] <= 0x7e);\n }.bind(null, uint8));\n\n shaka.log.debug('Unable to find byte-order-mark, making an educated guess.');\n if (uint8[0] == 0 && uint8[2] == 0)\n return StringUtils.fromUTF16(data, false /* littleEndian */);\n else if (uint8[1] == 0 && uint8[3] == 0)\n return StringUtils.fromUTF16(data, true /* littleEndian */);\n else if (isAscii(0) && isAscii(1) && isAscii(2) && isAscii(3))\n return StringUtils.fromUTF8(data);\n\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.UNABLE_TO_DETECT_ENCODING);\n};\n\n\n/**\n * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.\n *\n * @param {string} str\n * @return {!ArrayBuffer}\n * @export\n */\nshaka.util.StringUtils.toUTF8 = function(str) {\n // http://stackoverflow.com/a/13691499\n // Converts the given string to a URI encoded string. If a character falls\n // in the ASCII range, it is not converted; otherwise it will be converted to\n // a series of URI escape sequences according to UTF-8.\n // Example: 'g#€' -> 'g#%E3%82%AC'\n var encoded = encodeURIComponent(str);\n // Convert each escape sequence individually into a character. Each escape\n // sequence is interpreted as a code-point, so if an escape sequence happens\n // to be part of a multi-byte sequence, each byte will be converted to a\n // single character.\n // Example: 'g#%E3%82%AC' -> '\\x67\\x35\\xe3\\x82\\xac'\n var utf8 = unescape(encoded);\n\n var result = new Uint8Array(utf8.length);\n for (var i = 0; i < utf8.length; ++i) {\n result[i] = utf8.charCodeAt(i);\n }\n return result.buffer;\n};\n\n\n/**\n * Creates a new string from the given array of char codes.\n *\n * @param {!TypedArray} args\n * @return {string}\n * @private\n */\nshaka.util.StringUtils.fromCharCode_ = function(args) {\n var max = 16000;\n var ret = '';\n for (var i = 0; i < args.length; i += max) {\n var subArray = args.subarray(i, i + max);\n ret += String.fromCharCode.apply(null, subArray);\n }\n\n return ret;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/string_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Timer');\n\n\n\n/**\n * A simple cancelable timer.\n * @param {Function} callback\n * @constructor\n * @struct\n */\nshaka.util.Timer = function(callback) {\n /** @private {?number} */\n this.id_ = null;\n\n /** @private {Function} */\n this.callback_ = (function() {\n this.id_ = null;\n callback();\n }.bind(this));\n};\n\n\n/**\n * Cancel the timer, if it's running.\n */\nshaka.util.Timer.prototype.cancel = function() {\n if (this.id_ != null) {\n clearTimeout(this.id_);\n this.id_ = null;\n }\n};\n\n\n/**\n * Schedule the timer, canceling any previous scheduling.\n * @param {number} seconds\n */\nshaka.util.Timer.prototype.schedule = function(seconds) {\n this.cancel();\n this.id_ = setTimeout(this.callback_, seconds * 1000);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/timer.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * @namespace shaka.util.Uint8ArrayUtils\n * @summary A set of Uint8Array utility functions.\n * @exportDoc\n */\n\n\n/**\n * Convert a Uint8Array to a base64 string. The output will always use the\n * alternate encoding/alphabet also known as \"base64url\".\n * @param {!Uint8Array} arr\n * @param {boolean=} opt_padding If true, pad the output with equals signs.\n * Defaults to true.\n * @return {string}\n * @export\n */\nshaka.util.Uint8ArrayUtils.toBase64 = function(arr, opt_padding) {\n // btoa expects a \"raw string\" where each character is interpreted as a byte.\n var bytes = String.fromCharCode.apply(null, arr);\n var padding = (opt_padding == undefined) ? true : opt_padding;\n var base64 = window.btoa(bytes).replace(/\\+/g, '-').replace(/\\//g, '_');\n return padding ? base64 : base64.replace(/=*$/, '');\n};\n\n\n/**\n * Convert a base64 string to a Uint8Array. Accepts either the standard\n * alphabet or the alternate \"base64url\" alphabet.\n * @param {string} str\n * @return {!Uint8Array}\n * @export\n */\nshaka.util.Uint8ArrayUtils.fromBase64 = function(str) {\n // atob creates a \"raw string\" where each character is interpreted as a byte.\n var bytes = window.atob(str.replace(/-/g, '+').replace(/_/g, '/'));\n var result = new Uint8Array(bytes.length);\n for (var i = 0; i < bytes.length; ++i) {\n result[i] = bytes.charCodeAt(i);\n }\n return result;\n};\n\n\n/**\n * Convert a hex string to a Uint8Array.\n * @param {string} str\n * @return {!Uint8Array}\n * @export\n */\nshaka.util.Uint8ArrayUtils.fromHex = function(str) {\n var arr = new Uint8Array(str.length / 2);\n for (var i = 0; i < str.length; i += 2) {\n arr[i / 2] = window.parseInt(str.substr(i, 2), 16);\n }\n return arr;\n};\n\n\n/**\n * Convert a Uint8Array to a hex string.\n * @param {!Uint8Array} arr\n * @return {string}\n * @export\n */\nshaka.util.Uint8ArrayUtils.toHex = function(arr) {\n var hex = '';\n for (var i = 0; i < arr.length; ++i) {\n var value = arr[i].toString(16);\n if (value.length == 1) value = '0' + value;\n hex += value;\n }\n return hex;\n};\n\n\n/**\n * Compare two Uint8Arrays for equality.\n * @param {Uint8Array} arr1\n * @param {Uint8Array} arr2\n * @return {boolean}\n * @export\n */\nshaka.util.Uint8ArrayUtils.equal = function(arr1, arr2) {\n if (!arr1 && !arr2) return true;\n if (!arr1 || !arr2) return false;\n if (arr1.length != arr2.length) return false;\n for (var i = 0; i < arr1.length; ++i) {\n if (arr1[i] != arr2[i]) return false;\n }\n return true;\n};\n\n\n/**\n * Concatenate Uint8Arrays.\n * @param {...Uint8Array} var_args\n * @return {Uint8Array}\n * @export\n */\nshaka.util.Uint8ArrayUtils.concat = function(var_args) {\n var totalLength = 0;\n for (var i = 0; i < arguments.length; ++i) {\n totalLength += arguments[i].length;\n }\n\n var result = new Uint8Array(totalLength);\n var offset = 0;\n for (var i = 0; i < arguments.length; ++i) {\n result.set(arguments[i], offset);\n offset += arguments[i].length;\n }\n return result;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/uint8array_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.DrmEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.ArrayUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.Timer');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n\n/**\n * @constructor\n * @param {!shaka.net.NetworkingEngine} networkingEngine\n * @param {function(!shaka.util.Error)} onError Called when an error occurs.\n * @param {function(!Object.<string, string>)} onKeyStatus Called when key\n * status changes. Argument is a map of hex key IDs to statuses.\n * @param {function(string, number)} onExpirationUpdated\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.DrmEngine = function(\n networkingEngine, onError, onKeyStatus, onExpirationUpdated) {\n /** @private {Array.<string>} */\n this.supportedTypes_ = null;\n\n /** @private {MediaKeys} */\n this.mediaKeys_ = null;\n\n /** @private {HTMLMediaElement} */\n this.video_ = null;\n\n /** @private {boolean} */\n this.initialized_ = false;\n\n /** @private {?shakaExtern.DrmInfo} */\n this.currentDrmInfo_ = null;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {!Array.<shaka.media.DrmEngine.ActiveSession>} */\n this.activeSessions_ = [];\n\n /** @private {!Array.<string>} */\n this.offlineSessionIds_ = [];\n\n /** @private {!shaka.util.PublicPromise} */\n this.allSessionsLoaded_ = new shaka.util.PublicPromise();\n\n /** @private {shaka.net.NetworkingEngine} */\n this.networkingEngine_ = networkingEngine;\n\n /** @private {?shakaExtern.DrmConfiguration} */\n this.config_ = null;\n\n /** @private {?function(!shaka.util.Error)} */\n this.onError_ = (function(err) {\n this.allSessionsLoaded_.reject(err);\n onError(err);\n }.bind(this));\n\n /** @private {!Object.<string, string>} */\n this.keyStatusByKeyId_ = {};\n\n /** @private {?function(!Object.<string, string>)} */\n this.onKeyStatus_ = onKeyStatus;\n\n /** @private {?function(string, number)} */\n this.onExpirationUpdated_ = onExpirationUpdated;\n\n /** @private {shaka.util.Timer} */\n this.keyStatusTimer_ = new shaka.util.Timer(\n this.processKeyStatusChanges_.bind(this));\n\n /** @private {boolean} */\n this.destroyed_ = false;\n\n /** @private {boolean} */\n this.isOffline_ = false;\n\n /** @private {!Array.<!MediaKeyMessageEvent>} */\n this.mediaKeyMessageEvents_ = [];\n\n /** @private {boolean} */\n this.initialRequestsSent_ = false;\n\n /** @private {?number} */\n this.expirationInterval_ = setInterval(this.pollExpiration_.bind(this), 1000);\n\n // Add a catch to the Promise to avoid console logs about uncaught errors.\n this.allSessionsLoaded_.catch(function() {});\n};\n\n\n/**\n * @typedef {{\n * loaded: boolean,\n * initData: Uint8Array,\n * session: !MediaKeySession,\n * oldExpiration: number,\n * updatePromise: shaka.util.PublicPromise\n * }}\n *\n * @description A record to track sessions and suppress duplicate init data.\n * @property {boolean} loaded\n * True once the key status has been updated (to a non-pending state). This\n * does not mean the session is 'usable'.\n * @property {Uint8Array} initData\n * The init data used to create the session.\n * @property {!MediaKeySession} session\n * The session object.\n * @property {number} oldExpiration\n * The expiration of the session on the last check. This is used to fire\n * an event when it changes.\n * @property {shaka.util.PublicPromise} updatePromise\n * An optional Promise that will be resolved/rejected on the next update()\n * call. This is used to track the 'license-release' message when calling\n * remove().\n */\nshaka.media.DrmEngine.ActiveSession;\n\n\n/** @override */\nshaka.media.DrmEngine.prototype.destroy = function() {\n var Functional = shaka.util.Functional;\n this.destroyed_ = true;\n\n var async = this.activeSessions_.map(function(activeSession) {\n // Ignore any errors when closing the sessions. One such error would be\n // an invalid state error triggered by closing a session which has not\n // generated any key requests.\n // Chrome sometimes returns |undefined|: https://crbug.com/690664\n var p = activeSession.session.close() || Promise.resolve();\n return p.catch(Functional.noop);\n });\n this.allSessionsLoaded_.reject();\n\n if (this.eventManager_)\n async.push(this.eventManager_.destroy());\n\n if (this.video_) {\n goog.asserts.assert(!this.video_.src, 'video src must be removed first!');\n async.push(this.video_.setMediaKeys(null).catch(Functional.noop));\n }\n\n if (this.expirationInterval_) {\n clearInterval(this.expirationInterval_);\n this.expirationInterval_ = null;\n }\n\n if (this.keyStatusTimer_) {\n this.keyStatusTimer_.cancel();\n }\n this.keyStatusTimer_ = null;\n\n this.currentDrmInfo_ = null;\n this.supportedTypes_ = null;\n this.mediaKeys_ = null;\n this.video_ = null;\n this.eventManager_ = null;\n this.activeSessions_ = [];\n this.offlineSessionIds_ = [];\n this.networkingEngine_ = null; // We don't own it, don't destroy() it.\n this.config_ = null;\n this.onError_ = null;\n this.onExpirationUpdated_ = null;\n\n return Promise.all(async);\n};\n\n\n/**\n * Called by the Player to provide an updated configuration any time it changes.\n * Must be called at least once before init().\n *\n * @param {shakaExtern.DrmConfiguration} config\n */\nshaka.media.DrmEngine.prototype.configure = function(config) {\n this.config_ = config;\n};\n\n\n/**\n * Negotiate for a key system and set up MediaKeys.\n * @param {!shakaExtern.Manifest} manifest The manifest is read for MIME type\n * and DRM information to query EME. If the 'clearKeys' configuration is\n * used, the manifest will be modified to force the use of Clear Key.\n * @param {boolean} offline True if we are storing or loading offline content.\n * @return {!Promise} Resolved if/when a key system has been chosen.\n */\nshaka.media.DrmEngine.prototype.init = function(manifest, offline) {\n goog.asserts.assert(this.config_,\n 'DrmEngine configure() must be called before init()!');\n\n /** @type {!Object.<string, MediaKeySystemConfiguration>} */\n var configsByKeySystem = {};\n\n /** @type {!Array.<string>} */\n var keySystemsInOrder = [];\n\n // |isOffline_| determines what kind of session to create. The argument to\n // |prepareMediaKeyConfigs_| determines the kind of CDM to query for. So\n // we still need persistent state when we are loading offline sessions.\n this.isOffline_ = offline;\n this.offlineSessionIds_ = manifest.offlineSessionIds;\n this.prepareMediaKeyConfigs_(\n manifest, offline || manifest.offlineSessionIds.length > 0,\n configsByKeySystem, keySystemsInOrder);\n\n if (!keySystemsInOrder.length) {\n // Unencrypted.\n this.initialized_ = true;\n return Promise.resolve();\n }\n\n return this.queryMediaKeys_(configsByKeySystem, keySystemsInOrder);\n};\n\n\n/**\n * Attach MediaKeys to the video element and start processing events.\n * @param {HTMLMediaElement} video\n * @return {!Promise}\n */\nshaka.media.DrmEngine.prototype.attach = function(video) {\n if (!this.mediaKeys_) {\n // Unencrypted, or so we think. We listen for encrypted events in order to\n // warn when the stream is encrypted, even though the manifest does not know\n // it.\n // Don't complain about this twice, so just listenOnce().\n this.eventManager_.listenOnce(video, 'encrypted', function(event) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.ENCRYPTED_CONTENT_WITHOUT_DRM_INFO));\n }.bind(this));\n return Promise.resolve();\n }\n\n this.video_ = video;\n\n this.eventManager_.listenOnce(this.video_, 'play', this.onPlay_.bind(this));\n\n var setMediaKeys = this.video_.setMediaKeys(this.mediaKeys_);\n setMediaKeys = setMediaKeys.catch(function(exception) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_ATTACH_TO_VIDEO,\n exception.message));\n });\n\n var setServerCertificate = null;\n if (this.currentDrmInfo_.serverCertificate) {\n setServerCertificate = this.mediaKeys_.setServerCertificate(\n this.currentDrmInfo_.serverCertificate).then(function(supported) {\n if (!supported) {\n shaka.log.warning('Server certificates are not supported by the key' +\n ' system. The server certificate has been ignored.');\n }\n }).catch(function(exception) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.INVALID_SERVER_CERTIFICATE,\n exception.message));\n });\n }\n\n return Promise.all([setMediaKeys, setServerCertificate]).then(function() {\n if (this.destroyed_) return Promise.reject();\n\n this.createOrLoad();\n if (!this.currentDrmInfo_.initData.length &&\n !this.offlineSessionIds_.length) {\n // Explicit init data for any one stream or an offline session is\n // sufficient to suppress 'encrypted' events for all streams.\n var onEncrypted = /** @type {shaka.util.EventManager.ListenerType} */(\n this.onEncrypted_.bind(this));\n this.eventManager_.listen(this.video_, 'encrypted', onEncrypted);\n }\n }.bind(this)).catch(function(error) {\n if (this.destroyed_) return Promise.resolve(); // Ignore destruction errors\n return Promise.reject(error);\n }.bind(this));\n};\n\n\n/**\n * Removes the given offline sessions and deletes their data. Must call init()\n * before this. This will wait until the 'license-release' message is handled\n * and the resulting Promise will be rejected if there is an error with that.\n *\n * @param {!Array.<string>} sessions\n * @return {!Promise}\n */\nshaka.media.DrmEngine.prototype.removeSessions = function(sessions) {\n goog.asserts.assert(this.mediaKeys_ || !sessions.length,\n 'Must call init() before removeSessions');\n return Promise.all(sessions.map(function(sessionId) {\n return this.loadOfflineSession_(sessionId).then(function(session) {\n // This will be null on error, such as session not found.\n if (session) {\n var p = new shaka.util.PublicPromise();\n // TODO: Consider adding a timeout to get the 'message' event.\n // Note that the 'message' event will get raised after the remove()\n // promise resolves.\n\n for (var i = 0; i < this.activeSessions_.length; i++) {\n if (this.activeSessions_[i].session == session) {\n this.activeSessions_[i].updatePromise = p;\n break;\n }\n }\n return Promise.all([session.remove(), p]);\n }\n }.bind(this));\n }.bind(this)));\n};\n\n\n/**\n * Creates the sessions for the init data and waits for them to become ready.\n *\n * @return {!Promise}\n */\nshaka.media.DrmEngine.prototype.createOrLoad = function() {\n var initDatas = this.currentDrmInfo_ ? this.currentDrmInfo_.initData : [];\n initDatas.forEach(function(initDataOverride) {\n this.createTemporarySession_(\n initDataOverride.initDataType, initDataOverride.initData);\n }.bind(this));\n this.offlineSessionIds_.forEach(function(sessionId) {\n this.loadOfflineSession_(sessionId);\n }.bind(this));\n\n if (!initDatas.length && !this.offlineSessionIds_.length)\n this.allSessionsLoaded_.resolve();\n return this.allSessionsLoaded_;\n};\n\n\n/** @return {boolean} */\nshaka.media.DrmEngine.prototype.initialized = function() {\n return this.initialized_;\n};\n\n\n/** @return {string} */\nshaka.media.DrmEngine.prototype.keySystem = function() {\n return this.currentDrmInfo_ ? this.currentDrmInfo_.keySystem : '';\n};\n\n\n/**\n * Returns an array of the media types supported by the current key system.\n * These will be full mime types (e.g. 'video/webm; codecs=\"vp8\"').\n *\n * @return {Array.<string>}\n */\nshaka.media.DrmEngine.prototype.getSupportedTypes = function() {\n return this.supportedTypes_;\n};\n\n\n/**\n * Returns the ID of the sessions currently active.\n *\n * @return {!Array.<string>}\n */\nshaka.media.DrmEngine.prototype.getSessionIds = function() {\n return this.activeSessions_.map(function(session) {\n return session.session.sessionId;\n });\n};\n\n\n/**\n * Returns the next expiration time, or Infinity.\n * @return {number}\n */\nshaka.media.DrmEngine.prototype.getExpiration = function() {\n var expirations = this.activeSessions_.map(function(session) {\n var expiration = session.session.expiration;\n return isNaN(expiration) ? Infinity : expiration;\n });\n // This will equal Infinity if there are no entries.\n return Math.min.apply(Math, expirations);\n};\n\n\n/**\n * Returns the DrmInfo that was used to initialize the current key system.\n *\n * @return {?shakaExtern.DrmInfo}\n */\nshaka.media.DrmEngine.prototype.getDrmInfo = function() {\n return this.currentDrmInfo_;\n};\n\n\n/**\n * @param {!shakaExtern.Manifest} manifest\n * @param {boolean} offline True if we are storing or loading offline content.\n * @param {!Object.<string, MediaKeySystemConfiguration>} configsByKeySystem\n * (Output parameter.) A dictionary of configs, indexed by key system.\n * @param {!Array.<string>} keySystemsInOrder\n * (Output parameter.) A list of key systems in the order in which we\n * encounter them.\n * @see https://goo.gl/nwdYnY for MediaKeySystemConfiguration spec\n * @private\n */\nshaka.media.DrmEngine.prototype.prepareMediaKeyConfigs_ =\n function(manifest, offline, configsByKeySystem, keySystemsInOrder) {\n var clearKeyDrmInfo = this.configureClearKey_();\n\n manifest.periods.forEach(function(period) {\n period.variants.forEach(function(variant) {\n // clearKey config overrides manifest DrmInfo if present.\n // The manifest is modified so that filtering in Player still works.\n if (clearKeyDrmInfo) {\n variant.drmInfos = [clearKeyDrmInfo];\n }\n\n variant.drmInfos.forEach(function(drmInfo) {\n this.fillInDrmInfoDefaults_(drmInfo);\n\n // Chromecast has a variant of PlayReady that uses a different key\n // system ID. Since manifest parsers convert the standard PlayReady\n // UUID to the standard PlayReady key system ID, here we will switch\n // to the Chromecast version if we are running on that platform.\n // Note that this must come after fillInDrmInfoDefaults_, since the\n // player config uses the standard PlayReady ID for license server\n // configuration.\n if (window.cast && window.cast.__platform__) {\n if (drmInfo.keySystem == 'com.microsoft.playready') {\n drmInfo.keySystem = 'com.chromecast.playready';\n }\n }\n\n var config = configsByKeySystem[drmInfo.keySystem];\n if (!config) {\n config = {\n // ignore initDataTypes\n audioCapabilities: [],\n videoCapabilities: [],\n distinctiveIdentifier: 'optional',\n persistentState: offline ? 'required' : 'optional',\n sessionTypes: [offline ? 'persistent-license' : 'temporary'],\n label: drmInfo.keySystem,\n drmInfos: [] // tracked by us, ignored by EME\n };\n configsByKeySystem[drmInfo.keySystem] = config;\n keySystemsInOrder.push(drmInfo.keySystem);\n }\n\n config.drmInfos.push(drmInfo);\n\n if (drmInfo.distinctiveIdentifierRequired)\n config.distinctiveIdentifier = 'required';\n\n if (drmInfo.persistentStateRequired)\n config.persistentState = 'required';\n\n var streams = [];\n if (variant.video) streams.push(variant.video);\n if (variant.audio) streams.push(variant.audio);\n\n streams.forEach(function(stream) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n /** @type {!Array.<!MediaKeySystemMediaCapability>} */\n var capabilities = (stream.type == ContentType.VIDEO) ?\n config.videoCapabilities : config.audioCapabilities;\n /** @type {string} */\n var robustness = ((stream.type == ContentType.VIDEO) ?\n drmInfo.videoRobustness : drmInfo.audioRobustness) || '';\n\n var fullMimeType = stream.mimeType;\n if (stream.codecs) {\n fullMimeType += '; codecs=\"' + stream.codecs + '\"';\n }\n\n capabilities.push({\n robustness: robustness,\n contentType: fullMimeType\n });\n }.bind(this)); // streams.forEach (variant.video, variant.audio)\n }.bind(this)); // variant.drmInfos.forEach\n }.bind(this)); // periods.variants.forEach\n }.bind(this)); // manifest.perios.forEach\n};\n\n\n/**\n * @param {!Object.<string, MediaKeySystemConfiguration>} configsByKeySystem\n * A dictionary of configs, indexed by key system.\n * @param {!Array.<string>} keySystemsInOrder\n * A list of key systems in the order in which we should query them.\n * On a browser which supports multiple key systems, the order may indicate\n * a real preference for the application.\n * @return {!Promise} Resolved if/when a key system has been chosen.\n * @private\n */\nshaka.media.DrmEngine.prototype.queryMediaKeys_ =\n function(configsByKeySystem, keySystemsInOrder) {\n if (keySystemsInOrder.length == 1 && keySystemsInOrder[0] == '') {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.NO_RECOGNIZED_KEY_SYSTEMS));\n }\n\n // Wait to reject this initial Promise until we have built the entire chain.\n var instigator = new shaka.util.PublicPromise();\n var p = instigator;\n\n // Try key systems with configured license servers first. We only have to try\n // key systems without configured license servers for diagnostic reasons, so\n // that we can differentiate between \"none of these key systems are available\"\n // and \"some are available, but you did not configure them properly.\" The\n // former takes precedence.\n [true, false].forEach(function(shouldHaveLicenseServer) {\n keySystemsInOrder.forEach(function(keySystem) {\n var config = configsByKeySystem[keySystem];\n\n var hasLicenseServer = config.drmInfos.some(function(info) {\n return !!info.licenseServerUri;\n });\n if (hasLicenseServer != shouldHaveLicenseServer) return;\n\n // If there are no tracks of a type, these should be not present.\n // Otherwise the query will fail.\n if (config.audioCapabilities.length == 0) {\n delete config.audioCapabilities;\n }\n if (config.videoCapabilities.length == 0) {\n delete config.videoCapabilities;\n }\n\n p = p.catch(function() {\n if (this.destroyed_) return Promise.reject();\n return navigator.requestMediaKeySystemAccess(keySystem, [config]);\n }.bind(this));\n }.bind(this));\n }.bind(this));\n\n p = p.catch(function() {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE));\n });\n\n p = p.then(function(mediaKeySystemAccess) {\n if (this.destroyed_) return Promise.reject();\n\n // TODO: Remove once Edge has released a fix for https://goo.gl/qMeV7v\n var isEdge = navigator.userAgent.indexOf('Edge/') >= 0;\n\n // Store the capabilities of the key system.\n var realConfig = mediaKeySystemAccess.getConfiguration();\n var audioCaps = realConfig.audioCapabilities || [];\n var videoCaps = realConfig.videoCapabilities || [];\n var caps = audioCaps.concat(videoCaps);\n this.supportedTypes_ = caps.map(function(c) { return c.contentType; });\n if (isEdge) {\n // Edge 14 does not report correct capabilities. It will only report the\n // first MIME type even if the others are supported. To work around this,\n // set the supported types to null, which Player will use as a signal that\n // the information is not available.\n // See: https://goo.gl/qMeV7v\n this.supportedTypes_ = null;\n }\n goog.asserts.assert(!this.supportedTypes_ || this.supportedTypes_.length,\n 'We should get at least one supported MIME type');\n\n var originalConfig = configsByKeySystem[mediaKeySystemAccess.keySystem];\n this.createCurrentDrmInfo_(\n mediaKeySystemAccess.keySystem, originalConfig,\n originalConfig.drmInfos);\n\n if (!this.currentDrmInfo_.licenseServerUri) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.NO_LICENSE_SERVER_GIVEN));\n }\n\n return mediaKeySystemAccess.createMediaKeys();\n }.bind(this)).then(function(mediaKeys) {\n if (this.destroyed_) return Promise.reject();\n\n this.mediaKeys_ = mediaKeys;\n this.initialized_ = true;\n }.bind(this)).catch(function(exception) {\n if (this.destroyed_) return Promise.resolve(); // Ignore destruction errors\n\n // Don't rewrap a shaka.util.Error from earlier in the chain:\n this.currentDrmInfo_ = null;\n this.supportedTypes_ = null;\n if (exception instanceof shaka.util.Error) {\n return Promise.reject(exception);\n }\n\n // We failed to create MediaKeys. This generally shouldn't happen.\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_CDM,\n exception.message));\n }.bind(this));\n\n instigator.reject();\n return p;\n};\n\n\n/**\n * Use this.config_ to fill in missing values in drmInfo.\n * @param {shakaExtern.DrmInfo} drmInfo\n * @private\n */\nshaka.media.DrmEngine.prototype.fillInDrmInfoDefaults_ = function(drmInfo) {\n var keySystem = drmInfo.keySystem;\n\n if (!keySystem) {\n // This is a placeholder from the manifest parser for an unrecognized key\n // system. Skip this entry, to avoid logging nonsensical errors.\n return;\n }\n\n if (!drmInfo.licenseServerUri) {\n var server = this.config_.servers[keySystem];\n if (server) {\n drmInfo.licenseServerUri = server;\n } else {\n shaka.log.error('No license server configured for ' + keySystem);\n }\n }\n\n if (!drmInfo.keyIds) {\n drmInfo.keyIds = [];\n }\n\n var advanced = this.config_.advanced[keySystem];\n if (advanced) {\n if (!drmInfo.distinctiveIdentifierRequired) {\n drmInfo.distinctiveIdentifierRequired =\n advanced.distinctiveIdentifierRequired;\n }\n\n if (!drmInfo.persistentStateRequired) {\n drmInfo.persistentStateRequired = advanced.persistentStateRequired;\n }\n\n if (!drmInfo.videoRobustness) {\n drmInfo.videoRobustness = advanced.videoRobustness;\n }\n\n if (!drmInfo.audioRobustness) {\n drmInfo.audioRobustness = advanced.audioRobustness;\n }\n\n if (!drmInfo.serverCertificate) {\n drmInfo.serverCertificate = advanced.serverCertificate;\n }\n }\n};\n\n\n/**\n * Create a DrmInfo using configured clear keys.\n * The server URI will be a data URI which decodes to a clearkey license.\n * @return {?shakaExtern.DrmInfo} or null if clear keys are not configured.\n * @private\n * @see https://goo.gl/6nPdhF for the spec on the clearkey license format.\n */\nshaka.media.DrmEngine.prototype.configureClearKey_ = function() {\n var hasClearKeys = !shaka.util.MapUtils.empty(this.config_.clearKeys);\n if (!hasClearKeys) return null;\n\n var StringUtils = shaka.util.StringUtils;\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n var keys = [];\n var keyIds = [];\n\n for (var keyIdHex in this.config_.clearKeys) {\n var keyHex = this.config_.clearKeys[keyIdHex];\n\n var keyId = Uint8ArrayUtils.fromHex(keyIdHex);\n var key = Uint8ArrayUtils.fromHex(keyHex);\n var keyObj = {\n kty: 'oct',\n kid: Uint8ArrayUtils.toBase64(keyId, false),\n k: Uint8ArrayUtils.toBase64(key, false)\n };\n\n keys.push(keyObj);\n keyIds.push(keyObj.kid);\n }\n\n var jwkSet = {keys: keys};\n var license = JSON.stringify(jwkSet);\n\n // Use the keyids init data since is suggested by EME.\n // Suggestion: https://goo.gl/R72xp4\n // Format: https://goo.gl/75RCP6\n var initDataStr = JSON.stringify({'kids': keyIds});\n var initData = new Uint8Array(StringUtils.toUTF8(initDataStr));\n var initDatas = [{initData: initData, initDataType: 'keyids'}];\n\n return {\n keySystem: 'org.w3.clearkey',\n licenseServerUri: 'data:application/json;base64,' + window.btoa(license),\n distinctiveIdentifierRequired: false,\n persistentStateRequired: false,\n audioRobustness: '',\n videoRobustness: '',\n serverCertificate: null,\n initData: initDatas,\n keyIds: []\n };\n};\n\n\n/**\n * Creates a DrmInfo object describing the settings used to initialize the\n * engine.\n *\n * @param {string} keySystem\n * @param {MediaKeySystemConfiguration} config\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @private\n */\nshaka.media.DrmEngine.prototype.createCurrentDrmInfo_ = function(\n keySystem, config, drmInfos) {\n /** @type {!Array.<string>} */\n var licenseServers = [];\n\n /** @type {!Array.<!Uint8Array>} */\n var serverCerts = [];\n\n /** @type {!Array.<!shakaExtern.InitDataOverride>} */\n var initDatas = [];\n\n /** @type {!Array.<string>} */\n var keyIds = [];\n\n this.processDrmInfos_(drmInfos, licenseServers, serverCerts, initDatas,\n keyIds);\n\n if (serverCerts.length > 1) {\n shaka.log.warning('Multiple unique server certificates found! ' +\n 'Only the first will be used.');\n }\n\n if (licenseServers.length > 1) {\n shaka.log.warning('Multiple unique license server URIs found! ' +\n 'Only the first will be used.');\n }\n\n // TODO: This only works when all DrmInfo have the same robustness.\n var audioRobustness =\n config.audioCapabilities ? config.audioCapabilities[0].robustness : '';\n var videoRobustness =\n config.videoCapabilities ? config.videoCapabilities[0].robustness : '';\n this.currentDrmInfo_ = {\n keySystem: keySystem,\n licenseServerUri: licenseServers[0],\n distinctiveIdentifierRequired: (config.distinctiveIdentifier == 'required'),\n persistentStateRequired: (config.persistentState == 'required'),\n audioRobustness: audioRobustness,\n videoRobustness: videoRobustness,\n serverCertificate: serverCerts[0],\n initData: initDatas,\n keyIds: keyIds\n };\n};\n\n\n/**\n * Extract license server, server cert, and init data from DrmInfos, taking\n * care to eliminate duplicates.\n *\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @param {!Array.<string>} licenseServers\n * @param {!Array.<!Uint8Array>} serverCerts\n * @param {!Array.<!shakaExtern.InitDataOverride>} initDatas\n * @param {!Array.<string>} keyIds\n * @private\n */\nshaka.media.DrmEngine.prototype.processDrmInfos_ =\n function(drmInfos, licenseServers, serverCerts, initDatas, keyIds) {\n /**\n * @param {shakaExtern.InitDataOverride} a\n * @param {shakaExtern.InitDataOverride} b\n * @return {boolean}\n */\n function initDataOverrideEqual(a, b) {\n if (a.keyId && a.keyId == b.keyId) {\n // Two initDatas with the same keyId are considered to be the same,\n // unless that \"same keyId\" is null.\n return true;\n }\n return a.initDataType == b.initDataType &&\n shaka.util.Uint8ArrayUtils.equal(a.initData, b.initData);\n }\n\n drmInfos.forEach(function(drmInfo) {\n // Aliases:\n var ArrayUtils = shaka.util.ArrayUtils;\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n\n // Build an array of unique license servers.\n if (licenseServers.indexOf(drmInfo.licenseServerUri) == -1) {\n licenseServers.push(drmInfo.licenseServerUri);\n }\n\n // Build an array of unique server certs.\n if (drmInfo.serverCertificate) {\n if (ArrayUtils.indexOf(serverCerts, drmInfo.serverCertificate,\n Uint8ArrayUtils.equal) == -1) {\n serverCerts.push(drmInfo.serverCertificate);\n }\n }\n\n // Build an array of unique init datas.\n if (drmInfo.initData) {\n drmInfo.initData.forEach(function(initDataOverride) {\n if (ArrayUtils.indexOf(initDatas, initDataOverride,\n initDataOverrideEqual) == -1) {\n initDatas.push(initDataOverride);\n }\n });\n }\n\n if (drmInfo.keyIds) {\n for (var i = 0; i < drmInfo.keyIds.length; ++i) {\n if (keyIds.indexOf(drmInfo.keyIds[i]) == -1) {\n keyIds.push(drmInfo.keyIds[i]);\n }\n }\n }\n });\n};\n\n\n/**\n * @param {!MediaEncryptedEvent} event\n * @private\n */\nshaka.media.DrmEngine.prototype.onEncrypted_ = function(event) {\n // Aliases:\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n\n var initData = new Uint8Array(event.initData);\n\n // Suppress duplicate init data.\n // Note that some init data are extremely large and can't portably be used as\n // keys in a dictionary.\n for (var i = 0; i < this.activeSessions_.length; ++i) {\n if (Uint8ArrayUtils.equal(initData, this.activeSessions_[i].initData)) {\n shaka.log.debug('Ignoring duplicate init data.');\n return;\n }\n }\n\n this.createTemporarySession_(event.initDataType, initData);\n};\n\n\n/**\n * @param {string} sessionId\n * @return {!Promise.<MediaKeySession>}\n * @private\n */\nshaka.media.DrmEngine.prototype.loadOfflineSession_ = function(sessionId) {\n var session;\n try {\n session = this.mediaKeys_.createSession('persistent-license');\n } catch (exception) {\n var error = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_SESSION,\n exception.message);\n this.onError_(error);\n return Promise.reject(error);\n }\n\n this.eventManager_.listen(session, 'message',\n /** @type {shaka.util.EventManager.ListenerType} */(\n this.onSessionMessage_.bind(this)));\n this.eventManager_.listen(session, 'keystatuseschange',\n this.onKeyStatusesChange_.bind(this));\n\n var activeSession = {\n initData: null,\n session: session,\n loaded: false,\n oldExpiration: Infinity,\n updatePromise: null\n };\n this.activeSessions_.push(activeSession);\n\n return session.load(sessionId).then(function(present) {\n if (this.destroyed_) return;\n\n if (!present) {\n var i = this.activeSessions_.indexOf(activeSession);\n goog.asserts.assert(i >= 0, 'Session must be in the array');\n this.activeSessions_.splice(i, 1);\n\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.OFFLINE_SESSION_REMOVED));\n return;\n }\n\n // TODO: We should get a key status change event. Remove once Chrome CDM\n // is fixed.\n activeSession.loaded = true;\n if (this.activeSessions_.every(function(s) { return s.loaded; }))\n this.allSessionsLoaded_.resolve();\n\n return session;\n }.bind(this), function(error) {\n if (this.destroyed_) return;\n\n var i = this.activeSessions_.indexOf(activeSession);\n goog.asserts.assert(i >= 0, 'Session must be in the array');\n this.activeSessions_.splice(i, 1);\n\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_SESSION,\n error.message));\n }.bind(this));\n};\n\n\n/**\n * @param {string} initDataType\n * @param {!Uint8Array} initData\n * @private\n */\nshaka.media.DrmEngine.prototype.createTemporarySession_ =\n function(initDataType, initData) {\n var session;\n try {\n if (this.isOffline_) {\n session = this.mediaKeys_.createSession('persistent-license');\n } else {\n session = this.mediaKeys_.createSession();\n }\n } catch (exception) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_SESSION,\n exception.message));\n return;\n }\n\n this.eventManager_.listen(session, 'message',\n /** @type {shaka.util.EventManager.ListenerType} */(\n this.onSessionMessage_.bind(this)));\n this.eventManager_.listen(session, 'keystatuseschange',\n this.onKeyStatusesChange_.bind(this));\n this.activeSessions_.push({\n initData: initData,\n session: session,\n loaded: false,\n oldExpiration: Infinity,\n updatePromise: null\n });\n\n session.generateRequest(initDataType, initData.buffer).catch(function(error) {\n if (this.destroyed_) return;\n\n for (var i = 0; i < this.activeSessions_.length; ++i) {\n if (this.activeSessions_[i].session == session) {\n this.activeSessions_.splice(i, 1);\n break;\n }\n }\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_GENERATE_LICENSE_REQUEST,\n error.message));\n }.bind(this));\n};\n\n\n/**\n * @param {!MediaKeyMessageEvent} event\n * @private\n */\nshaka.media.DrmEngine.prototype.onSessionMessage_ = function(event) {\n if (this.delayLicenseRequest_())\n this.mediaKeyMessageEvents_.push(event);\n else\n this.sendLicenseRequest_(event);\n};\n\n\n/**\n * @return {boolean}\n * @private\n */\nshaka.media.DrmEngine.prototype.delayLicenseRequest_ = function() {\n return (this.config_.delayLicenseRequestUntilPlayed &&\n this.video_.paused && !this.initialRequestsSent_);\n};\n\n\n/**\n * Sends a license request.\n * @param {!MediaKeyMessageEvent} event\n * @private\n */\nshaka.media.DrmEngine.prototype.sendLicenseRequest_ = function(event) {\n /** @type {!MediaKeySession} */\n var session = event.target;\n\n var updatePromise;\n for (var i = 0; i < this.activeSessions_.length; i++) {\n if (this.activeSessions_[i].session == session) {\n updatePromise = this.activeSessions_[i].updatePromise;\n break;\n }\n }\n\n var requestType = shaka.net.NetworkingEngine.RequestType.LICENSE;\n var request = shaka.net.NetworkingEngine.makeRequest(\n [this.currentDrmInfo_.licenseServerUri], this.config_.retryParameters);\n request.body = event.message;\n request.method = 'POST';\n // NOTE: allowCrossSiteCredentials can be set in a request filter.\n\n if (this.currentDrmInfo_.keySystem == 'com.microsoft.playready' ||\n this.currentDrmInfo_.keySystem == 'com.chromecast.playready') {\n this.unpackPlayReadyRequest_(request);\n }\n\n this.networkingEngine_.request(requestType, request)\n .then(function(response) {\n if (this.destroyed_) return Promise.reject();\n\n // Request succeeded, now pass the response to the CDM.\n return session.update(response.data).then(function() {\n if (updatePromise)\n updatePromise.resolve();\n });\n }.bind(this), function(error) {\n // Ignore destruction errors\n if (this.destroyed_) return Promise.resolve();\n\n // Request failed!\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong NetworkingEngine error type!');\n var shakaErr = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.LICENSE_REQUEST_FAILED,\n error);\n this.onError_(shakaErr);\n if (updatePromise)\n updatePromise.reject(shakaErr);\n }.bind(this)).catch(function(error) {\n // Ignore destruction errors\n if (this.destroyed_) return Promise.resolve();\n\n // Session update failed!\n var shakaErr = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.LICENSE_RESPONSE_REJECTED,\n error.message);\n this.onError_(shakaErr);\n if (updatePromise)\n updatePromise.reject(shakaErr);\n }.bind(this));\n};\n\n\n/**\n * Unpack PlayReady license requests. Modifies the request object.\n * @param {shakaExtern.Request} request\n * @private\n */\nshaka.media.DrmEngine.prototype.unpackPlayReadyRequest_ = function(request) {\n // On IE and Edge, the raw license message is UTF-16-encoded XML. We need to\n // unpack the Challenge element (base64-encoded string containing the actual\n // license request) and any HttpHeader elements (sent as request headers).\n\n // Example XML:\n\n // <PlayReadyKeyMessage type=\"LicenseAcquisition\">\n // <LicenseAcquisition Version=\"1\">\n // <Challenge encoding=\"base64encoded\">{Base64Data}</Challenge>\n // <HttpHeaders>\n // <HttpHeader>\n // <name>Content-Type</name>\n // <value>text/xml; charset=utf-8</value>\n // </HttpHeader>\n // <HttpHeader>\n // <name>SOAPAction</name>\n // <value>http://schemas.microsoft.com/DRM/etc/etc</value>\n // </HttpHeader>\n // </HttpHeaders>\n // </LicenseAcquisition>\n // </PlayReadyKeyMessage>\n\n var xml = shaka.util.StringUtils.fromUTF16(\n request.body, true /* littleEndian */, true /* noThrow */);\n if (xml.indexOf('PlayReadyKeyMessage') == -1) {\n // This does not appear to be a wrapped message as on IE and Edge. Some\n // clients do not need this unwrapping, so we will assume this is one of\n // them. Note that \"xml\" at this point probably looks like random garbage,\n // since we interpreted UTF-8 as UTF-16.\n shaka.log.debug('PlayReady request is already unwrapped.');\n request.headers['Content-Type'] = 'text/xml; charset=utf-8';\n return;\n }\n shaka.log.debug('Unwrapping PlayReady request.');\n var dom = new DOMParser().parseFromString(xml, 'application/xml');\n\n // Set request headers.\n var headers = dom.getElementsByTagName('HttpHeader');\n for (var i = 0; i < headers.length; ++i) {\n var name = headers[i].querySelector('name');\n var value = headers[i].querySelector('value');\n goog.asserts.assert(name && value, 'Malformed PlayReady headers!');\n request.headers[name.textContent] = value.textContent;\n }\n\n // Unpack the base64-encoded challenge.\n var challenge = dom.querySelector('Challenge');\n goog.asserts.assert(challenge, 'Malformed PlayReady challenge!');\n goog.asserts.assert(challenge.getAttribute('encoding') == 'base64encoded',\n 'Unexpected PlayReady challenge encoding!');\n request.body =\n shaka.util.Uint8ArrayUtils.fromBase64(challenge.textContent).buffer;\n};\n\n\n/**\n * @param {!Event} event\n * @private\n * @suppress {invalidCasts} to swap keyId and status\n */\nshaka.media.DrmEngine.prototype.onKeyStatusesChange_ = function(event) {\n var session = /** @type {!MediaKeySession} */(event.target);\n\n // Locate the session in the active sessions list.\n var i;\n for (i = 0; i < this.activeSessions_.length; ++i) {\n if (this.activeSessions_[i].session == session) {\n break;\n }\n }\n goog.asserts.assert(i < this.activeSessions_.length,\n 'Key status change for inactive session!');\n if (i == this.activeSessions_.length) return;\n\n var keyStatusMap = session.keyStatuses;\n var hasExpiredKeys = false;\n\n keyStatusMap.forEach(function(status, keyId) {\n // The spec has changed a few times on the exact order of arguments here.\n // As of 2016-06-30, Edge has the order reversed compared to the current\n // EME spec. Given the back and forth in the spec, it may not be the only\n // one. Try to detect this and compensate:\n if (typeof keyId == 'string') {\n var tmp = keyId;\n keyId = /** @type {ArrayBuffer} */(status);\n status = /** @type {string} */(tmp);\n }\n\n // Microsoft's implementation in Edge seems to present key IDs as\n // little-endian UUIDs, rather than big-endian or just plain array of bytes.\n // standard: 6e 5a 1d 26 - 27 57 - 47 d7 - 80 46 ea a5 d1 d3 4b 5a\n // on Edge: 26 1d 5a 6e - 57 27 - d7 47 - 80 46 ea a5 d1 d3 4b 5a\n // Bug filed: https://goo.gl/gnRSkJ\n\n // NOTE that we skip this if byteLength != 16. This is used for the IE11\n // and Edge 12 EME polyfill, which uses single-byte dummy key IDs.\n if (this.currentDrmInfo_.keySystem == 'com.microsoft.playready' &&\n keyId.byteLength == 16) {\n // Read out some fields in little-endian:\n var dataView = new DataView(keyId);\n var part0 = dataView.getUint32(0, true /* LE */);\n var part1 = dataView.getUint16(4, true /* LE */);\n var part2 = dataView.getUint16(6, true /* LE */);\n // Write it back in big-endian:\n dataView.setUint32(0, part0, false /* BE */);\n dataView.setUint16(4, part1, false /* BE */);\n dataView.setUint16(6, part2, false /* BE */);\n }\n\n // Microsoft's implementation in IE11 and Edge seems to never set key\n // status to 'usable'. It is stuck forever at 'status-pending'. In spite\n // of this, the keys do seem to be usable and content plays correctly.\n // Bug filed: https://goo.gl/fcXEy1\n if (this.currentDrmInfo_.keySystem == 'com.microsoft.playready' &&\n status == 'status-pending') {\n status = 'usable';\n }\n\n if (status != 'status-pending') {\n this.activeSessions_[i].loaded = true;\n if (this.activeSessions_.every(function(s) { return s.loaded; }))\n this.allSessionsLoaded_.resolve();\n }\n\n if (status == 'expired') {\n hasExpiredKeys = true;\n }\n\n var keyIdHex = shaka.util.Uint8ArrayUtils.toHex(new Uint8Array(keyId));\n\n this.keyStatusByKeyId_[keyIdHex] = status;\n }.bind(this));\n\n // If the session has expired, close it.\n // Some CDMs do not have sub-second time resolution, so the key status may\n // fire with hundreds of milliseconds left until the stated expiration time.\n var msUntilExpiration = session.expiration - Date.now();\n if (msUntilExpiration < 0 || (hasExpiredKeys && msUntilExpiration < 1000)) {\n // If this is part of a remove(), we don't want to close the session until\n // the update is complete. Otherwise, we will orphan the session.\n if (!this.activeSessions_[i].updatePromise) {\n shaka.log.debug('Session has expired', session);\n this.activeSessions_.splice(i, 1);\n session.close();\n }\n }\n\n // Batch up key status changes before checking them or notifying Player.\n // This handles cases where the statuses of multiple sessions are set\n // simultaneously by the browser before dispatching key status changes for\n // each of them. By batching these up, we only send one status change event\n // and at most one EXPIRED error on expiration.\n this.keyStatusTimer_.schedule(0.5);\n};\n\n\n/**\n * @private\n */\nshaka.media.DrmEngine.prototype.processKeyStatusChanges_ = function() {\n // If all keys are expired, fire an error.\n function isExpired(keyId, status) {\n return status == 'expired';\n }\n var MapUtils = shaka.util.MapUtils;\n // Note that every() is always true for an empty map,\n // but we shouldn't fire an error for a lack of key status info.\n var allExpired = !MapUtils.empty(this.keyStatusByKeyId_) &&\n MapUtils.every(this.keyStatusByKeyId_, isExpired);\n\n if (allExpired) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.EXPIRED));\n }\n\n this.onKeyStatus_(this.keyStatusByKeyId_);\n};\n\n\n/**\n * Returns true if the browser has recent EME APIs.\n *\n * @return {boolean}\n */\nshaka.media.DrmEngine.isBrowserSupported = function() {\n var basic =\n !!window.MediaKeys &&\n !!window.navigator &&\n !!window.navigator.requestMediaKeySystemAccess &&\n !!window.MediaKeySystemAccess &&\n !!window.MediaKeySystemAccess.prototype.getConfiguration;\n\n return basic;\n};\n\n\n/**\n * Returns a Promise to a map of EME support for well-known key systems.\n *\n * @return {!Promise.<!Object.<string, ?shakaExtern.DrmSupportType>>}\n */\nshaka.media.DrmEngine.probeSupport = function() {\n goog.asserts.assert(shaka.media.DrmEngine.isBrowserSupported(),\n 'Must have basic EME support');\n\n var tests = [];\n var testKeySystems = [\n 'org.w3.clearkey',\n 'com.widevine.alpha',\n 'com.microsoft.playready',\n 'com.apple.fps.2_0',\n 'com.apple.fps.1_0',\n 'com.apple.fps',\n 'com.adobe.primetime'\n ];\n\n var basicVideoCapabilities = [\n { contentType: 'video/mp4; codecs=\"avc1.42E01E\"' },\n { contentType: 'video/webm; codecs=\"vp8\"' }\n ];\n\n var basicConfig = {\n videoCapabilities: basicVideoCapabilities\n };\n var offlineConfig = {\n videoCapabilities: basicVideoCapabilities,\n persistentState: 'required',\n sessionTypes: ['persistent-license']\n };\n\n // Try the offline config first, then fall back to the basic config.\n var configs = [offlineConfig, basicConfig];\n\n var support = {};\n testKeySystems.forEach(function(keySystem) {\n var p = navigator.requestMediaKeySystemAccess(keySystem, configs)\n .then(function(access) {\n // Edge doesn't return supported session types, but current versions\n // do not support persistent-license. If sessionTypes is missing,\n // assume no support for persistent-license.\n // TODO: polyfill Edge to return known supported session types.\n // Edge bug: https://goo.gl/z0URJ0\n // Firefox does return supported session types, but will still let you\n // create a session even if the type is unsupported.\n // Firefox bug: https://goo.gl/lB4H3i\n var sessionTypes = access.getConfiguration().sessionTypes;\n var persistentState = sessionTypes ?\n sessionTypes.indexOf('persistent-license') >= 0 : false;\n support[keySystem] = {persistentState: persistentState};\n return access.createMediaKeys();\n }).catch(function() {\n // Either the request failed or createMediaKeys failed.\n // Either way, write null to the support object.\n support[keySystem] = null;\n });\n tests.push(p);\n });\n\n return Promise.all(tests).then(function() {\n return support;\n });\n};\n\n\n/**\n * @private\n */\nshaka.media.DrmEngine.prototype.onPlay_ = function() {\n for (var i = 0; i < this.mediaKeyMessageEvents_.length; i++) {\n this.sendLicenseRequest_(this.mediaKeyMessageEvents_[i]);\n }\n\n this.initialRequestsSent_ = true;\n this.mediaKeyMessageEvents_ = [];\n};\n\n\n/**\n * Checks if a variant is compatible with the key system.\n * @param {!shakaExtern.Variant} variant\n * @return {boolean}\n**/\nshaka.media.DrmEngine.prototype.isSupportedByKeySystem = function(variant) {\n var keySystem = this.keySystem();\n return variant.drmInfos.length == 0 ||\n variant.drmInfos.some(function(drmInfo) {\n return drmInfo.keySystem == keySystem;\n });\n};\n\n\n/**\n * Checks if two DrmInfos can be decrypted using the\n * same key system. Clear content is considered compatible\n * with every key system.\n *\n * @param {!Array.<!shakaExtern.DrmInfo>} drms1\n * @param {!Array.<!shakaExtern.DrmInfo>} drms2\n * @return {boolean}\n */\nshaka.media.DrmEngine.areDrmCompatible = function(drms1, drms2) {\n if (!drms1.length || !drms2.length) return true;\n\n return shaka.media.DrmEngine.getCommonDrmInfos(\n drms1, drms2).length > 0;\n};\n\n\n/**\n * Returns an array of drm infos that are present in both input arrays.\n * If one of the arrays is empty, returns the other one since clear\n * content is considered compatible with every drm info.\n *\n * @param {!Array.<!shakaExtern.DrmInfo>} drms1\n * @param {!Array.<!shakaExtern.DrmInfo>} drms2\n * @return {!Array.<!shakaExtern.DrmInfo>}\n */\nshaka.media.DrmEngine.getCommonDrmInfos = function(drms1, drms2) {\n if (!drms1.length) return drms2;\n if (!drms2.length) return drms1;\n\n var commonDrms = [];\n\n for (var i = 0; i < drms1.length; i++) {\n for (var j = 0; j < drms2.length; j++) {\n // This method is only called to compare drmInfos of a video\n // and an audio adaptations, so we shouldn't have to worry about\n // checking robustness.\n if (drms1[i].keySystem == drms2[j].keySystem) {\n var drm1 = drms1[i];\n var drm2 = drms2[j];\n var initData = [];\n initData = initData.concat(drm1.initData || []);\n initData = initData.concat(drm2.initData || []);\n var keyIds = [];\n keyIds = keyIds.concat(drm1.keyIds);\n keyIds = keyIds.concat(drm2.keyIds);\n var mergedDrm = {\n keySystem: drm1.keySystem,\n licenseServerUri: drm1.licenseServerUri || drm2.licenseServerUri,\n distinctiveIdentifierRequired: drm1.distinctiveIdentifierRequired ||\n drm2.distinctiveIdentifierRequired,\n persistentStateRequired: drm1.persistentStateRequired ||\n drm2.persistentStateRequired,\n videoRobustness: drm1.videoRobustness || drm2.videoRobustness,\n audioRobustness: drm1.audioRobustness || drm2.audioRobustness,\n serverCertificate: drm1.serverCertificate || drm2.serverCertificate,\n initData: initData,\n keyIds: keyIds\n };\n commonDrms.push(mergedDrm);\n break;\n }\n }\n }\n\n return commonDrms;\n};\n\n\n/**\n * Called in an interval timer to poll the expiration times of the sessions. We\n * don't get an event from EME when the expiration updates, so we poll it so we\n * can fire an event when it happens.\n * @private\n */\nshaka.media.DrmEngine.prototype.pollExpiration_ = function() {\n this.activeSessions_.forEach(function(session) {\n var old = session.oldExpiration;\n var new_ = session.session.expiration;\n if (isNaN(new_))\n new_ = Infinity;\n\n if (new_ != old) {\n this.onExpirationUpdated_(session.session.sessionId, new_);\n session.oldExpiration = new_;\n }\n }.bind(this));\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/drm_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.TextEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.IDestroyable');\n\n\n\n/**\n * Manages text parsers and cues.\n *\n * @struct\n * @constructor\n * @param {TextTrack} track\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.TextEngine = function(track) {\n /** @private {shakaExtern.TextParser} */\n this.parser_ = null;\n\n /** @private {TextTrack} */\n this.track_ = track;\n\n /** @private {number} */\n this.timestampOffset_ = 0;\n\n /** @private {number} */\n this.appendWindowEnd_ = Infinity;\n\n /** @private {?number} */\n this.bufferStart_ = null;\n\n /** @private {?number} */\n this.bufferEnd_ = null;\n};\n\n\n/** @private {!Object.<string, !shakaExtern.TextParserPlugin>} */\nshaka.media.TextEngine.parserMap_ = {};\n\n\n/**\n * @param {string} mimeType\n * @param {!shakaExtern.TextParserPlugin} plugin\n * @export\n */\nshaka.media.TextEngine.registerParser = function(mimeType, plugin) {\n // Assume that if the function is expecting no parameters, it must be\n // a stateful text parser factory. Otherwise, assume that it is a\n // stateless text parser.\n if (plugin.length == 0) {\n shaka.media.TextEngine.parserMap_[mimeType] = plugin;\n } else {\n shaka.log.warning('The use of stateless text parsers is deprecated.');\n shaka.media.TextEngine.parserMap_[mimeType] =\n shaka.media.TextEngine.TextParserWrapper_.bind(null, plugin);\n }\n};\n\n\n/**\n * @param {string} mimeType\n * @export\n */\nshaka.media.TextEngine.unregisterParser = function(mimeType) {\n delete shaka.media.TextEngine.parserMap_[mimeType];\n};\n\n\n/**\n * @param {string} mimeType\n * @return {boolean}\n */\nshaka.media.TextEngine.isTypeSupported = function(mimeType) {\n return !!shaka.media.TextEngine.parserMap_[mimeType];\n};\n\n\n/**\n * Creates a cue using the best platform-specific interface available.\n *\n * @param {number} startTime\n * @param {number} endTime\n * @param {string} payload\n * @return {TextTrackCue} or null if the parameters were invalid.\n * @export\n */\nshaka.media.TextEngine.makeCue = function(startTime, endTime, payload) {\n if (startTime >= endTime) {\n // IE/Edge will throw in this case.\n // See issue #501\n shaka.log.warning('Invalid cue times: ' + startTime + ' - ' + endTime);\n return null;\n }\n\n return new VTTCue(startTime, endTime, payload);\n};\n\n\n/** @override */\nshaka.media.TextEngine.prototype.destroy = function() {\n if (this.track_) {\n this.removeWhere_(function(cue) { return true; });\n }\n\n this.parser_ = null;\n this.track_ = null;\n\n return Promise.resolve();\n};\n\n\n/**\n * Initialize the parser. This can be called multiple times, but must be called\n * at least once before appendBuffer.\n *\n * @param {string} mimeType\n */\nshaka.media.TextEngine.prototype.initParser = function(mimeType) {\n var factory = shaka.media.TextEngine.parserMap_[mimeType];\n goog.asserts.assert(\n factory,\n 'Text type negotiation should have happened already');\n this.parser_ = new factory();\n};\n\n\n/**\n * @param {!ArrayBuffer} buffer\n * @param {?number} startTime\n * @param {?number} endTime\n * @return {!Promise}\n */\nshaka.media.TextEngine.prototype.appendBuffer =\n function(buffer, startTime, endTime) {\n goog.asserts.assert(this.parser_, 'The parser should already be initialized');\n\n // Start the operation asynchronously to avoid blocking the caller.\n return Promise.resolve().then(function() {\n // Check that TextEngine hasn't been destroyed.\n if (!this.track_) return;\n\n if (startTime == null || endTime == null) {\n this.parser_.parseInit(buffer);\n return;\n }\n\n /** @type {shakaExtern.TextParser.TimeContext} **/\n var time = {\n periodStart: this.timestampOffset_,\n segmentStart: startTime,\n segmentEnd: endTime\n };\n\n // Parse the buffer and add the new cues.\n var cues = this.parser_.parseMedia(buffer, time);\n\n for (var i = 0; i < cues.length; ++i) {\n if (cues[i].startTime >= this.appendWindowEnd_) break;\n this.track_.addCue(cues[i]);\n }\n\n // NOTE: We update the buffered range from the start and end times passed\n // down from the segment reference, not with the start and end times of the\n // parsed cues. This is important because some segments may contain no\n // cues, but we must still consider those ranges buffered.\n if (this.bufferStart_ == null) {\n this.bufferStart_ = startTime;\n } else {\n // We already had something in buffer, and we assume we are extending the\n // range from the end.\n goog.asserts.assert((startTime - this.bufferEnd_) <= 1,\n 'There should not be a gap in text references >1s');\n }\n this.bufferEnd_ = Math.min(endTime, this.appendWindowEnd_);\n }.bind(this));\n};\n\n\n/**\n * @param {number} start\n * @param {number} end\n * @return {!Promise}\n */\nshaka.media.TextEngine.prototype.remove = function(start, end) {\n // Start the operation asynchronously to avoid blocking the caller.\n return Promise.resolve().then(function() {\n // Check that TextEngine hasn't been destroyed.\n if (!this.track_) return;\n\n this.removeWhere_(function(cue) {\n if (cue.startTime >= end || cue.endTime <= start) {\n // Outside the remove range. Hang on to it.\n return false;\n }\n return true;\n });\n\n if (this.bufferStart_ == null) {\n goog.asserts.assert(this.bufferEnd_ == null,\n 'end must be null if start is null');\n } else {\n goog.asserts.assert(this.bufferEnd_ != null,\n 'end must be non-null if start is non-null');\n\n // Update buffered range.\n if (end <= this.bufferStart_ || start >= this.bufferEnd_) {\n // No intersection. Nothing was removed.\n } else if (start <= this.bufferStart_ && end >= this.bufferEnd_) {\n // We wiped out everything.\n goog.asserts.assert(\n this.track_.cues.length == 0, 'should be no cues left');\n this.bufferStart_ = this.bufferEnd_ = null;\n } else if (start <= this.bufferStart_ && end < this.bufferEnd_) {\n // We removed from the beginning of the range.\n this.bufferStart_ = end;\n } else if (start > this.bufferStart_ && end >= this.bufferEnd_) {\n // We removed from the end of the range.\n this.bufferEnd_ = start;\n } else {\n // We removed from the middle? StreamingEngine isn't supposed to.\n goog.asserts.assert(\n false, 'removal from the middle is not supported by TextEngine');\n }\n }\n }.bind(this));\n};\n\n\n/** @param {number} timestampOffset */\nshaka.media.TextEngine.prototype.setTimestampOffset =\n function(timestampOffset) {\n this.timestampOffset_ = timestampOffset;\n};\n\n\n/** @param {number} windowEnd */\nshaka.media.TextEngine.prototype.setAppendWindowEnd =\n function(windowEnd) {\n this.appendWindowEnd_ = windowEnd;\n};\n\n\n/**\n * @return {?number} Time in seconds of the beginning of the buffered range,\n * or null if nothing is buffered.\n */\nshaka.media.TextEngine.prototype.bufferStart = function() {\n return this.bufferStart_;\n};\n\n\n/**\n * @return {?number} Time in seconds of the end of the buffered range,\n * or null if nothing is buffered.\n */\nshaka.media.TextEngine.prototype.bufferEnd = function() {\n return this.bufferEnd_;\n};\n\n\n/**\n * @param {number} t A timestamp\n * @return {boolean}\n */\nshaka.media.TextEngine.prototype.isBuffered = function(t) {\n return t >= this.bufferStart_ && t < this.bufferEnd_;\n};\n\n\n/**\n * @param {number} t A timestamp\n * @return {number} Number of seconds ahead of 't' we have buffered\n */\nshaka.media.TextEngine.prototype.bufferedAheadOf = function(t) {\n if (this.bufferEnd_ == null || this.bufferEnd_ < t) return 0;\n\n goog.asserts.assert(\n this.bufferStart_ != null, 'start should not be null if end is not null');\n\n return this.bufferEnd_ - Math.max(t, this.bufferStart_);\n};\n\n\n/**\n * Remove all cues for which the matching function returns true.\n *\n * @param {function(!TextTrackCue):boolean} predicate\n * @private\n */\nshaka.media.TextEngine.prototype.removeWhere_ = function(predicate) {\n var cues = this.track_.cues;\n var removeMe = [];\n\n // Remove these in another loop to avoid mutating the TextTrackCueList\n // while iterating over it. This allows us to avoid making assumptions\n // about whether or not this.track_.remove() will alter that list.\n for (var i = 0; i < cues.length; ++i) {\n if (predicate(cues[i])) {\n removeMe.push(cues[i]);\n }\n }\n\n for (var i = 0; i < removeMe.length; ++i) {\n this.track_.removeCue(removeMe[i]);\n }\n};\n\n\n\n/**\n * @param {Function} parser\n * @constructor\n * @implements {shakaExtern.TextParser}\n * @private\n */\nshaka.media.TextEngine.TextParserWrapper_ = function(parser) {\n this.parser = parser;\n};\n\n\n/** @override **/\nshaka.media.TextEngine.TextParserWrapper_.prototype.parseInit = function(data) {\n this.parser(data, 0, null, null);\n};\n\n\n/** @override **/\nshaka.media.TextEngine.TextParserWrapper_.prototype.parseMedia = function(\n data, time) {\n return this.parser(data,\n time.periodStart,\n time.segmentStart,\n time.segmentEnd);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/text_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.TimeRangesUtils');\n\n\n/**\n * @namespace shaka.media.TimeRangesUtils\n * @summary A set of utility functions for dealing with TimeRanges objects.\n */\n\n\n/**\n * Gets the first timestamp in buffer.\n *\n * @param {TimeRanges} b\n * @return {?number} The first buffered timestamp, in seconds, if |buffered|\n * is non-empty; otherwise, return null.\n */\nshaka.media.TimeRangesUtils.bufferStart = function(b) {\n if (!b) return null;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return null;\n // Workaround Edge bug: https://goo.gl/BtxKgb\n if (b.length == 1 && b.start(0) < 0) return 0;\n return b.length ? b.start(0) : null;\n};\n\n\n/**\n * Gets the last timestamp in buffer.\n *\n * @param {TimeRanges} b\n * @return {?number} The last buffered timestamp, in seconds, if |buffered|\n * is non-empty; otherwise, return null.\n */\nshaka.media.TimeRangesUtils.bufferEnd = function(b) {\n if (!b) return null;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return null;\n return b.length ? b.end(b.length - 1) : null;\n};\n\n\n/**\n * Determines if the given time is inside a buffered range. This includes gaps,\n * meaning if the playhead is in a gap, it is considered buffered.\n *\n * @param {TimeRanges} b\n * @param {number} time\n * @return {boolean}\n */\nshaka.media.TimeRangesUtils.isBuffered = function(b, time) {\n if (!b || !b.length) return false;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return false;\n\n return time >= b.start(0) && time <= b.end(b.length - 1);\n};\n\n\n/**\n * Computes how far ahead of the given timestamp is buffered. To provide smooth\n * playback while jumping gaps, we don't include the gaps when calculating this.\n * This only includes the amount of content that is buffered.\n *\n * @param {TimeRanges} b\n * @param {number} time\n * @return {number} The number of seconds buffered, in seconds, ahead of the\n * given time.\n */\nshaka.media.TimeRangesUtils.bufferedAheadOf = function(b, time) {\n if (!b || !b.length) return 0;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return 0;\n\n // NOTE: On IE11, buffered ranges may show appended data before the associated\n // append operation is complete.\n\n // We calculate buffered amount by ONLY accounting for the content buffered\n // (i.e. we ignore the times of the gaps). We also buffer through all gaps.\n // So start at the end and add up all buffers until |time|.\n var result = 0;\n for (var i = b.length - 1; i >= 0 && b.end(i) > time; --i) {\n result += b.end(i) - Math.max(b.start(i), time);\n }\n\n return result;\n};\n\n\n/**\n * Determines if the given time is inside a gap between buffered ranges. If it\n * is, this returns the index of the buffer that is *ahead* of the gap.\n *\n * @param {TimeRanges} b\n * @param {number} time\n * @return {?number} The index of the buffer after the gap, or null if not in a\n * gap.\n */\nshaka.media.TimeRangesUtils.getGapIndex = function(b, time) {\n if (!b || !b.length) return null;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return null;\n\n // IE/Edge stops 0.5 seconds before a gap, so it needs a much larger\n // threshold, but we don't want to punish other browsers that stop closer.\n // See: https://goo.gl/cuAcYd\n var threshold = 0.1;\n if (/(Edge|Trident)\\//.test(navigator.userAgent))\n threshold = 0.5;\n\n for (var i = 0; i < b.length; i++) {\n if (b.start(i) > time && (i == 0 || b.end(i - 1) - time <= threshold)) {\n return i;\n }\n }\n\n return null;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/time_ranges_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.MediaSourceEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.media.TimeRangesUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * MediaSourceEngine wraps all operations on MediaSource and SourceBuffers.\n * All asynchronous operations return a Promise, and all operations are\n * internally synchronized and serialized as needed. Operations that can\n * be done in parallel will be done in parallel.\n *\n * @param {HTMLMediaElement} video The video element, used to read error codes\n * when MediaSource operations fail.\n * @param {MediaSource} mediaSource The MediaSource, which must be in the\n * 'open' state.\n * @param {TextTrack} textTrack The TextTrack to use for subtitles/captions.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.MediaSourceEngine = function(video, mediaSource, textTrack) {\n goog.asserts.assert(mediaSource.readyState == 'open',\n 'The MediaSource should be in the \\'open\\' state.');\n\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {MediaSource} */\n this.mediaSource_ = mediaSource;\n\n /** @private {TextTrack} */\n this.textTrack_ = textTrack;\n\n /** @private {!Object.<shaka.util.ManifestParserUtils.ContentType,\n SourceBuffer>} */\n this.sourceBuffers_ = {};\n\n /** @private {shaka.media.TextEngine} */\n this.textEngine_ = null;\n\n /**\n * @private {!Object.<string,\n * !Array.<shaka.media.MediaSourceEngine.Operation>>}\n */\n this.queues_ = {};\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {boolean} */\n this.destroyed_ = false;\n};\n\n\n/**\n * @typedef {{\n * start: function(),\n * p: !shaka.util.PublicPromise\n * }}\n *\n * @summary An operation in queue.\n * @property {function()} start\n * The function which starts the operation.\n * @property {!shaka.util.PublicPromise} p\n * The PublicPromise which is associated with this operation.\n */\nshaka.media.MediaSourceEngine.Operation;\n\n\n/**\n * Checks if a certain type is supported.\n *\n * @param {string} mimeType\n * @return {boolean}\n */\nshaka.media.MediaSourceEngine.isTypeSupported = function(mimeType) {\n return shaka.media.TextEngine.isTypeSupported(mimeType) ||\n MediaSource.isTypeSupported(mimeType);\n};\n\n\n/**\n * Returns true if the browser has the basic APIs we need.\n *\n * @return {boolean}\n */\nshaka.media.MediaSourceEngine.isBrowserSupported = function() {\n return !!window.MediaSource && !!window.MediaSource.isTypeSupported;\n};\n\n\n/**\n * Returns a map of MediaSource support for well-known types.\n *\n * @return {!Object.<string, boolean>}\n */\nshaka.media.MediaSourceEngine.probeSupport = function() {\n goog.asserts.assert(shaka.media.MediaSourceEngine.isBrowserSupported(),\n 'Requires basic support');\n var support = {};\n var testMimeTypes = [\n // MP4 types\n 'video/mp4; codecs=\"avc1.42E01E\"',\n 'video/mp4; codecs=\"avc3.42E01E\"',\n 'video/mp4; codecs=\"hvc1.1.6.L93.90\"',\n 'audio/mp4; codecs=\"mp4a.40.2\"',\n 'audio/mp4; codecs=\"ac-3\"',\n 'audio/mp4; codecs=\"ec-3\"',\n // WebM types\n 'video/webm; codecs=\"vp8\"',\n 'video/webm; codecs=\"vp9\"',\n 'video/webm; codecs=\"av1\"',\n 'audio/webm; codecs=\"vorbis\"',\n 'audio/webm; codecs=\"opus\"',\n // MPEG2 TS types (video/ is also used for audio: http://goo.gl/tYHXiS)\n 'video/mp2t; codecs=\"avc1.42E01E\"',\n 'video/mp2t; codecs=\"avc3.42E01E\"',\n 'video/mp2t; codecs=\"hvc1.1.6.L93.90\"',\n 'video/mp2t; codecs=\"mp4a.40.2\"',\n 'video/mp2t; codecs=\"ac-3\"',\n 'video/mp2t; codecs=\"ec-3\"',\n 'video/mp2t; codecs=\"mp4a.40.2\"',\n // WebVTT types\n 'text/vtt',\n 'application/mp4; codecs=\"wvtt\"',\n // TTML types\n 'application/ttml+xml',\n 'application/mp4; codecs=\"stpp\"'\n ];\n\n testMimeTypes.forEach(function(type) {\n support[type] = shaka.media.MediaSourceEngine.isTypeSupported(type);\n var basicType = type.split(';')[0];\n support[basicType] = support[basicType] || support[type];\n });\n\n return support;\n};\n\n\n/**\n * @override\n */\nshaka.media.MediaSourceEngine.prototype.destroy = function() {\n var Functional = shaka.util.Functional;\n this.destroyed_ = true;\n\n var cleanup = [];\n\n for (var contentType in this.queues_) {\n // Make a local copy of the queue and the first item.\n var q = this.queues_[contentType];\n var inProgress = q[0];\n\n // Drop everything else out of the queue.\n this.queues_[contentType] = q.slice(0, 1);\n\n // We will wait for this item to complete/fail.\n if (inProgress) {\n cleanup.push(inProgress.p.catch(Functional.noop));\n }\n\n // The rest will be rejected silently if possible.\n for (var i = 1; i < q.length; ++i) {\n q[i].p.catch(Functional.noop);\n q[i].p.reject();\n }\n }\n\n if (this.textEngine_) {\n cleanup.push(this.textEngine_.destroy());\n }\n\n return Promise.all(cleanup).then(function() {\n this.eventManager_.destroy();\n this.eventManager_ = null;\n this.video_ = null;\n this.mediaSource_ = null;\n this.textTrack_ = null;\n this.textEngine_ = null;\n this.sourceBuffers_ = {};\n if (!COMPILED) {\n for (var contentType in this.queues_) {\n goog.asserts.assert(\n this.queues_[contentType].length == 0,\n contentType + ' queue should be empty after destroy!');\n }\n }\n this.queues_ = {};\n }.bind(this));\n};\n\n\n/**\n * Initialize MediaSourceEngine.\n *\n * Note that it is not valid to call this multiple times, except to add or\n * reinitialize text streams.\n *\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType, string>}\n * typeConfig A map of content types to full MIME types.\n * For example: { 'audio': 'audio/webm; codecs=\"vorbis\"',\n * 'video': 'video/webm; codecs=\"vp9\"', 'text': 'text/vtt' }.\n * All types given must be supported.\n *\n * @throws InvalidAccessError if blank MIME types are given\n * @throws NotSupportedError if unsupported MIME types are given\n * @throws QuotaExceededError if the browser can't support that many buffers\n */\nshaka.media.MediaSourceEngine.prototype.init = function(typeConfig) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n for (var contentType in typeConfig) {\n var mimeType = typeConfig[contentType];\n goog.asserts.assert(\n shaka.media.MediaSourceEngine.isTypeSupported(mimeType),\n 'Type negotiation should happen before MediaSourceEngine.init!');\n\n if (contentType == ContentType.TEXT) {\n this.reinitText(mimeType);\n } else {\n var sourceBuffer = this.mediaSource_.addSourceBuffer(mimeType);\n this.eventManager_.listen(\n sourceBuffer, 'error', this.onError_.bind(this, contentType));\n this.eventManager_.listen(\n sourceBuffer, 'updateend', this.onUpdateEnd_.bind(this, contentType));\n this.sourceBuffers_[contentType] = sourceBuffer;\n this.queues_[contentType] = [];\n }\n }\n};\n\n\n/**\n * Reinitialize the TextEngine for a new text type.\n * @param {string} mimeType\n */\nshaka.media.MediaSourceEngine.prototype.reinitText = function(mimeType) {\n if (!this.textEngine_) {\n this.textEngine_ = new shaka.media.TextEngine(this.textTrack_);\n }\n this.textEngine_.initParser(mimeType);\n};\n\n\n/**\n * Gets the first timestamp in buffer for the given content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {?number} The timestamp in seconds, or null if nothing is buffered.\n */\nshaka.media.MediaSourceEngine.prototype.bufferStart = function(contentType) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.bufferStart();\n }\n return shaka.media.TimeRangesUtils.bufferStart(\n this.getBuffered_(contentType));\n};\n\n\n/**\n * Gets the last timestamp in buffer for the given content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {?number} The timestamp in seconds, or null if nothing is buffered.\n */\nshaka.media.MediaSourceEngine.prototype.bufferEnd = function(contentType) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.bufferEnd();\n }\n return shaka.media.TimeRangesUtils.bufferEnd(this.getBuffered_(contentType));\n};\n\n\n/**\n * Determines if the given time is inside the buffered range of the given\n * content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} time\n * @return {boolean}\n */\nshaka.media.MediaSourceEngine.prototype.isBuffered = function(\n contentType, time) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.isBuffered(time);\n } else {\n var buffered = this.getBuffered_(contentType);\n return shaka.media.TimeRangesUtils.isBuffered(buffered, time);\n }\n};\n\n\n/**\n * Computes how far ahead of the given timestamp is buffered for the given\n * content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} time\n * @return {number} The amount of time buffered ahead in seconds.\n */\nshaka.media.MediaSourceEngine.prototype.bufferedAheadOf =\n function(contentType, time) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.bufferedAheadOf(time);\n } else {\n var buffered = this.getBuffered_(contentType);\n return shaka.media.TimeRangesUtils.bufferedAheadOf(buffered, time);\n }\n};\n\n\n/**\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {TimeRanges} The buffered ranges for the given content type, or\n * null if the buffered ranges could not be obtained.\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.getBuffered_ = function(contentType) {\n try {\n return this.sourceBuffers_[contentType].buffered;\n } catch (exception) {\n // Note: previous MediaSource errors may cause access to |buffered| to\n // throw.\n shaka.log.error('failed to get buffered range for ' + contentType,\n exception);\n return null;\n }\n};\n\n\n/**\n * Enqueue an operation to append data to the SourceBuffer.\n * Start and end times are needed for TextEngine, but not for MediaSource.\n * Start and end times may be null for initialization segments, if present they\n * are relative to the presentation timeline.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {!ArrayBuffer} data\n * @param {?number} startTime\n * @param {?number} endTime\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.appendBuffer =\n function(contentType, data, startTime, endTime) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.appendBuffer(data, startTime, endTime);\n }\n return this.enqueueOperation_(\n contentType,\n this.append_.bind(this, contentType, data));\n};\n\n\n/**\n * Enqueue an operation to remove data from the SourceBuffer.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} startTime\n * @param {number} endTime\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.remove =\n function(contentType, startTime, endTime) {\n // On IE11, this operation would be permitted, but would have no effect!\n // See https://github.com/google/shaka-player/issues/251\n goog.asserts.assert(endTime < Number.MAX_VALUE,\n 'remove() with MAX_VALUE or Infinity is not IE-compatible!');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.remove(startTime, endTime);\n }\n return this.enqueueOperation_(\n contentType,\n this.remove_.bind(this, contentType, startTime, endTime));\n};\n\n\n/**\n * Enqueue an operation to clear the SourceBuffer.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.clear = function(contentType) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.remove(0, Infinity);\n }\n // Note that not all platforms allow clearing to Infinity.\n return this.enqueueOperation_(\n contentType,\n this.remove_.bind(this, contentType, 0, this.mediaSource_.duration));\n};\n\n\n/**\n * Enqueue an operation to flush the SourceBuffer.\n * This is a workaround for what we believe is a Chromecast bug.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.flush = function(contentType) {\n // Flush the pipeline. Necessary on Chromecast, even though we have removed\n // everything.\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n // Nothing to flush for text.\n return Promise.resolve();\n }\n return this.enqueueOperation_(\n contentType,\n this.flush_.bind(this, contentType));\n};\n\n\n/**\n * Sets the timestamp offset and append window end for the given content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} timestampOffset The timestamp offset. Segments which start\n * at time t will be inserted at time t + timestampOffset instead. This\n * value does not affect segments which have already been inserted.\n * @param {?number} appendWindowEnd The timestamp to set the append window end\n * to. Media beyond this value will be truncated.\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.setStreamProperties = function(\n contentType, timestampOffset, appendWindowEnd) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n this.textEngine_.setTimestampOffset(timestampOffset);\n if (appendWindowEnd != null)\n this.textEngine_.setAppendWindowEnd(appendWindowEnd);\n return Promise.resolve();\n }\n\n if (appendWindowEnd == null)\n appendWindowEnd = Infinity;\n\n return Promise.all([\n // Queue an abort() to help MSE splice together overlapping segments.\n // We set appendWindowEnd when we change periods in DASH content, and the\n // period transition may result in overlap.\n //\n // An abort() also helps with MPEG2-TS. When we append a TS segment, we\n // always enter a PARSING_MEDIA_SEGMENT state and we can't change the\n // timestamp offset. By calling abort(), we reset the state so we can\n // set it.\n //\n // Note that abort() resets both appendWindowStart and appendWindowEnd;\n // however, we don't use appendWindowStart.\n this.enqueueOperation_(\n contentType,\n this.abort_.bind(this, contentType)),\n this.enqueueOperation_(\n contentType,\n this.setTimestampOffset_.bind(this, contentType, timestampOffset)),\n this.enqueueOperation_(\n contentType,\n this.setAppendWindowEnd_.bind(this, contentType, appendWindowEnd))\n ]);\n};\n\n\n/**\n * @param {string=} opt_reason Valid reasons are 'network' and 'decode'.\n * @return {!Promise}\n * @see http://w3c.github.io/media-source/#idl-def-EndOfStreamError\n */\nshaka.media.MediaSourceEngine.prototype.endOfStream = function(opt_reason) {\n return this.enqueueBlockingOperation_(function() {\n // Chrome won't let me pass undefined, but it will let me omit the\n // argument. Firefox does not have this problem.\n // TODO: File a bug about this.\n if (opt_reason) {\n this.mediaSource_.endOfStream(opt_reason);\n } else {\n this.mediaSource_.endOfStream();\n }\n }.bind(this));\n};\n\n\n/**\n * We only support increasing duration at this time. Decreasing duration\n * causes the MSE removal algorithm to run, which results in an 'updateend'\n * event. Supporting this scenario would be complicated, and is not currently\n * needed.\n *\n * @param {number} duration\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.setDuration = function(duration) {\n goog.asserts.assert(\n isNaN(this.mediaSource_.duration) ||\n this.mediaSource_.duration <= duration,\n 'duration cannot decrease: ' + this.mediaSource_.duration + ' -> ' +\n duration);\n return this.enqueueBlockingOperation_(function() {\n this.mediaSource_.duration = duration;\n }.bind(this));\n};\n\n\n/**\n * Get the current MediaSource duration.\n *\n * @return {number}\n */\nshaka.media.MediaSourceEngine.prototype.getDuration = function() {\n return this.mediaSource_.duration;\n};\n\n\n/**\n * Append data to the SourceBuffer.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {!ArrayBuffer} data\n * @throws QuotaExceededError if the browser's buffer is full\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.append_ =\n function(contentType, data) {\n // This will trigger an 'updateend' event.\n this.sourceBuffers_[contentType].appendBuffer(data);\n};\n\n\n/**\n * Remove data from the SourceBuffer.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} startTime\n * @param {number} endTime\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.remove_ =\n function(contentType, startTime, endTime) {\n if (endTime <= startTime) {\n // Ignore removal of inverted or empty ranges.\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n return;\n }\n\n // This will trigger an 'updateend' event.\n this.sourceBuffers_[contentType].remove(startTime, endTime);\n};\n\n\n/**\n * Call abort() on the SourceBuffer.\n * This resets MSE's last_decode_timestamp on all track buffers, which should\n * trigger the splicing logic for overlapping segments.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.abort_ = function(contentType) {\n // Save the append window end, which is reset on abort().\n var appendWindowEnd = this.sourceBuffers_[contentType].appendWindowEnd;\n\n // This will not trigger an 'updateend' event, since nothing is happening.\n // This is only to reset MSE internals, not to abort an actual operation.\n this.sourceBuffers_[contentType].abort();\n\n // Restore the append window end.\n this.sourceBuffers_[contentType].appendWindowEnd = appendWindowEnd;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * Nudge the playhead to force the media pipeline to be flushed.\n * This seems to be necessary on Chromecast to get new content to replace old\n * content.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.flush_ = function(contentType) {\n // Never use flush_ if there's data. It causes a hiccup in playback.\n goog.asserts.assert(\n this.video_.buffered.length == 0,\n 'MediaSourceEngine.flush_ should only be used after clearing all data!');\n\n // Seeking forces the pipeline to be flushed.\n this.video_.currentTime -= 0.001;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * Set the SourceBuffer's timestamp offset.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} timestampOffset\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.setTimestampOffset_ =\n function(contentType, timestampOffset) {\n this.sourceBuffers_[contentType].timestampOffset = timestampOffset;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * Set the SourceBuffer's append window end.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} appendWindowEnd\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.setAppendWindowEnd_ =\n function(contentType, appendWindowEnd) {\n var fudge = 1 / 25; // one frame, assuming a low framerate\n this.sourceBuffers_[contentType].appendWindowEnd = appendWindowEnd + fudge;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {!Event} event\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.onError_ =\n function(contentType, event) {\n var operation = this.queues_[contentType][0];\n goog.asserts.assert(operation, 'Spurious error event!');\n goog.asserts.assert(!this.sourceBuffers_[contentType].updating,\n 'SourceBuffer should not be updating on error!');\n var code = this.video_.error ? this.video_.error.code : 0;\n operation.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_FAILED,\n code));\n // Do not pop from queue. An 'updateend' event will fire next, and to avoid\n // synchronizing these two event handlers, we will allow that one to pop from\n // the queue as normal. Note that because the operation has already been\n // rejected, the call to resolve() in the 'updateend' handler will have no\n // effect.\n};\n\n\n/**\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.onUpdateEnd_ = function(contentType) {\n var operation = this.queues_[contentType][0];\n goog.asserts.assert(operation, 'Spurious updateend event!');\n if (!operation) return;\n goog.asserts.assert(!this.sourceBuffers_[contentType].updating,\n 'SourceBuffer should not be updating on updateend!');\n operation.p.resolve();\n this.popFromQueue_(contentType);\n};\n\n\n/**\n * Enqueue an operation and start it if appropriate.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {function()} start\n * @return {!Promise}\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.enqueueOperation_ =\n function(contentType, start) {\n if (this.destroyed_) return Promise.reject();\n\n var operation = {\n start: start,\n p: new shaka.util.PublicPromise()\n };\n this.queues_[contentType].push(operation);\n\n if (this.queues_[contentType].length == 1) {\n try {\n operation.start();\n } catch (exception) {\n if (exception.name == 'QuotaExceededError') {\n operation.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR,\n contentType));\n } else {\n operation.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW,\n exception));\n }\n this.popFromQueue_(contentType);\n }\n }\n return operation.p;\n};\n\n\n/**\n * Enqueue an operation which must block all other operations on all\n * SourceBuffers.\n *\n * @param {function()} run\n * @return {!Promise}\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.enqueueBlockingOperation_ =\n function(run) {\n if (this.destroyed_) return Promise.reject();\n\n var allWaiters = [];\n\n // Enqueue a 'wait' operation onto each queue.\n // This operation signals its readiness when it starts.\n // When all wait operations are ready, the real operation takes place.\n for (var contentType in this.sourceBuffers_) {\n var ready = new shaka.util.PublicPromise();\n var operation = {\n start: function(ready) { ready.resolve(); }.bind(null, ready),\n p: ready\n };\n\n this.queues_[contentType].push(operation);\n allWaiters.push(ready);\n\n if (this.queues_[contentType].length == 1) {\n operation.start();\n }\n }\n\n // Return a Promise to the real operation, which waits to begin until there\n // are no other in-progress operations on any SourceBuffers.\n return Promise.all(allWaiters).then(function() {\n if (!COMPILED) {\n // If we did it correctly, nothing is updating.\n for (var contentType in this.sourceBuffers_) {\n goog.asserts.assert(\n this.sourceBuffers_[contentType].updating == false,\n 'SourceBuffers should not be updating after a blocking op!');\n }\n }\n\n var ret;\n // Run the real operation, which is synchronous.\n try {\n run();\n } catch (exception) {\n ret = Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW,\n exception));\n }\n\n // Unblock the queues.\n for (var contentType in this.sourceBuffers_) {\n this.popFromQueue_(contentType);\n }\n\n return ret;\n }.bind(this), function() {\n // One of the waiters failed, which means we've been destroyed.\n goog.asserts.assert(this.destroyed_, 'Should be destroyed by now');\n // We haven't popped from the queue. Canceled waiters have been removed by\n // destroy. What's left now should just be resolved waiters. In uncompiled\n // mode, we will maintain good hygiene and make sure the assert at the end\n // of destroy passes. In compiled mode, the queues are wiped in destroy.\n if (!COMPILED) {\n for (var contentType in this.sourceBuffers_) {\n if (this.queues_[contentType].length) {\n goog.asserts.assert(\n this.queues_[contentType].length == 1,\n 'Should be at most one item in queue!');\n goog.asserts.assert(\n allWaiters.indexOf(this.queues_[contentType][0].p) != -1,\n 'The item in queue should be one of our waiters!');\n this.queues_[contentType].shift();\n }\n }\n }\n return Promise.reject();\n }.bind(this));\n};\n\n\n/**\n * Pop from the front of the queue and start a new operation.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.popFromQueue_ = function(contentType) {\n // Remove the in-progress operation, which is now complete.\n this.queues_[contentType].shift();\n // Retrieve the next operation, if any, from the queue and start it.\n var next = this.queues_[contentType][0];\n if (next) {\n try {\n next.start();\n } catch (exception) {\n next.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW,\n exception));\n this.popFromQueue_(contentType);\n }\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/media_source_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.LanguageUtils');\n\ngoog.require('goog.asserts');\n\n\n/**\n * @namespace shaka.util.LanguageUtils\n * @summary A set of language utility functions.\n */\n\n\n/**\n * Compares two language tags as defined by RFC 5646 and ISO 639. The\n * comparison takes sublanguages into account via the |fuzz| parameter.\n * The caller is expected to normalize the inputs first.\n *\n * @see shaka.util.LanguageUtils.normalize()\n * @see IETF RFC 5646\n * @see ISO 639\n *\n * @param {shaka.util.LanguageUtils.MatchType} fuzz What kind of match is\n * acceptable.\n * @param {string} preference The user's preferred language tag.\n * @param {string} candidate An available language tag.\n * @return {boolean}\n */\nshaka.util.LanguageUtils.match = function(fuzz, preference, candidate) {\n // Alias.\n var LanguageUtils = shaka.util.LanguageUtils;\n\n goog.asserts.assert(preference == LanguageUtils.normalize(preference),\n 'Language pref should be normalized first');\n goog.asserts.assert(candidate == LanguageUtils.normalize(candidate),\n 'Language candidate should be normalized first');\n\n if (candidate == preference) {\n return true;\n }\n\n if (fuzz >= shaka.util.LanguageUtils.MatchType.BASE_LANGUAGE_OKAY &&\n candidate == preference.split('-')[0]) {\n return true;\n }\n\n if (fuzz >= shaka.util.LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY &&\n candidate.split('-')[0] == preference.split('-')[0]) {\n return true;\n }\n\n return false;\n};\n\n\n/**\n * A match type for fuzzy-matching logic.\n *\n * @enum {number}\n */\nshaka.util.LanguageUtils.MatchType = {\n /** Accepts an exact match. */\n EXACT: 0,\n /** Accepts a less-specific version of the preferred sublanguage. */\n BASE_LANGUAGE_OKAY: 1,\n /** Accepts a different sublanguage of the preferred base language. */\n OTHER_SUB_LANGUAGE_OKAY: 2\n};\n\n\n/**\n * Normalize the language tag.\n *\n * RFC 5646 specifies that language tags are case insensitive and that the\n * shortest representation of the base language should always be used.\n * This will convert the tag to lower-case and map 3-letter codes (ISO 639-2)\n * to 2-letter codes (ISO 639-1) whenever possible.\n *\n * @param {string} lang\n * @return {string}\n *\n * @see IETF RFC 5646\n * @see ISO 639\n */\nshaka.util.LanguageUtils.normalize = function(lang) {\n var fields = lang.toLowerCase().split('-');\n var base = fields[0];\n var replacement = shaka.util.LanguageUtils.isoMap_[base];\n if (replacement) {\n fields[0] = replacement;\n }\n return fields.join('-');\n};\n\n\n/**\n * A map from 3-letter language codes (ISO 639-2) to 2-letter language codes\n * (ISO 639-1) for all languages which have both in the registry.\n *\n * @const {!Object.<string, string>}\n * @private\n */\nshaka.util.LanguageUtils.isoMap_ = {\n 'aar': 'aa', 'abk': 'ab', 'afr': 'af', 'aka': 'ak', 'alb': 'sq', 'amh': 'am',\n 'ara': 'ar', 'arg': 'an', 'arm': 'hy', 'asm': 'as', 'ava': 'av', 'ave': 'ae',\n 'aym': 'ay', 'aze': 'az', 'bak': 'ba', 'bam': 'bm', 'baq': 'eu', 'bel': 'be',\n 'ben': 'bn', 'bih': 'bh', 'bis': 'bi', 'bod': 'bo', 'bos': 'bs', 'bre': 'br',\n 'bul': 'bg', 'bur': 'my', 'cat': 'ca', 'ces': 'cs', 'cha': 'ch', 'che': 'ce',\n 'chi': 'zh', 'chu': 'cu', 'chv': 'cv', 'cor': 'kw', 'cos': 'co', 'cre': 'cr',\n 'cym': 'cy', 'cze': 'cs', 'dan': 'da', 'deu': 'de', 'div': 'dv', 'dut': 'nl',\n 'dzo': 'dz', 'ell': 'el', 'eng': 'en', 'epo': 'eo', 'est': 'et', 'eus': 'eu',\n 'ewe': 'ee', 'fao': 'fo', 'fas': 'fa', 'fij': 'fj', 'fin': 'fi', 'fra': 'fr',\n 'fre': 'fr', 'fry': 'fy', 'ful': 'ff', 'geo': 'ka', 'ger': 'de', 'gla': 'gd',\n 'gle': 'ga', 'glg': 'gl', 'glv': 'gv', 'gre': 'el', 'grn': 'gn', 'guj': 'gu',\n 'hat': 'ht', 'hau': 'ha', 'heb': 'he', 'her': 'hz', 'hin': 'hi', 'hmo': 'ho',\n 'hrv': 'hr', 'hun': 'hu', 'hye': 'hy', 'ibo': 'ig', 'ice': 'is', 'ido': 'io',\n 'iii': 'ii', 'iku': 'iu', 'ile': 'ie', 'ina': 'ia', 'ind': 'id', 'ipk': 'ik',\n 'isl': 'is', 'ita': 'it', 'jav': 'jv', 'jpn': 'ja', 'kal': 'kl', 'kan': 'kn',\n 'kas': 'ks', 'kat': 'ka', 'kau': 'kr', 'kaz': 'kk', 'khm': 'km', 'kik': 'ki',\n 'kin': 'rw', 'kir': 'ky', 'kom': 'kv', 'kon': 'kg', 'kor': 'ko', 'kua': 'kj',\n 'kur': 'ku', 'lao': 'lo', 'lat': 'la', 'lav': 'lv', 'lim': 'li', 'lin': 'ln',\n 'lit': 'lt', 'ltz': 'lb', 'lub': 'lu', 'lug': 'lg', 'mac': 'mk', 'mah': 'mh',\n 'mal': 'ml', 'mao': 'mi', 'mar': 'mr', 'may': 'ms', 'mkd': 'mk', 'mlg': 'mg',\n 'mlt': 'mt', 'mon': 'mn', 'mri': 'mi', 'msa': 'ms', 'mya': 'my', 'nau': 'na',\n 'nav': 'nv', 'nbl': 'nr', 'nde': 'nd', 'ndo': 'ng', 'nep': 'ne', 'nld': 'nl',\n 'nno': 'nn', 'nob': 'nb', 'nor': 'no', 'nya': 'ny', 'oci': 'oc', 'oji': 'oj',\n 'ori': 'or', 'orm': 'om', 'oss': 'os', 'pan': 'pa', 'per': 'fa', 'pli': 'pi',\n 'pol': 'pl', 'por': 'pt', 'pus': 'ps', 'que': 'qu', 'roh': 'rm', 'ron': 'ro',\n 'rum': 'ro', 'run': 'rn', 'rus': 'ru', 'sag': 'sg', 'san': 'sa', 'sin': 'si',\n 'slk': 'sk', 'slo': 'sk', 'slv': 'sl', 'sme': 'se', 'smo': 'sm', 'sna': 'sn',\n 'snd': 'sd', 'som': 'so', 'sot': 'st', 'spa': 'es', 'sqi': 'sq', 'srd': 'sc',\n 'srp': 'sr', 'ssw': 'ss', 'sun': 'su', 'swa': 'sw', 'swe': 'sv', 'tah': 'ty',\n 'tam': 'ta', 'tat': 'tt', 'tel': 'te', 'tgk': 'tg', 'tgl': 'tl', 'tha': 'th',\n 'tib': 'bo', 'tir': 'ti', 'ton': 'to', 'tsn': 'tn', 'tso': 'ts', 'tuk': 'tk',\n 'tur': 'tr', 'twi': 'tw', 'uig': 'ug', 'ukr': 'uk', 'urd': 'ur', 'uzb': 'uz',\n 'ven': 've', 'vie': 'vi', 'vol': 'vo', 'wel': 'cy', 'wln': 'wa', 'wol': 'wo',\n 'xho': 'xh', 'yid': 'yi', 'yor': 'yo', 'zha': 'za', 'zho': 'zh', 'zul': 'zu'\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/language_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.StreamUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.MediaSourceEngine');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.util.ArrayUtils');\ngoog.require('shaka.util.LanguageUtils');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n/**\n * @param {shakaExtern.Variant} variant\n * @param {shakaExtern.Restrictions} restrictions\n * Configured restrictions from the user.\n * @param {{width: number, height: number}} maxHwRes\n * The maximum resolution the hardware can handle.\n * This is applied separately from user restrictions because the setting\n * should not be easily replaced by the user's configuration.\n * @return {boolean}\n */\nshaka.util.StreamUtils.meetsRestrictions = function(\n variant, restrictions, maxHwRes) {\n var video = variant.video;\n if (video) {\n if (video.width < restrictions.minWidth ||\n video.width > restrictions.maxWidth || video.width > maxHwRes.width ||\n video.height < restrictions.minHeight ||\n video.height > restrictions.maxHeight ||\n video.height > maxHwRes.height ||\n (video.width * video.height) < restrictions.minPixels ||\n (video.width * video.height) > restrictions.maxPixels) {\n return false;\n }\n }\n\n if (variant.bandwidth < restrictions.minBandwidth ||\n variant.bandwidth > restrictions.maxBandwidth) {\n return false;\n }\n\n return true;\n};\n\n\n/**\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Restrictions} restrictions\n * @param {{width: number, height: number}} maxHwRes\n * @return {boolean} Whether the tracks changed.\n */\nshaka.util.StreamUtils.applyRestrictions =\n function(period, restrictions, maxHwRes) {\n var tracksChanged = false;\n\n period.variants.forEach(function(variant) {\n var originalAllowed = variant.allowedByApplication;\n variant.allowedByApplication = shaka.util.StreamUtils.meetsRestrictions(\n variant, restrictions, maxHwRes);\n\n if (originalAllowed != variant.allowedByApplication) {\n tracksChanged = true;\n }\n });\n\n return tracksChanged;\n};\n\n\n/**\n * Alters the given Period to filter out any unplayable streams.\n *\n * @param {shaka.media.DrmEngine} drmEngine\n * @param {!Object.<string, shakaExtern.Stream>} activeStreams\n * @param {shakaExtern.Period} period\n */\nshaka.util.StreamUtils.filterPeriod = function(\n drmEngine, activeStreams, period) {\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var activeVideo = activeStreams[ContentType.VIDEO];\n var activeAudio = activeStreams[ContentType.AUDIO];\n\n // Filter variants\n for (var i = 0; i < period.variants.length; ++i) {\n var variant = period.variants[i];\n if (!StreamUtils.variantIsCompatible_(\n variant, drmEngine, activeAudio, activeVideo)) {\n shaka.log.debug('Dropping Variant (not compatible with key system, ' +\n 'platform, or active Variant)', variant);\n period.variants.splice(i, 1);\n --i;\n continue;\n }\n }\n\n // Filter text streams\n for (var i = 0; i < period.textStreams.length; ++i) {\n var stream = period.textStreams[i];\n var fullMimeType = StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n if (!shaka.media.TextEngine.isTypeSupported(fullMimeType)) {\n shaka.log.debug('Dropping text stream. Is not supported by the ' +\n 'platform.', stream);\n period.textStreams.splice(i, 1);\n --i;\n }\n }\n};\n\n\n/**\n * Checks if a stream is compatible with the key system, platform,\n * and active stream.\n *\n * @param {?shakaExtern.Stream} stream\n * @param {shaka.media.DrmEngine} drmEngine\n * @param {?shakaExtern.Stream} activeStream\n * @return {boolean}\n * @private\n */\nshaka.util.StreamUtils.streamIsCompatible_ =\n function(stream, drmEngine, activeStream) {\n if (!stream) return true;\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n goog.asserts.assert(stream.type != ContentType.TEXT,\n 'Should not be called on a text stream!');\n\n var drmSupportedMimeTypes = null;\n if (drmEngine && drmEngine.initialized()) {\n drmSupportedMimeTypes = drmEngine.getSupportedTypes();\n }\n\n // Check if stream can be played by the platform\n var fullMimeType = shaka.util.StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n\n if (!shaka.media.MediaSourceEngine.isTypeSupported(fullMimeType))\n return false;\n\n // Check if stream can be handled by the key system.\n // There's no need to check that the stream is supported by the\n // chosen key system since the caller has already verified that.\n if (drmSupportedMimeTypes && stream.encrypted &&\n drmSupportedMimeTypes.indexOf(fullMimeType) < 0) {\n return false;\n }\n\n // Lastly, check if active stream can switch to the stream\n // Basic mime types and basic codecs need to match.\n // For example, we can't adapt between WebM and MP4,\n // nor can we adapt between mp4a.* to ec-3.\n // We can switch between text types on the fly,\n // so don't run this check on text.\n if (activeStream) {\n if (stream.mimeType != activeStream.mimeType ||\n stream.codecs.split('.')[0] != activeStream.codecs.split('.')[0]) {\n return false;\n }\n }\n\n return true;\n};\n\n\n/**\n * Checks if a variant is compatible with the key system, platform,\n * and active stream.\n *\n * @param {!shakaExtern.Variant} variant\n * @param {shaka.media.DrmEngine} drmEngine\n * @param {shakaExtern.Stream} activeAudio\n * @param {shakaExtern.Stream} activeVideo\n * @return {boolean}\n * @private\n */\nshaka.util.StreamUtils.variantIsCompatible_ =\n function(variant, drmEngine, activeAudio, activeVideo) {\n var StreamUtils = shaka.util.StreamUtils;\n if (drmEngine && drmEngine.initialized()) {\n if (!drmEngine.isSupportedByKeySystem(variant)) return false;\n }\n\n return StreamUtils.streamIsCompatible_(variant.audio,\n drmEngine,\n activeAudio) &&\n StreamUtils.streamIsCompatible_(variant.video, drmEngine, activeVideo);\n};\n\n\n/**\n * Gets an array of Track objects for the given Period\n *\n * @param {shakaExtern.Period} period\n * @param {?number} activeAudioId\n * @param {?number} activeVideoId\n * @return {!Array.<shakaExtern.Track>}\n */\nshaka.util.StreamUtils.getVariantTracks =\n function(period, activeAudioId, activeVideoId) {\n var StreamUtils = shaka.util.StreamUtils;\n var variants = StreamUtils.getPlayableVariants(period.variants);\n var label = null;\n var tracks = variants.map(function(variant) {\n var isActive;\n if (variant.video && variant.audio) {\n isActive = activeVideoId == variant.video.id &&\n activeAudioId == variant.audio.id;\n } else {\n isActive = (variant.video && activeVideoId == variant.video.id) ||\n (variant.audio && activeAudioId == variant.audio.id);\n }\n var codecs = '';\n if (variant.video) codecs += variant.video.codecs;\n if (variant.audio) {\n if (codecs != '') codecs += ', ';\n codecs += variant.audio.codecs;\n label = variant.audio.label;\n }\n\n var audioCodec = variant.audio ? variant.audio.codecs : null;\n var videoCodec = variant.video ? variant.video.codecs : null;\n var mimeType = null;\n if (variant.video) mimeType = variant.video.mimeType;\n else if (variant.audio) mimeType = variant.audio.mimeType;\n\n var kind = null;\n if (variant.audio) kind = variant.audio.kind;\n else if (variant.video) kind = variant.video.kind;\n\n var audioRoles = variant.audio ? variant.audio.roles : [];\n var videoRoles = variant.video ? variant.video.roles : [];\n var roles = shaka.util.ArrayUtils.removeDuplicates(\n audioRoles.concat(videoRoles));\n return {\n id: variant.id,\n active: isActive,\n type: 'variant',\n bandwidth: variant.bandwidth,\n language: variant.language,\n label: label,\n kind: kind || null,\n width: variant.video ? variant.video.width : null,\n height: variant.video ? variant.video.height : null,\n frameRate: variant.video ? variant.video.frameRate : undefined,\n mimeType: mimeType,\n codecs: codecs,\n audioCodec: audioCodec,\n videoCodec: videoCodec,\n primary: variant.primary,\n roles: roles,\n videoId: variant.video ? variant.video.id : null,\n audioId: variant.audio ? variant.audio.id : null\n };\n });\n\n return tracks;\n};\n\n\n/**\n * Gets an array of text Track objects for the given Period.\n *\n * @param {shakaExtern.Period} period\n * @param {?number} activeStreamId\n * @return {!Array.<shakaExtern.Track>}\n */\nshaka.util.StreamUtils.getTextTracks = function(period, activeStreamId) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n return period.textStreams.map(function(stream) {\n return {\n id: stream.id,\n active: activeStreamId == stream.id,\n type: ContentType.TEXT,\n language: stream.language,\n label: stream.label,\n kind: stream.kind,\n mimeType: stream.mimeType,\n codecs: stream.codecs || null,\n audioCodec: null,\n videoCodec: null,\n primary: stream.primary,\n roles: stream.roles\n };\n });\n};\n\n\n/**\n * Find the Variant for the given track.\n *\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Track} track\n * @return {?shakaExtern.Variant}\n */\nshaka.util.StreamUtils.findVariantForTrack = function(period, track) {\n for (var i = 0; i < period.variants.length; i++) {\n if (period.variants[i].id == track.id)\n return period.variants[i];\n }\n return null;\n};\n\n\n/**\n * Find the text stream for the given track.\n *\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Track} track\n * @return {?shakaExtern.Stream}\n */\nshaka.util.StreamUtils.findTextStreamForTrack = function(period, track) {\n for (var i = 0; i < period.textStreams.length; i++) {\n if (period.textStreams[i].id == track.id)\n return period.textStreams[i];\n }\n return null;\n};\n\n\n/**\n * Determines if the given variant is playable.\n * @param {!shakaExtern.Variant} variant\n * @return {boolean}\n */\nshaka.util.StreamUtils.isPlayable = function(variant) {\n return variant.allowedByApplication && variant.allowedByKeySystem;\n};\n\n\n/**\n * Filters out not playable variants.\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @return {!Array.<!shakaExtern.Variant>}\n */\nshaka.util.StreamUtils.getPlayableVariants = function(variants) {\n return variants.filter(function(variant) {\n return shaka.util.StreamUtils.isPlayable(variant);\n });\n};\n\n\n/**\n * Chooses variants according to the given config.\n *\n * @param {shakaExtern.Period} period\n * @param {string} preferredLanguage\n * @param {!Object=} opt_languageMatches\n * @param {string=} opt_role\n * @return {!Array.<!shakaExtern.Variant>}\n */\nshaka.util.StreamUtils.filterVariantsByRoleAndLanguage = function(\n period, preferredLanguage, opt_languageMatches, opt_role) {\n var LanguageUtils = shaka.util.LanguageUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var variants = shaka.util.StreamUtils.getPlayableVariants(period.variants);\n\n // Initially choose the first language in the list.\n /** @type {!Array.<!shakaExtern.Variant>} */\n var chosen = variants.filter(function(variant) {\n return variant.language == variants[0].language;\n });\n\n // Prefer primary variants.\n var primaryVariants = variants.filter(function(variant) {\n return variant.primary;\n });\n if (primaryVariants.length) chosen = primaryVariants;\n\n // Choose based on language preference. Favor exact matches, then\n // base matches, finally different subtags. Execute in reverse order so\n // the later steps override the previous ones.\n if (preferredLanguage) {\n var pref = LanguageUtils.normalize(preferredLanguage);\n [LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY,\n LanguageUtils.MatchType.BASE_LANGUAGE_OKAY,\n LanguageUtils.MatchType.EXACT]\n .forEach(function(matchType) {\n var betterLangMatchFound = false;\n variants.forEach(function(variant) {\n pref = LanguageUtils.normalize(pref);\n var lang = LanguageUtils.normalize(variant.language);\n if (LanguageUtils.match(matchType, pref, lang)) {\n if (betterLangMatchFound) {\n chosen.push(variant);\n } else {\n chosen = [variant];\n betterLangMatchFound = true;\n }\n if (opt_languageMatches) {\n opt_languageMatches[ContentType.AUDIO] = true;\n }\n }\n }); // forEach(variant)\n }); // forEach(matchType)\n } // if (preferredLanguage)\n\n // Choose based on role preference. If there's no exact match, return\n // what was chosen based on the language preference.\n var role = opt_role || '';\n if (role) {\n var chosenWithRoles = chosen.filter(function(variant) {\n return (variant.audio && (variant.audio.roles.indexOf(role) > - 1)) ||\n (variant.video && (variant.video.roles.indexOf(role) > - 1));\n });\n if (chosenWithRoles.length) return chosenWithRoles;\n else {\n shaka.log.warning(\n 'No exact match for the role is found. Returning the selection ' +\n 'based on language preference.');\n }\n }\n return chosen;\n};\n\n\n/**\n * Chooses text streams according to the given config.\n *\n * @param {shakaExtern.Period} period\n * @param {string} preferredLanguage\n * @param {!Object=} opt_languageMatches\n * @param {string=} opt_role\n * @return {!Array.<!shakaExtern.Stream>}\n */\nshaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage = function(\n period, preferredLanguage, opt_languageMatches, opt_role) {\n var LanguageUtils = shaka.util.LanguageUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var streams = period.textStreams;\n\n // Choose all the streams.\n /** @type {!Array.<!shakaExtern.Stream>} */\n var chosen = streams;\n\n // Prefer primary text streams.\n var primaryStreams = streams.filter(function(stream) {\n return stream.primary;\n });\n if (primaryStreams.length) chosen = primaryStreams;\n\n // Override based on language preference. Favor exact matches, then\n // base matches, finally different subtags. Execute in reverse order so\n // the later steps override the previous ones.\n if (preferredLanguage) {\n var pref = LanguageUtils.normalize(preferredLanguage);\n [LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY,\n LanguageUtils.MatchType.BASE_LANGUAGE_OKAY,\n LanguageUtils.MatchType.EXACT]\n .forEach(function(matchType) {\n var betterLangMatchFound = false;\n streams.forEach(function(stream) {\n var lang = LanguageUtils.normalize(stream.language);\n if (LanguageUtils.match(matchType, pref, lang)) {\n if (betterLangMatchFound) {\n chosen.push(stream);\n } else {\n chosen = [stream];\n betterLangMatchFound = true;\n }\n if (opt_languageMatches)\n opt_languageMatches[ContentType.TEXT] = true;\n }\n }); // forEach(stream)\n }); // forEach(matchType)\n } // if (preferredLanguage)\n // Choose based on role preference. If there's no exact match, return\n // what was chosen based on the language preference.\n var role = opt_role || '';\n if (role) {\n var chosenWithRoles = chosen.filter(function(stream) {\n return (stream && (stream.roles.indexOf(role) > - 1));\n });\n if (chosenWithRoles.length) return chosenWithRoles;\n else {\n shaka.log.warning(\n 'No exact match for the role is found. Returning the selection ' +\n 'based on language preference.');\n }\n }\n return chosen;\n};\n\n\n/**\n * Finds a Variant with given audio and video streams.\n * Returns null if none was found.\n *\n * @param {?shakaExtern.Stream} audio\n * @param {?shakaExtern.Stream} video\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @return {?shakaExtern.Variant}\n */\nshaka.util.StreamUtils.getVariantByStreams = function(audio, video, variants) {\n for (var i = 0; i < variants.length; i++) {\n if (variants[i].audio == audio && variants[i].video == video)\n return variants[i];\n }\n\n return null;\n};\n\n\n/**\n * Finds a Variant with the given video and audio streams, by stream ID.\n * Returns null if none were found.\n *\n * @param {?number} audioId\n * @param {?number} videoId\n * @param {!Array.<shakaExtern.Variant>} variants\n * @return {?shakaExtern.Variant}\n */\nshaka.util.StreamUtils.getVariantByStreamIds = function(\n audioId, videoId, variants) {\n function matchesId(id, stream) {\n if (id == null)\n return stream == null;\n else\n return stream.id == id;\n }\n\n for (var i = 0; i < variants.length; i++) {\n if (matchesId(audioId, variants[i].audio) &&\n matchesId(videoId, variants[i].video)) {\n return variants[i];\n }\n }\n\n return null;\n};\n\n\n/**\n * Takes a MIME type and optional codecs string and produces the full MIME type.\n *\n * @param {string} mimeType\n * @param {string=} opt_codecs\n * @return {string}\n */\nshaka.util.StreamUtils.getFullMimeType = function(mimeType, opt_codecs) {\n var fullMimeType = mimeType;\n if (opt_codecs) {\n fullMimeType += '; codecs=\"' + opt_codecs + '\"';\n }\n return fullMimeType;\n};\n\n\n/**\n * Gets the index of the Period that contains the given time.\n * @param {shakaExtern.Manifest} manifest\n * @param {number} time The time in seconds from the start of the presentation.\n * @return {number}\n */\nshaka.util.StreamUtils.findPeriodContainingTime = function(manifest, time) {\n for (var i = manifest.periods.length - 1; i > 0; --i) {\n var period = manifest.periods[i];\n if (time >= period.startTime)\n return i;\n }\n return 0;\n};\n\n\n/**\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.Stream} stream\n * @return {number} The index of the Period which contains |stream|, or -1 if\n * no Period contains |stream|.\n */\nshaka.util.StreamUtils.findPeriodContainingStream = function(manifest, stream) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n for (var periodIdx = 0; periodIdx < manifest.periods.length; ++periodIdx) {\n var period = manifest.periods[periodIdx];\n if (stream.type == ContentType.TEXT) {\n for (var j = 0; j < period.textStreams.length; ++j) {\n var textStream = period.textStreams[j];\n if (textStream == stream)\n return periodIdx;\n }\n } else {\n for (var j = 0; j < period.variants.length; ++j) {\n var variant = period.variants[j];\n if (variant.audio == stream || variant.video == stream ||\n (variant.video && variant.video.trickModeVideo == stream)) {\n return periodIdx;\n }\n }\n }\n }\n return -1;\n};\n\n\n/**\n * Gets the rebuffering goal from the manifest and configuration.\n *\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.StreamingConfiguration} config\n * @param {number} scaleFactor\n *\n * @return {number}\n */\nshaka.util.StreamUtils.getRebufferingGoal = function(\n manifest, config, scaleFactor) {\n return scaleFactor *\n Math.max(manifest.minBufferTime || 0, config.rebufferingGoal);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/stream_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.abr.SimpleAbrManager');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.abr.EwmaBandwidthEstimator');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * <p>\n * This defines the default ABR manager for the Player. An instance of this\n * class is used when no ABR manager is given.\n * </p>\n * <p>\n * The behavior of this class is to take throughput samples using\n * segmentDownloaded to estimate the current network bandwidth. Then it will\n * use that to choose the streams that best fit the current bandwidth. It will\n * always pick the highest bandwidth variant it thinks can be played.\n * </p>\n * <p>\n * After the initial choice (in chooseStreams), this class will call\n * switchCallback() when there is a better choice. switchCallback() will not\n * be called more than once per\n * ({@link shaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS}).\n * </p>\n * <p>\n * This does not adapt for text streams, it will always select the first one.\n * </p>\n *\n * @constructor\n * @struct\n * @implements {shakaExtern.AbrManager}\n * @export\n */\nshaka.abr.SimpleAbrManager = function() {\n /** @private {?shakaExtern.AbrManager.SwitchCallback} */\n this.switch_ = null;\n\n /** @private {boolean} */\n this.enabled_ = false;\n\n /** @private {shaka.abr.EwmaBandwidthEstimator} */\n this.bandwidthEstimator_ = new shaka.abr.EwmaBandwidthEstimator();\n\n /**\n * A filtered list of Variants to choose from.\n * @private {!Array.<!shakaExtern.Variant>}\n */\n this.variants_ = [];\n\n /**\n * A filtered list of text streams to choose from.\n * @private {!Array.<!shakaExtern.Stream>}\n */\n this.textStreams_ = [];\n\n /** @private {boolean} */\n this.startupComplete_ = false;\n\n /**\n * The last wall-clock time, in milliseconds, when Streams were chosen via\n * chooseStreams() or switch_().\n *\n * @private {?number}\n */\n this.lastTimeChosenMs_ = null;\n\n /** @private {shakaExtern.Restrictions} */\n this.restrictions_ = {\n minWidth: 0,\n maxWidth: Infinity,\n minHeight: 0,\n maxHeight: Infinity,\n minPixels: 0,\n maxPixels: Infinity,\n minBandwidth: 0,\n maxBandwidth: Infinity\n };\n};\n\n\n/**\n * The minimum amount of time that must pass between switches, in milliseconds.\n * This keeps us from changing too often and annoying the user.\n *\n * @const {number}\n */\nshaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS = 8000;\n\n\n/**\n * The fraction of the estimated bandwidth which we should try to use when\n * upgrading.\n *\n * @private\n * @const {number}\n */\nshaka.abr.SimpleAbrManager.BANDWIDTH_UPGRADE_TARGET_ = 0.85;\n\n\n/**\n * The largest fraction of the estimated bandwidth we should use. We should\n * downgrade to avoid this.\n *\n * @private\n * @const {number}\n */\nshaka.abr.SimpleAbrManager.BANDWIDTH_DOWNGRADE_TARGET_ = 0.95;\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.stop = function() {\n this.switch_ = null;\n this.enabled_ = false;\n this.variants_ = [];\n this.textStreams_ = [];\n this.lastTimeChosenMs_ = null;\n\n // Don't reset |startupComplete_|: if we've left the startup interval then we\n // can start using bandwidth estimates right away if init() is called again.\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.init = function(switchCallback) {\n this.switch_ = switchCallback;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.chooseStreams = function(\n mediaTypesToUpdate) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n // Choose streams for the specific types requested.\n var chosen = {};\n\n if (mediaTypesToUpdate.indexOf(ContentType.AUDIO) > -1 ||\n mediaTypesToUpdate.indexOf(ContentType.VIDEO) > -1) {\n // Choose a new Variant\n var variant = this.chooseVariant_(this.variants_);\n if (variant && variant.video)\n chosen[ContentType.VIDEO] = variant.video;\n\n if (variant && variant.audio)\n chosen[ContentType.AUDIO] = variant.audio;\n }\n\n if (mediaTypesToUpdate.indexOf(ContentType.TEXT) > -1) {\n // We don't adapt text, so just choose stream 0.\n chosen[ContentType.TEXT] = this.textStreams_[0];\n }\n\n this.lastTimeChosenMs_ = Date.now();\n return chosen;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.enable = function() {\n this.enabled_ = true;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.disable = function() {\n this.enabled_ = false;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.segmentDownloaded = function(\n deltaTimeMs, numBytes) {\n shaka.log.v2('Segment downloaded:',\n 'deltaTimeMs=' + deltaTimeMs,\n 'numBytes=' + numBytes);\n goog.asserts.assert(deltaTimeMs >= 0, 'expected a non-negative duration');\n this.bandwidthEstimator_.sample(deltaTimeMs, numBytes);\n\n if ((this.lastTimeChosenMs_ != null) && this.enabled_)\n this.suggestStreams_();\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.getBandwidthEstimate = function() {\n return this.bandwidthEstimator_.getBandwidthEstimate();\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setDefaultEstimate = function(estimate) {\n this.bandwidthEstimator_.setDefaultEstimate(estimate);\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setRestrictions = function(restrictions) {\n this.restrictions_ = restrictions;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setVariants = function(variants) {\n this.variants_ = variants;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setTextStreams = function(streams) {\n this.textStreams_ = streams;\n};\n\n\n/**\n * Calls switch_() with which Streams to switch to.\n *\n * @private\n */\nshaka.abr.SimpleAbrManager.prototype.suggestStreams_ = function() {\n shaka.log.v2('Suggesting Streams...');\n goog.asserts.assert(this.lastTimeChosenMs_ != null,\n 'lastTimeChosenMs_ should not be null');\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n if (!this.startupComplete_) {\n // Check if we've got enough data yet.\n if (!this.bandwidthEstimator_.hasGoodEstimate()) {\n shaka.log.v2('Still waiting for a good estimate...');\n return;\n }\n this.startupComplete_ = true;\n } else {\n // Check if we've left the switch interval.\n var now = Date.now();\n var delta = now - this.lastTimeChosenMs_;\n if (delta < shaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS) {\n shaka.log.v2('Still within switch interval...');\n return;\n }\n }\n\n var chosen = this.chooseStreams([ContentType.AUDIO, ContentType.VIDEO]);\n var currentBandwidthKbps =\n Math.round(this.bandwidthEstimator_.getBandwidthEstimate() / 1000.0);\n shaka.log.debug(\n 'Calling switch_(), bandwidth=' + currentBandwidthKbps + ' kbps');\n // If any of these chosen streams are already chosen, Player will filter them\n // out before passing the choices on to StreamingEngine.\n this.switch_(chosen);\n};\n\n\n/**\n * Chooses a Variant with an optimal bandwidth.\n *\n * @param {!Array.<shakaExtern.Variant>} variants\n * @return {shakaExtern.Variant}\n * @private\n */\nshaka.abr.SimpleAbrManager.prototype.chooseVariant_ = function(variants) {\n // Alias.\n var SimpleAbrManager = shaka.abr.SimpleAbrManager;\n\n // Get sorted Streams.\n var sortedVariants = SimpleAbrManager.filterAndSortVariants_(\n this.restrictions_, variants);\n var currentBandwidth = this.bandwidthEstimator_.getBandwidthEstimate();\n\n if (variants.length && !sortedVariants.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET);\n }\n\n // Start by assuming that we will use the first Stream.\n var chosen = sortedVariants[0];\n\n for (var i = 0; i < sortedVariants.length; ++i) {\n var variant = sortedVariants[i];\n var nextVariant = sortedVariants[i + 1] || {bandwidth: Infinity};\n\n var minBandwidth = variant.bandwidth /\n SimpleAbrManager.BANDWIDTH_DOWNGRADE_TARGET_;\n var maxBandwidth = nextVariant.bandwidth /\n SimpleAbrManager.BANDWIDTH_UPGRADE_TARGET_;\n shaka.log.v2('Bandwidth ranges:',\n (variant.bandwidth / 1e6).toFixed(3),\n (minBandwidth / 1e6).toFixed(3),\n (maxBandwidth / 1e6).toFixed(3));\n\n if (currentBandwidth >= minBandwidth && currentBandwidth <= maxBandwidth)\n chosen = variant;\n }\n\n return chosen;\n};\n\n\n/**\n * @param {shakaExtern.Restrictions} restrictions\n * @param {!Array.<shakaExtern.Variant>} variants\n * @return {!Array.<shakaExtern.Variant>} variants filtered according to\n * |restrictions| and sorted in ascending order of bandwidth.\n * @private\n */\nshaka.abr.SimpleAbrManager.filterAndSortVariants_ = function(\n restrictions, variants) {\n return variants\n .filter(function(variant) {\n return shaka.util.StreamUtils.meetsRestrictions(\n variant, restrictions,\n /* maxHwRes */ {width: Infinity, height: Infinity});\n })\n .sort(function(v1, v2) {\n return v1.bandwidth - v2.bandwidth;\n });\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/abr/simple_abr_manager.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.FakeEvent');\n\n\n\n/**\n * Create an Event work-alike object based on the dictionary.\n * The event should contain all of the same properties from the dict.\n *\n * @param {string} type\n * @param {Object=} opt_dict\n * @constructor\n * @extends {Event}\n */\nshaka.util.FakeEvent = function(type, opt_dict) {\n // Take properties from dict if present.\n var dict = opt_dict || {};\n for (var key in dict) {\n this[key] = dict[key];\n }\n\n\n // These Properties below cannot be set by dict. They are all provided for\n // compatibility with native events.\n\n /** @const {boolean} */\n this.bubbles = false;\n\n /** @type {boolean} */\n this.cancelable = false;\n\n /** @type {boolean} */\n this.defaultPrevented = false;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n this.timeStamp = window.performance && window.performance.now ?\n window.performance.now() : Date.now();\n\n /** @const {string} */\n this.type = type;\n\n /** @const {boolean} */\n this.isTrusted = false;\n\n /** @type {EventTarget} */\n this.currentTarget = null;\n\n /** @type {EventTarget} */\n this.target = null;\n\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n this.stopped = false;\n};\n\n\n/**\n * Prevents the default action of the event. Has no effect if the event isn't\n * cancellable.\n * @override\n */\nshaka.util.FakeEvent.prototype.preventDefault = function() {\n if (this.cancelable)\n this.defaultPrevented = true;\n};\n\n\n/**\n * Stops processing event listeners for this event. Provided for compatibility\n * with native Events.\n * @override\n */\nshaka.util.FakeEvent.prototype.stopImmediatePropagation = function() {\n this.stopped = true;\n};\n\n\n/**\n * Does nothing, since FakeEvents do not bubble. Provided for compatibility\n * with native Events.\n * @override\n */\nshaka.util.FakeEvent.prototype.stopPropagation = function() {};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/fake_event.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastUtils');\n\ngoog.require('shaka.util.FakeEvent');\n\n\n/**\n * @namespace shaka.cast.CastUtils\n * @summary A set of cast utility functions and variables shared between sender\n * and receiver.\n */\n\n\n/**\n * HTMLMediaElement events that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoEvents = [\n 'ended',\n 'play',\n 'playing',\n 'pause',\n 'pausing',\n 'ratechange',\n 'seeked',\n 'seeking',\n 'timeupdate',\n 'volumechange'\n];\n\n\n/**\n * HTMLMediaElement attributes that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoAttributes = [\n 'buffered',\n 'currentTime',\n 'duration',\n 'ended',\n 'loop',\n 'muted',\n 'paused',\n 'playbackRate',\n 'seeking',\n 'videoHeight',\n 'videoWidth',\n 'volume'\n];\n\n\n/**\n * HTMLMediaElement attributes that are transferred when casting begins.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoInitStateAttributes = [\n 'loop',\n 'playbackRate'\n];\n\n\n/**\n * HTMLMediaElement methods with no return value that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoVoidMethods = [\n 'pause',\n 'play'\n];\n\n\n/**\n * Player events that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerEvents = [\n 'adaptation',\n 'buffering',\n 'emsg',\n 'error',\n 'loading',\n 'unloading',\n 'texttrackvisibility',\n 'timelineregionadded',\n 'timelineregionenter',\n 'timelineregionexit',\n 'trackschanged'\n];\n\n\n/**\n * Player getter methods that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerGetterMethods = [\n 'drmInfo',\n 'getAudioLanguages',\n 'getConfiguration',\n 'getExpiration',\n 'getManifestUri',\n 'getPlaybackRate',\n 'getPlayheadTimeAsDate',\n 'getTextLanguages',\n 'getTextTracks',\n 'getTracks',\n 'getStats',\n 'getVariantTracks',\n 'isBuffering',\n 'isInProgress',\n 'isLive',\n 'isTextTrackVisible',\n 'keySystem',\n 'seekRange'\n];\n\n\n/**\n * Player getter and setter methods that are used to transfer state when casting\n * begins.\n * @const {!Array.<!Array.<string>>}\n */\nshaka.cast.CastUtils.PlayerInitState = [\n ['getConfiguration', 'configure']\n];\n\n\n/**\n * Player getter and setter methods that are used to transfer state after\n * after load() is resolved.\n * @const {!Array.<!Array.<string>>}\n */\nshaka.cast.CastUtils.PlayerInitAfterLoadState = [\n ['isTextTrackVisible', 'setTextTrackVisibility']\n];\n\n\n/**\n * Player methods with no return value that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerVoidMethods = [\n 'addTextTrack',\n 'cancelTrickPlay',\n 'configure',\n 'resetConfiguration',\n 'selectAudioLanguage',\n 'selectTextLanguage',\n 'selectTextTrack',\n 'selectTrack',\n 'selectVariantTrack',\n 'setTextTrackVisibility',\n 'trickPlay'\n];\n\n\n/**\n * Player methods returning a Promise that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerPromiseMethods = [\n // The opt_manifestFactory method is not supported.\n 'load',\n 'unload'\n];\n\n\n/**\n * @typedef {{\n * video: Object,\n * player: Object,\n * manifest: ?string,\n * startTime: ?number\n * }}\n * @property {Object} video\n * Dictionary of video properties to be set.\n * @property {Object} player\n * Dictionary of player setters to be called.\n * @property {?string} manifest\n * The currently-selected manifest, if present.\n * @property {?number} startTime\n * The playback start time, if currently playing.\n */\nshaka.cast.CastUtils.InitStateType;\n\n\n/**\n * The namespace for Shaka messages on the cast bus.\n * @const {string}\n */\nshaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE = 'urn:x-cast:com.google.shaka.v2';\n\n\n/**\n * The namespace for generic messages on the cast bus.\n * @const {string}\n */\nshaka.cast.CastUtils.GENERIC_MESSAGE_NAMESPACE =\n 'urn:x-cast:com.google.cast.media';\n\n\n/**\n * Serialize as JSON, but specially encode things JSON will not otherwise\n * represent.\n * @param {?} thing\n * @return {string}\n */\nshaka.cast.CastUtils.serialize = function(thing) {\n return JSON.stringify(thing, function(key, value) {\n if (key == 'manager') {\n // ABR manager can't be serialized.\n return undefined;\n }\n if (typeof value == 'function') {\n // Functions can't be (safely) serialized.\n return undefined;\n }\n if (value instanceof Event || value instanceof shaka.util.FakeEvent) {\n // Events don't serialize to JSON well because of the DOM objects\n // and other complex objects they contain. So we strip these out.\n // Note that using Object.keys or JSON.stringify directly on the event\n // will not capture its properties. We must use a for loop.\n var simpleEvent = {};\n for (var eventKey in value) {\n var eventValue = value[eventKey];\n if (eventValue && typeof eventValue == 'object') {\n // Strip out non-null object types because they are complex and we\n // don't need them.\n } else if (eventKey in Event) {\n // Strip out keys that are found on Event itself because they are\n // class-level constants we don't need, like Event.MOUSEMOVE == 16.\n } else {\n simpleEvent[eventKey] = eventValue;\n }\n }\n return simpleEvent;\n }\n if (value instanceof TimeRanges) {\n // TimeRanges must be unpacked into plain data for serialization.\n return shaka.cast.CastUtils.unpackTimeRanges_(value);\n }\n if (typeof value == 'number') {\n // NaN and infinity cannot be represented directly in JSON.\n if (isNaN(value)) return 'NaN';\n if (isFinite(value)) return value;\n if (value < 0) return '-Infinity';\n return 'Infinity';\n }\n return value;\n });\n};\n\n\n/**\n * Deserialize JSON using our special encodings.\n * @param {string} str\n * @return {?}\n */\nshaka.cast.CastUtils.deserialize = function(str) {\n return JSON.parse(str, function(key, value) {\n if (value == 'NaN') {\n return NaN;\n } else if (value == '-Infinity') {\n return -Infinity;\n } else if (value == 'Infinity') {\n return Infinity;\n } else if (value && typeof value == 'object' &&\n value['__type__'] == 'TimeRanges') {\n // TimeRanges objects have been unpacked and sent as plain data.\n // Simulate the original TimeRanges object.\n return shaka.cast.CastUtils.simulateTimeRanges_(value);\n }\n return value;\n });\n};\n\n\n/**\n * @param {!TimeRanges} ranges\n * @return {Object}\n * @private\n */\nshaka.cast.CastUtils.unpackTimeRanges_ = function(ranges) {\n var obj = {\n '__type__': 'TimeRanges', // a signal to deserialize\n 'length': ranges.length,\n 'start': [],\n 'end': []\n };\n\n for (var i = 0; i < ranges.length; ++i) {\n obj['start'].push(ranges.start(i));\n obj['end'].push(ranges.end(i));\n }\n\n return obj;\n};\n\n\n/**\n * Creates a simulated TimeRanges object from data sent by the cast receiver.\n * @param {?} obj\n * @return {{\n * length: number,\n * start: function(number): number,\n * end: function(number): number\n * }}\n * @private\n */\nshaka.cast.CastUtils.simulateTimeRanges_ = function(obj) {\n return {\n length: obj.length,\n // NOTE: a more complete simulation would throw when |i| was out of range,\n // but for simplicity we will assume a well-behaved application that uses\n // length instead of catch to stop iterating.\n start: function(i) { return obj.start[i]; },\n end: function(i) { return obj.end[i]; }\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastSender');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.cast.CastUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * @constructor\n * @struct\n * @param {string} receiverAppId The ID of the cast receiver application.\n * @param {function()} onStatusChanged A callback invoked when the cast status\n * changes.\n * @param {function(string, !shaka.util.FakeEvent)} onRemoteEvent A callback\n * invoked with target name and event when a remote event is received.\n * @param {function()} onResumeLocal A callback invoked when the local player\n * should resume playback. Called before cached remote state is wiped.\n * @param {function()} onInitStateRequired A callback to get local player's.\n * state. Invoked when casting is initiated from Chrome's cast button.\n * @implements {shaka.util.IDestroyable}\n */\nshaka.cast.CastSender =\n function(receiverAppId, onStatusChanged, onRemoteEvent, onResumeLocal,\n onInitStateRequired) {\n /** @private {string} */\n this.receiverAppId_ = receiverAppId;\n\n /** @private {?function()} */\n this.onStatusChanged_ = onStatusChanged;\n\n /** @private {?function(string, !shaka.util.FakeEvent)} */\n this.onRemoteEvent_ = onRemoteEvent;\n\n /** @private {?function()} */\n this.onResumeLocal_ = onResumeLocal;\n\n /** @private {?function()} */\n this.onInitStateRequired_ = onInitStateRequired;\n\n /** @private {boolean} */\n this.apiReady_ = false;\n\n /** @private {boolean} */\n this.hasReceivers_ = false;\n\n /** @private {boolean} */\n this.isCasting_ = false;\n\n /** @private {string} */\n this.receiverName_ = '';\n\n /** @private {Object} */\n this.appData_ = null;\n\n /** @private {chrome.cast.Session} */\n this.session_ = null;\n\n /** @private {Object} */\n this.cachedProperties_ = {\n 'video': {},\n 'player': {}\n };\n\n /** @private {number} */\n this.nextAsyncCallId_ = 0;\n\n /** @private {Object.<string, !shaka.util.PublicPromise>} */\n this.asyncCallPromises_ = {};\n\n /** @private {shaka.util.PublicPromise} */\n this.castPromise_ = null;\n};\n\n\n/** @override */\nshaka.cast.CastSender.prototype.destroy = function() {\n this.rejectAllPromises_();\n if (this.session_) {\n this.session_.leave(function() {}, function() {});\n this.session_ = null;\n }\n\n this.onStatusChanged_ = null;\n this.onRemoteEvent_ = null;\n this.onResumeLocal_ = null;\n this.apiReady_ = false;\n this.hasReceivers_ = false;\n this.isCasting_ = false;\n this.appData_ = null;\n this.cachedProperties_ = null;\n this.asyncCallPromises_ = null;\n this.castPromise_ = null;\n\n return Promise.resolve();\n};\n\n\n/**\n * @return {boolean} True if the cast API is available.\n */\nshaka.cast.CastSender.prototype.apiReady = function() {\n return this.apiReady_;\n};\n\n\n/**\n * @return {boolean} True if there are receivers.\n */\nshaka.cast.CastSender.prototype.hasReceivers = function() {\n return this.hasReceivers_;\n};\n\n\n/**\n * @return {boolean} True if we are currently casting.\n */\nshaka.cast.CastSender.prototype.isCasting = function() {\n return this.isCasting_;\n};\n\n\n/**\n * @return {string} The name of the Cast receiver device, if isCasting().\n */\nshaka.cast.CastSender.prototype.receiverName = function() {\n return this.receiverName_;\n};\n\n\n/**\n * @return {boolean} True if we have a cache of remote properties from the\n * receiver.\n */\nshaka.cast.CastSender.prototype.hasRemoteProperties = function() {\n return Object.keys(this.cachedProperties_['video']).length != 0;\n};\n\n\n/**\n * Initialize the Cast API.\n */\nshaka.cast.CastSender.prototype.init = function() {\n // Check for the cast extension.\n if (!window.chrome || !chrome.cast || !chrome.cast.isAvailable) {\n // Not available yet, so wait to be notified if/when it is available.\n window.__onGCastApiAvailable = (function(loaded) {\n if (loaded) {\n this.init();\n }\n }).bind(this);\n return;\n }\n\n // The API is now available.\n delete window.__onGCastApiAvailable;\n this.apiReady_ = true;\n this.onStatusChanged_();\n\n var sessionRequest = new chrome.cast.SessionRequest(this.receiverAppId_);\n var apiConfig = new chrome.cast.ApiConfig(sessionRequest,\n this.onExistingSessionJoined_.bind(this),\n this.onReceiverStatusChanged_.bind(this),\n 'origin_scoped');\n\n // TODO: have never seen this fail. when would it and how should we react?\n chrome.cast.initialize(apiConfig,\n function() { shaka.log.debug('CastSender: init'); },\n function(error) { shaka.log.error('CastSender: init error', error); });\n};\n\n\n/**\n * Set application-specific data.\n *\n * @param {Object} appData Application-specific data to relay to the receiver.\n */\nshaka.cast.CastSender.prototype.setAppData = function(appData) {\n this.appData_ = appData;\n if (this.isCasting_) {\n this.sendMessage_({\n 'type': 'appData',\n 'appData': this.appData_\n });\n }\n};\n\n\n/**\n * @param {shaka.cast.CastUtils.InitStateType} initState Video and player state\n * to be sent to the receiver.\n * @return {!Promise} Resolved when connected to a receiver. Rejected if the\n * connection fails or is canceled by the user.\n */\nshaka.cast.CastSender.prototype.cast = function(initState) {\n if (!this.apiReady_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.CAST,\n shaka.util.Error.Code.CAST_API_UNAVAILABLE));\n }\n if (!this.hasReceivers_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.CAST,\n shaka.util.Error.Code.NO_CAST_RECEIVERS));\n }\n if (this.isCasting_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.CAST,\n shaka.util.Error.Code.ALREADY_CASTING));\n }\n\n this.castPromise_ = new shaka.util.PublicPromise();\n chrome.cast.requestSession(\n this.onSessionInitiated_.bind(this, initState),\n this.onConnectionError_.bind(this));\n return this.castPromise_;\n};\n\n\n/**\n * Shows user a cast dialog where they can choose to stop\n * casting. Relies on Chrome to perform disconnect if they do.\n * Doesn't do anything if not connected.\n */\nshaka.cast.CastSender.prototype.showDisconnectDialog = function() {\n if (!this.isCasting_) {\n return;\n }\n var initState = this.onInitStateRequired_();\n\n chrome.cast.requestSession(\n this.onSessionInitiated_.bind(this, initState),\n this.onConnectionError_.bind(this));\n};\n\n\n/**\n * Forces the receiver app to shut down by disconnecting. Does nothing if not\n * connected.\n */\nshaka.cast.CastSender.prototype.forceDisconnect = function() {\n if (!this.isCasting_) {\n return;\n }\n\n this.rejectAllPromises_();\n if (this.session_) {\n this.session_.stop(function() {}, function() {});\n this.session_ = null;\n }\n};\n\n\n/**\n * Getter for properties of remote objects.\n * @param {string} targetName\n * @param {string} property\n * @return {?}\n */\nshaka.cast.CastSender.prototype.get = function(targetName, property) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n if (targetName == 'video') {\n if (shaka.cast.CastUtils.VideoVoidMethods.indexOf(property) >= 0) {\n return this.remoteCall_.bind(this, targetName, property);\n }\n } else if (targetName == 'player') {\n if (shaka.cast.CastUtils.PlayerVoidMethods.indexOf(property) >= 0) {\n return this.remoteCall_.bind(this, targetName, property);\n }\n if (shaka.cast.CastUtils.PlayerPromiseMethods.indexOf(property) >= 0) {\n return this.remoteAsyncCall_.bind(this, targetName, property);\n }\n if (shaka.cast.CastUtils.PlayerGetterMethods.indexOf(property) >= 0) {\n return this.propertyGetter_.bind(this, targetName, property);\n }\n }\n\n return this.propertyGetter_(targetName, property);\n};\n\n\n/**\n * Setter for properties of remote objects.\n * @param {string} targetName\n * @param {string} property\n * @param {?} value\n */\nshaka.cast.CastSender.prototype.set = function(targetName, property, value) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n\n this.cachedProperties_[targetName][property] = value;\n this.sendMessage_({\n 'type': 'set',\n 'targetName': targetName,\n 'property': property,\n 'value': value\n });\n};\n\n\n/**\n * @param {shaka.cast.CastUtils.InitStateType} initState\n * @param {chrome.cast.Session} session\n * @private\n */\nshaka.cast.CastSender.prototype.onSessionInitiated_ =\n function(initState, session) {\n shaka.log.debug('CastSender: onSessionInitiated');\n this.onSessionCreated_(session);\n\n this.sendMessage_({\n 'type': 'init',\n 'initState': initState,\n 'appData': this.appData_\n });\n\n this.castPromise_.resolve();\n};\n\n\n/**\n * @param {chrome.cast.Error} error\n * @private\n */\nshaka.cast.CastSender.prototype.onConnectionError_ = function(error) {\n // Default error code:\n var code = shaka.util.Error.Code.UNEXPECTED_CAST_ERROR;\n\n switch (error.code) {\n case 'cancel':\n code = shaka.util.Error.Code.CAST_CANCELED_BY_USER;\n break;\n case 'timeout':\n code = shaka.util.Error.Code.CAST_CONNECTION_TIMED_OUT;\n break;\n case 'receiver_unavailable':\n code = shaka.util.Error.Code.CAST_RECEIVER_APP_UNAVAILABLE;\n break;\n }\n\n this.castPromise_.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.CAST,\n code,\n error));\n};\n\n\n/**\n * @param {string} targetName\n * @param {string} property\n * @return {?}\n * @private\n */\nshaka.cast.CastSender.prototype.propertyGetter_ =\n function(targetName, property) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n return this.cachedProperties_[targetName][property];\n};\n\n\n/**\n * @param {string} targetName\n * @param {string} methodName\n * @private\n */\nshaka.cast.CastSender.prototype.remoteCall_ =\n function(targetName, methodName) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n var args = Array.prototype.slice.call(arguments, 2);\n this.sendMessage_({\n 'type': 'call',\n 'targetName': targetName,\n 'methodName': methodName,\n 'args': args\n });\n};\n\n\n/**\n * @param {string} targetName\n * @param {string} methodName\n * @return {!Promise}\n * @private\n */\nshaka.cast.CastSender.prototype.remoteAsyncCall_ =\n function(targetName, methodName) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n var args = Array.prototype.slice.call(arguments, 2);\n\n var p = new shaka.util.PublicPromise();\n var id = this.nextAsyncCallId_.toString();\n this.nextAsyncCallId_++;\n this.asyncCallPromises_[id] = p;\n\n this.sendMessage_({\n 'type': 'asyncCall',\n 'targetName': targetName,\n 'methodName': methodName,\n 'args': args,\n 'id': id\n });\n return p;\n};\n\n\n/**\n * @param {chrome.cast.Session} session\n * @private\n */\nshaka.cast.CastSender.prototype.onExistingSessionJoined_ = function(session) {\n shaka.log.debug('CastSender: onExistingSessionJoined');\n\n var initState = this.onInitStateRequired_();\n\n this.castPromise_ = new shaka.util.PublicPromise();\n\n this.onSessionInitiated_(initState, session);\n};\n\n\n/**\n * @param {string} availability\n * @private\n */\nshaka.cast.CastSender.prototype.onReceiverStatusChanged_ =\n function(availability) {\n // The cast extension is telling us whether there are any cast receiver\n // devices available.\n shaka.log.debug('CastSender: receiver status', availability);\n this.hasReceivers_ = availability == 'available';\n this.onStatusChanged_();\n};\n\n\n/**\n * @param {chrome.cast.Session} session\n * @private\n */\nshaka.cast.CastSender.prototype.onSessionCreated_ = function(session) {\n this.session_ = session;\n this.session_.addUpdateListener(this.onConnectionStatusChanged_.bind(this));\n this.session_.addMessageListener(\n shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE,\n this.onMessageReceived_.bind(this));\n this.onConnectionStatusChanged_();\n};\n\n\n/**\n * @private\n */\nshaka.cast.CastSender.prototype.onConnectionStatusChanged_ = function() {\n var connected = this.session_ ? this.session_.status == 'connected' : false;\n shaka.log.debug('CastSender: connection status', connected);\n if (this.isCasting_ && !connected) {\n // Tell CastProxy to transfer state back to local player.\n this.onResumeLocal_();\n\n // Clear whatever we have cached.\n for (var targetName in this.cachedProperties_) {\n this.cachedProperties_[targetName] = {};\n }\n\n this.rejectAllPromises_();\n }\n\n this.isCasting_ = connected;\n this.receiverName_ = connected ? this.session_.receiver.friendlyName : '';\n this.onStatusChanged_();\n};\n\n\n/**\n * Reject any async call promises that are still pending.\n * @private\n */\nshaka.cast.CastSender.prototype.rejectAllPromises_ = function() {\n for (var id in this.asyncCallPromises_) {\n var p = this.asyncCallPromises_[id];\n delete this.asyncCallPromises_[id];\n\n // Reject pending async operations as if they were interrupted.\n // At the moment, load() is the only async operation we are worried\n // about.\n p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.PLAYER,\n shaka.util.Error.Code.LOAD_INTERRUPTED));\n }\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages are\n * read with quoted properties.\n * @param {string} namespace\n * @param {string} serialized\n * @private\n */\nshaka.cast.CastSender.prototype.onMessageReceived_ =\n function(namespace, serialized) {\n var message = shaka.cast.CastUtils.deserialize(serialized);\n shaka.log.v2('CastSender: message', message);\n\n switch (message['type']) {\n case 'event':\n var targetName = message['targetName'];\n var event = message['event'];\n var fakeEvent = new shaka.util.FakeEvent(event['type'], event);\n this.onRemoteEvent_(targetName, fakeEvent);\n break;\n case 'update':\n var update = message['update'];\n for (var targetName in update) {\n var target = this.cachedProperties_[targetName] || {};\n for (var property in update[targetName]) {\n target[property] = update[targetName][property];\n }\n }\n break;\n case 'asyncComplete':\n var id = message['id'];\n var error = message['error'];\n var p = this.asyncCallPromises_[id];\n delete this.asyncCallPromises_[id];\n\n goog.asserts.assert(p, 'Unexpected async id');\n if (!p) break;\n\n if (error) {\n // This is a hacky way to reconstruct the serialized error.\n var reconstructedError = new shaka.util.Error(\n error.severity, error.category, error.code);\n for (var k in error) {\n (/** @type {Object} */(reconstructedError))[k] = error[k];\n }\n p.reject(reconstructedError);\n } else {\n p.resolve();\n }\n break;\n }\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages passed\n * in here were created with quoted property names.\n * @param {!Object} message\n * @private\n */\nshaka.cast.CastSender.prototype.sendMessage_ = function(message) {\n var serialized = shaka.cast.CastUtils.serialize(message);\n // TODO: have never seen this fail. When would it and how should we react?\n this.session_.sendMessage(shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE,\n serialized,\n function() {}, // success callback\n shaka.log.error); // error callback\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_sender.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.FakeEventTarget');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.MultiMap');\n\n\n\n/**\n * A work-alike for EventTarget. Only DOM elements may be true EventTargets,\n * but this can be used as a base class to provide event dispatch to non-DOM\n * classes. Only FakeEvents should be dispatched.\n *\n * @struct\n * @constructor\n * @implements {EventTarget}\n * @exportInterface\n */\nshaka.util.FakeEventTarget = function() {\n /**\n * @private {!shaka.util.MultiMap.<shaka.util.FakeEventTarget.ListenerType>}\n */\n this.listeners_ = new shaka.util.MultiMap();\n\n /**\n * The target of all dispatched events. Defaults to |this|.\n * @type {EventTarget}\n */\n this.dispatchTarget = this;\n};\n\n\n/**\n * These are the listener types defined in the closure extern for EventTarget.\n * @typedef {EventListener|function(!Event):(boolean|undefined)}\n * @exportInterface\n */\nshaka.util.FakeEventTarget.ListenerType;\n\n\n/**\n * Add an event listener to this object.\n *\n * @param {string} type The event type to listen for.\n * @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or\n * listener object to invoke.\n * @param {(EventListenerOptions|boolean)=} opt_options Ignored.\n * @override\n * @exportInterface\n */\nshaka.util.FakeEventTarget.prototype.addEventListener =\n function(type, listener, opt_options) {\n this.listeners_.push(type, listener);\n};\n\n\n/**\n * Remove an event listener from this object.\n *\n * @param {string} type The event type for which you wish to remove a listener.\n * @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or\n * listener object to remove.\n * @param {(EventListenerOptions|boolean)=} opt_options Ignored.\n * @override\n * @exportInterface\n */\nshaka.util.FakeEventTarget.prototype.removeEventListener =\n function(type, listener, opt_options) {\n this.listeners_.remove(type, listener);\n};\n\n\n/**\n * Dispatch an event from this object.\n *\n * @param {!Event} event The event to be dispatched from this object.\n * @return {boolean} True if the default action was prevented.\n * @override\n * @exportInterface\n */\nshaka.util.FakeEventTarget.prototype.dispatchEvent = function(event) {\n // In many browsers, it is complex to overwrite properties of actual Events.\n // Here we expect only to dispatch FakeEvents, which are simpler.\n goog.asserts.assert(event instanceof shaka.util.FakeEvent,\n 'FakeEventTarget can only dispatch FakeEvents!');\n\n var list = this.listeners_.get(event.type) || [];\n\n for (var i = 0; i < list.length; ++i) {\n // Do this every time, since events can be re-dispatched from handlers.\n event.target = this.dispatchTarget;\n event.currentTarget = this.dispatchTarget;\n\n var listener = list[i];\n try {\n if (listener.handleEvent) {\n listener.handleEvent(event);\n } else {\n listener.call(this, event);\n }\n } catch (exception) {\n // Exceptions during event handlers should not affect the caller,\n // but should appear on the console as uncaught, according to MDN:\n // http://goo.gl/N6Ff27\n shaka.log.error('Uncaught exception in event handler', exception);\n }\n\n if (event.stopped) {\n break;\n }\n }\n\n return event.defaultPrevented;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/fake_event_target.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.Player');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.abr.EwmaBandwidthEstimator');\ngoog.require('shaka.abr.SimpleAbrManager');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.MediaSourceEngine');\ngoog.require('shaka.media.Playhead');\ngoog.require('shaka.media.PlayheadObserver');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.media.StreamingEngine');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.CancelableChain');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * Construct a Player.\n *\n * @param {!HTMLMediaElement} video Any existing TextTracks attached to this\n * element that were not created by Shaka will be disabled. A new TextTrack\n * may be created to display captions or subtitles.\n * @param {function(shaka.Player)=} opt_dependencyInjector Optional callback\n * which is called to inject mocks into the Player. Used for testing.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n * @extends {shaka.util.FakeEventTarget}\n * @export\n */\nshaka.Player = function(video, opt_dependencyInjector) {\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {boolean} */\n this.destroyed_ = false;\n\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {TextTrack} */\n this.textTrack_ = null;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {shakaExtern.AbrManager} */\n this.defaultAbrManager_ = new shaka.abr.SimpleAbrManager();\n\n /** @private {shaka.net.NetworkingEngine} */\n this.networkingEngine_ = null;\n\n /** @private {shaka.media.DrmEngine} */\n this.drmEngine_ = null;\n\n /** @private {MediaSource} */\n this.mediaSource_ = null;\n\n /** @private {shaka.media.MediaSourceEngine} */\n this.mediaSourceEngine_ = null;\n\n /** @private {Promise} */\n this.mediaSourceOpen_ = null;\n\n /** @private {shaka.media.Playhead} */\n this.playhead_ = null;\n\n /** @private {shaka.media.PlayheadObserver} */\n this.playheadObserver_ = null;\n\n /** @private {shaka.media.StreamingEngine} */\n this.streamingEngine_ = null;\n\n /** @private {shakaExtern.ManifestParser} */\n this.parser_ = null;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = null;\n\n /** @private {?string} */\n this.manifestUri_ = null;\n\n /**\n * Contains an ID for use with creating streams. The manifest parser should\n * start with small IDs, so this starts with a large one.\n * @private {number}\n */\n this.nextExternalStreamId_ = 1e9;\n\n /** @private {!Array.<number>} */\n this.loadingTextStreamIds_ = [];\n\n /** @private {boolean} */\n this.buffering_ = false;\n\n /** @private {boolean} */\n this.switchingPeriods_ = true;\n\n /** @private {shaka.util.CancelableChain} */\n this.loadChain_ = null;\n\n /** @private {Promise} */\n this.unloadChain_ = null;\n\n /**\n * @private {!Object.<shaka.util.ManifestParserUtils.ContentType, {\n * stream: shakaExtern.Stream,\n * clearBuffer: boolean\n * }>}\n */\n this.deferredSwitches_ = {};\n\n /** @private {!Array.<shakaExtern.TimelineRegionInfo>} */\n this.pendingTimelineRegions_ = [];\n\n /**\n * A map of Period number to a map of content type to stream id.\n * @private {!Object.<number, !Object.<string, number>>}\n */\n this.activeStreamsByPeriod_ = {};\n\n /** @private {?shakaExtern.PlayerConfiguration} */\n this.config_ = this.defaultConfig_();\n\n /** @private {{width: number, height: number}} */\n this.maxHwRes_ = { width: Infinity, height: Infinity };\n\n /** @private {shakaExtern.Stats} */\n this.stats_ = this.getCleanStats_();\n\n /** @private {number} */\n this.lastTimeStatsUpdateTimestamp_ = 0;\n\n /** @private {string} */\n this.currentAudioLanguage_ = this.config_.preferredAudioLanguage;\n\n /** @private {string} */\n this.currentTextLanguage_ = this.config_.preferredTextLanguage;\n\n /** @private {string} */\n this.currentVariantRole_ = '';\n\n /** @private {string} */\n this.currentTextRole_ = '';\n\n if (opt_dependencyInjector)\n opt_dependencyInjector(this);\n\n this.networkingEngine_ = this.createNetworkingEngine();\n this.initialize_();\n};\ngoog.inherits(shaka.Player, shaka.util.FakeEventTarget);\n\n\n/**\n * After destruction, a Player object cannot be used again.\n *\n * @override\n * @export\n */\nshaka.Player.prototype.destroy = function() {\n this.destroyed_ = true;\n\n var cancelation = Promise.resolve();\n if (this.loadChain_) {\n // A load is in progress. Cancel it.\n cancelation = this.loadChain_.cancel(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.PLAYER,\n shaka.util.Error.Code.LOAD_INTERRUPTED));\n }\n\n return cancelation.then(function() {\n var p = Promise.all([\n // We need to destroy the current fields as well as waiting for an\n // existing unload to complete. It is fine to call destroyStreaming_ if\n // there is an unload since it resets the fields immediately.\n this.unloadChain_,\n this.destroyStreaming_(),\n this.eventManager_ ? this.eventManager_.destroy() : null,\n this.networkingEngine_ ? this.networkingEngine_.destroy() : null\n ]);\n\n this.video_ = null;\n this.textTrack_ = null;\n this.eventManager_ = null;\n this.defaultAbrManager_ = null;\n this.networkingEngine_ = null;\n this.config_ = null;\n\n return p;\n }.bind(this));\n};\n\n\n/**\n * @define {string} A version number taken from git at compile time.\n */\ngoog.define('GIT_VERSION', 'v2.1.4-debug');\n\n\n/**\n * @const {string}\n * @export\n */\nshaka.Player.version = GIT_VERSION;\n\n\n/**\n * @event shaka.Player.ErrorEvent\n * @description Fired when a playback error occurs.\n * @property {string} type\n * 'error'\n * @property {!shaka.util.Error} detail\n * An object which contains details on the error. The error's 'category' and\n * 'code' properties will identify the specific error that occured. In an\n * uncompiled build, you can also use the 'message' and 'stack' properties\n * to debug.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.EmsgEvent\n * @description Fired when a non-typical emsg is found in a segment.\n * @property {string} type\n * 'emsg'\n * @property {shakaExtern.EmsgInfo} detail\n * An object which contains the content of the emsg box.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TimelineRegionAdded\n * @description Fired when a media timeline region is added.\n * @property {string} type\n * 'timelineregionadded'\n * @property {shakaExtern.TimelineRegionInfo} detail\n * An object which contains a description of the region.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TimelineRegionEnter\n * @description Fired when the playhead enters a timeline region.\n * @property {string} type\n * 'timelineregionenter'\n * @property {shakaExtern.TimelineRegionInfo} detail\n * An object which contains a description of the region.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TimelineRegionExit\n * @description Fired when the playhead exits a timeline region.\n * @property {string} type\n * 'timelineregionexit'\n * @property {shakaExtern.TimelineregionInfo} detail\n * An object which contains a description of the region.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.BufferingEvent\n * @description Fired when the player's buffering state changes.\n * @property {string} type\n * 'buffering'\n * @property {boolean} buffering\n * True when the Player enters the buffering state.\n * False when the Player leaves the buffering state.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.LoadingEvent\n * @description Fired when the player begins loading.\n * Used by the Cast receiver to determine idle state.\n * @property {string} type\n * 'loading'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.UnloadingEvent\n * @description Fired when the player unloads or fails to load.\n * Used by the Cast receiver to determine idle state.\n * @property {string} type\n * 'unloading'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TextTrackVisibilityEvent\n * @description Fired when text track visibility changes.\n * @property {string} type\n * 'texttrackvisibility'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TracksChangedEvent\n * @description Fired when the list of tracks changes. For example, this will\n * happen when changing periods or when track restrictions change.\n * @property {string} type\n * 'trackschanged'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.AdaptationEvent\n * @description Fired when an automatic adaptation causes the active tracks\n * to change. Does not fire when the application calls selectVariantTrack()\n * selectTextTrack(), selectAudioLanguage() or selectTextLanguage().\n * @property {string} type\n * 'adaptation'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.ExpirationUpdatedEvent\n * @description Fired when there is a change in the expiration times of an\n * EME session.\n * @property {string} type\n * 'expirationupdated'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.LargeGapEvent\n * @description Fired when the playhead enters a large gap. If\n * |config.streaming.jumpLargeGaps| is set, the default action of this event\n * is to jump the gap; this can be prevented by calling preventDefault() on\n * the event object.\n * @property {string} type\n * 'largegap'\n * @property {number} currentTime\n * The current time of the playhead.\n * @property {number} gapSize\n * The size of the gap, in seconds.\n * @exportDoc\n */\n\n\n/** @private {!Object.<string, function():*>} */\nshaka.Player.supportPlugins_ = {};\n\n\n/**\n * Registers a plugin callback that will be called with support(). The\n * callback will return the value that will be stored in the return value from\n * support().\n *\n * @param {string} name\n * @param {function():*} callback\n * @export\n */\nshaka.Player.registerSupportPlugin = function(name, callback) {\n shaka.Player.supportPlugins_[name] = callback;\n};\n\n\n/**\n * Return whether the browser provides basic support. If this returns false,\n * Shaka Player cannot be used at all. In this case, do not construct a Player\n * instance and do not use the library.\n *\n * @return {boolean}\n * @export\n */\nshaka.Player.isBrowserSupported = function() {\n // Basic features needed for the library to be usable.\n var basic = !!window.Promise && !!window.Uint8Array &&\n !!Array.prototype.forEach;\n\n return basic &&\n shaka.media.MediaSourceEngine.isBrowserSupported() &&\n shaka.media.DrmEngine.isBrowserSupported();\n};\n\n\n/**\n * Probes the browser to determine what features are supported. This makes a\n * number of requests to EME/MSE/etc which may result in user prompts. This\n * should only be used for diagnostics.\n *\n * NOTE: This may show a request to the user for permission.\n *\n * @see https://goo.gl/ovYLvl\n * @return {!Promise.<shakaExtern.SupportType>}\n * @export\n */\nshaka.Player.probeSupport = function() {\n goog.asserts.assert(shaka.Player.isBrowserSupported(),\n 'Must have basic support');\n return shaka.media.DrmEngine.probeSupport().then(function(drm) {\n var manifest = shaka.media.ManifestParser.probeSupport();\n var media = shaka.media.MediaSourceEngine.probeSupport();\n var ret = {\n manifest: manifest,\n media: media,\n drm: drm\n };\n\n var plugins = shaka.Player.supportPlugins_;\n for (var name in plugins) {\n ret[name] = plugins[name]();\n }\n\n return ret;\n });\n};\n\n\n/**\n * Load a manifest.\n *\n * @param {string} manifestUri\n * @param {number=} opt_startTime Optional start time, in seconds, to begin\n * playback. Defaults to 0 for VOD and to the live edge for live.\n * @param {shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * Optional manifest parser factory to override auto-detection or use an\n * unregistered parser.\n * @return {!Promise} Resolved when the manifest has been loaded and playback\n * has begun; rejected when an error occurs or the call was interrupted by\n * destroy(), unload() or another call to load().\n * @export\n */\nshaka.Player.prototype.load = function(manifestUri, opt_startTime,\n opt_manifestParserFactory) {\n var unloadPromise = this.unload();\n var loadChain = new shaka.util.CancelableChain();\n this.loadChain_ = loadChain;\n this.dispatchEvent(new shaka.util.FakeEvent('loading'));\n\n var startTime = Date.now();\n\n return loadChain.then(function() {\n return unloadPromise;\n }).then(function() {\n // Not tracked in stats because it should be insignificant.\n // Logged in case it is not.\n shaka.log.debug('Unload latency:', (Date.now() - startTime) / 1000);\n\n this.stats_ = this.getCleanStats_();\n\n this.eventManager_.listen(this.video_, 'playing',\n this.updateState_.bind(this));\n this.eventManager_.listen(this.video_, 'pause',\n this.updateState_.bind(this));\n this.eventManager_.listen(this.video_, 'ended',\n this.updateState_.bind(this));\n\n goog.asserts.assert(this.networkingEngine_, 'Must not be destroyed');\n return shaka.media.ManifestParser.getFactory(\n manifestUri,\n this.networkingEngine_,\n this.config_.manifest.retryParameters,\n opt_manifestParserFactory);\n }.bind(this)).then(function(factory) {\n\n this.parser_ = new factory();\n this.parser_.configure(this.config_.manifest);\n goog.asserts.assert(this.networkingEngine_, 'Must not be destroyed');\n var playerInterface = {\n networkingEngine: this.networkingEngine_,\n filterPeriod: this.filterPeriod_.bind(this),\n onTimelineRegionAdded: this.onTimelineRegionAdded_.bind(this),\n onEvent: this.onEvent_.bind(this),\n onError: this.onError_.bind(this)\n };\n\n if (this.parser_.start.length > 2) {\n goog.asserts.assert(false, 'Old ManifestParser interface is deprecated');\n shaka.log.warning(\n 'The ManifestParser interface has changed. Please upgrade your ' +\n 'plugin to accept the PlayerInterface structure. See the ' +\n 'ManifestParser documentation for details.');\n // Use a string index here so the compiler doesn't complain about the\n // incorrect arguments.\n return this.parser_['start'](\n manifestUri, this.networkingEngine_, playerInterface.filterPeriod,\n playerInterface.onError, playerInterface.onEvent);\n }\n\n return this.parser_.start(manifestUri, playerInterface);\n }.bind(this)).then(function(manifest) {\n\n if (manifest.periods.length == 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.NO_PERIODS);\n }\n\n this.manifest_ = manifest;\n this.manifestUri_ = manifestUri;\n this.drmEngine_ = this.createDrmEngine();\n this.drmEngine_.configure(this.config_.drm);\n return this.drmEngine_.init(manifest, false /* isOffline */);\n }.bind(this)).then(function() {\n\n // Re-filter the manifest after DRM has been initialized.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n\n this.lastTimeStatsUpdateTimestamp_ = Date.now() / 1000;\n\n // Copy preferred languages from the config again, in case the config was\n // changed between construction and playback.\n this.currentAudioLanguage_ = this.config_.preferredAudioLanguage;\n this.currentTextLanguage_ = this.config_.preferredTextLanguage;\n\n // Wait for MediaSource to open before continuing.\n return Promise.all([\n this.drmEngine_.attach(this.video_),\n this.mediaSourceOpen_\n ]);\n }.bind(this)).then(function() {\n this.config_.abr.manager.init(this.switch_.bind(this));\n\n // MediaSource is open, so create the Playhead, MediaSourceEngine, and\n // StreamingEngine.\n this.playhead_ = this.createPlayhead(opt_startTime);\n this.playheadObserver_ = this.createPlayheadObserver();\n this.mediaSourceEngine_ = this.createMediaSourceEngine();\n\n this.streamingEngine_ = this.createStreamingEngine();\n this.streamingEngine_.configure(this.config_.streaming);\n\n // If the content is multi-codec and the browser can play more than one of\n // them, choose codecs now before we initialize streaming.\n this.chooseCodecsAndFilterManifest_();\n\n return this.streamingEngine_.init();\n }.bind(this)).then(function() {\n if (this.config_.streaming.startAtSegmentBoundary) {\n var time = this.adjustStartTime_(this.playhead_.getTime());\n this.playhead_.setStartTime(time);\n }\n\n // Re-filter the manifest after streams have been chosen.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n // Dispatch a 'trackschanged' event now that all initial filtering is done.\n this.onTracksChanged_();\n // Since the first streams just became active, send an adaptation event.\n this.onAdaptation_();\n\n // Now that we've filtered out variants that aren't compatible with the\n // active one, update abr manager with filtered variants for the current\n // period.\n var currentPeriod = this.streamingEngine_.getCurrentPeriod();\n var variants = shaka.util.StreamUtils.filterVariantsByRoleAndLanguage(\n currentPeriod, this.currentAudioLanguage_);\n this.config_.abr.manager.setVariants(variants);\n\n var hasPrimary = currentPeriod.variants.some(function(variant) {\n return variant.primary;\n });\n if (!this.currentAudioLanguage_ && !hasPrimary) {\n shaka.log.warning('No preferred audio language set. We will choose an ' +\n 'arbitrary language initially');\n }\n\n this.pendingTimelineRegions_.forEach(\n this.playheadObserver_.addTimelineRegion.bind(this.playheadObserver_));\n this.pendingTimelineRegions_ = [];\n\n // Wait for the 'loadeddata' event to measure load() latency.\n this.eventManager_.listenOnce(this.video_, 'loadeddata', function() {\n // Compute latency in seconds (Date.now() gives ms):\n var latency = (Date.now() - startTime) / 1000;\n this.stats_.loadLatency = latency;\n shaka.log.debug('Load latency:', latency);\n }.bind(this));\n\n this.loadChain_ = null;\n }.bind(this)).finalize().catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong error type!');\n shaka.log.debug('load() failed:', error);\n\n // If we haven't started another load, clear the loadChain_ member.\n if (this.loadChain_ == loadChain) {\n this.loadChain_ = null;\n this.dispatchEvent(new shaka.util.FakeEvent('unloading'));\n }\n return Promise.reject(error);\n }.bind(this));\n};\n\n\n/**\n * In case of multiple usable codecs, choose one based on lowest average\n * bandwidth and filter out the rest.\n * @private\n */\nshaka.Player.prototype.chooseCodecsAndFilterManifest_ = function() {\n function variantCodecs(variant) {\n // Only consider the base of the codec string. For example, these should\n // both be considered the same codec: avc1.42c01e, avc1.4d401f\n var baseVideoCodec =\n variant.video ? variant.video.codecs.split('.')[0] : '';\n var baseAudioCodec =\n variant.audio ? variant.audio.codecs.split('.')[0] : '';\n return baseVideoCodec + '-' + baseAudioCodec;\n }\n\n // Organize variants into buckets by codecs.\n var variantsByCodecs = {};\n this.manifest_.periods.forEach(function(period) {\n period.variants.forEach(function(variant) {\n var codecs = variantCodecs(variant);\n if (!(codecs in variantsByCodecs)) {\n variantsByCodecs[codecs] = [];\n }\n variantsByCodecs[codecs].push(variant);\n });\n });\n\n // Compute the average bandwidth for each group of variants.\n // Choose the lowest-bandwidth codecs.\n var bestCodecs = null;\n var lowestAverageBandwidth = Infinity;\n shaka.util.MapUtils.forEach(variantsByCodecs, function(codecs, variants) {\n var sum = 0;\n var num = 0;\n variants.forEach(function(variant) {\n sum += variant.bandwidth;\n ++num;\n });\n var averageBandwidth = sum / num;\n shaka.log.debug('codecs', codecs, 'avg bandwidth', averageBandwidth);\n\n if (averageBandwidth < lowestAverageBandwidth) {\n bestCodecs = codecs;\n lowestAverageBandwidth = averageBandwidth;\n }\n });\n goog.asserts.assert(bestCodecs != null, 'Should have chosen codecs!');\n goog.asserts.assert(!isNaN(lowestAverageBandwidth),\n 'Bandwidth should be a number!');\n\n // Filter out any variants that don't match, forcing AbrManager to choose from\n // the most efficient variants possible.\n this.manifest_.periods.forEach(function(period) {\n period.variants = period.variants.filter(function(variant) {\n var codecs = variantCodecs(variant);\n if (codecs == bestCodecs) return true;\n\n shaka.log.debug('Dropping Variant (better codec available)', variant);\n return false;\n });\n });\n};\n\n\n/**\n * Creates a new instance of DrmEngine. This can be replaced by tests to\n * create fake instances instead.\n *\n * @return {!shaka.media.DrmEngine}\n */\nshaka.Player.prototype.createDrmEngine = function() {\n goog.asserts.assert(this.networkingEngine_, 'Must not be destroyed');\n return new shaka.media.DrmEngine(\n this.networkingEngine_,\n this.onError_.bind(this),\n this.onKeyStatus_.bind(this),\n this.onExpirationUpdated_.bind(this));\n};\n\n\n/**\n * Creates a new instance of NetworkingEngine. This can be replaced by tests\n * to create fake instances instead.\n *\n * @return {!shaka.net.NetworkingEngine}\n */\nshaka.Player.prototype.createNetworkingEngine = function() {\n return new shaka.net.NetworkingEngine(this.onSegmentDownloaded_.bind(this));\n};\n\n\n/**\n * Creates a new instance of Playhead. This can be replaced by tests to create\n * fake instances instead.\n *\n * @param {number=} opt_startTime\n * @return {!shaka.media.Playhead}\n */\nshaka.Player.prototype.createPlayhead = function(opt_startTime) {\n goog.asserts.assert(this.manifest_, 'Must have manifest');\n return new shaka.media.Playhead(\n this.video_, this.manifest_, this.config_.streaming,\n opt_startTime || null, this.onSeek_.bind(this), this.onEvent_.bind(this));\n};\n\n\n/**\n * Creates a new instance of PlayheadOvserver. This can be replaced by tests to\n * create fake instances instead.\n *\n * @return {!shaka.media.PlayheadObserver}\n */\nshaka.Player.prototype.createPlayheadObserver = function() {\n goog.asserts.assert(this.manifest_, 'Must have manifest');\n return new shaka.media.PlayheadObserver(\n this.video_, this.manifest_, this.config_.streaming,\n this.onBuffering_.bind(this), this.onEvent_.bind(this),\n this.onChangePeriod_.bind(this));\n};\n\n\n/**\n * Create and open MediaSource. Potentially slow.\n *\n * @return {!Promise}\n */\nshaka.Player.prototype.createMediaSource = function() {\n this.mediaSource_ = new MediaSource();\n var ret = new shaka.util.PublicPromise();\n this.eventManager_.listen(this.mediaSource_, 'sourceopen', ret.resolve);\n this.video_.src = window.URL.createObjectURL(this.mediaSource_);\n return ret;\n};\n\n\n/**\n * Creates a new instance of MediaSourceEngine. This can be replaced by tests\n * to create fake instances instead.\n *\n * @return {!shaka.media.MediaSourceEngine}\n */\nshaka.Player.prototype.createMediaSourceEngine = function() {\n return new shaka.media.MediaSourceEngine(\n this.video_, this.mediaSource_, this.textTrack_);\n};\n\n\n/**\n * Creates a new instance of StreamingEngine. This can be replaced by tests\n * to create fake instances instead.\n *\n * @return {!shaka.media.StreamingEngine}\n */\nshaka.Player.prototype.createStreamingEngine = function() {\n goog.asserts.assert(\n this.playhead_ && this.playheadObserver_ && this.mediaSourceEngine_ &&\n this.manifest_,\n 'Must not be destroyed');\n\n var playerInterface = {\n playhead: this.playhead_,\n mediaSourceEngine: this.mediaSourceEngine_,\n netEngine: this.networkingEngine_,\n onChooseStreams: this.onChooseStreams_.bind(this),\n onCanSwitch: this.canSwitch_.bind(this),\n onError: this.onError_.bind(this),\n onEvent: this.onEvent_.bind(this),\n onManifestUpdate: this.onManifestUpdate_.bind(this),\n onSegmentAppended: this.onSegmentAppended_.bind(this)\n };\n return new shaka.media.StreamingEngine(this.manifest_, playerInterface);\n};\n\n\n/**\n * Configure the Player instance.\n *\n * The config object passed in need not be complete. It will be merged with\n * the existing Player configuration.\n *\n * Config keys and types will be checked. If any problems with the config\n * object are found, errors will be reported through logs.\n *\n * @param {!Object} config This should follow the form of\n * {@link shakaExtern.PlayerConfiguration}, but you may omit any field you do\n * not wish to change.\n * @export\n */\nshaka.Player.prototype.configure = function(config) {\n goog.asserts.assert(this.config_, 'Config must not be null!');\n\n if (config.abr && config.abr.manager &&\n config.abr.manager != this.config_.abr.manager) {\n this.config_.abr.manager.stop();\n config.abr.manager.init(this.switch_.bind(this));\n }\n\n shaka.util.ConfigUtils.mergeConfigObjects(\n this.config_, config, this.defaultConfig_(), this.configOverrides_(), '');\n\n this.applyConfig_();\n};\n\n\n/**\n * Apply config changes.\n * @private\n */\nshaka.Player.prototype.applyConfig_ = function() {\n if (this.parser_) {\n this.parser_.configure(this.config_.manifest);\n }\n if (this.drmEngine_) {\n this.drmEngine_.configure(this.config_.drm);\n }\n if (this.streamingEngine_) {\n this.streamingEngine_.configure(this.config_.streaming);\n\n // Need to apply the restrictions to every period.\n try {\n // this.filterPeriod_() may throw.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n } catch (error) {\n this.onError_(error);\n }\n\n // May need to choose new streams.\n shaka.log.debug('Choosing new streams after changing configuration');\n var period = this.streamingEngine_.getCurrentPeriod();\n this.chooseStreamsAndSwitch_(period);\n }\n\n // Simply enable/disable ABR with each call, since multiple calls to these\n // methods have no effect.\n if (this.config_.abr.enabled && !this.switchingPeriods_) {\n this.config_.abr.manager.enable();\n } else {\n this.config_.abr.manager.disable();\n }\n\n this.config_.abr.manager.setDefaultEstimate(\n this.config_.abr.defaultBandwidthEstimate);\n this.config_.abr.manager.setRestrictions(this.config_.abr.restrictions);\n};\n\n\n/**\n * Return a copy of the current configuration. Modifications of the returned\n * value will not affect the Player's active configuration. You must call\n * player.configure() to make changes.\n *\n * @return {shakaExtern.PlayerConfiguration}\n * @export\n */\nshaka.Player.prototype.getConfiguration = function() {\n goog.asserts.assert(this.config_, 'Config must not be null!');\n\n var ret = this.defaultConfig_();\n shaka.util.ConfigUtils.mergeConfigObjects(\n ret, this.config_, this.defaultConfig_(), this.configOverrides_(), '');\n return ret;\n};\n\n\n/**\n * Reset configuration to default.\n * @export\n */\nshaka.Player.prototype.resetConfiguration = function() {\n var config = this.defaultConfig_();\n\n if (config.abr && config.abr.manager &&\n config.abr.manager != this.config_.abr.manager) {\n this.config_.abr.manager.stop();\n config.abr.manager.init(this.switch_.bind(this));\n }\n\n // Don't call mergeConfigObjects_(), since that would not reset open-ended\n // dictionaries like drm.servers.\n this.config_ = this.defaultConfig_();\n\n this.applyConfig_();\n};\n\n\n/**\n * @return {HTMLMediaElement} A reference to the HTML Media Element passed\n * in during initialization.\n * @export\n */\nshaka.Player.prototype.getMediaElement = function() {\n return this.video_;\n};\n\n\n/**\n * @return {shaka.net.NetworkingEngine} A reference to the Player's networking\n * engine. Applications may use this to make requests through Shaka's\n * networking plugins.\n * @export\n */\nshaka.Player.prototype.getNetworkingEngine = function() {\n return this.networkingEngine_;\n};\n\n\n/**\n * @return {?string} If a manifest is loaded, returns the manifest URI given in\n * the last call to load(). Otherwise, returns null.\n * @export\n */\nshaka.Player.prototype.getManifestUri = function() {\n return this.manifestUri_;\n};\n\n\n/**\n * @return {boolean} True if the current stream is live. False otherwise.\n * @export\n */\nshaka.Player.prototype.isLive = function() {\n return this.manifest_ ?\n this.manifest_.presentationTimeline.isLive() :\n false;\n};\n\n\n/**\n * @return {boolean} True if the current stream is in-progress VOD.\n * False otherwise.\n * @export\n */\nshaka.Player.prototype.isInProgress = function() {\n return this.manifest_ ?\n this.manifest_.presentationTimeline.isInProgress() :\n false;\n};\n\n\n/**\n * Get the seekable range for the current stream.\n * @return {{start: number, end: number}}\n * @export\n */\nshaka.Player.prototype.seekRange = function() {\n var start = 0;\n var end = 0;\n if (this.manifest_) {\n var timeline = this.manifest_.presentationTimeline;\n start = timeline.getSegmentAvailabilityStart();\n end = timeline.getSeekRangeEnd();\n }\n return {'start': start, 'end': end};\n};\n\n\n/**\n * Get the key system currently being used by EME. This returns the empty\n * string if not using EME.\n *\n * @return {string}\n * @export\n */\nshaka.Player.prototype.keySystem = function() {\n return this.drmEngine_ ? this.drmEngine_.keySystem() : '';\n};\n\n\n/**\n * Get the DrmInfo used to initialize EME. This returns null when not using\n * EME.\n *\n * @return {?shakaExtern.DrmInfo}\n * @export\n */\nshaka.Player.prototype.drmInfo = function() {\n return this.drmEngine_ ? this.drmEngine_.getDrmInfo() : null;\n};\n\n\n/**\n * The next known expiration time for any EME session. If the sessions never\n * expire, or there are no EME sessions, this returns Infinity.\n *\n * @return {number}\n * @export\n */\nshaka.Player.prototype.getExpiration = function() {\n return this.drmEngine_ ? this.drmEngine_.getExpiration() : Infinity;\n};\n\n\n/**\n * @return {boolean} True if the Player is in a buffering state.\n * @export\n */\nshaka.Player.prototype.isBuffering = function() {\n return this.buffering_;\n};\n\n\n/**\n * Unload the current manifest and make the Player available for re-use.\n *\n * @return {!Promise} Resolved when streaming has stopped and the previous\n * content, if any, has been unloaded.\n * @export\n */\nshaka.Player.prototype.unload = function() {\n if (this.destroyed_) return Promise.resolve();\n this.dispatchEvent(new shaka.util.FakeEvent('unloading'));\n\n var p = Promise.resolve();\n if (this.loadChain_) {\n // A load is in progress, cancel it.\n var interrupt = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.PLAYER,\n shaka.util.Error.Code.LOAD_INTERRUPTED);\n p = this.loadChain_.cancel(interrupt);\n }\n\n return p.then(function() {\n // If there is an existing unload operation, use that.\n if (!this.unloadChain_) {\n this.unloadChain_ = this.resetStreaming_().then(function() {\n this.unloadChain_ = null;\n }.bind(this));\n }\n return this.unloadChain_;\n }.bind(this));\n};\n\n\n/**\n * Gets the current effective playback rate. If using trick play, it will\n * return the current trick play rate; otherwise, it will return the video\n * playback rate.\n * @return {number}\n * @export\n */\nshaka.Player.prototype.getPlaybackRate = function() {\n return this.playhead_ ? this.playhead_.getPlaybackRate() : 0;\n};\n\n\n/**\n * Skip through the content without playing. Simulated using repeated seeks.\n *\n * Trick play will be canceled automatically if the playhead hits the beginning\n * or end of the seekable range for the content.\n *\n * @param {number} rate The playback rate to simulate. For example, a rate of\n * 2.5 would result in 2.5 seconds of content being skipped every second.\n * To trick-play backward, use a negative rate.\n * @export\n */\nshaka.Player.prototype.trickPlay = function(rate) {\n shaka.log.debug('Trick play rate', rate);\n if (this.playhead_)\n this.playhead_.setPlaybackRate(rate);\n\n if (this.streamingEngine_)\n this.streamingEngine_.setTrickPlay(rate != 1);\n};\n\n\n/**\n * Cancel trick-play.\n * @export\n */\nshaka.Player.prototype.cancelTrickPlay = function() {\n shaka.log.debug('Trick play canceled');\n if (this.playhead_)\n this.playhead_.setPlaybackRate(1);\n\n if (this.streamingEngine_)\n this.streamingEngine_.setTrickPlay(false);\n};\n\n\n/**\n * Return a list of variant and text tracks available for the current Period.\n * If there are multiple Periods, then you must seek to the Period before\n * being able to switch.\n *\n * @return {!Array.<shakaExtern.Track>}\n * @export\n * @deprecated Use getVariantTracks() or getTextTracks()\n */\nshaka.Player.prototype.getTracks = function() {\n shaka.log.warning('shaka.Player.getTracks() is being deprecated and will ' +\n 'be removed in v2.2. Use getVariantTracks() to get a ' +\n 'list of variant tracks or getTextTracks() for text.');\n\n var tracks = this.getVariantTracks();\n return tracks.concat(this.getTextTracks());\n};\n\n\n/**\n * Select a specific track. For variant tracks, this disables adaptation.\n * Note that AdaptationEvents are not fired for manual track selections.\n *\n * @param {shakaExtern.Track} track\n * @param {boolean=} opt_clearBuffer\n * @export\n * @deprecated Use selectVariantTrack() or selectTextTrack()\n */\nshaka.Player.prototype.selectTrack = function(track, opt_clearBuffer) {\n shaka.log.warning('shaka.Player.selectTrack() is being deprecated and will ' +\n 'be removed in v2.2. Use selectVariantTrack() to select ' +\n 'a new variant track or selectTextTrack() for text.');\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (track.type == ContentType.TEXT) {\n this.selectTextTrack(track);\n } else {\n // Disable ABR for variant track changes.\n var config = {abr: {enabled: false}};\n this.configure(config);\n this.selectVariantTrack(track, opt_clearBuffer);\n }\n};\n\n\n/**\n * Return a list of variant tracks available for the current\n * Period. If there are multiple Periods, then you must seek to the Period\n * before being able to switch.\n *\n * @return {!Array.<shakaExtern.Track>}\n * @export\n */\nshaka.Player.prototype.getVariantTracks = function() {\n if (!this.manifest_)\n return [];\n this.assertCorrectActiveStreams_();\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var currentPeriod = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.playhead_.getTime());\n var activeStreams = this.activeStreamsByPeriod_[currentPeriod] || {};\n return shaka.util.StreamUtils.getVariantTracks(\n this.manifest_.periods[currentPeriod], activeStreams[ContentType.AUDIO],\n activeStreams[ContentType.VIDEO]);\n};\n\n\n/**\n * Return a list of text tracks available for the current\n * Period. If there are multiple Periods, then you must seek to the Period\n * before being able to switch.\n *\n * @return {!Array.<shakaExtern.Track>}\n * @export\n */\nshaka.Player.prototype.getTextTracks = function() {\n if (!this.manifest_)\n return [];\n this.assertCorrectActiveStreams_();\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var currentPeriod = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.playhead_.getTime());\n var activeStreams = this.activeStreamsByPeriod_[currentPeriod] || {};\n return shaka.util.StreamUtils\n .getTextTracks(\n this.manifest_.periods[currentPeriod],\n activeStreams[ContentType.TEXT])\n .filter(function(track) {\n // Don't show any tracks that are being loaded still.\n return this.loadingTextStreamIds_.indexOf(track.id) < 0;\n }.bind(this));\n};\n\n\n/**\n * Select a specific text track. Note that AdaptationEvents are not\n * fired for manual track selections.\n *\n * @param {shakaExtern.Track} track\n * @export\n */\nshaka.Player.prototype.selectTextTrack = function(track) {\n if (!this.streamingEngine_)\n return;\n\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var period = this.streamingEngine_.getCurrentPeriod();\n var stream = StreamUtils.findTextStreamForTrack(period, track);\n\n if (!stream) {\n shaka.log.error('Unable to find the track with id \"' + track.id +\n '\"; did we change Periods?');\n return;\n }\n\n this.addToSwitchHistory_(stream, /* fromAdaptation */ false);\n\n // Create empty object first and initialize the fields through\n // [] to allow field names to be expressions.\n var streamsToSwitch = {};\n streamsToSwitch[ContentType.TEXT] = stream;\n this.deferredSwitch_(streamsToSwitch, /* opt_clearBuffer */ true);\n};\n\n\n/**\n * Select a specific track. Note that AdaptationEvents are not fired for manual\n * track selections.\n *\n * @param {shakaExtern.Track} track\n * @param {boolean=} opt_clearBuffer\n * @export\n */\nshaka.Player.prototype.selectVariantTrack = function(track, opt_clearBuffer) {\n if (!this.streamingEngine_)\n return;\n\n if (this.config_.abr.enabled) {\n shaka.log.warning('Changing tracks while abr manager is enabled will ' +\n 'likely result in the selected track being overriden. ' +\n 'Consider disabling abr before calling ' +\n 'selectVariantTrack().');\n }\n\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var streamsToSwitch = {};\n\n var period = this.streamingEngine_.getCurrentPeriod();\n var variant = StreamUtils.findVariantForTrack(period, track);\n var activeStreams = this.streamingEngine_.getActiveStreams();\n if (variant) {\n // Double check that the track is allowed to be played.\n // The track list should only contain playable variants,\n // but if resctrictions change and selectVariantTrack()\n // is called before the track list is updated, we could\n // get a now-restricted variant.\n var variantIsPlayable = StreamUtils.isPlayable(variant);\n if (!variantIsPlayable) {\n shaka.log.error('Unable to switch to track with id \"' + track.id +\n '\" because it is restricted.');\n return;\n }\n\n if (variant.audio) {\n // Update active streams even if we're not switching\n // in case active streams haven't been set up yet.\n this.updateActiveStreams_(variant.audio);\n if (variant.audio != activeStreams[ContentType.AUDIO])\n streamsToSwitch[ContentType.AUDIO] = variant.audio;\n }\n if (variant.video) {\n this.updateActiveStreams_(variant.video);\n if (variant.video != activeStreams[ContentType.VIDEO])\n streamsToSwitch[ContentType.VIDEO] = variant.video;\n }\n }\n\n // Add entries to the history.\n shaka.util.MapUtils.values(streamsToSwitch).forEach(function(stream) {\n this.addToSwitchHistory_(stream, /* fromAdaptation */ false);\n }.bind(this));\n\n // Save current text stream to ensure that it doesn't get overridden\n // by a default one inside shaka.Player.configure()\n var currentTextStream = activeStreams[ContentType.TEXT];\n\n if (currentTextStream) {\n streamsToSwitch[ContentType.TEXT] = currentTextStream;\n }\n\n this.deferredSwitch_(streamsToSwitch, opt_clearBuffer);\n};\n\n\n/**\n * Return a list of audio languages available for the current\n * Period.\n *\n * @return {!Array.<string>}\n * @export\n */\nshaka.Player.prototype.getAudioLanguages = function() {\n if (!this.streamingEngine_) {\n return [];\n }\n\n var StreamUtils = shaka.util.StreamUtils;\n var period = this.streamingEngine_.getCurrentPeriod();\n var variants = StreamUtils.getPlayableVariants(period.variants);\n return variants.map(function(variant) {\n return variant.language;\n }).filter(shaka.util.Functional.isNotDuplicate);\n};\n\n\n/**\n * Return a list of text languages available for the current\n * Period.\n *\n * @return {!Array.<string>}\n * @export\n */\nshaka.Player.prototype.getTextLanguages = function() {\n if (!this.streamingEngine_) {\n return [];\n }\n\n var period = this.streamingEngine_.getCurrentPeriod();\n return period.textStreams.map(function(stream) {\n return stream.language;\n }).filter(shaka.util.Functional.isNotDuplicate);\n};\n\n\n/**\n * Sets currentAudioLanguage to the selected language and chooses\n * new variant in that language if need be.\n *\n * @param {!string} language\n * @param {string=} opt_role\n * @export\n */\nshaka.Player.prototype.selectAudioLanguage = function(language, opt_role) {\n if (!this.streamingEngine_) return;\n var period = this.streamingEngine_.getCurrentPeriod();\n this.currentAudioLanguage_ = language;\n this.currentVariantRole_ = opt_role || '';\n this.chooseStreamsAndSwitch_(period);\n};\n\n\n/**\n * Sets currentTextLanguage to the selected language and chooses\n * new text stream in that language if need be.\n *\n * @param {!string} language\n * @param {string=} opt_role\n * @export\n */\nshaka.Player.prototype.selectTextLanguage = function(language, opt_role) {\n if (!this.streamingEngine_) return;\n var period = this.streamingEngine_.getCurrentPeriod();\n this.currentTextLanguage_ = language;\n this.currentTextRole_ = opt_role || '';\n this.chooseStreamsAndSwitch_(period);\n};\n\n\n/**\n * @return {boolean} True if the current text track is visible.\n * @export\n */\nshaka.Player.prototype.isTextTrackVisible = function() {\n return this.textTrack_.mode == 'showing';\n};\n\n\n/**\n * Set the visibility of the current text track, if any.\n *\n * @param {boolean} on\n * @export\n */\nshaka.Player.prototype.setTextTrackVisibility = function(on) {\n this.textTrack_.mode = on ? 'showing' : 'hidden';\n this.onTextTrackVisibility_();\n};\n\n\n/**\n * Returns current playhead time as a Date.\n *\n * @return {Date}\n * @export\n */\nshaka.Player.prototype.getPlayheadTimeAsDate = function() {\n if (!this.manifest_) return null;\n goog.asserts.assert(this.isLive(),\n 'getPlayheadTimeInUTC should be called on a live stream!');\n var time =\n this.manifest_.presentationTimeline.getPresentationStartTime() * 1000 +\n this.video_.currentTime * 1000;\n\n return new Date(time);\n};\n\n\n/**\n * Return playback and adaptation stats.\n *\n * @return {shakaExtern.Stats}\n * @export\n */\nshaka.Player.prototype.getStats = function() {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n this.updateTimeStats_();\n this.updateState_();\n\n var video = null;\n var variant = null;\n var videoInfo = this.video_ && this.video_.getVideoPlaybackQuality ?\n this.video_.getVideoPlaybackQuality() : {};\n\n if (this.playhead_ && this.manifest_) {\n var periodIdx = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.playhead_.getTime());\n var period = this.manifest_.periods[periodIdx];\n var activeStreams = this.activeStreamsByPeriod_[periodIdx];\n\n variant = shaka.util.StreamUtils.getVariantByStreamIds(\n activeStreams[ContentType.AUDIO],\n activeStreams[ContentType.VIDEO],\n period.variants);\n\n video = variant.video || {};\n }\n\n if (!video) video = {};\n if (!variant) variant = {};\n\n // Clone the internal object so our state cannot be tampered with.\n var cloneObject = shaka.util.ConfigUtils.cloneObject;\n return {\n // Not tracked in this.stats_:\n width: video.width || 0,\n height: video.height || 0,\n streamBandwidth: variant.bandwidth || 0,\n decodedFrames: Number(videoInfo.totalVideoFrames),\n droppedFrames: Number(videoInfo.droppedVideoFrames),\n estimatedBandwidth: this.config_.abr.manager.getBandwidthEstimate(),\n\n loadLatency: this.stats_.loadLatency,\n playTime: this.stats_.playTime,\n bufferingTime: this.stats_.bufferingTime,\n // Deep-clone the objects as well as the arrays that contain them:\n switchHistory: cloneObject(this.stats_.switchHistory),\n stateHistory: cloneObject(this.stats_.stateHistory)\n };\n};\n\n\n/**\n * Adds the given text track to the current Period. Load() must resolve before\n * calling. The current Period or the presentation must have a duration. This\n * returns a Promise that will resolve when the track can be switched to and\n * will resolve with the track that was created.\n *\n * @param {string} uri\n * @param {string} language\n * @param {string} kind\n * @param {string} mime\n * @param {string=} opt_codec\n * @param {string=} opt_label\n * @return {!Promise.<shakaExtern.Track>}\n * @export\n */\nshaka.Player.prototype.addTextTrack = function(\n uri, language, kind, mime, opt_codec, opt_label) {\n if (!this.streamingEngine_) {\n shaka.log.error(\n 'Must call load() and wait for it to resolve before adding text ' +\n 'tracks.');\n return Promise.reject();\n }\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Get the Period duration.\n var period = this.streamingEngine_.getCurrentPeriod();\n /** @type {number} */\n var periodDuration;\n for (var i = 0; i < this.manifest_.periods.length; i++) {\n if (this.manifest_.periods[i] == period) {\n if (i == this.manifest_.periods.length - 1) {\n periodDuration = this.manifest_.presentationTimeline.getDuration() -\n period.startTime;\n if (periodDuration == Infinity) {\n shaka.log.error(\n 'The current Period or the presentation must have a duration ' +\n 'to add external text tracks.');\n return Promise.reject();\n }\n } else {\n var nextPeriod = this.manifest_.periods[i + 1];\n periodDuration = nextPeriod.startTime - period.startTime;\n }\n break;\n }\n }\n\n /** @type {shakaExtern.Stream} */\n var stream = {\n id: this.nextExternalStreamId_++,\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: function(time) { return 1; },\n getSegmentReference: function(ref) {\n if (ref != 1) return null;\n return new shaka.media.SegmentReference(\n 1, 0, periodDuration, function() { return [uri]; }, 0, null);\n },\n initSegmentReference: null,\n presentationTimeOffset: 0,\n mimeType: mime,\n codecs: opt_codec || '',\n kind: kind,\n encrypted: false,\n keyId: null,\n language: language,\n label: opt_label || null,\n type: ContentType.TEXT,\n primary: false,\n trickModeVideo: null,\n containsEmsgBoxes: false,\n roles: []\n };\n\n // Add the stream to the loading list to ensure it isn't switched to while it\n // is initializing.\n this.loadingTextStreamIds_.push(stream.id);\n period.textStreams.push(stream);\n\n return this.streamingEngine_.notifyNewTextStream(stream).then(function() {\n if (this.destroyed_) return;\n\n // If this was the first text stream, StreamingEngine will start streaming\n // it in notifyNewTextStream. So update the active stream.\n var curPeriodIdx = this.manifest_.periods.indexOf(period);\n var activeStreams = this.streamingEngine_.getActiveStreams();\n if (activeStreams[ContentType.TEXT]) {\n this.activeStreamsByPeriod_[curPeriodIdx][ContentType.TEXT] =\n activeStreams[ContentType.TEXT].id;\n }\n\n // Remove the stream from the loading list.\n this.loadingTextStreamIds_.splice(\n this.loadingTextStreamIds_.indexOf(stream.id), 1);\n\n shaka.log.debug('Choosing new streams after adding a text stream');\n this.chooseStreamsAndSwitch_(period);\n this.onTracksChanged_();\n\n return {\n id: stream.id,\n active: false,\n type: ContentType.TEXT,\n bandwidth: 0,\n language: language,\n label: opt_label || null,\n kind: kind,\n width: null,\n height: null\n };\n }.bind(this));\n};\n\n\n/**\n * Set the maximum resolution that the platform's hardware can handle.\n * This will be called automatically by shaka.cast.CastReceiver to enforce\n * limitations of the Chromecast hardware.\n *\n * @param {number} width\n * @param {number} height\n * @export\n */\nshaka.Player.prototype.setMaxHardwareResolution = function(width, height) {\n this.maxHwRes_.width = width;\n this.maxHwRes_.height = height;\n};\n\n\n/**\n * Initialize the Player.\n * @private\n */\nshaka.Player.prototype.initialize_ = function() {\n // Start the (potentially slow) process of opening MediaSource now.\n this.mediaSourceOpen_ = this.createMediaSource();\n\n // If the video element has TextTracks, disable them. If we see one that\n // was created by a previous instance of Shaka Player, reuse it.\n for (var i = 0; i < this.video_.textTracks.length; ++i) {\n var track = this.video_.textTracks[i];\n track.mode = 'disabled';\n\n if (track.label == shaka.Player.TextTrackLabel_) {\n this.textTrack_ = track;\n }\n }\n\n if (!this.textTrack_) {\n // As far as I can tell, there is no observable difference between setting\n // kind to 'subtitles' or 'captions' when creating the TextTrack object.\n // The individual text tracks from the manifest will still have their own\n // kinds which can be displayed in the app's UI.\n this.textTrack_ = this.video_.addTextTrack(\n 'subtitles', shaka.Player.TextTrackLabel_);\n }\n this.textTrack_.mode = 'hidden';\n\n // TODO: test that in all cases, the built-in CC controls in the video element\n // are toggling our TextTrack.\n\n // Listen for video errors.\n this.eventManager_.listen(this.video_, 'error',\n this.onVideoError_.bind(this));\n};\n\n\n/**\n * @param {!shakaExtern.Stream} stream\n * @param {boolean} fromAdaptation\n * @private\n */\nshaka.Player.prototype.addToSwitchHistory_ = function(stream, fromAdaptation) {\n this.stats_.switchHistory.push({\n timestamp: Date.now() / 1000,\n id: stream.id,\n type: stream.type,\n fromAdaptation: fromAdaptation\n });\n\n this.updateActiveStreams_(stream);\n};\n\n\n/**\n * @param {!shakaExtern.Stream} stream\n * @private\n */\nshaka.Player.prototype.updateActiveStreams_ = function(stream) {\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n var periodIndex =\n shaka.util.StreamUtils.findPeriodContainingStream(this.manifest_, stream);\n if (!this.activeStreamsByPeriod_[periodIndex])\n this.activeStreamsByPeriod_[periodIndex] = {};\n this.activeStreamsByPeriod_[periodIndex][stream.type] = stream.id;\n};\n\n\n/**\n * Destroy members responsible for streaming.\n *\n * @return {!Promise}\n * @private\n */\nshaka.Player.prototype.destroyStreaming_ = function() {\n if (this.eventManager_) {\n this.eventManager_.unlisten(this.mediaSource_, 'sourceopen');\n this.eventManager_.unlisten(this.video_, 'loadeddata');\n this.eventManager_.unlisten(this.video_, 'playing');\n this.eventManager_.unlisten(this.video_, 'pause');\n this.eventManager_.unlisten(this.video_, 'ended');\n }\n\n if (this.video_) {\n this.video_.removeAttribute('src');\n this.video_.load();\n }\n\n var p = Promise.all([\n this.config_ ? this.config_.abr.manager.stop() : null,\n this.drmEngine_ ? this.drmEngine_.destroy() : null,\n this.mediaSourceEngine_ ? this.mediaSourceEngine_.destroy() : null,\n this.playhead_ ? this.playhead_.destroy() : null,\n this.playheadObserver_ ? this.playheadObserver_.destroy() : null,\n this.streamingEngine_ ? this.streamingEngine_.destroy() : null,\n this.parser_ ? this.parser_.stop() : null\n ]);\n\n this.drmEngine_ = null;\n this.mediaSourceEngine_ = null;\n this.playhead_ = null;\n this.playheadObserver_ = null;\n this.streamingEngine_ = null;\n this.parser_ = null;\n this.manifest_ = null;\n this.manifestUri_ = null;\n this.mediaSourceOpen_ = null;\n this.mediaSource_ = null;\n this.pendingTimelineRegions_ = [];\n this.activeStreamsByPeriod_ = {};\n this.deferredSwitches_ = {};\n this.stats_ = this.getCleanStats_();\n\n return p;\n};\n\n\n/**\n * Reset the streaming system.\n * @return {!Promise}\n * @private\n */\nshaka.Player.prototype.resetStreaming_ = function() {\n if (!this.parser_) {\n // Nothing is playing, so this is effectively a no-op.\n return Promise.resolve();\n }\n\n // Destroy the streaming system before we recreate everything.\n return this.destroyStreaming_().then(function() {\n if (this.destroyed_) return;\n\n // Force an exit from the buffering state.\n this.onBuffering_(false);\n\n // Start the (potentially slow) process of opening MediaSource now.\n this.mediaSourceOpen_ = this.createMediaSource();\n }.bind(this));\n};\n\n\n/**\n * @const {string}\n * @private\n */\nshaka.Player.TextTrackLabel_ = 'Shaka Player TextTrack';\n\n\n/**\n * @return {!Object}\n * @private\n */\nshaka.Player.prototype.configOverrides_ = function() {\n return {\n '.drm.servers': '',\n '.drm.clearKeys': '',\n '.drm.advanced': {\n distinctiveIdentifierRequired: false,\n persistentStateRequired: false,\n videoRobustness: '',\n audioRobustness: '',\n serverCertificate: null\n }\n };\n};\n\n\n/**\n * @return {shakaExtern.PlayerConfiguration}\n * @private\n */\nshaka.Player.prototype.defaultConfig_ = function() {\n return {\n drm: {\n retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(),\n // These will all be verified by special cases in mergeConfigObjects_():\n servers: {}, // key is arbitrary key system ID, value must be string\n clearKeys: {}, // key is arbitrary key system ID, value must be string\n advanced: {}, // key is arbitrary key system ID, value is a record type\n delayLicenseRequestUntilPlayed: false\n },\n manifest: {\n retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(),\n dash: {\n customScheme: function(node) {\n // Reference node to keep closure from removing it.\n // If the argument is removed, it breaks our function length check\n // in mergeConfigObjects_().\n // TODO: Find a better solution if possible.\n // NOTE: Chrome App Content Security Policy prohibits usage of new\n // Function()\n\n if (node) return null;\n },\n clockSyncUri: '',\n ignoreDrmInfo: false\n },\n hls: {\n defaultTimeOffset: 0\n }\n },\n streaming: {\n retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(),\n infiniteRetriesForLiveStreams: true,\n rebufferingGoal: 2,\n bufferingGoal: 10,\n bufferBehind: 30,\n ignoreTextStreamFailures: false,\n startAtSegmentBoundary: false,\n smallGapLimit: 0.5,\n jumpLargeGaps: false\n },\n abr: {\n manager: this.defaultAbrManager_,\n enabled: true,\n defaultBandwidthEstimate:\n shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE,\n restrictions: {\n minWidth: 0,\n maxWidth: Infinity,\n minHeight: 0,\n maxHeight: Infinity,\n minPixels: 0,\n maxPixels: Infinity,\n minBandwidth: 0,\n maxBandwidth: Infinity\n }\n },\n preferredAudioLanguage: '',\n preferredTextLanguage: '',\n restrictions: {\n minWidth: 0,\n maxWidth: Infinity,\n minHeight: 0,\n maxHeight: Infinity,\n minPixels: 0,\n maxPixels: Infinity,\n minBandwidth: 0,\n maxBandwidth: Infinity\n }\n };\n};\n\n\n/**\n * @return {shakaExtern.Stats}\n * @private\n */\nshaka.Player.prototype.getCleanStats_ = function() {\n return {\n // These are not tracked in the private stats structure and are only here to\n // satisfy the compiler.\n width: NaN,\n height: NaN,\n streamBandwidth: NaN,\n decodedFrames: NaN,\n droppedFrames: NaN,\n estimatedBandwidth: NaN,\n\n // These are tracked in the private stats structure to avoid the need for\n // many private member variables.\n loadLatency: NaN,\n playTime: 0,\n bufferingTime: 0,\n switchHistory: [],\n stateHistory: []\n };\n};\n\n\n/**\n * @param {shakaExtern.Period} period\n * @private\n */\nshaka.Player.prototype.filterPeriod_ = function(period) {\n goog.asserts.assert(this.video_, 'Must not be destroyed');\n var StreamUtils = shaka.util.StreamUtils;\n\n var activeStreams =\n this.streamingEngine_ ? this.streamingEngine_.getActiveStreams() : {};\n StreamUtils.filterPeriod(this.drmEngine_, activeStreams, period);\n\n // Check for playable variants before restrictions to give a different error\n // if we have restricted all the tracks rather than there being none.\n var hasPlayableVariants =\n StreamUtils.getPlayableVariants(period.variants).length > 0;\n\n var tracksChanged = shaka.util.StreamUtils.applyRestrictions(\n period, this.config_.restrictions, this.maxHwRes_);\n if (tracksChanged && this.streamingEngine_ &&\n this.streamingEngine_.getCurrentPeriod() == period) {\n this.onTracksChanged_();\n }\n\n // Check for playable variants again. If the first check found variants, but\n // not the second, then all variants are restricted.\n var allVariantsRestricted =\n StreamUtils.getPlayableVariants(period.variants).length < 1;\n\n if (!hasPlayableVariants) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.UNPLAYABLE_PERIOD);\n } else if (allVariantsRestricted) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET);\n }\n};\n\n\n/**\n * Switches to the given streams, deferring switches if needed.\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType,\n shakaExtern.Stream>} streamsByType\n * @param {boolean=} opt_clearBuffer\n * @private\n */\nshaka.Player.prototype.deferredSwitch_ = function(\n streamsByType, opt_clearBuffer) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n for (var type in streamsByType) {\n var stream = streamsByType[type];\n var clearBuffer = opt_clearBuffer || false;\n // TODO: consider adding a cue replacement algorithm to TextEngine to remove\n // this special case for text:\n if (type == ContentType.TEXT) clearBuffer = true;\n if (this.switchingPeriods_) {\n this.deferredSwitches_[type] = {stream: stream, clearBuffer: clearBuffer};\n } else {\n this.streamingEngine_.switch(type, stream, clearBuffer);\n }\n }\n};\n\n\n/**\n * Verifies that the active streams according to the player match those in\n * StreamingEngine.\n * @private\n */\nshaka.Player.prototype.assertCorrectActiveStreams_ = function() {\n if (!this.streamingEngine_ || !this.manifest_ || COMPILED) return;\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var streamingActive = this.streamingEngine_.getActiveStreams();\n var mainStream =\n streamingActive[ContentType.VIDEO] || streamingActive[ContentType.AUDIO];\n if (!mainStream)\n return;\n\n var streamingPeriodIndex =\n StreamUtils.findPeriodContainingStream(this.manifest_, mainStream);\n var currentPeriodIndex =\n this.manifest_.periods.indexOf(this.streamingEngine_.getCurrentPeriod());\n if (streamingPeriodIndex < 0 || streamingPeriodIndex != currentPeriodIndex)\n return;\n\n var playerActive = this.activeStreamsByPeriod_[currentPeriodIndex] || {};\n for (var type in streamingActive) {\n var activeId = streamingActive[type].id;\n if (this.deferredSwitches_[type])\n activeId = this.deferredSwitches_[type].stream.id;\n goog.asserts.assert(activeId == playerActive[type],\n 'Inconsistent active stream');\n }\n};\n\n\n/** @private */\nshaka.Player.prototype.updateTimeStats_ = function() {\n // Only count while we're loaded.\n if (!this.manifest_)\n return;\n\n var now = Date.now() / 1000;\n if (this.buffering_)\n this.stats_.bufferingTime += (now - this.lastTimeStatsUpdateTimestamp_);\n else\n this.stats_.playTime += (now - this.lastTimeStatsUpdateTimestamp_);\n\n this.lastTimeStatsUpdateTimestamp_ = now;\n};\n\n\n/**\n * @param {number} time\n * @return {number}\n * @private\n */\nshaka.Player.prototype.adjustStartTime_ = function(time) {\n var activeStreams = this.streamingEngine_.getActiveStreams();\n var period = this.streamingEngine_.getCurrentPeriod();\n\n // This method is called after StreamingEngine.init resolves, this means that\n // all the active streams have had createSegmentIndex called.\n function getAdjustedTime(stream, time) {\n if (!stream) return null;\n var idx = stream.findSegmentPosition(time - period.startTime);\n if (idx == null) return null;\n var ref = stream.getSegmentReference(idx);\n if (!ref) return null;\n var refTime = ref.startTime + period.startTime;\n goog.asserts.assert(refTime <= time, 'Segment should start before time');\n return refTime;\n }\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var videoStartTime = getAdjustedTime(activeStreams[ContentType.VIDEO], time);\n var audioStartTime = getAdjustedTime(activeStreams[ContentType.AUDIO], time);\n\n // If we have both video and audio times, pick the larger one. If we picked\n // the smaller one, that one will download an entire segment to buffer the\n // difference.\n if (videoStartTime != null && audioStartTime != null)\n return Math.max(videoStartTime, audioStartTime);\n else if (videoStartTime != null)\n return videoStartTime;\n else if (audioStartTime != null)\n return audioStartTime;\n else\n return time;\n};\n\n\n/**\n * Callback from NetworkingEngine.\n *\n * @param {number} deltaTimeMs\n * @param {number} numBytes\n * @private\n */\nshaka.Player.prototype.onSegmentDownloaded_ = function(deltaTimeMs, numBytes) {\n this.config_.abr.manager.segmentDownloaded(deltaTimeMs, numBytes);\n};\n\n\n/**\n * Callback from PlayheadObserver.\n *\n * @param {boolean} buffering\n * @private\n */\nshaka.Player.prototype.onBuffering_ = function(buffering) {\n // Before setting |buffering_|, update the time spent in the previous state.\n this.updateTimeStats_();\n this.buffering_ = buffering;\n this.updateState_();\n\n if (this.playhead_)\n this.playhead_.setBuffering(buffering);\n\n var event = new shaka.util.FakeEvent('buffering', { 'buffering': buffering });\n this.dispatchEvent(event);\n};\n\n\n/**\n * Callback from PlayheadObserver.\n * @private\n */\nshaka.Player.prototype.onChangePeriod_ = function() {\n this.onTracksChanged_();\n};\n\n\n/**\n * Called from potential initiators of state change, or before returning stats\n * to the user.\n *\n * This method decides if state has actually changed, updates the last entry,\n * and adds a new one if needed.\n *\n * @private\n */\nshaka.Player.prototype.updateState_ = function() {\n if (this.destroyed_) return;\n\n var newState;\n if (this.buffering_) {\n newState = 'buffering';\n } else if (this.video_.ended) {\n newState = 'ended';\n } else if (this.video_.paused) {\n newState = 'paused';\n } else {\n newState = 'playing';\n }\n\n var now = Date.now() / 1000;\n if (this.stats_.stateHistory.length) {\n var lastIndex = this.stats_.stateHistory.length - 1;\n var lastEntry = this.stats_.stateHistory[lastIndex];\n lastEntry.duration = now - lastEntry.timestamp;\n\n if (newState == lastEntry.state) {\n // The state has not changed, so do not add anything to the history.\n return;\n }\n }\n\n this.stats_.stateHistory.push({\n timestamp: now,\n state: newState,\n duration: 0\n });\n};\n\n\n/**\n * Callback from Playhead.\n *\n * @private\n */\nshaka.Player.prototype.onSeek_ = function() {\n if (this.playheadObserver_)\n this.playheadObserver_.seeked();\n if (this.streamingEngine_)\n this.streamingEngine_.seeked();\n};\n\n\n/**\n * Chooses streams from the given Period.\n *\n * @param {!shakaExtern.Period} period\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @param {!Array.<!shakaExtern.Stream>} textStreams\n * @param {boolean=} opt_chooseAll If true, choose streams of every type.\n * @return {!Object.<string, !shakaExtern.Stream>} A map of stream types to\n * chosen streams.\n * @private\n */\nshaka.Player.prototype.chooseStreams_ =\n function(period, variants, textStreams, opt_chooseAll) {\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Issue an error if there are no playable variants\n if (!variants || variants.length < 1) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET));\n return {};\n }\n\n // Update abr manager with newly filtered streams and variants.\n this.config_.abr.manager.setVariants(variants);\n this.config_.abr.manager.setTextStreams(textStreams);\n\n var needsUpdate = [];\n if (opt_chooseAll) {\n needsUpdate = [ContentType.VIDEO, ContentType.AUDIO];\n if (period.textStreams.length) needsUpdate.push(ContentType.TEXT);\n }\n\n // Check if any of the active streams is no longer available\n // or is using the wrong language.\n var activeStreams = this.streamingEngine_.getActiveStreams();\n // activePeriod may reasonably be null before StreamingEngine is streaming.\n var activePeriod = this.streamingEngine_.getActivePeriod();\n var activeVariant = shaka.util.StreamUtils.getVariantByStreams(\n activeStreams[ContentType.AUDIO],\n activeStreams[ContentType.VIDEO],\n activePeriod ? activePeriod.variants : period.variants);\n\n if (activeVariant) {\n if (!activeVariant.allowedByApplication ||\n !activeVariant.allowedByKeySystem) {\n needsUpdate.push(ContentType.AUDIO);\n needsUpdate.push(ContentType.VIDEO);\n }\n\n for (var type in activeStreams) {\n var stream = activeStreams[type];\n if (stream.type == ContentType.AUDIO &&\n stream.language != variants[0].language) {\n needsUpdate.push(type);\n } else if (stream.type == ContentType.TEXT && textStreams.length > 0 &&\n stream.language != textStreams[0].language) {\n needsUpdate.push(type);\n }\n }\n }\n\n needsUpdate = needsUpdate.filter(shaka.util.Functional.isNotDuplicate);\n\n if (needsUpdate.length > 0) {\n shaka.log.debug('Choosing new streams for', needsUpdate);\n var chosen = {};\n try {\n chosen = this.config_.abr.manager.chooseStreams(needsUpdate);\n } catch (err) {\n this.onError_(err);\n }\n\n return chosen;\n } else {\n shaka.log.debug('No new streams need to be chosen.');\n return {};\n }\n};\n\n\n/**\n * Chooses streams from the given Period and switches to them.\n * Called after a config change, a new text stream, or a key status event.\n *\n * @param {!shakaExtern.Period} period\n * @private\n */\nshaka.Player.prototype.chooseStreamsAndSwitch_ = function(period) {\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Create empty object first and initialize the fields through\n // [] to allow field names to be expressions.\n var languageMatches = {};\n languageMatches[ContentType.AUDIO] = false;\n languageMatches[ContentType.TEXT] = false;\n\n var variants = shaka.util.StreamUtils.filterVariantsByRoleAndLanguage(\n period, this.currentAudioLanguage_, languageMatches,\n this.currentVariantRole_);\n var textStreams = shaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage(\n period, this.currentTextLanguage_, languageMatches,\n this.currentTextRole_);\n\n // chooseStreams_ filters out choices which are already active.\n var chosen = this.chooseStreams_(period, variants, textStreams);\n\n for (var type in chosen) {\n this.addToSwitchHistory_(chosen[type], /* fromAdaptation */ true);\n }\n\n // Because we're running this after a config change (manual language change),\n // a new text stream, or a key status event, and because active streams have\n // been filtered out already, it is always okay to clear the buffer for what\n // remains.\n this.deferredSwitch_(chosen, /* opt_clearBuffer */ true);\n\n // Send an adaptation event so that the UI can show the new language/tracks.\n this.onAdaptation_();\n\n if (chosen[ContentType.TEXT]) {\n // If audio and text tracks have different languages, and the text track\n // matches the user's preference, then show the captions.\n if (chosen[ContentType.AUDIO] &&\n languageMatches[ContentType.TEXT] &&\n chosen[ContentType.TEXT].language !=\n chosen[ContentType.AUDIO].language) {\n this.textTrack_.mode = 'showing';\n this.onTextTrackVisibility_();\n }\n }\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @param {!shakaExtern.Period} period\n * @return {!Object.<string, !shakaExtern.Stream>} A map of stream types to\n * chosen streams.\n * @private\n */\nshaka.Player.prototype.onChooseStreams_ = function(period) {\n shaka.log.debug('onChooseStreams_', period);\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n\n // We are switching Periods, so the AbrManager will be disabled. But if we\n // want to abr.enabled, we do not want to call AbrManager.enable before\n // canSwitch_ is called.\n this.switchingPeriods_ = true;\n this.config_.abr.manager.disable();\n\n shaka.log.debug('Choosing new streams after period changed');\n var variants = shaka.util.StreamUtils.filterVariantsByRoleAndLanguage(\n period, this.currentAudioLanguage_, /* opt_languageMatches */ undefined,\n this.currentVariantRole_);\n\n var textStreams = shaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage(\n period, this.currentTextLanguage_, /* opt_languageMatches */ undefined,\n this.currentTextRole_);\n\n shaka.log.v2('onChooseStreams_, variants and text streams: ',\n variants, textStreams);\n\n var chosen = this.chooseStreams_(\n period, variants, textStreams, /* opt_chooseAll */ true);\n shaka.log.v2('onChooseStreams_, chosen=', chosen);\n\n // Override the chosen streams with the ones picked in\n // selectVariant/TextTrack. NOTE: The apparent race between\n // selectVariant/TextTrack and period transition is handled by\n // StreamingEngine, which will re-request tracks for thetransition if any\n // of these deferred selections are from the wrong period.\n for (var type in this.deferredSwitches_) {\n // We are choosing initial tracks, so no segments from this Period have\n // been downloaded yet. Therefore, it is okay to ignore the .clearBuffer\n // member of this structure.\n chosen[type] = this.deferredSwitches_[type].stream;\n }\n this.deferredSwitches_ = {};\n\n for (var type in chosen) {\n this.addToSwitchHistory_(chosen[type], /* fromAdaptation */ true);\n }\n\n // Don't fire a tracks-changed event since we aren't inside the new Period\n // yet.\n\n return chosen;\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @private\n */\nshaka.Player.prototype.canSwitch_ = function() {\n shaka.log.debug('canSwitch_');\n this.switchingPeriods_ = false;\n if (this.config_.abr.enabled)\n this.config_.abr.manager.enable();\n\n // If we still have deferred switches, switch now.\n for (var type in this.deferredSwitches_) {\n var info = this.deferredSwitches_[type];\n this.streamingEngine_.switch(type, info.stream, info.clearBuffer);\n }\n this.deferredSwitches_ = {};\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @private\n */\nshaka.Player.prototype.onManifestUpdate_ = function() {\n if (this.parser_ && this.parser_.update)\n this.parser_.update();\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @private\n */\nshaka.Player.prototype.onSegmentAppended_ = function() {\n if (this.playhead_)\n this.playhead_.onSegmentAppended();\n};\n\n\n/**\n * Callback from AbrManager.\n *\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType,\n * !shakaExtern.Stream>} streamsByType\n * @param {boolean=} opt_clearBuffer\n * @private\n */\nshaka.Player.prototype.switch_ = function(streamsByType, opt_clearBuffer) {\n shaka.log.debug('switch_');\n goog.asserts.assert(this.config_.abr.enabled,\n 'AbrManager should not call switch while disabled!');\n goog.asserts.assert(!this.switchingPeriods_,\n 'AbrManager should not call switch while transitioning between Periods!');\n\n // We have adapted to a new stream, record it in the history. Only add if\n // we are actually switching the stream.\n var oldActive = this.streamingEngine_.getActiveStreams();\n for (var type in streamsByType) {\n var stream = streamsByType[type];\n if (oldActive[type] != stream) {\n this.addToSwitchHistory_(stream, /* fromAdaptation */ true);\n } else {\n // If it's the same, remove it from the map.\n // This allows us to avoid onAdaptation_() when nothing has changed.\n delete streamsByType[type];\n }\n }\n\n if (shaka.util.MapUtils.empty(streamsByType)) {\n // There's nothing to change.\n return;\n }\n\n if (!this.streamingEngine_) {\n // There's no way to change it.\n return;\n }\n\n for (var type in streamsByType) {\n var clearBuffer = opt_clearBuffer || false;\n this.streamingEngine_.switch(type, streamsByType[type], clearBuffer);\n }\n this.onAdaptation_();\n};\n\n\n/**\n * Dispatches a 'adaptation' event.\n * @private\n */\nshaka.Player.prototype.onAdaptation_ = function() {\n // In the next frame, dispatch a 'adaptation' event.\n // This gives StreamingEngine time to absorb the changes before the user\n // tries to query them.\n Promise.resolve().then(function() {\n if (this.destroyed_) return;\n var event = new shaka.util.FakeEvent('adaptation');\n this.dispatchEvent(event);\n }.bind(this));\n};\n\n\n/**\n * Dispatches a 'trackschanged' event.\n * @private\n */\nshaka.Player.prototype.onTracksChanged_ = function() {\n // In the next frame, dispatch a 'trackschanged' event.\n // This gives StreamingEngine time to absorb the changes before the user\n // tries to query them.\n Promise.resolve().then(function() {\n if (this.destroyed_) return;\n var event = new shaka.util.FakeEvent('trackschanged');\n this.dispatchEvent(event);\n }.bind(this));\n};\n\n\n/** @private */\nshaka.Player.prototype.onTextTrackVisibility_ = function() {\n var event = new shaka.util.FakeEvent('texttrackvisibility');\n this.dispatchEvent(event);\n};\n\n\n/**\n * @param {!shaka.util.Error} error\n * @private\n */\nshaka.Player.prototype.onError_ = function(error) {\n // Errors dispatched after destroy is called are irrelevant.\n if (this.destroyed_) return;\n\n goog.asserts.assert(error instanceof shaka.util.Error, 'Wrong error type!');\n\n var event = new shaka.util.FakeEvent('error', { 'detail': error });\n this.dispatchEvent(event);\n};\n\n\n/**\n * @param {shakaExtern.TimelineRegionInfo} region\n * @private\n */\nshaka.Player.prototype.onTimelineRegionAdded_ = function(region) {\n if (this.playheadObserver_) {\n this.playheadObserver_.addTimelineRegion(region);\n } else {\n this.pendingTimelineRegions_.push(region);\n }\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.Player.prototype.onEvent_ = function(event) {\n this.dispatchEvent(event);\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.Player.prototype.onVideoError_ = function(event) {\n if (!this.video_.error) return;\n\n var code = this.video_.error.code;\n if (code == 1 /* MEDIA_ERR_ABORTED */) {\n // Ignore this error code, which should only occur when navigating away or\n // deliberately stopping playback of HTTP content.\n return;\n }\n\n // Extra error information from MS Edge and IE11:\n var extended = this.video_.error.msExtendedCode;\n if (extended) {\n // Convert to unsigned:\n if (extended < 0) {\n extended += Math.pow(2, 32);\n }\n // Format as hex:\n extended = extended.toString(16);\n }\n\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.VIDEO_ERROR,\n code, extended));\n};\n\n\n/**\n * @param {!Object.<string, string>} keyStatusMap A map of hex key IDs to\n * statuses.\n * @private\n */\nshaka.Player.prototype.onKeyStatus_ = function(keyStatusMap) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n goog.asserts.assert(this.streamingEngine_, 'Should have been initialized.');\n // 'usable', 'released', 'output-downscaled', 'status-pending' are statuses\n // of the usable keys.\n // 'expired' status is being handled separately in DrmEngine.\n var restrictedStatuses = ['output-restricted', 'internal-error'];\n\n var period = this.streamingEngine_.getCurrentPeriod();\n var tracksChanged = false;\n\n period.variants.forEach(function(variant) {\n var streams = [];\n if (variant.audio) streams.push(variant.audio);\n if (variant.video) streams.push(variant.video);\n\n streams.forEach(function(stream) {\n var originalAllowed = variant.allowedByKeySystem;\n\n // Only update if we have a key ID for the stream. If the key isn't\n // present, then we don't have that key and it should be restricted.\n if (stream.keyId) {\n var keyStatus = keyStatusMap[stream.keyId];\n variant.allowedByKeySystem =\n !!keyStatus && restrictedStatuses.indexOf(keyStatus) < 0;\n }\n\n if (originalAllowed != variant.allowedByKeySystem) {\n tracksChanged = true;\n }\n });\n });\n\n var activeStreams = this.streamingEngine_.getActiveStreams();\n var activeVariant = shaka.util.StreamUtils.getVariantByStreams(\n activeStreams[ContentType.AUDIO], activeStreams[ContentType.VIDEO],\n period.variants);\n if (activeVariant && !activeVariant.allowedByKeySystem) {\n shaka.log.debug('Choosing new streams after key status changed');\n this.chooseStreamsAndSwitch_(period);\n }\n\n if (tracksChanged)\n this.onTracksChanged_();\n};\n\n\n/**\n * Callback from DrmEngine\n * @param {string} keyId\n * @param {number} expiration\n * @private\n */\nshaka.Player.prototype.onExpirationUpdated_ = function(keyId, expiration) {\n if (this.parser_ && this.parser_.onExpirationUpdated)\n this.parser_.onExpirationUpdated(keyId, expiration);\n\n var event = new shaka.util.FakeEvent('expirationupdated');\n this.dispatchEvent(event);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/player.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastReceiver');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.cast.CastUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.IDestroyable');\n\n\n\n/**\n * A receiver to communicate between the Chromecast-hosted player and the\n * sender application.\n *\n * @constructor\n * @struct\n * @param {!HTMLMediaElement} video The local video element associated with the\n * local Player instance.\n * @param {!shaka.Player} player A local Player instance.\n * @param {function(Object)=} opt_appDataCallback A callback to handle\n * application-specific data passed from the sender.\n * @param {function(string):string=} opt_contentIdCallback A callback to\n * retrieve manifest URI from the provided content id.\n * @implements {shaka.util.IDestroyable}\n * @extends {shaka.util.FakeEventTarget}\n * @export\n */\nshaka.cast.CastReceiver =\n function(video, player, opt_appDataCallback, opt_contentIdCallback) {\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {shaka.Player} */\n this.player_ = player;\n\n /** @private {Object} */\n this.targets_ = {\n 'video': video,\n 'player': player\n };\n\n /** @private {?function(Object)} */\n this.appDataCallback_ = opt_appDataCallback || function() {};\n\n /** @private {?function(string):string} */\n this.opt_contentIdCallback_ = opt_contentIdCallback ||\n /** @param {string} contentId\n @return {string} */\n function(contentId) { return contentId; };\n\n /** @private {boolean} */\n this.isConnected_ = false;\n\n /** @private {boolean} */\n this.isIdle_ = true;\n\n /** @private {cast.receiver.CastMessageBus} */\n this.shakaBus_ = null;\n\n /** @private {cast.receiver.CastMessageBus} */\n this.genericBus_ = null;\n\n /** @private {?number} */\n this.pollTimerId_ = null;\n\n this.init_();\n};\ngoog.inherits(shaka.cast.CastReceiver, shaka.util.FakeEventTarget);\n\n\n/**\n * @return {boolean} True if the cast API is available and there are receivers.\n * @export\n */\nshaka.cast.CastReceiver.prototype.isConnected = function() {\n return this.isConnected_;\n};\n\n\n/**\n * @return {boolean} True if the receiver is not currently doing loading or\n * playing anything.\n * @export\n */\nshaka.cast.CastReceiver.prototype.isIdle = function() {\n return this.isIdle_;\n};\n\n\n/**\n * Destroys the underlying Player, then terminates the cast receiver app.\n *\n * @override\n * @export\n */\nshaka.cast.CastReceiver.prototype.destroy = function() {\n var p = this.player_ ? this.player_.destroy() : Promise.resolve();\n\n if (this.pollTimerId_ != null) {\n window.clearTimeout(this.pollTimerId_);\n }\n\n this.video_ = null;\n this.player_ = null;\n this.targets_ = null;\n this.appDataCallback_ = null;\n this.isConnected_ = false;\n this.isIdle_ = true;\n this.shakaBus_ = null;\n this.genericBus_ = null;\n this.pollTimerId_ = null;\n\n return p.then(function() {\n var manager = cast.receiver.CastReceiverManager.getInstance();\n manager.stop();\n });\n};\n\n\n/** @private */\nshaka.cast.CastReceiver.prototype.init_ = function() {\n var manager = cast.receiver.CastReceiverManager.getInstance();\n manager.onSenderConnected = this.onSendersChanged_.bind(this);\n manager.onSenderDisconnected = this.onSendersChanged_.bind(this);\n manager.onSystemVolumeChanged = this.fakeVolumeChangeEvent_.bind(this);\n\n this.genericBus_ = manager.getCastMessageBus(\n shaka.cast.CastUtils.GENERIC_MESSAGE_NAMESPACE);\n this.genericBus_.onMessage = this.onGenericMessage_.bind(this);\n\n this.shakaBus_ = manager.getCastMessageBus(\n shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE);\n this.shakaBus_.onMessage = this.onShakaMessage_.bind(this);\n\n if (!COMPILED) {\n // Sometimes it is useful to load the receiver app in Chrome to work on the\n // UI. To avoid log spam caused by the SDK trying to connect to web sockets\n // that don't exist, in uncompiled mode we check if the hosting browser is a\n // Chromecast before starting the receiver manager. We wouldn't do browser\n // detection except for debugging, so only do this in uncompiled mode.\n var isChromecast = navigator.userAgent.indexOf('CrKey') >= 0;\n if (isChromecast) {\n manager.start();\n }\n } else {\n manager.start();\n }\n\n shaka.cast.CastUtils.VideoEvents.forEach(function(name) {\n this.video_.addEventListener(name, this.proxyEvent_.bind(this, 'video'));\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerEvents.forEach(function(name) {\n this.player_.addEventListener(name, this.proxyEvent_.bind(this, 'player'));\n }.bind(this));\n\n // In our tests, the original Chromecast seems to have trouble decoding above\n // 1080p. It would be a waste to select a higher res anyway, given that the\n // device only outputs 1080p to begin with.\n\n // Chromecast has an extension to query the device/display's resolution.\n if (cast.__platform__ && cast.__platform__.canDisplayType(\n 'video/mp4; codecs=\"avc1.640028\"; width=3840; height=2160')) {\n // The device & display can both do 4k. Assume a 4k limit.\n this.player_.setMaxHardwareResolution(3840, 2160);\n } else {\n // Chromecast has always been able to do 1080p. Assume a 1080p limit.\n this.player_.setMaxHardwareResolution(1920, 1080);\n }\n\n // Maintain idle state.\n this.player_.addEventListener('loading', function() {\n // No longer idle once loading. This allows us to show the spinner during\n // the initial buffering phase.\n this.isIdle_ = false;\n this.onCastStatusChanged_();\n }.bind(this));\n this.video_.addEventListener('playing', function() {\n // No longer idle once playing. This allows us to replay a video without\n // reloading.\n this.isIdle_ = false;\n this.onCastStatusChanged_();\n }.bind(this));\n this.video_.addEventListener('pause', function() {\n this.onCastStatusChanged_();\n }.bind(this));\n this.player_.addEventListener('unloading', function() {\n // Go idle when unloading content.\n this.isIdle_ = true;\n this.onCastStatusChanged_();\n }.bind(this));\n this.video_.addEventListener('ended', function() {\n // Go idle 5 seconds after 'ended', assuming we haven't started again or\n // been destroyed.\n window.setTimeout(function() {\n if (this.video_ && this.video_.ended) {\n this.isIdle_ = true;\n this.onCastStatusChanged_();\n }\n }.bind(this), 5000);\n }.bind(this));\n\n // Do not start polling until after the sender's 'init' message is handled.\n};\n\n\n/** @private */\nshaka.cast.CastReceiver.prototype.onSendersChanged_ = function() {\n var manager = cast.receiver.CastReceiverManager.getInstance();\n this.isConnected_ = manager.getSenders().length != 0;\n this.onCastStatusChanged_();\n};\n\n\n/**\n * Dispatch an event to notify the receiver app that the status has changed.\n * @private\n */\nshaka.cast.CastReceiver.prototype.onCastStatusChanged_ = function() {\n // Do this asynchronously so that synchronous changes to idle state (such as\n // Player calling unload() as part of load()) are coalesced before the event\n // goes out.\n Promise.resolve().then(function() {\n var event = new shaka.util.FakeEvent('caststatuschanged');\n this.dispatchEvent(event);\n this.sendMediaStatus_(0);\n }.bind(this));\n};\n\n\n/**\n * Take on initial state from the sender.\n * @param {shaka.cast.CastUtils.InitStateType} initState\n * @param {Object} appData\n * @private\n */\nshaka.cast.CastReceiver.prototype.initState_ = function(initState, appData) {\n // Take on player state first.\n for (var k in initState['player']) {\n var v = initState['player'][k];\n // All player state vars are setters to be called.\n /** @type {Object} */(this.player_)[k](v);\n }\n\n // Now process custom app data, which may add additional player configs:\n this.appDataCallback_(appData);\n\n var manifestReady = Promise.resolve();\n var autoplay = this.video_.autoplay;\n\n // Now load the manifest, if present.\n if (initState['manifest']) {\n // Don't autoplay the content until we finish setting up initial state.\n this.video_.autoplay = false;\n manifestReady = this.player_.load(\n initState['manifest'], initState['startTime']);\n // Pass any errors through to the app.\n manifestReady.catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong error type!');\n var event = new shaka.util.FakeEvent('error', { 'detail': error });\n this.player_.dispatchEvent(event);\n }.bind(this));\n }\n\n // Finally, take on video state and player's \"after load\" state.\n manifestReady.then(function() {\n for (var k in initState['video']) {\n var v = initState['video'][k];\n this.video_[k] = v;\n }\n\n for (var k in initState['playerAfterLoad']) {\n var v = initState['playerAfterLoad'][k];\n // All player state vars are setters to be called.\n /** @type {Object} */(this.player_)[k](v);\n }\n\n // Restore original autoplay setting.\n this.video_.autoplay = autoplay;\n if (initState['manifest']) {\n // Resume playback with transferred state.\n this.video_.play();\n // Notify generic controllers of the state change.\n this.sendMediaStatus_(0);\n }\n }.bind(this));\n};\n\n\n/**\n * @param {string} targetName\n * @param {!Event} event\n * @private\n */\nshaka.cast.CastReceiver.prototype.proxyEvent_ = function(targetName, event) {\n // Poll and send an update right before we send the event. Some events\n // indicate an attribute change, so that change should be visible when the\n // event is handled.\n this.pollAttributes_();\n\n this.sendMessage_({\n 'type': 'event',\n 'targetName': targetName,\n 'event': event\n }, this.shakaBus_);\n};\n\n\n/** @private */\nshaka.cast.CastReceiver.prototype.pollAttributes_ = function() {\n // The poll timer may have been pre-empted by an event.\n // To avoid polling too often, we clear it here.\n if (this.pollTimerId_ != null) {\n window.clearTimeout(this.pollTimerId_);\n }\n // Since we know the timer has been cleared, start a new one now.\n // This will be preempted by events, including 'timeupdate'.\n this.pollTimerId_ = window.setTimeout(this.pollAttributes_.bind(this), 500);\n\n var update = {\n 'video': {},\n 'player': {}\n };\n\n shaka.cast.CastUtils.VideoAttributes.forEach(function(name) {\n update['video'][name] = this.video_[name];\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerGetterMethods.forEach(function(name) {\n update['player'][name] = /** @type {Object} */(this.player_)[name]();\n }.bind(this));\n\n // Volume attributes are tied to the system volume.\n var manager = cast.receiver.CastReceiverManager.getInstance();\n var systemVolume = manager.getSystemVolume();\n if (systemVolume) {\n update['video']['volume'] = systemVolume.level;\n update['video']['muted'] = systemVolume.muted;\n }\n\n this.sendMessage_({\n 'type': 'update',\n 'update': update\n }, this.shakaBus_);\n};\n\n\n/**\n * Dispatch a fake 'volumechange' event to mimic the video element, since volume\n * changes are routed to the system volume on the receiver.\n * @private\n */\nshaka.cast.CastReceiver.prototype.fakeVolumeChangeEvent_ = function() {\n // Volume attributes are tied to the system volume.\n var manager = cast.receiver.CastReceiverManager.getInstance();\n var systemVolume = manager.getSystemVolume();\n goog.asserts.assert(systemVolume, 'System volume should not be null!');\n\n if (systemVolume) {\n // Send an update message with just the latest volume level and muted state.\n this.sendMessage_({\n 'type': 'update',\n 'update': {\n 'video': {\n 'volume': systemVolume.level,\n 'muted': systemVolume.muted\n }\n }\n }, this.shakaBus_);\n }\n\n // Send another message with a 'volumechange' event to update the sender's UI.\n this.sendMessage_({\n 'type': 'event',\n 'targetName': 'video',\n 'event': {'type': 'volumechange'}\n }, this.shakaBus_);\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages are\n * read with quoted properties.\n * @param {cast.receiver.CastMessageBus.Event} event\n * @private\n */\nshaka.cast.CastReceiver.prototype.onShakaMessage_ = function(event) {\n var message = shaka.cast.CastUtils.deserialize(event.data);\n shaka.log.debug('CastReceiver: message', message);\n\n switch (message['type']) {\n case 'init':\n this.initState_(message['initState'], message['appData']);\n // The sender is supposed to reflect the cast system volume after\n // connecting. Using fakeVolumeChangeEvent_() would create a race on the\n // sender side, since it would have volume properties, but no others.\n // This would lead to hasRemoteProperties() being true, even though a\n // complete set had never been sent.\n // Now that we have init state, this is a good time for the first update\n // message anyway.\n this.pollAttributes_();\n break;\n case 'appData':\n this.appDataCallback_(message['appData']);\n break;\n case 'set':\n var targetName = message['targetName'];\n var property = message['property'];\n var value = message['value'];\n\n if (targetName == 'video') {\n // Volume attributes must be rerouted to the system.\n var manager = cast.receiver.CastReceiverManager.getInstance();\n if (property == 'volume') {\n manager.setSystemVolumeLevel(value);\n break;\n } else if (property == 'muted') {\n manager.setSystemVolumeMuted(value);\n break;\n }\n }\n\n this.targets_[targetName][property] = value;\n break;\n case 'call':\n var targetName = message['targetName'];\n var methodName = message['methodName'];\n var args = message['args'];\n var target = this.targets_[targetName];\n target[methodName].apply(target, args);\n break;\n case 'asyncCall':\n var targetName = message['targetName'];\n var methodName = message['methodName'];\n var args = message['args'];\n var id = message['id'];\n var senderId = event.senderId;\n var target = this.targets_[targetName];\n var p = target[methodName].apply(target, args);\n // Replies must go back to the specific sender who initiated, so that we\n // don't have to deal with conflicting IDs between senders.\n p.then(this.sendAsyncComplete_.bind(this, senderId, id, /* error */ null),\n this.sendAsyncComplete_.bind(this, senderId, id));\n break;\n }\n};\n\n\n/**\n * @param {cast.receiver.CastMessageBus.Event} event\n * @private\n */\nshaka.cast.CastReceiver.prototype.onGenericMessage_ = function(event) {\n var message = shaka.cast.CastUtils.deserialize(event.data);\n shaka.log.debug('CastReceiver: message', message);\n // TODO(ismena): error message on duplicate request id from the same sender\n switch (message['type']) {\n case 'PLAY':\n this.video_.play();\n // Notify generic controllers that the player state changed.\n // requestId=0 (the parameter) means that the message was not\n // triggered by a GET_STATUS request.\n this.sendMediaStatus_(0);\n break;\n case 'PAUSE':\n this.video_.pause();\n this.sendMediaStatus_(0);\n break;\n case 'SEEK':\n var currentTime = message['currentTime'];\n var resumeState = message['resumeState'];\n if (currentTime != null)\n this.video_.currentTime = Number(currentTime);\n if (resumeState && resumeState == 'PLAYBACK_START') {\n this.video_.play();\n this.sendMediaStatus_(0);\n } else if (resumeState && resumeState == 'PLAYBACK_PAUSE') {\n this.video_.pause();\n this.sendMediaStatus_(0);\n }\n break;\n case 'STOP':\n this.player_.unload().then(function() {\n this.sendMediaStatus_(0);\n }.bind(this));\n break;\n case 'GET_STATUS':\n // TODO(ismena): According to the SDK this is supposed to be a\n // unicast message to the sender that requested the status,\n // but it doesn't appear to be working.\n // Look into what's going on there and change this to be a\n // unicast.\n this.sendMediaStatus_(Number(message['requestId']));\n break;\n case 'VOLUME':\n var volumeObject = message['volume'];\n var level = volumeObject['level'];\n var muted = volumeObject['muted'];\n var oldVolumeLevel = this.video_.volume;\n var oldVolumeMuted = this.video_.muted;\n if (level != null)\n this.video_.volume = Number(level);\n if (muted != null)\n this.video_.muted = muted;\n // Notify generic controllers if the volume changed.\n if (oldVolumeLevel != this.video_.volume ||\n oldVolumeMuted != this.video_.muted) {\n this.sendMediaStatus_(0);\n }\n break;\n case 'LOAD':\n var mediaInfo = message['media'];\n var contentId = mediaInfo['contentId'];\n var currentTime = message['currentTime'];\n var manifestUri = this.opt_contentIdCallback_(contentId);\n var autoplay = message['autoplay'] || true;\n if (autoplay)\n this.video_.autoplay = true;\n this.player_.load(manifestUri, currentTime).then(function() {\n // Notify generic controllers that the media has changed.\n var media = {\n 'contentId': manifestUri,\n 'streamType': this.player_.isLive() ? 'LIVE' : 'BUFFERED',\n // TODO: Is there a use case when this would be required?\n // Sending an empty string for now since it's a mandatory\n // field.\n 'contentType': ''\n };\n this.sendMediaStatus_(0, media);\n }.bind(this)).catch(function(error) {\n // Load failed. Dispatch the error message to the sender.\n var type = 'LOAD_FAILED';\n if (error.category == shaka.util.Error.Category.PLAYER &&\n error.code == shaka.util.Error.Code.LOAD_INTERRUPTED) {\n type = 'LOAD_CANCELLED';\n }\n\n this.sendMessage_({\n 'requestId': Number(message['requestId']),\n 'type': type\n }, this.genericBus_);\n }.bind(this));\n break;\n default:\n shaka.log.warning(\n 'Unrecognized message type from the generic Chromecast controller!',\n message['type']);\n // Dispatch an error to the sender.\n this.sendMessage_({\n 'requestId': Number(message['requestId']),\n 'type': 'INVALID_REQUEST',\n 'reason': 'INVALID_COMMAND'\n }, this.genericBus_);\n break;\n }\n};\n\n\n/**\n * Tell the sender that the async operation is complete.\n * @param {string} senderId\n * @param {string} id\n * @param {shaka.util.Error} error\n * @private\n */\nshaka.cast.CastReceiver.prototype.sendAsyncComplete_ =\n function(senderId, id, error) {\n this.sendMessage_({\n 'type': 'asyncComplete',\n 'id': id,\n 'error': error\n }, this.shakaBus_, senderId);\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages passed\n * in here were created with quoted property names.\n * @param {!Object} message\n * @param {cast.receiver.CastMessageBus} bus\n * @param {string=} opt_senderId\n * @private\n */\nshaka.cast.CastReceiver.prototype.sendMessage_ =\n function(message, bus, opt_senderId) {\n // Cuts log spam when debugging the receiver UI in Chrome.\n if (!this.isConnected_) return;\n\n var serialized = shaka.cast.CastUtils.serialize(message);\n if (opt_senderId) {\n bus.getCastChannel(opt_senderId).send(serialized);\n } else {\n bus.broadcast(serialized);\n }\n};\n\n\n/**\n * @return {string}\n * @private\n */\nshaka.cast.CastReceiver.prototype.getPlayState_ = function() {\n var playState = shaka.cast.CastReceiver.PLAY_STATE;\n if (this.isIdle_)\n return playState.IDLE;\n else if (this.player_.isBuffering())\n return playState.BUFFERING;\n else if (this.video_.paused)\n return playState.PAUSED;\n else\n return playState.PLAYING;\n};\n\n\n/**\n * @param {number} requestId\n * @param {Object=} opt_media\n * @private\n */\nshaka.cast.CastReceiver.prototype.sendMediaStatus_ =\n function(requestId, opt_media) {\n var mediaStatus = {\n // mediaSessionId is a unique ID for the playback of this specific session.\n // It's used to identify a specific instance of a playback.\n // We don't support multiple playbacks, so just return 0.\n 'mediaSessionId': 0,\n 'playbackRate': this.video_.playbackRate,\n 'playerState': this.getPlayState_(),\n 'currentTime': this.video_.currentTime,\n // supportedMediaCommands is a sum of all the flags of commands that the\n // player supports.\n // The list of comands with respective flags is:\n // 1 - Pause\n // 2 - Seek\n // 4 - Stream volume\n // 8 - Stream mute\n // 16 - Skip forward\n // 32 - Skip backward\n // We support pause, seek, volume and mute which gives a value of\n // 1+2+4+8=15\n 'supportedMediaCommands': 15,\n 'volume': {\n 'level': this.video_.volume,\n 'muted': this.video_.muted\n }\n };\n\n if (opt_media)\n mediaStatus['media'] = opt_media;\n\n var ret = {\n 'requestId': requestId,\n 'type': 'MEDIA_STATUS',\n 'status': [mediaStatus]\n };\n\n this.sendMessage_(ret, this.genericBus_);\n};\n\n\n/**\n * @enum {string}\n */\nshaka.cast.CastReceiver.PLAY_STATE = {\n IDLE: 'IDLE',\n PLAYING: 'PLAYING',\n BUFFERING: 'BUFFERING',\n PAUSED: 'PAUSED'\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_receiver.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.XmlUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\n\n\n/**\n * @namespace shaka.util.XmlUtils\n * @summary A set of XML utility functions.\n */\n\n\n/**\n * Finds a child XML element.\n * @param {!Element} elem The parent XML element.\n * @param {string} name The child XML element's tag name.\n * @return {Element} The child XML element, or null if a child XML element does\n * not exist with the given tag name OR if there exists more than one\n * child XML element with the given tag name.\n */\nshaka.util.XmlUtils.findChild = function(elem, name) {\n var children = shaka.util.XmlUtils.findChildren(elem, name);\n if (children.length != 1)\n return null;\n return children[0];\n};\n\n\n/**\n * Finds child XML elements.\n * @param {!Element} elem The parent XML element.\n * @param {string} name The child XML element's tag name.\n * @return {!Array.<!Element>} The child XML elements.\n */\nshaka.util.XmlUtils.findChildren = function(elem, name) {\n return Array.prototype.filter.call(elem.childNodes, function(child) {\n goog.asserts.assert(\n child.tagName != name || child instanceof Element,\n 'child element should be an Element');\n return child.tagName == name;\n });\n};\n\n\n/**\n * Gets the text contents of a node.\n * @param {!Element} elem The XML element.\n * @return {?string} The text contents, or null if there are none.\n */\nshaka.util.XmlUtils.getContents = function(elem) {\n var contents = elem.firstChild;\n\n // check content\n if (!contents || contents.nodeType != Node.TEXT_NODE)\n return null;\n\n // read merged text content from all text nodes (fixes MSIE 11 bug)\n return elem.textContent.trim();\n};\n\n\n/**\n * Parses an attribute by its name.\n * @param {!Element} elem The XML element.\n * @param {string} name The attribute name.\n * @param {function(string): (T|null)} parseFunction A function that parses\n * the attribute.\n * @param {(T|null)=} opt_defaultValue The attribute's default value, if not\n * specified, the attibute's default value is null.\n * @return {(T|null)} The parsed attribute on success, or the attribute's\n * default value if the attribute does not exist or could not be parsed.\n * @template T\n */\nshaka.util.XmlUtils.parseAttr = function(\n elem, name, parseFunction, opt_defaultValue) {\n var parsedValue = null;\n\n var value = elem.getAttribute(name);\n if (value != null)\n parsedValue = parseFunction(value);\n\n if (parsedValue == null)\n return opt_defaultValue != undefined ? opt_defaultValue : null;\n\n return parsedValue;\n};\n\n\n/**\n * Parses an XML date string.\n * @param {string} dateString\n * @return {?number} The parsed date in seconds on success; otherwise, return\n * null.\n */\nshaka.util.XmlUtils.parseDate = function(dateString) {\n if (!dateString)\n return null;\n\n var result = Date.parse(dateString);\n return (!isNaN(result) ? Math.floor(result / 1000.0) : null);\n};\n\n\n/**\n * Parses an XML duration string.\n * Negative values are not supported. Years and months are treated as exactly\n * 365 and 30 days respectively.\n * @param {string} durationString The duration string, e.g., \"PT1H3M43.2S\",\n * which means 1 hour, 3 minutes, and 43.2 seconds.\n * @return {?number} The parsed duration in seconds on success; otherwise,\n * return null.\n * @see {@link http://www.datypic.com/sc/xsd/t-xsd_duration.html}\n */\nshaka.util.XmlUtils.parseDuration = function(durationString) {\n if (!durationString)\n return null;\n\n var re = '^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?' +\n '(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$';\n var matches = new RegExp(re).exec(durationString);\n\n if (!matches) {\n shaka.log.warning('Invalid duration string:', durationString);\n return null;\n }\n\n // Note: Number(null) == 0 but Number(undefined) == NaN.\n var years = Number(matches[1] || null);\n var months = Number(matches[2] || null);\n var days = Number(matches[3] || null);\n var hours = Number(matches[4] || null);\n var minutes = Number(matches[5] || null);\n var seconds = Number(matches[6] || null);\n\n // Assume a year always has 365 days and a month always has 30 days.\n var d = (60 * 60 * 24 * 365) * years +\n (60 * 60 * 24 * 30) * months +\n (60 * 60 * 24) * days +\n (60 * 60) * hours +\n 60 * minutes +\n seconds;\n return isFinite(d) ? d : null;\n};\n\n\n/**\n * Parses a range string.\n * @param {string} rangeString The range string, e.g., \"101-9213\".\n * @return {?{start: number, end: number}} The parsed range on success;\n * otherwise, return null.\n */\nshaka.util.XmlUtils.parseRange = function(rangeString) {\n var matches = /([0-9]+)-([0-9]+)/.exec(rangeString);\n\n if (!matches)\n return null;\n\n var start = Number(matches[1]);\n if (!isFinite(start))\n return null;\n\n var end = Number(matches[2]);\n if (!isFinite(end))\n return null;\n\n return {start: start, end: end};\n};\n\n\n/**\n * Parses an integer.\n * @param {string} intString The integer string.\n * @return {?number} The parsed integer on success; otherwise, return null.\n */\nshaka.util.XmlUtils.parseInt = function(intString) {\n var n = Number(intString);\n return (n % 1 === 0) ? n : null;\n};\n\n\n/**\n * Parses a positive integer.\n * @param {string} intString The integer string.\n * @return {?number} The parsed positive integer on success; otherwise,\n * return null.\n */\nshaka.util.XmlUtils.parsePositiveInt = function(intString) {\n var n = Number(intString);\n return (n % 1 === 0) && (n > 0) ? n : null;\n};\n\n\n/**\n * Parses a non-negative integer.\n * @param {string} intString The integer string.\n * @return {?number} The parsed non-negative integer on success; otherwise,\n * return null.\n */\nshaka.util.XmlUtils.parseNonNegativeInt = function(intString) {\n var n = Number(intString);\n return (n % 1 === 0) && (n >= 0) ? n : null;\n};\n\n\n/**\n * Parses a floating point number.\n * @param {string} floatString The floating point number string.\n * @return {?number} The parsed floating point number on success; otherwise,\n * return null. May return -Infinity or Infinity.\n */\nshaka.util.XmlUtils.parseFloat = function(floatString) {\n var n = Number(floatString);\n return !isNaN(n) ? n : null;\n};\n\n\n/**\n * Evaluate a division expressed as a string\n * @param {string} exprString\n * The expression to evaluate, e.g. \"200/2\". Can also be a single number\n * @return {?number} The evaluated expression as floating point number on\n * success; otherwise return null.\n */\nshaka.util.XmlUtils.evalDivision = function(exprString) {\n var res;\n var n;\n if (res = exprString.match(/^(\\d+)\\/(\\d+)$/)) {\n n = Number(res[1] / res[2]);\n } else {\n n = Number(exprString);\n }\n return !isNaN(n) ? n : null;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/xml_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.ContentProtection');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.Uint8ArrayUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.ContentProtection\n * @summary A set of functions for parsing and interpreting ContentProtection\n * elements.\n */\n\n\n/**\n * @typedef {{\n * defaultKeyId: ?string,\n * defaultInit: Array.<shakaExtern.InitDataOverride>,\n * drmInfos: !Array.<shakaExtern.DrmInfo>,\n * firstRepresentation: boolean\n * }}\n *\n * @description\n * Contains information about the ContentProtection elements found at the\n * AdaptationSet level.\n *\n * @property {?string} defaultKeyId\n * The default key ID to use. This is used by parseKeyIds as a default. This\n * can be null to indicate that there is no default.\n * @property {Array.<shakaExtern.InitDataOverride>} defaultInit\n * The default init data override. This can be null to indicate that there\n * is no default.\n * @property {!Array.<shakaExtern.DrmInfo>} drmInfos\n * The DrmInfo objects.\n * @property {boolean} firstRepresentation\n * True when first parsed; changed to false after the first call to\n * parseKeyIds. This is used to determine if a dummy key-system should be\n * overwritten; namely that the first representation can replace the dummy\n * from the AdaptationSet.\n */\nshaka.dash.ContentProtection.Context;\n\n\n/**\n * @typedef {{\n * node: !Element,\n * schemeUri: string,\n * keyId: ?string,\n * init: Array.<shakaExtern.InitDataOverride>\n * }}\n *\n * @description\n * The parsed result of a single ContentProtection element.\n *\n * @property {!Element} node\n * The ContentProtection XML element.\n * @property {string} schemeUri\n * The scheme URI.\n * @property {?string} keyId\n * The default key ID, if present.\n * @property {Array.<shakaExtern.InitDataOverride>} init\n * The init data, if present. If there is no init data, it will be null. If\n * this is non-null, there is at least one element.\n */\nshaka.dash.ContentProtection.Element;\n\n\n/**\n * A map of scheme URI to key system name.\n *\n * @const {!Object.<string, string>}\n * @private\n */\nshaka.dash.ContentProtection.defaultKeySystems_ = {\n 'urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b': 'org.w3.clearkey',\n 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed': 'com.widevine.alpha',\n 'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95': 'com.microsoft.playready',\n 'urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb': 'com.adobe.primetime'\n};\n\n\n/**\n * @const {string}\n * @private\n */\nshaka.dash.ContentProtection.MP4Protection_ =\n 'urn:mpeg:dash:mp4protection:2011';\n\n\n/**\n * Parses info from the ContentProtection elements at the AdaptationSet level.\n *\n * @param {!Array.<!Element>} elems\n * @param {shakaExtern.DashContentProtectionCallback} callback\n * @param {boolean} ignoreDrmInfo\n * @return {shaka.dash.ContentProtection.Context}\n */\nshaka.dash.ContentProtection.parseFromAdaptationSet = function(\n elems, callback, ignoreDrmInfo) {\n var ContentProtection = shaka.dash.ContentProtection;\n var Functional = shaka.util.Functional;\n var MapUtils = shaka.util.MapUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var parsed = ContentProtection.parseElements_(elems);\n /** @type {Array.<shakaExtern.InitDataOverride>} */\n var defaultInit = null;\n /** @type {?string} */\n var defaultKeyId = null;\n /** @type {!Array.<shakaExtern.DrmInfo>} */\n var drmInfos = [];\n var parsedNonCenc = [];\n\n // Get the default key ID; if there are multiple, they must all match.\n var keyIds = parsed.map(function(elem) { return elem.keyId; })\n .filter(Functional.isNotNull);\n if (keyIds.length > 0) {\n defaultKeyId = keyIds[0];\n if (keyIds.some(Functional.isNotEqualFunc(defaultKeyId))) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_CONFLICTING_KEY_IDS);\n }\n }\n\n if (!ignoreDrmInfo) {\n // Find the default key ID and init data. Create a new array of all the\n // non-CENC elements.\n parsedNonCenc = parsed.filter(function(elem) {\n if (elem.schemeUri == ContentProtection.MP4Protection_) {\n goog.asserts.assert(!elem.init || elem.init.length,\n 'Init data must be null or non-empty.');\n defaultInit = elem.init || defaultInit;\n return false;\n } else {\n return true;\n }\n });\n\n if (parsedNonCenc.length > 0) {\n drmInfos = ContentProtection.convertElements_(\n defaultInit, callback, parsedNonCenc);\n\n // If there are no drmInfos after parsing, then add a dummy entry.\n // This may be removed in parseKeyIds.\n if (drmInfos.length == 0) {\n drmInfos = [ManifestParserUtils.createDrmInfo('', defaultInit)];\n }\n }\n }\n\n // If there are only CENC element(s) or ignoreDrmInfo flag is set, assume all\n // key-systems are supported.\n if (parsed.length > 0 && (ignoreDrmInfo || !parsedNonCenc.length)) {\n var keySystems = ContentProtection.defaultKeySystems_;\n drmInfos =\n MapUtils.values(keySystems)\n .map(function(keySystem) {\n return ManifestParserUtils.createDrmInfo(keySystem, defaultInit);\n });\n }\n\n // attach the default keyId, if it exists, to every initData\n if (defaultKeyId) {\n drmInfos.forEach(function(drmInfo) {\n drmInfo.initData.forEach(function(initData) {\n initData.keyId = defaultKeyId;\n });\n });\n }\n\n return {\n defaultKeyId: defaultKeyId,\n defaultInit: defaultInit,\n drmInfos: drmInfos,\n firstRepresentation: true\n };\n};\n\n\n/**\n * Parses the given ContentProtection elements found at the Representation\n * level. This may update the |context|.\n *\n * @param {!Array.<!Element>} elems\n * @param {shakaExtern.DashContentProtectionCallback} callback\n * @param {shaka.dash.ContentProtection.Context} context\n * @param {boolean} ignoreDrmInfo\n * @return {?string} The parsed key ID\n */\nshaka.dash.ContentProtection.parseFromRepresentation = function(\n elems, callback, context, ignoreDrmInfo) {\n var ContentProtection = shaka.dash.ContentProtection;\n var repContext = ContentProtection.parseFromAdaptationSet(\n elems, callback, ignoreDrmInfo);\n\n if (context.firstRepresentation) {\n var asUnknown = context.drmInfos.length == 1 &&\n !context.drmInfos[0].keySystem;\n var asUnencrypted = context.drmInfos.length == 0;\n var repUnencrypted = repContext.drmInfos.length == 0;\n\n // There are two cases when we need to replace the |drmInfos| in the context\n // with those in the Representation:\n // * The AdaptationSet does not list any ContentProtection.\n // * The AdaptationSet only lists unknown key-systems.\n if (asUnencrypted || (asUnknown && !repUnencrypted)) {\n context.drmInfos = repContext.drmInfos;\n }\n context.firstRepresentation = false;\n } else if (repContext.drmInfos.length > 0) {\n // If this is not the first Representation, then we need to remove entries\n // from the context that do not appear in this Representation.\n context.drmInfos = context.drmInfos.filter(function(asInfo) {\n return repContext.drmInfos.some(function(repInfo) {\n return repInfo.keySystem == asInfo.keySystem;\n });\n });\n // If we have filtered out all key-systems, throw an error.\n if (context.drmInfos.length == 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_COMMON_KEY_SYSTEM);\n }\n }\n\n return repContext.defaultKeyId || context.defaultKeyId;\n};\n\n\n/**\n * Creates DrmInfo objects from the given element.\n *\n * @param {Array.<shakaExtern.InitDataOverride>} defaultInit\n * @param {shakaExtern.DashContentProtectionCallback} callback\n * @param {!Array.<shaka.dash.ContentProtection.Element>} elements\n * @return {!Array.<shakaExtern.DrmInfo>}\n * @private\n */\nshaka.dash.ContentProtection.convertElements_ = function(\n defaultInit, callback, elements) {\n var Functional = shaka.util.Functional;\n return elements.map(\n /**\n * @param {shaka.dash.ContentProtection.Element} element\n * @return {!Array.<shakaExtern.DrmInfo>}\n */\n function(element) {\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var ContentProtection = shaka.dash.ContentProtection;\n var keySystem = ContentProtection.defaultKeySystems_[element.schemeUri];\n if (keySystem) {\n goog.asserts.assert(!element.init || element.init.length,\n 'Init data must be null or non-empty.');\n var initData = element.init || defaultInit;\n return [ManifestParserUtils.createDrmInfo(keySystem, initData)];\n } else {\n goog.asserts.assert(\n callback, 'ContentProtection callback is required');\n return callback(element.node) || [];\n }\n }).reduce(Functional.collapseArrays, []);\n};\n\n\n/**\n * Parses the given ContentProtection elements. If there is an error, it\n * removes those elements.\n *\n * @param {!Array.<!Element>} elems\n * @return {!Array.<shaka.dash.ContentProtection.Element>}\n * @private\n */\nshaka.dash.ContentProtection.parseElements_ = function(elems) {\n var Functional = shaka.util.Functional;\n return elems.map(\n /**\n * @param {!Element} elem\n * @return {?shaka.dash.ContentProtection.Element}\n */\n function(elem) {\n /** @type {?string} */\n var schemeUri = elem.getAttribute('schemeIdUri');\n /** @type {?string} */\n var keyId = elem.getAttribute('cenc:default_KID');\n /** @type {!Array.<string>} */\n var psshs = shaka.util.XmlUtils.findChildren(elem, 'cenc:pssh')\n .map(shaka.util.XmlUtils.getContents);\n\n if (!schemeUri) {\n shaka.log.error('Missing required schemeIdUri attribute on',\n 'ContentProtection element', elem);\n return null;\n }\n\n schemeUri = schemeUri.toLowerCase();\n if (keyId) {\n keyId = keyId.replace(/-/g, '').toLowerCase();\n if (keyId.indexOf(' ') >= 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED);\n }\n }\n\n /** @type {!Array.<shakaExtern.InitDataOverride>} */\n var init = [];\n try {\n init = psshs.map(function(pssh) {\n /** @type {shakaExtern.InitDataOverride} */\n var ret = {\n initDataType: 'cenc',\n initData: shaka.util.Uint8ArrayUtils.fromBase64(pssh),\n keyId: null\n };\n return ret;\n });\n } catch (e) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_PSSH_BAD_ENCODING);\n }\n\n /** @type {shaka.dash.ContentProtection.Element} */\n var element = {\n node: elem,\n schemeUri: schemeUri,\n keyId: keyId,\n init: (init.length > 0 ? init : null)\n };\n return element;\n }).filter(Functional.isNotNull);\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/content_protection.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.MpdUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.MpdUtils\n * @summary MPD processing utility functions.\n */\n\n\n/**\n * @typedef {{\n * start: number,\n * unscaledStart: number,\n * end: number\n * }}\n *\n * @description\n * Defines a time range of a media segment. Times are in seconds.\n *\n * @property {number} start\n * The start time of the range.\n * @property {number} unscaledStart\n * The start time of the range in representation timescale units.\n * @property {number} end\n * The end time (exclusive) of the range.\n */\nshaka.dash.MpdUtils.TimeRange;\n\n\n/**\n * @typedef {{\n * timescale: number,\n * segmentDuration: ?number,\n * startNumber: number,\n * presentationTimeOffset: number,\n * unscaledPresentationTimeOffset: number,\n * timeline: Array.<shaka.dash.MpdUtils.TimeRange>\n * }}\n *\n * @description\n * Contains common information between SegmentList and SegmentTemplate items.\n *\n * @property {number} timescale\n * The time-scale of the representation.\n * @property {?number} segmentDuration\n * The duration of the segments in seconds, if given.\n * @property {number} startNumber\n * The start number of the segments; 1 or greater.\n * @property {number} presentationTimeOffset\n * The presentationTimeOffset of the representation, in seconds.\n * @property {number} unscaledPresentationTimeOffset\n * The presentationTimeOffset of the representation, in timescale units.\n * @property {Array.<shaka.dash.MpdUtils.TimeRange>} timeline\n * The timeline of the representation, if given. Times in seconds.\n */\nshaka.dash.MpdUtils.SegmentInfo;\n\n\n/**\n * Fills a SegmentTemplate URI template. This function does not validate the\n * resulting URI.\n *\n * @param {string} uriTemplate\n * @param {?string} representationId\n * @param {?number} number\n * @param {?number} bandwidth\n * @param {?number} time\n * @return {string} A URI string.\n * @see ISO/IEC 23009-1:2014 section 5.3.9.4.4\n */\nshaka.dash.MpdUtils.fillUriTemplate = function(\n uriTemplate, representationId, number, bandwidth, time) {\n if (time != null) {\n goog.asserts.assert(Math.abs(time - Math.round(time)) < 0.2,\n 'Calculated $Time$ values must be close to integers!');\n time = Math.round(time);\n }\n\n /** @type {!Object.<string, ?number|?string>} */\n var valueTable = {\n 'RepresentationID': representationId,\n 'Number': number,\n 'Bandwidth': bandwidth,\n 'Time': time\n };\n\n var re = /\\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)d)?\\$/g;\n var uri = uriTemplate.replace(re, function(match, name, widthString) {\n if (match == '$$') {\n return '$';\n }\n\n var value = valueTable[name];\n goog.asserts.assert(value !== undefined, 'Unrecognized identifier');\n\n // Note that |value| may be 0 or ''.\n if (value == null) {\n shaka.log.warning(\n 'URL template does not have an available substitution for identifier',\n '\"' + name + '\":',\n uriTemplate);\n return match;\n }\n\n if (name == 'RepresentationID' && widthString) {\n shaka.log.warning(\n 'URL template should not contain a width specifier for identifier',\n '\"RepresentationID\":',\n uriTemplate);\n widthString = undefined;\n }\n\n var valueString = value.toString();\n\n // Create padding string.\n var width = window.parseInt(widthString, 10) || 1;\n var paddingSize = Math.max(0, width - valueString.length);\n var padding = (new Array(paddingSize + 1)).join('0');\n\n return padding + valueString;\n });\n\n return uri;\n};\n\n\n/**\n * Expands a SegmentTimeline into an array-based timeline. The results are in\n * seconds.\n *\n * @param {!Element} segmentTimeline\n * @param {number} timescale\n * @param {number} presentationTimeOffset\n * @param {number} periodDuration The Period's duration in seconds.\n * Infinity indicates that the Period continues indefinitely.\n * @return {!Array.<shaka.dash.MpdUtils.TimeRange>}\n */\nshaka.dash.MpdUtils.createTimeline = function(\n segmentTimeline, timescale, presentationTimeOffset, periodDuration) {\n goog.asserts.assert(\n timescale > 0 && timescale < Infinity,\n 'timescale must be a positive, finite integer');\n goog.asserts.assert(periodDuration > 0,\n 'period duration must be a positive integer');\n\n // Alias.\n var XmlUtils = shaka.util.XmlUtils;\n\n var timePoints = XmlUtils.findChildren(segmentTimeline, 'S');\n\n /** @type {!Array.<shaka.dash.MpdUtils.TimeRange>} */\n var timeline = [];\n var lastEndTime = 0;\n\n for (var i = 0; i < timePoints.length; ++i) {\n var timePoint = timePoints[i];\n var t = XmlUtils.parseAttr(timePoint, 't', XmlUtils.parseNonNegativeInt);\n var d = XmlUtils.parseAttr(timePoint, 'd', XmlUtils.parseNonNegativeInt);\n var r = XmlUtils.parseAttr(timePoint, 'r', XmlUtils.parseInt);\n\n // Adjust start considering the presentation time offset\n if (t != null)\n t -= presentationTimeOffset;\n\n if (!d) {\n shaka.log.warning(\n '\"S\" element must have a duration:',\n 'ignoring the remaining \"S\" elements.',\n timePoint);\n return timeline;\n }\n\n var startTime = t != null ? t : lastEndTime;\n\n var repeat = r || 0;\n if (repeat < 0) {\n if (i + 1 < timePoints.length) {\n var nextTimePoint = timePoints[i + 1];\n var nextStartTime = XmlUtils.parseAttr(\n nextTimePoint, 't', XmlUtils.parseNonNegativeInt);\n if (nextStartTime == null) {\n shaka.log.warning(\n '\"S\" element cannot have a negative repeat',\n 'if the next \"S\" element does not have a valid start time:',\n 'ignoring the remaining \"S\" elements.',\n timePoint);\n return timeline;\n } else if (startTime >= nextStartTime) {\n shaka.log.warning(\n '\"S\" element cannot have a negative repeat',\n 'if its start time exceeds the next \"S\" element\\'s start time:',\n 'ignoring the remaining \"S\" elements.',\n timePoint);\n return timeline;\n }\n repeat = Math.ceil((nextStartTime - startTime) / d) - 1;\n } else {\n if (periodDuration == Infinity) {\n // The DASH spec. actually allows the last \"S\" element to have a\n // negative repeat value even when the Period has an infinite\n // duration. No one uses this feature and no one ever should, ever.\n shaka.log.warning(\n 'The last \"S\" element cannot have a negative repeat',\n 'if the Period has an infinite duration:',\n 'ignoring the last \"S\" element.',\n timePoint);\n return timeline;\n } else if (startTime / timescale >= periodDuration) {\n shaka.log.warning(\n 'The last \"S\" element cannot have a negative repeat',\n 'if its start time exceeds the Period\\'s duration:',\n 'igoring the last \"S\" element.',\n timePoint);\n return timeline;\n }\n repeat = Math.ceil((periodDuration * timescale - startTime) / d) - 1;\n }\n }\n\n // The end of the last segment may end before the start of the current\n // segment (a gap) or may end after the start of the current segment (an\n // overlap). If there is a gap/overlap then stretch/compress the end of\n // the last segment to the start of the current segment.\n //\n // Note: it is possible to move the start of the current segment to the\n // end of the last segment, but this would complicate the computation of\n // the $Time$ placeholder later on.\n if ((timeline.length > 0) && (startTime != lastEndTime)) {\n var delta = startTime - lastEndTime;\n\n if (Math.abs(delta / timescale) >=\n shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS) {\n shaka.log.warning(\n 'SegmentTimeline contains a large gap/overlap:',\n 'the content may have errors in it.',\n timePoint);\n }\n\n timeline[timeline.length - 1].end = startTime / timescale;\n }\n\n for (var j = 0; j <= repeat; ++j) {\n var endTime = startTime + d;\n var item = {\n start: startTime / timescale,\n end: endTime / timescale,\n unscaledStart: startTime\n };\n timeline.push(item);\n\n startTime = endTime;\n lastEndTime = endTime;\n }\n }\n\n return timeline;\n};\n\n\n/**\n * Parses common segment info for SegmentList and SegmentTemplate.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * Gets the element that contains the segment info.\n * @return {shaka.dash.MpdUtils.SegmentInfo}\n */\nshaka.dash.MpdUtils.parseSegmentInfo = function(context, callback) {\n goog.asserts.assert(\n callback(context.representation),\n 'There must be at least one element of the given type.');\n var MpdUtils = shaka.dash.MpdUtils;\n var XmlUtils = shaka.util.XmlUtils;\n\n var timescaleStr = MpdUtils.inheritAttribute(context, callback, 'timescale');\n var timescale = 1;\n if (timescaleStr) {\n timescale = XmlUtils.parsePositiveInt(timescaleStr) || 1;\n }\n\n var durationStr = MpdUtils.inheritAttribute(context, callback, 'duration');\n var segmentDuration = XmlUtils.parsePositiveInt(durationStr || '');\n if (segmentDuration) {\n segmentDuration /= timescale;\n }\n\n var startNumberStr =\n MpdUtils.inheritAttribute(context, callback, 'startNumber');\n var presentationTimeOffset =\n MpdUtils.inheritAttribute(context, callback, 'presentationTimeOffset');\n var startNumber = XmlUtils.parseNonNegativeInt(startNumberStr || '');\n if (startNumberStr == null || startNumber == null)\n startNumber = 1;\n\n var timelineNode =\n MpdUtils.inheritChild(context, callback, 'SegmentTimeline');\n /** @type {Array.<shaka.dash.MpdUtils.TimeRange>} */\n var timeline = null;\n if (timelineNode) {\n timeline = MpdUtils.createTimeline(\n timelineNode, timescale, Number(presentationTimeOffset),\n context.periodInfo.duration || Infinity);\n }\n\n var pto = (Number(presentationTimeOffset) / timescale) || 0;\n return {\n timescale: timescale,\n segmentDuration: segmentDuration,\n startNumber: startNumber,\n presentationTimeOffset: pto,\n unscaledPresentationTimeOffset: Number(presentationTimeOffset),\n timeline: timeline\n };\n};\n\n\n/**\n * Searches the inheritance for a Segment* with the given attribute.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * Gets the Element that contains the attribute to inherit.\n * @param {string} attribute\n * @return {?string}\n */\nshaka.dash.MpdUtils.inheritAttribute = function(context, callback, attribute) {\n var Functional = shaka.util.Functional;\n goog.asserts.assert(\n callback(context.representation),\n 'There must be at least one element of the given type');\n\n /** @type {!Array.<!Element>} */\n var nodes = [\n callback(context.representation),\n callback(context.adaptationSet),\n callback(context.period)\n ].filter(Functional.isNotNull);\n\n return nodes\n .map(function(s) { return s.getAttribute(attribute); })\n .reduce(function(all, part) { return all || part; });\n};\n\n\n/**\n * Searches the inheritance for a Segment* with the given child.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * Gets the Element that contains the child to inherit.\n * @param {string} child\n * @return {Element}\n */\nshaka.dash.MpdUtils.inheritChild = function(context, callback, child) {\n var Functional = shaka.util.Functional;\n goog.asserts.assert(\n callback(context.representation),\n 'There must be at least one element of the given type');\n\n /** @type {!Array.<!Element>} */\n var nodes = [\n callback(context.representation),\n callback(context.adaptationSet),\n callback(context.period)\n ].filter(Functional.isNotNull);\n\n var XmlUtils = shaka.util.XmlUtils;\n return nodes\n .map(function(s) { return XmlUtils.findChild(s, child); })\n .reduce(function(all, part) { return all || part; });\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/mpd_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.InitSegmentReference');\ngoog.provide('shaka.media.SegmentReference');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Creates an InitSegmentReference, which provides the location to an\n * initialization segment.\n *\n * @param {function():!Array.<string>} uris\n * A function that creates the URIs of the resource containing the segment.\n * @param {number} startByte The offset from the start of the resource to the\n * start of the segment.\n * @param {?number} endByte The offset from the start of the resource to the\n * end of the segment, inclusive. null indicates that the segment extends\n * to the end of the resource.\n *\n * @constructor\n * @struct\n * @export\n */\nshaka.media.InitSegmentReference = function(uris, startByte, endByte) {\n /** @type {function():!Array.<string>} */\n this.getUris = uris;\n\n /** @const {number} */\n this.startByte = startByte;\n\n /** @const {?number} */\n this.endByte = endByte;\n};\n\n\n\n/**\n * Creates a SegmentReference, which provides the start time, end time, and\n * location to a media segment.\n *\n * @param {number} position The segment's position within a particular Period.\n * The following should hold true between any two SegmentReferences from the\n * same Period, r1 and r2:\n * IF r2.position > r1.position THEN\n * [ (r2.startTime > r1.startTime) OR\n * (r2.startTime == r1.startTime AND r2.endTime >= r1.endTime) ]\n * @param {number} startTime The segment's start time in seconds, relative to\n * the start of a particular Period.\n * @param {number} endTime The segment's end time in seconds, relative to\n * the start of a particular Period. The segment ends the instant before\n * this time, so |endTime| must be strictly greater than |startTime|.\n * @param {function():!Array.<string>} uris\n * A function that creates the URIs of the resource containing the segment.\n * @param {number} startByte The offset from the start of the resource to the\n * start of the segment.\n * @param {?number} endByte The offset from the start of the resource to the\n * end of the segment, inclusive. null indicates that the segment extends\n * to the end of the resource.\n *\n * @constructor\n * @struct\n * @export\n */\nshaka.media.SegmentReference = function(\n position, startTime, endTime, uris, startByte, endByte) {\n goog.asserts.assert(startTime < endTime,\n 'startTime must be less than endTime');\n goog.asserts.assert((startByte < endByte) || (endByte == null),\n 'startByte must be < endByte');\n /** @const {number} */\n this.position = position;\n\n /** @const {number} */\n this.startTime = startTime;\n\n /** @const {number} */\n this.endTime = endTime;\n\n /** @type {function():!Array.<string>} */\n this.getUris = uris;\n\n /** @const {number} */\n this.startByte = startByte;\n\n /** @const {?number} */\n this.endByte = endByte;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/segment_reference.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.DataViewReader');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\n\n\n\n/**\n * Creates a DataViewReader, which abstracts a DataView object.\n *\n * @param {!DataView} dataView The DataView.\n * @param {shaka.util.DataViewReader.Endianness} endianness The endianness.\n *\n * @struct\n * @constructor\n * @export\n */\nshaka.util.DataViewReader = function(dataView, endianness) {\n /** @private {!DataView} */\n this.dataView_ = dataView;\n\n /** @private {boolean} */\n this.littleEndian_ =\n endianness == shaka.util.DataViewReader.Endianness.LITTLE_ENDIAN;\n\n /** @private {number} */\n this.position_ = 0;\n};\n\n\n/**\n * Endianness.\n * @enum {number}\n * @export\n */\nshaka.util.DataViewReader.Endianness = {\n BIG_ENDIAN: 0,\n LITTLE_ENDIAN: 1\n};\n\n\n/**\n * @return {boolean} True if the reader has more data, false otherwise.\n * @export\n */\nshaka.util.DataViewReader.prototype.hasMoreData = function() {\n return this.position_ < this.dataView_.byteLength;\n};\n\n\n/**\n * Gets the current byte position.\n * @return {number}\n * @export\n */\nshaka.util.DataViewReader.prototype.getPosition = function() {\n return this.position_;\n};\n\n\n/**\n * Gets the byte length of the DataView.\n * @return {number}\n * @export\n */\nshaka.util.DataViewReader.prototype.getLength = function() {\n return this.dataView_.byteLength;\n};\n\n\n/**\n * Reads an unsigned 8 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint8 = function() {\n try {\n var value = this.dataView_.getUint8(this.position_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 1;\n return value;\n};\n\n\n/**\n * Reads an unsigned 16 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint16 = function() {\n try {\n var value = this.dataView_.getUint16(this.position_, this.littleEndian_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 2;\n return value;\n};\n\n\n/**\n * Reads an unsigned 32 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint32 = function() {\n try {\n var value = this.dataView_.getUint32(this.position_, this.littleEndian_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 4;\n return value;\n};\n\n\n/**\n * Reads a signed 32 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readInt32 = function() {\n try {\n var value = this.dataView_.getInt32(this.position_, this.littleEndian_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 4;\n return value;\n};\n\n\n/**\n * Reads an unsigned 64 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view or\n * when reading an integer too large to store accurately in JavaScript.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint64 = function() {\n var low, high;\n\n try {\n if (this.littleEndian_) {\n low = this.dataView_.getUint32(this.position_, true);\n high = this.dataView_.getUint32(this.position_ + 4, true);\n } else {\n high = this.dataView_.getUint32(this.position_, false);\n low = this.dataView_.getUint32(this.position_ + 4, false);\n }\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n\n if (high > 0x1FFFFF) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.JS_INTEGER_OVERFLOW);\n }\n\n this.position_ += 8;\n\n // NOTE: This is subtle, but in JavaScript you can't shift left by 32 and get\n // the full range of 53-bit values possible. You must multiply by 2^32.\n return (high * Math.pow(2, 32)) + low;\n};\n\n\n/**\n * Reads the specified number of raw bytes.\n * @param {number} bytes The number of bytes to read.\n * @return {!Uint8Array}\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readBytes = function(bytes) {\n goog.asserts.assert(bytes > 0, 'Bad call to DataViewReader.readBytes');\n if (this.position_ + bytes > this.dataView_.byteLength) {\n this.throwOutOfBounds_();\n }\n var value = this.dataView_.buffer.slice(\n this.position_, this.position_ + bytes);\n this.position_ += bytes;\n return new Uint8Array(value);\n};\n\n\n/**\n * Skips the specified number of bytes.\n * @param {number} bytes The number of bytes to skip.\n * @throws {shaka.util.Error} when skipping past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.skip = function(bytes) {\n goog.asserts.assert(bytes >= 0, 'Bad call to DataViewReader.skip');\n if (this.position_ + bytes > this.dataView_.byteLength) {\n this.throwOutOfBounds_();\n }\n this.position_ += bytes;\n};\n\n\n/**\n * Keeps reading until it reaches a byte that equals to zero. The text is\n * assumed to be UTF-8.\n * @return {string}\n * @export\n */\nshaka.util.DataViewReader.prototype.readTerminatedString = function() {\n var start = this.position_;\n while (this.hasMoreData()) {\n var value = this.dataView_.getUint8(this.position_);\n if (value == 0) break;\n this.position_ += 1;\n }\n\n var ret = this.dataView_.buffer.slice(start, this.position_);\n // skip string termination\n this.position_ += 1;\n return shaka.util.StringUtils.fromUTF8(ret);\n};\n\n\n/**\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.util.DataViewReader.prototype.throwOutOfBounds_ = function() {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.BUFFER_READ_OUT_OF_BOUNDS);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/data_view_reader.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Mp4Parser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.DataViewReader');\n\n\n\n/**\n * Create a new MP4 Parser\n * @struct\n * @constructor\n * @export\n */\nshaka.util.Mp4Parser = function() {\n /**\n * @type {!Object.<number, shaka.util.Mp4Parser.BoxType_>}\n * @private\n */\n this.headers_ = [];\n\n /**\n * @type {!Object.<number, !shaka.util.Mp4Parser.CallbackType>}\n * @private\n */\n this.boxDefinitions_ = [];\n};\n\n\n/**\n * @typedef {{\n * parser: !shaka.util.Mp4Parser,\n * start: number,\n * size: number,\n * version: ?number,\n * flags: ?number,\n * reader: !shaka.util.DataViewReader\n * }}\n *\n * @property {!shaka.util.Mp4Parser} parser\n * The parser that parsed this box. The parser can be used to parse child\n * boxes where the configuration of the current parser is needed to parsed\n * other boxes.\n * @property {number} start\n * The start of this box (before the header) in the original buffer. This\n * start position is the absolute position.\n * @property {number} size\n * The size of this box (including the header).\n * @property {?number} version\n * The version for a full box, null for basic boxes.\n * @property {?number} flags\n * The flags for a full box, null for basic boxes.\n * @property {!shaka.util.DataViewReader} reader\n * The reader for this box is only for this box. Reading or not reading to\n * the end will have no affect on the parser reading other sibling boxes.\n * @exportInterface\n */\nshaka.util.Mp4Parser.ParsedBox;\n\n\n/**\n * @typedef {function(!shaka.util.Mp4Parser.ParsedBox)}\n * @exportInterface\n */\nshaka.util.Mp4Parser.CallbackType;\n\n\n/**\n * An enum used to track the type of box so that the correct values can be\n * read from the header.\n *\n * @enum {number}\n * @private\n */\nshaka.util.Mp4Parser.BoxType_ = {\n BASIC_BOX: 0,\n FULL_BOX: 1\n};\n\n\n/**\n * Delcare a box type as a Box.\n *\n * @param {string} type\n * @param {!shaka.util.Mp4Parser.CallbackType} definition\n * @return {!shaka.util.Mp4Parser}\n * @export\n */\nshaka.util.Mp4Parser.prototype.box = function(type, definition) {\n var typeCode = shaka.util.Mp4Parser.typeFromString_(type);\n this.headers_[typeCode] = shaka.util.Mp4Parser.BoxType_.BASIC_BOX;\n this.boxDefinitions_[typeCode] = definition;\n return this;\n};\n\n\n/**\n * Declare a box type as a Full Box.\n *\n * @param {string} type\n * @param {!shaka.util.Mp4Parser.CallbackType} definition\n * @return {!shaka.util.Mp4Parser}\n * @export\n */\nshaka.util.Mp4Parser.prototype.fullBox = function(type, definition) {\n var typeCode = shaka.util.Mp4Parser.typeFromString_(type);\n this.headers_[typeCode] = shaka.util.Mp4Parser.BoxType_.FULL_BOX;\n this.boxDefinitions_[typeCode] = definition;\n return this;\n};\n\n\n/**\n * Parse the given data using the added callbacks.\n *\n * @param {!ArrayBuffer} data\n * @export\n */\nshaka.util.Mp4Parser.prototype.parse = function(data) {\n var reader = new shaka.util.DataViewReader(\n new DataView(data),\n shaka.util.DataViewReader.Endianness.BIG_ENDIAN);\n\n while (reader.hasMoreData()) {\n this.parseNext(0, reader);\n }\n};\n\n\n/**\n * Parse the next box on the current level.\n *\n * @param {number} absStart The absolute start position in the original\n * byte array\n * @param {!shaka.util.DataViewReader} reader\n * @export\n */\nshaka.util.Mp4Parser.prototype.parseNext = function(absStart, reader) {\n var start = reader.getPosition();\n\n var size = reader.readUint32();\n var type = reader.readUint32();\n\n switch (size) {\n case 0:\n size = reader.getLength() - start;\n break;\n case 1:\n size = reader.readUint64();\n break;\n }\n\n var boxDefinition = this.boxDefinitions_[type];\n\n if (boxDefinition) {\n var version = null;\n var flags = null;\n\n if (this.headers_[type] == shaka.util.Mp4Parser.BoxType_.FULL_BOX) {\n var versionAndFlags = reader.readUint32();\n version = versionAndFlags >>> 24;\n flags = versionAndFlags & 0xFFFFFF;\n }\n\n // Read the whole payload so that the current level can be safely read\n // regardless of how the payload is parsed.\n var payloadSize = start + size - reader.getPosition();\n var payload = (payloadSize > 0) ?\n reader.readBytes(payloadSize).buffer :\n new ArrayBuffer(0);\n\n var payloadReader = new shaka.util.DataViewReader(\n new DataView(payload),\n shaka.util.DataViewReader.Endianness.BIG_ENDIAN);\n\n /** @type {shaka.util.Mp4Parser.ParsedBox } */\n var box = {\n parser: this,\n version: version,\n flags: flags,\n reader: payloadReader,\n size: size,\n start: start + absStart\n };\n\n boxDefinition(box);\n } else {\n // Move the read head to be at the end of the box.\n reader.skip(start + size - reader.getPosition());\n }\n};\n\n\n/**\n * A callback that tells the Mp4 parser to treat the body of a box as a series\n * of boxes. The number of boxes is limited by the size of the parent box.\n *\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @export\n */\nshaka.util.Mp4Parser.children = function(box) {\n while (box.reader.hasMoreData()) {\n box.parser.parseNext(box.start, box.reader);\n }\n};\n\n\n/**\n * A callback that tells the Mp4 parser to treat the body of a box as a sample\n * description. A sample description box has a fixed number of children. The\n * number of children is represented by a 4 byte unsigned integer. Each child\n * is a box.\n *\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @export\n */\nshaka.util.Mp4Parser.sampleDescription = function(box) {\n for (var count = box.reader.readUint32(); count > 0; count -= 1) {\n box.parser.parseNext(box.start, box.reader);\n }\n};\n\n\n/**\n * Create a callback that tells the Mp4 parser to treat the body of a box as a\n * binary blob and how to handle it.\n *\n * @param {!function(!Uint8Array)} callback\n * @return {!shaka.util.Mp4Parser.CallbackType}\n * @export\n */\nshaka.util.Mp4Parser.allData = function(callback) {\n return function(box) {\n var all = box.reader.getLength() - box.reader.getPosition();\n callback(box.reader.readBytes(all));\n };\n};\n\n\n/**\n * Convert an ascii string name to the integer type for a box.\n *\n * @param {string} name The name of the box. The name must be four\n * characters long.\n * @return {number}\n * @private\n */\nshaka.util.Mp4Parser.typeFromString_ = function(name) {\n goog.asserts.assert(\n name.length == 4,\n 'Mp4 box names must be 4 characters long');\n\n var code = 0;\n for (var i = 0; i < name.length; i++) {\n code = (code << 8) | name.charCodeAt(i);\n }\n return code;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/mp4_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Mp4SegmentIndexParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Mp4Parser');\n\n\n/**\n * Parses SegmentReferences from an ISO BMFF SIDX structure.\n * @param {!ArrayBuffer} sidxData The MP4's container's SIDX.\n * @param {number} sidxOffset The SIDX's offset, in bytes, from the start of\n * the MP4 container.\n * @param {!Array.<string>} uris The possible locations of the MP4 file that\n * contains the segments.\n * @param {number} presentationTimeOffset\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @throws {shaka.util.Error}\n */\nshaka.media.Mp4SegmentIndexParser = function(\n sidxData, sidxOffset, uris, presentationTimeOffset) {\n\n var Mp4SegmentIndexParser = shaka.media.Mp4SegmentIndexParser;\n\n var references;\n\n var parser = new shaka.util.Mp4Parser()\n .fullBox('sidx', function(box) {\n references = Mp4SegmentIndexParser.parseSIDX_(\n sidxOffset,\n presentationTimeOffset,\n uris,\n box);\n });\n\n if (sidxData) {\n parser.parse(sidxData);\n }\n\n if (references) {\n return references;\n } else {\n shaka.log.error('Invalid box type, expected \"sidx\".');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MP4_SIDX_WRONG_BOX_TYPE);\n }\n};\n\n\n/**\n * Parse a SIDX box from the given reader.\n *\n * @param {number} sidxOffset\n * @param {number} presentationTimeOffset\n * @param {!Array.<string>} uris The possible locations of the MP4 file that\n * contains the segments.\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.media.Mp4SegmentIndexParser.parseSIDX_ = function(\n sidxOffset,\n presentationTimeOffset,\n uris,\n box) {\n\n goog.asserts.assert(\n box.version != null,\n 'SIDX is a full box and should have a valid version.');\n\n var references = [];\n\n // Parse the SIDX structure.\n // Skip reference_ID (32 bits).\n box.reader.skip(4);\n\n var timescale = box.reader.readUint32();\n\n if (timescale == 0) {\n shaka.log.error('Invalid timescale.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MP4_SIDX_INVALID_TIMESCALE);\n }\n\n var earliestPresentationTime;\n var firstOffset;\n\n if (box.version == 0) {\n earliestPresentationTime = box.reader.readUint32();\n firstOffset = box.reader.readUint32();\n } else {\n earliestPresentationTime = box.reader.readUint64();\n firstOffset = box.reader.readUint64();\n }\n\n // Skip reserved (16 bits).\n box.reader.skip(2);\n\n // Add references.\n var referenceCount = box.reader.readUint16();\n\n // Substract the presentationTimeOffset\n var unscaledStartTime = earliestPresentationTime - presentationTimeOffset;\n var startByte = sidxOffset + box.size + firstOffset;\n\n for (var i = 0; i < referenceCount; i++) {\n // |chunk| is 1 bit for |referenceType|, and 31 bits for |referenceSize|.\n var chunk = box.reader.readUint32();\n var referenceType = (chunk & 0x80000000) >>> 31;\n var referenceSize = chunk & 0x7FFFFFFF;\n\n var subsegmentDuration = box.reader.readUint32();\n\n // Skipping 1 bit for |startsWithSap|, 3 bits for |sapType|, and 28 bits\n // for |sapDelta|.\n box.reader.skip(4);\n\n // If |referenceType| is 1 then the reference is to another SIDX.\n // We do not support this.\n if (referenceType == 1) {\n shaka.log.error('Heirarchical SIDXs are not supported.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MP4_SIDX_TYPE_NOT_SUPPORTED);\n }\n\n references.push(\n new shaka.media.SegmentReference(\n references.length,\n unscaledStartTime / timescale,\n (unscaledStartTime + subsegmentDuration) / timescale,\n function() { return uris; },\n startByte,\n startByte + referenceSize - 1));\n\n unscaledStartTime += subsegmentDuration;\n startByte += referenceSize;\n }\n\n return references;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/mp4_segment_index_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.SegmentIndex');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n\n/**\n * Creates a SegmentIndex.\n *\n * @param {!Array.<!shaka.media.SegmentReference>} references The list of\n * SegmentReferences, which must be sorted first by their start times\n * (ascending) and second by their end times (ascending), and have\n * continuous, increasing positions.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n * @export\n */\nshaka.media.SegmentIndex = function(references) {\n if (!COMPILED) {\n shaka.media.SegmentIndex.assertCorrectReferences_(references);\n }\n\n /** @private {Array.<!shaka.media.SegmentReference>} */\n this.references_ = references;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.media.SegmentIndex.prototype.destroy = function() {\n this.references_ = null;\n return Promise.resolve();\n};\n\n\n/**\n * Finds the position of the segment for the given time, in seconds, relative\n * to the start of a particular Period. Returns the position of the segment\n * with the largest end time if more than one segment is known for the given\n * time.\n *\n * @param {number} time\n * @return {?number} The position of the segment, or null\n * if the position of the segment could not be determined.\n * @export\n */\nshaka.media.SegmentIndex.prototype.find = function(time) {\n // For live streams, searching from the end is faster. For VOD, it balances\n // out either way. In both cases, references_.length is small enough that the\n // difference isn't huge.\n for (var i = this.references_.length - 1; i >= 0; --i) {\n var r = this.references_[i];\n // Note that a segment ends immediately before the end time.\n if ((time >= r.startTime) && (time < r.endTime)) {\n return r.position;\n }\n }\n if (this.references_.length && time < this.references_[0].startTime)\n return this.references_[0].position;\n\n return null;\n};\n\n\n/**\n * Gets the SegmentReference for the segment at the given position.\n *\n * @param {number} position The position of the segment.\n * @return {shaka.media.SegmentReference} The SegmentReference, or null if\n * no such SegmentReference exists.\n * @export\n */\nshaka.media.SegmentIndex.prototype.get = function(position) {\n if (this.references_.length == 0)\n return null;\n\n var index = position - this.references_[0].position;\n if (index < 0 || index >= this.references_.length)\n return null;\n\n return this.references_[index];\n};\n\n\n/**\n * Merges the given SegmentReferences. Supports extending the original\n * references only. Will not replace old references or interleave new ones.\n *\n * @param {!Array.<!shaka.media.SegmentReference>} references The list of\n * SegmentReferences, which must be sorted first by their start times\n * (ascending) and second by their end times (ascending), and have\n * continuous, increasing positions.\n * @export\n */\nshaka.media.SegmentIndex.prototype.merge = function(references) {\n if (!COMPILED) {\n shaka.media.SegmentIndex.assertCorrectReferences_(references);\n }\n\n var newReferences = [];\n var i = 0;\n var j = 0;\n\n while ((i < this.references_.length) && (j < references.length)) {\n var r1 = this.references_[i];\n var r2 = references[j];\n\n if (r1.startTime < r2.startTime) {\n newReferences.push(r1);\n i++;\n } else if (r1.startTime > r2.startTime) {\n // Drop the new reference if it would have to be interleaved with the\n // old one. Issue a warning, since this is not a supported update.\n shaka.log.warning('Refusing to rewrite original references on update!');\n j++;\n } else {\n // When period is changed, fitSegmentReference will expand the last\n // segment to the start of the next period. So, it is valid to have end\n // time updated to the last segment reference in a period\n if (Math.abs(r1.endTime - r2.endTime) > 0.1) {\n goog.asserts.assert(r2.endTime > r1.endTime &&\n i == this.references_.length - 1 &&\n j == references.length - 1,\n 'This should be an update of the last segment in a period');\n newReferences.push(r2);\n } else {\n // Drop the new reference if there's an old reference with the\n // same time.\n newReferences.push(r1);\n }\n i++;\n j++;\n }\n }\n\n while (i < this.references_.length) {\n newReferences.push(this.references_[i++]);\n }\n\n if (newReferences.length) {\n // The rest of these refs may need to be renumbered.\n var nextPosition = newReferences[newReferences.length - 1].position + 1;\n while (j < references.length) {\n var r = references[j++];\n var r2 = new shaka.media.SegmentReference(nextPosition++,\n r.startTime, r.endTime, r.getUris, r.startByte, r.endByte);\n newReferences.push(r2);\n }\n } else {\n newReferences = references;\n }\n\n if (!COMPILED) {\n shaka.media.SegmentIndex.assertCorrectReferences_(newReferences);\n }\n\n this.references_ = newReferences;\n};\n\n\n/**\n * Removes all SegmentReferences that end before the given time.\n *\n * @param {number} time The time in seconds.\n * @export\n */\nshaka.media.SegmentIndex.prototype.evict = function(time) {\n for (var i = 0; i < this.references_.length; ++i) {\n if (this.references_[i].endTime > time)\n break;\n }\n this.references_.splice(0, i);\n};\n\n\n/**\n * Expands the first SegmentReference so it begins at the start of its Period\n * if it already begins close to the start of its Period, and expands or\n * contracts the last SegmentReference so it ends at the end of its Period for\n * VOD presentations.\n *\n * @param {?number} periodDuration\n */\nshaka.media.SegmentIndex.prototype.fit = function(periodDuration) {\n if (this.references_.length == 0)\n return;\n\n /** @const {number} */\n var tolerance = shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS;\n\n goog.asserts.assert(periodDuration != null,\n 'Period duration must be known for static content!');\n goog.asserts.assert(periodDuration != Infinity,\n 'Period duration must be finite for static content!');\n\n var lastReference = this.references_[this.references_.length - 1];\n\n // Sanity check.\n goog.asserts.assert(\n lastReference.startTime < periodDuration,\n 'lastReference cannot begin after the end of the Period');\n if (lastReference.startTime > periodDuration) return;\n\n // Log warning if necessary.\n if (lastReference.endTime <= periodDuration - tolerance) {\n shaka.log.warning(\n 'The last segment should not end before the end of the Period.',\n lastReference);\n } else if (lastReference.endTime >= periodDuration + tolerance) {\n shaka.log.warning(\n 'The last segment should not end after the end of the Period.',\n lastReference);\n }\n\n // Adjust the last SegmentReference.\n this.references_[this.references_.length - 1] =\n new shaka.media.SegmentReference(\n lastReference.position,\n lastReference.startTime, periodDuration,\n lastReference.getUris,\n lastReference.startByte, lastReference.endByte);\n};\n\n\nif (!COMPILED) {\n /**\n * Asserts that the given SegmentReferences are sorted and have continuous,\n * increasing positions.\n *\n * @param {!Array.<shaka.media.SegmentReference>} references\n * @private\n */\n shaka.media.SegmentIndex.assertCorrectReferences_ = function(references) {\n goog.asserts.assert(references.every(function(r2, i) {\n if (i == 0) return true;\n var r1 = references[i - 1];\n if (r2.position != r1.position + 1) return false;\n if (r1.startTime < r2.startTime) {\n return true;\n } else if (r1.startTime > r2.startTime) {\n return false;\n } else {\n if (r1.endTime <= r2.endTime) {\n return true;\n } else {\n return false;\n }\n }\n }), 'SegmentReferences are incorrect');\n };\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/segment_index.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.EbmlElement');\ngoog.provide('shaka.util.EbmlParser');\n\ngoog.require('shaka.util.DataViewReader');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n\n/**\n * Creates an Extensible Binary Markup Language (EBML) parser.\n * @param {!DataView} dataView The EBML data.\n * @constructor\n * @struct\n */\nshaka.util.EbmlParser = function(dataView) {\n /** @private {!DataView} */\n this.dataView_ = dataView;\n\n /** @private {!shaka.util.DataViewReader} */\n this.reader_ = new shaka.util.DataViewReader(\n dataView,\n shaka.util.DataViewReader.Endianness.BIG_ENDIAN);\n\n // If not already constructed, build a list of EBML dynamic size constants.\n // This is not done at load-time to avoid exceptions on unsupported browsers.\n if (!shaka.util.EbmlParser.DYNAMIC_SIZES) {\n shaka.util.EbmlParser.DYNAMIC_SIZES = [\n new Uint8Array([0xff]),\n new Uint8Array([0x7f, 0xff]),\n new Uint8Array([0x3f, 0xff, 0xff]),\n new Uint8Array([0x1f, 0xff, 0xff, 0xff]),\n new Uint8Array([0x0f, 0xff, 0xff, 0xff, 0xff]),\n new Uint8Array([0x07, 0xff, 0xff, 0xff, 0xff, 0xff]),\n new Uint8Array([0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]),\n new Uint8Array([0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])\n ];\n }\n};\n\n\n/** @const {!Array.<!Uint8Array>} */\nshaka.util.EbmlParser.DYNAMIC_SIZES;\n\n\n/**\n * @return {boolean} True if the parser has more data, false otherwise.\n */\nshaka.util.EbmlParser.prototype.hasMoreData = function() {\n return this.reader_.hasMoreData();\n};\n\n\n/**\n * Parses an EBML element from the parser's current position, and advances\n * the parser.\n * @return {!shaka.util.EbmlElement} The EBML element.\n * @throws {shaka.util.Error}\n * @see http://matroska.org/technical/specs/rfc/index.html\n */\nshaka.util.EbmlParser.prototype.parseElement = function() {\n var id = this.parseId_();\n\n // Parse the element's size.\n var vint = this.parseVint_();\n var size;\n if (shaka.util.EbmlParser.isDynamicSizeValue_(vint)) {\n // If this has an unknown size, assume that it takes up the rest of the\n // data.\n size = this.dataView_.byteLength - this.reader_.getPosition();\n } else {\n size = shaka.util.EbmlParser.getVintValue_(vint);\n }\n\n // Note that if the element's size is larger than the buffer then we are\n // parsing a \"partial element\". This may occur if for example we are\n // parsing the beginning of some WebM container data, but our buffer does\n // not contain the entire WebM container data.\n var elementSize =\n this.reader_.getPosition() + size <= this.dataView_.byteLength ?\n size :\n this.dataView_.byteLength - this.reader_.getPosition();\n\n var dataView = new DataView(\n this.dataView_.buffer,\n this.dataView_.byteOffset + this.reader_.getPosition(), elementSize);\n\n this.reader_.skip(elementSize);\n\n return new shaka.util.EbmlElement(id, dataView);\n};\n\n\n/**\n * Parses an EBML ID from the parser's current position, and advances the\n * parser.\n * @throws {shaka.util.Error}\n * @return {number} The EBML ID.\n * @private\n */\nshaka.util.EbmlParser.prototype.parseId_ = function() {\n var vint = this.parseVint_();\n\n if (vint.length > 7) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_OVERFLOW);\n }\n\n var id = 0;\n for (var i = 0; i < vint.length; i++) {\n // Note that we cannot use << since |value| may exceed 32 bits.\n id = (256 * id) + vint[i];\n }\n\n return id;\n};\n\n\n/**\n * Parses a variable sized integer from the parser's current position, and\n * advances the parser.\n * For example:\n * 1 byte wide: 1xxx xxxx\n * 2 bytes wide: 01xx xxxx xxxx xxxx\n * 3 bytes wide: 001x xxxx xxxx xxxx xxxx xxxx\n * @throws {shaka.util.Error}\n * @return {!Uint8Array} The variable sized integer.\n * @private\n */\nshaka.util.EbmlParser.prototype.parseVint_ = function() {\n var firstByte = this.reader_.readUint8();\n var numBytes;\n\n // Determine the byte width of the variable sized integer.\n for (numBytes = 1; numBytes <= 8; numBytes++) {\n var mask = 0x1 << (8 - numBytes);\n if (firstByte & mask) {\n break;\n }\n }\n\n if (numBytes > 8) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_OVERFLOW);\n }\n\n var vint = new Uint8Array(numBytes);\n vint[0] = firstByte;\n\n // Include the remaining bytes.\n for (var i = 1; i < numBytes; i++) {\n vint[i] = this.reader_.readUint8();\n }\n\n return vint;\n};\n\n\n/**\n * Gets the value of a variable sized integer.\n * For example, the x's below are part of the vint's value.\n * 7-bit value: 1xxx xxxx\n * 14-bit value: 01xx xxxx xxxx xxxx\n * 21-bit value: 001x xxxx xxxx xxxx xxxx xxxx\n * @param {!Uint8Array} vint The variable sized integer.\n * @throws {shaka.util.Error}\n * @return {number} The value of the variable sized integer.\n * @private\n */\nshaka.util.EbmlParser.getVintValue_ = function(vint) {\n // If |vint| is 8 bytes wide then we must ensure that it does not have more\n // than 53 meaningful bits. For example, assume |vint| is 8 bytes wide,\n // so it has the following structure,\n // 0000 0001 | xxxx xxxx ...\n // Thus, the first 3 bits following the first byte of |vint| must be 0.\n if ((vint.length == 8) && (vint[1] & 0xe0)) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.JS_INTEGER_OVERFLOW);\n }\n\n // Mask out the first few bits of |vint|'s first byte to get the most\n // significant bits of |vint|'s value. If |vint| is 8 bytes wide then |value|\n // will be set to 0.\n var mask = 0x1 << (8 - vint.length);\n var value = vint[0] & (mask - 1);\n\n // Add the remaining bytes.\n for (var i = 1; i < vint.length; i++) {\n // Note that we cannot use << since |value| may exceed 32 bits.\n value = (256 * value) + vint[i];\n }\n\n return value;\n};\n\n\n/**\n * Checks if the given variable sized integer represents a dynamic size value.\n * @param {!Uint8Array} vint The variable sized integer.\n * @return {boolean} true if |vint| represents a dynamic size value,\n * false otherwise.\n * @private\n */\nshaka.util.EbmlParser.isDynamicSizeValue_ = function(vint) {\n var EbmlParser = shaka.util.EbmlParser;\n var uint8ArrayEqual = shaka.util.Uint8ArrayUtils.equal;\n\n for (var i = 0; i < EbmlParser.DYNAMIC_SIZES.length; i++) {\n if (uint8ArrayEqual(vint, EbmlParser.DYNAMIC_SIZES[i])) {\n return true;\n }\n }\n\n return false;\n};\n\n\n\n/**\n * Creates an EbmlElement.\n * @param {number} id The ID.\n * @param {!DataView} dataView The DataView.\n * @constructor\n */\nshaka.util.EbmlElement = function(id, dataView) {\n /** @type {number} */\n this.id = id;\n\n /** @private {!DataView} */\n this.dataView_ = dataView;\n};\n\n\n/**\n * Gets the element's offset from the beginning of the buffer.\n * @return {number}\n */\nshaka.util.EbmlElement.prototype.getOffset = function() {\n return this.dataView_.byteOffset;\n};\n\n\n/**\n * Interpret the element's data as a list of sub-elements.\n * @throws {shaka.util.Error}\n * @return {!shaka.util.EbmlParser} A parser over the sub-elements.\n */\nshaka.util.EbmlElement.prototype.createParser = function() {\n return new shaka.util.EbmlParser(this.dataView_);\n};\n\n\n/**\n * Interpret the element's data as an unsigned integer.\n * @throws {shaka.util.Error}\n * @return {number}\n */\nshaka.util.EbmlElement.prototype.getUint = function() {\n if (this.dataView_.byteLength > 8) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_OVERFLOW);\n }\n\n // Ensure we have at most 53 meaningful bits.\n if ((this.dataView_.byteLength == 8) && (this.dataView_.getUint8(0) & 0xe0)) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.JS_INTEGER_OVERFLOW);\n }\n\n var value = 0;\n\n for (var i = 0; i < this.dataView_.byteLength; i++) {\n var chunk = this.dataView_.getUint8(i);\n value = (256 * value) + chunk;\n }\n\n return value;\n};\n\n\n/**\n * Interpret the element's data as a floating point number (32 bits or 64 bits).\n * 80-bit floating point numbers are not supported.\n * @throws {shaka.util.Error}\n * @return {number}\n */\nshaka.util.EbmlElement.prototype.getFloat = function() {\n if (this.dataView_.byteLength == 4) {\n return this.dataView_.getFloat32(0);\n } else if (this.dataView_.byteLength == 8) {\n return this.dataView_.getFloat64(0);\n } else {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_BAD_FLOATING_POINT_SIZE);\n }\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/ebml_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.WebmSegmentIndexParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.EbmlElement');\ngoog.require('shaka.util.EbmlParser');\ngoog.require('shaka.util.Error');\n\n\n\n/**\n * Creates a WebM Cues element parser.\n *\n * @constructor\n * @struct\n */\nshaka.media.WebmSegmentIndexParser = function() {};\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.EBML_ID = 0x1a45dfa3;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.SEGMENT_ID = 0x18538067;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.INFO_ID = 0x1549a966;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.TIMECODE_SCALE_ID = 0x2ad7b1;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.DURATION_ID = 0x4489;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUES_ID = 0x1c53bb6b;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_POINT_ID = 0xbb;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_TIME_ID = 0xb3;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_TRACK_POSITIONS_ID = 0xb7;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_CLUSTER_POSITION = 0xf1;\n\n\n/**\n * Parses SegmentReferences from a WebM container.\n * @param {!ArrayBuffer} cuesData The WebM container's \"Cueing Data\" section.\n * @param {!ArrayBuffer} initData The WebM container's headers.\n * @param {!Array.<string>} uris The possible locations of the WebM file that\n * contains the segments.\n * @param {number} presentationTimeOffset\n\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @throws {shaka.util.Error}\n * @see http://www.matroska.org/technical/specs/index.html\n * @see http://www.webmproject.org/docs/container/\n */\nshaka.media.WebmSegmentIndexParser.prototype.parse = function(\n cuesData, initData, uris, presentationTimeOffset) {\n var tuple = this.parseWebmContainer_(initData);\n var parser = new shaka.util.EbmlParser(new DataView(cuesData));\n var cuesElement = parser.parseElement();\n if (cuesElement.id != shaka.media.WebmSegmentIndexParser.CUES_ID) {\n shaka.log.error('Not a Cues element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_CUES_ELEMENT_MISSING);\n }\n\n return this.parseCues_(\n cuesElement, tuple.segmentOffset, tuple.timecodeScale, tuple.duration,\n uris, presentationTimeOffset);\n};\n\n\n/**\n * Parses a WebM container to get the segment's offset, timecode scale, and\n * duration.\n *\n * @param {!ArrayBuffer} initData\n * @return {{segmentOffset: number, timecodeScale: number, duration: number}}\n * The segment's offset in bytes, the segment's timecode scale in seconds,\n * and the duration in seconds.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseWebmContainer_ = function(\n initData) {\n var parser = new shaka.util.EbmlParser(new DataView(initData));\n\n // Check that the WebM container data starts with the EBML header, but\n // skip its contents.\n var ebmlElement = parser.parseElement();\n if (ebmlElement.id != shaka.media.WebmSegmentIndexParser.EBML_ID) {\n shaka.log.error('Not an EBML element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_EBML_HEADER_ELEMENT_MISSING);\n }\n\n var segmentElement = parser.parseElement();\n if (segmentElement.id != shaka.media.WebmSegmentIndexParser.SEGMENT_ID) {\n shaka.log.error('Not a Segment element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_SEGMENT_ELEMENT_MISSING);\n }\n\n // This value is used as the initial offset to the first referenced segment.\n var segmentOffset = segmentElement.getOffset();\n\n // Parse the Segment element to get the segment info.\n var segmentInfo = this.parseSegment_(segmentElement);\n return {\n segmentOffset: segmentOffset,\n timecodeScale: segmentInfo.timecodeScale,\n duration: segmentInfo.duration\n };\n};\n\n\n/**\n * Parses a WebM Info element to get the segment's timecode scale and duration.\n * @param {!shaka.util.EbmlElement} segmentElement\n * @return {{timecodeScale: number, duration: number}} The segment's timecode\n * scale in seconds and duration in seconds.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseSegment_ = function(\n segmentElement) {\n var parser = segmentElement.createParser();\n\n // Find the Info element.\n var infoElement = null;\n while (parser.hasMoreData()) {\n var elem = parser.parseElement();\n if (elem.id != shaka.media.WebmSegmentIndexParser.INFO_ID) {\n continue;\n }\n\n infoElement = elem;\n\n break;\n }\n\n if (!infoElement) {\n shaka.log.error('Not an Info element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_INFO_ELEMENT_MISSING);\n }\n\n return this.parseInfo_(infoElement);\n};\n\n\n/**\n * Parses a WebM Info element to get the segment's timecode scale and duration.\n * @param {!shaka.util.EbmlElement} infoElement\n * @return {{timecodeScale: number, duration: number}} The segment's timecode\n * scale in seconds and duration in seconds.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseInfo_ = function(\n infoElement) {\n var parser = infoElement.createParser();\n\n // The timecode scale factor in units of [nanoseconds / T], where [T] are the\n // units used to express all other time values in the WebM container. By\n // default it's assumed that [T] == [milliseconds].\n var timecodeScaleNanoseconds = 1000000;\n /** @type {?number} */\n var durationScale = null;\n\n while (parser.hasMoreData()) {\n var elem = parser.parseElement();\n if (elem.id == shaka.media.WebmSegmentIndexParser.TIMECODE_SCALE_ID) {\n timecodeScaleNanoseconds = elem.getUint();\n } else if (elem.id == shaka.media.WebmSegmentIndexParser.DURATION_ID) {\n durationScale = elem.getFloat();\n }\n }\n if (durationScale == null) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_DURATION_ELEMENT_MISSING);\n }\n\n // The timecode scale factor in units of [seconds / T].\n var timecodeScale = timecodeScaleNanoseconds / 1000000000;\n // The duration is stored in units of [T]\n var durationSeconds = durationScale * timecodeScale;\n\n return {timecodeScale: timecodeScale, duration: durationSeconds};\n};\n\n\n/**\n * Parses a WebM CuesElement.\n * @param {!shaka.util.EbmlElement} cuesElement\n * @param {number} segmentOffset\n * @param {number} timecodeScale\n * @param {number} duration\n * @param {!Array.<string>} uris\n * @param {number} presentationTimeOffset\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseCues_ = function(\n cuesElement, segmentOffset, timecodeScale, duration, uris,\n presentationTimeOffset) {\n var references = [];\n var getUris = function() { return uris; };\n\n var parser = cuesElement.createParser();\n\n var lastTime = -1;\n var lastOffset = -1;\n\n while (parser.hasMoreData()) {\n var elem = parser.parseElement();\n if (elem.id != shaka.media.WebmSegmentIndexParser.CUE_POINT_ID) {\n continue;\n }\n\n var tuple = this.parseCuePoint_(elem);\n if (!tuple) {\n continue;\n }\n\n // Substract presentationTimeOffset from unscalled time\n var currentTime = timecodeScale *\n (tuple.unscaledTime - presentationTimeOffset);\n var currentOffset = segmentOffset + tuple.relativeOffset;\n\n if (lastTime >= 0) {\n goog.asserts.assert(lastOffset >= 0, 'last offset cannot be 0');\n\n references.push(\n new shaka.media.SegmentReference(\n references.length,\n lastTime, currentTime,\n getUris,\n lastOffset, currentOffset - 1));\n }\n\n lastTime = currentTime;\n lastOffset = currentOffset;\n }\n\n if (lastTime >= 0) {\n goog.asserts.assert(lastOffset >= 0, 'last offset cannot be 0');\n\n references.push(\n new shaka.media.SegmentReference(\n references.length, lastTime, duration, getUris, lastOffset, null));\n }\n\n return references;\n};\n\n\n/**\n * Parses a WebM CuePointElement to get an \"unadjusted\" segment reference.\n * @param {shaka.util.EbmlElement} cuePointElement\n * @return {{unscaledTime: number, relativeOffset: number}} The referenced\n * segment's start time in units of [T] (see parseInfo_()), and the\n * referenced segment's offset in bytes, relative to a WebM Segment\n * element.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseCuePoint_ = function(\n cuePointElement) {\n var parser = cuePointElement.createParser();\n\n // Parse CueTime element.\n var cueTimeElement = parser.parseElement();\n if (cueTimeElement.id != shaka.media.WebmSegmentIndexParser.CUE_TIME_ID) {\n shaka.log.warning('Not a CueTime element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_CUE_TIME_ELEMENT_MISSING);\n }\n var unscaledTime = cueTimeElement.getUint();\n\n // Parse CueTrackPositions element.\n var cueTrackPositionsElement = parser.parseElement();\n if (cueTrackPositionsElement.id !=\n shaka.media.WebmSegmentIndexParser.CUE_TRACK_POSITIONS_ID) {\n shaka.log.warning('Not a CueTrackPositions element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING);\n }\n\n var cueTrackParser = cueTrackPositionsElement.createParser();\n var relativeOffset = 0;\n\n while (cueTrackParser.hasMoreData()) {\n var elem = cueTrackParser.parseElement();\n if (elem.id != shaka.media.WebmSegmentIndexParser.CUE_CLUSTER_POSITION) {\n continue;\n }\n\n relativeOffset = elem.getUint();\n break;\n }\n\n return { unscaledTime: unscaledTime, relativeOffset: relativeOffset };\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/webm_segment_index_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.SegmentBase');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.MpdUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.Mp4SegmentIndexParser');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.WebmSegmentIndexParser');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.SegmentBase\n * @summary A set of functions for parsing SegmentBase elements.\n */\n\n\n/**\n * Creates an init segment reference from a Context object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * @return {shaka.media.InitSegmentReference}\n */\nshaka.dash.SegmentBase.createInitSegment = function(context, callback) {\n var MpdUtils = shaka.dash.MpdUtils;\n var XmlUtils = shaka.util.XmlUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var initialization =\n MpdUtils.inheritChild(context, callback, 'Initialization');\n if (!initialization)\n return null;\n\n var resolvedUris = context.representation.baseUris;\n var uri = initialization.getAttribute('sourceURL');\n if (uri) {\n resolvedUris =\n ManifestParserUtils.resolveUris(context.representation.baseUris, [uri]);\n }\n\n var startByte = 0;\n var endByte = null;\n var range = XmlUtils.parseAttr(initialization, 'range', XmlUtils.parseRange);\n if (range) {\n startByte = range.start;\n endByte = range.end;\n }\n\n var getUris = function() { return resolvedUris; };\n return new shaka.media.InitSegmentReference(getUris, startByte, endByte);\n};\n\n\n/**\n * Creates a new Stream object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @throws shaka.util.Error When there is a parsing error.\n * @return {shaka.dash.DashParser.StreamInfo}\n */\nshaka.dash.SegmentBase.createStream = function(context, requestInitSegment) {\n goog.asserts.assert(context.representation.segmentBase,\n 'Should only be called with SegmentBase');\n // Since SegmentBase does not need updates, simply treat any call as\n // the initial parse.\n var MpdUtils = shaka.dash.MpdUtils;\n var SegmentBase = shaka.dash.SegmentBase;\n\n var presentationTimeOffset = MpdUtils.inheritAttribute(\n context, SegmentBase.fromInheritance_, 'presentationTimeOffset');\n\n var init =\n SegmentBase.createInitSegment(context, SegmentBase.fromInheritance_);\n var index = SegmentBase.createSegmentIndex_(\n context, requestInitSegment, init, Number(presentationTimeOffset));\n\n return {\n createSegmentIndex: index.createSegmentIndex,\n findSegmentPosition: index.findSegmentPosition,\n getSegmentReference: index.getSegmentReference,\n initSegmentReference: init,\n presentationTimeOffset: Number(presentationTimeOffset) || 0\n };\n};\n\n\n/**\n * Creates segment index info for the given info.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {shaka.media.InitSegmentReference} init\n * @param {!Array.<string>} uris\n * @param {number} startByte\n * @param {?number} endByte\n * @param {string} containerType\n * @param {number} presentationTimeOffset\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n */\nshaka.dash.SegmentBase.createSegmentIndexFromUris = function(\n context, requestInitSegment, init, uris,\n startByte, endByte, containerType, presentationTimeOffset) {\n var presentationTimeline = context.presentationTimeline;\n var fitLast = !context.dynamic || !context.periodInfo.isLastPeriod;\n var periodStartTime = context.periodInfo.start;\n var periodDuration = context.periodInfo.duration;\n\n // Create a local variable to bind to so we can set to null to help the GC.\n var localRequest = requestInitSegment;\n var segmentIndex = null;\n var create = function() {\n var async = [\n localRequest(uris, startByte, endByte),\n containerType == 'webm' ?\n localRequest(init.getUris(), init.startByte, init.endByte) :\n null\n ];\n\n localRequest = null;\n return Promise.all(async).then(function(results) {\n var indexData = results[0];\n var initData = results[1] || null;\n var references = null;\n\n if (containerType == 'mp4') {\n references = shaka.media.Mp4SegmentIndexParser(\n indexData, startByte, uris, presentationTimeOffset);\n } else {\n goog.asserts.assert(initData, 'WebM requires init data');\n var parser = new shaka.media.WebmSegmentIndexParser();\n references = parser.parse(indexData, initData, uris,\n presentationTimeOffset);\n }\n\n presentationTimeline.notifySegments(periodStartTime, references);\n\n // Since containers are never updated, we don't need to store the\n // segmentIndex in the map.\n goog.asserts.assert(!segmentIndex,\n 'Should not call createSegmentIndex twice');\n\n segmentIndex = new shaka.media.SegmentIndex(references);\n if (fitLast)\n segmentIndex.fit(periodDuration);\n });\n };\n var get = function(i) {\n goog.asserts.assert(segmentIndex, 'Must call createSegmentIndex first');\n return segmentIndex.get(i);\n };\n var find = function(t) {\n goog.asserts.assert(segmentIndex, 'Must call createSegmentIndex first');\n return segmentIndex.find(t);\n };\n\n return {\n createSegmentIndex: create,\n findSegmentPosition: find,\n getSegmentReference: get\n };\n};\n\n\n/**\n * @param {?shaka.dash.DashParser.InheritanceFrame} frame\n * @return {Element}\n * @private\n */\nshaka.dash.SegmentBase.fromInheritance_ = function(frame) {\n return frame.segmentBase;\n};\n\n\n/**\n * Creates segment index info from a Context object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {shaka.media.InitSegmentReference} init\n * @param {number} presentationTimeOffset\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.SegmentBase.createSegmentIndex_ = function(\n context, requestInitSegment, init, presentationTimeOffset) {\n var MpdUtils = shaka.dash.MpdUtils;\n var SegmentBase = shaka.dash.SegmentBase;\n var XmlUtils = shaka.util.XmlUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var contentType = context.representation.contentType;\n var containerType = context.representation.mimeType.split('/')[1];\n if (contentType != ContentType.TEXT && containerType != 'mp4' &&\n containerType != 'webm') {\n shaka.log.error(\n 'SegmentBase specifies an unsupported container type.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_UNSUPPORTED_CONTAINER);\n }\n\n if ((containerType == 'webm') && !init) {\n shaka.log.error(\n 'SegmentBase does not contain sufficient segment information:',\n 'the SegmentBase uses a WebM container,',\n 'but does not contain an Initialization element.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_WEBM_MISSING_INIT);\n }\n\n var representationIndex = MpdUtils.inheritChild(\n context, SegmentBase.fromInheritance_, 'RepresentationIndex');\n var indexRangeElem = MpdUtils.inheritAttribute(\n context, SegmentBase.fromInheritance_, 'indexRange');\n\n var indexUris = context.representation.baseUris;\n var indexRange = XmlUtils.parseRange(indexRangeElem || '');\n if (representationIndex) {\n var representationUri = representationIndex.getAttribute('sourceURL');\n if (representationUri) {\n indexUris = ManifestParserUtils.resolveUris(\n context.representation.baseUris, [representationUri]);\n }\n\n indexRange = XmlUtils.parseAttr(\n representationIndex, 'range', XmlUtils.parseRange, indexRange);\n }\n\n if (!indexRange) {\n shaka.log.error(\n 'SegmentBase does not contain sufficient segment information:',\n 'the SegmentBase does not contain @indexRange',\n 'or a RepresentationIndex element.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n\n return shaka.dash.SegmentBase.createSegmentIndexFromUris(\n context, requestInitSegment, init, indexUris, indexRange.start,\n indexRange.end, containerType, presentationTimeOffset);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/segment_base.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.SegmentList');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.MpdUtils');\ngoog.require('shaka.dash.SegmentBase');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.SegmentList\n * @summary A set of functions for parsing SegmentList elements.\n */\n\n\n/**\n * Creates a new Stream object or updates the Stream in the manifest.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Object.<string, !shaka.media.SegmentIndex>} segmentIndexMap\n * @return {shaka.dash.DashParser.StreamInfo}\n */\nshaka.dash.SegmentList.createStream = function(context, segmentIndexMap) {\n goog.asserts.assert(context.representation.segmentList,\n 'Should only be called with SegmentList');\n var SegmentList = shaka.dash.SegmentList;\n\n var init = shaka.dash.SegmentBase.createInitSegment(\n context, SegmentList.fromInheritance_);\n var info = SegmentList.parseSegmentListInfo_(context);\n\n SegmentList.checkSegmentListInfo_(context, info);\n\n /** @type {shaka.media.SegmentIndex} */\n var segmentIndex = null;\n var id = null;\n if (context.period.id && context.representation.id) {\n // Only check/store the index if period and representation IDs are set.\n id = context.period.id + ',' + context.representation.id;\n segmentIndex = segmentIndexMap[id];\n }\n\n var references = SegmentList.createSegmentReferences_(\n context.periodInfo.duration, info.startNumber,\n context.representation.baseUris, info);\n\n if (segmentIndex) {\n segmentIndex.merge(references);\n var start = context.presentationTimeline.getSegmentAvailabilityStart();\n segmentIndex.evict(start - context.periodInfo.start);\n } else {\n context.presentationTimeline.notifySegments(\n context.periodInfo.start, references);\n segmentIndex = new shaka.media.SegmentIndex(references);\n if (id && context.dynamic)\n segmentIndexMap[id] = segmentIndex;\n }\n\n if (!context.dynamic || !context.periodInfo.isLastPeriod)\n segmentIndex.fit(context.periodInfo.duration);\n\n return {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex),\n initSegmentReference: init,\n presentationTimeOffset: info.presentationTimeOffset\n };\n};\n\n\n/**\n * @typedef {{\n * mediaUri: string,\n * start: number,\n * end: ?number\n * }}\n *\n * @property {string} mediaUri\n * The URI of the segment.\n * @property {number} start\n * The start byte of the segment.\n * @property {?number} end\n * The end byte of the segment, or null.\n */\nshaka.dash.SegmentList.MediaSegment;\n\n\n/**\n * @typedef {{\n * segmentDuration: ?number,\n * startTime: number,\n * startNumber: number,\n * presentationTimeOffset: number,\n * timeline: Array.<shaka.dash.MpdUtils.TimeRange>,\n * mediaSegments: !Array.<shaka.dash.SegmentList.MediaSegment>\n * }}\n * @private\n *\n * @description\n * Contains information about a SegmentList.\n *\n * @property {?number} segmentDuration\n * The duration of the segments, if given.\n * @property {number} startTime\n * The start time of the first segment, in seconds.\n * @property {number} startNumber\n * The start number of the segments; 1 or greater.\n * @property {number} presentationTimeOffset\n * The presentationTimeOffset of the representation, in seconds.\n * @property {Array.<shaka.dash.MpdUtils.TimeRange>} timeline\n * The timeline of the representation, if given. Times in seconds.\n * @property {!Array.<shaka.dash.SegmentList.MediaSegment>} mediaSegments\n * The URI and byte-ranges of the media segments.\n */\nshaka.dash.SegmentList.SegmentListInfo;\n\n\n/**\n * @param {?shaka.dash.DashParser.InheritanceFrame} frame\n * @return {Element}\n * @private\n */\nshaka.dash.SegmentList.fromInheritance_ = function(frame) {\n return frame.segmentList;\n};\n\n\n/**\n * Parses the SegmentList items to create an info object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {shaka.dash.SegmentList.SegmentListInfo}\n * @private\n */\nshaka.dash.SegmentList.parseSegmentListInfo_ = function(context) {\n var SegmentList = shaka.dash.SegmentList;\n var MpdUtils = shaka.dash.MpdUtils;\n\n var mediaSegments = SegmentList.parseMediaSegments_(context);\n var segmentInfo =\n MpdUtils.parseSegmentInfo(context, SegmentList.fromInheritance_);\n\n var startNumber = segmentInfo.startNumber;\n if (startNumber == 0) {\n shaka.log.warning('SegmentList@startNumber must be > 0');\n startNumber = 1;\n }\n\n var startTime = 0;\n if (segmentInfo.segmentDuration) {\n // See DASH sec. 5.3.9.5.3\n // Don't use presentationTimeOffset for @duration.\n startTime = segmentInfo.segmentDuration * (startNumber - 1);\n } else if (segmentInfo.timeline && segmentInfo.timeline.length > 0) {\n // The presentationTimeOffset was considered in timeline creation\n startTime = segmentInfo.timeline[0].start;\n }\n\n return {\n segmentDuration: segmentInfo.segmentDuration,\n startTime: startTime,\n startNumber: startNumber,\n presentationTimeOffset: segmentInfo.presentationTimeOffset,\n timeline: segmentInfo.timeline,\n mediaSegments: mediaSegments\n };\n};\n\n\n/**\n * Checks whether a SegmentListInfo object is valid.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentList.SegmentListInfo} info\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.SegmentList.checkSegmentListInfo_ = function(context, info) {\n if (!info.segmentDuration && !info.timeline &&\n info.mediaSegments.length > 1) {\n shaka.log.warning(\n 'SegmentList does not contain sufficient segment information:',\n 'the SegmentList specifies multiple segments,',\n 'but does not specify a segment duration or timeline.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n\n if (!info.segmentDuration && !context.periodInfo.duration && !info.timeline &&\n info.mediaSegments.length == 1) {\n shaka.log.warning(\n 'SegmentList does not contain sufficient segment information:',\n 'the SegmentList specifies one segment,',\n 'but does not specify a segment duration, period duration,',\n 'or timeline.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n\n if (info.timeline && info.timeline.length == 0) {\n shaka.log.warning(\n 'SegmentList does not contain sufficient segment information:',\n 'the SegmentList has an empty timeline.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n};\n\n\n/**\n * Creates an array of segment references for the given data.\n *\n * @param {?number} periodDuration in seconds.\n * @param {number} startNumber\n * @param {!Array.<string>} baseUris\n * @param {shaka.dash.SegmentList.SegmentListInfo} info\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.dash.SegmentList.createSegmentReferences_ = function(\n periodDuration, startNumber, baseUris, info) {\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var max = info.mediaSegments.length;\n if (info.timeline && info.timeline.length != info.mediaSegments.length) {\n max = Math.min(info.timeline.length, info.mediaSegments.length);\n shaka.log.warning(\n 'The number of items in the segment timeline and the number of segment',\n 'URLs do not match, truncating', info.mediaSegments.length, 'to', max);\n }\n\n /** @type {!Array.<!shaka.media.SegmentReference>} */\n var references = [];\n var prevEndTime = info.startTime;\n for (var i = 0; i < max; i++) {\n var segment = info.mediaSegments[i];\n var mediaUri = ManifestParserUtils.resolveUris(\n baseUris, [segment.mediaUri]);\n\n var startTime = prevEndTime;\n var endTime;\n\n if (info.segmentDuration != null) {\n endTime = startTime + info.segmentDuration;\n } else if (info.timeline) {\n // Ignore the timepoint start since they are continuous.\n endTime = info.timeline[i].end;\n } else {\n // If segmentDuration and timeline are null then there must\n // only be one segment.\n goog.asserts.assert(\n info.mediaSegments.length == 1 && periodDuration,\n 'There should only be one segment with a Period duration.');\n endTime = startTime + periodDuration;\n }\n\n var getUris = (function(uris) { return uris; }.bind(null, mediaUri));\n references.push(\n new shaka.media.SegmentReference(\n i + startNumber, startTime, endTime, getUris, segment.start,\n segment.end));\n prevEndTime = endTime;\n }\n\n return references;\n};\n\n\n/**\n * Parses the media URIs from the context.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {!Array.<shaka.dash.SegmentList.MediaSegment>}\n * @private\n */\nshaka.dash.SegmentList.parseMediaSegments_ = function(context) {\n var Functional = shaka.util.Functional;\n /** @type {!Array.<!Element>} */\n var segmentLists = [\n context.representation.segmentList,\n context.adaptationSet.segmentList,\n context.period.segmentList\n ].filter(Functional.isNotNull);\n\n var XmlUtils = shaka.util.XmlUtils;\n // Search each SegmentList for one with at least one SegmentURL element,\n // select the first one, and convert each SegmentURL element to a tuple.\n return segmentLists\n .map(function(node) { return XmlUtils.findChildren(node, 'SegmentURL'); })\n .reduce(function(all, part) { return all.length > 0 ? all : part; })\n .map(function(urlNode) {\n if (urlNode.getAttribute('indexRange') &&\n !context.indexRangeWarningGiven) {\n context.indexRangeWarningGiven = true;\n shaka.log.warning(\n 'We do not support the SegmentURL@indexRange attribute on ' +\n 'SegmentList. We only use the SegmentList@duration attribute ' +\n 'or SegmentTimeline, which must be accurate.');\n }\n\n var uri = urlNode.getAttribute('media');\n var range = XmlUtils.parseAttr(\n urlNode, 'mediaRange', XmlUtils.parseRange, {start: 0, end: null});\n return {mediaUri: uri, start: range.start, end: range.end};\n });\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/segment_list.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.SegmentTemplate');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.MpdUtils');\ngoog.require('shaka.dash.SegmentBase');\ngoog.require('shaka.log');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n/**\n * @namespace shaka.dash.SegmentTemplate\n * @summary A set of functions for parsing SegmentTemplate elements.\n */\n\n\n/**\n * Creates a new Stream object or updates the Stream in the manifest.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {!Object.<string, !shaka.media.SegmentIndex>} segmentIndexMap\n * @param {boolean} isUpdate True if the manifest is being updated.\n * @throws shaka.util.Error When there is a parsing error.\n * @return {shaka.dash.DashParser.StreamInfo}\n */\nshaka.dash.SegmentTemplate.createStream = function(\n context, requestInitSegment, segmentIndexMap, isUpdate) {\n goog.asserts.assert(context.representation.segmentTemplate,\n 'Should only be called with SegmentTemplate');\n var SegmentTemplate = shaka.dash.SegmentTemplate;\n\n var init = SegmentTemplate.createInitSegment_(context);\n var info = SegmentTemplate.parseSegmentTemplateInfo_(context);\n\n SegmentTemplate.checkSegmentTemplateInfo_(context, info);\n\n /** @type {?shaka.dash.DashParser.SegmentIndexFunctions} */\n var segmentIndexFunctions = null;\n if (info.indexTemplate) {\n segmentIndexFunctions = SegmentTemplate.createFromIndexTemplate_(\n context, requestInitSegment, init, info);\n } else if (info.segmentDuration) {\n if (!isUpdate) {\n context.presentationTimeline.notifyMaxSegmentDuration(\n info.segmentDuration);\n }\n segmentIndexFunctions = SegmentTemplate.createFromDuration_(context, info);\n } else {\n /** @type {shaka.media.SegmentIndex} */\n var segmentIndex = null;\n var id = null;\n if (context.period.id && context.representation.id) {\n // Only check/store the index if period and representation IDs are set.\n id = context.period.id + ',' + context.representation.id;\n segmentIndex = segmentIndexMap[id];\n }\n\n var references = SegmentTemplate.createFromTimeline_(context, info);\n\n if (segmentIndex) {\n segmentIndex.merge(references);\n var start = context.presentationTimeline.getSegmentAvailabilityStart();\n segmentIndex.evict(start - context.periodInfo.start);\n } else {\n context.presentationTimeline.notifySegments(\n context.periodInfo.start, references);\n segmentIndex = new shaka.media.SegmentIndex(references);\n if (id && context.dynamic)\n segmentIndexMap[id] = segmentIndex;\n }\n\n if (!context.dynamic || !context.periodInfo.isLastPeriod)\n segmentIndex.fit(context.periodInfo.duration);\n\n segmentIndexFunctions = {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex)\n };\n }\n\n return {\n createSegmentIndex: segmentIndexFunctions.createSegmentIndex,\n findSegmentPosition: segmentIndexFunctions.findSegmentPosition,\n getSegmentReference: segmentIndexFunctions.getSegmentReference,\n initSegmentReference: init,\n presentationTimeOffset: info.presentationTimeOffset\n };\n};\n\n\n/**\n * @typedef {{\n * timescale: number,\n * segmentDuration: ?number,\n * startNumber: number,\n * presentationTimeOffset: number,\n * unscaledPresentationTimeOffset: number,\n * timeline: Array.<shaka.dash.MpdUtils.TimeRange>,\n * mediaTemplate: ?string,\n * indexTemplate: ?string\n * }}\n * @private\n *\n * @description\n * Contains information about a SegmentTemplate.\n *\n * @property {number} timescale\n * The time-scale of the representation.\n * @property {?number} segmentDuration\n * The duration of the segments in seconds, if given.\n * @property {number} startNumber\n * The start number of the segments; 1 or greater.\n * @property {number} presentationTimeOffset\n * The presentationTimeOffset of the representation, in seconds.\n * @property {number} unscaledPresentationTimeOffset\n * The presentationTimeOffset of the representation, in timescale units.\n * @property {Array.<shaka.dash.MpdUtils.TimeRange>} timeline\n * The timeline of the representation, if given. Times in seconds.\n * @property {?string} mediaTemplate\n * The media URI template, if given.\n * @property {?string} indexTemplate\n * The index URI template, if given.\n */\nshaka.dash.SegmentTemplate.SegmentTemplateInfo;\n\n\n/**\n * @param {?shaka.dash.DashParser.InheritanceFrame} frame\n * @return {Element}\n * @private\n */\nshaka.dash.SegmentTemplate.fromInheritance_ = function(frame) {\n return frame.segmentTemplate;\n};\n\n\n/**\n * Parses a SegmentTemplate element into an info object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {shaka.dash.SegmentTemplate.SegmentTemplateInfo}\n * @private\n */\nshaka.dash.SegmentTemplate.parseSegmentTemplateInfo_ = function(context) {\n var SegmentTemplate = shaka.dash.SegmentTemplate;\n var MpdUtils = shaka.dash.MpdUtils;\n var segmentInfo =\n MpdUtils.parseSegmentInfo(context, SegmentTemplate.fromInheritance_);\n\n var media = MpdUtils.inheritAttribute(\n context, SegmentTemplate.fromInheritance_, 'media');\n var index = MpdUtils.inheritAttribute(\n context, SegmentTemplate.fromInheritance_, 'index');\n\n return {\n segmentDuration: segmentInfo.segmentDuration,\n timescale: segmentInfo.timescale,\n startNumber: segmentInfo.startNumber,\n presentationTimeOffset: segmentInfo.presentationTimeOffset,\n unscaledPresentationTimeOffset: segmentInfo.unscaledPresentationTimeOffset,\n timeline: segmentInfo.timeline,\n mediaTemplate: media,\n indexTemplate: index\n };\n};\n\n\n/**\n * Verifies a SegmentTemplate info object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.SegmentTemplate.checkSegmentTemplateInfo_ = function(context, info) {\n var n = 0;\n n += info.indexTemplate ? 1 : 0;\n n += info.timeline ? 1 : 0;\n n += info.segmentDuration ? 1 : 0;\n\n if (n == 0) {\n shaka.log.error(\n 'SegmentTemplate does not contain any segment information:',\n 'the SegmentTemplate must contain either an index URL template',\n 'a SegmentTimeline, or a segment duration.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n } else if (n != 1) {\n shaka.log.warning(\n 'SegmentTemplate containes multiple segment information sources:',\n 'the SegmentTemplate should only contain an index URL template,',\n 'a SegmentTimeline or a segment duration.',\n context.representation);\n if (info.indexTemplate) {\n shaka.log.info('Using the index URL template by default.');\n info.timeline = null;\n info.segmentDuration = null;\n } else {\n goog.asserts.assert(info.timeline, 'There should be a timeline');\n shaka.log.info('Using the SegmentTimeline by default.');\n info.segmentDuration = null;\n }\n }\n\n if (!info.indexTemplate && !info.mediaTemplate) {\n shaka.log.error(\n 'SegmentTemplate does not contain sufficient segment information:',\n 'the SegmentTemplate\\'s media URL template is missing.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n};\n\n\n/**\n * Creates segment index functions from a index URL template.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {shaka.media.InitSegmentReference} init\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @throws shaka.util.Error When there is a parsing error.\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n * @private\n */\nshaka.dash.SegmentTemplate.createFromIndexTemplate_ = function(\n context, requestInitSegment, init, info) {\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n // Determine the container type.\n var containerType = context.representation.mimeType.split('/')[1];\n if ((containerType != 'mp4') && (containerType != 'webm')) {\n shaka.log.error(\n 'SegmentTemplate specifies an unsupported container type.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_UNSUPPORTED_CONTAINER);\n }\n\n if ((containerType == 'webm') && !init) {\n shaka.log.error(\n 'SegmentTemplate does not contain sufficient segment information:',\n 'the SegmentTemplate uses a WebM container,',\n 'but does not contain an initialization URL template.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_WEBM_MISSING_INIT);\n }\n\n goog.asserts.assert(info.indexTemplate, 'must be using index template');\n var filledTemplate = MpdUtils.fillUriTemplate(\n info.indexTemplate, context.representation.id,\n null, context.bandwidth || null, null);\n\n var resolvedUris = ManifestParserUtils.resolveUris(\n context.representation.baseUris, [filledTemplate]);\n\n return shaka.dash.SegmentBase.createSegmentIndexFromUris(\n context, requestInitSegment, init, resolvedUris, 0, null, containerType,\n info.presentationTimeOffset);\n};\n\n\n/**\n * Creates segment index functions from a segment duration.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n * @private\n */\nshaka.dash.SegmentTemplate.createFromDuration_ = function(context, info) {\n goog.asserts.assert(info.mediaTemplate,\n 'There should be a media template with duration');\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var periodDuration = context.periodInfo.duration;\n var segmentDuration = info.segmentDuration;\n var startNumber = info.startNumber;\n var timescale = info.timescale;\n\n var template = info.mediaTemplate;\n var bandwidth = context.bandwidth || null;\n var id = context.representation.id;\n var baseUris = context.representation.baseUris;\n\n var find = function(periodTime) {\n if (periodTime < 0)\n return null;\n else if (periodDuration && periodTime >= periodDuration)\n return null;\n\n return Math.floor(periodTime / segmentDuration);\n };\n var get = function(position) {\n var segmentStart = position * segmentDuration;\n\n // Do not construct segments references that should not exist.\n if (segmentStart < 0)\n return null;\n else if (periodDuration && segmentStart >= periodDuration)\n return null;\n\n var getUris = function() {\n var mediaUri = MpdUtils.fillUriTemplate(\n template, id, position + startNumber, bandwidth,\n segmentStart * timescale);\n return ManifestParserUtils.resolveUris(baseUris, [mediaUri]);\n };\n\n return new shaka.media.SegmentReference(\n position, segmentStart, segmentStart + segmentDuration, getUris, 0,\n null);\n };\n\n return {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: find,\n getSegmentReference: get\n };\n};\n\n\n/**\n * Creates segment references from a timeline.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.dash.SegmentTemplate.createFromTimeline_ = function(context, info) {\n goog.asserts.assert(info.mediaTemplate,\n 'There should be a media template with a timeline');\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n /** @type {!Array.<!shaka.media.SegmentReference>} */\n var references = [];\n for (var i = 0; i < info.timeline.length; i++) {\n var start = info.timeline[i].start;\n var unscaledStart = info.timeline[i].unscaledStart;\n var end = info.timeline[i].end;\n\n // Note: i = k - 1, where k indicates the k'th segment listed in the MPD.\n // (See section 5.3.9.5.3 of the DASH spec.)\n var segmentReplacement = i + info.startNumber;\n\n // Consider the presentation time offset in segment uri computation\n var timeReplacement = unscaledStart +\n info.unscaledPresentationTimeOffset;\n var createUris = (function(\n template, repId, bandwidth, baseUris, segmentId, time) {\n var mediaUri = MpdUtils.fillUriTemplate(\n template, repId, segmentId, bandwidth, time);\n return ManifestParserUtils.resolveUris(baseUris, [mediaUri])\n .map(function(g) { return g.toString(); });\n }.bind(null, info.mediaTemplate, context.representation.id,\n context.bandwidth || null, context.representation.baseUris,\n segmentReplacement, timeReplacement));\n\n references.push(new shaka.media.SegmentReference(\n segmentReplacement, start, end, createUris, 0, null));\n }\n\n return references;\n};\n\n\n/**\n * Creates an init segment reference from a context object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {shaka.media.InitSegmentReference}\n * @private\n */\nshaka.dash.SegmentTemplate.createInitSegment_ = function(context) {\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var SegmentTemplate = shaka.dash.SegmentTemplate;\n\n var initialization = MpdUtils.inheritAttribute(\n context, SegmentTemplate.fromInheritance_, 'initialization');\n if (!initialization)\n return null;\n\n var repId = context.representation.id;\n var bandwidth = context.bandwidth || null;\n var baseUris = context.representation.baseUris;\n var getUris = function() {\n goog.asserts.assert(initialization, 'Should have returned earler');\n var filledTemplate = MpdUtils.fillUriTemplate(\n initialization, repId, null, bandwidth, null);\n var resolvedUris = ManifestParserUtils.resolveUris(\n baseUris, [filledTemplate]);\n return resolvedUris;\n };\n\n return new shaka.media.InitSegmentReference(getUris, 0, null);\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/segment_template.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.ManifestParser');\n\ngoog.require('goog.Uri');\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\n\n\n/**\n * @namespace shaka.media.ManifestParser\n * @summary An interface to register manifest parsers.\n * @exportDoc\n */\n\n\n/**\n * Contains the parser factory functions indexed by MIME type.\n *\n * @type {!Object.<string, shakaExtern.ManifestParser.Factory>}\n */\nshaka.media.ManifestParser.parsersByMime = {};\n\n\n/**\n * Contains the parser factory functions indexed by file extension.\n *\n * @type {!Object.<string, shakaExtern.ManifestParser.Factory>}\n */\nshaka.media.ManifestParser.parsersByExtension = {};\n\n\n/**\n * Registers a manifest parser by file extension.\n *\n * @param {string} extension The file extension of the manifest.\n * @param {shakaExtern.ManifestParser.Factory} parserFactory The factory\n * used to create parser instances.\n * @export\n */\nshaka.media.ManifestParser.registerParserByExtension = function(\n extension, parserFactory) {\n shaka.media.ManifestParser.parsersByExtension[extension] = parserFactory;\n};\n\n\n/**\n * Registers a manifest parser by MIME type.\n *\n * @param {string} mimeType The MIME type of the manifest.\n * @param {shakaExtern.ManifestParser.Factory} parserFactory The factory\n * used to create parser instances.\n * @export\n */\nshaka.media.ManifestParser.registerParserByMime = function(\n mimeType, parserFactory) {\n shaka.media.ManifestParser.parsersByMime[mimeType] = parserFactory;\n};\n\n\n/**\n * Returns a map of manifest support for well-known types.\n *\n * @return {!Object.<string, boolean>}\n */\nshaka.media.ManifestParser.probeSupport = function() {\n // Make sure all registered parsers are shown.\n var support = {};\n for (var type in shaka.media.ManifestParser.parsersByMime) {\n support[type] = true;\n }\n for (var type in shaka.media.ManifestParser.parsersByExtension) {\n support[type] = true;\n }\n\n // Make sure all well-known types are tested as well, just to show an explicit\n // false for things people might be expecting.\n var testMimeTypes = [\n // DASH\n 'application/dash+xml',\n // HLS\n 'application/x-mpegurl',\n 'application/vnd.apple.mpegurl',\n // SmoothStreaming\n 'application/vnd.ms-sstr+xml'\n ];\n var testExtensions = [\n // DASH\n 'mpd',\n // HLS\n 'm3u8',\n // SmoothStreaming\n 'ism'\n ];\n\n testMimeTypes.forEach(function(type) {\n support[type] = !!shaka.media.ManifestParser.parsersByMime[type];\n });\n testExtensions.forEach(function(type) {\n support[type] = !!shaka.media.ManifestParser.parsersByExtension[type];\n });\n\n return support;\n};\n\n\n/**\n * Finds a manifest parser factory to parse the given manifest.\n *\n * @param {string} manifestUri\n * @param {!shaka.net.NetworkingEngine} netEngine\n * @param {shakaExtern.RetryParameters} retryParams\n * @param {shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * @return {!Promise.<shakaExtern.ManifestParser.Factory>}\n */\nshaka.media.ManifestParser.getFactory = function(\n manifestUri, netEngine, retryParams, opt_manifestParserFactory) {\n var factory = opt_manifestParserFactory;\n var extension;\n\n if (!factory) {\n // Try to choose a manifest parser by file extension.\n var uriObj = new goog.Uri(manifestUri);\n var uriPieces = uriObj.getPath().split('/');\n var uriFilename = uriPieces.pop();\n var filenamePieces = uriFilename.split('.');\n // Only one piece means there is no extension.\n if (filenamePieces.length > 1) {\n extension = filenamePieces.pop().toLowerCase();\n factory = shaka.media.ManifestParser.parsersByExtension[extension];\n }\n }\n\n if (factory)\n return Promise.resolve(factory);\n\n // Try to choose a manifest parser by MIME type.\n var headRequest =\n shaka.net.NetworkingEngine.makeRequest([manifestUri], retryParams);\n headRequest.method = 'HEAD';\n var type = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n\n return netEngine.request(type, headRequest).then(\n function(response) {\n var mimeType = response.headers['content-type'];\n // https://goo.gl/yzKDRx says this header should always be available,\n // but just to be safe:\n if (mimeType) {\n mimeType = mimeType.toLowerCase();\n }\n factory = shaka.media.ManifestParser.parsersByMime[mimeType];\n if (!factory) {\n shaka.log.error(\n 'Unable to guess manifest type by file extension ' +\n 'or by MIME type.', extension, mimeType);\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.UNABLE_TO_GUESS_MANIFEST_TYPE,\n manifestUri));\n }\n return factory;\n }, function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Incorrect error type');\n shaka.log.error('HEAD request to guess manifest type failed!', error);\n error.severity = shaka.util.Error.Severity.CRITICAL;\n return Promise.reject(error);\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/manifest_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.PresentationTimeline');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\n\n\n\n/**\n * Creates a PresentationTimeline.\n *\n * @param {?number} presentationStartTime The wall-clock time, in seconds,\n * when the presentation started or will start. Only required for live.\n * @param {number} presentationDelay The delay to give the presentation, in\n * seconds. Only required for live.\n *\n * @see {shakaExtern.Manifest}\n * @see {@tutorial architecture}\n *\n * @constructor\n * @struct\n * @export\n */\nshaka.media.PresentationTimeline = function(\n presentationStartTime, presentationDelay) {\n /** @private {?number} */\n this.presentationStartTime_ = presentationStartTime;\n\n /** @private {number} */\n this.presentationDelay_ = presentationDelay;\n\n /** @private {number} */\n this.duration_ = Infinity;\n\n /** @private {number} */\n this.segmentAvailabilityDuration_ = Infinity;\n\n /** @private {?number} */\n this.maxSegmentDuration_ = 1;\n\n /** @private {number} */\n this.clockOffset_ = 0;\n\n /** @private {boolean} */\n this.static_ = true;\n};\n\n\n/**\n * @return {number} The presentation's duration in seconds.\n * Infinity indicates that the presentation continues indefinitely.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getDuration = function() {\n return this.duration_;\n};\n\n\n/**\n * Sets the presentation's duration.\n *\n * @param {number} duration The presentation's duration in seconds.\n * Infinity indicates that the presentation continues indefinitely.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setDuration = function(duration) {\n goog.asserts.assert(duration > 0, 'duration must be > 0');\n this.duration_ = duration;\n};\n\n\n/**\n * @return {?number} The presentation's start time in seconds.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getPresentationStartTime =\n function() {\n return this.presentationStartTime_;\n};\n\n\n/**\n * Sets the clock offset, which is the the difference between the client's clock\n * and the server's clock, in milliseconds (i.e., serverTime = Date.now() +\n * clockOffset).\n *\n * @param {number} offset The clock offset, in ms.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setClockOffset = function(offset) {\n this.clockOffset_ = offset;\n};\n\n\n/**\n * Sets the presentation's static flag.\n *\n * @param {boolean} isStatic If true, the presentation is static, meaning all\n * segments are available at once.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setStatic = function(isStatic) {\n // NOTE: the argument name is not \"static\" because that's a keyword in ES6\n this.static_ = isStatic;\n};\n\n\n/**\n * Gets the presentation's segment availability duration, which is the amount\n * of time, in seconds, that the start of a segment remains available after the\n * live-edge moves past the end of that segment. Infinity indicates that\n * segments remain available indefinitely. For example, if your live\n * presentation has a 5 minute DVR window and your segments are 10 seconds long\n * then the segment availability duration should be 4 minutes and 50 seconds.\n *\n * @return {number} The presentation's segment availability duration.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSegmentAvailabilityDuration =\n function() {\n return this.segmentAvailabilityDuration_;\n};\n\n\n/**\n * Sets the presentation's segment availability duration. The segment\n * availability duration should only be set for live.\n *\n * @param {number} segmentAvailabilityDuration The presentation's new segment\n * availability duration in seconds.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setSegmentAvailabilityDuration =\n function(segmentAvailabilityDuration) {\n goog.asserts.assert(segmentAvailabilityDuration >= 0,\n 'segmentAvailabilityDuration must be >= 0');\n this.segmentAvailabilityDuration_ = segmentAvailabilityDuration;\n};\n\n\n/**\n * Gives PresentationTimeline a Stream's segments so it can size and position\n * the segment availability window, and account for missing segment\n * information. This function should be called once for each Stream (no more,\n * no less).\n *\n * @param {number} periodStartTime\n * @param {!Array.<!shaka.media.SegmentReference>} references\n * @export\n */\nshaka.media.PresentationTimeline.prototype.notifySegments = function(\n periodStartTime, references) {\n if (references.length == 0)\n return;\n\n this.maxSegmentDuration_ = references.reduce(\n function(max, r) { return Math.max(max, r.endTime - r.startTime); },\n this.maxSegmentDuration_);\n\n shaka.log.v1('notifySegments:',\n 'maxSegmentDuration=' + this.maxSegmentDuration_);\n};\n\n\n/**\n * Gives PresentationTimeline a Stream's maximum segment duration so it can\n * size and position the segment availability window. This function should be\n * called once for each Stream (no more, no less), but does not have to be\n * called if notifySegments() is called instead for a particular stream.\n *\n * @param {number} maxSegmentDuration The maximum segment duration for a\n * particular stream.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.notifyMaxSegmentDuration = function(\n maxSegmentDuration) {\n this.maxSegmentDuration_ = Math.max(\n this.maxSegmentDuration_, maxSegmentDuration);\n\n shaka.log.v1('notifyNewSegmentDuration:',\n 'maxSegmentDuration=' + this.maxSegmentDuration_);\n};\n\n\n/**\n * @return {boolean} True if the presentation is live; otherwise, return\n * false.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.isLive = function() {\n return this.duration_ == Infinity &&\n !this.static_;\n};\n\n\n/**\n * @return {boolean} True if the presentation is in progress (meaning not live,\n * but also not completely available); otherwise, return false.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.isInProgress = function() {\n return this.duration_ != Infinity &&\n !this.static_;\n};\n\n\n/**\n * Gets the presentation's current segment availability start time. Segments\n * ending at or before this time should be assumed to be unavailable.\n *\n * @return {number} The current segment availability start time, in seconds,\n * relative to the start of the presentation.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSegmentAvailabilityStart =\n function() {\n return this.getSafeAvailabilityStart(0 /* delay */);\n};\n\n\n/**\n * Gets the presentation's current segment availability start time, offset by\n * the given amount. This is used to ensure that we don't \"fall\" back out of\n * the availability window while we are buffering.\n *\n * @param {number} offset The offset to add to the start time.\n * @return {number} The current segment availability start time, in seconds,\n * relative to the start of the presentation.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSafeAvailabilityStart =\n function(offset) {\n if (this.segmentAvailabilityDuration_ == Infinity)\n return 0;\n\n var end = this.getSegmentAvailabilityEnd();\n var start = Math.min(end - this.segmentAvailabilityDuration_ + offset, end);\n return Math.max(0, start);\n};\n\n\n/**\n * Gets the presentation's current segment availability end time. Segments\n * starting after this time should be assumed to be unavailable.\n *\n * @return {number} The current segment availability end time, in seconds,\n * relative to the start of the presentation. Always returns the\n * presentation's duration for video-on-demand.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSegmentAvailabilityEnd =\n function() {\n if (!this.isLive() && !this.isInProgress())\n return this.duration_;\n\n return Math.min(this.getLiveEdge_(), this.duration_);\n};\n\n\n/**\n * Gets the seek range end.\n *\n * @return {number}\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSeekRangeEnd = function() {\n var useDelay = this.isLive() || this.isInProgress();\n var delay = useDelay ? this.presentationDelay_ : 0;\n return Math.max(0, this.getSegmentAvailabilityEnd() - delay);\n};\n\n\n/**\n * @return {number} The current presentation time in seconds.\n * @private\n */\nshaka.media.PresentationTimeline.prototype.getLiveEdge_ = function() {\n goog.asserts.assert(this.presentationStartTime_ != null,\n 'Cannot compute timeline live edge without start time');\n var now = (Date.now() + this.clockOffset_) / 1000.0;\n return Math.max(\n 0, now - this.maxSegmentDuration_ - this.presentationStartTime_);\n};\n\n\nif (!COMPILED) {\n /**\n * Debug only: assert that the timeline parameters make sense for the type of\n * presentation (VOD, IPR, live).\n */\n shaka.media.PresentationTimeline.prototype.assertIsValid = function() {\n if (this.isLive()) {\n // Implied by isLive(): infinite and dynamic.\n // Live streams should have a start time.\n goog.asserts.assert(this.presentationStartTime_ != null,\n 'Detected as live stream, but does not match our model of live!');\n } else if (this.isInProgress()) {\n // Implied by isInProgress(): finite and dynamic.\n // IPR streams should have a start time, and segments should not expire.\n goog.asserts.assert(this.presentationStartTime_ != null &&\n this.segmentAvailabilityDuration_ == Infinity,\n 'Detected as IPR stream, but does not match our model of IPR!');\n } else { // VOD\n // VOD segments should not expire and the presentation should be finite\n // and static.\n goog.asserts.assert(this.segmentAvailabilityDuration_ == Infinity &&\n this.duration_ != Infinity &&\n this.static_,\n 'Detected as VOD stream, but does not match our model of VOD!');\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/presentation_timeline.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.DashParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.ContentProtection');\ngoog.require('shaka.dash.SegmentBase');\ngoog.require('shaka.dash.SegmentList');\ngoog.require('shaka.dash.SegmentTemplate');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.LanguageUtils');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n\n/**\n * Creates a new DASH parser.\n *\n * @struct\n * @constructor\n * @implements {shakaExtern.ManifestParser}\n * @export\n */\nshaka.dash.DashParser = function() {\n /** @private {?shakaExtern.ManifestConfiguration} */\n this.config_ = null;\n\n /** @private {?shakaExtern.ManifestParser.PlayerInterface} */\n this.playerInterface_ = null;\n\n /** @private {!Array.<string>} */\n this.manifestUris_ = [];\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = null;\n\n /** @private {!Array.<string>} */\n this.periodIds_ = [];\n\n /** @private {number} */\n this.globalId_ = 1;\n\n /**\n * A map of IDs to SegmentIndex objects.\n * ID: Period@id,AdaptationSet@id,@Representation@id\n * e.g.: '1,5,23'\n * @private {!Object.<string, !shaka.media.SegmentIndex>}\n */\n this.segmentIndexMap_ = {};\n\n /**\n * The update period in seconds; or 0 for no updates.\n * @private {number}\n */\n this.updatePeriod_ = 0;\n\n /** @private {?number} */\n this.updateTimer_ = null;\n};\n\n\n/**\n * Contains the minimum amount of time, in seconds, between manifest update\n * requests.\n *\n * @private\n * @const {number}\n */\nshaka.dash.DashParser.MIN_UPDATE_PERIOD_ = 3;\n\n\n/**\n * The default MPD@suggestedPresentationDelay in seconds.\n *\n * @private\n * @const {number}\n */\nshaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_ = 10;\n\n\n/**\n * @typedef {\n * !function(!Array.<string>, ?number, ?number):!Promise.<!ArrayBuffer>\n * }\n */\nshaka.dash.DashParser.RequestInitSegmentCallback;\n\n\n/**\n * @typedef {{\n * segmentBase: Element,\n * segmentList: Element,\n * segmentTemplate: Element,\n * baseUris: !Array.<string>,\n * width: (number|undefined),\n * height: (number|undefined),\n * contentType: string,\n * mimeType: string,\n * codecs: string,\n * frameRate: (number|undefined),\n * containsEmsgBoxes: boolean,\n * id: string\n * }}\n *\n * @description\n * A collection of elements and properties which are inherited across levels\n * of a DASH manifest.\n *\n * @property {Element} segmentBase\n * The XML node for SegmentBase.\n * @property {Element} segmentList\n * The XML node for SegmentList.\n * @property {Element} segmentTemplate\n * The XML node for SegmentTemplate.\n * @property {!Array.<string>} baseUris\n * An array of absolute base URIs for the frame.\n * @property {(number|undefined)} width\n * The inherited width value.\n * @property {(number|undefined)} height\n * The inherited height value.\n * @property {string} contentType\n * The inherited media type.\n * @property {string} mimeType\n * The inherited MIME type value.\n * @property {string} codecs\n * The inherited codecs value.\n * @property {(number|undefined)} frameRate\n * The inherited framerate value.\n * @property {boolean} containsEmsgBoxes\n * Whether there are 'emsg' boxes.\n * @property {string} id\n * The ID of the element.\n */\nshaka.dash.DashParser.InheritanceFrame;\n\n\n/**\n * @typedef {{\n * dynamic: boolean,\n * presentationTimeline: !shaka.media.PresentationTimeline,\n * period: ?shaka.dash.DashParser.InheritanceFrame,\n * periodInfo: ?shaka.dash.DashParser.PeriodInfo,\n * adaptationSet: ?shaka.dash.DashParser.InheritanceFrame,\n * representation: ?shaka.dash.DashParser.InheritanceFrame,\n * bandwidth: (number|undefined),\n * indexRangeWarningGiven: boolean\n * }}\n *\n * @description\n * Contains context data for the streams.\n *\n * @property {boolean} dynamic\n * True if the MPD is dynamic (not all segments available at once)\n * @property {!shaka.media.PresentationTimeline} presentationTimeline\n * The PresentationTimeline.\n * @property {?shaka.dash.DashParser.InheritanceFrame} period\n * The inheritance from the Period element.\n * @property {?shaka.dash.DashParser.PeriodInfo} periodInfo\n * The Period info for the current Period.\n * @property {?shaka.dash.DashParser.InheritanceFrame} adaptationSet\n * The inheritance from the AdaptationSet element.\n * @property {?shaka.dash.DashParser.InheritanceFrame} representation\n * The inheritance from the Representation element.\n * @property {(number|undefined)} bandwidth\n * The bandwidth of the Representation.\n * @property {boolean} indexRangeWarningGiven\n * True if the warning about SegmentURL@indexRange has been printed.\n */\nshaka.dash.DashParser.Context;\n\n\n/**\n * @typedef {{\n * start: number,\n * duration: ?number,\n * node: !Element,\n * isLastPeriod: boolean\n * }}\n *\n * @description\n * Contains information about a Period element.\n *\n * @property {number} start\n * The start time of the period.\n * @property {?number} duration\n * The duration of the period; or null if the duration is not given. This\n * will be non-null for all periods except the last.\n * @property {!Element} node\n * The XML Node for the Period.\n * @property {boolean} isLastPeriod\n * Whether this Period is the last one in the manifest.\n */\nshaka.dash.DashParser.PeriodInfo;\n\n\n/**\n * @typedef {{\n * id: string,\n * contentType: ?string,\n * language: string,\n * main: boolean,\n * streams: !Array.<shakaExtern.Stream>,\n * drmInfos: !Array.<shakaExtern.DrmInfo>,\n * trickModeFor: ?string,\n * representationIds: !Array.<string>\n * }}\n *\n * @description\n * Contains information about an AdaptationSet element.\n *\n * @property {string} id\n * The unique ID of the adaptation set.\n * @property {?string} contentType\n * The content type of the AdaptationSet.\n * @property {string} language\n * The language of the AdaptationSet.\n * @property {boolean} main\n * Whether the AdaptationSet has the 'main' type.\n * @property {!Array.<shakaExtern.Stream>} streams\n * The streams this AdaptationSet contains.\n * @property {!Array.<shakaExtern.DrmInfo>} drmInfos\n * The DRM info for the AdaptationSet.\n * @property {?string} trickModeFor\n * If non-null, this AdaptationInfo represents trick mode tracks. This\n * property is the ID of the normal AdaptationSet these tracks should be\n * associated with.\n * @property {!Array.<string>} representationIds\n * An array of the IDs of the Representations this AdaptationSet contains.\n */\nshaka.dash.DashParser.AdaptationInfo;\n\n\n/**\n * @typedef {{\n * createSegmentIndex: shakaExtern.CreateSegmentIndexFunction,\n * findSegmentPosition: shakaExtern.FindSegmentPositionFunction,\n * getSegmentReference: shakaExtern.GetSegmentReferenceFunction\n * }}\n *\n * @description\n * Contains functions used to create and find segment references.\n *\n * @property {shakaExtern.CreateSegmentIndexFunction} createSegmentIndex\n * The createSegmentIndex function.\n * @property {shakaExtern.FindSegmentPositionFunction} findSegmentPosition\n * The findSegmentPosition function.\n * @property {shakaExtern.GetSegmentReferenceFunction} getSegmentReference\n * The getSegmentReference function.\n */\nshaka.dash.DashParser.SegmentIndexFunctions;\n\n\n/**\n * @typedef {{\n * createSegmentIndex: shakaExtern.CreateSegmentIndexFunction,\n * findSegmentPosition: shakaExtern.FindSegmentPositionFunction,\n * getSegmentReference: shakaExtern.GetSegmentReferenceFunction,\n * initSegmentReference: shaka.media.InitSegmentReference,\n * presentationTimeOffset: (number|undefined)\n * }}\n *\n * @description\n * Contains information about a Stream. This is passed from the createStream\n * methods.\n *\n * @property {shakaExtern.CreateSegmentIndexFunction} createSegmentIndex\n * The createSegmentIndex function for the stream.\n * @property {shakaExtern.FindSegmentPositionFunction} findSegmentPosition\n * The findSegmentPosition function for the stream.\n * @property {shakaExtern.GetSegmentReferenceFunction} getSegmentReference\n * The getSegmentReference function for the stream.\n * @property {shaka.media.InitSegmentReference} initSegmentReference\n * The init segment for the stream.\n * @property {(number|undefined)} presentationTimeOffset\n * The presentationTimeOffset for the stream.\n */\nshaka.dash.DashParser.StreamInfo;\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.configure = function(config) {\n goog.asserts.assert(config.dash != null,\n 'DashManifestConfiguration should not be null!');\n\n this.config_ = config;\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.start = function(uri, playerInterface) {\n goog.asserts.assert(this.config_, 'Must call configure() before start()!');\n this.manifestUris_ = [uri];\n this.playerInterface_ = playerInterface;\n return this.requestManifest_().then(function() {\n if (this.playerInterface_)\n this.setUpdateTimer_(0);\n return this.manifest_;\n }.bind(this));\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.stop = function() {\n this.playerInterface_ = null;\n this.config_ = null;\n\n this.manifestUris_ = [];\n this.manifest_ = null;\n this.periodIds_ = [];\n this.segmentIndexMap_ = {};\n if (this.updateTimer_ != null) {\n window.clearTimeout(this.updateTimer_);\n this.updateTimer_ = null;\n }\n\n return Promise.resolve();\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.update = function() {\n this.requestManifest_().catch(function(error) {\n if (!this.playerInterface_) return;\n this.playerInterface_.onError(error);\n }.bind(this));\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.onExpirationUpdated = function(\n sessionId, expiration) {\n // No-op\n};\n\n\n/**\n * Makes a network request for the manifest and parses the resulting data.\n *\n * @return {!Promise}\n * @private\n */\nshaka.dash.DashParser.prototype.requestManifest_ = function() {\n var requestType = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n var request = shaka.net.NetworkingEngine.makeRequest(\n this.manifestUris_, this.config_.retryParameters);\n return this.playerInterface_.networkingEngine.request(requestType, request)\n .then(function(response) {\n // Detect calls to stop().\n if (!this.playerInterface_)\n return;\n\n // This may throw; but it will result in a failed promise.\n return this.parseManifest_(response.data, response.uri);\n }.bind(this));\n};\n\n\n/**\n * Parses the manifest XML. This also handles updates and will update the\n * stored manifest.\n *\n * @param {!ArrayBuffer} data\n * @param {string} finalManifestUri The final manifest URI, which may\n * differ from this.manifestUri_ if there has been a redirect.\n * @return {!Promise}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parseManifest_ =\n function(data, finalManifestUri) {\n var Error = shaka.util.Error;\n var Functional = shaka.util.Functional;\n var XmlUtils = shaka.util.XmlUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var string = shaka.util.StringUtils.fromUTF8(data);\n var parser = new DOMParser();\n var xml = null;\n var mpd = null;\n\n try {\n xml = parser.parseFromString(string, 'text/xml');\n } catch (exception) {}\n if (xml) {\n // parseFromString returns a Document object. A Document is a Node but not\n // an Element, so it cannot be used in XmlUtils (technically it can but the\n // types don't match). The |documentElement| member defines the top-level\n // element in the document.\n if (xml.documentElement.tagName == 'MPD')\n mpd = xml.documentElement;\n }\n if (mpd && mpd.getElementsByTagName('parsererror').length > 0)\n mpd = null; // It had a parser error in it.\n if (!mpd) {\n throw new Error(\n Error.Severity.CRITICAL, Error.Category.MANIFEST,\n Error.Code.DASH_INVALID_XML);\n }\n\n // Get any Location elements. This will update the manifest location and\n // the base URI.\n /** @type {!Array.<string>} */\n var manifestBaseUris = [finalManifestUri];\n /** @type {!Array.<string>} */\n var locations = XmlUtils.findChildren(mpd, 'Location')\n .map(XmlUtils.getContents)\n .filter(Functional.isNotNull);\n if (locations.length > 0) {\n this.manifestUris_ = locations;\n manifestBaseUris = locations;\n }\n\n var uris = XmlUtils.findChildren(mpd, 'BaseURL').map(XmlUtils.getContents);\n var baseUris = ManifestParserUtils.resolveUris(manifestBaseUris, uris);\n\n var minBufferTime =\n XmlUtils.parseAttr(mpd, 'minBufferTime', XmlUtils.parseDuration);\n this.updatePeriod_ = /** @type {number} */ (XmlUtils.parseAttr(\n mpd, 'minimumUpdatePeriod', XmlUtils.parseDuration, -1));\n\n var presentationStartTime = XmlUtils.parseAttr(\n mpd, 'availabilityStartTime', XmlUtils.parseDate);\n var segmentAvailabilityDuration = XmlUtils.parseAttr(\n mpd, 'timeShiftBufferDepth', XmlUtils.parseDuration);\n var suggestedPresentationDelay = XmlUtils.parseAttr(\n mpd, 'suggestedPresentationDelay', XmlUtils.parseDuration);\n var maxSegmentDuration = XmlUtils.parseAttr(\n mpd, 'maxSegmentDuration', XmlUtils.parseDuration);\n var mpdType = mpd.getAttribute('type') || 'static';\n\n var presentationTimeline;\n if (this.manifest_) {\n presentationTimeline = this.manifest_.presentationTimeline;\n } else {\n // DASH IOP v3.0 suggests using a default delay between minBufferTime and\n // timeShiftBufferDepth. This is literally the range of all feasible\n // choices for the value. Nothing older than timeShiftBufferDepth is still\n // available, and anything less than minBufferTime will cause buffering\n // issues.\n //\n // We have decided that our default will be 1.5 * minBufferTime, or 10s,\n // whichever is larger. This is fairly conservative. Content providers\n // should provide a suggestedPresentationDelay whenever possible to optimize\n // the live streaming experience.\n var defaultPresentationDelay = Math.max(\n shaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_,\n minBufferTime * 1.5);\n var presentationDelay = suggestedPresentationDelay != null ?\n suggestedPresentationDelay : defaultPresentationDelay;\n presentationTimeline = new shaka.media.PresentationTimeline(\n presentationStartTime, presentationDelay);\n }\n\n /** @type {shaka.dash.DashParser.Context} */\n var context = {\n // Don't base on updatePeriod_ since emsg boxes can cause manifest updates.\n dynamic: mpdType != 'static',\n presentationTimeline: presentationTimeline,\n period: null,\n periodInfo: null,\n adaptationSet: null,\n representation: null,\n bandwidth: undefined,\n indexRangeWarningGiven: false\n };\n\n var periodsAndDuration = this.parsePeriods_(context, baseUris, mpd);\n var duration = periodsAndDuration.duration;\n var periods = periodsAndDuration.periods;\n\n presentationTimeline.setStatic(mpdType == 'static');\n presentationTimeline.setDuration(duration || Infinity);\n presentationTimeline.setSegmentAvailabilityDuration(\n segmentAvailabilityDuration != null ?\n segmentAvailabilityDuration :\n Infinity);\n // Use @maxSegmentDuration to override smaller, derived values.\n presentationTimeline.notifyMaxSegmentDuration(maxSegmentDuration || 1);\n if (!COMPILED) presentationTimeline.assertIsValid();\n\n if (this.manifest_) {\n // This is a manifest update, so we're done.\n return Promise.resolve();\n }\n\n // This is the first manifest parse, so we cannot return until we calculate\n // the clock offset.\n var timingElements = XmlUtils.findChildren(mpd, 'UTCTiming');\n\n var isLive = presentationTimeline.isLive();\n\n return this.parseUtcTiming_(\n baseUris, timingElements, isLive).then(function(offset) {\n // Detect calls to stop().\n if (!this.playerInterface_)\n return;\n\n presentationTimeline.setClockOffset(offset);\n\n this.manifest_ = {\n presentationTimeline: presentationTimeline,\n periods: periods,\n offlineSessionIds: [],\n minBufferTime: minBufferTime || 0\n };\n }.bind(this));\n};\n\n\n/**\n * Reads and parses the periods from the manifest. This first does some\n * partial parsing so the start and duration is available when parsing children.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Array.<string>} baseUris\n * @param {!Element} mpd\n * @return {{periods: !Array.<shakaExtern.Period>, duration: ?number}}\n * @private\n */\nshaka.dash.DashParser.prototype.parsePeriods_ = function(\n context, baseUris, mpd) {\n var Functional = shaka.util.Functional;\n var XmlUtils = shaka.util.XmlUtils;\n var presentationDuration = XmlUtils.parseAttr(\n mpd, 'mediaPresentationDuration', XmlUtils.parseDuration);\n\n var periods = [];\n var prevEnd = 0;\n var periodNodes = XmlUtils.findChildren(mpd, 'Period');\n for (var i = 0; i < periodNodes.length; i++) {\n var elem = periodNodes[i];\n var start = /** @type {number} */ (\n XmlUtils.parseAttr(elem, 'start', XmlUtils.parseDuration, prevEnd));\n var givenDuration =\n XmlUtils.parseAttr(elem, 'duration', XmlUtils.parseDuration);\n\n var periodDuration = null;\n if (i != periodNodes.length - 1) {\n // \"The difference between the start time of a Period and the start time\n // of the following Period is the duration of the media content\n // represented by this Period.\"\n var nextPeriod = periodNodes[i + 1];\n var nextStart =\n XmlUtils.parseAttr(nextPeriod, 'start', XmlUtils.parseDuration);\n if (nextStart != null)\n periodDuration = nextStart - start;\n } else if (presentationDuration != null) {\n // \"The Period extends until the Period.start of the next Period, or\n // until the end of the Media Presentation in the case of the last\n // Period.\"\n periodDuration = presentationDuration - start;\n }\n\n if (periodDuration && givenDuration && periodDuration != givenDuration) {\n shaka.log.warning('There is a gap/overlap between Periods', elem);\n }\n // Only use the @duration in the MPD if we can't calculate it. We should\n // favor the @start of the following Period. This ensures that there aren't\n // gaps between Periods.\n if (periodDuration == null)\n periodDuration = givenDuration;\n\n\n // Parse child nodes.\n var info = {\n start: start,\n duration: periodDuration,\n node: elem,\n isLastPeriod: periodDuration == null || i == periodNodes.length - 1\n };\n var period = this.parsePeriod_(context, baseUris, info);\n periods.push(period);\n\n // If there are any new periods, call the callback and add them to the\n // manifest. If this is the first parse, it will see all of them as new.\n var periodId = context.period.id;\n if (this.periodIds_.every(Functional.isNotEqualFunc(periodId))) {\n this.playerInterface_.filterPeriod(period);\n this.periodIds_.push(periodId);\n if (this.manifest_)\n this.manifest_.periods.push(period);\n }\n\n\n if (periodDuration == null) {\n if (i != periodNodes.length - 1) {\n // If the duration is still null and we aren't at the end, then we will\n // skip any remaining periods.\n shaka.log.warning(\n 'Skipping Period', i + 1, 'and any subsequent Periods:', 'Period',\n i + 1, 'does not have a valid start time.', periods[i + 1]);\n }\n\n // The duration is unknown, so the end is unknown.\n prevEnd = null;\n break;\n }\n\n prevEnd = start + periodDuration;\n }\n\n if (presentationDuration != null) {\n if (prevEnd != presentationDuration) {\n shaka.log.warning(\n '@mediaPresentationDuration does not match the total duration of all',\n 'Periods.');\n // Assume @mediaPresentationDuration is correct.\n }\n return {\n periods: periods,\n duration: presentationDuration\n };\n } else {\n return {\n periods: periods,\n duration: prevEnd\n };\n }\n};\n\n\n/**\n * Parses a Period XML element. Unlike the other parse methods, this is not\n * given the Node; it is given a PeriodInfo structure. Also, partial parsing\n * was done before this was called so start and duration are valid.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Array.<string>} baseUris\n * @param {shaka.dash.DashParser.PeriodInfo} periodInfo\n * @return {shakaExtern.Period}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parsePeriod_ = function(\n context, baseUris, periodInfo) {\n var Functional = shaka.util.Functional;\n var XmlUtils = shaka.util.XmlUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n context.period = this.createFrame_(periodInfo.node, null, baseUris);\n context.periodInfo = periodInfo;\n\n // If the period doesn't have an ID, give it one based on its start time.\n if (!context.period.id) {\n shaka.log.info(\n 'No Period ID given for Period with start time ' + periodInfo.start +\n ', Assigning a default');\n context.period.id = '__shaka_period_' + periodInfo.start;\n }\n\n var eventStreamNodes = XmlUtils.findChildren(periodInfo.node, 'EventStream');\n eventStreamNodes.forEach(\n this.parseEventStream_.bind(this, periodInfo.start, periodInfo.duration));\n\n var adaptationSetNodes =\n XmlUtils.findChildren(periodInfo.node, 'AdaptationSet');\n var adaptationSets = adaptationSetNodes\n .map(this.parseAdaptationSet_.bind(this, context))\n .filter(Functional.isNotNull);\n\n var representationIds = adaptationSets\n .map(function(as) { return as.representationIds; })\n .reduce(Functional.collapseArrays, []);\n var uniqueRepIds = representationIds.filter(Functional.isNotDuplicate);\n if (context.dynamic && representationIds.length != uniqueRepIds.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_DUPLICATE_REPRESENTATION_ID);\n }\n\n var normalAdaptationSets = adaptationSets\n .filter(function(as) { return !as.trickModeFor; });\n\n var trickModeAdaptationSets = adaptationSets\n .filter(function(as) { return as.trickModeFor; });\n\n // Attach trick mode tracks to normal tracks.\n trickModeAdaptationSets.forEach(function(trickModeSet) {\n // There may be multiple trick mode streams, but we do not currently\n // support that. Just choose one.\n var trickModeVideo = trickModeSet.streams[0];\n var targetId = trickModeSet.trickModeFor;\n normalAdaptationSets.forEach(function(normalSet) {\n if (normalSet.id == targetId) {\n normalSet.streams.forEach(function(stream) {\n stream.trickModeVideo = trickModeVideo;\n });\n }\n });\n });\n\n var videoSets = this.getSetsOfType_(normalAdaptationSets, ContentType.VIDEO);\n var audioSets = this.getSetsOfType_(normalAdaptationSets, ContentType.AUDIO);\n\n if (!videoSets.length && !audioSets.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_EMPTY_PERIOD);\n }\n\n // In case of audio-only or video-only content, we create an array of one item\n // containing a null. This way, the double-loop works for all kinds of\n // content.\n if (!audioSets.length) {\n audioSets = [null];\n }\n if (!videoSets.length) {\n videoSets = [null];\n }\n\n // TODO: Limit number of combinations. Come up with a heuristic\n // to decide which audio tracks to combine with which video tracks.\n var variants = [];\n for (var i = 0; i < audioSets.length; i++) {\n for (var j = 0; j < videoSets.length; j++) {\n var audioSet = audioSets[i];\n var videoSet = videoSets[j];\n this.createVariants_(audioSet, videoSet, variants);\n }\n }\n\n var textSets = this.getSetsOfType_(normalAdaptationSets, ContentType.TEXT);\n var textStreams = [];\n for (var i = 0; i < textSets.length; i++) {\n textStreams.push.apply(textStreams, textSets[i].streams);\n }\n\n return {\n startTime: periodInfo.start,\n textStreams: textStreams,\n variants: variants\n };\n};\n\n\n/**\n * @param {!Array.<!shaka.dash.DashParser.AdaptationInfo>} adaptationSets\n * @param {string} type\n * @return {!Array.<!shaka.dash.DashParser.AdaptationInfo>}\n * @private\n */\nshaka.dash.DashParser.prototype.getSetsOfType_ = function(\n adaptationSets, type) {\n return adaptationSets.filter(function(as) {\n return as.contentType == type;\n });\n};\n\n\n/**\n * Combines Streams into Variants\n *\n * @param {?shaka.dash.DashParser.AdaptationInfo} audio\n * @param {?shaka.dash.DashParser.AdaptationInfo} video\n * @param {!Array.<shakaExtern.Variant>} variants New variants are pushed onto\n * this array.\n * @private\n */\nshaka.dash.DashParser.prototype.createVariants_ =\n function(audio, video, variants) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Since both audio and video are of the same type, this assertion will catch\n // certain mistakes at runtime that the compiler would miss.\n goog.asserts.assert(!audio || audio.contentType == ContentType.AUDIO,\n 'Audio parameter mismatch!');\n goog.asserts.assert(!video || video.contentType == ContentType.VIDEO,\n 'Video parameter mismatch!');\n\n /** @type {number} */\n var bandwidth;\n /** @type {shakaExtern.Variant} */\n var variant;\n\n if (!audio && !video) {\n return;\n } else if (audio && video) {\n // Audio+video variants\n var DrmEngine = shaka.media.DrmEngine;\n if (DrmEngine.areDrmCompatible(audio.drmInfos, video.drmInfos)) {\n var drmInfos = DrmEngine.getCommonDrmInfos(audio.drmInfos,\n video.drmInfos);\n\n for (var i = 0; i < audio.streams.length; i++) {\n for (var j = 0; j < video.streams.length; j++) {\n // Explicit cast, followed by assertion. These should both be defined\n // in the case of DASH, but the type of Stream.bandwidth allows for\n // undefined in order to support HLS.\n bandwidth = /** @type {number} */(\n video.streams[j].bandwidth +\n audio.streams[i].bandwidth);\n goog.asserts.assert(bandwidth,\n 'Bandwidth must be defined and non-zero!');\n variant = {\n id: this.globalId_++,\n language: audio.language,\n primary: audio.main || video.main,\n audio: audio.streams[i],\n video: video.streams[j],\n bandwidth: bandwidth,\n drmInfos: drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n\n variants.push(variant);\n }\n }\n }\n } else {\n // Audio or video only variants\n var set = audio || video;\n for (var i = 0; i < set.streams.length; i++) {\n // Explicit cast, followed by assertion. These should both be defined\n // in the case of DASH, but the type allows for undefined in order to\n // support HLS.\n bandwidth = /** @type {number} */(set.streams[i].bandwidth);\n goog.asserts.assert(bandwidth,\n 'Bandwidth must be defined and non-zero!');\n variant = {\n id: this.globalId_++,\n language: set.language || 'und',\n primary: set.main,\n audio: audio ? set.streams[i] : null,\n video: video ? set.streams[i] : null,\n bandwidth: bandwidth,\n drmInfos: set.drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n\n variants.push(variant);\n }\n }\n};\n\n\n/**\n * Parses an AdaptationSet XML element.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Element} elem The AdaptationSet element.\n * @return {?shaka.dash.DashParser.AdaptationInfo}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parseAdaptationSet_ = function(context, elem) {\n var XmlUtils = shaka.util.XmlUtils;\n var Functional = shaka.util.Functional;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var ContentType = ManifestParserUtils.ContentType;\n\n context.adaptationSet = this.createFrame_(elem, context.period, null);\n\n var main = false;\n var roleElements = XmlUtils.findChildren(elem, 'Role');\n var roleValues = roleElements.map(function(role) {\n return role.getAttribute('value');\n }).filter(Functional.isNotNull);\n\n // Default kind for text streams is 'subtitle' if unspecified in the manifest.\n var kind = undefined;\n if (context.adaptationSet.contentType == ManifestParserUtils.ContentType.TEXT)\n kind = ManifestParserUtils.TextStreamKind.SUBTITLE;\n\n for (var i = 0; i < roleElements.length; i++) {\n var scheme = roleElements[i].getAttribute('schemeIdUri');\n if (scheme == null || scheme == 'urn:mpeg:dash:role:2011') {\n // These only apply for the given scheme, but allow them to be specified\n // if there is no scheme specified.\n // See: DASH section 5.8.5.5\n var value = roleElements[i].getAttribute('value');\n switch (value) {\n case 'main':\n main = true;\n break;\n case 'caption':\n case 'subtitle':\n kind = value;\n break;\n }\n }\n }\n\n var essentialProperties = XmlUtils.findChildren(elem, 'EssentialProperty');\n // ID of real AdaptationSet if this is a trick mode set:\n var trickModeFor = null;\n var unrecognizedEssentialProperty = false;\n essentialProperties.forEach(function(prop) {\n var schemeId = prop.getAttribute('schemeIdUri');\n if (schemeId == 'http://dashif.org/guidelines/trickmode') {\n trickModeFor = prop.getAttribute('value');\n } else {\n unrecognizedEssentialProperty = true;\n }\n });\n\n // According to DASH spec (2014) section 5.8.4.8, \"the successful processing\n // of the descriptor is essential to properly use the information in the\n // parent element\". According to DASH IOP v3.3, section 3.3.4, \"if the scheme\n // or the value\" for EssentialProperty is not recognized, \"the DASH client\n // shall ignore the parent element.\"\n if (unrecognizedEssentialProperty) {\n // Stop parsing this AdaptationSet and let the caller filter out the nulls.\n return null;\n }\n\n var contentProtectionElems = XmlUtils.findChildren(elem, 'ContentProtection');\n var contentProtection = shaka.dash.ContentProtection.parseFromAdaptationSet(\n contentProtectionElems, this.config_.dash.customScheme,\n this.config_.dash.ignoreDrmInfo);\n\n var language =\n shaka.util.LanguageUtils.normalize(elem.getAttribute('lang') || 'und');\n\n // non-standard attribute(yet) supported by Kaltura\n var label = elem.getAttribute('label');\n\n // Parse Representations into Streams.\n var representations = XmlUtils.findChildren(elem, 'Representation');\n var streams = representations\n .map(this.parseRepresentation_.bind(this, context, contentProtection,\n kind, language, label, main, roleValues))\n .filter(function(s) { return !!s; });\n\n if (streams.length == 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_EMPTY_ADAPTATION_SET);\n }\n\n // If AdaptationSet's type is unknown or is ambiguously \"application\",\n // guess based on the information in the first stream. If the attributes\n // mimeType and codecs are split across levels, they will both be inherited\n // down to the stream level by this point, so the stream will have all the\n // necessary information.\n if (!context.adaptationSet.contentType ||\n context.adaptationSet.contentType == ContentType.APPLICATION) {\n var mimeType = streams[0].mimeType;\n var codecs = streams[0].codecs;\n context.adaptationSet.contentType =\n shaka.dash.DashParser.guessContentType_(mimeType, codecs);\n\n streams.forEach(function(stream) {\n stream.type = context.adaptationSet.contentType;\n });\n }\n\n streams.forEach(function(stream) {\n // Some DRM license providers require that we have a default\n // key ID from the manifest in the wrapped license request.\n // Thus, it should be put in drmInfo to be accessible to request filters.\n contentProtection.drmInfos.forEach(function(drmInfo) {\n if (stream.keyId) {\n drmInfo.keyIds.push(stream.keyId);\n }\n });\n });\n\n var repIds = representations\n .map(function(node) { return node.getAttribute('id'); })\n .filter(shaka.util.Functional.isNotNull);\n\n return {\n id: context.adaptationSet.id || ('__fake__' + this.globalId_++),\n contentType: context.adaptationSet.contentType,\n language: language,\n main: main,\n streams: streams,\n drmInfos: contentProtection.drmInfos,\n trickModeFor: trickModeFor,\n representationIds: repIds\n };\n};\n\n\n/**\n * Parses a Representation XML element.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.ContentProtection.Context} contentProtection\n * @param {(string|undefined)} kind\n * @param {string} language\n * @param {string} label\n * @param {boolean} isPrimary\n * @param {!Array.<string>} roles\n * @param {!Element} node\n * @return {?shakaExtern.Stream} The Stream, or null when there is a\n * non-critical parsing error.\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parseRepresentation_ = function(\n context, contentProtection, kind, language, label, isPrimary, roles, node) {\n var XmlUtils = shaka.util.XmlUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n context.representation = this.createFrame_(node, context.adaptationSet, null);\n if (!this.verifyRepresentation_(context.representation)) {\n shaka.log.warning('Skipping Representation', context.representation);\n return null;\n }\n\n context.bandwidth =\n XmlUtils.parseAttr(node, 'bandwidth', XmlUtils.parsePositiveInt) ||\n undefined;\n\n /** @type {?shaka.dash.DashParser.StreamInfo} */\n var streamInfo;\n var requestInitSegment = this.requestInitSegment_.bind(this);\n if (context.representation.segmentBase) {\n streamInfo = shaka.dash.SegmentBase.createStream(\n context, requestInitSegment);\n } else if (context.representation.segmentList) {\n streamInfo = shaka.dash.SegmentList.createStream(\n context, this.segmentIndexMap_);\n } else if (context.representation.segmentTemplate) {\n streamInfo = shaka.dash.SegmentTemplate.createStream(\n context, requestInitSegment, this.segmentIndexMap_, !!this.manifest_);\n } else {\n goog.asserts.assert(\n context.representation.contentType == ContentType.TEXT ||\n context.representation.contentType == ContentType.APPLICATION,\n 'Must have Segment* with non-text streams.');\n\n var baseUris = context.representation.baseUris;\n var duration = context.periodInfo.duration || 0;\n streamInfo = {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition:\n /** @return {?number} */ function(/** number */ time) {\n if (time >= 0 && time < duration)\n return 1;\n else\n return null;\n },\n getSegmentReference:\n /** @return {shaka.media.SegmentReference} */\n function(/** number */ ref) {\n if (ref != 1)\n return null;\n\n return new shaka.media.SegmentReference(\n 1, 0, duration, function() { return baseUris; }, 0, null);\n },\n initSegmentReference: null,\n presentationTimeOffset: 0\n };\n }\n\n var contentProtectionElems = XmlUtils.findChildren(node, 'ContentProtection');\n var keyId = shaka.dash.ContentProtection.parseFromRepresentation(\n contentProtectionElems, this.config_.dash.customScheme,\n contentProtection, this.config_.dash.ignoreDrmInfo);\n\n return {\n id: this.globalId_++,\n createSegmentIndex: streamInfo.createSegmentIndex,\n findSegmentPosition: streamInfo.findSegmentPosition,\n getSegmentReference: streamInfo.getSegmentReference,\n initSegmentReference: streamInfo.initSegmentReference,\n presentationTimeOffset: streamInfo.presentationTimeOffset,\n mimeType: context.representation.mimeType,\n codecs: context.representation.codecs,\n frameRate: context.representation.frameRate,\n bandwidth: context.bandwidth,\n width: context.representation.width,\n height: context.representation.height,\n kind: kind,\n encrypted: contentProtection.drmInfos.length > 0,\n keyId: keyId,\n language: language,\n label: label,\n type: context.adaptationSet.contentType,\n primary: isPrimary,\n trickModeVideo: null,\n containsEmsgBoxes: context.representation.containsEmsgBoxes,\n roles: roles\n };\n};\n\n\n/**\n * Called when the update timer ticks.\n *\n * @private\n */\nshaka.dash.DashParser.prototype.onUpdate_ = function() {\n goog.asserts.assert(this.updateTimer_, 'Should only be called by timer');\n goog.asserts.assert(this.updatePeriod_ >= 0,\n 'There should be an update period');\n\n shaka.log.info('Updating manifest...');\n\n this.updateTimer_ = null;\n var startTime = Date.now();\n\n this.requestManifest_().then(function() {\n // Detect a call to stop()\n if (!this.playerInterface_)\n return;\n\n // Ensure the next update occurs within |updatePeriod_| seconds by taking\n // into account the time it took to update the manifest.\n var endTime = Date.now();\n this.setUpdateTimer_((endTime - startTime) / 1000.0);\n }.bind(this)).catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Should only receive a Shaka error');\n\n // Try updating again, but ensure we haven't been destroyed.\n if (this.playerInterface_) {\n // We will retry updating, so override the severity of the error.\n error.severity = shaka.util.Error.Severity.RECOVERABLE;\n this.playerInterface_.onError(error);\n\n this.setUpdateTimer_(0);\n }\n }.bind(this));\n};\n\n\n/**\n * Sets the update timer. Does nothing if the manifest does not specify an\n * update period.\n *\n * @param {number} offset An offset, in seconds, to apply to the manifest's\n * update period.\n * @private\n */\nshaka.dash.DashParser.prototype.setUpdateTimer_ = function(offset) {\n // NOTE: An updatePeriod_ of -1 means the attribute was missing.\n // An attribute which is present and set to 0 should still result in periodic\n // updates. For more, see: https://github.com/google/shaka-player/issues/331\n if (this.updatePeriod_ < 0)\n return;\n goog.asserts.assert(this.updateTimer_ == null,\n 'Timer should not be already set');\n\n var period =\n Math.max(shaka.dash.DashParser.MIN_UPDATE_PERIOD_, this.updatePeriod_);\n var interval = Math.max(period - offset, 0);\n shaka.log.debug('updateInterval', interval);\n\n var callback = this.onUpdate_.bind(this);\n this.updateTimer_ = window.setTimeout(callback, 1000 * interval);\n};\n\n\n/**\n * Creates a new inheritance frame for the given element.\n *\n * @param {!Element} elem\n * @param {?shaka.dash.DashParser.InheritanceFrame} parent\n * @param {Array.<string>} baseUris\n * @return {shaka.dash.DashParser.InheritanceFrame}\n * @private\n */\nshaka.dash.DashParser.prototype.createFrame_ = function(\n elem, parent, baseUris) {\n goog.asserts.assert(parent || baseUris,\n 'Must provide either parent or baseUris');\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var XmlUtils = shaka.util.XmlUtils;\n parent = parent || /** @type {shaka.dash.DashParser.InheritanceFrame} */ ({\n contentType: '',\n mimeType: '',\n codecs: '',\n containsEmsgBoxes: false,\n frameRate: undefined\n });\n baseUris = baseUris || parent.baseUris;\n\n var parseNumber = XmlUtils.parseNonNegativeInt;\n var evalDivision = XmlUtils.evalDivision;\n var uris = XmlUtils.findChildren(elem, 'BaseURL').map(XmlUtils.getContents);\n\n var contentType = elem.getAttribute('contentType') || parent.contentType;\n var mimeType = elem.getAttribute('mimeType') || parent.mimeType;\n var codecs = elem.getAttribute('codecs') || parent.codecs;\n var frameRate =\n XmlUtils.parseAttr(elem, 'frameRate', evalDivision) || parent.frameRate;\n var containsEmsgBoxes =\n !!XmlUtils.findChildren(elem, 'InbandEventStream').length;\n\n if (!contentType) {\n contentType = shaka.dash.DashParser.guessContentType_(mimeType, codecs);\n }\n\n return {\n baseUris: ManifestParserUtils.resolveUris(baseUris, uris),\n segmentBase: XmlUtils.findChild(elem, 'SegmentBase') || parent.segmentBase,\n segmentList: XmlUtils.findChild(elem, 'SegmentList') || parent.segmentList,\n segmentTemplate:\n XmlUtils.findChild(elem, 'SegmentTemplate') || parent.segmentTemplate,\n width: XmlUtils.parseAttr(elem, 'width', parseNumber) || parent.width,\n height: XmlUtils.parseAttr(elem, 'height', parseNumber) || parent.height,\n contentType: contentType,\n mimeType: mimeType,\n codecs: codecs,\n frameRate: frameRate,\n containsEmsgBoxes: containsEmsgBoxes || parent.containsEmsgBoxes,\n id: elem.getAttribute('id')\n };\n};\n\n\n/**\n * Verifies that a Representation has exactly one Segment* element. Prints\n * warnings if there is a problem.\n *\n * @param {shaka.dash.DashParser.InheritanceFrame} frame\n * @return {boolean} True if the Representation is usable; otherwise return\n * false.\n * @private\n */\nshaka.dash.DashParser.prototype.verifyRepresentation_ = function(frame) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var n = 0;\n n += frame.segmentBase ? 1 : 0;\n n += frame.segmentList ? 1 : 0;\n n += frame.segmentTemplate ? 1 : 0;\n\n if (n == 0) {\n // TODO: extend with the list of MIME types registered to TextEngine.\n if (frame.contentType == ContentType.TEXT ||\n frame.contentType == ContentType.APPLICATION) {\n return true;\n } else {\n shaka.log.warning(\n 'Representation does not contain a segment information source:',\n 'the Representation must contain one of SegmentBase, SegmentList,',\n 'SegmentTemplate, or explicitly indicate that it is \"text\".',\n frame);\n return false;\n }\n }\n\n if (n != 1) {\n shaka.log.warning(\n 'Representation contains multiple segment information sources:',\n 'the Representation should only contain one of SegmentBase,',\n 'SegmentList, or SegmentTemplate.',\n frame);\n if (frame.segmentBase) {\n shaka.log.info('Using SegmentBase by default.');\n frame.segmentList = null;\n frame.segmentTemplate = null;\n } else {\n goog.asserts.assert(frame.segmentList, 'There should be a SegmentList');\n shaka.log.info('Using SegmentList by default.');\n frame.segmentTemplate = null;\n }\n }\n\n return true;\n};\n\n\n/**\n * Makes a request to the given URI and calculates the clock offset.\n *\n * @param {!Array.<string>} baseUris\n * @param {string} uri\n * @param {string} method\n * @return {!Promise.<number>}\n * @private\n */\nshaka.dash.DashParser.prototype.requestForTiming_ =\n function(baseUris, uri, method) {\n var requestUris = shaka.util.ManifestParserUtils.resolveUris(baseUris, [uri]);\n var request = shaka.net.NetworkingEngine.makeRequest(\n requestUris, this.config_.retryParameters);\n request.method = method;\n var type = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n return this.playerInterface_.networkingEngine.request(type, request)\n .then(function(response) {\n var text;\n if (method == 'HEAD') {\n if (!response.headers || !response.headers['date']) return 0;\n\n text = response.headers['date'];\n } else {\n text = shaka.util.StringUtils.fromUTF8(response.data);\n }\n\n var date = Date.parse(text);\n return isNaN(date) ? 0 : (date - Date.now());\n });\n};\n\n\n/**\n * Parses an array of UTCTiming elements.\n *\n * @param {!Array.<string>} baseUris\n * @param {!Array.<!Element>} elems\n * @param {boolean} isLive\n * @return {!Promise.<number>}\n * @private\n */\nshaka.dash.DashParser.prototype.parseUtcTiming_ =\n function(baseUris, elems, isLive) {\n var schemesAndValues = elems.map(function(elem) {\n return {\n scheme: elem.getAttribute('schemeIdUri'),\n value: elem.getAttribute('value')\n };\n });\n\n // If there's nothing specified in the manifest, but we have a default from\n // the config, use that.\n var clockSyncUri = this.config_.dash.clockSyncUri;\n if (isLive && !schemesAndValues.length && clockSyncUri) {\n schemesAndValues.push({\n scheme: 'urn:mpeg:dash:utc:http-head:2014',\n value: clockSyncUri\n });\n }\n\n var Functional = shaka.util.Functional;\n return Functional.createFallbackPromiseChain(schemesAndValues, function(sv) {\n var scheme = sv.scheme;\n var value = sv.value;\n switch (scheme) {\n // See DASH IOP Guidelines Section 4.7\n // http://goo.gl/CQFNJT\n case 'urn:mpeg:dash:utc:http-head:2014':\n // Some old ISO23009-1 drafts used 2012.\n case 'urn:mpeg:dash:utc:http-head:2012':\n return this.requestForTiming_(baseUris, value, 'HEAD');\n case 'urn:mpeg:dash:utc:http-xsdate:2014':\n case 'urn:mpeg:dash:utc:http-iso:2014':\n case 'urn:mpeg:dash:utc:http-xsdate:2012':\n case 'urn:mpeg:dash:utc:http-iso:2012':\n return this.requestForTiming_(baseUris, value, 'GET');\n case 'urn:mpeg:dash:utc:direct:2014':\n case 'urn:mpeg:dash:utc:direct:2012':\n var date = Date.parse(value);\n return isNaN(date) ? 0 : (date - Date.now());\n\n case 'urn:mpeg:dash:utc:http-ntp:2014':\n case 'urn:mpeg:dash:utc:ntp:2014':\n case 'urn:mpeg:dash:utc:sntp:2014':\n shaka.log.warning('NTP UTCTiming scheme is not supported');\n return Promise.reject();\n default:\n shaka.log.warning(\n 'Unrecognized scheme in UTCTiming element', scheme);\n return Promise.reject();\n }\n }.bind(this)).catch(function() {\n if (isLive) {\n shaka.log.warning(\n 'A UTCTiming element should always be given in live manifests! ' +\n 'This content may not play on clients with bad clocks!');\n }\n return 0;\n });\n};\n\n\n/**\n * Parses an EventStream element.\n *\n * @param {number} periodStart\n * @param {?number} periodDuration\n * @param {!Element} elem\n * @private\n */\nshaka.dash.DashParser.prototype.parseEventStream_ = function(\n periodStart, periodDuration, elem) {\n var XmlUtils = shaka.util.XmlUtils;\n var parseNumber = XmlUtils.parseNonNegativeInt;\n\n var schemeIdUri = elem.getAttribute('schemeIdUri') || '';\n var value = elem.getAttribute('value') || '';\n var timescale = XmlUtils.parseAttr(elem, 'timescale', parseNumber) || 1;\n\n XmlUtils.findChildren(elem, 'Event').forEach(function(eventNode) {\n var presentationTime =\n XmlUtils.parseAttr(eventNode, 'presentationTime', parseNumber) || 0;\n var duration = XmlUtils.parseAttr(eventNode, 'duration', parseNumber) || 0;\n\n var startTime = presentationTime / timescale + periodStart;\n var endTime = startTime + (duration / timescale);\n if (periodDuration != null) {\n // An event should not go past the Period, even if the manifest says so.\n // See: Dash sec. 5.10.2.1\n startTime = Math.min(startTime, periodStart + periodDuration);\n endTime = Math.min(endTime, periodStart + periodDuration);\n }\n\n /** @type {shakaExtern.TimelineRegionInfo} */\n var region = {\n schemeIdUri: schemeIdUri,\n value: value,\n startTime: startTime,\n endTime: endTime,\n id: eventNode.getAttribute('id') || '',\n eventElement: eventNode\n };\n\n this.playerInterface_.onTimelineRegionAdded(region);\n }.bind(this));\n};\n\n\n/**\n * Makes a network request on behalf of SegmentBase.createStream.\n *\n * @param {!Array.<string>} uris\n * @param {?number} startByte\n * @param {?number} endByte\n * @return {!Promise.<!ArrayBuffer>}\n * @private\n */\nshaka.dash.DashParser.prototype.requestInitSegment_ = function(\n uris, startByte, endByte) {\n var requestType = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n var request = shaka.net.NetworkingEngine.makeRequest(\n uris, this.config_.retryParameters);\n if (startByte != null) {\n var end = (endByte != null ? endByte : '');\n request.headers['Range'] = 'bytes=' + startByte + '-' + end;\n }\n\n return this.playerInterface_.networkingEngine.request(requestType, request)\n .then(function(response) { return response.data; });\n};\n\n\n/**\n * Guess the content type based on MIME type and codecs.\n *\n * @param {string} mimeType\n * @param {string} codecs\n * @return {string}\n * @private\n */\nshaka.dash.DashParser.guessContentType_ = function(mimeType, codecs) {\n var fullMimeType = shaka.util.StreamUtils.getFullMimeType(mimeType, codecs);\n\n if (shaka.media.TextEngine.isTypeSupported(fullMimeType)) {\n // If it's supported by TextEngine, it's definitely text.\n // We don't check MediaSourceEngine, because that would report support\n // for platform-supported video and audio types as well.\n return shaka.util.ManifestParserUtils.ContentType.TEXT;\n }\n\n // Otherwise, just split the MIME type. This handles video and audio\n // types well.\n return mimeType.split('/')[0];\n};\n\n\nshaka.media.ManifestParser.registerParserByExtension(\n 'mpd', shaka.dash.DashParser);\nshaka.media.ManifestParser.registerParserByMime(\n 'application/dash+xml', shaka.dash.DashParser);\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/dash_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.hls.Attribute');\ngoog.provide('shaka.hls.Playlist');\ngoog.provide('shaka.hls.PlaylistType');\ngoog.provide('shaka.hls.Segment');\ngoog.provide('shaka.hls.Tag');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Creates an HLS playlist object.\n *\n * @param {!string} uri\n * @param {!shaka.hls.PlaylistType} type\n * @param {!Array.<shaka.hls.Tag>} tags\n * @param {!Array.<shaka.hls.Segment>=} opt_segments\n *\n * @constructor\n * @struct\n */\nshaka.hls.Playlist = function(uri, type, tags, opt_segments) {\n /** @const {!string} */\n this.uri = uri;\n\n /** @const {shaka.hls.PlaylistType} */\n this.type = type;\n\n /** @const {!Array.<!shaka.hls.Tag>} */\n this.tags = tags;\n\n /** @const {Array.<!shaka.hls.Segment>} */\n this.segments = opt_segments || null;\n};\n\n\n/**\n * @enum {number}\n */\nshaka.hls.PlaylistType = {\n MASTER: 0,\n MEDIA: 1\n};\n\n\n\n/**\n * Creates an HLS tag object.\n *\n * @param {number} id\n * @param {!string} name\n * @param {!Array.<shaka.hls.Attribute>} attributes\n * @param {?string=} opt_value\n *\n * @constructor\n * @struct\n */\nshaka.hls.Tag = function(id, name, attributes, opt_value) {\n\n goog.asserts.assert(\n (attributes.length == 0 && opt_value) ||\n (attributes.length > 0 && !opt_value) ||\n (attributes.length == 0 && !opt_value),\n 'Tags can only take the form ' +\n '(1) <NAME>:<VALUE> ' +\n '(2) <NAME>:<ATTRIBUTE_LIST> ' +\n ' (3) <NAME>');\n\n /** @const {number} */\n this.id = id;\n\n /** @const {!string} */\n this.name = name;\n\n /** @const {Array.<shaka.hls.Attribute>} */\n this.attributes = attributes;\n\n /** @const {?string} */\n this.value = opt_value || null;\n};\n\n\n/**\n * Create the string representation of the tag.\n *\n * For the DRM system - the full tag needs to be passed down to the CDM. There\n * are two ways of doing this (1) save the original tag or (2) recreate the tag.\n * As with some cases (like in tests) the tag never existed in string form, it\n * is far easier to recreate the tag from the parsed form.\n *\n * @return {string}\n * @override\n */\nshaka.hls.Tag.prototype.toString = function() {\n\n /**\n * @param {shaka.hls.Attribute} attr\n * @return {!string}\n */\n var attr_to_str = function(attr) {\n return attr.name + '=\"' + attr.value + '\"';\n };\n\n\n // A valid tag can only follow 1 of 3 patterns.\n // 1) <NAME>:<VALUE>\n // 2) <NAME>:<ATTRIBUTE LIST>\n // 3) <NAME>\n\n if (this.value) {\n return '#' + this.name + ':' + this.value;\n }\n\n if (this.attributes.length > 0) {\n return '#' + this.name + ':' + this.attributes.map(attr_to_str).join(',');\n }\n\n return '#' + this.name;\n};\n\n\n\n/**\n * Creates an HLS attribute object.\n *\n * @param {!string} name\n * @param {!string} value\n *\n * @constructor\n * @struct\n */\nshaka.hls.Attribute = function(name, value) {\n /** @const {!string} */\n this.name = name;\n\n /** @const {!string} */\n this.value = value;\n};\n\n\n/**\n * Adds an attribute to an HLS Tag.\n *\n * @param {!shaka.hls.Attribute} attribute\n */\nshaka.hls.Tag.prototype.addAttribute = function(attribute) {\n this.attributes.push(attribute);\n};\n\n\n/**\n * Gets the first attribute of the tag with a specified name.\n *\n * @param {!string} name\n * @return {?shaka.hls.Attribute} attribute\n */\nshaka.hls.Tag.prototype.getAttribute = function(name) {\n var attributes = this.attributes.filter(function(attr) {\n return attr.name == name;\n });\n\n goog.asserts.assert(attributes.length < 2,\n 'A tag should not have multiple attributes ' +\n 'with the same name!');\n\n if (attributes.length)\n return attributes[0];\n else\n return null;\n};\n\n\n/**\n * Gets the value of the first attribute of the tag with a specified name.\n * If not found, returns an optional default value.\n *\n * @param {!string} name\n * @param {string=} opt_defaultValue\n * @return {?string}\n */\nshaka.hls.Tag.prototype.getAttributeValue = function(name, opt_defaultValue) {\n var defaultValue = opt_defaultValue || null;\n var attribute = this.getAttribute(name);\n return attribute ? attribute.value : defaultValue;\n};\n\n\n\n/**\n * Creates an HLS segment object.\n *\n * @param {!string} uri\n * @param {!Array.<shaka.hls.Tag>} tags\n *\n * @constructor\n * @struct\n */\nshaka.hls.Segment = function(uri, tags) {\n /** @const {!Array.<shaka.hls.Tag>} */\n this.tags = tags;\n\n /** @const {!string} */\n this.uri = uri;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/hls_classes.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.hls.Utils');\n\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n/**\n *\n * @param {!Array.<!shaka.hls.Tag>} tags\n * @param {!string} name\n * @return {!Array.<!shaka.hls.Tag>}\n */\nshaka.hls.Utils.filterTagsByName = function(tags, name) {\n return tags.filter(function(tag) {\n return tag.name == name;\n });\n};\n\n\n/**\n *\n * @param {!Array.<!shaka.hls.Tag>} tags\n * @param {!string} name\n * @return {?shaka.hls.Tag}\n */\nshaka.hls.Utils.getFirstTagWithName = function(tags, name) {\n var tagsWithName = shaka.hls.Utils.filterTagsByName(tags, name);\n if (!tagsWithName.length) return null;\n\n return tagsWithName[0];\n};\n\n\n/**\n * Expects an array of EXT-X-MEDIA tags. Returns the first tag that\n * has given media type and group id.\n *\n * @param {!Array.<!shaka.hls.Tag>} tags\n * @param {!string} type\n * @param {!string} groupId\n * @return {!Array<!shaka.hls.Tag>}\n */\nshaka.hls.Utils.findMediaTags = function(tags, type, groupId) {\n return tags.filter(function(tag) {\n var typeAttr = tag.getAttribute('TYPE');\n var groupIdAttr = tag.getAttribute('GROUP-ID');\n return typeAttr.value == type && groupIdAttr.value == groupId;\n });\n};\n\n\n/**\n * @param {!string} parentAbsoluteUri\n * @param {!string} uri\n * @return {!string}\n */\nshaka.hls.Utils.constructAbsoluteUri = function(parentAbsoluteUri, uri) {\n var uris = shaka.util.ManifestParserUtils.resolveUris(\n [parentAbsoluteUri], [uri]);\n\n return uris[0];\n};\n\n\n/**\n * Matches a string to an HLS comment format and returns the result.\n *\n * @param {!string} line\n * @return {boolean}\n */\nshaka.hls.Utils.isComment = function(line) {\n return /^#(?!EXT)/m.test(line);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/hls_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.TextParser');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Reads elements from strings.\n *\n * @param {string} data\n * @constructor\n * @struct\n */\nshaka.util.TextParser = function(data) {\n /**\n * @const\n * @private {string}\n */\n this.data_ = data;\n\n /** @private {number} */\n this.position_ = 0;\n};\n\n\n/** @return {boolean} Whether it is at the end of the string. */\nshaka.util.TextParser.prototype.atEnd = function() {\n return this.position_ == this.data_.length;\n};\n\n\n/**\n * Reads a line from the parser. This will read but not return the newline.\n * Returns null at the end.\n *\n * @return {?string}\n */\nshaka.util.TextParser.prototype.readLine = function() {\n return this.readRegexReturnCapture_(/(.*?)(\\n|$)/gm, 1);\n};\n\n\n/**\n * Reads a word from the parser. This will not read or return any whitespace\n * before or after the word (including newlines). Returns null at the end.\n *\n * @return {?string}\n */\nshaka.util.TextParser.prototype.readWord = function() {\n return this.readRegexReturnCapture_(/[^ \\t\\n]*/gm, 0);\n};\n\n\n/**\n * Skips any continuous whitespace from the parser. Returns null at the end.\n */\nshaka.util.TextParser.prototype.skipWhitespace = function() {\n this.readRegex(/[ \\t]+/gm);\n};\n\n\n/**\n * Reads the given regular expression from the parser. This requires the match\n * to be at the current position; there is no need to include a head anchor.\n * This requires that the regex have the global flag to be set so that it can\n * set lastIndex to start the search at the current position. Returns null at\n * the end or if the regex does not match the current position.\n *\n * @param {!RegExp} regex\n * @return {Array.<string>}\n */\nshaka.util.TextParser.prototype.readRegex = function(regex) {\n var index = this.indexOf_(regex);\n if (this.atEnd() || index == null || index.position != this.position_)\n return null;\n\n this.position_ += index.length;\n return index.results;\n};\n\n\n/**\n * Reads a regex from the parser and returns the given capture.\n *\n * @param {!RegExp} regex\n * @param {number} index\n * @return {?string}\n * @private\n */\nshaka.util.TextParser.prototype.readRegexReturnCapture_ =\n function(regex, index) {\n if (this.atEnd())\n return null;\n\n var ret = this.readRegex(regex);\n if (!ret)\n return null;\n else\n return ret[index];\n};\n\n\n/**\n * Returns the index info about a regular expression match.\n *\n * @param {!RegExp} regex\n * @return {?{position: number, length: number, results: !Array.<string>}}\n * @private\n */\nshaka.util.TextParser.prototype.indexOf_ = function(regex) {\n // The global flag is required to use lastIndex.\n goog.asserts.assert(regex.global, 'global flag should be set');\n\n regex.lastIndex = this.position_;\n var results = regex.exec(this.data_);\n if (results == null)\n return null;\n else\n return {\n position: results.index,\n length: results[0].length,\n results: results\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.hls.ManifestTextParser');\n\ngoog.require('shaka.hls.Attribute');\ngoog.require('shaka.hls.Playlist');\ngoog.require('shaka.hls.PlaylistType');\ngoog.require('shaka.hls.Segment');\ngoog.require('shaka.hls.Tag');\ngoog.require('shaka.hls.Utils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.TextParser');\n\n\n\n/**\n * Creates a new ManifestTextParser.\n *\n * @constructor\n * @struct\n */\nshaka.hls.ManifestTextParser = function() {\n /** @private {number} */\n this.globalId_ = 0;\n};\n\n\n/**\n * @param {!ArrayBuffer} data\n * @param {!string} uri\n * @return {!shaka.hls.Playlist}\n * @throws {shaka.util.Error}\n */\nshaka.hls.ManifestTextParser.prototype.parsePlaylist = function(data, uri) {\n // Get the input as a string. Normalize newlines to \\n.\n var str = shaka.util.StringUtils.fromUTF8(data);\n str = str.replace(/\\r\\n|\\r(?=[^\\n]|$)/gm, '\\n').trim();\n\n var lines = str.split(/\\n+/m);\n\n if (!/^#EXTM3U($|[ \\t\\n])/m.test(lines[0])) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_PLAYLIST_HEADER_MISSING);\n }\n\n /** shaka.hls.PlaylistType */\n var playlistType = shaka.hls.PlaylistType.MASTER;\n\n /** {Array.<shaka.hls.Tag>} */\n var tags = [];\n var i = 1;\n while (i < lines.length) {\n // Skip comments\n if (shaka.hls.Utils.isComment(lines[i])) {\n i += 1;\n continue;\n }\n\n var tag = this.parseTag_(lines[i]);\n\n if (shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS\n .indexOf(tag.name) >= 0) {\n playlistType = shaka.hls.PlaylistType.MEDIA;\n } else if (shaka.hls.ManifestTextParser.SEGMENT_TAGS\n .indexOf(tag.name) >= 0) {\n if (playlistType != shaka.hls.PlaylistType.MEDIA) {\n // Only media playlist should contain segment tags\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY);\n }\n\n var segmentsData = lines.splice(i, lines.length - i);\n var segments = this.parseSegments_(segmentsData);\n return new shaka.hls.Playlist(uri, playlistType, tags, segments);\n }\n\n tags.push(tag);\n i += 1;\n\n // EXT-X-STREAM-INF tag is followed by a uri of a media playlist.\n // Add uri to the tag object.\n if (tag.name == 'EXT-X-STREAM-INF') {\n var tagUri = new shaka.hls.Attribute('URI', lines[i]);\n tag.addAttribute(tagUri);\n i += 1;\n }\n }\n\n return new shaka.hls.Playlist(uri, playlistType, tags);\n};\n\n\n/**\n * Parses an array of strings into an HLS Segment objects.\n *\n * @param {!Array.<string>} lines\n * @return {!Array.<shaka.hls.Segment>}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.ManifestTextParser.prototype.parseSegments_ = function(lines) {\n var segments = [];\n var tags = [];\n lines.forEach(function(line) {\n if (/^(#EXT)/.test(line)) {\n var tag = this.parseTag_(line);\n tags.push(tag);\n } else if (shaka.hls.Utils.isComment(line)) {\n // Skip comments\n return;\n } else {\n var uri = line.trim();\n // Uri appears after all the tags describing the segment.\n var segment = new shaka.hls.Segment(uri, tags);\n segments.push(segment);\n tags = [];\n }\n }.bind(this));\n\n return segments;\n};\n\n\n/**\n * Parses a string into an HLS Tag object while tracking what id to use next.\n *\n * @param {!string} word\n * @return {!shaka.hls.Tag}\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.hls.ManifestTextParser.prototype.parseTag_ = function(word) {\n return shaka.hls.ManifestTextParser.parseTag(this.globalId_++, word);\n};\n\n\n/**\n * Parses a string into an HLS Tag object.\n *\n * @param {number} id\n * @param {!string} word\n * @return {!shaka.hls.Tag}\n * @throws {shaka.util.Error}\n */\nshaka.hls.ManifestTextParser.parseTag = function(id, word) {\n /* HLS tags start with '#EXT'. A tag can have a set of attributes\n (#EXT-<tagname>:<attribute list>) or a value (#EXT-<tagname>:<value>).\n Attributes' format is 'AttributeName=AttributeValue'.\n The parsing logic goes like this:\n 1) Everything before ':' is a name (we ignore '#').\n 2) Everything after should be parsed as attributes if it contains '='.\n 3) Otherwise, this is a value.\n 4) If there is no \":\", it's a simple tag with no attributes and no value */\n var blocks = word.match(/^#(EXT[^:]*)(?::(.*))?$/);\n if (!blocks) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.INVALID_HLS_TAG);\n }\n var name = blocks[1];\n var data = blocks[2];\n var attributes = [];\n\n if (data && data.indexOf('=') >= 0) {\n var parser = new shaka.util.TextParser(data);\n var blockAttrs;\n\n // Regex:\n // 1. Key name ([1])\n // 2. Equals sign\n // 3. Either:\n // a. A quoted string (everything up to the next quote, [2])\n // b. An unquoted string\n // (everything up to the next comma or end of line, [3])\n // 4. Either:\n // a. A comma\n // b. End of line\n var regex = /([^=]+)=(?:\"([^\"]*)\"|([^\",]*))(?:,|$)/g;\n while (blockAttrs = parser.readRegex(regex)) {\n var attrName = blockAttrs[1];\n var attrValue = blockAttrs[2] || blockAttrs[3];\n var attribute = new shaka.hls.Attribute(attrName, attrValue);\n attributes.push(attribute);\n }\n } else if (data) {\n return new shaka.hls.Tag(id, name, attributes, data);\n }\n\n return new shaka.hls.Tag(id, name, attributes);\n};\n\n\n/**\n * HLS tags that only appear on Media Playlists.\n * Used to determine a playlist type.\n *\n * @const {!Array<!string>}\n */\nshaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS = [\n 'EXT-X-TARGETDURATION',\n 'EXT-X-MEDIA-SEQUENCE',\n 'EXT-X-DISCONTINUITY-SEQUENCE',\n 'EXT-X-PLAYLIST-TYPE',\n 'EXT-X-MAP',\n 'EXT-X-I-FRAMES-ONLY'\n];\n\n\n/**\n * HLS tags that only appear on Segments in a Media Playlists.\n * Used to determine the start of the segments info.\n *\n * @const {!Array<!string>}\n */\nshaka.hls.ManifestTextParser.SEGMENT_TAGS = [\n 'EXTINF',\n 'EXT-X-BYTERANGE',\n 'EXT-X-DISCONTINUITY',\n 'EXT-X-PROGRAM-DATE-TIME',\n 'EXT-X-KEY',\n 'EXT-X-DATERANGE'\n];\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/manifest_text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.net.DataUriPlugin');\n\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * @namespace\n * @summary A networking plugin to handle data URIs.\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs\n * @param {string} uri\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.net.DataUriPlugin = function(uri, request) {\n return new Promise(function(resolve, reject) {\n var parsed = shaka.net.DataUriPlugin.parse(uri);\n\n /** @type {shakaExtern.Response} */\n var response = {\n uri: uri,\n data: parsed.data,\n headers: {\n 'content-type': parsed.contentType\n }\n };\n\n resolve(response);\n });\n};\n\n\n/**\n * @param {string} uri\n * @return {{data: ArrayBuffer, contentType: string}}\n */\nshaka.net.DataUriPlugin.parse = function(uri) {\n // Extract the scheme.\n var parts = uri.split(':');\n if (parts.length < 2 || parts[0] != 'data') {\n shaka.log.error('Bad data URI, failed to parse scheme');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_DATA_URI,\n uri);\n }\n var path = parts.slice(1).join(':');\n\n // Extract the encoding and MIME type (required but can be empty).\n var infoAndData = path.split(',');\n if (infoAndData.length < 2) {\n shaka.log.error('Bad data URI, failed to extract encoding and MIME type');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_DATA_URI,\n uri);\n }\n var info = infoAndData[0];\n var dataStr = window.decodeURIComponent(infoAndData.slice(1).join(','));\n\n // Extract the encoding (optional).\n var typeAndEncoding = info.split(';');\n var encoding = null;\n if (typeAndEncoding.length > 1)\n encoding = typeAndEncoding[1];\n\n // Convert the data.\n /** @type {ArrayBuffer} */\n var data;\n if (encoding == 'base64') {\n data = shaka.util.Uint8ArrayUtils.fromBase64(dataStr).buffer;\n } else if (encoding) {\n shaka.log.error('Bad data URI, unknown encoding');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.UNKNOWN_DATA_URI_ENCODING,\n uri);\n } else {\n data = shaka.util.StringUtils.toUTF8(dataStr);\n }\n\n return {data: data, contentType: typeAndEncoding[0]};\n};\n\n\nshaka.net.NetworkingEngine.registerScheme('data', shaka.net.DataUriPlugin);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/net/data_uri_plugin.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\ngoog.provide('shaka.hls.HlsParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.hls.ManifestTextParser');\ngoog.require('shaka.hls.Playlist');\ngoog.require('shaka.hls.PlaylistType');\ngoog.require('shaka.hls.Tag');\ngoog.require('shaka.hls.Utils');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.net.DataUriPlugin');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n\n/**\n * Creates a new HLS parser.\n *\n * @struct\n * @constructor\n * @implements {shakaExtern.ManifestParser}\n * @export\n */\nshaka.hls.HlsParser = function() {\n /** @private {?shakaExtern.ManifestParser.PlayerInterface} */\n this.playerInterface_ = null;\n\n /** @private {?shakaExtern.ManifestConfiguration} */\n this.config_ = null;\n\n /** @private {number} */\n this.globalId_ = 1;\n\n /** @private {!Object.<number, shaka.hls.HlsParser.StreamInfo>} */\n this.mediaTagsToStreamInfosMap_ = {};\n\n /** @private {!Object.<number, !shaka.media.SegmentIndex>} */\n this.streamsToIndexMap_ = {};\n\n /** @private {?shaka.media.PresentationTimeline} */\n this.presentationTimeline_ = null;\n\n /** @private {string} */\n this.manifestUri_ = '';\n\n /** @private {shaka.hls.ManifestTextParser} */\n this.manifestTextParser_ = new shaka.hls.ManifestTextParser();\n};\n\n\n/**\n * @typedef {{\n * stream: !shakaExtern.Stream,\n * segmentIndex: !shaka.media.SegmentIndex,\n * drmInfos: !Array.<shakaExtern.DrmInfo>\n * }}\n *\n * @description\n * Contains a stream and information about it.\n *\n * @property {!shakaExtern.Stream} stream\n * The Stream itself.\n * @property {!shaka.media.SegmentIndex} segmentIndex\n * SegmentIndex of the stream.\n * @property {!Array.<shakaExtern.DrmInfo>} drmInfos\n * DrmInfos of the stream. There may be multiple for multi-DRM content.\n */\nshaka.hls.HlsParser.StreamInfo;\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.configure = function(config) {\n this.config_ = config;\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.start = function(uri, playerInterface) {\n goog.asserts.assert(this.config_, 'Must call configure() before start()!');\n this.playerInterface_ = playerInterface;\n this.manifestUri_ = uri;\n return this.requestManifest_(uri).then(function(response) {\n return this.parseManifest_(response.data, uri);\n }.bind(this));\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.stop = function() {\n this.playerInterface_ = null;\n this.config_ = null;\n this.mediaTagsToStreamInfosMap_ = {};\n\n return Promise.resolve();\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.update = function() {\n // TODO: Implement support for live content.\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.onExpirationUpdated = function(\n sessionId, expiration) {\n // No-op\n};\n\n\n/**\n * Parses the manifest.\n *\n * @param {!ArrayBuffer} data\n * @param {string} uri\n * @return {!Promise.<!shakaExtern.Manifest>}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.hls.HlsParser.prototype.parseManifest_ = function(data, uri) {\n var playlist = this.manifestTextParser_.parsePlaylist(data, uri);\n\n // We don't support directly providing a Media Playlist.\n // See error code for details.\n if (playlist.type != shaka.hls.PlaylistType.MASTER) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_MASTER_PLAYLIST_NOT_PROVIDED);\n }\n\n // TODO: Implement support for live content.\n this.presentationTimeline_ = new shaka.media.PresentationTimeline(null, 0);\n return this.createPeriod_(playlist).then(function(period) {\n // HLS has no notion of periods. We're treating the whole presentation as\n // one period.\n this.playerInterface_.filterPeriod(period);\n return {\n presentationTimeline: this.presentationTimeline_,\n periods: [period],\n offlineSessionIds: [],\n minBufferTime: 0\n };\n }.bind(this));\n};\n\n\n/**\n * Parses a playlist into a Period object.\n *\n * @param {!shaka.hls.Playlist} playlist\n * @return {!Promise.<!shakaExtern.Period>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createPeriod_ = function(playlist) {\n var Utils = shaka.hls.Utils;\n var Functional = shaka.util.Functional;\n var tags = playlist.tags;\n\n // Create Variants for every 'EXT-X-STREAM-INF' tag.\n var variantTags = Utils.filterTagsByName(tags, 'EXT-X-STREAM-INF');\n var variantsPromises = variantTags.map(function(tag) {\n return this.createVariantsForTag_(tag, playlist);\n }.bind(this));\n\n var mediaTags = Utils.filterTagsByName(playlist.tags, 'EXT-X-MEDIA');\n var textStreamTags = mediaTags.filter(function(tag) {\n var type = shaka.hls.HlsParser.getRequiredAttributeValue_(tag, 'TYPE');\n return type == 'SUBTITLES';\n }.bind(this));\n\n // TODO: CLOSED-CAPTIONS requires the parsing of CEA-608 from the video.\n var textStreamPromises = textStreamTags.map(function(tag) {\n return this.createTextStream_(tag, playlist);\n }.bind(this));\n\n return Promise.all(variantsPromises).then(function(allVariants) {\n return Promise.all(textStreamPromises).then(function(textStreams) {\n var variants = allVariants.reduce(Functional.collapseArrays, []);\n this.fitSegments_(variants);\n return {\n startTime: 0,\n variants: variants,\n textStreams: textStreams\n };\n }.bind(this));\n }.bind(this));\n};\n\n\n/**\n * @param {!shaka.hls.Tag} tag\n * @param {!shaka.hls.Playlist} playlist\n * @return {!Promise.<!Array.<!shakaExtern.Variant>>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createVariantsForTag_ = function(tag, playlist) {\n goog.asserts.assert(tag.name == 'EXT-X-STREAM-INF',\n 'Should only be called on variant tags!');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var HlsParser = shaka.hls.HlsParser;\n var Utils = shaka.hls.Utils;\n var bandwidth =\n Number(HlsParser.getRequiredAttributeValue_(tag, 'BANDWIDTH'));\n\n // These are the default codecs to assume if none are specified.\n //\n // The video codec is H.264, with baseline profile and level 3.0.\n // http://blog.pearce.org.nz/2013/11/what-does-h264avc1-codecs-parameters.html\n //\n // The audio codec is \"low-complexity\" AAC.\n var defaultCodecs = 'avc1.42E01E,mp4a.40.2';\n\n var codecs = tag.getAttributeValue('CODECS', defaultCodecs).split(',');\n var resolutionAttr = tag.getAttribute('RESOLUTION');\n var width = null;\n var height = null;\n var frameRate = tag.getAttributeValue('FRAME-RATE');\n\n if (resolutionAttr) {\n var resBlocks = resolutionAttr.value.split('x');\n width = resBlocks[0];\n height = resBlocks[1];\n }\n\n var timeOffset = this.getTimeOffset_(playlist);\n\n var mediaTags = Utils.filterTagsByName(playlist.tags, 'EXT-X-MEDIA');\n\n var audioGroupId = tag.getAttributeValue('AUDIO');\n var videoGroupId = tag.getAttributeValue('VIDEO');\n goog.asserts.assert(audioGroupId == null || videoGroupId == null,\n 'Unexpected: both video and audio described by media tags!');\n\n // Find any associated audio or video groups and create streams for them.\n if (audioGroupId) {\n mediaTags = Utils.findMediaTags(mediaTags, 'AUDIO', audioGroupId);\n } else if (videoGroupId) {\n mediaTags = Utils.findMediaTags(mediaTags, 'VIDEO', videoGroupId);\n }\n var promises = mediaTags.map(function(tag) {\n return this.createStreamInfoFromMediaTag_(tag, codecs, timeOffset);\n }.bind(this));\n\n var audioStreamInfos = [];\n var videoStreamInfos = [];\n\n return Promise.all(promises).then(function(data) {\n if (audioGroupId) {\n audioStreamInfos = data;\n } else if (videoGroupId) {\n videoStreamInfos = data;\n }\n\n // Make an educated guess about the stream type.\n shaka.log.debug('Guessing stream type for', tag.toString());\n var type;\n if (!audioStreamInfos.length && !videoStreamInfos.length) {\n // There are no associated streams. This is either an audio-only stream,\n // a video-only stream, or a multiplexed stream.\n\n if (codecs.length == 1) {\n // There is only one codec, so it shouldn't be multiplexed.\n if (resolutionAttr || frameRate) {\n // Assume video-only.\n shaka.log.debug('Guessing video-only.');\n type = ContentType.VIDEO;\n } else {\n // Assume audio-only.\n shaka.log.debug('Guessing audio-only.');\n type = ContentType.AUDIO;\n }\n } else {\n // There are multiple codecs, so assume multiplexed content.\n // Note that the default used when CODECS is missing assumes multiple\n // (and therefore multiplexed).\n // Recombine the codec strings into one so that MediaSource isn't\n // lied to later. (That would trigger an error in Chrome.)\n shaka.log.debug('Guessing multiplexed audio+video.');\n type = ContentType.VIDEO;\n codecs = [codecs.join(',')];\n }\n } else if (audioStreamInfos.length) {\n // There are associated audio streams. Assume this is video.\n shaka.log.debug('Guessing video.');\n type = ContentType.VIDEO;\n } else {\n // There are associated video streams. Assume this is audio.\n goog.asserts.assert(videoStreamInfos.length,\n 'No video streams! This should have been handled already!');\n shaka.log.debug('Guessing audio.');\n type = ContentType.AUDIO;\n }\n\n goog.asserts.assert(type, 'Type should have been set by now!');\n return this.createStreamInfoFromVariantTag_(tag, codecs, type, timeOffset);\n }.bind(this)).then(function(streamInfo) {\n goog.asserts.assert(streamInfo, 'We should have created a stream!');\n if (streamInfo.stream.type == ContentType.AUDIO) {\n audioStreamInfos = [streamInfo];\n } else {\n videoStreamInfos = [streamInfo];\n }\n\n return this.createVariants_(\n audioStreamInfos,\n videoStreamInfos,\n bandwidth,\n width,\n height,\n frameRate);\n }.bind(this));\n};\n\n\n/**\n * @param {!Array.<!shaka.hls.HlsParser.StreamInfo>} audioInfos\n * @param {!Array.<!shaka.hls.HlsParser.StreamInfo>} videoInfos\n * @param {number} bandwidth\n * @param {?string} width\n * @param {?string} height\n * @param {?string} frameRate\n * @return {!Array.<!shakaExtern.Variant>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createVariants_ =\n function(audioInfos, videoInfos, bandwidth, width, height, frameRate) {\n var DrmEngine = shaka.media.DrmEngine;\n\n videoInfos.forEach(function(info) {\n this.addVideoAttributes_(info.stream, width, height, frameRate);\n }.bind(this));\n\n // In case of audio-only or video-only content, we create an array of\n // one item containing a null. This way, the double-loop works for all\n // kinds of content.\n // NOTE: we currently don't have support for audio-only content.\n if (!audioInfos.length)\n audioInfos = [null];\n if (!videoInfos.length)\n videoInfos = [null];\n\n var variants = [];\n for (var i = 0; i < audioInfos.length; i++) {\n for (var j = 0; j < videoInfos.length; j++) {\n var audioStream = audioInfos[i] ? audioInfos[i].stream : null;\n var videoStream = videoInfos[j] ? videoInfos[j].stream : null;\n var audioDrmInfos = audioInfos[i] ? audioInfos[i].drmInfos : null;\n var videoDrmInfos = videoInfos[j] ? videoInfos[j].drmInfos : null;\n\n var drmInfos;\n if (audioStream && videoStream) {\n if (DrmEngine.areDrmCompatible(audioDrmInfos, videoDrmInfos)) {\n drmInfos = DrmEngine.getCommonDrmInfos(audioDrmInfos, videoDrmInfos);\n } else {\n shaka.log.warning('Incompatible DRM info in HLS variant. Skipping.');\n continue;\n }\n } else if (audioStream) {\n drmInfos = audioDrmInfos;\n } else if (videoStream) {\n drmInfos = videoDrmInfos;\n }\n\n variants.push(this.createVariant_(\n audioStream, videoStream, bandwidth, drmInfos));\n }\n }\n return variants;\n};\n\n\n/**\n * @param {shakaExtern.Stream} audio\n * @param {shakaExtern.Stream} video\n * @param {number} bandwidth\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @return {!shakaExtern.Variant}\n * @private\n */\nshaka.hls.HlsParser.prototype.createVariant_ =\n function(audio, video, bandwidth, drmInfos) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Since both audio and video are of the same type, this assertion will catch\n // certain mistakes at runtime that the compiler would miss.\n goog.asserts.assert(!audio || audio.type == ContentType.AUDIO,\n 'Audio parameter mismatch!');\n goog.asserts.assert(!video || video.type == ContentType.VIDEO,\n 'Video parameter mismatch!');\n\n return {\n id: this.globalId_++,\n language: audio ? audio.language : 'und',\n primary: (!!audio && audio.primary) || (!!video && video.primary),\n audio: audio,\n video: video,\n bandwidth: bandwidth,\n drmInfos: drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n};\n\n\n/**\n * Parses an EXT-X-MEDIA tag with TYPE=\"SUBTITLES\" into a text stream.\n *\n * @param {!shaka.hls.Tag} tag\n * @param {!shaka.hls.Playlist} playlist\n * @return {!Promise.<?shakaExtern.Stream>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createTextStream_ = function(tag, playlist) {\n goog.asserts.assert(tag.name == 'EXT-X-MEDIA',\n 'Should only be called on media tags!');\n\n var type = shaka.hls.HlsParser.getRequiredAttributeValue_(tag, 'TYPE');\n goog.asserts.assert(type == 'SUBTITLES',\n 'Should only be called on tags with TYPE=\"SUBTITLES\"!');\n\n var timeOffset = this.getTimeOffset_(playlist);\n return this.createStreamInfoFromMediaTag_(tag, [], timeOffset)\n .then(function(streamInfo) {\n return streamInfo.stream;\n });\n};\n\n\n/**\n * Parse EXT-X-MEDIA media tag into a Stream object.\n *\n * @param {shaka.hls.Tag} tag\n * @param {!Array.<!string>} allCodecs\n * @param {?number} timeOffset\n * @return {!Promise.<shaka.hls.HlsParser.StreamInfo>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createStreamInfoFromMediaTag_ =\n function(tag, allCodecs, timeOffset) {\n goog.asserts.assert(tag.name == 'EXT-X-MEDIA',\n 'Should only be called on media tags!');\n\n // Check if the stream has already been created as part of another Variant\n // and return it if it has.\n if (this.mediaTagsToStreamInfosMap_[tag.id]) {\n return Promise.resolve().then(function() {\n return this.mediaTagsToStreamInfosMap_[tag.id];\n }.bind(this));\n }\n\n var HlsParser = shaka.hls.HlsParser;\n var type = HlsParser.getRequiredAttributeValue_(tag, 'TYPE').toLowerCase();\n // Shaka recognizes content types 'audio', 'video' and 'text'.\n // HLS 'subtitles' type needs to be mapped to 'text'.\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (type == 'subtitles') type = ContentType.TEXT;\n\n var LanguageUtils = shaka.util.LanguageUtils;\n var language = LanguageUtils.normalize(/** @type {string} */(\n tag.getAttributeValue('LANGUAGE', 'und')));\n var label = tag.getAttributeValue('NAME');\n\n var defaultAttr = tag.getAttribute('DEFAULT');\n var autoselectAttr = tag.getAttribute('AUTOSELECT');\n // TODO: Should we take into account some of the currently ignored attributes:\n // FORCED, INSTREAM-ID, CHARACTERISTICS, CHANNELS?\n // Attribute descriptions:\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-4.3.4.1\n\n var uri = HlsParser.getRequiredAttributeValue_(tag, 'URI');\n var primary = !!defaultAttr || !!autoselectAttr;\n return this.createStreamInfo_(uri, allCodecs, type, timeOffset, language,\n primary, label).then(function(streamInfo) {\n this.mediaTagsToStreamInfosMap_[tag.id] = streamInfo;\n return streamInfo;\n }.bind(this));\n};\n\n\n/**\n * Parse EXT-X-STREAM-INF media tag into a Stream object.\n *\n * @param {!shaka.hls.Tag} tag\n * @param {!Array.<!string>} allCodecs\n * @param {!string} type\n * @param {?number} timeOffset\n * @return {!Promise.<shaka.hls.HlsParser.StreamInfo>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createStreamInfoFromVariantTag_ =\n function(tag, allCodecs, type, timeOffset) {\n goog.asserts.assert(tag.name == 'EXT-X-STREAM-INF',\n 'Should only be called on media tags!');\n\n var uri = shaka.hls.HlsParser.getRequiredAttributeValue_(tag, 'URI');\n return this.createStreamInfo_(uri, allCodecs, type, timeOffset,\n /* language */ 'und', /* primary */ false,\n /* label */ null);\n};\n\n\n/**\n * @param {!string} uri\n * @param {!Array.<!string>} allCodecs\n * @param {!string} type\n * @param {?number} timeOffset\n * @param {!string} language\n * @param {boolean} primary\n * @param {?string} label\n * @return {!Promise.<shaka.hls.HlsParser.StreamInfo>}\n * @throws shaka.util.Error\n * @private\n */\nshaka.hls.HlsParser.prototype.createStreamInfo_ =\n function(uri, allCodecs, type, timeOffset, language, primary, label) {\n var Utils = shaka.hls.Utils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var HlsParser = shaka.hls.HlsParser;\n uri = Utils.constructAbsoluteUri(this.manifestUri_, uri);\n\n return this.requestManifest_(uri).then(function(response) {\n var playlistData = response.data;\n var playlist = this.manifestTextParser_.parsePlaylist(playlistData,\n response.uri);\n if (playlist.type != shaka.hls.PlaylistType.MEDIA) {\n // EXT-X-MEDIA tags should point to media playlists.\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY);\n }\n\n goog.asserts.assert(playlist.segments != null,\n 'Media playlist should have segments!');\n\n // Time offset can be specified on either Master or Media Playlist.\n // If Media Playlist provides it's own value, use that.\n // Otherwise, use value from the Master Playlist. If no offset\n // has been provided it will default to\n // this.config_.hls.defaultTimeOffset.\n var mediaPlaylistTimeOffset = this.getTimeOffset_(playlist);\n timeOffset = mediaPlaylistTimeOffset || timeOffset;\n\n var initSegmentReference = null;\n if (type != ContentType.TEXT) {\n initSegmentReference = this.createInitSegmentReference_(playlist);\n }\n var mediaSequenceTag = Utils.getFirstTagWithName(playlist.tags,\n 'EXT-X-MEDIA-SEQUENCE');\n\n var startPosition = mediaSequenceTag ? Number(mediaSequenceTag.value) : 0;\n var segments = this.createSegments_(playlist, startPosition);\n\n this.presentationTimeline_.notifySegments(0, segments);\n var duration =\n segments[segments.length - 1].endTime - segments[0].startTime;\n var presentationDuration = this.presentationTimeline_.getDuration();\n if (presentationDuration == Infinity || presentationDuration < duration) {\n this.presentationTimeline_.setDuration(duration);\n }\n var codecs = this.guessCodecs_(type, allCodecs);\n\n var kind = undefined;\n\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n if (type == ManifestParserUtils.ContentType.TEXT)\n kind = ManifestParserUtils.TextStreamKind.SUBTITLE;\n // TODO: CLOSED-CAPTIONS requires the parsing of CEA-608 from the video.\n\n var segmentIndex = new shaka.media.SegmentIndex(segments);\n\n var drmTags = [];\n playlist.segments.forEach(function(segment) {\n var segmentKeyTags = Utils.filterTagsByName(segment.tags, 'EXT-X-KEY');\n drmTags.push.apply(drmTags, segmentKeyTags);\n });\n\n var encrypted = false;\n var drmInfos = [];\n var keyId = null;\n\n // TODO: may still need changes to support key rotation\n drmTags.forEach(function(drmTag) {\n var method = HlsParser.getRequiredAttributeValue_(drmTag, 'METHOD');\n if (method != 'NONE') {\n encrypted = true;\n\n var keyFormat =\n HlsParser.getRequiredAttributeValue_(drmTag, 'KEYFORMAT');\n var drmParser =\n shaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_[keyFormat];\n\n var drmInfo = drmParser ? drmParser(drmTag) : null;\n if (drmInfo) {\n if (drmInfo.keyIds.length) {\n keyId = drmInfo.keyIds[0];\n }\n drmInfos.push(drmInfo);\n } else {\n shaka.log.warning('Unsupported HLS KEYFORMAT', keyFormat);\n }\n }\n });\n\n if (encrypted && !drmInfos.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_KEYFORMATS_NOT_SUPPORTED);\n }\n\n return this.guessMimeType_(type, segments[0].getUris()[0])\n .then(function(mimeType) {\n var stream = {\n id: this.globalId_++,\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex),\n initSegmentReference: initSegmentReference,\n presentationTimeOffset: timeOffset || 0,\n mimeType: mimeType,\n codecs: codecs,\n kind: kind,\n encrypted: encrypted,\n keyId: keyId,\n language: language,\n label: label || null,\n type: type,\n primary: primary,\n // TODO: trick mode\n trickModeVideo: null,\n containsEmsgBoxes: false,\n frameRate: undefined,\n width: undefined,\n height: undefined,\n bandwidth: undefined,\n roles: []\n };\n\n this.streamsToIndexMap_[stream.id] = segmentIndex;\n\n return {\n stream: stream,\n segmentIndex: segmentIndex,\n drmInfos: drmInfos\n };\n }.bind(this));\n }.bind(this));\n\n};\n\n\n/**\n * @param {!shaka.hls.Playlist} playlist\n * @return {shaka.media.InitSegmentReference}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.createInitSegmentReference_ = function(playlist) {\n var Utils = shaka.hls.Utils;\n var mapTags = Utils.filterTagsByName(playlist.tags, 'EXT-X-MAP');\n // TODO: Support multiple map tags?\n // For now, we don't support multiple map tags and will throw an error.\n if (!mapTags.length) {\n return null;\n } else if (mapTags.length > 1) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND);\n }\n\n // Map tag example: #EXT-X-MAP:URI=\"main.mp4\",BYTERANGE=\"720@0\"\n var mapTag = mapTags[0];\n var initUri = shaka.hls.HlsParser.getRequiredAttributeValue_(mapTag, 'URI');\n var uri = Utils.constructAbsoluteUri(playlist.uri, initUri);\n var startByte = 0;\n var endByte = null;\n var byterange = mapTag.getAttributeValue('BYTERANGE');\n // If BYTERANGE attribute is not specified, the segment consists\n // of the entire resourse.\n if (byterange) {\n var blocks = byterange.split('@');\n var byteLength = Number(blocks[0]);\n startByte = Number(blocks[1]);\n endByte = startByte + byteLength - 1;\n }\n\n return new shaka.media.InitSegmentReference(function() { return [uri]; },\n startByte,\n endByte);\n};\n\n\n/**\n * Parses shaka.hls.Segment objects into shaka.media.SegmentReferences.\n *\n * @param {!shaka.hls.Playlist} playlist\n * @param {number} startPosition\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createSegments_ =\n function(playlist, startPosition) {\n var hlsSegments = playlist.segments;\n var segments = [];\n\n hlsSegments.forEach(function(segment) {\n var Utils = shaka.hls.Utils;\n var tags = segment.tags;\n var uri = Utils.constructAbsoluteUri(playlist.uri, segment.uri);\n\n // Start and end times\n var extinfTag = this.getRequiredTag_(tags, 'EXTINF');\n // EXTINF tag format is '#EXTINF:<duration>,[<title>]'.\n // We're interested in the duration part.\n var extinfValues = extinfTag.value.split(',');\n var duration = Number(extinfValues[0]);\n var startTime;\n var index = hlsSegments.indexOf(segment);\n if (index == 0) {\n startTime = 0;\n } else {\n startTime = segments[index - 1].endTime;\n }\n var endTime = startTime + duration;\n\n // StartByte and EndByte\n var startByte = 0;\n var endByte = null;\n var byterange = Utils.getFirstTagWithName(tags, 'EXT-X-BYTERANGE');\n // If BYTERANGE is not specified, the segment consists of the\n // entire resourse.\n if (byterange) {\n var blocks = byterange.value.split('@');\n var byteLength = Number(blocks[0]);\n if (blocks[1]) {\n startByte = Number(blocks[1]);\n } else {\n startByte = segments[index - 1].endByte;\n }\n endByte = startByte + byteLength - 1;\n\n // Last segment has endByte of null to indicate that it extends\n // to the end of the resource.\n if (index == hlsSegments.length - 1)\n endByte = null;\n }\n segments.push(new shaka.media.SegmentReference(startPosition + index,\n startTime,\n endTime,\n function() { return [uri]; },\n startByte,\n endByte));\n }.bind(this));\n\n return segments;\n};\n\n\n/**\n * Adjusts segment references of every stream of every variant to the\n * timeline of the presentation.\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @private\n */\nshaka.hls.HlsParser.prototype.fitSegments_ = function(variants) {\n variants.forEach(function(variant) {\n var duration = this.presentationTimeline_.getDuration();\n var video = variant.video;\n var audio = variant.audio;\n if (video && this.streamsToIndexMap_[video.id]) {\n this.streamsToIndexMap_[video.id].fit(duration);\n }\n if (audio && this.streamsToIndexMap_[audio.id]) {\n this.streamsToIndexMap_[audio.id].fit(duration);\n }\n }.bind(this));\n};\n\n\n/**\n * Attempts to guess which codecs from the codecs list belong\n * to a given content type.\n *\n * @param {!string} contentType\n * @param {!Array.<!string>} codecs\n * @return {string}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.guessCodecs_ = function(contentType, codecs) {\n if (codecs.length == 1) {\n return codecs[0];\n }\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return '';\n }\n\n var HlsParser = shaka.hls.HlsParser;\n var formats = HlsParser.VIDEO_CODEC_FORMATS_;\n if (contentType == ContentType.AUDIO)\n formats = HlsParser.AUDIO_CODEC_FORMATS_;\n\n for (var i = 0; i < formats.length; i++) {\n for (var j = 0; j < codecs.length; j++) {\n if (formats[i].test(codecs[j].trim())) {\n return codecs[j].trim();\n }\n }\n }\n\n // Unable to guess codecs.\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_COULD_NOT_GUESS_CODECS,\n codecs);\n};\n\n\n/**\n * Attempts to guess stream's mime type based on content type and uri.\n *\n * @param {!string} contentType\n * @param {!string} uri\n * @return {!Promise.<!string>}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.guessMimeType_ = function(contentType, uri) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var blocks = uri.split('.');\n var extension = blocks[blocks.length - 1];\n\n if (contentType == ContentType.TEXT) {\n // HLS only supports vtt at the moment.\n return Promise.resolve('text/vtt');\n }\n\n var HlsParser = shaka.hls.HlsParser;\n var map = HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_;\n if (contentType == ContentType.VIDEO)\n map = HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_;\n\n var mimeType = map[extension];\n if (mimeType)\n return Promise.resolve(mimeType);\n\n // If unable to guess mime type, request a segment and try getting it\n // from the response.\n var headRequest = shaka.net.NetworkingEngine.makeRequest(\n [uri], this.config_.retryParameters);\n headRequest.method = 'HEAD';\n var requestType = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n return this.playerInterface_.networkingEngine.request(\n requestType, headRequest)\n .then(function(response) {\n var mimeType = response.headers['content-type'];\n if (!mimeType) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_COULD_NOT_GUESS_MIME_TYPE,\n extension);\n }\n\n return mimeType;\n });\n};\n\n\n/**\n * Get presentation time offset of the playlist if it has been specified.\n * Return null otherwise.\n *\n * @param {!shaka.hls.Playlist} playlist\n * @return {?number}\n * @private\n */\nshaka.hls.HlsParser.prototype.getTimeOffset_ = function(playlist) {\n var Utils = shaka.hls.Utils;\n var startTag = Utils.getFirstTagWithName(playlist.tags, 'EXT-X-START');\n // TODO: Should we respect the PRECISE flag?\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-4.3.5.2\n if (startTag)\n return Number(shaka.hls.HlsParser.getRequiredAttributeValue_(\n startTag, 'TIME-OFFSET'));\n\n return this.config_.hls.defaultTimeOffset;\n};\n\n\n/**\n * Find the attribute and returns its value.\n * Throws an error if attribute was not found.\n *\n * @param {shaka.hls.Tag} tag\n * @param {!string} attributeName\n * @return {!string}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.getRequiredAttributeValue_ =\n function(tag, attributeName) {\n var attribute = tag.getAttribute(attributeName);\n if (!attribute) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_REQUIRED_ATTRIBUTE_MISSING,\n attributeName);\n }\n\n return attribute.value;\n};\n\n\n/**\n * Returns a tag with a given name.\n * Throws an error if tag was not found.\n *\n * @param {!Array.<shaka.hls.Tag>} tags\n * @param {!string} tagName\n * @return {!shaka.hls.Tag}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.getRequiredTag_ = function(tags, tagName) {\n var Utils = shaka.hls.Utils;\n var tag = Utils.getFirstTagWithName(tags, tagName);\n if (!tag) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_REQUIRED_TAG_MISSING, tagName);\n }\n\n return tag;\n};\n\n\n/**\n * @param {shakaExtern.Stream} stream\n * @param {?string} width\n * @param {?string} height\n * @param {?string} frameRate\n * @private\n */\nshaka.hls.HlsParser.prototype.addVideoAttributes_ =\n function(stream, width, height, frameRate) {\n if (stream) {\n stream.width = Number(width) || undefined;\n stream.height = Number(height) || undefined;\n stream.frameRate = Number(frameRate) || undefined;\n }\n};\n\n\n/**\n * Makes a network request for the manifest and returns a Promise\n * with the resulting data.\n *\n * @param {!string} uri\n * @return {!Promise.<!shakaExtern.Response>}\n * @private\n */\nshaka.hls.HlsParser.prototype.requestManifest_ = function(uri) {\n var requestType = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n var request = shaka.net.NetworkingEngine.makeRequest(\n [uri], this.config_.retryParameters);\n return this.playerInterface_.networkingEngine.request(requestType, request);\n};\n\n\n/**\n * A list of well-known video codecs formats.\n *\n * @const {!Array<!RegExp>}\n * @private\n */\nshaka.hls.HlsParser.VIDEO_CODEC_FORMATS_ = [\n /^(avc)/,\n /^(hvc)/,\n /^(vp[8-9])$/,\n /^(av1)$/,\n /^(mp4v)/\n];\n\n\n/**\n * A list of well-known audio codecs formats.\n *\n * @const {!Array<!RegExp>}\n * @private\n */\nshaka.hls.HlsParser.AUDIO_CODEC_FORMATS_ = [\n /^(vorbis)/,\n /^(opus)/,\n /^(mp4a)/,\n /^(ac-3)$/,\n /^(ec-3)$/\n];\n\n\n/**\n * @const {!Object<string, string>}\n * @private\n */\nshaka.hls.HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_ = {\n 'mp4': 'audio/mp4',\n 'm4s': 'audio/mp4',\n 'm4i': 'audio/mp4',\n 'm4a': 'audio/mp4',\n // mpeg2 ts aslo uses video/ for audio: http://goo.gl/tYHXiS\n 'ts': 'video/mp2t'\n};\n\n\n/**\n * @const {!Object<string, string>}\n * @private\n */\nshaka.hls.HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_ = {\n 'mp4': 'video/mp4',\n 'm4s': 'video/mp4',\n 'm4i': 'video/mp4',\n 'm4v': 'video/mp4',\n 'ts': 'video/mp2t'\n};\n\n\n/**\n * @typedef {function(!shaka.hls.Tag):?shakaExtern.DrmInfo}\n * @private\n */\nshaka.hls.HlsParser.DrmParser_;\n\n\n/**\n * @param {!shaka.hls.Tag} drmTag\n * @return {?shakaExtern.DrmInfo}\n * @private\n */\nshaka.hls.HlsParser.widevineDrmParser_ = function(drmTag) {\n var HlsParser = shaka.hls.HlsParser;\n var method = HlsParser.getRequiredAttributeValue_(drmTag, 'METHOD');\n if (method != 'SAMPLE-AES-CENC') {\n shaka.log.error(\n 'Widevine in HLS is only supported with SAMPLE-AES-CENC, not', method);\n return null;\n }\n\n var uri = HlsParser.getRequiredAttributeValue_(drmTag, 'URI');\n var parsedData = shaka.net.DataUriPlugin.parse(uri);\n\n // The data encoded in the URI is a PSSH box to be used as init data.\n var pssh = new Uint8Array(parsedData.data);\n var drmInfo = shaka.util.ManifestParserUtils.createDrmInfo(\n 'com.widevine.alpha', [\n {initDataType: 'cenc', initData: pssh}\n ]);\n\n var keyId = drmTag.getAttributeValue('KEYID');\n if (keyId) {\n // This value begins with '0x':\n goog.asserts.assert(keyId.substr(0, 2) == '0x',\n 'Incorrect KEYID format!');\n // But the output does not contain the '0x':\n drmInfo.keyIds = [keyId.substr(2).toLowerCase()];\n }\n return drmInfo;\n};\n\n\n/**\n * @const {!Object.<string, shaka.hls.HlsParser.DrmParser_>}\n * @private\n */\nshaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_ = {\n /* TODO: https://github.com/google/shaka-player/issues/382\n 'com.apple.streamingkeydelivery':\n shaka.hls.HlsParser.fairplayDrmParser_,\n */\n 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed':\n shaka.hls.HlsParser.widevineDrmParser_\n};\n\n\nshaka.media.ManifestParser.registerParserByExtension(\n 'm3u8', shaka.hls.HlsParser);\nshaka.media.ManifestParser.registerParserByMime(\n 'application/x-mpegurl', shaka.hls.HlsParser);\nshaka.media.ManifestParser.registerParserByMime(\n 'application/vnd.apple.mpegurl', shaka.hls.HlsParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/hls_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.TtmlTextParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\n\n\n\n/**\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.TtmlTextParser = function() {};\n\n\n/** @override */\nshaka.media.TtmlTextParser.prototype.parseInit = function(data) {\n goog.asserts.assert(false, 'TTML does not have init segments');\n};\n\n\n/** @override */\nshaka.media.TtmlTextParser.prototype.parseMedia = function(data, time) {\n var str = shaka.util.StringUtils.fromUTF8(data);\n var ret = [];\n var parser = new DOMParser();\n var xml = null;\n\n try {\n xml = parser.parseFromString(str, 'text/xml');\n } catch (exception) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_XML);\n }\n\n if (xml) {\n // Try to get the framerate, subFrameRate and frameRateMultiplier\n // if applicable\n var frameRate = null;\n var subFrameRate = null;\n var frameRateMultiplier = null;\n var tickRate = null;\n var spaceStyle = null;\n var tts = xml.getElementsByTagName('tt');\n var tt = tts[0];\n // TTML should always have tt element\n if (!tt) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_XML);\n } else {\n frameRate = tt.getAttribute('ttp:frameRate');\n subFrameRate = tt.getAttribute('ttp:subFrameRate');\n frameRateMultiplier = tt.getAttribute('ttp:frameRateMultiplier');\n tickRate = tt.getAttribute('ttp:tickRate');\n spaceStyle = tt.getAttribute('xml:space') || 'default';\n }\n\n if (spaceStyle != 'default' && spaceStyle != 'preserve') {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_XML);\n }\n var whitespaceTrim = spaceStyle == 'default';\n\n var rateInfo = new shaka.media.TtmlTextParser.RateInfo_(\n frameRate, subFrameRate, frameRateMultiplier, tickRate);\n\n var styles = shaka.media.TtmlTextParser.getLeafNodes_(\n tt.getElementsByTagName('styling')[0]);\n var regions = shaka.media.TtmlTextParser.getLeafNodes_(\n tt.getElementsByTagName('layout')[0]);\n var textNodes = shaka.media.TtmlTextParser.getLeafNodes_(\n tt.getElementsByTagName('body')[0]);\n\n for (var i = 0; i < textNodes.length; i++) {\n var cue = shaka.media.TtmlTextParser.parseCue_(textNodes[i],\n time.periodStart,\n rateInfo,\n styles,\n regions,\n whitespaceTrim);\n if (cue)\n ret.push(cue);\n }\n }\n\n return ret;\n};\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 00:00:40:07 (7 frames) or 00:00:40:07.1 (7 frames, 1 subframe)\n */\nshaka.media.TtmlTextParser.timeColonFormatFrames_ =\n /^(\\d{2,}):(\\d{2}):(\\d{2}):(\\d{2})\\.?(\\d+)?$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 00:00:40 or 00:40\n */\nshaka.media.TtmlTextParser.timeColonFormat_ =\n /^(?:(\\d{2,}):)?(\\d{2}):(\\d{2})$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * example 01:02:43.0345555 or 02:43.03\n */\nshaka.media.TtmlTextParser.timeColonFormatMilliseconds_ =\n /^(?:(\\d{2,}):)?(\\d{2}):(\\d{2}\\.\\d{2,})$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 75f or 75.5f\n */\nshaka.media.TtmlTextParser.timeFramesFormat_ = /^(\\d*\\.?\\d*)f$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 50t or 50.5t\n */\nshaka.media.TtmlTextParser.timeTickFormat_ = /^(\\d*\\.?\\d*)t$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 3.45h, 3m or 4.20s\n */\nshaka.media.TtmlTextParser.timeHMSFormat_ =\n /^(?:(\\d*\\.?\\d*)h)?(?:(\\d*\\.?\\d*)m)?(?:(\\d*\\.?\\d*)s)?(?:(\\d*\\.?\\d*)ms)?$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 50% 10%\n */\nshaka.media.TtmlTextParser.percentValues_ = /^(\\d{1,2}|100)% (\\d{1,2}|100)%$/;\n\n\n/**\n * @const\n * @private {!Object}\n */\nshaka.media.TtmlTextParser.textAlignToLineAlign_ = {\n 'left': 'start',\n 'center': 'center',\n 'right': 'end',\n 'start': 'start',\n 'end': 'end'\n};\n\n\n/**\n * @const\n * @private {!Object}\n */\nshaka.media.TtmlTextParser.textAlignToPositionAlign_ = {\n 'left': 'line-left',\n 'center': 'center',\n 'right': 'line-right'\n};\n\n\n/**\n * Gets leaf nodes of the xml node tree. Ignores the text, br elements\n * and the spans positioned inside paragraphs\n *\n * @param {Element} element\n * @return {!Array.<!Element>}\n * @private\n */\nshaka.media.TtmlTextParser.getLeafNodes_ = function(element) {\n var result = [];\n if (!element)\n return result;\n\n var childNodes = element.childNodes;\n for (var i = 0; i < childNodes.length; i++) {\n // Currently we don't support styles applicable to span\n // elements, so they are ignored\n var isSpanChildOfP = childNodes[i].nodeName == 'span' &&\n element.nodeName == 'p';\n if (childNodes[i].nodeType == Node.ELEMENT_NODE &&\n childNodes[i].nodeName != 'br' && !isSpanChildOfP) {\n // Get the leafs the child might contain\n goog.asserts.assert(childNodes[i] instanceof Element,\n 'Node should be Element!');\n var leafChildren = shaka.media.TtmlTextParser.getLeafNodes_(\n /** @type {Element} */(childNodes[i]));\n goog.asserts.assert(leafChildren.length > 0,\n 'Only a null Element should return no leaves!');\n result = result.concat(leafChildren);\n }\n }\n\n // if no result at this point, the element itself must be a leaf\n if (!result.length) {\n result.push(element);\n }\n return result;\n};\n\n\n/**\n * Insert \\n where <br> tags are found\n *\n * @param {!Node} element\n * @param {boolean} whitespaceTrim\n * @private\n */\nshaka.media.TtmlTextParser.addNewLines_ = function(element, whitespaceTrim) {\n var childNodes = element.childNodes;\n\n for (var i = 0; i < childNodes.length; i++) {\n if (childNodes[i].nodeName == 'br' && i > 0) {\n childNodes[i - 1].textContent += '\\n';\n } else if (childNodes[i].childNodes.length > 0) {\n shaka.media.TtmlTextParser.addNewLines_(childNodes[i], whitespaceTrim);\n } else if (whitespaceTrim) {\n // Trim leading and trailing whitespace.\n var trimmed = childNodes[i].textContent.trim();\n // Collapse multiple spaces into one.\n trimmed = trimmed.replace(/\\s+/g, ' ');\n\n childNodes[i].textContent = trimmed;\n }\n }\n};\n\n\n/**\n * Parses an Element into a TextTrackCue or VTTCue.\n *\n * @param {!Element} cueElement\n * @param {number} offset\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {!Array.<!Element>} styles\n * @param {!Array.<!Element>} regions\n * @param {boolean} whitespaceTrim\n * @return {TextTrackCue}\n * @private\n */\nshaka.media.TtmlTextParser.parseCue_ = function(\n cueElement, offset, rateInfo, styles, regions, whitespaceTrim) {\n\n // Disregard empty elements:\n // TTML allows for empty elements like <div></div>.\n // If cueElement has neither time attributes, nor\n // non-whitespace text, don't try to make a cue out of it.\n if (!cueElement.hasAttribute('begin') &&\n !cueElement.hasAttribute('end') &&\n /^\\s*$/.test(cueElement.textContent))\n return null;\n\n shaka.media.TtmlTextParser.addNewLines_(cueElement, whitespaceTrim);\n\n // Get time\n var start = shaka.media.TtmlTextParser.parseTime_(\n cueElement.getAttribute('begin'), rateInfo);\n var end = shaka.media.TtmlTextParser.parseTime_(\n cueElement.getAttribute('end'), rateInfo);\n var duration = shaka.media.TtmlTextParser.parseTime_(\n cueElement.getAttribute('dur'), rateInfo);\n var payload = cueElement.textContent;\n\n if (end == null && duration != null)\n end = start + duration;\n\n if (start == null || end == null) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_TEXT_CUE);\n }\n\n start += offset;\n end += offset;\n\n var cue = shaka.media.TextEngine.makeCue(start, end, payload);\n if (!cue)\n return null;\n\n // Get other properties if available\n var region = shaka.media.TtmlTextParser.getElementFromCollection_(\n cueElement, 'region', regions);\n shaka.media.TtmlTextParser.addStyle_(cue, cueElement, region, styles);\n\n return cue;\n};\n\n\n/**\n * Adds applicable style properties to a cue.\n *\n * @param {!TextTrackCue} cue\n * @param {!Element} cueElement\n * @param {Element} region\n * @param {!Array.<!Element>} styles\n * @private\n */\nshaka.media.TtmlTextParser.addStyle_ = function(\n cue, cueElement, region, styles) {\n var TtmlTextParser = shaka.media.TtmlTextParser;\n var results = null;\n\n\n var extent = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:extent');\n if (extent) {\n results = TtmlTextParser.percentValues_.exec(extent);\n if (results != null) {\n // Use width value of the extent attribute for size.\n // Height value is ignored.\n cue.size = Number(results[1]);\n }\n }\n\n var writingMode = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:writingMode');\n var isVerticalText = true;\n if (writingMode == 'tb' || writingMode == 'tblr')\n cue.vertical = 'lr';\n else if (writingMode == 'tbrl')\n cue.vertical = 'rl';\n else\n isVerticalText = false;\n\n var origin = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:origin');\n if (origin) {\n results = TtmlTextParser.percentValues_.exec(origin);\n if (results != null) {\n // for vertical text use first coordinate of tts:origin\n // to represent line of the cue and second - for position.\n // Otherwise (horizontal), use them the other way around.\n if (isVerticalText) {\n cue.position = Number(results[2]);\n cue.line = Number(results[1]);\n } else {\n cue.position = Number(results[1]);\n cue.line = Number(results[2]);\n }\n // A boolean indicating whether the line is an integer\n // number of lines (using the line dimensions of the first\n // line of the cue), or whether it is a percentage of the\n // dimension of the video. The flag is set to true when lines\n // are counted, and false otherwise.\n cue.snapToLines = false;\n }\n }\n\n var align = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:textAlign');\n if (align) {\n cue.align = align;\n if (align == 'center') {\n if (cue.align != 'center') {\n // Workaround for a Chrome bug http://crbug.com/663797\n // Chrome does not support align = 'center'\n cue.align = 'middle';\n }\n cue.position = 'auto';\n }\n cue.positionAlign = TtmlTextParser.textAlignToPositionAlign_[align];\n cue.lineAlign = TtmlTextParser.textAlignToLineAlign_[align];\n }\n};\n\n\n/**\n * Finds a specified attribute on either the original cue element or its\n * associated region and returns the value if the attribute was found.\n *\n * @param {!Element} cueElement\n * @param {Element} region\n * @param {!Array.<!Element>} styles\n * @param {string} attribute\n * @return {?string}\n * @private\n */\nshaka.media.TtmlTextParser.getStyleAttribute_ = function(\n cueElement, region, styles, attribute) {\n\n // An attribute can be specified on region level or in a styling block\n // associated with the region or original element.\n var regionChildren = shaka.media.TtmlTextParser.getLeafNodes_(region);\n for (var i = 0; i < regionChildren.length; i++) {\n var attr = regionChildren[i].getAttribute(attribute);\n if (attr)\n return attr;\n }\n\n var getElementFromCollection_ =\n shaka.media.TtmlTextParser.getElementFromCollection_;\n var style = getElementFromCollection_(region, 'style', styles) ||\n getElementFromCollection_(cueElement, 'style', styles);\n if (style)\n return style.getAttribute(attribute);\n return null;\n};\n\n\n/**\n * Selects an item from |collection| whose id matches |attributeName|\n * from |element|.\n *\n * @param {Element} element\n * @param {string} attributeName\n * @param {!Array.<Element>} collection\n * @return {Element}\n * @private\n */\nshaka.media.TtmlTextParser.getElementFromCollection_ = function(\n element, attributeName, collection) {\n if (!element || collection.length < 1) {\n return null;\n }\n var item = null;\n var itemName = shaka.media.TtmlTextParser.getInheritedAttribute_(\n element, attributeName);\n if (itemName) {\n for (var i = 0; i < collection.length; i++) {\n if (collection[i].getAttribute('xml:id') == itemName) {\n item = collection[i];\n break;\n }\n }\n }\n\n return item;\n};\n\n\n/**\n * Traverses upwards from a given node until a given attribute is found.\n *\n * @param {!Element} element\n * @param {string} attributeName\n * @return {?string}\n * @private\n */\nshaka.media.TtmlTextParser.getInheritedAttribute_ = function(\n element, attributeName) {\n var ret = null;\n while (element) {\n ret = element.getAttribute(attributeName);\n if (ret) {\n break;\n }\n\n // Element.parentNode can lead to XMLDocument, which is not an Element and\n // has no getAttribute().\n var parentNode = element.parentNode;\n if (parentNode instanceof Element) {\n element = parentNode;\n } else {\n break;\n }\n }\n return ret;\n};\n\n\n/**\n * Parses a TTML time from the given word.\n *\n * @param {string} text\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseTime_ = function(text, rateInfo) {\n var ret = null;\n var TtmlTextParser = shaka.media.TtmlTextParser;\n\n if (TtmlTextParser.timeColonFormatFrames_.test(text)) {\n ret = TtmlTextParser.parseColonTimeWithFrames_(rateInfo, text);\n } else if (TtmlTextParser.timeColonFormat_.test(text)) {\n ret = TtmlTextParser.parseTimeFromRegex_(\n TtmlTextParser.timeColonFormat_, text);\n } else if (TtmlTextParser.timeColonFormatMilliseconds_.test(text)) {\n ret = TtmlTextParser.parseTimeFromRegex_(\n TtmlTextParser.timeColonFormatMilliseconds_, text);\n } else if (TtmlTextParser.timeFramesFormat_.test(text)) {\n ret = TtmlTextParser.parseFramesTime_(rateInfo, text);\n } else if (TtmlTextParser.timeTickFormat_.test(text)) {\n ret = TtmlTextParser.parseTickTime_(rateInfo, text);\n } else if (TtmlTextParser.timeHMSFormat_.test(text)) {\n ret = TtmlTextParser.parseTimeFromRegex_(\n TtmlTextParser.timeHMSFormat_, text);\n }\n\n return ret;\n};\n\n\n/**\n * Parses a TTML time in frame format\n *\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseFramesTime_ = function(rateInfo, text) {\n\n // 75f or 75.5f\n var results = shaka.media.TtmlTextParser.timeFramesFormat_.exec(text);\n var frames = Number(results[1]);\n\n return frames / rateInfo.frameRate;\n};\n\n\n/**\n * Parses a TTML time in tick format\n *\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseTickTime_ = function(rateInfo, text) {\n\n // 50t or 50.5t\n var results = shaka.media.TtmlTextParser.timeTickFormat_.exec(text);\n var ticks = Number(results[1]);\n\n return ticks / rateInfo.tickRate;\n};\n\n\n/**\n * Parses a TTML colon formatted time containing frames\n *\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseColonTimeWithFrames_ = function(\n rateInfo, text) {\n\n // 01:02:43:07 ('07' is frames) or 01:02:43:07.1 (subframes)\n var results = shaka.media.TtmlTextParser.timeColonFormatFrames_.exec(text);\n\n var hours = Number(results[1]);\n var minutes = Number(results[2]);\n var seconds = Number(results[3]);\n var frames = Number(results[4]);\n var subframes = Number(results[5]) || 0;\n\n frames += subframes / rateInfo.subFrameRate;\n seconds += frames / rateInfo.frameRate;\n\n return seconds + (minutes * 60) + (hours * 3600);\n};\n\n\n/**\n * Parses a TTML time with a given regex. Expects regex to be some\n * sort of a time-matcher to match hours, minutes, seconds and milliseconds\n *\n * @param {!RegExp} regex\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseTimeFromRegex_ = function(regex, text) {\n var results = regex.exec(text);\n if (results == null || results[0] == '')\n return null;\n // This capture is optional, but will still be in the array as undefined,\n // default to 0.\n var hours = Number(results[1]) || 0;\n var minutes = Number(results[2]) || 0;\n var seconds = Number(results[3]) || 0;\n var miliseconds = Number(results[4]) || 0;\n\n return (miliseconds / 1000) + seconds + (minutes * 60) + (hours * 3600);\n};\n\n\n\n/**\n * Contains information about frame/subframe rate\n * and frame rate multiplier for time in frame format.\n * ex. 01:02:03:04(4 frames) or 01:02:03:04.1(4 frames, 1 subframe)\n *\n * @param {?string} frameRate\n * @param {?string} subFrameRate\n * @param {?string} frameRateMultiplier\n * @param {?string} tickRate\n * @constructor\n * @struct\n * @private\n */\nshaka.media.TtmlTextParser.RateInfo_ = function(\n frameRate, subFrameRate, frameRateMultiplier, tickRate) {\n\n /**\n * @type {number}\n */\n this.frameRate = Number(frameRate) || 30;\n\n /**\n * @type {number}\n */\n this.subFrameRate = Number(subFrameRate) || 1;\n\n /**\n * @type {number}\n */\n this.tickRate = Number(tickRate);\n if (this.tickRate == 0) {\n if (frameRate)\n this.tickRate = this.frameRate * this.subFrameRate;\n else\n this.tickRate = 1;\n }\n\n if (frameRateMultiplier) {\n var multiplierResults = /^(\\d+) (\\d+)$/g.exec(frameRateMultiplier);\n if (multiplierResults) {\n var numerator = multiplierResults[1];\n var denominator = multiplierResults[2];\n var multiplierNum = numerator / denominator;\n this.frameRate *= multiplierNum;\n }\n }\n};\n\n\nshaka.media.TextEngine.registerParser(\n 'application/ttml+xml',\n shaka.media.TtmlTextParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/ttml_text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Mp4TtmlParser');\n\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.media.TtmlTextParser');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Mp4Parser');\n\n\n\n/**\n * @struct\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.Mp4TtmlParser = function() {\n /**\n * @type {!shakaExtern.TextParser}\n * @private\n */\n this.parser_ = new shaka.media.TtmlTextParser();\n};\n\n\n/** @override **/\nshaka.media.Mp4TtmlParser.prototype.parseInit = function(data) {\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var sawSTPP = false;\n\n new Mp4Parser()\n .box('moov', Mp4Parser.children)\n .box('trak', Mp4Parser.children)\n .box('mdia', Mp4Parser.children)\n .box('minf', Mp4Parser.children)\n .box('stbl', Mp4Parser.children)\n .fullBox('stsd', Mp4Parser.sampleDescription)\n .box('stpp', function(box) {\n sawSTPP = true;\n }).parse(data);\n\n if (!sawSTPP) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_TTML);\n }\n};\n\n\n/** @override **/\nshaka.media.Mp4TtmlParser.prototype.parseMedia = function(data, time) {\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var sawMDAT = false;\n var payload = [];\n\n new Mp4Parser()\n .box('mdat', Mp4Parser.allData(function(data) {\n sawMDAT = true;\n payload = this.parser_.parseMedia(data.buffer, time);\n }.bind(this))).parse(data);\n\n if (!sawMDAT) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_TTML);\n }\n\n return payload;\n};\n\n\nshaka.media.TextEngine.registerParser(\n 'application/mp4; codecs=\"stpp\"',\n shaka.media.Mp4TtmlParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/mp4_ttml_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.VttTextParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.TextParser');\n\n\n\n/**\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.VttTextParser = function() { };\n\n\n/** @override */\nshaka.media.VttTextParser.prototype.parseInit = function(data) {\n goog.asserts.assert(false, 'VTT does not have init segments');\n};\n\n\n/**\n * @override\n * @throws {shaka.util.Error}\n */\nshaka.media.VttTextParser.prototype.parseMedia = function(data, time) {\n var VttTextParser = shaka.media.VttTextParser;\n // Get the input as a string. Normalize newlines to \\n.\n var str = shaka.util.StringUtils.fromUTF8(data);\n str = str.replace(/\\r\\n|\\r(?=[^\\n]|$)/gm, '\\n');\n var blocks = str.split(/\\n{2,}/m);\n\n if (!/^WEBVTT($|[ \\t\\n])/m.test(blocks[0])) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_TEXT_HEADER);\n }\n\n var offset = time.segmentStart;\n // Parse X-TIMESTAMP-MAP metadata header if it's present to get\n // time offset information.\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5\n if (blocks[0].indexOf('X-TIMESTAMP-MAP') >= 0) {\n // 'X-TIMESTAMP-MAP' header is used in HLS to align text with\n // the rest of the media.\n // The header format is 'X-TIMESTAMP-MAP=MPEGTS:n,LOCAL:m'\n // (the attributes can go in any order)\n // where n is MPEG-2 time and m is cue time it maps to.\n // For example 'X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000'\n // means an offset of 10 seconds\n // 900000/MPEG_TIMESCALE - cue time.\n var cueTimeMatch =\n blocks[0].match(/LOCAL:((?:(\\d{1,}):)?(\\d{2}):(\\d{2})\\.(\\d{3}))/m);\n\n var mpegTimeMatch = blocks[0].match(/MPEGTS:(\\d+)/m);\n if (cueTimeMatch && mpegTimeMatch) {\n var parser = new shaka.util.TextParser(cueTimeMatch[1]);\n var cueTime = shaka.media.VttTextParser.parseTime_(parser);\n var mpegTime = Number(mpegTimeMatch[1]);\n var mpegTimescale = shaka.media.VttTextParser.MPEG_TIMESCALE_;\n // Apple-encoded HLS content uses absolute timestamps, so assume\n // the presence of the map tag means the content uses absolute\n // timestamps.\n offset = time.periodStart + (mpegTime / mpegTimescale - cueTime);\n }\n }\n\n var ret = [];\n for (var i = 1; i < blocks.length; i++) {\n var lines = blocks[i].split('\\n');\n var cue = VttTextParser.parseCue_(lines, offset);\n if (cue)\n ret.push(cue);\n }\n\n return ret;\n};\n\n\n/**\n * Parses a text block into a Cue object.\n *\n * @param {!Array.<string>} text\n * @param {number} timeOffset\n * @return {?TextTrackCue}\n * @private\n */\nshaka.media.VttTextParser.parseCue_ = function(text, timeOffset) {\n // Skip empty blocks.\n if (text.length == 1 && !text[0])\n return null;\n\n // Skip comment blocks.\n if (/^NOTE($|[ \\t])/.test(text[0]))\n return null;\n\n var id = null;\n var index = text[0].indexOf('-->');\n if (index < 0) {\n id = text[0];\n text.splice(0, 1);\n }\n\n // Parse the times.\n var parser = new shaka.util.TextParser(text[0]);\n var start = shaka.media.VttTextParser.parseTime_(parser);\n var expect = parser.readRegex(/[ \\t]+-->[ \\t]+/g);\n var end = shaka.media.VttTextParser.parseTime_(parser);\n\n if (start == null || expect == null || end == null) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_TEXT_CUE);\n }\n\n start += timeOffset;\n end += timeOffset;\n\n // Get the payload.\n var payload = text.slice(1).join('\\n').trim();\n\n var cue = shaka.media.TextEngine.makeCue(start, end, payload);\n if (!cue)\n return null;\n\n // Parse optional settings.\n parser.skipWhitespace();\n var word = parser.readWord();\n while (word) {\n if (!shaka.media.VttTextParser.parseSetting(cue, word)) {\n shaka.log.warning('VTT parser encountered an invalid VTT setting: ',\n word,\n ' The setting will be ignored.');\n }\n parser.skipWhitespace();\n word = parser.readWord();\n }\n\n if (id != null)\n cue.id = id;\n return cue;\n};\n\n\n/**\n * Parses a WebVTT setting from the given word.\n *\n * @param {!TextTrackCue} cue\n * @param {string} word\n * @return {boolean} True on success.\n */\nshaka.media.VttTextParser.parseSetting = function(cue, word) {\n // NOTE: positionAlign and lineAlign settings are not supported by Chrome\n // at the moment, so setting them will have no effect.\n // The bug on chromium to implement them:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=633690\n\n var results = null;\n if ((results = /^align:(start|middle|center|end|left|right)$/.exec(word))) {\n cue.align = results[1];\n if (results[1] == 'center' && cue.align != 'center') {\n // Workaround for a Chrome bug http://crbug.com/663797\n // Chrome does not support align = 'center'\n cue.position = 'auto';\n cue.align = 'middle';\n }\n } else if ((results = /^vertical:(lr|rl)$/.exec(word))) {\n cue.vertical = results[1];\n } else if ((results = /^size:(\\d{1,2}|100)%$/.exec(word))) {\n cue.size = Number(results[1]);\n }\n // There was a disagreement between a working draft and an editor draft of\n // the WebVTT spec. According to the former, optional position alignment\n // options are 'start', 'end' and 'center'. According to the latter -\n // 'line-left', 'center' and 'line-right'.\n // We are going to support both options for now.\n else if ((results =\n /^position:(\\d{1,2}|100)%(?:,(line-left|line-right|center|start|end))?$/\n .exec(word))) {\n cue.position = Number(results[1]);\n if (results[2])\n cue.positionAlign = results[2];\n } else if ((results =\n /^line:(\\d{1,2}|100)%(?:,(start|end|center))?$/.exec(word))) {\n cue.snapToLines = false;\n cue.line = Number(results[1]);\n if (results[2])\n cue.lineAlign = results[2];\n } else if ((results = /^line:(-?\\d+)(?:,(start|end|center))?$/.exec(word))) {\n cue.snapToLines = true;\n cue.line = Number(results[1]);\n if (results[2])\n cue.lineAlign = results[2];\n } else {\n return false;\n }\n\n return true;\n};\n\n\n/**\n * Parses a WebVTT time from the given parser.\n *\n * @param {!shaka.util.TextParser} parser\n * @return {?number}\n * @private\n */\nshaka.media.VttTextParser.parseTime_ = function(parser) {\n // 00:00.000 or 00:00:00.000 or 0:00:00.000\n var results = parser.readRegex(/(?:(\\d{1,}):)?(\\d{2}):(\\d{2})\\.(\\d{3})/g);\n if (results == null)\n return null;\n // This capture is optional, but will still be in the array as undefined,\n // default to 0.\n var hours = Number(results[1]) || 0;\n var minutes = Number(results[2]);\n var seconds = Number(results[3]);\n var miliseconds = Number(results[4]);\n if (minutes > 59 || seconds > 59)\n return null;\n\n return (miliseconds / 1000) + seconds + (minutes * 60) + (hours * 3600);\n};\n\n\n/**\n * @const {number}\n * @private\n */\nshaka.media.VttTextParser.MPEG_TIMESCALE_ = 90000;\n\nshaka.media.TextEngine.registerParser(\n 'text/vtt',\n shaka.media.VttTextParser);\n\nshaka.media.TextEngine.registerParser(\n 'text/vtt; codecs=\"vtt\"',\n shaka.media.VttTextParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/vtt_text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Mp4VttParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.media.VttTextParser');\ngoog.require('shaka.util.DataViewReader');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Mp4Parser');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.TextParser');\n\n\n\n/**\n * @struct\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.Mp4VttParser = function() {\n /**\n * The current time scale used by the VTT parser.\n *\n * @type {?number}\n * @private\n */\n this.timescale_ = null;\n};\n\n\n/** @override */\nshaka.media.Mp4VttParser.prototype.parseInit = function(data) {\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var sawWVTT = false;\n\n new Mp4Parser()\n .box('moov', Mp4Parser.children)\n .box('trak', Mp4Parser.children)\n .box('mdia', Mp4Parser.children)\n .fullBox('mdhd', function(box) {\n goog.asserts.assert(\n box.version == 0 || box.version == 1,\n 'MDHD version can only be 0 or 1');\n if (box.version == 0) {\n box.reader.skip(4); // skip \"creation_time\"\n box.reader.skip(4); // skip \"modification_time\"\n this.timescale_ = box.reader.readUint32();\n box.reader.skip(4); // skip \"duration\"\n } else {\n box.reader.skip(8); // skip \"creation_time\"\n box.reader.skip(8); // skip \"modification_time\"\n this.timescale_ = box.reader.readUint32();\n box.reader.skip(8); // skip \"duration\"\n }\n box.reader.skip(4); // skip \"pad\", \"language\", and \"pre-defined\"\n }.bind(this))\n .box('minf', Mp4Parser.children)\n .box('stbl', Mp4Parser.children)\n .fullBox('stsd', Mp4Parser.sampleDescription)\n .box('wvtt', function(box) {\n // A valid vtt init segment, no actual subtitles yet\n sawWVTT = true;\n }).parse(data);\n\n if (!this.timescale_) {\n // Missing timescale for VTT content. Should be located in the MDHD\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_VTT);\n }\n\n if (!sawWVTT) {\n // A WVTT box should have been seen (a valid vtt init segment with no\n // actual subtitles).\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_VTT);\n }\n};\n\n\n/** @override */\nshaka.media.Mp4VttParser.prototype.parseMedia = function(data, time) {\n var Mp4VttParser = shaka.media.Mp4VttParser;\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var baseTime = 0;\n var presentations = [];\n var payloads = [];\n var cues = [];\n\n var sawTFDT = false;\n var sawTRUN = false;\n var sawMDAT = false;\n\n new Mp4Parser()\n .box('moof', Mp4Parser.children)\n .box('traf', Mp4Parser.children)\n .fullBox('tfdt', function(box) {\n sawTFDT = true;\n goog.asserts.assert(\n box.version == 0 || box.version == 1,\n 'TFDT version can only be 0 or 1');\n baseTime = (box.version == 0) ?\n box.reader.readUint32() :\n box.reader.readUint64();\n })\n .fullBox('trun', function(box) {\n sawTRUN = true;\n goog.asserts.assert(\n box.version != null,\n 'A TRUN box should have a valid version value');\n goog.asserts.assert(\n box.flags != null,\n 'A TRUN box should have a valid flags value');\n presentations = Mp4VttParser.parseTRUN_(\n box.version, box.flags, box.reader);\n })\n .box('vtte', function(box) {\n // VTTE are empty cues, so there is no need to do any more than insert\n // a place-holder. We must add something or else the ordering between\n // the payloads and presentation times would fall out of order.\n payloads.push(null);\n })\n .box('vttc', Mp4Parser.allData(function(data) {\n payloads.push(data.buffer);\n }))\n .box('mdat', function(box) {\n sawMDAT = true;\n Mp4Parser.children(box);\n }).parse(data);\n\n if (!sawMDAT && !sawTFDT && !sawTRUN) {\n // A required box is missing\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_VTT);\n }\n\n goog.asserts.assert(\n presentations.length == payloads.length,\n 'The number of presentations should equal the number of payloads');\n\n var currentTime = baseTime;\n\n for (var i = 0; i < presentations.length; i++) {\n var presentation = presentations[i];\n var payload = payloads[i];\n\n if (presentation.duration) {\n var startTime = presentation.timeOffset ?\n baseTime + presentation.timeOffset :\n currentTime;\n\n currentTime = startTime + presentation.duration;\n\n // The payload can be null as that would mean that it was a VTTE and\n // was only inserted to keep the presentation times in sync with the\n // payloads.\n if (payload) {\n cues.push(shaka.media.Mp4VttParser.parseVTTC_(\n payload,\n time.periodStart + startTime / this.timescale_,\n time.periodStart + currentTime / this.timescale_));\n }\n }\n }\n\n return cues;\n};\n\n\n/**\n * @typedef {{\n * duration: ?number,\n * timeOffset: ?number\n * }}\n *\n * @property {?number} duration\n * The length of the segment in timescale units.\n * @property {?number} timeOffset\n * The time since the start of the segment in timescale units. Time\n * offset is based of the start of the segment. If this value is\n * missing, the accumated durations preceeding this time segment will\n * be used to create the start time.\n */\nshaka.media.Mp4VttParser.TimeSegment;\n\n\n/**\n * @param {number} version\n * @param {number} flags\n * @param {!shaka.util.DataViewReader} reader\n * @return {!Array.<shaka.media.Mp4VttParser.TimeSegment>}\n * @private\n */\nshaka.media.Mp4VttParser.parseTRUN_ = function(version, flags, reader) {\n var sampleCount = reader.readUint32();\n\n // skip \"data_offset\" if present\n if (flags & 0x000001) { reader.skip(4); }\n\n // skip \"first_sample_flags\" if present\n if (flags & 0x000004) { reader.skip(4); }\n\n var samples = [];\n\n for (var sampleIndex = 0; sampleIndex < sampleCount; sampleIndex++) {\n\n /** @type {shaka.media.Mp4VttParser.TimeSegment} */\n var sample = {\n duration: null,\n timeOffset: null\n };\n\n // read \"sample duration\" if present\n if (flags & 0x000100) { sample.duration = reader.readUint32(); }\n\n // skip \"sample_size\" if present\n if (flags & 0x000200) { reader.skip(4); }\n\n // skip \"sample_flags\" if present\n if (flags & 0x000400) {reader.skip(4); }\n\n // read \"sample_time_offset\" if present\n if (flags & 0x000800) {\n sample.timeOffset = version == 0 ?\n reader.readUint32() :\n reader.readInt32();\n }\n\n samples.push(sample);\n }\n\n return samples;\n};\n\n\n/**\n * Parses a vttc box into a cue.\n *\n * @param {!ArrayBuffer} data\n * @param {number} startTime\n * @param {number} endTime\n * @return {TextTrackCue}\n * @private\n */\nshaka.media.Mp4VttParser.parseVTTC_ = function(data, startTime, endTime) {\n var payload;\n var id;\n var settings;\n\n new shaka.util.Mp4Parser()\n .box('payl', shaka.util.Mp4Parser.allData(function(data) {\n payload = shaka.util.StringUtils.fromUTF8(data);\n }))\n .box('iden', shaka.util.Mp4Parser.allData(function(data) {\n id = shaka.util.StringUtils.fromUTF8(data);\n }))\n .box('sttg', shaka.util.Mp4Parser.allData(function(data) {\n settings = shaka.util.StringUtils.fromUTF8(data);\n }))\n .parse(data);\n\n if (payload) {\n return shaka.media.Mp4VttParser.assembleCue_(payload,\n id,\n settings,\n startTime,\n endTime);\n } else {\n return null;\n }\n};\n\n\n/**\n * Take the individual components that make a cue and create a vttc cue.\n *\n * @param {string} payload\n * @param {?string} id\n * @param {?string} settings\n * @param {number} startTime\n * @param {number} endTime\n * @return {TextTrackCue}\n * @private\n */\nshaka.media.Mp4VttParser.assembleCue_ = function(payload,\n id,\n settings,\n startTime,\n endTime) {\n var cue = shaka.media.TextEngine.makeCue(\n startTime,\n endTime,\n payload);\n\n if (cue && id) {\n cue.id = id;\n }\n\n if (cue && settings) {\n var parser = new shaka.util.TextParser(settings);\n\n var word = parser.readWord();\n\n while (word) {\n\n if (!shaka.media.VttTextParser.parseSetting(cue, word)) {\n shaka.log.warning('VTT parser encountered an invalid VTT setting: ',\n word,\n ' The setting will be ignored.');\n }\n\n parser.skipWhitespace();\n word = parser.readWord();\n }\n }\n\n return cue;\n};\n\n\nshaka.media.TextEngine.registerParser(\n 'application/mp4; codecs=\"wvtt\"',\n shaka.media.Mp4VttParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/mp4_vtt_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Playhead');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TimeRangesUtils');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * Creates a Playhead, which manages the video's current time.\n *\n * The Playhead provides mechanisms for setting the presentation's start time,\n * restricting seeking to valid time ranges, and stopping playback for startup\n * and re- buffering.\n *\n * @param {HTMLMediaElement} video\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.StreamingConfiguration} config\n * @param {?number} startTime The playhead's initial position in seconds. If\n * null, defaults to the start of the presentation for VOD and the live-edge\n * for live.\n * @param {function()} onSeek Called when the user agent seeks to a time within\n * the presentation timeline.\n * @param {function(!Event)} onEvent Called when an event is raised to be sent\n * to the application.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.Playhead = function(\n video, manifest, config, startTime, onSeek, onEvent) {\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = manifest;\n\n /** @private {?shakaExtern.StreamingConfiguration} */\n this.config_ = config;\n\n /**\n * The playhead's initial position in seconds, or null if it should\n * automatically be calculated later.\n * @private {?number}\n */\n this.startTime_ = startTime;\n\n /** @private {?function()} */\n this.onSeek_ = onSeek;\n\n /** @private {?function(!Event)} */\n this.onEvent_ = onEvent;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {boolean} */\n this.buffering_ = false;\n\n /** @private {number} */\n this.playbackRate_ = 1;\n\n /** @private {?number} */\n this.trickPlayIntervalId_ = null;\n\n /** @private {?number} */\n this.gapJumpIntervalId_ = null;\n\n /** @private {number} */\n this.prevReadyState_ = video.readyState;\n\n /** @private {boolean} */\n this.didFireLargeGap_ = false;\n\n /**\n * The wall-clock time (in milliseconds) that the stall occurred. This is\n * used to ensure we don't flush the pipeline too often.\n * @private {number}\n */\n this.stallWallTime_ = -1;\n\n /**\n * The playhead time where we think a stall occurred. When the ready state\n * says we don't have enough data and the playhead stops too long, we assume\n * we have stalled.\n * @private {number}\n */\n this.stallPlayheadTime_ = -1;\n\n /** @private {boolean} */\n this.hadSegmentAppended_ = false;\n\n\n // Check if the video has already loaded some metadata.\n if (video.readyState > 0) {\n this.onLoadedMetadata_();\n } else {\n this.eventManager_.listenOnce(\n video, 'loadedmetadata', this.onLoadedMetadata_.bind(this));\n }\n\n var pollGap = this.onPollGapJump_.bind(this);\n this.eventManager_.listen(video, 'ratechange', this.onRateChange_.bind(this));\n this.eventManager_.listen(video, 'waiting', pollGap);\n\n // We can't trust readyState or 'waiting' events on all platforms. So poll\n // the current time and if we are in a gap, jump it.\n // See: https://goo.gl/sbSHp9 and https://goo.gl/cuAcYd\n this.gapJumpIntervalId_ = setInterval(pollGap, 250);\n};\n\n\n/** @override */\nshaka.media.Playhead.prototype.destroy = function() {\n var p = this.eventManager_.destroy();\n this.eventManager_ = null;\n\n if (this.trickPlayIntervalId_ != null) {\n window.clearInterval(this.trickPlayIntervalId_);\n this.trickPlayIntervalId_ = null;\n }\n\n if (this.gapJumpIntervalId_ != null) {\n window.clearInterval(this.gapJumpIntervalId_);\n this.gapJumpIntervalId_ = null;\n }\n\n this.video_ = null;\n this.manifest_ = null;\n this.config_ = null;\n this.onSeek_ = null;\n this.onEvent_ = null;\n\n return p;\n};\n\n\n/** @param {number} startTime */\nshaka.media.Playhead.prototype.setStartTime = function(startTime) {\n if (this.video_.readyState > 0)\n this.video_.currentTime = this.clampTime_(startTime);\n else\n this.startTime_ = startTime;\n};\n\n\n/**\n * Gets the playhead's current (logical) position.\n *\n * @return {number}\n */\nshaka.media.Playhead.prototype.getTime = function() {\n if (this.video_.readyState > 0) {\n // Although we restrict the video's currentTime elsewhere, clamp it here to\n // ensure any timing issues (e.g., the user agent seeks and calls this\n // function before we receive the 'seeking' event) don't cause us to return\n // a time outside the segment availability window.\n return this.clampTime_(this.video_.currentTime);\n }\n\n return this.getStartTime_();\n};\n\n\n/**\n * Gets the playhead's initial position in seconds.\n *\n * @return {number}\n * @private\n */\nshaka.media.Playhead.prototype.getStartTime_ = function() {\n if (this.startTime_) {\n return this.clampTime_(this.startTime_);\n }\n\n var startTime;\n var timeline = this.manifest_.presentationTimeline;\n if (timeline.getDuration() < Infinity) {\n // If the presentation is VOD, or if the presentation is live but has\n // finished broadcasting, then start from the beginning.\n startTime = timeline.getSegmentAvailabilityStart();\n } else {\n // Otherwise, start near the live-edge.\n startTime = timeline.getSeekRangeEnd();\n }\n return startTime;\n};\n\n\n/**\n * Stops the playhead for buffering, or resumes the playhead after buffering.\n *\n * @param {boolean} buffering True to stop the playhead; false to allow it to\n * continue.\n */\nshaka.media.Playhead.prototype.setBuffering = function(buffering) {\n if (buffering != this.buffering_) {\n this.buffering_ = buffering;\n this.setPlaybackRate(this.playbackRate_);\n }\n};\n\n\n/**\n * Gets the current effective playback rate. This may be negative even if the\n * browser does not directly support rewinding.\n * @return {number}\n */\nshaka.media.Playhead.prototype.getPlaybackRate = function() {\n return this.playbackRate_;\n};\n\n\n/**\n * Sets the playback rate.\n * @param {number} rate\n */\nshaka.media.Playhead.prototype.setPlaybackRate = function(rate) {\n if (this.trickPlayIntervalId_ != null) {\n window.clearInterval(this.trickPlayIntervalId_);\n this.trickPlayIntervalId_ = null;\n }\n\n this.playbackRate_ = rate;\n // All major browsers support playback rates above zero. Only need fake\n // trick play for negative rates.\n this.video_.playbackRate = (this.buffering_ || rate < 0) ? 0 : rate;\n\n if (!this.buffering_ && rate < 0) {\n // Defer creating the timer until we stop buffering. This function will be\n // called again from setBuffering().\n this.trickPlayIntervalId_ = window.setInterval(function() {\n this.video_.currentTime += rate / 4;\n }.bind(this), 250);\n }\n};\n\n\n/**\n * Called when a segment is appended by StreamingEngine, but not when a clear is\n * pending. This means StreamingEngine will continue buffering forward from\n * what is buffered. So we know about any gaps before the start.\n */\nshaka.media.Playhead.prototype.onSegmentAppended = function() {\n this.hadSegmentAppended_ = true;\n this.onPollGapJump_();\n};\n\n\n/**\n * Handles a 'ratechange' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onRateChange_ = function() {\n // NOTE: This will not allow explicitly setting the playback rate to 0 while\n // the playback rate is negative. Pause will still work.\n var expectedRate =\n this.buffering_ || this.playbackRate_ < 0 ? 0 : this.playbackRate_;\n if (this.video_.playbackRate != expectedRate) {\n shaka.log.debug('Video playback rate changed to', this.video_.playbackRate);\n this.setPlaybackRate(this.video_.playbackRate);\n }\n};\n\n\n/**\n * Handles a 'loadedmetadata' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onLoadedMetadata_ = function() {\n // Move the real playhead to the start time.\n var targetTime = this.getStartTime_();\n if (Math.abs(this.video_.currentTime - targetTime) < 0.001) {\n this.eventManager_.listen(\n this.video_, 'seeking', this.onSeeking_.bind(this));\n this.eventManager_.listen(\n this.video_, 'playing', this.onPlaying_.bind(this));\n } else {\n this.eventManager_.listenOnce(\n this.video_, 'seeking', this.onSeekingToStartTime_.bind(this));\n this.video_.currentTime = targetTime;\n }\n};\n\n\n/**\n * Handles the 'seeking' event from the initial jump to the start time (if\n * there is one).\n *\n * @private\n */\nshaka.media.Playhead.prototype.onSeekingToStartTime_ = function() {\n goog.asserts.assert(this.video_.readyState > 0,\n 'readyState should be greater than 0');\n this.eventManager_.listen(this.video_, 'seeking', this.onSeeking_.bind(this));\n this.eventManager_.listen(this.video_, 'playing', this.onPlaying_.bind(this));\n};\n\n\n/**\n * Called on a recurring timer to check for gaps in the media. This is also\n * called in a 'waiting' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onPollGapJump_ = function() {\n if (this.video_.readyState == 0)\n return;\n\n // When the ready state changes, we have moved on, so we should fire the large\n // gap event if we see one.\n if (this.video_.readyState != this.prevReadyState_) {\n this.didFireLargeGap_ = false;\n this.prevReadyState_ = this.video_.readyState;\n }\n\n var smallGapLimit = this.config_.smallGapLimit;\n var currentTime = this.video_.currentTime;\n var buffered = this.video_.buffered;\n\n var gapIndex = shaka.media.TimeRangesUtils.getGapIndex(buffered, currentTime);\n\n // The current time is unbuffered or is too far from a gap.\n if (gapIndex == null) {\n if (this.video_.readyState < 3 && this.video_.playbackRate > 0) {\n // Some platforms/browsers can get stuck in the middle of a buffered range\n // (e.g. when seeking in a background tab). Flush the media pipeline to\n // help.\n //\n // Flush once we have stopped for more than 1 second inside a buffered\n // range. Note that Chromecast takes a few seconds to start playing\n // after any kind of seek, so wait 5 seconds between repeated flushes.\n if (this.stallPlayheadTime_ != currentTime) {\n this.stallPlayheadTime_ = currentTime;\n this.stallWallTime_ = Date.now();\n } else if (this.stallWallTime_ < Date.now() - 1000) {\n // Make the stall appear in the future so we don't flush for 5 seconds.\n this.stallWallTime_ = Date.now() + 5000;\n\n for (var i = 0; i < buffered.length; i++) {\n // Ignore the end of the buffered range since it may not play anymore\n // on all platforms.\n if (currentTime >= buffered.start(i) &&\n currentTime < buffered.end(i) - 0.5) {\n shaka.log.debug(\n 'Flushing media pipeline due to stall inside buffered range');\n this.video_.currentTime = this.video_.currentTime;\n break;\n }\n }\n }\n }\n return;\n }\n // If we are before the first buffered range, this could be an unbuffered\n // seek. So wait until a segment is appended so we are sure it is a gap.\n if (gapIndex == 0 && !this.hadSegmentAppended_)\n return;\n\n // StreamingEngine can buffer past the seek end, but still don't allow seeking\n // past it.\n var jumpTo = buffered.start(gapIndex);\n var seekEnd = this.manifest_.presentationTimeline.getSeekRangeEnd();\n if (jumpTo >= seekEnd)\n return;\n\n var jumpSize = jumpTo - currentTime;\n var isGapSmall = jumpSize <= smallGapLimit;\n var jumpLargeGap = false;\n\n if (!isGapSmall && !this.didFireLargeGap_) {\n this.didFireLargeGap_ = true;\n\n // Event firing is synchronous.\n var event = new shaka.util.FakeEvent(\n 'largegap', {'currentTime': currentTime, 'gapSize': jumpSize});\n event.cancelable = true;\n this.onEvent_(event);\n\n if (this.config_.jumpLargeGaps && !event.defaultPrevented)\n jumpLargeGap = true;\n else\n shaka.log.info('Ignoring large gap at', currentTime);\n }\n\n if (isGapSmall || jumpLargeGap) {\n if (gapIndex == 0) {\n shaka.log.info(\n 'Jumping forward', jumpSize,\n 'seconds because of gap before start time of', jumpTo);\n } else {\n shaka.log.info(\n 'Jumping forward', jumpSize, 'seconds because of gap starting at',\n buffered.end(gapIndex - 1), 'and ending at', jumpTo);\n }\n\n this.movePlayhead_(currentTime, jumpTo);\n }\n};\n\n\n/**\n * Handles a 'seeking' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onSeeking_ = function() {\n goog.asserts.assert(this.video_.readyState > 0,\n 'readyState should be greater than 0');\n\n this.hadSegmentAppended_ = false;\n var currentTime = this.video_.currentTime;\n var targetTime = this.reposition_(currentTime);\n\n if (Math.abs(targetTime - currentTime) > 0.001) {\n this.movePlayhead_(currentTime, targetTime);\n return;\n }\n\n shaka.log.v1('Seek to ' + currentTime);\n this.didFireLargeGap_ = false;\n this.onSeek_();\n};\n\n\n/**\n * Handles a 'playing' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onPlaying_ = function() {\n goog.asserts.assert(this.video_.readyState > 0,\n 'readyState should be greater than 0');\n\n var currentTime = this.video_.currentTime;\n var targetTime = this.reposition_(currentTime);\n\n if (Math.abs(targetTime - currentTime) > 0.001)\n this.movePlayhead_(currentTime, targetTime);\n};\n\n\n/**\n * Computes a new playhead position that's within the presentation timeline.\n *\n * @param {number} currentTime\n * @return {number} The time to reposition the playhead to.\n * @private\n */\nshaka.media.Playhead.prototype.reposition_ = function(currentTime) {\n goog.asserts.assert(this.manifest_ && this.config_, 'Must not be destroyed');\n\n /** @type {function(number)} */\n var isBuffered =\n shaka.media.TimeRangesUtils.isBuffered.bind(null, this.video_.buffered);\n\n var rebufferingGoal = shaka.util.StreamUtils.getRebufferingGoal(\n this.manifest_, this.config_, 1 /* scaleFactor */);\n\n var timeline = this.manifest_.presentationTimeline;\n var start = timeline.getSafeAvailabilityStart(0);\n var end = timeline.getSegmentAvailabilityEnd();\n\n // With live content, the beginning of the availability window is moving\n // forward. This means we cannot seek to it since we will \"fall\" outside the\n // window while we buffer. So we define a \"safe\" region that is far enough\n // away. For VOD, |safe == start|.\n var safe = timeline.getSafeAvailabilityStart(rebufferingGoal);\n\n // These are the times to seek to rather than the exact destinations. When\n // we seek, we will get another event (after a slight delay) and these steps\n // will run again. So if we seeked directly to |start|, |start| would move\n // on the next call and we would loop forever.\n //\n // Offset by 5 seconds since Chromecast takes a few seconds to start playing\n // after a seek, even when buffered.\n var seekStart = timeline.getSafeAvailabilityStart(5);\n var seekSafe = timeline.getSafeAvailabilityStart(rebufferingGoal + 5);\n\n\n if (currentTime > end) {\n shaka.log.v1('Playhead past end.');\n return end;\n }\n\n if (currentTime < start) {\n if (isBuffered(seekStart)) {\n shaka.log.v1('Playhead before start & start is buffered');\n return seekStart;\n } else {\n shaka.log.v1('Playhead before start & start is unbuffered');\n return seekSafe;\n }\n }\n\n if (currentTime >= safe || isBuffered(currentTime)) {\n shaka.log.v1('Playhead in safe region or in buffered region.');\n return currentTime;\n } else {\n shaka.log.v1('Playhead outside safe region & in unbuffered region.');\n return seekSafe;\n }\n};\n\n\n/**\n * Moves the playhead to the target time, triggering a call to onSeeking_().\n *\n * @param {number} currentTime\n * @param {number} targetTime\n * @private\n */\nshaka.media.Playhead.prototype.movePlayhead_ = function(\n currentTime, targetTime) {\n shaka.log.debug('Moving playhead...',\n 'currentTime=' + currentTime,\n 'targetTime=' + targetTime);\n this.video_.currentTime = targetTime;\n\n // Sometimes, IE and Edge ignore re-seeks. Check every 100ms and try\n // again if need be, up to 10 tries.\n // Delay stats over 100 runs of a re-seeking integration test:\n // IE - 0ms - 47%\n // IE - 100ms - 63%\n // Edge - 0ms - 2%\n // Edge - 100ms - 40%\n // Edge - 200ms - 32%\n // Edge - 300ms - 24%\n // Edge - 400ms - 2%\n // Chrome - 0ms - 100%\n // TODO: File a bug on IE/Edge about this.\n var tries = 0;\n var recheck = (function() {\n if (!this.video_) return;\n if (tries++ >= 10) return;\n\n if (this.video_.currentTime == currentTime) {\n // Sigh. Try again.\n this.video_.currentTime = targetTime;\n setTimeout(recheck, 100);\n }\n }).bind(this);\n setTimeout(recheck, 100);\n};\n\n\n/**\n * Clamps the given time to the segment availability window.\n *\n * @param {number} time The time in seconds.\n * @return {number} The clamped time in seconds.\n * @private\n */\nshaka.media.Playhead.prototype.clampTime_ = function(time) {\n var start = this.manifest_.presentationTimeline.getSegmentAvailabilityStart();\n if (time < start) return start;\n\n var end = this.manifest_.presentationTimeline.getSegmentAvailabilityEnd();\n if (time > end) return end;\n\n return time;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/playhead.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.PlayheadObserver');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.media.TimeRangesUtils');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * This observes the current playhead position to raise events. This will only\n * observe the playhead, {@link shaka.media.Playhead} will modify it. This will:\n * <ul>\n * <li>Track buffering state and call |onBuffering|.</li>\n * <li>Track current Period and call |onChangePeriod|.</li>\n * <li>Track timeline regions and raise respective events.</li>\n * </ul>\n *\n * @param {HTMLMediaElement} video\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.StreamingConfiguration} config\n * @param {function(boolean)} onBuffering Called and passed true when stopped\n * for buffering; called and passed false when proceeding after buffering.\n * If passed true, the callback should not set the video's playback rate.\n * @param {function(!Event)} onEvent Called when an event is raised to be sent\n * to the application.\n * @param {function()} onChangePeriod Called when the playhead moves to a\n * different Period.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.PlayheadObserver = function(\n video, manifest, config, onBuffering, onEvent, onChangePeriod) {\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = manifest;\n\n /** @private {?shakaExtern.StreamingConfiguration} */\n this.config_ = config;\n\n /** @private {?function(boolean)} */\n this.onBuffering_ = onBuffering;\n\n /** @private {?function(!Event)} */\n this.onEvent_ = onEvent;\n\n /** @private {?function()} */\n this.onChangePeriod_ = onChangePeriod;\n\n /** @private {!Array.<shaka.media.PlayheadObserver.TimelineRegion>} */\n this.timelineRegions_ = [];\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {boolean} */\n this.buffering_ = false;\n\n /** @private {number} */\n this.curPeriodIndex_ = -1;\n\n /** @private {?number} */\n this.watchdogTimer_ = null;\n\n\n this.startWatchdogTimer_();\n};\n\n\n/**\n * The threshold for underflow, in seconds. If there is less than this amount\n * of data buffered, we will consider the player to be out of data.\n *\n * @private {number}\n * @const\n */\nshaka.media.PlayheadObserver.UNDERFLOW_THRESHOLD_ = 0.5;\n\n\n/**\n * A fudge factor used when comparing buffered ranges to the duration to\n * determine if we have buffered all available content.\n *\n * @private {number}\n * @const\n */\nshaka.media.PlayheadObserver.FUDGE_FACTOR_ = 0.1;\n\n\n/**\n * @enum {number}\n * @private\n */\nshaka.media.PlayheadObserver.RegionLocation_ = {\n FUTURE_REGION: 1,\n INSIDE: 2,\n PAST_REGION: 3\n};\n\n\n/**\n * @typedef {{\n * info: shakaExtern.TimelineRegionInfo,\n * status: shaka.media.PlayheadObserver.RegionLocation_\n * }}\n *\n * @property {shakaExtern.TimelineRegionInfo} info\n * The info for this timeline region.\n * @property {shaka.media.PlayheadObserver.RegionLocation_} status\n * This tracks where the region is relative to the playhead. This tracks\n * whether we are before or after the region so we can raise events if we pass\n * it.\n */\nshaka.media.PlayheadObserver.TimelineRegion;\n\n\n/** @override */\nshaka.media.PlayheadObserver.prototype.destroy = function() {\n var p = this.eventManager_ ? this.eventManager_.destroy() : Promise.resolve();\n\n this.eventManager_ = null;\n this.cancelWatchdogTimer_();\n\n this.video_ = null;\n this.manifest_ = null;\n this.config_ = null;\n this.onBuffering_ = null;\n this.onEvent_ = null;\n this.onChangePeriod_ = null;\n this.timelineRegions_ = [];\n\n return p;\n};\n\n\n/** Called when a seek completes. */\nshaka.media.PlayheadObserver.prototype.seeked = function() {\n this.timelineRegions_.forEach(\n this.updateTimelineRegion_.bind(this, /* isSeek */ true));\n};\n\n\n/**\n * Adds a new timeline region. Events will be raised whenever the playhead\n * enters or exits the given region. This method will raise a\n * 'timelineregionadded' event.\n * @param {shakaExtern.TimelineRegionInfo} regionInfo\n */\nshaka.media.PlayheadObserver.prototype.addTimelineRegion = function(\n regionInfo) {\n // Check there isn't an existing event with the same scheme ID and time range.\n // This ensures that the manifest parser doesn't need to also track which\n // events have already been added.\n var hasExistingRegion = this.timelineRegions_.some(function(existing) {\n return existing.info.schemeIdUri == regionInfo.schemeIdUri &&\n existing.info.startTime == regionInfo.startTime &&\n existing.info.endTime == regionInfo.endTime;\n });\n if (hasExistingRegion) return;\n\n var region = {\n info: regionInfo,\n status: shaka.media.PlayheadObserver.RegionLocation_.FUTURE_REGION\n };\n this.timelineRegions_.push(region);\n\n var cloneTimelineInfo_ = shaka.media.PlayheadObserver.cloneTimelineInfo_;\n var event = new shaka.util.FakeEvent(\n 'timelineregionadded', {detail: cloneTimelineInfo_(regionInfo)});\n this.onEvent_(event);\n\n // Pretend this is a seek so it will ignore if it should be PAST_REGION but\n // still fire an event if it should be INSIDE.\n this.updateTimelineRegion_(/* isSeek */ true, region);\n};\n\n\n/**\n * Clones the given TimelineRegionInfo so the app can modify it without\n * modifying our internal objects.\n * @param {shakaExtern.TimelineRegionInfo} source\n * @return {shakaExtern.TimelineRegionInfo}\n * @private\n */\nshaka.media.PlayheadObserver.cloneTimelineInfo_ = function(source) {\n var copy = shaka.util.ConfigUtils.cloneObject(source);\n // cloneObject uses JSON to clone, which won't copy the DOM element.\n copy.eventElement = source.eventElement;\n return copy;\n};\n\n\n/**\n * Updates the status of a timeline region and fires any enter/exit events.\n * @param {boolean} isSeek\n * @param {shaka.media.PlayheadObserver.TimelineRegion} region\n * @private\n */\nshaka.media.PlayheadObserver.prototype.updateTimelineRegion_ = function(\n isSeek, region) {\n var RegionLocation = shaka.media.PlayheadObserver.RegionLocation_;\n var cloneTimelineInfo_ = shaka.media.PlayheadObserver.cloneTimelineInfo_;\n\n // The events are fired when the playhead enters a region. We fire both\n // events when passing over a region and not seeking since the playhead was\n // in the region but left before we saw it. We don't fire both when seeking\n // since the playhead was never in the region.\n //\n // |--------------------------------------|\n // | From \\ To | FUTURE | INSIDE | PAST |\n // | FUTURE | | enter | both* |\n // | INSIDE | exit | | exit |\n // | PAST | both* | enter | |\n // |--------------------------------------|\n // * Only when not seeking.\n var newStatus = region.info.startTime > this.video_.currentTime ?\n RegionLocation.FUTURE_REGION :\n (region.info.endTime < this.video_.currentTime ?\n RegionLocation.PAST_REGION :\n RegionLocation.INSIDE);\n var wasInside = region.status == RegionLocation.INSIDE;\n var isInside = newStatus == RegionLocation.INSIDE;\n\n if (newStatus != region.status) {\n var passedRegion = !wasInside && !isInside;\n if (!(isSeek && passedRegion)) {\n if (!wasInside) {\n this.onEvent_(new shaka.util.FakeEvent(\n 'timelineregionenter',\n {'detail': cloneTimelineInfo_(region.info)}));\n }\n if (!isInside) {\n this.onEvent_(new shaka.util.FakeEvent(\n 'timelineregionexit', {'detail': cloneTimelineInfo_(region.info)}));\n }\n }\n region.status = newStatus;\n }\n};\n\n\n/**\n * Starts the watchdog timer.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.startWatchdogTimer_ = function() {\n this.cancelWatchdogTimer_();\n this.watchdogTimer_ =\n window.setTimeout(this.onWatchdogTimer_.bind(this), 250);\n};\n\n\n/**\n * Cancels the watchdog timer, if any.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.cancelWatchdogTimer_ = function() {\n if (this.watchdogTimer_) {\n window.clearTimeout(this.watchdogTimer_);\n this.watchdogTimer_ = null;\n }\n};\n\n\n/**\n * Called on a recurring timer to detect buffering events and Period changes.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.onWatchdogTimer_ = function() {\n this.watchdogTimer_ = null;\n this.startWatchdogTimer_();\n\n goog.asserts.assert(this.manifest_ && this.config_, 'Must not be destroyed');\n var newPeriod = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.video_.currentTime);\n if (newPeriod != this.curPeriodIndex_) {\n // Ignore seek to start time, the first 'trackschanged' event is handled\n // during player.load().\n if (this.curPeriodIndex_ != -1)\n this.onChangePeriod_();\n this.curPeriodIndex_ = newPeriod;\n }\n\n // This uses an intersection of buffered ranges for both audio and video, so\n // it's an accurate way to determine if we are buffering or not.\n var bufferedAhead = shaka.media.TimeRangesUtils.bufferedAheadOf(\n this.video_.buffered, this.video_.currentTime);\n var bufferEnd = shaka.media.TimeRangesUtils.bufferEnd(this.video_.buffered);\n\n var fudgeFactor = shaka.media.PlayheadObserver.FUDGE_FACTOR_;\n var threshold = shaka.media.PlayheadObserver.UNDERFLOW_THRESHOLD_;\n\n var timeline = this.manifest_.presentationTimeline;\n var duration = timeline.getSegmentAvailabilityEnd() - fudgeFactor;\n\n var atEnd = (bufferEnd >= duration) || (this.video_.ended);\n if (!this.buffering_) {\n // If there are no buffered ranges but the playhead is at the end of\n // the video then we shouldn't enter a buffering state.\n if (!atEnd && bufferedAhead < threshold) {\n this.setBuffering_(true);\n }\n } else {\n var rebufferingGoal = shaka.util.StreamUtils.getRebufferingGoal(\n this.manifest_, this.config_, 1 /* scaleFactor */);\n if (atEnd || bufferedAhead >= rebufferingGoal) {\n this.setBuffering_(false);\n }\n }\n\n this.timelineRegions_.forEach(\n this.updateTimelineRegion_.bind(this, /* isSeek */ false));\n};\n\n\n/**\n * Stops the playhead for buffering, or resumes the playhead after buffering.\n *\n * @param {boolean} buffering True to stop the playhead; false to allow it to\n * continue.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.setBuffering_ = function(buffering) {\n if (buffering != this.buffering_) {\n this.buffering_ = buffering;\n this.onBuffering_(buffering);\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/playhead_observer.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.StreamingEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.MediaSourceEngine');\ngoog.require('shaka.media.Playhead');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.Mp4Parser');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * Creates a StreamingEngine.\n *\n * The StreamingEngine is responsible for setting up the Manifest's Streams\n * (i.e., for calling each Stream's createSegmentIndex() function), for\n * downloading segments, for co-ordinating audio, video, and text buffering,\n * and for handling Period transitions. The StreamingEngine provides an\n * interface to switch between Streams, but it does not choose which Streams to\n * switch to.\n *\n * The StreamingEngine notifies its owner when it needs to buffer a new Period,\n * so its owner can choose which Streams within that Period to initially\n * buffer. Moreover, the StreamingEngine also notifies its owner when any\n * Stream within the current Period may be switched to, so its owner can switch\n * bitrates, resolutions, or languages.\n *\n * The StreamingEngine does not need to be notified about changes to the\n * Manifest's SegmentIndexes; however, it does need to be notified when new\n * Periods are added to the Manifest, so it can set up that Period's Streams.\n *\n * To start the StreamingEngine the owner must first call configure() followed\n * by init(). The StreamingEngine will then call onChooseStreams(p) when it\n * needs to buffer Period p; it will then switch to the Streams returned from\n * that function. The StreamingEngine will call onCanSwitch() when any\n * Stream within the current Period may be switched to.\n *\n * The owner must call seeked() each time the playhead moves to a new location\n * within the presentation timeline; however, the owner may forego calling\n * seeked() when the playhead moves outside the presentation timeline.\n *\n * @param {shakaExtern.Manifest} manifest\n * @param {shaka.media.StreamingEngine.PlayerInterface} playerInterface\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.StreamingEngine = function(manifest, playerInterface) {\n /** @private {?shaka.media.StreamingEngine.PlayerInterface} */\n this.playerInterface_ = playerInterface;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = manifest;\n\n /** @private {?shakaExtern.StreamingConfiguration} */\n this.config_ = null;\n\n /** @private {number} */\n this.bufferingGoalScale_ = 1;\n\n /** @private {Promise} */\n this.setupPeriodPromise_ = Promise.resolve();\n\n /**\n * Maps a Period's index to an object that indicates that either\n * 1. the Period has not been set up (undefined)\n * 2. the Period is being set up ([a PublicPromise, false]),\n * 3. the Period is set up (i.e., all Streams within the Period are set up)\n * and can be switched to ([a PublicPromise, true]).\n *\n * @private {Array.<?{promise: shaka.util.PublicPromise, resolved: boolean}>}\n */\n this.canSwitchPeriod_ = [];\n\n /**\n * Maps a Stream's ID to an object that indicates that either\n * 1. the Stream has not been set up (undefined)\n * 2. the Stream is being set up ([a Promise instance, false]),\n * 3. the Stream is set up and can be switched to\n * ([a Promise instance, true]).\n *\n * @private {Object.<number,\n * ?{promise: shaka.util.PublicPromise, resolved: boolean}>}\n */\n this.canSwitchStream_ = {};\n\n /**\n * Maps a content type, e.g., 'audio', 'video', or 'text', to a MediaState.\n *\n * @private {Object.<shaka.util.ManifestParserUtils.ContentType,\n !shaka.media.StreamingEngine.MediaState_>}\n */\n this.mediaStates_ = {};\n\n /**\n * Set to true once one segment of each content type has been buffered.\n *\n * @private {boolean}\n */\n this.startupComplete_ = false;\n\n /**\n * Set to true on fatal error. Interrupts fetchAndAppend_().\n *\n * @private {boolean}\n */\n this.fatalError_ = false;\n\n /** @private {boolean} */\n this.destroyed_ = false;\n};\n\n\n/**\n * @typedef {{\n * playhead: !shaka.media.Playhead,\n * mediaSourceEngine: !shaka.media.MediaSourceEngine,\n * netEngine: shaka.net.NetworkingEngine,\n * onChooseStreams: function(!shakaExtern.Period):\n * !Object.<shaka.util.ManifestParserUtils.ContentType,\n * shakaExtern.Stream>,\n * onCanSwitch: function(),\n * onError: function(!shaka.util.Error),\n * onEvent: function(!Event),\n * onManifestUpdate: function(),\n * onSegmentAppended: function(),\n * onInitialStreamsSetup: (function()|undefined),\n * onStartupComplete: (function()|undefined)}\n * }}\n *\n * @property {!shaka.media.Playhead} playhead\n * The Playhead. The caller retains ownership.\n * @property {!shaka.media.MediaSourceEngine} mediaSourceEngine\n * The MediaSourceEngine. The caller retains ownership.\n * @property {shaka.net.NetworkingEngine} netEngine\n * The NetworkingEngine instance to use. The caller retains ownership.\n * @property {function(!shakaExtern.Period):\n * !Object.<shaka.util.ManifestParserUtils.ContentType,\n * shakaExtern.Stream>} onChooseStreams\n * Called when the given Period needs to be buffered. The\n * StreamingEngine will switch to the Streams returned from this function.\n * The caller cannot call switch() directly until the StreamingEngine calls\n * onCanSwitch()\n * @property {function()} onCanSwitch\n * Called when any Stream within the current Period may be switched to.\n * @property {function(!shaka.util.Error)} onError\n * Called when an error occurs. If the error is recoverable (see\n * @link{shaka.util.Error}) then the caller may invoke either\n * StreamingEngine.switch() or StreamingEngine.seeked() to attempt recovery.\n * @property {function(!Event)} onEvent\n * Called when an event occurs that should be sent to the app.\n * @property {function()} onManifestUpdate\n * Called when an embedded 'emsg' box should trigger a manifest update.\n * @property {function()} onSegmentAppended\n * Called after a segment is successfully appended to a MediaSource.\n * @property {(function()|undefined)} onInitialStreamsSetup\n * Optional callback which is called when the initial set of Streams have been\n * setup. Intended to be used by tests.\n * @property {(function()|undefined)} onStartupComplete\n * Optional callback which is called when startup has completed. Intended to\n * be used by tests.\n */\nshaka.media.StreamingEngine.PlayerInterface;\n\n\n/**\n * @typedef {{\n * type: shaka.util.ManifestParserUtils.ContentType,\n * stream: shakaExtern.Stream,\n * lastStream: ?shakaExtern.Stream,\n * lastSegmentReference: shaka.media.SegmentReference,\n * restoreStreamAfterTrickPlay: ?shakaExtern.Stream,\n * needInitSegment: boolean,\n * needPeriodIndex: number,\n * endOfStream: boolean,\n * performingUpdate: boolean,\n * updateTimer: ?number,\n * waitingToClearBuffer: boolean,\n * waitingToFlushBuffer: boolean,\n * clearingBuffer: boolean,\n * recovering: boolean,\n * hasError: boolean,\n * resumeAt: number\n * }}\n *\n * @description\n * Contains the state of a logical stream, i.e., a sequence of segmented data\n * for a particular content type. At any given time there is a Stream object\n * associated with the state of the logical stream.\n *\n * @property {shaka.util.ManifestParserUtils.ContentType} type\n * The stream's content type, e.g., 'audio', 'video', or 'text'.\n * @property {shakaExtern.Stream} stream\n * The current Stream.\n * @property {?shakaExtern.Stream} lastStream\n * The Stream of the last segment that was appended.\n * @property {shaka.media.SegmentReference} lastSegmentReference\n * The SegmentReference of the last segment that was appended.\n * @property {?shakaExtern.Stream} restoreStreamAfterTrickPlay\n * The Stream to restore after trick play mode is turned off.\n * @property {boolean} needInitSegment\n * True indicates that |stream|'s init segment must be inserted before the\n * next media segment is appended.\n * @property {boolean} endOfStream\n * True indicates that the end of the buffer has hit the end of the\n * presentation.\n * @property {number} needPeriodIndex\n * The index of the Period which needs to be buffered.\n * @property {boolean} performingUpdate\n * True indicates that an update is in progress.\n * @property {?number} updateTimer\n * A non-null value indicates that an update is scheduled.\n * @property {boolean} waitingToClearBuffer\n * True indicates that the buffer must be cleared after the current update\n * finishes.\n * @property {boolean} waitingToFlushBuffer\n * True indicates that the buffer must be flushed after it is cleared.\n * @property {boolean} clearingBuffer\n * True indicates that the buffer is being cleared.\n * @property {boolean} recovering\n * True indicates that the last segment was not appended because it could not\n * fit in the buffer.\n * @property {boolean} hasError\n * True indicates that the stream has encountered an error and has stopped\n * updates.\n * @property {number} resumeAt\n * An override for the time to start performing updates at. If the playhead\n * is behind this time, update_() will still start fetching segments from\n * this time. If the playhead is ahead of the time, this field is ignored.\n */\nshaka.media.StreamingEngine.MediaState_;\n\n\n/**\n * The minimum number seconds that will remain buffered after evicting media.\n *\n * @const {number}\n */\nshaka.media.StreamingEngine.prototype.MIN_BUFFER_LENGTH = 2;\n\n\n/** @override */\nshaka.media.StreamingEngine.prototype.destroy = function() {\n for (var type in this.mediaStates_) {\n this.cancelUpdate_(this.mediaStates_[type]);\n }\n\n this.playerInterface_ = null;\n this.manifest_ = null;\n this.setupPeriodPromise_ = null;\n this.canSwitchPeriod_ = null;\n this.canSwitchStream_ = null;\n this.mediaStates_ = null;\n this.config_ = null;\n\n this.destroyed_ = true;\n\n return Promise.resolve();\n};\n\n\n/**\n * Called by the Player to provide an updated configuration any time it changes.\n * Will be called at least once before init().\n *\n * @param {shakaExtern.StreamingConfiguration} config\n */\nshaka.media.StreamingEngine.prototype.configure = function(config) {\n this.config_ = config;\n};\n\n\n/**\n * Initializes the StreamingEngine.\n *\n * After this function is called the StreamingEngine will call\n * onChooseStreams(p) when it needs to buffer Period p and onCanSwitch() when\n * any Stream within that Period may be switched to.\n *\n * After the StreamingEngine calls onChooseStreams(p) for the first time, it\n * will begin setting up the Streams returned from that function and\n * subsequently switch to them. However, the StreamingEngine will not begin\n * setting up any other Streams until at least one segment from each of the\n * initial set of Streams has been buffered (this reduces startup latency).\n * After the StreamingEngine completes this startup phase it will begin setting\n * up each Period's Streams (while buffering in parrallel).\n *\n * When the StreamingEngine needs to buffer the next Period it will have\n * already set up that Period's Streams. So, when the StreamingEngine calls\n * onChooseStreams(p) after the first time, the StreamingEngine will\n * immediately switch to the Streams returned from that function.\n *\n * @return {!Promise}\n */\nshaka.media.StreamingEngine.prototype.init = function() {\n var MapUtils = shaka.util.MapUtils;\n goog.asserts.assert(this.config_,\n 'StreamingEngine configure() must be called before init()!');\n\n // Determine which Period we must buffer.\n var playheadTime = this.playerInterface_.playhead.getTime();\n var needPeriodIndex = this.findPeriodContainingTime_(playheadTime);\n\n // Get the initial set of Streams.\n var streamsByType = this.playerInterface_.onChooseStreams(\n this.manifest_.periods[needPeriodIndex]);\n if (MapUtils.empty(streamsByType)) {\n shaka.log.error('init: no Streams chosen');\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STREAMING,\n shaka.util.Error.Code.INVALID_STREAMS_CHOSEN));\n }\n\n // Setup the initial set of Streams and then begin each update cycle. After\n // startup completes onUpdate_() will set up the remaining Periods.\n return this.initStreams_(streamsByType).then(function() {\n shaka.log.debug('init: completed initial Stream setup');\n\n // Subtlety: onInitialStreamsSetup() may call switch() or seeked(), so we\n // must schedule an update beforehand so |updateTimer| is set.\n if (this.playerInterface_ && this.playerInterface_.onInitialStreamsSetup) {\n shaka.log.v1('init: calling onInitialStreamsSetup()...');\n this.playerInterface_.onInitialStreamsSetup();\n }\n }.bind(this));\n};\n\n\n/**\n * Gets the current Period the stream is in. This Period may not be initialized\n * yet if canSwitch(period) has not been called yet.\n * @return {shakaExtern.Period}\n */\nshaka.media.StreamingEngine.prototype.getCurrentPeriod = function() {\n var playheadTime = this.playerInterface_.playhead.getTime();\n var needPeriodIndex = this.findPeriodContainingTime_(playheadTime);\n return this.manifest_.periods[needPeriodIndex];\n};\n\n\n/**\n * Gets the Period in which we are currently buffering. This may be different\n * from the Period which contains the Playhead.\n * @return {?shakaExtern.Period}\n */\nshaka.media.StreamingEngine.prototype.getActivePeriod = function() {\n goog.asserts.assert(this.mediaStates_, 'Must be initialized');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var anyMediaState = this.mediaStates_[ContentType.VIDEO] ||\n this.mediaStates_[ContentType.AUDIO];\n return anyMediaState ?\n this.manifest_.periods[anyMediaState.needPeriodIndex] : null;\n};\n\n\n/**\n * Gets a map of all the active streams.\n * @return {!Object.<shaka.util.ManifestParserUtils.ContentType,\n * shakaExtern.Stream>}\n */\nshaka.media.StreamingEngine.prototype.getActiveStreams = function() {\n goog.asserts.assert(this.mediaStates_, 'Must be initialized');\n var MapUtils = shaka.util.MapUtils;\n return MapUtils.map(\n this.mediaStates_, function(state) {\n // Don't tell the caller about trick play streams. If we're in trick\n // play, return the stream we will go back to after we exit trick play.\n return state.restoreStreamAfterTrickPlay || state.stream;\n });\n};\n\n\n/**\n * Notifies StreamingEngine that a new text stream was added to the manifest.\n * This initializes the given stream. This returns a Promise that resolves when\n * the stream has been set up.\n *\n * @param {shakaExtern.Stream} stream\n * @return {!Promise}\n */\nshaka.media.StreamingEngine.prototype.notifyNewTextStream = function(stream) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n // Create empty object first and initialize the fields through\n // [] to allow field names to be expressions.\n /** @type {!Object.<string, shakaExtern.Stream>} */\n var streamsByType = {};\n streamsByType[ContentType.TEXT] = stream;\n return this.initStreams_(streamsByType);\n};\n\n\n/**\n * Set trick play on or off.\n * If trick play is on, related trick play streams will be used when possible.\n * @param {boolean} on\n */\nshaka.media.StreamingEngine.prototype.setTrickPlay = function(on) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var mediaState = this.mediaStates_[ContentType.VIDEO];\n if (!mediaState) return;\n\n var stream = mediaState.stream;\n if (!stream) return;\n\n shaka.log.debug('setTrickPlay', on);\n if (on) {\n var trickModeVideo = stream.trickModeVideo;\n if (!trickModeVideo) return; // Can't engage trick play.\n\n var normalVideo = mediaState.restoreStreamAfterTrickPlay;\n if (normalVideo) return; // Already in trick play.\n\n shaka.log.debug('Engaging trick mode stream', trickModeVideo);\n this.switch(ContentType.VIDEO, trickModeVideo, false);\n mediaState.restoreStreamAfterTrickPlay = stream;\n } else {\n var normalVideo = mediaState.restoreStreamAfterTrickPlay;\n if (!normalVideo) return;\n\n shaka.log.debug('Restoring non-trick-mode stream', normalVideo);\n mediaState.restoreStreamAfterTrickPlay = null;\n this.switch(ContentType.VIDEO, normalVideo, true);\n }\n};\n\n\n/**\n * Switches to the given Stream. |stream| may be from any Variant or any\n * Period.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * |stream|'s content type.\n * @param {shakaExtern.Stream} stream\n * @param {boolean} clearBuffer\n */\nshaka.media.StreamingEngine.prototype.switch = function(\n contentType, stream, clearBuffer) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var mediaState = this.mediaStates_[contentType];\n if (!mediaState && contentType == ContentType.TEXT &&\n this.config_.ignoreTextStreamFailures) {\n this.notifyNewTextStream(stream);\n return;\n }\n goog.asserts.assert(mediaState, 'switch: expected mediaState to exist');\n if (!mediaState) return;\n\n // If we are selecting a stream from a different Period, then we need to\n // handle a Period transition. Simply ignore the given stream, assuming that\n // Player will select the same track in onChooseStreams.\n var periodIndex = this.findPeriodContainingStream_(stream);\n if (clearBuffer && periodIndex != mediaState.needPeriodIndex) {\n shaka.log.debug('switch: switching to stream in another Period; clearing ' +\n 'buffer and changing Periods');\n // handlePeriodTransition_ will be called on the next update because the\n // current Period won't match the playhead Period.\n this.clearAllBuffers_();\n return;\n }\n\n if (mediaState.restoreStreamAfterTrickPlay) {\n shaka.log.debug('switch during trick play mode', stream);\n\n // Already in trick play mode, so stick with trick mode tracks if possible.\n if (stream.trickModeVideo) {\n // Use the trick mode stream, but revert to the new selection later.\n mediaState.restoreStreamAfterTrickPlay = stream;\n stream = stream.trickModeVideo;\n shaka.log.debug('switch found trick play stream', stream);\n } else {\n // No special trick mode video for this stream!\n mediaState.restoreStreamAfterTrickPlay = null;\n shaka.log.debug('switch found no special trick play stream');\n }\n }\n\n if (contentType == ContentType.TEXT) {\n // Mime types are allowed to change for text streams.\n // Reinitialize the text parser.\n var fullMimeType = shaka.util.StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n this.playerInterface_.mediaSourceEngine.reinitText(fullMimeType);\n }\n\n // Ensure the Period is ready.\n var canSwitchRecord = this.canSwitchPeriod_[periodIndex];\n goog.asserts.assert(\n canSwitchRecord && canSwitchRecord.resolved,\n 'switch: expected Period ' + periodIndex + ' to be ready');\n if (!canSwitchRecord || !canSwitchRecord.resolved) return;\n\n // Sanity check. If the Period is ready then the Stream should be ready too.\n canSwitchRecord = this.canSwitchStream_[stream.id];\n goog.asserts.assert(canSwitchRecord && canSwitchRecord.resolved,\n 'switch: expected Stream ' + stream.id + ' to be ready');\n if (!canSwitchRecord || !canSwitchRecord.resolved) return;\n\n if (mediaState.stream == stream) {\n var streamTag = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.debug('switch: Stream ' + streamTag + ' already active');\n return;\n }\n\n mediaState.stream = stream;\n mediaState.needInitSegment = true;\n\n var streamTag = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.debug('switch: switching to Stream ' + streamTag);\n\n if (clearBuffer) {\n if (mediaState.clearingBuffer) {\n // We are already going to clear the buffer, but make sure it is also\n // flushed.\n mediaState.waitingToFlushBuffer = true;\n } else if (mediaState.performingUpdate) {\n // We are performing an update, so we have to wait until it's finished.\n // onUpdate_() will call clearBuffer_() when the update has\n // finished.\n mediaState.waitingToClearBuffer = true;\n mediaState.waitingToFlushBuffer = true;\n } else {\n // Cancel the update timer, if any.\n this.cancelUpdate_(mediaState);\n // Clear right away.\n this.clearBuffer_(mediaState, /* flush */ true);\n }\n }\n};\n\n\n/**\n * Notifies the StreamingEngine that the playhead has moved to a valid time\n * within the presentation timeline.\n */\nshaka.media.StreamingEngine.prototype.seeked = function() {\n goog.asserts.assert(this.mediaStates_, 'Must not be destroyed');\n\n var playheadTime = this.playerInterface_.playhead.getTime();\n var isAllBuffered = Object.keys(this.mediaStates_).every(function(type) {\n return this.playerInterface_.mediaSourceEngine.isBuffered(\n type, playheadTime);\n }.bind(this));\n\n // Only treat as a buffered seek if every media state has a buffer. For\n // example, if we have buffered text but not video, we should still clear\n // every buffer so all media states need the same Period.\n if (isAllBuffered) {\n shaka.log.debug(\n '(all): seeked: buffered seek: playheadTime=' + playheadTime);\n return;\n }\n\n // This was an unbuffered seek (for at least one stream), clear all buffers.\n // Don't clear only some of the buffers because we can become stalled since\n // the media states are waiting for different Periods.\n shaka.log.debug('(all): seeked: unbuffered seek: clearing all buffers');\n this.clearAllBuffers_();\n};\n\n\n/**\n * Clears the buffer for every stream. Unlike clearBuffer_, this will handle\n * cases where a MediaState is performing an update. After this runs, every\n * MediaState will have a pending update.\n * @private\n */\nshaka.media.StreamingEngine.prototype.clearAllBuffers_ = function() {\n for (var type in this.mediaStates_) {\n var mediaState = this.mediaStates_[type];\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n if (mediaState.clearingBuffer) {\n // We're already clearing the buffer, so we don't need to clear the\n // buffer again.\n shaka.log.debug(logPrefix, 'clear: already clearing the buffer');\n continue;\n }\n\n if (mediaState.waitingToClearBuffer) {\n // May not be performing an update, but an update will still happen.\n // See: https://github.com/google/shaka-player/issues/334\n shaka.log.debug(logPrefix, 'clear: already waiting');\n continue;\n }\n\n if (mediaState.performingUpdate) {\n // We are performing an update, so we have to wait until it's finished.\n // onUpdate_() will call clearBuffer_() when the update has\n // finished.\n shaka.log.debug(logPrefix, 'clear: currently updating');\n mediaState.waitingToClearBuffer = true;\n continue;\n }\n\n if (this.playerInterface_.mediaSourceEngine.bufferStart(type) == null) {\n // Nothing buffered.\n shaka.log.debug(logPrefix, 'clear: nothing buffered');\n if (mediaState.updateTimer == null) {\n // Note: an update cycle stops when we buffer to the end of the\n // presentation or Period, or when we raise an error.\n this.scheduleUpdate_(mediaState, 0);\n }\n continue;\n }\n\n // An update may be scheduled, but we can just cancel it and clear the\n // buffer right away. Note: clearBuffer_() will schedule the next update.\n shaka.log.debug(logPrefix, 'clear: handling right now');\n this.cancelUpdate_(mediaState);\n this.clearBuffer_(mediaState, /* flush */ false);\n }\n};\n\n\n/**\n * Initializes the given streams and media states if required. This will\n * schedule updates for the given types.\n *\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType,\n shakaExtern.Stream>} streamsByType\n * @param {number=} opt_resumeAt\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.initStreams_ = function(\n streamsByType, opt_resumeAt) {\n var MapUtils = shaka.util.MapUtils;\n goog.asserts.assert(this.config_,\n 'StreamingEngine configure() must be called before init()!');\n\n // Determine which Period we must buffer.\n var playheadTime = this.playerInterface_.playhead.getTime();\n var needPeriodIndex = this.findPeriodContainingTime_(playheadTime);\n\n // Init MediaSourceEngine.\n var typeConfig = MapUtils.map(streamsByType, function(stream) {\n return shaka.util.StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n });\n\n this.playerInterface_.mediaSourceEngine.init(typeConfig);\n this.setDuration_();\n\n // Setup the initial set of Streams and then begin each update cycle. After\n // startup completes onUpdate_() will set up the remaining Periods.\n var streams = MapUtils.values(streamsByType);\n return this.setupStreams_(streams).then(function() {\n if (this.destroyed_) return;\n\n for (var type in streamsByType) {\n var stream = streamsByType[type];\n if (!this.mediaStates_[type]) {\n this.mediaStates_[type] = {\n stream: stream,\n type: type,\n lastStream: null,\n lastSegmentReference: null,\n restoreStreamAfterTrickPlay: null,\n needInitSegment: true,\n needPeriodIndex: needPeriodIndex,\n endOfStream: false,\n performingUpdate: false,\n updateTimer: null,\n waitingToClearBuffer: false,\n waitingToFlushBuffer: false,\n clearingBuffer: false,\n recovering: false,\n hasError: false,\n resumeAt: opt_resumeAt || 0\n };\n this.scheduleUpdate_(this.mediaStates_[type], 0);\n }\n }\n }.bind(this));\n};\n\n\n/**\n * Sets up the given Period if necessary. Calls onError() if an error\n * occurs.\n *\n * @param {number} periodIndex The Period's index.\n * @return {!Promise} A Promise which is resolved when the given Period is\n * setup.\n * @private\n */\nshaka.media.StreamingEngine.prototype.setupPeriod_ = function(periodIndex) {\n var Functional = shaka.util.Functional;\n var canSwitchRecord = this.canSwitchPeriod_[periodIndex];\n if (canSwitchRecord) {\n shaka.log.debug(\n '(all) Period ' + periodIndex + ' is being or has been set up');\n goog.asserts.assert(canSwitchRecord.promise, 'promise must not be null');\n return canSwitchRecord.promise;\n }\n\n shaka.log.debug('(all) setting up Period ' + periodIndex);\n canSwitchRecord = {\n promise: new shaka.util.PublicPromise(),\n resolved: false\n };\n this.canSwitchPeriod_[periodIndex] = canSwitchRecord;\n\n var streams = this.manifest_.periods[periodIndex].variants\n .map(function(variant) {\n var result = [];\n if (variant.audio)\n result.push(variant.audio);\n if (variant.video)\n result.push(variant.video);\n if (variant.video && variant.video.trickModeVideo)\n result.push(variant.video.trickModeVideo);\n return result;\n })\n .reduce(Functional.collapseArrays, [])\n .filter(Functional.isNotDuplicate);\n\n // Add text streams\n streams.push.apply(streams, this.manifest_.periods[periodIndex].textStreams);\n\n // Serialize Period set up.\n this.setupPeriodPromise_ = this.setupPeriodPromise_.then(function() {\n if (this.destroyed_) return;\n return this.setupStreams_(streams);\n }.bind(this)).then(function() {\n if (this.destroyed_) return;\n this.canSwitchPeriod_[periodIndex].promise.resolve();\n this.canSwitchPeriod_[periodIndex].resolved = true;\n shaka.log.v1('(all) setup Period ' + periodIndex);\n }.bind(this)).catch(function(error) {\n if (this.destroyed_) return;\n this.canSwitchPeriod_[periodIndex].promise.reject();\n delete this.canSwitchPeriod_[periodIndex];\n shaka.log.warning('(all) failed to setup Period ' + periodIndex);\n this.playerInterface_.onError(error);\n // Don't stop other Periods from being set up.\n }.bind(this));\n\n return canSwitchRecord.promise;\n};\n\n\n/**\n * Sets up the given Streams if necessary. Does NOT call onError() if an\n * error occurs.\n *\n * @param {!Array.<!shakaExtern.Stream>} streams\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.setupStreams_ = function(streams) {\n // Make sure that all the streams have unique ids.\n // (Duplicate ids will cause the player to hang).\n var uniqueStreamIds = streams.map(function(s) { return s.id; })\n .filter(shaka.util.Functional.isNotDuplicate);\n\n goog.asserts.assert(uniqueStreamIds.length == streams.length,\n 'streams should have unique ids');\n // Parallelize Stream set up.\n var async = [];\n\n for (var i = 0; i < streams.length; ++i) {\n var stream = streams[i];\n var canSwitchRecord = this.canSwitchStream_[stream.id];\n\n if (canSwitchRecord) {\n shaka.log.debug(\n '(all) Stream ' + stream.id + ' is being or has been set up');\n async.push(canSwitchRecord.promise);\n } else {\n shaka.log.v1('(all) setting up Stream ' + stream.id);\n this.canSwitchStream_[stream.id] = {\n promise: new shaka.util.PublicPromise(),\n resolved: false\n };\n async.push(stream.createSegmentIndex());\n }\n }\n\n return Promise.all(async).then(function() {\n if (this.destroyed_) return;\n\n for (var i = 0; i < streams.length; ++i) {\n var stream = streams[i];\n var canSwitchRecord = this.canSwitchStream_[stream.id];\n if (!canSwitchRecord.resolved) {\n canSwitchRecord.promise.resolve();\n canSwitchRecord.resolved = true;\n shaka.log.v1('(all) setup Stream ' + stream.id);\n }\n }\n }.bind(this)).catch(function(error) {\n if (this.destroyed_) return;\n this.canSwitchStream_[stream.id].promise.reject();\n delete this.canSwitchStream_[stream.id];\n return Promise.reject(error);\n }.bind(this));\n};\n\n\n/**\n * Sets the MediaSource's duration.\n * @private\n */\nshaka.media.StreamingEngine.prototype.setDuration_ = function() {\n var duration = this.manifest_.presentationTimeline.getDuration();\n if (duration < Infinity) {\n this.playerInterface_.mediaSourceEngine.setDuration(duration);\n } else {\n // Not all platforms support infinite durations, so set a finite duration\n // so we can append segments and so the user agent can seek.\n this.playerInterface_.mediaSourceEngine.setDuration(Math.pow(2, 32));\n }\n};\n\n\n/**\n * Called when |mediaState|'s update timer has expired.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @private\n */\nshaka.media.StreamingEngine.prototype.onUpdate_ = function(mediaState) {\n var MapUtils = shaka.util.MapUtils;\n if (this.destroyed_) return;\n\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n // Sanity check.\n goog.asserts.assert(\n !mediaState.performingUpdate && (mediaState.updateTimer != null),\n logPrefix + ' unexpected call to onUpdate_()');\n if (mediaState.performingUpdate || (mediaState.updateTimer == null)) return;\n\n goog.asserts.assert(\n !mediaState.clearingBuffer,\n logPrefix + ' onUpdate_() should not be called when clearing the buffer');\n if (mediaState.clearingBuffer) return;\n\n mediaState.updateTimer = null;\n\n // Handle pending buffer clears.\n if (mediaState.waitingToClearBuffer) {\n // Note: clearBuffer_() will schedule the next update.\n shaka.log.debug(logPrefix, 'skipping update and clearing the buffer');\n this.clearBuffer_(mediaState, mediaState.waitingToFlushBuffer);\n return;\n }\n\n // Update the MediaState.\n try {\n var delay = this.update_(mediaState);\n if (delay != null) {\n this.scheduleUpdate_(mediaState, delay);\n mediaState.hasError = false;\n }\n } catch (error) {\n this.playerInterface_.onError(error);\n return;\n }\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n\n var mediaStates = MapUtils.values(this.mediaStates_);\n\n // Check if we've buffered to the end of the Period.\n this.handlePeriodTransition_(mediaState);\n\n // Check if we've buffered to the end of the presentation.\n if (mediaStates.every(function(ms) { return ms.endOfStream; })) {\n shaka.log.v1(logPrefix, 'calling endOfStream()...');\n this.playerInterface_.mediaSourceEngine.endOfStream().then(function() {\n // If the media segments don't reach the end, then we need to update the\n // timeline duration to match the final media duration to avoid buffering\n // forever at the end.\n var duration = this.playerInterface_.mediaSourceEngine.getDuration();\n this.manifest_.presentationTimeline.setDuration(duration);\n }.bind(this));\n }\n};\n\n\n/**\n * Updates the given MediaState.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @return {?number} The number of seconds to wait until updating again or\n * null if another update does not need to be scheduled.\n * @throws {!shaka.util.Error} if an error occurs.\n * @private\n */\nshaka.media.StreamingEngine.prototype.update_ = function(mediaState) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n // Compute how far we've buffered ahead of the playhead.\n var playheadTime = this.playerInterface_.playhead.getTime();\n\n // Get the next timestamp we need.\n var timeNeeded = this.getTimeNeeded_(mediaState, playheadTime);\n shaka.log.v2(logPrefix, 'timeNeeded=' + timeNeeded);\n mediaState.resumeAt = 0;\n\n var currentPeriodIndex = this.findPeriodContainingStream_(mediaState.stream);\n var needPeriodIndex = this.findPeriodContainingTime_(timeNeeded);\n\n // Get the amount of content we have buffered, accounting for drift. This\n // is only used to determine if we have meet the buffering goal. This should\n // be the same way that PlayheadObserver uses.\n var bufferedAhead = this.playerInterface_.mediaSourceEngine.bufferedAheadOf(\n mediaState.type, playheadTime);\n\n shaka.log.v2(logPrefix,\n 'update_:',\n 'playheadTime=' + playheadTime,\n 'bufferedAhead=' + bufferedAhead);\n\n var bufferingGoal = this.getBufferingGoal_();\n\n // Check if we've buffered to the end of the presentation.\n if (timeNeeded >= this.manifest_.presentationTimeline.getDuration()) {\n // We shouldn't rebuffer if the playhead is close to the end of the\n // presentation.\n shaka.log.debug(logPrefix, 'buffered to end of presentation');\n mediaState.endOfStream = true;\n return null;\n }\n mediaState.endOfStream = false;\n\n // Check if we've buffered to the end of the Period. This should be done\n // before checking segment availability because the new Period may become\n // available once it's switched to. Note that we don't use the non-existence\n // of SegmentReferences as an indicator to determine Period boundaries\n // because SegmentIndexes can provide SegmentReferences outside its Period.\n mediaState.needPeriodIndex = needPeriodIndex;\n if (needPeriodIndex != currentPeriodIndex) {\n shaka.log.debug(logPrefix,\n 'need Period ' + needPeriodIndex,\n 'playheadTime=' + playheadTime,\n 'timeNeeded=' + timeNeeded,\n 'currentPeriodIndex=' + currentPeriodIndex);\n return null;\n }\n\n // If we've buffered to the buffering goal then schedule an update.\n if (bufferedAhead >= bufferingGoal) {\n shaka.log.v2(logPrefix, 'buffering goal met');\n\n // Do not try to predict the next update. Just poll twice every second.\n // The playback rate can change at any time, so any prediction we make now\n // could be terribly invalid soon.\n return 0.5;\n }\n\n var bufferEnd =\n this.playerInterface_.mediaSourceEngine.bufferEnd(mediaState.type);\n var reference = this.getSegmentReferenceNeeded_(\n mediaState, playheadTime, bufferEnd, currentPeriodIndex);\n if (!reference) {\n // The segment could not be found, does not exist, or is not available. In\n // any case just try again... if the manifest is incomplete or is not being\n // updated then we'll idle forever; otherwise, we'll end up getting a\n // SegmentReference eventually.\n return 1;\n }\n\n this.fetchAndAppend_(mediaState, playheadTime, currentPeriodIndex, reference);\n return null;\n};\n\n\n/**\n * Computes buffering goal.\n *\n * @return {number}\n * @private\n */\nshaka.media.StreamingEngine.prototype.getBufferingGoal_ = function() {\n goog.asserts.assert(this.manifest_, 'manifest_ should not be null');\n goog.asserts.assert(this.config_, 'config_ should not be null');\n\n var rebufferingGoal = shaka.util.StreamUtils.getRebufferingGoal(\n this.manifest_, this.config_, this.bufferingGoalScale_);\n\n return Math.max(\n rebufferingGoal,\n this.bufferingGoalScale_ * this.config_.bufferingGoal);\n};\n\n\n/**\n * Gets the next timestamp needed. Returns the playhead's position if the\n * buffer is empty; otherwise, returns the time at which the last segment\n * appended ends.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @return {number} The next timestamp needed.\n * @throws {!shaka.util.Error} if the buffer is inconsistent with our\n * expectations.\n * @private\n */\nshaka.media.StreamingEngine.prototype.getTimeNeeded_ = function(\n mediaState, playheadTime) {\n // Get the next timestamp we need. We must use |lastSegmentReference|\n // to determine this and not the actual buffer for two reasons:\n // 1. actual segments end slightly before their advertised end times, so\n // the next timestamp we need is actually larger than |bufferEnd|; and\n // 2. there may be drift (the timestamps in the segments are ahead/behind\n // of the timestamps in the manifest), but we need drift free times when\n // comparing times against presentation and Period boundaries.\n if (!mediaState.lastStream || !mediaState.lastSegmentReference) {\n return Math.max(playheadTime, mediaState.resumeAt);\n }\n\n var lastPeriodIndex =\n this.findPeriodContainingStream_(mediaState.lastStream);\n var lastPeriod = this.manifest_.periods[lastPeriodIndex];\n return lastPeriod.startTime + mediaState.lastSegmentReference.endTime;\n};\n\n\n/**\n * Gets the SegmentReference of the next segment needed.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @param {?number} bufferEnd\n * @param {number} currentPeriodIndex\n * @return {shaka.media.SegmentReference} The SegmentReference of the\n * next segment needed, or null if a segment could not be found, does not\n * exist, or is not available.\n * @private\n */\nshaka.media.StreamingEngine.prototype.getSegmentReferenceNeeded_ = function(\n mediaState, playheadTime, bufferEnd, currentPeriodIndex) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n if (mediaState.lastSegmentReference &&\n mediaState.stream == mediaState.lastStream) {\n // Something is buffered from the same Stream.\n var position = mediaState.lastSegmentReference.position + 1;\n shaka.log.v2(logPrefix, 'next position known:', 'position=' + position);\n\n return this.getSegmentReferenceIfAvailable_(\n mediaState, currentPeriodIndex, position);\n }\n\n var position;\n\n if (mediaState.lastSegmentReference) {\n // Something is buffered from another Stream.\n goog.asserts.assert(mediaState.lastStream, 'lastStream should not be null');\n shaka.log.v1(logPrefix, 'next position unknown: another Stream buffered');\n var lastPeriodIndex =\n this.findPeriodContainingStream_(mediaState.lastStream);\n var lastPeriod = this.manifest_.periods[lastPeriodIndex];\n position = this.lookupSegmentPosition_(\n mediaState,\n lastPeriod.startTime + mediaState.lastSegmentReference.endTime,\n currentPeriodIndex);\n } else {\n // Either nothing is buffered, or we have cleared part of the buffer. If\n // we still have some buffered, use that time to find the segment, otherwise\n // start at the playhead time.\n goog.asserts.assert(!mediaState.lastStream, 'lastStream should be null');\n shaka.log.v1(logPrefix, 'next position unknown: nothing buffered');\n position = this.lookupSegmentPosition_(\n mediaState, bufferEnd || playheadTime, currentPeriodIndex);\n }\n\n if (position == null)\n return null;\n\n var reference = null;\n if (bufferEnd == null) {\n // If there's positive drift then we need to get the previous segment;\n // however, we don't actually know how much drift there is, so we must\n // unconditionally get the previous segment. If it turns out that there's\n // non-positive drift then we'll just end up buffering beind the playhead a\n // little more than we needed.\n var optimalPosition = Math.max(0, position - 1);\n reference = this.getSegmentReferenceIfAvailable_(\n mediaState, currentPeriodIndex, optimalPosition);\n }\n return reference ||\n this.getSegmentReferenceIfAvailable_(\n mediaState, currentPeriodIndex, position);\n};\n\n\n/**\n * Looks up the position of the segment containing the given timestamp.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} presentationTime The timestamp needed, relative to the\n * start of the presentation.\n * @param {number} currentPeriodIndex\n * @return {?number} A segment position, or null if a segment was not be found.\n * @private\n */\nshaka.media.StreamingEngine.prototype.lookupSegmentPosition_ = function(\n mediaState, presentationTime, currentPeriodIndex) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n shaka.log.debug(logPrefix,\n 'looking up segment:',\n 'presentationTime=' + presentationTime,\n 'currentPeriod.startTime=' + currentPeriod.startTime);\n\n var lookupTime = Math.max(0, presentationTime - currentPeriod.startTime);\n var position = mediaState.stream.findSegmentPosition(lookupTime);\n\n if (position == null) {\n shaka.log.warning(logPrefix,\n 'cannot find segment:',\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'lookupTime=' + lookupTime);\n }\n\n return position;\n};\n\n\n/**\n * Gets the SegmentReference at the given position if it's available.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} currentPeriodIndex\n * @param {number} position\n * @return {shaka.media.SegmentReference}\n *\n * @private\n */\nshaka.media.StreamingEngine.prototype.getSegmentReferenceIfAvailable_ =\n function(mediaState, currentPeriodIndex, position) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n var reference = mediaState.stream.getSegmentReference(position);\n if (!reference) {\n shaka.log.v1(logPrefix,\n 'segment does not exist:',\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'position=' + position);\n return null;\n }\n\n var timeline = this.manifest_.presentationTimeline;\n var availabilityStart = timeline.getSegmentAvailabilityStart();\n var availabilityEnd = timeline.getSegmentAvailabilityEnd();\n\n if ((currentPeriod.startTime + reference.endTime < availabilityStart) ||\n (currentPeriod.startTime + reference.startTime > availabilityEnd)) {\n shaka.log.v2(logPrefix,\n 'segment is not available:',\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'reference.startTime=' + reference.startTime,\n 'reference.endTime=' + reference.endTime,\n 'availabilityStart=' + availabilityStart,\n 'availabilityEnd=' + availabilityEnd);\n return null;\n }\n\n return reference;\n};\n\n\n/**\n * Fetches and appends the given segment; sets up the given MediaState's\n * associated SourceBuffer and evicts segments if either are required\n * beforehand. Schedules another update after completing successfully.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @param {number} currentPeriodIndex The index of the current Period.\n * @param {!shaka.media.SegmentReference} reference\n * @private\n */\nshaka.media.StreamingEngine.prototype.fetchAndAppend_ = function(\n mediaState, playheadTime, currentPeriodIndex, reference) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n shaka.log.v1(logPrefix,\n 'fetchAndAppend_:',\n 'playheadTime=' + playheadTime,\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'reference.position=' + reference.position,\n 'reference.startTime=' + reference.startTime,\n 'reference.endTime=' + reference.endTime);\n\n // Subtlety: The playhead may move while asynchronous update operations are\n // in progress, so we should avoid calling playhead.getTime() in any\n // callbacks. Furthermore, switch() may be called at any time, so we should\n // also avoid using mediaState.stream or mediaState.needInitSegment in any\n // callbacks too.\n var stream = mediaState.stream;\n\n // Compute the append window end.\n var followingPeriod = this.manifest_.periods[currentPeriodIndex + 1];\n var appendWindowEnd = null;\n if (followingPeriod) {\n appendWindowEnd = followingPeriod.startTime;\n } else {\n appendWindowEnd = this.manifest_.presentationTimeline.getDuration();\n }\n goog.asserts.assert(\n (appendWindowEnd == null) || (reference.startTime <= appendWindowEnd),\n logPrefix + ' segment should start before append window end');\n\n var initSourceBuffer =\n this.initSourceBuffer_(mediaState, currentPeriodIndex, appendWindowEnd);\n\n mediaState.performingUpdate = true;\n\n // We may set |needInitSegment| to true in switch(), so set it to false here,\n // since we want it to remain true if switch() is called.\n mediaState.needInitSegment = false;\n\n shaka.log.v2(logPrefix, 'fetching segment');\n var fetchSegment = this.fetch_(reference);\n\n Promise.all([initSourceBuffer, fetchSegment]).then(function(results) {\n if (this.destroyed_ || this.fatalError_) return;\n return this.append_(mediaState,\n playheadTime,\n currentPeriod,\n stream,\n reference,\n results[1]);\n }.bind(this)).then(function() {\n if (this.destroyed_ || this.fatalError_) return;\n\n mediaState.performingUpdate = false;\n mediaState.recovering = false;\n\n if (!mediaState.waitingToClearBuffer)\n this.playerInterface_.onSegmentAppended();\n\n // Update right away.\n this.scheduleUpdate_(mediaState, 0);\n\n // Subtlety: handleStartup_() calls onStartupComplete() which may call\n // switch() or seeked(), so we must schedule an update beforehand so\n // |updateTimer| is set.\n this.handleStartup_(mediaState, stream);\n\n shaka.log.v1(logPrefix, 'finished fetch and append');\n }.bind(this)).catch(function(error) {\n if (this.destroyed_ || this.fatalError_) return;\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Should only receive a Shaka error');\n\n mediaState.performingUpdate = false;\n\n if (this.manifest_.presentationTimeline.isLive() &&\n this.config_.infiniteRetriesForLiveStreams &&\n (error.code == shaka.util.Error.Code.BAD_HTTP_STATUS ||\n error.code == shaka.util.Error.Code.HTTP_ERROR ||\n error.code == shaka.util.Error.Code.TIMEOUT)) {\n this.handleNetworkError_(mediaState, error);\n } else if (error.code == shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR) {\n this.handleQuotaExceeded_(mediaState, error);\n } else {\n shaka.log.error(logPrefix, 'failed fetch and append: code=' + error.code);\n if (mediaState.type == ContentType.TEXT &&\n this.config_.ignoreTextStreamFailures) {\n shaka.log.warning(logPrefix,\n 'Text stream failed to parse. Proceeding without it.');\n delete this.mediaStates_[ContentType.TEXT];\n } else {\n mediaState.hasError = true;\n error.severity = shaka.util.Error.Severity.CRITICAL;\n this.playerInterface_.onError(error);\n }\n }\n }.bind(this));\n};\n\n\n/**\n * Handles a network error.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {!shaka.util.Error} error\n * @private\n */\nshaka.media.StreamingEngine.prototype.handleNetworkError_ = function(\n mediaState, error) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n if (mediaState.type == ContentType.TEXT &&\n this.config_.ignoreTextStreamFailures &&\n error.code == shaka.util.Error.Code.BAD_HTTP_STATUS) {\n shaka.log.warning(logPrefix,\n 'Text stream failed to download. Proceeding without it.');\n delete this.mediaStates_[ContentType.TEXT];\n } else {\n error.severity = shaka.util.Error.Severity.RECOVERABLE;\n this.playerInterface_.onError(error);\n\n shaka.log.warning(logPrefix, 'Network error. Retrying...');\n this.scheduleUpdate_(mediaState, 4);\n }\n};\n\n\n/**\n * Handles a QUOTA_EXCEEDED_ERROR.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {!shaka.util.Error} error\n * @private\n */\nshaka.media.StreamingEngine.prototype.handleQuotaExceeded_ = function(\n mediaState, error) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n // The segment cannot fit into the SourceBuffer. Ideally, MediaSource would\n // have evicted old data to accommodate the segment; however, it may have\n // failed to do this if the segment is very large, or if it could not find\n // a suitable time range to remove.\n //\n // We can overcome the latter by trying to append the segment again;\n // however, to avoid continuous QuotaExceededErrors we must reduce the size\n // of the buffer going forward.\n //\n // If we've recently reduced the buffering goals, wait until the stream\n // which caused the first QuotaExceededError recovers. Doing this ensures\n // we don't reduce the buffering goals too quickly.\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n var mediaStates = shaka.util.MapUtils.values(this.mediaStates_);\n var waitingForAnotherStreamToRecover = mediaStates.some(function(ms) {\n return ms != mediaState && ms.recovering;\n });\n\n if (!waitingForAnotherStreamToRecover) {\n // Reduction schedule: 80%, 60%, 40%, 20%, 16%, 12%, 8%, 4%, fail.\n // Note: percentages are used for comparisons to avoid rounding errors.\n var percentBefore = Math.round(100 * this.bufferingGoalScale_);\n if (percentBefore > 20) {\n this.bufferingGoalScale_ -= 0.2;\n } else if (percentBefore > 4) {\n this.bufferingGoalScale_ -= 0.04;\n } else {\n shaka.log.error(\n logPrefix, 'MediaSource threw QuotaExceededError too many times');\n mediaState.hasError = true;\n this.fatalError_ = true;\n this.playerInterface_.onError(error);\n return;\n }\n var percentAfter = Math.round(100 * this.bufferingGoalScale_);\n shaka.log.warning(\n logPrefix,\n 'MediaSource threw QuotaExceededError:',\n 'reducing buffering goals by ' + (100 - percentAfter) + '%');\n mediaState.recovering = true;\n } else {\n shaka.log.debug(\n logPrefix,\n 'MediaSource threw QuotaExceededError:',\n 'waiting for another stream to recover...');\n }\n\n // QuotaExceededError gets thrown if evication didn't help to make room\n // for a segment. We want to wait for a while (4 seconds is just an\n // arbitrary number) before updating to give the playhead a chance to\n // advance, so we don't immidiately throw again.\n this.scheduleUpdate_(mediaState, 4);\n};\n\n\n/**\n * Sets the given MediaState's associated SourceBuffer's timestamp offset and\n * init segment if either are required. If an error occurs then neither the\n * timestamp offset or init segment are unset, since another call to switch()\n * will end up superseding them.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} currentPeriodIndex\n * @param {?number} appendWindowEnd\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.initSourceBuffer_ = function(\n mediaState, currentPeriodIndex, appendWindowEnd) {\n if (!mediaState.needInitSegment)\n return Promise.resolve();\n\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n // If we need an init segment then the Stream switched, so we've either\n // changed bitrates, Periods, or both. If we've changed Periods then we must\n // set a new timestamp offset and append window end. Note that by setting\n // these values here, we avoid having to co-ordinate ongoing updates, which\n // we would have to do if we instead set them in switch().\n var timestampOffset =\n currentPeriod.startTime - mediaState.stream.presentationTimeOffset;\n shaka.log.v1(logPrefix, 'setting timestamp offset to ' + timestampOffset);\n shaka.log.v1(logPrefix, 'setting append window end to ' + appendWindowEnd);\n var setStreamProperties =\n this.playerInterface_.mediaSourceEngine.setStreamProperties(\n mediaState.type, timestampOffset, appendWindowEnd);\n\n if (!mediaState.stream.initSegmentReference) {\n // The Stream is self initializing.\n return setStreamProperties;\n }\n\n shaka.log.v1(logPrefix, 'fetching init segment');\n var fetchInit = this.fetch_(mediaState.stream.initSegmentReference);\n var appendInit = fetchInit.then(function(initSegment) {\n if (this.destroyed_) return;\n shaka.log.v1(logPrefix, 'appending init segment');\n\n return this.playerInterface_.mediaSourceEngine.appendBuffer(\n mediaState.type, initSegment, null /* startTime */, null /* endTime */);\n }.bind(this)).catch(function(error) {\n mediaState.needInitSegment = true;\n return Promise.reject(error);\n });\n\n return Promise.all([setStreamProperties, appendInit]);\n};\n\n\n/**\n * Appends the given segment and evicts content if required to append.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Stream} stream\n * @param {!shaka.media.SegmentReference} reference\n * @param {!ArrayBuffer} segment\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.append_ = function(\n mediaState, playheadTime, period, stream, reference, segment) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n if (stream.containsEmsgBoxes) {\n new shaka.util.Mp4Parser()\n .fullBox('emsg', this.parseEMSG_.bind(this, period, reference))\n .parse(segment);\n }\n\n return this.evict_(mediaState, playheadTime).then(function() {\n if (this.destroyed_) return;\n shaka.log.v1(logPrefix, 'appending media segment');\n\n return this.playerInterface_.mediaSourceEngine.appendBuffer(\n mediaState.type, segment, reference.startTime + period.startTime,\n reference.endTime + period.startTime);\n }.bind(this)).then(function() {\n if (this.destroyed_) return;\n shaka.log.v2(logPrefix, 'appended media segment');\n\n // We must use |stream| because switch() may have been called.\n mediaState.lastStream = stream;\n mediaState.lastSegmentReference = reference;\n\n return Promise.resolve();\n }.bind(this));\n};\n\n\n/**\n * Parse the EMSG box from a MP4 container.\n *\n * @param {!shakaExtern.Period} period\n * @param {!shaka.media.SegmentReference} reference\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @private\n */\nshaka.media.StreamingEngine.prototype.parseEMSG_ = function(\n period, reference, box) {\n\n var schemeId = box.reader.readTerminatedString();\n // read rest of the data and dispatch event to the application\n var value = box.reader.readTerminatedString();\n var timescale = box.reader.readUint32();\n var presentationTimeDelta = box.reader.readUint32();\n var eventDuration = box.reader.readUint32();\n var id = box.reader.readUint32();\n var messageData = box.reader.readBytes(\n box.reader.getLength() - box.reader.getPosition());\n\n var startTime = period.startTime + reference.startTime +\n (presentationTimeDelta / timescale);\n\n // See DASH sec. 5.10.4.1\n // A special scheme in DASH used to signal manifest updates.\n if (schemeId == 'urn:mpeg:dash:event:2012') {\n this.playerInterface_.onManifestUpdate();\n } else {\n /** @type {shakaExtern.EmsgInfo} */\n var emsg = {\n startTime: startTime,\n endTime: startTime + (eventDuration / timescale),\n schemeIdUri: schemeId,\n value: value,\n timescale: timescale,\n presentationTimeDelta: presentationTimeDelta,\n eventDuration: eventDuration,\n id: id,\n messageData: messageData\n };\n\n var event = new shaka.util.FakeEvent('emsg', {'detail': emsg});\n this.playerInterface_.onEvent(event);\n }\n};\n\n\n/**\n * Evicts media to meet the max buffer behind limit.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.evict_ = function(\n mediaState, playheadTime) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.v2(logPrefix, 'checking buffer length');\n\n var startTime =\n this.playerInterface_.mediaSourceEngine.bufferStart(mediaState.type);\n if (startTime == null) {\n shaka.log.v2(logPrefix,\n 'buffer behind okay because nothing buffered:',\n 'playheadTime=' + playheadTime,\n 'bufferBehind=' + this.config_.bufferBehind);\n return Promise.resolve();\n }\n var bufferedBehind = playheadTime - startTime;\n\n var overflow = bufferedBehind - this.config_.bufferBehind;\n if (overflow <= 0) {\n shaka.log.v2(logPrefix,\n 'buffer behind okay:',\n 'playheadTime=' + playheadTime,\n 'bufferedBehind=' + bufferedBehind,\n 'bufferBehind=' + this.config_.bufferBehind,\n 'underflow=' + (-overflow));\n return Promise.resolve();\n }\n\n shaka.log.v1(logPrefix,\n 'buffer behind too large:',\n 'playheadTime=' + playheadTime,\n 'bufferedBehind=' + bufferedBehind,\n 'bufferBehind=' + this.config_.bufferBehind,\n 'overflow=' + overflow);\n\n return this.playerInterface_.mediaSourceEngine.remove(\n mediaState.type, startTime, startTime + overflow).then(function() {\n if (this.destroyed_) return;\n shaka.log.v1(logPrefix, 'evicted ' + overflow + ' seconds');\n }.bind(this));\n};\n\n\n/**\n * Sets up all known Periods when startup completes; otherwise, does nothing.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState The last\n * MediaState updated.\n * @param {shakaExtern.Stream} stream\n * @private\n */\nshaka.media.StreamingEngine.prototype.handleStartup_ = function(\n mediaState, stream) {\n var Functional = shaka.util.Functional;\n var MapUtils = shaka.util.MapUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (this.startupComplete_)\n return;\n\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n var mediaStates = MapUtils.values(this.mediaStates_);\n this.startupComplete_ = mediaStates.every(function(ms) {\n // Startup completes once we have buffered at least one segment from each\n // MediaState, not counting text.\n if (ms.type == ContentType.TEXT) return true;\n return !ms.waitingToClearBuffer &&\n !ms.clearingBuffer &&\n ms.lastSegmentReference;\n });\n\n if (!this.startupComplete_)\n return;\n\n shaka.log.debug(logPrefix, 'startup complete');\n\n // We must use |stream| because switch() may have been called.\n var currentPeriodIndex = this.findPeriodContainingStream_(stream);\n\n goog.asserts.assert(\n mediaStates.every(function(ms) {\n // It is possible for one stream (usually text) to buffer the whole\n // Period and need the next one.\n return ms.needPeriodIndex == currentPeriodIndex ||\n ms.needPeriodIndex == currentPeriodIndex + 1;\n }),\n logPrefix + ' expected all MediaStates to need same Period');\n\n // Setup the current Period if necessary, which is likely since the current\n // Period is probably the initial one.\n if (!this.canSwitchPeriod_[currentPeriodIndex]) {\n this.setupPeriod_(currentPeriodIndex).then(function() {\n shaka.log.v1(logPrefix, 'calling onCanSwitch()...');\n this.playerInterface_.onCanSwitch();\n }.bind(this)).catch(Functional.noop);\n }\n\n // Now setup all known Periods.\n for (var i = 0; i < this.manifest_.periods.length; ++i) {\n this.setupPeriod_(i).catch(Functional.noop);\n }\n\n if (this.playerInterface_.onStartupComplete) {\n shaka.log.v1(logPrefix, 'calling onStartupComplete()...');\n this.playerInterface_.onStartupComplete();\n }\n};\n\n\n/**\n * Calls onChooseStreams() when necessary.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState The last\n * MediaState updated.\n * @private\n */\nshaka.media.StreamingEngine.prototype.handlePeriodTransition_ = function(\n mediaState) {\n var Functional = shaka.util.Functional;\n var MapUtils = shaka.util.MapUtils;\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var currentPeriodIndex = this.findPeriodContainingStream_(mediaState.stream);\n if (mediaState.needPeriodIndex == currentPeriodIndex)\n return;\n\n var needPeriodIndex = mediaState.needPeriodIndex;\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n var mediaStates = MapUtils.values(this.mediaStates_);\n\n // For a Period transition to work, all media states must need the same\n // Period. If a stream needs a different Period than the one it currently\n // has, it will try to transition or stop updates assuming that another stream\n // will handle it. This only works when all streams either need the same\n // Period or are still performing updates.\n goog.asserts.assert(\n mediaStates.every(function(ms) {\n return ms.needPeriodIndex == needPeriodIndex || ms.hasError ||\n !shaka.media.StreamingEngine.isIdle_(ms);\n }),\n 'All MediaStates should need the same Period or be performing updates.');\n\n // Only call onChooseStreams() when all MediaStates need the same Period.\n var needSamePeriod = mediaStates.every(function(ms) {\n return ms.needPeriodIndex == needPeriodIndex;\n });\n if (!needSamePeriod) {\n shaka.log.debug(\n logPrefix, 'not all MediaStates need Period ' + needPeriodIndex);\n return;\n }\n\n // Only call onChooseStreams() once per Period transition.\n var allAreIdle = mediaStates.every(shaka.media.StreamingEngine.isIdle_);\n if (!allAreIdle) {\n shaka.log.debug(\n logPrefix,\n 'all MediaStates need Period ' + needPeriodIndex + ', ' +\n 'but not all MediaStates are idle');\n return;\n }\n\n shaka.log.debug(logPrefix, 'all need Period ' + needPeriodIndex);\n\n // Ensure the Period which we need to buffer is setup and then call\n // onChooseStreams().\n this.setupPeriod_(needPeriodIndex).then(function() {\n if (this.destroyed_) return;\n\n // If we seek during a Period transition, we can start another transition.\n // So we need to verify that:\n // - We are still in need of the same Period.\n // - All streams are still idle.\n // - The current stream is not in the needed Period (another transition\n // handled it).\n var allReady = mediaStates.every(function(ms) {\n var isIdle = shaka.media.StreamingEngine.isIdle_(ms);\n var currentPeriodIndex = this.findPeriodContainingStream_(ms.stream);\n return isIdle && ms.needPeriodIndex == needPeriodIndex &&\n currentPeriodIndex != needPeriodIndex;\n }.bind(this));\n if (!allReady) {\n // TODO: Write unit tests for this case.\n shaka.log.debug(logPrefix, 'ignoring transition to Period',\n needPeriodIndex, 'since another is happening');\n return;\n }\n\n var needPeriod = this.manifest_.periods[needPeriodIndex];\n\n shaka.log.v1(logPrefix, 'calling onChooseStreams()...');\n var streamsByType = this.playerInterface_.onChooseStreams(needPeriod);\n\n // Vet |streamsByType| before switching.\n for (var type in this.mediaStates_) {\n if (streamsByType[type] || type == ContentType.TEXT) continue;\n\n shaka.log.error(logPrefix,\n 'invalid Streams chosen: missing ' + type + ' Stream');\n this.playerInterface_.onError(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STREAMING,\n shaka.util.Error.Code.INVALID_STREAMS_CHOSEN));\n return;\n }\n\n for (var type in streamsByType) {\n if (this.mediaStates_[type]) continue;\n if (type == ContentType.TEXT) {\n // initStreams_ will switch streams and schedule an update.\n this.initStreams_(\n {text: streamsByType[ContentType.TEXT]}, needPeriod.startTime);\n delete streamsByType[type];\n continue;\n }\n\n shaka.log.error(logPrefix,\n 'invalid Streams chosen: unusable ' + type + ' Stream');\n this.playerInterface_.onError(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STREAMING,\n shaka.util.Error.Code.INVALID_STREAMS_CHOSEN));\n return;\n }\n\n for (var type in this.mediaStates_) {\n var stream = streamsByType[type];\n if (stream) {\n this.switch(type, stream, /* clearBuffer */ false);\n this.scheduleUpdate_(this.mediaStates_[type], 0);\n } else {\n goog.asserts.assert(type == ContentType.TEXT, 'Invalid streams chosen');\n delete this.mediaStates_[type];\n }\n }\n\n // We've already set up the Period so call onCanSwitch() right now.\n shaka.log.v1(logPrefix, 'calling onCanSwitch()...');\n this.playerInterface_.onCanSwitch();\n }.bind(this)).catch(Functional.noop);\n};\n\n\n/**\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @return {boolean} True if the given MediaState is idle; otherwise, return\n * false.\n * @private\n */\nshaka.media.StreamingEngine.isIdle_ = function(mediaState) {\n return !mediaState.performingUpdate &&\n (mediaState.updateTimer == null) &&\n !mediaState.waitingToClearBuffer &&\n !mediaState.clearingBuffer;\n};\n\n\n/**\n * @param {number} time The time, in seconds, relative to the start of the\n * presentation.\n * @return {number} The index of the Period which starts after |time|\n * @private\n */\nshaka.media.StreamingEngine.prototype.findPeriodContainingTime_ = function(\n time) {\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n return shaka.util.StreamUtils.findPeriodContainingTime(this.manifest_, time);\n};\n\n\n/**\n * @param {!shakaExtern.Stream} stream\n * @return {number} The index of the Period which contains |stream|, or -1 if\n * no Period contains |stream|.\n * @private\n */\nshaka.media.StreamingEngine.prototype.findPeriodContainingStream_ = function(\n stream) {\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n return shaka.util.StreamUtils.findPeriodContainingStream(\n this.manifest_, stream);\n};\n\n\n/**\n * Fetches the given segment.\n *\n * @param {(!shaka.media.InitSegmentReference|!shaka.media.SegmentReference)}\n * reference\n *\n * @return {!Promise.<!ArrayBuffer>}\n * @private\n */\nshaka.media.StreamingEngine.prototype.fetch_ = function(reference) {\n var requestType = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n var request = shaka.net.NetworkingEngine.makeRequest(\n reference.getUris(), this.config_.retryParameters);\n\n // Set Range header. Note that some web servers don't accept Range headers,\n // so don't set one if it's not strictly required.\n if ((reference.startByte != 0) || (reference.endByte != null)) {\n var range = 'bytes=' + reference.startByte + '-';\n if (reference.endByte != null) range += reference.endByte;\n request.headers['Range'] = range;\n }\n\n shaka.log.v2('fetching: reference=' + reference);\n var p = this.playerInterface_.netEngine.request(requestType, request);\n return p.then(function(response) {\n return response.data;\n });\n};\n\n\n/**\n * Clears the buffer and schedules another update.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {boolean} flush\n * @private\n */\nshaka.media.StreamingEngine.prototype.clearBuffer_ =\n function(mediaState, flush) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n goog.asserts.assert(\n !mediaState.performingUpdate && (mediaState.updateTimer == null),\n logPrefix + ' unexpected call to clearBuffer_()');\n\n mediaState.waitingToClearBuffer = false;\n mediaState.waitingToFlushBuffer = false;\n mediaState.clearingBuffer = true;\n\n shaka.log.debug(logPrefix, 'clearing buffer');\n var p = this.playerInterface_.mediaSourceEngine.clear(mediaState.type);\n p.then(function() {\n if (!this.destroyed_ && flush) {\n return this.playerInterface_.mediaSourceEngine.flush(mediaState.type);\n }\n }.bind(this)).then(function() {\n if (this.destroyed_) return;\n shaka.log.debug(logPrefix, 'cleared buffer');\n mediaState.lastStream = null;\n mediaState.lastSegmentReference = null;\n mediaState.clearingBuffer = false;\n mediaState.endOfStream = false;\n this.scheduleUpdate_(mediaState, 0);\n }.bind(this));\n};\n\n\n/**\n * Schedules |mediaState|'s next update.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} delay The delay in seconds.\n * @private\n */\nshaka.media.StreamingEngine.prototype.scheduleUpdate_ = function(\n mediaState, delay) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.v2(logPrefix, 'updating in ' + delay + ' seconds');\n goog.asserts.assert(mediaState.updateTimer == null,\n logPrefix + ' did not expect update to be scheduled');\n mediaState.updateTimer = window.setTimeout(\n this.onUpdate_.bind(this, mediaState), delay * 1000);\n};\n\n\n/**\n * Cancels |mediaState|'s next update if one exists.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @private\n */\nshaka.media.StreamingEngine.prototype.cancelUpdate_ = function(mediaState) {\n if (mediaState.updateTimer != null) {\n window.clearTimeout(mediaState.updateTimer);\n mediaState.updateTimer = null;\n }\n};\n\n\n/**\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @return {string} A log prefix of the form ($CONTENT_TYPE:$STREAM_ID), e.g.,\n * \"(audio:5)\" or \"(video:hd)\".\n * @private\n */\nshaka.media.StreamingEngine.logPrefix_ = function(mediaState) {\n return '(' + mediaState.type + ':' + mediaState.stream.id + ')';\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/streaming_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.net.HttpPlugin');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\n\n\n/**\n * @namespace\n * @summary A networking plugin to handle http and https URIs via XHR.\n * @param {string} uri\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.net.HttpPlugin = function(uri, request) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n\n xhr.open(request.method, uri, true);\n xhr.responseType = 'arraybuffer';\n xhr.timeout = request.retryParameters.timeout;\n xhr.withCredentials = request.allowCrossSiteCredentials;\n\n xhr.onload = function(event) {\n var target = event.target;\n goog.asserts.assert(target, 'XHR onload has no target!');\n\n var headers = target.getAllResponseHeaders().split('\\r\\n').reduce(\n function(all, part) {\n var header = part.split(': ');\n all[header[0].toLowerCase()] = header.slice(1).join(': ');\n return all;\n },\n {});\n if (target.status >= 200 && target.status <= 299 &&\n target.status != 202) {\n // Most 2xx HTTP codes are success cases.\n if (target.responseURL) {\n uri = target.responseURL;\n }\n /** @type {shakaExtern.Response} */\n var response = {\n uri: uri,\n data: target.response,\n headers: headers,\n fromCache: !!headers['x-shaka-from-cache']\n };\n resolve(response);\n } else {\n var responseText = null;\n try {\n responseText = shaka.util.StringUtils.fromBytesAutoDetect(\n target.response);\n } catch (exception) {}\n shaka.log.debug('HTTP error text:', responseText);\n\n var severity = target.status == 401 || target.status == 403 ?\n shaka.util.Error.Severity.CRITICAL :\n shaka.util.Error.Severity.RECOVERABLE;\n reject(new shaka.util.Error(\n severity,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.BAD_HTTP_STATUS,\n uri,\n target.status,\n responseText,\n headers));\n }\n };\n xhr.onerror = function(event) {\n reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.HTTP_ERROR,\n uri));\n };\n xhr.ontimeout = function(event) {\n reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.TIMEOUT,\n uri));\n };\n\n for (var k in request.headers) {\n xhr.setRequestHeader(k, request.headers[k]);\n }\n xhr.send(request.body);\n });\n};\n\n\nshaka.net.NetworkingEngine.registerScheme('http', shaka.net.HttpPlugin);\nshaka.net.NetworkingEngine.registerScheme('https', shaka.net.HttpPlugin);\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/net/http_plugin.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.DBEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.offline.IStorageEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * This manages all operations on an IndexedDB. This wraps all operations\n * in Promises. All Promises will resolve once the transaction has completed.\n * Depending on the browser, this may or may not be after the data is flushed\n * to disk. https://goo.gl/zMOeJc\n *\n * @struct\n * @constructor\n * @implements {shaka.offline.IStorageEngine}\n */\nshaka.offline.DBEngine = function() {\n goog.asserts.assert(\n shaka.offline.DBEngine.isSupported(),\n 'DBEngine should not be called when DBEngine is not supported');\n\n /** @private {IDBDatabase} */\n this.db_ = null;\n\n /** @private {!Array.<shaka.offline.DBEngine.Operation>} */\n this.operations_ = [];\n\n /** @private {!Object.<string, number>} */\n this.currentIdMap_ = {};\n};\n\n\n/**\n * @typedef {{\n * transaction: !IDBTransaction,\n * promise: !shaka.util.PublicPromise\n * }}\n *\n * @property {!IDBTransaction} transaction\n * The transaction that this operation is using.\n * @property {!shaka.util.PublicPromise} promise\n * The promise associated with the operation.\n */\nshaka.offline.DBEngine.Operation;\n\n\n/** @private {string} */\nshaka.offline.DBEngine.DB_NAME_ = 'shaka_offline_db';\n\n\n/** @private @const {number} */\nshaka.offline.DBEngine.DB_VERSION_ = 1;\n\n\n/**\n * Determines if the browsers supports IndexedDB.\n * @return {boolean}\n */\nshaka.offline.DBEngine.isSupported = function() {\n return window.indexedDB != null;\n};\n\n\n/**\n * Delete the database. There must be no open connections to the database.\n * @return {!Promise}\n */\nshaka.offline.DBEngine.deleteDatabase = function() {\n if (!window.indexedDB)\n return Promise.resolve();\n var request =\n window.indexedDB.deleteDatabase(shaka.offline.DBEngine.DB_NAME_);\n\n var p = new shaka.util.PublicPromise();\n request.onsuccess = function(event) {\n goog.asserts.assert(event.newVersion == null, 'Unexpected database update');\n p.resolve();\n };\n request.onerror = shaka.offline.DBEngine.onError_.bind(null, request, p);\n return p;\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.initialized = function() {\n return this.db_ != null;\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.init = function(storeMap, opt_retryCount) {\n goog.asserts.assert(!this.db_, 'Already initialized');\n\n return this.createConnection_(storeMap, opt_retryCount).then(function() {\n // For each store, get the next ID and store in the map.\n var stores = Object.keys(storeMap);\n return Promise.all(stores.map(function(store) {\n return this.getNextId_(store).then(function(id) {\n this.currentIdMap_[store] = id;\n }.bind(this));\n }.bind(this)));\n }.bind(this));\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.destroy = function() {\n return Promise.all(this.operations_.map(function(op) {\n try {\n // If the transaction is considered finished but has not called the\n // callbacks yet, it will still be in the list and this call will fail.\n // Simply ignore errors.\n op.transaction.abort();\n } catch (e) {}\n\n var Functional = shaka.util.Functional;\n return op.promise.catch(Functional.noop);\n })).then(function() {\n goog.asserts.assert(this.operations_.length == 0,\n 'All operations should have been closed');\n if (this.db_) {\n this.db_.close();\n this.db_ = null;\n }\n }.bind(this));\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.get = function(storeName, key) {\n var request;\n return this.createTransaction_(storeName, 'readonly', function(store) {\n request = store.get(key);\n }).then(function() { return request.result; });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.forEach = function(storeName, callback) {\n return this.createTransaction_(storeName, 'readonly', function(store) {\n var request = store.openCursor();\n request.onsuccess = function(event) {\n var cursor = event.target.result;\n if (cursor) {\n callback(cursor.value);\n cursor.continue();\n }\n };\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.insert = function(storeName, value) {\n return this.createTransaction_(storeName, 'readwrite', function(store) {\n store.put(value);\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.remove = function(storeName, key) {\n return this.createTransaction_(storeName, 'readwrite', function(store) {\n store.delete(key);\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.removeKeys = function(storeName,\n keys,\n opt_onKeyRemoved) {\n return this.createTransaction_(storeName, 'readwrite', function(store) {\n for (var i = 0; i < keys.length; i++) {\n var request = store.delete(keys[i]);\n request.onsuccess = opt_onKeyRemoved || function(event) { };\n }\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.reserveId = function(storeName) {\n goog.asserts.assert(storeName in this.currentIdMap_,\n 'Store name must be passed to init()');\n return this.currentIdMap_[storeName]++;\n};\n\n\n/**\n * Gets the ID to start at.\n *\n * @param {string} storeName\n * @return {!Promise.<number>}\n * @private\n */\nshaka.offline.DBEngine.prototype.getNextId_ = function(storeName) {\n var id = 0;\n return this.createTransaction_(storeName, 'readonly', function(store) {\n var request = store.openCursor(null, 'prev');\n request.onsuccess = function(event) {\n var cursor = event.target.result;\n if (cursor) {\n id = cursor.key + 1;\n }\n };\n }).then(function() { return id; });\n};\n\n\n/**\n * Creates a new transaction for the given store name and calls |action| to\n * modify the store. The transaction will resolve or reject the promise\n * returned by this function.\n *\n * @param {string} storeName\n * @param {string} type\n * @param {!function(IDBObjectStore)} action\n *\n * @return {!Promise}\n * @private\n */\nshaka.offline.DBEngine.prototype.createTransaction_ = function(storeName,\n type,\n action) {\n\n goog.asserts.assert(this.db_, 'Must not be destroyed');\n goog.asserts.assert(type == 'readonly' || type == 'readwrite',\n 'Type must be \"readonly\" or \"readwrite\"');\n\n var op = {\n transaction: this.db_.transaction([storeName], type),\n promise: new shaka.util.PublicPromise()\n };\n\n op.transaction.oncomplete = (function(event) {\n this.closeOperation_(op);\n op.promise.resolve();\n }.bind(this));\n\n // We will see an onabort call via:\n // 1. request error -> transaction error -> transaction abort\n // 2. transaction commit fail -> transaction abort\n // As any transaction error will result in an abort, it is better to listen\n // for an abort so that we will catch all failed transaction operations.\n op.transaction.onabort = (function(event) {\n this.closeOperation_(op);\n shaka.offline.DBEngine.onError_(op.transaction, op.promise, event);\n }.bind(this));\n\n // We need to prevent default on the onerror event or else Firefox will\n // raise an error which will cause a karma failure. This will not stop the\n // onabort callback from firing.\n op.transaction.onerror = (function(event) {\n event.preventDefault();\n }.bind(this));\n\n var store = op.transaction.objectStore(storeName);\n action(store);\n\n this.operations_.push(op);\n\n return op.promise;\n};\n\n\n/**\n * Close an open operation.\n *\n * @param {!shaka.offline.DBEngine.Operation} op\n * @private\n */\nshaka.offline.DBEngine.prototype.closeOperation_ = function(op) {\n var i = this.operations_.indexOf(op);\n goog.asserts.assert(i >= 0, 'Operation must be in the list.');\n this.operations_.splice(i, 1);\n};\n\n\n/**\n * Creates a new connection to the database.\n *\n * On IE/Edge, it is possible for the database to not be deleted when the\n * success callback is fired. This means that when we delete the database and\n * immediately create a new connection, we will connect to the old database.\n * If this happens, we need to close the connection and retry.\n *\n * @see https://goo.gl/hOYJvN\n *\n * @param {!Object.<string, string>} storeMap\n * @param {number=} opt_retryCount\n * @return {!Promise}\n * @private\n */\nshaka.offline.DBEngine.prototype.createConnection_ = function(\n storeMap, opt_retryCount) {\n var DBEngine = shaka.offline.DBEngine;\n\n var indexedDB = window.indexedDB;\n var request = indexedDB.open(DBEngine.DB_NAME_, DBEngine.DB_VERSION_);\n\n var upgraded = false;\n var createPromise = new shaka.util.PublicPromise();\n request.onupgradeneeded = function(event) {\n upgraded = true;\n var db = event.target.result;\n goog.asserts.assert(event.oldVersion == 0,\n 'Must be upgrading from version 0');\n goog.asserts.assert(db.objectStoreNames.length == 0,\n 'Version 0 database should be empty');\n for (var name in storeMap) {\n db.createObjectStore(name, {keyPath: storeMap[name]});\n }\n };\n request.onsuccess = (function(event) {\n if (opt_retryCount && !upgraded) {\n event.target.result.close();\n\n shaka.log.info('Didn\\'t get an upgrade event... trying again.');\n setTimeout(function() {\n var p = this.createConnection_(storeMap, opt_retryCount - 1);\n p.then(createPromise.resolve, createPromise.reject);\n }.bind(this), 1000);\n return;\n }\n\n\n goog.asserts.assert(opt_retryCount == undefined || upgraded,\n 'Should get upgrade event');\n this.db_ = event.target.result;\n createPromise.resolve();\n }.bind(this));\n request.onerror = DBEngine.onError_.bind(null, request, createPromise);\n\n return createPromise;\n};\n\n\n/**\n * Rejects the given Promise using the error fromt the transaction.\n *\n * @param {!IDBTransaction|!IDBRequest} errorSource\n * @param {!shaka.util.PublicPromise} promise\n * @param {Event} event\n * @private\n */\nshaka.offline.DBEngine.onError_ = function(errorSource, promise, event) {\n\n if (errorSource.error) {\n promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.INDEXED_DB_ERROR, errorSource.error));\n } else {\n promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n\n // Firefox will raise an error which will cause a karma failure.\n event.preventDefault();\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/db_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.DownloadManager');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.MapUtils');\n\n\n\n/**\n * This manages downloading segments and notifying the app of progress.\n *\n * @param {shaka.offline.IStorageEngine} storageEngine\n * @param {!shaka.net.NetworkingEngine} netEngine\n * @param {shakaExtern.RetryParameters} retryParams\n * @param {shakaExtern.OfflineConfiguration} config\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n */\nshaka.offline.DownloadManager = function(\n storageEngine, netEngine, retryParams, config) {\n /**\n * @private {!Object.<\n * string, !Array.<shaka.offline.DownloadManager.Segment>>}\n */\n this.segments_ = {};\n\n /**\n * The IDs of the segments that have been stored for an in-progress\n * download(). This is used to cleanup in destroy().\n * @private {!Array.<number>}\n */\n this.storedSegments_ = [];\n\n /** @private {?shakaExtern.OfflineConfiguration} */\n this.config_ = config;\n\n /** @private {shaka.offline.IStorageEngine} */\n this.storageEngine_ = storageEngine;\n\n /** @private {shaka.net.NetworkingEngine} */\n this.netEngine_ = netEngine;\n\n /** @private {?shakaExtern.RetryParameters} */\n this.retryParams_ = retryParams;\n\n /** @private {?shakaExtern.ManifestDB} */\n this.manifest_ = null;\n\n /** @private {Promise} */\n this.promise_ = null;\n\n /**\n * The total number of bytes for segments that include a byte range.\n * @private {number}\n */\n this.givenBytesTotal_ = 0;\n\n /**\n * The number of bytes downloaded for segments that include a byte range.\n * @private {number}\n */\n this.givenBytesDownloaded_ = 0;\n\n /**\n * The total number of bytes estimated based on bandwidth for segments that\n * do not include a byte range.\n * @private {number}\n */\n this.bandwidthBytesTotal_ = 0;\n\n /**\n * The estimated number of bytes downloaded for segments that do not have\n * a byte range.\n * @private {number}\n */\n this.bandwidthBytesDownloaded_ = 0;\n};\n\n\n/**\n * @typedef {{\n * uris: !Array.<string>,\n * startByte: number,\n * endByte: ?number,\n * bandwidthSize: number,\n * segmentDb: shakaExtern.SegmentDataDB\n * }}\n *\n * @property {!Array.<string>} uris\n * The URIs to download the segment.\n * @property {number} startByte\n * The byte index the segment starts at.\n * @property {?number} endByte\n * The byte index the segment ends at, if present.\n * @property {number} bandwidthSize\n * The size of the segment as estimated by the bandwidth and segment duration.\n * @property {shakaExtern.SegmentDataDB} segmentDb\n * The data to store in the database.\n */\nshaka.offline.DownloadManager.Segment;\n\n\n/** @override */\nshaka.offline.DownloadManager.prototype.destroy = function() {\n var storage = this.storageEngine_;\n var segments = this.storedSegments_;\n var p = this.promise_ || Promise.resolve();\n p = p.then(function() { return storage.removeKeys('segment', segments); });\n\n // Don't destroy() storageEngine since it is owned by Storage.\n\n this.segments_ = {};\n this.storedSegments_ = [];\n this.config_ = null;\n this.storageEngine_ = null;\n this.netEngine_ = null;\n this.retryParams_ = null;\n this.manifest_ = null;\n this.promise_ = null;\n return p;\n};\n\n\n/**\n * Adds a segment to the list to be downloaded.\n *\n * @param {string} type\n * @param {!shaka.media.SegmentReference|!shaka.media.InitSegmentReference} ref\n * @param {number} bandwidthSize\n * @param {shakaExtern.SegmentDataDB} segmentDb\n * The data to store in the database with the data. The |data| field of this\n * object will contain the downloaded data.\n */\nshaka.offline.DownloadManager.prototype.addSegment = function(\n type, ref, bandwidthSize, segmentDb) {\n this.segments_[type] = this.segments_[type] || [];\n this.segments_[type].push({\n uris: ref.getUris(),\n startByte: ref.startByte,\n endByte: ref.endByte,\n bandwidthSize: bandwidthSize,\n segmentDb: segmentDb\n });\n};\n\n\n/**\n * Downloads all the segments, stores them in the database, and stores the given\n * manifest object.\n *\n * @param {shakaExtern.ManifestDB} manifest\n * @return {!Promise}\n */\nshaka.offline.DownloadManager.prototype.downloadAndStore = function(manifest) {\n var MapUtils = shaka.util.MapUtils;\n // Calculate progress estimates.\n this.givenBytesTotal_ = 0;\n this.givenBytesDownloaded_ = 0;\n this.bandwidthBytesTotal_ = 0;\n this.bandwidthBytesDownloaded_ = 0;\n MapUtils.values(this.segments_).forEach(function(segments) {\n segments.forEach(function(segment) {\n if (segment.endByte != null)\n this.givenBytesTotal_ += (segment.endByte - segment.startByte + 1);\n else\n this.bandwidthBytesTotal_ += segment.bandwidthSize;\n }.bind(this));\n }.bind(this));\n\n this.manifest_ = manifest;\n // Will be updated as we download for segments without a byte-range.\n this.manifest_.size = this.givenBytesTotal_;\n\n // Create separate download chains for different content types. This will\n // allow audio and video to be downloaded in parallel.\n var async = MapUtils.values(this.segments_).map(function(segments) {\n var i = 0;\n var downloadNext = (function() {\n if (!this.config_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n if (i >= segments.length) return Promise.resolve();\n var segment = segments[i++];\n return this.downloadSegment_(segment).then(downloadNext);\n }.bind(this));\n return downloadNext();\n }.bind(this));\n this.segments_ = {};\n\n this.promise_ = Promise.all(async).then(function() {\n return this.storageEngine_.insert('manifest', manifest);\n }.bind(this)).then(function() {\n this.storedSegments_ = [];\n }.bind(this));\n return this.promise_;\n};\n\n\n/**\n * Downloads the given segment and calls the callback.\n *\n * @param {shaka.offline.DownloadManager.Segment} segment\n * @return {!Promise}\n * @private\n */\nshaka.offline.DownloadManager.prototype.downloadSegment_ = function(segment) {\n goog.asserts.assert(this.retryParams_, 'Must not be destroyed');\n var type = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n var request =\n shaka.net.NetworkingEngine.makeRequest(segment.uris, this.retryParams_);\n if (segment.startByte != 0 || segment.endByte != null) {\n var end = segment.endByte == null ? '' : segment.endByte;\n request.headers['Range'] = 'bytes=' + segment.startByte + '-' + end;\n }\n\n var byteCount;\n return this.netEngine_.request(type, request)\n .then(function(response) {\n if (!this.manifest_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n byteCount = response.data.byteLength;\n\n this.storedSegments_.push(segment.segmentDb.key);\n segment.segmentDb.data = response.data;\n return this.storageEngine_.insert('segment', segment.segmentDb);\n }.bind(this))\n .then(function() {\n if (!this.manifest_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n if (segment.endByte == null) {\n // We didn't know the size, so it was an estimate.\n this.manifest_.size += byteCount;\n this.bandwidthBytesDownloaded_ += segment.bandwidthSize;\n } else {\n goog.asserts.assert(\n byteCount == (segment.endByte - segment.startByte + 1),\n 'Incorrect download size');\n this.givenBytesDownloaded_ += byteCount;\n }\n this.updateProgress_();\n }.bind(this));\n};\n\n\n/**\n * Calls the progress callback.\n * @private\n */\nshaka.offline.DownloadManager.prototype.updateProgress_ = function() {\n var progress = (this.givenBytesDownloaded_ + this.bandwidthBytesDownloaded_) /\n (this.givenBytesTotal_ + this.bandwidthBytesTotal_);\n\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n var manifest = shaka.offline.OfflineUtils.getStoredContent(this.manifest_);\n this.config_.progressCallback(manifest, progress);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/download_manager.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.OfflineUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.offline.DBEngine');\ngoog.require('shaka.offline.IStorageEngine');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\n\n\n/** @const {!Object.<string, string>} */\nshaka.offline.OfflineUtils.DB_SCHEME = {'manifest': 'key', 'segment': 'key'};\n\n\n/**\n * Converts the given database manifest to a storedContent structure.\n *\n * @param {shakaExtern.ManifestDB} manifest\n * @return {shakaExtern.StoredContent}\n */\nshaka.offline.OfflineUtils.getStoredContent = function(manifest) {\n goog.asserts.assert(manifest.periods.length > 0,\n 'Must be at least one Period.');\n\n // Reconstruct the first period to get the variants\n var timeline = new shaka.media.PresentationTimeline(null, 0);\n var period = shaka.offline.OfflineUtils.reconstructPeriod(\n manifest.periods[0], [], timeline);\n\n var tracks = shaka.util.StreamUtils.getVariantTracks(period, null, null);\n var textTracks = shaka.util.StreamUtils.getTextTracks(period, null);\n\n tracks.push.apply(tracks, textTracks);\n\n return {\n offlineUri: 'offline:' + manifest.key,\n originalManifestUri: manifest.originalManifestUri,\n duration: manifest.duration,\n size: manifest.size,\n expiration: manifest.expiration == undefined ? Infinity :\n manifest.expiration,\n tracks: tracks,\n appMetadata: manifest.appMetadata\n };\n};\n\n\n/**\n * Reconstructs a period object from the given database period.\n *\n * @param {shakaExtern.PeriodDB} period\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @param {shaka.media.PresentationTimeline} timeline\n * @return {shakaExtern.Period}\n */\nshaka.offline.OfflineUtils.reconstructPeriod = function(\n period, drmInfos, timeline) {\n var OfflineUtils = shaka.offline.OfflineUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var textStreamsDb = period.streams.filter(function(streamDb) {\n return streamDb.contentType == ContentType.TEXT;\n });\n\n var audioStreamsDb = period.streams.filter(function(streamDb) {\n return streamDb.contentType == ContentType.AUDIO;\n });\n\n var videoStreamsDb = period.streams.filter(function(streamDb) {\n return streamDb.contentType == ContentType.VIDEO;\n });\n\n var variants =\n OfflineUtils.createVariants_(audioStreamsDb, videoStreamsDb, drmInfos);\n var textStreams = textStreamsDb.map(OfflineUtils.createStream_);\n\n period.streams.forEach(function(streamDb) {\n var refs = OfflineUtils.getSegmentReferences_(streamDb);\n timeline.notifySegments(period.startTime, refs);\n });\n\n return {\n startTime: period.startTime,\n variants: variants,\n textStreams: textStreams\n };\n};\n\n\n/**\n * @param {!shakaExtern.StreamDB} streamDb\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.offline.OfflineUtils.getSegmentReferences_ = function(streamDb) {\n return streamDb.segments.map(function(segment, i) {\n var getUris = function() { return [segment.uri]; };\n return new shaka.media.SegmentReference(\n i, segment.startTime, segment.endTime, getUris, 0, null);\n });\n};\n\n\n/**\n * Creates Variants from audio and video StreamDB collections.\n *\n * @param {!Array.<!shakaExtern.StreamDB>} audios\n * @param {!Array.<!shakaExtern.StreamDB>} videos\n * @param {!Array.<!shakaExtern.DrmInfo>} drmInfos\n * @return {!Array.<!shakaExtern.Variant>}\n * @private\n */\nshaka.offline.OfflineUtils.createVariants_ = function(\n audios, videos, drmInfos) {\n var variants = [];\n if (!audios.length && !videos.length) return variants;\n\n // Create a single null element so the double loop will work for audio-only or\n // video-only variants.\n if (!audios.length) {\n audios = [null];\n } else if (!videos.length) {\n videos = [null];\n }\n\n var OfflineUtils = shaka.offline.OfflineUtils;\n var id = 0;\n for (var i = 0; i < audios.length; i++) {\n for (var j = 0; j < videos.length; j++) {\n if (OfflineUtils.areCompatible_(audios[i], videos[j])) {\n var variant =\n OfflineUtils.createVariant_(audios[i], videos[j], drmInfos, id++);\n variants.push(variant);\n }\n }\n }\n\n return variants;\n};\n\n\n/**\n * Checks if two streams can be combined into a variant.\n *\n * @param {?shakaExtern.StreamDB} stream1\n * @param {?shakaExtern.StreamDB} stream2\n * @return {boolean}\n * @private\n */\nshaka.offline.OfflineUtils.areCompatible_ = function(stream1, stream2) {\n // Treat content that doesn't have variantIds as compatible\n // with anything for compatibility with content stored before\n // the variants were introduced.\n if (!stream1 || !stream2 || !stream1.variantIds || !stream2.variantIds)\n return true;\n\n for (var i = 0; i < stream1.variantIds.length; i++) {\n var containsId = stream2.variantIds.some(function(id) {\n return id == stream1.variantIds[i];\n });\n if (containsId) {\n return true;\n }\n }\n\n return false;\n};\n\n\n/**\n * Creates a Variant from an audio and a video StreamDBs.\n * If one of the streams is null, it creates a Variant from the other.\n *\n * @param {?shakaExtern.StreamDB} audio\n * @param {?shakaExtern.StreamDB} video\n * @param {!Array.<!shakaExtern.DrmInfo>} drmInfos\n * @param {number} id\n * @return {!shakaExtern.Variant}\n * @private\n */\nshaka.offline.OfflineUtils.createVariant_ = function(\n audio, video, drmInfos, id) {\n return {\n id: id,\n language: audio ? audio.language : '',\n // Use !! to get the compiler to use a boolean type. Otherwise it will\n // deduce the type as {boolean|shakaExtern.StreamDB} even though |audio|\n // will only be returned if it is falsy, so the type would be {boolean|null}\n primary: (!!audio && audio.primary) || (!!video && video.primary),\n audio: shaka.offline.OfflineUtils.createStream_(audio),\n video: shaka.offline.OfflineUtils.createStream_(video),\n bandwidth: 0,\n drmInfos: drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n};\n\n\n/**\n * Creates a shakaExtern.Stream from a StreamDB.\n *\n * @param {?shakaExtern.StreamDB} streamDb\n * @return {?shakaExtern.Stream}\n * @private\n */\nshaka.offline.OfflineUtils.createStream_ = function(streamDb) {\n if (!streamDb) return null;\n\n var refs =\n shaka.offline.OfflineUtils.getSegmentReferences_(streamDb);\n\n var segmentIndex = new shaka.media.SegmentIndex(refs);\n\n var initRef = streamDb.initSegmentUri ?\n new shaka.media.InitSegmentReference(\n function() { return [streamDb.initSegmentUri]; }, 0, null) :\n null;\n return {\n id: streamDb.id,\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex),\n initSegmentReference: initRef,\n presentationTimeOffset: streamDb.presentationTimeOffset,\n mimeType: streamDb.mimeType,\n codecs: streamDb.codecs,\n width: streamDb.width || undefined,\n height: streamDb.height || undefined,\n frameRate: streamDb.frameRate || undefined,\n kind: streamDb.kind,\n encrypted: streamDb.encrypted,\n keyId: streamDb.keyId,\n language: streamDb.language,\n label: streamDb.label || null,\n type: streamDb.contentType,\n primary: streamDb.primary,\n trickModeVideo: null,\n // TODO(modmaker): Store offline?\n containsEmsgBoxes: false,\n roles: []\n };\n};\n\n\n/**\n * Determines if this platform supports any form of storage engine.\n * @return {boolean}\n */\nshaka.offline.OfflineUtils.isStorageEngineSupported = function() {\n return shaka.offline.DBEngine.isSupported();\n};\n\n\n/**\n * Create a new instance of the supported storage engine. The created instance\n * will be uninitialized. If this platform does not support any storage\n * engines, this function will return null.\n * @return {shaka.offline.IStorageEngine}\n */\nshaka.offline.OfflineUtils.createStorageEngine = function() {\n return shaka.offline.DBEngine.isSupported() ?\n new shaka.offline.DBEngine() :\n null;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/offline_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.OfflineManifestParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.Error');\n\n\n\n/**\n * Creates a new offline manifest parser.\n * @struct\n * @constructor\n * @implements {shakaExtern.ManifestParser}\n */\nshaka.offline.OfflineManifestParser = function() {\n /** @private {number} */\n this.manifestId_ = -1;\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.configure = function(config) {\n // No-op\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.start =\n function(uri, playerInterface) {\n var parts = /^offline:([0-9]+)$/.exec(uri);\n if (!parts) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_OFFLINE_URI, uri));\n }\n var manifestId = Number(parts[1]);\n var storageEngine = shaka.offline.OfflineUtils.createStorageEngine();\n this.manifestId_ = manifestId;\n\n if (!storageEngine) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORAGE_NOT_SUPPORTED));\n }\n\n return storageEngine.init(shaka.offline.OfflineUtils.DB_SCHEME)\n .then(function() { return storageEngine.get('manifest', manifestId); })\n .then(function(manifest) {\n if (!manifest) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND, manifestId);\n }\n\n var OfflineManifestParser = shaka.offline.OfflineManifestParser;\n return OfflineManifestParser.reconstructManifest(manifest);\n })\n .then(\n function(ret) {\n return storageEngine.destroy().then(function() { return ret; });\n },\n function(err) {\n return storageEngine.destroy().then(function() { throw err; });\n });\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.stop = function() {\n return Promise.resolve();\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.update = function() {\n // No-op\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.onExpirationUpdated = function(\n sessionId, expiration) {\n var storageEngine = shaka.offline.OfflineUtils.createStorageEngine();\n goog.asserts.assert(storageEngine, 'Must support offline storage');\n\n storageEngine.init(shaka.offline.OfflineUtils.DB_SCHEME)\n .then(function() {\n return storageEngine.get('manifest', this.manifestId_);\n }.bind(this))\n .then(function(manifest) {\n if (!manifest) {\n // Manifest was deleted, ignore update.\n return;\n }\n if (manifest.sessionIds.indexOf(sessionId) < 0) {\n shaka.log.debug('Ignoring updated expiration for unknown session');\n return;\n }\n\n if (manifest.expiration == undefined ||\n manifest.expiration > expiration) {\n shaka.log.debug('Updating expiration for stored content');\n manifest.expiration = expiration;\n return storageEngine.insert('manifest', manifest);\n }\n })\n .catch(function(error) {\n shaka.log.error('Error updating offline manifest expiration', error);\n })\n .then(function() {\n return storageEngine.destroy();\n });\n};\n\n\n/**\n * Reconstructs a manifest object from the given database manifest.\n *\n * @param {shakaExtern.ManifestDB} manifest\n * @return {shakaExtern.Manifest}\n */\nshaka.offline.OfflineManifestParser.reconstructManifest = function(manifest) {\n var timeline = new shaka.media.PresentationTimeline(null, 0);\n timeline.setDuration(manifest.duration);\n var drmInfos = manifest.drmInfo ? [manifest.drmInfo] : [];\n return {\n presentationTimeline: timeline,\n minBufferTime: 10,\n offlineSessionIds: manifest.sessionIds,\n periods: manifest.periods.map(function(period) {\n return shaka.offline.OfflineUtils.reconstructPeriod(period,\n drmInfos,\n timeline);\n })\n };\n};\n\n\nshaka.media.ManifestParser.registerParserByMime(\n 'application/x-offline-manifest', shaka.offline.OfflineManifestParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/offline_manifest_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.OfflineScheme');\n\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.Error');\n\n\n/**\n * @namespace\n * @summary A plugin that handles requests for offline content.\n * @param {string} uri\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.offline.OfflineScheme = function(uri, request) {\n var manifestParts = /^offline:([0-9]+)$/.exec(uri);\n if (manifestParts) {\n /** @type {shakaExtern.Response} */\n var response = {\n uri: uri,\n data: new ArrayBuffer(0),\n headers: {'content-type': 'application/x-offline-manifest'}\n };\n return Promise.resolve(response);\n }\n\n var segmentParts = /^offline:[0-9]+\\/[0-9]+\\/([0-9]+)$/.exec(uri);\n if (segmentParts) {\n var segmentId = Number(segmentParts[1]);\n var scheme = shaka.offline.OfflineUtils.DB_SCHEME;\n var storageEngine = shaka.offline.OfflineUtils.createStorageEngine();\n\n if (!storageEngine) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORAGE_NOT_SUPPORTED));\n }\n\n return storageEngine.init(scheme)\n .then(function() { return storageEngine.get('segment', segmentId); })\n .then(function(segment) {\n return storageEngine.destroy().then(function() {\n if (!segment) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND, segmentId);\n }\n return {uri: uri, data: segment.data, headers: {}};\n });\n });\n }\n\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_OFFLINE_URI, uri));\n};\n\n\nshaka.net.NetworkingEngine.registerScheme(\n 'offline', shaka.offline.OfflineScheme);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/offline_scheme.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.CancelableChain');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.Error');\n\n\n\n/**\n * A Promise-based abstraction that creates cancelable Promise chains.\n * When canceled, subsequent stages of the internal Promise chain will stop.\n * A canceled chain is rejected with a user-specified value.\n *\n * A CancelableChain only supports linear Promise chains. Chains which branch\n * (more than one then() handler chained to a particular stage) are not\n * supported. You will not be prevented from treating this as if branching\n * were supported, but everything will be serialized into a linear chain.\n * Be careful!\n *\n * @constructor\n * @struct\n */\nshaka.util.CancelableChain = function() {\n /** @private {!Promise} */\n this.promise_ = Promise.resolve();\n\n /** @private {boolean} */\n this.final_ = false;\n\n /** @private {boolean} */\n this.complete_ = false;\n\n /** @private {boolean} */\n this.canceled_ = false;\n\n /** @private {shaka.util.Error} */\n this.rejectionValue_;\n\n /** @private {function()} */\n this.onCancelComplete_;\n\n /** @private {!Promise} */\n this.cancelPromise_ = new Promise(function(resolve) {\n this.onCancelComplete_ = resolve;\n }.bind(this));\n};\n\n\n/**\n * @param {function(*)} callback\n * @return {!shaka.util.CancelableChain} the chain itself.\n */\nshaka.util.CancelableChain.prototype.then = function(callback) {\n goog.asserts.assert(!this.final_, 'Chain should not be final!');\n\n this.promise_ = this.promise_.then(callback).then(function(data) {\n if (this.canceled_) {\n this.onCancelComplete_();\n return Promise.reject(this.rejectionValue_);\n }\n return Promise.resolve(data);\n }.bind(this));\n return this;\n};\n\n\n/**\n * Finalize the chain.\n * Converts the chain into a simple Promise and stops accepting new stages.\n *\n * @return {!Promise}\n */\nshaka.util.CancelableChain.prototype.finalize = function() {\n if (!this.final_) {\n this.promise_ = this.promise_.then(function(data) {\n this.complete_ = true;\n return Promise.resolve(data);\n }.bind(this), function(error) {\n this.complete_ = true;\n if (this.canceled_) {\n this.onCancelComplete_();\n return Promise.reject(this.rejectionValue_);\n }\n\n return Promise.reject(error);\n }.bind(this));\n }\n this.final_ = true;\n return this.promise_;\n};\n\n\n/**\n * Cancel the Promise chain and reject with the given value.\n *\n * @param {!shaka.util.Error} reason\n * @return {!Promise} resolved when the cancelation has been processed by the\n * the chain and no more stages will execute. Note that this may be before\n * the owner of the finalized chain has seen the rejection.\n */\nshaka.util.CancelableChain.prototype.cancel = function(reason) {\n if (this.complete_) return Promise.resolve();\n\n this.canceled_ = true;\n this.rejectionValue_ = reason;\n return this.cancelPromise_;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/cancelable_chain.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.Storage');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.Player');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.offline.DownloadManager');\ngoog.require('shaka.offline.IStorageEngine');\ngoog.require('shaka.offline.OfflineManifestParser');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.LanguageUtils');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * This manages persistent offline data including storage, listing, and deleting\n * stored manifests. Playback of offline manifests are done using Player\n * using the special URI (e.g. 'offline:12').\n *\n * First, check support() to see if offline is supported by the platform.\n * Second, configure() the storage object with callbacks to your application.\n * Third, call store(), remove(), or list() as needed.\n * When done, call destroy().\n *\n * @param {shaka.Player} player\n * The player instance to pull configuration data from.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n * @export\n */\nshaka.offline.Storage = function(player) {\n // It is an easy mistake to make to pass a Player proxy from CastProxy.\n // Rather than throw a vague exception later, throw an explicit and clear one\n // now.\n if (!player || player.constructor != shaka.Player) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.LOCAL_PLAYER_INSTANCE_REQUIRED);\n }\n\n /** @private {shaka.offline.IStorageEngine} */\n this.storageEngine_ = shaka.offline.OfflineUtils.createStorageEngine();\n\n /** @private {shaka.Player} */\n this.player_ = player;\n\n /** @private {?shakaExtern.OfflineConfiguration} */\n this.config_ = this.defaultConfig_();\n\n /** @private {shaka.media.DrmEngine} */\n this.drmEngine_ = null;\n\n /** @private {boolean} */\n this.storeInProgress_ = false;\n\n /** @private {Array.<shakaExtern.Track>} */\n this.firstPeriodTracks_ = null;\n\n /** @private {number} */\n this.manifestId_ = -1;\n\n /** @private {number} */\n this.duration_ = 0;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = null;\n\n var netEngine = player.getNetworkingEngine();\n goog.asserts.assert(netEngine, 'Player must not be destroyed');\n\n /** @private {shaka.offline.DownloadManager} */\n this.downloadManager_ = new shaka.offline.DownloadManager(\n this.storageEngine_, netEngine,\n player.getConfiguration().streaming.retryParameters, this.config_);\n};\n\n\n/**\n * Gets whether offline storage is supported. Returns true if offline storage\n * is supported for clear content. Support for offline storage of encrypted\n * content will not be determined until storage is attempted.\n *\n * @return {boolean}\n * @export\n */\nshaka.offline.Storage.support = function() {\n return shaka.offline.OfflineUtils.isStorageEngineSupported();\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.offline.Storage.prototype.destroy = function() {\n var storageEngine = this.storageEngine_;\n // Destroy the download manager first since it needs the StorageEngine to\n // clean up old segments.\n var ret = !this.downloadManager_ ?\n Promise.resolve() :\n this.downloadManager_.destroy()\n .catch(function() {})\n .then(function() {\n if (storageEngine) return storageEngine.destroy();\n });\n\n this.storageEngine_ = null;\n this.downloadManager_ = null;\n this.player_ = null;\n this.config_ = null;\n return ret;\n};\n\n\n/**\n * Sets configuration values for Storage. This is not associated with\n * Player.configure and will not change Player.\n *\n * There are two important callbacks configured here: one for download progress,\n * and one to decide which tracks to store.\n *\n * The default track selection callback will store the largest SD video track.\n * Provide your own callback to choose the tracks you want to store.\n *\n * @param {shakaExtern.OfflineConfiguration} config\n * @export\n */\nshaka.offline.Storage.prototype.configure = function(config) {\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n shaka.util.ConfigUtils.mergeConfigObjects(\n this.config_, config, this.defaultConfig_(), {}, '');\n};\n\n\n/**\n * Stores the given manifest. If the content is encrypted, and encrypted\n * content cannot be stored on this platform, the Promise will be rejected with\n * error code 6001, REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE.\n *\n * @param {string} manifestUri The URI of the manifest to store.\n * @param {!Object} appMetadata An arbitrary object from the application that\n * will be stored along-side the offline content. Use this for any\n * application-specific metadata you need associated with the stored content.\n * For details on the data types that can be stored here, please refer to\n * https://goo.gl/h62coS\n * @param {!shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * @return {!Promise.<shakaExtern.StoredContent>} A Promise to a structure\n * representing what was stored. The \"offlineUri\" member is the URI that\n * should be given to Player.load() to play this piece of content offline.\n * The \"appMetadata\" member is the appMetadata argument you passed to store().\n * @export\n */\nshaka.offline.Storage.prototype.store = function(\n manifestUri, appMetadata, opt_manifestParserFactory) {\n if (this.storeInProgress_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORE_ALREADY_IN_PROGRESS));\n }\n this.storeInProgress_ = true;\n\n /** @type {shakaExtern.ManifestDB} */\n var manifestDb;\n\n var error = null;\n var onError = function(e) { error = e; };\n return this.initIfNeeded_()\n .then(function() {\n this.checkDestroyed_();\n return this.loadInternal(\n manifestUri, onError, opt_manifestParserFactory);\n }.bind(this)).then((\n /**\n * @param {{manifest: shakaExtern.Manifest,\n * drmEngine: !shaka.media.DrmEngine}} data\n * @return {!Promise}\n */\n function(data) {\n this.checkDestroyed_();\n this.manifest_ = data.manifest;\n this.drmEngine_ = data.drmEngine;\n\n if (this.manifest_.presentationTimeline.isLive() ||\n this.manifest_.presentationTimeline.isInProgress()) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.CANNOT_STORE_LIVE_OFFLINE, manifestUri);\n }\n\n // Re-filter now that DrmEngine is initialized.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n\n this.manifestId_ = this.storageEngine_.reserveId('manifest');\n this.duration_ = 0;\n manifestDb = this.createOfflineManifest_(manifestUri, appMetadata);\n return this.downloadManager_.downloadAndStore(manifestDb);\n })\n .bind(this))\n .then(function() {\n this.checkDestroyed_();\n // Throw any errors from the manifest parser or DrmEngine.\n if (error)\n throw error;\n\n return this.cleanup_();\n }.bind(this))\n .then(function() {\n return shaka.offline.OfflineUtils.getStoredContent(manifestDb);\n }.bind(this))\n .catch(function(err) {\n var Functional = shaka.util.Functional;\n return this.cleanup_().catch(Functional.noop).then(function() {\n throw err;\n });\n }.bind(this));\n};\n\n\n/**\n * Removes the given stored content.\n *\n * @param {shakaExtern.StoredContent} content\n * @return {!Promise}\n * @export\n */\nshaka.offline.Storage.prototype.remove = function(content) {\n var uri = content.offlineUri;\n var parts = /^offline:([0-9]+)$/.exec(uri);\n if (!parts) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.MALFORMED_OFFLINE_URI, uri));\n }\n\n var error = null;\n var onError = function(e) {\n // Ignore errors if the session was already removed.\n if (e.code != shaka.util.Error.Code.OFFLINE_SESSION_REMOVED)\n error = e;\n };\n\n /** @type {shakaExtern.ManifestDB} */\n var manifestDb;\n /** @type {!shaka.media.DrmEngine} */\n var drmEngine;\n var manifestId = Number(parts[1]);\n return this.initIfNeeded_().then(function() {\n this.checkDestroyed_();\n return this.storageEngine_.get('manifest', manifestId);\n }.bind(this)).then((\n /**\n * @param {?shakaExtern.ManifestDB} data\n * @return {!Promise}\n */\n function(data) {\n this.checkDestroyed_();\n if (!data) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND, uri);\n }\n manifestDb = data;\n var manifest =\n shaka.offline.OfflineManifestParser.reconstructManifest(manifestDb);\n var netEngine = this.player_.getNetworkingEngine();\n goog.asserts.assert(netEngine, 'Player must not be destroyed');\n drmEngine = new shaka.media.DrmEngine(\n netEngine, onError, function() {}, function() {});\n drmEngine.configure(this.player_.getConfiguration().drm);\n return drmEngine.init(manifest, true /* isOffline */);\n })\n .bind(this)).then(function() {\n return drmEngine.removeSessions(manifestDb.sessionIds);\n }.bind(this)).then(function() {\n return drmEngine.destroy();\n }.bind(this)).then(function() {\n this.checkDestroyed_();\n if (error) throw error;\n var Functional = shaka.util.Functional;\n // Get every segment for every stream in the manifest.\n /** @type {!Array.<number>} */\n var segments = manifestDb.periods.map(function(period) {\n return period.streams.map(function(stream) {\n var segments = stream.segments.map(function(segment) {\n var parts = /^offline:[0-9]+\\/[0-9]+\\/([0-9]+)$/.exec(segment.uri);\n goog.asserts.assert(parts, 'Invalid offline URI');\n return Number(parts[1]);\n });\n if (stream.initSegmentUri) {\n var parts = /^offline:[0-9]+\\/[0-9]+\\/([0-9]+)$/.exec(\n stream.initSegmentUri);\n goog.asserts.assert(parts, 'Invalid offline URI');\n segments.push(Number(parts[1]));\n }\n return segments;\n }).reduce(Functional.collapseArrays, []);\n }).reduce(Functional.collapseArrays, []);\n\n // Delete all the segments.\n var deleteCount = 0;\n var segmentCount = segments.length;\n var callback = this.config_.progressCallback;\n\n return this.storageEngine_.removeKeys('segment', segments, function() {\n deleteCount++;\n callback(content, deleteCount / segmentCount);\n });\n\n }.bind(this)).then(function() {\n this.checkDestroyed_();\n this.config_.progressCallback(content, 1);\n return this.storageEngine_.remove('manifest', manifestId);\n }.bind(this));\n};\n\n\n/**\n * Lists all the stored content available.\n *\n * @return {!Promise.<!Array.<shakaExtern.StoredContent>>} A Promise to an\n * array of structures representing all stored content. The \"offlineUri\"\n * member of the structure is the URI that should be given to Player.load()\n * to play this piece of content offline. The \"appMetadata\" member is the\n * appMetadata argument you passed to store().\n * @export\n */\nshaka.offline.Storage.prototype.list = function() {\n /** @type {!Array.<shakaExtern.StoredContent>} */\n var storedContents = [];\n return this.initIfNeeded_()\n .then(function() {\n this.checkDestroyed_();\n return this.storageEngine_.forEach(\n 'manifest', function(/** shakaExtern.ManifestDB */ manifest) {\n storedContents.push(\n shaka.offline.OfflineUtils.getStoredContent(manifest));\n });\n }.bind(this))\n .then(function() { return storedContents; });\n};\n\n\n/**\n * Loads the given manifest, parses it, and constructs the DrmEngine. This\n * stops the manifest parser. This may be replaced by tests.\n *\n * @param {string} manifestUri\n * @param {function(*)} onError\n * @param {!shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * @return {!Promise.<{\n * manifest: shakaExtern.Manifest,\n * drmEngine: !shaka.media.DrmEngine\n * }>}\n */\nshaka.offline.Storage.prototype.loadInternal = function(\n manifestUri, onError, opt_manifestParserFactory) {\n\n var netEngine = /** @type {!shaka.net.NetworkingEngine} */ (\n this.player_.getNetworkingEngine());\n var config = this.player_.getConfiguration();\n\n /** @type {shakaExtern.Manifest} */\n var manifest;\n /** @type {!shaka.media.DrmEngine} */\n var drmEngine;\n /** @type {!shakaExtern.ManifestParser} */\n var manifestParser;\n\n var onKeyStatusChange = function() {};\n return shaka.media.ManifestParser\n .getFactory(\n manifestUri, netEngine, config.manifest.retryParameters,\n opt_manifestParserFactory)\n .then(function(factory) {\n this.checkDestroyed_();\n manifestParser = new factory();\n manifestParser.configure(config.manifest);\n\n var playerInterface = {\n networkingEngine: netEngine,\n filterPeriod: this.filterPeriod_.bind(this),\n onTimelineRegionAdded: function() {},\n onEvent: function() {},\n onError: onError\n };\n return manifestParser.start(manifestUri, playerInterface);\n }.bind(this))\n .then(function(data) {\n this.checkDestroyed_();\n manifest = data;\n drmEngine = new shaka.media.DrmEngine(\n netEngine, onError, onKeyStatusChange, function() {});\n drmEngine.configure(config.drm);\n return drmEngine.init(manifest, true /* isOffline */);\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return this.createSegmentIndex_(manifest);\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return drmEngine.createOrLoad();\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return manifestParser.stop();\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return {manifest: manifest, drmEngine: drmEngine};\n }.bind(this))\n .catch(function(error) {\n if (manifestParser)\n return manifestParser.stop().then(function() { throw error; });\n else\n throw error;\n });\n};\n\n\n/**\n * The default track selection function.\n *\n * @param {!Array.<shakaExtern.Track>} tracks\n * @return {!Array.<shakaExtern.Track>}\n * @private\n */\nshaka.offline.Storage.prototype.defaultTrackSelect_ = function(tracks) {\n var LanguageUtils = shaka.util.LanguageUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var selectedTracks = [];\n\n // Select variants with best language match.\n var audioLangPref = LanguageUtils.normalize(\n this.player_.getConfiguration().preferredAudioLanguage);\n var matchTypes = [\n LanguageUtils.MatchType.EXACT,\n LanguageUtils.MatchType.BASE_LANGUAGE_OKAY,\n LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY\n ];\n var allVariantTracks =\n tracks.filter(function(track) { return track.type == 'variant'; });\n // For each match type, get the tracks that match the audio preference for\n // that match type.\n var tracksByMatchType = matchTypes.map(function(match) {\n return allVariantTracks.filter(function(track) {\n var lang = LanguageUtils.normalize(track.language);\n return LanguageUtils.match(match, audioLangPref, lang);\n });\n });\n\n // Find the best match type that has any matches.\n var variantTracks;\n for (var i = 0; i < tracksByMatchType.length; i++) {\n if (tracksByMatchType[i].length) {\n variantTracks = tracksByMatchType[i];\n break;\n }\n }\n\n // Fall back to \"primary\" audio tracks, if present.\n if (!variantTracks) {\n var primaryTracks = allVariantTracks.filter(function(track) {\n return track.primary;\n });\n if (primaryTracks.length)\n variantTracks = primaryTracks;\n }\n\n // Otherwise, there is no good way to choose the language, so we don't choose\n // a language at all.\n if (!variantTracks) {\n variantTracks = allVariantTracks;\n // Issue a warning, but only if the content has multiple languages.\n // Otherwise, this warning would just be noise.\n var languages = allVariantTracks\n .map(function(track) { return track.language; })\n .filter(shaka.util.Functional.isNotDuplicate);\n if (languages.length > 1) {\n shaka.log.warning('Could not choose a good audio track based on ' +\n 'language preferences or primary tracks. An ' +\n 'arbitrary language will be stored!');\n }\n }\n\n // From previously selected variants, choose the SD ones (height <= 480).\n var tracksByHeight = variantTracks.filter(function(track) {\n return track.height && track.height <= 480;\n });\n\n // If variants don't have video or no video with height <= 480 was\n // found, proceed with the previously selected tracks.\n if (tracksByHeight.length) {\n // Sort by resolution, then select all variants which match the height\n // of the highest SD res. There may be multiple audio bitrates for the\n // same video resolution.\n tracksByHeight.sort(function(a, b) { return b.height - a.height; });\n variantTracks = tracksByHeight.filter(function(track) {\n return track.height == tracksByHeight[0].height;\n });\n }\n\n // Now sort by bandwidth.\n variantTracks.sort(function(a, b) { return a.bandwidth - b.bandwidth; });\n\n // In case there are multiple matches at different audio bitrates, select the\n // middle bandwidth one.\n if (variantTracks.length)\n selectedTracks.push(variantTracks[Math.floor(variantTracks.length / 2)]);\n\n // Since this default callback is used primarily by our own demo app and by\n // app developers who haven't thought about which tracks they want, we should\n // select all text tracks, regardless of language. This makes for a better\n // demo for us, and does not rely on user preferences for the unconfigured\n // app.\n selectedTracks.push.apply(selectedTracks, tracks.filter(function(track) {\n return track.type == ContentType.TEXT;\n }));\n\n return selectedTracks;\n};\n\n\n/**\n * @return {shakaExtern.OfflineConfiguration}\n * @private\n */\nshaka.offline.Storage.prototype.defaultConfig_ = function() {\n return {\n trackSelectionCallback: this.defaultTrackSelect_.bind(this),\n progressCallback: function(storedContent, percent) {\n // Reference arguments to keep closure from removing it.\n // If the argument is removed, it breaks our function length check\n // in mergeConfigObjects_().\n // NOTE: Chrome App Content Security Policy prohibits usage of new\n // Function().\n if (storedContent || percent) return null;\n }\n };\n};\n\n\n/**\n * Initializes the IStorageEngine if it is not already.\n *\n * @return {!Promise}\n * @private\n */\nshaka.offline.Storage.prototype.initIfNeeded_ = function() {\n if (!this.storageEngine_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORAGE_NOT_SUPPORTED));\n } else if (this.storageEngine_.initialized()) {\n return Promise.resolve();\n } else {\n var scheme = shaka.offline.OfflineUtils.DB_SCHEME;\n return this.storageEngine_.init(scheme);\n }\n};\n\n\n/**\n * @param {shakaExtern.Period} period\n * @private\n */\nshaka.offline.Storage.prototype.filterPeriod_ = function(period) {\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var activeStreams = {};\n if (this.firstPeriodTracks_) {\n var variantTracks = this.firstPeriodTracks_.filter(function(track) {\n return track.type == 'variant';\n });\n var variant = null;\n if (variantTracks.length)\n variant = StreamUtils.findVariantForTrack(period, variantTracks[0]);\n\n if (variant) {\n // Use the first variant as the container of \"active streams\". This\n // is then used to filter out the streams that are not compatible with it.\n // This ensures that in multi-Period content, all Periods have streams\n // with compatible MIME types.\n if (variant.video) activeStreams[ContentType.VIDEO] = variant.video;\n if (variant.audio) activeStreams[ContentType.AUDIO] = variant.audio;\n }\n }\n StreamUtils.filterPeriod(this.drmEngine_, activeStreams, period);\n StreamUtils.applyRestrictions(\n period, this.player_.getConfiguration().restrictions,\n /* maxHwRes */ { width: Infinity, height: Infinity });\n};\n\n\n/**\n * Cleans up the current store and destroys any objects. This object is still\n * usable after this.\n *\n * @return {!Promise}\n * @private\n */\nshaka.offline.Storage.prototype.cleanup_ = function() {\n var ret = this.drmEngine_ ? this.drmEngine_.destroy() : Promise.resolve();\n this.drmEngine_ = null;\n this.manifest_ = null;\n this.storeInProgress_ = false;\n this.firstPeriodTracks_ = null;\n this.manifestId_ = -1;\n return ret;\n};\n\n\n/**\n * Calls createSegmentIndex for all streams in the manifest.\n *\n * @param {shakaExtern.Manifest} manifest\n * @return {!Promise}\n * @private\n */\nshaka.offline.Storage.prototype.createSegmentIndex_ = function(manifest) {\n var Functional = shaka.util.Functional;\n var streams = manifest.periods\n .map(function(period) { return period.variants; })\n .reduce(Functional.collapseArrays, [])\n .map(function(variant) {\n var variantStreams = [];\n if (variant.audio) variantStreams.push(variant.audio);\n if (variant.video) variantStreams.push(variant.video);\n return variantStreams;\n })\n .reduce(Functional.collapseArrays, [])\n .filter(Functional.isNotDuplicate);\n\n var textStreams = manifest.periods\n .map(function(period) { return period.textStreams; })\n .reduce(Functional.collapseArrays, []);\n\n streams.push.apply(streams, textStreams);\n return Promise.all(\n streams.map(function(stream) { return stream.createSegmentIndex(); }));\n};\n\n\n/**\n * Creates an offline 'manifest' for the real manifest. This does not store\n * the segments yet, only adds them to the download manager through\n * createPeriod_.\n *\n * @param {string} originalManifestUri\n * @param {!Object} appMetadata\n * @return {shakaExtern.ManifestDB}\n * @private\n */\nshaka.offline.Storage.prototype.createOfflineManifest_ = function(\n originalManifestUri, appMetadata) {\n var periods = this.manifest_.periods.map(this.createPeriod_.bind(this));\n var drmInfo = this.drmEngine_.getDrmInfo();\n var sessions = this.drmEngine_.getSessionIds();\n if (drmInfo) {\n if (!sessions.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.NO_INIT_DATA_FOR_OFFLINE, originalManifestUri);\n }\n // Don't store init data since we have stored sessions.\n drmInfo.initData = [];\n }\n\n return {\n key: this.manifestId_,\n originalManifestUri: originalManifestUri,\n duration: this.duration_,\n size: 0,\n expiration: this.drmEngine_.getExpiration(),\n periods: periods,\n sessionIds: sessions,\n drmInfo: drmInfo,\n appMetadata: appMetadata\n };\n};\n\n\n/**\n * Converts a manifest Period to a database Period. This will use the current\n * configuration to get the tracks to use, then it will search each segment\n * index and add all the segments to the download manager through createStream_.\n *\n * @param {shakaExtern.Period} period\n * @return {shakaExtern.PeriodDB}\n * @private\n */\nshaka.offline.Storage.prototype.createPeriod_ = function(period) {\n var StreamUtils = shaka.util.StreamUtils;\n\n var variantTracks = StreamUtils.getVariantTracks(period, null, null);\n var textTracks = StreamUtils.getTextTracks(period, null);\n var allTracks = variantTracks.concat(textTracks);\n\n var chosenTracks = this.config_.trackSelectionCallback(allTracks);\n\n if (this.firstPeriodTracks_ == null) {\n this.firstPeriodTracks_ = chosenTracks;\n // Now that the first tracks are chosen, filter again. This ensures all\n // Periods have compatible content types.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n }\n\n for (var i = chosenTracks.length - 1; i > 0; --i) {\n var foundSimilarTracks = false;\n for (var j = i - 1; j >= 0; --j) {\n if (chosenTracks[i].type == chosenTracks[j].type &&\n chosenTracks[i].kind == chosenTracks[j].kind &&\n chosenTracks[i].language == chosenTracks[j].language) {\n shaka.log.warning(\n 'Multiple tracks of the same type/kind/language given.');\n foundSimilarTracks = true;\n break;\n }\n }\n if (foundSimilarTracks) break;\n }\n\n var streams = [];\n\n for (var i = 0; i < chosenTracks.length; i++) {\n var variant = StreamUtils.findVariantForTrack(period, chosenTracks[i]);\n if (variant) {\n // Make a rough estimation of the streams' bandwidth so download manager\n // can track the progress of the download.\n var bandwidthEstimation;\n if (variant.audio) {\n // If the audio stream has already been added to the DB\n // as part of another variant, add the ID to the list.\n // Otherwise, add it to the DB.\n var stream = streams.filter(function(s) {\n return s.id == variant.audio.id;\n })[0];\n if (stream) {\n stream.variantIds.push(variant.id);\n } else {\n // If variant has both audio and video, roughly estimate them\n // both to be 1/2 of the variant's bandwidth.\n // If variant only has one stream, it's bandwidth equals to\n // the bandwidth of the variant.\n bandwidthEstimation =\n variant.video ? variant.bandwidth / 2 : variant.bandwidth;\n streams.push(this.createStream_(period,\n variant.audio,\n bandwidthEstimation,\n variant.id));\n }\n }\n if (variant.video) {\n var stream = streams.filter(function(s) {\n return s.id == variant.video.id;\n })[0];\n if (stream) {\n stream.variantIds.push(variant.id);\n } else {\n bandwidthEstimation =\n variant.audio ? variant.bandwidth / 2 : variant.bandwidth;\n streams.push(this.createStream_(period,\n variant.video,\n bandwidthEstimation,\n variant.id));\n }\n }\n } else {\n var textStream =\n StreamUtils.findTextStreamForTrack(period, chosenTracks[i]);\n goog.asserts.assert(\n textStream, 'Could not find track with id ' + chosenTracks[i].id);\n streams.push(this.createStream_(\n period, textStream, 0 /* estimatedStreamBandwidth */));\n }\n }\n\n return {\n startTime: period.startTime,\n streams: streams\n };\n};\n\n\n/**\n * Converts a manifest stream to a database stream. This will search the\n * segment index and add all the segments to the download manager.\n *\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Stream} stream\n * @param {number} estimatedStreamBandwidth\n * @param {number=} opt_variantId\n * @return {shakaExtern.StreamDB}\n * @private\n */\nshaka.offline.Storage.prototype.createStream_ = function(\n period, stream, estimatedStreamBandwidth, opt_variantId) {\n /** @type {!Array.<shakaExtern.SegmentDB>} */\n var segmentsDb = [];\n var startTime =\n this.manifest_.presentationTimeline.getSegmentAvailabilityStart();\n var endTime = startTime;\n var i = stream.findSegmentPosition(startTime);\n var ref = (i != null ? stream.getSegmentReference(i) : null);\n while (ref) {\n var id = this.storageEngine_.reserveId('segment');\n var bandwidthSize =\n (ref.endTime - ref.startTime) * estimatedStreamBandwidth / 8;\n\n /** @type {shakaExtern.SegmentDataDB} */\n var segmentDataDb = {\n key: id,\n data: null,\n manifestKey: this.manifestId_,\n streamNumber: stream.id,\n segmentNumber: id\n };\n this.downloadManager_.addSegment(\n stream.type, ref, bandwidthSize, segmentDataDb);\n\n segmentsDb.push({\n startTime: ref.startTime,\n endTime: ref.endTime,\n uri: 'offline:' + this.manifestId_ + '/' + stream.id + '/' + id\n });\n\n endTime = ref.endTime + period.startTime;\n ref = stream.getSegmentReference(++i);\n }\n\n this.duration_ = Math.max(this.duration_, (endTime - startTime));\n var initUri = null;\n if (stream.initSegmentReference) {\n var id = this.storageEngine_.reserveId('segment');\n initUri = 'offline:' + this.manifestId_ + '/' + stream.id + '/' + id;\n\n /** @type {shakaExtern.SegmentDataDB} */\n var initDataDb = {\n key: id,\n data: null,\n manifestKey: this.manifestId_,\n streamNumber: stream.id,\n segmentNumber: -1\n };\n\n this.downloadManager_.addSegment(\n stream.contentType, stream.initSegmentReference, 0, initDataDb);\n }\n\n var variantIds = [];\n if (opt_variantId != null) variantIds.push(opt_variantId);\n\n return {\n id: stream.id,\n primary: stream.primary,\n presentationTimeOffset: stream.presentationTimeOffset || 0,\n contentType: stream.type,\n mimeType: stream.mimeType,\n codecs: stream.codecs,\n frameRate: stream.frameRate,\n kind: stream.kind,\n language: stream.language,\n label: stream.label,\n width: stream.width || null,\n height: stream.height || null,\n initSegmentUri: initUri,\n encrypted: stream.encrypted,\n keyId: stream.keyId,\n segments: segmentsDb,\n variantIds: variantIds\n };\n};\n\n\n/**\n * Throws an error if the object is destroyed.\n * @private\n */\nshaka.offline.Storage.prototype.checkDestroyed_ = function() {\n if (!this.player_) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED);\n }\n};\n\n\nshaka.Player.registerSupportPlugin('offline', shaka.offline.Storage.support);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/storage.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.installAll');\ngoog.provide('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill\n * @summary A one-stop installer for all polyfills.\n * @see http://enwp.org/polyfill\n * @exportDoc\n */\n\n\n/**\n * Install all polyfills.\n * @export\n */\nshaka.polyfill.installAll = function() {\n for (var i = 0; i < shaka.polyfill.polyfills_.length; ++i) {\n shaka.polyfill.polyfills_[i]();\n }\n};\n\n\n/**\n * Contains the polyfills that will be installed.\n * @private {!Array.<function()>}\n */\nshaka.polyfill.polyfills_ = [];\n\n\n/**\n * Registers a new polyfill to be installed.\n *\n * @param {function()} polyfill\n * @export\n */\nshaka.polyfill.register = function(polyfill) {\n shaka.polyfill.polyfills_.push(polyfill);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/all.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.Fullscreen');\n\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.Fullscreen\n *\n * @summary A polyfill to unify fullscreen APIs across browsers.\n * Many browsers have prefixed fullscreen methods on Element and document.\n * See {@link http://goo.gl/n7TYl0 Using fullscreen mode} on MDN for more\n * information.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.Fullscreen.install = function() {\n if (!window.Document) {\n // Avoid errors on very old browsers.\n return;\n }\n\n var proto = Element.prototype;\n proto.requestFullscreen = proto.requestFullscreen ||\n proto.mozRequestFullScreen ||\n proto.msRequestFullscreen ||\n proto.webkitRequestFullscreen;\n\n proto = Document.prototype;\n proto.exitFullscreen = proto.exitFullscreen ||\n proto.mozCancelFullScreen ||\n proto.msExitFullscreen ||\n proto.webkitExitFullscreen;\n\n if (!('fullscreenElement' in document)) {\n Object.defineProperty(document, 'fullscreenElement', {\n get: function() {\n return document.mozFullScreenElement ||\n document.msFullscreenElement ||\n document.webkitFullscreenElement;\n }\n });\n Object.defineProperty(document, 'fullscreenEnabled', {\n get: function() {\n return document.mozFullScreenEnabled ||\n document.msFullscreenEnabled ||\n document.webkitFullscreenEnabled;\n }\n });\n }\n\n var proxy = shaka.polyfill.Fullscreen.proxyEvent_;\n document.addEventListener('webkitfullscreenchange', proxy);\n document.addEventListener('webkitfullscreenerror', proxy);\n document.addEventListener('mozfullscreenchange', proxy);\n document.addEventListener('mozfullscreenerror', proxy);\n document.addEventListener('MSFullscreenChange', proxy);\n document.addEventListener('MSFullscreenError', proxy);\n};\n\n\n/**\n * Proxy fullscreen events after changing their name.\n * @param {!Event} event\n * @private\n */\nshaka.polyfill.Fullscreen.proxyEvent_ = function(event) {\n var eventType = event.type.replace(/^(webkit|moz|MS)/, '').toLowerCase();\n\n var newEvent;\n // IE 11 does not have an Event constructor\n if (typeof(Event) === 'function') {\n newEvent = new Event(eventType, /** @type {EventInit} */(event));\n } else {\n newEvent = document.createEvent('Event');\n newEvent.initEvent(eventType, event.bubbles, event.cancelable);\n }\n\n event.target.dispatchEvent(newEvent);\n};\n\n\nshaka.polyfill.register(shaka.polyfill.Fullscreen.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/fullscreen.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.IndexedDB');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.IndexedDB\n *\n * @summary A polyfill to patch indexed db bugs.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.IndexedDB.install = function() {\n shaka.log.debug('IndexedDB.install');\n\n var agent = navigator.userAgent;\n if (agent && agent.indexOf('CrKey') >= 0) {\n shaka.log.debug('Removing IndexedDB from ChromeCast');\n delete window.indexedDB;\n goog.asserts.assert(\n !window.indexedDB, 'Failed to override window.indexedDB');\n }\n};\n\nshaka.polyfill.register(shaka.polyfill.IndexedDB.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/indexed_db.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\ngoog.provide('shaka.polyfill.MathRound');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n/**\n * @namespace shaka.polyfill.MathRound\n *\n * @summary A polyfill to patch math round bug on some browsers.\n */\n\n\n/**\n @const {number}\n @private\n */\nshaka.polyfill.MathRound.MAX_ACCURATE_INPUT_ = 0x10000000000000;\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.MathRound.install = function() {\n shaka.log.debug('mathRound.install');\n\n var testNumber = shaka.polyfill.MathRound.MAX_ACCURATE_INPUT_ + 1;\n if (Math.round(testNumber) != testNumber) {\n shaka.log.debug('polyfill Math.round');\n var original_mathRound = Math.round;\n Math.round = function(number) {\n var result = number;\n // https://stackoverflow.com/questions/12830742/javascript-math-round-bug-in-ie\n // Due to the precision of JavaScript numbers, the number must be integer\n if (number <= shaka.polyfill.MathRound.MAX_ACCURATE_INPUT_) {\n result = original_mathRound(number);\n }\n return result;\n };\n }\n};\n\nshaka.polyfill.register(shaka.polyfill.MathRound.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/mathround.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Pssh');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Mp4Parser');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n\n/**\n * Parse a PSSH box and extract the system IDs.\n *\n * @param {!Uint8Array} psshBox\n * @constructor\n * @struct\n * @throws {shaka.util.Error} if a PSSH box is truncated or contains a size\n * field over 53 bits.\n */\nshaka.util.Pssh = function(psshBox) {\n /**\n * In hex.\n * @type {!Array.<string>}\n */\n this.systemIds = [];\n\n /**\n * In hex.\n * @type {!Array.<string>}\n */\n this.cencKeyIds = [];\n\n /*\n * Array of tuples that define the startIndex + size for each\n * discrete pssh within |psshBox|\n * */\n this.dataBoundaries = [];\n\n new shaka.util.Mp4Parser()\n .fullBox('pssh', this.parseBox_.bind(this)).parse(psshBox.buffer);\n\n if (this.dataBoundaries.length == 0) {\n shaka.log.warning('No pssh box found!');\n }\n};\n\n\n/**\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @private\n */\nshaka.util.Pssh.prototype.parseBox_ = function(box) {\n goog.asserts.assert(\n box.version != null,\n 'PSSH boxes are full boxes and must have a valid version');\n\n goog.asserts.assert(\n box.flags != null,\n 'PSSH boxes are full boxes and must have a valid flag');\n\n if (box.version > 1) {\n shaka.log.warning('Unrecognized PSSH version found!');\n return;\n }\n\n var systemId = shaka.util.Uint8ArrayUtils.toHex(box.reader.readBytes(16));\n var keyIds = [];\n if (box.version > 0) {\n var numKeyIds = box.reader.readUint32();\n for (var i = 0; i < numKeyIds; ++i) {\n var keyId = shaka.util.Uint8ArrayUtils.toHex(box.reader.readBytes(16));\n keyIds.push(keyId);\n }\n }\n\n var dataSize = box.reader.readUint32();\n box.reader.skip(dataSize); // Ignore the data section.\n\n // Now that everything has been succesfully parsed from this box,\n // update member variables.\n this.cencKeyIds.push.apply(this.cencKeyIds, keyIds);\n this.systemIds.push(systemId);\n this.dataBoundaries.push({\n start: box.start,\n end: box.start + box.size - 1\n });\n\n if (box.reader.getPosition() != box.reader.getLength()) {\n shaka.log.warning('Mismatch between box size and data size!');\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/pssh.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.PatchedMediaKeysMs');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.ArrayUtils');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.Pssh');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * Install a polyfill to implement {@link http://goo.gl/blgtZZ EME draft\n * 12 March 2015} on top of ms-prefixed\n * {@link http://www.w3.org/TR/2014/WD-encrypted-media-20140218/ EME v20140218}.\n */\nshaka.polyfill.PatchedMediaKeysMs.install = function() {\n shaka.log.debug('PatchedMediaKeysMs.install');\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n // Construct fake key ID. This is not done at load-time to avoid exceptions\n // on unsupported browsers. This particular fake key ID was suggested in\n // w3c/encrypted-media#32.\n PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_ = (new Uint8Array([0])).buffer;\n\n // Delete mediaKeys to work around strict mode compatibility issues.\n delete HTMLMediaElement.prototype['mediaKeys'];\n // Work around read-only declaration for mediaKeys by using a string.\n HTMLMediaElement.prototype['mediaKeys'] = null;\n HTMLMediaElement.prototype.setMediaKeys = PatchedMediaKeysMs.setMediaKeys;\n\n // Install patches\n window.MediaKeys = PatchedMediaKeysMs.MediaKeys;\n window.MediaKeySystemAccess = PatchedMediaKeysMs.MediaKeySystemAccess;\n navigator.requestMediaKeySystemAccess =\n PatchedMediaKeysMs.requestMediaKeySystemAccess;\n};\n\n\n/**\n * An implementation of navigator.requestMediaKeySystemAccess.\n * Retrieve a MediaKeySystemAccess object.\n *\n * @this {!Navigator}\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @return {!Promise.<!MediaKeySystemAccess>}\n */\nshaka.polyfill.PatchedMediaKeysMs.requestMediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysMs.requestMediaKeySystemAccess');\n goog.asserts.assert(this == navigator,\n 'bad \"this\" for requestMediaKeySystemAccess');\n\n // Alias.\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n try {\n var access = new PatchedMediaKeysMs.MediaKeySystemAccess(\n keySystem, supportedConfigurations);\n return Promise.resolve(/** @type {!MediaKeySystemAccess} */ (access));\n } catch (exception) {\n return Promise.reject(exception);\n }\n};\n\n\n\n/**\n * An implementation of MediaKeySystemAccess.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @implements {MediaKeySystemAccess}\n * @throws {Error} if the key system is not supported.\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySystemAccess');\n\n /** @type {string} */\n this.keySystem = keySystem;\n\n /** @private {!MediaKeySystemConfiguration} */\n this.configuration_;\n\n var allowPersistentState = true;\n\n var success = false;\n for (var i = 0; i < supportedConfigurations.length; ++i) {\n var cfg = supportedConfigurations[i];\n\n // Create a new config object and start adding in the pieces which we\n // find support for. We will return this from getConfiguration() if\n // asked.\n /** @type {!MediaKeySystemConfiguration} */\n var newCfg = {\n 'audioCapabilities': [],\n 'videoCapabilities': [],\n // It is technically against spec to return these as optional, but we\n // don't truly know their values from the prefixed API:\n 'persistentState': 'optional',\n 'distinctiveIdentifier': 'optional',\n // Pretend the requested init data types are supported, since we don't\n // really know that either:\n 'initDataTypes': cfg.initDataTypes,\n 'sessionTypes': ['temporary'],\n 'label': cfg.label\n };\n\n // PatchedMediaKeysMs tests for key system availability through\n // MSMediaKeys.isTypeSupported\n var ranAnyTests = false;\n if (cfg.audioCapabilities) {\n for (var j = 0; j < cfg.audioCapabilities.length; ++j) {\n var cap = cfg.audioCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n var contentType = cap.contentType.split(';')[0];\n if (MSMediaKeys.isTypeSupported(this.keySystem, contentType)) {\n newCfg.audioCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n if (cfg.videoCapabilities) {\n for (var j = 0; j < cfg.videoCapabilities.length; ++j) {\n var cap = cfg.videoCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n var contentType = cap.contentType.split(';')[0];\n if (MSMediaKeys.isTypeSupported(this.keySystem, contentType)) {\n newCfg.videoCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n\n if (!ranAnyTests) {\n // If no specific types were requested, we check all common types to find\n // out if the key system is present at all.\n success = MSMediaKeys.isTypeSupported(this.keySystem, 'video/mp4');\n }\n if (cfg.persistentState == 'required') {\n if (allowPersistentState) {\n newCfg.persistentState = 'required';\n newCfg.sessionTypes = ['persistent-license'];\n } else {\n success = false;\n }\n }\n\n if (success) {\n this.configuration_ = newCfg;\n return;\n }\n } // for each cfg in supportedConfigurations\n\n // As per the spec, this should be a DOMException, but\n // there is not a public constructor for this\n var unsupportedKeySystemError = new Error('Unsupported keySystem');\n unsupportedKeySystemError.name = 'NotSupportedError';\n unsupportedKeySystemError.code = DOMException.NOT_SUPPORTED_ERR;\n throw unsupportedKeySystemError;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.\n createMediaKeys = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySystemAccess.createMediaKeys');\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n var mediaKeys = new PatchedMediaKeysMs.MediaKeys(this.keySystem);\n return Promise.resolve(/** @type {!MediaKeys} */ (mediaKeys));\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.\n getConfiguration = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySystemAccess.getConfiguration');\n return this.configuration_;\n};\n\n\n/**\n * An implementation of HTMLMediaElement.prototype.setMediaKeys.\n * Attach a MediaKeys object to the media element.\n *\n * @this {!HTMLMediaElement}\n * @param {MediaKeys} mediaKeys\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysMs.setMediaKeys = function(mediaKeys) {\n shaka.log.debug('PatchedMediaKeysMs.setMediaKeys');\n goog.asserts.assert(this instanceof HTMLMediaElement,\n 'bad \"this\" for setMediaKeys');\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n var newMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysMs.MediaKeys} */ (\n mediaKeys);\n var oldMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysMs.MediaKeys} */ (\n this.mediaKeys);\n\n if (oldMediaKeys && oldMediaKeys != newMediaKeys) {\n goog.asserts.assert(oldMediaKeys instanceof PatchedMediaKeysMs.MediaKeys,\n 'non-polyfill instance of oldMediaKeys');\n // Have the old MediaKeys stop listening to events on the video tag.\n oldMediaKeys.setMedia(null);\n }\n\n delete this['mediaKeys']; // in case there is an existing getter\n this['mediaKeys'] = mediaKeys; // work around read-only declaration\n\n if (newMediaKeys) {\n goog.asserts.assert(newMediaKeys instanceof PatchedMediaKeysMs.MediaKeys,\n 'non-polyfill instance of newMediaKeys');\n return newMediaKeys.setMedia(this);\n }\n\n return Promise.resolve();\n};\n\n\n\n/**\n * An implementation of MediaKeys.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @implements {MediaKeys}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys = function(keySystem) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeys');\n\n /** @private {!MSMediaKeys} */\n this.nativeMediaKeys_ = new MSMediaKeys(keySystem);\n\n /** @private {!shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.\n createSession = function(opt_sessionType) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeys.createSession');\n\n var sessionType = opt_sessionType || 'temporary';\n // For now, only 'temporary' type is supported\n if (sessionType != 'temporary') {\n throw new TypeError('Session type ' + opt_sessionType +\n ' is unsupported on this platform.');\n }\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n return new PatchedMediaKeysMs.MediaKeySession(\n this.nativeMediaKeys_, sessionType);\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.\n setServerCertificate = function(serverCertificate) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeys.setServerCertificate');\n\n // There is no equivalent in PatchedMediaKeysMs, so return failure.\n return Promise.resolve(false);\n};\n\n\n/**\n * @param {HTMLMediaElement} media\n * @protected\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.\n setMedia = function(media) {\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n // Remove any old listeners.\n this.eventManager_.removeAll();\n\n // It is valid for media to be null, it's used to flag that event handlers\n // need to be cleaned up\n if (!media) {\n return Promise.resolve();\n }\n\n // Intercept and translate these prefixed EME events.\n this.eventManager_.listen(media, 'msneedkey',\n /** @type {shaka.util.EventManager.ListenerType} */\n (PatchedMediaKeysMs.onMsNeedKey_));\n\n var self = this;\n function setMediaKeysDeferred() {\n media.msSetMediaKeys(self.nativeMediaKeys_);\n media.removeEventListener('loadedmetadata', setMediaKeysDeferred);\n }\n\n // Wrap native HTMLMediaElement.msSetMediaKeys with Promise\n try {\n // IE11/Edge requires that readyState >=1 before mediaKeys can be set, so\n // check this and wait for loadedmetadata if we are not in the correct state\n if (media.readyState >= 1) {\n media.msSetMediaKeys(this.nativeMediaKeys_);\n } else {\n media.addEventListener('loadedmetadata', setMediaKeysDeferred);\n }\n\n return Promise.resolve();\n\n } catch (exception) {\n return Promise.reject(exception);\n }\n};\n\n\n\n/**\n * An implementation of MediaKeySession.\n *\n * @constructor\n * @struct\n * @param {MSMediaKeys} nativeMediaKeys\n * @param {string} sessionType\n * @implements {MediaKeySession}\n * @extends {shaka.util.FakeEventTarget}\n */\nshaka.polyfill.PatchedMediaKeysMs.\n MediaKeySession = function(nativeMediaKeys, sessionType) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession');\n shaka.util.FakeEventTarget.call(this);\n\n // Native MediaKeySession, which will be created in generateRequest\n /** @private {MSMediaKeySession} */\n this.nativeMediaKeySession_ = null;\n\n /** @private {MSMediaKeys} */\n this.nativeMediaKeys_ = nativeMediaKeys;\n\n // Promises that are resolved later\n /** @private {Promise} */\n this.generateRequestPromise_ = null;\n\n /** @private {Promise} */\n this.updatePromise_ = null;\n\n /** @private {!shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @type {string} */\n this.sessionId = '';\n\n /** @type {number} */\n this.expiration = NaN;\n\n /** @type {!shaka.util.PublicPromise} */\n this.closed = new shaka.util.PublicPromise();\n\n /** @type {!MediaKeyStatusMap} */\n this.keyStatuses =\n new shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap();\n};\ngoog.inherits(shaka.polyfill.PatchedMediaKeysMs.MediaKeySession,\n shaka.util.FakeEventTarget);\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n generateRequest = function(initDataType, initData) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.generateRequest');\n\n this.generateRequestPromise_ = new shaka.util.PublicPromise();\n\n try {\n // This EME spec version requires a MIME content type as the 1st param\n // to createSession, but doesn't seem to matter what the value is.\n\n // NOTE: IE11 takes either Uint8Array or ArrayBuffer, but Edge 12 only\n // accepts Uint8Array.\n this.nativeMediaKeySession_ = this.nativeMediaKeys_\n .createSession('video/mp4', new Uint8Array(initData), null);\n\n // Attach session event handlers here\n this.eventManager_.listen(this.nativeMediaKeySession_, 'mskeymessage',\n /** @type {shaka.util.EventManager.ListenerType} */\n (this.onMsKeyMessage_.bind(this)));\n this.eventManager_.listen(this.nativeMediaKeySession_, 'mskeyadded',\n /** @type {shaka.util.EventManager.ListenerType} */\n (this.onMsKeyAdded_.bind(this)));\n this.eventManager_.listen(this.nativeMediaKeySession_, 'mskeyerror',\n /** @type {shaka.util.EventManager.ListenerType} */\n (this.onMsKeyError_.bind(this)));\n\n this.updateKeyStatus_('status-pending');\n } catch (exception) {\n this.generateRequestPromise_.reject(exception);\n }\n\n return this.generateRequestPromise_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n load = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.load');\n\n return Promise.reject(new Error('MediaKeySession.load not yet supported'));\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n update = function(response) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.update');\n\n this.updatePromise_ = new shaka.util.PublicPromise();\n\n try {\n // Pass through to the native session.\n // NOTE: IE11 takes either Uint8Array or ArrayBuffer, but Edge 12 only\n // accepts Uint8Array.\n this.nativeMediaKeySession_.update(new Uint8Array(response));\n } catch (exception) {\n this.updatePromise_.reject(exception);\n }\n\n return this.updatePromise_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n close = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.close');\n\n try {\n // Pass through to the native session\n // NOTE: IE seems to have spec discrepancy here - v2010218 should have\n // MediaKeySession.release, but actually uses \"close\". The next version\n // of the spec is the initial Promise based one, so it's not the target spec\n // either.\n this.nativeMediaKeySession_.close();\n\n this.closed.resolve();\n this.eventManager_.removeAll();\n } catch (exception) {\n this.closed.reject(exception);\n }\n\n return this.closed;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n remove = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.remove');\n\n return Promise.reject(new Error('MediaKeySession.remove is only ' +\n 'applicable for persistent licenses, which are not supported on ' +\n 'this platform'));\n};\n\n\n/**\n * Handler for the native media elements msNeedKey event.\n *\n * @this {!HTMLMediaElement}\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.onMsNeedKey_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsNeedKey_', event);\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n // NOTE: Because \"this\" is a real EventTarget, on IE, the event we dispatch\n // here must also be a real Event.\n var event2 = /** @type {!CustomEvent} */(document.createEvent('CustomEvent'));\n event2.initCustomEvent('encrypted', false, false, null);\n event2.initDataType = 'cenc';\n event2.initData = PatchedMediaKeysMs.NormaliseInitData_(event.initData);\n\n this.dispatchEvent(event2);\n};\n\n\n/**\n * Normalise the initData array. This is to apply browser specific work-arounds,\n * e.g. removing duplicates which appears to occur intermittently when the\n * native msneedkey event fires (i.e. event.initData contains dupes).\n *\n * @param {?Uint8Array} initData\n * @private\n * @return {?Uint8Array}\n */\nshaka.polyfill.PatchedMediaKeysMs.\n NormaliseInitData_ = function(initData) {\n if (!initData) {\n return initData;\n }\n\n var pssh = new shaka.util.Pssh(initData);\n\n // If there is only a single pssh, return the original array\n if (pssh.dataBoundaries.length <= 1) {\n return initData;\n }\n\n var unfilteredInitDatas = [];\n for (var i = 0; i < pssh.dataBoundaries.length; i++) {\n var currPssh = initData.subarray(\n pssh.dataBoundaries[i].start,\n pssh.dataBoundaries[i].end + 1); // end is exclusive, hence the +1\n\n unfilteredInitDatas.push(currPssh);\n }\n\n // Dedupe psshData\n var dedupedInitDatas = shaka.util.ArrayUtils.removeDuplicates(\n unfilteredInitDatas,\n shaka.polyfill.PatchedMediaKeysMs.compareInitDatas_);\n\n var targetLength = 0;\n for (var i = 0; i < dedupedInitDatas.length; i++) {\n targetLength += dedupedInitDatas[i].length;\n }\n\n // Concat array of Uint8Arrays back into a single Uint8Array\n var normalisedInitData = new Uint8Array(targetLength);\n var offset = 0;\n for (var i = 0; i < dedupedInitDatas.length; i++) {\n normalisedInitData.set(dedupedInitDatas[i], offset);\n offset += dedupedInitDatas[i].length;\n }\n\n return normalisedInitData;\n};\n\n\n/**\n * @param {!Uint8Array} initDataA\n * @param {!Uint8Array} initDataB\n * @return {boolean}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.compareInitDatas_ =\n function(initDataA, initDataB) {\n return shaka.util.Uint8ArrayUtils.equal(initDataA, initDataB);\n};\n\n\n/**\n * Handler for the native keymessage event on MSMediaKeySession.\n *\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n onMsKeyMessage_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsKeyMessage_', event);\n\n // We can now resolve this.generateRequestPromise (it should be non-null)\n goog.asserts.assert(this.generateRequestPromise_,\n 'generateRequestPromise_ not set in onMsKeyMessage_');\n if (this.generateRequestPromise_) {\n this.generateRequestPromise_.resolve();\n this.generateRequestPromise_ = null;\n }\n\n var isNew = this.keyStatuses.getStatus() == undefined;\n\n var event2 = new shaka.util.FakeEvent('message', {\n messageType: isNew ? 'licenserequest' : 'licenserenewal',\n message: event.message.buffer\n });\n\n this.dispatchEvent(event2);\n};\n\n\n/**\n * Handler for the native keyadded event on MSMediaKeySession.\n *\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n onMsKeyAdded_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsKeyAdded_', event);\n\n // PlayReady's concept of persistent licenses makes emulation difficult here.\n // A license policy can say that the license persists, which causes the CDM to\n // store it for use in a later session. The result is that in IE11, the CDM\n // fires 'mskeyadded' without ever firing 'mskeymessage'.\n if (this.generateRequestPromise_) {\n shaka.log.debug('Simulating completion for a PR persistent license.');\n goog.asserts.assert(!this.updatePromise_,\n 'updatePromise_ and generateRequestPromise_ set in onMsKeyAdded_');\n this.updateKeyStatus_('usable');\n this.generateRequestPromise_.resolve();\n this.generateRequestPromise_ = null;\n return;\n }\n\n // We can now resolve this.updatePromise (it should be non-null)\n goog.asserts.assert(this.updatePromise_,\n 'updatePromise_ not set in onMsKeyAdded_');\n if (this.updatePromise_) {\n this.updateKeyStatus_('usable');\n this.updatePromise_.resolve();\n this.updatePromise_ = null;\n }\n};\n\n\n/**\n * Handler for the native keyerror event on MSMediaKeySession.\n *\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n onMsKeyError_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsKeyError_', event);\n\n var error = new Error('EME PatchedMediaKeysMs key error');\n error.errorCode = this.nativeMediaKeySession_.error;\n\n if (this.generateRequestPromise_ != null) {\n this.generateRequestPromise_.reject(error);\n this.generateRequestPromise_ = null;\n } else if (this.updatePromise_ != null) {\n this.updatePromise_.reject(error);\n this.updatePromise_ = null;\n } else {\n /*\n Unexpected error - map native codes to standardised key statuses.\n Possible values of this.nativeMediaKeySession_.error.code\n\n MS_MEDIA_KEYERR_UNKNOWN = 1\n MS_MEDIA_KEYERR_CLIENT = 2\n MS_MEDIA_KEYERR_SERVICE = 3\n MS_MEDIA_KEYERR_OUTPUT = 4\n MS_MEDIA_KEYERR_HARDWARECHANGE = 5\n MS_MEDIA_KEYERR_DOMAIN = 6\n */\n\n switch (this.nativeMediaKeySession_.error.code) {\n case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:\n case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:\n this.updateKeyStatus_('output-not-allowed');\n default:\n this.updateKeyStatus_('internal-error');\n }\n }\n};\n\n\n/**\n * Update key status and dispatch a 'keystatuseschange' event.\n *\n * @param {string} status\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n updateKeyStatus_ = function(status) {\n this.keyStatuses.setStatus(status);\n var event = new shaka.util.FakeEvent('keystatuseschange');\n this.dispatchEvent(event);\n};\n\n\n\n/**\n * An implementation of MediaKeyStatusMap.\n * This fakes a map with a single key ID.\n *\n * @constructor\n * @struct\n * @implements {MediaKeyStatusMap}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap = function() {\n /**\n * @type {number}\n */\n this.size = 0;\n\n /**\n * @private {string|undefined}\n */\n this.status_ = undefined;\n};\n\n\n/**\n * @const {!ArrayBuffer}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_;\n\n\n/**\n * An internal method used by the session to set key status.\n * @param {string|undefined} status\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n setStatus = function(status) {\n this.size = status == undefined ? 0 : 1;\n this.status_ = status;\n};\n\n\n/**\n * An internal method used by the session to get key status.\n * @return {string|undefined}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n getStatus = function() {\n return this.status_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n forEach = function(fn) {\n if (this.status_) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_;\n fn(this.status_, fakeKeyId);\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n get = function(keyId) {\n if (this.has(keyId)) {\n return this.status_;\n }\n return undefined;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n has = function(keyId) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_;\n if (this.status_ &&\n shaka.util.Uint8ArrayUtils.equal(\n new Uint8Array(keyId), new Uint8Array(fakeKeyId))) {\n return true;\n }\n return false;\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n entries = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n keys = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n values = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/patchedmediakeys_ms.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.PatchedMediaKeysNop');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\n\n\n/**\n * Install a polyfill to stub out {@link http://goo.gl/blgtZZ EME draft\n * 12 March 2015} on browsers without EME. All methods will fail.\n */\nshaka.polyfill.PatchedMediaKeysNop.install = function() {\n shaka.log.debug('PatchedMediaKeysNop.install');\n\n // Alias.\n var PatchedMediaKeysNop = shaka.polyfill.PatchedMediaKeysNop;\n\n // Install patches.\n navigator.requestMediaKeySystemAccess =\n PatchedMediaKeysNop.requestMediaKeySystemAccess;\n // Delete mediaKeys to work around strict mode compatibility issues.\n delete HTMLMediaElement.prototype['mediaKeys'];\n // Work around read-only declaration for mediaKeys by using a string.\n HTMLMediaElement.prototype['mediaKeys'] = null;\n HTMLMediaElement.prototype.setMediaKeys = PatchedMediaKeysNop.setMediaKeys;\n // These are not usable, but allow Player.isBrowserSupported to pass.\n window.MediaKeys = PatchedMediaKeysNop.MediaKeys;\n window.MediaKeySystemAccess = PatchedMediaKeysNop.MediaKeySystemAccess;\n};\n\n\n/**\n * An implementation of navigator.requestMediaKeySystemAccess.\n * Retrieve a MediaKeySystemAccess object.\n *\n * @this {!Navigator}\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @return {!Promise.<!MediaKeySystemAccess>}\n */\nshaka.polyfill.PatchedMediaKeysNop.requestMediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysNop.requestMediaKeySystemAccess');\n goog.asserts.assert(this == navigator,\n 'bad \"this\" for requestMediaKeySystemAccess');\n\n\n return Promise.reject(new Error(\n 'The key system specified is not supported.'));\n};\n\n\n/**\n * An implementation of HTMLMediaElement.prototype.setMediaKeys.\n * Attach a MediaKeys object to the media element.\n *\n * @this {!HTMLMediaElement}\n * @param {MediaKeys} mediaKeys\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysNop.setMediaKeys = function(mediaKeys) {\n shaka.log.debug('PatchedMediaKeysNop.setMediaKeys');\n goog.asserts.assert(this instanceof HTMLMediaElement,\n 'bad \"this\" for setMediaKeys');\n\n if (mediaKeys == null) {\n return Promise.resolve();\n }\n\n return Promise.reject(new Error('MediaKeys not supported.'));\n};\n\n\n\n/**\n * An unusable constructor for MediaKeys.\n * @constructor\n * @struct\n * @implements {MediaKeys}\n */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeys = function() {\n throw new TypeError('Illegal constructor.');\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.createSession =\n function() {};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.setServerCertificate =\n function() {};\n\n\n\n/**\n * An unusable constructor for MediaKeySystemAccess.\n * @constructor\n * @struct\n * @implements {MediaKeySystemAccess}\n */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess = function() {\n throw new TypeError('Illegal constructor.');\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.\n getConfiguration = function() {};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.\n createMediaKeys = function() {};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.\n keySystem;\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/patchedmediakeys_nop.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.PatchedMediaKeysWebkit');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * Store api prefix.\n *\n * @private {string}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.prefix_ = '';\n\n\n/**\n * Install a polyfill to implement {@link http://goo.gl/blgtZZ EME draft\n * 12 March 2015} on top of webkit-prefixed\n * {@link http://goo.gl/FSpoAo EME v0.1b}.\n *\n * @param {string} prefix\n */\nshaka.polyfill.PatchedMediaKeysWebkit.install = function(prefix) {\n shaka.log.debug('PatchedMediaKeysWebkit.install');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n PatchedMediaKeysWebkit.prefix_ = prefix;\n var prefixApi = PatchedMediaKeysWebkit.prefixApi_;\n\n goog.asserts.assert(\n HTMLMediaElement.prototype[prefixApi('generateKeyRequest')],\n 'PatchedMediaKeysWebkit APIs not available!');\n\n // Construct fake key ID. This is not done at load-time to avoid exceptions\n // on unsupported browsers. This particular fake key ID was suggested in\n // w3c/encrypted-media#32.\n PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_ =\n (new Uint8Array([0])).buffer;\n\n // Install patches.\n navigator.requestMediaKeySystemAccess =\n PatchedMediaKeysWebkit.requestMediaKeySystemAccess;\n // Delete mediaKeys to work around strict mode compatibility issues.\n delete HTMLMediaElement.prototype['mediaKeys'];\n // Work around read-only declaration for mediaKeys by using a string.\n HTMLMediaElement.prototype['mediaKeys'] = null;\n HTMLMediaElement.prototype.setMediaKeys = PatchedMediaKeysWebkit.setMediaKeys;\n window.MediaKeys = PatchedMediaKeysWebkit.MediaKeys;\n window.MediaKeySystemAccess = PatchedMediaKeysWebkit.MediaKeySystemAccess;\n};\n\n\n/**\n * Prefix api by stored prefix.\n *\n * @param {string} api\n * @return {string}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.prefixApi_ = function(api) {\n var prefix = shaka.polyfill.PatchedMediaKeysWebkit.prefix_;\n if (prefix) {\n return prefix + api.charAt(0).toUpperCase() + api.slice(1);\n }\n return api;\n};\n\n\n/**\n * An implementation of navigator.requestMediaKeySystemAccess.\n * Retrieve a MediaKeySystemAccess object.\n *\n * @this {!Navigator}\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @return {!Promise.<!MediaKeySystemAccess>}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.requestMediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysWebkit.requestMediaKeySystemAccess');\n goog.asserts.assert(this == navigator,\n 'bad \"this\" for requestMediaKeySystemAccess');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n try {\n var access = new PatchedMediaKeysWebkit.MediaKeySystemAccess(\n keySystem, supportedConfigurations);\n return Promise.resolve(/** @type {!MediaKeySystemAccess} */ (access));\n } catch (exception) {\n return Promise.reject(exception);\n }\n};\n\n\n/**\n * An implementation of HTMLMediaElement.prototype.setMediaKeys.\n * Attach a MediaKeys object to the media element.\n *\n * @this {!HTMLMediaElement}\n * @param {MediaKeys} mediaKeys\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.setMediaKeys = function(mediaKeys) {\n shaka.log.debug('PatchedMediaKeysWebkit.setMediaKeys');\n goog.asserts.assert(this instanceof HTMLMediaElement,\n 'bad \"this\" for setMediaKeys');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n\n var newMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys} */ (\n mediaKeys);\n var oldMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys} */ (\n this.mediaKeys);\n\n if (oldMediaKeys && oldMediaKeys != newMediaKeys) {\n goog.asserts.assert(\n oldMediaKeys instanceof PatchedMediaKeysWebkit.MediaKeys,\n 'non-polyfill instance of oldMediaKeys');\n // Have the old MediaKeys stop listening to events on the video tag.\n oldMediaKeys.setMedia(null);\n }\n\n delete this['mediaKeys']; // in case there is an existing getter\n this['mediaKeys'] = mediaKeys; // work around read-only declaration\n\n if (newMediaKeys) {\n goog.asserts.assert(\n newMediaKeys instanceof PatchedMediaKeysWebkit.MediaKeys,\n 'non-polyfill instance of newMediaKeys');\n newMediaKeys.setMedia(this);\n }\n\n return Promise.resolve();\n};\n\n\n/**\n * For some of this polyfill's implementation, we need to query a video element.\n * But for some embedded systems, it is memory-expensive to create multiple\n * video elements. Therefore, we check the document to see if we can borrow one\n * to query before we fall back to creating one temporarily.\n *\n * @return {!HTMLVideoElement}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.getVideoElement_ = function() {\n var videos = document.getElementsByTagName('video');\n var tmpVideo = videos.length ? videos[0] : document.createElement('video');\n return /** @type {!HTMLVideoElement} */(tmpVideo);\n};\n\n\n\n/**\n * An implementation of MediaKeySystemAccess.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @implements {MediaKeySystemAccess}\n * @throws {Error} if the key system is not supported.\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySystemAccess');\n\n /** @type {string} */\n this.keySystem = keySystem;\n\n /** @private {string} */\n this.internalKeySystem_ = keySystem;\n\n /** @private {!MediaKeySystemConfiguration} */\n this.configuration_;\n\n // This is only a guess, since we don't really know from the prefixed API.\n var allowPersistentState = true;\n\n if (keySystem == 'org.w3.clearkey') {\n // ClearKey's string must be prefixed in v0.1b.\n this.internalKeySystem_ = 'webkit-org.w3.clearkey';\n // ClearKey doesn't support persistence.\n allowPersistentState = false;\n }\n\n var success = false;\n var tmpVideo = shaka.polyfill.PatchedMediaKeysWebkit.getVideoElement_();\n for (var i = 0; i < supportedConfigurations.length; ++i) {\n var cfg = supportedConfigurations[i];\n\n // Create a new config object and start adding in the pieces which we\n // find support for. We will return this from getConfiguration() if\n // asked.\n /** @type {!MediaKeySystemConfiguration} */\n var newCfg = {\n 'audioCapabilities': [],\n 'videoCapabilities': [],\n // It is technically against spec to return these as optional, but we\n // don't truly know their values from the prefixed API:\n 'persistentState': 'optional',\n 'distinctiveIdentifier': 'optional',\n // Pretend the requested init data types are supported, since we don't\n // really know that either:\n 'initDataTypes': cfg.initDataTypes,\n 'sessionTypes': ['temporary'],\n 'label': cfg.label\n };\n\n // v0.1b tests for key system availability with an extra argument on\n // canPlayType.\n var ranAnyTests = false;\n if (cfg.audioCapabilities) {\n for (var j = 0; j < cfg.audioCapabilities.length; ++j) {\n var cap = cfg.audioCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n // In Chrome <= 40, if you ask about Widevine-encrypted audio support,\n // you get a false-negative when you specify codec information.\n // Work around this by stripping codec info for audio types.\n var contentType = cap.contentType.split(';')[0];\n if (tmpVideo.canPlayType(contentType, this.internalKeySystem_)) {\n newCfg.audioCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n if (cfg.videoCapabilities) {\n for (var j = 0; j < cfg.videoCapabilities.length; ++j) {\n var cap = cfg.videoCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n if (tmpVideo.canPlayType(cap.contentType, this.internalKeySystem_)) {\n newCfg.videoCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n\n if (!ranAnyTests) {\n // If no specific types were requested, we check all common types to find\n // out if the key system is present at all.\n success = tmpVideo.canPlayType('video/mp4', this.internalKeySystem_) ||\n tmpVideo.canPlayType('video/webm', this.internalKeySystem_);\n }\n if (cfg.persistentState == 'required') {\n if (allowPersistentState) {\n newCfg.persistentState = 'required';\n newCfg.sessionTypes = ['persistent-license'];\n } else {\n success = false;\n }\n }\n\n if (success) {\n this.configuration_ = newCfg;\n return;\n }\n } // for each cfg in supportedConfigurations\n\n var message = 'Unsupported keySystem';\n if (keySystem == 'org.w3.clearkey' || keySystem == 'com.widevine.alpha') {\n message = 'None of the requested configurations were supported.';\n }\n var unsupportedError = new Error(message);\n unsupportedError.name = 'NotSupportedError';\n unsupportedError.code = DOMException.NOT_SUPPORTED_ERR;\n throw unsupportedError;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.\n createMediaKeys = function() {\n shaka.log.debug(\n 'PatchedMediaKeysWebkit.MediaKeySystemAccess.createMediaKeys');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n var mediaKeys = new PatchedMediaKeysWebkit.MediaKeys(this.internalKeySystem_);\n return Promise.resolve(/** @type {!MediaKeys} */ (mediaKeys));\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.\n getConfiguration = function() {\n shaka.log.debug(\n 'PatchedMediaKeysWebkit.MediaKeySystemAccess.getConfiguration');\n return this.configuration_;\n};\n\n\n\n/**\n * An implementation of MediaKeys.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @implements {MediaKeys}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys = function(keySystem) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys');\n\n /** @private {string} */\n this.keySystem_ = keySystem;\n\n /** @private {HTMLMediaElement} */\n this.media_ = null;\n\n /** @private {!shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /**\n * @private {!Array.<!shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession>}\n */\n this.newSessions_ = [];\n\n /**\n * @private {!Object.<string,\n * !shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession>}\n */\n this.sessionMap_ = {};\n};\n\n\n/**\n * @param {HTMLMediaElement} media\n * @protected\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setMedia =\n function(media) {\n this.media_ = media;\n\n // Remove any old listeners.\n this.eventManager_.removeAll();\n\n var prefix = shaka.polyfill.PatchedMediaKeysWebkit.prefix_;\n if (media) {\n // Intercept and translate these prefixed EME events.\n this.eventManager_.listen(media, prefix + 'needkey',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitNeedKey_.bind(this)));\n\n this.eventManager_.listen(media, prefix + 'keymessage',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitKeyMessage_.bind(this)));\n\n this.eventManager_.listen(media, prefix + 'keyadded',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitKeyAdded_.bind(this)));\n\n this.eventManager_.listen(media, prefix + 'keyerror',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitKeyError_.bind(this)));\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.createSession =\n function(opt_sessionType) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.createSession');\n\n var sessionType = opt_sessionType || 'temporary';\n // TODO: Consider adding support for persistent-release once Chrome has\n // implemented it natively. http://crbug.com/448888\n // This is a non-issue if we've deprecated the polyfill by then, since\n // prefixed EME is on its way out.\n if (sessionType != 'temporary' && sessionType != 'persistent-license') {\n throw new TypeError('Session type ' + opt_sessionType +\n ' is unsupported on this platform.');\n }\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n\n // Unprefixed EME allows for session creation without a video tag or src.\n // Prefixed EME requires both a valid HTMLMediaElement and a src.\n var media = this.media_ || /** @type {!HTMLMediaElement} */(\n document.createElement('video'));\n if (!media.src) media.src = 'about:blank';\n\n var session = new PatchedMediaKeysWebkit.MediaKeySession(\n media, this.keySystem_, sessionType);\n this.newSessions_.push(session);\n return session;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setServerCertificate =\n function(serverCertificate) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.setServerCertificate');\n\n // There is no equivalent in v0.1b, so return failure.\n return Promise.resolve(false);\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitNeedKey_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitNeedKey_', event);\n goog.asserts.assert(this.media_, 'media_ not set in onWebkitNeedKey_');\n\n var event2 = document.createEvent('CustomEvent');\n event2.initCustomEvent('encrypted', false, false, null);\n\n // not used by v0.1b EME, but given a valid value\n event2.initDataType = 'webm';\n event2.initData = event.initData;\n\n this.media_.dispatchEvent(event2);\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyMessage_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitKeyMessage_', event);\n\n var session = this.findSession_(event.sessionId);\n if (!session) {\n shaka.log.error('Session not found', event.sessionId);\n return;\n }\n\n var isNew = session.keyStatuses.getStatus() == undefined;\n\n var event2 = new shaka.util.FakeEvent('message', {\n messageType: isNew ? 'licenserequest' : 'licenserenewal',\n message: event.message\n });\n\n session.generated();\n session.dispatchEvent(event2);\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyAdded_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitKeyAdded_', event);\n\n var session = this.findSession_(event.sessionId);\n goog.asserts.assert(session, 'unable to find session in onWebkitKeyAdded_');\n if (session) {\n session.ready();\n }\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyError_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitKeyError_', event);\n\n var session = this.findSession_(event.sessionId);\n goog.asserts.assert(session, 'unable to find session in onWebkitKeyError_');\n if (session) {\n session.handleError(event);\n }\n};\n\n\n/**\n * @param {string} sessionId\n * @return {shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.findSession_ =\n function(sessionId) {\n var session = this.sessionMap_[sessionId];\n if (session) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.findSession_', session);\n return session;\n }\n\n session = this.newSessions_.shift();\n if (session) {\n session.sessionId = sessionId;\n this.sessionMap_[sessionId] = session;\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.findSession_', session);\n return session;\n }\n\n return null;\n};\n\n\n\n/**\n * An implementation of MediaKeySession.\n *\n * @param {!HTMLMediaElement} media\n * @param {string} keySystem\n * @param {string} sessionType\n *\n * @constructor\n * @struct\n * @implements {MediaKeySession}\n * @extends {shaka.util.FakeEventTarget}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession =\n function(media, keySystem, sessionType) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession');\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {!HTMLMediaElement} */\n this.media_ = media;\n\n /** @private {boolean} */\n this.initialized_ = false;\n\n /** @private {shaka.util.PublicPromise} */\n this.generatePromise_ = null;\n\n /** @private {shaka.util.PublicPromise} */\n this.updatePromise_ = null;\n\n /** @private {string} */\n this.keySystem_ = keySystem;\n\n /** @private {string} */\n this.type_ = sessionType;\n\n /** @type {string} */\n this.sessionId = '';\n\n /** @type {number} */\n this.expiration = NaN;\n\n /** @type {!shaka.util.PublicPromise} */\n this.closed = new shaka.util.PublicPromise();\n\n /** @type {!MediaKeyStatusMap} */\n this.keyStatuses =\n new shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap();\n};\ngoog.inherits(shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession,\n shaka.util.FakeEventTarget);\n\n\n/**\n * Signals that the license request has been generated. This resolves the\n * 'generateRequest' promise.\n *\n * @protected\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generated =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.generated');\n\n if (this.generatePromise_) {\n this.generatePromise_.resolve();\n this.generatePromise_ = null;\n }\n};\n\n\n/**\n * Signals that the session is 'ready', which is the terminology used in older\n * versions of EME. The new signal is to resolve the 'update' promise. This\n * translates between the two.\n *\n * @protected\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.ready =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.ready');\n\n this.updateKeyStatus_('usable');\n\n if (this.updatePromise_) {\n this.updatePromise_.resolve();\n }\n this.updatePromise_ = null;\n};\n\n\n/**\n * Either rejects a promise, or dispatches an error event, as appropriate.\n *\n * @param {!MediaKeyEvent} event\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.handleError =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.handleError', event);\n\n // This does not match the DOMException we get in current WD EME, but it will\n // at least provide some information which can be used to look into the\n // problem.\n var error = new Error('EME v0.1b key error');\n error.errorCode = event.errorCode;\n error.errorCode.systemCode = event.systemCode;\n\n // The presence or absence of sessionId indicates whether this corresponds to\n // generateRequest() or update().\n if (!event.sessionId && this.generatePromise_) {\n error.method = 'generateRequest';\n if (event.systemCode == 45) {\n error.message = 'Unsupported session type.';\n }\n this.generatePromise_.reject(error);\n this.generatePromise_ = null;\n } else if (event.sessionId && this.updatePromise_) {\n error.method = 'update';\n this.updatePromise_.reject(error);\n this.updatePromise_ = null;\n } else {\n // This mapping of key statuses is imperfect at best.\n var code = event.errorCode.code;\n var systemCode = event.systemCode;\n if (code == MediaKeyError['MEDIA_KEYERR_OUTPUT']) {\n this.updateKeyStatus_('output-restricted');\n } else if (systemCode == 1) {\n this.updateKeyStatus_('expired');\n } else {\n this.updateKeyStatus_('internal-error');\n }\n }\n};\n\n\n/**\n * Logic which is shared between generateRequest() and load(), both of which\n * are ultimately implemented with webkitGenerateKeyRequest in prefixed EME.\n *\n * @param {?BufferSource} initData\n * @param {?string} offlineSessionId\n * @return {!Promise}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generate_ =\n function(initData, offlineSessionId) {\n if (this.initialized_) {\n return Promise.reject(new Error('The session is already initialized.'));\n }\n\n this.initialized_ = true;\n\n /** @type {!Uint8Array} */\n var mangledInitData;\n\n try {\n if (this.type_ == 'persistent-license') {\n var StringUtils = shaka.util.StringUtils;\n if (!offlineSessionId) {\n // Persisting the initial license.\n // Prefix the init data with a tag to indicate persistence.\n var prefix = StringUtils.toUTF8('PERSISTENT|');\n var result = new Uint8Array(prefix.byteLength + initData.byteLength);\n result.set(new Uint8Array(prefix), 0);\n result.set(new Uint8Array(initData), prefix.byteLength);\n mangledInitData = result;\n } else {\n // Loading a stored license.\n // Prefix the init data (which is really a session ID) with a tag to\n // indicate that we are loading a persisted session.\n mangledInitData = new Uint8Array(\n StringUtils.toUTF8('LOAD_SESSION|' + offlineSessionId));\n }\n } else {\n // Streaming.\n goog.asserts.assert(this.type_ == 'temporary',\n 'expected temporary session');\n goog.asserts.assert(!offlineSessionId,\n 'unexpected offline session ID');\n mangledInitData = new Uint8Array(initData);\n }\n\n goog.asserts.assert(mangledInitData,\n 'init data not set!');\n } catch (exception) {\n return Promise.reject(exception);\n }\n\n goog.asserts.assert(this.generatePromise_ == null,\n 'generatePromise_ should be null');\n this.generatePromise_ = new shaka.util.PublicPromise();\n\n // Because we are hacking media.src in createSession to better emulate\n // unprefixed EME's ability to create sessions and license requests without a\n // video tag, we can get ourselves into trouble. It seems that sometimes,\n // the setting of media.src hasn't been processed by some other thread, and\n // GKR can throw an exception. If this occurs, wait 10 ms and try again at\n // most once. This situation should only occur when init data is available\n // ahead of the 'needkey' event.\n\n var prefixApi = shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_;\n var generateKeyRequestName = prefixApi('generateKeyRequest');\n try {\n this.media_[generateKeyRequestName](this.keySystem_, mangledInitData);\n } catch (exception) {\n if (exception.name != 'InvalidStateError') {\n this.generatePromise_ = null;\n return Promise.reject(exception);\n }\n\n setTimeout(function() {\n try {\n this.media_[generateKeyRequestName](this.keySystem_, mangledInitData);\n } catch (exception) {\n this.generatePromise_.reject(exception);\n this.generatePromise_ = null;\n }\n }.bind(this), 10);\n }\n\n return this.generatePromise_;\n};\n\n\n/**\n * An internal version of update which defers new calls while old ones are in\n * progress.\n *\n * @param {!shaka.util.PublicPromise} promise The promise associated with this\n * call.\n * @param {?BufferSource} response\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update_ =\n function(promise, response) {\n if (this.updatePromise_) {\n // We already have an update in-progress, so defer this one until after the\n // old one is resolved. Execute this whether the original one succeeds or\n // fails.\n this.updatePromise_.then(\n this.update_.bind(this, promise, response)\n ).catch(\n this.update_.bind(this, promise, response)\n );\n return;\n }\n\n this.updatePromise_ = promise;\n\n var key;\n var keyId;\n\n if (this.keySystem_ == 'webkit-org.w3.clearkey') {\n // The current EME version of clearkey wants a structured JSON response.\n // The v0.1b version wants just a raw key. Parse the JSON response and\n // extract the key and key ID.\n var StringUtils = shaka.util.StringUtils;\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n var licenseString = StringUtils.fromUTF8(response);\n var jwkSet = /** @type {JWKSet} */ (JSON.parse(licenseString));\n var kty = jwkSet.keys[0].kty;\n if (kty != 'oct') {\n // Reject the promise.\n var error = new Error('Response is not a valid JSON Web Key Set.');\n this.updatePromise_.reject(error);\n this.updatePromise_ = null;\n }\n key = Uint8ArrayUtils.fromBase64(jwkSet.keys[0].k);\n keyId = Uint8ArrayUtils.fromBase64(jwkSet.keys[0].kid);\n } else {\n // The key ID is not required.\n key = new Uint8Array(response);\n keyId = null;\n }\n\n var prefixApi = shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_;\n var addKeyName = prefixApi('addKey');\n try {\n this.media_[addKeyName](this.keySystem_, key, keyId, this.sessionId);\n } catch (exception) {\n // Reject the promise.\n this.updatePromise_.reject(exception);\n this.updatePromise_ = null;\n }\n};\n\n\n/**\n * Update key status and dispatch a 'keystatuseschange' event.\n *\n * @param {string} status\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.\n updateKeyStatus_ = function(status) {\n this.keyStatuses.setStatus(status);\n var event = new shaka.util.FakeEvent('keystatuseschange');\n this.dispatchEvent(event);\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.\n generateRequest = function(initDataType, initData) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.generateRequest');\n return this.generate_(initData, null);\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.load =\n function(sessionId) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.load');\n if (this.type_ == 'persistent-license') {\n return this.generate_(null, sessionId);\n } else {\n return Promise.reject(new Error('Not a persistent session.'));\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update =\n function(response) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.update', response);\n goog.asserts.assert(this.sessionId, 'update without session ID');\n\n var nextUpdatePromise = new shaka.util.PublicPromise();\n this.update_(nextUpdatePromise, response);\n return nextUpdatePromise;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.close =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.close');\n\n // This will remove a persistent session, but it's also the only way to\n // free CDM resources on v0.1b.\n if (this.type_ != 'persistent-license') {\n // sessionId may reasonably be null if no key request has been generated\n // yet. Unprefixed EME will return a rejected promise in this case.\n // We will use the same error message that Chrome 41 uses in its EME\n // implementation.\n if (!this.sessionId) {\n this.closed.reject(new Error('The session is not callable.'));\n return this.closed;\n }\n\n // This may throw an exception, but we ignore it because we are only using\n // it to clean up resources in v0.1b. We still consider the session closed.\n // We can't let the exception propagate because MediaKeySession.close()\n // should not throw.\n var prefixApi = shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_;\n var cancelKeyRequestName = prefixApi('cancelKeyRequest');\n try {\n this.media_[cancelKeyRequestName](this.keySystem_, this.sessionId);\n } catch (exception) {}\n }\n\n // Resolve the 'closed' promise and return it.\n this.closed.resolve();\n return this.closed;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.remove =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.remove');\n\n if (this.type_ != 'persistent-license') {\n return Promise.reject(new Error('Not a persistent session.'));\n }\n\n return this.close();\n};\n\n\n\n/**\n * An implementation of MediaKeyStatusMap.\n * This fakes a map with a single key ID.\n *\n * @constructor\n * @struct\n * @implements {MediaKeyStatusMap}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap = function() {\n /**\n * @type {number}\n */\n this.size = 0;\n\n /**\n * @private {string|undefined}\n */\n this.status_ = undefined;\n};\n\n\n/**\n * @const {!ArrayBuffer}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_;\n\n\n/**\n * An internal method used by the session to set key status.\n * @param {string|undefined} status\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.setStatus =\n function(status) {\n this.size = status == undefined ? 0 : 1;\n this.status_ = status;\n};\n\n\n/**\n * An internal method used by the session to get key status.\n * @return {string|undefined}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.getStatus =\n function() {\n return this.status_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.forEach =\n function(fn) {\n if (this.status_) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_;\n fn(this.status_, fakeKeyId);\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.get =\n function(keyId) {\n if (this.has(keyId)) {\n return this.status_;\n }\n return undefined;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.has =\n function(keyId) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_;\n if (this.status_ &&\n shaka.util.Uint8ArrayUtils.equal(\n new Uint8Array(keyId), new Uint8Array(fakeKeyId))) {\n return true;\n }\n return false;\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.\n entries = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.\n keys = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.\n values = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/patchedmediakeys_webkit.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.MediaKeys');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.PatchedMediaKeysMs');\ngoog.require('shaka.polyfill.PatchedMediaKeysNop');\ngoog.require('shaka.polyfill.PatchedMediaKeysWebkit');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.MediaKeys\n *\n * @summary A polyfill to unify EME APIs across browser versions.\n *\n * The {@link https://w3c.github.io/encrypted-media/ EME spec} is still a\n * work-in-progress. As such, we need to provide a consistent API to the Shaka\n * Player. Until the spec is completely stable, the API provided by this\n * polyfill may lag behind the latest spec developments.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.MediaKeys.install = function() {\n shaka.log.debug('MediaKeys.install');\n\n if (!window.HTMLVideoElement) {\n // Avoid errors on very old browsers.\n return;\n }\n\n if (navigator.requestMediaKeySystemAccess &&\n MediaKeySystemAccess.prototype.getConfiguration) {\n shaka.log.info('Using native EME as-is.');\n } else if (HTMLMediaElement.prototype.webkitGenerateKeyRequest) {\n shaka.log.info('Using webkit-prefixed EME v0.1b');\n shaka.polyfill.PatchedMediaKeysWebkit.install('webkit');\n } else if (HTMLMediaElement.prototype.generateKeyRequest) {\n shaka.log.info('Using nonprefixed EME v0.1b');\n shaka.polyfill.PatchedMediaKeysWebkit.install('');\n } else if (window.MSMediaKeys) {\n shaka.log.info('Using ms-prefixed EME v20140218');\n shaka.polyfill.PatchedMediaKeysMs.install();\n } else {\n shaka.log.info('EME not available.');\n shaka.polyfill.PatchedMediaKeysNop.install();\n }\n};\n\n\nshaka.polyfill.register(shaka.polyfill.MediaKeys.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/mediakeys.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.MediaSource');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.MediaSource\n *\n * @summary A polyfill to patch MSE bugs.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.MediaSource.install = function() {\n shaka.log.debug('MediaSource.install');\n\n if (!window.MediaSource) {\n shaka.log.info('No MSE implementation available.');\n return;\n }\n\n // Detection is complicated by the fact that Safari does not expose\n // SourceBuffer on window. So we can't detect missing features by accessing\n // SourceBuffer.prototype. That is why we use navigator to detect Safari and\n // particular versions of it.\n var vendor = navigator.vendor;\n var version = navigator.appVersion;\n if (!vendor || !version || vendor.indexOf('Apple') < 0) {\n shaka.log.info('Using native MSE as-is.');\n return;\n }\n\n if (version.indexOf('Version/8') >= 0) {\n // Safari 8 does not implement appendWindowEnd. If we ignore the\n // incomplete MSE implementation, some content (especially multi-period)\n // will fail to play correctly. The best we can do is blacklist Safari 8.\n shaka.log.info('Blacklisting Safari 8 MSE.');\n shaka.polyfill.MediaSource.blacklist_();\n } else if (version.indexOf('Version/9') >= 0) {\n shaka.log.info('Patching Safari 9 MSE bugs.');\n // Safari 9 does not correctly implement abort() on SourceBuffer.\n // Calling abort() causes a decoder failure, rather than resetting the\n // decode timestamp as called for by the spec.\n // Bug filed: http://goo.gl/UZ2rPp\n shaka.polyfill.MediaSource.stubAbort_();\n } else if (version.indexOf('Version/10') >= 0) {\n shaka.log.info('Patching Safari 10 MSE bugs.');\n // Safari 10 does not correctly implement abort() on SourceBuffer.\n // Calling abort() before appending a segment causes that segment to be\n // incomplete in buffer.\n // Bug filed: https://goo.gl/rC3CLj\n shaka.polyfill.MediaSource.stubAbort_();\n // Safari 10 fires spurious 'updateend' events after endOfStream().\n // Bug filed: https://goo.gl/qCeTZr\n shaka.polyfill.MediaSource.patchEndOfStreamEvents_();\n } else {\n shaka.log.info('Using native MSE as-is.');\n }\n};\n\n\n/**\n * Blacklist the current browser by making MediaSourceEngine.isBrowserSupported\n * fail later.\n *\n * @private\n */\nshaka.polyfill.MediaSource.blacklist_ = function() {\n window['MediaSource'] = null;\n};\n\n\n/**\n * Stub out abort(). On some buggy MSE implementations, calling abort() causes\n * various problems.\n *\n * @private\n */\nshaka.polyfill.MediaSource.stubAbort_ = function() {\n var addSourceBuffer = MediaSource.prototype.addSourceBuffer;\n MediaSource.prototype.addSourceBuffer = function() {\n var sourceBuffer = addSourceBuffer.apply(this, arguments);\n sourceBuffer.abort = function() {}; // Stub out for buggy implementations.\n return sourceBuffer;\n };\n};\n\n\n/**\n * Patch endOfStream() to get rid of 'updateend' events that should not fire.\n * These extra events confuse MediaSourceEngine, which relies on correct events\n * to manage SourceBuffer state.\n *\n * @private\n */\nshaka.polyfill.MediaSource.patchEndOfStreamEvents_ = function() {\n var endOfStream = MediaSource.prototype.endOfStream;\n MediaSource.prototype.endOfStream = function() {\n // This bug manifests only when endOfStream() results in the truncation\n // of the MediaSource's duration. So first we must calculate what the\n // new duration will be.\n var newDuration = 0;\n for (var i = 0; i < this.sourceBuffers.length; ++i) {\n var buffer = this.sourceBuffers[i];\n var bufferEnd = buffer.buffered.end(buffer.buffered.length - 1);\n newDuration = Math.max(newDuration, bufferEnd);\n }\n\n // If the duration is going to be reduced, suppress the next 'updateend'\n // event on each SourceBuffer.\n if (!isNaN(this.duration) &&\n newDuration < this.duration) {\n this.ignoreUpdateEnd_ = true;\n for (var i = 0; i < this.sourceBuffers.length; ++i) {\n var buffer = this.sourceBuffers[i];\n buffer.eventSuppressed_ = false;\n }\n }\n\n return endOfStream.apply(this, arguments);\n };\n\n var addSourceBuffer = MediaSource.prototype.addSourceBuffer;\n MediaSource.prototype.addSourceBuffer = function() {\n // After adding a new source buffer, add an event listener to allow us to\n // suppress events.\n var sourceBuffer = addSourceBuffer.apply(this, arguments);\n sourceBuffer.mediaSource_ = this;\n sourceBuffer.addEventListener('updateend',\n shaka.polyfill.MediaSource.ignoreUpdateEnd_, false);\n\n if (!this.cleanUpHandlerInstalled_) {\n // If we haven't already, install an event listener to allow us to clean\n // up listeners when MediaSource is torn down.\n this.addEventListener('sourceclose',\n shaka.polyfill.MediaSource.cleanUpListeners_, false);\n this.cleanUpHandlerInstalled_ = true;\n }\n return sourceBuffer;\n };\n};\n\n\n/**\n * An event listener for 'updateend' which selectively suppresses the events.\n *\n * @see shaka.polyfill.MediaSource.patchEndOfStreamEvents_\n *\n * @param {Event} event\n * @private\n */\nshaka.polyfill.MediaSource.ignoreUpdateEnd_ = function(event) {\n var sourceBuffer = event.target;\n var mediaSource = sourceBuffer.mediaSource_;\n\n if (mediaSource.ignoreUpdateEnd_) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n sourceBuffer.eventSuppressed_ = true;\n\n for (var i = 0; i < mediaSource.sourceBuffers.length; ++i) {\n var buffer = mediaSource.sourceBuffers[i];\n if (buffer.eventSuppressed_ == false) {\n // More events need to be suppressed.\n return;\n }\n }\n\n // All events have been suppressed, all buffers are out of 'updating'\n // mode. Stop suppressing events.\n mediaSource.ignoreUpdateEnd_ = false;\n }\n};\n\n\n/**\n * An event listener for 'sourceclose' which cleans up listeners for 'updateend'\n * to avoid memory leaks.\n *\n * @see shaka.polyfill.MediaSource.patchEndOfStreamEvents_\n * @see shaka.polyfill.MediaSource.ignoreUpdateEnd_\n *\n * @param {Event} event\n * @private\n */\nshaka.polyfill.MediaSource.cleanUpListeners_ = function(event) {\n var mediaSource = event.target;\n for (var i = 0; i < mediaSource.sourceBuffers.length; ++i) {\n var buffer = mediaSource.sourceBuffers[i];\n buffer.removeEventListener('updateend',\n shaka.polyfill.MediaSource.ignoreUpdateEnd_, false);\n }\n mediaSource.removeEventListener('sourceclose',\n shaka.polyfill.MediaSource.cleanUpListeners_, false);\n};\n\n\nshaka.polyfill.register(shaka.polyfill.MediaSource.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/mediasource.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.Promise');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n\n/**\n * @summary A polyfill to implement Promises, primarily for IE.\n * Only partially supports thenables, but otherwise passes the A+ conformance\n * tests.\n * Note that Promise.all() and Promise.race() are not tested by that suite.\n *\n * @constructor\n * @struct\n * @param {function(function(*), function(*))=} opt_callback\n * @template T\n */\nshaka.polyfill.Promise = function(opt_callback) {\n /** @private {!Array.<shaka.polyfill.Promise.Child>} */\n this.thens_ = [];\n\n /** @private {!Array.<shaka.polyfill.Promise.Child>} */\n this.catches_ = [];\n\n /** @private {shaka.polyfill.Promise.State} */\n this.state_ = shaka.polyfill.Promise.State.PENDING;\n\n /** @private {*} */\n this.value_;\n\n // External callers must supply the callback. Internally, we may construct\n // child Promises without it, since we can directly access their resolve_ and\n // reject_ methods when convenient.\n if (opt_callback) {\n try {\n opt_callback(this.resolve_.bind(this), this.reject_.bind(this));\n } catch (e) {\n this.reject_(e);\n }\n }\n};\n\n\n/**\n * @typedef {{\n * promise: !shaka.polyfill.Promise,\n * callback: (function(*)|undefined)\n * }}\n *\n * @summary A child promise, used for chaining.\n * @description\n * Only exists in the context of a then or catch chain.\n * @property {!shaka.polyfill.Promise} promise\n * The child promise.\n * @property {(function(*)|undefined)} callback\n * The then or catch callback to be invoked as part of this chain.\n */\nshaka.polyfill.Promise.Child;\n\n\n/**\n * @enum {number}\n */\nshaka.polyfill.Promise.State = {\n PENDING: 0,\n RESOLVED: 1,\n REJECTED: 2\n};\n\n\n/**\n * Install the polyfill if needed.\n * @param {boolean=} opt_force If true, force the polyfill to be installed.\n * Used in some unit tests.\n */\nshaka.polyfill.Promise.install = function(opt_force) {\n // Decide on the best way to invoke a callback as soon as possible.\n // Precompute the setImmediate/clearImmediate convenience methods to avoid the\n // overhead of this switch every time a callback has to be invoked.\n if (window.setImmediate) {\n // For IE and node.js:\n shaka.polyfill.Promise.setImmediate_ = function(callback) {\n return window.setImmediate(callback);\n };\n shaka.polyfill.Promise.clearImmediate_ = function(id) {\n return window.clearImmediate(id);\n };\n } else {\n // For everyone else:\n shaka.polyfill.Promise.setImmediate_ = function(callback) {\n return window.setTimeout(callback, 0);\n };\n shaka.polyfill.Promise.clearImmediate_ = function(id) {\n return window.clearTimeout(id);\n };\n }\n\n if (window.Promise && !opt_force) {\n shaka.log.info('Using native Promises.');\n return;\n }\n\n shaka.log.info('Using Promises polyfill.');\n // Quoted to work around type-checking, since our then() signature doesn't\n // exactly match that of a native Promise.\n window['Promise'] = shaka.polyfill.Promise;\n\n // Explicitly installed because the compiler won't necessarily attach them\n // to the compiled constructor. Exporting them will only attach them to\n // their original namespace, which isn't the same as attaching them to the\n // constructor unless you also export the constructor.\n window['Promise'].resolve = shaka.polyfill.Promise.resolve;\n window['Promise'].reject = shaka.polyfill.Promise.reject;\n window['Promise'].all = shaka.polyfill.Promise.all;\n window['Promise'].race = shaka.polyfill.Promise.race;\n\n // These are manually exported as well, because allowing the compiler to\n // export them for us will cause the polyfill to end up in our generated\n // externs. Since nobody should be accessing this directly using the\n // shaka.polyfill namespace, it is okay not to @export these methods.\n window['Promise']['prototype']['then'] =\n shaka.polyfill.Promise.prototype.then;\n window['Promise']['prototype']['catch'] =\n shaka.polyfill.Promise.prototype.catch;\n};\n\n\n/**\n * Uninstall the polyfill. Used in some unit tests.\n */\nshaka.polyfill.Promise.uninstall = function() {\n // Do nothing if there is no native implementation.\n if (shaka.polyfill.Promise.nativePromise_) {\n shaka.log.info('Removing Promise polyfill.');\n window['Promise'] = shaka.polyfill.Promise.nativePromise_;\n shaka.polyfill.Promise.q_ = [];\n }\n};\n\n\n/**\n * @param {*} value\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.resolve = function(value) {\n var p = new shaka.polyfill.Promise();\n p.resolve_(undefined);\n return p.then(function() {\n return value;\n });\n};\n\n\n/**\n * @param {*} reason\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.reject = function(reason) {\n var p = new shaka.polyfill.Promise();\n p.reject_(reason);\n return p;\n};\n\n\n/**\n * @param {!Array.<!shaka.polyfill.Promise>} others\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.all = function(others) {\n var p = new shaka.polyfill.Promise();\n if (!others.length) {\n p.resolve_([]);\n return p;\n }\n\n // The array of results must be in the same order as the array of Promises\n // passed to all(). So we pre-allocate the array and keep a count of how\n // many have resolved. Only when all have resolved is the returned Promise\n // itself resolved.\n var count = 0;\n var values = new Array(others.length);\n var resolve = function(p, i, newValue) {\n goog.asserts.assert(p.state_ != shaka.polyfill.Promise.State.RESOLVED,\n 'Invalid Promise state in Promise.all');\n // If one of the Promises in the array was rejected, this Promise was\n // rejected and new values are ignored. In such a case, the values array\n // and its contents continue to be alive in memory until all of the Promises\n // in the array have completed.\n if (p.state_ == shaka.polyfill.Promise.State.PENDING) {\n values[i] = newValue;\n count++;\n if (count == values.length) {\n p.resolve_(values);\n }\n }\n };\n\n var reject = p.reject_.bind(p);\n for (var i = 0; i < others.length; ++i) {\n if (others[i] && others[i].then) {\n others[i].then(resolve.bind(null, p, i), reject);\n } else {\n resolve(p, i, others[i]);\n }\n }\n return p;\n};\n\n\n/**\n * @param {!Array.<!shaka.polyfill.Promise>} others\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.race = function(others) {\n var p = new shaka.polyfill.Promise();\n\n // The returned Promise is resolved or rejected as soon as one of the others\n // is.\n var resolve = p.resolve_.bind(p);\n var reject = p.reject_.bind(p);\n for (var i = 0; i < others.length; ++i) {\n if (others[i] && others[i].then) {\n others[i].then(resolve, reject);\n } else {\n resolve(others[i]);\n }\n }\n return p;\n};\n\n\n/**\n * @param {function(*)=} opt_successCallback\n * @param {function(*)=} opt_failCallback\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.prototype.then = function(opt_successCallback,\n opt_failCallback) {\n // then() returns a child Promise which is chained onto this one.\n var child = new shaka.polyfill.Promise();\n switch (this.state_) {\n case shaka.polyfill.Promise.State.RESOLVED:\n // This is already resolved, so we can chain to the child ASAP.\n this.schedule_(child, opt_successCallback);\n break;\n case shaka.polyfill.Promise.State.REJECTED:\n // This is already rejected, so we can chain to the child ASAP.\n this.schedule_(child, opt_failCallback);\n break;\n case shaka.polyfill.Promise.State.PENDING:\n // This is pending, so we have to track both callbacks and the child\n // in order to chain later.\n this.thens_.push({ promise: child, callback: opt_successCallback});\n this.catches_.push({ promise: child, callback: opt_failCallback});\n break;\n }\n\n return child;\n};\n\n\n/**\n * @param {function(*)=} opt_callback\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.prototype.catch = function(opt_callback) {\n // Devolves into a two-argument call to 'then'.\n return this.then(undefined, opt_callback);\n};\n\n\n/**\n * @param {*} value\n * @private\n */\nshaka.polyfill.Promise.prototype.resolve_ = function(value) {\n // Ignore resolve calls if we aren't still pending.\n if (this.state_ == shaka.polyfill.Promise.State.PENDING) {\n this.value_ = value;\n this.state_ = shaka.polyfill.Promise.State.RESOLVED;\n // Schedule calls to all of the chained callbacks.\n for (var i = 0; i < this.thens_.length; ++i) {\n this.schedule_(this.thens_[i].promise, this.thens_[i].callback);\n }\n this.thens_ = [];\n this.catches_ = [];\n }\n};\n\n\n/**\n * @param {*} reason\n * @private\n */\nshaka.polyfill.Promise.prototype.reject_ = function(reason) {\n // Ignore reject calls if we aren't still pending.\n if (this.state_ == shaka.polyfill.Promise.State.PENDING) {\n this.value_ = reason;\n this.state_ = shaka.polyfill.Promise.State.REJECTED;\n // Schedule calls to all of the chained callbacks.\n for (var i = 0; i < this.catches_.length; ++i) {\n this.schedule_(this.catches_[i].promise, this.catches_[i].callback);\n }\n this.thens_ = [];\n this.catches_ = [];\n }\n};\n\n\n/**\n * @param {!shaka.polyfill.Promise} child\n * @param {function(*)|undefined} callback\n * @private\n */\nshaka.polyfill.Promise.prototype.schedule_ = function(child, callback) {\n goog.asserts.assert(this.state_ != shaka.polyfill.Promise.State.PENDING,\n 'Invalid Promise state in Promise.schedule_');\n var Promise = shaka.polyfill.Promise;\n\n var wrapper = function() {\n if (callback && typeof callback == 'function') {\n // Wrap around the callback. Exceptions thrown by the callback are\n // converted to failures.\n try {\n var value = callback(this.value_);\n } catch (exception) {\n child.reject_(exception);\n return;\n }\n\n // According to the spec, 'then' in a thenable may only be accessed once\n // and any thrown exceptions in the getter must cause the Promise chain\n // to fail.\n var then;\n try {\n then = value && value.then;\n } catch (exception) {\n child.reject_(exception);\n return;\n }\n\n if (value instanceof Promise) {\n // If the returned value is a Promise, we bind it's state to the child.\n if (value == child) {\n // Without this, a bad calling pattern can cause an infinite loop.\n child.reject_(new TypeError('Chaining cycle detected'));\n } else {\n value.then(child.resolve_.bind(child), child.reject_.bind(child));\n }\n } else if (then) {\n // If the returned value is thenable, chain it to the child.\n Promise.handleThenable_(value, then, child);\n } else {\n // If the returned value is not a Promise, the child is resolved with\n // that value.\n child.resolve_(value);\n }\n } else if (this.state_ == Promise.State.RESOLVED) {\n // No callback for this state, so just chain on down the line.\n child.resolve_(this.value_);\n } else {\n // No callback for this state, so just chain on down the line.\n child.reject_(this.value_);\n }\n };\n\n // Enqueue a call to the wrapper.\n Promise.q_.push(wrapper.bind(this));\n if (Promise.flushTimer_ == null) {\n Promise.flushTimer_ = Promise.setImmediate_(Promise.flush);\n }\n};\n\n\n/**\n * @param {!Object} thenable\n * @param {Function} then\n * @param {!shaka.polyfill.Promise} child\n * @private\n */\nshaka.polyfill.Promise.handleThenable_ = function(thenable, then, child) {\n var Promise = shaka.polyfill.Promise;\n try {\n var sealed = false;\n then.call(thenable, function(value) {\n if (sealed) return;\n sealed = true;\n\n var nextThen;\n try {\n nextThen = value && value.then;\n } catch (exception) {\n child.reject_(exception);\n return;\n }\n\n if (nextThen) {\n Promise.handleThenable_(value, nextThen, child);\n } else {\n child.resolve_(value);\n }\n }, child.reject_.bind(child));\n } catch (exception) {\n child.reject_(exception);\n }\n};\n\n\n/**\n * Flush the queue of callbacks.\n * Used directly by some unit tests.\n */\nshaka.polyfill.Promise.flush = function() {\n var Promise = shaka.polyfill.Promise;\n\n // Flush as long as we have callbacks. This means we can finish a chain more\n // quickly, since we avoid the overhead of multiple calls to setTimeout, each\n // of which has a minimum resolution of as much as 15ms on IE11.\n // This helps to fix the out-of-order task bug on IE:\n // https://github.com/google/shaka-player/issues/251#issuecomment-178146242\n while (Promise.q_.length) {\n // Callbacks may enqueue other callbacks, so clear the timer ID and swap the\n // queue before we do anything else.\n if (Promise.flushTimer_ != null) {\n Promise.clearImmediate_(Promise.flushTimer_);\n Promise.flushTimer_ = null;\n }\n var q = Promise.q_;\n Promise.q_ = [];\n\n for (var i = 0; i < q.length; ++i) {\n q[i]();\n }\n }\n};\n\n\n/**\n * @param {function()} callback\n * @return {number}\n * Schedule a callback as soon as possible.\n * Bound in shaka.polyfill.Promise.install() to a specific implementation.\n * @private\n */\nshaka.polyfill.Promise.setImmediate_ = function(callback) { return 0; };\n\n\n/**\n * @param {number} id\n * Clear a scheduled callback.\n * Bound in shaka.polyfill.Promise.install() to a specific implementation.\n * @private\n */\nshaka.polyfill.Promise.clearImmediate_ = function(id) {};\n\n\n/**\n * A timer ID to flush the queue.\n * @private {?number}\n */\nshaka.polyfill.Promise.flushTimer_ = null;\n\n\n/**\n * A queue of callbacks to be invoked ASAP in the next frame.\n * @private {!Array.<function()>}\n */\nshaka.polyfill.Promise.q_ = [];\n\n\n/** @private {?} */\nshaka.polyfill.Promise.nativePromise_ = window.Promise;\n\n\nshaka.polyfill.register(shaka.polyfill.Promise.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/promise.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.VideoPlayPromise');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.VideoPlayPromise\n *\n * @summary A polyfill to silence the play() Promise in HTML5 video.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.VideoPlayPromise.install = function() {\n shaka.log.debug('VideoPlayPromise.install');\n\n if (window.HTMLMediaElement) {\n var originalPlay = HTMLMediaElement.prototype.play;\n HTMLMediaElement.prototype.play = function() {\n var p = originalPlay.apply(this, arguments);\n if (p) {\n // This browser is returning a Promise from play().\n // If the play() call fails or is interrupted, the Promise will be\n // rejected. Some apps, however, don't listen to this Promise,\n // especially since it is not available cross-browser. If the Promise\n // is rejected without anyone listening for the failure, an error will\n // appear in the JS console.\n // To avoid confusion over this innocuous \"error\", we will install a\n // catch handler on the Promise. This does not prevent the app from\n // also catching failures and handling them. It only prevents the\n // console message.\n p.catch(function() {});\n }\n return p;\n };\n }\n};\n\nshaka.polyfill.register(shaka.polyfill.VideoPlayPromise.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/video_play_promise.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.VideoPlaybackQuality');\n\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.VideoPlaybackQuality\n *\n * @summary A polyfill to provide MSE VideoPlaybackQuality metrics.\n * Many browsers do not yet provide this API, and Chrome currently provides\n * similar data through individual prefixed attributes on HTMLVideoElement.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.VideoPlaybackQuality.install = function() {\n if (!window.HTMLVideoElement) {\n // Avoid errors on very old browsers.\n return;\n }\n\n var proto = HTMLVideoElement.prototype;\n if (proto.getVideoPlaybackQuality) {\n // No polyfill needed.\n return;\n }\n\n if ('webkitDroppedFrameCount' in proto) {\n proto.getVideoPlaybackQuality =\n shaka.polyfill.VideoPlaybackQuality.webkit_;\n }\n};\n\n\n/**\n * @this {HTMLVideoElement}\n * @return {!VideoPlaybackQuality}\n * @private\n */\nshaka.polyfill.VideoPlaybackQuality.webkit_ = function() {\n return {\n 'droppedVideoFrames': this.webkitDroppedFrameCount,\n 'totalVideoFrames': this.webkitDecodedFrameCount,\n // Not provided by this polyfill:\n 'corruptedVideoFrames': 0,\n 'creationTime': NaN,\n 'totalFrameDelay': 0\n };\n};\n\n\nshaka.polyfill.register(shaka.polyfill.VideoPlaybackQuality.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/videoplaybackquality.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.VTTCue');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.VTTCue\n *\n * @summary A polyfill to provide VTTCue.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.VTTCue.install = function() {\n if (window.VTTCue) {\n shaka.log.info('Using native VTTCue.');\n return;\n }\n\n if (!window.TextTrackCue) {\n shaka.log.error('VTTCue not available.');\n return;\n }\n\n var constructorLength = TextTrackCue.length;\n if (constructorLength == 3) {\n shaka.log.info('Using VTTCue polyfill from 3 argument TextTrackCue.');\n window.VTTCue = shaka.polyfill.VTTCue.from3ArgsTextTrackCue_;\n } else if (constructorLength == 6) {\n shaka.log.info('Using VTTCue polyfill from 6 argument TextTrackCue.');\n window.VTTCue = shaka.polyfill.VTTCue.from6ArgsTextTrackCue_;\n } else if (shaka.polyfill.VTTCue.canUse3ArgsTextTrackCue_()) {\n shaka.log.info('Using VTTCue polyfill from 3 argument TextTrackCue.');\n window.VTTCue = shaka.polyfill.VTTCue.from3ArgsTextTrackCue_;\n }\n};\n\n\n/**\n * Draft spec TextTrackCue with 3 constructor arguments.\n * See {@link https://goo.gl/ZXBWZi W3C Working Draft 25 October 2012}.\n *\n * @param {number} startTime\n * @param {number} endTime\n * @param {string} text\n * @return {TextTrackCue}\n * @private\n */\nshaka.polyfill.VTTCue.from3ArgsTextTrackCue_ = function(startTime, endTime,\n text) {\n return new window.TextTrackCue(startTime, endTime, text);\n};\n\n\n/**\n * Draft spec TextTrackCue with 6 constructor arguments (5th & 6th are\n * optional).\n * See {@link https://goo.gl/AYFqUh W3C Working Draft 29 March 2012}.\n * Quoting the access to the TextTrackCue object to avoid the compiler\n * complaining.\n *\n * @param {number} startTime\n * @param {number} endTime\n * @param {string} text\n * @return {TextTrackCue}\n * @private\n */\nshaka.polyfill.VTTCue.from6ArgsTextTrackCue_ = function(startTime, endTime,\n text) {\n var id = startTime + '-' + endTime + '-' + text;\n return new window['TextTrackCue'](id, startTime, endTime, text);\n};\n\n\n/**\n * IE10, IE11 and Edge returns TextTrackCue.length = 0 although it accepts 3\n * constructor arguments.\n *\n * @return {boolean}\n * @private\n */\nshaka.polyfill.VTTCue.canUse3ArgsTextTrackCue_ = function() {\n try {\n return !!shaka.polyfill.VTTCue.from3ArgsTextTrackCue_(1, 2, '');\n } catch (error) {\n return false;\n }\n};\n\n\nshaka.polyfill.register(shaka.polyfill.VTTCue.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/vttcue.js","//@flow\nimport * as Playkit from 'playkit-js';\nimport OvpProvider from 'playkit-js-providers/dist/ovpProvider';\nimport handleSessionId from './session-id'\n\n/**\n *\n * @param {Object} config - contains partnerId and entryID\n * @return {Promise<*>} - player promise\n */\nexport default function setup(config: Object): Promise<*> {\n let player = Playkit.playkit();\n player.addEventListener(player.Event.SOURCE_SELECTED, (event) => {\n handleSessionId(event.payload.selectedSource, player);\n });\n if (config) {\n let provider = new OvpProvider(config.partnerId);\n return provider.getConfig(config.entryID)\n .then(data => {\n player.configure(data);\n return Promise.resolve(player);\n }).catch(error => {\n return Promise.reject(error);\n });\n } else {\n return Promise.resolve(player);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./setup.js","//@flow\n/**\n * @return {string} - GUID\n * @private\n */\nfunction _generateGUID(): string {\n let S4 = () => {\n return (((1+Math.random())*0x10000)|0).toString(16).substring(1);\n };\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n}\n\n/**\n * @param {Object} selectedSource - selected source\n * @param {Player} player - player\n * @return {void}\n * @private\n */\nfunction _addSessionId(selectedSource: Object, player: Player): void {\n let delimiter = selectedSource.url.indexOf('?') === -1 ? '?' : '&';\n let primaryGUID = _generateGUID();\n let secondGUID = _generateGUID();\n let sessionId = primaryGUID + ':' + secondGUID;\n selectedSource.url += delimiter + 'playSessionId=' + sessionId;\n player.sessionId = sessionId;\n}\n\n/**\n * @param {Object} selectedSource - selected source\n * @param {string} sessionId - session id\n * @param {Player} player - player\n * @return {void}\n * @private\n */\nfunction _replaceSecondGUID(selectedSource: Object, sessionId: string, player: Player): void {\n let secondGUIDRegex = /:((?:[a-z0-9]|-)*)/i;\n let secondGUID = secondGUIDRegex.exec(sessionId);\n if (secondGUID && secondGUID[1]) {\n let newSessionId = sessionId.replace(secondGUID[1], _generateGUID());\n selectedSource.url = selectedSource.url.replace(sessionId, newSessionId);\n player.sessionId = newSessionId;\n }\n}\n\n/**\n * @param {Object} selectedSource - selected source\n * @param {Player} player - player\n * @return {void}\n * @public\n */\nfunction handleSessionId(selectedSource: Object = {}, player: Player): void {\n if (typeof selectedSource.url === 'string' && selectedSource.url.toLowerCase().indexOf('playmanifest/') !== -1) {\n let sessionIdRegex = /playSessionId=((?:[a-z0-9]|-|:)*)/i;\n let sessionId = sessionIdRegex.exec(selectedSource.url);\n if (sessionId && sessionId[1]) {\n _replaceSecondGUID(selectedSource, sessionId[1], player);\n } else {\n _addSessionId(selectedSource, player);\n }\n }\n}\n\nexport default handleSessionId\n\n\n\n// WEBPACK FOOTER //\n// ./session-id.js"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/kaltura-player.min.js b/dist/kaltura-player.min.js index f73c29a1d..a0db8e3d2 100644 --- a/dist/kaltura-player.min.js +++ b/dist/kaltura-player.min.js @@ -1,17 +1,17 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("KalturaPlayer",[],t):"object"==typeof exports?exports.KalturaPlayer=t():e.KalturaPlayer=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t,n){!function(t,n){e.exports=n()}(0,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=21)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,e),this._id=t.id,this._active=t.active,this._label=t.label,this._language=t.language,this._index=t.index}return i(e,[{key:"id",get:function(){return this._id}},{key:"active",get:function(){return this._active},set:function(e){this._active=e}},{key:"label",get:function(){return this._label}},{key:"language",get:function(){return this._language}},{key:"index",get:function(){return this._index}}]),e}();t.default=a},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.LOG_LEVEL=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(25),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),s={DEBUG:o.DEBUG,INFO:o.INFO,TIME:o.TIME,WARN:o.WARN,ERROR:o.ERROR,OFF:o.OFF},u=function(){function e(t){r(this,e),o.useDefaults(t||{})}return i(e,[{key:"getLogger",value:function(e){return e?o.get(e):o}}]),e}(),l=new u({defaultLevel:o.DEBUG});t.default=l,t.LOG_LEVEL=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n){r(this,e),this.bubbles=!1,this.cancelable=!1,this.defaultPrevented=!1,this.timeStamp=window.performance?window.performance.now():Date.now(),this.type=t,this.isTrusted=!1,this.currentTarget=null,this.target=null,this.stopped=!1,this.payload=n}return i(e,[{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.stopped=!0}},{key:"stopPropagation",value:function(){}}]),e}();t.default=a},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(s.default);t.default=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._kind=e.kind,n}return a(t,e),o(t,[{key:"kind",get:function(){return this._kind}}]),t}(u.default);t.default=l},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._bandwidth=e.bandwidth,n}return a(t,e),o(t,[{key:"bandwidth",get:function(){return this._bandwidth}}]),t}(u.default);t.default=l},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(17),s=r(o),u=n(2),l=(r(u),function(){function e(){i(this,e),this._bindingMap=new s.default}return a(e,[{key:"destroy",value:function(){return this.removeAll(),this._bindingMap=null,Promise.resolve()}},{key:"listen",value:function(e,t,n){var r=new c(e,t,n);this._bindingMap&&this._bindingMap.push(t,r)}},{key:"unlisten",value:function(e,t){if(this._bindingMap)for(var n=this._bindingMap.get(t),r=0;r<n.length;++r){var i=n[r];i.target==e&&(i.unlisten(),this._bindingMap&&this._bindingMap.remove(t,i))}}},{key:"removeAll",value:function(){if(this._bindingMap){var e=this._bindingMap.getAll(),t=!0,n=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){i.value.unlisten()}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}this._bindingMap&&this._bindingMap.clear()}}}]),e}()),c=function(){function e(t,n,r){i(this,e),this.target=t,this.type=n,this.listener=r,this.target.addEventListener(n,r,!1)}return a(e,[{key:"unlisten",value:function(){this.target&&(this.target.removeEventListener(this.type,this.listener,!1),this.target=null,this.listener=null)}}]),e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CUSTOM_EVENTS=t.HTML5_EVENTS=t.PLAYER_EVENTS=void 0;var r=n(11),i={ABORT:"abort",CAN_PLAY:"canplay",CAN_PLAY_THROUGH:"canplaythrough",DURATION_CHANGE:"durationchange",EMPTIED:"emptied",ENDED:"ended",ERROR:"error",LOADED_DATA:"loadeddata",LOADED_METADATA:"loadedmetadata",LOAD_START:"loadstart",PAUSE:"pause",PLAY:"play",PLAYING:"playing",PROGRESS:"progress",RATE_CHANGE:"ratechange",SEEKED:"seeked",SEEKING:"seeking",STALLED:"stalled",SUSPEND:"suspend",TIME_UPDATE:"timeupdate",VOLUME_CHANGE:"volumechange",WAITING:"waiting"},a={VIDEO_TRACK_CHANGED:"videotrackchanged",AUDIO_TRACK_CHANGED:"audiotrackchanged",TEXT_TRACK_CHANGED:"texttrackchanged",TRACKS_CHANGED:"trackschanged",PLAYER_STATE_CHANGED:"playerstatechanged",FIRST_PLAY:"firstplay",SOURCE_SELECTED:"sourceselected"},o=(0,r.merge)([i,a]);t.PLAYER_EVENTS=o,t.HTML5_EVENTS=i,t.CUSTOM_EVENTS=a},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(6),l=r(u),c=n(2),f=r(c),d=n(9),h=r(d),p=n(7),v=n(16),y=r(v),g=n(11),m=n(1),b=r(m),_=n(19),E=r(_),T=n(15),w=r(T),k=n(22),S=r(k),O=n(24),A=r(O),P=n(0),R=(r(P),n(5)),D=r(R),L=n(3),x=r(L),I=n(4),M=r(I),C=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n._tracks=[],n._firstPlay=!0,n._logger=b.default.getLogger("Player"),n._stateManager=new S.default(n),n._pluginManager=new w.default,n._eventManager=new l.default,n._readyPromise=new Promise(function(e,t){n._eventManager.listen(n,p.CUSTOM_EVENTS.TRACKS_CHANGED,function(){e()}),n._eventManager.listen(n,p.HTML5_EVENTS.ERROR,t)}),n.configure(e),n}return o(t,e),s(t,[{key:"configure",value:function(e){this._config=(0,g.merge)([this._config,e||t._defaultConfig()]),this._loadPlugins(this._config),this._selectEngine(this._config),this._attachMedia()}},{key:"destroy",value:function(){this._engine.destroy(),this._eventManager.destroy(),this._pluginManager.destroy(),this._stateManager.destroy(),this._config={},this._tracks=[],this._readyPromise=null,this._firstPlay=!0}},{key:"_loadPlugins",value:function(e){var t=e.plugins;for(var n in t)this._pluginManager.load(n,this,t[n])}},{key:"_selectEngine",value:function(e){if(e&&e.sources)for(var t=e.sources,n=0;n<t.length;n++)if(E.default.canPlayType(t[n].mimetype)){this.dispatchEvent(new f.default(p.CUSTOM_EVENTS.SOURCE_SELECTED,{selectedSource:t[n]})),this._loadEngine(t[n],e);break}}},{key:"_loadEngine",value:function(e,t){this._engine=new E.default(e,t),"auto"===t.preload&&this.load()}},{key:"_attachMedia",value:function(){var e=this;if(this._engine){for(var t in p.HTML5_EVENTS)this._eventManager.listen(this._engine,p.HTML5_EVENTS[t],function(t){return e.dispatchEvent(t)});this._eventManager.listen(this._engine,p.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED,function(t){return e._markActiveTrack(t.payload.selectedVideoTrack),e.dispatchEvent(t)}),this._eventManager.listen(this._engine,p.CUSTOM_EVENTS.AUDIO_TRACK_CHANGED,function(t){return e._markActiveTrack(t.payload.selectedAudioTrack),e.dispatchEvent(t)}),this._eventManager.listen(this._engine,p.CUSTOM_EVENTS.TEXT_TRACK_CHANGED,function(t){return e._markActiveTrack(t.payload.selectedTextTrack),e.dispatchEvent(t)}),this._eventManager.listen(this,p.HTML5_EVENTS.PLAY,this._onPlay.bind(this))}}},{key:"getTracks",value:function(e){return this._getTracksByType(e)}},{key:"_getTracksByType",value:function(e){return e?this._tracks.filter(function(t){return e===A.default.VIDEO?t instanceof D.default:e===A.default.AUDIO?t instanceof x.default:e!==A.default.TEXT||t instanceof M.default}):this._tracks}},{key:"selectTrack",value:function(e){this._engine&&(e instanceof D.default?this._engine.selectVideoTrack(e):e instanceof x.default?this._engine.selectAudioTrack(e):e instanceof M.default&&this._engine.selectTextTrack(e))}},{key:"enableAdaptiveBitrate",value:function(){this._engine&&this._engine.enableAdaptiveBitrate()}},{key:"_markActiveTrack",value:function(e){var t=void 0;if(e instanceof D.default?t=A.default.VIDEO:e instanceof x.default?t=A.default.AUDIO:e instanceof M.default&&(t=A.default.TEXT),t)for(var n=this.getTracks(t),r=0;r<n.length;r++)n[r].active=e.index===r}},{key:"_onPlay",value:function(){this._firstPlay&&(this._firstPlay=!1,this.dispatchEvent(new f.default(p.CUSTOM_EVENTS.FIRST_PLAY)))}},{key:"ready",value:function(){return this._readyPromise?this._readyPromise:Promise.resolve()}},{key:"load",value:function(){var e=this;this._engine&&this._engine.load().then(function(t){e._tracks=t.tracks,e.dispatchEvent(new f.default(p.CUSTOM_EVENTS.TRACKS_CHANGED,{tracks:e._tracks}))}).catch(function(t){e.dispatchEvent(new f.default(p.HTML5_EVENTS.ERROR,t))})}},{key:"play",value:function(){var e=this;this._engine&&(this._engine.src?this._engine.play():(this.load(),this.ready().then(function(){e._engine.play()})))}},{key:"pause",value:function(){if(this._engine)return this._engine.pause()}},{key:"buffered",value:function(){}},{key:"config",get:function(){return this._config}},{key:"sessionId",set:function(e){this._config.session=this._config.session||{},this._config.session.id=e}},{key:"currentTime",set:function(e){if(this._engine&&(0,g.isNumber)(e)){var t=e;e<0&&(t=0),t>this._engine.duration&&(t=this._engine.duration),this._engine.currentTime=t}},get:function(){if(this._engine)return this._engine.currentTime}},{key:"duration",get:function(){if(this._engine)return this._engine.duration}},{key:"volume",set:function(e){if(this._engine&&(0,g.isFloat)(e)){var t=e;t<0&&(t=0),t>1&&(t=1),this._engine.volume=t}},get:function(){if(this._engine)return this._engine.volume}},{key:"paused",get:function(){if(this._engine)return this._engine.paused}},{key:"seeking",get:function(){if(this._engine)return this._engine.seeking}},{key:"muted",set:function(e){this._engine&&(this._engine.muted=e)},get:function(){if(this._engine)return this._engine.muted}},{key:"src",get:function(){if(this._engine)return this._engine.src}},{key:"Event",get:function(){return p.PLAYER_EVENTS}},{key:"State",get:function(){return y.default}},{key:"Track",get:function(){return A.default}}],[{key:"_defaultConfig",value:function(){return{}}}]),t}(h.default);t.default=C},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(2),s=(r(o),n(17)),u=r(s),l=function(){function e(){i(this,e),this._listeners=new u.default,this.dispatchTarget=this}return a(e,[{key:"addEventListener",value:function(e,t){this._listeners.push(e,t)}},{key:"removeEventListener",value:function(e,t){this._listeners.remove(e,t)}},{key:"dispatchEvent",value:function(e){for(var t=this._listeners.get(e.type)||[],n=0;n<t.length;++n){e.target=this.dispatchTarget,e.currentTarget=this.dispatchTarget;var r=t[n];try{r.handleEvent?r.handleEvent(e):r.call(this,e)}catch(e){}if(e.stopped)break}return e.defaultPrevented}}]),e}();t.default=l},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n){r(this,e),this.name=t.name,this.message=t.message(n)}return i(e,[{key:"getError",value:function(){return{name:this.name,message:this.message}}}]),e}();a.TYPE={NOT_REGISTERED_PLUGIN:{name:"PluginNotRegisteredException",message:function(e){return"Cannot load "+e+" plugin. Name not found in the registry"}},NOT_VALID_HANDLER:{name:"PluginHandlerIsNotValidException",message:function(){return"To activate plugin you must provide a class derived from BasePlugin"}},NOT_IMPLEMENTED_METHOD:{name:"NotImplementedException",message:function(e){return e+" method not implemented"}}},t.default=a},function(e,t,n){"use strict";function r(e){return Number(e)===e}function i(e){return r(e)&&e%1==0}function a(e){return r(e)&&e%1!=0}function o(e){var t={},n=!0,r=!1,i=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;Object.assign(t,s)}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.isNumber=r,t.isInt=i,t.isFloat=a,t.merge=o},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(2),l=r(u),c=n(9),f=r(c),d=n(10),h=r(d),p=n(7),v=n(1),y=r(v),g=n(0),m=(r(g),n(5)),b=r(m),_=n(3),E=r(_),T=n(4),w=r(T),k=function(e){function t(e,n,r){i(this,t);var o=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o._videoElement=e,o._sourceObj=n,o._config=r,o}return o(t,e),s(t,null,[{key:"isSupported",value:function(){return!0}},{key:"createAdapter",value:function(e,t,n){return new this(e,t,n)}}]),s(t,[{key:"destroy",value:function(){this._sourceObj=null,this._config=null}},{key:"_onTrackChanged",value:function(e){e instanceof b.default?this._trigger(t.CustomEvents.VIDEO_TRACK_CHANGED,{selectedVideoTrack:e}):e instanceof E.default?this._trigger(t.CustomEvents.AUDIO_TRACK_CHANGED,{selectedAudioTrack:e}):e instanceof w.default&&this._trigger(t.CustomEvents.TEXT_TRACK_CHANGED,{selectedTextTrack:e})}},{key:"_trigger",value:function(e,t){this.dispatchEvent(new l.default(e,t))}},{key:"load",value:function(){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"load").getError()}},{key:"selectVideoTrack",value:function(e){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"selectVideoTrack").getError()}},{key:"selectAudioTrack",value:function(e){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"selectAudioTrack").getError()}},{key:"selectTextTrack",value:function(e){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"selectTextTrack").getError()}},{key:"enableAdaptiveBitrate",value:function(){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"enableAdaptiveBitrate").getError()}},{key:"src",get:function(){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"get src").getError()}}],[{key:"canPlayType",value:function(e){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"static canPlayType").getError()}}]),t}(f.default);k.CustomEvents=p.CUSTOM_EVENTS,k.getLogger=y.default.getLogger,t.default=k},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0}),t.registerMediaSourceAdapter=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(20),s=r(o),u=n(1),l=r(u),c=function(){function e(){i(this,e)}return a(e,null,[{key:"register",value:function(t){t&&(e._mediaSourceAdapters.includes(t)?e._logger.debug("Adapter <"+t.id+"> is already registered, do not register again"):(e._logger.debug("Adapter <"+t.id+"> has been registered successfully"),e._mediaSourceAdapters.push(t)))}},{key:"unRegister",value:function(t){var n=e._mediaSourceAdapters.indexOf(t);n>-1&&(e._logger.debug("Unregistered <"+t.id+"> adapter"),e._mediaSourceAdapters.splice(n,1))}},{key:"canPlayType",value:function(t){for(var n=e._mediaSourceAdapters,r=0;r<n.length;r++)if(n[r].canPlayType(t))return e._selectedAdapter=n[r],e._logger.debug("Selected adapter is <"+e._selectedAdapter.id+">"),!0;return!1}},{key:"getMediaSourceAdapter",value:function(t,n,r){return t&&n&&r?(e._selectedAdapter||e.canPlayType(n.mimetype),e._selectedAdapter?e._selectedAdapter.createAdapter(t,n,r.engines):null):null}}]),e}();c._logger=l.default.getLogger("MediaSourceProvider"),c._mediaSourceAdapters=[s.default],c._selectedAdapter=null,t.default=c;var f=c.register;t.registerMediaSourceAdapter=f},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(8),s=(r(o),n(1)),u=r(s),l=n(11),c=n(6),f=r(c),d=n(10),h=r(d),p=function(){function e(t,n,r){i(this,e),this.name=t,this.player=n,this.eventManager=new f.default,this.logger=u.default.getLogger(this.name),this.config=(0,l.merge)([this.constructor.defaultConfig,r])}return a(e,null,[{key:"createPlugin",value:function(e,t){return new this(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}},{key:"isValid",value:function(){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"isValid()").getError()}}]),a(e,[{key:"getConfig",value:function(e){return e?this.config[e]:this.config}},{key:"updateConfig",value:function(e){this.config=(0,l.merge)([this.config,e])}},{key:"destroy",value:function(){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"destroy()").getError()}},{key:"getName",value:function(){return this.name}}]),e}();p.defaultConfig={},t.default=p},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0}),t.registerPlugin=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(14),s=r(o),u=n(10),l=r(u),c=n(8),f=(r(c),n(1)),d=r(f),h=d.default.getLogger("PluginManager"),p=function(){function e(){i(this,e),this._plugins=new Map}return a(e,[{key:"load",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e._registry.has(t))throw new l.default(l.default.TYPE.NOT_REGISTERED_PLUGIN,t).getError();var i=e._registry.get(t);return null!=i&&i.isValid()?(this._plugins.set(t,i.createPlugin(t,n,r)),h.debug("Plugin <"+t+"> has been loaded"),!0):(h.debug("Plugin <"+t+"> isn't loaded, isValid()=false"),!1)}},{key:"destroy",value:function(){this._plugins.forEach(this._destroy.bind(this))}},{key:"_destroy",value:function(e,t){e.destroy(),this._plugins.delete(t)}},{key:"get",value:function(e){return this._plugins.get(e)}}],[{key:"register",value:function(t,n){if("function"!=typeof n||n.prototype instanceof s.default==!1)throw new l.default(l.default.TYPE.NOT_VALID_HANDLER).getError();return e._registry.has(t)?(h.debug("Plugin <"+t+"> is already registered, do not register again"),!1):(e._registry.set(t,n),h.debug("Plugin <"+t+"> has been registered successfully"),!0)}},{key:"unRegister",value:function(t){e._registry.has(t)&&(e._registry.delete(t),h.debug("Unregistered <"+t+"> plugin."))}}]),e}();p._registry=new Map,t.default=p;var v=p.register;t.registerPlugin=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={IDLE:"idle",LOADING:"loading",PLAYING:"playing",PAUSED:"paused",BUFFERING:"buffering"};t.default=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e),this._map=new Map}return i(e,[{key:"push",value:function(e,t){if(this._map.has(e)){var n=this._map.get(e);Array.isArray(n)&&(n.push(t),this._map.set(e,n))}else this._map.set(e,[t])}},{key:"set",value:function(e,t){this._map.set(e,t)}},{key:"has",value:function(e){return this._map.has(e)}},{key:"get",value:function(e){var t=this._map.get(e);return t?t.slice():[]}},{key:"getAll",value:function(){var e=[],t=!0,n=!1,r=void 0;try{for(var i,a=this._map.values()[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;e=e.concat(o)}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return e}},{key:"remove",value:function(e,t){if(this._map.has(e)){var n=this._map.get(e);if(Array.isArray(n))for(var r=0;r<n.length;++r)n[r]==t&&(n.splice(r,1),--r)}}},{key:"keys",value:function(){return this._map.keys()}},{key:"clear",value:function(){this._map.clear()}}]),e}();t.default=a},function(e,t){e.exports={name:"playkit-js",version:"0.2.0",main:"dist/playkit.js",scripts:{clean:"rm -rf ./dist",prebuild:"npm run clean","build:prod":"NODE_ENV=production webpack",build:"webpack",dev:"webpack --progress --colors --watch",test:"NODE_ENV=test karma start --color","test:chrome":"NODE_ENV=test karma start --color --browsers Chrome","test:chrome:dots":"NODE_ENV=test karma start --color --browsers Chrome --reporters dots","test:firefox":"NODE_ENV=test karma start --color --browsers Firefox","test:safari":"NODE_ENV=test karma start --color --browsers Safari","test:watch":"NODE_ENV=test karma start --color --auto-watch",start:"webpack-dev-server",release:"npm run build:prod && npm run commit:dist && standard-version",publish:"git push --follow-tags --no-verify origin develop",eslint:"eslint . --color",flow:"flow check","eslint:flow:test":"npm run eslint && npm run flow && npm run test","commit:dist":"git add --all dist && (git commit -m 'chore: update dist' || exit 0)","prepush-msg:build":"echo '\nRunning build before push...\n' && exit 0","prepush-msg:dist":"echo '\nAdding dist files to a seperate commit...\n' && exit 0","prepush-msg:done":"echo '\nPre push tasks are done.\n' && exit 0"},"pre-push":["prepush-msg:build","prebuild","build","build:prod","prepush-msg:dist","commit:dist","prepush-msg:done"],devDependencies:{"babel-cli":"^6.18.0","babel-core":"^6.18.2","babel-eslint":"^7.1.1","babel-loader":"^6.2.7","babel-plugin-istanbul":"^4.0.0","babel-plugin-transform-class-properties":"^6.22.0","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-preset-es2015":"^6.18.0","babel-register":"^6.23.0",chai:"^3.5.0","cross-env":"^3.1.4",eslint:"^3.10.0","eslint-loader":"^1.6.1","eslint-plugin-flowtype":"^2.30.0","eslint-plugin-import":"^2.2.0","eslint-plugin-mocha-no-only":"^0.0.5","flow-bin":"latest",istanbul:"^0.4.5",karma:"^1.5.0","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.0.0","karma-cli":"^1.0.1","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.0.1","karma-ie-launcher":"^1.0.0","karma-mocha":"^1.3.0","karma-safari-launcher":"^1.0.0","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^2.0.2",mocha:"^3.2.0","mocha-cli":"^1.0.1","pre-push":"^0.1.1",sinon:"^2.0.0","sinon-chai":"^2.8.0","standard-version":"^4.0.0","uglifyjs-webpack-plugin":"^0.4.3",webpack:"latest","webpack-dev-server":"latest"},repository:{type:"git",url:"https://github.com/kaltura/playkit-js"},keywords:["kaltura","player","html5 player"],license:"AGPLV3",bugs:{url:"https://github.com/kaltura/playkit-js/issues"},homepage:"https://github.com/kaltura/playkit-js",dependencies:{"js-logger":"^1.3.0"}}},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(9),l=r(u),c=n(2),f=r(c),d=n(6),h=r(d),p=n(7),v=n(13),y=r(v),g=n(5),m=(r(g),n(3)),b=(r(m),n(4)),_=(r(b),function(e){function t(e,n){i(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r._createVideoElement(),r._eventManager=new h.default,r._loadMediaSourceAdapter(e,n),r.attach(),r}return o(t,e),s(t,null,[{key:"canPlayType",value:function(e){return y.default.canPlayType(e)}}]),s(t,[{key:"destroy",value:function(){this.detach(),this._mediaSourceAdapter&&this._mediaSourceAdapter.destroy(),this._el&&(this.pause(),this._el.removeAttribute("src"),this._el.parentNode&&this._el.parentNode.removeChild(this._el)),this._eventManager.destroy()}},{key:"attach",value:function(){var e=this;for(var t in p.HTML5_EVENTS)!function(t){e._eventManager.listen(e._el,p.HTML5_EVENTS[t],function(){e.dispatchEvent(new f.default(p.HTML5_EVENTS[t]))})}(t);this._mediaSourceAdapter&&(this._eventManager.listen(this._mediaSourceAdapter,p.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED,function(t){e.dispatchEvent(t)}),this._eventManager.listen(this._mediaSourceAdapter,p.CUSTOM_EVENTS.AUDIO_TRACK_CHANGED,function(t){return e.dispatchEvent(t)}),this._eventManager.listen(this._mediaSourceAdapter,p.CUSTOM_EVENTS.TEXT_TRACK_CHANGED,function(t){return e.dispatchEvent(t)}))}},{key:"detach",value:function(){for(var e in p.HTML5_EVENTS)this._eventManager.unlisten(this._el,p.HTML5_EVENTS[e]);this._mediaSourceAdapter&&(this._eventManager.unlisten(this._mediaSourceAdapter,p.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED),this._eventManager.unlisten(this._mediaSourceAdapter,p.CUSTOM_EVENTS.AUDIO_TRACK_CHANGED),this._eventManager.unlisten(this._mediaSourceAdapter,p.CUSTOM_EVENTS.TEXT_TRACK_CHANGED))}},{key:"getVideoElement",value:function(){return this._el}},{key:"_createVideoElement",value:function(){this._el=document.createElement("video"),this._el.style.width="640px",this._el.style.height="360px",this._el.style.backgroundColor="black",this._el.controls=!0,document&&document.body&&document.body.appendChild(this._el)}},{key:"_loadMediaSourceAdapter",value:function(e,t){this._mediaSourceAdapter=y.default.getMediaSourceAdapter(this.getVideoElement(),e,t)}},{key:"selectVideoTrack",value:function(e){this._mediaSourceAdapter&&this._mediaSourceAdapter.selectVideoTrack(e)}},{key:"selectAudioTrack",value:function(e){this._mediaSourceAdapter&&this._mediaSourceAdapter.selectAudioTrack(e)}},{key:"selectTextTrack",value:function(e){this._mediaSourceAdapter&&this._mediaSourceAdapter.selectTextTrack(e)}},{key:"enableAdaptiveBitrate",value:function(){this._mediaSourceAdapter&&this._mediaSourceAdapter.enableAdaptiveBitrate()}},{key:"play",value:function(){return this._el.play()}},{key:"pause",value:function(){return this._el.pause()}},{key:"load",value:function(){return this._mediaSourceAdapter?this._mediaSourceAdapter.load():Promise.resolve({})}},{key:"ready",value:function(){}},{key:"src",set:function(e){this._el.src=e},get:function(){return this._mediaSourceAdapter?this._mediaSourceAdapter.src:""}},{key:"currentTime",get:function(){return this._el.currentTime},set:function(e){this._el.currentTime=e}},{key:"duration",get:function(){return this._el.duration}},{key:"volume",set:function(e){this._el.volume=e},get:function(){return this._el.volume}},{key:"paused",get:function(){return this._el.paused}},{key:"seeking",get:function(){return this._el.seeking}},{key:"seekable",get:function(){return this._el.seekable}},{key:"played",get:function(){return this._el.played}},{key:"buffered",get:function(){return this._el.buffered}},{key:"muted",set:function(e){this._el.muted=e},get:function(){return this._el.muted}},{key:"defaultMuted",get:function(){return this._el.defaultMuted}},{key:"poster",set:function(e){this._el.poster=e},get:function(){return this._el.poster}},{key:"preload",set:function(e){this._el.preload=e},get:function(){return this._el.preload}},{key:"autoplay",set:function(e){this._el.autoplay=e},get:function(){return this._el.autoplay}},{key:"loop",set:function(e){this._el.loop=e},get:function(){return this._el.loop}},{key:"controls",set:function(e){this._el.controls=e},get:function(){return this._el.controls}},{key:"playbackRate",set:function(e){this._el.playbackRate=e},get:function(){return this._el.playbackRate}},{key:"defaultPlaybackRate",set:function(e){this._el.defaultPlaybackRate=e},get:function(){return this._el.defaultPlaybackRate}},{key:"ended",get:function(){return this._el.ended}},{key:"error",get:function(){return this._el.error}},{key:"networkState",get:function(){return this._el.networkState}},{key:"readyState",get:function(){return this._el.readyState}},{key:"videoHeight",get:function(){return this._el.videoHeight}},{key:"videoWidth",get:function(){return this._el.videoWidth}}],[{key:"isSupported",value:function(){try{t.TEST_VID=document.createElement("video"),t.TEST_VID.volume=.5}catch(e){return!1}return!!t.TEST_VID.canPlayType}}]),t}(l.default));_.EngineName="html5",t.default=_},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var o=i.get;if(void 0!==o)return o.call(r)},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(6),c=r(l),f=n(7),d=n(0),h=(r(d),n(5)),p=r(h),v=n(3),y=r(v),g=n(4),m=r(g),b=n(12),_=r(b),E=function(e){function t(e,n,r){i(this,t),t._logger.debug("Creating adapter");var o=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));return o._eventManager=new c.default,o}return o(t,e),u(t,null,[{key:"canPlayType",value:function(e){var n="string"==typeof e&&!!document.createElement("video").canPlayType(e.toLowerCase());return t._logger.debug("canPlayType result for mimeType:"+e+" is "+n.toString()),n}}]),u(t,[{key:"load",value:function(){var e=this;return this._loadPromise||(this._loadPromise=new Promise(function(n,r){e._eventManager.listen(e._videoElement,f.HTML5_EVENTS.LOADED_DATA,function(){e._eventManager.unlisten(e._videoElement,f.HTML5_EVENTS.LOADED_DATA);var r={tracks:e._getParsedTracks()};t._logger.debug("The source has been loaded successfully"),n(r)}),e._eventManager.listen(e._videoElement,f.HTML5_EVENTS.ERROR,function(n){e._eventManager.unlisten(e._videoElement,f.HTML5_EVENTS.ERROR),t._logger.error(n),r(n)}),e._sourceObj&&e._sourceObj.url&&(e._videoElement.src=e._sourceObj.url)})),this._loadPromise}},{key:"destroy",value:function(){t._logger.debug("destroy"),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),this._eventManager.destroy(),this._loadPromise=null}},{key:"_getParsedTracks",value:function(){var e=this._getParsedVideoTracks(),t=this._getParsedAudioTracks(),n=this._getParsedTextTracks();return e.concat(t).concat(n)}},{key:"_getParsedVideoTracks",value:function(){var e=this._videoElement.videoTracks,t=[];if(e)for(var n=0;n<e.length;n++){var r={id:e[n].id,active:e[n].selected,label:e[n].label,language:e[n].language,index:n};t.push(new p.default(r))}return t}},{key:"_getParsedAudioTracks",value:function(){var e=this._videoElement.audioTracks,t=[];if(e)for(var n=0;n<e.length;n++){var r={id:e[n].id,active:e[n].enabled,label:e[n].label,language:e[n].language,index:n};t.push(new y.default(r))}return t}},{key:"_getParsedTextTracks",value:function(){var e=this._videoElement.textTracks,t=[];if(e)for(var n=0;n<e.length;n++){var r={kind:e[n].kind,active:"showing"===e[n].mode,label:e[n].label,language:e[n].language,index:n};t.push(new m.default(r))}return t}},{key:"selectVideoTrack",value:function(e){var t=this._videoElement.videoTracks;e instanceof p.default&&t&&t[e.index]&&(this._disableVideoTracks(),t[e.index].selected=!0,this._onTrackChanged(e))}},{key:"selectAudioTrack",value:function(e){var t=this._videoElement.audioTracks;e instanceof y.default&&t&&t[e.index]&&(this._disableAudioTracks(),t[e.index].enabled=!0,this._onTrackChanged(e))}},{key:"selectTextTrack",value:function(e){var t=this._videoElement.textTracks;e instanceof m.default&&("subtitles"===e.kind||"captions"===e.kind)&&t&&t[e.index]&&(this._disableTextTracks(),t[e.index].mode="showing",this._onTrackChanged(e))}},{key:"enableAdaptiveBitrate",value:function(){t._logger.debug("Enabling adaptive bitrate not supported")}},{key:"_disableVideoTracks",value:function(){var e=this._videoElement.videoTracks;if(e)for(var t=0;t<e.length;t++)e[t].selected=!1}},{key:"_disableAudioTracks",value:function(){var e=this._videoElement.audioTracks;if(e)for(var t=0;t<e.length;t++)e[t].enabled=!1}},{key:"_disableTextTracks",value:function(){var e=this._videoElement.textTracks;if(e)for(var t=0;t<e.length;t++)e[t].mode="disabled"}},{key:"src",get:function(){return this._videoElement.src}}]),t}(_.default);E.id="NativeAdapter",E._logger=_.default.getLogger(E.id),t.default=E},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new o.default(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=t.TextTrack=t.AudioTrack=t.VideoTrack=t.Track=t.BasePlugin=t.registerPlugin=t.BaseMediaSourceAdapter=t.registerMediaSourceAdapter=void 0,t.playkit=i;var a=n(8),o=r(a),s=n(1),u=r(s),l=n(18),c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(l),f=n(12),d=r(f),h=n(13),p=n(15),v=n(14),y=r(v),g=n(0),m=r(g),b=n(5),_=r(b),E=n(3),T=r(E),w=n(4),k=r(w),S=c.version;u.default.getLogger().log("%c Playkit "+S,"color: yellow; font-size: large"),u.default.getLogger().log("%c For more details see https://github.com/kaltura/playkit-js","color: yellow;"),t.registerMediaSourceAdapter=h.registerMediaSourceAdapter,t.BaseMediaSourceAdapter=d.default,t.registerPlugin=p.registerPlugin,t.BasePlugin=y.default,t.Track=m.default,t.VideoTrack=_.default,t.AudioTrack=T.default,t.TextTrack=k.default,t.VERSION=S,t.default=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(8),u=(r(s),n(6)),l=r(u),c=n(23),f=r(c),d=n(16),h=r(d),p=n(7),v=n(2),y=r(v),g=n(1),m=r(g),b=function(){function e(t){var n,r,o,s,u,c,d=this;a(this,e),this._transitions=(c={},i(c,h.default.IDLE,(n={},i(n,p.HTML5_EVENTS.LOAD_START,function(){d._updateState(h.default.LOADING),d._dispatchEvent()}),i(n,p.HTML5_EVENTS.PLAY,function(){d._updateState(h.default.BUFFERING),d._dispatchEvent()}),n)),i(c,h.default.LOADING,(r={},i(r,p.HTML5_EVENTS.LOADED_METADATA,function(){d._player.config.autoPlay?d._updateState(h.default.PLAYING):d._updateState(h.default.PAUSED),d._dispatchEvent()}),i(r,p.HTML5_EVENTS.ERROR,function(){d._updateState(h.default.IDLE),d._dispatchEvent()}),r)),i(c,h.default.PAUSED,(o={},i(o,p.HTML5_EVENTS.PLAY,function(){d._updateState(h.default.PLAYING),d._dispatchEvent()}),i(o,p.HTML5_EVENTS.PLAYING,function(){d._updateState(h.default.PLAYING),d._dispatchEvent()}),i(o,p.HTML5_EVENTS.ENDED,function(){d._updateState(h.default.IDLE),d._dispatchEvent()}),o)),i(c,h.default.PLAYING,(s={},i(s,p.HTML5_EVENTS.PAUSE,function(){d._updateState(h.default.PAUSED),d._dispatchEvent()}),i(s,p.HTML5_EVENTS.WAITING,function(){d._updateState(h.default.BUFFERING),d._dispatchEvent()}),i(s,p.HTML5_EVENTS.ENDED,function(){d._updateState(h.default.IDLE),d._dispatchEvent()}),i(s,p.HTML5_EVENTS.ERROR,function(){d._updateState(h.default.IDLE),d._dispatchEvent()}),s)),i(c,h.default.BUFFERING,(u={},i(u,p.HTML5_EVENTS.PLAYING,function(){d._updateState(h.default.PLAYING),d._dispatchEvent()}),i(u,p.HTML5_EVENTS.PAUSE,function(){d._updateState(h.default.PAUSED),d._dispatchEvent()}),u)),c),this._player=t,this._logger=m.default.getLogger("StateManager"),this._eventManager=new l.default,this._history=[],this._prevState=null,this._curState=new f.default(h.default.IDLE),this._attachListeners()}return o(e,[{key:"_attachListeners",value:function(){this._eventManager.listen(this._player,p.HTML5_EVENTS.ERROR,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.ENDED,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.PLAY,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.LOAD_START,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.PLAYING,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.LOADED_METADATA,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.PAUSE,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.WAITING,this._doTransition.bind(this))}},{key:"_doTransition",value:function(e){this._logger.debug("Do transition request",e);var t=this._transitions[this._curState.type];"function"==typeof t[e.type]&&t[e.type]()}},{key:"_updateState",value:function(e){this._curState.type!==e&&(this._curState.duration=Date.now()/1e3,this._history.push(this._curState),this._prevState=this._curState,this._curState=new f.default(e),this._logger.debug("Switch player state: from "+this._prevState.type+" to "+this._curState.type))}},{key:"_dispatchEvent",value:function(){var e=new y.default(p.CUSTOM_EVENTS.PLAYER_STATE_CHANGED,{oldState:this._prevState,newState:this._curState});this._player.dispatchEvent(e)}},{key:"destroy",value:function(){this._history=[],this._eventManager.destroy()}},{key:"currentState",get:function(){return this._curState}},{key:"previousState",get:function(){return this._prevState}},{key:"history",get:function(){return this._history}}]),e}();t.default=b},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t){r(this,e),this.type=t,this._duration=0,this._timestamp=Date.now()/1e3}return i(e,[{key:"duration",get:function(){return this._duration},set:function(e){this._duration=e-this._timestamp}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={VIDEO:"video",AUDIO:"audio",TEXT:"text"};t.default=r},function(e,t,n){var r,i;/*! +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("KalturaPlayer",[],t):"object"==typeof exports?exports.KalturaPlayer=t():e.KalturaPlayer=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,n){!function(t,n){e.exports=n()}(0,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=21)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,e),this._id=t.id,this._active=t.active,this._label=t.label,this._language=t.language,this._index=t.index}return i(e,[{key:"id",get:function(){return this._id}},{key:"active",get:function(){return this._active},set:function(e){this._active=e}},{key:"label",get:function(){return this._label}},{key:"language",get:function(){return this._language}},{key:"index",get:function(){return this._index}}]),e}();t.default=a},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.LOG_LEVEL=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(25),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),s={DEBUG:o.DEBUG,INFO:o.INFO,TIME:o.TIME,WARN:o.WARN,ERROR:o.ERROR,OFF:o.OFF},u=function(){function e(t){r(this,e),o.useDefaults(t||{})}return i(e,[{key:"getLogger",value:function(e){return e?o.get(e):o}}]),e}(),l=new u({defaultLevel:o.DEBUG});t.default=l,t.LOG_LEVEL=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n){r(this,e),this.bubbles=!1,this.cancelable=!1,this.defaultPrevented=!1,this.timeStamp=window.performance?window.performance.now():Date.now(),this.type=t,this.isTrusted=!1,this.currentTarget=null,this.target=null,this.stopped=!1,this.payload=n}return i(e,[{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.stopped=!0}},{key:"stopPropagation",value:function(){}}]),e}();t.default=a},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(s.default);t.default=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._kind=e.kind,n}return a(t,e),o(t,[{key:"kind",get:function(){return this._kind}}]),t}(u.default);t.default=l},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._bandwidth=e.bandwidth,n}return a(t,e),o(t,[{key:"bandwidth",get:function(){return this._bandwidth}}]),t}(u.default);t.default=l},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(17),s=r(o),u=n(2),l=(r(u),function(){function e(){i(this,e),this._bindingMap=new s.default}return a(e,[{key:"destroy",value:function(){return this.removeAll(),this._bindingMap=null,Promise.resolve()}},{key:"listen",value:function(e,t,n){var r=new c(e,t,n);this._bindingMap&&this._bindingMap.push(t,r)}},{key:"unlisten",value:function(e,t){if(this._bindingMap)for(var n=this._bindingMap.get(t),r=0;r<n.length;++r){var i=n[r];i.target==e&&(i.unlisten(),this._bindingMap&&this._bindingMap.remove(t,i))}}},{key:"removeAll",value:function(){if(this._bindingMap){var e=this._bindingMap.getAll(),t=!0,n=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){i.value.unlisten()}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}this._bindingMap&&this._bindingMap.clear()}}}]),e}()),c=function(){function e(t,n,r){i(this,e),this.target=t,this.type=n,this.listener=r,this.target.addEventListener(n,r,!1)}return a(e,[{key:"unlisten",value:function(){this.target&&(this.target.removeEventListener(this.type,this.listener,!1),this.target=null,this.listener=null)}}]),e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CUSTOM_EVENTS=t.HTML5_EVENTS=t.PLAYER_EVENTS=void 0;var r=n(11),i={ABORT:"abort",CAN_PLAY:"canplay",CAN_PLAY_THROUGH:"canplaythrough",DURATION_CHANGE:"durationchange",EMPTIED:"emptied",ENDED:"ended",ERROR:"error",LOADED_DATA:"loadeddata",LOADED_METADATA:"loadedmetadata",LOAD_START:"loadstart",PAUSE:"pause",PLAY:"play",PLAYING:"playing",PROGRESS:"progress",RATE_CHANGE:"ratechange",SEEKED:"seeked",SEEKING:"seeking",STALLED:"stalled",SUSPEND:"suspend",TIME_UPDATE:"timeupdate",VOLUME_CHANGE:"volumechange",WAITING:"waiting"},a={VIDEO_TRACK_CHANGED:"videotrackchanged",AUDIO_TRACK_CHANGED:"audiotrackchanged",TEXT_TRACK_CHANGED:"texttrackchanged",TRACKS_CHANGED:"trackschanged",PLAYER_STATE_CHANGED:"playerstatechanged",FIRST_PLAY:"firstplay",SOURCE_SELECTED:"sourceselected"},o=(0,r.merge)([i,a]);t.PLAYER_EVENTS=o,t.HTML5_EVENTS=i,t.CUSTOM_EVENTS=a},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(6),c=r(l),f=n(2),d=r(f),h=n(9),p=r(h),v=n(7),g=n(16),y=r(g),m=n(11),b=n(1),_=r(b),E=n(19),T=r(E),w=n(15),k=r(w),S=n(22),A=r(S),O=n(24),P=r(O),R=n(0),D=(r(R),n(5)),x=r(D),L=n(3),I=r(L),M=n(4),C=r(M),N=n(26),U=r(N),j=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n._tracks=[],n._firstPlay=!0,n._stateManager=new A.default(n),n._pluginManager=new k.default,n._eventManager=new c.default,n._readyPromise=new Promise(function(e,t){n._eventManager.listen(n,v.CUSTOM_EVENTS.TRACKS_CHANGED,function(){e()}),n._eventManager.listen(n,v.HTML5_EVENTS.ERROR,t)}),n.configure(e),n}return o(t,e),u(t,[{key:"configure",value:function(e){this._config=(0,m.mergeDeep)(t._defaultConfig(),e),this._selectEngine()?(this._attachMedia(),this._loadPlugins(),this._handlePlaybackConfig()):t._logger.warn("No playable engines was found to play the given sources")}},{key:"destroy",value:function(){this._engine&&this._engine.destroy(),this._eventManager.destroy(),this._pluginManager.destroy(),this._stateManager.destroy(),this._config={},this._tracks=[],this._readyPromise=null,this._firstPlay=!0}},{key:"_loadPlugins",value:function(){var e=this._config.plugins;for(var t in e)this._pluginManager.load(t,this,e[t])}},{key:"_selectEngine",value:function(){return!!(this._config.sources&&this._config.playback&&this._config.playback.streamPriority)&&this._selectEngineByPriority()}},{key:"_selectEngineByPriority",value:function(){var e=this,n=this._config.playback.streamPriority,r=this._config.sources,i=!0,a=!1,o=void 0;try{for(var u,l=n[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var c=function(){var n=u.value,i="string"==typeof n.engine?n.engine.toLowerCase():"",a="string"==typeof n.format?n.format.toLowerCase():"",o=t._engines.find(function(e){return e.id===i});if(o){var s=r[a];if(s&&s.length>0){var l=s[0];if(o.canPlayType(l.mimetype))return e._loadEngine(o,l),{v:!0}}}}();if("object"===(void 0===c?"undefined":s(c)))return c.v}}catch(e){a=!0,o=e}finally{try{!i&&l.return&&l.return()}finally{if(a)throw o}}return!1}},{key:"_loadEngine",value:function(e,t){this.dispatchEvent(new d.default(v.CUSTOM_EVENTS.SOURCE_SELECTED,{selectedSource:t})),this._engine=e.createEngine(t,this._config)}},{key:"_attachMedia",value:function(){var e=this;if(this._engine){for(var t in v.HTML5_EVENTS)this._eventManager.listen(this._engine,v.HTML5_EVENTS[t],function(t){return e.dispatchEvent(t)});this._eventManager.listen(this._engine,v.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED,function(t){return e._markActiveTrack(t.payload.selectedVideoTrack),e.dispatchEvent(t)}),this._eventManager.listen(this._engine,v.CUSTOM_EVENTS.AUDIO_TRACK_CHANGED,function(t){return e._markActiveTrack(t.payload.selectedAudioTrack),e.dispatchEvent(t)}),this._eventManager.listen(this._engine,v.CUSTOM_EVENTS.TEXT_TRACK_CHANGED,function(t){return e._markActiveTrack(t.payload.selectedTextTrack),e.dispatchEvent(t)}),this._eventManager.listen(this,v.HTML5_EVENTS.PLAY,this._onPlay.bind(this))}}},{key:"_handlePlaybackConfig",value:function(){this._config.playback&&(this._config.playback.muted&&(this.muted=!0),"auto"===this._config.playback.preload&&this.load(),this._config.playback.autoplay&&this.play())}},{key:"getTracks",value:function(e){return this._getTracksByType(e)}},{key:"_getTracksByType",value:function(e){return e?this._tracks.filter(function(t){return e===P.default.VIDEO?t instanceof x.default:e===P.default.AUDIO?t instanceof I.default:e!==P.default.TEXT||t instanceof C.default}):this._tracks}},{key:"selectTrack",value:function(e){this._engine&&(e instanceof x.default?this._engine.selectVideoTrack(e):e instanceof I.default?this._engine.selectAudioTrack(e):e instanceof C.default&&this._engine.selectTextTrack(e))}},{key:"hideTextTrack",value:function(){this._engine&&(this._engine.hideTextTrack(),this._getTracksByType(P.default.TEXT).map(function(e){return e.active=!1}))}},{key:"enableAdaptiveBitrate",value:function(){this._engine&&this._engine.enableAdaptiveBitrate()}},{key:"_markActiveTrack",value:function(e){var t=void 0;if(e instanceof x.default?t=P.default.VIDEO:e instanceof I.default?t=P.default.AUDIO:e instanceof C.default&&(t=P.default.TEXT),t)for(var n=this.getTracks(t),r=0;r<n.length;r++)n[r].active=e.index===r}},{key:"_onPlay",value:function(){this._firstPlay&&(this._firstPlay=!1,this.dispatchEvent(new d.default(v.CUSTOM_EVENTS.FIRST_PLAY)))}},{key:"ready",value:function(){return this._readyPromise?this._readyPromise:Promise.resolve()}},{key:"load",value:function(){var e=this;this._engine&&this._engine.load().then(function(t){e._tracks=t.tracks,e.dispatchEvent(new d.default(v.CUSTOM_EVENTS.TRACKS_CHANGED,{tracks:e._tracks}))}).catch(function(t){e.dispatchEvent(new d.default(v.HTML5_EVENTS.ERROR,t))})}},{key:"play",value:function(){var e=this;this._engine&&(this._engine.src?this._engine.play():(this.load(),this.ready().then(function(){e._engine.play()})))}},{key:"pause",value:function(){if(this._engine)return this._engine.pause()}},{key:"buffered",value:function(){}},{key:"config",get:function(){return this._config}},{key:"sessionId",set:function(e){this._config.session=this._config.session||{},this._config.session.id=e}},{key:"currentTime",set:function(e){if(this._engine&&(0,m.isNumber)(e)){var t=e;e<0&&(t=0),t>this._engine.duration&&(t=this._engine.duration),this._engine.currentTime=t}},get:function(){if(this._engine)return this._engine.currentTime}},{key:"duration",get:function(){if(this._engine)return this._engine.duration}},{key:"volume",set:function(e){if(this._engine&&(0,m.isFloat)(e)){var t=e;t<0&&(t=0),t>1&&(t=1),this._engine.volume=t}},get:function(){if(this._engine)return this._engine.volume}},{key:"paused",get:function(){if(this._engine)return this._engine.paused}},{key:"seeking",get:function(){if(this._engine)return this._engine.seeking}},{key:"muted",set:function(e){this._engine&&(this._engine.muted=e)},get:function(){if(this._engine)return this._engine.muted}},{key:"src",get:function(){if(this._engine)return this._engine.src}},{key:"Event",get:function(){return v.PLAYER_EVENTS}},{key:"State",get:function(){return y.default}},{key:"Track",get:function(){return P.default}}],[{key:"_defaultConfig",value:function(){return(0,m.copyDeep)(U.default)}}]),t}(p.default);j._logger=_.default.getLogger("Player"),j._engines=[T.default],t.default=j},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(2),s=(r(o),n(17)),u=r(s),l=function(){function e(){i(this,e),this._listeners=new u.default,this.dispatchTarget=this}return a(e,[{key:"addEventListener",value:function(e,t){this._listeners.push(e,t)}},{key:"removeEventListener",value:function(e,t){this._listeners.remove(e,t)}},{key:"dispatchEvent",value:function(e){for(var t=this._listeners.get(e.type)||[],n=0;n<t.length;++n){e.target=this.dispatchTarget,e.currentTarget=this.dispatchTarget;var r=t[n];try{r.handleEvent?r.handleEvent(e):r.call(this,e)}catch(e){}if(e.stopped)break}return e.defaultPrevented}}]),e}();t.default=l},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n){r(this,e),this.name=t.name,this.message=t.message(n)}return i(e,[{key:"getError",value:function(){return{name:this.name,message:this.message}}}]),e}();a.TYPE={NOT_REGISTERED_PLUGIN:{name:"PluginNotRegisteredException",message:function(e){return"Cannot load "+e+" plugin. Name not found in the registry"}},NOT_VALID_HANDLER:{name:"PluginHandlerIsNotValidException",message:function(){return"To activate plugin you must provide a class derived from BasePlugin"}},NOT_IMPLEMENTED_METHOD:{name:"NotImplementedException",message:function(e){return e+" method not implemented"}}},t.default=a},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){return Number(e)===e}function o(e){return a(e)&&e%1==0}function s(e){return a(e)&&e%1!=0}function u(e){var t={},n=!0,r=!1,i=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;Object.assign(t,s)}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}return t}function l(e){return e&&"object"===(void 0===e?"undefined":d(e))&&!Array.isArray(e)}function c(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];if(!n.length)return e;var o=n.shift();if(l(e)&&l(o))for(var s in o)l(o[s])?(e[s]||Object.assign(e,i({},s,{})),c(e[s],o[s])):Object.assign(e,i({},s,o[s]));return c.apply(void 0,[e].concat(r(n)))}function f(e){var t=void 0;return Array.isArray(e)?(t=e.length>0?e.slice(0):[],t.forEach(function(e,n){("object"===(void 0===e?"undefined":d(e))&&e!=={}||Array.isArray(e)&&e.length>0)&&(t[n]=f(e))})):"object"===(void 0===e?"undefined":d(e))?(t=Object.assign({},e),Object.keys(t).forEach(function(e){("object"===d(t[e])&&t[e]!=={}||Array.isArray(t[e])&&t[e].length>0)&&(t[e]=f(t[e]))})):t=e,t}Object.defineProperty(t,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.isNumber=a,t.isInt=o,t.isFloat=s,t.isObject=l,t.merge=u,t.mergeDeep=c,t.copyDeep=f},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(2),l=r(u),c=n(9),f=r(c),d=n(10),h=r(d),p=n(7),v=n(1),g=r(v),y=n(0),m=(r(y),n(5)),b=r(m),_=n(3),E=r(_),T=n(4),w=r(T),k=function(e){function t(e,n,r){i(this,t);var o=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o._videoElement=e,o._sourceObj=n,o._config=r,o}return o(t,e),s(t,null,[{key:"isSupported",value:function(){return!0}},{key:"createAdapter",value:function(e,t,n){return new this(e,t,n)}}]),s(t,[{key:"destroy",value:function(){this._sourceObj=null,this._config=null}},{key:"_onTrackChanged",value:function(e){e instanceof b.default?this._trigger(t.CustomEvents.VIDEO_TRACK_CHANGED,{selectedVideoTrack:e}):e instanceof E.default?this._trigger(t.CustomEvents.AUDIO_TRACK_CHANGED,{selectedAudioTrack:e}):e instanceof w.default&&this._trigger(t.CustomEvents.TEXT_TRACK_CHANGED,{selectedTextTrack:e})}},{key:"_trigger",value:function(e,t){this.dispatchEvent(new l.default(e,t))}},{key:"load",value:function(){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"load").getError()}},{key:"selectVideoTrack",value:function(e){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"selectVideoTrack").getError()}},{key:"selectAudioTrack",value:function(e){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"selectAudioTrack").getError()}},{key:"selectTextTrack",value:function(e){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"selectTextTrack").getError()}},{key:"hideTextTrack",value:function(){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"hideTextTrack").getError()}},{key:"enableAdaptiveBitrate",value:function(){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"enableAdaptiveBitrate").getError()}},{key:"src",get:function(){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"get src").getError()}}],[{key:"canPlayType",value:function(e){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"static canPlayType").getError()}}]),t}(f.default);k.CustomEvents=p.CUSTOM_EVENTS,k.getLogger=g.default.getLogger,t.default=k},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0}),t.registerMediaSourceAdapter=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(20),s=r(o),u=n(1),l=r(u),c=function(){function e(){i(this,e)}return a(e,null,[{key:"register",value:function(t){t&&(e._mediaSourceAdapters.includes(t)?e._logger.debug("Adapter <"+t.id+"> is already registered, do not register again"):(e._logger.debug("Adapter <"+t.id+"> has been registered successfully"),e._mediaSourceAdapters.push(t)))}},{key:"unRegister",value:function(t){var n=e._mediaSourceAdapters.indexOf(t);n>-1&&(e._logger.debug("Unregistered <"+t.id+"> adapter"),e._mediaSourceAdapters.splice(n,1))}},{key:"canPlayType",value:function(t){for(var n=e._mediaSourceAdapters,r=0;r<n.length;r++)if(n[r].canPlayType(t))return e._selectedAdapter=n[r],e._logger.debug("Selected adapter is <"+e._selectedAdapter.id+">"),!0;return!1}},{key:"getMediaSourceAdapter",value:function(t,n,r){return t&&n&&r?(e._selectedAdapter||e.canPlayType(n.mimetype),e._selectedAdapter?e._selectedAdapter.createAdapter(t,n,r):null):null}},{key:"destroy",value:function(){e._selectedAdapter=null}}]),e}();c._logger=l.default.getLogger("MediaSourceProvider"),c._mediaSourceAdapters=[s.default],c._selectedAdapter=null,t.default=c;var f=c.register;t.registerMediaSourceAdapter=f},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(8),s=(r(o),n(1)),u=r(s),l=n(11),c=n(6),f=r(c),d=n(10),h=r(d),p=function(){function e(t,n,r){i(this,e),this.name=t,this.player=n,this.eventManager=new f.default,this.logger=u.default.getLogger(this.name),this.config=(0,l.merge)([this.constructor.defaultConfig,r])}return a(e,null,[{key:"createPlugin",value:function(e,t){return new this(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}},{key:"isValid",value:function(){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"isValid()").getError()}}]),a(e,[{key:"getConfig",value:function(e){return e?this.config[e]:this.config}},{key:"updateConfig",value:function(e){this.config=(0,l.merge)([this.config,e])}},{key:"destroy",value:function(){throw new h.default(h.default.TYPE.NOT_IMPLEMENTED_METHOD,"destroy()").getError()}},{key:"getName",value:function(){return this.name}}]),e}();p.defaultConfig={},t.default=p},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0}),t.registerPlugin=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(14),s=r(o),u=n(10),l=r(u),c=n(8),f=(r(c),n(1)),d=r(f),h=d.default.getLogger("PluginManager"),p=function(){function e(){i(this,e),this._plugins=new Map}return a(e,[{key:"load",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e._registry.has(t))throw new l.default(l.default.TYPE.NOT_REGISTERED_PLUGIN,t).getError();var i=e._registry.get(t);return null!=i&&i.isValid()?(this._plugins.set(t,i.createPlugin(t,n,r)),h.debug("Plugin <"+t+"> has been loaded"),!0):(h.debug("Plugin <"+t+"> isn't loaded, isValid()=false"),!1)}},{key:"destroy",value:function(){this._plugins.forEach(this._destroy.bind(this))}},{key:"_destroy",value:function(e,t){e.destroy(),this._plugins.delete(t)}},{key:"get",value:function(e){return this._plugins.get(e)}}],[{key:"register",value:function(t,n){if("function"!=typeof n||n.prototype instanceof s.default==!1)throw new l.default(l.default.TYPE.NOT_VALID_HANDLER).getError();return e._registry.has(t)?(h.debug("Plugin <"+t+"> is already registered, do not register again"),!1):(e._registry.set(t,n),h.debug("Plugin <"+t+"> has been registered successfully"),!0)}},{key:"unRegister",value:function(t){e._registry.has(t)&&(e._registry.delete(t),h.debug("Unregistered <"+t+"> plugin."))}}]),e}();p._registry=new Map,t.default=p;var v=p.register;t.registerPlugin=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={IDLE:"idle",LOADING:"loading",PLAYING:"playing",PAUSED:"paused",BUFFERING:"buffering"};t.default=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e),this._map=new Map}return i(e,[{key:"push",value:function(e,t){if(this._map.has(e)){var n=this._map.get(e);Array.isArray(n)&&(n.push(t),this._map.set(e,n))}else this._map.set(e,[t])}},{key:"set",value:function(e,t){this._map.set(e,t)}},{key:"has",value:function(e){return this._map.has(e)}},{key:"get",value:function(e){var t=this._map.get(e);return t?t.slice():[]}},{key:"getAll",value:function(){var e=[],t=!0,n=!1,r=void 0;try{for(var i,a=this._map.values()[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;e=e.concat(o)}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return e}},{key:"remove",value:function(e,t){if(this._map.has(e)){var n=this._map.get(e);if(Array.isArray(n))for(var r=0;r<n.length;++r)n[r]==t&&(n.splice(r,1),--r)}}},{key:"keys",value:function(){return this._map.keys()}},{key:"clear",value:function(){this._map.clear()}}]),e}();t.default=a},function(e,t){e.exports={name:"playkit-js",version:"0.2.0",main:"dist/playkit.js",scripts:{clean:"rm -rf ./dist",prebuild:"npm run clean","build:prod":"NODE_ENV=production webpack",build:"webpack",dev:"webpack --progress --colors --watch",test:"NODE_ENV=test karma start --color","test:chrome":"NODE_ENV=test karma start --color --browsers Chrome","test:chrome:dots":"NODE_ENV=test karma start --color --browsers Chrome --reporters dots","test:firefox":"NODE_ENV=test karma start --color --browsers Firefox","test:safari":"NODE_ENV=test karma start --color --browsers Safari","test:watch":"NODE_ENV=test karma start --color --auto-watch",start:"webpack-dev-server",release:"npm run build:prod && npm run commit:dist && standard-version",publish:"git push --follow-tags --no-verify origin develop",eslint:"eslint . --color",flow:"flow check","eslint:flow:test":"npm run eslint && npm run flow && npm run test","commit:dist":"git add --all dist && (git commit -m 'chore: update dist' || exit 0)","prepush-msg:build":"echo '\nRunning build before push...\n' && exit 0","prepush-msg:dist":"echo '\nAdding dist files to a seperate commit...\n' && exit 0","prepush-msg:done":"echo '\nPre push tasks are done.\n' && exit 0"},"pre-push":["prepush-msg:build","prebuild","build","build:prod","prepush-msg:dist","commit:dist","prepush-msg:done"],devDependencies:{"babel-cli":"^6.18.0","babel-core":"^6.18.2","babel-eslint":"^7.1.1","babel-loader":"^6.2.7","babel-plugin-istanbul":"^4.0.0","babel-plugin-transform-class-properties":"^6.22.0","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-preset-es2015":"^6.18.0","babel-register":"^6.23.0",chai:"^3.5.0","cross-env":"^3.1.4",eslint:"^3.10.0","eslint-loader":"^1.6.1","eslint-plugin-flowtype":"^2.30.0","eslint-plugin-import":"^2.2.0","eslint-plugin-mocha-no-only":"^0.0.5","flow-bin":"latest",istanbul:"^0.4.5",karma:"^1.5.0","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.0.0","karma-cli":"^1.0.1","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.0.1","karma-ie-launcher":"^1.0.0","karma-mocha":"^1.3.0","karma-safari-launcher":"^1.0.0","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^2.0.2",mocha:"^3.2.0","mocha-cli":"^1.0.1","pre-push":"^0.1.1",sinon:"^2.0.0","sinon-chai":"^2.8.0","standard-version":"^4.0.0","uglifyjs-webpack-plugin":"^0.4.3",webpack:"latest","webpack-dev-server":"latest"},repository:{type:"git",url:"https://github.com/kaltura/playkit-js"},keywords:["kaltura","player","html5 player"],license:"AGPLV3",bugs:{url:"https://github.com/kaltura/playkit-js/issues"},homepage:"https://github.com/kaltura/playkit-js",dependencies:{"js-logger":"^1.3.0"}}},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(9),l=r(u),c=n(2),f=r(c),d=n(6),h=r(d),p=n(7),v=n(13),g=r(v),y=n(5),m=(r(y),n(3)),b=(r(m),n(4)),_=(r(b),function(e){function t(e,n){i(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r._eventManager=new h.default,r._createVideoElement(),r._loadMediaSourceAdapter(e,n),r.attach(),r}return o(t,e),s(t,null,[{key:"createEngine",value:function(e,t){return new this(e,t)}},{key:"canPlayType",value:function(e){return g.default.canPlayType(e)}}]),s(t,[{key:"destroy",value:function(){this.detach(),this._mediaSourceAdapter&&(this._mediaSourceAdapter.destroy(),g.default.destroy()),this._el&&(this.pause(),this._el.removeAttribute("src"),this._el.parentNode&&this._el.parentNode.removeChild(this._el)),this._eventManager.destroy()}},{key:"attach",value:function(){var e=this;for(var t in p.HTML5_EVENTS)!function(t){e._eventManager.listen(e._el,p.HTML5_EVENTS[t],function(){e.dispatchEvent(new f.default(p.HTML5_EVENTS[t]))})}(t);this._mediaSourceAdapter&&(this._eventManager.listen(this._mediaSourceAdapter,p.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED,function(t){e.dispatchEvent(t)}),this._eventManager.listen(this._mediaSourceAdapter,p.CUSTOM_EVENTS.AUDIO_TRACK_CHANGED,function(t){return e.dispatchEvent(t)}),this._eventManager.listen(this._mediaSourceAdapter,p.CUSTOM_EVENTS.TEXT_TRACK_CHANGED,function(t){return e.dispatchEvent(t)}))}},{key:"detach",value:function(){for(var e in p.HTML5_EVENTS)this._eventManager.unlisten(this._el,p.HTML5_EVENTS[e]);this._mediaSourceAdapter&&(this._eventManager.unlisten(this._mediaSourceAdapter,p.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED),this._eventManager.unlisten(this._mediaSourceAdapter,p.CUSTOM_EVENTS.AUDIO_TRACK_CHANGED),this._eventManager.unlisten(this._mediaSourceAdapter,p.CUSTOM_EVENTS.TEXT_TRACK_CHANGED))}},{key:"getVideoElement",value:function(){return this._el}},{key:"_createVideoElement",value:function(){this._el=document.createElement("video"),this._el.style.width="640px",this._el.style.height="360px",this._el.style.backgroundColor="black",this._el.controls=!0,document&&document.body&&document.body.appendChild(this._el)}},{key:"_loadMediaSourceAdapter",value:function(e,t){this._mediaSourceAdapter=g.default.getMediaSourceAdapter(this.getVideoElement(),e,t)}},{key:"selectVideoTrack",value:function(e){this._mediaSourceAdapter&&this._mediaSourceAdapter.selectVideoTrack(e)}},{key:"selectAudioTrack",value:function(e){this._mediaSourceAdapter&&this._mediaSourceAdapter.selectAudioTrack(e)}},{key:"selectTextTrack",value:function(e){this._mediaSourceAdapter&&this._mediaSourceAdapter.selectTextTrack(e)}},{key:"hideTextTrack",value:function(){this._mediaSourceAdapter&&this._mediaSourceAdapter.hideTextTrack()}},{key:"enableAdaptiveBitrate",value:function(){this._mediaSourceAdapter&&this._mediaSourceAdapter.enableAdaptiveBitrate()}},{key:"play",value:function(){return this._el.play()}},{key:"pause",value:function(){return this._el.pause()}},{key:"load",value:function(){return this._mediaSourceAdapter?this._mediaSourceAdapter.load():Promise.resolve({})}},{key:"ready",value:function(){}},{key:"src",set:function(e){this._el.src=e},get:function(){return this._mediaSourceAdapter?this._mediaSourceAdapter.src:""}},{key:"currentTime",get:function(){return this._el.currentTime},set:function(e){this._el.currentTime=e}},{key:"duration",get:function(){return this._el.duration}},{key:"volume",set:function(e){this._el.volume=e},get:function(){return this._el.volume}},{key:"paused",get:function(){return this._el.paused}},{key:"seeking",get:function(){return this._el.seeking}},{key:"seekable",get:function(){return this._el.seekable}},{key:"played",get:function(){return this._el.played}},{key:"buffered",get:function(){return this._el.buffered}},{key:"muted",set:function(e){this._el.muted=e},get:function(){return this._el.muted}},{key:"defaultMuted",get:function(){return this._el.defaultMuted}},{key:"poster",set:function(e){this._el.poster=e},get:function(){return this._el.poster}},{key:"preload",set:function(e){this._el.preload=e},get:function(){return this._el.preload}},{key:"autoplay",set:function(e){this._el.autoplay=e},get:function(){return this._el.autoplay}},{key:"loop",set:function(e){this._el.loop=e},get:function(){return this._el.loop}},{key:"controls",set:function(e){this._el.controls=e},get:function(){return this._el.controls}},{key:"playbackRate",set:function(e){this._el.playbackRate=e},get:function(){return this._el.playbackRate}},{key:"defaultPlaybackRate",set:function(e){this._el.defaultPlaybackRate=e},get:function(){return this._el.defaultPlaybackRate}},{key:"ended",get:function(){return this._el.ended}},{key:"error",get:function(){return this._el.error}},{key:"networkState",get:function(){return this._el.networkState}},{key:"readyState",get:function(){return this._el.readyState}},{key:"videoHeight",get:function(){return this._el.videoHeight}},{key:"videoWidth",get:function(){return this._el.videoWidth}}],[{key:"isSupported",value:function(){try{t.TEST_VID=document.createElement("video"),t.TEST_VID.volume=.5}catch(e){return!1}return!!t.TEST_VID.canPlayType}}]),t}(l.default));_.id="html5",t.default=_},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var o=i.get;if(void 0!==o)return o.call(r)},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(6),c=r(l),f=n(7),d=n(0),h=(r(d),n(5)),p=r(h),v=n(3),g=r(v),y=n(4),m=r(y),b=n(12),_=r(b),E=function(e){function t(e,n,r){i(this,t),t._logger.debug("Creating adapter");var o=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));return o._eventManager=new c.default,o}return o(t,e),u(t,null,[{key:"canPlayType",value:function(e){var n="string"==typeof e&&!!document.createElement("video").canPlayType(e.toLowerCase());return t._logger.debug("canPlayType result for mimeType:"+e+" is "+n.toString()),n}}]),u(t,[{key:"load",value:function(){var e=this;return this._loadPromise||(this._loadPromise=new Promise(function(n,r){e._eventManager.listen(e._videoElement,f.HTML5_EVENTS.LOADED_DATA,function(){e._eventManager.unlisten(e._videoElement,f.HTML5_EVENTS.LOADED_DATA);var r={tracks:e._getParsedTracks()};t._logger.debug("The source has been loaded successfully"),n(r)}),e._eventManager.listen(e._videoElement,f.HTML5_EVENTS.ERROR,function(n){e._eventManager.unlisten(e._videoElement,f.HTML5_EVENTS.ERROR),t._logger.error(n),r(n)}),e._sourceObj&&e._sourceObj.url&&(e._videoElement.src=e._sourceObj.url)})),this._loadPromise}},{key:"destroy",value:function(){t._logger.debug("destroy"),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),this._eventManager.destroy(),this._loadPromise=null}},{key:"_getParsedTracks",value:function(){var e=this._getParsedVideoTracks(),t=this._getParsedAudioTracks(),n=this._getParsedTextTracks();return e.concat(t).concat(n)}},{key:"_getParsedVideoTracks",value:function(){var e=this._videoElement.videoTracks,t=[];if(e)for(var n=0;n<e.length;n++){var r={id:e[n].id,active:e[n].selected,label:e[n].label,language:e[n].language,index:n};t.push(new p.default(r))}return t}},{key:"_getParsedAudioTracks",value:function(){var e=this._videoElement.audioTracks,t=[];if(e)for(var n=0;n<e.length;n++){var r={id:e[n].id,active:e[n].enabled,label:e[n].label,language:e[n].language,index:n};t.push(new g.default(r))}return t}},{key:"_getParsedTextTracks",value:function(){var e=this._videoElement.textTracks,t=[];if(e)for(var n=0;n<e.length;n++){var r={kind:e[n].kind,active:"showing"===e[n].mode,label:e[n].label,language:e[n].language,index:n};t.push(new m.default(r))}return t}},{key:"selectVideoTrack",value:function(e){var t=this._videoElement.videoTracks;e instanceof p.default&&t&&t[e.index]&&(this._disableVideoTracks(),t[e.index].selected=!0,this._onTrackChanged(e))}},{key:"selectAudioTrack",value:function(e){var t=this._videoElement.audioTracks;e instanceof g.default&&t&&t[e.index]&&(this._disableAudioTracks(),t[e.index].enabled=!0,this._onTrackChanged(e))}},{key:"selectTextTrack",value:function(e){var t=this._videoElement.textTracks;e instanceof m.default&&("subtitles"===e.kind||"captions"===e.kind)&&t&&t[e.index]&&(this._disableTextTracks(),t[e.index].mode="showing",this._onTrackChanged(e))}},{key:"hideTextTrack",value:function(){this._disableTextTracks()}},{key:"enableAdaptiveBitrate",value:function(){t._logger.debug("Enabling adaptive bitrate not supported")}},{key:"_disableVideoTracks",value:function(){var e=this._videoElement.videoTracks;if(e)for(var t=0;t<e.length;t++)e[t].selected=!1}},{key:"_disableAudioTracks",value:function(){var e=this._videoElement.audioTracks;if(e)for(var t=0;t<e.length;t++)e[t].enabled=!1}},{key:"_disableTextTracks",value:function(){var e=this._videoElement.textTracks;if(e)for(var t=0;t<e.length;t++)e[t].mode="disabled"}},{key:"src",get:function(){return this._videoElement.src}}]),t}(_.default);E.id="NativeAdapter",E._logger=_.default.getLogger(E.id),t.default=E},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new o.default(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=t.TextTrack=t.AudioTrack=t.VideoTrack=t.Track=t.BasePlugin=t.registerPlugin=t.BaseMediaSourceAdapter=t.registerMediaSourceAdapter=void 0,t.playkit=i;var a=n(8),o=r(a),s=n(1),u=r(s),l=n(18),c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(l),f=n(12),d=r(f),h=n(13),p=n(15),v=n(14),g=r(v),y=n(0),m=r(y),b=n(5),_=r(b),E=n(3),T=r(E),w=n(4),k=r(w),S=c.version;u.default.getLogger().log("%c Playkit "+S,"color: yellow; font-size: large"),u.default.getLogger().log("%c For more details see https://github.com/kaltura/playkit-js","color: yellow;"),t.registerMediaSourceAdapter=h.registerMediaSourceAdapter,t.BaseMediaSourceAdapter=d.default,t.registerPlugin=p.registerPlugin,t.BasePlugin=g.default,t.Track=m.default,t.VideoTrack=_.default,t.AudioTrack=T.default,t.TextTrack=k.default,t.VERSION=S,t.default=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(8),u=(r(s),n(6)),l=r(u),c=n(23),f=r(c),d=n(16),h=r(d),p=n(7),v=n(2),g=r(v),y=n(1),m=r(y),b=function(){function e(t){var n,r,o,s,u,c,d=this;a(this,e),this._transitions=(c={},i(c,h.default.IDLE,(n={},i(n,p.HTML5_EVENTS.LOAD_START,function(){d._updateState(h.default.LOADING),d._dispatchEvent()}),i(n,p.HTML5_EVENTS.PLAY,function(){d._updateState(h.default.BUFFERING),d._dispatchEvent()}),n)),i(c,h.default.LOADING,(r={},i(r,p.HTML5_EVENTS.LOADED_METADATA,function(){d._player.config.autoPlay?d._updateState(h.default.PLAYING):d._updateState(h.default.PAUSED),d._dispatchEvent()}),i(r,p.HTML5_EVENTS.ERROR,function(){d._updateState(h.default.IDLE),d._dispatchEvent()}),r)),i(c,h.default.PAUSED,(o={},i(o,p.HTML5_EVENTS.PLAY,function(){d._updateState(h.default.PLAYING),d._dispatchEvent()}),i(o,p.HTML5_EVENTS.PLAYING,function(){d._updateState(h.default.PLAYING),d._dispatchEvent()}),i(o,p.HTML5_EVENTS.ENDED,function(){d._updateState(h.default.IDLE),d._dispatchEvent()}),o)),i(c,h.default.PLAYING,(s={},i(s,p.HTML5_EVENTS.PAUSE,function(){d._updateState(h.default.PAUSED),d._dispatchEvent()}),i(s,p.HTML5_EVENTS.WAITING,function(){d._updateState(h.default.BUFFERING),d._dispatchEvent()}),i(s,p.HTML5_EVENTS.ENDED,function(){d._updateState(h.default.IDLE),d._dispatchEvent()}),i(s,p.HTML5_EVENTS.ERROR,function(){d._updateState(h.default.IDLE),d._dispatchEvent()}),s)),i(c,h.default.BUFFERING,(u={},i(u,p.HTML5_EVENTS.PLAYING,function(){d._updateState(h.default.PLAYING),d._dispatchEvent()}),i(u,p.HTML5_EVENTS.PAUSE,function(){d._updateState(h.default.PAUSED),d._dispatchEvent()}),u)),c),this._player=t,this._logger=m.default.getLogger("StateManager"),this._eventManager=new l.default,this._history=[],this._prevState=null,this._curState=new f.default(h.default.IDLE),this._attachListeners()}return o(e,[{key:"_attachListeners",value:function(){this._eventManager.listen(this._player,p.HTML5_EVENTS.ERROR,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.ENDED,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.PLAY,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.LOAD_START,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.PLAYING,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.LOADED_METADATA,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.PAUSE,this._doTransition.bind(this)),this._eventManager.listen(this._player,p.HTML5_EVENTS.WAITING,this._doTransition.bind(this))}},{key:"_doTransition",value:function(e){this._logger.debug("Do transition request",e);var t=this._transitions[this._curState.type];"function"==typeof t[e.type]&&t[e.type]()}},{key:"_updateState",value:function(e){this._curState.type!==e&&(this._curState.duration=Date.now()/1e3,this._history.push(this._curState),this._prevState=this._curState,this._curState=new f.default(e),this._logger.debug("Switch player state: from "+this._prevState.type+" to "+this._curState.type))}},{key:"_dispatchEvent",value:function(){var e=new g.default(p.CUSTOM_EVENTS.PLAYER_STATE_CHANGED,{oldState:this._prevState,newState:this._curState});this._player.dispatchEvent(e)}},{key:"destroy",value:function(){this._history=[],this._eventManager.destroy()}},{key:"currentState",get:function(){return this._curState}},{key:"previousState",get:function(){return this._prevState}},{key:"history",get:function(){return this._history}}]),e}();t.default=b},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t){r(this,e),this.type=t,this._duration=0,this._timestamp=Date.now()/1e3}return i(e,[{key:"duration",get:function(){return this._duration},set:function(e){this._duration=e-this._timestamp}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={VIDEO:"video",AUDIO:"audio",TEXT:"text"};t.default=r},function(e,t,n){var r,i;/*! * js-logger - http://github.com/jonnyreeves/js-logger * Jonny Reeves, http://jonnyreeves.co.uk/ * js-logger may be freely distributed under the MIT license. */ -!function(a){"use strict";var o={};o.VERSION="1.3.0";var s,u={},l=function(e,t){return function(){return t.apply(e,arguments)}},c=function(){var e,t,n=arguments,r=n[0];for(t=1;t<n.length;t++)for(e in n[t])e in r||!n[t].hasOwnProperty(e)||(r[e]=n[t][e]);return r},f=function(e,t){return{value:e,name:t}};o.DEBUG=f(1,"DEBUG"),o.INFO=f(2,"INFO"),o.TIME=f(3,"TIME"),o.WARN=f(4,"WARN"),o.ERROR=f(8,"ERROR"),o.OFF=f(99,"OFF");var d=function(e){this.context=e,this.setLevel(e.filterLevel),this.log=this.info};d.prototype={setLevel:function(e){e&&"value"in e&&(this.context.filterLevel=e)},enabledFor:function(e){var t=this.context.filterLevel;return e.value>=t.value},debug:function(){this.invoke(o.DEBUG,arguments)},info:function(){this.invoke(o.INFO,arguments)},warn:function(){this.invoke(o.WARN,arguments)},error:function(){this.invoke(o.ERROR,arguments)},time:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"start"])},timeEnd:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"end"])},invoke:function(e,t){s&&this.enabledFor(e)&&s(t,c({level:e},this.context))}};var h=new d({filterLevel:o.OFF});!function(){var e=o;e.enabledFor=l(h,h.enabledFor),e.debug=l(h,h.debug),e.time=l(h,h.time),e.timeEnd=l(h,h.timeEnd),e.info=l(h,h.info),e.warn=l(h,h.warn),e.error=l(h,h.error),e.log=e.info}(),o.setHandler=function(e){s=e},o.setLevel=function(e){h.setLevel(e);for(var t in u)u.hasOwnProperty(t)&&u[t].setLevel(e)},o.get=function(e){return u[e]||(u[e]=new d(c({name:e},h.context)))},o.createDefaultHandler=function(e){e=e||{},e.formatter=e.formatter||function(e,t){t.name&&e.unshift("["+t.name+"]")};var t={},n=function(e,t){Function.prototype.apply.call(e,console,t)};return"undefined"==typeof console?function(){}:function(r,i){r=Array.prototype.slice.call(r);var a,s=console.log;i.level===o.TIME?(a=(i.name?"["+i.name+"] ":"")+r[0],"start"===r[1]?console.time?console.time(a):t[a]=(new Date).getTime():console.timeEnd?console.timeEnd(a):n(s,[a+": "+((new Date).getTime()-t[a])+"ms"])):(i.level===o.WARN&&console.warn?s=console.warn:i.level===o.ERROR&&console.error?s=console.error:i.level===o.INFO&&console.info&&(s=console.info),e.formatter(r,i),n(s,r))}},o.useDefaults=function(e){o.setLevel(e&&e.defaultLevel||o.DEBUG),o.setHandler(o.createDefaultHandler(e))},r=o,void 0!==(i="function"==typeof r?r.call(t,n,t,e):r)&&(e.exports=i)}()}])})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.PlaykitUI=t.OvpProvider=t.Playkit=void 0;var i=n(0),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(i),o=n(2),s=r(o),u=n(3),l=r(u);n(4),n(9),n(11),t.Playkit=a,t.OvpProvider=s.default,t.PlaykitUI=l.default},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=24)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map;r(this,e),this.headers=t,this.headers.set("Content-Type","application/json")}return a(e,[{key:"getUrl",value:function(){if(!this.baseUrl)throw new Error("baseUrl is mandatory for request builder");return this.baseUrl+"/service/"+this.service+(this.action?"/action/"+this.action:"")}},{key:"doHttpRequest",value:function(){var e=this,t=new XMLHttpRequest;return new Promise(function(n,r){t.onreadystatechange=function(){if(4===t.readyState)if(200===t.status){var e=JSON.parse(t.responseText);e&&"object"===(void 0===e?"undefined":i(e))&&e.code&&e.message?r(e):n(e)}else r(t.responseText)},t.open(e.method,e.getUrl()),e.headers.forEach(function(e,n){t.setRequestHeader(n,e)}),t.send(e.params)})}}]),e}();t.default=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a={beUrl:"http://www.kaltura.com/api_v3",baseUrl:"https://cdnapisec.kaltura.com",serviceParams:{clientTag:"playkit-js",apiVersion:"3.3.0",format:1}},o=function(){function e(){r(this,e)}return i(e,null,[{key:"set",value:function(e){e&&Object.assign(a,e)}},{key:"get",value:function(){return a}}]),e}();t.default=o,t.Configuration=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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}),t.UIConfCreationMode=t.UIConfType=t.MediaEntryType=t.MediaType=t.EntryType=t.EntryModerationStatus=t.EntryStatus=t.MetadataStatus=t.MetadataObjectType=t.Status=t.KalturaRuleActionType=t.Scheme=void 0;var o=n(16);(t.Scheme=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({PLAYREADY_CENC:"drm.PLAYREADY_CENC",WIDEVINE_CENC:"drm.WIDEVINE_CENC",FAIRPLAY:"fairplay.FAIRPLAY",PLAYREADY:"playReady.PLAYREADY",WIDEVINE:"widevine.WIDEVINE"}),(t.KalturaRuleActionType=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({DRM_POLICY:"drm.DRM_POLICY",BLOCK:1,PREVIEW:2,LIMIT_FLAVORS:3,ADD_TO_STORAGE:4,LIMIT_DELIVERY_PROFILES:5,SERVE_FROM_REMOTE_SERVER:6,REQUEST_HOST_REGEX:7,LIMIT_THUMBNAIL_CAPTURE:8}),(t.Status=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({ERROR:-1,QUEUED:0,CONVERTING:1,READY:2,DELETED:3,NOT_APPLICABLE:4,TEMP:5,WAIT_FOR_CONVERT:6,IMPORTING:7,VALIDATING:8,EXPORTING:9}),(t.MetadataObjectType=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({AD_CUE_POINT:"adCuePointMetadata.AdCuePoint",ANNOTATION:"annotationMetadata.Annotation",CODE_CUE_POINT:"codeCuePointMetadata.CodeCuePoint",THUMB_CUE_POINT:"thumbCuePointMetadata.thumbCuePoint",ENTRY:1,CATEGORY:2,USER:3,PARTNER:4,DYNAMIC_OBJECT:5}),(t.MetadataStatus=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({VALID:1,INVALID:2,DELETED:3}),(t.EntryStatus=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({ERROR_IMPORTING:-2,ERROR_CONVERTING:-1,SCAN_FAILURE:"virusScan.ScanFailure",IMPORT:0,INFECTED:"virusScan.Infected",PRECONVERT:1,READY:2,DELETED:3,PENDING:4,MODERATE:5,BLOCKED:6,NO_CONTENT:7}),(t.EntryModerationStatus=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({PENDING_MODERATION:1,APPROVED:2,REJECTED:3,FLAGGED_FOR_REVIEW:4,MODERATE:5,AUTO_APPROVED:6}),(t.EntryType=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({AUTOMATIC:{value:-1},EXTERNAL_MEDIA:{value:"externalMedia.externalMedia"},MEDIA_CLIP:{value:1},MIX:{value:2},PLAYLIST:{value:5},DATA:{value:6},LIVE_STREAM:{value:7},LIVE_CHANNEL:{value:8},DOCUMENT:{value:10}}),(t.MediaType=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({VIDEO:{value:1},IMAGE:{value:2},AUDIO:{value:5},LIVE_STREAM_FLASH:{value:201},LIVE_STREAM_WINDOWS_MEDIA:{value:202},LIVE_STREAM_REAL_MEDIA:{value:203},LIVE_STREAM_QUICKTIME:{value:204}}),(t.MediaEntryType=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum(["Vod","Live","Image","Audio","Unknown"]),(t.UIConfType=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({PLAYER:1,CONTRIBUTION_WIZARD:2,SIMPLE_EDITOR:3,ADVANCED_EDITOR:4,PLAYLIST:5,APP_STUDIO:6,KRECORD:7,PLAYER_V3:8,KMC_ACCOUNT:9,KMC_ANALYTICS:10,KMC_CONTENT:11,KMC_DASHBOARD:12,KMC_LOGIN:13,PLAYER_SL:14,CLIENTSIDE_ENCODER:15,KMC_GENERAL:16,KMC_ROLES_AND_PERMISSIONS:17,CLIPPER:18,KSR:19,KUPLOAD:20,WEBCASTING:21}),(t.UIConfCreationMode=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({WIZARD:2,ADVANCED:3})},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(6),s=r(o),u=n(1),l=r(u),c=l.default.get(),f=function(){function e(){i(this,e)}return a(e,null,[{key:"getMultirequest",value:function(e,t){var n=c.serviceParams;Object.assign(n,{ks:e}),t&&Object.assign(n,{partnerId:t});var r=new s.default;return r.method="POST",r.service="multirequest",r.baseUrl=c.beUrl,r.params=n,r}}]),e}();t.default=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function e(t){r(this,e),this.hasError=!1,"KalturaAPIException"===t.objectType?(this.hasError=!0,this.error=new a(t.code,t.message)):this.data=t};t.default=i;var a=function e(t,n){r(this,e),this.code=t,this.message=n}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.LOG_LEVEL=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(8),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),s=function(){function e(t){r(this,e),o.useDefaults(t||{})}return i(e,[{key:"get",value:function(e){return e?o.get(e):o}}]),e}(),u=new s({defaultLevel:o.DEBUG}),l={DEBUG:o.DEBUG,INFO:o.INFO,TIME:o.TIME,WARN:o.WARN,ERROR:o.ERROR,OFF:o.OFF};t.default=u,t.LOG_LEVEL=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.MultiRequestResult=void 0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=r(l),f=n(4),d=r(f),h=n(5),p=r(h),v=p.default.get("OvpProvider"),y=function(e){function t(){a(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requests=[],e}return s(t,e),u(t,[{key:"add",value:function(e){this.requests.push(e);var t={},n={service:e.service,action:e.action};return Object.assign(t,i({},this.requests.length,Object.assign(n,e.params))),Object.assign(t,this.params),this.params=t,this}},{key:"execute",value:function(){var e=this;try{this.params=JSON.stringify(this.params)}catch(e){v.error(""+e.message)}return new Promise(function(t,n){e.doHttpRequest().then(function(e){t(new g(e))},function(e){n("Error on multiRequest execution, error <"+e+">.")})})}}]),t}(c.default);t.default=y;var g=t.MultiRequestResult=function e(t){var n=this;a(this,e),this.results=[],this.success=!0,t.forEach(function(e){var t=new d.default(e);if(n.results.push(t),t.hasError)return v.error("Service returned an error with error code: "+t.error.code+" and message: "+t.error.message+"."),void(n.success=!1)})}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=n(10),a=(function(e){e&&e.__esModule}(i),function e(){r(this,e)});t.default=a},function(e,t,n){var r,i;/*! +!function(a){"use strict";var o={};o.VERSION="1.3.0";var s,u={},l=function(e,t){return function(){return t.apply(e,arguments)}},c=function(){var e,t,n=arguments,r=n[0];for(t=1;t<n.length;t++)for(e in n[t])e in r||!n[t].hasOwnProperty(e)||(r[e]=n[t][e]);return r},f=function(e,t){return{value:e,name:t}};o.DEBUG=f(1,"DEBUG"),o.INFO=f(2,"INFO"),o.TIME=f(3,"TIME"),o.WARN=f(4,"WARN"),o.ERROR=f(8,"ERROR"),o.OFF=f(99,"OFF");var d=function(e){this.context=e,this.setLevel(e.filterLevel),this.log=this.info};d.prototype={setLevel:function(e){e&&"value"in e&&(this.context.filterLevel=e)},enabledFor:function(e){var t=this.context.filterLevel;return e.value>=t.value},debug:function(){this.invoke(o.DEBUG,arguments)},info:function(){this.invoke(o.INFO,arguments)},warn:function(){this.invoke(o.WARN,arguments)},error:function(){this.invoke(o.ERROR,arguments)},time:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"start"])},timeEnd:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"end"])},invoke:function(e,t){s&&this.enabledFor(e)&&s(t,c({level:e},this.context))}};var h=new d({filterLevel:o.OFF});!function(){var e=o;e.enabledFor=l(h,h.enabledFor),e.debug=l(h,h.debug),e.time=l(h,h.time),e.timeEnd=l(h,h.timeEnd),e.info=l(h,h.info),e.warn=l(h,h.warn),e.error=l(h,h.error),e.log=e.info}(),o.setHandler=function(e){s=e},o.setLevel=function(e){h.setLevel(e);for(var t in u)u.hasOwnProperty(t)&&u[t].setLevel(e)},o.get=function(e){return u[e]||(u[e]=new d(c({name:e},h.context)))},o.createDefaultHandler=function(e){e=e||{},e.formatter=e.formatter||function(e,t){t.name&&e.unshift("["+t.name+"]")};var t={},n=function(e,t){Function.prototype.apply.call(e,console,t)};return"undefined"==typeof console?function(){}:function(r,i){r=Array.prototype.slice.call(r);var a,s=console.log;i.level===o.TIME?(a=(i.name?"["+i.name+"] ":"")+r[0],"start"===r[1]?console.time?console.time(a):t[a]=(new Date).getTime():console.timeEnd?console.timeEnd(a):n(s,[a+": "+((new Date).getTime()-t[a])+"ms"])):(i.level===o.WARN&&console.warn?s=console.warn:i.level===o.ERROR&&console.error?s=console.error:i.level===o.INFO&&console.info&&(s=console.info),e.formatter(r,i),n(s,r))}},o.useDefaults=function(e){o.setLevel(e&&e.defaultLevel||o.DEBUG),o.setHandler(o.createDefaultHandler(e))},r=o,void 0!==(i="function"==typeof r?r.call(t,n,t,e):r)&&(e.exports=i)}()},function(e,t){e.exports={playback:{preload:"none",autoplay:!1,muted:!1,streamPriority:[{engine:"html5",format:"hls"},{engine:"html5",format:"dash"},{engine:"html5",format:"progressive"}]},plugins:{}}}])})},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=25)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map;r(this,e),this.headers=t,this.headers.set("Content-Type","application/json")}return a(e,[{key:"getUrl",value:function(){if(!this.baseUrl)throw new Error("baseUrl is mandatory for request builder");return this.baseUrl+"/service/"+this.service+(this.action?"/action/"+this.action:"")}},{key:"doHttpRequest",value:function(){var e=this,t=new XMLHttpRequest;return new Promise(function(n,r){t.onreadystatechange=function(){if(4===t.readyState)if(200===t.status){var e=JSON.parse(t.responseText);e&&"object"===(void 0===e?"undefined":i(e))&&e.code&&e.message?r(e):n(e)}else r(t.responseText)},t.open(e.method,e.getUrl()),e.headers.forEach(function(e,n){t.setRequestHeader(n,e)}),t.send(e.params)})}}]),e}();t.default=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a={beUrl:"http://www.kaltura.com/api_v3",baseUrl:"https://cdnapisec.kaltura.com",serviceParams:{clientTag:"playkit-js",apiVersion:"3.3.0",format:1}},o=function(){function e(){r(this,e)}return i(e,null,[{key:"set",value:function(e){e&&Object.assign(a,e)}},{key:"get",value:function(){return a}}]),e}();t.default=o,t.Configuration=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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}),t.UIConfCreationMode=t.UIConfType=t.MediaEntryType=t.MediaType=t.EntryType=t.EntryModerationStatus=t.EntryStatus=t.MetadataStatus=t.MetadataObjectType=t.Status=t.KalturaRuleActionType=t.Scheme=void 0;var o=n(18);(t.Scheme=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({PLAYREADY_CENC:"drm.PLAYREADY_CENC",WIDEVINE_CENC:"drm.WIDEVINE_CENC",FAIRPLAY:"fairplay.FAIRPLAY",PLAYREADY:"playReady.PLAYREADY",WIDEVINE:"widevine.WIDEVINE"}),(t.KalturaRuleActionType=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({DRM_POLICY:"drm.DRM_POLICY",BLOCK:1,PREVIEW:2,LIMIT_FLAVORS:3,ADD_TO_STORAGE:4,LIMIT_DELIVERY_PROFILES:5,SERVE_FROM_REMOTE_SERVER:6,REQUEST_HOST_REGEX:7,LIMIT_THUMBNAIL_CAPTURE:8}),(t.Status=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({ERROR:-1,QUEUED:0,CONVERTING:1,READY:2,DELETED:3,NOT_APPLICABLE:4,TEMP:5,WAIT_FOR_CONVERT:6,IMPORTING:7,VALIDATING:8,EXPORTING:9}),(t.MetadataObjectType=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({AD_CUE_POINT:"adCuePointMetadata.AdCuePoint",ANNOTATION:"annotationMetadata.Annotation",CODE_CUE_POINT:"codeCuePointMetadata.CodeCuePoint",THUMB_CUE_POINT:"thumbCuePointMetadata.thumbCuePoint",ENTRY:1,CATEGORY:2,USER:3,PARTNER:4,DYNAMIC_OBJECT:5}),(t.MetadataStatus=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({VALID:1,INVALID:2,DELETED:3}),(t.EntryStatus=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({ERROR_IMPORTING:-2,ERROR_CONVERTING:-1,SCAN_FAILURE:"virusScan.ScanFailure",IMPORT:0,INFECTED:"virusScan.Infected",PRECONVERT:1,READY:2,DELETED:3,PENDING:4,MODERATE:5,BLOCKED:6,NO_CONTENT:7}),(t.EntryModerationStatus=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({PENDING_MODERATION:1,APPROVED:2,REJECTED:3,FLAGGED_FOR_REVIEW:4,MODERATE:5,AUTO_APPROVED:6}),(t.EntryType=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({AUTOMATIC:{value:-1},EXTERNAL_MEDIA:{value:"externalMedia.externalMedia"},MEDIA_CLIP:{value:1},MIX:{value:2},PLAYLIST:{value:5},DATA:{value:6},LIVE_STREAM:{value:7},LIVE_CHANNEL:{value:8},DOCUMENT:{value:10}}),(t.MediaType=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({VIDEO:{value:1},IMAGE:{value:2},AUDIO:{value:5},LIVE_STREAM_FLASH:{value:201},LIVE_STREAM_WINDOWS_MEDIA:{value:202},LIVE_STREAM_REAL_MEDIA:{value:203},LIVE_STREAM_QUICKTIME:{value:204}}),(t.MediaEntryType=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum(["Vod","Live","Image","Audio","Unknown"]),(t.UIConfType=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({PLAYER:1,CONTRIBUTION_WIZARD:2,SIMPLE_EDITOR:3,ADVANCED_EDITOR:4,PLAYLIST:5,APP_STUDIO:6,KRECORD:7,PLAYER_V3:8,KMC_ACCOUNT:9,KMC_ANALYTICS:10,KMC_CONTENT:11,KMC_DASHBOARD:12,KMC_LOGIN:13,PLAYER_SL:14,CLIENTSIDE_ENCODER:15,KMC_GENERAL:16,KMC_ROLES_AND_PERMISSIONS:17,CLIPPER:18,KSR:19,KUPLOAD:20,WEBCASTING:21}),(t.UIConfCreationMode=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({WIZARD:2,ADVANCED:3})},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(6),s=r(o),u=n(1),l=r(u),c=l.default.get(),f=function(){function e(){i(this,e)}return a(e,null,[{key:"getMultirequest",value:function(e,t){var n=c.serviceParams;Object.assign(n,{ks:e}),t&&Object.assign(n,{partnerId:t});var r=new s.default;return r.method="POST",r.service="multirequest",r.baseUrl=c.beUrl,r.params=n,r}}]),e}();t.default=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function e(t){r(this,e),this.hasError=!1,"KalturaAPIException"===t.objectType?(this.hasError=!0,this.error=new a(t.code,t.message)):this.data=t};t.default=i;var a=function e(t,n){r(this,e),this.code=t,this.message=n}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.LOG_LEVEL=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(8),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),s=function(){function e(t){r(this,e),o.useDefaults(t||{})}return i(e,[{key:"get",value:function(e){return e?o.get(e):o}}]),e}(),u=new s({defaultLevel:o.DEBUG}),l={DEBUG:o.DEBUG,INFO:o.INFO,TIME:o.TIME,WARN:o.WARN,ERROR:o.ERROR,OFF:o.OFF};t.default=u,t.LOG_LEVEL=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.MultiRequestResult=void 0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=r(l),f=n(4),d=r(f),h=n(5),p=r(h),v=p.default.get("OvpProvider"),g=function(e){function t(){a(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.requests=[],e}return s(t,e),u(t,[{key:"add",value:function(e){this.requests.push(e);var t={},n={service:e.service,action:e.action};return Object.assign(t,i({},this.requests.length,Object.assign(n,e.params))),Object.assign(t,this.params),this.params=t,this}},{key:"execute",value:function(){var e=this;try{this.params=JSON.stringify(this.params)}catch(e){v.error(""+e.message)}return new Promise(function(t,n){e.doHttpRequest().then(function(e){t(new y(e))},function(e){n("Error on multiRequest execution, error <"+e+">.")})})}}]),t}(c.default);t.default=g;var y=t.MultiRequestResult=function e(t){var n=this;a(this,e),this.results=[],this.success=!0,t.forEach(function(e){var t=new d.default(e);if(n.results.push(t),t.hasError)return v.error("Service returned an error with error code: "+t.error.code+" and message: "+t.error.message+"."),void(n.success=!1)})}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(12),o=(function(e){e&&e.__esModule}(a),n(11),function(){function e(){r(this,e),this.progressive=[],this.dash=[],this.hls=[]}return i(e,[{key:"map",value:function(e,t){if(t)switch(t.name){case"mp4":this.progressive.push(e);break;case"dash":this.dash.push(e);break;case"hls":this.hls.push(e)}}}]),e}());t.default=o},function(e,t,n){var r,i;/*! * js-logger - http://github.com/jonnyreeves/js-logger * Jonny Reeves, http://jonnyreeves.co.uk/ * js-logger may be freely distributed under the MIT license. */ -!function(a){"use strict";var o={};o.VERSION="1.3.0";var s,u={},l=function(e,t){return function(){return t.apply(e,arguments)}},c=function(){var e,t,n=arguments,r=n[0];for(t=1;t<n.length;t++)for(e in n[t])e in r||!n[t].hasOwnProperty(e)||(r[e]=n[t][e]);return r},f=function(e,t){return{value:e,name:t}};o.DEBUG=f(1,"DEBUG"),o.INFO=f(2,"INFO"),o.TIME=f(3,"TIME"),o.WARN=f(4,"WARN"),o.ERROR=f(8,"ERROR"),o.OFF=f(99,"OFF");var d=function(e){this.context=e,this.setLevel(e.filterLevel),this.log=this.info};d.prototype={setLevel:function(e){e&&"value"in e&&(this.context.filterLevel=e)},enabledFor:function(e){var t=this.context.filterLevel;return e.value>=t.value},debug:function(){this.invoke(o.DEBUG,arguments)},info:function(){this.invoke(o.INFO,arguments)},warn:function(){this.invoke(o.WARN,arguments)},error:function(){this.invoke(o.ERROR,arguments)},time:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"start"])},timeEnd:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"end"])},invoke:function(e,t){s&&this.enabledFor(e)&&s(t,c({level:e},this.context))}};var h=new d({filterLevel:o.OFF});!function(){var e=o;e.enabledFor=l(h,h.enabledFor),e.debug=l(h,h.debug),e.time=l(h,h.time),e.timeEnd=l(h,h.timeEnd),e.info=l(h,h.info),e.warn=l(h,h.warn),e.error=l(h,h.error),e.log=e.info}(),o.setHandler=function(e){s=e},o.setLevel=function(e){h.setLevel(e);for(var t in u)u.hasOwnProperty(t)&&u[t].setLevel(e)},o.get=function(e){return u[e]||(u[e]=new d(c({name:e},h.context)))},o.createDefaultHandler=function(e){e=e||{},e.formatter=e.formatter||function(e,t){t.name&&e.unshift("["+t.name+"]")};var t={},n=function(e,t){Function.prototype.apply.call(e,console,t)};return"undefined"==typeof console?function(){}:function(r,i){r=Array.prototype.slice.call(r);var a,s=console.log;i.level===o.TIME?(a=(i.name?"["+i.name+"] ":"")+r[0],"start"===r[1]?console.time?console.time(a):t[a]=(new Date).getTime():console.timeEnd?console.timeEnd(a):n(s,[a+": "+((new Date).getTime()-t[a])+"ms"])):(i.level===o.WARN&&console.warn?s=console.warn:i.level===o.ERROR&&console.error?s=console.error:i.level===o.INFO&&console.info&&(s=console.info),e.formatter(r,i),n(s,r))}},o.useDefaults=function(e){o.setLevel(e&&e.defaultLevel||o.DEBUG),o.setHandler(o.createDefaultHandler(e))},r=o,void 0!==(i="function"==typeof r?r.call(t,n,t,e):r)&&(e.exports=i)}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),a=(function(e){e&&e.__esModule}(i),n(2)),o=function e(){r(this,e),this.metaData=new Map,this.type=a.MediaEntryType.Unknown};t.default=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=(n(2),function e(t,n){r(this,e),this.licenseUrl=t,this.scheme=n});t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=(n(2),function e(t){r(this,e),this.id=t.id,this.flavorParamsId=t.flavorParamsId,this.fileExt=t.fileExt,this.bitrate=t.bitrate,this.width=t.width,this.height=t.height,this.id=t.id,this.frameRate=t.frameRate,this.isOriginal=t.isOriginal,this.isWeb=t.isWeb,this.containerFormat=t.containerFormat,this.videoCodecId=t.videoCodecId,this.status=t.status,this.language=t.language,this.label=t.label});t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=(n(2),function e(t){r(this,e),this.id=t.id,this.name=t.name,this.dataUrl=t.dataUrl,this.type=t.type,this.entryType=t.mediaType,this.flavorParamsIds=t.flavorParamsIds,this.duration=t.duration});t.default=i},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=n(4),u=r(s),l=n(29),c=r(l),f=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.hasError||(n.totalCount=e.totalCount,n.totalCount>0&&(n.metas=[],e.objects.map(function(e){return n.metas.push(new c.default(e))}))),n}return o(t,e),t}(u.default);t.default=f},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=n(4),u=r(s),l=n(26),c=r(l),f=n(15),d=r(f),h=n(30),p=r(h),v=n(11),y=r(v),g=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if(n.sources=[],n.actions=[],n.messages=[],n.flavorAssets=[],!n.hasError){var r=e.messages;r&&r.map(function(e){return n.messages.push(new c.default(e))});var o=e.actions;o&&o.map(function(e){return n.actions.push(new p.default(e))});var s=e.sources;s&&s.map(function(e){return n.sources.push(new d.default(e))});var u=e.flavorAssets;u&&u.map(function(e){return n.flavorAssets.push(new y.default(e))})}return n}return o(t,e),t}(u.default);t.default=g},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(28),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(){function e(t){var n=this;r(this,e),this.drm=[],this.format=t.format,this.deliveryProfileId=t.deliveryProfileId,this.url=t.url,this.protocols=t.protocols,this.flavorIds=t.flavorIds,t.drm&&t.drm.map(function(e){return n.drm.push(new o.default(e))})}return i(e,[{key:"hasDrmData",value:function(){return this.drm&&this.drm.length>0}},{key:"hasFlavorIds",value:function(){return!!this.flavorIds&&this.flavorIds.length>0}},{key:"getProtocol",value:function(e){var t="";if(this.protocols&&this.protocols.length>0){this.protocols.split(",").forEach(function(n){n==e&&(t=n)})}else if("http"==e)return e;return t}}]),e}();t.default=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){var n=!0,r=!1,i=void 0;try{for(var a,o=Object.getOwnPropertyNames(t)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value,u=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,u)}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}return e}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0}),t.copyProperties=i;var s=Symbol();t.Enum=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?void 0:arguments[0];if(r(this,e),{}.hasOwnProperty.call(this.constructor,s))throw new Error("Enum classes can’t be instantiated");"object"===(void 0===t?"undefined":a(t))&&null!==t&&i(this,t)}return o(e,[{key:"toString",value:function(){return this.constructor.name+"."+this.name}}],[{key:"initEnum",value:function(e){return Object.defineProperty(this,"enumValues",{value:[],configurable:!1,writable:!1,enumerable:!0}),Array.isArray(e)?this._enumValuesFromArray(e):this._enumValuesFromObject(e),Object.freeze(this.enumValues),this[s]=!0,this}},{key:"_enumValuesFromArray",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;this._pushEnumValue(new this,o)}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}},{key:"_enumValuesFromObject",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,a=Object.keys(e)[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value,s=new this(e[o]);this._pushEnumValue(s,o)}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}},{key:"_pushEnumValue",value:function(e,t){e.name=t,e.ordinal=this.enumValues.length,Object.defineProperty(this,t,{value:e,configurable:!1,writable:!1,enumerable:!0}),this.enumValues.push(e)}},{key:"enumValueOf",value:function(e){return this.enumValues.find(function(t){return t.name===e})}},{key:Symbol.iterator,value:function(){return this.enumValues[Symbol.iterator]()}}]),e}()},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(3),s=r(o),u=n(6),l=(r(u),function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";i(this,e),this._loaders=new Map,this._multiRequest=s.default.getMultirequest(n,t)}return a(e,[{key:"add",value:function(t,n){var r=this,i=new t(n);if(i.isValid()){this._loaders.set(t.name,i);var a=this._multiRequest.requests.length,o=i.requests;o.forEach(function(e){r._multiRequest.add(e)});var s=Array.from(new Array(o.length),function(e,t){return t+a});e._loadersResponseMap.set(t.name,s)}}},{key:"fetchData",value:function(){var e=this;return new Promise(function(t,n){e._multiRequest.execute().then(function(r){if(e._multiResponse=r,r.success){var i=e.prepareData(r);i.success?t(e._loaders):n({success:!1,data:i.error})}else n(r)},function(e){n(e)})})}},{key:"prepareData",value:function(t){return this._loaders.forEach(function(n,r){var i=e._loadersResponseMap.get(r);try{null!=i&&(n.response=t.results.slice(i[0],i[i.length-1]+1))}catch(e){return{success:!1,error:e}}}),{success:!0,data:this._loaders}}}]),e}());l._loadersResponseMap=new Map,t.default=l},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),s=(r(o),n(32)),u=r(s),l=n(33),c=r(l),f=n(1),d=r(f),h=n(14),p=r(h),v=n(13),y=r(v),g=n(27),m=r(g),b=d.default.get(),_=function(){function e(t){i(this,e),this._response={},this.requests=this.buildRequests(t),this._entryId=t.entryId}return a(e,null,[{key:"name",get:function(){return"media"}}]),a(e,[{key:"buildRequests",value:function(e){var t=[];return t.push(u.default.list(b.beUrl,e.ks,e.entryId)),t.push(u.default.getPlaybackContext(b.beUrl,e.ks,e.entryId)),t.push(c.default.list(b.beUrl,e.ks,e.entryId)),t}},{key:"isValid",value:function(){return!!this._entryId}},{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){var t=new m.default(e[0].data);this._response.entry=t.entries[0],this._response.playBackContextResult=new p.default(e[1].data),this._response.metadataListResult=new y.default(e[2].data)},get:function(){return this._response}}]),e}();t.default=_},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(34),s=r(o),u=n(1),l=r(u),c=n(0),f=(r(c),l.default.get()),d=function(){function e(t){i(this,e),this._response={},this.requests=this.buildRequests(t),this._partnerId=t.partnerId}return a(e,null,[{key:"name",get:function(){return"session"}}]),a(e,[{key:"buildRequests",value:function(e){var t=[];return t.push(s.default.anonymousSession(f.beUrl,e.partnerId)),t}},{key:"isValid",value:function(){return!!this._partnerId}},{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.ks=e[0].data.ks},get:function(){return this._response.ks}}]),e}();t.default=d},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(36),s=r(o),u=n(31),l=r(u),c=n(1),f=r(c),d=n(0),h=(r(d),f.default.get()),p=function(){function e(t){i(this,e),this._response={},this.requests=this.buildRequests(t),this._uiConfId=t.uiConfId}return a(e,null,[{key:"name",get:function(){return"uiConf"}}]),a(e,[{key:"buildRequests",value:function(e){var t=[];return t.push(s.default.get(h.beUrl,e.ks,e.uiConfId)),t}},{key:"isValid",value:function(){return!!this._uiConfId}},{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.uiConf=new l.default(e[0].data)},get:function(){if(null==this._response||null==this._response.uiConf||null==this._response.uiConf.config)return null;try{return JSON.parse(this._response.uiConf.config).plugins}catch(e){return null}}}]),e}();t.default=p},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(12),s=(r(o),n(14)),u=(r(s),n(15)),l=(r(u),n(11)),c=(r(l),n(13)),f=(r(c),n(25)),d=r(f),h=n(37),p=r(h),v=n(2),y=n(5),g=r(y),m=n(1),b=r(m),_=n(22),E=n(9),T=r(E),w=n(10),k=r(w),S=n(7),O=r(S),A=b.default.get(),P=g.default.get("OvpProvider"),R=new Map([["mpegdash",_.MediaFormat.dash],["applehttp",_.MediaFormat.hls],["url",_.MediaFormat.mp4]]),D=function(){function e(){i(this,e)}return a(e,null,[{key:"getMediaEntry",value:function(e,t,n,r){var i=this,a=new T.default,o=r.entry,s=r.playBackContextResult,u=r.metadataListResult,l=s.sources,c=[];l&&l.length>0?l.forEach(function(r){c.push(i.parseSource(r,e,t,n,o,s))}):c=[],a.sources=c;var f=this.parseMetaData(u);a.metaData=f,a.id=o.id,a.duration=o.duration;var d=v.MediaEntryType.Unknown;switch(o.entryType){case v.MediaType.IMAGE.value:d=v.MediaEntryType.Image;break;case v.MediaType.AUDIO.value:d=v.MediaEntryType.Audio;break;default:switch(o.type){case v.EntryType.MEDIA_CLIP.value:d=v.MediaEntryType.Vod;break;case v.EntryType.LIVE_STREAM.value:case v.EntryType.LIVE_CHANNEL.value:d=v.MediaEntryType.Live;break;default:d=v.MediaEntryType.Unknown}}return a.type=d,a}},{key:"parseSource",value:function(e,t,n,r,i,a){var o="",s=R.get(e.format),u=new O.default;if(e.hasFlavorIds()){var l=A.baseUrl.split("/"),c=void 0;c=l&&l.length>0?l[0].substring(0,l[0].length-1):"http";var f="";if(s)f=s.pathExt,u.mimetype=s.mimeType;else{var h=e.flavorIds.split(","),p=a.flavorAssets.filter(function(e){return-1!=h.indexOf(e.id)});p&&p.length>0&&(f=p[0].fileExt)}o=d.default.build({entryId:i.id,flavorIds:e.flavorIds,format:e.format,ks:t,partnerId:n,uiConfId:r,extension:f,protocol:e.getProtocol(c)})}else o=e.url;if(""==o)return P.error("failed to create play url from source, discarding source: ("+i.id+"_"+e.deliveryProfileId+"), "+e.format+"."),u;if(u.url=o,u.id=i.id+"_"+e.deliveryProfileId+","+e.format,e.hasDrmData()){var v=[];e.drm.forEach(function(e){v.push(new k.default(e.licenseURL,e.scheme))}),u.drmData=v}return u}},{key:"parseMetaData",value:function(e){var t={};return e&&e.metas&&e.metas.length>0&&e.metas.forEach(function(e){var n=void 0,r=new DOMParser;e.xml=e.xml.replace(/\r?\n|\r/g,""),e.xml=e.xml.replace(/>\s*/g,">"),e.xml=e.xml.replace(/>\s*/g,">"),n=r.parseFromString(e.xml,"text/xml");var i=p.default.xmlToJson(n);Object.keys(i.metadata).forEach(function(e){t[e]=i.metadata[e]["#text"]})}),t}}]),e}();t.default=D},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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}),t.MediaFormat=void 0;var o=n(16);(t.MediaFormat=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({dash:{get mimeType(){return"application/dash+xml"},get pathExt(){return"mpd"}},hls:{get mimeType(){return"application/x-mpegURL"},get pathExt(){return"m3u8"}},wvm:{get mimeType(){return"video/wvm"},get pathExt(){return"wvm"}},mp4:{get mimeType(){return"video/mp4"},get pathExt(){return"mp4"}},mp3:{get mimeType(){return"audio/mpeg"},get pathExt(){return"mp3"}}})},,function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0}),t.OvpProvider=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(5),s=r(o),u=n(21),l=r(u),c=n(17),f=r(c),d=n(18),h=r(d),p=n(19),v=r(p),y=n(20),g=r(y),m=n(1),b=r(m),_=n(9),E=(r(_),n(7)),T=(r(E),s.default.get("OvpProvider")),w=t.OvpProvider=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments[2];i(this,e),this.partnerID=t,this.ks=n,this._isAnonymous=!this.ks,b.default.set(r)}return a(e,[{key:"getConfig",value:function(e,t){var n=this;return null!=t&&(this._uiConfId=t),this._dataLoader=new f.default(this.partnerID,this.ks),new Promise(function(r,i){if(n.validateParams(e,t)){var a=n.ks;n._isAnonymous&&(a="{1:result:ks}",n._dataLoader.add(v.default,{partnerId:n.partnerID})),n._dataLoader.add(h.default,{entryId:e,ks:a}),n._dataLoader.add(g.default,{uiConfId:t,ks:a}),n._dataLoader.fetchData().then(function(e){r(n.parseDataFromResponse(e))},function(e){i(e)})}else i({success:!1,data:"Missing mandatory parameter"})})}},{key:"parseDataFromResponse",value:function(e){T.debug("Data parsing started");var t={id:"",session:{partnerID:this.partnerID,uiConfID:this._uiConfId},sources:[],duration:0,type:"Unknown",metadata:{},plugins:{}};if(null!=e){if(e.has(v.default.name)){var n=e.get(v.default.name);null!=n&&null!=n.response&&(this.ks=n.response,this._isAnonymous=!this.ks,t.session.ks=this.ks)}if(e.has(g.default.name)){var r=e.get(g.default.name),i={};null!=r&&(i=r.response),t.plugins=i}if(e.has(h.default.name)){var a=e.get(h.default.name);if(null!=a&&null!=a.response){var o=l.default.getMediaEntry(this.ks,this.partnerID,this._uiConfId,a.response);t.id=o.id,t.sources=o.sources,t.duration=o.duration,t.type=o.type.name,t.metadata=o.metaData}}}return T.debug("Data parsing finished",t),t}},{key:"validateParams",value:function(e,t){return!!e||!!t}}]),e}();t.default=w},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=o.default.get(),u=function(){function e(){r(this,e)}return i(e,null,[{key:"build",value:function(t){var n=s.baseUrl,r=t.partnerId,i=t.entryId,a=t.ks,o=t.uiConfId,u=t.format,l=t.protocol,c=t.extension,f=t.flavorIds;if(""==n&&""==r&&""==i&&""==c&&""==u)return"";var d=n;return e.endsWith(n,"/")||(d+="/"),d+="p/"+r+"/sp/"+r+"00/playManifest/entryId/"+i+"/protocol/"+l+"/format/"+u,""!=f?d+="/falvorIds/"+f:""!=o&&(d+="/uiConfId/"+o),""!=this.ks&&(d+="/ks/"+a),d+="/a."+c,o&&""!=f&&(d+="?uiConfId=."+o),d}},{key:"endsWith",value:function(e,t){return"string"==typeof e&&("string"==typeof t&&-1!=e.indexOf(t,e.length-t.length))}}]),e}();t.default=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function e(t){r(this,e),this.message=t.message,this.code=t.code};t.default=i},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=n(4),u=r(s),l=n(12),c=r(l),f=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.hasError||(n.totalCount=e.totalCount,n.totalCount>0&&(n.entries=[],e.objects.map(function(e){return n.entries.push(new c.default(e))}))),n}return o(t,e),t}(u.default);t.default=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=(n(2),function e(t){r(this,e),this.scheme=t.scheme,this.licenseURL=t.licenseURL});t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=(n(2),function e(t){r(this,e),this.id=t.id,this.metadataProfileId=t.metadataProfileId,this.metadataProfileVersion=t.metadataProfileVersion,this.metadataProfileId=t.metadataProfileId,this.metadataObjectType=t.metadataObjectType,this.objectId=t.objectId,this.version=t.version,this.created=new Date(0),this.created.setUTCSeconds(t.createdAt),this.updated=new Date(0),this.updated.setUTCSeconds(t.updatedAt),this.status=t.status,this.xml=t.xml});t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=(n(2),function e(t){r(this,e),this.type=t.type});t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=n(4),s=function(e){return e&&e.__esModule?e:{default:e}}(o),u=(n(2),function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.hasError||(n.name=e.name,n.description=e.description,n.objTypeAsString=e.objTypeAsString,n.width=e.width,n.height=e.height,n.htmlParams=e.htmlParams,n.swfUrl=e.swfUrl,n.confFilePath=e.confFilePath,n.confFile=e.confFile,n.confFileFeatures=e.confFileFeatures,n.config=e.config,n.confVars=e.confVars,n.useCdn=e.useCdn,n.tags=e.tags,n.swfUrlVersion=e.swfUrlVersion,n.created=new Date(0),n.created.setUTCSeconds(e.createdAt),n.updated=new Date(0),n.updated.setUTCSeconds(e.updatedAt),n.html5Url=e.description,n.version=e.description,n.partnerTags=e.description,n.objType=e.description,n.creationMode=e.description),n}return a(t,e),t}(s.default));t.default=u},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(3),l=r(u),c=n(0),f=r(c),d=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),s(t,null,[{key:"getPlaybackContext",value:function(e,t,n){var r=new f.default;r.service="baseEntry",r.action="getPlaybackContext",r.method="POST",r.baseUrl=e,r.tag="baseEntry-getPlaybackContext";var i={objectType:"KalturaContextDataParams",flavorTags:"all"},a={entryId:n,ks:t,contextDataParams:i};return r.params=a,r}},{key:"list",value:function(e,n,r){var i=new f.default;return i.service="baseEntry",i.action="list",i.method="POST",i.baseUrl=e,i.tag="list",i.params=t.getEntryListReqParams(r,n),i}},{key:"getEntryListReqParams",value:function(e,t){return{ks:t,filter:{redirectFromEntryId:e},responseProfile:{fields:"id,name,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags",type:1}}}}]),t}(l.default);t.default=d},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(3),l=r(u),c=n(0),f=r(c),d=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),s(t,null,[{key:"list",value:function(e,t,n){var r=new f.default;r.service="metadata_metadata",r.action="list",r.method="POST",r.baseUrl=e,r.tag="metadata_metadata-list";var i={objectType:"KalturaMetadataFilter",objectIdEqual:n,metadataObjectTypeEqual:"1"},a={filter:i,ks:t};return r.params=a,r}}]),t}(l.default);t.default=d},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(3),l=r(u),c=n(0),f=r(c),d=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),s(t,null,[{key:"anonymousSession",value:function(e,t){var n=new f.default;return n.service="session",n.action="startWidgetSession",n.method="POST",n.baseUrl=e,n.tag="session-startWidget",n.params={widgetId:"_"+t},n}}]),t}(l.default);t.default=d},,function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(3),l=r(u),c=n(0),f=r(c),d=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),s(t,null,[{key:"get",value:function(e,t,n){var r=new f.default;r.service="uiconf",r.action="get",r.method="POST",r.baseUrl=e,r.tag="uiconf-get";var i={fields:"config",type:1};return r.params={id:n,responseProfile:i,ks:t},r}}]),t}(l.default);t.default=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e)}return i(e,null,[{key:"xmlToJson",value:function(e){var t={};if(1==e.nodeType){if(e.attributes.length>0){t["@attributes"]={};for(var n=0;n<e.attributes.length;n++){var r=e.attributes.item(n);t["@attributes"][r.nodeName]=r.nodeValue}}}else 3==e.nodeType&&(t=e.nodeValue);if(e.hasChildNodes())for(var i=0;i<e.childNodes.length;i++){var a=e.childNodes.item(i),o=a.nodeName;if(void 0===t[o])t[o]=this.xmlToJson(a);else{if(void 0===t[o].push){var s=t[o];t[o]=[],t[o].push(s)}t[o].push(this.xmlToJson(a))}}return t}}]),e}();t.default=a}])})},function(e,t,n){!function(t,r){e.exports=r(n(0))}(0,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=28)}([function(e,t,n){!function(){"use strict";function t(){}function n(e,n){var r,i,a,o,s=I;for(o=arguments.length;o-- >2;)x.push(arguments[o]);for(n&&null!=n.children&&(x.length||x.push(n.children),delete n.children);x.length;)if((i=x.pop())&&void 0!==i.pop)for(o=i.length;o--;)x.push(i[o]);else!0!==i&&!1!==i||(i=null),(a="function"!=typeof e)&&(null==i?i="":"number"==typeof i?i=String(i):"string"!=typeof i&&(a=!1)),a&&r?s[s.length-1]+=i:s===I?s=[i]:s.push(i),r=a;var u=new t;return u.nodeName=e,u.children=s,u.attributes=null==n?void 0:n,u.key=null==n?void 0:n.key,void 0!==L.vnode&&L.vnode(u),u}function r(e,t){for(var n in t)e[n]=t[n];return e}function i(e,t){return n(e.nodeName,r(r({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}function a(e){!e.__d&&(e.__d=!0)&&1==C.push(e)&&(L.debounceRendering||setTimeout)(o)}function o(){var e,t=C;for(C=[];e=t.pop();)e.__d&&O(e)}function s(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&u(e,t.nodeName):n||e._componentConstructor===t.nodeName}function u(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function l(e){var t=r({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var i in n)void 0===t[i]&&(t[i]=n[i]);return t}function c(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function f(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t,n,r,i){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||i)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var a in n)a in r||(e.style[a]="");for(var a in r)e.style[a]="number"==typeof r[a]&&!1===M.test(a)?r[a]+"px":r[a]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var o=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,p,o):e.removeEventListener(t,p,o),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!i&&t in e)h(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=i&&t!==(t=t.replace(/^xlink\:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function h(e,t,n){try{e[t]=n}catch(e){}}function p(e){return this.__l[e.type](L.event&&L.event(e)||e)}function v(){for(var e;e=N.pop();)L.afterMount&&L.afterMount(e),e.componentDidMount&&e.componentDidMount()}function y(e,t,n,r,i,a){U++||(j=null!=i&&void 0!==i.ownerSVGElement,F=null!=e&&!("__preactattr_"in e));var o=g(e,t,n,r,a);return i&&o.parentNode!==i&&i.appendChild(o),--U||(F=!1,a||v()),o}function g(e,t,n,r,i){var a=e,o=j;if(null==t&&(t=""),"string"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||i)?e.nodeValue!=t&&(e.nodeValue=t):(a=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(a,e),b(e,!0))),a.__preactattr_=!0,a;if("function"==typeof t.nodeName)return A(e,t,n,r);if(j="svg"===t.nodeName||"foreignObject"!==t.nodeName&&j,(!e||!u(e,String(t.nodeName)))&&(a=c(String(t.nodeName),j),e)){for(;e.firstChild;)a.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(a,e),b(e,!0)}var s=a.firstChild,l=a.__preactattr_||(a.__preactattr_={}),f=t.children;return!F&&f&&1===f.length&&"string"==typeof f[0]&&null!=s&&void 0!==s.splitText&&null==s.nextSibling?s.nodeValue!=f[0]&&(s.nodeValue=f[0]):(f&&f.length||null!=s)&&m(a,f,n,r,F||null!=l.dangerouslySetInnerHTML),E(a,t.attributes,l),j=o,a}function m(e,t,n,r,i){var a,o,u,l,c=e.childNodes,d=[],h={},p=0,v=0,y=c.length,m=0,_=t?t.length:0;if(0!==y)for(var E=0;E<y;E++){var T=c[E],w=T.__preactattr_,k=_&&w?T._component?T._component.__k:w.key:null;null!=k?(p++,h[k]=T):(w||(void 0!==T.splitText?!i||T.nodeValue.trim():i))&&(d[m++]=T)}if(0!==_)for(var E=0;E<_;E++){u=t[E],l=null;var k=u.key;if(null!=k)p&&void 0!==h[k]&&(l=h[k],h[k]=void 0,p--);else if(!l&&v<m)for(a=v;a<m;a++)if(void 0!==d[a]&&s(o=d[a],u,i)){l=o,d[a]=void 0,a===m-1&&m--,a===v&&v++;break}l=g(l,u,n,r),l&&l!==e&&(E>=y?e.appendChild(l):l!==c[E]&&(l===c[E+1]?f(c[E]):e.insertBefore(l,c[E]||null)))}if(p)for(var E in h)void 0!==h[E]&&b(h[E],!1);for(;v<=m;)void 0!==(l=d[m--])&&b(l,!1)}function b(e,t){var n=e._component;n?P(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||f(e),_(e))}function _(e){for(e=e.lastChild;e;){var t=e.previousSibling;b(e,!0),e=t}}function E(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||d(e,r,n[r],n[r]=void 0,j);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||d(e,r,n[r],n[r]=t[r],j)}function T(e){var t=e.constructor.name;(B[t]||(B[t]=[])).push(e)}function w(e,t,n){var r,i=B[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),R.call(r,t,n)):(r=new R(t,n),r.constructor=e,r.render=k),i)for(var a=i.length;a--;)if(i[a].constructor===e){r.__b=i[a].__b,i.splice(a,1);break}return r}function k(e,t,n){return this.constructor(e,n)}function S(e,t,n,r,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,r),r&&r!==e.context&&(e.__c||(e.__c=e.context),e.context=r),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===L.syncComponentUpdates&&e.base?a(e):O(e,1,i)),e.__r&&e.__r(e))}function O(e,t,n,i){if(!e.__x){var a,o,s,u=e.props,c=e.state,f=e.context,d=e.__p||u,h=e.__s||c,p=e.__c||f,g=e.base,m=e.__b,_=g||m,E=e._component,T=!1;if(g&&(e.props=d,e.state=h,e.context=p,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,c,f)?T=!0:e.componentWillUpdate&&e.componentWillUpdate(u,c,f),e.props=u,e.state=c,e.context=f),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!T){a=e.render(u,c,f),e.getChildContext&&(f=r(r({},f),e.getChildContext()));var k,A,R=a&&a.nodeName;if("function"==typeof R){var D=l(a);o=E,o&&o.constructor===R&&D.key==o.__k?S(o,D,1,f,!1):(k=o,e._component=o=w(R,D,f),o.__b=o.__b||m,o.__u=e,S(o,D,0,f,!1),O(o,1,n,!0)),A=o.base}else s=_,k=E,k&&(s=e._component=null),(_||1===t)&&(s&&(s._component=null),A=y(s,a,f,n||!g,_&&_.parentNode,!0));if(_&&A!==_&&o!==E){var x=_.parentNode;x&&A!==x&&(x.replaceChild(A,_),k||(_._component=null,b(_,!1)))}if(k&&P(k),e.base=A,A&&!i){for(var I=e,M=e;M=M.__u;)(I=M).base=A;A._component=I,A._componentConstructor=I.constructor}}if(!g||n?N.unshift(e):T||(v(),e.componentDidUpdate&&e.componentDidUpdate(d,h,p),L.afterUpdate&&L.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);U||i||v()}}function A(e,t,n,r){for(var i=e&&e._component,a=i,o=e,s=i&&e._componentConstructor===t.nodeName,u=s,c=l(t);i&&!u&&(i=i.__u);)u=i.constructor===t.nodeName;return i&&u&&(!r||i._component)?(S(i,c,3,n,r),e=i.base):(a&&!s&&(P(a),e=o=null),i=w(t.nodeName,c,n),e&&!i.__b&&(i.__b=e,o=null),S(i,c,1,n,r),e=i.base,o&&e!==o&&(o._component=null,b(o,!1))),e}function P(e){L.beforeUnmount&&L.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?P(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,f(t),T(e),_(t)),e.__r&&e.__r(null)}function R(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}function D(e,t,n){return y(n,e,{},!1,t,!1)}var L={},x=[],I=[],M=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,C=[],N=[],U=0,j=!1,F=!1,B={};r(R.prototype,{setState:function(e,t){var n=this.state;this.__s||(this.__s=r({},n)),r(n,"function"==typeof e?e(n,this.props):e),t&&(this.__h=this.__h||[]).push(t),a(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),O(this,2)},render:function(){}});var G={h:n,createElement:n,cloneElement:i,Component:R,render:D,rerender:o,options:L};e.exports=G}()},function(e,t,n){!function(t,r){e.exports=r(n(0),n(6))}(0,function(e,t){function n(){}function r(){var e=[],t=[];return{clear:function(){t=B,e=B},notify:function(){for(var n=e=t,r=0;r<n.length;r++)n[r]()},subscribe:function(n){var r=!0;return t===e&&(t=e.slice()),t.push(n),function(){r&&e!==B&&(r=!1,t===e&&(t=e.slice()),t.splice(t.indexOf(n),1))}}}}function i(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}function a(){K||(K=!0,i("<Provider> does not support changing `store` on the fly. It is most likely that you see this error because you updated to Redux 2.x and React Redux 2.x which no longer hot reload reducers automatically. See https://github.com/reactjs/react-redux/releases/tag/v2.0.0 for the migration instructions."))}function o(t){var n,r,i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=i.getDisplayName,o=void 0===a?function(e){return"ConnectAdvanced("+e+")"}:a,s=i.methodName,u=void 0===s?"connectAdvanced":s,l=i.renderCountProp,c=void 0===l?void 0:l,f=i.shouldHandleStateChanges,d=void 0===f||f,h=i.storeKey,p=void 0===h?"store":h,v=i.withRef,y=void 0!==v&&v,g=j(i,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),m=p+"Subscription",b=J++,_=(n={},n[p]=H,n[m]=I.instanceOf(V),n),E=(r={},r[m]=I.instanceOf(V),r);return function(n){$("function"==typeof n,"You must pass a component to the function returned by connect. Instead received "+n);var r=n.displayName||n.name||"Component",i=o(r),a=N({},g,{getDisplayName:o,methodName:u,renderCountProp:c,shouldHandleStateChanges:d,storeKey:p,withRef:y,displayName:i,wrappedComponentName:r,WrappedComponent:n}),s=function(r){function o(e,t){C(this,o);var n=F(this,r.call(this,e,t));return n.version=b,n.state={},n.renderCount=0,n.store=n.props[p]||n.context[p],n.parentSub=e[m]||t[m],n.setWrappedInstance=n.setWrappedInstance.bind(n),$(n.store,'Could not find "'+p+'" in either the context or props of "'+i+'". Either wrap the root component in a <Provider>, or explicitly pass "'+p+'" as a prop to "'+i+'".'),n.getState=n.store.getState.bind(n.store),n.initSelector(),n.initSubscription(),n}return U(o,r),o.prototype.getChildContext=function(){var e;return e={},e[m]=this.subscription||this.parentSub,e},o.prototype.componentDidMount=function(){d&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},o.prototype.componentWillReceiveProps=function(e){this.selector.run(e)},o.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},o.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.store=null,this.parentSub=null,this.selector.run=function(){}},o.prototype.getWrappedInstance=function(){return $(y,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+u+"() call."),this.wrappedInstance},o.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},o.prototype.initSelector=function(){var e=this.store.dispatch,n=this.getState,r=t(e,a),i=this.selector={shouldComponentUpdate:!0,props:r(n(),this.props),run:function(e){try{var t=r(n(),e);(i.error||t!==i.props)&&(i.shouldComponentUpdate=!0,i.props=t,i.error=null)}catch(e){i.shouldComponentUpdate=!0,i.error=e}}}},o.prototype.initSubscription=function(){var e=this;d&&function(){var t=e.subscription=new V(e.store,e.parentSub),n={};t.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=function(){this.componentDidUpdate=void 0,t.notifyNestedSubs()},this.setState(n)):t.notifyNestedSubs()}.bind(e)}()},o.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},o.prototype.addExtraProps=function(e){if(!y&&!c)return e;var t=N({},e);return y&&(t.ref=this.setWrappedInstance),c&&(t[c]=this.renderCount++),t},o.prototype.render=function(){var t=this.selector;if(t.shouldComponentUpdate=!1,t.error)throw t.error;return e.h(n,this.addExtraProps(t.props))},o}(e.Component);return s.WrappedComponent=n,s.displayName=i,s.childContextTypes=E,s.contextTypes=_,s.prototype.componentWillUpdate=function(){this.version!==b&&(this.version=b,this.initSelector(),this.subscription&&this.subscription.tryUnsubscribe(),this.initSubscription(),d&&this.subscription.trySubscribe())},X(s,n)}}function s(e,t){if(e===t)return!0;var n=0,r=0;for(var i in e){if(Q.call(e,i)&&e[i]!==t[i])return!1;n++}for(var a in t)Q.call(t,a)&&r++;return n===r}function u(e){return Z(Object(e))}function l(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function c(e){return!!e&&"object"==(void 0===e?"undefined":M(e))}function f(e){if(!c(e)||ae.call(e)!=ee||l(e))return!1;var t=u(e);if(null===t)return!0;var n=re.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ne.call(n)==ie}function d(e,t,n){f(e)||i(n+"() in "+t+" must return a plain object. Instead received "+e+".")}function h(e){return function(t,n){function r(){return i}var i=e(t,n);return r.dependsOnOwnProps=!1,r}}function p(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function v(e,t){return function(n,r){var i=r.displayName,a=function(e,t){return a.dependsOnOwnProps?a.mapToProps(e,t):a.mapToProps(e)};return a.dependsOnOwnProps=p(e),a.mapToProps=function(n,r){a.mapToProps=e;var o=a(n,r);return"function"==typeof o&&(a.mapToProps=o,a.dependsOnOwnProps=p(o),o=a(n,r)),d(o,i,t),o},a}}function y(e){return"function"==typeof e?v(e,"mapDispatchToProps"):void 0}function g(e){return e?void 0:h(function(e){return{dispatch:e}})}function m(e){return e&&"object"===(void 0===e?"undefined":M(e))?h(function(n){return t.bindActionCreators(e,n)}):void 0}function b(e){return"function"==typeof e?v(e,"mapStateToProps"):void 0}function _(e){return e?void 0:h(function(){return{}})}function E(e,t,n){return N({},n,e,t)}function T(e){return function(t,n){var r=n.displayName,i=n.pure,a=n.areMergedPropsEqual,o=!1,s=void 0;return function(t,n,u){var l=e(t,n,u);return o?i&&a(l,s)||(s=l):(o=!0,s=l,d(s,r,"mergeProps")),s}}}function w(e){return"function"==typeof e?T(e):void 0}function k(e){return e?void 0:function(){return E}}function S(e,t,n){if(!e)throw new Error("Unexpected value for "+t+" in "+n+".");"mapStateToProps"!==t&&"mapDispatchToProps"!==t||e.hasOwnProperty("dependsOnOwnProps")||i("The selector for "+t+" of "+n+" did not specify a value for dependsOnOwnProps.")}function O(e,t,n,r){S(e,"mapStateToProps",r),S(t,"mapDispatchToProps",r),S(n,"mergeProps",r)}function A(e,t,n,r){return function(i,a){return n(e(i,a),t(r,a),a)}}function P(e,t,n,r,i){function a(i,a){return p=i,v=a,y=e(p,v),g=t(r,v),m=n(y,g,v),h=!0,m}function o(){return y=e(p,v),t.dependsOnOwnProps&&(g=t(r,v)),m=n(y,g,v)}function s(){return e.dependsOnOwnProps&&(y=e(p,v)),t.dependsOnOwnProps&&(g=t(r,v)),m=n(y,g,v)}function u(){var t=e(p,v),r=!d(t,y);return y=t,r&&(m=n(y,g,v)),m}function l(e,t){var n=!f(t,v),r=!c(e,p);return p=e,v=t,n&&r?o():n?s():r?u():m}var c=i.areStatesEqual,f=i.areOwnPropsEqual,d=i.areStatePropsEqual,h=!1,p=void 0,v=void 0,y=void 0,g=void 0,m=void 0;return function(e,t){return h?l(e,t):a(e,t)}}function R(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,i=t.initMergeProps,a=j(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),o=n(e,a),s=r(e,a),u=i(e,a);return O(o,s,u,a.displayName),(a.pure?P:A)(o,s,u,e,a)}function D(e,t,n){for(var r=t.length-1;r>=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+(void 0===e?"undefined":M(e))+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function L(e,t){return e===t}var x={only:function(e){return e&&e[0]||null}};n.isRequired=n;var I={element:n,func:n,shape:function(){return n},instanceOf:function(){return n}},M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},C=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},j=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},F=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},B=null,G={notify:function(){}},V=function(){function e(t,n){C(this,e),this.store=t,this.parentSub=n,this.unsubscribe=null,this.listeners=G}return e.prototype.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},e.prototype.notifyNestedSubs=function(){this.listeners.notify()},e.prototype.isSubscribed=function(){return Boolean(this.unsubscribe)},e.prototype.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=r())},e.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=G)},e}(),H=I.shape({subscribe:I.func.isRequired,dispatch:I.func.isRequired,getState:I.func.isRequired}),K=!1,Y=function(e){function t(n,r){C(this,t);var i=F(this,e.call(this,n,r));return i.store=n.store,i}return U(t,e),t.prototype.getChildContext=function(){return{store:this.store,storeSubscription:null}},t.prototype.render=function(){return x.only(this.props.children)},t}(e.Component);Y.prototype.componentWillReceiveProps=function(e){this.store!==e.store&&a()},Y.childContextTypes={store:H.isRequired,storeSubscription:I.instanceOf(V)},Y.displayName="Provider";var W={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},q={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},z="function"==typeof Object.getOwnPropertySymbols,X=function(e,t,n){if("string"!=typeof t){var r=Object.getOwnPropertyNames(t);z&&(r=r.concat(Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;++i)if(!(W[r[i]]||q[r[i]]||n&&n[r[i]]))try{e[r[i]]=t[r[i]]}catch(e){}}return e},$=function(){},J=0,Q=Object.prototype.hasOwnProperty,Z=Object.getPrototypeOf,ee="[object Object]",te=Object.prototype,ne=Function.prototype.toString,re=te.hasOwnProperty,ie=ne.call(Object),ae=te.toString,oe=[y,g,m],se=[b,_],ue=[w,k];return{Provider:Y,connect:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.connectHOC,n=void 0===t?o:t,r=e.mapStateToPropsFactories,i=void 0===r?se:r,a=e.mapDispatchToPropsFactories,u=void 0===a?oe:a,l=e.mergePropsFactories,c=void 0===l?ue:l,f=e.selectorFactory,d=void 0===f?R:f;return function(e,t,r){var a=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],o=a.pure,l=void 0===o||o,f=a.areStatesEqual,h=void 0===f?L:f,p=a.areOwnPropsEqual,v=void 0===p?s:p,y=a.areStatePropsEqual,g=void 0===y?s:y,m=a.areMergedPropsEqual,b=void 0===m?s:m,_=j(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),E=D(e,i,"mapStateToProps"),T=D(t,u,"mapDispatchToProps"),w=D(r,c,"mergeProps");return n(d,N({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:T,initMergeProps:w,pure:l,areStatesEqual:h,areOwnPropsEqual:v,areStatePropsEqual:g,areMergedPropsEqual:b},_))}}(),connectAdvanced:o}})},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),l=n(48),c=(r(l),n(49)),f=r(c),d=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{config:{}};i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.name=e.name,n.player=e.player,n.config=e.config,n.logger=f.default.getLogger("UI "+n.name),n.logger.debug("Initialized"),n}return o(t,e),s(t,[{key:"getConfig",value:function(e){return e?this.config[e]:this.config}},{key:"defaultConfig",get:function(){return{}}}]),t}(u.Component);t.default=d},function(e,t,n){"use strict";function r(e){return function(t){return i({},(0,a.bindActionCreators)(e,t))}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.bindActions=r;var a=n(6)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),o(t,[{key:"render",value:function(e){switch(e.type){case"maximize":return(0,s.h)("svg",{className:"icon icon-maximize",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M800 269.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z"}),(0,s.h)("path",{d:"M224 754.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z"}));case"minimize":return(0,s.h)("svg",{className:"icon icon-minimize",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M672 306.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z"}),(0,s.h)("path",{d:"M352 717.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z"}));case"play":return(0,s.h)("svg",{className:"icon icon-play",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M796.806 461.202c44.919 28.075 44.739 73.706 0 101.668l-459.472 287.171c-44.919 28.075-81.334 7.915-81.334-45.305v-585.4c0-53.096 36.595-73.266 81.334-45.305l459.472 287.171z"}));case"pause":return(0,s.h)("svg",{className:"icon icon-pause",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M256 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314zM640 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314z"}));case"volume-base":return(0,s.h)("svg",{className:"icon volume-base",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M224 352l234.504-156.336c29.545-19.697 53.496-7.194 53.496 28.053v576.566c0 35.19-24.059 47.677-53.496 28.053l-234.504-156.336h-127.906c-17.725 0-32.094-14.581-32.094-31.853v-256.295c0-17.592 14.012-31.853 32.094-31.853h127.906zM288 637.748l160 106.667v-464.83l-160 106.667v251.496zM128 416v192h96v-192h-96z"}));case"volume-waves":return(0,s.h)("svg",{className:"icon volume-waves",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M802.017 837.177c82.359-86.627 129.183-201.774 129.183-324.26 0-123.976-47.976-240.409-132.127-327.329-12.293-12.697-32.552-13.025-45.249-0.732s-13.025 32.552-0.732 45.249c72.692 75.084 114.109 175.597 114.109 282.812 0 105.928-40.422 205.331-111.566 280.162-12.177 12.808-11.666 33.063 1.143 45.24s33.063 11.666 45.24-1.143z"}),(0,s.h)("path",{d:"M667.436 743.221c67.761-60.884 107.273-147.888 107.273-241.233 0-87.318-34.552-169.203-94.836-229.446-12.501-12.493-32.762-12.486-45.255 0.015s-12.486 32.762 0.015 45.255c48.375 48.342 76.075 113.989 76.075 184.176 0 75.021-31.679 144.776-86.048 193.627-13.146 11.812-14.227 32.044-2.416 45.19s32.044 14.227 45.19 2.416z"}));case"volume-mute":return(0,s.h)("svg",{className:"icon volume-mute",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M768 466.745l-67.986-67.986c-12.213-12.213-32.654-12.393-45.151 0.104-12.584 12.584-12.543 32.711-0.104 45.151l67.986 67.986-67.986 67.986c-12.213 12.213-12.393 32.654 0.104 45.151 12.584 12.584 32.711 12.543 45.151 0.104l67.986-67.986 67.986 67.986c12.213 12.213 32.654 12.393 45.151-0.104 12.584-12.584 12.543-32.711 0.104-45.151l-67.986-67.986 67.986-67.986c12.213-12.213 12.393-32.654-0.104-45.151-12.584-12.584-32.711-12.543-45.151-0.104l-67.986 67.986z"}));case"close":return(0,s.h)("svg",{className:"icon icon-close",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M573.162 512l214.269-214.269c16.772-16.772 16.688-44.071-0.202-60.96-17.007-17.007-44.182-16.98-60.96-0.202l-214.269 214.269-214.269-214.269c-16.772-16.772-44.071-16.688-60.96 0.202-17.007 17.007-16.98 44.182-0.202 60.96l214.269 214.269-214.269 214.269c-16.772 16.772-16.688 44.071 0.202 60.96 17.007 17.007 44.182 16.98 60.96 0.202l214.269-214.269 214.269 214.269c16.772 16.772 44.071 16.688 60.96-0.202 17.007-17.007 16.98-44.182 0.202-60.96l-214.269-214.269z"}));case"share":return(0,s.h)("svg",{className:"icon icon-share",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.129-5.295 0-58.91 47.756-106.667 106.667-106.667s106.667 47.756 106.667 106.667c0 58.91-47.756 106.667-106.667 106.667-33.894 0-64.095-15.808-83.633-40.454l-236.467 142.445c-0.132-3.064-0.394-6.095-0.779-9.087l7.271-12.835-0.117 53.333-7.183-12.743c0.399-3.046 0.67-6.131 0.806-9.252l236.467 142.383c19.538-24.648 49.741-40.457 83.636-40.457 58.91 0 106.667 47.756 106.667 106.667s-47.756 106.667-106.667 106.667c-58.91 0-106.667-47.756-106.667-106.667 0-1.775 0.043-3.539 0.129-5.293l-236.19-142.216c-19.528 24.867-49.868 40.841-83.939 40.841-58.91 0-106.667-47.756-106.667-106.667s47.756-106.667 106.667-106.667c34.091 0 64.447 15.993 83.974 40.886zM234.667 554.667c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 341.333c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 768c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667z"}));case"settings":return(0,s.h)("svg",{className:"icon icon-share",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M829.945 549.126c2.784-24.116 2.784-48.445 0.269-70.702-1.182-6.772-7.090-11.696-13.674-11.641-33.039 0.582-62.975-19.389-75.126-50.118s-3.971-65.772 20.504-87.92c4.293-3.894 4.818-10.455 1.003-15.228-14.831-18.927-31.796-36.079-50.521-51.087-4.614-3.687-11.301-3.148-16.127 2.145-15.732 16.059-37.322 25.023-59.382 24.831-9.828 0.044-19.574-1.802-29.307-5.686-30.997-13.082-50.429-44.232-48.535-78.046 0.365-5.803-3.87-10.878-9.583-11.551-23.919-2.769-48.074-2.831-71.958-0.192-5.836 0.654-10.191 5.68-10.009 11.47 1.121 33.146-18.329 63.547-49.925 76.834-8.987 3.423-18.538 5.129-27.498 5.028-22.472 0.224-44.067-8.707-60.526-25.487-2.197-2.386-5.29-3.748-8.24-3.758-2.663 0.016-5.248 0.905-7.105 2.334-19.136 15.052-36.496 32.233-51.558 50.977-3.729 4.732-3.187 11.536 1.058 15.449 24.89 22.573 32.935 58.34 19.426 90.928-14.22 29.886-44.875 48.43-77.941 47.151-5.576-0.215-10.363 3.934-11.003 10.013-2.916 24.025-2.916 48.315-0.231 70.764 1.178 6.84 7.155 11.808 14.518 11.713l2.428 0.007c31.565 0.659 59.701 20.063 71.6 49.499 12.239 30.769 4.278 65.898-20.252 88.586-4.217 3.829-4.736 10.275-0.976 14.991 14.777 18.932 31.665 36.115 50.227 51.128 4.694 3.762 11.505 3.223 16.349-2.081 15.725-16.101 37.337-25.092 59.378-24.895 9.894-0.057 19.705 1.819 29.5 5.78 30.753 13.169 50.063 44.084 48.378 77.965-0.373 5.795 3.857 10.867 9.602 11.539 23.908 2.78 48.053 2.842 71.923 0.192 5.851-0.659 10.215-5.702 10.027-11.562-1.088-33.118 18.371-63.473 49.584-76.583 9.014-3.552 18.622-5.354 27.841-5.307 22.555-0.225 44.218 8.804 60.434 25.505 2.224 2.395 5.343 3.76 8.371 3.769 2.474-0.012 4.874-0.847 6.896-2.43 19.227-14.971 36.653-32.121 51.726-50.848 3.737-4.743 3.194-11.563-0.941-15.379-24.391-21.907-32.789-56.564-21.134-87.207s40.964-50.957 73.904-51.116h5.704c5.586-0.028 10.269-4.227 10.905-9.777zM893.526 556.438c-4.321 37.715-36.171 66.271-74.323 66.464h-5.711c-6.33 0.031-11.99 3.953-14.24 9.87s-0.629 12.609 4.385 17.116c29.020 26.748 32.567 71.325 7.936 102.582-18.378 22.837-39.342 43.468-62.397 61.42-13.128 10.284-29.303 15.909-46.22 15.991-21.004-0.056-41.043-8.825-54.839-23.692-3.514-3.616-8.356-5.634-13.867-5.583-1.555-0.007-3.097 0.282-3.877 0.581-6.088 2.559-9.967 8.609-9.749 15.235 1.257 39.227-27.828 72.841-66.88 77.241-28.725 3.189-57.719 3.114-86.45-0.227-39.585-4.631-68.615-39.444-66.083-78.749 0.331-6.679-3.529-12.859-9.057-15.234-1.449-0.585-2.998-0.881-5.025-0.873-5.074-0.045-9.947 1.982-12.693 4.763-26.775 29.494-71.875 33.067-103.071 8.066-22.458-18.164-42.771-38.831-60.335-61.337-24.602-30.847-21.012-75.5 7.982-101.818 4.881-4.515 6.479-11.568 4.088-17.58-2.239-5.538-7.562-9.209-12.866-9.327-39.748 0.506-72.828-26.991-79.581-66.425-3.538-29.147-3.538-58.616-0.060-87.234 4.085-39.084 37.791-68.296 77.064-66.784 7.502 0.29 14.456-3.916 17.001-9.164 2.519-6.098 0.94-13.122-4.133-17.724-29.022-26.738-32.57-71.311-7.956-102.538 18.292-22.765 39.115-43.375 62.322-61.626 13.199-10.169 29.368-15.731 46.323-15.833 21.063 0.065 41.146 8.908 54.704 23.656 3.559 3.623 8.44 5.642 14.175 5.592 1.605 0.017 3.199-0.268 3.668-0.426 6.11-2.574 9.998-8.651 9.771-15.356-1.228-39.209 27.864-72.786 66.897-77.161 28.715-3.173 57.697-3.098 86.456 0.231 39.539 4.653 68.54 39.409 66.051 78.92-0.369 6.596 3.446 12.713 8.931 15.035 1.507 0.6 3.114 0.905 5.156 0.898 5.087 0.044 9.973-1.985 12.671-4.704 26.66-29.444 71.625-33.068 102.694-8.244 22.604 18.117 43.043 38.781 60.715 61.337 24.728 30.927 21.142 75.751-8.215 102.378-4.724 4.275-6.301 11.031-3.958 16.955s8.114 9.775 14.774 9.659c38.18-0.325 70.992 27.018 77.822 66.463 3.343 28.966 3.343 58.22 0 87.185zM511.951 597.037c47.144-0.118 85.24-38.367 85.169-85.511 0-34.617-20.872-65.819-52.867-79.034s-68.802-5.836-93.231 18.69c-24.429 24.527-31.66 61.363-18.317 93.305s44.628 52.688 79.245 52.55zM512.158 661.036c-60.477 0.242-115.178-36.032-138.507-91.881s-10.686-120.254 32.026-163.138c42.712-42.884 107.066-55.785 163.008-32.679s92.434 77.661 92.434 138.139c0.124 82.417-66.545 149.353-148.962 149.559z"}));case"check":return(0,s.h)("svg",{className:"icon check-icon",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M342.481 563.894c-12.577-12.416-32.838-12.285-45.254 0.292s-12.285 32.838 0.292 45.254l118.857 117.333c13.275 13.105 34.901 12.123 46.933-2.131l297.143-352c11.4-13.505 9.694-33.694-3.811-45.094s-33.694-9.694-45.094 3.811l-274.828 325.566-94.238-93.030z"}));case"language":return(0,s.h)("svg",{className:"icon language-icon",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M625.773 808.031c29.752-39.944 63.443-97.069 83.311-168.977 41.798-3.715 74.872-8.022 98.271-11.57-32.456 82.71-98.638 148.558-181.582 180.547zM216.562 627.283c23.516 3.506 56.799 7.797 98.279 11.528 19.868 72.017 53.601 129.224 83.378 169.219-83.002-32.014-149.226-97.945-181.657-180.747zM400.147 215.201c-29.835 40.32-64.161 98.037-84.572 169.695-42.123 3.731-75.423 8.072-98.938 11.629 32.698-83.353 99.656-149.61 183.51-181.323zM807.438 396.725c-23.641-3.523-57.158-7.847-98.947-11.587-20.402-71.766-54.778-129.567-84.639-169.937 83.912 31.73 150.912 98.070 183.585 181.523zM720.095 436.644c48.952 4.817 84.472 10.209 102.995 13.331 3.99 20.068 6.127 40.796 6.127 62.024 0 21.262-2.137 42.031-6.152 62.141-18.248 3.172-53.376 8.615-102.753 13.448 3.84-23.908 6.069-49.102 6.069-75.59 0-26.296-2.304-51.431-6.286-75.356zM537.043 597.206v-170.396c48.576 0.551 92.653 2.646 131.178 5.426 5.050 25.119 8.072 51.74 8.072 79.763 0 28.216-2.913 54.87-7.789 79.939-38.283 2.713-82.343 4.742-131.462 5.267zM486.957 195.859v180.856c-43.175 0.442-82.443 1.995-117.429 4.149 31.939-95.382 89.99-161.656 112.237-184.612 1.72-0.159 3.464-0.259 5.192-0.392zM542.286 196.26c22.297 22.906 80.456 89.080 112.345 184.771-35.261-2.229-74.646-3.848-117.587-4.307v-180.864c1.745 0.142 3.506 0.234 5.242 0.401zM347.706 512c0-28.074 3.047-54.762 8.156-79.955 38.191-2.696 82.134-4.708 131.094-5.234v170.387c-48.71-0.551-92.895-2.655-131.495-5.443-4.858-25.018-7.755-51.606-7.755-79.755zM194.783 512c0-21.262 2.137-42.031 6.144-62.125 18.282-3.181 53.501-8.64 103.012-13.482-4.007 24-6.319 49.219-6.319 75.606 0 26.396 2.221 51.506 6.027 75.339-48.826-4.808-84.246-10.184-102.737-13.306-3.99-20.068-6.127-40.804-6.127-62.033zM481.338 827.706c-22.389-22.314-81.016-87.469-112.662-184.779 35.437 2.262 75.047 3.898 118.28 4.366v180.839c-1.87-0.142-3.757-0.25-5.618-0.426zM542.653 827.706c-1.862 0.175-3.74 0.284-5.61 0.426v-180.839c43.509-0.442 83.044-2.012 118.222-4.199-31.672 97.244-90.265 162.349-112.612 184.612zM512 128c-211.734 0-384 172.257-384 384 0 211.734 172.266 384 384 384s384-172.266 384-384c0-211.743-172.266-384-384-384z"}))}}}]),t}(s.Component);t.default=u},function(e,t,n){function r(e){return null!==e&&void 0!==e}function i(e,t){var n=a({},e);for(var r in t)t.hasOwnProperty(r)&&(n[r]=e[r]&&t[r]&&"object"==typeof e[r]&&"object"==typeof t[r]?i(e[r],t[r]):e[r]||t[r]);return n}function a(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function o(e){if(e=e||{},"string"==typeof e&&(e=e.split(",")),"join"in e){for(var t={},n=0;n<e.length;n++){var r=e[n].trim();r&&(t[r.split(".").pop()]=r)}return t}return e}function s(e,t){return f=t||m,e&&e.replace(/\{\{([\w.-]+)\}\}/g,u)}function u(e,t){for(var n=t.split("."),r=f,i=0;i<n.length;i++)if(null==(r=r[n[i]]))return"";return"string"==typeof r&&r.match(/\{\{/)&&(r=s(r,f)),r}function l(e,t,n,i,a,o){t&&(e=t+"."+e);var u=n&&h(n,e);return(a||0===a)&&u&&"object"==typeof u&&(u=u.splice?u[a]||u[0]:0===a&&r(u.none)?u.none:1===a&&r(u.one||u.singular)?u.one||u.singular:u.some||u.many||u.plural||u.other||u),u&&s(u,i)||o||null}function c(e,t,n){var r={};t=t||{},e=o(e);for(var i in e)if(e.hasOwnProperty(i)&&e[i]){var s=e[i];n||"string"!=typeof s?s.nodeName===b&&(s=a({fallback:s.children&&s.children[0]},s.attributes),r[i]=l(s.id,t.scope,t.dictionary,s.fields,s.plural,s.fallback)):r[i]=l(s,t.scope,t.dictionary)}return r}var f,d=n(0),h=function(e){return e&&"object"==typeof e&&"default"in e?e.default:e}(n(44)),p=/[?&#]intl=show/,v=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getChildContext=function(){var e=this.props,t=e.scope,n=e.definition,r=e.mark,o=a({},this.context.intl||{});return t&&(o.scope=t),n&&(o.dictionary=i(o.dictionary||{},n)),(r||"undefined"!=typeof location&&String(location).match(p))&&(o.mark=!0),{intl:o}},t.prototype.render=function(e){var t=e.children;return t&&t[0]||null},t}(d.Component),y=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e.length>1)return g(e[0],e[1]);var n=e[0];return function(e){return g(e,n)}},g=function(e,t){return function(n){return d.h(v,t||{},d.h(e,n))}},m={},b=function(e,t){var n=e.id,r=e.children,i=e.plural,a=e.fields,o=t.intl,s=r&&r[0],u=l(n,o&&o.scope,o&&o.dictionary,a,i,s);if(o&&o.mark){var c="dictionary"+(o&&o.scope?"."+o.scope:"")+"."+n;return d.h("mark",{style:"background: "+(u?h(o,c)?"rgba(119,231,117,.5)":"rgba(229,226,41,.5)":"rgba(228,147,51,.5)"),title:n},u)}return u},_=function(e,t){var n=e.children,r=t.intl,i=n&&n[0];return i&&d.cloneElement(i,c(i.attributes,r,!0))},E=function(e){return function(t){return function(n,r){var i="function"==typeof e?e(n):e,a=c(i,r.intl);return d.h(t,assign({},n,a))}}};y.intl=y,y.IntlProvider=v,y.Text=b,y.Localizer=_,y.withText=E,e.exports=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){function r(){}var i=n(12),a=n(41),o=n(42),s=n(43),u=n(16),l=n(7);n.d(t,"createStore",function(){return i.b}),n.d(t,"combineReducers",function(){return a.a}),n.d(t,"bindActionCreators",function(){return o.a}),n.d(t,"applyMiddleware",function(){return s.a}),n.d(t,"compose",function(){return u.a}),"production"!==e.env.NODE_ENV&&"string"==typeof r.name&&"isCrushed"!==r.name&&l.a("You are currently using minified code outside of NODE_ENV === 'production'. This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) to ensure you have the correct code for your production build.")}.call(t,n(11))},function(e,t,n){"use strict";function r(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}t.a=r},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=t.types={ADD_PLAYER_CLASS:"shell/ADD_PLAYER_CLASS",REMOVE_PLAYER_CLASS:"shell/REMOVE_PLAYER_CLASS",UPDATE_IS_MOBILE:"shell/UPDATE_IS_MOBILE"},o=t.initialState={playerClasses:[]};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments[1];switch(t.type){case a.ADD_PLAYER_CLASS:return i({},e,{playerClasses:[].concat(r(e.playerClasses),[t.className])});case a.REMOVE_PLAYER_CLASS:return i({},e,{playerClasses:e.playerClasses.filter(function(e){return e!==t.className})});case a.UPDATE_IS_MOBILE:return i({},e,{isMobile:t.isMobile});default:return e}};t.actions={addPlayerClass:function(e){return{type:a.ADD_PLAYER_CLASS,className:e}},removePlayerClass:function(e){return{type:a.REMOVE_PLAYER_CLASS,className:e}},updateIsMobile:function(e){return{type:a.UPDATE_IS_MOBILE,isMobile:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={TOGGLE_PLAY:"play-pause/TOGGLE_PLAY"},a=t.initialState={isPlaying:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.TOGGLE_PLAY:return r({},e,{isPlaying:t.isPlaying});default:return e}};t.actions={toggleIsPlaying:function(e){return{type:i.TOGGLE_PLAY,isPlaying:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={TOGGLE_SHARE_OVERLAY:"share/TOGGLE_SHARE_OVERLAY"},a=t.initialState={overlayOpen:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.TOGGLE_SHARE_OVERLAY:return r({},e,{overlayOpen:t.show});default:return e}};t.actions={toggleShareOverlay:function(e){return{type:i.TOGGLE_SHARE_OVERLAY,show:e}}}},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function a(e){if(f===clearTimeout)return clearTimeout(e);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function o(){v&&h&&(v=!1,h.length?p=h.concat(p):y=-1,p.length&&s())}function s(){if(!v){var e=i(o);v=!0;for(var t=p.length;t;){for(h=p,p=[];++y<t;)h&&h[y].run();y=-1,t=p.length}h=null,v=!1,a(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var c,f,d=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(e){f=r}}();var h,p=[],v=!1,y=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];p.push(new u(e,t)),1!==p.length||v||i(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=l,d.addListener=l,d.once=l,d.off=l,d.removeListener=l,d.removeAllListeners=l,d.emit=l,d.prependListener=l,d.prependOnceListener=l,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t,n){"use strict";function r(e,t,n){function a(){g===y&&(g=y.slice())}function u(){return v}function l(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return a(),g.push(e),function(){if(t){t=!1,a();var n=g.indexOf(e);g.splice(n,1)}}}function c(e){if(!i.a(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(m)throw new Error("Reducers may not dispatch actions.");try{m=!0,v=p(v,e)}finally{m=!1}for(var t=y=g,n=0;n<t.length;n++){(0,t[n])()}return e}function f(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");p=e,c({type:s.INIT})}function d(){var e,t=l;return e={subscribe:function(e){function n(){e.next&&e.next(u())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");return n(),{unsubscribe:t(n)}}},e[o.a]=function(){return this},e}var h;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(r)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var p=e,v=t,y=[],g=y,m=!1;return c({type:s.INIT}),h={dispatch:c,subscribe:l,getState:u,replaceReducer:f},h[o.a]=d,h}n.d(t,"a",function(){return s}),t.b=r;var i=n(13),a=n(37),o=n.n(a),s={INIT:"@@redux/INIT"}},function(e,t,n){"use strict";function r(e){if(!o.a(e)||i.a(e)!=s)return!1;var t=a.a(e);if(null===t)return!0;var n=f.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==d}var i=n(29),a=n(34),o=n(36),s="[object Object]",u=Function.prototype,l=Object.prototype,c=u.toString,f=l.hasOwnProperty,d=c.call(Object);t.a=r},function(e,t,n){"use strict";var r=n(30),i=r.a.Symbol;t.a=i},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}t.a=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={UPDATE_PLAYER_STATE:"engine/UPDATE_PLAYER_STATE",UPDATE_IS_PLAYING:"engine/UPDATE_IS_PLAYING",UPDATE_CURRENT_TIME:"engine/UPDATE_CURRENT_TIME",UPDATE_DURATION:"engine/UPDATE_DURATION",UPDATE_VOLUME:"engine/UPDATE_VOLUME",UPDATE_MUTED:"engine/UPDATE_MUTED",UPDATE_METADATA_LOADING_STATUS:"engine/UPDATE_METADATA_LOADING_STATUS",UPDATE_AUDIO_TRACKS:"engine/UPDATE_AUDIO_TRACKS",UPDATE_VIDEO_TRACKS:"engine/UPDATE_VIDEO_TRACKS",UPDATE_TEXT_TRACKS:"engine/UPDATE_TEXT_TRACKS"},a=t.initialState={isPlaying:!1,metadataLoaded:!1,playerState:{previousState:"",currentState:""},currentTime:0,duration:0,volume:1,muted:!1,videoTracks:[],audioTracks:[],textTracks:[]};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.UPDATE_PLAYER_STATE:return r({},e,{playerState:t.playerState});case i.UPDATE_IS_PLAYING:return r({},e,{isPlaying:t.isPlaying});case i.UPDATE_CURRENT_TIME:return r({},e,{currentTime:t.currentTime});case i.UPDATE_DURATION:return r({},e,{duration:t.duration});case i.UPDATE_VOLUME:return r({},e,{volume:t.volume});case i.UPDATE_MUTED:return r({},e,{muted:t.muted});case i.UPDATE_METADATA_LOADING_STATUS:return r({},e,{metadataLoaded:t.metadataLoaded});case i.UPDATE_AUDIO_TRACKS:return r({},e,{audioTracks:t.tracks});case i.UPDATE_VIDEO_TRACKS:return r({},e,{videoTracks:t.tracks});case i.UPDATE_TEXT_TRACKS:return r({},e,{textTracks:t.tracks});default:return e}};t.actions={updatePlayerState:function(e,t){return{type:i.UPDATE_PLAYER_STATE,playerState:{prevoiusState:e,currentState:t}}},updateIsPlaying:function(e){return{type:i.UPDATE_IS_PLAYING,isPlaying:e}},updateCurrentTime:function(e){return{type:i.UPDATE_CURRENT_TIME,currentTime:e}},updateDuration:function(e){return{type:i.UPDATE_DURATION,duration:e}},updateVolume:function(e){return{type:i.UPDATE_VOLUME,volume:e}},updateMuted:function(e){return{type:i.UPDATE_MUTED,muted:e}},updateMetadataLoadingStatus:function(e){return{type:i.UPDATE_METADATA_LOADING_STATUS,metadataLoaded:e}},updateAudioTracks:function(e){return{type:i.UPDATE_AUDIO_TRACKS,tracks:e}},updateVideoTracks:function(e){return{type:i.UPDATE_VIDEO_TRACKS,tracks:e}},updateTextTracks:function(e){return{type:i.UPDATE_TEXT_TRACKS,tracks:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={UPDATE_SEEKBAR_DRAGGING_STATUS:"seekbar/UPDATE_SEEKBAR_DRAGGING_STATUS",UPDATE_CURRENT_TIME:"seekbar/UPDATE_CURRENT_TIME",UPDATE_DURATION:"seekbar/UPDATE_DURATION"},a=t.initialState={currentTime:0,duration:0,draggingActive:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.UPDATE_SEEKBAR_DRAGGING_STATUS:return r({},e,{draggingActive:t.draggingActive});case i.UPDATE_CURRENT_TIME:return r({},e,{currentTime:t.currentTime});case i.UPDATE_DURATION:return r({},e,{duration:t.duration});default:return e}};t.actions={updateSeekbarDraggingStatus:function(e){return{type:i.UPDATE_SEEKBAR_DRAGGING_STATUS,draggingActive:e}},updateDuration:function(e){return{type:i.UPDATE_DURATION,duration:e}},updateCurrentTime:function(e){return{type:i.UPDATE_CURRENT_TIME,currentTime:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={UPDATE_VOLUME:"volume/UPDATE_VOLUME",UPDATE_VOLUME_DRAGGING_STATUS:"volume/UPDATE_VOLUME_DRAGGING_STATUS",UPDATE_MUTED:"volume/UPDATE_MUTED"},a=t.initialState={draggingActive:!1,volume:1,muted:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.UPDATE_VOLUME:return r({},e,{volume:t.volume});case i.UPDATE_VOLUME_DRAGGING_STATUS:return r({},e,{draggingActive:t.draggingActive});case i.UPDATE_MUTED:return r({},e,{muted:t.muted});default:return e}};t.actions={updateVolume:function(e){return{type:i.UPDATE_VOLUME,volume:e}},updateVolumeDraggingStatus:function(e){return{type:i.UPDATE_VOLUME_DRAGGING_STATUS,draggingActive:e}},updateMuted:function(e){return{type:i.UPDATE_MUTED,muted:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={UPDATE_FULLSCREEN:"fullscreen/UPDATE_FULLSCREEN"},a=t.initialState={fullscreen:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.UPDATE_FULLSCREEN:return r({},e,{fullscreen:t.fullscreen});default:return e}};t.actions={updateFullscreen:function(e){return{type:i.UPDATE_FULLSCREEN,fullscreen:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={UPDATE_LOADING_SPINNER_STATE:"loading/UPDATE_LOADING_SPINNER_STATE"},a=t.initialState={showLoadingSpinner:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.UPDATE_LOADING_SPINNER_STATE:return r({},e,{show:t.show});default:return e}};t.actions={updateLoadingSpinnerState:function(e){return{type:i.UPDATE_LOADING_SPINNER_STATE,show:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={TOGGLE_CVAA_OVERLAY:"share/TOGGLE_CVAA_OVERLAY"},a=t.initialState={overlayOpen:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.TOGGLE_CVAA_OVERLAY:return r({},e,{overlayOpen:t.show});default:return e}};t.actions={toggleCVAAOverlay:function(e){return{type:i.TOGGLE_CVAA_OVERLAY,show:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={UPDATE_QUALITY:"settings/UPDATE_QUALITY",UPDATE_SPEED:"settings/UPDATE_SPEED"},a=t.initialState={quality:1,speed:2};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.UPDATE_QUALITY:return r({},e,{quality:t.quality});case i.UPDATE_SPEED:return r({},e,{speed:t.speed});default:return e}};t.actions={updateQuality:function(e){return{type:i.UPDATE_QUALITY,quality:e}},updateSpeed:function(e){return{type:i.UPDATE_SPEED,speed:e}}}},function(e,t,n){"use strict";function r(e){var t=parseInt(e,10),n=Math.floor(t/3600),r=Math.floor((t-3600*n)/60),i=t-3600*n-60*r;return n<10&&(n="0"+n),r<10&&(r="0"+r),i<10&&(i="0"+i),r+":"+i}Object.defineProperty(t,"__esModule",{value:!0}),t.toHHMMSS=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),o(t,[{key:"render",value:function(e){return(0,s.h)("div",{className:"smart-container top left"},e.children)}}]),t}(s.Component);t.default=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=n(60),l=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),o(t,[{key:"render",value:function(e){return(0,s.h)("div",{className:"smart-container-item select-menu-item"},(0,s.h)("label",{htmlFor:"quality"},e.label),(0,s.h)(l.default,{onSelect:function(t){return e.onSelect(t)},options:e.options}))}}]),t}(s.Component);t.default=c},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o,s,u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=n(5),f=n(1),d=n(3),h=n(8),p=n(4),v=function(e){return e&&e.__esModule?e:{default:e}}(p),y=(o=(0,f.connect)(null,(0,d.bindActions)(h.actions)))(s=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),u(t,[{key:"componentDidUpdate",value:function(){this.props.open?this.props.addPlayerClass("overlay-active"):this.props.removePlayerClass("overlay-active")}},{key:"render",value:function(e){var t="overlay";return e.type&&(t+=" "+e.type+"-overlay"),e.open&&(t+=" active"),(0,l.h)("div",{className:t,role:"dialog"},(0,l.h)(c.Localizer,null,(0,l.h)("a",{onClick:function(){return e.onClose()},"aria-label":(0,l.h)(c.Text,{id:"core.close"}),className:"close-overlay"},(0,l.h)(v.default,{type:"close"}))),e.children)}}]),t}(l.Component))||s;t.default=y},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),s=n(1),u=n(5),l=n(6),c=n(45),f=r(c),d=n(46),h=r(d),p=n(47),v=r(p),y=n(51),g=r(y),m=n(53),b=r(m),_=n(54),E=r(_),T=n(55),w=r(T),k=n(56),S=r(k),O=n(57),A=r(O),P=n(58),R=r(P),D=n(59),L=r(D),x=n(61),I=r(x),M=n(62),C=r(M),N=n(63),U=r(N),j=n(64),F=r(j),B=n(65),G=r(B),V=n(66),H=r(V),K=n(67),Y=r(K),W=n(68),q=r(W),z=function(){function e(t,n){i(this,e),this.player=t,this.config=n,this.config.ui={translations:{controls:{language:"שפה"}},components:{Loading:{enabled:!0},OverlayPlay:{enabled:!0}}}}return a(e,[{key:"buildCustomUI",value:function(e){this._buildUI(e)}},{key:"buildDefaultUI",value:function(){var e=(0,l.createStore)(f.default,window.devToolsExtension&&window.devToolsExtension({name:"playkit #"+this.config.target,instanceId:this.config.target})),t=(0,o.h)(s.Provider,{store:e},(0,o.h)(u.IntlProvider,{definition:h.default},(0,o.h)(g.default,null,(0,o.h)("div",{className:"player-holder"}),(0,o.h)(v.default,{player:this.player}),(0,o.h)(q.default,{player:this.player}),(0,o.h)(E.default,{player:this.player}),(0,o.h)("div",{className:"player-gui"},(0,o.h)(b.default,{player:this.player}),(0,o.h)(F.default,null,(0,o.h)("div",{className:"left-controls"},(0,o.h)("div",{className:"video-playing-title"},"L21 Earth Time Lapse View from Space, ISS")),(0,o.h)("div",{className:"right-controls"},(0,o.h)(R.default,{player:this.player}))),(0,o.h)(G.default,null,(0,o.h)(S.default,{showFramePreview:!0,showTimeBubble:!0,player:this.player}),(0,o.h)("div",{className:"left-controls"},(0,o.h)(w.default,{player:this.player}),(0,o.h)(U.default,{format:"current / total",player:this.player})),(0,o.h)("div",{className:"right-controls"},(0,o.h)(A.default,{player:this.player}),(0,o.h)(I.default,{player:this.player}),(0,o.h)(L.default,{player:this.player}),(0,o.h)(C.default,{player:this.player}))),(0,o.h)(H.default,null),(0,o.h)(Y.default,null)))));this._buildUI(t)}},{key:"_buildUI",value:function(e){if(this.player){var t=document.createElement("div");document.body.appendChild(t),(0,o.render)(e,t);var n=document.getElementsByTagName("video")["player1"===this.config.target?0:1];n.removeAttribute("style"),t.getElementsByClassName("player-holder")[0].appendChild(n)}}},{key:"release",value:function(){}}]),e}();t.default=z},function(e,t,n){"use strict";function r(e){return null==e?void 0===e?u:s:l&&l in Object(e)?a.a(e):o.a(e)}var i=n(14),a=n(32),o=n(33),s="[object Null]",u="[object Undefined]",l=i.a?i.a.toStringTag:void 0;t.a=r},function(e,t,n){"use strict";var r=n(31),i="object"==typeof self&&self&&self.Object===Object&&self,a=r.a||i||Function("return this")();t.a=a},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(t,n(15))},function(e,t,n){"use strict";function r(e){var t=o.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[u]=n:delete e[u]),i}var i=n(14),a=Object.prototype,o=a.hasOwnProperty,s=a.toString,u=i.a?i.a.toStringTag:void 0;t.a=r},function(e,t,n){"use strict";function r(e){return a.call(e)}var i=Object.prototype,a=i.toString;t.a=r},function(e,t,n){"use strict";var r=n(35),i=r.a(Object.getPrototypeOf,Object);t.a=i},function(e,t,n){"use strict";function r(e,t){return function(n){return e(t(n))}}t.a=r},function(e,t,n){"use strict";function r(e){return null!=e&&"object"==typeof e}t.a=r},function(e,t,n){e.exports=n(38)},function(e,t,n){"use strict";(function(e,r){Object.defineProperty(t,"__esModule",{value:!0});var i,a=n(40),o=function(e){return e&&e.__esModule?e:{default:e}}(a);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var s=(0,o.default)(i);t.default=s}).call(t,n(15),n(39)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,n){"use strict";(function(e){function r(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function i(e,t,n,r){var i=Object.keys(t),a=n&&n.type===s.a.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===i.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!u.a(e))return"The "+a+' has unexpected type of "'+{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1]+'". Expected argument to be an object with the following keys: "'+i.join('", "')+'"';var o=Object.keys(e).filter(function(e){return!t.hasOwnProperty(e)&&!r[e]});return o.forEach(function(e){r[e]=!0}),o.length>0?"Unexpected "+(o.length>1?"keys":"key")+' "'+o.join('", "')+'" found in '+a+'. Expected to find one of the known reducer keys instead: "'+i.join('", "')+'". Unexpected keys will be ignored.':void 0}function a(e){Object.keys(e).forEach(function(t){var n=e[t];if(void 0===n(void 0,{type:s.a.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+s.a.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}function o(t){for(var n=Object.keys(t),o={},s=0;s<n.length;s++){var u=n[s];"production"!==e.env.NODE_ENV&&void 0===t[u]&&l.a('No reducer provided for key "'+u+'"'),"function"==typeof t[u]&&(o[u]=t[u])}var c=Object.keys(o),f=void 0;"production"!==e.env.NODE_ENV&&(f={});var d=void 0;try{a(o)}catch(e){d=e}return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1];if(d)throw d;if("production"!==e.env.NODE_ENV){var a=i(t,o,n,f);a&&l.a(a)}for(var s=!1,u={},h=0;h<c.length;h++){var p=c[h],v=o[p],y=t[p],g=v(y,n);if(void 0===g){var m=r(p,n);throw new Error(m)}u[p]=g,s=s||g!==y}return s?u:t}}t.a=o;var s=n(12),u=n(13),l=n(7)}).call(t,n(11))},function(e,t,n){"use strict";function r(e,t){return function(){return t(e.apply(void 0,arguments))}}function i(e,t){if("function"==typeof e)return r(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),i={},o=0;o<n.length;o++){var s=n[o],u=e[s];"function"==typeof u?i[s]=r(u,t):a.a("bindActionCreators expected a function actionCreator for key '"+s+"', instead received type '"+typeof u+"'.")}return i}t.a=i;var a=n(7)},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,o){var s=e(n,r,o),u=s.dispatch,l=[],c={getState:s.getState,dispatch:function(e){return u(e)}};return l=t.map(function(e){return e(c)}),u=i.a.apply(void 0,l)(s.dispatch),a({},s,{dispatch:u})}}}t.a=r;var i=n(16),a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){function e(e,t,n,r){for(r=0,t=t.split?t.split("."):t;e&&r<t.length;)e=e[t[r++]];return void 0===e?n:e}return e})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),a=n(17),o=r(a),s=n(8),u=r(s),l=n(9),c=r(l),f=n(18),d=r(f),h=n(19),p=r(h),v=n(20),y=r(v),g=n(21),m=r(g),b=n(10),_=r(b),E=n(22),T=r(E),w=n(23),k=r(w),S=(0,i.combineReducers)({engine:o.default,shell:u.default,seekbar:d.default,volume:p.default,fullscreen:y.default,loading:m.default,playPause:c.default,share:_.default,cvaa:T.default,settings:k.default});t.default=S},function(e,t){e.exports={core:{disable:"Disable",auto:"Auto",close:"Close"},controls:{play:"Play",pause:"Pause",share:"Share",language:"Language",settings:"Settings",fullscreen:"Fullscreen"},settings:{quality:"Quality",speed:"Speed"},language:{audio:"Audio",captions:"Captions",advanced_captions_settings:"Advanced captions settings"},share:{share_title:"Partager",link_options:"Options de lien"}}},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(1),d=n(3),h=n(17),p=r(h),v=n(2),y=r(v),g=(s=(0,f.connect)(p.default,(0,d.bindActions)(h.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"EngineConnector",player:e.player}))}return o(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this;this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED,function(t){e.props.updatePlayerState(t.payload.oldState.type,t.payload.newState.type)}),this.player.addEventListener(this.player.Event.TIME_UPDATE,function(){e.props.updateCurrentTime(e.player.currentTime)}),this.player.addEventListener(this.player.Event.LOADED_METADATA,function(){e.props.updateDuration(e.player.duration),e.props.updateMetadataLoadingStatus(!0);var t=e.player.Track,n=e.player.getTracks(t.AUDIO),r=e.player.getTracks(t.VIDEO),i=e.player.getTracks(t.TEXT);e.props.updateAudioTracks(n),e.props.updateVideoTracks(r),e.props.updateTextTracks(i)}),this.player.addEventListener(this.player.Event.VOLUME_CHANGE,function(){e.props.updateVolume(e.player.volume)}),this.player.addEventListener(this.player.Event.PLAY,function(){e.props.updateIsPlaying(!0)}),this.player.addEventListener(this.player.Event.PAUSE,function(){e.props.updateIsPlaying(!1)})}},{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,c.h)("span",null)}}]),t}(y.default))||u;t.default=g},function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.LOG_LEVEL=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(50),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),s={DEBUG:o.DEBUG,INFO:o.INFO,TIME:o.TIME,WARN:o.WARN,ERROR:o.ERROR,OFF:o.OFF},u=function(){function e(t){r(this,e),o.useDefaults(t||{})}return i(e,[{key:"getLogger",value:function(e){return e?o.get(e):o}}]),e}(),l=new u({defaultLevel:o.DEBUG});t.default=l,t.LOG_LEVEL=s},function(e,t,n){var r,i;/*! +!function(a){"use strict";var o={};o.VERSION="1.3.0";var s,u={},l=function(e,t){return function(){return t.apply(e,arguments)}},c=function(){var e,t,n=arguments,r=n[0];for(t=1;t<n.length;t++)for(e in n[t])e in r||!n[t].hasOwnProperty(e)||(r[e]=n[t][e]);return r},f=function(e,t){return{value:e,name:t}};o.DEBUG=f(1,"DEBUG"),o.INFO=f(2,"INFO"),o.TIME=f(3,"TIME"),o.WARN=f(4,"WARN"),o.ERROR=f(8,"ERROR"),o.OFF=f(99,"OFF");var d=function(e){this.context=e,this.setLevel(e.filterLevel),this.log=this.info};d.prototype={setLevel:function(e){e&&"value"in e&&(this.context.filterLevel=e)},enabledFor:function(e){var t=this.context.filterLevel;return e.value>=t.value},debug:function(){this.invoke(o.DEBUG,arguments)},info:function(){this.invoke(o.INFO,arguments)},warn:function(){this.invoke(o.WARN,arguments)},error:function(){this.invoke(o.ERROR,arguments)},time:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"start"])},timeEnd:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"end"])},invoke:function(e,t){s&&this.enabledFor(e)&&s(t,c({level:e},this.context))}};var h=new d({filterLevel:o.OFF});!function(){var e=o;e.enabledFor=l(h,h.enabledFor),e.debug=l(h,h.debug),e.time=l(h,h.time),e.timeEnd=l(h,h.timeEnd),e.info=l(h,h.info),e.warn=l(h,h.warn),e.error=l(h,h.error),e.log=e.info}(),o.setHandler=function(e){s=e},o.setLevel=function(e){h.setLevel(e);for(var t in u)u.hasOwnProperty(t)&&u[t].setLevel(e)},o.get=function(e){return u[e]||(u[e]=new d(c({name:e},h.context)))},o.createDefaultHandler=function(e){e=e||{},e.formatter=e.formatter||function(e,t){t.name&&e.unshift("["+t.name+"]")};var t={},n=function(e,t){Function.prototype.apply.call(e,console,t)};return"undefined"==typeof console?function(){}:function(r,i){r=Array.prototype.slice.call(r);var a,s=console.log;i.level===o.TIME?(a=(i.name?"["+i.name+"] ":"")+r[0],"start"===r[1]?console.time?console.time(a):t[a]=(new Date).getTime():console.timeEnd?console.timeEnd(a):n(s,[a+": "+((new Date).getTime()-t[a])+"ms"])):(i.level===o.WARN&&console.warn?s=console.warn:i.level===o.ERROR&&console.error?s=console.error:i.level===o.INFO&&console.info&&(s=console.info),e.formatter(r,i),n(s,r))}},o.useDefaults=function(e){o.setLevel(e&&e.defaultLevel||o.DEBUG),o.setHandler(o.createDefaultHandler(e))},r=o,void 0!==(i="function"==typeof r?r.call(t,n,t,e):r)&&(e.exports=i)}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),a=n(7),o=(function(e){e&&e.__esModule}(a),function e(){r(this,e),this.metaData=new Map,this.type=i.MediaEntryType.Unknown});t.default=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=(n(2),function e(t,n){r(this,e),this.licenseUrl=t,this.scheme=n});t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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}),t.MediaFormat=void 0;var o=n(18);(t.MediaFormat=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(o.Enum)).initEnum({dash:{get mimeType(){return"application/dash+xml"},get pathExt(){return"mpd"}},hls:{get mimeType(){return"application/x-mpegURL"},get pathExt(){return"m3u8"}},wvm:{get mimeType(){return"video/wvm"},get pathExt(){return"wvm"}},mp4:{get mimeType(){return"video/mp4"},get pathExt(){return"mp4"}},mp3:{get mimeType(){return"audio/mpeg"},get pathExt(){return"mp3"}}})},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=n(10),a=(function(e){e&&e.__esModule}(i),function e(){r(this,e)});t.default=a},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=(n(2),function e(t){r(this,e),this.id=t.id,this.flavorParamsId=t.flavorParamsId,this.fileExt=t.fileExt,this.bitrate=t.bitrate,this.width=t.width,this.height=t.height,this.id=t.id,this.frameRate=t.frameRate,this.isOriginal=t.isOriginal,this.isWeb=t.isWeb,this.containerFormat=t.containerFormat,this.videoCodecId=t.videoCodecId,this.status=t.status,this.language=t.language,this.label=t.label});t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=(n(2),function e(t){r(this,e),this.id=t.id,this.name=t.name,this.dataUrl=t.dataUrl,this.type=t.type,this.entryType=t.mediaType,this.flavorParamsIds=t.flavorParamsIds,this.duration=t.duration});t.default=i},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=n(4),u=r(s),l=n(30),c=r(l),f=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.hasError||(n.totalCount=e.totalCount,n.totalCount>0&&(n.metas=[],e.objects.map(function(e){return n.metas.push(new c.default(e))}))),n}return o(t,e),t}(u.default);t.default=f},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=n(4),u=r(s),l=n(27),c=r(l),f=n(17),d=r(f),h=n(31),p=r(h),v=n(13),g=r(v),y=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if(n.sources=[],n.actions=[],n.messages=[],n.flavorAssets=[],!n.hasError){var r=e.messages;r&&r.map(function(e){return n.messages.push(new c.default(e))});var o=e.actions;o&&o.map(function(e){return n.actions.push(new p.default(e))});var s=e.sources;s&&s.map(function(e){return n.sources.push(new d.default(e))});var u=e.flavorAssets;u&&u.map(function(e){return n.flavorAssets.push(new g.default(e))})}return n}return o(t,e),t}(u.default);t.default=y},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(29),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(){function e(t){var n=this;r(this,e),this.drm=[],this.format=t.format,this.deliveryProfileId=t.deliveryProfileId,this.url=t.url,this.protocols=t.protocols,this.flavorIds=t.flavorIds,t.drm&&t.drm.map(function(e){return n.drm.push(new o.default(e))})}return i(e,[{key:"hasDrmData",value:function(){return this.drm&&this.drm.length>0}},{key:"hasFlavorIds",value:function(){return!!this.flavorIds&&this.flavorIds.length>0}},{key:"getProtocol",value:function(e){var t="";if(this.protocols&&this.protocols.length>0){this.protocols.split(",").forEach(function(n){n==e&&(t=n)})}else if("http"==e)return e;return t}}]),e}();t.default=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){var n=!0,r=!1,i=void 0;try{for(var a,o=Object.getOwnPropertyNames(t)[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value,u=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,u)}}catch(e){r=!0,i=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw i}}return e}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0}),t.copyProperties=i;var s=Symbol();t.Enum=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?void 0:arguments[0];if(r(this,e),{}.hasOwnProperty.call(this.constructor,s))throw new Error("Enum classes can’t be instantiated");"object"===(void 0===t?"undefined":a(t))&&null!==t&&i(this,t)}return o(e,[{key:"toString",value:function(){return this.constructor.name+"."+this.name}}],[{key:"initEnum",value:function(e){return Object.defineProperty(this,"enumValues",{value:[],configurable:!1,writable:!1,enumerable:!0}),Array.isArray(e)?this._enumValuesFromArray(e):this._enumValuesFromObject(e),Object.freeze(this.enumValues),this[s]=!0,this}},{key:"_enumValuesFromArray",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;this._pushEnumValue(new this,o)}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}},{key:"_enumValuesFromObject",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,a=Object.keys(e)[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value,s=new this(e[o]);this._pushEnumValue(s,o)}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}},{key:"_pushEnumValue",value:function(e,t){e.name=t,e.ordinal=this.enumValues.length,Object.defineProperty(this,t,{value:e,configurable:!1,writable:!1,enumerable:!0}),this.enumValues.push(e)}},{key:"enumValueOf",value:function(e){return this.enumValues.find(function(t){return t.name===e})}},{key:Symbol.iterator,value:function(){return this.enumValues[Symbol.iterator]()}}]),e}()},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(3),s=r(o),u=n(6),l=(r(u),function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";i(this,e),this._loaders=new Map,this._multiRequest=s.default.getMultirequest(n,t)}return a(e,[{key:"add",value:function(t,n){var r=this,i=new t(n);if(i.isValid()){this._loaders.set(t.name,i);var a=this._multiRequest.requests.length,o=i.requests;o.forEach(function(e){r._multiRequest.add(e)});var s=Array.from(new Array(o.length),function(e,t){return t+a});e._loadersResponseMap.set(t.name,s)}}},{key:"fetchData",value:function(){var e=this;return new Promise(function(t,n){e._multiRequest.execute().then(function(r){if(e._multiResponse=r,r.success){var i=e.prepareData(r);i.success?t(e._loaders):n({success:!1,data:i.error})}else n(r)},function(e){n(e)})})}},{key:"prepareData",value:function(t){return this._loaders.forEach(function(n,r){var i=e._loadersResponseMap.get(r);try{null!=i&&(n.response=t.results.slice(i[0],i[i.length-1]+1))}catch(e){return{success:!1,error:e}}}),{success:!0,data:this._loaders}}}]),e}());l._loadersResponseMap=new Map,t.default=l},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),s=(r(o),n(33)),u=r(s),l=n(34),c=r(l),f=n(1),d=r(f),h=n(16),p=r(h),v=n(15),g=r(v),y=n(28),m=r(y),b=d.default.get(),_=function(){function e(t){i(this,e),this._response={},this.requests=this.buildRequests(t),this._entryId=t.entryId}return a(e,null,[{key:"name",get:function(){return"media"}}]),a(e,[{key:"buildRequests",value:function(e){var t=[];return t.push(u.default.list(b.beUrl,e.ks,e.entryId)),t.push(u.default.getPlaybackContext(b.beUrl,e.ks,e.entryId)),t.push(c.default.list(b.beUrl,e.ks,e.entryId)),t}},{key:"isValid",value:function(){return!!this._entryId}},{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){var t=new m.default(e[0].data);this._response.entry=t.entries[0],this._response.playBackContextResult=new p.default(e[1].data),this._response.metadataListResult=new g.default(e[2].data)},get:function(){return this._response}}]),e}();t.default=_},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(35),s=r(o),u=n(1),l=r(u),c=n(0),f=(r(c),l.default.get()),d=function(){function e(t){i(this,e),this._response={},this.requests=this.buildRequests(t),this._partnerId=t.partnerId}return a(e,null,[{key:"name",get:function(){return"session"}}]),a(e,[{key:"buildRequests",value:function(e){var t=[];return t.push(s.default.anonymousSession(f.beUrl,e.partnerId)),t}},{key:"isValid",value:function(){return!!this._partnerId}},{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.ks=e[0].data.ks},get:function(){return this._response.ks}}]),e}();t.default=d},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(37),s=r(o),u=n(32),l=r(u),c=n(1),f=r(c),d=n(0),h=(r(d),f.default.get()),p=function(){function e(t){i(this,e),this._response={},this.requests=this.buildRequests(t),this._uiConfId=t.uiConfId}return a(e,null,[{key:"name",get:function(){return"uiConf"}}]),a(e,[{key:"buildRequests",value:function(e){var t=[];return t.push(s.default.get(h.beUrl,e.ks,e.uiConfId)),t}},{key:"isValid",value:function(){return!!this._uiConfId}},{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.uiConf=new l.default(e[0].data)},get:function(){if(null==this._response||null==this._response.uiConf||null==this._response.uiConf.config)return null;try{return JSON.parse(this._response.uiConf.config).plugins}catch(e){return null}}}]),e}();t.default=p},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(14),s=(r(o),n(16)),u=(r(s),n(17)),l=(r(u),n(13)),c=(r(l),n(15)),f=(r(c),n(26)),d=r(f),h=n(38),p=r(h),v=n(2),g=n(5),y=r(g),m=n(1),b=r(m),_=n(11),E=n(9),T=r(E),w=n(10),k=r(w),S=n(12),A=r(S),O=n(7),P=r(O),R=b.default.get(),D=y.default.get("OvpProvider"),x=new Map([["mpegdash",_.MediaFormat.dash],["applehttp",_.MediaFormat.hls],["url",_.MediaFormat.mp4]]),L=function(){function e(){i(this,e)}return a(e,null,[{key:"getMediaEntry",value:function(e,t,n,r){var i=this,a=new T.default,o=r.entry,s=r.playBackContextResult,u=r.metadataListResult,l=s.sources,c=new P.default;l&&l.length>0&&l.forEach(function(r){var a=i.parseSource(r,e,t,n,o,s),u=x.get(r.format);c.map(a,u)}),a.sources=c;var f=this.parseMetaData(u);a.metaData=f,a.id=o.id,a.duration=o.duration;var d=v.MediaEntryType.Unknown;switch(o.entryType){case v.MediaType.IMAGE.value:d=v.MediaEntryType.Image;break;case v.MediaType.AUDIO.value:d=v.MediaEntryType.Audio;break;default:switch(o.type){case v.EntryType.MEDIA_CLIP.value:d=v.MediaEntryType.Vod;break;case v.EntryType.LIVE_STREAM.value:case v.EntryType.LIVE_CHANNEL.value:d=v.MediaEntryType.Live;break;default:d=v.MediaEntryType.Unknown}}return a.type=d,a}},{key:"parseSource",value:function(e,t,n,r,i,a){var o="",s=x.get(e.format),u=new A.default;if(e.hasFlavorIds()){var l=R.baseUrl.split("/"),c=void 0;c=l&&l.length>0?l[0].substring(0,l[0].length-1):"http";var f="";if(s)f=s.pathExt,u.mimetype=s.mimeType;else{var h=e.flavorIds.split(","),p=a.flavorAssets.filter(function(e){return-1!=h.indexOf(e.id)});p&&p.length>0&&(f=p[0].fileExt)}o=d.default.build({entryId:i.id,flavorIds:e.flavorIds,format:e.format,ks:t,partnerId:n,uiConfId:r,extension:f,protocol:e.getProtocol(c)})}else o=e.url;if(""==o)return D.error("failed to create play url from source, discarding source: ("+i.id+"_"+e.deliveryProfileId+"), "+e.format+"."),u;if(u.url=o,u.id=i.id+"_"+e.deliveryProfileId+","+e.format,e.hasDrmData()){var v=[];e.drm.forEach(function(e){v.push(new k.default(e.licenseURL,e.scheme))}),u.drmData=v}return u}},{key:"parseMetaData",value:function(e){var t={};return e&&e.metas&&e.metas.length>0&&e.metas.forEach(function(e){var n=void 0,r=new DOMParser;e.xml=e.xml.replace(/\r?\n|\r/g,""),e.xml=e.xml.replace(/>\s*/g,">"),e.xml=e.xml.replace(/>\s*/g,">"),n=r.parseFromString(e.xml,"text/xml");var i=p.default.xmlToJson(n);Object.keys(i.metadata).forEach(function(e){t[e]=i.metadata[e]["#text"]})}),t}}]),e}();t.default=L},,function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0}),t.OvpProvider=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(5),s=r(o),u=n(23),l=r(u),c=n(19),f=r(c),d=n(20),h=r(d),p=n(21),v=r(p),g=n(22),y=r(g),m=n(1),b=r(m),_=n(9),E=(r(_),n(7)),T=r(E),w=s.default.get("OvpProvider"),k=t.OvpProvider=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments[2];i(this,e),this.partnerID=t,this.ks=n,this._isAnonymous=!this.ks,b.default.set(r)}return a(e,[{key:"getConfig",value:function(e,t){var n=this;return null!=t&&(this._uiConfId=t),this._dataLoader=new f.default(this.partnerID,this.ks),new Promise(function(r,i){if(n.validateParams(e,t)){var a=n.ks;n._isAnonymous&&(a="{1:result:ks}",n._dataLoader.add(v.default,{partnerId:n.partnerID})),n._dataLoader.add(h.default,{entryId:e,ks:a}),n._dataLoader.add(y.default,{uiConfId:t,ks:a}),n._dataLoader.fetchData().then(function(e){r(n.parseDataFromResponse(e))},function(e){i(e)})}else i({success:!1,data:"Missing mandatory parameter"})})}},{key:"parseDataFromResponse",value:function(e){w.debug("Data parsing started");var t={id:"",session:{partnerID:this.partnerID,uiConfID:this._uiConfId},sources:new T.default,duration:0,type:"Unknown",metadata:{},plugins:{}};if(null!=e){if(e.has(v.default.name)){var n=e.get(v.default.name);null!=n&&null!=n.response&&(this.ks=n.response,this._isAnonymous=!this.ks,t.session.ks=this.ks)}if(e.has(y.default.name)){var r=e.get(y.default.name),i={};null!=r&&(i=r.response),t.plugins=i}if(e.has(h.default.name)){var a=e.get(h.default.name);if(null!=a&&null!=a.response){var o=l.default.getMediaEntry(this.ks,this.partnerID,this._uiConfId,a.response);t.id=o.id,t.sources=o.sources,t.duration=o.duration,t.type=o.type.name,t.metadata=o.metaData}}}return w.debug("Data parsing finished",t),t}},{key:"validateParams",value:function(e,t){return!!e||!!t}}]),e}();t.default=k},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=o.default.get(),u=function(){function e(){r(this,e)}return i(e,null,[{key:"build",value:function(t){var n=s.baseUrl,r=t.partnerId,i=t.entryId,a=t.ks,o=t.uiConfId,u=t.format,l=t.protocol,c=t.extension,f=t.flavorIds;if(""==n&&""==r&&""==i&&""==c&&""==u)return"";var d=n;return e.endsWith(n,"/")||(d+="/"),d+="p/"+r+"/sp/"+r+"00/playManifest/entryId/"+i+"/protocol/"+l+"/format/"+u,""!=f?d+="/falvorIds/"+f:""!=o&&(d+="/uiConfId/"+o),""!=this.ks&&(d+="/ks/"+a),d+="/a."+c,o&&""!=f&&(d+="?uiConfId=."+o),d}},{key:"endsWith",value:function(e,t){return"string"==typeof e&&("string"==typeof t&&-1!=e.indexOf(t,e.length-t.length))}}]),e}();t.default=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function e(t){r(this,e),this.message=t.message,this.code=t.code};t.default=i},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=n(4),u=r(s),l=n(14),c=r(l),f=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.hasError||(n.totalCount=e.totalCount,n.totalCount>0&&(n.entries=[],e.objects.map(function(e){return n.entries.push(new c.default(e))}))),n}return o(t,e),t}(u.default);t.default=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=(n(2),function e(t){r(this,e),this.scheme=t.scheme,this.licenseURL=t.licenseURL});t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=(n(2),function e(t){r(this,e),this.id=t.id,this.metadataProfileId=t.metadataProfileId,this.metadataProfileVersion=t.metadataProfileVersion,this.metadataProfileId=t.metadataProfileId,this.metadataObjectType=t.metadataObjectType,this.objectId=t.objectId,this.version=t.version,this.created=new Date(0),this.created.setUTCSeconds(t.createdAt),this.updated=new Date(0),this.updated.setUTCSeconds(t.updatedAt),this.status=t.status,this.xml=t.xml});t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=(n(2),function e(t){r(this,e),this.type=t.type});t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=n(4),s=function(e){return e&&e.__esModule?e:{default:e}}(o),u=(n(2),function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.hasError||(n.name=e.name,n.description=e.description,n.objTypeAsString=e.objTypeAsString,n.width=e.width,n.height=e.height,n.htmlParams=e.htmlParams,n.swfUrl=e.swfUrl,n.confFilePath=e.confFilePath,n.confFile=e.confFile,n.confFileFeatures=e.confFileFeatures,n.config=e.config,n.confVars=e.confVars,n.useCdn=e.useCdn,n.tags=e.tags,n.swfUrlVersion=e.swfUrlVersion,n.created=new Date(0),n.created.setUTCSeconds(e.createdAt),n.updated=new Date(0),n.updated.setUTCSeconds(e.updatedAt),n.html5Url=e.description,n.version=e.description,n.partnerTags=e.description,n.objType=e.description,n.creationMode=e.description),n}return a(t,e),t}(s.default));t.default=u},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(3),l=r(u),c=n(0),f=r(c),d=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),s(t,null,[{key:"getPlaybackContext",value:function(e,t,n){var r=new f.default;r.service="baseEntry",r.action="getPlaybackContext",r.method="POST",r.baseUrl=e,r.tag="baseEntry-getPlaybackContext";var i={objectType:"KalturaContextDataParams",flavorTags:"all"},a={entryId:n,ks:t,contextDataParams:i};return r.params=a,r}},{key:"list",value:function(e,n,r){var i=new f.default;return i.service="baseEntry",i.action="list",i.method="POST",i.baseUrl=e,i.tag="list",i.params=t.getEntryListReqParams(r,n),i}},{key:"getEntryListReqParams",value:function(e,t){return{ks:t,filter:{redirectFromEntryId:e},responseProfile:{fields:"id,name,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags",type:1}}}}]),t}(l.default);t.default=d},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(3),l=r(u),c=n(0),f=r(c),d=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),s(t,null,[{key:"list",value:function(e,t,n){var r=new f.default;r.service="metadata_metadata",r.action="list",r.method="POST",r.baseUrl=e,r.tag="metadata_metadata-list";var i={objectType:"KalturaMetadataFilter",objectIdEqual:n,metadataObjectTypeEqual:"1"},a={filter:i,ks:t};return r.params=a,r}}]),t}(l.default);t.default=d},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(3),l=r(u),c=n(0),f=r(c),d=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),s(t,null,[{key:"anonymousSession",value:function(e,t){var n=new f.default;return n.service="session",n.action="startWidgetSession",n.method="POST",n.baseUrl=e,n.tag="session-startWidget",n.params={widgetId:"_"+t},n}}]),t}(l.default);t.default=d},,function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(3),l=r(u),c=n(0),f=r(c),d=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),s(t,null,[{key:"get",value:function(e,t,n){var r=new f.default;r.service="uiconf",r.action="get",r.method="POST",r.baseUrl=e,r.tag="uiconf-get";var i={fields:"config",type:1};return r.params={id:n,responseProfile:i,ks:t},r}}]),t}(l.default);t.default=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e)}return i(e,null,[{key:"xmlToJson",value:function(e){var t={};if(1==e.nodeType){if(e.attributes.length>0){t["@attributes"]={};for(var n=0;n<e.attributes.length;n++){var r=e.attributes.item(n);t["@attributes"][r.nodeName]=r.nodeValue}}}else 3==e.nodeType&&(t=e.nodeValue);if(e.hasChildNodes())for(var i=0;i<e.childNodes.length;i++){var a=e.childNodes.item(i),o=a.nodeName;if(void 0===t[o])t[o]=this.xmlToJson(a);else{if(void 0===t[o].push){var s=t[o];t[o]=[],t[o].push(s)}t[o].push(this.xmlToJson(a))}}return t}}]),e}();t.default=a}])})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.setup=t.PlaykitUI=t.OvpProvider=t.Playkit=void 0;var i=n(0),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(i),o=n(1),s=r(o),u=n(3),l=r(u);n(4),n(9),n(11);var c=n(13),f=r(c);t.Playkit=a,t.OvpProvider=s.default,t.PlaykitUI=l.default,t.setup=f.default},function(e,t,n){!function(t,r){e.exports=r(n(0))}(0,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=28)}([function(e,t,n){!function(){"use strict";function t(){}function n(e,n){var r,i,a,o,s=I;for(o=arguments.length;o-- >2;)L.push(arguments[o]);for(n&&null!=n.children&&(L.length||L.push(n.children),delete n.children);L.length;)if((i=L.pop())&&void 0!==i.pop)for(o=i.length;o--;)L.push(i[o]);else!0!==i&&!1!==i||(i=null),(a="function"!=typeof e)&&(null==i?i="":"number"==typeof i?i=String(i):"string"!=typeof i&&(a=!1)),a&&r?s[s.length-1]+=i:s===I?s=[i]:s.push(i),r=a;var u=new t;return u.nodeName=e,u.children=s,u.attributes=null==n?void 0:n,u.key=null==n?void 0:n.key,void 0!==x.vnode&&x.vnode(u),u}function r(e,t){for(var n in t)e[n]=t[n];return e}function i(e,t){return n(e.nodeName,r(r({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}function a(e){!e.__d&&(e.__d=!0)&&1==C.push(e)&&(x.debounceRendering||setTimeout)(o)}function o(){var e,t=C;for(C=[];e=t.pop();)e.__d&&A(e)}function s(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&u(e,t.nodeName):n||e._componentConstructor===t.nodeName}function u(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function l(e){var t=r({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var i in n)void 0===t[i]&&(t[i]=n[i]);return t}function c(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function f(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t,n,r,i){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||i)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var a in n)a in r||(e.style[a]="");for(var a in r)e.style[a]="number"==typeof r[a]&&!1===M.test(a)?r[a]+"px":r[a]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var o=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,p,o):e.removeEventListener(t,p,o),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!i&&t in e)h(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=i&&t!==(t=t.replace(/^xlink\:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function h(e,t,n){try{e[t]=n}catch(e){}}function p(e){return this.__l[e.type](x.event&&x.event(e)||e)}function v(){for(var e;e=N.pop();)x.afterMount&&x.afterMount(e),e.componentDidMount&&e.componentDidMount()}function g(e,t,n,r,i,a){U++||(j=null!=i&&void 0!==i.ownerSVGElement,F=null!=e&&!("__preactattr_"in e));var o=y(e,t,n,r,a);return i&&o.parentNode!==i&&i.appendChild(o),--U||(F=!1,a||v()),o}function y(e,t,n,r,i){var a=e,o=j;if(null==t&&(t=""),"string"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||i)?e.nodeValue!=t&&(e.nodeValue=t):(a=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(a,e),b(e,!0))),a.__preactattr_=!0,a;if("function"==typeof t.nodeName)return O(e,t,n,r);if(j="svg"===t.nodeName||"foreignObject"!==t.nodeName&&j,(!e||!u(e,String(t.nodeName)))&&(a=c(String(t.nodeName),j),e)){for(;e.firstChild;)a.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(a,e),b(e,!0)}var s=a.firstChild,l=a.__preactattr_||(a.__preactattr_={}),f=t.children;return!F&&f&&1===f.length&&"string"==typeof f[0]&&null!=s&&void 0!==s.splitText&&null==s.nextSibling?s.nodeValue!=f[0]&&(s.nodeValue=f[0]):(f&&f.length||null!=s)&&m(a,f,n,r,F||null!=l.dangerouslySetInnerHTML),E(a,t.attributes,l),j=o,a}function m(e,t,n,r,i){var a,o,u,l,c=e.childNodes,d=[],h={},p=0,v=0,g=c.length,m=0,_=t?t.length:0;if(0!==g)for(var E=0;E<g;E++){var T=c[E],w=T.__preactattr_,k=_&&w?T._component?T._component.__k:w.key:null;null!=k?(p++,h[k]=T):(w||(void 0!==T.splitText?!i||T.nodeValue.trim():i))&&(d[m++]=T)}if(0!==_)for(var E=0;E<_;E++){u=t[E],l=null;var k=u.key;if(null!=k)p&&void 0!==h[k]&&(l=h[k],h[k]=void 0,p--);else if(!l&&v<m)for(a=v;a<m;a++)if(void 0!==d[a]&&s(o=d[a],u,i)){l=o,d[a]=void 0,a===m-1&&m--,a===v&&v++;break}l=y(l,u,n,r),l&&l!==e&&(E>=g?e.appendChild(l):l!==c[E]&&(l===c[E+1]?f(c[E]):e.insertBefore(l,c[E]||null)))}if(p)for(var E in h)void 0!==h[E]&&b(h[E],!1);for(;v<=m;)void 0!==(l=d[m--])&&b(l,!1)}function b(e,t){var n=e._component;n?P(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||f(e),_(e))}function _(e){for(e=e.lastChild;e;){var t=e.previousSibling;b(e,!0),e=t}}function E(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||d(e,r,n[r],n[r]=void 0,j);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||d(e,r,n[r],n[r]=t[r],j)}function T(e){var t=e.constructor.name;(B[t]||(B[t]=[])).push(e)}function w(e,t,n){var r,i=B[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),R.call(r,t,n)):(r=new R(t,n),r.constructor=e,r.render=k),i)for(var a=i.length;a--;)if(i[a].constructor===e){r.__b=i[a].__b,i.splice(a,1);break}return r}function k(e,t,n){return this.constructor(e,n)}function S(e,t,n,r,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,r),r&&r!==e.context&&(e.__c||(e.__c=e.context),e.context=r),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===x.syncComponentUpdates&&e.base?a(e):A(e,1,i)),e.__r&&e.__r(e))}function A(e,t,n,i){if(!e.__x){var a,o,s,u=e.props,c=e.state,f=e.context,d=e.__p||u,h=e.__s||c,p=e.__c||f,y=e.base,m=e.__b,_=y||m,E=e._component,T=!1;if(y&&(e.props=d,e.state=h,e.context=p,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,c,f)?T=!0:e.componentWillUpdate&&e.componentWillUpdate(u,c,f),e.props=u,e.state=c,e.context=f),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!T){a=e.render(u,c,f),e.getChildContext&&(f=r(r({},f),e.getChildContext()));var k,O,R=a&&a.nodeName;if("function"==typeof R){var D=l(a);o=E,o&&o.constructor===R&&D.key==o.__k?S(o,D,1,f,!1):(k=o,e._component=o=w(R,D,f),o.__b=o.__b||m,o.__u=e,S(o,D,0,f,!1),A(o,1,n,!0)),O=o.base}else s=_,k=E,k&&(s=e._component=null),(_||1===t)&&(s&&(s._component=null),O=g(s,a,f,n||!y,_&&_.parentNode,!0));if(_&&O!==_&&o!==E){var L=_.parentNode;L&&O!==L&&(L.replaceChild(O,_),k||(_._component=null,b(_,!1)))}if(k&&P(k),e.base=O,O&&!i){for(var I=e,M=e;M=M.__u;)(I=M).base=O;O._component=I,O._componentConstructor=I.constructor}}if(!y||n?N.unshift(e):T||(v(),e.componentDidUpdate&&e.componentDidUpdate(d,h,p),x.afterUpdate&&x.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);U||i||v()}}function O(e,t,n,r){for(var i=e&&e._component,a=i,o=e,s=i&&e._componentConstructor===t.nodeName,u=s,c=l(t);i&&!u&&(i=i.__u);)u=i.constructor===t.nodeName;return i&&u&&(!r||i._component)?(S(i,c,3,n,r),e=i.base):(a&&!s&&(P(a),e=o=null),i=w(t.nodeName,c,n),e&&!i.__b&&(i.__b=e,o=null),S(i,c,1,n,r),e=i.base,o&&e!==o&&(o._component=null,b(o,!1))),e}function P(e){x.beforeUnmount&&x.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?P(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,f(t),T(e),_(t)),e.__r&&e.__r(null)}function R(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}function D(e,t,n){return g(n,e,{},!1,t,!1)}var x={},L=[],I=[],M=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,C=[],N=[],U=0,j=!1,F=!1,B={};r(R.prototype,{setState:function(e,t){var n=this.state;this.__s||(this.__s=r({},n)),r(n,"function"==typeof e?e(n,this.props):e),t&&(this.__h=this.__h||[]).push(t),a(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),A(this,2)},render:function(){}});var G={h:n,createElement:n,cloneElement:i,Component:R,render:D,rerender:o,options:x};e.exports=G}()},function(e,t,n){!function(t,r){e.exports=r(n(0),n(6))}(0,function(e,t){function n(){}function r(){var e=[],t=[];return{clear:function(){t=B,e=B},notify:function(){for(var n=e=t,r=0;r<n.length;r++)n[r]()},subscribe:function(n){var r=!0;return t===e&&(t=e.slice()),t.push(n),function(){r&&e!==B&&(r=!1,t===e&&(t=e.slice()),t.splice(t.indexOf(n),1))}}}}function i(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}function a(){K||(K=!0,i("<Provider> does not support changing `store` on the fly. It is most likely that you see this error because you updated to Redux 2.x and React Redux 2.x which no longer hot reload reducers automatically. See https://github.com/reactjs/react-redux/releases/tag/v2.0.0 for the migration instructions."))}function o(t){var n,r,i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=i.getDisplayName,o=void 0===a?function(e){return"ConnectAdvanced("+e+")"}:a,s=i.methodName,u=void 0===s?"connectAdvanced":s,l=i.renderCountProp,c=void 0===l?void 0:l,f=i.shouldHandleStateChanges,d=void 0===f||f,h=i.storeKey,p=void 0===h?"store":h,v=i.withRef,g=void 0!==v&&v,y=j(i,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),m=p+"Subscription",b=J++,_=(n={},n[p]=H,n[m]=I.instanceOf(V),n),E=(r={},r[m]=I.instanceOf(V),r);return function(n){$("function"==typeof n,"You must pass a component to the function returned by connect. Instead received "+n);var r=n.displayName||n.name||"Component",i=o(r),a=N({},y,{getDisplayName:o,methodName:u,renderCountProp:c,shouldHandleStateChanges:d,storeKey:p,withRef:g,displayName:i,wrappedComponentName:r,WrappedComponent:n}),s=function(r){function o(e,t){C(this,o);var n=F(this,r.call(this,e,t));return n.version=b,n.state={},n.renderCount=0,n.store=n.props[p]||n.context[p],n.parentSub=e[m]||t[m],n.setWrappedInstance=n.setWrappedInstance.bind(n),$(n.store,'Could not find "'+p+'" in either the context or props of "'+i+'". Either wrap the root component in a <Provider>, or explicitly pass "'+p+'" as a prop to "'+i+'".'),n.getState=n.store.getState.bind(n.store),n.initSelector(),n.initSubscription(),n}return U(o,r),o.prototype.getChildContext=function(){var e;return e={},e[m]=this.subscription||this.parentSub,e},o.prototype.componentDidMount=function(){d&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},o.prototype.componentWillReceiveProps=function(e){this.selector.run(e)},o.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},o.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.store=null,this.parentSub=null,this.selector.run=function(){}},o.prototype.getWrappedInstance=function(){return $(g,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+u+"() call."),this.wrappedInstance},o.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},o.prototype.initSelector=function(){var e=this.store.dispatch,n=this.getState,r=t(e,a),i=this.selector={shouldComponentUpdate:!0,props:r(n(),this.props),run:function(e){try{var t=r(n(),e);(i.error||t!==i.props)&&(i.shouldComponentUpdate=!0,i.props=t,i.error=null)}catch(e){i.shouldComponentUpdate=!0,i.error=e}}}},o.prototype.initSubscription=function(){var e=this;d&&function(){var t=e.subscription=new V(e.store,e.parentSub),n={};t.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=function(){this.componentDidUpdate=void 0,t.notifyNestedSubs()},this.setState(n)):t.notifyNestedSubs()}.bind(e)}()},o.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},o.prototype.addExtraProps=function(e){if(!g&&!c)return e;var t=N({},e);return g&&(t.ref=this.setWrappedInstance),c&&(t[c]=this.renderCount++),t},o.prototype.render=function(){var t=this.selector;if(t.shouldComponentUpdate=!1,t.error)throw t.error;return e.h(n,this.addExtraProps(t.props))},o}(e.Component);return s.WrappedComponent=n,s.displayName=i,s.childContextTypes=E,s.contextTypes=_,s.prototype.componentWillUpdate=function(){this.version!==b&&(this.version=b,this.initSelector(),this.subscription&&this.subscription.tryUnsubscribe(),this.initSubscription(),d&&this.subscription.trySubscribe())},X(s,n)}}function s(e,t){if(e===t)return!0;var n=0,r=0;for(var i in e){if(Q.call(e,i)&&e[i]!==t[i])return!1;n++}for(var a in t)Q.call(t,a)&&r++;return n===r}function u(e){return Z(Object(e))}function l(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function c(e){return!!e&&"object"==(void 0===e?"undefined":M(e))}function f(e){if(!c(e)||ae.call(e)!=ee||l(e))return!1;var t=u(e);if(null===t)return!0;var n=re.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ne.call(n)==ie}function d(e,t,n){f(e)||i(n+"() in "+t+" must return a plain object. Instead received "+e+".")}function h(e){return function(t,n){function r(){return i}var i=e(t,n);return r.dependsOnOwnProps=!1,r}}function p(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function v(e,t){return function(n,r){var i=r.displayName,a=function(e,t){return a.dependsOnOwnProps?a.mapToProps(e,t):a.mapToProps(e)};return a.dependsOnOwnProps=p(e),a.mapToProps=function(n,r){a.mapToProps=e;var o=a(n,r);return"function"==typeof o&&(a.mapToProps=o,a.dependsOnOwnProps=p(o),o=a(n,r)),d(o,i,t),o},a}}function g(e){return"function"==typeof e?v(e,"mapDispatchToProps"):void 0}function y(e){return e?void 0:h(function(e){return{dispatch:e}})}function m(e){return e&&"object"===(void 0===e?"undefined":M(e))?h(function(n){return t.bindActionCreators(e,n)}):void 0}function b(e){return"function"==typeof e?v(e,"mapStateToProps"):void 0}function _(e){return e?void 0:h(function(){return{}})}function E(e,t,n){return N({},n,e,t)}function T(e){return function(t,n){var r=n.displayName,i=n.pure,a=n.areMergedPropsEqual,o=!1,s=void 0;return function(t,n,u){var l=e(t,n,u);return o?i&&a(l,s)||(s=l):(o=!0,s=l,d(s,r,"mergeProps")),s}}}function w(e){return"function"==typeof e?T(e):void 0}function k(e){return e?void 0:function(){return E}}function S(e,t,n){if(!e)throw new Error("Unexpected value for "+t+" in "+n+".");"mapStateToProps"!==t&&"mapDispatchToProps"!==t||e.hasOwnProperty("dependsOnOwnProps")||i("The selector for "+t+" of "+n+" did not specify a value for dependsOnOwnProps.")}function A(e,t,n,r){S(e,"mapStateToProps",r),S(t,"mapDispatchToProps",r),S(n,"mergeProps",r)}function O(e,t,n,r){return function(i,a){return n(e(i,a),t(r,a),a)}}function P(e,t,n,r,i){function a(i,a){return p=i,v=a,g=e(p,v),y=t(r,v),m=n(g,y,v),h=!0,m}function o(){return g=e(p,v),t.dependsOnOwnProps&&(y=t(r,v)),m=n(g,y,v)}function s(){return e.dependsOnOwnProps&&(g=e(p,v)),t.dependsOnOwnProps&&(y=t(r,v)),m=n(g,y,v)}function u(){var t=e(p,v),r=!d(t,g);return g=t,r&&(m=n(g,y,v)),m}function l(e,t){var n=!f(t,v),r=!c(e,p);return p=e,v=t,n&&r?o():n?s():r?u():m}var c=i.areStatesEqual,f=i.areOwnPropsEqual,d=i.areStatePropsEqual,h=!1,p=void 0,v=void 0,g=void 0,y=void 0,m=void 0;return function(e,t){return h?l(e,t):a(e,t)}}function R(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,i=t.initMergeProps,a=j(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),o=n(e,a),s=r(e,a),u=i(e,a);return A(o,s,u,a.displayName),(a.pure?P:O)(o,s,u,e,a)}function D(e,t,n){for(var r=t.length-1;r>=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+(void 0===e?"undefined":M(e))+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function x(e,t){return e===t}var L={only:function(e){return e&&e[0]||null}};n.isRequired=n;var I={element:n,func:n,shape:function(){return n},instanceOf:function(){return n}},M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},C=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},j=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},F=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},B=null,G={notify:function(){}},V=function(){function e(t,n){C(this,e),this.store=t,this.parentSub=n,this.unsubscribe=null,this.listeners=G}return e.prototype.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},e.prototype.notifyNestedSubs=function(){this.listeners.notify()},e.prototype.isSubscribed=function(){return Boolean(this.unsubscribe)},e.prototype.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=r())},e.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=G)},e}(),H=I.shape({subscribe:I.func.isRequired,dispatch:I.func.isRequired,getState:I.func.isRequired}),K=!1,Y=function(e){function t(n,r){C(this,t);var i=F(this,e.call(this,n,r));return i.store=n.store,i}return U(t,e),t.prototype.getChildContext=function(){return{store:this.store,storeSubscription:null}},t.prototype.render=function(){return L.only(this.props.children)},t}(e.Component);Y.prototype.componentWillReceiveProps=function(e){this.store!==e.store&&a()},Y.childContextTypes={store:H.isRequired,storeSubscription:I.instanceOf(V)},Y.displayName="Provider";var W={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},q={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},z="function"==typeof Object.getOwnPropertySymbols,X=function(e,t,n){if("string"!=typeof t){var r=Object.getOwnPropertyNames(t);z&&(r=r.concat(Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;++i)if(!(W[r[i]]||q[r[i]]||n&&n[r[i]]))try{e[r[i]]=t[r[i]]}catch(e){}}return e},$=function(){},J=0,Q=Object.prototype.hasOwnProperty,Z=Object.getPrototypeOf,ee="[object Object]",te=Object.prototype,ne=Function.prototype.toString,re=te.hasOwnProperty,ie=ne.call(Object),ae=te.toString,oe=[g,y,m],se=[b,_],ue=[w,k];return{Provider:Y,connect:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=e.connectHOC,n=void 0===t?o:t,r=e.mapStateToPropsFactories,i=void 0===r?se:r,a=e.mapDispatchToPropsFactories,u=void 0===a?oe:a,l=e.mergePropsFactories,c=void 0===l?ue:l,f=e.selectorFactory,d=void 0===f?R:f;return function(e,t,r){var a=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],o=a.pure,l=void 0===o||o,f=a.areStatesEqual,h=void 0===f?x:f,p=a.areOwnPropsEqual,v=void 0===p?s:p,g=a.areStatePropsEqual,y=void 0===g?s:g,m=a.areMergedPropsEqual,b=void 0===m?s:m,_=j(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),E=D(e,i,"mapStateToProps"),T=D(t,u,"mapDispatchToProps"),w=D(r,c,"mergeProps");return n(d,N({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:T,initMergeProps:w,pure:l,areStatesEqual:h,areOwnPropsEqual:v,areStatePropsEqual:y,areMergedPropsEqual:b},_))}}(),connectAdvanced:o}})},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),l=n(48),c=(r(l),n(49)),f=r(c),d=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{config:{}};i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.name=e.name,n.player=e.player,n.config=e.config,n.logger=f.default.getLogger("UI "+n.name),n.logger.debug("Initialized"),n}return o(t,e),s(t,[{key:"getConfig",value:function(e){return e?this.config[e]:this.config}},{key:"defaultConfig",get:function(){return{}}}]),t}(u.Component);t.default=d},function(e,t,n){"use strict";function r(e){return function(t){return i({},(0,a.bindActionCreators)(e,t))}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.bindActions=r;var a=n(6)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),o(t,[{key:"render",value:function(e){switch(e.type){case"maximize":return(0,s.h)("svg",{className:"icon icon-maximize",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M800 269.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z"}),(0,s.h)("path",{d:"M224 754.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z"}));case"minimize":return(0,s.h)("svg",{className:"icon icon-minimize",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M672 306.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z"}),(0,s.h)("path",{d:"M352 717.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z"}));case"play":return(0,s.h)("svg",{className:"icon icon-play",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M796.806 461.202c44.919 28.075 44.739 73.706 0 101.668l-459.472 287.171c-44.919 28.075-81.334 7.915-81.334-45.305v-585.4c0-53.096 36.595-73.266 81.334-45.305l459.472 287.171z"}));case"pause":return(0,s.h)("svg",{className:"icon icon-pause",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M256 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314zM640 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314z"}));case"volume-base":return(0,s.h)("svg",{className:"icon volume-base",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M224 352l234.504-156.336c29.545-19.697 53.496-7.194 53.496 28.053v576.566c0 35.19-24.059 47.677-53.496 28.053l-234.504-156.336h-127.906c-17.725 0-32.094-14.581-32.094-31.853v-256.295c0-17.592 14.012-31.853 32.094-31.853h127.906zM288 637.748l160 106.667v-464.83l-160 106.667v251.496zM128 416v192h96v-192h-96z"}));case"volume-waves":return(0,s.h)("svg",{className:"icon volume-waves",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M802.017 837.177c82.359-86.627 129.183-201.774 129.183-324.26 0-123.976-47.976-240.409-132.127-327.329-12.293-12.697-32.552-13.025-45.249-0.732s-13.025 32.552-0.732 45.249c72.692 75.084 114.109 175.597 114.109 282.812 0 105.928-40.422 205.331-111.566 280.162-12.177 12.808-11.666 33.063 1.143 45.24s33.063 11.666 45.24-1.143z"}),(0,s.h)("path",{d:"M667.436 743.221c67.761-60.884 107.273-147.888 107.273-241.233 0-87.318-34.552-169.203-94.836-229.446-12.501-12.493-32.762-12.486-45.255 0.015s-12.486 32.762 0.015 45.255c48.375 48.342 76.075 113.989 76.075 184.176 0 75.021-31.679 144.776-86.048 193.627-13.146 11.812-14.227 32.044-2.416 45.19s32.044 14.227 45.19 2.416z"}));case"volume-mute":return(0,s.h)("svg",{className:"icon volume-mute",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M768 466.745l-67.986-67.986c-12.213-12.213-32.654-12.393-45.151 0.104-12.584 12.584-12.543 32.711-0.104 45.151l67.986 67.986-67.986 67.986c-12.213 12.213-12.393 32.654 0.104 45.151 12.584 12.584 32.711 12.543 45.151 0.104l67.986-67.986 67.986 67.986c12.213 12.213 32.654 12.393 45.151-0.104 12.584-12.584 12.543-32.711 0.104-45.151l-67.986-67.986 67.986-67.986c12.213-12.213 12.393-32.654-0.104-45.151-12.584-12.584-32.711-12.543-45.151-0.104l-67.986 67.986z"}));case"close":return(0,s.h)("svg",{className:"icon icon-close",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M573.162 512l214.269-214.269c16.772-16.772 16.688-44.071-0.202-60.96-17.007-17.007-44.182-16.98-60.96-0.202l-214.269 214.269-214.269-214.269c-16.772-16.772-44.071-16.688-60.96 0.202-17.007 17.007-16.98 44.182-0.202 60.96l214.269 214.269-214.269 214.269c-16.772 16.772-16.688 44.071 0.202 60.96 17.007 17.007 44.182 16.98 60.96 0.202l214.269-214.269 214.269 214.269c16.772 16.772 44.071 16.688 60.96-0.202 17.007-17.007 16.98-44.182 0.202-60.96l-214.269-214.269z"}));case"share":return(0,s.h)("svg",{className:"icon icon-share",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.129-5.295 0-58.91 47.756-106.667 106.667-106.667s106.667 47.756 106.667 106.667c0 58.91-47.756 106.667-106.667 106.667-33.894 0-64.095-15.808-83.633-40.454l-236.467 142.445c-0.132-3.064-0.394-6.095-0.779-9.087l7.271-12.835-0.117 53.333-7.183-12.743c0.399-3.046 0.67-6.131 0.806-9.252l236.467 142.383c19.538-24.648 49.741-40.457 83.636-40.457 58.91 0 106.667 47.756 106.667 106.667s-47.756 106.667-106.667 106.667c-58.91 0-106.667-47.756-106.667-106.667 0-1.775 0.043-3.539 0.129-5.293l-236.19-142.216c-19.528 24.867-49.868 40.841-83.939 40.841-58.91 0-106.667-47.756-106.667-106.667s47.756-106.667 106.667-106.667c34.091 0 64.447 15.993 83.974 40.886zM234.667 554.667c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 341.333c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 768c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667z"}));case"settings":return(0,s.h)("svg",{className:"icon icon-share",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M829.945 549.126c2.784-24.116 2.784-48.445 0.269-70.702-1.182-6.772-7.090-11.696-13.674-11.641-33.039 0.582-62.975-19.389-75.126-50.118s-3.971-65.772 20.504-87.92c4.293-3.894 4.818-10.455 1.003-15.228-14.831-18.927-31.796-36.079-50.521-51.087-4.614-3.687-11.301-3.148-16.127 2.145-15.732 16.059-37.322 25.023-59.382 24.831-9.828 0.044-19.574-1.802-29.307-5.686-30.997-13.082-50.429-44.232-48.535-78.046 0.365-5.803-3.87-10.878-9.583-11.551-23.919-2.769-48.074-2.831-71.958-0.192-5.836 0.654-10.191 5.68-10.009 11.47 1.121 33.146-18.329 63.547-49.925 76.834-8.987 3.423-18.538 5.129-27.498 5.028-22.472 0.224-44.067-8.707-60.526-25.487-2.197-2.386-5.29-3.748-8.24-3.758-2.663 0.016-5.248 0.905-7.105 2.334-19.136 15.052-36.496 32.233-51.558 50.977-3.729 4.732-3.187 11.536 1.058 15.449 24.89 22.573 32.935 58.34 19.426 90.928-14.22 29.886-44.875 48.43-77.941 47.151-5.576-0.215-10.363 3.934-11.003 10.013-2.916 24.025-2.916 48.315-0.231 70.764 1.178 6.84 7.155 11.808 14.518 11.713l2.428 0.007c31.565 0.659 59.701 20.063 71.6 49.499 12.239 30.769 4.278 65.898-20.252 88.586-4.217 3.829-4.736 10.275-0.976 14.991 14.777 18.932 31.665 36.115 50.227 51.128 4.694 3.762 11.505 3.223 16.349-2.081 15.725-16.101 37.337-25.092 59.378-24.895 9.894-0.057 19.705 1.819 29.5 5.78 30.753 13.169 50.063 44.084 48.378 77.965-0.373 5.795 3.857 10.867 9.602 11.539 23.908 2.78 48.053 2.842 71.923 0.192 5.851-0.659 10.215-5.702 10.027-11.562-1.088-33.118 18.371-63.473 49.584-76.583 9.014-3.552 18.622-5.354 27.841-5.307 22.555-0.225 44.218 8.804 60.434 25.505 2.224 2.395 5.343 3.76 8.371 3.769 2.474-0.012 4.874-0.847 6.896-2.43 19.227-14.971 36.653-32.121 51.726-50.848 3.737-4.743 3.194-11.563-0.941-15.379-24.391-21.907-32.789-56.564-21.134-87.207s40.964-50.957 73.904-51.116h5.704c5.586-0.028 10.269-4.227 10.905-9.777zM893.526 556.438c-4.321 37.715-36.171 66.271-74.323 66.464h-5.711c-6.33 0.031-11.99 3.953-14.24 9.87s-0.629 12.609 4.385 17.116c29.020 26.748 32.567 71.325 7.936 102.582-18.378 22.837-39.342 43.468-62.397 61.42-13.128 10.284-29.303 15.909-46.22 15.991-21.004-0.056-41.043-8.825-54.839-23.692-3.514-3.616-8.356-5.634-13.867-5.583-1.555-0.007-3.097 0.282-3.877 0.581-6.088 2.559-9.967 8.609-9.749 15.235 1.257 39.227-27.828 72.841-66.88 77.241-28.725 3.189-57.719 3.114-86.45-0.227-39.585-4.631-68.615-39.444-66.083-78.749 0.331-6.679-3.529-12.859-9.057-15.234-1.449-0.585-2.998-0.881-5.025-0.873-5.074-0.045-9.947 1.982-12.693 4.763-26.775 29.494-71.875 33.067-103.071 8.066-22.458-18.164-42.771-38.831-60.335-61.337-24.602-30.847-21.012-75.5 7.982-101.818 4.881-4.515 6.479-11.568 4.088-17.58-2.239-5.538-7.562-9.209-12.866-9.327-39.748 0.506-72.828-26.991-79.581-66.425-3.538-29.147-3.538-58.616-0.060-87.234 4.085-39.084 37.791-68.296 77.064-66.784 7.502 0.29 14.456-3.916 17.001-9.164 2.519-6.098 0.94-13.122-4.133-17.724-29.022-26.738-32.57-71.311-7.956-102.538 18.292-22.765 39.115-43.375 62.322-61.626 13.199-10.169 29.368-15.731 46.323-15.833 21.063 0.065 41.146 8.908 54.704 23.656 3.559 3.623 8.44 5.642 14.175 5.592 1.605 0.017 3.199-0.268 3.668-0.426 6.11-2.574 9.998-8.651 9.771-15.356-1.228-39.209 27.864-72.786 66.897-77.161 28.715-3.173 57.697-3.098 86.456 0.231 39.539 4.653 68.54 39.409 66.051 78.92-0.369 6.596 3.446 12.713 8.931 15.035 1.507 0.6 3.114 0.905 5.156 0.898 5.087 0.044 9.973-1.985 12.671-4.704 26.66-29.444 71.625-33.068 102.694-8.244 22.604 18.117 43.043 38.781 60.715 61.337 24.728 30.927 21.142 75.751-8.215 102.378-4.724 4.275-6.301 11.031-3.958 16.955s8.114 9.775 14.774 9.659c38.18-0.325 70.992 27.018 77.822 66.463 3.343 28.966 3.343 58.22 0 87.185zM511.951 597.037c47.144-0.118 85.24-38.367 85.169-85.511 0-34.617-20.872-65.819-52.867-79.034s-68.802-5.836-93.231 18.69c-24.429 24.527-31.66 61.363-18.317 93.305s44.628 52.688 79.245 52.55zM512.158 661.036c-60.477 0.242-115.178-36.032-138.507-91.881s-10.686-120.254 32.026-163.138c42.712-42.884 107.066-55.785 163.008-32.679s92.434 77.661 92.434 138.139c0.124 82.417-66.545 149.353-148.962 149.559z"}));case"check":return(0,s.h)("svg",{className:"icon check-icon",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M342.481 563.894c-12.577-12.416-32.838-12.285-45.254 0.292s-12.285 32.838 0.292 45.254l118.857 117.333c13.275 13.105 34.901 12.123 46.933-2.131l297.143-352c11.4-13.505 9.694-33.694-3.811-45.094s-33.694-9.694-45.094 3.811l-274.828 325.566-94.238-93.030z"}));case"language":return(0,s.h)("svg",{className:"icon language-icon",viewBox:"0 0 1024 1024"},(0,s.h)("path",{d:"M625.773 808.031c29.752-39.944 63.443-97.069 83.311-168.977 41.798-3.715 74.872-8.022 98.271-11.57-32.456 82.71-98.638 148.558-181.582 180.547zM216.562 627.283c23.516 3.506 56.799 7.797 98.279 11.528 19.868 72.017 53.601 129.224 83.378 169.219-83.002-32.014-149.226-97.945-181.657-180.747zM400.147 215.201c-29.835 40.32-64.161 98.037-84.572 169.695-42.123 3.731-75.423 8.072-98.938 11.629 32.698-83.353 99.656-149.61 183.51-181.323zM807.438 396.725c-23.641-3.523-57.158-7.847-98.947-11.587-20.402-71.766-54.778-129.567-84.639-169.937 83.912 31.73 150.912 98.070 183.585 181.523zM720.095 436.644c48.952 4.817 84.472 10.209 102.995 13.331 3.99 20.068 6.127 40.796 6.127 62.024 0 21.262-2.137 42.031-6.152 62.141-18.248 3.172-53.376 8.615-102.753 13.448 3.84-23.908 6.069-49.102 6.069-75.59 0-26.296-2.304-51.431-6.286-75.356zM537.043 597.206v-170.396c48.576 0.551 92.653 2.646 131.178 5.426 5.050 25.119 8.072 51.74 8.072 79.763 0 28.216-2.913 54.87-7.789 79.939-38.283 2.713-82.343 4.742-131.462 5.267zM486.957 195.859v180.856c-43.175 0.442-82.443 1.995-117.429 4.149 31.939-95.382 89.99-161.656 112.237-184.612 1.72-0.159 3.464-0.259 5.192-0.392zM542.286 196.26c22.297 22.906 80.456 89.080 112.345 184.771-35.261-2.229-74.646-3.848-117.587-4.307v-180.864c1.745 0.142 3.506 0.234 5.242 0.401zM347.706 512c0-28.074 3.047-54.762 8.156-79.955 38.191-2.696 82.134-4.708 131.094-5.234v170.387c-48.71-0.551-92.895-2.655-131.495-5.443-4.858-25.018-7.755-51.606-7.755-79.755zM194.783 512c0-21.262 2.137-42.031 6.144-62.125 18.282-3.181 53.501-8.64 103.012-13.482-4.007 24-6.319 49.219-6.319 75.606 0 26.396 2.221 51.506 6.027 75.339-48.826-4.808-84.246-10.184-102.737-13.306-3.99-20.068-6.127-40.804-6.127-62.033zM481.338 827.706c-22.389-22.314-81.016-87.469-112.662-184.779 35.437 2.262 75.047 3.898 118.28 4.366v180.839c-1.87-0.142-3.757-0.25-5.618-0.426zM542.653 827.706c-1.862 0.175-3.74 0.284-5.61 0.426v-180.839c43.509-0.442 83.044-2.012 118.222-4.199-31.672 97.244-90.265 162.349-112.612 184.612zM512 128c-211.734 0-384 172.257-384 384 0 211.734 172.266 384 384 384s384-172.266 384-384c0-211.743-172.266-384-384-384z"}))}}}]),t}(s.Component);t.default=u},function(e,t,n){function r(e){return null!==e&&void 0!==e}function i(e,t){var n=a({},e);for(var r in t)t.hasOwnProperty(r)&&(n[r]=e[r]&&t[r]&&"object"==typeof e[r]&&"object"==typeof t[r]?i(e[r],t[r]):e[r]||t[r]);return n}function a(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function o(e){if(e=e||{},"string"==typeof e&&(e=e.split(",")),"join"in e){for(var t={},n=0;n<e.length;n++){var r=e[n].trim();r&&(t[r.split(".").pop()]=r)}return t}return e}function s(e,t){return f=t||m,e&&e.replace(/\{\{([\w.-]+)\}\}/g,u)}function u(e,t){for(var n=t.split("."),r=f,i=0;i<n.length;i++)if(null==(r=r[n[i]]))return"";return"string"==typeof r&&r.match(/\{\{/)&&(r=s(r,f)),r}function l(e,t,n,i,a,o){t&&(e=t+"."+e);var u=n&&h(n,e);return(a||0===a)&&u&&"object"==typeof u&&(u=u.splice?u[a]||u[0]:0===a&&r(u.none)?u.none:1===a&&r(u.one||u.singular)?u.one||u.singular:u.some||u.many||u.plural||u.other||u),u&&s(u,i)||o||null}function c(e,t,n){var r={};t=t||{},e=o(e);for(var i in e)if(e.hasOwnProperty(i)&&e[i]){var s=e[i];n||"string"!=typeof s?s.nodeName===b&&(s=a({fallback:s.children&&s.children[0]},s.attributes),r[i]=l(s.id,t.scope,t.dictionary,s.fields,s.plural,s.fallback)):r[i]=l(s,t.scope,t.dictionary)}return r}var f,d=n(0),h=function(e){return e&&"object"==typeof e&&"default"in e?e.default:e}(n(44)),p=/[?&#]intl=show/,v=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getChildContext=function(){var e=this.props,t=e.scope,n=e.definition,r=e.mark,o=a({},this.context.intl||{});return t&&(o.scope=t),n&&(o.dictionary=i(o.dictionary||{},n)),(r||"undefined"!=typeof location&&String(location).match(p))&&(o.mark=!0),{intl:o}},t.prototype.render=function(e){var t=e.children;return t&&t[0]||null},t}(d.Component),g=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e.length>1)return y(e[0],e[1]);var n=e[0];return function(e){return y(e,n)}},y=function(e,t){return function(n){return d.h(v,t||{},d.h(e,n))}},m={},b=function(e,t){var n=e.id,r=e.children,i=e.plural,a=e.fields,o=t.intl,s=r&&r[0],u=l(n,o&&o.scope,o&&o.dictionary,a,i,s);if(o&&o.mark){var c="dictionary"+(o&&o.scope?"."+o.scope:"")+"."+n;return d.h("mark",{style:"background: "+(u?h(o,c)?"rgba(119,231,117,.5)":"rgba(229,226,41,.5)":"rgba(228,147,51,.5)"),title:n},u)}return u},_=function(e,t){var n=e.children,r=t.intl,i=n&&n[0];return i&&d.cloneElement(i,c(i.attributes,r,!0))},E=function(e){return function(t){return function(n,r){var i="function"==typeof e?e(n):e,a=c(i,r.intl);return d.h(t,assign({},n,a))}}};g.intl=g,g.IntlProvider=v,g.Text=b,g.Localizer=_,g.withText=E,e.exports=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){function r(){}var i=n(13),a=n(41),o=n(42),s=n(43),u=n(17),l=n(7);n.d(t,"createStore",function(){return i.b}),n.d(t,"combineReducers",function(){return a.a}),n.d(t,"bindActionCreators",function(){return o.a}),n.d(t,"applyMiddleware",function(){return s.a}),n.d(t,"compose",function(){return u.a}),"production"!==e.env.NODE_ENV&&"string"==typeof r.name&&"isCrushed"!==r.name&&l.a("You are currently using minified code outside of NODE_ENV === 'production'. This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) to ensure you have the correct code for your production build.")}.call(t,n(12))},function(e,t,n){"use strict";function r(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}t.a=r},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=t.types={ADD_PLAYER_CLASS:"shell/ADD_PLAYER_CLASS",REMOVE_PLAYER_CLASS:"shell/REMOVE_PLAYER_CLASS",UPDATE_IS_MOBILE:"shell/UPDATE_IS_MOBILE"},o=t.initialState={playerClasses:[]};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments[1];switch(t.type){case a.ADD_PLAYER_CLASS:return i({},e,{playerClasses:[].concat(r(e.playerClasses),[t.className])});case a.REMOVE_PLAYER_CLASS:return i({},e,{playerClasses:e.playerClasses.filter(function(e){return e!==t.className})});case a.UPDATE_IS_MOBILE:return i({},e,{isMobile:t.isMobile});default:return e}};t.actions={addPlayerClass:function(e){return{type:a.ADD_PLAYER_CLASS,className:e}},removePlayerClass:function(e){return{type:a.REMOVE_PLAYER_CLASS,className:e}},updateIsMobile:function(e){return{type:a.UPDATE_IS_MOBILE,isMobile:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={TOGGLE_PLAY:"play-pause/TOGGLE_PLAY"},a=t.initialState={isPlaying:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.TOGGLE_PLAY:return r({},e,{isPlaying:t.isPlaying});default:return e}};t.actions={toggleIsPlaying:function(e){return{type:i.TOGGLE_PLAY,isPlaying:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={TOGGLE_SHARE_OVERLAY:"share/TOGGLE_SHARE_OVERLAY"},a=t.initialState={overlayOpen:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.TOGGLE_SHARE_OVERLAY:return r({},e,{overlayOpen:t.show});default:return e}};t.actions={toggleShareOverlay:function(e){return{type:i.TOGGLE_SHARE_OVERLAY,show:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={TOGGLE_CVAA_OVERLAY:"share/TOGGLE_CVAA_OVERLAY"},a=t.initialState={overlayOpen:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.TOGGLE_CVAA_OVERLAY:return r({},e,{overlayOpen:t.show});default:return e}};t.actions={toggleCVAAOverlay:function(e){return{type:i.TOGGLE_CVAA_OVERLAY,show:e}}}},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function a(e){if(f===clearTimeout)return clearTimeout(e);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function o(){v&&h&&(v=!1,h.length?p=h.concat(p):g=-1,p.length&&s())}function s(){if(!v){var e=i(o);v=!0;for(var t=p.length;t;){for(h=p,p=[];++g<t;)h&&h[g].run();g=-1,t=p.length}h=null,v=!1,a(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var c,f,d=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(e){f=r}}();var h,p=[],v=!1,g=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];p.push(new u(e,t)),1!==p.length||v||i(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=l,d.addListener=l,d.once=l,d.off=l,d.removeListener=l,d.removeAllListeners=l,d.emit=l,d.prependListener=l,d.prependOnceListener=l,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t,n){"use strict";function r(e,t,n){function a(){y===g&&(y=g.slice())}function u(){return v}function l(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return a(),y.push(e),function(){if(t){t=!1,a();var n=y.indexOf(e);y.splice(n,1)}}}function c(e){if(!i.a(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(m)throw new Error("Reducers may not dispatch actions.");try{m=!0,v=p(v,e)}finally{m=!1}for(var t=g=y,n=0;n<t.length;n++){(0,t[n])()}return e}function f(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");p=e,c({type:s.INIT})}function d(){var e,t=l;return e={subscribe:function(e){function n(){e.next&&e.next(u())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");return n(),{unsubscribe:t(n)}}},e[o.a]=function(){return this},e}var h;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(r)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var p=e,v=t,g=[],y=g,m=!1;return c({type:s.INIT}),h={dispatch:c,subscribe:l,getState:u,replaceReducer:f},h[o.a]=d,h}n.d(t,"a",function(){return s}),t.b=r;var i=n(14),a=n(37),o=n.n(a),s={INIT:"@@redux/INIT"}},function(e,t,n){"use strict";function r(e){if(!o.a(e)||i.a(e)!=s)return!1;var t=a.a(e);if(null===t)return!0;var n=f.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==d}var i=n(29),a=n(34),o=n(36),s="[object Object]",u=Function.prototype,l=Object.prototype,c=u.toString,f=l.hasOwnProperty,d=c.call(Object);t.a=r},function(e,t,n){"use strict";var r=n(30),i=r.a.Symbol;t.a=i},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}t.a=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={UPDATE_PLAYER_STATE:"engine/UPDATE_PLAYER_STATE",UPDATE_IS_PLAYING:"engine/UPDATE_IS_PLAYING",UPDATE_CURRENT_TIME:"engine/UPDATE_CURRENT_TIME",UPDATE_DURATION:"engine/UPDATE_DURATION",UPDATE_VOLUME:"engine/UPDATE_VOLUME",UPDATE_MUTED:"engine/UPDATE_MUTED",UPDATE_METADATA_LOADING_STATUS:"engine/UPDATE_METADATA_LOADING_STATUS",UPDATE_AUDIO_TRACKS:"engine/UPDATE_AUDIO_TRACKS",UPDATE_VIDEO_TRACKS:"engine/UPDATE_VIDEO_TRACKS",UPDATE_TEXT_TRACKS:"engine/UPDATE_TEXT_TRACKS"},a=t.initialState={isPlaying:!1,metadataLoaded:!1,playerState:{previousState:"",currentState:""},currentTime:0,duration:0,volume:1,muted:!1,videoTracks:[],audioTracks:[],textTracks:[]};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.UPDATE_PLAYER_STATE:return r({},e,{playerState:t.playerState});case i.UPDATE_IS_PLAYING:return r({},e,{isPlaying:t.isPlaying});case i.UPDATE_CURRENT_TIME:return r({},e,{currentTime:t.currentTime});case i.UPDATE_DURATION:return r({},e,{duration:t.duration});case i.UPDATE_VOLUME:return r({},e,{volume:t.volume});case i.UPDATE_MUTED:return r({},e,{muted:t.muted});case i.UPDATE_METADATA_LOADING_STATUS:return r({},e,{metadataLoaded:t.metadataLoaded});case i.UPDATE_AUDIO_TRACKS:return r({},e,{audioTracks:t.tracks});case i.UPDATE_VIDEO_TRACKS:return r({},e,{videoTracks:t.tracks});case i.UPDATE_TEXT_TRACKS:return r({},e,{textTracks:t.tracks});default:return e}};t.actions={updatePlayerState:function(e,t){return{type:i.UPDATE_PLAYER_STATE,playerState:{prevoiusState:e,currentState:t}}},updateIsPlaying:function(e){return{type:i.UPDATE_IS_PLAYING,isPlaying:e}},updateCurrentTime:function(e){return{type:i.UPDATE_CURRENT_TIME,currentTime:e}},updateDuration:function(e){return{type:i.UPDATE_DURATION,duration:e}},updateVolume:function(e){return{type:i.UPDATE_VOLUME,volume:e}},updateMuted:function(e){return{type:i.UPDATE_MUTED,muted:e}},updateMetadataLoadingStatus:function(e){return{type:i.UPDATE_METADATA_LOADING_STATUS,metadataLoaded:e}},updateAudioTracks:function(e){return{type:i.UPDATE_AUDIO_TRACKS,tracks:e}},updateVideoTracks:function(e){return{type:i.UPDATE_VIDEO_TRACKS,tracks:e}},updateTextTracks:function(e){return{type:i.UPDATE_TEXT_TRACKS,tracks:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={UPDATE_SEEKBAR_DRAGGING_STATUS:"seekbar/UPDATE_SEEKBAR_DRAGGING_STATUS",UPDATE_CURRENT_TIME:"seekbar/UPDATE_CURRENT_TIME",UPDATE_DURATION:"seekbar/UPDATE_DURATION"},a=t.initialState={currentTime:0,duration:0,draggingActive:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.UPDATE_SEEKBAR_DRAGGING_STATUS:return r({},e,{draggingActive:t.draggingActive});case i.UPDATE_CURRENT_TIME:return r({},e,{currentTime:t.currentTime});case i.UPDATE_DURATION:return r({},e,{duration:t.duration});default:return e}};t.actions={updateSeekbarDraggingStatus:function(e){return{type:i.UPDATE_SEEKBAR_DRAGGING_STATUS,draggingActive:e}},updateDuration:function(e){return{type:i.UPDATE_DURATION,duration:e}},updateCurrentTime:function(e){return{type:i.UPDATE_CURRENT_TIME,currentTime:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={UPDATE_VOLUME:"volume/UPDATE_VOLUME",UPDATE_VOLUME_DRAGGING_STATUS:"volume/UPDATE_VOLUME_DRAGGING_STATUS",UPDATE_MUTED:"volume/UPDATE_MUTED"},a=t.initialState={draggingActive:!1,volume:1,muted:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.UPDATE_VOLUME:return r({},e,{volume:t.volume});case i.UPDATE_VOLUME_DRAGGING_STATUS:return r({},e,{draggingActive:t.draggingActive});case i.UPDATE_MUTED:return r({},e,{muted:t.muted});default:return e}};t.actions={updateVolume:function(e){return{type:i.UPDATE_VOLUME,volume:e}},updateVolumeDraggingStatus:function(e){return{type:i.UPDATE_VOLUME_DRAGGING_STATUS,draggingActive:e}},updateMuted:function(e){return{type:i.UPDATE_MUTED,muted:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={UPDATE_FULLSCREEN:"fullscreen/UPDATE_FULLSCREEN"},a=t.initialState={fullscreen:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.UPDATE_FULLSCREEN:return r({},e,{fullscreen:t.fullscreen});default:return e}};t.actions={updateFullscreen:function(e){return{type:i.UPDATE_FULLSCREEN,fullscreen:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={UPDATE_LOADING_SPINNER_STATE:"loading/UPDATE_LOADING_SPINNER_STATE"},a=t.initialState={showLoadingSpinner:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.UPDATE_LOADING_SPINNER_STATE:return r({},e,{show:t.show});default:return e}};t.actions={updateLoadingSpinnerState:function(e){return{type:i.UPDATE_LOADING_SPINNER_STATE,show:e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=t.types={UPDATE_QUALITY:"settings/UPDATE_QUALITY",UPDATE_SPEED:"settings/UPDATE_SPEED"},a=t.initialState={quality:1,speed:2};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case i.UPDATE_QUALITY:return r({},e,{quality:t.quality});case i.UPDATE_SPEED:return r({},e,{speed:t.speed});default:return e}};t.actions={updateQuality:function(e){return{type:i.UPDATE_QUALITY,quality:e}},updateSpeed:function(e){return{type:i.UPDATE_SPEED,speed:e}}}},function(e,t,n){"use strict";function r(e){var t=parseInt(e,10),n=Math.floor(t/3600),r=Math.floor((t-3600*n)/60),i=t-3600*n-60*r;return n<10&&(n="0"+n),r<10&&(r="0"+r),i<10&&(i="0"+i),r+":"+i}Object.defineProperty(t,"__esModule",{value:!0}),t.toHHMMSS=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),o(t,[{key:"render",value:function(e){return(0,s.h)("div",{className:"smart-container top left"},e.children)}}]),t}(s.Component);t.default=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=n(60),l=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),o(t,[{key:"render",value:function(e){return(0,s.h)("div",{className:"smart-container-item select-menu-item"},(0,s.h)("label",{htmlFor:"quality"},e.label),(0,s.h)(l.default,{onSelect:function(t){return e.onSelect(t)},options:e.options}))}}]),t}(s.Component);t.default=c},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o,s,u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=n(5),f=n(1),d=n(3),h=n(8),p=n(4),v=function(e){return e&&e.__esModule?e:{default:e}}(p),g=(o=(0,f.connect)(null,(0,d.bindActions)(h.actions)))(s=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),u(t,[{key:"componentWillUnmount",value:function(){this.props.removePlayerClass("overlay-active")}},{key:"componentWillMount",value:function(){this.props.addPlayerClass("overlay-active")}},{key:"render",value:function(e){var t="overlay";return e.type&&(t+=" "+e.type+"-overlay"),e.open&&(t+=" active"),(0,l.h)("div",{className:t,role:"dialog"},(0,l.h)(c.Localizer,null,(0,l.h)("a",{onClick:function(){return e.onClose()},"aria-label":(0,l.h)(c.Text,{id:"core.close"}),className:"close-overlay"},(0,l.h)(v.default,{type:"close"}))),e.children)}}]),t}(l.Component))||s;t.default=g},function(e,t,n){"use strict";function r(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")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),s=n(1),u=n(5),l=n(6),c=n(45),f=r(c),d=n(46),h=r(d),p=n(47),v=r(p),g=n(51),y=r(g),m=n(53),b=r(m),_=n(54),E=r(_),T=n(55),w=r(T),k=n(56),S=r(k),A=n(57),O=r(A),P=n(58),R=r(P),D=n(59),x=r(D),L=n(61),I=r(L),M=n(62),C=r(M),N=n(63),U=r(N),j=n(64),F=r(j),B=n(65),G=r(B),V=n(66),H=r(V),K=n(67),Y=r(K),W=n(68),q=r(W),z=function(){function e(t,n){i(this,e),this.player=t,this.config=n,this.config.ui={translations:{controls:{language:"שפה"}},components:{Loading:{enabled:!0},OverlayPlay:{enabled:!0}}}}return a(e,[{key:"buildCustomUI",value:function(e){this._buildUI(e)}},{key:"buildDefaultUI",value:function(){var e=(0,l.createStore)(f.default,window.devToolsExtension&&window.devToolsExtension({name:"playkit #"+this.config.target,instanceId:this.config.target})),t=(0,o.h)(s.Provider,{store:e},(0,o.h)(u.IntlProvider,{definition:h.default},(0,o.h)(y.default,null,(0,o.h)("div",{className:"player-holder"}),(0,o.h)(v.default,{player:this.player}),(0,o.h)(q.default,{player:this.player}),(0,o.h)(E.default,{player:this.player}),(0,o.h)("div",{className:"player-gui"},(0,o.h)(b.default,{player:this.player}),(0,o.h)(F.default,null,(0,o.h)("div",{className:"left-controls"},(0,o.h)("div",{className:"video-playing-title"},"L21 Earth Time Lapse View from Space, ISS")),(0,o.h)("div",{className:"right-controls"},(0,o.h)(R.default,{player:this.player}))),(0,o.h)(G.default,null,(0,o.h)(S.default,{showFramePreview:!0,showTimeBubble:!0,player:this.player}),(0,o.h)("div",{className:"left-controls"},(0,o.h)(w.default,{player:this.player}),(0,o.h)(U.default,{format:"current / total",player:this.player})),(0,o.h)("div",{className:"right-controls"},(0,o.h)(O.default,{player:this.player}),(0,o.h)(I.default,{player:this.player}),(0,o.h)(x.default,{player:this.player}),(0,o.h)(C.default,{player:this.player}))),(0,o.h)(H.default,null),(0,o.h)(Y.default,null)))));this._buildUI(t)}},{key:"_buildUI",value:function(e){if(this.player){var t=document.createElement("div");document.body.appendChild(t),(0,o.render)(e,t);var n=document.getElementsByTagName("video")["player1"===this.config.target?0:1];n.removeAttribute("style"),t.getElementsByClassName("player-holder")[0].appendChild(n)}}},{key:"release",value:function(){}}]),e}();t.default=z},function(e,t,n){"use strict";function r(e){return null==e?void 0===e?u:s:l&&l in Object(e)?a.a(e):o.a(e)}var i=n(15),a=n(32),o=n(33),s="[object Null]",u="[object Undefined]",l=i.a?i.a.toStringTag:void 0;t.a=r},function(e,t,n){"use strict";var r=n(31),i="object"==typeof self&&self&&self.Object===Object&&self,a=r.a||i||Function("return this")();t.a=a},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(t,n(16))},function(e,t,n){"use strict";function r(e){var t=o.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[u]=n:delete e[u]),i}var i=n(15),a=Object.prototype,o=a.hasOwnProperty,s=a.toString,u=i.a?i.a.toStringTag:void 0;t.a=r},function(e,t,n){"use strict";function r(e){return a.call(e)}var i=Object.prototype,a=i.toString;t.a=r},function(e,t,n){"use strict";var r=n(35),i=r.a(Object.getPrototypeOf,Object);t.a=i},function(e,t,n){"use strict";function r(e,t){return function(n){return e(t(n))}}t.a=r},function(e,t,n){"use strict";function r(e){return null!=e&&"object"==typeof e}t.a=r},function(e,t,n){e.exports=n(38)},function(e,t,n){"use strict";(function(e,r){Object.defineProperty(t,"__esModule",{value:!0});var i,a=n(40),o=function(e){return e&&e.__esModule?e:{default:e}}(a);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var s=(0,o.default)(i);t.default=s}).call(t,n(16),n(39)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,n){"use strict";(function(e){function r(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function i(e,t,n,r){var i=Object.keys(t),a=n&&n.type===s.a.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===i.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!u.a(e))return"The "+a+' has unexpected type of "'+{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1]+'". Expected argument to be an object with the following keys: "'+i.join('", "')+'"';var o=Object.keys(e).filter(function(e){return!t.hasOwnProperty(e)&&!r[e]});return o.forEach(function(e){r[e]=!0}),o.length>0?"Unexpected "+(o.length>1?"keys":"key")+' "'+o.join('", "')+'" found in '+a+'. Expected to find one of the known reducer keys instead: "'+i.join('", "')+'". Unexpected keys will be ignored.':void 0}function a(e){Object.keys(e).forEach(function(t){var n=e[t];if(void 0===n(void 0,{type:s.a.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+s.a.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}function o(t){for(var n=Object.keys(t),o={},s=0;s<n.length;s++){var u=n[s];"production"!==e.env.NODE_ENV&&void 0===t[u]&&l.a('No reducer provided for key "'+u+'"'),"function"==typeof t[u]&&(o[u]=t[u])}var c=Object.keys(o),f=void 0;"production"!==e.env.NODE_ENV&&(f={});var d=void 0;try{a(o)}catch(e){d=e}return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1];if(d)throw d;if("production"!==e.env.NODE_ENV){var a=i(t,o,n,f);a&&l.a(a)}for(var s=!1,u={},h=0;h<c.length;h++){var p=c[h],v=o[p],g=t[p],y=v(g,n);if(void 0===y){var m=r(p,n);throw new Error(m)}u[p]=y,s=s||y!==g}return s?u:t}}t.a=o;var s=n(13),u=n(14),l=n(7)}).call(t,n(12))},function(e,t,n){"use strict";function r(e,t){return function(){return t(e.apply(void 0,arguments))}}function i(e,t){if("function"==typeof e)return r(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),i={},o=0;o<n.length;o++){var s=n[o],u=e[s];"function"==typeof u?i[s]=r(u,t):a.a("bindActionCreators expected a function actionCreator for key '"+s+"', instead received type '"+typeof u+"'.")}return i}t.a=i;var a=n(7)},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,o){var s=e(n,r,o),u=s.dispatch,l=[],c={getState:s.getState,dispatch:function(e){return u(e)}};return l=t.map(function(e){return e(c)}),u=i.a.apply(void 0,l)(s.dispatch),a({},s,{dispatch:u})}}}t.a=r;var i=n(17),a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){function e(e,t,n,r){for(r=0,t=t.split?t.split("."):t;e&&r<t.length;)e=e[t[r++]];return void 0===e?n:e}return e})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),a=n(18),o=r(a),s=n(8),u=r(s),l=n(9),c=r(l),f=n(19),d=r(f),h=n(20),p=r(h),v=n(21),g=r(v),y=n(22),m=r(y),b=n(10),_=r(b),E=n(11),T=r(E),w=n(23),k=r(w),S=(0,i.combineReducers)({engine:o.default,shell:u.default,seekbar:d.default,volume:p.default,fullscreen:g.default,loading:m.default,playPause:c.default,share:_.default,cvaa:T.default,settings:k.default});t.default=S},function(e,t){e.exports={core:{disable:"Disable",auto:"Auto",close:"Close"},controls:{play:"Play",pause:"Pause",share:"Share",language:"Language",settings:"Settings",fullscreen:"Fullscreen"},settings:{quality:"Quality",speed:"Speed"},language:{audio:"Audio",captions:"Captions",advanced_captions_settings:"Advanced captions settings"},share:{share_title:"Share",link_options:"Link options"}}},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(1),d=n(3),h=n(18),p=r(h),v=n(2),g=r(v),y=(s=(0,f.connect)(p.default,(0,d.bindActions)(h.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"EngineConnector",player:e.player}))}return o(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this;this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED,function(t){e.props.updatePlayerState(t.payload.oldState.type,t.payload.newState.type)}),this.player.addEventListener(this.player.Event.TIME_UPDATE,function(){e.props.updateCurrentTime(e.player.currentTime)}),this.player.addEventListener(this.player.Event.LOADED_METADATA,function(){e.props.updateDuration(e.player.duration),e.props.updateMetadataLoadingStatus(!0);var t=(e.player.Track,e.player.getTracks()),n=t.filter(function(e){return"AudioTrack"===e.constructor.name}),r=t.filter(function(e){return"VideoTrack"===e.constructor.name}),i=t.filter(function(e){return"TextTrack"===e.constructor.name});e.props.updateAudioTracks(n),e.props.updateVideoTracks(r),e.props.updateTextTracks(i)}),this.player.addEventListener(this.player.Event.VOLUME_CHANGE,function(){e.props.updateVolume(e.player.volume)}),this.player.addEventListener(this.player.Event.PLAY,function(){e.props.updateIsPlaying(!0)}),this.player.addEventListener(this.player.Event.PAUSE,function(){e.props.updateIsPlaying(!1)})}},{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,c.h)("span",null)}}]),t}(g.default))||u;t.default=y},function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.LOG_LEVEL=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(50),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),s={DEBUG:o.DEBUG,INFO:o.INFO,TIME:o.TIME,WARN:o.WARN,ERROR:o.ERROR,OFF:o.OFF},u=function(){function e(t){r(this,e),o.useDefaults(t||{})}return i(e,[{key:"getLogger",value:function(e){return e?o.get(e):o}}]),e}(),l=new u({defaultLevel:o.DEBUG});t.default=l,t.LOG_LEVEL=s},function(e,t,n){var r,i;/*! * js-logger - http://github.com/jonnyreeves/js-logger * Jonny Reeves, http://jonnyreeves.co.uk/ * js-logger may be freely distributed under the MIT license. */ -!function(a){"use strict";var o={};o.VERSION="1.3.0";var s,u={},l=function(e,t){return function(){return t.apply(e,arguments)}},c=function(){var e,t,n=arguments,r=n[0];for(t=1;t<n.length;t++)for(e in n[t])e in r||!n[t].hasOwnProperty(e)||(r[e]=n[t][e]);return r},f=function(e,t){return{value:e,name:t}};o.DEBUG=f(1,"DEBUG"),o.INFO=f(2,"INFO"),o.TIME=f(3,"TIME"),o.WARN=f(4,"WARN"),o.ERROR=f(8,"ERROR"),o.OFF=f(99,"OFF");var d=function(e){this.context=e,this.setLevel(e.filterLevel),this.log=this.info};d.prototype={setLevel:function(e){e&&"value"in e&&(this.context.filterLevel=e)},enabledFor:function(e){var t=this.context.filterLevel;return e.value>=t.value},debug:function(){this.invoke(o.DEBUG,arguments)},info:function(){this.invoke(o.INFO,arguments)},warn:function(){this.invoke(o.WARN,arguments)},error:function(){this.invoke(o.ERROR,arguments)},time:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"start"])},timeEnd:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"end"])},invoke:function(e,t){s&&this.enabledFor(e)&&s(t,c({level:e},this.context))}};var h=new d({filterLevel:o.OFF});!function(){var e=o;e.enabledFor=l(h,h.enabledFor),e.debug=l(h,h.debug),e.time=l(h,h.time),e.timeEnd=l(h,h.timeEnd),e.info=l(h,h.info),e.warn=l(h,h.warn),e.error=l(h,h.error),e.log=e.info}(),o.setHandler=function(e){s=e},o.setLevel=function(e){h.setLevel(e);for(var t in u)u.hasOwnProperty(t)&&u[t].setLevel(e)},o.get=function(e){return u[e]||(u[e]=new d(c({name:e},h.context)))},o.createDefaultHandler=function(e){e=e||{},e.formatter=e.formatter||function(e,t){t.name&&e.unshift("["+t.name+"]")};var t={},n=function(e,t){Function.prototype.apply.call(e,console,t)};return"undefined"==typeof console?function(){}:function(r,i){r=Array.prototype.slice.call(r);var a,s=console.log;i.level===o.TIME?(a=(i.name?"["+i.name+"] ":"")+r[0],"start"===r[1]?console.time?console.time(a):t[a]=(new Date).getTime():console.timeEnd?console.timeEnd(a):n(s,[a+": "+((new Date).getTime()-t[a])+"ms"])):(i.level===o.WARN&&console.warn?s=console.warn:i.level===o.ERROR&&console.error?s=console.error:i.level===o.INFO&&console.info&&(s=console.info),e.formatter(r,i),n(s,r))}},o.useDefaults=function(e){o.setLevel(e&&e.defaultLevel||o.DEBUG),o.setHandler(o.createDefaultHandler(e))},r=o,void 0!==(i="function"==typeof r?r.call(t,n,t,e):r)&&(e.exports=i)}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o,s,u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=n(2),f=function(e){return e&&e.__esModule?e:{default:e}}(c),d=n(1),h=n(3),p=n(8),v=n(52),y=function(e){return{metadataLoaded:e.engine.metadataLoaded,currentState:e.engine.playerState.currentState,playerClasses:e.shell.playerClasses,isMobile:e.shell.isMobile}},g=(o=(0,d.connect)(y,(0,h.bindActions)(p.actions)))(s=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Shell"}))}return a(t,e),u(t,[{key:"componentDidMount",value:function(){this.props.updateIsMobile((0,v.isMobile)())}},{key:"render",value:function(e){var t="player skin-default";return t+=" "+e.playerClasses.join(" "),this.props.metadataLoaded&&(t+=" metadata-loaded"),this.props.metadataLoaded&&(t+=" state-"+this.props.currentState),(0,l.h)("div",{className:t},e.children)}}]),t}(f.default))||s;t.default=g},function(e,t,n){"use strict";function r(){return void 0!==window.orientation||-1!==navigator.userAgent.indexOf("IEMobile")}Object.defineProperty(t,"__esModule",{value:!0}),t.isMobile=r},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(1),d=n(3),h=n(9),p=n(2),v=r(p),y=n(4),g=r(y),m=function(e){return{isPlaying:e.engine.isPlaying}},b=(s=(0,f.connect)(m,(0,d.bindActions)(h.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"OverlayPlay",player:e.player}))}return o(t,e),l(t,[{key:"togglePlayPause",value:function(){var e=this;this.logger.debug("Toggle play"),this.setState({animation:!0}),setTimeout(function(){e.setState({animation:!1})},400),this.player.paused?this.player.play():this.player.pause()}},{key:"render",value:function(e){var t=this;return(0,c.h)("div",{className:"overlay-play "+(this.state.animation?"in":""),onClick:function(){return t.togglePlayPause()}},e.isPlaying?(0,c.h)(g.default,{type:"play"}):(0,c.h)(g.default,{type:"pause"}))}}]),t}(v.default))||u;t.default=b},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(1),d=n(3),h=n(21),p=n(2),v=function(e){return e&&e.__esModule?e:{default:e}}(p),y=function(e){return{show:e.loading.show}},g=(s=(0,f.connect)(y,(0,d.bindActions)(h.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Loading",player:e.player}))}return o(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this;this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED,function(t){"idle"===t.payload.newState.type||"playing"===t.payload.newState.type||"paused"===t.payload.newState.type?e.props.updateLoadingSpinnerState(!1):e.props.updateLoadingSpinnerState(!0)})}},{key:"render",value:function(e){return(0,c.h)("div",{className:e.show?"loading-backdrop show":"loading-backdrop"},(0,c.h)("div",{className:"spinner-container"},(0,c.h)("div",{className:"spinner"},[].concat(r(Array(8))).map(function(){return(0,c.h)("span",null)}))))}}]),t}(v.default))||u;t.default=g},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(5),d=n(1),h=n(3),p=n(9),v=n(2),y=r(v),g=n(4),m=r(g),b=function(e){return{isPlaying:e.engine.isPlaying}},_=(s=(0,d.connect)(b,(0,h.bindActions)(p.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"PlayPause",player:e.player}))}return o(t,e),l(t,[{key:"togglePlayPause",value:function(){this.logger.debug("Toggle play"),this.player.paused?this.player.play():this.player.pause()}},{key:"render",value:function(){var e=this,t=this.props.isPlaying?"control-button is-playing":"control-button";return(0,c.h)("div",{className:"control-button-container control-play-pause"},(0,c.h)(f.Localizer,null,(0,c.h)("button",{"aria-label":(0,c.h)(f.Text,{id:this.props.isPlaying?"controls.pause":"controls.play"}),className:t,onClick:function(){return e.togglePlayPause()}},(0,c.h)(m.default,{type:"play"}),(0,c.h)(m.default,{type:"pause"}))))}}]),t}(y.default))||u;t.default=_},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o,s,u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=n(1),f=n(3),d=n(18),h=n(2),p=function(e){return e&&e.__esModule?e:{default:e}}(h),v=n(24),y=function(e){return{virtualProgress:e.seekbar.virtualTime,currentTime:e.seekbar.currentTime,duration:e.engine.duration,isDraggingActive:e.seekbar.draggingActive}},g=(o=(0,c.connect)(y,(0,f.bindActions)(d.actions)))(s=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"SeekBar",player:e.player}));return n.onSeekbarMouseDown=function(e){if(n.props.updateSeekbarDraggingStatus(!0),n.props.isDraggingActive){var t=n.getTime(e);n.updateSeekBarProgress(t,n.player.duration)}},n.onSeekbarMouseUp=function(e){var t=n.getTime(e);n.player.currentTime=t,n.updateSeekBarProgress(t,n.player.duration),n.props.updateSeekbarDraggingStatus(!1),n.logger.debug("Seek to "+t+"s")},n.onSeekbarMouseMove=function(e){var t=n.getTime(e);n.updateSeekBarProgress(t,n.player.duration,!0),n.props.isDraggingActive&&n.updateSeekBarProgress(t,n.player.duration)},n}return a(t,e),u(t,[{key:"componentDidMount",value:function(){var e=this;this._playerElement=document.getElementsByClassName("player")[0],this._seekBarElement=document.getElementsByClassName("seek-bar")[0],this.setState({virtualTime:0}),this.player.addEventListener(this.player.Event.TIME_UPDATE,function(){e.props.updateCurrentTime(e.player.currentTime)})}},{key:"updateSeekBarProgress",value:function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this.setState({virtualTime:e}):this.props.updateCurrentTime(e)}},{key:"getTime",value:function(e){var t=this.player.duration*((e.clientX-this._seekBarElement.offsetLeft-this._playerElement.offsetLeft)/this._seekBarElement.clientWidth);return t=parseFloat(t.toFixed(2)),t<0?0:t>this.player.duration?this.player.duration:t}},{key:"getThumbSpriteOffset",value:function(){return-160*Math.ceil(100*this.state.virtualTime/this.player.duration)+"px 0px"}},{key:"render",value:function(e){var t=this,n=this.state.virtualTime/e.duration*100+"%",r=e.currentTime/e.duration*100+"%",i="background-image: url(http://cfvod.kaltura.com/p/1914121/sp/191412100/thumbnail/entry_id/1_fet8ffop/version/100001/width/160/vid_slices/100); ";return i+="background-position: "+this.getThumbSpriteOffset(),(0,l.h)("div",{className:"seek-bar",role:"slider","aria-label":"Seek slider","aria-valuemin":"0","aria-valuemax":Math.round(this.player.duration),"aria-valuenow":Math.round(this.player.currentTime),"aria-valuetext":(0,v.toHHMMSS)(this.player.currentTime)+" of "+(0,v.toHHMMSS)(this.player.duration),onMouseMove:function(e){return t.onSeekbarMouseMove(e)},onMouseDown:function(e){return t.onSeekbarMouseDown(e)},onMouseUp:function(e){return t.onSeekbarMouseUp(e)}},(0,l.h)("div",{className:"progress-bar"},(0,l.h)("div",{className:"progress",style:{width:r}},(0,l.h)("a",{className:"scrubber"})),(0,l.h)("div",{className:"virtual-progress",style:{width:n}},e.showFramePreview?(0,l.h)("div",{className:"frame-preview"},(0,l.h)("div",{className:"frame-preview-img",style:i})):"",this.props.showTimeBubble?(0,l.h)("div",{className:"time-preview"},(0,v.toHHMMSS)(this.state.virtualTime)):""),(0,l.h)("div",{className:"buffered",style:"width: 60%;"})))}}]),t}(p.default))||s;t.default=g},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(1),d=n(3),h=n(19),p=n(2),v=r(p),y=n(4),g=r(y),m=function(e){return{isDraggingActive:e.volume.isDraggingActive,volume:e.volume.volume,muted:e.volume.muted,isMobile:e.shell.isMobile}},b=(s=(0,f.connect)(m,(0,d.bindActions)(h.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Volume",player:e.player}))}return o(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this;this._volumeControlElement=document.getElementsByClassName("volume-control")[0],this._volumeProgressBarElement=this._volumeControlElement.getElementsByClassName("bar")[0],this.player.addEventListener(this.player.Event.LOADED_METADATA,function(){e.props.updateVolume(e.player.volume)}),this.player.addEventListener(this.player.Event.VOLUME_CHANGE,function(){e.props.updateVolume(e.player.volume)})}},{key:"getVolumeProgessHeight",value:function(){return this.props.muted?"0%":Math.round(100*this.props.volume)+"%"}},{key:"onVolumeProgressBarMouseDown",value:function(){this.props.updateVolumeDraggingStatus(!0)}},{key:"onVolumeProgressBarClick",value:function(e){this.changeVolume(e)}},{key:"onVolumeControlButtonClick",value:function(){this.logger.debug("Toggle mute. "+this.player.muted+" => "+!this.player.muted),this.props.updateMuted(!this.props.muted),this.player.muted=!this.player.muted}},{key:"changeVolume",value:function(e){var t=this._volumeProgressBarElement.clientHeight,n=this.getCoords(this._volumeProgressBarElement).top,r=e.clientY,i=1-(r-n)/t;i=parseFloat(i.toFixed(2)),this.logger.debug("Change volume from "+this.player.volume+" => "+i),this.player.volume=i,this.props.muted&&(this.player.muted=!1,this.props.updateMuted(!1))}},{key:"getCoords",value:function(e){var t=e.getBoundingClientRect();return{top:t.top+pageYOffset,left:t.left+pageXOffset}}},{key:"render",value:function(){var e=this,t="control-button-container volume-control";return this.props.isDraggingActive&&(t+=" dragging-active"),(this.props.muted||0===this.props.volume)&&(t+=" is-muted"),!!this.props.isMobile&&(0,c.h)("div",{className:t},(0,c.h)("button",{className:"control-button",onClick:function(){return e.onVolumeControlButtonClick()},"aria-label":"Volume"},(0,c.h)(g.default,{type:"volume-base"}),(0,c.h)(g.default,{type:"volume-waves"}),(0,c.h)(g.default,{type:"volume-mute"})),(0,c.h)("div",{className:"volume-control-bar",role:"slider","aria-valuemin":"0","aria-valuemaz":"100","aria-valuenow":100*this.player.volume,"aria-valuetext":100*this.player.volume+"% volume "+(this.player.muted?"muted":"")},(0,c.h)("div",{className:"bar",onMouseDown:function(){return e.onVolumeProgressBarMouseDown()},onClick:function(t){return e.onVolumeProgressBarClick(t)}},(0,c.h)("div",{className:"progress",style:{height:this.getVolumeProgessHeight()}}))))}}]),t}(v.default))||u;t.default=b},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(1),d=n(3),h=n(10),p=n(2),v=r(p),y=n(4),g=r(y),m=function(e){return{overlayOpen:e.share.overlayOpen}},b=(s=(0,f.connect)(m,(0,d.bindActions)(h.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Share",player:e.player}))}return o(t,e),l(t,[{key:"render",value:function(e){return(0,c.h)("div",{className:"control-button-container control-share"},(0,c.h)("button",{className:"control-button control-button-rounded",onClick:function(){return e.toggleShareOverlay(!e.overlayOpen)},"aria-label":"Share"},(0,c.h)(g.default,{type:"share"})))}}]),t}(v.default))||u;t.default=b},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(5),d=n(1),h=n(3),p=n(23),v=n(2),y=r(v),g=n(25),m=r(g),b=n(26),_=r(b),E=n(4),T=r(E),w=function(e){return{videoTracks:e.engine.videoTracks}},k=(s=(0,d.connect)(w,(0,h.bindActions)(p.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Settings",player:e.player}))}return o(t,e),l(t,[{key:"componentDidMount",value:function(){this.setState({smartContainerOpen:!1})}},{key:"onControlButtonClick",value:function(){this.setState({smartContainerOpen:!this.state.smartContainerOpen})}},{key:"onSpeedChange",value:function(e){this.props.updateSpeed(e.value)}},{key:"onQualityChange",value:function(e){this.props.updateQuality(e.value)}},{key:"render",value:function(e){var t=this,n=[{value:1,label:"Auto (360)",active:!0},{value:2,label:"240"},{value:3,label:"144"}];return(0,c.h)("div",{className:"control-button-container control-settings"},(0,c.h)(f.Localizer,null,(0,c.h)("button",{"aria-label":(0,c.h)(f.Text,{id:"controls.settings"}),className:this.state.smartContainerOpen?"control-button active":"control-button",onClick:function(){return t.onControlButtonClick()}},(0,c.h)(T.default,{type:"settings"}))),this.state.smartContainerOpen?(0,c.h)(m.default,null,e.videoTracks.length<=0?"":(0,c.h)(f.Localizer,null,(0,c.h)(_.default,{label:(0,c.h)(f.Text,{id:"settings.quality"}),options:qualityOptions,onSelect:function(e){return t.onQualityChange(e)}})),(0,c.h)(f.Localizer,null,(0,c.h)(_.default,{label:(0,c.h)(f.Text,{id:"settings.speed"}),options:n,onSelect:function(e){return t.onSpeedChange(e)}}))):"")}}]),t}(y.default))||u;t.default=k},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=n(4),l=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),o(t,[{key:"componentWillMount",value:function(){this.setState({dropMenuActive:!1})}},{key:"isSelected",value:function(e){return e.active}},{key:"onSelect",value:function(e){this.props.onSelect(e),this.setState({dropMenuActive:!1})}},{key:"render",value:function(e){var t=this;return(0,s.h)("div",{className:"dropdown top left"},(0,s.h)("div",{className:"dropdown-button",onClick:function(){return t.setState({dropMenuActive:!t.state.dropMenuActive})}},e.options.filter(function(e){return e.active}).length>0?e.options.filter(function(e){return e.active})[0].label:""),this.state.dropMenuActive?(0,s.h)("div",{className:"dropdown-menu"},e.options.map(function(e){return(0,s.h)("div",{className:t.isSelected(e)?"dropdown-menu-item active":"dropdown-menu-item",onClick:function(){return t.onSelect(e)}},(0,s.h)("span",null,e.label),t.isSelected(e)?(0,s.h)(l.default,{type:"check"}):"")})):"")}}]),t}(s.Component);t.default=c},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(5),d=n(1),h=n(2),p=r(h),v=n(25),y=r(v),g=n(26),m=r(g),b=n(4),_=r(b),E=function(e){return{audioTracks:e.engine.audioTracks,textTracks:e.engine.textTracks}},T=(s=(0,d.connect)(E))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"LanguageControl",player:e.player}))}return o(t,e),l(t,[{key:"componentDidMount",value:function(){this.setState({smartContainerOpen:!1})}},{key:"onControlButtonClick",value:function(){this.setState({smartContainerOpen:!this.state.smartContainerOpen})}},{key:"onAudioChange",value:function(e){this.player._engine.selectTextTrack(e)}},{key:"onCaptionsChange",value:function(e){this.player._engine.selectTextTrack(e)}},{key:"render",value:function(e){var t=this;return(0!==e.audioTracks.length||0!==e.audioTracks.length)&&(0,c.h)("div",{className:"control-button-container control-language"},(0,c.h)(f.Localizer,null,(0,c.h)("button",{"aria-label":(0,c.h)(f.Text,{id:"controls.language"}),className:this.state.smartContainerOpen?"control-button active":"control-button",onClick:function(){return t.onControlButtonClick()}},(0,c.h)(_.default,{type:"language"}))),this.state.smartContainerOpen?(0,c.h)(y.default,null,e.audioTracks.length<=0?"":(0,c.h)(f.Localizer,null,(0,c.h)(m.default,{label:(0,c.h)(f.Text,{id:"language.audio"}),options:e.audioTracks,onSelect:function(e){return t.onAudioChange(e)}})),e.textTracks.length<=0?"":(0,c.h)(f.Localizer,null,(0,c.h)(m.default,{label:(0,c.h)(f.Text,{id:"language.captions"}),options:e.textTracks,onSelect:function(e){return t.onCaptionsChange(e)}})),e.textTracks.length<=0?"":(0,c.h)("div",{className:"smart-container-item"},(0,c.h)("a",{href:"#"},(0,c.h)(f.Text,{id:"language.advanced_captions_settings"},"Advanced captions settings")))):"")}}]),t}(p.default))||u;t.default=T},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(5),d=n(1),h=n(3),p=n(20),v=n(2),y=r(v),g=n(4),m=r(g),b=function(e){return{fullscreen:e.fullscreen.fullscreen}},_=(s=(0,d.connect)(b,(0,h.bindActions)(p.actions)))(u=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Fullscreen"}))}return o(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this;this._playerElement=document.getElementsByClassName("player")[0],document.addEventListener("webkitfullscreenchange",function(){e.props.updateFullscreen(document.webkitIsFullScreen)})}},{key:"enterFullscreen",value:function(){this._playerElement.webkitRequestFullscreen()}},{key:"exitFullscreen",value:function(){document.webkitCancelFullScreen()}},{key:"toggleFullscreen",value:function(){this.logger.debug("Toggle fullscreen"),this.props.fullscreen?this.exitFullscreen():this.enterFullscreen()}},{key:"render",value:function(){var e=this;return(0,c.h)("div",{className:"control-button-container control-fullscreen"},(0,c.h)(f.Localizer,null,(0,c.h)("button",{"aria-label":(0,c.h)(f.Text,{id:"controls.fullscreen"}),className:this.props.fullscreen?"control-button is-fullscreen":"control-button",onClick:function(){return e.toggleFullscreen()}},(0,c.h)(m.default,{type:"maximize"}),(0,c.h)(m.default,{type:"minimize"}))))}}]),t}(y.default))||u;t.default=_},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o,s,u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=n(1),f=n(2),d=function(e){return e&&e.__esModule?e:{default:e}}(f),h=n(24),p=function(e){return{currentTime:e.seekbar.currentTime,duration:e.engine.duration}},v=(o=(0,c.connect)(p))(s=function(e){function t(e){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"TimeDisplay",player:e.player,config:e.config}))}return a(t,e),u(t,[{key:"getTimeDisplay",value:function(){var e=this.props.format?this.props.format:"current / total",t=(0,h.toHHMMSS)(this.props.currentTime),n=(0,h.toHHMMSS)(this.props.duration),r=(0,h.toHHMMSS)(this.props.duration-this.props.currentTime);return e=e.replace(/current/g,t),e=e.replace(/total/g,n),e=e.replace(/left/g,r)}},{key:"render",value:function(){return(0,l.h)("div",{className:"time-display"},(0,l.h)("span",null,this.getTimeDisplay()))}}]),t}(d.default))||s;t.default=v},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),o(t,[{key:"render",value:function(e){return(0,s.h)("div",{className:"top-bar"},e.children)}}]),t}(s.Component);t.default=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),o(t,[{key:"render",value:function(e){return(0,s.h)("div",{className:"bottom-bar"},e.children)}}]),t}(s.Component);t.default=u},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(5),d=n(1),h=n(3),p=n(10),v=n(2),y=r(v),g=n(27),m=r(g),b=function(e){return{open:e.share.overlayOpen}},_=(s=(0,d.connect)(b,(0,h.bindActions)(p.actions)))(u=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"ShareOverlay"}))}return o(t,e),l(t,[{key:"render",value:function(e){return e.open?(0,c.h)(m.default,{open:e.open,onClose:function(){return e.toggleShareOverlay(!1)},type:"share"},(0,c.h)("div",{className:"title"},(0,c.h)(f.Text,{id:"share.share_title"})),(0,c.h)("div",{className:"share-icons"},(0,c.h)("a",{className:"share-btn facebook-share-btn"},(0,c.h)("svg",{style:"width:32px;height:32px",viewBox:"0 0 1024 1024"},(0,c.h)("path",{fill:"#fff",d:"M432 405.333h-80v106.667h80v320h133.333v-320h97.12l9.547-106.667h-106.667v-44.453c0-25.467 5.12-35.547 29.733-35.547h76.933v-133.333h-101.547c-95.893 0-138.453 42.213-138.453 123.067v90.267z"}))),(0,c.h)("a",{className:"share-btn twitter-share-btn"},(0,c.h)("svg",{style:"width:32px;height:32px",viewBox:"0 0 1024 1024"},(0,c.h)("path",{fill:"#fff",d:"M832 316.614c-23.547 10.29-48.853 17.221-75.413 20.345 27.12-15.987 47.947-41.319 57.733-71.508-25.36 14.806-53.467 25.568-83.387 31.37-23.92-25.122-58.080-40.82-95.84-40.82-84.773 0-147.067 77.861-127.92 158.687-109.093-5.381-205.84-56.833-270.613-135.035-34.4 58.094-17.84 134.090 40.613 172.574-21.493-0.683-41.76-6.484-59.44-16.171-1.44 59.879 42.16 115.898 105.307 128.368-18.48 4.935-38.72 6.090-59.307 2.205 16.693 51.347 65.173 88.702 122.667 89.752-55.2 42.605-124.747 61.637-194.4 53.552 58.107 36.673 127.147 58.067 201.28 58.067 243.787 0 381.52-202.684 373.2-384.473 25.653-18.244 47.92-41.004 65.52-66.914v0z"}))),(0,c.h)("a",{className:"share-btn google-plus-share-btn"},(0,c.h)("svg",{style:"width:32px;height:32px",viewBox:"0 0 1024 1024"},(0,c.h)("path",{fill:"#fff",d:"M352 556.8h127.040c-5.12 32.928-38.4 96.64-127.040 96.64-76.48 0-138.88-63.328-138.88-141.44 0-78.080 62.4-141.44 138.88-141.44 43.52 0 72.64 18.56 89.28 34.56l60.8-58.56c-39.040-36.48-89.6-58.56-150.080-58.56-123.84 0-224 100.16-224 224s100.16 224 224 224c129.28 0 215.072-90.88 215.072-218.88 0-14.72-1.632-25.92-3.552-37.12h-211.52v76.8zM800 544v96h-64v-96h-96v-64h96v-96h64v96h96v64h-96z"}))),(0,c.h)("a",{className:"share-btn linkedin-share-btn"},(0,c.h)("svg",{style:"width:32px;height:32px",viewBox:"0 0 1024 1024"},(0,c.h)("path",{fill:"#fff",d:"M324.8 290.087c0 36.506-29.6 66.087-66.133 66.087s-66.133-29.581-66.133-66.087c0-36.48 29.6-66.087 66.133-66.087s66.133 29.607 66.133 66.087zM325.333 409.043h-133.333v422.957h133.333v-422.957zM538.187 409.043h-132.48v422.957h132.507v-222.026c0-123.45 160.773-133.549 160.773 0v222.026h133.013v-267.811c0-208.306-237.92-200.719-293.813-98.179v-56.967z"}))),(0,c.h)("a",{className:"share-btn email-share-btn"},(0,c.h)("svg",{style:"width:32px;height:32px",viewBox:"0 0 1024 1024"},(0,c.h)("path",{fill:"#fff",d:"M256 768c-35.346 0-64-28.654-64-64v-352c0-35.346 28.654-64 64-64h512c35.346 0 64 28.654 64 64v352c0 35.346-28.654 64-64 64h-512zM512 467.488l147.52-115.488h-295.040l147.52 115.488zM748.48 352l-211.2 179.2c-0.713 1.308-1.572 2.532-2.56 3.648-12.707 12.158-32.733 12.158-45.44 0-0.988-1.116-1.847-2.34-2.56-3.648l-211.2-179.2h-19.52v352h512v-352h-19.52z"}))),(0,c.h)("a",{className:"share-btn embed-share-btn"},(0,c.h)("svg",{style:"width:32px;height:32px",viewBox:"0 0 1024 1024"},(0,c.h)("path",{fill:"#fff",d:"M377.989 579.335c12.669 12.904 12.669 33.777 0 46.68-12.733 12.969-33.427 12.969-46.16 0l-104.727-106.667c-12.669-12.904-12.669-33.777 0-46.68l104.727-106.667c12.733-12.969 33.427-12.969 46.16 0 12.669 12.904 12.669 33.777 0 46.68l-81.812 83.327 81.812 83.327zM646.011 412.68c-12.669-12.904-12.669-33.777 0-46.68 12.733-12.969 33.427-12.969 46.16 0l104.727 106.667c12.669 12.904 12.669 33.777 0 46.68l-104.727 106.667c-12.733 12.969-33.427 12.969-46.16 0-12.669-12.904-12.669-33.777 0-46.68l81.812-83.327-81.812-83.327zM572.293 250.6c17.455 4.445 28.025 22.388 23.686 40.066l-104.727 426.669c-4.349 17.719-22.048 28.535-39.545 24.079-17.455-4.445-28.025-22.388-23.686-40.066l104.727-426.669c4.349-17.719 22.048-28.535 39.545-24.079z"})))),(0,c.h)("div",null,(0,c.h)("div",{className:"form-group has-icon",style:"width: 300px;"},(0,c.h)("input",{type:"text",placeholder:"Share URL",className:"form-control",value:"https://cdnapisec.kaltura.com/index.php?assetId=123456",readOnly:!0}),(0,c.h)("svg",{className:"icon",style:"width:32px;height:32px;",viewBox:"0 0 1024 1024"},(0,c.h)("path",{d:"M355.028 445.537c12.497 12.497 12.497 32.758 0 45.255s-32.758 12.497-45.255 0l-24.141-24.141c-49.92-49.92-49.832-130.999 0.094-180.925 49.984-49.984 130.995-50.025 180.955-0.064l113.266 113.266c49.964 49.964 49.935 130.955-0.064 180.955-12.497 12.497-32.758 12.497-45.255 0s-12.497-32.758 0-45.255c25.013-25.013 25.027-65.482 0.064-90.445l-113.266-113.266c-24.957-24.957-65.445-24.936-90.445 0.064-24.955 24.955-24.998 65.511-0.094 90.416l24.141 24.141zM668.972 578.463c-12.497-12.497-12.497-32.758 0-45.255s32.758-12.497 45.255 0l24.141 24.141c49.92 49.92 49.832 130.999-0.094 180.925-49.984 49.984-130.995 50.025-180.955 0.064l-113.266-113.266c-49.964-49.964-49.935-130.955 0.064-180.955 12.497-12.497 32.758-12.497 45.255 0s12.497 32.758 0 45.255c-25.013 25.013-25.027 65.482-0.064 90.445l113.266 113.266c24.957 24.957 65.445 24.936 90.445-0.064 24.955-24.955 24.998-65.511 0.094-90.416l-24.141-24.141z"})))),(0,c.h)("a",null,(0,c.h)(f.Text,{id:"share.link_options"}))):""}}]),t}(y.default))||u;t.default=_},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(1),d=n(3),h=n(22),p=n(2),v=r(p),y=n(27),g=r(y),m=function(e){return{open:e.cvaa.overlayOpen}},b=(s=(0,f.connect)(m,(0,d.bindActions)(h.actions)))(u=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"CVAAOverlay"}))}return o(t,e),l(t,[{key:"render",value:function(e){return e.open?(0,c.h)(g.default,{type:"cvaa"},(0,c.h)("div",{className:"title"},"Advanced captions settings"),(0,c.h)("div",{className:"sample"},"Sample"),(0,c.h)("div",{className:"sample black-bg"},"Sample"),(0,c.h)("div",{className:"sample yellow-text"},"Sample")):""}}]),t}(v.default))||u;t.default=b},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(2),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Keyboard",player:e.player}));return document.body.onkeydown=function(e){var t=void 0,r=void 0;switch(e.which){case 32:n.logger.debug("Keydown space"),n.player.paused?n.player.play():n.player.pause();break;case 38:n.logger.debug("Keydown up"),r=Math.round(100*n.player.volume)+5,n.logger.debug("Changing volume. "+n.player.volume+" => "+r),n.player.muted&&(n.player.muted=!1),n.player.volume=r/100;break;case 40:if(n.logger.debug("Keydown down"),(r=Math.round(100*n.player.volume)-5)<5)return void(n.player.muted=!0);n.logger.debug("Changing volume. "+n.player.volume+" => "+r),n.player.volume=r/100;break;case 37:n.logger.debug("Keydown left"),t=n.player.currentTime-5>0?n.player.currentTime-5:0,n.player.currentTime=t;break;case 39:n.logger.debug("Keydown right"),t=n.player.currentTime+5>n.player.duration?n.player.duration:n.player.currentTime+5,n.player.currentTime=t;break;default:return}},n.disableKeyboardCommandsOnControls(),n}return a(t,e),o(t,[{key:"disableKeyboardCommandsOnControls",value:function(){Array.from(document.getElementsByClassName("control-button")).forEach(function(e){e.onkeydown=function(e){return e.preventDefault()}})}}]),t}(u.default);t.default=l}])})},function(e,t,n){var r=n(5);"string"==typeof r&&(r=[[e.i,r,""]]);var i={};i.transform=void 0;n(7)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){t=e.exports=n(6)(void 0),t.push([e.i,".row{display:block}.row:after{content:'';clear:both;display:block}.form-group{margin:10px auto;position:relative;max-width:100%}.form-group.has-error .form-control{border-color:#db1f26}.form-group.has-error .form-control:focus{border-color:#fff}.form-group.has-icon .form-control{padding-left:34px}.form-group .icon{position:absolute;top:2px;left:2px;fill:rgba(255,255,255,0.4)}.form-control{height:36px;width:100%;min-width:72px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(0,0,0,0.4);font-size:15px;line-height:18px;color:#fff;padding:8px 10px;text-overflow:ellipsis}.form-control::-webkit-input-placeholder{color:rgba(255,255,255,0.6)}.form-control:focus{background-color:#fff;border-color:#fff;color:#333}.form-control:focus::-webkit-input-placeholder{color:#ccc}.form-control:focus+.icon{fill:#999}textarea.form-control{min-height:72px}@-webkit-keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.dropdown{position:relative}.dropdown.active .dropdown-menu{display:block;opacity:1}.dropdown.top .dropdown-menu{margin-bottom:10px;bottom:100%}.dropdown.bottom .dropdown-menu{margin-top:10px;top:100%}.dropdown.right .dropdown-menu{left:0}.dropdown.left .dropdown-menu{right:0}.dropdown .dropdown-button{font-size:15px;font-weight:bold;line-height:18px;color:#fff;cursor:pointer}.dropdown .dropdown-menu{display:block;opacity:1;position:absolute;background-color:#333333;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;padding:6px 0;z-index:5;-webkit-animation:openDropmenu 100ms ease-out forwards;animation:openDropmenu 100ms ease-out forwards;max-height:173px;overflow-y:auto}.dropdown .dropdown-menu .dropdown-menu-item{padding:2px 10px 2px 16px;white-space:nowrap;min-height:30px;cursor:pointer}.dropdown .dropdown-menu .dropdown-menu-item:hover{color:#fff}.dropdown .dropdown-menu .dropdown-menu-item.active{color:#01ACCD;fill:#01ACCD}.dropdown .dropdown-menu .dropdown-menu-item .check-icon{display:inline-block;margin-left:16px;vertical-align:middle;width:24px;height:24px}.dropdown .dropdown-menu .dropdown-menu-item span{vertical-align:middle;line-height:26px}.tooltip{display:inline-block;height:22px;border-radius:4px;background-color:#FFFFFF;padding:3px 13px;color:#333333;font-size:13px;font-weight:bold;line-height:16px;box-shadow:0 0 8px 0 rgba(0,0,0,0.3)}.player .control-button{width:32px;height:32px;background:transparent;display:inline-block;opacity:0.8;border:none;padding:0;cursor:pointer;fill:#fff}.player .control-button svg{width:32px;height:32px}.player .control-button:hover,.player .control-button.active{opacity:1}.player .control-button.control-button-rounded{width:36px;height:36px;padding:2px}.player .control-button.control-button-rounded:hover{background-color:rgba(0,0,0,0.4);border-radius:18px}.player .control-button-container{display:inline-block;position:relative;vertical-align:top}a{color:#01ACCD;text-decoration:underline;font-size:15px;line-height:18px}a:hover{color:#01819a}a:active{opacity:0.7}.player{position:relative;max-width:854px;width:100%;background-color:#000;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.player:-webkit-full-screen{width:100%;height:100%;max-width:none}.player *{box-sizing:border-box;outline:none}.player ::-moz-selection{background-color:rgba(0,0,0,0.1)}.player ::selection{background-color:rgba(0,0,0,0.1)}.player video{width:100%}.player .player-gui{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;overflow:hidden;font-size:0;font-family:\"Lato\",sans-serif}.player .player-gui input,.player .player-gui textarea{font-family:\"Lato\",sans-serif}.player.metadata-loaded .player-gui,.player.state-paused .player-gui,.player.overlay-active .player-gui,.player.menu-active .player-gui{opacity:1}video::-webkit-media-controls{display:none !important}video::-webkit-media-controls-start-playback-button{display:none !important;-webkit-appearance:none}@-webkit-keyframes openOverlay{from{opacity:0}to{opacity:1}}@keyframes openOverlay{from{opacity:0}to{opacity:1}}.overlay{position:absolute;display:none;opacity:0;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.42);z-index:4;text-align:center;color:#fff;padding:80px 20px 0;-webkit-animation:openOverlay 100ms ease-in-out forwards;animation:openOverlay 100ms ease-in-out forwards}.overlay.active{display:block;opacity:1}.overlay .title{font-size:24px;font-weight:bold;line-height:29px;margin-bottom:60px}.overlay .close-overlay{position:absolute;top:48px;right:48px;z-index:5;fill:#fff;cursor:pointer}.overlay .close-overlay .icon-close{width:24px;height:24px}@media screen and (max-width: 768px){.overlay{padding:36px 20px 0}.overlay .close-overlay{top:38px}.overlay .title{margin-bottom:24px}}@media screen and (max-width: 480px){.overlay{padding:16px 24px 0}.overlay .close-overlay{top:15px;right:24px}.overlay .title{font-size:16px;line-height:19px;margin-bottom:36px}}@-webkit-keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.smart-container{background-color:#222222;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;position:absolute;right:0px;min-width:193px;font-size:15px;z-index:5;display:block;-webkit-animation:openSmartContainer 100ms ease-out forwards;animation:openSmartContainer 100ms ease-out forwards}.smart-container.top{bottom:100%;margin-bottom:6px}.smart-container.top:before{display:block;content:' ';position:absolute;bottom:-6px;left:0;width:100%;height:6px}.smart-container.bottom{top:100%;margin-top:6px}.smart-container.right{left:0px}.smart-container.left{right:0px}.smart-container .smart-container-item{margin:16px;color:rgba(244,244,244,0.8);white-space:nowrap}.smart-container .smart-container-item:after{display:block;content:' ';clear:both}.smart-container .smart-container-item.select-menu-item label{float:left}.smart-container .smart-container-item.select-menu-item .dropdown{float:right}.overlay.share-overlay .share-icons{margin:60px 0}.overlay.share-overlay .share-btn{height:36px;width:36px;border-radius:18px;background-color:rgba(0,0,0,0.4);display:inline-block;margin:0 8px;-webkit-transition:-webkit-transform 100ms;transition:transform 100ms;will-change:transform;padding:2px}.overlay.share-overlay .share-btn:hover{-webkit-transform:scale(1.1667);-ms-transform:scale(1.1667);transform:scale(1.1667)}.overlay.share-overlay .share-btn.facebook-share-btn{background-color:#3B5998}.overlay.share-overlay .share-btn.twitter-share-btn{background-color:#1DA1F2}.overlay.share-overlay .share-btn.google-plus-share-btn{background-color:#DD4B39}.overlay.share-overlay .share-btn.linkedin-share-btn{background-color:#00A0DC}@media screen and (max-width: 768px){.overlay.share-overlay .share-icons{margin:40px 0}}@media screen and (max-width: 480px){.overlay.share-overlay .share-icons{margin:20px 0}}.overlay.cvaa-overlay .sample{border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:36px;text-align:center;padding:0 28px;display:inline-block;margin:0 12px;cursor:pointer}.overlay.cvaa-overlay .sample.black-bg{background-color:#000}.overlay.cvaa-overlay .sample.yellow-text{color:#FAFF00}@-webkit-keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}@keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}.loading-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.3);-webkit-transition:100ms opacity;transition:100ms opacity;opacity:0}.loading-backdrop.show{opacity:1}.loading-backdrop.show .spinner-container{display:block}.loading-backdrop .spinner-container{display:none;position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50px, -50px, 0);transform:translate3d(-50px, -50px, 0)}.spinner{width:100px;height:100px;position:relative;-webkit-animation:kaltura-spinner 2.5s infinite;animation:kaltura-spinner 2.5s infinite}.spinner span{width:8px;height:8px;background-color:#fff;display:block;border-radius:8px;position:absolute;top:50%;left:50%;margin-top:-4px;margin-left:-4px}.spinner span:nth-child(1){-webkit-transform:rotate(45deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(45deg) translateX(-25px) translateY(-25px);transform:rotate(45deg) translateX(-25px) translateY(-25px);background-color:#da1f26}.spinner span:nth-child(2){-webkit-transform:rotate(90deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(90deg) translateX(-25px) translateY(-25px);transform:rotate(90deg) translateX(-25px) translateY(-25px);background-color:#06a885}.spinner span:nth-child(3){-webkit-transform:rotate(135deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(135deg) translateX(-25px) translateY(-25px);transform:rotate(135deg) translateX(-25px) translateY(-25px);background-color:#009344}.spinner span:nth-child(4){-webkit-transform:rotate(180deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(180deg) translateX(-25px) translateY(-25px);transform:rotate(180deg) translateX(-25px) translateY(-25px);background-color:#f8a61a}.spinner span:nth-child(5){-webkit-transform:rotate(225deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(225deg) translateX(-25px) translateY(-25px);transform:rotate(225deg) translateX(-25px) translateY(-25px);background-color:#1b4a97}.spinner span:nth-child(6){-webkit-transform:rotate(270deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(270deg) translateX(-25px) translateY(-25px);transform:rotate(270deg) translateX(-25px) translateY(-25px);background-color:#00abcc}.spinner span:nth-child(7){-webkit-transform:rotate(315deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(315deg) translateX(-25px) translateY(-25px);transform:rotate(315deg) translateX(-25px) translateY(-25px);background-color:#b1d238}.spinner span:nth-child(8){-webkit-transform:rotate(360deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(360deg) translateX(-25px) translateY(-25px);transform:rotate(360deg) translateX(-25px) translateY(-25px);background-color:#fcd203}.control-button-container.control-play-pause .control-button{-webkit-transition:400ms -webkit-transform;transition:400ms transform}.control-button-container.control-play-pause .control-button .icon-pause{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:0;display:none}.control-button-container.control-play-pause .control-button .icon-play{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}.control-button-container.control-play-pause .control-button.is-playing .icon-pause{opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing .icon-play{opacity:0;display:none}@media screen and (max-width: 480px){.control-button-container.control-play-pause{display:none}}.control-button-container.volume-control:hover .volume-control-bar{display:block !important}.control-button-container.volume-control.is-muted .volume-waves{opacity:0;-webkit-transform:translateX(-5px);-ms-transform:translateX(-5px);transform:translateX(-5px)}.control-button-container.volume-control.is-muted .volume-mute{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.volume-control.dragging-active .volume-control-bar{display:block}.control-button-container.volume-control .volume-waves{-webkit-transform:translateX(0px);-ms-transform:translateX(0px);transform:translateX(0px)}.control-button-container.volume-control .volume-mute{opacity:1;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.control-button-container.volume-control .volume-waves,.control-button-container.volume-control .volume-mute{-webkit-transition:300ms -webkit-transform, 300ms opacity;transition:300ms transform, 300ms opacity}.control-button-container.volume-control svg{position:absolute;top:0;left:0}.volume-control-bar{position:absolute;z-index:2;bottom:38px;left:0px;display:block;height:112px;width:34px;border-radius:4px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);background-color:#333333;padding:6px;display:none}.volume-control-bar:before{position:absolute;width:34px;height:14px;bottom:-8px;left:0;content:' ';display:block}.volume-control-bar .bar{background-color:#424242;height:100%;position:relative;cursor:ns-resize}.volume-control-bar .progress{position:absolute;bottom:0px;left:0px;width:100%;border-radius:0 0 2px 2px;background-color:#01ACCD}.control-button-container.control-fullscreen .control-button{-webkit-transition:100ms -webkit-transform;transition:100ms transform;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.control-fullscreen .control-button .icon-minimize{display:none}.control-button-container.control-fullscreen .control-button:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-maximize{display:none}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-minimize{display:block}.player .seek-bar{padding:6px 0;cursor:pointer}.player .seek-bar:hover .progress-bar .scrubber,.player .seek-bar.dragging-active .progress-bar .scrubber{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.player .seek-bar:hover .progress-bar .virtual-progress,.player .seek-bar.dragging-active .progress-bar .virtual-progress{display:block}.player .seek-bar .progress-bar{height:4px;background-color:rgba(255,255,255,0.3);border-radius:2px;position:relative}.player .seek-bar .progress-bar .progress{position:absolute;top:0;left:0;height:100%;z-index:2;border-radius:2px 0 0 2px;background-color:#01ACCD}.player .seek-bar .progress-bar .virtual-progress{display:none}.player .seek-bar .progress-bar .buffered,.player .seek-bar .progress-bar .virtual-progress{position:absolute;top:0;left:0;height:100%;z-index:1;border-radius:2px 0 0 2px;background-color:rgba(255,255,255,0.3)}.player .seek-bar .progress-bar .buffered .frame-preview-img,.player .seek-bar .progress-bar .virtual-progress .frame-preview-img{background-size:auto 100%;width:100%;height:100%;position:relative}.player .seek-bar .progress-bar .buffered .frame-preview,.player .seek-bar .progress-bar .virtual-progress .frame-preview{position:absolute;bottom:16px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:94px;width:164px;border:2px solid rgba(255,255,255,0.2);border-radius:4px}.player .seek-bar .progress-bar .buffered .time-preview,.player .seek-bar .progress-bar .virtual-progress .time-preview{position:absolute;bottom:22px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:22px;min-width:48px;padding:0 3px;text-align:center;border-radius:3px;background-color:rgba(0,0,0,0.7);font-size:13px;font-weight:bold;line-height:22px;color:#fff}.player .seek-bar .progress-bar .scrubber{position:absolute;z-index:3;cursor:pointer;display:block;top:-6px;right:-8px;border-radius:8px;height:16px;width:16px;background-color:#FFFFFF;box-shadow:0 0 31px 0 rgba(0,0,0,0.3);-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:100ms -webkit-transform;transition:100ms transform}.player .seek-bar .progress-bar .scrubber:active{opacity:1;cursor:-webkit-grabbing;cursor:grabbing}@media screen and (max-width: 480px){.virtual-progress{display:none}}.player .time-display{display:inline-block;line-height:32px;vertical-align:top;font-size:14px;padding:0 23px;font-weight:bold}@media screen and (max-width: 480px){.player .time-display{padding:0 12px 0 0}}.player .video-playing-title{font-size:15px;font-weight:bold;line-height:18px;padding:6px 0}.player .bottom-bar{position:absolute;bottom:0;left:0;width:100%;background:-webkit-linear-gradient(270deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:6px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .bottom-bar .left-controls{float:left;text-align:left}.player .bottom-bar .right-controls{float:right;text-align:left}.player .bottom-bar .right-controls .control-button-container{margin:0 6px}.player .bottom-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .bottom-bar,.player.hover .bottom-bar,.player.state-paused .bottom-bar,.player.menu-active .bottom-bar{opacity:1}.player.overlay-active .bottom-bar{opacity:0}@media screen and (max-width: 480px){.player .bottom-bar{padding:6px 8px}}.player .top-bar{position:absolute;top:0;left:0;width:100%;background:-webkit-linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(0deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:14px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .top-bar .left-controls{float:left;text-align:left}.player .top-bar .right-controls{float:right;text-align:left}.player .top-bar .right-controls .control-button-container{margin:0 6px}.player .top-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .top-bar,.player.hover .top-bar,.player.state-paused .top-bar,.player.menu-active .top-bar{opacity:1}.player.overlay-active .top-bar{opacity:0}@media screen and (max-width: 480px){.player .top-bar{padding:8px 8px 20px 8px}}@-webkit-keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}@keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}.overlay-play{position:absolute;top:0;left:0;width:100%;height:100%}.overlay-play.in .icon{-webkit-animation:overlayPlayIconIn 400ms linear forwards;animation:overlayPlayIconIn 400ms linear forwards}.overlay-play .icon{width:144px;height:144px;fill:#fff;position:absolute;top:50%;left:50%;margin:-72px 0 0 -72px;opacity:0}",""])},function(e,t){function n(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var a=r(i);return[n].concat(i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"})).concat([a]).join("\n")}return[n].join("\n")}function r(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var a=this[i][0];"number"==typeof a&&(r[a]=!0)}for(i=0;i<e.length;i++){var o=e[i];"number"==typeof o[0]&&r[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),t.push(o))}},t}},function(e,t,n){function r(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=p[r.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](r.parts[a]);for(;a<r.parts.length;a++)i.parts.push(c(r.parts[a],t))}else{for(var o=[],a=0;a<r.parts.length;a++)o.push(c(r.parts[a],t));p[r.id]={id:r.id,refs:1,parts:o}}}}function i(e,t){for(var n=[],r={},i=0;i<e.length;i++){var a=e[i],o=t.base?a[0]+t.base:a[0],s=a[1],u=a[2],l=a[3],c={css:s,media:u,sourceMap:l};r[o]?r[o].parts.push(c):n.push(r[o]={id:o,parts:[c]})}return n}function a(e,t){var n=y(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=b[b.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),b.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function o(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=b.indexOf(e);t>=0&&b.splice(t,1)}function s(e){var t=document.createElement("style");return e.attrs.type="text/css",l(t,e.attrs),a(e,t),t}function u(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",l(t,e.attrs),a(e,t),t}function l(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function c(e,t){var n,r,i,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var l=m++;n=g||(g=s(t)),r=f.bind(null,n,l,!1),i=f.bind(null,n,l,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=u(t),r=h.bind(null,n,t),i=function(){o(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=d.bind(null,n),i=function(){o(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}function f(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=E(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function d(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function h(e,t,n){var r=n.css,i=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||a)&&(r=_(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}var p={},v=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),y=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e.call(this,n)),t[n]}}(function(e){return document.querySelector(e)}),g=null,m=0,b=[],_=n(8);e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},t.attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=v()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=i(e,t);return r(n,t),function(e){for(var a=[],o=0;o<n.length;o++){var s=n[o],u=p[s.id];u.refs--,a.push(u)}if(e){r(i(e,t),t)}for(var o=0;o<a.length;o++){var u=a[o];if(0===u.refs){for(var l=0;l<u.parts.length;l++)u.parts[l]();delete p[u.id]}}}};var E=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i))return e;var a;return a=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(a)+")"})}},function(e,t,n){!function(t,r){e.exports=r(n(10),n(0))}(0,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var o=i.get;if(void 0!==o)return o.call(r)},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),l=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(2),f=function(e){function t(e,n,a){r(this,t),t._logger.debug("Creating adapter. Hls version: "+l.default.version);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,a));return o._hls=new l.default(o._config),o._addBindings(),o}return a(t,e),s(t,null,[{key:"canPlayType",value:function(e){var n="string"==typeof e&&t._hlsMimeTypes.includes(e.toLowerCase());return t._logger.debug("canPlayType result for mimeType:"+e+" is "+n.toString()),n}},{key:"isSupported",value:function(){var e=l.default.isSupported();return t._logger.debug("isSupported:"+e),e}}]),s(t,[{key:"_addBindings",value:function(){this._hls.on(l.default.Events.ERROR,this._onError.bind(this)),this._hls.on(l.default.Events.LEVEL_SWITCHED,this._onLevelSwitched.bind(this)),this._hls.on(l.default.Events.AUDIO_TRACK_SWITCHED,this._onAudioTrackSwitched.bind(this))}},{key:"load",value:function(){var e=this;return this._loadPromise||(this._loadPromise=new Promise(function(n){e._hls.on(l.default.Events.MANIFEST_LOADED,function(r,i){t._logger.debug("The source has been loaded successfully"),e._playerTracks=e._parseTracks(i),n({tracks:e._playerTracks})}),e._sourceObj&&e._sourceObj.url&&(e._hls.loadSource(e._sourceObj.url),e._hls.attachMedia(e._videoElement))})),this._loadPromise}},{key:"destroy",value:function(){t._logger.debug("destroy"),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),this._loadPromise=null,this._removeBindings(),this._hls.detachMedia(),this._hls.destroy()}},{key:"_parseTracks",value:function(e){var t=this._parseAudioTracks(e.audioTracks||[]),n=this._parseVideoTracks(e.levels||[]),r=this._parseTextTracks(this._videoElement.textTracks||[]);return t.concat(n).concat(r)}},{key:"_parseAudioTracks",value:function(e){for(var t=[],n=0;n<e.length;n++){var r={id:e[n].id,active:this._hls.audioTrack===e[n].id,label:e[n].name,language:e[n].lang,index:n};t.push(new c.AudioTrack(r))}return t}},{key:"_parseVideoTracks",value:function(e){for(var t=[],n=0;n<e.length;n++){var r={active:this._hls.startLevel===n,label:e[n].name,bandwidth:e[n].bitrate,language:"",index:n};t.push(new c.VideoTrack(r))}return t}},{key:"_parseTextTracks",value:function(e){for(var t=[],n=0;n<e.length;n++){var r={active:"showing"===e[n].mode,label:e[n].label,kind:e[n].kind,language:e[n].language,index:n};t.push(new c.TextTrack(r))}return t}},{key:"selectAudioTrack",value:function(e){e instanceof c.AudioTrack&&!e.active&&this._hls.audioTracks&&(this._hls.audioTrack=e.id)}},{key:"selectVideoTrack",value:function(e){e instanceof c.VideoTrack&&(!e.active||this._hls.autoLevelEnabled)&&this._hls.levels&&(this._hls.nextLevel=e.index)}},{key:"selectTextTrack",value:function(e){e instanceof c.TextTrack&&!e.active&&this._videoElement.textTracks&&(this._disableAllTextTracks(),this._videoElement.textTracks[e.index].mode="showing",t._logger.debug("Text track changed",e),this._onTrackChanged(e))}},{key:"enableAdaptiveBitrate",value:function(){this._hls.nextLevel=-1}},{key:"_onLevelSwitched",value:function(e,n){var r=this._playerTracks.find(function(e){return e instanceof c.VideoTrack&&e.index===n.level});t._logger.debug("Video track changed",r),this._onTrackChanged(r)}},{key:"_onAudioTrackSwitched",value:function(e,n){var r=this._playerTracks.find(function(e){return e instanceof c.AudioTrack&&e.id===n.id});t._logger.debug("Audio track changed",r),this._onTrackChanged(r)}},{key:"_disableAllTextTracks",value:function(){for(var e=this._videoElement.textTracks,t=0;t<e.length;t++)e[t].mode="hidden"}},{key:"_onError",value:function(e,n){var r=n.type,i=n.details;if(n.fatal)switch(r){case l.default.ErrorTypes.NETWORK_ERROR:t._logger.error("fatal network error encountered, try to recover"),this._hls.startLoad();break;case l.default.ErrorTypes.MEDIA_ERROR:t._logger.error("fatal media error encountered, try to recover"),this._hls.recoverMediaError();break;default:t._logger.error("fatal error, cannot recover"),this.destroy()}else switch(i){case l.default.ErrorDetails.MANIFEST_LOAD_ERROR:case l.default.ErrorDetails.MANIFEST_LOAD_TIMEOUT:case l.default.ErrorDetails.MANIFEST_PARSING_ERROR:case l.default.ErrorDetails.LEVEL_LOAD_ERROR:case l.default.ErrorDetails.LEVEL_LOAD_TIMEOUT:case l.default.ErrorDetails.LEVEL_SWITCH_ERROR:case l.default.ErrorDetails.FRAG_LOAD_ERROR:case l.default.ErrorDetails.FRAG_LOOP_LOADING_ERROR:case l.default.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.default.ErrorDetails.FRAG_PARSING_ERROR:case l.default.ErrorDetails.BUFFER_APPEND_ERROR:case l.default.ErrorDetails.BUFFER_APPENDING_ERROR:t._logger.error(r,i)}}},{key:"_removeBindings",value:function(){this._hls.off(l.default.Events.ERROR,this._onError),this._hls.off(l.default.Events.LEVEL_SWITCHED,this._onLevelSwitched),this._hls.off(l.default.Events.AUDIO_TRACK_SWITCHED,this._onAudioTrackSwitched)}},{key:"src",get:function(){return this._loadPromise&&this._sourceObj?this._sourceObj.url:""}}]),t}(c.BaseMediaSourceAdapter);f.id="HlsAdapter",f._logger=c.BaseMediaSourceAdapter.getLogger(f.id),f._hlsMimeTypes=["application/x-mpegurl","application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"],t.default=f,f.isSupported()&&(0,c.registerMediaSourceAdapter)(f)},function(t,n){t.exports=e},function(e,n){e.exports=t}])})},function(e,t,n){var r,r;!function(t){e.exports=t()}(function(){var e;return function e(t,n,i){function a(s,u){if(!n[s]){if(!t[s]){var l="function"==typeof r&&r;if(!u&&l)return r(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[s]={exports:{}};t[s][0].call(f.exports,function(e){var n=t[s][1][e];return a(n||e)},f,f.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof r&&r,s=0;s<i.length;s++)a(i[s]);return a}({1:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function a(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function s(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,a,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],s(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(o(n))for(a=Array.prototype.slice.call(arguments,1),l=n.slice(),r=l.length,u=0;u<r;u++)l[u].apply(this,a);return!0},r.prototype.addListener=function(e,t){var n;if(!i(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(n=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,a,s;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){r=s;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],2:[function(t,n,r){!function(t){var i=/^((?:[^\/;?#]+:)?)(\/\/[^\/\;?#]*)?(.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,a=/^([^\/;?#]*)(.*)$/,o=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,u={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");return r.path=u.normalizePath(r.path),u.buildURLFromParts(r)}var i=this.parseURL(t);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return n.alwaysNormalize?(i.path=u.normalizePath(i.path),u.buildURLFromParts(i)):t;var o=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var s=a.exec(o.path);o.netLoc=s[1],o.path=s[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(l.netLoc=o.netLoc,"/"!==i.path[0]))if(i.path){var c=o.path,f=c.substring(0,c.lastIndexOf("/")+1)+i.path;l.path=u.normalizePath(f)}else l.path=o.path,i.params||(l.params=o.params,i.query||(l.query=o.query));return null===l.path&&(l.path=n.alwaysNormalize?u.normalizePath(i.path):i.path),u.buildURLFromParts(l)},parseURL:function(e){var t=i.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(o,"");e.length!==(e=e.replace(s,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};"object"==typeof r&&"object"==typeof n?n.exports=u:"function"==typeof e&&e.amd?e([],function(){return u}):"object"==typeof r?r.URLToolkit=u:t.URLToolkit=u}(this)},{}],3:[function(e,t,n){var r=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;t.exports=function(e,t){function n(e){y[e]=!0;for(var t in i[e][1]){var r=i[e][1][t];y[r]||n(r)}}for(var s,u=Object.keys(a),l=0,c=u.length;l<c;l++){var f=u[l],d=a[f].exports;if(d===e||d&&d.default===e){s=f;break}}if(!s){s=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var h={},l=0,c=u.length;l<c;l++){var f=u[l];h[f]=f}i[s]=[Function(["require","module","exports"],"("+e+")(self)"),h]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),v={};v[s]=s,i[p]=[Function(["require"],"var f = require("+o(s)+");(f.default ? f.default : f)(self);"),v];var y={};n(p);var g="("+r+")({"+Object.keys(y).map(function(e){return o(e)+":["+i[e][0]+","+o(i[e][1])+"]"}).join(",")+"},{},["+o(p)+"])",m=window.URL||window.webkitURL||window.mozURL||window.msURL,b=new Blob([g],{type:"text/javascript"});if(t&&t.bare)return b;var _=m.createObjectURL(b),E=new Worker(_);return E.objectURL=_,E}},{}],4:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.hlsDefaultConfig=void 0;var i=e(5),a=r(i),o=e(8),s=r(o),u=e(9),l=r(u),c=e(10),f=r(c),d=e(58),h=r(d),p=e(7),v=r(p),y=e(6),g=r(y),m=e(50),b=r(m),_=e(16),E=r(_),T=e(15),w=r(T),k=e(14),S=r(k);n.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:l.default,fpsController:f.default,audioStreamController:g.default,audioTrackController:v.default,subtitleStreamController:S.default,subtitleTrackController:w.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(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(37),h=r(d),p=e(33),v=e(53),y=e(51),g=r(y),m=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.FRAG_LOADING,l.default.FRAG_LOADED,l.default.FRAG_BUFFERED,l.default.ERROR));return n.lastLoadedFragLevel=0,n._nextAutoLevel=-1,n.hls=e,n.onCheck=n._abandonRulesCheck.bind(n),n}return o(t,e),s(t,[{key:"destroy",value:function(){this.clearTimer(),f.default.prototype.destroy.call(this)}},{key:"onFragLoading",value:function(e){var t=e.frag;if("main"===t.type){if(this.timer||(this.timer=setInterval(this.onCheck,100)),!this._bwEstimator){var n=this.hls,r=e.frag.level,i=n.levels[r].details.live,a=n.config,o=void 0,s=void 0;i?(o=a.abrEwmaFastLive,s=a.abrEwmaSlowLive):(o=a.abrEwmaFastVoD,s=a.abrEwmaSlowVoD),this._bwEstimator=new g.default(n,s,o,a.abrEwmaDefaultEstimate)}this.fragCurrent=t}}},{key:"_abandonRulesCheck",value:function(){var e=this.hls,t=e.media,n=this.fragCurrent,r=n.loader,i=e.minAutoLevel;if(!r||r.stats&&r.stats.aborted)return v.logger.warn("frag loader destroy or aborted, disarm abandonRules"),void this.clearTimer();var a=r.stats;if(t&&(!t.paused&&0!==t.playbackRate||!t.readyState)&&n.autoLevel&&n.level){var o=performance.now()-a.trequest,s=Math.abs(t.playbackRate);if(o>500*n.duration/s){var u=e.levels,c=Math.max(1,a.bw?a.bw/8:1e3*a.loaded/o),f=u[n.level],d=f.realBitrate?Math.max(f.realBitrate,f.bitrate):f.bitrate,p=a.total?a.total:Math.max(a.loaded,Math.round(n.duration*d/8)),y=t.currentTime,g=(p-a.loaded)/c,m=(h.default.bufferInfo(t,y,e.config.maxBufferHole).end-y)/s;if(m<2*n.duration/s&&g>m){var b=void 0,_=void 0;for(_=n.level-1;_>i;_--){var E=u[_].realBitrate?Math.max(u[_].realBitrate,u[_].bitrate):u[_].bitrate;if((b=n.duration*E/(6.4*c))<m)break}b<g&&(v.logger.warn("loading too slow, abort fragment loading and switch to level "+_+":fragLoadedDelay["+_+"]<fragLoadedDelay["+(n.level-1)+"];bufferStarvationDelay:"+b.toFixed(1)+"<"+g.toFixed(1)+":"+m.toFixed(1)),e.nextLoadLevel=_,this._bwEstimator.sample(o,a.loaded),r.abort(),this.clearTimer(),e.trigger(l.default.FRAG_LOAD_EMERGENCY_ABORTED,{frag:n,stats:a}))}}}}},{key:"onFragLoaded",value:function(e){var t=e.frag;if("main"===t.type&&!isNaN(t.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var n=this.hls.levels[t.level],r=(n.loaded?n.loaded.bytes:0)+e.stats.loaded,i=(n.loaded?n.loaded.duration:0)+e.frag.duration;n.loaded={bytes:r,duration:i},n.realBitrate=Math.round(8*r/i)}if(e.frag.bitrateTest){var a=e.stats;a.tparsed=a.tbuffered=a.tload,this.onFragBuffered(e)}}}},{key:"onFragBuffered",value:function(e){var t=e.stats,n=e.frag;if(!(!0===t.aborted||1!==n.loadCounter||"main"!==n.type||isNaN(n.sn)||n.bitrateTest&&t.tload!==t.tbuffered)){var r=t.tparsed-t.trequest;v.logger.log("latency/loading/parsing/append/kbps:"+Math.round(t.tfirst-t.trequest)+"/"+Math.round(t.tload-t.tfirst)+"/"+Math.round(t.tparsed-t.tload)+"/"+Math.round(t.tbuffered-t.tparsed)+"/"+Math.round(8*t.loaded/(t.tbuffered-t.trequest))),this._bwEstimator.sample(r,t.loaded),t.bwEstimate=this._bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=r/1e3:this.bitrateTestDelay=0}}},{key:"onError",value:function(e){switch(e.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(e,t,n,r,i,a,o,s,u){for(var l=i;l>=r;l--){var c=u[l],f=c.details,d=f?f.totalduration/f.fragments.length:t,h=!!f&&f.live,p=void 0;p=l<=e?o*n:s*n;var y=u[l].realBitrate?Math.max(u[l].realBitrate,u[l].bitrate):u[l].bitrate,g=y*d/p;if(v.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+l+"/"+Math.round(p)+"/"+y+"/"+d+"/"+a+"/"+g),p>y&&(!g||h&&!this.bitrateTestDelay||g<a))return l}return-1}},{key:"nextAutoLevel",get:function(){var e=this._nextAutoLevel,t=this._bwEstimator;if(!(-1===e||t&&t.canEstimate()))return e;var n=this._nextABRAutoLevel;return-1!==e&&(n=Math.min(e,n)),n},set:function(e){this._nextAutoLevel=e}},{key:"_nextABRAutoLevel",get:function(){var e=this.hls,t=e.maxAutoLevel,n=e.levels,r=e.config,i=e.minAutoLevel,a=e.media,o=this.lastLoadedFragLevel,s=this.fragCurrent?this.fragCurrent.duration:0,u=a?a.currentTime:0,l=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,c=this._bwEstimator?this._bwEstimator.getEstimate():r.abrEwmaDefaultEstimate,f=(h.default.bufferInfo(a,u,r.maxBufferHole).end-u)/l,d=this._findBestLevel(o,s,c,i,t,f,r.abrBandWidthFactor,r.abrBandWidthUpFactor,n);if(d>=0)return d;v.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,g=r.abrBandWidthUpFactor;if(0===f){var m=this.bitrateTestDelay;if(m){p=(s?Math.min(s,r.maxLoadingDelay):r.maxLoadingDelay)-m,v.logger.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*p)+" ms"),y=g=1}}return d=this._findBestLevel(o,s,c,i,t,f+p,y,g,n),Math.max(d,0)}}]),t}(f.default);n.default=m},{33:33,34:34,35:35,37:37,51:51,53:53}],6:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(48),l=r(u),c=e(37),f=r(c),d=e(25),h=r(d),p=e(35),v=r(p),y=e(34),g=r(y),m=e(38),b=r(m),_=e(54),E=r(_),T=e(33),w=e(53),k={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(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,v.default.MEDIA_ATTACHED,v.default.MEDIA_DETACHING,v.default.AUDIO_TRACKS_UPDATED,v.default.AUDIO_TRACK_SWITCHING,v.default.AUDIO_TRACK_LOADED,v.default.KEY_LOADED,v.default.FRAG_LOADED,v.default.FRAG_PARSING_INIT_SEGMENT,v.default.FRAG_PARSING_DATA,v.default.FRAG_PARSED,v.default.ERROR,v.default.BUFFER_CREATED,v.default.BUFFER_APPENDED,v.default.BUFFER_FLUSHED,v.default.INIT_PTS_FOUND));return n.config=e.config,n.audioCodecSwap=!1,n.ticks=0,n._state=k.STOPPED,n.ontick=n.tick.bind(n),n.initPTS=[],n.waitingFragment=null,n}return o(t,e),s(t,[{key:"destroy",value:function(){this.stopLoad(),this.timer&&(clearInterval(this.timer),this.timer=null),g.default.prototype.destroy.call(this),this.state=k.STOPPED}},{key:"onInitPtsFound",value:function(e){var t=e.id,n=e.frag.cc,r=e.initPTS;"main"===t&&(this.initPTS[n]=r,w.logger.log("InitPTS for cc:"+n+" found from video track:"+r),this.state===k.WAITING_INIT_PTS&&(w.logger.log("sending pending audio frag to demuxer"),this.state=k.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null))}},{key:"startLoad",value:function(e){if(this.tracks){var t=this.lastCurrentTime;this.stopLoad(),this.timer||(this.timer=setInterval(this.ontick,100)),this.fragLoadError=0,t>0&&-1===e?(w.logger.log("audio:override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=k.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:e,this.state=k.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=e,this.state=k.STOPPED}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=k.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 e,t,n,r=this.hls,i=r.config;switch(this.state){case k.ERROR:case k.PAUSED:case k.BUFFER_FLUSHING:break;case k.STARTING:this.state=k.WAITING_TRACK,this.loadedmetadata=!1;break;case k.IDLE:var a=this.tracks;if(!a)break;if(!this.media&&(this.startFragRequested||!i.startFragPrefetch))break;e=this.loadedmetadata?this.media.currentTime:this.nextLoadPosition;var o=this.mediaBuffer?this.mediaBuffer:this.media,s=f.default.bufferInfo(o,e,i.maxBufferHole),u=s.len,c=s.end,d=this.fragPrevious,h=i.maxMaxBufferLength,p=this.audioSwitch,y=this.trackId;if((u<h||p)&&y<a.length){if(void 0===(n=a[y].details)){this.state=k.WAITING_TRACK;break}if(!p&&!n.live&&d&&d.sn===n.endSN&&(!this.media.seeking||this.media.duration-c<d.duration/2)){this.hls.trigger(v.default.BUFFER_EOS,{type:"audio"}),this.state=k.ENDED;break}var g=n.fragments,m=g.length,b=g[0].start,_=g[m-1].start+g[m-1].duration,E=void 0;if(p)if(n.live&&!n.PTSKnown)w.logger.log("switching audiotrack, live stream, unknown PTS,load first fragment"),c=0;else if(c=e,n.PTSKnown&&e<b){if(!(s.end>b||s.nextStart))return;w.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=b+.05}if(n.initSegment&&!n.initSegment.data)E=n.initSegment;else if(c<=b){if(E=g[0],n.live&&E.loadIdx&&E.loadIdx===this.fragLoadIdx){var S=s.nextStart?s.nextStart:b;return w.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(S+.05)),void(this.media.currentTime=S+.05)}}else{var O=void 0,A=i.maxFragLookUpTolerance,P=d?g[d.sn-g[0].sn+1]:void 0,R=function(e){var t=Math.min(A,e.duration);return e.start+e.duration-t<=c?1:e.start-t>c&&e.start?-1:0};c<_?(c>_-A&&(A=0),O=P&&!R(P)?P:l.default.search(g,R)):O=g[m-1],O&&(E=O,b=O.start,d&&E.level===d.level&&E.sn===d.sn&&(E.sn<n.endSN?(E=g[E.sn+1-n.startSN],w.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)w.logger.log("Loading key for "+E.sn+" of ["+n.startSN+" ,"+n.endSN+"],track "+y),this.state=k.KEY_LOADING,r.trigger(v.default.KEY_LOADING,{frag:E});else{if(w.logger.log("Loading "+E.sn+" of ["+n.startSN+" ,"+n.endSN+"],track "+y+", currentTime:"+e+",bufferEnd:"+c.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,E.loadCounter){E.loadCounter++;var D=i.fragLoadingLoopThreshold;if(E.loadCounter>D&&Math.abs(this.fragLoadIdx-E.loadIdx)<D)return void r.trigger(v.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(v.default.FRAG_LOADING,{frag:E}),this.state=k.FRAG_LOADING}}break;case k.WAITING_TRACK:t=this.tracks[this.trackId],t&&t.details&&(this.state=k.IDLE);break;case k.FRAG_LOADING_WAITING_RETRY:var L=performance.now(),x=this.retryDate;o=this.media;var I=o&&o.seeking;(!x||L>=x||I)&&(w.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=k.IDLE);break;case k.WAITING_INIT_PTS:case k.STOPPED:case k.FRAG_LOADING:case k.PARSING:case k.PARSED:case k.ENDED:}}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("ended",this.onvended);var n=this.config;this.tracks&&n.autoStartLoad&&this.startLoad(n.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(w.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.tracks;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.loadCounter=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.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===k.ENDED&&(this.state=k.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(e){w.logger.log("audio tracks updated"),this.tracks=e.audioTracks}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url;this.trackId=e.id,this.state=k.IDLE,this.fragCurrent=null,this.state=k.PAUSED,this.waitingFragment=null,t?this.timer||(this.timer=setInterval(this.ontick,100)):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),t&&(this.audioSwitch=!0,this.state=k.IDLE,void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold)),this.tick()}},{key:"onAudioTrackLoaded",value:function(e){var t=e.details,n=e.id,r=this.tracks[n],i=t.totalduration,a=0;if(w.logger.log("track "+n+" loaded ["+t.startSN+","+t.endSN+"],duration:"+i),t.live){var o=r.details;o&&t.fragments.length>0?(b.default.mergeDetails(o,t),a=t.fragments[0].start,t.PTSKnown?w.logger.log("live audio playlist sliding:"+a.toFixed(3)):w.logger.log("live audio playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,w.logger.log("live audio playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(r.details=t,!this.startFragRequested){if(-1===this.startPosition){var s=t.startTimeOffset;isNaN(s)?this.startPosition=0:(w.logger.log("start time offset found in playlist, adjust startPosition to "+s),this.startPosition=s)}this.nextLoadPosition=this.startPosition}this.state===k.WAITING_TRACK&&(this.state=k.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===k.KEY_LOADING&&(this.state=k.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,n=e.frag;if(this.state===k.FRAG_LOADING&&t&&"audio"===n.type&&n.level===t.level&&n.sn===t.sn){var r=this.tracks[this.trackId],i=r.details,a=i.totalduration,o=t.level,s=t.sn,u=t.cc,l=this.config.defaultAudioCodec||r.audioCodec||"mp4a.40.2",c=this.stats=e.stats;if("initSegment"===s)this.state=k.IDLE,c.tparsed=c.tbuffered=performance.now(),i.initSegment.data=e.payload,this.hls.trigger(v.default.FRAG_BUFFERED,{stats:c,frag:t,id:"audio"}),this.tick();else{this.state=k.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new h.default(this.hls,"audio"));var f=this.initPTS[u],d=i.initSegment?i.initSegment.data:[];if(i.initSegment||void 0!==f){this.pendingBuffering=!0,w.logger.log("Demuxing "+s+" of ["+i.startSN+" ,"+i.endSN+"],track "+o);this.demuxer.push(e.payload,d,l,null,t,a,!1,f)}else w.logger.log("unknown video PTS for continuity counter "+u+", waiting for video PTS before demuxing audio frag "+s+" of ["+i.startSN+" ,"+i.endSN+"],track "+o),this.waitingFragment=e,this.state=k.WAITING_INIT_PTS}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent,n=e.frag;if(t&&"audio"===e.id&&n.sn===t.sn&&n.level===t.level&&this.state===k.PARSING){var r=e.tracks,i=void 0;if(r.video&&delete r.video,i=r.audio){i.levelCodec="mp4a.40.2",i.id=e.id,this.hls.trigger(v.default.BUFFER_CODECS,r),w.logger.log("audio track:audio,container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var a=i.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(v.default.BUFFER_APPENDING,o))}this.tick()}}}},{key:"onFragParsingData",value:function(e){var t=this,n=this.fragCurrent,r=e.frag;if(n&&"audio"===e.id&&"audio"===e.type&&r.sn===n.sn&&r.level===n.level&&this.state===k.PARSING){var i=this.trackId,a=this.tracks[i],o=this.hls;isNaN(e.endPTS)&&(e.endPTS=e.startPTS+n.duration,e.endDTS=e.startDTS+n.duration),w.logger.log("parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb),b.default.updateFragPTSDTS(a.details,n,e.startPTS,e.endPTS);var s=this.audioSwitch,u=this.media,l=!1;if(s&&u)if(u.readyState){var c=u.currentTime;w.logger.log("switching audio track : currentTime:"+c),c>=e.startPTS&&(w.logger.log("switching audio track : flushing all audio"),this.state=k.BUFFER_FLUSHING,o.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),l=!0,this.audioSwitch=!1,o.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:i}))}else this.audioSwitch=!1,o.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:i});var f=this.pendingData;this.audioSwitch||([e.data1,e.data2].forEach(function(t){t&&t.length&&f.push({type:e.type,data:t,parent:"audio",content:"data"})}),!l&&f.length&&(f.forEach(function(e){t.state===k.PARSING&&(t.pendingBuffering=!0,t.hls.trigger(v.default.BUFFER_APPENDING,e))}),this.pendingData=[],this.appended=!0)),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent,n=e.frag;t&&"audio"===e.id&&n.sn===t.sn&&n.level===t.level&&this.state===k.PARSING&&(this.stats.tparsed=performance.now(),this.state=k.PARSED,this._checkAppendedParsed())}},{key:"onBufferCreated",value:function(e){var t=e.tracks.audio;t&&(this.mediaBuffer=t.buffer,this.loadedmetadata=!0)}},{key:"onBufferAppended",value:function(e){if("audio"===e.parent){var t=this.state;t!==k.PARSING&&t!==k.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==k.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent,t=this.stats,n=this.hls;if(e){this.fragPrevious=e,t.tbuffered=performance.now(),n.trigger(v.default.FRAG_BUFFERED,{stats:t,frag:e,id:"audio"});var r=this.mediaBuffer?this.mediaBuffer:this.media;w.logger.log("audio buffered : "+E.default.toString(r.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,n.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=k.IDLE}this.tick()}}},{key:"onError",value:function(e){var t=e.frag;if(!t||"audio"===t.type)switch(e.details){case T.ErrorDetails.FRAG_LOAD_ERROR:case T.ErrorDetails.FRAG_LOAD_TIMEOUT:if(!e.fatal){var n=this.fragLoadError;n?n++:n=1;var r=this.config;if(n<=r.fragLoadingMaxRetry){this.fragLoadError=n,t.loadCounter=0;var i=Math.min(Math.pow(2,n-1)*r.fragLoadingRetryDelay,r.fragLoadingMaxRetryTimeout);w.logger.warn("audioStreamController: frag loading failed, retry in "+i+" ms"),this.retryDate=performance.now()+i,this.state=k.FRAG_LOADING_WAITING_RETRY}else w.logger.error("audioStreamController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=k.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!==k.ERROR&&(this.state=e.fatal?k.ERROR:k.IDLE,w.logger.warn("audioStreamController: "+e.details+" while loading frag,switch to "+this.state+" state ..."));break;case T.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===e.parent&&(this.state===k.PARSING||this.state===k.PARSED)){var a=this.mediaBuffer,o=this.media.currentTime;if(a&&f.default.isBuffered(a,o)&&f.default.isBuffered(a,o+.5)){var s=this.config;s.maxMaxBufferLength>=s.maxBufferLength&&(s.maxMaxBufferLength/=2,w.logger.warn("audio:reduce max buffer length to "+s.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*s.fragLoadingLoopThreshold),this.state=k.IDLE}else w.logger.warn("buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=k.BUFFER_FLUSHING,this.hls.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}}}},{key:"onBufferFlushed",value:function(){var e=this,t=this.pendingData;t&&t.length?(w.logger.log("appending pending audio data on Buffer Flushed"),t.forEach(function(t){e.hls.trigger(v.default.BUFFER_APPENDING,t)}),this.appended=!0,this.pendingData=[],this.state=k.PARSED):(this.state=k.IDLE,this.fragPrevious=null,this.tick())}},{key:"state",set:function(e){if(this.state!==e){var t=this.state;this._state=e,w.logger.log("audio stream:"+t+"->"+e)}},get:function(){return this._state}}]),t}(g.default);n.default=S},{25:25,33:33,34:34,35:35,37:37,38:38,48:48,53:53,54:54}],7:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(53),h=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.MANIFEST_LOADING,l.default.MANIFEST_LOADED,l.default.AUDIO_TRACK_LOADED));return n.ticks=0,n.ontick=n.tick.bind(n),n}return o(t,e),s(t,[{key:"destroy",value:function(){f.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(e){var t=this,n=e.audioTracks||[],r=!1;this.tracks=n,this.hls.trigger(l.default.AUDIO_TRACKS_UPDATED,{audioTracks:n});var i=0;n.forEach(function(e){if(e.default)return t.audioTrack=i,void(r=!0);i++}),!1===r&&n.length&&(d.logger.log("no default audio track defined, use first audio track as default"),this.audioTrack=0)}},{key:"onAudioTrackLoaded",value:function(e){e.id<this.tracks.length&&(d.logger.log("audioTrack "+e.id+" loaded"),this.tracks[e.id].details=e.details,e.details.live&&!this.timer&&(this.timer=setInterval(this.ontick,1e3*e.details.targetduration)),!e.details.live&&this.timer&&(clearInterval(this.timer),this.timer=null))}},{key:"setAudioTrackInternal",value:function(e){if(e>=0&&e<this.tracks.length){this.timer&&(clearInterval(this.timer),this.timer=null),this.trackId=e,d.logger.log("switching to audioTrack "+e);var t=this.tracks[e],n=this.hls,r=t.type,i=t.url,a={id:e,type:r,url:i};n.trigger(l.default.AUDIO_TRACK_SWITCH,a),n.trigger(l.default.AUDIO_TRACK_SWITCHING,a);var o=t.details;!i||void 0!==o&&!0!==o.live||(d.logger.log("(re)loading playlist for audioTrack "+e),n.trigger(l.default.AUDIO_TRACK_LOADING,{url:i,id:e}))}}},{key:"updateTrack",value:function(e){if(e>=0&&e<this.tracks.length){this.timer&&(clearInterval(this.timer),this.timer=null),this.trackId=e,d.logger.log("updating audioTrack "+e);var t=this.tracks[e],n=t.url,r=t.details;!n||void 0!==r&&!0!==r.live||(d.logger.log("(re)loading playlist for audioTrack "+e),this.hls.trigger(l.default.AUDIO_TRACK_LOADING,{url:n,id:e}))}}},{key:"audioTracks",get:function(){return this.tracks}},{key:"audioTrack",get:function(){return this.trackId},set:function(e){this.trackId===e&&void 0!==this.tracks[e].details||this.setAudioTrackInternal(e)}}]),t}(f.default);n.default=h},{34:34,35:35,53:53}],8:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(53),h=e(33),p=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.MEDIA_ATTACHING,l.default.MEDIA_DETACHING,l.default.MANIFEST_PARSED,l.default.BUFFER_RESET,l.default.BUFFER_APPENDING,l.default.BUFFER_CODECS,l.default.BUFFER_EOS,l.default.BUFFER_FLUSHING,l.default.LEVEL_PTS_UPDATED,l.default.LEVEL_UPDATED));return n._msDuration=null,n._levelDuration=null,n.onsbue=n.onSBUpdateEnd.bind(n),n.onsbe=n.onSBUpdateError.bind(n),n.pendingTracks={},n.tracks={},n}return o(t,e),s(t,[{key:"destroy",value:function(){f.default.prototype.destroy.call(this)}},{key:"onLevelPtsUpdated",value:function(e){var t=e.type,n=this.tracks.audio;if("audio"===t&&n&&"audio/mpeg"===n.container){var r=this.sourceBuffer.audio;if(Math.abs(r.timestampOffset-e.start)>.1){var i=r.updating;try{r.abort()}catch(e){i=!0,d.logger.warn("can not abort audio buffer: "+e)}i?this.audioTimestampOffset=e.start:(d.logger.warn("change mpeg audio timestamp offset from "+r.timestampOffset+" to "+e.start),r.timestampOffset=e.start)}}}},{key:"onManifestParsed",value:function(e){var t=e.audio,n=e.video,r=0;e.altAudio&&(t||n)&&(r=(t?1:0)+(n?1:0),d.logger.log(r+" sourceBuffer(s) expected")),this.sourceBufferNb=r}},{key:"onMediaAttaching",value:function(e){var t=this.media=e.media;if(t){var n=this.mediaSource=new MediaSource;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),n.addEventListener("sourceopen",this.onmso),n.addEventListener("sourceended",this.onmse),n.addEventListener("sourceclose",this.onmsc),t.src=URL.createObjectURL(n)}}},{key:"onMediaDetaching",value:function(){d.logger.log("media source detaching");var e=this.mediaSource;if(e){if("open"===e.readyState)try{e.endOfStream()}catch(e){d.logger.warn("onMediaDetaching:"+e.message+" while calling endOfStream")}e.removeEventListener("sourceopen",this.onmso),e.removeEventListener("sourceended",this.onmse),e.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(l.default.MEDIA_DETACHED)}},{key:"onMediaSourceOpen",value:function(){d.logger.log("media source opened"),this.hls.trigger(l.default.MEDIA_ATTACHED,{media:this.media});var e=this.mediaSource;e&&e.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()}},{key:"checkPendingTracks",value:function(){var e=this.pendingTracks,t=Object.keys(e).length;t&&(this.sourceBufferNb<=t||0===this.sourceBufferNb)&&(this.createSourceBuffers(e),this.pendingTracks={},this.doAppending())}},{key:"onMediaSourceClose",value:function(){d.logger.log("media source closed")}},{key:"onMediaSourceEnded",value:function(){d.logger.log("media source ended")}},{key:"onSBUpdateEnd",value:function(){if(this.audioTimestampOffset){var e=this.sourceBuffer.audio;d.logger.warn("change mpeg audio timestamp offset from "+e.timestampOffset+" to "+this.audioTimestampOffset),e.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var t=this.parent,n=this.segments.reduce(function(e,n){return n.parent===t?e+1:e},0);this.hls.trigger(l.default.BUFFER_APPENDED,{parent:t,pending:n}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()}},{key:"onSBUpdateError",value:function(e){d.logger.error("sourceBuffer error:",e),this.hls.trigger(l.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferReset",value:function(){var e=this.sourceBuffer;for(var t in e){var n=e[t];try{this.mediaSource.removeSourceBuffer(n),n.removeEventListener("updateend",this.onsbue),n.removeEventListener("error",this.onsbe)}catch(e){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}},{key:"onBufferCodecs",value:function(e){if(0===Object.keys(this.sourceBuffer).length){for(var t in e)this.pendingTracks[t]=e[t];var n=this.mediaSource;n&&"open"===n.readyState&&this.checkPendingTracks()}}},{key:"createSourceBuffers",value:function(e){var t=this.sourceBuffer,n=this.mediaSource;for(var r in e)if(!t[r]){var i=e[r],a=i.levelCodec||i.codec,o=i.container+";codecs="+a;d.logger.log("creating sourceBuffer("+o+")");try{var s=t[r]=n.addSourceBuffer(o);s.addEventListener("updateend",this.onsbue),s.addEventListener("error",this.onsbe),this.tracks[r]={codec:a,container:i.container},i.buffer=s}catch(e){d.logger.error("error while trying to add sourceBuffer:"+e.message),this.hls.trigger(l.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:e,mimeType:o})}}this.hls.trigger(l.default.BUFFER_CREATED,{tracks:e})}},{key:"onBufferAppending",value:function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())}},{key:"onBufferAppendFail",value:function(e){d.logger.error("sourceBuffer error:",e.event),this.hls.trigger(l.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferEos",value:function(e){var t=this.sourceBuffer,n=e.type;for(var r in t)n&&r!==n||t[r].ended||(t[r].ended=!0,d.logger.log(r+" sourceBuffer now EOS"));this.checkEos()}},{key:"checkEos",value:function(){var e=this.sourceBuffer,t=this.mediaSource;if(!t||"open"!==t.readyState)return void(this._needsEos=!1);for(var n in e){var r=e[n];if(!r.ended)return;if(r.updating)return void(this._needsEos=!0)}d.logger.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(e){d.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}},{key:"onBufferFlushing",value:function(e){this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}),this.flushBufferCounter=0,this.doFlush()}},{key:"onLevelUpdated",value:function(e){var t=e.details;0!==t.fragments.length&&(this._levelDuration=t.totalduration+t.fragments[0].start,this.updateMediaElementDuration())}},{key:"updateMediaElementDuration",value:function(){var e=this.media,t=this.mediaSource,n=this.sourceBuffer,r=this._levelDuration;if(null!==r&&e&&t&&n&&0!==e.readyState&&"open"===t.readyState){for(var i in n)if(n[i].updating)return;null===this._msDuration&&(this._msDuration=t.duration);var a=e.duration;(r>this._msDuration&&r>a||a===1/0||isNaN(a))&&(d.logger.log("Updating mediasource duration to "+r.toFixed(3)),this._msDuration=t.duration=r)}}},{key:"doFlush",value:function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(!this.flushBuffer(e.start,e.end,e.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var t=0,n=this.sourceBuffer;try{for(var r in n)t+=n[r].buffered.length}catch(e){d.logger.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(l.default.BUFFER_FLUSHED)}}},{key:"doAppending",value:function(){var e=this.hls,t=this.sourceBuffer,n=this.segments;if(Object.keys(t).length){if(this.media.error)return this.segments=[],void d.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(n&&n.length){var r=n.shift();try{var i=r.type,a=t[i];a?a.updating?n.unshift(r):(a.ended=!1,this.parent=r.parent,a.appendBuffer(r.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(t){d.logger.error("error while trying to append buffer:"+t.message),n.unshift(r);var o={type:h.ErrorTypes.MEDIA_ERROR,parent:r.parent};if(22===t.code)return this.segments=[],o.details=h.ErrorDetails.BUFFER_FULL_ERROR,o.fatal=!1,void e.trigger(l.default.ERROR,o);if(this.appendError?this.appendError++:this.appendError=1,o.details=h.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.config.appendErrorMaxRetry)return d.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),n=[],o.fatal=!0,void e.trigger(l.default.ERROR,o);o.fatal=!1,e.trigger(l.default.ERROR,o)}}}}},{key:"flushBuffer",value:function(e,t,n){var r,i,a,o,s,u,l=this.sourceBuffer;if(Object.keys(l).length){if(d.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounter<this.appended){for(var c in l)if(!n||c===n){if(r=l[c],r.ended=!1,r.updating)return d.logger.warn("cannot flush, sb updating in progress"),!1;try{for(i=0;i<r.buffered.length;i++)if(a=r.buffered.start(i),o=r.buffered.end(i),-1!==navigator.userAgent.toLowerCase().indexOf("firefox")&&t===Number.POSITIVE_INFINITY?(s=e,u=t):(s=Math.max(a,e),u=Math.min(o,t)),Math.min(u,o)-s>.5)return this.flushBufferCounter++,d.logger.log("flush "+c+" ["+s+","+u+"], of ["+a+","+o+"], pos:"+this.media.currentTime),r.remove(s,u),!1}catch(e){d.logger.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else d.logger.warn("abort flushing too many retries");d.logger.log("buffer flushed")}return!0}}]),t}(f.default);n.default=p},{33:33,34:34,35:35,53:53}],9:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.FPS_DROP_LEVEL_CAPPING,l.default.MEDIA_ATTACHING,l.default.MANIFEST_PARSED))}return o(t,e),s(t,[{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(e){this.restrictedLevels||(this.restrictedLevels=[]),this.isLevelRestricted(e.droppedLevel)||this.restrictedLevels.push(e.droppedLevel)}},{key:"onMediaAttaching",value:function(e){this.media=e.media instanceof HTMLVideoElement?e.media:null}},{key:"onManifestParsed",value:function(e){var t=this.hls;t.config.capLevelToPlayerSize&&(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.levels=e.levels,t.firstLevel=this.getMaxLevel(e.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}},{key:"detectPlayerSize",value:function(){if(this.media){var e=this.levels?this.levels.length:0;if(e){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e-1),t.autoLevelCapping>this.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}},{key:"getMaxLevel",value:function(e){var t=0,n=void 0,r=void 0,i=this.mediaWidth,a=this.mediaHeight,o=0,s=0;for(n=0;n<=e&&(r=this.levels[n],!this.isLevelRestricted(n))&&(t=n,o=r.width,s=r.height,!(i<=o||a<=s));n++);return t}},{key:"isLevelRestricted",value:function(e){return!(!this.restrictedLevels||-1===this.restrictedLevels.indexOf(e))}},{key:"contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){}return e}},{key:"mediaWidth",get:function(){var e=void 0,t=this.media;return t&&(e=t.width||t.clientWidth||t.offsetWidth,e*=this.contentScaleFactor),e}},{key:"mediaHeight",get:function(){var e=void 0,t=this.media;return t&&(e=t.height||t.clientHeight||t.offsetHeight,e*=this.contentScaleFactor),e}}]),t}(f.default);n.default=d},{34:34,35:35}],10:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(53),h=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.MEDIA_ATTACHING))}return o(t,e),s(t,[{key:"destroy",value:function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1}},{key:"onMediaAttaching",value:function(e){var t=this.hls.config;if(t.capLevelOnFPSDrop){"function"==typeof(this.video=e.media instanceof HTMLVideoElement?e.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),t.fpsDroppedMonitoringPeriod)}}},{key:"checkFPS",value:function(e,t,n){var r=performance.now();if(t){if(this.lastTime){var i=r-this.lastTime,a=n-this.lastDroppedFrames,o=t-this.lastDecodedFrames,s=1e3*a/i,u=this.hls;if(u.trigger(l.default.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:n}),s>0&&a>u.config.fpsDroppedMonitoringThreshold*o){var c=u.currentLevel;d.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(-1===u.autoLevelCapping||u.autoLevelCapping>=c)&&(c-=1,u.trigger(l.default.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:u.currentLevel}),u.autoLevelCapping=c,u.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}},{key:"checkFPSInterval",value:function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}]),t}(f.default);n.default=h},{34:34,35:35,53:53}],11:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.MEDIA_ATTACHED,l.default.MEDIA_DETACHING,l.default.FRAG_PARSING_METADATA));return n.id3Track=void 0,n.media=void 0,n}return o(t,e),s(t,[{key:"destroy",value:function(){f.default.prototype.destroy.call(this)}},{key:"onMediaAttached",value:function(e){this.media=e.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(e){var t=e.frag,n=e.samples,r=t.start,i=t.start+t.duration;r===i&&(i+=1e-4);for(var a=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,o=0;o<n.length;o++){var s=this.parseID3Frame(n[o].data),u=this.decodeID3Frame(s);if(u){var l=new a(r,i,"");l.value=u,this.id3Track.addCue(l)}}}},{key:"parseID3Frame",value:function(e){if(!(e.length<21)&&73===e[0]&&68===e[1]&&51===e[2]){var t=String.fromCharCode(e[10],e[11],e[12],e[13]);return e=e.subarray(20),{type:t,data:e}}}},{key:"decodeID3Frame",value:function(e){return"TXXX"===e.type?this.decodeTxxxFrame(e):"PRIV"===e.type?this.decodePrivFrame(e):"T"===e.type[0]?this.decodeTextFrame(e):void 0}},{key:"decodeTxxxFrame",value:function(e){if(!(e.size<2)&&3===e.data[0]){var t=1,n=this.utf8ArrayToStr(e.data.subarray(t));t+=n.length+1;return{key:"TXXX",description:n,data:this.utf8ArrayToStr(e.data.subarray(t))}}}},{key:"decodeTextFrame",value:function(e){if(!(e.size<2)&&3===e.data[0]){var t=e.data.subarray(1);return{key:e.type,data:this.utf8ArrayToStr(t)}}}},{key:"decodePrivFrame",value:function(e){if(!(e.size<2)){var t=this.utf8ArrayToStr(e.data);return{key:"PRIV",info:t,data:e.data.subarray(t.length+1).buffer}}}},{key:"utf8ArrayToStr",value:function(e){for(var t=void 0,n=void 0,r="",i=0,a=e.length;i<a;){var o=e[i++];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:t=e[i++],r+=String.fromCharCode((31&o)<<6|63&t);break;case 14:t=e[i++],n=e[i++],r+=String.fromCharCode((15&o)<<12|(63&t)<<6|(63&n)<<0)}}return r}}]),t}(f.default);n.default=d},{34:34,35:35}],12:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(53),h=e(33),p=e(37),v=r(p),y=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.MANIFEST_LOADED,l.default.LEVEL_LOADED,l.default.FRAG_LOADED,l.default.ERROR));return n.ontick=n.tick.bind(n),n._manualLevel=-1,n}return o(t,e),s(t,[{key:"destroy",value:function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this._manualLevel=-1}},{key:"startLoad",value:function(){this.canload=!0;var e=this._levels;e&&e.forEach(function(e){e.loadError=0;var t=e.details;t&&t.live&&(e.details=void 0)}),this.timer&&this.tick()}},{key:"stopLoad",value:function(){this.canload=!1}},{key:"onManifestLoaded",value:function(e){var t,n=[],r=[],i={},a=!1,o=!1,s=this.hls,u=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),c=function(e,t){return MediaSource.isTypeSupported(e+"/mp4;codecs="+t)};if(e.levels.forEach(function(e){e.videoCodec&&(a=!0),u&&e.audioCodec&&-1!==e.audioCodec.indexOf("mp4a.40.34")&&(e.audioCodec=void 0),(e.audioCodec||e.attrs&&e.attrs.AUDIO)&&(o=!0);var t=i[e.bitrate];void 0===t?(i[e.bitrate]=n.length,e.url=[e.url],e.urlId=0,n.push(e)):n[t].url.push(e.url)}),a&&o?n.forEach(function(e){e.videoCodec&&r.push(e)}):r=n,r=r.filter(function(e){var t=e.audioCodec,n=e.videoCodec;return(!t||c("audio",t))&&(!n||c("video",n))}),r.length){t=r[0].bitrate,r.sort(function(e,t){return e.bitrate-t.bitrate}),this._levels=r;for(var f=0;f<r.length;f++)if(r[f].bitrate===t){this._firstLevel=f,d.logger.log("manifest loaded,"+r.length+" level(s) found, first bitrate:"+t);break}s.trigger(l.default.MANIFEST_PARSED,{levels:r,firstLevel:this._firstLevel,stats:e.stats,audio:o,video:a,altAudio:e.audioTracks.length>0})}else s.trigger(l.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(e){var t=this._levels,n=this.hls;if(e>=0&&e<t.length){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this._level!==e){d.logger.log("switching to level "+e),this._level=e;var r=t[e];r.level=e,n.trigger(l.default.LEVEL_SWITCH,r),n.trigger(l.default.LEVEL_SWITCHING,r)}var i=t[e],a=i.details;if(!a||!0===a.live){var o=i.urlId;n.trigger(l.default.LEVEL_LOADING,{url:i.url[o],level:e,id:o})}}else n.trigger(l.default.ERROR,{type:h.ErrorTypes.OTHER_ERROR,details:h.ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:!1,reason:"invalid level idx"})}},{key:"onError",value:function(e){if(!e.fatal){var t=e.details,n=this.hls,r=void 0,i=void 0,a=!1;switch(t){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=e.frag.level;break;case h.ErrorDetails.LEVEL_LOAD_ERROR:case h.ErrorDetails.LEVEL_LOAD_TIMEOUT:r=e.context.level,a=!0;break;case h.ErrorDetails.REMUX_ALLOC_ERROR:r=e.level}if(void 0!==r){i=this._levels[r],i.loadError?i.loadError++:i.loadError=1;var o=i.url.length;if(o>1&&i.loadError<o)i.urlId=(i.urlId+1)%o,i.details=void 0,d.logger.warn("level controller,"+t+" for level "+r+": switching to redundant stream id "+i.urlId);else{if(-1===this._manualLevel&&r)d.logger.warn("level controller,"+t+": switch-down for next fragment"),n.nextAutoLevel=Math.max(0,r-1);else if(i&&i.details&&i.details.live)d.logger.warn("level controller,"+t+" on live stream, discard"),a&&(this._level=void 0);else if(t===h.ErrorDetails.LEVEL_LOAD_ERROR||t===h.ErrorDetails.LEVEL_LOAD_TIMEOUT){var s=n.media,u=s&&v.default.isBuffered(s,s.currentTime)&&v.default.isBuffered(s,s.currentTime+.5);if(u){var l=n.config.levelLoadingRetryDelay;d.logger.warn("level controller,"+t+", but media buffered, retry in "+l+"ms"),this.timer=setTimeout(this.ontick,l),e.levelRetry=!0}else d.logger.error("cannot recover "+t+" error"),this._level=void 0,this.timer&&(clearTimeout(this.timer),this.timer=null),e.fatal=!0}}}}}},{key:"onFragLoaded",value:function(e){var t=e.frag;if(t&&"main"===t.type){var n=this._levels[t.level];n&&(n.loadError=0)}}},{key:"onLevelLoaded",value:function(e){var t=e.level;if(t===this._level){var n=this._levels[t];n.loadError=0;var r=e.details;if(r.live){var i=1e3*(r.averagetargetduration?r.averagetargetduration:r.targetduration),a=n.details;a&&r.endSN===a.endSN&&(i/=2,d.logger.log("same live playlist, reload twice faster")),i-=performance.now()-e.stats.trequest,i=Math.max(1e3,Math.round(i)),d.logger.log("live playlist, reload in "+i+" ms"),this.timer=setTimeout(this.ontick,i)}else this.timer=null}}},{key:"tick",value:function(){var e=this._level;if(void 0!==e&&this.canload){var t=this._levels[e];if(t&&t.url){var n=t.urlId;this.hls.trigger(l.default.LEVEL_LOADING,{url:t.url[n],level:e,id:n})}}}},{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this._level},set:function(e){var t=this._levels;t&&t.length>e&&(this._level===e&&void 0!==t[e].details||this.setLevelInternal(e))}},{key:"manualLevel",get:function(){return this._manualLevel},set:function(e){this._manualLevel=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this._manualLevel?this._manualLevel:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this._manualLevel&&(this.hls.nextAutoLevel=e)}}]),t}(f.default);n.default=y},{33:33,34:34,35:35,37:37,53:53}],13:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(48),l=r(u),c=e(37),f=r(c),d=e(25),h=r(d),p=e(35),v=r(p),y=e(34),g=r(y),m=e(38),b=r(m),_=e(54),E=r(_),T=e(33),w=e(53),k={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(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,v.default.MEDIA_ATTACHED,v.default.MEDIA_DETACHING,v.default.MANIFEST_LOADING,v.default.MANIFEST_PARSED,v.default.LEVEL_LOADED,v.default.KEY_LOADED,v.default.FRAG_LOADED,v.default.FRAG_LOAD_EMERGENCY_ABORTED,v.default.FRAG_PARSING_INIT_SEGMENT,v.default.FRAG_PARSING_DATA,v.default.FRAG_PARSED,v.default.ERROR,v.default.AUDIO_TRACK_SWITCHING,v.default.AUDIO_TRACK_SWITCHED,v.default.BUFFER_CREATED,v.default.BUFFER_APPENDED,v.default.BUFFER_FLUSHED));return n.config=e.config,n.audioCodecSwap=!1,n.ticks=0,n._state=k.STOPPED,n.ontick=n.tick.bind(n),n}return o(t,e),s(t,[{key:"destroy",value:function(){this.stopLoad(),this.timer&&(clearInterval(this.timer),this.timer=null),g.default.prototype.destroy.call(this),this.state=k.STOPPED}},{key:"startLoad",value:function(e){if(this.levels){var t=this.lastCurrentTime,n=this.hls;if(this.stopLoad(),this.timer||(this.timer=setInterval(this.ontick,100)),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var r=n.startLevel;-1===r&&(r=0,this.bitrateTest=!0),this.level=n.nextLoadLevel=r,this.loadedmetadata=!1}t>0&&-1===e&&(w.logger.log("override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=k.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this.forceStartLoad=!0,this.state=k.STOPPED}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=k.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 k.ERROR:break;case k.BUFFER_FLUSHING:this.fragLoadError=0;break;case k.IDLE:this._doTickIdle();break;case k.WAITING_LEVEL:var e=this.levels[this.level];e&&e.details&&(this.state=k.IDLE);break;case k.FRAG_LOADING_WAITING_RETRY:var t=performance.now(),n=this.retryDate;(!n||t>=n||this.media&&this.media.seeking)&&(w.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=k.IDLE);break;case k.ERROR:case k.STOPPED:case k.FRAG_LOADING:case k.PARSING:case k.PARSED:case k.ENDED:}this._checkBuffer(),this._checkFragmentChanged()}},{key:"_doTickIdle",value:function(){var e=this.hls,t=e.config,n=this.media;if(void 0===this.levelLastLoaded||n||!this.startFragRequested&&t.startFragPrefetch){var r=void 0;r=this.loadedmetadata?n.currentTime:this.nextLoadPosition;var i=e.nextLoadLevel,a=this.levels[i];if(a){var o=a.bitrate,s=void 0;s=o?Math.max(8*t.maxBufferSize/o,t.maxBufferLength):t.maxBufferLength,s=Math.min(s,t.maxMaxBufferLength);var u=f.default.bufferInfo(this.mediaBuffer?this.mediaBuffer:n,r,t.maxBufferHole),l=u.len;if(!(l>=s)){w.logger.trace("buffer length of "+l.toFixed(3)+" is below max of "+s.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=i;var c=a.details;if(void 0===c||c.live&&this.levelLastLoaded!==i)return void(this.state=k.WAITING_LEVEL);var d=this.fragPrevious;if(!c.live&&d&&d.sn===c.endSN){if(Math.min(n.duration,d.start+d.duration)-Math.max(u.end,d.start)<=Math.max(.2,d.duration)){var h={};return this.altAudio&&(h.type="video"),this.hls.trigger(v.default.BUFFER_EOS,h),void(this.state=k.ENDED)}}this._fetchPayloadOrEos(r,u,c)}}}}},{key:"_fetchPayloadOrEos",value:function(e,t,n){var r=this.fragPrevious,i=this.level,a=n.fragments,o=a.length;if(0!==o){var s=a[0].start,u=a[o-1].start+a[o-1].duration,l=t.end,c=void 0;if(n.initSegment&&!n.initSegment.data)c=n.initSegment;else if(n.live){var f=this.config.initialLiveManifestSize;if(o<f)return void w.logger.warn("Can not start playback of a level, reason: not enough fragments "+o+" < "+f);if(null===(c=this._ensureFragmentAtLivePoint(n,l,s,u,r,a,o)))return}else l<s&&(c=a[0]);c||(c=this._findFragment(s,r,o,a,l,u,n)),c&&this._loadFragmentOrKey(c,i,n,e,l)}}},{key:"_ensureFragmentAtLivePoint",value:function(e,t,n,r,i,a,o){var s=this.hls.config,u=this.media,l=void 0,c=void 0!==s.liveMaxLatencyDuration?s.liveMaxLatencyDuration:s.liveMaxLatencyDurationCount*e.targetduration;if(t<Math.max(n-s.maxFragLookUpTolerance,r-c)){var f=this.liveSyncPosition=this.computeLivePosition(n,e);w.logger.log("buffer end: "+t.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+f.toFixed(3)),t=f,u&&u.readyState&&u.duration>f&&(u.currentTime=f)}if(e.PTSKnown&&t>r&&u&&u.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(i){var d=i.sn+1;d>=e.startSN&&d<=e.endSN&&(l=a[d-e.startSN],w.logger.log("live playlist, switching playlist, load frag with next SN: "+l.sn))}l||(l=a[Math.min(o-1,Math.round(o/2))],w.logger.log("live playlist, switching playlist, unknown, load middle frag : "+l.sn))}return l}},{key:"_findFragment",value:function(e,t,n,r,i,a,o){var s=this.hls.config,u=void 0,c=void 0,f=s.maxFragLookUpTolerance,d=t?r[t.sn-r[0].sn+1]:void 0,h=function(e){var t=Math.min(f,e.duration);return e.start+e.duration-t<=i?1:e.start-t>i&&e.start?-1:0};if(i<a?(i>a-f&&(f=0),c=d&&!h(d)?d:l.default.search(r,h)):c=r[n-1],c){u=c;var p=u.sn-o.startSN,v=t&&u.level===t.level,y=r[p-1],g=r[p+1];if(t&&u.sn===t.sn)if(v&&!u.backtracked)if(u.sn<o.endSN){var m=t.deltaPTS;m&&m>s.maxBufferHole&&t.dropped&&p?(u=y,w.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"),t.loadCounter--):(u=g,w.logger.log("SN just loaded, load next one: "+u.sn))}else u=null;else u.backtracked&&(g&&g.backtracked?(w.logger.warn("Already backtracked from fragment "+g.sn+", will not backtrack to fragment "+u.sn+". Loading fragment "+g.sn),u=g):(w.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),u.dropped=0,y?(y.loadCounter&&y.loadCounter--,u=y,u.backtracked=!0):u=null))}return u}},{key:"_loadFragmentOrKey",value:function(e,t,n,r,i){var a=this.hls,o=a.config;if(!e.decryptdata||null==e.decryptdata.uri||null!=e.decryptdata.key){if(w.logger.log("Loading "+e.sn+" of ["+n.startSN+" ,"+n.endSN+"],level "+t+", currentTime:"+r.toFixed(3)+",bufferEnd:"+i.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,e.loadCounter){e.loadCounter++;var s=o.fragLoadingLoopThreshold;if(e.loadCounter>s&&Math.abs(this.fragLoadIdx-e.loadIdx)<s)return void a.trigger(v.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_LOOP_LOADING_ERROR,fatal:!1,frag:e})}else e.loadCounter=1;return e.loadIdx=this.fragLoadIdx,this.fragCurrent=e,this.startFragRequested=!0,isNaN(e.sn)||(this.nextLoadPosition=e.start+e.duration),e.autoLevel=a.autoLevelEnabled,e.bitrateTest=this.bitrateTest,a.trigger(v.default.FRAG_LOADING,{frag:e}),this.demuxer||(this.demuxer=new h.default(a,"main")),void(this.state=k.FRAG_LOADING)}w.logger.log("Loading key for "+e.sn+" of ["+n.startSN+" ,"+n.endSN+"],level "+t),this.state=k.KEY_LOADING,a.trigger(v.default.KEY_LOADING,{frag:e})}},{key:"getBufferedFrag",value:function(e){return l.default.search(this._bufferedFrags,function(t){return e<t.startPTS?-1:e>t.endPTS?1:0})}},{key:"followingBufferedFrag",value:function(e){return e?this.getBufferedFrag(e.endPTS+.5):null}},{key:"_checkFragmentChanged",value:function(){var e,t,n=this.media;if(n&&n.readyState&&!1===n.seeking&&(t=n.currentTime,t>n.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=t),f.default.isBuffered(n,t)?e=this.getBufferedFrag(t):f.default.isBuffered(n,t+.1)&&(e=this.getBufferedFrag(t+.1)),e)){var r=e;if(r!==this.fragPlaying){this.hls.trigger(v.default.FRAG_CHANGED,{frag:r});var i=r.level;this.fragPlaying&&this.fragPlaying.level===i||this.hls.trigger(v.default.LEVEL_SWITCHED,{level:i}),this.fragPlaying=r}}}},{key:"immediateLevelSwitch",value:function(){if(w.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var e=this.media,t=void 0;e?(t=e.paused,e.pause()):t=!0,this.previouslyPaused=t}var n=this.fragCurrent;n&&n.loader&&n.loader.abort(),this.fragCurrent=null,this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}},{key:"immediateLevelSwitchEnd",value:function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,f.default.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())}},{key:"nextLevelSwitch",value:function(){var e=this.media;if(e&&e.readyState){var t=void 0,n=void 0,r=void 0;if(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,n=this.getBufferedFrag(e.currentTime),n&&n.startPTS>1&&this.flushMainBuffer(0,n.startPTS-1),e.paused)t=0;else{var i=this.hls.nextLoadLevel,a=this.levels[i],o=this.fragLastKbps;t=o&&this.fragCurrent?this.fragCurrent.duration*a.bitrate/(1e3*o)+1:0}if((r=this.getBufferedFrag(e.currentTime+t))&&(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(e,t){this.state=k.BUFFER_FLUSHING;var n={startOffset:e,endOffset:t};this.altAudio&&(n.type="video"),this.hls.trigger(v.default.BUFFER_FLUSHING,n)}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("seeked",this.onvseeked),t.addEventListener("ended",this.onvended);var n=this.config;this.levels&&n.autoStartLoad&&this.hls.startLoad(n.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(w.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.levels;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.loadCounter=void 0,e.backtracked=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){var e=this.media,t=e?e.currentTime:void 0,n=this.config;isNaN(t)||w.logger.log("media seeking to "+t.toFixed(3));var r=this.mediaBuffer?this.mediaBuffer:e,i=f.default.bufferInfo(r,t,this.config.maxBufferHole);if(this.state===k.FRAG_LOADING){var a=this.fragCurrent;if(0===i.len&&a){var o=n.maxFragLookUpTolerance,s=a.start-o,u=a.start+a.duration+o;t<s||t>u?(a.loader&&(w.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=k.IDLE):w.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===k.ENDED&&(0===i.len&&(this.fragPrevious=0),this.state=k.IDLE);e&&(this.lastCurrentTime=t),this.state!==k.FRAG_LOADING&&void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*n.fragLoadingLoopThreshold),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=t),this.tick()}},{key:"onMediaSeeked",value:function(){var e=this.media,t=e?e.currentTime:void 0;isNaN(t)||w.logger.log("media seeked to "+t.toFixed(3)),this.tick()}},{key:"onMediaEnded",value:function(){w.logger.log("media ended"),this.startPosition=this.lastCurrentTime=0}},{key:"onManifestLoading",value:function(){w.logger.log("trigger BUFFER_RESET"),this.hls.trigger(v.default.BUFFER_RESET),this._bufferedFrags=[],this.stalled=!1,this.startPosition=this.lastCurrentTime=0}},{key:"onManifestParsed",value:function(e){var t,n=!1,r=!1;e.levels.forEach(function(e){(t=e.audioCodec)&&(-1!==t.indexOf("mp4a.40.2")&&(n=!0),-1!==t.indexOf("mp4a.40.5")&&(r=!0))}),this.audioCodecSwitch=n&&r,this.audioCodecSwitch&&w.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startLevelLoaded=!1,this.startFragRequested=!1;var i=this.config;(i.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(i.startPosition)}},{key:"onLevelLoaded",value:function(e){var t=e.details,n=e.level,r=this.levels[n],i=t.totalduration,a=0;if(w.logger.log("level "+n+" loaded ["+t.startSN+","+t.endSN+"],duration:"+i),this.levelLastLoaded=n,t.live){var o=r.details;o&&t.fragments.length>0?(b.default.mergeDetails(o,t),a=t.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(a,o),t.PTSKnown?w.logger.log("live playlist sliding:"+a.toFixed(3)):w.logger.log("live playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,w.logger.log("live playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(r.details=t,this.hls.trigger(v.default.LEVEL_UPDATED,{details:t,level:n}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var s=t.startTimeOffset;isNaN(s)?t.live?(this.startPosition=this.computeLivePosition(a,t),w.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(s<0&&(w.logger.log("negative start time offset "+s+", count from end of last fragment"),s=a+i+s),w.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===k.WAITING_LEVEL&&(this.state=k.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===k.KEY_LOADING&&(this.state=k.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,n=e.frag;if(this.state===k.FRAG_LOADING&&t&&"main"===n.type&&n.level===t.level&&n.sn===t.sn){var r=e.stats,i=this.levels[t.level],a=i.details;if(w.logger.log("Loaded "+t.sn+" of ["+a.startSN+" ,"+a.endSN+"],level "+t.level),this.bitrateTest=!1,this.stats=r,!0===n.bitrateTest&&this.hls.nextLoadLevel)this.state=k.IDLE,this.startFragRequested=!1,r.tparsed=r.tbuffered=performance.now(),this.hls.trigger(v.default.FRAG_BUFFERED,{stats:r,frag:t,id:"main"}),this.tick();else if("initSegment"===n.sn)this.state=k.IDLE,r.tparsed=r.tbuffered=performance.now(),a.initSegment.data=e.payload,this.hls.trigger(v.default.FRAG_BUFFERED,{stats:r,frag:t,id:"main"}),this.tick();else{this.state=k.PARSING;var o=a.totalduration,s=t.level,u=t.sn,l=this.config.defaultAudioCodec||i.audioCodec;this.audioCodecSwap&&(w.logger.log("swapping playlist audio codec"),void 0===l&&(l=this.lastAudioCodec),l&&(l=-1!==l.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),this.pendingBuffering=!0,this.appended=!1,w.logger.log("Parsing "+u+" of ["+a.startSN+" ,"+a.endSN+"],level "+s+", cc "+t.cc);var c=this.demuxer;c||(c=this.demuxer=new h.default(this.hls,"main"));var f=this.media,d=f&&f.seeking,p=!d&&(a.PTSKnown||!a.live),y=a.initSegment?a.initSegment.data:[];c.push(e.payload,y,l,i.videoCodec,t,o,p,void 0)}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent,n=e.frag;if(t&&"main"===e.id&&n.sn===t.sn&&n.level===t.level&&this.state===k.PARSING){var r,i,a=e.tracks;if(a.audio&&this.altAudio&&delete a.audio,i=a.audio){var o=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(w.logger.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==i.metadata.channelCount&&-1===s.indexOf("firefox")&&(o="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==i.container&&(o="mp4a.40.2",w.logger.log("Android: force audio codec to "+o)),i.levelCodec=o,i.id=e.id}i=a.video,i&&(i.levelCodec=this.levels[this.level].videoCodec,i.id=e.id),this.hls.trigger(v.default.BUFFER_CODECS,a);for(r in a){i=a[r],w.logger.log("main track:"+r+",container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var u=i.initSegment;u&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(v.default.BUFFER_APPENDING,{type:r,data:u,parent:"main",content:"initSegment"}))}this.tick()}}},{key:"onFragParsingData",value:function(e){var t=this,n=this.fragCurrent,r=e.frag;if(n&&"main"===e.id&&r.sn===n.sn&&r.level===n.level&&("audio"!==e.type||!this.altAudio)&&this.state===k.PARSING){var i=this.levels[this.level],a=n;if(isNaN(e.endPTS)&&(e.endPTS=e.startPTS+n.duration,e.endDTS=e.startDTS+n.duration),w.logger.log("Parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb+",dropped:"+(e.dropped||0)),"video"===e.type)if(a.dropped=e.dropped,a.dropped){if(!a.backtracked)return w.logger.warn("missing video frame(s), backtracking fragment"),a.backtracked=!0,this.nextLoadPosition=e.startPTS,this.state=k.IDLE,this.fragPrevious=a,void this.tick();w.logger.warn("Already backtracked on this fragment, appending with the gap")}else a.backtracked=!1;var o=b.default.updateFragPTSDTS(i.details,a,e.startPTS,e.endPTS,e.startDTS,e.endDTS),s=this.hls;s.trigger(v.default.LEVEL_PTS_UPDATED,{details:i.details,level:this.level,drift:o,type:e.type,start:e.startPTS,end:e.endPTS}),[e.data1,e.data2].forEach(function(n){n&&n.length&&t.state===k.PARSING&&(t.appended=!0,t.pendingBuffering=!0,s.trigger(v.default.BUFFER_APPENDING,{type:e.type,data:n,parent:"main",content:"data"}))}),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent,n=e.frag;t&&"main"===e.id&&n.sn===t.sn&&n.level===t.level&&this.state===k.PARSING&&(this.stats.tparsed=performance.now(),this.state=k.PARSED,this._checkAppendedParsed())}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url,n=e.id;if(!t){if(this.mediaBuffer!==this.media){w.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var r=this.fragCurrent;r.loader&&(w.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=k.IDLE}var i=this.hls;i.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),i.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:n}),this.altAudio=!1}}},{key:"onAudioTrackSwitched",value:function(e){var t=e.id,n=!!this.hls.audioTracks[t].url;if(n){var r=this.videoBuffer;r&&this.mediaBuffer!==r&&(w.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=n,this.tick()}},{key:"onBufferCreated",value:function(e){var t=e.tracks,n=void 0,r=void 0,i=!1;for(var a in t){var o=t[a];"main"===o.id?(r=a,n=o,"video"===a&&(this.videoBuffer=t[a].buffer)):i=!0}i&&n?(w.logger.log("alternate track found, use "+r+".buffered to schedule main fragment loading"),this.mediaBuffer=n.buffer):this.mediaBuffer=this.media}},{key:"onBufferAppended",value:function(e){if("main"===e.parent){var t=this.state;t!==k.PARSING&&t!==k.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==k.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent;if(e){var t=this.mediaBuffer?this.mediaBuffer:this.media;w.logger.log("main buffered : "+E.default.toString(t.buffered));var n=this._bufferedFrags.filter(function(e){return f.default.isBuffered(t,(e.startPTS+e.endPTS)/2)});n.push(e),this._bufferedFrags=n.sort(function(e,t){return e.startPTS-t.startPTS}),this.fragPrevious=e;var r=this.stats;r.tbuffered=performance.now(),this.fragLastKbps=Math.round(8*r.total/(r.tbuffered-r.tfirst)),this.hls.trigger(v.default.FRAG_BUFFERED,{stats:r,frag:e,id:"main"}),this.state=k.IDLE}this.tick()}}},{key:"onError",value:function(e){var t=e.frag||this.fragCurrent;if(!t||"main"===t.type){var n=this.media,r=n&&f.default.isBuffered(n,n.currentTime)&&f.default.isBuffered(n,n.currentTime+.5);switch(e.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(!e.fatal){var i=this.fragLoadError;i?i++:i=1;var a=this.config;if(i<=a.fragLoadingMaxRetry||r||t.autoLevel&&t.level){this.fragLoadError=i,t.loadCounter=0;var o=Math.min(Math.pow(2,i-1)*a.fragLoadingRetryDelay,a.fragLoadingMaxRetryTimeout);w.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=k.FRAG_LOADING_WAITING_RETRY}else w.logger.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=k.ERROR}break;case T.ErrorDetails.FRAG_LOOP_LOADING_ERROR:e.fatal||(r?(this._reduceMaxBufferLength(t.duration),this.state=k.IDLE):t.autoLevel&&0!==t.level||(e.fatal=!0,this.state=k.ERROR));break;case T.ErrorDetails.LEVEL_LOAD_ERROR:case T.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==k.ERROR&&(e.fatal?(this.state=k.ERROR,w.logger.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):e.levelRetry||this.state!==k.WAITING_LEVEL||(this.state=k.IDLE));break;case T.ErrorDetails.BUFFER_FULL_ERROR:"main"!==e.parent||this.state!==k.PARSING&&this.state!==k.PARSED||(r?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=k.IDLE):(w.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(e){var t=this.config;t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,w.logger.warn("main:reduce max buffer length to "+t.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*t.fragLoadingLoopThreshold)}},{key:"_checkBuffer",value:function(){var e=this.media;if(e&&e.readyState){var t=e.currentTime,n=this.mediaBuffer?this.mediaBuffer:e,r=n.buffered;if(!this.loadedmetadata&&r.length){this.loadedmetadata=!0;var i=e.seeking?t:this.startPosition,a=f.default.isBuffered(n,i);t===i&&a||(w.logger.log("target start position:"+i),a||(i=r.start(0),w.logger.log("target start position not buffered, seek to buffered.start(0) "+i)),w.logger.log("adjust currentTime from "+t+" to "+i),e.currentTime=i)}else if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var o=f.default.bufferInfo(e,t,0),s=!(e.paused||e.ended||0===e.buffered.length),u=t!==this.lastCurrentTime,l=this.config;if(u)this.stallReported&&(w.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(performance.now()-this.stalled)+"ms"),this.stallReported=!1),this.stalled=void 0,this.nudgeRetry=0;else if(s){var c=performance.now(),d=this.hls;if(this.stalled){var h=c-this.stalled,p=o.len,y=this.nudgeRetry||0;if(p<=.5&&h>1e3*l.lowBufferWatchdogPeriod){this.stallReported||(this.stallReported=!0,w.logger.warn("playback stalling in low buffer @"+t),d.trigger(v.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p}));var g=o.nextStart,m=g-t;if(g&&m<l.maxSeekHole&&m>0){this.nudgeRetry=++y;var b=y*l.nudgeOffset;w.logger.log("adjust currentTime from "+e.currentTime+" to next buffered @ "+g+" + nudge "+b),e.currentTime=g+b,this.stalled=void 0,d.trigger(v.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,hole:g+b-t})}}else if(p>.5&&h>1e3*l.highBufferWatchdogPeriod)if(this.stallReported||(this.stallReported=!0,w.logger.warn("playback stalling in high buffer @"+t),d.trigger(v.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<l.nudgeMaxRetry){var _=e.currentTime,E=_+y*l.nudgeOffset;w.logger.log("adjust currentTime from "+_+" to "+E),e.currentTime=E,d.trigger(v.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else w.logger.error("still stuck in high buffer @"+t+" after "+l.nudgeMaxRetry+", raise fatal error"),d.trigger(v.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})}else this.stalled=c,this.stallReported=!1}}}}},{key:"onFragLoadEmergencyAborted",value:function(){this.state=k.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()}},{key:"onBufferFlushed",value:function(){var e=this.mediaBuffer?this.mediaBuffer:this.media;this._bufferedFrags=this._bufferedFrags.filter(function(t){return f.default.isBuffered(e,(t.startPTS+t.endPTS)/2)}),this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.state=k.IDLE,this.fragPrevious=null}},{key:"swapAudioCodec",value:function(){this.audioCodecSwap=!this.audioCodecSwap}},{key:"computeLivePosition",value:function(e,t){var n=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*t.targetduration;return e+Math.max(0,t.totalduration-n)}},{key:"state",set:function(e){if(this.state!==e){var t=this.state;this._state=e,w.logger.log("main stream:"+t+"->"+e),this.hls.trigger(v.default.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var e=this.media;if(e){var t=this.getBufferedFrag(e.currentTime);if(t)return t.level}return-1}},{key:"nextBufferedFrag",get:function(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e}}]),t}(g.default);n.default=S},{25:25,33:33,34:34,35:35,37:37,38:38,48:48,53:53,54:54}],14:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(53),h=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.ERROR,l.default.SUBTITLE_TRACKS_UPDATED,l.default.SUBTITLE_TRACK_SWITCH,l.default.SUBTITLE_TRACK_LOADED,l.default.SUBTITLE_FRAG_PROCESSED));return n.config=e.config,n.vttFragSNsProcessed={},n.vttFragQueues=void 0,n.currentlyProcessing=null,n.currentTrackId=-1,n}return o(t,e),s(t,[{key:"destroy",value:function(){f.default.prototype.destroy.call(this)}},{key:"clearVttFragQueues",value:function(){var e=this;this.vttFragQueues={},this.tracks.forEach(function(t){e.vttFragQueues[t.id]=[]})}},{key:"nextFrag",value:function(){if(null===this.currentlyProcessing&&this.currentTrackId>-1&&this.vttFragQueues[this.currentTrackId].length){var e=this.currentlyProcessing=this.vttFragQueues[this.currentTrackId].shift();this.hls.trigger(l.default.FRAG_LOADING,{frag:e})}}},{key:"onSubtitleFragProcessed",value:function(e){e.success&&this.vttFragSNsProcessed[e.frag.trackId].push(e.frag.sn),this.currentlyProcessing=null,this.nextFrag()}},{key:"onError",value:function(e){var t=e.frag;t&&"subtitle"!==t.type||this.currentlyProcessing&&(this.currentlyProcessing=null,this.nextFrag())}},{key:"onSubtitleTracksUpdated",value:function(e){var t=this;d.logger.log("subtitle tracks updated"),this.tracks=e.subtitleTracks,this.clearVttFragQueues(),this.vttFragSNsProcessed={},this.tracks.forEach(function(e){t.vttFragSNsProcessed[e.id]=[]})}},{key:"onSubtitleTrackSwitch",value:function(e){this.currentTrackId=e.id,this.clearVttFragQueues()}},{key:"onSubtitleTrackLoaded",value:function(e){var t=this.vttFragSNsProcessed[e.id],n=this.vttFragQueues[e.id],r=this.currentlyProcessing?this.currentlyProcessing.sn:-1,i=function(e){return t.indexOf(e.sn)>-1},a=function(e){return n.some(function(t){return t.sn===e.sn})};e.details.fragments.forEach(function(t){i(t)||t.sn===r||a(t)||(t.trackId=e.id,n.push(t))}),this.nextFrag()}}]),t}(f.default);n.default=h},{34:34,35:35,53:53}],15:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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)}function s(e){for(var t=[],n=0;n<e.length;n++)"subtitles"===e[n].kind&&t.push(e[n]);return t}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=e(35),c=r(l),f=e(34),d=r(f),h=e(53),p=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,c.default.MEDIA_ATTACHED,c.default.MEDIA_DETACHING,c.default.MANIFEST_LOADING,c.default.MANIFEST_LOADED,c.default.SUBTITLE_TRACK_LOADED));return n.tracks=[],n.trackId=-1,n.media=void 0,n}return o(t,e),u(t,[{key:"destroy",value:function(){d.default.prototype.destroy.call(this)}},{key:"onMediaAttached",value:function(e){var t=this;this.media=e.media,this.media&&this.media.textTracks.addEventListener("change",function(){if(t.media){for(var e=-1,n=s(t.media.textTracks),r=0;r<n.length;r++)"showing"===n[r].mode&&(e=r);t.subtitleTrack=e}})}},{key:"onMediaDetaching",value:function(){this.media=void 0}},{key:"onManifestLoading",value:function(){this.tracks=[],this.trackId=-1}},{key:"onManifestLoaded",value:function(e){var t=this,n=e.subtitles||[],r=!1;this.tracks=n,this.trackId=-1,this.hls.trigger(c.default.SUBTITLE_TRACKS_UPDATED,{subtitleTracks:n}),n.forEach(function(e){e.default&&(t.subtitleTrack=e.id,r=!0)})}},{key:"onTick",value:function(){var e=this.trackId,t=this.tracks[e];if(t){var n=t.details;void 0!==n&&!0!==n.live||(h.logger.log("(re)loading playlist for subtitle track "+e),this.hls.trigger(c.default.SUBTITLE_TRACK_LOADING,{url:t.url,id:e}))}}},{key:"onSubtitleTrackLoaded",value:function(e){var t=this;e.id<this.tracks.length&&(h.logger.log("subtitle track "+e.id+" loaded"),this.tracks[e.id].details=e.details,e.details.live&&!this.timer&&(this.timer=setInterval(function(){t.onTick()},1e3*e.details.targetduration,this)),!e.details.live&&this.timer&&(clearInterval(this.timer),this.timer=null))}},{key:"setSubtitleTrackInternal",value:function(e){if(e>=0&&e<this.tracks.length){this.timer&&(clearInterval(this.timer),this.timer=null),this.trackId=e,h.logger.log("switching to subtitle track "+e);var t=this.tracks[e];this.hls.trigger(c.default.SUBTITLE_TRACK_SWITCH,{id:e});var n=t.details;void 0!==n&&!0!==n.live||(h.logger.log("(re)loading playlist for subtitle track "+e),this.hls.trigger(c.default.SUBTITLE_TRACK_LOADING,{url:t.url,id:e}))}}},{key:"subtitleTracks",get:function(){return this.tracks}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.trackId!==e&&this.setSubtitleTrackInternal(e)}}]),t}(d.default);n.default=p},{34:34,35:35,53:53}],16:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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)}function s(e){if(e&&e.cues)for(;e.cues.length>0;)e.removeCue(e.cues[0])}function u(e,t){return e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}function l(e,t,n,r){return Math.min(t,r)-Math.max(e,n)}Object.defineProperty(n,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=e(35),d=r(f),h=e(34),p=r(h),v=e(49),y=r(v),g=e(57),m=r(g),b=e(53),_=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,d.default.MEDIA_ATTACHING,d.default.MEDIA_DETACHING,d.default.FRAG_PARSING_USERDATA,d.default.MANIFEST_LOADING,d.default.MANIFEST_LOADED,d.default.FRAG_LOADED,d.default.LEVEL_SWITCHING,d.default.INIT_PTS_FOUND));if(n.hls=e,n.config=e.config,n.enabled=!0,n.Cues=e.config.cueHandler,n.textTracks=[],n.tracks=[],n.unparsedVttFrags=[],n.initPTS=void 0,n.cueRanges=[],n.config.enableCEA708Captions){var r=n,o=function(e,t){var n=null;try{n=new window.Event("addtrack")}catch(e){n=document.createEvent("Event"),n.initEvent("addtrack",!1,!1)}n.track=e,t.dispatchEvent(n)},u={newCue:function(e,t,n){if(!r.textTrack1){var i=r.getExistingTrack("1");if(i)r.textTrack1=i,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",e,t,n)}},l={newCue:function(e,t,n){if(!r.textTrack2){var i=r.getExistingTrack("2");if(i)r.textTrack2=i,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",e,t,n)}};n.cea608Parser=new y.default(0,u,l)}return n}return o(t,e),c(t,[{key:"addCues",value:function(e,t,n,r){for(var i=this.cueRanges,a=!1,o=i.length;o--;){var s=i[o],u=l(s[0],s[1],t,n);if(u>=0&&(s[0]=Math.min(s[0],t),s[1]=Math.max(s[1],n),a=!0,u/(n-t)>.5))return}a||i.push([t,n]),this.Cues.newCue(this[e],t,n,r)}},{key:"onInitPtsFound",value:function(e){var t=this;void 0===this.initPTS&&(this.initPTS=e.initPTS),this.unparsedVttFrags.length&&(this.unparsedVttFrags.forEach(function(e){t.onFragLoaded(e)}),this.unparsedVttFrags=[])}},{key:"getExistingTrack",value:function(e){var t=this.media;if(t)for(var n=0;n<t.textTracks.length;n++){var r=t.textTracks[n],i="textTrack"+e;if(!0===r[i])return r}return null}},{key:"createTextTrack",value:function(e,t,n){var r=this.media;if(r)return r.addTextTrack(e,t,n)}},{key:"destroy",value:function(){p.default.prototype.destroy.call(this)}},{key:"onMediaAttaching",value:function(e){this.media=e.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 e=this.media;if(e){var t=e.textTracks;if(t)for(var n=0;n<t.length;n++)s(t[n])}}},{key:"onManifestLoaded",value:function(e){var t=this;if(this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=void 0,this.cueRanges=[],this.config.enableWebVTT){this.tracks=e.subtitles||[];var n=this.media?this.media.textTracks:[];this.tracks.forEach(function(e,r){var i=void 0;if(r<n.length){var a=n[r];u(a,e)&&(i=a)}i||(i=t.createTextTrack("subtitles",e.name,e.lang)),i.mode=e.default?"showing":"hidden",t.textTracks.push(i)})}}},{key:"onLevelSwitching",value:function(){this.enabled="NONE"!==this.hls.currentLevel.closedCaptions}},{key:"onFragLoaded",value:function(e){var t=e.frag,n=e.payload;if("main"===t.type){var r=t.sn;if(r!==this.lastSn+1){var i=this.cea608Parser;i&&i.reset()}this.lastSn=r}else if("subtitle"===t.type)if(n.byteLength){if(void 0===this.initPTS)return void this.unparsedVttFrags.push(e);var a=this.vttCCs;a[t.cc]||(a[t.cc]={start:t.start,prevCC:this.prevCC,new:!0},this.prevCC=t.cc);var o=this.textTracks,s=this.hls;m.default.parse(n,this.initPTS,a,t.cc,function(e){var n=o[t.trackId];e.forEach(function(e){n.cues.getCueById(e.id)||n.addCue(e)}),s.trigger(d.default.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(e){b.logger.log("Failed to parse VTT cue: "+e),s.trigger(d.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t})})}else this.hls.trigger(d.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t})}},{key:"onFragParsingUserdata",value:function(e){if(this.enabled&&this.config.enableCEA708Captions)for(var t=0;t<e.samples.length;t++){var n=this.extractCea608Data(e.samples[t].bytes);this.cea608Parser.addData(e.samples[t].pts,n)}}},{key:"extractCea608Data",value:function(e){for(var t,n,r,i,a,o=31&e[0],s=2,u=[],l=0;l<o;l++)t=e[s++],n=127&e[s++],r=127&e[s++],i=0!=(4&t),a=3&t,0===n&&0===r||i&&0===a&&(u.push(n),u.push(r));return u}}]),t}(p.default);n.default=_},{34:34,35:35,49:49,53:53,57:57}],17:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n){r(this,e),this.subtle=t,this.aesIV=n}return i(e,[{key:"decrypt",value:function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}]),e}();n.default=a},{}],18:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e),this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return i(e,[{key:"uint8ArrayToUint32Array_",value:function(e){for(var t=new DataView(e),n=new Uint32Array(4),r=0;r<4;r++)n[r]=t.getUint32(4*r);return n}},{key:"initTable",value:function(){var e=this.sBox,t=this.invSBox,n=this.subMix,r=n[0],i=n[1],a=n[2],o=n[3],s=this.invSubMix,u=s[0],l=s[1],c=s[2],f=s[3],d=new Uint32Array(256),h=0,p=0,v=0;for(v=0;v<256;v++)d[v]=v<128?v<<1:v<<1^283;for(v=0;v<256;v++){var y=p^p<<1^p<<2^p<<3^p<<4;y=y>>>8^255&y^99,e[h]=y,t[y]=h;var g=d[h],m=d[g],b=d[m],_=257*d[y]^16843008*y;r[h]=_<<24|_>>>8,i[h]=_<<16|_>>>16,a[h]=_<<8|_>>>24,o[h]=_,_=16843009*b^65537*m^257*g^16843008*h,u[y]=_<<24|_>>>8,l[y]=_<<16|_>>>16,c[y]=_<<8|_>>>24,f[y]=_,h?(h=g^d[d[d[b^g]]],p^=d[d[p]]):h=p=1}}},{key:"expandKey",value:function(e){for(var t=this.uint8ArrayToUint32Array_(e),n=!0,r=0;r<t.length&&n;)n=t[r]===this.key[r],r++;if(!n){this.key=t;var i=this.keySize=t.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);var a=this.ksRows=4*(i+6+1),o=void 0,s=void 0,u=this.keySchedule=new Uint32Array(a),l=this.invKeySchedule=new Uint32Array(a),c=this.sBox,f=this.rcon,d=this.invSubMix,h=d[0],p=d[1],v=d[2],y=d[3],g=void 0,m=void 0;for(o=0;o<a;o++)o<i?g=u[o]=t[o]:(m=g,o%i==0?(m=m<<8|m>>>24,m=c[m>>>24]<<24|c[m>>>16&255]<<16|c[m>>>8&255]<<8|c[255&m],m^=f[o/i|0]<<24):i>6&&o%i==4&&(m=c[m>>>24]<<24|c[m>>>16&255]<<16|c[m>>>8&255]<<8|c[255&m]),u[o]=g=(u[o-i]^m)>>>0);for(s=0;s<a;s++)o=a-s,m=3&s?u[o]:u[o-4],l[s]=s<4||o<=4?m:h[c[m>>>24]]^p[c[m>>>16&255]]^v[c[m>>>8&255]]^y[c[255&m]],l[s]=l[s]>>>0}}},{key:"networkToHostOrderSwap",value:function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}},{key:"decrypt",value:function(e,t,n){for(var r,i,a=this.keySize+6,o=this.invKeySchedule,s=this.invSBox,u=this.invSubMix,l=u[0],c=u[1],f=u[2],d=u[3],h=this.uint8ArrayToUint32Array_(n),p=h[0],v=h[1],y=h[2],g=h[3],m=new Int32Array(e),b=new Int32Array(m.length),_=void 0,E=void 0,T=void 0,w=void 0,k=void 0,S=void 0,O=void 0,A=void 0,P=void 0,R=void 0,D=void 0,L=void 0,x=this.networkToHostOrderSwap;t<m.length;){for(P=x(m[t]),R=x(m[t+1]),D=x(m[t+2]),L=x(m[t+3]),k=P^o[0],S=L^o[1],O=D^o[2],A=R^o[3],r=4,i=1;i<a;i++)_=l[k>>>24]^c[S>>16&255]^f[O>>8&255]^d[255&A]^o[r],E=l[S>>>24]^c[O>>16&255]^f[A>>8&255]^d[255&k]^o[r+1],T=l[O>>>24]^c[A>>16&255]^f[k>>8&255]^d[255&S]^o[r+2],w=l[A>>>24]^c[k>>16&255]^f[S>>8&255]^d[255&O]^o[r+3],k=_,S=E,O=T,A=w,r+=4;_=s[k>>>24]<<24^s[S>>16&255]<<16^s[O>>8&255]<<8^s[255&A]^o[r],E=s[S>>>24]<<24^s[O>>16&255]<<16^s[A>>8&255]<<8^s[255&k]^o[r+1],T=s[O>>>24]<<24^s[A>>16&255]<<16^s[k>>8&255]<<8^s[255&S]^o[r+2],w=s[A>>>24]<<24^s[k>>16&255]<<16^s[S>>8&255]<<8^s[255&O]^o[r+3],r+=3,b[t]=x(_^p),b[t+1]=x(w^v),b[t+2]=x(T^y),b[t+3]=x(E^g),p=P,v=R,y=D,g=L,t+=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}}]),e}();n.default=a},{}],19:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(17),s=r(o),u=e(20),l=r(u),c=e(18),f=r(c),d=e(33),h=e(53),p=function(){function e(t,n){i(this,e),this.observer=t,this.config=n,this.logEnabled=!0;try{var r=crypto||self.crypto;this.subtle=r.subtle||r.webkitSubtle}catch(e){}this.disableWebCrypto=!this.subtle}return a(e,[{key:"isSync",value:function(){return this.disableWebCrypto&&this.config.enableSoftwareAES}},{key:"decrypt",value:function(e,t,n,r){var i=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 f.default),a.expandKey(t),r(a.decrypt(e,0,n))}else{this.logEnabled&&(h.logger.log("WebCrypto AES decrypt"),this.logEnabled=!1);var o=this.subtle;this.key!==t&&(this.key=t,this.fastAesKey=new l.default(o,t)),this.fastAesKey.expandKey().then(function(a){new s.default(o,n).decrypt(e,a).catch(function(a){i.onWebCryptoError(a,e,t,n,r)}).then(function(e){r(e)})}).catch(function(a){i.onWebCryptoError(a,e,t,n,r)})}}},{key:"onWebCryptoError",value:function(e,t,n,r,i){this.config.enableSoftwareAES?(h.logger.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(t,n,r,i)):(h.logger.error("decrypting error : "+e.message),this.observer.trigger(Event.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_DECRYPT_ERROR,fatal:!0,reason:e.message}))}},{key:"destroy",value:function(){var e=this.decryptor;e&&(e.destroy(),this.decryptor=void 0)}}]),e}();n.default=p},{17:17,18:18,20:20,33:33,53:53}],20:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n){r(this,e),this.subtle=t,this.key=n}return i(e,[{key:"expandKey",value:function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}]),e}();n.default=a},{}],21:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(22),s=r(o),u=e(53),l=e(27),c=r(l),f=function(){function e(t,n,r){i(this,e),this.observer=t,this.config=r,this.remuxer=n}return a(e,[{key:"resetInitSegment",value:function(e,t,n,r){this._audioTrack={container:"audio/adts",type:"audio",id:-1,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:t,duration:r,inputTimeScale:9e4}}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(e,t,n,r){var i,a,o,l,f,d,h,p,v,y,g=new c.default(e),m=90*g.timeStamp;for(i=this._audioTrack,d=g.length,v=e.length;d<v-1&&(255!==e[d]||240!=(246&e[d+1]));d++);for(i.samplerate||(a=s.default.getAudioConfig(this.observer,e,d,i.manifestCodec),i.config=a.config,i.samplerate=a.samplerate,i.channelCount=a.channelCount,i.codec=a.codec,u.logger.log("parsed codec:"+i.codec+",rate:"+a.samplerate+",nb channel:"+a.channelCount)),f=0,l=9216e4/i.samplerate;d+5<v&&(h=1&e[d+1]?7:9,o=(3&e[d+3])<<11|e[d+4]<<3|(224&e[d+5])>>>5,(o-=h)>0&&d+h+o<=v);)for(p=m+f*l,y={unit:e.subarray(d+h,d+h+o),pts:p,dts:p},i.samples.push(y),i.len+=o,d+=o+h,f++;d<v-1&&(255!==e[d]||240!=(246&e[d+1]));d++);this.remuxer.remux(i,{samples:[]},{samples:[{pts:m,dts:m,data:g.payload}],inputTimeScale:9e4},{samples:[]},t,n,r)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(e){var t,n,r=new c.default(e);if(r.hasTimeStamp)for(t=r.length,n=Math.min(e.length-1,t+100);t<n;t++)if(255===e[t]&&240==(246&e[t+1]))return!0;return!1}}]),e}();n.default=f},{22:22,27:27,53:53}],22:[function(e,t,n){"use strict";var r=e(53),i=e(33),a={getAudioConfig:function(e,t,n,a){var o,s,u,l,c,f=navigator.userAgent.toLowerCase(),d=a,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];return o=1+((192&t[n+2])>>>6),(s=(60&t[n+2])>>>2)>h.length-1?void e.trigger(Event.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+s}):(l=(1&t[n+2])<<2,l|=(192&t[n+3])>>>6,r.logger.log("manifest codec:"+a+",ADTS data:type:"+o+",sampleingIndex:"+s+"["+h[s]+"Hz],channelConfig:"+l),/firefox/i.test(f)?s>=6?(o=5,c=new Array(4),u=s-3):(o=2,c=new Array(2),u=s):-1!==f.indexOf("android")?(o=2,c=new Array(2),u=s):(o=5,c=new Array(4),a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&s>=6?u=s-3:((a&&-1!==a.indexOf("mp4a.40.2")&&s>=6&&1===l||!a&&1===l)&&(o=2,c=new Array(2)),u=s)),c[0]=o<<3,c[0]|=(14&s)>>1,c[1]|=(1&s)<<7,c[1]|=l<<3,5===o&&(c[1]|=(14&u)>>1,c[2]=(1&u)<<7,c[2]|=8,c[3]=0),{config:c,samplerate:h[s],channelCount:l,codec:"mp4a.40."+o,manifestCodec:d})}};t.exports=a},{33:33,53:53}],23:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(35),s=r(o),u=e(33),l=e(19),c=r(l),f=e(21),d=r(f),h=e(29),p=r(h),v=e(32),y=r(v),g=e(28),m=r(g),b=e(45),_=r(b),E=e(46),T=r(E),w=function(){function e(t,n,r,a){i(this,e),this.observer=t,this.typeSupported=n,this.config=r,this.vendor=a}return a(e,[{key:"destroy",value:function(){var e=this.demuxer;e&&e.destroy()}},{key:"push",value:function(e,t,n,r,i,a,o,u,l,f,d,h){if(e.byteLength>0&&null!=t&&null!=t.key&&"AES-128"===t.method){var p=this.decrypter;null==p&&(p=this.decrypter=new c.default(this.observer,this.config));var v,y=this;try{v=performance.now()}catch(e){v=Date.now()}p.decrypt(e,t.key.buffer,t.iv.buffer,function(e){var c;try{c=performance.now()}catch(e){c=Date.now()}y.observer.trigger(s.default.FRAG_DECRYPTED,{stats:{tstart:v,tdecrypt:c}}),y.pushDecrypted(new Uint8Array(e),t,new Uint8Array(n),r,i,a,o,u,l,f,d,h)})}else this.pushDecrypted(new Uint8Array(e),t,new Uint8Array(n),r,i,a,o,u,l,f,d,h)}},{key:"pushDecrypted",value:function(e,t,n,r,i,a,o,l,c,f,h,v){var g=this.demuxer;if(!g||o&&!this.probe(e)){var b=this.observer,E=this.typeSupported,w=this.config,k=[{demux:y.default,remux:_.default},{demux:m.default,remux:_.default},{demux:d.default,remux:_.default},{demux:p.default,remux:T.default}];for(var S in k){var O=k[S],A=O.demux.probe;if(A(e)){var P=this.remuxer=new O.remux(b,w,E,this.vendor);g=new O.demux(b,P,w,E),this.probe=A;break}}if(!g)return void b.trigger(s.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=g}var R=this.remuxer;(o||l)&&(g.resetInitSegment(n,r,i,f),R.resetInitSegment()),o&&(g.resetTimeStamp(),R.resetTimeStamp(v)),"function"==typeof g.setDecryptData&&g.setDecryptData(t),g.append(e,a,c,h)}}]),e}();n.default=w},{19:19,21:21,28:28,29:29,32:32,33:33,35:35,45:45,46:46}],24:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e(23),a=r(i),o=e(35),s=r(o),u=e(53),l=e(1),c=r(l),f=function(e){var t=new c.default;t.trigger=function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.emit.apply(t,[e,e].concat(r))},t.off=function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.removeListener.apply(t,[e].concat(r))};var n=function(t,n){e.postMessage({event:t,data:n})};e.addEventListener("message",function(r){var i=r.data;switch(i.cmd){case"init":var o=JSON.parse(i.config);e.demuxer=new a.default(t,i.typeSupported,o,i.vendor);try{(0,u.enableLogs)(!0===o.debug)}catch(e){console.warn("demuxerWorker: unable to enable logs")}n("init",null);break;case"demux":e.demuxer.push(i.data,i.decryptdata,i.initSegment,i.audioCodec,i.videoCodec,i.timeOffset,i.discontinuity,i.trackSwitch,i.contiguous,i.duration,i.accurateTimeOffset,i.defaultInitPTS)}}),t.on(s.default.FRAG_DECRYPTED,n),t.on(s.default.FRAG_PARSING_INIT_SEGMENT,n),t.on(s.default.FRAG_PARSED,n),t.on(s.default.ERROR,n),t.on(s.default.FRAG_PARSING_METADATA,n),t.on(s.default.FRAG_PARSING_USERDATA,n),t.on(s.default.INIT_PTS_FOUND,n),t.on(s.default.FRAG_PARSING_DATA,function(t,n){var r=[],i={event:t,data:n};n.data1&&(i.data1=n.data1.buffer,r.push(n.data1.buffer),delete n.data1),n.data2&&(i.data2=n.data2.buffer,r.push(n.data2.buffer),delete n.data2),e.postMessage(i,r)})};n.default=f},{1:1,23:23,35:35,53:53}],25:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(35),s=r(o),u=e(23),l=r(u),c=e(24),f=r(c),d=e(53),h=e(33),p=e(1),v=r(p),y=function(){function t(n,r){i(this,t),this.hls=n,this.id=r;var a=this.observer=new v.default,o=n.config;a.trigger=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];a.emit.apply(a,[e,e].concat(n))},a.off=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];a.removeListener.apply(a,[e].concat(n))};var u=function(e,t){t=t||{},t.frag=this.frag,t.id=this.id,n.trigger(e,t)}.bind(this);a.on(s.default.FRAG_DECRYPTED,u),a.on(s.default.FRAG_PARSING_INIT_SEGMENT,u),a.on(s.default.FRAG_PARSING_DATA,u),a.on(s.default.FRAG_PARSED,u),a.on(s.default.ERROR,u),a.on(s.default.FRAG_PARSING_METADATA,u),a.on(s.default.FRAG_PARSING_USERDATA,u),a.on(s.default.INIT_PTS_FOUND,u);var c={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){d.logger.log("demuxing in webworker");var y=void 0;try{var g=e(3);y=this.w=g(f.default),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(e){n.trigger(s.default.ERROR,{type:h.ErrorTypes.OTHER_ERROR,details:h.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:e.message+" ("+e.filename+":"+e.lineno+")"}})},y.postMessage({cmd:"init",typeSupported:c,vendor:p,id:r,config:JSON.stringify(o)})}catch(e){d.logger.error("error while initializing DemuxerWorker, fallback on DemuxerInline"),y&&URL.revokeObjectURL(y.objectURL),this.demuxer=new l.default(a,c,o,p),this.w=void 0}}else this.demuxer=new l.default(a,c,o,p)}return a(t,[{key:"destroy",value:function(){var e=this.w;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.w=null;else{var t=this.demuxer;t&&(t.destroy(),this.demuxer=null)}var n=this.observer;n&&(n.removeAllListeners(),this.observer=null)}},{key:"push",value:function(e,t,n,r,i,a,o,s){var u=this.w,l=isNaN(i.startDTS)?i.start:i.startDTS,c=i.decryptdata,f=this.frag,h=!(f&&i.cc===f.cc),p=!(f&&i.level===f.level),v=f&&i.sn===f.sn+1,y=!p&&v;if(h&&d.logger.log(this.id+":discontinuity detected"),p&&d.logger.log(this.id+":switch detected"),this.frag=i,u)u.postMessage({cmd:"demux",data:e,decryptdata:c,initSegment:t,audioCodec:n,videoCodec:r,timeOffset:l,discontinuity:h,trackSwitch:p,contiguous:y,duration:a,accurateTimeOffset:o,defaultInitPTS:s},[e]);else{var g=this.demuxer;g&&g.push(e,c,t,n,r,l,h,p,y,a,o,s)}}},{key:"onWorkerMessage",value:function(e){var t=e.data,n=this.hls;switch(t.event){case"init":URL.revokeObjectURL(this.w.objectURL);break;case s.default.FRAG_PARSING_DATA:t.data.data1=new Uint8Array(t.data1),t.data2&&(t.data.data2=new Uint8Array(t.data2));default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,n.trigger(t.event,t.data)}}}]),t}();n.default=y},{1:1,23:23,24:24,3:3,33:33,35:35,53:53}],26:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e(53),o=function(){function e(t){r(this,e),this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}return i(e,[{key:"loadWord",value:function(){var e=this.data,t=this.bytesAvailable,n=e.byteLength-t,r=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw new Error("no bytes available");r.set(e.subarray(n,n+i)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i}},{key:"skipBits",value:function(e){var t;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}},{key:"readBits",value:function(e){var t=Math.min(this.bitsAvailable,e),n=this.word>>>32-t;return e>32&&a.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}},{key:"skipLZ",value:function(){var e;for(e=0;e<this.bitsAvailable;++e)if(0!=(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+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 e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>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(e){var t,n,r=8,i=8;for(t=0;t<e;t++)0!==i&&(n=this.readEG(),i=(r+n+256)%256),r=0===i?r:i}},{key:"readSPS",value:function(){var e,t,n,r,i,a,o,s=0,u=0,l=0,c=0,f=this.readUByte.bind(this),d=this.readBits.bind(this),h=this.readUEG.bind(this),p=this.readBoolean.bind(this),v=this.skipBits.bind(this),y=this.skipEG.bind(this),g=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);if(f(),e=f(),d(5),v(3),f(),g(),100===e||110===e||122===e||244===e||44===e||83===e||86===e||118===e||128===e){var b=h();if(3===b&&v(1),g(),g(),v(1),p())for(a=3!==b?8:12,o=0;o<a;o++)p()&&m(o<6?16:64)}g();var _=h();if(0===_)h();else if(1===_)for(v(1),y(),y(),t=h(),o=0;o<t;o++)y();g(),v(1),n=h(),r=h(),i=d(1),0===i&&v(1),v(1),p()&&(s=h(),u=h(),l=h(),c=h());var E=[1,1];if(p()&&p()){switch(f()){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=[f()<<8|f(),f()<<8|f()]}}return{width:Math.ceil(16*(n+1)-2*s-2*u),height:(2-i)*(r+1)*16-(i?2:4)*(l+c),pixelRatio:E}}},{key:"readSliceType",value:function(){return this.readUByte(),this.readUEG(),this.readUEG()}}]),e}();n.default=o},{53:53}],27:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e(53),o=function(){function e(t){r(this,e),this._hasTimeStamp=!1,this._length=0;for(var n,i,o,s,u,l,c,f,d=0;;)if(c=this.readUTF(t,d,3),d+=3,"ID3"===c)d+=3,n=127&t[d++],i=127&t[d++],o=127&t[d++],s=127&t[d++],u=(n<<21)+(i<<14)+(o<<7)+s,l=d+u,this._parseID3Frames(t,d,l),d=l;else{if("3DI"!==c)return d-=3,void((f=d)&&(this.hasTimeStamp||a.logger.warn("ID3 tag found, but no timestamp"),this._length=f,this._payload=t.subarray(0,f)));d+=7,a.logger.log("3DI footer found, end: "+d)}}return i(e,[{key:"readUTF",value:function(e,t,n){var r="",i=t,a=t+n;do{r+=String.fromCharCode(e[i++])}while(i<a);return r}},{key:"_parseID3Frames",value:function(e,t,n){for(var r,i;t+8<=n;)switch(r=this.readUTF(e,t,4),t+=4,e[t++]<<24+e[t++]<<16+e[t++]<<8+e[t++],e[t++]<<8+e[t++],t,r){case"PRIV":if("com.apple.streaming.transportStreamTimestamp"===this.readUTF(e,t,44)){t+=44,t+=4;var o=1&e[t++];this._hasTimeStamp=!0,i=((e[t++]<<23)+(e[t++]<<15)+(e[t++]<<7)+e[t++])/45,o&&(i+=47721858.84),i=Math.round(i),a.logger.trace("ID3 timestamp found: "+i),this._timeStamp=i}}}},{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}}]),e}();n.default=o},{53:53}],28:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(27),s=r(o),u=e(30),l=r(u),c=function(){function e(t,n,r){i(this,e),this.observer=t,this.config=r,this.remuxer=n}return a(e,[{key:"resetInitSegment",value:function(e,t,n,r){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:t,duration:r,inputTimeScale:9e4}}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(e,t,n,r){var i,a,o=new s.default(e),u=90*o.timeStamp,c=o.length;for(i=c,a=e.length;i<a-1&&(255!==e[i]||224!=(224&e[i+1])||0==(6&e[i+1]));i++);l.default.parse(this._audioTrack,e,o.length,u),this.remuxer.remux(this._audioTrack,{samples:[]},{samples:[{pts:u,dts:u,data:o.payload}],inputTimeScale:9e4},{samples:[]},t,n,r)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(e){var t,n,r=new s.default(e);if(r.hasTimeStamp)for(t=r.length,n=Math.min(e.length-1,t+100);t<n;t++)if(255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1]))return!0;return!1}}]),e}();n.default=c},{27:27,30:30}],29:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e(35),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(){function e(t,n){r(this,e),this.observer=t,this.remuxer=n}return i(e,[{key:"resetTimeStamp",value:function(){}},{key:"resetInitSegment",value:function(t,n,r,i){var a=this.initData=e.parseInitSegment(t),s={};a.audio&&(s.audio={container:"audio/mp4",codec:n,initSegment:t}),a.video&&(s.video={container:"video/mp4",codec:r,initSegment:t}),this.observer.trigger(o.default.FRAG_PARSING_INIT_SEGMENT,{tracks:s})}},{key:"append",value:function(t,n,r,i){var a=this.initData,o=e.startDTS(a,t);this.remuxer.remux(a.audio,a.video,null,null,o,r,i,t)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(t){if(t.length>=8){return["moof","ftyp","styp"].indexOf(e.bin2str(t.subarray(4,8)))>=0}return!1}},{key:"bin2str",value:function(e){return String.fromCharCode.apply(null,e)}},{key:"readUint32",value:function(e,t){var n=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return n<0?4294967296+n:n}},{key:"findBox",value:function(t,n){var r,i,a,o,s,u=[];if(!n.length)return null;for(r=0;r<t.byteLength;)i=e.readUint32(t,r),a=e.bin2str(t.subarray(r+4,r+8)),o=i>1?r+i:t.byteLength,a===n[0]&&(1===n.length?u.push(t.subarray(r+8,o)):(s=e.findBox(t.subarray(r+8,o),n.slice(1)),s.length&&(u=u.concat(s)))),r=o;return u}},{key:"parseInitSegment",value:function(t){var n=[];return e.findBox(t,["moov","trak"]).forEach(function(t){var r=e.findBox(t,["tkhd"])[0];if(r){var i=r[0],a=0===i?12:20,o=e.readUint32(r,a),s=e.findBox(t,["mdia","mdhd"])[0];if(s){i=s[0],a=0===i?12:20;var u=e.readUint32(s,a),l=e.findBox(t,["mdia","hdlr"])[0];if(l){var c=e.bin2str(l.subarray(8,12)),f={soun:"audio",vide:"video"}[c];f&&(n[o]={timescale:u,type:f},n[f]={timescale:u,id:o})}}}}),n}},{key:"startDTS",value:function(t,n){var r,i,a;return r=e.findBox(n,["moof","traf"]),i=[].concat.apply([],r.map(function(n){return e.findBox(n,["tfhd"]).map(function(r){var i,a,o;return i=e.readUint32(r,4),a=t[i].timescale||9e4,o=e.findBox(n,["tfdt"]).map(function(t){var n,r;return n=t[0],r=e.readUint32(t,4),1===n&&(r*=Math.pow(2,32),r+=e.readUint32(t,8)),r})[0],(o=o||1/0)/a})})),a=Math.min.apply(null,i),isFinite(a)?a:0}}]),e}();n.default=s},{35:35}],30:[function(e,t,n){"use strict";var r=e(53),i={onFrame:function(e,t,n,r,i,a,o){var s=10368e4/r,u=o+a*s;e.config=[],e.channelCount=i,e.samplerate=r,e.samples.push({unit:t,pts:u,dts:u}),e.len+=t.length},onNoise:function(e){r.logger.warn("mpeg audio has noise: "+e.length+" bytes")},parseFrames:function(e,t,n,r,i,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(n+2>r)return-1;if(255===t[n]||224==(224&t[n+1])){if(n+24>r)return-1;var u=t[n+1]>>3&3,l=t[n+1]>>1&3,c=t[n+2]>>4&15,f=t[n+2]>>2&3,d=!!(2&t[n+2]);if(1!==u&&0!==c&&15!==c&&3!==f){var h=3===u?3-l:3===l?3:4,p=1e3*o[14*h+c-1],v=3===u?0:2===u?1:2,y=s[3*v+f],g=d?1:0,m=t[n+3]>>6==3?1:2,b=3===l?(3===u?12:6)*p/y+g<<2:(3===u?144:72)*p/y+g|0;return n+b>r?-1:(this.onFrame(e,t.subarray(n,n+b),p,y,m,i,a),b)}}for(var _=n+2;_<r;){if(255===t[_-1]&&224==(224&t[_]))return this.onNoise(t.subarray(n,_-1)),_-n-1;_++}return-1},parse:function(e,t,n,r){for(var i,a=t.length,o=0;n<a&&(i=this.parseFrames(e,t,n,a,o++,r))>0;)n+=i}};t.exports=i},{53:53}],31:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e(19),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(){function e(t,n,i,a){r(this,e),this.decryptdata=i,this.discardEPB=a,this.decrypter=new o.default(t,n)}return i(e,[{key:"decryptBuffer",value:function(e,t){this.decrypter.decrypt(e,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,t)}},{key:"decryptAacSample",value:function(e,t,n,r){var i=e[t].unit,a=i.subarray(16,i.length-i.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),s=this;this.decryptBuffer(o,function(a){a=new Uint8Array(a),i.set(a,16),r||s.decryptAacSamples(e,t+1,n)})}},{key:"decryptAacSamples",value:function(e,t,n){for(;;t++){if(t>=e.length)return void n();if(!(e[t].unit.length<32)){var r=this.decrypter.isSync();if(this.decryptAacSample(e,t,n,r),!r)return}}}},{key:"getAvcEncryptedData",value:function(e){for(var t=16*Math.floor((e.length-48)/160)+16,n=new Int8Array(t),r=0,i=32;i<=e.length-16;i+=160,r+=16)n.set(e.subarray(i,i+16),r);return n}},{key:"getAvcDecryptedUnit",value:function(e,t){t=new Uint8Array(t);for(var n=0,r=32;r<=e.length-16;r+=160,n+=16)e.set(t.subarray(n,n+16),r);return e}},{key:"decryptAvcSample",value:function(e,t,n,r,i,a){var o=this.discardEPB(i.data),s=this.getAvcEncryptedData(o),u=this;this.decryptBuffer(s.buffer,function(s){i.data=u.getAvcDecryptedUnit(o,s),a||u.decryptAvcSamples(e,t,n+1,r)})}},{key:"decryptAvcSamples",value:function(e,t,n,r){for(;;t++,n=0){if(t>=e.length)return void r();for(var i=e[t].units;!(n>=i.length);n++){var a=i[n];if(!(a.length<=48||1!==a.type&&5!==a.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(e,t,n,r,a,o),!o)return}}}}}]),e}();n.default=s},{19:19}],32:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(22),s=r(o),u=e(30),l=r(u),c=e(35),f=r(c),d=e(26),h=r(d),p=e(31),v=r(p),y=e(53),g=e(33),m=function(){function e(t,n,r,a){i(this,e),this.observer=t,this.config=r,this.typeSupported=a,this.remuxer=n,this.sampleAes=null}return a(e,[{key:"setDecryptData",value:function(e){null!=e&&null!=e.key&&"SAMPLE-AES"===e.method?this.sampleAes=new v.default(this.observer,this.config,e,this.discardEPB):this.sampleAes=null}},{key:"resetInitSegment",value:function(e,t,n,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=t,this.videoCodec=n,this._duration=r}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(e,t,n,r){var i,a,o,s,u,l=e.length,c=!1;this.contiguous=n;var d=this.pmtParsed,h=this._avcTrack,p=this._audioTrack,v=this._id3Track,m=h.id,b=p.id,_=v.id,E=this._pmtId,T=h.pesData,w=p.pesData,k=v.pesData,S=this._parsePAT,O=this._parsePMT,A=this._parsePES,P=this._parseAVCPES.bind(this),R=this._parseAACPES.bind(this),D=this._parseMPEGPES.bind(this),L=this._parseID3PES.bind(this);for(l-=l%188,i=0;i<l;i+=188)if(71===e[i]){if(a=!!(64&e[i+1]),o=((31&e[i+1])<<8)+e[i+2],(48&e[i+3])>>4>1){if((s=i+5+e[i+4])===i+188)continue}else s=i+4;switch(o){case m:a&&(T&&(u=A(T))&&P(u,!1),T={data:[],size:0}),T&&(T.data.push(e.subarray(s,i+188)),T.size+=i+188-s);break;case b:a&&(w&&(u=A(w))&&(p.isAAC?R(u):D(u)),w={data:[],size:0}),w&&(w.data.push(e.subarray(s,i+188)),w.size+=i+188-s);break;case _:a&&(k&&(u=A(k))&&L(u),k={data:[],size:0}),k&&(k.data.push(e.subarray(s,i+188)),k.size+=i+188-s);break;case 0:a&&(s+=e[s]+1),E=this._pmtId=S(e,s);break;case E:a&&(s+=e[s]+1);var x=O(e,s,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);m=x.avc,m>0&&(h.id=m),b=x.audio,b>0&&(p.id=b,p.isAAC=x.isAAC),_=x.id3,_>0&&(v.id=_),c&&!d&&(y.logger.log("reparse from beginning"),c=!1,i=-188),d=this.pmtParsed=!0;break;case 17:case 8191:break;default:c=!0}}else this.observer.trigger(f.default.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T&&(u=A(T))?(P(u,!0),h.pesData=null):h.pesData=T,w&&(u=A(w))?(p.isAAC?R(u):D(u),p.pesData=null):(w&&w.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=w),k&&(u=A(k))?(L(u),v.pesData=null):v.pesData=k,null==this.sampleAes?this.remuxer.remux(p,h,v,this._txtTrack,t,n,r):this.decryptAndRemux(p,h,v,this._txtTrack,t,n,r)}},{key:"decryptAndRemux",value:function(e,t,n,r,i,a,o){if(e.samples&&e.isAAC){var s=this;this.sampleAes.decryptAacSamples(e.samples,0,function(){s.decryptAndRemuxAvc(e,t,n,r,i,a,o)})}else this.decryptAndRemuxAvc(e,t,n,r,i,a,o)}},{key:"decryptAndRemuxAvc",value:function(e,t,n,r,i,a,o){if(t.samples){var s=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,function(){s.remuxer.remux(e,t,n,r,i,a,o)})}else this.remuxer.remux(e,t,n,r,i,a,o)}},{key:"destroy",value:function(){this._initPTS=this._initDTS=void 0,this._duration=0}},{key:"_parsePAT",value:function(e,t){return(31&e[t+10])<<8|e[t+11]}},{key:"_parsePMT",value:function(e,t,n,r){var i,a,o,s,u={audio:-1,avc:-1,id3:-1,isAAC:!0};for(i=(15&e[t+1])<<8|e[t+2],a=t+3+i-4,o=(15&e[t+10])<<8|e[t+11],t+=12+o;t<a;){switch(s=(31&e[t+1])<<8|e[t+2],e[t]){case 207:if(!r){y.logger.log("unkown stream type:"+e[t]);break}case 15:-1===u.audio&&(u.audio=s);break;case 21:-1===u.id3&&(u.id3=s);break;case 219:if(!r){y.logger.log("unkown stream type:"+e[t]);break}case 27:-1===u.avc&&(u.avc=s);break;case 3:case 4:n?-1===u.audio&&(u.audio=s,u.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:"+e[t])}t+=5+((15&e[t+3])<<8|e[t+4])}return u}},{key:"_parsePES",value:function(e){var t,n,r,i,a,o,s,u,l=0,c=e.data;if(!e||0===e.size)return null;for(;c[0].length<19&&c.length>1;){var f=new Uint8Array(c[0].length+c[1].length);f.set(c[0]),f.set(c[1],c[0].length),c[0]=f,c.splice(1,1)}if(t=c[0],1===(t[0]<<16)+(t[1]<<8)+t[2]){if((r=(t[4]<<8)+t[5])&&r>e.size-6)return null;n=t[7],192&n&&(o=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,o>4294967295&&(o-=8589934592),64&n?(s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[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),i=t[8],u=i+9,e.size-=u,a=new Uint8Array(e.size);for(var d=0,h=c.length;d<h;d++){t=c[d];var p=t.byteLength;if(u){if(u>p){u-=p;continue}t=t.subarray(u),p-=u,u=0}a.set(t,l),l+=p}return r&&(r-=i+3),{data:a,pts:o,dts:s,len:r}}return null}},{key:"pushAccesUnit",value:function(e,t){if(e.units.length&&e.frame){var n=t.samples,r=n.length;!this.config.forceKeyFrameOnDiscontinuity||!0===e.key||t.sps&&(r||this.contiguous)?(e.id=r,n.push(e)):t.dropped++}e.debug.length&&y.logger.log(e.pts+"/"+e.dts+":"+e.debug)}},{key:"_parseAVCPES",value:function(e,t){var n,r,i,a=this,o=this._avcTrack,s=this._parseAVCNALu(e.data),u=this.avcSample;e.data=null,s.forEach(function(t){switch(t.type){case 1:r=!0,u.frame=!0;var s=t.data;if(s.length>4){var l=new h.default(s).readSliceType();2!==l&&4!==l&&7!==l&&9!==l||(u.key=!0)}break;case 5:r=!0,u||(u=a.avcSample=a._createAVCSample(!0,e.pts,e.dts,"")),u.key=!0,u.frame=!0;break;case 6:r=!0,n=new h.default(a.discardEPB(t.data)),n.readUByte();for(var c=0,f=0,d=!1,p=0;!d&&n.bytesAvailable>1;){c=0;do{p=n.readUByte(),c+=p}while(255===p);f=0;do{p=n.readUByte(),f+=p}while(255===p);if(4===c&&0!==n.bytesAvailable){d=!0;if(181===n.readUByte()){if(49===n.readUShort()){if(1195456820===n.readUInt()){if(3===n.readUByte()){var v=n.readUByte(),y=n.readUByte(),g=31&v,m=[v,y];for(i=0;i<g;i++)m.push(n.readUByte()),m.push(n.readUByte()),m.push(n.readUByte());a._insertSampleInOrder(a._txtTrack.samples,{type:3,pts:e.pts,bytes:m})}}}}}else if(f<n.bytesAvailable)for(i=0;i<f;i++)n.readUByte()}break;case 7:if(r=!0,!o.sps){n=new h.default(t.data);var b=n.readSPS();o.width=b.width,o.height=b.height,o.pixelRatio=b.pixelRatio,o.sps=[t.data],o.duration=a._duration;var _=t.data.subarray(1,4),E="avc1.";for(i=0;i<3;i++){var T=_[i].toString(16);T.length<2&&(T="0"+T),E+=T}o.codec=E}break;case 8:r=!0,o.pps||(o.pps=[t.data]);break;case 9:r=!1,u&&a.pushAccesUnit(u,o),u=a.avcSample=a._createAVCSample(!1,e.pts,e.dts,"");break;case 12:r=!1;break;default:r=!1,u&&(u.debug+="unknown NAL "+t.type+" ")}if(u&&r){u.units.push(t)}}),t&&u&&(this.pushAccesUnit(u,o),this.avcSample=null)}},{key:"_createAVCSample",value:function(e,t,n,r){return{key:e,pts:t,dts:n,units:[],debug:r}}},{key:"_insertSampleInOrder",value:function(e,t){var n=e.length;if(n>0){if(t.pts>=e[n-1].pts)e.push(t);else for(var r=n-1;r>=0;r--)if(t.pts<e[r].pts){e.splice(r,0,t);break}}else e.push(t)}},{key:"_getLastNalUnit",value:function(){var e=this.avcSample,t=void 0;if(!e||0===e.units.length){var n=this._avcTrack,r=n.samples;e=r[r.length-1]}if(e){var i=e.units;t=i[i.length-1]}return t}},{key:"_parseAVCNALu",value:function(e){var t,n,r,i,a,o=0,s=e.byteLength,u=this._avcTrack,l=u.naluState||0,c=l,f=[],d=-1;for(-1===l&&(d=0,a=31&e[0],l=0,o=1);o<s;)if(t=e[o++],l)if(1!==l)if(t)if(1===t){if(d>=0)r={data:e.subarray(d,o-l-1),type:a},f.push(r);else{var h=this._getLastNalUnit();if(h&&(c&&o<=4-c&&h.state&&(h.data=h.data.subarray(0,h.data.byteLength-c)),(n=o-l-1)>0)){var p=new Uint8Array(h.data.byteLength+n);p.set(h.data,0),p.set(e.subarray(0,n),h.data.byteLength),h.data=p}}o<s?(i=31&e[o],d=o,a=i,l=0):l=-1}else l=0;else l=3;else l=t?0:2;else l=t?0:1;if(d>=0&&l>=0&&(r={data:e.subarray(d,s),type:a,state:l},f.push(r)),0===f.length){var v=this._getLastNalUnit();if(v){var y=new Uint8Array(v.data.byteLength+e.byteLength);y.set(v.data,0),y.set(e,v.data.byteLength),v.data=y}}return u.naluState=l,f}},{key:"discardEPB",value:function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var o=0;for(a=0;a<t;o++,a++)o===i[0]&&(o++,i.shift()),n[a]=e[o];return n}},{key:"_parseAACPES",value:function(e){var t,n,r,i,a,o,u,l,c,d=this._audioTrack,h=e.data,p=e.pts,v=this.aacOverFlow,m=this.aacLastPTS;if(v){var b=new Uint8Array(v.byteLength+h.byteLength);b.set(v,0),b.set(h,v.byteLength),h=b}for(a=0,l=h.length;a<l-1&&(255!==h[a]||240!=(240&h[a+1]));a++);if(a){var _,E;if(a<l-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(f.default.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:E,reason:_}),E)return}if(!d.samplerate){var T=this.audioCodec;t=s.default.getAudioConfig(this.observer,h,a,T),d.config=t.config,d.samplerate=t.samplerate,d.channelCount=t.channelCount,d.codec=t.codec,d.manifestCodec=t.manifestCodec,y.logger.log("parsed codec:"+d.codec+",rate:"+t.samplerate+",nb channel:"+t.channelCount)}if(i=0,r=9216e4/d.samplerate,v&&m){var w=m+r;Math.abs(w-p)>1&&(y.logger.log("AAC: align PTS for overlapping frames by "+Math.round((w-p)/90)),p=w)}for(;a+5<l&&(o=1&h[a+1]?7:9,n=(3&h[a+3])<<11|h[a+4]<<3|(224&h[a+5])>>>5,(n-=o)>0&&a+o+n<=l);)for(u=p+i*r,c={unit:h.subarray(a+o,a+o+n),pts:u,dts:u},d.samples.push(c),d.len+=n,a+=n+o,i++;a<l-1&&(255!==h[a]||240!=(240&h[a+1]));a++);v=a<l?h.subarray(a,l):null,this.aacOverFlow=v,this.aacLastPTS=u}},{key:"_parseMPEGPES",value:function(e){l.default.parse(this._audioTrack,e.data,0,e.pts)}},{key:"_parseID3PES",value:function(e){this._id3Track.samples.push(e)}}],[{key:"probe",value:function(e){return e.length>=564&&71===e[0]&&71===e[188]&&71===e[376]}}]),e}();n.default=m},{22:22,26:26,30:30,31:31,33:33,35:35,53:53}],33:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},n.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(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(53),s=e(33),u=e(35),l=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(){function e(t){r(this,e),this.hls=t,this.onEvent=this.onEvent.bind(this);for(var n=arguments.length,i=Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];this.handledEvents=i,this.useGenericHandler=!0,this.registerListeners()}return a(e,[{key:"destroy",value:function(){this.unregisterListeners()}},{key:"isEventHandler",value:function(){return"object"===i(this.handledEvents)&&this.handledEvents.length&&"function"==typeof this.onEvent}},{key:"registerListeners",value:function(){this.isEventHandler()&&this.handledEvents.forEach(function(e){if("hlsEventGeneric"===e)throw new Error("Forbidden event name: "+e);this.hls.on(e,this.onEvent)}.bind(this))}},{key:"unregisterListeners",value:function(){this.isEventHandler()&&this.handledEvents.forEach(function(e){this.hls.off(e,this.onEvent)}.bind(this))}},{key:"onEvent",value:function(e,t){this.onEventGeneric(e,t)}},{key:"onEventGeneric",value:function(e,t){var n=function(e,t){var n="on"+e.replace("hls","");if("function"!=typeof this[n])throw new Error("Event "+e+" has no generic handler in this "+this.constructor.name+" class (tried "+n+")");return this[n].bind(this,t)};try{n.call(this,e,t).call()}catch(t){o.logger.error("internal error happened while processing "+e+":"+t.message),this.hls.trigger(l.default.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:e,err:t})}}}]),e}();n.default=c},{33:33,35:35,53:53}],35:[function(e,t,n){"use strict";t.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(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e)}return i(e,null,[{key:"getSilentFrame",value:function(e,t){switch(e){case"mp4a.40.2":if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)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===t)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===t)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===t)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===t)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}}]),e}();n.default=a},{}],37:[function(e,t,n){"use strict";var r={isBuffered:function(e,t){if(e)for(var n=e.buffered,r=0;r<n.length;r++)if(t>=n.start(r)&&t<=n.end(r))return!0;return!1},bufferInfo:function(e,t,n){if(e){var r,i=e.buffered,a=[];for(r=0;r<i.length;r++)a.push({start:i.start(r),end:i.end(r)});return this.bufferedInfo(a,t,n)}return{len:0,start:t,end:t,nextStart:void 0}},bufferedInfo:function(e,t,n){var r,i,a,o,s,u=[];for(e.sort(function(e,t){var n=e.start-t.start;return n||t.end-e.end}),s=0;s<e.length;s++){var l=u.length;if(l){var c=u[l-1].end;e[s].start-c<n?e[s].end>c&&(u[l-1].end=e[s].end):u.push(e[s])}else u.push(e[s])}for(s=0,r=0,i=a=t;s<u.length;s++){var f=u[s].start,d=u[s].end;if(t+n>=f&&t<d)i=f,a=d,r=a-t;else if(t+n<f){o=f;break}}return{len:r,start:i,end:a,nextStart:o}}};t.exports=r},{}],38:[function(e,t,n){"use strict";var r=e(53),i={mergeDetails:function(e,t){var n,a=Math.max(e.startSN,t.startSN)-t.startSN,o=Math.min(e.endSN,t.endSN)-t.startSN,s=t.startSN-e.startSN,u=e.fragments,l=t.fragments,c=0;if(o<a)return void(t.PTSKnown=!1);for(var f=a;f<=o;f++){var d=u[s+f],h=l[f];h&&d&&(c=d.cc-h.cc,isNaN(d.startPTS)||(h.start=h.startPTS=d.startPTS,h.endPTS=d.endPTS,h.duration=d.duration,h.backtracked=d.backtracked,h.dropped=d.dropped,n=h))}if(c)for(r.logger.log("discontinuity sliding from playlist, take drift into account"),f=0;f<l.length;f++)l[f].cc+=c;if(n)i.updateFragPTSDTS(t,n,n.startPTS,n.endPTS,n.startDTS,n.endDTS);else if(s>=0&&s<u.length){var p=u[s].start;for(f=0;f<l.length;f++)l[f].start+=p}t.PTSKnown=e.PTSKnown},updateFragPTSDTS:function(e,t,n,r,a,o){if(!isNaN(t.startPTS)){var s=Math.abs(t.startPTS-n);isNaN(t.deltaPTS)?t.deltaPTS=s:t.deltaPTS=Math.max(s,t.deltaPTS),n=Math.min(n,t.startPTS),r=Math.max(r,t.endPTS),a=Math.min(a,t.startDTS),o=Math.max(o,t.endDTS)}var u=n-t.start;t.start=t.startPTS=n,t.endPTS=r,t.startDTS=a,t.endDTS=o,t.duration=r-n;var l=t.sn;if(!e||l<e.startSN||l>e.endSN)return 0;var c,f,d;for(c=l-e.startSN,f=e.fragments,t=f[c],d=c;d>0;d--)i.updatePTS(f,d,d-1);for(d=c;d<f.length-1;d++)i.updatePTS(f,d,d+1);return e.PTSKnown=!0,u},updatePTS:function(e,t,n){var i=e[t],a=e[n],o=a.startPTS;isNaN(o)?a.start=n>t?i.start+i.duration:Math.max(i.start-a.duration,0):n>t?(i.duration=o-i.start,i.duration<0&&r.logger.warn("negative duration computed for frag "+i.sn+",level "+i.level+", there should be some duration drift between playlist and fragment!")):(a.duration=i.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!"))}};t.exports=i},{53:53}],39:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(2),s=r(o),u=e(35),l=r(u),c=e(33),f=e(43),d=r(f),h=e(41),p=r(h),v=e(42),y=r(v),g=e(13),m=r(g),b=e(12),_=r(b),E=e(11),T=r(E),w=e(53),k=e(1),S=r(k),O=e(4),A=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=e.DefaultConfig;if((n.liveSyncDurationCount||n.liveMaxLatencyDurationCount)&&(n.liveSyncDuration||n.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var a in r)a in n||(n[a]=r[a]);if(void 0!==n.liveMaxLatencyDurationCount&&n.liveMaxLatencyDurationCount<=n.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==n.liveMaxLatencyDuration&&(n.liveMaxLatencyDuration<=n.liveSyncDuration||void 0===n.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');(0,w.enableLogs)(n.debug),this.config=n,this._autoLevelCapping=-1;var o=this.observer=new S.default;o.trigger=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e,e].concat(n))},o.off=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.removeListener.apply(o,[e].concat(n))},this.on=o.on.bind(o),this.off=o.off.bind(o),this.trigger=o.trigger.bind(o);var s=this.abrController=new n.abrController(this),u=new n.bufferController(this),l=new n.capLevelController(this),c=new n.fpsController(this),f=new d.default(this),h=new p.default(this),v=new y.default(this),g=new T.default(this),b=this.levelController=new _.default(this),E=this.streamController=new m.default(this),k=[b,E],O=n.audioStreamController;O&&k.push(new O(this)),this.networkControllers=k;var A=[f,h,v,s,u,l,c,g];if(O=n.audioTrackController){var P=new O(this);this.audioTrackController=P,A.push(P)}if(O=n.subtitleTrackController){var R=new O(this);this.subtitleTrackController=R,A.push(R)}[n.subtitleStreamController,n.timelineController].forEach(function(e){e&&A.push(new e(t))}),this.coreComponents=A}return a(e,null,[{key:"isSupported",value:function(){var e=window.MediaSource=window.MediaSource||window.WebKitMediaSource,t=window.SourceBuffer=window.SourceBuffer||window.WebKitSourceBuffer,n=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return n&&r}},{key:"version",get:function(){return"0.7.9"}},{key:"Events",get:function(){return l.default}},{key:"ErrorTypes",get:function(){return c.ErrorTypes}},{key:"ErrorDetails",get:function(){return c.ErrorDetails}},{key:"DefaultConfig",get:function(){return e.defaultConfig?e.defaultConfig:O.hlsDefaultConfig},set:function(t){e.defaultConfig=t}}]),a(e,[{key:"destroy",value:function(){w.logger.log("destroy"),this.trigger(l.default.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach(function(e){e.destroy()}),this.url=null,this.observer.removeAllListeners(),this._autoLevelCapping=-1}},{key:"attachMedia",value:function(e){w.logger.log("attachMedia"),this.media=e,this.trigger(l.default.MEDIA_ATTACHING,{media:e})}},{key:"detachMedia",value:function(){w.logger.log("detachMedia"),this.trigger(l.default.MEDIA_DETACHING),this.media=null}},{key:"loadSource",value:function(e){e=s.default.buildAbsoluteURL(window.location.href,e,{alwaysNormalize:!0}),w.logger.log("loadSource:"+e),this.url=e,this.trigger(l.default.MANIFEST_LOADING,{url:e})}},{key:"startLoad",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;w.logger.log("startLoad("+e+")"),this.networkControllers.forEach(function(t){t.startLoad(e)})}},{key:"stopLoad",value:function(){w.logger.log("stopLoad"),this.networkControllers.forEach(function(e){e.stopLoad()})}},{key:"swapAudioCodec",value:function(){w.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){w.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){w.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){w.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){w.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){w.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){w.logger.log("set startLevel:"+e);var t=this;-1!==e&&(e=Math.max(e,t.minAutoLevel)),t.levelController.startLevel=e}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){w.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var e=this,t=e.levels,n=e.config.minAutoBitrate,r=t?t.length:0,i=0;i<r;i++){if((t[i].realBitrate?Math.max(t[i].realBitrate,t[i].bitrate):t[i].bitrate)>n)return i}return 0}},{key:"maxAutoLevel",get:function(){var e=this,t=e.levels,n=e.autoLevelCapping;return-1===n&&t&&t.length?t.length-1:n}},{key:"nextAutoLevel",get:function(){var e=this;return Math.min(Math.max(e.abrController.nextAutoLevel,e.minAutoLevel),e.maxAutoLevel)},set:function(e){var t=this;t.abrController.nextAutoLevel=Math.max(t.minAutoLevel,e)}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}}]),e}();n.default=A},{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(e,t,n){"use strict";t.exports=e(39).default},{39:39}],41:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(33),h=e(53),p=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.FRAG_LOADING));return n.loaders={},n}return o(t,e),s(t,[{key:"destroy",value:function(){var e=this.loaders;for(var t in e){var n=e[t];n&&n.destroy()}this.loaders={},f.default.prototype.destroy.call(this)}},{key:"onFragLoading",value:function(e){var t=e.frag,n=t.type,r=this.loaders[n],i=this.hls.config;t.loaded=0,r&&(h.logger.warn("abort previous fragment loader for type:"+n),r.abort()),r=this.loaders[n]=t.loader=void 0!==i.fLoader?new i.fLoader(i):new i.loader(i);var a=void 0,o=void 0,s=void 0;a={url:t.url,frag:t,responseType:"arraybuffer",progressData:!1};var u=t.byteRangeStartOffset,l=t.byteRangeEndOffset;isNaN(u)||isNaN(l)||(a.rangeStart=u,a.rangeEnd=l),o={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:i.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(e,t,n){var r=e.data,i=n.frag;i.loader=void 0,this.loaders[i.type]=void 0,this.hls.trigger(l.default.FRAG_LOADED,{payload:r,frag:i,stats:t})}},{key:"loaderror",value:function(e,t){var n=t.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(l.default.ERROR,{type:d.ErrorTypes.NETWORK_ERROR,details:d.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t.frag,response:e})}},{key:"loadtimeout",value:function(e,t){var n=t.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(l.default.ERROR,{type:d.ErrorTypes.NETWORK_ERROR,details:d.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t.frag})}},{key:"loadprogress",value:function(e,t,n){var r=t.frag;r.loaded=e.loaded,this.hls.trigger(l.default.FRAG_LOAD_PROGRESS,{frag:r,stats:e})}}]),t}(f.default);n.default=p},{33:33,34:34,35:35,53:53}],42:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(33),h=e(53),p=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.KEY_LOADING));return n.loaders={},n.decryptkey=null,n.decrypturl=null,n}return o(t,e),s(t,[{key:"destroy",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},f.default.prototype.destroy.call(this)}},{key:"onKeyLoading",value:function(e){var t=e.frag,n=t.type,r=this.loaders[n],i=t.decryptdata,a=i.uri;if(a!==this.decrypturl||null===this.decryptkey){var o=this.hls.config;r&&(h.logger.warn("abort previous key loader for type:"+n),r.abort()),t.loader=this.loaders[n]=new o.loader(o),this.decrypturl=a,this.decryptkey=null;var s=void 0,u=void 0,c=void 0;s={url:a,frag:t,responseType:"arraybuffer"},u={timeout:o.fragLoadingTimeOut,maxRetry:o.fragLoadingMaxRetry,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},t.loader.load(s,u,c)}else this.decryptkey&&(i.key=this.decryptkey,this.hls.trigger(l.default.KEY_LOADED,{frag:t}))}},{key:"loadsuccess",value:function(e,t,n){var r=n.frag;this.decryptkey=r.decryptdata.key=new Uint8Array(e.data),r.loader=void 0,this.loaders[r.type]=void 0,this.hls.trigger(l.default.KEY_LOADED,{frag:r})}},{key:"loaderror",value:function(e,t){var n=t.frag,r=n.loader;r&&r.abort(),this.loaders[t.type]=void 0,this.hls.trigger(l.default.ERROR,{type:d.ErrorTypes.NETWORK_ERROR,details:d.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:n,response:e})}},{key:"loadtimeout",value:function(e,t){var n=t.frag,r=n.loader;r&&r.abort(),this.loaders[t.type]=void 0,this.hls.trigger(l.default.ERROR,{type:d.ErrorTypes.NETWORK_ERROR,details:d.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:n})}}]),t}(f.default);n.default=p},{33:33,34:34,35:35,53:53}],43:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(2),l=r(u),c=e(35),f=r(c),d=e(34),h=r(d),p=e(33),v=e(47),y=r(v),g=e(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 e(){o(this,e),this.method=null,this.key=null,this.iv=null,this._uri=null}return s(e,[{key:"uri",get:function(){return!this._uri&&this.reluri&&(this._uri=l.default.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri}}]),e}(),w=function(){function e(){o(this,e),this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[]}return s(e,[{key:"createInitializationVector",value:function(e){for(var t=new Uint8Array(16),n=12;n<16;n++)t[n]=e>>8*(15-n)&255;return t}},{key:"fragmentDecryptdataFromLevelkey",value:function(e,t){var n=e;return e&&e.method&&e.uri&&!e.iv&&(n=new T,n.method=e.method,n.baseuri=e.baseuri,n.reluri=e.reluri,n.iv=this.createInitializationVector(t)),n}},{key:"cloneObj",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=l.default.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(e){this._url=e}},{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 e=this._byteRange=[];if(this.rawByteRange){var t=this.rawByteRange.split("@",2);if(1===t.length){var n=this.lastByteRangeEndOffset;e[0]=n||0}else e[0]=parseInt(t[1]);e[1]=parseInt(t[0])+e[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}}]),e}(),k=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,f.default.MANIFEST_LOADING,f.default.LEVEL_LOADING,f.default.AUDIO_TRACK_LOADING,f.default.SUBTITLE_TRACK_LOADING));return n.loaders={},n}return a(t,e),s(t,[{key:"destroy",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},h.default.prototype.destroy.call(this)}},{key:"onManifestLoading",value:function(e){this.load(e.url,{type:"manifest"})}},{key:"onLevelLoading",value:function(e){this.load(e.url,{type:"level",level:e.level,id:e.id})}},{key:"onAudioTrackLoading",value:function(e){this.load(e.url,{type:"audioTrack",id:e.id})}},{key:"onSubtitleTrackLoading",value:function(e){this.load(e.url,{type:"subtitleTrack",id:e.id})}},{key:"load",value:function(e,t){var n=this.loaders[t.type];if(n){var r=n.context;if(r&&r.url===e)return void g.logger.trace("playlist request ongoing");g.logger.warn("abort previous loader for type:"+t.type),n.abort()}var i=this.hls.config,a=void 0,o=void 0,s=void 0,u=void 0;"manifest"===t.type?(a=i.manifestLoadingMaxRetry,o=i.manifestLoadingTimeOut,s=i.manifestLoadingRetryDelay,u=i.manifestLoadingMaxRetryTimeout):(a=i.levelLoadingMaxRetry,o=i.levelLoadingTimeOut,s=i.levelLoadingRetryDelay,u=i.levelLoadingMaxRetryTimeout,g.logger.log("loading playlist for "+t.type+" "+(t.level||t.id))),n=this.loaders[t.type]=t.loader=void 0!==i.pLoader?new i.pLoader(i):new i.loader(i),t.url=e,t.responseType="";var l=void 0,c=void 0;l={timeout:o,maxRetry:a,retryDelay:s,maxRetryDelay:u},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},n.load(t,l,c)}},{key:"resolve",value:function(e,t){return l.default.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}},{key:"parseMasterPlaylist",value:function(e,t){var n=[],r=void 0;for(m.lastIndex=0;null!=(r=m.exec(e));){var i={},a=i.attrs=new y.default(r[1]);i.url=this.resolve(r[2],t);var o=a.decimalResolution("RESOLUTION");o&&(i.width=o.width,i.height=o.height),i.bitrate=a.decimalInteger("AVERAGE-BANDWIDTH")||a.decimalInteger("BANDWIDTH"),i.name=a.NAME;var s=a.CODECS;if(s){s=s.split(/[ ,]+/);for(var u=0;u<s.length;u++){var l=s[u];-1!==l.indexOf("avc1")?i.videoCodec=this.avc1toavcoti(l):i.audioCodec=l}}n.push(i)}return n}},{key:"parseMasterPlaylistMedia",value:function(e,t,n){var r=void 0,i=[],a=0;for(b.lastIndex=0;null!=(r=b.exec(e));){var o={},s=new y.default(r[1]);s.TYPE===n&&(o.groupId=s["GROUP-ID"],o.name=s.NAME,o.type=n,o.default="YES"===s.DEFAULT,o.autoselect="YES"===s.AUTOSELECT,o.forced="YES"===s.FORCED,s.URI&&(o.url=this.resolve(s.URI,t)),o.lang=s.LANGUAGE,o.name||(o.name=o.lang),o.id=a++,i.push(o))}return i}},{key:"avc1toavcoti",value:function(e){var t,n=e.split(".");return n.length>2?(t=n.shift()+".",t+=parseInt(n.shift()).toString(16),t+=("000"+parseInt(n.shift()).toString(16)).substr(-4)):t=e,t}},{key:"parseLevelPlaylist",value:function(e,t,n,r){var i,a,o=0,s=0,u={type:null,version:null,url:t,fragments:[],live:!0,startSN:0},l=new T,c=0,f=null,d=new w;for(_.lastIndex=0;null!==(i=_.exec(e));){var h=i[1];if(h){d.duration=parseFloat(h);var p=(" "+i[2]).slice(1);d.title=p||null,d.tagList.push(p?["INF",h,p]:["INF",h])}else if(i[3]){if(!isNaN(d.duration)){var v=o++;d.type=r,d.start=s,d.levelkey=l,d.sn=v,d.level=n,d.cc=c,d.baseurl=t,d.relurl=(" "+i[3]).slice(1),u.fragments.push(d),f=d,s+=d.duration,d=new w}}else if(i[4]){if(d.rawByteRange=(" "+i[4]).slice(1),f){var m=f.byteRangeEndOffset;m&&(d.lastByteRangeEndOffset=m)}}else if(i[5])d.rawProgramDateTime=(" "+i[5]).slice(1),d.tagList.push(["PROGRAM-DATE-TIME",d.rawProgramDateTime]);else{for(i=i[0].match(E),a=1;a<i.length&&void 0===i[a];a++);var b=(" "+i[a+1]).slice(1),k=(" "+i[a+2]).slice(1);switch(i[a]){case"#":d.tagList.push(k?[b,k]:[b]);break;case"PLAYLIST-TYPE":u.type=b.toUpperCase();break;case"MEDIA-SEQUENCE":o=u.startSN=parseInt(b);break;case"TARGETDURATION":u.targetduration=parseFloat(b);break;case"VERSION":u.version=parseInt(b);break;case"EXTM3U":break;case"ENDLIST":u.live=!1;break;case"DIS":c++,d.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":c=parseInt(b);break;case"KEY":var S=b,O=new y.default(S),A=O.enumeratedString("METHOD"),P=O.URI,R=O.hexadecimalInteger("IV");A&&(l=new T,P&&["AES-128","SAMPLE-AES"].indexOf(A)>=0&&(l.method=A,l.baseuri=t,l.reluri=P,l.key=null,l.iv=R));break;case"START":var D=b,L=new y.default(D),x=L.decimalFloatingPoint("TIME-OFFSET");isNaN(x)||(u.startTimeOffset=x);break;case"MAP":var I=new y.default(b);d.relurl=I.URI,d.rawByteRange=I.BYTERANGE,d.baseurl=t,d.level=n,d.type=r,d.sn="initSegment",u.initSegment=d,d=new w;break;default:g.logger.warn("line parsed but not handled: "+i)}}}return d=f,d&&!d.relurl&&(u.fragments.pop(),s-=d.duration),u.totalduration=s,u.averagetargetduration=s/u.fragments.length,u.endSN=o-1,u}},{key:"loadsuccess",value:function(e,t,n){var r=e.data,i=e.url,a=n.type,o=n.id,s=n.level,u=this.hls;if(this.loaders[a]=void 0,void 0!==i&&0!==i.indexOf("data:")||(i=n.url),t.tload=performance.now(),0===r.indexOf("#EXTM3U"))if(r.indexOf("#EXTINF:")>0){var l="audioTrack"!==a&&"subtitleTrack"!==a,c=isNaN(s)?isNaN(o)?0:o:s,d=this.parseLevelPlaylist(r,i,c,"audioTrack"===a?"audio":"subtitleTrack"===a?"subtitle":"main");d.tload=t.tload,"manifest"===a&&u.trigger(f.default.MANIFEST_LOADED,{levels:[{url:i,details:d}],audioTracks:[],url:i,stats:t}),t.tparsed=performance.now(),d.targetduration?l?u.trigger(f.default.LEVEL_LOADED,{details:d,level:s||0,id:o||0,stats:t}):"audioTrack"===a?u.trigger(f.default.AUDIO_TRACK_LOADED,{details:d,id:o,stats:t}):"subtitleTrack"===a&&u.trigger(f.default.SUBTITLE_TRACK_LOADED,{details:d,id:o,stats:t}):u.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:i,reason:"invalid targetduration"})}else{var h=this.parseMasterPlaylist(r,i);if(h.length){var v=this.parseMasterPlaylistMedia(r,i,"AUDIO"),y=this.parseMasterPlaylistMedia(r,i,"SUBTITLES");if(v.length){var m=!1;v.forEach(function(e){e.url||(m=!0)}),!1===m&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(g.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main"}))}u.trigger(f.default.MANIFEST_LOADED,{levels:h,audioTracks:v,subtitles:y,url:i,stats:t})}else u.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:i,reason:"no level found in manifest"})}else u.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:i,reason:"no EXTM3U delimiter"})}},{key:"loaderror",value:function(e,t){var n,r,i=t.loader;switch(t.type){case"manifest":n=p.ErrorDetails.MANIFEST_LOAD_ERROR,r=!0;break;case"level":n=p.ErrorDetails.LEVEL_LOAD_ERROR,r=!1;break;case"audioTrack":n=p.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,r=!1}i&&(i.abort(),this.loaders[t.type]=void 0),this.hls.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:n,fatal:r,url:i.url,loader:i,response:e,context:t})}},{key:"loadtimeout",value:function(e,t){var n,r,i=t.loader;switch(t.type){case"manifest":n=p.ErrorDetails.MANIFEST_LOAD_TIMEOUT,r=!0;break;case"level":n=p.ErrorDetails.LEVEL_LOAD_TIMEOUT,r=!1;break;case"audioTrack":n=p.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT,r=!1}i&&(i.abort(),this.loaders[t.type]=void 0),this.hls.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:n,fatal:r,url:i.url,loader:i,context:t})}}]),t}(h.default);n.default=k},{2:2,33:33,34:34,35:35,47:47,53:53}],44:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=Math.pow(2,32)-1,o=function(){function e(){r(this,e)}return i(e,null,[{key:"init",value:function(){e.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 t;for(t in e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var n=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]);e.HDLR_TYPES={video:n,audio:r};var i=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]);e.STTS=e.STSC=e.STCO=a,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.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]),u=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,o,u,o,s),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,i))}},{key:"box",value:function(e){for(var t,n=Array.prototype.slice.call(arguments,1),r=8,i=n.length,a=i;i--;)r+=n[i].byteLength;for(t=new Uint8Array(r),t[0]=r>>24&255,t[1]=r>>16&255,t[2]=r>>8&255,t[3]=255&r,t.set(e,4),i=0,r=8;i<a;i++)t.set(n[i],r),r+=n[i].byteLength;return t}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}},{key:"mdhd",value:function(t,n){n*=t;var r=Math.floor(n/(a+1)),i=Math.floor(n%(a+1));return e.box(e.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"minf",value:function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}},{key:"moof",value:function(t,n,r){return e.box(e.types.moof,e.mfhd(t),e.traf(r,n))}},{key:"moov",value:function(t){for(var n=t.length,r=[];n--;)r[n]=e.trak(t[n]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(r).concat(e.mvex(t)))}},{key:"mvex",value:function(t){for(var n=t.length,r=[];n--;)r[n]=e.trex(t[n]);return e.box.apply(null,[e.types.mvex].concat(r))}},{key:"mvhd",value:function(t,n){n*=t;var r=Math.floor(n/(a+1)),i=Math.floor(n%(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,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e.box(e.types.mvhd,o)}},{key:"sdtp",value:function(t){var n,r,i=t.samples||[],a=new Uint8Array(4+i.length);for(r=0;r<i.length;r++)n=i[r].flags,a[r+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return e.box(e.types.sdtp,a)}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))}},{key:"avc1",value:function(t){var n,r,i,a=[],o=[];for(n=0;n<t.sps.length;n++)r=t.sps[n],i=r.byteLength,a.push(i>>>8&255),a.push(255&i),a=a.concat(Array.prototype.slice.call(r));for(n=0;n<t.pps.length;n++)r=t.pps[n],i=r.byteLength,o.push(i>>>8&255),o.push(255&i),o=o.concat(Array.prototype.slice.call(r));var s=e.box(e.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|t.sps.length].concat(a).concat([t.pps.length]).concat(o))),u=t.width,l=t.height,c=t.pixelRatio[0],f=t.pixelRatio[1];return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,u>>8&255,255&u,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,f>>24,f>>16&255,f>>8&255,255&f])))}},{key:"esds",value:function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}},{key:"mp4a",value:function(t){var n=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,n>>8&255,255&n,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"mp3",value:function(t){var n=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,n>>8&255,255&n,0,0]))}},{key:"stsd",value:function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){var n=t.id,r=t.duration*t.timescale,i=t.width,o=t.height,s=Math.floor(r/(a+1)),u=Math.floor(r%(a+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,255&n,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,u>>24,u>>16&255,u>>8&255,255&u,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,i>>8&255,255&i,0,0,o>>8&255,255&o,0,0]))}},{key:"traf",value:function(t,n){var r=e.sdtp(t),i=t.id,o=Math.floor(n/(a+1)),s=Math.floor(n%(a+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),e.box(e.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])),e.trun(t,r.length+16+20+8+16+8+8),r)}},{key:"trak",value:function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"trex",value:function(t){var n=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(t,n){var r,i,a,o,s,u,l=t.samples||[],c=l.length,f=12+16*c,d=new Uint8Array(f);for(n+=8+f,d.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,255&c,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0),r=0;r<c;r++)i=l[r],a=i.duration,o=i.size,s=i.flags,u=i.cts,d.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,u>>>24&255,u>>>16&255,u>>>8&255,255&u],12+16*r);return e.box(e.types.trun,d)}},{key:"initSegment",value:function(t){e.types||e.init();var n,r=e.moov(t);return n=new Uint8Array(e.FTYP.byteLength+r.byteLength),n.set(e.FTYP),n.set(r,e.FTYP.byteLength),n}}]),e}();n.default=o},{}],45:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(36),s=r(o),u=e(35),l=r(u),c=e(53),f=e(44),d=r(f),h=e(33),p=function(){function e(t,n,r,a){i(this,e),this.observer=t,this.config=n,this.typeSupported=r;var o=navigator.userAgent;this.isSafari=a&&a.indexOf("Apple")>-1&&o&&!o.match("CriOS"),this.ISGenerated=!1}return a(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(e){this._initPTS=this._initDTS=e}},{key:"resetInitSegment",value:function(){this.ISGenerated=!1}},{key:"remux",value:function(e,t,n,r,i,a,o){if(this.ISGenerated||this.generateIS(e,t,i),this.ISGenerated)if(e.samples.length){e.timescale||(c.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(e,t,i));var s=this.remuxAudio(e,i,a,o);if(t.samples.length){var u=void 0;s&&(u=s.endPTS-s.startPTS),t.timescale||(c.logger.warn("regenerate InitSegment as video detected"),this.generateIS(e,t,i)),this.remuxVideo(t,i,a,u,o)}}else{var f=void 0;t.samples.length&&(f=this.remuxVideo(t,i,a,o)),f&&e.codec&&this.remuxEmptyAudio(e,i,a,f)}n.samples.length&&this.remuxID3(n,i),r.samples.length&&this.remuxText(r,i),this.observer.trigger(l.default.FRAG_PARSED)}},{key:"generateIS",value:function(e,t,n){var r,i,a=this.observer,o=e.samples,s=t.samples,u=this.typeSupported,f="audio/mp4",p={},v={tracks:p},y=void 0===this._initPTS;if(y&&(r=i=1/0),e.config&&o.length&&(e.timescale=e.samplerate,c.logger.log("audio sampling rate : "+e.samplerate),e.isAAC||(u.mpeg?(f="audio/mpeg",e.codec=""):u.mp3&&(e.codec="mp3")),p.audio={container:f,codec:e.codec,initSegment:!e.isAAC&&u.mpeg?new Uint8Array:d.default.initSegment([e]),metadata:{channelCount:e.channelCount}},y&&(r=i=o[0].pts-e.inputTimeScale*n)),t.sps&&t.pps&&s.length){var g=t.inputTimeScale;t.timescale=g,p.video={container:"video/mp4",codec:t.codec,initSegment:d.default.initSegment([t]),metadata:{width:t.width,height:t.height}},y&&(r=Math.min(r,s[0].pts-g*n),i=Math.min(i,s[0].dts-g*n),this.observer.trigger(l.default.INIT_PTS_FOUND,{initPTS:r}))}Object.keys(p).length?(a.trigger(l.default.FRAG_PARSING_INIT_SEGMENT,v),this.ISGenerated=!0,y&&(this._initPTS=r,this._initDTS=i)):a.trigger(l.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(e,t,n,r,i){var a,o,s,u,f,p,v,y=8,g=e.timescale,m=e.samples,b=[],_=m.length,E=this._PTSNormalize,T=this._initDTS,w=this.nextAvcDts,k=this.isSafari;k&&(n|=m.length&&w&&(i&&Math.abs(t-w/g)<.1||Math.abs(m[0].pts-w-T)<g/5)),n||(w=t*g),m.forEach(function(e){e.pts=E(e.pts-T,w),e.dts=E(e.dts-T,w)}),m.sort(function(e,t){var n=e.dts-t.dts,r=e.pts-t.pts;return n||(r||e.id-t.id)});var S=m.reduce(function(e,t){return Math.max(Math.min(e,t.pts-t.dts),-18e3)},0);if(S<0){c.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(S/90)+" ms to overcome this issue");for(var O=0;O<m.length;O++)m[O].dts+=S}var A=m[0];f=Math.max(A.dts,0),u=Math.max(A.pts,0);var P=Math.round((f-w)/90);n&&P&&(P>1?c.logger.log("AVC:"+P+" ms hole between fragments detected,filling it"):P<-1&&c.logger.log("AVC:"+-P+" ms overlapping between fragments detected"),f=w,m[0].dts=f,u=Math.max(u-P,w),m[0].pts=u,c.logger.log("Video/PTS/DTS adjusted: "+Math.round(u/90)+"/"+Math.round(f/90)+",delta:"+P+" ms")),A=m[m.length-1],v=Math.max(A.dts,0),p=Math.max(A.pts,0,v),k&&(a=Math.round((v-f)/(m.length-1)));for(var R=0,D=0,L=0;L<_;L++){for(var x=m[L],I=x.units,M=I.length,C=0,N=0;N<M;N++)C+=I[N].data.length;D+=C,R+=M,x.length=C,x.dts=k?f+L*a:Math.max(x.dts,f),x.pts=Math.max(x.pts,x.dts)}var U=D+4*R+8;try{o=new Uint8Array(U)}catch(e){return void this.observer.trigger(l.default.ERROR,{type:h.ErrorTypes.MUX_ERROR,details:h.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:U,reason:"fail allocating video mdat "+U})}var j=new DataView(o.buffer);j.setUint32(0,U),o.set(d.default.types.mdat,4);for(var F=0;F<_;F++){for(var B=m[F],G=B.units,V=0,H=void 0,K=0,Y=G.length;K<Y;K++){var W=G[K],q=W.data,z=W.data.byteLength;j.setUint32(y,z),y+=4,o.set(q,y),y+=z,V+=4+z}if(k)H=Math.max(0,a*Math.round((B.pts-B.dts)/a));else{if(F<_-1)a=m[F+1].dts-B.dts;else{var X=this.config,$=B.dts-m[F>0?F-1:F].dts;if(X.stretchShortVideoTrack){var J=X.maxBufferHole,Q=X.maxSeekHole,Z=Math.floor(Math.min(J,Q)*g),ee=(r?u+r*g:this.nextAudioPts)-B.pts;ee>Z?(a=ee-$,a<0&&(a=$),c.logger.log("It is approximately "+ee/90+" ms to the next segment; using duration "+a/90+" ms for the last video frame.")):a=$}else a=$}H=Math.round(B.pts-B.dts)}b.push({size:V,duration:a,cts:H,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:B.key?2:1,isNonSync:B.key?0:1}})}this.nextAvcDts=v+a;var te=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,b.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var ne=b[0].flags;ne.dependsOn=2,ne.isNonSync=0}e.samples=b,s=d.default.moof(e.sequenceNumber++,f,e),e.samples=[];var re={data1:s,data2:o,startPTS:u/g,endPTS:(p+a)/g,startDTS:f/g,endDTS:this.nextAvcDts/g,type:"video",nb:b.length,dropped:te};return this.observer.trigger(l.default.FRAG_PARSING_DATA,re),re}},{key:"remuxAudio",value:function(e,t,n,r){var i,a,o,u,f,p,v,y=e.inputTimeScale,g=e.timescale,m=y/g,b=e.isAAC?1024:1152,_=b*m,E=this._PTSNormalize,T=this._initDTS,w=!e.isAAC&&this.typeSupported.mpeg,k=e.samples,S=[],O=this.nextAudioPts;if(n|=k.length&&O&&(r&&Math.abs(t-O/y)<.1||Math.abs(k[0].pts-O-T)<20*_),n||(O=t*y),k.forEach(function(e){e.pts=e.dts=E(e.pts-T,O)}),k.sort(function(e,t){return e.pts-t.pts}),r&&e.isAAC)for(var A=0,P=O;A<k.length;){var R,D=k[A],L=D.pts;R=L-P;var x=Math.abs(1e3*R/y);if(R<=-_)c.logger.warn("Dropping 1 audio frame @ "+(P/y).toFixed(3)+"s due to "+x+" ms overlap."),k.splice(A,1),e.len-=D.unit.length;else if(R>=_&&x<1e4&&P){var I=Math.round(R/_);c.logger.warn("Injecting "+I+" audio frame @ "+(P/y).toFixed(3)+"s due to "+Math.round(1e3*R/y)+" ms gap.");for(var M=0;M<I;M++){var C=Math.max(P,0);o=s.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount),o||(c.logger.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),o=D.unit.subarray()),k.splice(A,0,{unit:o,pts:C,dts:C}),e.len+=o.length,P+=_,A++}D.pts=D.dts=P,P+=_,A++}else Math.abs(R),D.pts=D.dts=P,P+=_,A++}for(var N=0,U=k.length;N<U;N++){var j=k[N],F=j.unit,B=j.pts;if(void 0!==v)a.duration=Math.round((B-v)/m);else{var G=Math.round(1e3*(B-O)/y),V=0;if(n&&e.isAAC&&G){if(G>0&&G<1e4)V=Math.round((B-O)/_),c.logger.log(G+" ms hole between AAC samples detected,filling it"),V>0&&(o=s.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount),o||(o=F.subarray()),e.len+=V*o.length);else if(G<-12){c.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(O/y).toFixed(3)+"s/"+(B/y).toFixed(3)+"s/"+-G+"ms"),e.len-=F.byteLength;continue}B=O}if(p=Math.max(0,B),!(e.len>0))return;var H=w?e.len:e.len+8;i=w?0:8;try{u=new Uint8Array(H)}catch(e){return void this.observer.trigger(l.default.ERROR,{type:h.ErrorTypes.MUX_ERROR,details:h.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:H,reason:"fail allocating audio mdat "+H})}if(!w){new DataView(u.buffer).setUint32(0,H),u.set(d.default.types.mdat,4)}for(var K=0;K<V;K++)o=s.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount),o||(c.logger.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),o=F.subarray()),u.set(o,i),i+=o.byteLength,a={size:o.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(a)}u.set(F,i);var Y=F.byteLength;i+=Y,a={size:Y,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(a),v=B}var W=0,q=S.length;if(q>=2&&(W=S[q-2].duration,a.duration=W),q){this.nextAudioPts=O=v+m*W,e.len=0,e.samples=S,f=w?new Uint8Array:d.default.moof(e.sequenceNumber++,p/m,e),e.samples=[];var z=p/y,X=O/y,$={data1:f,data2:u,startPTS:z,endPTS:X,startDTS:z,endDTS:X,type:"audio",nb:q};return this.observer.trigger(l.default.FRAG_PARSING_DATA,$),$}return null}},{key:"remuxEmptyAudio",value:function(e,t,n,r){var i=e.inputTimeScale,a=e.samplerate?e.samplerate:i,o=i/a,u=this.nextAudioPts,l=(void 0!==u?u:r.startDTS*i)+this._initDTS,f=r.endDTS*i+this._initDTS,d=1024*o,h=Math.ceil((f-l)/d),p=s.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(c.logger.warn("remux empty Audio"),!p)return void c.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var v=[],y=0;y<h;y++){var g=l+y*d;v.push({unit:p,pts:g,dts:g}),e.len+=p.length}e.samples=v,this.remuxAudio(e,t,n)}},{key:"remuxID3",value:function(e,t){var n,r=e.samples.length,i=e.inputTimeScale,a=this._initPTS,o=this._initDTS;if(r){for(var s=0;s<r;s++)n=e.samples[s],n.pts=(n.pts-a)/i,n.dts=(n.dts-o)/i;this.observer.trigger(l.default.FRAG_PARSING_METADATA,{samples:e.samples})}e.samples=[],t=t}},{key:"remuxText",value:function(e,t){e.samples.sort(function(e,t){return e.pts-t.pts});var n,r=e.samples.length,i=e.inputTimeScale,a=this._initPTS;if(r){for(var o=0;o<r;o++)n=e.samples[o],n.pts=(n.pts-a)/i;this.observer.trigger(l.default.FRAG_PARSING_USERDATA,{samples:e.samples})}e.samples=[],t=t}},{key:"_PTSNormalize",value:function(e,t){var n;if(void 0===t)return e;for(n=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=n;return e}}]),e}();n.default=p},{33:33,35:35,36:36,44:44,53:53}],46:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e(35),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(){function e(t){r(this,e),this.observer=t}return i(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(){}},{key:"resetInitSegment",value:function(){}},{key:"remux",value:function(e,t,n,r,i,a,s,u){var l=this.observer,c="";e&&(c+="audio"),t&&(c+="video"),l.trigger(o.default.FRAG_PARSING_DATA,{data1:u,startPTS:i,startDTS:i,type:c,nb:1,dropped:0}),l.trigger(o.default.FRAG_PARSED)}}]),e}();n.default=s},{35:35}],47:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=/^(\d+)x(\d+)$/,o=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,s=function(){function e(t){r(this,e),"string"==typeof t&&(t=e.parseAttrList(t));for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n])}return i(e,[{key:"decimalInteger",value:function(e){var t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}},{key:"hexadecimalInteger",value:function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var n=new Uint8Array(t.length/2),r=0;r<t.length/2;r++)n[r]=parseInt(t.slice(2*r,2*r+2),16);return n}return null}},{key:"hexadecimalIntegerAsNumber",value:function(e){var t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}},{key:"decimalFloatingPoint",value:function(e){return parseFloat(this[e])}},{key:"enumeratedString",value:function(e){return this[e]}},{key:"decimalResolution",value:function(e){var t=a.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}}],[{key:"parseAttrList",value:function(e){var t,n={};for(o.lastIndex=0;null!==(t=o.exec(e));){var r=t[2];0===r.indexOf('"')&&r.lastIndexOf('"')===r.length-1&&(r=r.slice(1,-1)),n[t[1]]=r}return n}}]),e}();n.default=s},{}],48:[function(e,t,n){"use strict";var r={search:function(e,t){for(var n=0,r=e.length-1,i=null,a=null;n<=r;){i=(n+r)/2|0,a=e[i];var o=t(a);if(o>0)n=i+1;else{if(!(o<0))return a;r=i-1}}return null}};t.exports=r},{}],49:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),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(e){var t=e;return a.hasOwnProperty(e)&&(t=a[e]),String.fromCharCode(t)},s=15,u=100,l={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},c={17:2,18:4,21:6,22:8,23:10,19:13,20:15},f={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},d={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(e){this.time=e},log:function(e,t){var n=this.verboseFilter[e];this.verboseLevel>=n&&console.log(this.time+" ["+e+"] "+t)}},v=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},y=function(){function e(t,n,i,a,o){r(this,e),this.foreground=t||"white",this.underline=n||!1,this.italics=i||!1,this.background=a||"black",this.flash=o||!1}return i(e,[{key:"reset",value:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}},{key:"setStyles",value:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}}},{key:"isDefault",value:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}},{key:"equals",value:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}},{key:"copy",value:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}},{key:"toString",value:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}]),e}(),g=function(){function e(t,n,i,a,o,s){r(this,e),this.uchar=t||" ",this.penState=new y(n,i,a,o,s)}return i(e,[{key:"reset",value:function(){this.uchar=" ",this.penState.reset()}},{key:"setChar",value:function(e,t){this.uchar=e,this.penState.copy(t)}},{key:"setPenState",value:function(e){this.penState.copy(e)}},{key:"equals",value:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}},{key:"copy",value:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)}},{key:"isEmpty",value:function(){return" "===this.uchar&&this.penState.isDefault()}}]),e}(),m=function(){function e(){r(this,e),this.chars=[];for(var t=0;t<u;t++)this.chars.push(new g);this.pos=0,this.currPenState=new y}return i(e,[{key:"equals",value:function(e){for(var t=!0,n=0;n<u;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t}},{key:"copy",value:function(e){for(var t=0;t<u;t++)this.chars[t].copy(e.chars[t])}},{key:"isEmpty",value:function(){for(var e=!0,t=0;t<u;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}},{key:"setCursor",value:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(p.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>u&&(p.log("ERROR","Too large cursor position "+this.pos),this.pos=u)}},{key:"moveCursor",value:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)}},{key:"backSpace",value:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}},{key:"insertChar",value:function(e){e>=144&&this.backSpace();var t=o(e);if(this.pos>=u)return void p.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}},{key:"clearFromPos",value:function(e){var t;for(t=e;t<u;t++)this.chars[t].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 e=[],t=!0,n=0;n<u;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")}},{key:"setPenStyles",value:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}]),e}(),b=function(){function e(){r(this,e),this.rows=[];for(var t=0;t<s;t++)this.rows.push(new m);this.currRow=s-1,this.nrRollUpRows=null,this.reset()}return i(e,[{key:"reset",value:function(){for(var e=0;e<s;e++)this.rows[e].clear();this.currRow=s-1}},{key:"equals",value:function(e){for(var t=!0,n=0;n<s;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}},{key:"copy",value:function(e){for(var t=0;t<s;t++)this.rows[t].copy(e.rows[t])}},{key:"isEmpty",value:function(){for(var e=!0,t=0;t<s;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}},{key:"backSpace",value:function(){this.rows[this.currRow].backSpace()}},{key:"clearToEndOfRow",value:function(){this.rows[this.currRow].clearToEndOfRow()}},{key:"insertChar",value:function(e){this.rows[this.currRow].insertChar(e)}},{key:"setPen",value:function(e){this.rows[this.currRow].setPenStyles(e)}},{key:"moveCursor",value:function(e){this.rows[this.currRow].moveCursor(e)}},{key:"setCursor",value:function(e){p.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)}},{key:"setPAC",value:function(e){p.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(var n=0;n<s;n++)this.rows[n].clear();var r=this.currRow+1-this.nrRollUpRows,i=this.lastOutputScreen;if(i){var a=i.rows[r].cueStartTime;if(a&&a<p.time)for(var o=0;o<this.nrRollUpRows;o++)this.rows[t-this.nrRollUpRows+o+1].copy(i.rows[r+o])}}this.currRow=t;var u=this.rows[this.currRow];if(null!==e.indent){var l=e.indent,c=Math.max(l-1,0);u.setCursor(e.indent),e.color=u.chars[c].penState.foreground}var f={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(f)}},{key:"setBkgData",value:function(e){p.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}},{key:"setRollUpRows",value:function(e){this.nrRollUpRows=e}},{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 e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),p.log("INFO","Rolling up")}},{key:"getDisplayText",value:function(e){e=e||!1;for(var t=[],n="",r=-1,i=0;i<s;i++){var a=this.rows[i].getTextString();a&&(r=i+1,e?t.push("Row "+r+": '"+a+"'"):t.push(a.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n}},{key:"getTextAndFormat",value:function(){return this.rows}}]),e}(),_=function(){function e(t,n){r(this,e),this.chNr=t,this.outputFilter=n,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 i(e,[{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(e){this.outputFilter=e}},{key:"setPAC",value:function(e){this.writeScreen.setPAC(e)}},{key:"setBkgData",value:function(e){this.writeScreen.setBkgData(e)}},{key:"setMode",value:function(e){e!==this.mode&&(this.mode=e,p.log("INFO","MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}},{key:"insertChars",value:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";p.log("INFO",n+": "+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(e){p.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}},{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 e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,p.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()}},{key:"ccTO",value:function(e){p.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}},{key:"ccMIDROW",value:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[n]}p.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}},{key:"outputDataUpdate",value:function(){var e=p.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))}},{key:"cueSplitAtTime",value:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}]),e}(),E=function(){function e(t,n,i){r(this,e),this.field=t||1,this.outputs=[n,i],this.channels=[new _(1,n),new _(2,i)],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 i(e,[{key:"getHandler",value:function(e){return this.channels[e].getHandler()}},{key:"setHandler",value:function(e,t){this.channels[e].setHandler(t)}},{key:"addData",value:function(e,t){var n,r,i,a=!1;this.lastTime=e,p.setTime(e);for(var o=0;o<t.length;o+=2)if(r=127&t[o],i=127&t[o+1],0!==r||0!==i){if(p.log("DATA","["+v([t[o],t[o+1]])+"] -> ("+v([r,i])+")"),n=this.parseCmd(r,i),n||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),!n&&(a=this.parseChars(r,i)))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?");n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,p.log("WARNING","Couldn't parse cleaned data "+v([r,i])+" orig: "+v([t[o],t[o+1]])))}else this.dataCounters.padding+=2}},{key:"parseCmd",value:function(e,t){var n=null,r=(20===e||28===e)&&32<=t&&t<=47,i=(23===e||31===e)&&33<=t&&t<=35;if(!r&&!i)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,p.log("DEBUG","Repeated command ("+v([e,t])+") is dropped"),!0;n=20===e||23===e?1:2;var a=this.channels[n-1];return 20===e||28===e?32===t?a.ccRCL():33===t?a.ccBS():34===t?a.ccAOF():35===t?a.ccAON():36===t?a.ccDER():37===t?a.ccRU(2):38===t?a.ccRU(3):39===t?a.ccRU(4):40===t?a.ccFON():41===t?a.ccRDC():42===t?a.ccTR():43===t?a.ccRTD():44===t?a.ccEDM():45===t?a.ccCR():46===t?a.ccENM():47===t&&a.ccEOC():a.ccTO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0}},{key:"parseMidrow",value:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return p.log("ERROR","Mismatch channel in midrow parsing"),!1;return this.channels[n-1].ccMIDROW(t),p.log("DEBUG","MIDROW ("+v([e,t])+")"),!0}return!1}},{key:"parsePAC",value:function(e,t){var n=null,r=null,i=(17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127,a=(16===e||24===e)&&64<=t&&t<=95;if(!i&&!a)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;n=e<=23?1:2,r=64<=t&&t<=95?1===n?l[e]:f[e]:1===n?c[e]:d[e];var o=this.interpretPAC(r,t);return this.channels[n-1].setPAC(o),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0}},{key:"interpretPAC",value:function(e,t){var n=t,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r}},{key:"parseChars",value:function(e,t){var n=null,r=null,i=null;if(e>=25?(n=2,i=e-8):(n=1,i=e),17<=i&&i<=19){var a=t;a=17===i?t+80:18===i?t+112:t+144,p.log("INFO","Special char '"+o(a)+"' in channel "+n),r=[a]}else 32<=e&&e<=127&&(r=0===t?[e]:[e,t]);if(r){var s=v(r);p.log("DEBUG","Char codes = "+s.join(",")),this.lastCmdA=null,this.lastCmdB=null}return r}},{key:"parseBackgroundAttributes",value:function(e,t){var n,r,i,a,o=(16===e||24===e)&&32<=t&&t<=47,s=(23===e||31===e)&&45<=t&&t<=47;return!(!o&&!s)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=h[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,a=this.channels[i-1],a.setBkgData(n),this.lastCmdA=null,this.lastCmdB=null,!0)}},{key:"reset",value:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null}},{key:"cueSplitAtTime",value:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}}]),e}();n.default=E},{}],50:[function(e,t,n){"use strict";var r=e(56),i={newCue:function(e,t,n,i){for(var a,o,s,u,l,c=window.VTTCue||window.TextTrackCue,f=0;f<i.rows.length;f++)if(a=i.rows[f],s=!0,u=0,l="",!a.isEmpty()){for(var d=0;d<a.chars.length;d++)a.chars[d].uchar.match(/\s/)&&s?u++:(l+=a.chars[d].uchar,s=!1);a.cueStartTime=t,t===n&&(n+=1e-4),o=new c(t,n,(0,r.fixLineBreaks)(l.trim())),u>=16?u--:u++,navigator.userAgent.match(/Firefox\//)?o.line=f+1:o.line=f>7?f-2:f+1,o.align="left",o.position=Math.max(0,Math.min(100,u/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),e.addCue(o)}}};t.exports=i},{56:56}],51:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e(52),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(){function e(t,n,i,a){r(this,e),this.hls=t,this.defaultEstimate_=a,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new o.default(n),this.fast_=new o.default(i)}return i(e,[{key:"sample",value:function(e,t){e=Math.max(e,this.minDelayMs_);var n=8e3*t/e,r=e/1e3;this.fast_.sample(r,n),this.slow_.sample(r,n)}},{key:"canEstimate",value:function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"destroy",value:function(){}}]),e}();n.default=s},{52:52}],52:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t){r(this,e),this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=0,this.totalWeight_=0}return i(e,[{key:"sample",value:function(e,t){var n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}},{key:"getTotalWeight",value:function(){return this.totalWeight_}},{key:"getEstimate",value:function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/e}return this.estimate_}}]),e}();n.default=a},{}],53:[function(e,t,n){"use strict";function r(){}function i(e,t){return t="["+e+"] > "+t}function a(e){var t=self.console[e];return t?function(){for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];r[0]&&(r[0]=i(e,r[0])),t.apply(self.console,r)}:r}function o(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];n.forEach(function(t){l[t]=e[t]?e[t].bind(e):a(t)})}Object.defineProperty(n,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u={trace:r,debug:r,log:r,warn:r,info:r,error:r},l=u;n.enableLogs=function(e){if(!0===e||"object"===(void 0===e?"undefined":s(e))){o(e,"debug","log","info","warn","error");try{l.log()}catch(e){l=u}}else l=u},n.logger=l},{}],54:[function(e,t,n){"use strict";var r={toString:function(e){for(var t="",n=e.length,r=0;r<n;r++)t+="["+e.start(r).toFixed(3)+","+e.end(r).toFixed(3)+"]";return t}};t.exports=r},{}],55:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){function e(e){return"string"==typeof e&&(!!a[e.toLowerCase()]&&e.toLowerCase())}function t(e){return"string"==typeof e&&(!!o[e.toLowerCase()]&&e.toLowerCase())}function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}function r(r,a,o){var s=this,u=function(){if("undefined"!=typeof navigator)return/MSIE\s8\.0/.test(navigator.userAgent)}(),l={};u?s=document.createElement("custom"):l.enumerable=!0,s.hasBeenReset=!1;var c="",f=!1,d=r,h=a,p=o,v=null,y="",g=!0,m="auto",b="start",_=50,E="middle",T=50,w="middle";if(Object.defineProperty(s,"id",n({},l,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(s,"pauseOnExit",n({},l,{get:function(){return f},set:function(e){f=!!e}})),Object.defineProperty(s,"startTime",n({},l,{get:function(){return d},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"endTime",n({},l,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"text",n({},l,{get:function(){return p},set:function(e){p=""+e,this.hasBeenReset=!0}})),Object.defineProperty(s,"region",n({},l,{get:function(){return v},set:function(e){v=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"vertical",n({},l,{get:function(){return y},set:function(t){var n=e(t);if(!1===n)throw new SyntaxError("An invalid or illegal string was specified.");y=n,this.hasBeenReset=!0}})),Object.defineProperty(s,"snapToLines",n({},l,{get:function(){return g},set:function(e){g=!!e,this.hasBeenReset=!0}})),Object.defineProperty(s,"line",n({},l,{get:function(){return m},set:function(e){if("number"!=typeof e&&e!==i)throw new SyntaxError("An invalid number or illegal string was specified.");m=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"lineAlign",n({},l,{get:function(){return b},set:function(e){var n=t(e);if(!n)throw new SyntaxError("An invalid or illegal string was specified.");b=n,this.hasBeenReset=!0}})),Object.defineProperty(s,"position",n({},l,{get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",n({},l,{get:function(){return E},set:function(e){var n=t(e);if(!n)throw new SyntaxError("An invalid or illegal string was specified.");E=n,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",n({},l,{get:function(){return T},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");T=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",n({},l,{get:function(){return w},set:function(e){var n=t(e);if(!n)throw new SyntaxError("An invalid or illegal string was specified.");w=n,this.hasBeenReset=!0}})),s.displayState=void 0,u)return s}if("undefined"!=typeof window&&window.VTTCue)return window.VTTCue;var i="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(e,t,n){"use strict";function r(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new f,this.regionList=[]}function i(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+(0|r)/1e3}var n=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return n?n[3]?t(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?t(n[1],n[2],0,n[4]):t(0,n[1],n[2],n[4]):null}function a(){this.values=Object.create(null)}function o(e,t,n,r){var i=r?e.split(r):[e];for(var a in i)if("string"==typeof i[a]){var o=i[a].split(n);if(2===o.length){var s=o[0],u=o[1];t(s,u)}}}function s(e,t,n){function r(){var t=i(e);if(null===t)throw new Error("Malformed timestamp: "+u);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function s(){e=e.replace(/^\s+/,"")}var u=e;if(s(),t.startTime=r(),s(),"--\x3e"!==e.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+u);e=e.substr(3),s(),t.endTime=r(),s(),function(e,t){var r=new a;o(e,function(e,t){switch(e){case"region":for(var i=n.length-1;i>=0;i--)if(n[i].id===t){r.set(e,n[i].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),o=a[0];r.integer(e,o),r.percent(e,o)&&r.set("snapToLines",!1),r.alt(e,o,["auto"]),2===a.length&&r.alt("lineAlign",a[1],["start",h,"end"]);break;case"position":a=t.split(","),r.percent(e,a[0]),2===a.length&&r.alt("positionAlign",a[1],["start",h,"end","line-left","line-right","auto"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start",h,"end","left","right"])}},/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");var i=r.get("line","auto");"auto"===i&&-1===d.line&&(i=-1),t.line=i,t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align",h);var s=r.get("position","auto");"auto"===s&&50===d.position&&(s="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=s}(e,t)}function u(e){return e.replace(/<br(?: \/)?>/gi,"\n")}Object.defineProperty(n,"__esModule",{value:!0}),n.fixLineBreaks=void 0;var l=e(55),c=function(e){return e&&e.__esModule?e:{default:e}}(l),f=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}};a.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,n){for(var r=0;r<n.length;++r)if(t===n[r]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var d=new c.default(0,0,0),h="middle"===d.align?"middle":"center";r.prototype={parse:function(e){function t(){var e=n.buffer,t=0;for(e=u(e);t<e.length&&"\r"!==e[t]&&"\n"!==e[t];)++t;var r=e.substr(0,t);return"\r"===e[t]&&++t,"\n"===e[t]&&++t,n.buffer=e.substr(t),r}var n=this;e&&(n.buffer+=n.decoder.decode(e,{stream:!0}));try{var r;if("INITIAL"===n.state){if(!/\r\n|\n/.test(n.buffer))return this;r=t();var i=r.match(/^WEBVTT([ \t].*)?$/);if(!i||!i[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var a=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;switch(a?a=!1:r=t(),n.state){case"HEADER":/:/.test(r)?function(e){o(e,function(e,t){switch(e){case"Region":console.log("parse region",t)}},/:/)}(r):r||(n.state="ID");continue;case"NOTE":r||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){n.state="NOTE";break}if(!r)continue;if(n.cue=new c.default(0,0,""),n.state="CUE",-1===r.indexOf("--\x3e")){n.cue.id=r;continue}case"CUE":try{s(r,n.cue,n.regionList)}catch(e){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":var l=-1!==r.indexOf("--\x3e");if(!r||l&&(a=!0)){n.oncue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}n.cue.text&&(n.cue.text+="\n"),n.cue.text+=r;continue;case"BADCUE":r||(n.state="ID");continue}}}catch(e){"CUETEXT"===n.state&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state="INITIAL"===n.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new Error("Malformed WebVTT signature.")}catch(e){throw e}return e.onflush&&e.onflush(),this}},n.fixLineBreaks=u,n.default=r},{55:55}],57:[function(e,t,n){"use strict";var r=e(56),i=function(e){return e&&e.__esModule?e:{default:e}}(r),a=function(e,t,n){return e.substr(n||0,t.length)===t},o=function(e){var t=parseInt(e.substr(-3)),n=parseInt(e.substr(-6,2)),r=parseInt(e.substr(-9,2)),i=e.length>9?parseInt(e.substr(0,e.indexOf(":"))):0;return isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i)?-1:(t+=1e3*n,t+=6e4*r,t+=36e5*i)},s=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return(t>>>0).toString()},u=function(e,t,n){var r=e[t],i=e[r.prevCC];if(!i||!i.new&&r.new)return e.ccOffset=e.presentationOffset=r.start,void(r.new=!1);for(;i&&i.new;)e.ccOffset+=r.start-i.start,r.new=!1,r=i,i=e[r.prevCC];e.presentationOffset=n},l={parse:function(e,t,n,r,l,c){var f=/\r\n|\n\r|\n|\r/g,d=String.fromCharCode.apply(null,new Uint8Array(e)).trim().replace(f,"\n").split("\n"),h="00:00.000",p=0,v=0,y=0,g=[],m=void 0,b=!0,_=new i.default;_.oncue=function(e){var t=n[r],i=n.ccOffset;t&&t.new&&(void 0!==v?i=n.ccOffset=t.start:u(n,r,y)),y&&(i=y+n.ccOffset-n.presentationOffset),e.startTime+=i-v,e.endTime+=i-v,e.id=s(e.startTime)+s(e.endTime)+s(e.text),e.text=decodeURIComponent(escape(e.text)),e.endTime>0&&g.push(e)},_.onparsingerror=function(e){m=e},_.onflush=function(){if(m&&c)return void c(m);l(g)},d.forEach(function(e){if(b){if(a(e,"X-TIMESTAMP-MAP=")){b=!1,e.substr(16).split(",").forEach(function(e){a(e,"LOCAL:")?h=e.substr(6):a(e,"MPEGTS:")&&(p=parseInt(e.substr(7)))});try{t=t<0?t+8589934592:t,p-=t,v=o(h)/1e3,y=p/9e4,-1===v&&(m=new Error("Malformed X-TIMESTAMP-MAP: "+e))}catch(t){m=new Error("Malformed X-TIMESTAMP-MAP: "+e)}return}""===e&&(b=!1)}_.parse(e+"\n")}),_.flush()}};t.exports=l},{56:56}],58:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e(53),o=function(){function e(t){r(this,e),t&&t.xhrSetup&&(this.xhrSetup=t.xhrSetup)}return i(e,[{key:"destroy",value:function(){this.abort(),this.loader=null}},{key:"abort",value:function(){var e=this.loader;e&&4!==e.readyState&&(this.stats.aborted=!0,e.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null}},{key:"load",value:function(e,t,n){this.context=e,this.config=t,this.callbacks=n,this.stats={trequest:performance.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()}},{key:"loadInternal",value:function(){var e,t=this.context;e="undefined"!=typeof XDomainRequest?this.loader=new XDomainRequest:this.loader=new XMLHttpRequest;var n=this.stats;n.tfirst=0,n.loaded=0;var r=this.xhrSetup;try{if(r)try{r(e,t.url)}catch(n){e.open("GET",t.url,!0),r(e,t.url)}e.readyState||e.open("GET",t.url,!0)}catch(n){return void this.callbacks.onError({code:e.status,text:n.message},t)}t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),e.send()}},{key:"readystatechange",value:function(e){var t=e.currentTarget,n=t.readyState,r=this.stats,i=this.context,o=this.config;if(!r.aborted&&n>=2)if(window.clearTimeout(this.requestTimeout),0===r.tfirst&&(r.tfirst=Math.max(performance.now(),r.trequest)),4===n){var s=t.status;if(s>=200&&s<300){r.tload=Math.max(r.tfirst,performance.now());var u=void 0,l=void 0;"arraybuffer"===i.responseType?(u=t.response,l=u.byteLength):(u=t.responseText,l=u.length),r.loaded=r.total=l;var c={url:t.responseURL,data:u};this.callbacks.onSuccess(c,r,i)}else r.retry>=o.maxRetry||s>=400&&s<499?(a.logger.error(s+" while loading "+i.url),this.callbacks.onError({code:s,text:t.statusText},i)):(a.logger.warn(s+" while loading "+i.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(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total);var n=this.callbacks.onProgress;n&&n(t,this.context,null)}}]),e}();n.default=o},{53:53}]},{},[40])(40)})},function(e,t,n){!function(t,r){e.exports=r(n(12),n(0))}(0,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var o=i.get;if(void 0!==o)return o.call(r)},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),l=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(2),f=function(e){function t(e,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r(this,t),t._logger.debug("Creating adapter. Shaka version: "+l.default.Player.version);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,a));return o._shaka=new l.default.Player(e),o._shaka.configure(a),o._addBindings(),o}return a(t,e),s(t,null,[{key:"canPlayType",value:function(e){var n="string"==typeof e&&e.toLowerCase()===t._dashMimeType;return t._logger.debug("canPlayType result for mimeType: "+e+" is "+n.toString()),n}},{key:"isSupported",value:function(){l.default.polyfill.installAll();var e=l.default.Player.isBrowserSupported();return t._logger.debug("isSupported:"+e),e}}]),s(t,[{key:"_addBindings",value:function(){this._shaka.addEventListener("adaptation",this._onAdaptation.bind(this)),this._shaka.addEventListener("error",this._onError.bind(this))}},{key:"_removeBindings",value:function(){this._shaka.removeEventListener("adaptation",this._onAdaptation),this._shaka.removeEventListener("error",this._onError)}},{key:"load",value:function(){var e=this;return this._loadPromise||(this._loadPromise=new Promise(function(n,r){e._sourceObj&&e._sourceObj.url&&e._shaka.load(e._sourceObj.url).then(function(){var r={tracks:e._getParsedTracks()};t._logger.debug("The source has been loaded successfully"),n(r)}).catch(function(t){r(t),e._onError(t)})})),this._loadPromise}},{key:"destroy",value:function(){t._logger.debug("destroy"),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),this._loadPromise=null,this._removeBindings(),this._shaka.destroy()}},{key:"_getVideoTracks",value:function(){var e=this._shaka.getVariantTracks(),t=e.filter(function(e){return e.active})[0];return e.filter(function(e){return e.audioId===t.audioId})}},{key:"_getAudioTracks",value:function(){var e=this._shaka.getVariantTracks(),t=e.filter(function(e){return e.active})[0];return e.filter(function(e){return e.videoId===t.videoId})}},{key:"_getParsedTracks",value:function(){var e=this._getParsedVideoTracks(),t=this._getParsedAudioTracks(),n=this._getParsedTextTracks();return e.concat(t).concat(n)}},{key:"_getParsedVideoTracks",value:function(){var e=this._getVideoTracks(),t=[];if(e)for(var n=0;n<e.length;n++){var r={id:e[n].id,bandwidth:e[n].bandwidth,active:e[n].active,label:e[n].label,index:n};t.push(new c.VideoTrack(r))}return t}},{key:"_getParsedAudioTracks",value:function(){var e=this._getAudioTracks(),t=[];if(e)for(var n=0;n<e.length;n++){var r={id:e[n].id,active:e[n].active,label:e[n].label,language:e[n].language,index:n};t.push(new c.AudioTrack(r))}return t}},{key:"_getParsedTextTracks",value:function(){var e=this._shaka.getTextTracks(),t=[];if(e)for(var n=0;n<e.length;n++){var r={kind:e[n].kind?e[n].kind+"s":"",active:e[n].active,label:e[n].label,language:e[n].language,index:n};t.push(new c.TextTrack(r))}return t}},{key:"selectVideoTrack",value:function(e){var t=this._getVideoTracks();if(e instanceof c.VideoTrack&&t){var n=t[e.index];n&&(this._shaka.configure({abr:{enabled:!1}}),n.active||(this._shaka.selectVariantTrack(t[e.index],!0),this._onTrackChanged(e)))}}},{key:"selectAudioTrack",value:function(e){e instanceof c.AudioTrack&&!e.active&&(this._shaka.selectAudioLanguage(e.language),this._onTrackChanged(e))}},{key:"selectTextTrack",value:function(e){e instanceof c.TextTrack&&!e.active&&("subtitles"===e.kind||"captions"===e.kind)&&(this._shaka.selectTextLanguage(e.language),this._onTrackChanged(e))}},{key:"enableAdaptiveBitrate",value:function(){this._shaka.configure({abr:{enabled:!0}})}},{key:"_onAdaptation",value:function(){var e=this._getParsedVideoTracks().filter(function(e){return e.active})[0];this._onTrackChanged(e)}},{key:"_onError",value:function(e){t._logger.error(e)}},{key:"src",get:function(){return this._loadPromise&&this._sourceObj?this._sourceObj.url:""}}]),t}(c.BaseMediaSourceAdapter);f.id="DashAdapter",f._logger=c.BaseMediaSourceAdapter.getLogger(f.id),f._dashMimeType="application/dash+xml",t.default=f,f.isSupported()&&(0,c.registerMediaSourceAdapter)(f)},function(t,n){t.exports=e},function(e,n){e.exports=t}])})},function(e,t,n){var r;!function(){var i={};(function(e){function t(e,t){var n=e.split("."),r=uo;n[0]in r||!r.execScript||r.execScript("var "+n[0]);for(var i;n.length&&(i=n.shift());)n.length||void 0===t?r=r[i]?r[i]:r[i]={}:r[i]=t}function n(e){function t(){}var n=pt;t.prototype=n.prototype,e.Be=n.prototype,e.prototype=new t,e.prototype.constructor=e,e.ye=function(e,t,r){return n.prototype[t].apply(e,Array.prototype.slice.call(arguments,2))}}function r(e){this.c=Math.exp(Math.log(.5)/e),this.b=this.a=0}function i(e,t,n){var r=Math.pow(e.c,t);n=n*(1-r)+r*e.a,isNaN(n)||(e.a=n,e.b+=t)}function a(e){return e.a/(1-Math.pow(e.c,e.b))}function o(){this.c=new r(2),this.f=new r(5),this.a=0,this.b=5e5}function s(){}function u(e,t,n,r){this.severity=e,this.category=t,this.code=n,this.data=Array.prototype.slice.call(arguments,3)}function l(e){var t;e instanceof l?(c(this,e.aa),this.Ba=e.Ba,this.ca=e.ca,f(this,e.Ja),this.W=e.W,d(this,g(e.a)),this.ta=e.ta):e&&(t=String(e).match(lo))?(c(this,t[1]||"",!0),this.Ba=h(t[2]||""),this.ca=h(t[3]||"",!0),f(this,t[4]),this.W=h(t[5]||"",!0),d(this,t[6]||"",!0),this.ta=h(t[7]||"")):this.a=new y(null)}function c(e,t,n){e.aa=n?h(t,!0):t,e.aa&&(e.aa=e.aa.replace(/:$/,""))}function f(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.Ja=t}else e.Ja=null}function d(e,t,n){t instanceof y?e.a=t:(n||(t=p(t,po)),e.a=new y(t))}function h(e,t){return e?t?decodeURI(e):decodeURIComponent(e):""}function p(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,v),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function v(e){return e=e.charCodeAt(0),"%"+(e>>4&15).toString(16)+(15&e).toString(16)}function y(e){this.b=e||null}function g(e){var t=new y;if(t.b=e.b,e.a){var n,r={};for(n in e.a)r[n]=e.a[n].concat();t.a=r,t.c=e.c}return t}function m(e,t){return e.reduce(function(e,t,n){return t.catch(e.bind(null,n))}.bind(null,t),Promise.reject())}function b(e,t){return e.concat(t)}function _(){}function E(e){return null!=e}function T(e){return function(t){return t!=e}}function w(e,t,n){return n.indexOf(e)==t}function k(e,t){if(!t.length)return e;var n=t.map(function(e){return new l(e)});return e.map(function(e){return new l(e)}).map(function(e){return n.map(e.resolve.bind(e))}).reduce(b,[]).map(function(e){return e.toString()})}function S(e,t){return{keySystem:e,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:t||[],keyIds:[]}}function O(e,t,n,r,i){var a,o=i in r;for(a in t){var s=i+"."+a,u=o?r[i]:n[a],l=!!{".abr.manager":!0}[s]||!!{serverCertificate:!0}[a];(o||a in e)&&(void 0===t[a]?void 0===u||o?delete e[a]:e[a]=u:l?e[a]=t[a]:"object"==typeof e[a]&&"object"==typeof t[a]?O(e[a],t[a],u,r,s):typeof t[a]==typeof u&&(e[a]=t[a]))}}function A(e){return JSON.parse(JSON.stringify(e))}function P(){var e,t,n=new Promise(function(n,r){e=n,t=r});return n.resolve=e,n.reject=t,n}function R(e){this.f=!1,this.a=[],this.b=[],this.c=[],this.h=e||null}function D(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function L(e,t){return{uris:e,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:t}}function x(e,t){for(var n=[],r=0;r<e.length;++r){for(var i=!1,a=0;a<n.length&&!(i=t?t(e[r],n[a]):e[r]===n[a]);++a);i||n.push(e[r])}return n}function I(e,t,n){for(var r=0;r<e.length;++r)if(n(e[r],t))return r;return-1}function M(){this.a={}}function C(){this.a=new M}function N(e,t,n,r){e.a&&(t=new F(t,n,r),e.a.push(n,t))}function U(e,t,n,r){N(e,t,n,function(e){this.ha(t,n),r(e)}.bind(e))}function j(e){if(e.a){var t,n=e.a,r=[];for(t in n.a)r.push.apply(r,n.a[t]);for(n=0;n<r.length;++n)r[n].ha();e.a.a={}}}function F(e,t,n){this.target=e,this.type=t,this.a=n,this.target.addEventListener(t,n,!1)}function B(e){return!e||!Object.keys(e).length}function G(e){return Object.keys(e).map(function(t){return e[t]})}function V(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=t(e[r],r),n},{})}function H(e,t){return Object.keys(e).every(function(n){return t(n,e[n])})}function K(e,t){Object.keys(e).forEach(function(n){t(n,e[n])})}function Y(e){if(!e)return"";e=new Uint8Array(e),239==e[0]&&187==e[1]&&191==e[2]&&(e=e.subarray(3)),e=escape(X(e));try{return decodeURIComponent(e)}catch(e){throw new u(2,2,2004)}}function W(e,t,n){if(!e)return"";if(!n&&e.byteLength%2)throw new u(2,2,2004);if(e instanceof ArrayBuffer)var r=e;else n=new Uint8Array(e.byteLength),n.set(new Uint8Array(e)),r=n.buffer;e=Math.floor(e.byteLength/2),n=new Uint16Array(e),r=new DataView(r);for(var i=0;i<e;i++)n[i]=r.getUint16(2*i,t);return X(n)}function q(e){var t=new Uint8Array(e);if(239==t[0]&&187==t[1]&&191==t[2])return Y(t);if(254==t[0]&&255==t[1])return W(t.subarray(2),!1);if(255==t[0]&&254==t[1])return W(t.subarray(2),!0);var n=function(e,t){return e.byteLength<=t||32<=e[t]&&126>=e[t]}.bind(null,t);if(!t[0]&&!t[2])return W(e,!1);if(!t[1]&&!t[3])return W(e,!0);if(n(0)&&n(1)&&n(2)&&n(3))return Y(e);throw new u(2,2,2003)}function z(e){e=unescape(encodeURIComponent(e));for(var t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t.buffer}function X(e){for(var t="",n=0;n<e.length;n+=16e3)t+=String.fromCharCode.apply(null,e.subarray(n,n+16e3));return t}function $(e){this.a=null,this.b=function(){this.a=null,e()}.bind(this)}function J(e){e.cancel(),e.a=setTimeout(e.b,500)}function Q(t,n){var r=void 0==n||n,i=e.btoa(String.fromCharCode.apply(null,t)).replace(/\+/g,"-").replace(/\//g,"_");return r?i:i.replace(/=*$/,"")}function Z(t){t=e.atob(t.replace(/-/g,"+").replace(/_/g,"/"));for(var n=new Uint8Array(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}function ee(t){for(var n=new Uint8Array(t.length/2),r=0;r<t.length;r+=2)n[r/2]=e.parseInt(t.substr(r,2),16);return n}function te(e){for(var t="",n=0;n<e.length;++n){var r=e[n].toString(16);1==r.length&&(r="0"+r),t+=r}return t}function ne(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!=t.length)return!1;for(var n=0;n<e.length;++n)if(e[n]!=t[n])return!1;return!0}function re(e,t,n,r){this.j=this.i=this.v=null,this.J=!1,this.b=null,this.f=new C,this.a=[],this.o=[],this.l=new P,this.ka=e,this.h=null,this.g=function(e){this.l.reject(e),t(e)}.bind(this),this.A={},this.Ca=n,this.la=r,this.B=new $(this.Kd.bind(this)),this.ja=this.c=!1,this.G=[],this.ia=!1,this.O=setInterval(this.Jd.bind(this),1e3),this.l.catch(function(){})}function ie(e,t){if(!e.i)return U(e.f,t,"encrypted",function(){this.g(new u(2,6,6010))}.bind(e)),Promise.resolve();e.j=t,U(e.f,e.j,"play",e.qd.bind(e));var n=e.j.setMediaKeys(e.i),n=n.catch(function(e){return Promise.reject(new u(2,6,6003,e.message))}),r=null;return e.b.serverCertificate&&(r=e.i.setServerCertificate(e.b.serverCertificate).then(function(){}).catch(function(e){return Promise.reject(new u(2,6,6004,e.message))})),Promise.all([n,r]).then(function(){if(this.c)return Promise.reject();oe(this),this.b.initData.length||this.o.length||N(this.f,this.j,"encrypted",this.fd.bind(this))}.bind(e)).catch(function(e){return this.c?Promise.resolve():Promise.reject(e)}.bind(e))}function ae(e,t){return Promise.all(t.map(function(e){return pe(this,e).then(function(e){if(e){for(var t=new P,n=0;n<this.a.length;n++)if(this.a[n].ba==e){this.a[n].ib=t;break}return Promise.all([e.remove(),t])}}.bind(this))}.bind(e)))}function oe(e){var t=e.b?e.b.initData:[];return t.forEach(function(e){ve(this,e.initDataType,e.initData)}.bind(e)),e.o.forEach(function(e){pe(this,e)}.bind(e)),t.length||e.o.length||e.l.resolve(),e.l}function se(e){return e.a.map(function(e){return e.ba.sessionId})}function ue(t,n,r,i,a){var o=fe(t);n.periods.forEach(function(t){t.variants.forEach(function(t){o&&(t.drmInfos=[o]),t.drmInfos.forEach(function(n){ce(this,n),e.cast&&e.cast.__platform__&&"com.microsoft.playready"==n.keySystem&&(n.keySystem="com.chromecast.playready");var o=i[n.keySystem];o||(o={audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:r?"required":"optional",sessionTypes:[r?"persistent-license":"temporary"],label:n.keySystem,drmInfos:[]},i[n.keySystem]=o,a.push(n.keySystem)),o.drmInfos.push(n),n.distinctiveIdentifierRequired&&(o.distinctiveIdentifier="required"),n.persistentStateRequired&&(o.persistentState="required");var s=[];t.video&&s.push(t.video),t.audio&&s.push(t.audio),s.forEach(function(e){var t="video"==e.type?o.videoCapabilities:o.audioCapabilities,r=("video"==e.type?n.videoRobustness:n.audioRobustness)||"",i=e.mimeType;e.codecs&&(i+='; codecs="'+e.codecs+'"'),t.push({robustness:r,contentType:i})}.bind(this))}.bind(this))}.bind(this))}.bind(t))}function le(e,t,n){if(1==n.length&&""==n[0])return Promise.reject(new u(2,6,6e3));var r=new P,i=r;return[!0,!1].forEach(function(e){n.forEach(function(n){var r=t[n];r.drmInfos.some(function(e){return!!e.licenseServerUri})==e&&(r.audioCapabilities.length||delete r.audioCapabilities,r.videoCapabilities.length||delete r.videoCapabilities,i=i.catch(function(){return this.c?Promise.reject():navigator.requestMediaKeySystemAccess(n,[r])}.bind(this)))}.bind(this))}.bind(e)),i=i.catch(function(){return Promise.reject(new u(2,6,6001))}),i=i.then(function(e){if(this.c)return Promise.reject();var n=0<=navigator.userAgent.indexOf("Edge/"),r=e.getConfiguration();return this.v=(r.audioCapabilities||[]).concat(r.videoCapabilities||[]).map(function(e){return e.contentType}),n&&(this.v=null),n=t[e.keySystem],de(this,e.keySystem,n,n.drmInfos),this.b.licenseServerUri?e.createMediaKeys():Promise.reject(new u(2,6,6012))}.bind(e)).then(function(e){if(this.c)return Promise.reject();this.i=e,this.J=!0}.bind(e)).catch(function(e){return this.c?Promise.resolve():(this.v=this.b=null,e instanceof u?Promise.reject(e):Promise.reject(new u(2,6,6002,e.message)))}.bind(e)),r.reject(),i}function ce(e,t){var n=t.keySystem;if(n){if(!t.licenseServerUri){var r=e.h.servers[n];r&&(t.licenseServerUri=r)}t.keyIds||(t.keyIds=[]),(n=e.h.advanced[n])&&(t.distinctiveIdentifierRequired||(t.distinctiveIdentifierRequired=n.distinctiveIdentifierRequired),t.persistentStateRequired||(t.persistentStateRequired=n.persistentStateRequired),t.videoRobustness||(t.videoRobustness=n.videoRobustness),t.audioRobustness||(t.audioRobustness=n.audioRobustness),t.serverCertificate||(t.serverCertificate=n.serverCertificate))}}function fe(t){if(B(t.h.clearKeys))return null;var n,r=[],i=[];for(n in t.h.clearKeys){var a=t.h.clearKeys[n],o=ee(n),a=ee(a),o={kty:"oct",kid:Q(o,!1),k:Q(a,!1)};r.push(o),i.push(o.kid)}return t=JSON.stringify({keys:r}),i=JSON.stringify({kids:i}),i=[{initData:new Uint8Array(z(i)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+e.btoa(t),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:i,keyIds:[]}}function de(e,t,n,r){var i=[],a=[],o=[],s=[];he(r,i,a,o,s),e.b={keySystem:t,licenseServerUri:i[0],distinctiveIdentifierRequired:"required"==n.distinctiveIdentifier,persistentStateRequired:"required"==n.persistentState,audioRobustness:n.audioCapabilities?n.audioCapabilities[0].robustness:"",videoRobustness:n.videoCapabilities?n.videoCapabilities[0].robustness:"",serverCertificate:a[0],initData:o,keyIds:s}}function he(e,t,n,r,i){function a(e,t){return!(!e.keyId||e.keyId!=t.keyId)||e.initDataType==t.initDataType&&ne(e.initData,t.initData)}e.forEach(function(e){if(-1==t.indexOf(e.licenseServerUri)&&t.push(e.licenseServerUri),e.serverCertificate&&-1==I(n,e.serverCertificate,ne)&&n.push(e.serverCertificate),e.initData&&e.initData.forEach(function(e){-1==I(r,e,a)&&r.push(e)}),e.keyIds)for(var o=0;o<e.keyIds.length;++o)-1==i.indexOf(e.keyIds[o])&&i.push(e.keyIds[o])})}function pe(e,t){try{var n=e.i.createSession("persistent-license")}catch(t){var r=new u(2,6,6005,t.message);return e.g(r),Promise.reject(r)}N(e.f,n,"message",e.kc.bind(e)),N(e.f,n,"keystatuseschange",e.ec.bind(e));var i={initData:null,ba:n,loaded:!1,zb:1/0,ib:null};return e.a.push(i),n.load(t).then(function(e){if(!this.c){if(e)return i.loaded=!0,this.a.every(function(e){return e.loaded})&&this.l.resolve(),n;this.a.splice(this.a.indexOf(i),1),this.g(new u(2,6,6013))}}.bind(e),function(e){this.c||(this.a.splice(this.a.indexOf(i),1),this.g(new u(2,6,6005,e.message)))}.bind(e))}function ve(e,t,n){try{var r=e.ja?e.i.createSession("persistent-license"):e.i.createSession()}catch(t){return void e.g(new u(2,6,6005,t.message))}N(e.f,r,"message",e.kc.bind(e)),N(e.f,r,"keystatuseschange",e.ec.bind(e)),e.a.push({initData:n,ba:r,loaded:!1,zb:1/0,ib:null}),r.generateRequest(t,n.buffer).catch(function(e){if(!this.c){for(var t=0;t<this.a.length;++t)if(this.a[t].ba==r){this.a.splice(t,1);break}this.g(new u(2,6,6006,e.message))}}.bind(e))}function ye(e,t){for(var n,r=t.target,i=0;i<e.a.length;i++)if(e.a[i].ba==r){n=e.a[i].ib;break}i=L([e.b.licenseServerUri],e.h.retryParameters),i.body=t.message,i.method="POST","com.microsoft.playready"!=e.b.keySystem&&"com.chromecast.playready"!=e.b.keySystem||ge(i),e.ka.request(2,i).then(function(e){return this.c?Promise.reject():r.update(e.data).then(function(){n&&n.resolve()})}.bind(e),function(e){if(this.c)return Promise.resolve();e=new u(2,6,6007,e),this.g(e),n&&n.reject(e)}.bind(e)).catch(function(e){if(this.c)return Promise.resolve();e=new u(2,6,6008,e.message),this.g(e),n&&n.reject(e)}.bind(e))}function ge(e){var t=W(e.body,!0,!0);if(-1==t.indexOf("PlayReadyKeyMessage"))e.headers["Content-Type"]="text/xml; charset=utf-8";else{for(var t=(new DOMParser).parseFromString(t,"application/xml"),n=t.getElementsByTagName("HttpHeader"),r=0;r<n.length;++r)e.headers[n[r].querySelector("name").textContent]=n[r].querySelector("value").textContent;e.body=Z(t.querySelector("Challenge").textContent).buffer}}function me(){var e=[],t=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],n=[{videoCapabilities:t,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:t}],r={};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(t){var i=navigator.requestMediaKeySystemAccess(t,n).then(function(e){var n=e.getConfiguration().sessionTypes;return r[t]={persistentState:!!n&&0<=n.indexOf("persistent-license")},e.createMediaKeys()}).catch(function(){r[t]=null});e.push(i)}),Promise.all(e).then(function(){return r})}function be(e,t){var n=e.keySystem();return!t.drmInfos.length||t.drmInfos.some(function(e){return e.keySystem==n})}function _e(e,t){if(!e.length)return t;if(!t.length)return e;for(var n=[],r=0;r<e.length;r++)for(var i=0;i<t.length;i++)if(e[r].keySystem==t[i].keySystem){var a=e[r],i=t[i],o=[],o=o.concat(a.initData||[]),o=o.concat(i.initData||[]),s=[],s=s.concat(a.keyIds),s=s.concat(i.keyIds);n.push({keySystem:a.keySystem,licenseServerUri:a.licenseServerUri||i.licenseServerUri,distinctiveIdentifierRequired:a.distinctiveIdentifierRequired||i.distinctiveIdentifierRequired,persistentStateRequired:a.persistentStateRequired||i.persistentStateRequired,videoRobustness:a.videoRobustness||i.videoRobustness,audioRobustness:a.audioRobustness||i.audioRobustness,serverCertificate:a.serverCertificate||i.serverCertificate,initData:o,keyIds:s});break}return n}function Ee(e){this.f=null,this.c=e,this.h=0,this.g=1/0,this.a=this.b=null}function Te(e,t){go[e]=t.length?Oe.bind(null,t):t}function we(e,t,n){return e>=t?null:new VTTCue(e,t,n)}function ke(e,t,n,r){return Promise.resolve().then(function(){if(this.c)if(null==n||null==r)this.f.parseInit(t);else{for(var e=this.f.parseMedia(t,{periodStart:this.h,segmentStart:n,segmentEnd:r}),i=0;i<e.length&&!(e[i].startTime>=this.g);++i)this.c.addCue(e[i]);null==this.b&&(this.b=n),this.a=Math.min(r,this.g)}}.bind(e))}function Se(e,t){for(var n=e.c.cues,r=[],i=0;i<n.length;++i)t(n[i])&&r.push(n[i]);for(i=0;i<r.length;++i)e.c.removeCue(r[i])}function Oe(e){this.Na=e}function Ae(e){return!e||1==e.length&&1e-6>e.end(0)-e.start(0)?null:e.length?e.end(e.length-1):null}function Pe(e,t){return!(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0))&&(t>=e.start(0)&&t<=e.end(e.length-1))}function Re(e,t){if(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0))return 0;for(var n=0,r=e.length-1;0<=r&&e.end(r)>t;--r)n+=e.end(r)-Math.max(e.start(r),t);return n}function De(e,t,n){this.f=e,this.N=t,this.i=n,this.c={},this.a=null,this.b={},this.g=new C,this.h=!1}function Le(){var e={};return'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(t){e[t]=!!go[t]||MediaSource.isTypeSupported(t);var n=t.split(";")[0];e[n]=e[n]||e[t]}),e}function xe(e,t){e.a||(e.a=new Ee(e.i)),e.a.f=new go[t]}function Ie(e,t){if("text"==t)var n=e.a.b;else n=Me(e,t),n=!n||1==n.length&&1e-6>n.end(0)-n.start(0)?null:1==n.length&&0>n.start(0)?0:n.length?n.start(0):null;return n}function Me(e,t){try{return e.c[t].buffered}catch(e){return null}}function Ce(e,t,n,r,i){return"text"==t?ke(e.a,n,r,i):je(e,t,e.ie.bind(e,t,n))}function Ne(e,t){return"text"==t?e.a.remove(0,1/0):je(e,t,e.qc.bind(e,t,0,e.N.duration))}function Ue(e,t,n,r){return"text"==t?(e.a.h=n,null!=r&&(e.a.g=r),Promise.resolve()):(null==r&&(r=1/0),Promise.all([je(e,t,e.Ec.bind(e,t)),je(e,t,e.Zd.bind(e,t,n)),je(e,t,e.Xd.bind(e,t,r))]))}function je(e,t,n){if(e.h)return Promise.reject();if(n={start:n,p:new P},e.b[t].push(n),1==e.b[t].length)try{n.start()}catch(r){"QuotaExceededError"==r.name?n.p.reject(new u(2,3,3017,t)):n.p.reject(new u(2,3,3015,r)),Be(e,t)}return n.p}function Fe(e,t){if(e.h)return Promise.reject();var n,r=[];for(n in e.c){var i=new P,a={start:function(e){e.resolve()}.bind(null,i),p:i};e.b[n].push(a),r.push(i),1==e.b[n].length&&a.start()}return Promise.all(r).then(function(){var e;try{t()}catch(e){var n=Promise.reject(new u(2,3,3015,e))}for(e in this.c)Be(this,e);return n}.bind(e),function(){return Promise.reject()}.bind(e))}function Be(e,t){e.b[t].shift();var n=e.b[t][0];if(n)try{n.start()}catch(r){n.p.reject(new u(2,3,3015,r)),Be(e,t)}}function Ge(e,t,n){return n==t||e>=mo&&n==t.split("-")[0]||e>=bo&&n.split("-")[0]==t.split("-")[0]}function Ve(e){e=e.toLowerCase().split("-");var t=_o[e[0]];return t&&(e[0]=t),e.join("-")}function He(e,t,n){var r=e.video;return!(r&&(r.width<t.minWidth||r.width>t.maxWidth||r.width>n.width||r.height<t.minHeight||r.height>t.maxHeight||r.height>n.height||r.width*r.height<t.minPixels||r.width*r.height>t.maxPixels)||e.bandwidth<t.minBandwidth||e.bandwidth>t.maxBandwidth)}function Ke(e,t,n){var r=!1;return e.variants.forEach(function(e){var i=e.allowedByApplication;e.allowedByApplication=He(e,t,n),i!=e.allowedByApplication&&(r=!0)}),r}function Ye(e,t,n){var r=t.video,i=t.audio;for(t=0;t<n.variants.length;++t){var a=n.variants[t],o=e,s=i,u=r;(o&&o.J&&!be(o,a)?0:We(a.audio,o,s)&&We(a.video,o,u))||(n.variants.splice(t,1),--t)}for(t=0;t<n.textStreams.length;++t)e=n.textStreams[t],go[nt(e.mimeType,e.codecs)]||(n.textStreams.splice(t,1),--t)}function We(e,t,n){if(!e)return!0;var r=null;return t&&t.J&&(r=t.v),t=nt(e.mimeType,e.codecs),!(!go[t]&&!MediaSource.isTypeSupported(t)||r&&e.encrypted&&0>r.indexOf(t)||n&&(e.mimeType!=n.mimeType||e.codecs.split(".")[0]!=n.codecs.split(".")[0]))}function qe(e,t,n){var r=null;return Je(e.variants).map(function(e){var i;i=e.video&&e.audio?n==e.video.id&&t==e.audio.id:e.video&&n==e.video.id||e.audio&&t==e.audio.id;var a="";e.video&&(a+=e.video.codecs),e.audio&&(""!=a&&(a+=", "),a+=e.audio.codecs,r=e.audio.label);var o=e.audio?e.audio.codecs:null,s=e.video?e.video.codecs:null,u=null;e.video?u=e.video.mimeType:e.audio&&(u=e.audio.mimeType);var l=null;e.audio?l=e.audio.kind:e.video&&(l=e.video.kind);var c=x((e.audio?e.audio.roles:[]).concat(e.video?e.video.roles:[]));return{id:e.id,active:i,type:"variant",bandwidth:e.bandwidth,language:e.language,label:r,kind:l||null,width:e.video?e.video.width:null,height:e.video?e.video.height:null,frameRate:e.video?e.video.frameRate:void 0,mimeType:u,codecs:a,audioCodec:o,videoCodec:s,primary:e.primary,roles:c,videoId:e.video?e.video.id:null,audioId:e.audio?e.audio.id:null}})}function ze(e,t){return e.textStreams.map(function(e){return{id:e.id,active:t==e.id,type:"text",language:e.language,label:e.label,kind:e.kind,mimeType:e.mimeType,codecs:e.codecs||null,audioCodec:null,videoCodec:null,primary:e.primary,roles:e.roles}})}function Xe(e,t){for(var n=0;n<e.variants.length;n++)if(e.variants[n].id==t.id)return e.variants[n];return null}function $e(e,t){for(var n=0;n<e.textStreams.length;n++)if(e.textStreams[n].id==t.id)return e.textStreams[n];return null}function Je(e){return e.filter(function(e){return e.allowedByApplication&&e.allowedByKeySystem})}function Qe(e,t,n,r){var i=Je(e.variants),a=i.filter(function(e){return e.language==i[0].language});if(e=i.filter(function(e){return e.primary}),e.length&&(a=e),t){var o=Ve(t);[bo,mo,0].forEach(function(e){var t=!1;i.forEach(function(r){o=Ve(o);var i=Ve(r.language);Ge(e,o,i)&&(t?a.push(r):(a=[r],t=!0),n&&(n.audio=!0))})})}var s=r||"";return s&&(t=a.filter(function(e){return e.audio&&-1<e.audio.roles.indexOf(s)||e.video&&-1<e.video.roles.indexOf(s)}),t.length)?t:a}function Ze(e,t,n,r){var i=e.textStreams,a=i;if(e=i.filter(function(e){return e.primary}),e.length&&(a=e),t){var o=Ve(t);[bo,mo,0].forEach(function(e){var t=!1;i.forEach(function(r){var i=Ve(r.language);Ge(e,o,i)&&(t?a.push(r):(a=[r],t=!0),n&&(n.text=!0))})})}var s=r||"";return s&&(t=a.filter(function(e){return e&&-1<e.roles.indexOf(s)}),t.length)?t:a}function et(e,t,n){for(var r=0;r<n.length;r++)if(n[r].audio==e&&n[r].video==t)return n[r];return null}function tt(e,t,n){function r(e,t){return null==e?null==t:t.id==e}for(var i=0;i<n.length;i++)if(r(e,n[i].audio)&&r(t,n[i].video))return n[i];return null}function nt(e,t){var n=e;return t&&(n+='; codecs="'+t+'"'),n}function rt(e,t){for(var n=e.periods.length-1;0<n;--n)if(t>=e.periods[n].startTime)return n;return 0}function it(e,t){for(var n=0;n<e.periods.length;++n){var r=e.periods[n];if("text"==t.type){for(var i=0;i<r.textStreams.length;++i)if(r.textStreams[i]==t)return n}else for(i=0;i<r.variants.length;++i){var a=r.variants[i];if(a.audio==t||a.video==t||a.video&&a.video.trickModeVideo==t)return n}}return-1}function at(){this.f=null,this.b=!1,this.a=new o,this.h=[],this.g=[],this.j=!1,this.c=null,this.i={minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minBandwidth:0,maxBandwidth:1/0}}function ot(e,t){return t.filter(function(t){return He(t,e,{width:1/0,height:1/0})}).sort(function(e,t){return e.bandwidth-t.bandwidth})}function st(t,n){var r,i=n||{};for(r in i)this[r]=i[r];this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=e.performance&&e.performance.now?e.performance.now():Date.now(),this.type=t,this.isTrusted=!1,this.target=this.currentTarget=null,this.a=!1}function ut(e){return JSON.stringify(e,function(e,t){if("manager"!=e&&"function"!=typeof t){if(t instanceof Event||t instanceof st){var n,r={};for(n in t){var i=t[n];i&&"object"==typeof i||n in Event||(r[n]=i)}return r}if(t instanceof TimeRanges)for(r={__type__:"TimeRanges",length:t.length,start:[],end:[]},n=0;n<t.length;++n)r.start.push(t.start(n)),r.end.push(t.end(n));else r="number"==typeof t?isNaN(t)?"NaN":isFinite(t)?t:0>t?"-Infinity":"Infinity":t;return r}})}function lt(e){return JSON.parse(e,function(e,t){return"NaN"==t?NaN:"-Infinity"==t?-1/0:"Infinity"==t?1/0:t&&"object"==typeof t&&"TimeRanges"==t.__type__?ct(t):t})}function ct(e){return{length:e.length,start:function(t){return e.start[t]},end:function(t){return e.end[t]}}}function ft(e,t,n,r,i){this.J=e,this.l=t,this.B=n,this.G=r,this.v=i,this.c=this.j=this.h=!1,this.A="",this.a=this.i=null,this.b={video:{},player:{}},this.o=0,this.f={},this.g=null}function dt(e){for(var t in e.f){var n=e.f[t];delete e.f[t],n.reject(new u(1,7,7e3))}}function ht(e,t){var n=ut(t);e.a.sendMessage("urn:x-cast:com.google.shaka.v2",n,function(){},s)}function pt(){this.nb=new M,this.Ta=this}function vt(e,t,n){pt.call(this),this.c=e,this.b=t,this.h=this.f=this.g=this.i=this.j=null,this.a=new ft(n,this.ee.bind(this),this.fe.bind(this),this.ge.bind(this),this.Vb.bind(this)),yt(this)}function yt(e){e.a.init(),e.h=new C,Eo.forEach(function(e){N(this.h,this.c,e,this.te.bind(this))}.bind(e)),So.forEach(function(e){N(this.h,this.b,e,this.Id.bind(this))}.bind(e)),e.j={};for(var t in e.c)Object.defineProperty(e.j,t,{configurable:!1,enumerable:!0,get:e.se.bind(e,t),set:e.ue.bind(e,t)});e.i={};for(t in e.b)Object.defineProperty(e.i,t,{configurable:!1,enumerable:!0,get:e.Hd.bind(e,t)});e.g=new pt,e.g.Ta=e.j,e.f=new pt,e.f.Ta=e.i}function gt(e,t,n,r){pt.call(this),this.a=e,this.b=t,this.j={video:e,player:t},this.l=n||function(){},this.o=r||function(e){return e},this.i=!1,this.f=!0,this.h=this.g=this.c=null,mt(this)}function mt(t){var n=cast.receiver.CastReceiverManager.getInstance();n.onSenderConnected=t.jc.bind(t),n.onSenderDisconnected=t.jc.bind(t),n.onSystemVolumeChanged=t.Mc.bind(t),t.g=n.getCastMessageBus("urn:x-cast:com.google.cast.media"),t.g.onMessage=t.hd.bind(t),t.c=n.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),t.c.onMessage=t.vd.bind(t),n.start(),Eo.forEach(function(e){this.a.addEventListener(e,this.mc.bind(this,"video"))}.bind(t)),So.forEach(function(e){this.b.addEventListener(e,this.mc.bind(this,"player"))}.bind(t)),cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?t.b.Jb(3840,2160):t.b.Jb(1920,1080),t.b.addEventListener("loading",function(){this.f=!1,bt(this)}.bind(t)),t.a.addEventListener("playing",function(){this.f=!1,bt(this)}.bind(t)),t.a.addEventListener("pause",function(){bt(this)}.bind(t)),t.b.addEventListener("unloading",function(){this.f=!0,bt(this)}.bind(t)),t.a.addEventListener("ended",function(){e.setTimeout(function(){this.a&&this.a.ended&&(this.f=!0,bt(this))}.bind(this),5e3)}.bind(t))}function bt(e){Promise.resolve().then(function(){this.dispatchEvent(new st("caststatuschanged")),Tt(this,0)}.bind(e))}function _t(e,t,n){for(var r in t.player)e.b[r](t.player[r]);e.l(n),n=Promise.resolve();var i=e.a.autoplay;t.manifest&&(e.a.autoplay=!1,n=e.b.load(t.manifest,t.startTime),n.catch(function(e){this.b.dispatchEvent(new st("error",{detail:e}))}.bind(e))),n.then(function(){var e;for(e in t.video){var n=t.video[e];this.a[e]=n}for(e in t.playerAfterLoad)n=t.playerAfterLoad[e],this.b[e](n);this.a.autoplay=i,t.manifest&&(this.a.play(),Tt(this,0))}.bind(e))}function Et(e,t,n,r){e.i&&(e=ut(t),r?n.getCastChannel(r).send(e):n.broadcast(e))}function Tt(e,t,n){var r=Lo,r={mediaSessionId:0,playbackRate:e.a.playbackRate,playerState:e.f?r.IDLE:e.b.ka?r.Ac:e.a.paused?r.Bc:r.Cc,currentTime:e.a.currentTime,supportedMediaCommands:15,volume:{level:e.a.volume,muted:e.a.muted}};n&&(r.media=n),Et(e,{requestId:t,type:"MEDIA_STATUS",status:[r]},e.g)}function wt(e,t){var n=kt(e,t);return 1!=n.length?null:n[0]}function kt(e,t){return Array.prototype.filter.call(e.childNodes,function(e){return e.tagName==t})}function St(e){var t=e.firstChild;return t&&t.nodeType==Node.TEXT_NODE?e.textContent.trim():null}function Ot(e,t,n,r){var i=null;return e=e.getAttribute(t),null!=e&&(i=n(e)),null==i?void 0!=r?r:null:i}function At(e){return e?(e=Date.parse(e),isNaN(e)?null:Math.floor(e/1e3)):null}function Pt(e){return e&&(e=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(e))?(e=31536e3*Number(e[1]||null)+2592e3*Number(e[2]||null)+86400*Number(e[3]||null)+3600*Number(e[4]||null)+60*Number(e[5]||null)+Number(e[6]||null),isFinite(e)?e:null):null}function Rt(e){var t=/([0-9]+)-([0-9]+)/.exec(e);return t?(e=Number(t[1]),isFinite(e)?(t=Number(t[2]),isFinite(t)?{start:e,end:t}:null):null):null}function Dt(e){return e=Number(e),e%1?null:e}function Lt(e){return e=Number(e),!(e%1)&&0<e?e:null}function xt(e){return e=Number(e),!(e%1)&&0<=e?e:null}function It(e){var t;return e=(t=e.match(/^(\d+)\/(\d+)$/))?Number(t[1]/t[2]):Number(e),isNaN(e)?null:e}function Mt(e,t,n){e=Ut(e);var r=null,i=null,a=[],o=[],s=e.map(function(e){return e.keyId}).filter(E);if(0<s.length&&(i=s[0],s.some(T(i))))throw new u(2,4,4010);return n||(o=e.filter(function(e){return"urn:mpeg:dash:mp4protection:2011"!=e.sc||(r=e.init||r,!1)}),0<o.length&&(a=Nt(r,t,o),a.length||(a=[S("",r)]))),0<e.length&&(n||!o.length)&&(a=G(xo).map(function(e){return S(e,r)})),i&&a.forEach(function(e){e.initData.forEach(function(e){e.keyId=i})}),{Sb:i,ze:r,drmInfos:a,Ub:!0}}function Ct(e,t,n,r){var i=Mt(e,t,r);if(n.Ub)e=1==n.drmInfos.length&&!n.drmInfos[0].keySystem,t=!i.drmInfos.length,(!n.drmInfos.length||e&&!t)&&(n.drmInfos=i.drmInfos),n.Ub=!1;else if(0<i.drmInfos.length&&(n.drmInfos=n.drmInfos.filter(function(e){return i.drmInfos.some(function(t){return t.keySystem==e.keySystem})}),!n.drmInfos.length))throw new u(2,4,4008);return i.Sb||n.Sb}function Nt(e,t,n){return n.map(function(n){var r=xo[n.sc];return r?[S(r,n.init||e)]:t(n.node)||[]}).reduce(b,[])}function Ut(e){return e.map(function(e){var t=e.getAttribute("schemeIdUri"),n=e.getAttribute("cenc:default_KID"),r=kt(e,"cenc:pssh").map(St);if(!t)return null;if(t=t.toLowerCase(),n&&(n=n.replace(/-/g,"").toLowerCase(),0<=n.indexOf(" ")))throw new u(2,4,4009);var i=[];try{i=r.map(function(e){return{initDataType:"cenc",initData:Z(e),keyId:null}})}catch(e){throw new u(2,4,4007)}return{node:e,sc:t,keyId:n,init:0<i.length?i:null}}).filter(E)}function jt(t,n,r,i,a){null!=a&&(a=Math.round(a));var o={RepresentationID:n,Number:r,Bandwidth:i,Time:a};return t.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)d)?\$/g,function(t,n,r){if("$$"==t)return"$";var i=o[n];return null==i?t:("RepresentationID"==n&&r&&(r=void 0),t=i.toString(),r=e.parseInt(r,10)||1,Array(Math.max(0,r-t.length)+1).join("0")+t)})}function Ft(e,t){var n=Bt(e,t,"timescale"),r=1;n&&(r=Lt(n)||1),n=Bt(e,t,"duration"),(n=Lt(n||""))&&(n/=r);var i=Bt(e,t,"startNumber"),a=Bt(e,t,"presentationTimeOffset"),o=xt(i||"");null!=i&&null!=o||(o=1);var s=Gt(e,t,"SegmentTimeline"),i=null;if(s){for(var i=r,u=Number(a),l=e.R.duration||1/0,s=kt(s,"S"),c=[],f=0,d=0;d<s.length;++d){var h=s[d],p=Ot(h,"t",xt),v=Ot(h,"d",xt),h=Ot(h,"r",Dt);if(null!=p&&(p-=u),!v)break;if(p=null!=p?p:f,0>(h=h||0))if(d+1<s.length){if(null==(h=Ot(s[d+1],"t",xt)))break;if(p>=h)break;h=Math.ceil((h-p)/v)-1}else{if(1/0==l)break;if(p/i>=l)break;h=Math.ceil((l*i-p)/v)-1}0<c.length&&p!=f&&(c[c.length-1].end=p/i);for(var y=0;y<=h;++y)f=p+v,c.push({start:p/i,end:f/i,qe:p}),p=f}i=c}return{timescale:r,P:n,za:o,presentationTimeOffset:Number(a)/r||0,Pb:Number(a),F:i}}function Bt(e,t,n){return[t(e.w),t(e.S),t(e.T)].filter(E).map(function(e){return e.getAttribute(n)}).reduce(function(e,t){return e||t})}function Gt(e,t,n){return[t(e.w),t(e.S),t(e.T)].filter(E).map(function(e){return wt(e,n)}).reduce(function(e,t){return e||t})}function Vt(e,t,n){this.a=e,this.X=t,this.M=n}function Ht(e,t,n,r,i,a){this.position=e,this.startTime=t,this.endTime=n,this.a=r,this.X=i,this.M=a}function Kt(e,t){this.H=e,this.a=t==Io,this.u=0}function Yt(){throw new u(2,3,3e3)}function Wt(){this.b=[],this.a=[]}function qt(e){for(;e.s.Z();)e.Na.eb(e.start,e.s)}function zt(e){for(var t=e.s.D();0<t;--t)e.Na.eb(e.start,e.s)}function Xt(e){return function(t){e(t.s.Ka(t.s.H.byteLength-t.s.u))}}function $t(e){for(var t=0,n=0;n<e.length;n++)t=t<<8|e.charCodeAt(n);return t}function Jt(e,t,n,r){var i,a=(new Wt).da("sidx",function(e){i=Qt(t,r,n,e)});if(e&&a.parse(e),i)return i;throw new u(2,3,3004)}function Qt(e,t,n,r){var i=[];r.s.I(4);var a=r.s.D();if(!a)throw new u(2,3,3005);if(r.version)var o=r.s.Pa(),s=r.s.Pa();else o=r.s.D(),s=r.s.D();r.s.I(2);var l=r.s.oc();for(t=o-t,e=e+r.size+s,s=0;s<l;s++){var c=r.s.D();o=(2147483648&c)>>>31;var c=2147483647&c,f=r.s.D();if(r.s.I(4),1==o)throw new u(2,3,3006);i.push(new Ht(i.length,t/a,(t+f)/a,function(){return n},e,e+c-1)),t+=f,e+=c}return i}function Zt(e){this.a=e}function en(e,t){if(e.a.length){var n=e.a[e.a.length-1];n.startTime>t||(e.a[e.a.length-1]=new Ht(n.position,n.startTime,t,n.a,n.X,n.M))}}function tn(e){this.b=e,this.a=new Kt(e,0),Mo||(Mo=[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 nn(e){var t=rn(e);if(7<t.length)throw new u(2,3,3002);for(var n=0,r=0;r<t.length;r++)n=256*n+t[r];t=n,n=rn(e);e:{for(r=0;r<Mo.length;r++)if(ne(n,Mo[r])){r=!0;break e}r=!1}if(r)n=e.b.byteLength-e.a.u;else{if(8==n.length&&224&n[1])throw new u(2,3,3001);for(var r=n[0]&(1<<8-n.length)-1,i=1;i<n.length;i++)r=256*r+n[i];n=r}return n=e.a.u+n<=e.b.byteLength?n:e.b.byteLength-e.a.u,r=new DataView(e.b.buffer,e.b.byteOffset+e.a.u,n),e.a.I(n),new an(t,r)}function rn(e){var t,n=e.a.Eb();for(t=1;8>=t&&!(n&1<<8-t);t++);if(8<t)throw new u(2,3,3002);var r=new Uint8Array(t);for(r[0]=n,n=1;n<t;n++)r[n]=e.a.Eb();return r}function an(e,t){this.id=e,this.a=t}function on(e){if(8<e.a.byteLength)throw new u(2,3,3002);if(8==e.a.byteLength&&224&e.a.getUint8(0))throw new u(2,3,3001);for(var t=0,n=0;n<e.a.byteLength;n++)var r=e.a.getUint8(n),t=256*t+r;return t}function sn(){}function un(e,t,n,r,i,a){function o(){return i}var s=[];e=new tn(e.a);for(var u=-1,l=-1;e.Z();){var c=nn(e);if(187==c.id){var f=ln(c);f&&(c=n*(f.re-a),f=t+f.Nd,0<=u&&s.push(new Ht(s.length,u,c,o,l,f-1)),u=c,l=f)}}return 0<=u&&s.push(new Ht(s.length,u,r,o,l,null)),s}function ln(e){var t=new tn(e.a);if(e=nn(t),179!=e.id)throw new u(2,3,3013);if(e=on(e),t=nn(t),183!=t.id)throw new u(2,3,3012);for(var t=new tn(t.a),n=0;t.Z();){var r=nn(t);if(241==r.id){n=on(r);break}}return{re:e,Nd:n}}function cn(e,t){var n=Gt(e,t,"Initialization");if(!n)return null;var r=e.w.U,i=n.getAttribute("sourceURL");i&&(r=k(e.w.U,[i]));var i=0,a=null;return(n=Ot(n,"range",Rt))&&(i=n.start,a=n.end),new Vt(function(){return r},i,a)}function fn(e,t){var n=Bt(e,hn,"presentationTimeOffset"),r=cn(e,hn),i=Number(n),a=e.w.contentType,o=e.w.mimeType.split("/")[1];if("text"!=a&&"mp4"!=o&&"webm"!=o)throw new u(2,4,4006);if("webm"==o&&!r)throw new u(2,4,4005);var a=Gt(e,hn,"RepresentationIndex"),s=Bt(e,hn,"indexRange"),l=e.w.U,s=Rt(s||"");if(a){var c=a.getAttribute("sourceURL");c&&(l=k(e.w.U,[c])),s=Ot(a,"range",Rt,s)}if(!s)throw new u(2,4,4002);return i=dn(e,t,r,l,s.start,s.end,o,i),{createSegmentIndex:i.createSegmentIndex,findSegmentPosition:i.findSegmentPosition,getSegmentReference:i.getSegmentReference,initSegmentReference:r,presentationTimeOffset:Number(n)||0}}function dn(e,t,n,r,i,a,o,s){var u=e.presentationTimeline,l=!e.Da||!e.R.ub,c=e.R.duration,f=t,d=null;return{createSegmentIndex:function(){var e=[f(r,i,a),"webm"==o?f(n.a(),n.X,n.M):null];return f=null,Promise.all(e).then(function(e){var t=e[0];e=e[1]||null,t="mp4"==o?Jt(t,i,r,s):(new sn).parse(t,e,r,s),u.Ha(0,t),d=new Zt(t),l&&en(d,c)})},findSegmentPosition:function(e){return d.find(e)},getSegmentReference:function(e){return d.get(e)}}}function hn(e){return e.Qa}function pn(e,t){var n=cn(e,vn),r=gn(e),i=Ft(e,vn),a=i.za;a||(a=1);var o=0;if(i.P?o=i.P*(a-1):i.F&&0<i.F.length&&(o=i.F[0].start),r={P:i.P,startTime:o,za:a,presentationTimeOffset:i.presentationTimeOffset,F:i.F,Ga:r},!r.P&&!r.F&&1<r.Ga.length)throw new u(2,4,4002);if(!r.P&&!e.R.duration&&!r.F&&1==r.Ga.length)throw new u(2,4,4002);if(r.F&&!r.F.length)throw new u(2,4,4002);return a=i=null,e.T.id&&e.w.id&&(a=e.T.id+","+e.w.id,i=t[a]),o=yn(e.R.duration,r.za,e.w.U,r),i?(i.xb(o),i.qb(e.presentationTimeline.ma()-e.R.start)):(e.presentationTimeline.Ha(0,o),i=new Zt(o),a&&e.Da&&(t[a]=i)),e.Da&&e.R.ub||en(i,e.R.duration),{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:i.find.bind(i),getSegmentReference:i.get.bind(i),initSegmentReference:n,presentationTimeOffset:r.presentationTimeOffset}}function vn(e){return e.oa}function yn(e,t,n,r){var i=r.Ga.length;r.F&&r.F.length!=r.Ga.length&&(i=Math.min(r.F.length,r.Ga.length));for(var a=[],o=r.startTime,s=0;s<i;s++){var u=r.Ga[s],l=k(n,[u.cd]),c=null!=r.P?o+r.P:r.F?r.F[s].end:o+e;a.push(new Ht(s+t,o,c,function(e){return e}.bind(null,l),u.start,u.end)),o=c}return a}function gn(e){return[e.w.oa,e.S.oa,e.T.oa].filter(E).map(function(e){return kt(e,"SegmentURL")}).reduce(function(e,t){return 0<e.length?e:t}).map(function(t){t.getAttribute("indexRange")&&!e.$b&&(e.$b=!0);var n=t.getAttribute("media");return t=Ot(t,"mediaRange",Rt,{start:0,end:null}),{cd:n,start:t.start,end:t.end}})}function mn(e,t,n,r){var i=Tn(e),a=Ft(e,bn),o=Bt(e,bn,"media"),s=Bt(e,bn,"index");if(a={P:a.P,timescale:a.timescale,za:a.za,presentationTimeOffset:a.presentationTimeOffset,Pb:a.Pb,F:a.F,wb:o,Ma:s},o=0+(a.Ma?1:0),o+=a.F?1:0,!(o+=a.P?1:0))throw new u(2,4,4002);if(1!=o&&(a.Ma&&(a.F=null),a.P=null),!a.Ma&&!a.wb)throw new u(2,4,4002);if(a.Ma){if("mp4"!=(n=e.w.mimeType.split("/")[1])&&"webm"!=n)throw new u(2,4,4006);if("webm"==n&&!i)throw new u(2,4,4005);r=jt(a.Ma,e.w.id,null,e.bandwidth||null,null),r=k(e.w.U,[r]),e=dn(e,t,i,r,0,null,n,a.presentationTimeOffset)}else a.P?(r||e.presentationTimeline.yb(a.P),e=_n(e,a)):(r=t=null,e.T.id&&e.w.id&&(r=e.T.id+","+e.w.id,t=n[r]),o=En(e,a),t?(t.xb(o),t.qb(e.presentationTimeline.ma()-e.R.start)):(e.presentationTimeline.Ha(0,o),t=new Zt(o),r&&e.Da&&(n[r]=t)),e.Da&&e.R.ub||en(t,e.R.duration),e={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:t.find.bind(t),getSegmentReference:t.get.bind(t)});return{createSegmentIndex:e.createSegmentIndex,findSegmentPosition:e.findSegmentPosition,getSegmentReference:e.getSegmentReference,initSegmentReference:i,presentationTimeOffset:a.presentationTimeOffset}}function bn(e){return e.Ra}function _n(e,t){var n=e.R.duration,r=t.P,i=t.za,a=t.timescale,o=t.wb,s=e.bandwidth||null,u=e.w.id,l=e.w.U;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(e){return 0>e||n&&e>=n?null:Math.floor(e/r)},getSegmentReference:function(e){var t=e*r;return 0>t||n&&t>=n?null:new Ht(e,t,t+r,function(){var n=jt(o,u,e+i,s,t*a);return k(l,[n])},0,null)}}}function En(e,t){for(var n=[],r=0;r<t.F.length;r++){var i=r+t.za;n.push(new Ht(i,t.F[r].start,t.F[r].end,function(e,t,n,r,i,a){return e=jt(e,t,i,n,a),k(r,[e]).map(function(e){return e.toString()})}.bind(null,t.wb,e.w.id,e.bandwidth||null,e.w.U,i,t.F[r].qe+t.Pb),0,null))}return n}function Tn(e){var t=Bt(e,bn,"initialization");if(!t)return null;var n=e.w.id,r=e.bandwidth||null,i=e.w.U;return new Vt(function(){var e=jt(t,n,null,r,null);return k(i,[e])},0,null)}function wn(){var e,t={};for(e in Co)t[e]=!0;for(e in No)t[e]=!0;return["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"].forEach(function(e){t[e]=!!Co[e]}),["mpd","m3u8","ism"].forEach(function(e){t[e]=!!No[e]}),t}function kn(e,t,n,r){var i=r;return i||(r=new l(e).W.split("/").pop().split("."),1<r.length&&(r=r.pop().toLowerCase(),i=No[r])),i?Promise.resolve(i):(n=L([e],n),n.method="HEAD",t.request(0,n).then(function(t){return(t=t.headers["content-type"])&&(t=t.toLowerCase()),(i=Co[t])?i:Promise.reject(new u(2,4,4e3,e))},function(e){return e.severity=2,Promise.reject(e)}))}function Sn(e,t){this.f=e,this.i=t,this.c=this.a=1/0,this.b=1,this.h=0,this.g=!0}function On(){this.a=this.b=null,this.g=[],this.c=null,this.i=[],this.h=1,this.j={},this.l=0,this.f=null}function An(e){return e.a.networkingEngine.request(0,L(e.g,e.b.retryParameters)).then(function(e){if(this.a)return Pn(this,e.data,e.uri)}.bind(e))}function Pn(e,t,n){var r=Y(t),i=new DOMParser,a=null;t=null;try{a=i.parseFromString(r,"text/xml")}catch(e){}if(a&&"MPD"==a.documentElement.tagName&&(t=a.documentElement),t&&0<t.getElementsByTagName("parsererror").length&&(t=null),!t)throw new u(2,4,4001);n=[n],r=kt(t,"Location").map(St).filter(E),0<r.length&&(n=e.g=r),r=kt(t,"BaseURL").map(St),n=k(n,r);var o=Ot(t,"minBufferTime",Pt);e.l=Ot(t,"minimumUpdatePeriod",Pt,-1);var s=Ot(t,"availabilityStartTime",At),r=Ot(t,"timeShiftBufferDepth",Pt),l=Ot(t,"suggestedPresentationDelay",Pt),i=Ot(t,"maxSegmentDuration",Pt),a=t.getAttribute("type")||"static";if(e.c)var c=e.c.presentationTimeline;else{var f=Math.max(10,1.5*o);c=new Sn(s,null!=l?l:f)}var s=Rn(e,{Da:"static"!=a,presentationTimeline:c,T:null,R:null,S:null,w:null,bandwidth:void 0,$b:!1},n,t),l=s.duration,d=s.periods;return c.yc("static"==a),c.pa(l||1/0),c.xc(null!=r?r:1/0),c.yb(i||1),e.c?Promise.resolve():(t=kt(t,"UTCTiming"),Un(e,n,t,c.$()).then(function(e){this.a&&(c.wc(e),this.c={presentationTimeline:c,periods:d,offlineSessionIds:[],minBufferTime:o||0})}.bind(e)))}function Rn(e,t,n,r){var i=Ot(r,"mediaPresentationDuration",Pt),a=[],o=0;r=kt(r,"Period");for(var s=0;s<r.length;s++){var u=r[s],o=Ot(u,"start",Pt,o),l=Ot(u,"duration",Pt),c=null;if(s!=r.length-1){var f=Ot(r[s+1],"start",Pt);null!=f&&(c=f-o)}else null!=i&&(c=i-o);if(null==c&&(c=l),u=Dn(e,t,n,{start:o,duration:c,node:u,ub:null==c||s==r.length-1}),a.push(u),l=t.T.id,e.i.every(T(l))&&(e.a.filterPeriod(u),e.i.push(l),e.c&&e.c.periods.push(u)),null==c){o=null;break}o+=c}return null!=i?{periods:a,duration:i}:{periods:a,duration:o}}function Dn(e,t,n,r){t.T=Mn(r.node,null,n),t.R=r,t.T.id||(t.T.id="__shaka_period_"+r.start),kt(r.node,"EventStream").forEach(e.Fd.bind(e,r.start,r.duration)),n=kt(r.node,"AdaptationSet").map(e.Dd.bind(e,t)).filter(E);var i=n.map(function(e){return e.Pd}).reduce(b,[]),a=i.filter(w);if(t.Da&&i.length!=a.length)throw new u(2,4,4018);var o=n.filter(function(e){return!e.Ob});if(n.filter(function(e){return e.Ob}).forEach(function(e){var t=e.streams[0],n=e.Ob;o.forEach(function(e){e.id==n&&e.streams.forEach(function(e){e.trickModeVideo=t})})}),i=Ln(o,"video"),a=Ln(o,"audio"),!i.length&&!a.length)throw new u(2,4,4004);for(a.length||(a=[null]),i.length||(i=[null]),t=[],n=0;n<a.length;n++)for(var s=0;s<i.length;s++)xn(e,a[n],i[s],t);for(e=Ln(o,"text"),i=[],n=0;n<e.length;n++)i.push.apply(i,e[n].streams);return{startTime:r.start,textStreams:i,variants:t}}function Ln(e,t){return e.filter(function(e){return e.contentType==t})}function xn(e,t,n,r){if(t||n)if(t&&n){var i=t.drmInfos,a=n.drmInfos;if(i.length&&a.length?0<_e(i,a).length:1)for(var o=_e(t.drmInfos,n.drmInfos),i=0;i<t.streams.length;i++)for(var s=0;s<n.streams.length;s++)a=n.streams[s].bandwidth+t.streams[i].bandwidth,a={id:e.h++,language:t.language,primary:t.vb||n.vb,audio:t.streams[i],video:n.streams[s],bandwidth:a,drmInfos:o,allowedByApplication:!0,allowedByKeySystem:!0},r.push(a)}else for(o=t||n,i=0;i<o.streams.length;i++)a=o.streams[i].bandwidth,a={id:e.h++,language:o.language||"und",primary:o.vb,audio:t?o.streams[i]:null,video:n?o.streams[i]:null,bandwidth:a,drmInfos:o.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},r.push(a)}function In(t,n){0>t.l||(t.f=e.setTimeout(t.he.bind(t),1e3*Math.max(Math.max(3,t.l)-n,0)))}function Mn(e,t,n){t=t||{contentType:"",mimeType:"",codecs:"",containsEmsgBoxes:!1,frameRate:void 0},n=n||t.U;var r=kt(e,"BaseURL").map(St),i=e.getAttribute("contentType")||t.contentType,a=e.getAttribute("mimeType")||t.mimeType,o=e.getAttribute("codecs")||t.codecs,s=Ot(e,"frameRate",It)||t.frameRate,u=!!kt(e,"InbandEventStream").length;return i||(i=jn(a,o)),{U:k(n,r),Qa:wt(e,"SegmentBase")||t.Qa,oa:wt(e,"SegmentList")||t.oa,Ra:wt(e,"SegmentTemplate")||t.Ra,width:Ot(e,"width",xt)||t.width,height:Ot(e,"height",xt)||t.height,contentType:i,mimeType:a,codecs:o,frameRate:s,containsEmsgBoxes:u||t.containsEmsgBoxes,id:e.getAttribute("id")}}function Cn(e){var t=0+(e.Qa?1:0);return t+=e.oa?1:0,(t+=e.Ra?1:0)?(1!=t&&(e.Qa&&(e.oa=null),e.Ra=null),!0):"text"==e.contentType||"application"==e.contentType}function Nn(e,t,n,r){return t=k(t,[n]),t=L(t,e.b.retryParameters),t.method=r,e.a.networkingEngine.request(0,t).then(function(e){if("HEAD"==r){if(!e.headers||!e.headers.date)return 0;e=e.headers.date}else e=Y(e.data);return e=Date.parse(e),isNaN(e)?0:e-Date.now()})}function Un(e,t,n,r){n=n.map(function(e){return{scheme:e.getAttribute("schemeIdUri"),value:e.getAttribute("value")}});var i=e.b.dash.clockSyncUri;return r&&!n.length&&i&&n.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:i}),m(n,function(e){var n=e.value;switch(e.scheme){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return Nn(this,t,n,"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 Nn(this,t,n,"GET");case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return e=Date.parse(n),isNaN(e)?0:e-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(e)).catch(function(){return 0})}function jn(e,t){return go[nt(e,t)]?"text":e.split("/")[0]}function Fn(e,t,n,r){this.uri=e,this.type=t,this.ga=n,this.segments=r||null}function Bn(e,t,n,r){this.id=e,this.name=t,this.a=n,this.value=r||null}function Gn(e,t){this.name=e,this.value=t}function Vn(e,t,n){return n=n||null,(e=e.getAttribute(t))?e.value:n}function Hn(e,t){this.ga=t,this.uri=e}function Kn(e,t){return e.filter(function(e){return e.name==t})}function Yn(e,t){var n=Kn(e,t);return n.length?n[0]:null}function Wn(e,t,n){return e.filter(function(e){var r=e.getAttribute("TYPE");return e=e.getAttribute("GROUP-ID"),r.value==t&&e.value==n})}function qn(e){this.b=e,this.a=0}function zn(e,t){t.lastIndex=e.a;var n=(n=t.exec(e.b))?{position:n.index,length:n[0].length,Sd:n}:null;return e.a!=e.b.length&&n&&n.position==e.a?(e.a+=n.length,n.Sd):null}function Xn(e){return e.a==e.b.length?null:(e=zn(e,/[^ \t\n]*/gm))?e[0]:null}function $n(){this.a=0}function Jn(e,t,n){t=Y(t),t=t.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var r=t.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(r[0]))throw new u(2,4,4015);t=0;for(var i=[],a=1;a<r.length;)if(/^#(?!EXT)/m.test(r[a]))a+=1;else{var o=r[a];if(o=Zn(e.a++,o),0<=Uo.indexOf(o.name))t=1;else if(0<=jo.indexOf(o.name)){if(1!=t)throw new u(2,4,4017);return r=r.splice(a,r.length-a),e=Qn(e,r),new Fn(n,t,i,e)}i.push(o),a+=1,"EXT-X-STREAM-INF"==o.name&&(o.a.push(new Gn("URI",r[a])),a+=1)}return new Fn(n,t,i)}function Qn(e,t){var n=[],r=[];return t.forEach(function(e){/^(#EXT)/.test(e)?(e=Zn(this.a++,e),r.push(e)):/^#(?!EXT)/m.test(e)||(n.push(new Hn(e.trim(),r)),r=[])}.bind(e)),n}function Zn(e,t){var n=t.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!n)throw new u(2,4,4016);var r=n[1],i=n[2],n=[];if(i&&0<=i.indexOf("="))for(var a,i=new qn(i),o=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;a=zn(i,o);)n.push(new Gn(a[1],a[2]||a[3]));else if(i)return new Bn(e,r,n,i);return new Bn(e,r,n)}function er(e){return new Promise(function(t){var n=er.parse(e);t({uri:e,data:n.data,headers:{"content-type":n.contentType}})})}function tr(){this.b=this.c=null,this.i=1,this.g={},this.f={},this.a=null,this.j="",this.h=new $n}function nr(e,t,n){if(t=Jn(e.h,t,n),0!=t.type)throw new u(2,4,4022);return e.a=new Sn(null,0),rr(e,t).then(function(e){return this.c.filterPeriod(e),{presentationTimeline:this.a,periods:[e],offlineSessionIds:[],minBufferTime:0}}.bind(e))}function rr(e,t){var n=Kn(t.ga,"EXT-X-STREAM-INF").map(function(e){return ir(this,e,t)}.bind(e)),r=Kn(t.ga,"EXT-X-MEDIA").filter(function(e){return"SUBTITLES"==yr(e,"TYPE")}.bind(e)).map(function(e){return sr(this,e,t)}.bind(e));return Promise.all(n).then(function(e){return Promise.all(r).then(function(t){var n=e.reduce(b,[]);return dr(this,n),{startTime:0,variants:n,textStreams:t}}.bind(this))}.bind(e))}function ir(e,t,n){var r=Number(yr(t,"BANDWIDTH")),i=Vn(t,"CODECS","avc1.42E01E,mp4a.40.2").split(","),a=t.getAttribute("RESOLUTION"),o=null,s=null,u=Vn(t,"FRAME-RATE");if(a)var l=a.value.split("x"),o=l[0],s=l[1];var c=vr(e,n);n=Kn(n.ga,"EXT-X-MEDIA");var f=Vn(t,"AUDIO"),d=Vn(t,"VIDEO");f?n=Wn(n,"AUDIO",f):d&&(n=Wn(n,"VIDEO",d)),n=n.map(function(e){return ur(this,e,i,c)}.bind(e));var h=[],p=[];return Promise.all(n).then(function(e){if(f?h=e:d&&(p=e),h.length||p.length)var n=h.length?"video":"audio";else 1==i.length?n=a||u?"video":"audio":(n="video",i=[i.join(",")]);return e=i,lr(this,yr(t,"URI"),e,n,c,"und",!1,null)}.bind(e)).then(function(e){return"audio"==e.stream.type?h=[e]:p=[e],ar(this,h,p,r,o,s,u)}.bind(e))}function ar(e,t,n,r,i,a,o){n.forEach(function(e){(e=e.stream)&&(e.width=Number(i)||void 0,e.height=Number(a)||void 0,e.frameRate=Number(o)||void 0)}.bind(e)),t.length||(t=[null]),n.length||(n=[null]);for(var s=[],u=0;u<t.length;u++)for(var l=0;l<n.length;l++){var c=t[u]?t[u].stream:null,f=n[l]?n[l].stream:null,d=t[u]?t[u].drmInfos:null,h=n[l]?n[l].drmInfos:null;if(c&&f){if(!(d.length&&h.length?0<_e(d,h).length:1))continue;var p=_e(d,h)}else c?p=d:f&&(p=h);s.push(or(e,c,f,r,p))}return s}function or(e,t,n,r,i){return{id:e.i++,language:t?t.language:"und",primary:!!t&&t.primary||!!n&&n.primary,audio:t,video:n,bandwidth:r,drmInfos:i,allowedByApplication:!0,allowedByKeySystem:!0}}function sr(e,t,n){return yr(t,"TYPE"),n=vr(e,n),ur(e,t,[],n).then(function(e){return e.stream})}function ur(e,t,n,r){if(e.g[t.id])return Promise.resolve().then(function(){return this.g[t.id]}.bind(e));var i=yr(t,"TYPE").toLowerCase();"subtitles"==i&&(i="text");var a=Ve(Vn(t,"LANGUAGE","und")),o=Vn(t,"NAME"),s=t.getAttribute("DEFAULT"),u=t.getAttribute("AUTOSELECT");return lr(e,yr(t,"URI"),n,i,r,a,!!s||!!u,o).then(function(e){return this.g[t.id]=e}.bind(e))}function lr(e,t,n,r,i,a,o,s){return t=k([e.j],[t])[0],e.c.networkingEngine.request(0,L([t],e.b.retryParameters)).then(function(e){if(e=Jn(this.h,e.data,e.uri),1!=e.type)throw new u(2,4,4017);i=vr(this,e)||i;var t=null;"text"!=r&&(t=cr(e));var l=Yn(e.ga,"EXT-X-MEDIA-SEQUENCE"),l=fr(this,e,l?Number(l.value):0);this.a.Ha(0,l);var c=l[l.length-1].endTime-l[0].startTime,f=this.a.Y();(1/0==f||f<c)&&this.a.pa(c);var d=hr(r,n),h=void 0;"text"==r&&(h="subtitle");var p=new Zt(l),v=[];e.segments.forEach(function(e){e=Kn(e.ga,"EXT-X-KEY"),v.push.apply(v,e)});var y=!1,g=[],m=null;if(v.forEach(function(e){if("NONE"!=yr(e,"METHOD")){y=!0;var t=yr(e,"KEYFORMAT");(e=(t=Ho[t])?t(e):null)&&(e.keyIds.length&&(m=e.keyIds[0]),g.push(e))}}),y&&!g.length)throw new u(2,4,4026);return pr(this,r,l[0].a()[0]).then(function(e){return e={id:this.i++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:p.find.bind(p),getSegmentReference:p.get.bind(p),initSegmentReference:t,presentationTimeOffset:i||0,mimeType:e,codecs:d,kind:h,encrypted:y,keyId:m,language:a,label:s||null,type:r,primary:o,trickModeVideo:null,containsEmsgBoxes:!1,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[]},this.f[e.id]=p,{stream:e,Ae:p,drmInfos:g}}.bind(this))}.bind(e))}function cr(e){var t=Kn(e.ga,"EXT-X-MAP");if(!t.length)return null;if(1<t.length)throw new u(2,4,4020);var t=t[0],n=yr(t,"URI"),r=k([e.uri],[n])[0];return e=0,n=null,(t=Vn(t,"BYTERANGE"))&&(e=t.split("@"),t=Number(e[0]),e=Number(e[1]),n=e+t-1),new Vt(function(){return[r]},e,n)}function fr(e,t,n){var r=t.segments,i=[];return r.forEach(function(e){var a,o=e.ga,s=k([t.uri],[e.uri])[0],u=gr(o).value.split(","),u=Number(u[0]);a=(e=r.indexOf(e))?i[e-1].endTime:0;var u=a+u,l=0,c=null;(o=Yn(o,"EXT-X-BYTERANGE"))&&(o=o.value.split("@"),c=Number(o[0]),l=o[1]?Number(o[1]):i[e-1].M,c=l+c-1,e==r.length-1&&(c=null)),i.push(new Ht(n+e,a,u,function(){return[s]},l,c))}.bind(e)),i}function dr(e,t){t.forEach(function(e){var t=this.a.Y(),n=e.video;e=e.audio,n&&this.f[n.id]&&en(this.f[n.id],t),e&&this.f[e.id]&&en(this.f[e.id],t)}.bind(e))}function hr(e,t){if(1==t.length)return t[0];if("text"==e)return"";var n=Fo;"audio"==e&&(n=Bo);for(var r=0;r<n.length;r++)for(var i=0;i<t.length;i++)if(n[r].test(t[i].trim()))return t[i].trim();throw new u(2,4,4025,t)}function pr(e,t,n){var r=n.split("."),i=r[r.length-1];return"text"==t?Promise.resolve("text/vtt"):(r=Go,"video"==t&&(r=Vo),(t=r[i])?Promise.resolve(t):(n=L([n],e.b.retryParameters),n.method="HEAD",e.c.networkingEngine.request(1,n).then(function(e){if(!(e=e.headers["content-type"]))throw new u(2,4,4021,i);return e})))}function vr(e,t){var n=Yn(t.ga,"EXT-X-START");return n?Number(yr(n,"TIME-OFFSET")):e.b.hls.defaultTimeOffset}function yr(e,t){var n=e.getAttribute(t);if(!n)throw new u(2,4,4023,t);return n.value}function gr(e){if(!(e=Yn(e,"EXTINF")))throw new u(2,4,4024,"EXTINF");return e}function mr(){}function br(e){var t=[];if(!e)return t;for(var n=e.childNodes,r=0;r<n.length;r++){var i="span"==n[r].nodeName&&"p"==e.nodeName;n[r].nodeType!=Node.ELEMENT_NODE||"br"==n[r].nodeName||i||(i=br(n[r]),t=t.concat(i))}return t.length||t.push(e),t}function _r(e,t){for(var n=e.childNodes,r=0;r<n.length;r++)if("br"==n[r].nodeName&&0<r)n[r-1].textContent+="\n";else if(0<n[r].childNodes.length)_r(n[r],t);else if(t){var i=n[r].textContent.trim(),i=i.replace(/\s+/g," ");n[r].textContent=i}}function Er(e,t,n,r){for(var i=br(t),a=0;a<i.length;a++){var o=i[a].getAttribute(r);if(o)return o}return i=Tr,(e=i(t,"style",n)||i(e,"style",n))?e.getAttribute(r):null}function Tr(e,t,n){if(!e||1>n.length)return null;var r=null,i=e;for(e=null;i&&!(e=i.getAttribute(t))&&(i=i.parentNode)instanceof Element;);if(t=e)for(e=0;e<n.length;e++)if(n[e].getAttribute("xml:id")==t){r=n[e];break}return r}function wr(e,t){var n=null;if(Ko.test(e))var n=Ko.exec(e),r=Number(n[1]),i=Number(n[2]),a=Number(n[3]),o=Number(n[4]),o=o+(Number(n[5])||0)/t.b,a=a+o/t.frameRate,n=a+60*i+3600*r;else Yo.test(e)?n=kr(Yo,e):Wo.test(e)?n=kr(Wo,e):qo.test(e)?(n=qo.exec(e),n=Number(n[1])/t.frameRate):zo.test(e)?(n=zo.exec(e),n=Number(n[1])/t.a):Xo.test(e)&&(n=kr(Xo,e));return n}function kr(e,t){var n=e.exec(t);return n&&""!=n[0]?(Number(n[4])||0)/1e3+(Number(n[3])||0)+60*(Number(n[2])||0)+3600*(Number(n[1])||0):null}function Sr(e,t,n,r){this.frameRate=Number(e)||30,this.b=Number(t)||1,this.a=Number(r),this.a||(this.a=e?this.frameRate*this.b:1),n&&(e=/^(\d+) (\d+)$/g.exec(n))&&(this.frameRate*=e[1]/e[2])}function Or(){this.a=new mr}function Ar(){}function Pr(e,t){var n;(n=/^align:(start|middle|center|end|left|right)$/.exec(t))?(e.align=n[1],"center"==n[1]&&"center"!=e.align&&(e.position="auto",e.align="middle")):(n=/^vertical:(lr|rl)$/.exec(t))?e.vertical=n[1]:(n=/^size:(\d{1,2}|100)%$/.exec(t))?e.size=Number(n[1]):(n=/^position:(\d{1,2}|100)%(?:,(line-left|line-right|center|start|end))?$/.exec(t))?(e.position=Number(n[1]),n[2]&&(e.positionAlign=n[2])):(n=/^line:(\d{1,2}|100)%(?:,(start|end|center))?$/.exec(t))?(e.snapToLines=!1,e.line=Number(n[1]),n[2]&&(e.lineAlign=n[2])):(n=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(t))&&(e.snapToLines=!0,e.line=Number(n[1]),n[2]&&(e.lineAlign=n[2]))}function Rr(e){if(!(e=zn(e,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g)))return null;var t=Number(e[2]),n=Number(e[3]);return 59<t||59<n?null:Number(e[4])/1e3+n+60*t+3600*(Number(e[1])||0)}function Dr(){this.a=null}function Lr(e,t,n){var r,i,a;return(new Wt).C("payl",Xt(function(e){r=Y(e)})).C("iden",Xt(function(e){i=Y(e)})).C("sttg",Xt(function(e){a=Y(e)})).parse(e),r?xr(r,i,a,t,n):null}function xr(e,t,n,r,i){if((e=we(r,i,e))&&t&&(e.id=t),e&&n)for(t=new qn(n),n=Xn(t);n;)Pr(e,n),zn(t,/[ \t]+/gm),n=Xn(t);return e}function Ir(e,t,n,r,i,a){this.a=e,this.c=t,this.l=n,this.A=r,this.J=i,this.G=a,this.b=new C,this.h=!1,this.g=1,this.j=this.f=null,this.B=e.readyState,this.i=!1,this.O=this.v=-1,this.o=!1,0<e.readyState?this.fc():U(this.b,e,"loadedmetadata",this.fc.bind(this)),t=this.hc.bind(this),N(this.b,e,"ratechange",this.rd.bind(this)),N(this.b,e,"waiting",t),this.j=setInterval(t,250)}function Mr(e,t){0<e.a.readyState?e.a.currentTime=Br(e,t):e.A=t}function Cr(e){return 0<e.a.readyState?Br(e,e.a.currentTime):Nr(e)}function Nr(e){return e.A?Br(e,e.A):(e=e.c.presentationTimeline,1/0>e.Y()?e.ma():e.bb())}function Ur(t,n){null!=t.f&&(e.clearInterval(t.f),t.f=null),t.g=n,t.a.playbackRate=t.h||0>n?0:n,!t.h&&0>n&&(t.f=e.setInterval(function(){this.a.currentTime+=n/4}.bind(t),250))}function jr(e,t){var n=Pe.bind(null,e.a.buffered),r=1*Math.max(e.c.minBufferTime||0,e.l.rebufferingGoal),i=e.c.presentationTimeline,a=i.ua(),o=i.Ea(r),s=i.Ea(5),r=i.Ea(r+5);return t>a?a:t<i.Ea(0)?n(s)?s:r:t>=o||n(t)?t:r}function Fr(e,t,n){e.a.currentTime=n;var r=0,i=function(){!this.a||10<=r++||this.a.currentTime!=t||(this.a.currentTime=n,setTimeout(i,100))}.bind(e);setTimeout(i,100)}function Br(e,t){var n=e.c.presentationTimeline.ma();return t<n?n:(n=e.c.presentationTimeline.ua(),t>n?n:t)}function Gr(e,t,n,r,i,a){this.a=e,this.g=t,this.A=n,this.l=r,this.h=i,this.B=a,this.c=[],this.j=new C,this.b=!1,this.i=-1,this.f=null,Hr(this)}function Vr(e){var t=A(e);return t.eventElement=e.eventElement,t}function Hr(t){Kr(t),t.f=e.setTimeout(t.G.bind(t),250)}function Kr(t){t.f&&(e.clearTimeout(t.f),t.f=null)}function Yr(e,t){this.a=t,this.b=e,this.g=null,this.i=1,this.o=Promise.resolve(),this.h=[],this.j={},this.c={},this.f=this.l=this.v=!1}function Wr(e){return e.b.periods[rt(e.b,Cr(e.a.Oa))]}function qr(e){return V(e.c,function(e){return e.na||e.stream})}function zr(e,t){var n={};return n.text=t,Zr(e,n)}function Xr(e,t){var n=e.c.video;if(n){var r=n.stream;if(r)if(t){var i=r.trickModeVideo;if(i){var a=n.na;a||($r(e,"video",i,!1),n.na=r)}}else(a=n.na)&&(n.na=null,$r(e,"video",a,!0))}}function $r(e,t,n,r){var i=e.c[t];if(!i&&"text"==t&&e.g.ignoreTextStreamFailures)zr(e,n);else if(i){var a=it(e.b,n);r&&a!=i.wa?Qr(e):(i.na&&(n.trickModeVideo?(i.na=n,n=n.trickModeVideo):i.na=null),"text"==t&&xe(e.a.K,nt(n.mimeType,n.codecs)),(t=e.h[a])&&t.La&&(t=e.j[n.id])&&t.La&&i.stream!=n&&(i.stream=n,i.cb=!0,r&&(i.sa?i.kb=!0:i.xa?(i.ra=!0,i.kb=!0):(yi(i),pi(e,i,!0)))))}}function Jr(e){var t=Cr(e.a.Oa);Object.keys(e.c).every(function(e){var n=this.a.K;return"text"==e?(e=n.a,e=t>=e.b&&t<e.a):(e=Me(n,e),e=Pe(e,t)),e}.bind(e))||Qr(e)}function Qr(e){for(var t in e.c){var n=e.c[t];n.sa||n.ra||(n.xa?n.ra=!0:null==Ie(e.a.K,t)?null==n.qa&&vi(e,n,0):(yi(n),pi(e,n,!1)))}}function Zr(e,t,n){var r=rt(e.b,Cr(e.a.Oa)),i=V(t,function(e){return nt(e.mimeType,e.codecs)});return e.a.K.init(i),ni(e),i=G(t),ti(e,i).then(function(){if(!this.f)for(var e in t){var i=t[e];this.c[e]||(this.c[e]={stream:i,type:e,Fa:null,ea:null,na:null,cb:!0,wa:r,endOfStream:!1,xa:!1,qa:null,ra:!1,kb:!1,sa:!1,Gb:!1,tb:!1,rc:n||0},vi(this,this.c[e],0))}}.bind(e))}function ei(e,t){var n=e.h[t];if(n)return n.L;n={L:new P,La:!1},e.h[t]=n;var r=e.b.periods[t].variants.map(function(e){var t=[];return e.audio&&t.push(e.audio),e.video&&t.push(e.video),e.video&&e.video.trickModeVideo&&t.push(e.video.trickModeVideo),t}).reduce(b,[]).filter(w);return r.push.apply(r,e.b.periods[t].textStreams),e.o=e.o.then(function(){if(!this.f)return ti(this,r)}.bind(e)).then(function(){this.f||(this.h[t].L.resolve(),this.h[t].La=!0)}.bind(e)).catch(function(e){this.f||(this.h[t].L.reject(),delete this.h[t],this.a.onError(e))}.bind(e)),n.L}function ti(e,t){t.map(function(e){return e.id}).filter(w);for(var n=[],r=0;r<t.length;++r){var i=t[r],a=e.j[i.id];a?n.push(a.L):(e.j[i.id]={L:new P,La:!1},n.push(i.createSegmentIndex()))}return Promise.all(n).then(function(){if(!this.f)for(var e=0;e<t.length;++e){var n=this.j[t[e].id];n.La||(n.L.resolve(),n.La=!0)}}.bind(e)).catch(function(e){if(!this.f)return this.j[i.id].L.reject(),delete this.j[i.id],Promise.reject(e)}.bind(e))}function ni(e){var t=e.b.presentationTimeline.Y();1/0>t?e.a.K.pa(t):e.a.K.pa(Math.pow(2,32))}function ri(e,t){var n=Cr(e.a.Oa),r=t.Fa&&t.ea?e.b.periods[it(e.b,t.Fa)].startTime+t.ea.endTime:Math.max(n,t.rc);t.rc=0;var i=it(e.b,t.stream),a=rt(e.b,r),o=e.a.K,s=t.type;return"text"==s?(o=o.a,o=null==o.a||o.a<n?0:o.a-Math.max(n,o.b)):(o=Me(o,s),o=Re(o,n)),s=Math.max(e.i*Math.max(e.b.minBufferTime||0,e.g.rebufferingGoal),e.i*e.g.bufferingGoal),r>=e.b.presentationTimeline.Y()?(t.endOfStream=!0,null):(t.endOfStream=!1,t.wa=a,a!=i?null:o>=s?.5:(r=e.a.K,a=t.type,r="text"==a?r.a.a:Ae(Me(r,a)),t.ea&&t.stream==t.Fa?(a=t.ea.position+1,r=ii(e,t,i,a)):(a=t.ea?t.stream.findSegmentPosition(Math.max(0,e.b.periods[it(e.b,t.Fa)].startTime+t.ea.endTime-e.b.periods[i].startTime)):t.stream.findSegmentPosition(Math.max(0,(r||n)-e.b.periods[i].startTime)),null==a?r=null:(o=null,null==r&&(o=ii(e,t,i,Math.max(0,a-1))),r=o||ii(e,t,i,a))),r?(ai(e,t,n,i,r),null):1))}function ii(e,t,n,r){return n=e.b.periods[n],(t=t.stream.getSegmentReference(r))?(e=e.b.presentationTimeline,r=e.ua(),n.startTime+t.endTime<e.ma()||n.startTime+t.startTime>r?null:t):null}function ai(e,t,n,r,i){var a=e.b.periods[r],o=t.stream,s=e.b.periods[r+1],u=null,u=s?s.startTime:e.b.presentationTimeline.Y();r=si(e,t,r,u),t.xa=!0,t.cb=!1,s=hi(e,i),Promise.all([r,s]).then(function(e){if(!this.f&&!this.l)return ui(this,t,n,a,o,i,e[1])}.bind(e)).then(function(){this.f||this.l||(t.xa=!1,t.Gb=!1,t.ra||this.a.Ab(),vi(this,t,0),ci(this,o))}.bind(e)).catch(function(e){this.f||this.l||(t.xa=!1,this.b.presentationTimeline.$()&&this.g.infiniteRetriesForLiveStreams&&(1001==e.code||1002==e.code||1003==e.code)?"text"==t.type&&this.g.ignoreTextStreamFailures&&1001==e.code?delete this.c.text:(e.severity=1,this.a.onError(e),vi(this,t,4)):3017==e.code?oi(this,t,e):"text"==t.type&&this.g.ignoreTextStreamFailures?delete this.c.text:(t.tb=!0,e.severity=2,this.a.onError(e)))}.bind(e))}function oi(e,t,n){if(!G(e.c).some(function(e){return e!=t&&e.Gb})){var r=Math.round(100*e.i);if(20<r)e.i-=.2;else{if(!(4<r))return t.tb=!0,e.l=!0,void e.a.onError(n);e.i-=.04}t.Gb=!0}vi(e,t,4)}function si(e,t,n,r){return t.cb?(n=Ue(e.a.K,t.type,e.b.periods[n].startTime-t.stream.presentationTimeOffset,r),t.stream.initSegmentReference?(e=hi(e,t.stream.initSegmentReference).then(function(e){if(!this.f)return Ce(this.a.K,t.type,e,null,null)}.bind(e)).catch(function(e){return t.cb=!0,Promise.reject(e)}),Promise.all([n,e])):n):Promise.resolve()}function ui(e,t,n,r,i,a,o){return i.containsEmsgBoxes&&(new Wt).da("emsg",e.Ed.bind(e,r,a)).parse(o),li(e,t,n).then(function(){if(!this.f)return Ce(this.a.K,t.type,o,a.startTime+r.startTime,a.endTime+r.startTime)}.bind(e)).then(function(){if(!this.f)return t.Fa=i,t.ea=a,Promise.resolve()}.bind(e))}function li(e,t,n){var r=Ie(e.a.K,t.type);return null==r?Promise.resolve():(n=n-r-e.g.bufferBehind,0>=n?Promise.resolve():e.a.K.remove(t.type,r,r+n).then(function(){}.bind(e)))}function ci(e,t){if(!e.v&&(e.v=G(e.c).every(function(e){return"text"==e.type||!e.ra&&!e.sa&&e.ea}),e.v)){var n=it(e.b,t);for(e.h[n]||ei(e,n).then(function(){this.a.ac()}.bind(e)).catch(_),n=0;n<e.b.periods.length;++n)ei(e,n).catch(_);e.a.wd&&e.a.wd()}}function fi(e,t){if(t.wa!=it(e.b,t.stream)){var n=t.wa,r=G(e.c);r.every(function(e){return e.wa==n})&&r.every(di)&&ei(e,n).then(function(){if(!this.f&&r.every(function(e){var t=it(this.b,e.stream);return di(e)&&e.wa==n&&t!=n}.bind(this))){var e,t=this.b.periods[n],i=this.a.bc(t);for(e in this.c)if(!i[e]&&"text"!=e)return void this.a.onError(new u(2,5,5005));for(e in i)if(!this.c[e]){if("text"!=e)return void this.a.onError(new u(2,5,5005));Zr(this,{text:i.text},t.startTime),delete i[e]}for(e in this.c)(t=i[e])?($r(this,e,t,!1),vi(this,this.c[e],0)):delete this.c[e];this.a.ac()}}.bind(e)).catch(_)}}function di(e){return!e.xa&&null==e.qa&&!e.ra&&!e.sa}function hi(e,t){var n=L(t.a(),e.g.retryParameters);if(t.X||null!=t.M){var r="bytes="+t.X+"-";null!=t.M&&(r+=t.M),n.headers.Range=r}return e.a.dd.request(1,n).then(function(e){return e.data})}function pi(e,t,n){t.ra=!1,t.kb=!1,t.sa=!0,Ne(e.a.K,t.type).then(function(){if(!this.f&&n){var e=this.a.K,r=t.type;return"text"==r?Promise.resolve():je(e,r,e.Oc.bind(e,r))}}.bind(e)).then(function(){this.f||(t.Fa=null,t.ea=null,t.sa=!1,t.endOfStream=!1,vi(this,t,0))}.bind(e))}function vi(t,n,r){n.qa=e.setTimeout(t.ke.bind(t,n),1e3*r)}function yi(t){null!=t.qa&&(e.clearTimeout(t.qa),t.qa=null)}function gi(e,t){return new Promise(function(n,r){var i=new XMLHttpRequest;i.open(t.method,e,!0),i.responseType="arraybuffer",i.timeout=t.retryParameters.timeout,i.withCredentials=t.allowCrossSiteCredentials,i.onload=function(t){t=t.target;var i=t.getAllResponseHeaders().split("\r\n").reduce(function(e,t){var n=t.split(": ");return e[n[0].toLowerCase()]=n.slice(1).join(": "),e},{});if(200<=t.status&&299>=t.status&&202!=t.status)t.responseURL&&(e=t.responseURL),n({uri:e,data:t.response,headers:i,fromCache:!!i["x-shaka-from-cache"]});else{var a=null;try{a=q(t.response)}catch(e){}r(new u(401==t.status||403==t.status?2:1,1,1001,e,t.status,a,i))}},i.onerror=function(){r(new u(1,1,1002,e))},i.ontimeout=function(){r(new u(1,1,1003,e))};for(var a in t.headers)i.setRequestHeader(a,t.headers[a]);i.send(t.body)})}function mi(){this.a=null,this.b=[],this.c={}}function bi(e,t,n){return Ti(e,t,"readwrite",function(e){e.put(n)})}function _i(e,t,n){return Ti(e,"segment","readwrite",function(e){for(var r=0;r<t.length;r++)e.delete(t[r]).onsuccess=n||function(){}})}function Ei(e,t){var n=0;return Ti(e,t,"readonly",function(e){e.openCursor(null,"prev").onsuccess=function(e){(e=e.target.result)&&(n=e.key+1)}}).then(function(){return n})}function Ti(e,t,n,r){var i={transaction:e.a.transaction([t],n),L:new P};return i.transaction.oncomplete=function(){this.b.splice(this.b.indexOf(i),1),i.L.resolve()}.bind(e),i.transaction.onabort=function(e){this.b.splice(this.b.indexOf(i),1),ki(i.transaction,i.L,e)}.bind(e),i.transaction.onerror=function(e){e.preventDefault()}.bind(e),t=i.transaction.objectStore(t),r(t),e.b.push(i),i.L}function wi(t,n,r){var i=e.indexedDB.open("shaka_offline_db",1),a=!1,o=new P;return i.onupgradeneeded=function(e){a=!0,e=e.target.result;for(var t in n)e.createObjectStore(t,{keyPath:n[t]})},i.onsuccess=function(e){r&&!a?(e.target.result.close(),setTimeout(function(){wi(this,n,r-1).then(o.resolve,o.reject)}.bind(this),1e3)):(this.a=e.target.result,o.resolve())}.bind(t),i.onerror=ki.bind(null,i,o),o}function ki(e,t,n){e.error?t.reject(new u(2,9,9001,e.error)):t.reject(new u(2,9,9002)),n.preventDefault()}function Si(e){var t=Oi(e.periods[0],[],new Sn(null,0)),n=qe(t,null,null),t=ze(t,null);return n.push.apply(n,t),{offlineUri:"offline:"+e.key,originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:void 0==e.expiration?1/0:e.expiration,tracks:n,appMetadata:e.appMetadata}}function Oi(e,t,n){var r=e.streams.filter(function(e){return"text"==e.contentType});return t=Pi(e.streams.filter(function(e){return"audio"==e.contentType}),e.streams.filter(function(e){return"video"==e.contentType}),t),r=r.map(Di),e.streams.forEach(function(e){e=Ai(e),n.Ha(0,e)}),{startTime:e.startTime,variants:t,textStreams:r}}function Ai(e){return e.segments.map(function(e,t){return new Ht(t,e.startTime,e.endTime,function(){return[e.uri]},0,null)})}function Pi(e,t,n){var r=[];if(!e.length&&!t.length)return r;e.length?t.length||(t=[null]):e=[null];for(var i=0,a=0;a<e.length;a++)for(var o=0;o<t.length;o++)if(Ri(e[a],t[o])){var s=e[a],u=t[o],l=n;s={id:i++,language:s?s.language:"",primary:!!s&&s.primary||!!u&&u.primary,audio:Di(s),video:Di(u),bandwidth:0,drmInfos:l,allowedByApplication:!0,allowedByKeySystem:!0},r.push(s)}return r}function Ri(e,t){if(!(e&&t&&e.variantIds&&t.variantIds))return!0;for(var n=0;n<e.variantIds.length;n++)if(t.variantIds.some(function(t){return t==e.variantIds[n]}))return!0;return!1}function Di(e){if(!e)return null;var t=Ai(e),t=new Zt(t);return{id:e.id,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:t.find.bind(t),getSegmentReference:t.get.bind(t),initSegmentReference:e.initSegmentUri?new Vt(function(){return[e.initSegmentUri]},0,null):null,presentationTimeOffset:e.presentationTimeOffset,mimeType:e.mimeType,codecs:e.codecs,width:e.width||void 0,height:e.height||void 0,frameRate:e.frameRate||void 0,kind:e.kind,encrypted:e.encrypted,keyId:e.keyId,language:e.language,label:e.label||null,type:e.contentType,primary:e.primary,trickModeVideo:null,containsEmsgBoxes:!1,roles:[]}}function Li(){return e.indexedDB?new mi:null}function xi(e,t,n,r){this.b={},this.l=[],this.o=r,this.j=e,this.v=t,this.A=n,this.i=this.a=null,this.f=this.g=this.h=this.c=0}function Ii(e,t,n,r,i){e.b[t]=e.b[t]||[],e.b[t].push({uris:n.a(),X:n.X,M:n.M,Rb:r,Hb:i})}function Mi(e,t){e.c=0,e.h=0,e.g=0,e.f=0,G(e.b).forEach(function(e){e.forEach(function(e){null!=e.M?this.c+=e.M-e.X+1:this.g+=e.Rb}.bind(this))}.bind(e)),e.a=t,e.a.size=e.c;var n=G(e.b).map(function(e){var t=0,n=function(){return this.o?t>=e.length?Promise.resolve():Ci(this,e[t++]).then(n):Promise.reject(new u(2,9,9002))}.bind(this);return n()}.bind(e));return e.b={},e.i=Promise.all(n).then(function(){return bi(this.j,"manifest",t)}.bind(e)).then(function(){this.l=[]}.bind(e)),e.i}function Ci(e,t){var n=L(t.uris,e.A);(t.X||null!=t.M)&&(n.headers.Range="bytes="+t.X+"-"+(null==t.M?"":t.M));var r;return e.v.request(1,n).then(function(e){return this.a?(r=e.data.byteLength,this.l.push(t.Hb.key),t.Hb.data=e.data,bi(this.j,"segment",t.Hb)):Promise.reject(new u(2,9,9002))}.bind(e)).then(function(){if(!this.a)return Promise.reject(new u(2,9,9002));null==t.M?(this.a.size+=r,this.f+=t.Rb):this.h+=r;var e=(this.h+this.f)/(this.c+this.g),n=Si(this.a);this.o.progressCallback(n,e)}.bind(e))}function Ni(){this.a=-1}function Ui(e){var t=new Sn(null,0);t.pa(e.duration);var n=e.drmInfo?[e.drmInfo]:[];return{presentationTimeline:t,minBufferTime:10,offlineSessionIds:e.sessionIds,periods:e.periods.map(function(e){return Oi(e,n,t)})}}function ji(e){if(/^offline:([0-9]+)$/.exec(e)){var t={uri:e,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return Promise.resolve(t)}if(t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e)){var n=Number(t[1]),r=Li();return r?r.init(Zo).then(function(){return r.get("segment",n)}).then(function(t){return r.m().then(function(){if(!t)throw new u(2,9,9003,n);return{uri:e,data:t.data,headers:{}}})}):Promise.reject(new u(2,9,9e3))}return Promise.reject(new u(2,1,9004,e))}function Fi(){this.a=Promise.resolve(),this.b=this.c=this.f=!1,this.i=new Promise(function(e){this.g=e}.bind(this))}function Bi(e){return e.f||(e.a=e.a.then(function(e){return this.c=!0,Promise.resolve(e)}.bind(e),function(e){return this.c=!0,this.b?(this.g(),Promise.reject(this.h)):Promise.reject(e)}.bind(e))),e.f=!0,e.a}function Gi(e,t){pt.call(this),this.O=!1,this.f=e,this.A=null,this.l=new C,this.Qb=new at,this.Ya=this.c=this.h=this.a=this.v=this.g=this.Wa=this.ja=this.N=this.j=this.o=null,this.Dc=1e9,this.Va=[],this.ka=!1,this.Za=!0,this.la=this.J=null,this.G={},this.Xa=[],this.B={},this.b=$i(this),this.ob={width:1/0,height:1/0},this.i=Ji(),this.Ua=0,this.ia=this.b.preferredAudioLanguage,this.Ca=this.b.preferredTextLanguage,this.lb=this.mb="",t&&t(this),this.o=new R(this.de.bind(this)),this.Wa=Hi(this);for(var n=0;n<this.f.textTracks.length;++n){var r=this.f.textTracks[n];r.mode="disabled","Shaka Player TextTrack"==r.label&&(this.A=r)}this.A||(this.A=this.f.addTextTrack("subtitles","Shaka Player TextTrack")),this.A.mode="hidden",N(this.l,this.f,"error",this.yd.bind(this))}function Vi(e){function t(e){return(e.video?e.video.codecs.split(".")[0]:"")+"-"+(e.audio?e.audio.codecs.split(".")[0]:"")}var n={};e.c.periods.forEach(function(e){e.variants.forEach(function(e){var r=t(e);r in n||(n[r]=[]),n[r].push(e)})});var r=null,i=1/0;K(n,function(e,t){var n=0,a=0;t.forEach(function(e){n+=e.bandwidth,++a});var o=n/a;o<i&&(r=e,i=o)}),e.c.periods.forEach(function(e){e.variants=e.variants.filter(function(e){return t(e)==r})})}function Hi(t){t.N=new MediaSource;var n=new P;return N(t.l,t.N,"sourceopen",n.resolve),t.f.src=e.URL.createObjectURL(t.N),n}function Ki(e){if(e.h&&e.h.configure(e.b.manifest),e.j&&e.j.configure(e.b.drm),e.a){e.a.configure(e.b.streaming);try{e.c.periods.forEach(e.fb.bind(e))}catch(t){e.ya(t)}na(e,Wr(e.a))}e.b.abr.enabled&&!e.Za?e.b.abr.manager.enable():e.b.abr.manager.disable(),e.b.abr.manager.setDefaultEstimate(e.b.abr.defaultBandwidthEstimate),e.b.abr.manager.setRestrictions(e.b.abr.restrictions)}function Yi(e,t,n){e.i.switchHistory.push({timestamp:Date.now()/1e3,id:t.id,type:t.type,fromAdaptation:n}),Wi(e,t)}function Wi(e,t){var n=it(e.c,t);e.B[n]||(e.B[n]={}),e.B[n][t.type]=t.id}function qi(e){e.l&&(e.l.ha(e.N,"sourceopen"),e.l.ha(e.f,"loadeddata"),e.l.ha(e.f,"playing"),e.l.ha(e.f,"pause"),e.l.ha(e.f,"ended")),e.f&&(e.f.removeAttribute("src"),e.f.load());var t=Promise.all([e.b?e.b.abr.manager.stop():null,e.j?e.j.m():null,e.ja?e.ja.m():null,e.g?e.g.m():null,e.v?e.v.m():null,e.a?e.a.m():null,e.h?e.h.stop():null]);return e.j=null,e.ja=null,e.g=null,e.v=null,e.a=null,e.h=null,e.c=null,e.Ya=null,e.Wa=null,e.N=null,e.Xa=[],e.B={},e.G={},e.i=Ji(),t}function zi(e){return e.h?qi(e).then(function(){this.O||(this.zc(!1),this.Wa=Hi(this))}.bind(e)):Promise.resolve()}function Xi(){return{".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:null}}}function $i(e){return{drm:{retryParameters:D(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1},manifest:{retryParameters:D(),dash:{customScheme:function(e){if(e)return null},clockSyncUri:"",ignoreDrmInfo:!1},hls:{defaultTimeOffset:0}},streaming:{retryParameters:D(),infiniteRetriesForLiveStreams:!0,rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1},abr:{manager:e.Qb,enabled:!0,defaultBandwidthEstimate:5e5,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}}}function Ji(){return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:0,bufferingTime:0,switchHistory:[],stateHistory:[]}}function Qi(e,t,n){for(var r in t){var i=t[r],a=n||!1;"text"==r&&(a=!0),e.Za?e.G[r]={stream:i,Kc:a}:$r(e.a,r,i,a)}}function Zi(e){if(e.c){var t=Date.now()/1e3;e.ka?e.i.bufferingTime+=t-e.Ua:e.i.playTime+=t-e.Ua,e.Ua=t}}function ea(e,t){function n(e,t){if(!e)return null;var n=e.findSegmentPosition(t-i.startTime);return null==n?null:(n=e.getSegmentReference(n))?n.startTime+i.startTime:null}var r=qr(e.a),i=Wr(e.a),a=n(r.video,t),r=n(r.audio,t);return null!=a&&null!=r?Math.max(a,r):null!=a?a:null!=r?r:t}function ta(e,t,n,r,i){if(!n||1>n.length)return e.ya(new u(2,4,4012)),{};e.b.abr.manager.setVariants(n),e.b.abr.manager.setTextStreams(r);var a=[];i&&(a=["video","audio"],t.textStreams.length&&a.push("text")),i=qr(e.a);var o=e.a,s=o.c.video||o.c.audio;if(o=s?o.b.periods[s.wa]:null,t=et(i.audio,i.video,o?o.variants:t.variants)){t.allowedByApplication&&t.allowedByKeySystem||(a.push("audio"),a.push("video"));for(var l in i)t=i[l],"audio"==t.type&&t.language!=n[0].language?a.push(l):"text"==t.type&&0<r.length&&t.language!=r[0].language&&a.push(l)}if(a=a.filter(w),0<a.length){n={};try{n=e.b.abr.manager.chooseStreams(a)}catch(t){e.ya(t)}return n}return{}}function na(e,t){var n,r={audio:!1,text:!1},i=Qe(t,e.ia,r,e.mb),a=Ze(t,e.Ca,r,e.lb),i=ta(e,t,i,a);for(n in i)Yi(e,i[n],!0);Qi(e,i,!0),ra(e),i.text&&i.audio&&r.text&&i.text.language!=i.audio.language&&(e.A.mode="showing",aa(e))}function ra(e){Promise.resolve().then(function(){this.O||this.dispatchEvent(new st("adaptation"))}.bind(e))}function ia(e){Promise.resolve().then(function(){this.O||this.dispatchEvent(new st("trackschanged"))}.bind(e))}function aa(e){e.dispatchEvent(new st("texttrackvisibility"))}function oa(e){if(!e||e.constructor!=Gi)throw new u(2,9,9008);this.a=Li(),this.f=e,this.i=la(this),this.b=null,this.v=!1,this.j=null,this.g=-1,this.l=0,this.c=null,this.h=new xi(this.a,e.o,e.getConfiguration().streaming.retryParameters,this.i)}function sa(){return!!e.indexedDB}function ua(e,t,n,r){function i(){}var a,o,s,u=e.f.o,l=e.f.getConfiguration();return kn(t,u,l.manifest.retryParameters,r).then(function(e){return pa(this),s=new e,s.configure(l.manifest),s.start(t,{networkingEngine:u,filterPeriod:this.o.bind(this),onTimelineRegionAdded:function(){},onEvent:function(){},onError:n})}.bind(e)).then(function(e){return pa(this),a=e,o=new re(u,n,i,function(){}),o.configure(l.drm),o.init(a,!0)}.bind(e)).then(function(){return pa(this),da(a)}.bind(e)).then(function(){return pa(this),oe(o)}.bind(e)).then(function(){return pa(this),s.stop()}.bind(e)).then(function(){return pa(this),{manifest:a,Lc:o}}.bind(e)).catch(function(e){if(s)return s.stop().then(function(){throw e});throw e})}function la(e){return{trackSelectionCallback:e.A.bind(e),progressCallback:function(e,t){if(e||t)return null}}}function ca(e){return e.a?e.a.a?Promise.resolve():e.a.init(Zo):Promise.reject(new u(2,9,9e3))}function fa(e){var t=e.b?e.b.m():Promise.resolve();return e.b=null,e.c=null,e.v=!1,e.j=null,e.g=-1,t}function da(e){var t=e.periods.map(function(e){return e.variants}).reduce(b,[]).map(function(e){var t=[];return e.audio&&t.push(e.audio),e.video&&t.push(e.video),t}).reduce(b,[]).filter(w);return e=e.periods.map(function(e){return e.textStreams}).reduce(b,[]),t.push.apply(t,e),Promise.all(t.map(function(e){return e.createSegmentIndex()}))}function ha(e,t,n,r,i){for(var a=[],o=e.c.presentationTimeline.ma(),s=o,u=n.findSegmentPosition(o),l=null!=u?n.getSegmentReference(u):null;l;)s=e.a.c.segment++,Ii(e.h,n.type,l,(l.endTime-l.startTime)*r/8,{key:s,data:null,manifestKey:e.g,streamNumber:n.id,segmentNumber:s}),a.push({startTime:l.startTime,endTime:l.endTime,uri:"offline:"+e.g+"/"+n.id+"/"+s}),s=l.endTime+t.startTime,l=n.getSegmentReference(++u);return e.l=Math.max(e.l,s-o),t=null,n.initSegmentReference&&(s=e.a.c.segment++,t="offline:"+e.g+"/"+n.id+"/"+s,Ii(e.h,n.contentType,n.initSegmentReference,0,{key:s,data:null,manifestKey:e.g,streamNumber:n.id,segmentNumber:-1})),e=[],null!=i&&e.push(i),{id:n.id,primary:n.primary,presentationTimeOffset:n.presentationTimeOffset||0,contentType:n.type,mimeType:n.mimeType,codecs:n.codecs,frameRate:n.frameRate,kind:n.kind,language:n.language,label:n.label,width:n.width||null,height:n.height||null,initSegmentUri:t,encrypted:n.encrypted,keyId:n.keyId,segments:a,variantIds:e}}function pa(e){if(!e.f)throw new u(2,9,9002)}function va(e){ts.push(e)}function ya(e){var t=e.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();if("function"==typeof Event)var n=new Event(t,e);else n=document.createEvent("Event"),n.initEvent(t,e.bubbles,e.cancelable);e.target.dispatchEvent(n)}function ga(e){this.f=[],this.b=[],this.a=[],(new Wt).da("pssh",this.c.bind(this)).parse(e.buffer)}function ma(e,t){try{var n=new ba(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function ba(e,t){this.keySystem=e;for(var n=!1,r=0;r<t.length;++r){var i=t[r],a={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:i.initDataTypes,sessionTypes:["temporary"],label:i.label},o=!1;if(i.audioCapabilities)for(var s=0;s<i.audioCapabilities.length;++s){var u=i.audioCapabilities[s];if(u.contentType){o=!0;var l=u.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,l)&&(a.audioCapabilities.push(u),n=!0)}}if(i.videoCapabilities)for(s=0;s<i.videoCapabilities.length;++s)u=i.videoCapabilities[s],u.contentType&&(o=!0,l=u.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,l)&&(a.videoCapabilities.push(u),n=!0));if(o||(n=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),"required"==i.persistentState&&(a.persistentState="required",a.sessionTypes=["persistent-license"]),n)return void(this.a=a)}throw i=Error("Unsupported keySystem"),i.name="NotSupportedError",i.code=DOMException.NOT_SUPPORTED_ERR,i}function _a(e){var t=this.mediaKeys;return t&&t!=e&&Ta(t,null),delete this.mediaKeys,(this.mediaKeys=e)?Ta(e,this):Promise.resolve()}function Ea(e){this.a=new MSMediaKeys(e),this.b=new C}function Ta(e,t){function n(){t.msSetMediaKeys(r.a),t.removeEventListener("loadedmetadata",n)}if(j(e.b),!t)return Promise.resolve();N(e.b,t,"msneedkey",ka);var r=e;try{return 1<=t.readyState?t.msSetMediaKeys(e.a):t.addEventListener("loadedmetadata",n),Promise.resolve()}catch(e){return Promise.reject(e)}}function wa(e){pt.call(this),this.c=null,this.g=e,this.b=this.a=null,this.f=new C,this.sessionId="",this.expiration=NaN,this.closed=new P,this.keyStatuses=new Aa}function ka(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("encrypted",!1,!1,null),t.initDataType="cenc";var n=e.initData;if(n){var r=new ga(n);if(1>=r.a.length)e=n;else{var i=[];for(e=0;e<r.a.length;e++)i.push(n.subarray(r.a[e].start,r.a[e].end+1));for(n=x(i,Sa),e=r=0;e<n.length;e++)r+=n[e].length;for(r=new Uint8Array(r),e=i=0;e<n.length;e++)r.set(n[e],i),i+=n[e].length;e=r}}else e=n;t.initData=e,this.dispatchEvent(t)}function Sa(e,t){return ne(e,t)}function Oa(e,t){e.keyStatuses.Kb(t),e.dispatchEvent(new st("keystatuseschange"))}function Aa(){this.size=0,this.a=void 0}function Pa(){return Promise.reject(Error("The key system specified is not supported."))}function Ra(e){return e?Promise.reject(Error("MediaKeys not supported.")):Promise.resolve()}function Da(){throw new TypeError("Illegal constructor.")}function La(){throw new TypeError("Illegal constructor.")}function xa(t){rs=t,is=new Uint8Array([0]).buffer,navigator.requestMediaKeySystemAccess=Ma,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Ca,e.MediaKeys=Ua,e.MediaKeySystemAccess=Na}function Ia(e){var t=rs;return t?t+e.charAt(0).toUpperCase()+e.slice(1):e}function Ma(e,t){try{var n=new Na(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function Ca(e){var t=this.mediaKeys;return t&&t!=e&&ja(t,null),delete this.mediaKeys,(this.mediaKeys=e)&&ja(e,this),Promise.resolve()}function Na(e,t){this.a=this.keySystem=e;var n=!0;"org.w3.clearkey"==e&&(this.a="webkit-org.w3.clearkey",n=!1);for(var r=!1,i=document.getElementsByTagName("video"),a=i.length?i[0]:document.createElement("video"),o=0;o<t.length;++o){i=t[o];var s={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:i.initDataTypes,sessionTypes:["temporary"],label:i.label},u=!1;if(i.audioCapabilities)for(var l=0;l<i.audioCapabilities.length;++l){var c=i.audioCapabilities[l];if(c.contentType){var u=!0,f=c.contentType.split(";")[0];a.canPlayType(f,this.a)&&(s.audioCapabilities.push(c),r=!0)}}if(i.videoCapabilities)for(l=0;l<i.videoCapabilities.length;++l)c=i.videoCapabilities[l],c.contentType&&(u=!0,a.canPlayType(c.contentType,this.a)&&(s.videoCapabilities.push(c),r=!0));if(u||(r=a.canPlayType("video/mp4",this.a)||a.canPlayType("video/webm",this.a)),"required"==i.persistentState&&(n?(s.persistentState="required",s.sessionTypes=["persistent-license"]):r=!1),r)return void(this.b=s)}throw n="Unsupported keySystem","org.w3.clearkey"!=e&&"com.widevine.alpha"!=e||(n="None of the requested configurations were supported."),n=Error(n),n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function Ua(e){this.g=e,this.b=null,this.a=new C,this.c=[],this.f={}}function ja(e,t){e.b=t,j(e.a);var n=rs;t&&(N(e.a,t,n+"needkey",e.Cd.bind(e)),N(e.a,t,n+"keymessage",e.Bd.bind(e)),N(e.a,t,n+"keyadded",e.zd.bind(e)),N(e.a,t,n+"keyerror",e.Ad.bind(e)))}function Fa(e,t){var n=e.f[t];return n||((n=e.c.shift())?(n.sessionId=t,e.f[t]=n):null)}function Ba(e,t,n){pt.call(this),this.f=e,this.h=!1,this.a=this.b=null,this.c=t,this.g=n,this.sessionId="",this.expiration=NaN,this.closed=new P,this.keyStatuses=new Ha}function Ga(e,t,n){if(e.h)return Promise.reject(Error("The session is already initialized."));e.h=!0;try{if("persistent-license"==e.g)if(n)var r=new Uint8Array(z("LOAD_SESSION|"+n));else{var i=z("PERSISTENT|"),a=new Uint8Array(i.byteLength+t.byteLength);a.set(new Uint8Array(i),0),a.set(new Uint8Array(t),i.byteLength),r=a}else r=new Uint8Array(t)}catch(e){return Promise.reject(e)}e.b=new P;var o=Ia("generateKeyRequest");try{e.f[o](e.c,r)}catch(t){if("InvalidStateError"!=t.name)return e.b=null,Promise.reject(t);setTimeout(function(){try{this.f[o](this.c,r)}catch(e){this.b.reject(e),this.b=null}}.bind(e),10)}return e.b}function Va(e,t){e.keyStatuses.Kb(t),e.dispatchEvent(new st("keystatuseschange"))}function Ha(){this.size=0,this.a=void 0}function Ka(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=e.apply(this,arguments);return t.abort=function(){},t}}function Ya(){var e=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream=function(){for(var t,n=0,r=0;r<this.sourceBuffers.length;++r)t=this.sourceBuffers[r],t=t.buffered.end(t.buffered.length-1),n=Math.max(n,t);if(!isNaN(this.duration)&&n<this.duration)for(this.Zb=!0,r=0;r<this.sourceBuffers.length;++r)t=this.sourceBuffers[r],t.Tb=!1;return e.apply(this,arguments)};var t=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var e=t.apply(this,arguments);return e.N=this,e.addEventListener("updateend",Wa,!1),this.a||(this.addEventListener("sourceclose",qa,!1),this.a=!0),e}}function Wa(e){var t=e.target,n=t.N;if(n.Zb){for(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t.Tb=!0,e=0;e<n.sourceBuffers.length;++e)if(0==n.sourceBuffers[e].Tb)return;n.Zb=!1}}function qa(e){e=e.target;for(var t=0;t<e.sourceBuffers.length;++t)e.sourceBuffers[t].removeEventListener("updateend",Wa,!1);e.removeEventListener("sourceclose",qa,!1)}function za(e){if(this.c=[],this.b=[],this.Aa=as,e)try{e(this.fa.bind(this),this.a.bind(this))}catch(e){this.a(e)}}function Xa(e){var t=new za;return t.fa(void 0),t.then(function(){return e})}function $a(e){var t=new za;return t.a(e),t}function Ja(e){function t(e,t,n){e.Aa==as&&(i[t]=n,++r==i.length&&e.fa(i))}var n=new za;if(!e.length)return n.fa([]),n;for(var r=0,i=Array(e.length),a=n.a.bind(n),o=0;o<e.length;++o)e[o]&&e[o].then?e[o].then(t.bind(null,n,o),a):t(n,o,e[o]);return n}function Qa(e){for(var t=new za,n=t.fa.bind(t),r=t.a.bind(t),i=0;i<e.length;++i)e[i]&&e[i].then?e[i].then(n,r):n(e[i]);return t}function Za(e,t,n){ss.push(function(){if(n&&"function"==typeof n){try{var e=n(this.jb)}catch(e){return void t.a(e)}try{var r=e&&e.then}catch(e){return void t.a(e)}e instanceof za?e==t?t.a(new TypeError("Chaining cycle detected")):e.then(t.fa.bind(t),t.a.bind(t)):r?eo(e,r,t):t.fa(e)}else 1==this.Aa?t.fa(this.jb):t.a(this.jb)}.bind(e)),null==os&&(os=no(to))}function eo(e,t,n){try{var r=!1;t.call(e,function(e){if(!r){r=!0;try{var t=e&&e.then}catch(e){return void n.a(e)}t?eo(e,t,n):n.fa(e)}},n.a.bind(n))}catch(e){n.a(e)}}function to(){for(;ss.length;){null!=os&&(ro(os),os=null);var e=ss;ss=[];for(var t=0;t<e.length;++t)e[t]()}}function no(){return 0}function ro(){}function io(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function ao(t,n,r){return new e.TextTrackCue(t,n,r)}function oo(t,n,r){return new e.TextTrackCue(t+"-"+n+"-"+r,t,n,r)}var so,uo=this;uo.we=!0,o.prototype.setDefaultEstimate=function(e){this.b=e},o.prototype.getBandwidthEstimate=function(){return 128e3>this.a?this.b:Math.min(a(this.c),a(this.f))},t("shaka.util.Error",u),u.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},u.Severity={RECOVERABLE:1,CRITICAL:2},u.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},u.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,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};var lo=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;so=l.prototype,so.aa="",so.Ba="",so.ca="",so.Ja=null,so.W="",so.ta="",so.toString=function(){var e=[],t=this.aa;if(t&&e.push(p(t,co,!0),":"),t=this.ca){e.push("//");var n=this.Ba;n&&e.push(p(n,co,!0),"@"),e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t=this.Ja,null!=t&&e.push(":",String(t))}return(t=this.W)&&(this.ca&&"/"!=t.charAt(0)&&e.push("/"),e.push(p(t,"/"==t.charAt(0)?ho:fo,!0))),(t=this.a.toString())&&e.push("?",t),(t=this.ta)&&e.push("#",p(t,vo)),e.join("")},so.resolve=function(e){var t=new l(this);"data"===t.aa&&(t=new l);var n=!!e.aa;n?c(t,e.aa):n=!!e.Ba,n?t.Ba=e.Ba:n=!!e.ca,n?t.ca=e.ca:n=null!=e.Ja;var r=e.W;if(n)f(t,e.Ja);else if(n=!!e.W){if("/"!=r.charAt(0))if(this.ca&&!this.W)r="/"+r;else{var i=t.W.lastIndexOf("/");-1!=i&&(r=t.W.substr(0,i+1)+r)}if(".."==r||"."==r)r="";else if(-1!=r.indexOf("./")||-1!=r.indexOf("/.")){for(var i=!r.lastIndexOf("/",0),r=r.split("/"),a=[],o=0;o<r.length;){var s=r[o++];"."==s?i&&o==r.length&&a.push(""):".."==s?((1<a.length||1==a.length&&""!=a[0])&&a.pop(),i&&o==r.length&&a.push("")):(a.push(s),i=!0)}r=a.join("/")}}return n?t.W=r:n=""!==e.a.toString(),n?d(t,g(e.a)):n=!!e.ta,n&&(t.ta=e.ta),t};var co=/[#\/\?@]/g,fo=/[\#\?:]/g,ho=/[\#\?]/g,po=/[\#\?@]/g,vo=/#/g;y.prototype.a=null,y.prototype.c=null,y.prototype.toString=function(){if(this.b)return this.b;if(!this.a)return"";var e,t=[];for(e in this.a)for(var n=encodeURIComponent(e),r=this.a[e],i=0;i<r.length;i++){var a=n;""!==r[i]&&(a+="="+encodeURIComponent(r[i])),t.push(a)}return this.b=t.join("&")},t("shaka.net.NetworkingEngine",R),R.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3};var yo={};R.registerScheme=function(e,t){yo[e]=t},R.unregisterScheme=function(e){delete yo[e]},R.prototype.Ld=function(e){this.b.push(e)},R.prototype.registerRequestFilter=R.prototype.Ld,R.prototype.oe=function(e){var t=this.b;0<=(e=t.indexOf(e))&&t.splice(e,1)},R.prototype.unregisterRequestFilter=R.prototype.oe,R.prototype.Ic=function(){this.b=[]},R.prototype.clearAllRequestFilters=R.prototype.Ic,R.prototype.Md=function(e){this.c.push(e)},R.prototype.registerResponseFilter=R.prototype.Md,R.prototype.pe=function(e){var t=this.c;0<=(e=t.indexOf(e))&&t.splice(e,1)},R.prototype.unregisterResponseFilter=R.prototype.pe,R.prototype.Jc=function(){this.c=[]},R.prototype.clearAllResponseFilters=R.prototype.Jc,R.prototype.m=function(){this.f=!0,this.b=[],this.c=[];for(var e=[],t=0;t<this.a.length;++t)e.push(this.a[t].catch(_));return Promise.all(e)},R.prototype.destroy=R.prototype.m,R.prototype.request=function(t,n){if(this.f)return Promise.reject();n.method=n.method||"GET",n.headers=n.headers||{},n.retryParameters=n.retryParameters?A(n.retryParameters):D(),n.uris=A(n.uris);var r=Date.now(),i=Promise.resolve();return this.b.forEach(function(e){i=i.then(e.bind(null,t,n))}),i=i.catch(function(e){throw new u(2,1,1006,e)}),i=i.then(function(){for(var i=Date.now()-r,a=n.retryParameters||{},o=a.maxAttempts||1,s=a.backoffFactor||2,a=null==a.baseDelay?1e3:a.baseDelay,u=this.g(t,n,0,i),l=1;l<o;l++)u=u.catch(function(r,a,o){if(o&&1==o.severity){o=new P;var s=n.retryParameters||{};return e.setTimeout(o.resolve,r*(1+(2*Math.random()-1)*(null==s.fuzzFactor?.5:s.fuzzFactor))),o.then(this.g.bind(this,t,n,a,i))}throw o}.bind(this,a,l%n.uris.length)),a*=s;return u}.bind(this)),this.a.push(i),i.then(function(e){return 0<=this.a.indexOf(i)&&this.a.splice(this.a.indexOf(i),1),this.h&&!e.fromCache&&1==t&&this.h(e.timeMs,e.data.byteLength),e}.bind(this)).catch(function(e){return e&&(e.severity=2),0<=this.a.indexOf(i)&&this.a.splice(this.a.indexOf(i),1),Promise.reject(e)}.bind(this))},R.prototype.request=R.prototype.request,R.prototype.g=function(e,t,n,r){if(this.f)return Promise.reject();var i=new l(t.uris[n]),a=i.aa;if(a||(a=location.protocol,a=a.slice(0,-1),c(i,a),t.uris[n]=i.toString()),!(a=yo[a]))return Promise.reject(new u(2,1,1e3,i));var o=Date.now();return a(t.uris[n],t,e).then(function(t){void 0==t.timeMs&&(t.timeMs=Date.now()-o);var n=Date.now(),i=Promise.resolve();return this.c.forEach(function(n){i=i.then(function(){return Promise.resolve(n(e,t))}.bind(this))}),i=i.catch(function(e){var t=2;throw e instanceof u&&(t=e.severity),new u(t,1,1007,e)}),i.then(function(){return t.timeMs+=Date.now()-n,t.timeMs+=r,t})}.bind(this))},M.prototype.push=function(e,t){this.a.hasOwnProperty(e)?this.a[e].push(t):this.a[e]=[t]},M.prototype.get=function(e){return(e=this.a[e])?e.slice():null},M.prototype.remove=function(e,t){var n=this.a[e];if(n)for(var r=0;r<n.length;++r)n[r]==t&&(n.splice(r,1),--r)},C.prototype.m=function(){return j(this),this.a=null,Promise.resolve()},C.prototype.ha=function(e,t){if(this.a)for(var n=this.a.get(t)||[],r=0;r<n.length;++r){var i=n[r];i.target==e&&(i.ha(),this.a.remove(t,i))}},F.prototype.ha=function(){this.target.removeEventListener(this.type,this.a,!1),this.a=this.target=null},t("shaka.util.StringUtils.fromUTF8",Y),t("shaka.util.StringUtils.fromUTF16",W),t("shaka.util.StringUtils.fromBytesAutoDetect",q),t("shaka.util.StringUtils.toUTF8",z),$.prototype.cancel=function(){null!=this.a&&(clearTimeout(this.a),this.a=null)},t("shaka.util.Uint8ArrayUtils.toBase64",Q),t("shaka.util.Uint8ArrayUtils.fromBase64",Z),t("shaka.util.Uint8ArrayUtils.fromHex",ee),t("shaka.util.Uint8ArrayUtils.toHex",te),t("shaka.util.Uint8ArrayUtils.equal",ne),t("shaka.util.Uint8ArrayUtils.concat",function(e){for(var t=0,n=0;n<arguments.length;++n)t+=arguments[n].length;for(var t=new Uint8Array(t),r=0,n=0;n<arguments.length;++n)t.set(arguments[n],r),r+=arguments[n].length;return t}),so=re.prototype,so.m=function(){this.c=!0;var e=this.a.map(function(e){return(e.ba.close()||Promise.resolve()).catch(_)});return this.l.reject(),this.f&&e.push(this.f.m()),this.j&&e.push(this.j.setMediaKeys(null).catch(_)),this.O&&(clearInterval(this.O),this.O=null),this.B&&this.B.cancel(),this.f=this.j=this.i=this.v=this.b=this.B=null,this.a=[],this.o=[],this.la=this.g=this.h=this.ka=null,Promise.all(e)},so.configure=function(e){this.h=e},so.init=function(e,t){var n={},r=[];return this.ja=t,this.o=e.offlineSessionIds,ue(this,e,t||0<e.offlineSessionIds.length,n,r),r.length?le(this,n,r):(this.J=!0,Promise.resolve())},so.keySystem=function(){return this.b?this.b.keySystem:""},so.ab=function(){var e=this.a.map(function(e){return e=e.ba.expiration,isNaN(e)?1/0:e});return Math.min.apply(Math,e)},so.fd=function(e){for(var t=new Uint8Array(e.initData),n=0;n<this.a.length;++n)if(ne(t,this.a[n].initData))return;ve(this,e.initDataType,t)},so.kc=function(e){this.h.delayLicenseRequestUntilPlayed&&this.j.paused&&!this.ia?this.G.push(e):ye(this,e)},so.ec=function(e){e=e.target;var t;for(t=0;t<this.a.length&&this.a[t].ba!=e;++t);if(t!=this.a.length){var n=!1;e.keyStatuses.forEach(function(e,r){if("string"==typeof r){var i=r;r=e,e=i}if("com.microsoft.playready"==this.b.keySystem&&16==r.byteLength){var i=new DataView(r),a=i.getUint32(0,!0),o=i.getUint16(4,!0),s=i.getUint16(6,!0);i.setUint32(0,a,!1),i.setUint16(4,o,!1),i.setUint16(6,s,!1)}"com.microsoft.playready"==this.b.keySystem&&"status-pending"==e&&(e="usable"),"status-pending"!=e&&(this.a[t].loaded=!0,this.a.every(function(e){return e.loaded})&&this.l.resolve()),"expired"==e&&(n=!0),i=te(new Uint8Array(r)),this.A[i]=e}.bind(this));var r=e.expiration-Date.now();(0>r||n&&1e3>r)&&!this.a[t].ib&&(this.a.splice(t,1),e.close()),J(this.B)}},so.Kd=function(){function e(e,t){return"expired"==t}!B(this.A)&&H(this.A,e)&&this.g(new u(2,6,6014)),this.Ca(this.A)},so.qd=function(){for(var e=0;e<this.G.length;e++)ye(this,this.G[e]);this.ia=!0,this.G=[]},so.Jd=function(){this.a.forEach(function(e){var t=e.zb,n=e.ba.expiration;isNaN(n)&&(n=1/0),n!=t&&(this.la(e.ba.sessionId,n),e.zb=n)}.bind(this))};var go={};t("shaka.media.TextEngine.registerParser",Te),t("shaka.media.TextEngine.unregisterParser",function(e){delete go[e]}),t("shaka.media.TextEngine.makeCue",we),Ee.prototype.m=function(){return this.c&&Se(this,function(){return!0}),this.c=this.f=null,Promise.resolve()},Ee.prototype.remove=function(e,t){return Promise.resolve().then(function(){this.c&&(Se(this,function(n){return!(n.startTime>=t||n.endTime<=e)}),null==this.b||t<=this.b||e>=this.a||(e<=this.b&&t>=this.a?this.b=this.a=null:e<=this.b&&t<this.a?this.b=t:e>this.b&&t>=this.a&&(this.a=e)))}.bind(this))},Oe.prototype.parseInit=function(e){this.Na(e,0,null,null)},Oe.prototype.parseMedia=function(e,t){return this.Na(e,t.periodStart,t.segmentStart,t.segmentEnd)},so=De.prototype,so.m=function(){this.h=!0;var e,t=[];for(e in this.b){var n=this.b[e],r=n[0];for(this.b[e]=n.slice(0,1),r&&t.push(r.p.catch(_)),r=1;r<n.length;++r)n[r].p.catch(_),n[r].p.reject()}return this.a&&t.push(this.a.m()),Promise.all(t).then(function(){this.g.m(),this.a=this.i=this.N=this.f=this.g=null,this.c={},this.b={}}.bind(this))},so.init=function(e){for(var t in e){var n=e[t];"text"==t?xe(this,n):(n=this.N.addSourceBuffer(n),N(this.g,n,"error",this.je.bind(this,t)),N(this.g,n,"updateend",this.Ia.bind(this,t)),this.c[t]=n,this.b[t]=[])}},so.remove=function(e,t,n){return"text"==e?this.a.remove(t,n):je(this,e,this.qc.bind(this,e,t,n))},so.endOfStream=function(e){return Fe(this,function(){e?this.N.endOfStream(e):this.N.endOfStream()}.bind(this))},so.pa=function(e){return Fe(this,function(){this.N.duration=e}.bind(this))},so.Y=function(){return this.N.duration},so.ie=function(e,t){this.c[e].appendBuffer(t)},so.qc=function(e,t,n){n<=t?this.Ia(e):this.c[e].remove(t,n)},so.Ec=function(e){var t=this.c[e].appendWindowEnd;this.c[e].abort(),this.c[e].appendWindowEnd=t,this.Ia(e)},so.Oc=function(e){this.f.currentTime-=.001,this.Ia(e)},so.Zd=function(e,t){this.c[e].timestampOffset=t,this.Ia(e)},so.Xd=function(e,t){this.c[e].appendWindowEnd=t+.04,this.Ia(e)},so.je=function(e){this.b[e][0].p.reject(new u(2,3,3014,this.f.error?this.f.error.code:0))},so.Ia=function(e){var t=this.b[e][0];t&&(t.p.resolve(),Be(this,e))};var mo=1,bo=2,_o={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"};t("shaka.abr.SimpleAbrManager",at),at.prototype.stop=function(){this.f=null,this.b=!1,this.h=[],this.g=[],this.c=null},at.prototype.stop=at.prototype.stop,at.prototype.init=function(e){this.f=e},at.prototype.init=at.prototype.init,at.prototype.chooseStreams=function(e){var t={};if(-1<e.indexOf("audio")||-1<e.indexOf("video")){var n=this.h,r=ot(this.i,n),i=this.a.getBandwidthEstimate();if(n.length&&!r.length)throw new u(2,4,4012);for(var n=r[0],a=0;a<r.length;++a){var o=r[a],s=(r[a+1]||{bandwidth:1/0}).bandwidth/.85;i>=o.bandwidth/.95&&i<=s&&(n=o)}(r=n)&&r.video&&(t.video=r.video),r&&r.audio&&(t.audio=r.audio)}return-1<e.indexOf("text")&&(t.text=this.g[0]),this.c=Date.now(),t},at.prototype.chooseStreams=at.prototype.chooseStreams,at.prototype.enable=function(){this.b=!0},at.prototype.enable=at.prototype.enable,at.prototype.disable=function(){this.b=!1},at.prototype.disable=at.prototype.disable,at.prototype.segmentDownloaded=function(e,t){var n=this.a;if(!(16e3>t)){var r=8e3*t/e,a=e/1e3;n.a+=t,i(n.c,a,r),i(n.f,a,r)}if(null!=this.c&&this.b)e:{if(this.j){if(8e3>Date.now()-this.c)break e}else{if(!(128e3<=this.a.a))break e;this.j=!0}n=this.chooseStreams(["audio","video"]),this.a.getBandwidthEstimate(),this.f(n)}},at.prototype.segmentDownloaded=at.prototype.segmentDownloaded,at.prototype.getBandwidthEstimate=function(){return this.a.getBandwidthEstimate()},at.prototype.getBandwidthEstimate=at.prototype.getBandwidthEstimate,at.prototype.setDefaultEstimate=function(e){this.a.setDefaultEstimate(e)},at.prototype.setDefaultEstimate=at.prototype.setDefaultEstimate,at.prototype.setRestrictions=function(e){this.i=e},at.prototype.setRestrictions=at.prototype.setRestrictions,at.prototype.setVariants=function(e){this.h=e},at.prototype.setVariants=at.prototype.setVariants,at.prototype.setTextStreams=function(e){this.g=e},at.prototype.setTextStreams=at.prototype.setTextStreams,st.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},st.prototype.stopImmediatePropagation=function(){this.a=!0},st.prototype.stopPropagation=function(){};var Eo="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),To="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),wo=["loop","playbackRate"],ko=["pause","play"],So="adaptation buffering emsg error loading unloading texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged".split(" "),Oo="drmInfo getAudioLanguages getConfiguration getExpiration getManifestUri getPlaybackRate getPlayheadTimeAsDate getTextLanguages getTextTracks getTracks getStats getVariantTracks isBuffering isInProgress isLive isTextTrackVisible keySystem seekRange".split(" "),Ao=[["getConfiguration","configure"]],Po=[["isTextTrackVisible","setTextTrackVisibility"]],Ro="addTextTrack cancelTrickPlay configure resetConfiguration selectAudioLanguage selectTextLanguage selectTextTrack selectTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "),Do=["load","unload"];so=ft.prototype,so.m=function(){return dt(this),this.a&&(this.a.leave(function(){},function(){}),this.a=null),this.G=this.B=this.l=null,this.c=this.j=this.h=!1,this.g=this.f=this.b=this.i=null,Promise.resolve()},so.V=function(){return this.c},so.Fb=function(){return this.A},so.init=function(){if(e.chrome&&chrome.cast&&chrome.cast.isAvailable){delete e.__onGCastApiAvailable,this.h=!0,this.l();var t=new chrome.cast.SessionRequest(this.J),t=new chrome.cast.ApiConfig(t,this.gd.bind(this),this.sd.bind(this),"origin_scoped");chrome.cast.initialize(t,function(){},function(){})}else e.__onGCastApiAvailable=function(e){e&&this.init()}.bind(this)},so.Ib=function(e){this.i=e,this.c&&ht(this,{type:"appData",appData:this.i})},so.cast=function(e){return this.h?this.j?this.c?Promise.reject(new u(1,8,8002)):(this.g=new P,chrome.cast.requestSession(this.Bb.bind(this,e),this.cc.bind(this)),this.g):Promise.reject(new u(1,8,8001)):Promise.reject(new u(1,8,8e3))},so.$a=function(){this.c&&(dt(this),this.a&&(this.a.stop(function(){},function(){}),this.a=null))},so.get=function(e,t){if("video"==e){if(0<=ko.indexOf(t))return this.pc.bind(this,e,t)}else if("player"==e){if(0<=Ro.indexOf(t))return this.pc.bind(this,e,t);if(0<=Do.indexOf(t))return this.Od.bind(this,e,t);if(0<=Oo.indexOf(t))return this.lc.bind(this,e,t)}return this.lc(e,t)},so.set=function(e,t,n){this.b[e][t]=n,ht(this,{type:"set",targetName:e,property:t,value:n})},so.Bb=function(e,t){this.a=t,this.a.addUpdateListener(this.dc.bind(this)),this.a.addMessageListener("urn:x-cast:com.google.shaka.v2",this.md.bind(this)),this.dc(),ht(this,{type:"init",initState:e,appData:this.i}),this.g.resolve()},so.cc=function(e){var t=8003;switch(e.code){case"cancel":t=8004;break;case"timeout":t=8005;break;case"receiver_unavailable":t=8006}this.g.reject(new u(2,8,t,e))},so.lc=function(e,t){return this.b[e][t]},so.pc=function(e,t){ht(this,{type:"call",targetName:e,methodName:t,args:Array.prototype.slice.call(arguments,2)})},so.Od=function(e,t){var n=Array.prototype.slice.call(arguments,2),r=new P,i=this.o.toString();return this.o++,this.f[i]=r,ht(this,{type:"asyncCall",targetName:e,methodName:t,args:n,id:i}),r},so.gd=function(e){var t=this.v();this.g=new P,this.Bb(t,e)},so.sd=function(e){this.j="available"==e,this.l()},so.dc=function(){var e=!!this.a&&"connected"==this.a.status;if(this.c&&!e){this.G();for(var t in this.b)this.b[t]={};dt(this)}this.A=(this.c=e)?this.a.receiver.friendlyName:"",this.l()},so.md=function(e,t){var n=lt(t);switch(n.type){case"event":var r=n.targetName,i=n.event;this.B(r,new st(i.type,i));break;case"update":i=n.update;for(r in i){var n=this.b[r]||{};for(a in i[r])n[a]=i[r][a]}break;case"asyncComplete":r=n.id;var a=n.error;if(n=this.f[r],delete this.f[r],n)if(a){r=new u(a.severity,a.category,a.code);for(i in a)r[i]=a[i];n.reject(r)}else n.resolve()}},pt.prototype.addEventListener=function(e,t){this.nb.push(e,t)},pt.prototype.removeEventListener=function(e,t){this.nb.remove(e,t)},pt.prototype.dispatchEvent=function(e){for(var t=this.nb.get(e.type)||[],n=0;n<t.length;++n){e.target=this.Ta,e.currentTarget=this.Ta;var r=t[n];try{r.handleEvent?r.handleEvent(e):r.call(this,e)}catch(e){}if(e.a)break}return e.defaultPrevented},n(vt),t("shaka.cast.CastProxy",vt),vt.prototype.m=function(e){return e&&this.a&&this.a.$a(),e=[this.h?this.h.m():null,this.b?this.b.m():null,this.a?this.a.m():null],this.a=this.h=this.i=this.j=this.b=this.c=null,Promise.all(e)},vt.prototype.destroy=vt.prototype.m,vt.prototype.Zc=function(){return this.j},vt.prototype.getVideo=vt.prototype.Zc,vt.prototype.Tc=function(){return this.i},vt.prototype.getPlayer=vt.prototype.Tc,vt.prototype.Fc=function(){return!!this.a&&(this.a.h&&this.a.j)},vt.prototype.canCast=vt.prototype.Fc,vt.prototype.V=function(){return!!this.a&&this.a.V()},vt.prototype.isCasting=vt.prototype.V,vt.prototype.Fb=function(){return this.a?this.a.Fb():""},vt.prototype.receiverName=vt.prototype.Fb,vt.prototype.cast=function(){var e=this.Vb();return this.a.cast(e).then(function(){return this.b.hb()}.bind(this))},vt.prototype.cast=vt.prototype.cast,vt.prototype.Ib=function(e){this.a.Ib(e)},vt.prototype.setAppData=vt.prototype.Ib,vt.prototype.me=function(){var e=this.a;if(e.c){var t=e.v();chrome.cast.requestSession(e.Bb.bind(e,t),e.cc.bind(e))}},vt.prototype.suggestDisconnect=vt.prototype.me,vt.prototype.$a=function(){this.a.$a()},vt.prototype.forceDisconnect=vt.prototype.$a,so=vt.prototype,so.Vb=function(){var e={video:{},player:{},playerAfterLoad:{},manifest:this.b.Ya,startTime:null};return this.c.pause(),wo.forEach(function(t){e.video[t]=this.c[t]}.bind(this)),this.c.ended||(e.startTime=this.c.currentTime),Ao.forEach(function(t){var n=t[1];t=this.b[t[0]](),e.player[n]=t}.bind(this)),Po.forEach(function(t){var n=t[1];t=this.b[t[0]](),e.playerAfterLoad[n]=t}.bind(this)),e},so.ee=function(){this.dispatchEvent(new st("caststatuschanged"))},so.ge=function(){Ao.forEach(function(e){var t=e[1];e=this.a.get("player",e[0])(),this.b[t](e)}.bind(this));var e=this.a.get("player","getManifestUri")(),t=this.a.get("video","ended"),n=Promise.resolve(),r=this.c.autoplay,i=null;t||(i=this.a.get("video","currentTime")),e&&(this.c.autoplay=!1,n=this.b.load(e,i),n.catch(function(e){this.b.dispatchEvent(new st("error",{detail:e}))}.bind(this)));var a={};wo.forEach(function(e){a[e]=this.a.get("video",e)}.bind(this)),n.then(function(){wo.forEach(function(e){this.c[e]=a[e]}.bind(this)),Po.forEach(function(e){var t=e[1];e=this.a.get("player",e[0])(),this.b[t](e)}.bind(this)),this.c.autoplay=r,e&&this.c.play()}.bind(this))},so.se=function(e){if("addEventListener"==e)return this.g.addEventListener.bind(this.g);if("removeEventListener"==e)return this.g.removeEventListener.bind(this.g);if(this.a.V()&&!Object.keys(this.a.b.video).length){var t=this.c[e];if("function"!=typeof t)return t}return this.a.V()?this.a.get("video",e):(t=this.c[e],"function"==typeof t&&(t=t.bind(this.c)),t)},so.ue=function(e,t){this.a.V()?this.a.set("video",e,t):this.c[e]=t},so.te=function(e){this.a.V()||this.g.dispatchEvent(new st(e.type,e))},so.Hd=function(e){return"addEventListener"==e?this.f.addEventListener.bind(this.f):"removeEventListener"==e?this.f.removeEventListener.bind(this.f):"getNetworkingEngine"==e?this.b.Wb.bind(this.b):this.a.V()&&!Object.keys(this.a.b.video).length&&0<=Oo.indexOf(e)||!this.a.V()?(e=this.b[e],e.bind(this.b)):this.a.get("player",e)},so.Id=function(e){this.a.V()||this.f.dispatchEvent(e)},so.fe=function(e,t){this.a.V()&&("video"==e?this.g.dispatchEvent(t):"player"==e&&this.f.dispatchEvent(t))},n(gt),t("shaka.cast.CastReceiver",gt),gt.prototype.isConnected=function(){return this.i},gt.prototype.isConnected=gt.prototype.isConnected,gt.prototype.ad=function(){return this.f},gt.prototype.isIdle=gt.prototype.ad,gt.prototype.m=function(){var t=this.b?this.b.m():Promise.resolve();return null!=this.h&&e.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,t.then(function(){cast.receiver.CastReceiverManager.getInstance().stop()})},gt.prototype.destroy=gt.prototype.m,so=gt.prototype,so.jc=function(){this.i=!!cast.receiver.CastReceiverManager.getInstance().getSenders().length,bt(this)},so.mc=function(e,t){this.Cb(),Et(this,{type:"event",targetName:e,event:t},this.c)},so.Cb=function(){null!=this.h&&e.clearTimeout(this.h),this.h=e.setTimeout(this.Cb.bind(this),500);var t={video:{},player:{}};To.forEach(function(e){t.video[e]=this.a[e]}.bind(this)),Oo.forEach(function(e){t.player[e]=this.b[e]()}.bind(this));var n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();n&&(t.video.volume=n.level,t.video.muted=n.muted),Et(this,{type:"update",update:t},this.c)},so.Mc=function(){var e=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();e&&Et(this,{type:"update",update:{video:{volume:e.level,muted:e.muted}}},this.c),Et(this,{type:"event",targetName:"video",event:{type:"volumechange"}},this.c)},so.vd=function(e){var t=lt(e.data);switch(t.type){case"init":_t(this,t.initState,t.appData),this.Cb();break;case"appData":this.l(t.appData);break;case"set":var n=t.targetName,r=t.property,i=t.value;if("video"==n){if(t=cast.receiver.CastReceiverManager.getInstance(),"volume"==r){t.setSystemVolumeLevel(i);break}if("muted"==r){t.setSystemVolumeMuted(i);break}}this.j[n][r]=i;break;case"call":n=t.targetName,r=t.methodName,i=t.args,n=this.j[n],n[r].apply(n,i);break;case"asyncCall":n=t.targetName,r=t.methodName,i=t.args,t=t.id,e=e.senderId,n=this.j[n],n[r].apply(n,i).then(this.vc.bind(this,e,t,null),this.vc.bind(this,e,t))}},so.hd=function(e){var t=lt(e.data);switch(t.type){case"PLAY":this.a.play(),Tt(this,0);break;case"PAUSE":this.a.pause(),Tt(this,0);break;case"SEEK":e=t.currentTime;var n=t.resumeState;null!=e&&(this.a.currentTime=Number(e)),n&&"PLAYBACK_START"==n?(this.a.play(),Tt(this,0)):n&&"PLAYBACK_PAUSE"==n&&(this.a.pause(),Tt(this,0));break;case"STOP":this.b.hb().then(function(){Tt(this,0)}.bind(this));break;case"GET_STATUS":Tt(this,Number(t.requestId));break;case"VOLUME":n=t.volume,e=n.level;var n=n.muted,r=this.a.volume,i=this.a.muted;null!=e&&(this.a.volume=Number(e)),null!=n&&(this.a.muted=n),r==this.a.volume&&i==this.a.muted||Tt(this,0);break;case"LOAD":n=t.media.contentId,e=t.currentTime;var a=this.o(n);this.a.autoplay=!0,this.b.load(a,e).then(function(){Tt(this,0,{contentId:a,streamType:this.b.$()?"LIVE":"BUFFERED",contentType:""})}.bind(this)).catch(function(e){var n="LOAD_FAILED";7==e.category&&7e3==e.code&&(n="LOAD_CANCELLED"),Et(this,{requestId:Number(t.requestId),type:n},this.g)}.bind(this));break;default:Et(this,{requestId:Number(t.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},this.g)}},so.vc=function(e,t,n){Et(this,{type:"asyncComplete",id:t,error:n},this.c,e)};var Lo={IDLE:"IDLE",Cc:"PLAYING",Ac:"BUFFERING",Bc:"PAUSED"},xo={"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"};t("shaka.media.InitSegmentReference",Vt),t("shaka.media.SegmentReference",Ht),t("shaka.util.DataViewReader",Kt);var Io=1;Kt.Endianness={ve:0,xe:Io},Kt.prototype.Z=function(){return this.u<this.H.byteLength},Kt.prototype.hasMoreData=Kt.prototype.Z,Kt.prototype.Vc=function(){return this.u},Kt.prototype.getPosition=Kt.prototype.Vc,Kt.prototype.Qc=function(){return this.H.byteLength},Kt.prototype.getLength=Kt.prototype.Qc,Kt.prototype.Eb=function(){try{var e=this.H.getUint8(this.u)}catch(e){Yt()}return this.u+=1,e},Kt.prototype.readUint8=Kt.prototype.Eb,Kt.prototype.oc=function(){try{var e=this.H.getUint16(this.u,this.a)}catch(e){Yt()}return this.u+=2,e},Kt.prototype.readUint16=Kt.prototype.oc,Kt.prototype.D=function(){try{var e=this.H.getUint32(this.u,this.a)}catch(e){Yt()}return this.u+=4,e},Kt.prototype.readUint32=Kt.prototype.D,Kt.prototype.nc=function(){try{var e=this.H.getInt32(this.u,this.a)}catch(e){Yt()}return this.u+=4,e},Kt.prototype.readInt32=Kt.prototype.nc,Kt.prototype.Pa=function(){try{if(this.a)var e=this.H.getUint32(this.u,!0),t=this.H.getUint32(this.u+4,!0);else t=this.H.getUint32(this.u,!1),e=this.H.getUint32(this.u+4,!1)}catch(e){Yt()}if(2097151<t)throw new u(2,3,3001);return this.u+=8,t*Math.pow(2,32)+e},Kt.prototype.readUint64=Kt.prototype.Pa,Kt.prototype.Ka=function(e){this.u+e>this.H.byteLength&&Yt();var t=this.H.buffer.slice(this.u,this.u+e);return this.u+=e,new Uint8Array(t)},Kt.prototype.readBytes=Kt.prototype.Ka,Kt.prototype.I=function(e){this.u+e>this.H.byteLength&&Yt(),this.u+=e},Kt.prototype.skip=Kt.prototype.I,Kt.prototype.Db=function(){for(var e=this.u;this.Z()&&this.H.getUint8(this.u);)this.u+=1;return e=this.H.buffer.slice(e,this.u),this.u+=1,Y(e)},Kt.prototype.readTerminatedString=Kt.prototype.Db,t("shaka.util.Mp4Parser",Wt),Wt.prototype.C=function(e,t){var n=$t(e);return this.b[n]=0,this.a[n]=t,this},Wt.prototype.box=Wt.prototype.C,Wt.prototype.da=function(e,t){var n=$t(e);return this.b[n]=1,this.a[n]=t,this},Wt.prototype.fullBox=Wt.prototype.da,Wt.prototype.parse=function(e){for(e=new Kt(new DataView(e),0);e.Z();)this.eb(0,e)},Wt.prototype.parse=Wt.prototype.parse,Wt.prototype.eb=function(e,t){var n=t.u,r=t.D(),i=t.D();switch(r){case 0:r=t.H.byteLength-n;break;case 1:r=t.Pa()}var a=this.a[i];if(a){var o=null,s=null;1==this.b[i]&&(s=t.D(),o=s>>>24,s&=16777215),i=n+r-t.u,i=0<i?t.Ka(i).buffer:new ArrayBuffer(0),i=new Kt(new DataView(i),0),a({Na:this,version:o,Nc:s,s:i,size:r,start:n+e})}else t.I(n+r-t.u)},Wt.prototype.parseNext=Wt.prototype.eb,Wt.children=qt,Wt.sampleDescription=zt,Wt.allData=Xt,t("shaka.media.SegmentIndex",Zt),Zt.prototype.m=function(){return this.a=null,Promise.resolve()},Zt.prototype.destroy=Zt.prototype.m,Zt.prototype.find=function(e){for(var t=this.a.length-1;0<=t;--t){var n=this.a[t];if(e>=n.startTime&&e<n.endTime)return n.position}return this.a.length&&e<this.a[0].startTime?this.a[0].position:null},Zt.prototype.find=Zt.prototype.find,Zt.prototype.get=function(e){return this.a.length?(e-=this.a[0].position,0>e||e>=this.a.length?null:this.a[e]):null},Zt.prototype.get=Zt.prototype.get,Zt.prototype.xb=function(e){for(var t,n,r=[],i=n=0;n<this.a.length&&i<e.length;){var a=this.a[n];t=e[i],a.startTime<t.startTime?(r.push(a),n++):(a.startTime>t.startTime||(.1<Math.abs(a.endTime-t.endTime)?r.push(t):r.push(a),n++),i++)}for(;n<this.a.length;)r.push(this.a[n++]);if(r.length)for(n=r[r.length-1].position+1;i<e.length;)t=e[i++],t=new Ht(n++,t.startTime,t.endTime,t.a,t.X,t.M),r.push(t);else r=e;this.a=r},Zt.prototype.merge=Zt.prototype.xb,Zt.prototype.qb=function(e){for(var t=0;t<this.a.length&&!(this.a[t].endTime>e);++t);this.a.splice(0,t)},Zt.prototype.evict=Zt.prototype.qb;var Mo;tn.prototype.Z=function(){return this.a.Z()},sn.prototype.parse=function(e,t,n,r){var i;if(t=new tn(new DataView(t)),440786851!=nn(t).id)throw new u(2,3,3008);var a=nn(t);if(408125543!=a.id)throw new u(2,3,3009);for(t=a.a.byteOffset,a=new tn(a.a),i=null;a.Z();){var o=nn(a);if(357149030==o.id){i=o;break}}if(!i)throw new u(2,3,3010);for(a=new tn(i.a),i=1e6,o=null;a.Z();){var s=nn(a);if(2807729==s.id)i=on(s);else if(17545==s.id)if(o=s,4==o.a.byteLength)o=o.a.getFloat32(0);else{if(8!=o.a.byteLength)throw new u(2,3,3003);o=o.a.getFloat64(0)}}if(null==o)throw new u(2,3,3011);if(a=i/1e9,i=o*a,e=nn(new tn(new DataView(e))),475249515!=e.id)throw new u(2,3,3007);return un(e,t,a,i,n,r)};var Co={},No={};t("shaka.media.ManifestParser.registerParserByExtension",function(e,t){No[e]=t}),t("shaka.media.ManifestParser.registerParserByMime",function(e,t){Co[e]=t}),t("shaka.media.PresentationTimeline",Sn),Sn.prototype.Y=function(){return this.a},Sn.prototype.getDuration=Sn.prototype.Y,Sn.prototype.pa=function(e){this.a=e},Sn.prototype.setDuration=Sn.prototype.pa,Sn.prototype.Wc=function(){return this.f},Sn.prototype.getPresentationStartTime=Sn.prototype.Wc,Sn.prototype.wc=function(e){this.h=e},Sn.prototype.setClockOffset=Sn.prototype.wc,Sn.prototype.yc=function(e){this.g=e},Sn.prototype.setStatic=Sn.prototype.yc,Sn.prototype.Xc=function(){return this.c},Sn.prototype.getSegmentAvailabilityDuration=Sn.prototype.Xc,Sn.prototype.xc=function(e){this.c=e},Sn.prototype.setSegmentAvailabilityDuration=Sn.prototype.xc,Sn.prototype.Ha=function(e,t){t.length&&(this.b=t.reduce(function(e,t){return Math.max(e,t.endTime-t.startTime)},this.b))},Sn.prototype.notifySegments=Sn.prototype.Ha,Sn.prototype.yb=function(e){this.b=Math.max(this.b,e)},Sn.prototype.notifyMaxSegmentDuration=Sn.prototype.yb,Sn.prototype.$=function(){return 1/0==this.a&&!this.g},Sn.prototype.isLive=Sn.prototype.$,Sn.prototype.va=function(){return 1/0!=this.a&&!this.g},Sn.prototype.isInProgress=Sn.prototype.va,Sn.prototype.ma=function(){return this.Ea(0)},Sn.prototype.getSegmentAvailabilityStart=Sn.prototype.ma,Sn.prototype.Ea=function(e){if(1/0==this.c)return 0;var t=this.ua();return Math.max(0,Math.min(t-this.c+e,t))},Sn.prototype.getSafeAvailabilityStart=Sn.prototype.Ea,Sn.prototype.ua=function(){return this.$()||this.va()?Math.min(Math.max(0,(Date.now()+this.h)/1e3-this.b-this.f),this.a):this.a},Sn.prototype.getSegmentAvailabilityEnd=Sn.prototype.ua,Sn.prototype.bb=function(){return Math.max(0,this.ua()-(this.$()||this.va()?this.i:0))},Sn.prototype.getSeekRangeEnd=Sn.prototype.bb,t("shaka.dash.DashParser",On),so=On.prototype,so.configure=function(e){this.b=e},so.start=function(e,t){return this.g=[e],this.a=t,An(this).then(function(){return this.a&&In(this,0),this.c}.bind(this))},so.stop=function(){return this.b=this.a=null,this.g=[],this.c=null,this.i=[],this.j={},null!=this.f&&(e.clearTimeout(this.f),this.f=null),Promise.resolve()},so.update=function(){An(this).catch(function(e){this.a&&this.a.onError(e)}.bind(this))},so.onExpirationUpdated=function(){},so.Dd=function(e,t){e.S=Mn(t,e.T,null);var n=!1,r=kt(t,"Role"),i=r.map(function(e){return e.getAttribute("value")}).filter(E),a=void 0;"text"==e.S.contentType&&(a="subtitle");for(var o=0;o<r.length;o++){var s=r[o].getAttribute("schemeIdUri");if(null==s||"urn:mpeg:dash:role:2011"==s)switch(s=r[o].getAttribute("value")){case"main":n=!0;break;case"caption":case"subtitle":a=s}}var l=null,c=!1;if(kt(t,"EssentialProperty").forEach(function(e){"http://dashif.org/guidelines/trickmode"==e.getAttribute("schemeIdUri")?l=e.getAttribute("value"):c=!0}),c)return null;var r=kt(t,"ContentProtection"),f=Mt(r,this.b.dash.customScheme,this.b.dash.ignoreDrmInfo),r=Ve(t.getAttribute("lang")||"und"),s=t.getAttribute("label"),o=kt(t,"Representation"),i=o.map(this.Gd.bind(this,e,f,a,r,s,n,i)).filter(function(e){return!!e});if(!i.length)throw new u(2,4,4003);return e.S.contentType&&"application"!=e.S.contentType||(e.S.contentType=jn(i[0].mimeType,i[0].codecs),i.forEach(function(t){t.type=e.S.contentType})),i.forEach(function(e){f.drmInfos.forEach(function(t){e.keyId&&t.keyIds.push(e.keyId)})}),a=o.map(function(e){return e.getAttribute("id")}).filter(E),{id:e.S.id||"__fake__"+this.h++,contentType:e.S.contentType,language:r,vb:n,streams:i,drmInfos:f.drmInfos,Ob:l,Pd:a}},so.Gd=function(e,t,n,r,i,a,o,s){if(e.w=Mn(s,e.S,null),!Cn(e.w))return null;e.bandwidth=Ot(s,"bandwidth",Lt)||void 0;var u=this.Qd.bind(this);if(e.w.Qa)u=fn(e,u);else if(e.w.oa)u=pn(e,this.j);else if(e.w.Ra)u=mn(e,u,this.j,!!this.c);else{var l=e.w.U,c=e.R.duration||0;u={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(e){return 0<=e&&e<c?1:null},getSegmentReference:function(e){return 1!=e?null:new Ht(1,0,c,function(){return l},0,null)},initSegmentReference:null,presentationTimeOffset:0}}return s=kt(s,"ContentProtection"),s=Ct(s,this.b.dash.customScheme,t,this.b.dash.ignoreDrmInfo),{id:this.h++,createSegmentIndex:u.createSegmentIndex,findSegmentPosition:u.findSegmentPosition,getSegmentReference:u.getSegmentReference,initSegmentReference:u.initSegmentReference,presentationTimeOffset:u.presentationTimeOffset,mimeType:e.w.mimeType,codecs:e.w.codecs,frameRate:e.w.frameRate,bandwidth:e.bandwidth,width:e.w.width,height:e.w.height,kind:n,encrypted:0<t.drmInfos.length,keyId:s,language:r,label:i,type:e.S.contentType,primary:a,trickModeVideo:null,containsEmsgBoxes:e.w.containsEmsgBoxes,roles:o}},so.he=function(){this.f=null;var e=Date.now();An(this).then(function(){this.a&&In(this,(Date.now()-e)/1e3)}.bind(this)).catch(function(e){this.a&&(e.severity=1,this.a.onError(e),In(this,0))}.bind(this))},so.Fd=function(e,t,n){var r=n.getAttribute("schemeIdUri")||"",i=n.getAttribute("value")||"",a=Ot(n,"timescale",xt)||1;kt(n,"Event").forEach(function(n){var o=Ot(n,"presentationTime",xt)||0,s=Ot(n,"duration",xt)||0,o=o/a+e,s=o+s/a;null!=t&&(o=Math.min(o,e+t),s=Math.min(s,e+t)),n={schemeIdUri:r,value:i,startTime:o,endTime:s,id:n.getAttribute("id")||"",eventElement:n},this.a.onTimelineRegionAdded(n)}.bind(this))},so.Qd=function(e,t,n){return e=L(e,this.b.retryParameters),null!=t&&(e.headers.Range="bytes="+t+"-"+(null!=n?n:"")),this.a.networkingEngine.request(1,e).then(function(e){return e.data})},No.mpd=On,Co["application/dash+xml"]=On,Bn.prototype.toString=function(){function e(e){return e.name+'="'+e.value+'"'}return this.value?"#"+this.name+":"+this.value:0<this.a.length?"#"+this.name+":"+this.a.map(e).join(","):"#"+this.name},Bn.prototype.getAttribute=function(e){var t=this.a.filter(function(t){return t.name==e});return t.length?t[0]:null};var Uo="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-MAP EXT-X-I-FRAMES-ONLY".split(" "),jo="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE".split(" ");t("shaka.net.DataUriPlugin",er),er.parse=function(t){var n=t.split(":");if(2>n.length||"data"!=n[0])throw new u(2,1,1004,t);if(n=n.slice(1).join(":").split(","),2>n.length)throw new u(2,1,1004,t);var r=n[0],n=e.decodeURIComponent(n.slice(1).join(",")),r=r.split(";"),i=null;if(1<r.length&&(i=r[1]),"base64"==i)t=Z(n).buffer;else{if(i)throw new u(2,1,1005,t);t=z(n)}return{data:t,contentType:r[0]}},yo.data=er,t("shaka.hls.HlsParser",tr),so=tr.prototype,so.configure=function(e){this.b=e},so.start=function(e,t){return this.c=t,this.j=e,this.c.networkingEngine.request(0,L([e],this.b.retryParameters)).then(function(t){return nr(this,t.data,e)}.bind(this))},so.stop=function(){return this.b=this.c=null,this.g={},Promise.resolve()},so.update=function(){},so.onExpirationUpdated=function(){};var Fo=[/^(avc)/,/^(hvc)/,/^(vp[8-9])$/,/^(av1)$/,/^(mp4v)/],Bo=[/^(vorbis)/,/^(opus)/,/^(mp4a)/,/^(ac-3)$/,/^(ec-3)$/],Go={mp4:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",ts:"video/mp2t"},Vo={mp4:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",ts:"video/mp2t"},Ho={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(e){if("SAMPLE-AES-CENC"!=yr(e,"METHOD"))return null;var t=yr(e,"URI"),t=er.parse(t),t=new Uint8Array(t.data),t=S("com.widevine.alpha",[{initDataType:"cenc",initData:t}]);return(e=Vn(e,"KEYID"))&&(t.keyIds=[e.substr(2).toLowerCase()]),t}};No.m3u8=tr,Co["application/x-mpegurl"]=tr,Co["application/vnd.apple.mpegurl"]=tr,mr.prototype.parseInit=function(){},mr.prototype.parseMedia=function(e,t){var n=Y(e),r=[],i=new DOMParser,a=null;try{a=i.parseFromString(n,"text/xml")}catch(e){throw new u(2,2,2005)}if(a){var o=a.getElementsByTagName("tt")[0];if(!o)throw new u(2,2,2005);i=o.getAttribute("ttp:frameRate"),a=o.getAttribute("ttp:subFrameRate");var s=o.getAttribute("ttp:frameRateMultiplier"),l=o.getAttribute("ttp:tickRate");if("default"!=(n=o.getAttribute("xml:space")||"default")&&"preserve"!=n)throw new u(2,2,2005);for(n="default"==n,i=new Sr(i,a,s,l),a=br(o.getElementsByTagName("styling")[0]),s=br(o.getElementsByTagName("layout")[0]),o=br(o.getElementsByTagName("body")[0]),l=0;l<o.length;l++){var c=o[l],f=t.periodStart,d=i,h=a,p=s,v=n;if(c.hasAttribute("begin")||c.hasAttribute("end")||!/^\s*$/.test(c.textContent)){_r(c,v);var v=wr(c.getAttribute("begin"),d),y=wr(c.getAttribute("end"),d),d=wr(c.getAttribute("dur"),d),g=c.textContent;if(null==y&&null!=d&&(y=v+d),null==v||null==y)throw new u(2,2,2001);(f=we(v+f,y+f,g))?(v=Tr(c,"region",p),p=f,(y=Er(c,v,h,"tts:extent"))&&(d=$o.exec(y))&&(p.size=Number(d[1])),d=Er(c,v,h,"tts:writingMode"),y=!0,"tb"==d||"tblr"==d?p.vertical="lr":"tbrl"==d?p.vertical="rl":y=!1,(d=Er(c,v,h,"tts:origin"))&&(d=$o.exec(d))&&(y?(p.position=Number(d[2]),p.line=Number(d[1])):(p.position=Number(d[1]),p.line=Number(d[2])),p.snapToLines=!1),(h=Er(c,v,h,"tts:textAlign"))&&(p.align=h,"center"==h&&("center"!=p.align&&(p.align="middle"),p.position="auto"),p.positionAlign=Qo[h],p.lineAlign=Jo[h]),h=f):h=null}else h=null;h&&r.push(h)}}return r};var Ko=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Yo=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Wo=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,qo=/^(\d*\.?\d*)f$/,zo=/^(\d*\.?\d*)t$/,Xo=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,$o=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,Jo={left:"start",center:"center",right:"end",start:"start",end:"end"},Qo={left:"line-left",center:"center",right:"line-right"};Te("application/ttml+xml",mr),Or.prototype.parseInit=function(e){var t=!1;if((new Wt).C("moov",qt).C("trak",qt).C("mdia",qt).C("minf",qt).C("stbl",qt).da("stsd",zt).C("stpp",function(){t=!0}).parse(e),!t)throw new u(2,2,2007)},Or.prototype.parseMedia=function(e,t){var n=!1,r=[];if((new Wt).C("mdat",Xt(function(e){n=!0,r=this.a.parseMedia(e.buffer,t)}.bind(this))).parse(e),!n)throw new u(2,2,2007);return r},Te('application/mp4; codecs="stpp"',Or),Ar.prototype.parseInit=function(){},Ar.prototype.parseMedia=function(e,t){var n=Y(e),n=n.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n"),n=n.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(n[0]))throw new u(2,2,2e3);var r=t.segmentStart;if(0<=n[0].indexOf("X-TIMESTAMP-MAP")){var i=n[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),a=n[0].match(/MPEGTS:(\d+)/m);i&&a&&(r=Rr(new qn(i[1])),r=t.periodStart+(Number(a[1])/9e4-r))}for(a=[],i=1;i<n.length;i++){var o=n[i].split("\n"),s=r;if(1==o.length&&!o[0]||/^NOTE($|[ \t])/.test(o[0]))var l=null;else{l=null,0>o[0].indexOf("--\x3e")&&(l=o[0],o.splice(0,1));var c=new qn(o[0]),f=Rr(c),d=zn(c,/[ \t]+--\x3e[ \t]+/g),h=Rr(c);if(null==f||!d||null==h)throw new u(2,2,2001);if(o=we(f+s,h+s,o.slice(1).join("\n").trim())){for(zn(c,/[ \t]+/gm),s=Xn(c);s;)Pr(o,s),zn(c,/[ \t]+/gm),s=Xn(c);null!=l&&(o.id=l),l=o}else l=null}l&&a.push(l)}return a},Te("text/vtt",Ar),Te('text/vtt; codecs="vtt"',Ar),Dr.prototype.parseInit=function(e){var t=!1;if((new Wt).C("moov",qt).C("trak",qt).C("mdia",qt).da("mdhd",function(e){0==e.version?(e.s.I(4),e.s.I(4),this.a=e.s.D(),e.s.I(4)):(e.s.I(8),e.s.I(8),this.a=e.s.D(),e.s.I(8)),e.s.I(4)}.bind(this)).C("minf",qt).C("stbl",qt).da("stsd",zt).C("wvtt",function(){t=!0}).parse(e),!this.a)throw new u(2,2,2008);if(!t)throw new u(2,2,2008)},Dr.prototype.parseMedia=function(e,t){var n=0,r=[],i=[],a=[],o=!1,s=!1,l=!1;if((new Wt).C("moof",qt).C("traf",qt).da("tfdt",function(e){o=!0,n=e.version?e.s.Pa():e.s.D()}).da("trun",function(e){s=!0;var t=e.version,n=e.Nc;e=e.s;var i=e.D();1&n&&e.I(4),4&n&&e.I(4);for(var a=[],o=0;o<i;o++){var u={duration:null,Nb:null};256&n&&(u.duration=e.D()),512&n&&e.I(4),1024&n&&e.I(4),2048&n&&(u.Nb=t?e.nc():e.D()),a.push(u)}r=a}).C("vtte",function(){i.push(null)}).C("vttc",Xt(function(e){i.push(e.buffer)})).C("mdat",function(e){l=!0,qt(e)}).parse(e),!l&&!o&&!s)throw new u(2,2,2008);for(var c=n,f=0;f<r.length;f++){var d=r[f],h=i[f];if(d.duration){var p=d.Nb?n+d.Nb:c,c=p+d.duration;h&&a.push(Lr(h,t.periodStart+p/this.a,t.periodStart+c/this.a))}}return a},Te('application/mp4; codecs="wvtt"',Dr),so=Ir.prototype,so.m=function(){var t=this.b.m();return this.b=null,null!=this.f&&(e.clearInterval(this.f),this.f=null),null!=this.j&&(e.clearInterval(this.j),this.j=null),this.G=this.J=this.l=this.c=this.a=null,t},so.rb=function(){return this.g},so.Ab=function(){this.o=!0,this.hc()},so.rd=function(){this.a.playbackRate!=(this.h||0>this.g?0:this.g)&&Ur(this,this.a.playbackRate)},so.fc=function(){var e=Nr(this);.001>Math.abs(this.a.currentTime-e)?(N(this.b,this.a,"seeking",this.ic.bind(this)),N(this.b,this.a,"playing",this.gc.bind(this))):(U(this.b,this.a,"seeking",this.td.bind(this)),this.a.currentTime=e)},so.td=function(){N(this.b,this.a,"seeking",this.ic.bind(this)),N(this.b,this.a,"playing",this.gc.bind(this))},so.hc=function(){if(this.a.readyState){this.a.readyState!=this.B&&(this.i=!1,this.B=this.a.readyState);var e=this.l.smallGapLimit,t=this.a.currentTime,n=this.a.buffered;e:{if(n&&n.length&&!(1==n.length&&1e-6>n.end(0)-n.start(0))){var r=.1;/(Edge|Trident)\//.test(navigator.userAgent)&&(r=.5);for(var i=0;i<n.length;i++)if(n.start(i)>t&&(!i||n.end(i-1)-t<=r)){r=i;break e}}r=null}if(null==r){if(3>this.a.readyState&&0<this.a.playbackRate)if(this.O!=t)this.O=t,this.v=Date.now();else if(this.v<Date.now()-1e3)for(this.v=Date.now()+5e3,r=0;r<n.length;r++)if(t>=n.start(r)&&t<n.end(r)-.5){this.a.currentTime=this.a.currentTime;break}}else if((r||this.o)&&!((i=n.start(r))>=this.c.presentationTimeline.bb())){var a=i-t,e=a<=e,o=!1;e||this.i||(this.i=!0,a=new st("largegap",{currentTime:t,gapSize:a}),a.cancelable=!0,this.G(a),this.l.jumpLargeGaps&&!a.defaultPrevented&&(o=!0)),(e||o)&&(r&&n.end(r-1),Fr(this,t,i))}}},so.ic=function(){this.o=!1;var e=this.a.currentTime,t=jr(this,e);.001<Math.abs(t-e)?Fr(this,e,t):(this.i=!1,this.J())},so.gc=function(){var e=this.a.currentTime,t=jr(this,e);.001<Math.abs(t-e)&&Fr(this,e,t)},Gr.prototype.m=function(){var e=this.j?this.j.m():Promise.resolve();return this.j=null,Kr(this),this.B=this.h=this.l=this.A=this.g=this.a=null,this.c=[],e},Gr.prototype.v=function(e){if(!this.c.some(function(t){return t.info.schemeIdUri==e.schemeIdUri&&t.info.startTime==e.startTime&&t.info.endTime==e.endTime})){var t={info:e,status:1};this.c.push(t);var n=new st("timelineregionadded",{detail:Vr(e)});this.h(n),this.o(!0,t)}},Gr.prototype.o=function(e,t){var n=t.info.startTime>this.a.currentTime?1:t.info.endTime<this.a.currentTime?3:2,r=2==t.status,i=2==n;n!=t.status&&((!e||r||i)&&(r||this.h(new st("timelineregionenter",{detail:Vr(t.info)})),i||this.h(new st("timelineregionexit",{detail:Vr(t.info)}))),t.status=n)},Gr.prototype.G=function(){this.f=null,Hr(this);var e=rt(this.g,this.a.currentTime);e!=this.i&&(-1!=this.i&&this.B(),this.i=e);var e=Re(this.a.buffered,this.a.currentTime),t=Ae(this.a.buffered)>=this.g.presentationTimeline.ua()-.1||this.a.ended;if(this.b){var n=1*Math.max(this.g.minBufferTime||0,this.A.rebufferingGoal);(t||e>=n)&&0!=this.b&&(this.b=!1,this.l(!1))}else!t&&.5>e&&1!=this.b&&(this.b=!0,this.l(!0));this.c.forEach(this.o.bind(this,!1))},so=Yr.prototype,so.m=function(){for(var e in this.c)yi(this.c[e]);return this.g=this.c=this.j=this.h=this.o=this.b=this.a=null,this.f=!0,Promise.resolve()},so.configure=function(e){this.g=e},so.init=function(){var e=this.a.bc(this.b.periods[rt(this.b,Cr(this.a.Oa))]);return B(e)?Promise.reject(new u(2,5,5005)):Zr(this,e).then(function(){this.a&&this.a.jd&&this.a.jd()}.bind(this))},so.ke=function(e){if(!this.f&&!e.xa&&null!=e.qa&&!e.sa)if(e.qa=null,e.ra)pi(this,e,e.kb);else{try{var t=ri(this,e);null!=t&&(vi(this,e,t),e.tb=!1)}catch(e){return void this.a.onError(e)}t=G(this.c),fi(this,e),t.every(function(e){return e.endOfStream})&&this.a.K.endOfStream().then(function(){this.b.presentationTimeline.pa(this.a.K.Y())}.bind(this))}},so.Ed=function(e,t,n){var r=n.s.Db(),i=n.s.Db(),a=n.s.D(),o=n.s.D(),s=n.s.D(),u=n.s.D();n=n.s.Ka(n.s.H.byteLength-n.s.u),e=e.startTime+t.startTime+o/a,"urn:mpeg:dash:event:2012"==r?this.a.kd():this.a.onEvent(new st("emsg",{detail:{startTime:e,endTime:e+s/a,schemeIdUri:r,value:i,timescale:a,presentationTimeDelta:o,eventDuration:s,id:u,messageData:n}}))},t("shaka.net.HttpPlugin",gi),yo.http=gi,yo.https=gi,so=mi.prototype,so.init=function(e,t){return wi(this,e,t).then(function(){var t=Object.keys(e);return Promise.all(t.map(function(e){return Ei(this,e).then(function(t){this.c[e]=t}.bind(this))}.bind(this)))}.bind(this))},so.m=function(){return Promise.all(this.b.map(function(e){try{e.transaction.abort()}catch(e){}return e.L.catch(_)})).then(function(){this.a&&(this.a.close(),this.a=null)}.bind(this))},so.get=function(e,t){var n;return Ti(this,e,"readonly",function(e){n=e.get(t)}).then(function(){return n.result})},so.forEach=function(e,t){return Ti(this,e,"readonly",function(e){e.openCursor().onsuccess=function(e){(e=e.target.result)&&(t(e.value),e.continue())}})},so.remove=function(e,t){return Ti(this,e,"readwrite",function(e){e.delete(t)})};var Zo={manifest:"key",segment:"key"};xi.prototype.m=function(){var e=this.j,t=this.l,n=this.i||Promise.resolve(),n=n.then(function(){return _i(e,t)});return this.b={},this.l=[],this.i=this.a=this.A=this.v=this.j=this.o=null,n},so=Ni.prototype,so.configure=function(){},so.start=function(e){var t=/^offline:([0-9]+)$/.exec(e);if(!t)return Promise.reject(new u(2,1,9004,e));var n=Number(t[1]),r=Li();return this.a=n,r?r.init(Zo).then(function(){return r.get("manifest",n)}).then(function(e){if(!e)throw new u(2,9,9003,n);return Ui(e)}).then(function(e){return r.m().then(function(){return e})},function(e){return r.m().then(function(){throw e})}):Promise.reject(new u(2,9,9e3))},so.stop=function(){return Promise.resolve()},so.update=function(){},so.onExpirationUpdated=function(e,t){var n=Li();n.init(Zo).then(function(){return n.get("manifest",this.a)}.bind(this)).then(function(r){if(r&&!(0>r.sessionIds.indexOf(e))&&(void 0==r.expiration||r.expiration>t))return r.expiration=t,bi(n,"manifest",r)}).catch(function(){}).then(function(){return n.m()})},Co["application/x-offline-manifest"]=Ni,t("shaka.offline.OfflineScheme",ji),yo.offline=ji,Fi.prototype.then=function(e){return this.a=this.a.then(e).then(function(e){return this.b?(this.g(),Promise.reject(this.h)):Promise.resolve(e)}.bind(this)),this},Fi.prototype.cancel=function(e){return this.c?Promise.resolve():(this.b=!0,this.h=e,this.i)},n(Gi),t("shaka.Player",Gi),Gi.prototype.m=function(){this.O=!0;var e=Promise.resolve();return this.J&&(e=this.J.cancel(new u(2,7,7e3))),e.then(function(){var e=Promise.all([this.la,qi(this),this.l?this.l.m():null,this.o?this.o.m():null]);return this.b=this.o=this.Qb=this.l=this.A=this.f=null,e}.bind(this))},Gi.prototype.destroy=Gi.prototype.m,Gi.version="v2.1.4";var es={};Gi.registerSupportPlugin=function(e,t){es[e]=t},Gi.isBrowserSupported=function(){return!!(e.Promise&&e.Uint8Array&&Array.prototype.forEach&&e.MediaSource&&e.MediaSource.isTypeSupported&&e.MediaKeys&&e.navigator&&e.navigator.requestMediaKeySystemAccess&&e.MediaKeySystemAccess&&e.MediaKeySystemAccess.prototype.getConfiguration)},Gi.probeSupport=function(){return me().then(function(e){e={manifest:wn(),media:Le(),drm:e};for(var t in es)e[t]=es[t]();return e})},Gi.prototype.load=function(e,t,n){var r=this.hb(),i=new Fi;this.J=i,this.dispatchEvent(new st("loading"));var a=Date.now();return Bi(i.then(function(){return r}).then(function(){return this.i=Ji(),N(this.l,this.f,"playing",this.Sa.bind(this)),N(this.l,this.f,"pause",this.Sa.bind(this)),N(this.l,this.f,"ended",this.Sa.bind(this)),kn(e,this.o,this.b.manifest.retryParameters,n)}.bind(this)).then(function(t){return this.h=new t,this.h.configure(this.b.manifest),t={networkingEngine:this.o,filterPeriod:this.fb.bind(this),onTimelineRegionAdded:this.xd.bind(this),onEvent:this.gb.bind(this),onError:this.ya.bind(this)},2<this.h.start.length?this.h.start(e,this.o,t.filterPeriod,t.onError,t.onEvent):this.h.start(e,t)}.bind(this)).then(function(t){if(0==t.periods.length)throw new u(2,4,4014);return this.c=t,this.Ya=e,this.j=new re(this.o,this.ya.bind(this),this.be.bind(this),this.ae.bind(this)),this.j.configure(this.b.drm),this.j.init(t,!1)}.bind(this)).then(function(){return this.c.periods.forEach(this.fb.bind(this)),this.Ua=Date.now()/1e3,this.ia=this.b.preferredAudioLanguage,this.Ca=this.b.preferredTextLanguage,Promise.all([ie(this.j,this.f),this.Wa])}.bind(this)).then(function(){return this.b.abr.manager.init(this.Lb.bind(this)),this.g=new Ir(this.f,this.c,this.b.streaming,t||null,this.ce.bind(this),this.gb.bind(this)),this.v=new Gr(this.f,this.c,this.b.streaming,this.zc.bind(this),this.gb.bind(this),this.$d.bind(this)),this.ja=new De(this.f,this.N,this.A),this.a=new Yr(this.c,{Oa:this.g,K:this.ja,dd:this.o,bc:this.ed.bind(this),ac:this.Gc.bind(this),onError:this.ya.bind(this),onEvent:this.gb.bind(this),kd:this.ld.bind(this),Ab:this.ud.bind(this)}),this.a.configure(this.b.streaming),Vi(this),this.a.init()}.bind(this)).then(function(){if(this.b.streaming.startAtSegmentBoundary){var e=ea(this,Cr(this.g));Mr(this.g,e)}this.c.periods.forEach(this.fb.bind(this)),ia(this),ra(this);var e=Wr(this.a),t=Qe(e,this.ia);this.b.abr.manager.setVariants(t),e.variants.some(function(e){return e.primary}),this.Xa.forEach(this.v.v.bind(this.v)),this.Xa=[],U(this.l,this.f,"loadeddata",function(){this.i.loadLatency=(Date.now()-a)/1e3}.bind(this)),this.J=null}.bind(this))).catch(function(e){return this.J==i&&(this.J=null,this.dispatchEvent(new st("unloading"))),Promise.reject(e)}.bind(this))},Gi.prototype.load=Gi.prototype.load,Gi.prototype.configure=function(e){e.abr&&e.abr.manager&&e.abr.manager!=this.b.abr.manager&&(this.b.abr.manager.stop(),e.abr.manager.init(this.Lb.bind(this))),O(this.b,e,$i(this),Xi(),""),Ki(this)},Gi.prototype.configure=Gi.prototype.configure,Gi.prototype.getConfiguration=function(){var e=$i(this);return O(e,this.b,$i(this),Xi(),""),e},Gi.prototype.getConfiguration=Gi.prototype.getConfiguration,Gi.prototype.Rd=function(){var e=$i(this);e.abr&&e.abr.manager&&e.abr.manager!=this.b.abr.manager&&(this.b.abr.manager.stop(),e.abr.manager.init(this.Lb.bind(this))),this.b=$i(this),Ki(this)},Gi.prototype.resetConfiguration=Gi.prototype.Rd,Gi.prototype.Sc=function(){return this.f},Gi.prototype.getMediaElement=Gi.prototype.Sc,Gi.prototype.Wb=function(){return this.o},Gi.prototype.getNetworkingEngine=Gi.prototype.Wb,Gi.prototype.Rc=function(){return this.Ya},Gi.prototype.getManifestUri=Gi.prototype.Rc,Gi.prototype.$=function(){return!!this.c&&this.c.presentationTimeline.$()},Gi.prototype.isLive=Gi.prototype.$,Gi.prototype.va=function(){return!!this.c&&this.c.presentationTimeline.va()},Gi.prototype.isInProgress=Gi.prototype.va,Gi.prototype.Td=function(){var e=0,t=0;return this.c&&(t=this.c.presentationTimeline,e=t.ma(),t=t.bb()),{start:e,end:t}},Gi.prototype.seekRange=Gi.prototype.Td,Gi.prototype.keySystem=function(){return this.j?this.j.keySystem():""},Gi.prototype.keySystem=Gi.prototype.keySystem,Gi.prototype.drmInfo=function(){return this.j?this.j.b:null},Gi.prototype.drmInfo=Gi.prototype.drmInfo,Gi.prototype.ab=function(){return this.j?this.j.ab():1/0},Gi.prototype.getExpiration=Gi.prototype.ab,Gi.prototype.$c=function(){return this.ka},Gi.prototype.isBuffering=Gi.prototype.$c,Gi.prototype.hb=function(){if(this.O)return Promise.resolve();this.dispatchEvent(new st("unloading"));var e=Promise.resolve();return this.J&&(e=this.J.cancel(new u(2,7,7e3))),e.then(function(){return this.la||(this.la=zi(this).then(function(){this.la=null}.bind(this))),this.la}.bind(this))},Gi.prototype.unload=Gi.prototype.hb,Gi.prototype.rb=function(){return this.g?this.g.rb():0},Gi.prototype.getPlaybackRate=Gi.prototype.rb,Gi.prototype.ne=function(e){this.g&&Ur(this.g,e),this.a&&Xr(this.a,1!=e)},Gi.prototype.trickPlay=Gi.prototype.ne,Gi.prototype.Hc=function(){this.g&&Ur(this.g,1),this.a&&Xr(this.a,!1)},Gi.prototype.cancelTrickPlay=Gi.prototype.Hc,Gi.prototype.getTracks=function(){return this.Yb().concat(this.Xb())},Gi.prototype.getTracks=Gi.prototype.getTracks,Gi.prototype.Wd=function(e,t){"text"==e.type?this.tc(e):(this.configure({abr:{enabled:!1}}),this.uc(e,t))},Gi.prototype.selectTrack=Gi.prototype.Wd,Gi.prototype.Yb=function(){if(!this.c)return[];var e=rt(this.c,Cr(this.g)),t=this.B[e]||{};return qe(this.c.periods[e],t.audio,t.video)},Gi.prototype.getVariantTracks=Gi.prototype.Yb,Gi.prototype.Xb=function(){if(!this.c)return[];var e=rt(this.c,Cr(this.g));return ze(this.c.periods[e],(this.B[e]||{}).text).filter(function(e){return 0>this.Va.indexOf(e.id)}.bind(this))},Gi.prototype.getTextTracks=Gi.prototype.Xb,Gi.prototype.tc=function(e){if(this.a&&(e=$e(Wr(this.a),e))){Yi(this,e,!1);var t={};t.text=e,Qi(this,t,!0)}},Gi.prototype.selectTextTrack=Gi.prototype.tc,Gi.prototype.uc=function(e,t){if(this.a){var n={},r=Xe(Wr(this.a),e),i=qr(this.a);if(r){if(!r.allowedByApplication||!r.allowedByKeySystem)return;r.audio&&(Wi(this,r.audio),r.audio!=i.audio&&(n.audio=r.audio)),r.video&&(Wi(this,r.video),r.video!=i.video&&(n.video=r.video))}G(n).forEach(function(e){Yi(this,e,!1)}.bind(this)),(r=i.text)&&(n.text=r),Qi(this,n,t)}},Gi.prototype.selectVariantTrack=Gi.prototype.uc,Gi.prototype.Pc=function(){return this.a?Je(Wr(this.a).variants).map(function(e){return e.language}).filter(w):[]},Gi.prototype.getAudioLanguages=Gi.prototype.Pc,Gi.prototype.Yc=function(){return this.a?Wr(this.a).textStreams.map(function(e){return e.language}).filter(w):[]},Gi.prototype.getTextLanguages=Gi.prototype.Yc,Gi.prototype.Ud=function(e,t){if(this.a){var n=Wr(this.a);this.ia=e,this.mb=t||"",na(this,n)}},Gi.prototype.selectAudioLanguage=Gi.prototype.Ud,Gi.prototype.Vd=function(e,t){if(this.a){var n=Wr(this.a);this.Ca=e,this.lb=t||"",na(this,n)}},Gi.prototype.selectTextLanguage=Gi.prototype.Vd,Gi.prototype.bd=function(){return"showing"==this.A.mode},Gi.prototype.isTextTrackVisible=Gi.prototype.bd,Gi.prototype.Yd=function(e){this.A.mode=e?"showing":"hidden",aa(this)},Gi.prototype.setTextTrackVisibility=Gi.prototype.Yd,Gi.prototype.Uc=function(){return this.c?new Date(1e3*this.c.presentationTimeline.f+1e3*this.f.currentTime):null},Gi.prototype.getPlayheadTimeAsDate=Gi.prototype.Uc,Gi.prototype.getStats=function(){Zi(this),this.Sa();var e=null,t=null,n=this.f&&this.f.getVideoPlaybackQuality?this.f.getVideoPlaybackQuality():{};return this.g&&this.c&&(e=rt(this.c,Cr(this.g)),t=this.B[e],t=tt(t.audio,t.video,this.c.periods[e].variants),e=t.video||{}),e||(e={}),t||(t={}),{width:e.width||0,height:e.height||0,streamBandwidth:t.bandwidth||0,decodedFrames:Number(n.totalVideoFrames),droppedFrames:Number(n.droppedVideoFrames),estimatedBandwidth:this.b.abr.manager.getBandwidthEstimate(),loadLatency:this.i.loadLatency,playTime:this.i.playTime,bufferingTime:this.i.bufferingTime,switchHistory:A(this.i.switchHistory),stateHistory:A(this.i.stateHistory)}},Gi.prototype.getStats=Gi.prototype.getStats,Gi.prototype.addTextTrack=function(e,t,n,r,i,a){if(!this.a)return Promise.reject();for(var o,s=Wr(this.a),u=0;u<this.c.periods.length;u++)if(this.c.periods[u]==s){if(u==this.c.periods.length-1){if(o=this.c.presentationTimeline.Y()-s.startTime,1/0==o)return Promise.reject()}else o=this.c.periods[u+1].startTime-s.startTime;break}var l={id:this.Dc++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(t){return 1!=t?null:new Ht(1,0,o,function(){return[e]},0,null)},initSegmentReference:null,presentationTimeOffset:0,mimeType:r,codecs:i||"",kind:n,encrypted:!1,keyId:null,language:t,label:a||null,type:"text",primary:!1,trickModeVideo:null,containsEmsgBoxes:!1,roles:[]};return this.Va.push(l.id),s.textStreams.push(l),zr(this.a,l).then(function(){if(!this.O){var e=this.c.periods.indexOf(s),r=qr(this.a);return r.text&&(this.B[e].text=r.text.id),this.Va.splice(this.Va.indexOf(l.id),1),na(this,s),ia(this),{id:l.id,active:!1,type:"text",bandwidth:0,language:t,label:a||null,kind:n,width:null,height:null}}}.bind(this))},Gi.prototype.addTextTrack=Gi.prototype.addTextTrack,Gi.prototype.Jb=function(e,t){this.ob.width=e,this.ob.height=t},Gi.prototype.setMaxHardwareResolution=Gi.prototype.Jb,so=Gi.prototype,so.fb=function(e){var t=this.a?qr(this.a):{};if(Ye(this.j,t,e),t=0<Je(e.variants).length,Ke(e,this.b.restrictions,this.ob)&&this.a&&Wr(this.a)==e&&ia(this),e=1>Je(e.variants).length,!t)throw new u(2,4,4011);if(e)throw new u(2,4,4012)},so.de=function(e,t){this.b.abr.manager.segmentDownloaded(e,t)},so.zc=function(e){if(Zi(this),this.ka=e,this.Sa(),this.g){var t=this.g;e!=t.h&&(t.h=e,Ur(t,t.g))}this.dispatchEvent(new st("buffering",{buffering:e}))},so.$d=function(){ia(this)},so.Sa=function(){if(!this.O){var e=this.ka?"buffering":this.f.ended?"ended":this.f.paused?"paused":"playing",t=Date.now()/1e3;if(this.i.stateHistory.length){var n=this.i.stateHistory[this.i.stateHistory.length-1];if(n.duration=t-n.timestamp,e==n.state)return}this.i.stateHistory.push({timestamp:t,state:e,duration:0})}},so.ce=function(){if(this.v){var e=this.v;e.c.forEach(e.o.bind(e,!0))}this.a&&Jr(this.a)},so.ed=function(e){this.Za=!0,this.b.abr.manager.disable(),e=ta(this,e,Qe(e,this.ia,void 0,this.mb),Ze(e,this.Ca,void 0,this.lb),!0);for(var t in this.G)e[t]=this.G[t].stream;this.G={};for(t in e)Yi(this,e[t],!0);return e},so.Gc=function(){this.Za=!1,this.b.abr.enabled&&this.b.abr.manager.enable();for(var e in this.G){var t=this.G[e];$r(this.a,e,t.stream,t.Kc)}this.G={}},so.ld=function(){this.h&&this.h.update&&this.h.update()},so.ud=function(){this.g&&this.g.Ab()},so.Lb=function(e,t){var n,r=qr(this.a);for(n in e){var i=e[n];r[n]!=i?Yi(this,i,!0):delete e[n]}if(!B(e)&&this.a){for(n in e)$r(this.a,n,e[n],t||!1);ra(this)}},so.ya=function(e){this.O||this.dispatchEvent(new st("error",{detail:e}))},so.xd=function(e){this.v?this.v.v(e):this.Xa.push(e)},so.gb=function(e){this.dispatchEvent(e)},so.yd=function(){if(this.f.error){var e=this.f.error.code;if(1!=e){var t=this.f.error.msExtendedCode;t&&(0>t&&(t+=Math.pow(2,32)),t=t.toString(16)),this.ya(new u(2,3,3016,e,t))}}},so.be=function(e){var t=["output-restricted","internal-error"],n=Wr(this.a),r=!1;n.variants.forEach(function(n){var i=[];n.audio&&i.push(n.audio),n.video&&i.push(n.video),i.forEach(function(i){var a=n.allowedByKeySystem;i.keyId&&(i=e[i.keyId],n.allowedByKeySystem=!!i&&0>t.indexOf(i)),a!=n.allowedByKeySystem&&(r=!0)})});var i=qr(this.a);(i=et(i.audio,i.video,n.variants))&&!i.allowedByKeySystem&&na(this,n),r&&ia(this)},so.ae=function(e,t){this.h&&this.h.onExpirationUpdated&&this.h.onExpirationUpdated(e,t),this.dispatchEvent(new st("expirationupdated"))},t("shaka.offline.Storage",oa),oa.support=sa,oa.prototype.m=function(){var e=this.a,t=this.h?this.h.m().catch(function(){}).then(function(){if(e)return e.m()}):Promise.resolve();return this.i=this.f=this.h=this.a=null,t},oa.prototype.destroy=oa.prototype.m,oa.prototype.configure=function(e){O(this.i,e,la(this),{},"")},oa.prototype.configure=oa.prototype.configure,oa.prototype.le=function(e,t,n){function r(e){a=e}if(this.v)return Promise.reject(new u(2,9,9006));this.v=!0;var i,a=null;return ca(this).then(function(){return pa(this),ua(this,e,r,n)}.bind(this)).then(function(n){if(pa(this),this.c=n.manifest,this.b=n.Lc,this.c.presentationTimeline.$()||this.c.presentationTimeline.va())throw new u(2,9,9005,e);this.c.periods.forEach(this.o.bind(this)),this.g=this.a.c.manifest++,this.l=0,n=this.c.periods.map(this.B.bind(this));var r=this.b.b,a=se(this.b);if(r){if(!a.length)throw new u(2,9,9007,e);r.initData=[]}return i={key:this.g,originalManifestUri:e,duration:this.l,size:0,expiration:this.b.ab(),periods:n,sessionIds:a,drmInfo:r,appMetadata:t},Mi(this.h,i)}.bind(this)).then(function(){if(pa(this),a)throw a;return fa(this)}.bind(this)).then(function(){return Si(i)}.bind(this)).catch(function(e){return fa(this).catch(_).then(function(){throw e})}.bind(this))},oa.prototype.store=oa.prototype.le,oa.prototype.remove=function(e){function t(e){6013!=e.code&&(o=e)}var n=e.offlineUri,r=/^offline:([0-9]+)$/.exec(n);if(!r)return Promise.reject(new u(2,9,9004,n));var i,a,o=null,s=Number(r[1]);return ca(this).then(function(){return pa(this),this.a.get("manifest",s)}.bind(this)).then(function(e){if(pa(this),!e)throw new u(2,9,9003,n);return i=e,e=Ui(i),a=new re(this.f.o,t,function(){},function(){}),a.configure(this.f.getConfiguration().drm),a.init(e,!0)}.bind(this)).then(function(){return ae(a,i.sessionIds)}.bind(this)).then(function(){return a.m()}.bind(this)).then(function(){if(pa(this),o)throw o;var t=i.periods.map(function(e){return e.streams.map(function(e){var t=e.segments.map(function(e){return e=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e.uri),Number(e[1])});return e.initSegmentUri&&(e=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e.initSegmentUri),t.push(Number(e[1]))),t}).reduce(b,[])}).reduce(b,[]),n=0,r=t.length,a=this.i.progressCallback;return _i(this.a,t,function(){n++,a(e,n/r)})}.bind(this)).then(function(){return pa(this),this.i.progressCallback(e,1),this.a.remove("manifest",s)}.bind(this))},oa.prototype.remove=oa.prototype.remove,oa.prototype.list=function(){var e=[];return ca(this).then(function(){return pa(this),this.a.forEach("manifest",function(t){e.push(Si(t))})}.bind(this)).then(function(){return e})},oa.prototype.list=oa.prototype.list,oa.prototype.A=function(e){for(var t,n=[],r=Ve(this.f.getConfiguration().preferredAudioLanguage),i=[0,mo,bo],a=e.filter(function(e){return"variant"==e.type}),i=i.map(function(e){return a.filter(function(t){return t=Ve(t.language),Ge(e,r,t)})}),o=0;o<i.length;o++)if(i[o].length){t=i[o];break}t||(i=a.filter(function(e){return e.primary}),i.length&&(t=i)),t||(t=a,a.map(function(e){return e.language}).filter(w));var s=t.filter(function(e){return e.height&&480>=e.height});return s.length&&(s.sort(function(e,t){return t.height-e.height}),t=s.filter(function(e){return e.height==s[0].height})),t.sort(function(e,t){return e.bandwidth-t.bandwidth}),t.length&&n.push(t[Math.floor(t.length/2)]),n.push.apply(n,e.filter(function(e){return"text"==e.type})),n},oa.prototype.o=function(e){var t={};if(this.j){var n=this.j.filter(function(e){return"variant"==e.type}),r=null;n.length&&(r=Xe(e,n[0])),r&&(r.video&&(t.video=r.video),r.audio&&(t.audio=r.audio))}Ye(this.b,t,e),Ke(e,this.f.getConfiguration().restrictions,{width:1/0,height:1/0})},oa.prototype.B=function(e){var t,n,r=qe(e,null,null),i=ze(e,null),r=this.i.trackSelectionCallback(r.concat(i));for(this.j||(this.j=r,this.c.periods.forEach(this.o.bind(this))),i=r.length-1;0<i;--i){var a=!1;for(n=i-1;0<=n;--n)if(r[i].type==r[n].type&&r[i].kind==r[n].kind&&r[i].language==r[n].language){a=!0;break}if(a)break}for(a=[],i=0;i<r.length;i++)(t=Xe(e,r[i]))?(t.audio&&((n=a.filter(function(e){return e.id==t.audio.id})[0])?n.variantIds.push(t.id):(n=t.video?t.bandwidth/2:t.bandwidth,a.push(ha(this,e,t.audio,n,t.id)))),t.video&&((n=a.filter(function(e){return e.id==t.video.id})[0])?n.variantIds.push(t.id):(n=t.audio?t.bandwidth/2:t.bandwidth,a.push(ha(this,e,t.video,n,t.id))))):a.push(ha(this,e,$e(e,r[i]),0));return{startTime:e.startTime,streams:a}},es.offline=sa,t("shaka.polyfill.installAll",function(){for(var e=0;e<ts.length;++e)ts[e]()});var ts=[];t("shaka.polyfill.register",va),va(function(){if(e.Document){var t=Element.prototype;t.requestFullscreen=t.requestFullscreen||t.mozRequestFullScreen||t.msRequestFullscreen||t.webkitRequestFullscreen,t=Document.prototype,t.exitFullscreen=t.exitFullscreen||t.mozCancelFullScreen||t.msExitFullscreen||t.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",ya),document.addEventListener("webkitfullscreenerror",ya),document.addEventListener("mozfullscreenchange",ya),document.addEventListener("mozfullscreenerror",ya),document.addEventListener("MSFullscreenChange",ya),document.addEventListener("MSFullscreenError",ya)}}),va(function(){var t=navigator.userAgent;t&&0<=t.indexOf("CrKey")&&delete e.indexedDB}),va(function(){if(4503599627370497!=Math.round(4503599627370497)){var e=Math.round;Math.round=function(t){var n=t;return 4503599627370496>=t&&(n=e(t)),n}}}),ga.prototype.c=function(e){if(!(1<e.version)){var t=te(e.s.Ka(16)),n=[];if(0<e.version)for(var r=e.s.D(),i=0;i<r;++i){var a=te(e.s.Ka(16));n.push(a)}r=e.s.D(),e.s.I(r),this.b.push.apply(this.b,n),this.f.push(t),this.a.push({start:e.start,end:e.start+e.size-1})}},ba.prototype.createMediaKeys=function(){var e=new Ea(this.keySystem);return Promise.resolve(e)},ba.prototype.getConfiguration=function(){return this.a},Ea.prototype.createSession=function(e){if("temporary"!=(e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new wa(this.a)},Ea.prototype.setServerCertificate=function(){return Promise.resolve(!1)},n(wa),so=wa.prototype,so.generateRequest=function(e,t){this.a=new P;try{this.c=this.g.createSession("video/mp4",new Uint8Array(t),null),N(this.f,this.c,"mskeymessage",this.pd.bind(this)),N(this.f,this.c,"mskeyadded",this.nd.bind(this)),N(this.f,this.c,"mskeyerror",this.od.bind(this)),Oa(this,"status-pending")}catch(e){this.a.reject(e)}return this.a},so.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},so.update=function(e){this.b=new P;try{this.c.update(new Uint8Array(e))}catch(e){this.b.reject(e)}return this.b},so.close=function(){try{this.c.close(),this.closed.resolve(),j(this.f)}catch(e){this.closed.reject(e)}return this.closed},so.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},so.pd=function(e){this.a&&(this.a.resolve(),this.a=null),this.dispatchEvent(new st("message",{messageType:void 0==this.keyStatuses.sb()?"licenserequest":"licenserenewal",message:e.message.buffer}))},so.nd=function(){this.a?(Oa(this,"usable"),this.a.resolve(),this.a=null):this.b&&(Oa(this,"usable"),this.b.resolve(),this.b=null)},so.od=function(){var e=Error("EME PatchedMediaKeysMs key error");if(e.errorCode=this.c.error,this.a)this.a.reject(e),this.a=null;else if(this.b)this.b.reject(e),this.b=null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:Oa(this,"output-not-allowed");default:Oa(this,"internal-error")}};var ns;so=Aa.prototype,so.Kb=function(e){this.size=void 0==e?0:1,this.a=e},so.sb=function(){return this.a},so.forEach=function(e){this.a&&e(this.a,ns)},so.get=function(e){if(this.has(e))return this.a},so.has=function(e){var t=ns;return!(!this.a||!ne(new Uint8Array(e),new Uint8Array(t)))},so.entries=function(){},so.keys=function(){},so.values=function(){},Da.prototype.createSession=function(){},Da.prototype.setServerCertificate=function(){},La.prototype.getConfiguration=function(){},La.prototype.createMediaKeys=function(){};var rs="";Na.prototype.createMediaKeys=function(){var e=new Ua(this.a);return Promise.resolve(e)},Na.prototype.getConfiguration=function(){return this.b},so=Ua.prototype,so.createSession=function(e){var t=e||"temporary";if("temporary"!=t&&"persistent-license"!=t)throw new TypeError("Session type "+e+" is unsupported on this platform.");return e=this.b||document.createElement("video"),e.src||(e.src="about:blank"),t=new Ba(e,this.g,t),this.c.push(t),t},so.setServerCertificate=function(){return Promise.resolve(!1)},so.Cd=function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("encrypted",!1,!1,null),t.initDataType="webm",t.initData=e.initData,this.b.dispatchEvent(t)},so.Bd=function(e){var t=Fa(this,e.sessionId);t&&(e=new st("message",{messageType:void 0==t.keyStatuses.sb()?"licenserequest":"licenserenewal",message:e.message}),t.b&&(t.b.resolve(),t.b=null),t.dispatchEvent(e))},so.zd=function(e){(e=Fa(this,e.sessionId))&&(Va(e,"usable"),e.a&&e.a.resolve(),e.a=null)},so.Ad=function(e){var t=Fa(this,e.sessionId);if(t){var n=Error("EME v0.1b key error");n.errorCode=e.errorCode,n.errorCode.systemCode=e.systemCode,!e.sessionId&&t.b?(n.method="generateRequest",45==e.systemCode&&(n.message="Unsupported session type."),t.b.reject(n),t.b=null):e.sessionId&&t.a?(n.method="update",t.a.reject(n),t.a=null):(n=e.systemCode,e.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?Va(t,"output-restricted"):1==n?Va(t,"expired"):Va(t,"internal-error"))}},n(Ba),so=Ba.prototype,so.Mb=function(e,t){if(this.a)this.a.then(this.Mb.bind(this,e,t)).catch(this.Mb.bind(this,e,t));else{if(this.a=e,"webkit-org.w3.clearkey"==this.c){var n=Y(t),r=JSON.parse(n);"oct"!=r.keys[0].kty&&(this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a=null),n=Z(r.keys[0].k),r=Z(r.keys[0].kid)}else n=new Uint8Array(t),r=null;var i=Ia("addKey");try{this.f[i](this.c,n,r,this.sessionId)}catch(e){this.a.reject(e),this.a=null}}},so.generateRequest=function(e,t){return Ga(this,t,null)},so.load=function(e){return"persistent-license"==this.g?Ga(this,null,e):Promise.reject(Error("Not a persistent session."))},so.update=function(e){var t=new P;return this.Mb(t,e),t},so.close=function(){if("persistent-license"!=this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var e=Ia("cancelKeyRequest");try{this.f[e](this.c,this.sessionId)}catch(e){}}return this.closed.resolve(),this.closed},so.remove=function(){return"persistent-license"!=this.g?Promise.reject(Error("Not a persistent session.")):this.close()};var is;so=Ha.prototype,so.Kb=function(e){this.size=void 0==e?0:1,this.a=e},so.sb=function(){return this.a},so.forEach=function(e){this.a&&e(this.a,is)},so.get=function(e){if(this.has(e))return this.a},so.has=function(e){var t=is;return!(!this.a||!ne(new Uint8Array(e),new Uint8Array(t)))},so.entries=function(){},so.keys=function(){},so.values=function(){},va(function(){!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(HTMLMediaElement.prototype.webkitGenerateKeyRequest?xa("webkit"):HTMLMediaElement.prototype.generateKeyRequest?xa(""):e.MSMediaKeys?(ns=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=_a,e.MediaKeys=Ea,e.MediaKeySystemAccess=ba,navigator.requestMediaKeySystemAccess=ma):(navigator.requestMediaKeySystemAccess=Pa,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Ra,e.MediaKeys=Da,e.MediaKeySystemAccess=La))}),va(function(){if(e.MediaSource){var t=navigator.vendor,n=navigator.appVersion;!t||!n||0>t.indexOf("Apple")||(0<=n.indexOf("Version/8")?e.MediaSource=null:0<=n.indexOf("Version/9")?Ka():0<=n.indexOf("Version/10")&&(Ka(),Ya()))}});var as=0;za.prototype.then=function(e,t){var n=new za;switch(this.Aa){case 1:Za(this,n,e);break;case 2:Za(this,n,t);break;case as:this.c.push({L:n,pb:e}),this.b.push({L:n,pb:t})}return n},za.prototype.catch=function(e){return this.then(void 0,e)},za.prototype.fa=function(e){if(this.Aa==as){for(this.jb=e,this.Aa=1,e=0;e<this.c.length;++e)Za(this,this.c[e].L,this.c[e].pb);this.c=[],this.b=[]}},za.prototype.a=function(e){if(this.Aa==as){for(this.jb=e,this.Aa=2,e=0;e<this.b.length;++e)Za(this,this.b[e].L,this.b[e].pb);this.c=[],this.b=[]}};var os=null,ss=[];va(function(t){e.setImmediate?(no=function(t){return e.setImmediate(t)},ro=function(t){return e.clearImmediate(t)}):(no=function(t){return e.setTimeout(t,0)},ro=function(t){return e.clearTimeout(t)}),e.Promise&&!t||(e.Promise=za,e.Promise.resolve=Xa,e.Promise.reject=$a,e.Promise.all=Ja,e.Promise.race=Qa,e.Promise.prototype.then=za.prototype.then,e.Promise.prototype.catch=za.prototype.catch)}),va(function(){if(e.HTMLMediaElement){var t=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var e=t.apply(this,arguments);return e&&e.catch(function(){}),e}}}),va(function(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;!t.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in t&&(t.getVideoPlaybackQuality=io)}}),va(function(){if(!e.VTTCue&&e.TextTrackCue){var t=TextTrackCue.length;if(3==t)e.VTTCue=ao;else if(6==t)e.VTTCue=oo;else{try{var n=!!ao(1,2,"")}catch(e){n=!1}n&&(e.VTTCue=ao)}}})}).call(i,this),void 0!==e&&e.exports?e.exports=i.shaka:void 0!==(r=function(){return i.shaka}.call(t,n,t,e))&&(e.exports=r)}()}])}); +!function(a){"use strict";var o={};o.VERSION="1.3.0";var s,u={},l=function(e,t){return function(){return t.apply(e,arguments)}},c=function(){var e,t,n=arguments,r=n[0];for(t=1;t<n.length;t++)for(e in n[t])e in r||!n[t].hasOwnProperty(e)||(r[e]=n[t][e]);return r},f=function(e,t){return{value:e,name:t}};o.DEBUG=f(1,"DEBUG"),o.INFO=f(2,"INFO"),o.TIME=f(3,"TIME"),o.WARN=f(4,"WARN"),o.ERROR=f(8,"ERROR"),o.OFF=f(99,"OFF");var d=function(e){this.context=e,this.setLevel(e.filterLevel),this.log=this.info};d.prototype={setLevel:function(e){e&&"value"in e&&(this.context.filterLevel=e)},enabledFor:function(e){var t=this.context.filterLevel;return e.value>=t.value},debug:function(){this.invoke(o.DEBUG,arguments)},info:function(){this.invoke(o.INFO,arguments)},warn:function(){this.invoke(o.WARN,arguments)},error:function(){this.invoke(o.ERROR,arguments)},time:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"start"])},timeEnd:function(e){"string"==typeof e&&e.length>0&&this.invoke(o.TIME,[e,"end"])},invoke:function(e,t){s&&this.enabledFor(e)&&s(t,c({level:e},this.context))}};var h=new d({filterLevel:o.OFF});!function(){var e=o;e.enabledFor=l(h,h.enabledFor),e.debug=l(h,h.debug),e.time=l(h,h.time),e.timeEnd=l(h,h.timeEnd),e.info=l(h,h.info),e.warn=l(h,h.warn),e.error=l(h,h.error),e.log=e.info}(),o.setHandler=function(e){s=e},o.setLevel=function(e){h.setLevel(e);for(var t in u)u.hasOwnProperty(t)&&u[t].setLevel(e)},o.get=function(e){return u[e]||(u[e]=new d(c({name:e},h.context)))},o.createDefaultHandler=function(e){e=e||{},e.formatter=e.formatter||function(e,t){t.name&&e.unshift("["+t.name+"]")};var t={},n=function(e,t){Function.prototype.apply.call(e,console,t)};return"undefined"==typeof console?function(){}:function(r,i){r=Array.prototype.slice.call(r);var a,s=console.log;i.level===o.TIME?(a=(i.name?"["+i.name+"] ":"")+r[0],"start"===r[1]?console.time?console.time(a):t[a]=(new Date).getTime():console.timeEnd?console.timeEnd(a):n(s,[a+": "+((new Date).getTime()-t[a])+"ms"])):(i.level===o.WARN&&console.warn?s=console.warn:i.level===o.ERROR&&console.error?s=console.error:i.level===o.INFO&&console.info&&(s=console.info),e.formatter(r,i),n(s,r))}},o.useDefaults=function(e){o.setLevel(e&&e.defaultLevel||o.DEBUG),o.setHandler(o.createDefaultHandler(e))},r=o,void 0!==(i="function"==typeof r?r.call(t,n,t,e):r)&&(e.exports=i)}()},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o,s,u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=n(2),f=function(e){return e&&e.__esModule?e:{default:e}}(c),d=n(1),h=n(3),p=n(8),v=n(52),g=function(e){return{metadataLoaded:e.engine.metadataLoaded,currentState:e.engine.playerState.currentState,playerClasses:e.shell.playerClasses,isMobile:e.shell.isMobile}},y=(o=(0,d.connect)(g,(0,h.bindActions)(p.actions)))(s=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Shell"}))}return a(t,e),u(t,[{key:"componentDidMount",value:function(){this.props.updateIsMobile((0,v.isMobile)())}},{key:"render",value:function(e){var t="player skin-default";return t+=" "+e.playerClasses.join(" "),this.props.metadataLoaded&&(t+=" metadata-loaded"),this.props.metadataLoaded&&(t+=" state-"+this.props.currentState),(0,l.h)("div",{className:t},e.children)}}]),t}(f.default))||s;t.default=y},function(e,t,n){"use strict";function r(){return void 0!==window.orientation||-1!==navigator.userAgent.indexOf("IEMobile")}Object.defineProperty(t,"__esModule",{value:!0}),t.isMobile=r},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(1),d=n(3),h=n(9),p=n(2),v=r(p),g=n(4),y=r(g),m=function(e){return{isPlaying:e.engine.isPlaying}},b=(s=(0,f.connect)(m,(0,d.bindActions)(h.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"OverlayPlay",player:e.player}))}return o(t,e),l(t,[{key:"togglePlayPause",value:function(){var e=this;this.logger.debug("Toggle play"),this.setState({animation:!0}),setTimeout(function(){e.setState({animation:!1})},400),this.player.paused?this.player.play():this.player.pause()}},{key:"render",value:function(e){var t=this;return(0,c.h)("div",{className:"overlay-play "+(this.state.animation?"in":""),onClick:function(){return t.togglePlayPause()}},e.isPlaying?(0,c.h)(y.default,{type:"play"}):(0,c.h)(y.default,{type:"pause"}))}}]),t}(v.default))||u;t.default=b},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(1),d=n(3),h=n(22),p=n(2),v=function(e){return e&&e.__esModule?e:{default:e}}(p),g=function(e){return{show:e.loading.show}},y=(s=(0,f.connect)(g,(0,d.bindActions)(h.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Loading",player:e.player}))}return o(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this;this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED,function(t){"idle"===t.payload.newState.type||"playing"===t.payload.newState.type||"paused"===t.payload.newState.type?e.props.updateLoadingSpinnerState(!1):e.props.updateLoadingSpinnerState(!0)})}},{key:"render",value:function(e){return(0,c.h)("div",{className:e.show?"loading-backdrop show":"loading-backdrop"},(0,c.h)("div",{className:"spinner-container"},(0,c.h)("div",{className:"spinner"},[].concat(r(Array(8))).map(function(){return(0,c.h)("span",null)}))))}}]),t}(v.default))||u;t.default=y},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(5),d=n(1),h=n(3),p=n(9),v=n(2),g=r(v),y=n(4),m=r(y),b=function(e){return{isPlaying:e.engine.isPlaying}},_=(s=(0,d.connect)(b,(0,h.bindActions)(p.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"PlayPause",player:e.player}))}return o(t,e),l(t,[{key:"togglePlayPause",value:function(){this.logger.debug("Toggle play"),this.player.paused?this.player.play():this.player.pause()}},{key:"render",value:function(){var e=this,t=this.props.isPlaying?"control-button is-playing":"control-button";return(0,c.h)("div",{className:"control-button-container control-play-pause"},(0,c.h)(f.Localizer,null,(0,c.h)("button",{"aria-label":(0,c.h)(f.Text,{id:this.props.isPlaying?"controls.pause":"controls.play"}),className:t,onClick:function(){return e.togglePlayPause()}},(0,c.h)(m.default,{type:"play"}),(0,c.h)(m.default,{type:"pause"}))))}}]),t}(g.default))||u;t.default=_},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o,s,u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=n(1),f=n(3),d=n(19),h=n(2),p=function(e){return e&&e.__esModule?e:{default:e}}(h),v=n(24),g=function(e){return{virtualProgress:e.seekbar.virtualTime,currentTime:e.seekbar.currentTime,duration:e.engine.duration,isDraggingActive:e.seekbar.draggingActive}},y=(o=(0,c.connect)(g,(0,f.bindActions)(d.actions)))(s=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"SeekBar",player:e.player}));return n.onSeekbarMouseDown=function(e){if(n.props.updateSeekbarDraggingStatus(!0),n.props.isDraggingActive){var t=n.getTime(e);n.updateSeekBarProgress(t,n.player.duration)}},n.onSeekbarMouseUp=function(e){var t=n.getTime(e);n.player.currentTime=t,n.updateSeekBarProgress(t,n.player.duration),n.props.updateSeekbarDraggingStatus(!1),n.logger.debug("Seek to "+t+"s")},n.onSeekbarMouseMove=function(e){var t=n.getTime(e);n.updateSeekBarProgress(t,n.player.duration,!0),n.props.isDraggingActive&&n.updateSeekBarProgress(t,n.player.duration)},n}return a(t,e),u(t,[{key:"componentDidMount",value:function(){var e=this;this._playerElement=document.getElementsByClassName("player")[0],this._seekBarElement=document.getElementsByClassName("seek-bar")[0],this.setState({virtualTime:0}),this.player.addEventListener(this.player.Event.TIME_UPDATE,function(){e.props.updateCurrentTime(e.player.currentTime)})}},{key:"updateSeekBarProgress",value:function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this.setState({virtualTime:e}):this.props.updateCurrentTime(e)}},{key:"getTime",value:function(e){var t=this.player.duration*((e.clientX-this._seekBarElement.offsetLeft-this._playerElement.offsetLeft)/this._seekBarElement.clientWidth);return t=parseFloat(t.toFixed(2)),t<0?0:t>this.player.duration?this.player.duration:t}},{key:"getThumbSpriteOffset",value:function(){return-160*Math.ceil(100*this.state.virtualTime/this.player.duration)+"px 0px"}},{key:"render",value:function(e){var t=this,n=this.state.virtualTime/e.duration*100+"%",r=e.currentTime/e.duration*100+"%",i="background-image: url(http://cfvod.kaltura.com/p/1914121/sp/191412100/thumbnail/entry_id/1_fet8ffop/version/100001/width/160/vid_slices/100); ";return i+="background-position: "+this.getThumbSpriteOffset(),(0,l.h)("div",{className:"seek-bar",role:"slider","aria-label":"Seek slider","aria-valuemin":"0","aria-valuemax":Math.round(this.player.duration),"aria-valuenow":Math.round(this.player.currentTime),"aria-valuetext":(0,v.toHHMMSS)(this.player.currentTime)+" of "+(0,v.toHHMMSS)(this.player.duration),onMouseMove:function(e){return t.onSeekbarMouseMove(e)},onMouseDown:function(e){return t.onSeekbarMouseDown(e)},onMouseUp:function(e){return t.onSeekbarMouseUp(e)}},(0,l.h)("div",{className:"progress-bar"},(0,l.h)("div",{className:"progress",style:{width:r}},(0,l.h)("a",{className:"scrubber"})),(0,l.h)("div",{className:"virtual-progress",style:{width:n}},e.showFramePreview?(0,l.h)("div",{className:"frame-preview"},(0,l.h)("div",{className:"frame-preview-img",style:i})):"",this.props.showTimeBubble?(0,l.h)("div",{className:"time-preview"},(0,v.toHHMMSS)(this.state.virtualTime)):""),(0,l.h)("div",{className:"buffered",style:"width: 60%;"})))}}]),t}(p.default))||s;t.default=y},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(1),d=n(3),h=n(20),p=n(2),v=r(p),g=n(4),y=r(g),m=function(e){return{isDraggingActive:e.volume.isDraggingActive,volume:e.volume.volume,muted:e.volume.muted,isMobile:e.shell.isMobile}},b=(s=(0,f.connect)(m,(0,d.bindActions)(h.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Volume",player:e.player}))}return o(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this;this._volumeControlElement=document.getElementsByClassName("volume-control")[0],this._volumeProgressBarElement=this._volumeControlElement.getElementsByClassName("bar")[0],this.player.addEventListener(this.player.Event.LOADED_METADATA,function(){e.props.updateVolume(e.player.volume)}),this.player.addEventListener(this.player.Event.VOLUME_CHANGE,function(){e.props.updateVolume(e.player.volume)})}},{key:"getVolumeProgessHeight",value:function(){return this.props.muted?"0%":Math.round(100*this.props.volume)+"%"}},{key:"onVolumeProgressBarMouseDown",value:function(){this.props.updateVolumeDraggingStatus(!0)}},{key:"onVolumeProgressBarClick",value:function(e){this.changeVolume(e)}},{key:"onVolumeControlButtonClick",value:function(){this.logger.debug("Toggle mute. "+this.player.muted+" => "+!this.player.muted),this.props.updateMuted(!this.props.muted),this.player.muted=!this.player.muted}},{key:"changeVolume",value:function(e){var t=this._volumeProgressBarElement.clientHeight,n=this.getCoords(this._volumeProgressBarElement).top,r=e.clientY,i=1-(r-n)/t;i=parseFloat(i.toFixed(2)),this.logger.debug("Change volume from "+this.player.volume+" => "+i),this.player.volume=i,this.props.muted&&(this.player.muted=!1,this.props.updateMuted(!1))}},{key:"getCoords",value:function(e){var t=e.getBoundingClientRect();return{top:t.top+pageYOffset,left:t.left+pageXOffset}}},{key:"render",value:function(){var e=this,t="control-button-container volume-control";return this.props.isDraggingActive&&(t+=" dragging-active"),(this.props.muted||0===this.props.volume)&&(t+=" is-muted"),(0,c.h)("div",{className:t},(0,c.h)("button",{className:"control-button",onClick:function(){return e.onVolumeControlButtonClick()},"aria-label":"Volume"},(0,c.h)(y.default,{type:"volume-base"}),(0,c.h)(y.default,{type:"volume-waves"}),(0,c.h)(y.default,{type:"volume-mute"})),(0,c.h)("div",{className:"volume-control-bar",role:"slider","aria-valuemin":"0","aria-valuemaz":"100","aria-valuenow":100*this.player.volume,"aria-valuetext":100*this.player.volume+"% volume "+(this.player.muted?"muted":"")},(0,c.h)("div",{className:"bar",onMouseDown:function(){return e.onVolumeProgressBarMouseDown()},onClick:function(t){return e.onVolumeProgressBarClick(t)}},(0,c.h)("div",{className:"progress",style:{height:this.getVolumeProgessHeight()}}))))}}]),t}(v.default))||u;t.default=b},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(1),d=n(3),h=n(10),p=n(2),v=r(p),g=n(4),y=r(g),m=function(e){return{overlayOpen:e.share.overlayOpen}},b=(s=(0,f.connect)(m,(0,d.bindActions)(h.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Share",player:e.player}))}return o(t,e),l(t,[{key:"render",value:function(e){return(0,c.h)("div",{className:"control-button-container control-share"},(0,c.h)("button",{className:"control-button control-button-rounded",onClick:function(){return e.toggleShareOverlay(!e.overlayOpen)},"aria-label":"Share"},(0,c.h)(y.default,{type:"share"})))}}]),t}(v.default))||u;t.default=b},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(5),d=n(1),h=n(3),p=n(23),v=n(2),g=r(v),y=n(25),m=r(y),b=n(26),_=r(b),E=n(4),T=r(E),w=function(e){return{videoTracks:e.engine.videoTracks}},k=(s=(0,d.connect)(w,(0,h.bindActions)(p.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Settings",player:e.player}))}return o(t,e),l(t,[{key:"componentDidMount",value:function(){this.setState({smartContainerOpen:!1})}},{key:"onControlButtonClick",value:function(){this.setState({smartContainerOpen:!this.state.smartContainerOpen})}},{key:"onSpeedChange",value:function(e){this.props.updateSpeed(e.value)}},{key:"onQualityChange",value:function(e){this.props.updateQuality(e.value)}},{key:"render",value:function(e){var t=this,n=[{value:1,label:"Auto (360)",active:!0},{value:2,label:"240"},{value:3,label:"144"}],r=e.videoTracks.map(function(e){return{label:e.label||e.language,active:e.active,value:e}});return(0,c.h)("div",{className:"control-button-container control-settings"},(0,c.h)(f.Localizer,null,(0,c.h)("button",{"aria-label":(0,c.h)(f.Text,{id:"controls.settings"}),className:this.state.smartContainerOpen?"control-button active":"control-button",onClick:function(){return t.onControlButtonClick()}},(0,c.h)(T.default,{type:"settings"}))),this.state.smartContainerOpen?(0,c.h)(m.default,null,e.videoTracks.length<=0?"":(0,c.h)(f.Localizer,null,(0,c.h)(_.default,{label:(0,c.h)(f.Text,{id:"settings.quality"}),options:r,onSelect:function(e){return t.onQualityChange(e)}})),(0,c.h)(f.Localizer,null,(0,c.h)(_.default,{label:(0,c.h)(f.Text,{id:"settings.speed"}),options:n,onSelect:function(e){return t.onSpeedChange(e)}}))):"")}}]),t}(g.default))||u;t.default=k},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=n(4),l=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),o(t,[{key:"componentWillMount",value:function(){this.setState({dropMenuActive:!1})}},{key:"isSelected",value:function(e){return e.active}},{key:"onSelect",value:function(e){this.props.onSelect(e.value),this.setState({dropMenuActive:!1})}},{key:"getActiveOptionLabel",value:function(){var e=this.props.options.filter(function(e){return e.active});return e.length>0?e[0].label:this.props.options[0].label}},{key:"render",value:function(e){var t=this;return(0,s.h)("div",{className:"dropdown top left"},(0,s.h)("div",{className:"dropdown-button",onClick:function(){return t.setState({dropMenuActive:!t.state.dropMenuActive})}},this.getActiveOptionLabel()),this.state.dropMenuActive?(0,s.h)("div",{className:"dropdown-menu"},e.options.map(function(e){return(0,s.h)("div",{className:t.isSelected(e)?"dropdown-menu-item active":"dropdown-menu-item",onClick:function(){return t.onSelect(e)}},(0,s.h)("span",null,e.label),t.isSelected(e)?(0,s.h)(l.default,{type:"check"}):"")})):"")}}]),t}(s.Component);t.default=c},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(5),d=n(1),h=n(3),p=n(11),v=n(2),g=r(v),y=n(25),m=r(y),b=n(26),_=r(b),E=n(4),T=r(E),w=function(e){return{audioTracks:e.engine.audioTracks,textTracks:e.engine.textTracks,overlayOpen:e.cvaa.overlayOpen}},k=(s=(0,d.connect)(w,(0,h.bindActions)(p.actions)))(u=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"LanguageControl",player:e.player}))}return o(t,e),l(t,[{key:"componentDidMount",value:function(){this.setState({smartContainerOpen:!1})}},{key:"onControlButtonClick",value:function(){this.setState({smartContainerOpen:!this.state.smartContainerOpen})}},{key:"onAudioChange",value:function(e){this.player._engine.selectTextTrack(e)}},{key:"onCaptionsChange",value:function(e){this.player._engine.selectTextTrack(e)}},{key:"render",value:function(e){var t=this,n=e.audioTracks.map(function(e){return{label:e.label||e.language,active:e.active,value:e}}),r=e.textTracks.map(function(e){return{label:e.label||e.language,active:e.active,value:e}});return(0!==e.audioTracks.length||0!==e.audioTracks.length)&&(0,c.h)("div",{className:"control-button-container control-language"},(0,c.h)(f.Localizer,null,(0,c.h)("button",{"aria-label":(0,c.h)(f.Text,{id:"controls.language"}),className:this.state.smartContainerOpen?"control-button active":"control-button",onClick:function(){return t.onControlButtonClick()}},(0,c.h)(T.default,{type:"language"}))),this.state.smartContainerOpen?(0,c.h)(m.default,null,e.audioTracks.length<=0?"":(0,c.h)(f.Localizer,null,(0,c.h)(_.default,{label:(0,c.h)(f.Text,{id:"language.audio"}),options:n,onSelect:function(e){return t.onAudioChange(e)}})),e.textTracks.length<=0?"":(0,c.h)(f.Localizer,null,(0,c.h)(_.default,{label:(0,c.h)(f.Text,{id:"language.captions"}),options:r,onSelect:function(e){return t.onCaptionsChange(e)}})),e.textTracks.length<=0?"":(0,c.h)("div",{className:"smart-container-item"},(0,c.h)("a",{onClick:function(){return e.toggleCVAAOverlay(!e.overlayOpen)}},(0,c.h)(f.Text,{id:"language.advanced_captions_settings"},"Advanced captions settings")))):"")}}]),t}(g.default))||u;t.default=k},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(5),d=n(1),h=n(3),p=n(21),v=n(2),g=r(v),y=n(4),m=r(y),b=function(e){return{fullscreen:e.fullscreen.fullscreen}},_=(s=(0,d.connect)(b,(0,h.bindActions)(p.actions)))(u=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Fullscreen"}))}return o(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this;this._playerElement=document.getElementsByClassName("player")[0],document.addEventListener("webkitfullscreenchange",function(){e.props.updateFullscreen(document.webkitIsFullScreen)})}},{key:"enterFullscreen",value:function(){this._playerElement.webkitRequestFullscreen()}},{key:"exitFullscreen",value:function(){document.webkitCancelFullScreen()}},{key:"toggleFullscreen",value:function(){this.logger.debug("Toggle fullscreen"),this.props.fullscreen?this.exitFullscreen():this.enterFullscreen()}},{key:"render",value:function(){var e=this;return(0,c.h)("div",{className:"control-button-container control-fullscreen"},(0,c.h)(f.Localizer,null,(0,c.h)("button",{"aria-label":(0,c.h)(f.Text,{id:"controls.fullscreen"}),className:this.props.fullscreen?"control-button is-fullscreen":"control-button",onClick:function(){return e.toggleFullscreen()}},(0,c.h)(m.default,{type:"maximize"}),(0,c.h)(m.default,{type:"minimize"}))))}}]),t}(g.default))||u;t.default=_},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o,s,u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=n(1),f=n(2),d=function(e){return e&&e.__esModule?e:{default:e}}(f),h=n(24),p=function(e){return{currentTime:e.seekbar.currentTime,duration:e.engine.duration}},v=(o=(0,c.connect)(p))(s=function(e){function t(e){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"TimeDisplay",player:e.player,config:e.config}))}return a(t,e),u(t,[{key:"getTimeDisplay",value:function(){var e=this.props.format?this.props.format:"current / total",t=(0,h.toHHMMSS)(this.props.currentTime),n=(0,h.toHHMMSS)(this.props.duration),r=(0,h.toHHMMSS)(this.props.duration-this.props.currentTime);return e=e.replace(/current/g,t),e=e.replace(/total/g,n),e=e.replace(/left/g,r)}},{key:"render",value:function(){return(0,l.h)("div",{className:"time-display"},(0,l.h)("span",null,this.getTimeDisplay()))}}]),t}(d.default))||s;t.default=v},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),o(t,[{key:"render",value:function(e){return(0,s.h)("div",{className:"top-bar"},e.children)}}]),t}(s.Component);t.default=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),o(t,[{key:"render",value:function(e){return(0,s.h)("div",{className:"bottom-bar"},e.children)}}]),t}(s.Component);t.default=u},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(5),d=n(1),h=n(3),p=n(10),v=n(2),g=r(v),y=n(27),m=r(y),b=function(e){return{open:e.share.overlayOpen}},_=(s=(0,d.connect)(b,(0,h.bindActions)(p.actions)))(u=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"ShareOverlay"}))}return o(t,e),l(t,[{key:"render",value:function(e){return e.open?(0,c.h)(m.default,{open:e.open,onClose:function(){return e.toggleShareOverlay(!1)},type:"share"},(0,c.h)("div",{className:"title"},(0,c.h)(f.Text,{id:"share.share_title"})),(0,c.h)("div",{className:"share-icons"},(0,c.h)("a",{className:"share-btn facebook-share-btn"},(0,c.h)("svg",{style:"width:32px;height:32px",viewBox:"0 0 1024 1024"},(0,c.h)("path",{fill:"#fff",d:"M432 405.333h-80v106.667h80v320h133.333v-320h97.12l9.547-106.667h-106.667v-44.453c0-25.467 5.12-35.547 29.733-35.547h76.933v-133.333h-101.547c-95.893 0-138.453 42.213-138.453 123.067v90.267z"}))),(0,c.h)("a",{className:"share-btn twitter-share-btn"},(0,c.h)("svg",{style:"width:32px;height:32px",viewBox:"0 0 1024 1024"},(0,c.h)("path",{fill:"#fff",d:"M832 316.614c-23.547 10.29-48.853 17.221-75.413 20.345 27.12-15.987 47.947-41.319 57.733-71.508-25.36 14.806-53.467 25.568-83.387 31.37-23.92-25.122-58.080-40.82-95.84-40.82-84.773 0-147.067 77.861-127.92 158.687-109.093-5.381-205.84-56.833-270.613-135.035-34.4 58.094-17.84 134.090 40.613 172.574-21.493-0.683-41.76-6.484-59.44-16.171-1.44 59.879 42.16 115.898 105.307 128.368-18.48 4.935-38.72 6.090-59.307 2.205 16.693 51.347 65.173 88.702 122.667 89.752-55.2 42.605-124.747 61.637-194.4 53.552 58.107 36.673 127.147 58.067 201.28 58.067 243.787 0 381.52-202.684 373.2-384.473 25.653-18.244 47.92-41.004 65.52-66.914v0z"}))),(0,c.h)("a",{className:"share-btn google-plus-share-btn"},(0,c.h)("svg",{style:"width:32px;height:32px",viewBox:"0 0 1024 1024"},(0,c.h)("path",{fill:"#fff",d:"M352 556.8h127.040c-5.12 32.928-38.4 96.64-127.040 96.64-76.48 0-138.88-63.328-138.88-141.44 0-78.080 62.4-141.44 138.88-141.44 43.52 0 72.64 18.56 89.28 34.56l60.8-58.56c-39.040-36.48-89.6-58.56-150.080-58.56-123.84 0-224 100.16-224 224s100.16 224 224 224c129.28 0 215.072-90.88 215.072-218.88 0-14.72-1.632-25.92-3.552-37.12h-211.52v76.8zM800 544v96h-64v-96h-96v-64h96v-96h64v96h96v64h-96z"}))),(0,c.h)("a",{className:"share-btn linkedin-share-btn"},(0,c.h)("svg",{style:"width:32px;height:32px",viewBox:"0 0 1024 1024"},(0,c.h)("path",{fill:"#fff",d:"M324.8 290.087c0 36.506-29.6 66.087-66.133 66.087s-66.133-29.581-66.133-66.087c0-36.48 29.6-66.087 66.133-66.087s66.133 29.607 66.133 66.087zM325.333 409.043h-133.333v422.957h133.333v-422.957zM538.187 409.043h-132.48v422.957h132.507v-222.026c0-123.45 160.773-133.549 160.773 0v222.026h133.013v-267.811c0-208.306-237.92-200.719-293.813-98.179v-56.967z"}))),(0,c.h)("a",{className:"share-btn email-share-btn"},(0,c.h)("svg",{style:"width:32px;height:32px",viewBox:"0 0 1024 1024"},(0,c.h)("path",{fill:"#fff",d:"M256 768c-35.346 0-64-28.654-64-64v-352c0-35.346 28.654-64 64-64h512c35.346 0 64 28.654 64 64v352c0 35.346-28.654 64-64 64h-512zM512 467.488l147.52-115.488h-295.040l147.52 115.488zM748.48 352l-211.2 179.2c-0.713 1.308-1.572 2.532-2.56 3.648-12.707 12.158-32.733 12.158-45.44 0-0.988-1.116-1.847-2.34-2.56-3.648l-211.2-179.2h-19.52v352h512v-352h-19.52z"}))),(0,c.h)("a",{className:"share-btn embed-share-btn"},(0,c.h)("svg",{style:"width:32px;height:32px",viewBox:"0 0 1024 1024"},(0,c.h)("path",{fill:"#fff",d:"M377.989 579.335c12.669 12.904 12.669 33.777 0 46.68-12.733 12.969-33.427 12.969-46.16 0l-104.727-106.667c-12.669-12.904-12.669-33.777 0-46.68l104.727-106.667c12.733-12.969 33.427-12.969 46.16 0 12.669 12.904 12.669 33.777 0 46.68l-81.812 83.327 81.812 83.327zM646.011 412.68c-12.669-12.904-12.669-33.777 0-46.68 12.733-12.969 33.427-12.969 46.16 0l104.727 106.667c12.669 12.904 12.669 33.777 0 46.68l-104.727 106.667c-12.733 12.969-33.427 12.969-46.16 0-12.669-12.904-12.669-33.777 0-46.68l81.812-83.327-81.812-83.327zM572.293 250.6c17.455 4.445 28.025 22.388 23.686 40.066l-104.727 426.669c-4.349 17.719-22.048 28.535-39.545 24.079-17.455-4.445-28.025-22.388-23.686-40.066l104.727-426.669c4.349-17.719 22.048-28.535 39.545-24.079z"})))),(0,c.h)("div",null,(0,c.h)("div",{className:"form-group has-icon",style:"width: 300px;"},(0,c.h)("input",{type:"text",placeholder:"Share URL",className:"form-control",value:"https://cdnapisec.kaltura.com/index.php?assetId=123456",readOnly:!0}),(0,c.h)("svg",{className:"icon",style:"width:32px;height:32px;",viewBox:"0 0 1024 1024"},(0,c.h)("path",{d:"M355.028 445.537c12.497 12.497 12.497 32.758 0 45.255s-32.758 12.497-45.255 0l-24.141-24.141c-49.92-49.92-49.832-130.999 0.094-180.925 49.984-49.984 130.995-50.025 180.955-0.064l113.266 113.266c49.964 49.964 49.935 130.955-0.064 180.955-12.497 12.497-32.758 12.497-45.255 0s-12.497-32.758 0-45.255c25.013-25.013 25.027-65.482 0.064-90.445l-113.266-113.266c-24.957-24.957-65.445-24.936-90.445 0.064-24.955 24.955-24.998 65.511-0.094 90.416l24.141 24.141zM668.972 578.463c-12.497-12.497-12.497-32.758 0-45.255s32.758-12.497 45.255 0l24.141 24.141c49.92 49.92 49.832 130.999-0.094 180.925-49.984 49.984-130.995 50.025-180.955 0.064l-113.266-113.266c-49.964-49.964-49.935-130.955 0.064-180.955 12.497-12.497 32.758-12.497 45.255 0s12.497 32.758 0 45.255c-25.013 25.013-25.027 65.482-0.064 90.445l113.266 113.266c24.957 24.957 65.445 24.936 90.445-0.064 24.955-24.955 24.998-65.511 0.094-90.416l-24.141-24.141z"})))),(0,c.h)("a",null,(0,c.h)(f.Text,{id:"share.link_options"}))):""}}]),t}(g.default))||u;t.default=_},function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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 s,u,l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=n(1),d=n(3),h=n(11),p=n(2),v=r(p),g=n(27),y=r(g),m=function(e){return{open:e.cvaa.overlayOpen}},b=(s=(0,f.connect)(m,(0,d.bindActions)(h.actions)))(u=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"CVAAOverlay"}))}return o(t,e),l(t,[{key:"render",value:function(e){return e.open?(0,c.h)(y.default,{open:e.open,onClose:function(){return e.toggleCVAAOverlay(!1)},type:"cvaa"},(0,c.h)("div",{className:"title"},"Advanced captions settings"),(0,c.h)("div",null,(0,c.h)("div",{className:"sample"},"Sample"),(0,c.h)("div",{className:"sample black-bg"},"Sample"),(0,c.h)("div",{className:"sample yellow-text"},"Sample")),(0,c.h)("a",{className:"button-save-cvaa"},"Set custom caption")):""}}]),t}(v.default))||u;t.default=b},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(2),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:"Keyboard",player:e.player}));return document.body.onkeydown=function(e){var t=void 0,r=void 0;switch(e.which){case 32:n.logger.debug("Keydown space"),n.player.paused?n.player.play():n.player.pause();break;case 38:n.logger.debug("Keydown up"),r=Math.round(100*n.player.volume)+5,n.logger.debug("Changing volume. "+n.player.volume+" => "+r),n.player.muted&&(n.player.muted=!1),n.player.volume=r/100;break;case 40:if(n.logger.debug("Keydown down"),(r=Math.round(100*n.player.volume)-5)<5)return void(n.player.muted=!0);n.logger.debug("Changing volume. "+n.player.volume+" => "+r),n.player.volume=r/100;break;case 37:n.logger.debug("Keydown left"),t=n.player.currentTime-5>0?n.player.currentTime-5:0,n.player.currentTime=t;break;case 39:n.logger.debug("Keydown right"),t=n.player.currentTime+5>n.player.duration?n.player.duration:n.player.currentTime+5,n.player.currentTime=t;break;default:return}},n.disableKeyboardCommandsOnControls(),n}return a(t,e),o(t,[{key:"disableKeyboardCommandsOnControls",value:function(){Array.from(document.getElementsByClassName("control-button")).forEach(function(e){e.onkeydown=function(e){return e.preventDefault()}})}}]),t}(u.default);t.default=l}])})},function(e,t,n){var r=n(5);"string"==typeof r&&(r=[[e.i,r,""]]);var i={};i.transform=void 0;n(7)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){t=e.exports=n(6)(void 0),t.push([e.i,".row{display:block}.row:after{content:'';clear:both;display:block}.form-group{margin:10px auto;position:relative;max-width:100%}.form-group.has-error .form-control{border-color:#db1f26}.form-group.has-error .form-control:focus{border-color:#fff}.form-group.has-icon .form-control{padding-left:34px}.form-group .icon{position:absolute;top:2px;left:2px;fill:rgba(255,255,255,0.4)}.form-control{height:36px;width:100%;min-width:72px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(0,0,0,0.4);font-size:15px;line-height:18px;color:#fff;padding:8px 10px;text-overflow:ellipsis}.form-control::-webkit-input-placeholder{color:rgba(255,255,255,0.6)}.form-control:focus{background-color:#fff;border-color:#fff;color:#333}.form-control:focus::-webkit-input-placeholder{color:#ccc}.form-control:focus+.icon{fill:#999}textarea.form-control{min-height:72px}@-webkit-keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.dropdown{position:relative}.dropdown.active .dropdown-menu{display:block;opacity:1}.dropdown.top .dropdown-menu{margin-bottom:10px;bottom:100%}.dropdown.bottom .dropdown-menu{margin-top:10px;top:100%}.dropdown.right .dropdown-menu{left:0}.dropdown.left .dropdown-menu{right:0}.dropdown .dropdown-button{font-size:15px;font-weight:bold;line-height:18px;color:#fff;cursor:pointer}.dropdown .dropdown-menu{display:block;opacity:1;position:absolute;background-color:#333333;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;padding:6px 0;z-index:5;-webkit-animation:openDropmenu 100ms ease-out forwards;animation:openDropmenu 100ms ease-out forwards;max-height:173px;overflow-y:auto}.dropdown .dropdown-menu .dropdown-menu-item{padding:2px 10px 2px 16px;white-space:nowrap;min-height:30px;cursor:pointer}.dropdown .dropdown-menu .dropdown-menu-item:hover{color:#fff}.dropdown .dropdown-menu .dropdown-menu-item.active{color:#01ACCD;fill:#01ACCD}.dropdown .dropdown-menu .dropdown-menu-item .check-icon{display:inline-block;margin-left:16px;vertical-align:middle;width:24px;height:24px}.dropdown .dropdown-menu .dropdown-menu-item span{vertical-align:middle;line-height:26px}.tooltip{display:inline-block;height:22px;border-radius:4px;background-color:#FFFFFF;padding:3px 13px;color:#333333;font-size:13px;font-weight:bold;line-height:16px;box-shadow:0 0 8px 0 rgba(0,0,0,0.3)}.player .control-button{width:32px;height:32px;background:transparent;display:inline-block;opacity:0.8;border:none;padding:0;cursor:pointer;fill:#fff}.player .control-button svg{width:32px;height:32px}.player .control-button:hover,.player .control-button.active{opacity:1}.player .control-button.control-button-rounded{width:36px;height:36px;padding:2px}.player .control-button.control-button-rounded:hover{background-color:rgba(0,0,0,0.4);border-radius:18px}.player .control-button-container{display:inline-block;position:relative;vertical-align:top}a{color:#01ACCD;text-decoration:underline;font-size:15px;line-height:18px}a:hover{color:#01819a}a:active{opacity:0.7}.player{position:relative;max-width:854px;width:100%;background-color:#000;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.player:-webkit-full-screen{width:100%;height:100%;max-width:none}.player *{box-sizing:border-box;outline:none}.player ::-moz-selection{background-color:rgba(0,0,0,0.1)}.player ::selection{background-color:rgba(0,0,0,0.1)}.player video{width:100%}.player .player-gui{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;overflow:hidden;font-size:0;font-family:\"Lato\",sans-serif}.player .player-gui input,.player .player-gui textarea{font-family:\"Lato\",sans-serif}.player.metadata-loaded .player-gui,.player.state-paused .player-gui,.player.overlay-active .player-gui,.player.menu-active .player-gui{opacity:1}video::-webkit-media-controls{display:none !important}video::-webkit-media-controls-start-playback-button{display:none !important;-webkit-appearance:none}video::cue{background-color:transparent}.player.captions-yellow-text video::cue{color:#FAFF00}.player.captions-black-bg video::cue{background-color:#000}@-webkit-keyframes openOverlay{from{opacity:0}to{opacity:1}}@keyframes openOverlay{from{opacity:0}to{opacity:1}}.overlay{position:absolute;display:none;opacity:0;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.42);z-index:4;text-align:center;color:#fff;padding:80px 20px 0;-webkit-animation:openOverlay 100ms ease-in-out forwards;animation:openOverlay 100ms ease-in-out forwards}.overlay.active{display:block;opacity:1}.overlay .title{font-size:24px;font-weight:bold;line-height:29px;margin-bottom:60px}.overlay .close-overlay{position:absolute;top:48px;right:48px;z-index:5;fill:#fff;cursor:pointer}.overlay .close-overlay .icon-close{width:24px;height:24px}@media screen and (max-width: 768px){.overlay{padding:36px 20px 0}.overlay .close-overlay{top:38px}.overlay .title{margin-bottom:24px}}@media screen and (max-width: 480px){.overlay{padding:16px 24px 0}.overlay .close-overlay{top:15px;right:24px}.overlay .title{font-size:16px;line-height:19px;margin-bottom:36px}}@-webkit-keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.smart-container{background-color:#222222;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;position:absolute;right:0px;min-width:193px;font-size:15px;z-index:5;display:block;-webkit-animation:openSmartContainer 100ms ease-out forwards;animation:openSmartContainer 100ms ease-out forwards}.smart-container.top{bottom:100%;margin-bottom:6px}.smart-container.top:before{display:block;content:' ';position:absolute;bottom:-6px;left:0;width:100%;height:6px}.smart-container.bottom{top:100%;margin-top:6px}.smart-container.right{left:0px}.smart-container.left{right:0px}.smart-container .smart-container-item{margin:16px;color:rgba(244,244,244,0.8);white-space:nowrap}.smart-container .smart-container-item:after{display:block;content:' ';clear:both}.smart-container .smart-container-item.select-menu-item label{float:left}.smart-container .smart-container-item.select-menu-item .dropdown{float:right}.overlay.share-overlay .share-icons{margin:60px 0}.overlay.share-overlay .share-btn{height:36px;width:36px;border-radius:18px;background-color:rgba(0,0,0,0.4);display:inline-block;margin:0 8px;-webkit-transition:-webkit-transform 100ms;transition:transform 100ms;will-change:transform;padding:2px}.overlay.share-overlay .share-btn:hover{-webkit-transform:scale(1.1667);-ms-transform:scale(1.1667);transform:scale(1.1667)}.overlay.share-overlay .share-btn.facebook-share-btn{background-color:#3B5998}.overlay.share-overlay .share-btn.twitter-share-btn{background-color:#1DA1F2}.overlay.share-overlay .share-btn.google-plus-share-btn{background-color:#DD4B39}.overlay.share-overlay .share-btn.linkedin-share-btn{background-color:#00A0DC}@media screen and (max-width: 768px){.overlay.share-overlay .share-icons{margin:40px 0}}@media screen and (max-width: 480px){.overlay.share-overlay .share-icons{margin:20px 0}}.overlay.cvaa-overlay .sample{border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:36px;text-align:center;padding:0 31px;display:inline-block;margin:0 12px;cursor:pointer}.overlay.cvaa-overlay .sample.black-bg{background-color:#000}.overlay.cvaa-overlay .sample.yellow-text{color:#FAFF00}.overlay.cvaa-overlay .button-save-cvaa{margin-top:50px;height:40px;width:400px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:38px;text-align:center;display:inline-block;color:#fff;text-decoration:none;cursor:pointer}@-webkit-keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}@keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}.loading-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.3);-webkit-transition:100ms opacity;transition:100ms opacity;opacity:0}.loading-backdrop.show{opacity:1}.loading-backdrop.show .spinner-container{display:block}.loading-backdrop .spinner-container{display:none;position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50px, -50px, 0);transform:translate3d(-50px, -50px, 0)}.spinner{width:100px;height:100px;position:relative;-webkit-animation:kaltura-spinner 2.5s infinite;animation:kaltura-spinner 2.5s infinite}.spinner span{width:8px;height:8px;background-color:#fff;display:block;border-radius:8px;position:absolute;top:50%;left:50%;margin-top:-4px;margin-left:-4px}.spinner span:nth-child(1){-webkit-transform:rotate(45deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(45deg) translateX(-25px) translateY(-25px);transform:rotate(45deg) translateX(-25px) translateY(-25px);background-color:#da1f26}.spinner span:nth-child(2){-webkit-transform:rotate(90deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(90deg) translateX(-25px) translateY(-25px);transform:rotate(90deg) translateX(-25px) translateY(-25px);background-color:#06a885}.spinner span:nth-child(3){-webkit-transform:rotate(135deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(135deg) translateX(-25px) translateY(-25px);transform:rotate(135deg) translateX(-25px) translateY(-25px);background-color:#009344}.spinner span:nth-child(4){-webkit-transform:rotate(180deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(180deg) translateX(-25px) translateY(-25px);transform:rotate(180deg) translateX(-25px) translateY(-25px);background-color:#f8a61a}.spinner span:nth-child(5){-webkit-transform:rotate(225deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(225deg) translateX(-25px) translateY(-25px);transform:rotate(225deg) translateX(-25px) translateY(-25px);background-color:#1b4a97}.spinner span:nth-child(6){-webkit-transform:rotate(270deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(270deg) translateX(-25px) translateY(-25px);transform:rotate(270deg) translateX(-25px) translateY(-25px);background-color:#00abcc}.spinner span:nth-child(7){-webkit-transform:rotate(315deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(315deg) translateX(-25px) translateY(-25px);transform:rotate(315deg) translateX(-25px) translateY(-25px);background-color:#b1d238}.spinner span:nth-child(8){-webkit-transform:rotate(360deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(360deg) translateX(-25px) translateY(-25px);transform:rotate(360deg) translateX(-25px) translateY(-25px);background-color:#fcd203}.control-button-container.control-play-pause .control-button{-webkit-transition:400ms -webkit-transform;transition:400ms transform}.control-button-container.control-play-pause .control-button .icon-pause{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:0;display:none}.control-button-container.control-play-pause .control-button .icon-play{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}.control-button-container.control-play-pause .control-button.is-playing .icon-pause{opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing .icon-play{opacity:0;display:none}@media screen and (max-width: 480px){.control-button-container.control-play-pause{display:none}}.control-button-container.volume-control:hover .volume-control-bar{display:block !important}.control-button-container.volume-control.is-muted .volume-waves{opacity:0;-webkit-transform:translateX(-5px);-ms-transform:translateX(-5px);transform:translateX(-5px)}.control-button-container.volume-control.is-muted .volume-mute{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.volume-control.dragging-active .volume-control-bar{display:block}.control-button-container.volume-control .volume-waves{-webkit-transform:translateX(0px);-ms-transform:translateX(0px);transform:translateX(0px)}.control-button-container.volume-control .volume-mute{opacity:1;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.control-button-container.volume-control .volume-waves,.control-button-container.volume-control .volume-mute{-webkit-transition:300ms -webkit-transform, 300ms opacity;transition:300ms transform, 300ms opacity}.control-button-container.volume-control svg{position:absolute;top:0;left:0}.volume-control-bar{position:absolute;z-index:2;bottom:38px;left:0px;display:block;height:112px;width:34px;border-radius:4px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);background-color:#333333;padding:6px;display:none}.volume-control-bar:before{position:absolute;width:34px;height:14px;bottom:-8px;left:0;content:' ';display:block}.volume-control-bar .bar{background-color:#424242;height:100%;position:relative;cursor:ns-resize}.volume-control-bar .progress{position:absolute;bottom:0px;left:0px;width:100%;border-radius:0 0 2px 2px;background-color:#01ACCD}.control-button-container.control-fullscreen .control-button{-webkit-transition:100ms -webkit-transform;transition:100ms transform;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.control-fullscreen .control-button .icon-minimize{display:none}.control-button-container.control-fullscreen .control-button:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-maximize{display:none}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-minimize{display:block}.player .seek-bar{padding:6px 0;cursor:pointer}.player .seek-bar:hover .progress-bar .scrubber,.player .seek-bar.dragging-active .progress-bar .scrubber{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.player .seek-bar:hover .progress-bar .virtual-progress,.player .seek-bar.dragging-active .progress-bar .virtual-progress{display:block}.player .seek-bar .progress-bar{height:4px;background-color:rgba(255,255,255,0.3);border-radius:2px;position:relative}.player .seek-bar .progress-bar .progress{position:absolute;top:0;left:0;height:100%;z-index:2;border-radius:2px 0 0 2px;background-color:#01ACCD}.player .seek-bar .progress-bar .virtual-progress{display:none}.player .seek-bar .progress-bar .buffered,.player .seek-bar .progress-bar .virtual-progress{position:absolute;top:0;left:0;height:100%;z-index:1;border-radius:2px 0 0 2px;background-color:rgba(255,255,255,0.3)}.player .seek-bar .progress-bar .buffered .frame-preview-img,.player .seek-bar .progress-bar .virtual-progress .frame-preview-img{background-size:auto 100%;width:100%;height:100%;position:relative}.player .seek-bar .progress-bar .buffered .frame-preview,.player .seek-bar .progress-bar .virtual-progress .frame-preview{position:absolute;bottom:16px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:94px;width:164px;border:2px solid rgba(255,255,255,0.2);border-radius:4px}.player .seek-bar .progress-bar .buffered .time-preview,.player .seek-bar .progress-bar .virtual-progress .time-preview{position:absolute;bottom:22px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:22px;min-width:48px;padding:0 3px;text-align:center;border-radius:3px;background-color:rgba(0,0,0,0.7);font-size:13px;font-weight:bold;line-height:22px;color:#fff}.player .seek-bar .progress-bar .scrubber{position:absolute;z-index:3;cursor:pointer;display:block;top:-6px;right:-8px;border-radius:8px;height:16px;width:16px;background-color:#FFFFFF;box-shadow:0 0 31px 0 rgba(0,0,0,0.3);-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:100ms -webkit-transform;transition:100ms transform}.player .seek-bar .progress-bar .scrubber:active{opacity:1;cursor:-webkit-grabbing;cursor:grabbing}@media screen and (max-width: 480px){.virtual-progress{display:none}}.player .time-display{display:inline-block;line-height:32px;vertical-align:top;font-size:14px;padding:0 23px;font-weight:bold}@media screen and (max-width: 480px){.player .time-display{padding:0 12px 0 0}}.player .video-playing-title{font-size:15px;font-weight:bold;line-height:18px;padding:6px 0}.player .bottom-bar{position:absolute;bottom:0;left:0;width:100%;background:-webkit-linear-gradient(270deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:6px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .bottom-bar .left-controls{float:left;text-align:left}.player .bottom-bar .right-controls{float:right;text-align:left}.player .bottom-bar .right-controls .control-button-container{margin:0 6px}.player .bottom-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .bottom-bar,.player.hover .bottom-bar,.player.state-paused .bottom-bar,.player.menu-active .bottom-bar{opacity:1}.player.overlay-active .bottom-bar{opacity:0}@media screen and (max-width: 480px){.player .bottom-bar{padding:6px 8px}}.player .top-bar{position:absolute;top:0;left:0;width:100%;background:-webkit-linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(0deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:14px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .top-bar .left-controls{float:left;text-align:left}.player .top-bar .right-controls{float:right;text-align:left}.player .top-bar .right-controls .control-button-container{margin:0 6px}.player .top-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .top-bar,.player.hover .top-bar,.player.state-paused .top-bar,.player.menu-active .top-bar{opacity:1}.player.overlay-active .top-bar{opacity:0}@media screen and (max-width: 480px){.player .top-bar{padding:8px 8px 20px 8px}}@-webkit-keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}@keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}.overlay-play{position:absolute;top:0;left:0;width:100%;height:100%}.overlay-play.in .icon{-webkit-animation:overlayPlayIconIn 400ms linear forwards;animation:overlayPlayIconIn 400ms linear forwards}.overlay-play .icon{width:144px;height:144px;fill:#fff;position:absolute;top:50%;left:50%;margin:-72px 0 0 -72px;opacity:0}",""])},function(e,t){function n(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var a=r(i);return[n].concat(i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"})).concat([a]).join("\n")}return[n].join("\n")}function r(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var a=this[i][0];"number"==typeof a&&(r[a]=!0)}for(i=0;i<e.length;i++){var o=e[i];"number"==typeof o[0]&&r[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),t.push(o))}},t}},function(e,t,n){function r(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=p[r.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](r.parts[a]);for(;a<r.parts.length;a++)i.parts.push(c(r.parts[a],t))}else{for(var o=[],a=0;a<r.parts.length;a++)o.push(c(r.parts[a],t));p[r.id]={id:r.id,refs:1,parts:o}}}}function i(e,t){for(var n=[],r={},i=0;i<e.length;i++){var a=e[i],o=t.base?a[0]+t.base:a[0],s=a[1],u=a[2],l=a[3],c={css:s,media:u,sourceMap:l};r[o]?r[o].parts.push(c):n.push(r[o]={id:o,parts:[c]})}return n}function a(e,t){var n=g(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=b[b.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),b.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function o(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=b.indexOf(e);t>=0&&b.splice(t,1)}function s(e){var t=document.createElement("style");return e.attrs.type="text/css",l(t,e.attrs),a(e,t),t}function u(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",l(t,e.attrs),a(e,t),t}function l(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function c(e,t){var n,r,i,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var l=m++;n=y||(y=s(t)),r=f.bind(null,n,l,!1),i=f.bind(null,n,l,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=u(t),r=h.bind(null,n,t),i=function(){o(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=d.bind(null,n),i=function(){o(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}function f(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=E(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function d(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function h(e,t,n){var r=n.css,i=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||a)&&(r=_(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}var p={},v=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),g=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e.call(this,n)),t[n]}}(function(e){return document.querySelector(e)}),y=null,m=0,b=[],_=n(8);e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},t.attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=v()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=i(e,t);return r(n,t),function(e){for(var a=[],o=0;o<n.length;o++){var s=n[o],u=p[s.id];u.refs--,a.push(u)}if(e){r(i(e,t),t)}for(var o=0;o<a.length;o++){var u=a[o];if(0===u.refs){for(var l=0;l<u.parts.length;l++)u.parts[l]();delete p[u.id]}}}};var E=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i))return e;var a;return a=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(a)+")"})}},function(e,t,n){!function(t,r){e.exports=r(n(10),n(0))}(0,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var o=i.get;if(void 0!==o)return o.call(r)},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),l=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(2),f=function(e){function t(e,n,a){r(this,t),t._logger.debug("Creating adapter. Hls version: "+l.default.version);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,a));return o._hls=new l.default(o._config),o._addBindings(),o}return a(t,e),s(t,null,[{key:"canPlayType",value:function(e){var n="string"==typeof e&&t._hlsMimeTypes.includes(e.toLowerCase());return t._logger.debug("canPlayType result for mimeType:"+e+" is "+n.toString()),n}},{key:"isSupported",value:function(){var e=l.default.isSupported();return t._logger.debug("isSupported:"+e),e}}]),s(t,[{key:"_addBindings",value:function(){this._hls.on(l.default.Events.ERROR,this._onError.bind(this)),this._hls.on(l.default.Events.LEVEL_SWITCHED,this._onLevelSwitched.bind(this)),this._hls.on(l.default.Events.AUDIO_TRACK_SWITCHED,this._onAudioTrackSwitched.bind(this))}},{key:"load",value:function(){var e=this;return this._loadPromise||(this._loadPromise=new Promise(function(n){e._hls.on(l.default.Events.MANIFEST_LOADED,function(r,i){t._logger.debug("The source has been loaded successfully"),e._playerTracks=e._parseTracks(i),n({tracks:e._playerTracks})}),e._sourceObj&&e._sourceObj.url&&(e._hls.loadSource(e._sourceObj.url),e._hls.attachMedia(e._videoElement))})),this._loadPromise}},{key:"destroy",value:function(){t._logger.debug("destroy"),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),this._loadPromise=null,this._removeBindings(),this._hls.detachMedia(),this._hls.destroy()}},{key:"_parseTracks",value:function(e){var t=this._parseAudioTracks(e.audioTracks||[]),n=this._parseVideoTracks(e.levels||[]),r=this._parseTextTracks(this._videoElement.textTracks||[]);return t.concat(n).concat(r)}},{key:"_parseAudioTracks",value:function(e){for(var t=[],n=0;n<e.length;n++){var r={id:e[n].id,active:this._hls.audioTrack===e[n].id,label:e[n].name,language:e[n].lang,index:n};t.push(new c.AudioTrack(r))}return t}},{key:"_parseVideoTracks",value:function(e){for(var t=[],n=0;n<e.length;n++){var r={active:this._hls.startLevel===n,label:e[n].name,bandwidth:e[n].bitrate,language:"",index:n};t.push(new c.VideoTrack(r))}return t}},{key:"_parseTextTracks",value:function(e){for(var t=[],n=0;n<e.length;n++){var r={active:"showing"===e[n].mode,label:e[n].label,kind:e[n].kind,language:e[n].language,index:n};t.push(new c.TextTrack(r))}return t}},{key:"selectAudioTrack",value:function(e){e instanceof c.AudioTrack&&!e.active&&this._hls.audioTracks&&(this._hls.audioTrack=e.id)}},{key:"selectVideoTrack",value:function(e){e instanceof c.VideoTrack&&(!e.active||this._hls.autoLevelEnabled)&&this._hls.levels&&(this._hls.nextLevel=e.index)}},{key:"selectTextTrack",value:function(e){e instanceof c.TextTrack&&!e.active&&this._videoElement.textTracks&&(this._disableAllTextTracks(),this._videoElement.textTracks[e.index].mode="showing",t._logger.debug("Text track changed",e),this._onTrackChanged(e))}},{key:"hideTextTrack",value:function(){this._disableAllTextTracks()}},{key:"enableAdaptiveBitrate",value:function(){this._hls.nextLevel=-1}},{key:"_onLevelSwitched",value:function(e,n){var r=this._playerTracks.find(function(e){return e instanceof c.VideoTrack&&e.index===n.level});t._logger.debug("Video track changed",r),this._onTrackChanged(r)}},{key:"_onAudioTrackSwitched",value:function(e,n){var r=this._playerTracks.find(function(e){return e instanceof c.AudioTrack&&e.id===n.id});t._logger.debug("Audio track changed",r),this._onTrackChanged(r)}},{key:"_disableAllTextTracks",value:function(){for(var e=this._videoElement.textTracks,t=0;t<e.length;t++)e[t].mode="hidden"}},{key:"_onError",value:function(e,n){var r=n.type,i=n.details;if(n.fatal)switch(r){case l.default.ErrorTypes.NETWORK_ERROR:t._logger.error("fatal network error encountered, try to recover"),this._hls.startLoad();break;case l.default.ErrorTypes.MEDIA_ERROR:t._logger.error("fatal media error encountered, try to recover"),this._hls.recoverMediaError();break;default:t._logger.error("fatal error, cannot recover"),this.destroy()}else switch(i){case l.default.ErrorDetails.MANIFEST_LOAD_ERROR:case l.default.ErrorDetails.MANIFEST_LOAD_TIMEOUT:case l.default.ErrorDetails.MANIFEST_PARSING_ERROR:case l.default.ErrorDetails.LEVEL_LOAD_ERROR:case l.default.ErrorDetails.LEVEL_LOAD_TIMEOUT:case l.default.ErrorDetails.LEVEL_SWITCH_ERROR:case l.default.ErrorDetails.FRAG_LOAD_ERROR:case l.default.ErrorDetails.FRAG_LOOP_LOADING_ERROR:case l.default.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.default.ErrorDetails.FRAG_PARSING_ERROR:case l.default.ErrorDetails.BUFFER_APPEND_ERROR:case l.default.ErrorDetails.BUFFER_APPENDING_ERROR:t._logger.error(r,i)}}},{key:"_removeBindings",value:function(){this._hls.off(l.default.Events.ERROR,this._onError),this._hls.off(l.default.Events.LEVEL_SWITCHED,this._onLevelSwitched),this._hls.off(l.default.Events.AUDIO_TRACK_SWITCHED,this._onAudioTrackSwitched)}},{key:"src",get:function(){return this._loadPromise&&this._sourceObj?this._sourceObj.url:""}}]),t}(c.BaseMediaSourceAdapter);f.id="HlsAdapter",f._logger=c.BaseMediaSourceAdapter.getLogger(f.id),f._hlsMimeTypes=["application/x-mpegurl","application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"],t.default=f,f.isSupported()&&(0,c.registerMediaSourceAdapter)(f)},function(t,n){t.exports=e},function(e,n){e.exports=t}])})},function(e,t,n){var r,r;!function(t){e.exports=t()}(function(){var e;return function e(t,n,i){function a(s,u){if(!n[s]){if(!t[s]){var l="function"==typeof r&&r;if(!u&&l)return r(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[s]={exports:{}};t[s][0].call(f.exports,function(e){var n=t[s][1][e];return a(n||e)},f,f.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof r&&r,s=0;s<i.length;s++)a(i[s]);return a}({1:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function a(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function s(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,a,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],s(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(o(n))for(a=Array.prototype.slice.call(arguments,1),l=n.slice(),r=l.length,u=0;u<r;u++)l[u].apply(this,a);return!0},r.prototype.addListener=function(e,t){var n;if(!i(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(n=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,a,s;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){r=s;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],2:[function(t,n,r){!function(t){var i=/^((?:[^\/;?#]+:)?)(\/\/[^\/\;?#]*)?(.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,a=/^([^\/;?#]*)(.*)$/,o=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,u={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");return r.path=u.normalizePath(r.path),u.buildURLFromParts(r)}var i=this.parseURL(t);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return n.alwaysNormalize?(i.path=u.normalizePath(i.path),u.buildURLFromParts(i)):t;var o=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var s=a.exec(o.path);o.netLoc=s[1],o.path=s[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(l.netLoc=o.netLoc,"/"!==i.path[0]))if(i.path){var c=o.path,f=c.substring(0,c.lastIndexOf("/")+1)+i.path;l.path=u.normalizePath(f)}else l.path=o.path,i.params||(l.params=o.params,i.query||(l.query=o.query));return null===l.path&&(l.path=n.alwaysNormalize?u.normalizePath(i.path):i.path),u.buildURLFromParts(l)},parseURL:function(e){var t=i.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(o,"");e.length!==(e=e.replace(s,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};"object"==typeof r&&"object"==typeof n?n.exports=u:"function"==typeof e&&e.amd?e([],function(){return u}):"object"==typeof r?r.URLToolkit=u:t.URLToolkit=u}(this)},{}],3:[function(e,t,n){var r=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;t.exports=function(e,t){function n(e){g[e]=!0;for(var t in i[e][1]){var r=i[e][1][t];g[r]||n(r)}}for(var s,u=Object.keys(a),l=0,c=u.length;l<c;l++){var f=u[l],d=a[f].exports;if(d===e||d&&d.default===e){s=f;break}}if(!s){s=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var h={},l=0,c=u.length;l<c;l++){var f=u[l];h[f]=f}i[s]=[Function(["require","module","exports"],"("+e+")(self)"),h]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),v={};v[s]=s,i[p]=[Function(["require"],"var f = require("+o(s)+");(f.default ? f.default : f)(self);"),v];var g={};n(p);var y="("+r+")({"+Object.keys(g).map(function(e){return o(e)+":["+i[e][0]+","+o(i[e][1])+"]"}).join(",")+"},{},["+o(p)+"])",m=window.URL||window.webkitURL||window.mozURL||window.msURL,b=new Blob([y],{type:"text/javascript"});if(t&&t.bare)return b;var _=m.createObjectURL(b),E=new Worker(_);return E.objectURL=_,E}},{}],4:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.hlsDefaultConfig=void 0;var i=e(5),a=r(i),o=e(8),s=r(o),u=e(9),l=r(u),c=e(10),f=r(c),d=e(59),h=r(d),p=e(7),v=r(p),g=e(6),y=r(g),m=e(50),b=r(m),_=e(16),E=r(_),T=e(15),w=r(T),k=e(14),S=r(k);n.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:l.default,fpsController:f.default,audioStreamController:y.default,audioTrackController:v.default,subtitleStreamController:S.default,subtitleTrackController:w.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,59:59,6:6,7:7,8:8,9:9}],5:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(37),h=r(d),p=e(33),v=e(54),g=e(52),y=r(g),m=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.FRAG_LOADING,l.default.FRAG_LOADED,l.default.FRAG_BUFFERED,l.default.ERROR));return n.lastLoadedFragLevel=0,n._nextAutoLevel=-1,n.hls=e,n.timer=null,n._bwEstimator=null,n.onCheck=n._abandonRulesCheck.bind(n),n}return o(t,e),s(t,[{key:"destroy",value:function(){this.clearTimer(),f.default.prototype.destroy.call(this)}},{key:"onFragLoading",value:function(e){var t=e.frag;if("main"===t.type){if(this.timer||(this.timer=setInterval(this.onCheck,100)),!this._bwEstimator){var n=this.hls,r=e.frag.level,i=n.levels[r].details.live,a=n.config,o=void 0,s=void 0;i?(o=a.abrEwmaFastLive,s=a.abrEwmaSlowLive):(o=a.abrEwmaFastVoD,s=a.abrEwmaSlowVoD),this._bwEstimator=new y.default(n,s,o,a.abrEwmaDefaultEstimate)}this.fragCurrent=t}}},{key:"_abandonRulesCheck",value:function(){var e=this.hls,t=e.media,n=this.fragCurrent,r=n.loader,i=e.minAutoLevel;if(!r||r.stats&&r.stats.aborted)return v.logger.warn("frag loader destroy or aborted, disarm abandonRules"),void this.clearTimer();var a=r.stats;if(t&&(!t.paused&&0!==t.playbackRate||!t.readyState)&&n.autoLevel&&n.level){var o=performance.now()-a.trequest,s=Math.abs(t.playbackRate);if(o>500*n.duration/s){var u=e.levels,c=Math.max(1,a.bw?a.bw/8:1e3*a.loaded/o),f=u[n.level],d=f.realBitrate?Math.max(f.realBitrate,f.bitrate):f.bitrate,p=a.total?a.total:Math.max(a.loaded,Math.round(n.duration*d/8)),g=t.currentTime,y=(p-a.loaded)/c,m=(h.default.bufferInfo(t,g,e.config.maxBufferHole).end-g)/s;if(m<2*n.duration/s&&y>m){var b=void 0,_=void 0;for(_=n.level-1;_>i;_--){var E=u[_].realBitrate?Math.max(u[_].realBitrate,u[_].bitrate):u[_].bitrate;if((b=n.duration*E/(6.4*c))<m)break}b<y&&(v.logger.warn("loading too slow, abort fragment loading and switch to level "+_+":fragLoadedDelay["+_+"]<fragLoadedDelay["+(n.level-1)+"];bufferStarvationDelay:"+b.toFixed(1)+"<"+y.toFixed(1)+":"+m.toFixed(1)),e.nextLoadLevel=_,this._bwEstimator.sample(o,a.loaded),r.abort(),this.clearTimer(),e.trigger(l.default.FRAG_LOAD_EMERGENCY_ABORTED,{frag:n,stats:a}))}}}}},{key:"onFragLoaded",value:function(e){var t=e.frag;if("main"===t.type&&!isNaN(t.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var n=this.hls.levels[t.level],r=(n.loaded?n.loaded.bytes:0)+e.stats.loaded,i=(n.loaded?n.loaded.duration:0)+e.frag.duration;n.loaded={bytes:r,duration:i},n.realBitrate=Math.round(8*r/i)}if(e.frag.bitrateTest){var a=e.stats;a.tparsed=a.tbuffered=a.tload,this.onFragBuffered(e)}}}},{key:"onFragBuffered",value:function(e){var t=e.stats,n=e.frag;if(!(!0===t.aborted||1!==n.loadCounter||"main"!==n.type||isNaN(n.sn)||n.bitrateTest&&t.tload!==t.tbuffered)){var r=t.tparsed-t.trequest;v.logger.log("latency/loading/parsing/append/kbps:"+Math.round(t.tfirst-t.trequest)+"/"+Math.round(t.tload-t.tfirst)+"/"+Math.round(t.tparsed-t.tload)+"/"+Math.round(t.tbuffered-t.tparsed)+"/"+Math.round(8*t.loaded/(t.tbuffered-t.trequest))),this._bwEstimator.sample(r,t.loaded),t.bwEstimate=this._bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=r/1e3:this.bitrateTestDelay=0}}},{key:"onError",value:function(e){switch(e.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}}},{key:"clearTimer",value:function(){clearInterval(this.timer),this.timer=null}},{key:"_findBestLevel",value:function(e,t,n,r,i,a,o,s,u){for(var l=i;l>=r;l--){var c=u[l],f=c.details,d=f?f.totalduration/f.fragments.length:t,h=!!f&&f.live,p=void 0;p=l<=e?o*n:s*n;var g=u[l].realBitrate?Math.max(u[l].realBitrate,u[l].bitrate):u[l].bitrate,y=g*d/p;if(v.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+l+"/"+Math.round(p)+"/"+g+"/"+d+"/"+a+"/"+y),p>g&&(!y||h&&!this.bitrateTestDelay||y<a))return l}return-1}},{key:"nextAutoLevel",get:function(){var e=this._nextAutoLevel,t=this._bwEstimator;if(!(-1===e||t&&t.canEstimate()))return e;var n=this._nextABRAutoLevel;return-1!==e&&(n=Math.min(e,n)),n},set:function(e){this._nextAutoLevel=e}},{key:"_nextABRAutoLevel",get:function(){var e=this.hls,t=e.maxAutoLevel,n=e.levels,r=e.config,i=e.minAutoLevel,a=e.media,o=this.lastLoadedFragLevel,s=this.fragCurrent?this.fragCurrent.duration:0,u=a?a.currentTime:0,l=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,c=this._bwEstimator?this._bwEstimator.getEstimate():r.abrEwmaDefaultEstimate,f=(h.default.bufferInfo(a,u,r.maxBufferHole).end-u)/l,d=this._findBestLevel(o,s,c,i,t,f,r.abrBandWidthFactor,r.abrBandWidthUpFactor,n);if(d>=0)return d;v.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,g=r.abrBandWidthFactor,y=r.abrBandWidthUpFactor;if(0===f){var m=this.bitrateTestDelay;if(m){p=(s?Math.min(s,r.maxLoadingDelay):r.maxLoadingDelay)-m,v.logger.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*p)+" ms"),g=y=1}}return d=this._findBestLevel(o,s,c,i,t,f+p,g,y,n),Math.max(d,0)}}]),t}(f.default);n.default=m},{33:33,34:34,35:35,37:37,52:52,54:54}],6:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(48),l=r(u),c=e(37),f=r(c),d=e(25),h=r(d),p=e(35),v=r(p),g=e(34),y=r(g),m=e(38),b=r(m),_=e(55),E=r(_),T=e(33),w=e(54),k=e(51),S={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"},A=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,v.default.MEDIA_ATTACHED,v.default.MEDIA_DETACHING,v.default.AUDIO_TRACKS_UPDATED,v.default.AUDIO_TRACK_SWITCHING,v.default.AUDIO_TRACK_LOADED,v.default.KEY_LOADED,v.default.FRAG_LOADED,v.default.FRAG_PARSING_INIT_SEGMENT,v.default.FRAG_PARSING_DATA,v.default.FRAG_PARSED,v.default.ERROR,v.default.BUFFER_CREATED,v.default.BUFFER_APPENDED,v.default.BUFFER_FLUSHED,v.default.INIT_PTS_FOUND));return n.config=e.config,n.audioCodecSwap=!1,n.ticks=0,n._state=S.STOPPED,n.ontick=n.tick.bind(n),n.initPTS=[],n.waitingFragment=null,n.videoTrackCC=null,n}return o(t,e),s(t,[{key:"destroy",value:function(){this.stopLoad(),this.timer&&(clearInterval(this.timer),this.timer=null),y.default.prototype.destroy.call(this),this.state=S.STOPPED}},{key:"onInitPtsFound",value:function(e){var t=e.id,n=e.frag.cc,r=e.initPTS;"main"===t&&(this.initPTS[n]=r,this.videoTrackCC=n,w.logger.log("InitPTS for cc:"+n+" found from video track:"+r),this.state===S.WAITING_INIT_PTS&&this.tick())}},{key:"startLoad",value:function(e){if(this.tracks){var t=this.lastCurrentTime;this.stopLoad(),this.timer||(this.timer=setInterval(this.ontick,100)),this.fragLoadError=0,t>0&&-1===e?(w.logger.log("audio:override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=S.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:e,this.state=S.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=e,this.state=S.STOPPED}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=S.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 e,t,n,r=this.hls,i=r.config;switch(this.state){case S.ERROR:case S.PAUSED:case S.BUFFER_FLUSHING:break;case S.STARTING:this.state=S.WAITING_TRACK,this.loadedmetadata=!1;break;case S.IDLE:var a=this.tracks;if(!a)break;if(!this.media&&(this.startFragRequested||!i.startFragPrefetch))break;if(this.loadedmetadata)e=this.media.currentTime;else if(void 0===(e=this.nextLoadPosition))break;var o=this.mediaBuffer?this.mediaBuffer:this.media,s=f.default.bufferInfo(o,e,i.maxBufferHole),u=s.len,c=s.end,d=this.fragPrevious,h=i.maxMaxBufferLength,p=this.audioSwitch,g=this.trackId;if((u<h||p)&&g<a.length){if(void 0===(n=a[g].details)){this.state=S.WAITING_TRACK;break}if(!p&&!n.live&&d&&d.sn===n.endSN&&(!this.media.seeking||this.media.duration-c<d.duration/2)){this.hls.trigger(v.default.BUFFER_EOS,{type:"audio"}),this.state=S.ENDED;break}var y=n.fragments,m=y.length,b=y[0].start,_=y[m-1].start+y[m-1].duration,E=void 0;if(p)if(n.live&&!n.PTSKnown)w.logger.log("switching audiotrack, live stream, unknown PTS,load first fragment"),c=0;else if(c=e,n.PTSKnown&&e<b){if(!(s.end>b||s.nextStart))return;w.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=b+.05}if(n.initSegment&&!n.initSegment.data)E=n.initSegment;else if(c<=b){if(E=y[0],null!==this.videoTrackCC&&E.cc!==this.videoTrackCC&&(E=(0,k.findFragWithCC)(y,this.videoTrackCC)),n.live&&E.loadIdx&&E.loadIdx===this.fragLoadIdx){var A=s.nextStart?s.nextStart:b;return w.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(A+.05)),void(this.media.currentTime=A+.05)}}else{var O=void 0,P=i.maxFragLookUpTolerance,R=d?y[d.sn-y[0].sn+1]:void 0,D=function(e){var t=Math.min(P,e.duration);return e.start+e.duration-t<=c?1:e.start-t>c&&e.start?-1:0};c<_?(c>_-P&&(P=0),O=R&&!D(R)?R:l.default.search(y,D)):O=y[m-1],O&&(E=O,b=O.start,d&&E.level===d.level&&E.sn===d.sn&&(E.sn<n.endSN?(E=y[E.sn+1-n.startSN],w.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)w.logger.log("Loading key for "+E.sn+" of ["+n.startSN+" ,"+n.endSN+"],track "+g),this.state=S.KEY_LOADING,r.trigger(v.default.KEY_LOADING,{frag:E});else{if(w.logger.log("Loading "+E.sn+", cc: "+E.cc+" of ["+n.startSN+" ,"+n.endSN+"],track "+g+", currentTime:"+e+",bufferEnd:"+c.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,E.loadCounter){E.loadCounter++;var x=i.fragLoadingLoopThreshold;if(E.loadCounter>x&&Math.abs(this.fragLoadIdx-E.loadIdx)<x)return void r.trigger(v.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(v.default.FRAG_LOADING,{frag:E}),this.state=S.FRAG_LOADING}}break;case S.WAITING_TRACK:t=this.tracks[this.trackId],t&&t.details&&(this.state=S.IDLE);break;case S.FRAG_LOADING_WAITING_RETRY:var L=performance.now(),I=this.retryDate;o=this.media;var M=o&&o.seeking;(!I||L>=I||M)&&(w.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=S.IDLE);break;case S.WAITING_INIT_PTS:if(void 0===this.initPTS[this.videoTrackCC])break;var C=this.waitingFragment;if(C){var N=C.frag.cc;this.videoTrackCC!==N?(w.logger.warn("Waiting fragment CC ("+N+") does not match video track CC ("+this.videoTrackCC+")"),this.waitingFragment=null,this.state=S.IDLE):(this.state=S.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=S.IDLE;break;case S.STOPPED:case S.FRAG_LOADING:case S.PARSING:case S.PARSED:case S.ENDED:}}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("ended",this.onvended);var n=this.config;this.tracks&&n.autoStartLoad&&this.startLoad(n.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(w.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.tracks;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.loadCounter=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.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===S.ENDED&&(this.state=S.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(e){w.logger.log("audio tracks updated"),this.tracks=e.audioTracks}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url;this.trackId=e.id,this.fragCurrent=null,this.state=S.PAUSED,this.waitingFragment=null,t?this.timer||(this.timer=setInterval(this.ontick,100)):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),t&&(this.audioSwitch=!0,this.state=S.IDLE,void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold)),this.tick()}},{key:"onAudioTrackLoaded",value:function(e){var t=e.details,n=e.id,r=this.tracks[n],i=t.totalduration,a=0;if(w.logger.log("track "+n+" loaded ["+t.startSN+","+t.endSN+"],duration:"+i),t.live){var o=r.details;o&&t.fragments.length>0?(b.default.mergeDetails(o,t),a=t.fragments[0].start,t.PTSKnown?w.logger.log("live audio playlist sliding:"+a.toFixed(3)):w.logger.log("live audio playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,w.logger.log("live audio playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(r.details=t,!this.startFragRequested){if(-1===this.startPosition){var s=t.startTimeOffset;isNaN(s)?this.startPosition=0:(w.logger.log("start time offset found in playlist, adjust startPosition to "+s),this.startPosition=s)}this.nextLoadPosition=this.startPosition}this.state===S.WAITING_TRACK&&(this.state=S.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===S.KEY_LOADING&&(this.state=S.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,n=e.frag;if(this.state===S.FRAG_LOADING&&t&&"audio"===n.type&&n.level===t.level&&n.sn===t.sn){var r=this.tracks[this.trackId],i=r.details,a=i.totalduration,o=t.level,s=t.sn,u=t.cc,l=this.config.defaultAudioCodec||r.audioCodec||"mp4a.40.2",c=this.stats=e.stats;if("initSegment"===s)this.state=S.IDLE,c.tparsed=c.tbuffered=performance.now(),i.initSegment.data=e.payload,this.hls.trigger(v.default.FRAG_BUFFERED,{stats:c,frag:t,id:"audio"}),this.tick();else{this.state=S.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new h.default(this.hls,"audio"));var f=this.initPTS[u],d=i.initSegment?i.initSegment.data:[];if(i.initSegment||void 0!==f){this.pendingBuffering=!0,w.logger.log("Demuxing "+s+" of ["+i.startSN+" ,"+i.endSN+"],track "+o);this.demuxer.push(e.payload,d,l,null,t,a,!1,f)}else w.logger.log("unknown video PTS for continuity counter "+u+", waiting for video PTS before demuxing audio frag "+s+" of ["+i.startSN+" ,"+i.endSN+"],track "+o),this.waitingFragment=e,this.state=S.WAITING_INIT_PTS}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent,n=e.frag;if(t&&"audio"===e.id&&n.sn===t.sn&&n.level===t.level&&this.state===S.PARSING){var r=e.tracks,i=void 0;if(r.video&&delete r.video,i=r.audio){i.levelCodec=i.codec,i.id=e.id,this.hls.trigger(v.default.BUFFER_CODECS,r),w.logger.log("audio track:audio,container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var a=i.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(v.default.BUFFER_APPENDING,o))}this.tick()}}}},{key:"onFragParsingData",value:function(e){var t=this,n=this.fragCurrent,r=e.frag;if(n&&"audio"===e.id&&"audio"===e.type&&r.sn===n.sn&&r.level===n.level&&this.state===S.PARSING){var i=this.trackId,a=this.tracks[i],o=this.hls;isNaN(e.endPTS)&&(e.endPTS=e.startPTS+n.duration,e.endDTS=e.startDTS+n.duration),w.logger.log("parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb),b.default.updateFragPTSDTS(a.details,n,e.startPTS,e.endPTS);var s=this.audioSwitch,u=this.media,l=!1;if(s&&u)if(u.readyState){var c=u.currentTime;w.logger.log("switching audio track : currentTime:"+c),c>=e.startPTS&&(w.logger.log("switching audio track : flushing all audio"),this.state=S.BUFFER_FLUSHING,o.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),l=!0,this.audioSwitch=!1,o.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:i}))}else this.audioSwitch=!1,o.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:i});var f=this.pendingData;this.audioSwitch||([e.data1,e.data2].forEach(function(t){t&&t.length&&f.push({type:e.type,data:t,parent:"audio",content:"data"})}),!l&&f.length&&(f.forEach(function(e){t.state===S.PARSING&&(t.pendingBuffering=!0,t.hls.trigger(v.default.BUFFER_APPENDING,e))}),this.pendingData=[],this.appended=!0)),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent,n=e.frag;t&&"audio"===e.id&&n.sn===t.sn&&n.level===t.level&&this.state===S.PARSING&&(this.stats.tparsed=performance.now(),this.state=S.PARSED,this._checkAppendedParsed())}},{key:"onBufferCreated",value:function(e){var t=e.tracks.audio;t&&(this.mediaBuffer=t.buffer,this.loadedmetadata=!0)}},{key:"onBufferAppended",value:function(e){if("audio"===e.parent){var t=this.state;t!==S.PARSING&&t!==S.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==S.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent,t=this.stats,n=this.hls;if(e){this.fragPrevious=e,t.tbuffered=performance.now(),n.trigger(v.default.FRAG_BUFFERED,{stats:t,frag:e,id:"audio"});var r=this.mediaBuffer?this.mediaBuffer:this.media;w.logger.log("audio buffered : "+E.default.toString(r.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,n.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=S.IDLE}this.tick()}}},{key:"onError",value:function(e){var t=e.frag;if(!t||"audio"===t.type)switch(e.details){case T.ErrorDetails.FRAG_LOAD_ERROR:case T.ErrorDetails.FRAG_LOAD_TIMEOUT:if(!e.fatal){var n=this.fragLoadError;n?n++:n=1;var r=this.config;if(n<=r.fragLoadingMaxRetry){this.fragLoadError=n,t.loadCounter=0;var i=Math.min(Math.pow(2,n-1)*r.fragLoadingRetryDelay,r.fragLoadingMaxRetryTimeout);w.logger.warn("audioStreamController: frag loading failed, retry in "+i+" ms"),this.retryDate=performance.now()+i,this.state=S.FRAG_LOADING_WAITING_RETRY}else w.logger.error("audioStreamController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=S.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!==S.ERROR&&(this.state=e.fatal?S.ERROR:S.IDLE,w.logger.warn("audioStreamController: "+e.details+" while loading frag,switch to "+this.state+" state ..."));break;case T.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===e.parent&&(this.state===S.PARSING||this.state===S.PARSED)){var a=this.mediaBuffer,o=this.media.currentTime;if(a&&f.default.isBuffered(a,o)&&f.default.isBuffered(a,o+.5)){var s=this.config;s.maxMaxBufferLength>=s.maxBufferLength&&(s.maxMaxBufferLength/=2,w.logger.warn("audio:reduce max buffer length to "+s.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*s.fragLoadingLoopThreshold),this.state=S.IDLE}else w.logger.warn("buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=S.BUFFER_FLUSHING,this.hls.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}}}},{key:"onBufferFlushed",value:function(){var e=this,t=this.pendingData;t&&t.length?(w.logger.log("appending pending audio data on Buffer Flushed"),t.forEach(function(t){e.hls.trigger(v.default.BUFFER_APPENDING,t)}),this.appended=!0,this.pendingData=[],this.state=S.PARSED):(this.state=S.IDLE,this.fragPrevious=null,this.tick())}},{key:"state",set:function(e){if(this.state!==e){var t=this.state;this._state=e,w.logger.log("audio stream:"+t+"->"+e)}},get:function(){return this._state}}]),t}(y.default);n.default=A},{25:25,33:33,34:34,35:35,37:37,38:38,48:48,51:51,54:54,55:55}],7:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(54),h=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.MANIFEST_LOADING,l.default.MANIFEST_LOADED,l.default.AUDIO_TRACK_LOADED));return n.ticks=0,n.ontick=n.tick.bind(n),n}return o(t,e),s(t,[{key:"destroy",value:function(){f.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(e){var t=this,n=e.audioTracks||[],r=!1;this.tracks=n,this.hls.trigger(l.default.AUDIO_TRACKS_UPDATED,{audioTracks:n});var i=0;n.forEach(function(e){if(e.default)return t.audioTrack=i,void(r=!0);i++}),!1===r&&n.length&&(d.logger.log("no default audio track defined, use first audio track as default"),this.audioTrack=0)}},{key:"onAudioTrackLoaded",value:function(e){e.id<this.tracks.length&&(d.logger.log("audioTrack "+e.id+" loaded"),this.tracks[e.id].details=e.details,e.details.live&&!this.timer&&(this.timer=setInterval(this.ontick,1e3*e.details.targetduration)),!e.details.live&&this.timer&&(clearInterval(this.timer),this.timer=null))}},{key:"setAudioTrackInternal",value:function(e){if(e>=0&&e<this.tracks.length){this.timer&&(clearInterval(this.timer),this.timer=null),this.trackId=e,d.logger.log("switching to audioTrack "+e);var t=this.tracks[e],n=this.hls,r=t.type,i=t.url,a={id:e,type:r,url:i};n.trigger(l.default.AUDIO_TRACK_SWITCH,a),n.trigger(l.default.AUDIO_TRACK_SWITCHING,a);var o=t.details;!i||void 0!==o&&!0!==o.live||(d.logger.log("(re)loading playlist for audioTrack "+e),n.trigger(l.default.AUDIO_TRACK_LOADING,{url:i,id:e}))}}},{key:"updateTrack",value:function(e){if(e>=0&&e<this.tracks.length){this.timer&&(clearInterval(this.timer),this.timer=null),this.trackId=e,d.logger.log("updating audioTrack "+e);var t=this.tracks[e],n=t.url,r=t.details;!n||void 0!==r&&!0!==r.live||(d.logger.log("(re)loading playlist for audioTrack "+e),this.hls.trigger(l.default.AUDIO_TRACK_LOADING,{url:n,id:e}))}}},{key:"audioTracks",get:function(){return this.tracks}},{key:"audioTrack",get:function(){return this.trackId},set:function(e){this.trackId===e&&void 0!==this.tracks[e].details||this.setAudioTrackInternal(e)}}]),t}(f.default);n.default=h},{34:34,35:35,54:54}],8:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(54),h=e(33),p=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.MEDIA_ATTACHING,l.default.MEDIA_DETACHING,l.default.MANIFEST_PARSED,l.default.BUFFER_RESET,l.default.BUFFER_APPENDING,l.default.BUFFER_CODECS,l.default.BUFFER_EOS,l.default.BUFFER_FLUSHING,l.default.LEVEL_PTS_UPDATED,l.default.LEVEL_UPDATED));return n._msDuration=null,n._levelDuration=null,n.onsbue=n.onSBUpdateEnd.bind(n),n.onsbe=n.onSBUpdateError.bind(n),n.pendingTracks={},n.tracks={},n}return o(t,e),s(t,[{key:"destroy",value:function(){f.default.prototype.destroy.call(this)}},{key:"onLevelPtsUpdated",value:function(e){var t=e.type,n=this.tracks.audio;if("audio"===t&&n&&"audio/mpeg"===n.container){var r=this.sourceBuffer.audio;if(Math.abs(r.timestampOffset-e.start)>.1){var i=r.updating;try{r.abort()}catch(e){i=!0,d.logger.warn("can not abort audio buffer: "+e)}i?this.audioTimestampOffset=e.start:(d.logger.warn("change mpeg audio timestamp offset from "+r.timestampOffset+" to "+e.start),r.timestampOffset=e.start)}}}},{key:"onManifestParsed",value:function(e){var t=e.audio,n=e.video,r=0;e.altAudio&&(t||n)&&(r=(t?1:0)+(n?1:0),d.logger.log(r+" sourceBuffer(s) expected")),this.sourceBufferNb=r}},{key:"onMediaAttaching",value:function(e){var t=this.media=e.media;if(t){var n=this.mediaSource=new MediaSource;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),n.addEventListener("sourceopen",this.onmso),n.addEventListener("sourceended",this.onmse),n.addEventListener("sourceclose",this.onmsc),t.src=URL.createObjectURL(n)}}},{key:"onMediaDetaching",value:function(){d.logger.log("media source detaching");var e=this.mediaSource;if(e){if("open"===e.readyState)try{e.endOfStream()}catch(e){d.logger.warn("onMediaDetaching:"+e.message+" while calling endOfStream")}e.removeEventListener("sourceopen",this.onmso),e.removeEventListener("sourceended",this.onmse),e.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(l.default.MEDIA_DETACHED)}},{key:"onMediaSourceOpen",value:function(){d.logger.log("media source opened"),this.hls.trigger(l.default.MEDIA_ATTACHED,{media:this.media});var e=this.mediaSource;e&&e.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()}},{key:"checkPendingTracks",value:function(){var e=this.pendingTracks,t=Object.keys(e).length;t&&(this.sourceBufferNb<=t||0===this.sourceBufferNb)&&(this.createSourceBuffers(e),this.pendingTracks={},this.doAppending())}},{key:"onMediaSourceClose",value:function(){d.logger.log("media source closed")}},{key:"onMediaSourceEnded",value:function(){d.logger.log("media source ended")}},{key:"onSBUpdateEnd",value:function(){if(this.audioTimestampOffset){var e=this.sourceBuffer.audio;d.logger.warn("change mpeg audio timestamp offset from "+e.timestampOffset+" to "+this.audioTimestampOffset),e.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var t=this.parent,n=this.segments.reduce(function(e,n){return n.parent===t?e+1:e},0);this.hls.trigger(l.default.BUFFER_APPENDED,{parent:t,pending:n}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()}},{key:"onSBUpdateError",value:function(e){d.logger.error("sourceBuffer error:",e),this.hls.trigger(l.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferReset",value:function(){var e=this.sourceBuffer;for(var t in e){var n=e[t];try{this.mediaSource.removeSourceBuffer(n),n.removeEventListener("updateend",this.onsbue),n.removeEventListener("error",this.onsbe)}catch(e){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}},{key:"onBufferCodecs",value:function(e){if(0===Object.keys(this.sourceBuffer).length){for(var t in e)this.pendingTracks[t]=e[t];var n=this.mediaSource;n&&"open"===n.readyState&&this.checkPendingTracks()}}},{key:"createSourceBuffers",value:function(e){var t=this.sourceBuffer,n=this.mediaSource;for(var r in e)if(!t[r]){var i=e[r],a=i.levelCodec||i.codec,o=i.container+";codecs="+a;d.logger.log("creating sourceBuffer("+o+")");try{var s=t[r]=n.addSourceBuffer(o);s.addEventListener("updateend",this.onsbue),s.addEventListener("error",this.onsbe),this.tracks[r]={codec:a,container:i.container},i.buffer=s}catch(e){d.logger.error("error while trying to add sourceBuffer:"+e.message),this.hls.trigger(l.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:e,mimeType:o})}}this.hls.trigger(l.default.BUFFER_CREATED,{tracks:e})}},{key:"onBufferAppending",value:function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())}},{key:"onBufferAppendFail",value:function(e){d.logger.error("sourceBuffer error:",e.event),this.hls.trigger(l.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferEos",value:function(e){var t=this.sourceBuffer,n=e.type;for(var r in t)n&&r!==n||t[r].ended||(t[r].ended=!0,d.logger.log(r+" sourceBuffer now EOS"));this.checkEos()}},{key:"checkEos",value:function(){var e=this.sourceBuffer,t=this.mediaSource;if(!t||"open"!==t.readyState)return void(this._needsEos=!1);for(var n in e){var r=e[n];if(!r.ended)return;if(r.updating)return void(this._needsEos=!0)}d.logger.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(e){d.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}},{key:"onBufferFlushing",value:function(e){this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}),this.flushBufferCounter=0,this.doFlush()}},{key:"onLevelUpdated",value:function(e){var t=e.details;0!==t.fragments.length&&(this._levelDuration=t.totalduration+t.fragments[0].start,this.updateMediaElementDuration())}},{key:"updateMediaElementDuration",value:function(){var e=this.media,t=this.mediaSource,n=this.sourceBuffer,r=this._levelDuration;if(null!==r&&e&&t&&n&&0!==e.readyState&&"open"===t.readyState){for(var i in n)if(n[i].updating)return;null===this._msDuration&&(this._msDuration=t.duration);var a=e.duration;(r>this._msDuration&&r>a||a===1/0||isNaN(a))&&(d.logger.log("Updating mediasource duration to "+r.toFixed(3)),this._msDuration=t.duration=r)}}},{key:"doFlush",value:function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(!this.flushBuffer(e.start,e.end,e.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var t=0,n=this.sourceBuffer;try{for(var r in n)t+=n[r].buffered.length}catch(e){d.logger.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(l.default.BUFFER_FLUSHED)}}},{key:"doAppending",value:function(){var e=this.hls,t=this.sourceBuffer,n=this.segments;if(Object.keys(t).length){if(this.media.error)return this.segments=[],void d.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(n&&n.length){var r=n.shift();try{var i=r.type,a=t[i];a?a.updating?n.unshift(r):(a.ended=!1,this.parent=r.parent,a.appendBuffer(r.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(t){d.logger.error("error while trying to append buffer:"+t.message),n.unshift(r);var o={type:h.ErrorTypes.MEDIA_ERROR,parent:r.parent};if(22===t.code)return this.segments=[],o.details=h.ErrorDetails.BUFFER_FULL_ERROR,o.fatal=!1,void e.trigger(l.default.ERROR,o);if(this.appendError?this.appendError++:this.appendError=1,o.details=h.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.config.appendErrorMaxRetry)return d.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),n=[],o.fatal=!0,void e.trigger(l.default.ERROR,o);o.fatal=!1,e.trigger(l.default.ERROR,o)}}}}},{key:"flushBuffer",value:function(e,t,n){var r,i,a,o,s,u,l=this.sourceBuffer;if(Object.keys(l).length){if(d.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounter<this.appended){for(var c in l)if(!n||c===n){if(r=l[c],r.ended=!1,r.updating)return d.logger.warn("cannot flush, sb updating in progress"),!1;try{for(i=0;i<r.buffered.length;i++)if(a=r.buffered.start(i),o=r.buffered.end(i),-1!==navigator.userAgent.toLowerCase().indexOf("firefox")&&t===Number.POSITIVE_INFINITY?(s=e,u=t):(s=Math.max(a,e),u=Math.min(o,t)),Math.min(u,o)-s>.5)return this.flushBufferCounter++,d.logger.log("flush "+c+" ["+s+","+u+"], of ["+a+","+o+"], pos:"+this.media.currentTime),r.remove(s,u),!1}catch(e){d.logger.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else d.logger.warn("abort flushing too many retries");d.logger.log("buffer flushed")}return!0}}]),t}(f.default);n.default=p},{33:33,34:34,35:35,54:54}],9:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.FPS_DROP_LEVEL_CAPPING,l.default.MEDIA_ATTACHING,l.default.MANIFEST_PARSED))}return o(t,e),s(t,[{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(e){t.isLevelAllowed(e.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(e.droppedLevel)}},{key:"onMediaAttaching",value:function(e){this.media=e.media instanceof HTMLVideoElement?e.media:null}},{key:"onManifestParsed",value:function(e){var t=this.hls;this.restrictedLevels=[],t.config.capLevelToPlayerSize&&(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.levels=e.levels,t.firstLevel=this.getMaxLevel(e.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}},{key:"detectPlayerSize",value:function(){if(this.media){var e=this.levels?this.levels.length:0;if(e){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e-1),t.autoLevelCapping>this.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}},{key:"getMaxLevel",value:function(e){var n=this;if(!this.levels)return-1;var r=this.levels.filter(function(r,i){return t.isLevelAllowed(i,n.restrictedLevels)&&i<=e});return t.getMaxLevelByMediaSize(r,this.mediaWidth,this.mediaHeight)}},{key:"mediaWidth",get:function(){var e=void 0,n=this.media;return n&&(e=n.width||n.clientWidth||n.offsetWidth,e*=t.contentScaleFactor),e}},{key:"mediaHeight",get:function(){var e=void 0,n=this.media;return n&&(e=n.height||n.clientHeight||n.offsetHeight,e*=t.contentScaleFactor),e}}],[{key:"isLevelAllowed",value:function(e){return-1===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).indexOf(e)}},{key:"getMaxLevelByMediaSize",value:function(e,t,n){if(!e||e&&!e.length)return-1;for(var r=e.length-1,i=0;i<e.length;i+=1){var a=e[i];if((a.width>=t||a.height>=n)&&function(e,t){return!t||(e.width!==t.width||e.height!==t.height)}(a,e[i+1])){r=i;break}}return r}},{key:"contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){}return e}}]),t}(f.default);n.default=d},{34:34,35:35}],10:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(54),h=function(e){function t(e){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.MEDIA_ATTACHING))}return o(t,e),s(t,[{key:"destroy",value:function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1}},{key:"onMediaAttaching",value:function(e){var t=this.hls.config;if(t.capLevelOnFPSDrop){"function"==typeof(this.video=e.media instanceof HTMLVideoElement?e.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),t.fpsDroppedMonitoringPeriod)}}},{key:"checkFPS",value:function(e,t,n){var r=performance.now();if(t){if(this.lastTime){var i=r-this.lastTime,a=n-this.lastDroppedFrames,o=t-this.lastDecodedFrames,s=1e3*a/i,u=this.hls;if(u.trigger(l.default.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:n}),s>0&&a>u.config.fpsDroppedMonitoringThreshold*o){var c=u.currentLevel;d.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(-1===u.autoLevelCapping||u.autoLevelCapping>=c)&&(c-=1,u.trigger(l.default.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:u.currentLevel}),u.autoLevelCapping=c,u.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}},{key:"checkFPSInterval",value:function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}]),t}(f.default);n.default=h},{34:34,35:35,54:54}],11:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(27),h=r(d),p=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.MEDIA_ATTACHED,l.default.MEDIA_DETACHING,l.default.FRAG_PARSING_METADATA));return n.id3Track=void 0,n.media=void 0,n}return o(t,e),s(t,[{key:"destroy",value:function(){f.default.prototype.destroy.call(this)}},{key:"onMediaAttached",value:function(e){this.media=e.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(e){for(var t=e.frag,n=e.samples,r=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,i=0;i<n.length;i++){var a=h.default.getID3Frames(n[i].data);if(a){var o=n[i].pts,s=i<n.length-1?n[i+1].pts:t.endPTS;o===s&&(s+=1e-4);for(var u=0;u<a.length;u++){var l=a[u];if(!h.default.isTimeStampFrame(l)){var c=new r(o,s,"");c.value=l,this.id3Track.addCue(c)}}}}}}]),t}(f.default);n.default=p},{27:27,34:34,35:35}],12:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(54),h=e(33),p=e(37),v=r(p),g=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.MANIFEST_LOADED,l.default.LEVEL_LOADED,l.default.FRAG_LOADED,l.default.ERROR));return n.ontick=n.tick.bind(n),n._manualLevel=-1,n}return o(t,e),s(t,[{key:"destroy",value:function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this._manualLevel=-1}},{key:"startLoad",value:function(){this.canload=!0;var e=this._levels;e&&e.forEach(function(e){e.loadError=0;var t=e.details;t&&t.live&&(e.details=void 0)}),this.timer&&this.tick()}},{key:"stopLoad",value:function(){this.canload=!1}},{key:"onManifestLoaded",value:function(e){var t,n=[],r=[],i={},a=!1,o=!1,s=this.hls,u=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),c=function(e,t){return MediaSource.isTypeSupported(e+"/mp4;codecs="+t)};if(e.levels.forEach(function(e){e.videoCodec&&(a=!0),u&&e.audioCodec&&-1!==e.audioCodec.indexOf("mp4a.40.34")&&(e.audioCodec=void 0),(e.audioCodec||e.attrs&&e.attrs.AUDIO)&&(o=!0);var t=i[e.bitrate];void 0===t?(i[e.bitrate]=n.length,e.url=[e.url],e.urlId=0,n.push(e)):n[t].url.push(e.url)}),a&&o?n.forEach(function(e){e.videoCodec&&r.push(e)}):r=n,r=r.filter(function(e){var t=e.audioCodec,n=e.videoCodec;return(!t||c("audio",t))&&(!n||c("video",n))}),r.length){t=r[0].bitrate,r.sort(function(e,t){return e.bitrate-t.bitrate}),this._levels=r;for(var f=0;f<r.length;f++)if(r[f].bitrate===t){this._firstLevel=f,d.logger.log("manifest loaded,"+r.length+" level(s) found, first bitrate:"+t);break}s.trigger(l.default.MANIFEST_PARSED,{levels:r,firstLevel:this._firstLevel,stats:e.stats,audio:o,video:a,altAudio:e.audioTracks.length>0})}else s.trigger(l.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(e){var t=this._levels,n=this.hls;if(e>=0&&e<t.length){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this._level!==e){d.logger.log("switching to level "+e),this._level=e;var r=t[e];r.level=e,n.trigger(l.default.LEVEL_SWITCH,r),n.trigger(l.default.LEVEL_SWITCHING,r)}var i=t[e],a=i.details;if(!a||!0===a.live){var o=i.urlId;n.trigger(l.default.LEVEL_LOADING,{url:i.url[o],level:e,id:o})}}else n.trigger(l.default.ERROR,{type:h.ErrorTypes.OTHER_ERROR,details:h.ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:!1,reason:"invalid level idx"})}},{key:"onError",value:function(e){if(!e.fatal){var t=e.details,n=this.hls,r=void 0,i=void 0,a=!1;switch(t){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=e.frag.level;break;case h.ErrorDetails.LEVEL_LOAD_ERROR:case h.ErrorDetails.LEVEL_LOAD_TIMEOUT:r=e.context.level,a=!0;break;case h.ErrorDetails.REMUX_ALLOC_ERROR:r=e.level}if(void 0!==r){i=this._levels[r],i.loadError?i.loadError++:i.loadError=1;var o=i.url.length;if(o>1&&i.loadError<o)i.urlId=(i.urlId+1)%o,i.details=void 0,d.logger.warn("level controller,"+t+" for level "+r+": switching to redundant stream id "+i.urlId);else{if(-1===this._manualLevel&&r)d.logger.warn("level controller,"+t+": switch-down for next fragment"),n.nextAutoLevel=Math.max(0,r-1);else if(i&&i.details&&i.details.live)d.logger.warn("level controller,"+t+" on live stream, discard"),a&&(this._level=void 0);else if(t===h.ErrorDetails.LEVEL_LOAD_ERROR||t===h.ErrorDetails.LEVEL_LOAD_TIMEOUT){var s=n.media,u=s&&v.default.isBuffered(s,s.currentTime)&&v.default.isBuffered(s,s.currentTime+.5);if(u){var l=n.config.levelLoadingRetryDelay;d.logger.warn("level controller,"+t+", but media buffered, retry in "+l+"ms"),this.timer=setTimeout(this.ontick,l),e.levelRetry=!0}else d.logger.error("cannot recover "+t+" error"),this._level=void 0,this.timer&&(clearTimeout(this.timer),this.timer=null),e.fatal=!0}}}}}},{key:"onFragLoaded",value:function(e){var t=e.frag;if(t&&"main"===t.type){var n=this._levels[t.level];n&&(n.loadError=0)}}},{key:"onLevelLoaded",value:function(e){var t=e.level;if(t===this._level){var n=this._levels[t];n.loadError=0;var r=e.details;if(r.live){var i=1e3*(r.averagetargetduration?r.averagetargetduration:r.targetduration),a=n.details;a&&r.endSN===a.endSN&&(i/=2,d.logger.log("same live playlist, reload twice faster")),i-=performance.now()-e.stats.trequest,i=Math.max(1e3,Math.round(i)),d.logger.log("live playlist, reload in "+i+" ms"),this.timer=setTimeout(this.ontick,i)}else this.timer=null}}},{key:"tick",value:function(){var e=this._level;if(void 0!==e&&this.canload){var t=this._levels[e];if(t&&t.url){var n=t.urlId;this.hls.trigger(l.default.LEVEL_LOADING,{url:t.url[n],level:e,id:n})}}}},{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this._level},set:function(e){var t=this._levels;t&&t.length>e&&(this._level===e&&void 0!==t[e].details||this.setLevelInternal(e))}},{key:"manualLevel",get:function(){return this._manualLevel},set:function(e){this._manualLevel=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this._manualLevel?this._manualLevel:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this._manualLevel&&(this.hls.nextAutoLevel=e)}}]),t}(f.default);n.default=g},{33:33,34:34,35:35,37:37,54:54}],13:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(48),l=r(u),c=e(37),f=r(c),d=e(25),h=r(d),p=e(35),v=r(p),g=e(34),y=r(g),m=e(38),b=r(m),_=e(55),E=r(_),T=e(33),w=e(54),k={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(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,v.default.MEDIA_ATTACHED,v.default.MEDIA_DETACHING,v.default.MANIFEST_LOADING,v.default.MANIFEST_PARSED,v.default.LEVEL_LOADED,v.default.KEY_LOADED,v.default.FRAG_LOADED,v.default.FRAG_LOAD_EMERGENCY_ABORTED,v.default.FRAG_PARSING_INIT_SEGMENT,v.default.FRAG_PARSING_DATA,v.default.FRAG_PARSED,v.default.ERROR,v.default.AUDIO_TRACK_SWITCHING,v.default.AUDIO_TRACK_SWITCHED,v.default.BUFFER_CREATED,v.default.BUFFER_APPENDED,v.default.BUFFER_FLUSHED));return n.config=e.config,n.audioCodecSwap=!1,n.ticks=0,n._state=k.STOPPED,n.ontick=n.tick.bind(n),n}return o(t,e),s(t,[{key:"destroy",value:function(){this.stopLoad(),this.timer&&(clearInterval(this.timer),this.timer=null),y.default.prototype.destroy.call(this),this.state=k.STOPPED}},{key:"startLoad",value:function(e){if(this.levels){var t=this.lastCurrentTime,n=this.hls;if(this.stopLoad(),this.timer||(this.timer=setInterval(this.ontick,100)),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var r=n.startLevel;-1===r&&(r=0,this.bitrateTest=!0),this.level=n.nextLoadLevel=r,this.loadedmetadata=!1}t>0&&-1===e&&(w.logger.log("override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=k.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this.forceStartLoad=!0,this.state=k.STOPPED}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=k.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 k.ERROR:break;case k.BUFFER_FLUSHING:this.fragLoadError=0;break;case k.IDLE:this._doTickIdle();break;case k.WAITING_LEVEL:var e=this.levels[this.level];e&&e.details&&(this.state=k.IDLE);break;case k.FRAG_LOADING_WAITING_RETRY:var t=performance.now(),n=this.retryDate;(!n||t>=n||this.media&&this.media.seeking)&&(w.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=k.IDLE);break;case k.ERROR:case k.STOPPED:case k.FRAG_LOADING:case k.PARSING:case k.PARSED:case k.ENDED:}this._checkBuffer(),this._checkFragmentChanged()}},{key:"_doTickIdle",value:function(){var e=this.hls,t=e.config,n=this.media;if(void 0===this.levelLastLoaded||n||!this.startFragRequested&&t.startFragPrefetch){var r=void 0;r=this.loadedmetadata?n.currentTime:this.nextLoadPosition;var i=e.nextLoadLevel,a=this.levels[i];if(a){var o=a.bitrate,s=void 0;s=o?Math.max(8*t.maxBufferSize/o,t.maxBufferLength):t.maxBufferLength,s=Math.min(s,t.maxMaxBufferLength);var u=f.default.bufferInfo(this.mediaBuffer?this.mediaBuffer:n,r,t.maxBufferHole),l=u.len;if(!(l>=s)){w.logger.trace("buffer length of "+l.toFixed(3)+" is below max of "+s.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=i;var c=a.details;if(void 0===c||c.live&&this.levelLastLoaded!==i)return void(this.state=k.WAITING_LEVEL);var d=this.fragPrevious;if(!c.live&&d&&d.sn===c.endSN&&l&&!u.nextStart){if(Math.min(n.duration,d.start+d.duration)-Math.max(u.end,d.start)<=Math.max(.2,d.duration)){var h={};return this.altAudio&&(h.type="video"),this.hls.trigger(v.default.BUFFER_EOS,h),void(this.state=k.ENDED)}}this._fetchPayloadOrEos(r,u,c)}}}}},{key:"_fetchPayloadOrEos",value:function(e,t,n){var r=this.fragPrevious,i=this.level,a=n.fragments,o=a.length;if(0!==o){var s=a[0].start,u=a[o-1].start+a[o-1].duration,l=t.end,c=void 0;if(n.initSegment&&!n.initSegment.data)c=n.initSegment;else if(n.live){var f=this.config.initialLiveManifestSize;if(o<f)return void w.logger.warn("Can not start playback of a level, reason: not enough fragments "+o+" < "+f);if(null===(c=this._ensureFragmentAtLivePoint(n,l,s,u,r,a,o)))return}else l<s&&(c=a[0]);c||(c=this._findFragment(s,r,o,a,l,u,n)),c&&this._loadFragmentOrKey(c,i,n,e,l)}}},{key:"_ensureFragmentAtLivePoint",value:function(e,t,n,r,i,a,o){var s=this.hls.config,u=this.media,l=void 0,c=void 0!==s.liveMaxLatencyDuration?s.liveMaxLatencyDuration:s.liveMaxLatencyDurationCount*e.targetduration;if(t<Math.max(n-s.maxFragLookUpTolerance,r-c)){var f=this.liveSyncPosition=this.computeLivePosition(n,e);w.logger.log("buffer end: "+t.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+f.toFixed(3)),t=f,u&&u.readyState&&u.duration>f&&(u.currentTime=f),this.nextLoadPosition=f}if(e.PTSKnown&&t>r&&u&&u.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(i){var d=i.sn+1;d>=e.startSN&&d<=e.endSN&&(l=a[d-e.startSN],w.logger.log("live playlist, switching playlist, load frag with next SN: "+l.sn))}l||(l=a[Math.min(o-1,Math.round(o/2))],w.logger.log("live playlist, switching playlist, unknown, load middle frag : "+l.sn))}return l}},{key:"_findFragment",value:function(e,t,n,r,i,a,o){var s=this.hls.config,u=void 0,c=void 0,f=s.maxFragLookUpTolerance,d=t?r[t.sn-r[0].sn+1]:void 0,h=function(e){var t=Math.min(f,e.duration);return e.start+e.duration-t<=i?1:e.start-t>i&&e.start?-1:0};if(i<a?(i>a-f&&(f=0),c=d&&!h(d)?d:l.default.search(r,h)):c=r[n-1],c){u=c;var p=u.sn-o.startSN,v=t&&u.level===t.level,g=r[p-1],y=r[p+1];if(t&&u.sn===t.sn)if(v&&!u.backtracked)if(u.sn<o.endSN){var m=t.deltaPTS;m&&m>s.maxBufferHole&&t.dropped&&p?(u=g,w.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"),t.loadCounter--):(u=y,w.logger.log("SN just loaded, load next one: "+u.sn))}else u=null;else u.backtracked&&(y&&y.backtracked?(w.logger.warn("Already backtracked from fragment "+y.sn+", will not backtrack to fragment "+u.sn+". Loading fragment "+y.sn),u=y):(w.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),u.dropped=0,g?(g.loadCounter&&g.loadCounter--,u=g,u.backtracked=!0):p&&(u=null)))}return u}},{key:"_loadFragmentOrKey",value:function(e,t,n,r,i){var a=this.hls,o=a.config;if(!e.decryptdata||null==e.decryptdata.uri||null!=e.decryptdata.key){if(w.logger.log("Loading "+e.sn+" of ["+n.startSN+" ,"+n.endSN+"],level "+t+", currentTime:"+r.toFixed(3)+",bufferEnd:"+i.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,e.loadCounter){e.loadCounter++;var s=o.fragLoadingLoopThreshold;if(e.loadCounter>s&&Math.abs(this.fragLoadIdx-e.loadIdx)<s)return void a.trigger(v.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_LOOP_LOADING_ERROR,fatal:!1,frag:e})}else e.loadCounter=1;return e.loadIdx=this.fragLoadIdx,this.fragCurrent=e,this.startFragRequested=!0,isNaN(e.sn)||(this.nextLoadPosition=e.start+e.duration),e.autoLevel=a.autoLevelEnabled,e.bitrateTest=this.bitrateTest,a.trigger(v.default.FRAG_LOADING,{frag:e}),this.demuxer||(this.demuxer=new h.default(a,"main")),void(this.state=k.FRAG_LOADING)}w.logger.log("Loading key for "+e.sn+" of ["+n.startSN+" ,"+n.endSN+"],level "+t),this.state=k.KEY_LOADING,a.trigger(v.default.KEY_LOADING,{frag:e})}},{key:"getBufferedFrag",value:function(e){return l.default.search(this._bufferedFrags,function(t){return e<t.startPTS?-1:e>t.endPTS?1:0})}},{key:"followingBufferedFrag",value:function(e){return e?this.getBufferedFrag(e.endPTS+.5):null}},{key:"_checkFragmentChanged",value:function(){var e,t,n=this.media;if(n&&n.readyState&&!1===n.seeking&&(t=n.currentTime,t>n.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=t),f.default.isBuffered(n,t)?e=this.getBufferedFrag(t):f.default.isBuffered(n,t+.1)&&(e=this.getBufferedFrag(t+.1)),e)){var r=e;if(r!==this.fragPlaying){this.hls.trigger(v.default.FRAG_CHANGED,{frag:r});var i=r.level;this.fragPlaying&&this.fragPlaying.level===i||this.hls.trigger(v.default.LEVEL_SWITCHED,{level:i}),this.fragPlaying=r}}}},{key:"immediateLevelSwitch",value:function(){if(w.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var e=this.media,t=void 0;e?(t=e.paused,e.pause()):t=!0,this.previouslyPaused=t}var n=this.fragCurrent;n&&n.loader&&n.loader.abort(),this.fragCurrent=null,this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}},{key:"immediateLevelSwitchEnd",value:function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,f.default.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())}},{key:"nextLevelSwitch",value:function(){var e=this.media;if(e&&e.readyState){var t=void 0,n=void 0,r=void 0;if(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,n=this.getBufferedFrag(e.currentTime),n&&n.startPTS>1&&this.flushMainBuffer(0,n.startPTS-1),e.paused)t=0;else{var i=this.hls.nextLoadLevel,a=this.levels[i],o=this.fragLastKbps;t=o&&this.fragCurrent?this.fragCurrent.duration*a.bitrate/(1e3*o)+1:0}if((r=this.getBufferedFrag(e.currentTime+t))&&(r=this.followingBufferedFrag(r))){var s=this.fragCurrent;s&&s.loader&&s.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(r.maxStartPTS,Number.POSITIVE_INFINITY)}}}},{key:"flushMainBuffer",value:function(e,t){this.state=k.BUFFER_FLUSHING;var n={startOffset:e,endOffset:t};this.altAudio&&(n.type="video"),this.hls.trigger(v.default.BUFFER_FLUSHING,n)}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("seeked",this.onvseeked),t.addEventListener("ended",this.onvended);var n=this.config;this.levels&&n.autoStartLoad&&this.hls.startLoad(n.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(w.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.levels;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.loadCounter=void 0,e.backtracked=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){var e=this.media,t=e?e.currentTime:void 0,n=this.config;isNaN(t)||w.logger.log("media seeking to "+t.toFixed(3));var r=this.mediaBuffer?this.mediaBuffer:e,i=f.default.bufferInfo(r,t,this.config.maxBufferHole);if(this.state===k.FRAG_LOADING){var a=this.fragCurrent;if(0===i.len&&a){var o=n.maxFragLookUpTolerance,s=a.start-o,u=a.start+a.duration+o;t<s||t>u?(a.loader&&(w.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=k.IDLE):w.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===k.ENDED&&(0===i.len&&(this.fragPrevious=0),this.state=k.IDLE);e&&(this.lastCurrentTime=t),this.state!==k.FRAG_LOADING&&void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*n.fragLoadingLoopThreshold),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=t),this.tick()}},{key:"onMediaSeeked",value:function(){var e=this.media,t=e?e.currentTime:void 0;isNaN(t)||w.logger.log("media seeked to "+t.toFixed(3)),this.tick()}},{key:"onMediaEnded",value:function(){w.logger.log("media ended"),this.startPosition=this.lastCurrentTime=0}},{key:"onManifestLoading",value:function(){w.logger.log("trigger BUFFER_RESET"),this.hls.trigger(v.default.BUFFER_RESET),this._bufferedFrags=[],this.stalled=!1,this.startPosition=this.lastCurrentTime=0}},{key:"onManifestParsed",value:function(e){var t,n=!1,r=!1;e.levels.forEach(function(e){(t=e.audioCodec)&&(-1!==t.indexOf("mp4a.40.2")&&(n=!0),-1!==t.indexOf("mp4a.40.5")&&(r=!0))}),this.audioCodecSwitch=n&&r,this.audioCodecSwitch&&w.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startLevelLoaded=!1,this.startFragRequested=!1;var i=this.config;(i.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(i.startPosition)}},{key:"onLevelLoaded",value:function(e){var t=e.details,n=e.level,r=this.levels[n],i=t.totalduration,a=0;if(w.logger.log("level "+n+" loaded ["+t.startSN+","+t.endSN+"],duration:"+i),this.levelLastLoaded=n,t.live){var o=r.details;o&&t.fragments.length>0?(b.default.mergeDetails(o,t),a=t.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(a,o),t.PTSKnown?w.logger.log("live playlist sliding:"+a.toFixed(3)):w.logger.log("live playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,w.logger.log("live playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(r.details=t,this.hls.trigger(v.default.LEVEL_UPDATED,{details:t,level:n}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var s=t.startTimeOffset;isNaN(s)?t.live?(this.startPosition=this.computeLivePosition(a,t),w.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(s<0&&(w.logger.log("negative start time offset "+s+", count from end of last fragment"),s=a+i+s),w.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===k.WAITING_LEVEL&&(this.state=k.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===k.KEY_LOADING&&(this.state=k.IDLE,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,n=e.frag;if(this.state===k.FRAG_LOADING&&t&&"main"===n.type&&n.level===t.level&&n.sn===t.sn){var r=e.stats,i=this.levels[t.level],a=i.details;if(w.logger.log("Loaded "+t.sn+" of ["+a.startSN+" ,"+a.endSN+"],level "+t.level),this.bitrateTest=!1,this.stats=r,!0===n.bitrateTest&&this.hls.nextLoadLevel)this.state=k.IDLE,this.startFragRequested=!1,r.tparsed=r.tbuffered=performance.now(),this.hls.trigger(v.default.FRAG_BUFFERED,{stats:r,frag:t,id:"main"}),this.tick();else if("initSegment"===n.sn)this.state=k.IDLE,r.tparsed=r.tbuffered=performance.now(),a.initSegment.data=e.payload,this.hls.trigger(v.default.FRAG_BUFFERED,{stats:r,frag:t,id:"main"}),this.tick();else{this.state=k.PARSING;var o=a.totalduration,s=t.level,u=t.sn,l=this.config.defaultAudioCodec||i.audioCodec;this.audioCodecSwap&&(w.logger.log("swapping playlist audio codec"),void 0===l&&(l=this.lastAudioCodec),l&&(l=-1!==l.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),this.pendingBuffering=!0,this.appended=!1,w.logger.log("Parsing "+u+" of ["+a.startSN+" ,"+a.endSN+"],level "+s+", cc "+t.cc);var c=this.demuxer;c||(c=this.demuxer=new h.default(this.hls,"main"));var f=this.media,d=f&&f.seeking,p=!d&&(a.PTSKnown||!a.live),g=a.initSegment?a.initSegment.data:[];c.push(e.payload,g,l,i.videoCodec,t,o,p,void 0)}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent,n=e.frag;if(t&&"main"===e.id&&n.sn===t.sn&&n.level===t.level&&this.state===k.PARSING){var r,i,a=e.tracks;if(a.audio&&this.altAudio&&delete a.audio,i=a.audio){var o=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(w.logger.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==i.metadata.channelCount&&-1===s.indexOf("firefox")&&(o="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==i.container&&(o="mp4a.40.2",w.logger.log("Android: force audio codec to "+o)),i.levelCodec=o,i.id=e.id}i=a.video,i&&(i.levelCodec=this.levels[this.level].videoCodec,i.id=e.id),this.hls.trigger(v.default.BUFFER_CODECS,a);for(r in a){i=a[r],w.logger.log("main track:"+r+",container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var u=i.initSegment;u&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(v.default.BUFFER_APPENDING,{type:r,data:u,parent:"main",content:"initSegment"}))}this.tick()}}},{key:"onFragParsingData",value:function(e){var t=this,n=this.fragCurrent,r=e.frag;if(n&&"main"===e.id&&r.sn===n.sn&&r.level===n.level&&("audio"!==e.type||!this.altAudio)&&this.state===k.PARSING){var i=this.levels[this.level],a=n;if(isNaN(e.endPTS)&&(e.endPTS=e.startPTS+n.duration,e.endDTS=e.startDTS+n.duration),w.logger.log("Parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb+",dropped:"+(e.dropped||0)),"video"===e.type)if(a.dropped=e.dropped,a.dropped){if(!a.backtracked)return w.logger.warn("missing video frame(s), backtracking fragment"),a.backtracked=!0,this.nextLoadPosition=e.startPTS,this.state=k.IDLE,this.fragPrevious=a,void this.tick();w.logger.warn("Already backtracked on this fragment, appending with the gap")}else a.backtracked=!1;var o=b.default.updateFragPTSDTS(i.details,a,e.startPTS,e.endPTS,e.startDTS,e.endDTS),s=this.hls;s.trigger(v.default.LEVEL_PTS_UPDATED,{details:i.details,level:this.level,drift:o,type:e.type,start:e.startPTS,end:e.endPTS}),[e.data1,e.data2].forEach(function(n){n&&n.length&&t.state===k.PARSING&&(t.appended=!0,t.pendingBuffering=!0,s.trigger(v.default.BUFFER_APPENDING,{type:e.type,data:n,parent:"main",content:"data"}))}),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent,n=e.frag;t&&"main"===e.id&&n.sn===t.sn&&n.level===t.level&&this.state===k.PARSING&&(this.stats.tparsed=performance.now(),this.state=k.PARSED,this._checkAppendedParsed())}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url,n=e.id;if(!t){if(this.mediaBuffer!==this.media){w.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var r=this.fragCurrent;r.loader&&(w.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=k.IDLE}var i=this.hls;i.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),i.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:n}),this.altAudio=!1}}},{key:"onAudioTrackSwitched",value:function(e){var t=e.id,n=!!this.hls.audioTracks[t].url;if(n){var r=this.videoBuffer;r&&this.mediaBuffer!==r&&(w.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=n,this.tick()}},{key:"onBufferCreated",value:function(e){var t=e.tracks,n=void 0,r=void 0,i=!1;for(var a in t){var o=t[a];"main"===o.id?(r=a,n=o,"video"===a&&(this.videoBuffer=t[a].buffer)):i=!0}i&&n?(w.logger.log("alternate track found, use "+r+".buffered to schedule main fragment loading"),this.mediaBuffer=n.buffer):this.mediaBuffer=this.media}},{key:"onBufferAppended",value:function(e){if("main"===e.parent){var t=this.state;t!==k.PARSING&&t!==k.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==k.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent;if(e){var t=this.mediaBuffer?this.mediaBuffer:this.media;w.logger.log("main buffered : "+E.default.toString(t.buffered));var n=this._bufferedFrags.filter(function(e){return f.default.isBuffered(t,(e.startPTS+e.endPTS)/2)});n.push(e),this._bufferedFrags=n.sort(function(e,t){return e.startPTS-t.startPTS}),this.fragPrevious=e;var r=this.stats;r.tbuffered=performance.now(),this.fragLastKbps=Math.round(8*r.total/(r.tbuffered-r.tfirst)),this.hls.trigger(v.default.FRAG_BUFFERED,{stats:r,frag:e,id:"main"}),this.state=k.IDLE}this.tick()}}},{key:"onError",value:function(e){var t=e.frag||this.fragCurrent;if(!t||"main"===t.type){var n=this.media,r=n&&f.default.isBuffered(n,n.currentTime)&&f.default.isBuffered(n,n.currentTime+.5);switch(e.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(!e.fatal){var i=this.fragLoadError;i?i++:i=1;var a=this.config;if(i<=a.fragLoadingMaxRetry||r||t.autoLevel&&t.level){this.fragLoadError=i,t.loadCounter=0;var o=Math.min(Math.pow(2,i-1)*a.fragLoadingRetryDelay,a.fragLoadingMaxRetryTimeout);w.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=k.FRAG_LOADING_WAITING_RETRY}else w.logger.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=k.ERROR}break;case T.ErrorDetails.FRAG_LOOP_LOADING_ERROR:e.fatal||(r?(this._reduceMaxBufferLength(t.duration),this.state=k.IDLE):t.autoLevel&&0!==t.level||(e.fatal=!0,this.state=k.ERROR));break;case T.ErrorDetails.LEVEL_LOAD_ERROR:case T.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==k.ERROR&&(e.fatal?(this.state=k.ERROR,w.logger.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):e.levelRetry||this.state!==k.WAITING_LEVEL||(this.state=k.IDLE));break;case T.ErrorDetails.BUFFER_FULL_ERROR:"main"!==e.parent||this.state!==k.PARSING&&this.state!==k.PARSED||(r?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=k.IDLE):(w.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(e){var t=this.config;t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,w.logger.warn("main:reduce max buffer length to "+t.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*t.fragLoadingLoopThreshold)}},{key:"_checkBuffer",value:function(){var e=this.media,t=this.config;if(e&&e.readyState){var n=e.currentTime,r=this.mediaBuffer?this.mediaBuffer:e,i=r.buffered;if(!this.loadedmetadata&&i.length){this.loadedmetadata=!0;var a=e.seeking?n:this.startPosition,o=f.default.isBuffered(r,a),s=i.start(0);(n!==a||!o&&Math.abs(a-s)<t.maxSeekHole)&&(w.logger.log("target start position:"+a),o||(a=s,w.logger.log("target start position not buffered, seek to buffered.start(0) "+a)),w.logger.log("adjust currentTime from "+n+" to "+a),e.currentTime=a)}else if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var u=f.default.bufferInfo(e,n,0),l=!(e.paused||e.ended||0===e.buffered.length),c=n!==this.lastCurrentTime;if(c)this.stallReported&&(w.logger.warn("playback not stuck anymore @"+n+", after "+Math.round(performance.now()-this.stalled)+"ms"),this.stallReported=!1),this.stalled=void 0,this.nudgeRetry=0;else if(l){var d=performance.now(),h=this.hls;if(this.stalled){var p=d-this.stalled,g=u.len,y=this.nudgeRetry||0;if(g<=.5&&p>1e3*t.lowBufferWatchdogPeriod){this.stallReported||(this.stallReported=!0,w.logger.warn("playback stalling in low buffer @"+n),h.trigger(v.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:g}));var m=u.nextStart,b=m-n;if(m&&b<t.maxSeekHole&&b>0){this.nudgeRetry=++y;var _=y*t.nudgeOffset;w.logger.log("adjust currentTime from "+e.currentTime+" to next buffered @ "+m+" + nudge "+_),e.currentTime=m+_,this.stalled=void 0,h.trigger(v.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,hole:m+_-n})}}else if(g>.5&&p>1e3*t.highBufferWatchdogPeriod)if(this.stallReported||(this.stallReported=!0,w.logger.warn("playback stalling in high buffer @"+n),h.trigger(v.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:g})),this.stalled=void 0,this.nudgeRetry=++y,y<t.nudgeMaxRetry){var E=e.currentTime,k=E+y*t.nudgeOffset;w.logger.log("adjust currentTime from "+E+" to "+k),e.currentTime=k,h.trigger(v.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else w.logger.error("still stuck in high buffer @"+n+" after "+t.nudgeMaxRetry+", raise fatal error"),h.trigger(v.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=k.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()}},{key:"onBufferFlushed",value:function(){var e=this.mediaBuffer?this.mediaBuffer:this.media;this._bufferedFrags=this._bufferedFrags.filter(function(t){return f.default.isBuffered(e,(t.startPTS+t.endPTS)/2)}),this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.state=k.IDLE,this.fragPrevious=null}},{key:"swapAudioCodec",value:function(){this.audioCodecSwap=!this.audioCodecSwap}},{key:"computeLivePosition",value:function(e,t){var n=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*t.targetduration;return e+Math.max(0,t.totalduration-n)}},{key:"state",set:function(e){if(this.state!==e){var t=this.state;this._state=e,w.logger.log("main stream:"+t+"->"+e),this.hls.trigger(v.default.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var e=this.media;if(e){var t=this.getBufferedFrag(e.currentTime);if(t)return t.level}return-1}},{key:"nextBufferedFrag",get:function(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e}}]),t}(y.default);n.default=S},{25:25,33:33,34:34,35:35,37:37,38:38,48:48,54:54,55:55}],14:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(54),h=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.ERROR,l.default.SUBTITLE_TRACKS_UPDATED,l.default.SUBTITLE_TRACK_SWITCH,l.default.SUBTITLE_TRACK_LOADED,l.default.SUBTITLE_FRAG_PROCESSED));return n.config=e.config,n.vttFragSNsProcessed={},n.vttFragQueues=void 0,n.currentlyProcessing=null,n.currentTrackId=-1,n}return o(t,e),s(t,[{key:"destroy",value:function(){f.default.prototype.destroy.call(this)}},{key:"clearVttFragQueues",value:function(){var e=this;this.vttFragQueues={},this.tracks.forEach(function(t){e.vttFragQueues[t.id]=[]})}},{key:"nextFrag",value:function(){if(null===this.currentlyProcessing&&this.currentTrackId>-1&&this.vttFragQueues[this.currentTrackId].length){var e=this.currentlyProcessing=this.vttFragQueues[this.currentTrackId].shift();this.hls.trigger(l.default.FRAG_LOADING,{frag:e})}}},{key:"onSubtitleFragProcessed",value:function(e){e.success&&this.vttFragSNsProcessed[e.frag.trackId].push(e.frag.sn),this.currentlyProcessing=null,this.nextFrag()}},{key:"onError",value:function(e){var t=e.frag;t&&"subtitle"!==t.type||this.currentlyProcessing&&(this.currentlyProcessing=null,this.nextFrag())}},{key:"onSubtitleTracksUpdated",value:function(e){var t=this;d.logger.log("subtitle tracks updated"),this.tracks=e.subtitleTracks,this.clearVttFragQueues(),this.vttFragSNsProcessed={},this.tracks.forEach(function(e){t.vttFragSNsProcessed[e.id]=[]})}},{key:"onSubtitleTrackSwitch",value:function(e){this.currentTrackId=e.id,this.clearVttFragQueues()}},{key:"onSubtitleTrackLoaded",value:function(e){var t=this.vttFragSNsProcessed[e.id],n=this.vttFragQueues[e.id],r=this.currentlyProcessing?this.currentlyProcessing.sn:-1,i=function(e){return t.indexOf(e.sn)>-1},a=function(e){return n.some(function(t){return t.sn===e.sn})};e.details.fragments.forEach(function(t){i(t)||t.sn===r||a(t)||(t.trackId=e.id,n.push(t))}),this.nextFrag()}}]),t}(f.default);n.default=h},{34:34,35:35,54:54}],15:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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)}function s(e){for(var t=[],n=0;n<e.length;n++)"subtitles"===e[n].kind&&t.push(e[n]);return t}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=e(35),c=r(l),f=e(34),d=r(f),h=e(54),p=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,c.default.MEDIA_ATTACHED,c.default.MEDIA_DETACHING,c.default.MANIFEST_LOADING,c.default.MANIFEST_LOADED,c.default.SUBTITLE_TRACK_LOADED));return n.tracks=[],n.trackId=-1,n.media=void 0,n}return o(t,e),u(t,[{key:"_onTextTracksChanged",value:function(){if(this.media){for(var e=-1,t=s(this.media.textTracks),n=0;n<t.length;n++)"showing"===t[n].mode&&(e=n);this.subtitleTrack=e}}},{key:"destroy",value:function(){d.default.prototype.destroy.call(this)}},{key:"onMediaAttached",value:function(e){this.media=e.media,this.media&&(this.trackChangeListener=this._onTextTracksChanged.bind(this),this.media.textTracks.addEventListener("change",this.trackChangeListener))}},{key:"onMediaDetaching",value:function(){this.media&&(this.media.textTracks.removeEventListener("change",this.trackChangeListener),this.media=void 0)}},{key:"onManifestLoading",value:function(){this.tracks=[],this.trackId=-1}},{key:"onManifestLoaded",value:function(e){var t=this,n=e.subtitles||[],r=!1;this.tracks=n,this.trackId=-1,this.hls.trigger(c.default.SUBTITLE_TRACKS_UPDATED,{subtitleTracks:n}),n.forEach(function(e){e.default&&(t.subtitleTrack=e.id,r=!0)})}},{key:"onTick",value:function(){var e=this.trackId,t=this.tracks[e];if(t){var n=t.details;void 0!==n&&!0!==n.live||(h.logger.log("(re)loading playlist for subtitle track "+e),this.hls.trigger(c.default.SUBTITLE_TRACK_LOADING,{url:t.url,id:e}))}}},{key:"onSubtitleTrackLoaded",value:function(e){var t=this;e.id<this.tracks.length&&(h.logger.log("subtitle track "+e.id+" loaded"),this.tracks[e.id].details=e.details,e.details.live&&!this.timer&&(this.timer=setInterval(function(){t.onTick()},1e3*e.details.targetduration,this)),!e.details.live&&this.timer&&(clearInterval(this.timer),this.timer=null))}},{key:"setSubtitleTrackInternal",value:function(e){if(e>=0&&e<this.tracks.length){this.timer&&(clearInterval(this.timer),this.timer=null),this.trackId=e,h.logger.log("switching to subtitle track "+e);var t=this.tracks[e];this.hls.trigger(c.default.SUBTITLE_TRACK_SWITCH,{id:e});var n=t.details;void 0!==n&&!0!==n.live||(h.logger.log("(re)loading playlist for subtitle track "+e),this.hls.trigger(c.default.SUBTITLE_TRACK_LOADING,{url:t.url,id:e}))}}},{key:"subtitleTracks",get:function(){return this.tracks}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.trackId!==e&&this.setSubtitleTrackInternal(e)}}]),t}(d.default);n.default=p},{34:34,35:35,54:54}],16:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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)}function s(e){if(e&&e.cues)for(;e.cues.length>0;)e.removeCue(e.cues[0])}function u(e,t){return e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}function l(e,t,n,r){return Math.min(t,r)-Math.max(e,n)}Object.defineProperty(n,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),f=e(35),d=r(f),h=e(34),p=r(h),v=e(49),g=r(v),y=e(58),m=r(y),b=e(54),_=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,d.default.MEDIA_ATTACHING,d.default.MEDIA_DETACHING,d.default.FRAG_PARSING_USERDATA,d.default.MANIFEST_LOADING,d.default.MANIFEST_LOADED,d.default.FRAG_LOADED,d.default.LEVEL_SWITCHING,d.default.INIT_PTS_FOUND));if(n.hls=e,n.config=e.config,n.enabled=!0,n.Cues=e.config.cueHandler,n.textTracks=[],n.tracks=[],n.unparsedVttFrags=[],n.initPTS=void 0,n.cueRanges=[],n.config.enableCEA708Captions){var r=n,o=function(e,t){var n=null;try{n=new window.Event("addtrack")}catch(e){n=document.createEvent("Event"),n.initEvent("addtrack",!1,!1)}n.track=e,t.dispatchEvent(n)},u={newCue:function(e,t,n){if(!r.textTrack1){var i=r.getExistingTrack("1");if(i)r.textTrack1=i,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",e,t,n)}},l={newCue:function(e,t,n){if(!r.textTrack2){var i=r.getExistingTrack("2");if(i)r.textTrack2=i,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",e,t,n)}};n.cea608Parser=new g.default(0,u,l)}return n}return o(t,e),c(t,[{key:"addCues",value:function(e,t,n,r){for(var i=this.cueRanges,a=!1,o=i.length;o--;){var s=i[o],u=l(s[0],s[1],t,n);if(u>=0&&(s[0]=Math.min(s[0],t),s[1]=Math.max(s[1],n),a=!0,u/(n-t)>.5))return}a||i.push([t,n]),this.Cues.newCue(this[e],t,n,r)}},{key:"onInitPtsFound",value:function(e){var t=this;void 0===this.initPTS&&(this.initPTS=e.initPTS),this.unparsedVttFrags.length&&(this.unparsedVttFrags.forEach(function(e){t.onFragLoaded(e)}),this.unparsedVttFrags=[])}},{key:"getExistingTrack",value:function(e){var t=this.media;if(t)for(var n=0;n<t.textTracks.length;n++){var r=t.textTracks[n],i="textTrack"+e;if(!0===r[i])return r}return null}},{key:"createTextTrack",value:function(e,t,n){var r=this.media;if(r)return r.addTextTrack(e,t,n)}},{key:"destroy",value:function(){p.default.prototype.destroy.call(this)}},{key:"onMediaAttaching",value:function(e){this.media=e.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 e=this.media;if(e){var t=e.textTracks;if(t)for(var n=0;n<t.length;n++)s(t[n])}}},{key:"onManifestLoaded",value:function(e){var t=this;if(this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=void 0,this.cueRanges=[],this.config.enableWebVTT){this.tracks=e.subtitles||[];var n=this.media?this.media.textTracks:[];this.tracks.forEach(function(e,r){var i=void 0;if(r<n.length){var a=n[r];u(a,e)&&(i=a)}i||(i=t.createTextTrack("subtitles",e.name,e.lang)),i.mode=e.default?"showing":"hidden",t.textTracks.push(i)})}}},{key:"onLevelSwitching",value:function(){this.enabled="NONE"!==this.hls.currentLevel.closedCaptions}},{key:"onFragLoaded",value:function(e){var t=e.frag,n=e.payload;if("main"===t.type){var r=t.sn;if(r!==this.lastSn+1){var i=this.cea608Parser;i&&i.reset()}this.lastSn=r}else if("subtitle"===t.type)if(n.byteLength){if(void 0===this.initPTS)return void this.unparsedVttFrags.push(e);var a=this.vttCCs;a[t.cc]||(a[t.cc]={start:t.start,prevCC:this.prevCC,new:!0},this.prevCC=t.cc);var o=this.textTracks,s=this.hls;m.default.parse(n,this.initPTS,a,t.cc,function(e){var n=o[t.trackId];e.forEach(function(e){n.cues.getCueById(e.id)||n.addCue(e)}),s.trigger(d.default.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(e){b.logger.log("Failed to parse VTT cue: "+e),s.trigger(d.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t})})}else this.hls.trigger(d.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t})}},{key:"onFragParsingUserdata",value:function(e){if(this.enabled&&this.config.enableCEA708Captions)for(var t=0;t<e.samples.length;t++){var n=this.extractCea608Data(e.samples[t].bytes);this.cea608Parser.addData(e.samples[t].pts,n)}}},{key:"extractCea608Data",value:function(e){for(var t,n,r,i,a,o=31&e[0],s=2,u=[],l=0;l<o;l++)t=e[s++],n=127&e[s++],r=127&e[s++],i=0!=(4&t),a=3&t,0===n&&0===r||i&&0===a&&(u.push(n),u.push(r));return u}}]),t}(p.default);n.default=_},{34:34,35:35,49:49,54:54,58:58}],17:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n){r(this,e),this.subtle=t,this.aesIV=n}return i(e,[{key:"decrypt",value:function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}]),e}();n.default=a},{}],18:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e),this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return i(e,[{key:"uint8ArrayToUint32Array_",value:function(e){for(var t=new DataView(e),n=new Uint32Array(4),r=0;r<4;r++)n[r]=t.getUint32(4*r);return n}},{key:"initTable",value:function(){var e=this.sBox,t=this.invSBox,n=this.subMix,r=n[0],i=n[1],a=n[2],o=n[3],s=this.invSubMix,u=s[0],l=s[1],c=s[2],f=s[3],d=new Uint32Array(256),h=0,p=0,v=0;for(v=0;v<256;v++)d[v]=v<128?v<<1:v<<1^283;for(v=0;v<256;v++){var g=p^p<<1^p<<2^p<<3^p<<4;g=g>>>8^255&g^99,e[h]=g,t[g]=h;var y=d[h],m=d[y],b=d[m],_=257*d[g]^16843008*g;r[h]=_<<24|_>>>8,i[h]=_<<16|_>>>16,a[h]=_<<8|_>>>24,o[h]=_,_=16843009*b^65537*m^257*y^16843008*h,u[g]=_<<24|_>>>8,l[g]=_<<16|_>>>16,c[g]=_<<8|_>>>24,f[g]=_,h?(h=y^d[d[d[b^y]]],p^=d[d[p]]):h=p=1}}},{key:"expandKey",value:function(e){for(var t=this.uint8ArrayToUint32Array_(e),n=!0,r=0;r<t.length&&n;)n=t[r]===this.key[r],r++;if(!n){this.key=t;var i=this.keySize=t.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);var a=this.ksRows=4*(i+6+1),o=void 0,s=void 0,u=this.keySchedule=new Uint32Array(a),l=this.invKeySchedule=new Uint32Array(a),c=this.sBox,f=this.rcon,d=this.invSubMix,h=d[0],p=d[1],v=d[2],g=d[3],y=void 0,m=void 0;for(o=0;o<a;o++)o<i?y=u[o]=t[o]:(m=y,o%i==0?(m=m<<8|m>>>24,m=c[m>>>24]<<24|c[m>>>16&255]<<16|c[m>>>8&255]<<8|c[255&m],m^=f[o/i|0]<<24):i>6&&o%i==4&&(m=c[m>>>24]<<24|c[m>>>16&255]<<16|c[m>>>8&255]<<8|c[255&m]),u[o]=y=(u[o-i]^m)>>>0);for(s=0;s<a;s++)o=a-s,m=3&s?u[o]:u[o-4],l[s]=s<4||o<=4?m:h[c[m>>>24]]^p[c[m>>>16&255]]^v[c[m>>>8&255]]^g[c[255&m]],l[s]=l[s]>>>0}}},{key:"networkToHostOrderSwap",value:function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}},{key:"decrypt",value:function(e,t,n){for(var r,i,a=this.keySize+6,o=this.invKeySchedule,s=this.invSBox,u=this.invSubMix,l=u[0],c=u[1],f=u[2],d=u[3],h=this.uint8ArrayToUint32Array_(n),p=h[0],v=h[1],g=h[2],y=h[3],m=new Int32Array(e),b=new Int32Array(m.length),_=void 0,E=void 0,T=void 0,w=void 0,k=void 0,S=void 0,A=void 0,O=void 0,P=void 0,R=void 0,D=void 0,x=void 0,L=this.networkToHostOrderSwap;t<m.length;){for(P=L(m[t]),R=L(m[t+1]),D=L(m[t+2]),x=L(m[t+3]),k=P^o[0],S=x^o[1],A=D^o[2],O=R^o[3],r=4,i=1;i<a;i++)_=l[k>>>24]^c[S>>16&255]^f[A>>8&255]^d[255&O]^o[r],E=l[S>>>24]^c[A>>16&255]^f[O>>8&255]^d[255&k]^o[r+1],T=l[A>>>24]^c[O>>16&255]^f[k>>8&255]^d[255&S]^o[r+2],w=l[O>>>24]^c[k>>16&255]^f[S>>8&255]^d[255&A]^o[r+3],k=_,S=E,A=T,O=w,r+=4;_=s[k>>>24]<<24^s[S>>16&255]<<16^s[A>>8&255]<<8^s[255&O]^o[r],E=s[S>>>24]<<24^s[A>>16&255]<<16^s[O>>8&255]<<8^s[255&k]^o[r+1],T=s[A>>>24]<<24^s[O>>16&255]<<16^s[k>>8&255]<<8^s[255&S]^o[r+2],w=s[O>>>24]<<24^s[k>>16&255]<<16^s[S>>8&255]<<8^s[255&A]^o[r+3],r+=3,b[t]=L(_^p),b[t+1]=L(w^v),b[t+2]=L(T^g),b[t+3]=L(E^y),p=P,v=R,g=D,y=x,t+=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}}]),e}();n.default=a},{}],19:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(17),s=r(o),u=e(20),l=r(u),c=e(18),f=r(c),d=e(33),h=e(54),p=function(){function e(t,n){i(this,e),this.observer=t,this.config=n,this.logEnabled=!0;try{var r=crypto||self.crypto;this.subtle=r.subtle||r.webkitSubtle}catch(e){}this.disableWebCrypto=!this.subtle}return a(e,[{key:"isSync",value:function(){return this.disableWebCrypto&&this.config.enableSoftwareAES}},{key:"decrypt",value:function(e,t,n,r){var i=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 f.default),a.expandKey(t),r(a.decrypt(e,0,n))}else{this.logEnabled&&(h.logger.log("WebCrypto AES decrypt"),this.logEnabled=!1);var o=this.subtle;this.key!==t&&(this.key=t,this.fastAesKey=new l.default(o,t)),this.fastAesKey.expandKey().then(function(a){new s.default(o,n).decrypt(e,a).catch(function(a){i.onWebCryptoError(a,e,t,n,r)}).then(function(e){r(e)})}).catch(function(a){i.onWebCryptoError(a,e,t,n,r)})}}},{key:"onWebCryptoError",value:function(e,t,n,r,i){this.config.enableSoftwareAES?(h.logger.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(t,n,r,i)):(h.logger.error("decrypting error : "+e.message),this.observer.trigger(Event.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_DECRYPT_ERROR,fatal:!0,reason:e.message}))}},{key:"destroy",value:function(){var e=this.decryptor;e&&(e.destroy(),this.decryptor=void 0)}}]),e}();n.default=p},{17:17,18:18,20:20,33:33,54:54}],20:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n){r(this,e),this.subtle=t,this.key=n}return i(e,[{key:"expandKey",value:function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}]),e}();n.default=a},{}],21:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(22),s=r(o),u=e(54),l=e(27),c=r(l),f=function(){function e(t,n,r){i(this,e),this.observer=t,this.config=r,this.remuxer=n}return a(e,[{key:"resetInitSegment",value:function(e,t,n,r){this._audioTrack={container:"audio/adts",type:"audio",id:-1,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:t,duration:r,inputTimeScale:9e4}}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(e,t,n,r){for(var i=this._audioTrack,a=c.default.getID3Data(e,0),o=90*c.default.getTimeStamp(a),l=0,f=o,d=e.length,h=a.length,p=[{pts:f,dts:f,data:a}];h<d-1;)if(s.default.isHeader(e,h)&&h+5<d){s.default.initTrackConfig(i,this.observer,e,h,i.manifestCodec);var v=s.default.appendFrame(i,e,h,o,l);if(!v){u.logger.log("Unable to parse AAC frame");break}h+=v.length,f=v.sample.pts,l++}else c.default.isHeader(e,h)?(a=c.default.getID3Data(e,h),p.push({pts:f,dts:f,data:a}),h+=a.length):h++;this.remuxer.remux(i,{samples:[]},{samples:p,inputTimeScale:9e4},{samples:[]},t,n,r)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(e){var t,n,r=c.default.getID3Data(e,0);if(r&&void 0!==c.default.getTimeStamp(r))for(t=r.length,n=Math.min(e.length-1,t+100);t<n;t++)if(s.default.probe(e,t))return u.logger.log("ADTS sync word found !"),!0;return!1}}]),e}();n.default=f},{22:22,27:27,54:54}],22:[function(e,t,n){"use strict";var r=e(54),i=e(33),a={getAudioConfig:function(e,t,n,a){var o,s,u,l,c,f=navigator.userAgent.toLowerCase(),d=a,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];return o=1+((192&t[n+2])>>>6),(s=(60&t[n+2])>>>2)>h.length-1?void e.trigger(Event.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+s}):(l=(1&t[n+2])<<2,l|=(192&t[n+3])>>>6,r.logger.log("manifest codec:"+a+",ADTS data:type:"+o+",sampleingIndex:"+s+"["+h[s]+"Hz],channelConfig:"+l),/firefox/i.test(f)?s>=6?(o=5,c=new Array(4),u=s-3):(o=2,c=new Array(2),u=s):-1!==f.indexOf("android")?(o=2,c=new Array(2),u=s):(o=5,c=new Array(4),a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&s>=6?u=s-3:((a&&-1!==a.indexOf("mp4a.40.2")&&s>=6&&1===l||!a&&1===l)&&(o=2,c=new Array(2)),u=s)),c[0]=o<<3,c[0]|=(14&s)>>1,c[1]|=(1&s)<<7,c[1]|=l<<3,5===o&&(c[1]|=(14&u)>>1,c[2]=(1&u)<<7,c[2]|=8,c[3]=0),{config:c,samplerate:h[s],channelCount:l,codec:"mp4a.40."+o,manifestCodec:d})},isHeaderPattern:function(e,t){return 255===e[t]&&240==(246&e[t+1])},getHeaderLength:function(e,t){return 1&e[t+1]?7:9},getFullFrameLength:function(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5},isHeader:function(e,t){return!!(t+1<e.length&&this.isHeaderPattern(e,t))},probe:function(e,t){if(t+1<e.length&&this.isHeaderPattern(e,t)){var n=this.getHeaderLength(e,t),r=n;t+5<e.length&&(r=this.getFullFrameLength(e,t));var i=t+r;if(i===e.length||i+1<e.length&&this.isHeaderPattern(e,i))return!0}return!1},initTrackConfig:function(e,t,n,i,a){if(!e.samplerate){var o=this.getAudioConfig(t,n,i,a);e.config=o.config,e.samplerate=o.samplerate,e.channelCount=o.channelCount,e.codec=o.codec,e.manifestCodec=o.manifestCodec,r.logger.log("parsed codec:"+e.codec+",rate:"+o.samplerate+",nb channel:"+o.channelCount)}},getFrameDuration:function(e){return 9216e4/e},appendFrame:function(e,t,n,r,i){var a=this.getFrameDuration(e.samplerate),o=this.parseFrameHeader(t,n,r,i,a);if(o){var s=o.stamp,u=o.headerLength,l=o.frameLength,c={unit:t.subarray(n+u,n+u+l),pts:s,dts:s};return e.samples.push(c),e.len+=l,{sample:c,length:l+u}}},parseFrameHeader:function(e,t,n,r,i){var a,o,s,u=e.length;if(a=this.getHeaderLength(e,t),o=this.getFullFrameLength(e,t),(o-=a)>0&&t+a+o<=u)return s=n+r*i,{headerLength:a,frameLength:o,stamp:s}}};t.exports=a},{33:33,54:54}],23:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(35),s=r(o),u=e(33),l=e(19),c=r(l),f=e(21),d=r(f),h=e(29),p=r(h),v=e(32),g=r(v),y=e(28),m=r(y),b=e(45),_=r(b),E=e(46),T=r(E),w=function(){function e(t,n,r,a){i(this,e),this.observer=t,this.typeSupported=n,this.config=r,this.vendor=a}return a(e,[{key:"destroy",value:function(){var e=this.demuxer;e&&e.destroy()}},{key:"push",value:function(e,t,n,r,i,a,o,u,l,f,d,h){if(e.byteLength>0&&null!=t&&null!=t.key&&"AES-128"===t.method){var p=this.decrypter;null==p&&(p=this.decrypter=new c.default(this.observer,this.config));var v,g=this;try{v=performance.now()}catch(e){v=Date.now()}p.decrypt(e,t.key.buffer,t.iv.buffer,function(e){var c;try{c=performance.now()}catch(e){c=Date.now()}g.observer.trigger(s.default.FRAG_DECRYPTED,{stats:{tstart:v,tdecrypt:c}}),g.pushDecrypted(new Uint8Array(e),t,new Uint8Array(n),r,i,a,o,u,l,f,d,h)})}else this.pushDecrypted(new Uint8Array(e),t,new Uint8Array(n),r,i,a,o,u,l,f,d,h)}},{key:"pushDecrypted",value:function(e,t,n,r,i,a,o,l,c,f,h,v){var y=this.demuxer;if(!y||o&&!this.probe(e)){for(var b=this.observer,E=this.typeSupported,w=this.config,k=[{demux:d.default,remux:_.default},{demux:m.default,remux:_.default},{demux:g.default,remux:_.default},{demux:p.default,remux:T.default}],S=0,A=k.length;S<A;S++){var O=k[S],P=O.demux.probe;if(P(e)){var R=this.remuxer=new O.remux(b,w,E,this.vendor);y=new O.demux(b,R,w,E),this.probe=P;break}}if(!y)return void b.trigger(s.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=y}var D=this.remuxer;(o||l)&&(y.resetInitSegment(n,r,i,f),D.resetInitSegment()),o&&(y.resetTimeStamp(v),D.resetTimeStamp(v)),"function"==typeof y.setDecryptData&&y.setDecryptData(t),y.append(e,a,c,h)}}]),e}();n.default=w},{19:19,21:21,28:28,29:29,32:32,33:33,35:35,45:45,46:46}],24:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var i=e(23),a=r(i),o=e(35),s=r(o),u=e(54),l=e(1),c=r(l),f=function(e){var t=new c.default;t.trigger=function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.emit.apply(t,[e,e].concat(r))},t.off=function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.removeListener.apply(t,[e].concat(r))};var n=function(t,n){e.postMessage({event:t,data:n})};e.addEventListener("message",function(r){var i=r.data;switch(i.cmd){case"init":var o=JSON.parse(i.config);e.demuxer=new a.default(t,i.typeSupported,o,i.vendor);try{(0,u.enableLogs)(!0===o.debug)}catch(e){console.warn("demuxerWorker: unable to enable logs")}n("init",null);break;case"demux":e.demuxer.push(i.data,i.decryptdata,i.initSegment,i.audioCodec,i.videoCodec,i.timeOffset,i.discontinuity,i.trackSwitch,i.contiguous,i.duration,i.accurateTimeOffset,i.defaultInitPTS)}}),t.on(s.default.FRAG_DECRYPTED,n),t.on(s.default.FRAG_PARSING_INIT_SEGMENT,n),t.on(s.default.FRAG_PARSED,n),t.on(s.default.ERROR,n),t.on(s.default.FRAG_PARSING_METADATA,n),t.on(s.default.FRAG_PARSING_USERDATA,n),t.on(s.default.INIT_PTS_FOUND,n),t.on(s.default.FRAG_PARSING_DATA,function(t,n){var r=[],i={event:t,data:n};n.data1&&(i.data1=n.data1.buffer,r.push(n.data1.buffer),delete n.data1),n.data2&&(i.data2=n.data2.buffer,r.push(n.data2.buffer),delete n.data2),e.postMessage(i,r)})};n.default=f},{1:1,23:23,35:35,54:54}],25:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(35),s=r(o),u=e(23),l=r(u),c=e(24),f=r(c),d=e(54),h=e(33),p=e(1),v=r(p),g=function(){function t(n,r){i(this,t),this.hls=n,this.id=r;var a=this.observer=new v.default,o=n.config;a.trigger=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];a.emit.apply(a,[e,e].concat(n))},a.off=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];a.removeListener.apply(a,[e].concat(n))};var u=function(e,t){t=t||{},t.frag=this.frag,t.id=this.id,n.trigger(e,t)}.bind(this);a.on(s.default.FRAG_DECRYPTED,u),a.on(s.default.FRAG_PARSING_INIT_SEGMENT,u),a.on(s.default.FRAG_PARSING_DATA,u),a.on(s.default.FRAG_PARSED,u),a.on(s.default.ERROR,u),a.on(s.default.FRAG_PARSING_METADATA,u),a.on(s.default.FRAG_PARSING_USERDATA,u),a.on(s.default.INIT_PTS_FOUND,u);var c={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){d.logger.log("demuxing in webworker");var g=void 0;try{var y=e(3);g=this.w=y(f.default),this.onwmsg=this.onWorkerMessage.bind(this),g.addEventListener("message",this.onwmsg),g.onerror=function(e){n.trigger(s.default.ERROR,{type:h.ErrorTypes.OTHER_ERROR,details:h.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:e.message+" ("+e.filename+":"+e.lineno+")"}})},g.postMessage({cmd:"init",typeSupported:c,vendor:p,id:r,config:JSON.stringify(o)})}catch(e){d.logger.error("error while initializing DemuxerWorker, fallback on DemuxerInline"),g&&URL.revokeObjectURL(g.objectURL),this.demuxer=new l.default(a,c,o,p),this.w=void 0}}else this.demuxer=new l.default(a,c,o,p)}return a(t,[{key:"destroy",value:function(){var e=this.w;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.w=null;else{var t=this.demuxer;t&&(t.destroy(),this.demuxer=null)}var n=this.observer;n&&(n.removeAllListeners(),this.observer=null)}},{key:"push",value:function(e,t,n,r,i,a,o,s){var u=this.w,l=isNaN(i.startDTS)?i.start:i.startDTS,c=i.decryptdata,f=this.frag,h=!(f&&i.cc===f.cc),p=!(f&&i.level===f.level),v=f&&i.sn===f.sn+1,g=!p&&v;if(h&&d.logger.log(this.id+":discontinuity detected"),p&&d.logger.log(this.id+":switch detected"),this.frag=i,u)u.postMessage({cmd:"demux",data:e,decryptdata:c,initSegment:t,audioCodec:n,videoCodec:r,timeOffset:l,discontinuity:h,trackSwitch:p,contiguous:g,duration:a,accurateTimeOffset:o,defaultInitPTS:s},[e]);else{var y=this.demuxer;y&&y.push(e,c,t,n,r,l,h,p,g,a,o,s)}}},{key:"onWorkerMessage",value:function(e){var t=e.data,n=this.hls;switch(t.event){case"init":URL.revokeObjectURL(this.w.objectURL);break;case s.default.FRAG_PARSING_DATA:t.data.data1=new Uint8Array(t.data1),t.data2&&(t.data.data2=new Uint8Array(t.data2));default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,n.trigger(t.event,t.data)}}}]),t}();n.default=g},{1:1,23:23,24:24,3:3,33:33,35:35,54:54}],26:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e(54),o=function(){function e(t){r(this,e),this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}return i(e,[{key:"loadWord",value:function(){var e=this.data,t=this.bytesAvailable,n=e.byteLength-t,r=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw new Error("no bytes available");r.set(e.subarray(n,n+i)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i}},{key:"skipBits",value:function(e){var t;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}},{key:"readBits",value:function(e){var t=Math.min(this.bitsAvailable,e),n=this.word>>>32-t;return e>32&&a.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}},{key:"skipLZ",value:function(){var e;for(e=0;e<this.bitsAvailable;++e)if(0!=(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+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 e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>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(e){var t,n,r=8,i=8;for(t=0;t<e;t++)0!==i&&(n=this.readEG(),i=(r+n+256)%256),r=0===i?r:i}},{key:"readSPS",value:function(){var e,t,n,r,i,a,o,s=0,u=0,l=0,c=0,f=this.readUByte.bind(this),d=this.readBits.bind(this),h=this.readUEG.bind(this),p=this.readBoolean.bind(this),v=this.skipBits.bind(this),g=this.skipEG.bind(this),y=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);if(f(),e=f(),d(5),v(3),f(),y(),100===e||110===e||122===e||244===e||44===e||83===e||86===e||118===e||128===e){var b=h();if(3===b&&v(1),y(),y(),v(1),p())for(a=3!==b?8:12,o=0;o<a;o++)p()&&m(o<6?16:64)}y();var _=h();if(0===_)h();else if(1===_)for(v(1),g(),g(),t=h(),o=0;o<t;o++)g();y(),v(1),n=h(),r=h(),i=d(1),0===i&&v(1),v(1),p()&&(s=h(),u=h(),l=h(),c=h());var E=[1,1];if(p()&&p()){switch(f()){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=[f()<<8|f(),f()<<8|f()]}}return{width:Math.ceil(16*(n+1)-2*s-2*u),height:(2-i)*(r+1)*16-(i?2:4)*(l+c),pixelRatio:E}}},{key:"readSliceType",value:function(){return this.readUByte(),this.readUEG(),this.readUEG()}}]),e}();n.default=o},{54:54}],27:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e)}return i(e,null,[{key:"isHeader",value:function(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}},{key:"isFooter",value:function(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}},{key:"getID3Data",value:function(t,n){for(var r=n,i=0;e.isHeader(t,n);){i+=10;i+=e._readSize(t,n+6),e.isFooter(t,n+10)&&(i+=10),n+=i}if(i>0)return t.subarray(r,r+i)}},{key:"_readSize",value:function(e,t){var n=0;return n=(127&e[t])<<21,n|=(127&e[t+1])<<14,n|=(127&e[t+2])<<7,n|=127&e[t+3]}},{key:"getTimeStamp",value:function(t){for(var n=e.getID3Frames(t),r=0;r<n.length;r++){var i=n[r];if(e.isTimeStampFrame(i))return e._readTimeStamp(i)}}},{key:"isTimeStampFrame",value:function(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info}},{key:"_getFrameData",value:function(t){var n=String.fromCharCode(t[0],t[1],t[2],t[3]),r=e._readSize(t,4);return{type:n,size:r,data:t.subarray(10,10+r)}}},{key:"getID3Frames",value:function(t){for(var n=0,r=[];e.isHeader(t,n);){var i=e._readSize(t,n+6);n+=10;for(var a=n+i;n+8<a;){var o=e._getFrameData(t.subarray(n)),s=e._decodeFrame(o);s&&r.push(s),n+=o.size+10}e.isFooter(t,n)&&(n+=10)}return r}},{key:"_decodeFrame",value:function(t){return"PRIV"===t.type?e._decodePrivFrame(t):"T"===t.type[0]?e._decodeTextFrame(t):"W"===t.type[0]?e._decodeURLFrame(t):void 0}},{key:"_readTimeStamp",value:function(e){if(8===e.data.byteLength){var t=new Uint8Array(e.data),n=1&t[3],r=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return r/=45,n&&(r+=47721858.84),Math.round(r)}}},{key:"_decodePrivFrame",value:function(t){if(!(t.size<2)){var n=e._utf8ArrayToStr(t.data),r=new Uint8Array(t.data.subarray(n.length+1));return{key:t.type,info:n,data:r.buffer}}}},{key:"_decodeTextFrame",value:function(t){if(!(t.size<2)){if("TXXX"===t.type){var n=1,r=e._utf8ArrayToStr(t.data.subarray(n));n+=r.length+1;var i=e._utf8ArrayToStr(t.data.subarray(n));return{key:t.type,info:r,data:i}}var a=e._utf8ArrayToStr(t.data.subarray(1));return{key:t.type,data:a}}}},{key:"_decodeURLFrame",value:function(t){if("WXXX"===t.type){if(t.size<2)return;var n=1,r=e._utf8ArrayToStr(t.data.subarray(n));n+=r.length+1;var i=e._utf8ArrayToStr(t.data.subarray(n));return{key:t.type,info:r,data:i}}var a=e._utf8ArrayToStr(t.data);return{key:t.type,data:a}}},{key:"_utf8ArrayToStr",value:function(e){for(var t=void 0,n=void 0,r="",i=0,a=e.length;i<a;){var o=e[i++];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:t=e[i++],r+=String.fromCharCode((31&o)<<6|63&t);break;case 14:t=e[i++],n=e[i++],r+=String.fromCharCode((15&o)<<12|(63&t)<<6|(63&n)<<0)}}return r}}]),e}();n.default=a},{}],28:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(27),s=r(o),u=e(54),l=e(30),c=r(l),f=function(){function e(t,n,r){i(this,e),this.observer=t,this.config=r,this.remuxer=n}return a(e,[{key:"resetInitSegment",value:function(e,t,n,r){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:t,duration:r,inputTimeScale:9e4}}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(e,t,n,r){for(var i=s.default.getID3Data(e,0),a=90*s.default.getTimeStamp(i),o=i.length,u=e.length,l=0,f=0,d=this._audioTrack,h=[{pts:a,dts:a,data:i}];o<u;)if(c.default.isHeader(e,o)){var p=c.default.appendFrame(d,e,o,a,l);if(!p)break;o+=p.length,f=p.sample.pts,l++}else s.default.isHeader(e,o)?(i=s.default.getID3Data(e,o),h.push({pts:f,dts:f,data:i}),o+=i.length):o++;this.remuxer.remux(d,{samples:[]},{samples:h,inputTimeScale:9e4},{samples:[]},t,n,r)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(e){var t,n,r=s.default.getID3Data(e,0);if(r&&void 0!==s.default.getTimeStamp(r))for(t=r.length,n=Math.min(e.length-1,t+100);t<n;t++)if(c.default.probe(e,t))return u.logger.log("MPEG Audio sync word found !"),!0;return!1}}]),e}();n.default=f},{27:27,30:30,54:54}],29:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e(35),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=Math.pow(2,32)-1,u=function(){function e(t,n){r(this,e),this.observer=t,this.remuxer=n}return i(e,[{key:"resetTimeStamp",value:function(e){this.initPTS=e}},{key:"resetInitSegment",value:function(t,n,r,i){if(t&&t.byteLength){var a=this.initData=e.parseInitSegment(t),s={};a.audio&&(s.audio={container:"audio/mp4",codec:n,initSegment:i?t:null}),a.video&&(s.video={container:"video/mp4",codec:r,initSegment:i?t:null}),this.observer.trigger(o.default.FRAG_PARSING_INIT_SEGMENT,{tracks:s})}else n&&(this.audioCodec=n),r&&(this.videoCodec=r)}},{key:"append",value:function(t,n,r,i){var a=this.initData;a||(this.resetInitSegment(t,this.audioCodec,this.videoCodec),a=this.initData);var s=void 0,u=this.initPTS;if(void 0===u){var l=e.getStartDTS(a,t);this.initPTS=u=l-n,this.observer.trigger(o.default.INIT_PTS_FOUND,{initPTS:u})}e.offsetStartDTS(a,t,u),s=e.getStartDTS(a,t),this.remuxer.remux(a.audio,a.video,null,null,s,r,i,t)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(t){if(t.length>=8){return["moof","ftyp","styp"].indexOf(e.bin2str(t.subarray(4,8)))>=0}return!1}},{key:"bin2str",value:function(e){return String.fromCharCode.apply(null,e)}},{key:"readUint32",value:function(e,t){e.data&&(t+=e.start,e=e.data);var n=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return n<0?4294967296+n:n}},{key:"writeUint32",value:function(e,t,n){e.data&&(t+=e.start,e=e.data),e[t]=n>>24,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n}},{key:"findBox",value:function(t,n){var r,i,a,o,s,u,l,c=[];if(t.data?(u=t.start,o=t.end,t=t.data):(u=0,o=t.byteLength),!n.length)return null;for(r=u;r<o;)i=e.readUint32(t,r),a=e.bin2str(t.subarray(r+4,r+8)),l=i>1?r+i:o,a===n[0]&&(1===n.length?c.push({data:t,start:r+8,end:l}):(s=e.findBox({data:t,start:r+8,end:l},n.slice(1)),s.length&&(c=c.concat(s)))),r=l;return c}},{key:"parseInitSegment",value:function(t){var n=[];return e.findBox(t,["moov","trak"]).forEach(function(t){var r=e.findBox(t,["tkhd"])[0];if(r){var i=r.data[r.start],a=0===i?12:20,o=e.readUint32(r,a),s=e.findBox(t,["mdia","mdhd"])[0];if(s){i=s.data[s.start],a=0===i?12:20;var u=e.readUint32(s,a),l=e.findBox(t,["mdia","hdlr"])[0];if(l){var c=e.bin2str(l.data.subarray(l.start+8,l.start+12)),f={soun:"audio",vide:"video"}[c];f&&(n[o]={timescale:u,type:f},n[f]={timescale:u,id:o})}}}}),n}},{key:"getStartDTS",value:function(t,n){var r,i,a;return r=e.findBox(n,["moof","traf"]),i=[].concat.apply([],r.map(function(n){return e.findBox(n,["tfhd"]).map(function(r){var i,a,o;return i=e.readUint32(r,4),a=t[i].timescale||9e4,o=e.findBox(n,["tfdt"]).map(function(t){var n,r;return n=t.data[t.start],r=e.readUint32(t,4),1===n&&(r*=Math.pow(2,32),r+=e.readUint32(t,8)),r})[0],(o=o||1/0)/a})})),a=Math.min.apply(null,i),isFinite(a)?a:0}},{key:"offsetStartDTS",value:function(t,n,r){e.findBox(n,["moof","traf"]).map(function(n){return e.findBox(n,["tfhd"]).map(function(i){var a=e.readUint32(i,4),o=t[a].timescale||9e4;e.findBox(n,["tfdt"]).map(function(t){var n=t.data[t.start],i=e.readUint32(t,4);if(0===n)e.writeUint32(t,4,i-r*o);else{i*=Math.pow(2,32),i+=e.readUint32(t,8),i-=r*o;var a=Math.floor(i/(s+1)),u=Math.floor(i%(s+1));e.writeUint32(t,4,a),e.writeUint32(t,8,u)}})})})}}]),e}();n.default=u},{35:35}],30:[function(e,t,n){"use strict";var r={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],appendFrame:function(e,t,n,r,i){if(!(n+24>t.length)){var a=this.parseHeader(t,n);if(a&&n+a.frameLength<=t.length){var o=10368e4/a.sampleRate,s=r+i*o,u={unit:t.subarray(n,n+a.frameLength),pts:s,dts:s};return e.config=[],e.channelCount=a.channelCount,e.samplerate=a.sampleRate,e.samples.push(u),e.len+=a.frameLength,{sample:u,length:a.frameLength}}}},parseHeader:function(e,t){var n=e[t+1]>>3&3,i=e[t+1]>>1&3,a=e[t+2]>>4&15,o=e[t+2]>>2&3,s=!!(2&e[t+2]);if(1!==n&&0!==a&&15!==a&&3!==o){var u=3===n?3-i:3===i?3:4,l=1e3*r.BitratesMap[14*u+a-1],c=3===n?0:2===n?1:2,f=r.SamplingRateMap[3*c+o],d=s?1:0;return{sampleRate:f,channelCount:e[t+3]>>6==3?1:2,frameLength:3===i?(3===n?12:6)*l/f+d<<2:(3===n?144:72)*l/f+d|0}}},isHeaderPattern:function(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])},isHeader:function(e,t){return!!(t+1<e.length&&this.isHeaderPattern(e,t))},probe:function(e,t){if(t+1<e.length&&this.isHeaderPattern(e,t)){var n=this.parseHeader(e,t),r=4;n&&n.frameLength&&(r=n.frameLength);var i=t+r;if(i===e.length||i+1<e.length&&this.isHeaderPattern(e,i))return!0}return!1}};t.exports=r},{}],31:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e(19),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(){function e(t,n,i,a){r(this,e),this.decryptdata=i,this.discardEPB=a,this.decrypter=new o.default(t,n)}return i(e,[{key:"decryptBuffer",value:function(e,t){this.decrypter.decrypt(e,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,t)}},{key:"decryptAacSample",value:function(e,t,n,r){var i=e[t].unit,a=i.subarray(16,i.length-i.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),s=this;this.decryptBuffer(o,function(a){a=new Uint8Array(a),i.set(a,16),r||s.decryptAacSamples(e,t+1,n)})}},{key:"decryptAacSamples",value:function(e,t,n){for(;;t++){if(t>=e.length)return void n();if(!(e[t].unit.length<32)){var r=this.decrypter.isSync();if(this.decryptAacSample(e,t,n,r),!r)return}}}},{key:"getAvcEncryptedData",value:function(e){for(var t=16*Math.floor((e.length-48)/160)+16,n=new Int8Array(t),r=0,i=32;i<=e.length-16;i+=160,r+=16)n.set(e.subarray(i,i+16),r);return n}},{key:"getAvcDecryptedUnit",value:function(e,t){t=new Uint8Array(t);for(var n=0,r=32;r<=e.length-16;r+=160,n+=16)e.set(t.subarray(n,n+16),r);return e}},{key:"decryptAvcSample",value:function(e,t,n,r,i,a){var o=this.discardEPB(i.data),s=this.getAvcEncryptedData(o),u=this;this.decryptBuffer(s.buffer,function(s){i.data=u.getAvcDecryptedUnit(o,s),a||u.decryptAvcSamples(e,t,n+1,r)})}},{key:"decryptAvcSamples",value:function(e,t,n,r){for(;;t++,n=0){if(t>=e.length)return void r();for(var i=e[t].units;!(n>=i.length);n++){var a=i[n];if(!(a.length<=48||1!==a.type&&5!==a.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(e,t,n,r,a,o),!o)return}}}}}]),e}();n.default=s},{19:19}],32:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(22),s=r(o),u=e(30),l=r(u),c=e(35),f=r(c),d=e(26),h=r(d),p=e(31),v=r(p),g=e(54),y=e(33),m=function(){function e(t,n,r,a){i(this,e),this.observer=t,this.config=r,this.typeSupported=a,this.remuxer=n,this.sampleAes=null}return a(e,[{key:"setDecryptData",value:function(e){null!=e&&null!=e.key&&"SAMPLE-AES"===e.method?this.sampleAes=new v.default(this.observer,this.config,e,this.discardEPB):this.sampleAes=null}},{key:"resetInitSegment",value:function(e,t,n,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=t,this.videoCodec=n,this._duration=r}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(e,t,n,r){var i,a,o,s,u,l=e.length,c=!1;this.contiguous=n;var d=this.pmtParsed,h=this._avcTrack,p=this._audioTrack,v=this._id3Track,m=h.id,b=p.id,_=v.id,E=this._pmtId,T=h.pesData,w=p.pesData,k=v.pesData,S=this._parsePAT,A=this._parsePMT,O=this._parsePES,P=this._parseAVCPES.bind(this),R=this._parseAACPES.bind(this),D=this._parseMPEGPES.bind(this),x=this._parseID3PES.bind(this);for(l-=l%188,i=0;i<l;i+=188)if(71===e[i]){if(a=!!(64&e[i+1]),o=((31&e[i+1])<<8)+e[i+2],(48&e[i+3])>>4>1){if((s=i+5+e[i+4])===i+188)continue}else s=i+4;switch(o){case m:a&&(T&&(u=O(T))&&P(u,!1),T={data:[],size:0}),T&&(T.data.push(e.subarray(s,i+188)),T.size+=i+188-s);break;case b:a&&(w&&(u=O(w))&&(p.isAAC?R(u):D(u)),w={data:[],size:0}),w&&(w.data.push(e.subarray(s,i+188)),w.size+=i+188-s);break;case _:a&&(k&&(u=O(k))&&x(u),k={data:[],size:0}),k&&(k.data.push(e.subarray(s,i+188)),k.size+=i+188-s);break;case 0:a&&(s+=e[s]+1),E=this._pmtId=S(e,s);break;case E:a&&(s+=e[s]+1);var L=A(e,s,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);m=L.avc,m>0&&(h.id=m),b=L.audio,b>0&&(p.id=b,p.isAAC=L.isAAC),_=L.id3,_>0&&(v.id=_),c&&!d&&(g.logger.log("reparse from beginning"),c=!1,i=-188),d=this.pmtParsed=!0;break;case 17:case 8191:break;default:c=!0}}else this.observer.trigger(f.default.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T&&(u=O(T))?(P(u,!0),h.pesData=null):h.pesData=T,w&&(u=O(w))?(p.isAAC?R(u):D(u),p.pesData=null):(w&&w.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=w),k&&(u=O(k))?(x(u),v.pesData=null):v.pesData=k,null==this.sampleAes?this.remuxer.remux(p,h,v,this._txtTrack,t,n,r):this.decryptAndRemux(p,h,v,this._txtTrack,t,n,r)}},{key:"decryptAndRemux",value:function(e,t,n,r,i,a,o){if(e.samples&&e.isAAC){var s=this;this.sampleAes.decryptAacSamples(e.samples,0,function(){s.decryptAndRemuxAvc(e,t,n,r,i,a,o)})}else this.decryptAndRemuxAvc(e,t,n,r,i,a,o)}},{key:"decryptAndRemuxAvc",value:function(e,t,n,r,i,a,o){if(t.samples){var s=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,function(){s.remuxer.remux(e,t,n,r,i,a,o)})}else this.remuxer.remux(e,t,n,r,i,a,o)}},{key:"destroy",value:function(){this._initPTS=this._initDTS=void 0,this._duration=0}},{key:"_parsePAT",value:function(e,t){return(31&e[t+10])<<8|e[t+11]}},{key:"_parsePMT",value:function(e,t,n,r){var i,a,o,s,u={audio:-1,avc:-1,id3:-1,isAAC:!0};for(i=(15&e[t+1])<<8|e[t+2],a=t+3+i-4,o=(15&e[t+10])<<8|e[t+11],t+=12+o;t<a;){switch(s=(31&e[t+1])<<8|e[t+2],e[t]){case 207:if(!r){g.logger.log("unkown stream type:"+e[t]);break}case 15:-1===u.audio&&(u.audio=s);break;case 21:-1===u.id3&&(u.id3=s);break;case 219:if(!r){g.logger.log("unkown stream type:"+e[t]);break}case 27:-1===u.avc&&(u.avc=s);break;case 3:case 4:n?-1===u.audio&&(u.audio=s,u.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser for now");break;case 36:g.logger.warn("HEVC stream type found, not supported for now");break;default:g.logger.log("unkown stream type:"+e[t])}t+=5+((15&e[t+3])<<8|e[t+4])}return u}},{key:"_parsePES",value:function(e){var t,n,r,i,a,o,s,u,l=0,c=e.data;if(!e||0===e.size)return null;for(;c[0].length<19&&c.length>1;){var f=new Uint8Array(c[0].length+c[1].length);f.set(c[0]),f.set(c[1],c[0].length),c[0]=f,c.splice(1,1)}if(t=c[0],1===(t[0]<<16)+(t[1]<<8)+t[2]){if((r=(t[4]<<8)+t[5])&&r>e.size-6)return null;n=t[7],192&n&&(o=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,o>4294967295&&(o-=8589934592),64&n?(s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,s>4294967295&&(s-=8589934592),o-s>54e5&&(g.logger.warn(Math.round((o-s)/9e4)+"s delta between PTS and DTS, align them"),o=s)):s=o),i=t[8],u=i+9,e.size-=u,a=new Uint8Array(e.size);for(var d=0,h=c.length;d<h;d++){t=c[d];var p=t.byteLength;if(u){if(u>p){u-=p;continue}t=t.subarray(u),p-=u,u=0}a.set(t,l),l+=p}return r&&(r-=i+3),{data:a,pts:o,dts:s,len:r}}return null}},{key:"pushAccesUnit",value:function(e,t){if(e.units.length&&e.frame){var n=t.samples,r=n.length;!this.config.forceKeyFrameOnDiscontinuity||!0===e.key||t.sps&&(r||this.contiguous)?(e.id=r,n.push(e)):t.dropped++}e.debug.length&&g.logger.log(e.pts+"/"+e.dts+":"+e.debug)}},{key:"_parseAVCPES",value:function(e,t){var n,r,i,a=this,o=this._avcTrack,s=this._parseAVCNALu(e.data),u=this.avcSample,l=!1;e.data=null,s.forEach(function(t){switch(t.type){case 1:r=!0,u.frame=!0;var s=t.data;if(l&&s.length>4){var c=new h.default(s).readSliceType();2!==c&&4!==c&&7!==c&&9!==c||(u.key=!0)}break;case 5:r=!0,u||(u=a.avcSample=a._createAVCSample(!0,e.pts,e.dts,"")),u.key=!0,u.frame=!0;break;case 6:r=!0,n=new h.default(a.discardEPB(t.data)),n.readUByte();for(var f=0,d=0,p=!1,v=0;!p&&n.bytesAvailable>1;){f=0;do{v=n.readUByte(),f+=v}while(255===v);d=0;do{v=n.readUByte(),d+=v}while(255===v);if(4===f&&0!==n.bytesAvailable){p=!0;if(181===n.readUByte()){if(49===n.readUShort()){if(1195456820===n.readUInt()){if(3===n.readUByte()){var g=n.readUByte(),y=n.readUByte(),m=31&g,b=[g,y];for(i=0;i<m;i++)b.push(n.readUByte()),b.push(n.readUByte()),b.push(n.readUByte());a._insertSampleInOrder(a._txtTrack.samples,{type:3,pts:e.pts,bytes:b})}}}}}else if(d<n.bytesAvailable)for(i=0;i<d;i++)n.readUByte()}break;case 7:if(r=!0,l=!0,!o.sps){n=new h.default(t.data);var _=n.readSPS();o.width=_.width,o.height=_.height,o.pixelRatio=_.pixelRatio,o.sps=[t.data],o.duration=a._duration;var E=t.data.subarray(1,4),T="avc1.";for(i=0;i<3;i++){var w=E[i].toString(16);w.length<2&&(w="0"+w),T+=w}o.codec=T}break;case 8:r=!0,o.pps||(o.pps=[t.data]);break;case 9:r=!1,u&&a.pushAccesUnit(u,o),u=a.avcSample=a._createAVCSample(!1,e.pts,e.dts,"");break;case 12:r=!1;break;default:r=!1,u&&(u.debug+="unknown NAL "+t.type+" ")}if(u&&r){u.units.push(t)}}),t&&u&&(this.pushAccesUnit(u,o),this.avcSample=null)}},{key:"_createAVCSample",value:function(e,t,n,r){return{key:e,pts:t,dts:n,units:[],debug:r}}},{key:"_insertSampleInOrder",value:function(e,t){var n=e.length;if(n>0){if(t.pts>=e[n-1].pts)e.push(t);else for(var r=n-1;r>=0;r--)if(t.pts<e[r].pts){e.splice(r,0,t);break}}else e.push(t)}},{key:"_getLastNalUnit",value:function(){var e=this.avcSample,t=void 0;if(!e||0===e.units.length){var n=this._avcTrack,r=n.samples;e=r[r.length-1]}if(e){var i=e.units;t=i[i.length-1]}return t}},{key:"_parseAVCNALu",value:function(e){var t,n,r,i,a,o=0,s=e.byteLength,u=this._avcTrack,l=u.naluState||0,c=l,f=[],d=-1;for(-1===l&&(d=0,a=31&e[0],l=0,o=1);o<s;)if(t=e[o++],l)if(1!==l)if(t)if(1===t){if(d>=0)r={data:e.subarray(d,o-l-1),type:a},f.push(r);else{var h=this._getLastNalUnit();if(h&&(c&&o<=4-c&&h.state&&(h.data=h.data.subarray(0,h.data.byteLength-c)),(n=o-l-1)>0)){var p=new Uint8Array(h.data.byteLength+n);p.set(h.data,0),p.set(e.subarray(0,n),h.data.byteLength),h.data=p}}o<s?(i=31&e[o],d=o,a=i,l=0):l=-1}else l=0;else l=3;else l=t?0:2;else l=t?0:1;if(d>=0&&l>=0&&(r={data:e.subarray(d,s),type:a,state:l},f.push(r)),0===f.length){var v=this._getLastNalUnit();if(v){var g=new Uint8Array(v.data.byteLength+e.byteLength);g.set(v.data,0),g.set(e,v.data.byteLength),v.data=g}}return u.naluState=l,f}},{key:"discardEPB",value:function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var o=0;for(a=0;a<t;o++,a++)o===i[0]&&(o++,i.shift()),n[a]=e[o];return n}},{key:"_parseAACPES",value:function(e){var t,n,r,i,a,o=this._audioTrack,u=e.data,l=e.pts,c=this.aacOverFlow,d=this.aacLastPTS;if(c){var h=new Uint8Array(c.byteLength+u.byteLength);h.set(c,0),h.set(u,c.byteLength),u=h}for(r=0,a=u.length;r<a-1&&!s.default.isHeader(u,r);r++);if(r){var p,v;if(r<a-1?(p="AAC PES did not start with ADTS header,offset:"+r,v=!1):(p="no ADTS header found in AAC PES",v=!0),g.logger.warn("parsing error:"+p),this.observer.trigger(f.default.ERROR,{type:y.ErrorTypes.MEDIA_ERROR,details:y.ErrorDetails.FRAG_PARSING_ERROR,fatal:v,reason:p}),v)return}if(s.default.initTrackConfig(o,this.observer,u,r,this.audioCodec),n=0,t=s.default.getFrameDuration(o.samplerate),c&&d){var m=d+t;Math.abs(m-l)>1&&(g.logger.log("AAC: align PTS for overlapping frames by "+Math.round((m-l)/90)),l=m)}for(;r<a;)if(s.default.isHeader(u,r)&&r+5<a){var b=s.default.appendFrame(o,u,r,l,n);if(!b)break;r+=b.length,i=b.sample.pts,n++}else r++;c=r<a?u.subarray(r,a):null,this.aacOverFlow=c,this.aacLastPTS=i}},{key:"_parseMPEGPES",value:function(e){for(var t=e.data,n=t.length,r=0,i=0,a=e.pts;i<n;)if(l.default.isHeader(t,i)){var o=l.default.appendFrame(this._audioTrack,t,i,a,r);if(!o)break;i+=o.length,r++}else i++}},{key:"_parseID3PES",value:function(e){this._id3Track.samples.push(e)}}],[{key:"probe",value:function(e){return e.length>=564&&71===e[0]&&71===e[188]&&71===e[376]}}]),e}();n.default=m},{22:22,26:26,30:30,31:31,33:33,35:35,54:54}],33:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},n.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(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(54),s=e(33),u=e(35),l=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(){function e(t){r(this,e),this.hls=t,this.onEvent=this.onEvent.bind(this);for(var n=arguments.length,i=Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];this.handledEvents=i,this.useGenericHandler=!0,this.registerListeners()}return a(e,[{key:"destroy",value:function(){this.unregisterListeners()}},{key:"isEventHandler",value:function(){return"object"===i(this.handledEvents)&&this.handledEvents.length&&"function"==typeof this.onEvent}},{key:"registerListeners",value:function(){this.isEventHandler()&&this.handledEvents.forEach(function(e){if("hlsEventGeneric"===e)throw new Error("Forbidden event name: "+e);this.hls.on(e,this.onEvent)},this)}},{key:"unregisterListeners",value:function(){this.isEventHandler()&&this.handledEvents.forEach(function(e){this.hls.off(e,this.onEvent)},this)}},{key:"onEvent",value:function(e,t){this.onEventGeneric(e,t)}},{key:"onEventGeneric",value:function(e,t){var n=function(e,t){var n="on"+e.replace("hls","");if("function"!=typeof this[n])throw new Error("Event "+e+" has no generic handler in this "+this.constructor.name+" class (tried "+n+")");return this[n].bind(this,t)};try{n.call(this,e,t).call()}catch(t){o.logger.error("internal error happened while processing "+e+":"+t.message),this.hls.trigger(l.default.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:e,err:t})}}}]),e}();n.default=c},{33:33,35:35,54:54}],35:[function(e,t,n){"use strict";t.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(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(){r(this,e)}return i(e,null,[{key:"getSilentFrame",value:function(e,t){switch(e){case"mp4a.40.2":if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)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===t)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===t)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===t)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===t)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}}]),e}();n.default=a},{}],37:[function(e,t,n){"use strict";var r={isBuffered:function(e,t){if(e)for(var n=e.buffered,r=0;r<n.length;r++)if(t>=n.start(r)&&t<=n.end(r))return!0;return!1},bufferInfo:function(e,t,n){if(e){var r,i=e.buffered,a=[];for(r=0;r<i.length;r++)a.push({start:i.start(r),end:i.end(r)});return this.bufferedInfo(a,t,n)}return{len:0,start:t,end:t,nextStart:void 0}},bufferedInfo:function(e,t,n){var r,i,a,o,s,u=[];for(e.sort(function(e,t){var n=e.start-t.start;return n||t.end-e.end}),s=0;s<e.length;s++){var l=u.length;if(l){var c=u[l-1].end;e[s].start-c<n?e[s].end>c&&(u[l-1].end=e[s].end):u.push(e[s])}else u.push(e[s])}for(s=0,r=0,i=a=t;s<u.length;s++){var f=u[s].start,d=u[s].end;if(t+n>=f&&t<d)i=f,a=d,r=a-t;else if(t+n<f){o=f;break}}return{len:r,start:i,end:a,nextStart:o}}};t.exports=r},{}],38:[function(e,t,n){"use strict";var r=e(54),i={mergeDetails:function(e,t){var n,a=Math.max(e.startSN,t.startSN)-t.startSN,o=Math.min(e.endSN,t.endSN)-t.startSN,s=t.startSN-e.startSN,u=e.fragments,l=t.fragments,c=0;if(o<a)return void(t.PTSKnown=!1);for(var f=a;f<=o;f++){var d=u[s+f],h=l[f];h&&d&&(c=d.cc-h.cc,isNaN(d.startPTS)||(h.start=h.startPTS=d.startPTS,h.endPTS=d.endPTS,h.duration=d.duration,h.backtracked=d.backtracked,h.dropped=d.dropped,n=h))}if(c)for(r.logger.log("discontinuity sliding from playlist, take drift into account"),f=0;f<l.length;f++)l[f].cc+=c;if(n)i.updateFragPTSDTS(t,n,n.startPTS,n.endPTS,n.startDTS,n.endDTS);else if(s>=0&&s<u.length){var p=u[s].start;for(f=0;f<l.length;f++)l[f].start+=p}t.PTSKnown=e.PTSKnown},updateFragPTSDTS:function(e,t,n,r,a,o){var s=n;if(!isNaN(t.startPTS)){var u=Math.abs(t.startPTS-n);isNaN(t.deltaPTS)?t.deltaPTS=u:t.deltaPTS=Math.max(u,t.deltaPTS),s=Math.max(n,t.startPTS),n=Math.min(n,t.startPTS),r=Math.max(r,t.endPTS),a=Math.min(a,t.startDTS),o=Math.max(o,t.endDTS)}var l=n-t.start;t.start=t.startPTS=n,t.maxStartPTS=s,t.endPTS=r,t.startDTS=a,t.endDTS=o,t.duration=r-n;var c=t.sn;if(!e||c<e.startSN||c>e.endSN)return 0;var f,d,h;for(f=c-e.startSN,d=e.fragments,t=d[f],h=f;h>0;h--)i.updatePTS(d,h,h-1);for(h=f;h<d.length-1;h++)i.updatePTS(d,h,h+1);return e.PTSKnown=!0,l},updatePTS:function(e,t,n){var i=e[t],a=e[n],o=a.startPTS;isNaN(o)?a.start=n>t?i.start+i.duration:Math.max(i.start-a.duration,0):n>t?(i.duration=o-i.start,i.duration<0&&r.logger.warn("negative duration computed for frag "+i.sn+",level "+i.level+", there should be some duration drift between playlist and fragment!")):(a.duration=i.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!"))}};t.exports=i},{54:54}],39:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(2),s=r(o),u=e(35),l=r(u),c=e(33),f=e(43),d=r(f),h=e(41),p=r(h),v=e(42),g=r(v),y=e(13),m=r(y),b=e(12),_=r(b),E=e(11),T=r(E),w=e(54),k=e(1),S=r(k),A=e(4),O=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var r=e.DefaultConfig;if((n.liveSyncDurationCount||n.liveMaxLatencyDurationCount)&&(n.liveSyncDuration||n.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var a in r)a in n||(n[a]=r[a]);if(void 0!==n.liveMaxLatencyDurationCount&&n.liveMaxLatencyDurationCount<=n.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==n.liveMaxLatencyDuration&&(n.liveMaxLatencyDuration<=n.liveSyncDuration||void 0===n.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');(0,w.enableLogs)(n.debug),this.config=n,this._autoLevelCapping=-1;var o=this.observer=new S.default;o.trigger=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e,e].concat(n))},o.off=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.removeListener.apply(o,[e].concat(n))},this.on=o.on.bind(o),this.off=o.off.bind(o),this.trigger=o.trigger.bind(o);var s=this.abrController=new n.abrController(this),u=new n.bufferController(this),l=new n.capLevelController(this),c=new n.fpsController(this),f=new d.default(this),h=new p.default(this),v=new g.default(this),y=new T.default(this),b=this.levelController=new _.default(this),E=this.streamController=new m.default(this),k=[b,E],A=n.audioStreamController;A&&k.push(new A(this)),this.networkControllers=k;var O=[f,h,v,s,u,l,c,y];if(A=n.audioTrackController){var P=new A(this);this.audioTrackController=P,O.push(P)}if(A=n.subtitleTrackController){var R=new A(this);this.subtitleTrackController=R,O.push(R)}[n.subtitleStreamController,n.timelineController].forEach(function(e){e&&O.push(new e(t))}),this.coreComponents=O}return a(e,null,[{key:"isSupported",value:function(){var e=window.MediaSource=window.MediaSource||window.WebKitMediaSource,t=window.SourceBuffer=window.SourceBuffer||window.WebKitSourceBuffer,n=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return n&&r}},{key:"version",get:function(){return"0.7.10"}},{key:"Events",get:function(){return l.default}},{key:"ErrorTypes",get:function(){return c.ErrorTypes}},{key:"ErrorDetails",get:function(){return c.ErrorDetails}},{key:"DefaultConfig",get:function(){return e.defaultConfig?e.defaultConfig:A.hlsDefaultConfig},set:function(t){e.defaultConfig=t}}]),a(e,[{key:"destroy",value:function(){w.logger.log("destroy"),this.trigger(l.default.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach(function(e){e.destroy()}),this.url=null,this.observer.removeAllListeners(),this._autoLevelCapping=-1}},{key:"attachMedia",value:function(e){w.logger.log("attachMedia"),this.media=e,this.trigger(l.default.MEDIA_ATTACHING,{media:e})}},{key:"detachMedia",value:function(){w.logger.log("detachMedia"),this.trigger(l.default.MEDIA_DETACHING),this.media=null}},{key:"loadSource",value:function(e){e=s.default.buildAbsoluteURL(window.location.href,e,{alwaysNormalize:!0}),w.logger.log("loadSource:"+e),this.url=e,this.trigger(l.default.MANIFEST_LOADING,{url:e})}},{key:"startLoad",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;w.logger.log("startLoad("+e+")"),this.networkControllers.forEach(function(t){t.startLoad(e)})}},{key:"stopLoad",value:function(){w.logger.log("stopLoad"),this.networkControllers.forEach(function(e){e.stopLoad()})}},{key:"swapAudioCodec",value:function(){w.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){w.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){w.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){w.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){w.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){w.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){w.logger.log("set startLevel:"+e);var t=this;-1!==e&&(e=Math.max(e,t.minAutoLevel)),t.levelController.startLevel=e}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){w.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var e=this,t=e.levels,n=e.config.minAutoBitrate,r=t?t.length:0,i=0;i<r;i++){if((t[i].realBitrate?Math.max(t[i].realBitrate,t[i].bitrate):t[i].bitrate)>n)return i}return 0}},{key:"maxAutoLevel",get:function(){var e=this,t=e.levels,n=e.autoLevelCapping;return-1===n&&t&&t.length?t.length-1:n}},{key:"nextAutoLevel",get:function(){var e=this;return Math.min(Math.max(e.abrController.nextAutoLevel,e.minAutoLevel),e.maxAutoLevel)},set:function(e){var t=this;t.abrController.nextAutoLevel=Math.max(t.minAutoLevel,e)}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}}]),e}();n.default=O},{1:1,11:11,12:12,13:13,2:2,33:33,35:35,4:4,41:41,42:42,43:43,54:54}],40:[function(e,t,n){"use strict";t.exports=e(39).default},{39:39}],41:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(33),h=e(54),p=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.FRAG_LOADING));return n.loaders={},n}return o(t,e),s(t,[{key:"destroy",value:function(){var e=this.loaders;for(var t in e){var n=e[t];n&&n.destroy()}this.loaders={},f.default.prototype.destroy.call(this)}},{key:"onFragLoading",value:function(e){var t=e.frag,n=t.type,r=this.loaders[n],i=this.hls.config;t.loaded=0,r&&(h.logger.warn("abort previous fragment loader for type:"+n),r.abort()),r=this.loaders[n]=t.loader=void 0!==i.fLoader?new i.fLoader(i):new i.loader(i);var a=void 0,o=void 0,s=void 0;a={url:t.url,frag:t,responseType:"arraybuffer",progressData:!1};var u=t.byteRangeStartOffset,l=t.byteRangeEndOffset;isNaN(u)||isNaN(l)||(a.rangeStart=u,a.rangeEnd=l),o={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:i.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(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e.data,a=n.frag;a.loader=void 0,this.loaders[a.type]=void 0,this.hls.trigger(l.default.FRAG_LOADED,{payload:i,frag:a,stats:t,networkDetails:r})}},{key:"loaderror",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.loader;r&&r.abort(),this.loaders[t.type]=void 0,this.hls.trigger(l.default.ERROR,{type:d.ErrorTypes.NETWORK_ERROR,details:d.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t.frag,response:e,networkDetails:n})}},{key:"loadtimeout",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.loader;r&&r.abort(),this.loaders[t.type]=void 0,this.hls.trigger(l.default.ERROR,{type:d.ErrorTypes.NETWORK_ERROR,details:d.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t.frag,networkDetails:n})}},{key:"loadprogress",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=t.frag;i.loaded=e.loaded,this.hls.trigger(l.default.FRAG_LOAD_PROGRESS,{frag:i,stats:e,networkDetails:r})}}]),t}(f.default);n.default=p},{33:33,34:34,35:35,54:54}],42:[function(e,t,n){"use strict";function r(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(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(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(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(35),l=r(u),c=e(34),f=r(c),d=e(33),h=e(54),p=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,l.default.KEY_LOADING));return n.loaders={},n.decryptkey=null,n.decrypturl=null,n}return o(t,e),s(t,[{key:"destroy",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},f.default.prototype.destroy.call(this)}},{key:"onKeyLoading",value:function(e){var t=e.frag,n=t.type,r=this.loaders[n],i=t.decryptdata,a=i.uri;if(a!==this.decrypturl||null===this.decryptkey){var o=this.hls.config;r&&(h.logger.warn("abort previous key loader for type:"+n),r.abort()),t.loader=this.loaders[n]=new o.loader(o),this.decrypturl=a,this.decryptkey=null;var s=void 0,u=void 0,c=void 0;s={url:a,frag:t,responseType:"arraybuffer"},u={timeout:o.fragLoadingTimeOut,maxRetry:o.fragLoadingMaxRetry,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},t.loader.load(s,u,c)}else this.decryptkey&&(i.key=this.decryptkey,this.hls.trigger(l.default.KEY_LOADED,{frag:t}))}},{key:"loadsuccess",value:function(e,t,n){var r=n.frag;this.decryptkey=r.decryptdata.key=new Uint8Array(e.data),r.loader=void 0,this.loaders[r.type]=void 0,this.hls.trigger(l.default.KEY_LOADED,{frag:r})}},{key:"loaderror",value:function(e,t){var n=t.frag,r=n.loader;r&&r.abort(),this.loaders[t.type]=void 0,this.hls.trigger(l.default.ERROR,{type:d.ErrorTypes.NETWORK_ERROR,details:d.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:n,response:e})}},{key:"loadtimeout",value:function(e,t){var n=t.frag,r=n.loader;r&&r.abort(),this.loaders[t.type]=void 0,this.hls.trigger(l.default.ERROR,{type:d.ErrorTypes.NETWORK_ERROR,details:d.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:n})}}]),t}(f.default);n.default=p},{33:33,34:34,35:35,54:54}],43:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(2),l=r(u),c=e(35),f=r(c),d=e(34),h=r(d),p=e(33),v=e(47),g=r(v),y=e(54),m=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,b=/#EXT-X-MEDIA:(.*)/g,_=new RegExp([/#EXTINF:(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)(\S+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"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 e(){o(this,e),this.method=null,this.key=null,this.iv=null,this._uri=null}return s(e,[{key:"uri",get:function(){return!this._uri&&this.reluri&&(this._uri=l.default.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri}}]),e}(),w=function(){function e(){o(this,e),this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[]}return s(e,[{key:"createInitializationVector",value:function(e){for(var t=new Uint8Array(16),n=12;n<16;n++)t[n]=e>>8*(15-n)&255;return t}},{key:"fragmentDecryptdataFromLevelkey",value:function(e,t){var n=e;return e&&e.method&&e.uri&&!e.iv&&(n=new T,n.method=e.method,n.baseuri=e.baseuri,n.reluri=e.reluri,n.iv=this.createInitializationVector(t)),n}},{key:"cloneObj",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=l.default.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(e){this._url=e}},{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 e=this._byteRange=[];if(this.rawByteRange){var t=this.rawByteRange.split("@",2);if(1===t.length){var n=this.lastByteRangeEndOffset;e[0]=n||0}else e[0]=parseInt(t[1]);e[1]=parseInt(t[0])+e[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}}]),e}(),k=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,f.default.MANIFEST_LOADING,f.default.LEVEL_LOADING,f.default.AUDIO_TRACK_LOADING,f.default.SUBTITLE_TRACK_LOADING));return n.loaders={},n}return a(t,e),s(t,[{key:"destroy",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},h.default.prototype.destroy.call(this)}},{key:"onManifestLoading",value:function(e){this.load(e.url,{type:"manifest"})}},{key:"onLevelLoading",value:function(e){this.load(e.url,{type:"level",level:e.level,id:e.id})}},{key:"onAudioTrackLoading",value:function(e){this.load(e.url,{type:"audioTrack",id:e.id})}},{key:"onSubtitleTrackLoading",value:function(e){this.load(e.url,{type:"subtitleTrack",id:e.id})}},{key:"load",value:function(e,t){var n=this.loaders[t.type];if(n){var r=n.context;if(r&&r.url===e)return void y.logger.trace("playlist request ongoing");y.logger.warn("abort previous loader for type:"+t.type),n.abort()}var i=this.hls.config,a=void 0,o=void 0,s=void 0,u=void 0;"manifest"===t.type?(a=i.manifestLoadingMaxRetry,o=i.manifestLoadingTimeOut,s=i.manifestLoadingRetryDelay,u=i.manifestLoadingMaxRetryTimeout):(a=i.levelLoadingMaxRetry,o=i.levelLoadingTimeOut,s=i.levelLoadingRetryDelay,u=i.levelLoadingMaxRetryTimeout,y.logger.log("loading playlist for "+t.type+" "+(t.level||t.id))),n=this.loaders[t.type]=t.loader=void 0!==i.pLoader?new i.pLoader(i):new i.loader(i),t.url=e,t.responseType="";var l=void 0,c=void 0;l={timeout:o,maxRetry:a,retryDelay:s,maxRetryDelay:u},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},n.load(t,l,c)}},{key:"resolve",value:function(e,t){return l.default.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}},{key:"parseMasterPlaylist",value:function(e,t){var n=[],r=void 0;for(m.lastIndex=0;null!=(r=m.exec(e));){var i={},a=i.attrs=new g.default(r[1]);i.url=this.resolve(r[2],t);var o=a.decimalResolution("RESOLUTION");o&&(i.width=o.width,i.height=o.height),i.bitrate=a.decimalInteger("AVERAGE-BANDWIDTH")||a.decimalInteger("BANDWIDTH"),i.name=a.NAME;var s=a.CODECS;if(s){s=s.split(/[ ,]+/);for(var u=0;u<s.length;u++){var l=s[u];-1!==l.indexOf("avc1")?i.videoCodec=this.avc1toavcoti(l):-1!==l.indexOf("hvc1")?i.videoCodec=l:i.audioCodec=l}}n.push(i)}return n}},{key:"parseMasterPlaylistMedia",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=void 0,a=[],o=0;for(b.lastIndex=0;null!=(i=b.exec(e));){var s={},u=new g.default(i[1]);u.TYPE===n&&(s.groupId=u["GROUP-ID"],s.name=u.NAME,s.type=n,s.default="YES"===u.DEFAULT,s.autoselect="YES"===u.AUTOSELECT,s.forced="YES"===u.FORCED,u.URI&&(s.url=this.resolve(u.URI,t)),s.lang=u.LANGUAGE,s.name||(s.name=s.lang),r&&(s.audioCodec=r),s.id=o++,a.push(s))}return a}},{key:"avc1toavcoti",value:function(e){var t,n=e.split(".");return n.length>2?(t=n.shift()+".",t+=parseInt(n.shift()).toString(16),t+=("000"+parseInt(n.shift()).toString(16)).substr(-4)):t=e,t}},{key:"parseLevelPlaylist",value:function(e,t,n,r){var i,a,o=0,s=0,u={type:null,version:null,url:t,fragments:[],live:!0,startSN:0},l=new T,c=0,f=null,d=new w;for(_.lastIndex=0;null!==(i=_.exec(e));){var h=i[1];if(h){d.duration=parseFloat(h);var p=(" "+i[2]).slice(1);d.title=p||null,d.tagList.push(p?["INF",h,p]:["INF",h])}else if(i[3]){if(!isNaN(d.duration)){var v=o++;d.type=r,d.start=s,d.levelkey=l,d.sn=v,d.level=n,d.cc=c,d.baseurl=t,d.relurl=(" "+i[3]).slice(1),u.fragments.push(d),f=d,s+=d.duration,d=new w}}else if(i[4]){if(d.rawByteRange=(" "+i[4]).slice(1),f){var m=f.byteRangeEndOffset;m&&(d.lastByteRangeEndOffset=m)}}else if(i[5])d.rawProgramDateTime=(" "+i[5]).slice(1),d.tagList.push(["PROGRAM-DATE-TIME",d.rawProgramDateTime]);else{for(i=i[0].match(E),a=1;a<i.length&&void 0===i[a];a++);var b=(" "+i[a+1]).slice(1),k=(" "+i[a+2]).slice(1);switch(i[a]){case"#":d.tagList.push(k?[b,k]:[b]);break;case"PLAYLIST-TYPE":u.type=b.toUpperCase();break;case"MEDIA-SEQUENCE":o=u.startSN=parseInt(b);break;case"TARGETDURATION":u.targetduration=parseFloat(b);break;case"VERSION":u.version=parseInt(b);break;case"EXTM3U":break;case"ENDLIST":u.live=!1;break;case"DIS":c++,d.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":c=parseInt(b);break;case"KEY":var S=b,A=new g.default(S),O=A.enumeratedString("METHOD"),P=A.URI,R=A.hexadecimalInteger("IV");O&&(l=new T,P&&["AES-128","SAMPLE-AES"].indexOf(O)>=0&&(l.method=O,l.baseuri=t,l.reluri=P,l.key=null,l.iv=R));break;case"START":var D=b,x=new g.default(D),L=x.decimalFloatingPoint("TIME-OFFSET");isNaN(L)||(u.startTimeOffset=L);break;case"MAP":var I=new g.default(b);d.relurl=I.URI,d.rawByteRange=I.BYTERANGE,d.baseurl=t,d.level=n,d.type=r,d.sn="initSegment",u.initSegment=d,d=new w;break;default:y.logger.warn("line parsed but not handled: "+i)}}}return d=f,d&&!d.relurl&&(u.fragments.pop(),s-=d.duration),u.totalduration=s,u.averagetargetduration=s/u.fragments.length,u.endSN=o-1,u}},{key:"loadsuccess",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e.data,a=e.url,o=n.type,s=n.id,u=n.level,l=this.hls;if(this.loaders[o]=void 0,void 0!==a&&0!==a.indexOf("data:")||(a=n.url),t.tload=performance.now(),0===i.indexOf("#EXTM3U"))if(i.indexOf("#EXTINF:")>0){var c="audioTrack"!==o&&"subtitleTrack"!==o,d=isNaN(u)?isNaN(s)?0:s:u,h=this.parseLevelPlaylist(i,a,d,"audioTrack"===o?"audio":"subtitleTrack"===o?"subtitle":"main");h.tload=t.tload,"manifest"===o&&l.trigger(f.default.MANIFEST_LOADED,{levels:[{url:a,details:h}],audioTracks:[],url:a,stats:t,networkDetails:r}),t.tparsed=performance.now(),h.targetduration?c?l.trigger(f.default.LEVEL_LOADED,{details:h,level:u||0,id:s||0,stats:t,networkDetails:r}):"audioTrack"===o?l.trigger(f.default.AUDIO_TRACK_LOADED,{details:h,id:s,stats:t,networkDetails:r}):"subtitleTrack"===o&&l.trigger(f.default.SUBTITLE_TRACK_LOADED,{details:h,id:s,stats:t,networkDetails:r}):l.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"invalid targetduration",networkDetails:r})}else{var v=this.parseMasterPlaylist(i,a);if(v.length){var g=this.parseMasterPlaylistMedia(i,a,"AUDIO",v[0].audioCodec),m=this.parseMasterPlaylistMedia(i,a,"SUBTITLES");if(g.length){var b=!1;g.forEach(function(e){e.url||(b=!0)}),!1===b&&v[0].audioCodec&&!v[0].attrs.AUDIO&&(y.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main"}))}l.trigger(f.default.MANIFEST_LOADED,{levels:v,audioTracks:g,subtitles:m,url:a,stats:t,networkDetails:r})}else l.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no level found in manifest",networkDetails:r})}else l.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no EXTM3U delimiter",networkDetails:r})}},{key:"loaderror",value:function(e,t){var n,r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=t.loader;switch(t.type){case"manifest":n=p.ErrorDetails.MANIFEST_LOAD_ERROR,r=!0;break;case"level":n=p.ErrorDetails.LEVEL_LOAD_ERROR,r=!1;break;case"audioTrack":n=p.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,r=!1}a&&(a.abort(),this.loaders[t.type]=void 0),this.hls.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:n,fatal:r,url:a.url,loader:a,response:e,context:t,networkDetails:i})}},{key:"loadtimeout",value:function(e,t){var n,r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=t.loader;switch(t.type){case"manifest":n=p.ErrorDetails.MANIFEST_LOAD_TIMEOUT,r=!0;break;case"level":n=p.ErrorDetails.LEVEL_LOAD_TIMEOUT,r=!1;break;case"audioTrack":n=p.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT,r=!1}a&&(a.abort(),this.loaders[t.type]=void 0),this.hls.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:n,fatal:r,url:a.url,loader:a,context:t,networkDetails:i})}}]),t}(h.default);n.default=k},{2:2,33:33,34:34,35:35,47:47,54:54}],44:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=Math.pow(2,32)-1,o=function(){function e(){r(this,e)}return i(e,null,[{key:"init",value:function(){e.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 t;for(t in e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var n=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]);e.HDLR_TYPES={video:n,audio:r};var i=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]);e.STTS=e.STSC=e.STCO=a,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.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]),u=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,o,u,o,s),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,i))}},{key:"box",value:function(e){for(var t,n=Array.prototype.slice.call(arguments,1),r=8,i=n.length,a=i;i--;)r+=n[i].byteLength;for(t=new Uint8Array(r),t[0]=r>>24&255,t[1]=r>>16&255,t[2]=r>>8&255,t[3]=255&r,t.set(e,4),i=0,r=8;i<a;i++)t.set(n[i],r),r+=n[i].byteLength;return t}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}},{key:"mdhd",value:function(t,n){n*=t;var r=Math.floor(n/(a+1)),i=Math.floor(n%(a+1));return e.box(e.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"minf",value:function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}},{key:"moof",value:function(t,n,r){return e.box(e.types.moof,e.mfhd(t),e.traf(r,n))}},{key:"moov",value:function(t){for(var n=t.length,r=[];n--;)r[n]=e.trak(t[n]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(r).concat(e.mvex(t)))}},{key:"mvex",value:function(t){for(var n=t.length,r=[];n--;)r[n]=e.trex(t[n]);return e.box.apply(null,[e.types.mvex].concat(r))}},{key:"mvhd",value:function(t,n){n*=t;var r=Math.floor(n/(a+1)),i=Math.floor(n%(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,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e.box(e.types.mvhd,o)}},{key:"sdtp",value:function(t){var n,r,i=t.samples||[],a=new Uint8Array(4+i.length);for(r=0;r<i.length;r++)n=i[r].flags,a[r+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return e.box(e.types.sdtp,a)}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))}},{key:"avc1",value:function(t){var n,r,i,a=[],o=[];for(n=0;n<t.sps.length;n++)r=t.sps[n],i=r.byteLength,a.push(i>>>8&255),a.push(255&i),a=a.concat(Array.prototype.slice.call(r));for(n=0;n<t.pps.length;n++)r=t.pps[n],i=r.byteLength,o.push(i>>>8&255),o.push(255&i),o=o.concat(Array.prototype.slice.call(r));var s=e.box(e.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|t.sps.length].concat(a).concat([t.pps.length]).concat(o))),u=t.width,l=t.height,c=t.pixelRatio[0],f=t.pixelRatio[1];return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,u>>8&255,255&u,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,f>>24,f>>16&255,f>>8&255,255&f])))}},{key:"esds",value:function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}},{key:"mp4a",value:function(t){var n=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,n>>8&255,255&n,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"mp3",value:function(t){var n=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,n>>8&255,255&n,0,0]))}},{key:"stsd",value:function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){var n=t.id,r=t.duration*t.timescale,i=t.width,o=t.height,s=Math.floor(r/(a+1)),u=Math.floor(r%(a+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,255&n,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,u>>24,u>>16&255,u>>8&255,255&u,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,i>>8&255,255&i,0,0,o>>8&255,255&o,0,0]))}},{key:"traf",value:function(t,n){var r=e.sdtp(t),i=t.id,o=Math.floor(n/(a+1)),s=Math.floor(n%(a+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),e.box(e.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])),e.trun(t,r.length+16+20+8+16+8+8),r)}},{key:"trak",value:function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"trex",value:function(t){var n=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(t,n){var r,i,a,o,s,u,l=t.samples||[],c=l.length,f=12+16*c,d=new Uint8Array(f);for(n+=8+f,d.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,255&c,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0),r=0;r<c;r++)i=l[r],a=i.duration,o=i.size,s=i.flags,u=i.cts,d.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,u>>>24&255,u>>>16&255,u>>>8&255,255&u],12+16*r);return e.box(e.types.trun,d)}},{key:"initSegment",value:function(t){e.types||e.init();var n,r=e.moov(t);return n=new Uint8Array(e.FTYP.byteLength+r.byteLength),n.set(e.FTYP),n.set(r,e.FTYP.byteLength),n}}]),e}();n.default=o},{}],45:[function(e,t,n){"use strict";function r(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")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e(36),s=r(o),u=e(35),l=r(u),c=e(54),f=e(44),d=r(f),h=e(33),p=function(){function e(t,n,r,a){i(this,e),this.observer=t,this.config=n,this.typeSupported=r;var o=navigator.userAgent;this.isSafari=a&&a.indexOf("Apple")>-1&&o&&!o.match("CriOS"),this.ISGenerated=!1}return a(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(e){this._initPTS=this._initDTS=e}},{key:"resetInitSegment",value:function(){this.ISGenerated=!1}},{key:"remux",value:function(e,t,n,r,i,a,o){if(this.ISGenerated){if(o){var s=this._initPTS,u=this._PTSNormalize,f=e.inputTimeScale||t.inputTimeScale,d=1/0,h=1/0,p=e.samples;if(p.length&&(d=h=u(p[0].pts-f*i,s)),p=t.samples,p.length){var v=p[0];d=Math.min(d,u(v.pts-f*i,s)),h=Math.min(h,u(v.dts-f*i,s))}if(d!==1/0){var g=s-d;Math.abs(g)>10*f&&(c.logger.warn("timestamp inconsistency, "+(g/f).toFixed(3)+"s delta against expected value: missing discontinuity ? reset initPTS/initDTS"),this._initPTS=d,this._initDTS=h,this.observer.trigger(l.default.INIT_PTS_FOUND,{initPTS:d}))}}}else this.generateIS(e,t,i);if(this.ISGenerated)if(e.samples.length){e.timescale||(c.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(e,t,i));var y=this.remuxAudio(e,i,a,o);if(t.samples.length){var m=void 0;y&&(m=y.endPTS-y.startPTS),t.timescale||(c.logger.warn("regenerate InitSegment as video detected"),this.generateIS(e,t,i)),this.remuxVideo(t,i,a,m,o)}}else{var b=void 0;t.samples.length&&(b=this.remuxVideo(t,i,a,o)),b&&e.codec&&this.remuxEmptyAudio(e,i,a,b)}n.samples.length&&this.remuxID3(n,i),r.samples.length&&this.remuxText(r,i),this.observer.trigger(l.default.FRAG_PARSED)}},{key:"generateIS",value:function(e,t,n){var r,i,a=this.observer,o=e.samples,s=t.samples,u=this.typeSupported,f="audio/mp4",p={},v={tracks:p},g=void 0===this._initPTS;if(g&&(r=i=1/0),e.config&&o.length&&(e.timescale=e.samplerate,c.logger.log("audio sampling rate : "+e.samplerate),e.isAAC||(u.mpeg?(f="audio/mpeg",e.codec=""):u.mp3&&(e.codec="mp3")),p.audio={container:f,codec:e.codec,initSegment:!e.isAAC&&u.mpeg?new Uint8Array:d.default.initSegment([e]),metadata:{channelCount:e.channelCount}},g&&(r=i=o[0].pts-e.inputTimeScale*n)),t.sps&&t.pps&&s.length){var y=t.inputTimeScale;t.timescale=y,p.video={container:"video/mp4",codec:t.codec,initSegment:d.default.initSegment([t]),metadata:{width:t.width,height:t.height}},g&&(r=Math.min(r,s[0].pts-y*n),i=Math.min(i,s[0].dts-y*n),this.observer.trigger(l.default.INIT_PTS_FOUND,{initPTS:r}))}Object.keys(p).length?(a.trigger(l.default.FRAG_PARSING_INIT_SEGMENT,v),this.ISGenerated=!0,g&&(this._initPTS=r,this._initDTS=i)):a.trigger(l.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(e,t,n,r,i){var a,o,s,u,f,p,v,g=8,y=e.timescale,m=e.samples,b=[],_=m.length,E=this._PTSNormalize,T=this._initDTS,w=this.nextAvcDts,k=this.isSafari;k&&(n|=m.length&&w&&(i&&Math.abs(t-w/y)<.1||Math.abs(m[0].pts-w-T)<y/5)),n||(w=t*y),m.forEach(function(e){e.pts=E(e.pts-T,w),e.dts=E(e.dts-T,w)}),m.sort(function(e,t){var n=e.dts-t.dts,r=e.pts-t.pts;return n||(r||e.id-t.id)});var S=m.reduce(function(e,t){return Math.max(Math.min(e,t.pts-t.dts),-18e3)},0);if(S<0){c.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(S/90)+" ms to overcome this issue");for(var A=0;A<m.length;A++)m[A].dts+=S}var O=m[0];f=Math.max(O.dts,0),u=Math.max(O.pts,0);var P=Math.round((f-w)/90);n&&P&&(P>1?c.logger.log("AVC:"+P+" ms hole between fragments detected,filling it"):P<-1&&c.logger.log("AVC:"+-P+" ms overlapping between fragments detected"),f=w,m[0].dts=f,u=Math.max(u-P,w),m[0].pts=u,c.logger.log("Video/PTS/DTS adjusted: "+Math.round(u/90)+"/"+Math.round(f/90)+",delta:"+P+" ms")),O=m[m.length-1],v=Math.max(O.dts,0),p=Math.max(O.pts,0,v),k&&(a=Math.round((v-f)/(m.length-1)));for(var R=0,D=0,x=0;x<_;x++){for(var L=m[x],I=L.units,M=I.length,C=0,N=0;N<M;N++)C+=I[N].data.length;D+=C,R+=M,L.length=C,L.dts=k?f+x*a:Math.max(L.dts,f),L.pts=Math.max(L.pts,L.dts)}var U=D+4*R+8;try{o=new Uint8Array(U)}catch(e){return void this.observer.trigger(l.default.ERROR,{type:h.ErrorTypes.MUX_ERROR,details:h.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:U,reason:"fail allocating video mdat "+U})}var j=new DataView(o.buffer);j.setUint32(0,U),o.set(d.default.types.mdat,4);for(var F=0;F<_;F++){for(var B=m[F],G=B.units,V=0,H=void 0,K=0,Y=G.length;K<Y;K++){var W=G[K],q=W.data,z=W.data.byteLength;j.setUint32(g,z),g+=4,o.set(q,g),g+=z,V+=4+z}if(k)H=Math.max(0,a*Math.round((B.pts-B.dts)/a));else{if(F<_-1)a=m[F+1].dts-B.dts;else{var X=this.config,$=B.dts-m[F>0?F-1:F].dts;if(X.stretchShortVideoTrack){var J=X.maxBufferHole,Q=X.maxSeekHole,Z=Math.floor(Math.min(J,Q)*y),ee=(r?u+r*y:this.nextAudioPts)-B.pts;ee>Z?(a=ee-$,a<0&&(a=$),c.logger.log("It is approximately "+ee/90+" ms to the next segment; using duration "+a/90+" ms for the last video frame.")):a=$}else a=$}H=Math.round(B.pts-B.dts)}b.push({size:V,duration:a,cts:H,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:B.key?2:1,isNonSync:B.key?0:1}})}this.nextAvcDts=v+a;var te=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,b.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var ne=b[0].flags;ne.dependsOn=2,ne.isNonSync=0}e.samples=b,s=d.default.moof(e.sequenceNumber++,f,e),e.samples=[];var re={data1:s,data2:o,startPTS:u/y,endPTS:(p+a)/y,startDTS:f/y,endDTS:this.nextAvcDts/y,type:"video",nb:b.length,dropped:te};return this.observer.trigger(l.default.FRAG_PARSING_DATA,re),re}},{key:"remuxAudio",value:function(e,t,n,r){var i,a,o,u,f,p,v,g=e.inputTimeScale,y=e.timescale,m=g/y,b=e.isAAC?1024:1152,_=b*m,E=this._PTSNormalize,T=this._initDTS,w=!e.isAAC&&this.typeSupported.mpeg,k=e.samples,S=[],A=this.nextAudioPts;if(n|=k.length&&A&&(r&&Math.abs(t-A/g)<.1||Math.abs(k[0].pts-A-T)<20*_),n||(A=t*g),k.forEach(function(e){e.pts=e.dts=E(e.pts-T,A)}),k.sort(function(e,t){return e.pts-t.pts}),r&&e.isAAC)for(var O=0,P=A;O<k.length;){var R,D=k[O],x=D.pts;R=x-P;var L=Math.abs(1e3*R/g);if(R<=-_)c.logger.warn("Dropping 1 audio frame @ "+(P/g).toFixed(3)+"s due to "+L+" ms overlap."),k.splice(O,1),e.len-=D.unit.length;else if(R>=_&&L<1e4&&P){var I=Math.round(R/_);c.logger.warn("Injecting "+I+" audio frame @ "+(P/g).toFixed(3)+"s due to "+Math.round(1e3*R/g)+" ms gap.");for(var M=0;M<I;M++){var C=Math.max(P,0);o=s.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount),o||(c.logger.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),o=D.unit.subarray()),k.splice(O,0,{unit:o,pts:C,dts:C}),e.len+=o.length,P+=_,O++}D.pts=D.dts=P,P+=_,O++}else Math.abs(R),D.pts=D.dts=P,P+=_,O++}for(var N=0,U=k.length;N<U;N++){var j=k[N],F=j.unit,B=j.pts;if(void 0!==v)a.duration=Math.round((B-v)/m);else{var G=Math.round(1e3*(B-A)/g),V=0;if(n&&e.isAAC&&G){if(G>0&&G<1e4)V=Math.round((B-A)/_),c.logger.log(G+" ms hole between AAC samples detected,filling it"),V>0&&(o=s.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount),o||(o=F.subarray()),e.len+=V*o.length);else if(G<-12){c.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(A/g).toFixed(3)+"s/"+(B/g).toFixed(3)+"s/"+-G+"ms"),e.len-=F.byteLength;continue}B=A}if(p=Math.max(0,B),!(e.len>0))return;var H=w?e.len:e.len+8;i=w?0:8;try{u=new Uint8Array(H)}catch(e){return void this.observer.trigger(l.default.ERROR,{type:h.ErrorTypes.MUX_ERROR,details:h.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:H,reason:"fail allocating audio mdat "+H})}if(!w){new DataView(u.buffer).setUint32(0,H),u.set(d.default.types.mdat,4)}for(var K=0;K<V;K++)o=s.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount),o||(c.logger.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),o=F.subarray()),u.set(o,i),i+=o.byteLength,a={size:o.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(a)}u.set(F,i);var Y=F.byteLength;i+=Y,a={size:Y,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(a),v=B}var W=0,q=S.length;if(q>=2&&(W=S[q-2].duration,a.duration=W),q){this.nextAudioPts=A=v+m*W,e.len=0,e.samples=S,f=w?new Uint8Array:d.default.moof(e.sequenceNumber++,p/m,e),e.samples=[];var z=p/g,X=A/g,$={data1:f,data2:u,startPTS:z,endPTS:X,startDTS:z,endDTS:X,type:"audio",nb:q};return this.observer.trigger(l.default.FRAG_PARSING_DATA,$),$}return null}},{key:"remuxEmptyAudio",value:function(e,t,n,r){var i=e.inputTimeScale,a=e.samplerate?e.samplerate:i,o=i/a,u=this.nextAudioPts,l=(void 0!==u?u:r.startDTS*i)+this._initDTS,f=r.endDTS*i+this._initDTS,d=1024*o,h=Math.ceil((f-l)/d),p=s.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(c.logger.warn("remux empty Audio"),!p)return void c.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var v=[],g=0;g<h;g++){var y=l+g*d;v.push({unit:p,pts:y,dts:y}),e.len+=p.length}e.samples=v,this.remuxAudio(e,t,n)}},{key:"remuxID3",value:function(e,t){var n,r=e.samples.length,i=e.inputTimeScale,a=this._initPTS,o=this._initDTS;if(r){for(var s=0;s<r;s++)n=e.samples[s],n.pts=(n.pts-a)/i,n.dts=(n.dts-o)/i;this.observer.trigger(l.default.FRAG_PARSING_METADATA,{samples:e.samples})}e.samples=[],t=t}},{key:"remuxText",value:function(e,t){e.samples.sort(function(e,t){return e.pts-t.pts});var n,r=e.samples.length,i=e.inputTimeScale,a=this._initPTS;if(r){for(var o=0;o<r;o++)n=e.samples[o],n.pts=(n.pts-a)/i;this.observer.trigger(l.default.FRAG_PARSING_USERDATA,{samples:e.samples})}e.samples=[],t=t}},{key:"_PTSNormalize",value:function(e,t){var n;if(void 0===t)return e;for(n=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=n;return e}}]),e}();n.default=p},{33:33,35:35,36:36,44:44,54:54}],46:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e(35),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(){function e(t){r(this,e),this.observer=t}return i(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(){}},{key:"resetInitSegment",value:function(){}},{key:"remux",value:function(e,t,n,r,i,a,s,u){var l=this.observer,c="";e&&(c+="audio"),t&&(c+="video"),l.trigger(o.default.FRAG_PARSING_DATA,{data1:u,startPTS:i,startDTS:i,type:c,nb:1,dropped:0}),l.trigger(o.default.FRAG_PARSED)}}]),e}();n.default=s},{35:35}],47:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=/^(\d+)x(\d+)$/,o=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,s=function(){function e(t){r(this,e),"string"==typeof t&&(t=e.parseAttrList(t));for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n])}return i(e,[{key:"decimalInteger",value:function(e){var t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}},{key:"hexadecimalInteger",value:function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var n=new Uint8Array(t.length/2),r=0;r<t.length/2;r++)n[r]=parseInt(t.slice(2*r,2*r+2),16);return n}return null}},{key:"hexadecimalIntegerAsNumber",value:function(e){var t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}},{key:"decimalFloatingPoint",value:function(e){return parseFloat(this[e])}},{key:"enumeratedString",value:function(e){return this[e]}},{key:"decimalResolution",value:function(e){var t=a.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}}],[{key:"parseAttrList",value:function(e){var t,n={};for(o.lastIndex=0;null!==(t=o.exec(e));){var r=t[2];0===r.indexOf('"')&&r.lastIndexOf('"')===r.length-1&&(r=r.slice(1,-1)),n[t[1]]=r}return n}}]),e}();n.default=s},{}],48:[function(e,t,n){"use strict";var r={search:function(e,t){for(var n=0,r=e.length-1,i=null,a=null;n<=r;){i=(n+r)/2|0,a=e[i];var o=t(a);if(o>0)n=i+1;else{if(!(o<0))return a;r=i-1}}return null}};t.exports=r},{}],49:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),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(e){var t=e;return a.hasOwnProperty(e)&&(t=a[e]),String.fromCharCode(t)},s=15,u=100,l={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},c={17:2,18:4,21:6,22:8,23:10,19:13,20:15},f={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},d={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(e){this.time=e},log:function(e,t){var n=this.verboseFilter[e];this.verboseLevel>=n&&console.log(this.time+" ["+e+"] "+t)}},v=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},g=function(){function e(t,n,i,a,o){r(this,e),this.foreground=t||"white",this.underline=n||!1,this.italics=i||!1,this.background=a||"black",this.flash=o||!1}return i(e,[{key:"reset",value:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}},{key:"setStyles",value:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}}},{key:"isDefault",value:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}},{key:"equals",value:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}},{key:"copy",value:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}},{key:"toString",value:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}]),e}(),y=function(){function e(t,n,i,a,o,s){r(this,e),this.uchar=t||" ",this.penState=new g(n,i,a,o,s)}return i(e,[{key:"reset",value:function(){this.uchar=" ",this.penState.reset()}},{key:"setChar",value:function(e,t){this.uchar=e,this.penState.copy(t)}},{key:"setPenState",value:function(e){this.penState.copy(e)}},{key:"equals",value:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}},{key:"copy",value:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)}},{key:"isEmpty",value:function(){return" "===this.uchar&&this.penState.isDefault()}}]),e}(),m=function(){function e(){r(this,e),this.chars=[];for(var t=0;t<u;t++)this.chars.push(new y);this.pos=0,this.currPenState=new g}return i(e,[{key:"equals",value:function(e){for(var t=!0,n=0;n<u;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t}},{key:"copy",value:function(e){for(var t=0;t<u;t++)this.chars[t].copy(e.chars[t])}},{key:"isEmpty",value:function(){for(var e=!0,t=0;t<u;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}},{key:"setCursor",value:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(p.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>u&&(p.log("ERROR","Too large cursor position "+this.pos),this.pos=u)}},{key:"moveCursor",value:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)}},{key:"backSpace",value:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}},{key:"insertChar",value:function(e){e>=144&&this.backSpace();var t=o(e);if(this.pos>=u)return void p.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}},{key:"clearFromPos",value:function(e){var t;for(t=e;t<u;t++)this.chars[t].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 e=[],t=!0,n=0;n<u;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")}},{key:"setPenStyles",value:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}]),e}(),b=function(){function e(){r(this,e),this.rows=[];for(var t=0;t<s;t++)this.rows.push(new m);this.currRow=s-1,this.nrRollUpRows=null,this.reset()}return i(e,[{key:"reset",value:function(){for(var e=0;e<s;e++)this.rows[e].clear();this.currRow=s-1}},{key:"equals",value:function(e){for(var t=!0,n=0;n<s;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}},{key:"copy",value:function(e){for(var t=0;t<s;t++)this.rows[t].copy(e.rows[t])}},{key:"isEmpty",value:function(){for(var e=!0,t=0;t<s;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}},{key:"backSpace",value:function(){this.rows[this.currRow].backSpace()}},{key:"clearToEndOfRow",value:function(){this.rows[this.currRow].clearToEndOfRow()}},{key:"insertChar",value:function(e){this.rows[this.currRow].insertChar(e)}},{key:"setPen",value:function(e){this.rows[this.currRow].setPenStyles(e)}},{key:"moveCursor",value:function(e){this.rows[this.currRow].moveCursor(e)}},{key:"setCursor",value:function(e){p.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)}},{key:"setPAC",value:function(e){p.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(var n=0;n<s;n++)this.rows[n].clear();var r=this.currRow+1-this.nrRollUpRows,i=this.lastOutputScreen;if(i){var a=i.rows[r].cueStartTime;if(a&&a<p.time)for(var o=0;o<this.nrRollUpRows;o++)this.rows[t-this.nrRollUpRows+o+1].copy(i.rows[r+o])}}this.currRow=t;var u=this.rows[this.currRow];if(null!==e.indent){var l=e.indent,c=Math.max(l-1,0);u.setCursor(e.indent),e.color=u.chars[c].penState.foreground}var f={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(f)}},{key:"setBkgData",value:function(e){p.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}},{key:"setRollUpRows",value:function(e){this.nrRollUpRows=e}},{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 e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),p.log("INFO","Rolling up")}},{key:"getDisplayText",value:function(e){e=e||!1;for(var t=[],n="",r=-1,i=0;i<s;i++){var a=this.rows[i].getTextString();a&&(r=i+1,e?t.push("Row "+r+": '"+a+"'"):t.push(a.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n}},{key:"getTextAndFormat",value:function(){return this.rows}}]),e}(),_=function(){function e(t,n){r(this,e),this.chNr=t,this.outputFilter=n,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 i(e,[{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(e){this.outputFilter=e}},{key:"setPAC",value:function(e){this.writeScreen.setPAC(e)}},{key:"setBkgData",value:function(e){this.writeScreen.setBkgData(e)}},{key:"setMode",value:function(e){e!==this.mode&&(this.mode=e,p.log("INFO","MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}},{key:"insertChars",value:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";p.log("INFO",n+": "+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(e){p.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}},{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 e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,p.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()}},{key:"ccTO",value:function(e){p.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}},{key:"ccMIDROW",value:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[n]}p.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}},{key:"outputDataUpdate",value:function(){var e=p.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))}},{key:"cueSplitAtTime",value:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}]),e}(),E=function(){function e(t,n,i){r(this,e),this.field=t||1,this.outputs=[n,i],this.channels=[new _(1,n),new _(2,i)],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 i(e,[{key:"getHandler",value:function(e){return this.channels[e].getHandler()}},{key:"setHandler",value:function(e,t){this.channels[e].setHandler(t)}},{key:"addData",value:function(e,t){var n,r,i,a=!1;this.lastTime=e,p.setTime(e);for(var o=0;o<t.length;o+=2)if(r=127&t[o],i=127&t[o+1],0!==r||0!==i){if(p.log("DATA","["+v([t[o],t[o+1]])+"] -> ("+v([r,i])+")"),n=this.parseCmd(r,i),n||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),!n&&(a=this.parseChars(r,i)))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?");n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,p.log("WARNING","Couldn't parse cleaned data "+v([r,i])+" orig: "+v([t[o],t[o+1]])))}else this.dataCounters.padding+=2}},{key:"parseCmd",value:function(e,t){var n=null,r=(20===e||28===e)&&32<=t&&t<=47,i=(23===e||31===e)&&33<=t&&t<=35;if(!r&&!i)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,p.log("DEBUG","Repeated command ("+v([e,t])+") is dropped"),!0;n=20===e||23===e?1:2;var a=this.channels[n-1];return 20===e||28===e?32===t?a.ccRCL():33===t?a.ccBS():34===t?a.ccAOF():35===t?a.ccAON():36===t?a.ccDER():37===t?a.ccRU(2):38===t?a.ccRU(3):39===t?a.ccRU(4):40===t?a.ccFON():41===t?a.ccRDC():42===t?a.ccTR():43===t?a.ccRTD():44===t?a.ccEDM():45===t?a.ccCR():46===t?a.ccENM():47===t&&a.ccEOC():a.ccTO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0}},{key:"parseMidrow",value:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return p.log("ERROR","Mismatch channel in midrow parsing"),!1;return this.channels[n-1].ccMIDROW(t),p.log("DEBUG","MIDROW ("+v([e,t])+")"),!0}return!1}},{key:"parsePAC",value:function(e,t){var n=null,r=null,i=(17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127,a=(16===e||24===e)&&64<=t&&t<=95;if(!i&&!a)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;n=e<=23?1:2,r=64<=t&&t<=95?1===n?l[e]:f[e]:1===n?c[e]:d[e];var o=this.interpretPAC(r,t);return this.channels[n-1].setPAC(o),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0}},{key:"interpretPAC",value:function(e,t){var n=t,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r}},{key:"parseChars",value:function(e,t){var n=null,r=null,i=null;if(e>=25?(n=2,i=e-8):(n=1,i=e),17<=i&&i<=19){var a=t;a=17===i?t+80:18===i?t+112:t+144,p.log("INFO","Special char '"+o(a)+"' in channel "+n),r=[a]}else 32<=e&&e<=127&&(r=0===t?[e]:[e,t]);if(r){var s=v(r);p.log("DEBUG","Char codes = "+s.join(",")),this.lastCmdA=null,this.lastCmdB=null}return r}},{key:"parseBackgroundAttributes",value:function(e,t){var n,r,i,a,o=(16===e||24===e)&&32<=t&&t<=47,s=(23===e||31===e)&&45<=t&&t<=47;return!(!o&&!s)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=h[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,a=this.channels[i-1],a.setBkgData(n),this.lastCmdA=null,this.lastCmdB=null,!0)}},{key:"reset",value:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null}},{key:"cueSplitAtTime",value:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}}]),e}();n.default=E},{}],50:[function(e,t,n){"use strict";var r=e(57),i={newCue:function(e,t,n,i){for(var a,o,s,u,l,c=window.VTTCue||window.TextTrackCue,f=0;f<i.rows.length;f++)if(a=i.rows[f],s=!0,u=0,l="",!a.isEmpty()){for(var d=0;d<a.chars.length;d++)a.chars[d].uchar.match(/\s/)&&s?u++:(l+=a.chars[d].uchar,s=!1);a.cueStartTime=t,t===n&&(n+=1e-4),o=new c(t,n,(0,r.fixLineBreaks)(l.trim())),u>=16?u--:u++,navigator.userAgent.match(/Firefox\//)?o.line=f+1:o.line=f>7?f-2:f+1,o.align="left",o.position=Math.max(0,Math.min(100,u/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),e.addCue(o)}}};t.exports=i},{57:57}],51:[function(e,t,n){"use strict";function r(e,t){return a.default.search(e,function(e){return e.cc<t?1:e.cc>t?-1:0})}Object.defineProperty(n,"__esModule",{value:!0}),n.findFragWithCC=r;var i=e(48),a=function(e){return e&&e.__esModule?e:{default:e}}(i)},{48:48}],52:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e(53),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(){function e(t,n,i,a){r(this,e),this.hls=t,this.defaultEstimate_=a,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new o.default(n),this.fast_=new o.default(i)}return i(e,[{key:"sample",value:function(e,t){e=Math.max(e,this.minDelayMs_);var n=8e3*t/e,r=e/1e3;this.fast_.sample(r,n),this.slow_.sample(r,n)}},{key:"canEstimate",value:function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"destroy",value:function(){}}]),e}();n.default=s},{53:53}],53:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t){r(this,e),this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=0,this.totalWeight_=0}return i(e,[{key:"sample",value:function(e,t){var n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}},{key:"getTotalWeight",value:function(){return this.totalWeight_}},{key:"getEstimate",value:function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/e}return this.estimate_}}]),e}();n.default=a},{}],54:[function(e,t,n){"use strict";function r(){}function i(e,t){return t="["+e+"] > "+t}function a(e){var t=self.console[e];return t?function(){for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];r[0]&&(r[0]=i(e,r[0])),t.apply(self.console,r)}:r}function o(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];n.forEach(function(t){l[t]=e[t]?e[t].bind(e):a(t)})}Object.defineProperty(n,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u={trace:r,debug:r,log:r,warn:r,info:r,error:r},l=u;n.enableLogs=function(e){if(!0===e||"object"===(void 0===e?"undefined":s(e))){o(e,"debug","log","info","warn","error");try{l.log()}catch(e){l=u}}else l=u},n.logger=l},{}],55:[function(e,t,n){"use strict";var r={toString:function(e){for(var t="",n=e.length,r=0;r<n;r++)t+="["+e.start(r).toFixed(3)+","+e.end(r).toFixed(3)+"]";return t}};t.exports=r},{}],56:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){function e(e){return"string"==typeof e&&(!!a[e.toLowerCase()]&&e.toLowerCase())}function t(e){return"string"==typeof e&&(!!o[e.toLowerCase()]&&e.toLowerCase())}function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}function r(r,a,o){var s=this,u=function(){if("undefined"!=typeof navigator)return/MSIE\s8\.0/.test(navigator.userAgent)}(),l={};u?s=document.createElement("custom"):l.enumerable=!0,s.hasBeenReset=!1;var c="",f=!1,d=r,h=a,p=o,v=null,g="",y=!0,m="auto",b="start",_=50,E="middle",T=50,w="middle";if(Object.defineProperty(s,"id",n({},l,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(s,"pauseOnExit",n({},l,{get:function(){return f},set:function(e){f=!!e}})),Object.defineProperty(s,"startTime",n({},l,{get:function(){return d},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"endTime",n({},l,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"text",n({},l,{get:function(){return p},set:function(e){p=""+e,this.hasBeenReset=!0}})),Object.defineProperty(s,"region",n({},l,{get:function(){return v},set:function(e){v=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"vertical",n({},l,{get:function(){return g},set:function(t){var n=e(t);if(!1===n)throw new SyntaxError("An invalid or illegal string was specified.");g=n,this.hasBeenReset=!0}})),Object.defineProperty(s,"snapToLines",n({},l,{get:function(){return y},set:function(e){y=!!e,this.hasBeenReset=!0}})),Object.defineProperty(s,"line",n({},l,{get:function(){return m},set:function(e){if("number"!=typeof e&&e!==i)throw new SyntaxError("An invalid number or illegal string was specified.");m=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"lineAlign",n({},l,{get:function(){return b},set:function(e){var n=t(e);if(!n)throw new SyntaxError("An invalid or illegal string was specified.");b=n,this.hasBeenReset=!0}})),Object.defineProperty(s,"position",n({},l,{get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",n({},l,{get:function(){return E},set:function(e){var n=t(e);if(!n)throw new SyntaxError("An invalid or illegal string was specified.");E=n,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",n({},l,{get:function(){return T},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");T=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",n({},l,{get:function(){return w},set:function(e){var n=t(e);if(!n)throw new SyntaxError("An invalid or illegal string was specified.");w=n,this.hasBeenReset=!0}})),s.displayState=void 0,u)return s}if("undefined"!=typeof window&&window.VTTCue)return window.VTTCue;var i="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}()},{}],57:[function(e,t,n){"use strict";function r(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new f,this.regionList=[]}function i(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+(0|r)/1e3}var n=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return n?n[3]?t(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?t(n[1],n[2],0,n[4]):t(0,n[1],n[2],n[4]):null}function a(){this.values=Object.create(null)}function o(e,t,n,r){var i=r?e.split(r):[e];for(var a in i)if("string"==typeof i[a]){var o=i[a].split(n);if(2===o.length){var s=o[0],u=o[1];t(s,u)}}}function s(e,t,n){function r(){var t=i(e);if(null===t)throw new Error("Malformed timestamp: "+u);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function s(){e=e.replace(/^\s+/,"")}var u=e;if(s(),t.startTime=r(),s(),"--\x3e"!==e.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+u);e=e.substr(3),s(),t.endTime=r(),s(),function(e,t){var r=new a;o(e,function(e,t){switch(e){case"region":for(var i=n.length-1;i>=0;i--)if(n[i].id===t){r.set(e,n[i].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),o=a[0];r.integer(e,o),r.percent(e,o)&&r.set("snapToLines",!1),r.alt(e,o,["auto"]),2===a.length&&r.alt("lineAlign",a[1],["start",h,"end"]);break;case"position":a=t.split(","),r.percent(e,a[0]),2===a.length&&r.alt("positionAlign",a[1],["start",h,"end","line-left","line-right","auto"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start",h,"end","left","right"])}},/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");var i=r.get("line","auto");"auto"===i&&-1===d.line&&(i=-1),t.line=i,t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align",h);var s=r.get("position","auto");"auto"===s&&50===d.position&&(s="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=s}(e,t)}function u(e){return e.replace(/<br(?: \/)?>/gi,"\n")}Object.defineProperty(n,"__esModule",{value:!0}),n.fixLineBreaks=void 0;var l=e(56),c=function(e){return e&&e.__esModule?e:{default:e}}(l),f=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}};a.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,n){for(var r=0;r<n.length;++r)if(t===n[r]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var d=new c.default(0,0,0),h="middle"===d.align?"middle":"center";r.prototype={parse:function(e){function t(){var e=n.buffer,t=0;for(e=u(e);t<e.length&&"\r"!==e[t]&&"\n"!==e[t];)++t;var r=e.substr(0,t);return"\r"===e[t]&&++t,"\n"===e[t]&&++t,n.buffer=e.substr(t),r}var n=this;e&&(n.buffer+=n.decoder.decode(e,{stream:!0}));try{var r;if("INITIAL"===n.state){if(!/\r\n|\n/.test(n.buffer))return this;r=t();var i=r.match(/^WEBVTT([ \t].*)?$/);if(!i||!i[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var a=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;switch(a?a=!1:r=t(),n.state){case"HEADER":/:/.test(r)?function(e){o(e,function(e,t){switch(e){case"Region":console.log("parse region",t)}},/:/)}(r):r||(n.state="ID");continue;case"NOTE":r||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){n.state="NOTE";break}if(!r)continue;if(n.cue=new c.default(0,0,""),n.state="CUE",-1===r.indexOf("--\x3e")){n.cue.id=r;continue}case"CUE":try{s(r,n.cue,n.regionList)}catch(e){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":var l=-1!==r.indexOf("--\x3e");if(!r||l&&(a=!0)){n.oncue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}n.cue.text&&(n.cue.text+="\n"),n.cue.text+=r;continue;case"BADCUE":r||(n.state="ID");continue}}}catch(e){"CUETEXT"===n.state&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state="INITIAL"===n.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new Error("Malformed WebVTT signature.")}catch(e){throw e}return e.onflush&&e.onflush(),this}},n.fixLineBreaks=u,n.default=r},{56:56}],58:[function(e,t,n){"use strict";var r=e(57),i=function(e){return e&&e.__esModule?e:{default:e}}(r),a=function(e,t,n){return e.substr(n||0,t.length)===t},o=function(e){var t=parseInt(e.substr(-3)),n=parseInt(e.substr(-6,2)),r=parseInt(e.substr(-9,2)),i=e.length>9?parseInt(e.substr(0,e.indexOf(":"))):0;return isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i)?-1:(t+=1e3*n,t+=6e4*r,t+=36e5*i)},s=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return(t>>>0).toString()},u=function(e,t,n){var r=e[t],i=e[r.prevCC];if(!i||!i.new&&r.new)return e.ccOffset=e.presentationOffset=r.start,void(r.new=!1);for(;i&&i.new;)e.ccOffset+=r.start-i.start,r.new=!1,r=i,i=e[r.prevCC];e.presentationOffset=n},l={parse:function(e,t,n,r,l,c){var f=/\r\n|\n\r|\n|\r/g,d=String.fromCharCode.apply(null,new Uint8Array(e)).trim().replace(f,"\n").split("\n"),h="00:00.000",p=0,v=0,g=0,y=[],m=void 0,b=!0,_=new i.default;_.oncue=function(e){var t=n[r],i=n.ccOffset;t&&t.new&&(void 0!==v?i=n.ccOffset=t.start:u(n,r,g)),g&&(i=g+n.ccOffset-n.presentationOffset),e.startTime+=i-v,e.endTime+=i-v,e.id=s(e.startTime)+s(e.endTime)+s(e.text),e.text=decodeURIComponent(escape(e.text)),e.endTime>0&&y.push(e)},_.onparsingerror=function(e){m=e},_.onflush=function(){if(m&&c)return void c(m);l(y)},d.forEach(function(e){if(b){if(a(e,"X-TIMESTAMP-MAP=")){b=!1,e.substr(16).split(",").forEach(function(e){a(e,"LOCAL:")?h=e.substr(6):a(e,"MPEGTS:")&&(p=parseInt(e.substr(7)))});try{t=t<0?t+8589934592:t,p-=t,v=o(h)/1e3,g=p/9e4,-1===v&&(m=new Error("Malformed X-TIMESTAMP-MAP: "+e))}catch(t){m=new Error("Malformed X-TIMESTAMP-MAP: "+e)}return}""===e&&(b=!1)}_.parse(e+"\n")}),_.flush()}};t.exports=l},{57:57}],59:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e(54),o=function(){function e(t){r(this,e),t&&t.xhrSetup&&(this.xhrSetup=t.xhrSetup)}return i(e,[{key:"destroy",value:function(){this.abort(),this.loader=null}},{key:"abort",value:function(){var e=this.loader;e&&4!==e.readyState&&(this.stats.aborted=!0,e.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null}},{key:"load",value:function(e,t,n){this.context=e,this.config=t,this.callbacks=n,this.stats={trequest:performance.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()}},{key:"loadInternal",value:function(){var e,t=this.context;e="undefined"!=typeof XDomainRequest?this.loader=new XDomainRequest:this.loader=new XMLHttpRequest;var n=this.stats;n.tfirst=0,n.loaded=0;var r=this.xhrSetup;try{if(r)try{r(e,t.url)}catch(n){e.open("GET",t.url,!0),r(e,t.url)}e.readyState||e.open("GET",t.url,!0)}catch(n){return void this.callbacks.onError({code:e.status,text:n.message},t,e)}t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),e.send()}},{key:"readystatechange",value:function(e){var t=e.currentTarget,n=t.readyState,r=this.stats,i=this.context,o=this.config;if(!r.aborted&&n>=2)if(window.clearTimeout(this.requestTimeout),0===r.tfirst&&(r.tfirst=Math.max(performance.now(),r.trequest)),4===n){var s=t.status;if(s>=200&&s<300){r.tload=Math.max(r.tfirst,performance.now());var u=void 0,l=void 0;"arraybuffer"===i.responseType?(u=t.response,l=u.byteLength):(u=t.responseText,l=u.length),r.loaded=r.total=l;var c={url:t.responseURL,data:u};this.callbacks.onSuccess(c,r,i,t)}else r.retry>=o.maxRetry||s>=400&&s<499?(a.logger.error(s+" while loading "+i.url),this.callbacks.onError({code:s,text:t.statusText},i,t)):(a.logger.warn(s+" while loading "+i.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,null)}},{key:"loadprogress",value:function(e){var t=e.currentTarget,n=this.stats;n.loaded=e.loaded,e.lengthComputable&&(n.total=e.total);var r=this.callbacks.onProgress;r&&r(n,this.context,null,t)}}]),e}();n.default=o},{54:54}]},{},[40])(40)})},function(e,t,n){!function(t,r){e.exports=r(n(12),n(0))}(0,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 o=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in i)return i.value;var o=i.get;if(void 0!==o)return o.call(r)},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),l=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(2),f=function(e){function t(e,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r(this,t),t._logger.debug("Creating adapter. Shaka version: "+l.default.Player.version);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,a));return o._shaka=new l.default.Player(e),o._shaka.configure(a),o._addBindings(),o}return a(t,e),s(t,null,[{key:"canPlayType",value:function(e){var n="string"==typeof e&&e.toLowerCase()===t._dashMimeType;return t._logger.debug("canPlayType result for mimeType: "+e+" is "+n.toString()),n}},{key:"isSupported",value:function(){l.default.polyfill.installAll();var e=l.default.Player.isBrowserSupported();return t._logger.debug("isSupported:"+e),e}}]),s(t,[{key:"_addBindings",value:function(){this._shaka.addEventListener("adaptation",this._onAdaptation.bind(this)),this._shaka.addEventListener("error",this._onError.bind(this))}},{key:"_removeBindings",value:function(){this._shaka.removeEventListener("adaptation",this._onAdaptation),this._shaka.removeEventListener("error",this._onError)}},{key:"load",value:function(){var e=this;return this._loadPromise||(this._loadPromise=new Promise(function(n,r){e._sourceObj&&e._sourceObj.url&&e._shaka.load(e._sourceObj.url).then(function(){var r={tracks:e._getParsedTracks()};t._logger.debug("The source has been loaded successfully"),n(r)}).catch(function(t){r(t),e._onError(t)})})),this._loadPromise}},{key:"destroy",value:function(){t._logger.debug("destroy"),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),this._loadPromise=null,this._removeBindings(),this._shaka.destroy()}},{key:"_getVideoTracks",value:function(){var e=this._shaka.getVariantTracks(),t=e.filter(function(e){return e.active})[0];return e.filter(function(e){return e.audioId===t.audioId})}},{key:"_getAudioTracks",value:function(){var e=this._shaka.getVariantTracks(),t=e.filter(function(e){return e.active})[0];return e.filter(function(e){return e.videoId===t.videoId})}},{key:"_getParsedTracks",value:function(){var e=this._getParsedVideoTracks(),t=this._getParsedAudioTracks(),n=this._getParsedTextTracks();return e.concat(t).concat(n)}},{key:"_getParsedVideoTracks",value:function(){var e=this._getVideoTracks(),t=[];if(e)for(var n=0;n<e.length;n++){var r={id:e[n].id,bandwidth:e[n].bandwidth,active:e[n].active,label:e[n].label,index:n};t.push(new c.VideoTrack(r))}return t}},{key:"_getParsedAudioTracks",value:function(){var e=this._getAudioTracks(),t=[];if(e)for(var n=0;n<e.length;n++){var r={id:e[n].id,active:e[n].active,label:e[n].label,language:e[n].language,index:n};t.push(new c.AudioTrack(r))}return t}},{key:"_getParsedTextTracks",value:function(){var e=this._shaka.getTextTracks(),t=[];if(e)for(var n=0;n<e.length;n++){var r={kind:e[n].kind?e[n].kind+"s":"",active:e[n].active,label:e[n].label,language:e[n].language,index:n};t.push(new c.TextTrack(r))}return t}},{key:"selectVideoTrack",value:function(e){var t=this._getVideoTracks();if(e instanceof c.VideoTrack&&t){var n=t[e.index];n&&(this._shaka.configure({abr:{enabled:!1}}),n.active||(this._shaka.selectVariantTrack(t[e.index],!0),this._onTrackChanged(e)))}}},{key:"selectAudioTrack",value:function(e){e instanceof c.AudioTrack&&!e.active&&(this._shaka.selectAudioLanguage(e.language),this._onTrackChanged(e))}},{key:"selectTextTrack",value:function(e){e instanceof c.TextTrack&&!e.active&&("subtitles"===e.kind||"captions"===e.kind)&&(this._shaka.selectTextLanguage(e.language),this._shaka.setTextTrackVisibility(!0),this._onTrackChanged(e))}},{key:"hideTextTrack",value:function(){this._shaka.setTextTrackVisibility(!1)}},{key:"enableAdaptiveBitrate",value:function(){this._shaka.configure({abr:{enabled:!0}})}},{key:"_onAdaptation",value:function(){var e=this._getParsedVideoTracks().filter(function(e){return e.active})[0];this._onTrackChanged(e)}},{key:"_onError",value:function(e){t._logger.error(e)}},{key:"src",get:function(){return this._loadPromise&&this._sourceObj?this._sourceObj.url:""}}]),t}(c.BaseMediaSourceAdapter);f.id="DashAdapter",f._logger=c.BaseMediaSourceAdapter.getLogger(f.id),f._dashMimeType="application/dash+xml",t.default=f,f.isSupported()&&(0,c.registerMediaSourceAdapter)(f)},function(t,n){t.exports=e},function(e,n){e.exports=t}])})},function(e,t,n){var r;!function(){var i={};(function(e){function t(e,t){var n=e.split("."),r=uo;n[0]in r||!r.execScript||r.execScript("var "+n[0]);for(var i;n.length&&(i=n.shift());)n.length||void 0===t?r=r[i]?r[i]:r[i]={}:r[i]=t}function n(e){function t(){}var n=pt;t.prototype=n.prototype,e.Be=n.prototype,e.prototype=new t,e.prototype.constructor=e,e.ye=function(e,t,r){return n.prototype[t].apply(e,Array.prototype.slice.call(arguments,2))}}function r(e){this.c=Math.exp(Math.log(.5)/e),this.b=this.a=0}function i(e,t,n){var r=Math.pow(e.c,t);n=n*(1-r)+r*e.a,isNaN(n)||(e.a=n,e.b+=t)}function a(e){return e.a/(1-Math.pow(e.c,e.b))}function o(){this.c=new r(2),this.f=new r(5),this.a=0,this.b=5e5}function s(){}function u(e,t,n,r){this.severity=e,this.category=t,this.code=n,this.data=Array.prototype.slice.call(arguments,3)}function l(e){var t;e instanceof l?(c(this,e.aa),this.Ba=e.Ba,this.ca=e.ca,f(this,e.Ja),this.W=e.W,d(this,y(e.a)),this.ta=e.ta):e&&(t=String(e).match(lo))?(c(this,t[1]||"",!0),this.Ba=h(t[2]||""),this.ca=h(t[3]||"",!0),f(this,t[4]),this.W=h(t[5]||"",!0),d(this,t[6]||"",!0),this.ta=h(t[7]||"")):this.a=new g(null)}function c(e,t,n){e.aa=n?h(t,!0):t,e.aa&&(e.aa=e.aa.replace(/:$/,""))}function f(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.Ja=t}else e.Ja=null}function d(e,t,n){t instanceof g?e.a=t:(n||(t=p(t,po)),e.a=new g(t))}function h(e,t){return e?t?decodeURI(e):decodeURIComponent(e):""}function p(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,v),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function v(e){return e=e.charCodeAt(0),"%"+(e>>4&15).toString(16)+(15&e).toString(16)}function g(e){this.b=e||null}function y(e){var t=new g;if(t.b=e.b,e.a){var n,r={};for(n in e.a)r[n]=e.a[n].concat();t.a=r,t.c=e.c}return t}function m(e,t){return e.reduce(function(e,t,n){return t.catch(e.bind(null,n))}.bind(null,t),Promise.reject())}function b(e,t){return e.concat(t)}function _(){}function E(e){return null!=e}function T(e){return function(t){return t!=e}}function w(e,t,n){return n.indexOf(e)==t}function k(e,t){if(!t.length)return e;var n=t.map(function(e){return new l(e)});return e.map(function(e){return new l(e)}).map(function(e){return n.map(e.resolve.bind(e))}).reduce(b,[]).map(function(e){return e.toString()})}function S(e,t){return{keySystem:e,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:t||[],keyIds:[]}}function A(e,t,n,r,i){var a,o=i in r;for(a in t){var s=i+"."+a,u=o?r[i]:n[a],l=!!{".abr.manager":!0}[s]||!!{serverCertificate:!0}[a];(o||a in e)&&(void 0===t[a]?void 0===u||o?delete e[a]:e[a]=u:l?e[a]=t[a]:"object"==typeof e[a]&&"object"==typeof t[a]?A(e[a],t[a],u,r,s):typeof t[a]==typeof u&&(e[a]=t[a]))}}function O(e){return JSON.parse(JSON.stringify(e))}function P(){var e,t,n=new Promise(function(n,r){e=n,t=r});return n.resolve=e,n.reject=t,n}function R(e){this.f=!1,this.a=[],this.b=[],this.c=[],this.h=e||null}function D(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function x(e,t){return{uris:e,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:t}}function L(e,t){for(var n=[],r=0;r<e.length;++r){for(var i=!1,a=0;a<n.length&&!(i=t?t(e[r],n[a]):e[r]===n[a]);++a);i||n.push(e[r])}return n}function I(e,t,n){for(var r=0;r<e.length;++r)if(n(e[r],t))return r;return-1}function M(){this.a={}}function C(){this.a=new M}function N(e,t,n,r){e.a&&(t=new F(t,n,r),e.a.push(n,t))}function U(e,t,n,r){N(e,t,n,function(e){this.ha(t,n),r(e)}.bind(e))}function j(e){if(e.a){var t,n=e.a,r=[];for(t in n.a)r.push.apply(r,n.a[t]);for(n=0;n<r.length;++n)r[n].ha();e.a.a={}}}function F(e,t,n){this.target=e,this.type=t,this.a=n,this.target.addEventListener(t,n,!1)}function B(e){return!e||!Object.keys(e).length}function G(e){return Object.keys(e).map(function(t){return e[t]})}function V(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=t(e[r],r),n},{})}function H(e,t){return Object.keys(e).every(function(n){return t(n,e[n])})}function K(e,t){Object.keys(e).forEach(function(n){t(n,e[n])})}function Y(e){if(!e)return"";e=new Uint8Array(e),239==e[0]&&187==e[1]&&191==e[2]&&(e=e.subarray(3)),e=escape(X(e));try{return decodeURIComponent(e)}catch(e){throw new u(2,2,2004)}}function W(e,t,n){if(!e)return"";if(!n&&e.byteLength%2)throw new u(2,2,2004);if(e instanceof ArrayBuffer)var r=e;else n=new Uint8Array(e.byteLength),n.set(new Uint8Array(e)),r=n.buffer;e=Math.floor(e.byteLength/2),n=new Uint16Array(e),r=new DataView(r);for(var i=0;i<e;i++)n[i]=r.getUint16(2*i,t);return X(n)}function q(e){var t=new Uint8Array(e);if(239==t[0]&&187==t[1]&&191==t[2])return Y(t);if(254==t[0]&&255==t[1])return W(t.subarray(2),!1);if(255==t[0]&&254==t[1])return W(t.subarray(2),!0);var n=function(e,t){return e.byteLength<=t||32<=e[t]&&126>=e[t]}.bind(null,t);if(!t[0]&&!t[2])return W(e,!1);if(!t[1]&&!t[3])return W(e,!0);if(n(0)&&n(1)&&n(2)&&n(3))return Y(e);throw new u(2,2,2003)}function z(e){e=unescape(encodeURIComponent(e));for(var t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t.buffer}function X(e){for(var t="",n=0;n<e.length;n+=16e3)t+=String.fromCharCode.apply(null,e.subarray(n,n+16e3));return t}function $(e){this.a=null,this.b=function(){this.a=null,e()}.bind(this)}function J(e){e.cancel(),e.a=setTimeout(e.b,500)}function Q(t,n){var r=void 0==n||n,i=e.btoa(String.fromCharCode.apply(null,t)).replace(/\+/g,"-").replace(/\//g,"_");return r?i:i.replace(/=*$/,"")}function Z(t){t=e.atob(t.replace(/-/g,"+").replace(/_/g,"/"));for(var n=new Uint8Array(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}function ee(t){for(var n=new Uint8Array(t.length/2),r=0;r<t.length;r+=2)n[r/2]=e.parseInt(t.substr(r,2),16);return n}function te(e){for(var t="",n=0;n<e.length;++n){var r=e[n].toString(16);1==r.length&&(r="0"+r),t+=r}return t}function ne(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!=t.length)return!1;for(var n=0;n<e.length;++n)if(e[n]!=t[n])return!1;return!0}function re(e,t,n,r){this.j=this.i=this.v=null,this.J=!1,this.b=null,this.f=new C,this.a=[],this.o=[],this.l=new P,this.ka=e,this.h=null,this.g=function(e){this.l.reject(e),t(e)}.bind(this),this.A={},this.Ca=n,this.la=r,this.B=new $(this.Kd.bind(this)),this.ja=this.c=!1,this.G=[],this.ia=!1,this.O=setInterval(this.Jd.bind(this),1e3),this.l.catch(function(){})}function ie(e,t){if(!e.i)return U(e.f,t,"encrypted",function(){this.g(new u(2,6,6010))}.bind(e)),Promise.resolve();e.j=t,U(e.f,e.j,"play",e.qd.bind(e));var n=e.j.setMediaKeys(e.i),n=n.catch(function(e){return Promise.reject(new u(2,6,6003,e.message))}),r=null;return e.b.serverCertificate&&(r=e.i.setServerCertificate(e.b.serverCertificate).then(function(){}).catch(function(e){return Promise.reject(new u(2,6,6004,e.message))})),Promise.all([n,r]).then(function(){if(this.c)return Promise.reject();oe(this),this.b.initData.length||this.o.length||N(this.f,this.j,"encrypted",this.fd.bind(this))}.bind(e)).catch(function(e){return this.c?Promise.resolve():Promise.reject(e)}.bind(e))}function ae(e,t){return Promise.all(t.map(function(e){return pe(this,e).then(function(e){if(e){for(var t=new P,n=0;n<this.a.length;n++)if(this.a[n].ba==e){this.a[n].ib=t;break}return Promise.all([e.remove(),t])}}.bind(this))}.bind(e)))}function oe(e){var t=e.b?e.b.initData:[];return t.forEach(function(e){ve(this,e.initDataType,e.initData)}.bind(e)),e.o.forEach(function(e){pe(this,e)}.bind(e)),t.length||e.o.length||e.l.resolve(),e.l}function se(e){return e.a.map(function(e){return e.ba.sessionId})}function ue(t,n,r,i,a){var o=fe(t);n.periods.forEach(function(t){t.variants.forEach(function(t){o&&(t.drmInfos=[o]),t.drmInfos.forEach(function(n){ce(this,n),e.cast&&e.cast.__platform__&&"com.microsoft.playready"==n.keySystem&&(n.keySystem="com.chromecast.playready");var o=i[n.keySystem];o||(o={audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:r?"required":"optional",sessionTypes:[r?"persistent-license":"temporary"],label:n.keySystem,drmInfos:[]},i[n.keySystem]=o,a.push(n.keySystem)),o.drmInfos.push(n),n.distinctiveIdentifierRequired&&(o.distinctiveIdentifier="required"),n.persistentStateRequired&&(o.persistentState="required");var s=[];t.video&&s.push(t.video),t.audio&&s.push(t.audio),s.forEach(function(e){var t="video"==e.type?o.videoCapabilities:o.audioCapabilities,r=("video"==e.type?n.videoRobustness:n.audioRobustness)||"",i=e.mimeType;e.codecs&&(i+='; codecs="'+e.codecs+'"'),t.push({robustness:r,contentType:i})}.bind(this))}.bind(this))}.bind(this))}.bind(t))}function le(e,t,n){if(1==n.length&&""==n[0])return Promise.reject(new u(2,6,6e3));var r=new P,i=r;return[!0,!1].forEach(function(e){n.forEach(function(n){var r=t[n];r.drmInfos.some(function(e){return!!e.licenseServerUri})==e&&(r.audioCapabilities.length||delete r.audioCapabilities,r.videoCapabilities.length||delete r.videoCapabilities,i=i.catch(function(){return this.c?Promise.reject():navigator.requestMediaKeySystemAccess(n,[r])}.bind(this)))}.bind(this))}.bind(e)),i=i.catch(function(){return Promise.reject(new u(2,6,6001))}),i=i.then(function(e){if(this.c)return Promise.reject();var n=0<=navigator.userAgent.indexOf("Edge/"),r=e.getConfiguration();return this.v=(r.audioCapabilities||[]).concat(r.videoCapabilities||[]).map(function(e){return e.contentType}),n&&(this.v=null),n=t[e.keySystem],de(this,e.keySystem,n,n.drmInfos),this.b.licenseServerUri?e.createMediaKeys():Promise.reject(new u(2,6,6012))}.bind(e)).then(function(e){if(this.c)return Promise.reject();this.i=e,this.J=!0}.bind(e)).catch(function(e){return this.c?Promise.resolve():(this.v=this.b=null,e instanceof u?Promise.reject(e):Promise.reject(new u(2,6,6002,e.message)))}.bind(e)),r.reject(),i}function ce(e,t){var n=t.keySystem;if(n){if(!t.licenseServerUri){var r=e.h.servers[n];r&&(t.licenseServerUri=r)}t.keyIds||(t.keyIds=[]),(n=e.h.advanced[n])&&(t.distinctiveIdentifierRequired||(t.distinctiveIdentifierRequired=n.distinctiveIdentifierRequired),t.persistentStateRequired||(t.persistentStateRequired=n.persistentStateRequired),t.videoRobustness||(t.videoRobustness=n.videoRobustness),t.audioRobustness||(t.audioRobustness=n.audioRobustness),t.serverCertificate||(t.serverCertificate=n.serverCertificate))}}function fe(t){if(B(t.h.clearKeys))return null;var n,r=[],i=[];for(n in t.h.clearKeys){var a=t.h.clearKeys[n],o=ee(n),a=ee(a),o={kty:"oct",kid:Q(o,!1),k:Q(a,!1)};r.push(o),i.push(o.kid)}return t=JSON.stringify({keys:r}),i=JSON.stringify({kids:i}),i=[{initData:new Uint8Array(z(i)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+e.btoa(t),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:i,keyIds:[]}}function de(e,t,n,r){var i=[],a=[],o=[],s=[];he(r,i,a,o,s),e.b={keySystem:t,licenseServerUri:i[0],distinctiveIdentifierRequired:"required"==n.distinctiveIdentifier,persistentStateRequired:"required"==n.persistentState,audioRobustness:n.audioCapabilities?n.audioCapabilities[0].robustness:"",videoRobustness:n.videoCapabilities?n.videoCapabilities[0].robustness:"",serverCertificate:a[0],initData:o,keyIds:s}}function he(e,t,n,r,i){function a(e,t){return!(!e.keyId||e.keyId!=t.keyId)||e.initDataType==t.initDataType&&ne(e.initData,t.initData)}e.forEach(function(e){if(-1==t.indexOf(e.licenseServerUri)&&t.push(e.licenseServerUri),e.serverCertificate&&-1==I(n,e.serverCertificate,ne)&&n.push(e.serverCertificate),e.initData&&e.initData.forEach(function(e){-1==I(r,e,a)&&r.push(e)}),e.keyIds)for(var o=0;o<e.keyIds.length;++o)-1==i.indexOf(e.keyIds[o])&&i.push(e.keyIds[o])})}function pe(e,t){try{var n=e.i.createSession("persistent-license")}catch(t){var r=new u(2,6,6005,t.message);return e.g(r),Promise.reject(r)}N(e.f,n,"message",e.kc.bind(e)),N(e.f,n,"keystatuseschange",e.ec.bind(e));var i={initData:null,ba:n,loaded:!1,zb:1/0,ib:null};return e.a.push(i),n.load(t).then(function(e){if(!this.c){if(e)return i.loaded=!0,this.a.every(function(e){return e.loaded})&&this.l.resolve(),n;this.a.splice(this.a.indexOf(i),1),this.g(new u(2,6,6013))}}.bind(e),function(e){this.c||(this.a.splice(this.a.indexOf(i),1),this.g(new u(2,6,6005,e.message)))}.bind(e))}function ve(e,t,n){try{var r=e.ja?e.i.createSession("persistent-license"):e.i.createSession()}catch(t){return void e.g(new u(2,6,6005,t.message))}N(e.f,r,"message",e.kc.bind(e)),N(e.f,r,"keystatuseschange",e.ec.bind(e)),e.a.push({initData:n,ba:r,loaded:!1,zb:1/0,ib:null}),r.generateRequest(t,n.buffer).catch(function(e){if(!this.c){for(var t=0;t<this.a.length;++t)if(this.a[t].ba==r){this.a.splice(t,1);break}this.g(new u(2,6,6006,e.message))}}.bind(e))}function ge(e,t){for(var n,r=t.target,i=0;i<e.a.length;i++)if(e.a[i].ba==r){n=e.a[i].ib;break}i=x([e.b.licenseServerUri],e.h.retryParameters),i.body=t.message,i.method="POST","com.microsoft.playready"!=e.b.keySystem&&"com.chromecast.playready"!=e.b.keySystem||ye(i),e.ka.request(2,i).then(function(e){return this.c?Promise.reject():r.update(e.data).then(function(){n&&n.resolve()})}.bind(e),function(e){if(this.c)return Promise.resolve();e=new u(2,6,6007,e),this.g(e),n&&n.reject(e)}.bind(e)).catch(function(e){if(this.c)return Promise.resolve();e=new u(2,6,6008,e.message),this.g(e),n&&n.reject(e)}.bind(e))}function ye(e){var t=W(e.body,!0,!0);if(-1==t.indexOf("PlayReadyKeyMessage"))e.headers["Content-Type"]="text/xml; charset=utf-8";else{for(var t=(new DOMParser).parseFromString(t,"application/xml"),n=t.getElementsByTagName("HttpHeader"),r=0;r<n.length;++r)e.headers[n[r].querySelector("name").textContent]=n[r].querySelector("value").textContent;e.body=Z(t.querySelector("Challenge").textContent).buffer}}function me(){var e=[],t=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],n=[{videoCapabilities:t,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:t}],r={};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(t){var i=navigator.requestMediaKeySystemAccess(t,n).then(function(e){var n=e.getConfiguration().sessionTypes;return r[t]={persistentState:!!n&&0<=n.indexOf("persistent-license")},e.createMediaKeys()}).catch(function(){r[t]=null});e.push(i)}),Promise.all(e).then(function(){return r})}function be(e,t){var n=e.keySystem();return!t.drmInfos.length||t.drmInfos.some(function(e){return e.keySystem==n})}function _e(e,t){if(!e.length)return t;if(!t.length)return e;for(var n=[],r=0;r<e.length;r++)for(var i=0;i<t.length;i++)if(e[r].keySystem==t[i].keySystem){var a=e[r],i=t[i],o=[],o=o.concat(a.initData||[]),o=o.concat(i.initData||[]),s=[],s=s.concat(a.keyIds),s=s.concat(i.keyIds);n.push({keySystem:a.keySystem,licenseServerUri:a.licenseServerUri||i.licenseServerUri,distinctiveIdentifierRequired:a.distinctiveIdentifierRequired||i.distinctiveIdentifierRequired,persistentStateRequired:a.persistentStateRequired||i.persistentStateRequired,videoRobustness:a.videoRobustness||i.videoRobustness,audioRobustness:a.audioRobustness||i.audioRobustness,serverCertificate:a.serverCertificate||i.serverCertificate,initData:o,keyIds:s});break}return n}function Ee(e){this.f=null,this.c=e,this.h=0,this.g=1/0,this.a=this.b=null}function Te(e,t){yo[e]=t.length?Ae.bind(null,t):t}function we(e,t,n){return e>=t?null:new VTTCue(e,t,n)}function ke(e,t,n,r){return Promise.resolve().then(function(){if(this.c)if(null==n||null==r)this.f.parseInit(t);else{for(var e=this.f.parseMedia(t,{periodStart:this.h,segmentStart:n,segmentEnd:r}),i=0;i<e.length&&!(e[i].startTime>=this.g);++i)this.c.addCue(e[i]);null==this.b&&(this.b=n),this.a=Math.min(r,this.g)}}.bind(e))}function Se(e,t){for(var n=e.c.cues,r=[],i=0;i<n.length;++i)t(n[i])&&r.push(n[i]);for(i=0;i<r.length;++i)e.c.removeCue(r[i])}function Ae(e){this.Na=e}function Oe(e){return!e||1==e.length&&1e-6>e.end(0)-e.start(0)?null:e.length?e.end(e.length-1):null}function Pe(e,t){return!(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0))&&(t>=e.start(0)&&t<=e.end(e.length-1))}function Re(e,t){if(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0))return 0;for(var n=0,r=e.length-1;0<=r&&e.end(r)>t;--r)n+=e.end(r)-Math.max(e.start(r),t);return n}function De(e,t,n){this.f=e,this.N=t,this.i=n,this.c={},this.a=null,this.b={},this.g=new C,this.h=!1}function xe(){var e={};return'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(t){e[t]=!!yo[t]||MediaSource.isTypeSupported(t);var n=t.split(";")[0];e[n]=e[n]||e[t]}),e}function Le(e,t){e.a||(e.a=new Ee(e.i)),e.a.f=new yo[t]}function Ie(e,t){if("text"==t)var n=e.a.b;else n=Me(e,t),n=!n||1==n.length&&1e-6>n.end(0)-n.start(0)?null:1==n.length&&0>n.start(0)?0:n.length?n.start(0):null;return n}function Me(e,t){try{return e.c[t].buffered}catch(e){return null}}function Ce(e,t,n,r,i){return"text"==t?ke(e.a,n,r,i):je(e,t,e.ie.bind(e,t,n))}function Ne(e,t){return"text"==t?e.a.remove(0,1/0):je(e,t,e.qc.bind(e,t,0,e.N.duration))}function Ue(e,t,n,r){return"text"==t?(e.a.h=n,null!=r&&(e.a.g=r),Promise.resolve()):(null==r&&(r=1/0),Promise.all([je(e,t,e.Ec.bind(e,t)),je(e,t,e.Zd.bind(e,t,n)),je(e,t,e.Xd.bind(e,t,r))]))}function je(e,t,n){if(e.h)return Promise.reject();if(n={start:n,p:new P},e.b[t].push(n),1==e.b[t].length)try{n.start()}catch(r){"QuotaExceededError"==r.name?n.p.reject(new u(2,3,3017,t)):n.p.reject(new u(2,3,3015,r)),Be(e,t)}return n.p}function Fe(e,t){if(e.h)return Promise.reject();var n,r=[];for(n in e.c){var i=new P,a={start:function(e){e.resolve()}.bind(null,i),p:i};e.b[n].push(a),r.push(i),1==e.b[n].length&&a.start()}return Promise.all(r).then(function(){var e;try{t()}catch(e){var n=Promise.reject(new u(2,3,3015,e))}for(e in this.c)Be(this,e);return n}.bind(e),function(){return Promise.reject()}.bind(e))}function Be(e,t){e.b[t].shift();var n=e.b[t][0];if(n)try{n.start()}catch(r){n.p.reject(new u(2,3,3015,r)),Be(e,t)}}function Ge(e,t,n){return n==t||e>=mo&&n==t.split("-")[0]||e>=bo&&n.split("-")[0]==t.split("-")[0]}function Ve(e){e=e.toLowerCase().split("-");var t=_o[e[0]];return t&&(e[0]=t),e.join("-")}function He(e,t,n){var r=e.video;return!(r&&(r.width<t.minWidth||r.width>t.maxWidth||r.width>n.width||r.height<t.minHeight||r.height>t.maxHeight||r.height>n.height||r.width*r.height<t.minPixels||r.width*r.height>t.maxPixels)||e.bandwidth<t.minBandwidth||e.bandwidth>t.maxBandwidth)}function Ke(e,t,n){var r=!1;return e.variants.forEach(function(e){var i=e.allowedByApplication;e.allowedByApplication=He(e,t,n),i!=e.allowedByApplication&&(r=!0)}),r}function Ye(e,t,n){var r=t.video,i=t.audio;for(t=0;t<n.variants.length;++t){var a=n.variants[t],o=e,s=i,u=r;(o&&o.J&&!be(o,a)?0:We(a.audio,o,s)&&We(a.video,o,u))||(n.variants.splice(t,1),--t)}for(t=0;t<n.textStreams.length;++t)e=n.textStreams[t],yo[nt(e.mimeType,e.codecs)]||(n.textStreams.splice(t,1),--t)}function We(e,t,n){if(!e)return!0;var r=null;return t&&t.J&&(r=t.v),t=nt(e.mimeType,e.codecs),!(!yo[t]&&!MediaSource.isTypeSupported(t)||r&&e.encrypted&&0>r.indexOf(t)||n&&(e.mimeType!=n.mimeType||e.codecs.split(".")[0]!=n.codecs.split(".")[0]))}function qe(e,t,n){var r=null;return Je(e.variants).map(function(e){var i;i=e.video&&e.audio?n==e.video.id&&t==e.audio.id:e.video&&n==e.video.id||e.audio&&t==e.audio.id;var a="";e.video&&(a+=e.video.codecs),e.audio&&(""!=a&&(a+=", "),a+=e.audio.codecs,r=e.audio.label);var o=e.audio?e.audio.codecs:null,s=e.video?e.video.codecs:null,u=null;e.video?u=e.video.mimeType:e.audio&&(u=e.audio.mimeType);var l=null;e.audio?l=e.audio.kind:e.video&&(l=e.video.kind);var c=L((e.audio?e.audio.roles:[]).concat(e.video?e.video.roles:[]));return{id:e.id,active:i,type:"variant",bandwidth:e.bandwidth,language:e.language,label:r,kind:l||null,width:e.video?e.video.width:null,height:e.video?e.video.height:null,frameRate:e.video?e.video.frameRate:void 0,mimeType:u,codecs:a,audioCodec:o,videoCodec:s,primary:e.primary,roles:c,videoId:e.video?e.video.id:null,audioId:e.audio?e.audio.id:null}})}function ze(e,t){return e.textStreams.map(function(e){return{id:e.id,active:t==e.id,type:"text",language:e.language,label:e.label,kind:e.kind,mimeType:e.mimeType,codecs:e.codecs||null,audioCodec:null,videoCodec:null,primary:e.primary,roles:e.roles}})}function Xe(e,t){for(var n=0;n<e.variants.length;n++)if(e.variants[n].id==t.id)return e.variants[n];return null}function $e(e,t){for(var n=0;n<e.textStreams.length;n++)if(e.textStreams[n].id==t.id)return e.textStreams[n];return null}function Je(e){return e.filter(function(e){return e.allowedByApplication&&e.allowedByKeySystem})}function Qe(e,t,n,r){var i=Je(e.variants),a=i.filter(function(e){return e.language==i[0].language});if(e=i.filter(function(e){return e.primary}),e.length&&(a=e),t){var o=Ve(t);[bo,mo,0].forEach(function(e){var t=!1;i.forEach(function(r){o=Ve(o);var i=Ve(r.language);Ge(e,o,i)&&(t?a.push(r):(a=[r],t=!0),n&&(n.audio=!0))})})}var s=r||"";return s&&(t=a.filter(function(e){return e.audio&&-1<e.audio.roles.indexOf(s)||e.video&&-1<e.video.roles.indexOf(s)}),t.length)?t:a}function Ze(e,t,n,r){var i=e.textStreams,a=i;if(e=i.filter(function(e){return e.primary}),e.length&&(a=e),t){var o=Ve(t);[bo,mo,0].forEach(function(e){var t=!1;i.forEach(function(r){var i=Ve(r.language);Ge(e,o,i)&&(t?a.push(r):(a=[r],t=!0),n&&(n.text=!0))})})}var s=r||"";return s&&(t=a.filter(function(e){return e&&-1<e.roles.indexOf(s)}),t.length)?t:a}function et(e,t,n){for(var r=0;r<n.length;r++)if(n[r].audio==e&&n[r].video==t)return n[r];return null}function tt(e,t,n){function r(e,t){return null==e?null==t:t.id==e}for(var i=0;i<n.length;i++)if(r(e,n[i].audio)&&r(t,n[i].video))return n[i];return null}function nt(e,t){var n=e;return t&&(n+='; codecs="'+t+'"'),n}function rt(e,t){for(var n=e.periods.length-1;0<n;--n)if(t>=e.periods[n].startTime)return n;return 0}function it(e,t){for(var n=0;n<e.periods.length;++n){var r=e.periods[n];if("text"==t.type){for(var i=0;i<r.textStreams.length;++i)if(r.textStreams[i]==t)return n}else for(i=0;i<r.variants.length;++i){var a=r.variants[i];if(a.audio==t||a.video==t||a.video&&a.video.trickModeVideo==t)return n}}return-1}function at(){this.f=null,this.b=!1,this.a=new o,this.h=[],this.g=[],this.j=!1,this.c=null,this.i={minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minBandwidth:0,maxBandwidth:1/0}}function ot(e,t){return t.filter(function(t){return He(t,e,{width:1/0,height:1/0})}).sort(function(e,t){return e.bandwidth-t.bandwidth})}function st(t,n){var r,i=n||{};for(r in i)this[r]=i[r];this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=e.performance&&e.performance.now?e.performance.now():Date.now(),this.type=t,this.isTrusted=!1,this.target=this.currentTarget=null,this.a=!1}function ut(e){return JSON.stringify(e,function(e,t){if("manager"!=e&&"function"!=typeof t){if(t instanceof Event||t instanceof st){var n,r={};for(n in t){var i=t[n];i&&"object"==typeof i||n in Event||(r[n]=i)}return r}if(t instanceof TimeRanges)for(r={__type__:"TimeRanges",length:t.length,start:[],end:[]},n=0;n<t.length;++n)r.start.push(t.start(n)),r.end.push(t.end(n));else r="number"==typeof t?isNaN(t)?"NaN":isFinite(t)?t:0>t?"-Infinity":"Infinity":t;return r}})}function lt(e){return JSON.parse(e,function(e,t){return"NaN"==t?NaN:"-Infinity"==t?-1/0:"Infinity"==t?1/0:t&&"object"==typeof t&&"TimeRanges"==t.__type__?ct(t):t})}function ct(e){return{length:e.length,start:function(t){return e.start[t]},end:function(t){return e.end[t]}}}function ft(e,t,n,r,i){this.J=e,this.l=t,this.B=n,this.G=r,this.v=i,this.c=this.j=this.h=!1,this.A="",this.a=this.i=null,this.b={video:{},player:{}},this.o=0,this.f={},this.g=null}function dt(e){for(var t in e.f){var n=e.f[t];delete e.f[t],n.reject(new u(1,7,7e3))}}function ht(e,t){var n=ut(t);e.a.sendMessage("urn:x-cast:com.google.shaka.v2",n,function(){},s)}function pt(){this.nb=new M,this.Ta=this}function vt(e,t,n){pt.call(this),this.c=e,this.b=t,this.h=this.f=this.g=this.i=this.j=null,this.a=new ft(n,this.ee.bind(this),this.fe.bind(this),this.ge.bind(this),this.Vb.bind(this)),gt(this)}function gt(e){e.a.init(),e.h=new C,Eo.forEach(function(e){N(this.h,this.c,e,this.te.bind(this))}.bind(e)),So.forEach(function(e){N(this.h,this.b,e,this.Id.bind(this))}.bind(e)),e.j={};for(var t in e.c)Object.defineProperty(e.j,t,{configurable:!1,enumerable:!0,get:e.se.bind(e,t),set:e.ue.bind(e,t)});e.i={};for(t in e.b)Object.defineProperty(e.i,t,{configurable:!1,enumerable:!0,get:e.Hd.bind(e,t)});e.g=new pt,e.g.Ta=e.j,e.f=new pt,e.f.Ta=e.i}function yt(e,t,n,r){pt.call(this),this.a=e,this.b=t,this.j={video:e,player:t},this.l=n||function(){},this.o=r||function(e){return e},this.i=!1,this.f=!0,this.h=this.g=this.c=null,mt(this)}function mt(t){var n=cast.receiver.CastReceiverManager.getInstance();n.onSenderConnected=t.jc.bind(t),n.onSenderDisconnected=t.jc.bind(t),n.onSystemVolumeChanged=t.Mc.bind(t),t.g=n.getCastMessageBus("urn:x-cast:com.google.cast.media"),t.g.onMessage=t.hd.bind(t),t.c=n.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),t.c.onMessage=t.vd.bind(t),n.start(),Eo.forEach(function(e){this.a.addEventListener(e,this.mc.bind(this,"video"))}.bind(t)),So.forEach(function(e){this.b.addEventListener(e,this.mc.bind(this,"player"))}.bind(t)),cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?t.b.Jb(3840,2160):t.b.Jb(1920,1080),t.b.addEventListener("loading",function(){this.f=!1,bt(this)}.bind(t)),t.a.addEventListener("playing",function(){this.f=!1,bt(this)}.bind(t)),t.a.addEventListener("pause",function(){bt(this)}.bind(t)),t.b.addEventListener("unloading",function(){this.f=!0,bt(this)}.bind(t)),t.a.addEventListener("ended",function(){e.setTimeout(function(){this.a&&this.a.ended&&(this.f=!0,bt(this))}.bind(this),5e3)}.bind(t))}function bt(e){Promise.resolve().then(function(){this.dispatchEvent(new st("caststatuschanged")),Tt(this,0)}.bind(e))}function _t(e,t,n){for(var r in t.player)e.b[r](t.player[r]);e.l(n),n=Promise.resolve();var i=e.a.autoplay;t.manifest&&(e.a.autoplay=!1,n=e.b.load(t.manifest,t.startTime),n.catch(function(e){this.b.dispatchEvent(new st("error",{detail:e}))}.bind(e))),n.then(function(){var e;for(e in t.video){var n=t.video[e];this.a[e]=n}for(e in t.playerAfterLoad)n=t.playerAfterLoad[e],this.b[e](n);this.a.autoplay=i,t.manifest&&(this.a.play(),Tt(this,0))}.bind(e))}function Et(e,t,n,r){e.i&&(e=ut(t),r?n.getCastChannel(r).send(e):n.broadcast(e))}function Tt(e,t,n){var r=xo,r={mediaSessionId:0,playbackRate:e.a.playbackRate,playerState:e.f?r.IDLE:e.b.ka?r.Ac:e.a.paused?r.Bc:r.Cc,currentTime:e.a.currentTime,supportedMediaCommands:15,volume:{level:e.a.volume,muted:e.a.muted}};n&&(r.media=n),Et(e,{requestId:t,type:"MEDIA_STATUS",status:[r]},e.g)}function wt(e,t){var n=kt(e,t);return 1!=n.length?null:n[0]}function kt(e,t){return Array.prototype.filter.call(e.childNodes,function(e){return e.tagName==t})}function St(e){var t=e.firstChild;return t&&t.nodeType==Node.TEXT_NODE?e.textContent.trim():null}function At(e,t,n,r){var i=null;return e=e.getAttribute(t),null!=e&&(i=n(e)),null==i?void 0!=r?r:null:i}function Ot(e){return e?(e=Date.parse(e),isNaN(e)?null:Math.floor(e/1e3)):null}function Pt(e){return e&&(e=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(e))?(e=31536e3*Number(e[1]||null)+2592e3*Number(e[2]||null)+86400*Number(e[3]||null)+3600*Number(e[4]||null)+60*Number(e[5]||null)+Number(e[6]||null),isFinite(e)?e:null):null}function Rt(e){var t=/([0-9]+)-([0-9]+)/.exec(e);return t?(e=Number(t[1]),isFinite(e)?(t=Number(t[2]),isFinite(t)?{start:e,end:t}:null):null):null}function Dt(e){return e=Number(e),e%1?null:e}function xt(e){return e=Number(e),!(e%1)&&0<e?e:null}function Lt(e){return e=Number(e),!(e%1)&&0<=e?e:null}function It(e){var t;return e=(t=e.match(/^(\d+)\/(\d+)$/))?Number(t[1]/t[2]):Number(e),isNaN(e)?null:e}function Mt(e,t,n){e=Ut(e);var r=null,i=null,a=[],o=[],s=e.map(function(e){return e.keyId}).filter(E);if(0<s.length&&(i=s[0],s.some(T(i))))throw new u(2,4,4010);return n||(o=e.filter(function(e){return"urn:mpeg:dash:mp4protection:2011"!=e.sc||(r=e.init||r,!1)}),0<o.length&&(a=Nt(r,t,o),a.length||(a=[S("",r)]))),0<e.length&&(n||!o.length)&&(a=G(Lo).map(function(e){return S(e,r)})),i&&a.forEach(function(e){e.initData.forEach(function(e){e.keyId=i})}),{Sb:i,ze:r,drmInfos:a,Ub:!0}}function Ct(e,t,n,r){var i=Mt(e,t,r);if(n.Ub)e=1==n.drmInfos.length&&!n.drmInfos[0].keySystem,t=!i.drmInfos.length,(!n.drmInfos.length||e&&!t)&&(n.drmInfos=i.drmInfos),n.Ub=!1;else if(0<i.drmInfos.length&&(n.drmInfos=n.drmInfos.filter(function(e){return i.drmInfos.some(function(t){return t.keySystem==e.keySystem})}),!n.drmInfos.length))throw new u(2,4,4008);return i.Sb||n.Sb}function Nt(e,t,n){return n.map(function(n){var r=Lo[n.sc];return r?[S(r,n.init||e)]:t(n.node)||[]}).reduce(b,[])}function Ut(e){return e.map(function(e){var t=e.getAttribute("schemeIdUri"),n=e.getAttribute("cenc:default_KID"),r=kt(e,"cenc:pssh").map(St);if(!t)return null;if(t=t.toLowerCase(),n&&(n=n.replace(/-/g,"").toLowerCase(),0<=n.indexOf(" ")))throw new u(2,4,4009);var i=[];try{i=r.map(function(e){return{initDataType:"cenc",initData:Z(e),keyId:null}})}catch(e){throw new u(2,4,4007)}return{node:e,sc:t,keyId:n,init:0<i.length?i:null}}).filter(E)}function jt(t,n,r,i,a){null!=a&&(a=Math.round(a));var o={RepresentationID:n,Number:r,Bandwidth:i,Time:a};return t.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)d)?\$/g,function(t,n,r){if("$$"==t)return"$";var i=o[n];return null==i?t:("RepresentationID"==n&&r&&(r=void 0),t=i.toString(),r=e.parseInt(r,10)||1,Array(Math.max(0,r-t.length)+1).join("0")+t)})}function Ft(e,t){var n=Bt(e,t,"timescale"),r=1;n&&(r=xt(n)||1),n=Bt(e,t,"duration"),(n=xt(n||""))&&(n/=r);var i=Bt(e,t,"startNumber"),a=Bt(e,t,"presentationTimeOffset"),o=Lt(i||"");null!=i&&null!=o||(o=1);var s=Gt(e,t,"SegmentTimeline"),i=null;if(s){for(var i=r,u=Number(a),l=e.R.duration||1/0,s=kt(s,"S"),c=[],f=0,d=0;d<s.length;++d){var h=s[d],p=At(h,"t",Lt),v=At(h,"d",Lt),h=At(h,"r",Dt);if(null!=p&&(p-=u),!v)break;if(p=null!=p?p:f,0>(h=h||0))if(d+1<s.length){if(null==(h=At(s[d+1],"t",Lt)))break;if(p>=h)break;h=Math.ceil((h-p)/v)-1}else{if(1/0==l)break;if(p/i>=l)break;h=Math.ceil((l*i-p)/v)-1}0<c.length&&p!=f&&(c[c.length-1].end=p/i);for(var g=0;g<=h;++g)f=p+v,c.push({start:p/i,end:f/i,qe:p}),p=f}i=c}return{timescale:r,P:n,za:o,presentationTimeOffset:Number(a)/r||0,Pb:Number(a),F:i}}function Bt(e,t,n){return[t(e.w),t(e.S),t(e.T)].filter(E).map(function(e){return e.getAttribute(n)}).reduce(function(e,t){return e||t})}function Gt(e,t,n){return[t(e.w),t(e.S),t(e.T)].filter(E).map(function(e){return wt(e,n)}).reduce(function(e,t){return e||t})}function Vt(e,t,n){this.a=e,this.X=t,this.M=n}function Ht(e,t,n,r,i,a){this.position=e,this.startTime=t,this.endTime=n,this.a=r,this.X=i,this.M=a}function Kt(e,t){this.H=e,this.a=t==Io,this.u=0}function Yt(){throw new u(2,3,3e3)}function Wt(){this.b=[],this.a=[]}function qt(e){for(;e.s.Z();)e.Na.eb(e.start,e.s)}function zt(e){for(var t=e.s.D();0<t;--t)e.Na.eb(e.start,e.s)}function Xt(e){return function(t){e(t.s.Ka(t.s.H.byteLength-t.s.u))}}function $t(e){for(var t=0,n=0;n<e.length;n++)t=t<<8|e.charCodeAt(n);return t}function Jt(e,t,n,r){var i,a=(new Wt).da("sidx",function(e){i=Qt(t,r,n,e)});if(e&&a.parse(e),i)return i;throw new u(2,3,3004)}function Qt(e,t,n,r){var i=[];r.s.I(4);var a=r.s.D();if(!a)throw new u(2,3,3005);if(r.version)var o=r.s.Pa(),s=r.s.Pa();else o=r.s.D(),s=r.s.D();r.s.I(2);var l=r.s.oc();for(t=o-t,e=e+r.size+s,s=0;s<l;s++){var c=r.s.D();o=(2147483648&c)>>>31;var c=2147483647&c,f=r.s.D();if(r.s.I(4),1==o)throw new u(2,3,3006);i.push(new Ht(i.length,t/a,(t+f)/a,function(){return n},e,e+c-1)),t+=f,e+=c}return i}function Zt(e){this.a=e}function en(e,t){if(e.a.length){var n=e.a[e.a.length-1];n.startTime>t||(e.a[e.a.length-1]=new Ht(n.position,n.startTime,t,n.a,n.X,n.M))}}function tn(e){this.b=e,this.a=new Kt(e,0),Mo||(Mo=[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 nn(e){var t=rn(e);if(7<t.length)throw new u(2,3,3002);for(var n=0,r=0;r<t.length;r++)n=256*n+t[r];t=n,n=rn(e);e:{for(r=0;r<Mo.length;r++)if(ne(n,Mo[r])){r=!0;break e}r=!1}if(r)n=e.b.byteLength-e.a.u;else{if(8==n.length&&224&n[1])throw new u(2,3,3001);for(var r=n[0]&(1<<8-n.length)-1,i=1;i<n.length;i++)r=256*r+n[i];n=r}return n=e.a.u+n<=e.b.byteLength?n:e.b.byteLength-e.a.u,r=new DataView(e.b.buffer,e.b.byteOffset+e.a.u,n),e.a.I(n),new an(t,r)}function rn(e){var t,n=e.a.Eb();for(t=1;8>=t&&!(n&1<<8-t);t++);if(8<t)throw new u(2,3,3002);var r=new Uint8Array(t);for(r[0]=n,n=1;n<t;n++)r[n]=e.a.Eb();return r}function an(e,t){this.id=e,this.a=t}function on(e){if(8<e.a.byteLength)throw new u(2,3,3002);if(8==e.a.byteLength&&224&e.a.getUint8(0))throw new u(2,3,3001);for(var t=0,n=0;n<e.a.byteLength;n++)var r=e.a.getUint8(n),t=256*t+r;return t}function sn(){}function un(e,t,n,r,i,a){function o(){return i}var s=[];e=new tn(e.a);for(var u=-1,l=-1;e.Z();){var c=nn(e);if(187==c.id){var f=ln(c);f&&(c=n*(f.re-a),f=t+f.Nd,0<=u&&s.push(new Ht(s.length,u,c,o,l,f-1)),u=c,l=f)}}return 0<=u&&s.push(new Ht(s.length,u,r,o,l,null)),s}function ln(e){var t=new tn(e.a);if(e=nn(t),179!=e.id)throw new u(2,3,3013);if(e=on(e),t=nn(t),183!=t.id)throw new u(2,3,3012);for(var t=new tn(t.a),n=0;t.Z();){var r=nn(t);if(241==r.id){n=on(r);break}}return{re:e,Nd:n}}function cn(e,t){var n=Gt(e,t,"Initialization");if(!n)return null;var r=e.w.U,i=n.getAttribute("sourceURL");i&&(r=k(e.w.U,[i]));var i=0,a=null;return(n=At(n,"range",Rt))&&(i=n.start,a=n.end),new Vt(function(){return r},i,a)}function fn(e,t){var n=Bt(e,hn,"presentationTimeOffset"),r=cn(e,hn),i=Number(n),a=e.w.contentType,o=e.w.mimeType.split("/")[1];if("text"!=a&&"mp4"!=o&&"webm"!=o)throw new u(2,4,4006);if("webm"==o&&!r)throw new u(2,4,4005);var a=Gt(e,hn,"RepresentationIndex"),s=Bt(e,hn,"indexRange"),l=e.w.U,s=Rt(s||"");if(a){var c=a.getAttribute("sourceURL");c&&(l=k(e.w.U,[c])),s=At(a,"range",Rt,s)}if(!s)throw new u(2,4,4002);return i=dn(e,t,r,l,s.start,s.end,o,i),{createSegmentIndex:i.createSegmentIndex,findSegmentPosition:i.findSegmentPosition,getSegmentReference:i.getSegmentReference,initSegmentReference:r,presentationTimeOffset:Number(n)||0}}function dn(e,t,n,r,i,a,o,s){var u=e.presentationTimeline,l=!e.Da||!e.R.ub,c=e.R.duration,f=t,d=null;return{createSegmentIndex:function(){var e=[f(r,i,a),"webm"==o?f(n.a(),n.X,n.M):null];return f=null,Promise.all(e).then(function(e){var t=e[0];e=e[1]||null,t="mp4"==o?Jt(t,i,r,s):(new sn).parse(t,e,r,s),u.Ha(0,t),d=new Zt(t),l&&en(d,c)})},findSegmentPosition:function(e){return d.find(e)},getSegmentReference:function(e){return d.get(e)}}}function hn(e){return e.Qa}function pn(e,t){var n=cn(e,vn),r=yn(e),i=Ft(e,vn),a=i.za;a||(a=1);var o=0;if(i.P?o=i.P*(a-1):i.F&&0<i.F.length&&(o=i.F[0].start),r={P:i.P,startTime:o,za:a,presentationTimeOffset:i.presentationTimeOffset,F:i.F,Ga:r},!r.P&&!r.F&&1<r.Ga.length)throw new u(2,4,4002);if(!r.P&&!e.R.duration&&!r.F&&1==r.Ga.length)throw new u(2,4,4002);if(r.F&&!r.F.length)throw new u(2,4,4002);return a=i=null,e.T.id&&e.w.id&&(a=e.T.id+","+e.w.id,i=t[a]),o=gn(e.R.duration,r.za,e.w.U,r),i?(i.xb(o),i.qb(e.presentationTimeline.ma()-e.R.start)):(e.presentationTimeline.Ha(0,o),i=new Zt(o),a&&e.Da&&(t[a]=i)),e.Da&&e.R.ub||en(i,e.R.duration),{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:i.find.bind(i),getSegmentReference:i.get.bind(i),initSegmentReference:n,presentationTimeOffset:r.presentationTimeOffset}}function vn(e){return e.oa}function gn(e,t,n,r){var i=r.Ga.length;r.F&&r.F.length!=r.Ga.length&&(i=Math.min(r.F.length,r.Ga.length));for(var a=[],o=r.startTime,s=0;s<i;s++){var u=r.Ga[s],l=k(n,[u.cd]),c=null!=r.P?o+r.P:r.F?r.F[s].end:o+e;a.push(new Ht(s+t,o,c,function(e){return e}.bind(null,l),u.start,u.end)),o=c}return a}function yn(e){return[e.w.oa,e.S.oa,e.T.oa].filter(E).map(function(e){return kt(e,"SegmentURL")}).reduce(function(e,t){return 0<e.length?e:t}).map(function(t){t.getAttribute("indexRange")&&!e.$b&&(e.$b=!0);var n=t.getAttribute("media");return t=At(t,"mediaRange",Rt,{start:0,end:null}),{cd:n,start:t.start,end:t.end}})}function mn(e,t,n,r){var i=Tn(e),a=Ft(e,bn),o=Bt(e,bn,"media"),s=Bt(e,bn,"index");if(a={P:a.P,timescale:a.timescale,za:a.za,presentationTimeOffset:a.presentationTimeOffset,Pb:a.Pb,F:a.F,wb:o,Ma:s},o=0+(a.Ma?1:0),o+=a.F?1:0,!(o+=a.P?1:0))throw new u(2,4,4002);if(1!=o&&(a.Ma&&(a.F=null),a.P=null),!a.Ma&&!a.wb)throw new u(2,4,4002);if(a.Ma){if("mp4"!=(n=e.w.mimeType.split("/")[1])&&"webm"!=n)throw new u(2,4,4006);if("webm"==n&&!i)throw new u(2,4,4005);r=jt(a.Ma,e.w.id,null,e.bandwidth||null,null),r=k(e.w.U,[r]),e=dn(e,t,i,r,0,null,n,a.presentationTimeOffset)}else a.P?(r||e.presentationTimeline.yb(a.P),e=_n(e,a)):(r=t=null,e.T.id&&e.w.id&&(r=e.T.id+","+e.w.id,t=n[r]),o=En(e,a),t?(t.xb(o),t.qb(e.presentationTimeline.ma()-e.R.start)):(e.presentationTimeline.Ha(0,o),t=new Zt(o),r&&e.Da&&(n[r]=t)),e.Da&&e.R.ub||en(t,e.R.duration),e={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:t.find.bind(t),getSegmentReference:t.get.bind(t)});return{createSegmentIndex:e.createSegmentIndex,findSegmentPosition:e.findSegmentPosition,getSegmentReference:e.getSegmentReference,initSegmentReference:i,presentationTimeOffset:a.presentationTimeOffset}}function bn(e){return e.Ra}function _n(e,t){var n=e.R.duration,r=t.P,i=t.za,a=t.timescale,o=t.wb,s=e.bandwidth||null,u=e.w.id,l=e.w.U;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(e){return 0>e||n&&e>=n?null:Math.floor(e/r)},getSegmentReference:function(e){var t=e*r;return 0>t||n&&t>=n?null:new Ht(e,t,t+r,function(){var n=jt(o,u,e+i,s,t*a);return k(l,[n])},0,null)}}}function En(e,t){for(var n=[],r=0;r<t.F.length;r++){var i=r+t.za;n.push(new Ht(i,t.F[r].start,t.F[r].end,function(e,t,n,r,i,a){return e=jt(e,t,i,n,a),k(r,[e]).map(function(e){return e.toString()})}.bind(null,t.wb,e.w.id,e.bandwidth||null,e.w.U,i,t.F[r].qe+t.Pb),0,null))}return n}function Tn(e){var t=Bt(e,bn,"initialization");if(!t)return null;var n=e.w.id,r=e.bandwidth||null,i=e.w.U;return new Vt(function(){var e=jt(t,n,null,r,null);return k(i,[e])},0,null)}function wn(){var e,t={};for(e in Co)t[e]=!0;for(e in No)t[e]=!0;return["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"].forEach(function(e){t[e]=!!Co[e]}),["mpd","m3u8","ism"].forEach(function(e){t[e]=!!No[e]}),t}function kn(e,t,n,r){var i=r;return i||(r=new l(e).W.split("/").pop().split("."),1<r.length&&(r=r.pop().toLowerCase(),i=No[r])),i?Promise.resolve(i):(n=x([e],n),n.method="HEAD",t.request(0,n).then(function(t){return(t=t.headers["content-type"])&&(t=t.toLowerCase()),(i=Co[t])?i:Promise.reject(new u(2,4,4e3,e))},function(e){return e.severity=2,Promise.reject(e)}))}function Sn(e,t){this.f=e,this.i=t,this.c=this.a=1/0,this.b=1,this.h=0,this.g=!0}function An(){this.a=this.b=null,this.g=[],this.c=null,this.i=[],this.h=1,this.j={},this.l=0,this.f=null}function On(e){return e.a.networkingEngine.request(0,x(e.g,e.b.retryParameters)).then(function(e){if(this.a)return Pn(this,e.data,e.uri)}.bind(e))}function Pn(e,t,n){var r=Y(t),i=new DOMParser,a=null;t=null;try{a=i.parseFromString(r,"text/xml")}catch(e){}if(a&&"MPD"==a.documentElement.tagName&&(t=a.documentElement),t&&0<t.getElementsByTagName("parsererror").length&&(t=null),!t)throw new u(2,4,4001);n=[n],r=kt(t,"Location").map(St).filter(E),0<r.length&&(n=e.g=r),r=kt(t,"BaseURL").map(St),n=k(n,r);var o=At(t,"minBufferTime",Pt);e.l=At(t,"minimumUpdatePeriod",Pt,-1);var s=At(t,"availabilityStartTime",Ot),r=At(t,"timeShiftBufferDepth",Pt),l=At(t,"suggestedPresentationDelay",Pt),i=At(t,"maxSegmentDuration",Pt),a=t.getAttribute("type")||"static";if(e.c)var c=e.c.presentationTimeline;else{var f=Math.max(10,1.5*o);c=new Sn(s,null!=l?l:f)}var s=Rn(e,{Da:"static"!=a,presentationTimeline:c,T:null,R:null,S:null,w:null,bandwidth:void 0,$b:!1},n,t),l=s.duration,d=s.periods;return c.yc("static"==a),c.pa(l||1/0),c.xc(null!=r?r:1/0),c.yb(i||1),e.c?Promise.resolve():(t=kt(t,"UTCTiming"),Un(e,n,t,c.$()).then(function(e){this.a&&(c.wc(e),this.c={presentationTimeline:c,periods:d,offlineSessionIds:[],minBufferTime:o||0})}.bind(e)))}function Rn(e,t,n,r){var i=At(r,"mediaPresentationDuration",Pt),a=[],o=0;r=kt(r,"Period");for(var s=0;s<r.length;s++){var u=r[s],o=At(u,"start",Pt,o),l=At(u,"duration",Pt),c=null;if(s!=r.length-1){var f=At(r[s+1],"start",Pt);null!=f&&(c=f-o)}else null!=i&&(c=i-o);if(null==c&&(c=l),u=Dn(e,t,n,{start:o,duration:c,node:u,ub:null==c||s==r.length-1}),a.push(u),l=t.T.id,e.i.every(T(l))&&(e.a.filterPeriod(u),e.i.push(l),e.c&&e.c.periods.push(u)),null==c){o=null;break}o+=c}return null!=i?{periods:a,duration:i}:{periods:a,duration:o}}function Dn(e,t,n,r){t.T=Mn(r.node,null,n),t.R=r,t.T.id||(t.T.id="__shaka_period_"+r.start),kt(r.node,"EventStream").forEach(e.Fd.bind(e,r.start,r.duration)),n=kt(r.node,"AdaptationSet").map(e.Dd.bind(e,t)).filter(E);var i=n.map(function(e){return e.Pd}).reduce(b,[]),a=i.filter(w);if(t.Da&&i.length!=a.length)throw new u(2,4,4018);var o=n.filter(function(e){return!e.Ob});if(n.filter(function(e){return e.Ob}).forEach(function(e){var t=e.streams[0],n=e.Ob;o.forEach(function(e){e.id==n&&e.streams.forEach(function(e){e.trickModeVideo=t})})}),i=xn(o,"video"),a=xn(o,"audio"),!i.length&&!a.length)throw new u(2,4,4004);for(a.length||(a=[null]),i.length||(i=[null]),t=[],n=0;n<a.length;n++)for(var s=0;s<i.length;s++)Ln(e,a[n],i[s],t);for(e=xn(o,"text"),i=[],n=0;n<e.length;n++)i.push.apply(i,e[n].streams);return{startTime:r.start,textStreams:i,variants:t}}function xn(e,t){return e.filter(function(e){return e.contentType==t})}function Ln(e,t,n,r){if(t||n)if(t&&n){var i=t.drmInfos,a=n.drmInfos;if(i.length&&a.length?0<_e(i,a).length:1)for(var o=_e(t.drmInfos,n.drmInfos),i=0;i<t.streams.length;i++)for(var s=0;s<n.streams.length;s++)a=n.streams[s].bandwidth+t.streams[i].bandwidth,a={id:e.h++,language:t.language,primary:t.vb||n.vb,audio:t.streams[i],video:n.streams[s],bandwidth:a,drmInfos:o,allowedByApplication:!0,allowedByKeySystem:!0},r.push(a)}else for(o=t||n,i=0;i<o.streams.length;i++)a=o.streams[i].bandwidth,a={id:e.h++,language:o.language||"und",primary:o.vb,audio:t?o.streams[i]:null,video:n?o.streams[i]:null,bandwidth:a,drmInfos:o.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},r.push(a)}function In(t,n){0>t.l||(t.f=e.setTimeout(t.he.bind(t),1e3*Math.max(Math.max(3,t.l)-n,0)))}function Mn(e,t,n){t=t||{contentType:"",mimeType:"",codecs:"",containsEmsgBoxes:!1,frameRate:void 0},n=n||t.U;var r=kt(e,"BaseURL").map(St),i=e.getAttribute("contentType")||t.contentType,a=e.getAttribute("mimeType")||t.mimeType,o=e.getAttribute("codecs")||t.codecs,s=At(e,"frameRate",It)||t.frameRate,u=!!kt(e,"InbandEventStream").length;return i||(i=jn(a,o)),{U:k(n,r),Qa:wt(e,"SegmentBase")||t.Qa,oa:wt(e,"SegmentList")||t.oa,Ra:wt(e,"SegmentTemplate")||t.Ra,width:At(e,"width",Lt)||t.width,height:At(e,"height",Lt)||t.height,contentType:i,mimeType:a,codecs:o,frameRate:s,containsEmsgBoxes:u||t.containsEmsgBoxes,id:e.getAttribute("id")}}function Cn(e){var t=0+(e.Qa?1:0);return t+=e.oa?1:0,(t+=e.Ra?1:0)?(1!=t&&(e.Qa&&(e.oa=null),e.Ra=null),!0):"text"==e.contentType||"application"==e.contentType}function Nn(e,t,n,r){return t=k(t,[n]),t=x(t,e.b.retryParameters),t.method=r,e.a.networkingEngine.request(0,t).then(function(e){if("HEAD"==r){if(!e.headers||!e.headers.date)return 0;e=e.headers.date}else e=Y(e.data);return e=Date.parse(e),isNaN(e)?0:e-Date.now()})}function Un(e,t,n,r){n=n.map(function(e){return{scheme:e.getAttribute("schemeIdUri"),value:e.getAttribute("value")}});var i=e.b.dash.clockSyncUri;return r&&!n.length&&i&&n.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:i}),m(n,function(e){var n=e.value;switch(e.scheme){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return Nn(this,t,n,"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 Nn(this,t,n,"GET");case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return e=Date.parse(n),isNaN(e)?0:e-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(e)).catch(function(){return 0})}function jn(e,t){return yo[nt(e,t)]?"text":e.split("/")[0]}function Fn(e,t,n,r){this.uri=e,this.type=t,this.ga=n,this.segments=r||null}function Bn(e,t,n,r){this.id=e,this.name=t,this.a=n,this.value=r||null}function Gn(e,t){this.name=e,this.value=t}function Vn(e,t,n){return n=n||null,(e=e.getAttribute(t))?e.value:n}function Hn(e,t){this.ga=t,this.uri=e}function Kn(e,t){return e.filter(function(e){return e.name==t})}function Yn(e,t){var n=Kn(e,t);return n.length?n[0]:null}function Wn(e,t,n){return e.filter(function(e){var r=e.getAttribute("TYPE");return e=e.getAttribute("GROUP-ID"),r.value==t&&e.value==n})}function qn(e){this.b=e,this.a=0}function zn(e,t){t.lastIndex=e.a;var n=(n=t.exec(e.b))?{position:n.index,length:n[0].length,Sd:n}:null;return e.a!=e.b.length&&n&&n.position==e.a?(e.a+=n.length,n.Sd):null}function Xn(e){return e.a==e.b.length?null:(e=zn(e,/[^ \t\n]*/gm))?e[0]:null}function $n(){this.a=0}function Jn(e,t,n){t=Y(t),t=t.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var r=t.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(r[0]))throw new u(2,4,4015);t=0;for(var i=[],a=1;a<r.length;)if(/^#(?!EXT)/m.test(r[a]))a+=1;else{var o=r[a];if(o=Zn(e.a++,o),0<=Uo.indexOf(o.name))t=1;else if(0<=jo.indexOf(o.name)){if(1!=t)throw new u(2,4,4017);return r=r.splice(a,r.length-a),e=Qn(e,r),new Fn(n,t,i,e)}i.push(o),a+=1,"EXT-X-STREAM-INF"==o.name&&(o.a.push(new Gn("URI",r[a])),a+=1)}return new Fn(n,t,i)}function Qn(e,t){var n=[],r=[];return t.forEach(function(e){/^(#EXT)/.test(e)?(e=Zn(this.a++,e),r.push(e)):/^#(?!EXT)/m.test(e)||(n.push(new Hn(e.trim(),r)),r=[])}.bind(e)),n}function Zn(e,t){var n=t.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!n)throw new u(2,4,4016);var r=n[1],i=n[2],n=[];if(i&&0<=i.indexOf("="))for(var a,i=new qn(i),o=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;a=zn(i,o);)n.push(new Gn(a[1],a[2]||a[3]));else if(i)return new Bn(e,r,n,i);return new Bn(e,r,n)}function er(e){return new Promise(function(t){var n=er.parse(e);t({uri:e,data:n.data,headers:{"content-type":n.contentType}})})}function tr(){this.b=this.c=null,this.i=1,this.g={},this.f={},this.a=null,this.j="",this.h=new $n}function nr(e,t,n){if(t=Jn(e.h,t,n),0!=t.type)throw new u(2,4,4022);return e.a=new Sn(null,0),rr(e,t).then(function(e){return this.c.filterPeriod(e),{presentationTimeline:this.a,periods:[e],offlineSessionIds:[],minBufferTime:0}}.bind(e))}function rr(e,t){var n=Kn(t.ga,"EXT-X-STREAM-INF").map(function(e){return ir(this,e,t)}.bind(e)),r=Kn(t.ga,"EXT-X-MEDIA").filter(function(e){return"SUBTITLES"==gr(e,"TYPE")}.bind(e)).map(function(e){return sr(this,e,t)}.bind(e));return Promise.all(n).then(function(e){return Promise.all(r).then(function(t){var n=e.reduce(b,[]);return dr(this,n),{startTime:0,variants:n,textStreams:t}}.bind(this))}.bind(e))}function ir(e,t,n){var r=Number(gr(t,"BANDWIDTH")),i=Vn(t,"CODECS","avc1.42E01E,mp4a.40.2").split(","),a=t.getAttribute("RESOLUTION"),o=null,s=null,u=Vn(t,"FRAME-RATE");if(a)var l=a.value.split("x"),o=l[0],s=l[1];var c=vr(e,n);n=Kn(n.ga,"EXT-X-MEDIA");var f=Vn(t,"AUDIO"),d=Vn(t,"VIDEO");f?n=Wn(n,"AUDIO",f):d&&(n=Wn(n,"VIDEO",d)),n=n.map(function(e){return ur(this,e,i,c)}.bind(e));var h=[],p=[];return Promise.all(n).then(function(e){if(f?h=e:d&&(p=e),h.length||p.length)var n=h.length?"video":"audio";else 1==i.length?n=a||u?"video":"audio":(n="video",i=[i.join(",")]);return e=i,lr(this,gr(t,"URI"),e,n,c,"und",!1,null)}.bind(e)).then(function(e){return"audio"==e.stream.type?h=[e]:p=[e],ar(this,h,p,r,o,s,u)}.bind(e))}function ar(e,t,n,r,i,a,o){n.forEach(function(e){(e=e.stream)&&(e.width=Number(i)||void 0,e.height=Number(a)||void 0,e.frameRate=Number(o)||void 0)}.bind(e)),t.length||(t=[null]),n.length||(n=[null]);for(var s=[],u=0;u<t.length;u++)for(var l=0;l<n.length;l++){var c=t[u]?t[u].stream:null,f=n[l]?n[l].stream:null,d=t[u]?t[u].drmInfos:null,h=n[l]?n[l].drmInfos:null;if(c&&f){if(!(d.length&&h.length?0<_e(d,h).length:1))continue;var p=_e(d,h)}else c?p=d:f&&(p=h);s.push(or(e,c,f,r,p))}return s}function or(e,t,n,r,i){return{id:e.i++,language:t?t.language:"und",primary:!!t&&t.primary||!!n&&n.primary,audio:t,video:n,bandwidth:r,drmInfos:i,allowedByApplication:!0,allowedByKeySystem:!0}}function sr(e,t,n){return gr(t,"TYPE"),n=vr(e,n),ur(e,t,[],n).then(function(e){return e.stream})}function ur(e,t,n,r){if(e.g[t.id])return Promise.resolve().then(function(){return this.g[t.id]}.bind(e));var i=gr(t,"TYPE").toLowerCase();"subtitles"==i&&(i="text");var a=Ve(Vn(t,"LANGUAGE","und")),o=Vn(t,"NAME"),s=t.getAttribute("DEFAULT"),u=t.getAttribute("AUTOSELECT");return lr(e,gr(t,"URI"),n,i,r,a,!!s||!!u,o).then(function(e){return this.g[t.id]=e}.bind(e))}function lr(e,t,n,r,i,a,o,s){return t=k([e.j],[t])[0],e.c.networkingEngine.request(0,x([t],e.b.retryParameters)).then(function(e){if(e=Jn(this.h,e.data,e.uri),1!=e.type)throw new u(2,4,4017);i=vr(this,e)||i;var t=null;"text"!=r&&(t=cr(e));var l=Yn(e.ga,"EXT-X-MEDIA-SEQUENCE"),l=fr(this,e,l?Number(l.value):0);this.a.Ha(0,l);var c=l[l.length-1].endTime-l[0].startTime,f=this.a.Y();(1/0==f||f<c)&&this.a.pa(c);var d=hr(r,n),h=void 0;"text"==r&&(h="subtitle");var p=new Zt(l),v=[];e.segments.forEach(function(e){e=Kn(e.ga,"EXT-X-KEY"),v.push.apply(v,e)});var g=!1,y=[],m=null;if(v.forEach(function(e){if("NONE"!=gr(e,"METHOD")){g=!0;var t=gr(e,"KEYFORMAT");(e=(t=Ho[t])?t(e):null)&&(e.keyIds.length&&(m=e.keyIds[0]),y.push(e))}}),g&&!y.length)throw new u(2,4,4026);return pr(this,r,l[0].a()[0]).then(function(e){return e={id:this.i++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:p.find.bind(p),getSegmentReference:p.get.bind(p),initSegmentReference:t,presentationTimeOffset:i||0,mimeType:e,codecs:d,kind:h,encrypted:g,keyId:m,language:a,label:s||null,type:r,primary:o,trickModeVideo:null,containsEmsgBoxes:!1,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[]},this.f[e.id]=p,{stream:e,Ae:p,drmInfos:y}}.bind(this))}.bind(e))}function cr(e){var t=Kn(e.ga,"EXT-X-MAP");if(!t.length)return null;if(1<t.length)throw new u(2,4,4020);var t=t[0],n=gr(t,"URI"),r=k([e.uri],[n])[0];return e=0,n=null,(t=Vn(t,"BYTERANGE"))&&(e=t.split("@"),t=Number(e[0]),e=Number(e[1]),n=e+t-1),new Vt(function(){return[r]},e,n)}function fr(e,t,n){var r=t.segments,i=[];return r.forEach(function(e){var a,o=e.ga,s=k([t.uri],[e.uri])[0],u=yr(o).value.split(","),u=Number(u[0]);a=(e=r.indexOf(e))?i[e-1].endTime:0;var u=a+u,l=0,c=null;(o=Yn(o,"EXT-X-BYTERANGE"))&&(o=o.value.split("@"),c=Number(o[0]),l=o[1]?Number(o[1]):i[e-1].M,c=l+c-1,e==r.length-1&&(c=null)),i.push(new Ht(n+e,a,u,function(){return[s]},l,c))}.bind(e)),i}function dr(e,t){t.forEach(function(e){var t=this.a.Y(),n=e.video;e=e.audio,n&&this.f[n.id]&&en(this.f[n.id],t),e&&this.f[e.id]&&en(this.f[e.id],t)}.bind(e))}function hr(e,t){if(1==t.length)return t[0];if("text"==e)return"";var n=Fo;"audio"==e&&(n=Bo);for(var r=0;r<n.length;r++)for(var i=0;i<t.length;i++)if(n[r].test(t[i].trim()))return t[i].trim();throw new u(2,4,4025,t)}function pr(e,t,n){var r=n.split("."),i=r[r.length-1];return"text"==t?Promise.resolve("text/vtt"):(r=Go,"video"==t&&(r=Vo),(t=r[i])?Promise.resolve(t):(n=x([n],e.b.retryParameters),n.method="HEAD",e.c.networkingEngine.request(1,n).then(function(e){if(!(e=e.headers["content-type"]))throw new u(2,4,4021,i);return e})))}function vr(e,t){var n=Yn(t.ga,"EXT-X-START");return n?Number(gr(n,"TIME-OFFSET")):e.b.hls.defaultTimeOffset}function gr(e,t){var n=e.getAttribute(t);if(!n)throw new u(2,4,4023,t);return n.value}function yr(e){if(!(e=Yn(e,"EXTINF")))throw new u(2,4,4024,"EXTINF");return e}function mr(){}function br(e){var t=[];if(!e)return t;for(var n=e.childNodes,r=0;r<n.length;r++){var i="span"==n[r].nodeName&&"p"==e.nodeName;n[r].nodeType!=Node.ELEMENT_NODE||"br"==n[r].nodeName||i||(i=br(n[r]),t=t.concat(i))}return t.length||t.push(e),t}function _r(e,t){for(var n=e.childNodes,r=0;r<n.length;r++)if("br"==n[r].nodeName&&0<r)n[r-1].textContent+="\n";else if(0<n[r].childNodes.length)_r(n[r],t);else if(t){var i=n[r].textContent.trim(),i=i.replace(/\s+/g," ");n[r].textContent=i}}function Er(e,t,n,r){for(var i=br(t),a=0;a<i.length;a++){var o=i[a].getAttribute(r);if(o)return o}return i=Tr,(e=i(t,"style",n)||i(e,"style",n))?e.getAttribute(r):null}function Tr(e,t,n){if(!e||1>n.length)return null;var r=null,i=e;for(e=null;i&&!(e=i.getAttribute(t))&&(i=i.parentNode)instanceof Element;);if(t=e)for(e=0;e<n.length;e++)if(n[e].getAttribute("xml:id")==t){r=n[e];break}return r}function wr(e,t){var n=null;if(Ko.test(e))var n=Ko.exec(e),r=Number(n[1]),i=Number(n[2]),a=Number(n[3]),o=Number(n[4]),o=o+(Number(n[5])||0)/t.b,a=a+o/t.frameRate,n=a+60*i+3600*r;else Yo.test(e)?n=kr(Yo,e):Wo.test(e)?n=kr(Wo,e):qo.test(e)?(n=qo.exec(e),n=Number(n[1])/t.frameRate):zo.test(e)?(n=zo.exec(e),n=Number(n[1])/t.a):Xo.test(e)&&(n=kr(Xo,e));return n}function kr(e,t){var n=e.exec(t);return n&&""!=n[0]?(Number(n[4])||0)/1e3+(Number(n[3])||0)+60*(Number(n[2])||0)+3600*(Number(n[1])||0):null}function Sr(e,t,n,r){this.frameRate=Number(e)||30,this.b=Number(t)||1,this.a=Number(r),this.a||(this.a=e?this.frameRate*this.b:1),n&&(e=/^(\d+) (\d+)$/g.exec(n))&&(this.frameRate*=e[1]/e[2])}function Ar(){this.a=new mr}function Or(){}function Pr(e,t){var n;(n=/^align:(start|middle|center|end|left|right)$/.exec(t))?(e.align=n[1],"center"==n[1]&&"center"!=e.align&&(e.position="auto",e.align="middle")):(n=/^vertical:(lr|rl)$/.exec(t))?e.vertical=n[1]:(n=/^size:(\d{1,2}|100)%$/.exec(t))?e.size=Number(n[1]):(n=/^position:(\d{1,2}|100)%(?:,(line-left|line-right|center|start|end))?$/.exec(t))?(e.position=Number(n[1]),n[2]&&(e.positionAlign=n[2])):(n=/^line:(\d{1,2}|100)%(?:,(start|end|center))?$/.exec(t))?(e.snapToLines=!1,e.line=Number(n[1]),n[2]&&(e.lineAlign=n[2])):(n=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(t))&&(e.snapToLines=!0,e.line=Number(n[1]),n[2]&&(e.lineAlign=n[2]))}function Rr(e){if(!(e=zn(e,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g)))return null;var t=Number(e[2]),n=Number(e[3]);return 59<t||59<n?null:Number(e[4])/1e3+n+60*t+3600*(Number(e[1])||0)}function Dr(){this.a=null}function xr(e,t,n){var r,i,a;return(new Wt).C("payl",Xt(function(e){r=Y(e)})).C("iden",Xt(function(e){i=Y(e)})).C("sttg",Xt(function(e){a=Y(e)})).parse(e),r?Lr(r,i,a,t,n):null}function Lr(e,t,n,r,i){if((e=we(r,i,e))&&t&&(e.id=t),e&&n)for(t=new qn(n),n=Xn(t);n;)Pr(e,n),zn(t,/[ \t]+/gm),n=Xn(t);return e}function Ir(e,t,n,r,i,a){this.a=e,this.c=t,this.l=n,this.A=r,this.J=i,this.G=a,this.b=new C,this.h=!1,this.g=1,this.j=this.f=null,this.B=e.readyState,this.i=!1,this.O=this.v=-1,this.o=!1,0<e.readyState?this.fc():U(this.b,e,"loadedmetadata",this.fc.bind(this)),t=this.hc.bind(this),N(this.b,e,"ratechange",this.rd.bind(this)),N(this.b,e,"waiting",t),this.j=setInterval(t,250)}function Mr(e,t){0<e.a.readyState?e.a.currentTime=Br(e,t):e.A=t}function Cr(e){return 0<e.a.readyState?Br(e,e.a.currentTime):Nr(e)}function Nr(e){return e.A?Br(e,e.A):(e=e.c.presentationTimeline,1/0>e.Y()?e.ma():e.bb())}function Ur(t,n){null!=t.f&&(e.clearInterval(t.f),t.f=null),t.g=n,t.a.playbackRate=t.h||0>n?0:n,!t.h&&0>n&&(t.f=e.setInterval(function(){this.a.currentTime+=n/4}.bind(t),250))}function jr(e,t){var n=Pe.bind(null,e.a.buffered),r=1*Math.max(e.c.minBufferTime||0,e.l.rebufferingGoal),i=e.c.presentationTimeline,a=i.ua(),o=i.Ea(r),s=i.Ea(5),r=i.Ea(r+5);return t>a?a:t<i.Ea(0)?n(s)?s:r:t>=o||n(t)?t:r}function Fr(e,t,n){e.a.currentTime=n;var r=0,i=function(){!this.a||10<=r++||this.a.currentTime!=t||(this.a.currentTime=n,setTimeout(i,100))}.bind(e);setTimeout(i,100)}function Br(e,t){var n=e.c.presentationTimeline.ma();return t<n?n:(n=e.c.presentationTimeline.ua(),t>n?n:t)}function Gr(e,t,n,r,i,a){this.a=e,this.g=t,this.A=n,this.l=r,this.h=i,this.B=a,this.c=[],this.j=new C,this.b=!1,this.i=-1,this.f=null,Hr(this)}function Vr(e){var t=O(e);return t.eventElement=e.eventElement,t}function Hr(t){Kr(t),t.f=e.setTimeout(t.G.bind(t),250)}function Kr(t){t.f&&(e.clearTimeout(t.f),t.f=null)}function Yr(e,t){this.a=t,this.b=e,this.g=null,this.i=1,this.o=Promise.resolve(),this.h=[],this.j={},this.c={},this.f=this.l=this.v=!1}function Wr(e){return e.b.periods[rt(e.b,Cr(e.a.Oa))]}function qr(e){return V(e.c,function(e){return e.na||e.stream})}function zr(e,t){var n={};return n.text=t,Zr(e,n)}function Xr(e,t){var n=e.c.video;if(n){var r=n.stream;if(r)if(t){var i=r.trickModeVideo;if(i){var a=n.na;a||($r(e,"video",i,!1),n.na=r)}}else(a=n.na)&&(n.na=null,$r(e,"video",a,!0))}}function $r(e,t,n,r){var i=e.c[t];if(!i&&"text"==t&&e.g.ignoreTextStreamFailures)zr(e,n);else if(i){var a=it(e.b,n);r&&a!=i.wa?Qr(e):(i.na&&(n.trickModeVideo?(i.na=n,n=n.trickModeVideo):i.na=null),"text"==t&&Le(e.a.K,nt(n.mimeType,n.codecs)),(t=e.h[a])&&t.La&&(t=e.j[n.id])&&t.La&&i.stream!=n&&(i.stream=n,i.cb=!0,r&&(i.sa?i.kb=!0:i.xa?(i.ra=!0,i.kb=!0):(gi(i),pi(e,i,!0)))))}}function Jr(e){var t=Cr(e.a.Oa);Object.keys(e.c).every(function(e){var n=this.a.K;return"text"==e?(e=n.a,e=t>=e.b&&t<e.a):(e=Me(n,e),e=Pe(e,t)),e}.bind(e))||Qr(e)}function Qr(e){for(var t in e.c){var n=e.c[t];n.sa||n.ra||(n.xa?n.ra=!0:null==Ie(e.a.K,t)?null==n.qa&&vi(e,n,0):(gi(n),pi(e,n,!1)))}}function Zr(e,t,n){var r=rt(e.b,Cr(e.a.Oa)),i=V(t,function(e){return nt(e.mimeType,e.codecs)});return e.a.K.init(i),ni(e),i=G(t),ti(e,i).then(function(){if(!this.f)for(var e in t){var i=t[e];this.c[e]||(this.c[e]={stream:i,type:e,Fa:null,ea:null,na:null,cb:!0,wa:r,endOfStream:!1,xa:!1,qa:null,ra:!1,kb:!1,sa:!1,Gb:!1,tb:!1,rc:n||0},vi(this,this.c[e],0))}}.bind(e))}function ei(e,t){var n=e.h[t];if(n)return n.L;n={L:new P,La:!1},e.h[t]=n;var r=e.b.periods[t].variants.map(function(e){var t=[];return e.audio&&t.push(e.audio),e.video&&t.push(e.video),e.video&&e.video.trickModeVideo&&t.push(e.video.trickModeVideo),t}).reduce(b,[]).filter(w);return r.push.apply(r,e.b.periods[t].textStreams),e.o=e.o.then(function(){if(!this.f)return ti(this,r)}.bind(e)).then(function(){this.f||(this.h[t].L.resolve(),this.h[t].La=!0)}.bind(e)).catch(function(e){this.f||(this.h[t].L.reject(),delete this.h[t],this.a.onError(e))}.bind(e)),n.L}function ti(e,t){t.map(function(e){return e.id}).filter(w);for(var n=[],r=0;r<t.length;++r){var i=t[r],a=e.j[i.id];a?n.push(a.L):(e.j[i.id]={L:new P,La:!1},n.push(i.createSegmentIndex()))}return Promise.all(n).then(function(){if(!this.f)for(var e=0;e<t.length;++e){var n=this.j[t[e].id];n.La||(n.L.resolve(),n.La=!0)}}.bind(e)).catch(function(e){if(!this.f)return this.j[i.id].L.reject(),delete this.j[i.id],Promise.reject(e)}.bind(e))}function ni(e){var t=e.b.presentationTimeline.Y();1/0>t?e.a.K.pa(t):e.a.K.pa(Math.pow(2,32))}function ri(e,t){var n=Cr(e.a.Oa),r=t.Fa&&t.ea?e.b.periods[it(e.b,t.Fa)].startTime+t.ea.endTime:Math.max(n,t.rc);t.rc=0;var i=it(e.b,t.stream),a=rt(e.b,r),o=e.a.K,s=t.type;return"text"==s?(o=o.a,o=null==o.a||o.a<n?0:o.a-Math.max(n,o.b)):(o=Me(o,s),o=Re(o,n)),s=Math.max(e.i*Math.max(e.b.minBufferTime||0,e.g.rebufferingGoal),e.i*e.g.bufferingGoal),r>=e.b.presentationTimeline.Y()?(t.endOfStream=!0,null):(t.endOfStream=!1,t.wa=a,a!=i?null:o>=s?.5:(r=e.a.K,a=t.type,r="text"==a?r.a.a:Oe(Me(r,a)),t.ea&&t.stream==t.Fa?(a=t.ea.position+1,r=ii(e,t,i,a)):(a=t.ea?t.stream.findSegmentPosition(Math.max(0,e.b.periods[it(e.b,t.Fa)].startTime+t.ea.endTime-e.b.periods[i].startTime)):t.stream.findSegmentPosition(Math.max(0,(r||n)-e.b.periods[i].startTime)),null==a?r=null:(o=null,null==r&&(o=ii(e,t,i,Math.max(0,a-1))),r=o||ii(e,t,i,a))),r?(ai(e,t,n,i,r),null):1))}function ii(e,t,n,r){return n=e.b.periods[n],(t=t.stream.getSegmentReference(r))?(e=e.b.presentationTimeline,r=e.ua(),n.startTime+t.endTime<e.ma()||n.startTime+t.startTime>r?null:t):null}function ai(e,t,n,r,i){var a=e.b.periods[r],o=t.stream,s=e.b.periods[r+1],u=null,u=s?s.startTime:e.b.presentationTimeline.Y();r=si(e,t,r,u),t.xa=!0,t.cb=!1,s=hi(e,i),Promise.all([r,s]).then(function(e){if(!this.f&&!this.l)return ui(this,t,n,a,o,i,e[1])}.bind(e)).then(function(){this.f||this.l||(t.xa=!1,t.Gb=!1,t.ra||this.a.Ab(),vi(this,t,0),ci(this,o))}.bind(e)).catch(function(e){this.f||this.l||(t.xa=!1,this.b.presentationTimeline.$()&&this.g.infiniteRetriesForLiveStreams&&(1001==e.code||1002==e.code||1003==e.code)?"text"==t.type&&this.g.ignoreTextStreamFailures&&1001==e.code?delete this.c.text:(e.severity=1,this.a.onError(e),vi(this,t,4)):3017==e.code?oi(this,t,e):"text"==t.type&&this.g.ignoreTextStreamFailures?delete this.c.text:(t.tb=!0,e.severity=2,this.a.onError(e)))}.bind(e))}function oi(e,t,n){if(!G(e.c).some(function(e){return e!=t&&e.Gb})){var r=Math.round(100*e.i);if(20<r)e.i-=.2;else{if(!(4<r))return t.tb=!0,e.l=!0,void e.a.onError(n);e.i-=.04}t.Gb=!0}vi(e,t,4)}function si(e,t,n,r){return t.cb?(n=Ue(e.a.K,t.type,e.b.periods[n].startTime-t.stream.presentationTimeOffset,r),t.stream.initSegmentReference?(e=hi(e,t.stream.initSegmentReference).then(function(e){if(!this.f)return Ce(this.a.K,t.type,e,null,null)}.bind(e)).catch(function(e){return t.cb=!0,Promise.reject(e)}),Promise.all([n,e])):n):Promise.resolve()}function ui(e,t,n,r,i,a,o){return i.containsEmsgBoxes&&(new Wt).da("emsg",e.Ed.bind(e,r,a)).parse(o),li(e,t,n).then(function(){if(!this.f)return Ce(this.a.K,t.type,o,a.startTime+r.startTime,a.endTime+r.startTime)}.bind(e)).then(function(){if(!this.f)return t.Fa=i,t.ea=a,Promise.resolve()}.bind(e))}function li(e,t,n){var r=Ie(e.a.K,t.type);return null==r?Promise.resolve():(n=n-r-e.g.bufferBehind,0>=n?Promise.resolve():e.a.K.remove(t.type,r,r+n).then(function(){}.bind(e)))}function ci(e,t){if(!e.v&&(e.v=G(e.c).every(function(e){return"text"==e.type||!e.ra&&!e.sa&&e.ea}),e.v)){var n=it(e.b,t);for(e.h[n]||ei(e,n).then(function(){this.a.ac()}.bind(e)).catch(_),n=0;n<e.b.periods.length;++n)ei(e,n).catch(_);e.a.wd&&e.a.wd()}}function fi(e,t){if(t.wa!=it(e.b,t.stream)){var n=t.wa,r=G(e.c);r.every(function(e){return e.wa==n})&&r.every(di)&&ei(e,n).then(function(){if(!this.f&&r.every(function(e){var t=it(this.b,e.stream);return di(e)&&e.wa==n&&t!=n}.bind(this))){var e,t=this.b.periods[n],i=this.a.bc(t);for(e in this.c)if(!i[e]&&"text"!=e)return void this.a.onError(new u(2,5,5005));for(e in i)if(!this.c[e]){if("text"!=e)return void this.a.onError(new u(2,5,5005));Zr(this,{text:i.text},t.startTime),delete i[e]}for(e in this.c)(t=i[e])?($r(this,e,t,!1),vi(this,this.c[e],0)):delete this.c[e];this.a.ac()}}.bind(e)).catch(_)}}function di(e){return!e.xa&&null==e.qa&&!e.ra&&!e.sa}function hi(e,t){var n=x(t.a(),e.g.retryParameters);if(t.X||null!=t.M){var r="bytes="+t.X+"-";null!=t.M&&(r+=t.M),n.headers.Range=r}return e.a.dd.request(1,n).then(function(e){return e.data})}function pi(e,t,n){t.ra=!1,t.kb=!1,t.sa=!0,Ne(e.a.K,t.type).then(function(){if(!this.f&&n){var e=this.a.K,r=t.type;return"text"==r?Promise.resolve():je(e,r,e.Oc.bind(e,r))}}.bind(e)).then(function(){this.f||(t.Fa=null,t.ea=null,t.sa=!1,t.endOfStream=!1,vi(this,t,0))}.bind(e))}function vi(t,n,r){n.qa=e.setTimeout(t.ke.bind(t,n),1e3*r)}function gi(t){null!=t.qa&&(e.clearTimeout(t.qa),t.qa=null)}function yi(e,t){return new Promise(function(n,r){var i=new XMLHttpRequest;i.open(t.method,e,!0),i.responseType="arraybuffer",i.timeout=t.retryParameters.timeout,i.withCredentials=t.allowCrossSiteCredentials,i.onload=function(t){t=t.target;var i=t.getAllResponseHeaders().split("\r\n").reduce(function(e,t){var n=t.split(": ");return e[n[0].toLowerCase()]=n.slice(1).join(": "),e},{});if(200<=t.status&&299>=t.status&&202!=t.status)t.responseURL&&(e=t.responseURL),n({uri:e,data:t.response,headers:i,fromCache:!!i["x-shaka-from-cache"]});else{var a=null;try{a=q(t.response)}catch(e){}r(new u(401==t.status||403==t.status?2:1,1,1001,e,t.status,a,i))}},i.onerror=function(){r(new u(1,1,1002,e))},i.ontimeout=function(){r(new u(1,1,1003,e))};for(var a in t.headers)i.setRequestHeader(a,t.headers[a]);i.send(t.body)})}function mi(){this.a=null,this.b=[],this.c={}}function bi(e,t,n){return Ti(e,t,"readwrite",function(e){e.put(n)})}function _i(e,t,n){return Ti(e,"segment","readwrite",function(e){for(var r=0;r<t.length;r++)e.delete(t[r]).onsuccess=n||function(){}})}function Ei(e,t){var n=0;return Ti(e,t,"readonly",function(e){e.openCursor(null,"prev").onsuccess=function(e){(e=e.target.result)&&(n=e.key+1)}}).then(function(){return n})}function Ti(e,t,n,r){var i={transaction:e.a.transaction([t],n),L:new P};return i.transaction.oncomplete=function(){this.b.splice(this.b.indexOf(i),1),i.L.resolve()}.bind(e),i.transaction.onabort=function(e){this.b.splice(this.b.indexOf(i),1),ki(i.transaction,i.L,e)}.bind(e),i.transaction.onerror=function(e){e.preventDefault()}.bind(e),t=i.transaction.objectStore(t),r(t),e.b.push(i),i.L}function wi(t,n,r){var i=e.indexedDB.open("shaka_offline_db",1),a=!1,o=new P;return i.onupgradeneeded=function(e){a=!0,e=e.target.result;for(var t in n)e.createObjectStore(t,{keyPath:n[t]})},i.onsuccess=function(e){r&&!a?(e.target.result.close(),setTimeout(function(){wi(this,n,r-1).then(o.resolve,o.reject)}.bind(this),1e3)):(this.a=e.target.result,o.resolve())}.bind(t),i.onerror=ki.bind(null,i,o),o}function ki(e,t,n){e.error?t.reject(new u(2,9,9001,e.error)):t.reject(new u(2,9,9002)),n.preventDefault()}function Si(e){var t=Ai(e.periods[0],[],new Sn(null,0)),n=qe(t,null,null),t=ze(t,null);return n.push.apply(n,t),{offlineUri:"offline:"+e.key,originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:void 0==e.expiration?1/0:e.expiration,tracks:n,appMetadata:e.appMetadata}}function Ai(e,t,n){var r=e.streams.filter(function(e){return"text"==e.contentType});return t=Pi(e.streams.filter(function(e){return"audio"==e.contentType}),e.streams.filter(function(e){return"video"==e.contentType}),t),r=r.map(Di),e.streams.forEach(function(e){e=Oi(e),n.Ha(0,e)}),{startTime:e.startTime,variants:t,textStreams:r}}function Oi(e){return e.segments.map(function(e,t){return new Ht(t,e.startTime,e.endTime,function(){return[e.uri]},0,null)})}function Pi(e,t,n){var r=[];if(!e.length&&!t.length)return r;e.length?t.length||(t=[null]):e=[null];for(var i=0,a=0;a<e.length;a++)for(var o=0;o<t.length;o++)if(Ri(e[a],t[o])){var s=e[a],u=t[o],l=n;s={id:i++,language:s?s.language:"",primary:!!s&&s.primary||!!u&&u.primary,audio:Di(s),video:Di(u),bandwidth:0,drmInfos:l,allowedByApplication:!0,allowedByKeySystem:!0},r.push(s)}return r}function Ri(e,t){if(!(e&&t&&e.variantIds&&t.variantIds))return!0;for(var n=0;n<e.variantIds.length;n++)if(t.variantIds.some(function(t){return t==e.variantIds[n]}))return!0;return!1}function Di(e){if(!e)return null;var t=Oi(e),t=new Zt(t);return{id:e.id,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:t.find.bind(t),getSegmentReference:t.get.bind(t),initSegmentReference:e.initSegmentUri?new Vt(function(){return[e.initSegmentUri]},0,null):null,presentationTimeOffset:e.presentationTimeOffset,mimeType:e.mimeType,codecs:e.codecs,width:e.width||void 0,height:e.height||void 0,frameRate:e.frameRate||void 0,kind:e.kind,encrypted:e.encrypted,keyId:e.keyId,language:e.language,label:e.label||null,type:e.contentType,primary:e.primary,trickModeVideo:null,containsEmsgBoxes:!1,roles:[]}}function xi(){return e.indexedDB?new mi:null}function Li(e,t,n,r){this.b={},this.l=[],this.o=r,this.j=e,this.v=t,this.A=n,this.i=this.a=null,this.f=this.g=this.h=this.c=0}function Ii(e,t,n,r,i){e.b[t]=e.b[t]||[],e.b[t].push({uris:n.a(),X:n.X,M:n.M,Rb:r,Hb:i})}function Mi(e,t){e.c=0,e.h=0,e.g=0,e.f=0,G(e.b).forEach(function(e){e.forEach(function(e){null!=e.M?this.c+=e.M-e.X+1:this.g+=e.Rb}.bind(this))}.bind(e)),e.a=t,e.a.size=e.c;var n=G(e.b).map(function(e){var t=0,n=function(){return this.o?t>=e.length?Promise.resolve():Ci(this,e[t++]).then(n):Promise.reject(new u(2,9,9002))}.bind(this);return n()}.bind(e));return e.b={},e.i=Promise.all(n).then(function(){return bi(this.j,"manifest",t)}.bind(e)).then(function(){this.l=[]}.bind(e)),e.i}function Ci(e,t){var n=x(t.uris,e.A);(t.X||null!=t.M)&&(n.headers.Range="bytes="+t.X+"-"+(null==t.M?"":t.M));var r;return e.v.request(1,n).then(function(e){return this.a?(r=e.data.byteLength,this.l.push(t.Hb.key),t.Hb.data=e.data,bi(this.j,"segment",t.Hb)):Promise.reject(new u(2,9,9002))}.bind(e)).then(function(){if(!this.a)return Promise.reject(new u(2,9,9002));null==t.M?(this.a.size+=r,this.f+=t.Rb):this.h+=r;var e=(this.h+this.f)/(this.c+this.g),n=Si(this.a);this.o.progressCallback(n,e)}.bind(e))}function Ni(){this.a=-1}function Ui(e){var t=new Sn(null,0);t.pa(e.duration);var n=e.drmInfo?[e.drmInfo]:[];return{presentationTimeline:t,minBufferTime:10,offlineSessionIds:e.sessionIds,periods:e.periods.map(function(e){return Ai(e,n,t)})}}function ji(e){if(/^offline:([0-9]+)$/.exec(e)){var t={uri:e,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}};return Promise.resolve(t)}if(t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e)){var n=Number(t[1]),r=xi();return r?r.init(Zo).then(function(){return r.get("segment",n)}).then(function(t){return r.m().then(function(){if(!t)throw new u(2,9,9003,n);return{uri:e,data:t.data,headers:{}}})}):Promise.reject(new u(2,9,9e3))}return Promise.reject(new u(2,1,9004,e))}function Fi(){this.a=Promise.resolve(),this.b=this.c=this.f=!1,this.i=new Promise(function(e){this.g=e}.bind(this))}function Bi(e){return e.f||(e.a=e.a.then(function(e){return this.c=!0,Promise.resolve(e)}.bind(e),function(e){return this.c=!0,this.b?(this.g(),Promise.reject(this.h)):Promise.reject(e)}.bind(e))),e.f=!0,e.a}function Gi(e,t){pt.call(this),this.O=!1,this.f=e,this.A=null,this.l=new C,this.Qb=new at,this.Ya=this.c=this.h=this.a=this.v=this.g=this.Wa=this.ja=this.N=this.j=this.o=null,this.Dc=1e9,this.Va=[],this.ka=!1,this.Za=!0,this.la=this.J=null,this.G={},this.Xa=[],this.B={},this.b=$i(this),this.ob={width:1/0,height:1/0},this.i=Ji(),this.Ua=0,this.ia=this.b.preferredAudioLanguage,this.Ca=this.b.preferredTextLanguage,this.lb=this.mb="",t&&t(this),this.o=new R(this.de.bind(this)),this.Wa=Hi(this);for(var n=0;n<this.f.textTracks.length;++n){var r=this.f.textTracks[n];r.mode="disabled","Shaka Player TextTrack"==r.label&&(this.A=r)}this.A||(this.A=this.f.addTextTrack("subtitles","Shaka Player TextTrack")),this.A.mode="hidden",N(this.l,this.f,"error",this.yd.bind(this))}function Vi(e){function t(e){return(e.video?e.video.codecs.split(".")[0]:"")+"-"+(e.audio?e.audio.codecs.split(".")[0]:"")}var n={};e.c.periods.forEach(function(e){e.variants.forEach(function(e){var r=t(e);r in n||(n[r]=[]),n[r].push(e)})});var r=null,i=1/0;K(n,function(e,t){var n=0,a=0;t.forEach(function(e){n+=e.bandwidth,++a});var o=n/a;o<i&&(r=e,i=o)}),e.c.periods.forEach(function(e){e.variants=e.variants.filter(function(e){return t(e)==r})})}function Hi(t){t.N=new MediaSource;var n=new P;return N(t.l,t.N,"sourceopen",n.resolve),t.f.src=e.URL.createObjectURL(t.N),n}function Ki(e){if(e.h&&e.h.configure(e.b.manifest),e.j&&e.j.configure(e.b.drm),e.a){e.a.configure(e.b.streaming);try{e.c.periods.forEach(e.fb.bind(e))}catch(t){e.ya(t)}na(e,Wr(e.a))}e.b.abr.enabled&&!e.Za?e.b.abr.manager.enable():e.b.abr.manager.disable(),e.b.abr.manager.setDefaultEstimate(e.b.abr.defaultBandwidthEstimate),e.b.abr.manager.setRestrictions(e.b.abr.restrictions)}function Yi(e,t,n){e.i.switchHistory.push({timestamp:Date.now()/1e3,id:t.id,type:t.type,fromAdaptation:n}),Wi(e,t)}function Wi(e,t){var n=it(e.c,t);e.B[n]||(e.B[n]={}),e.B[n][t.type]=t.id}function qi(e){e.l&&(e.l.ha(e.N,"sourceopen"),e.l.ha(e.f,"loadeddata"),e.l.ha(e.f,"playing"),e.l.ha(e.f,"pause"),e.l.ha(e.f,"ended")),e.f&&(e.f.removeAttribute("src"),e.f.load());var t=Promise.all([e.b?e.b.abr.manager.stop():null,e.j?e.j.m():null,e.ja?e.ja.m():null,e.g?e.g.m():null,e.v?e.v.m():null,e.a?e.a.m():null,e.h?e.h.stop():null]);return e.j=null,e.ja=null,e.g=null,e.v=null,e.a=null,e.h=null,e.c=null,e.Ya=null,e.Wa=null,e.N=null,e.Xa=[],e.B={},e.G={},e.i=Ji(),t}function zi(e){return e.h?qi(e).then(function(){this.O||(this.zc(!1),this.Wa=Hi(this))}.bind(e)):Promise.resolve()}function Xi(){return{".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:null}}}function $i(e){return{drm:{retryParameters:D(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1},manifest:{retryParameters:D(),dash:{customScheme:function(e){if(e)return null},clockSyncUri:"",ignoreDrmInfo:!1},hls:{defaultTimeOffset:0}},streaming:{retryParameters:D(),infiniteRetriesForLiveStreams:!0,rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1},abr:{manager:e.Qb,enabled:!0,defaultBandwidthEstimate:5e5,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}}}function Ji(){return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:0,bufferingTime:0,switchHistory:[],stateHistory:[]}}function Qi(e,t,n){for(var r in t){var i=t[r],a=n||!1;"text"==r&&(a=!0),e.Za?e.G[r]={stream:i,Kc:a}:$r(e.a,r,i,a)}}function Zi(e){if(e.c){var t=Date.now()/1e3;e.ka?e.i.bufferingTime+=t-e.Ua:e.i.playTime+=t-e.Ua,e.Ua=t}}function ea(e,t){function n(e,t){if(!e)return null;var n=e.findSegmentPosition(t-i.startTime);return null==n?null:(n=e.getSegmentReference(n))?n.startTime+i.startTime:null}var r=qr(e.a),i=Wr(e.a),a=n(r.video,t),r=n(r.audio,t);return null!=a&&null!=r?Math.max(a,r):null!=a?a:null!=r?r:t}function ta(e,t,n,r,i){if(!n||1>n.length)return e.ya(new u(2,4,4012)),{};e.b.abr.manager.setVariants(n),e.b.abr.manager.setTextStreams(r);var a=[];i&&(a=["video","audio"],t.textStreams.length&&a.push("text")),i=qr(e.a);var o=e.a,s=o.c.video||o.c.audio;if(o=s?o.b.periods[s.wa]:null,t=et(i.audio,i.video,o?o.variants:t.variants)){t.allowedByApplication&&t.allowedByKeySystem||(a.push("audio"),a.push("video"));for(var l in i)t=i[l],"audio"==t.type&&t.language!=n[0].language?a.push(l):"text"==t.type&&0<r.length&&t.language!=r[0].language&&a.push(l)}if(a=a.filter(w),0<a.length){n={};try{n=e.b.abr.manager.chooseStreams(a)}catch(t){e.ya(t)}return n}return{}}function na(e,t){var n,r={audio:!1,text:!1},i=Qe(t,e.ia,r,e.mb),a=Ze(t,e.Ca,r,e.lb),i=ta(e,t,i,a);for(n in i)Yi(e,i[n],!0);Qi(e,i,!0),ra(e),i.text&&i.audio&&r.text&&i.text.language!=i.audio.language&&(e.A.mode="showing",aa(e))}function ra(e){Promise.resolve().then(function(){this.O||this.dispatchEvent(new st("adaptation"))}.bind(e))}function ia(e){Promise.resolve().then(function(){this.O||this.dispatchEvent(new st("trackschanged"))}.bind(e))}function aa(e){e.dispatchEvent(new st("texttrackvisibility"))}function oa(e){if(!e||e.constructor!=Gi)throw new u(2,9,9008);this.a=xi(),this.f=e,this.i=la(this),this.b=null,this.v=!1,this.j=null,this.g=-1,this.l=0,this.c=null,this.h=new Li(this.a,e.o,e.getConfiguration().streaming.retryParameters,this.i)}function sa(){return!!e.indexedDB}function ua(e,t,n,r){function i(){}var a,o,s,u=e.f.o,l=e.f.getConfiguration();return kn(t,u,l.manifest.retryParameters,r).then(function(e){return pa(this),s=new e,s.configure(l.manifest),s.start(t,{networkingEngine:u,filterPeriod:this.o.bind(this),onTimelineRegionAdded:function(){},onEvent:function(){},onError:n})}.bind(e)).then(function(e){return pa(this),a=e,o=new re(u,n,i,function(){}),o.configure(l.drm),o.init(a,!0)}.bind(e)).then(function(){return pa(this),da(a)}.bind(e)).then(function(){return pa(this),oe(o)}.bind(e)).then(function(){return pa(this),s.stop()}.bind(e)).then(function(){return pa(this),{manifest:a,Lc:o}}.bind(e)).catch(function(e){if(s)return s.stop().then(function(){throw e});throw e})}function la(e){return{trackSelectionCallback:e.A.bind(e),progressCallback:function(e,t){if(e||t)return null}}}function ca(e){return e.a?e.a.a?Promise.resolve():e.a.init(Zo):Promise.reject(new u(2,9,9e3))}function fa(e){var t=e.b?e.b.m():Promise.resolve();return e.b=null,e.c=null,e.v=!1,e.j=null,e.g=-1,t}function da(e){var t=e.periods.map(function(e){return e.variants}).reduce(b,[]).map(function(e){var t=[];return e.audio&&t.push(e.audio),e.video&&t.push(e.video),t}).reduce(b,[]).filter(w);return e=e.periods.map(function(e){return e.textStreams}).reduce(b,[]),t.push.apply(t,e),Promise.all(t.map(function(e){return e.createSegmentIndex()}))}function ha(e,t,n,r,i){for(var a=[],o=e.c.presentationTimeline.ma(),s=o,u=n.findSegmentPosition(o),l=null!=u?n.getSegmentReference(u):null;l;)s=e.a.c.segment++,Ii(e.h,n.type,l,(l.endTime-l.startTime)*r/8,{key:s,data:null,manifestKey:e.g,streamNumber:n.id,segmentNumber:s}),a.push({startTime:l.startTime,endTime:l.endTime,uri:"offline:"+e.g+"/"+n.id+"/"+s}),s=l.endTime+t.startTime,l=n.getSegmentReference(++u);return e.l=Math.max(e.l,s-o),t=null,n.initSegmentReference&&(s=e.a.c.segment++,t="offline:"+e.g+"/"+n.id+"/"+s,Ii(e.h,n.contentType,n.initSegmentReference,0,{key:s,data:null,manifestKey:e.g,streamNumber:n.id,segmentNumber:-1})),e=[],null!=i&&e.push(i),{id:n.id,primary:n.primary,presentationTimeOffset:n.presentationTimeOffset||0,contentType:n.type,mimeType:n.mimeType,codecs:n.codecs,frameRate:n.frameRate,kind:n.kind,language:n.language,label:n.label,width:n.width||null,height:n.height||null,initSegmentUri:t,encrypted:n.encrypted,keyId:n.keyId,segments:a,variantIds:e}}function pa(e){if(!e.f)throw new u(2,9,9002)}function va(e){ts.push(e)}function ga(e){var t=e.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();if("function"==typeof Event)var n=new Event(t,e);else n=document.createEvent("Event"),n.initEvent(t,e.bubbles,e.cancelable);e.target.dispatchEvent(n)}function ya(e){this.f=[],this.b=[],this.a=[],(new Wt).da("pssh",this.c.bind(this)).parse(e.buffer)}function ma(e,t){try{var n=new ba(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function ba(e,t){this.keySystem=e;for(var n=!1,r=0;r<t.length;++r){var i=t[r],a={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:i.initDataTypes,sessionTypes:["temporary"],label:i.label},o=!1;if(i.audioCapabilities)for(var s=0;s<i.audioCapabilities.length;++s){var u=i.audioCapabilities[s];if(u.contentType){o=!0;var l=u.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,l)&&(a.audioCapabilities.push(u),n=!0)}}if(i.videoCapabilities)for(s=0;s<i.videoCapabilities.length;++s)u=i.videoCapabilities[s],u.contentType&&(o=!0,l=u.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,l)&&(a.videoCapabilities.push(u),n=!0));if(o||(n=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),"required"==i.persistentState&&(a.persistentState="required",a.sessionTypes=["persistent-license"]),n)return void(this.a=a)}throw i=Error("Unsupported keySystem"),i.name="NotSupportedError",i.code=DOMException.NOT_SUPPORTED_ERR,i}function _a(e){var t=this.mediaKeys;return t&&t!=e&&Ta(t,null),delete this.mediaKeys,(this.mediaKeys=e)?Ta(e,this):Promise.resolve()}function Ea(e){this.a=new MSMediaKeys(e),this.b=new C}function Ta(e,t){function n(){t.msSetMediaKeys(r.a),t.removeEventListener("loadedmetadata",n)}if(j(e.b),!t)return Promise.resolve();N(e.b,t,"msneedkey",ka);var r=e;try{return 1<=t.readyState?t.msSetMediaKeys(e.a):t.addEventListener("loadedmetadata",n),Promise.resolve()}catch(e){return Promise.reject(e)}}function wa(e){pt.call(this),this.c=null,this.g=e,this.b=this.a=null,this.f=new C,this.sessionId="",this.expiration=NaN,this.closed=new P,this.keyStatuses=new Oa}function ka(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("encrypted",!1,!1,null),t.initDataType="cenc";var n=e.initData;if(n){var r=new ya(n);if(1>=r.a.length)e=n;else{var i=[];for(e=0;e<r.a.length;e++)i.push(n.subarray(r.a[e].start,r.a[e].end+1));for(n=L(i,Sa),e=r=0;e<n.length;e++)r+=n[e].length;for(r=new Uint8Array(r),e=i=0;e<n.length;e++)r.set(n[e],i),i+=n[e].length;e=r}}else e=n;t.initData=e,this.dispatchEvent(t)}function Sa(e,t){return ne(e,t)}function Aa(e,t){e.keyStatuses.Kb(t),e.dispatchEvent(new st("keystatuseschange"))}function Oa(){this.size=0,this.a=void 0}function Pa(){return Promise.reject(Error("The key system specified is not supported."))}function Ra(e){return e?Promise.reject(Error("MediaKeys not supported.")):Promise.resolve()}function Da(){throw new TypeError("Illegal constructor.")}function xa(){throw new TypeError("Illegal constructor.")}function La(t){rs=t,is=new Uint8Array([0]).buffer,navigator.requestMediaKeySystemAccess=Ma,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Ca,e.MediaKeys=Ua,e.MediaKeySystemAccess=Na}function Ia(e){var t=rs;return t?t+e.charAt(0).toUpperCase()+e.slice(1):e}function Ma(e,t){try{var n=new Na(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function Ca(e){var t=this.mediaKeys;return t&&t!=e&&ja(t,null),delete this.mediaKeys,(this.mediaKeys=e)&&ja(e,this),Promise.resolve()}function Na(e,t){this.a=this.keySystem=e;var n=!0;"org.w3.clearkey"==e&&(this.a="webkit-org.w3.clearkey",n=!1);for(var r=!1,i=document.getElementsByTagName("video"),a=i.length?i[0]:document.createElement("video"),o=0;o<t.length;++o){i=t[o];var s={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:i.initDataTypes,sessionTypes:["temporary"],label:i.label},u=!1;if(i.audioCapabilities)for(var l=0;l<i.audioCapabilities.length;++l){var c=i.audioCapabilities[l];if(c.contentType){var u=!0,f=c.contentType.split(";")[0];a.canPlayType(f,this.a)&&(s.audioCapabilities.push(c),r=!0)}}if(i.videoCapabilities)for(l=0;l<i.videoCapabilities.length;++l)c=i.videoCapabilities[l],c.contentType&&(u=!0,a.canPlayType(c.contentType,this.a)&&(s.videoCapabilities.push(c),r=!0));if(u||(r=a.canPlayType("video/mp4",this.a)||a.canPlayType("video/webm",this.a)),"required"==i.persistentState&&(n?(s.persistentState="required",s.sessionTypes=["persistent-license"]):r=!1),r)return void(this.b=s)}throw n="Unsupported keySystem","org.w3.clearkey"!=e&&"com.widevine.alpha"!=e||(n="None of the requested configurations were supported."),n=Error(n),n.name="NotSupportedError",n.code=DOMException.NOT_SUPPORTED_ERR,n}function Ua(e){this.g=e,this.b=null,this.a=new C,this.c=[],this.f={}}function ja(e,t){e.b=t,j(e.a);var n=rs;t&&(N(e.a,t,n+"needkey",e.Cd.bind(e)),N(e.a,t,n+"keymessage",e.Bd.bind(e)),N(e.a,t,n+"keyadded",e.zd.bind(e)),N(e.a,t,n+"keyerror",e.Ad.bind(e)))}function Fa(e,t){var n=e.f[t];return n||((n=e.c.shift())?(n.sessionId=t,e.f[t]=n):null)}function Ba(e,t,n){pt.call(this),this.f=e,this.h=!1,this.a=this.b=null,this.c=t,this.g=n,this.sessionId="",this.expiration=NaN,this.closed=new P,this.keyStatuses=new Ha}function Ga(e,t,n){if(e.h)return Promise.reject(Error("The session is already initialized."));e.h=!0;try{if("persistent-license"==e.g)if(n)var r=new Uint8Array(z("LOAD_SESSION|"+n));else{var i=z("PERSISTENT|"),a=new Uint8Array(i.byteLength+t.byteLength);a.set(new Uint8Array(i),0),a.set(new Uint8Array(t),i.byteLength),r=a}else r=new Uint8Array(t)}catch(e){return Promise.reject(e)}e.b=new P;var o=Ia("generateKeyRequest");try{e.f[o](e.c,r)}catch(t){if("InvalidStateError"!=t.name)return e.b=null,Promise.reject(t);setTimeout(function(){try{this.f[o](this.c,r)}catch(e){this.b.reject(e),this.b=null}}.bind(e),10)}return e.b}function Va(e,t){e.keyStatuses.Kb(t),e.dispatchEvent(new st("keystatuseschange"))}function Ha(){this.size=0,this.a=void 0}function Ka(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=e.apply(this,arguments);return t.abort=function(){},t}}function Ya(){var e=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream=function(){for(var t,n=0,r=0;r<this.sourceBuffers.length;++r)t=this.sourceBuffers[r],t=t.buffered.end(t.buffered.length-1),n=Math.max(n,t);if(!isNaN(this.duration)&&n<this.duration)for(this.Zb=!0,r=0;r<this.sourceBuffers.length;++r)t=this.sourceBuffers[r],t.Tb=!1;return e.apply(this,arguments)};var t=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var e=t.apply(this,arguments);return e.N=this,e.addEventListener("updateend",Wa,!1),this.a||(this.addEventListener("sourceclose",qa,!1),this.a=!0),e}}function Wa(e){var t=e.target,n=t.N;if(n.Zb){for(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t.Tb=!0,e=0;e<n.sourceBuffers.length;++e)if(0==n.sourceBuffers[e].Tb)return;n.Zb=!1}}function qa(e){e=e.target;for(var t=0;t<e.sourceBuffers.length;++t)e.sourceBuffers[t].removeEventListener("updateend",Wa,!1);e.removeEventListener("sourceclose",qa,!1)}function za(e){if(this.c=[],this.b=[],this.Aa=as,e)try{e(this.fa.bind(this),this.a.bind(this))}catch(e){this.a(e)}}function Xa(e){var t=new za;return t.fa(void 0),t.then(function(){return e})}function $a(e){var t=new za;return t.a(e),t}function Ja(e){function t(e,t,n){e.Aa==as&&(i[t]=n,++r==i.length&&e.fa(i))}var n=new za;if(!e.length)return n.fa([]),n;for(var r=0,i=Array(e.length),a=n.a.bind(n),o=0;o<e.length;++o)e[o]&&e[o].then?e[o].then(t.bind(null,n,o),a):t(n,o,e[o]);return n}function Qa(e){for(var t=new za,n=t.fa.bind(t),r=t.a.bind(t),i=0;i<e.length;++i)e[i]&&e[i].then?e[i].then(n,r):n(e[i]);return t}function Za(e,t,n){ss.push(function(){if(n&&"function"==typeof n){try{var e=n(this.jb)}catch(e){return void t.a(e)}try{var r=e&&e.then}catch(e){return void t.a(e)}e instanceof za?e==t?t.a(new TypeError("Chaining cycle detected")):e.then(t.fa.bind(t),t.a.bind(t)):r?eo(e,r,t):t.fa(e)}else 1==this.Aa?t.fa(this.jb):t.a(this.jb)}.bind(e)),null==os&&(os=no(to))}function eo(e,t,n){try{var r=!1;t.call(e,function(e){if(!r){r=!0;try{var t=e&&e.then}catch(e){return void n.a(e)}t?eo(e,t,n):n.fa(e)}},n.a.bind(n))}catch(e){n.a(e)}}function to(){for(;ss.length;){null!=os&&(ro(os),os=null);var e=ss;ss=[];for(var t=0;t<e.length;++t)e[t]()}}function no(){return 0}function ro(){}function io(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function ao(t,n,r){return new e.TextTrackCue(t,n,r)}function oo(t,n,r){return new e.TextTrackCue(t+"-"+n+"-"+r,t,n,r)}var so,uo=this;uo.we=!0,o.prototype.setDefaultEstimate=function(e){this.b=e},o.prototype.getBandwidthEstimate=function(){return 128e3>this.a?this.b:Math.min(a(this.c),a(this.f))},t("shaka.util.Error",u),u.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},u.Severity={RECOVERABLE:1,CRITICAL:2},u.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},u.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,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};var lo=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;so=l.prototype,so.aa="",so.Ba="",so.ca="",so.Ja=null,so.W="",so.ta="",so.toString=function(){var e=[],t=this.aa;if(t&&e.push(p(t,co,!0),":"),t=this.ca){e.push("//");var n=this.Ba;n&&e.push(p(n,co,!0),"@"),e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t=this.Ja,null!=t&&e.push(":",String(t))}return(t=this.W)&&(this.ca&&"/"!=t.charAt(0)&&e.push("/"),e.push(p(t,"/"==t.charAt(0)?ho:fo,!0))),(t=this.a.toString())&&e.push("?",t),(t=this.ta)&&e.push("#",p(t,vo)),e.join("")},so.resolve=function(e){var t=new l(this);"data"===t.aa&&(t=new l);var n=!!e.aa;n?c(t,e.aa):n=!!e.Ba,n?t.Ba=e.Ba:n=!!e.ca,n?t.ca=e.ca:n=null!=e.Ja;var r=e.W;if(n)f(t,e.Ja);else if(n=!!e.W){if("/"!=r.charAt(0))if(this.ca&&!this.W)r="/"+r;else{var i=t.W.lastIndexOf("/");-1!=i&&(r=t.W.substr(0,i+1)+r)}if(".."==r||"."==r)r="";else if(-1!=r.indexOf("./")||-1!=r.indexOf("/.")){for(var i=!r.lastIndexOf("/",0),r=r.split("/"),a=[],o=0;o<r.length;){var s=r[o++];"."==s?i&&o==r.length&&a.push(""):".."==s?((1<a.length||1==a.length&&""!=a[0])&&a.pop(),i&&o==r.length&&a.push("")):(a.push(s),i=!0)}r=a.join("/")}}return n?t.W=r:n=""!==e.a.toString(),n?d(t,y(e.a)):n=!!e.ta,n&&(t.ta=e.ta),t};var co=/[#\/\?@]/g,fo=/[\#\?:]/g,ho=/[\#\?]/g,po=/[\#\?@]/g,vo=/#/g;g.prototype.a=null,g.prototype.c=null,g.prototype.toString=function(){if(this.b)return this.b;if(!this.a)return"";var e,t=[];for(e in this.a)for(var n=encodeURIComponent(e),r=this.a[e],i=0;i<r.length;i++){var a=n;""!==r[i]&&(a+="="+encodeURIComponent(r[i])),t.push(a)}return this.b=t.join("&")},t("shaka.net.NetworkingEngine",R),R.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3};var go={};R.registerScheme=function(e,t){go[e]=t},R.unregisterScheme=function(e){delete go[e]},R.prototype.Ld=function(e){this.b.push(e)},R.prototype.registerRequestFilter=R.prototype.Ld,R.prototype.oe=function(e){var t=this.b;0<=(e=t.indexOf(e))&&t.splice(e,1)},R.prototype.unregisterRequestFilter=R.prototype.oe,R.prototype.Ic=function(){this.b=[]},R.prototype.clearAllRequestFilters=R.prototype.Ic,R.prototype.Md=function(e){this.c.push(e)},R.prototype.registerResponseFilter=R.prototype.Md,R.prototype.pe=function(e){var t=this.c;0<=(e=t.indexOf(e))&&t.splice(e,1)},R.prototype.unregisterResponseFilter=R.prototype.pe,R.prototype.Jc=function(){this.c=[]},R.prototype.clearAllResponseFilters=R.prototype.Jc,R.prototype.m=function(){this.f=!0,this.b=[],this.c=[];for(var e=[],t=0;t<this.a.length;++t)e.push(this.a[t].catch(_));return Promise.all(e)},R.prototype.destroy=R.prototype.m,R.prototype.request=function(t,n){if(this.f)return Promise.reject();n.method=n.method||"GET",n.headers=n.headers||{},n.retryParameters=n.retryParameters?O(n.retryParameters):D(),n.uris=O(n.uris);var r=Date.now(),i=Promise.resolve();return this.b.forEach(function(e){i=i.then(e.bind(null,t,n))}),i=i.catch(function(e){throw new u(2,1,1006,e)}),i=i.then(function(){for(var i=Date.now()-r,a=n.retryParameters||{},o=a.maxAttempts||1,s=a.backoffFactor||2,a=null==a.baseDelay?1e3:a.baseDelay,u=this.g(t,n,0,i),l=1;l<o;l++)u=u.catch(function(r,a,o){if(o&&1==o.severity){o=new P;var s=n.retryParameters||{};return e.setTimeout(o.resolve,r*(1+(2*Math.random()-1)*(null==s.fuzzFactor?.5:s.fuzzFactor))),o.then(this.g.bind(this,t,n,a,i))}throw o}.bind(this,a,l%n.uris.length)),a*=s;return u}.bind(this)),this.a.push(i),i.then(function(e){return 0<=this.a.indexOf(i)&&this.a.splice(this.a.indexOf(i),1),this.h&&!e.fromCache&&1==t&&this.h(e.timeMs,e.data.byteLength),e}.bind(this)).catch(function(e){return e&&(e.severity=2),0<=this.a.indexOf(i)&&this.a.splice(this.a.indexOf(i),1),Promise.reject(e)}.bind(this))},R.prototype.request=R.prototype.request,R.prototype.g=function(e,t,n,r){if(this.f)return Promise.reject();var i=new l(t.uris[n]),a=i.aa;if(a||(a=location.protocol,a=a.slice(0,-1),c(i,a),t.uris[n]=i.toString()),!(a=go[a]))return Promise.reject(new u(2,1,1e3,i));var o=Date.now();return a(t.uris[n],t,e).then(function(t){void 0==t.timeMs&&(t.timeMs=Date.now()-o);var n=Date.now(),i=Promise.resolve();return this.c.forEach(function(n){i=i.then(function(){return Promise.resolve(n(e,t))}.bind(this))}),i=i.catch(function(e){var t=2;throw e instanceof u&&(t=e.severity),new u(t,1,1007,e)}),i.then(function(){return t.timeMs+=Date.now()-n,t.timeMs+=r,t})}.bind(this))},M.prototype.push=function(e,t){this.a.hasOwnProperty(e)?this.a[e].push(t):this.a[e]=[t]},M.prototype.get=function(e){return(e=this.a[e])?e.slice():null},M.prototype.remove=function(e,t){var n=this.a[e];if(n)for(var r=0;r<n.length;++r)n[r]==t&&(n.splice(r,1),--r)},C.prototype.m=function(){return j(this),this.a=null,Promise.resolve()},C.prototype.ha=function(e,t){if(this.a)for(var n=this.a.get(t)||[],r=0;r<n.length;++r){var i=n[r];i.target==e&&(i.ha(),this.a.remove(t,i))}},F.prototype.ha=function(){this.target.removeEventListener(this.type,this.a,!1),this.a=this.target=null},t("shaka.util.StringUtils.fromUTF8",Y),t("shaka.util.StringUtils.fromUTF16",W),t("shaka.util.StringUtils.fromBytesAutoDetect",q),t("shaka.util.StringUtils.toUTF8",z),$.prototype.cancel=function(){null!=this.a&&(clearTimeout(this.a),this.a=null)},t("shaka.util.Uint8ArrayUtils.toBase64",Q),t("shaka.util.Uint8ArrayUtils.fromBase64",Z),t("shaka.util.Uint8ArrayUtils.fromHex",ee),t("shaka.util.Uint8ArrayUtils.toHex",te),t("shaka.util.Uint8ArrayUtils.equal",ne),t("shaka.util.Uint8ArrayUtils.concat",function(e){for(var t=0,n=0;n<arguments.length;++n)t+=arguments[n].length;for(var t=new Uint8Array(t),r=0,n=0;n<arguments.length;++n)t.set(arguments[n],r),r+=arguments[n].length;return t}),so=re.prototype,so.m=function(){this.c=!0;var e=this.a.map(function(e){return(e.ba.close()||Promise.resolve()).catch(_)});return this.l.reject(),this.f&&e.push(this.f.m()),this.j&&e.push(this.j.setMediaKeys(null).catch(_)),this.O&&(clearInterval(this.O),this.O=null),this.B&&this.B.cancel(),this.f=this.j=this.i=this.v=this.b=this.B=null,this.a=[],this.o=[],this.la=this.g=this.h=this.ka=null,Promise.all(e)},so.configure=function(e){this.h=e},so.init=function(e,t){var n={},r=[];return this.ja=t,this.o=e.offlineSessionIds,ue(this,e,t||0<e.offlineSessionIds.length,n,r),r.length?le(this,n,r):(this.J=!0,Promise.resolve())},so.keySystem=function(){return this.b?this.b.keySystem:""},so.ab=function(){var e=this.a.map(function(e){return e=e.ba.expiration,isNaN(e)?1/0:e});return Math.min.apply(Math,e)},so.fd=function(e){for(var t=new Uint8Array(e.initData),n=0;n<this.a.length;++n)if(ne(t,this.a[n].initData))return;ve(this,e.initDataType,t)},so.kc=function(e){this.h.delayLicenseRequestUntilPlayed&&this.j.paused&&!this.ia?this.G.push(e):ge(this,e)},so.ec=function(e){e=e.target;var t;for(t=0;t<this.a.length&&this.a[t].ba!=e;++t);if(t!=this.a.length){var n=!1;e.keyStatuses.forEach(function(e,r){if("string"==typeof r){var i=r;r=e,e=i}if("com.microsoft.playready"==this.b.keySystem&&16==r.byteLength){var i=new DataView(r),a=i.getUint32(0,!0),o=i.getUint16(4,!0),s=i.getUint16(6,!0);i.setUint32(0,a,!1),i.setUint16(4,o,!1),i.setUint16(6,s,!1)}"com.microsoft.playready"==this.b.keySystem&&"status-pending"==e&&(e="usable"),"status-pending"!=e&&(this.a[t].loaded=!0,this.a.every(function(e){return e.loaded})&&this.l.resolve()),"expired"==e&&(n=!0),i=te(new Uint8Array(r)),this.A[i]=e}.bind(this));var r=e.expiration-Date.now();(0>r||n&&1e3>r)&&!this.a[t].ib&&(this.a.splice(t,1),e.close()),J(this.B)}},so.Kd=function(){function e(e,t){return"expired"==t}!B(this.A)&&H(this.A,e)&&this.g(new u(2,6,6014)),this.Ca(this.A)},so.qd=function(){for(var e=0;e<this.G.length;e++)ge(this,this.G[e]);this.ia=!0,this.G=[]},so.Jd=function(){this.a.forEach(function(e){var t=e.zb,n=e.ba.expiration;isNaN(n)&&(n=1/0),n!=t&&(this.la(e.ba.sessionId,n),e.zb=n)}.bind(this))};var yo={};t("shaka.media.TextEngine.registerParser",Te),t("shaka.media.TextEngine.unregisterParser",function(e){delete yo[e]}),t("shaka.media.TextEngine.makeCue",we),Ee.prototype.m=function(){return this.c&&Se(this,function(){return!0}),this.c=this.f=null,Promise.resolve()},Ee.prototype.remove=function(e,t){return Promise.resolve().then(function(){this.c&&(Se(this,function(n){return!(n.startTime>=t||n.endTime<=e)}),null==this.b||t<=this.b||e>=this.a||(e<=this.b&&t>=this.a?this.b=this.a=null:e<=this.b&&t<this.a?this.b=t:e>this.b&&t>=this.a&&(this.a=e)))}.bind(this))},Ae.prototype.parseInit=function(e){this.Na(e,0,null,null)},Ae.prototype.parseMedia=function(e,t){return this.Na(e,t.periodStart,t.segmentStart,t.segmentEnd)},so=De.prototype,so.m=function(){this.h=!0;var e,t=[];for(e in this.b){var n=this.b[e],r=n[0];for(this.b[e]=n.slice(0,1),r&&t.push(r.p.catch(_)),r=1;r<n.length;++r)n[r].p.catch(_),n[r].p.reject()}return this.a&&t.push(this.a.m()),Promise.all(t).then(function(){this.g.m(),this.a=this.i=this.N=this.f=this.g=null,this.c={},this.b={}}.bind(this))},so.init=function(e){for(var t in e){var n=e[t];"text"==t?Le(this,n):(n=this.N.addSourceBuffer(n),N(this.g,n,"error",this.je.bind(this,t)),N(this.g,n,"updateend",this.Ia.bind(this,t)),this.c[t]=n,this.b[t]=[])}},so.remove=function(e,t,n){return"text"==e?this.a.remove(t,n):je(this,e,this.qc.bind(this,e,t,n))},so.endOfStream=function(e){return Fe(this,function(){e?this.N.endOfStream(e):this.N.endOfStream()}.bind(this))},so.pa=function(e){return Fe(this,function(){this.N.duration=e}.bind(this))},so.Y=function(){return this.N.duration},so.ie=function(e,t){this.c[e].appendBuffer(t)},so.qc=function(e,t,n){n<=t?this.Ia(e):this.c[e].remove(t,n)},so.Ec=function(e){var t=this.c[e].appendWindowEnd;this.c[e].abort(),this.c[e].appendWindowEnd=t,this.Ia(e)},so.Oc=function(e){this.f.currentTime-=.001,this.Ia(e)},so.Zd=function(e,t){this.c[e].timestampOffset=t,this.Ia(e)},so.Xd=function(e,t){this.c[e].appendWindowEnd=t+.04,this.Ia(e)},so.je=function(e){this.b[e][0].p.reject(new u(2,3,3014,this.f.error?this.f.error.code:0))},so.Ia=function(e){var t=this.b[e][0];t&&(t.p.resolve(),Be(this,e))};var mo=1,bo=2,_o={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"};t("shaka.abr.SimpleAbrManager",at),at.prototype.stop=function(){this.f=null,this.b=!1,this.h=[],this.g=[],this.c=null},at.prototype.stop=at.prototype.stop,at.prototype.init=function(e){this.f=e},at.prototype.init=at.prototype.init,at.prototype.chooseStreams=function(e){var t={};if(-1<e.indexOf("audio")||-1<e.indexOf("video")){var n=this.h,r=ot(this.i,n),i=this.a.getBandwidthEstimate();if(n.length&&!r.length)throw new u(2,4,4012);for(var n=r[0],a=0;a<r.length;++a){var o=r[a],s=(r[a+1]||{bandwidth:1/0}).bandwidth/.85;i>=o.bandwidth/.95&&i<=s&&(n=o)}(r=n)&&r.video&&(t.video=r.video),r&&r.audio&&(t.audio=r.audio)}return-1<e.indexOf("text")&&(t.text=this.g[0]),this.c=Date.now(),t},at.prototype.chooseStreams=at.prototype.chooseStreams,at.prototype.enable=function(){this.b=!0},at.prototype.enable=at.prototype.enable,at.prototype.disable=function(){this.b=!1},at.prototype.disable=at.prototype.disable,at.prototype.segmentDownloaded=function(e,t){var n=this.a;if(!(16e3>t)){var r=8e3*t/e,a=e/1e3;n.a+=t,i(n.c,a,r),i(n.f,a,r)}if(null!=this.c&&this.b)e:{if(this.j){if(8e3>Date.now()-this.c)break e}else{if(!(128e3<=this.a.a))break e;this.j=!0}n=this.chooseStreams(["audio","video"]),this.a.getBandwidthEstimate(),this.f(n)}},at.prototype.segmentDownloaded=at.prototype.segmentDownloaded,at.prototype.getBandwidthEstimate=function(){return this.a.getBandwidthEstimate()},at.prototype.getBandwidthEstimate=at.prototype.getBandwidthEstimate,at.prototype.setDefaultEstimate=function(e){this.a.setDefaultEstimate(e)},at.prototype.setDefaultEstimate=at.prototype.setDefaultEstimate,at.prototype.setRestrictions=function(e){this.i=e},at.prototype.setRestrictions=at.prototype.setRestrictions,at.prototype.setVariants=function(e){this.h=e},at.prototype.setVariants=at.prototype.setVariants,at.prototype.setTextStreams=function(e){this.g=e},at.prototype.setTextStreams=at.prototype.setTextStreams,st.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},st.prototype.stopImmediatePropagation=function(){this.a=!0},st.prototype.stopPropagation=function(){};var Eo="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),To="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),wo=["loop","playbackRate"],ko=["pause","play"],So="adaptation buffering emsg error loading unloading texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged".split(" "),Ao="drmInfo getAudioLanguages getConfiguration getExpiration getManifestUri getPlaybackRate getPlayheadTimeAsDate getTextLanguages getTextTracks getTracks getStats getVariantTracks isBuffering isInProgress isLive isTextTrackVisible keySystem seekRange".split(" "),Oo=[["getConfiguration","configure"]],Po=[["isTextTrackVisible","setTextTrackVisibility"]],Ro="addTextTrack cancelTrickPlay configure resetConfiguration selectAudioLanguage selectTextLanguage selectTextTrack selectTrack selectVariantTrack setTextTrackVisibility trickPlay".split(" "),Do=["load","unload"];so=ft.prototype,so.m=function(){return dt(this),this.a&&(this.a.leave(function(){},function(){}),this.a=null),this.G=this.B=this.l=null,this.c=this.j=this.h=!1,this.g=this.f=this.b=this.i=null,Promise.resolve()},so.V=function(){return this.c},so.Fb=function(){return this.A},so.init=function(){if(e.chrome&&chrome.cast&&chrome.cast.isAvailable){delete e.__onGCastApiAvailable,this.h=!0,this.l();var t=new chrome.cast.SessionRequest(this.J),t=new chrome.cast.ApiConfig(t,this.gd.bind(this),this.sd.bind(this),"origin_scoped");chrome.cast.initialize(t,function(){},function(){})}else e.__onGCastApiAvailable=function(e){e&&this.init()}.bind(this)},so.Ib=function(e){this.i=e,this.c&&ht(this,{type:"appData",appData:this.i})},so.cast=function(e){return this.h?this.j?this.c?Promise.reject(new u(1,8,8002)):(this.g=new P,chrome.cast.requestSession(this.Bb.bind(this,e),this.cc.bind(this)),this.g):Promise.reject(new u(1,8,8001)):Promise.reject(new u(1,8,8e3))},so.$a=function(){this.c&&(dt(this),this.a&&(this.a.stop(function(){},function(){}),this.a=null))},so.get=function(e,t){if("video"==e){if(0<=ko.indexOf(t))return this.pc.bind(this,e,t)}else if("player"==e){if(0<=Ro.indexOf(t))return this.pc.bind(this,e,t);if(0<=Do.indexOf(t))return this.Od.bind(this,e,t);if(0<=Ao.indexOf(t))return this.lc.bind(this,e,t)}return this.lc(e,t)},so.set=function(e,t,n){this.b[e][t]=n,ht(this,{type:"set",targetName:e,property:t,value:n})},so.Bb=function(e,t){this.a=t,this.a.addUpdateListener(this.dc.bind(this)),this.a.addMessageListener("urn:x-cast:com.google.shaka.v2",this.md.bind(this)),this.dc(),ht(this,{type:"init",initState:e,appData:this.i}),this.g.resolve()},so.cc=function(e){var t=8003;switch(e.code){case"cancel":t=8004;break;case"timeout":t=8005;break;case"receiver_unavailable":t=8006}this.g.reject(new u(2,8,t,e))},so.lc=function(e,t){return this.b[e][t]},so.pc=function(e,t){ht(this,{type:"call",targetName:e,methodName:t,args:Array.prototype.slice.call(arguments,2)})},so.Od=function(e,t){var n=Array.prototype.slice.call(arguments,2),r=new P,i=this.o.toString();return this.o++,this.f[i]=r,ht(this,{type:"asyncCall",targetName:e,methodName:t,args:n,id:i}),r},so.gd=function(e){var t=this.v();this.g=new P,this.Bb(t,e)},so.sd=function(e){this.j="available"==e,this.l()},so.dc=function(){var e=!!this.a&&"connected"==this.a.status;if(this.c&&!e){this.G();for(var t in this.b)this.b[t]={};dt(this)}this.A=(this.c=e)?this.a.receiver.friendlyName:"",this.l()},so.md=function(e,t){var n=lt(t);switch(n.type){case"event":var r=n.targetName,i=n.event;this.B(r,new st(i.type,i));break;case"update":i=n.update;for(r in i){var n=this.b[r]||{};for(a in i[r])n[a]=i[r][a]}break;case"asyncComplete":r=n.id;var a=n.error;if(n=this.f[r],delete this.f[r],n)if(a){r=new u(a.severity,a.category,a.code);for(i in a)r[i]=a[i];n.reject(r)}else n.resolve()}},pt.prototype.addEventListener=function(e,t){this.nb.push(e,t)},pt.prototype.removeEventListener=function(e,t){this.nb.remove(e,t)},pt.prototype.dispatchEvent=function(e){for(var t=this.nb.get(e.type)||[],n=0;n<t.length;++n){e.target=this.Ta,e.currentTarget=this.Ta;var r=t[n];try{r.handleEvent?r.handleEvent(e):r.call(this,e)}catch(e){}if(e.a)break}return e.defaultPrevented},n(vt),t("shaka.cast.CastProxy",vt),vt.prototype.m=function(e){return e&&this.a&&this.a.$a(),e=[this.h?this.h.m():null,this.b?this.b.m():null,this.a?this.a.m():null],this.a=this.h=this.i=this.j=this.b=this.c=null,Promise.all(e)},vt.prototype.destroy=vt.prototype.m,vt.prototype.Zc=function(){return this.j},vt.prototype.getVideo=vt.prototype.Zc,vt.prototype.Tc=function(){return this.i},vt.prototype.getPlayer=vt.prototype.Tc,vt.prototype.Fc=function(){return!!this.a&&(this.a.h&&this.a.j)},vt.prototype.canCast=vt.prototype.Fc,vt.prototype.V=function(){return!!this.a&&this.a.V()},vt.prototype.isCasting=vt.prototype.V,vt.prototype.Fb=function(){return this.a?this.a.Fb():""},vt.prototype.receiverName=vt.prototype.Fb,vt.prototype.cast=function(){var e=this.Vb();return this.a.cast(e).then(function(){return this.b.hb()}.bind(this))},vt.prototype.cast=vt.prototype.cast,vt.prototype.Ib=function(e){this.a.Ib(e)},vt.prototype.setAppData=vt.prototype.Ib,vt.prototype.me=function(){var e=this.a;if(e.c){var t=e.v();chrome.cast.requestSession(e.Bb.bind(e,t),e.cc.bind(e))}},vt.prototype.suggestDisconnect=vt.prototype.me,vt.prototype.$a=function(){this.a.$a()},vt.prototype.forceDisconnect=vt.prototype.$a,so=vt.prototype,so.Vb=function(){var e={video:{},player:{},playerAfterLoad:{},manifest:this.b.Ya,startTime:null};return this.c.pause(),wo.forEach(function(t){e.video[t]=this.c[t]}.bind(this)),this.c.ended||(e.startTime=this.c.currentTime),Oo.forEach(function(t){var n=t[1];t=this.b[t[0]](),e.player[n]=t}.bind(this)),Po.forEach(function(t){var n=t[1];t=this.b[t[0]](),e.playerAfterLoad[n]=t}.bind(this)),e},so.ee=function(){this.dispatchEvent(new st("caststatuschanged"))},so.ge=function(){Oo.forEach(function(e){var t=e[1];e=this.a.get("player",e[0])(),this.b[t](e)}.bind(this));var e=this.a.get("player","getManifestUri")(),t=this.a.get("video","ended"),n=Promise.resolve(),r=this.c.autoplay,i=null;t||(i=this.a.get("video","currentTime")),e&&(this.c.autoplay=!1,n=this.b.load(e,i),n.catch(function(e){this.b.dispatchEvent(new st("error",{detail:e}))}.bind(this)));var a={};wo.forEach(function(e){a[e]=this.a.get("video",e)}.bind(this)),n.then(function(){wo.forEach(function(e){this.c[e]=a[e]}.bind(this)),Po.forEach(function(e){var t=e[1];e=this.a.get("player",e[0])(),this.b[t](e)}.bind(this)),this.c.autoplay=r,e&&this.c.play()}.bind(this))},so.se=function(e){if("addEventListener"==e)return this.g.addEventListener.bind(this.g);if("removeEventListener"==e)return this.g.removeEventListener.bind(this.g);if(this.a.V()&&!Object.keys(this.a.b.video).length){var t=this.c[e];if("function"!=typeof t)return t}return this.a.V()?this.a.get("video",e):(t=this.c[e],"function"==typeof t&&(t=t.bind(this.c)),t)},so.ue=function(e,t){this.a.V()?this.a.set("video",e,t):this.c[e]=t},so.te=function(e){this.a.V()||this.g.dispatchEvent(new st(e.type,e))},so.Hd=function(e){return"addEventListener"==e?this.f.addEventListener.bind(this.f):"removeEventListener"==e?this.f.removeEventListener.bind(this.f):"getNetworkingEngine"==e?this.b.Wb.bind(this.b):this.a.V()&&!Object.keys(this.a.b.video).length&&0<=Ao.indexOf(e)||!this.a.V()?(e=this.b[e],e.bind(this.b)):this.a.get("player",e)},so.Id=function(e){this.a.V()||this.f.dispatchEvent(e)},so.fe=function(e,t){this.a.V()&&("video"==e?this.g.dispatchEvent(t):"player"==e&&this.f.dispatchEvent(t))},n(yt),t("shaka.cast.CastReceiver",yt),yt.prototype.isConnected=function(){return this.i},yt.prototype.isConnected=yt.prototype.isConnected,yt.prototype.ad=function(){return this.f},yt.prototype.isIdle=yt.prototype.ad,yt.prototype.m=function(){var t=this.b?this.b.m():Promise.resolve();return null!=this.h&&e.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,t.then(function(){cast.receiver.CastReceiverManager.getInstance().stop()})},yt.prototype.destroy=yt.prototype.m,so=yt.prototype,so.jc=function(){this.i=!!cast.receiver.CastReceiverManager.getInstance().getSenders().length,bt(this)},so.mc=function(e,t){this.Cb(),Et(this,{type:"event",targetName:e,event:t},this.c)},so.Cb=function(){null!=this.h&&e.clearTimeout(this.h),this.h=e.setTimeout(this.Cb.bind(this),500);var t={video:{},player:{}};To.forEach(function(e){t.video[e]=this.a[e]}.bind(this)),Ao.forEach(function(e){t.player[e]=this.b[e]()}.bind(this));var n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();n&&(t.video.volume=n.level,t.video.muted=n.muted),Et(this,{type:"update",update:t},this.c)},so.Mc=function(){var e=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();e&&Et(this,{type:"update",update:{video:{volume:e.level,muted:e.muted}}},this.c),Et(this,{type:"event",targetName:"video",event:{type:"volumechange"}},this.c)},so.vd=function(e){var t=lt(e.data);switch(t.type){case"init":_t(this,t.initState,t.appData),this.Cb();break;case"appData":this.l(t.appData);break;case"set":var n=t.targetName,r=t.property,i=t.value;if("video"==n){if(t=cast.receiver.CastReceiverManager.getInstance(),"volume"==r){t.setSystemVolumeLevel(i);break}if("muted"==r){t.setSystemVolumeMuted(i);break}}this.j[n][r]=i;break;case"call":n=t.targetName,r=t.methodName,i=t.args,n=this.j[n],n[r].apply(n,i);break;case"asyncCall":n=t.targetName,r=t.methodName,i=t.args,t=t.id,e=e.senderId,n=this.j[n],n[r].apply(n,i).then(this.vc.bind(this,e,t,null),this.vc.bind(this,e,t))}},so.hd=function(e){var t=lt(e.data);switch(t.type){case"PLAY":this.a.play(),Tt(this,0);break;case"PAUSE":this.a.pause(),Tt(this,0);break;case"SEEK":e=t.currentTime;var n=t.resumeState;null!=e&&(this.a.currentTime=Number(e)),n&&"PLAYBACK_START"==n?(this.a.play(),Tt(this,0)):n&&"PLAYBACK_PAUSE"==n&&(this.a.pause(),Tt(this,0));break;case"STOP":this.b.hb().then(function(){Tt(this,0)}.bind(this));break;case"GET_STATUS":Tt(this,Number(t.requestId));break;case"VOLUME":n=t.volume,e=n.level;var n=n.muted,r=this.a.volume,i=this.a.muted;null!=e&&(this.a.volume=Number(e)),null!=n&&(this.a.muted=n),r==this.a.volume&&i==this.a.muted||Tt(this,0);break;case"LOAD":n=t.media.contentId,e=t.currentTime;var a=this.o(n);this.a.autoplay=!0,this.b.load(a,e).then(function(){Tt(this,0,{contentId:a,streamType:this.b.$()?"LIVE":"BUFFERED",contentType:""})}.bind(this)).catch(function(e){var n="LOAD_FAILED";7==e.category&&7e3==e.code&&(n="LOAD_CANCELLED"),Et(this,{requestId:Number(t.requestId),type:n},this.g)}.bind(this));break;default:Et(this,{requestId:Number(t.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},this.g)}},so.vc=function(e,t,n){Et(this,{type:"asyncComplete",id:t,error:n},this.c,e)};var xo={IDLE:"IDLE",Cc:"PLAYING",Ac:"BUFFERING",Bc:"PAUSED"},Lo={"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"};t("shaka.media.InitSegmentReference",Vt),t("shaka.media.SegmentReference",Ht),t("shaka.util.DataViewReader",Kt);var Io=1;Kt.Endianness={ve:0,xe:Io},Kt.prototype.Z=function(){return this.u<this.H.byteLength},Kt.prototype.hasMoreData=Kt.prototype.Z,Kt.prototype.Vc=function(){return this.u},Kt.prototype.getPosition=Kt.prototype.Vc,Kt.prototype.Qc=function(){return this.H.byteLength},Kt.prototype.getLength=Kt.prototype.Qc,Kt.prototype.Eb=function(){try{var e=this.H.getUint8(this.u)}catch(e){Yt()}return this.u+=1,e},Kt.prototype.readUint8=Kt.prototype.Eb,Kt.prototype.oc=function(){try{var e=this.H.getUint16(this.u,this.a)}catch(e){Yt()}return this.u+=2,e},Kt.prototype.readUint16=Kt.prototype.oc,Kt.prototype.D=function(){try{var e=this.H.getUint32(this.u,this.a)}catch(e){Yt()}return this.u+=4,e},Kt.prototype.readUint32=Kt.prototype.D,Kt.prototype.nc=function(){try{var e=this.H.getInt32(this.u,this.a)}catch(e){Yt()}return this.u+=4,e},Kt.prototype.readInt32=Kt.prototype.nc,Kt.prototype.Pa=function(){try{if(this.a)var e=this.H.getUint32(this.u,!0),t=this.H.getUint32(this.u+4,!0);else t=this.H.getUint32(this.u,!1),e=this.H.getUint32(this.u+4,!1)}catch(e){Yt()}if(2097151<t)throw new u(2,3,3001);return this.u+=8,t*Math.pow(2,32)+e},Kt.prototype.readUint64=Kt.prototype.Pa,Kt.prototype.Ka=function(e){this.u+e>this.H.byteLength&&Yt();var t=this.H.buffer.slice(this.u,this.u+e);return this.u+=e,new Uint8Array(t)},Kt.prototype.readBytes=Kt.prototype.Ka,Kt.prototype.I=function(e){this.u+e>this.H.byteLength&&Yt(),this.u+=e},Kt.prototype.skip=Kt.prototype.I,Kt.prototype.Db=function(){for(var e=this.u;this.Z()&&this.H.getUint8(this.u);)this.u+=1;return e=this.H.buffer.slice(e,this.u),this.u+=1,Y(e)},Kt.prototype.readTerminatedString=Kt.prototype.Db,t("shaka.util.Mp4Parser",Wt),Wt.prototype.C=function(e,t){var n=$t(e);return this.b[n]=0,this.a[n]=t,this},Wt.prototype.box=Wt.prototype.C,Wt.prototype.da=function(e,t){var n=$t(e);return this.b[n]=1,this.a[n]=t,this},Wt.prototype.fullBox=Wt.prototype.da,Wt.prototype.parse=function(e){for(e=new Kt(new DataView(e),0);e.Z();)this.eb(0,e)},Wt.prototype.parse=Wt.prototype.parse,Wt.prototype.eb=function(e,t){var n=t.u,r=t.D(),i=t.D();switch(r){case 0:r=t.H.byteLength-n;break;case 1:r=t.Pa()}var a=this.a[i];if(a){var o=null,s=null;1==this.b[i]&&(s=t.D(),o=s>>>24,s&=16777215),i=n+r-t.u,i=0<i?t.Ka(i).buffer:new ArrayBuffer(0),i=new Kt(new DataView(i),0),a({Na:this,version:o,Nc:s,s:i,size:r,start:n+e})}else t.I(n+r-t.u)},Wt.prototype.parseNext=Wt.prototype.eb,Wt.children=qt,Wt.sampleDescription=zt,Wt.allData=Xt,t("shaka.media.SegmentIndex",Zt),Zt.prototype.m=function(){return this.a=null,Promise.resolve()},Zt.prototype.destroy=Zt.prototype.m,Zt.prototype.find=function(e){for(var t=this.a.length-1;0<=t;--t){var n=this.a[t];if(e>=n.startTime&&e<n.endTime)return n.position}return this.a.length&&e<this.a[0].startTime?this.a[0].position:null},Zt.prototype.find=Zt.prototype.find,Zt.prototype.get=function(e){return this.a.length?(e-=this.a[0].position,0>e||e>=this.a.length?null:this.a[e]):null},Zt.prototype.get=Zt.prototype.get,Zt.prototype.xb=function(e){for(var t,n,r=[],i=n=0;n<this.a.length&&i<e.length;){var a=this.a[n];t=e[i],a.startTime<t.startTime?(r.push(a),n++):(a.startTime>t.startTime||(.1<Math.abs(a.endTime-t.endTime)?r.push(t):r.push(a),n++),i++)}for(;n<this.a.length;)r.push(this.a[n++]);if(r.length)for(n=r[r.length-1].position+1;i<e.length;)t=e[i++],t=new Ht(n++,t.startTime,t.endTime,t.a,t.X,t.M),r.push(t);else r=e;this.a=r},Zt.prototype.merge=Zt.prototype.xb,Zt.prototype.qb=function(e){for(var t=0;t<this.a.length&&!(this.a[t].endTime>e);++t);this.a.splice(0,t)},Zt.prototype.evict=Zt.prototype.qb;var Mo;tn.prototype.Z=function(){return this.a.Z()},sn.prototype.parse=function(e,t,n,r){var i;if(t=new tn(new DataView(t)),440786851!=nn(t).id)throw new u(2,3,3008);var a=nn(t);if(408125543!=a.id)throw new u(2,3,3009);for(t=a.a.byteOffset,a=new tn(a.a),i=null;a.Z();){var o=nn(a);if(357149030==o.id){i=o;break}}if(!i)throw new u(2,3,3010);for(a=new tn(i.a),i=1e6,o=null;a.Z();){var s=nn(a);if(2807729==s.id)i=on(s);else if(17545==s.id)if(o=s,4==o.a.byteLength)o=o.a.getFloat32(0);else{if(8!=o.a.byteLength)throw new u(2,3,3003);o=o.a.getFloat64(0)}}if(null==o)throw new u(2,3,3011);if(a=i/1e9,i=o*a,e=nn(new tn(new DataView(e))),475249515!=e.id)throw new u(2,3,3007);return un(e,t,a,i,n,r)};var Co={},No={};t("shaka.media.ManifestParser.registerParserByExtension",function(e,t){No[e]=t}),t("shaka.media.ManifestParser.registerParserByMime",function(e,t){Co[e]=t}),t("shaka.media.PresentationTimeline",Sn),Sn.prototype.Y=function(){return this.a},Sn.prototype.getDuration=Sn.prototype.Y,Sn.prototype.pa=function(e){this.a=e},Sn.prototype.setDuration=Sn.prototype.pa,Sn.prototype.Wc=function(){return this.f},Sn.prototype.getPresentationStartTime=Sn.prototype.Wc,Sn.prototype.wc=function(e){this.h=e},Sn.prototype.setClockOffset=Sn.prototype.wc,Sn.prototype.yc=function(e){this.g=e},Sn.prototype.setStatic=Sn.prototype.yc,Sn.prototype.Xc=function(){return this.c},Sn.prototype.getSegmentAvailabilityDuration=Sn.prototype.Xc,Sn.prototype.xc=function(e){this.c=e},Sn.prototype.setSegmentAvailabilityDuration=Sn.prototype.xc,Sn.prototype.Ha=function(e,t){t.length&&(this.b=t.reduce(function(e,t){return Math.max(e,t.endTime-t.startTime)},this.b))},Sn.prototype.notifySegments=Sn.prototype.Ha,Sn.prototype.yb=function(e){this.b=Math.max(this.b,e)},Sn.prototype.notifyMaxSegmentDuration=Sn.prototype.yb,Sn.prototype.$=function(){return 1/0==this.a&&!this.g},Sn.prototype.isLive=Sn.prototype.$,Sn.prototype.va=function(){return 1/0!=this.a&&!this.g},Sn.prototype.isInProgress=Sn.prototype.va,Sn.prototype.ma=function(){return this.Ea(0)},Sn.prototype.getSegmentAvailabilityStart=Sn.prototype.ma,Sn.prototype.Ea=function(e){if(1/0==this.c)return 0;var t=this.ua();return Math.max(0,Math.min(t-this.c+e,t))},Sn.prototype.getSafeAvailabilityStart=Sn.prototype.Ea,Sn.prototype.ua=function(){return this.$()||this.va()?Math.min(Math.max(0,(Date.now()+this.h)/1e3-this.b-this.f),this.a):this.a},Sn.prototype.getSegmentAvailabilityEnd=Sn.prototype.ua,Sn.prototype.bb=function(){return Math.max(0,this.ua()-(this.$()||this.va()?this.i:0))},Sn.prototype.getSeekRangeEnd=Sn.prototype.bb,t("shaka.dash.DashParser",An),so=An.prototype,so.configure=function(e){this.b=e},so.start=function(e,t){return this.g=[e],this.a=t,On(this).then(function(){return this.a&&In(this,0),this.c}.bind(this))},so.stop=function(){return this.b=this.a=null,this.g=[],this.c=null,this.i=[],this.j={},null!=this.f&&(e.clearTimeout(this.f),this.f=null),Promise.resolve()},so.update=function(){On(this).catch(function(e){this.a&&this.a.onError(e)}.bind(this))},so.onExpirationUpdated=function(){},so.Dd=function(e,t){e.S=Mn(t,e.T,null);var n=!1,r=kt(t,"Role"),i=r.map(function(e){return e.getAttribute("value")}).filter(E),a=void 0;"text"==e.S.contentType&&(a="subtitle");for(var o=0;o<r.length;o++){var s=r[o].getAttribute("schemeIdUri");if(null==s||"urn:mpeg:dash:role:2011"==s)switch(s=r[o].getAttribute("value")){case"main":n=!0;break;case"caption":case"subtitle":a=s}}var l=null,c=!1;if(kt(t,"EssentialProperty").forEach(function(e){"http://dashif.org/guidelines/trickmode"==e.getAttribute("schemeIdUri")?l=e.getAttribute("value"):c=!0}),c)return null;var r=kt(t,"ContentProtection"),f=Mt(r,this.b.dash.customScheme,this.b.dash.ignoreDrmInfo),r=Ve(t.getAttribute("lang")||"und"),s=t.getAttribute("label"),o=kt(t,"Representation"),i=o.map(this.Gd.bind(this,e,f,a,r,s,n,i)).filter(function(e){return!!e});if(!i.length)throw new u(2,4,4003);return e.S.contentType&&"application"!=e.S.contentType||(e.S.contentType=jn(i[0].mimeType,i[0].codecs),i.forEach(function(t){t.type=e.S.contentType})),i.forEach(function(e){f.drmInfos.forEach(function(t){e.keyId&&t.keyIds.push(e.keyId)})}),a=o.map(function(e){return e.getAttribute("id")}).filter(E),{id:e.S.id||"__fake__"+this.h++,contentType:e.S.contentType,language:r,vb:n,streams:i,drmInfos:f.drmInfos,Ob:l,Pd:a}},so.Gd=function(e,t,n,r,i,a,o,s){if(e.w=Mn(s,e.S,null),!Cn(e.w))return null;e.bandwidth=At(s,"bandwidth",xt)||void 0;var u=this.Qd.bind(this);if(e.w.Qa)u=fn(e,u);else if(e.w.oa)u=pn(e,this.j);else if(e.w.Ra)u=mn(e,u,this.j,!!this.c);else{var l=e.w.U,c=e.R.duration||0;u={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(e){return 0<=e&&e<c?1:null},getSegmentReference:function(e){return 1!=e?null:new Ht(1,0,c,function(){return l},0,null)},initSegmentReference:null,presentationTimeOffset:0}}return s=kt(s,"ContentProtection"),s=Ct(s,this.b.dash.customScheme,t,this.b.dash.ignoreDrmInfo),{id:this.h++,createSegmentIndex:u.createSegmentIndex,findSegmentPosition:u.findSegmentPosition,getSegmentReference:u.getSegmentReference,initSegmentReference:u.initSegmentReference,presentationTimeOffset:u.presentationTimeOffset,mimeType:e.w.mimeType,codecs:e.w.codecs,frameRate:e.w.frameRate,bandwidth:e.bandwidth,width:e.w.width,height:e.w.height,kind:n,encrypted:0<t.drmInfos.length,keyId:s,language:r,label:i,type:e.S.contentType,primary:a,trickModeVideo:null,containsEmsgBoxes:e.w.containsEmsgBoxes,roles:o}},so.he=function(){this.f=null;var e=Date.now();On(this).then(function(){this.a&&In(this,(Date.now()-e)/1e3)}.bind(this)).catch(function(e){this.a&&(e.severity=1,this.a.onError(e),In(this,0))}.bind(this))},so.Fd=function(e,t,n){var r=n.getAttribute("schemeIdUri")||"",i=n.getAttribute("value")||"",a=At(n,"timescale",Lt)||1;kt(n,"Event").forEach(function(n){var o=At(n,"presentationTime",Lt)||0,s=At(n,"duration",Lt)||0,o=o/a+e,s=o+s/a;null!=t&&(o=Math.min(o,e+t),s=Math.min(s,e+t)),n={schemeIdUri:r,value:i,startTime:o,endTime:s,id:n.getAttribute("id")||"",eventElement:n},this.a.onTimelineRegionAdded(n)}.bind(this))},so.Qd=function(e,t,n){return e=x(e,this.b.retryParameters),null!=t&&(e.headers.Range="bytes="+t+"-"+(null!=n?n:"")),this.a.networkingEngine.request(1,e).then(function(e){return e.data})},No.mpd=An,Co["application/dash+xml"]=An,Bn.prototype.toString=function(){function e(e){return e.name+'="'+e.value+'"'}return this.value?"#"+this.name+":"+this.value:0<this.a.length?"#"+this.name+":"+this.a.map(e).join(","):"#"+this.name},Bn.prototype.getAttribute=function(e){var t=this.a.filter(function(t){return t.name==e});return t.length?t[0]:null};var Uo="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-MAP EXT-X-I-FRAMES-ONLY".split(" "),jo="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE".split(" ");t("shaka.net.DataUriPlugin",er),er.parse=function(t){var n=t.split(":");if(2>n.length||"data"!=n[0])throw new u(2,1,1004,t);if(n=n.slice(1).join(":").split(","),2>n.length)throw new u(2,1,1004,t);var r=n[0],n=e.decodeURIComponent(n.slice(1).join(",")),r=r.split(";"),i=null;if(1<r.length&&(i=r[1]),"base64"==i)t=Z(n).buffer;else{if(i)throw new u(2,1,1005,t);t=z(n)}return{data:t,contentType:r[0]}},go.data=er,t("shaka.hls.HlsParser",tr),so=tr.prototype,so.configure=function(e){this.b=e},so.start=function(e,t){return this.c=t,this.j=e,this.c.networkingEngine.request(0,x([e],this.b.retryParameters)).then(function(t){return nr(this,t.data,e)}.bind(this))},so.stop=function(){return this.b=this.c=null,this.g={},Promise.resolve()},so.update=function(){},so.onExpirationUpdated=function(){};var Fo=[/^(avc)/,/^(hvc)/,/^(vp[8-9])$/,/^(av1)$/,/^(mp4v)/],Bo=[/^(vorbis)/,/^(opus)/,/^(mp4a)/,/^(ac-3)$/,/^(ec-3)$/],Go={mp4:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",ts:"video/mp2t"},Vo={mp4:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",ts:"video/mp2t"},Ho={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(e){if("SAMPLE-AES-CENC"!=gr(e,"METHOD"))return null;var t=gr(e,"URI"),t=er.parse(t),t=new Uint8Array(t.data),t=S("com.widevine.alpha",[{initDataType:"cenc",initData:t}]);return(e=Vn(e,"KEYID"))&&(t.keyIds=[e.substr(2).toLowerCase()]),t}};No.m3u8=tr,Co["application/x-mpegurl"]=tr,Co["application/vnd.apple.mpegurl"]=tr,mr.prototype.parseInit=function(){},mr.prototype.parseMedia=function(e,t){var n=Y(e),r=[],i=new DOMParser,a=null;try{a=i.parseFromString(n,"text/xml")}catch(e){throw new u(2,2,2005)}if(a){var o=a.getElementsByTagName("tt")[0];if(!o)throw new u(2,2,2005);i=o.getAttribute("ttp:frameRate"),a=o.getAttribute("ttp:subFrameRate");var s=o.getAttribute("ttp:frameRateMultiplier"),l=o.getAttribute("ttp:tickRate");if("default"!=(n=o.getAttribute("xml:space")||"default")&&"preserve"!=n)throw new u(2,2,2005);for(n="default"==n,i=new Sr(i,a,s,l),a=br(o.getElementsByTagName("styling")[0]),s=br(o.getElementsByTagName("layout")[0]),o=br(o.getElementsByTagName("body")[0]),l=0;l<o.length;l++){var c=o[l],f=t.periodStart,d=i,h=a,p=s,v=n;if(c.hasAttribute("begin")||c.hasAttribute("end")||!/^\s*$/.test(c.textContent)){_r(c,v);var v=wr(c.getAttribute("begin"),d),g=wr(c.getAttribute("end"),d),d=wr(c.getAttribute("dur"),d),y=c.textContent;if(null==g&&null!=d&&(g=v+d),null==v||null==g)throw new u(2,2,2001);(f=we(v+f,g+f,y))?(v=Tr(c,"region",p),p=f,(g=Er(c,v,h,"tts:extent"))&&(d=$o.exec(g))&&(p.size=Number(d[1])),d=Er(c,v,h,"tts:writingMode"),g=!0,"tb"==d||"tblr"==d?p.vertical="lr":"tbrl"==d?p.vertical="rl":g=!1,(d=Er(c,v,h,"tts:origin"))&&(d=$o.exec(d))&&(g?(p.position=Number(d[2]),p.line=Number(d[1])):(p.position=Number(d[1]),p.line=Number(d[2])),p.snapToLines=!1),(h=Er(c,v,h,"tts:textAlign"))&&(p.align=h,"center"==h&&("center"!=p.align&&(p.align="middle"),p.position="auto"),p.positionAlign=Qo[h],p.lineAlign=Jo[h]),h=f):h=null}else h=null;h&&r.push(h)}}return r};var Ko=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Yo=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Wo=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,qo=/^(\d*\.?\d*)f$/,zo=/^(\d*\.?\d*)t$/,Xo=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,$o=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,Jo={left:"start",center:"center",right:"end",start:"start",end:"end"},Qo={left:"line-left",center:"center",right:"line-right"};Te("application/ttml+xml",mr),Ar.prototype.parseInit=function(e){var t=!1;if((new Wt).C("moov",qt).C("trak",qt).C("mdia",qt).C("minf",qt).C("stbl",qt).da("stsd",zt).C("stpp",function(){t=!0}).parse(e),!t)throw new u(2,2,2007)},Ar.prototype.parseMedia=function(e,t){var n=!1,r=[];if((new Wt).C("mdat",Xt(function(e){n=!0,r=this.a.parseMedia(e.buffer,t)}.bind(this))).parse(e),!n)throw new u(2,2,2007);return r},Te('application/mp4; codecs="stpp"',Ar),Or.prototype.parseInit=function(){},Or.prototype.parseMedia=function(e,t){var n=Y(e),n=n.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n"),n=n.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(n[0]))throw new u(2,2,2e3);var r=t.segmentStart;if(0<=n[0].indexOf("X-TIMESTAMP-MAP")){var i=n[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),a=n[0].match(/MPEGTS:(\d+)/m);i&&a&&(r=Rr(new qn(i[1])),r=t.periodStart+(Number(a[1])/9e4-r))}for(a=[],i=1;i<n.length;i++){var o=n[i].split("\n"),s=r;if(1==o.length&&!o[0]||/^NOTE($|[ \t])/.test(o[0]))var l=null;else{l=null,0>o[0].indexOf("--\x3e")&&(l=o[0],o.splice(0,1));var c=new qn(o[0]),f=Rr(c),d=zn(c,/[ \t]+--\x3e[ \t]+/g),h=Rr(c);if(null==f||!d||null==h)throw new u(2,2,2001);if(o=we(f+s,h+s,o.slice(1).join("\n").trim())){for(zn(c,/[ \t]+/gm),s=Xn(c);s;)Pr(o,s),zn(c,/[ \t]+/gm),s=Xn(c);null!=l&&(o.id=l),l=o}else l=null}l&&a.push(l)}return a},Te("text/vtt",Or),Te('text/vtt; codecs="vtt"',Or),Dr.prototype.parseInit=function(e){var t=!1;if((new Wt).C("moov",qt).C("trak",qt).C("mdia",qt).da("mdhd",function(e){0==e.version?(e.s.I(4),e.s.I(4),this.a=e.s.D(),e.s.I(4)):(e.s.I(8),e.s.I(8),this.a=e.s.D(),e.s.I(8)),e.s.I(4)}.bind(this)).C("minf",qt).C("stbl",qt).da("stsd",zt).C("wvtt",function(){t=!0}).parse(e),!this.a)throw new u(2,2,2008);if(!t)throw new u(2,2,2008)},Dr.prototype.parseMedia=function(e,t){var n=0,r=[],i=[],a=[],o=!1,s=!1,l=!1;if((new Wt).C("moof",qt).C("traf",qt).da("tfdt",function(e){o=!0,n=e.version?e.s.Pa():e.s.D()}).da("trun",function(e){s=!0;var t=e.version,n=e.Nc;e=e.s;var i=e.D();1&n&&e.I(4),4&n&&e.I(4);for(var a=[],o=0;o<i;o++){var u={duration:null,Nb:null};256&n&&(u.duration=e.D()),512&n&&e.I(4),1024&n&&e.I(4),2048&n&&(u.Nb=t?e.nc():e.D()),a.push(u)}r=a}).C("vtte",function(){i.push(null)}).C("vttc",Xt(function(e){i.push(e.buffer)})).C("mdat",function(e){l=!0,qt(e)}).parse(e),!l&&!o&&!s)throw new u(2,2,2008);for(var c=n,f=0;f<r.length;f++){var d=r[f],h=i[f];if(d.duration){var p=d.Nb?n+d.Nb:c,c=p+d.duration;h&&a.push(xr(h,t.periodStart+p/this.a,t.periodStart+c/this.a))}}return a},Te('application/mp4; codecs="wvtt"',Dr),so=Ir.prototype,so.m=function(){var t=this.b.m();return this.b=null,null!=this.f&&(e.clearInterval(this.f),this.f=null),null!=this.j&&(e.clearInterval(this.j),this.j=null),this.G=this.J=this.l=this.c=this.a=null,t},so.rb=function(){return this.g},so.Ab=function(){this.o=!0,this.hc()},so.rd=function(){this.a.playbackRate!=(this.h||0>this.g?0:this.g)&&Ur(this,this.a.playbackRate)},so.fc=function(){var e=Nr(this);.001>Math.abs(this.a.currentTime-e)?(N(this.b,this.a,"seeking",this.ic.bind(this)),N(this.b,this.a,"playing",this.gc.bind(this))):(U(this.b,this.a,"seeking",this.td.bind(this)),this.a.currentTime=e)},so.td=function(){N(this.b,this.a,"seeking",this.ic.bind(this)),N(this.b,this.a,"playing",this.gc.bind(this))},so.hc=function(){if(this.a.readyState){this.a.readyState!=this.B&&(this.i=!1,this.B=this.a.readyState);var e=this.l.smallGapLimit,t=this.a.currentTime,n=this.a.buffered;e:{if(n&&n.length&&!(1==n.length&&1e-6>n.end(0)-n.start(0))){var r=.1;/(Edge|Trident)\//.test(navigator.userAgent)&&(r=.5);for(var i=0;i<n.length;i++)if(n.start(i)>t&&(!i||n.end(i-1)-t<=r)){r=i;break e}}r=null}if(null==r){if(3>this.a.readyState&&0<this.a.playbackRate)if(this.O!=t)this.O=t,this.v=Date.now();else if(this.v<Date.now()-1e3)for(this.v=Date.now()+5e3,r=0;r<n.length;r++)if(t>=n.start(r)&&t<n.end(r)-.5){this.a.currentTime=this.a.currentTime;break}}else if((r||this.o)&&!((i=n.start(r))>=this.c.presentationTimeline.bb())){var a=i-t,e=a<=e,o=!1;e||this.i||(this.i=!0,a=new st("largegap",{currentTime:t,gapSize:a}),a.cancelable=!0,this.G(a),this.l.jumpLargeGaps&&!a.defaultPrevented&&(o=!0)),(e||o)&&(r&&n.end(r-1),Fr(this,t,i))}}},so.ic=function(){this.o=!1;var e=this.a.currentTime,t=jr(this,e);.001<Math.abs(t-e)?Fr(this,e,t):(this.i=!1,this.J())},so.gc=function(){var e=this.a.currentTime,t=jr(this,e);.001<Math.abs(t-e)&&Fr(this,e,t)},Gr.prototype.m=function(){var e=this.j?this.j.m():Promise.resolve();return this.j=null,Kr(this),this.B=this.h=this.l=this.A=this.g=this.a=null,this.c=[],e},Gr.prototype.v=function(e){if(!this.c.some(function(t){return t.info.schemeIdUri==e.schemeIdUri&&t.info.startTime==e.startTime&&t.info.endTime==e.endTime})){var t={info:e,status:1};this.c.push(t);var n=new st("timelineregionadded",{detail:Vr(e)});this.h(n),this.o(!0,t)}},Gr.prototype.o=function(e,t){var n=t.info.startTime>this.a.currentTime?1:t.info.endTime<this.a.currentTime?3:2,r=2==t.status,i=2==n;n!=t.status&&((!e||r||i)&&(r||this.h(new st("timelineregionenter",{detail:Vr(t.info)})),i||this.h(new st("timelineregionexit",{detail:Vr(t.info)}))),t.status=n)},Gr.prototype.G=function(){this.f=null,Hr(this);var e=rt(this.g,this.a.currentTime);e!=this.i&&(-1!=this.i&&this.B(),this.i=e);var e=Re(this.a.buffered,this.a.currentTime),t=Oe(this.a.buffered)>=this.g.presentationTimeline.ua()-.1||this.a.ended;if(this.b){var n=1*Math.max(this.g.minBufferTime||0,this.A.rebufferingGoal);(t||e>=n)&&0!=this.b&&(this.b=!1,this.l(!1))}else!t&&.5>e&&1!=this.b&&(this.b=!0,this.l(!0));this.c.forEach(this.o.bind(this,!1))},so=Yr.prototype,so.m=function(){for(var e in this.c)gi(this.c[e]);return this.g=this.c=this.j=this.h=this.o=this.b=this.a=null,this.f=!0,Promise.resolve()},so.configure=function(e){this.g=e},so.init=function(){var e=this.a.bc(this.b.periods[rt(this.b,Cr(this.a.Oa))]);return B(e)?Promise.reject(new u(2,5,5005)):Zr(this,e).then(function(){this.a&&this.a.jd&&this.a.jd()}.bind(this))},so.ke=function(e){if(!this.f&&!e.xa&&null!=e.qa&&!e.sa)if(e.qa=null,e.ra)pi(this,e,e.kb);else{try{var t=ri(this,e);null!=t&&(vi(this,e,t),e.tb=!1)}catch(e){return void this.a.onError(e)}t=G(this.c),fi(this,e),t.every(function(e){return e.endOfStream})&&this.a.K.endOfStream().then(function(){this.b.presentationTimeline.pa(this.a.K.Y())}.bind(this))}},so.Ed=function(e,t,n){var r=n.s.Db(),i=n.s.Db(),a=n.s.D(),o=n.s.D(),s=n.s.D(),u=n.s.D();n=n.s.Ka(n.s.H.byteLength-n.s.u),e=e.startTime+t.startTime+o/a,"urn:mpeg:dash:event:2012"==r?this.a.kd():this.a.onEvent(new st("emsg",{detail:{startTime:e,endTime:e+s/a,schemeIdUri:r,value:i,timescale:a,presentationTimeDelta:o,eventDuration:s,id:u,messageData:n}}))},t("shaka.net.HttpPlugin",yi),go.http=yi,go.https=yi,so=mi.prototype,so.init=function(e,t){return wi(this,e,t).then(function(){var t=Object.keys(e);return Promise.all(t.map(function(e){return Ei(this,e).then(function(t){this.c[e]=t}.bind(this))}.bind(this)))}.bind(this))},so.m=function(){return Promise.all(this.b.map(function(e){try{e.transaction.abort()}catch(e){}return e.L.catch(_)})).then(function(){this.a&&(this.a.close(),this.a=null)}.bind(this))},so.get=function(e,t){var n;return Ti(this,e,"readonly",function(e){n=e.get(t)}).then(function(){return n.result})},so.forEach=function(e,t){return Ti(this,e,"readonly",function(e){e.openCursor().onsuccess=function(e){(e=e.target.result)&&(t(e.value),e.continue())}})},so.remove=function(e,t){return Ti(this,e,"readwrite",function(e){e.delete(t)})};var Zo={manifest:"key",segment:"key"};Li.prototype.m=function(){var e=this.j,t=this.l,n=this.i||Promise.resolve(),n=n.then(function(){return _i(e,t)});return this.b={},this.l=[],this.i=this.a=this.A=this.v=this.j=this.o=null,n},so=Ni.prototype,so.configure=function(){},so.start=function(e){var t=/^offline:([0-9]+)$/.exec(e);if(!t)return Promise.reject(new u(2,1,9004,e));var n=Number(t[1]),r=xi();return this.a=n,r?r.init(Zo).then(function(){return r.get("manifest",n)}).then(function(e){if(!e)throw new u(2,9,9003,n);return Ui(e)}).then(function(e){return r.m().then(function(){return e})},function(e){return r.m().then(function(){throw e})}):Promise.reject(new u(2,9,9e3))},so.stop=function(){return Promise.resolve()},so.update=function(){},so.onExpirationUpdated=function(e,t){var n=xi();n.init(Zo).then(function(){return n.get("manifest",this.a)}.bind(this)).then(function(r){if(r&&!(0>r.sessionIds.indexOf(e))&&(void 0==r.expiration||r.expiration>t))return r.expiration=t,bi(n,"manifest",r)}).catch(function(){}).then(function(){return n.m()})},Co["application/x-offline-manifest"]=Ni,t("shaka.offline.OfflineScheme",ji),go.offline=ji,Fi.prototype.then=function(e){return this.a=this.a.then(e).then(function(e){return this.b?(this.g(),Promise.reject(this.h)):Promise.resolve(e)}.bind(this)),this},Fi.prototype.cancel=function(e){return this.c?Promise.resolve():(this.b=!0,this.h=e,this.i)},n(Gi),t("shaka.Player",Gi),Gi.prototype.m=function(){this.O=!0;var e=Promise.resolve();return this.J&&(e=this.J.cancel(new u(2,7,7e3))),e.then(function(){var e=Promise.all([this.la,qi(this),this.l?this.l.m():null,this.o?this.o.m():null]);return this.b=this.o=this.Qb=this.l=this.A=this.f=null,e}.bind(this))},Gi.prototype.destroy=Gi.prototype.m,Gi.version="v2.1.4";var es={};Gi.registerSupportPlugin=function(e,t){es[e]=t},Gi.isBrowserSupported=function(){return!!(e.Promise&&e.Uint8Array&&Array.prototype.forEach&&e.MediaSource&&e.MediaSource.isTypeSupported&&e.MediaKeys&&e.navigator&&e.navigator.requestMediaKeySystemAccess&&e.MediaKeySystemAccess&&e.MediaKeySystemAccess.prototype.getConfiguration)},Gi.probeSupport=function(){return me().then(function(e){e={manifest:wn(),media:xe(),drm:e};for(var t in es)e[t]=es[t]();return e})},Gi.prototype.load=function(e,t,n){var r=this.hb(),i=new Fi;this.J=i,this.dispatchEvent(new st("loading"));var a=Date.now();return Bi(i.then(function(){return r}).then(function(){return this.i=Ji(),N(this.l,this.f,"playing",this.Sa.bind(this)),N(this.l,this.f,"pause",this.Sa.bind(this)),N(this.l,this.f,"ended",this.Sa.bind(this)),kn(e,this.o,this.b.manifest.retryParameters,n)}.bind(this)).then(function(t){return this.h=new t,this.h.configure(this.b.manifest),t={networkingEngine:this.o,filterPeriod:this.fb.bind(this),onTimelineRegionAdded:this.xd.bind(this),onEvent:this.gb.bind(this),onError:this.ya.bind(this)},2<this.h.start.length?this.h.start(e,this.o,t.filterPeriod,t.onError,t.onEvent):this.h.start(e,t)}.bind(this)).then(function(t){if(0==t.periods.length)throw new u(2,4,4014);return this.c=t,this.Ya=e,this.j=new re(this.o,this.ya.bind(this),this.be.bind(this),this.ae.bind(this)),this.j.configure(this.b.drm),this.j.init(t,!1)}.bind(this)).then(function(){return this.c.periods.forEach(this.fb.bind(this)),this.Ua=Date.now()/1e3,this.ia=this.b.preferredAudioLanguage,this.Ca=this.b.preferredTextLanguage,Promise.all([ie(this.j,this.f),this.Wa])}.bind(this)).then(function(){return this.b.abr.manager.init(this.Lb.bind(this)),this.g=new Ir(this.f,this.c,this.b.streaming,t||null,this.ce.bind(this),this.gb.bind(this)),this.v=new Gr(this.f,this.c,this.b.streaming,this.zc.bind(this),this.gb.bind(this),this.$d.bind(this)),this.ja=new De(this.f,this.N,this.A),this.a=new Yr(this.c,{Oa:this.g,K:this.ja,dd:this.o,bc:this.ed.bind(this),ac:this.Gc.bind(this),onError:this.ya.bind(this),onEvent:this.gb.bind(this),kd:this.ld.bind(this),Ab:this.ud.bind(this)}),this.a.configure(this.b.streaming),Vi(this),this.a.init()}.bind(this)).then(function(){if(this.b.streaming.startAtSegmentBoundary){var e=ea(this,Cr(this.g));Mr(this.g,e)}this.c.periods.forEach(this.fb.bind(this)),ia(this),ra(this);var e=Wr(this.a),t=Qe(e,this.ia);this.b.abr.manager.setVariants(t),e.variants.some(function(e){return e.primary}),this.Xa.forEach(this.v.v.bind(this.v)),this.Xa=[],U(this.l,this.f,"loadeddata",function(){this.i.loadLatency=(Date.now()-a)/1e3}.bind(this)),this.J=null}.bind(this))).catch(function(e){return this.J==i&&(this.J=null,this.dispatchEvent(new st("unloading"))),Promise.reject(e)}.bind(this))},Gi.prototype.load=Gi.prototype.load,Gi.prototype.configure=function(e){e.abr&&e.abr.manager&&e.abr.manager!=this.b.abr.manager&&(this.b.abr.manager.stop(),e.abr.manager.init(this.Lb.bind(this))),A(this.b,e,$i(this),Xi(),""),Ki(this)},Gi.prototype.configure=Gi.prototype.configure,Gi.prototype.getConfiguration=function(){var e=$i(this);return A(e,this.b,$i(this),Xi(),""),e},Gi.prototype.getConfiguration=Gi.prototype.getConfiguration,Gi.prototype.Rd=function(){var e=$i(this);e.abr&&e.abr.manager&&e.abr.manager!=this.b.abr.manager&&(this.b.abr.manager.stop(),e.abr.manager.init(this.Lb.bind(this))),this.b=$i(this),Ki(this)},Gi.prototype.resetConfiguration=Gi.prototype.Rd,Gi.prototype.Sc=function(){return this.f},Gi.prototype.getMediaElement=Gi.prototype.Sc,Gi.prototype.Wb=function(){return this.o},Gi.prototype.getNetworkingEngine=Gi.prototype.Wb,Gi.prototype.Rc=function(){return this.Ya},Gi.prototype.getManifestUri=Gi.prototype.Rc,Gi.prototype.$=function(){return!!this.c&&this.c.presentationTimeline.$()},Gi.prototype.isLive=Gi.prototype.$,Gi.prototype.va=function(){return!!this.c&&this.c.presentationTimeline.va()},Gi.prototype.isInProgress=Gi.prototype.va,Gi.prototype.Td=function(){var e=0,t=0;return this.c&&(t=this.c.presentationTimeline,e=t.ma(),t=t.bb()),{start:e,end:t}},Gi.prototype.seekRange=Gi.prototype.Td,Gi.prototype.keySystem=function(){return this.j?this.j.keySystem():""},Gi.prototype.keySystem=Gi.prototype.keySystem,Gi.prototype.drmInfo=function(){return this.j?this.j.b:null},Gi.prototype.drmInfo=Gi.prototype.drmInfo,Gi.prototype.ab=function(){return this.j?this.j.ab():1/0},Gi.prototype.getExpiration=Gi.prototype.ab,Gi.prototype.$c=function(){return this.ka},Gi.prototype.isBuffering=Gi.prototype.$c,Gi.prototype.hb=function(){if(this.O)return Promise.resolve();this.dispatchEvent(new st("unloading"));var e=Promise.resolve();return this.J&&(e=this.J.cancel(new u(2,7,7e3))),e.then(function(){return this.la||(this.la=zi(this).then(function(){this.la=null}.bind(this))),this.la}.bind(this))},Gi.prototype.unload=Gi.prototype.hb,Gi.prototype.rb=function(){return this.g?this.g.rb():0},Gi.prototype.getPlaybackRate=Gi.prototype.rb,Gi.prototype.ne=function(e){this.g&&Ur(this.g,e),this.a&&Xr(this.a,1!=e)},Gi.prototype.trickPlay=Gi.prototype.ne,Gi.prototype.Hc=function(){this.g&&Ur(this.g,1),this.a&&Xr(this.a,!1)},Gi.prototype.cancelTrickPlay=Gi.prototype.Hc,Gi.prototype.getTracks=function(){return this.Yb().concat(this.Xb())},Gi.prototype.getTracks=Gi.prototype.getTracks,Gi.prototype.Wd=function(e,t){"text"==e.type?this.tc(e):(this.configure({abr:{enabled:!1}}),this.uc(e,t))},Gi.prototype.selectTrack=Gi.prototype.Wd,Gi.prototype.Yb=function(){if(!this.c)return[];var e=rt(this.c,Cr(this.g)),t=this.B[e]||{};return qe(this.c.periods[e],t.audio,t.video)},Gi.prototype.getVariantTracks=Gi.prototype.Yb,Gi.prototype.Xb=function(){if(!this.c)return[];var e=rt(this.c,Cr(this.g));return ze(this.c.periods[e],(this.B[e]||{}).text).filter(function(e){return 0>this.Va.indexOf(e.id)}.bind(this))},Gi.prototype.getTextTracks=Gi.prototype.Xb,Gi.prototype.tc=function(e){if(this.a&&(e=$e(Wr(this.a),e))){Yi(this,e,!1);var t={};t.text=e,Qi(this,t,!0)}},Gi.prototype.selectTextTrack=Gi.prototype.tc,Gi.prototype.uc=function(e,t){if(this.a){var n={},r=Xe(Wr(this.a),e),i=qr(this.a);if(r){if(!r.allowedByApplication||!r.allowedByKeySystem)return;r.audio&&(Wi(this,r.audio),r.audio!=i.audio&&(n.audio=r.audio)),r.video&&(Wi(this,r.video),r.video!=i.video&&(n.video=r.video))}G(n).forEach(function(e){Yi(this,e,!1)}.bind(this)),(r=i.text)&&(n.text=r),Qi(this,n,t)}},Gi.prototype.selectVariantTrack=Gi.prototype.uc,Gi.prototype.Pc=function(){return this.a?Je(Wr(this.a).variants).map(function(e){return e.language}).filter(w):[]},Gi.prototype.getAudioLanguages=Gi.prototype.Pc,Gi.prototype.Yc=function(){return this.a?Wr(this.a).textStreams.map(function(e){return e.language}).filter(w):[]},Gi.prototype.getTextLanguages=Gi.prototype.Yc,Gi.prototype.Ud=function(e,t){if(this.a){var n=Wr(this.a);this.ia=e,this.mb=t||"",na(this,n)}},Gi.prototype.selectAudioLanguage=Gi.prototype.Ud,Gi.prototype.Vd=function(e,t){if(this.a){var n=Wr(this.a);this.Ca=e,this.lb=t||"",na(this,n)}},Gi.prototype.selectTextLanguage=Gi.prototype.Vd,Gi.prototype.bd=function(){return"showing"==this.A.mode},Gi.prototype.isTextTrackVisible=Gi.prototype.bd,Gi.prototype.Yd=function(e){this.A.mode=e?"showing":"hidden",aa(this)},Gi.prototype.setTextTrackVisibility=Gi.prototype.Yd,Gi.prototype.Uc=function(){return this.c?new Date(1e3*this.c.presentationTimeline.f+1e3*this.f.currentTime):null},Gi.prototype.getPlayheadTimeAsDate=Gi.prototype.Uc,Gi.prototype.getStats=function(){Zi(this),this.Sa();var e=null,t=null,n=this.f&&this.f.getVideoPlaybackQuality?this.f.getVideoPlaybackQuality():{};return this.g&&this.c&&(e=rt(this.c,Cr(this.g)),t=this.B[e],t=tt(t.audio,t.video,this.c.periods[e].variants),e=t.video||{}),e||(e={}),t||(t={}),{width:e.width||0,height:e.height||0,streamBandwidth:t.bandwidth||0,decodedFrames:Number(n.totalVideoFrames),droppedFrames:Number(n.droppedVideoFrames),estimatedBandwidth:this.b.abr.manager.getBandwidthEstimate(),loadLatency:this.i.loadLatency,playTime:this.i.playTime,bufferingTime:this.i.bufferingTime,switchHistory:O(this.i.switchHistory),stateHistory:O(this.i.stateHistory)}},Gi.prototype.getStats=Gi.prototype.getStats,Gi.prototype.addTextTrack=function(e,t,n,r,i,a){if(!this.a)return Promise.reject();for(var o,s=Wr(this.a),u=0;u<this.c.periods.length;u++)if(this.c.periods[u]==s){if(u==this.c.periods.length-1){if(o=this.c.presentationTimeline.Y()-s.startTime,1/0==o)return Promise.reject()}else o=this.c.periods[u+1].startTime-s.startTime;break}var l={id:this.Dc++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(t){return 1!=t?null:new Ht(1,0,o,function(){return[e]},0,null)},initSegmentReference:null,presentationTimeOffset:0,mimeType:r,codecs:i||"",kind:n,encrypted:!1,keyId:null,language:t,label:a||null,type:"text",primary:!1,trickModeVideo:null,containsEmsgBoxes:!1,roles:[]};return this.Va.push(l.id),s.textStreams.push(l),zr(this.a,l).then(function(){if(!this.O){var e=this.c.periods.indexOf(s),r=qr(this.a);return r.text&&(this.B[e].text=r.text.id),this.Va.splice(this.Va.indexOf(l.id),1),na(this,s),ia(this),{id:l.id,active:!1,type:"text",bandwidth:0,language:t,label:a||null,kind:n,width:null,height:null}}}.bind(this))},Gi.prototype.addTextTrack=Gi.prototype.addTextTrack,Gi.prototype.Jb=function(e,t){this.ob.width=e,this.ob.height=t},Gi.prototype.setMaxHardwareResolution=Gi.prototype.Jb,so=Gi.prototype,so.fb=function(e){var t=this.a?qr(this.a):{};if(Ye(this.j,t,e),t=0<Je(e.variants).length,Ke(e,this.b.restrictions,this.ob)&&this.a&&Wr(this.a)==e&&ia(this),e=1>Je(e.variants).length,!t)throw new u(2,4,4011);if(e)throw new u(2,4,4012)},so.de=function(e,t){this.b.abr.manager.segmentDownloaded(e,t)},so.zc=function(e){if(Zi(this),this.ka=e,this.Sa(),this.g){var t=this.g;e!=t.h&&(t.h=e,Ur(t,t.g))}this.dispatchEvent(new st("buffering",{buffering:e}))},so.$d=function(){ia(this)},so.Sa=function(){if(!this.O){var e=this.ka?"buffering":this.f.ended?"ended":this.f.paused?"paused":"playing",t=Date.now()/1e3;if(this.i.stateHistory.length){var n=this.i.stateHistory[this.i.stateHistory.length-1];if(n.duration=t-n.timestamp,e==n.state)return}this.i.stateHistory.push({timestamp:t,state:e,duration:0})}},so.ce=function(){if(this.v){var e=this.v;e.c.forEach(e.o.bind(e,!0))}this.a&&Jr(this.a)},so.ed=function(e){this.Za=!0,this.b.abr.manager.disable(),e=ta(this,e,Qe(e,this.ia,void 0,this.mb),Ze(e,this.Ca,void 0,this.lb),!0);for(var t in this.G)e[t]=this.G[t].stream;this.G={};for(t in e)Yi(this,e[t],!0);return e},so.Gc=function(){this.Za=!1,this.b.abr.enabled&&this.b.abr.manager.enable();for(var e in this.G){var t=this.G[e];$r(this.a,e,t.stream,t.Kc)}this.G={}},so.ld=function(){this.h&&this.h.update&&this.h.update()},so.ud=function(){this.g&&this.g.Ab()},so.Lb=function(e,t){var n,r=qr(this.a);for(n in e){var i=e[n];r[n]!=i?Yi(this,i,!0):delete e[n]}if(!B(e)&&this.a){for(n in e)$r(this.a,n,e[n],t||!1);ra(this)}},so.ya=function(e){this.O||this.dispatchEvent(new st("error",{detail:e}))},so.xd=function(e){this.v?this.v.v(e):this.Xa.push(e)},so.gb=function(e){this.dispatchEvent(e)},so.yd=function(){if(this.f.error){var e=this.f.error.code;if(1!=e){var t=this.f.error.msExtendedCode;t&&(0>t&&(t+=Math.pow(2,32)),t=t.toString(16)),this.ya(new u(2,3,3016,e,t))}}},so.be=function(e){var t=["output-restricted","internal-error"],n=Wr(this.a),r=!1;n.variants.forEach(function(n){var i=[];n.audio&&i.push(n.audio),n.video&&i.push(n.video),i.forEach(function(i){var a=n.allowedByKeySystem;i.keyId&&(i=e[i.keyId],n.allowedByKeySystem=!!i&&0>t.indexOf(i)),a!=n.allowedByKeySystem&&(r=!0)})});var i=qr(this.a);(i=et(i.audio,i.video,n.variants))&&!i.allowedByKeySystem&&na(this,n),r&&ia(this)},so.ae=function(e,t){this.h&&this.h.onExpirationUpdated&&this.h.onExpirationUpdated(e,t),this.dispatchEvent(new st("expirationupdated"))},t("shaka.offline.Storage",oa),oa.support=sa,oa.prototype.m=function(){var e=this.a,t=this.h?this.h.m().catch(function(){}).then(function(){if(e)return e.m()}):Promise.resolve();return this.i=this.f=this.h=this.a=null,t},oa.prototype.destroy=oa.prototype.m,oa.prototype.configure=function(e){A(this.i,e,la(this),{},"")},oa.prototype.configure=oa.prototype.configure,oa.prototype.le=function(e,t,n){function r(e){a=e}if(this.v)return Promise.reject(new u(2,9,9006));this.v=!0;var i,a=null;return ca(this).then(function(){return pa(this),ua(this,e,r,n)}.bind(this)).then(function(n){if(pa(this),this.c=n.manifest,this.b=n.Lc,this.c.presentationTimeline.$()||this.c.presentationTimeline.va())throw new u(2,9,9005,e);this.c.periods.forEach(this.o.bind(this)),this.g=this.a.c.manifest++,this.l=0,n=this.c.periods.map(this.B.bind(this));var r=this.b.b,a=se(this.b);if(r){if(!a.length)throw new u(2,9,9007,e);r.initData=[]}return i={key:this.g,originalManifestUri:e,duration:this.l,size:0,expiration:this.b.ab(),periods:n,sessionIds:a,drmInfo:r,appMetadata:t},Mi(this.h,i)}.bind(this)).then(function(){if(pa(this),a)throw a;return fa(this)}.bind(this)).then(function(){return Si(i)}.bind(this)).catch(function(e){return fa(this).catch(_).then(function(){throw e})}.bind(this))},oa.prototype.store=oa.prototype.le,oa.prototype.remove=function(e){function t(e){6013!=e.code&&(o=e)}var n=e.offlineUri,r=/^offline:([0-9]+)$/.exec(n);if(!r)return Promise.reject(new u(2,9,9004,n));var i,a,o=null,s=Number(r[1]);return ca(this).then(function(){return pa(this),this.a.get("manifest",s)}.bind(this)).then(function(e){if(pa(this),!e)throw new u(2,9,9003,n);return i=e,e=Ui(i),a=new re(this.f.o,t,function(){},function(){}),a.configure(this.f.getConfiguration().drm),a.init(e,!0)}.bind(this)).then(function(){return ae(a,i.sessionIds)}.bind(this)).then(function(){return a.m()}.bind(this)).then(function(){if(pa(this),o)throw o;var t=i.periods.map(function(e){return e.streams.map(function(e){var t=e.segments.map(function(e){return e=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e.uri),Number(e[1])});return e.initSegmentUri&&(e=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e.initSegmentUri),t.push(Number(e[1]))),t}).reduce(b,[])}).reduce(b,[]),n=0,r=t.length,a=this.i.progressCallback;return _i(this.a,t,function(){n++,a(e,n/r)})}.bind(this)).then(function(){return pa(this),this.i.progressCallback(e,1),this.a.remove("manifest",s)}.bind(this))},oa.prototype.remove=oa.prototype.remove,oa.prototype.list=function(){var e=[];return ca(this).then(function(){return pa(this),this.a.forEach("manifest",function(t){e.push(Si(t))})}.bind(this)).then(function(){return e})},oa.prototype.list=oa.prototype.list,oa.prototype.A=function(e){for(var t,n=[],r=Ve(this.f.getConfiguration().preferredAudioLanguage),i=[0,mo,bo],a=e.filter(function(e){return"variant"==e.type}),i=i.map(function(e){return a.filter(function(t){return t=Ve(t.language),Ge(e,r,t)})}),o=0;o<i.length;o++)if(i[o].length){t=i[o];break}t||(i=a.filter(function(e){return e.primary}),i.length&&(t=i)),t||(t=a,a.map(function(e){return e.language}).filter(w));var s=t.filter(function(e){return e.height&&480>=e.height});return s.length&&(s.sort(function(e,t){return t.height-e.height}),t=s.filter(function(e){return e.height==s[0].height})),t.sort(function(e,t){return e.bandwidth-t.bandwidth}),t.length&&n.push(t[Math.floor(t.length/2)]),n.push.apply(n,e.filter(function(e){return"text"==e.type})),n},oa.prototype.o=function(e){var t={};if(this.j){var n=this.j.filter(function(e){return"variant"==e.type}),r=null;n.length&&(r=Xe(e,n[0])),r&&(r.video&&(t.video=r.video),r.audio&&(t.audio=r.audio))}Ye(this.b,t,e),Ke(e,this.f.getConfiguration().restrictions,{width:1/0,height:1/0})},oa.prototype.B=function(e){var t,n,r=qe(e,null,null),i=ze(e,null),r=this.i.trackSelectionCallback(r.concat(i));for(this.j||(this.j=r,this.c.periods.forEach(this.o.bind(this))),i=r.length-1;0<i;--i){var a=!1;for(n=i-1;0<=n;--n)if(r[i].type==r[n].type&&r[i].kind==r[n].kind&&r[i].language==r[n].language){a=!0;break}if(a)break}for(a=[],i=0;i<r.length;i++)(t=Xe(e,r[i]))?(t.audio&&((n=a.filter(function(e){return e.id==t.audio.id})[0])?n.variantIds.push(t.id):(n=t.video?t.bandwidth/2:t.bandwidth,a.push(ha(this,e,t.audio,n,t.id)))),t.video&&((n=a.filter(function(e){return e.id==t.video.id})[0])?n.variantIds.push(t.id):(n=t.audio?t.bandwidth/2:t.bandwidth,a.push(ha(this,e,t.video,n,t.id))))):a.push(ha(this,e,$e(e,r[i]),0));return{startTime:e.startTime,streams:a}},es.offline=sa,t("shaka.polyfill.installAll",function(){for(var e=0;e<ts.length;++e)ts[e]()});var ts=[];t("shaka.polyfill.register",va),va(function(){if(e.Document){var t=Element.prototype;t.requestFullscreen=t.requestFullscreen||t.mozRequestFullScreen||t.msRequestFullscreen||t.webkitRequestFullscreen,t=Document.prototype,t.exitFullscreen=t.exitFullscreen||t.mozCancelFullScreen||t.msExitFullscreen||t.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",ga),document.addEventListener("webkitfullscreenerror",ga),document.addEventListener("mozfullscreenchange",ga),document.addEventListener("mozfullscreenerror",ga),document.addEventListener("MSFullscreenChange",ga),document.addEventListener("MSFullscreenError",ga)}}),va(function(){var t=navigator.userAgent;t&&0<=t.indexOf("CrKey")&&delete e.indexedDB}),va(function(){if(4503599627370497!=Math.round(4503599627370497)){var e=Math.round;Math.round=function(t){var n=t;return 4503599627370496>=t&&(n=e(t)),n}}}),ya.prototype.c=function(e){if(!(1<e.version)){var t=te(e.s.Ka(16)),n=[];if(0<e.version)for(var r=e.s.D(),i=0;i<r;++i){var a=te(e.s.Ka(16));n.push(a)}r=e.s.D(),e.s.I(r),this.b.push.apply(this.b,n),this.f.push(t),this.a.push({start:e.start,end:e.start+e.size-1})}},ba.prototype.createMediaKeys=function(){var e=new Ea(this.keySystem);return Promise.resolve(e)},ba.prototype.getConfiguration=function(){return this.a},Ea.prototype.createSession=function(e){if("temporary"!=(e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new wa(this.a)},Ea.prototype.setServerCertificate=function(){return Promise.resolve(!1)},n(wa),so=wa.prototype,so.generateRequest=function(e,t){this.a=new P;try{this.c=this.g.createSession("video/mp4",new Uint8Array(t),null),N(this.f,this.c,"mskeymessage",this.pd.bind(this)),N(this.f,this.c,"mskeyadded",this.nd.bind(this)),N(this.f,this.c,"mskeyerror",this.od.bind(this)),Aa(this,"status-pending")}catch(e){this.a.reject(e)}return this.a},so.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},so.update=function(e){this.b=new P;try{this.c.update(new Uint8Array(e))}catch(e){this.b.reject(e)}return this.b},so.close=function(){try{this.c.close(),this.closed.resolve(),j(this.f)}catch(e){this.closed.reject(e)}return this.closed},so.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},so.pd=function(e){this.a&&(this.a.resolve(),this.a=null),this.dispatchEvent(new st("message",{messageType:void 0==this.keyStatuses.sb()?"licenserequest":"licenserenewal",message:e.message.buffer}))},so.nd=function(){this.a?(Aa(this,"usable"),this.a.resolve(),this.a=null):this.b&&(Aa(this,"usable"),this.b.resolve(),this.b=null)},so.od=function(){var e=Error("EME PatchedMediaKeysMs key error");if(e.errorCode=this.c.error,this.a)this.a.reject(e),this.a=null;else if(this.b)this.b.reject(e),this.b=null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:Aa(this,"output-not-allowed");default:Aa(this,"internal-error")}};var ns;so=Oa.prototype,so.Kb=function(e){this.size=void 0==e?0:1,this.a=e},so.sb=function(){return this.a},so.forEach=function(e){this.a&&e(this.a,ns)},so.get=function(e){if(this.has(e))return this.a},so.has=function(e){var t=ns;return!(!this.a||!ne(new Uint8Array(e),new Uint8Array(t)))},so.entries=function(){},so.keys=function(){},so.values=function(){},Da.prototype.createSession=function(){},Da.prototype.setServerCertificate=function(){},xa.prototype.getConfiguration=function(){},xa.prototype.createMediaKeys=function(){};var rs="";Na.prototype.createMediaKeys=function(){var e=new Ua(this.a);return Promise.resolve(e)},Na.prototype.getConfiguration=function(){return this.b},so=Ua.prototype,so.createSession=function(e){var t=e||"temporary";if("temporary"!=t&&"persistent-license"!=t)throw new TypeError("Session type "+e+" is unsupported on this platform.");return e=this.b||document.createElement("video"),e.src||(e.src="about:blank"),t=new Ba(e,this.g,t),this.c.push(t),t},so.setServerCertificate=function(){return Promise.resolve(!1)},so.Cd=function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("encrypted",!1,!1,null),t.initDataType="webm",t.initData=e.initData,this.b.dispatchEvent(t)},so.Bd=function(e){var t=Fa(this,e.sessionId);t&&(e=new st("message",{messageType:void 0==t.keyStatuses.sb()?"licenserequest":"licenserenewal",message:e.message}),t.b&&(t.b.resolve(),t.b=null),t.dispatchEvent(e))},so.zd=function(e){(e=Fa(this,e.sessionId))&&(Va(e,"usable"),e.a&&e.a.resolve(),e.a=null)},so.Ad=function(e){var t=Fa(this,e.sessionId);if(t){var n=Error("EME v0.1b key error");n.errorCode=e.errorCode,n.errorCode.systemCode=e.systemCode,!e.sessionId&&t.b?(n.method="generateRequest",45==e.systemCode&&(n.message="Unsupported session type."),t.b.reject(n),t.b=null):e.sessionId&&t.a?(n.method="update",t.a.reject(n),t.a=null):(n=e.systemCode,e.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?Va(t,"output-restricted"):1==n?Va(t,"expired"):Va(t,"internal-error"))}},n(Ba),so=Ba.prototype,so.Mb=function(e,t){if(this.a)this.a.then(this.Mb.bind(this,e,t)).catch(this.Mb.bind(this,e,t));else{if(this.a=e,"webkit-org.w3.clearkey"==this.c){var n=Y(t),r=JSON.parse(n);"oct"!=r.keys[0].kty&&(this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a=null),n=Z(r.keys[0].k),r=Z(r.keys[0].kid)}else n=new Uint8Array(t),r=null;var i=Ia("addKey");try{this.f[i](this.c,n,r,this.sessionId)}catch(e){this.a.reject(e),this.a=null}}},so.generateRequest=function(e,t){return Ga(this,t,null)},so.load=function(e){return"persistent-license"==this.g?Ga(this,null,e):Promise.reject(Error("Not a persistent session."))},so.update=function(e){var t=new P;return this.Mb(t,e),t},so.close=function(){if("persistent-license"!=this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var e=Ia("cancelKeyRequest");try{this.f[e](this.c,this.sessionId)}catch(e){}}return this.closed.resolve(),this.closed},so.remove=function(){return"persistent-license"!=this.g?Promise.reject(Error("Not a persistent session.")):this.close()};var is;so=Ha.prototype,so.Kb=function(e){this.size=void 0==e?0:1,this.a=e},so.sb=function(){return this.a},so.forEach=function(e){this.a&&e(this.a,is)},so.get=function(e){if(this.has(e))return this.a},so.has=function(e){var t=is;return!(!this.a||!ne(new Uint8Array(e),new Uint8Array(t)))},so.entries=function(){},so.keys=function(){},so.values=function(){},va(function(){!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(HTMLMediaElement.prototype.webkitGenerateKeyRequest?La("webkit"):HTMLMediaElement.prototype.generateKeyRequest?La(""):e.MSMediaKeys?(ns=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=_a,e.MediaKeys=Ea,e.MediaKeySystemAccess=ba,navigator.requestMediaKeySystemAccess=ma):(navigator.requestMediaKeySystemAccess=Pa,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Ra,e.MediaKeys=Da,e.MediaKeySystemAccess=xa))}),va(function(){if(e.MediaSource){var t=navigator.vendor,n=navigator.appVersion;!t||!n||0>t.indexOf("Apple")||(0<=n.indexOf("Version/8")?e.MediaSource=null:0<=n.indexOf("Version/9")?Ka():0<=n.indexOf("Version/10")&&(Ka(),Ya()))}});var as=0;za.prototype.then=function(e,t){var n=new za;switch(this.Aa){case 1:Za(this,n,e);break;case 2:Za(this,n,t);break;case as:this.c.push({L:n,pb:e}),this.b.push({L:n,pb:t})}return n},za.prototype.catch=function(e){return this.then(void 0,e)},za.prototype.fa=function(e){if(this.Aa==as){for(this.jb=e,this.Aa=1,e=0;e<this.c.length;++e)Za(this,this.c[e].L,this.c[e].pb);this.c=[],this.b=[]}},za.prototype.a=function(e){if(this.Aa==as){for(this.jb=e,this.Aa=2,e=0;e<this.b.length;++e)Za(this,this.b[e].L,this.b[e].pb);this.c=[],this.b=[]}};var os=null,ss=[];va(function(t){e.setImmediate?(no=function(t){return e.setImmediate(t)},ro=function(t){return e.clearImmediate(t)}):(no=function(t){return e.setTimeout(t,0)},ro=function(t){return e.clearTimeout(t)}),e.Promise&&!t||(e.Promise=za,e.Promise.resolve=Xa,e.Promise.reject=$a,e.Promise.all=Ja,e.Promise.race=Qa,e.Promise.prototype.then=za.prototype.then,e.Promise.prototype.catch=za.prototype.catch)}),va(function(){if(e.HTMLMediaElement){var t=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var e=t.apply(this,arguments);return e&&e.catch(function(){}),e}}}),va(function(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;!t.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in t&&(t.getVideoPlaybackQuality=io)}}),va(function(){if(!e.VTTCue&&e.TextTrackCue){var t=TextTrackCue.length;if(3==t)e.VTTCue=ao;else if(6==t)e.VTTCue=oo;else{try{var n=!!ao(1,2,"")}catch(e){n=!1}n&&(e.VTTCue=ao)}}})}).call(i,this),void 0!==e&&e.exports?e.exports=i.shaka:void 0!==(r=function(){return i.shaka}.call(t,n,t,e))&&(e.exports=r)}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=o.playkit();if(t.addEventListener(t.Event.SOURCE_SELECTED,function(e){(0,c.default)(e.payload.selectedSource,t)}),e){return new u.default(e.partnerId).getConfig(e.entryID).then(function(e){return t.configure(e),Promise.resolve(t)}).catch(function(e){return Promise.reject(e)})}return Promise.resolve(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var a=n(0),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),s=n(1),u=r(s),l=n(14),c=r(l)},function(e,t,n){"use strict";function r(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function i(e,t){var n=-1===e.url.indexOf("?")?"?":"&",i=r(),a=r(),o=i+":"+a;e.url+=n+"playSessionId="+o,t.sessionId=o}function a(e,t,n){var i=/:((?:[a-z0-9]|-)*)/i,a=i.exec(t);if(a&&a[1]){var o=t.replace(a[1],r());e.url=e.url.replace(t,o),n.sessionId=o}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if("string"==typeof e.url&&-1!==e.url.toLowerCase().indexOf("playmanifest/")){var n=/playSessionId=((?:[a-z0-9]|-|:)*)/i,r=n.exec(e.url);r&&r[1]?a(e,r[1],t):i(e,t)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o}])}); //# sourceMappingURL=kaltura-player.min.js.map \ No newline at end of file diff --git a/dist/kaltura-player.min.js.map b/dist/kaltura-player.min.js.map index c4a628248..638a6b575 100644 --- a/dist/kaltura-player.min.js.map +++ b/dist/kaltura-player.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///kaltura-player.min.js","webpack:///webpack/bootstrap 98114c4c97ce723c9c62","webpack:///webpack:///core/webpack/universalModuleDefinition","webpack:///webpack:/core/webpack/bootstrap dbf76349fddd4414c1d5","webpack:///webpack:///core/track/track.js","webpack:///webpack:///core/utils/logger.js","webpack:///webpack:///core/event/fake-event.js","webpack:///webpack:///core/track/audio-track.js","webpack:///webpack:///core/track/text-track.js","webpack:///webpack:///core/track/video-track.js","webpack:///webpack:///core/event/event-manager.js","webpack:///webpack:///core/event/events.js","webpack:///webpack:///core/player.js","webpack:///webpack:///core/event/fake-event-target.js","webpack:///webpack:///core/utils/player-error.js","webpack:///webpack:///core/utils/util.js","webpack:///webpack:///core/engines/html5/media-source/base-media-source-adapter.js","webpack:///webpack:///core/engines/html5/media-source/media-source-provider.js","webpack:///webpack:///core/plugin/base-plugin.js","webpack:///webpack:///core/plugin/plugin-manager.js","webpack:///webpack:///core/state/state-types.js","webpack:///webpack:///core/utils/multi-map.js","webpack:///webpack:///package.json","webpack:///webpack:///core/engines/html5/html5.js","webpack:///webpack:///core/engines/html5/media-source/adapters/native-adapter.js","webpack:///webpack:///core/playkit.js","webpack:///webpack:///core/state/state-manager.js","webpack:///webpack:///core/state/state.js","webpack:///webpack:///core/track/track-types.js","webpack:///webpack:///~/js-logger/src/logger.js","webpack:///./index.js","webpack:///webpack:///providers/webpack/universalModuleDefinition","webpack:///webpack:/providers/webpack/bootstrap c25ced737c8594c7041b","webpack:///webpack:///providers/k-provider/request-builder.js","webpack:///webpack:///providers/k-provider/ovp/config.js","webpack:///webpack:///providers/k-provider/enums.js","webpack:///webpack:///providers/k-provider/ovp/services/ovp-service.js","webpack:///webpack:///providers/k-provider/base-service-result.js","webpack:///webpack:///providers/util/logger.js","webpack:///webpack:///providers/k-provider/multi-request-builder.js","webpack:///webpack:///providers/entities/media-source.js","webpack:///webpack:///providers/entities/media-entry.js","webpack:///webpack:///providers/entities/drm.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-flavor-asset.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-media-entry.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-metadata-list-response.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-playback-context.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-playback-source.js","webpack:///webpack:///~/enumify/lib/enumify.js","webpack:///webpack:///providers/k-provider/ovp/loaders/data-loader-manager.js","webpack:///webpack:///providers/k-provider/ovp/loaders/media-entry-loader.js","webpack:///webpack:///providers/k-provider/ovp/loaders/session-loader.js","webpack:///webpack:///providers/k-provider/ovp/loaders/ui-config-loader.js","webpack:///webpack:///providers/k-provider/ovp/provider-parser.js","webpack:///webpack:///providers/entities/media-format.js","webpack:///webpack:///providers/k-provider/ovp/ovp-provider.js","webpack:///webpack:///providers/k-provider/ovp/play-source-url-builder.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-access-control-message.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-base-entry-list-response.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-drm-playback-plugin-data.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-metadata.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-rule-action.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kalturaUIConfResponse.js","webpack:///webpack:///providers/k-provider/ovp/services/base-entry-service.js","webpack:///webpack:///providers/k-provider/ovp/services/meta-data-service.js","webpack:///webpack:///providers/k-provider/ovp/services/session-service.js","webpack:///webpack:///providers/k-provider/ovp/services/ui-conf-service.js","webpack:///webpack:///providers/k-provider/xml-parser.js","webpack:///webpack:///ui/webpack/universalModuleDefinition","webpack:///webpack:/ui/webpack/bootstrap 22c3c46a80b1c7885159","webpack:///webpack:///node_modules/preact/dist/preact.js","webpack:///webpack:///node_modules/preact-redux/dist/preact-redux.js","webpack:///webpack:///ui/components/base.js","webpack:///webpack:///ui/utils/bind-actions.js","webpack:///webpack:///ui/components/icon/icon.js","webpack:///webpack:///node_modules/preact-i18n/dist/preact-i18n.js","webpack:///webpack:///node_modules/redux/es/index.js","webpack:///webpack:///node_modules/redux/es/utils/warning.js","webpack:///webpack:///ui/reducers/shell.js","webpack:///webpack:///ui/reducers/play-pause.js","webpack:///webpack:///ui/reducers/share.js","webpack:///webpack:///node_modules/process/browser.js","webpack:///webpack:///node_modules/redux/es/createStore.js","webpack:///webpack:///node_modules/lodash-es/isPlainObject.js","webpack:///webpack:///node_modules/lodash-es/_Symbol.js","webpack:///webpack:///node_modules/webpack/buildin/global.js","webpack:///webpack:///node_modules/redux/es/compose.js","webpack:///webpack:///ui/reducers/engine.js","webpack:///webpack:///ui/reducers/seekbar.js","webpack:///webpack:///ui/reducers/volume.js","webpack:///webpack:///ui/reducers/fullscreen.js","webpack:///webpack:///ui/reducers/loading.js","webpack:///webpack:///ui/reducers/cvaa.js","webpack:///webpack:///ui/reducers/settings.js","webpack:///webpack:///ui/utils/time-format.js","webpack:///webpack:///ui/components/smart-container/smart-container.js","webpack:///webpack:///ui/components/smart-container/smart-container-item.js","webpack:///webpack:///ui/components/overlay/overlay.js","webpack:///webpack:///ui/ui-manager.js","webpack:///webpack:///node_modules/lodash-es/_baseGetTag.js","webpack:///webpack:///node_modules/lodash-es/_root.js","webpack:///webpack:///node_modules/lodash-es/_freeGlobal.js","webpack:///webpack:///node_modules/lodash-es/_getRawTag.js","webpack:///webpack:///node_modules/lodash-es/_objectToString.js","webpack:///webpack:///node_modules/lodash-es/_getPrototype.js","webpack:///webpack:///node_modules/lodash-es/_overArg.js","webpack:///webpack:///node_modules/lodash-es/isObjectLike.js","webpack:///webpack:///node_modules/symbol-observable/index.js","webpack:///webpack:///node_modules/symbol-observable/lib/index.js","webpack:///webpack:///node_modules/webpack/buildin/module.js","webpack:///webpack:///node_modules/symbol-observable/lib/ponyfill.js","webpack:///webpack:///node_modules/redux/es/combineReducers.js","webpack:///webpack:///node_modules/redux/es/bindActionCreators.js","webpack:///webpack:///node_modules/redux/es/applyMiddleware.js","webpack:///webpack:///node_modules/dlv/dist/dlv.umd.js","webpack:///webpack:///ui/store.js","webpack:///webpack:///ui/fr.json","webpack:///webpack:///ui/components/engine-connector/engine-connector.js","webpack:///webpack:/ui/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","webpack:///webpack:///ui/utils/logger.js","webpack:///webpack:///node_modules/js-logger/src/logger.js","webpack:///webpack:///ui/components/shell/shell.js","webpack:///webpack:///ui/utils/is-mobile.js","webpack:///webpack:///ui/components/overlay-play/overlay-play.js","webpack:///webpack:///ui/components/loading/loading.js","webpack:///webpack:///ui/components/play-pause/play-pause.js","webpack:///webpack:///ui/components/seekbar/seekbar.js","webpack:///webpack:///ui/components/volume/volume.js","webpack:///webpack:///ui/components/share/share.js","webpack:///webpack:///ui/components/settings/settings.js","webpack:///webpack:///ui/components/dropdown-menu/dropdown-menu.js","webpack:///webpack:///ui/components/language/language.js","webpack:///webpack:///ui/components/fullscreen/fullscreen.js","webpack:///webpack:///ui/components/time-display/time-display.js","webpack:///webpack:///ui/components/top-bar/top-bar.js","webpack:///webpack:///ui/components/bottom-bar/bottom-bar.js","webpack:///webpack:///ui/components/share-overlay/share-overlay.js","webpack:///webpack:///ui/components/cvaa-overlay/cvaa-overlay.js","webpack:///webpack:///ui/components/keyboard.js","webpack:///../node_modules/playkit-js-ui/src/styles/style.css?b4f7","webpack:///../node_modules/playkit-js-ui/src/styles/style.css","webpack:///../node_modules/css-loader/lib/css-base.js","webpack:///../node_modules/style-loader/lib/addStyles.js","webpack:///../node_modules/style-loader/lib/urls.js","webpack:///webpack:///hls/webpack/universalModuleDefinition","webpack:///webpack:/hls/webpack/bootstrap 3d553f6cfbde57d4496a","webpack:///webpack:///hls/hls-adapter.js","webpack:///webpack:/hls/external {\"commonjs\":\"hls.js\",\"commonjs2\":\"hls.js\",\"amd\":\"hls.js\",\"root\":\"Hls\"}","webpack:///webpack:/hls/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","webpack:///node_modules/browser-pack/_prelude.js","webpack:///node_modules/events/events.js","webpack:///node_modules/url-toolkit/src/url-toolkit.js","webpack:///node_modules/webworkify/index.js","webpack:///src/config.js","webpack:///src/controller/abr-controller.js","webpack:///src/controller/audio-stream-controller.js","webpack:///src/controller/audio-track-controller.js","webpack:///src/controller/buffer-controller.js","webpack:///src/controller/cap-level-controller.js","webpack:///src/controller/fps-controller.js","webpack:///src/controller/id3-track-controller.js","webpack:///src/controller/level-controller.js","webpack:///src/controller/stream-controller.js","webpack:///src/controller/subtitle-stream-controller.js","webpack:///src/controller/subtitle-track-controller.js","webpack:///src/controller/timeline-controller.js","webpack:///src/crypt/aes-crypto.js","webpack:///src/crypt/aes-decryptor.js","webpack:///src/crypt/decrypter.js","webpack:///src/crypt/fast-aes-key.js","webpack:///src/demux/aacdemuxer.js","webpack:///src/demux/adts.js","webpack:///src/demux/demuxer-inline.js","webpack:///src/demux/demuxer-worker.js","webpack:///src/demux/demuxer.js","webpack:///src/demux/exp-golomb.js","webpack:///src/demux/id3.js","webpack:///src/demux/mp3demuxer.js","webpack:///src/demux/mp4demuxer.js","webpack:///src/demux/mpegaudio.js","webpack:///src/demux/sample-aes.js","webpack:///src/demux/tsdemuxer.js","webpack:///src/errors.js","webpack:///src/event-handler.js","webpack:///src/events.js","webpack:///src/helper/aac.js","webpack:///src/helper/buffer-helper.js","webpack:///src/helper/level-helper.js","webpack:///src/hls.js","webpack:///src/index.js","webpack:///src/loader/fragment-loader.js","webpack:///src/loader/key-loader.js","webpack:///src/loader/playlist-loader.js","webpack:///src/remux/mp4-generator.js","webpack:///src/remux/mp4-remuxer.js","webpack:///src/remux/passthrough-remuxer.js","webpack:///src/utils/attr-list.js","webpack:///src/utils/binary-search.js","webpack:///src/utils/cea-608-parser.js","webpack:///src/utils/cues.js","webpack:///src/utils/ewma-bandwidth-estimator.js","webpack:///src/utils/ewma.js","webpack:///src/utils/logger.js","webpack:///src/utils/timeRanges.js","webpack:///src/utils/vttcue.js","webpack:///src/utils/vttparser.js","webpack:///src/utils/webvtt-parser.js","webpack:///src/utils/xhr-loader.js","webpack:///webpack:///dash/webpack/universalModuleDefinition","webpack:///webpack:/dash/webpack/bootstrap 37792bb50222e2c929fb","webpack:///webpack:///dash/dash-adapter.js","webpack:///webpack:/dash/external {\"commonjs\":\"shaka-player\",\"commonjs2\":\"shaka-player\",\"amd\":\"shaka-player\",\"root\":\"shaka\"}","webpack:///webpack:/dash/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","webpack:///../node_modules/shaka-player/third_party/closure/goog/base.js","webpack:///../node_modules/shaka-player/lib/cast/cast_proxy.js","webpack:///../node_modules/shaka-player/lib/abr/ewma.js","webpack:///../node_modules/shaka-player/lib/abr/ewma_bandwidth_estimator.js","webpack:///../node_modules/shaka-player/lib/debug/log.js","webpack:///../node_modules/shaka-player/lib/util/error.js","webpack:///../node_modules/shaka-player/third_party/closure/goog/uri/uri.js","webpack:///../node_modules/shaka-player/third_party/closure/goog/uri/utils.js","webpack:///../node_modules/shaka-player/lib/util/functional.js","webpack:///../node_modules/shaka-player/lib/util/manifest_parser_utils.js","webpack:///../node_modules/shaka-player/lib/util/config_utils.js","webpack:///../node_modules/shaka-player/lib/util/public_promise.js","webpack:///../node_modules/shaka-player/lib/net/networking_engine.js","webpack:///../node_modules/shaka-player/lib/util/array_utils.js","webpack:///../node_modules/shaka-player/lib/util/multi_map.js","webpack:///../node_modules/shaka-player/lib/util/event_manager.js","webpack:///../node_modules/shaka-player/lib/util/map_utils.js","webpack:///../node_modules/shaka-player/lib/util/string_utils.js","webpack:///../node_modules/shaka-player/lib/util/timer.js","webpack:///../node_modules/shaka-player/lib/util/uint8array_utils.js","webpack:///../node_modules/shaka-player/lib/media/drm_engine.js","webpack:///../node_modules/shaka-player/lib/media/text_engine.js","webpack:///../node_modules/shaka-player/lib/media/time_ranges_utils.js","webpack:///../node_modules/shaka-player/lib/media/media_source_engine.js","webpack:///../node_modules/shaka-player/lib/util/language_utils.js","webpack:///../node_modules/shaka-player/lib/util/stream_utils.js","webpack:///../node_modules/shaka-player/lib/abr/simple_abr_manager.js","webpack:///../node_modules/shaka-player/lib/util/fake_event.js","webpack:///../node_modules/shaka-player/lib/cast/cast_utils.js","webpack:///../node_modules/shaka-player/lib/cast/cast_sender.js","webpack:///../node_modules/shaka-player/lib/util/fake_event_target.js","webpack:///../node_modules/shaka-player/lib/cast/cast_receiver.js","webpack:///../node_modules/shaka-player/lib/player.js","webpack:///../node_modules/shaka-player/lib/util/xml_utils.js","webpack:///../node_modules/shaka-player/lib/dash/content_protection.js","webpack:///../node_modules/shaka-player/lib/dash/mpd_utils.js","webpack:///../node_modules/shaka-player/lib/media/segment_reference.js","webpack:///../node_modules/shaka-player/lib/util/data_view_reader.js","webpack:///../node_modules/shaka-player/lib/util/mp4_parser.js","webpack:///../node_modules/shaka-player/lib/media/mp4_segment_index_parser.js","webpack:///../node_modules/shaka-player/lib/media/segment_index.js","webpack:///../node_modules/shaka-player/lib/util/ebml_parser.js","webpack:///../node_modules/shaka-player/lib/media/webm_segment_index_parser.js","webpack:///../node_modules/shaka-player/lib/dash/segment_base.js","webpack:///../node_modules/shaka-player/lib/dash/segment_list.js","webpack:///../node_modules/shaka-player/lib/dash/segment_template.js","webpack:///../node_modules/shaka-player/lib/media/manifest_parser.js","webpack:///../node_modules/shaka-player/lib/media/presentation_timeline.js","webpack:///../node_modules/shaka-player/lib/dash/dash_parser.js","webpack:///../node_modules/shaka-player/lib/hls/hls_classes.js","webpack:///../node_modules/shaka-player/lib/hls/hls_utils.js","webpack:///../node_modules/shaka-player/lib/util/text_parser.js","webpack:///../node_modules/shaka-player/lib/hls/manifest_text_parser.js","webpack:///../node_modules/shaka-player/lib/net/data_uri_plugin.js","webpack:///../node_modules/shaka-player/lib/hls/hls_parser.js","webpack:///../node_modules/shaka-player/lib/media/ttml_text_parser.js","webpack:///../node_modules/shaka-player/lib/media/mp4_ttml_parser.js","webpack:///../node_modules/shaka-player/lib/media/vtt_text_parser.js","webpack:///../node_modules/shaka-player/lib/media/mp4_vtt_parser.js","webpack:///../node_modules/shaka-player/lib/media/playhead.js","webpack:///../node_modules/shaka-player/lib/media/playhead_observer.js","webpack:///../node_modules/shaka-player/lib/media/streaming_engine.js","webpack:///../node_modules/shaka-player/lib/net/http_plugin.js","webpack:///../node_modules/shaka-player/lib/offline/db_engine.js","webpack:///../node_modules/shaka-player/lib/offline/download_manager.js","webpack:///../node_modules/shaka-player/lib/offline/offline_utils.js","webpack:///../node_modules/shaka-player/lib/offline/offline_manifest_parser.js","webpack:///../node_modules/shaka-player/lib/offline/offline_scheme.js","webpack:///../node_modules/shaka-player/lib/util/cancelable_chain.js","webpack:///../node_modules/shaka-player/lib/offline/storage.js","webpack:///../node_modules/shaka-player/lib/polyfill/all.js","webpack:///../node_modules/shaka-player/lib/polyfill/fullscreen.js","webpack:///../node_modules/shaka-player/lib/util/pssh.js","webpack:///../node_modules/shaka-player/lib/polyfill/patchedmediakeys_ms.js","webpack:///../node_modules/shaka-player/lib/polyfill/patchedmediakeys_nop.js","webpack:///../node_modules/shaka-player/lib/polyfill/patchedmediakeys_webkit.js","webpack:///../node_modules/shaka-player/lib/polyfill/mediasource.js","webpack:///../node_modules/shaka-player/lib/polyfill/promise.js","webpack:///../node_modules/shaka-player/lib/polyfill/videoplaybackquality.js","webpack:///../node_modules/shaka-player/lib/polyfill/vttcue.js","webpack:///../node_modules/shaka-player/lib/polyfill/indexed_db.js","webpack:///../node_modules/shaka-player/lib/polyfill/mathround.js","webpack:///../node_modules/shaka-player/lib/polyfill/mediakeys.js","webpack:///../node_modules/shaka-player/lib/polyfill/video_play_promise.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","value","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","length","descriptor","writable","key","protoProps","staticProps","Track","settings","arguments","undefined","_id","id","_active","active","_label","label","_language","language","_index","index","set","default","LOG_LEVEL","_jsLogger","JsLogger","obj","newObj","DEBUG","INFO","TIME","WARN","ERROR","OFF","LoggerFactory","options","useDefaults","lf","defaultLevel","FakeEvent","type","payload","bubbles","cancelable","defaultPrevented","timeStamp","window","performance","now","Date","isTrusted","currentTarget","stopped","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","setPrototypeOf","__proto__","_track","_track2","AudioTrack","_Track","getPrototypeOf","apply","TextTrack","_this","_kind","kind","VideoTrack","_bandwidth","bandwidth","_interopRequireDefault","_multiMap","_multiMap2","_fakeEvent","EventManager","_bindingMap","removeAll","Promise","resolve","listener","binding","Binding_","push","list","unlisten","remove","listeners","getAll","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","Symbol","iterator","next","done","err","return","clear","addEventListener","removeEventListener","CUSTOM_EVENTS","HTML5_EVENTS","PLAYER_EVENTS","_util","ABORT","CAN_PLAY","CAN_PLAY_THROUGH","DURATION_CHANGE","EMPTIED","ENDED","LOADED_DATA","LOADED_METADATA","LOAD_START","PAUSE","PLAY","PLAYING","PROGRESS","RATE_CHANGE","SEEKED","SEEKING","STALLED","SUSPEND","TIME_UPDATE","VOLUME_CHANGE","WAITING","VIDEO_TRACK_CHANGED","AUDIO_TRACK_CHANGED","TEXT_TRACK_CHANGED","TRACKS_CHANGED","PLAYER_STATE_CHANGED","FIRST_PLAY","SOURCE_SELECTED","merge","_eventManager","_eventManager2","_fakeEvent2","_fakeEventTarget","_fakeEventTarget2","_events","_stateTypes","_stateTypes2","_logger","_logger2","_html","_html2","_pluginManager","_pluginManager2","_stateManager","_stateManager2","_trackTypes","_trackTypes2","_videoTrack","_videoTrack2","_audioTrack","_audioTrack2","_textTrack","_textTrack2","Player","_FakeEventTarget","config","_tracks","_firstPlay","getLogger","_readyPromise","reject","listen","configure","_config","_defaultConfig","_loadPlugins","_selectEngine","_attachMedia","_engine","destroy","plugins","load","sources","canPlayType","mimetype","dispatchEvent","selectedSource","_loadEngine","source","preload","_this2","playerEvent","event","_markActiveTrack","selectedVideoTrack","selectedAudioTrack","selectedTextTrack","_onPlay","bind","_getTracksByType","filter","track","VIDEO","AUDIO","TEXT","selectVideoTrack","selectAudioTrack","selectTextTrack","enableAdaptiveBitrate","tracks","getTracks","_this3","then","data","catch","error","_this4","src","play","ready","pause","sessionId","session","to","isNumber","boundedTo","duration","currentTime","vol","isFloat","boundedVol","volume","paused","seeking","mute","muted","FakeEventTarget","_listeners","dispatchTarget","handleEvent","exception","PlayerError","param","message","TYPE","NOT_REGISTERED_PLUGIN","NOT_VALID_HANDLER","NOT_IMPLEMENTED_METHOD","method","Number","isInt","objects","assign","_playerError","_playerError2","BaseMediaSourceAdapter","videoElement","_videoElement","_sourceObj","_trigger","CustomEvents","getError","videoTrack","audioTrack","textTrack","mimeType","registerMediaSourceAdapter","_nativeAdapter","_nativeAdapter2","MediaSourceProvider","mediaSourceAdapter","_mediaSourceAdapters","includes","debug","indexOf","splice","mediaSourceAdapters","_selectedAdapter","createAdapter","engines","register","_player","BasePlugin","player","eventManager","logger","defaultConfig","attr","update","registerPlugin","_basePlugin","_basePlugin2","PluginManager","_plugins","Map","_registry","has","pluginClass","isValid","createPlugin","forEach","_destroy","plugin","delete","handler","PLAYER_STATE_TYPES","IDLE","LOADING","PAUSED","BUFFERING","MultiMap","_map","Array","isArray","values","slice","concat","keys","version","main","scripts","clean","prebuild","build:prod","build","dev","test","test:chrome","test:chrome:dots","test:firefox","test:safari","test:watch","start","release","publish","eslint","flow","eslint:flow:test","commit:dist","prepush-msg:build","prepush-msg:dist","prepush-msg:done","pre-push","devDependencies","babel-cli","babel-core","babel-eslint","babel-loader","babel-plugin-istanbul","babel-plugin-transform-class-properties","babel-plugin-transform-flow-strip-types","babel-preset-es2015","babel-register","chai","cross-env","eslint-loader","eslint-plugin-flowtype","eslint-plugin-import","eslint-plugin-mocha-no-only","flow-bin","istanbul","karma","karma-chai","karma-chrome-launcher","karma-cli","karma-coverage","karma-firefox-launcher","karma-ie-launcher","karma-mocha","karma-safari-launcher","karma-sourcemap-loader","karma-webpack","mocha","mocha-cli","sinon","sinon-chai","standard-version","uglifyjs-webpack-plugin","webpack","webpack-dev-server","repository","url","keywords","license","bugs","homepage","dependencies","js-logger","_mediaSourceProvider","_mediaSourceProvider2","Html5","_createVideoElement","_loadMediaSourceAdapter","attach","detach","_mediaSourceAdapter","_el","removeAttribute","parentNode","removeChild","document","createElement","style","width","height","backgroundColor","controls","body","appendChild","getMediaSourceAdapter","getVideoElement","seekable","played","buffered","defaultMuted","poster","autoplay","loop","playbackRate","defaultPlaybackRate","ended","networkState","readyState","videoHeight","videoWidth","TEST_VID","e","EngineName","_get","receiver","Function","desc","getOwnPropertyDescriptor","parent","_baseMediaSourceAdapter","_baseMediaSourceAdapter2","NativeAdapter","_BaseMediaSourceAdapt","toLowerCase","toString","_loadPromise","_getParsedTracks","videoTracks","_getParsedVideoTracks","audioTracks","_getParsedAudioTracks","textTracks","_getParsedTextTracks","parsedTracks","selected","enabled","mode","_disableVideoTracks","_onTrackChanged","_disableAudioTracks","_disableTextTracks","playkit","_player2","VERSION","_package","packageData","log","_defineProperty","_state","_state2","StateManager","_PlayerStates$IDLE","_PlayerStates$LOADING","_PlayerStates$PAUSED","_PlayerStates$PLAYING","_PlayerStates$BUFFERI","_transitions","_updateState","_dispatchEvent","autoPlay","_history","_prevState","_curState","_attachListeners","_doTransition","transition","oldState","newState","State","_duration","_timestamp","endTime","TRACK_TYPES","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_RESULT__","global","Logger","logHandler","contextualLoggersByNameMap","scope","func","args","defineLogLevel","ContextualLogger","defaultContext","context","setLevel","filterLevel","info","newLevel","enabledFor","lvl","invoke","warn","time","timeEnd","level","msgArgs","globalLogger","L","setHandler","createDefaultHandler","formatter","messages","unshift","timerStartTimeByLabelMap","invokeConsoleMethod","hdlr","console","timerLabel","getTime","PlaykitUI","OvpProvider","Playkit","_playkitJs","_ovpProvider","_ovpProvider2","_playkitJsUi","_playkitJsUi2","_typeof","RequestBuilder","headers","baseUrl","Error","service","action","request","XMLHttpRequest","onreadystatechange","status","jsonResponse","JSON","parse","responseText","code","open","getUrl","setRequestHeader","send","params","beUrl","serviceParams","clientTag","apiVersion","format","Configuration","clientConfig","UIConfCreationMode","UIConfType","MediaEntryType","MediaType","EntryType","EntryModerationStatus","EntryStatus","MetadataStatus","MetadataObjectType","Status","KalturaRuleActionType","Scheme","_enumify","_Enum","Enum","initEnum","PLAYREADY_CENC","WIDEVINE_CENC","FAIRPLAY","PLAYREADY","WIDEVINE","_Enum2","DRM_POLICY","BLOCK","PREVIEW","LIMIT_FLAVORS","ADD_TO_STORAGE","LIMIT_DELIVERY_PROFILES","SERVE_FROM_REMOTE_SERVER","REQUEST_HOST_REGEX","LIMIT_THUMBNAIL_CAPTURE","_Enum3","QUEUED","CONVERTING","READY","DELETED","NOT_APPLICABLE","TEMP","WAIT_FOR_CONVERT","IMPORTING","VALIDATING","EXPORTING","_Enum4","AD_CUE_POINT","ANNOTATION","CODE_CUE_POINT","THUMB_CUE_POINT","ENTRY","CATEGORY","USER","PARTNER","DYNAMIC_OBJECT","_Enum5","VALID","INVALID","_Enum6","ERROR_IMPORTING","ERROR_CONVERTING","SCAN_FAILURE","IMPORT","INFECTED","PRECONVERT","PENDING","MODERATE","BLOCKED","NO_CONTENT","_Enum7","PENDING_MODERATION","APPROVED","REJECTED","FLAGGED_FOR_REVIEW","AUTO_APPROVED","_Enum8","AUTOMATIC","EXTERNAL_MEDIA","MEDIA_CLIP","MIX","PLAYLIST","DATA","LIVE_STREAM","LIVE_CHANNEL","DOCUMENT","_Enum9","IMAGE","LIVE_STREAM_FLASH","LIVE_STREAM_WINDOWS_MEDIA","LIVE_STREAM_REAL_MEDIA","LIVE_STREAM_QUICKTIME","_Enum10","_Enum11","PLAYER","CONTRIBUTION_WIZARD","SIMPLE_EDITOR","ADVANCED_EDITOR","APP_STUDIO","KRECORD","PLAYER_V3","KMC_ACCOUNT","KMC_ANALYTICS","KMC_CONTENT","KMC_DASHBOARD","KMC_LOGIN","PLAYER_SL","CLIENTSIDE_ENCODER","KMC_GENERAL","KMC_ROLES_AND_PERMISSIONS","CLIPPER","KSR","KUPLOAD","WEBCASTING","_Enum12","WIZARD","ADVANCED","_multiRequestBuilder","_multiRequestBuilder2","_config2","OvpService","ks","partnerId","ovpParams","multiReq","ServiceResult","response","hasError","objectType","ServiceError","MultiRequestResult","_requestBuilder","_requestBuilder2","_baseServiceResult","_baseServiceResult2","MultiRequestBuilder","_RequestBuilder","requests","requestParams","serviceDef","stringify","doHttpRequest","errorText","results","success","result","serviceResult","_drm","MediaSource","_mediaSource","_enums","MediaEntry","metaData","Unknown","Drm","licenseUrl","scheme","KalturaFlavorAsset","flavorParamsId","fileExt","bitrate","frameRate","isOriginal","isWeb","containerFormat","videoCodecId","KalturaMediaEntry","entry","dataUrl","entryType","mediaType","flavorParamsIds","_kalturaMetadata","_kalturaMetadata2","KalturaMetadataListResponse","_ServiceResult","responseObj","totalCount","metas","map","meta","_kalturaAccessControlMessage","_kalturaAccessControlMessage2","_kalturaPlaybackSource","_kalturaPlaybackSource2","_kalturaRuleAction","_kalturaRuleAction2","_kalturaFlavorAsset","_kalturaFlavorAsset2","KalturaPlaybackContext","actions","flavorAssets","flavor","_kalturaDrmPlaybackPluginData","_kalturaDrmPlaybackPluginData2","KalturaPlaybackSource","drm","deliveryProfileId","protocols","flavorIds","protocol","returnValue","split","copyProperties","_iteratorNormalCompletion3","_didIteratorError3","_iteratorError3","_step3","_iterator3","getOwnPropertyNames","INITIALIZED","instanceProperties","arg","_enumValuesFromArray","_enumValuesFromObject","freeze","enumValues","arr","_pushEnumValue","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","enumValue","ordinal","find","x","_ovpService","_ovpService2","DataLoaderManager","partnerID","_loaders","_multiRequest","getMultirequest","loader","execution_loader","startIndex","add","executionLoaderResponseMap","from","val","_loadersResponseMap","execute","_multiResponse","preparedData","prepareData","loaderDataIndexes","_baseEntryService","_baseEntryService2","_metaDataService","_metaDataService2","_kalturaPlaybackContext","_kalturaPlaybackContext2","_kalturaMetadataListResponse","_kalturaMetadataListResponse2","_kalturaBaseEntryListResponse","_kalturaBaseEntryListResponse2","MediaEntryLoader","_response","buildRequests","_entryId","entryId","getPlaybackContext","_requests","mediaEntryResponse","entries","playBackContextResult","metadataListResult","_sessionService","_sessionService2","SessionLoader","_partnerId","anonymousSession","_uiConfService","_uiConfService2","_kalturaUIConfResponse","_kalturaUIConfResponse2","UiConfigLoader","_uiConfId","uiConfId","uiConf","_kalturaMediaEntry","_playSourceUrlBuilder","_playSourceUrlBuilder2","_xmlParser","_xmlParser2","_mediaFormat","_mediaEntry","_mediaEntry2","_drm2","_mediaSource2","SUPPORTED_FORMATS","MediaFormat","dash","hls","mp4","ProviderParser","mediaEntry","playbackContext","metadataList","kalturaSources","parseSource","metadata","parseMetaData","Image","Audio","Vod","Live","playUrl","mediaFormat","mediaSource","hasFlavorIds","splittedUrl","baseProtocol","substring","extension","pathExt","flavorIdsArr","flavors","getProtocol","hasDrmData","drmParams","licenseURL","drmData","metaXml","domParser","DOMParser","xml","replace","parseFromString","metasObj","xmlToJson","wvm","mp3","_providerParser","_providerParser2","_dataLoaderManager","_dataLoaderManager2","_mediaEntryLoader","_mediaEntryLoader2","_sessionLoader","_sessionLoader2","_uiConfigLoader","_uiConfigLoader2","_isAnonymous","_dataLoader","validateParams","fetchData","parseDataFromResponse","uiConfID","sessionLoader","uiConfLoader","pluginsJson","mediaLoader","getMediaEntry","PlaySourceUrlBuilder","urlParams","endsWith","string","searchString","KalturaAccessControlMessage","_kalturaMediaEntry2","KalturaBaseEntryListResponse","KalturaDrmPlaybackPluginData","KalturaMetadata","metadataProfileId","metadataProfileVersion","metadataObjectType","objectId","created","setUTCSeconds","createdAt","updated","updatedAt","KalturaRuleAction","KalturaUiConfResponse","description","objTypeAsString","htmlParams","swfUrl","confFilePath","confFile","confFileFeatures","confVars","useCdn","tags","swfUrlVersion","html5Url","partnerTags","objType","creationMode","BaseEntryService","_OvpService","tag","contextDataParams","flavorTags","getEntryListReqParams","redirectFromEntryId","responseProfile","fields","MetaDataService","objectIdEqual","metadataObjectTypeEqual","SessionService","widgetId","UiConfService","responseProfileParams","XmlParser","nodeType","attributes","j","attribute","item","nodeName","nodeValue","hasChildNodes","childNodes","old","__WEBPACK_EXTERNAL_MODULE_48__","VNode","h","lastSimple","child","simple","children","EMPTY_CHILDREN","stack","pop","String","vnode","extend","cloneElement","enqueueRender","component","__d","items","debounceRendering","setTimeout","rerender","renderComponent","isSameNodeType","node","hydrating","splitText","_componentConstructor","isNamedNode","__n","getNodeProps","defaultProps","createNode","isSvg","createElementNS","removeNode","setAccessor","cssText","IS_NON_DIMENSIONAL","innerHTML","__html","useCapture","eventProxy","__l","setProperty","ns","removeAttributeNS","setAttributeNS","setAttribute","className","flushMounts","mounts","afterMount","componentDidMount","diff","dom","mountAll","componentRoot","diffLevel","isSvgMode","ownerSVGElement","ret","idiff","out","prevSvgMode","_component","createTextNode","replaceChild","recollectNodeTree","__preactattr_","buildComponentFromVNode","firstChild","fc","vchildren","nextSibling","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","isHydrating","vchild","originalChildren","keyed","keyedLen","min","len","childrenLen","vlen","_child","__k","trim","insertBefore","unmountOnly","unmountComponent","ref","removeChildren","lastChild","previousSibling","attrs","collectComponent","components","createComponent","Ctor","inst","render","Component","doRender","__b","state","setComponentProps","opts","__x","__r","base","componentWillMount","componentWillReceiveProps","__c","__p","syncComponentUpdates","isChild","rendered","cbase","previousProps","previousState","__s","previousContext","isUpdate","nextBase","initialBase","initialChildComponent","skip","shouldComponentUpdate","componentWillUpdate","getChildContext","toUnmount","childComponent","childProps","__u","baseParent","componentRef","t","componentDidUpdate","afterUpdate","__h","originalComponent","oldDom","isDirectOwner","isOwner","beforeUnmount","componentWillUnmount","inner","setState","callback","forceUpdate","preact","redux","proptype","createListenerCollection","current","CLEARED","notify","subscribe","isSubscribed","warning","warnAboutReceivingStore","didWarnAboutReceivingStore","connectAdvanced","selectorFactory","_contextTypes","_childContextTypes","_ref","_ref$getDisplayName","getDisplayName","_ref$methodName","methodName","_ref$renderCountProp","renderCountProp","_ref$shouldHandleStat","shouldHandleStateChanges","_ref$storeKey","storeKey","_ref$withRef","withRef","connectOptions","objectWithoutProperties","subscriptionKey","hotReloadingVersion","contextTypes","storeShape","PropTypes","instanceOf","Subscription","childContextTypes","WrappedComponent","invariant","wrappedComponentName","displayName","selectorFactoryOptions","_extends","Connect","_Component","classCallCheck","possibleConstructorReturn","renderCount","store","parentSub","setWrappedInstance","getState","initSelector","initSubscription","inherits","_ref2","subscription","trySubscribe","selector","run","nextProps","tryUnsubscribe","getWrappedInstance","wrappedInstance","dispatch","sourceSelector","dummyState","onStateChange","notifyNestedSubs","Boolean","addExtraProps","withExtras","shallowEqual","a","b","countA","countB","hasOwn","_key","getPrototype","nativeGetPrototype","isHostObject","isObjectLike","isPlainObject","objectToString","objectTag","proto","funcToString","objectCtorString","verifyPlainObject","wrapMapToPropsConstant","getConstant","constantSelector","constant","dependsOnOwnProps","getDependsOnOwnProps","mapToProps","wrapMapToPropsFunc","proxy","stateOrDispatch","ownProps","whenMapDispatchToPropsIsFunction","mapDispatchToProps","whenMapDispatchToPropsIsMissing","whenMapDispatchToPropsIsObject","bindActionCreators","whenMapStateToPropsIsFunction","mapStateToProps","whenMapStateToPropsIsMissing","defaultMergeProps","stateProps","dispatchProps","wrapMergePropsFunc","mergeProps","pure","areMergedPropsEqual","hasRunOnce","mergedProps","nextMergedProps","whenMergePropsIsFunction","whenMergePropsIsOmitted","verify","verifySubselectors","impureFinalPropsSelectorFactory","pureFinalPropsSelectorFactory","handleFirstCall","firstState","firstOwnProps","hasRunAtLeastOnce","handleNewPropsAndNewState","handleNewProps","handleNewState","nextStateProps","statePropsChanged","areStatePropsEqual","handleSubsequentCalls","nextState","nextOwnProps","propsChanged","areOwnPropsEqual","stateChanged","areStatesEqual","finalPropsSelectorFactory","initMapStateToProps","initMapDispatchToProps","initMergeProps","match","factories","strictEqual","Children","only","isRequired","element","shape","nullListeners","unsubscribe","addNestedSub","Provider","storeSubscription","REACT_STATICS","getDefaultProps","mixins","propTypes","KNOWN_STATICS","caller","arity","isGetOwnPropertySymbolsAvailable","getOwnPropertySymbols","targetComponent","sourceComponent","customStatics","objectProto","defaultMapDispatchToPropsFactories","defaultMapStateToPropsFactories","defaultMergePropsFactories","connect","_ref$connectHOC","connectHOC","_ref$mapStateToPropsF","mapStateToPropsFactories","_ref$mapDispatchToPro","mapDispatchToPropsFactories","_ref$mergePropsFactor","mergePropsFactories","_ref$selectorFactory","_ref2$pure","_ref2$areStatesEqual","_ref2$areOwnPropsEqua","_ref2$areStatePropsEq","_ref2$areMergedPropsE","extraOptions","_preact","BaseComponent","bindActions","_redux","Icon","viewBox","r","v","u","f","none","one","singular","some","many","plural","other","g","fallback","dictionary","definition","mark","intl","location","y","title","IntlProvider","Text","Localizer","withText","__webpack_exports__","process","isCrushed","__WEBPACK_IMPORTED_MODULE_0__createStore__","__WEBPACK_IMPORTED_MODULE_1__combineReducers__","__WEBPACK_IMPORTED_MODULE_2__bindActionCreators__","__WEBPACK_IMPORTED_MODULE_3__applyMiddleware__","__WEBPACK_IMPORTED_MODULE_4__compose__","__WEBPACK_IMPORTED_MODULE_5__utils_warning__","env","NODE_ENV","_toConsumableArray","arr2","types","ADD_PLAYER_CLASS","REMOVE_PLAYER_CLASS","UPDATE_IS_MOBILE","initialState","playerClasses","isMobile","addPlayerClass","removePlayerClass","updateIsMobile","TOGGLE_PLAY","isPlaying","toggleIsPlaying","TOGGLE_SHARE_OVERLAY","overlayOpen","show","toggleShareOverlay","defaultSetTimout","defaultClearTimeout","runTimeout","fun","cachedSetTimeout","runClearTimeout","marker","cachedClearTimeout","clearTimeout","cleanUpNextTick","draining","currentQueue","queue","queueIndex","drainQueue","timeout","Item","array","noop","nextTick","browser","argv","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","cwd","chdir","dir","umask","createStore","reducer","preloadedState","enhancer","ensureCanMutateNextListeners","nextListeners","currentListeners","currentState","__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__","isDispatching","currentReducer","replaceReducer","nextReducer","ActionTypes","INIT","observable","outerSubscribe","observer","observeState","__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default","__WEBPACK_IMPORTED_MODULE_1_symbol_observable__","__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__","__WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__","__WEBPACK_IMPORTED_MODULE_1__getPrototype_js__","funcProto","__WEBPACK_IMPORTED_MODULE_0__root_js__","eval","compose","_len","funcs","reduce","UPDATE_PLAYER_STATE","UPDATE_IS_PLAYING","UPDATE_CURRENT_TIME","UPDATE_DURATION","UPDATE_VOLUME","UPDATE_MUTED","UPDATE_METADATA_LOADING_STATUS","UPDATE_AUDIO_TRACKS","UPDATE_VIDEO_TRACKS","UPDATE_TEXT_TRACKS","metadataLoaded","playerState","updatePlayerState","prevoiusState","updateIsPlaying","updateCurrentTime","updateDuration","updateVolume","updateMuted","updateMetadataLoadingStatus","updateAudioTracks","updateVideoTracks","updateTextTracks","UPDATE_SEEKBAR_DRAGGING_STATUS","draggingActive","updateSeekbarDraggingStatus","UPDATE_VOLUME_DRAGGING_STATUS","updateVolumeDraggingStatus","UPDATE_FULLSCREEN","fullscreen","updateFullscreen","UPDATE_LOADING_SPINNER_STATE","showLoadingSpinner","updateLoadingSpinnerState","TOGGLE_CVAA_OVERLAY","toggleCVAAOverlay","UPDATE_QUALITY","UPDATE_SPEED","quality","speed","updateQuality","updateSpeed","toHHMMSS","input","sec_num","parseInt","hours","Math","floor","minutes","seconds","SmartContainer","_dropdownMenu","_dropdownMenu2","htmlFor","onSelect","_dec","_class","_preactI18n","_preactRedux","_bindActions","_shell","_icon","_icon2","Overlay","overlayClass","role","onClick","onClose","aria-label","_store","_store2","_fr","_fr2","_engineConnector","_engineConnector2","_shell2","_overlayPlay","_overlayPlay2","_loading","_loading2","_playPause","_playPause2","_seekbar","_seekbar2","_volume","_volume2","_share","_share2","_settings","_settings2","_language2","_fullscreen","_fullscreen2","_timeDisplay","_timeDisplay2","_topBar","_topBar2","_bottomBar","_bottomBar2","_shareOverlay","_shareOverlay2","_cvaaOverlay","_cvaaOverlay2","_keyboard","_keyboard2","UIManager","ui","translations","Loading","OverlayPlay","template","_buildUI","devToolsExtension","instanceId","showFramePreview","showTimeBubble","playerWrapper","playerElement","getElementsByTagName","getElementsByClassName","baseGetTag","undefinedTag","nullTag","symToStringTag","__WEBPACK_IMPORTED_MODULE_1__getRawTag_js__","__WEBPACK_IMPORTED_MODULE_2__objectToString_js__","__WEBPACK_IMPORTED_MODULE_0__Symbol_js__","toStringTag","__WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__","freeSelf","freeGlobal","getRawTag","isOwn","unmasked","nativeObjectToString","__WEBPACK_IMPORTED_MODULE_0__overArg_js__","overArg","transform","_ponyfill","_ponyfill2","webpackPolyfill","deprecate","paths","symbolObservablePonyfill","_Symbol","getUndefinedStateErrorMessage","actionType","getUnexpectedStateShapeWarningMessage","inputState","reducers","unexpectedKeyCache","reducerKeys","argumentName","__WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__","join","unexpectedKeys","assertReducerShape","random","combineReducers","finalReducers","__WEBPACK_IMPORTED_MODULE_2__utils_warning__","finalReducerKeys","shapeAssertionError","warningMessage","hasChanged","_i","previousStateForKey","nextStateForKey","errorMessage","bindActionCreator","actionCreator","actionCreators","boundActionCreators","__WEBPACK_IMPORTED_MODULE_0__utils_warning__","applyMiddleware","middlewares","_dispatch","chain","middlewareAPI","middleware","__WEBPACK_IMPORTED_MODULE_0__compose__","_engine2","_cvaa","_cvaa2","engine","shell","seekbar","loading","playPause","share","cvaa","core","disable","auto","close","audio","captions","advanced_captions_settings","share_title","link_options","_base","_base2","EngineConnector","_BaseComponent","Event","TrackType","_isMobile","Shell","orientation","navigator","userAgent","animation","togglePlayPause","PlayPauseControl","controlButtonClass","_timeFormat","virtualProgress","virtualTime","isDraggingActive","SeekBarControl","onSeekbarMouseDown","updateSeekBarProgress","onSeekbarMouseUp","onSeekbarMouseMove","_playerElement","_seekBarElement","clientX","offsetLeft","clientWidth","parseFloat","toFixed","ceil","virtualProgressWidth","progressWidth","framePreviewStyle","getThumbSpriteOffset","aria-valuemin","aria-valuemax","round","aria-valuenow","aria-valuetext","onMouseMove","onMouseDown","onMouseUp","VolumeControl","_volumeControlElement","_volumeProgressBarElement","changeVolume","barHeight","clientHeight","topY","getCoords","top","clickY","clientY","el","box","getBoundingClientRect","pageYOffset","left","pageXOffset","onVolumeControlButtonClick","aria-valuemaz","onVolumeProgressBarMouseDown","onVolumeProgressBarClick","getVolumeProgessHeight","ShareControl","_smartContainer","_smartContainer2","_smartContainerItem","_smartContainerItem2","SettingsControl","smartContainerOpen","speedOptions","onControlButtonClick","qualityOptions","onQualityChange","onSpeedChange","DropDownMenu","dropMenuActive","isSelected","LanguageControl","onAudioChange","onCaptionsChange","href","FullscreenControl","webkitIsFullScreen","webkitRequestFullscreen","webkitCancelFullScreen","exitFullscreen","enterFullscreen","toggleFullscreen","TimeDisplay","total","getTimeDisplay","TopBar","BottomBar","_overlay","_overlay2","ShareOverlay","fill","placeholder","readOnly","CVAAOverlay","KeyboardControl","onkeydown","newVolume","which","disableKeyboardCommandsOnControls","preventDefault","content","locals","cssWithMappingToString","useSourceMap","cssMapping","btoa","sourceMapping","toComment","sourceRoot","sourceMap","unescape","encodeURIComponent","mediaQuery","alreadyImportedModules","addStylesToDom","styles","domStyle","stylesInDom","refs","parts","addStyle","listToStyles","newStyles","css","media","part","insertStyleElement","getElement","insertInto","lastStyleElementInsertedAtTop","stylesInsertedAtTop","insertAt","removeStyleElement","idx","createStyleElement","addAttrs","createLinkElement","link","rel","singleton","styleIndex","singletonCounter","applyToSingletonTag","URL","createObjectURL","revokeObjectURL","Blob","updateLink","applyToTag","styleSheet","replaceText","cssNode","autoFixUrls","convertToAbsoluteUrls","fixUrls","blob","oldSrc","isOldIE","fn","memo","all","atob","querySelector","newList","mayRemove","textStore","replacement","host","currentDir","pathname","fullMatch","origUrl","unquotedOrigUrl","$1","newUrl","__WEBPACK_EXTERNAL_MODULE_1__","__WEBPACK_EXTERNAL_MODULE_2__","_hls","_hls2","HlsAdapter","_addBindings","canHlsPlayType","_hlsMimeTypes","isHlsSupported","isSupported","Events","_onError","LEVEL_SWITCHED","_onLevelSwitched","AUDIO_TRACK_SWITCHED","_onAudioTrackSwitched","MANIFEST_LOADED","_playerTracks","_parseTracks","loadSource","attachMedia","_removeBindings","detachMedia","_parseAudioTracks","_parseVideoTracks","levels","_parseTextTracks","hlsAudioTracks","lang","hlsVideoTracks","startLevel","vidTextTracks","autoLevelEnabled","nextLevel","_disableAllTextTracks","errorType","errorDetails","details","fatal","ErrorTypes","NETWORK_ERROR","startLoad","MEDIA_ERROR","recoverMediaError","ErrorDetails","MANIFEST_LOAD_ERROR","MANIFEST_LOAD_TIMEOUT","MANIFEST_PARSING_ERROR","LEVEL_LOAD_ERROR","LEVEL_LOAD_TIMEOUT","LEVEL_SWITCH_ERROR","FRAG_LOAD_ERROR","FRAG_LOOP_LOADING_ERROR","FRAG_LOAD_TIMEOUT","FRAG_PARSING_ERROR","BUFFER_APPEND_ERROR","BUFFER_APPENDING_ERROR","require","1","_dereq_","EventEmitter","_maxListeners","isFunction","isObject","isUndefined","defaultMaxListeners","setMaxListeners","isNaN","er","newListener","warned","trace","fired","position","listenerCount","evlistener","emitter","2","URL_REGEX","FIRST_SEGMENT_REGEX","SLASH_DOT_REGEX","SLASH_DOT_DOT_REGEX","URLToolkit","buildAbsoluteURL","baseURL","relativeURL","alwaysNormalize","basePartsForNormalise","parseURL","baseParts","path","normalizePath","buildURLFromParts","relativeParts","netLoc","pathParts","exec","builtParts","query","fragment","baseURLPath","newPath","lastIndexOf","reverse","3","bundleFn","cache","resolveSources","workerSources","depPath","depKey","wkey","cacheKeys","exp","pow","wcache","skey","scache","webkitURL","mozURL","msURL","bare","workerUrl","worker","Worker","objectURL","4","hlsDefaultConfig","_abrController","_abrController2","_bufferController","_bufferController2","_capLevelController","_capLevelController2","_fpsController","_fpsController2","_xhrLoader","_xhrLoader2","_audioTrackController","_audioTrackController2","_audioStreamController","_audioStreamController2","_cues","_cues2","_timelineController","_timelineController2","_subtitleTrackController","_subtitleTrackController2","_subtitleStreamController","_subtitleStreamController2","autoStartLoad","startPosition","defaultAudioCodec","capLevelOnFPSDrop","capLevelToPlayerSize","initialLiveManifestSize","maxBufferLength","maxBufferSize","maxBufferHole","maxSeekHole","lowBufferWatchdogPeriod","highBufferWatchdogPeriod","nudgeOffset","nudgeMaxRetry","maxFragLookUpTolerance","liveSyncDurationCount","liveMaxLatencyDurationCount","Infinity","liveSyncDuration","liveMaxLatencyDuration","maxMaxBufferLength","enableWorker","enableSoftwareAES","manifestLoadingTimeOut","manifestLoadingMaxRetry","manifestLoadingRetryDelay","manifestLoadingMaxRetryTimeout","levelLoadingTimeOut","levelLoadingMaxRetry","levelLoadingRetryDelay","levelLoadingMaxRetryTimeout","fragLoadingTimeOut","fragLoadingMaxRetry","fragLoadingRetryDelay","fragLoadingMaxRetryTimeout","fragLoadingLoopThreshold","startFragPrefetch","fpsDroppedMonitoringPeriod","fpsDroppedMonitoringThreshold","appendErrorMaxRetry","fLoader","pLoader","xhrSetup","fetchSetup","abrController","bufferController","capLevelController","fpsController","audioStreamController","audioTrackController","subtitleStreamController","subtitleTrackController","timelineController","cueHandler","enableCEA708Captions","enableWebVTT","captionsTextTrack1Label","captionsTextTrack1LanguageCode","captionsTextTrack2Label","captionsTextTrack2LanguageCode","stretchShortVideoTrack","forceKeyFrameOnDiscontinuity","abrEwmaFastLive","abrEwmaSlowLive","abrEwmaFastVoD","abrEwmaSlowVoD","abrEwmaDefaultEstimate","abrBandWidthFactor","abrBandWidthUpFactor","abrMaxWithRealBitrate","maxStarvationDelay","maxLoadingDelay","minAutoBitrate","10","14","15","16","5","50","58","6","7","8","9","_events2","_eventHandler","_eventHandler2","_bufferHelper","_bufferHelper2","_errors","_ewmaBandwidthEstimator","_ewmaBandwidthEstimator2","AbrController","_EventHandler","FRAG_LOADING","FRAG_LOADED","FRAG_BUFFERED","lastLoadedFragLevel","_nextAutoLevel","onCheck","_abandonRulesCheck","clearTimer","frag","timer","setInterval","_bwEstimator","isLive","live","ewmaFast","ewmaSlow","fragCurrent","minAutoLevel","stats","aborted","autoLevel","requestDelay","trequest","abs","loadRate","max","bw","loaded","levelBitrate","realBitrate","expectedLen","pos","fragLoadedDelay","bufferStarvationDelay","bufferInfo","end","fragLevelNextLoadedDelay","nextLoadLevel","levelNextBitrate","sample","abort","trigger","FRAG_LOAD_EMERGENCY_ABORTED","sn","loadedBytes","bytes","loadedDuration","bitrateTest","tparsed","tbuffered","tload","onFragBuffered","loadCounter","fragLoadingProcessingMs","tfirst","bwEstimate","getEstimate","bitrateTestDelay","clearInterval","currentLevel","currentFragDuration","currentBw","maxAutoLevel","maxFetchDuration","bwFactor","bwUpFactor","levelInfo","levelDetails","avgDuration","totalduration","fragments","adjustedbw","fetchDuration","forcedAutoLevel","bwEstimator","canEstimate","nextABRAutoLevel","_nextABRAutoLevel","avgbw","bestLevel","_findBestLevel","33","34","35","37","51","53","_binarySearch","_binarySearch2","_demuxer","_demuxer2","_levelHelper","_levelHelper2","_timeRanges","_timeRanges2","STOPPED","STARTING","KEY_LOADING","FRAG_LOADING_WAITING_RETRY","WAITING_TRACK","PARSING","PARSED","BUFFER_FLUSHING","WAITING_INIT_PTS","AudioStreamController","MEDIA_ATTACHED","MEDIA_DETACHING","AUDIO_TRACKS_UPDATED","AUDIO_TRACK_SWITCHING","AUDIO_TRACK_LOADED","KEY_LOADED","FRAG_PARSING_INIT_SEGMENT","FRAG_PARSING_DATA","FRAG_PARSED","BUFFER_CREATED","BUFFER_APPENDED","BUFFER_FLUSHED","INIT_PTS_FOUND","audioCodecSwap","ticks","ontick","tick","initPTS","waitingFragment","stopLoad","demuxerId","cc","onFragLoaded","lastCurrentTime","fragLoadError","nextLoadPosition","fragPrevious","demuxer","doTick","trackDetails","loadedmetadata","startFragRequested","mediaBuffer","bufferLen","bufferEnd","maxBufLen","audioSwitch","trackId","endSN","BUFFER_EOS","fragLen","PTSKnown","nextStart","initSegment","loadIdx","fragLoadIdx","nextBuffered","foundFrag","fragNext","fragmentWithinToleranceTest","candidate","candidateLookupTolerance","search","startSN","decryptdata","uri","maxThreshold","retryDate","isSeeking","onvseeking","onMediaSeeking","onvended","onMediaEnded","onvseeked","altAudio","newDetails","sliding","curDetails","mergeDetails","startTimeOffset","fragLoaded","audioCodec","appended","initSegmentData","pendingBuffering","fragNew","video","levelCodec","BUFFER_CODECS","container","codec","appendObj","pendingData","BUFFER_APPENDING","endPTS","startPTS","endDTS","startDTS","nb","updateFragPTSDTS","appendOnBufferFlush","startOffset","endOffset","POSITIVE_INFINITY","data1","data2","buffer","_checkAppendedParsed","pending","loadError","delay","AUDIO_TRACK_LOAD_ERROR","AUDIO_TRACK_LOAD_TIMEOUT","KEY_LOAD_ERROR","KEY_LOAD_TIMEOUT","BUFFER_FULL_ERROR","isBuffered","25","38","48","54","AudioTrackController","MANIFEST_LOADING","updateTrack","defaultFound","targetduration","newId","eventObj","AUDIO_TRACK_SWITCH","AUDIO_TRACK_LOADING","audioTrackId","setAudioTrackInternal","BufferController","MEDIA_ATTACHING","MANIFEST_PARSED","BUFFER_RESET","LEVEL_PTS_UPDATED","LEVEL_UPDATED","_msDuration","_levelDuration","onsbue","onSBUpdateEnd","onsbe","onSBUpdateError","pendingTracks","audioBuffer","sourceBuffer","timestampOffset","updating","audioTimestampOffset","audioExpected","videoExpected","sourceBufferNb","ms","onmso","onMediaSourceOpen","onmse","onMediaSourceEnded","onmsc","onMediaSourceClose","endOfStream","flushRange","segments","MEDIA_DETACHED","checkPendingTracks","pendingTracksNb","createSourceBuffers","doAppending","_needsFlush","doFlush","_needsEos","checkEos","appending","counter","segment","updateMediaElementDuration","sb","removeSourceBuffer","trackName","addSourceBuffer","BUFFER_ADD_CODEC_ERROR","dataType","sbobj","flushBufferCounter","levelDuration","range","flushBuffer","shift","appendBuffer","appendError","typeIn","bufStart","bufEnd","flushStart","flushEnd","CapLevelController","FPS_DROP_LEVEL_CAPPING","restrictedLevels","autoLevelCapping","isLevelRestricted","droppedLevel","HTMLVideoElement","firstLevel","getMaxLevel","detectPlayerSize","levelsLength","streamController","nextLevelSwitch","capLevelIndex","mWidth","mediaWidth","mHeight","mediaHeight","lWidth","lHeight","pixelRatio","devicePixelRatio","offsetWidth","contentScaleFactor","offsetHeight","FPSController","isVideoPlaybackQualityAvailable","getVideoPlaybackQuality","checkFPSInterval","decodedFrames","droppedFrames","lastTime","currentPeriod","currentDropped","lastDroppedFrames","currentDecoded","lastDecodedFrames","droppedFPS","FPS_DROP","totalDroppedFrames","videoPlaybackQuality","checkFPS","totalVideoFrames","droppedVideoFrames","webkitDecodedFrameCount","webkitDroppedFrameCount","11","ID3TrackController","FRAG_PARSING_METADATA","id3Track","addTextTrack","samples","startTime","Cue","WebKitDataCue","VTTCue","TextTrackCue","id3Frame","parseID3Frame","frame","decodeID3Frame","cue","addCue","fromCharCode","subarray","decodeTxxxFrame","decodePrivFrame","decodeTextFrame","size","utf8ArrayToStr","owner","char2","char3","12","LevelController","LEVEL_LOADED","_manualLevel","canload","_levels","bitrateStart","levels0","bitrateSet","videoCodecFound","audioCodecFound","brokenmp4inmp3","checkSupported","isTypeSupported","videoCodec","redundantLevelId","urlId","sort","_firstLevel","MANIFEST_INCOMPATIBLE_CODECS_ERROR","reason","_level","levelProperties","LEVEL_SWITCH","LEVEL_SWITCHING","LEVEL_LOADING","OTHER_ERROR","levelId","levelError","REMUX_ALLOC_ERROR","nbRedundantLevel","nextAutoLevel","mediaBuffered","retryDelay","levelRetry","curLevel","reloadInterval","averagetargetduration","setLevelInternal","_startLevel","configStartLevel","13","WAITING_LEVEL","StreamController","forceStartLoad","_doTickIdle","_checkBuffer","_checkFragmentChanged","levelLastLoaded","_fetchPayloadOrEos","_ensureFragmentAtLivePoint","_findFragment","_loadFragmentOrKey","maxLatency","liveSyncPosition","computeLivePosition","targetSN","curSNIdx","sameLevel","prevFrag","nextFrag","backtracked","deltaPTS","dropped","_bufferedFrags","getBufferedFrag","fragPlayingCurrent","fragPlaying","FRAG_CHANGED","fragPlayingLevel","immediateSwitch","previouslyPaused","flushMainBuffer","fetchdelay","nextBufferedFrag","nextLevelId","fragLastKbps","followingBufferedFrag","flushScope","onMediaSeeked","tolerance","fragStartOffset","fragEndOffset","stalled","aac","heaac","audioCodecSwitch","startLevelLoaded","newLevelId","lastAudioCodec","mediaSeeking","accurateTimeOffset","ua","channelCount","drift","videoBuffer","mediaTrack","alternate","bufferedFrags","_reduceMaxBufferLength","minLength","startPositionBuffered","immediateLevelSwitchEnd","expectedPlaying","playheadMoving","stallReported","nudgeRetry","tnow","stalledDuration","BUFFER_STALLED_ERROR","nextBufferStart","delta","BUFFER_SEEK_OVER_HOLE","hole","_currentTime","targetTime","BUFFER_NUDGE_ON_STALL","targetLatency","STREAM_STATE_TRANSITION","_liveSyncPosition","SubtitleStreamController","SUBTITLE_TRACKS_UPDATED","SUBTITLE_TRACK_SWITCH","SUBTITLE_TRACK_LOADED","SUBTITLE_FRAG_PROCESSED","vttFragSNsProcessed","vttFragQueues","currentlyProcessing","currentTrackId","subtitleTracks","clearVttFragQueues","processedFragSNs","fragQueue","currentFragSN","alreadyProcessed","alreadyInQueue","fragInQueue","filterSubtitleTracks","textTrackList","SubtitleTrackController","subtitleTrack","subtitles","SUBTITLE_TRACK_LOADING","onTick","subtitleTrackId","setSubtitleTrackInternal","clearCurrentCues","cues","removeCue","reuseVttTextTrack","inUseTrack","manifestTrack","textTrack1","textTrack2","intersection","x1","x2","y1","y2","_cea608Parser","_cea608Parser2","_webvttParser","_webvttParser2","TimelineController","FRAG_PARSING_USERDATA","Cues","unparsedVttFrags","cueRanges","sendAddTrackEvent","createEvent","initEvent","channel1","newCue","screen","existingTrack1","getExistingTrack","createTextTrack","addCues","channel2","existingTrack2","cea608Parser","channel","ranges","merged","cueRange","overlap","channelNumber","propName","lastSn","prevCC","vttCCs","ccOffset","presentationOffset","inUseTracks","closedCaptions","reset","byteLength","new","currentTrack","getCueById","ccdatas","extractCea608Data","addData","pts","byteArray","tmpByte","ccbyte1","ccbyte2","ccValid","ccType","count","actualCCBytes","49","57","17","AESCrypto","subtle","iv","aesIV","decrypt","18","AESDecryptor","rcon","subMix","Uint32Array","invSubMix","sBox","invSBox","initTable","arrayBuffer","view","DataView","newArray","getUint32","subMix0","subMix1","subMix2","subMix3","invSubMix0","invSubMix1","invSubMix2","invSubMix3","xi","sx","x4","x8","keyBuffer","uint8ArrayToUint32Array_","sameKey","offset","keySize","ksRows","ksRow","invKsRow","keySchedule","invKeySchedule","sbox","prev","word","inputArrayBuffer","nRounds","invSBOX","initVector","initVector0","initVector1","initVector2","initVector3","inputInt32","Int32Array","outputInt32","t0","t1","t2","t3","s0","s1","s2","s3","inputWords0","inputWords1","inputWords2","inputWords3","swapWord","networkToHostOrderSwap","19","_aesCrypto","_aesCrypto2","_fastAesKey","_fastAesKey2","_aesDecryptor","_aesDecryptor2","Decrypter","logEnabled","browserCrypto","crypto","webkitSubtle","disableWebCrypto","decryptor","expandKey","fastAesKey","aesKey","onWebCryptoError","FRAG_DECRYPT_ERROR","20","FastAESKey","importKey","21","_adts","_adts2","_id2","AACDemuxer","remuxer","sequenceNumber","isAAC","manifestCodec","inputTimeScale","timeOffset","contiguous","frameLength","frameDuration","frameIndex","headerLength","stamp","aacSample","id3","samplerate","getAudioConfig","unit","dts","remux","hasTimeStamp","22","27","ADTS","adtsObjectType","adtsSampleingIndex","adtsExtensionSampleingIndex","adtsChanelConfig","adtsSampleingRates","23","_decrypter","_decrypter2","_aacdemuxer","_aacdemuxer2","_mp4demuxer","_mp4demuxer2","_tsdemuxer","_tsdemuxer2","_mp3demuxer","_mp3demuxer2","_mp4Remuxer","_mp4Remuxer2","_passthroughRemuxer","_passthroughRemuxer2","DemuxerInline","typeSupported","vendor","discontinuity","trackSwitch","defaultInitPTS","decrypter","localthis","decryptedData","FRAG_DECRYPTED","tstart","tdecrypt","pushDecrypted","Uint8Array","probe","muxConfig","demux","mux","_remuxer","resetInitSegment","resetTimeStamp","setDecryptData","append","28","29","32","45","46","24","_demuxerInline","_demuxerInline2","_events3","_events4","DemuxerWorker","_len2","_key2","forwardMessage","ev","postMessage","cmd","enableLogs","transferable","_demuxerWorker","_demuxerWorker2","Demuxer","mpeg","w","work","onwmsg","onWorkerMessage","onerror","INTERNAL_EXCEPTION","filename","lineno","terminate","lastFrag","nextSN","26","ExpGolomb","bytesAvailable","bitsAvailable","workingBytes","availableBytes","skipBytes","loadWord","bits","valu","readBits","leadingZeroCount","skipLZ","skipBits","clz","readUEG","deltaScale","lastScale","nextScale","readEG","profileIdc","numRefFramesInPicOrderCntCycle","picWidthInMbsMinus1","picHeightInMapUnitsMinus1","frameMbsOnlyFlag","scalingListCount","frameCropLeftOffset","frameCropRightOffset","frameCropTopOffset","frameCropBottomOffset","readUByte","readBoolean","skipEG","skipUEG","skipScalingList","chromaFormatIdc","picOrderCntType","ID3","_hasTimeStamp","_length","byte1","byte2","byte3","byte4","tagSize","endPos","header","readUTF","_parseID3Frames","_payload","tagId","timestamp","pts33Bit","_timeStamp","_mpegaudio","_mpegaudio2","MP3Demuxer","afterID3","30","MP4Demuxer","initData","parseInitSegment","bin2str","subresults","readUint32","findBox","trak","tkhd","mdhd","timescale","hdlrType","soun","vide","trafs","baseTimes","traf","tfhd","scale","baseTime","tfdt","isFinite","MpegAudio","onFrame","bitRate","sampleRate","onNoise","parseFrames","BitratesMap","SamplingRateMap","headerB","headerC","headerE","headerF","headerG","columnInBitrates","columnInSampleRates","padding","parsed","31","SampleAesDecrypter","discardEPB","encryptedData","sampleIndex","sync","curUnit","encryptedBuffer","byteOffset","decryptBuffer","decryptAacSamples","isSync","decryptAacSample","decodedData","encryptedDataLen","Int8Array","outputPos","inputPos","unitIndex","getAvcEncryptedData","getAvcDecryptedUnit","decryptAvcSamples","curUnits","units","decryptAvcSample","_expGolomb","_expGolomb2","_sampleAes","_sampleAes2","TSDemuxer","sampleAes","pmtParsed","_pmtId","_avcTrack","_id3Track","_txtTrack","aacOverFlow","aacLastPTS","avcSample","stt","pid","pes","unknownPIDs","avcTrack","avcId","audioId","id3Id","pmtId","avcData","pesData","audioData","id3Data","parsePAT","_parsePAT","parsePMT","_parsePMT","parsePES","_parsePES","parseAVCPES","_parseAVCPES","parseAACPES","_parseAACPES","parseMPEGPES","_parseMPEGPES","parseID3PES","_parseID3PES","parsedPIDs","avc","decryptAndRemux","decryptAndRemuxAvc","_initPTS","_initDTS","mpegSupported","isSampleAes","sectionLength","tableEnd","programInfoLength","stream","pesFlags","pesLen","pesHdrLen","pesPts","pesDts","payloadStartOffset","newData","dataLen","nbSamples","sps","last","expGolombDecoder","_parseAVCNALu","sliceType","readSliceType","_createAVCSample","payloadType","payloadSize","endOfCaptions","readUShort","readUInt","firstByte","secondByte","totalCCs","_insertSampleInOrder","readSPS","codecarray","codecstring","pps","pushAccesUnit","lastUnit","overflow","unitType","lastUnitType","naluState","lastState","lastUnitStart","_getLastNalUnit","tmp","_lastUnit","_tmp","newLength","EPBPositions","sourceIndex","newPTS","MUX_ERROR","WEBVTT_EXCEPTION","EventHandler","onEvent","events","handledEvents","useGenericHandler","registerListeners","unregisterListeners","isEventHandler","onEventGeneric","eventToFunction","funcName","FRAG_LOAD_PROGRESS","DESTROYING","36","AAC","BufferHelper","maxHoleDuration","vbuffered","bufferedInfo","bufferStart","bufferStartNext","buffered2","buf2len","buf2end","LevelHelper","oldDetails","PTSFrag","oldfragments","newfragments","oldFrag","newFrag","fragIdx","updatePTS","fromIdx","toIdx","fragFrom","fragTo","fragToPTS","39","_urlToolkit","_urlToolkit2","_playlistLoader","_playlistLoader2","_fragmentLoader","_fragmentLoader2","_keyLoader","_keyLoader2","_streamController","_streamController2","_levelController","_levelController2","_id3TrackController","_id3TrackController2","Hls","DefaultConfig","prop","_autoLevelCapping","playListLoader","fragmentLoader","keyLoader","id3TrackController","levelController","networkControllers","Controller","coreComponents","WebKitMediaSource","SourceBuffer","WebKitSourceBuffer","sourceBufferValidAPI","controller","swapAudioCodec","loadLevel","immediateLevelSwitch","manualLevel","41","42","43","40","FragmentLoader","loaders","loaderName","loaderContext","loaderConfig","loaderCallbacks","responseType","progressData","byteRangeStartOffset","byteRangeEndOffset","rangeStart","rangeEnd","maxRetry","maxRetryDelay","onSuccess","loadsuccess","onError","loaderror","onTimeout","loadtimeout","onProgress","loadprogress","KeyLoader","decryptkey","decrypturl","_attrList","_attrList2","MASTER_PLAYLIST_REGEX","MASTER_PLAYLIST_MEDIA_REGEX","LEVEL_PLAYLIST_REGEX_FAST","LEVEL_PLAYLIST_REGEX_SLOW","LevelKey","_uri","reluri","baseuri","Fragment","_url","_byteRange","_decryptdata","tagList","segmentNumber","uint8View","levelkey","createInitializationVector","relurl","baseurl","_programDateTime","rawProgramDateTime","byteRange","rawByteRange","lastByteRangeEndOffset","fragmentDecryptdataFromLevelkey","PlaylistLoader","retry","lastIndex","resolution","decimalResolution","decimalInteger","NAME","codecs","CODECS","avc1toavcoti","medias","groupId","DEFAULT","autoselect","AUTOSELECT","forced","FORCED","URI","LANGUAGE","avcdata","substr","currentSN","value1","value2","toUpperCase","decryptparams","keyAttrs","decryptmethod","enumeratedString","decrypturi","decryptiv","hexadecimalInteger","startParams","startAttrs","decimalFloatingPoint","mapAttrs","BYTERANGE","isLevel","parseLevelPlaylist","parseMasterPlaylist","parseMasterPlaylistMedia","embeddedAudioFound","47","44","UINT32_MAX","MP4","avc1","avcC","btrt","dinf","dref","esds","ftyp","mdat","mdia","mfhd","minf","moof","moov","mp4a",".mp3","mvex","mvhd","pasp","sdtp","stbl","stco","stsc","stsd","stsz","stts","trun","trex","vmhd","smhd","charCodeAt","videoHdlr","audioHdlr","HDLR_TYPES","STTS","STSC","STCO","STSZ","VMHD","SMHD","STSD","majorBrand","avc1Brand","minorVersion","FTYP","DINF","upperWordDuration","lowerWordDuration","baseMediaDecodeTime","boxes","flags","dependsOn","isDependedOn","hasRedundancy","avcc","hSpacing","vSpacing","configlen","sampleDependencyTable","upperWordBaseMediaDecodeTime","lowerWordBaseMediaDecodeTime","cts","arraylen","isLeading","paddingValue","isNonSync","degradPrio","init","movie","_aac","_aac2","_mp4Generator","_mp4Generator2","MP4Remuxer","isSafari","ISGenerated","defaultTimeStamp","generateIS","remuxAudio","audioTrackLength","remuxVideo","videoData","remuxEmptyAudio","remuxID3","remuxText","initDTS","audioSamples","videoSamples","computePTSDTS","mp4SampleDuration","firstPTS","firstDTS","lastPTS","lastDTS","timeScale","inputSamples","outputSamples","ptsNormalize","_PTSNormalize","nextAvcDts","deltadts","deltapts","PTSDTSshift","curr","nbNalu","naluLen","_sample","nbUnits","sampleLen","mdatSize","setUint32","_i2","avcSampleUnits","mp4SampleLength","compositionTimeOffset","_j","_nbUnits","unitData","unitDataLen","lastFrameDuration","gapTolerance","deltaToFrameEnd","nextAudioPts","mp4Sample","fillFrame","mp4timeScale","scaleFactor","inputSampleDuration","rawMPEG","nextPts","missing","newStamp","getSilentFrame","_j2","_nbSamples","audioSample","_pts","_delta","numMissingFrames","_i3","unitLen","lastSampleDuration","silentFrame","reference","PassThroughRemuxer","rawData","streamType","DECIMAL_RESOLUTION_REGEX","ATTR_LIST_REGEX","AttrList","parseAttrList","attrName","intValue","MAX_SAFE_INTEGER","stringValue","res","BinarySearch","comparisonFunction","minIndex","maxIndex","currentIndex","currentElement","comparisonResult","specialCea608CharsCodes","92","94","95","96","123","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","WARNING","verboseLevel","setTime","newTime","severity","msg","minLevel","numArrayToHexArray","numArray","hexArray","PenState","foreground","underline","italics","background","flash","attribs","newPenState","StyledUnicodeChar","uchar","penState","copy","equals","newChar","isDefault","Row","chars","currPenState","equal","empty","isEmpty","absPos","relPos","newPos","setPenState","setCursor","moveCursor","setChar","backSpace","char","startPos","clearFromPos","setStyles","CaptionScreen","rows","currRow","nrRollUpRows","clearToEndOfRow","insertChar","setPenStyles","pacData","newRow","row","topRowIndex","lastOutputScreen","prevLineTime","cueStartTime","indent","prevPos","color","setPen","bkgData","nrRows","getDisplayText","topRow","asOneRow","displayText","text","rowNr","rowText","getTextString","Cea608Channel","outputFilter","chNr","verbose","displayedMemory","nonDisplayedMemory","currRollUpRow","writeScreen","lastCueEndTime","newHandler","setPAC","setBkgData","newMode","outputDataUpdate","setMode","setRollUpRows","rollUp","nrCols","colorIndex","colors","updateData","Cea608Parser","field","out1","out2","outputs","channels","currChNr","lastCmdA","lastCmdB","bufferedData","dataCounters","getHandler","byteList","cmdFound","charsFound","parseCmd","parseMidrow","parsePAC","parseBackgroundAttributes","parseChars","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","_vttparser","captionScreen","indenting","fixLineBreaks","line","align","56","_ewma","_ewma2","EwmaBandWidthEstimator","slow","fast","defaultEstimate","defaultEstimate_","minWeight_","minDelayMs_","slow_","fast_","durationMs","numBytes","weight","getTotalWeight","52","EWMA","halfLife","alpha_","estimate_","totalWeight_","adjAlpha","zeroFactor","formatMsg","consolePrintFn","exportLoggerFunctions","debugConfig","functions","exportedLogger","fakeLogger","TimeRanges","55","findDirectionSetting","directionSetting","findAlignSetting","alignSetting","cobj","isIE8","baseObj","hasBeenReset","_pauseOnExit","_startTime","_endTime","_text","_region","_vertical","_snapToLines","_line","_lineAlign","_position","_positionAlign","_size","_align","setting","SyntaxError","autoKeyword","displayState","","lr","rl","middle","right","getCueAsHTML","WebVTT","convertCueToDOMTree","VTTParser","decoder","StringDecoder","regionList","parseTimeStamp","computeSeconds","Settings","parseOptions","keyValueDelim","groupDelim","groups","kv","k","parseCue","consumeTimeStamp","ts","oInput","skipWhitespace","region","alt","vals","vals0","integer","percent","center","vertical","defaults","lineAlign","snapToLines","_vttcue","_vttcue2","decode","decodeURIComponent","dflt","defaultKey","collectNextLine","alreadyCollectedLine","hasSubstring","oncue","flush","onflush","_vttparser2","startsWith","inputString","cueString2millis","timeString","secs","mins","hash","calculateOffset","presentationTime","currCC","WebVTTParser","vttByteArray","syncPTS","callBack","errorCallBack","re","vttLines","cueTime","mpegTs","localTime","parsingError","inHeader","parser","cueOffset","escape","onparsingerror","XhrLoader","requestTimeout","retryTimeout","callbacks","loadInternal","xhr","XDomainRequest","readystatechange","onprogress","responseURL","statusText","lengthComputable","_shakaPlayer","_shakaPlayer2","DashAdapter","_shaka","_dashMimeType","polyfill","installAll","isBrowserSupported","_onAdaptation","variantTracks","getVariantTracks","activeVariantTrack","variantTrack","videoId","_getVideoTracks","_getAudioTracks","getTextTracks","abr","selectVariantTrack","selectAudioLanguage","selectTextLanguage","goog.exportSymbol","publicPath","cur","goog.global","execScript","goog.inherits","ba","childCtor","tempCtor","shaka.util.FakeEventTarget","parentCtor","superClass_","childCtor.base","me","var_args","shaka.abr.Ewma","ca","shaka.abr.Ewma.prototype.sample","da","newEstimate","shaka.abr.Ewma.prototype.getEstimate","ea","shaka.abr.EwmaBandwidthEstimator","fa","bytesSampled_","shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE","shaka.log.error","ga","shaka.util.Error","category","goog.Uri","ia","opt_uri","setScheme","scheme_","setUserInfo","userInfo_","setDomain","domain_","setPort","port_","setPath","path_","setQueryData","clone","queryData_","setFragment","fragment_","goog.uri.utils.splitRe_","SCHEME","goog.Uri.decodeOrEmpty_","USER_INFO","DOMAIN","PORT","PATH","QUERY_DATA","FRAGMENT","goog.Uri.QueryData","goog.Uri.prototype.setScheme","ja","newScheme","opt_decode","goog.Uri.prototype.setPort","ka","newPort","goog.Uri.prototype.setQueryData","la","queryData","goog.Uri.encodeSpecialChars_","goog.Uri.reDisallowedInQuery_","na","opt_preserveReserved","decodeURI","qa","unescapedPart","extra","opt_removeDoubleEncoding","encoded","encodeURI","goog.Uri.encodeChar_","wa","ch","oa","opt_query","encodedQuery_","goog.Uri.QueryData.prototype.clone","ma","rv","keyMap_","cloneMap","count_","shaka.util.Functional.createFallbackPromiseChain","xa","promise","elem","shaka.util.Functional.collapseArrays","shaka.util.Functional.noop","shaka.util.Functional.isNotNull","ya","shaka.util.Functional.isNotEqualFunc","za","compare","shaka.util.Functional.isNotDuplicate","Aa","shaka.util.ManifestParserUtils.resolveUris","z","baseUris","relativeUris","relativeAsGoog","shaka.util.ManifestParserUtils.createDrmInfo","Ba","keySystem","licenseServerUri","distinctiveIdentifierRequired","persistentStateRequired","audioRobustness","videoRobustness","serverCertificate","keyIds","shaka.util.ConfigUtils.mergeConfigObjects","Ca","destination","overrides","ignoreKeys","subPath","subTemplate","copyObject",".abr.manager","shaka.util.ConfigUtils.cloneObject","Da","shaka.util.PublicPromise","A","resolvePromise","rejectPromise","shaka.net.NetworkingEngine","B","opt_onSegmentDownloaded","destroyed_","requests_","requestFilters_","responseFilters_","onSegmentDownloaded_","shaka.net.NetworkingEngine.defaultRetryParameters","Fa","maxAttempts","baseDelay","backoffFactor","fuzzFactor","shaka.net.NetworkingEngine.makeRequest","C","uris","retryParams","allowCrossSiteCredentials","retryParameters","shaka.util.ArrayUtils.removeDuplicates","Ga","opt_compareFn","matchFound","shaka.util.ArrayUtils.indexOf","Ha","compareFn","shaka.util.MultiMap","Ia","map_","shaka.util.EventManager","D","bindingMap_","shaka.util.EventManager.prototype.listen","E","shaka.util.EventManager.Binding_","shaka.util.EventManager.prototype.listenOnce","La","shaka.util.EventManager.prototype.removeAll","Ja","Ka","shaka.util.MapUtils.empty","Ma","shaka.util.MapUtils.values","Na","shaka.util.MapUtils.map","Oa","shaka.util.MapUtils.every","Pa","every","shaka.util.MapUtils.forEach","Qa","shaka.util.StringUtils.fromUTF8","F","uint8","escaped","shaka.util.StringUtils.fromCharCode_","shaka.util.Error.Severity.CRITICAL","shaka.util.Error.Category.TEXT","shaka.util.Error.Code.BAD_ENCODING","Sa","littleEndian","opt_noThrow","ArrayBuffer","temp","Uint16Array","dataView","getUint16","Ta","shaka.util.StringUtils.fromUTF16","isAscii","shaka.util.Error.Code.UNABLE_TO_DETECT_ENCODING","Ua","str","utf8","Ra","shaka.util.Timer","Va","id_","callback_","shaka.util.Timer.prototype.schedule","Wa","cancel","shaka.util.Uint8ArrayUtils.toBase64","Xa","opt_padding","base64","shaka.util.Uint8ArrayUtils.fromBase64","Ya","Za","shaka.util.Uint8ArrayUtils.toHex","$a","hex","shaka.util.Uint8ArrayUtils.equal","ab","arr1","shaka.media.DrmEngine","bb","networkingEngine","onKeyStatus","onExpirationUpdated","video_","mediaKeys_","supportedTypes_","initialized_","currentDrmInfo_","eventManager_","activeSessions_","offlineSessionIds_","allSessionsLoaded_","networkingEngine_","config_","onError_","keyStatusByKeyId_","onKeyStatus_","onExpirationUpdated_","keyStatusTimer_","processKeyStatusChanges_","isOffline_","mediaKeyMessageEvents_","initialRequestsSent_","expirationInterval_","pollExpiration_","eb","shaka.media.DrmEngine.prototype.attach","listenOnce","shaka.util.Error.Category.DRM","shaka.util.Error.Code.ENCRYPTED_CONTENT_WITHOUT_DRM_INFO","onPlay_","setMediaKeys","shaka.util.Error.Code.FAILED_TO_ATTACH_TO_VIDEO","setServerCertificate","shaka.util.Error.Code.INVALID_SERVER_CERTIFICATE","fb","createOrLoad","onEncrypted_","shaka.media.DrmEngine.prototype.removeSessions","gb","sessions","loadOfflineSession_","updatePromise","shaka.media.DrmEngine.prototype.createOrLoad","initDatas","initDataOverride","createTemporarySession_","initDataType","shaka.media.DrmEngine.prototype.getSessionIds","jb","cb","shaka.media.DrmEngine.prototype.prepareMediaKeyConfigs_","manifest","offline","configsByKeySystem","keySystemsInOrder","clearKeyDrmInfo","configureClearKey_","periods","period","variants","variant","drmInfos","drmInfo","fillInDrmInfoDefaults_","cast","__platform__","audioCapabilities","videoCapabilities","distinctiveIdentifier","persistentState","sessionTypes","streams","capabilities","robustness","fullMimeType","contentType","shaka.media.DrmEngine.prototype.queryMediaKeys_","db","shaka.util.Error.Code.NO_RECOGNIZED_KEY_SYSTEMS","instigator","shouldHaveLicenseServer","requestMediaKeySystemAccess","shaka.util.Error.Code.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE","mediaKeySystemAccess","isEdge","realConfig","getConfiguration","originalConfig","createCurrentDrmInfo_","createMediaKeys","shaka.util.Error.Code.NO_LICENSE_SERVER_GIVEN","mediaKeys","shaka.util.Error.Code.FAILED_TO_CREATE_CDM","shaka.media.DrmEngine.prototype.fillInDrmInfoDefaults_","lb","server","servers","advanced","shaka.media.DrmEngine.prototype.configureClearKey_","kb","clearKeys","keyIdHex","keyHex","keyId","shaka.util.Uint8ArrayUtils.fromHex","keyObj","kty","kid","initDataStr","kids","shaka.util.StringUtils.toUTF8","shaka.media.DrmEngine.prototype.createCurrentDrmInfo_","mb","licenseServers","serverCerts","processDrmInfos_","shaka.media.DrmEngine.prototype.processDrmInfos_","initDataOverrideEqual","hb","shaka.media.DrmEngine.prototype.loadOfflineSession_","createSession","shaka.util.Error.Code.FAILED_TO_CREATE_SESSION","onSessionMessage_","onKeyStatusesChange_","activeSession","oldExpiration","present","shaka.util.Error.Code.OFFLINE_SESSION_REMOVED","shaka.media.DrmEngine.prototype.createTemporarySession_","ib","generateRequest","shaka.util.Error.Code.FAILED_TO_GENERATE_LICENSE_REQUEST","ob","shaka.media.DrmEngine.prototype.sendLicenseRequest_","unpackPlayReadyRequest_","shaka.net.NetworkingEngine.RequestType.LICENSE","shakaErr","shaka.util.Error.Code.LICENSE_REQUEST_FAILED","shaka.util.Error.Code.LICENSE_RESPONSE_REJECTED","shaka.media.DrmEngine.prototype.unpackPlayReadyRequest_","pb","textContent","qb","tests","basicVideoCapabilities","configs","support","testKeySystems","access","shaka.media.DrmEngine.prototype.isSupportedByKeySystem","rb","shaka.media.DrmEngine.getCommonDrmInfos","drms1","drms2","commonDrms","drm1","drm2","shaka.media.TextEngine","tb","parser_","track_","timestampOffset_","appendWindowEnd_","bufferEnd_","bufferStart_","shaka.media.TextEngine.registerParser","vb","shaka.media.TextEngine.parserMap_","shaka.media.TextEngine.TextParserWrapper_.bind","shaka.media.TextEngine.makeCue","xb","zb","shaka.media.TextEngine.prototype.appendBuffer","parseInit","parseMedia","periodStart","segmentStart","segmentEnd","shaka.media.TextEngine.prototype.removeWhere_","yb","predicate","removeMe","shaka.media.TextEngine.TextParserWrapper_","wb","shaka.media.TimeRangesUtils.bufferEnd","Ab","shaka.media.TimeRangesUtils.isBuffered","Bb","shaka.media.TimeRangesUtils.bufferedAheadOf","Cb","shaka.media.MediaSourceEngine","Db","mediaSource_","textTrack_","sourceBuffers_","textEngine_","queues_","shaka.media.MediaSourceEngine.probeSupport","Eb","testMimeTypes","basicType","shaka.media.MediaSourceEngine.prototype.reinitText","Fb","shaka.media.MediaSourceEngine.prototype.bufferStart","Gb","Ib","shaka.media.MediaSourceEngine.prototype.getBuffered_","shaka.media.MediaSourceEngine.prototype.appendBuffer","Jb","enqueueOperation_","append_","shaka.media.MediaSourceEngine.prototype.clear","Lb","remove_","shaka.media.MediaSourceEngine.prototype.setStreamProperties","Mb","appendWindowEnd","abort_","setTimestampOffset_","setAppendWindowEnd_","Kb","shaka.media.MediaSourceEngine.prototype.enqueueOperation_","operation","shaka.util.Error.Category.MEDIA","shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR","shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW","popFromQueue_","shaka.media.MediaSourceEngine.prototype.enqueueBlockingOperation_","Nb","allWaiters","shaka.media.MediaSourceEngine.prototype.popFromQueue_","Ob","shaka.util.LanguageUtils.match","Pb","fuzz","preference","shaka.util.LanguageUtils.MatchType.BASE_LANGUAGE_OKAY","shaka.util.LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY","shaka.util.LanguageUtils.normalize","Sb","shaka.util.LanguageUtils.isoMap_","shaka.util.StreamUtils.meetsRestrictions","Ub","restrictions","maxHwRes","minWidth","maxWidth","minHeight","maxHeight","minPixels","maxPixels","minBandwidth","maxBandwidth","shaka.util.StreamUtils.applyRestrictions","Vb","tracksChanged","originalAllowed","allowedByApplication","shaka.util.StreamUtils.filterPeriod","Wb","drmEngine","activeStreams","activeVideo","activeAudio","isSupportedByKeySystem","shaka.util.StreamUtils.streamIsCompatible_","textStreams","shaka.util.StreamUtils.getFullMimeType","Xb","activeStream","drmSupportedMimeTypes","encrypted","shaka.util.StreamUtils.getVariantTracks","Zb","activeAudioId","activeVideoId","shaka.util.StreamUtils.getPlayableVariants","isActive","roles","primary","shaka.util.StreamUtils.getTextTracks","ac","activeStreamId","shaka.util.StreamUtils.findVariantForTrack","bc","shaka.util.StreamUtils.findTextStreamForTrack","$b","allowedByKeySystem","shaka.util.StreamUtils.filterVariantsByRoleAndLanguage","dc","preferredLanguage","opt_languageMatches","opt_role","chosen","primaryVariants","pref","EXACT","matchType","betterLangMatchFound","chosenWithRoles","shaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage","ec","primaryStreams","shaka.util.StreamUtils.getVariantByStreams","shaka.util.StreamUtils.getVariantByStreamIds","gc","matchesId","Yb","opt_codecs","shaka.util.StreamUtils.findPeriodContainingTime","hc","shaka.util.StreamUtils.findPeriodContainingStream","ic","periodIdx","trickModeVideo","shaka.abr.SimpleAbrManager","H","switch_","enabled_","bandwidthEstimator_","variants_","textStreams_","startupComplete_","lastTimeChosenMs_","restrictions_","shaka.abr.SimpleAbrManager.filterAndSortVariants_","jc","v1","v2","shaka.util.FakeEvent","I","opt_dict","dict","vc","thing","eventKey","simpleEvent","eventValue","__type__","shaka.cast.CastUtils.deserialize","wc","NaN","shaka.cast.CastUtils.simulateTimeRanges_","xc","shaka.cast.CastSender","yc","receiverAppId","onStatusChanged","onRemoteEvent","onResumeLocal","onInitStateRequired","receiverAppId_","onStatusChanged_","onRemoteEvent_","onResumeLocal_","onInitStateRequired_","isCasting_","hasReceivers_","apiReady_","receiverName_","session_","appData_","cachedProperties_","nextAsyncCallId_","asyncCallPromises_","castPromise_","shaka.cast.CastSender.prototype.rejectAllPromises_","zc","shaka.util.Error.Severity.RECOVERABLE","shaka.util.Error.Category.PLAYER","shaka.util.Error.Code.LOAD_INTERRUPTED","shaka.cast.CastSender.prototype.sendMessage_","Ac","serialized","shaka.cast.CastUtils.serialize","sendMessage","shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE","listeners_","shaka.cast.CastProxy","J","shaka.util.FakeEventTarget.call","localVideo_","localPlayer_","playerEventTarget_","videoEventTarget_","playerProxy_","videoProxy_","sender_","onCastStatusChanged_","getInitState_","init_","Bc","shaka.cast.CastProxy.prototype.init_","shaka.cast.CastUtils.VideoEvents.forEach","videoProxyLocalEvent_","shaka.cast.CastUtils.PlayerEvents.forEach","playerProxyLocalEvent_","videoProxyGet_","videoProxySet_","playerProxyGet_","shaka.cast.CastReceiver","K","opt_appDataCallback","opt_contentIdCallback","player_","targets_","appDataCallback_","opt_contentIdCallback_","contentId","isConnected_","isIdle_","pollTimerId_","genericBus_","shakaBus_","Cc","shaka.cast.CastReceiver.prototype.init_","manager","CastReceiverManager","getInstance","onSenderConnected","onSendersChanged_","onSenderDisconnected","onSystemVolumeChanged","fakeVolumeChangeEvent_","getCastMessageBus","shaka.cast.CastUtils.GENERIC_MESSAGE_NAMESPACE","onMessage","onGenericMessage_","onShakaMessage_","proxyEvent_","canDisplayType","setMaxHardwareResolution","shaka.cast.CastReceiver.prototype.onCastStatusChanged_","Dc","sendMediaStatus_","shaka.cast.CastReceiver.prototype.initState_","Ec","initState","appData","manifestReady","detail","playerAfterLoad","shaka.cast.CastReceiver.prototype.sendMessage_","Fc","bus","opt_senderId","getCastChannel","broadcast","shaka.cast.CastReceiver.prototype.sendMediaStatus_","requestId","opt_media","playState","shaka.cast.CastReceiver.PLAY_STATE","mediaStatus","mediaSessionId","getPlayState_","buffering_","supportedMediaCommands","sendMessage_","shaka.util.XmlUtils.findChild","Hc","shaka.util.XmlUtils.findChildren","M","tagName","shaka.util.XmlUtils.getContents","Ic","contents","Node","TEXT_NODE","shaka.util.XmlUtils.parseAttr","N","parseFunction","opt_defaultValue","parsedValue","getAttribute","shaka.util.XmlUtils.parseDate","Jc","dateString","shaka.util.XmlUtils.parseDuration","Kc","durationString","matches","shaka.util.XmlUtils.parseRange","Lc","rangeString","shaka.util.XmlUtils.parseInt","Mc","intString","shaka.util.XmlUtils.parsePositiveInt","Nc","shaka.util.XmlUtils.parseNonNegativeInt","Oc","shaka.util.XmlUtils.evalDivision","Pc","exprString","Rc","elems","ignoreDrmInfo","shaka.dash.ContentProtection.parseElements_","defaultInit","defaultKeyId","parsedNonCenc","shaka.util.Error.Category.MANIFEST","shaka.util.Error.Code.DASH_CONFLICTING_KEY_IDS","shaka.dash.ContentProtection.MP4Protection_","schemeUri","shaka.dash.ContentProtection.convertElements_","shaka.dash.ContentProtection.defaultKeySystems_","firstRepresentation","shaka.dash.ContentProtection.parseFromRepresentation","Uc","repContext","shaka.dash.ContentProtection.parseFromAdaptationSet","asUnknown","repUnencrypted","asInfo","repInfo","shaka.util.Error.Code.DASH_NO_COMMON_KEY_SYSTEM","Tc","elements","Sc","psshs","shaka.util.Error.Code.DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED","pssh","shaka.util.Error.Code.DASH_PSSH_BAD_ENCODING","shaka.dash.MpdUtils.fillUriTemplate","Vc","uriTemplate","representationId","number","valueTable","RepresentationID","Bandwidth","Time","widthString","valueString","shaka.dash.MpdUtils.parseSegmentInfo","Wc","timescaleStr","shaka.dash.MpdUtils.inheritAttribute","durationStr","segmentDuration","startNumberStr","presentationTimeOffset","startNumber","timelineNode","shaka.dash.MpdUtils.inheritChild","timeline","periodInfo","timePoints","lastEndTime","timePoint","repeat","nextStartTime","periodDuration","unscaledStart","unscaledPresentationTimeOffset","Xc","representation","adaptationSet","Yc","shaka.media.InitSegmentReference","Zc","startByte","endByte","getUris","shaka.media.SegmentReference","O","shaka.util.DataViewReader","P","endianness","dataView_","littleEndian_","shaka.util.DataViewReader.Endianness.LITTLE_ENDIAN","position_","shaka.util.DataViewReader.prototype.throwOutOfBounds_","ad","shaka.util.Error.Code.BUFFER_READ_OUT_OF_BOUNDS","shaka.util.Mp4Parser","Q","headers_","boxDefinitions_","shaka.util.Mp4Parser.children","R","reader","hasMoreData","parseNext","cd","shaka.util.Mp4Parser.allData","dd","readBytes","shaka.util.Mp4Parser.typeFromString_","bd","shaka.media.Mp4SegmentIndexParser","ed","sidxData","sidxOffset","references","fullBox","shaka.media.Mp4SegmentIndexParser.parseSIDX_","shaka.util.Error.Code.MP4_SIDX_WRONG_BOX_TYPE","fd","shaka.util.Error.Code.MP4_SIDX_INVALID_TIMESCALE","earliestPresentationTime","readUint64","firstOffset","referenceCount","readUint16","unscaledStartTime","chunk","referenceType","referenceSize","subsegmentDuration","shaka.util.Error.Code.MP4_SIDX_TYPE_NOT_SUPPORTED","shaka.media.SegmentIndex","S","references_","shaka.media.SegmentIndex.prototype.fit","gd","lastReference","shaka.util.EbmlParser","hd","reader_","BIG_ENDIAN","shaka.util.EbmlParser.DYNAMIC_SIZES","jd","shaka.util.EbmlParser.prototype.parseElement","vint","parseVint_","parseId_","shaka.util.Error.Code.EBML_OVERFLOW","shaka.util.EbmlParser.DYNAMIC_SIZES.length","shaka.util.Error.Code.JS_INTEGER_OVERFLOW","elementSize","shaka.util.EbmlElement","shaka.util.EbmlParser.prototype.parseVint_","kd","readUint8","ld","shaka.util.EbmlElement.prototype.getUint","md","getUint8","shaka.media.WebmSegmentIndexParser","nd","shaka.media.WebmSegmentIndexParser.prototype.parseCues_","od","cuesElement","segmentOffset","timecodeScale","lastOffset","parseElement","shaka.media.WebmSegmentIndexParser.CUE_POINT_ID","tuple","parseCuePoint_","unscaledTime","currentOffset","relativeOffset","shaka.media.WebmSegmentIndexParser.prototype.parseCuePoint_","pd","cuePointElement","cueTimeElement","shaka.media.WebmSegmentIndexParser.CUE_TIME_ID","shaka.util.Error.Code.WEBM_CUE_TIME_ELEMENT_MISSING","getUint","cueTrackPositionsElement","shaka.media.WebmSegmentIndexParser.CUE_TRACK_POSITIONS_ID","shaka.util.Error.Code.WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING","cueTrackParser","shaka.media.WebmSegmentIndexParser.CUE_CLUSTER_POSITION","shaka.dash.SegmentBase.createInitSegment","qd","initialization","resolvedUris","shaka.dash.SegmentBase.createStream","rd","requestInitSegment","shaka.dash.SegmentBase.fromInheritance_","containerType","shaka.util.Error.Code.DASH_UNSUPPORTED_CONTAINER","shaka.util.Error.Code.DASH_WEBM_MISSING_INIT","representationIndex","indexRangeElem","indexUris","indexRange","representationUri","shaka.util.Error.Code.DASH_NO_SEGMENT_INFO","shaka.dash.SegmentBase.createSegmentIndexFromUris","createSegmentIndex","findSegmentPosition","getSegmentReference","initSegmentReference","td","presentationTimeline","fitLast","dynamic","isLastPeriod","localRequest","segmentIndex","async","indexData","notifySegments","periodStartTime","fit","sd","segmentBase","shaka.dash.SegmentList.createStream","ud","segmentIndexMap","shaka.dash.SegmentList.fromInheritance_","mediaSegments","shaka.dash.SegmentList.parseMediaSegments_","segmentInfo","shaka.dash.SegmentList.createSegmentReferences_","evict","getSegmentAvailabilityStart","vd","segmentList","xd","prevEndTime","mediaUri","wd","urlNode","indexRangeWarningGiven","shaka.dash.SegmentTemplate.createStream","yd","shaka.dash.SegmentTemplate.createInitSegment_","shaka.dash.SegmentTemplate.fromInheritance_","mediaTemplate","indexTemplate","filledTemplate","notifyMaxSegmentDuration","segmentIndexFunctions","shaka.dash.SegmentTemplate.createFromDuration_","shaka.dash.SegmentTemplate.createFromTimeline_","Ad","segmentTemplate","Bd","periodTime","Cd","segmentReplacement","repId","segmentId","zd","shaka.media.ManifestParser.probeSupport","Fd","shaka.media.ManifestParser.parsersByMime","shaka.media.ManifestParser.parsersByExtension","shaka.media.ManifestParser.getFactory","Gd","manifestUri","netEngine","opt_manifestParserFactory","filenamePieces","headRequest","shaka.net.NetworkingEngine.RequestType.MANIFEST","shaka.util.Error.Code.UNABLE_TO_GUESS_MANIFEST_TYPE","shaka.media.PresentationTimeline","T","presentationStartTime","presentationDelay","presentationStartTime_","presentationDelay_","segmentAvailabilityDuration_","duration_","maxSegmentDuration_","clockOffset_","static_","shaka.dash.DashParser","Hd","playerInterface_","manifestUris_","manifest_","periodIds_","globalId_","segmentIndexMap_","updatePeriod_","updateTimer_","shaka.dash.DashParser.prototype.requestManifest_","Id","parseManifest_","shaka.dash.DashParser.prototype.parseManifest_","Kd","finalManifestUri","mpd","documentElement","shaka.util.Error.Code.DASH_INVALID_XML","manifestBaseUris","locations","minBufferTime","segmentAvailabilityDuration","suggestedPresentationDelay","maxSegmentDuration","mpdType","defaultPresentationDelay","shaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_","periodsAndDuration","parsePeriods_","setStatic","setDuration","setSegmentAvailabilityDuration","timingElements","parseUtcTiming_","setClockOffset","offlineSessionIds","shaka.dash.DashParser.prototype.parsePeriods_","Ld","presentationDuration","prevEnd","periodNodes","givenDuration","parsePeriod_","periodId","filterPeriod","shaka.dash.DashParser.prototype.parsePeriod_","Nd","createFrame_","parseEventStream_","adaptationSets","parseAdaptationSet_","representationIds","as","uniqueRepIds","shaka.util.Error.Code.DASH_DUPLICATE_REPRESENTATION_ID","normalAdaptationSets","trickModeFor","trickModeSet","targetId","normalSet","videoSets","getSetsOfType_","audioSets","shaka.util.Error.Code.DASH_EMPTY_PERIOD","createVariants_","textSets","shaka.dash.DashParser.prototype.getSetsOfType_","Pd","shaka.dash.DashParser.prototype.createVariants_","Qd","shaka.dash.DashParser.prototype.setUpdateTimer_","Jd","onUpdate_","shaka.dash.DashParser.MIN_UPDATE_PERIOD_","shaka.dash.DashParser.prototype.createFrame_","Od","containsEmsgBoxes","shaka.dash.DashParser.guessContentType_","shaka.dash.DashParser.prototype.verifyRepresentation_","Sd","APPLICATION","shaka.dash.DashParser.prototype.requestForTiming_","Td","requestUris","date","shaka.dash.DashParser.prototype.parseUtcTiming_","Md","schemesAndValues","clockSyncUri","sv","requestForTiming_","Rd","shaka.hls.Playlist","Ud","opt_segments","shaka.hls.Tag","Vd","opt_value","shaka.hls.Attribute","Wd","Xd","shaka.hls.Tag.prototype.getAttributeValue","defaultValue","shaka.hls.Segment","Yd","shaka.hls.Utils.filterTagsByName","Zd","shaka.hls.Utils.getFirstTagWithName","$d","tagsWithName","shaka.hls.Utils.findMediaTags","ae","typeAttr","groupIdAttr","shaka.util.TextParser","be","data_","shaka.util.TextParser.prototype.readRegex","ce","regex","indexOf_","atEnd","shaka.util.TextParser.prototype.readRegexReturnCapture_","de","readRegex","shaka.hls.ManifestTextParser","ee","shaka.hls.ManifestTextParser.prototype.parsePlaylist","fe","lines","shaka.util.Error.Code.HLS_PLAYLIST_HEADER_MISSING","playlistType","MASTER","shaka.hls.ManifestTextParser.parseTag","parseTag_","shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS.indexOf","MEDIA","shaka.hls.ManifestTextParser.SEGMENT_TAGS.indexOf","shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY","segmentsData","parseSegments_","tagUri","shaka.hls.ManifestTextParser.prototype.parseSegments_","je","ge","blocks","shaka.util.Error.Code.INVALID_HLS_TAG","blockAttrs","shaka.net.DataUriPlugin","ke","shaka.net.DataUriPlugin.parse","content-type","shaka.hls.HlsParser","le","mediaTagsToStreamInfosMap_","streamsToIndexMap_","presentationTimeline_","manifestUri_","manifestTextParser_","ne","shaka.hls.HlsParser.prototype.parseManifest_","playlist","parsePlaylist","shaka.util.Error.Code.HLS_MASTER_PLAYLIST_NOT_PROVIDED","createPeriod_","shaka.hls.HlsParser.prototype.createPeriod_","oe","variantsPromises","createVariantsForTag_","textStreamPromises","shaka.hls.HlsParser.getRequiredAttributeValue_","createTextStream_","allVariants","fitSegments_","shaka.hls.HlsParser.prototype.createVariantsForTag_","pe","getAttributeValue","defaultCodecs","resolutionAttr","resBlocks","getTimeOffset_","mediaTags","audioGroupId","videoGroupId","promises","createStreamInfoFromMediaTag_","audioStreamInfos","videoStreamInfos","createStreamInfo_","createStreamInfoFromVariantTag_","allCodecs","streamInfo","shaka.hls.HlsParser.prototype.createVariants_","ve","audioInfos","videoInfos","audioStream","videoStream","audioDrmInfos","videoDrmInfos","createVariant_","shaka.hls.HlsParser.prototype.createVariant_","xe","shaka.hls.HlsParser.prototype.createTextStream_","qe","shaka.hls.HlsParser.prototype.createStreamInfoFromMediaTag_","te","defaultAttr","autoselectAttr","shaka.hls.HlsParser.prototype.createStreamInfo_","ue","requestManifest_","createInitSegmentReference_","mediaSequenceTag","createSegments_","getDuration","guessCodecs_","SUBTITLE","drmTags","segmentKeyTags","drmTag","keyFormat","drmParser","shaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_","shaka.util.Error.Code.HLS_KEYFORMATS_NOT_SUPPORTED","guessMimeType_","shaka.hls.HlsParser.prototype.createInitSegmentReference_","ye","mapTags","shaka.util.Error.Code.HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND","mapTag","initUri","byterange","shaka.hls.HlsParser.prototype.createSegments_","ze","hlsSegments","extinfValues","getRequiredTag_","shaka.hls.HlsParser.prototype.fitSegments_","shaka.hls.HlsParser.prototype.guessCodecs_","Ae","formats","shaka.hls.HlsParser.VIDEO_CODEC_FORMATS_","shaka.hls.HlsParser.AUDIO_CODEC_FORMATS_","shaka.util.Error.Code.HLS_COULD_NOT_GUESS_CODECS","shaka.hls.HlsParser.prototype.guessMimeType_","Ce","shaka.hls.HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_","shaka.hls.HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_","shaka.net.NetworkingEngine.RequestType.SEGMENT","shaka.util.Error.Code.HLS_COULD_NOT_GUESS_MIME_TYPE","shaka.hls.HlsParser.prototype.getTimeOffset_","se","startTag","defaultTimeOffset","U","attributeName","shaka.util.Error.Code.HLS_REQUIRED_ATTRIBUTE_MISSING","shaka.hls.HlsParser.prototype.getRequiredTag_","De","shaka.util.Error.Code.HLS_REQUIRED_TAG_MISSING","shaka.media.TtmlTextParser","Ie","Ke","isSpanChildOfP","ELEMENT_NODE","leafChildren","shaka.media.TtmlTextParser.getLeafNodes_","shaka.media.TtmlTextParser.addNewLines_","Le","whitespaceTrim","trimmed","shaka.media.TtmlTextParser.getStyleAttribute_","Oe","cueElement","regionChildren","getElementFromCollection_","shaka.media.TtmlTextParser.getElementFromCollection_","Ne","collection","Element","itemName","shaka.media.TtmlTextParser.parseTime_","Me","rateInfo","shaka.media.TtmlTextParser.timeColonFormatFrames_.test","shaka.media.TtmlTextParser.timeColonFormatFrames_.exec","frames","subFrameRate","shaka.media.TtmlTextParser.timeColonFormat_.test","shaka.media.TtmlTextParser.parseTimeFromRegex_","shaka.media.TtmlTextParser.timeColonFormat_","shaka.media.TtmlTextParser.timeColonFormatMilliseconds_.test","shaka.media.TtmlTextParser.timeColonFormatMilliseconds_","shaka.media.TtmlTextParser.timeFramesFormat_.test","shaka.media.TtmlTextParser.timeFramesFormat_.exec","shaka.media.TtmlTextParser.timeTickFormat_.test","shaka.media.TtmlTextParser.timeTickFormat_.exec","tickRate","shaka.media.TtmlTextParser.timeHMSFormat_.test","shaka.media.TtmlTextParser.timeHMSFormat_","Ye","shaka.media.TtmlTextParser.RateInfo_","Je","frameRateMultiplier","multiplierResults","shaka.media.Mp4TtmlParser","Ze","shaka.media.VttTextParser","$e","bf","positionAlign","shaka.media.VttTextParser.parseTime_","af","shaka.media.Mp4VttParser","cf","timescale_","shaka.media.Mp4VttParser.parseVTTC_","df","shaka.media.Mp4VttParser.assembleCue_","ef","readRegexReturnCapture_","shaka.media.VttTextParser.parseSetting","shaka.media.Playhead","ff","onSeek","startTime_","onSeek_","onEvent_","playbackRate_","gapJumpIntervalId_","trickPlayIntervalId_","prevReadyState_","didFireLargeGap_","stallPlayheadTime_","stallWallTime_","hadSegmentAppended_","onLoadedMetadata_","pollGap","onPollGapJump_","onRateChange_","shaka.media.Playhead.prototype.setStartTime","gf","clampTime_","shaka.media.Playhead.prototype.getTime","jf","getStartTime_","shaka.media.Playhead.prototype.getStartTime_","kf","getSeekRangeEnd","shaka.media.Playhead.prototype.setPlaybackRate","rate","shaka.media.Playhead.prototype.reposition_","nf","shaka.media.TimeRangesUtils.isBuffered.bind","rebufferingGoal","getSegmentAvailabilityEnd","safe","getSafeAvailabilityStart","seekStart","seekSafe","shaka.media.Playhead.prototype.movePlayhead_","mf","tries","recheck","shaka.media.Playhead.prototype.clampTime_","hf","shaka.media.PlayheadObserver","of","onBuffering","onChangePeriod","onBuffering_","onChangePeriod_","timelineRegions_","curPeriodIndex_","watchdogTimer_","startWatchdogTimer_","shaka.media.PlayheadObserver.cloneTimelineInfo_","rf","eventElement","shaka.media.PlayheadObserver.prototype.startWatchdogTimer_","pf","cancelWatchdogTimer_","onWatchdogTimer_","shaka.media.PlayheadObserver.prototype.cancelWatchdogTimer_","qf","shaka.media.StreamingEngine","sf","playerInterface","bufferingGoalScale_","setupPeriodPromise_","canSwitchPeriod_","canSwitchStream_","mediaStates_","fatalError_","V","shaka.media.StreamingEngine.prototype.getCurrentPeriod","findPeriodContainingTime_","playhead","shaka.media.StreamingEngine.prototype.getActiveStreams","vf","restoreStreamAfterTrickPlay","shaka.media.StreamingEngine.prototype.notifyNewTextStream","wf","streamsByType","initStreams_","shaka.media.StreamingEngine.prototype.setTrickPlay","xf","normalVideo","mediaState","switch","shaka.media.StreamingEngine.prototype.switch","yf","clearBuffer","ignoreTextStreamFailures","notifyNewTextStream","periodIndex","findPeriodContainingStream_","needPeriodIndex","clearAllBuffers_","reinitText","mediaSourceEngine","canSwitchRecord","resolved","needInitSegment","clearingBuffer","waitingToFlushBuffer","performingUpdate","waitingToClearBuffer","cancelUpdate_","clearBuffer_","shaka.media.StreamingEngine.prototype.seeked","Bf","playheadTime","getBuffered_","shaka.media.StreamingEngine.prototype.clearAllBuffers_","zf","updateTimer","scheduleUpdate_","shaka.media.StreamingEngine.prototype.initStreams_","uf","opt_resumeAt","typeConfig","setDuration_","setupStreams_","lastStream","lastSegmentReference","recovering","resumeAt","shaka.media.StreamingEngine.prototype.setupPeriod_","Ff","shaka.media.StreamingEngine.prototype.setupStreams_","Ef","shaka.media.StreamingEngine.prototype.setDuration_","Df","Gf","shaka.media.StreamingEngine.prototype.update_","timeNeeded","getTimeNeeded_","currentPeriodIndex","bufferingGoal","getBufferingGoal_","bufferedAhead","getSegmentReferenceIfAvailable_","getSegmentReferenceNeeded_","fetchAndAppend_","shaka.media.StreamingEngine.prototype.getSegmentReferenceIfAvailable_","If","availabilityEnd","shaka.media.StreamingEngine.prototype.fetchAndAppend_","Jf","followingPeriod","initSourceBuffer","initSourceBuffer_","fetchSegment","fetch_","onSegmentAppended","handleStartup_","infiniteRetriesForLiveStreams","shaka.util.Error.Code.BAD_HTTP_STATUS","shaka.util.Error.Code.HTTP_ERROR","shaka.util.Error.Code.TIMEOUT","handleNetworkError_","handleQuotaExceeded_","shaka.media.StreamingEngine.prototype.handleQuotaExceeded_","Of","percentBefore","shaka.media.StreamingEngine.prototype.initSourceBuffer_","Kf","setStreamProperties","appendInit","shaka.media.StreamingEngine.prototype.append_","Mf","parseEMSG_","evict_","Pf","shaka.media.StreamingEngine.prototype.evict_","bufferBehind","shaka.media.StreamingEngine.prototype.handleStartup_","Nf","setupPeriod_","onCanSwitch","onStartupComplete","shaka.media.StreamingEngine.prototype.handlePeriodTransition_","Hf","mediaStates","shaka.media.StreamingEngine.isIdle_","needPeriod","onChooseStreams","shaka.util.Error.Category.STREAMING","shaka.util.Error.Code.INVALID_STREAMS_CHOSEN","Qf","shaka.media.StreamingEngine.prototype.fetch_","Lf","Range","shaka.media.StreamingEngine.prototype.clearBuffer_","Af","flush_","shaka.media.StreamingEngine.prototype.scheduleUpdate_","Cf","shaka.media.StreamingEngine.prototype.cancelUpdate_","tf","shaka.net.HttpPlugin","Rf","withCredentials","onload","xhr.onload","getAllResponseHeaders","fromCache","shaka.util.StringUtils.fromBytesAutoDetect","shaka.util.Error.Category.NETWORK","xhr.onerror","ontimeout","xhr.ontimeout","shaka.offline.DBEngine","Sf","db_","operations_","currentIdMap_","shaka.offline.DBEngine.prototype.insert","Wf","storeName","createTransaction_","put","Xf","shaka.offline.DBEngine.prototype.removeKeys","opt_onKeyRemoved","onsuccess","shaka.offline.DBEngine.prototype.getNextId_","Uf","openCursor","request.onsuccess","cursor","shaka.offline.DBEngine.prototype.createTransaction_","Vf","op","transaction","oncomplete","closeOperation_","onabort","shaka.offline.DBEngine.onError_","objectStore","shaka.offline.DBEngine.prototype.createConnection_","Tf","storeMap","opt_retryCount","indexedDB","shaka.offline.DBEngine.DB_NAME_","shaka.offline.DBEngine.DB_VERSION_","upgraded","createPromise","onupgradeneeded","request.onupgradeneeded","createObjectStore","keyPath","createConnection_","shaka.offline.DBEngine.onError_.bind","Yf","errorSource","shaka.util.Error.Category.STORAGE","shaka.util.Error.Code.INDEXED_DB_ERROR","shaka.util.Error.Code.OPERATION_ABORTED","shaka.offline.OfflineUtils.getStoredContent","$f","shaka.offline.OfflineUtils.reconstructPeriod","offlineUri","originalManifestUri","expiration","appMetadata","ag","textStreamsDb","streamDb","shaka.offline.OfflineUtils.createVariants_","shaka.offline.OfflineUtils.createStream_","shaka.offline.OfflineUtils.getSegmentReferences_","dg","bg","audios","videos","shaka.offline.OfflineUtils.areCompatible_","eg","stream1","stream2","variantIds","cg","initSegmentUri","shaka.offline.OfflineUtils.createStorageEngine","fg","shaka.offline.DownloadManager","gg","storageEngine","segments_","storedSegments_","storageEngine_","netEngine_","retryParams_","promise_","bandwidthBytesDownloaded_","bandwidthBytesTotal_","givenBytesDownloaded_","givenBytesTotal_","shaka.offline.DownloadManager.prototype.addSegment","hg","bandwidthSize","segmentDb","shaka.offline.DownloadManager.prototype.downloadAndStore","ig","downloadNext","downloadSegment_","insert","shaka.offline.DownloadManager.prototype.downloadSegment_","jg","byteCount","progress","updateProgress_","progressCallback","shaka.offline.OfflineManifestParser","kg","manifestId_","lg","sessionIds","shaka.offline.OfflineScheme","mg","segmentParts","shaka.offline.OfflineUtils.DB_SCHEME","shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND","shaka.util.Error.Code.STORAGE_NOT_SUPPORTED","shaka.util.Error.Code.MALFORMED_OFFLINE_URI","shaka.util.CancelableChain","ng","canceled_","complete_","final_","cancelPromise_","onCancelComplete_","shaka.util.CancelableChain.prototype.finalize","og","rejectionValue_","shaka.Player","W","opt_dependencyInjector","defaultAbrManager_","streamingEngine_","playheadObserver_","playhead_","mediaSourceOpen_","mediaSourceEngine_","drmEngine_","nextExternalStreamId_","loadingTextStreamIds_","switchingPeriods_","unloadChain_","loadChain_","deferredSwitches_","pendingTimelineRegions_","activeStreamsByPeriod_","defaultConfig_","maxHwRes_","stats_","getCleanStats_","lastTimeStatsUpdateTimestamp_","currentAudioLanguage_","preferredAudioLanguage","currentTextLanguage_","preferredTextLanguage","currentTextRole_","currentVariantRole_","createNetworkingEngine","initialize_","createMediaSource","shaka.Player.TextTrackLabel_","onVideoError_","ug","shaka.Player.prototype.chooseCodecsAndFilterManifest_","variantCodecs","variantsByCodecs","bestCodecs","lowestAverageBandwidth","sum","num","averageBandwidth","shaka.Player.prototype.createMediaSource","rg","zg","shaka.Player.prototype.applyConfig_","streaming","filterPeriod_","chooseStreamsAndSwitch_","getCurrentPeriod","enable","setDefaultEstimate","defaultBandwidthEstimate","setRestrictions","shaka.Player.prototype.addToSwitchHistory_","Cg","fromAdaptation","switchHistory","updateActiveStreams_","shaka.Player.prototype.updateActiveStreams_","Eg","shaka.Player.prototype.destroyStreaming_","sg","stop","shaka.Player.prototype.resetStreaming_","Bg","destroyStreaming_","shaka.Player.prototype.configOverrides_","yg",".drm.servers",".drm.clearKeys",".drm.advanced","shaka.Player.prototype.defaultConfig_","pg","delayLicenseRequestUntilPlayed","customScheme","startAtSegmentBoundary","smallGapLimit","jumpLargeGaps","shaka.Player.prototype.getCleanStats_","qg","streamBandwidth","estimatedBandwidth","loadLatency","playTime","bufferingTime","stateHistory","Dg","shaka.Player.prototype.deferredSwitch_","opt_clearBuffer","shaka.Player.prototype.updateTimeStats_","Gg","shaka.Player.prototype.adjustStartTime_","vg","getAdjustedTime","getActiveStreams","videoStartTime","audioStartTime","Hg","shaka.Player.prototype.chooseStreams_","opt_chooseAll","shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET","setVariants","setTextStreams","needsUpdate","anyMediaState","activeVariant","activePeriod","chooseStreams","shaka.Player.prototype.chooseStreamsAndSwitch_","Ag","languageMatches","chooseStreams_","addToSwitchHistory_","deferredSwitch_","onAdaptation_","onTextTrackVisibility_","shaka.Player.prototype.onAdaptation_","xg","shaka.Player.prototype.onTracksChanged_","wg","shaka.Player.prototype.onTextTrackVisibility_","Fg","shaka.offline.Storage","X","shaka.util.Error.Code.LOCAL_PLAYER_INSTANCE_REQUIRED","storeInProgress_","firstPeriodTracks_","downloadManager_","shaka.offline.Storage.support","Jg","Lg","shaka.offline.Storage.prototype.loadInternal","onKeyStatusChange","manifestParser","checkDestroyed_","onTimelineRegionAdded","createSegmentIndex_","shaka.offline.Storage.prototype.defaultConfig_","Ig","trackSelectionCallback","defaultTrackSelect_","storedContent","shaka.offline.Storage.prototype.initIfNeeded_","Kg","shaka.offline.Storage.prototype.cleanup_","Mg","shaka.offline.Storage.prototype.createSegmentIndex_","Ng","variantStreams","Og","shaka.offline.Storage.prototype.createStream_","estimatedStreamBandwidth","opt_variantId","segmentsDb","addSegment","manifestKey","streamNumber","shaka.offline.Storage.prototype.checkDestroyed_","Y","shaka.polyfill.register","Qg","shaka.polyfill.polyfills_.push","shaka.polyfill.Fullscreen.proxyEvent_","Rg","eventType","newEvent","shaka.util.Pssh","Sg","psshBox","systemIds","cencKeyIds","dataBoundaries","parseBox_","shaka.polyfill.PatchedMediaKeysMs.requestMediaKeySystemAccess","Tg","supportedConfigurations","shaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess","Ug","cfg","newCfg","initDataTypes","ranAnyTests","cap","MSMediaKeys","configuration_","unsupportedKeySystemError","DOMException","NOT_SUPPORTED_ERR","shaka.polyfill.PatchedMediaKeysMs.setMediaKeys","Wg","oldMediaKeys","setMedia","shaka.polyfill.PatchedMediaKeysMs.MediaKeys","Vg","nativeMediaKeys_","shaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.setMedia","Xg","setMediaKeysDeferred","msSetMediaKeys","shaka.polyfill.PatchedMediaKeysMs.onMsNeedKey_","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession","Yg","nativeMediaKeys","nativeMediaKeySession_","updatePromise_","generateRequestPromise_","closed","keyStatuses","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap","Zg","event2","initCustomEvent","unfilteredInitDatas","dedupedInitDatas","shaka.polyfill.PatchedMediaKeysMs.compareInitDatas_","targetLength","normalisedInitData","bh","initDataA","initDataB","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.updateKeyStatus_","ah","setStatus","$g","status_","shaka.polyfill.PatchedMediaKeysNop.requestMediaKeySystemAccess","dh","shaka.polyfill.PatchedMediaKeysNop.setMediaKeys","eh","shaka.polyfill.PatchedMediaKeysNop.MediaKeys","fh","shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess","gh","shaka.polyfill.PatchedMediaKeysWebkit.install","ih","prefix","shaka.polyfill.PatchedMediaKeysWebkit.prefix_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_","shaka.polyfill.PatchedMediaKeysWebkit.requestMediaKeySystemAccess","HTMLMediaElement","shaka.polyfill.PatchedMediaKeysWebkit.setMediaKeys","MediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys","MediaKeySystemAccess","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess","shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_","oh","api","charAt","kh","lh","nh","internalKeySystem_","allowPersistentState","tmpVideo","unsupportedError","mh","keySystem_","media_","newSessions_","sessionMap_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setMedia","ph","onWebkitNeedKey_","onWebkitKeyMessage_","onWebkitKeyAdded_","onWebkitKeyError_","rh","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.findSession_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession","qh","sessionType","generatePromise_","type_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap","uh","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generate_","offlineSessionId","mangledInitData","generateKeyRequestName","sh","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.updateKeyStatus_","th","shaka.polyfill.MediaSource.stubAbort_","vh","MediaSource.prototype.addSourceBuffer","sourceBuffer.abort","shaka.polyfill.MediaSource.patchEndOfStreamEvents_","wh","MediaSource.prototype.endOfStream","newDuration","sourceBuffers","ignoreUpdateEnd_","eventSuppressed_","shaka.polyfill.MediaSource.ignoreUpdateEnd_","cleanUpHandlerInstalled_","shaka.polyfill.MediaSource.cleanUpListeners_","xh","stopPropagation","stopImmediatePropagation","yh","shaka.polyfill.Promise","Z","opt_callback","thens_","catches_","state_","shaka.polyfill.Promise.State.PENDING","resolve_","reject_","shaka.polyfill.Promise.resolve","Ah","shaka.polyfill.Promise.reject","Bh","shaka.polyfill.Promise.all","Ch","others","newValue","shaka.polyfill.Promise.race","Dh","Eh","shaka.polyfill.Promise.prototype.schedule_","shaka.polyfill.Promise.q_.push","wrapper","value_","shaka.polyfill.Promise.handleThenable_","RESOLVED","shaka.polyfill.Promise.flushTimer_","shaka.polyfill.Promise.setImmediate_","shaka.polyfill.Promise.flush","Gh","thenable","sealed","nextThen","Jh","shaka.polyfill.Promise.q_.length","shaka.polyfill.Promise.clearImmediate_","q","shaka.polyfill.Promise.q_","Ih","Kh","shaka.polyfill.VideoPlaybackQuality.webkit_","Lh","corruptedVideoFrames","creationTime","totalFrameDelay","shaka.polyfill.VTTCue.from3ArgsTextTrackCue_","Mh","shaka.polyfill.VTTCue.from6ArgsTextTrackCue_","Nh","goog.global.CLOSURE_NO_DEPS","CLOSURE_NO_DEPS","shaka.abr.EwmaBandwidthEstimator.prototype.setDefaultEstimate","estimate","getBandwidthEstimate","shaka.abr.EwmaBandwidthEstimator.prototype.getBandwidthEstimate","minTotalBytes_","shaka.util.Error.prototype.toString","Severity","shaka.util.Error.Severity","Category","shaka.util.Error.Category","Code","shaka.util.Error.Code","goog$Uri.prototype","goog.Uri.prototype","goog.Uri.prototype.toString","getScheme","goog.Uri.reDisallowedInSchemeOrUserInfo_","domain","getDomain","userInfo","getUserInfo","port","getPort","getPath","hasDomain","goog.Uri.reDisallowedInAbsolutePath_","goog.Uri.reDisallowedInRelativePath_","getEncodedQuery","getFragment","goog.Uri.reDisallowedInFragment_","goog.Uri.prototype.resolve","relativeUri","absoluteUri","overridden","hasPath","lastSlashIndex","leadingSlash","goog.Uri.QueryData.prototype.toString","encodedKey","NetworkingEngine","RequestType","shaka.net.NetworkingEngine.RequestType","shaka.net.NetworkingEngine.schemes_","registerScheme","shaka.net.NetworkingEngine.registerScheme","unregisterScheme","shaka.net.NetworkingEngine.unregisterScheme","registerRequestFilter","shaka.net.NetworkingEngine.prototype.registerRequestFilter","goog.exportProperty","unregisterRequestFilter","shaka.net.NetworkingEngine.prototype.unregisterRequestFilter","filters","clearAllRequestFilters","shaka.net.NetworkingEngine.prototype.clearAllRequestFilters","registerResponseFilter","shaka.net.NetworkingEngine.prototype.registerResponseFilter","unregisterResponseFilter","shaka.net.NetworkingEngine.prototype.unregisterResponseFilter","clearAllResponseFilters","shaka.net.NetworkingEngine.prototype.clearAllResponseFilters","shaka.net.NetworkingEngine.prototype.destroy","cleanup","shaka.net.NetworkingEngine.prototype.request","filterStartMs","requestFilter","shaka.util.Error.Code.REQUEST_FILTER_ERROR","filterTimeMs","send_","resend_","timeMs","shaka.net.NetworkingEngine.prototype.send_","requestFilterTime","shaka.util.Error.Code.UNSUPPORTED_SCHEME","startTimeMs","responseFilter","shaka.util.Error.Code.RESPONSE_FILTER_ERROR","shaka.util.MultiMap.prototype.push","shaka.util.MultiMap.prototype.get","shaka.util.MultiMap.prototype.remove","shaka.util.EventManager.prototype.destroy","shaka.util.EventManager.prototype.unlisten","shaka.util.EventManager.Binding_.prototype.unlisten","fromUTF8","fromUTF16","fromBytesAutoDetect","toUTF8","shaka.util.Timer.prototype.cancel","toBase64","fromBase64","fromHex","toHex","shaka.util.Uint8ArrayUtils.concat","totalLength","shaka$media$DrmEngine.prototype","shaka.media.DrmEngine.prototype.destroy","shaka.media.DrmEngine.prototype","shaka.media.DrmEngine.prototype.configure","shaka.media.DrmEngine.prototype.init","prepareMediaKeyConfigs_","queryMediaKeys_","shaka.media.DrmEngine.prototype.keySystem","getExpiration","shaka.media.DrmEngine.prototype.getExpiration","expirations","shaka.media.DrmEngine.prototype.onEncrypted_","shaka.media.DrmEngine.prototype.onSessionMessage_","delayLicenseRequest_","sendLicenseRequest_","shaka.media.DrmEngine.prototype.onKeyStatusesChange_","hasExpiredKeys","part0","part1","part2","setUint16","msUntilExpiration","schedule","shaka.media.DrmEngine.prototype.processKeyStatusChanges_","isExpired","shaka.util.Error.Code.EXPIRED","shaka.media.DrmEngine.prototype.onPlay_","shaka.media.DrmEngine.prototype.pollExpiration_","new_","registerParser","unregisterParser","shaka.media.TextEngine.unregisterParser","makeCue","shaka.media.TextEngine.prototype.destroy","removeWhere_","shaka.media.TextEngine.prototype.remove","shaka.media.TextEngine.TextParserWrapper_.prototype.parseInit","shaka.media.TextEngine.TextParserWrapper_.prototype.parseMedia","shaka$media$MediaSourceEngine.prototype","shaka.media.MediaSourceEngine.prototype","shaka.media.MediaSourceEngine.prototype.destroy","inProgress","shaka.media.MediaSourceEngine.prototype.init","onUpdateEnd_","shaka.media.MediaSourceEngine.prototype.remove","shaka.media.MediaSourceEngine.prototype.endOfStream","opt_reason","enqueueBlockingOperation_","shaka.media.MediaSourceEngine.prototype.setDuration","shaka.media.MediaSourceEngine.prototype.getDuration","shaka_media_MediaSourceEngine_prototype$append_","shaka.media.MediaSourceEngine.prototype.append_","shaka.media.MediaSourceEngine.prototype.remove_","shaka.media.MediaSourceEngine.prototype.abort_","shaka.media.MediaSourceEngine.prototype.flush_","shaka.media.MediaSourceEngine.prototype.setTimestampOffset_","shaka.media.MediaSourceEngine.prototype.setAppendWindowEnd_","fudge","shaka_media_MediaSourceEngine_prototype$onError_","shaka.media.MediaSourceEngine.prototype.onError_","shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_FAILED","shaka.media.MediaSourceEngine.prototype.onUpdateEnd_","BASE_LANGUAGE_OKAY","OTHER_SUB_LANGUAGE_OKAY","aar","abk","afr","aka","alb","amh","ara","arm","asm","ava","ave","aym","aze","bak","bam","baq","bel","ben","bih","bis","bod","bos","bre","bul","bur","cat","ces","cha","che","chi","chu","chv","cor","cos","cre","cym","cze","dan","deu","div","dut","dzo","ell","eng","epo","est","eus","ewe","fao","fas","fij","fin","fra","fre","fry","ful","geo","ger","gla","gle","glg","glv","gre","grn","guj","hat","hau","heb","her","hin","hmo","hrv","hun","hye","ibo","ice","ido","iii","iku","ile","ina","ind","ipk","isl","ita","jav","jpn","kal","kan","kas","kat","kau","kaz","khm","kik","kin","kir","kom","kon","kor","kua","kur","lao","lat","lav","lim","lin","lit","ltz","lub","lug","mac","mah","mal","mao","mar","may","mkd","mlg","mlt","mon","mri","msa","mya","nau","nav","nbl","nde","ndo","nep","nld","nno","nob","nor","nya","oci","oji","ori","orm","oss","pan","per","pli","pol","por","pus","que","roh","ron","rum","rus","sag","san","sin","slk","slo","slv","sme","smo","sna","snd","som","sot","spa","sqi","srd","srp","ssw","sun","swa","swe","tah","tam","tat","tel","tgk","tgl","tha","tib","tir","ton","tsn","tso","tuk","tur","twi","uig","ukr","urd","uzb","ven","vie","wel","wln","wol","xho","yid","yor","zha","zho","zul","SimpleAbrManager","shaka.abr.SimpleAbrManager.prototype.stop","shaka.abr.SimpleAbrManager.prototype.init","switchCallback","shaka.abr.SimpleAbrManager.prototype.chooseStreams","mediaTypesToUpdate","sortedVariants","chooseVariant_","currentBandwidth","shaka.abr.SimpleAbrManager.BANDWIDTH_UPGRADE_TARGET_","shaka.abr.SimpleAbrManager.BANDWIDTH_DOWNGRADE_TARGET_","shaka.abr.SimpleAbrManager.prototype.enable","shaka.abr.SimpleAbrManager.prototype.disable","segmentDownloaded","shaka.abr.SimpleAbrManager.prototype.segmentDownloaded","deltaTimeMs","minBytes_","suggestStreams_","shaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS","shaka.abr.SimpleAbrManager.prototype.getBandwidthEstimate","shaka.abr.SimpleAbrManager.prototype.setDefaultEstimate","shaka.abr.SimpleAbrManager.prototype.setRestrictions","shaka.abr.SimpleAbrManager.prototype.setVariants","shaka.abr.SimpleAbrManager.prototype.setTextStreams","shaka.util.FakeEvent.prototype.preventDefault","shaka.util.FakeEvent.prototype.stopImmediatePropagation","shaka.util.FakeEvent.prototype.stopPropagation","shaka.cast.CastUtils.VideoEvents","shaka.cast.CastUtils.VideoAttributes","shaka.cast.CastUtils.VideoInitStateAttributes","shaka.cast.CastUtils.VideoVoidMethods","shaka.cast.CastUtils.PlayerEvents","shaka.cast.CastUtils.PlayerGetterMethods","shaka.cast.CastUtils.PlayerInitState","shaka.cast.CastUtils.PlayerInitAfterLoadState","shaka.cast.CastUtils.PlayerVoidMethods","shaka.cast.CastUtils.PlayerPromiseMethods","shaka$cast$CastSender.prototype","shaka.cast.CastSender.prototype","shaka.cast.CastSender.prototype.destroy","rejectAllPromises_","leave","isCasting","shaka.cast.CastSender.prototype.isCasting","receiverName","shaka.cast.CastSender.prototype.receiverName","shaka.cast.CastSender.prototype.init","chrome","isAvailable","__onGCastApiAvailable","sessionRequest","SessionRequest","apiConfig","ApiConfig","onExistingSessionJoined_","onReceiverStatusChanged_","initialize","setAppData","shaka.cast.CastSender.prototype.setAppData","shaka.cast.CastSender.prototype.cast","shaka.util.Error.Category.CAST","shaka.util.Error.Code.ALREADY_CASTING","requestSession","onSessionInitiated_","onConnectionError_","shaka.util.Error.Code.NO_CAST_RECEIVERS","shaka.util.Error.Code.CAST_API_UNAVAILABLE","forceDisconnect","shaka.cast.CastSender.prototype.forceDisconnect","shaka.cast.CastSender.prototype.get","targetName","shaka.cast.CastUtils.VideoVoidMethods.indexOf","remoteCall_","shaka.cast.CastUtils.PlayerVoidMethods.indexOf","shaka.cast.CastUtils.PlayerPromiseMethods.indexOf","remoteAsyncCall_","shaka.cast.CastUtils.PlayerGetterMethods.indexOf","propertyGetter_","shaka.cast.CastSender.prototype.set","shaka.cast.CastSender.prototype.onSessionInitiated_","onSessionCreated_","addUpdateListener","onConnectionStatusChanged_","addMessageListener","onMessageReceived_","shaka.cast.CastSender.prototype.onConnectionError_","shaka.util.Error.Code.UNEXPECTED_CAST_ERROR","shaka.util.Error.Code.CAST_CANCELED_BY_USER","shaka.util.Error.Code.CAST_CONNECTION_TIMED_OUT","shaka.util.Error.Code.CAST_RECEIVER_APP_UNAVAILABLE","shaka.cast.CastSender.prototype.propertyGetter_","shaka.cast.CastSender.prototype.remoteCall_","shaka.cast.CastSender.prototype.remoteAsyncCall_","shaka.cast.CastSender.prototype.onExistingSessionJoined_","shaka.cast.CastSender.prototype.onReceiverStatusChanged_","availability","shaka.cast.CastSender.prototype.onConnectionStatusChanged_","connected","friendlyName","shaka.cast.CastSender.prototype.onMessageReceived_","namespace","fakeEvent","reconstructedError","shaka.util.FakeEventTarget.prototype.addEventListener","shaka.util.FakeEventTarget.prototype.removeEventListener","shaka.util.FakeEventTarget.prototype.dispatchEvent","CastProxy","shaka.cast.CastProxy.prototype.destroy","opt_forceDisconnect","getVideo","shaka.cast.CastProxy.prototype.getVideo","getPlayer","shaka.cast.CastProxy.prototype.getPlayer","canCast","shaka.cast.CastProxy.prototype.canCast","shaka.cast.CastProxy.prototype.isCasting","shaka.cast.CastProxy.prototype.receiverName","shaka.cast.CastProxy.prototype.cast","unload","shaka.cast.CastProxy.prototype.setAppData","suggestDisconnect","shaka.cast.CastProxy.prototype.suggestDisconnect","shaka.cast.CastProxy.prototype.forceDisconnect","shaka$cast$CastProxy.prototype","shaka.cast.CastProxy.prototype.getInitState_","shaka.cast.CastUtils.VideoInitStateAttributes.forEach","shaka.cast.CastUtils.PlayerInitState.forEach","pair","setter","shaka.cast.CastUtils.PlayerInitAfterLoadState.forEach","shaka.cast.CastProxy.prototype","shaka_cast_CastProxy_prototype$onCastStatusChanged_","shaka.cast.CastProxy.prototype.onCastStatusChanged_","shaka_cast_CastProxy_prototype$onResumeLocal_","shaka.cast.CastProxy.prototype.onResumeLocal_","videoState","shaka.cast.CastProxy.prototype.videoProxyGet_","shaka.cast.CastProxy.prototype.videoProxySet_","shaka.cast.CastProxy.prototype.videoProxyLocalEvent_","shaka.cast.CastProxy.prototype.playerProxyGet_","getNetworkingEngine","shaka.cast.CastProxy.prototype.playerProxyLocalEvent_","shaka_cast_CastProxy_prototype$onRemoteEvent_","shaka.cast.CastProxy.prototype.onRemoteEvent_","CastReceiver","isConnected","shaka.cast.CastReceiver.prototype.isConnected","isIdle","shaka.cast.CastReceiver.prototype.isIdle","shaka.cast.CastReceiver.prototype.destroy","shaka$cast$CastReceiver.prototype","shaka.cast.CastReceiver.prototype","shaka.cast.CastReceiver.prototype.onSendersChanged_","getSenders","shaka.cast.CastReceiver.prototype.proxyEvent_","pollAttributes_","shaka.cast.CastReceiver.prototype.pollAttributes_","shaka.cast.CastUtils.VideoAttributes.forEach","shaka.cast.CastUtils.PlayerGetterMethods.forEach","systemVolume","getSystemVolume","shaka.cast.CastReceiver.prototype.fakeVolumeChangeEvent_","shaka.cast.CastReceiver.prototype.onShakaMessage_","initState_","setSystemVolumeLevel","setSystemVolumeMuted","senderId","sendAsyncComplete_","shaka.cast.CastReceiver.prototype.onGenericMessage_","resumeState","volumeObject","oldVolumeLevel","oldVolumeMuted","mediaInfo","shaka.cast.CastReceiver.prototype.sendAsyncComplete_","urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb","InitSegmentReference","SegmentReference","DataViewReader","LITTLE_ENDIAN","Endianness","shaka.util.DataViewReader.Endianness","shaka.util.DataViewReader.prototype.hasMoreData","getPosition","shaka.util.DataViewReader.prototype.getPosition","getLength","shaka.util.DataViewReader.prototype.getLength","shaka.util.DataViewReader.prototype.readUint8","throwOutOfBounds_","shaka.util.DataViewReader.prototype.readUint16","shaka.util.DataViewReader.prototype.readUint32","readInt32","shaka.util.DataViewReader.prototype.readInt32","getInt32","shaka.util.DataViewReader.prototype.readUint64","low","high","shaka.util.DataViewReader.prototype.readBytes","shaka.util.DataViewReader.prototype.skip","readTerminatedString","shaka.util.DataViewReader.prototype.readTerminatedString","Mp4Parser","shaka.util.Mp4Parser.prototype.box","typeCode","BASIC_BOX","shaka.util.Mp4Parser.prototype.fullBox","FULL_BOX","shaka.util.Mp4Parser.prototype.parse","shaka.util.Mp4Parser.prototype.parseNext","absStart","boxDefinition","versionAndFlags","payloadReader","sampleDescription","shaka.util.Mp4Parser.sampleDescription","allData","SegmentIndex","shaka.media.SegmentIndex.prototype.destroy","shaka.media.SegmentIndex.prototype.find","shaka.media.SegmentIndex.prototype.get","shaka.media.SegmentIndex.prototype.merge","nextPosition","newReferences","r1","r2","shaka.media.SegmentIndex.prototype.evict","shaka.util.EbmlParser.prototype.hasMoreData","shaka.media.WebmSegmentIndexParser.prototype.parse","cuesData","shaka.media.WebmSegmentIndexParser.EBML_ID","shaka.util.Error.Code.WEBM_EBML_HEADER_ELEMENT_MISSING","segmentElement","shaka.media.WebmSegmentIndexParser.SEGMENT_ID","shaka.util.Error.Code.WEBM_SEGMENT_ELEMENT_MISSING","infoElement","shaka.media.WebmSegmentIndexParser.INFO_ID","shaka.util.Error.Code.WEBM_INFO_ELEMENT_MISSING","timecodeScaleNanoseconds","durationScale","shaka.media.WebmSegmentIndexParser.TIMECODE_SCALE_ID","shaka.media.WebmSegmentIndexParser.DURATION_ID","getFloat32","shaka.util.Error.Code.EBML_BAD_FLOATING_POINT_SIZE","getFloat64","shaka.util.Error.Code.WEBM_DURATION_ELEMENT_MISSING","shaka.media.WebmSegmentIndexParser.CUES_ID","shaka.util.Error.Code.WEBM_CUES_ELEMENT_MISSING","parseCues_","registerParserByExtension","shaka.media.ManifestParser.registerParserByExtension","parserFactory","registerParserByMime","shaka.media.ManifestParser.registerParserByMime","PresentationTimeline","shaka.media.PresentationTimeline.prototype.getDuration","shaka.media.PresentationTimeline.prototype.setDuration","getPresentationStartTime","shaka.media.PresentationTimeline.prototype.getPresentationStartTime","shaka.media.PresentationTimeline.prototype.setClockOffset","shaka.media.PresentationTimeline.prototype.setStatic","isStatic","getSegmentAvailabilityDuration","shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityDuration","shaka.media.PresentationTimeline.prototype.setSegmentAvailabilityDuration","shaka.media.PresentationTimeline.prototype.notifySegments","shaka.media.PresentationTimeline.prototype.notifyMaxSegmentDuration","shaka.media.PresentationTimeline.prototype.isLive","isInProgress","shaka.media.PresentationTimeline.prototype.isInProgress","shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityStart","shaka.media.PresentationTimeline.prototype.getSafeAvailabilityStart","shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityEnd","getLiveEdge_","shaka.media.PresentationTimeline.prototype.getSeekRangeEnd","DashParser","shaka$dash$DashParser.prototype","shaka.dash.DashParser.prototype","shaka.dash.DashParser.prototype.configure","shaka.dash.DashParser.prototype.start","setUpdateTimer_","shaka.dash.DashParser.prototype.stop","shaka.dash.DashParser.prototype.update","shaka.dash.DashParser.prototype.onExpirationUpdated","shaka.dash.DashParser.prototype.parseAdaptationSet_","roleElements","roleValues","unrecognizedEssentialProperty","contentProtectionElems","contentProtection","representations","parseRepresentation_","shaka.util.Error.Code.DASH_EMPTY_ADAPTATION_SET","repIds","shaka.dash.DashParser.prototype.parseRepresentation_","isPrimary","verifyRepresentation_","requestInitSegment_","shaka_dash_DashParser_prototype$onUpdate_","shaka.dash.DashParser.prototype.onUpdate_","shaka.dash.DashParser.prototype.parseEventStream_","schemeIdUri","eventNode","shaka.dash.DashParser.prototype.requestInitSegment_","shaka.hls.Tag.prototype.toString","attr_to_str","shaka.hls.Tag.prototype.getAttribute","shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS","shaka.hls.ManifestTextParser.SEGMENT_TAGS","DataUriPlugin","shaka.util.Error.Code.MALFORMED_DATA_URI","infoAndData","dataStr","typeAndEncoding","encoding","shaka.util.Error.Code.UNKNOWN_DATA_URI_ENCODING","HlsParser","shaka$hls$HlsParser.prototype","shaka.hls.HlsParser.prototype","shaka.hls.HlsParser.prototype.configure","shaka.hls.HlsParser.prototype.start","shaka.hls.HlsParser.prototype.stop","shaka.hls.HlsParser.prototype.update","shaka.hls.HlsParser.prototype.onExpirationUpdated","m4s","m4i","m4a","m4v","shaka.hls.HlsParser.widevineDrmParser_","parsedData","m3u8","shaka.media.TtmlTextParser.prototype.parseInit","shaka.media.TtmlTextParser.prototype.parseMedia","shaka.util.Error.Code.INVALID_XML","tt","spaceStyle","regions","textNodes","hasAttribute","shaka.util.Error.Code.INVALID_TEXT_CUE","extent","shaka.media.TtmlTextParser.percentValues_.exec","writingMode","isVerticalText","origin","shaka.media.TtmlTextParser.textAlignToPositionAlign_","shaka.media.TtmlTextParser.textAlignToLineAlign_","shaka.media.TtmlTextParser.timeColonFormatFrames_","shaka.media.TtmlTextParser.timeFramesFormat_","shaka.media.TtmlTextParser.timeTickFormat_","shaka.media.TtmlTextParser.percentValues_","shaka.media.Mp4TtmlParser.prototype.parseInit","sawSTPP","shaka.util.Error.Code.INVALID_MP4_TTML","shaka.media.Mp4TtmlParser.prototype.parseMedia","sawMDAT","shaka.media.VttTextParser.prototype.parseInit","shaka.media.VttTextParser.prototype.parseMedia","shaka.util.Error.Code.INVALID_TEXT_HEADER","cueTimeMatch","mpegTimeMatch","shaka.media.VttTextParser.MPEG_TIMESCALE_","expect","shaka.media.Mp4VttParser.prototype.parseInit","sawWVTT","shaka.util.Error.Code.INVALID_MP4_VTT","shaka.media.Mp4VttParser.prototype.parseMedia","presentations","payloads","sawTFDT","sawTRUN","sampleCount","presentation","shaka$media$Playhead.prototype","shaka.media.Playhead.prototype.destroy","shaka.media.Playhead.prototype","getPlaybackRate","shaka.media.Playhead.prototype.getPlaybackRate","shaka.media.Playhead.prototype.onSegmentAppended","shaka.media.Playhead.prototype.onRateChange_","setPlaybackRate","shaka.media.Playhead.prototype.onLoadedMetadata_","onSeeking_","onPlaying_","onSeekingToStartTime_","shaka.media.Playhead.prototype.onSeekingToStartTime_","shaka.media.Playhead.prototype.onPollGapJump_","threshold","gapIndex","jumpTo","jumpSize","isGapSmall","jumpLargeGap","gapSize","movePlayhead_","shaka.media.Playhead.prototype.onSeeking_","reposition_","shaka.media.Playhead.prototype.onPlaying_","shaka.media.PlayheadObserver.prototype.destroy","addTimelineRegion","shaka.media.PlayheadObserver.prototype.addTimelineRegion","regionInfo","existing","FUTURE_REGION","updateTimelineRegion_","shaka.media.PlayheadObserver.prototype.updateTimelineRegion_","isSeek","newStatus","PAST_REGION","INSIDE","wasInside","isInside","shaka.media.PlayheadObserver.prototype.onWatchdogTimer_","newPeriod","shaka.media.PlayheadObserver.FUDGE_FACTOR_","buffering","setBuffering_","shaka.media.PlayheadObserver.UNDERFLOW_THRESHOLD_","shaka$media$StreamingEngine.prototype","shaka.media.StreamingEngine.prototype","shaka.media.StreamingEngine.prototype.destroy","shaka.media.StreamingEngine.prototype.configure","shaka.media.StreamingEngine.prototype.init","onInitialStreamsSetup","shaka_media_StreamingEngine_prototype$onUpdate_","shaka.media.StreamingEngine.prototype.onUpdate_","update_","handlePeriodTransition_","shaka.media.StreamingEngine.prototype.parseEMSG_","schemeId","presentationTimeDelta","eventDuration","messageData","onManifestUpdate","HttpPlugin","http","https","shaka$offline$DBEngine.prototype","shaka.offline.DBEngine.prototype","shaka.offline.DBEngine.prototype.init","stores","getNextId_","shaka.offline.DBEngine.prototype.destroy","shaka.offline.DBEngine.prototype.get","shaka.offline.DBEngine.prototype.forEach","continue","shaka.offline.DBEngine.prototype.remove","shaka.offline.DownloadManager.prototype.destroy","storage","removeKeys","shaka$offline$OfflineManifestParser.prototype","shaka.offline.OfflineManifestParser.prototype","shaka.offline.OfflineManifestParser.prototype.configure","shaka.offline.OfflineManifestParser.prototype.start","manifestId","shaka.offline.OfflineManifestParser.reconstructManifest","shaka.offline.OfflineManifestParser.prototype.stop","shaka.offline.OfflineManifestParser.prototype.update","shaka.offline.OfflineManifestParser.prototype.onExpirationUpdated","OfflineScheme","shaka.util.CancelableChain.prototype.then","shaka.util.CancelableChain.prototype.cancel","shaka.Player.prototype.destroy","cancelation","GIT_VERSION","shaka.Player.supportPlugins_","registerSupportPlugin","shaka.Player.registerSupportPlugin","shaka.Player.isBrowserSupported","probeSupport","shaka.Player.probeSupport","shaka.media.DrmEngine.probeSupport","shaka.Player.prototype.load","opt_startTime","unloadPromise","loadChain","finalize","updateState_","onTimelineRegionAdded_","shaka.util.Error.Code.NO_PERIODS","createDrmEngine","createPlayhead","createPlayheadObserver","createMediaSourceEngine","createStreamingEngine","onChooseStreams_","canSwitch_","onManifestUpdate_","onSegmentAppended_","chooseCodecsAndFilterManifest_","adjustStartTime_","setStartTime","onTracksChanged_","shaka.Player.prototype.configure","configOverrides_","applyConfig_","shaka.Player.prototype.getConfiguration","resetConfiguration","shaka.Player.prototype.resetConfiguration","getMediaElement","shaka.Player.prototype.getMediaElement","shaka.Player.prototype.getNetworkingEngine","getManifestUri","shaka.Player.prototype.getManifestUri","shaka.Player.prototype.isLive","shaka.Player.prototype.isInProgress","seekRange","shaka.Player.prototype.seekRange","shaka.Player.prototype.keySystem","shaka.Player.prototype.drmInfo","shaka.Player.prototype.getExpiration","isBuffering","shaka.Player.prototype.isBuffering","shaka.Player.prototype.unload","interrupt","resetStreaming_","shaka.Player.prototype.getPlaybackRate","trickPlay","shaka.Player.prototype.trickPlay","setTrickPlay","cancelTrickPlay","shaka.Player.prototype.cancelTrickPlay","shaka.Player.prototype.getTracks","selectTrack","shaka.Player.prototype.selectTrack","shaka.Player.prototype.getVariantTracks","shaka.Player.prototype.getTextTracks","shaka.Player.prototype.selectTextTrack","streamsToSwitch","shaka.Player.prototype.selectVariantTrack","currentTextStream","getAudioLanguages","shaka.Player.prototype.getAudioLanguages","getTextLanguages","shaka.Player.prototype.getTextLanguages","shaka.Player.prototype.selectAudioLanguage","shaka.Player.prototype.selectTextLanguage","isTextTrackVisible","shaka.Player.prototype.isTextTrackVisible","setTextTrackVisibility","shaka.Player.prototype.setTextTrackVisibility","getPlayheadTimeAsDate","shaka.Player.prototype.getPlayheadTimeAsDate","getStats","shaka.Player.prototype.getStats","updateTimeStats_","videoInfo","shaka.Player.prototype.addTextTrack","mime","opt_codec","opt_label","curPeriodIdx","shaka.Player.prototype.setMaxHardwareResolution","shaka$Player.prototype","shaka.Player.prototype","shaka_Player_prototype$filterPeriod_","shaka.Player.prototype.filterPeriod_","hasPlayableVariants","allVariantsRestricted","shaka.util.Error.Code.UNPLAYABLE_PERIOD","shaka_Player_prototype$onSegmentDownloaded_","shaka.Player.prototype.onSegmentDownloaded_","shaka_Player_prototype$onBuffering_","shaka.Player.prototype.onBuffering_","shaka_Player_prototype$onChangePeriod_","shaka.Player.prototype.onChangePeriod_","shaka.Player.prototype.updateState_","lastEntry","shaka_Player_prototype$onSeek_","shaka.Player.prototype.onSeek_","seeked","shaka.Player.prototype.onChooseStreams_","shaka.Player.prototype.canSwitch_","shaka.Player.prototype.onManifestUpdate_","shaka.Player.prototype.onSegmentAppended_","shaka_Player_prototype$switch_","shaka.Player.prototype.switch_","oldActive","shaka_Player_prototype$onError_","shaka.Player.prototype.onError_","shaka.Player.prototype.onTimelineRegionAdded_","shaka_Player_prototype$onEvent_","shaka.Player.prototype.onEvent_","shaka.Player.prototype.onVideoError_","extended","msExtendedCode","shaka.util.Error.Code.VIDEO_ERROR","shaka_Player_prototype$onKeyStatus_","shaka.Player.prototype.onKeyStatus_","keyStatusMap","restrictedStatuses","keyStatus","shaka_Player_prototype$onExpirationUpdated_","shaka.Player.prototype.onExpirationUpdated_","Storage","shaka.offline.Storage.prototype.destroy","shaka.offline.Storage.prototype.configure","shaka.offline.Storage.prototype.store","shaka.util.Error.Code.STORE_ALREADY_IN_PROGRESS","manifestDb","initIfNeeded_","shaka.util.Error.Code.CANNOT_STORE_LIVE_OFFLINE","createOfflineManifest_","getSessionIds","shaka.util.Error.Code.NO_INIT_DATA_FOR_OFFLINE","downloadAndStore","cleanup_","shaka.offline.Storage.prototype.remove","removeSessions","deleteCount","segmentCount","shaka.offline.Storage.prototype.list","storedContents","shaka.offline.Storage.prototype.defaultTrackSelect_","selectedTracks","audioLangPref","matchTypes","allVariantTracks","tracksByMatchType","primaryTracks","tracksByHeight","shaka.offline.Storage.prototype.filterPeriod_","shaka.offline.Storage.prototype.createPeriod_","chosenTracks","foundSimilarTracks","bandwidthEstimation","createStream_","shaka.polyfill.installAll","shaka.polyfill.polyfills_.length","shaka.polyfill.polyfills_","shaka.polyfill.Fullscreen.install","Document","requestFullscreen","mozRequestFullScreen","msRequestFullscreen","mozCancelFullScreen","msExitFullscreen","webkitExitFullscreen","mozFullScreenElement","msFullscreenElement","webkitFullscreenElement","mozFullScreenEnabled","msFullscreenEnabled","webkitFullscreenEnabled","shaka.polyfill.IndexedDB.install","agent","shaka.polyfill.MathRound.install","testNumber","original_mathRound","Math.round","shaka.polyfill.MathRound.MAX_ACCURATE_INPUT_","shaka.util.Pssh.prototype.parseBox_","systemId","numKeyIds","dataSize","shaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.createMediaKeys","shaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.getConfiguration","shaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.createSession","opt_sessionType","shaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.setServerCertificate","shaka$polyfill$PatchedMediaKeysMs$MediaKeySession.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.generateRequest","onMsKeyMessage_","onMsKeyAdded_","onMsKeyError_","updateKeyStatus_","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.load","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.update","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.close","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.remove","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.onMsKeyMessage_","messageType","getStatus","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.onMsKeyAdded_","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.onMsKeyError_","errorCode","MSMediaKeyError","MS_MEDIA_KEYERR_OUTPUT","MS_MEDIA_KEYERR_HARDWARECHANGE","shaka$polyfill$PatchedMediaKeysMs$MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.setStatus","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.getStatus","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.forEach","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.get","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.has","fakeKeyId","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.entries","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.keys","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.values","shaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.createSession","shaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.setServerCertificate","shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.getConfiguration","shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.createMediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.createMediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.getConfiguration","shaka$polyfill$PatchedMediaKeysWebkit$MediaKeys.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.createSession","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setServerCertificate","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitNeedKey_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyMessage_","findSession_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyAdded_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyError_","systemCode","MediaKeyError","MEDIA_KEYERR_OUTPUT","shaka$polyfill$PatchedMediaKeysWebkit$MediaKeySession.prototype","shaka_polyfill_PatchedMediaKeysWebkit_MediaKeySession_prototype$update_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update_","licenseString","jwkSet","addKeyName","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generateRequest","generate_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.load","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update","nextUpdatePromise","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.close","cancelKeyRequestName","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.remove","jh","shaka$polyfill$PatchedMediaKeysWebkit$MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.setStatus","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.getStatus","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.forEach","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.get","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.has","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.entries","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.keys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.values","shaka.polyfill.MediaKeys.install","webkitGenerateKeyRequest","generateKeyRequest","shaka.polyfill.MediaSource.install","appVersion","shaka.polyfill.Promise.prototype.then","opt_successCallback","opt_failCallback","schedule_","shaka.polyfill.Promise.prototype.catch","shaka.polyfill.Promise.prototype.resolve_","shaka.polyfill.Promise.prototype.reject_","shaka.polyfill.Promise.install","opt_force","setImmediate","clearImmediate","race","shaka.polyfill.VideoPlayPromise.install","originalPlay","HTMLMediaElement.prototype.play","shaka.polyfill.VideoPlaybackQuality.install","shaka.polyfill.VTTCue.install","constructorLength","shaka"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,OAAA,mBAAAH,GACA,gBAAAC,SACAA,QAAA,cAAAD,IAEAD,EAAA,cAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAtB,GACA,GAAAe,GAAAf,KAAAuB,WACA,WAA2B,MAAAvB,GAAA,SAC3B,WAAiC,MAAAA,G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AI4sC,GAAe5sC,iBAAA/mL,UAAAwO,IACnBu4K,kBAAA/mL,UAAAwO,KAAkColN,WAChC,GAAI1zN,GAAIyzN,EAAA3uN,MAAmBvG,KAAM4C,UAcjC,OAbInB,IAWFA,EAAAkO,MAAQ,cAEHlO,MLiBb6hL,GApC8C8xC,WAC5C,GAAKnwN,EAAA2xE,iBAAL,CAKA,GAAItoC,GAAQsoC,iBAAAr1E,WACR+sC,EAAA2pC,yBAKA,2BAA6B3pC,KAC/BA,EAAA2pC,wBACI22G,OC8DRtL,GA7EgC+xC,WAC9B,IAAIpwN,EAAA40E,QAKC50E,EAAA60E,aAAL,CAKA,GAAIw7I,GAAoBx7I,aAAA13E,MACxB,IAAyB,GAArBkzN,EAEFrwN,EAAA40E,OAAgBo1G,OACX,IAAyB,GAArBqmC,EAETrwN,EAAA40E,OAAgBs1G,OACX,CAmDP,IACE,GAAAzhJ,KAASuhJ,GAA6C,EAAG,EAAG,IAC5D,MAAOr/K,GACP89B,GAAO,EAtDEA,IAETzoC,EAAA40E,OAAgBo1G,UAyDpB1uL,KAAAy1C,EAAAh2C,UpSiqhCoB,KAAV,GAAuBH,EAAOD,QAAQC,EAAOD,QAAQo2C,EAAEu/K,UAE3B1yN,MADtBie,EAAgC,WAAW,MAAOk1B,GAAEu/K,OAAOh1N,KAAKX,EAASM,EAAqBN,EAASC,MACnEA,EAAOD,QAAUkhB","file":"kaltura-player.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(\"KalturaPlayer\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"KalturaPlayer\"] = factory();\n\telse\n\t\troot[\"KalturaPlayer\"] = 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(\"KalturaPlayer\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"KalturaPlayer\"] = factory();\n\telse\n\t\troot[\"KalturaPlayer\"] = 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/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Playkit\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Playkit\"] = factory();\n\telse\n\t\troot[\"Playkit\"] = 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/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\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.l = 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// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 21);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 * General track representation of the player.\n * @classdesc\n */\nvar Track = function () {\n _createClass(Track, [{\n key: \"id\",\n\n\n /**\n * Getter for the track id.\n * @public\n * @returns {?string} - The track id.\n */\n\n /**\n * The language of the track.\n * @member\n * @type {string}\n * @private\n */\n\n /**\n * The active mode of the track.\n * @member\n * @type {boolean}\n * @private\n */\n get: function get() {\n return this._id;\n }\n\n /**\n * Getter for the active mode of the track.\n * @public\n * @returns {boolean} - The active mode of the track.\n */\n\n /**\n * The index of the track.\n * @member\n * @type {number}\n * @private\n */\n\n /**\n * The label of the track.\n * @member\n * @type {string}\n * @private\n */\n\n /**\n * The id of the track.\n * @member\n * @type {string}\n * @private\n */\n\n }, {\n key: \"active\",\n get: function get() {\n return this._active;\n }\n\n /**\n * Setter for the active mode of the track.\n * @public\n * @param {boolean} value - Whether the track is active or not.\n */\n ,\n set: function set(value) {\n this._active = value;\n }\n\n /**\n * Getter for the label of the track.\n * @public\n * @returns {string} - The label of the track.\n */\n\n }, {\n key: \"label\",\n get: function get() {\n return this._label;\n }\n\n /**\n * Getter for the language of the track.\n * @public\n * @returns {string} - The language of the track.\n */\n\n }, {\n key: \"language\",\n get: function get() {\n return this._language;\n }\n\n /**\n * Getter for the index of the track.\n * @public\n * @returns {number} - The index of the track.\n */\n\n }, {\n key: \"index\",\n get: function get() {\n return this._index;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n\n }]);\n\n function Track() {\n var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Track);\n\n this._id = settings.id;\n this._active = settings.active;\n this._label = settings.label;\n this._language = settings.language;\n this._index = settings.index;\n }\n\n return Track;\n}();\n\nexports.default = Track;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.LOG_LEVEL = undefined;\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 _jsLogger = __webpack_require__(25);\n\nvar JsLogger = _interopRequireWildcard(_jsLogger);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LOG_LEVEL = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nvar LoggerFactory = function () {\n function LoggerFactory(options) {\n _classCallCheck(this, LoggerFactory);\n\n JsLogger.useDefaults(options || {});\n }\n\n _createClass(LoggerFactory, [{\n key: \"getLogger\",\n value: function getLogger(name) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n }]);\n\n return LoggerFactory;\n}();\n\nvar lf = new LoggerFactory({ defaultLevel: JsLogger.DEBUG });\n\nexports.default = lf;\nexports.LOG_LEVEL = LOG_LEVEL;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 * Create an Event work-alike object based on the dictionary.\n * The event should contain all of the same properties from the dict.\n * @param {string} type -\n * @param {Object=} opt_dict -\n * @constructor\n * @extends {Event}\n */\nvar FakeEvent = function () {\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n\n\n /** @type {EventTarget} */\n\n\n /** @const {string} */\n\n\n /** @const {boolean} */\n\n /** @const {boolean} */\n function FakeEvent(type, payload) {\n _classCallCheck(this, FakeEvent);\n\n // These Properties below cannot be set by dict. They are all provided for\n // compatibility with native events.\n\n /** @const {boolean} */\n this.bubbles = false;\n\n /** @const {boolean} */\n this.cancelable = false;\n\n /** @const {boolean} */\n this.defaultPrevented = false;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n this.timeStamp = window.performance ? window.performance.now() : Date.now();\n\n /** @const {string} */\n this.type = type;\n\n /** @const {boolean} */\n this.isTrusted = false;\n\n /** @type {EventTarget} */\n this.currentTarget = null;\n\n /** @type {EventTarget} */\n this.target = null;\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n this.stopped = false;\n\n this.payload = payload;\n }\n\n /**\n * Does nothing, since FakeEvents have no default. Provided for compatibility\n * with native Events.\n * @override\n */\n\n\n /** @type {EventTarget} */\n\n\n /** @const {boolean} */\n\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n\n\n /** @const {boolean} */\n\n\n _createClass(FakeEvent, [{\n key: \"preventDefault\",\n value: function preventDefault() {}\n\n /**\n * Stops processing event listeners for this event. Provided for compatibility\n * with native Events.\n * @override\n */\n\n }, {\n key: \"stopImmediatePropagation\",\n value: function stopImmediatePropagation() {\n this.stopped = true;\n }\n\n /**\n * Does nothing, since FakeEvents do not bubble. Provided for compatibility\n * with native Events.\n * @override\n */\n\n }, {\n key: \"stopPropagation\",\n value: function stopPropagation() {}\n }]);\n\n return FakeEvent;\n}();\n\nexports.default = FakeEvent;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\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\n/**\n * Audio track representation of the player.\n * @classdesc\n */\nvar AudioTrack = function (_Track) {\n _inherits(AudioTrack, _Track);\n\n function AudioTrack() {\n _classCallCheck(this, AudioTrack);\n\n return _possibleConstructorReturn(this, (AudioTrack.__proto__ || Object.getPrototypeOf(AudioTrack)).apply(this, arguments));\n }\n\n return AudioTrack;\n}(_track2.default);\n\nexports.default = AudioTrack;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\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\n/**\n * Text track representation of the player.\n * @classdesc\n */\nvar TextTrack = function (_Track) {\n _inherits(TextTrack, _Track);\n\n _createClass(TextTrack, [{\n key: 'kind',\n\n\n /**\n * Getter for the kind of the text track.\n * @public\n * @returns {string} - The kind of the text track.\n */\n get: function get() {\n return this._kind;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n\n /**\n * The kind of the text track:\n * subtitles/captions/metadata.\n * @member\n * @type {string}\n * @private\n */\n\n }]);\n\n function TextTrack() {\n var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, TextTrack);\n\n var _this = _possibleConstructorReturn(this, (TextTrack.__proto__ || Object.getPrototypeOf(TextTrack)).call(this, settings));\n\n _this._kind = settings.kind;\n return _this;\n }\n\n return TextTrack;\n}(_track2.default);\n\nexports.default = TextTrack;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\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\n/**\n * Video track representation of the player.\n * @classdesc\n */\nvar VideoTrack = function (_Track) {\n _inherits(VideoTrack, _Track);\n\n _createClass(VideoTrack, [{\n key: 'bandwidth',\n\n\n /**\n * Getter for the kind of the text track.\n * @public\n * @returns {string} - The kind of the text track.\n */\n get: function get() {\n return this._bandwidth;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n\n /**\n * The kind of the text track:\n * subtitles/captions/metadata.\n * @member\n * @type {string}\n * @private\n */\n\n }]);\n\n function VideoTrack() {\n var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, VideoTrack);\n\n var _this = _possibleConstructorReturn(this, (VideoTrack.__proto__ || Object.getPrototypeOf(VideoTrack)).call(this, settings));\n\n _this._bandwidth = settings.bandwidth;\n return _this;\n }\n\n return VideoTrack;\n}(_track2.default);\n\nexports.default = VideoTrack;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _multiMap = __webpack_require__(17);\n\nvar _multiMap2 = _interopRequireDefault(_multiMap);\n\nvar _fakeEvent = __webpack_require__(2);\n\nvar _fakeEvent2 = _interopRequireDefault(_fakeEvent);\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\n/**\n * Creates a new EventManager. An EventManager maintains a collection of \"event\n * bindings\" between event targets and event listeners.\n *\n * @struct\n * @constructor\n * @implements {IDestroyable}\n */\nvar EventManager = function () {\n function EventManager() {\n _classCallCheck(this, EventManager);\n\n /**\n * Maps an event type to an array of event bindings.\n * @private {MultiMap.<!EventManager.Binding_>}\n */\n this._bindingMap = new _multiMap2.default();\n }\n\n /**\n * Detaches all event listeners.\n * @override\n */\n\n\n _createClass(EventManager, [{\n key: 'destroy',\n value: function destroy() {\n this.removeAll();\n this._bindingMap = null;\n return Promise.resolve();\n }\n\n /**\n * Attaches an event listener to an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {EventManager.ListenerType} listener The event listener.\n * @returns {void}\n */\n\n }, {\n key: 'listen',\n value: function listen(target, type, listener) {\n var binding = new Binding_(target, type, listener);\n if (this._bindingMap) {\n this._bindingMap.push(type, binding);\n }\n }\n\n /**\n * Detaches an event listener from an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @returns {void}\n */\n\n }, {\n key: 'unlisten',\n value: function unlisten(target, type) {\n if (this._bindingMap) {\n var list = this._bindingMap.get(type);\n\n for (var i = 0; i < list.length; ++i) {\n var binding = list[i];\n\n if (binding.target == target) {\n binding.unlisten();\n if (this._bindingMap) {\n this._bindingMap.remove(type, binding);\n }\n }\n }\n }\n }\n\n /**\n * Detaches all event listeners from all targets.\n * @returns {void}\n */\n\n }, {\n key: 'removeAll',\n value: function removeAll() {\n if (this._bindingMap) {\n var listeners = this._bindingMap.getAll();\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = listeners[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var listener = _step.value;\n\n listener.unlisten();\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n if (this._bindingMap) {\n this._bindingMap.clear();\n }\n }\n }\n }]);\n\n return EventManager;\n}();\n\n/**\n * @typedef {function(!Event)}\n */\n\n\n/**\n * Creates a new Binding_ and attaches the event listener to the event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {EventManager.ListenerType} listener The event listener.\n * @constructor\n * @private\n */\nvar Binding_ = function () {\n function Binding_(target, type, listener) {\n _classCallCheck(this, Binding_);\n\n /** @type {EventTarget} */\n this.target = target;\n\n /** @type {string} */\n this.type = type;\n\n /** @type {?EventManager.ListenerType} */\n this.listener = listener;\n\n this.target.addEventListener(type, listener, false);\n }\n\n /**\n * Detaches the event listener from the event target. This does nothing if the\n * event listener is already detached.\n * @returns {void}\n */\n\n\n _createClass(Binding_, [{\n key: 'unlisten',\n value: function unlisten() {\n if (!this.target) return;\n\n this.target.removeEventListener(this.type, this.listener, false);\n\n this.target = null;\n this.listener = null;\n }\n }]);\n\n return Binding_;\n}();\n\nexports.default = EventManager;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CUSTOM_EVENTS = exports.HTML5_EVENTS = exports.PLAYER_EVENTS = undefined;\n\nvar _util = __webpack_require__(11);\n\nvar HTML5_EVENTS = {\n /**\n * Fires when the loading of an audio/video is aborted\n */\n ABORT: 'abort',\n /**\n * Fires when the browser can start playing the audio/video\n */\n CAN_PLAY: 'canplay',\n /**\n * Fires when the browser can play through the audio/video without stopping for buffering\n */\n CAN_PLAY_THROUGH: 'canplaythrough',\n /**\n * Fires when the duration of the audio/video is changed\n */\n DURATION_CHANGE: 'durationchange',\n /**\n * Fires when the current playlist is empty\n */\n EMPTIED: 'emptied',\n /**\n * Fires when the current playlist is ended\n */\n ENDED: 'ended',\n /**\n * Fires when an error occurred during the loading of an audio/video\n */\n ERROR: 'error',\n /**\n * Fires when the browser has loaded the current frame of the audio/video\n */\n LOADED_DATA: 'loadeddata',\n /**\n * Fires when the browser has loaded meta data for the audio/video\n */\n LOADED_METADATA: 'loadedmetadata',\n /**\n * Fires when the browser starts looking for the audio/video\n */\n LOAD_START: 'loadstart',\n /**\n * Fires when the audio/video has been paused\n */\n PAUSE: 'pause',\n /**\n * Fires when the audio/video has been started or is no longer paused\n */\n PLAY: 'play',\n /**\n * Fires when the audio/video is playing after having been paused or stopped for buffering\n */\n PLAYING: 'playing',\n /**\n * Fires when the browser is downloading the audio/video\n */\n PROGRESS: 'progress',\n /**\n * Fires when the playing speed of the audio/video is changed\n */\n RATE_CHANGE: 'ratechange',\n /**\n * Fires when the user is finished moving/skipping to a new position in the audio/video\n */\n SEEKED: 'seeked',\n /**\n * Fires when the user starts moving/skipping to a new position in the audio/video\n */\n SEEKING: 'seeking',\n /**\n * Fires when the browser is trying to get media data, but data is not available\n */\n STALLED: 'stalled',\n /**\n * Fires when the browser is intentionally not getting media data\n */\n SUSPEND: 'suspend',\n /**\n * Fires when the current playback position has changed\n */\n TIME_UPDATE: 'timeupdate',\n /**\n * Fires when the volume has been changed\n */\n VOLUME_CHANGE: 'volumechange',\n /**\n * Fires when the video stops because it needs to buffer the next frame\n */\n WAITING: 'waiting'\n};\n\n\nvar CUSTOM_EVENTS = {\n /**\n * Fires when the active video track has been changed\n */\n VIDEO_TRACK_CHANGED: 'videotrackchanged',\n /**\n * Fires when the active audio track has been changed\n */\n AUDIO_TRACK_CHANGED: 'audiotrackchanged',\n /**\n * Fires when the active text track has been changed\n */\n TEXT_TRACK_CHANGED: 'texttrackchanged',\n /**\n * Fires when the player tracks have been changed\n */\n TRACKS_CHANGED: 'trackschanged',\n /**\n * Fires when the player state has been changed\n */\n PLAYER_STATE_CHANGED: 'playerstatechanged',\n /**\n * Fires on the first play\n */\n FIRST_PLAY: 'firstplay',\n /**\n * Fires when the player has selected the source to play\n */\n SOURCE_SELECTED: 'sourceselected'\n};\n\nvar PLAYER_EVENTS = (0, _util.merge)([HTML5_EVENTS, CUSTOM_EVENTS]);\n\nexports.PLAYER_EVENTS = PLAYER_EVENTS;\nexports.HTML5_EVENTS = HTML5_EVENTS;\nexports.CUSTOM_EVENTS = CUSTOM_EVENTS;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _eventManager = __webpack_require__(6);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _fakeEvent = __webpack_require__(2);\n\nvar _fakeEvent2 = _interopRequireDefault(_fakeEvent);\n\nvar _fakeEventTarget = __webpack_require__(9);\n\nvar _fakeEventTarget2 = _interopRequireDefault(_fakeEventTarget);\n\nvar _events = __webpack_require__(7);\n\nvar _stateTypes = __webpack_require__(16);\n\nvar _stateTypes2 = _interopRequireDefault(_stateTypes);\n\nvar _util = __webpack_require__(11);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _html = __webpack_require__(19);\n\nvar _html2 = _interopRequireDefault(_html);\n\nvar _pluginManager = __webpack_require__(15);\n\nvar _pluginManager2 = _interopRequireDefault(_pluginManager);\n\nvar _stateManager = __webpack_require__(22);\n\nvar _stateManager2 = _interopRequireDefault(_stateManager);\n\nvar _trackTypes = __webpack_require__(24);\n\nvar _trackTypes2 = _interopRequireDefault(_trackTypes);\n\nvar _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\n\nvar _videoTrack = __webpack_require__(5);\n\nvar _videoTrack2 = _interopRequireDefault(_videoTrack);\n\nvar _audioTrack = __webpack_require__(3);\n\nvar _audioTrack2 = _interopRequireDefault(_audioTrack);\n\nvar _textTrack = __webpack_require__(4);\n\nvar _textTrack2 = _interopRequireDefault(_textTrack);\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\n/**\n * The HTML5 player class.\n * @classdesc\n */\nvar Player = function (_FakeEventTarget) {\n _inherits(Player, _FakeEventTarget);\n\n /**\n * @param {Object} config - The configuration for the player instance.\n * @constructor\n */\n\n /**\n * The player ready promise\n * @type {Promise<*>}\n * @private\n */\n\n /**\n * The state manager of the player.\n * @type {StateManager}\n * @private\n */\n\n /**\n * The runtime configuration of the player.\n * @type {Object}\n * @private\n */\n\n /**\n * The plugin manager of the player.\n * @type {PluginManager}\n * @private\n */\n function Player(config) {\n _classCallCheck(this, Player);\n\n var _this = _possibleConstructorReturn(this, (Player.__proto__ || Object.getPrototypeOf(Player)).call(this));\n\n _this._tracks = [];\n _this._firstPlay = true;\n _this._logger = _logger2.default.getLogger('Player');\n _this._stateManager = new _stateManager2.default(_this);\n _this._pluginManager = new _pluginManager2.default();\n _this._eventManager = new _eventManager2.default();\n _this._readyPromise = new Promise(function (resolve, reject) {\n _this._eventManager.listen(_this, _events.CUSTOM_EVENTS.TRACKS_CHANGED, function () {\n resolve();\n });\n _this._eventManager.listen(_this, _events.HTML5_EVENTS.ERROR, reject);\n });\n _this.configure(config);\n return _this;\n }\n\n /**\n * Configures the player according to given configuration.\n * @param {Object} config - The configuration for the player instance.\n * @returns {void}\n */\n\n /**\n * Whether the play is the first or not\n * @type {boolean}\n * @private\n */\n\n /**\n * The tracks of the player.\n * @type {Array<Track>}\n * @private\n */\n\n /**\n * The playback engine.\n * @type {IEngine}\n * @private\n */\n\n /**\n * The event manager of the player.\n * @type {EventManager}\n * @private\n */\n\n /**\n * The player class logger.\n * @type {any}\n * @private\n */\n\n\n _createClass(Player, [{\n key: 'configure',\n value: function configure(config) {\n this._config = (0, _util.merge)([this._config, config || Player._defaultConfig()]);\n this._loadPlugins(this._config);\n this._selectEngine(this._config);\n this._attachMedia();\n }\n\n /**\n * Destroys the player.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this._engine.destroy();\n this._eventManager.destroy();\n this._pluginManager.destroy();\n this._stateManager.destroy();\n this._config = {};\n this._tracks = [];\n this._readyPromise = null;\n this._firstPlay = true;\n }\n\n /**\n * @returns {Object} - The default configuration of the player.\n * @private\n * @static\n */\n\n }, {\n key: '_loadPlugins',\n\n\n /**\n *\n * @param {Object} config - The configuration of the player instance.\n * @private\n * @returns {void}\n */\n value: function _loadPlugins(config) {\n var plugins = config.plugins;\n for (var name in plugins) {\n this._pluginManager.load(name, this, plugins[name]);\n }\n }\n\n /**\n * Select the engine to create based on the given configured sources.\n * @param {Object} config - The configuration of the player instance.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_selectEngine',\n value: function _selectEngine(config) {\n if (config && config.sources) {\n var sources = config.sources;\n for (var i = 0; i < sources.length; i++) {\n if (_html2.default.canPlayType(sources[i].mimetype)) {\n this.dispatchEvent(new _fakeEvent2.default(_events.CUSTOM_EVENTS.SOURCE_SELECTED, { selectedSource: sources[i] }));\n this._loadEngine(sources[i], config);\n break;\n }\n }\n }\n }\n\n /**\n * Loads the selected engine.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The configuration of the player instance.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_loadEngine',\n value: function _loadEngine(source, config) {\n this._engine = new _html2.default(source, config);\n if (config.preload === \"auto\") {\n this.load();\n }\n }\n\n /**\n * Listen to all HTML5 defined events and trigger them on the player\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_attachMedia',\n value: function _attachMedia() {\n var _this2 = this;\n\n if (this._engine) {\n for (var playerEvent in _events.HTML5_EVENTS) {\n this._eventManager.listen(this._engine, _events.HTML5_EVENTS[playerEvent], function (event) {\n return _this2.dispatchEvent(event);\n });\n }\n this._eventManager.listen(this._engine, _events.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED, function (event) {\n _this2._markActiveTrack(event.payload.selectedVideoTrack);\n return _this2.dispatchEvent(event);\n });\n this._eventManager.listen(this._engine, _events.CUSTOM_EVENTS.AUDIO_TRACK_CHANGED, function (event) {\n _this2._markActiveTrack(event.payload.selectedAudioTrack);\n return _this2.dispatchEvent(event);\n });\n this._eventManager.listen(this._engine, _events.CUSTOM_EVENTS.TEXT_TRACK_CHANGED, function (event) {\n _this2._markActiveTrack(event.payload.selectedTextTrack);\n return _this2.dispatchEvent(event);\n });\n this._eventManager.listen(this, _events.HTML5_EVENTS.PLAY, this._onPlay.bind(this));\n }\n }\n\n /**\n * Returns the tracks according to the filter. if no filter given returns the all tracks.\n * @function getTracks\n * @param {string} [type] - a tracks filter, should be 'video', 'audio' or 'text'.\n * @returns {Array<Track>} - The parsed tracks.\n * @public\n */\n\n }, {\n key: 'getTracks',\n value: function getTracks(type) {\n return this._getTracksByType(type);\n }\n\n /**\n * Returns the tracks according to the filter. if no filter given returns the all tracks.\n * @function _getTracksByType\n * @param {string} [type] - a tracks filter, should be 'video', 'audio' or 'text'.\n * @returns {Array<Track>} - The parsed tracks.\n * @private\n */\n\n }, {\n key: '_getTracksByType',\n value: function _getTracksByType(type) {\n return !type ? this._tracks : this._tracks.filter(function (track) {\n if (type === _trackTypes2.default.VIDEO) {\n return track instanceof _videoTrack2.default;\n } else if (type === _trackTypes2.default.AUDIO) {\n return track instanceof _audioTrack2.default;\n } else if (type === _trackTypes2.default.TEXT) {\n return track instanceof _textTrack2.default;\n } else {\n return true;\n }\n });\n }\n\n /**\n * Select a track\n * @function selectTrack\n * @param {Track} track - the track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectTrack',\n value: function selectTrack(track) {\n if (this._engine) {\n if (track instanceof _videoTrack2.default) {\n this._engine.selectVideoTrack(track);\n } else if (track instanceof _audioTrack2.default) {\n this._engine.selectAudioTrack(track);\n } else if (track instanceof _textTrack2.default) {\n this._engine.selectTextTrack(track);\n }\n }\n }\n\n /**\n * Enables adaptive bitrate switching.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'enableAdaptiveBitrate',\n value: function enableAdaptiveBitrate() {\n if (this._engine) {\n this._engine.enableAdaptiveBitrate();\n }\n }\n\n /**\n * Mark the selected track as active\n * @function _markActiveTrack\n * @param {Track} track - the track to mark\n * @returns {void}\n * @private\n */\n\n }, {\n key: '_markActiveTrack',\n value: function _markActiveTrack(track) {\n var type = void 0;\n if (track instanceof _videoTrack2.default) {\n type = _trackTypes2.default.VIDEO;\n } else if (track instanceof _audioTrack2.default) {\n type = _trackTypes2.default.AUDIO;\n } else if (track instanceof _textTrack2.default) {\n type = _trackTypes2.default.TEXT;\n }\n if (type) {\n var tracks = this.getTracks(type);\n for (var i = 0; i < tracks.length; i++) {\n tracks[i].active = track.index === i;\n }\n }\n }\n\n /**\n * @function _onPlay\n * @return {void}\n * @private\n */\n\n }, {\n key: '_onPlay',\n value: function _onPlay() {\n if (this._firstPlay) {\n this._firstPlay = false;\n this.dispatchEvent(new _fakeEvent2.default(_events.CUSTOM_EVENTS.FIRST_PLAY));\n }\n }\n\n /**\n * Get the player config.\n * @returns {Object} - The player configuration.\n * @public\n */\n\n }, {\n key: 'ready',\n\n\n // <editor-fold desc=\"Playback Interface\">\n /**\n * The player readiness\n * @public\n * @returns {Promise<*>} - The ready promise\n */\n value: function ready() {\n return this._readyPromise ? this._readyPromise : Promise.resolve();\n }\n\n /**\n * Load media\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'load',\n value: function load() {\n var _this3 = this;\n\n if (this._engine) {\n this._engine.load().then(function (data) {\n _this3._tracks = data.tracks;\n _this3.dispatchEvent(new _fakeEvent2.default(_events.CUSTOM_EVENTS.TRACKS_CHANGED, { tracks: _this3._tracks }));\n }).catch(function (error) {\n _this3.dispatchEvent(new _fakeEvent2.default(_events.HTML5_EVENTS.ERROR, error));\n });\n }\n }\n\n /**\n * Start/resume playback.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'play',\n value: function play() {\n var _this4 = this;\n\n if (this._engine) {\n if (this._engine.src) {\n this._engine.play();\n } else {\n this.load();\n this.ready().then(function () {\n _this4._engine.play();\n });\n }\n }\n }\n\n /**\n * Pause playback.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'pause',\n value: function pause() {\n if (this._engine) {\n return this._engine.pause();\n }\n }\n\n /**\n * Set the current time in seconds.\n * @param {Number} to - The number to set in seconds.\n * @public\n */\n\n }, {\n key: 'buffered',\n value: function buffered() {}\n\n /**\n * Set player muted state.\n * @param {boolean} mute - The mute value.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'config',\n get: function get() {\n return this._config;\n }\n\n /**\n * Set player session id\n * @param {string} sessionId - the player session id to set\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'sessionId',\n set: function set(sessionId) {\n this._config.session = this._config.session || {};\n this._config.session.id = sessionId;\n }\n }, {\n key: 'currentTime',\n set: function set(to) {\n if (this._engine) {\n if ((0, _util.isNumber)(to)) {\n var boundedTo = to;\n if (to < 0) {\n boundedTo = 0;\n }\n if (boundedTo > this._engine.duration) {\n boundedTo = this._engine.duration;\n }\n this._engine.currentTime = boundedTo;\n }\n }\n }\n\n /**\n * Get the current time in seconds.\n * @returns {?Number} - The playback current time.\n * @public\n */\n ,\n get: function get() {\n if (this._engine) {\n return this._engine.currentTime;\n }\n }\n\n /**\n * Get the duration in seconds.\n * @returns {?Number} - The playback duration.\n * @public\n */\n\n }, {\n key: 'duration',\n get: function get() {\n if (this._engine) {\n return this._engine.duration;\n }\n }\n\n /**\n * Set playback volume.\n * @param {Number} vol - The volume to set.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'volume',\n set: function set(vol) {\n if (this._engine) {\n if ((0, _util.isFloat)(vol)) {\n var boundedVol = vol;\n if (boundedVol < 0) {\n boundedVol = 0;\n }\n if (boundedVol > 1) {\n boundedVol = 1;\n }\n this._engine.volume = boundedVol;\n }\n }\n }\n\n /**\n * Get playback volume.\n * @returns {?Number} - The playback volume.\n * @public\n */\n ,\n get: function get() {\n if (this._engine) {\n return this._engine.volume;\n }\n }\n\n // </editor-fold>\n\n // <editor-fold desc=\"State\">\n /**\n * Get paused state.\n * @returns {?boolean} - Whether the video is paused or not.\n * @public\n */\n\n }, {\n key: 'paused',\n get: function get() {\n if (this._engine) {\n return this._engine.paused;\n }\n }\n\n /**\n * Get seeking state.\n * @returns {?boolean} - Whether the video is seeking or not.\n * @public\n */\n\n }, {\n key: 'seeking',\n get: function get() {\n if (this._engine) {\n return this._engine.seeking;\n }\n }\n }, {\n key: 'muted',\n set: function set(mute) {\n if (this._engine) {\n this._engine.muted = mute;\n }\n }\n\n /**\n * Get player muted state.\n * @returns {?boolean} - Whether the video is muted or not.\n * @public\n */\n ,\n get: function get() {\n if (this._engine) {\n return this._engine.muted;\n }\n }\n\n /**\n * Get the player source.\n * @returns {?string} - The current source of the player.\n * @public\n */\n\n }, {\n key: 'src',\n get: function get() {\n if (this._engine) {\n return this._engine.src;\n }\n }\n\n /**\n * Get the player events.\n * @returns {Object} - The events of the player.\n * @public\n */\n\n }, {\n key: 'Event',\n get: function get() {\n return _events.PLAYER_EVENTS;\n }\n\n /**\n * Get the player states.\n * @returns {Object} - The states of the player.\n * @public\n */\n\n }, {\n key: 'State',\n get: function get() {\n return _stateTypes2.default;\n }\n\n /**\n * Get the player tracks types.\n * @returns {Object} - The tracks types of the player.\n * @public\n */\n\n }, {\n key: 'Track',\n get: function get() {\n return _trackTypes2.default;\n }\n\n // </editor-fold>\n\n }], [{\n key: '_defaultConfig',\n value: function _defaultConfig() {\n return {};\n }\n }]);\n\n return Player;\n}(_fakeEventTarget2.default);\n\nexports.default = Player;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _fakeEvent = __webpack_require__(2);\n\nvar _fakeEvent2 = _interopRequireDefault(_fakeEvent);\n\nvar _multiMap = __webpack_require__(17);\n\nvar _multiMap2 = _interopRequireDefault(_multiMap);\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\n/**\n * A work-alike for EventTarget. Only DOM elements may be true EventTargets,\n * but this can be used as a base class to provide event dispatch to non-DOM\n * classes. Only FakeEvents should be dispatched.\n *\n * @struct\n * @constructor\n * @implements {EventTarget}\n * @export\n */\nvar FakeEventTarget = function () {\n function FakeEventTarget() {\n _classCallCheck(this, FakeEventTarget);\n\n /**\n * @private {!MultiMap.<FakeEventTarget.ListenerType>}\n */\n this._listeners = new _multiMap2.default();\n\n /**\n * The target of all dispatched events. Defaults to |this|.\n * @type {EventTarget}\n */\n this.dispatchTarget = this;\n }\n\n /**\n * Add an event listener to this object.\n *\n * @param {string} type The event type to listen for.\n * @param {FakeEventTarget.ListenerType} listener The callback or\n * listener object to invoke.\n * @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have\n * parents, so events neither capture nor bubble.\n * @override\n * @export\n */\n\n\n _createClass(FakeEventTarget, [{\n key: 'addEventListener',\n value: function addEventListener(type, listener) {\n this._listeners.push(type, listener);\n }\n\n /**\n * Remove an event listener from this object.\n *\n * @param {string} type The event type for which you wish to remove a listener.\n * @param {FakeEventTarget.ListenerType} listener The callback or\n * listener object to remove.\n * @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have\n * parents, so events neither capture nor bubble.\n * @override\n * @export\n */\n\n }, {\n key: 'removeEventListener',\n value: function removeEventListener(type, listener) {\n this._listeners.remove(type, listener);\n }\n\n /**\n * Dispatch an event from this object.\n *\n * @param {!Event} event The event to be dispatched from this object.\n * @return {boolean} True if the default action was prevented.\n * @override\n * @export\n */\n\n }, {\n key: 'dispatchEvent',\n value: function dispatchEvent(event) {\n // In many browsers, it is complex to overwrite properties of actual Events.\n // Here we expect only to dispatch FakeEvents, which are simpler.\n //goog.asserts.assert(event instanceof FakeEvent,\n // 'FakeEventTarget can only dispatch FakeEvents!');\n\n var list = this._listeners.get(event.type) || [];\n\n for (var i = 0; i < list.length; ++i) {\n // Do this every time, since events can be re-dispatched from handlers.\n event.target = this.dispatchTarget;\n event.currentTarget = this.dispatchTarget;\n\n var listener = list[i];\n try {\n if (listener.handleEvent) {\n listener.handleEvent(event);\n } else {\n listener.call(this, event);\n }\n } catch (exception) {\n // Exceptions during event handlers should not affect the caller,\n // but should appear on the console as uncaught, according to MDN:\n // http://goo.gl/N6Ff27\n // TODO: add log\n }\n\n if (event.stopped) {\n break;\n }\n }\n\n return event.defaultPrevented;\n }\n }]);\n\n return FakeEventTarget;\n}();\n\n/**\n * These are the listener types defined in the closure extern for EventTarget.\n * @typedef {EventListener|function(!Event):(boolean|undefined)}\n */\n\n\nexports.default = FakeEventTarget;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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\nvar PlayerError = function () {\n function PlayerError(error, param) {\n _classCallCheck(this, PlayerError);\n\n this.name = error.name;\n this.message = error.message(param);\n }\n\n _createClass(PlayerError, [{\n key: \"getError\",\n value: function getError() {\n return {\n name: this.name,\n message: this.message\n };\n }\n }]);\n\n return PlayerError;\n}();\n\nPlayerError.TYPE = {\n NOT_REGISTERED_PLUGIN: {\n name: \"PluginNotRegisteredException\",\n message: function message(name) {\n return \"Cannot load \" + name + \" plugin. Name not found in the registry\";\n }\n },\n NOT_VALID_HANDLER: {\n name: \"PluginHandlerIsNotValidException\",\n message: function message() {\n return \"To activate plugin you must provide a class derived from BasePlugin\";\n }\n },\n NOT_IMPLEMENTED_METHOD: {\n name: \"NotImplementedException\",\n message: function message(method) {\n return method + \" method not implemented\";\n }\n }\n};\nexports.default = PlayerError;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is a number\n */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nfunction isNumber(n) {\n return Number(n) === n;\n}\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is an integer\n */\nfunction isInt(n) {\n return isNumber(n) && n % 1 === 0;\n}\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is a float\n */\nfunction isFloat(n) {\n return isNumber(n) && n % 1 !== 0;\n}\n\n/**\n * @param {Array<Object>} objects - The objects to merge\n * @returns {Object} - The merged object.\n */\nfunction merge(objects) {\n var target = {};\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = objects[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var obj = _step.value;\n\n Object.assign(target, obj);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return target;\n}\n\nexports.isNumber = isNumber;\nexports.isInt = isInt;\nexports.isFloat = isFloat;\nexports.merge = merge;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _fakeEvent = __webpack_require__(2);\n\nvar _fakeEvent2 = _interopRequireDefault(_fakeEvent);\n\nvar _fakeEventTarget = __webpack_require__(9);\n\nvar _fakeEventTarget2 = _interopRequireDefault(_fakeEventTarget);\n\nvar _playerError = __webpack_require__(10);\n\nvar _playerError2 = _interopRequireDefault(_playerError);\n\nvar _events = __webpack_require__(7);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\n\nvar _videoTrack = __webpack_require__(5);\n\nvar _videoTrack2 = _interopRequireDefault(_videoTrack);\n\nvar _audioTrack = __webpack_require__(3);\n\nvar _audioTrack2 = _interopRequireDefault(_audioTrack);\n\nvar _textTrack = __webpack_require__(4);\n\nvar _textTrack2 = _interopRequireDefault(_textTrack);\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/* eslint-disable no-unused-vars */\n\n\nvar BaseMediaSourceAdapter = function (_FakeEventTarget) {\n _inherits(BaseMediaSourceAdapter, _FakeEventTarget);\n\n _createClass(BaseMediaSourceAdapter, null, [{\n key: 'isSupported',\n\n\n /**\n * Checks if the media source adapter is supported.\n * @function isSupported\n * @returns {boolean} - Whether the media source adapter is supported.\n * @static\n */\n\n\n /**\n * The adapter config.\n * @member {Object} _config\n * @private\n */\n\n\n /**\n * The source object.\n * @member {Source} _sourceObj\n * @private\n */\n\n\n /**\n * The dom video element.\n * @member {HTMLVideoElement} _videoElement\n * @private\n */\n\n /**\n * Passing the custom events to the actual media source adapter.\n * @static\n */\n value: function isSupported() {\n return true;\n }\n\n /**\n * Factory method to create media source adapter.\n * @function createAdapter\n * @param {HTMLVideoElement} videoElement - The video element that the media source adapter work with.\n * @param {Object} source - The source Object.\n * @param {Object} config - The media source adapter configuration.\n * @returns {IMediaSourceAdapter} - New instance of the run time media source adapter.\n * @static\n */\n\n\n /**\n * Passing the getLogger function to the actual media source adapter.\n * @type {Function}\n * @static\n */\n\n }, {\n key: 'createAdapter',\n value: function createAdapter(videoElement, source, config) {\n return new this(videoElement, source, config);\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to media source adapter.\n * @param {Source} source - The source object.\n * @param {Object} config - The media source adapter configuration.\n */\n\n }]);\n\n function BaseMediaSourceAdapter(videoElement, source, config) {\n _classCallCheck(this, BaseMediaSourceAdapter);\n\n var _this = _possibleConstructorReturn(this, (BaseMediaSourceAdapter.__proto__ || Object.getPrototypeOf(BaseMediaSourceAdapter)).call(this));\n\n _this._videoElement = videoElement;\n _this._sourceObj = source;\n _this._config = config;\n return _this;\n }\n\n /**\n * Destroys the media source adapter.\n * @function destroy\n * @returns {void}\n */\n\n\n _createClass(BaseMediaSourceAdapter, [{\n key: 'destroy',\n value: function destroy() {\n this._sourceObj = null;\n this._config = null;\n }\n\n /**\n * Triggers the appropriate track changed event.\n * @param {Track} track - The selected track.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_onTrackChanged',\n value: function _onTrackChanged(track) {\n if (track instanceof _videoTrack2.default) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.VIDEO_TRACK_CHANGED, { selectedVideoTrack: track });\n } else if (track instanceof _audioTrack2.default) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.AUDIO_TRACK_CHANGED, { selectedAudioTrack: track });\n } else if (track instanceof _textTrack2.default) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.TEXT_TRACK_CHANGED, { selectedTextTrack: track });\n }\n }\n\n /**\n * Dispatch an adapter event forward.\n * @param {string} name - The name of the event.\n * @param {Object} payload - The event payload.\n * @returns {void}\n */\n\n }, {\n key: '_trigger',\n value: function _trigger(name, payload) {\n this.dispatchEvent(new _fakeEvent2.default(name, payload));\n }\n\n /** Must implemented methods by the derived media source adapter **/\n\n }, {\n key: 'load',\n value: function load() {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'load').getError();\n }\n }, {\n key: 'selectVideoTrack',\n value: function selectVideoTrack(videoTrack) {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'selectVideoTrack').getError();\n }\n }, {\n key: 'selectAudioTrack',\n value: function selectAudioTrack(audioTrack) {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'selectAudioTrack').getError();\n }\n }, {\n key: 'selectTextTrack',\n value: function selectTextTrack(textTrack) {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'selectTextTrack').getError();\n }\n }, {\n key: 'enableAdaptiveBitrate',\n value: function enableAdaptiveBitrate() {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'enableAdaptiveBitrate').getError();\n }\n }, {\n key: 'src',\n get: function get() {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'get src').getError();\n }\n }], [{\n key: 'canPlayType',\n value: function canPlayType(mimeType) {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'static canPlayType').getError();\n }\n }]);\n\n return BaseMediaSourceAdapter;\n}(_fakeEventTarget2.default);\n\nBaseMediaSourceAdapter.CustomEvents = _events.CUSTOM_EVENTS;\nBaseMediaSourceAdapter.getLogger = _logger2.default.getLogger;\nexports.default = BaseMediaSourceAdapter;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.registerMediaSourceAdapter = undefined;\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 _nativeAdapter = __webpack_require__(20);\n\nvar _nativeAdapter2 = _interopRequireDefault(_nativeAdapter);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\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\n/**\n * Media source provider\n * @classdesc\n */\nvar MediaSourceProvider = function () {\n function MediaSourceProvider() {\n _classCallCheck(this, MediaSourceProvider);\n }\n\n _createClass(MediaSourceProvider, null, [{\n key: 'register',\n\n\n /**\n * Add a media source adapter to the registry\n * @function register\n * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to register\n * @static\n * @returns {void}\n */\n\n /**\n * The media source adapter registry\n * @member {Array<IMediaSourceAdapter>} _mediaSourceAdapters\n * @static\n * @private\n */\n value: function register(mediaSourceAdapter) {\n if (mediaSourceAdapter) {\n if (!MediaSourceProvider._mediaSourceAdapters.includes(mediaSourceAdapter)) {\n MediaSourceProvider._logger.debug('Adapter <' + mediaSourceAdapter.id + '> has been registered successfully');\n MediaSourceProvider._mediaSourceAdapters.push(mediaSourceAdapter);\n } else {\n MediaSourceProvider._logger.debug('Adapter <' + mediaSourceAdapter.id + '> is already registered, do not register again');\n }\n }\n }\n\n /**\n * Remove a media source adapter from the registry\n * @function unRegister\n * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to unRegister\n * @static\n * @returns {void}\n */\n\n /**\n * The selected adapter for playback\n * @type {null|IMediaSourceAdapter}\n * @static\n * @private\n */\n\n /**\n * The logger of the media source provider\n * @member {any} _logger\n * @static\n * @private\n */\n\n }, {\n key: 'unRegister',\n value: function unRegister(mediaSourceAdapter) {\n var index = MediaSourceProvider._mediaSourceAdapters.indexOf(mediaSourceAdapter);\n if (index > -1) {\n MediaSourceProvider._logger.debug('Unregistered <' + mediaSourceAdapter.id + '> adapter');\n MediaSourceProvider._mediaSourceAdapters.splice(index, 1);\n }\n }\n\n /**\n * Checks if one of the registered media source adapters can play a given mime type\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @static\n * @returns {boolean} - If one of the adapters can play the specific mime type\n */\n\n }, {\n key: 'canPlayType',\n value: function canPlayType(mimeType) {\n var mediaSourceAdapters = MediaSourceProvider._mediaSourceAdapters;\n for (var i = 0; i < mediaSourceAdapters.length; i++) {\n if (mediaSourceAdapters[i].canPlayType(mimeType)) {\n MediaSourceProvider._selectedAdapter = mediaSourceAdapters[i];\n MediaSourceProvider._logger.debug('Selected adapter is <' + MediaSourceProvider._selectedAdapter.id + '>');\n return true;\n }\n }\n return false;\n }\n\n /**\n * Get the appropriate media source adapter to the video source\n * @function getMediaSourceAdapter\n * @param {HTMLVideoElement} videoElement - The video element which requires adapter for a given mimeType\n * @param {Source} source - The selected source object\n * @param {Object} config - The player configuration\n * @returns {IMediaSourceAdapter|null} - The selected media source adapter, or null if such doesn't exists\n * @static\n */\n\n }, {\n key: 'getMediaSourceAdapter',\n value: function getMediaSourceAdapter(videoElement, source, config) {\n if (videoElement && source && config) {\n if (!MediaSourceProvider._selectedAdapter) {\n MediaSourceProvider.canPlayType(source.mimetype);\n }\n return MediaSourceProvider._selectedAdapter ? MediaSourceProvider._selectedAdapter.createAdapter(videoElement, source, config.engines) : null;\n }\n return null;\n }\n }]);\n\n return MediaSourceProvider;\n}();\n\nMediaSourceProvider._logger = _logger2.default.getLogger('MediaSourceProvider');\nMediaSourceProvider._mediaSourceAdapters = [_nativeAdapter2.default];\nMediaSourceProvider._selectedAdapter = null;\nexports.default = MediaSourceProvider;\n\n\nvar registerMediaSourceAdapter = MediaSourceProvider.register;\nexports.registerMediaSourceAdapter = registerMediaSourceAdapter;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _player = __webpack_require__(8);\n\nvar _player2 = _interopRequireDefault(_player);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _util = __webpack_require__(11);\n\nvar _eventManager = __webpack_require__(6);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _playerError = __webpack_require__(10);\n\nvar _playerError2 = _interopRequireDefault(_playerError);\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\n/** The BasePlugin responsible to implement the plugin interface.\n * Contains several default implementations.\n * Other plugins should extend this class.\n * @classdesc\n */\nvar BasePlugin = function () {\n _createClass(BasePlugin, null, [{\n key: 'createPlugin',\n\n\n /**\n * Factory method to create the actual plugin.\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} config - The plugin configuration\n * @returns {BasePlugin} - New runtime plugin instance\n * @static\n * @public\n */\n\n /**\n * The event manager of the plugin.\n * @member\n */\n\n /**\n * The logger of the plugin.\n * @member\n */\n\n /**\n * The runtime configuration of the plugin.\n * @member\n */\n value: function createPlugin(name, player) {\n var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n return new this(name, player, config);\n }\n\n /**\n * Returns under what conditions the plugin is valid.\n * Plugin must implement this method.\n * @returns {boolean} - Whether the plugin is valid and can be initiated. Default implementation is true\n * @static\n * @public\n * @abstract\n */\n\n /**\n * The default configuration of the plugin.\n * Inherited plugins should override this property.\n * @type {Object}\n * @static\n * @member\n */\n\n /**\n * Reference to the actual player.\n * @member\n */\n\n /**\n * The name of the plugin.\n * @member\n */\n\n }, {\n key: 'isValid',\n value: function isValid() {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'isValid()').getError();\n }\n\n /**\n * constructor\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} config - The plugin configuration\n * @constructor\n * @private\n */\n\n }]);\n\n function BasePlugin(name, player, config) {\n _classCallCheck(this, BasePlugin);\n\n this.name = name;\n this.player = player;\n this.eventManager = new _eventManager2.default();\n this.logger = _logger2.default.getLogger(this.name);\n this.config = (0, _util.merge)([this.constructor.defaultConfig, config]);\n }\n\n /**\n * Getter for the configuration of the plugin.\n * @param {string} attr - The key in the plugin configuration (optional).\n * @returns {*} - If attribute is provided, returns its value. Else, Returns the config of the plugin.\n * @public\n */\n\n\n _createClass(BasePlugin, [{\n key: 'getConfig',\n value: function getConfig(attr) {\n if (attr) {\n return this.config[attr];\n }\n return this.config;\n }\n\n /**\n * Updates the config of the plugin.\n * @param {Object} update - The updated configuration.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'updateConfig',\n value: function updateConfig(update) {\n this.config = (0, _util.merge)([this.config, update]);\n }\n\n /**\n * Runs the destroy logic of the plugin.\n * plugin must implement this method.\n * @public\n * @abstract\n * @returns {void}\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'destroy()').getError();\n }\n\n /**\n * Getter for the plugin's name.\n * @returns {string} - The name of the plugin.\n * @public\n */\n\n }, {\n key: 'getName',\n value: function getName() {\n return this.name;\n }\n }]);\n\n return BasePlugin;\n}();\n\nBasePlugin.defaultConfig = {};\nexports.default = BasePlugin;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.registerPlugin = undefined;\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 _basePlugin = __webpack_require__(14);\n\nvar _basePlugin2 = _interopRequireDefault(_basePlugin);\n\nvar _playerError = __webpack_require__(10);\n\nvar _playerError2 = _interopRequireDefault(_playerError);\n\nvar _player = __webpack_require__(8);\n\nvar _player2 = _interopRequireDefault(_player);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\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\n/**\n * The logger of the PluginManager class.\n * @private\n * @const\n */\nvar logger = _logger2.default.getLogger(\"PluginManager\");\n\n/** The PluginManager responsible for register plugins definitions and store plugins instances.\n * @classdesc\n */\n\nvar PluginManager = function () {\n function PluginManager() {\n _classCallCheck(this, PluginManager);\n\n this._plugins = new Map();\n }\n /**\n * The registry of the plugins.\n * Maps plugin's name to his class.\n * @type {Map}\n * @static\n * @private\n */\n\n /**\n * The active plugins in the player.\n * Maps plugin's name to his instance.\n * @type {Map}\n * @private\n */\n\n\n _createClass(PluginManager, [{\n key: 'load',\n\n\n /**\n * Creates and store new instance of the plugin in case isValid() of the plugin returns true.\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} [config={}] - The plugin configuration\n * @returns {boolean} - Whether the plugin load was successful\n * @public\n */\n value: function load(name, player) {\n var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n if (!PluginManager._registry.has(name)) {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_REGISTERED_PLUGIN, name).getError();\n }\n var pluginClass = PluginManager._registry.get(name);\n if (pluginClass != null && pluginClass.isValid()) {\n this._plugins.set(name, pluginClass.createPlugin(name, player, config));\n logger.debug('Plugin <' + name + '> has been loaded');\n return true;\n }\n logger.debug('Plugin <' + name + '> isn\\'t loaded, isValid()=false');\n return false;\n }\n\n /**\n * Iterates over all the plugins and calls private _destroy.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this._plugins.forEach(this._destroy.bind(this));\n }\n\n /**\n * Calls destroy() method of the plugin's impl.\n * @param {BasePlugin} plugin - The plugin instance\n * @param {string} name - The plugin name\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_destroy',\n value: function _destroy(plugin, name) {\n plugin.destroy();\n this._plugins.delete(name);\n }\n\n /**\n * Returns the plugin's instance.\n * @param {string} name - The plugin name\n * @returns {BasePlugin} - The plugin instance\n * @public\n */\n\n }, {\n key: 'get',\n value: function get(name) {\n return this._plugins.get(name);\n }\n }], [{\n key: 'register',\n\n\n /**\n * Writes the plugin in the registry.\n * Maps: plugin name -> plugin class.\n * @param {string} name - The plugin name\n * @param {Function} handler - The plugin class\n * @returns {boolean} - If the registration request succeeded\n * @static\n * @public\n */\n value: function register(name, handler) {\n if (typeof handler !== 'function' || handler.prototype instanceof _basePlugin2.default === false) {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_VALID_HANDLER).getError();\n }\n if (!PluginManager._registry.has(name)) {\n PluginManager._registry.set(name, handler);\n logger.debug('Plugin <' + name + '> has been registered successfully');\n return true;\n }\n logger.debug('Plugin <' + name + '> is already registered, do not register again');\n return false;\n }\n\n /**\n * Removes the plugin from the registry.\n * @param {string} name - The plugin name\n * @static\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'unRegister',\n value: function unRegister(name) {\n if (PluginManager._registry.has(name)) {\n PluginManager._registry.delete(name);\n logger.debug('Unregistered <' + name + '> plugin.');\n }\n }\n }]);\n\n return PluginManager;\n}();\n\n/**\n * Export the register method.\n * @type {function}\n * @constant\n */\n\n\nPluginManager._registry = new Map();\nexports.default = PluginManager;\nvar registerPlugin = PluginManager.register;\nexports.registerPlugin = registerPlugin;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar PLAYER_STATE_TYPES = {\n IDLE: \"idle\",\n LOADING: \"loading\",\n PLAYING: \"playing\",\n PAUSED: \"paused\",\n BUFFERING: \"buffering\"\n};\n\nexports.default = PLAYER_STATE_TYPES;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 * A simple multimap template.\n * @constructor\n * @struct\n * @template T\n */\nvar MultiMap = function () {\n function MultiMap() {\n _classCallCheck(this, MultiMap);\n\n /** @private {!Object.<string, !Array.<T>>} */\n this._map = new Map();\n }\n\n /**\n * Add a key, value pair to the map.\n * @param {string} key -\n * @param {T} value -\n * @returns {void}\n */\n\n\n _createClass(MultiMap, [{\n key: \"push\",\n value: function push(key, value) {\n if (this._map.has(key)) {\n var list = this._map.get(key);\n if (Array.isArray(list)) {\n list.push(value);\n this._map.set(key, list);\n }\n } else {\n this._map.set(key, [value]);\n }\n }\n\n /**\n * Set an array of values for the key, overwriting any previous data.\n * @param {string} key -\n * @param {!Array.<T>} values -\n * @returns {void}\n */\n\n }, {\n key: \"set\",\n value: function set(key, values) {\n this._map.set(key, values);\n }\n\n /**\n * Check for a key.\n * @param {string} key -\n * @return {boolean} true if the key exists.\n */\n\n }, {\n key: \"has\",\n value: function has(key) {\n return this._map.has(key);\n }\n\n /**\n * Get a list of values by key.\n * @param {string} key -\n * @return {Array.<T>} or null if no suZch key exists.\n */\n\n }, {\n key: \"get\",\n value: function get(key) {\n var list = this._map.get(key);\n // slice() clones the list so that it and the map can each be modified\n // without affecting the other.\n return list ? list.slice() : [];\n }\n\n /**\n * Get a list of all values.\n * @returns {!Array.<T>} -\n */\n\n }, {\n key: \"getAll\",\n value: function getAll() {\n var list = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = this._map.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var value = _step.value;\n\n list = list.concat(value);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return list;\n }\n\n /**\n * Remove a specific value, if it exists.\n * @param {string} key -\n * @param {T} value -\n * @returns {void}\n */\n\n }, {\n key: \"remove\",\n value: function remove(key, value) {\n if (!this._map.has(key)) return;\n var list = this._map.get(key);\n if (Array.isArray(list)) {\n for (var i = 0; i < list.length; ++i) {\n if (list[i] == value) {\n list.splice(i, 1);\n --i;\n }\n }\n }\n }\n\n /**\n * Get all keys from the multimap.\n * @return {!Array.<string>}\n */\n // eslint-disable-next-line no-undef\n\n }, {\n key: \"keys\",\n value: function keys() {\n return this._map.keys();\n }\n\n /**\n * Clear all keys and values from the multimap.\n * @returns {void}\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n this._map.clear();\n }\n }]);\n\n return MultiMap;\n}();\n\nexports.default = MultiMap;\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports) {\n\nmodule.exports = {\n\t\"name\": \"playkit-js\",\n\t\"version\": \"0.2.0\",\n\t\"main\": \"dist/playkit.js\",\n\t\"scripts\": {\n\t\t\"clean\": \"rm -rf ./dist\",\n\t\t\"prebuild\": \"npm run clean\",\n\t\t\"build:prod\": \"NODE_ENV=production webpack\",\n\t\t\"build\": \"webpack\",\n\t\t\"dev\": \"webpack --progress --colors --watch\",\n\t\t\"test\": \"NODE_ENV=test karma start --color\",\n\t\t\"test:chrome\": \"NODE_ENV=test karma start --color --browsers Chrome\",\n\t\t\"test:chrome:dots\": \"NODE_ENV=test karma start --color --browsers Chrome --reporters dots\",\n\t\t\"test:firefox\": \"NODE_ENV=test karma start --color --browsers Firefox\",\n\t\t\"test:safari\": \"NODE_ENV=test karma start --color --browsers Safari\",\n\t\t\"test:watch\": \"NODE_ENV=test karma start --color --auto-watch\",\n\t\t\"start\": \"webpack-dev-server\",\n\t\t\"release\": \"npm run build:prod && npm run commit:dist && standard-version\",\n\t\t\"publish\": \"git push --follow-tags --no-verify origin develop\",\n\t\t\"eslint\": \"eslint . --color\",\n\t\t\"flow\": \"flow check\",\n\t\t\"eslint:flow:test\": \"npm run eslint && npm run flow && npm run test\",\n\t\t\"commit:dist\": \"git add --all dist && (git commit -m 'chore: update dist' || exit 0)\",\n\t\t\"prepush-msg:build\": \"echo '\\nRunning build before push...\\n' && exit 0\",\n\t\t\"prepush-msg:dist\": \"echo '\\nAdding dist files to a seperate commit...\\n' && exit 0\",\n\t\t\"prepush-msg:done\": \"echo '\\nPre push tasks are done.\\n' && exit 0\"\n\t},\n\t\"pre-push\": [\n\t\t\"prepush-msg:build\",\n\t\t\"prebuild\",\n\t\t\"build\",\n\t\t\"build:prod\",\n\t\t\"prepush-msg:dist\",\n\t\t\"commit:dist\",\n\t\t\"prepush-msg:done\"\n\t],\n\t\"devDependencies\": {\n\t\t\"babel-cli\": \"^6.18.0\",\n\t\t\"babel-core\": \"^6.18.2\",\n\t\t\"babel-eslint\": \"^7.1.1\",\n\t\t\"babel-loader\": \"^6.2.7\",\n\t\t\"babel-plugin-istanbul\": \"^4.0.0\",\n\t\t\"babel-plugin-transform-class-properties\": \"^6.22.0\",\n\t\t\"babel-plugin-transform-flow-strip-types\": \"^6.22.0\",\n\t\t\"babel-preset-es2015\": \"^6.18.0\",\n\t\t\"babel-register\": \"^6.23.0\",\n\t\t\"chai\": \"^3.5.0\",\n\t\t\"cross-env\": \"^3.1.4\",\n\t\t\"eslint\": \"^3.10.0\",\n\t\t\"eslint-loader\": \"^1.6.1\",\n\t\t\"eslint-plugin-flowtype\": \"^2.30.0\",\n\t\t\"eslint-plugin-import\": \"^2.2.0\",\n\t\t\"eslint-plugin-mocha-no-only\": \"^0.0.5\",\n\t\t\"flow-bin\": \"latest\",\n\t\t\"istanbul\": \"^0.4.5\",\n\t\t\"karma\": \"^1.5.0\",\n\t\t\"karma-chai\": \"^0.1.0\",\n\t\t\"karma-chrome-launcher\": \"^2.0.0\",\n\t\t\"karma-cli\": \"^1.0.1\",\n\t\t\"karma-coverage\": \"^1.1.1\",\n\t\t\"karma-firefox-launcher\": \"^1.0.1\",\n\t\t\"karma-ie-launcher\": \"^1.0.0\",\n\t\t\"karma-mocha\": \"^1.3.0\",\n\t\t\"karma-safari-launcher\": \"^1.0.0\",\n\t\t\"karma-sourcemap-loader\": \"^0.3.7\",\n\t\t\"karma-webpack\": \"^2.0.2\",\n\t\t\"mocha\": \"^3.2.0\",\n\t\t\"mocha-cli\": \"^1.0.1\",\n\t\t\"pre-push\": \"^0.1.1\",\n\t\t\"sinon\": \"^2.0.0\",\n\t\t\"sinon-chai\": \"^2.8.0\",\n\t\t\"standard-version\": \"^4.0.0\",\n\t\t\"uglifyjs-webpack-plugin\": \"^0.4.3\",\n\t\t\"webpack\": \"latest\",\n\t\t\"webpack-dev-server\": \"latest\"\n\t},\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/kaltura/playkit-js\"\n\t},\n\t\"keywords\": [\n\t\t\"kaltura\",\n\t\t\"player\",\n\t\t\"html5 player\"\n\t],\n\t\"license\": \"AGPLV3\",\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/kaltura/playkit-js/issues\"\n\t},\n\t\"homepage\": \"https://github.com/kaltura/playkit-js\",\n\t\"dependencies\": {\n\t\t\"js-logger\": \"^1.3.0\"\n\t}\n};\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _fakeEventTarget = __webpack_require__(9);\n\nvar _fakeEventTarget2 = _interopRequireDefault(_fakeEventTarget);\n\nvar _fakeEvent = __webpack_require__(2);\n\nvar _fakeEvent2 = _interopRequireDefault(_fakeEvent);\n\nvar _eventManager = __webpack_require__(6);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _events = __webpack_require__(7);\n\nvar _mediaSourceProvider = __webpack_require__(13);\n\nvar _mediaSourceProvider2 = _interopRequireDefault(_mediaSourceProvider);\n\nvar _videoTrack = __webpack_require__(5);\n\nvar _videoTrack2 = _interopRequireDefault(_videoTrack);\n\nvar _audioTrack = __webpack_require__(3);\n\nvar _audioTrack2 = _interopRequireDefault(_audioTrack);\n\nvar _textTrack = __webpack_require__(4);\n\nvar _textTrack2 = _interopRequireDefault(_textTrack);\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\nvar Html5 = function (_FakeEventTarget) {\n _inherits(Html5, _FakeEventTarget);\n\n _createClass(Html5, null, [{\n key: 'canPlayType',\n\n\n /**\n * Checks if the engine can play a given mime type.\n * @param {string} mimeType - The mime type to check.\n * @returns {boolean} - Whether the engine can play the mime type.\n */\n\n /**\n * The selected media source adapter of the engine.\n * @type {IMediaSourceAdapter}\n * @private\n */\n\n /**\n * The video element.\n * @type {HTMLVideoElement}\n * @private\n */\n value: function canPlayType(mimeType) {\n return _mediaSourceProvider2.default.canPlayType(mimeType);\n }\n\n /**\n * @constructor\n * @param {Source} source - The selected source object.\n * @param {Object} config - The player configuration.\n */\n\n\n /**\n * @type {string} - The engine name.\n */\n\n /**\n * The event manager of the engine.\n * @type {EventManager}\n * @private\n */\n\n }]);\n\n function Html5(source, config) {\n _classCallCheck(this, Html5);\n\n var _this = _possibleConstructorReturn(this, (Html5.__proto__ || Object.getPrototypeOf(Html5)).call(this));\n\n _this._createVideoElement();\n _this._eventManager = new _eventManager2.default();\n _this._loadMediaSourceAdapter(source, config);\n _this.attach();\n return _this;\n }\n\n /**\n * Destroys the engine.\n * @public\n * @returns {void}\n */\n\n\n _createClass(Html5, [{\n key: 'destroy',\n value: function destroy() {\n this.detach();\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.destroy();\n }\n if (this._el) {\n this.pause();\n this._el.removeAttribute('src');\n if (this._el.parentNode) {\n this._el.parentNode.removeChild(this._el);\n }\n }\n this._eventManager.destroy();\n }\n\n /**\n * Listen to the video element events and triggers them from the engine.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'attach',\n value: function attach() {\n var _this2 = this;\n\n var _loop = function _loop(playerEvent) {\n _this2._eventManager.listen(_this2._el, _events.HTML5_EVENTS[playerEvent], function () {\n _this2.dispatchEvent(new _fakeEvent2.default(_events.HTML5_EVENTS[playerEvent]));\n });\n };\n\n for (var playerEvent in _events.HTML5_EVENTS) {\n _loop(playerEvent);\n }\n if (this._mediaSourceAdapter) {\n // listen and dispatch adaptive bitrate changed event\n this._eventManager.listen(this._mediaSourceAdapter, _events.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED, function (event) {\n _this2.dispatchEvent(event);\n });\n this._eventManager.listen(this._mediaSourceAdapter, _events.CUSTOM_EVENTS.AUDIO_TRACK_CHANGED, function (event) {\n return _this2.dispatchEvent(event);\n });\n this._eventManager.listen(this._mediaSourceAdapter, _events.CUSTOM_EVENTS.TEXT_TRACK_CHANGED, function (event) {\n return _this2.dispatchEvent(event);\n });\n }\n }\n\n /**\n * Remove the listeners of the video element events.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'detach',\n value: function detach() {\n for (var playerEvent in _events.HTML5_EVENTS) {\n this._eventManager.unlisten(this._el, _events.HTML5_EVENTS[playerEvent]);\n }\n if (this._mediaSourceAdapter) {\n // unlisten to adaptive bitrate changed\n this._eventManager.unlisten(this._mediaSourceAdapter, _events.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED);\n this._eventManager.unlisten(this._mediaSourceAdapter, _events.CUSTOM_EVENTS.AUDIO_TRACK_CHANGED);\n this._eventManager.unlisten(this._mediaSourceAdapter, _events.CUSTOM_EVENTS.TEXT_TRACK_CHANGED);\n }\n }\n\n /**\n * @returns {HTMLVideoElement} - The video element.\n * @public\n */\n\n }, {\n key: 'getVideoElement',\n value: function getVideoElement() {\n return this._el;\n }\n\n /**\n * Creates a video element dom object.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_createVideoElement',\n value: function _createVideoElement() {\n this._el = document.createElement(\"video\");\n //Set attributes\n this._el.style.width = \"640px\";\n this._el.style.height = \"360px\";\n this._el.style.backgroundColor = \"black\";\n this._el.controls = true;\n if (document && document.body) {\n document.body.appendChild(this._el);\n }\n }\n\n /**\n * Loads the appropriate media source extension adapter.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The media source extension configuration.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_loadMediaSourceAdapter',\n value: function _loadMediaSourceAdapter(source, config) {\n this._mediaSourceAdapter = _mediaSourceProvider2.default.getMediaSourceAdapter(this.getVideoElement(), source, config);\n }\n\n /**\n * Select a new video track.\n * @param {VideoTrack} videoTrack - The video track object to set.\n * @returns {void}\n */\n\n }, {\n key: 'selectVideoTrack',\n value: function selectVideoTrack(videoTrack) {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectVideoTrack(videoTrack);\n }\n }\n\n /**\n * Select a new audio track.\n * @param {AudioTrack} audioTrack - The video track object to set.\n * @returns {void}\n */\n\n }, {\n key: 'selectAudioTrack',\n value: function selectAudioTrack(audioTrack) {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectAudioTrack(audioTrack);\n }\n }\n\n /**\n * Select a new text track.\n * @param {TextTrack} textTrack - The text track object to set.\n * @returns {void}\n */\n\n }, {\n key: 'selectTextTrack',\n value: function selectTextTrack(textTrack) {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectTextTrack(textTrack);\n }\n }\n\n /**\n * Enables adaptive bitrate switching according to the media source extension logic.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'enableAdaptiveBitrate',\n value: function enableAdaptiveBitrate() {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.enableAdaptiveBitrate();\n }\n }\n\n /**\n * Set a source.\n * @param {string} source - Source to set.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'play',\n\n\n //playback interface\n /**\n * Start/resume playback.\n * @public\n * @returns {void}\n */\n value: function play() {\n return this._el.play();\n }\n\n /**\n * Pause playback.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'pause',\n value: function pause() {\n return this._el.pause();\n }\n\n /**\n * Load media.\n * @public\n * @returns {Promise<Object>} - The loaded data\n */\n\n }, {\n key: 'load',\n value: function load() {\n return this._mediaSourceAdapter ? this._mediaSourceAdapter.load() : Promise.resolve({});\n }\n\n /**\n * Get the current time in seconds.\n * @returns {Number} - The current playback time.\n * @public\n */\n\n }, {\n key: 'ready',\n value: function ready() {}\n\n /**\n * Get paused state.\n * @returns {boolean} - The paused value of the video element.\n * @public\n */\n\n }, {\n key: 'src',\n set: function set(source) {\n this._el.src = source;\n }\n\n /**\n * Get the source url.\n * @returns {string} - The source url.\n * @public\n */\n ,\n get: function get() {\n if (this._mediaSourceAdapter) {\n return this._mediaSourceAdapter.src;\n }\n return \"\";\n }\n }, {\n key: 'currentTime',\n get: function get() {\n return this._el.currentTime;\n }\n\n /**\n * Set the current time in seconds.\n * @param {Number} to - The number to set in seconds.\n * @public\n * @returns {void}\n */\n ,\n set: function set(to) {\n this._el.currentTime = to;\n }\n\n /**\n * Get the duration in seconds.\n * @returns {Number} - The playback duration.\n * @public\n */\n\n }, {\n key: 'duration',\n get: function get() {\n return this._el.duration;\n }\n\n /**\n * Set playback volume.\n * @param {Number} vol - The volume to set.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'volume',\n set: function set(vol) {\n this._el.volume = vol;\n }\n\n /**\n * Get playback volume.\n * @returns {Number} - The volume value of the video element.\n * @public\n */\n ,\n get: function get() {\n return this._el.volume;\n }\n }, {\n key: 'paused',\n get: function get() {\n return this._el.paused;\n }\n\n /**\n * Get seeking state.\n * @returns {boolean} - The seeking value of the video element.\n * @public\n */\n\n }, {\n key: 'seeking',\n get: function get() {\n return this._el.seeking;\n }\n\n /**\n * Get the first seekable range (part) of the video in seconds.\n * @returns {TimeRanges} - First seekable range (part) of the video in seconds.\n * @public\n */\n\n }, {\n key: 'seekable',\n get: function get() {\n return this._el.seekable;\n }\n\n /**\n * Get the first played range (part) of the video in seconds.\n * @returns {TimeRanges} - First played range (part) of the video in seconds.\n * @public\n */\n\n }, {\n key: 'played',\n get: function get() {\n return this._el.played;\n }\n\n /**\n * Get the first buffered range (part) of the video in seconds.\n * @returns {TimeRanges} - First buffered range (part) of the video in seconds.\n * @public\n */\n\n }, {\n key: 'buffered',\n get: function get() {\n return this._el.buffered;\n }\n\n /**\n * Set player muted state.\n * @param {boolean} mute - The new mute value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'muted',\n set: function set(mute) {\n this._el.muted = mute;\n }\n\n /**\n * Get player muted state.\n * @returns {boolean} - The muted value of the video element.\n * @public\n */\n ,\n get: function get() {\n return this._el.muted;\n }\n\n /**\n * Get the default mute value.\n * @returns {boolean} - The defaultMuted of the video element.\n * @public\n */\n\n }, {\n key: 'defaultMuted',\n get: function get() {\n return this._el.defaultMuted;\n }\n\n /**\n * Sets an image to be shown while the video is downloading, or until the user hits the play button.\n * @param {string} poster - The image url to be shown.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'poster',\n set: function set(poster) {\n this._el.poster = poster;\n }\n\n /**\n * Gets an image to be shown while the video is downloading, or until the user hits the play button.\n * @returns {poster} - The image url.\n * @public\n */\n ,\n get: function get() {\n return this._el.poster;\n }\n\n /**\n * Specifies if and how the author thinks that the video should be loaded when the page loads.\n * @param {string} preload - The preload value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'preload',\n set: function set(preload) {\n this._el.preload = preload;\n }\n\n /**\n * Gets the preload value of the video element.\n * @returns {string} - The preload value.\n * @public\n */\n ,\n get: function get() {\n return this._el.preload;\n }\n\n /**\n * Set if the video will automatically start playing as soon as it can do so without stopping.\n * @param {boolean} autoplay - The autoplay value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'autoplay',\n set: function set(autoplay) {\n this._el.autoplay = autoplay;\n }\n\n /**\n * Gets the autoplay value of the video element.\n * @returns {boolean} - The autoplay value.\n * @public\n */\n ,\n get: function get() {\n return this._el.autoplay;\n }\n\n /**\n * Set to specifies that the video will start over again, every time it is finished.\n * @param {boolean} loop - the loop value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'loop',\n set: function set(loop) {\n this._el.loop = loop;\n }\n\n /**\n * Gets the loop value of the video element.\n * @returns {boolean} - The loop value.\n * @public\n */\n ,\n get: function get() {\n return this._el.loop;\n }\n\n /**\n * Set to specifies that video controls should be displayed.\n * @param {boolean} controls - the controls value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'controls',\n set: function set(controls) {\n this._el.controls = controls;\n }\n\n /**\n * Gets the controls value of the video element.\n * @returns {boolean} - The controls value.\n * @public\n */\n ,\n get: function get() {\n return this._el.controls;\n }\n\n /**\n * Sets the current playback speed of the audio/video.\n * @param {Number} playbackRate - The playback speed value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'playbackRate',\n set: function set(playbackRate) {\n this._el.playbackRate = playbackRate;\n }\n\n /**\n * Gets the current playback speed of the audio/video.\n * @returns {Number} - The current playback speed value.\n * @public\n */\n ,\n get: function get() {\n return this._el.playbackRate;\n }\n\n /**\n * Sets the default playback speed of the audio/video.\n * @param {Number} defaultPlaybackRate - The default playback speed value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'defaultPlaybackRate',\n set: function set(defaultPlaybackRate) {\n this._el.defaultPlaybackRate = defaultPlaybackRate;\n }\n\n /**\n * Gets the default playback speed of the audio/video.\n * @returns {Number} - The default playback speed value.\n * @public\n */\n ,\n get: function get() {\n return this._el.defaultPlaybackRate;\n }\n\n /**\n * The ended property returns whether the playback of the audio/video has ended.\n * @returns {boolean} - The ended value.\n * @public\n */\n\n }, {\n key: 'ended',\n get: function get() {\n return this._el.ended;\n }\n\n /**\n * The error property returns a MediaError object.\n * @returns {MediaError} - The MediaError object has a code property containing the error state of the audio/video.\n * @public\n */\n\n }, {\n key: 'error',\n get: function get() {\n return this._el.error;\n }\n\n /**\n * @returns {Number} - The current network state (activity) of the audio/video.\n * @public\n */\n\n }, {\n key: 'networkState',\n get: function get() {\n return this._el.networkState;\n }\n\n /**\n * Indicates if the audio/video is ready to play or not.\n * @returns {Number} - The current ready state of the audio/video.\n * 0 = HAVE_NOTHING - no information whether or not the audio/video is ready.\n * 1 = HAVE_METADATA - metadata for the audio/video is ready.\n * 2 = HAVE_CURRENT_DATA - data for the current playback position is available, but not enough data to play next frame/millisecond.\n * 3 = HAVE_FUTURE_DATA - data for the current and at least the next frame is available.\n * 4 = HAVE_ENOUGH_DATA - enough data available to start playing.\n */\n\n }, {\n key: 'readyState',\n get: function get() {\n return this._el.readyState;\n }\n\n /**\n * @returns {Number} - The height of the video player, in pixels.\n * @public\n */\n\n }, {\n key: 'videoHeight',\n get: function get() {\n return this._el.videoHeight;\n }\n\n /**\n * @returns {Number} - The width of the video player, in pixels.\n * @public\n */\n\n }, {\n key: 'videoWidth',\n get: function get() {\n return this._el.videoWidth;\n }\n\n /**\n * Test video element to check if html5 engine is supported.\n */\n\n }], [{\n key: 'isSupported',\n\n\n /**\n * Checks if the html5 engine is supported.\n * @returns {boolean} - The isSupported result.\n * @static\n * @public\n */\n value: function isSupported() {\n try {\n Html5.TEST_VID = document.createElement('video');\n Html5.TEST_VID.volume = 0.5;\n } catch (e) {\n return false;\n }\n return !!Html5.TEST_VID.canPlayType;\n }\n }]);\n\n return Html5;\n}(_fakeEventTarget2.default);\n\nHtml5.EngineName = \"html5\";\nexports.default = Html5;\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _get = function get(object, property, receiver) { 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 { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\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 _eventManager = __webpack_require__(6);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _events = __webpack_require__(7);\n\nvar _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\n\nvar _videoTrack = __webpack_require__(5);\n\nvar _videoTrack2 = _interopRequireDefault(_videoTrack);\n\nvar _audioTrack = __webpack_require__(3);\n\nvar _audioTrack2 = _interopRequireDefault(_audioTrack);\n\nvar _textTrack = __webpack_require__(4);\n\nvar _textTrack2 = _interopRequireDefault(_textTrack);\n\nvar _baseMediaSourceAdapter = __webpack_require__(12);\n\nvar _baseMediaSourceAdapter2 = _interopRequireDefault(_baseMediaSourceAdapter);\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\n/**\n * An illustration of media source extension for progressive download\n * @classdesc\n * @implements {IMediaSourceAdapter}\n */\nvar NativeAdapter = function (_BaseMediaSourceAdapt) {\n _inherits(NativeAdapter, _BaseMediaSourceAdapt);\n\n _createClass(NativeAdapter, null, [{\n key: 'canPlayType',\n\n\n /**\n * Checks if NativeAdapter can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @returns {boolean} - Whether the native adapter can play a specific mime type\n * @static\n */\n\n /**\n * The event manager of the class.\n * @member {EventManager} - _eventManager\n * @type {EventManager}\n * @private\n */\n\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n\n /**\n * The id of the Adapter\n * @member {string} id\n * @static\n * @public\n */\n value: function canPlayType(mimeType) {\n var canPlayType = typeof mimeType === 'string' ? !!document.createElement(\"video\").canPlayType(mimeType.toLowerCase()) : false;\n NativeAdapter._logger.debug('canPlayType result for mimeType:' + mimeType + ' is ' + canPlayType.toString());\n return canPlayType;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to NativeAdapter\n * @param {Source} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n\n\n /**\n * The adapter logger\n * @member {any} _logger\n * @private\n * @static\n */\n\n }]);\n\n function NativeAdapter(videoElement, source, config) {\n _classCallCheck(this, NativeAdapter);\n\n NativeAdapter._logger.debug('Creating adapter');\n\n var _this = _possibleConstructorReturn(this, (NativeAdapter.__proto__ || Object.getPrototypeOf(NativeAdapter)).call(this, videoElement, source, config));\n\n _this._eventManager = new _eventManager2.default();\n return _this;\n }\n\n /**\n * Load the video source\n * @function load\n * @returns {Promise<Object>} - The loaded data\n */\n\n\n _createClass(NativeAdapter, [{\n key: 'load',\n value: function load() {\n var _this2 = this;\n\n if (!this._loadPromise) {\n this._loadPromise = new Promise(function (resolve, reject) {\n // We're using 'loadeddata' event for native hls (on 'loadedmetadata' native hls doesn't have tracks yet).\n _this2._eventManager.listen(_this2._videoElement, _events.HTML5_EVENTS.LOADED_DATA, function () {\n _this2._eventManager.unlisten(_this2._videoElement, _events.HTML5_EVENTS.LOADED_DATA);\n var data = { tracks: _this2._getParsedTracks() };\n NativeAdapter._logger.debug('The source has been loaded successfully');\n resolve(data);\n });\n _this2._eventManager.listen(_this2._videoElement, _events.HTML5_EVENTS.ERROR, function (error) {\n _this2._eventManager.unlisten(_this2._videoElement, _events.HTML5_EVENTS.ERROR);\n NativeAdapter._logger.error(error);\n reject(error);\n });\n if (_this2._sourceObj && _this2._sourceObj.url) {\n _this2._videoElement.src = _this2._sourceObj.url;\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroys the native adapter.\n * @function destroy\n * @returns {void}\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n NativeAdapter._logger.debug('destroy');\n _get(NativeAdapter.prototype.__proto__ || Object.getPrototypeOf(NativeAdapter.prototype), 'destroy', this).call(this);\n this._eventManager.destroy();\n this._loadPromise = null;\n }\n\n /**\n * Get the parsed tracks\n * @function _getParsedTracks\n * @returns {Array<Track>} - The parsed tracks\n * @private\n */\n\n }, {\n key: '_getParsedTracks',\n value: function _getParsedTracks() {\n var videoTracks = this._getParsedVideoTracks();\n var audioTracks = this._getParsedAudioTracks();\n var textTracks = this._getParsedTextTracks();\n return videoTracks.concat(audioTracks).concat(textTracks);\n }\n\n /**\n * Get the parsed video tracks\n * @function _getParsedVideoTracks\n * @returns {Array<Track>} - The parsed video tracks\n * @private\n */\n\n }, {\n key: '_getParsedVideoTracks',\n value: function _getParsedVideoTracks() {\n var videoTracks = this._videoElement.videoTracks;\n var parsedTracks = [];\n if (videoTracks) {\n for (var i = 0; i < videoTracks.length; i++) {\n var settings = {\n id: videoTracks[i].id,\n active: videoTracks[i].selected,\n label: videoTracks[i].label,\n language: videoTracks[i].language,\n index: i\n };\n parsedTracks.push(new _videoTrack2.default(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed audio tracks\n * @function _getParsedAudioTracks\n * @returns {Array<Track>} - The parsed audio tracks\n * @private\n */\n\n }, {\n key: '_getParsedAudioTracks',\n value: function _getParsedAudioTracks() {\n var audioTracks = this._videoElement.audioTracks;\n var parsedTracks = [];\n if (audioTracks) {\n for (var i = 0; i < audioTracks.length; i++) {\n var settings = {\n id: audioTracks[i].id,\n active: audioTracks[i].enabled,\n label: audioTracks[i].label,\n language: audioTracks[i].language,\n index: i\n };\n parsedTracks.push(new _audioTrack2.default(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed text tracks\n * @function _getParsedTextTracks\n * @returns {Array<Track>} - The parsed text tracks\n * @private\n */\n\n }, {\n key: '_getParsedTextTracks',\n value: function _getParsedTextTracks() {\n var textTracks = this._videoElement.textTracks;\n var parsedTracks = [];\n if (textTracks) {\n for (var i = 0; i < textTracks.length; i++) {\n var settings = {\n kind: textTracks[i].kind,\n active: textTracks[i].mode === 'showing',\n label: textTracks[i].label,\n language: textTracks[i].language,\n index: i\n };\n parsedTracks.push(new _textTrack2.default(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Select a video track\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectVideoTrack',\n value: function selectVideoTrack(videoTrack) {\n var videoTracks = this._videoElement.videoTracks;\n if (videoTrack instanceof _videoTrack2.default && videoTracks && videoTracks[videoTrack.index]) {\n this._disableVideoTracks();\n videoTracks[videoTrack.index].selected = true;\n this._onTrackChanged(videoTrack);\n }\n }\n\n /**\n * Select an audio track\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectAudioTrack',\n value: function selectAudioTrack(audioTrack) {\n var audioTracks = this._videoElement.audioTracks;\n if (audioTrack instanceof _audioTrack2.default && audioTracks && audioTracks[audioTrack.index]) {\n this._disableAudioTracks();\n audioTracks[audioTrack.index].enabled = true;\n this._onTrackChanged(audioTrack);\n }\n }\n\n /**\n * Select a text track\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectTextTrack',\n value: function selectTextTrack(textTrack) {\n var textTracks = this._videoElement.textTracks;\n if (textTrack instanceof _textTrack2.default && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions') && textTracks && textTracks[textTrack.index]) {\n this._disableTextTracks();\n textTracks[textTrack.index].mode = 'showing';\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Enables adaptive bitrate\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'enableAdaptiveBitrate',\n value: function enableAdaptiveBitrate() {\n NativeAdapter._logger.debug('Enabling adaptive bitrate not supported');\n }\n\n /**\n * Disables all the existing video tracks.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_disableVideoTracks',\n value: function _disableVideoTracks() {\n var videoTracks = this._videoElement.videoTracks;\n if (videoTracks) {\n for (var i = 0; i < videoTracks.length; i++) {\n videoTracks[i].selected = false;\n }\n }\n }\n\n /**\n * Disables all the existing audio tracks.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_disableAudioTracks',\n value: function _disableAudioTracks() {\n var audioTracks = this._videoElement.audioTracks;\n if (audioTracks) {\n for (var i = 0; i < audioTracks.length; i++) {\n audioTracks[i].enabled = false;\n }\n }\n }\n\n /**\n * Disables all the existing text tracks.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_disableTextTracks',\n value: function _disableTextTracks() {\n var textTracks = this._videoElement.textTracks;\n if (textTracks) {\n for (var i = 0; i < textTracks.length; i++) {\n textTracks[i].mode = 'disabled';\n }\n }\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * @public\n * @returns {string} - The src url.\n */\n\n }, {\n key: 'src',\n get: function get() {\n return this._videoElement.src;\n }\n }]);\n\n return NativeAdapter;\n}(_baseMediaSourceAdapter2.default);\n\nNativeAdapter.id = 'NativeAdapter';\nNativeAdapter._logger = _baseMediaSourceAdapter2.default.getLogger(NativeAdapter.id);\nexports.default = NativeAdapter;\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.VERSION = exports.TextTrack = exports.AudioTrack = exports.VideoTrack = exports.Track = exports.BasePlugin = exports.registerPlugin = exports.BaseMediaSourceAdapter = exports.registerMediaSourceAdapter = undefined;\nexports.playkit = playkit;\n\nvar _player = __webpack_require__(8);\n\nvar _player2 = _interopRequireDefault(_player);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _package = __webpack_require__(18);\n\nvar packageData = _interopRequireWildcard(_package);\n\nvar _baseMediaSourceAdapter = __webpack_require__(12);\n\nvar _baseMediaSourceAdapter2 = _interopRequireDefault(_baseMediaSourceAdapter);\n\nvar _mediaSourceProvider = __webpack_require__(13);\n\nvar _pluginManager = __webpack_require__(15);\n\nvar _basePlugin = __webpack_require__(14);\n\nvar _basePlugin2 = _interopRequireDefault(_basePlugin);\n\nvar _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\n\nvar _videoTrack = __webpack_require__(5);\n\nvar _videoTrack2 = _interopRequireDefault(_videoTrack);\n\nvar _audioTrack = __webpack_require__(3);\n\nvar _audioTrack2 = _interopRequireDefault(_audioTrack);\n\nvar _textTrack = __webpack_require__(4);\n\nvar _textTrack2 = _interopRequireDefault(_textTrack);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Playkit version\nvar VERSION = packageData.version;\n\n\n_logger2.default.getLogger().log(\"%c Playkit \" + VERSION, \"color: yellow; font-size: large\");\n_logger2.default.getLogger().log(\"%c For more details see https://github.com/kaltura/playkit-js\", \"color: yellow;\");\n\n/**\n * @param {Object} config - The configuration of the player\n * @returns {Player} - The player instance\n */\nfunction playkit() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n return new _player2.default(config);\n}\n\n// Export the media source adapters necessary utils\nexports.registerMediaSourceAdapter = _mediaSourceProvider.registerMediaSourceAdapter;\nexports.BaseMediaSourceAdapter = _baseMediaSourceAdapter2.default;\n\n// Export the plugin framework\n\nexports.registerPlugin = _pluginManager.registerPlugin;\nexports.BasePlugin = _basePlugin2.default;\n\n// Export the tracks classes\n\nexports.Track = _track2.default;\nexports.VideoTrack = _videoTrack2.default;\nexports.AudioTrack = _audioTrack2.default;\nexports.TextTrack = _textTrack2.default;\n\n//export version\n\nexports.VERSION = VERSION;\nexports.default = playkit;\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _player = __webpack_require__(8);\n\nvar _player2 = _interopRequireDefault(_player);\n\nvar _eventManager = __webpack_require__(6);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _state = __webpack_require__(23);\n\nvar _state2 = _interopRequireDefault(_state);\n\nvar _stateTypes = __webpack_require__(16);\n\nvar _stateTypes2 = _interopRequireDefault(_stateTypes);\n\nvar _events = __webpack_require__(7);\n\nvar _fakeEvent = __webpack_require__(2);\n\nvar _fakeEvent2 = _interopRequireDefault(_fakeEvent);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * This class responsible to manage all the state machine of the player.\n * @classdesc\n */\n\n\n/**\n * Define a transition object.\n */\nvar StateManager = function () {\n\n /**\n * @constructor\n * @param {Player} player - Reference to the player.\n */\n\n /**\n * Holds the state history of the player.\n * @member\n * @type {Array<State>}\n * @private\n */\n\n /**\n * Holds the current state of the player.\n * @member\n * @type {State}\n * @private\n */\n\n /**\n * Reference to the actual player.\n * @member\n * @type {Player}\n * @private\n */\n function StateManager(player) {\n var _this = this,\n _PlayerStates$IDLE,\n _PlayerStates$LOADING,\n _PlayerStates$PAUSED,\n _PlayerStates$PLAYING,\n _PlayerStates$BUFFERI,\n _transitions;\n\n _classCallCheck(this, StateManager);\n\n this._transitions = (_transitions = {}, _defineProperty(_transitions, _stateTypes2.default.IDLE, (_PlayerStates$IDLE = {}, _defineProperty(_PlayerStates$IDLE, _events.HTML5_EVENTS.LOAD_START, function () {\n _this._updateState(_stateTypes2.default.LOADING);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$IDLE, _events.HTML5_EVENTS.PLAY, function () {\n _this._updateState(_stateTypes2.default.BUFFERING);\n _this._dispatchEvent();\n }), _PlayerStates$IDLE)), _defineProperty(_transitions, _stateTypes2.default.LOADING, (_PlayerStates$LOADING = {}, _defineProperty(_PlayerStates$LOADING, _events.HTML5_EVENTS.LOADED_METADATA, function () {\n if (_this._player.config.autoPlay) {\n _this._updateState(_stateTypes2.default.PLAYING);\n } else {\n _this._updateState(_stateTypes2.default.PAUSED);\n }\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$LOADING, _events.HTML5_EVENTS.ERROR, function () {\n _this._updateState(_stateTypes2.default.IDLE);\n _this._dispatchEvent();\n }), _PlayerStates$LOADING)), _defineProperty(_transitions, _stateTypes2.default.PAUSED, (_PlayerStates$PAUSED = {}, _defineProperty(_PlayerStates$PAUSED, _events.HTML5_EVENTS.PLAY, function () {\n _this._updateState(_stateTypes2.default.PLAYING);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$PAUSED, _events.HTML5_EVENTS.PLAYING, function () {\n _this._updateState(_stateTypes2.default.PLAYING);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$PAUSED, _events.HTML5_EVENTS.ENDED, function () {\n _this._updateState(_stateTypes2.default.IDLE);\n _this._dispatchEvent();\n }), _PlayerStates$PAUSED)), _defineProperty(_transitions, _stateTypes2.default.PLAYING, (_PlayerStates$PLAYING = {}, _defineProperty(_PlayerStates$PLAYING, _events.HTML5_EVENTS.PAUSE, function () {\n _this._updateState(_stateTypes2.default.PAUSED);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$PLAYING, _events.HTML5_EVENTS.WAITING, function () {\n _this._updateState(_stateTypes2.default.BUFFERING);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$PLAYING, _events.HTML5_EVENTS.ENDED, function () {\n _this._updateState(_stateTypes2.default.IDLE);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$PLAYING, _events.HTML5_EVENTS.ERROR, function () {\n _this._updateState(_stateTypes2.default.IDLE);\n _this._dispatchEvent();\n }), _PlayerStates$PLAYING)), _defineProperty(_transitions, _stateTypes2.default.BUFFERING, (_PlayerStates$BUFFERI = {}, _defineProperty(_PlayerStates$BUFFERI, _events.HTML5_EVENTS.PLAYING, function () {\n _this._updateState(_stateTypes2.default.PLAYING);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$BUFFERI, _events.HTML5_EVENTS.PAUSE, function () {\n _this._updateState(_stateTypes2.default.PAUSED);\n _this._dispatchEvent();\n }), _PlayerStates$BUFFERI)), _transitions);\n\n this._player = player;\n this._logger = _logger2.default.getLogger(\"StateManager\");\n this._eventManager = new _eventManager2.default();\n this._history = [];\n this._prevState = null;\n this._curState = new _state2.default(_stateTypes2.default.IDLE);\n this._attachListeners();\n }\n\n /**\n * Register to all necessary events which impacts on the player state.\n * @private\n * @returns {void}\n */\n\n /**\n * The possible transitions from one state to another.\n * @type {Array<Transition>}\n * @private\n */\n\n /**\n * Holds the previous state of the player.\n * @member\n * @type {State | null}\n * @private\n */\n\n /**\n * The event manager of the class.\n * @member\n * @type {EventManager}\n * @private\n */\n\n /**\n * The logger of the class.\n * @member\n * @type {any}\n * @private\n */\n\n\n _createClass(StateManager, [{\n key: '_attachListeners',\n value: function _attachListeners() {\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.ERROR, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.ENDED, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.PLAY, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.LOAD_START, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.PLAYING, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.LOADED_METADATA, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.PAUSE, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.WAITING, this._doTransition.bind(this));\n }\n\n /**\n * Performs a state transition depends on the event which occurs in the player system.\n * @param {FakeEvent} event - The event occurs in the player system.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_doTransition',\n value: function _doTransition(event) {\n this._logger.debug('Do transition request', event);\n var transition = this._transitions[this._curState.type];\n if (typeof transition[event.type] === 'function') {\n transition[event.type]();\n }\n }\n\n /**\n * Updates the player's state.\n * @param {string} type - The type of the new state.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_updateState',\n value: function _updateState(type) {\n if (this._curState.type !== type) {\n this._curState.duration = Date.now() / 1000;\n this._history.push(this._curState);\n this._prevState = this._curState;\n this._curState = new _state2.default(type);\n this._logger.debug('Switch player state: from ' + this._prevState.type + ' to ' + this._curState.type);\n }\n }\n\n /**\n * Fires the playerStateChanged event after state has been changed.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_dispatchEvent',\n value: function _dispatchEvent() {\n var event = new _fakeEvent2.default(_events.CUSTOM_EVENTS.PLAYER_STATE_CHANGED, {\n 'oldState': this._prevState,\n 'newState': this._curState\n });\n this._player.dispatchEvent(event);\n }\n\n /**\n * Destroys the state manager.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this._history = [];\n this._eventManager.destroy();\n }\n\n /**\n * Getter to the current state of the player.\n * @public\n * @returns {State} - The current state object\n */\n\n }, {\n key: 'currentState',\n get: function get() {\n return this._curState;\n }\n\n /**\n * Getter to the previous state of the player.\n * @public\n * @returns {State|null} - The previous state object, or null if such doesn't exists\n */\n\n }, {\n key: 'previousState',\n get: function get() {\n return this._prevState;\n }\n\n /**\n * Getter to the state history of the player.\n * @public\n * @returns {Array.<State>} - The full states history objects\n */\n\n }, {\n key: 'history',\n get: function get() {\n return this._history;\n }\n }]);\n\n return StateManager;\n}();\n\nexports.default = StateManager;\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 * This class describes a player state.\n * @classdesc\n */\nvar State = function () {\n\n /**\n * @constructor\n * @param {string} type - The type of the state.\n */\n\n /**\n * The duration that the player was in this state.\n * @member\n * @type {number}\n * @private\n */\n function State(type) {\n _classCallCheck(this, State);\n\n this.type = type;\n this._duration = 0;\n this._timestamp = Date.now() / 1000;\n }\n\n /**\n * Getter for the duration of the state.\n * @returns {number} - The duration of the state\n */\n\n /**\n * The timestamp that this state started.\n * @member\n * @type {number}\n * @private\n */\n\n /**\n * The type of the state.\n * Can be one of those describes in states.js\n * @member\n * @type {string}\n * @public\n */\n\n\n _createClass(State, [{\n key: \"duration\",\n get: function get() {\n return this._duration;\n }\n\n /**\n * Setter for the duration of the state.\n * @param {number} endTime - The timestamp of the next state.\n */\n ,\n set: function set(endTime) {\n this._duration = endTime - this._timestamp;\n }\n }]);\n\n return State;\n}();\n\nexports.default = State;\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar TRACK_TYPES = {\n VIDEO: \"video\",\n AUDIO: \"audio\",\n TEXT: \"text\"\n};\n\nexports.default = TRACK_TYPES;\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (true) {\r\n\t\t!(__WEBPACK_AMD_DEFINE_FACTORY__ = (Logger),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n/***/ })\n/******/ ]);\n});\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.PlaykitUI = exports.OvpProvider = exports.Playkit = undefined;\n\nvar _playkitJs = __webpack_require__(0);\n\nvar Playkit = _interopRequireWildcard(_playkitJs);\n\nvar _ovpProvider = __webpack_require__(2);\n\nvar _ovpProvider2 = _interopRequireDefault(_ovpProvider);\n\nvar _playkitJsUi = __webpack_require__(3);\n\nvar _playkitJsUi2 = _interopRequireDefault(_playkitJsUi);\n\n__webpack_require__(4);\n\n__webpack_require__(9);\n\n__webpack_require__(11);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n// TODO: Import plugins\n\n// Import media source adapters\n\n\n// Import UI\n\n\n// Import core\nexports.Playkit = Playkit;\nexports.OvpProvider = _ovpProvider2.default;\nexports.PlaykitUI = _playkitJsUi2.default;\n\n// Import OVP and OTT providers\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\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[\"PlaykitJsProviders\"] = factory();\n\telse\n\t\troot[\"PlaykitJsProviders\"] = 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/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\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.l = 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// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 24);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 && obj !== Symbol.prototype ? \"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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Request builder\n * @classdesc\n */\nvar RequestBuilder = function () {\n\n /**\n * @constructor\n * @param {Map<string, string>} headers The request headers\n */\n\n /**\n * @member - Service method (POST,GET,DELETE etc..)\n * @type {string}\n */\n\n /**\n * @member - Service headers\n * @type {Map<string, string>}\n */\n\n /**\n * @member - Service action\n * @type {string}\n */\n function RequestBuilder() {\n var headers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Map();\n\n _classCallCheck(this, RequestBuilder);\n\n this.headers = headers;\n this.headers.set(\"Content-Type\", \"application/json\");\n }\n\n /**\n * Builds restful service URL\n * @function getUrl\n * @returns {string} The service URL\n */\n\n /**\n * @member - Service tag\n * @type {string}\n */\n\n /**\n * @member - Service base url\n * @type {Map<string, string>}\n */\n\n /**\n * @member - Service params\n * @type {any}\n */\n\n\n /**\n * @member - Service name\n * @type {string}\n */\n\n\n _createClass(RequestBuilder, [{\n key: \"getUrl\",\n value: function getUrl() {\n if (!this.baseUrl) {\n throw new Error(\"baseUrl is mandatory for request builder\");\n }\n var url = this.baseUrl + '/service/' + this.service + (this.action ? '/action/' + this.action : '');\n return url;\n }\n\n /**\n * Executes service\n * @function doHttpRequest\n * @returns {Promise.<any>} Service response as promise\n */\n\n }, {\n key: \"doHttpRequest\",\n value: function doHttpRequest() {\n var _this = this;\n\n var request = new XMLHttpRequest();\n return new Promise(function (resolve, reject) {\n request.onreadystatechange = function () {\n if (request.readyState === 4) {\n if (request.status === 200) {\n var jsonResponse = JSON.parse(request.responseText);\n if (jsonResponse && (typeof jsonResponse === \"undefined\" ? \"undefined\" : _typeof(jsonResponse)) === 'object' && jsonResponse.code && jsonResponse.message) reject(jsonResponse);else resolve(jsonResponse);\n } else {\n reject(request.responseText);\n }\n }\n };\n request.open(_this.method, _this.getUrl());\n _this.headers.forEach(function (value, key) {\n request.setRequestHeader(key, value);\n });\n request.send(_this.params);\n });\n }\n }]);\n\n return RequestBuilder;\n}();\n\nexports.default = RequestBuilder;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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\nvar defaultConfig = {\n beUrl: \"http://www.kaltura.com/api_v3\",\n baseUrl: \"https://cdnapisec.kaltura.com\",\n serviceParams: {\n clientTag: \"playkit-js\",\n apiVersion: '3.3.0',\n format: 1\n }\n};\n\nvar Configuration = function () {\n function Configuration() {\n _classCallCheck(this, Configuration);\n }\n\n _createClass(Configuration, null, [{\n key: \"set\",\n value: function set(clientConfig) {\n if (clientConfig) {\n Object.assign(defaultConfig, clientConfig);\n }\n }\n }, {\n key: \"get\",\n value: function get() {\n return defaultConfig;\n }\n }]);\n\n return Configuration;\n}();\n\nexports.default = Configuration;\nexports.Configuration = Configuration;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.UIConfCreationMode = exports.UIConfType = exports.MediaEntryType = exports.MediaType = exports.EntryType = exports.EntryModerationStatus = exports.EntryStatus = exports.MetadataStatus = exports.MetadataObjectType = exports.Status = exports.KalturaRuleActionType = exports.Scheme = undefined;\n\nvar _enumify = __webpack_require__(16);\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\nvar Scheme = exports.Scheme = function (_Enum) {\n _inherits(Scheme, _Enum);\n\n function Scheme() {\n _classCallCheck(this, Scheme);\n\n return _possibleConstructorReturn(this, (Scheme.__proto__ || Object.getPrototypeOf(Scheme)).apply(this, arguments));\n }\n\n return Scheme;\n}(_enumify.Enum);\n\nScheme.initEnum({\n PLAYREADY_CENC: \"drm.PLAYREADY_CENC\",\n WIDEVINE_CENC: \"drm.WIDEVINE_CENC\",\n FAIRPLAY: \"fairplay.FAIRPLAY\",\n PLAYREADY: \"playReady.PLAYREADY\",\n WIDEVINE: \"widevine.WIDEVINE\"\n});\n\nvar KalturaRuleActionType = exports.KalturaRuleActionType = function (_Enum2) {\n _inherits(KalturaRuleActionType, _Enum2);\n\n function KalturaRuleActionType() {\n _classCallCheck(this, KalturaRuleActionType);\n\n return _possibleConstructorReturn(this, (KalturaRuleActionType.__proto__ || Object.getPrototypeOf(KalturaRuleActionType)).apply(this, arguments));\n }\n\n return KalturaRuleActionType;\n}(_enumify.Enum);\n\nKalturaRuleActionType.initEnum({\n DRM_POLICY: \"drm.DRM_POLICY\",\n BLOCK: 1,\n PREVIEW: 2,\n LIMIT_FLAVORS: 3,\n ADD_TO_STORAGE: 4,\n LIMIT_DELIVERY_PROFILES: 5,\n SERVE_FROM_REMOTE_SERVER: 6,\n REQUEST_HOST_REGEX: 7,\n LIMIT_THUMBNAIL_CAPTURE: 8\n});\n\nvar Status = exports.Status = function (_Enum3) {\n _inherits(Status, _Enum3);\n\n function Status() {\n _classCallCheck(this, Status);\n\n return _possibleConstructorReturn(this, (Status.__proto__ || Object.getPrototypeOf(Status)).apply(this, arguments));\n }\n\n return Status;\n}(_enumify.Enum);\n\nStatus.initEnum({\n ERROR: -1,\n QUEUED: 0,\n CONVERTING: 1,\n READY: 2,\n DELETED: 3,\n NOT_APPLICABLE: 4,\n TEMP: 5,\n WAIT_FOR_CONVERT: 6,\n IMPORTING: 7,\n VALIDATING: 8,\n EXPORTING: 9\n});\n\nvar MetadataObjectType = exports.MetadataObjectType = function (_Enum4) {\n _inherits(MetadataObjectType, _Enum4);\n\n function MetadataObjectType() {\n _classCallCheck(this, MetadataObjectType);\n\n return _possibleConstructorReturn(this, (MetadataObjectType.__proto__ || Object.getPrototypeOf(MetadataObjectType)).apply(this, arguments));\n }\n\n return MetadataObjectType;\n}(_enumify.Enum);\n\nMetadataObjectType.initEnum({\n AD_CUE_POINT: \"adCuePointMetadata.AdCuePoint\",\n ANNOTATION: \"annotationMetadata.Annotation\",\n CODE_CUE_POINT: \"codeCuePointMetadata.CodeCuePoint\",\n THUMB_CUE_POINT: \"thumbCuePointMetadata.thumbCuePoint\",\n ENTRY: 1,\n CATEGORY: 2,\n USER: 3,\n PARTNER: 4,\n DYNAMIC_OBJECT: 5\n});\n\nvar MetadataStatus = exports.MetadataStatus = function (_Enum5) {\n _inherits(MetadataStatus, _Enum5);\n\n function MetadataStatus() {\n _classCallCheck(this, MetadataStatus);\n\n return _possibleConstructorReturn(this, (MetadataStatus.__proto__ || Object.getPrototypeOf(MetadataStatus)).apply(this, arguments));\n }\n\n return MetadataStatus;\n}(_enumify.Enum);\n\nMetadataStatus.initEnum({\n VALID: 1,\n INVALID: 2,\n DELETED: 3\n});\n\nvar EntryStatus = exports.EntryStatus = function (_Enum6) {\n _inherits(EntryStatus, _Enum6);\n\n function EntryStatus() {\n _classCallCheck(this, EntryStatus);\n\n return _possibleConstructorReturn(this, (EntryStatus.__proto__ || Object.getPrototypeOf(EntryStatus)).apply(this, arguments));\n }\n\n return EntryStatus;\n}(_enumify.Enum);\n\nEntryStatus.initEnum({\n ERROR_IMPORTING: -2,\n ERROR_CONVERTING: -1,\n SCAN_FAILURE: \"virusScan.ScanFailure\",\n IMPORT: 0,\n INFECTED: \"virusScan.Infected\",\n PRECONVERT: 1,\n READY: 2,\n DELETED: 3,\n PENDING: 4,\n MODERATE: 5,\n BLOCKED: 6,\n NO_CONTENT: 7\n});\n\nvar EntryModerationStatus = exports.EntryModerationStatus = function (_Enum7) {\n _inherits(EntryModerationStatus, _Enum7);\n\n function EntryModerationStatus() {\n _classCallCheck(this, EntryModerationStatus);\n\n return _possibleConstructorReturn(this, (EntryModerationStatus.__proto__ || Object.getPrototypeOf(EntryModerationStatus)).apply(this, arguments));\n }\n\n return EntryModerationStatus;\n}(_enumify.Enum);\n\nEntryModerationStatus.initEnum({\n PENDING_MODERATION: 1,\n APPROVED: 2,\n REJECTED: 3,\n FLAGGED_FOR_REVIEW: 4,\n MODERATE: 5,\n AUTO_APPROVED: 6\n});\n\nvar EntryType = exports.EntryType = function (_Enum8) {\n _inherits(EntryType, _Enum8);\n\n function EntryType() {\n _classCallCheck(this, EntryType);\n\n return _possibleConstructorReturn(this, (EntryType.__proto__ || Object.getPrototypeOf(EntryType)).apply(this, arguments));\n }\n\n return EntryType;\n}(_enumify.Enum);\n\nEntryType.initEnum({\n AUTOMATIC: { value: -1 },\n EXTERNAL_MEDIA: { value: \"externalMedia.externalMedia\" },\n MEDIA_CLIP: { value: 1 },\n MIX: { value: 2 },\n PLAYLIST: { value: 5 },\n DATA: { value: 6 },\n LIVE_STREAM: { value: 7 },\n LIVE_CHANNEL: { value: 8 },\n DOCUMENT: { value: 10 }\n});\n\nvar MediaType = exports.MediaType = function (_Enum9) {\n _inherits(MediaType, _Enum9);\n\n function MediaType() {\n _classCallCheck(this, MediaType);\n\n return _possibleConstructorReturn(this, (MediaType.__proto__ || Object.getPrototypeOf(MediaType)).apply(this, arguments));\n }\n\n return MediaType;\n}(_enumify.Enum);\n\nMediaType.initEnum({\n VIDEO: { value: 1 },\n IMAGE: { value: 2 },\n AUDIO: { value: 5 },\n LIVE_STREAM_FLASH: { value: 201 },\n LIVE_STREAM_WINDOWS_MEDIA: { value: 202 },\n LIVE_STREAM_REAL_MEDIA: { value: 203 },\n LIVE_STREAM_QUICKTIME: { value: 204 }\n});\n\nvar MediaEntryType = exports.MediaEntryType = function (_Enum10) {\n _inherits(MediaEntryType, _Enum10);\n\n function MediaEntryType() {\n _classCallCheck(this, MediaEntryType);\n\n return _possibleConstructorReturn(this, (MediaEntryType.__proto__ || Object.getPrototypeOf(MediaEntryType)).apply(this, arguments));\n }\n\n return MediaEntryType;\n}(_enumify.Enum);\n\nMediaEntryType.initEnum(['Vod', 'Live', 'Image', 'Audio', 'Unknown']);\n\nvar UIConfType = exports.UIConfType = function (_Enum11) {\n _inherits(UIConfType, _Enum11);\n\n function UIConfType() {\n _classCallCheck(this, UIConfType);\n\n return _possibleConstructorReturn(this, (UIConfType.__proto__ || Object.getPrototypeOf(UIConfType)).apply(this, arguments));\n }\n\n return UIConfType;\n}(_enumify.Enum);\n\nUIConfType.initEnum({\n PLAYER: 1,\n CONTRIBUTION_WIZARD: 2,\n SIMPLE_EDITOR: 3,\n ADVANCED_EDITOR: 4,\n PLAYLIST: 5,\n APP_STUDIO: 6,\n KRECORD: 7,\n PLAYER_V3: 8,\n KMC_ACCOUNT: 9,\n KMC_ANALYTICS: 10,\n KMC_CONTENT: 11,\n KMC_DASHBOARD: 12,\n KMC_LOGIN: 13,\n PLAYER_SL: 14,\n CLIENTSIDE_ENCODER: 15,\n KMC_GENERAL: 16,\n KMC_ROLES_AND_PERMISSIONS: 17,\n CLIPPER: 18,\n KSR: 19,\n KUPLOAD: 20,\n WEBCASTING: 21\n});\n\nvar UIConfCreationMode = exports.UIConfCreationMode = function (_Enum12) {\n _inherits(UIConfCreationMode, _Enum12);\n\n function UIConfCreationMode() {\n _classCallCheck(this, UIConfCreationMode);\n\n return _possibleConstructorReturn(this, (UIConfCreationMode.__proto__ || Object.getPrototypeOf(UIConfCreationMode)).apply(this, arguments));\n }\n\n return UIConfCreationMode;\n}(_enumify.Enum);\n\nUIConfCreationMode.initEnum({\n WIZARD: 2,\n ADVANCED: 3\n});\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _multiRequestBuilder = __webpack_require__(6);\n\nvar _multiRequestBuilder2 = _interopRequireDefault(_multiRequestBuilder);\n\nvar _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\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 config = _config2.default.get();\nvar SERVICE_NAME = \"multirequest\";\n\n/**\n * Base for all ovp services\n * @classdesc\n */\n\nvar OvpService = function () {\n function OvpService() {\n _classCallCheck(this, OvpService);\n }\n\n _createClass(OvpService, null, [{\n key: 'getMultirequest',\n\n /**\n * Gets a new instance of MultiRequestBuilder with ovp params\n * @function getMultirequest\n * @param {string} ks The ks\n * @param {string} partnerId The partner ID\n * @returns {MultiRequestBuilder} The multi request builder\n * @static\n */\n value: function getMultirequest(ks, partnerId) {\n var ovpParams = config.serviceParams;\n Object.assign(ovpParams, { ks: ks });\n if (partnerId) {\n Object.assign(ovpParams, { partnerId: partnerId });\n }\n var multiReq = new _multiRequestBuilder2.default();\n multiReq.method = \"POST\";\n multiReq.service = SERVICE_NAME;\n multiReq.baseUrl = config.beUrl;\n multiReq.params = ovpParams;\n return multiReq;\n }\n }]);\n\n return OvpService;\n}();\n\nexports.default = OvpService;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Base service result\n * @classdesc\n */\nvar ServiceResult =\n\n/**\n * @constructor\n * @param {Object} response - Service response\n */\n\n/**\n * @member - The service error\n * @type {ServiceError}\n */\n\n/**\n * @member - The service result data\n * @type {Object}\n */\nfunction ServiceResult(response) {\n _classCallCheck(this, ServiceResult);\n\n this.hasError = false;\n\n if (response.objectType === \"KalturaAPIException\") {\n this.hasError = true;\n this.error = new ServiceError(response.code, response.message);\n } else {\n this.data = response;\n }\n}\n\n/**\n * @member - Is service returned an error\n * @type {boolean}\n */\n;\n\n/**\n * Service error\n * @classdesc\n */\n\n\nexports.default = ServiceResult;\n\nvar ServiceError =\n\n/**\n * @constructor\n * @param {string} code - The result code\n * @param {string} message - The result message\n */\n\n/**\n * @member - The error code\n * @type {string}\n */\nfunction ServiceError(code, message) {\n _classCallCheck(this, ServiceError);\n\n this.code = code;\n this.message = message;\n}\n/**\n * @member - The error message\n * @type {string}\n */\n;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.LOG_LEVEL = undefined;\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 _jsLogger = __webpack_require__(8);\n\nvar JsLogger = _interopRequireWildcard(_jsLogger);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LoggerFactory = function () {\n function LoggerFactory(options) {\n _classCallCheck(this, LoggerFactory);\n\n JsLogger.useDefaults(options || {});\n }\n\n _createClass(LoggerFactory, [{\n key: \"get\",\n value: function get(name) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n }]);\n\n return LoggerFactory;\n}();\n\nvar Logger = new LoggerFactory({ defaultLevel: JsLogger.DEBUG });\nvar LOG_LEVEL = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nexports.default = Logger;\nexports.LOG_LEVEL = LOG_LEVEL;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.MultiRequestResult = undefined;\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 _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\n\nvar _baseServiceResult = __webpack_require__(4);\n\nvar _baseServiceResult2 = _interopRequireDefault(_baseServiceResult);\n\nvar _logger = __webpack_require__(5);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return 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\n/**\n * @constant\n */\nvar logger = _logger2.default.get(\"OvpProvider\");\n\n/**\n * Multi Request builder\n * @classdesc\n */\n\nvar MultiRequestBuilder = function (_RequestBuilder) {\n _inherits(MultiRequestBuilder, _RequestBuilder);\n\n /**\n * @constructor\n */\n function MultiRequestBuilder() {\n _classCallCheck(this, MultiRequestBuilder);\n\n var _this = _possibleConstructorReturn(this, (MultiRequestBuilder.__proto__ || Object.getPrototypeOf(MultiRequestBuilder)).call(this));\n\n _this.requests = [];\n return _this;\n }\n\n /**\n * Adds request to requests array\n * @function add\n * @param {RequestBuilder} request The request\n * @returns {MultiRequestBuilder} The multiRequest\n */\n\n\n /**\n * @member - Array of requests\n * @type {Array<RequestBuilder>}\n */\n\n\n _createClass(MultiRequestBuilder, [{\n key: 'add',\n value: function add(request) {\n this.requests.push(request);\n var requestParams = {};\n var serviceDef = { service: request.service, action: request.action };\n Object.assign(requestParams, _defineProperty({}, this.requests.length, Object.assign(serviceDef, request.params)));\n Object.assign(requestParams, this.params);\n this.params = requestParams;\n return this;\n }\n\n /**\n * Executes a multi request\n * @function execute\n * @returns {Promise} The multirequest execution promisie\n */\n\n }, {\n key: 'execute',\n value: function execute() {\n var _this2 = this;\n\n try {\n this.params = JSON.stringify(this.params);\n } catch (err) {\n logger.error('' + err.message);\n }\n return new Promise(function (resolve, reject) {\n _this2.doHttpRequest().then(function (data) {\n resolve(new MultiRequestResult(data));\n }, function (err) {\n var errorText = 'Error on multiRequest execution, error <' + err + '>.';\n reject(errorText);\n });\n });\n }\n }]);\n\n return MultiRequestBuilder;\n}(_requestBuilder2.default);\n\n/**\n * Multi Request result object\n * @classdesc\n */\n\n\nexports.default = MultiRequestBuilder;\n\nvar MultiRequestResult =\n\n/**\n * @constructor\n * @param {Object} response data\n */\n\n\n/**\n * @member - Is success\n * @type {boolean}\n */\nexports.MultiRequestResult = function MultiRequestResult(response) {\n var _this3 = this;\n\n _classCallCheck(this, MultiRequestResult);\n\n this.results = [];\n\n this.success = true;\n response.forEach(function (result) {\n var serviceResult = new _baseServiceResult2.default(result);\n _this3.results.push(serviceResult);\n if (serviceResult.hasError) {\n logger.error('Service returned an error with error code: ' + serviceResult.error.code + ' and message: ' + serviceResult.error.message + '.');\n _this3.success = false;\n return;\n }\n });\n}\n/**\n * @member - Multi request response data\n * @type {Object}\n */\n;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _drm = __webpack_require__(10);\n\nvar _drm2 = _interopRequireDefault(_drm);\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\n/**\n * Media source\n * @classdesc\n */\nvar MediaSource =\n\n/**\n * @constructor\n */\n\n/**\n * @member - media source mimetype\n * @type {string}\n */\n\n/**\n * @member - media source ID\n * @type {string}\n */\nfunction MediaSource() {\n _classCallCheck(this, MediaSource);\n}\n/**\n * @member - media source drm data\n * @type {Array<Drm>}\n */\n\n/**\n * @member - media source URL\n * @type {string}\n */\n;\n\nexports.default = MediaSource;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (true) {\r\n\t\t!(__WEBPACK_AMD_DEFINE_FACTORY__ = (Logger),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _mediaSource = __webpack_require__(7);\n\nvar _mediaSource2 = _interopRequireDefault(_mediaSource);\n\nvar _enums = __webpack_require__(2);\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\n/**\n * Media entry\n * @classdesc\n */\nvar MediaEntry =\n\n/**\n * @constructor\n */\n\n/**\n * @member - entry type\n * @type {MediaEntryType}\n */\n\n/**\n * @member - entry sources\n * @type {Array<MediaSource>}\n */\nfunction MediaEntry() {\n _classCallCheck(this, MediaEntry);\n\n this.metaData = new Map();\n this.type = _enums.MediaEntryType.Unknown;\n}\n/**\n * @member - entry metadata\n * @type {Map<string,string>}\n */\n\n/**\n * @member - entry duration\n * @type {number}\n */\n\n\n/**\n * @member - entry ID\n * @type {string}\n */\n;\n\nexports.default = MediaEntry;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _enums = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Drm data\n * @classdesc\n */\nvar Drm =\n\n/**\n * @constructor\n * @param {string} licenseUrl - the license URL\n * @param {Scheme} scheme - the drm scheme\n */\n\n\n/**\n * @member - license URL\n * @type {string}\n */\nfunction Drm(licenseUrl, scheme) {\n _classCallCheck(this, Drm);\n\n this.licenseUrl = licenseUrl;\n this.scheme = scheme;\n}\n/**\n * @member - drm scheme\n * @type {Scheme}\n */\n;\n\nexports.default = Drm;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _enums = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Ovp BE FlavorAsset\n * @classdesc\n */\nvar KalturaFlavorAsset =\n\n/**\n * @constructor\n * @param {Object} data The json response\n */\n\n/**\n * @member - The language of the flavor asset\n * @type {Status}\n */\n\n/**\n *@member - The video codec\n * @type {boolean}\n */\n\n/**\n * @member - True if this Flavor Asset is playable in KDP\n * @type {boolean}\n */\n\n/**\n * @member - The frame rate (in FPS) of the Flavor Asset\n * @type {number}\n */\n\n/**\n * @member - The width of the Flavor Asset\n * @type {number}\n */\n\n/**\n * @member -The file extension\n * @type {string}\n */\n\n/**\n * @member - The ID of the Flavor Asset\n * @type {string}\n */\nfunction KalturaFlavorAsset(data) {\n _classCallCheck(this, KalturaFlavorAsset);\n\n this.id = data.id;\n this.flavorParamsId = data.flavorParamsId;\n this.fileExt = data.fileExt;\n this.bitrate = data.bitrate;\n this.width = data.width;\n this.height = data.height;\n this.id = data.id;\n this.frameRate = data.frameRate;\n this.isOriginal = data.isOriginal;\n this.isWeb = data.isWeb;\n this.containerFormat = data.containerFormat;\n this.videoCodecId = data.videoCodecId;\n this.status = data.status;\n this.language = data.language;\n this.label = data.label;\n}\n/**\n * @member - The label of the flavor asset\n * @type {string}\n */\n\n/**\n * @member - The status of the Flavor Asset\n * @type {string}\n */\n\n/**\n * @member - The container format\n * @type {boolean}\n */\n\n/**\n * @member - True if this Flavor Asset is the original source\n * @type {number}\n */\n\n/**\n * @member - The height of the Flavor Asset\n * @type {number}\n */\n\n/**\n * @member - The overall bitrate (in KBits) of the Flavor Asset\n * @type {string}\n */\n\n/**\n * @member -The Flavor Params used to create this Flavor Asset\n * @type {string}\n */\n;\n\nexports.default = KalturaFlavorAsset;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _enums = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Ovp BE MediaEntry\n * @classdesc\n */\nvar KalturaMediaEntry =\n\n/**\n * @constructor\n * @param {Object} entry The json response\n */\n\n/**\n * @member - The type of the entry, this is auto filled by the derived entry object\n * @type {EntryType}\n */\n\n/**\n * @member - Comma separated flavor params ids that exists for this media entry\n * @type {string}\n */\n\n/**\n * @member - Entry name (Min 1 chars)\n * @type {string}\n */\nfunction KalturaMediaEntry(entry) {\n _classCallCheck(this, KalturaMediaEntry);\n\n this.id = entry.id;\n this.name = entry.name;\n this.dataUrl = entry.dataUrl;\n this.type = entry.type;\n this.entryType = entry.mediaType;\n this.flavorParamsIds = entry.flavorParamsIds;\n this.duration = entry.duration;\n}\n/**\n * @member - The type of the entry, this is auto filled by the derived entry object (Image, Audio etc.)\n * @type {MediaType}\n */\n\n/**\n * @member - The entry duration\n * @type {number}\n */\n\n/**\n * @member - The URL used for playback. This is not the download URL.\n * @type {string}\n */\n\n/**\n * @member - The entry id\n * @type {string}\n */\n;\n\nexports.default = KalturaMediaEntry;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _baseServiceResult = __webpack_require__(4);\n\nvar _baseServiceResult2 = _interopRequireDefault(_baseServiceResult);\n\nvar _kalturaMetadata = __webpack_require__(29);\n\nvar _kalturaMetadata2 = _interopRequireDefault(_kalturaMetadata);\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\n/**\n * Ovp BE Metadata list response\n * @classdesc\n */\nvar KalturaMetadataListResponse = function (_ServiceResult) {\n _inherits(KalturaMetadataListResponse, _ServiceResult);\n\n /**\n * @constructor\n * @param {Object} responseObj The response\n */\n function KalturaMetadataListResponse(responseObj) {\n _classCallCheck(this, KalturaMetadataListResponse);\n\n var _this = _possibleConstructorReturn(this, (KalturaMetadataListResponse.__proto__ || Object.getPrototypeOf(KalturaMetadataListResponse)).call(this, responseObj));\n\n if (!_this.hasError) {\n _this.totalCount = responseObj.totalCount;\n if (_this.totalCount > 0) {\n _this.metas = [];\n responseObj.objects.map(function (meta) {\n return _this.metas.push(new _kalturaMetadata2.default(meta));\n });\n }\n }\n return _this;\n }\n /**\n * @member -The mata data array\n * @type {Array<KalturaMetadata>}\n */\n\n\n return KalturaMetadataListResponse;\n}(_baseServiceResult2.default);\n\nexports.default = KalturaMetadataListResponse;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _baseServiceResult = __webpack_require__(4);\n\nvar _baseServiceResult2 = _interopRequireDefault(_baseServiceResult);\n\nvar _kalturaAccessControlMessage = __webpack_require__(26);\n\nvar _kalturaAccessControlMessage2 = _interopRequireDefault(_kalturaAccessControlMessage);\n\nvar _kalturaPlaybackSource = __webpack_require__(15);\n\nvar _kalturaPlaybackSource2 = _interopRequireDefault(_kalturaPlaybackSource);\n\nvar _kalturaRuleAction = __webpack_require__(30);\n\nvar _kalturaRuleAction2 = _interopRequireDefault(_kalturaRuleAction);\n\nvar _kalturaFlavorAsset = __webpack_require__(11);\n\nvar _kalturaFlavorAsset2 = _interopRequireDefault(_kalturaFlavorAsset);\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\n/**\n * Ovp BE playback context response\n * @classdesc\n */\nvar KalturaPlaybackContext = function (_ServiceResult) {\n _inherits(KalturaPlaybackContext, _ServiceResult);\n\n /**\n * @constructor\n * @param {Object} response The response\n */\n\n /**\n * @member - Array of actions as received from the rules that invalidated\n * @type {Array<KalturaAccessControlMessage>}\n */\n\n /**\n * @member - The playback sources\n * @type {Array<KalturaPlaybackSource>}\n */\n function KalturaPlaybackContext(response) {\n _classCallCheck(this, KalturaPlaybackContext);\n\n var _this = _possibleConstructorReturn(this, (KalturaPlaybackContext.__proto__ || Object.getPrototypeOf(KalturaPlaybackContext)).call(this, response));\n\n _this.sources = [];\n _this.actions = [];\n _this.messages = [];\n _this.flavorAssets = [];\n\n if (!_this.hasError) {\n\n var messages = response.messages;\n if (messages) {\n messages.map(function (message) {\n return _this.messages.push(new _kalturaAccessControlMessage2.default(message));\n });\n }\n\n var actions = response.actions;\n if (actions) {\n actions.map(function (action) {\n return _this.actions.push(new _kalturaRuleAction2.default(action));\n });\n }\n\n var sources = response.sources;\n if (sources) {\n sources.map(function (source) {\n return _this.sources.push(new _kalturaPlaybackSource2.default(source));\n });\n }\n\n var flavorAssets = response.flavorAssets;\n if (flavorAssets) {\n flavorAssets.map(function (flavor) {\n return _this.flavorAssets.push(new _kalturaFlavorAsset2.default(flavor));\n });\n }\n }\n\n return _this;\n }\n /**\n * @member - The flavor assets\n * @type {Array<KalturaFlavorAsset>}\n */\n\n /**\n * @member - Array of actions as received from the rules that invalidated\n * @type {Array<KalturaRuleAction>}\n */\n\n\n return KalturaPlaybackContext;\n}(_baseServiceResult2.default);\n\nexports.default = KalturaPlaybackContext;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _kalturaDrmPlaybackPluginData = __webpack_require__(28);\n\nvar _kalturaDrmPlaybackPluginData2 = _interopRequireDefault(_kalturaDrmPlaybackPluginData);\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\n/**\n * Ovp BE playback source\n * @classdesc\n */\nvar KalturaPlaybackSource = function () {\n\n /**\n * @constructor\n * @param {Object} source The response\n */\n\n /**\n * @member - comma separated string of flavor ids\n * @type {string}\n */\n\n /**\n * @member - The source URL\n * @type {string}\n */\n\n /**\n * @member - source format according to delivery profile streamer type (applehttp, mpegdash etc.)\n * @type {string}\n */\n function KalturaPlaybackSource(source) {\n var _this = this;\n\n _classCallCheck(this, KalturaPlaybackSource);\n\n this.drm = [];\n\n this.format = source.format;\n this.deliveryProfileId = source.deliveryProfileId;\n this.url = source.url;\n this.protocols = source.protocols;\n this.flavorIds = source.flavorIds;\n\n if (source.drm) {\n source.drm.map(function (drm) {\n return _this.drm.push(new _kalturaDrmPlaybackPluginData2.default(drm));\n });\n }\n }\n\n /**\n * Checks if source has DRM data\n * @function hasDrmData\n * @returns {boolean} Is source has DRM\n */\n\n /**\n * @member - drm data object containing relevant license url ,scheme name and certificate\n * @type {Array<KalturaDrmPlaybackPluginData>}\n */\n\n /**\n * @member - comma separated string according to deliveryProfile media protocols ('http,https' etc.)\n * @type {string}\n */\n\n /**\n * @member - delivery profile Id\n * @type {string}\n */\n\n\n _createClass(KalturaPlaybackSource, [{\n key: \"hasDrmData\",\n value: function hasDrmData() {\n return this.drm && this.drm.length > 0;\n }\n\n /**\n * Checks if source has flavor IDs\n * @function hasFlavorIds\n * @returns {boolean} Is source ha flavor IDs\n */\n\n }, {\n key: \"hasFlavorIds\",\n value: function hasFlavorIds() {\n return !!this.flavorIds && this.flavorIds.length > 0;\n }\n\n /**\n * Returns source desired protocol if supported\n * @param {string} protocol - the desired protocol for the source (base play url protocol)\n * @returns {string} - protocol if protocol is in the protocols list - if not empty string returned\n */\n\n }, {\n key: \"getProtocol\",\n value: function getProtocol(protocol) {\n var returnValue = \"\";\n if (this.protocols && this.protocols.length > 0) {\n var protocolsArr = this.protocols.split(\",\");\n protocolsArr.forEach(function (p) {\n if (p == protocol) {\n returnValue = p;\n }\n });\n } else if (protocol == \"http\") {\n return protocol;\n }\n return returnValue;\n }\n }]);\n\n return KalturaPlaybackSource;\n}();\n\nexports.default = KalturaPlaybackSource;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\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\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.copyProperties = copyProperties;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar INITIALIZED = Symbol();\n\n/**\n * This is an abstract class that is not intended to be\n * used directly. Extend it to turn your class into an enum\n * (initialization is performed via `MyClass.initEnum()`).\n */\n\nvar Enum = exports.Enum = function () {\n /**\n * `initEnum()` closes the class. Then calling this constructor\n * throws an exception.\n * \n * If your subclass has a constructor then you can control\n * what properties are added to `this` via the argument you\n * pass to `super()`. No arguments are fine, too.\n */\n\n function Enum() {\n var instanceProperties = arguments.length <= 0 || arguments[0] === undefined ? undefined : arguments[0];\n\n _classCallCheck(this, Enum);\n\n // new.target would be better than this.constructor,\n // but isn’t supported by Babel\n if ({}.hasOwnProperty.call(this.constructor, INITIALIZED)) {\n throw new Error('Enum classes can’t be instantiated');\n }\n if ((typeof instanceProperties === 'undefined' ? 'undefined' : _typeof(instanceProperties)) === 'object' && instanceProperties !== null) {\n copyProperties(this, instanceProperties);\n }\n }\n /**\n * Set up the enum, close the class.\n * \n * @param arg Either an object whose properties provide the names\n * and values (which must be mutable objects) of the enum constants.\n * Or an Array whose elements are used as the names of the enum constants\n * The values are create by instantiating the current class.\n */\n\n _createClass(Enum, [{\n key: 'toString',\n\n /**\n * Default `toString()` method for enum constant.\n */\n value: function toString() {\n return this.constructor.name + '.' + this.name;\n }\n }], [{\n key: 'initEnum',\n value: function initEnum(arg) {\n Object.defineProperty(this, 'enumValues', {\n value: [],\n configurable: false,\n writable: false,\n enumerable: true\n });\n if (Array.isArray(arg)) {\n this._enumValuesFromArray(arg);\n } else {\n this._enumValuesFromObject(arg);\n }\n Object.freeze(this.enumValues);\n this[INITIALIZED] = true;\n return this;\n }\n }, {\n key: '_enumValuesFromArray',\n value: function _enumValuesFromArray(arr) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = arr[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n\n this._pushEnumValue(new this(), key);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n }, {\n key: '_enumValuesFromObject',\n value: function _enumValuesFromObject(obj) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = Object.keys(obj)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n\n var value = new this(obj[key]);\n this._pushEnumValue(value, key);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n }, {\n key: '_pushEnumValue',\n value: function _pushEnumValue(enumValue, name) {\n enumValue.name = name;\n enumValue.ordinal = this.enumValues.length;\n Object.defineProperty(this, name, {\n value: enumValue,\n configurable: false,\n writable: false,\n enumerable: true\n });\n this.enumValues.push(enumValue);\n }\n\n /**\n * Given the name of an enum constant, return its value.\n */\n\n }, {\n key: 'enumValueOf',\n value: function enumValueOf(name) {\n return this.enumValues.find(function (x) {\n return x.name === name;\n });\n }\n\n /**\n * Make enum classes iterable\n */\n\n }, {\n key: Symbol.iterator,\n value: function value() {\n return this.enumValues[Symbol.iterator]();\n }\n }]);\n\n return Enum;\n}();\n\nfunction copyProperties(target, source) {\n // Ideally, we’d use Reflect.ownKeys() here,\n // but I don’t want to depend on a polyfill\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = Object.getOwnPropertyNames(source)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var key = _step3.value;\n\n var desc = Object.getOwnPropertyDescriptor(source, key);\n Object.defineProperty(target, key, desc);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return target;\n}\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _ovpService = __webpack_require__(3);\n\nvar _ovpService2 = _interopRequireDefault(_ovpService);\n\nvar _multiRequestBuilder = __webpack_require__(6);\n\nvar _multiRequestBuilder2 = _interopRequireDefault(_multiRequestBuilder);\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\n/**\n * Data loaders manager\n * @classdesc\n */\nvar DataLoaderManager = function () {\n\n /**\n * @constructor\n * @param {string} partnerID Then partner ID\n * @param {string} ks The ks\n */\n\n /**\n * @member - Lodaers response map index\n * @type {Map<string,Array<number>>}\n * @private\n * @static\n */\n function DataLoaderManager(partnerID) {\n var ks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"\";\n\n _classCallCheck(this, DataLoaderManager);\n\n this._loaders = new Map();\n\n this._multiRequest = _ovpService2.default.getMultirequest(ks, partnerID);\n }\n\n /**\n * Add loader too execution loaders map\n * @function\n * @param {Function} loader Loader to add\n * @param {Object} params Loader params\n * @returns {void}\n */\n\n /**\n * @member - Loaders to execute\n * @type {Map<string,Function>}\n * @private\n */\n\n /**\n * @member - Loaders multi request\n * @type {MultiRequestBuilder}\n * @private\n */\n\n /**\n * @member - Loaders multi response\n * @type {MultiRequestResult}\n * @private\n */\n\n\n _createClass(DataLoaderManager, [{\n key: 'add',\n value: function add(loader, params) {\n var _this = this;\n\n var execution_loader = new loader(params);\n if (execution_loader.isValid()) {\n this._loaders.set(loader.name, execution_loader);\n //Get the start index from the multiReqeust before adding current execution_loader requests\n var startIndex = this._multiRequest.requests.length;\n //Get the requests\n var requests = execution_loader.requests;\n //Add requests to muktiRequest queue\n requests.forEach(function (request) {\n _this._multiRequest.add(request);\n });\n //Create range array of current execution_loader requests\n var executionLoaderResponseMap = Array.from(new Array(requests.length), function (val, index) {\n return index + startIndex;\n });\n //Add to map\n DataLoaderManager._loadersResponseMap.set(loader.name, executionLoaderResponseMap);\n }\n }\n\n /**\n * Get data from all loaders using multi request\n * @function\n * @returns {Promise} Promise\n */\n\n }, {\n key: 'fetchData',\n value: function fetchData() {\n var _this2 = this;\n\n return new Promise(function (resolve, reject) {\n _this2._multiRequest.execute().then(function (response) {\n _this2._multiResponse = response;\n if (!response.success) {\n reject(response);\n } else {\n var preparedData = _this2.prepareData(response);\n if (preparedData.success) {\n resolve(_this2._loaders);\n } else {\n reject({ success: false, data: preparedData.error });\n }\n }\n }, function (err) {\n reject(err);\n });\n });\n }\n }, {\n key: 'prepareData',\n value: function prepareData(response) {\n this._loaders.forEach(function (loader, name) {\n var loaderDataIndexes = DataLoaderManager._loadersResponseMap.get(name);\n try {\n if (loaderDataIndexes != null) {\n loader.response = response.results.slice(loaderDataIndexes[0], loaderDataIndexes[loaderDataIndexes.length - 1] + 1);\n }\n } catch (err) {\n return { success: false, error: err };\n }\n });\n return { success: true, data: this._loaders };\n }\n }]);\n\n return DataLoaderManager;\n}();\n\nDataLoaderManager._loadersResponseMap = new Map();\nexports.default = DataLoaderManager;\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\n\nvar _baseEntryService = __webpack_require__(32);\n\nvar _baseEntryService2 = _interopRequireDefault(_baseEntryService);\n\nvar _metaDataService = __webpack_require__(33);\n\nvar _metaDataService2 = _interopRequireDefault(_metaDataService);\n\nvar _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\n\nvar _kalturaPlaybackContext = __webpack_require__(14);\n\nvar _kalturaPlaybackContext2 = _interopRequireDefault(_kalturaPlaybackContext);\n\nvar _kalturaMetadataListResponse = __webpack_require__(13);\n\nvar _kalturaMetadataListResponse2 = _interopRequireDefault(_kalturaMetadataListResponse);\n\nvar _kalturaBaseEntryListResponse = __webpack_require__(27);\n\nvar _kalturaBaseEntryListResponse2 = _interopRequireDefault(_kalturaBaseEntryListResponse);\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 config = _config2.default.get();\n\n/**\n * Media entry loader\n * @classdesc\n */\n\nvar MediaEntryLoader = function () {\n _createClass(MediaEntryLoader, null, [{\n key: 'name',\n get: function get() {\n return \"media\";\n }\n }]);\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n function MediaEntryLoader(params) {\n _classCallCheck(this, MediaEntryLoader);\n\n this._response = {};\n\n this.requests = this.buildRequests(params);\n this._entryId = params.entryId;\n }\n\n _createClass(MediaEntryLoader, [{\n key: 'buildRequests',\n\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function buildRequests(params) {\n var requests = [];\n requests.push(_baseEntryService2.default.list(config.beUrl, params.ks, params.entryId));\n requests.push(_baseEntryService2.default.getPlaybackContext(config.beUrl, params.ks, params.entryId));\n requests.push(_metaDataService2.default.list(config.beUrl, params.ks, params.entryId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n\n }, {\n key: 'isValid',\n value: function isValid() {\n return !!this._entryId;\n }\n }, {\n key: 'requests',\n set: function set(requests) {\n this._requests = requests;\n },\n get: function get() {\n return this._requests;\n }\n }, {\n key: 'response',\n set: function set(response) {\n var mediaEntryResponse = new _kalturaBaseEntryListResponse2.default(response[0].data);\n this._response.entry = mediaEntryResponse.entries[0];\n this._response.playBackContextResult = new _kalturaPlaybackContext2.default(response[1].data);\n this._response.metadataListResult = new _kalturaMetadataListResponse2.default(response[2].data);\n },\n get: function get() {\n return this._response;\n }\n }]);\n\n return MediaEntryLoader;\n}();\n\nexports.default = MediaEntryLoader;\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _sessionService = __webpack_require__(34);\n\nvar _sessionService2 = _interopRequireDefault(_sessionService);\n\nvar _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\n\nvar _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\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 config = _config2.default.get();\n/**\n * Media entry loader\n * @classdesc\n */\n\nvar SessionLoader = function () {\n _createClass(SessionLoader, null, [{\n key: 'name',\n get: function get() {\n return \"session\";\n }\n\n /**\n * @member - partner ID\n * @type {number}\n * @private\n */\n\n }]);\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n function SessionLoader(params) {\n _classCallCheck(this, SessionLoader);\n\n this._response = {};\n\n this.requests = this.buildRequests(params);\n this._partnerId = params.partnerId;\n }\n\n _createClass(SessionLoader, [{\n key: 'buildRequests',\n\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function buildRequests(params) {\n var requests = [];\n requests.push(_sessionService2.default.anonymousSession(config.beUrl, params.partnerId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n\n }, {\n key: 'isValid',\n value: function isValid() {\n return !!this._partnerId;\n }\n }, {\n key: 'requests',\n set: function set(requests) {\n this._requests = requests;\n },\n get: function get() {\n return this._requests;\n }\n }, {\n key: 'response',\n set: function set(response) {\n this._response.ks = response[0].data.ks;\n },\n get: function get() {\n return this._response.ks;\n }\n }]);\n\n return SessionLoader;\n}();\n\nexports.default = SessionLoader;\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _uiConfService = __webpack_require__(36);\n\nvar _uiConfService2 = _interopRequireDefault(_uiConfService);\n\nvar _kalturaUIConfResponse = __webpack_require__(31);\n\nvar _kalturaUIConfResponse2 = _interopRequireDefault(_kalturaUIConfResponse);\n\nvar _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\n\nvar _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\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 config = _config2.default.get();\n\nvar UiConfigLoader = function () {\n _createClass(UiConfigLoader, null, [{\n key: 'name',\n get: function get() {\n return \"uiConf\";\n }\n\n /**\n * @member - uiConf ID\n * @type {number}\n * @private\n */\n\n }]);\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n function UiConfigLoader(params) {\n _classCallCheck(this, UiConfigLoader);\n\n this._response = {};\n\n this.requests = this.buildRequests(params);\n this._uiConfId = params.uiConfId;\n }\n\n _createClass(UiConfigLoader, [{\n key: 'buildRequests',\n\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function buildRequests(params) {\n var requests = [];\n requests.push(_uiConfService2.default.get(config.beUrl, params.ks, params.uiConfId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n\n }, {\n key: 'isValid',\n value: function isValid() {\n return !!this._uiConfId;\n }\n }, {\n key: 'requests',\n set: function set(requests) {\n this._requests = requests;\n },\n get: function get() {\n return this._requests;\n }\n }, {\n key: 'response',\n set: function set(response) {\n this._response.uiConf = new _kalturaUIConfResponse2.default(response[0].data);\n },\n get: function get() {\n if (this._response != null && this._response.uiConf != null && this._response.uiConf.config != null) try {\n return JSON.parse(this._response.uiConf.config).plugins;\n } catch (err) {\n return null;\n } else return null;\n }\n }]);\n\n return UiConfigLoader;\n}();\n\nexports.default = UiConfigLoader;\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _kalturaMediaEntry = __webpack_require__(12);\n\nvar _kalturaMediaEntry2 = _interopRequireDefault(_kalturaMediaEntry);\n\nvar _kalturaPlaybackContext = __webpack_require__(14);\n\nvar _kalturaPlaybackContext2 = _interopRequireDefault(_kalturaPlaybackContext);\n\nvar _kalturaPlaybackSource = __webpack_require__(15);\n\nvar _kalturaPlaybackSource2 = _interopRequireDefault(_kalturaPlaybackSource);\n\nvar _kalturaFlavorAsset = __webpack_require__(11);\n\nvar _kalturaFlavorAsset2 = _interopRequireDefault(_kalturaFlavorAsset);\n\nvar _kalturaMetadataListResponse = __webpack_require__(13);\n\nvar _kalturaMetadataListResponse2 = _interopRequireDefault(_kalturaMetadataListResponse);\n\nvar _playSourceUrlBuilder = __webpack_require__(25);\n\nvar _playSourceUrlBuilder2 = _interopRequireDefault(_playSourceUrlBuilder);\n\nvar _xmlParser = __webpack_require__(37);\n\nvar _xmlParser2 = _interopRequireDefault(_xmlParser);\n\nvar _enums = __webpack_require__(2);\n\nvar _logger = __webpack_require__(5);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\n\nvar _mediaFormat = __webpack_require__(22);\n\nvar _mediaEntry = __webpack_require__(9);\n\nvar _mediaEntry2 = _interopRequireDefault(_mediaEntry);\n\nvar _drm = __webpack_require__(10);\n\nvar _drm2 = _interopRequireDefault(_drm);\n\nvar _mediaSource = __webpack_require__(7);\n\nvar _mediaSource2 = _interopRequireDefault(_mediaSource);\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 config = _config2.default.get();\n/**\n * @constant\n */\nvar logger = _logger2.default.get(\"OvpProvider\");\n\n/**\n * @constant\n * @type {Map<string, MediaFormat>}\n */\nvar SUPPORTED_FORMATS = new Map([[\"mpegdash\", _mediaFormat.MediaFormat.dash], [\"applehttp\", _mediaFormat.MediaFormat.hls], [\"url\", _mediaFormat.MediaFormat.mp4]]);\n\n/**\n * Ovp provider parser\n * @classdesc\n */\n\nvar ProviderParser = function () {\n function ProviderParser() {\n _classCallCheck(this, ProviderParser);\n }\n\n _createClass(ProviderParser, null, [{\n key: 'getMediaEntry',\n\n\n /**\n * Returns parsed media entry by given OVP response objects\n * @function getMediaEntry\n * @param {string} ks The ks\n * @param {number} partnerID The partner ID\n * @param {number} uiConfId The uiConf ID\n * @param {any} mediaEntryResponse The media entry response\n * @returns {MediaEntry} The media entry\n * @static\n */\n value: function getMediaEntry(ks, partnerID, uiConfId, mediaEntryResponse) {\n var _this = this;\n\n var mediaEntry = new _mediaEntry2.default();\n var entry = mediaEntryResponse.entry;\n var playbackContext = mediaEntryResponse.playBackContextResult;\n var metadataList = mediaEntryResponse.metadataListResult;\n var kalturaSources = playbackContext.sources;\n var sources = [];\n\n if (kalturaSources && kalturaSources.length > 0) {\n kalturaSources.forEach(function (source) {\n sources.push(_this.parseSource(source, ks, partnerID, uiConfId, entry, playbackContext));\n });\n } else {\n sources = [];\n }\n\n mediaEntry.sources = sources;\n\n var metadata = this.parseMetaData(metadataList);\n mediaEntry.metaData = metadata;\n mediaEntry.id = entry.id;\n mediaEntry.duration = entry.duration;\n\n var type = _enums.MediaEntryType.Unknown;\n\n switch (entry.entryType) {\n case _enums.MediaType.IMAGE.value:\n type = _enums.MediaEntryType.Image;\n break;\n case _enums.MediaType.AUDIO.value:\n type = _enums.MediaEntryType.Audio;\n break;\n default:\n switch (entry.type) {\n case _enums.EntryType.MEDIA_CLIP.value:\n type = _enums.MediaEntryType.Vod;\n break;\n case _enums.EntryType.LIVE_STREAM.value:\n case _enums.EntryType.LIVE_CHANNEL.value:\n type = _enums.MediaEntryType.Live;\n break;\n default:\n type = _enums.MediaEntryType.Unknown;\n }\n }\n mediaEntry.type = type;\n\n return mediaEntry;\n }\n\n /**\n *\n * @param {KalturaPlaybackSource} source The source\n * @param {string} ks The ks\n * @param {number} partnerID The partner ID\n * @param {number} uiConfId The uiConf ID\n * @param {KalturaMediaEntry} entry The entry\n * @param {KalturaPlaybackContext} playbackContext The playback context\n * @returns {MediaSource} The parsed media source\n * @static\n */\n\n }, {\n key: 'parseSource',\n value: function parseSource(source, ks, partnerID, uiConfId, entry, playbackContext) {\n var playUrl = \"\";\n var mediaFormat = SUPPORTED_FORMATS.get(source.format);\n var mediaSource = new _mediaSource2.default();\n // in case playbackSource doesn't have flavors we don't need to build the url and we'll use the provided one.\n if (source.hasFlavorIds()) {\n var splittedUrl = config.baseUrl.split(\"/\");\n var baseProtocol = void 0;\n if (splittedUrl && splittedUrl.length > 0) {\n baseProtocol = splittedUrl[0].substring(0, splittedUrl[0].length - 1);\n } else {\n baseProtocol = \"http\";\n }\n\n var extension = \"\";\n if (!mediaFormat) {\n var flavorIdsArr = source.flavorIds.split(\",\");\n var flavors = playbackContext.flavorAssets.filter(function (flavor) {\n return flavorIdsArr.indexOf(flavor.id) != -1;\n });\n if (flavors && flavors.length > 0) {\n extension = flavors[0].fileExt;\n }\n } else {\n extension = mediaFormat.pathExt;\n mediaSource.mimetype = mediaFormat.mimeType;\n }\n\n playUrl = _playSourceUrlBuilder2.default.build({\n entryId: entry.id,\n flavorIds: source.flavorIds,\n format: source.format,\n ks: ks,\n partnerId: partnerID,\n uiConfId: uiConfId,\n extension: extension,\n protocol: source.getProtocol(baseProtocol)\n });\n } else {\n playUrl = source.url;\n }\n\n if (playUrl == \"\") {\n logger.error('failed to create play url from source, discarding source: (' + entry.id + '_' + source.deliveryProfileId + '), ' + source.format + '.');\n return mediaSource;\n }\n\n mediaSource.url = playUrl;\n mediaSource.id = entry.id + \"_\" + source.deliveryProfileId + \",\" + source.format;\n if (source.hasDrmData()) {\n var drmParams = [];\n source.drm.forEach(function (drm) {\n drmParams.push(new _drm2.default(drm.licenseURL, drm.scheme));\n });\n mediaSource.drmData = drmParams;\n }\n return mediaSource;\n }\n\n /**\n * Ovp metadata parser\n * @function parseMetaData\n * @param {KalturaMetadataListResponse} metadataList The metadata list\n * @returns {Map<string,string>} Parsed metadata\n * @static\n */\n\n }, {\n key: 'parseMetaData',\n value: function parseMetaData(metadataList) {\n var metadata = {};\n if (metadataList && metadataList.metas && metadataList.metas.length > 0) {\n metadataList.metas.forEach(function (meta) {\n var metaXml = void 0;\n var domParser = new DOMParser();\n meta.xml = meta.xml.replace(/\\r?\\n|\\r/g, \"\");\n meta.xml = meta.xml.replace(/>\\s*/g, '>');\n meta.xml = meta.xml.replace(/>\\s*/g, '>');\n metaXml = domParser.parseFromString(meta.xml, 'text/xml');\n var metasObj = _xmlParser2.default.xmlToJson(metaXml);\n var metaKeys = Object.keys(metasObj.metadata);\n metaKeys.forEach(function (key) {\n metadata[key] = metasObj.metadata[key][\"#text\"];\n });\n });\n }\n return metadata;\n }\n }]);\n\n return ProviderParser;\n}();\n\nexports.default = ProviderParser;\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.MediaFormat = undefined;\n\nvar _enumify = __webpack_require__(16);\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\nvar MediaFormat = exports.MediaFormat = function (_Enum) {\n _inherits(MediaFormat, _Enum);\n\n function MediaFormat() {\n _classCallCheck(this, MediaFormat);\n\n return _possibleConstructorReturn(this, (MediaFormat.__proto__ || Object.getPrototypeOf(MediaFormat)).apply(this, arguments));\n }\n\n return MediaFormat;\n}(_enumify.Enum);\n\nMediaFormat.initEnum({\n dash: {\n get mimeType() {\n return \"application/dash+xml\";\n },\n get pathExt() {\n return \"mpd\";\n }\n },\n hls: {\n get mimeType() {\n return \"application/x-mpegURL\";\n },\n get pathExt() {\n return \"m3u8\";\n }\n },\n wvm: {\n get mimeType() {\n return \"video/wvm\";\n },\n get pathExt() {\n return \"wvm\";\n }\n },\n mp4: {\n get mimeType() {\n return \"video/mp4\";\n },\n get pathExt() {\n return \"mp4\";\n }\n },\n mp3: {\n get mimeType() {\n return \"audio/mpeg\";\n },\n get pathExt() {\n return \"mp3\";\n }\n }\n});\n\n/***/ }),\n/* 23 */,\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.OvpProvider = undefined;\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 _logger = __webpack_require__(5);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _providerParser = __webpack_require__(21);\n\nvar _providerParser2 = _interopRequireDefault(_providerParser);\n\nvar _dataLoaderManager = __webpack_require__(17);\n\nvar _dataLoaderManager2 = _interopRequireDefault(_dataLoaderManager);\n\nvar _mediaEntryLoader = __webpack_require__(18);\n\nvar _mediaEntryLoader2 = _interopRequireDefault(_mediaEntryLoader);\n\nvar _sessionLoader = __webpack_require__(19);\n\nvar _sessionLoader2 = _interopRequireDefault(_sessionLoader);\n\nvar _uiConfigLoader = __webpack_require__(20);\n\nvar _uiConfigLoader2 = _interopRequireDefault(_uiConfigLoader);\n\nvar _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\n\nvar _mediaEntry = __webpack_require__(9);\n\nvar _mediaEntry2 = _interopRequireDefault(_mediaEntry);\n\nvar _mediaSource = __webpack_require__(7);\n\nvar _mediaSource2 = _interopRequireDefault(_mediaSource);\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\n/**\n * @constant\n */\nvar logger = _logger2.default.get(\"OvpProvider\");\n\n/**\n * Ovp provider\n * @classdesc\n */\nvar OvpProvider = exports.OvpProvider = function () {\n\n /**\n * @constructor\n * @param {number} partnerID The partner ID\n * @param {string} [ks=\"\"] The provider ks (has empty string as default value)\n * @param {Object} [config] The provider config(optional)\n */\n\n /**\n * @member - uiConf ID\n * @type {number}\n * @private\n */\n\n /**\n * @member - partner ID\n * @type {number}\n */\n function OvpProvider(partnerID) {\n var ks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"\";\n var config = arguments[2];\n\n _classCallCheck(this, OvpProvider);\n\n this.partnerID = partnerID;\n this.ks = ks;\n this._isAnonymous = !this.ks;\n _config2.default.set(config);\n }\n\n /**\n * Returns player json configuration\n * @function getConfig\n * @param {string} entryId The entry ID\n * @param {number} uiConfId The uiConf ID\n * @returns {Promise} The provider config object as promise\n */\n\n /**\n * @member - Data loader\n * @type {DataLoaderManager}\n * @private\n */\n\n /**\n * @member - is anonymous\n * @type {boolean}\n * @private\n */\n\n /**\n * @member - ks\n * @type {string}\n */\n\n\n _createClass(OvpProvider, [{\n key: 'getConfig',\n value: function getConfig(entryId, uiConfId) {\n var _this = this;\n\n if (uiConfId != null) {\n this._uiConfId = uiConfId;\n }\n this._dataLoader = new _dataLoaderManager2.default(this.partnerID, this.ks);\n return new Promise(function (resolve, reject) {\n if (_this.validateParams(entryId, uiConfId)) {\n var ks = _this.ks;\n if (_this._isAnonymous) {\n ks = \"{1:result:ks}\";\n _this._dataLoader.add(_sessionLoader2.default, { partnerId: _this.partnerID });\n }\n _this._dataLoader.add(_mediaEntryLoader2.default, { entryId: entryId, ks: ks });\n _this._dataLoader.add(_uiConfigLoader2.default, { uiConfId: uiConfId, ks: ks });\n _this._dataLoader.fetchData().then(function (response) {\n resolve(_this.parseDataFromResponse(response));\n }, function (err) {\n reject(err);\n });\n } else {\n reject({ success: false, data: \"Missing mandatory parameter\" });\n }\n });\n }\n\n /**\n * Parses BE data to json configuration object\n * @function parseDataFromResponse\n * @param {Map<string,Function>} data The data to parse\n * @returns {Object} The parsed config object\n */\n\n }, {\n key: 'parseDataFromResponse',\n value: function parseDataFromResponse(data) {\n logger.debug(\"Data parsing started\");\n var config = {\n id: \"\",\n session: {\n partnerID: this.partnerID,\n uiConfID: this._uiConfId\n },\n sources: [],\n duration: 0,\n type: \"Unknown\",\n metadata: {},\n plugins: {}\n };\n if (data != null) {\n if (data.has(_sessionLoader2.default.name)) {\n var sessionLoader = data.get(_sessionLoader2.default.name);\n if (sessionLoader != null && sessionLoader.response != null) {\n this.ks = sessionLoader.response;\n this._isAnonymous = !this.ks;\n config.session.ks = this.ks;\n }\n }\n if (data.has(_uiConfigLoader2.default.name)) {\n var uiConfLoader = data.get(_uiConfigLoader2.default.name);\n var pluginsJson = {};\n if (uiConfLoader != null) {\n pluginsJson = uiConfLoader.response;\n }\n config.plugins = pluginsJson;\n }\n if (data.has(_mediaEntryLoader2.default.name)) {\n var mediaLoader = data.get(_mediaEntryLoader2.default.name);\n if (mediaLoader != null && mediaLoader.response != null) {\n var mediaEntry = _providerParser2.default.getMediaEntry(this.ks, this.partnerID, this._uiConfId, mediaLoader.response);\n config.id = mediaEntry.id;\n config.sources = mediaEntry.sources;\n config.duration = mediaEntry.duration;\n config.type = mediaEntry.type.name;\n config.metadata = mediaEntry.metaData;\n }\n }\n }\n logger.debug(\"Data parsing finished\", config);\n return config;\n }\n\n /**\n * Parameters validation function\n * @param {string} entryId The entry ID\n * @param {number} uiConfId The uiConfID\n * @returns {boolean} Is valid params\n */\n\n }, {\n key: 'validateParams',\n value: function validateParams(entryId, uiConfId) {\n return !!entryId || !!uiConfId;\n }\n }]);\n\n return OvpProvider;\n}();\n\nexports.default = OvpProvider;\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\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 config = _config2.default.get();\n\n/**\n * Media source url builder\n * @classdesc\n */\n\nvar PlaySourceUrlBuilder = function () {\n function PlaySourceUrlBuilder() {\n _classCallCheck(this, PlaySourceUrlBuilder);\n }\n\n _createClass(PlaySourceUrlBuilder, null, [{\n key: \"build\",\n\n\n /**\n * Returns source url by given url params\n * @function build\n * @param {Object} urlParams The params\n * @returns {string} The URL\n * @static\n */\n value: function build(urlParams) {\n var baseUrl = config.baseUrl;\n var partnerId = urlParams.partnerId;\n var entryId = urlParams.entryId;\n var ks = urlParams.ks;\n var uiConfId = urlParams.uiConfId;\n var format = urlParams.format;\n var protocol = urlParams.protocol;\n var extension = urlParams.extension;\n var flavorIds = urlParams.flavorIds;\n\n if (baseUrl == \"\" && partnerId == \"\" && entryId == \"\" && extension == \"\" && format == \"\") {\n return \"\";\n }\n\n var playUrl = baseUrl;\n if (!PlaySourceUrlBuilder.endsWith(baseUrl, \"/\")) {\n playUrl += \"/\";\n }\n playUrl += \"p/\" + partnerId + \"/sp/\" + partnerId + \"00\" + \"/playManifest/entryId/\" + entryId + \"/protocol/\" + protocol + \"/format/\" + format;\n\n if (flavorIds != \"\") {\n playUrl += \"/falvorIds/\" + flavorIds;\n } else if (uiConfId != \"\") {\n playUrl += \"/uiConfId/\" + uiConfId;\n }\n\n if (this.ks != \"\") {\n playUrl += \"/ks/\" + ks;\n }\n\n playUrl += \"/a.\" + extension;\n\n if (uiConfId && flavorIds != \"\") {\n playUrl += \"?uiConfId=.\" + uiConfId;\n }\n\n return playUrl;\n }\n\n /**\n * Checks if given string end with search string\n * @param {string} string The given string\n * @param {string} searchString The string to search\n * @returns {boolean} Is given string end with search string\n */\n\n }, {\n key: \"endsWith\",\n value: function endsWith(string, searchString) {\n if (typeof string !== 'string') {\n return false;\n }\n if (typeof searchString !== 'string') {\n return false;\n }\n\n return string.indexOf(searchString, string.length - searchString.length) != -1;\n }\n }]);\n\n return PlaySourceUrlBuilder;\n}();\n\nexports.default = PlaySourceUrlBuilder;\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Ovp BE access control message\n * @classdesc\n */\nvar KalturaAccessControlMessage =\n\n/**\n * @constructor\n * @param {Object} data The json response\n */\n\n/**\n * @member - The access control message\n * @type {string}\n */\nfunction KalturaAccessControlMessage(data) {\n _classCallCheck(this, KalturaAccessControlMessage);\n\n this.message = data.message;\n this.code = data.code;\n}\n/**\n * @member - The access control message code\n * @@type {string}\n */\n;\n\nexports.default = KalturaAccessControlMessage;\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _baseServiceResult = __webpack_require__(4);\n\nvar _baseServiceResult2 = _interopRequireDefault(_baseServiceResult);\n\nvar _kalturaMediaEntry = __webpack_require__(12);\n\nvar _kalturaMediaEntry2 = _interopRequireDefault(_kalturaMediaEntry);\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\n/**\n * Ovp BE BaseEntryList service response\n * @classdesc\n */\nvar KalturaBaseEntryListResponse = function (_ServiceResult) {\n _inherits(KalturaBaseEntryListResponse, _ServiceResult);\n\n /**\n * @constructor\n * @param {Object} responseObj The json response\n */\n\n /**\n * @member - The total count\n * @type {number}\n */\n function KalturaBaseEntryListResponse(responseObj) {\n _classCallCheck(this, KalturaBaseEntryListResponse);\n\n var _this = _possibleConstructorReturn(this, (KalturaBaseEntryListResponse.__proto__ || Object.getPrototypeOf(KalturaBaseEntryListResponse)).call(this, responseObj));\n\n if (!_this.hasError) {\n _this.totalCount = responseObj.totalCount;\n if (_this.totalCount > 0) {\n _this.entries = [];\n responseObj.objects.map(function (entry) {\n return _this.entries.push(new _kalturaMediaEntry2.default(entry));\n });\n }\n }\n return _this;\n }\n /**\n * @member - The entries\n * @type {Array<KalturaMediaEntry>}\n */\n\n\n return KalturaBaseEntryListResponse;\n}(_baseServiceResult2.default);\n\nexports.default = KalturaBaseEntryListResponse;\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _enums = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Ovp BE DrmPlaybackPluginData\n * @classdesc\n */\nvar KalturaDrmPlaybackPluginData =\n\n/**\n * @constructor\n * @param {Object} drm The json response\n */\n\n/**\n * @member - The drm scheme\n * @type {Scheme}\n */\nfunction KalturaDrmPlaybackPluginData(drm) {\n _classCallCheck(this, KalturaDrmPlaybackPluginData);\n\n this.scheme = drm.scheme;\n this.licenseURL = drm.licenseURL;\n}\n\n/**\n * @member - The license URL\n * @type {string}\n */\n;\n\nexports.default = KalturaDrmPlaybackPluginData;\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _enums = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Ovp BE Metadata\n * @classdesc\n */\nvar KalturaMetadata =\n\n/**\n * @constructor\n * @param {Object} data The response\n */\nfunction KalturaMetadata(data) {\n _classCallCheck(this, KalturaMetadata);\n\n this.id = data.id;\n this.metadataProfileId = data.metadataProfileId;\n this.metadataProfileVersion = data.metadataProfileVersion;\n this.metadataProfileId = data.metadataProfileId;\n this.metadataObjectType = data.metadataObjectType;\n this.objectId = data.objectId;\n this.version = data.version;\n this.created = new Date(0);\n this.created.setUTCSeconds(data.createdAt);\n this.updated = new Date(0);\n this.updated.setUTCSeconds(data.updatedAt);\n this.status = data.status;\n this.xml = data.xml;\n}\n/**\n * @member - The Metadata xml - represented as XML string\n * @type {string}\n */\n;\n\nexports.default = KalturaMetadata;\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _enums = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Ovp BE rule action\n * @classdesc\n */\nvar KalturaRuleAction =\n\n/**\n * @constructor\n * @param {Object} data The response\n */\nfunction KalturaRuleAction(data) {\n _classCallCheck(this, KalturaRuleAction);\n\n this.type = data.type;\n}\n/**\n * @member - The type of the action\n * @type {KalturaRuleActionType}\n */\n;\n\nexports.default = KalturaRuleAction;\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _baseServiceResult = __webpack_require__(4);\n\nvar _baseServiceResult2 = _interopRequireDefault(_baseServiceResult);\n\nvar _enums = __webpack_require__(2);\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\n/**\n * Ovp BE Ui config response\n * @classdesc\n */\nvar KalturaUiConfResponse = function (_ServiceResult) {\n _inherits(KalturaUiConfResponse, _ServiceResult);\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n\n /**\n * @member -plugins configuration represented as Json string\n * @type {string}\n */\n\n /**\n * @member -Name of the uiConf, this is not a primary key\n * @type {string}\n */\n function KalturaUiConfResponse(data) {\n _classCallCheck(this, KalturaUiConfResponse);\n\n var _this = _possibleConstructorReturn(this, (KalturaUiConfResponse.__proto__ || Object.getPrototypeOf(KalturaUiConfResponse)).call(this, data));\n\n if (!_this.hasError) {\n _this.name = data.name;\n\n _this.description = data.description;\n _this.objTypeAsString = data.objTypeAsString;\n _this.width = data.width;\n _this.height = data.height;\n _this.htmlParams = data.htmlParams;\n _this.swfUrl = data.swfUrl;\n _this.confFilePath = data.confFilePath;\n _this.confFile = data.confFile;\n _this.confFileFeatures = data.confFileFeatures;\n _this.config = data.config;\n _this.confVars = data.confVars;\n _this.useCdn = data.useCdn;\n _this.tags = data.tags;\n _this.swfUrlVersion = data.swfUrlVersion;\n _this.created = new Date(0);\n _this.created.setUTCSeconds(data.createdAt);\n _this.updated = new Date(0);\n _this.updated.setUTCSeconds(data.updatedAt);\n _this.html5Url = data.description;\n _this.version = data.description;\n _this.partnerTags = data.description;\n _this.objType = data.description;\n _this.creationMode = data.description;\n }\n return _this;\n }\n /**\n * @member -Name of the uiConf, this is not a primary key\n * @type {string}\n */\n\n\n return KalturaUiConfResponse;\n}(_baseServiceResult2.default);\n\nexports.default = KalturaUiConfResponse;\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _ovpService = __webpack_require__(3);\n\nvar _ovpService2 = _interopRequireDefault(_ovpService);\n\nvar _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\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\nvar SERVICE_NAME = \"baseEntry\";\n\n/**\n * Ovp BaseEntry service methods\n * @classdesc\n */\n\nvar BaseEntryService = function (_OvpService) {\n _inherits(BaseEntryService, _OvpService);\n\n function BaseEntryService() {\n _classCallCheck(this, BaseEntryService);\n\n return _possibleConstructorReturn(this, (BaseEntryService.__proto__ || Object.getPrototypeOf(BaseEntryService)).apply(this, arguments));\n }\n\n _createClass(BaseEntryService, null, [{\n key: 'getPlaybackContext',\n\n\n /**\n * Creates an instance of RequestBuilder for baseentry.getPlaybackContext\n * @function getPlaybackContext\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function getPlaybackContext(baseUrl, ks, entryId) {\n var request = new _requestBuilder2.default();\n request.service = SERVICE_NAME;\n request.action = \"getPlaybackContext\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"baseEntry-getPlaybackContext\";\n var contextDataParams = { objectType: \"KalturaContextDataParams\", flavorTags: \"all\" };\n var params = { entryId: entryId, ks: ks, contextDataParams: contextDataParams };\n request.params = params;\n return request;\n }\n\n /**\n * Creates an instance of RequestBuilder for baseentry.list\n * @function list\n * @param {string} baseUrl The base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n\n }, {\n key: 'list',\n value: function list(baseUrl, ks, entryId) {\n var request = new _requestBuilder2.default();\n request.service = SERVICE_NAME;\n request.action = \"list\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"list\";\n request.params = BaseEntryService.getEntryListReqParams(entryId, ks);\n return request;\n }\n\n /**\n * Gets baseentry.list service params\n * @function getEntryListReqParams\n * @param {string} entryId The entry ID\n * @param {string} ks The ks\n * @returns {{ks: string, filter: {redirectFromEntryId: string}, responseProfile: {fields: string, type: number}}} The service params object\n * @static\n */\n\n }, {\n key: 'getEntryListReqParams',\n value: function getEntryListReqParams(entryId, ks) {\n var filterParams = { redirectFromEntryId: entryId };\n var responseProfileParams = {\n fields: \"id,name,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags\",\n type: 1\n };\n return { ks: ks, filter: filterParams, responseProfile: responseProfileParams };\n }\n }]);\n\n return BaseEntryService;\n}(_ovpService2.default);\n\nexports.default = BaseEntryService;\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _ovpService = __webpack_require__(3);\n\nvar _ovpService2 = _interopRequireDefault(_ovpService);\n\nvar _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\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\nvar SERVICE_NAME = \"metadata_metadata\";\n\n/**\n * Ovp metadata_metadata service methods\n * @classdesc\n */\n\nvar MetaDataService = function (_OvpService) {\n _inherits(MetaDataService, _OvpService);\n\n function MetaDataService() {\n _classCallCheck(this, MetaDataService);\n\n return _possibleConstructorReturn(this, (MetaDataService.__proto__ || Object.getPrototypeOf(MetaDataService)).apply(this, arguments));\n }\n\n _createClass(MetaDataService, null, [{\n key: 'list',\n\n /**\n * Creates an instance of RequestBuilder for metadata_metadata.list\n * @function getPlaybackContext\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function list(baseUrl, ks, entryId) {\n var request = new _requestBuilder2.default();\n request.service = SERVICE_NAME;\n request.action = \"list\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"metadata_metadata-list\";\n var filter = { objectType: \"KalturaMetadataFilter\", objectIdEqual: entryId, metadataObjectTypeEqual: \"1\" };\n var params = { filter: filter, ks: ks };\n request.params = params;\n return request;\n }\n }]);\n\n return MetaDataService;\n}(_ovpService2.default);\n\nexports.default = MetaDataService;\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _ovpService = __webpack_require__(3);\n\nvar _ovpService2 = _interopRequireDefault(_ovpService);\n\nvar _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\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\nvar SERVICE_NAME = \"session\";\n\n/**\n * Ovp session service methods\n * @classdesc\n */\n\nvar SessionService = function (_OvpService) {\n _inherits(SessionService, _OvpService);\n\n function SessionService() {\n _classCallCheck(this, SessionService);\n\n return _possibleConstructorReturn(this, (SessionService.__proto__ || Object.getPrototypeOf(SessionService)).apply(this, arguments));\n }\n\n _createClass(SessionService, null, [{\n key: 'anonymousSession',\n\n /**\n * Creates an instance of RequestBuilder for session.startWidgetSession\n * @function anonymousSession\n * @param {string} baseUrl The service base URL\n * @param {string} partnerId The partner ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function anonymousSession(baseUrl, partnerId) {\n var request = new _requestBuilder2.default();\n request.service = SERVICE_NAME;\n request.action = \"startWidgetSession\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"session-startWidget\";\n request.params = { widgetId: \"_\" + partnerId };\n return request;\n }\n }]);\n\n return SessionService;\n}(_ovpService2.default);\n\nexports.default = SessionService;\n\n/***/ }),\n/* 35 */,\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _ovpService = __webpack_require__(3);\n\nvar _ovpService2 = _interopRequireDefault(_ovpService);\n\nvar _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\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\nvar SERVICE_NAME = \"uiconf\";\n\n/**\n * Ovp uiconf service methods\n * @classdesc\n */\n\nvar UiConfService = function (_OvpService) {\n _inherits(UiConfService, _OvpService);\n\n function UiConfService() {\n _classCallCheck(this, UiConfService);\n\n return _possibleConstructorReturn(this, (UiConfService.__proto__ || Object.getPrototypeOf(UiConfService)).apply(this, arguments));\n }\n\n _createClass(UiConfService, null, [{\n key: 'get',\n\n /**\n * Creates an instance of RequestBuilder for uiconf.get\n * @function get\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} uiConfID The uiConf ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function get(baseUrl, ks, uiConfID) {\n var request = new _requestBuilder2.default();\n request.service = SERVICE_NAME;\n request.action = \"get\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"uiconf-get\";\n var responseProfileParams = {\n fields: \"config\",\n type: 1\n };\n request.params = { id: uiConfID, responseProfile: responseProfileParams, ks: ks };\n return request;\n }\n }]);\n\n return UiConfService;\n}(_ovpService2.default);\n\nexports.default = UiConfService;\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 * Xml parser\n * @classdesc\n */\nvar XmlParser = function () {\n function XmlParser() {\n _classCallCheck(this, XmlParser);\n }\n\n _createClass(XmlParser, null, [{\n key: \"xmlToJson\",\n\n /**\n * Parses xml string to json object\n * @param {string} xml The xml to parse\n * @returns {{}} The parsed xml as Json object\n * @static\n */\n value: function xmlToJson(xml) {\n var obj = {};\n if (xml.nodeType == 1) {\n if (xml.attributes.length > 0) {\n obj[\"@attributes\"] = {};\n for (var j = 0; j < xml.attributes.length; j++) {\n var attribute = xml.attributes.item(j);\n obj[\"@attributes\"][attribute.nodeName] = attribute.nodeValue;\n }\n }\n } else if (xml.nodeType == 3) {\n obj = xml.nodeValue;\n }\n if (xml.hasChildNodes()) {\n for (var i = 0; i < xml.childNodes.length; i++) {\n var item = xml.childNodes.item(i);\n var nodeName = item.nodeName;\n if (typeof obj[nodeName] == \"undefined\") {\n obj[nodeName] = this.xmlToJson(item);\n } else {\n if (typeof obj[nodeName].push == \"undefined\") {\n var old = obj[nodeName];\n obj[nodeName] = [];\n obj[nodeName].push(old);\n }\n obj[nodeName].push(this.xmlToJson(item));\n }\n }\n }\n return obj;\n }\n }]);\n\n return XmlParser;\n}();\n\nexports.default = XmlParser;\n\n/***/ })\n/******/ ]);\n});\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(0));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsUi\"] = factory(require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsUi\"] = factory(root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_48__) {\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/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 28);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n!function() {\n 'use strict';\n function VNode() {}\n function h(nodeName, attributes) {\n var lastSimple, child, simple, i, children = EMPTY_CHILDREN;\n for (i = arguments.length; i-- > 2; ) stack.push(arguments[i]);\n if (attributes && null != attributes.children) {\n if (!stack.length) stack.push(attributes.children);\n delete attributes.children;\n }\n while (stack.length) if ((child = stack.pop()) && void 0 !== child.pop) for (i = child.length; i--; ) stack.push(child[i]); else {\n if (child === !0 || child === !1) child = null;\n if (simple = 'function' != typeof nodeName) if (null == child) child = ''; else if ('number' == typeof child) child = String(child); else if ('string' != typeof child) simple = !1;\n if (simple && lastSimple) children[children.length - 1] += child; else if (children === EMPTY_CHILDREN) children = [ child ]; else children.push(child);\n lastSimple = simple;\n }\n var p = new VNode();\n p.nodeName = nodeName;\n p.children = children;\n p.attributes = null == attributes ? void 0 : attributes;\n p.key = null == attributes ? void 0 : attributes.key;\n if (void 0 !== options.vnode) options.vnode(p);\n return p;\n }\n function extend(obj, props) {\n for (var i in props) obj[i] = props[i];\n return obj;\n }\n function cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n }\n function enqueueRender(component) {\n if (!component.__d && (component.__d = !0) && 1 == items.push(component)) (options.debounceRendering || setTimeout)(rerender);\n }\n function rerender() {\n var p, list = items;\n items = [];\n while (p = list.pop()) if (p.__d) renderComponent(p);\n }\n function isSameNodeType(node, vnode, hydrating) {\n if ('string' == typeof vnode || 'number' == typeof vnode) return void 0 !== node.splitText;\n if ('string' == typeof vnode.nodeName) return !node._componentConstructor && isNamedNode(node, vnode.nodeName); else return hydrating || node._componentConstructor === vnode.nodeName;\n }\n function isNamedNode(node, nodeName) {\n return node.__n === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n }\n function getNodeProps(vnode) {\n var props = extend({}, vnode.attributes);\n props.children = vnode.children;\n var defaultProps = vnode.nodeName.defaultProps;\n if (void 0 !== defaultProps) for (var i in defaultProps) if (void 0 === props[i]) props[i] = defaultProps[i];\n return props;\n }\n function createNode(nodeName, isSvg) {\n var node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n node.__n = nodeName;\n return node;\n }\n function removeNode(node) {\n if (node.parentNode) node.parentNode.removeChild(node);\n }\n function setAccessor(node, name, old, value, isSvg) {\n if ('className' === name) name = 'class';\n if ('key' === name) ; else if ('ref' === name) {\n if (old) old(null);\n if (value) value(node);\n } else if ('class' === name && !isSvg) node.className = value || ''; else if ('style' === name) {\n if (!value || 'string' == typeof value || 'string' == typeof old) node.style.cssText = value || '';\n if (value && 'object' == typeof value) {\n if ('string' != typeof old) for (var i in old) if (!(i in value)) node.style[i] = '';\n for (var i in value) node.style[i] = 'number' == typeof value[i] && IS_NON_DIMENSIONAL.test(i) === !1 ? value[i] + 'px' : value[i];\n }\n } else if ('dangerouslySetInnerHTML' === name) {\n if (value) node.innerHTML = value.__html || '';\n } else if ('o' == name[0] && 'n' == name[1]) {\n var useCapture = name !== (name = name.replace(/Capture$/, ''));\n name = name.toLowerCase().substring(2);\n if (value) {\n if (!old) node.addEventListener(name, eventProxy, useCapture);\n } else node.removeEventListener(name, eventProxy, useCapture);\n (node.__l || (node.__l = {}))[name] = value;\n } else if ('list' !== name && 'type' !== name && !isSvg && name in node) {\n setProperty(node, name, null == value ? '' : value);\n if (null == value || value === !1) node.removeAttribute(name);\n } else {\n var ns = isSvg && name !== (name = name.replace(/^xlink\\:?/, ''));\n if (null == value || value === !1) if (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase()); else node.removeAttribute(name); else if ('function' != typeof value) if (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value); else node.setAttribute(name, value);\n }\n }\n function setProperty(node, name, value) {\n try {\n node[name] = value;\n } catch (e) {}\n }\n function eventProxy(e) {\n return this.__l[e.type](options.event && options.event(e) || e);\n }\n function flushMounts() {\n var c;\n while (c = mounts.pop()) {\n if (options.afterMount) options.afterMount(c);\n if (c.componentDidMount) c.componentDidMount();\n }\n }\n function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n if (!diffLevel++) {\n isSvgMode = null != parent && void 0 !== parent.ownerSVGElement;\n hydrating = null != dom && !('__preactattr_' in dom);\n }\n var ret = idiff(dom, vnode, context, mountAll, componentRoot);\n if (parent && ret.parentNode !== parent) parent.appendChild(ret);\n if (!--diffLevel) {\n hydrating = !1;\n if (!componentRoot) flushMounts();\n }\n return ret;\n }\n function idiff(dom, vnode, context, mountAll, componentRoot) {\n var out = dom, prevSvgMode = isSvgMode;\n if (null == vnode) vnode = '';\n if ('string' == typeof vnode) {\n if (dom && void 0 !== dom.splitText && dom.parentNode && (!dom._component || componentRoot)) {\n if (dom.nodeValue != vnode) dom.nodeValue = vnode;\n } else {\n out = document.createTextNode(vnode);\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n recollectNodeTree(dom, !0);\n }\n }\n out.__preactattr_ = !0;\n return out;\n }\n if ('function' == typeof vnode.nodeName) return buildComponentFromVNode(dom, vnode, context, mountAll);\n isSvgMode = 'svg' === vnode.nodeName ? !0 : 'foreignObject' === vnode.nodeName ? !1 : isSvgMode;\n if (!dom || !isNamedNode(dom, String(vnode.nodeName))) {\n out = createNode(String(vnode.nodeName), isSvgMode);\n if (dom) {\n while (dom.firstChild) out.appendChild(dom.firstChild);\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n recollectNodeTree(dom, !0);\n }\n }\n var fc = out.firstChild, props = out.__preactattr_ || (out.__preactattr_ = {}), vchildren = vnode.children;\n if (!hydrating && vchildren && 1 === vchildren.length && 'string' == typeof vchildren[0] && null != fc && void 0 !== fc.splitText && null == fc.nextSibling) {\n if (fc.nodeValue != vchildren[0]) fc.nodeValue = vchildren[0];\n } else if (vchildren && vchildren.length || null != fc) innerDiffNode(out, vchildren, context, mountAll, hydrating || null != props.dangerouslySetInnerHTML);\n diffAttributes(out, vnode.attributes, props);\n isSvgMode = prevSvgMode;\n return out;\n }\n function innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n var j, c, vchild, child, originalChildren = dom.childNodes, children = [], keyed = {}, keyedLen = 0, min = 0, len = originalChildren.length, childrenLen = 0, vlen = vchildren ? vchildren.length : 0;\n if (0 !== len) for (var i = 0; i < len; i++) {\n var _child = originalChildren[i], props = _child.__preactattr_, key = vlen && props ? _child._component ? _child._component.__k : props.key : null;\n if (null != key) {\n keyedLen++;\n keyed[key] = _child;\n } else if (props || (void 0 !== _child.splitText ? isHydrating ? _child.nodeValue.trim() : !0 : isHydrating)) children[childrenLen++] = _child;\n }\n if (0 !== vlen) for (var i = 0; i < vlen; i++) {\n vchild = vchildren[i];\n child = null;\n var key = vchild.key;\n if (null != key) {\n if (keyedLen && void 0 !== keyed[key]) {\n child = keyed[key];\n keyed[key] = void 0;\n keyedLen--;\n }\n } else if (!child && min < childrenLen) for (j = min; j < childrenLen; j++) if (void 0 !== children[j] && isSameNodeType(c = children[j], vchild, isHydrating)) {\n child = c;\n children[j] = void 0;\n if (j === childrenLen - 1) childrenLen--;\n if (j === min) min++;\n break;\n }\n child = idiff(child, vchild, context, mountAll);\n if (child && child !== dom) if (i >= len) dom.appendChild(child); else if (child !== originalChildren[i]) if (child === originalChildren[i + 1]) removeNode(originalChildren[i]); else dom.insertBefore(child, originalChildren[i] || null);\n }\n if (keyedLen) for (var i in keyed) if (void 0 !== keyed[i]) recollectNodeTree(keyed[i], !1);\n while (min <= childrenLen) if (void 0 !== (child = children[childrenLen--])) recollectNodeTree(child, !1);\n }\n function recollectNodeTree(node, unmountOnly) {\n var component = node._component;\n if (component) unmountComponent(component); else {\n if (null != node.__preactattr_ && node.__preactattr_.ref) node.__preactattr_.ref(null);\n if (unmountOnly === !1 || null == node.__preactattr_) removeNode(node);\n removeChildren(node);\n }\n }\n function removeChildren(node) {\n node = node.lastChild;\n while (node) {\n var next = node.previousSibling;\n recollectNodeTree(node, !0);\n node = next;\n }\n }\n function diffAttributes(dom, attrs, old) {\n var name;\n for (name in old) if ((!attrs || null == attrs[name]) && null != old[name]) setAccessor(dom, name, old[name], old[name] = void 0, isSvgMode);\n for (name in attrs) if (!('children' === name || 'innerHTML' === name || name in old && attrs[name] === ('value' === name || 'checked' === name ? dom[name] : old[name]))) setAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n }\n function collectComponent(component) {\n var name = component.constructor.name;\n (components[name] || (components[name] = [])).push(component);\n }\n function createComponent(Ctor, props, context) {\n var inst, list = components[Ctor.name];\n if (Ctor.prototype && Ctor.prototype.render) {\n inst = new Ctor(props, context);\n Component.call(inst, props, context);\n } else {\n inst = new Component(props, context);\n inst.constructor = Ctor;\n inst.render = doRender;\n }\n if (list) for (var i = list.length; i--; ) if (list[i].constructor === Ctor) {\n inst.__b = list[i].__b;\n list.splice(i, 1);\n break;\n }\n return inst;\n }\n function doRender(props, state, context) {\n return this.constructor(props, context);\n }\n function setComponentProps(component, props, opts, context, mountAll) {\n if (!component.__x) {\n component.__x = !0;\n if (component.__r = props.ref) delete props.ref;\n if (component.__k = props.key) delete props.key;\n if (!component.base || mountAll) {\n if (component.componentWillMount) component.componentWillMount();\n } else if (component.componentWillReceiveProps) component.componentWillReceiveProps(props, context);\n if (context && context !== component.context) {\n if (!component.__c) component.__c = component.context;\n component.context = context;\n }\n if (!component.__p) component.__p = component.props;\n component.props = props;\n component.__x = !1;\n if (0 !== opts) if (1 === opts || options.syncComponentUpdates !== !1 || !component.base) renderComponent(component, 1, mountAll); else enqueueRender(component);\n if (component.__r) component.__r(component);\n }\n }\n function renderComponent(component, opts, mountAll, isChild) {\n if (!component.__x) {\n var rendered, inst, cbase, props = component.props, state = component.state, context = component.context, previousProps = component.__p || props, previousState = component.__s || state, previousContext = component.__c || context, isUpdate = component.base, nextBase = component.__b, initialBase = isUpdate || nextBase, initialChildComponent = component._component, skip = !1;\n if (isUpdate) {\n component.props = previousProps;\n component.state = previousState;\n component.context = previousContext;\n if (2 !== opts && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === !1) skip = !0; else if (component.componentWillUpdate) component.componentWillUpdate(props, state, context);\n component.props = props;\n component.state = state;\n component.context = context;\n }\n component.__p = component.__s = component.__c = component.__b = null;\n component.__d = !1;\n if (!skip) {\n rendered = component.render(props, state, context);\n if (component.getChildContext) context = extend(extend({}, context), component.getChildContext());\n var toUnmount, base, childComponent = rendered && rendered.nodeName;\n if ('function' == typeof childComponent) {\n var childProps = getNodeProps(rendered);\n inst = initialChildComponent;\n if (inst && inst.constructor === childComponent && childProps.key == inst.__k) setComponentProps(inst, childProps, 1, context, !1); else {\n toUnmount = inst;\n component._component = inst = createComponent(childComponent, childProps, context);\n inst.__b = inst.__b || nextBase;\n inst.__u = component;\n setComponentProps(inst, childProps, 0, context, !1);\n renderComponent(inst, 1, mountAll, !0);\n }\n base = inst.base;\n } else {\n cbase = initialBase;\n toUnmount = initialChildComponent;\n if (toUnmount) cbase = component._component = null;\n if (initialBase || 1 === opts) {\n if (cbase) cbase._component = null;\n base = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, !0);\n }\n }\n if (initialBase && base !== initialBase && inst !== initialChildComponent) {\n var baseParent = initialBase.parentNode;\n if (baseParent && base !== baseParent) {\n baseParent.replaceChild(base, initialBase);\n if (!toUnmount) {\n initialBase._component = null;\n recollectNodeTree(initialBase, !1);\n }\n }\n }\n if (toUnmount) unmountComponent(toUnmount);\n component.base = base;\n if (base && !isChild) {\n var componentRef = component, t = component;\n while (t = t.__u) (componentRef = t).base = base;\n base._component = componentRef;\n base._componentConstructor = componentRef.constructor;\n }\n }\n if (!isUpdate || mountAll) mounts.unshift(component); else if (!skip) {\n flushMounts();\n if (component.componentDidUpdate) component.componentDidUpdate(previousProps, previousState, previousContext);\n if (options.afterUpdate) options.afterUpdate(component);\n }\n if (null != component.__h) while (component.__h.length) component.__h.pop().call(component);\n if (!diffLevel && !isChild) flushMounts();\n }\n }\n function buildComponentFromVNode(dom, vnode, context, mountAll) {\n var c = dom && dom._component, originalComponent = c, oldDom = dom, isDirectOwner = c && dom._componentConstructor === vnode.nodeName, isOwner = isDirectOwner, props = getNodeProps(vnode);\n while (c && !isOwner && (c = c.__u)) isOwner = c.constructor === vnode.nodeName;\n if (c && isOwner && (!mountAll || c._component)) {\n setComponentProps(c, props, 3, context, mountAll);\n dom = c.base;\n } else {\n if (originalComponent && !isDirectOwner) {\n unmountComponent(originalComponent);\n dom = oldDom = null;\n }\n c = createComponent(vnode.nodeName, props, context);\n if (dom && !c.__b) {\n c.__b = dom;\n oldDom = null;\n }\n setComponentProps(c, props, 1, context, mountAll);\n dom = c.base;\n if (oldDom && dom !== oldDom) {\n oldDom._component = null;\n recollectNodeTree(oldDom, !1);\n }\n }\n return dom;\n }\n function unmountComponent(component) {\n if (options.beforeUnmount) options.beforeUnmount(component);\n var base = component.base;\n component.__x = !0;\n if (component.componentWillUnmount) component.componentWillUnmount();\n component.base = null;\n var inner = component._component;\n if (inner) unmountComponent(inner); else if (base) {\n if (base.__preactattr_ && base.__preactattr_.ref) base.__preactattr_.ref(null);\n component.__b = base;\n removeNode(base);\n collectComponent(component);\n removeChildren(base);\n }\n if (component.__r) component.__r(null);\n }\n function Component(props, context) {\n this.__d = !0;\n this.context = context;\n this.props = props;\n this.state = this.state || {};\n }\n function render(vnode, parent, merge) {\n return diff(merge, vnode, {}, !1, parent, !1);\n }\n var options = {};\n var stack = [];\n var EMPTY_CHILDREN = [];\n var IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n var items = [];\n var mounts = [];\n var diffLevel = 0;\n var isSvgMode = !1;\n var hydrating = !1;\n var components = {};\n extend(Component.prototype, {\n setState: function(state, callback) {\n var s = this.state;\n if (!this.__s) this.__s = extend({}, s);\n extend(s, 'function' == typeof state ? state(s, this.props) : state);\n if (callback) (this.__h = this.__h || []).push(callback);\n enqueueRender(this);\n },\n forceUpdate: function(callback) {\n if (callback) (this.__h = this.__h || []).push(callback);\n renderComponent(this, 2);\n },\n render: function() {}\n });\n var preact = {\n h: h,\n createElement: h,\n cloneElement: cloneElement,\n Component: Component,\n render: render,\n rerender: rerender,\n options: options\n };\n if (true) module.exports = preact; else self.preact = preact;\n}();\n//# sourceMappingURL=preact.js.map\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function (global, factory) {\n\t true ? module.exports = factory(__webpack_require__(0), __webpack_require__(6)) :\n\ttypeof define === 'function' && define.amd ? define(['preact', 'redux'], factory) :\n\t(global.preactRedux = factory(global.preact,global.Redux));\n}(this, (function (preact,redux) {\n\nvar Children = {\n\tonly: function only(children) {\n\t\treturn children && children[0] || null;\n\t}\n};\n\nfunction proptype() {}\nproptype.isRequired = proptype;\n\nvar PropTypes = {\n\telement: proptype,\n\tfunc: proptype,\n\tshape: function shape() {\n\t\treturn proptype;\n\t},\n\tinstanceOf: function instanceOf() {\n\t\treturn proptype;\n\t}\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n};\n\n\n\n\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\n\n\n\n\n\n\n\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar get = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\nvar objectWithoutProperties = function (obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n};\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n\n\nvar set = function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if (\"value\" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n};\n\n// encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nvar CLEARED = null;\nvar nullListeners = {\n notify: function notify() {}\n};\n\nfunction createListenerCollection() {\n // the current/next pattern is copied from redux's createStore code.\n // TODO: refactor+expose that code to be reusable here?\n var current = [];\n var next = [];\n\n return {\n clear: function clear() {\n next = CLEARED;\n current = CLEARED;\n },\n notify: function notify() {\n var listeners = current = next;\n for (var i = 0; i < listeners.length; i++) {\n listeners[i]();\n }\n },\n subscribe: function subscribe(listener) {\n var isSubscribed = true;\n if (next === current) next = current.slice();\n next.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed || current === CLEARED) return;\n isSubscribed = false;\n\n if (next === current) next = current.slice();\n next.splice(next.indexOf(listener), 1);\n };\n }\n };\n}\n\nvar Subscription = function () {\n function Subscription(store, parentSub) {\n classCallCheck(this, Subscription);\n\n this.store = store;\n this.parentSub = parentSub;\n this.unsubscribe = null;\n this.listeners = nullListeners;\n }\n\n Subscription.prototype.addNestedSub = function addNestedSub(listener) {\n this.trySubscribe();\n return this.listeners.subscribe(listener);\n };\n\n Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() {\n this.listeners.notify();\n };\n\n Subscription.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.unsubscribe);\n };\n\n Subscription.prototype.trySubscribe = function trySubscribe() {\n if (!this.unsubscribe) {\n // this.onStateChange is set by connectAdvanced.initSubscription()\n this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);\n\n this.listeners = createListenerCollection();\n }\n };\n\n Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n this.listeners.clear();\n this.listeners = nullListeners;\n }\n };\n\n return Subscription;\n}();\n\nvar storeShape = PropTypes.shape({\n subscribe: PropTypes.func.isRequired,\n dispatch: PropTypes.func.isRequired,\n getState: PropTypes.func.isRequired\n});\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}\n\nvar didWarnAboutReceivingStore = false;\nfunction warnAboutReceivingStore() {\n if (didWarnAboutReceivingStore) {\n return;\n }\n didWarnAboutReceivingStore = true;\n\n warning('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');\n}\n\nvar Provider = function (_Component) {\n inherits(Provider, _Component);\n\n Provider.prototype.getChildContext = function getChildContext() {\n return { store: this.store, storeSubscription: null };\n };\n\n function Provider(props, context) {\n classCallCheck(this, Provider);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.store = props.store;\n return _this;\n }\n\n Provider.prototype.render = function render() {\n return Children.only(this.props.children);\n };\n\n return Provider;\n}(preact.Component);\n\n{\n Provider.prototype.componentWillReceiveProps = function (nextProps) {\n var store = this.store;\n var nextStore = nextProps.store;\n\n\n if (store !== nextStore) {\n warnAboutReceivingStore();\n }\n };\n}\n\nProvider.childContextTypes = {\n store: storeShape.isRequired,\n storeSubscription: PropTypes.instanceOf(Subscription)\n};\nProvider.displayName = 'Provider';\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\n\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n arguments: true,\n arity: true\n};\n\nvar isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function';\n\nvar index = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n var keys = Object.getOwnPropertyNames(sourceComponent);\n\n /* istanbul ignore else */\n if (isGetOwnPropertySymbolsAvailable) {\n keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent));\n }\n\n for (var i = 0; i < keys.length; ++i) {\n if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) {\n try {\n targetComponent[keys[i]] = sourceComponent[keys[i]];\n } catch (error) {}\n }\n }\n }\n\n return targetComponent;\n};\n\nvar invariant = function () {}\n\nvar hotReloadingVersion = 0;\nfunction connectAdvanced(\n/*\n selectorFactory is a func that is responsible for returning the selector function used to\n compute new props from state, props, and dispatch. For example:\n export default connectAdvanced((dispatch, options) => (state, props) => ({\n thing: state.things[props.thingId],\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\n }))(YourComponent)\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\n props. Do not use connectAdvanced directly without memoizing results between calls to your\n selector, otherwise the Connect component will re-render on every state or props change.\n*/\nselectorFactory) {\n var _contextTypes, _childContextTypes;\n\n var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n var _ref$getDisplayName = _ref.getDisplayName;\n var getDisplayName = _ref$getDisplayName === undefined ? function (name) {\n return 'ConnectAdvanced(' + name + ')';\n } : _ref$getDisplayName;\n var _ref$methodName = _ref.methodName;\n var methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName;\n var _ref$renderCountProp = _ref.renderCountProp;\n var renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp;\n var _ref$shouldHandleStat = _ref.shouldHandleStateChanges;\n var shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat;\n var _ref$storeKey = _ref.storeKey;\n var storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey;\n var _ref$withRef = _ref.withRef;\n var withRef = _ref$withRef === undefined ? false : _ref$withRef;\n var connectOptions = objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']);\n\n var subscriptionKey = storeKey + 'Subscription';\n var version = hotReloadingVersion++;\n\n var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = storeShape, _contextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _contextTypes);\n var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _childContextTypes);\n\n return function wrapWithConnect(WrappedComponent) {\n invariant(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + WrappedComponent));\n\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n withRef: withRef,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent\n });\n\n var Connect = function (_Component) {\n inherits(Connect, _Component);\n\n function Connect(props, context) {\n classCallCheck(this, Connect);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.version = version;\n _this.state = {};\n _this.renderCount = 0;\n _this.store = _this.props[storeKey] || _this.context[storeKey];\n _this.parentSub = props[subscriptionKey] || context[subscriptionKey];\n\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n\n invariant(_this.store, 'Could not find \"' + storeKey + '\" in either the context or ' + ('props of \"' + displayName + '\". ') + 'Either wrap the root component in a <Provider>, ' + ('or explicitly pass \"' + storeKey + '\" as a prop to \"' + displayName + '\".'));\n\n // make sure `getState` is properly bound in order to avoid breaking\n // custom store implementations that rely on the store's context\n _this.getState = _this.store.getState.bind(_this.store);\n\n _this.initSelector();\n _this.initSubscription();\n return _this;\n }\n\n Connect.prototype.getChildContext = function getChildContext() {\n var _ref2;\n\n return _ref2 = {}, _ref2[subscriptionKey] = this.subscription || this.parentSub, _ref2;\n };\n\n Connect.prototype.componentDidMount = function componentDidMount() {\n if (!shouldHandleStateChanges) return;\n\n // componentWillMount fires during server side rendering, but componentDidMount and\n // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.\n // Otherwise, unsubscription would never take place during SSR, causing a memory leak.\n // To handle the case where a child component may have triggered a state change by\n // dispatching an action in its componentWillMount, we have to re-run the select and maybe\n // re-render.\n this.subscription.trySubscribe();\n this.selector.run(this.props);\n if (this.selector.shouldComponentUpdate) this.forceUpdate();\n };\n\n Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n this.selector.run(nextProps);\n };\n\n Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() {\n return this.selector.shouldComponentUpdate;\n };\n\n Connect.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.subscription) this.subscription.tryUnsubscribe();\n // these are just to guard against extra memory leakage if a parent element doesn't\n // dereference this instance properly, such as an async callback that never finishes\n this.subscription = null;\n this.store = null;\n this.parentSub = null;\n this.selector.run = function () {};\n };\n\n Connect.prototype.getWrappedInstance = function getWrappedInstance() {\n invariant(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.'));\n return this.wrappedInstance;\n };\n\n Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) {\n this.wrappedInstance = ref;\n };\n\n Connect.prototype.initSelector = function initSelector() {\n var dispatch = this.store.dispatch;\n var getState = this.getState;\n\n var sourceSelector = selectorFactory(dispatch, selectorFactoryOptions);\n\n // wrap the selector in an object that tracks its results between runs\n var selector = this.selector = {\n shouldComponentUpdate: true,\n props: sourceSelector(getState(), this.props),\n run: function runComponentSelector(props) {\n try {\n var nextProps = sourceSelector(getState(), props);\n if (selector.error || nextProps !== selector.props) {\n selector.shouldComponentUpdate = true;\n selector.props = nextProps;\n selector.error = null;\n }\n } catch (error) {\n selector.shouldComponentUpdate = true;\n selector.error = error;\n }\n }\n };\n };\n\n Connect.prototype.initSubscription = function initSubscription() {\n var _this2 = this;\n\n if (shouldHandleStateChanges) {\n (function () {\n var subscription = _this2.subscription = new Subscription(_this2.store, _this2.parentSub);\n var dummyState = {};\n\n subscription.onStateChange = function onStateChange() {\n this.selector.run(this.props);\n\n if (!this.selector.shouldComponentUpdate) {\n subscription.notifyNestedSubs();\n } else {\n this.componentDidUpdate = function componentDidUpdate() {\n this.componentDidUpdate = undefined;\n subscription.notifyNestedSubs();\n };\n\n this.setState(dummyState);\n }\n }.bind(_this2);\n })();\n }\n };\n\n Connect.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.subscription) && this.subscription.isSubscribed();\n };\n\n Connect.prototype.addExtraProps = function addExtraProps(props) {\n if (!withRef && !renderCountProp) return props;\n // make a shallow copy so that fields added don't leak to the original selector.\n // this is especially important for 'ref' since that's a reference back to the component\n // instance. a singleton memoized selector would then be holding a reference to the\n // instance, preventing the instance from being garbage collected, and that would be bad\n var withExtras = _extends({}, props);\n if (withRef) withExtras.ref = this.setWrappedInstance;\n if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;\n return withExtras;\n };\n\n Connect.prototype.render = function render() {\n var selector = this.selector;\n selector.shouldComponentUpdate = false;\n\n if (selector.error) {\n throw selector.error;\n } else {\n return preact.h(WrappedComponent, this.addExtraProps(selector.props));\n }\n };\n\n return Connect;\n }(preact.Component);\n\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = displayName;\n Connect.childContextTypes = childContextTypes;\n Connect.contextTypes = contextTypes;\n\n\n {\n Connect.prototype.componentWillUpdate = function componentWillUpdate() {\n // We are hot reloading!\n if (this.version !== version) {\n this.version = version;\n this.initSelector();\n\n if (this.subscription) this.subscription.tryUnsubscribe();\n this.initSubscription();\n if (shouldHandleStateChanges) this.subscription.trySubscribe();\n }\n };\n }\n\n return index(Connect, WrappedComponent);\n };\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n\n var countA = 0;\n var countB = 0;\n\n for (var key in a) {\n if (hasOwn.call(a, key) && a[key] !== b[key]) return false;\n countA++;\n }\n\n for (var _key in b) {\n if (hasOwn.call(b, _key)) countB++;\n }\n\n return countA === countB;\n}\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetPrototype = Object.getPrototypeOf;\n\n/**\n * Gets the `[[Prototype]]` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {null|Object} Returns the `[[Prototype]]`.\n */\nfunction getPrototype(value) {\n return nativeGetPrototype(Object(value));\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 * 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 === 'undefined' ? 'undefined' : _typeof(value)) == 'object';\n}\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = Function.prototype.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/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\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,\n * 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) || 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' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;\n}\n\nfunction verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.');\n }\n}\n\nfunction wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n}\n\n// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n// \n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\nfunction getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\n\n// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n// \n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n// \n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n// \n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n// \nfunction wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}\n\nfunction whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\n\nfunction whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return { dispatch: dispatch };\n }) : undefined;\n}\n\nfunction whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && (typeof mapDispatchToProps === 'undefined' ? 'undefined' : _typeof(mapDispatchToProps)) === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return redux.bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\n\nvar defaultMapDispatchToPropsFactories = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];\n\nfunction whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\n\nfunction whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\n\nvar defaultMapStateToPropsFactories = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];\n\nfunction defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, stateProps, dispatchProps);\n}\n\nfunction wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName;\n var pure = _ref.pure;\n var areMergedPropsEqual = _ref.areMergedPropsEqual;\n\n var hasRunOnce = false;\n var mergedProps = void 0;\n\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n\n verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\n\nfunction whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\n\nfunction whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\n\nvar defaultMergePropsFactories = [whenMergePropsIsFunction, whenMergePropsIsOmitted];\n\nfunction verify(selector, methodName, displayName) {\n if (!selector) {\n throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.');\n } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {\n if (!selector.hasOwnProperty('dependsOnOwnProps')) {\n warning('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.');\n }\n }\n}\n\nfunction verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {\n verify(mapStateToProps, 'mapStateToProps', displayName);\n verify(mapDispatchToProps, 'mapDispatchToProps', displayName);\n verify(mergeProps, 'mergeProps', displayName);\n}\n\nfunction impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\n\nfunction pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual;\n var areOwnPropsEqual = _ref.areOwnPropsEqual;\n var areStatePropsEqual = _ref.areStatePropsEqual;\n\n var hasRunAtLeastOnce = false;\n var state = void 0;\n var ownProps = void 0;\n var stateProps = void 0;\n var dispatchProps = void 0;\n var mergedProps = void 0;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state);\n state = nextState;\n ownProps = nextOwnProps;\n\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n}\n\n// TODO: Add more comments\n\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nfunction finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps;\n var initMapDispatchToProps = _ref2.initMapDispatchToProps;\n var initMergeProps = _ref2.initMergeProps;\n var options = objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}\n\n/*\n connect is a facade over connectAdvanced. It turns its args into a compatible\n selectorFactory, which has the signature:\n\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\n \n connect passes its args to connectAdvanced as options, which will in turn pass them to\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\n\n selectorFactory returns a final props selector from its mapStateToProps,\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\n mergePropsFactories, and pure args.\n\n The resulting final props selector is called by the Connect component instance whenever\n it receives new props or store state.\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error('Invalid value of type ' + (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.');\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n}\n\n// createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\nfunction createConnect() {\n var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var _ref$connectHOC = _ref.connectHOC;\n var connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC;\n var _ref$mapStateToPropsF = _ref.mapStateToPropsFactories;\n var mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF;\n var _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories;\n var mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro;\n var _ref$mergePropsFactor = _ref.mergePropsFactories;\n var mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor;\n var _ref$selectorFactory = _ref.selectorFactory;\n var selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];\n\n var _ref2$pure = _ref2.pure;\n var pure = _ref2$pure === undefined ? true : _ref2$pure;\n var _ref2$areStatesEqual = _ref2.areStatesEqual;\n var areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual;\n var _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual;\n var areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua;\n var _ref2$areStatePropsEq = _ref2.areStatePropsEqual;\n var areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq;\n var _ref2$areMergedPropsE = _ref2.areMergedPropsEqual;\n var areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE;\n var extraOptions = objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}\n\nvar connect$1 = createConnect();\n\n\n\nvar lib$1 = {\n\tProvider: Provider,\n\tconnect: connect$1,\n\tconnectAdvanced: connectAdvanced\n};\n\nreturn lib$1;\n\n})));\n//# sourceMappingURL=preact-redux.js.map\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\n\nvar _playkitJs = __webpack_require__(48);\n\nvar _playkitJs2 = _interopRequireDefault(_playkitJs);\n\nvar _logger = __webpack_require__(49);\n\nvar _logger2 = _interopRequireDefault(_logger);\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\nvar BaseComponent = function (_Component) {\n _inherits(BaseComponent, _Component);\n\n function BaseComponent() {\n var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { config: {} };\n\n _classCallCheck(this, BaseComponent);\n\n var _this = _possibleConstructorReturn(this, (BaseComponent.__proto__ || Object.getPrototypeOf(BaseComponent)).call(this));\n\n _this.name = obj.name;\n _this.player = obj.player;\n _this.config = obj.config;\n _this.logger = _logger2.default.getLogger('UI ' + _this.name);\n _this.logger.debug('Initialized');\n return _this;\n }\n\n _createClass(BaseComponent, [{\n key: 'getConfig',\n value: function getConfig(attr) {\n if (attr) {\n return this.config[attr];\n }\n return this.config;\n }\n }, {\n key: 'defaultConfig',\n get: function get() {\n return {};\n }\n }]);\n\n return BaseComponent;\n}(_preact.Component);\n\nexports.default = BaseComponent;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports.bindActions = bindActions;\n\nvar _redux = __webpack_require__(6);\n\nfunction bindActions(actions) {\n\treturn function (dispatch) {\n\t\treturn _extends({}, (0, _redux.bindActionCreators)(actions, dispatch));\n\t};\n}\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\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\nvar Icon = function (_Component) {\n _inherits(Icon, _Component);\n\n function Icon() {\n _classCallCheck(this, Icon);\n\n return _possibleConstructorReturn(this, (Icon.__proto__ || Object.getPrototypeOf(Icon)).apply(this, arguments));\n }\n\n _createClass(Icon, [{\n key: 'render',\n value: function render(props) {\n switch (props.type) {\n case 'maximize':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-maximize', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M800 269.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z' }),\n (0, _preact.h)('path', { d: 'M224 754.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z' })\n );\n case 'minimize':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-minimize', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M672 306.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z' }),\n (0, _preact.h)('path', { d: 'M352 717.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z' })\n );\n\n case 'play':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-play', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M796.806 461.202c44.919 28.075 44.739 73.706 0 101.668l-459.472 287.171c-44.919 28.075-81.334 7.915-81.334-45.305v-585.4c0-53.096 36.595-73.266 81.334-45.305l459.472 287.171z' })\n );\n\n case 'pause':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-pause', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M256 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314zM640 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314z' })\n );\n\n case 'volume-base':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon volume-base', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M224 352l234.504-156.336c29.545-19.697 53.496-7.194 53.496 28.053v576.566c0 35.19-24.059 47.677-53.496 28.053l-234.504-156.336h-127.906c-17.725 0-32.094-14.581-32.094-31.853v-256.295c0-17.592 14.012-31.853 32.094-31.853h127.906zM288 637.748l160 106.667v-464.83l-160 106.667v251.496zM128 416v192h96v-192h-96z' })\n );\n\n case 'volume-waves':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon volume-waves', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M802.017 837.177c82.359-86.627 129.183-201.774 129.183-324.26 0-123.976-47.976-240.409-132.127-327.329-12.293-12.697-32.552-13.025-45.249-0.732s-13.025 32.552-0.732 45.249c72.692 75.084 114.109 175.597 114.109 282.812 0 105.928-40.422 205.331-111.566 280.162-12.177 12.808-11.666 33.063 1.143 45.24s33.063 11.666 45.24-1.143z' }),\n (0, _preact.h)('path', { d: 'M667.436 743.221c67.761-60.884 107.273-147.888 107.273-241.233 0-87.318-34.552-169.203-94.836-229.446-12.501-12.493-32.762-12.486-45.255 0.015s-12.486 32.762 0.015 45.255c48.375 48.342 76.075 113.989 76.075 184.176 0 75.021-31.679 144.776-86.048 193.627-13.146 11.812-14.227 32.044-2.416 45.19s32.044 14.227 45.19 2.416z' })\n );\n\n case 'volume-mute':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon volume-mute', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M768 466.745l-67.986-67.986c-12.213-12.213-32.654-12.393-45.151 0.104-12.584 12.584-12.543 32.711-0.104 45.151l67.986 67.986-67.986 67.986c-12.213 12.213-12.393 32.654 0.104 45.151 12.584 12.584 32.711 12.543 45.151 0.104l67.986-67.986 67.986 67.986c12.213 12.213 32.654 12.393 45.151-0.104 12.584-12.584 12.543-32.711 0.104-45.151l-67.986-67.986 67.986-67.986c12.213-12.213 12.393-32.654-0.104-45.151-12.584-12.584-32.711-12.543-45.151-0.104l-67.986 67.986z' })\n );\n\n case 'close':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-close', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M573.162 512l214.269-214.269c16.772-16.772 16.688-44.071-0.202-60.96-17.007-17.007-44.182-16.98-60.96-0.202l-214.269 214.269-214.269-214.269c-16.772-16.772-44.071-16.688-60.96 0.202-17.007 17.007-16.98 44.182-0.202 60.96l214.269 214.269-214.269 214.269c-16.772 16.772-16.688 44.071 0.202 60.96 17.007 17.007 44.182 16.98 60.96 0.202l214.269-214.269 214.269 214.269c16.772 16.772 44.071 16.688 60.96-0.202 17.007-17.007 16.98-44.182 0.202-60.96l-214.269-214.269z' })\n );\n\n case 'share':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-share', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.129-5.295 0-58.91 47.756-106.667 106.667-106.667s106.667 47.756 106.667 106.667c0 58.91-47.756 106.667-106.667 106.667-33.894 0-64.095-15.808-83.633-40.454l-236.467 142.445c-0.132-3.064-0.394-6.095-0.779-9.087l7.271-12.835-0.117 53.333-7.183-12.743c0.399-3.046 0.67-6.131 0.806-9.252l236.467 142.383c19.538-24.648 49.741-40.457 83.636-40.457 58.91 0 106.667 47.756 106.667 106.667s-47.756 106.667-106.667 106.667c-58.91 0-106.667-47.756-106.667-106.667 0-1.775 0.043-3.539 0.129-5.293l-236.19-142.216c-19.528 24.867-49.868 40.841-83.939 40.841-58.91 0-106.667-47.756-106.667-106.667s47.756-106.667 106.667-106.667c34.091 0 64.447 15.993 83.974 40.886zM234.667 554.667c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 341.333c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 768c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667z' })\n );\n\n case 'settings':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-share', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M829.945 549.126c2.784-24.116 2.784-48.445 0.269-70.702-1.182-6.772-7.090-11.696-13.674-11.641-33.039 0.582-62.975-19.389-75.126-50.118s-3.971-65.772 20.504-87.92c4.293-3.894 4.818-10.455 1.003-15.228-14.831-18.927-31.796-36.079-50.521-51.087-4.614-3.687-11.301-3.148-16.127 2.145-15.732 16.059-37.322 25.023-59.382 24.831-9.828 0.044-19.574-1.802-29.307-5.686-30.997-13.082-50.429-44.232-48.535-78.046 0.365-5.803-3.87-10.878-9.583-11.551-23.919-2.769-48.074-2.831-71.958-0.192-5.836 0.654-10.191 5.68-10.009 11.47 1.121 33.146-18.329 63.547-49.925 76.834-8.987 3.423-18.538 5.129-27.498 5.028-22.472 0.224-44.067-8.707-60.526-25.487-2.197-2.386-5.29-3.748-8.24-3.758-2.663 0.016-5.248 0.905-7.105 2.334-19.136 15.052-36.496 32.233-51.558 50.977-3.729 4.732-3.187 11.536 1.058 15.449 24.89 22.573 32.935 58.34 19.426 90.928-14.22 29.886-44.875 48.43-77.941 47.151-5.576-0.215-10.363 3.934-11.003 10.013-2.916 24.025-2.916 48.315-0.231 70.764 1.178 6.84 7.155 11.808 14.518 11.713l2.428 0.007c31.565 0.659 59.701 20.063 71.6 49.499 12.239 30.769 4.278 65.898-20.252 88.586-4.217 3.829-4.736 10.275-0.976 14.991 14.777 18.932 31.665 36.115 50.227 51.128 4.694 3.762 11.505 3.223 16.349-2.081 15.725-16.101 37.337-25.092 59.378-24.895 9.894-0.057 19.705 1.819 29.5 5.78 30.753 13.169 50.063 44.084 48.378 77.965-0.373 5.795 3.857 10.867 9.602 11.539 23.908 2.78 48.053 2.842 71.923 0.192 5.851-0.659 10.215-5.702 10.027-11.562-1.088-33.118 18.371-63.473 49.584-76.583 9.014-3.552 18.622-5.354 27.841-5.307 22.555-0.225 44.218 8.804 60.434 25.505 2.224 2.395 5.343 3.76 8.371 3.769 2.474-0.012 4.874-0.847 6.896-2.43 19.227-14.971 36.653-32.121 51.726-50.848 3.737-4.743 3.194-11.563-0.941-15.379-24.391-21.907-32.789-56.564-21.134-87.207s40.964-50.957 73.904-51.116h5.704c5.586-0.028 10.269-4.227 10.905-9.777zM893.526 556.438c-4.321 37.715-36.171 66.271-74.323 66.464h-5.711c-6.33 0.031-11.99 3.953-14.24 9.87s-0.629 12.609 4.385 17.116c29.020 26.748 32.567 71.325 7.936 102.582-18.378 22.837-39.342 43.468-62.397 61.42-13.128 10.284-29.303 15.909-46.22 15.991-21.004-0.056-41.043-8.825-54.839-23.692-3.514-3.616-8.356-5.634-13.867-5.583-1.555-0.007-3.097 0.282-3.877 0.581-6.088 2.559-9.967 8.609-9.749 15.235 1.257 39.227-27.828 72.841-66.88 77.241-28.725 3.189-57.719 3.114-86.45-0.227-39.585-4.631-68.615-39.444-66.083-78.749 0.331-6.679-3.529-12.859-9.057-15.234-1.449-0.585-2.998-0.881-5.025-0.873-5.074-0.045-9.947 1.982-12.693 4.763-26.775 29.494-71.875 33.067-103.071 8.066-22.458-18.164-42.771-38.831-60.335-61.337-24.602-30.847-21.012-75.5 7.982-101.818 4.881-4.515 6.479-11.568 4.088-17.58-2.239-5.538-7.562-9.209-12.866-9.327-39.748 0.506-72.828-26.991-79.581-66.425-3.538-29.147-3.538-58.616-0.060-87.234 4.085-39.084 37.791-68.296 77.064-66.784 7.502 0.29 14.456-3.916 17.001-9.164 2.519-6.098 0.94-13.122-4.133-17.724-29.022-26.738-32.57-71.311-7.956-102.538 18.292-22.765 39.115-43.375 62.322-61.626 13.199-10.169 29.368-15.731 46.323-15.833 21.063 0.065 41.146 8.908 54.704 23.656 3.559 3.623 8.44 5.642 14.175 5.592 1.605 0.017 3.199-0.268 3.668-0.426 6.11-2.574 9.998-8.651 9.771-15.356-1.228-39.209 27.864-72.786 66.897-77.161 28.715-3.173 57.697-3.098 86.456 0.231 39.539 4.653 68.54 39.409 66.051 78.92-0.369 6.596 3.446 12.713 8.931 15.035 1.507 0.6 3.114 0.905 5.156 0.898 5.087 0.044 9.973-1.985 12.671-4.704 26.66-29.444 71.625-33.068 102.694-8.244 22.604 18.117 43.043 38.781 60.715 61.337 24.728 30.927 21.142 75.751-8.215 102.378-4.724 4.275-6.301 11.031-3.958 16.955s8.114 9.775 14.774 9.659c38.18-0.325 70.992 27.018 77.822 66.463 3.343 28.966 3.343 58.22 0 87.185zM511.951 597.037c47.144-0.118 85.24-38.367 85.169-85.511 0-34.617-20.872-65.819-52.867-79.034s-68.802-5.836-93.231 18.69c-24.429 24.527-31.66 61.363-18.317 93.305s44.628 52.688 79.245 52.55zM512.158 661.036c-60.477 0.242-115.178-36.032-138.507-91.881s-10.686-120.254 32.026-163.138c42.712-42.884 107.066-55.785 163.008-32.679s92.434 77.661 92.434 138.139c0.124 82.417-66.545 149.353-148.962 149.559z' })\n );\n\n case 'check':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon check-icon', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M342.481 563.894c-12.577-12.416-32.838-12.285-45.254 0.292s-12.285 32.838 0.292 45.254l118.857 117.333c13.275 13.105 34.901 12.123 46.933-2.131l297.143-352c11.4-13.505 9.694-33.694-3.811-45.094s-33.694-9.694-45.094 3.811l-274.828 325.566-94.238-93.030z' })\n );\n case 'language':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon language-icon', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M625.773 808.031c29.752-39.944 63.443-97.069 83.311-168.977 41.798-3.715 74.872-8.022 98.271-11.57-32.456 82.71-98.638 148.558-181.582 180.547zM216.562 627.283c23.516 3.506 56.799 7.797 98.279 11.528 19.868 72.017 53.601 129.224 83.378 169.219-83.002-32.014-149.226-97.945-181.657-180.747zM400.147 215.201c-29.835 40.32-64.161 98.037-84.572 169.695-42.123 3.731-75.423 8.072-98.938 11.629 32.698-83.353 99.656-149.61 183.51-181.323zM807.438 396.725c-23.641-3.523-57.158-7.847-98.947-11.587-20.402-71.766-54.778-129.567-84.639-169.937 83.912 31.73 150.912 98.070 183.585 181.523zM720.095 436.644c48.952 4.817 84.472 10.209 102.995 13.331 3.99 20.068 6.127 40.796 6.127 62.024 0 21.262-2.137 42.031-6.152 62.141-18.248 3.172-53.376 8.615-102.753 13.448 3.84-23.908 6.069-49.102 6.069-75.59 0-26.296-2.304-51.431-6.286-75.356zM537.043 597.206v-170.396c48.576 0.551 92.653 2.646 131.178 5.426 5.050 25.119 8.072 51.74 8.072 79.763 0 28.216-2.913 54.87-7.789 79.939-38.283 2.713-82.343 4.742-131.462 5.267zM486.957 195.859v180.856c-43.175 0.442-82.443 1.995-117.429 4.149 31.939-95.382 89.99-161.656 112.237-184.612 1.72-0.159 3.464-0.259 5.192-0.392zM542.286 196.26c22.297 22.906 80.456 89.080 112.345 184.771-35.261-2.229-74.646-3.848-117.587-4.307v-180.864c1.745 0.142 3.506 0.234 5.242 0.401zM347.706 512c0-28.074 3.047-54.762 8.156-79.955 38.191-2.696 82.134-4.708 131.094-5.234v170.387c-48.71-0.551-92.895-2.655-131.495-5.443-4.858-25.018-7.755-51.606-7.755-79.755zM194.783 512c0-21.262 2.137-42.031 6.144-62.125 18.282-3.181 53.501-8.64 103.012-13.482-4.007 24-6.319 49.219-6.319 75.606 0 26.396 2.221 51.506 6.027 75.339-48.826-4.808-84.246-10.184-102.737-13.306-3.99-20.068-6.127-40.804-6.127-62.033zM481.338 827.706c-22.389-22.314-81.016-87.469-112.662-184.779 35.437 2.262 75.047 3.898 118.28 4.366v180.839c-1.87-0.142-3.757-0.25-5.618-0.426zM542.653 827.706c-1.862 0.175-3.74 0.284-5.61 0.426v-180.839c43.509-0.442 83.044-2.012 118.222-4.199-31.672 97.244-90.265 162.349-112.612 184.612zM512 128c-211.734 0-384 172.257-384 384 0 211.734 172.266 384 384 384s384-172.266 384-384c0-211.743-172.266-384-384-384z' })\n );\n\n default:\n break;\n }\n }\n }]);\n\n return Icon;\n}(_preact.Component);\n\nexports.default = Icon;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\nfunction n(n){return n&&\"object\"==typeof n&&\"default\"in n?n.default:n}function t(n){return null!==n&&void 0!==n}function r(n,t){var o=e({},n);for(var i in t)t.hasOwnProperty(i)&&(o[i]=n[i]&&t[i]&&\"object\"==typeof n[i]&&\"object\"==typeof t[i]?r(n[i],t[i]):n[i]||t[i]);return o}function e(n,t){for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function o(n){if(n=n||{},\"string\"==typeof n&&(n=n.split(\",\")),\"join\"in n){for(var t={},r=0;r<n.length;r++){var e=n[r].trim();e&&(t[e.split(\".\").pop()]=e)}return t}return n}function i(n,t){return v=t||h,n&&n.replace(/\\{\\{([\\w.-]+)\\}\\}/g,u)}function u(n,t){for(var r=t.split(\".\"),e=v,o=0;o<r.length;o++)if(null==(e=e[r[o]]))return\"\";return\"string\"==typeof e&&e.match(/\\{\\{/)&&(e=i(e,v)),e}function c(n,r,e,o,u,c){r&&(n=r+\".\"+n);var a=e&&f(e,n);return(u||0===u)&&a&&\"object\"==typeof a&&(a=a.splice?a[u]||a[0]:0===u&&t(a.none)?a.none:1===u&&t(a.one||a.singular)?a.one||a.singular:a.some||a.many||a.plural||a.other||a),a&&i(a,o)||c||null}function a(n,t,r){var i={};t=t||{},n=o(n);for(var u in n)if(n.hasOwnProperty(u)&&n[u]){var a=n[u];r||\"string\"!=typeof a?a.nodeName===g&&(a=e({fallback:a.children&&a.children[0]},a.attributes),i[u]=c(a.id,t.scope,t.dictionary,a.fields,a.plural,a.fallback)):i[u]=c(a,t.scope,t.dictionary)}return i}var l=__webpack_require__(0),f=n(__webpack_require__(44)),p=/[?&#]intl=show/,s=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getChildContext=function(){var n=this.props,t=n.scope,o=n.definition,i=n.mark,u=e({},this.context.intl||{});return t&&(u.scope=t),o&&(u.dictionary=r(u.dictionary||{},o)),(i||\"undefined\"!=typeof location&&String(location).match(p))&&(u.mark=!0),{intl:u}},t.prototype.render=function(n){var t=n.children;return t&&t[0]||null},t}(l.Component),d=function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];if(n.length>1){return y(n[0],n[1])}var r=n[0];return function(n){return y(n,r)}},y=function(n,t){return function(r){return l.h(s,t||{},l.h(n,r))}},h={},v,g=function(n,t){var r=n.id,e=n.children,o=n.plural,i=n.fields,u=t.intl,a=e&&e[0],p=c(r,u&&u.scope,u&&u.dictionary,i,o,a);if(u&&u.mark){var s=\"dictionary\"+(u&&u.scope?\".\"+u.scope:\"\")+\".\"+r;return l.h(\"mark\",{style:\"background: \"+(p?f(u,s)?\"rgba(119,231,117,.5)\":\"rgba(229,226,41,.5)\":\"rgba(228,147,51,.5)\"),title:r},p)}return p},b=function(n,t){var r=n.children,e=t.intl,o=r&&r[0];return o&&l.cloneElement(o,a(o.attributes,e,!0))},m=function(n){return function(t){return function(r,e){var o=\"function\"==typeof n?n(r):n,i=a(o,e.intl);return l.h(t,assign({},r,i))}}};d.intl=d,d.IntlProvider=s,d.Text=g,d.Localizer=b,d.withText=m,module.exports=d;\n//# sourceMappingURL=preact-i18n.js.map\n\n/***/ }),\n/* 6 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(12);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(41);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(42);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(43);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(16);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(7);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"createStore\", function() { return __WEBPACK_IMPORTED_MODULE_0__createStore__[\"b\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"combineReducers\", function() { return __WEBPACK_IMPORTED_MODULE_1__combineReducers__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"bindActionCreators\", function() { return __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"applyMiddleware\", function() { return __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"compose\", function() { return __WEBPACK_IMPORTED_MODULE_4__compose__[\"a\"]; });\n\n\n\n\n\n\n\n/*\n* This is a dummy function to check if the function name has been altered by minification.\n* If the function has been minified and NODE_ENV !== 'production', warn the user.\n*/\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n __WEBPACK_IMPORTED_MODULE_5__utils_warning__[\"a\" /* default */]('You are currently using minified code outside of NODE_ENV === \\'production\\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');\n}\n\n\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(11)))\n\n/***/ }),\n/* 7 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = warning;\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _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\nvar types = exports.types = {\n ADD_PLAYER_CLASS: 'shell/ADD_PLAYER_CLASS',\n REMOVE_PLAYER_CLASS: 'shell/REMOVE_PLAYER_CLASS',\n UPDATE_IS_MOBILE: 'shell/UPDATE_IS_MOBILE'\n};\n\nvar initialState = exports.initialState = {\n playerClasses: []\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.ADD_PLAYER_CLASS:\n return _extends({}, state, {\n playerClasses: [].concat(_toConsumableArray(state.playerClasses), [action.className])\n });\n\n case types.REMOVE_PLAYER_CLASS:\n return _extends({}, state, {\n playerClasses: state.playerClasses.filter(function (c) {\n return c !== action.className;\n })\n });\n\n case types.UPDATE_IS_MOBILE:\n return _extends({}, state, {\n isMobile: action.isMobile\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n addPlayerClass: function addPlayerClass(className) {\n return { type: types.ADD_PLAYER_CLASS, className: className };\n },\n removePlayerClass: function removePlayerClass(className) {\n return { type: types.REMOVE_PLAYER_CLASS, className: className };\n },\n updateIsMobile: function updateIsMobile(isMobile) {\n return { type: types.UPDATE_IS_MOBILE, isMobile: isMobile };\n }\n};\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n TOGGLE_PLAY: 'play-pause/TOGGLE_PLAY'\n};\n\nvar initialState = exports.initialState = {\n isPlaying: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.TOGGLE_PLAY:\n return _extends({}, state, {\n isPlaying: action.isPlaying\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n toggleIsPlaying: function toggleIsPlaying(isPlaying) {\n return { type: types.TOGGLE_PLAY, isPlaying: isPlaying };\n }\n};\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n TOGGLE_SHARE_OVERLAY: 'share/TOGGLE_SHARE_OVERLAY'\n};\n\nvar initialState = exports.initialState = {\n overlayOpen: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.TOGGLE_SHARE_OVERLAY:\n return _extends({}, state, {\n overlayOpen: action.show\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n toggleShareOverlay: function toggleShareOverlay(show) {\n return { type: types.TOGGLE_SHARE_OVERLAY, show: show };\n }\n};\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports) {\n\n// 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;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\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/* 12 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ActionTypes; });\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = createStore;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(13);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(37);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_symbol_observable__);\n\n\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar ActionTypes = {\n INIT: '@@redux/INIT'\n\n /**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n};function createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n function getState() {\n return currentState;\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected listener to be a function.');\n }\n\n var isSubscribed = true;\n\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n isSubscribed = false;\n\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action) {\n if (!__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__[\"a\" /* default */](action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer;\n dispatch({ type: ActionTypes.INIT });\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object') {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return { unsubscribe: unsubscribe };\n }\n }, _ref[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = function () {\n return this;\n }, _ref;\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch({ type: ActionTypes.INIT });\n\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = observable, _ref2;\n}\n\n/***/ }),\n/* 13 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(29);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(34);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(36);\n\n\n\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\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 * 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 (!__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__[\"a\" /* default */](value) || __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__[\"a\" /* default */](value) != objectTag) {\n return false;\n }\n var proto = __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__[\"a\" /* default */](value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isPlainObject);\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(30);\n\n\n/** Built-in value references. */\nvar Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__[\"a\" /* default */].Symbol;\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (Symbol);\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\nvar g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = compose;\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nfunction compose() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(undefined, arguments));\n };\n });\n}\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n UPDATE_PLAYER_STATE: 'engine/UPDATE_PLAYER_STATE',\n UPDATE_IS_PLAYING: 'engine/UPDATE_IS_PLAYING',\n UPDATE_CURRENT_TIME: 'engine/UPDATE_CURRENT_TIME',\n UPDATE_DURATION: 'engine/UPDATE_DURATION',\n UPDATE_VOLUME: 'engine/UPDATE_VOLUME',\n UPDATE_MUTED: 'engine/UPDATE_MUTED',\n UPDATE_METADATA_LOADING_STATUS: 'engine/UPDATE_METADATA_LOADING_STATUS',\n UPDATE_AUDIO_TRACKS: 'engine/UPDATE_AUDIO_TRACKS',\n UPDATE_VIDEO_TRACKS: 'engine/UPDATE_VIDEO_TRACKS',\n UPDATE_TEXT_TRACKS: 'engine/UPDATE_TEXT_TRACKS'\n};\n\nvar initialState = exports.initialState = {\n isPlaying: false,\n metadataLoaded: false,\n playerState: {\n previousState: '',\n currentState: ''\n },\n currentTime: 0,\n duration: 0,\n volume: 1,\n muted: false,\n videoTracks: [],\n audioTracks: [],\n textTracks: []\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.UPDATE_PLAYER_STATE:\n return _extends({}, state, {\n playerState: action.playerState\n });\n\n case types.UPDATE_IS_PLAYING:\n return _extends({}, state, {\n isPlaying: action.isPlaying\n });\n\n case types.UPDATE_CURRENT_TIME:\n return _extends({}, state, {\n currentTime: action.currentTime\n });\n\n case types.UPDATE_DURATION:\n return _extends({}, state, {\n duration: action.duration\n });\n\n case types.UPDATE_VOLUME:\n return _extends({}, state, {\n volume: action.volume\n });\n\n case types.UPDATE_MUTED:\n return _extends({}, state, {\n muted: action.muted\n });\n\n case types.UPDATE_METADATA_LOADING_STATUS:\n return _extends({}, state, {\n metadataLoaded: action.metadataLoaded\n });\n\n case types.UPDATE_AUDIO_TRACKS:\n return _extends({}, state, {\n audioTracks: action.tracks\n });\n\n case types.UPDATE_VIDEO_TRACKS:\n return _extends({}, state, {\n videoTracks: action.tracks\n });\n\n case types.UPDATE_TEXT_TRACKS:\n return _extends({}, state, {\n textTracks: action.tracks\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n updatePlayerState: function updatePlayerState(prevoiusState, currentState) {\n return { type: types.UPDATE_PLAYER_STATE, playerState: { prevoiusState: prevoiusState, currentState: currentState } };\n },\n updateIsPlaying: function updateIsPlaying(isPlaying) {\n return { type: types.UPDATE_IS_PLAYING, isPlaying: isPlaying };\n },\n updateCurrentTime: function updateCurrentTime(currentTime) {\n return { type: types.UPDATE_CURRENT_TIME, currentTime: currentTime };\n },\n updateDuration: function updateDuration(duration) {\n return { type: types.UPDATE_DURATION, duration: duration };\n },\n updateVolume: function updateVolume(volume) {\n return { type: types.UPDATE_VOLUME, volume: volume };\n },\n updateMuted: function updateMuted(muted) {\n return { type: types.UPDATE_MUTED, muted: muted };\n },\n updateMetadataLoadingStatus: function updateMetadataLoadingStatus(metadataLoaded) {\n return { type: types.UPDATE_METADATA_LOADING_STATUS, metadataLoaded: metadataLoaded };\n },\n updateAudioTracks: function updateAudioTracks(tracks) {\n return { type: types.UPDATE_AUDIO_TRACKS, tracks: tracks };\n },\n updateVideoTracks: function updateVideoTracks(tracks) {\n return { type: types.UPDATE_VIDEO_TRACKS, tracks: tracks };\n },\n updateTextTracks: function updateTextTracks(tracks) {\n return { type: types.UPDATE_TEXT_TRACKS, tracks: tracks };\n }\n};\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n UPDATE_SEEKBAR_DRAGGING_STATUS: 'seekbar/UPDATE_SEEKBAR_DRAGGING_STATUS',\n UPDATE_CURRENT_TIME: 'seekbar/UPDATE_CURRENT_TIME',\n UPDATE_DURATION: 'seekbar/UPDATE_DURATION'\n};\n\nvar initialState = exports.initialState = {\n currentTime: 0,\n duration: 0,\n draggingActive: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.UPDATE_SEEKBAR_DRAGGING_STATUS:\n return _extends({}, state, {\n draggingActive: action.draggingActive\n });\n\n case types.UPDATE_CURRENT_TIME:\n return _extends({}, state, {\n currentTime: action.currentTime\n });\n\n case types.UPDATE_DURATION:\n return _extends({}, state, {\n duration: action.duration\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n updateSeekbarDraggingStatus: function updateSeekbarDraggingStatus(draggingActive) {\n return { type: types.UPDATE_SEEKBAR_DRAGGING_STATUS, draggingActive: draggingActive };\n },\n updateDuration: function updateDuration(duration) {\n return { type: types.UPDATE_DURATION, duration: duration };\n },\n updateCurrentTime: function updateCurrentTime(currentTime) {\n return { type: types.UPDATE_CURRENT_TIME, currentTime: currentTime };\n }\n};\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n UPDATE_VOLUME: 'volume/UPDATE_VOLUME',\n UPDATE_VOLUME_DRAGGING_STATUS: 'volume/UPDATE_VOLUME_DRAGGING_STATUS',\n UPDATE_MUTED: 'volume/UPDATE_MUTED'\n};\n\nvar initialState = exports.initialState = {\n draggingActive: false,\n volume: 1,\n muted: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.UPDATE_VOLUME:\n return _extends({}, state, {\n volume: action.volume\n });\n\n case types.UPDATE_VOLUME_DRAGGING_STATUS:\n return _extends({}, state, {\n draggingActive: action.draggingActive\n });\n\n case types.UPDATE_MUTED:\n return _extends({}, state, {\n muted: action.muted\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n updateVolume: function updateVolume(volume) {\n return { type: types.UPDATE_VOLUME, volume: volume };\n },\n updateVolumeDraggingStatus: function updateVolumeDraggingStatus(draggingActive) {\n return { type: types.UPDATE_VOLUME_DRAGGING_STATUS, draggingActive: draggingActive };\n },\n updateMuted: function updateMuted(muted) {\n return { type: types.UPDATE_MUTED, muted: muted };\n }\n};\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n UPDATE_FULLSCREEN: 'fullscreen/UPDATE_FULLSCREEN'\n};\n\nvar initialState = exports.initialState = {\n fullscreen: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.UPDATE_FULLSCREEN:\n return _extends({}, state, {\n fullscreen: action.fullscreen\n });\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n updateFullscreen: function updateFullscreen(fullscreen) {\n return { type: types.UPDATE_FULLSCREEN, fullscreen: fullscreen };\n }\n};\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n UPDATE_LOADING_SPINNER_STATE: 'loading/UPDATE_LOADING_SPINNER_STATE'\n};\n\nvar initialState = exports.initialState = {\n showLoadingSpinner: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.UPDATE_LOADING_SPINNER_STATE:\n return _extends({}, state, {\n show: action.show\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n updateLoadingSpinnerState: function updateLoadingSpinnerState(show) {\n return { type: types.UPDATE_LOADING_SPINNER_STATE, show: show };\n }\n};\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n TOGGLE_CVAA_OVERLAY: 'share/TOGGLE_CVAA_OVERLAY'\n};\n\nvar initialState = exports.initialState = {\n overlayOpen: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.TOGGLE_CVAA_OVERLAY:\n return _extends({}, state, {\n overlayOpen: action.show\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n toggleCVAAOverlay: function toggleCVAAOverlay(show) {\n return { type: types.TOGGLE_CVAA_OVERLAY, show: show };\n }\n};\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n UPDATE_QUALITY: 'settings/UPDATE_QUALITY',\n UPDATE_SPEED: 'settings/UPDATE_SPEED'\n};\n\nvar initialState = exports.initialState = {\n quality: 1,\n speed: 2\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.UPDATE_QUALITY:\n return _extends({}, state, {\n quality: action.quality\n });\n\n case types.UPDATE_SPEED:\n return _extends({}, state, {\n speed: action.speed\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n updateQuality: function updateQuality(quality) {\n return { type: types.UPDATE_QUALITY, quality: quality };\n },\n updateSpeed: function updateSpeed(speed) {\n return { type: types.UPDATE_SPEED, speed: speed };\n }\n};\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nfunction toHHMMSS(input) {\n var sec_num = parseInt(input, 10);\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - hours * 3600) / 60);\n var seconds = sec_num - hours * 3600 - minutes * 60;\n\n if (hours < 10) {\n hours = \"0\" + hours;\n }\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n return minutes + \":\" + seconds;\n}\n\nexports.toHHMMSS = toHHMMSS;\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\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\nvar SmartContainer = function (_Component) {\n _inherits(SmartContainer, _Component);\n\n function SmartContainer() {\n _classCallCheck(this, SmartContainer);\n\n return _possibleConstructorReturn(this, (SmartContainer.__proto__ || Object.getPrototypeOf(SmartContainer)).apply(this, arguments));\n }\n\n _createClass(SmartContainer, [{\n key: 'render',\n value: function render(props) {\n return (0, _preact.h)(\n 'div',\n { className: 'smart-container top left' },\n props.children\n );\n }\n }]);\n\n return SmartContainer;\n}(_preact.Component);\n\nexports.default = SmartContainer;\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\n\nvar _dropdownMenu = __webpack_require__(60);\n\nvar _dropdownMenu2 = _interopRequireDefault(_dropdownMenu);\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\nvar SmartContainer = function (_Component) {\n _inherits(SmartContainer, _Component);\n\n function SmartContainer() {\n _classCallCheck(this, SmartContainer);\n\n return _possibleConstructorReturn(this, (SmartContainer.__proto__ || Object.getPrototypeOf(SmartContainer)).apply(this, arguments));\n }\n\n _createClass(SmartContainer, [{\n key: 'render',\n value: function render(props) {\n return (0, _preact.h)(\n 'div',\n { className: 'smart-container-item select-menu-item' },\n (0, _preact.h)(\n 'label',\n { htmlFor: 'quality' },\n props.label\n ),\n (0, _preact.h)(_dropdownMenu2.default, { onSelect: function onSelect(o) {\n return props.onSelect(o);\n }, options: props.options })\n );\n }\n }]);\n\n return SmartContainer;\n}(_preact.Component);\n\nexports.default = SmartContainer;\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _shell = __webpack_require__(8);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar Overlay = (_dec = (0, _preactRedux.connect)(null, (0, _bindActions.bindActions)(_shell.actions)), _dec(_class = function (_Component) {\n _inherits(Overlay, _Component);\n\n function Overlay() {\n _classCallCheck(this, Overlay);\n\n return _possibleConstructorReturn(this, (Overlay.__proto__ || Object.getPrototypeOf(Overlay)).apply(this, arguments));\n }\n\n _createClass(Overlay, [{\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n this.props.open ? this.props.addPlayerClass('overlay-active') : this.props.removePlayerClass('overlay-active');\n }\n }, {\n key: 'render',\n value: function render(props) {\n var overlayClass = 'overlay';\n if (props.type) overlayClass += ' ' + props.type + '-overlay';\n if (props.open) overlayClass += ' active';\n\n return (0, _preact.h)(\n 'div',\n { className: overlayClass, role: 'dialog' },\n (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(\n 'a',\n { onClick: function onClick() {\n return props.onClose();\n }, 'aria-label': (0, _preact.h)(_preactI18n.Text, { id: 'core.close' }), className: 'close-overlay' },\n (0, _preact.h)(_icon2.default, { type: 'close' })\n )\n ),\n props.children\n );\n }\n }]);\n\n return Overlay;\n}(_preact.Component)) || _class);\nexports.default = Overlay;\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _redux = __webpack_require__(6);\n\nvar _store = __webpack_require__(45);\n\nvar _store2 = _interopRequireDefault(_store);\n\nvar _fr = __webpack_require__(46);\n\nvar _fr2 = _interopRequireDefault(_fr);\n\nvar _engineConnector = __webpack_require__(47);\n\nvar _engineConnector2 = _interopRequireDefault(_engineConnector);\n\nvar _shell = __webpack_require__(51);\n\nvar _shell2 = _interopRequireDefault(_shell);\n\nvar _overlayPlay = __webpack_require__(53);\n\nvar _overlayPlay2 = _interopRequireDefault(_overlayPlay);\n\nvar _loading = __webpack_require__(54);\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _playPause = __webpack_require__(55);\n\nvar _playPause2 = _interopRequireDefault(_playPause);\n\nvar _seekbar = __webpack_require__(56);\n\nvar _seekbar2 = _interopRequireDefault(_seekbar);\n\nvar _volume = __webpack_require__(57);\n\nvar _volume2 = _interopRequireDefault(_volume);\n\nvar _share = __webpack_require__(58);\n\nvar _share2 = _interopRequireDefault(_share);\n\nvar _settings = __webpack_require__(59);\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _language = __webpack_require__(61);\n\nvar _language2 = _interopRequireDefault(_language);\n\nvar _fullscreen = __webpack_require__(62);\n\nvar _fullscreen2 = _interopRequireDefault(_fullscreen);\n\nvar _timeDisplay = __webpack_require__(63);\n\nvar _timeDisplay2 = _interopRequireDefault(_timeDisplay);\n\nvar _topBar = __webpack_require__(64);\n\nvar _topBar2 = _interopRequireDefault(_topBar);\n\nvar _bottomBar = __webpack_require__(65);\n\nvar _bottomBar2 = _interopRequireDefault(_bottomBar);\n\nvar _shareOverlay = __webpack_require__(66);\n\nvar _shareOverlay2 = _interopRequireDefault(_shareOverlay);\n\nvar _cvaaOverlay = __webpack_require__(67);\n\nvar _cvaaOverlay2 = _interopRequireDefault(_cvaaOverlay);\n\nvar _keyboard = __webpack_require__(68);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\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 UIManager = function () {\n function UIManager(player, config) {\n _classCallCheck(this, UIManager);\n\n this.player = player;\n this.config = config;\n this.config.ui = {\n \"translations\": {\n \"controls\": {\n \"language\": \"שפה\"\n }\n },\n \"components\": {\n \"Loading\": {\n \"enabled\": true\n },\n \"OverlayPlay\": {\n \"enabled\": true\n }\n }\n };\n }\n\n _createClass(UIManager, [{\n key: 'buildCustomUI',\n value: function buildCustomUI(template) {\n this._buildUI(template);\n }\n }, {\n key: 'buildDefaultUI',\n value: function buildDefaultUI() {\n var store = (0, _redux.createStore)(_store2.default, window.devToolsExtension && window.devToolsExtension({ name: 'playkit #' + this.config.target, instanceId: this.config.target }));\n\n var template = (0, _preact.h)(\n _preactRedux.Provider,\n { store: store },\n (0, _preact.h)(\n _preactI18n.IntlProvider,\n { definition: _fr2.default },\n (0, _preact.h)(\n _shell2.default,\n null,\n (0, _preact.h)('div', { className: 'player-holder' }),\n (0, _preact.h)(_engineConnector2.default, { player: this.player }),\n (0, _preact.h)(_keyboard2.default, { player: this.player }),\n (0, _preact.h)(_loading2.default, { player: this.player }),\n (0, _preact.h)(\n 'div',\n { className: 'player-gui' },\n (0, _preact.h)(_overlayPlay2.default, { player: this.player }),\n (0, _preact.h)(\n _topBar2.default,\n null,\n (0, _preact.h)(\n 'div',\n { className: 'left-controls' },\n (0, _preact.h)(\n 'div',\n { className: 'video-playing-title' },\n 'L21 Earth Time Lapse View from Space, ISS'\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'right-controls' },\n (0, _preact.h)(_share2.default, { player: this.player })\n )\n ),\n (0, _preact.h)(\n _bottomBar2.default,\n null,\n (0, _preact.h)(_seekbar2.default, { showFramePreview: true, showTimeBubble: true, player: this.player }),\n (0, _preact.h)(\n 'div',\n { className: 'left-controls' },\n (0, _preact.h)(_playPause2.default, { player: this.player }),\n (0, _preact.h)(_timeDisplay2.default, { format: 'current / total', player: this.player })\n ),\n (0, _preact.h)(\n 'div',\n { className: 'right-controls' },\n (0, _preact.h)(_volume2.default, { player: this.player }),\n (0, _preact.h)(_language2.default, { player: this.player }),\n (0, _preact.h)(_settings2.default, { player: this.player }),\n (0, _preact.h)(_fullscreen2.default, { player: this.player })\n )\n ),\n (0, _preact.h)(_shareOverlay2.default, null),\n (0, _preact.h)(_cvaaOverlay2.default, null)\n )\n )\n )\n );\n this._buildUI(template);\n }\n }, {\n key: '_buildUI',\n value: function _buildUI(template) {\n if (!this.player) return;\n\n var playerWrapper = document.createElement('div');\n document.body.appendChild(playerWrapper);\n (0, _preact.render)(template, playerWrapper);\n\n var playerElement = document.getElementsByTagName('video')[this.config.target === 'player1' ? 0 : 1];\n // let playerElement = document.getElementById(this.config.target); // the right way\n playerElement.removeAttribute('style');\n playerWrapper.getElementsByClassName('player-holder')[0].appendChild(playerElement);\n }\n }, {\n key: 'release',\n value: function release() {}\n }]);\n\n return UIManager;\n}();\n\nexports.default = UIManager;\n\n/***/ }),\n/* 29 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(14);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(32);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(33);\n\n\n\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__[\"a\" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__[\"a\" /* default */].toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__[\"a\" /* default */](value)\n : __WEBPACK_IMPORTED_MODULE_2__objectToString_js__[\"a\" /* default */](value);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (baseGetTag);\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(31);\n\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 = __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__[\"a\" /* default */] || freeSelf || Function('return this')();\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (root);\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (freeGlobal);\n\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(15)))\n\n/***/ }),\n/* 32 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(14);\n\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\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 nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__[\"a\" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__[\"a\" /* default */].toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (getRawTag);\n\n\n/***/ }),\n/* 33 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\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 nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (objectToString);\n\n\n/***/ }),\n/* 34 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(35);\n\n\n/** Built-in value references. */\nvar getPrototype = __WEBPACK_IMPORTED_MODULE_0__overArg_js__[\"a\" /* default */](Object.getPrototypeOf, Object);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (getPrototype);\n\n\n/***/ }),\n/* 35 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\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/* harmony default export */ __webpack_exports__[\"a\"] = (overArg);\n\n\n/***/ }),\n/* 36 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\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 != null && typeof value == 'object';\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isObjectLike);\n\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(38);\n\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(global, module) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _ponyfill = __webpack_require__(40);\n\nvar _ponyfill2 = _interopRequireDefault(_ponyfill);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar root; /* global window */\n\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (true) {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = (0, _ponyfill2['default'])(root);\nexports['default'] = result;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15), __webpack_require__(39)(module)))\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tif(!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, \"loaded\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"id\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\nexports['default'] = symbolObservablePonyfill;\nfunction symbolObservablePonyfill(root) {\n\tvar result;\n\tvar _Symbol = root.Symbol;\n\n\tif (typeof _Symbol === 'function') {\n\t\tif (_Symbol.observable) {\n\t\t\tresult = _Symbol.observable;\n\t\t} else {\n\t\t\tresult = _Symbol('observable');\n\t\t\t_Symbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n\n/***/ }),\n/* 41 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__[\"a\"] = combineReducers;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(12);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(13);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(7);\n\n\n\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionName = actionType && '\"' + actionType.toString() + '\"' || 'an action';\n\n return 'Given action ' + actionName + ', reducer \"' + key + '\" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === __WEBPACK_IMPORTED_MODULE_0__createStore__[\"a\" /* ActionTypes */].INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!__WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__[\"a\" /* default */](inputState)) {\n return 'The ' + argumentName + ' has unexpected type of \"' + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + '\". Expected argument to be an object with the following ' + ('keys: \"' + reducerKeys.join('\", \"') + '\"');\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n\n if (unexpectedKeys.length > 0) {\n return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('\"' + unexpectedKeys.join('\", \"') + '\" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('\"' + reducerKeys.join('\", \"') + '\". Unexpected keys will be ignored.');\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, { type: __WEBPACK_IMPORTED_MODULE_0__createStore__[\"a\" /* ActionTypes */].INIT });\n\n if (typeof initialState === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');\n }\n\n var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');\n if (typeof reducer(undefined, { type: type }) === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined when probed with a random type. ' + ('Don\\'t try to handle ' + __WEBPACK_IMPORTED_MODULE_0__createStore__[\"a\" /* ActionTypes */].INIT + ' or other actions in \"redux/*\" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');\n }\n });\n}\n\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n __WEBPACK_IMPORTED_MODULE_2__utils_warning__[\"a\" /* default */]('No reducer provided for key \"' + key + '\"');\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n var finalReducerKeys = Object.keys(finalReducers);\n\n var unexpectedKeyCache = void 0;\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError = void 0;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments[1];\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n __WEBPACK_IMPORTED_MODULE_2__utils_warning__[\"a\" /* default */](warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n return hasChanged ? nextState : state;\n };\n}\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(11)))\n\n/***/ }),\n/* 42 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = bindActionCreators;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_warning__ = __webpack_require__(7);\n\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(undefined, arguments));\n };\n}\n\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass a single function as the first argument,\n * and get a function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?');\n }\n\n var keys = Object.keys(actionCreators);\n var boundActionCreators = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var actionCreator = actionCreators[key];\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n } else {\n __WEBPACK_IMPORTED_MODULE_0__utils_warning__[\"a\" /* default */]('bindActionCreators expected a function actionCreator for key \\'' + key + '\\', instead received type \\'' + typeof actionCreator + '\\'.');\n }\n }\n return boundActionCreators;\n}\n\n/***/ }),\n/* 43 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = applyMiddleware;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(16);\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\n\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function (reducer, preloadedState, enhancer) {\n var store = createStore(reducer, preloadedState, enhancer);\n var _dispatch = store.dispatch;\n var chain = [];\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch(action) {\n return _dispatch(action);\n }\n };\n chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = __WEBPACK_IMPORTED_MODULE_0__compose__[\"a\" /* default */].apply(undefined, chain)(store.dispatch);\n\n return _extends({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports, __webpack_require__) {\n\n!function(e,n){ true?module.exports=n():\"function\"==typeof define&&define.amd?define(n):e.dlv=n()}(this,function(){function e(e,n,t,o){for(o=0,n=n.split?n.split(\".\"):n;e&&o<n.length;)e=e[n[o++]];return void 0===e?t:e}return e});\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _redux = __webpack_require__(6);\n\nvar _engine = __webpack_require__(17);\n\nvar _engine2 = _interopRequireDefault(_engine);\n\nvar _shell = __webpack_require__(8);\n\nvar _shell2 = _interopRequireDefault(_shell);\n\nvar _playPause = __webpack_require__(9);\n\nvar _playPause2 = _interopRequireDefault(_playPause);\n\nvar _seekbar = __webpack_require__(18);\n\nvar _seekbar2 = _interopRequireDefault(_seekbar);\n\nvar _volume = __webpack_require__(19);\n\nvar _volume2 = _interopRequireDefault(_volume);\n\nvar _fullscreen = __webpack_require__(20);\n\nvar _fullscreen2 = _interopRequireDefault(_fullscreen);\n\nvar _loading = __webpack_require__(21);\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _share = __webpack_require__(10);\n\nvar _share2 = _interopRequireDefault(_share);\n\nvar _cvaa = __webpack_require__(22);\n\nvar _cvaa2 = _interopRequireDefault(_cvaa);\n\nvar _settings = __webpack_require__(23);\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar reducer = (0, _redux.combineReducers)({\n engine: _engine2.default,\n shell: _shell2.default,\n seekbar: _seekbar2.default,\n volume: _volume2.default,\n fullscreen: _fullscreen2.default,\n loading: _loading2.default,\n playPause: _playPause2.default,\n share: _share2.default,\n cvaa: _cvaa2.default,\n settings: _settings2.default\n});\nexports.default = reducer;\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports) {\n\nmodule.exports = {\n\t\"core\": {\n\t\t\"disable\": \"Disable\",\n\t\t\"auto\": \"Auto\",\n\t\t\"close\": \"Close\"\n\t},\n\t\"controls\": {\n\t\t\"play\": \"Play\",\n\t\t\"pause\": \"Pause\",\n\t\t\"share\": \"Share\",\n\t\t\"language\": \"Language\",\n\t\t\"settings\": \"Settings\",\n\t\t\"fullscreen\": \"Fullscreen\"\n\t},\n\t\"settings\": {\n\t\t\"quality\": \"Quality\",\n\t\t\"speed\": \"Speed\"\n\t},\n\t\"language\": {\n\t\t\"audio\": \"Audio\",\n\t\t\"captions\": \"Captions\",\n\t\t\"advanced_captions_settings\": \"Advanced captions settings\"\n\t},\n\t\"share\": {\n\t\t\"share_title\": \"Partager\",\n\t\t\"link_options\": \"Options de lien\"\n\t}\n};\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _engine = __webpack_require__(17);\n\nvar _engine2 = _interopRequireDefault(_engine);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\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\nvar EngineConnector = (_dec = (0, _preactRedux.connect)(_engine2.default, (0, _bindActions.bindActions)(_engine.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(EngineConnector, _BaseComponent);\n\n function EngineConnector(obj) {\n _classCallCheck(this, EngineConnector);\n\n return _possibleConstructorReturn(this, (EngineConnector.__proto__ || Object.getPrototypeOf(EngineConnector)).call(this, { name: 'EngineConnector', player: obj.player }));\n }\n\n _createClass(EngineConnector, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED, function (e) {\n _this2.props.updatePlayerState(e.payload.oldState.type, e.payload.newState.type);\n });\n\n this.player.addEventListener(this.player.Event.TIME_UPDATE, function () {\n _this2.props.updateCurrentTime(_this2.player.currentTime);\n });\n\n this.player.addEventListener(this.player.Event.LOADED_METADATA, function () {\n _this2.props.updateDuration(_this2.player.duration);\n _this2.props.updateMetadataLoadingStatus(true);\n\n var TrackType = _this2.player.Track;\n var audioTracks = _this2.player.getTracks(TrackType.AUDIO);\n var videoTracks = _this2.player.getTracks(TrackType.VIDEO);\n var textTracks = _this2.player.getTracks(TrackType.TEXT);\n _this2.props.updateAudioTracks(audioTracks);\n _this2.props.updateVideoTracks(videoTracks);\n _this2.props.updateTextTracks(textTracks);\n });\n\n this.player.addEventListener(this.player.Event.VOLUME_CHANGE, function () {\n _this2.props.updateVolume(_this2.player.volume);\n });\n\n this.player.addEventListener(this.player.Event.PLAY, function () {\n _this2.props.updateIsPlaying(true);\n });\n\n this.player.addEventListener(this.player.Event.PAUSE, function () {\n _this2.props.updateIsPlaying(false);\n });\n }\n }, {\n key: 'shouldComponentUpdate',\n value: function shouldComponentUpdate() {\n return false;\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)('span', null);\n }\n }]);\n\n return EngineConnector;\n}(_base2.default)) || _class);\nexports.default = EngineConnector;\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_48__;\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.LOG_LEVEL = undefined;\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 _jsLogger = __webpack_require__(50);\n\nvar JsLogger = _interopRequireWildcard(_jsLogger);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LOG_LEVEL = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nvar LoggerFactory = function () {\n function LoggerFactory(options) {\n _classCallCheck(this, LoggerFactory);\n\n JsLogger.useDefaults(options || {});\n }\n\n _createClass(LoggerFactory, [{\n key: \"getLogger\",\n value: function getLogger(name) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n }]);\n\n return LoggerFactory;\n}();\n\nvar lf = new LoggerFactory({ defaultLevel: JsLogger.DEBUG });\n\nexports.default = lf;\nexports.LOG_LEVEL = LOG_LEVEL;\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (true) {\r\n\t\t!(__WEBPACK_AMD_DEFINE_FACTORY__ = (Logger),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _shell = __webpack_require__(8);\n\nvar _isMobile = __webpack_require__(52);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n metadataLoaded: state.engine.metadataLoaded,\n currentState: state.engine.playerState.currentState,\n playerClasses: state.shell.playerClasses,\n isMobile: state.shell.isMobile\n };\n};\n\nvar Shell = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_shell.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(Shell, _BaseComponent);\n\n function Shell() {\n _classCallCheck(this, Shell);\n\n return _possibleConstructorReturn(this, (Shell.__proto__ || Object.getPrototypeOf(Shell)).call(this, { name: 'Shell' }));\n }\n\n _createClass(Shell, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.props.updateIsMobile((0, _isMobile.isMobile)());\n }\n }, {\n key: 'render',\n value: function render(props) {\n var playerClasses = 'player skin-default';\n playerClasses += ' ' + props.playerClasses.join(' ');\n\n if (this.props.metadataLoaded) playerClasses += ' metadata-loaded';\n if (this.props.metadataLoaded) playerClasses += ' state-' + this.props.currentState;\n\n return (0, _preact.h)(\n 'div',\n { className: playerClasses },\n props.children\n );\n }\n }]);\n\n return Shell;\n}(_base2.default)) || _class);\nexports.default = Shell;\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nfunction isMobile() {\n return typeof window.orientation !== \"undefined\" || navigator.userAgent.indexOf(\"IEMobile\") !== -1;\n}\n\nexports.isMobile = isMobile;\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _playPause = __webpack_require__(9);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n isPlaying: state.engine.isPlaying\n };\n};\n\nvar OverlayPlay = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_playPause.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(OverlayPlay, _BaseComponent);\n\n function OverlayPlay(obj) {\n _classCallCheck(this, OverlayPlay);\n\n return _possibleConstructorReturn(this, (OverlayPlay.__proto__ || Object.getPrototypeOf(OverlayPlay)).call(this, { name: 'OverlayPlay', player: obj.player }));\n }\n\n _createClass(OverlayPlay, [{\n key: 'togglePlayPause',\n value: function togglePlayPause() {\n var _this2 = this;\n\n this.logger.debug('Toggle play');\n this.setState({ animation: true });\n setTimeout(function () {\n _this2.setState({ animation: false });\n }, 400);\n if (this.player.paused) {\n this.player.play();\n } else {\n this.player.pause();\n }\n }\n }, {\n key: 'render',\n value: function render(props) {\n var _this3 = this;\n\n return (0, _preact.h)(\n 'div',\n { className: 'overlay-play ' + (this.state.animation ? 'in' : ''), onClick: function onClick() {\n return _this3.togglePlayPause();\n } },\n props.isPlaying ? (0, _preact.h)(_icon2.default, { type: 'play' }) : (0, _preact.h)(_icon2.default, { type: 'pause' })\n );\n }\n }]);\n\n return OverlayPlay;\n}(_base2.default)) || _class);\nexports.default = OverlayPlay;\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _loading = __webpack_require__(21);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n show: state.loading.show\n };\n};\n\nvar Loading = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_loading.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(Loading, _BaseComponent);\n\n function Loading(obj) {\n _classCallCheck(this, Loading);\n\n return _possibleConstructorReturn(this, (Loading.__proto__ || Object.getPrototypeOf(Loading)).call(this, { name: 'Loading', player: obj.player }));\n }\n\n _createClass(Loading, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED, function (e) {\n if (e.payload.newState.type === 'idle' || e.payload.newState.type === 'playing' || e.payload.newState.type === 'paused') {\n _this2.props.updateLoadingSpinnerState(false);\n } else {\n _this2.props.updateLoadingSpinnerState(true);\n }\n });\n }\n }, {\n key: 'render',\n value: function render(props) {\n return (0, _preact.h)(\n 'div',\n { className: props.show ? 'loading-backdrop show' : 'loading-backdrop' },\n (0, _preact.h)(\n 'div',\n { className: 'spinner-container' },\n (0, _preact.h)(\n 'div',\n { className: 'spinner' },\n [].concat(_toConsumableArray(Array(8))).map(function () {\n return (0, _preact.h)('span', null);\n })\n )\n )\n );\n }\n }]);\n\n return Loading;\n}(_base2.default)) || _class);\nexports.default = Loading;\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _playPause = __webpack_require__(9);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n isPlaying: state.engine.isPlaying\n };\n};\n\nvar PlayPauseControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_playPause.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(PlayPauseControl, _BaseComponent);\n\n function PlayPauseControl(obj) {\n _classCallCheck(this, PlayPauseControl);\n\n return _possibleConstructorReturn(this, (PlayPauseControl.__proto__ || Object.getPrototypeOf(PlayPauseControl)).call(this, { name: 'PlayPause', player: obj.player }));\n }\n\n _createClass(PlayPauseControl, [{\n key: 'togglePlayPause',\n value: function togglePlayPause() {\n this.logger.debug('Toggle play');\n if (this.player.paused) {\n this.player.play();\n } else {\n this.player.pause();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var controlButtonClass = this.props.isPlaying ? 'control-button is-playing' : 'control-button';\n\n return (0, _preact.h)(\n 'div',\n { className: 'control-button-container control-play-pause' },\n (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(\n 'button',\n { 'aria-label': (0, _preact.h)(_preactI18n.Text, { id: this.props.isPlaying ? 'controls.pause' : 'controls.play' }), className: controlButtonClass, onClick: function onClick() {\n return _this2.togglePlayPause();\n } },\n (0, _preact.h)(_icon2.default, { type: 'play' }),\n (0, _preact.h)(_icon2.default, { type: 'pause' })\n )\n )\n );\n }\n }]);\n\n return PlayPauseControl;\n}(_base2.default)) || _class);\nexports.default = PlayPauseControl;\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _seekbar = __webpack_require__(18);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _timeFormat = __webpack_require__(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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n virtualProgress: state.seekbar.virtualTime,\n currentTime: state.seekbar.currentTime,\n duration: state.engine.duration,\n isDraggingActive: state.seekbar.draggingActive\n };\n};\n\nvar SeekBarControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_seekbar.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(SeekBarControl, _BaseComponent);\n\n function SeekBarControl(obj) {\n _classCallCheck(this, SeekBarControl);\n\n var _this = _possibleConstructorReturn(this, (SeekBarControl.__proto__ || Object.getPrototypeOf(SeekBarControl)).call(this, { name: 'SeekBar', player: obj.player }));\n\n _this.onSeekbarMouseDown = function (e) {\n _this.props.updateSeekbarDraggingStatus(true);\n if (_this.props.isDraggingActive) {\n var time = _this.getTime(e);\n _this.updateSeekBarProgress(time, _this.player.duration);\n }\n };\n\n _this.onSeekbarMouseUp = function (e) {\n var time = _this.getTime(e);\n _this.player.currentTime = time;\n _this.updateSeekBarProgress(time, _this.player.duration);\n _this.props.updateSeekbarDraggingStatus(false);\n _this.logger.debug('Seek to ' + time + 's');\n };\n\n _this.onSeekbarMouseMove = function (e) {\n var time = _this.getTime(e);\n _this.updateSeekBarProgress(time, _this.player.duration, true);\n\n if (_this.props.isDraggingActive) {\n _this.updateSeekBarProgress(time, _this.player.duration);\n }\n };\n\n return _this;\n }\n\n _createClass(SeekBarControl, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this._playerElement = document.getElementsByClassName('player')[0];\n this._seekBarElement = document.getElementsByClassName('seek-bar')[0];\n\n this.setState({ virtualTime: 0 });\n\n this.player.addEventListener(this.player.Event.TIME_UPDATE, function () {\n _this2.props.updateCurrentTime(_this2.player.currentTime);\n });\n }\n }, {\n key: 'updateSeekBarProgress',\n value: function updateSeekBarProgress(currentTime, duration) {\n var virtual = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (virtual) {\n this.setState({ virtualTime: currentTime });\n } else {\n this.props.updateCurrentTime(currentTime);\n }\n }\n }, {\n key: 'getTime',\n value: function getTime(e) {\n var time = this.player.duration * ((e.clientX - this._seekBarElement.offsetLeft - this._playerElement.offsetLeft) / this._seekBarElement.clientWidth);\n time = parseFloat(time.toFixed(2));\n if (time < 0) return 0;\n if (time > this.player.duration) return this.player.duration;\n return time;\n }\n }, {\n key: 'getThumbSpriteOffset',\n value: function getThumbSpriteOffset() {\n return -(Math.ceil(100 * this.state.virtualTime / this.player.duration) * 160) + 'px 0px';\n }\n }, {\n key: 'render',\n value: function render(props) {\n var _this3 = this;\n\n var virtualProgressWidth = this.state.virtualTime / props.duration * 100 + '%';\n var progressWidth = props.currentTime / props.duration * 100 + '%';\n var framePreviewStyle = 'background-image: url(http://cfvod.kaltura.com/p/1914121/sp/191412100/thumbnail/entry_id/1_fet8ffop/version/100001/width/160/vid_slices/100); ';\n framePreviewStyle += 'background-position: ' + this.getThumbSpriteOffset();\n\n return (0, _preact.h)(\n 'div',\n { className: 'seek-bar', role: 'slider',\n 'aria-label': 'Seek slider', 'aria-valuemin': '0', 'aria-valuemax': Math.round(this.player.duration), 'aria-valuenow': Math.round(this.player.currentTime),\n 'aria-valuetext': (0, _timeFormat.toHHMMSS)(this.player.currentTime) + ' of ' + (0, _timeFormat.toHHMMSS)(this.player.duration),\n onMouseMove: function onMouseMove(e) {\n return _this3.onSeekbarMouseMove(e);\n }, onMouseDown: function onMouseDown(e) {\n return _this3.onSeekbarMouseDown(e);\n }, onMouseUp: function onMouseUp(e) {\n return _this3.onSeekbarMouseUp(e);\n } },\n (0, _preact.h)(\n 'div',\n { className: 'progress-bar' },\n (0, _preact.h)(\n 'div',\n { className: 'progress', style: { width: progressWidth } },\n (0, _preact.h)('a', { className: 'scrubber' })\n ),\n (0, _preact.h)(\n 'div',\n { className: 'virtual-progress', style: { width: virtualProgressWidth } },\n props.showFramePreview ? (0, _preact.h)(\n 'div',\n { className: 'frame-preview' },\n (0, _preact.h)('div', { className: 'frame-preview-img', style: framePreviewStyle })\n ) : '',\n this.props.showTimeBubble ? (0, _preact.h)(\n 'div',\n { className: 'time-preview' },\n (0, _timeFormat.toHHMMSS)(this.state.virtualTime)\n ) : ''\n ),\n (0, _preact.h)('div', { className: 'buffered', style: 'width: 60%;' })\n )\n );\n }\n }]);\n\n return SeekBarControl;\n}(_base2.default)) || _class);\nexports.default = SeekBarControl;\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _volume = __webpack_require__(19);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n isDraggingActive: state.volume.isDraggingActive,\n volume: state.volume.volume,\n muted: state.volume.muted,\n isMobile: state.shell.isMobile\n };\n};\n\nvar VolumeControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_volume.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(VolumeControl, _BaseComponent);\n\n function VolumeControl(obj) {\n _classCallCheck(this, VolumeControl);\n\n return _possibleConstructorReturn(this, (VolumeControl.__proto__ || Object.getPrototypeOf(VolumeControl)).call(this, { name: 'Volume', player: obj.player }));\n }\n\n _createClass(VolumeControl, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this._volumeControlElement = document.getElementsByClassName('volume-control')[0];\n this._volumeProgressBarElement = this._volumeControlElement.getElementsByClassName('bar')[0];\n\n this.player.addEventListener(this.player.Event.LOADED_METADATA, function () {\n _this2.props.updateVolume(_this2.player.volume);\n });\n\n this.player.addEventListener(this.player.Event.VOLUME_CHANGE, function () {\n _this2.props.updateVolume(_this2.player.volume);\n });\n }\n }, {\n key: 'getVolumeProgessHeight',\n value: function getVolumeProgessHeight() {\n return this.props.muted ? '0%' : Math.round(this.props.volume * 100) + '%';\n }\n }, {\n key: 'onVolumeProgressBarMouseDown',\n value: function onVolumeProgressBarMouseDown() {\n this.props.updateVolumeDraggingStatus(true);\n }\n }, {\n key: 'onVolumeProgressBarClick',\n value: function onVolumeProgressBarClick(e) {\n this.changeVolume(e);\n }\n }, {\n key: 'onVolumeControlButtonClick',\n value: function onVolumeControlButtonClick() {\n this.logger.debug('Toggle mute. ' + this.player.muted + ' => ' + !this.player.muted);\n this.props.updateMuted(!this.props.muted);\n this.player.muted = !this.player.muted;\n }\n }, {\n key: 'changeVolume',\n value: function changeVolume(e) {\n var barHeight = this._volumeProgressBarElement.clientHeight;\n var topY = this.getCoords(this._volumeProgressBarElement).top;\n var clickY = e.clientY;\n var volume = 1 - (clickY - topY) / barHeight;\n volume = parseFloat(volume.toFixed(2));\n this.logger.debug('Change volume from ' + this.player.volume + ' => ' + volume);\n this.player.volume = volume;\n if (this.props.muted) {\n this.player.muted = false;\n this.props.updateMuted(false);\n }\n }\n }, {\n key: 'getCoords',\n value: function getCoords(el) {\n var box = el.getBoundingClientRect();\n\n return {\n top: box.top + pageYOffset,\n left: box.left + pageXOffset\n };\n }\n }, {\n key: 'render',\n value: function render() {\n var _this3 = this;\n\n var controlButtonClass = 'control-button-container volume-control';\n if (this.props.isDraggingActive) controlButtonClass += ' dragging-active';\n if (this.props.muted || this.props.volume === 0) controlButtonClass += ' is-muted';\n\n if (!this.props.isMobile) return false;\n\n return (0, _preact.h)(\n 'div',\n { className: controlButtonClass },\n (0, _preact.h)(\n 'button',\n { className: 'control-button', onClick: function onClick() {\n return _this3.onVolumeControlButtonClick();\n }, 'aria-label': 'Volume' },\n (0, _preact.h)(_icon2.default, { type: 'volume-base' }),\n (0, _preact.h)(_icon2.default, { type: 'volume-waves' }),\n (0, _preact.h)(_icon2.default, { type: 'volume-mute' })\n ),\n (0, _preact.h)(\n 'div',\n { className: 'volume-control-bar', role: 'slider',\n 'aria-valuemin': '0', 'aria-valuemaz': '100', 'aria-valuenow': this.player.volume * 100,\n 'aria-valuetext': this.player.volume * 100 + '% volume ' + (this.player.muted ? 'muted' : '') },\n (0, _preact.h)(\n 'div',\n { className: 'bar', onMouseDown: function onMouseDown() {\n return _this3.onVolumeProgressBarMouseDown();\n }, onClick: function onClick(e) {\n return _this3.onVolumeProgressBarClick(e);\n } },\n (0, _preact.h)('div', { className: 'progress', style: { height: this.getVolumeProgessHeight() } })\n )\n )\n );\n }\n }]);\n\n return VolumeControl;\n}(_base2.default)) || _class);\nexports.default = VolumeControl;\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _share = __webpack_require__(10);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n overlayOpen: state.share.overlayOpen\n };\n};\n\nvar ShareControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_share.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(ShareControl, _BaseComponent);\n\n function ShareControl(obj) {\n _classCallCheck(this, ShareControl);\n\n return _possibleConstructorReturn(this, (ShareControl.__proto__ || Object.getPrototypeOf(ShareControl)).call(this, { name: 'Share', player: obj.player }));\n }\n\n _createClass(ShareControl, [{\n key: 'render',\n value: function render(props) {\n return (0, _preact.h)(\n 'div',\n { className: 'control-button-container control-share' },\n (0, _preact.h)(\n 'button',\n { className: 'control-button control-button-rounded', onClick: function onClick() {\n return props.toggleShareOverlay(!props.overlayOpen);\n }, 'aria-label': 'Share' },\n (0, _preact.h)(_icon2.default, { type: 'share' })\n )\n );\n }\n }]);\n\n return ShareControl;\n}(_base2.default)) || _class);\nexports.default = ShareControl;\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _settings = __webpack_require__(23);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _smartContainer = __webpack_require__(25);\n\nvar _smartContainer2 = _interopRequireDefault(_smartContainer);\n\nvar _smartContainerItem = __webpack_require__(26);\n\nvar _smartContainerItem2 = _interopRequireDefault(_smartContainerItem);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n videoTracks: state.engine.videoTracks\n };\n};\n\nvar SettingsControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_settings.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(SettingsControl, _BaseComponent);\n\n function SettingsControl(obj) {\n _classCallCheck(this, SettingsControl);\n\n return _possibleConstructorReturn(this, (SettingsControl.__proto__ || Object.getPrototypeOf(SettingsControl)).call(this, { name: 'Settings', player: obj.player }));\n }\n\n _createClass(SettingsControl, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.setState({ smartContainerOpen: false });\n }\n }, {\n key: 'onControlButtonClick',\n value: function onControlButtonClick() {\n this.setState({ smartContainerOpen: !this.state.smartContainerOpen });\n }\n }, {\n key: 'onSpeedChange',\n value: function onSpeedChange(o) {\n this.props.updateSpeed(o.value);\n }\n }, {\n key: 'onQualityChange',\n value: function onQualityChange(o) {\n this.props.updateQuality(o.value);\n }\n }, {\n key: 'render',\n value: function render(props) {\n var _this2 = this;\n\n var speedOptions = [{ value: 1, label: 'Auto (360)', active: true }, { value: 2, label: '240' }, { value: 3, label: '144' }];\n return (0, _preact.h)(\n 'div',\n { className: 'control-button-container control-settings' },\n (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(\n 'button',\n { 'aria-label': (0, _preact.h)(_preactI18n.Text, { id: 'controls.settings' }), className: this.state.smartContainerOpen ? 'control-button active' : 'control-button', onClick: function onClick() {\n return _this2.onControlButtonClick();\n } },\n (0, _preact.h)(_icon2.default, { type: 'settings' })\n )\n ),\n !this.state.smartContainerOpen ? '' : (0, _preact.h)(\n _smartContainer2.default,\n null,\n props.videoTracks.length <= 0 ? '' : (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(_smartContainerItem2.default, { label: (0, _preact.h)(_preactI18n.Text, { id: 'settings.quality' }), options: qualityOptions, onSelect: function onSelect(o) {\n return _this2.onQualityChange(o);\n } })\n ),\n (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(_smartContainerItem2.default, { label: (0, _preact.h)(_preactI18n.Text, { id: 'settings.speed' }), options: speedOptions, onSelect: function onSelect(o) {\n return _this2.onSpeedChange(o);\n } })\n )\n )\n );\n }\n }]);\n\n return SettingsControl;\n}(_base2.default)) || _class);\nexports.default = SettingsControl;\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar DropDownMenu = function (_Component) {\n _inherits(DropDownMenu, _Component);\n\n function DropDownMenu() {\n _classCallCheck(this, DropDownMenu);\n\n return _possibleConstructorReturn(this, (DropDownMenu.__proto__ || Object.getPrototypeOf(DropDownMenu)).apply(this, arguments));\n }\n\n _createClass(DropDownMenu, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n this.setState({ dropMenuActive: false });\n }\n }, {\n key: 'isSelected',\n value: function isSelected(o) {\n return o.active;\n }\n }, {\n key: 'onSelect',\n value: function onSelect(o) {\n this.props.onSelect(o);\n this.setState({ dropMenuActive: false });\n }\n }, {\n key: 'render',\n value: function render(props) {\n var _this2 = this;\n\n return (0, _preact.h)(\n 'div',\n { className: 'dropdown top left' },\n (0, _preact.h)(\n 'div',\n { className: 'dropdown-button', onClick: function onClick() {\n return _this2.setState({ dropMenuActive: !_this2.state.dropMenuActive });\n } },\n props.options.filter(function (t) {\n return t.active;\n }).length > 0 ? props.options.filter(function (t) {\n return t.active;\n })[0].label : ''\n ),\n !this.state.dropMenuActive ? '' : (0, _preact.h)(\n 'div',\n { className: 'dropdown-menu' },\n props.options.map(function (o) {\n return (0, _preact.h)(\n 'div',\n { className: _this2.isSelected(o) ? 'dropdown-menu-item active' : 'dropdown-menu-item', onClick: function onClick() {\n return _this2.onSelect(o);\n } },\n (0, _preact.h)(\n 'span',\n null,\n o.label\n ),\n _this2.isSelected(o) ? (0, _preact.h)(_icon2.default, { type: 'check' }) : ''\n );\n })\n )\n );\n }\n }]);\n\n return DropDownMenu;\n}(_preact.Component);\n\nexports.default = DropDownMenu;\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _smartContainer = __webpack_require__(25);\n\nvar _smartContainer2 = _interopRequireDefault(_smartContainer);\n\nvar _smartContainerItem = __webpack_require__(26);\n\nvar _smartContainerItem2 = _interopRequireDefault(_smartContainerItem);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n audioTracks: state.engine.audioTracks,\n textTracks: state.engine.textTracks\n };\n};\n\nvar LanguageControl = (_dec = (0, _preactRedux.connect)(mapStateToProps), _dec(_class = function (_BaseComponent) {\n _inherits(LanguageControl, _BaseComponent);\n\n function LanguageControl(obj) {\n _classCallCheck(this, LanguageControl);\n\n return _possibleConstructorReturn(this, (LanguageControl.__proto__ || Object.getPrototypeOf(LanguageControl)).call(this, { name: 'LanguageControl', player: obj.player }));\n }\n\n _createClass(LanguageControl, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.setState({ smartContainerOpen: false });\n }\n }, {\n key: 'onControlButtonClick',\n value: function onControlButtonClick() {\n this.setState({ smartContainerOpen: !this.state.smartContainerOpen });\n }\n }, {\n key: 'onAudioChange',\n value: function onAudioChange(audioTrack) {\n // this.player.selectTrack(audioTrack);\n this.player._engine.selectTextTrack(audioTrack); // workaround untill bug fixed in playkit-js\n }\n }, {\n key: 'onCaptionsChange',\n value: function onCaptionsChange(textTrack) {\n // this.player.selectTrack(textTrack);\n this.player._engine.selectTextTrack(textTrack); // workaround untill bug fixed in playkit-js\n }\n }, {\n key: 'render',\n value: function render(props) {\n var _this2 = this;\n\n return props.audioTracks.length === 0 && props.audioTracks.length === 0 ? false : (0, _preact.h)(\n 'div',\n { className: 'control-button-container control-language' },\n (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(\n 'button',\n { 'aria-label': (0, _preact.h)(_preactI18n.Text, { id: 'controls.language' }), className: this.state.smartContainerOpen ? 'control-button active' : 'control-button', onClick: function onClick() {\n return _this2.onControlButtonClick();\n } },\n (0, _preact.h)(_icon2.default, { type: 'language' })\n )\n ),\n !this.state.smartContainerOpen ? '' : (0, _preact.h)(\n _smartContainer2.default,\n null,\n props.audioTracks.length <= 0 ? '' : (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(_smartContainerItem2.default, { label: (0, _preact.h)(_preactI18n.Text, { id: 'language.audio' }), options: props.audioTracks, onSelect: function onSelect(audioTrack) {\n return _this2.onAudioChange(audioTrack);\n } })\n ),\n props.textTracks.length <= 0 ? '' : (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(_smartContainerItem2.default, { label: (0, _preact.h)(_preactI18n.Text, { id: 'language.captions' }), options: props.textTracks, onSelect: function onSelect(textTrack) {\n return _this2.onCaptionsChange(textTrack);\n } })\n ),\n props.textTracks.length <= 0 ? '' : (0, _preact.h)(\n 'div',\n { className: 'smart-container-item' },\n (0, _preact.h)(\n 'a',\n { href: '#' },\n (0, _preact.h)(\n _preactI18n.Text,\n { id: 'language.advanced_captions_settings' },\n 'Advanced captions settings'\n )\n )\n )\n )\n );\n }\n }]);\n\n return LanguageControl;\n}(_base2.default)) || _class);\nexports.default = LanguageControl;\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _fullscreen = __webpack_require__(20);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n fullscreen: state.fullscreen.fullscreen\n };\n};\n\nvar FullscreenControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_fullscreen.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(FullscreenControl, _BaseComponent);\n\n function FullscreenControl() {\n _classCallCheck(this, FullscreenControl);\n\n return _possibleConstructorReturn(this, (FullscreenControl.__proto__ || Object.getPrototypeOf(FullscreenControl)).call(this, { name: 'Fullscreen' }));\n }\n\n _createClass(FullscreenControl, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this._playerElement = document.getElementsByClassName('player')[0];\n\n document.addEventListener('webkitfullscreenchange', function () {\n _this2.props.updateFullscreen(document.webkitIsFullScreen);\n });\n }\n }, {\n key: 'enterFullscreen',\n value: function enterFullscreen() {\n this._playerElement.webkitRequestFullscreen();\n }\n }, {\n key: 'exitFullscreen',\n value: function exitFullscreen() {\n document.webkitCancelFullScreen();\n }\n }, {\n key: 'toggleFullscreen',\n value: function toggleFullscreen() {\n this.logger.debug('Toggle fullscreen');\n this.props.fullscreen ? this.exitFullscreen() : this.enterFullscreen();\n }\n }, {\n key: 'render',\n value: function render() {\n var _this3 = this;\n\n return (0, _preact.h)(\n 'div',\n { className: 'control-button-container control-fullscreen' },\n (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(\n 'button',\n { 'aria-label': (0, _preact.h)(_preactI18n.Text, { id: 'controls.fullscreen' }), className: this.props.fullscreen ? 'control-button is-fullscreen' : 'control-button', onClick: function onClick() {\n return _this3.toggleFullscreen();\n } },\n (0, _preact.h)(_icon2.default, { type: 'maximize' }),\n (0, _preact.h)(_icon2.default, { type: 'minimize' })\n )\n )\n );\n }\n }]);\n\n return FullscreenControl;\n}(_base2.default)) || _class);\nexports.default = FullscreenControl;\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _timeFormat = __webpack_require__(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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n currentTime: state.seekbar.currentTime,\n duration: state.engine.duration\n };\n};\n\nvar TimeDisplay = (_dec = (0, _preactRedux.connect)(mapStateToProps), _dec(_class = function (_BaseComponent) {\n _inherits(TimeDisplay, _BaseComponent);\n\n function TimeDisplay(obj) {\n _classCallCheck(this, TimeDisplay);\n\n return _possibleConstructorReturn(this, (TimeDisplay.__proto__ || Object.getPrototypeOf(TimeDisplay)).call(this, { name: 'TimeDisplay', player: obj.player, config: obj.config }));\n }\n\n _createClass(TimeDisplay, [{\n key: 'getTimeDisplay',\n value: function getTimeDisplay() {\n var result = this.props.format ? this.props.format : 'current / total',\n current = (0, _timeFormat.toHHMMSS)(this.props.currentTime),\n total = (0, _timeFormat.toHHMMSS)(this.props.duration),\n left = (0, _timeFormat.toHHMMSS)(this.props.duration - this.props.currentTime);\n\n result = result.replace(/current/g, current);\n result = result.replace(/total/g, total);\n result = result.replace(/left/g, left);\n\n return result;\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'div',\n { className: 'time-display' },\n (0, _preact.h)(\n 'span',\n null,\n this.getTimeDisplay()\n )\n );\n }\n }]);\n\n return TimeDisplay;\n}(_base2.default)) || _class);\nexports.default = TimeDisplay;\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\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\nvar TopBar = function (_Component) {\n _inherits(TopBar, _Component);\n\n function TopBar() {\n _classCallCheck(this, TopBar);\n\n return _possibleConstructorReturn(this, (TopBar.__proto__ || Object.getPrototypeOf(TopBar)).apply(this, arguments));\n }\n\n _createClass(TopBar, [{\n key: 'render',\n value: function render(props) {\n return (0, _preact.h)(\n 'div',\n { className: 'top-bar' },\n props.children\n );\n }\n }]);\n\n return TopBar;\n}(_preact.Component);\n\nexports.default = TopBar;\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\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\nvar BottomBar = function (_Component) {\n _inherits(BottomBar, _Component);\n\n function BottomBar() {\n _classCallCheck(this, BottomBar);\n\n return _possibleConstructorReturn(this, (BottomBar.__proto__ || Object.getPrototypeOf(BottomBar)).apply(this, arguments));\n }\n\n _createClass(BottomBar, [{\n key: 'render',\n value: function render(props) {\n return (0, _preact.h)(\n 'div',\n { className: 'bottom-bar' },\n props.children\n );\n }\n }]);\n\n return BottomBar;\n}(_preact.Component);\n\nexports.default = BottomBar;\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _share = __webpack_require__(10);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _overlay = __webpack_require__(27);\n\nvar _overlay2 = _interopRequireDefault(_overlay);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n open: state.share.overlayOpen\n };\n};\n\nvar ShareOverlay = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_share.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(ShareOverlay, _BaseComponent);\n\n function ShareOverlay() {\n _classCallCheck(this, ShareOverlay);\n\n return _possibleConstructorReturn(this, (ShareOverlay.__proto__ || Object.getPrototypeOf(ShareOverlay)).call(this, { name: 'ShareOverlay' }));\n }\n\n _createClass(ShareOverlay, [{\n key: 'render',\n value: function render(props) {\n return !props.open ? '' : (0, _preact.h)(\n _overlay2.default,\n { open: props.open, onClose: function onClose() {\n return props.toggleShareOverlay(false);\n }, type: 'share' },\n (0, _preact.h)(\n 'div',\n { className: 'title' },\n (0, _preact.h)(_preactI18n.Text, { id: 'share.share_title' })\n ),\n (0, _preact.h)(\n 'div',\n { className: 'share-icons' },\n (0, _preact.h)(\n 'a',\n { className: 'share-btn facebook-share-btn' },\n (0, _preact.h)(\n 'svg',\n { style: 'width:32px;height:32px', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { fill: '#fff', d: 'M432 405.333h-80v106.667h80v320h133.333v-320h97.12l9.547-106.667h-106.667v-44.453c0-25.467 5.12-35.547 29.733-35.547h76.933v-133.333h-101.547c-95.893 0-138.453 42.213-138.453 123.067v90.267z' })\n )\n ),\n (0, _preact.h)(\n 'a',\n { className: 'share-btn twitter-share-btn' },\n (0, _preact.h)(\n 'svg',\n { style: 'width:32px;height:32px', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { fill: '#fff', d: 'M832 316.614c-23.547 10.29-48.853 17.221-75.413 20.345 27.12-15.987 47.947-41.319 57.733-71.508-25.36 14.806-53.467 25.568-83.387 31.37-23.92-25.122-58.080-40.82-95.84-40.82-84.773 0-147.067 77.861-127.92 158.687-109.093-5.381-205.84-56.833-270.613-135.035-34.4 58.094-17.84 134.090 40.613 172.574-21.493-0.683-41.76-6.484-59.44-16.171-1.44 59.879 42.16 115.898 105.307 128.368-18.48 4.935-38.72 6.090-59.307 2.205 16.693 51.347 65.173 88.702 122.667 89.752-55.2 42.605-124.747 61.637-194.4 53.552 58.107 36.673 127.147 58.067 201.28 58.067 243.787 0 381.52-202.684 373.2-384.473 25.653-18.244 47.92-41.004 65.52-66.914v0z' })\n )\n ),\n (0, _preact.h)(\n 'a',\n { className: 'share-btn google-plus-share-btn' },\n (0, _preact.h)(\n 'svg',\n { style: 'width:32px;height:32px', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { fill: '#fff', d: 'M352 556.8h127.040c-5.12 32.928-38.4 96.64-127.040 96.64-76.48 0-138.88-63.328-138.88-141.44 0-78.080 62.4-141.44 138.88-141.44 43.52 0 72.64 18.56 89.28 34.56l60.8-58.56c-39.040-36.48-89.6-58.56-150.080-58.56-123.84 0-224 100.16-224 224s100.16 224 224 224c129.28 0 215.072-90.88 215.072-218.88 0-14.72-1.632-25.92-3.552-37.12h-211.52v76.8zM800 544v96h-64v-96h-96v-64h96v-96h64v96h96v64h-96z' })\n )\n ),\n (0, _preact.h)(\n 'a',\n { className: 'share-btn linkedin-share-btn' },\n (0, _preact.h)(\n 'svg',\n { style: 'width:32px;height:32px', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { fill: '#fff', d: 'M324.8 290.087c0 36.506-29.6 66.087-66.133 66.087s-66.133-29.581-66.133-66.087c0-36.48 29.6-66.087 66.133-66.087s66.133 29.607 66.133 66.087zM325.333 409.043h-133.333v422.957h133.333v-422.957zM538.187 409.043h-132.48v422.957h132.507v-222.026c0-123.45 160.773-133.549 160.773 0v222.026h133.013v-267.811c0-208.306-237.92-200.719-293.813-98.179v-56.967z' })\n )\n ),\n (0, _preact.h)(\n 'a',\n { className: 'share-btn email-share-btn' },\n (0, _preact.h)(\n 'svg',\n { style: 'width:32px;height:32px', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { fill: '#fff', d: 'M256 768c-35.346 0-64-28.654-64-64v-352c0-35.346 28.654-64 64-64h512c35.346 0 64 28.654 64 64v352c0 35.346-28.654 64-64 64h-512zM512 467.488l147.52-115.488h-295.040l147.52 115.488zM748.48 352l-211.2 179.2c-0.713 1.308-1.572 2.532-2.56 3.648-12.707 12.158-32.733 12.158-45.44 0-0.988-1.116-1.847-2.34-2.56-3.648l-211.2-179.2h-19.52v352h512v-352h-19.52z' })\n )\n ),\n (0, _preact.h)(\n 'a',\n { className: 'share-btn embed-share-btn' },\n (0, _preact.h)(\n 'svg',\n { style: 'width:32px;height:32px', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { fill: '#fff', d: 'M377.989 579.335c12.669 12.904 12.669 33.777 0 46.68-12.733 12.969-33.427 12.969-46.16 0l-104.727-106.667c-12.669-12.904-12.669-33.777 0-46.68l104.727-106.667c12.733-12.969 33.427-12.969 46.16 0 12.669 12.904 12.669 33.777 0 46.68l-81.812 83.327 81.812 83.327zM646.011 412.68c-12.669-12.904-12.669-33.777 0-46.68 12.733-12.969 33.427-12.969 46.16 0l104.727 106.667c12.669 12.904 12.669 33.777 0 46.68l-104.727 106.667c-12.733 12.969-33.427 12.969-46.16 0-12.669-12.904-12.669-33.777 0-46.68l81.812-83.327-81.812-83.327zM572.293 250.6c17.455 4.445 28.025 22.388 23.686 40.066l-104.727 426.669c-4.349 17.719-22.048 28.535-39.545 24.079-17.455-4.445-28.025-22.388-23.686-40.066l104.727-426.669c4.349-17.719 22.048-28.535 39.545-24.079z' })\n )\n )\n ),\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n 'div',\n { className: 'form-group has-icon', style: 'width: 300px;' },\n (0, _preact.h)('input', { type: 'text', placeholder: 'Share URL', className: 'form-control', value: 'https://cdnapisec.kaltura.com/index.php?assetId=123456', readOnly: true }),\n (0, _preact.h)(\n 'svg',\n { className: 'icon', style: 'width:32px;height:32px;', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M355.028 445.537c12.497 12.497 12.497 32.758 0 45.255s-32.758 12.497-45.255 0l-24.141-24.141c-49.92-49.92-49.832-130.999 0.094-180.925 49.984-49.984 130.995-50.025 180.955-0.064l113.266 113.266c49.964 49.964 49.935 130.955-0.064 180.955-12.497 12.497-32.758 12.497-45.255 0s-12.497-32.758 0-45.255c25.013-25.013 25.027-65.482 0.064-90.445l-113.266-113.266c-24.957-24.957-65.445-24.936-90.445 0.064-24.955 24.955-24.998 65.511-0.094 90.416l24.141 24.141zM668.972 578.463c-12.497-12.497-12.497-32.758 0-45.255s32.758-12.497 45.255 0l24.141 24.141c49.92 49.92 49.832 130.999-0.094 180.925-49.984 49.984-130.995 50.025-180.955 0.064l-113.266-113.266c-49.964-49.964-49.935-130.955 0.064-180.955 12.497-12.497 32.758-12.497 45.255 0s12.497 32.758 0 45.255c-25.013 25.013-25.027 65.482-0.064 90.445l113.266 113.266c24.957 24.957 65.445 24.936 90.445-0.064 24.955-24.955 24.998-65.511 0.094-90.416l-24.141-24.141z' })\n )\n )\n ),\n (0, _preact.h)(\n 'a',\n null,\n (0, _preact.h)(_preactI18n.Text, { id: 'share.link_options' })\n )\n );\n }\n }]);\n\n return ShareOverlay;\n}(_base2.default)) || _class);\nexports.default = ShareOverlay;\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _cvaa = __webpack_require__(22);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _overlay = __webpack_require__(27);\n\nvar _overlay2 = _interopRequireDefault(_overlay);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n open: state.cvaa.overlayOpen\n };\n};\n\nvar CVAAOverlay = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_cvaa.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(CVAAOverlay, _BaseComponent);\n\n function CVAAOverlay() {\n _classCallCheck(this, CVAAOverlay);\n\n return _possibleConstructorReturn(this, (CVAAOverlay.__proto__ || Object.getPrototypeOf(CVAAOverlay)).call(this, { name: 'CVAAOverlay' }));\n }\n\n _createClass(CVAAOverlay, [{\n key: 'render',\n value: function render(props) {\n return !props.open ? '' : (0, _preact.h)(\n _overlay2.default,\n { type: 'cvaa' },\n (0, _preact.h)(\n 'div',\n { className: 'title' },\n 'Advanced captions settings'\n ),\n (0, _preact.h)(\n 'div',\n { className: 'sample' },\n 'Sample'\n ),\n (0, _preact.h)(\n 'div',\n { className: 'sample black-bg' },\n 'Sample'\n ),\n (0, _preact.h)(\n 'div',\n { className: 'sample yellow-text' },\n 'Sample'\n )\n );\n }\n }]);\n\n return CVAAOverlay;\n}(_base2.default)) || _class);\nexports.default = CVAAOverlay;\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\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\nvar KeyboardControl = function (_BaseComponent) {\n _inherits(KeyboardControl, _BaseComponent);\n\n // _playerElement: HTMLElement;\n\n function KeyboardControl(obj) {\n _classCallCheck(this, KeyboardControl);\n\n // this._playerElement = document.getElementsByClassName('player')[0];\n\n var _this = _possibleConstructorReturn(this, (KeyboardControl.__proto__ || Object.getPrototypeOf(KeyboardControl)).call(this, { name: 'Keyboard', player: obj.player }));\n\n document.body.onkeydown = function (e) {\n var time = void 0,\n newVolume = void 0;\n switch (e.which) {\n case 32:\n // space\n _this.logger.debug(\"Keydown space\");\n _this.player.paused ? _this.player.play() : _this.player.pause();\n break;\n\n case 38:\n // up\n _this.logger.debug(\"Keydown up\");\n newVolume = Math.round(_this.player.volume * 100) + 5;\n _this.logger.debug('Changing volume. ' + _this.player.volume + ' => ' + newVolume);\n if (_this.player.muted) {\n _this.player.muted = false;\n }\n _this.player.volume = newVolume / 100;\n break;\n\n case 40:\n // down\n _this.logger.debug(\"Keydown down\");\n newVolume = Math.round(_this.player.volume * 100) - 5;\n if (newVolume < 5) {\n _this.player.muted = true;\n return;\n }\n _this.logger.debug('Changing volume. ' + _this.player.volume + ' => ' + newVolume);\n _this.player.volume = newVolume / 100;\n break;\n\n case 37:\n // left\n _this.logger.debug(\"Keydown left\");\n time = _this.player.currentTime - 5 > 0 ? _this.player.currentTime - 5 : 0;\n _this.player.currentTime = time;\n break;\n\n case 39:\n // right\n _this.logger.debug(\"Keydown right\");\n time = _this.player.currentTime + 5 > _this.player.duration ? _this.player.duration : _this.player.currentTime + 5;\n _this.player.currentTime = time;\n break;\n\n default:\n return;\n }\n };\n\n _this.disableKeyboardCommandsOnControls();\n return _this;\n }\n\n _createClass(KeyboardControl, [{\n key: 'disableKeyboardCommandsOnControls',\n value: function disableKeyboardCommandsOnControls() {\n var controlButtonsElements = Array.from(document.getElementsByClassName('control-button'));\n controlButtonsElements.forEach(function (element) {\n element.onkeydown = function (e) {\n return e.preventDefault();\n };\n });\n }\n }]);\n\n return KeyboardControl;\n}(_base2.default);\n\nexports.default = KeyboardControl;\n\n/***/ })\n/******/ ]);\n});\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = __webpack_require__(5);\nif(typeof content === 'string') content = [[module.i, content, '']];\n// Prepare cssTransformation\nvar transform;\n\nvar options = {}\noptions.transform = transform\n// add the styles to the DOM\nvar update = __webpack_require__(7)(content, options);\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(false) {\n\t// When the styles change, update the <style> tags\n\tif(!content.locals) {\n\t\tmodule.hot.accept(\"!!../../../css-loader/index.js!./style.css\", function() {\n\t\t\tvar newContent = require(\"!!../../../css-loader/index.js!./style.css\");\n\t\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\t\t\tupdate(newContent);\n\t\t});\n\t}\n\t// When the module is disposed, remove the <style> tags\n\tmodule.hot.dispose(function() { update(); });\n}\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(6)(undefined);\n// imports\n\n\n// module\nexports.push([module.i, \".row{display:block}.row:after{content:'';clear:both;display:block}.form-group{margin:10px auto;position:relative;max-width:100%}.form-group.has-error .form-control{border-color:#db1f26}.form-group.has-error .form-control:focus{border-color:#fff}.form-group.has-icon .form-control{padding-left:34px}.form-group .icon{position:absolute;top:2px;left:2px;fill:rgba(255,255,255,0.4)}.form-control{height:36px;width:100%;min-width:72px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(0,0,0,0.4);font-size:15px;line-height:18px;color:#fff;padding:8px 10px;text-overflow:ellipsis}.form-control::-webkit-input-placeholder{color:rgba(255,255,255,0.6)}.form-control:focus{background-color:#fff;border-color:#fff;color:#333}.form-control:focus::-webkit-input-placeholder{color:#ccc}.form-control:focus+.icon{fill:#999}textarea.form-control{min-height:72px}@-webkit-keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.dropdown{position:relative}.dropdown.active .dropdown-menu{display:block;opacity:1}.dropdown.top .dropdown-menu{margin-bottom:10px;bottom:100%}.dropdown.bottom .dropdown-menu{margin-top:10px;top:100%}.dropdown.right .dropdown-menu{left:0}.dropdown.left .dropdown-menu{right:0}.dropdown .dropdown-button{font-size:15px;font-weight:bold;line-height:18px;color:#fff;cursor:pointer}.dropdown .dropdown-menu{display:block;opacity:1;position:absolute;background-color:#333333;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;padding:6px 0;z-index:5;-webkit-animation:openDropmenu 100ms ease-out forwards;animation:openDropmenu 100ms ease-out forwards;max-height:173px;overflow-y:auto}.dropdown .dropdown-menu .dropdown-menu-item{padding:2px 10px 2px 16px;white-space:nowrap;min-height:30px;cursor:pointer}.dropdown .dropdown-menu .dropdown-menu-item:hover{color:#fff}.dropdown .dropdown-menu .dropdown-menu-item.active{color:#01ACCD;fill:#01ACCD}.dropdown .dropdown-menu .dropdown-menu-item .check-icon{display:inline-block;margin-left:16px;vertical-align:middle;width:24px;height:24px}.dropdown .dropdown-menu .dropdown-menu-item span{vertical-align:middle;line-height:26px}.tooltip{display:inline-block;height:22px;border-radius:4px;background-color:#FFFFFF;padding:3px 13px;color:#333333;font-size:13px;font-weight:bold;line-height:16px;box-shadow:0 0 8px 0 rgba(0,0,0,0.3)}.player .control-button{width:32px;height:32px;background:transparent;display:inline-block;opacity:0.8;border:none;padding:0;cursor:pointer;fill:#fff}.player .control-button svg{width:32px;height:32px}.player .control-button:hover,.player .control-button.active{opacity:1}.player .control-button.control-button-rounded{width:36px;height:36px;padding:2px}.player .control-button.control-button-rounded:hover{background-color:rgba(0,0,0,0.4);border-radius:18px}.player .control-button-container{display:inline-block;position:relative;vertical-align:top}a{color:#01ACCD;text-decoration:underline;font-size:15px;line-height:18px}a:hover{color:#01819a}a:active{opacity:0.7}.player{position:relative;max-width:854px;width:100%;background-color:#000;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.player:-webkit-full-screen{width:100%;height:100%;max-width:none}.player *{box-sizing:border-box;outline:none}.player ::-moz-selection{background-color:rgba(0,0,0,0.1)}.player ::selection{background-color:rgba(0,0,0,0.1)}.player video{width:100%}.player .player-gui{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;overflow:hidden;font-size:0;font-family:\\\"Lato\\\",sans-serif}.player .player-gui input,.player .player-gui textarea{font-family:\\\"Lato\\\",sans-serif}.player.metadata-loaded .player-gui,.player.state-paused .player-gui,.player.overlay-active .player-gui,.player.menu-active .player-gui{opacity:1}video::-webkit-media-controls{display:none !important}video::-webkit-media-controls-start-playback-button{display:none !important;-webkit-appearance:none}@-webkit-keyframes openOverlay{from{opacity:0}to{opacity:1}}@keyframes openOverlay{from{opacity:0}to{opacity:1}}.overlay{position:absolute;display:none;opacity:0;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.42);z-index:4;text-align:center;color:#fff;padding:80px 20px 0;-webkit-animation:openOverlay 100ms ease-in-out forwards;animation:openOverlay 100ms ease-in-out forwards}.overlay.active{display:block;opacity:1}.overlay .title{font-size:24px;font-weight:bold;line-height:29px;margin-bottom:60px}.overlay .close-overlay{position:absolute;top:48px;right:48px;z-index:5;fill:#fff;cursor:pointer}.overlay .close-overlay .icon-close{width:24px;height:24px}@media screen and (max-width: 768px){.overlay{padding:36px 20px 0}.overlay .close-overlay{top:38px}.overlay .title{margin-bottom:24px}}@media screen and (max-width: 480px){.overlay{padding:16px 24px 0}.overlay .close-overlay{top:15px;right:24px}.overlay .title{font-size:16px;line-height:19px;margin-bottom:36px}}@-webkit-keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.smart-container{background-color:#222222;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;position:absolute;right:0px;min-width:193px;font-size:15px;z-index:5;display:block;-webkit-animation:openSmartContainer 100ms ease-out forwards;animation:openSmartContainer 100ms ease-out forwards}.smart-container.top{bottom:100%;margin-bottom:6px}.smart-container.top:before{display:block;content:' ';position:absolute;bottom:-6px;left:0;width:100%;height:6px}.smart-container.bottom{top:100%;margin-top:6px}.smart-container.right{left:0px}.smart-container.left{right:0px}.smart-container .smart-container-item{margin:16px;color:rgba(244,244,244,0.8);white-space:nowrap}.smart-container .smart-container-item:after{display:block;content:' ';clear:both}.smart-container .smart-container-item.select-menu-item label{float:left}.smart-container .smart-container-item.select-menu-item .dropdown{float:right}.overlay.share-overlay .share-icons{margin:60px 0}.overlay.share-overlay .share-btn{height:36px;width:36px;border-radius:18px;background-color:rgba(0,0,0,0.4);display:inline-block;margin:0 8px;-webkit-transition:-webkit-transform 100ms;transition:transform 100ms;will-change:transform;padding:2px}.overlay.share-overlay .share-btn:hover{-webkit-transform:scale(1.1667);-ms-transform:scale(1.1667);transform:scale(1.1667)}.overlay.share-overlay .share-btn.facebook-share-btn{background-color:#3B5998}.overlay.share-overlay .share-btn.twitter-share-btn{background-color:#1DA1F2}.overlay.share-overlay .share-btn.google-plus-share-btn{background-color:#DD4B39}.overlay.share-overlay .share-btn.linkedin-share-btn{background-color:#00A0DC}@media screen and (max-width: 768px){.overlay.share-overlay .share-icons{margin:40px 0}}@media screen and (max-width: 480px){.overlay.share-overlay .share-icons{margin:20px 0}}.overlay.cvaa-overlay .sample{border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:36px;text-align:center;padding:0 28px;display:inline-block;margin:0 12px;cursor:pointer}.overlay.cvaa-overlay .sample.black-bg{background-color:#000}.overlay.cvaa-overlay .sample.yellow-text{color:#FAFF00}@-webkit-keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}@keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}.loading-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.3);-webkit-transition:100ms opacity;transition:100ms opacity;opacity:0}.loading-backdrop.show{opacity:1}.loading-backdrop.show .spinner-container{display:block}.loading-backdrop .spinner-container{display:none;position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50px, -50px, 0);transform:translate3d(-50px, -50px, 0)}.spinner{width:100px;height:100px;position:relative;-webkit-animation:kaltura-spinner 2.5s infinite;animation:kaltura-spinner 2.5s infinite}.spinner span{width:8px;height:8px;background-color:#fff;display:block;border-radius:8px;position:absolute;top:50%;left:50%;margin-top:-4px;margin-left:-4px}.spinner span:nth-child(1){-webkit-transform:rotate(45deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(45deg) translateX(-25px) translateY(-25px);transform:rotate(45deg) translateX(-25px) translateY(-25px);background-color:#da1f26}.spinner span:nth-child(2){-webkit-transform:rotate(90deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(90deg) translateX(-25px) translateY(-25px);transform:rotate(90deg) translateX(-25px) translateY(-25px);background-color:#06a885}.spinner span:nth-child(3){-webkit-transform:rotate(135deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(135deg) translateX(-25px) translateY(-25px);transform:rotate(135deg) translateX(-25px) translateY(-25px);background-color:#009344}.spinner span:nth-child(4){-webkit-transform:rotate(180deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(180deg) translateX(-25px) translateY(-25px);transform:rotate(180deg) translateX(-25px) translateY(-25px);background-color:#f8a61a}.spinner span:nth-child(5){-webkit-transform:rotate(225deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(225deg) translateX(-25px) translateY(-25px);transform:rotate(225deg) translateX(-25px) translateY(-25px);background-color:#1b4a97}.spinner span:nth-child(6){-webkit-transform:rotate(270deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(270deg) translateX(-25px) translateY(-25px);transform:rotate(270deg) translateX(-25px) translateY(-25px);background-color:#00abcc}.spinner span:nth-child(7){-webkit-transform:rotate(315deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(315deg) translateX(-25px) translateY(-25px);transform:rotate(315deg) translateX(-25px) translateY(-25px);background-color:#b1d238}.spinner span:nth-child(8){-webkit-transform:rotate(360deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(360deg) translateX(-25px) translateY(-25px);transform:rotate(360deg) translateX(-25px) translateY(-25px);background-color:#fcd203}.control-button-container.control-play-pause .control-button{-webkit-transition:400ms -webkit-transform;transition:400ms transform}.control-button-container.control-play-pause .control-button .icon-pause{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:0;display:none}.control-button-container.control-play-pause .control-button .icon-play{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}.control-button-container.control-play-pause .control-button.is-playing .icon-pause{opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing .icon-play{opacity:0;display:none}@media screen and (max-width: 480px){.control-button-container.control-play-pause{display:none}}.control-button-container.volume-control:hover .volume-control-bar{display:block !important}.control-button-container.volume-control.is-muted .volume-waves{opacity:0;-webkit-transform:translateX(-5px);-ms-transform:translateX(-5px);transform:translateX(-5px)}.control-button-container.volume-control.is-muted .volume-mute{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.volume-control.dragging-active .volume-control-bar{display:block}.control-button-container.volume-control .volume-waves{-webkit-transform:translateX(0px);-ms-transform:translateX(0px);transform:translateX(0px)}.control-button-container.volume-control .volume-mute{opacity:1;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.control-button-container.volume-control .volume-waves,.control-button-container.volume-control .volume-mute{-webkit-transition:300ms -webkit-transform, 300ms opacity;transition:300ms transform, 300ms opacity}.control-button-container.volume-control svg{position:absolute;top:0;left:0}.volume-control-bar{position:absolute;z-index:2;bottom:38px;left:0px;display:block;height:112px;width:34px;border-radius:4px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);background-color:#333333;padding:6px;display:none}.volume-control-bar:before{position:absolute;width:34px;height:14px;bottom:-8px;left:0;content:' ';display:block}.volume-control-bar .bar{background-color:#424242;height:100%;position:relative;cursor:ns-resize}.volume-control-bar .progress{position:absolute;bottom:0px;left:0px;width:100%;border-radius:0 0 2px 2px;background-color:#01ACCD}.control-button-container.control-fullscreen .control-button{-webkit-transition:100ms -webkit-transform;transition:100ms transform;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.control-fullscreen .control-button .icon-minimize{display:none}.control-button-container.control-fullscreen .control-button:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-maximize{display:none}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-minimize{display:block}.player .seek-bar{padding:6px 0;cursor:pointer}.player .seek-bar:hover .progress-bar .scrubber,.player .seek-bar.dragging-active .progress-bar .scrubber{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.player .seek-bar:hover .progress-bar .virtual-progress,.player .seek-bar.dragging-active .progress-bar .virtual-progress{display:block}.player .seek-bar .progress-bar{height:4px;background-color:rgba(255,255,255,0.3);border-radius:2px;position:relative}.player .seek-bar .progress-bar .progress{position:absolute;top:0;left:0;height:100%;z-index:2;border-radius:2px 0 0 2px;background-color:#01ACCD}.player .seek-bar .progress-bar .virtual-progress{display:none}.player .seek-bar .progress-bar .buffered,.player .seek-bar .progress-bar .virtual-progress{position:absolute;top:0;left:0;height:100%;z-index:1;border-radius:2px 0 0 2px;background-color:rgba(255,255,255,0.3)}.player .seek-bar .progress-bar .buffered .frame-preview-img,.player .seek-bar .progress-bar .virtual-progress .frame-preview-img{background-size:auto 100%;width:100%;height:100%;position:relative}.player .seek-bar .progress-bar .buffered .frame-preview,.player .seek-bar .progress-bar .virtual-progress .frame-preview{position:absolute;bottom:16px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:94px;width:164px;border:2px solid rgba(255,255,255,0.2);border-radius:4px}.player .seek-bar .progress-bar .buffered .time-preview,.player .seek-bar .progress-bar .virtual-progress .time-preview{position:absolute;bottom:22px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:22px;min-width:48px;padding:0 3px;text-align:center;border-radius:3px;background-color:rgba(0,0,0,0.7);font-size:13px;font-weight:bold;line-height:22px;color:#fff}.player .seek-bar .progress-bar .scrubber{position:absolute;z-index:3;cursor:pointer;display:block;top:-6px;right:-8px;border-radius:8px;height:16px;width:16px;background-color:#FFFFFF;box-shadow:0 0 31px 0 rgba(0,0,0,0.3);-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:100ms -webkit-transform;transition:100ms transform}.player .seek-bar .progress-bar .scrubber:active{opacity:1;cursor:-webkit-grabbing;cursor:grabbing}@media screen and (max-width: 480px){.virtual-progress{display:none}}.player .time-display{display:inline-block;line-height:32px;vertical-align:top;font-size:14px;padding:0 23px;font-weight:bold}@media screen and (max-width: 480px){.player .time-display{padding:0 12px 0 0}}.player .video-playing-title{font-size:15px;font-weight:bold;line-height:18px;padding:6px 0}.player .bottom-bar{position:absolute;bottom:0;left:0;width:100%;background:-webkit-linear-gradient(270deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:6px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .bottom-bar .left-controls{float:left;text-align:left}.player .bottom-bar .right-controls{float:right;text-align:left}.player .bottom-bar .right-controls .control-button-container{margin:0 6px}.player .bottom-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .bottom-bar,.player.hover .bottom-bar,.player.state-paused .bottom-bar,.player.menu-active .bottom-bar{opacity:1}.player.overlay-active .bottom-bar{opacity:0}@media screen and (max-width: 480px){.player .bottom-bar{padding:6px 8px}}.player .top-bar{position:absolute;top:0;left:0;width:100%;background:-webkit-linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(0deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:14px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .top-bar .left-controls{float:left;text-align:left}.player .top-bar .right-controls{float:right;text-align:left}.player .top-bar .right-controls .control-button-container{margin:0 6px}.player .top-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .top-bar,.player.hover .top-bar,.player.state-paused .top-bar,.player.menu-active .top-bar{opacity:1}.player.overlay-active .top-bar{opacity:0}@media screen and (max-width: 480px){.player .top-bar{padding:8px 8px 20px 8px}}@-webkit-keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}@keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}.overlay-play{position:absolute;top:0;left:0;width:100%;height:100%}.overlay-play.in .icon{-webkit-animation:overlayPlayIconIn 400ms linear forwards;animation:overlayPlayIconIn 400ms linear forwards}.overlay-play .icon{width:144px;height:144px;fill:#fff;position:absolute;top:50%;left:50%;margin:-72px 0 0 -72px;opacity:0}\", \"\"]);\n\n// exports\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tmemo[selector] = fn.call(this, selector);\n\t\t}\n\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = __webpack_require__(8);\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n\t// tags it will allow on a page\n\tif (!options.singleton) options.singleton = isOldIE();\n\n\t// By default, add <style> tags to the <head> element\n\tif (!options.insertInto) options.insertInto = \"head\";\n\n\t// By default, add <style> tags to the bottom of the target\n\tif (!options.insertAt) options.insertAt = \"bottom\";\n\n\tvar styles = listToStyles(list, options);\n\n\taddStylesToDom(styles, options);\n\n\treturn function update (newList) {\n\t\tvar mayRemove = [];\n\n\t\tfor (var i = 0; i < styles.length; i++) {\n\t\t\tvar item = styles[i];\n\t\t\tvar domStyle = stylesInDom[item.id];\n\n\t\t\tdomStyle.refs--;\n\t\t\tmayRemove.push(domStyle);\n\t\t}\n\n\t\tif(newList) {\n\t\t\tvar newStyles = listToStyles(newList, options);\n\t\t\taddStylesToDom(newStyles, options);\n\t\t}\n\n\t\tfor (var i = 0; i < mayRemove.length; i++) {\n\t\t\tvar domStyle = mayRemove[i];\n\n\t\t\tif(domStyle.refs === 0) {\n\t\t\t\tfor (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();\n\n\t\t\t\tdelete stylesInDom[domStyle.id];\n\t\t\t}\n\t\t}\n\t};\n};\n\nfunction addStylesToDom (styles, options) {\n\tfor (var i = 0; i < styles.length; i++) {\n\t\tvar item = styles[i];\n\t\tvar domStyle = stylesInDom[item.id];\n\n\t\tif(domStyle) {\n\t\t\tdomStyle.refs++;\n\n\t\t\tfor(var j = 0; j < domStyle.parts.length; j++) {\n\t\t\t\tdomStyle.parts[j](item.parts[j]);\n\t\t\t}\n\n\t\t\tfor(; j < item.parts.length; j++) {\n\t\t\t\tdomStyle.parts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\t\t} else {\n\t\t\tvar parts = [];\n\n\t\t\tfor(var j = 0; j < item.parts.length; j++) {\n\t\t\t\tparts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\n\t\t\tstylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};\n\t\t}\n\t}\n}\n\nfunction listToStyles (list, options) {\n\tvar styles = [];\n\tvar newStyles = {};\n\n\tfor (var i = 0; i < list.length; i++) {\n\t\tvar item = list[i];\n\t\tvar id = options.base ? item[0] + options.base : item[0];\n\t\tvar css = item[1];\n\t\tvar media = item[2];\n\t\tvar sourceMap = item[3];\n\t\tvar part = {css: css, media: media, sourceMap: sourceMap};\n\n\t\tif(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});\n\t\telse newStyles[id].parts.push(part);\n\t}\n\n\treturn styles;\n}\n\nfunction insertStyleElement (options, style) {\n\tvar target = getElement(options.insertInto)\n\n\tif (!target) {\n\t\tthrow new Error(\"Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.\");\n\t}\n\n\tvar lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];\n\n\tif (options.insertAt === \"top\") {\n\t\tif (!lastStyleElementInsertedAtTop) {\n\t\t\ttarget.insertBefore(style, target.firstChild);\n\t\t} else if (lastStyleElementInsertedAtTop.nextSibling) {\n\t\t\ttarget.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);\n\t\t} else {\n\t\t\ttarget.appendChild(style);\n\t\t}\n\t\tstylesInsertedAtTop.push(style);\n\t} else if (options.insertAt === \"bottom\") {\n\t\ttarget.appendChild(style);\n\t} else {\n\t\tthrow new Error(\"Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.\");\n\t}\n}\n\nfunction removeStyleElement (style) {\n\tif (style.parentNode === null) return false;\n\tstyle.parentNode.removeChild(style);\n\n\tvar idx = stylesInsertedAtTop.indexOf(style);\n\tif(idx >= 0) {\n\t\tstylesInsertedAtTop.splice(idx, 1);\n\t}\n}\n\nfunction createStyleElement (options) {\n\tvar style = document.createElement(\"style\");\n\n\toptions.attrs.type = \"text/css\";\n\n\taddAttrs(style, options.attrs);\n\tinsertStyleElement(options, style);\n\n\treturn style;\n}\n\nfunction createLinkElement (options) {\n\tvar link = document.createElement(\"link\");\n\n\toptions.attrs.type = \"text/css\";\n\toptions.attrs.rel = \"stylesheet\";\n\n\taddAttrs(link, options.attrs);\n\tinsertStyleElement(options, link);\n\n\treturn link;\n}\n\nfunction addAttrs (el, attrs) {\n\tObject.keys(attrs).forEach(function (key) {\n\t\tel.setAttribute(key, attrs[key]);\n\t});\n}\n\nfunction addStyle (obj, options) {\n\tvar style, update, remove, result;\n\n\t// If a transform function was defined, run it on the css\n\tif (options.transform && obj.css) {\n\t result = options.transform(obj.css);\n\n\t if (result) {\n\t \t// If transform returns a value, use that instead of the original css.\n\t \t// This allows running runtime transformations on the css.\n\t \tobj.css = result;\n\t } else {\n\t \t// If the transform function returns a falsy value, don't add this css.\n\t \t// This allows conditional loading of css\n\t \treturn function() {\n\t \t\t// noop\n\t \t};\n\t }\n\t}\n\n\tif (options.singleton) {\n\t\tvar styleIndex = singletonCounter++;\n\n\t\tstyle = singleton || (singleton = createStyleElement(options));\n\n\t\tupdate = applyToSingletonTag.bind(null, style, styleIndex, false);\n\t\tremove = applyToSingletonTag.bind(null, style, styleIndex, true);\n\n\t} else if (\n\t\tobj.sourceMap &&\n\t\ttypeof URL === \"function\" &&\n\t\ttypeof URL.createObjectURL === \"function\" &&\n\t\ttypeof URL.revokeObjectURL === \"function\" &&\n\t\ttypeof Blob === \"function\" &&\n\t\ttypeof btoa === \"function\"\n\t) {\n\t\tstyle = createLinkElement(options);\n\t\tupdate = updateLink.bind(null, style, options);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\n\t\t\tif(style.href) URL.revokeObjectURL(style.href);\n\t\t};\n\t} else {\n\t\tstyle = createStyleElement(options);\n\t\tupdate = applyToTag.bind(null, style);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\t\t};\n\t}\n\n\tupdate(obj);\n\n\treturn function updateStyle (newObj) {\n\t\tif (newObj) {\n\t\t\tif (\n\t\t\t\tnewObj.css === obj.css &&\n\t\t\t\tnewObj.media === obj.media &&\n\t\t\t\tnewObj.sourceMap === obj.sourceMap\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdate(obj = newObj);\n\t\t} else {\n\t\t\tremove();\n\t\t}\n\t};\n}\n\nvar replaceText = (function () {\n\tvar textStore = [];\n\n\treturn function (index, replacement) {\n\t\ttextStore[index] = replacement;\n\n\t\treturn textStore.filter(Boolean).join('\\n');\n\t};\n})();\n\nfunction applyToSingletonTag (style, index, remove, obj) {\n\tvar css = remove ? \"\" : obj.css;\n\n\tif (style.styleSheet) {\n\t\tstyle.styleSheet.cssText = replaceText(index, css);\n\t} else {\n\t\tvar cssNode = document.createTextNode(css);\n\t\tvar childNodes = style.childNodes;\n\n\t\tif (childNodes[index]) style.removeChild(childNodes[index]);\n\n\t\tif (childNodes.length) {\n\t\t\tstyle.insertBefore(cssNode, childNodes[index]);\n\t\t} else {\n\t\t\tstyle.appendChild(cssNode);\n\t\t}\n\t}\n}\n\nfunction applyToTag (style, obj) {\n\tvar css = obj.css;\n\tvar media = obj.media;\n\n\tif(media) {\n\t\tstyle.setAttribute(\"media\", media)\n\t}\n\n\tif(style.styleSheet) {\n\t\tstyle.styleSheet.cssText = css;\n\t} else {\n\t\twhile(style.firstChild) {\n\t\t\tstyle.removeChild(style.firstChild);\n\t\t}\n\n\t\tstyle.appendChild(document.createTextNode(css));\n\t}\n}\n\nfunction updateLink (link, options, obj) {\n\tvar css = obj.css;\n\tvar sourceMap = obj.sourceMap;\n\n\t/*\n\t\tIf convertToAbsoluteUrls isn't defined, but sourcemaps are enabled\n\t\tand there is no publicPath defined then lets turn convertToAbsoluteUrls\n\t\ton by default. Otherwise default to the convertToAbsoluteUrls option\n\t\tdirectly\n\t*/\n\tvar autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;\n\n\tif (options.convertToAbsoluteUrls || autoFixUrls) {\n\t\tcss = fixUrls(css);\n\t}\n\n\tif (sourceMap) {\n\t\t// http://stackoverflow.com/a/26603875\n\t\tcss += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\n\t}\n\n\tvar blob = new Blob([css], { type: \"text/css\" });\n\n\tvar oldSrc = link.href;\n\n\tlink.href = URL.createObjectURL(blob);\n\n\tif(oldSrc) URL.revokeObjectURL(oldSrc);\n}\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\n\n/**\n * When source maps are enabled, `style-loader` uses a link element with a data-uri to\n * embed the css on the page. This breaks all relative urls because now they are relative to a\n * bundle instead of the current page.\n *\n * One solution is to only use full urls, but that may be impossible.\n *\n * Instead, this function \"fixes\" the relative urls to be absolute according to the current page location.\n *\n * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.\n *\n */\n\nmodule.exports = function (css) {\n // get current location\n var location = typeof window !== \"undefined\" && window.location;\n\n if (!location) {\n throw new Error(\"fixUrls requires window.location\");\n }\n\n\t// blank or null?\n\tif (!css || typeof css !== \"string\") {\n\t return css;\n }\n\n var baseUrl = location.protocol + \"//\" + location.host;\n var currentDir = baseUrl + location.pathname.replace(/\\/[^\\/]*$/, \"/\");\n\n\t// convert each url(...)\n\t/*\n\tThis regular expression is just a way to recursively match brackets within\n\ta string.\n\n\t /url\\s*\\( = Match on the word \"url\" with any whitespace after it and then a parens\n\t ( = Start a capturing group\n\t (?: = Start a non-capturing group\n\t [^)(] = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t (?: = Start another non-capturing groups\n\t [^)(]+ = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t [^)(]* = Match anything that isn't a parentheses\n\t \\) = Match a end parentheses\n\t ) = End Group\n *\\) = Match anything and then a close parens\n ) = Close non-capturing group\n * = Match anything\n ) = Close capturing group\n\t \\) = Match a close parens\n\n\t /gi = Get all matches, not the first. Be case insensitive.\n\t */\n\tvar fixedCss = css.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi, function(fullMatch, origUrl) {\n\t\t// strip quotes (if they exist)\n\t\tvar unquotedOrigUrl = origUrl\n\t\t\t.trim()\n\t\t\t.replace(/^\"(.*)\"$/, function(o, $1){ return $1; })\n\t\t\t.replace(/^'(.*)'$/, function(o, $1){ return $1; });\n\n\t\t// already a full url? no change\n\t\tif (/^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/)/i.test(unquotedOrigUrl)) {\n\t\t return fullMatch;\n\t\t}\n\n\t\t// convert the url to a full url\n\t\tvar newUrl;\n\n\t\tif (unquotedOrigUrl.indexOf(\"//\") === 0) {\n\t\t \t//TODO: should we add protocol?\n\t\t\tnewUrl = unquotedOrigUrl;\n\t\t} else if (unquotedOrigUrl.indexOf(\"/\") === 0) {\n\t\t\t// path should be relative to the base url\n\t\t\tnewUrl = baseUrl + unquotedOrigUrl; // already starts with '/'\n\t\t} else {\n\t\t\t// path should be relative to current directory\n\t\t\tnewUrl = currentDir + unquotedOrigUrl.replace(/^\\.\\//, \"\"); // Strip leading './'\n\t\t}\n\n\t\t// send back the fixed url(...)\n\t\treturn \"url(\" + JSON.stringify(newUrl) + \")\";\n\t});\n\n\t// send back the fixed css\n\treturn fixedCss;\n};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(10), __webpack_require__(0));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"hls.js\", \"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsHls\"] = factory(require(\"hls.js\"), require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsHls\"] = factory(root[\"Hls\"], root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {\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/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _get = function get(object, property, receiver) { 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 { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\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 _hls = __webpack_require__(1);\n\nvar _hls2 = _interopRequireDefault(_hls);\n\nvar _playkitJs = __webpack_require__(2);\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\n/**\n * Adapter of hls.js lib for hls content\n * @classdesc\n */\nvar HlsAdapter = function (_BaseMediaSourceAdapt) {\n _inherits(HlsAdapter, _BaseMediaSourceAdapt);\n\n _createClass(HlsAdapter, null, [{\n key: 'canPlayType',\n\n\n /**\n * Checks if hls adapter can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check.\n * @returns {boolean} - Whether the hls adapter can play a specific mime type.\n * @static\n */\n\n /**\n * The hls player instance.\n * @member {any} _hls\n * @private\n */\n\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n\n /**\n * Reference to the player tracks.\n * @member {Array<Track>} - _playerTracks\n * @type {Array<Track>}\n * @private\n */\n\n /**\n * The adapter logger.\n * @member {any} _logger\n * @static\n * @private\n */\n value: function canPlayType(mimeType) {\n var canHlsPlayType = typeof mimeType === 'string' ? HlsAdapter._hlsMimeTypes.includes(mimeType.toLowerCase()) : false;\n HlsAdapter._logger.debug('canPlayType result for mimeType:' + mimeType + ' is ' + canHlsPlayType.toString());\n return canHlsPlayType;\n }\n\n /**\n * Checks if the hls adapter is supported.\n * @function isSupported\n * @returns {boolean} - Whether hls is supported.\n * @static\n */\n\n /**\n * The supported mime types by the hls adapter.\n * @member {Array<string>} _hlsMimeType\n * @static\n * @private\n */\n\n /**\n * The id of the adapter.\n * @member {string} id\n * @static\n * @private\n */\n\n }, {\n key: 'isSupported',\n value: function isSupported() {\n var isHlsSupported = _hls2.default.isSupported();\n HlsAdapter._logger.debug('isSupported:' + isHlsSupported);\n return isHlsSupported;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which will bind to the hls adapter\n * @param {Object} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n\n }]);\n\n function HlsAdapter(videoElement, source, config) {\n _classCallCheck(this, HlsAdapter);\n\n HlsAdapter._logger.debug('Creating adapter. Hls version: ' + _hls2.default.version);\n\n var _this = _possibleConstructorReturn(this, (HlsAdapter.__proto__ || Object.getPrototypeOf(HlsAdapter)).call(this, videoElement, source, config));\n\n _this._hls = new _hls2.default(_this._config);\n _this._addBindings();\n return _this;\n }\n\n /**\n * Adds the required bindings with hls.js.\n * @function _addBindings\n * @private\n * @returns {void}\n */\n\n\n _createClass(HlsAdapter, [{\n key: '_addBindings',\n value: function _addBindings() {\n this._hls.on(_hls2.default.Events.ERROR, this._onError.bind(this));\n this._hls.on(_hls2.default.Events.LEVEL_SWITCHED, this._onLevelSwitched.bind(this));\n this._hls.on(_hls2.default.Events.AUDIO_TRACK_SWITCHED, this._onAudioTrackSwitched.bind(this));\n }\n\n /**\n * Load the video source\n * @function load\n * @returns {Promise<Object>} - The loaded data\n * @override\n */\n\n }, {\n key: 'load',\n value: function load() {\n var _this2 = this;\n\n if (!this._loadPromise) {\n this._loadPromise = new Promise(function (resolve) {\n _this2._hls.on(_hls2.default.Events.MANIFEST_LOADED, function (event, data) {\n HlsAdapter._logger.debug('The source has been loaded successfully');\n _this2._playerTracks = _this2._parseTracks(data);\n resolve({ tracks: _this2._playerTracks });\n });\n if (_this2._sourceObj && _this2._sourceObj.url) {\n _this2._hls.loadSource(_this2._sourceObj.url);\n _this2._hls.attachMedia(_this2._videoElement);\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroying the hls adapter.\n * @function destroy\n * @override\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n HlsAdapter._logger.debug('destroy');\n _get(HlsAdapter.prototype.__proto__ || Object.getPrototypeOf(HlsAdapter.prototype), 'destroy', this).call(this);\n this._loadPromise = null;\n this._removeBindings();\n this._hls.detachMedia();\n this._hls.destroy();\n }\n\n /**\n * Parse the hls tracks into player tracks.\n * @param {any} data - The event data.\n * @returns {Array<Track>} - The parsed tracks.\n * @private\n */\n\n }, {\n key: '_parseTracks',\n value: function _parseTracks(data) {\n var audioTracks = this._parseAudioTracks(data.audioTracks || []);\n var videoTracks = this._parseVideoTracks(data.levels || []);\n var textTracks = this._parseTextTracks(this._videoElement.textTracks || []);\n return audioTracks.concat(videoTracks).concat(textTracks);\n }\n\n /**\n * Parse hls audio tracks into player audio tracks.\n * @param {Array<Object>} hlsAudioTracks - The hls audio tracks.\n * @returns {Array<AudioTrack>} - The parsed audio tracks.\n * @private\n */\n\n }, {\n key: '_parseAudioTracks',\n value: function _parseAudioTracks(hlsAudioTracks) {\n var audioTracks = [];\n for (var i = 0; i < hlsAudioTracks.length; i++) {\n // Create audio tracks\n var settings = {\n id: hlsAudioTracks[i].id,\n active: this._hls.audioTrack === hlsAudioTracks[i].id,\n label: hlsAudioTracks[i].name,\n language: hlsAudioTracks[i].lang,\n index: i\n };\n audioTracks.push(new _playkitJs.AudioTrack(settings));\n }\n return audioTracks;\n }\n\n /**\n * Parse hls video tracks into player video tracks.\n * @param {Array<Object>} hlsVideoTracks - The hls video tracks.\n * @returns {Array<VideoTrack>} - The parsed video tracks.\n * @private\n */\n\n }, {\n key: '_parseVideoTracks',\n value: function _parseVideoTracks(hlsVideoTracks) {\n var videoTracks = [];\n for (var i = 0; i < hlsVideoTracks.length; i++) {\n // Create video tracks\n var settings = {\n active: this._hls.startLevel === i,\n label: hlsVideoTracks[i].name,\n bandwidth: hlsVideoTracks[i].bitrate,\n language: '',\n index: i\n };\n videoTracks.push(new _playkitJs.VideoTrack(settings));\n }\n return videoTracks;\n }\n\n /**\n * Parse native video tag text tracks into player text tracks.\n * @param {TextTrackList} vidTextTracks - The native video tag text tracks.\n * @returns {Array<TextTrack>} - The parsed text tracks.\n * @private\n */\n\n }, {\n key: '_parseTextTracks',\n value: function _parseTextTracks(vidTextTracks) {\n var textTracks = [];\n for (var i = 0; i < vidTextTracks.length; i++) {\n // Create text tracks\n var settings = {\n active: vidTextTracks[i].mode === 'showing',\n label: vidTextTracks[i].label,\n kind: vidTextTracks[i].kind,\n language: vidTextTracks[i].language,\n index: i\n };\n textTracks.push(new _playkitJs.TextTrack(settings));\n }\n return textTracks;\n }\n\n /**\n * Select an audio track.\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectAudioTrack',\n value: function selectAudioTrack(audioTrack) {\n if (audioTrack instanceof _playkitJs.AudioTrack && !audioTrack.active && this._hls.audioTracks) {\n this._hls.audioTrack = audioTrack.id;\n }\n }\n\n /**\n * Select a video track.\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the track to select.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectVideoTrack',\n value: function selectVideoTrack(videoTrack) {\n if (videoTrack instanceof _playkitJs.VideoTrack && (!videoTrack.active || this._hls.autoLevelEnabled) && this._hls.levels) {\n this._hls.nextLevel = videoTrack.index;\n }\n }\n\n /**\n * Select a text track.\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectTextTrack',\n value: function selectTextTrack(textTrack) {\n if (textTrack instanceof _playkitJs.TextTrack && !textTrack.active && this._videoElement.textTracks) {\n this._disableAllTextTracks();\n this._videoElement.textTracks[textTrack.index].mode = 'showing';\n HlsAdapter._logger.debug('Text track changed', textTrack);\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Enables adaptive bitrate switching according to hls.js logic.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'enableAdaptiveBitrate',\n value: function enableAdaptiveBitrate() {\n this._hls.nextLevel = -1;\n }\n\n /**\n * Triggers on video track selection (auto or manually) the 'videotrackchanged' event forward.\n * @function _onLevelSwitched\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_onLevelSwitched',\n value: function _onLevelSwitched(event, data) {\n var videoTrack = this._playerTracks.find(function (track) {\n return track instanceof _playkitJs.VideoTrack && track.index === data.level;\n });\n HlsAdapter._logger.debug('Video track changed', videoTrack);\n this._onTrackChanged(videoTrack);\n }\n\n /**\n * Triggers on audio track selection (auto or manually) the 'audiotrackchanged' event forward.\n * @function _onAudioTrackSwitched\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_onAudioTrackSwitched',\n value: function _onAudioTrackSwitched(event, data) {\n var audioTrack = this._playerTracks.find(function (track) {\n return track instanceof _playkitJs.AudioTrack && track.id === data.id;\n });\n HlsAdapter._logger.debug('Audio track changed', audioTrack);\n this._onTrackChanged(audioTrack);\n }\n\n /**\n * Disables all the video tag text tracks.\n * @returns {void}\n * @private\n */\n\n }, {\n key: '_disableAllTextTracks',\n value: function _disableAllTextTracks() {\n var vidTextTracks = this._videoElement.textTracks;\n for (var i = 0; i < vidTextTracks.length; i++) {\n vidTextTracks[i].mode = 'hidden';\n }\n }\n\n /**\n * Handles hls errors.\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_onError',\n value: function _onError(event, data) {\n var errorType = data.type;\n var errorDetails = data.details;\n var errorFatal = data.fatal;\n if (errorFatal) {\n switch (errorType) {\n case _hls2.default.ErrorTypes.NETWORK_ERROR:\n HlsAdapter._logger.error(\"fatal network error encountered, try to recover\");\n this._hls.startLoad();\n break;\n case _hls2.default.ErrorTypes.MEDIA_ERROR:\n HlsAdapter._logger.error(\"fatal media error encountered, try to recover\");\n this._hls.recoverMediaError();\n break;\n default:\n HlsAdapter._logger.error(\"fatal error, cannot recover\");\n this.destroy();\n break;\n }\n } else {\n switch (errorDetails) {\n case _hls2.default.ErrorDetails.MANIFEST_LOAD_ERROR:\n case _hls2.default.ErrorDetails.MANIFEST_LOAD_TIMEOUT:\n case _hls2.default.ErrorDetails.MANIFEST_PARSING_ERROR:\n case _hls2.default.ErrorDetails.LEVEL_LOAD_ERROR:\n case _hls2.default.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n case _hls2.default.ErrorDetails.LEVEL_SWITCH_ERROR:\n case _hls2.default.ErrorDetails.FRAG_LOAD_ERROR:\n case _hls2.default.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case _hls2.default.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _hls2.default.ErrorDetails.FRAG_PARSING_ERROR:\n case _hls2.default.ErrorDetails.BUFFER_APPEND_ERROR:\n case _hls2.default.ErrorDetails.BUFFER_APPENDING_ERROR:\n HlsAdapter._logger.error(errorType, errorDetails);\n break;\n default:\n break;\n }\n }\n }\n\n /**\n * Removes hls.js bindings.\n * @returns {void}\n * @private\n */\n\n }, {\n key: '_removeBindings',\n value: function _removeBindings() {\n this._hls.off(_hls2.default.Events.ERROR, this._onError);\n this._hls.off(_hls2.default.Events.LEVEL_SWITCHED, this._onLevelSwitched);\n this._hls.off(_hls2.default.Events.AUDIO_TRACK_SWITCHED, this._onAudioTrackSwitched);\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * In case the adapter preformed a load it will return the manifest url.\n * @public\n * @returns {string} - The src url.\n */\n\n }, {\n key: 'src',\n get: function get() {\n if (this._loadPromise && this._sourceObj) {\n return this._sourceObj.url;\n }\n return \"\";\n }\n }]);\n\n return HlsAdapter;\n}(_playkitJs.BaseMediaSourceAdapter);\n\n// Register hls adapter to the media source adapter provider.\n\n\nHlsAdapter.id = 'HlsAdapter';\nHlsAdapter._logger = _playkitJs.BaseMediaSourceAdapter.getLogger(HlsAdapter.id);\nHlsAdapter._hlsMimeTypes = ['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/x-mpegurl', 'video/x-mpegurl', 'video/mpegurl', 'application/mpegurl'];\nexports.default = HlsAdapter;\nif (HlsAdapter.isSupported()) {\n (0, _playkitJs.registerMediaSourceAdapter)(HlsAdapter);\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n/***/ })\n/******/ ]);\n});\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar 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// 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 } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\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){\n// see https://tools.ietf.org/html/rfc1808\r\n\r\n/* jshint ignore:start */\r\n(function(root) { \r\n/* jshint ignore:end */\r\n\r\n var URL_REGEX = /^((?:[^\\/;?#]+:)?)(\\/\\/[^\\/\\;?#]*)?(.*?)??(;.*?)?(\\?.*?)?(#.*?)?$/;\r\n var FIRST_SEGMENT_REGEX = /^([^\\/;?#]*)(.*)$/;\r\n var SLASH_DOT_REGEX = /(?:\\/|^)\\.(?=\\/)/g;\r\n var SLASH_DOT_DOT_REGEX = /(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/).*?(?=\\/)/g;\r\n\r\n var URLToolkit = { // jshint ignore:line\r\n // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //\r\n // E.g\r\n // With opts.alwaysNormalize = false (default, spec compliant)\r\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g\r\n // With opts.alwaysNormalize = true (default, not spec compliant)\r\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/g\r\n buildAbsoluteURL: function(baseURL, relativeURL, opts) {\r\n opts = opts || {};\r\n // remove any remaining space and CRLF\r\n baseURL = baseURL.trim();\r\n relativeURL = relativeURL.trim();\r\n if (!relativeURL) {\r\n // 2a) If the embedded URL is entirely empty, it inherits the\r\n // entire base URL (i.e., is set equal to the base URL)\r\n // and we are done.\r\n if (!opts.alwaysNormalize) {\r\n return baseURL;\r\n }\r\n var basePartsForNormalise = this.parseURL(baseURL);\r\n if (!baseParts) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n basePartsForNormalise.path = URLToolkit.normalizePath(basePartsForNormalise.path);\r\n return URLToolkit.buildURLFromParts(basePartsForNormalise);\r\n }\r\n var relativeParts = this.parseURL(relativeURL);\r\n if (!relativeParts) {\r\n throw new Error('Error trying to parse relative URL.');\r\n }\r\n if (relativeParts.scheme) {\r\n // 2b) If the embedded URL starts with a scheme name, it is\r\n // interpreted as an absolute URL and we are done.\r\n if (!opts.alwaysNormalize) {\r\n return relativeURL;\r\n }\r\n relativeParts.path = URLToolkit.normalizePath(relativeParts.path);\r\n return URLToolkit.buildURLFromParts(relativeParts);\r\n }\r\n var baseParts = this.parseURL(baseURL);\r\n if (!baseParts) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== '/') {\r\n // If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc\r\n // This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'\r\n var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);\r\n baseParts.netLoc = pathParts[1];\r\n baseParts.path = pathParts[2];\r\n }\r\n if (baseParts.netLoc && !baseParts.path) {\r\n baseParts.path = '/';\r\n }\r\n var builtParts = {\r\n // 2c) Otherwise, the embedded URL inherits the scheme of\r\n // the base URL.\r\n scheme: baseParts.scheme,\r\n netLoc: relativeParts.netLoc,\r\n path: null,\r\n params: relativeParts.params,\r\n query: relativeParts.query,\r\n fragment: relativeParts.fragment\r\n };\r\n if (!relativeParts.netLoc) {\r\n // 3) If the embedded URL's <net_loc> is non-empty, we skip to\r\n // Step 7. Otherwise, the embedded URL inherits the <net_loc>\r\n // (if any) of the base URL.\r\n builtParts.netLoc = baseParts.netLoc;\r\n // 4) If the embedded URL path is preceded by a slash \"/\", the\r\n // path is not relative and we skip to Step 7.\r\n if (relativeParts.path[0] !== '/') {\r\n if (!relativeParts.path) {\r\n // 5) If the embedded URL path is empty (and not preceded by a\r\n // slash), then the embedded URL inherits the base URL path\r\n builtParts.path = baseParts.path;\r\n // 5a) if the embedded URL's <params> is non-empty, we skip to\r\n // step 7; otherwise, it inherits the <params> of the base\r\n // URL (if any) and\r\n if (!relativeParts.params) {\r\n builtParts.params = baseParts.params;\r\n // 5b) if the embedded URL's <query> is non-empty, we skip to\r\n // step 7; otherwise, it inherits the <query> of the base\r\n // URL (if any) and we skip to step 7.\r\n if (!relativeParts.query) {\r\n builtParts.query = baseParts.query;\r\n }\r\n }\r\n } else {\r\n // 6) The last segment of the base URL's path (anything\r\n // following the rightmost slash \"/\", or the entire path if no\r\n // slash is present) is removed and the embedded URL's path is\r\n // appended in its place.\r\n var baseURLPath = baseParts.path;\r\n var newPath = baseURLPath.substring(0, baseURLPath.lastIndexOf('/') + 1) + relativeParts.path;\r\n builtParts.path = URLToolkit.normalizePath(newPath);\r\n }\r\n }\r\n }\r\n if (builtParts.path === null) {\r\n builtParts.path = opts.alwaysNormalize ? URLToolkit.normalizePath(relativeParts.path) : relativeParts.path;\r\n }\r\n return URLToolkit.buildURLFromParts(builtParts);\r\n },\r\n parseURL: function(url) {\r\n var parts = URL_REGEX.exec(url);\r\n if (!parts) {\r\n return null;\r\n }\r\n return {\r\n scheme: parts[1] || '',\r\n netLoc: parts[2] || '',\r\n path: parts[3] || '',\r\n params: parts[4] || '',\r\n query: parts[5] || '',\r\n fragment: parts[6] || ''\r\n };\r\n },\r\n normalizePath: function(path) {\r\n // The following operations are\r\n // then applied, in order, to the new path:\r\n // 6a) All occurrences of \"./\", where \".\" is a complete path\r\n // segment, are removed.\r\n // 6b) If the path ends with \".\" as a complete path segment,\r\n // that \".\" is removed.\r\n path = path.split('').reverse().join('').replace(SLASH_DOT_REGEX, '');\r\n // 6c) All occurrences of \"<segment>/../\", where <segment> is a\r\n // complete path segment not equal to \"..\", are removed.\r\n // Removal of these path segments is performed iteratively,\r\n // removing the leftmost matching pattern on each iteration,\r\n // until no matching pattern remains.\r\n // 6d) If the path ends with \"<segment>/..\", where <segment> is a\r\n // complete path segment not equal to \"..\", that\r\n // \"<segment>/..\" is removed.\r\n while (path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, '')).length) {} // jshint ignore:line\r\n return path.split('').reverse().join('');\r\n },\r\n buildURLFromParts: function(parts) {\r\n return parts.scheme + parts.netLoc + parts.path + parts.params + parts.query + parts.fragment;\r\n }\r\n };\r\n\r\n/* jshint ignore:start */\r\n if(typeof exports === 'object' && typeof module === 'object')\r\n module.exports = URLToolkit;\r\n else if(typeof define === 'function' && define.amd)\r\n define([], function() { return URLToolkit; });\r\n else if(typeof exports === 'object')\r\n exports[\"URLToolkit\"] = URLToolkit;\r\n else\r\n root[\"URLToolkit\"] = URLToolkit;\r\n})(this);\r\n/* jshint ignore:end */\r\n\n},{}],3:[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},{}],4:[function(_dereq_,module,exports){\n/**\n * HLS config\n */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.hlsDefaultConfig = undefined;\n\nvar _abrController = _dereq_(5);\n\nvar _abrController2 = _interopRequireDefault(_abrController);\n\nvar _bufferController = _dereq_(8);\n\nvar _bufferController2 = _interopRequireDefault(_bufferController);\n\nvar _capLevelController = _dereq_(9);\n\nvar _capLevelController2 = _interopRequireDefault(_capLevelController);\n\nvar _fpsController = _dereq_(10);\n\nvar _fpsController2 = _interopRequireDefault(_fpsController);\n\nvar _xhrLoader = _dereq_(58);\n\nvar _xhrLoader2 = _interopRequireDefault(_xhrLoader);\n\nvar _audioTrackController = _dereq_(7);\n\nvar _audioTrackController2 = _interopRequireDefault(_audioTrackController);\n\nvar _audioStreamController = _dereq_(6);\n\nvar _audioStreamController2 = _interopRequireDefault(_audioStreamController);\n\nvar _cues = _dereq_(50);\n\nvar _cues2 = _interopRequireDefault(_cues);\n\nvar _timelineController = _dereq_(16);\n\nvar _timelineController2 = _interopRequireDefault(_timelineController);\n\nvar _subtitleTrackController = _dereq_(15);\n\nvar _subtitleTrackController2 = _interopRequireDefault(_subtitleTrackController);\n\nvar _subtitleStreamController = _dereq_(14);\n\nvar _subtitleStreamController2 = _interopRequireDefault(_subtitleStreamController);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//#endif\n\n//#endif\n\n//#if subtitle\n\n//import FetchLoader from './utils/fetch-loader';\n//#if altaudio\nvar hlsDefaultConfig = exports.hlsDefaultConfig = {\n autoStartLoad: true, // used by stream-controller\n startPosition: -1, // used by stream-controller\n defaultAudioCodec: undefined, // used by stream-controller\n debug: false, // used by logger\n capLevelOnFPSDrop: false, // used by fps-controller\n capLevelToPlayerSize: false, // used by cap-level-controller\n initialLiveManifestSize: 1, // used by stream-controller\n maxBufferLength: 30, // used by stream-controller\n maxBufferSize: 60 * 1000 * 1000, // used by stream-controller\n maxBufferHole: 0.5, // used by stream-controller\n maxSeekHole: 2, // used by stream-controller\n lowBufferWatchdogPeriod: 0.5, // used by stream-controller\n highBufferWatchdogPeriod: 3, // used by stream-controller\n nudgeOffset: 0.1, // used by stream-controller\n nudgeMaxRetry: 3, // used by stream-controller\n maxFragLookUpTolerance: 0.25, // used by stream-controller\n liveSyncDurationCount: 3, // used by stream-controller\n liveMaxLatencyDurationCount: Infinity, // used by stream-controller\n liveSyncDuration: undefined, // used by stream-controller\n liveMaxLatencyDuration: undefined, // used by stream-controller\n maxMaxBufferLength: 600, // used by stream-controller\n enableWorker: true, // used by demuxer\n enableSoftwareAES: true, // used by decrypter\n manifestLoadingTimeOut: 10000, // used by playlist-loader\n manifestLoadingMaxRetry: 1, // used by playlist-loader\n manifestLoadingRetryDelay: 1000, // used by playlist-loader\n manifestLoadingMaxRetryTimeout: 64000, // used by playlist-loader\n startLevel: undefined, // used by level-controller\n levelLoadingTimeOut: 10000, // used by playlist-loader\n levelLoadingMaxRetry: 4, // used by playlist-loader\n levelLoadingRetryDelay: 1000, // used by playlist-loader\n levelLoadingMaxRetryTimeout: 64000, // used by playlist-loader\n fragLoadingTimeOut: 20000, // used by fragment-loader\n fragLoadingMaxRetry: 6, // used by fragment-loader\n fragLoadingRetryDelay: 1000, // used by fragment-loader\n fragLoadingMaxRetryTimeout: 64000, // used by fragment-loader\n fragLoadingLoopThreshold: 3, // used by stream-controller\n startFragPrefetch: false, // used by stream-controller\n fpsDroppedMonitoringPeriod: 5000, // used by fps-controller\n fpsDroppedMonitoringThreshold: 0.2, // used by fps-controller\n appendErrorMaxRetry: 3, // used by buffer-controller\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 //#if altaudio\n audioStreamController: _audioStreamController2.default,\n audioTrackController: _audioTrackController2.default,\n //#endif\n //#if subtitle\n subtitleStreamController: _subtitleStreamController2.default,\n subtitleTrackController: _subtitleTrackController2.default,\n timelineController: _timelineController2.default,\n cueHandler: _cues2.default,\n enableCEA708Captions: true, // used by timeline-controller\n enableWebVTT: true, // used by timeline-controller\n captionsTextTrack1Label: 'English', // used by timeline-controller\n captionsTextTrack1LanguageCode: 'en', // used by timeline-controller\n captionsTextTrack2Label: 'Spanish', // used by timeline-controller\n captionsTextTrack2LanguageCode: 'es', // used by timeline-controller\n //#endif\n stretchShortVideoTrack: false, // used by mp4-remuxer\n forceKeyFrameOnDiscontinuity: true, // used by ts-demuxer\n abrEwmaFastLive: 3, // used by abr-controller\n abrEwmaSlowLive: 9, // used by abr-controller\n abrEwmaFastVoD: 3, // used by abr-controller\n abrEwmaSlowVoD: 9, // used by abr-controller\n abrEwmaDefaultEstimate: 5e5, // 500 kbps // used by abr-controller\n abrBandWidthFactor: 0.95, // used by abr-controller\n abrBandWidthUpFactor: 0.7, // used by abr-controller\n abrMaxWithRealBitrate: false, // used by abr-controller\n maxStarvationDelay: 4, // used by abr-controller\n maxLoadingDelay: 4, // used by abr-controller\n minAutoBitrate: 0 // used by hls\n};\n\n},{\"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){\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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _bufferHelper = _dereq_(37);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _errors = _dereq_(33);\n\nvar _logger = _dereq_(53);\n\nvar _ewmaBandwidthEstimator = _dereq_(51);\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, (AbrController.__proto__ || 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._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 minAutoLevel = hls.minAutoLevel;\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 level = levels[frag.level],\n levelBitrate = level.realBitrate ? Math.max(level.realBitrate, level.bitrate) : level.bitrate,\n expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levelBitrate / 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 > minAutoLevel; 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 var levelNextBitrate = levels[nextLoadLevel].realBitrate ? Math.max(levels[nextLoadLevel].realBitrate, levels[nextLoadLevel].bitrate) : levels[nextLoadLevel].bitrate;\n fragLevelNextLoadedDelay = frag.duration * levelNextBitrate / (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 _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' && !isNaN(frag.sn)) {\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\n // compute level average bitrate\n if (this.hls.config.abrMaxWithRealBitrate) {\n var level = this.hls.levels[frag.level];\n var loadedBytes = (level.loaded ? level.loaded.bytes : 0) + data.stats.loaded;\n var loadedDuration = (level.loaded ? level.loaded.duration : 0) + data.frag.duration;\n level.loaded = { bytes: loadedBytes, duration: loadedDuration };\n level.realBitrate = Math.round(8 * loadedBytes / loadedDuration);\n }\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' && !isNaN(frag.sn) && (!frag.bitrateTest || stats.tload === stats.tbuffered)) {\n // use tparsed-trequest instead of tbuffered-trequest to compute fragLoadingProcessing; rationale is that buffer appending only happens once media is attached\n // 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\n // as a consequence it could happen really late in the process. meaning that appending duration might appears huge ... leading to underestimated throughput estimation\n var fragLoadingProcessingMs = stats.tparsed - 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 stats.bwEstimate = this._bwEstimator.getEstimate();\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 next auto level\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 live = levelDetails ? levelDetails.live : false,\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].realBitrate ? Math.max(levels[i].realBitrate, levels[i].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 live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches\n // 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 ...\n // special case to support startLevel = -1 (bitrateTest) on live streams : in that case we should not exit loop so that _findBestLevel will return -1\n !fetchDuration || live && !this.bitrateTestDelay || fetchDuration < maxFetchDuration)) {\n // as we are looping from highest to lowest, this will return the best achievable quality level\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: 'nextAutoLevel',\n get: function get() {\n var forcedAutoLevel = this._nextAutoLevel;\n var bwEstimator = this._bwEstimator;\n // in case next auto level has been forced, and bw not available or not reliable, return forced value\n if (forcedAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {\n return forcedAutoLevel;\n }\n // compute next level using ABR logic\n var nextABRAutoLevel = this._nextABRAutoLevel;\n // if forced auto level has been defined, use it to cap ABR computed quality level\n if (forcedAutoLevel !== -1) {\n nextABRAutoLevel = Math.min(forcedAutoLevel, nextABRAutoLevel);\n }\n return nextABRAutoLevel;\n },\n set: function set(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n }, {\n key: '_nextABRAutoLevel',\n get: function get() {\n var hls = this.hls,\n maxAutoLevel = hls.maxAutoLevel,\n levels = hls.levels,\n config = hls.config,\n minAutoLevel = hls.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 = currentFragDuration ? Math.min(currentFragDuration, config.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 // cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration\n var maxLoadingDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxLoadingDelay) : config.maxLoadingDelay;\n maxStarvationDelay = 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},{\"33\":33,\"34\":34,\"35\":35,\"37\":37,\"51\":51,\"53\":53}],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 _binarySearch = _dereq_(48);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(37);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(25);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(38);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(54);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(33);\n\nvar _logger = _dereq_(53);\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 BUFFER_FLUSHING: 'BUFFER_FLUSHING',\n ENDED: 'ENDED',\n ERROR: 'ERROR',\n WAITING_INIT_PTS: 'WAITING_INIT_PTS'\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, (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));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this._state = State.STOPPED;\n _this.ontick = _this.tick.bind(_this);\n _this.initPTS = [];\n _this.waitingFragment = null;\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 //Signal that video PTS was found\n\n }, {\n key: 'onInitPtsFound',\n value: function onInitPtsFound(data) {\n var demuxerId = data.id,\n cc = data.frag.cc,\n initPTS = data.initPTS;\n if (demuxerId === 'main') {\n //Always update the new INIT PTS\n //Can change due level switch\n this.initPTS[cc] = initPTS;\n _logger.logger.log('InitPTS for cc:' + cc + ' found from video track:' + initPTS);\n\n //If we are waiting we need to demux/remux the waiting frag\n //With the new initPTS\n if (this.state === State.WAITING_INIT_PTS) {\n _logger.logger.log('sending pending audio frag to demuxer');\n this.state = State.FRAG_LOADING;\n //We have audio frag waiting or video pts\n //Let process it\n this.onFragLoaded(this.waitingFragment);\n //Lets clean the waiting frag\n this.waitingFragment = null;\n }\n }\n }\n }, {\n key: 'startLoad',\n value: function startLoad(startPosition) {\n if (this.tracks) {\n var lastCurrentTime = this.lastCurrentTime;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.fragLoadError = 0;\n if (lastCurrentTime > 0 && startPosition === -1) {\n _logger.logger.log('audio:override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));\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 case State.BUFFER_FLUSHING:\n break;\n case State.STARTING:\n this.state = State.WAITING_TRACK;\n this.loadedmetadata = false;\n break;\n case State.IDLE:\n var tracks = this.tracks;\n // audio tracks not received => exit loop\n if (!tracks) {\n break;\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 (!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 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 audioSwitch = this.audioSwitch,\n trackId = this.trackId;\n\n // if buffer length is less than maxBufLen try to load a new fragment\n if ((bufferLen < maxBufLen || audioSwitch) && trackId < tracks.length) {\n trackDetails = tracks[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 (!audioSwitch && !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 // When switching audio track, reload audio as close as possible to currentTime\n if (audioSwitch) {\n if (trackDetails.live && !trackDetails.PTSKnown) {\n _logger.logger.log('switching audiotrack, live stream, unknown PTS,load first fragment');\n bufferEnd = 0;\n } else {\n bufferEnd = pos;\n // if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime\n if (trackDetails.PTSKnown && pos < start) {\n // if everything is buffered from pos to start or if audio buffer upfront, let's seek to start\n if (bufferInfo.end > start || bufferInfo.nextStart) {\n _logger.logger.log('alt audio track ahead of main track, seek to start of alt audio track');\n this.media.currentTime = start + 0.05;\n } else {\n return;\n }\n }\n }\n }\n if (trackDetails.initSegment && !trackDetails.initSegment.data) {\n frag = trackDetails.initSegment;\n }\n // if bufferEnd before start of playlist, load first fragment\n else if (bufferEnd <= start) {\n frag = fragments[0];\n if (trackDetails.live && frag.loadIdx && frag.loadIdx === this.fragLoadIdx) {\n // we just loaded this first fragment, and we are still lagging behind the start of the live playlist\n // let's force seek to start\n var nextBuffered = bufferInfo.nextStart ? bufferInfo.nextStart : start;\n _logger.logger.log('no alt audio available @currentTime:' + this.media.currentTime + ', seeking @' + (nextBuffered + 0.05));\n this.media.currentTime = nextBuffered + 0.05;\n return;\n }\n } else {\n var foundFrag = void 0;\n var maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n var fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;\n var fragmentWithinToleranceTest = function fragmentWithinToleranceTest(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 // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments\n var candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);\n if (candidate.start + candidate.duration - candidateLookupTolerance <= bufferEnd) {\n return 1;\n } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n };\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n // Prefer the next fragment if it's within tolerance\n if (fragNext && !fragmentWithinToleranceTest(fragNext)) {\n foundFrag = fragNext;\n } else {\n foundFrag = _binarySearch2.default.search(fragments, fragmentWithinToleranceTest);\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 if (frag) {\n //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n if (frag.decryptdata && frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n _logger.logger.log('Loading key for ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + 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 ' + 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 if (!isNaN(frag.sn)) {\n this.nextLoadPosition = frag.start + frag.duration;\n }\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.WAITING_INIT_PTS:\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 = this.mediaBuffer = 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: 'onAudioTrackSwitching',\n value: function onAudioTrackSwitching(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 this.waitingFragment = null;\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\n //should we switch tracks ?\n if (altAudio) {\n this.audioSwitch = true;\n //main audio track are handled by stream-controller, just do something if switching to alt audio track\n this.state = State.IDLE;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n }\n this.tick();\n }\n }, {\n key: 'onAudioTrackLoaded',\n value: function onAudioTrackLoaded(data) {\n var newDetails = data.details,\n trackId = data.id,\n track = this.tracks[trackId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n _logger.logger.log('track ' + trackId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);\n\n if (newDetails.live) {\n var curDetails = track.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 // TODO\n //this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n _logger.logger.log('live audio playlist sliding:' + sliding.toFixed(3));\n } else {\n _logger.logger.log('live audio playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n _logger.logger.log('live audio playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n track.details = newDetails;\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 = newDetails.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 fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING && fragCurrent && fragLoaded.type === 'audio' && fragLoaded.level === fragCurrent.level && fragLoaded.sn === fragCurrent.sn) {\n var track = this.tracks[this.trackId],\n details = track.details,\n duration = details.totalduration,\n trackId = fragCurrent.level,\n sn = fragCurrent.sn,\n cc = fragCurrent.cc,\n audioCodec = this.config.defaultAudioCodec || track.audioCodec || 'mp4a.40.2',\n stats = this.stats = data.stats;\n if (sn === 'initSegment') {\n this.state = State.IDLE;\n\n stats.tparsed = stats.tbuffered = performance.now();\n details.initSegment.data = data.payload;\n this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'audio' });\n this.tick();\n } else {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.appended = false;\n if (!this.demuxer) {\n this.demuxer = new _demuxer2.default(this.hls, 'audio');\n }\n //Check if we have video initPTS\n // If not we need to wait for it\n var initPTS = this.initPTS[cc];\n var initSegmentData = details.initSegment ? details.initSegment.data : [];\n if (details.initSegment || initPTS !== undefined) {\n this.pendingBuffering = true;\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 = false; //details.PTSKnown || !details.live;\n this.demuxer.push(data.payload, initSegmentData, audioCodec, null, fragCurrent, duration, accurateTimeOffset, initPTS);\n } else {\n _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);\n this.waitingFragment = data;\n this.state = State.WAITING_INIT_PTS;\n }\n }\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n var fragNew = data.frag;\n if (fragCurrent && data.id === 'audio' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === State.PARSING) {\n var tracks = data.tracks,\n track = void 0;\n\n // delete any video track found on audio demuxer\n if (tracks.video) {\n delete tracks.video;\n }\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 var appendObj = { type: 'audio', data: initSegment, parent: 'audio', content: 'initSegment' };\n if (this.audioSwitch) {\n this.pendingData = [appendObj];\n } else {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n }\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 var fragNew = data.frag;\n if (fragCurrent && data.id === 'audio' && data.type === 'audio' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === State.PARSING) {\n var trackId = this.trackId,\n track = this.tracks[trackId],\n hls = this.hls;\n\n if (isNaN(data.endPTS)) {\n data.endPTS = data.startPTS + fragCurrent.duration;\n data.endDTS = data.startDTS + fragCurrent.duration;\n }\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, fragCurrent, data.startPTS, data.endPTS);\n\n var audioSwitch = this.audioSwitch,\n media = this.media,\n appendOnBufferFlush = false;\n //Only flush audio from old audio tracks when PTS is known on new audio track\n if (audioSwitch && media) {\n if (media.readyState) {\n var currentTime = media.currentTime;\n _logger.logger.log('switching audio track : currentTime:' + currentTime);\n if (currentTime >= data.startPTS) {\n _logger.logger.log('switching audio track : flushing all audio');\n this.state = State.BUFFER_FLUSHING;\n hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n appendOnBufferFlush = true;\n //Lets announce that the initial audio track switch flush occur\n this.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n }\n } else {\n //Lets announce that the initial audio track switch flush occur\n this.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n }\n }\n\n var pendingData = this.pendingData;\n if (!this.audioSwitch) {\n [data.data1, data.data2].forEach(function (buffer) {\n if (buffer && buffer.length) {\n pendingData.push({ type: data.type, data: buffer, parent: 'audio', content: 'data' });\n }\n });\n if (!appendOnBufferFlush && pendingData.length) {\n pendingData.forEach(function (appendObj) {\n // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)\n // in that case it is useless to append following segments\n if (_this2.state === State.PARSING) {\n // arm pending Buffering flag before appending a segment\n _this2.pendingBuffering = true;\n _this2.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n }\n });\n this.pendingData = [];\n this.appended = true;\n }\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 var fragNew = data.frag;\n if (fragCurrent && data.id === 'audio' && fragNew.sn === fragCurrent.sn && fragNew.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 var state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = data.pending > 0;\n this._checkAppendedParsed();\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n var frag = this.fragCurrent,\n stats = this.stats,\n hls = this.hls;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = performance.now();\n 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 if (this.audioSwitch && this.appended) {\n this.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: this.trackId });\n }\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 // switch error to fatal\n data.fatal = true;\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 case _errors.ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (data.parent === 'audio' && (this.state === State.PARSING || this.state === State.PARSED)) {\n var media = this.mediaBuffer,\n currentTime = this.media.currentTime,\n mediaBuffered = media && _bufferHelper2.default.isBuffered(media, currentTime) && _bufferHelper2.default.isBuffered(media, currentTime + 0.5);\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n var _config = this.config;\n if (_config.maxMaxBufferLength >= _config.maxBufferLength) {\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('audio:reduce max buffer length to ' + _config.maxMaxBufferLength + 's');\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * _config.fragLoadingLoopThreshold;\n }\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/video-dev/hls.js/pull/708\n // in that case flush the whole audio buffer to recover\n _logger.logger.warn('buffer full error also media.currentTime is not buffered, flush audio buffer');\n this.fragCurrent = null;\n // flush everything\n this.state = State.BUFFER_FLUSHING;\n this.hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n }\n }\n break;\n default:\n break;\n }\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n var _this3 = this;\n\n var pendingData = this.pendingData;\n if (pendingData && pendingData.length) {\n _logger.logger.log('appending pending audio data on Buffer Flushed');\n pendingData.forEach(function (appendObj) {\n _this3.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n });\n this.appended = true;\n this.pendingData = [];\n this.state = State.PARSED;\n } else {\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 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('audio stream:' + previousState + '->' + nextState);\n }\n },\n get: function get() {\n return this._state;\n }\n }]);\n\n return AudioStreamController;\n}(_eventHandler2.default);\n\nexports.default = AudioStreamController;\n\n},{\"25\":25,\"33\":33,\"34\":34,\"35\":35,\"37\":37,\"38\":38,\"48\":48,\"53\":53,\"54\":54}],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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(53);\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 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));\n\n _this.ticks = 0;\n _this.ontick = _this.tick.bind(_this);\n return _this;\n }\n\n _createClass(AudioTrackController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\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 this.updateTrack(this.trackId);\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 hls = this.hls,\n type = audioTrack.type,\n url = audioTrack.url,\n eventObj = { id: newId, type: type, url: url };\n // keep AUDIO_TRACK_SWITCH for legacy reason\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCH, eventObj);\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHING, eventObj);\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 hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });\n }\n }\n }\n }, {\n key: 'updateTrack',\n value: function updateTrack(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('updating audioTrack ' + newId);\n var audioTrack = this.tracks[newId],\n url = audioTrack.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},{\"34\":34,\"35\":35,\"53\":53}],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\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(53);\n\nvar _errors = _dereq_(33);\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 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));\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 _this.tracks = {};\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: 'onLevelPtsUpdated',\n value: function onLevelPtsUpdated(data) {\n var type = data.type;\n var audioTrack = this.tracks.audio;\n\n // Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)\n // in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`\n // 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\n // `SourceBuffer.abort()` and adjusting `SourceBuffer.timestampOffset` if `SourceBuffer.updating` is false or awaiting `updateend`\n // event if SB is in updating state.\n // More info here: https://github.com/video-dev/hls.js/issues/332#issuecomment-257986486\n\n if (type === 'audio' && audioTrack && audioTrack.container === 'audio/mpeg') {\n // Chrome audio mp3 track\n var audioBuffer = this.sourceBuffer.audio;\n var delta = Math.abs(audioBuffer.timestampOffset - data.start);\n\n // adjust timestamp offset if time delta is greater than 100ms\n if (delta > 0.1) {\n var updating = audioBuffer.updating;\n\n try {\n audioBuffer.abort();\n } catch (err) {\n updating = true;\n _logger.logger.warn('can not abort audio buffer: ' + err);\n }\n\n if (!updating) {\n _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + data.start);\n audioBuffer.timestampOffset = data.start;\n } else {\n this.audioTimestampOffset = data.start;\n }\n }\n }\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 URL.revokeObjectURL(this.media.src);\n this.media.removeAttribute('src');\n this.media.load();\n }\n\n this.mediaSource = null;\n this.media = null;\n this.pendingTracks = {};\n this.tracks = {};\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 // update timestampOffset\n if (this.audioTimestampOffset) {\n var audioBuffer = this.sourceBuffer.audio;\n _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + this.audioTimestampOffset);\n audioBuffer.timestampOffset = this.audioTimestampOffset;\n delete this.audioTimestampOffset;\n }\n\n if (this._needsFlush) {\n this.doFlush();\n }\n\n if (this._needsEos) {\n this.checkEos();\n }\n this.appending = false;\n var parent = this.parent;\n // count nb of pending segments waiting for appending on this sourcebuffer\n var pending = this.segments.reduce(function (counter, segment) {\n return segment.parent === parent ? counter + 1 : counter;\n }, 0);\n this.hls.trigger(_events2.default.BUFFER_APPENDED, { parent: parent, pending: pending });\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 this.tracks[trackName] = { codec: codec, container: track.container };\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 });\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 var sbobj = sb[type];\n if (!sbobj.ended) {\n return;\n }\n if (sbobj.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 try {\n mediaSource.endOfStream();\n } catch (e) {\n _logger.logger.warn('exception while calling mediaSource.endOfStream()');\n }\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/video-dev/hls.js/issues/355\n\n }, {\n key: 'updateMediaElementDuration',\n value: function updateMediaElementDuration() {\n var media = this.media,\n mediaSource = this.mediaSource,\n sourceBuffer = this.sourceBuffer,\n levelDuration = this._levelDuration;\n if (levelDuration === null || !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 var duration = media.duration;\n // 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\n if (levelDuration > this._msDuration && levelDuration > duration || duration === Infinity || isNaN(duration)) {\n _logger.logger.log('Updating mediasource duration to ' + levelDuration.toFixed(3));\n this._msDuration = mediaSource.duration = 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 try {\n for (var type in sourceBuffer) {\n appended += sourceBuffer[type].buffered.length;\n }\n } catch (error) {\n // error could be thrown while accessing buffered, in case sourcebuffer has already been removed from MediaSource\n // this is harmess at this stage, catch this to avoid reporting an internal exception\n _logger.logger.error('error while accessing sourceBuffer.buffered');\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 sb = sourceBuffer[type];\n if (sb) {\n if (!sb.updating) {\n // reset sourceBuffer ended flag before appending segment\n sb.ended = false;\n //logger.log(`appending ${segment.content} ${type} SB, size:${segment.data.length}, ${segment.parent}`);\n this.parent = segment.parent;\n sb.appendBuffer(segment.data);\n this.appendError = 0;\n this.appended++;\n this.appending = true;\n } else {\n segments.unshift(segment);\n }\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, parent: segment.parent };\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 /* 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 event.fatal = false;\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.toFixed(3) + '/' + 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 try {\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 } catch (e) {\n _logger.logger.warn('exception while accessing sourcebuffer, it might have been removed from MediaSource');\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},{\"33\":33,\"34\":34,\"35\":35,\"53\":53}],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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\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, (CapLevelController.__proto__ || 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 var hls = this.hls;\n if (hls.config.capLevelToPlayerSize) {\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n this.levels = data.levels;\n 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 var hls = this.hls;\n hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);\n if (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 hls.streamController.nextLevelSwitch();\n }\n this.autoLevelCapping = 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 var media = this.media;\n if (media) {\n width = media.width || media.clientWidth || 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 var media = this.media;\n if (media) {\n height = media.height || media.clientHeight || 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},{\"34\":34,\"35\":35}],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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(53);\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, (FPSController.__proto__ || 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 var config = this.hls.config;\n if (config.capLevelOnFPSDrop) {\n var video = this.video = data.media instanceof HTMLVideoElement ? data.media : null;\n if (typeof video.getVideoPlaybackQuality === 'function') {\n this.isVideoPlaybackQualityAvailable = true;\n }\n clearInterval(this.timer);\n this.timer = setInterval(this.checkFPSInterval.bind(this), 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 hls = this.hls;\n 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 > hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {\n var currentLevel = hls.currentLevel;\n _logger.logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);\n if (currentLevel > 0 && (hls.autoLevelCapping === -1 || hls.autoLevelCapping >= currentLevel)) {\n currentLevel = currentLevel - 1;\n hls.trigger(_events2.default.FPS_DROP_LEVEL_CAPPING, { level: currentLevel, droppedLevel: hls.currentLevel });\n hls.autoLevelCapping = currentLevel;\n 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 var video = this.video;\n if (video) {\n if (this.isVideoPlaybackQualityAvailable) {\n var videoPlaybackQuality = video.getVideoPlaybackQuality();\n this.checkFPS(video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);\n } else {\n this.checkFPS(video, video.webkitDecodedFrameCount, video.webkitDroppedFrameCount);\n }\n }\n }\n }]);\n\n return FPSController;\n}(_eventHandler2.default);\n\nexports.default = FPSController;\n\n},{\"34\":34,\"35\":35,\"53\":53}],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 _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\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 * id3 metadata track controller\n */\n\nvar ID3TrackController = function (_EventHandler) {\n _inherits(ID3TrackController, _EventHandler);\n\n function ID3TrackController(hls) {\n _classCallCheck(this, ID3TrackController);\n\n 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));\n\n _this.id3Track = undefined;\n _this.media = undefined;\n return _this;\n }\n\n _createClass(ID3TrackController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n\n // Add ID3 metatadata text track.\n\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n this.media = data.media;\n if (!this.media) {\n return;\n }\n\n this.id3Track = this.media.addTextTrack('metadata', 'id3');\n this.id3Track.mode = 'hidden';\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n this.media = undefined;\n }\n }, {\n key: 'onFragParsingMetadata',\n value: function onFragParsingMetadata(data) {\n var fragment = data.frag;\n var samples = data.samples;\n var startTime = fragment.start;\n var endTime = fragment.start + fragment.duration;\n // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE\n if (startTime === endTime) {\n endTime += 0.0001;\n }\n\n // Attempt to recreate Safari functionality by creating\n // WebKitDataCue objects when available and store the decoded\n // ID3 data in the value property of the cue\n var Cue = window.WebKitDataCue || window.VTTCue || window.TextTrackCue;\n\n for (var i = 0; i < samples.length; i++) {\n var id3Frame = this.parseID3Frame(samples[i].data);\n var frame = this.decodeID3Frame(id3Frame);\n if (frame) {\n var cue = new Cue(startTime, endTime, '');\n cue.value = frame;\n this.id3Track.addCue(cue);\n }\n }\n }\n }, {\n key: 'parseID3Frame',\n value: function parseID3Frame(data) {\n if (data.length < 21) {\n return undefined;\n }\n\n /* http://id3.org/id3v2.3.0\n [0] = 'I'\n [1] = 'D'\n [2] = '3'\n [3,4] = {Version}\n [5] = {Flags}\n [6-9] = {ID3 Size}\n [10-13] = {Frame ID}\n [14-17] = {Frame Size}\n [18,19] = {Frame Flags}\n */\n if (data[0] === 73 && // I\n data[1] === 68 && // D\n data[2] === 51) {\n // 3\n\n var type = String.fromCharCode(data[10], data[11], data[12], data[13]);\n data = data.subarray(20);\n return { type: type, data: data };\n }\n }\n }, {\n key: 'decodeID3Frame',\n value: function decodeID3Frame(frame) {\n if (frame.type === 'TXXX') {\n return this.decodeTxxxFrame(frame);\n } else if (frame.type === 'PRIV') {\n return this.decodePrivFrame(frame);\n } else if (frame.type[0] === 'T') {\n return this.decodeTextFrame(frame);\n } else {\n return undefined;\n }\n }\n }, {\n key: 'decodeTxxxFrame',\n value: function decodeTxxxFrame(frame) {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Description}\\0{Value}\n */\n\n if (frame.size < 2) {\n return undefined;\n }\n\n if (frame.data[0] !== 3) {\n //only support UTF-8\n return undefined;\n }\n\n var index = 1;\n var description = this.utf8ArrayToStr(frame.data.subarray(index));\n\n index += description.length + 1;\n var value = this.utf8ArrayToStr(frame.data.subarray(index));\n\n return { key: 'TXXX', description: description, data: value };\n }\n }, {\n key: 'decodeTextFrame',\n value: function decodeTextFrame(frame) {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Value}\n */\n\n if (frame.size < 2) {\n return undefined;\n }\n\n if (frame.data[0] !== 3) {\n //only support UTF-8\n return undefined;\n }\n\n var data = frame.data.subarray(1);\n return { key: frame.type, data: this.utf8ArrayToStr(data) };\n }\n }, {\n key: 'decodePrivFrame',\n value: function decodePrivFrame(frame) {\n /*\n Format: <text string>\\0<binary data>\n */\n\n if (frame.size < 2) {\n return undefined;\n }\n\n var owner = this.utf8ArrayToStr(frame.data);\n var privateData = frame.data.subarray(owner.length + 1);\n\n return { key: 'PRIV', info: owner, data: privateData.buffer };\n }\n\n // http://stackoverflow.com/questions/8936984/uint8array-to-string-in-javascript/22373197\n // http://www.onicos.com/staff/iz/amuse/javascript/expert/utf.txt\n /* utf.js - UTF-8 <=> UTF-16 convertion\n *\n * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>\n * Version: 1.0\n * LastModified: Dec 25 1999\n * This library is free. You can redistribute it and/or modify it.\n */\n\n }, {\n key: 'utf8ArrayToStr',\n value: function utf8ArrayToStr(array) {\n\n var char2 = void 0;\n var char3 = void 0;\n var out = '';\n var i = 0;\n var length = array.length;\n\n while (i < length) {\n var c = array[i++];\n switch (c >> 4) {\n case 0:\n return out;\n case 1:case 2:case 3:case 4:case 5:case 6:case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12:case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode((c & 0x1F) << 6 | char2 & 0x3F);\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode((c & 0x0F) << 12 | (char2 & 0x3F) << 6 | (char3 & 0x3F) << 0);\n break;\n }\n }\n\n return out;\n }\n }]);\n\n return ID3TrackController;\n}(_eventHandler2.default);\n\nexports.default = ID3TrackController;\n\n},{\"34\":34,\"35\":35}],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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(53);\n\nvar _errors = _dereq_(33);\n\nvar _bufferHelper = _dereq_(37);\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, (LevelController.__proto__ || Object.getPrototypeOf(LevelController)).call(this, hls, _events2.default.MANIFEST_LOADED, _events2.default.LEVEL_LOADED, _events2.default.FRAG_LOADED, _events2.default.ERROR));\n\n _this.ontick = _this.tick.bind(_this);\n _this._manualLevel = -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 var levels = this._levels;\n // clean up live level details to force reload them, and reset load errors\n if (levels) {\n levels.forEach(function (level) {\n level.loadError = 0;\n var levelDetails = level.details;\n if (levelDetails && levelDetails.live) {\n level.details = undefined;\n }\n });\n }\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 bitrateSet = {},\n videoCodecFound = false,\n audioCodecFound = false,\n hls = this.hls,\n brokenmp4inmp3 = /chrome|firefox/.test(navigator.userAgent.toLowerCase()),\n checkSupported = function checkSupported(type, codec) {\n return MediaSource.isTypeSupported(type + '/mp4;codecs=' + codec);\n };\n\n // regroup redundant level together\n data.levels.forEach(function (level) {\n if (level.videoCodec) {\n videoCodecFound = true;\n }\n // erase audio codec info if browser does not support mp4a.40.34. demuxer will autodetect codec and fallback to mpeg/audio\n if (brokenmp4inmp3 && level.audioCodec && level.audioCodec.indexOf('mp4a.40.34') !== -1) {\n level.audioCodec = undefined;\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 // only keep level with supported audio/video codecs\n levels = levels.filter(function (level) {\n var audioCodec = level.audioCodec,\n videoCodec = level.videoCodec;\n return (!audioCodec || checkSupported('audio', audioCodec)) && (!videoCodec || checkSupported('video', 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 (var 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: 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 var hls = this.hls;\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 var levelProperties = levels[newLevel];\n levelProperties.level = newLevel;\n // LEVEL_SWITCH to be deprecated in next major release\n hls.trigger(_events2.default.LEVEL_SWITCH, levelProperties);\n hls.trigger(_events2.default.LEVEL_SWITCHING, levelProperties);\n }\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 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 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 case _errors.ErrorDetails.REMUX_ALLOC_ERROR:\n levelId = data.level;\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.loadError) {\n level.loadError = 1;\n } else {\n level.loadError++;\n }\n // if any redundant streams available and if we haven't try them all (level.loadError is reseted on successful frag/level load.\n // if level.loadError reaches nbRedundantLevel it means that we tried them all, no hope => let's switch down\n var nbRedundantLevel = level.url.length;\n if (nbRedundantLevel > 1 && level.loadError < nbRedundantLevel) {\n level.urlId = (level.urlId + 1) % nbRedundantLevel;\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 + ': switch-down for next fragment');\n hls.nextAutoLevel = Math.max(0, levelId - 1);\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 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 // boolean used to inform stream controller not to switch back to IDLE on non fatal error\n data.levelRetry = true;\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 // switch error to fatal\n data.fatal = true;\n }\n }\n }\n }\n }\n\n // reset level load error counter on successful frag loaded\n\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragLoaded = data.frag;\n if (fragLoaded && fragLoaded.type === 'main') {\n var level = this._levels[fragLoaded.level];\n if (level) {\n level.loadError = 0;\n }\n }\n }\n }, {\n key: 'onLevelLoaded',\n value: function onLevelLoaded(data) {\n var levelId = data.level;\n // only process level loaded events matching with expected level\n if (levelId === this._level) {\n var curLevel = this._levels[levelId];\n // reset level load error counter on successful level loaded\n curLevel.loadError = 0;\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 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 if (level && level.url) {\n var urlId = level.urlId;\n this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: levelId, id: urlId });\n }\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.nextAutoLevel;\n }\n },\n set: function set(nextLevel) {\n this.level = nextLevel;\n if (this._manualLevel === -1) {\n this.hls.nextAutoLevel = nextLevel;\n }\n }\n }]);\n\n return LevelController;\n}(_eventHandler2.default);\n\nexports.default = LevelController;\n\n},{\"33\":33,\"34\":34,\"35\":35,\"37\":37,\"53\":53}],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\nvar _binarySearch = _dereq_(48);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(37);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(25);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(38);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(54);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(33);\n\nvar _logger = _dereq_(53);\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 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 BUFFER_FLUSHING: 'BUFFER_FLUSHING',\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, (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));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this._state = State.STOPPED;\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 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 (!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 // if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime\n if (lastCurrentTime > 0 && startPosition === -1) {\n _logger.logger.log('override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));\n startPosition = lastCurrentTime;\n }\n this.state = State.IDLE;\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime = startPosition;\n this.tick();\n } else {\n this.forceStartLoad = true;\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 this.forceStartLoad = false;\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 break;\n case State.BUFFER_FLUSHING:\n // in buffer flushing state, reset fragLoadError counter\n this.fragLoadError = 0;\n break;\n case State.IDLE:\n this._doTickIdle();\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.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 start level loaded and media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (this.levelLastLoaded !== undefined && !media && (this.startFragRequested || !config.startFragPrefetch)) {\n return;\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 levelInfo = this.levels[level];\n\n if (!levelInfo) {\n return;\n }\n\n var levelBitrate = levelInfo.bitrate,\n maxBufLen = void 0;\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 if (levelBitrate) {\n maxBufLen = Math.max(8 * config.maxBufferSize / levelBitrate, 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;\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 this.level = hls.nextLoadLevel = level;\n\n var levelDetails = levelInfo.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;\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 // fragPrevious is last fragment. retrieve level duration using last frag start offset + duration\n // real duration might be lower than initial duration if there are drifts between real frag duration and playlist signaling\n var duration = Math.min(media.duration, fragPrevious.start + fragPrevious.duration);\n // if 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 (audio/video offsets...)\n // tolerate up to one frag duration to cope with these cases.\n // 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\n if (duration - Math.max(bufferInfo.end, fragPrevious.start) <= Math.max(0.2, fragPrevious.duration)) {\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;\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 this._fetchPayloadOrEos(pos, bufferInfo, levelDetails);\n }\n }, {\n key: '_fetchPayloadOrEos',\n value: function _fetchPayloadOrEos(pos, bufferInfo, levelDetails) {\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;\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 if (levelDetails.initSegment && !levelDetails.initSegment.data) {\n frag = levelDetails.initSegment;\n } else {\n // in case of live playlist we need to ensure that requested position is not located before playlist start\n if (levelDetails.live) {\n var initialLiveManifestSize = this.config.initialLiveManifestSize;\n if (fragLen < initialLiveManifestSize) {\n _logger.logger.warn('Can not start playback of a level, reason: not enough fragments ' + fragLen + ' < ' + initialLiveManifestSize);\n return;\n }\n\n frag = this._ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen);\n // if it explicitely returns null don't load any fragment and exit function now\n if (frag === null) {\n return;\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 }\n if (!frag) {\n frag = this._findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails);\n }\n if (frag) {\n this._loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd);\n }\n return;\n }\n }, {\n key: '_ensureFragmentAtLivePoint',\n value: function _ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen) {\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 - config.maxFragLookUpTolerance, 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(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails) {\n var config = this.hls.config;\n var frag = void 0;\n var foundFrag = void 0;\n var maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n var fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;\n var fragmentWithinToleranceTest = function fragmentWithinToleranceTest(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 // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments\n var candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);\n if (candidate.start + candidate.duration - candidateLookupTolerance <= bufferEnd) {\n return 1;\n } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n };\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n // Prefer the next fragment if it's within tolerance\n if (fragNext && !fragmentWithinToleranceTest(fragNext)) {\n foundFrag = fragNext;\n } else {\n foundFrag = _binarySearch2.default.search(fragments, fragmentWithinToleranceTest);\n }\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen - 1];\n }\n if (foundFrag) {\n frag = foundFrag;\n var curSNIdx = frag.sn - levelDetails.startSN;\n var sameLevel = fragPrevious && frag.level === fragPrevious.level;\n var prevFrag = fragments[curSNIdx - 1];\n var nextFrag = fragments[curSNIdx + 1];\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.sn === fragPrevious.sn) {\n if (sameLevel && !frag.backtracked) {\n if (frag.sn < levelDetails.endSN) {\n var deltaPTS = fragPrevious.deltaPTS;\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 = prevFrag;\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 = nextFrag;\n _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n }\n } else {\n frag = null;\n }\n } else if (frag.backtracked) {\n // Only backtrack a max of 1 consecutive fragment to prevent sliding back too far when little or no frags start with keyframes\n if (nextFrag && nextFrag.backtracked) {\n _logger.logger.warn('Already backtracked from fragment ' + nextFrag.sn + ', will not backtrack to fragment ' + frag.sn + '. Loading fragment ' + nextFrag.sn);\n frag = nextFrag;\n } else {\n // If a fragment has dropped frames and it's in a same level/sequence, load the previous fragment to try and find the keyframe\n // 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\n _logger.logger.warn('Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe');\n frag.dropped = 0;\n if (prevFrag) {\n if (prevFrag.loadCounter) {\n prevFrag.loadCounter--;\n }\n frag = prevFrag;\n frag.backtracked = true;\n } else {\n frag = null;\n }\n }\n }\n }\n }\n return frag;\n }\n }, {\n key: '_loadFragmentOrKey',\n value: function _loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd) {\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 && 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;\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = this.fragLoadIdx;\n this.fragCurrent = frag;\n this.startFragRequested = true;\n if (!isNaN(frag.sn)) {\n this.nextLoadPosition = frag.start + frag.duration;\n }\n frag.autoLevel = hls.autoLevelEnabled;\n frag.bitrateTest = this.bitrateTest;\n hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n // lazy demuxer init, as this could take some time ... do it during frag loading\n if (!this.demuxer) {\n this.demuxer = new _demuxer2.default(hls, 'main');\n }\n this.state = State.FRAG_LOADING;\n return;\n }\n }\n }, {\n key: 'getBufferedFrag',\n value: function getBufferedFrag(position) {\n return _binarySearch2.default.search(this._bufferedFrags, function (frag) {\n if (position < frag.startPTS) {\n return -1;\n } else if (position > frag.endPTS) {\n return 1;\n }\n return 0;\n });\n }\n }, {\n key: 'followingBufferedFrag',\n value: function followingBufferedFrag(frag) {\n if (frag) {\n // try to get range of next fragment (500ms after this range)\n return this.getBufferedFrag(frag.endPTS + 0.5);\n }\n return null;\n }\n }, {\n key: '_checkFragmentChanged',\n value: function _checkFragmentChanged() {\n var fragPlayingCurrent,\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 fragPlayingCurrent = this.getBufferedFrag(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 fragPlayingCurrent = this.getBufferedFrag(currentTime + 0.1);\n }\n if (fragPlayingCurrent) {\n var fragPlaying = fragPlayingCurrent;\n if (fragPlaying !== this.fragPlaying) {\n this.hls.trigger(_events2.default.FRAG_CHANGED, { frag: fragPlaying });\n var fragPlayingLevel = fragPlaying.level;\n if (!this.fragPlaying || this.fragPlaying.level !== fragPlayingLevel) {\n this.hls.trigger(_events2.default.LEVEL_SWITCHED, { level: fragPlayingLevel });\n }\n this.fragPlaying = 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 // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // flush everything\n this.flushMainBuffer(0, 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 fragPlayingCurrent = void 0,\n nextBufferedFrag = void 0;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n fragPlayingCurrent = this.getBufferedFrag(media.currentTime);\n if (fragPlayingCurrent && fragPlayingCurrent.startPTS > 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.flushMainBuffer(0, fragPlayingCurrent.startPTS - 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 nextBufferedFrag = this.getBufferedFrag(media.currentTime + fetchdelay);\n if (nextBufferedFrag) {\n // we can flush buffer range following this one without stalling playback\n nextBufferedFrag = this.followingBufferedFrag(nextBufferedFrag);\n if (nextBufferedFrag) {\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.flushMainBuffer(nextBufferedFrag.startPTS, Number.POSITIVE_INFINITY);\n }\n }\n }\n }\n }, {\n key: 'flushMainBuffer',\n value: function flushMainBuffer(startOffset, endOffset) {\n this.state = State.BUFFER_FLUSHING;\n var flushScope = { startOffset: startOffset, endOffset: endOffset };\n // if alternate audio tracks are used, only flush video, otherwise flush everything\n if (this.altAudio) {\n flushScope.type = 'video';\n }\n this.hls.trigger(_events2.default.BUFFER_FLUSHING, flushScope);\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 fragment.backtracked = 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 = this.mediaBuffer = 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 if (!isNaN(currentTime)) {\n _logger.logger.log('media seeking to ' + currentTime.toFixed(3));\n }\n var mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media;\n var bufferInfo = _bufferHelper2.default.bufferInfo(mediaBuffer, currentTime, this.config.maxBufferHole);\n if (this.state === State.FRAG_LOADING) {\n var 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 // if seeking to unbuffered area, clean up fragPrevious\n if (bufferInfo.len === 0) {\n this.fragPrevious = 0;\n }\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 // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target\n if (!this.loadedmetadata) {\n this.nextLoadPosition = this.startPosition = currentTime;\n }\n // tick to speed up processing\n this.tick();\n }\n }, {\n key: 'onMediaSeeked',\n value: function onMediaSeeked() {\n var media = this.media,\n currentTime = media ? media.currentTime : undefined;\n if (!isNaN(currentTime)) {\n _logger.logger.log('media seeked to ' + currentTime.toFixed(3));\n }\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._bufferedFrags = [];\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 || this.forceStartLoad) {\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 this.lastCurrentTime = this.startPosition;\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 this.stats = stats;\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 if (fragLoaded.sn === 'initSegment') {\n this.state = State.IDLE;\n stats.tparsed = stats.tbuffered = performance.now();\n details.initSegment.data = data.payload;\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 var duration = details.totalduration,\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.pendingBuffering = true;\n this.appended = false;\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) and if media is not seeking (this is to overcome potential timestamp drifts between playlists and fragments)\n var media = this.media;\n var mediaSeeking = media && media.seeking;\n var accurateTimeOffset = !mediaSeeking && (details.PTSKnown || !details.live);\n var initSegmentData = details.initSegment ? details.initSegment.data : [];\n demuxer.push(data.payload, initSegmentData, audioCodec, currentLevel.videoCodec, fragCurrent, duration, accurateTimeOffset, undefined);\n }\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n var fragNew = data.frag;\n if (fragCurrent && data.id === 'main' && fragNew.sn === fragCurrent.sn && fragNew.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 && track.container !== 'audio/mpeg') {\n // Exclude mpeg audio\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 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.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\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 var fragNew = data.frag;\n 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\n this.state === State.PARSING) {\n var level = this.levels[this.level],\n frag = fragCurrent;\n if (isNaN(data.endPTS)) {\n data.endPTS = data.startPTS + fragCurrent.duration;\n data.endDTS = data.startDTS + fragCurrent.duration;\n }\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 // Detect gaps in a fragment and try to fix it by finding a keyframe in the previous fragment (see _findFragments)\n if (data.type === 'video') {\n frag.dropped = data.dropped;\n if (frag.dropped) {\n if (!frag.backtracked) {\n _logger.logger.warn('missing video frame(s), backtracking fragment');\n // Return back to the IDLE state without appending to buffer\n // Causes findFragments to backtrack a segment and find the keyframe\n // Audio fragments arriving before video sets the nextLoadPosition, causing _findFragments to skip the backtracked fragment\n frag.backtracked = true;\n this.nextLoadPosition = data.startPTS;\n this.state = State.IDLE;\n this.fragPrevious = frag;\n this.tick();\n return;\n } else {\n _logger.logger.warn('Already backtracked on this fragment, appending with the gap');\n }\n } else {\n // Only reset the backtracked flag if we've loaded the frag without any dropped frames\n frag.backtracked = false;\n }\n }\n\n var drift = _levelHelper2.default.updateFragPTSDTS(level.details, frag, 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, type: data.type, start: data.startPTS, end: data.endPTS });\n\n // has remuxer dropped video frames located before first keyframe ?\n [data.data1, data.data2].forEach(function (buffer) {\n // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)\n // in that case it is useless to append following segments\n if (buffer && buffer.length && _this2.state === State.PARSING) {\n _this2.appended = true;\n // arm pending Buffering flag before appending a segment\n _this2.pendingBuffering = true;\n hls.trigger(_events2.default.BUFFER_APPENDING, { type: data.type, data: buffer, parent: 'main', content: 'data' });\n }\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 var fragNew = data.frag;\n if (fragCurrent && data.id === 'main' && fragNew.sn === fragCurrent.sn && fragNew.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: 'onAudioTrackSwitching',\n value: function onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url,\n trackId = data.id;\n // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered\n // don't do anything if we switch to alt audio: audio stream controller is handling it.\n // we will just have to change buffer scheduling on audioTrackSwitched\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 var hls = this.hls;\n // switching to main audio, flush all audio and trigger track switched\n hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n this.altAudio = false;\n }\n }\n }, {\n key: 'onAudioTrackSwitched',\n value: function onAudioTrackSwitched(data) {\n var trackId = data.id,\n altAudio = !!this.hls.audioTracks[trackId].url;\n if (altAudio) {\n var videoBuffer = this.videoBuffer;\n // if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered\n if (videoBuffer && this.mediaBuffer !== videoBuffer) {\n _logger.logger.log('switching on alternate audio, use video.buffered to schedule main fragment loading');\n this.mediaBuffer = videoBuffer;\n }\n }\n this.altAudio = altAudio;\n this.tick();\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 var state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = data.pending > 0;\n this._checkAppendedParsed();\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n var frag = this.fragCurrent;\n if (frag) {\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n _logger.logger.log('main buffered : ' + _timeRanges2.default.toString(media.buffered));\n // filter fragments potentially evicted from buffer. this is to avoid memleak on live streams\n var bufferedFrags = this._bufferedFrags.filter(function (frag) {\n return _bufferHelper2.default.isBuffered(media, (frag.startPTS + frag.endPTS) / 2);\n });\n // push new range\n bufferedFrags.push(frag);\n // sort frags, as we use BinarySearch for lookup in getBufferedFrag ...\n this._bufferedFrags = bufferedFrags.sort(function (a, b) {\n return a.startPTS - b.startPTS;\n });\n this.fragPrevious = frag;\n var stats = this.stats;\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 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 case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_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 or if in automode with current level not 0\n if (loadError <= config.fragLoadingMaxRetry || mediaBuffered || frag.autoLevel && frag.level) {\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 // 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 this.nextLoadPosition = this.startPosition;\n }\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n _logger.logger.error('mediaController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n // switch error to fatal\n data.fatal = true;\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 // switch error to fatal\n data.fatal = true;\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 if (this.state !== State.ERROR) {\n if (data.fatal) {\n // if fatal error, stop processing\n this.state = State.ERROR;\n _logger.logger.warn('streamController: ' + data.details + ',switch to ' + this.state + ' state ...');\n } else {\n // in case of non fatal error while loading level, if level controller is not retrying to load level , switch back to IDLE\n if (!data.levelRetry && this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n }\n }\n break;\n case _errors.ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (data.parent === 'main' && (this.state === State.PARSING || this.state === State.PARSED)) {\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n this._reduceMaxBufferLength(this.config.maxBufferLength);\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/video-dev/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 // flush everything\n this.flushMainBuffer(0, 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('main:reduce max buffer length to ' + config.maxMaxBufferLength + 's');\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 mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media,\n buffered = mediaBuffer.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 = media.seeking ? currentTime : this.startPosition,\n startPositionBuffered = _bufferHelper2.default.isBuffered(mediaBuffer, 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 !== this.lastCurrentTime,\n config = this.config;\n\n if (playheadMoving) {\n // played moving, but was previously stalled => now not stuck anymore\n if (this.stallReported) {\n _logger.logger.warn('playback not stuck anymore @' + currentTime + ', after ' + Math.round(performance.now() - this.stalled) + 'ms');\n this.stallReported = false;\n }\n this.stalled = undefined;\n this.nudgeRetry = 0;\n } else {\n // playhead not moving\n if (expectedPlaying) {\n // playhead not moving BUT media expected to play\n var tnow = performance.now();\n var hls = this.hls;\n if (!this.stalled) {\n // stall just detected, store current time\n this.stalled = tnow;\n this.stallReported = false;\n } else {\n // playback already stalled, check stalling duration\n // if stalling for more than a given threshold, let's try to recover\n var stalledDuration = tnow - this.stalled;\n var bufferLen = bufferInfo.len;\n var nudgeRetry = this.nudgeRetry || 0;\n // have we reached stall deadline ?\n if (bufferLen <= jumpThreshold && stalledDuration > config.lowBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n _logger.logger.warn('playback stalling in low buffer @' + currentTime);\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });\n }\n // if buffer len is below threshold, try to jump to start of next buffer range if close\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 this.nudgeRetry = ++nudgeRetry;\n var nudgeOffset = nudgeRetry * config.nudgeOffset;\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 ' + nudgeOffset);\n media.currentTime = nextBufferStart + nudgeOffset;\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole: nextBufferStart + nudgeOffset - currentTime });\n }\n } else if (bufferLen > jumpThreshold && stalledDuration > config.highBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n _logger.logger.warn('playback stalling in high buffer @' + currentTime);\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });\n }\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n this.nudgeRetry = ++nudgeRetry;\n if (nudgeRetry < config.nudgeMaxRetry) {\n var _currentTime = media.currentTime;\n var targetTime = _currentTime + nudgeRetry * config.nudgeOffset;\n _logger.logger.log('adjust currentTime from ' + _currentTime + ' to ' + targetTime);\n // playback stalled in buffered area ... let's nudge currentTime to try to overcome this\n media.currentTime = targetTime;\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_NUDGE_ON_STALL, fatal: false });\n } else {\n _logger.logger.error('still stuck in high buffer @' + currentTime + ' after ' + config.nudgeMaxRetry + ', raise fatal error');\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: true });\n }\n }\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 this.nextLoadPosition = this.startPosition;\n }\n this.tick();\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n /* after successful buffer flushing, filter flushed fragments from bufferedFrags\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 this._bufferedFrags = this._bufferedFrags.filter(function (frag) {\n return _bufferHelper2.default.isBuffered(media, (frag.startPTS + frag.endPTS) / 2);\n });\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('main stream:' + previousState + '->' + 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 frag = this.getBufferedFrag(media.currentTime);\n if (frag) {\n return frag.level;\n }\n }\n return -1;\n }\n }, {\n key: 'nextBufferedFrag',\n get: function get() {\n var media = this.media;\n if (media) {\n // first get end range of current fragment\n return this.followingBufferedFrag(this.getBufferedFrag(media.currentTime));\n } else {\n return null;\n }\n }\n }, {\n key: 'nextLevel',\n get: function get() {\n var frag = this.nextBufferedFrag;\n if (frag) {\n return 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},{\"25\":25,\"33\":33,\"34\":34,\"35\":35,\"37\":37,\"38\":38,\"48\":48,\"53\":53,\"54\":54}],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\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(53);\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 * Subtitle Stream Controller\n */\n\nvar SubtitleStreamController = function (_EventHandler) {\n _inherits(SubtitleStreamController, _EventHandler);\n\n function SubtitleStreamController(hls) {\n _classCallCheck(this, SubtitleStreamController);\n\n 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));\n\n _this.config = hls.config;\n _this.vttFragSNsProcessed = {};\n _this.vttFragQueues = undefined;\n _this.currentlyProcessing = null;\n _this.currentTrackId = -1;\n return _this;\n }\n\n _createClass(SubtitleStreamController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n\n // Remove all queued items and create a new, empty queue for each track.\n\n }, {\n key: 'clearVttFragQueues',\n value: function clearVttFragQueues() {\n var _this2 = this;\n\n this.vttFragQueues = {};\n this.tracks.forEach(function (track) {\n _this2.vttFragQueues[track.id] = [];\n });\n }\n\n // If no frag is being processed and queue isn't empty, initiate processing of next frag in line.\n\n }, {\n key: 'nextFrag',\n value: function nextFrag() {\n if (this.currentlyProcessing === null && this.currentTrackId > -1 && this.vttFragQueues[this.currentTrackId].length) {\n var frag = this.currentlyProcessing = this.vttFragQueues[this.currentTrackId].shift();\n this.hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n }\n }\n\n // When fragment has finished processing, add sn to list of completed if successful.\n\n }, {\n key: 'onSubtitleFragProcessed',\n value: function onSubtitleFragProcessed(data) {\n if (data.success) {\n this.vttFragSNsProcessed[data.frag.trackId].push(data.frag.sn);\n }\n this.currentlyProcessing = null;\n this.nextFrag();\n }\n\n // If something goes wrong, procede to next frag, if we were processing one.\n\n }, {\n key: 'onError',\n value: function onError(data) {\n var frag = data.frag;\n // don't handle frag error not related to subtitle fragment\n if (frag && frag.type !== 'subtitle') {\n return;\n }\n if (this.currentlyProcessing) {\n this.currentlyProcessing = null;\n this.nextFrag();\n }\n }\n\n // Got all new subtitle tracks.\n\n }, {\n key: 'onSubtitleTracksUpdated',\n value: function onSubtitleTracksUpdated(data) {\n var _this3 = this;\n\n _logger.logger.log('subtitle tracks updated');\n this.tracks = data.subtitleTracks;\n this.clearVttFragQueues();\n this.vttFragSNsProcessed = {};\n this.tracks.forEach(function (track) {\n _this3.vttFragSNsProcessed[track.id] = [];\n });\n }\n }, {\n key: 'onSubtitleTrackSwitch',\n value: function onSubtitleTrackSwitch(data) {\n this.currentTrackId = data.id;\n this.clearVttFragQueues();\n }\n\n // Got a new set of subtitle fragments.\n\n }, {\n key: 'onSubtitleTrackLoaded',\n value: function onSubtitleTrackLoaded(data) {\n var processedFragSNs = this.vttFragSNsProcessed[data.id],\n fragQueue = this.vttFragQueues[data.id],\n currentFragSN = !!this.currentlyProcessing ? this.currentlyProcessing.sn : -1;\n\n var alreadyProcessed = function alreadyProcessed(frag) {\n return processedFragSNs.indexOf(frag.sn) > -1;\n };\n\n var alreadyInQueue = function alreadyInQueue(frag) {\n return fragQueue.some(function (fragInQueue) {\n return fragInQueue.sn === frag.sn;\n });\n };\n\n // Add all fragments that haven't been, aren't currently being and aren't waiting to be processed, to queue.\n data.details.fragments.forEach(function (frag) {\n if (!(alreadyProcessed(frag) || frag.sn === currentFragSN || alreadyInQueue(frag))) {\n // Frags don't know their subtitle track ID, so let's just add that...\n frag.trackId = data.id;\n fragQueue.push(frag);\n }\n });\n\n this.nextFrag();\n }\n }]);\n\n return SubtitleStreamController;\n}(_eventHandler2.default);\n\nexports.default = SubtitleStreamController;\n\n},{\"34\":34,\"35\":35,\"53\":53}],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\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(53);\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\nfunction filterSubtitleTracks(textTrackList) {\n var tracks = [];\n for (var i = 0; i < textTrackList.length; i++) {\n if (textTrackList[i].kind === 'subtitles') {\n tracks.push(textTrackList[i]);\n }\n }\n return tracks;\n}\n\nvar SubtitleTrackController = function (_EventHandler) {\n _inherits(SubtitleTrackController, _EventHandler);\n\n function SubtitleTrackController(hls) {\n _classCallCheck(this, SubtitleTrackController);\n\n 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));\n\n _this.tracks = [];\n _this.trackId = -1;\n _this.media = undefined;\n return _this;\n }\n\n _createClass(SubtitleTrackController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n\n // Listen for subtitle track change, then extract the current track ID.\n\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n var _this2 = this;\n\n this.media = data.media;\n if (!this.media) {\n return;\n }\n\n this.media.textTracks.addEventListener('change', function () {\n // Media is undefined when switching streams via loadSource()\n if (!_this2.media) {\n return;\n }\n\n var trackId = -1;\n var tracks = filterSubtitleTracks(_this2.media.textTracks);\n for (var id = 0; id < tracks.length; id++) {\n if (tracks[id].mode === 'showing') {\n trackId = id;\n }\n }\n // Setting current subtitleTrack will invoke code.\n _this2.subtitleTrack = trackId;\n });\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n // TODO: Remove event listeners.\n this.media = undefined;\n }\n\n // Reset subtitle tracks on manifest loading\n\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n this.tracks = [];\n this.trackId = -1;\n }\n\n // Fired whenever a new manifest is loaded.\n\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var _this3 = this;\n\n var tracks = data.subtitles || [];\n var defaultFound = false;\n this.tracks = tracks;\n this.trackId = -1;\n this.hls.trigger(_events2.default.SUBTITLE_TRACKS_UPDATED, { subtitleTracks: tracks });\n\n // loop through available subtitle tracks and autoselect default if needed\n // TODO: improve selection logic to handle forced, etc\n tracks.forEach(function (track) {\n if (track.default) {\n _this3.subtitleTrack = track.id;\n defaultFound = true;\n }\n });\n }\n\n // Trigger subtitle track playlist reload.\n\n }, {\n key: 'onTick',\n value: function onTick() {\n var trackId = this.trackId;\n var subtitleTrack = this.tracks[trackId];\n if (!subtitleTrack) {\n return;\n }\n\n var details = subtitleTrack.details;\n // check if we need to load playlist for this subtitle Track\n if (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 subtitle track ' + trackId);\n this.hls.trigger(_events2.default.SUBTITLE_TRACK_LOADING, { url: subtitleTrack.url, id: trackId });\n }\n }\n }, {\n key: 'onSubtitleTrackLoaded',\n value: function onSubtitleTrackLoaded(data) {\n var _this4 = this;\n\n if (data.id < this.tracks.length) {\n _logger.logger.log('subtitle track ' + 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(function () {\n _this4.onTick();\n }, 1000 * data.details.targetduration, this);\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 subtitle tracks list from playlist **/\n\n }, {\n key: 'setSubtitleTrackInternal',\n value: function setSubtitleTrackInternal(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 subtitle track ' + newId);\n var subtitleTrack = this.tracks[newId];\n this.hls.trigger(_events2.default.SUBTITLE_TRACK_SWITCH, { id: newId });\n // check if we need to load playlist for this subtitle Track\n var details = subtitleTrack.details;\n if (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 subtitle track ' + newId);\n this.hls.trigger(_events2.default.SUBTITLE_TRACK_LOADING, { url: subtitleTrack.url, id: newId });\n }\n }\n }\n }, {\n key: 'subtitleTracks',\n get: function get() {\n return this.tracks;\n }\n\n /** get index of the selected subtitle track (index in subtitle track lists) **/\n\n }, {\n key: 'subtitleTrack',\n get: function get() {\n return this.trackId;\n }\n\n /** select a subtitle track, based on its index in subtitle track lists**/\n ,\n set: function set(subtitleTrackId) {\n if (this.trackId !== subtitleTrackId) {\n // || this.tracks[subtitleTrackId].details === undefined) {\n this.setSubtitleTrackInternal(subtitleTrackId);\n }\n }\n }]);\n\n return SubtitleTrackController;\n}(_eventHandler2.default);\n\nexports.default = SubtitleTrackController;\n\n},{\"34\":34,\"35\":35,\"53\":53}],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\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _cea608Parser = _dereq_(49);\n\nvar _cea608Parser2 = _interopRequireDefault(_cea608Parser);\n\nvar _webvttParser = _dereq_(57);\n\nvar _webvttParser2 = _interopRequireDefault(_webvttParser);\n\nvar _logger = _dereq_(53);\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\nfunction clearCurrentCues(track) {\n if (track && track.cues) {\n while (track.cues.length > 0) {\n track.removeCue(track.cues[0]);\n }\n }\n}\n\nfunction reuseVttTextTrack(inUseTrack, manifestTrack) {\n return inUseTrack && inUseTrack.label === manifestTrack.name && !(inUseTrack.textTrack1 || inUseTrack.textTrack2);\n}\n\nfunction intersection(x1, x2, y1, y2) {\n return Math.min(x2, y2) - Math.max(x1, y1);\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, (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));\n\n _this.hls = hls;\n _this.config = hls.config;\n _this.enabled = true;\n _this.Cues = hls.config.cueHandler;\n _this.textTracks = [];\n _this.tracks = [];\n _this.unparsedVttFrags = [];\n _this.initPTS = undefined;\n _this.cueRanges = [];\n\n if (_this.config.enableCEA708Captions) {\n var self = _this;\n var sendAddTrackEvent = function sendAddTrackEvent(track, media) {\n var e = null;\n try {\n e = new window.Event('addtrack');\n } catch (err) {\n //for IE11\n e = document.createEvent('Event');\n e.initEvent('addtrack', false, false);\n }\n e.track = track;\n media.dispatchEvent(e);\n };\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 var textTrack1 = self.createTextTrack('captions', self.config.captionsTextTrack1Label, self.config.captionsTextTrack1LanguageCode);\n if (textTrack1) {\n textTrack1.textTrack1 = true;\n self.textTrack1 = textTrack1;\n }\n } else {\n self.textTrack1 = existingTrack1;\n clearCurrentCues(self.textTrack1);\n\n sendAddTrackEvent(self.textTrack1, self.media);\n }\n }\n self.addCues('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 var textTrack2 = self.createTextTrack('captions', self.config.captionsTextTrack2Label, self.config.captionsTextTrack1LanguageCode);\n if (textTrack2) {\n textTrack2.textTrack2 = true;\n self.textTrack2 = textTrack2;\n }\n } else {\n self.textTrack2 = existingTrack2;\n clearCurrentCues(self.textTrack2);\n\n sendAddTrackEvent(self.textTrack2, self.media);\n }\n }\n self.addCues('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: 'addCues',\n value: function addCues(channel, startTime, endTime, screen) {\n // skip cues which overlap more than 50% with previously parsed time ranges\n var ranges = this.cueRanges;\n var merged = false;\n for (var i = ranges.length; i--;) {\n var cueRange = ranges[i];\n var overlap = intersection(cueRange[0], cueRange[1], startTime, endTime);\n if (overlap >= 0) {\n cueRange[0] = Math.min(cueRange[0], startTime);\n cueRange[1] = Math.max(cueRange[1], endTime);\n merged = true;\n if (overlap / (endTime - startTime) > 0.5) {\n return;\n }\n }\n }\n if (!merged) {\n ranges.push([startTime, endTime]);\n }\n this.Cues.newCue(this[channel], startTime, endTime, screen);\n }\n\n // Triggered when an initial PTS is found; used for synchronisation of WebVTT.\n\n }, {\n key: 'onInitPtsFound',\n value: function onInitPtsFound(data) {\n var _this2 = this;\n\n if (typeof this.initPTS === 'undefined') {\n this.initPTS = data.initPTS;\n }\n\n // Due to asynchrony, initial PTS may arrive later than the first VTT fragments are loaded.\n // Parse any unparsed fragments upon receiving the initial PTS.\n if (this.unparsedVttFrags.length) {\n this.unparsedVttFrags.forEach(function (frag) {\n _this2.onFragLoaded(frag);\n });\n this.unparsedVttFrags = [];\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 var media = this.media;\n if (media) {\n return 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 clearCurrentCues(this.textTrack1);\n clearCurrentCues(this.textTrack2);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n this.lastSn = -1; // Detect discontiguity in fragment parsing\n this.prevCC = -1;\n this.vttCCs = { ccOffset: 0, presentationOffset: 0 }; // Detect discontinuity in subtitle manifests\n\n // clear outdated subtitles\n var media = this.media;\n if (media) {\n var textTracks = media.textTracks;\n if (textTracks) {\n for (var i = 0; i < textTracks.length; i++) {\n clearCurrentCues(textTracks[i]);\n }\n }\n }\n }\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var _this3 = this;\n\n this.textTracks = [];\n this.unparsedVttFrags = this.unparsedVttFrags || [];\n this.initPTS = undefined;\n this.cueRanges = [];\n\n if (this.config.enableWebVTT) {\n this.tracks = data.subtitles || [];\n var inUseTracks = this.media ? this.media.textTracks : [];\n\n this.tracks.forEach(function (track, index) {\n var textTrack = void 0;\n if (index < inUseTracks.length) {\n var inUseTrack = inUseTracks[index];\n // Reuse tracks with the same label, but do not reuse 608/708 tracks\n if (reuseVttTextTrack(inUseTrack, track)) {\n textTrack = inUseTrack;\n }\n }\n if (!textTrack) {\n textTrack = _this3.createTextTrack('subtitles', track.name, track.lang);\n }\n textTrack.mode = track.default ? 'showing' : 'hidden';\n _this3.textTracks.push(textTrack);\n });\n }\n }\n }, {\n key: 'onLevelSwitching',\n value: function onLevelSwitching() {\n this.enabled = this.hls.currentLevel.closedCaptions !== 'NONE';\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var frag = data.frag,\n payload = data.payload;\n if (frag.type === 'main') {\n var sn = frag.sn;\n // if this frag isn't contiguous, clear the parser so cues with bad start/end times aren't added to the textTrack\n if (sn !== this.lastSn + 1) {\n var cea608Parser = this.cea608Parser;\n if (cea608Parser) {\n cea608Parser.reset();\n }\n }\n this.lastSn = sn;\n }\n // If fragment is subtitle type, parse as WebVTT.\n else if (frag.type === 'subtitle') {\n if (payload.byteLength) {\n // We need an initial synchronisation PTS. Store fragments as long as none has arrived.\n if (typeof this.initPTS === 'undefined') {\n this.unparsedVttFrags.push(data);\n return;\n }\n var vttCCs = this.vttCCs;\n if (!vttCCs[frag.cc]) {\n vttCCs[frag.cc] = { start: frag.start, prevCC: this.prevCC, new: true };\n this.prevCC = frag.cc;\n }\n var textTracks = this.textTracks,\n hls = this.hls;\n\n // Parse the WebVTT file contents.\n _webvttParser2.default.parse(payload, this.initPTS, vttCCs, frag.cc, function (cues) {\n var currentTrack = textTracks[frag.trackId];\n // Add cues and trigger event with success true.\n cues.forEach(function (cue) {\n // Sometimes there are cue overlaps on segmented vtts so the same\n // cue can appear more than once in different vtt files.\n // This avoid showing duplicated cues with same timecode and text.\n if (!currentTrack.cues.getCueById(cue.id)) {\n currentTrack.addCue(cue);\n }\n });\n hls.trigger(_events2.default.SUBTITLE_FRAG_PROCESSED, { success: true, frag: frag });\n }, function (e) {\n // Something went wrong while parsing. Trigger event with success false.\n _logger.logger.log('Failed to parse VTT cue: ' + e);\n hls.trigger(_events2.default.SUBTITLE_FRAG_PROCESSED, { success: false, frag: frag });\n });\n } else {\n // In case there is no payload, finish unsuccessfully.\n this.hls.trigger(_events2.default.SUBTITLE_FRAG_PROCESSED, { success: false, frag: frag });\n }\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 && this.config.enableCEA708Captions) {\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;\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},{\"34\":34,\"35\":35,\"49\":49,\"53\":53,\"57\":57}],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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AESCrypto = function () {\n function AESCrypto(subtle, iv) {\n _classCallCheck(this, AESCrypto);\n\n this.subtle = subtle;\n this.aesIV = iv;\n }\n\n _createClass(AESCrypto, [{\n key: 'decrypt',\n value: function decrypt(data, key) {\n return this.subtle.decrypt({ name: 'AES-CBC', iv: this.aesIV }, key, data);\n }\n }]);\n\n return AESCrypto;\n}();\n\nexports.default = AESCrypto;\n\n},{}],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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AESDecryptor = function () {\n function AESDecryptor() {\n _classCallCheck(this, AESDecryptor);\n\n // Static after running initTable\n this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n this.subMix = [new Uint32Array(256), new Uint32Array(256), new Uint32Array(256), new Uint32Array(256)];\n this.invSubMix = [new Uint32Array(256), new Uint32Array(256), new Uint32Array(256), new Uint32Array(256)];\n this.sBox = new Uint32Array(256);\n this.invSBox = new Uint32Array(256);\n\n // Changes during runtime\n this.key = new Uint32Array(0);\n\n this.initTable();\n }\n\n // Using view.getUint32() also swaps the byte order.\n\n\n _createClass(AESDecryptor, [{\n key: 'uint8ArrayToUint32Array_',\n value: function uint8ArrayToUint32Array_(arrayBuffer) {\n var view = new DataView(arrayBuffer);\n var newArray = new Uint32Array(4);\n for (var i = 0; i < 4; i++) {\n newArray[i] = view.getUint32(i * 4);\n }\n return newArray;\n }\n }, {\n key: 'initTable',\n value: function initTable() {\n var sBox = this.sBox;\n var invSBox = this.invSBox;\n var subMix = this.subMix;\n var subMix0 = subMix[0];\n var subMix1 = subMix[1];\n var subMix2 = subMix[2];\n var subMix3 = subMix[3];\n var invSubMix = this.invSubMix;\n var invSubMix0 = invSubMix[0];\n var invSubMix1 = invSubMix[1];\n var invSubMix2 = invSubMix[2];\n var invSubMix3 = invSubMix[3];\n\n var d = new Uint32Array(256);\n var x = 0;\n var xi = 0;\n var i = 0;\n for (i = 0; i < 256; i++) {\n if (i < 128) {\n d[i] = i << 1;\n } else {\n d[i] = i << 1 ^ 0x11b;\n }\n }\n\n for (i = 0; i < 256; i++) {\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 0xff ^ 0x63;\n sBox[x] = sx;\n invSBox[sx] = x;\n\n // Compute multiplication\n var x2 = d[x];\n var x4 = d[x2];\n var x8 = d[x4];\n\n // Compute sub/invSub bytes, mix columns tables\n var t = d[sx] * 0x101 ^ sx * 0x1010100;\n subMix0[x] = t << 24 | t >>> 8;\n subMix1[x] = t << 16 | t >>> 16;\n subMix2[x] = t << 8 | t >>> 24;\n subMix3[x] = t;\n\n // Compute inv sub bytes, inv mix columns tables\n t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n invSubMix0[sx] = t << 24 | t >>> 8;\n invSubMix1[sx] = t << 16 | t >>> 16;\n invSubMix2[sx] = t << 8 | t >>> 24;\n invSubMix3[sx] = t;\n\n // Compute next counter\n if (!x) {\n x = xi = 1;\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]];\n xi ^= d[d[xi]];\n }\n }\n }\n }, {\n key: 'expandKey',\n value: function expandKey(keyBuffer) {\n // convert keyBuffer to Uint32Array\n var key = this.uint8ArrayToUint32Array_(keyBuffer);\n var sameKey = true;\n var offset = 0;\n\n while (offset < key.length && sameKey) {\n sameKey = key[offset] === this.key[offset];\n offset++;\n }\n\n if (sameKey) {\n return;\n }\n\n this.key = key;\n var keySize = this.keySize = key.length;\n\n if (keySize !== 4 && keySize !== 6 && keySize !== 8) {\n throw new Error('Invalid aes key size=' + keySize);\n }\n\n var ksRows = this.ksRows = (keySize + 6 + 1) * 4;\n var ksRow = void 0;\n var invKsRow = void 0;\n\n var keySchedule = this.keySchedule = new Uint32Array(ksRows);\n var invKeySchedule = this.invKeySchedule = new Uint32Array(ksRows);\n var sbox = this.sBox;\n var rcon = this.rcon;\n\n var invSubMix = this.invSubMix;\n var invSubMix0 = invSubMix[0];\n var invSubMix1 = invSubMix[1];\n var invSubMix2 = invSubMix[2];\n var invSubMix3 = invSubMix[3];\n\n var prev = void 0;\n var t = void 0;\n\n for (ksRow = 0; ksRow < ksRows; ksRow++) {\n if (ksRow < keySize) {\n prev = keySchedule[ksRow] = key[ksRow];\n continue;\n }\n t = prev;\n\n if (ksRow % keySize === 0) {\n // Rot word\n t = t << 8 | t >>> 24;\n\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n\n // Mix Rcon\n t ^= rcon[ksRow / keySize | 0] << 24;\n } else if (keySize > 6 && ksRow % keySize === 4) {\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n }\n\n keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;\n }\n\n for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n ksRow = ksRows - invKsRow;\n if (invKsRow & 3) {\n t = keySchedule[ksRow];\n } else {\n t = keySchedule[ksRow - 4];\n }\n\n if (invKsRow < 4 || ksRow <= 4) {\n invKeySchedule[invKsRow] = t;\n } else {\n invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[t >>> 16 & 0xff]] ^ invSubMix2[sbox[t >>> 8 & 0xff]] ^ invSubMix3[sbox[t & 0xff]];\n }\n\n invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;\n }\n }\n\n // Adding this as a method greatly improves performance.\n\n }, {\n key: 'networkToHostOrderSwap',\n value: function networkToHostOrderSwap(word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n }\n }, {\n key: 'decrypt',\n value: function decrypt(inputArrayBuffer, offset, aesIV) {\n var nRounds = this.keySize + 6;\n var invKeySchedule = this.invKeySchedule;\n var invSBOX = this.invSBox;\n\n var invSubMix = this.invSubMix;\n var invSubMix0 = invSubMix[0];\n var invSubMix1 = invSubMix[1];\n var invSubMix2 = invSubMix[2];\n var invSubMix3 = invSubMix[3];\n\n var initVector = this.uint8ArrayToUint32Array_(aesIV);\n var initVector0 = initVector[0];\n var initVector1 = initVector[1];\n var initVector2 = initVector[2];\n var initVector3 = initVector[3];\n\n var inputInt32 = new Int32Array(inputArrayBuffer);\n var outputInt32 = new Int32Array(inputInt32.length);\n\n var t0 = void 0,\n t1 = void 0,\n t2 = void 0,\n t3 = void 0;\n var s0 = void 0,\n s1 = void 0,\n s2 = void 0,\n s3 = void 0;\n var inputWords0 = void 0,\n inputWords1 = void 0,\n inputWords2 = void 0,\n inputWords3 = void 0;\n\n var ksRow, i;\n var swapWord = this.networkToHostOrderSwap;\n\n while (offset < inputInt32.length) {\n inputWords0 = swapWord(inputInt32[offset]);\n inputWords1 = swapWord(inputInt32[offset + 1]);\n inputWords2 = swapWord(inputInt32[offset + 2]);\n inputWords3 = swapWord(inputInt32[offset + 3]);\n\n s0 = inputWords0 ^ invKeySchedule[0];\n s1 = inputWords3 ^ invKeySchedule[1];\n s2 = inputWords2 ^ invKeySchedule[2];\n s3 = inputWords1 ^ invKeySchedule[3];\n\n ksRow = 4;\n\n // Iterate through the rounds of decryption\n for (i = 1; i < nRounds; i++) {\n t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[s1 >> 16 & 0xff] ^ invSubMix2[s2 >> 8 & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[s2 >> 16 & 0xff] ^ invSubMix2[s3 >> 8 & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[s3 >> 16 & 0xff] ^ invSubMix2[s0 >> 8 & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[s0 >> 16 & 0xff] ^ invSubMix2[s1 >> 8 & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n // Update state\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n\n ksRow = ksRow + 4;\n }\n\n // Shift rows, sub bytes, add round key\n t0 = invSBOX[s0 >>> 24] << 24 ^ invSBOX[s1 >> 16 & 0xff] << 16 ^ invSBOX[s2 >> 8 & 0xff] << 8 ^ invSBOX[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSBOX[s1 >>> 24] << 24 ^ invSBOX[s2 >> 16 & 0xff] << 16 ^ invSBOX[s3 >> 8 & 0xff] << 8 ^ invSBOX[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSBOX[s2 >>> 24] << 24 ^ invSBOX[s3 >> 16 & 0xff] << 16 ^ invSBOX[s0 >> 8 & 0xff] << 8 ^ invSBOX[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSBOX[s3 >>> 24] << 24 ^ invSBOX[s0 >> 16 & 0xff] << 16 ^ invSBOX[s1 >> 8 & 0xff] << 8 ^ invSBOX[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n ksRow = ksRow + 3;\n\n // Write\n outputInt32[offset] = swapWord(t0 ^ initVector0);\n outputInt32[offset + 1] = swapWord(t3 ^ initVector1);\n outputInt32[offset + 2] = swapWord(t2 ^ initVector2);\n outputInt32[offset + 3] = swapWord(t1 ^ initVector3);\n\n // reset initVector to last 4 unsigned int\n initVector0 = inputWords0;\n initVector1 = inputWords1;\n initVector2 = inputWords2;\n initVector3 = inputWords3;\n\n offset = offset + 4;\n }\n\n return outputInt32.buffer;\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.key = undefined;\n this.keySize = undefined;\n this.ksRows = undefined;\n\n this.sBox = undefined;\n this.invSBox = undefined;\n this.subMix = undefined;\n this.invSubMix = undefined;\n this.keySchedule = undefined;\n this.invKeySchedule = undefined;\n\n this.rcon = undefined;\n }\n }]);\n\n return AESDecryptor;\n}();\n\nexports.default = AESDecryptor;\n\n},{}],19:[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 _aesCrypto = _dereq_(17);\n\nvar _aesCrypto2 = _interopRequireDefault(_aesCrypto);\n\nvar _fastAesKey = _dereq_(20);\n\nvar _fastAesKey2 = _interopRequireDefault(_fastAesKey);\n\nvar _aesDecryptor = _dereq_(18);\n\nvar _aesDecryptor2 = _interopRequireDefault(_aesDecryptor);\n\nvar _errors = _dereq_(33);\n\nvar _logger = _dereq_(53);\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\n/*globals self: false */\n\nvar Decrypter = function () {\n function Decrypter(observer, config) {\n _classCallCheck(this, Decrypter);\n\n this.observer = observer;\n this.config = config;\n this.logEnabled = true;\n try {\n var browserCrypto = crypto ? crypto : self.crypto;\n this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;\n } catch (e) {}\n this.disableWebCrypto = !this.subtle;\n }\n\n _createClass(Decrypter, [{\n key: 'isSync',\n value: function isSync() {\n return this.disableWebCrypto && this.config.enableSoftwareAES;\n }\n }, {\n key: 'decrypt',\n value: function decrypt(data, key, iv, callback) {\n var _this = this;\n\n if (this.disableWebCrypto && this.config.enableSoftwareAES) {\n if (this.logEnabled) {\n _logger.logger.log('JS AES decrypt');\n this.logEnabled = false;\n }\n var decryptor = this.decryptor;\n if (!decryptor) {\n this.decryptor = decryptor = new _aesDecryptor2.default();\n }\n decryptor.expandKey(key);\n callback(decryptor.decrypt(data, 0, iv));\n } else {\n if (this.logEnabled) {\n _logger.logger.log('WebCrypto AES decrypt');\n this.logEnabled = false;\n }\n var subtle = this.subtle;\n if (this.key !== key) {\n this.key = key;\n this.fastAesKey = new _fastAesKey2.default(subtle, key);\n }\n\n this.fastAesKey.expandKey().then(function (aesKey) {\n // decrypt using web crypto\n var crypto = new _aesCrypto2.default(subtle, iv);\n crypto.decrypt(data, aesKey).catch(function (err) {\n _this.onWebCryptoError(err, data, key, iv, callback);\n }).then(function (result) {\n callback(result);\n });\n }).catch(function (err) {\n _this.onWebCryptoError(err, data, key, iv, callback);\n });\n }\n }\n }, {\n key: 'onWebCryptoError',\n value: function onWebCryptoError(err, data, key, iv, callback) {\n if (this.config.enableSoftwareAES) {\n _logger.logger.log('WebCrypto Error, disable WebCrypto API');\n this.disableWebCrypto = true;\n this.logEnabled = true;\n this.decrypt(data, key, iv, callback);\n } else {\n _logger.logger.error('decrypting error : ' + err.message);\n this.observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_DECRYPT_ERROR, fatal: true, reason: err.message });\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n var decryptor = this.decryptor;\n if (decryptor) {\n decryptor.destroy();\n this.decryptor = undefined;\n }\n }\n }]);\n\n return Decrypter;\n}();\n\nexports.default = Decrypter;\n\n},{\"17\":17,\"18\":18,\"20\":20,\"33\":33,\"53\":53}],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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar FastAESKey = function () {\n function FastAESKey(subtle, key) {\n _classCallCheck(this, FastAESKey);\n\n this.subtle = subtle;\n this.key = key;\n }\n\n _createClass(FastAESKey, [{\n key: 'expandKey',\n value: function expandKey() {\n return this.subtle.importKey('raw', this.key, { name: 'AES-CBC' }, false, ['encrypt', 'decrypt']);\n }\n }]);\n\n return FastAESKey;\n}();\n\nexports.default = FastAESKey;\n\n},{}],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 * AAC demuxer\n */\n\n\nvar _adts = _dereq_(22);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _logger = _dereq_(53);\n\nvar _id = _dereq_(27);\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, remuxer, config) {\n _classCallCheck(this, AACDemuxer);\n\n this.observer = observer;\n this.config = config;\n this.remuxer = remuxer;\n }\n\n _createClass(AACDemuxer, [{\n key: 'resetInitSegment',\n value: function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {\n this._audioTrack = { container: 'audio/adts', type: 'audio', id: -1, sequenceNumber: 0, isAAC: true, samples: [], len: 0, manifestCodec: audioCodec, duration: duration, inputTimeScale: 90000 };\n }\n }, {\n key: 'resetTimeStamp',\n value: function resetTimeStamp() {}\n }, {\n key: 'append',\n\n\n // feed incoming data to the front of the parsing pipeline\n value: function append(data, timeOffset, contiguous, 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 length,\n aacSample;\n\n track = this._audioTrack;\n\n // Look for ADTS header\n for (offset = id3.length, length = data.length; offset < length - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf6) === 0xf0) {\n break;\n }\n }\n\n if (!track.samplerate) {\n config = _adts2.default.getAudioConfig(this.observer, data, offset, track.manifestCodec);\n track.config = config.config;\n track.samplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.samplerate;\n while (offset + 5 < length) {\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 <= length) {\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 < length - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf6) === 0xf0) {\n break;\n }\n }\n } else {\n break;\n }\n }\n this.remuxer.remux(track, { samples: [] }, { samples: [{ pts: pts, dts: pts, data: id3.payload }], inputTimeScale: 90000 }, { 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 word\n var id3 = new _id2.default(data),\n offset,\n length;\n if (id3.hasTimeStamp) {\n // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1\n // Layer bits (position 14 and 15) in header should be always 0 for ADTS\n // More info https://wiki.multimedia.cx/index.php?title=ADTS\n for (offset = id3.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xf6) === 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},{\"22\":22,\"27\":27,\"53\":53}],22:[function(_dereq_,module,exports){\n'use strict';\n\nvar _logger = _dereq_(53);\n\nvar _errors = _dereq_(33);\n\n/**\n * ADTS parser helper\n */\nvar ADTS = {\n getAudioConfig: 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 manifestCodec = audioCodec,\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: freq less than 24kHz = AAC SBR (HE-AAC)\n if (/firefox/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/Opera ...)\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, manifestCodec: manifestCodec };\n }\n};\n\nmodule.exports = ADTS;\n\n},{\"33\":33,\"53\":53}],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; }; }(); /* inline demuxer.\n * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)\n */\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(33);\n\nvar _decrypter = _dereq_(19);\n\nvar _decrypter2 = _interopRequireDefault(_decrypter);\n\nvar _aacdemuxer = _dereq_(21);\n\nvar _aacdemuxer2 = _interopRequireDefault(_aacdemuxer);\n\nvar _mp4demuxer = _dereq_(29);\n\nvar _mp4demuxer2 = _interopRequireDefault(_mp4demuxer);\n\nvar _tsdemuxer = _dereq_(32);\n\nvar _tsdemuxer2 = _interopRequireDefault(_tsdemuxer);\n\nvar _mp3demuxer = _dereq_(28);\n\nvar _mp3demuxer2 = _interopRequireDefault(_mp3demuxer);\n\nvar _mp4Remuxer = _dereq_(45);\n\nvar _mp4Remuxer2 = _interopRequireDefault(_mp4Remuxer);\n\nvar _passthroughRemuxer = _dereq_(46);\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(observer, typeSupported, config, vendor) {\n _classCallCheck(this, DemuxerInline);\n\n this.observer = observer;\n this.typeSupported = typeSupported;\n this.config = config;\n this.vendor = vendor;\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, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {\n if (data.byteLength > 0 && decryptdata != null && decryptdata.key != null && decryptdata.method === 'AES-128') {\n var decrypter = this.decrypter;\n if (decrypter == null) {\n decrypter = this.decrypter = new _decrypter2.default(this.observer, this.config);\n }\n var localthis = this;\n // performance.now() not available on WebWorker, at least on Safari Desktop\n var startTime;\n try {\n startTime = performance.now();\n } catch (error) {\n startTime = Date.now();\n }\n decrypter.decrypt(data, decryptdata.key.buffer, decryptdata.iv.buffer, function (decryptedData) {\n var endTime;\n try {\n endTime = performance.now();\n } catch (error) {\n endTime = Date.now();\n }\n localthis.observer.trigger(_events2.default.FRAG_DECRYPTED, { stats: { tstart: startTime, tdecrypt: endTime } });\n localthis.pushDecrypted(new Uint8Array(decryptedData), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);\n });\n } else {\n this.pushDecrypted(new Uint8Array(data), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);\n }\n }\n }, {\n key: 'pushDecrypted',\n value: function pushDecrypted(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {\n var demuxer = this.demuxer;\n if (!demuxer ||\n // in case of continuity change, we might switch from content type (AAC container to TS container for example)\n // so let's check that current demuxer is still valid\n discontinuity && !this.probe(data)) {\n var observer = this.observer;\n var typeSupported = this.typeSupported;\n var config = this.config;\n 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 }];\n\n // probe for content type\n for (var i in muxConfig) {\n var mux = muxConfig[i];\n var probe = mux.demux.probe;\n if (probe(data)) {\n var _remuxer = this.remuxer = new mux.remux(observer, config, typeSupported, this.vendor);\n demuxer = new mux.demux(observer, _remuxer, config, typeSupported);\n this.probe = probe;\n break;\n }\n }\n if (!demuxer) {\n 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' });\n return;\n }\n this.demuxer = demuxer;\n }\n var remuxer = this.remuxer;\n\n if (discontinuity || trackSwitch) {\n demuxer.resetInitSegment(initSegment, audioCodec, videoCodec, duration);\n remuxer.resetInitSegment();\n }\n if (discontinuity) {\n demuxer.resetTimeStamp();\n remuxer.resetTimeStamp(defaultInitPTS);\n }\n if (typeof demuxer.setDecryptData === 'function') {\n demuxer.setDecryptData(decryptdata);\n }\n demuxer.append(data, timeOffset, contiguous, accurateTimeOffset);\n }\n }]);\n\n return DemuxerInline;\n}();\n\nexports.default = DemuxerInline;\n\n},{\"19\":19,\"21\":21,\"28\":28,\"29\":29,\"32\":32,\"33\":33,\"35\":35,\"45\":45,\"46\":46}],24:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _demuxerInline = _dereq_(23);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(53);\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.typeSupported, config, data.vendor);\n try {\n (0, _logger.enableLogs)(config.debug === true);\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(data.data, data.decryptdata, data.initSegment, data.audioCodec, data.videoCodec, data.timeOffset, data.discontinuity, data.trackSwitch, data.contiguous, data.duration, data.accurateTimeOffset, data.defaultInitPTS);\n break;\n default:\n break;\n }\n });\n\n // forward events to main thread\n observer.on(_events2.default.FRAG_DECRYPTED, forwardMessage);\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 observer.on(_events2.default.INIT_PTS_FOUND, 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 transferable = [];\n var message = { event: ev, data: data };\n if (data.data1) {\n message.data1 = data.data1.buffer;\n transferable.push(data.data1.buffer);\n delete data.data1;\n }\n if (data.data2) {\n message.data2 = data.data2.buffer;\n transferable.push(data.data2.buffer);\n delete data.data2;\n }\n self.postMessage(message, transferable);\n });\n};\n\nexports.default = DemuxerWorker;\n\n},{\"1\":1,\"23\":23,\"35\":35,\"53\":53}],25:[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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _demuxerInline = _dereq_(23);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _demuxerWorker = _dereq_(24);\n\nvar _demuxerWorker2 = _interopRequireDefault(_demuxerWorker);\n\nvar _logger = _dereq_(53);\n\nvar _errors = _dereq_(33);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\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 // observer setup\n var observer = this.observer = new _events4.default();\n var config = hls.config;\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 (ev, data) {\n data = data || {};\n data.frag = this.frag;\n data.id = this.id;\n hls.trigger(ev, data);\n }.bind(this);\n\n // forward events to main thread\n observer.on(_events2.default.FRAG_DECRYPTED, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_DATA, 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 observer.on(_events2.default.INIT_PTS_FOUND, forwardMessage);\n\n var typeSupported = {\n mp4: MediaSource.isTypeSupported('video/mp4'),\n mpeg: MediaSource.isTypeSupported('audio/mpeg'),\n mp3: MediaSource.isTypeSupported('audio/mp4; codecs=\"mp3\"')\n };\n // navigator.vendor is not always available in Web Worker\n // refer to https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/navigator\n var vendor = navigator.vendor;\n if (config.enableWorker && typeof Worker !== 'undefined') {\n _logger.logger.log('demuxing in webworker');\n var w = void 0;\n try {\n var work = _dereq_(3);\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, vendor: vendor, id: id, config: JSON.stringify(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(observer, typeSupported, config, vendor);\n this.w = undefined;\n }\n } else {\n this.demuxer = new _demuxerInline2.default(observer, typeSupported, config, vendor);\n }\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 observer = this.observer;\n if (observer) {\n observer.removeAllListeners();\n this.observer = null;\n }\n }\n }, {\n key: 'push',\n value: function push(data, initSegment, audioCodec, videoCodec, frag, duration, accurateTimeOffset, defaultInitPTS) {\n var w = this.w;\n var timeOffset = !isNaN(frag.startDTS) ? frag.startDTS : frag.start;\n var decryptdata = frag.decryptdata;\n var lastFrag = this.frag;\n var discontinuity = !(lastFrag && frag.cc === lastFrag.cc);\n var trackSwitch = !(lastFrag && frag.level === lastFrag.level);\n var nextSN = lastFrag && frag.sn === lastFrag.sn + 1;\n var contiguous = !trackSwitch && nextSN;\n if (discontinuity) {\n _logger.logger.log(this.id + ':discontinuity detected');\n }\n if (trackSwitch) {\n _logger.logger.log(this.id + ':switch detected');\n }\n this.frag = frag;\n if (w) {\n // post fragment payload as transferable objects (no copy)\n 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]);\n } else {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);\n }\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 if (data.data2) {\n data.data.data2 = new Uint8Array(data.data2);\n }\n /* falls through */\n default:\n data.data = data.data || {};\n data.data.frag = this.frag;\n data.data.id = this.id;\n hls.trigger(data.event, data.data);\n break;\n }\n }\n }]);\n\n return Demuxer;\n}();\n\nexports.default = Demuxer;\n\n},{\"1\":1,\"23\":23,\"24\":24,\"3\":3,\"33\":33,\"35\":35,\"53\":53}],26:[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_(53);\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 = 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 data = this.data,\n bytesAvailable = this.bytesAvailable,\n position = data.byteLength - bytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, bytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(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 profileIdc,\n profileCompat,\n levelIdc,\n numRefFramesInPicOrderCntCycle,\n picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n i,\n readUByte = this.readUByte.bind(this),\n readBits = this.readBits.bind(this),\n readUEG = this.readUEG.bind(this),\n readBoolean = this.readBoolean.bind(this),\n skipBits = this.skipBits.bind(this),\n skipEG = this.skipEG.bind(this),\n skipUEG = this.skipUEG.bind(this),\n skipScalingList = this.skipScalingList.bind(this);\n\n readUByte();\n profileIdc = readUByte(); // profile_idc\n profileCompat = readBits(5); // constraint_set[0-4]_flag, u(5)\n skipBits(3); // reserved_zero_3bits u(3),\n levelIdc = readUByte(); //level_idc u(8)\n 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 = readUEG();\n if (chromaFormatIdc === 3) {\n skipBits(1); // separate_colour_plane_flag\n }\n skipUEG(); // bit_depth_luma_minus8\n skipUEG(); // bit_depth_chroma_minus8\n skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (readBoolean()) {\n // seq_scaling_matrix_present_flag\n scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (readBoolean()) {\n // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16);\n } else {\n skipScalingList(64);\n }\n }\n }\n }\n }\n skipUEG(); // log2_max_frame_num_minus4\n var picOrderCntType = readUEG();\n if (picOrderCntType === 0) {\n readUEG(); //log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n skipBits(1); // delta_pic_order_always_zero_flag\n skipEG(); // offset_for_non_ref_pic\n skipEG(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = readUEG();\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n skipEG(); // offset_for_ref_frame[ i ]\n }\n }\n skipUEG(); // max_num_ref_frames\n skipBits(1); // gaps_in_frame_num_value_allowed_flag\n picWidthInMbsMinus1 = readUEG();\n picHeightInMapUnitsMinus1 = readUEG();\n frameMbsOnlyFlag = readBits(1);\n if (frameMbsOnlyFlag === 0) {\n skipBits(1); // mb_adaptive_frame_field_flag\n }\n skipBits(1); // direct_8x8_inference_flag\n if (readBoolean()) {\n // frame_cropping_flag\n frameCropLeftOffset = readUEG();\n frameCropRightOffset = readUEG();\n frameCropTopOffset = readUEG();\n frameCropBottomOffset = readUEG();\n }\n var pixelRatio = [1, 1];\n if (readBoolean()) {\n // vui_parameters_present_flag\n if (readBoolean()) {\n // aspect_ratio_info_present_flag\n var aspectRatioIdc = readUByte();\n switch (aspectRatioIdc) {\n case 1:\n pixelRatio = [1, 1];break;\n case 2:\n pixelRatio = [12, 11];break;\n case 3:\n pixelRatio = [10, 11];break;\n case 4:\n pixelRatio = [16, 11];break;\n case 5:\n pixelRatio = [40, 33];break;\n case 6:\n pixelRatio = [24, 11];break;\n case 7:\n pixelRatio = [20, 11];break;\n case 8:\n pixelRatio = [32, 11];break;\n case 9:\n pixelRatio = [80, 33];break;\n case 10:\n pixelRatio = [18, 11];break;\n case 11:\n pixelRatio = [15, 11];break;\n case 12:\n pixelRatio = [64, 33];break;\n case 13:\n pixelRatio = [160, 99];break;\n case 14:\n pixelRatio = [4, 3];break;\n case 15:\n pixelRatio = [3, 2];break;\n case 16:\n pixelRatio = [2, 1];break;\n case 255:\n {\n pixelRatio = [readUByte() << 8 | readUByte(), readUByte() << 8 | readUByte()];\n break;\n }\n }\n }\n }\n return {\n width: Math.ceil((picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2),\n height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - (frameMbsOnlyFlag ? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset),\n pixelRatio: pixelRatio\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},{\"53\":53}],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 * ID3 parser\n */\n\n\nvar _logger = _dereq_(53);\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 this._length = 0;\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},{\"53\":53}],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 * MP3 demuxer\n */\n\n\nvar _id = _dereq_(27);\n\nvar _id2 = _interopRequireDefault(_id);\n\nvar _mpegaudio = _dereq_(30);\n\nvar _mpegaudio2 = _interopRequireDefault(_mpegaudio);\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 MP3Demuxer = function () {\n function MP3Demuxer(observer, remuxer, config) {\n _classCallCheck(this, MP3Demuxer);\n\n this.observer = observer;\n this.config = config;\n this.remuxer = remuxer;\n }\n\n _createClass(MP3Demuxer, [{\n key: 'resetInitSegment',\n value: function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {\n this._audioTrack = { container: 'audio/mpeg', type: 'audio', id: -1, sequenceNumber: 0, isAAC: false, samples: [], len: 0, manifestCodec: audioCodec, duration: duration, inputTimeScale: 90000 };\n }\n }, {\n key: 'resetTimeStamp',\n value: function resetTimeStamp() {}\n }, {\n key: 'append',\n\n\n // feed incoming data to the front of the parsing pipeline\n value: function append(data, timeOffset, contiguous, accurateTimeOffset) {\n var id3 = new _id2.default(data);\n var pts = 90 * id3.timeStamp;\n var afterID3 = id3.length;\n var offset, length;\n\n // Look for MPEG header\n for (offset = afterID3, length = data.length; offset < length - 1; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xe0) === 0xe0 && (data[offset + 1] & 0x06) !== 0x00) {\n break;\n }\n }\n\n _mpegaudio2.default.parse(this._audioTrack, data, id3.length, pts);\n\n this.remuxer.remux(this._audioTrack, { samples: [] }, { samples: [{ pts: pts, dts: pts, data: id3.payload }], inputTimeScale: 90000 }, { 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 MPEG sync word\n var id3 = new _id2.default(data),\n offset,\n length;\n if (id3.hasTimeStamp) {\n // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1\n // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)\n // More info http://www.mp3-tech.org/programmer/frame_header.html\n for (offset = id3.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {\n if (data[offset] === 0xff && (data[offset + 1] & 0xe0) === 0xe0 && (data[offset + 1] & 0x06) !== 0x00) {\n //logger.log('MPEG sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n }]);\n\n return MP3Demuxer;\n}();\n\nexports.default = MP3Demuxer;\n\n},{\"27\":27,\"30\":30}],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 * MP4 demuxer\n */\n//import {logger} from '../utils/logger';\n\n\nvar _events = _dereq_(35);\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 MP4Demuxer = function () {\n function MP4Demuxer(observer, remuxer) {\n _classCallCheck(this, MP4Demuxer);\n\n this.observer = observer;\n this.remuxer = remuxer;\n }\n\n _createClass(MP4Demuxer, [{\n key: 'resetTimeStamp',\n value: function resetTimeStamp() {}\n }, {\n key: 'resetInitSegment',\n value: function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {\n //jshint unused:false\n var initData = this.initData = MP4Demuxer.parseInitSegment(initSegment);\n var tracks = {};\n if (initData.audio) {\n tracks.audio = { container: 'audio/mp4', codec: audioCodec, initSegment: initSegment };\n }\n if (initData.video) {\n tracks.video = { container: 'video/mp4', codec: videoCodec, initSegment: initSegment };\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, { tracks: tracks });\n }\n }, {\n key: 'append',\n\n\n // feed incoming data to the front of the parsing pipeline\n value: function append(data, timeOffset, contiguous, accurateTimeOffset) {\n var initData = this.initData;\n var startDTS = MP4Demuxer.startDTS(initData, data);\n this.remuxer.remux(initData.audio, initData.video, null, null, startDTS, contiguous, accurateTimeOffset, data);\n }\n }, {\n key: 'destroy',\n value: function destroy() {}\n }], [{\n key: 'probe',\n value: function probe(data) {\n if (data.length >= 8) {\n var dataType = MP4Demuxer.bin2str(data.subarray(4, 8));\n return ['moof', 'ftyp', 'styp'].indexOf(dataType) >= 0;\n }\n return false;\n }\n }, {\n key: 'bin2str',\n value: function bin2str(buffer) {\n return String.fromCharCode.apply(null, buffer);\n }\n }, {\n key: 'readUint32',\n value: function readUint32(buffer, offset) {\n var val = buffer[offset] << 24 | buffer[offset + 1] << 16 | buffer[offset + 2] << 8 | buffer[offset + 3];\n return val < 0 ? 4294967296 + val : val;\n }\n\n // Find the data for a box specified by its path\n\n }, {\n key: 'findBox',\n value: function findBox(data, path) {\n var results = [],\n i,\n size,\n type,\n end,\n subresults;\n\n if (!path.length) {\n // short-circuit the search for empty paths\n return null;\n }\n\n for (i = 0; i < data.byteLength;) {\n size = MP4Demuxer.readUint32(data, i);\n type = MP4Demuxer.bin2str(data.subarray(i + 4, i + 8));\n\n end = size > 1 ? i + size : data.byteLength;\n\n if (type === path[0]) {\n if (path.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push(data.subarray(i + 8, end));\n } else {\n // recursively search for the next box along the path\n subresults = MP4Demuxer.findBox(data.subarray(i + 8, end), path.slice(1));\n if (subresults.length) {\n results = results.concat(subresults);\n }\n }\n }\n i = end;\n }\n\n // we've finished searching all of data\n return results;\n }\n\n /**\n * Parses an MP4 initialization segment and extracts stream type and\n * timescale values for any declared tracks. Timescale values indicate the\n * number of clock ticks per second to assume for time-based values\n * elsewhere in the MP4.\n *\n * To determine the start time of an MP4, you need two pieces of\n * information: the timescale unit and the earliest base media decode\n * time. Multiple timescales can be specified within an MP4 but the\n * base media decode time is always expressed in the timescale from\n * the media header box for the track:\n * ```\n * moov > trak > mdia > mdhd.timescale\n * moov > trak > mdia > hdlr\n * ```\n * @param init {Uint8Array} the bytes of the init segment\n * @return {object} a hash of track type to timescale values or null if\n * the init segment is malformed.\n */\n\n }, {\n key: 'parseInitSegment',\n value: function parseInitSegment(initSegment) {\n var result = [];\n var traks = MP4Demuxer.findBox(initSegment, ['moov', 'trak']);\n\n traks.forEach(function (trak) {\n var tkhd = MP4Demuxer.findBox(trak, ['tkhd'])[0];\n if (tkhd) {\n var version = tkhd[0];\n var index = version === 0 ? 12 : 20;\n var trackId = MP4Demuxer.readUint32(tkhd, index);\n\n var mdhd = MP4Demuxer.findBox(trak, ['mdia', 'mdhd'])[0];\n if (mdhd) {\n version = mdhd[0];\n index = version === 0 ? 12 : 20;\n var timescale = MP4Demuxer.readUint32(mdhd, index);\n\n var hdlr = MP4Demuxer.findBox(trak, ['mdia', 'hdlr'])[0];\n if (hdlr) {\n var hdlrType = MP4Demuxer.bin2str(hdlr.subarray(8, 12));\n var type = { 'soun': 'audio', 'vide': 'video' }[hdlrType];\n if (type) {\n result[trackId] = { timescale: timescale, type: type };\n result[type] = { timescale: timescale, id: trackId };\n }\n }\n }\n }\n });\n return result;\n }\n\n /**\n * Determine the base media decode start time, in seconds, for an MP4\n * fragment. If multiple fragments are specified, the earliest time is\n * returned.\n *\n * The base media decode time can be parsed from track fragment\n * metadata:\n * ```\n * moof > traf > tfdt.baseMediaDecodeTime\n * ```\n * It requires the timescale value from the mdhd to interpret.\n *\n * @param timescale {object} a hash of track ids to timescale values.\n * @return {number} the earliest base media decode start time for the\n * fragment, in seconds\n */\n\n }, {\n key: 'startDTS',\n value: function startDTS(initData, fragment) {\n var trafs, baseTimes, result;\n\n // we need info from two childrend of each track fragment box\n trafs = MP4Demuxer.findBox(fragment, ['moof', 'traf']);\n\n // determine the start times for each track\n baseTimes = [].concat.apply([], trafs.map(function (traf) {\n return MP4Demuxer.findBox(traf, ['tfhd']).map(function (tfhd) {\n var id, scale, baseTime;\n\n // get the track id from the tfhd\n id = MP4Demuxer.readUint32(tfhd, 4);\n // assume a 90kHz clock if no timescale was specified\n scale = initData[id].timescale || 90e3;\n\n // get the base media decode time from the tfdt\n baseTime = MP4Demuxer.findBox(traf, ['tfdt']).map(function (tfdt) {\n var version, result;\n\n version = tfdt[0];\n result = MP4Demuxer.readUint32(tfdt, 4);\n if (version === 1) {\n result *= Math.pow(2, 32);\n\n result += MP4Demuxer.readUint32(tfdt, 8);\n }\n return result;\n })[0];\n baseTime = baseTime || Infinity;\n\n // convert base time to seconds\n return baseTime / scale;\n });\n }));\n\n // return the minimum\n result = Math.min.apply(null, baseTimes);\n return isFinite(result) ? result : 0;\n }\n }]);\n\n return MP4Demuxer;\n}();\n\nexports.default = MP4Demuxer;\n\n},{\"35\":35}],30:[function(_dereq_,module,exports){\n'use strict';\n\nvar _logger = _dereq_(53);\n\nvar MpegAudio = {\n\n onFrame: function onFrame(track, data, bitRate, sampleRate, channelCount, frameIndex, pts) {\n var frameDuration = 1152 * 90000 / sampleRate;\n var stamp = pts + frameIndex * frameDuration;\n\n track.config = [];\n track.channelCount = channelCount;\n track.samplerate = sampleRate;\n track.samples.push({ unit: data, pts: stamp, dts: stamp });\n track.len += data.length;\n },\n\n onNoise: function onNoise(data) {\n _logger.logger.warn('mpeg audio has noise: ' + data.length + ' bytes');\n },\n\n parseFrames: function parseFrames(track, data, start, end, frameIndex, pts) {\n 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];\n var SamplingRateMap = [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000];\n\n if (start + 2 > end) {\n return -1; // we need at least 2 bytes to detect sync pattern\n }\n if (data[start] === 0xFF || (data[start + 1] & 0xE0) === 0xE0) {\n // Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference\n if (start + 24 > end) {\n return -1;\n }\n var headerB = data[start + 1] >> 3 & 3;\n var headerC = data[start + 1] >> 1 & 3;\n var headerE = data[start + 2] >> 4 & 15;\n var headerF = data[start + 2] >> 2 & 3;\n var headerG = !!(data[start + 2] & 2);\n if (headerB !== 1 && headerE !== 0 && headerE !== 15 && headerF !== 3) {\n var columnInBitrates = headerB === 3 ? 3 - headerC : headerC === 3 ? 3 : 4;\n var bitRate = BitratesMap[columnInBitrates * 14 + headerE - 1] * 1000;\n var columnInSampleRates = headerB === 3 ? 0 : headerB === 2 ? 1 : 2;\n var sampleRate = SamplingRateMap[columnInSampleRates * 3 + headerF];\n var padding = headerG ? 1 : 0;\n var channelCount = data[start + 3] >> 6 === 3 ? 1 : 2; // If bits of channel mode are `11` then it is a single channel (Mono)\n var frameLength = headerC === 3 ? (headerB === 3 ? 12 : 6) * bitRate / sampleRate + padding << 2 : (headerB === 3 ? 144 : 72) * bitRate / sampleRate + padding | 0;\n if (start + frameLength > end) {\n return -1;\n }\n\n this.onFrame(track, data.subarray(start, start + frameLength), bitRate, sampleRate, channelCount, frameIndex, pts);\n\n return frameLength;\n }\n }\n // noise or ID3, trying to skip\n var offset = start + 2;\n while (offset < end) {\n if (data[offset - 1] === 0xFF && (data[offset] & 0xE0) === 0xE0) {\n // sync pattern is found\n this.onNoise(data.subarray(start, offset - 1));\n\n return offset - start - 1;\n }\n offset++;\n }\n return -1;\n },\n\n parse: function parse(track, data, offset, pts) {\n var length = data.length;\n var frameIndex = 0;\n var parsed;\n\n while (offset < length && (parsed = this.parseFrames(track, data, offset, length, frameIndex++, pts)) > 0) {\n offset += parsed;\n }\n }\n}; /**\n * MPEG parser helper\n */\n\n\nmodule.exports = MpegAudio;\n\n},{\"53\":53}],31:[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 * SAMPLE-AES decrypter\n */\n\nvar _decrypter = _dereq_(19);\n\nvar _decrypter2 = _interopRequireDefault(_decrypter);\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 SampleAesDecrypter = function () {\n function SampleAesDecrypter(observer, config, decryptdata, discardEPB) {\n _classCallCheck(this, SampleAesDecrypter);\n\n this.decryptdata = decryptdata;\n this.discardEPB = discardEPB;\n this.decrypter = new _decrypter2.default(observer, config);\n }\n\n _createClass(SampleAesDecrypter, [{\n key: 'decryptBuffer',\n value: function decryptBuffer(encryptedData, callback) {\n this.decrypter.decrypt(encryptedData, this.decryptdata.key.buffer, this.decryptdata.iv.buffer, callback);\n }\n\n // AAC - encrypt all full 16 bytes blocks starting from offset 16\n\n }, {\n key: 'decryptAacSample',\n value: function decryptAacSample(samples, sampleIndex, callback, sync) {\n var curUnit = samples[sampleIndex].unit;\n var encryptedData = curUnit.subarray(16, curUnit.length - curUnit.length % 16);\n var encryptedBuffer = encryptedData.buffer.slice(encryptedData.byteOffset, encryptedData.byteOffset + encryptedData.length);\n\n var localthis = this;\n this.decryptBuffer(encryptedBuffer, function (decryptedData) {\n decryptedData = new Uint8Array(decryptedData);\n curUnit.set(decryptedData, 16);\n\n if (!sync) {\n localthis.decryptAacSamples(samples, sampleIndex + 1, callback);\n }\n });\n }\n }, {\n key: 'decryptAacSamples',\n value: function decryptAacSamples(samples, sampleIndex, callback) {\n for (;; sampleIndex++) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n\n if (samples[sampleIndex].unit.length < 32) {\n continue;\n }\n\n var sync = this.decrypter.isSync();\n\n this.decryptAacSample(samples, sampleIndex, callback, sync);\n\n if (!sync) {\n return;\n }\n }\n }\n\n // AVC - encrypt one 16 bytes block out of ten, starting from offset 32\n\n }, {\n key: 'getAvcEncryptedData',\n value: function getAvcEncryptedData(decodedData) {\n var encryptedDataLen = Math.floor((decodedData.length - 48) / 160) * 16 + 16;\n var encryptedData = new Int8Array(encryptedDataLen);\n var outputPos = 0;\n for (var inputPos = 32; inputPos <= decodedData.length - 16; inputPos += 160, outputPos += 16) {\n encryptedData.set(decodedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return encryptedData;\n }\n }, {\n key: 'getAvcDecryptedUnit',\n value: function getAvcDecryptedUnit(decodedData, decryptedData) {\n decryptedData = new Uint8Array(decryptedData);\n var inputPos = 0;\n for (var outputPos = 32; outputPos <= decodedData.length - 16; outputPos += 160, inputPos += 16) {\n decodedData.set(decryptedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return decodedData;\n }\n }, {\n key: 'decryptAvcSample',\n value: function decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync) {\n var decodedData = this.discardEPB(curUnit.data);\n var encryptedData = this.getAvcEncryptedData(decodedData);\n var localthis = this;\n\n this.decryptBuffer(encryptedData.buffer, function (decryptedData) {\n curUnit.data = localthis.getAvcDecryptedUnit(decodedData, decryptedData);\n\n if (!sync) {\n localthis.decryptAvcSamples(samples, sampleIndex, unitIndex + 1, callback);\n }\n });\n }\n }, {\n key: 'decryptAvcSamples',\n value: function decryptAvcSamples(samples, sampleIndex, unitIndex, callback) {\n for (;; sampleIndex++, unitIndex = 0) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n\n var curUnits = samples[sampleIndex].units;\n for (;; unitIndex++) {\n if (unitIndex >= curUnits.length) {\n break;\n }\n\n var curUnit = curUnits[unitIndex];\n if (curUnit.length <= 48 || curUnit.type !== 1 && curUnit.type !== 5) {\n continue;\n }\n\n var sync = this.decrypter.isSync();\n\n this.decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync);\n\n if (!sync) {\n return;\n }\n }\n }\n }\n }]);\n\n return SampleAesDecrypter;\n}();\n\nexports.default = SampleAesDecrypter;\n\n},{\"19\":19}],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 * 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_(22);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _mpegaudio = _dereq_(30);\n\nvar _mpegaudio2 = _interopRequireDefault(_mpegaudio);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _expGolomb = _dereq_(26);\n\nvar _expGolomb2 = _interopRequireDefault(_expGolomb);\n\nvar _sampleAes = _dereq_(31);\n\nvar _sampleAes2 = _interopRequireDefault(_sampleAes);\n\nvar _logger = _dereq_(53);\n\nvar _errors = _dereq_(33);\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, remuxer, config, typeSupported) {\n _classCallCheck(this, TSDemuxer);\n\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n this.remuxer = remuxer;\n this.sampleAes = null;\n }\n\n _createClass(TSDemuxer, [{\n key: 'setDecryptData',\n value: function setDecryptData(decryptdata) {\n if (decryptdata != null && decryptdata.key != null && decryptdata.method === 'SAMPLE-AES') {\n this.sampleAes = new _sampleAes2.default(this.observer, this.config, decryptdata, this.discardEPB);\n } else {\n this.sampleAes = null;\n }\n }\n }, {\n key: 'resetInitSegment',\n value: function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {\n this.pmtParsed = false;\n this._pmtId = -1;\n this._avcTrack = { container: 'video/mp2t', type: 'video', id: -1, inputTimeScale: 90000, sequenceNumber: 0, samples: [], len: 0, dropped: 0 };\n this._audioTrack = { container: 'video/mp2t', type: 'audio', id: -1, inputTimeScale: 90000, duration: duration, sequenceNumber: 0, samples: [], len: 0, isAAC: true };\n this._id3Track = { type: 'id3', id: -1, inputTimeScale: 90000, sequenceNumber: 0, samples: [], len: 0 };\n this._txtTrack = { type: 'text', id: -1, inputTimeScale: 90000, sequenceNumber: 0, samples: [], len: 0 };\n // flush any partial content\n this.aacOverFlow = null;\n this.aacLastPTS = null;\n this.avcSample = null;\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this._duration = duration;\n }\n }, {\n key: 'resetTimeStamp',\n value: function resetTimeStamp() {}\n\n // feed incoming data to the front of the parsing pipeline\n\n }, {\n key: 'append',\n value: function append(data, timeOffset, contiguous, accurateTimeOffset) {\n var start,\n len = data.length,\n stt,\n pid,\n atf,\n offset,\n pes,\n unknownPIDs = false;\n this.contiguous = contiguous;\n var pmtParsed = this.pmtParsed,\n avcTrack = this._avcTrack,\n audioTrack = this._audioTrack,\n id3Track = this._id3Track,\n avcId = avcTrack.id,\n audioId = audioTrack.id,\n id3Id = id3Track.id,\n pmtId = this._pmtId,\n avcData = avcTrack.pesData,\n audioData = audioTrack.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 parseMPEGPES = this._parseMPEGPES.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 }\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 audioId:\n if (stt) {\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n }\n audioData = { data: [], size: 0 };\n }\n if (audioData) {\n audioData.data.push(data.subarray(offset, start + 188));\n audioData.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, this.typeSupported.mpeg === true || this.typeSupported.mp3 === true, this.sampleAes != null);\n\n // only update track id if track PID found while parsing PMT\n // this is to avoid resetting the PID to -1 in case\n // track PID transiently disappears from the stream\n // this could happen in case of transient missing audio samples for example\n avcId = parsedPIDs.avc;\n if (avcId > 0) {\n avcTrack.id = avcId;\n }\n audioId = parsedPIDs.audio;\n if (audioId > 0) {\n audioTrack.id = audioId;\n audioTrack.isAAC = parsedPIDs.isAAC;\n }\n id3Id = parsedPIDs.id3;\n if (id3Id > 0) {\n id3Track.id = id3Id;\n }\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, 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 (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n audioTrack.pesData = null;\n } else {\n if (audioData && audioData.size) {\n _logger.logger.log('last AAC PES packet truncated,might overlap between fragments');\n }\n // either audioData null or PES truncated, keep it for next frag parsing\n audioTrack.pesData = audioData;\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\n if (this.sampleAes == null) {\n this.remuxer.remux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);\n } else {\n this.decryptAndRemux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n }, {\n key: 'decryptAndRemux',\n value: function decryptAndRemux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n if (audioTrack.samples && audioTrack.isAAC) {\n var localthis = this;\n this.sampleAes.decryptAacSamples(audioTrack.samples, 0, function () {\n localthis.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n });\n } else {\n this.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n }, {\n key: 'decryptAndRemuxAvc',\n value: function decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n if (videoTrack.samples) {\n var localthis = this;\n this.sampleAes.decryptAvcSamples(videoTrack.samples, 0, 0, function () {\n localthis.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n });\n } else {\n this.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\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, mpegSupported, isSampleAes) {\n var sectionLength,\n tableEnd,\n programInfoLength,\n pid,\n result = { audio: -1, avc: -1, id3: -1, isAAC: true };\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 case 0xcf:\n // SAMPLE-AES AAC\n if (!isSampleAes) {\n _logger.logger.log('unkown stream type:' + data[offset]);\n break;\n }\n /* falls through */\n\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.audio === -1) {\n result.audio = pid;\n }\n break;\n\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\n case 0xdb:\n // SAMPLE-AES AVC\n if (!isSampleAes) {\n _logger.logger.log('unkown stream type:' + data[offset]);\n break;\n }\n /* falls through */\n\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\n // ISO/IEC 11172-3 (MPEG-1 audio)\n // or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)\n case 0x03:\n case 0x04:\n //logger.log('MPEG PID:' + pid);\n if (!mpegSupported) {\n _logger.logger.log('MPEG audio found, not supported in this browser for now');\n } else if (result.audio === -1) {\n result.audio = pid;\n result.isAAC = false;\n }\n break;\n\n case 0x24:\n _logger.logger.warn('HEVC stream type found, not supported for now');\n break;\n\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 parsed length is not zero and greater than total received length, 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 if (pesPts - pesDts > 60 * 90000) {\n _logger.logger.warn(Math.round((pesPts - pesDts) / 90000) + 's delta between PTS and DTS, align them');\n pesPts = pesDts;\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 for (var j = 0, dataLen = data.length; j < dataLen; j++) {\n frag = data[j];\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.length && avcSample.frame) {\n var samples = avcTrack.samples;\n var nbSamples = samples.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 && (nbSamples || this.contiguous)) {\n avcSample.id = nbSamples;\n 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);\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 avcSample.frame = true;\n // retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR\n var data = unit.data;\n if (data.length > 4) {\n var sliceType = new _expGolomb2.default(data).readSliceType();\n // 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice\n // SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.\n // An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.\n // I slice: A slice that is not an SI slice that is decoded using intra prediction only.\n //if (sliceType === 2 || sliceType === 7) {\n if (sliceType === 2 || sliceType === 4 || sliceType === 7 || sliceType === 9) {\n avcSample.key = true;\n }\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 avcSample.frame = 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.pixelRatio = config.pixelRatio;\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.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: [], 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.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;\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\n if (state === -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 = array[0] & 0x1f;\n state = 0;\n i = 1;\n }\n\n while (i < len) {\n value = array[i++];\n // optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case\n if (!state) {\n state = value ? 0 : 1;\n continue;\n }\n if (state === 1) {\n state = value ? 0 : 2;\n continue;\n }\n // here we have state either equal to 2 or 3\n if (!value) {\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 }\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._audioTrack,\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, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason });\n if (fatal) {\n return;\n }\n }\n if (!track.samplerate) {\n var audioCodec = this.audioCodec;\n config = _adts2.default.getAudioConfig(this.observer, data, offset, audioCodec);\n track.config = config.config;\n track.samplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.samplerate;\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: '_parseMPEGPES',\n value: function _parseMPEGPES(pes) {\n _mpegaudio2.default.parse(this._audioTrack, pes.data, 0, pes.pts);\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},{\"22\":22,\"26\":26,\"30\":30,\"31\":31,\"33\":33,\"35\":35,\"53\":53}],33:[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 a mux Error (demuxing/remuxing)\n MUX_ERROR: 'muxError',\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: {id : demuxer Id,frag: fragment object, reason : parsing error description }\n FRAG_DECRYPT_ERROR: 'fragDecryptError',\n // Identifier for a fragment parsing error event - data: { id : demuxer Id, reason : parsing error description }\n // will be renamed DEMUX_PARSING_ERROR and switched to MUX_ERROR in the next major release\n FRAG_PARSING_ERROR: 'fragParsingError',\n // 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 }\n REMUX_ALLOC_ERROR: 'remuxAllocError',\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 a buffer nudge on stall (playback is stuck although currentTime is in a buffered area)\n BUFFER_NUDGE_ON_STALL: 'bufferNudgeOnStall',\n // Identifier for an internal exception happening inside hls.js while handling an event\n INTERNAL_EXCEPTION: 'internalException',\n // Malformed WebVTT contents\n WEBVTT_EXCEPTION: 'webVTTException'\n};\n\n},{}],34:[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 && obj !== Symbol.prototype ? \"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_(53);\n\nvar _errors = _dereq_(33);\n\nvar _events = _dereq_(35);\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},{\"33\":33,\"35\":35,\"53\":53}],35:[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 reset - data: { }\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, pending : nb of segments waiting for appending for this segment parent}\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 - 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 buffer has been flushed - data: { }\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 switch is requested - data: { level : id of new level } // deprecated in favor LEVEL_SWITCHING\n LEVEL_SWITCH: 'hlsLevelSwitch',\n // fired when a level switch is requested - data: { level : id of new level }\n LEVEL_SWITCHING: 'hlsLevelSwitching',\n // fired when a level switch is effective - data: { level : id of new level }\n LEVEL_SWITCHED: 'hlsLevelSwitched',\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 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 } // deprecated in favor AUDIO_TRACK_SWITCHING\n AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',\n // fired when an audio track switching is requested - data: { id : audio track id }\n AUDIO_TRACK_SWITCHING: 'hlsAudioTrackSwitching',\n // fired when an audio track switch actually occurs - data: { id : audio track id }\n AUDIO_TRACK_SWITCHED: 'hlsAudioTrackSwitched',\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 to notify that subtitle track lists has been updated - data: { subtitleTracks : subtitleTracks }\n SUBTITLE_TRACKS_UPDATED: 'hlsSubtitleTracksUpdated',\n // fired when an subtitle track switch occurs - data: { id : subtitle track id }\n SUBTITLE_TRACK_SWITCH: 'hlsSubtitleTrackSwitch',\n // fired when a subtitle track loading starts - data: { url : subtitle track URL, id : subtitle track id }\n SUBTITLE_TRACK_LOADING: 'hlsSubtitleTrackLoading',\n // fired when a subtitle track loading finishes - data: { details : levelDetails object, id : subtitle track id, stats : { trequest, tfirst, tload, mtime } }\n SUBTITLE_TRACK_LOADED: 'hlsSubtitleTrackLoaded',\n // fired when a subtitle fragment has been processed - data: { success : boolean, frag : the processed frag }\n SUBTITLE_FRAG_PROCESSED: 'hlsSubtitleFragProcessed',\n // fired when the first timestamp is found - data: { id : demuxer id, initPTS: initPTS, frag : fragment object }\n INIT_PTS_FOUND: 'hlsInitPtsFound',\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 a fragment has finished decrypting - data: { id : demuxer id, frag: fragment object, stats : { tstart, tdecrypt } }\n FRAG_DECRYPTED: 'hlsFragDecrypted',\n // 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 }\n FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',\n // fired when parsing sei text is completed - data: { id : demuxer id, frag: fragment object, samples : [ sei samples pes ] }\n FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',\n // fired when parsing id3 is completed - data: { id : demuxer id, frag: fragment object, samples : [ id3 samples pes ] }\n FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',\n // 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}\n FRAG_PARSING_DATA: 'hlsFragParsingData',\n // fired when fragment parsing is completed - data: { id : demuxer id, frag: fragment object }\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, bwEstimate } }\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 - data: { }\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},{}],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\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(codec, channelCount) {\n switch (codec) {\n case 'mp4a.40.2':\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 break;\n // handle HE-AAC below (mp4a.40.5 / mp4a.40.29)\n default:\n if (channelCount === 1) {\n // 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\n 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]);\n } else if (channelCount === 2) {\n // 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\n 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]);\n } else if (channelCount === 3) {\n // 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\n 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]);\n }\n break;\n }\n return null;\n }\n }]);\n\n return AAC;\n}();\n\nexports.default = AAC;\n\n},{}],37:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * Buffer Helper utils, providing methods dealing buffer length retrieval\n*/\n\nvar BufferHelper = {\n isBuffered: 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 bufferInfo: 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: pos, end: pos, nextStart: undefined };\n }\n },\n\n bufferedInfo: 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\nmodule.exports = BufferHelper;\n\n},{}],38:[function(_dereq_,module,exports){\n'use strict';\n\nvar _logger = _dereq_(53);\n\nvar LevelHelper = {\n\n mergeDetails: 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 newFrag.backtracked = oldFrag.backtracked;\n newFrag.dropped = oldFrag.dropped;\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, 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 updateFragPTSDTS: function updateFragPTSDTS(details, frag, startPTS, endPTS, startDTS, endDTS) {\n // update frag PTS/DTS\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 frag.start = frag.startPTS = startPTS;\n frag.endPTS = endPTS;\n frag.startDTS = startDTS;\n frag.endDTS = endDTS;\n frag.duration = endPTS - startPTS;\n\n var sn = frag.sn;\n // exit if sn out of range\n if (!details || sn < details.startSN || sn > details.endSN) {\n return 0;\n }\n var fragIdx, fragments, i;\n fragIdx = sn - details.startSN;\n fragments = details.fragments;\n frag = fragments[fragIdx];\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 updatePTS: 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 = Math.max(fragFrom.start - fragTo.duration, 0);\n }\n }\n }\n}; /**\n * Level Helper class, providing methods dealing with playlist sliding and drift\n */\n\nmodule.exports = LevelHelper;\n\n},{\"53\":53}],39:[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\nvar _urlToolkit = _dereq_(2);\n\nvar _urlToolkit2 = _interopRequireDefault(_urlToolkit);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(33);\n\nvar _playlistLoader = _dereq_(43);\n\nvar _playlistLoader2 = _interopRequireDefault(_playlistLoader);\n\nvar _fragmentLoader = _dereq_(41);\n\nvar _fragmentLoader2 = _interopRequireDefault(_fragmentLoader);\n\nvar _keyLoader = _dereq_(42);\n\nvar _keyLoader2 = _interopRequireDefault(_keyLoader);\n\nvar _streamController = _dereq_(13);\n\nvar _streamController2 = _interopRequireDefault(_streamController);\n\nvar _levelController = _dereq_(12);\n\nvar _levelController2 = _interopRequireDefault(_levelController);\n\nvar _id3TrackController = _dereq_(11);\n\nvar _id3TrackController2 = _interopRequireDefault(_id3TrackController);\n\nvar _logger = _dereq_(53);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\n\nvar _config = _dereq_(4);\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 var mediaSource = window.MediaSource = window.MediaSource || window.WebKitMediaSource;\n var sourceBuffer = window.SourceBuffer = window.SourceBuffer || window.WebKitSourceBuffer;\n var isTypeSupported = mediaSource && typeof mediaSource.isTypeSupported === 'function' && mediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"');\n\n // if SourceBuffer is exposed ensure its API is valid\n // safari and old version of Chrome doe not expose SourceBuffer globally so checking SourceBuffer.prototype is impossible\n var sourceBufferValidAPI = !sourceBuffer || sourceBuffer.prototype && typeof sourceBuffer.prototype.appendBuffer === 'function' && typeof sourceBuffer.prototype.remove === 'function';\n return isTypeSupported && sourceBufferValidAPI;\n }\n }, {\n key: 'version',\n get: function get() {\n // replaced with browserify-versionify transform\n return '0.7.9';\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 return _config.hlsDefaultConfig;\n }\n return Hls.defaultConfig;\n },\n set: function set(defaultConfig) {\n Hls.defaultConfig = defaultConfig;\n }\n }]);\n\n function Hls() {\n var _this = this;\n\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 this._autoLevelCapping = -1;\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\n // core controllers and network loaders\n var abrController = this.abrController = new config.abrController(this);\n var bufferController = new config.bufferController(this);\n var capLevelController = new config.capLevelController(this);\n var fpsController = new config.fpsController(this);\n var playListLoader = new _playlistLoader2.default(this);\n var fragmentLoader = new _fragmentLoader2.default(this);\n var keyLoader = new _keyLoader2.default(this);\n var id3TrackController = new _id3TrackController2.default(this);\n\n // network controllers\n var levelController = this.levelController = new _levelController2.default(this);\n var streamController = this.streamController = new _streamController2.default(this);\n var networkControllers = [levelController, streamController];\n\n // optional audio stream controller\n var Controller = config.audioStreamController;\n if (Controller) {\n networkControllers.push(new Controller(this));\n }\n this.networkControllers = networkControllers;\n\n var coreComponents = [playListLoader, fragmentLoader, keyLoader, abrController, bufferController, capLevelController, fpsController, id3TrackController];\n\n // optional audio track and subtitle controller\n Controller = config.audioTrackController;\n if (Controller) {\n var audioTrackController = new Controller(this);\n this.audioTrackController = audioTrackController;\n coreComponents.push(audioTrackController);\n }\n\n Controller = config.subtitleTrackController;\n if (Controller) {\n var subtitleTrackController = new Controller(this);\n this.subtitleTrackController = subtitleTrackController;\n coreComponents.push(subtitleTrackController);\n }\n\n // optional subtitle controller\n [config.subtitleStreamController, config.timelineController].forEach(function (Controller) {\n if (Controller) {\n coreComponents.push(new Controller(_this));\n }\n });\n this.coreComponents = coreComponents;\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.coreComponents.concat(this.networkControllers).forEach(function (component) {\n component.destroy();\n });\n this.url = null;\n this.observer.removeAllListeners();\n this._autoLevelCapping = -1;\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 url = _urlToolkit2.default.buildAbsoluteURL(window.location.href, url, { alwaysNormalize: true });\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 ? arguments[0] : -1;\n\n _logger.logger.log('startLoad(' + startPosition + ')');\n this.networkControllers.forEach(function (controller) {\n controller.startLoad(startPosition);\n });\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n _logger.logger.log('stopLoad');\n this.networkControllers.forEach(function (controller) {\n controller.stopLoad();\n });\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 Math.max(this.levelController.firstLevel, this.minAutoLevel);\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 var hls = this;\n // if not in automatic start level detection, ensure startLevel is greater than minAutoLevel\n if (newLevel !== -1) {\n newLevel = Math.max(newLevel, hls.minAutoLevel);\n }\n hls.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._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._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 /* return min level selectable in auto mode according to config.minAutoBitrate */\n\n }, {\n key: 'minAutoLevel',\n get: function get() {\n var hls = this,\n levels = hls.levels,\n minAutoBitrate = hls.config.minAutoBitrate,\n len = levels ? levels.length : 0;\n for (var i = 0; i < len; i++) {\n var levelNextBitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate;\n if (levelNextBitrate > minAutoBitrate) {\n return i;\n }\n }\n return 0;\n }\n\n /* return max level selectable in auto mode according to autoLevelCapping */\n\n }, {\n key: 'maxAutoLevel',\n get: function get() {\n var hls = this;\n var levels = hls.levels;\n var autoLevelCapping = hls.autoLevelCapping;\n var maxAutoLevel = void 0;\n if (autoLevelCapping === -1 && levels && levels.length) {\n maxAutoLevel = levels.length - 1;\n } else {\n maxAutoLevel = autoLevelCapping;\n }\n return maxAutoLevel;\n }\n\n // return next auto level\n\n }, {\n key: 'nextAutoLevel',\n get: function get() {\n var hls = this;\n // ensure next auto level is between min and max auto level\n return Math.min(Math.max(hls.abrController.nextAutoLevel, hls.minAutoLevel), hls.maxAutoLevel);\n }\n\n // this setter is used to force next auto level\n // 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)\n // forced value is valid for one fragment. upon succesful frag loading at forced level, this value will be resetted to -1 by ABR controller\n ,\n set: function set(nextLevel) {\n var hls = this;\n hls.abrController.nextAutoLevel = Math.max(hls.minAutoLevel, nextLevel);\n }\n\n /** get alternate audio tracks list from playlist **/\n\n }, {\n key: 'audioTracks',\n get: function get() {\n var audioTrackController = this.audioTrackController;\n return audioTrackController ? 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 var audioTrackController = this.audioTrackController;\n return audioTrackController ? audioTrackController.audioTrack : -1;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n ,\n set: function set(audioTrackId) {\n var audioTrackController = this.audioTrackController;\n if (audioTrackController) {\n audioTrackController.audioTrack = audioTrackId;\n }\n }\n }, {\n key: 'liveSyncPosition',\n get: function get() {\n return this.streamController.liveSyncPosition;\n }\n\n /** get alternate subtitle tracks list from playlist **/\n\n }, {\n key: 'subtitleTracks',\n get: function get() {\n var subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTracks : [];\n }\n\n /** get index of the selected subtitle track (index in subtitle track lists) **/\n\n }, {\n key: 'subtitleTrack',\n get: function get() {\n var subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTrack : -1;\n }\n\n /** select an subtitle track, based on its index in subtitle track lists**/\n ,\n set: function set(subtitleTrackId) {\n var subtitleTrackController = this.subtitleTrackController;\n if (subtitleTrackController) {\n subtitleTrackController.subtitleTrack = subtitleTrackId;\n }\n }\n }]);\n\n return Hls;\n}();\n\nexports.default = Hls;\n\n},{\"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){\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_(39).default;\n\n},{\"39\":39}],41:[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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(33);\n\nvar _logger = _dereq_(53);\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, (FragmentLoader.__proto__ || 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},{\"33\":33,\"34\":34,\"35\":35,\"53\":53}],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\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(33);\n\nvar _logger = _dereq_(53);\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, (KeyLoader.__proto__ || 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 key 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[frag.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},{\"33\":33,\"34\":34,\"35\":35,\"53\":53}],43:[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 * Playlist Loader\n */\n\nvar _urlToolkit = _dereq_(2);\n\nvar _urlToolkit2 = _interopRequireDefault(_urlToolkit);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(33);\n\nvar _attrList = _dereq_(47);\n\nvar _attrList2 = _interopRequireDefault(_attrList);\n\nvar _logger = _dereq_(53);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// https://regex101.com is your friend\nvar MASTER_PLAYLIST_REGEX = /#EXT-X-STREAM-INF:([^\\n\\r]*)[\\r\\n]+([^\\r\\n]+)/g;\nvar MASTER_PLAYLIST_MEDIA_REGEX = /#EXT-X-MEDIA:(.*)/g;\nvar LEVEL_PLAYLIST_REGEX_FAST = /#EXTINF:(\\d*(?:\\.\\d+)?)(?:,(.*))?|(?!#)(\\S.+)|#EXT-X-BYTERANGE: *(.+)|#EXT-X-PROGRAM-DATE-TIME:(.+)|#.*/g;\nvar 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?/;\n\nvar LevelKey = function () {\n function LevelKey() {\n _classCallCheck(this, LevelKey);\n\n this.method = null;\n this.key = null;\n this.iv = null;\n this._uri = null;\n }\n\n _createClass(LevelKey, [{\n key: 'uri',\n get: function get() {\n if (!this._uri && this.reluri) {\n this._uri = _urlToolkit2.default.buildAbsoluteURL(this.baseuri, this.reluri, { alwaysNormalize: true });\n }\n return this._uri;\n }\n }]);\n\n return LevelKey;\n}();\n\nvar Fragment = function () {\n function Fragment() {\n _classCallCheck(this, Fragment);\n\n this._url = null;\n this._byteRange = null;\n this._decryptdata = null;\n this.tagList = [];\n }\n\n _createClass(Fragment, [{\n key: 'createInitializationVector',\n\n\n /**\n * Utility method for parseLevelPlaylist to create an initialization vector for a given segment\n * @returns {Uint8Array}\n */\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 = new LevelKey();\n decryptdata.method = levelkey.method;\n decryptdata.baseuri = levelkey.baseuri;\n decryptdata.reluri = levelkey.reluri;\n decryptdata.iv = this.createInitializationVector(segmentNumber);\n }\n\n return decryptdata;\n }\n }, {\n key: 'cloneObj',\n value: function cloneObj(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n }, {\n key: 'url',\n get: function get() {\n if (!this._url && this.relurl) {\n this._url = _urlToolkit2.default.buildAbsoluteURL(this.baseurl, this.relurl, { alwaysNormalize: true });\n }\n return this._url;\n },\n set: function set(value) {\n this._url = value;\n }\n }, {\n key: 'programDateTime',\n get: function get() {\n if (!this._programDateTime && this.rawProgramDateTime) {\n this._programDateTime = new Date(Date.parse(this.rawProgramDateTime));\n }\n return this._programDateTime;\n }\n }, {\n key: 'byteRange',\n get: function get() {\n if (!this._byteRange) {\n var byteRange = this._byteRange = [];\n if (this.rawByteRange) {\n var params = this.rawByteRange.split('@', 2);\n if (params.length === 1) {\n var lastByteRangeEndOffset = this.lastByteRangeEndOffset;\n byteRange[0] = lastByteRangeEndOffset ? lastByteRangeEndOffset : 0;\n } else {\n byteRange[0] = parseInt(params[1]);\n }\n byteRange[1] = parseInt(params[0]) + byteRange[0];\n }\n }\n return this._byteRange;\n }\n }, {\n key: 'byteRangeStartOffset',\n get: function get() {\n return this.byteRange[0];\n }\n }, {\n key: 'byteRangeEndOffset',\n get: function get() {\n return this.byteRange[1];\n }\n }, {\n key: 'decryptdata',\n get: function get() {\n if (!this._decryptdata) {\n this._decryptdata = this.fragmentDecryptdataFromLevelkey(this.levelkey, this.sn);\n }\n return this._decryptdata;\n }\n }]);\n\n return Fragment;\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, (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));\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: 'onSubtitleTrackLoading',\n value: function onSubtitleTrackLoading(data) {\n this.load(data.url, { type: 'subtitleTrack', 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 ' + context.type + ' ' + (context.level || context.id));\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 _urlToolkit2.default.buildAbsoluteURL(baseUrl, url, { alwaysNormalize: true });\n }\n }, {\n key: 'parseMasterPlaylist',\n value: function parseMasterPlaylist(string, baseurl) {\n var levels = [],\n result = void 0;\n MASTER_PLAYLIST_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_REGEX.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 id = 0;\n MASTER_PLAYLIST_MEDIA_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_MEDIA_REGEX.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 media.id = id++;\n medias.push(media);\n }\n }\n return medias;\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: 'parseLevelPlaylist',\n value: function parseLevelPlaylist(string, baseurl, id, type) {\n var currentSN = 0,\n totalduration = 0,\n level = { type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0 },\n levelkey = new LevelKey(),\n cc = 0,\n prevFrag = null,\n frag = new Fragment(),\n result,\n i;\n\n LEVEL_PLAYLIST_REGEX_FAST.lastIndex = 0;\n\n while ((result = LEVEL_PLAYLIST_REGEX_FAST.exec(string)) !== null) {\n var duration = result[1];\n if (duration) {\n // INF\n frag.duration = parseFloat(duration);\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n var title = (' ' + result[2]).slice(1);\n frag.title = title ? title : null;\n frag.tagList.push(title ? ['INF', duration, title] : ['INF', duration]);\n } else if (result[3]) {\n // url\n if (!isNaN(frag.duration)) {\n var sn = currentSN++;\n frag.type = type;\n frag.start = totalduration;\n frag.levelkey = levelkey;\n frag.sn = sn;\n frag.level = id;\n frag.cc = cc;\n frag.baseurl = baseurl;\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.relurl = (' ' + result[3]).slice(1);\n\n level.fragments.push(frag);\n prevFrag = frag;\n totalduration += frag.duration;\n\n frag = new Fragment();\n }\n } else if (result[4]) {\n // X-BYTERANGE\n frag.rawByteRange = (' ' + result[4]).slice(1);\n if (prevFrag) {\n var lastByteRangeEndOffset = prevFrag.byteRangeEndOffset;\n if (lastByteRangeEndOffset) {\n frag.lastByteRangeEndOffset = lastByteRangeEndOffset;\n }\n }\n } else if (result[5]) {\n // PROGRAM-DATE-TIME\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.rawProgramDateTime = (' ' + result[5]).slice(1);\n frag.tagList.push(['PROGRAM-DATE-TIME', frag.rawProgramDateTime]);\n } else {\n result = result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);\n for (i = 1; i < result.length; i++) {\n if (result[i] !== undefined) {\n break;\n }\n }\n\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n var value1 = (' ' + result[i + 1]).slice(1);\n var value2 = (' ' + result[i + 2]).slice(1);\n\n switch (result[i]) {\n case '#':\n frag.tagList.push(value2 ? [value1, value2] : [value1]);\n break;\n case 'PLAYLIST-TYPE':\n level.type = value1.toUpperCase();\n break;\n case 'MEDIA-SEQUENCE':\n currentSN = level.startSN = parseInt(value1);\n break;\n case 'TARGETDURATION':\n level.targetduration = parseFloat(value1);\n break;\n case 'VERSION':\n level.version = parseInt(value1);\n break;\n case 'EXTM3U':\n break;\n case 'ENDLIST':\n level.live = false;\n break;\n case 'DIS':\n cc++;\n frag.tagList.push(['DIS']);\n break;\n case 'DISCONTINUITY-SEQ':\n cc = parseInt(value1);\n break;\n case 'KEY':\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4\n var decryptparams = value1;\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 = new LevelKey();\n if (decrypturi && ['AES-128', 'SAMPLE-AES'].indexOf(decryptmethod) >= 0) {\n levelkey.method = decryptmethod;\n // URI to get the key\n levelkey.baseuri = baseurl;\n levelkey.reluri = decrypturi;\n levelkey.key = null;\n // Initialization Vector (IV)\n levelkey.iv = decryptiv;\n }\n }\n break;\n case 'START':\n var startParams = value1;\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 'MAP':\n var mapAttrs = new _attrList2.default(value1);\n frag.relurl = mapAttrs.URI;\n frag.rawByteRange = mapAttrs.BYTERANGE;\n frag.baseurl = baseurl;\n frag.level = id;\n frag.type = type;\n frag.sn = 'initSegment';\n level.initSegment = frag;\n frag = new Fragment();\n break;\n default:\n _logger.logger.warn('line parsed but not handled: ' + result);\n break;\n }\n }\n }\n frag = prevFrag;\n //logger.log('found ' + level.fragments.length + ' fragments');\n if (frag && !frag.relurl) {\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' && type !== 'subtitleTrack',\n levelId = !isNaN(level) ? level : !isNaN(id) ? id : 0,\n levelDetails = this.parseLevelPlaylist(string, url, levelId, type === 'audioTrack' ? 'audio' : type === 'subtitleTrack' ? 'subtitle' : 'main');\n levelDetails.tload = stats.tload;\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 (levelDetails.targetduration) {\n if (isLevel) {\n hls.trigger(_events2.default.LEVEL_LOADED, { details: levelDetails, level: level || 0, id: id || 0, stats: stats });\n } else {\n if (type === 'audioTrack') {\n hls.trigger(_events2.default.AUDIO_TRACK_LOADED, { details: levelDetails, id: id, stats: stats });\n } else if (type === 'subtitleTrack') {\n hls.trigger(_events2.default.SUBTITLE_TRACK_LOADED, { details: levelDetails, id: id, stats: stats });\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: 'invalid targetduration' });\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 var subtitles = this.parseMasterPlaylistMedia(string, url, 'SUBTITLES');\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, subtitles: subtitles, 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},{\"2\":2,\"33\":33,\"34\":34,\"35\":35,\"47\":47,\"53\":53}],44:[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 UINT32_MAX = Math.pow(2, 32) - 1;\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 '.mp3': [],\n mvex: [],\n mvhd: [],\n pasp: [],\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 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 var upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n var lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.mdhd, new Uint8Array([0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n 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)\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 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 upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n var lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n var bytes = new Uint8Array([0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n 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\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 hSpacing = track.pixelRatio[0],\n vSpacing = track.pixelRatio[1];\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 MP4.box(MP4.types.pasp, new Uint8Array([hSpacing >> 24, // hSpacing\n hSpacing >> 16 & 0xFF, hSpacing >> 8 & 0xFF, hSpacing & 0xFF, vSpacing >> 24, // vSpacing\n vSpacing >> 16 & 0xFF, vSpacing >> 8 & 0xFF, vSpacing & 0xFF])));\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 samplerate = track.samplerate;\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 samplerate >> 8 & 0xFF, samplerate & 0xff, //\n 0x00, 0x00]), MP4.box(MP4.types.esds, MP4.esds(track)));\n }\n }, {\n key: 'mp3',\n value: function mp3(track) {\n var samplerate = track.samplerate;\n return MP4.box(MP4.types['.mp3'], 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 samplerate >> 8 & 0xFF, samplerate & 0xff, //\n 0x00, 0x00]));\n }\n }, {\n key: 'stsd',\n value: function stsd(track) {\n if (track.type === 'audio') {\n if (!track.isAAC && track.codec === 'mp3') {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));\n }\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 upperWordDuration = Math.floor(duration / (UINT32_MAX + 1)),\n lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.tkhd, new Uint8Array([0x01, // version 1\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n id >> 24 & 0xFF, id >> 16 & 0xFF, id >> 8 & 0xFF, id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n 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\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 upperWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime / (UINT32_MAX + 1)),\n lowerWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime % (UINT32_MAX + 1));\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])), MP4.box(MP4.types.tfdt, new Uint8Array([0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 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\n 20 + // 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},{}],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 * fMP4 remuxer\n */\n\nvar _aac = _dereq_(36);\n\nvar _aac2 = _interopRequireDefault(_aac);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(53);\n\nvar _mp4Generator = _dereq_(44);\n\nvar _mp4Generator2 = _interopRequireDefault(_mp4Generator);\n\nvar _errors = _dereq_(33);\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\n// 10 seconds\nvar MAX_SILENT_FRAME_DURATION = 10 * 1000;\n\nvar MP4Remuxer = function () {\n function MP4Remuxer(observer, config, typeSupported, vendor) {\n _classCallCheck(this, MP4Remuxer);\n\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n var userAgent = navigator.userAgent;\n this.isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');\n this.ISGenerated = false;\n }\n\n _createClass(MP4Remuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'resetTimeStamp',\n value: function resetTimeStamp(defaultTimeStamp) {\n this._initPTS = this._initDTS = defaultTimeStamp;\n }\n }, {\n key: 'resetInitSegment',\n value: function resetInitSegment() {\n this.ISGenerated = false;\n }\n }, {\n key: 'remux',\n value: function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\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 nextAudioPts, which is\n // calculated in remuxAudio.\n //logger.log('nb AAC samples:' + audioTrack.samples.length);\n if (audioTrack.samples.length) {\n // if initSegment was generated without video samples, regenerate it again\n if (!audioTrack.timescale) {\n _logger.logger.warn('regenerate InitSegment as audio detected');\n this.generateIS(audioTrack, videoTrack, timeOffset);\n }\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 // if initSegment was generated without video samples, regenerate it again\n if (!videoTrack.timescale) {\n _logger.logger.warn('regenerate InitSegment as video detected');\n this.generateIS(audioTrack, videoTrack, timeOffset);\n }\n this.remuxVideo(videoTrack, timeOffset, contiguous, audioTrackLength, accurateTimeOffset);\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, accurateTimeOffset);\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);\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 typeSupported = this.typeSupported,\n container = 'audio/mp4',\n tracks = {},\n data = { tracks: tracks },\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 // let's use audio sampling rate as MP4 time scale.\n // rationale is that there is a integer nb of audio frames per audio sample (1024 for AAC)\n // using audio sampling rate here helps having an integer MP4 frame duration\n // this avoids potential rounding issue and AV sync issue\n audioTrack.timescale = audioTrack.samplerate;\n _logger.logger.log('audio sampling rate : ' + audioTrack.samplerate);\n if (!audioTrack.isAAC) {\n if (typeSupported.mpeg) {\n // Chrome and Safari\n container = 'audio/mpeg';\n audioTrack.codec = '';\n } else if (typeSupported.mp3) {\n // Firefox\n audioTrack.codec = 'mp3';\n }\n }\n tracks.audio = {\n container: container,\n codec: audioTrack.codec,\n initSegment: !audioTrack.isAAC && typeSupported.mpeg ? new Uint8Array() : _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 - audioTrack.inputTimeScale * timeOffset;\n }\n }\n\n if (videoTrack.sps && videoTrack.pps && videoSamples.length) {\n // let's use input time scale as MP4 video timescale\n // we use input time scale straight away to avoid rounding issues on frame duration / cts computation\n var inputTimeScale = videoTrack.inputTimeScale;\n videoTrack.timescale = inputTimeScale;\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 - inputTimeScale * timeOffset);\n initDTS = Math.min(initDTS, videoSamples[0].dts - inputTimeScale * timeOffset);\n this.observer.trigger(_events2.default.INIT_PTS_FOUND, { initPTS: initPTS });\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, 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, accurateTimeOffset) {\n var offset = 8,\n timeScale = track.timescale,\n mp4SampleDuration,\n mdat,\n moof,\n firstPTS,\n firstDTS,\n nextDTS,\n lastPTS,\n lastDTS,\n inputSamples = track.samples,\n outputSamples = [],\n nbSamples = inputSamples.length,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS;\n\n // for (let i = 0; i < track.samples.length; i++) {\n // let avcSample = track.samples[i];\n // let units = avcSample.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 // if parsed fragment is contiguous with last one, let's use last DTS value as reference\n var nextAvcDts = this.nextAvcDts;\n\n var isSafari = this.isSafari;\n\n // Safari does not like overlapping DTS on consecutive fragments. let's use nextAvcDts to overcome this if fragments are consecutive\n if (isSafari) {\n // also consider consecutive fragments as being contiguous (even if a level switch occurs),\n // for sake of clarity:\n // consecutive fragments are frags with\n // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR\n // - less than 200 ms PTS gaps (timeScale/5)\n contiguous |= inputSamples.length && nextAvcDts && (accurateTimeOffset && Math.abs(timeOffset - nextAvcDts / timeScale) < 0.1 || Math.abs(inputSamples[0].pts - nextAvcDts - initDTS) < timeScale / 5);\n }\n\n if (!contiguous) {\n // if not contiguous, let's use target timeOffset\n nextAvcDts = timeOffset * timeScale;\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 inputSamples.forEach(function (sample) {\n sample.pts = ptsNormalize(sample.pts - initDTS, nextAvcDts);\n sample.dts = ptsNormalize(sample.dts - initDTS, nextAvcDts);\n });\n\n // sort video samples by DTS then PTS then demux id order\n inputSamples.sort(function (a, b) {\n var deltadts = a.dts - b.dts;\n var deltapts = a.pts - b.pts;\n return deltadts ? deltadts : deltapts ? deltapts : a.id - b.id;\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 // compute first DTS and last DTS, normalize them against reference value\n var sample = inputSamples[0];\n firstDTS = Math.max(sample.dts, 0);\n firstPTS = Math.max(sample.pts, 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;\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;\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(sample.dts, 0);\n lastPTS = Math.max(sample.pts, 0, lastDTS);\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) / (inputSamples.length - 1));\n }\n\n var nbNalu = 0,\n naluLen = 0;\n for (var _i = 0; _i < nbSamples; _i++) {\n // compute total/avc sample length and nb of NAL units\n var _sample = inputSamples[_i],\n units = _sample.units,\n nbUnits = units.length,\n sampleLen = 0;\n for (var j = 0; j < nbUnits; j++) {\n sampleLen += units[j].data.length;\n }\n naluLen += sampleLen;\n nbNalu += nbUnits;\n _sample.length = sampleLen;\n\n // normalize PTS/DTS\n if (isSafari) {\n // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples\n _sample.dts = firstDTS + _i * mp4SampleDuration;\n } else {\n // ensure sample monotonic DTS\n _sample.dts = Math.max(_sample.dts, firstDTS);\n }\n // ensure that computed value is greater or equal than sample DTS\n _sample.pts = Math.max(_sample.pts, _sample.dts);\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 var mdatSize = naluLen + 4 * nbNalu + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n 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 });\n return;\n }\n var view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n\n for (var _i2 = 0; _i2 < nbSamples; _i2++) {\n var avcSample = inputSamples[_i2],\n avcSampleUnits = avcSample.units,\n mp4SampleLength = 0,\n compositionTimeOffset = void 0;\n // convert NALU bitstream to MP4 format (prepend NALU with size field)\n for (var _j = 0, _nbUnits = avcSampleUnits.length; _j < _nbUnits; _j++) {\n var unit = avcSampleUnits[_j],\n unitData = unit.data,\n unitDataLen = unit.data.byteLength;\n view.setUint32(offset, unitDataLen);\n offset += 4;\n mdat.set(unitData, offset);\n offset += unitDataLen;\n mp4SampleLength += 4 + unitDataLen;\n }\n\n if (!isSafari) {\n // expected sample duration is the Decoding Timestamp diff of consecutive samples\n if (_i2 < nbSamples - 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) * timeScale),\n deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * timeScale : this.nextAudioPts) - 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 compositionTimeOffset = Math.round(avcSample.pts - avcSample.dts);\n } else {\n compositionTimeOffset = Math.max(0, mp4SampleDuration * Math.round((avcSample.pts - avcSample.dts) / mp4SampleDuration));\n }\n\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${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;\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, track);\n track.samples = [];\n\n var data = {\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / timeScale,\n endPTS: (lastPTS + mp4SampleDuration) / timeScale,\n startDTS: firstDTS / timeScale,\n endDTS: this.nextAvcDts / timeScale,\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 inputTimeScale = track.inputTimeScale,\n mp4timeScale = track.timescale,\n scaleFactor = inputTimeScale / mp4timeScale,\n mp4SampleDuration = track.isAAC ? 1024 : 1152,\n inputSampleDuration = mp4SampleDuration * scaleFactor,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS,\n rawMPEG = !track.isAAC && this.typeSupported.mpeg;\n\n var offset,\n mp4Sample,\n fillFrame,\n mdat,\n moof,\n firstPTS,\n lastPTS,\n inputSamples = track.samples,\n outputSamples = [],\n nextAudioPts = this.nextAudioPts;\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\n // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR\n // - less than 20 audio frames distance\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 contiguous |= inputSamples.length && nextAudioPts && (accurateTimeOffset && Math.abs(timeOffset - nextAudioPts / inputTimeScale) < 0.1 || Math.abs(inputSamples[0].pts - nextAudioPts - initDTS) < 20 * inputSampleDuration);\n\n if (!contiguous) {\n // if fragments are not contiguous, let's use timeOffset to compute next Audio PTS\n nextAudioPts = timeOffset * inputTimeScale;\n }\n\n // compute normalized PTS\n inputSamples.forEach(function (sample) {\n sample.pts = sample.dts = ptsNormalize(sample.pts - initDTS, nextAudioPts);\n });\n\n // sort based on normalized PTS (this is to avoid sorting issues in case timestamp\n // reloop in the middle of our samples array)\n inputSamples.sort(function (a, b) {\n return a.pts - b.pts;\n });\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\n // only inject/drop audio frames in case time offset is accurate\n if (accurateTimeOffset && track.isAAC) {\n for (var i = 0, nextPts = nextAudioPts; i < inputSamples.length;) {\n // First, let's see how far off this frame is from where we expect it to be\n var sample = inputSamples[i],\n delta;\n var pts = sample.pts;\n delta = pts - nextPts;\n\n var duration = Math.abs(1000 * delta / inputTimeScale);\n\n // If we're overlapping by more than a duration, drop this sample\n if (delta <= -inputSampleDuration) {\n _logger.logger.warn('Dropping 1 audio frame @ ' + (nextPts / inputTimeScale).toFixed(3) + 's due to ' + duration + ' ms overlap.');\n inputSamples.splice(i, 1);\n track.len -= sample.unit.length;\n // Don't touch nextPtsNorm or i\n }\n\n // Insert missing frames if:\n // 1: We're more than one frame away\n // 2: Not more than MAX_SILENT_FRAME_DURATION away\n // 3: currentTime (aka nextPtsNorm) is not 0\n else if (delta >= inputSampleDuration && duration < MAX_SILENT_FRAME_DURATION && nextPts) {\n var missing = Math.round(delta / inputSampleDuration);\n _logger.logger.warn('Injecting ' + missing + ' audio frame @ ' + (nextPts / inputTimeScale).toFixed(3) + 's due to ' + Math.round(1000 * delta / inputTimeScale) + ' ms gap.');\n for (var j = 0; j < missing; j++) {\n var newStamp = Math.max(nextPts, 0);\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, 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.subarray();\n }\n inputSamples.splice(i, 0, { unit: fillFrame, pts: newStamp, dts: newStamp });\n track.len += fillFrame.length;\n nextPts += inputSampleDuration;\n i++;\n }\n\n // Adjust sample to next expected pts\n sample.pts = sample.dts = nextPts;\n nextPts += inputSampleDuration;\n i++;\n } else {\n // Otherwise, just adjust pts\n if (Math.abs(delta) > 0.1 * inputSampleDuration) {\n //logger.log(`Invalid frame delta ${Math.round(delta + inputSampleDuration)} at PTS ${Math.round(pts / 90)} (should be ${Math.round(inputSampleDuration)}).`);\n }\n sample.pts = sample.dts = nextPts;\n nextPts += inputSampleDuration;\n i++;\n }\n }\n }\n\n for (var _j2 = 0, _nbSamples = inputSamples.length; _j2 < _nbSamples; _j2++) {\n var audioSample = inputSamples[_j2];\n var unit = audioSample.unit;\n var _pts = audioSample.pts;\n //logger.log(`Audio/PTS:${Math.round(pts/90)}`);\n // if not first sample\n if (lastPTS !== undefined) {\n mp4Sample.duration = Math.round((_pts - lastPTS) / scaleFactor);\n } else {\n var _delta = Math.round(1000 * (_pts - nextAudioPts) / inputTimeScale),\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 && track.isAAC) {\n // log delta\n if (_delta) {\n if (_delta > 0 && _delta < MAX_SILENT_FRAME_DURATION) {\n numMissingFrames = Math.round((_pts - nextAudioPts) / inputSampleDuration);\n _logger.logger.log(_delta + ' ms hole between AAC samples detected,filling it');\n if (numMissingFrames > 0) {\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n fillFrame = unit.subarray();\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('drop overlapping AAC sample, expected/parsed/delta:' + (nextAudioPts / inputTimeScale).toFixed(3) + 's/' + (_pts / inputTimeScale).toFixed(3) + 's/' + -_delta + 'ms');\n track.len -= unit.byteLength;\n continue;\n }\n // set PTS/DTS to expected PTS/DTS\n _pts = nextAudioPts;\n }\n }\n // remember first PTS of our audioSamples, ensure value is positive\n firstPTS = Math.max(0, _pts);\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 var mdatSize = rawMPEG ? track.len : track.len + 8;\n offset = rawMPEG ? 0 : 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n 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 });\n return;\n }\n if (!rawMPEG) {\n var view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n }\n } else {\n // no audio samples\n return;\n }\n for (var _i3 = 0; _i3 < numMissingFrames; _i3++) {\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, 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.subarray();\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 outputSamples.push(mp4Sample);\n }\n }\n mdat.set(unit, offset);\n var unitLen = unit.byteLength;\n offset += unitLen;\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${audioSample.pts}/${audioSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(audioSample.pts/4294967296).toFixed(3)}');\n mp4Sample = {\n size: unitLen,\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 outputSamples.push(mp4Sample);\n lastPTS = _pts;\n }\n var lastSampleDuration = 0;\n var nbSamples = outputSamples.length;\n //set last sample duration as being identical to previous sample\n if (nbSamples >= 2) {\n lastSampleDuration = outputSamples[nbSamples - 2].duration;\n mp4Sample.duration = lastSampleDuration;\n }\n if (nbSamples) {\n // next audio sample PTS should be equal to last sample PTS + duration\n this.nextAudioPts = nextAudioPts = lastPTS + scaleFactor * lastSampleDuration;\n //logger.log('Audio/PTS/PTSend:' + audioSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));\n track.len = 0;\n track.samples = outputSamples;\n if (rawMPEG) {\n moof = new Uint8Array();\n } else {\n moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstPTS / scaleFactor, track);\n }\n track.samples = [];\n var start = firstPTS / inputTimeScale;\n var end = nextAudioPts / inputTimeScale;\n var audioData = {\n data1: moof,\n data2: mdat,\n startPTS: start,\n endPTS: end,\n startDTS: start,\n endDTS: end,\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 inputTimeScale = track.inputTimeScale,\n mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale,\n scaleFactor = inputTimeScale / mp4timeScale,\n nextAudioPts = this.nextAudioPts,\n\n\n // sync with video's timestamp\n startDTS = (nextAudioPts !== undefined ? nextAudioPts : videoData.startDTS * inputTimeScale) + this._initDTS,\n endDTS = videoData.endDTS * inputTimeScale + this._initDTS,\n\n // one sample's duration value\n sampleDuration = 1024,\n frameDuration = scaleFactor * 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.manifestCodec || track.codec, track.channelCount);\n\n _logger.logger.warn('remux empty Audio');\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, 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 var inputTimeScale = track.inputTimeScale;\n var initPTS = this._initPTS;\n var initDTS = this._initDTS;\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 - initPTS) / inputTimeScale;\n sample.dts = (sample.dts - initDTS) / inputTimeScale;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_METADATA, {\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 var inputTimeScale = track.inputTimeScale;\n var initPTS = this._initPTS;\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 - initPTS) / inputTimeScale;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_USERDATA, {\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\n return MP4Remuxer;\n}();\n\nexports.default = MP4Remuxer;\n\n},{\"33\":33,\"35\":35,\"36\":36,\"44\":44,\"53\":53}],46:[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_(35);\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) {\n _classCallCheck(this, PassThroughRemuxer);\n\n this.observer = observer;\n }\n\n _createClass(PassThroughRemuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'resetTimeStamp',\n value: function resetTimeStamp() {}\n }, {\n key: 'resetInitSegment',\n value: function resetInitSegment() {}\n }, {\n key: 'remux',\n value: function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset, rawData) {\n var observer = this.observer;\n var streamType = '';\n if (audioTrack) {\n streamType += 'audio';\n }\n if (videoTrack) {\n streamType += 'video';\n }\n observer.trigger(_events2.default.FRAG_PARSING_DATA, {\n data1: rawData,\n startPTS: timeOffset,\n startDTS: timeOffset,\n type: streamType,\n nb: 1,\n dropped: 0\n });\n //notify end of parsing\n observer.trigger(_events2.default.FRAG_PARSED);\n }\n }]);\n\n return PassThroughRemuxer;\n}();\n\nexports.default = PassThroughRemuxer;\n\n},{\"35\":35}],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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DECIMAL_RESOLUTION_REGEX = /^(\\d+)x(\\d+)$/;\nvar ATTR_LIST_REGEX = /\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g;\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 = DECIMAL_RESOLUTION_REGEX.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 match,\n attrs = {};\n ATTR_LIST_REGEX.lastIndex = 0;\n while ((match = ATTR_LIST_REGEX.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},{}],48:[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},{}],49:[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 = 100;\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\n //Make sure this only affects Roll-up Captions by checking this.nrRollUpRows\n if (this.nrRollUpRows && this.currRow !== newRow) {\n //clear all rows first\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n\n //Copy this.nrRollUpRows rows from lastOutputScreen and place it in the newRow location\n //topRowIndex - the start of rows to copy (inclusive index)\n var topRowIndex = this.currRow + 1 - this.nrRollUpRows;\n //We only copy if the last position was already shown.\n //We use the cueStartTime value to check this.\n var lastOutputScreen = this.lastOutputScreen;\n if (lastOutputScreen) {\n var prevLineTime = lastOutputScreen.rows[topRowIndex].cueStartTime;\n if (prevLineTime && prevLineTime < logger.time) {\n for (var _i = 0; _i < this.nrRollUpRows; _i++) {\n this.rows[newRow - this.nrRollUpRows + _i + 1].copy(lastOutputScreen.rows[topRowIndex + _i]);\n }\n }\n }\n }\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},{}],50:[function(_dereq_,module,exports){\n'use strict';\n\nvar _vttparser = _dereq_(56);\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 //To be used for cleaning-up orphaned roll-up captions\n row.cueStartTime = startTime;\n\n // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE\n if (startTime === endTime) {\n endTime += 0.0001;\n }\n\n cue = new VTTCue(startTime, endTime, (0, _vttparser.fixLineBreaks)(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 // Clamp the position between 0 and 100 - if out of these bounds, Firefox throws an exception and captions break\n cue.position = Math.max(0, Math.min(100, 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\\//) ? 50 : 0)));\n track.addCue(cue);\n }\n }\n }\n\n};\n\nmodule.exports = Cues;\n\n},{\"56\":56}],51:[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_(52);\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},{\"52\":52}],52:[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 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},{}],53:[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 && obj !== Symbol.prototype ? \"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},{}],54:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * TimeRanges to string helper\n */\n\nvar TimeRanges = {\n toString: 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\nmodule.exports = TimeRanges;\n\n},{}],55:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\n/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexports.default = function () {\n if (typeof window !== 'undefined' && window.VTTCue) {\n return window.VTTCue;\n }\n\n var autoKeyword = 'auto';\n var directionSetting = {\n '': true,\n lr: true,\n rl: true\n };\n var alignSetting = {\n start: true,\n middle: true,\n end: true,\n left: true,\n right: true\n };\n\n function findDirectionSetting(value) {\n if (typeof value !== 'string') {\n return false;\n }\n var dir = directionSetting[value.toLowerCase()];\n return dir ? value.toLowerCase() : false;\n }\n\n function findAlignSetting(value) {\n if (typeof value !== 'string') {\n return false;\n }\n var align = alignSetting[value.toLowerCase()];\n return align ? value.toLowerCase() : false;\n }\n\n function extend(obj) {\n var i = 1;\n for (; i < arguments.length; i++) {\n var cobj = arguments[i];\n for (var p in cobj) {\n obj[p] = cobj[p];\n }\n }\n\n return obj;\n }\n\n function VTTCue(startTime, endTime, text) {\n var cue = this;\n var isIE8 = function () {\n if (typeof navigator === 'undefined') {\n return;\n }\n return (/MSIE\\s8\\.0/.test(navigator.userAgent)\n );\n }();\n var baseObj = {};\n\n if (isIE8) {\n cue = document.createElement('custom');\n } else {\n baseObj.enumerable = true;\n }\n\n /**\n * Shim implementation specific properties. These properties are not in\n * the spec.\n */\n\n // Lets us know when the VTTCue's data has changed in such a way that we need\n // to recompute its display state. This lets us compute its display state\n // lazily.\n cue.hasBeenReset = false;\n\n /**\n * VTTCue and TextTrackCue properties\n * http://dev.w3.org/html5/webvtt/#vttcue-interface\n */\n\n var _id = '';\n var _pauseOnExit = false;\n var _startTime = startTime;\n var _endTime = endTime;\n var _text = text;\n var _region = null;\n var _vertical = '';\n var _snapToLines = true;\n var _line = 'auto';\n var _lineAlign = 'start';\n var _position = 50;\n var _positionAlign = 'middle';\n var _size = 50;\n var _align = 'middle';\n\n Object.defineProperty(cue, 'id', extend({}, baseObj, {\n get: function get() {\n return _id;\n },\n set: function set(value) {\n _id = '' + value;\n }\n }));\n\n Object.defineProperty(cue, 'pauseOnExit', extend({}, baseObj, {\n get: function get() {\n return _pauseOnExit;\n },\n set: function set(value) {\n _pauseOnExit = !!value;\n }\n }));\n\n Object.defineProperty(cue, 'startTime', extend({}, baseObj, {\n get: function get() {\n return _startTime;\n },\n set: function set(value) {\n if (typeof value !== 'number') {\n throw new TypeError('Start time must be set to a number.');\n }\n _startTime = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'endTime', extend({}, baseObj, {\n get: function get() {\n return _endTime;\n },\n set: function set(value) {\n if (typeof value !== 'number') {\n throw new TypeError('End time must be set to a number.');\n }\n _endTime = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'text', extend({}, baseObj, {\n get: function get() {\n return _text;\n },\n set: function set(value) {\n _text = '' + value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'region', extend({}, baseObj, {\n get: function get() {\n return _region;\n },\n set: function set(value) {\n _region = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'vertical', extend({}, baseObj, {\n get: function get() {\n return _vertical;\n },\n set: function set(value) {\n var setting = findDirectionSetting(value);\n // Have to check for false because the setting an be an empty string.\n if (setting === false) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _vertical = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'snapToLines', extend({}, baseObj, {\n get: function get() {\n return _snapToLines;\n },\n set: function set(value) {\n _snapToLines = !!value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'line', extend({}, baseObj, {\n get: function get() {\n return _line;\n },\n set: function set(value) {\n if (typeof value !== 'number' && value !== autoKeyword) {\n throw new SyntaxError('An invalid number or illegal string was specified.');\n }\n _line = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'lineAlign', extend({}, baseObj, {\n get: function get() {\n return _lineAlign;\n },\n set: function set(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _lineAlign = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'position', extend({}, baseObj, {\n get: function get() {\n return _position;\n },\n set: function set(value) {\n if (value < 0 || value > 100) {\n throw new Error('Position must be between 0 and 100.');\n }\n _position = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'positionAlign', extend({}, baseObj, {\n get: function get() {\n return _positionAlign;\n },\n set: function set(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _positionAlign = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'size', extend({}, baseObj, {\n get: function get() {\n return _size;\n },\n set: function set(value) {\n if (value < 0 || value > 100) {\n throw new Error('Size must be between 0 and 100.');\n }\n _size = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'align', extend({}, baseObj, {\n get: function get() {\n return _align;\n },\n set: function set(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _align = setting;\n this.hasBeenReset = true;\n }\n }));\n\n /**\n * Other <track> spec defined properties\n */\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state\n cue.displayState = undefined;\n\n if (isIE8) {\n return cue;\n }\n }\n\n /**\n * VTTCue methods\n */\n\n VTTCue.prototype.getCueAsHTML = function () {\n // Assume WebVTT.convertCueToDOMTree is on the global.\n var WebVTT = window.WebVTT;\n return WebVTT.convertCueToDOMTree(window, this.text);\n };\n\n return VTTCue;\n}();\n\n},{}],56:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.fixLineBreaks = undefined;\n\nvar _vttcue = _dereq_(55);\n\nvar _vttcue2 = _interopRequireDefault(_vttcue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar StringDecoder = function StringDecoder() {\n return {\n decode: function decode(data) {\n if (!data) {\n return '';\n }\n if (typeof data !== 'string') {\n throw new Error('Error - expected string data.');\n }\n return decodeURIComponent(encodeURIComponent(data));\n }\n };\n}; /*\n * Source: https://github.com/mozilla/vtt.js/blob/master/dist/vtt.js#L1716\n */\n\nfunction VTTParser() {\n this.window = window;\n this.state = 'INITIAL';\n this.buffer = '';\n this.decoder = new StringDecoder();\n this.regionList = [];\n}\n\n// Try to parse input as a time stamp.\nfunction parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(':', ''), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}\n\n// A settings object holds key/value pairs and will ignore anything but the first\n// assignment to a specific key.\nfunction Settings() {\n this.values = Object.create(null);\n}\n\nSettings.prototype = {\n // Only accept the first assignment to any key.\n set: function set(k, v) {\n if (!this.get(k) && v !== '') {\n this.values[k] = v;\n }\n },\n // Return the value for a key, or a default value.\n // If 'defaultKey' is passed then 'dflt' is assumed to be an object with\n // a number of possible default values as properties where 'defaultKey' is\n // the key of the property that will be chosen; otherwise it's assumed to be\n // a single value.\n get: function get(k, dflt, defaultKey) {\n if (defaultKey) {\n return this.has(k) ? this.values[k] : dflt[defaultKey];\n }\n return this.has(k) ? this.values[k] : dflt;\n },\n // Check whether we have a value for a key.\n has: function has(k) {\n return k in this.values;\n },\n // Accept a setting if its one of the given alternatives.\n alt: function alt(k, v, a) {\n for (var n = 0; n < a.length; ++n) {\n if (v === a[n]) {\n this.set(k, v);\n break;\n }\n }\n },\n // Accept a setting if its a valid (signed) integer.\n integer: function integer(k, v) {\n if (/^-?\\d+$/.test(v)) {\n // integer\n this.set(k, parseInt(v, 10));\n }\n },\n // Accept a setting if its a valid percentage.\n percent: function percent(k, v) {\n var m;\n if (m = v.match(/^([\\d]{1,3})(\\.[\\d]*)?%$/)) {\n v = parseFloat(v);\n if (v >= 0 && v <= 100) {\n this.set(k, v);\n return true;\n }\n }\n return false;\n }\n};\n\n// Helper function to parse input into groups separated by 'groupDelim', and\n// interprete each group as a key/value pair separated by 'keyValueDelim'.\nfunction parseOptions(input, callback, keyValueDelim, groupDelim) {\n var groups = groupDelim ? input.split(groupDelim) : [input];\n for (var i in groups) {\n if (typeof groups[i] !== 'string') {\n continue;\n }\n var kv = groups[i].split(keyValueDelim);\n if (kv.length !== 2) {\n continue;\n }\n var k = kv[0];\n var v = kv[1];\n callback(k, v);\n }\n}\n\nvar defaults = new _vttcue2.default(0, 0, 0);\n// 'middle' was changed to 'center' in the spec: https://github.com/w3c/webvtt/pull/244\n// Chrome and Safari don't yet support this change, but FF does\nvar center = defaults.align === 'middle' ? 'middle' : 'center';\n\nfunction parseCue(input, cue, regionList) {\n // Remember the original input if we need to throw an error.\n var oInput = input;\n // 4.1 WebVTT timestamp\n function consumeTimeStamp() {\n var ts = parseTimeStamp(input);\n if (ts === null) {\n throw new Error('Malformed timestamp: ' + oInput);\n }\n // Remove time stamp from input.\n input = input.replace(/^[^\\sa-zA-Z-]+/, '');\n return ts;\n }\n\n // 4.4.2 WebVTT cue settings\n function consumeCueSettings(input, cue) {\n var settings = new Settings();\n\n parseOptions(input, function (k, v) {\n switch (k) {\n case 'region':\n // Find the last region we parsed with the same region id.\n for (var i = regionList.length - 1; i >= 0; i--) {\n if (regionList[i].id === v) {\n settings.set(k, regionList[i].region);\n break;\n }\n }\n break;\n case 'vertical':\n settings.alt(k, v, ['rl', 'lr']);\n break;\n case 'line':\n var vals = v.split(','),\n vals0 = vals[0];\n settings.integer(k, vals0);\n if (settings.percent(k, vals0)) {\n settings.set('snapToLines', false);\n }\n settings.alt(k, vals0, ['auto']);\n if (vals.length === 2) {\n settings.alt('lineAlign', vals[1], ['start', center, 'end']);\n }\n break;\n case 'position':\n vals = v.split(',');\n settings.percent(k, vals[0]);\n if (vals.length === 2) {\n settings.alt('positionAlign', vals[1], ['start', center, 'end', 'line-left', 'line-right', 'auto']);\n }\n break;\n case 'size':\n settings.percent(k, v);\n break;\n case 'align':\n settings.alt(k, v, ['start', center, 'end', 'left', 'right']);\n break;\n }\n }, /:/, /\\s/);\n\n // Apply default values for any missing fields.\n cue.region = settings.get('region', null);\n cue.vertical = settings.get('vertical', '');\n var line = settings.get('line', 'auto');\n if (line === 'auto' && defaults.line === -1) {\n // set numeric line number for Safari\n line = -1;\n }\n cue.line = line;\n cue.lineAlign = settings.get('lineAlign', 'start');\n cue.snapToLines = settings.get('snapToLines', true);\n cue.size = settings.get('size', 100);\n cue.align = settings.get('align', center);\n var position = settings.get('position', 'auto');\n if (position === 'auto' && defaults.position === 50) {\n // set numeric position for Safari\n position = cue.align === 'start' || cue.align === 'left' ? 0 : cue.align === 'end' || cue.align === 'right' ? 100 : 50;\n }\n cue.position = position;\n }\n\n function skipWhitespace() {\n input = input.replace(/^\\s+/, '');\n }\n\n // 4.1 WebVTT cue timings.\n skipWhitespace();\n cue.startTime = consumeTimeStamp(); // (1) collect cue start time\n skipWhitespace();\n if (input.substr(0, 3) !== '-->') {\n // (3) next characters must match '-->'\n throw new Error('Malformed time stamp (time stamps must be separated by \\'-->\\'): ' + oInput);\n }\n input = input.substr(3);\n skipWhitespace();\n cue.endTime = consumeTimeStamp(); // (5) collect cue end time\n\n // 4.1 WebVTT cue settings list.\n skipWhitespace();\n consumeCueSettings(input, cue);\n}\n\nfunction fixLineBreaks(input) {\n return input.replace(/<br(?: \\/)?>/gi, '\\n');\n}\n\nVTTParser.prototype = {\n parse: function parse(data) {\n var self = this;\n\n // If there is no data then we won't decode it, but will just try to parse\n // whatever is in buffer already. This may occur in circumstances, for\n // example when flush() is called.\n if (data) {\n // Try to decode the data that we received.\n self.buffer += self.decoder.decode(data, { stream: true });\n }\n\n function collectNextLine() {\n var buffer = self.buffer;\n var pos = 0;\n\n buffer = fixLineBreaks(buffer);\n\n while (pos < buffer.length && buffer[pos] !== '\\r' && buffer[pos] !== '\\n') {\n ++pos;\n }\n var line = buffer.substr(0, pos);\n // Advance the buffer early in case we fail below.\n if (buffer[pos] === '\\r') {\n ++pos;\n }\n if (buffer[pos] === '\\n') {\n ++pos;\n }\n self.buffer = buffer.substr(pos);\n return line;\n }\n\n // 3.2 WebVTT metadata header syntax\n function parseHeader(input) {\n parseOptions(input, function (k, v) {\n switch (k) {\n case 'Region':\n // 3.3 WebVTT region metadata header syntax\n console.log('parse region', v);\n //parseRegion(v);\n break;\n }\n }, /:/);\n }\n\n // 5.1 WebVTT file parsing.\n try {\n var line;\n if (self.state === 'INITIAL') {\n // We can't start parsing until we have the first line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n line = collectNextLine();\n\n var m = line.match(/^WEBVTT([ \\t].*)?$/);\n if (!m || !m[0]) {\n throw new Error('Malformed WebVTT signature.');\n }\n\n self.state = 'HEADER';\n }\n\n var alreadyCollectedLine = false;\n while (self.buffer) {\n // We can't parse a line until we have the full line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n if (!alreadyCollectedLine) {\n line = collectNextLine();\n } else {\n alreadyCollectedLine = false;\n }\n\n switch (self.state) {\n case 'HEADER':\n // 13-18 - Allow a header (metadata) under the WEBVTT line.\n if (/:/.test(line)) {\n parseHeader(line);\n } else if (!line) {\n // An empty line terminates the header and starts the body (cues).\n self.state = 'ID';\n }\n continue;\n case 'NOTE':\n // Ignore NOTE blocks.\n if (!line) {\n self.state = 'ID';\n }\n continue;\n case 'ID':\n // Check for the start of NOTE blocks.\n if (/^NOTE($|[ \\t])/.test(line)) {\n self.state = 'NOTE';\n break;\n }\n // 19-29 - Allow any number of line terminators, then initialize new cue values.\n if (!line) {\n continue;\n }\n self.cue = new _vttcue2.default(0, 0, '');\n self.state = 'CUE';\n // 30-39 - Check if self line contains an optional identifier or timing data.\n if (line.indexOf('-->') === -1) {\n self.cue.id = line;\n continue;\n }\n // Process line as start of a cue.\n /*falls through*/\n case 'CUE':\n // 40 - Collect cue timings and settings.\n try {\n parseCue(line, self.cue, self.regionList);\n } catch (e) {\n // In case of an error ignore rest of the cue.\n self.cue = null;\n self.state = 'BADCUE';\n continue;\n }\n self.state = 'CUETEXT';\n continue;\n case 'CUETEXT':\n var hasSubstring = line.indexOf('-->') !== -1;\n // 34 - If we have an empty line then report the cue.\n // 35 - If we have the special substring '-->' then report the cue,\n // but do not collect the line as we need to process the current\n // one as a new cue.\n if (!line || hasSubstring && (alreadyCollectedLine = true)) {\n // We are done parsing self cue.\n if (self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n self.state = 'ID';\n continue;\n }\n if (self.cue.text) {\n self.cue.text += '\\n';\n }\n self.cue.text += line;\n continue;\n case 'BADCUE':\n // BADCUE\n // 54-62 - Collect and discard the remaining cue.\n if (!line) {\n self.state = 'ID';\n }\n continue;\n }\n }\n } catch (e) {\n\n // If we are currently parsing a cue, report what we have.\n if (self.state === 'CUETEXT' && self.cue && self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n // Enter BADWEBVTT state if header was not parsed correctly otherwise\n // another exception occurred so enter BADCUE state.\n self.state = self.state === 'INITIAL' ? 'BADWEBVTT' : 'BADCUE';\n }\n return this;\n },\n flush: function flush() {\n var self = this;\n try {\n // Finish decoding the stream.\n self.buffer += self.decoder.decode();\n // Synthesize the end of the current cue or region.\n if (self.cue || self.state === 'HEADER') {\n self.buffer += '\\n\\n';\n self.parse();\n }\n // If we've flushed, parsed, and we're still on the INITIAL state then\n // that means we don't have enough of the stream to parse the first\n // line.\n if (self.state === 'INITIAL') {\n throw new Error('Malformed WebVTT signature.');\n }\n } catch (e) {\n throw e;\n }\n if (self.onflush) {\n self.onflush();\n }\n return this;\n }\n};\n\nexports.fixLineBreaks = fixLineBreaks;\nexports.default = VTTParser;\n\n},{\"55\":55}],57:[function(_dereq_,module,exports){\n'use strict';\n\nvar _vttparser = _dereq_(56);\n\nvar _vttparser2 = _interopRequireDefault(_vttparser);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// String.prototype.startsWith is not supported in IE11\nvar startsWith = function startsWith(inputString, searchString, position) {\n return inputString.substr(position || 0, searchString.length) === searchString;\n};\n\nvar cueString2millis = function cueString2millis(timeString) {\n var ts = parseInt(timeString.substr(-3));\n var secs = parseInt(timeString.substr(-6, 2));\n var mins = parseInt(timeString.substr(-9, 2));\n var hours = timeString.length > 9 ? parseInt(timeString.substr(0, timeString.indexOf(':'))) : 0;\n\n if (isNaN(ts) || isNaN(secs) || isNaN(mins) || isNaN(hours)) {\n return -1;\n }\n\n ts += 1000 * secs;\n ts += 60 * 1000 * mins;\n ts += 60 * 60 * 1000 * hours;\n\n return ts;\n};\n\n// From https://github.com/darkskyapp/string-hash\nvar hash = function hash(text) {\n var hash = 5381;\n var i = text.length;\n while (i) {\n hash = hash * 33 ^ text.charCodeAt(--i);\n }\n return (hash >>> 0).toString();\n};\n\nvar calculateOffset = function calculateOffset(vttCCs, cc, presentationTime) {\n var currCC = vttCCs[cc];\n var prevCC = vttCCs[currCC.prevCC];\n\n // This is the first discontinuity or cues have been processed since the last discontinuity\n // Offset = current discontinuity time\n if (!prevCC || !prevCC.new && currCC.new) {\n vttCCs.ccOffset = vttCCs.presentationOffset = currCC.start;\n currCC.new = false;\n return;\n }\n\n // There have been discontinuities since cues were last parsed.\n // Offset = time elapsed\n while (prevCC && prevCC.new) {\n vttCCs.ccOffset += currCC.start - prevCC.start;\n currCC.new = false;\n currCC = prevCC;\n prevCC = vttCCs[currCC.prevCC];\n }\n\n vttCCs.presentationOffset = presentationTime;\n};\n\nvar WebVTTParser = {\n parse: function parse(vttByteArray, syncPTS, vttCCs, cc, callBack, errorCallBack) {\n // Convert byteArray into string, replacing any somewhat exotic linefeeds with \"\\n\", then split on that character.\n var re = /\\r\\n|\\n\\r|\\n|\\r/g;\n var vttLines = String.fromCharCode.apply(null, new Uint8Array(vttByteArray)).trim().replace(re, '\\n').split('\\n');\n var cueTime = '00:00.000';\n var mpegTs = 0;\n var localTime = 0;\n var presentationTime = 0;\n var cues = [];\n var parsingError = void 0;\n var inHeader = true;\n // let VTTCue = VTTCue || window.TextTrackCue;\n\n // Create parser object using VTTCue with TextTrackCue fallback on certain browsers.\n var parser = new _vttparser2.default();\n\n parser.oncue = function (cue) {\n // Adjust cue timing; clamp cues to start no earlier than - and drop cues that don't end after - 0 on timeline.\n var currCC = vttCCs[cc];\n var cueOffset = vttCCs.ccOffset;\n\n // Update offsets for new discontinuities\n if (currCC && currCC.new) {\n if (localTime !== undefined) {\n // When local time is provided, offset = discontinuity start time - local time\n cueOffset = vttCCs.ccOffset = currCC.start;\n } else {\n calculateOffset(vttCCs, cc, presentationTime);\n }\n }\n\n if (presentationTime) {\n // If we have MPEGTS, offset = presentation time + discontinuity offset\n cueOffset = presentationTime + vttCCs.ccOffset - vttCCs.presentationOffset;\n }\n\n cue.startTime += cueOffset - localTime;\n cue.endTime += cueOffset - localTime;\n\n // Create a unique hash id for a cue based on start/end times and text.\n // This helps timeline-controller to avoid showing repeated captions.\n cue.id = hash(cue.startTime) + hash(cue.endTime) + hash(cue.text);\n\n // Fix encoding of special characters. TODO: Test with all sorts of weird characters.\n cue.text = decodeURIComponent(escape(cue.text));\n if (cue.endTime > 0) {\n cues.push(cue);\n }\n };\n\n parser.onparsingerror = function (e) {\n parsingError = e;\n };\n\n parser.onflush = function () {\n if (parsingError && errorCallBack) {\n errorCallBack(parsingError);\n return;\n }\n callBack(cues);\n };\n\n // Go through contents line by line.\n vttLines.forEach(function (line) {\n if (inHeader) {\n // Look for X-TIMESTAMP-MAP in header.\n if (startsWith(line, 'X-TIMESTAMP-MAP=')) {\n // Once found, no more are allowed anyway, so stop searching.\n inHeader = false;\n // Extract LOCAL and MPEGTS.\n line.substr(16).split(',').forEach(function (timestamp) {\n if (startsWith(timestamp, 'LOCAL:')) {\n cueTime = timestamp.substr(6);\n } else if (startsWith(timestamp, 'MPEGTS:')) {\n mpegTs = parseInt(timestamp.substr(7));\n }\n });\n try {\n // Calculate subtitle offset in milliseconds.\n // If sync PTS is less than zero, we have a 33-bit wraparound, which is fixed by adding 2^33 = 8589934592.\n syncPTS = syncPTS < 0 ? syncPTS + 8589934592 : syncPTS;\n // Adjust MPEGTS by sync PTS.\n mpegTs -= syncPTS;\n // Convert cue time to seconds\n localTime = cueString2millis(cueTime) / 1000;\n // Convert MPEGTS to seconds from 90kHz.\n presentationTime = mpegTs / 90000;\n\n if (localTime === -1) {\n parsingError = new Error('Malformed X-TIMESTAMP-MAP: ' + line);\n }\n } catch (e) {\n parsingError = new Error('Malformed X-TIMESTAMP-MAP: ' + line);\n }\n // Return without parsing X-TIMESTAMP-MAP line.\n return;\n } else if (line === '') {\n inHeader = false;\n }\n }\n // Parse line by default.\n parser.parse(line + '\\n');\n });\n\n parser.flush();\n }\n};\n\nmodule.exports = WebVTTParser;\n\n},{\"56\":56}],58:[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_(53);\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 var stats = this.stats;\n stats.tfirst = 0;\n stats.loaded = 0;\n var xhrSetup = this.xhrSetup;\n\n try {\n if (xhrSetup) {\n try {\n xhrSetup(xhr, context.url);\n } catch (e) {\n // fix xhrSetup: (xhr, url) => {xhr.setRequestHeader(\"Content-Language\", \"test\");}\n // not working, as xhr.setRequestHeader expects xhr.readyState === OPEN\n xhr.open('GET', context.url, true);\n xhrSetup(xhr, context.url);\n }\n }\n if (!xhr.readyState) {\n xhr.open('GET', context.url, true);\n }\n } catch (e) {\n // IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS\n this.callbacks.onError({ code: xhr.status, text: e.message }, context);\n return;\n }\n\n if (context.rangeEnd) {\n xhr.setRequestHeader('Range', 'bytes=' + context.rangeStart + '-' + (context.rangeEnd - 1));\n }\n xhr.onreadystatechange = this.readystatechange.bind(this);\n xhr.onprogress = this.loadprogress.bind(this);\n xhr.responseType = context.responseType;\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 // >= HEADERS_RECEIVED\n if (readyState >= 2) {\n // clear xhr timeout and rearm it if readyState less than 4\n window.clearTimeout(this.requestTimeout);\n if (stats.tfirst === 0) {\n stats.tfirst = Math.max(performance.now(), 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 } else {\n // readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout);\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},{\"53\":53}]},{},[40])(40)\n});\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(12), __webpack_require__(0));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"shaka-player\", \"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsDash\"] = factory(require(\"shaka-player\"), require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsDash\"] = factory(root[\"shaka\"], root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {\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/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _get = function get(object, property, receiver) { 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 { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\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 _shakaPlayer = __webpack_require__(1);\n\nvar _shakaPlayer2 = _interopRequireDefault(_shakaPlayer);\n\nvar _playkitJs = __webpack_require__(2);\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\n/**\n * Adapter of shaka lib for dash content\n * @classdesc\n */\nvar DashAdapter = function (_BaseMediaSourceAdapt) {\n _inherits(DashAdapter, _BaseMediaSourceAdapt);\n\n _createClass(DashAdapter, null, [{\n key: 'canPlayType',\n\n\n /**\n * Checks if dash adapter can play a given mime type\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @returns {boolean} - Whether the dash adapter can play a specific mime type\n * @static\n */\n\n /**\n * The shaka player instance\n * @member {any} _shaka\n * @private\n */\n\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n\n /**\n * The adapter logger\n * @member {any} _logger\n * @private\n * @static\n */\n value: function canPlayType(mimeType) {\n var canPlayType = typeof mimeType === 'string' ? mimeType.toLowerCase() === DashAdapter._dashMimeType : false;\n DashAdapter._logger.debug('canPlayType result for mimeType: ' + mimeType + ' is ' + canPlayType.toString());\n return canPlayType;\n }\n\n /**\n * Checks if the dash adapter is supported\n * @function isSupported\n * @returns {boolean} - Whether dash is supported.\n * @static\n */\n\n /**\n * The supported mime type by the dash adapter\n * @member {string} _dashMimeType\n * @static\n * @private\n */\n\n /**\n * The id of Adapter\n * @member {string} id\n * @static\n * @public\n */\n\n }, {\n key: 'isSupported',\n value: function isSupported() {\n _shakaPlayer2.default.polyfill.installAll();\n var isSupported = _shakaPlayer2.default.Player.isBrowserSupported();\n DashAdapter._logger.debug('isSupported:' + isSupported);\n return isSupported;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to the dash adapter\n * @param {Object} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n\n }]);\n\n function DashAdapter(videoElement, source) {\n var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n _classCallCheck(this, DashAdapter);\n\n DashAdapter._logger.debug('Creating adapter. Shaka version: ' + _shakaPlayer2.default.Player.version);\n\n var _this = _possibleConstructorReturn(this, (DashAdapter.__proto__ || Object.getPrototypeOf(DashAdapter)).call(this, videoElement, source, config));\n\n _this._shaka = new _shakaPlayer2.default.Player(videoElement);\n _this._shaka.configure(config);\n _this._addBindings();\n return _this;\n }\n\n /**\n * Add the required bindings to shaka.\n * @function _addBindings\n * @private\n * @returns {void}\n */\n\n\n _createClass(DashAdapter, [{\n key: '_addBindings',\n value: function _addBindings() {\n this._shaka.addEventListener('adaptation', this._onAdaptation.bind(this));\n this._shaka.addEventListener('error', this._onError.bind(this));\n }\n\n /**\n * Remove the bindings to shaka.\n * @function _removeBindings\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_removeBindings',\n value: function _removeBindings() {\n this._shaka.removeEventListener('adaptation', this._onAdaptation);\n this._shaka.removeEventListener('error', this._onError);\n }\n\n /**\n * Load the video source\n * @function load\n * @override\n */\n\n }, {\n key: 'load',\n value: function load() {\n var _this2 = this;\n\n if (!this._loadPromise) {\n this._loadPromise = new Promise(function (resolve, reject) {\n if (_this2._sourceObj && _this2._sourceObj.url) {\n _this2._shaka.load(_this2._sourceObj.url).then(function () {\n var data = { tracks: _this2._getParsedTracks() };\n DashAdapter._logger.debug('The source has been loaded successfully');\n resolve(data);\n }).catch(function (error) {\n reject(error);\n _this2._onError(error);\n });\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroying the dash adapter\n * @function destroy\n * @override\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n DashAdapter._logger.debug('destroy');\n _get(DashAdapter.prototype.__proto__ || Object.getPrototypeOf(DashAdapter.prototype), 'destroy', this).call(this);\n this._loadPromise = null;\n this._removeBindings();\n this._shaka.destroy();\n }\n\n /**\n * Get the original video tracks\n * @function _getVideoTracks\n * @returns {Array<Object>} - The original video tracks\n * @private\n */\n\n }, {\n key: '_getVideoTracks',\n value: function _getVideoTracks() {\n var variantTracks = this._shaka.getVariantTracks();\n var activeVariantTrack = variantTracks.filter(function (variantTrack) {\n return variantTrack.active;\n })[0];\n var videoTracks = variantTracks.filter(function (variantTrack) {\n return variantTrack.audioId === activeVariantTrack.audioId;\n });\n return videoTracks;\n }\n\n /**\n * Get the original audio tracks\n * @function _getAudioTracks\n * @returns {Array<Object>} - The original audio tracks\n * @private\n */\n\n }, {\n key: '_getAudioTracks',\n value: function _getAudioTracks() {\n var variantTracks = this._shaka.getVariantTracks();\n var activeVariantTrack = variantTracks.filter(function (variantTrack) {\n return variantTrack.active;\n })[0];\n var audioTracks = variantTracks.filter(function (variantTrack) {\n return variantTrack.videoId === activeVariantTrack.videoId;\n });\n return audioTracks;\n }\n\n /**\n * Get the parsed tracks\n * @function _getParsedTracks\n * @returns {Array<Track>} - The parsed tracks\n * @private\n */\n\n }, {\n key: '_getParsedTracks',\n value: function _getParsedTracks() {\n var videoTracks = this._getParsedVideoTracks();\n var audioTracks = this._getParsedAudioTracks();\n var textTracks = this._getParsedTextTracks();\n return videoTracks.concat(audioTracks).concat(textTracks);\n }\n\n /**\n * Get the parsed video tracks\n * @function _getParsedVideoTracks\n * @returns {Array<VideoTrack>} - The parsed video tracks\n * @private\n */\n\n }, {\n key: '_getParsedVideoTracks',\n value: function _getParsedVideoTracks() {\n var videoTracks = this._getVideoTracks();\n var parsedTracks = [];\n if (videoTracks) {\n for (var i = 0; i < videoTracks.length; i++) {\n var settings = {\n id: videoTracks[i].id,\n bandwidth: videoTracks[i].bandwidth,\n active: videoTracks[i].active,\n label: videoTracks[i].label,\n index: i\n };\n parsedTracks.push(new _playkitJs.VideoTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed audio tracks\n * @function _getParsedAudioTracks\n * @returns {Array<AudioTrack>} - The parsed audio tracks\n * @private\n */\n\n }, {\n key: '_getParsedAudioTracks',\n value: function _getParsedAudioTracks() {\n var audioTracks = this._getAudioTracks();\n var parsedTracks = [];\n if (audioTracks) {\n for (var i = 0; i < audioTracks.length; i++) {\n var settings = {\n id: audioTracks[i].id,\n active: audioTracks[i].active,\n label: audioTracks[i].label,\n language: audioTracks[i].language,\n index: i\n };\n parsedTracks.push(new _playkitJs.AudioTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed text tracks\n * @function _getParsedTextTracks\n * @returns {Array<TextTrack>} - The parsed text tracks\n * @private\n */\n\n }, {\n key: '_getParsedTextTracks',\n value: function _getParsedTextTracks() {\n var textTracks = this._shaka.getTextTracks();\n var parsedTracks = [];\n if (textTracks) {\n for (var i = 0; i < textTracks.length; i++) {\n var settings = {\n kind: textTracks[i].kind ? textTracks[i].kind + 's' : \"\",\n active: textTracks[i].active,\n label: textTracks[i].label,\n language: textTracks[i].language,\n index: i\n };\n parsedTracks.push(new _playkitJs.TextTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Select a video track\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the video track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectVideoTrack',\n value: function selectVideoTrack(videoTrack) {\n var videoTracks = this._getVideoTracks();\n if (videoTrack instanceof _playkitJs.VideoTrack && videoTracks) {\n var selectedVideoTrack = videoTracks[videoTrack.index];\n if (selectedVideoTrack) {\n this._shaka.configure({ abr: { enabled: false } });\n if (!selectedVideoTrack.active) {\n this._shaka.selectVariantTrack(videoTracks[videoTrack.index], true);\n this._onTrackChanged(videoTrack);\n }\n }\n }\n }\n\n /**\n * Select an audio track\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectAudioTrack',\n value: function selectAudioTrack(audioTrack) {\n if (audioTrack instanceof _playkitJs.AudioTrack && !audioTrack.active) {\n this._shaka.selectAudioLanguage(audioTrack.language);\n this._onTrackChanged(audioTrack);\n }\n }\n\n /**\n * Select a text track\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectTextTrack',\n value: function selectTextTrack(textTrack) {\n if (textTrack instanceof _playkitJs.TextTrack && !textTrack.active && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions')) {\n this._shaka.selectTextLanguage(textTrack.language);\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Enables adaptive bitrate switching\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'enableAdaptiveBitrate',\n value: function enableAdaptiveBitrate() {\n this._shaka.configure({ abr: { enabled: true } });\n }\n\n /**\n * An handler to shaka adaptation event\n * @function _onAdaptation\n * @returns {void}\n * @private\n */\n\n }, {\n key: '_onAdaptation',\n value: function _onAdaptation() {\n var selectedVideoTrack = this._getParsedVideoTracks().filter(function (videoTrack) {\n return videoTrack.active;\n })[0];\n this._onTrackChanged(selectedVideoTrack);\n }\n\n /**\n * An handler to shaka error event\n * @function _onError\n * @param {any} error - the error\n * @returns {void}\n * @private\n */\n\n }, {\n key: '_onError',\n value: function _onError(error) {\n DashAdapter._logger.error(error);\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * In case the adapter preformed a load it will return the manifest url.\n * @public\n * @returns {string} - The src url.\n */\n\n }, {\n key: 'src',\n get: function get() {\n if (this._loadPromise && this._sourceObj) {\n return this._sourceObj.url;\n }\n return \"\";\n }\n }]);\n\n return DashAdapter;\n}(_playkitJs.BaseMediaSourceAdapter);\n\n// Register DashAdapter to the media source adapter manager\n\n\nDashAdapter.id = 'DashAdapter';\nDashAdapter._logger = _playkitJs.BaseMediaSourceAdapter.getLogger(DashAdapter.id);\nDashAdapter._dashMimeType = 'application/dash+xml';\nexports.default = DashAdapter;\nif (DashAdapter.isSupported()) {\n (0, _playkitJs.registerMediaSourceAdapter)(DashAdapter);\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n/***/ })\n/******/ ]);\n});\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_RESULT__;(function(){var g={};\n(function(window){var k,aa=this;aa.we=!0;function n(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.Be=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.ye=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};/*\n\n Copyright 2016 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\nfunction 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 t(a,b,c,d){this.severity=a;this.category=b;this.code=c;this.data=Array.prototype.slice.call(arguments,3)}n(\"shaka.util.Error\",t);t.prototype.toString=function(){return\"shaka.util.Error \"+JSON.stringify(this,null,\" \")};t.Severity={RECOVERABLE:1,CRITICAL:2};t.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9};\nt.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,\nMP4_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,\nDASH_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,\nHLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,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,\nOFFLINE_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};var ha=/^(?:([^:/?#.]+):)?(?:\\/\\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$/;function ia(a){var b;a instanceof ia?(ja(this,a.aa),this.Ba=a.Ba,this.ca=a.ca,ka(this,a.Ja),this.W=a.W,la(this,ma(a.a)),this.ta=a.ta):a&&(b=String(a).match(ha))?(ja(this,b[1]||\"\",!0),this.Ba=na(b[2]||\"\"),this.ca=na(b[3]||\"\",!0),ka(this,b[4]),this.W=na(b[5]||\"\",!0),la(this,b[6]||\"\",!0),this.ta=na(b[7]||\"\")):this.a=new oa(null)}k=ia.prototype;k.aa=\"\";k.Ba=\"\";k.ca=\"\";k.Ja=null;k.W=\"\";k.ta=\"\";\nk.toString=function(){var a=[],b=this.aa;b&&a.push(qa(b,ra,!0),\":\");if(b=this.ca){a.push(\"//\");var c=this.Ba;c&&a.push(qa(c,ra,!0),\"@\");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,\"%$1\"));b=this.Ja;null!=b&&a.push(\":\",String(b))}if(b=this.W)this.ca&&\"/\"!=b.charAt(0)&&a.push(\"/\"),a.push(qa(b,\"/\"==b.charAt(0)?sa:ta,!0));(b=this.a.toString())&&a.push(\"?\",b);(b=this.ta)&&a.push(\"#\",qa(b,ua));return a.join(\"\")};\nk.resolve=function(a){var b=new ia(this);\"data\"===b.aa&&(b=new ia);var c=!!a.aa;c?ja(b,a.aa):c=!!a.Ba;c?b.Ba=a.Ba:c=!!a.ca;c?b.ca=a.ca:c=null!=a.Ja;var d=a.W;if(c)ka(b,a.Ja);else if(c=!!a.W){if(\"/\"!=d.charAt(0))if(this.ca&&!this.W)d=\"/\"+d;else{var e=b.W.lastIndexOf(\"/\");-1!=e&&(d=b.W.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<\nf.length||1==f.length&&\"\"!=f[0])&&f.pop(),e&&g==d.length&&f.push(\"\")):(f.push(h),e=!0)}d=f.join(\"/\")}}c?b.W=d:c=\"\"!==a.a.toString();c?la(b,ma(a.a)):c=!!a.ta;c&&(b.ta=a.ta);return b};function ja(a,b,c){a.aa=c?na(b,!0):b;a.aa&&(a.aa=a.aa.replace(/:$/,\"\"))}function ka(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\"Bad port number \"+b);a.Ja=b}else a.Ja=null}function la(a,b,c){b instanceof oa?a.a=b:(c||(b=qa(b,va)),a.a=new oa(b))}\nfunction na(a,b){return a?b?decodeURI(a):decodeURIComponent(a):\"\"}function qa(a,b,c){return\"string\"==typeof a?(a=encodeURI(a).replace(b,wa),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\"%$1\")),a):null}function wa(a){a=a.charCodeAt(0);return\"%\"+(a>>4&15).toString(16)+(a&15).toString(16)}var ra=/[#\\/\\?@]/g,ta=/[\\#\\?:]/g,sa=/[\\#\\?]/g,va=/[\\#\\?@]/g,ua=/#/g;function oa(a){this.b=a||null}oa.prototype.a=null;oa.prototype.c=null;\noa.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 ma(a){var b=new oa;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 xa(a,b){return a.reduce(function(a,b,e){return b[\"catch\"](a.bind(null,e))}.bind(null,b),Promise.reject())}function x(a,b){return a.concat(b)}function y(){}function ya(a){return null!=a}function za(a){return function(b){return b!=a}}function Aa(a,b,c){return c.indexOf(a)==b};function z(a,b){if(!b.length)return a;var c=b.map(function(a){return new ia(a)});return a.map(function(a){return new ia(a)}).map(function(a){return c.map(a.resolve.bind(a))}).reduce(x,[]).map(function(a){return a.toString()})}function Ba(a,b){return{keySystem:a,licenseServerUri:\"\",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:\"\",videoRobustness:\"\",serverCertificate:null,initData:b||[],keyIds:[]}};function Ca(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],m=!!{\".abr.manager\":!0}[h]||!!{serverCertificate:!0}[g];if(f||g in a)void 0===b[g]?void 0===l||f?delete a[g]:a[g]=l:m?a[g]=b[g]:\"object\"==typeof a[g]&&\"object\"==typeof b[g]?Ca(a[g],b[g],l,d,h):typeof b[g]==typeof l&&(a[g]=b[g])}}function Da(a){return JSON.parse(JSON.stringify(a))};function A(){var a,b,c=new Promise(function(c,e){a=c;b=e});c.resolve=a;c.reject=b;return c};function B(a){this.f=!1;this.a=[];this.b=[];this.c=[];this.h=a||null}n(\"shaka.net.NetworkingEngine\",B);B.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3};var Ea={};B.registerScheme=function(a,b){Ea[a]=b};B.unregisterScheme=function(a){delete Ea[a]};B.prototype.Ld=function(a){this.b.push(a)};B.prototype.registerRequestFilter=B.prototype.Ld;B.prototype.oe=function(a){var b=this.b;a=b.indexOf(a);0<=a&&b.splice(a,1)};B.prototype.unregisterRequestFilter=B.prototype.oe;\nB.prototype.Ic=function(){this.b=[]};B.prototype.clearAllRequestFilters=B.prototype.Ic;B.prototype.Md=function(a){this.c.push(a)};B.prototype.registerResponseFilter=B.prototype.Md;B.prototype.pe=function(a){var b=this.c;a=b.indexOf(a);0<=a&&b.splice(a,1)};B.prototype.unregisterResponseFilter=B.prototype.pe;B.prototype.Jc=function(){this.c=[]};B.prototype.clearAllResponseFilters=B.prototype.Jc;function Fa(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0}}\nfunction C(a,b){return{uris:a,method:\"GET\",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b}}B.prototype.m=function(){this.f=!0;this.b=[];this.c=[];for(var a=[],b=0;b<this.a.length;++b)a.push(this.a[b][\"catch\"](y));return Promise.all(a)};B.prototype.destroy=B.prototype.m;\nB.prototype.request=function(a,b){if(this.f)return Promise.reject();b.method=b.method||\"GET\";b.headers=b.headers||{};b.retryParameters=b.retryParameters?Da(b.retryParameters):Fa();b.uris=Da(b.uris);var c=Date.now(),d=Promise.resolve();this.b.forEach(function(c){d=d.then(c.bind(null,a,b))});d=d[\"catch\"](function(a){throw new t(2,1,1006,a);});d=d.then(function(){for(var d=Date.now()-c,f=b.retryParameters||{},g=f.maxAttempts||1,h=f.backoffFactor||2,f=null==f.baseDelay?1E3:f.baseDelay,l=this.g(a,b,0,\nd),m=1;m<g;m++)l=l[\"catch\"](function(c,e,f){if(f&&1==f.severity){f=new A;var g=b.retryParameters||{};window.setTimeout(f.resolve,c*(1+(2*Math.random()-1)*(null==g.fuzzFactor?.5:g.fuzzFactor)));return f.then(this.g.bind(this,a,b,e,d))}throw f;}.bind(this,f,m%b.uris.length)),f*=h;return l}.bind(this));this.a.push(d);return d.then(function(b){0<=this.a.indexOf(d)&&this.a.splice(this.a.indexOf(d),1);this.h&&!b.fromCache&&1==a&&this.h(b.timeMs,b.data.byteLength);return b}.bind(this))[\"catch\"](function(a){a&&\n(a.severity=2);0<=this.a.indexOf(d)&&this.a.splice(this.a.indexOf(d),1);return Promise.reject(a)}.bind(this))};B.prototype.request=B.prototype.request;\nB.prototype.g=function(a,b,c,d){if(this.f)return Promise.reject();var e=new ia(b.uris[c]),f=e.aa;f||(f=location.protocol,f=f.slice(0,-1),ja(e,f),b.uris[c]=e.toString());f=Ea[f];if(!f)return Promise.reject(new t(2,1,1E3,e));var g=Date.now();return f(b.uris[c],b,a).then(function(b){void 0==b.timeMs&&(b.timeMs=Date.now()-g);var c=Date.now(),e=Promise.resolve();this.c.forEach(function(c){e=e.then(function(){return Promise.resolve(c(a,b))}.bind(this))});e=e[\"catch\"](function(a){var b=2;a instanceof t&&\n(b=a.severity);throw new t(b,1,1007,a);});return e.then(function(){b.timeMs+=Date.now()-c;b.timeMs+=d;return b})}.bind(this))};function Ga(a,b){for(var c=[],d=0;d<a.length;++d){for(var e=!1,f=0;f<c.length&&!(e=b?b(a[d],c[f]):a[d]===c[f]);++f);e||c.push(a[d])}return c}function Ha(a,b,c){for(var d=0;d<a.length;++d)if(c(a[d],b))return d;return-1};function Ia(){this.a={}}Ia.prototype.push=function(a,b){this.a.hasOwnProperty(a)?this.a[a].push(b):this.a[a]=[b]};Ia.prototype.get=function(a){return(a=this.a[a])?a.slice():null};Ia.prototype.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)};function D(){this.a=new Ia}D.prototype.m=function(){Ja(this);this.a=null;return Promise.resolve()};function E(a,b,c,d){a.a&&(b=new Ka(b,c,d),a.a.push(c,b))}function La(a,b,c,d){E(a,b,c,function(a){this.ha(b,c);d(a)}.bind(a))}D.prototype.ha=function(a,b){if(this.a)for(var c=this.a.get(b)||[],d=0;d<c.length;++d){var e=c[d];e.target==a&&(e.ha(),this.a.remove(b,e))}};function Ja(a){if(a.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].ha();a.a.a={}}}\nfunction Ka(a,b,c){this.target=a;this.type=b;this.a=c;this.target.addEventListener(b,c,!1)}Ka.prototype.ha=function(){this.target.removeEventListener(this.type,this.a,!1);this.a=this.target=null};function Ma(a){return!a||!Object.keys(a).length}function Na(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,b){Object.keys(a).forEach(function(c){b(c,a[c])})};function F(a){if(!a)return\"\";a=new Uint8Array(a);239==a[0]&&187==a[1]&&191==a[2]&&(a=a.subarray(3));a=escape(Ra(a));try{return decodeURIComponent(a)}catch(b){throw new t(2,2,2004);}}n(\"shaka.util.StringUtils.fromUTF8\",F);\nfunction Sa(a,b,c){if(!a)return\"\";if(!c&&a.byteLength%2)throw new t(2,2,2004);if(a instanceof ArrayBuffer)var d=a;else c=new Uint8Array(a.byteLength),c.set(new Uint8Array(a)),d=c.buffer;a=Math.floor(a.byteLength/2);c=new Uint16Array(a);d=new DataView(d);for(var e=0;e<a;e++)c[e]=d.getUint16(2*e,b);return Ra(c)}n(\"shaka.util.StringUtils.fromUTF16\",Sa);\nfunction Ta(a){var b=new Uint8Array(a);if(239==b[0]&&187==b[1]&&191==b[2])return F(b);if(254==b[0]&&255==b[1])return Sa(b.subarray(2),!1);if(255==b[0]&&254==b[1])return Sa(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 Sa(a,!0);if(c(0)&&c(1)&&c(2)&&c(3))return F(a)}else return Sa(a,!1);throw new t(2,2,2003);}n(\"shaka.util.StringUtils.fromBytesAutoDetect\",Ta);\nfunction Ua(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}n(\"shaka.util.StringUtils.toUTF8\",Ua);function Ra(a){for(var b=\"\",c=0;c<a.length;c+=16E3)b+=String.fromCharCode.apply(null,a.subarray(c,c+16E3));return b};function Va(a){this.a=null;this.b=function(){this.a=null;a()}.bind(this)}Va.prototype.cancel=function(){null!=this.a&&(clearTimeout(this.a),this.a=null)};function Wa(a){a.cancel();a.a=setTimeout(a.b,500)};function Xa(a,b){var c=void 0==b?!0:b,d=window.btoa(String.fromCharCode.apply(null,a)).replace(/\\+/g,\"-\").replace(/\\//g,\"_\");return c?d:d.replace(/=*$/,\"\")}n(\"shaka.util.Uint8ArrayUtils.toBase64\",Xa);function Ya(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}n(\"shaka.util.Uint8ArrayUtils.fromBase64\",Ya);\nfunction Za(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}n(\"shaka.util.Uint8ArrayUtils.fromHex\",Za);function $a(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}n(\"shaka.util.Uint8ArrayUtils.toHex\",$a);function ab(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}n(\"shaka.util.Uint8ArrayUtils.equal\",ab);\nn(\"shaka.util.Uint8ArrayUtils.concat\",function(a){for(var b=0,c=0;c<arguments.length;++c)b+=arguments[c].length;for(var b=new Uint8Array(b),d=0,c=0;c<arguments.length;++c)b.set(arguments[c],d),d+=arguments[c].length;return b});function bb(a,b,c,d){this.j=this.i=this.v=null;this.J=!1;this.b=null;this.f=new D;this.a=[];this.o=[];this.l=new A;this.ka=a;this.h=null;this.g=function(a){this.l.reject(a);b(a)}.bind(this);this.A={};this.Ca=c;this.la=d;this.B=new Va(this.Kd.bind(this));this.ja=this.c=!1;this.G=[];this.ia=!1;this.O=setInterval(this.Jd.bind(this),1E3);this.l[\"catch\"](function(){})}k=bb.prototype;\nk.m=function(){this.c=!0;var a=this.a.map(function(a){return(a.ba.close()||Promise.resolve())[\"catch\"](y)});this.l.reject();this.f&&a.push(this.f.m());this.j&&a.push(this.j.setMediaKeys(null)[\"catch\"](y));this.O&&(clearInterval(this.O),this.O=null);this.B&&this.B.cancel();this.f=this.j=this.i=this.v=this.b=this.B=null;this.a=[];this.o=[];this.la=this.g=this.h=this.ka=null;return Promise.all(a)};k.configure=function(a){this.h=a};\nk.init=function(a,b){var c={},d=[];this.ja=b;this.o=a.offlineSessionIds;cb(this,a,b||0<a.offlineSessionIds.length,c,d);return d.length?db(this,c,d):(this.J=!0,Promise.resolve())};\nfunction eb(a,b){if(!a.i)return La(a.f,b,\"encrypted\",function(){this.g(new t(2,6,6010))}.bind(a)),Promise.resolve();a.j=b;La(a.f,a.j,\"play\",a.qd.bind(a));var c=a.j.setMediaKeys(a.i),c=c[\"catch\"](function(a){return Promise.reject(new t(2,6,6003,a.message))}),d=null;a.b.serverCertificate&&(d=a.i.setServerCertificate(a.b.serverCertificate).then(function(){})[\"catch\"](function(a){return Promise.reject(new t(2,6,6004,a.message))}));return Promise.all([c,d]).then(function(){if(this.c)return Promise.reject();\nfb(this);this.b.initData.length||this.o.length||E(this.f,this.j,\"encrypted\",this.fd.bind(this))}.bind(a))[\"catch\"](function(a){return this.c?Promise.resolve():Promise.reject(a)}.bind(a))}function gb(a,b){return Promise.all(b.map(function(a){return hb(this,a).then(function(a){if(a){for(var b=new A,c=0;c<this.a.length;c++)if(this.a[c].ba==a){this.a[c].ib=b;break}return Promise.all([a.remove(),b])}}.bind(this))}.bind(a)))}\nfunction fb(a){var b=a.b?a.b.initData:[];b.forEach(function(a){ib(this,a.initDataType,a.initData)}.bind(a));a.o.forEach(function(a){hb(this,a)}.bind(a));b.length||a.o.length||a.l.resolve();return a.l}k.keySystem=function(){return this.b?this.b.keySystem:\"\"};function jb(a){return a.a.map(function(a){return a.ba.sessionId})}k.ab=function(){var a=this.a.map(function(a){a=a.ba.expiration;return isNaN(a)?Infinity:a});return Math.min.apply(Math,a)};\nfunction cb(a,b,c,d,e){var f=kb(a);b.periods.forEach(function(a){a.variants.forEach(function(a){f&&(a.drmInfos=[f]);a.drmInfos.forEach(function(b){lb(this,b);window.cast&&window.cast.__platform__&&\"com.microsoft.playready\"==b.keySystem&&(b.keySystem=\"com.chromecast.playready\");var f=d[b.keySystem];f||(f={audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:\"optional\",persistentState:c?\"required\":\"optional\",sessionTypes:[c?\"persistent-license\":\"temporary\"],label:b.keySystem,drmInfos:[]},\nd[b.keySystem]=f,e.push(b.keySystem));f.drmInfos.push(b);b.distinctiveIdentifierRequired&&(f.distinctiveIdentifier=\"required\");b.persistentStateRequired&&(f.persistentState=\"required\");var g=[];a.video&&g.push(a.video);a.audio&&g.push(a.audio);g.forEach(function(a){var c=\"video\"==a.type?f.videoCapabilities:f.audioCapabilities,d=(\"video\"==a.type?b.videoRobustness:b.audioRobustness)||\"\",e=a.mimeType;a.codecs&&(e+='; codecs=\"'+a.codecs+'\"');c.push({robustness:d,contentType:e})}.bind(this))}.bind(this))}.bind(this))}.bind(a))}\nfunction db(a,b,c){if(1==c.length&&\"\"==c[0])return Promise.reject(new t(2,6,6E3));var d=new A,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 t(2,\n6,6001))});e=e.then(function(a){if(this.c)return Promise.reject();var c=0<=navigator.userAgent.indexOf(\"Edge/\"),d=a.getConfiguration();this.v=(d.audioCapabilities||[]).concat(d.videoCapabilities||[]).map(function(a){return a.contentType});c&&(this.v=null);c=b[a.keySystem];mb(this,a.keySystem,c,c.drmInfos);return this.b.licenseServerUri?a.createMediaKeys():Promise.reject(new t(2,6,6012))}.bind(a)).then(function(a){if(this.c)return Promise.reject();this.i=a;this.J=!0}.bind(a))[\"catch\"](function(a){if(this.c)return Promise.resolve();\nthis.v=this.b=null;return a instanceof t?Promise.reject(a):Promise.reject(new t(2,6,6002,a.message))}.bind(a));d.reject();return e}\nfunction lb(a,b){var c=b.keySystem;if(c){if(!b.licenseServerUri){var d=a.h.servers[c];d&&(b.licenseServerUri=d)}b.keyIds||(b.keyIds=[]);if(c=a.h.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)}}\nfunction kb(a){if(Ma(a.h.clearKeys))return null;var b=[],c=[],d;for(d in a.h.clearKeys){var e=a.h.clearKeys[d],f=Za(d),e=Za(e),f={kty:\"oct\",kid:Xa(f,!1),k:Xa(e,!1)};b.push(f);c.push(f.kid)}a=JSON.stringify({keys:b});c=JSON.stringify({kids:c});c=[{initData:new Uint8Array(Ua(c)),initDataType:\"keyids\"}];return{keySystem:\"org.w3.clearkey\",licenseServerUri:\"data:application/json;base64,\"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:\"\",videoRobustness:\"\",serverCertificate:null,\ninitData:c,keyIds:[]}}function mb(a,b,c,d){var e=[],f=[],g=[],h=[];nb(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}}\nfunction nb(a,b,c,d,e){function f(a,b){return a.keyId&&a.keyId==b.keyId?!0:a.initDataType==b.initDataType&&ab(a.initData,b.initData)}a.forEach(function(a){-1==b.indexOf(a.licenseServerUri)&&b.push(a.licenseServerUri);a.serverCertificate&&-1==Ha(c,a.serverCertificate,ab)&&c.push(a.serverCertificate);a.initData&&a.initData.forEach(function(a){-1==Ha(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])})}\nk.fd=function(a){for(var b=new Uint8Array(a.initData),c=0;c<this.a.length;++c)if(ab(b,this.a[c].initData))return;ib(this,a.initDataType,b)};\nfunction hb(a,b){try{var c=a.i.createSession(\"persistent-license\")}catch(f){var d=new t(2,6,6005,f.message);a.g(d);return Promise.reject(d)}E(a.f,c,\"message\",a.kc.bind(a));E(a.f,c,\"keystatuseschange\",a.ec.bind(a));var e={initData:null,ba:c,loaded:!1,zb:Infinity,ib:null};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.l.resolve(),c;this.a.splice(this.a.indexOf(e),1);this.g(new t(2,6,6013))}}.bind(a),function(a){this.c||\n(this.a.splice(this.a.indexOf(e),1),this.g(new t(2,6,6005,a.message)))}.bind(a))}\nfunction ib(a,b,c){try{var d=a.ja?a.i.createSession(\"persistent-license\"):a.i.createSession()}catch(e){a.g(new t(2,6,6005,e.message));return}E(a.f,d,\"message\",a.kc.bind(a));E(a.f,d,\"keystatuseschange\",a.ec.bind(a));a.a.push({initData:c,ba:d,loaded:!1,zb:Infinity,ib:null});d.generateRequest(b,c.buffer)[\"catch\"](function(a){if(!this.c){for(var b=0;b<this.a.length;++b)if(this.a[b].ba==d){this.a.splice(b,1);break}this.g(new t(2,6,6006,a.message))}}.bind(a))}\nk.kc=function(a){this.h.delayLicenseRequestUntilPlayed&&this.j.paused&&!this.ia?this.G.push(a):ob(this,a)};\nfunction ob(a,b){for(var c=b.target,d,e=0;e<a.a.length;e++)if(a.a[e].ba==c){d=a.a[e].ib;break}e=C([a.b.licenseServerUri],a.h.retryParameters);e.body=b.message;e.method=\"POST\";\"com.microsoft.playready\"!=a.b.keySystem&&\"com.chromecast.playready\"!=a.b.keySystem||pb(e);a.ka.request(2,e).then(function(a){return this.c?Promise.reject():c.update(a.data).then(function(){d&&d.resolve()})}.bind(a),function(a){if(this.c)return Promise.resolve();a=new t(2,6,6007,a);this.g(a);d&&d.reject(a)}.bind(a))[\"catch\"](function(a){if(this.c)return Promise.resolve();\na=new t(2,6,6008,a.message);this.g(a);d&&d.reject(a)}.bind(a))}function pb(a){var b=Sa(a.body,!0,!0);if(-1==b.indexOf(\"PlayReadyKeyMessage\"))a.headers[\"Content-Type\"]=\"text/xml; charset=utf-8\";else{for(var 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=Ya(b.querySelector(\"Challenge\").textContent).buffer}}\nk.ec=function(a){a=a.target;var b;for(b=0;b<this.a.length&&this.a[b].ba!=a;++b);if(b!=this.a.length){var c=!1;a.keyStatuses.forEach(function(a,d){if(\"string\"==typeof d){var e=d;d=a;a=e}if(\"com.microsoft.playready\"==this.b.keySystem&&16==d.byteLength){var e=new DataView(d),f=e.getUint32(0,!0),l=e.getUint16(4,!0),m=e.getUint16(6,!0);e.setUint32(0,f,!1);e.setUint16(4,l,!1);e.setUint16(6,m,!1)}\"com.microsoft.playready\"==this.b.keySystem&&\"status-pending\"==a&&(a=\"usable\");\"status-pending\"!=a&&(this.a[b].loaded=\n!0,this.a.every(function(a){return a.loaded})&&this.l.resolve());\"expired\"==a&&(c=!0);e=$a(new Uint8Array(d));this.A[e]=a}.bind(this));var d=a.expiration-Date.now();(0>d||c&&1E3>d)&&!this.a[b].ib&&(this.a.splice(b,1),a.close());Wa(this.B)}};k.Kd=function(){function a(a,c){return\"expired\"==c}!Ma(this.A)&&Pa(this.A,a)&&this.g(new t(2,6,6014));this.Ca(this.A)};\nfunction qb(){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){var c=a.getConfiguration().sessionTypes;d[b]=\n{persistentState:c?0<=c.indexOf(\"persistent-license\"):!1};return a.createMediaKeys()})[\"catch\"](function(){d[b]=null});a.push(e)});return Promise.all(a).then(function(){return d})}k.qd=function(){for(var a=0;a<this.G.length;a++)ob(this,this.G[a]);this.ia=!0;this.G=[]};function rb(a,b){var c=a.keySystem();return!b.drmInfos.length||b.drmInfos.some(function(a){return a.keySystem==c})}\nfunction sb(a,b){if(!a.length)return b;if(!b.length)return a;for(var c=[],d=0;d<a.length;d++)for(var e=0;e<b.length;e++)if(a[d].keySystem==b[e].keySystem){var f=a[d],e=b[e],g=[],g=g.concat(f.initData||[]),g=g.concat(e.initData||[]),h=[],h=h.concat(f.keyIds),h=h.concat(e.keyIds);c.push({keySystem:f.keySystem,licenseServerUri:f.licenseServerUri||e.licenseServerUri,distinctiveIdentifierRequired:f.distinctiveIdentifierRequired||e.distinctiveIdentifierRequired,persistentStateRequired:f.persistentStateRequired||\ne.persistentStateRequired,videoRobustness:f.videoRobustness||e.videoRobustness,audioRobustness:f.audioRobustness||e.audioRobustness,serverCertificate:f.serverCertificate||e.serverCertificate,initData:g,keyIds:h});break}return c}k.Jd=function(){this.a.forEach(function(a){var b=a.zb,c=a.ba.expiration;isNaN(c)&&(c=Infinity);c!=b&&(this.la(a.ba.sessionId,c),a.zb=c)}.bind(this))};function tb(a){this.f=null;this.c=a;this.h=0;this.g=Infinity;this.a=this.b=null}var ub={};function vb(a,b){ub[a]=b.length?wb.bind(null,b):b}n(\"shaka.media.TextEngine.registerParser\",vb);n(\"shaka.media.TextEngine.unregisterParser\",function(a){delete ub[a]});function xb(a,b,c){return a>=b?null:new VTTCue(a,b,c)}n(\"shaka.media.TextEngine.makeCue\",xb);tb.prototype.m=function(){this.c&&yb(this,function(){return!0});this.c=this.f=null;return Promise.resolve()};\nfunction zb(a,b,c,d){return Promise.resolve().then(function(){if(this.c)if(null==c||null==d)this.f.parseInit(b);else{for(var a=this.f.parseMedia(b,{periodStart:this.h,segmentStart:c,segmentEnd:d}),f=0;f<a.length&&!(a[f].startTime>=this.g);++f)this.c.addCue(a[f]);null==this.b&&(this.b=c);this.a=Math.min(d,this.g)}}.bind(a))}\ntb.prototype.remove=function(a,b){return Promise.resolve().then(function(){this.c&&(yb(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 yb(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 wb(a){this.Na=a}\nwb.prototype.parseInit=function(a){this.Na(a,0,null,null)};wb.prototype.parseMedia=function(a,b){return this.Na(a,b.periodStart,b.segmentStart,b.segmentEnd)};function Ab(a){return!a||1==a.length&&1E-6>a.end(0)-a.start(0)?null:a.length?a.end(a.length-1):null}function Bb(a,b){return!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0)?!1:b>=a.start(0)&&b<=a.end(a.length-1)}function Cb(a,b){if(!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0))return 0;for(var c=0,d=a.length-1;0<=d&&a.end(d)>b;--d)c+=a.end(d)-Math.max(a.start(d),b);return c};function Db(a,b,c){this.f=a;this.N=b;this.i=c;this.c={};this.a=null;this.b={};this.g=new D;this.h=!1}\nfunction Eb(){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]=!!ub[b]||\nMediaSource.isTypeSupported(b);var c=b.split(\";\")[0];a[c]=a[c]||a[b]});return a}k=Db.prototype;k.m=function(){this.h=!0;var a=[],b;for(b in this.b){var c=this.b[b],d=c[0];this.b[b]=c.slice(0,1);d&&a.push(d.p[\"catch\"](y));for(d=1;d<c.length;++d)c[d].p[\"catch\"](y),c[d].p.reject()}this.a&&a.push(this.a.m());return Promise.all(a).then(function(){this.g.m();this.a=this.i=this.N=this.f=this.g=null;this.c={};this.b={}}.bind(this))};\nk.init=function(a){for(var b in a){var c=a[b];\"text\"==b?Fb(this,c):(c=this.N.addSourceBuffer(c),E(this.g,c,\"error\",this.je.bind(this,b)),E(this.g,c,\"updateend\",this.Ia.bind(this,b)),this.c[b]=c,this.b[b]=[])}};function Fb(a,b){a.a||(a.a=new tb(a.i));a.a.f=new ub[b]}function Gb(a,b){if(\"text\"==b)var c=a.a.b;else c=Ib(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 Ib(a,b){try{return a.c[b].buffered}catch(c){return null}}\nfunction Jb(a,b,c,d,e){return\"text\"==b?zb(a.a,c,d,e):Kb(a,b,a.ie.bind(a,b,c))}k.remove=function(a,b,c){return\"text\"==a?this.a.remove(b,c):Kb(this,a,this.qc.bind(this,a,b,c))};function Lb(a,b){return\"text\"==b?a.a.remove(0,Infinity):Kb(a,b,a.qc.bind(a,b,0,a.N.duration))}function Mb(a,b,c,d){if(\"text\"==b)return a.a.h=c,null!=d&&(a.a.g=d),Promise.resolve();null==d&&(d=Infinity);return Promise.all([Kb(a,b,a.Ec.bind(a,b)),Kb(a,b,a.Zd.bind(a,b,c)),Kb(a,b,a.Xd.bind(a,b,d))])}\nk.endOfStream=function(a){return Nb(this,function(){a?this.N.endOfStream(a):this.N.endOfStream()}.bind(this))};k.pa=function(a){return Nb(this,function(){this.N.duration=a}.bind(this))};k.Y=function(){return this.N.duration};k.ie=function(a,b){this.c[a].appendBuffer(b)};k.qc=function(a,b,c){c<=b?this.Ia(a):this.c[a].remove(b,c)};k.Ec=function(a){var b=this.c[a].appendWindowEnd;this.c[a].abort();this.c[a].appendWindowEnd=b;this.Ia(a)};k.Oc=function(a){this.f.currentTime-=.001;this.Ia(a)};\nk.Zd=function(a,b){this.c[a].timestampOffset=b;this.Ia(a)};k.Xd=function(a,b){this.c[a].appendWindowEnd=b+.04;this.Ia(a)};k.je=function(a){this.b[a][0].p.reject(new t(2,3,3014,this.f.error?this.f.error.code:0))};k.Ia=function(a){var b=this.b[a][0];b&&(b.p.resolve(),Ob(this,a))};\nfunction Kb(a,b,c){if(a.h)return Promise.reject();c={start:c,p:new A};a.b[b].push(c);if(1==a.b[b].length)try{c.start()}catch(d){\"QuotaExceededError\"==d.name?c.p.reject(new t(2,3,3017,b)):c.p.reject(new t(2,3,3015,d)),Ob(a,b)}return c.p}\nfunction Nb(a,b){if(a.h)return Promise.reject();var c=[],d;for(d in a.c){var e=new A,f={start:function(a){a.resolve()}.bind(null,e),p:e};a.b[d].push(f);c.push(e);1==a.b[d].length&&f.start()}return Promise.all(c).then(function(){var a;try{b()}catch(l){var c=Promise.reject(new t(2,3,3015,l))}for(a in this.c)Ob(this,a);return c}.bind(a),function(){return Promise.reject()}.bind(a))}function Ob(a,b){a.b[b].shift();var c=a.b[b][0];if(c)try{c.start()}catch(d){c.p.reject(new t(2,3,3015,d)),Ob(a,b)}};function Pb(a,b,c){return c==b||a>=Qb&&c==b.split(\"-\")[0]||a>=Rb&&c.split(\"-\")[0]==b.split(\"-\")[0]?!0:!1}var Qb=1,Rb=2;function Sb(a){a=a.toLowerCase().split(\"-\");var b=Tb[a[0]];b&&(a[0]=b);return a.join(\"-\")}\nvar Tb={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\",\nfry:\"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\",\nlug:\"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\",\nsrd:\"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 Ub(a,b,c){var d=a.video;return d&&(d.width<b.minWidth||d.width>b.maxWidth||d.width>c.width||d.height<b.minHeight||d.height>b.maxHeight||d.height>c.height||d.width*d.height<b.minPixels||d.width*d.height>b.maxPixels)||a.bandwidth<b.minBandwidth||a.bandwidth>b.maxBandwidth?!1:!0}function Vb(a,b,c){var d=!1;a.variants.forEach(function(a){var e=a.allowedByApplication;a.allowedByApplication=Ub(a,b,c);e!=a.allowedByApplication&&(d=!0)});return d}\nfunction Wb(a,b,c){var d=b.video,e=b.audio;for(b=0;b<c.variants.length;++b){var f=c.variants[b],g=a,h=e,l=d;(g&&g.J&&!rb(g,f)?0:Xb(f.audio,g,h)&&Xb(f.video,g,l))||(c.variants.splice(b,1),--b)}for(b=0;b<c.textStreams.length;++b)a=c.textStreams[b],ub[Yb(a.mimeType,a.codecs)]||(c.textStreams.splice(b,1),--b)}\nfunction Xb(a,b,c){if(!a)return!0;var d=null;b&&b.J&&(d=b.v);b=Yb(a.mimeType,a.codecs);return!ub[b]&&!MediaSource.isTypeSupported(b)||d&&a.encrypted&&0>d.indexOf(b)||c&&(a.mimeType!=c.mimeType||a.codecs.split(\".\")[0]!=c.codecs.split(\".\")[0])?!1:!0}\nfunction Zb(a,b,c){var d=null;return $b(a.variants).map(function(a){var e;a.video&&a.audio?e=c==a.video.id&&b==a.audio.id:e=a.video&&c==a.video.id||a.audio&&b==a.audio.id;var g=\"\";a.video&&(g+=a.video.codecs);a.audio&&(\"\"!=g&&(g+=\", \"),g+=a.audio.codecs,d=a.audio.label);var h=a.audio?a.audio.codecs:null,l=a.video?a.video.codecs:null,m=null;a.video?m=a.video.mimeType:a.audio&&(m=a.audio.mimeType);var q=null;a.audio?q=a.audio.kind:a.video&&(q=a.video.kind);var r=Ga((a.audio?a.audio.roles:[]).concat(a.video?\na.video.roles:[]));return{id:a.id,active:e,type:\"variant\",bandwidth:a.bandwidth,language:a.language,label:d,kind:q||null,width:a.video?a.video.width:null,height:a.video?a.video.height:null,frameRate:a.video?a.video.frameRate:void 0,mimeType:m,codecs:g,audioCodec:h,videoCodec:l,primary:a.primary,roles:r,videoId:a.video?a.video.id:null,audioId:a.audio?a.audio.id:null}})}\nfunction ac(a,b){return a.textStreams.map(function(a){return{id:a.id,active:b==a.id,type:\"text\",language:a.language,label:a.label,kind:a.kind,mimeType:a.mimeType,codecs:a.codecs||null,audioCodec:null,videoCodec:null,primary:a.primary,roles:a.roles}})}function bc(a,b){for(var c=0;c<a.variants.length;c++)if(a.variants[c].id==b.id)return a.variants[c];return null}function cc(a,b){for(var c=0;c<a.textStreams.length;c++)if(a.textStreams[c].id==b.id)return a.textStreams[c];return null}\nfunction $b(a){return a.filter(function(a){return a.allowedByApplication&&a.allowedByKeySystem})}\nfunction dc(a,b,c,d){var e=$b(a.variants),f=e.filter(function(a){return a.language==e[0].language});a=e.filter(function(a){return a.primary});a.length&&(f=a);if(b){var g=Sb(b);[Rb,Qb,0].forEach(function(a){var b=!1;e.forEach(function(d){g=Sb(g);var e=Sb(d.language);Pb(a,g,e)&&(b?f.push(d):(f=[d],b=!0),c&&(c.audio=!0))})})}var h=d||\"\";return h&&(b=f.filter(function(a){return a.audio&&-1<a.audio.roles.indexOf(h)||a.video&&-1<a.video.roles.indexOf(h)}),b.length)?b:f}\nfunction ec(a,b,c,d){var e=a.textStreams,f=e;a=e.filter(function(a){return a.primary});a.length&&(f=a);if(b){var g=Sb(b);[Rb,Qb,0].forEach(function(a){var b=!1;e.forEach(function(d){var e=Sb(d.language);Pb(a,g,e)&&(b?f.push(d):(f=[d],b=!0),c&&(c.text=!0))})})}var h=d||\"\";return h&&(b=f.filter(function(a){return a&&-1<a.roles.indexOf(h)}),b.length)?b:f}function fc(a,b,c){for(var d=0;d<c.length;d++)if(c[d].audio==a&&c[d].video==b)return c[d];return null}\nfunction gc(a,b,c){function d(a,b){return null==a?null==b:b.id==a}for(var e=0;e<c.length;e++)if(d(a,c[e].audio)&&d(b,c[e].video))return c[e];return null}function Yb(a,b){var c=a;b&&(c+='; codecs=\"'+b+'\"');return c}function hc(a,b){for(var c=a.periods.length-1;0<c;--c)if(b>=a.periods[c].startTime)return c;return 0}\nfunction ic(a,b){for(var c=0;c<a.periods.length;++c){var d=a.periods[c];if(\"text\"==b.type)for(var e=0;e<d.textStreams.length;++e){if(d.textStreams[e]==b)return c}else for(e=0;e<d.variants.length;++e){var f=d.variants[e];if(f.audio==b||f.video==b||f.video&&f.video.trickModeVideo==b)return c}}return-1};function H(){this.f=null;this.b=!1;this.a=new fa;this.h=[];this.g=[];this.j=!1;this.c=null;this.i={minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minBandwidth:0,maxBandwidth:Infinity}}n(\"shaka.abr.SimpleAbrManager\",H);H.prototype.stop=function(){this.f=null;this.b=!1;this.h=[];this.g=[];this.c=null};H.prototype.stop=H.prototype.stop;H.prototype.init=function(a){this.f=a};H.prototype.init=H.prototype.init;\nH.prototype.chooseStreams=function(a){var b={};if(-1<a.indexOf(\"audio\")||-1<a.indexOf(\"video\")){var c=this.h;var d=jc(this.i,c);var e=this.a.getBandwidthEstimate();if(c.length&&!d.length)throw new t(2,4,4012);for(var c=d[0],f=0;f<d.length;++f){var g=d[f],h=(d[f+1]||{bandwidth:Infinity}).bandwidth/.85;e>=g.bandwidth/.95&&e<=h&&(c=g)}(d=c)&&d.video&&(b.video=d.video);d&&d.audio&&(b.audio=d.audio)}-1<a.indexOf(\"text\")&&(b.text=this.g[0]);this.c=Date.now();return b};H.prototype.chooseStreams=H.prototype.chooseStreams;\nH.prototype.enable=function(){this.b=!0};H.prototype.enable=H.prototype.enable;H.prototype.disable=function(){this.b=!1};H.prototype.disable=H.prototype.disable;H.prototype.segmentDownloaded=function(a,b){var c=this.a;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;da(c.c,e,d);da(c.f,e,d)}if(null!=this.c&&this.b)a:{if(!this.j){if(!(128E3<=this.a.a))break a;this.j=!0}else if(8E3>Date.now()-this.c)break a;c=this.chooseStreams([\"audio\",\"video\"]);this.a.getBandwidthEstimate();this.f(c)}};\nH.prototype.segmentDownloaded=H.prototype.segmentDownloaded;H.prototype.getBandwidthEstimate=function(){return this.a.getBandwidthEstimate()};H.prototype.getBandwidthEstimate=H.prototype.getBandwidthEstimate;H.prototype.setDefaultEstimate=function(a){this.a.setDefaultEstimate(a)};H.prototype.setDefaultEstimate=H.prototype.setDefaultEstimate;H.prototype.setRestrictions=function(a){this.i=a};H.prototype.setRestrictions=H.prototype.setRestrictions;H.prototype.setVariants=function(a){this.h=a};\nH.prototype.setVariants=H.prototype.setVariants;H.prototype.setTextStreams=function(a){this.g=a};H.prototype.setTextStreams=H.prototype.setTextStreams;function jc(a,b){return b.filter(function(b){return Ub(b,a,{width:Infinity,height:Infinity})}).sort(function(a,b){return a.bandwidth-b.bandwidth})};function I(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}I.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};I.prototype.stopImmediatePropagation=function(){this.a=!0};I.prototype.stopPropagation=function(){};var kc=\"ended play playing pause pausing ratechange seeked seeking timeupdate volumechange\".split(\" \"),lc=\"buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume\".split(\" \"),mc=[\"loop\",\"playbackRate\"],nc=[\"pause\",\"play\"],oc=\"adaptation buffering emsg error loading unloading texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged\".split(\" \"),pc=\"drmInfo getAudioLanguages getConfiguration getExpiration getManifestUri getPlaybackRate getPlayheadTimeAsDate getTextLanguages getTextTracks getTracks getStats getVariantTracks isBuffering isInProgress isLive isTextTrackVisible keySystem seekRange\".split(\" \"),\nqc=[[\"getConfiguration\",\"configure\"]],rc=[[\"isTextTrackVisible\",\"setTextTrackVisibility\"]],sc=\"addTextTrack cancelTrickPlay configure resetConfiguration selectAudioLanguage selectTextLanguage selectTextTrack selectTrack selectVariantTrack setTextTrackVisibility trickPlay\".split(\" \"),uc=[\"load\",\"unload\"];\nfunction vc(a){return JSON.stringify(a,function(a,c){if(\"manager\"!=a&&\"function\"!=typeof c){if(c instanceof Event||c instanceof I){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}})}\nfunction wc(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__?xc(c):c})}function xc(a){return{length:a.length,start:function(b){return a.start[b]},end:function(b){return a.end[b]}}};function yc(a,b,c,d,e){this.J=a;this.l=b;this.B=c;this.G=d;this.v=e;this.c=this.j=this.h=!1;this.A=\"\";this.a=this.i=null;this.b={video:{},player:{}};this.o=0;this.f={};this.g=null}k=yc.prototype;k.m=function(){zc(this);this.a&&(this.a.leave(function(){},function(){}),this.a=null);this.G=this.B=this.l=null;this.c=this.j=this.h=!1;this.g=this.f=this.b=this.i=null;return Promise.resolve()};k.V=function(){return this.c};k.Fb=function(){return this.A};\nk.init=function(){if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){delete window.__onGCastApiAvailable;this.h=!0;this.l();var a=new chrome.cast.SessionRequest(this.J),a=new chrome.cast.ApiConfig(a,this.gd.bind(this),this.sd.bind(this),\"origin_scoped\");chrome.cast.initialize(a,function(){},function(){})}else window.__onGCastApiAvailable=function(a){a&&this.init()}.bind(this)};k.Ib=function(a){this.i=a;this.c&&Ac(this,{type:\"appData\",appData:this.i})};\nk.cast=function(a){if(!this.h)return Promise.reject(new t(1,8,8E3));if(!this.j)return Promise.reject(new t(1,8,8001));if(this.c)return Promise.reject(new t(1,8,8002));this.g=new A;chrome.cast.requestSession(this.Bb.bind(this,a),this.cc.bind(this));return this.g};k.$a=function(){this.c&&(zc(this),this.a&&(this.a.stop(function(){},function(){}),this.a=null))};\nk.get=function(a,b){if(\"video\"==a){if(0<=nc.indexOf(b))return this.pc.bind(this,a,b)}else if(\"player\"==a){if(0<=sc.indexOf(b))return this.pc.bind(this,a,b);if(0<=uc.indexOf(b))return this.Od.bind(this,a,b);if(0<=pc.indexOf(b))return this.lc.bind(this,a,b)}return this.lc(a,b)};k.set=function(a,b,c){this.b[a][b]=c;Ac(this,{type:\"set\",targetName:a,property:b,value:c})};\nk.Bb=function(a,b){this.a=b;this.a.addUpdateListener(this.dc.bind(this));this.a.addMessageListener(\"urn:x-cast:com.google.shaka.v2\",this.md.bind(this));this.dc();Ac(this,{type:\"init\",initState:a,appData:this.i});this.g.resolve()};k.cc=function(a){var b=8003;switch(a.code){case \"cancel\":b=8004;break;case \"timeout\":b=8005;break;case \"receiver_unavailable\":b=8006}this.g.reject(new t(2,8,b,a))};k.lc=function(a,b){return this.b[a][b]};\nk.pc=function(a,b){Ac(this,{type:\"call\",targetName:a,methodName:b,args:Array.prototype.slice.call(arguments,2)})};k.Od=function(a,b){var c=Array.prototype.slice.call(arguments,2),d=new A,e=this.o.toString();this.o++;this.f[e]=d;Ac(this,{type:\"asyncCall\",targetName:a,methodName:b,args:c,id:e});return d};k.gd=function(a){var b=this.v();this.g=new A;this.Bb(b,a)};k.sd=function(a){this.j=\"available\"==a;this.l()};\nk.dc=function(){var a=this.a?\"connected\"==this.a.status:!1;if(this.c&&!a){this.G();for(var b in this.b)this.b[b]={};zc(this)}this.A=(this.c=a)?this.a.receiver.friendlyName:\"\";this.l()};function zc(a){for(var b in a.f){var c=a.f[b];delete a.f[b];c.reject(new t(1,7,7E3))}}\nk.md=function(a,b){var c=wc(b);switch(c.type){case \"event\":var d=c.targetName,e=c.event;this.B(d,new I(e.type,e));break;case \"update\":e=c.update;for(d in e){var c=this.b[d]||{};for(f in e[d])c[f]=e[d][f]}break;case \"asyncComplete\":d=c.id;var f=c.error;c=this.f[d];delete this.f[d];if(c)if(f){d=new t(f.severity,f.category,f.code);for(e in f)d[e]=f[e];c.reject(d)}else c.resolve()}};function Ac(a,b){var c=vc(b);a.a.sendMessage(\"urn:x-cast:com.google.shaka.v2\",c,function(){},ga)};function p(){this.nb=new Ia;this.Ta=this}p.prototype.addEventListener=function(a,b){this.nb.push(a,b)};p.prototype.removeEventListener=function(a,b){this.nb.remove(a,b)};p.prototype.dispatchEvent=function(a){for(var b=this.nb.get(a.type)||[],c=0;c<b.length;++c){a.target=this.Ta;a.currentTarget=this.Ta;var d=b[c];try{d.handleEvent?d.handleEvent(a):d.call(this,a)}catch(e){}if(a.a)break}return a.defaultPrevented};function J(a,b,c){p.call(this);this.c=a;this.b=b;this.h=this.f=this.g=this.i=this.j=null;this.a=new yc(c,this.ee.bind(this),this.fe.bind(this),this.ge.bind(this),this.Vb.bind(this));Bc(this)}ba(J);n(\"shaka.cast.CastProxy\",J);J.prototype.m=function(a){a&&this.a&&this.a.$a();a=[this.h?this.h.m():null,this.b?this.b.m():null,this.a?this.a.m():null];this.a=this.h=this.i=this.j=this.b=this.c=null;return Promise.all(a)};J.prototype.destroy=J.prototype.m;J.prototype.Zc=function(){return this.j};\nJ.prototype.getVideo=J.prototype.Zc;J.prototype.Tc=function(){return this.i};J.prototype.getPlayer=J.prototype.Tc;J.prototype.Fc=function(){return this.a?this.a.h&&this.a.j:!1};J.prototype.canCast=J.prototype.Fc;J.prototype.V=function(){return this.a?this.a.V():!1};J.prototype.isCasting=J.prototype.V;J.prototype.Fb=function(){return this.a?this.a.Fb():\"\"};J.prototype.receiverName=J.prototype.Fb;J.prototype.cast=function(){var a=this.Vb();return this.a.cast(a).then(function(){return this.b.hb()}.bind(this))};\nJ.prototype.cast=J.prototype.cast;J.prototype.Ib=function(a){this.a.Ib(a)};J.prototype.setAppData=J.prototype.Ib;J.prototype.me=function(){var a=this.a;if(a.c){var b=a.v();chrome.cast.requestSession(a.Bb.bind(a,b),a.cc.bind(a))}};J.prototype.suggestDisconnect=J.prototype.me;J.prototype.$a=function(){this.a.$a()};J.prototype.forceDisconnect=J.prototype.$a;\nfunction Bc(a){a.a.init();a.h=new D;kc.forEach(function(a){E(this.h,this.c,a,this.te.bind(this))}.bind(a));oc.forEach(function(a){E(this.h,this.b,a,this.Id.bind(this))}.bind(a));a.j={};for(var b in a.c)Object.defineProperty(a.j,b,{configurable:!1,enumerable:!0,get:a.se.bind(a,b),set:a.ue.bind(a,b)});a.i={};for(b in a.b)Object.defineProperty(a.i,b,{configurable:!1,enumerable:!0,get:a.Hd.bind(a,b)});a.g=new p;a.g.Ta=a.j;a.f=new p;a.f.Ta=a.i}k=J.prototype;\nk.Vb=function(){var a={video:{},player:{},playerAfterLoad:{},manifest:this.b.Ya,startTime:null};this.c.pause();mc.forEach(function(b){a.video[b]=this.c[b]}.bind(this));this.c.ended||(a.startTime=this.c.currentTime);qc.forEach(function(b){var c=b[1];b=this.b[b[0]]();a.player[c]=b}.bind(this));rc.forEach(function(b){var c=b[1];b=this.b[b[0]]();a.playerAfterLoad[c]=b}.bind(this));return a};k.ee=function(){this.dispatchEvent(new I(\"caststatuschanged\"))};\nk.ge=function(){qc.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 I(\"error\",{detail:a}))}.bind(this)));var f={};mc.forEach(function(a){f[a]=this.a.get(\"video\",a)}.bind(this));c.then(function(){mc.forEach(function(a){this.c[a]=\nf[a]}.bind(this));rc.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))};\nk.se=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.V()&&!Object.keys(this.a.b.video).length){var b=this.c[a];if(\"function\"!=typeof b)return b}return this.a.V()?this.a.get(\"video\",a):(b=this.c[a],\"function\"==typeof b&&(b=b.bind(this.c)),b)};k.ue=function(a,b){this.a.V()?this.a.set(\"video\",a,b):this.c[a]=b};k.te=function(a){this.a.V()||this.g.dispatchEvent(new I(a.type,a))};\nk.Hd=function(a){return\"addEventListener\"==a?this.f.addEventListener.bind(this.f):\"removeEventListener\"==a?this.f.removeEventListener.bind(this.f):\"getNetworkingEngine\"==a?this.b.Wb.bind(this.b):this.a.V()&&!Object.keys(this.a.b.video).length&&0<=pc.indexOf(a)||!this.a.V()?(a=this.b[a],a.bind(this.b)):this.a.get(\"player\",a)};k.Id=function(a){this.a.V()||this.f.dispatchEvent(a)};k.fe=function(a,b){this.a.V()&&(\"video\"==a?this.g.dispatchEvent(b):\"player\"==a&&this.f.dispatchEvent(b))};function K(a,b,c,d){p.call(this);this.a=a;this.b=b;this.j={video:a,player:b};this.l=c||function(){};this.o=d||function(a){return a};this.i=!1;this.f=!0;this.h=this.g=this.c=null;Cc(this)}ba(K);n(\"shaka.cast.CastReceiver\",K);K.prototype.isConnected=function(){return this.i};K.prototype.isConnected=K.prototype.isConnected;K.prototype.ad=function(){return this.f};K.prototype.isIdle=K.prototype.ad;\nK.prototype.m=function(){var a=this.b?this.b.m():Promise.resolve();null!=this.h&&window.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;return a.then(function(){cast.receiver.CastReceiverManager.getInstance().stop()})};K.prototype.destroy=K.prototype.m;\nfunction Cc(a){var b=cast.receiver.CastReceiverManager.getInstance();b.onSenderConnected=a.jc.bind(a);b.onSenderDisconnected=a.jc.bind(a);b.onSystemVolumeChanged=a.Mc.bind(a);a.g=b.getCastMessageBus(\"urn:x-cast:com.google.cast.media\");a.g.onMessage=a.hd.bind(a);a.c=b.getCastMessageBus(\"urn:x-cast:com.google.shaka.v2\");a.c.onMessage=a.vd.bind(a);b.start();kc.forEach(function(a){this.a.addEventListener(a,this.mc.bind(this,\"video\"))}.bind(a));oc.forEach(function(a){this.b.addEventListener(a,this.mc.bind(this,\n\"player\"))}.bind(a));cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs=\"avc1.640028\"; width=3840; height=2160')?a.b.Jb(3840,2160):a.b.Jb(1920,1080);a.b.addEventListener(\"loading\",function(){this.f=!1;Dc(this)}.bind(a));a.a.addEventListener(\"playing\",function(){this.f=!1;Dc(this)}.bind(a));a.a.addEventListener(\"pause\",function(){Dc(this)}.bind(a));a.b.addEventListener(\"unloading\",function(){this.f=!0;Dc(this)}.bind(a));a.a.addEventListener(\"ended\",function(){window.setTimeout(function(){this.a&&\nthis.a.ended&&(this.f=!0,Dc(this))}.bind(this),5E3)}.bind(a))}k=K.prototype;k.jc=function(){this.i=!!cast.receiver.CastReceiverManager.getInstance().getSenders().length;Dc(this)};function Dc(a){Promise.resolve().then(function(){this.dispatchEvent(new I(\"caststatuschanged\"));L(this,0)}.bind(a))}\nfunction Ec(a,b,c){for(var d in b.player)a.b[d](b.player[d]);a.l(c);c=Promise.resolve();var e=a.a.autoplay;b.manifest&&(a.a.autoplay=!1,c=a.b.load(b.manifest,b.startTime),c[\"catch\"](function(a){this.b.dispatchEvent(new I(\"error\",{detail:a}))}.bind(a)));c.then(function(){var a;for(a in b.video){var c=b.video[a];this.a[a]=c}for(a in b.playerAfterLoad)c=b.playerAfterLoad[a],this.b[a](c);this.a.autoplay=e;b.manifest&&(this.a.play(),L(this,0))}.bind(a))}\nk.mc=function(a,b){this.Cb();Fc(this,{type:\"event\",targetName:a,event:b},this.c)};k.Cb=function(){null!=this.h&&window.clearTimeout(this.h);this.h=window.setTimeout(this.Cb.bind(this),500);var a={video:{},player:{}};lc.forEach(function(b){a.video[b]=this.a[b]}.bind(this));pc.forEach(function(b){a.player[b]=this.b[b]()}.bind(this));var b=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();b&&(a.video.volume=b.level,a.video.muted=b.muted);Fc(this,{type:\"update\",update:a},this.c)};\nk.Mc=function(){var a=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();a&&Fc(this,{type:\"update\",update:{video:{volume:a.level,muted:a.muted}}},this.c);Fc(this,{type:\"event\",targetName:\"video\",event:{type:\"volumechange\"}},this.c)};\nk.vd=function(a){var b=wc(a.data);switch(b.type){case \"init\":Ec(this,b.initState,b.appData);this.Cb();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,\nd=b.methodName,e=b.args,b=b.id,a=a.senderId,c=this.j[c],c[d].apply(c,e).then(this.vc.bind(this,a,b,null),this.vc.bind(this,a,b))}};\nk.hd=function(a){var b=wc(a.data);switch(b.type){case \"PLAY\":this.a.play();L(this,0);break;case \"PAUSE\":this.a.pause();L(this,0);break;case \"SEEK\":a=b.currentTime;var c=b.resumeState;null!=a&&(this.a.currentTime=Number(a));c&&\"PLAYBACK_START\"==c?(this.a.play(),L(this,0)):c&&\"PLAYBACK_PAUSE\"==c&&(this.a.pause(),L(this,0));break;case \"STOP\":this.b.hb().then(function(){L(this,0)}.bind(this));break;case \"GET_STATUS\":L(this,Number(b.requestId));break;case \"VOLUME\":c=b.volume;a=c.level;var c=c.muted,d=\nthis.a.volume,e=this.a.muted;null!=a&&(this.a.volume=Number(a));null!=c&&(this.a.muted=c);d==this.a.volume&&e==this.a.muted||L(this,0);break;case \"LOAD\":c=b.media.contentId;a=b.currentTime;var f=this.o(c);this.a.autoplay=!0;this.b.load(f,a).then(function(){L(this,0,{contentId:f,streamType:this.b.$()?\"LIVE\":\"BUFFERED\",contentType:\"\"})}.bind(this))[\"catch\"](function(a){var c=\"LOAD_FAILED\";7==a.category&&7E3==a.code&&(c=\"LOAD_CANCELLED\");Fc(this,{requestId:Number(b.requestId),type:c},this.g)}.bind(this));\nbreak;default:Fc(this,{requestId:Number(b.requestId),type:\"INVALID_REQUEST\",reason:\"INVALID_COMMAND\"},this.g)}};k.vc=function(a,b,c){Fc(this,{type:\"asyncComplete\",id:b,error:c},this.c,a)};function Fc(a,b,c,d){a.i&&(a=vc(b),d?c.getCastChannel(d).send(a):c.broadcast(a))}\nfunction L(a,b,c){var d=Gc,d={mediaSessionId:0,playbackRate:a.a.playbackRate,playerState:a.f?d.IDLE:a.b.ka?d.Ac:a.a.paused?d.Bc:d.Cc,currentTime:a.a.currentTime,supportedMediaCommands:15,volume:{level:a.a.volume,muted:a.a.muted}};c&&(d.media=c);Fc(a,{requestId:b,type:\"MEDIA_STATUS\",status:[d]},a.g)}var Gc={IDLE:\"IDLE\",Cc:\"PLAYING\",Ac:\"BUFFERING\",Bc:\"PAUSED\"};function Hc(a,b){var c=M(a,b);return 1!=c.length?null:c[0]}function M(a,b){return Array.prototype.filter.call(a.childNodes,function(a){return a.tagName==b})}function Ic(a){var b=a.firstChild;return b&&b.nodeType==Node.TEXT_NODE?a.textContent.trim():null}function N(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 Jc(a){if(!a)return null;a=Date.parse(a);return isNaN(a)?null:Math.floor(a/1E3)}\nfunction Kc(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 Lc(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}\nfunction Mc(a){a=Number(a);return a%1?null:a}function Nc(a){a=Number(a);return!(a%1)&&0<a?a:null}function Oc(a){a=Number(a);return!(a%1)&&0<=a?a:null}function Pc(a){var b;a=(b=a.match(/^(\\d+)\\/(\\d+)$/))?Number(b[1]/b[2]):Number(a);return isNaN(a)?null:a};var Qc={\"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\"};\nfunction Rc(a,b,c){a=Sc(a);var d=null,e=null,f=[],g=[],h=a.map(function(a){return a.keyId}).filter(ya);if(0<h.length&&(e=h[0],h.some(za(e))))throw new t(2,4,4010);c||(g=a.filter(function(a){return\"urn:mpeg:dash:mp4protection:2011\"==a.sc?(d=a.init||d,!1):!0}),0<g.length&&(f=Tc(d,b,g),f.length||(f=[Ba(\"\",d)])));0<a.length&&(c||!g.length)&&(f=Na(Qc).map(function(a){return Ba(a,d)}));e&&f.forEach(function(a){a.initData.forEach(function(a){a.keyId=e})});return{Sb:e,ze:d,drmInfos:f,Ub:!0}}\nfunction Uc(a,b,c,d){var e=Rc(a,b,d);if(c.Ub){a=1==c.drmInfos.length&&!c.drmInfos[0].keySystem;b=!e.drmInfos.length;if(!c.drmInfos.length||a&&!b)c.drmInfos=e.drmInfos;c.Ub=!1}else if(0<e.drmInfos.length&&(c.drmInfos=c.drmInfos.filter(function(a){return e.drmInfos.some(function(b){return b.keySystem==a.keySystem})}),!c.drmInfos.length))throw new t(2,4,4008);return e.Sb||c.Sb}function Tc(a,b,c){return c.map(function(c){var d=Qc[c.sc];return d?[Ba(d,c.init||a)]:b(c.node)||[]}).reduce(x,[])}\nfunction Sc(a){return a.map(function(a){var b=a.getAttribute(\"schemeIdUri\"),d=a.getAttribute(\"cenc:default_KID\"),e=M(a,\"cenc:pssh\").map(Ic);if(!b)return null;b=b.toLowerCase();if(d&&(d=d.replace(/-/g,\"\").toLowerCase(),0<=d.indexOf(\" \")))throw new t(2,4,4009);var f=[];try{f=e.map(function(a){return{initDataType:\"cenc\",initData:Ya(a),keyId:null}})}catch(g){throw new t(2,4,4007);}return{node:a,sc:b,keyId:d,init:0<f.length?f:null}}).filter(ya)};function Vc(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})}\nfunction Wc(a,b){var c=Xc(a,b,\"timescale\"),d=1;c&&(d=Nc(c)||1);c=Xc(a,b,\"duration\");(c=Nc(c||\"\"))&&(c/=d);var e=Xc(a,b,\"startNumber\"),f=Xc(a,b,\"presentationTimeOffset\"),g=Oc(e||\"\");if(null==e||null==g)g=1;var h=Yc(a,b,\"SegmentTimeline\"),e=null;if(h){for(var e=d,l=Number(f),m=a.R.duration||Infinity,h=M(h,\"S\"),q=[],r=0,v=0;v<h.length;++v){var u=h[v],w=N(u,\"t\",Oc),G=N(u,\"d\",Oc),u=N(u,\"r\",Mc);null!=w&&(w-=l);if(!G)break;w=null!=w?w:r;u=u||0;if(0>u)if(v+1<h.length){u=N(h[v+1],\"t\",Oc);if(null==u)break;\nelse if(w>=u)break;u=Math.ceil((u-w)/G)-1}else{if(Infinity==m)break;else if(w/e>=m)break;u=Math.ceil((m*e-w)/G)-1}0<q.length&&w!=r&&(q[q.length-1].end=w/e);for(var pa=0;pa<=u;++pa)r=w+G,q.push({start:w/e,end:r/e,qe:w}),w=r}e=q}return{timescale:d,P:c,za:g,presentationTimeOffset:Number(f)/d||0,Pb:Number(f),F:e}}function Xc(a,b,c){return[b(a.w),b(a.S),b(a.T)].filter(ya).map(function(a){return a.getAttribute(c)}).reduce(function(a,b){return a||b})}\nfunction Yc(a,b,c){return[b(a.w),b(a.S),b(a.T)].filter(ya).map(function(a){return Hc(a,c)}).reduce(function(a,b){return a||b})};function Zc(a,b,c){this.a=a;this.X=b;this.M=c}n(\"shaka.media.InitSegmentReference\",Zc);function O(a,b,c,d,e,f){this.position=a;this.startTime=b;this.endTime=c;this.a=d;this.X=e;this.M=f}n(\"shaka.media.SegmentReference\",O);function P(a,b){this.H=a;this.a=b==$c;this.u=0}n(\"shaka.util.DataViewReader\",P);var $c=1;P.Endianness={ve:0,xe:$c};P.prototype.Z=function(){return this.u<this.H.byteLength};P.prototype.hasMoreData=P.prototype.Z;P.prototype.Vc=function(){return this.u};P.prototype.getPosition=P.prototype.Vc;P.prototype.Qc=function(){return this.H.byteLength};P.prototype.getLength=P.prototype.Qc;P.prototype.Eb=function(){try{var a=this.H.getUint8(this.u)}catch(b){ad()}this.u+=1;return a};P.prototype.readUint8=P.prototype.Eb;\nP.prototype.oc=function(){try{var a=this.H.getUint16(this.u,this.a)}catch(b){ad()}this.u+=2;return a};P.prototype.readUint16=P.prototype.oc;P.prototype.D=function(){try{var a=this.H.getUint32(this.u,this.a)}catch(b){ad()}this.u+=4;return a};P.prototype.readUint32=P.prototype.D;P.prototype.nc=function(){try{var a=this.H.getInt32(this.u,this.a)}catch(b){ad()}this.u+=4;return a};P.prototype.readInt32=P.prototype.nc;\nP.prototype.Pa=function(){try{if(this.a){var a=this.H.getUint32(this.u,!0);var b=this.H.getUint32(this.u+4,!0)}else b=this.H.getUint32(this.u,!1),a=this.H.getUint32(this.u+4,!1)}catch(c){ad()}if(2097151<b)throw new t(2,3,3001);this.u+=8;return b*Math.pow(2,32)+a};P.prototype.readUint64=P.prototype.Pa;P.prototype.Ka=function(a){this.u+a>this.H.byteLength&&ad();var b=this.H.buffer.slice(this.u,this.u+a);this.u+=a;return new Uint8Array(b)};P.prototype.readBytes=P.prototype.Ka;\nP.prototype.I=function(a){this.u+a>this.H.byteLength&&ad();this.u+=a};P.prototype.skip=P.prototype.I;P.prototype.Db=function(){for(var a=this.u;this.Z()&&this.H.getUint8(this.u);)this.u+=1;a=this.H.buffer.slice(a,this.u);this.u+=1;return F(a)};P.prototype.readTerminatedString=P.prototype.Db;function ad(){throw new t(2,3,3E3);};function Q(){this.b=[];this.a=[]}n(\"shaka.util.Mp4Parser\",Q);Q.prototype.C=function(a,b){var c=bd(a);this.b[c]=0;this.a[c]=b;return this};Q.prototype.box=Q.prototype.C;Q.prototype.da=function(a,b){var c=bd(a);this.b[c]=1;this.a[c]=b;return this};Q.prototype.fullBox=Q.prototype.da;Q.prototype.parse=function(a){for(a=new P(new DataView(a),0);a.Z();)this.eb(0,a)};Q.prototype.parse=Q.prototype.parse;\nQ.prototype.eb=function(a,b){var c=b.u,d=b.D(),e=b.D();switch(d){case 0:d=b.H.byteLength-c;break;case 1:d=b.Pa()}var f=this.a[e];if(f){var g=null,h=null;1==this.b[e]&&(h=b.D(),g=h>>>24,h&=16777215);e=c+d-b.u;e=0<e?b.Ka(e).buffer:new ArrayBuffer(0);e=new P(new DataView(e),0);f({Na:this,version:g,Nc:h,s:e,size:d,start:c+a})}else b.I(c+d-b.u)};Q.prototype.parseNext=Q.prototype.eb;function R(a){for(;a.s.Z();)a.Na.eb(a.start,a.s)}Q.children=R;\nfunction cd(a){for(var b=a.s.D();0<b;--b)a.Na.eb(a.start,a.s)}Q.sampleDescription=cd;function dd(a){return function(b){a(b.s.Ka(b.s.H.byteLength-b.s.u))}}Q.allData=dd;function bd(a){for(var b=0,c=0;c<a.length;c++)b=b<<8|a.charCodeAt(c);return b};function ed(a,b,c,d){var e,f=(new Q).da(\"sidx\",function(a){e=fd(b,d,c,a)});a&&f.parse(a);if(e)return e;throw new t(2,3,3004);}\nfunction fd(a,b,c,d){var e=[];d.s.I(4);var f=d.s.D();if(!f)throw new t(2,3,3005);if(d.version){var g=d.s.Pa();var h=d.s.Pa()}else g=d.s.D(),h=d.s.D();d.s.I(2);var l=d.s.oc();b=g-b;a=a+d.size+h;for(h=0;h<l;h++){var m=d.s.D();g=(m&2147483648)>>>31;var m=m&2147483647,q=d.s.D();d.s.I(4);if(1==g)throw new t(2,3,3006);e.push(new O(e.length,b/f,(b+q)/f,function(){return c},a,a+m-1));b+=q;a+=m}return e};function S(a){this.a=a}n(\"shaka.media.SegmentIndex\",S);S.prototype.m=function(){this.a=null;return Promise.resolve()};S.prototype.destroy=S.prototype.m;S.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 this.a.length&&a<this.a[0].startTime?this.a[0].position:null};S.prototype.find=S.prototype.find;S.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]};\nS.prototype.get=S.prototype.get;S.prototype.xb=function(a){for(var b,c,d=[],e=c=0;c<this.a.length&&e<a.length;){var f=this.a[c];b=a[e];f.startTime<b.startTime?(d.push(f),c++):(f.startTime>b.startTime||(.1<Math.abs(f.endTime-b.endTime)?d.push(b):d.push(f),c++),e++)}for(;c<this.a.length;)d.push(this.a[c++]);if(d.length)for(c=d[d.length-1].position+1;e<a.length;)b=a[e++],b=new O(c++,b.startTime,b.endTime,b.a,b.X,b.M),d.push(b);else d=a;this.a=d};S.prototype.merge=S.prototype.xb;\nS.prototype.qb=function(a){for(var b=0;b<this.a.length&&!(this.a[b].endTime>a);++b);this.a.splice(0,b)};S.prototype.evict=S.prototype.qb;function gd(a,b){if(a.a.length){var c=a.a[a.a.length-1];c.startTime>b||(a.a[a.a.length-1]=new O(c.position,c.startTime,b,c.a,c.X,c.M))}};function hd(a){this.b=a;this.a=new P(a,0);id||(id=[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 id;hd.prototype.Z=function(){return this.a.Z()};\nfunction jd(a){var b=kd(a);if(7<b.length)throw new t(2,3,3002);for(var c=0,d=0;d<b.length;d++)c=256*c+b[d];b=c;c=kd(a);a:{for(d=0;d<id.length;d++)if(ab(c,id[d])){d=!0;break a}d=!1}if(d)c=a.b.byteLength-a.a.u;else{if(8==c.length&&c[1]&224)throw new t(2,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.u+c<=a.b.byteLength?c:a.b.byteLength-a.a.u;d=new DataView(a.b.buffer,a.b.byteOffset+a.a.u,c);a.a.I(c);return new ld(b,d)}\nfunction kd(a){var b=a.a.Eb(),c;for(c=1;8>=c&&!(b&1<<8-c);c++);if(8<c)throw new t(2,3,3002);var d=new Uint8Array(c);d[0]=b;for(b=1;b<c;b++)d[b]=a.a.Eb();return d}function ld(a,b){this.id=a;this.a=b}function md(a){if(8<a.a.byteLength)throw new t(2,3,3002);if(8==a.a.byteLength&&a.a.getUint8(0)&224)throw new t(2,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 nd(){}\nnd.prototype.parse=function(a,b,c,d){var e;b=new hd(new DataView(b));if(440786851!=jd(b).id)throw new t(2,3,3008);var f=jd(b);if(408125543!=f.id)throw new t(2,3,3009);b=f.a.byteOffset;f=new hd(f.a);for(e=null;f.Z();){var g=jd(f);if(357149030==g.id){e=g;break}}if(!e)throw new t(2,3,3010);f=new hd(e.a);e=1E6;for(g=null;f.Z();){var h=jd(f);if(2807729==h.id)e=md(h);else if(17545==h.id)if(g=h,4==g.a.byteLength)g=g.a.getFloat32(0);else if(8==g.a.byteLength)g=g.a.getFloat64(0);else throw new t(2,3,3003);\n}if(null==g)throw new t(2,3,3011);f=e/1E9;e=g*f;a=jd(new hd(new DataView(a)));if(475249515!=a.id)throw new t(2,3,3007);return od(a,b,f,e,c,d)};function od(a,b,c,d,e,f){function g(){return e}var h=[];a=new hd(a.a);for(var l=-1,m=-1;a.Z();){var q=jd(a);if(187==q.id){var r=pd(q);r&&(q=c*(r.re-f),r=b+r.Nd,0<=l&&h.push(new O(h.length,l,q,g,m,r-1)),l=q,m=r)}}0<=l&&h.push(new O(h.length,l,d,g,m,null));return h}\nfunction pd(a){var b=new hd(a.a);a=jd(b);if(179!=a.id)throw new t(2,3,3013);a=md(a);b=jd(b);if(183!=b.id)throw new t(2,3,3012);for(var b=new hd(b.a),c=0;b.Z();){var d=jd(b);if(241==d.id){c=md(d);break}}return{re:a,Nd:c}};function qd(a,b){var c=Yc(a,b,\"Initialization\");if(!c)return null;var d=a.w.U,e=c.getAttribute(\"sourceURL\");e&&(d=z(a.w.U,[e]));var e=0,f=null;if(c=N(c,\"range\",Lc))e=c.start,f=c.end;return new Zc(function(){return d},e,f)}\nfunction rd(a,b){var c=Xc(a,sd,\"presentationTimeOffset\"),d=qd(a,sd);var e=Number(c);var f=a.w.contentType,g=a.w.mimeType.split(\"/\")[1];if(\"text\"!=f&&\"mp4\"!=g&&\"webm\"!=g)throw new t(2,4,4006);if(\"webm\"==g&&!d)throw new t(2,4,4005);var f=Yc(a,sd,\"RepresentationIndex\"),h=Xc(a,sd,\"indexRange\"),l=a.w.U,h=Lc(h||\"\");if(f){var m=f.getAttribute(\"sourceURL\");m&&(l=z(a.w.U,[m]));h=N(f,\"range\",Lc,h)}if(!h)throw new t(2,4,4002);e=td(a,b,d,l,h.start,h.end,g,e);return{createSegmentIndex:e.createSegmentIndex,findSegmentPosition:e.findSegmentPosition,\ngetSegmentReference:e.getSegmentReference,initSegmentReference:d,presentationTimeOffset:Number(c)||0}}\nfunction td(a,b,c,d,e,f,g,h){var l=a.presentationTimeline,m=!a.Da||!a.R.ub,q=a.R.duration,r=b,v=null;return{createSegmentIndex:function(){var a=[r(d,e,f),\"webm\"==g?r(c.a(),c.X,c.M):null];r=null;return Promise.all(a).then(function(a){var b=a[0];a=a[1]||null;b=\"mp4\"==g?ed(b,e,d,h):(new nd).parse(b,a,d,h);l.Ha(0,b);v=new S(b);m&&gd(v,q)})},findSegmentPosition:function(a){return v.find(a)},getSegmentReference:function(a){return v.get(a)}}}function sd(a){return a.Qa};function ud(a,b){var c=qd(a,vd);var d=wd(a);var e=Wc(a,vd),f=e.za;f||(f=1);var g=0;e.P?g=e.P*(f-1):e.F&&0<e.F.length&&(g=e.F[0].start);d={P:e.P,startTime:g,za:f,presentationTimeOffset:e.presentationTimeOffset,F:e.F,Ga:d};if(!d.P&&!d.F&&1<d.Ga.length)throw new t(2,4,4002);if(!d.P&&!a.R.duration&&!d.F&&1==d.Ga.length)throw new t(2,4,4002);if(d.F&&!d.F.length)throw new t(2,4,4002);f=e=null;a.T.id&&a.w.id&&(f=a.T.id+\",\"+a.w.id,e=b[f]);g=xd(a.R.duration,d.za,a.w.U,d);e?(e.xb(g),e.qb(a.presentationTimeline.ma()-\na.R.start)):(a.presentationTimeline.Ha(0,g),e=new S(g),f&&a.Da&&(b[f]=e));a.Da&&a.R.ub||gd(e,a.R.duration);return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e),initSegmentReference:c,presentationTimeOffset:d.presentationTimeOffset}}function vd(a){return a.oa}\nfunction xd(a,b,c,d){var e=d.Ga.length;d.F&&d.F.length!=d.Ga.length&&(e=Math.min(d.F.length,d.Ga.length));for(var f=[],g=d.startTime,h=0;h<e;h++){var l=d.Ga[h],m=z(c,[l.cd]);var q=null!=d.P?g+d.P:d.F?d.F[h].end:g+a;f.push(new O(h+b,g,q,function(a){return a}.bind(null,m),l.start,l.end));g=q}return f}\nfunction wd(a){return[a.w.oa,a.S.oa,a.T.oa].filter(ya).map(function(a){return M(a,\"SegmentURL\")}).reduce(function(a,c){return 0<a.length?a:c}).map(function(b){b.getAttribute(\"indexRange\")&&!a.$b&&(a.$b=!0);var c=b.getAttribute(\"media\");b=N(b,\"mediaRange\",Lc,{start:0,end:null});return{cd:c,start:b.start,end:b.end}})};function yd(a,b,c,d){var e=zd(a);var f=Wc(a,Ad);var g=Xc(a,Ad,\"media\"),h=Xc(a,Ad,\"index\");f={P:f.P,timescale:f.timescale,za:f.za,presentationTimeOffset:f.presentationTimeOffset,Pb:f.Pb,F:f.F,wb:g,Ma:h};g=0+(f.Ma?1:0);g+=f.F?1:0;g+=f.P?1:0;if(!g)throw new t(2,4,4002);1!=g&&(f.Ma&&(f.F=null),f.P=null);if(!f.Ma&&!f.wb)throw new t(2,4,4002);if(f.Ma){c=a.w.mimeType.split(\"/\")[1];if(\"mp4\"!=c&&\"webm\"!=c)throw new t(2,4,4006);if(\"webm\"==c&&!e)throw new t(2,4,4005);d=Vc(f.Ma,a.w.id,null,a.bandwidth||null,\nnull);d=z(a.w.U,[d]);a=td(a,b,e,d,0,null,c,f.presentationTimeOffset)}else f.P?(d||a.presentationTimeline.yb(f.P),a=Bd(a,f)):(d=b=null,a.T.id&&a.w.id&&(d=a.T.id+\",\"+a.w.id,b=c[d]),g=Cd(a,f),b?(b.xb(g),b.qb(a.presentationTimeline.ma()-a.R.start)):(a.presentationTimeline.Ha(0,g),b=new S(g),d&&a.Da&&(c[d]=b)),a.Da&&a.R.ub||gd(b,a.R.duration),a={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:b.find.bind(b),getSegmentReference:b.get.bind(b)});return{createSegmentIndex:a.createSegmentIndex,\nfindSegmentPosition:a.findSegmentPosition,getSegmentReference:a.getSegmentReference,initSegmentReference:e,presentationTimeOffset:f.presentationTimeOffset}}function Ad(a){return a.Ra}\nfunction Bd(a,b){var c=a.R.duration,d=b.P,e=b.za,f=b.timescale,g=b.wb,h=a.bandwidth||null,l=a.w.id,m=a.w.U;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(a){return 0>a||c&&a>=c?null:Math.floor(a/d)},getSegmentReference:function(a){var b=a*d;return 0>b||c&&b>=c?null:new O(a,b,b+d,function(){var c=Vc(g,l,a+e,h,b*f);return z(m,[c])},0,null)}}}\nfunction Cd(a,b){for(var c=[],d=0;d<b.F.length;d++){var e=d+b.za;c.push(new O(e,b.F[d].start,b.F[d].end,function(a,b,c,d,e,q){a=Vc(a,b,e,c,q);return z(d,[a]).map(function(a){return a.toString()})}.bind(null,b.wb,a.w.id,a.bandwidth||null,a.w.U,e,b.F[d].qe+b.Pb),0,null))}return c}function zd(a){var b=Xc(a,Ad,\"initialization\");if(!b)return null;var c=a.w.id,d=a.bandwidth||null,e=a.w.U;return new Zc(function(){var a=Vc(b,c,null,d,null);return z(e,[a])},0,null)};var Dd={},Ed={};n(\"shaka.media.ManifestParser.registerParserByExtension\",function(a,b){Ed[a]=b});n(\"shaka.media.ManifestParser.registerParserByMime\",function(a,b){Dd[a]=b});function Fd(){var a={},b;for(b in Dd)a[b]=!0;for(b in Ed)a[b]=!0;[\"application/dash+xml\",\"application/x-mpegurl\",\"application/vnd.apple.mpegurl\",\"application/vnd.ms-sstr+xml\"].forEach(function(b){a[b]=!!Dd[b]});[\"mpd\",\"m3u8\",\"ism\"].forEach(function(b){a[b]=!!Ed[b]});return a}\nfunction Gd(a,b,c,d){var e=d;e||(d=(new ia(a)).W.split(\"/\").pop().split(\".\"),1<d.length&&(d=d.pop().toLowerCase(),e=Ed[d]));if(e)return Promise.resolve(e);c=C([a],c);c.method=\"HEAD\";return b.request(0,c).then(function(b){(b=b.headers[\"content-type\"])&&(b=b.toLowerCase());return(e=Dd[b])?e:Promise.reject(new t(2,4,4E3,a))},function(a){a.severity=2;return Promise.reject(a)})};function T(a,b){this.f=a;this.i=b;this.c=this.a=Infinity;this.b=1;this.h=0;this.g=!0}n(\"shaka.media.PresentationTimeline\",T);T.prototype.Y=function(){return this.a};T.prototype.getDuration=T.prototype.Y;T.prototype.pa=function(a){this.a=a};T.prototype.setDuration=T.prototype.pa;T.prototype.Wc=function(){return this.f};T.prototype.getPresentationStartTime=T.prototype.Wc;T.prototype.wc=function(a){this.h=a};T.prototype.setClockOffset=T.prototype.wc;T.prototype.yc=function(a){this.g=a};\nT.prototype.setStatic=T.prototype.yc;T.prototype.Xc=function(){return this.c};T.prototype.getSegmentAvailabilityDuration=T.prototype.Xc;T.prototype.xc=function(a){this.c=a};T.prototype.setSegmentAvailabilityDuration=T.prototype.xc;T.prototype.Ha=function(a,b){b.length&&(this.b=b.reduce(function(a,b){return Math.max(a,b.endTime-b.startTime)},this.b))};T.prototype.notifySegments=T.prototype.Ha;T.prototype.yb=function(a){this.b=Math.max(this.b,a)};T.prototype.notifyMaxSegmentDuration=T.prototype.yb;\nT.prototype.$=function(){return Infinity==this.a&&!this.g};T.prototype.isLive=T.prototype.$;T.prototype.va=function(){return Infinity!=this.a&&!this.g};T.prototype.isInProgress=T.prototype.va;T.prototype.ma=function(){return this.Ea(0)};T.prototype.getSegmentAvailabilityStart=T.prototype.ma;T.prototype.Ea=function(a){if(Infinity==this.c)return 0;var b=this.ua();return Math.max(0,Math.min(b-this.c+a,b))};T.prototype.getSafeAvailabilityStart=T.prototype.Ea;\nT.prototype.ua=function(){return this.$()||this.va()?Math.min(Math.max(0,(Date.now()+this.h)/1E3-this.b-this.f),this.a):this.a};T.prototype.getSegmentAvailabilityEnd=T.prototype.ua;T.prototype.bb=function(){return Math.max(0,this.ua()-(this.$()||this.va()?this.i:0))};T.prototype.getSeekRangeEnd=T.prototype.bb;function Hd(){this.a=this.b=null;this.g=[];this.c=null;this.i=[];this.h=1;this.j={};this.l=0;this.f=null}n(\"shaka.dash.DashParser\",Hd);k=Hd.prototype;k.configure=function(a){this.b=a};k.start=function(a,b){this.g=[a];this.a=b;return Id(this).then(function(){this.a&&Jd(this,0);return this.c}.bind(this))};k.stop=function(){this.b=this.a=null;this.g=[];this.c=null;this.i=[];this.j={};null!=this.f&&(window.clearTimeout(this.f),this.f=null);return Promise.resolve()};k.update=function(){Id(this)[\"catch\"](function(a){if(this.a)this.a.onError(a)}.bind(this))};\nk.onExpirationUpdated=function(){};function Id(a){return a.a.networkingEngine.request(0,C(a.g,a.b.retryParameters)).then(function(a){if(this.a)return Kd(this,a.data,a.uri)}.bind(a))}\nfunction Kd(a,b,c){var d=F(b),e=new DOMParser,f=null;b=null;try{f=e.parseFromString(d,\"text/xml\")}catch(v){}f&&\"MPD\"==f.documentElement.tagName&&(b=f.documentElement);b&&0<b.getElementsByTagName(\"parsererror\").length&&(b=null);if(!b)throw new t(2,4,4001);c=[c];d=M(b,\"Location\").map(Ic).filter(ya);0<d.length&&(c=a.g=d);d=M(b,\"BaseURL\").map(Ic);c=z(c,d);var g=N(b,\"minBufferTime\",Kc);a.l=N(b,\"minimumUpdatePeriod\",Kc,-1);var h=N(b,\"availabilityStartTime\",Jc),d=N(b,\"timeShiftBufferDepth\",Kc),l=N(b,\"suggestedPresentationDelay\",\nKc),e=N(b,\"maxSegmentDuration\",Kc),f=b.getAttribute(\"type\")||\"static\";if(a.c)var m=a.c.presentationTimeline;else{var q=Math.max(10,1.5*g);m=new T(h,null!=l?l:q)}var h=Ld(a,{Da:\"static\"!=f,presentationTimeline:m,T:null,R:null,S:null,w:null,bandwidth:void 0,$b:!1},c,b),l=h.duration,r=h.periods;m.yc(\"static\"==f);m.pa(l||Infinity);m.xc(null!=d?d:Infinity);m.yb(e||1);if(a.c)return Promise.resolve();b=M(b,\"UTCTiming\");return Md(a,c,b,m.$()).then(function(a){this.a&&(m.wc(a),this.c={presentationTimeline:m,\nperiods:r,offlineSessionIds:[],minBufferTime:g||0})}.bind(a))}\nfunction Ld(a,b,c,d){var e=N(d,\"mediaPresentationDuration\",Kc),f=[],g=0;d=M(d,\"Period\");for(var h=0;h<d.length;h++){var l=d[h],g=N(l,\"start\",Kc,g),m=N(l,\"duration\",Kc),q=null;if(h!=d.length-1){var r=N(d[h+1],\"start\",Kc);null!=r&&(q=r-g)}else null!=e&&(q=e-g);null==q&&(q=m);l=Nd(a,b,c,{start:g,duration:q,node:l,ub:null==q||h==d.length-1});f.push(l);m=b.T.id;a.i.every(za(m))&&(a.a.filterPeriod(l),a.i.push(m),a.c&&a.c.periods.push(l));if(null==q){g=null;break}g+=q}return null!=e?{periods:f,duration:e}:\n{periods:f,duration:g}}\nfunction Nd(a,b,c,d){b.T=Od(d.node,null,c);b.R=d;b.T.id||(b.T.id=\"__shaka_period_\"+d.start);M(d.node,\"EventStream\").forEach(a.Fd.bind(a,d.start,d.duration));c=M(d.node,\"AdaptationSet\").map(a.Dd.bind(a,b)).filter(ya);var e=c.map(function(a){return a.Pd}).reduce(x,[]),f=e.filter(Aa);if(b.Da&&e.length!=f.length)throw new t(2,4,4018);var g=c.filter(function(a){return!a.Ob});c.filter(function(a){return a.Ob}).forEach(function(a){var b=a.streams[0],c=a.Ob;g.forEach(function(a){a.id==c&&a.streams.forEach(function(a){a.trickModeVideo=\nb})})});e=Pd(g,\"video\");f=Pd(g,\"audio\");if(!e.length&&!f.length)throw new t(2,4,4004);f.length||(f=[null]);e.length||(e=[null]);b=[];for(c=0;c<f.length;c++)for(var h=0;h<e.length;h++)Qd(a,f[c],e[h],b);a=Pd(g,\"text\");e=[];for(c=0;c<a.length;c++)e.push.apply(e,a[c].streams);return{startTime:d.start,textStreams:e,variants:b}}function Pd(a,b){return a.filter(function(a){return a.contentType==b})}\nfunction Qd(a,b,c,d){if(b||c)if(b&&c){var e=b.drmInfos;var f=c.drmInfos;if(e.length&&f.length?0<sb(e,f).length:1)for(var g=sb(b.drmInfos,c.drmInfos),e=0;e<b.streams.length;e++)for(var h=0;h<c.streams.length;h++)f=c.streams[h].bandwidth+b.streams[e].bandwidth,f={id:a.h++,language:b.language,primary:b.vb||c.vb,audio:b.streams[e],video:c.streams[h],bandwidth:f,drmInfos:g,allowedByApplication:!0,allowedByKeySystem:!0},d.push(f)}else for(g=b||c,e=0;e<g.streams.length;e++)f=g.streams[e].bandwidth,f={id:a.h++,\nlanguage:g.language||\"und\",primary:g.vb,audio:b?g.streams[e]:null,video:c?g.streams[e]:null,bandwidth:f,drmInfos:g.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},d.push(f)}\nk.Dd=function(a,b){a.S=Od(b,a.T,null);var c=!1,d=M(b,\"Role\"),e=d.map(function(a){return a.getAttribute(\"value\")}).filter(ya),f=void 0;\"text\"==a.S.contentType&&(f=\"subtitle\");for(var g=0;g<d.length;g++){var h=d[g].getAttribute(\"schemeIdUri\");if(null==h||\"urn:mpeg:dash:role:2011\"==h)switch(h=d[g].getAttribute(\"value\"),h){case \"main\":c=!0;break;case \"caption\":case \"subtitle\":f=h}}var l=null,m=!1;M(b,\"EssentialProperty\").forEach(function(a){\"http://dashif.org/guidelines/trickmode\"==a.getAttribute(\"schemeIdUri\")?\nl=a.getAttribute(\"value\"):m=!0});if(m)return null;var d=M(b,\"ContentProtection\"),q=Rc(d,this.b.dash.customScheme,this.b.dash.ignoreDrmInfo),d=Sb(b.getAttribute(\"lang\")||\"und\"),h=b.getAttribute(\"label\"),g=M(b,\"Representation\"),e=g.map(this.Gd.bind(this,a,q,f,d,h,c,e)).filter(function(a){return!!a});if(!e.length)throw new t(2,4,4003);a.S.contentType&&\"application\"!=a.S.contentType||(a.S.contentType=Rd(e[0].mimeType,e[0].codecs),e.forEach(function(b){b.type=a.S.contentType}));e.forEach(function(a){q.drmInfos.forEach(function(b){a.keyId&&\nb.keyIds.push(a.keyId)})});f=g.map(function(a){return a.getAttribute(\"id\")}).filter(ya);return{id:a.S.id||\"__fake__\"+this.h++,contentType:a.S.contentType,language:d,vb:c,streams:e,drmInfos:q.drmInfos,Ob:l,Pd:f}};\nk.Gd=function(a,b,c,d,e,f,g,h){a.w=Od(h,a.S,null);if(!Sd(a.w))return null;a.bandwidth=N(h,\"bandwidth\",Nc)||void 0;var l=this.Qd.bind(this);if(a.w.Qa)l=rd(a,l);else if(a.w.oa)l=ud(a,this.j);else if(a.w.Ra)l=yd(a,l,this.j,!!this.c);else{var m=a.w.U,q=a.R.duration||0;l={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(a){return 0<=a&&a<q?1:null},getSegmentReference:function(a){return 1!=a?null:new O(1,0,q,function(){return m},0,null)},initSegmentReference:null,presentationTimeOffset:0}}h=\nM(h,\"ContentProtection\");h=Uc(h,this.b.dash.customScheme,b,this.b.dash.ignoreDrmInfo);return{id:this.h++,createSegmentIndex:l.createSegmentIndex,findSegmentPosition:l.findSegmentPosition,getSegmentReference:l.getSegmentReference,initSegmentReference:l.initSegmentReference,presentationTimeOffset:l.presentationTimeOffset,mimeType:a.w.mimeType,codecs:a.w.codecs,frameRate:a.w.frameRate,bandwidth:a.bandwidth,width:a.w.width,height:a.w.height,kind:c,encrypted:0<b.drmInfos.length,keyId:h,language:d,label:e,\ntype:a.S.contentType,primary:f,trickModeVideo:null,containsEmsgBoxes:a.w.containsEmsgBoxes,roles:g}};k.he=function(){this.f=null;var a=Date.now();Id(this).then(function(){this.a&&Jd(this,(Date.now()-a)/1E3)}.bind(this))[\"catch\"](function(a){this.a&&(a.severity=1,this.a.onError(a),Jd(this,0))}.bind(this))};function Jd(a,b){0>a.l||(a.f=window.setTimeout(a.he.bind(a),1E3*Math.max(Math.max(3,a.l)-b,0)))}\nfunction Od(a,b,c){b=b||{contentType:\"\",mimeType:\"\",codecs:\"\",containsEmsgBoxes:!1,frameRate:void 0};c=c||b.U;var d=M(a,\"BaseURL\").map(Ic),e=a.getAttribute(\"contentType\")||b.contentType,f=a.getAttribute(\"mimeType\")||b.mimeType,g=a.getAttribute(\"codecs\")||b.codecs,h=N(a,\"frameRate\",Pc)||b.frameRate,l=!!M(a,\"InbandEventStream\").length;e||(e=Rd(f,g));return{U:z(c,d),Qa:Hc(a,\"SegmentBase\")||b.Qa,oa:Hc(a,\"SegmentList\")||b.oa,Ra:Hc(a,\"SegmentTemplate\")||b.Ra,width:N(a,\"width\",Oc)||b.width,height:N(a,\"height\",\nOc)||b.height,contentType:e,mimeType:f,codecs:g,frameRate:h,containsEmsgBoxes:l||b.containsEmsgBoxes,id:a.getAttribute(\"id\")}}function Sd(a){var b=0+(a.Qa?1:0);b+=a.oa?1:0;b+=a.Ra?1:0;if(!b)return\"text\"==a.contentType||\"application\"==a.contentType?!0:!1;1!=b&&(a.Qa&&(a.oa=null),a.Ra=null);return!0}\nfunction Td(a,b,c,d){b=z(b,[c]);b=C(b,a.b.retryParameters);b.method=d;return a.a.networkingEngine.request(0,b).then(function(a){if(\"HEAD\"==d){if(!a.headers||!a.headers.date)return 0;a=a.headers.date}else a=F(a.data);a=Date.parse(a);return isNaN(a)?0:a-Date.now()})}\nfunction Md(a,b,c,d){c=c.map(function(a){return{scheme:a.getAttribute(\"schemeIdUri\"),value:a.getAttribute(\"value\")}});var e=a.b.dash.clockSyncUri;d&&!c.length&&e&&c.push({scheme:\"urn:mpeg:dash:utc:http-head:2014\",value:e});return xa(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 Td(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 Td(this,\nb,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})}\nk.Fd=function(a,b,c){var d=c.getAttribute(\"schemeIdUri\")||\"\",e=c.getAttribute(\"value\")||\"\",f=N(c,\"timescale\",Oc)||1;M(c,\"Event\").forEach(function(c){var g=N(c,\"presentationTime\",Oc)||0,l=N(c,\"duration\",Oc)||0,g=g/f+a,l=g+l/f;null!=b&&(g=Math.min(g,a+b),l=Math.min(l,a+b));c={schemeIdUri:d,value:e,startTime:g,endTime:l,id:c.getAttribute(\"id\")||\"\",eventElement:c};this.a.onTimelineRegionAdded(c)}.bind(this))};\nk.Qd=function(a,b,c){a=C(a,this.b.retryParameters);null!=b&&(a.headers.Range=\"bytes=\"+b+\"-\"+(null!=c?c:\"\"));return this.a.networkingEngine.request(1,a).then(function(a){return a.data})};function Rd(a,b){return ub[Yb(a,b)]?\"text\":a.split(\"/\")[0]}Ed.mpd=Hd;Dd[\"application/dash+xml\"]=Hd;function Ud(a,b,c,d){this.uri=a;this.type=b;this.ga=c;this.segments=d||null}function Vd(a,b,c,d){this.id=a;this.name=b;this.a=c;this.value=d||null}Vd.prototype.toString=function(){function a(a){return a.name+'=\"'+a.value+'\"'}return this.value?\"#\"+this.name+\":\"+this.value:0<this.a.length?\"#\"+this.name+\":\"+this.a.map(a).join(\",\"):\"#\"+this.name};function Wd(a,b){this.name=a;this.value=b}Vd.prototype.getAttribute=function(a){var b=this.a.filter(function(b){return b.name==a});return b.length?b[0]:null};\nfunction Xd(a,b,c){c=c||null;return(a=a.getAttribute(b))?a.value:c}function Yd(a,b){this.ga=b;this.uri=a};function Zd(a,b){return a.filter(function(a){return a.name==b})}function $d(a,b){var c=Zd(a,b);return c.length?c[0]:null}function ae(a,b,c){return a.filter(function(a){var d=a.getAttribute(\"TYPE\");a=a.getAttribute(\"GROUP-ID\");return d.value==b&&a.value==c})};function be(a){this.b=a;this.a=0}function ce(a,b){b.lastIndex=a.a;var c=(c=b.exec(a.b))?{position:c.index,length:c[0].length,Sd:c}:null;if(a.a==a.b.length||!c||c.position!=a.a)return null;a.a+=c.length;return c.Sd}function de(a){return a.a==a.b.length?null:(a=ce(a,/[^ \\t\\n]*/gm))?a[0]:null};function ee(){this.a=0}\nfunction fe(a,b,c){b=F(b);b=b.replace(/\\r\\n|\\r(?=[^\\n]|$)/gm,\"\\n\").trim();var d=b.split(/\\n+/m);if(!/^#EXTM3U($|[ \\t\\n])/m.test(d[0]))throw new t(2,4,4015);b=0;for(var e=[],f=1;f<d.length;)if(/^#(?!EXT)/m.test(d[f]))f+=1;else{var g=d[f];g=ge(a.a++,g);if(0<=he.indexOf(g.name))b=1;else if(0<=ie.indexOf(g.name)){if(1!=b)throw new t(2,4,4017);d=d.splice(f,d.length-f);a=je(a,d);return new Ud(c,b,e,a)}e.push(g);f+=1;\"EXT-X-STREAM-INF\"==g.name&&(g.a.push(new Wd(\"URI\",d[f])),f+=1)}return new Ud(c,b,e)}\nfunction je(a,b){var c=[],d=[];b.forEach(function(a){/^(#EXT)/.test(a)?(a=ge(this.a++,a),d.push(a)):/^#(?!EXT)/m.test(a)||(c.push(new Yd(a.trim(),d)),d=[])}.bind(a));return c}function ge(a,b){var c=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!c)throw new t(2,4,4016);var d=c[1],e=c[2],c=[];if(e&&0<=e.indexOf(\"=\"))for(var e=new be(e),f,g=/([^=]+)=(?:\"([^\"]*)\"|([^\",]*))(?:,|$)/g;f=ce(e,g);)c.push(new Wd(f[1],f[2]||f[3]));else if(e)return new Vd(a,d,c,e);return new Vd(a,d,c)}\nvar he=\"EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-MAP EXT-X-I-FRAMES-ONLY\".split(\" \"),ie=\"EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE\".split(\" \");function ke(a){return new Promise(function(b){var c=ke.parse(a);b({uri:a,data:c.data,headers:{\"content-type\":c.contentType}})})}n(\"shaka.net.DataUriPlugin\",ke);\nke.parse=function(a){var b=a.split(\":\");if(2>b.length||\"data\"!=b[0])throw new t(2,1,1004,a);b=b.slice(1).join(\":\").split(\",\");if(2>b.length)throw new t(2,1,1004,a);var c=b[0],b=window.decodeURIComponent(b.slice(1).join(\",\")),c=c.split(\";\"),d=null;1<c.length&&(d=c[1]);if(\"base64\"==d)a=Ya(b).buffer;else{if(d)throw new t(2,1,1005,a);a=Ua(b)}return{data:a,contentType:c[0]}};Ea.data=ke;function le(){this.b=this.c=null;this.i=1;this.g={};this.f={};this.a=null;this.j=\"\";this.h=new ee}n(\"shaka.hls.HlsParser\",le);k=le.prototype;k.configure=function(a){this.b=a};k.start=function(a,b){this.c=b;this.j=a;return this.c.networkingEngine.request(0,C([a],this.b.retryParameters)).then(function(b){return ne(this,b.data,a)}.bind(this))};k.stop=function(){this.b=this.c=null;this.g={};return Promise.resolve()};k.update=function(){};k.onExpirationUpdated=function(){};\nfunction ne(a,b,c){b=fe(a.h,b,c);if(0!=b.type)throw new t(2,4,4022);a.a=new T(null,0);return oe(a,b).then(function(a){this.c.filterPeriod(a);return{presentationTimeline:this.a,periods:[a],offlineSessionIds:[],minBufferTime:0}}.bind(a))}\nfunction oe(a,b){var c=Zd(b.ga,\"EXT-X-STREAM-INF\").map(function(a){return pe(this,a,b)}.bind(a)),d=Zd(b.ga,\"EXT-X-MEDIA\").filter(function(a){return\"SUBTITLES\"==U(a,\"TYPE\")}.bind(a)).map(function(a){return qe(this,a,b)}.bind(a));return Promise.all(c).then(function(a){return Promise.all(d).then(function(b){var c=a.reduce(x,[]);re(this,c);return{startTime:0,variants:c,textStreams:b}}.bind(this))}.bind(a))}\nfunction pe(a,b,c){var d=Number(U(b,\"BANDWIDTH\")),e=Xd(b,\"CODECS\",\"avc1.42E01E,mp4a.40.2\").split(\",\"),f=b.getAttribute(\"RESOLUTION\"),g=null,h=null,l=Xd(b,\"FRAME-RATE\");if(f)var m=f.value.split(\"x\"),g=m[0],h=m[1];var q=se(a,c);c=Zd(c.ga,\"EXT-X-MEDIA\");var r=Xd(b,\"AUDIO\"),v=Xd(b,\"VIDEO\");r?c=ae(c,\"AUDIO\",r):v&&(c=ae(c,\"VIDEO\",v));c=c.map(function(a){return te(this,a,e,q)}.bind(a));var u=[],w=[];return Promise.all(c).then(function(a){r?u=a:v&&(w=a);if(u.length||w.length)var c=u.length?\"video\":\"audio\";\nelse 1==e.length?c=f||l?\"video\":\"audio\":(c=\"video\",e=[e.join(\",\")]);a=e;var d=U(b,\"URI\");return ue(this,d,a,c,q,\"und\",!1,null)}.bind(a)).then(function(a){\"audio\"==a.stream.type?u=[a]:w=[a];return ve(this,u,w,d,g,h,l)}.bind(a))}\nfunction ve(a,b,c,d,e,f,g){c.forEach(function(a){if(a=a.stream)a.width=Number(e)||void 0,a.height=Number(f)||void 0,a.frameRate=Number(g)||void 0}.bind(a));b.length||(b=[null]);c.length||(c=[null]);for(var h=[],l=0;l<b.length;l++)for(var m=0;m<c.length;m++){var q=b[l]?b[l].stream:null,r=c[m]?c[m].stream:null,v=b[l]?b[l].drmInfos:null,u=c[m]?c[m].drmInfos:null;if(q&&r)if(v.length&&u.length?0<sb(v,u).length:1)var w=sb(v,u);else continue;else q?w=v:r&&(w=u);h.push(xe(a,q,r,d,w))}return h}\nfunction xe(a,b,c,d,e){return{id:a.i++,language:b?b.language:\"und\",primary:!!b&&b.primary||!!c&&c.primary,audio:b,video:c,bandwidth:d,drmInfos:e,allowedByApplication:!0,allowedByKeySystem:!0}}function qe(a,b,c){U(b,\"TYPE\");c=se(a,c);return te(a,b,[],c).then(function(a){return a.stream})}\nfunction te(a,b,c,d){if(a.g[b.id])return Promise.resolve().then(function(){return this.g[b.id]}.bind(a));var e=U(b,\"TYPE\").toLowerCase();\"subtitles\"==e&&(e=\"text\");var f=Sb(Xd(b,\"LANGUAGE\",\"und\")),g=Xd(b,\"NAME\"),h=b.getAttribute(\"DEFAULT\"),l=b.getAttribute(\"AUTOSELECT\"),m=U(b,\"URI\");return ue(a,m,c,e,d,f,!!h||!!l,g).then(function(a){return this.g[b.id]=a}.bind(a))}\nfunction ue(a,b,c,d,e,f,g,h){b=z([a.j],[b])[0];return a.c.networkingEngine.request(0,C([b],a.b.retryParameters)).then(function(a){a=fe(this.h,a.data,a.uri);if(1!=a.type)throw new t(2,4,4017);e=se(this,a)||e;var b=null;\"text\"!=d&&(b=ye(a));var l=$d(a.ga,\"EXT-X-MEDIA-SEQUENCE\"),l=ze(this,a,l?Number(l.value):0);this.a.Ha(0,l);var r=l[l.length-1].endTime-l[0].startTime,v=this.a.Y();(Infinity==v||v<r)&&this.a.pa(r);var u=Ae(d,c),w=void 0;\"text\"==d&&(w=\"subtitle\");var G=new S(l),pa=[];a.segments.forEach(function(a){a=\nZd(a.ga,\"EXT-X-KEY\");pa.push.apply(pa,a)});var Hb=!1,tc=[],me=null;pa.forEach(function(a){if(\"NONE\"!=U(a,\"METHOD\")){Hb=!0;var b=U(a,\"KEYFORMAT\");if(a=(b=Be[b])?b(a):null)a.keyIds.length&&(me=a.keyIds[0]),tc.push(a)}});if(Hb&&!tc.length)throw new t(2,4,4026);return Ce(this,d,l[0].a()[0]).then(function(a){a={id:this.i++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:G.find.bind(G),getSegmentReference:G.get.bind(G),initSegmentReference:b,presentationTimeOffset:e||0,mimeType:a,codecs:u,\nkind:w,encrypted:Hb,keyId:me,language:f,label:h||null,type:d,primary:g,trickModeVideo:null,containsEmsgBoxes:!1,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[]};this.f[a.id]=G;return{stream:a,Ae:G,drmInfos:tc}}.bind(this))}.bind(a))}\nfunction ye(a){var b=Zd(a.ga,\"EXT-X-MAP\");if(!b.length)return null;if(1<b.length)throw new t(2,4,4020);var b=b[0],c=U(b,\"URI\"),d=z([a.uri],[c])[0];a=0;c=null;if(b=Xd(b,\"BYTERANGE\"))a=b.split(\"@\"),b=Number(a[0]),a=Number(a[1]),c=a+b-1;return new Zc(function(){return[d]},a,c)}\nfunction ze(a,b,c){var d=b.segments,e=[];d.forEach(function(a){var f=a.ga,h=z([b.uri],[a.uri])[0],l=De(f).value.split(\",\"),l=Number(l[0]),m;(a=d.indexOf(a))?m=e[a-1].endTime:m=0;var l=m+l,q=0,r=null;if(f=$d(f,\"EXT-X-BYTERANGE\"))f=f.value.split(\"@\"),r=Number(f[0]),f[1]?q=Number(f[1]):q=e[a-1].M,r=q+r-1,a==d.length-1&&(r=null);e.push(new O(c+a,m,l,function(){return[h]},q,r))}.bind(a));return e}\nfunction re(a,b){b.forEach(function(a){var b=this.a.Y(),c=a.video;a=a.audio;c&&this.f[c.id]&&gd(this.f[c.id],b);a&&this.f[a.id]&&gd(this.f[a.id],b)}.bind(a))}function Ae(a,b){if(1==b.length)return b[0];if(\"text\"==a)return\"\";var c=Ee;\"audio\"==a&&(c=Fe);for(var d=0;d<c.length;d++)for(var e=0;e<b.length;e++)if(c[d].test(b[e].trim()))return b[e].trim();throw new t(2,4,4025,b);}\nfunction Ce(a,b,c){var d=c.split(\".\"),e=d[d.length-1];if(\"text\"==b)return Promise.resolve(\"text/vtt\");d=Ge;\"video\"==b&&(d=He);if(b=d[e])return Promise.resolve(b);c=C([c],a.b.retryParameters);c.method=\"HEAD\";return a.c.networkingEngine.request(1,c).then(function(a){a=a.headers[\"content-type\"];if(!a)throw new t(2,4,4021,e);return a})}function se(a,b){var c=$d(b.ga,\"EXT-X-START\");return c?Number(U(c,\"TIME-OFFSET\")):a.b.hls.defaultTimeOffset}\nfunction U(a,b){var c=a.getAttribute(b);if(!c)throw new t(2,4,4023,b);return c.value}function De(a){a=$d(a,\"EXTINF\");if(!a)throw new t(2,4,4024,\"EXTINF\");return a}\nvar Ee=[/^(avc)/,/^(hvc)/,/^(vp[8-9])$/,/^(av1)$/,/^(mp4v)/],Fe=[/^(vorbis)/,/^(opus)/,/^(mp4a)/,/^(ac-3)$/,/^(ec-3)$/],Ge={mp4:\"audio/mp4\",m4s:\"audio/mp4\",m4i:\"audio/mp4\",m4a:\"audio/mp4\",ts:\"video/mp2t\"},He={mp4:\"video/mp4\",m4s:\"video/mp4\",m4i:\"video/mp4\",m4v:\"video/mp4\",ts:\"video/mp2t\"},Be={\"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed\":function(a){if(\"SAMPLE-AES-CENC\"!=U(a,\"METHOD\"))return null;var b=U(a,\"URI\"),b=ke.parse(b),b=new Uint8Array(b.data),b=Ba(\"com.widevine.alpha\",[{initDataType:\"cenc\",\ninitData:b}]);if(a=Xd(a,\"KEYID\"))b.keyIds=[a.substr(2).toLowerCase()];return b}};Ed.m3u8=le;Dd[\"application/x-mpegurl\"]=le;Dd[\"application/vnd.apple.mpegurl\"]=le;function Ie(){}Ie.prototype.parseInit=function(){};\nIe.prototype.parseMedia=function(a,b){var c=F(a),d=[],e=new DOMParser,f=null;try{f=e.parseFromString(c,\"text/xml\")}catch(Hb){throw new t(2,2,2005);}if(f){var g=f.getElementsByTagName(\"tt\")[0];if(g){e=g.getAttribute(\"ttp:frameRate\");f=g.getAttribute(\"ttp:subFrameRate\");var h=g.getAttribute(\"ttp:frameRateMultiplier\");var l=g.getAttribute(\"ttp:tickRate\");c=g.getAttribute(\"xml:space\")||\"default\"}else throw new t(2,2,2005);if(\"default\"!=c&&\"preserve\"!=c)throw new t(2,2,2005);c=\"default\"==c;e=new Je(e,\nf,h,l);f=Ke(g.getElementsByTagName(\"styling\")[0]);h=Ke(g.getElementsByTagName(\"layout\")[0]);g=Ke(g.getElementsByTagName(\"body\")[0]);for(l=0;l<g.length;l++){var m=g[l],q=b.periodStart,r=e;var v=f;var u=h,w=c;if(m.hasAttribute(\"begin\")||m.hasAttribute(\"end\")||!/^\\s*$/.test(m.textContent)){Le(m,w);var w=Me(m.getAttribute(\"begin\"),r),G=Me(m.getAttribute(\"end\"),r),r=Me(m.getAttribute(\"dur\"),r),pa=m.textContent;null==G&&null!=r&&(G=w+r);if(null==w||null==G)throw new t(2,2,2001);if(q=xb(w+q,G+q,pa)){w=Ne(m,\n\"region\",u);u=q;if(G=Oe(m,w,v,\"tts:extent\"))if(r=Pe.exec(G))u.size=Number(r[1]);r=Oe(m,w,v,\"tts:writingMode\");G=!0;\"tb\"==r||\"tblr\"==r?u.vertical=\"lr\":\"tbrl\"==r?u.vertical=\"rl\":G=!1;if(r=Oe(m,w,v,\"tts:origin\"))if(r=Pe.exec(r))G?(u.position=Number(r[2]),u.line=Number(r[1])):(u.position=Number(r[1]),u.line=Number(r[2])),u.snapToLines=!1;if(v=Oe(m,w,v,\"tts:textAlign\"))u.align=v,\"center\"==v&&(\"center\"!=u.align&&(u.align=\"middle\"),u.position=\"auto\"),u.positionAlign=Qe[v],u.lineAlign=Re[v];v=q}else v=null}else v=\nnull;v&&d.push(v)}}return d};var Se=/^(\\d{2,}):(\\d{2}):(\\d{2}):(\\d{2})\\.?(\\d+)?$/,Te=/^(?:(\\d{2,}):)?(\\d{2}):(\\d{2})$/,Ue=/^(?:(\\d{2,}):)?(\\d{2}):(\\d{2}\\.\\d{2,})$/,Ve=/^(\\d*\\.?\\d*)f$/,We=/^(\\d*\\.?\\d*)t$/,Xe=/^(?:(\\d*\\.?\\d*)h)?(?:(\\d*\\.?\\d*)m)?(?:(\\d*\\.?\\d*)s)?(?:(\\d*\\.?\\d*)ms)?$/,Pe=/^(\\d{1,2}|100)% (\\d{1,2}|100)%$/,Re={left:\"start\",center:\"center\",right:\"end\",start:\"start\",end:\"end\"},Qe={left:\"line-left\",center:\"center\",right:\"line-right\"};\nfunction Ke(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=Ke(c[d]),b=b.concat(e))}b.length||b.push(a);return b}function Le(a,b){for(var c=a.childNodes,d=0;d<c.length;d++)if(\"br\"==c[d].nodeName&&0<d)c[d-1].textContent+=\"\\n\";else if(0<c[d].childNodes.length)Le(c[d],b);else if(b){var e=c[d].textContent.trim(),e=e.replace(/\\s+/g,\" \");c[d].textContent=e}}\nfunction Oe(a,b,c,d){for(var e=Ke(b),f=0;f<e.length;f++){var g=e[f].getAttribute(d);if(g)return g}e=Ne;return(a=e(b,\"style\",c)||e(a,\"style\",c))?a.getAttribute(d):null}function Ne(a,b,c){if(!a||1>c.length)return null;var d=null,e=a;for(a=null;e&&!(a=e.getAttribute(b))&&(e=e.parentNode,e instanceof Element););if(b=a)for(a=0;a<c.length;a++)if(c[a].getAttribute(\"xml:id\")==b){d=c[a];break}return d}\nfunction Me(a,b){var c=null;if(Se.test(a))var c=Se.exec(a),d=Number(c[1]),e=Number(c[2]),f=Number(c[3]),g=Number(c[4]),g=g+(Number(c[5])||0)/b.b,f=f+g/b.frameRate,c=f+60*e+3600*d;else Te.test(a)?c=Ye(Te,a):Ue.test(a)?c=Ye(Ue,a):Ve.test(a)?(c=Ve.exec(a),c=Number(c[1])/b.frameRate):We.test(a)?(c=We.exec(a),c=Number(c[1])/b.a):Xe.test(a)&&(c=Ye(Xe,a));return c}\nfunction Ye(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 Je(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])}vb(\"application/ttml+xml\",Ie);function Ze(){this.a=new Ie}Ze.prototype.parseInit=function(a){var b=!1;(new Q).C(\"moov\",R).C(\"trak\",R).C(\"mdia\",R).C(\"minf\",R).C(\"stbl\",R).da(\"stsd\",cd).C(\"stpp\",function(){b=!0}).parse(a);if(!b)throw new t(2,2,2007);};Ze.prototype.parseMedia=function(a,b){var c=!1,d=[];(new Q).C(\"mdat\",dd(function(a){c=!0;d=this.a.parseMedia(a.buffer,b)}.bind(this))).parse(a);if(!c)throw new t(2,2,2007);return d};vb('application/mp4; codecs=\"stpp\"',Ze);function $e(){}$e.prototype.parseInit=function(){};\n$e.prototype.parseMedia=function(a,b){var c=F(a),c=c.replace(/\\r\\n|\\r(?=[^\\n]|$)/gm,\"\\n\"),c=c.split(/\\n{2,}/m);if(!/^WEBVTT($|[ \\t\\n])/m.test(c[0]))throw new t(2,2,2E3);var d=b.segmentStart;if(0<=c[0].indexOf(\"X-TIMESTAMP-MAP\")){var e=c[0].match(/LOCAL:((?:(\\d{1,}):)?(\\d{2}):(\\d{2})\\.(\\d{3}))/m),f=c[0].match(/MPEGTS:(\\d+)/m);e&&f&&(d=af(new be(e[1])),d=b.periodStart+(Number(f[1])/9E4-d))}f=[];for(e=1;e<c.length;e++){var g=c[e].split(\"\\n\"),h=d;if(1==g.length&&!g[0]||/^NOTE($|[ \\t])/.test(g[0]))var l=\nnull;else{l=null;0>g[0].indexOf(\"--\\x3e\")&&(l=g[0],g.splice(0,1));var m=new be(g[0]),q=af(m),r=ce(m,/[ \\t]+--\\x3e[ \\t]+/g),v=af(m);if(null==q||!r||null==v)throw new t(2,2,2001);if(g=xb(q+h,v+h,g.slice(1).join(\"\\n\").trim())){ce(m,/[ \\t]+/gm);for(h=de(m);h;)bf(g,h),ce(m,/[ \\t]+/gm),h=de(m);null!=l&&(g.id=l);l=g}else l=null}l&&f.push(l)}return f};\nfunction bf(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=\n!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])}function af(a){a=ce(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)}vb(\"text/vtt\",$e);vb('text/vtt; codecs=\"vtt\"',$e);function cf(){this.a=null}cf.prototype.parseInit=function(a){var b=!1;(new Q).C(\"moov\",R).C(\"trak\",R).C(\"mdia\",R).da(\"mdhd\",function(a){0==a.version?(a.s.I(4),a.s.I(4),this.a=a.s.D(),a.s.I(4)):(a.s.I(8),a.s.I(8),this.a=a.s.D(),a.s.I(8));a.s.I(4)}.bind(this)).C(\"minf\",R).C(\"stbl\",R).da(\"stsd\",cd).C(\"wvtt\",function(){b=!0}).parse(a);if(!this.a)throw new t(2,2,2008);if(!b)throw new t(2,2,2008);};\ncf.prototype.parseMedia=function(a,b){var c=0,d=[],e=[],f=[],g=!1,h=!1,l=!1;(new Q).C(\"moof\",R).C(\"traf\",R).da(\"tfdt\",function(a){g=!0;c=a.version?a.s.Pa():a.s.D()}).da(\"trun\",function(a){h=!0;var b=a.version,c=a.Nc;a=a.s;var e=a.D();c&1&&a.I(4);c&4&&a.I(4);for(var f=[],g=0;g<e;g++){var l={duration:null,Nb:null};c&256&&(l.duration=a.D());c&512&&a.I(4);c&1024&&a.I(4);c&2048&&(l.Nb=b?a.nc():a.D());f.push(l)}d=f}).C(\"vtte\",function(){e.push(null)}).C(\"vttc\",dd(function(a){e.push(a.buffer)})).C(\"mdat\",\nfunction(a){l=!0;R(a)}).parse(a);if(!l&&!g&&!h)throw new t(2,2,2008);for(var m=c,q=0;q<d.length;q++){var r=d[q],v=e[q];if(r.duration){var u=r.Nb?c+r.Nb:m,m=u+r.duration;v&&f.push(df(v,b.periodStart+u/this.a,b.periodStart+m/this.a))}}return f};function df(a,b,c){var d,e,f;(new Q).C(\"payl\",dd(function(a){d=F(a)})).C(\"iden\",dd(function(a){e=F(a)})).C(\"sttg\",dd(function(a){f=F(a)})).parse(a);return d?ef(d,e,f,b,c):null}\nfunction ef(a,b,c,d,e){(a=xb(d,e,a))&&b&&(a.id=b);if(a&&c)for(b=new be(c),c=de(b);c;)bf(a,c),ce(b,/[ \\t]+/gm),c=de(b);return a}vb('application/mp4; codecs=\"wvtt\"',cf);function ff(a,b,c,d,e,f){this.a=a;this.c=b;this.l=c;this.A=d;this.J=e;this.G=f;this.b=new D;this.h=!1;this.g=1;this.j=this.f=null;this.B=a.readyState;this.i=!1;this.O=this.v=-1;this.o=!1;0<a.readyState?this.fc():La(this.b,a,\"loadedmetadata\",this.fc.bind(this));b=this.hc.bind(this);E(this.b,a,\"ratechange\",this.rd.bind(this));E(this.b,a,\"waiting\",b);this.j=setInterval(b,250)}k=ff.prototype;\nk.m=function(){var a=this.b.m();this.b=null;null!=this.f&&(window.clearInterval(this.f),this.f=null);null!=this.j&&(window.clearInterval(this.j),this.j=null);this.G=this.J=this.l=this.c=this.a=null;return a};function gf(a,b){0<a.a.readyState?a.a.currentTime=hf(a,b):a.A=b}function jf(a){return 0<a.a.readyState?hf(a,a.a.currentTime):kf(a)}function kf(a){if(a.A)return hf(a,a.A);a=a.c.presentationTimeline;return Infinity>a.Y()?a.ma():a.bb()}k.rb=function(){return this.g};\nfunction lf(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.Ab=function(){this.o=!0;this.hc()};k.rd=function(){this.a.playbackRate!=(this.h||0>this.g?0:this.g)&&lf(this,this.a.playbackRate)};\nk.fc=function(){var a=kf(this);.001>Math.abs(this.a.currentTime-a)?(E(this.b,this.a,\"seeking\",this.ic.bind(this)),E(this.b,this.a,\"playing\",this.gc.bind(this))):(La(this.b,this.a,\"seeking\",this.td.bind(this)),this.a.currentTime=a)};k.td=function(){E(this.b,this.a,\"seeking\",this.ic.bind(this));E(this.b,this.a,\"playing\",this.gc.bind(this))};\nk.hc=function(){if(this.a.readyState){this.a.readyState!=this.B&&(this.i=!1,this.B=this.a.readyState);var a=this.l.smallGapLimit,b=this.a.currentTime,c=this.a.buffered;a:{if(c&&c.length&&!(1==c.length&&1E-6>c.end(0)-c.start(0))){var d=.1;/(Edge|Trident)\\//.test(navigator.userAgent)&&(d=.5);for(var e=0;e<c.length;e++)if(c.start(e)>b&&(!e||c.end(e-1)-b<=d)){d=e;break a}}d=null}if(null==d){if(3>this.a.readyState&&0<this.a.playbackRate)if(this.O!=b)this.O=b,this.v=Date.now();else if(this.v<Date.now()-\n1E3)for(this.v=Date.now()+5E3,d=0;d<c.length;d++)if(b>=c.start(d)&&b<c.end(d)-.5){this.a.currentTime=this.a.currentTime;break}}else if(d||this.o)if(e=c.start(d),!(e>=this.c.presentationTimeline.bb())){var f=e-b,a=f<=a,g=!1;a||this.i||(this.i=!0,f=new I(\"largegap\",{currentTime:b,gapSize:f}),f.cancelable=!0,this.G(f),this.l.jumpLargeGaps&&!f.defaultPrevented&&(g=!0));if(a||g)d&&c.end(d-1),mf(this,b,e)}}};\nk.ic=function(){this.o=!1;var a=this.a.currentTime,b=nf(this,a);.001<Math.abs(b-a)?mf(this,a,b):(this.i=!1,this.J())};k.gc=function(){var a=this.a.currentTime,b=nf(this,a);.001<Math.abs(b-a)&&mf(this,a,b)};function nf(a,b){var c=Bb.bind(null,a.a.buffered),d=1*Math.max(a.c.minBufferTime||0,a.l.rebufferingGoal),e=a.c.presentationTimeline,f=e.ua(),g=e.Ea(d),h=e.Ea(5),d=e.Ea(d+5);return b>f?f:b<e.Ea(0)?c(h)?h:d:b>=g||c(b)?b:d}\nfunction mf(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 hf(a,b){var c=a.c.presentationTimeline.ma();if(b<c)return c;c=a.c.presentationTimeline.ua();return b>c?c:b};function of(a,b,c,d,e,f){this.a=a;this.g=b;this.A=c;this.l=d;this.h=e;this.B=f;this.c=[];this.j=new D;this.b=!1;this.i=-1;this.f=null;pf(this)}of.prototype.m=function(){var a=this.j?this.j.m():Promise.resolve();this.j=null;qf(this);this.B=this.h=this.l=this.A=this.g=this.a=null;this.c=[];return a};\nof.prototype.v=function(a){if(!this.c.some(function(b){return b.info.schemeIdUri==a.schemeIdUri&&b.info.startTime==a.startTime&&b.info.endTime==a.endTime})){var b={info:a,status:1};this.c.push(b);var c=new I(\"timelineregionadded\",{detail:rf(a)});this.h(c);this.o(!0,b)}};function rf(a){var b=Da(a);b.eventElement=a.eventElement;return b}\nof.prototype.o=function(a,b){var c=b.info.startTime>this.a.currentTime?1:b.info.endTime<this.a.currentTime?3:2,d=2==b.status,e=2==c;if(c!=b.status){if(!a||d||e)d||this.h(new I(\"timelineregionenter\",{detail:rf(b.info)})),e||this.h(new I(\"timelineregionexit\",{detail:rf(b.info)}));b.status=c}};function pf(a){qf(a);a.f=window.setTimeout(a.G.bind(a),250)}function qf(a){a.f&&(window.clearTimeout(a.f),a.f=null)}\nof.prototype.G=function(){this.f=null;pf(this);var a=hc(this.g,this.a.currentTime);a!=this.i&&(-1!=this.i&&this.B(),this.i=a);var a=Cb(this.a.buffered,this.a.currentTime),b=Ab(this.a.buffered)>=this.g.presentationTimeline.ua()-.1||this.a.ended;if(this.b){var c=1*Math.max(this.g.minBufferTime||0,this.A.rebufferingGoal);(b||a>=c)&&0!=this.b&&(this.b=!1,this.l(!1))}else!b&&.5>a&&1!=this.b&&(this.b=!0,this.l(!0));this.c.forEach(this.o.bind(this,!1))};function sf(a,b){this.a=b;this.b=a;this.g=null;this.i=1;this.o=Promise.resolve();this.h=[];this.j={};this.c={};this.f=this.l=this.v=!1}k=sf.prototype;k.m=function(){for(var a in this.c)tf(this.c[a]);this.g=this.c=this.j=this.h=this.o=this.b=this.a=null;this.f=!0;return Promise.resolve()};k.configure=function(a){this.g=a};k.init=function(){var a=this.a.bc(this.b.periods[hc(this.b,jf(this.a.Oa))]);return Ma(a)?Promise.reject(new t(2,5,5005)):uf(this,a).then(function(){this.a&&this.a.jd&&this.a.jd()}.bind(this))};\nfunction V(a){return a.b.periods[hc(a.b,jf(a.a.Oa))]}function vf(a){return Oa(a.c,function(a){return a.na||a.stream})}function wf(a,b){var c={};c.text=b;return uf(a,c)}function xf(a,b){var c=a.c.video;if(c){var d=c.stream;if(d)if(b){var e=d.trickModeVideo;if(e){var f=c.na;f||(yf(a,\"video\",e,!1),c.na=d)}}else if(f=c.na)c.na=null,yf(a,\"video\",f,!0)}}\nfunction yf(a,b,c,d){var e=a.c[b];if(!e&&\"text\"==b&&a.g.ignoreTextStreamFailures)wf(a,c);else if(e){var f=ic(a.b,c);d&&f!=e.wa?zf(a):(e.na&&(c.trickModeVideo?(e.na=c,c=c.trickModeVideo):e.na=null),\"text\"==b&&Fb(a.a.K,Yb(c.mimeType,c.codecs)),(b=a.h[f])&&b.La&&(b=a.j[c.id])&&b.La&&e.stream!=c&&(e.stream=c,e.cb=!0,d&&(e.sa?e.kb=!0:e.xa?(e.ra=!0,e.kb=!0):(tf(e),Af(a,e,!0)))))}}\nfunction Bf(a){var b=jf(a.a.Oa);Object.keys(a.c).every(function(a){var c=this.a.K;\"text\"==a?(a=c.a,a=b>=a.b&&b<a.a):(a=Ib(c,a),a=Bb(a,b));return a}.bind(a))||zf(a)}function zf(a){for(var b in a.c){var c=a.c[b];c.sa||c.ra||(c.xa?c.ra=!0:null==Gb(a.a.K,b)?null==c.qa&&Cf(a,c,0):(tf(c),Af(a,c,!1)))}}\nfunction uf(a,b,c){var d=hc(a.b,jf(a.a.Oa)),e=Oa(b,function(a){return Yb(a.mimeType,a.codecs)});a.a.K.init(e);Df(a);e=Na(b);return Ef(a,e).then(function(){if(!this.f)for(var a in b){var e=b[a];this.c[a]||(this.c[a]={stream:e,type:a,Fa:null,ea:null,na:null,cb:!0,wa:d,endOfStream:!1,xa:!1,qa:null,ra:!1,kb:!1,sa:!1,Gb:!1,tb:!1,rc:c||0},Cf(this,this.c[a],0))}}.bind(a))}\nfunction Ff(a,b){var c=a.h[b];if(c)return c.L;c={L:new A,La:!1};a.h[b]=c;var d=a.b.periods[b].variants.map(function(a){var b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);a.video&&a.video.trickModeVideo&&b.push(a.video.trickModeVideo);return b}).reduce(x,[]).filter(Aa);d.push.apply(d,a.b.periods[b].textStreams);a.o=a.o.then(function(){if(!this.f)return Ef(this,d)}.bind(a)).then(function(){this.f||(this.h[b].L.resolve(),this.h[b].La=!0)}.bind(a))[\"catch\"](function(a){this.f||(this.h[b].L.reject(),\ndelete this.h[b],this.a.onError(a))}.bind(a));return c.L}\nfunction Ef(a,b){b.map(function(a){return a.id}).filter(Aa);for(var c=[],d=0;d<b.length;++d){var e=b[d];var f=a.j[e.id];f?c.push(f.L):(a.j[e.id]={L:new A,La:!1},c.push(e.createSegmentIndex()))}return Promise.all(c).then(function(){if(!this.f)for(var a=0;a<b.length;++a){var c=this.j[b[a].id];c.La||(c.L.resolve(),c.La=!0)}}.bind(a))[\"catch\"](function(a){if(!this.f)return this.j[e.id].L.reject(),delete this.j[e.id],Promise.reject(a)}.bind(a))}\nfunction Df(a){var b=a.b.presentationTimeline.Y();Infinity>b?a.a.K.pa(b):a.a.K.pa(Math.pow(2,32))}k.ke=function(a){if(!this.f&&!a.xa&&null!=a.qa&&!a.sa)if(a.qa=null,a.ra)Af(this,a,a.kb);else{try{var b=Gf(this,a);null!=b&&(Cf(this,a,b),a.tb=!1)}catch(c){this.a.onError(c);return}b=Na(this.c);Hf(this,a);b.every(function(a){return a.endOfStream})&&this.a.K.endOfStream().then(function(){this.b.presentationTimeline.pa(this.a.K.Y())}.bind(this))}};\nfunction Gf(a,b){var c=jf(a.a.Oa),d=b.Fa&&b.ea?a.b.periods[ic(a.b,b.Fa)].startTime+b.ea.endTime:Math.max(c,b.rc);b.rc=0;var e=ic(a.b,b.stream),f=hc(a.b,d);var g=a.a.K;var h=b.type;\"text\"==h?(g=g.a,g=null==g.a||g.a<c?0:g.a-Math.max(c,g.b)):(g=Ib(g,h),g=Cb(g,c));h=Math.max(a.i*Math.max(a.b.minBufferTime||0,a.g.rebufferingGoal),a.i*a.g.bufferingGoal);if(d>=a.b.presentationTimeline.Y())return b.endOfStream=!0,null;b.endOfStream=!1;b.wa=f;if(f!=e)return null;if(g>=h)return.5;d=a.a.K;f=b.type;d=\"text\"==\nf?d.a.a:Ab(Ib(d,f));b.ea&&b.stream==b.Fa?(f=b.ea.position+1,d=If(a,b,e,f)):(f=b.ea?b.stream.findSegmentPosition(Math.max(0,a.b.periods[ic(a.b,b.Fa)].startTime+b.ea.endTime-a.b.periods[e].startTime)):b.stream.findSegmentPosition(Math.max(0,(d||c)-a.b.periods[e].startTime)),null==f?d=null:(g=null,null==d&&(g=If(a,b,e,Math.max(0,f-1))),d=g||If(a,b,e,f)));if(!d)return 1;Jf(a,b,c,e,d);return null}\nfunction If(a,b,c,d){c=a.b.periods[c];b=b.stream.getSegmentReference(d);if(!b)return null;a=a.b.presentationTimeline;d=a.ua();return c.startTime+b.endTime<a.ma()||c.startTime+b.startTime>d?null:b}\nfunction Jf(a,b,c,d,e){var f=a.b.periods[d],g=b.stream,h=a.b.periods[d+1],l=null,l=h?h.startTime:a.b.presentationTimeline.Y();d=Kf(a,b,d,l);b.xa=!0;b.cb=!1;h=Lf(a,e);Promise.all([d,h]).then(function(a){if(!this.f&&!this.l)return Mf(this,b,c,f,g,e,a[1])}.bind(a)).then(function(){this.f||this.l||(b.xa=!1,b.Gb=!1,b.ra||this.a.Ab(),Cf(this,b,0),Nf(this,g))}.bind(a))[\"catch\"](function(a){this.f||this.l||(b.xa=!1,this.b.presentationTimeline.$()&&this.g.infiniteRetriesForLiveStreams&&(1001==a.code||1002==\na.code||1003==a.code)?\"text\"==b.type&&this.g.ignoreTextStreamFailures&&1001==a.code?delete this.c.text:(a.severity=1,this.a.onError(a),Cf(this,b,4)):3017==a.code?Of(this,b,a):\"text\"==b.type&&this.g.ignoreTextStreamFailures?delete this.c.text:(b.tb=!0,a.severity=2,this.a.onError(a)))}.bind(a))}function Of(a,b,c){if(!Na(a.c).some(function(a){return a!=b&&a.Gb})){var d=Math.round(100*a.i);if(20<d)a.i-=.2;else if(4<d)a.i-=.04;else{b.tb=!0;a.l=!0;a.a.onError(c);return}b.Gb=!0}Cf(a,b,4)}\nfunction Kf(a,b,c,d){if(!b.cb)return Promise.resolve();c=Mb(a.a.K,b.type,a.b.periods[c].startTime-b.stream.presentationTimeOffset,d);if(!b.stream.initSegmentReference)return c;a=Lf(a,b.stream.initSegmentReference).then(function(a){if(!this.f)return Jb(this.a.K,b.type,a,null,null)}.bind(a))[\"catch\"](function(a){b.cb=!0;return Promise.reject(a)});return Promise.all([c,a])}\nfunction Mf(a,b,c,d,e,f,g){e.containsEmsgBoxes&&(new Q).da(\"emsg\",a.Ed.bind(a,d,f)).parse(g);return Pf(a,b,c).then(function(){if(!this.f)return Jb(this.a.K,b.type,g,f.startTime+d.startTime,f.endTime+d.startTime)}.bind(a)).then(function(){if(!this.f)return b.Fa=e,b.ea=f,Promise.resolve()}.bind(a))}\nk.Ed=function(a,b,c){var d=c.s.Db(),e=c.s.Db(),f=c.s.D(),g=c.s.D(),h=c.s.D(),l=c.s.D();c=c.s.Ka(c.s.H.byteLength-c.s.u);a=a.startTime+b.startTime+g/f;if(\"urn:mpeg:dash:event:2012\"==d)this.a.kd();else this.a.onEvent(new I(\"emsg\",{detail:{startTime:a,endTime:a+h/f,schemeIdUri:d,value:e,timescale:f,presentationTimeDelta:g,eventDuration:h,id:l,messageData:c}}))};\nfunction Pf(a,b,c){var d=Gb(a.a.K,b.type);if(null==d)return Promise.resolve();c=c-d-a.g.bufferBehind;return 0>=c?Promise.resolve():a.a.K.remove(b.type,d,d+c).then(function(){}.bind(a))}function Nf(a,b){if(!a.v&&(a.v=Na(a.c).every(function(a){return\"text\"==a.type?!0:!a.ra&&!a.sa&&a.ea}),a.v)){var c=ic(a.b,b);a.h[c]||Ff(a,c).then(function(){this.a.ac()}.bind(a))[\"catch\"](y);for(c=0;c<a.b.periods.length;++c)Ff(a,c)[\"catch\"](y);a.a.wd&&a.a.wd()}}\nfunction Hf(a,b){if(b.wa!=ic(a.b,b.stream)){var c=b.wa,d=Na(a.c);d.every(function(a){return a.wa==c})&&d.every(Qf)&&Ff(a,c).then(function(){if(!this.f&&d.every(function(a){var b=ic(this.b,a.stream);return Qf(a)&&a.wa==c&&b!=c}.bind(this))){var a=this.b.periods[c],b=this.a.bc(a),g;for(g in this.c)if(!b[g]&&\"text\"!=g){this.a.onError(new t(2,5,5005));return}for(g in b)if(!this.c[g])if(\"text\"==g)uf(this,{text:b.text},a.startTime),delete b[g];else{this.a.onError(new t(2,5,5005));return}for(g in this.c)(a=\nb[g])?(yf(this,g,a,!1),Cf(this,this.c[g],0)):delete this.c[g];this.a.ac()}}.bind(a))[\"catch\"](y)}}function Qf(a){return!a.xa&&null==a.qa&&!a.ra&&!a.sa}function Lf(a,b){var c=C(b.a(),a.g.retryParameters);if(b.X||null!=b.M){var d=\"bytes=\"+b.X+\"-\";null!=b.M&&(d+=b.M);c.headers.Range=d}return a.a.dd.request(1,c).then(function(a){return a.data})}\nfunction Af(a,b,c){b.ra=!1;b.kb=!1;b.sa=!0;Lb(a.a.K,b.type).then(function(){if(!this.f&&c){var a=this.a.K,e=b.type;return\"text\"==e?Promise.resolve():Kb(a,e,a.Oc.bind(a,e))}}.bind(a)).then(function(){this.f||(b.Fa=null,b.ea=null,b.sa=!1,b.endOfStream=!1,Cf(this,b,0))}.bind(a))}function Cf(a,b,c){b.qa=window.setTimeout(a.ke.bind(a,b),1E3*c)}function tf(a){null!=a.qa&&(window.clearTimeout(a.qa),a.qa=null)};function Rf(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;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},{});if(200<=b.status&&299>=b.status&&202!=b.status)b.responseURL&&(a=b.responseURL),c({uri:a,data:b.response,headers:e,fromCache:!!e[\"x-shaka-from-cache\"]});\nelse{var f=null;try{f=Ta(b.response)}catch(m){}d(new t(401==b.status||403==b.status?2:1,1,1001,a,b.status,f,e))}};e.onerror=function(){d(new t(1,1,1002,a))};e.ontimeout=function(){d(new t(1,1,1003,a))};for(var f in b.headers)e.setRequestHeader(f,b.headers[f]);e.send(b.body)})}n(\"shaka.net.HttpPlugin\",Rf);Ea.http=Rf;Ea.https=Rf;function Sf(){this.a=null;this.b=[];this.c={}}k=Sf.prototype;k.init=function(a,b){return Tf(this,a,b).then(function(){var b=Object.keys(a);return Promise.all(b.map(function(a){return Uf(this,a).then(function(b){this.c[a]=b}.bind(this))}.bind(this)))}.bind(this))};k.m=function(){return Promise.all(this.b.map(function(a){try{a.transaction.abort()}catch(b){}return a.L[\"catch\"](y)})).then(function(){this.a&&(this.a.close(),this.a=null)}.bind(this))};\nk.get=function(a,b){var c;return Vf(this,a,\"readonly\",function(a){c=a.get(b)}).then(function(){return c.result})};k.forEach=function(a,b){return Vf(this,a,\"readonly\",function(a){a.openCursor().onsuccess=function(a){if(a=a.target.result)b(a.value),a[\"continue\"]()}})};function Wf(a,b,c){return Vf(a,b,\"readwrite\",function(a){a.put(c)})}k.remove=function(a,b){return Vf(this,a,\"readwrite\",function(a){a[\"delete\"](b)})};\nfunction Xf(a,b,c){return Vf(a,\"segment\",\"readwrite\",function(a){for(var d=0;d<b.length;d++)a[\"delete\"](b[d]).onsuccess=c||function(){}})}function Uf(a,b){var c=0;return Vf(a,b,\"readonly\",function(a){a.openCursor(null,\"prev\").onsuccess=function(a){(a=a.target.result)&&(c=a.key+1)}}).then(function(){return c})}\nfunction Vf(a,b,c,d){var e={transaction:a.a.transaction([b],c),L:new A};e.transaction.oncomplete=function(){this.b.splice(this.b.indexOf(e),1);e.L.resolve()}.bind(a);e.transaction.onabort=function(a){this.b.splice(this.b.indexOf(e),1);Yf(e.transaction,e.L,a)}.bind(a);e.transaction.onerror=function(a){a.preventDefault()}.bind(a);b=e.transaction.objectStore(b);d(b);a.b.push(e);return e.L}\nfunction Tf(a,b,c){var d=window.indexedDB.open(\"shaka_offline_db\",1),e=!1,f=new A;d.onupgradeneeded=function(a){e=!0;a=a.target.result;for(var c in b)a.createObjectStore(c,{keyPath:b[c]})};d.onsuccess=function(a){c&&!e?(a.target.result.close(),setTimeout(function(){Tf(this,b,c-1).then(f.resolve,f.reject)}.bind(this),1E3)):(this.a=a.target.result,f.resolve())}.bind(a);d.onerror=Yf.bind(null,d,f);return f}\nfunction Yf(a,b,c){a.error?b.reject(new t(2,9,9001,a.error)):b.reject(new t(2,9,9002));c.preventDefault()};var Zf={manifest:\"key\",segment:\"key\"};function $f(a){var b=ag(a.periods[0],[],new T(null,0)),c=Zb(b,null,null),b=ac(b,null);c.push.apply(c,b);return{offlineUri:\"offline:\"+a.key,originalManifestUri:a.originalManifestUri,duration:a.duration,size:a.size,expiration:void 0==a.expiration?Infinity:a.expiration,tracks:c,appMetadata:a.appMetadata}}\nfunction ag(a,b,c){var d=a.streams.filter(function(a){return\"text\"==a.contentType}),e=a.streams.filter(function(a){return\"audio\"==a.contentType}),f=a.streams.filter(function(a){return\"video\"==a.contentType});b=bg(e,f,b);d=d.map(cg);a.streams.forEach(function(a){a=dg(a);c.Ha(0,a)});return{startTime:a.startTime,variants:b,textStreams:d}}function dg(a){return a.segments.map(function(a,c){return new O(c,a.startTime,a.endTime,function(){return[a.uri]},0,null)})}\nfunction bg(a,b,c){var d=[];if(!a.length&&!b.length)return d;a.length?b.length||(b=[null]):a=[null];for(var e=0,f=0;f<a.length;f++)for(var g=0;g<b.length;g++)if(eg(a[f],b[g])){var h=a[f];var l=b[g],m=c;h={id:e++,language:h?h.language:\"\",primary:!!h&&h.primary||!!l&&l.primary,audio:cg(h),video:cg(l),bandwidth:0,drmInfos:m,allowedByApplication:!0,allowedByKeySystem:!0};d.push(h)}return d}\nfunction eg(a,b){if(!(a&&b&&a.variantIds&&b.variantIds))return!0;for(var c=0;c<a.variantIds.length;c++)if(b.variantIds.some(function(b){return b==a.variantIds[c]}))return!0;return!1}\nfunction cg(a){if(!a)return null;var b=dg(a),b=new S(b);return{id:a.id,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:b.find.bind(b),getSegmentReference:b.get.bind(b),initSegmentReference:a.initSegmentUri?new Zc(function(){return[a.initSegmentUri]},0,null):null,presentationTimeOffset:a.presentationTimeOffset,mimeType:a.mimeType,codecs:a.codecs,width:a.width||void 0,height:a.height||void 0,frameRate:a.frameRate||void 0,kind:a.kind,encrypted:a.encrypted,keyId:a.keyId,language:a.language,\nlabel:a.label||null,type:a.contentType,primary:a.primary,trickModeVideo:null,containsEmsgBoxes:!1,roles:[]}}function fg(){return window.indexedDB?new Sf:null};function gg(a,b,c,d){this.b={};this.l=[];this.o=d;this.j=a;this.v=b;this.A=c;this.i=this.a=null;this.f=this.g=this.h=this.c=0}gg.prototype.m=function(){var a=this.j,b=this.l,c=this.i||Promise.resolve(),c=c.then(function(){return Xf(a,b)});this.b={};this.l=[];this.i=this.a=this.A=this.v=this.j=this.o=null;return c};function hg(a,b,c,d,e){a.b[b]=a.b[b]||[];a.b[b].push({uris:c.a(),X:c.X,M:c.M,Rb:d,Hb:e})}\nfunction ig(a,b){a.c=0;a.h=0;a.g=0;a.f=0;Na(a.b).forEach(function(a){a.forEach(function(a){null!=a.M?this.c+=a.M-a.X+1:this.g+=a.Rb}.bind(this))}.bind(a));a.a=b;a.a.size=a.c;var c=Na(a.b).map(function(a){var b=0,c=function(){if(!this.o)return Promise.reject(new t(2,9,9002));if(b>=a.length)return Promise.resolve();var d=a[b++];return jg(this,d).then(c)}.bind(this);return c()}.bind(a));a.b={};a.i=Promise.all(c).then(function(){return Wf(this.j,\"manifest\",b)}.bind(a)).then(function(){this.l=[]}.bind(a));\nreturn a.i}\nfunction jg(a,b){var c=C(b.uris,a.A);if(b.X||null!=b.M)c.headers.Range=\"bytes=\"+b.X+\"-\"+(null==b.M?\"\":b.M);var d;return a.v.request(1,c).then(function(a){if(!this.a)return Promise.reject(new t(2,9,9002));d=a.data.byteLength;this.l.push(b.Hb.key);b.Hb.data=a.data;return Wf(this.j,\"segment\",b.Hb)}.bind(a)).then(function(){if(!this.a)return Promise.reject(new t(2,9,9002));null==b.M?(this.a.size+=d,this.f+=b.Rb):this.h+=d;var a=(this.h+this.f)/(this.c+this.g),c=$f(this.a);this.o.progressCallback(c,a)}.bind(a))}\n;function kg(){this.a=-1}k=kg.prototype;k.configure=function(){};k.start=function(a){var b=/^offline:([0-9]+)$/.exec(a);if(!b)return Promise.reject(new t(2,1,9004,a));var c=Number(b[1]),d=fg();this.a=c;return d?d.init(Zf).then(function(){return d.get(\"manifest\",c)}).then(function(a){if(!a)throw new t(2,9,9003,c);return lg(a)}).then(function(a){return d.m().then(function(){return a})},function(a){return d.m().then(function(){throw a;})}):Promise.reject(new t(2,9,9E3))};k.stop=function(){return Promise.resolve()};\nk.update=function(){};k.onExpirationUpdated=function(a,b){var c=fg();c.init(Zf).then(function(){return c.get(\"manifest\",this.a)}.bind(this)).then(function(d){if(d&&!(0>d.sessionIds.indexOf(a))&&(void 0==d.expiration||d.expiration>b))return d.expiration=b,Wf(c,\"manifest\",d)})[\"catch\"](function(){}).then(function(){return c.m()})};\nfunction lg(a){var b=new T(null,0);b.pa(a.duration);var c=a.drmInfo?[a.drmInfo]:[];return{presentationTimeline:b,minBufferTime:10,offlineSessionIds:a.sessionIds,periods:a.periods.map(function(a){return ag(a,c,b)})}}Dd[\"application/x-offline-manifest\"]=kg;function mg(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=fg();return d?d.init(Zf).then(function(){return d.get(\"segment\",c)}).then(function(b){return d.m().then(function(){if(!b)throw new t(2,9,9003,c);return{uri:a,data:b.data,headers:{}}})}):Promise.reject(new t(2,9,9E3))}return Promise.reject(new t(2,1,9004,a))}\nn(\"shaka.offline.OfflineScheme\",mg);Ea.offline=mg;function ng(){this.a=Promise.resolve();this.b=this.c=this.f=!1;this.i=new Promise(function(a){this.g=a}.bind(this))}ng.prototype.then=function(a){this.a=this.a.then(a).then(function(a){return this.b?(this.g(),Promise.reject(this.h)):Promise.resolve(a)}.bind(this));return this};function og(a){a.f||(a.a=a.a.then(function(a){this.c=!0;return Promise.resolve(a)}.bind(a),function(a){this.c=!0;return this.b?(this.g(),Promise.reject(this.h)):Promise.reject(a)}.bind(a)));a.f=!0;return a.a}\nng.prototype.cancel=function(a){if(this.c)return Promise.resolve();this.b=!0;this.h=a;return this.i};function W(a,b){p.call(this);this.O=!1;this.f=a;this.A=null;this.l=new D;this.Qb=new H;this.Ya=this.c=this.h=this.a=this.v=this.g=this.Wa=this.ja=this.N=this.j=this.o=null;this.Dc=1E9;this.Va=[];this.ka=!1;this.Za=!0;this.la=this.J=null;this.G={};this.Xa=[];this.B={};this.b=pg(this);this.ob={width:Infinity,height:Infinity};this.i=qg();this.Ua=0;this.ia=this.b.preferredAudioLanguage;this.Ca=this.b.preferredTextLanguage;this.lb=this.mb=\"\";b&&b(this);this.o=new B(this.de.bind(this));this.Wa=rg(this);\nfor(var c=0;c<this.f.textTracks.length;++c){var d=this.f.textTracks[c];d.mode=\"disabled\";\"Shaka Player TextTrack\"==d.label&&(this.A=d)}this.A||(this.A=this.f.addTextTrack(\"subtitles\",\"Shaka Player TextTrack\"));this.A.mode=\"hidden\";E(this.l,this.f,\"error\",this.yd.bind(this))}ba(W);n(\"shaka.Player\",W);\nW.prototype.m=function(){this.O=!0;var a=Promise.resolve();this.J&&(a=this.J.cancel(new t(2,7,7E3)));return a.then(function(){var a=Promise.all([this.la,sg(this),this.l?this.l.m():null,this.o?this.o.m():null]);this.b=this.o=this.Qb=this.l=this.A=this.f=null;return a}.bind(this))};W.prototype.destroy=W.prototype.m;W.version=\"v2.1.4\";var tg={};W.registerSupportPlugin=function(a,b){tg[a]=b};\nW.isBrowserSupported=function(){return!!window.Promise&&!!window.Uint8Array&&!!Array.prototype.forEach&&!!window.MediaSource&&!!window.MediaSource.isTypeSupported&&!!window.MediaKeys&&!!window.navigator&&!!window.navigator.requestMediaKeySystemAccess&&!!window.MediaKeySystemAccess&&!!window.MediaKeySystemAccess.prototype.getConfiguration};W.probeSupport=function(){return qb().then(function(a){var b=Fd(),c=Eb();a={manifest:b,media:c,drm:a};for(var d in tg)a[d]=tg[d]();return a})};\nW.prototype.load=function(a,b,c){var d=this.hb(),e=new ng;this.J=e;this.dispatchEvent(new I(\"loading\"));var f=Date.now();return og(e.then(function(){return d}).then(function(){this.i=qg();E(this.l,this.f,\"playing\",this.Sa.bind(this));E(this.l,this.f,\"pause\",this.Sa.bind(this));E(this.l,this.f,\"ended\",this.Sa.bind(this));return Gd(a,this.o,this.b.manifest.retryParameters,c)}.bind(this)).then(function(b){this.h=new b;this.h.configure(this.b.manifest);b={networkingEngine:this.o,filterPeriod:this.fb.bind(this),\nonTimelineRegionAdded:this.xd.bind(this),onEvent:this.gb.bind(this),onError:this.ya.bind(this)};return 2<this.h.start.length?this.h.start(a,this.o,b.filterPeriod,b.onError,b.onEvent):this.h.start(a,b)}.bind(this)).then(function(b){if(0==b.periods.length)throw new t(2,4,4014);this.c=b;this.Ya=a;this.j=new bb(this.o,this.ya.bind(this),this.be.bind(this),this.ae.bind(this));this.j.configure(this.b.drm);return this.j.init(b,!1)}.bind(this)).then(function(){this.c.periods.forEach(this.fb.bind(this));this.Ua=\nDate.now()/1E3;this.ia=this.b.preferredAudioLanguage;this.Ca=this.b.preferredTextLanguage;return Promise.all([eb(this.j,this.f),this.Wa])}.bind(this)).then(function(){this.b.abr.manager.init(this.Lb.bind(this));this.g=new ff(this.f,this.c,this.b.streaming,b||null,this.ce.bind(this),this.gb.bind(this));this.v=new of(this.f,this.c,this.b.streaming,this.zc.bind(this),this.gb.bind(this),this.$d.bind(this));this.ja=new Db(this.f,this.N,this.A);this.a=new sf(this.c,{Oa:this.g,K:this.ja,dd:this.o,bc:this.ed.bind(this),\nac:this.Gc.bind(this),onError:this.ya.bind(this),onEvent:this.gb.bind(this),kd:this.ld.bind(this),Ab:this.ud.bind(this)});this.a.configure(this.b.streaming);ug(this);return this.a.init()}.bind(this)).then(function(){if(this.b.streaming.startAtSegmentBoundary){var a=vg(this,jf(this.g));gf(this.g,a)}this.c.periods.forEach(this.fb.bind(this));wg(this);xg(this);var a=V(this.a),b=dc(a,this.ia);this.b.abr.manager.setVariants(b);a.variants.some(function(a){return a.primary});this.Xa.forEach(this.v.v.bind(this.v));\nthis.Xa=[];La(this.l,this.f,\"loadeddata\",function(){this.i.loadLatency=(Date.now()-f)/1E3}.bind(this));this.J=null}.bind(this)))[\"catch\"](function(a){this.J==e&&(this.J=null,this.dispatchEvent(new I(\"unloading\")));return Promise.reject(a)}.bind(this))};W.prototype.load=W.prototype.load;\nfunction ug(a){function b(a){return(a.video?a.video.codecs.split(\".\")[0]:\"\")+\"-\"+(a.audio?a.audio.codecs.split(\".\")[0]:\"\")}var c={};a.c.periods.forEach(function(a){a.variants.forEach(function(a){var d=b(a);d in c||(c[d]=[]);c[d].push(a)})});var d=null,e=Infinity;Qa(c,function(a,b){var c=0,f=0;b.forEach(function(a){c+=a.bandwidth;++f});var g=c/f;g<e&&(d=a,e=g)});a.c.periods.forEach(function(a){a.variants=a.variants.filter(function(a){return b(a)==d?!0:!1})})}\nfunction rg(a){a.N=new MediaSource;var b=new A;E(a.l,a.N,\"sourceopen\",b.resolve);a.f.src=window.URL.createObjectURL(a.N);return b}W.prototype.configure=function(a){a.abr&&a.abr.manager&&a.abr.manager!=this.b.abr.manager&&(this.b.abr.manager.stop(),a.abr.manager.init(this.Lb.bind(this)));Ca(this.b,a,pg(this),yg(),\"\");zg(this)};W.prototype.configure=W.prototype.configure;\nfunction zg(a){a.h&&a.h.configure(a.b.manifest);a.j&&a.j.configure(a.b.drm);if(a.a){a.a.configure(a.b.streaming);try{a.c.periods.forEach(a.fb.bind(a))}catch(b){a.ya(b)}Ag(a,V(a.a))}a.b.abr.enabled&&!a.Za?a.b.abr.manager.enable():a.b.abr.manager.disable();a.b.abr.manager.setDefaultEstimate(a.b.abr.defaultBandwidthEstimate);a.b.abr.manager.setRestrictions(a.b.abr.restrictions)}W.prototype.getConfiguration=function(){var a=pg(this);Ca(a,this.b,pg(this),yg(),\"\");return a};\nW.prototype.getConfiguration=W.prototype.getConfiguration;W.prototype.Rd=function(){var a=pg(this);a.abr&&a.abr.manager&&a.abr.manager!=this.b.abr.manager&&(this.b.abr.manager.stop(),a.abr.manager.init(this.Lb.bind(this)));this.b=pg(this);zg(this)};W.prototype.resetConfiguration=W.prototype.Rd;W.prototype.Sc=function(){return this.f};W.prototype.getMediaElement=W.prototype.Sc;W.prototype.Wb=function(){return this.o};W.prototype.getNetworkingEngine=W.prototype.Wb;W.prototype.Rc=function(){return this.Ya};\nW.prototype.getManifestUri=W.prototype.Rc;W.prototype.$=function(){return this.c?this.c.presentationTimeline.$():!1};W.prototype.isLive=W.prototype.$;W.prototype.va=function(){return this.c?this.c.presentationTimeline.va():!1};W.prototype.isInProgress=W.prototype.va;W.prototype.Td=function(){var a=0,b=0;this.c&&(b=this.c.presentationTimeline,a=b.ma(),b=b.bb());return{start:a,end:b}};W.prototype.seekRange=W.prototype.Td;W.prototype.keySystem=function(){return this.j?this.j.keySystem():\"\"};\nW.prototype.keySystem=W.prototype.keySystem;W.prototype.drmInfo=function(){return this.j?this.j.b:null};W.prototype.drmInfo=W.prototype.drmInfo;W.prototype.ab=function(){return this.j?this.j.ab():Infinity};W.prototype.getExpiration=W.prototype.ab;W.prototype.$c=function(){return this.ka};W.prototype.isBuffering=W.prototype.$c;\nW.prototype.hb=function(){if(this.O)return Promise.resolve();this.dispatchEvent(new I(\"unloading\"));var a=Promise.resolve();this.J&&(a=this.J.cancel(new t(2,7,7E3)));return a.then(function(){this.la||(this.la=Bg(this).then(function(){this.la=null}.bind(this)));return this.la}.bind(this))};W.prototype.unload=W.prototype.hb;W.prototype.rb=function(){return this.g?this.g.rb():0};W.prototype.getPlaybackRate=W.prototype.rb;W.prototype.ne=function(a){this.g&&lf(this.g,a);this.a&&xf(this.a,1!=a)};\nW.prototype.trickPlay=W.prototype.ne;W.prototype.Hc=function(){this.g&&lf(this.g,1);this.a&&xf(this.a,!1)};W.prototype.cancelTrickPlay=W.prototype.Hc;W.prototype.getTracks=function(){return this.Yb().concat(this.Xb())};W.prototype.getTracks=W.prototype.getTracks;W.prototype.Wd=function(a,b){\"text\"==a.type?this.tc(a):(this.configure({abr:{enabled:!1}}),this.uc(a,b))};W.prototype.selectTrack=W.prototype.Wd;\nW.prototype.Yb=function(){if(!this.c)return[];var a=hc(this.c,jf(this.g)),b=this.B[a]||{};return Zb(this.c.periods[a],b.audio,b.video)};W.prototype.getVariantTracks=W.prototype.Yb;W.prototype.Xb=function(){if(!this.c)return[];var a=hc(this.c,jf(this.g));return ac(this.c.periods[a],(this.B[a]||{}).text).filter(function(a){return 0>this.Va.indexOf(a.id)}.bind(this))};W.prototype.getTextTracks=W.prototype.Xb;\nW.prototype.tc=function(a){if(this.a&&(a=cc(V(this.a),a))){Cg(this,a,!1);var b={};b.text=a;Dg(this,b,!0)}};W.prototype.selectTextTrack=W.prototype.tc;\nW.prototype.uc=function(a,b){if(this.a){var c={},d=bc(V(this.a),a),e=vf(this.a);if(d){if(!d.allowedByApplication||!d.allowedByKeySystem)return;d.audio&&(Eg(this,d.audio),d.audio!=e.audio&&(c.audio=d.audio));d.video&&(Eg(this,d.video),d.video!=e.video&&(c.video=d.video))}Na(c).forEach(function(a){Cg(this,a,!1)}.bind(this));(d=e.text)&&(c.text=d);Dg(this,c,b)}};W.prototype.selectVariantTrack=W.prototype.uc;\nW.prototype.Pc=function(){return this.a?$b(V(this.a).variants).map(function(a){return a.language}).filter(Aa):[]};W.prototype.getAudioLanguages=W.prototype.Pc;W.prototype.Yc=function(){return this.a?V(this.a).textStreams.map(function(a){return a.language}).filter(Aa):[]};W.prototype.getTextLanguages=W.prototype.Yc;W.prototype.Ud=function(a,b){if(this.a){var c=V(this.a);this.ia=a;this.mb=b||\"\";Ag(this,c)}};W.prototype.selectAudioLanguage=W.prototype.Ud;\nW.prototype.Vd=function(a,b){if(this.a){var c=V(this.a);this.Ca=a;this.lb=b||\"\";Ag(this,c)}};W.prototype.selectTextLanguage=W.prototype.Vd;W.prototype.bd=function(){return\"showing\"==this.A.mode};W.prototype.isTextTrackVisible=W.prototype.bd;W.prototype.Yd=function(a){this.A.mode=a?\"showing\":\"hidden\";Fg(this)};W.prototype.setTextTrackVisibility=W.prototype.Yd;W.prototype.Uc=function(){return this.c?new Date(1E3*this.c.presentationTimeline.f+1E3*this.f.currentTime):null};\nW.prototype.getPlayheadTimeAsDate=W.prototype.Uc;\nW.prototype.getStats=function(){Gg(this);this.Sa();var a=null,b=null,c=this.f&&this.f.getVideoPlaybackQuality?this.f.getVideoPlaybackQuality():{};this.g&&this.c&&(a=hc(this.c,jf(this.g)),b=this.B[a],b=gc(b.audio,b.video,this.c.periods[a].variants),a=b.video||{});a||(a={});b||(b={});return{width:a.width||0,height:a.height||0,streamBandwidth:b.bandwidth||0,decodedFrames:Number(c.totalVideoFrames),droppedFrames:Number(c.droppedVideoFrames),estimatedBandwidth:this.b.abr.manager.getBandwidthEstimate(),loadLatency:this.i.loadLatency,\nplayTime:this.i.playTime,bufferingTime:this.i.bufferingTime,switchHistory:Da(this.i.switchHistory),stateHistory:Da(this.i.stateHistory)}};W.prototype.getStats=W.prototype.getStats;\nW.prototype.addTextTrack=function(a,b,c,d,e,f){if(!this.a)return Promise.reject();for(var g=V(this.a),h,l=0;l<this.c.periods.length;l++)if(this.c.periods[l]==g){if(l==this.c.periods.length-1){if(h=this.c.presentationTimeline.Y()-g.startTime,Infinity==h)return Promise.reject()}else h=this.c.periods[l+1].startTime-g.startTime;break}var m={id:this.Dc++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(b){return 1!=b?null:new O(1,0,\nh,function(){return[a]},0,null)},initSegmentReference:null,presentationTimeOffset:0,mimeType:d,codecs:e||\"\",kind:c,encrypted:!1,keyId:null,language:b,label:f||null,type:\"text\",primary:!1,trickModeVideo:null,containsEmsgBoxes:!1,roles:[]};this.Va.push(m.id);g.textStreams.push(m);return wf(this.a,m).then(function(){if(!this.O){var a=this.c.periods.indexOf(g),d=vf(this.a);d.text&&(this.B[a].text=d.text.id);this.Va.splice(this.Va.indexOf(m.id),1);Ag(this,g);wg(this);return{id:m.id,active:!1,type:\"text\",\nbandwidth:0,language:b,label:f||null,kind:c,width:null,height:null}}}.bind(this))};W.prototype.addTextTrack=W.prototype.addTextTrack;W.prototype.Jb=function(a,b){this.ob.width=a;this.ob.height=b};W.prototype.setMaxHardwareResolution=W.prototype.Jb;function Cg(a,b,c){a.i.switchHistory.push({timestamp:Date.now()/1E3,id:b.id,type:b.type,fromAdaptation:c});Eg(a,b)}function Eg(a,b){var c=ic(a.c,b);a.B[c]||(a.B[c]={});a.B[c][b.type]=b.id}\nfunction sg(a){a.l&&(a.l.ha(a.N,\"sourceopen\"),a.l.ha(a.f,\"loadeddata\"),a.l.ha(a.f,\"playing\"),a.l.ha(a.f,\"pause\"),a.l.ha(a.f,\"ended\"));a.f&&(a.f.removeAttribute(\"src\"),a.f.load());var b=Promise.all([a.b?a.b.abr.manager.stop():null,a.j?a.j.m():null,a.ja?a.ja.m():null,a.g?a.g.m():null,a.v?a.v.m():null,a.a?a.a.m():null,a.h?a.h.stop():null]);a.j=null;a.ja=null;a.g=null;a.v=null;a.a=null;a.h=null;a.c=null;a.Ya=null;a.Wa=null;a.N=null;a.Xa=[];a.B={};a.G={};a.i=qg();return b}\nfunction Bg(a){return a.h?sg(a).then(function(){this.O||(this.zc(!1),this.Wa=rg(this))}.bind(a)):Promise.resolve()}function yg(){return{\".drm.servers\":\"\",\".drm.clearKeys\":\"\",\".drm.advanced\":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:\"\",audioRobustness:\"\",serverCertificate:null}}}\nfunction pg(a){return{drm:{retryParameters:Fa(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1},manifest:{retryParameters:Fa(),dash:{customScheme:function(a){if(a)return null},clockSyncUri:\"\",ignoreDrmInfo:!1},hls:{defaultTimeOffset:0}},streaming:{retryParameters:Fa(),infiniteRetriesForLiveStreams:!0,rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1},abr:{manager:a.Qb,enabled:!0,defaultBandwidthEstimate:5E5,\nrestrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minBandwidth:0,maxBandwidth:Infinity}},preferredAudioLanguage:\"\",preferredTextLanguage:\"\",restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minBandwidth:0,maxBandwidth:Infinity}}}\nfunction qg(){return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:0,bufferingTime:0,switchHistory:[],stateHistory:[]}}k=W.prototype;k.fb=function(a){var b=this.a?vf(this.a):{};Wb(this.j,b,a);b=0<$b(a.variants).length;Vb(a,this.b.restrictions,this.ob)&&this.a&&V(this.a)==a&&wg(this);a=1>$b(a.variants).length;if(!b)throw new t(2,4,4011);if(a)throw new t(2,4,4012);};\nfunction Dg(a,b,c){for(var d in b){var e=b[d],f=c||!1;\"text\"==d&&(f=!0);a.Za?a.G[d]={stream:e,Kc:f}:yf(a.a,d,e,f)}}function Gg(a){if(a.c){var b=Date.now()/1E3;a.ka?a.i.bufferingTime+=b-a.Ua:a.i.playTime+=b-a.Ua;a.Ua=b}}\nfunction vg(a,b){function c(a,b){if(!a)return null;var c=a.findSegmentPosition(b-e.startTime);return null==c?null:(c=a.getSegmentReference(c))?c.startTime+e.startTime:null}var d=vf(a.a),e=V(a.a),f=c(d.video,b),d=c(d.audio,b);return null!=f&&null!=d?Math.max(f,d):null!=f?f:null!=d?d:b}k.de=function(a,b){this.b.abr.manager.segmentDownloaded(a,b)};k.zc=function(a){Gg(this);this.ka=a;this.Sa();if(this.g){var b=this.g;a!=b.h&&(b.h=a,lf(b,b.g))}this.dispatchEvent(new I(\"buffering\",{buffering:a}))};\nk.$d=function(){wg(this)};k.Sa=function(){if(!this.O){var a=this.ka?\"buffering\":this.f.ended?\"ended\":this.f.paused?\"paused\":\"playing\";var b=Date.now()/1E3;if(this.i.stateHistory.length){var c=this.i.stateHistory[this.i.stateHistory.length-1];c.duration=b-c.timestamp;if(a==c.state)return}this.i.stateHistory.push({timestamp:b,state:a,duration:0})}};k.ce=function(){if(this.v){var a=this.v;a.c.forEach(a.o.bind(a,!0))}this.a&&Bf(this.a)};\nfunction Hg(a,b,c,d,e){if(!c||1>c.length)return a.ya(new t(2,4,4012)),{};a.b.abr.manager.setVariants(c);a.b.abr.manager.setTextStreams(d);var f=[];e&&(f=[\"video\",\"audio\"],b.textStreams.length&&f.push(\"text\"));e=vf(a.a);var g=a.a;var h=g.c.video||g.c.audio;g=h?g.b.periods[h.wa]:null;if(b=fc(e.audio,e.video,g?g.variants:b.variants)){b.allowedByApplication&&b.allowedByKeySystem||(f.push(\"audio\"),f.push(\"video\"));for(var l in e)b=e[l],\"audio\"==b.type&&b.language!=c[0].language?f.push(l):\"text\"==b.type&&\n0<d.length&&b.language!=d[0].language&&f.push(l)}f=f.filter(Aa);if(0<f.length){c={};try{c=a.b.abr.manager.chooseStreams(f)}catch(m){a.ya(m)}return c}return{}}function Ag(a,b){var c={audio:!1,text:!1},d=dc(b,a.ia,c,a.mb),e=ec(b,a.Ca,c,a.lb),d=Hg(a,b,d,e),f;for(f in d)Cg(a,d[f],!0);Dg(a,d,!0);xg(a);d.text&&d.audio&&c.text&&d.text.language!=d.audio.language&&(a.A.mode=\"showing\",Fg(a))}\nk.ed=function(a){this.Za=!0;this.b.abr.manager.disable();var b=dc(a,this.ia,void 0,this.mb),c=ec(a,this.Ca,void 0,this.lb);a=Hg(this,a,b,c,!0);for(var d in this.G)a[d]=this.G[d].stream;this.G={};for(d in a)Cg(this,a[d],!0);return a};k.Gc=function(){this.Za=!1;this.b.abr.enabled&&this.b.abr.manager.enable();for(var a in this.G){var b=this.G[a];yf(this.a,a,b.stream,b.Kc)}this.G={}};k.ld=function(){this.h&&this.h.update&&this.h.update()};k.ud=function(){this.g&&this.g.Ab()};\nk.Lb=function(a,b){var c=vf(this.a),d;for(d in a){var e=a[d];c[d]!=e?Cg(this,e,!0):delete a[d]}if(!Ma(a)&&this.a){for(d in a)yf(this.a,d,a[d],b||!1);xg(this)}};function xg(a){Promise.resolve().then(function(){this.O||this.dispatchEvent(new I(\"adaptation\"))}.bind(a))}function wg(a){Promise.resolve().then(function(){this.O||this.dispatchEvent(new I(\"trackschanged\"))}.bind(a))}function Fg(a){a.dispatchEvent(new I(\"texttrackvisibility\"))}k.ya=function(a){this.O||this.dispatchEvent(new I(\"error\",{detail:a}))};\nk.xd=function(a){this.v?this.v.v(a):this.Xa.push(a)};k.gb=function(a){this.dispatchEvent(a)};k.yd=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.ya(new t(2,3,3016,a,b))}}};\nk.be=function(a){var b=[\"output-restricted\",\"internal-error\"],c=V(this.a),d=!1;c.variants.forEach(function(c){var e=[];c.audio&&e.push(c.audio);c.video&&e.push(c.video);e.forEach(function(e){var f=c.allowedByKeySystem;e.keyId&&(e=a[e.keyId],c.allowedByKeySystem=!!e&&0>b.indexOf(e));f!=c.allowedByKeySystem&&(d=!0)})});var e=vf(this.a);(e=fc(e.audio,e.video,c.variants))&&!e.allowedByKeySystem&&Ag(this,c);d&&wg(this)};\nk.ae=function(a,b){if(this.h&&this.h.onExpirationUpdated)this.h.onExpirationUpdated(a,b);this.dispatchEvent(new I(\"expirationupdated\"))};function X(a){if(!a||a.constructor!=W)throw new t(2,9,9008);this.a=fg();this.f=a;this.i=Ig(this);this.b=null;this.v=!1;this.j=null;this.g=-1;this.l=0;this.c=null;this.h=new gg(this.a,a.o,a.getConfiguration().streaming.retryParameters,this.i)}n(\"shaka.offline.Storage\",X);function Jg(){return!!window.indexedDB}X.support=Jg;X.prototype.m=function(){var a=this.a,b=this.h?this.h.m()[\"catch\"](function(){}).then(function(){if(a)return a.m()}):Promise.resolve();this.i=this.f=this.h=this.a=null;return b};\nX.prototype.destroy=X.prototype.m;X.prototype.configure=function(a){Ca(this.i,a,Ig(this),{},\"\")};X.prototype.configure=X.prototype.configure;\nX.prototype.le=function(a,b,c){function d(a){f=a}if(this.v)return Promise.reject(new t(2,9,9006));this.v=!0;var e,f=null;return Kg(this).then(function(){Y(this);return Lg(this,a,d,c)}.bind(this)).then(function(c){Y(this);this.c=c.manifest;this.b=c.Lc;if(this.c.presentationTimeline.$()||this.c.presentationTimeline.va())throw new t(2,9,9005,a);this.c.periods.forEach(this.o.bind(this));this.g=this.a.c.manifest++;this.l=0;c=this.c.periods.map(this.B.bind(this));var d=this.b.b,f=jb(this.b);if(d){if(!f.length)throw new t(2,\n9,9007,a);d.initData=[]}e={key:this.g,originalManifestUri:a,duration:this.l,size:0,expiration:this.b.ab(),periods:c,sessionIds:f,drmInfo:d,appMetadata:b};return ig(this.h,e)}.bind(this)).then(function(){Y(this);if(f)throw f;return Mg(this)}.bind(this)).then(function(){return $f(e)}.bind(this))[\"catch\"](function(a){return Mg(this)[\"catch\"](y).then(function(){throw a;})}.bind(this))};X.prototype.store=X.prototype.le;\nX.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 t(2,9,9004,c));var e=null,f,g,h=Number(d[1]);return Kg(this).then(function(){Y(this);return this.a.get(\"manifest\",h)}.bind(this)).then(function(a){Y(this);if(!a)throw new t(2,9,9003,c);f=a;a=lg(f);g=new bb(this.f.o,b,function(){},function(){});g.configure(this.f.getConfiguration().drm);return g.init(a,!0)}.bind(this)).then(function(){return gb(g,f.sessionIds)}.bind(this)).then(function(){return g.m()}.bind(this)).then(function(){Y(this);\nif(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(x,[])}).reduce(x,[]),c=0,d=b.length,g=this.i.progressCallback;return Xf(this.a,b,function(){c++;g(a,c/d)})}.bind(this)).then(function(){Y(this);this.i.progressCallback(a,1);return this.a.remove(\"manifest\",\nh)}.bind(this))};X.prototype.remove=X.prototype.remove;X.prototype.list=function(){var a=[];return Kg(this).then(function(){Y(this);return this.a.forEach(\"manifest\",function(b){a.push($f(b))})}.bind(this)).then(function(){return a})};X.prototype.list=X.prototype.list;\nfunction Lg(a,b,c,d){function e(){}var f=a.f.o,g=a.f.getConfiguration(),h,l,m;return Gd(b,f,g.manifest.retryParameters,d).then(function(a){Y(this);m=new a;m.configure(g.manifest);return m.start(b,{networkingEngine:f,filterPeriod:this.o.bind(this),onTimelineRegionAdded:function(){},onEvent:function(){},onError:c})}.bind(a)).then(function(a){Y(this);h=a;l=new bb(f,c,e,function(){});l.configure(g.drm);return l.init(h,!0)}.bind(a)).then(function(){Y(this);return Ng(h)}.bind(a)).then(function(){Y(this);\nreturn fb(l)}.bind(a)).then(function(){Y(this);return m.stop()}.bind(a)).then(function(){Y(this);return{manifest:h,Lc:l}}.bind(a))[\"catch\"](function(a){if(m)return m.stop().then(function(){throw a;});throw a;})}\nX.prototype.A=function(a){for(var b=[],c=Sb(this.f.getConfiguration().preferredAudioLanguage),d=[0,Qb,Rb],e=a.filter(function(a){return\"variant\"==a.type}),d=d.map(function(a){return e.filter(function(b){b=Sb(b.language);return Pb(a,c,b)})}),f,g=0;g<d.length;g++)if(d[g].length){f=d[g];break}f||(d=e.filter(function(a){return a.primary}),d.length&&(f=d));f||(f=e,e.map(function(a){return a.language}).filter(Aa));var h=f.filter(function(a){return a.height&&480>=a.height});h.length&&(h.sort(function(a,\nb){return b.height-a.height}),f=h.filter(function(a){return a.height==h[0].height}));f.sort(function(a,b){return a.bandwidth-b.bandwidth});f.length&&b.push(f[Math.floor(f.length/2)]);b.push.apply(b,a.filter(function(a){return\"text\"==a.type}));return b};function Ig(a){return{trackSelectionCallback:a.A.bind(a),progressCallback:function(a,c){if(a||c)return null}}}function Kg(a){return a.a?a.a.a?Promise.resolve():a.a.init(Zf):Promise.reject(new t(2,9,9E3))}\nX.prototype.o=function(a){var b={};if(this.j){var c=this.j.filter(function(a){return\"variant\"==a.type}),d=null;c.length&&(d=bc(a,c[0]));d&&(d.video&&(b.video=d.video),d.audio&&(b.audio=d.audio))}Wb(this.b,b,a);Vb(a,this.f.getConfiguration().restrictions,{width:Infinity,height:Infinity})};function Mg(a){var b=a.b?a.b.m():Promise.resolve();a.b=null;a.c=null;a.v=!1;a.j=null;a.g=-1;return b}\nfunction Ng(a){var b=a.periods.map(function(a){return a.variants}).reduce(x,[]).map(function(a){var b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);return b}).reduce(x,[]).filter(Aa);a=a.periods.map(function(a){return a.textStreams}).reduce(x,[]);b.push.apply(b,a);return Promise.all(b.map(function(a){return a.createSegmentIndex()}))}\nX.prototype.B=function(a){var b,c,d=Zb(a,null,null),e=ac(a,null),d=this.i.trackSelectionCallback(d.concat(e));this.j||(this.j=d,this.c.periods.forEach(this.o.bind(this)));for(e=d.length-1;0<e;--e){var f=!1;for(c=e-1;0<=c;--c)if(d[e].type==d[c].type&&d[e].kind==d[c].kind&&d[e].language==d[c].language){f=!0;break}if(f)break}f=[];for(e=0;e<d.length;e++)(b=bc(a,d[e]))?(b.audio&&((c=f.filter(function(a){return a.id==b.audio.id})[0])?c.variantIds.push(b.id):(c=b.video?b.bandwidth/2:b.bandwidth,f.push(Og(this,\na,b.audio,c,b.id)))),b.video&&((c=f.filter(function(a){return a.id==b.video.id})[0])?c.variantIds.push(b.id):(c=b.audio?b.bandwidth/2:b.bandwidth,f.push(Og(this,a,b.video,c,b.id))))):f.push(Og(this,a,cc(a,d[e]),0));return{startTime:a.startTime,streams:f}};\nfunction Og(a,b,c,d,e){var f=[],g=a.c.presentationTimeline.ma();var h=g;for(var l=c.findSegmentPosition(g),m=null!=l?c.getSegmentReference(l):null;m;)h=a.a.c.segment++,hg(a.h,c.type,m,(m.endTime-m.startTime)*d/8,{key:h,data:null,manifestKey:a.g,streamNumber:c.id,segmentNumber:h}),f.push({startTime:m.startTime,endTime:m.endTime,uri:\"offline:\"+a.g+\"/\"+c.id+\"/\"+h}),h=m.endTime+b.startTime,m=c.getSegmentReference(++l);a.l=Math.max(a.l,h-g);b=null;c.initSegmentReference&&(h=a.a.c.segment++,b=\"offline:\"+\na.g+\"/\"+c.id+\"/\"+h,hg(a.h,c.contentType,c.initSegmentReference,0,{key:h,data:null,manifestKey:a.g,streamNumber:c.id,segmentNumber:-1}));a=[];null!=e&&a.push(e);return{id:c.id,primary:c.primary,presentationTimeOffset:c.presentationTimeOffset||0,contentType:c.type,mimeType:c.mimeType,codecs:c.codecs,frameRate:c.frameRate,kind:c.kind,language:c.language,label:c.label,width:c.width||null,height:c.height||null,initSegmentUri:b,encrypted:c.encrypted,keyId:c.keyId,segments:f,variantIds:a}}\nfunction Y(a){if(!a.f)throw new t(2,9,9002);}tg.offline=Jg;n(\"shaka.polyfill.installAll\",function(){for(var a=0;a<Pg.length;++a)Pg[a]()});var Pg=[];function Qg(a){Pg.push(a)}n(\"shaka.polyfill.register\",Qg);function Rg(a){var b=a.type.replace(/^(webkit|moz|MS)/,\"\").toLowerCase();if(\"function\"===typeof Event)var c=new Event(b,a);else c=document.createEvent(\"Event\"),c.initEvent(b,a.bubbles,a.cancelable);a.target.dispatchEvent(c)}\nQg(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(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,\n\"fullscreenEnabled\",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}}));document.addEventListener(\"webkitfullscreenchange\",Rg);document.addEventListener(\"webkitfullscreenerror\",Rg);document.addEventListener(\"mozfullscreenchange\",Rg);document.addEventListener(\"mozfullscreenerror\",Rg);document.addEventListener(\"MSFullscreenChange\",Rg);document.addEventListener(\"MSFullscreenError\",Rg)}});Qg(function(){var a=navigator.userAgent;a&&0<=a.indexOf(\"CrKey\")&&delete window.indexedDB});Qg(function(){if(4503599627370497!=Math.round(4503599627370497)){var a=Math.round;Math.round=function(b){var c=b;4503599627370496>=b&&(c=a(b));return c}}});function Sg(a){this.f=[];this.b=[];this.a=[];(new Q).da(\"pssh\",this.c.bind(this)).parse(a.buffer)}Sg.prototype.c=function(a){if(!(1<a.version)){var b=$a(a.s.Ka(16)),c=[];if(0<a.version)for(var d=a.s.D(),e=0;e<d;++e){var f=$a(a.s.Ka(16));c.push(f)}d=a.s.D();a.s.I(d);this.b.push.apply(this.b,c);this.f.push(b);this.a.push({start:a.start,end:a.start+a.size-1})}};function Tg(a,b){try{var c=new Ug(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}\nfunction Ug(a,b){this.keySystem=a;for(var c=!1,d=0;d<b.length;++d){var e=b[d];var 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){g=!0;var m=l.contentType.split(\";\")[0];MSMediaKeys.isTypeSupported(this.keySystem,m)&&(f.audioCapabilities.push(l),c=!0)}}if(e.videoCapabilities)for(h=\n0;h<e.videoCapabilities.length;++h)l=e.videoCapabilities[h],l.contentType&&(g=!0,m=l.contentType.split(\";\")[0],MSMediaKeys.isTypeSupported(this.keySystem,m)&&(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}}e=Error(\"Unsupported keySystem\");e.name=\"NotSupportedError\";e.code=DOMException.NOT_SUPPORTED_ERR;throw e;}\nUg.prototype.createMediaKeys=function(){var a=new Vg(this.keySystem);return Promise.resolve(a)};Ug.prototype.getConfiguration=function(){return this.a};function Wg(a){var b=this.mediaKeys;b&&b!=a&&Xg(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?Xg(a,this):Promise.resolve()}function Vg(a){this.a=new MSMediaKeys(a);this.b=new D}Vg.prototype.createSession=function(a){if(\"temporary\"!=(a||\"temporary\"))throw new TypeError(\"Session type \"+a+\" is unsupported on this platform.\");return new Yg(this.a)};\nVg.prototype.setServerCertificate=function(){return Promise.resolve(!1)};function Xg(a,b){function c(){b.msSetMediaKeys(d.a);b.removeEventListener(\"loadedmetadata\",c)}Ja(a.b);if(!b)return Promise.resolve();E(a.b,b,\"msneedkey\",Zg);var d=a;try{return 1<=b.readyState?b.msSetMediaKeys(a.a):b.addEventListener(\"loadedmetadata\",c),Promise.resolve()}catch(e){return Promise.reject(e)}}\nfunction Yg(a){p.call(this);this.c=null;this.g=a;this.b=this.a=null;this.f=new D;this.sessionId=\"\";this.expiration=NaN;this.closed=new A;this.keyStatuses=new $g}ba(Yg);k=Yg.prototype;k.generateRequest=function(a,b){this.a=new A;try{this.c=this.g.createSession(\"video/mp4\",new Uint8Array(b),null),E(this.f,this.c,\"mskeymessage\",this.pd.bind(this)),E(this.f,this.c,\"mskeyadded\",this.nd.bind(this)),E(this.f,this.c,\"mskeyerror\",this.od.bind(this)),ah(this,\"status-pending\")}catch(c){this.a.reject(c)}return this.a};\nk.load=function(){return Promise.reject(Error(\"MediaKeySession.load not yet supported\"))};k.update=function(a){this.b=new A;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(),Ja(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\"))};\nfunction Zg(a){var b=document.createEvent(\"CustomEvent\");b.initCustomEvent(\"encrypted\",!1,!1,null);b.initDataType=\"cenc\";var c=a.initData;if(c){var d=new Sg(c);if(1>=d.a.length)a=c;else{var e=[];for(a=0;a<d.a.length;a++)e.push(c.subarray(d.a[a].start,d.a[a].end+1));c=Ga(e,bh);for(a=d=0;a<c.length;a++)d+=c[a].length;d=new Uint8Array(d);for(a=e=0;a<c.length;a++)d.set(c[a],e),e+=c[a].length;a=d}}else a=c;b.initData=a;this.dispatchEvent(b)}function bh(a,b){return ab(a,b)}\nk.pd=function(a){this.a&&(this.a.resolve(),this.a=null);this.dispatchEvent(new I(\"message\",{messageType:void 0==this.keyStatuses.sb()?\"licenserequest\":\"licenserenewal\",message:a.message.buffer}))};k.nd=function(){this.a?(ah(this,\"usable\"),this.a.resolve(),this.a=null):this.b&&(ah(this,\"usable\"),this.b.resolve(),this.b=null)};\nk.od=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:ah(this,\"output-not-allowed\");default:ah(this,\"internal-error\")}};function ah(a,b){a.keyStatuses.Kb(b);a.dispatchEvent(new I(\"keystatuseschange\"))}function $g(){this.size=0;this.a=void 0}var ch;k=$g.prototype;\nk.Kb=function(a){this.size=void 0==a?0:1;this.a=a};k.sb=function(){return this.a};k.forEach=function(a){this.a&&a(this.a,ch)};k.get=function(a){if(this.has(a))return this.a};k.has=function(a){var b=ch;return this.a&&ab(new Uint8Array(a),new Uint8Array(b))?!0:!1};k.entries=function(){};k.keys=function(){};k.values=function(){};function dh(){return Promise.reject(Error(\"The key system specified is not supported.\"))}function eh(a){return a?Promise.reject(Error(\"MediaKeys not supported.\")):Promise.resolve()}function fh(){throw new TypeError(\"Illegal constructor.\");}fh.prototype.createSession=function(){};fh.prototype.setServerCertificate=function(){};function gh(){throw new TypeError(\"Illegal constructor.\");}gh.prototype.getConfiguration=function(){};gh.prototype.createMediaKeys=function(){};var hh=\"\";function ih(a){hh=a;jh=(new Uint8Array([0])).buffer;navigator.requestMediaKeySystemAccess=kh;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=lh;window.MediaKeys=mh;window.MediaKeySystemAccess=nh}function oh(a){var b=hh;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function kh(a,b){try{var c=new nh(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}\nfunction lh(a){var b=this.mediaKeys;b&&b!=a&&ph(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&ph(a,this);return Promise.resolve()}\nfunction nh(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;var e=document.getElementsByTagName(\"video\");var f=e.length?e[0]:document.createElement(\"video\");for(var g=0;g<b.length;++g){e=b[g];var h={audioCapabilities:[],videoCapabilities:[],persistentState:\"optional\",distinctiveIdentifier:\"optional\",initDataTypes:e.initDataTypes,sessionTypes:[\"temporary\"],label:e.label},l=!1;if(e.audioCapabilities)for(var m=0;m<e.audioCapabilities.length;++m){var q=\ne.audioCapabilities[m];if(q.contentType){var l=!0,r=q.contentType.split(\";\")[0];f.canPlayType(r,this.a)&&(h.audioCapabilities.push(q),d=!0)}}if(e.videoCapabilities)for(m=0;m<e.videoCapabilities.length;++m)q=e.videoCapabilities[m],q.contentType&&(l=!0,f.canPlayType(q.contentType,this.a)&&(h.videoCapabilities.push(q),d=!0));l||(d=f.canPlayType(\"video/mp4\",this.a)||f.canPlayType(\"video/webm\",this.a));\"required\"==e.persistentState&&(c?(h.persistentState=\"required\",h.sessionTypes=[\"persistent-license\"]):\nd=!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;}nh.prototype.createMediaKeys=function(){var a=new mh(this.a);return Promise.resolve(a)};nh.prototype.getConfiguration=function(){return this.b};function mh(a){this.g=a;this.b=null;this.a=new D;this.c=[];this.f={}}\nfunction ph(a,b){a.b=b;Ja(a.a);var c=hh;b&&(E(a.a,b,c+\"needkey\",a.Cd.bind(a)),E(a.a,b,c+\"keymessage\",a.Bd.bind(a)),E(a.a,b,c+\"keyadded\",a.zd.bind(a)),E(a.a,b,c+\"keyerror\",a.Ad.bind(a)))}k=mh.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 qh(a,this.g,b);this.c.push(b);return b};\nk.setServerCertificate=function(){return Promise.resolve(!1)};k.Cd=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.Bd=function(a){var b=rh(this,a.sessionId);b&&(a=new I(\"message\",{messageType:void 0==b.keyStatuses.sb()?\"licenserequest\":\"licenserenewal\",message:a.message}),b.b&&(b.b.resolve(),b.b=null),b.dispatchEvent(a))};\nk.zd=function(a){if(a=rh(this,a.sessionId))sh(a,\"usable\"),a.a&&a.a.resolve(),a.a=null};\nk.Ad=function(a){var b=rh(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?sh(b,\"output-restricted\"):1==c?sh(b,\"expired\"):sh(b,\"internal-error\"))}};\nfunction rh(a,b){var c=a.f[b];return c?c:(c=a.c.shift())?(c.sessionId=b,a.f[b]=c):null}function qh(a,b,c){p.call(this);this.f=a;this.h=!1;this.a=this.b=null;this.c=b;this.g=c;this.sessionId=\"\";this.expiration=NaN;this.closed=new A;this.keyStatuses=new th}ba(qh);\nfunction uh(a,b,c){if(a.h)return Promise.reject(Error(\"The session is already initialized.\"));a.h=!0;try{if(\"persistent-license\"==a.g)if(c)var d=new Uint8Array(Ua(\"LOAD_SESSION|\"+c));else{var e=Ua(\"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 A;var g=oh(\"generateKeyRequest\");try{a.f[g](a.c,d)}catch(h){if(\"InvalidStateError\"!=h.name)return a.b=null,Promise.reject(h);\nsetTimeout(function(){try{this.f[g](this.c,d)}catch(l){this.b.reject(l),this.b=null}}.bind(a),10)}return a.b}k=qh.prototype;\nk.Mb=function(a,b){if(this.a)this.a.then(this.Mb.bind(this,a,b))[\"catch\"](this.Mb.bind(this,a,b));else{this.a=a;if(\"webkit-org.w3.clearkey\"==this.c){var c=F(b);var 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=Ya(d.keys[0].k);d=Ya(d.keys[0].kid)}else c=new Uint8Array(b),d=null;var e=oh(\"addKey\");try{this.f[e](this.c,c,d,this.sessionId)}catch(f){this.a.reject(f),this.a=null}}};\nfunction sh(a,b){a.keyStatuses.Kb(b);a.dispatchEvent(new I(\"keystatuseschange\"))}k.generateRequest=function(a,b){return uh(this,b,null)};k.load=function(a){return\"persistent-license\"==this.g?uh(this,null,a):Promise.reject(Error(\"Not a persistent session.\"))};k.update=function(a){var b=new A;this.Mb(b,a);return b};\nk.close=function(){if(\"persistent-license\"!=this.g){if(!this.sessionId)return this.closed.reject(Error(\"The session is not callable.\")),this.closed;var a=oh(\"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 th(){this.size=0;this.a=void 0}var jh;k=th.prototype;k.Kb=function(a){this.size=void 0==a?0:1;this.a=a};\nk.sb=function(){return this.a};k.forEach=function(a){this.a&&a(this.a,jh)};k.get=function(a){if(this.has(a))return this.a};k.has=function(a){var b=jh;return this.a&&ab(new Uint8Array(a),new Uint8Array(b))?!0:!1};k.entries=function(){};k.keys=function(){};k.values=function(){};Qg(function(){!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(HTMLMediaElement.prototype.webkitGenerateKeyRequest?ih(\"webkit\"):HTMLMediaElement.prototype.generateKeyRequest?ih(\"\"):window.MSMediaKeys?(ch=(new Uint8Array([0])).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Wg,window.MediaKeys=Vg,window.MediaKeySystemAccess=Ug,navigator.requestMediaKeySystemAccess=\nTg):(navigator.requestMediaKeySystemAccess=dh,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=eh,window.MediaKeys=fh,window.MediaKeySystemAccess=gh))});function vh(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var b=a.apply(this,arguments);b.abort=function(){};return b}}\nfunction wh(){var a=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream=function(){for(var b,d=0,e=0;e<this.sourceBuffers.length;++e)b=this.sourceBuffers[e],b=b.buffered.end(b.buffered.length-1),d=Math.max(d,b);if(!isNaN(this.duration)&&d<this.duration)for(this.Zb=!0,e=0;e<this.sourceBuffers.length;++e)b=this.sourceBuffers[e],b.Tb=!1;return a.apply(this,arguments)};var b=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var a=b.apply(this,arguments);\na.N=this;a.addEventListener(\"updateend\",xh,!1);this.a||(this.addEventListener(\"sourceclose\",yh,!1),this.a=!0);return a}}function xh(a){var b=a.target,c=b.N;if(c.Zb){a.preventDefault();a.stopPropagation();a.stopImmediatePropagation();b.Tb=!0;for(a=0;a<c.sourceBuffers.length;++a)if(0==c.sourceBuffers[a].Tb)return;c.Zb=!1}}function yh(a){a=a.target;for(var b=0;b<a.sourceBuffers.length;++b)a.sourceBuffers[b].removeEventListener(\"updateend\",xh,!1);a.removeEventListener(\"sourceclose\",yh,!1)}\nQg(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\")?vh():0<=b.indexOf(\"Version/10\")&&(vh(),wh()))}});function Z(a){this.c=[];this.b=[];this.Aa=zh;if(a)try{a(this.fa.bind(this),this.a.bind(this))}catch(b){this.a(b)}}var zh=0;function Ah(a){var b=new Z;b.fa(void 0);return b.then(function(){return a})}function Bh(a){var b=new Z;b.a(a);return b}function Ch(a){function b(a,b,c){a.Aa==zh&&(e[b]=c,d++,d==e.length&&a.fa(e))}var c=new Z;if(!a.length)return c.fa([]),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}\nfunction Dh(a){for(var b=new Z,c=b.fa.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.Aa){case 1:Eh(this,c,a);break;case 2:Eh(this,c,b);break;case zh:this.c.push({L:c,pb:a}),this.b.push({L:c,pb:b})}return c};Z.prototype[\"catch\"]=function(a){return this.then(void 0,a)};\nZ.prototype.fa=function(a){if(this.Aa==zh){this.jb=a;this.Aa=1;for(a=0;a<this.c.length;++a)Eh(this,this.c[a].L,this.c[a].pb);this.c=[];this.b=[]}};Z.prototype.a=function(a){if(this.Aa==zh){this.jb=a;this.Aa=2;for(a=0;a<this.b.length;++a)Eh(this,this.b[a].L,this.b[a].pb);this.c=[];this.b=[]}};\nfunction Eh(a,b,c){Fh.push(function(){if(c&&\"function\"==typeof c){try{var a=c(this.jb)}catch(f){b.a(f);return}try{var 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.fa.bind(b),b.a.bind(b)):e?Gh(a,e,b):b.fa(a)}else 1==this.Aa?b.fa(this.jb):b.a(this.jb)}.bind(a));null==Hh&&(Hh=Ih(Jh))}\nfunction Gh(a,b,c){try{var d=!1;b.call(a,function(a){if(!d){d=!0;try{var b=a&&a.then}catch(g){c.a(g);return}b?Gh(a,b,c):c.fa(a)}},c.a.bind(c))}catch(e){c.a(e)}}function Jh(){for(;Fh.length;){null!=Hh&&(Kh(Hh),Hh=null);var a=Fh;Fh=[];for(var b=0;b<a.length;++b)a[b]()}}function Ih(){return 0}function Kh(){}var Hh=null,Fh=[];\nQg(function(a){window.setImmediate?(Ih=function(a){return window.setImmediate(a)},Kh=function(a){return window.clearImmediate(a)}):(Ih=function(a){return window.setTimeout(a,0)},Kh=function(a){return window.clearTimeout(a)});if(!window.Promise||a)window.Promise=Z,window.Promise.resolve=Ah,window.Promise.reject=Bh,window.Promise.all=Ch,window.Promise.race=Dh,window.Promise.prototype.then=Z.prototype.then,window.Promise.prototype[\"catch\"]=Z.prototype[\"catch\"]});Qg(function(){if(window.HTMLMediaElement){var a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var b=a.apply(this,arguments);b&&b[\"catch\"](function(){});return b}}});function Lh(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}Qg(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&\"webkitDroppedFrameCount\"in a&&(a.getVideoPlaybackQuality=Lh)}});function Mh(a,b,c){return new window.TextTrackCue(a,b,c)}function Nh(a,b,c){return new window.TextTrackCue(a+\"-\"+b+\"-\"+c,a,b,c)}Qg(function(){if(!window.VTTCue&&window.TextTrackCue){var a=TextTrackCue.length;if(3==a)window.VTTCue=Mh;else if(6==a)window.VTTCue=Nh;else{try{var b=!!Mh(1,2,\"\")}catch(c){b=!1}b&&(window.VTTCue=Mh)}}});}.call(g,this));\nif (typeof(module)!=\"undefined\"&&module.exports)module.exports=g.shaka;\nelse if (true)!(__WEBPACK_AMD_DEFINE_RESULT__ = function(){return g.shaka}.call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\nelse this.shaka=g.shaka;\n})();\n\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// kaltura-player.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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 98114c4c97ce723c9c62","(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(\"Playkit\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Playkit\"] = factory();\n\telse\n\t\troot[\"Playkit\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///core/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 21);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap dbf76349fddd4414c1d5\n\n\n// WEBPACK FOOTER //\n// webpack:/core/webpack/bootstrap dbf76349fddd4414c1d5","//@flow\n\n/**\n * General track representation of the player.\n * @classdesc\n */\nexport default class Track {\n /**\n * The id of the track.\n * @member\n * @type {string}\n * @private\n */\n _id: ?string;\n /**\n * The active mode of the track.\n * @member\n * @type {boolean}\n * @private\n */\n _active: boolean;\n /**\n * The label of the track.\n * @member\n * @type {string}\n * @private\n */\n _label: string;\n /**\n * The language of the track.\n * @member\n * @type {string}\n * @private\n */\n _language: string;\n /**\n * The index of the track.\n * @member\n * @type {number}\n * @private\n */\n _index: number;\n\n /**\n * Getter for the track id.\n * @public\n * @returns {?string} - The track id.\n */\n get id(): ?string {\n return this._id;\n }\n\n /**\n * Getter for the active mode of the track.\n * @public\n * @returns {boolean} - The active mode of the track.\n */\n get active(): boolean {\n return this._active;\n }\n\n /**\n * Setter for the active mode of the track.\n * @public\n * @param {boolean} value - Whether the track is active or not.\n */\n set active(value: boolean) {\n this._active = value;\n }\n\n /**\n * Getter for the label of the track.\n * @public\n * @returns {string} - The label of the track.\n */\n get label(): string {\n return this._label;\n }\n\n /**\n * Getter for the language of the track.\n * @public\n * @returns {string} - The language of the track.\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Getter for the index of the track.\n * @public\n * @returns {number} - The index of the track.\n */\n get index(): number {\n return this._index;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n constructor(settings: Object = {}) {\n this._id = settings.id;\n this._active = settings.active;\n this._label = settings.label;\n this._language = settings.language;\n this._index = settings.index;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./track/track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/track.js","//@flow\nimport * as JsLogger from 'js-logger';\n\nconst LOG_LEVEL: { [level: string]: Object } = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nclass LoggerFactory {\n constructor(options?: Object) {\n JsLogger.useDefaults(options || {});\n }\n\n getLogger(name?: string) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n}\n\nconst lf = new LoggerFactory({defaultLevel: JsLogger.DEBUG});\n\nexport default lf;\nexport {LOG_LEVEL};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/logger.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/logger.js","//@flow\n/**\n * Create an Event work-alike object based on the dictionary.\n * The event should contain all of the same properties from the dict.\n * @param {string} type -\n * @param {Object=} opt_dict -\n * @constructor\n * @extends {Event}\n */\nclass FakeEvent {\n /** @const {boolean} */\n bubbles: boolean;\n\n /** @const {boolean} */\n cancelable: boolean;\n\n /** @const {boolean} */\n defaultPrevented: boolean;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n timeStamp: number | Date;\n\n /** @const {string} */\n type: string;\n\n /** @const {boolean} */\n isTrusted: boolean;\n\n /** @type {EventTarget} */\n currentTarget: any;\n\n /** @type {EventTarget} */\n target: any;\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n stopped: boolean;\n\n payload: any;\n\n constructor(type: string, payload: any) {\n // These Properties below cannot be set by dict. They are all provided for\n // compatibility with native events.\n\n /** @const {boolean} */\n this.bubbles = false;\n\n /** @const {boolean} */\n this.cancelable = false;\n\n /** @const {boolean} */\n this.defaultPrevented = false;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n this.timeStamp = window.performance ? window.performance.now() : Date.now();\n\n /** @const {string} */\n this.type = type;\n\n /** @const {boolean} */\n this.isTrusted = false;\n\n /** @type {EventTarget} */\n this.currentTarget = null;\n\n /** @type {EventTarget} */\n this.target = null;\n\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n this.stopped = false;\n\n this.payload = payload;\n }\n\n /**\n * Does nothing, since FakeEvents have no default. Provided for compatibility\n * with native Events.\n * @override\n */\n preventDefault() {\n }\n\n /**\n * Stops processing event listeners for this event. Provided for compatibility\n * with native Events.\n * @override\n */\n stopImmediatePropagation() {\n this.stopped = true;\n }\n\n /**\n * Does nothing, since FakeEvents do not bubble. Provided for compatibility\n * with native Events.\n * @override\n */\n stopPropagation() {\n }\n}\n\nexport default FakeEvent;\n\n\n\n// WEBPACK FOOTER //\n// ./event/fake-event.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/fake-event.js","//@flow\nimport Track from './track'\n\n/**\n * Audio track representation of the player.\n * @classdesc\n */\nexport default class AudioTrack extends Track {}\n\n\n\n// WEBPACK FOOTER //\n// ./track/audio-track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/audio-track.js","//@flow\nimport Track from './track'\n\n/**\n * Text track representation of the player.\n * @classdesc\n */\nexport default class TextTrack extends Track {\n /**\n * The kind of the text track:\n * subtitles/captions/metadata.\n * @member\n * @type {string}\n * @private\n */\n _kind: string;\n\n /**\n * Getter for the kind of the text track.\n * @public\n * @returns {string} - The kind of the text track.\n */\n get kind(): string {\n return this._kind;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n constructor(settings: Object = {}) {\n super(settings);\n this._kind = settings.kind;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./track/text-track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/text-track.js","//@flow\nimport Track from './track'\n\n/**\n * Video track representation of the player.\n * @classdesc\n */\nexport default class VideoTrack extends Track {\n /**\n * The kind of the text track:\n * subtitles/captions/metadata.\n * @member\n * @type {string}\n * @private\n */\n _bandwidth: string;\n\n /**\n * Getter for the kind of the text track.\n * @public\n * @returns {string} - The kind of the text track.\n */\n get bandwidth(): string {\n return this._bandwidth;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n constructor(settings: Object = {}) {\n super(settings);\n this._bandwidth = settings.bandwidth;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./track/video-track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/video-track.js","//@flow\nimport MultiMap from '../utils/multi-map'\nimport FakeEvent from './fake-event'\n\n/**\n * Creates a new EventManager. An EventManager maintains a collection of \"event\n * bindings\" between event targets and event listeners.\n *\n * @struct\n * @constructor\n * @implements {IDestroyable}\n */\nclass EventManager {\n _bindingMap: MultiMap<Binding_> | null;\n\n constructor() {\n /**\n * Maps an event type to an array of event bindings.\n * @private {MultiMap.<!EventManager.Binding_>}\n */\n this._bindingMap = new MultiMap();\n }\n\n /**\n * Detaches all event listeners.\n * @override\n */\n destroy() {\n this.removeAll();\n this._bindingMap = null;\n return Promise.resolve();\n }\n\n\n /**\n * Attaches an event listener to an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {EventManager.ListenerType} listener The event listener.\n * @returns {void}\n */\n listen(target: any, type: string, listener: ListenerType): void {\n let binding = new Binding_(target, type, listener);\n if (this._bindingMap) {\n this._bindingMap.push(type, binding);\n }\n }\n\n\n /**\n * Detaches an event listener from an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @returns {void}\n */\n unlisten(target: any, type: string): void {\n if (this._bindingMap) {\n let list = this._bindingMap.get(type);\n\n for (let i = 0; i < list.length; ++i) {\n let binding = list[i];\n\n if (binding.target == target) {\n binding.unlisten();\n if (this._bindingMap) {\n this._bindingMap.remove(type, binding);\n }\n }\n }\n }\n }\n\n /**\n * Detaches all event listeners from all targets.\n * @returns {void}\n */\n removeAll(): void {\n if (this._bindingMap) {\n let listeners = this._bindingMap.getAll();\n\n for (let listener of listeners) {\n listener.unlisten();\n }\n if (this._bindingMap) {\n this._bindingMap.clear();\n }\n }\n }\n}\n\n/**\n * @typedef {function(!Event)}\n */\ntype ListenerType = (event: FakeEvent) => any;\n\n/**\n * Creates a new Binding_ and attaches the event listener to the event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {EventManager.ListenerType} listener The event listener.\n * @constructor\n * @private\n */\nclass Binding_ {\n target: any;\n type: string;\n listener: ?ListenerType;\n\n constructor(target, type, listener) {\n /** @type {EventTarget} */\n this.target = target;\n\n /** @type {string} */\n this.type = type;\n\n /** @type {?EventManager.ListenerType} */\n this.listener = listener;\n\n this.target.addEventListener(type, listener, false);\n }\n\n\n /**\n * Detaches the event listener from the event target. This does nothing if the\n * event listener is already detached.\n * @returns {void}\n */\n unlisten(): void {\n if (!this.target)\n return;\n\n this.target.removeEventListener(this.type, this.listener, false);\n\n this.target = null;\n this.listener = null;\n }\n}\n\nexport default EventManager;\n\n\n\n// WEBPACK FOOTER //\n// ./event/event-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/event-manager.js","//@flow\nimport {merge} from '../utils/util'\n\nconst HTML5_EVENTS: { [event: string]: string } = {\n /**\n * Fires when the loading of an audio/video is aborted\n */\n ABORT: 'abort',\n /**\n * Fires when the browser can start playing the audio/video\n */\n CAN_PLAY: 'canplay',\n /**\n * Fires when the browser can play through the audio/video without stopping for buffering\n */\n CAN_PLAY_THROUGH: 'canplaythrough',\n /**\n * Fires when the duration of the audio/video is changed\n */\n DURATION_CHANGE: 'durationchange',\n /**\n * Fires when the current playlist is empty\n */\n EMPTIED: 'emptied',\n /**\n * Fires when the current playlist is ended\n */\n ENDED: 'ended',\n /**\n * Fires when an error occurred during the loading of an audio/video\n */\n ERROR: 'error',\n /**\n * Fires when the browser has loaded the current frame of the audio/video\n */\n LOADED_DATA: 'loadeddata',\n /**\n * Fires when the browser has loaded meta data for the audio/video\n */\n LOADED_METADATA: 'loadedmetadata',\n /**\n * Fires when the browser starts looking for the audio/video\n */\n LOAD_START: 'loadstart',\n /**\n * Fires when the audio/video has been paused\n */\n PAUSE: 'pause',\n /**\n * Fires when the audio/video has been started or is no longer paused\n */\n PLAY: 'play',\n /**\n * Fires when the audio/video is playing after having been paused or stopped for buffering\n */\n PLAYING: 'playing',\n /**\n * Fires when the browser is downloading the audio/video\n */\n PROGRESS: 'progress',\n /**\n * Fires when the playing speed of the audio/video is changed\n */\n RATE_CHANGE: 'ratechange',\n /**\n * Fires when the user is finished moving/skipping to a new position in the audio/video\n */\n SEEKED: 'seeked',\n /**\n * Fires when the user starts moving/skipping to a new position in the audio/video\n */\n SEEKING: 'seeking',\n /**\n * Fires when the browser is trying to get media data, but data is not available\n */\n STALLED: 'stalled',\n /**\n * Fires when the browser is intentionally not getting media data\n */\n SUSPEND: 'suspend',\n /**\n * Fires when the current playback position has changed\n */\n TIME_UPDATE: 'timeupdate',\n /**\n * Fires when the volume has been changed\n */\n VOLUME_CHANGE: 'volumechange',\n /**\n * Fires when the video stops because it needs to buffer the next frame\n */\n WAITING: 'waiting',\n};\n\nconst CUSTOM_EVENTS: { [event: string]: string } = {\n /**\n * Fires when the active video track has been changed\n */\n VIDEO_TRACK_CHANGED: 'videotrackchanged',\n /**\n * Fires when the active audio track has been changed\n */\n AUDIO_TRACK_CHANGED: 'audiotrackchanged',\n /**\n * Fires when the active text track has been changed\n */\n TEXT_TRACK_CHANGED: 'texttrackchanged',\n /**\n * Fires when the player tracks have been changed\n */\n TRACKS_CHANGED: 'trackschanged',\n /**\n * Fires when the player state has been changed\n */\n PLAYER_STATE_CHANGED: 'playerstatechanged',\n /**\n * Fires on the first play\n */\n FIRST_PLAY: 'firstplay',\n /**\n * Fires when the player has selected the source to play\n */\n SOURCE_SELECTED: 'sourceselected'\n};\n\nconst PLAYER_EVENTS: { [event: string]: string } = merge([HTML5_EVENTS, CUSTOM_EVENTS]);\n\nexport {PLAYER_EVENTS, HTML5_EVENTS, CUSTOM_EVENTS};\n\n\n\n// WEBPACK FOOTER //\n// ./event/events.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/events.js","//@flow\nimport EventManager from './event/event-manager'\nimport FakeEvent from './event/fake-event'\nimport FakeEventTarget from './event/fake-event-target'\nimport {PLAYER_EVENTS as PlayerEvents, HTML5_EVENTS as Html5Events, CUSTOM_EVENTS as CustomEvents} from './event/events'\nimport PlayerStates from './state/state-types'\nimport {isNumber, isFloat, merge} from './utils/util'\nimport LoggerFactory from './utils/logger'\nimport Html5 from './engines/html5/html5'\nimport PluginManager from './plugin/plugin-manager'\nimport StateManager from './state/state-manager'\nimport TrackTypes from './track/track-types'\nimport Track from './track/track'\nimport VideoTrack from './track/video-track'\nimport AudioTrack from './track/audio-track'\nimport TextTrack from './track/text-track'\n\n/**\n * The HTML5 player class.\n * @classdesc\n */\nclass Player extends FakeEventTarget {\n /**\n * The player class logger.\n * @type {any}\n * @private\n */\n _logger: any;\n /**\n * The plugin manager of the player.\n * @type {PluginManager}\n * @private\n */\n _pluginManager: PluginManager;\n /**\n * The event manager of the player.\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * The runtime configuration of the player.\n * @type {Object}\n * @private\n */\n _config: Object;\n /**\n * The playback engine.\n * @type {IEngine}\n * @private\n */\n _engine: IEngine;\n /**\n * The state manager of the player.\n * @type {StateManager}\n * @private\n */\n _stateManager: StateManager;\n /**\n * The tracks of the player.\n * @type {Array<Track>}\n * @private\n */\n _tracks: Array<Track>;\n /**\n * The player ready promise\n * @type {Promise<*>}\n * @private\n */\n _readyPromise: ?Promise<*>;\n /**\n * Whether the play is the first or not\n * @type {boolean}\n * @private\n */\n _firstPlay: boolean;\n\n /**\n * @param {Object} config - The configuration for the player instance.\n * @constructor\n */\n constructor(config: Object) {\n super();\n this._tracks = [];\n this._firstPlay = true;\n this._logger = LoggerFactory.getLogger('Player');\n this._stateManager = new StateManager(this);\n this._pluginManager = new PluginManager();\n this._eventManager = new EventManager();\n this._readyPromise = new Promise((resolve, reject) => {\n this._eventManager.listen(this, CustomEvents.TRACKS_CHANGED, () => {\n resolve();\n });\n this._eventManager.listen(this, Html5Events.ERROR, reject);\n });\n this.configure(config);\n }\n\n /**\n * Configures the player according to given configuration.\n * @param {Object} config - The configuration for the player instance.\n * @returns {void}\n */\n configure(config: Object): void {\n this._config = merge([this._config, config || Player._defaultConfig()]);\n this._loadPlugins(this._config);\n this._selectEngine(this._config);\n this._attachMedia();\n }\n\n /**\n * Destroys the player.\n * @returns {void}\n * @public\n */\n destroy(): void {\n this._engine.destroy();\n this._eventManager.destroy();\n this._pluginManager.destroy();\n this._stateManager.destroy();\n this._config = {};\n this._tracks = [];\n this._readyPromise = null;\n this._firstPlay = true;\n }\n\n /**\n * @returns {Object} - The default configuration of the player.\n * @private\n * @static\n */\n static _defaultConfig(): Object {\n return {};\n }\n\n /**\n *\n * @param {Object} config - The configuration of the player instance.\n * @private\n * @returns {void}\n */\n _loadPlugins(config: Object): void {\n let plugins = config.plugins;\n for (let name in plugins) {\n this._pluginManager.load(name, this, plugins[name]);\n }\n }\n\n /**\n * Select the engine to create based on the given configured sources.\n * @param {Object} config - The configuration of the player instance.\n * @private\n * @returns {void}\n */\n _selectEngine(config: Object): void {\n if (config && config.sources) {\n let sources = config.sources;\n for (let i = 0; i < sources.length; i++) {\n if (Html5.canPlayType(sources[i].mimetype)) {\n this.dispatchEvent(new FakeEvent(CustomEvents.SOURCE_SELECTED, {selectedSource: sources[i]}));\n this._loadEngine(sources[i], config);\n break;\n }\n }\n }\n }\n\n /**\n * Loads the selected engine.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The configuration of the player instance.\n * @private\n * @returns {void}\n */\n _loadEngine(source: Source, config: Object): void {\n this._engine = new Html5(source, config);\n if (config.preload === \"auto\") {\n this.load();\n }\n }\n\n /**\n * Listen to all HTML5 defined events and trigger them on the player\n * @private\n * @returns {void}\n */\n _attachMedia(): void {\n if (this._engine) {\n for (let playerEvent in Html5Events) {\n this._eventManager.listen(this._engine, Html5Events[playerEvent], (event: FakeEvent) => {\n return this.dispatchEvent(event);\n });\n }\n this._eventManager.listen(this._engine, CustomEvents.VIDEO_TRACK_CHANGED, (event: FakeEvent) => {\n this._markActiveTrack(event.payload.selectedVideoTrack);\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this._engine, CustomEvents.AUDIO_TRACK_CHANGED, (event: FakeEvent) => {\n this._markActiveTrack(event.payload.selectedAudioTrack);\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this._engine, CustomEvents.TEXT_TRACK_CHANGED, (event: FakeEvent) => {\n this._markActiveTrack(event.payload.selectedTextTrack);\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this, Html5Events.PLAY, this._onPlay.bind(this));\n }\n }\n\n /**\n * Returns the tracks according to the filter. if no filter given returns the all tracks.\n * @function getTracks\n * @param {string} [type] - a tracks filter, should be 'video', 'audio' or 'text'.\n * @returns {Array<Track>} - The parsed tracks.\n * @public\n */\n getTracks(type?: string): Array<Track> {\n return this._getTracksByType(type);\n }\n\n /**\n * Returns the tracks according to the filter. if no filter given returns the all tracks.\n * @function _getTracksByType\n * @param {string} [type] - a tracks filter, should be 'video', 'audio' or 'text'.\n * @returns {Array<Track>} - The parsed tracks.\n * @private\n */\n _getTracksByType(type?: string): Array<Track> {\n return !type ? this._tracks : this._tracks.filter((track: Track) => {\n if (type === TrackTypes.VIDEO) {\n return track instanceof VideoTrack;\n } else if (type === TrackTypes.AUDIO) {\n return track instanceof AudioTrack;\n } else if (type === TrackTypes.TEXT) {\n return track instanceof TextTrack;\n } else {\n return true;\n }\n });\n }\n\n /**\n * Select a track\n * @function selectTrack\n * @param {Track} track - the track to select\n * @returns {void}\n * @public\n */\n selectTrack(track: Track): void {\n if (this._engine) {\n if (track instanceof VideoTrack) {\n this._engine.selectVideoTrack(track);\n } else if (track instanceof AudioTrack) {\n this._engine.selectAudioTrack(track);\n } else if (track instanceof TextTrack) {\n this._engine.selectTextTrack(track);\n }\n }\n }\n\n /**\n * Enables adaptive bitrate switching.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n if (this._engine) {\n this._engine.enableAdaptiveBitrate();\n }\n }\n\n /**\n * Mark the selected track as active\n * @function _markActiveTrack\n * @param {Track} track - the track to mark\n * @returns {void}\n * @private\n */\n _markActiveTrack(track: Track) {\n let type;\n if (track instanceof VideoTrack) {\n type = TrackTypes.VIDEO;\n } else if (track instanceof AudioTrack) {\n type = TrackTypes.AUDIO;\n } else if (track instanceof TextTrack) {\n type = TrackTypes.TEXT;\n }\n if (type) {\n let tracks = this.getTracks(type);\n for (let i = 0; i < tracks.length; i++) {\n tracks[i].active = track.index === i;\n }\n }\n }\n\n /**\n * @function _onPlay\n * @return {void}\n * @private\n */\n _onPlay(): void {\n if (this._firstPlay) {\n this._firstPlay = false;\n this.dispatchEvent(new FakeEvent(CustomEvents.FIRST_PLAY));\n }\n }\n\n /**\n * Get the player config.\n * @returns {Object} - The player configuration.\n * @public\n */\n get config(): Object {\n return this._config;\n }\n\n /**\n * Set player session id\n * @param {string} sessionId - the player session id to set\n * @returns {void}\n * @public\n */\n set sessionId(sessionId: string): void {\n this._config.session = this._config.session || {};\n this._config.session.id = sessionId;\n }\n\n // <editor-fold desc=\"Playback Interface\">\n /**\n * The player readiness\n * @public\n * @returns {Promise<*>} - The ready promise\n */\n ready(): Promise<*> {\n return this._readyPromise ? this._readyPromise : Promise.resolve();\n }\n\n /**\n * Load media\n * @public\n * @returns {void}\n */\n load(): void {\n if (this._engine) {\n this._engine.load().then((data) => {\n this._tracks = data.tracks;\n this.dispatchEvent(new FakeEvent(CustomEvents.TRACKS_CHANGED, {tracks: this._tracks}));\n }).catch((error) => {\n this.dispatchEvent(new FakeEvent(Html5Events.ERROR, error));\n });\n }\n }\n\n /**\n * Start/resume playback.\n * @returns {void}\n * @public\n */\n play(): void {\n if (this._engine) {\n if (this._engine.src) {\n this._engine.play();\n } else {\n this.load();\n this.ready().then(() => {\n this._engine.play();\n });\n }\n }\n }\n\n /**\n * Pause playback.\n * @returns {void}\n * @public\n */\n pause(): void {\n if (this._engine) {\n return this._engine.pause();\n }\n }\n\n /**\n * Set the current time in seconds.\n * @param {Number} to - The number to set in seconds.\n * @public\n */\n set currentTime(to: number): void {\n if (this._engine) {\n if (isNumber(to)) {\n let boundedTo = to;\n if (to < 0) {\n boundedTo = 0;\n }\n if (boundedTo > this._engine.duration) {\n boundedTo = this._engine.duration;\n }\n this._engine.currentTime = boundedTo;\n }\n }\n }\n\n /**\n * Get the current time in seconds.\n * @returns {?Number} - The playback current time.\n * @public\n */\n get currentTime(): ?number {\n if (this._engine) {\n return this._engine.currentTime;\n }\n }\n\n /**\n * Get the duration in seconds.\n * @returns {?Number} - The playback duration.\n * @public\n */\n get duration(): ?number {\n if (this._engine) {\n return this._engine.duration;\n }\n }\n\n /**\n * Set playback volume.\n * @param {Number} vol - The volume to set.\n * @returns {void}\n * @public\n */\n set volume(vol: number): void {\n if (this._engine) {\n if (isFloat(vol)) {\n let boundedVol = vol;\n if (boundedVol < 0) {\n boundedVol = 0;\n }\n if (boundedVol > 1) {\n boundedVol = 1;\n }\n this._engine.volume = boundedVol;\n }\n }\n }\n\n /**\n * Get playback volume.\n * @returns {?Number} - The playback volume.\n * @public\n */\n get volume(): ?number {\n if (this._engine) {\n return this._engine.volume;\n }\n }\n\n // </editor-fold>\n\n // <editor-fold desc=\"State\">\n /**\n * Get paused state.\n * @returns {?boolean} - Whether the video is paused or not.\n * @public\n */\n get paused(): ?boolean {\n if (this._engine) {\n return this._engine.paused;\n }\n }\n\n /**\n * Get seeking state.\n * @returns {?boolean} - Whether the video is seeking or not.\n * @public\n */\n get seeking(): ?boolean {\n if (this._engine) {\n return this._engine.seeking;\n }\n }\n\n buffered() {\n }\n\n /**\n * Set player muted state.\n * @param {boolean} mute - The mute value.\n * @returns {void}\n * @public\n */\n set muted(mute: boolean): void {\n if (this._engine) {\n this._engine.muted = mute;\n }\n }\n\n /**\n * Get player muted state.\n * @returns {?boolean} - Whether the video is muted or not.\n * @public\n */\n get muted(): ?boolean {\n if (this._engine) {\n return this._engine.muted;\n }\n }\n\n /**\n * Get the player source.\n * @returns {?string} - The current source of the player.\n * @public\n */\n get src(): ?string {\n if (this._engine) {\n return this._engine.src;\n }\n }\n\n /**\n * Get the player events.\n * @returns {Object} - The events of the player.\n * @public\n */\n get Event(): { [event: string]: string } {\n return PlayerEvents;\n }\n\n /**\n * Get the player states.\n * @returns {Object} - The states of the player.\n * @public\n */\n get State(): { [state: string]: string } {\n return PlayerStates;\n }\n\n /**\n * Get the player tracks types.\n * @returns {Object} - The tracks types of the player.\n * @public\n */\n get Track(): { [track: string]: string } {\n return TrackTypes;\n }\n\n// </editor-fold>\n}\n\nexport default Player;\n\n\n\n// WEBPACK FOOTER //\n// ./player.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/player.js","//@flow\nimport FakeEvent from './fake-event'\nimport MultiMap from '../utils/multi-map'\n\n/**\n * A work-alike for EventTarget. Only DOM elements may be true EventTargets,\n * but this can be used as a base class to provide event dispatch to non-DOM\n * classes. Only FakeEvents should be dispatched.\n *\n * @struct\n * @constructor\n * @implements {EventTarget}\n * @export\n */\nclass FakeEventTarget {\n _listeners: MultiMap<ListenerType>;\n dispatchTarget: FakeEventTarget;\n\n constructor() {\n /**\n * @private {!MultiMap.<FakeEventTarget.ListenerType>}\n */\n this._listeners = new MultiMap();\n\n /**\n * The target of all dispatched events. Defaults to |this|.\n * @type {EventTarget}\n */\n this.dispatchTarget = this;\n }\n\n /**\n * Add an event listener to this object.\n *\n * @param {string} type The event type to listen for.\n * @param {FakeEventTarget.ListenerType} listener The callback or\n * listener object to invoke.\n * @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have\n * parents, so events neither capture nor bubble.\n * @override\n * @export\n */\n addEventListener(type: string, listener: ListenerType) {\n this._listeners.push(type, listener);\n }\n\n /**\n * Remove an event listener from this object.\n *\n * @param {string} type The event type for which you wish to remove a listener.\n * @param {FakeEventTarget.ListenerType} listener The callback or\n * listener object to remove.\n * @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have\n * parents, so events neither capture nor bubble.\n * @override\n * @export\n */\n removeEventListener(type: string, listener: ListenerType) {\n this._listeners.remove(type, listener);\n }\n\n /**\n * Dispatch an event from this object.\n *\n * @param {!Event} event The event to be dispatched from this object.\n * @return {boolean} True if the default action was prevented.\n * @override\n * @export\n */\n dispatchEvent(event: FakeEvent) {\n // In many browsers, it is complex to overwrite properties of actual Events.\n // Here we expect only to dispatch FakeEvents, which are simpler.\n //goog.asserts.assert(event instanceof FakeEvent,\n // 'FakeEventTarget can only dispatch FakeEvents!');\n\n let list = this._listeners.get(event.type) || [];\n\n for (let i = 0; i < list.length; ++i) {\n // Do this every time, since events can be re-dispatched from handlers.\n event.target = this.dispatchTarget;\n event.currentTarget = this.dispatchTarget;\n\n let listener = list[i];\n try {\n if (listener.handleEvent) {\n listener.handleEvent(event);\n } else {\n listener.call(this, event);\n }\n } catch (exception) {\n // Exceptions during event handlers should not affect the caller,\n // but should appear on the console as uncaught, according to MDN:\n // http://goo.gl/N6Ff27\n // TODO: add log\n }\n\n if (event.stopped) {\n break;\n }\n }\n\n return event.defaultPrevented;\n }\n}\n\n/**\n * These are the listener types defined in the closure extern for EventTarget.\n * @typedef {EventListener|function(!Event):(boolean|undefined)}\n */\ndeclare function ListenerType(event: FakeEvent): (boolean | void);\n\nexport default FakeEventTarget;\n\n\n\n// WEBPACK FOOTER //\n// ./event/fake-event-target.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/fake-event-target.js","//@flow\nexport default class PlayerError {\n static TYPE: {[name: string]: Object} = {\n NOT_REGISTERED_PLUGIN: {\n name: \"PluginNotRegisteredException\",\n message: function (name) {\n return `Cannot load ${name} plugin. Name not found in the registry`;\n }\n },\n NOT_VALID_HANDLER: {\n name: \"PluginHandlerIsNotValidException\",\n message: function () {\n return \"To activate plugin you must provide a class derived from BasePlugin\";\n }\n },\n NOT_IMPLEMENTED_METHOD: {\n name: \"NotImplementedException\",\n message: function (method) {\n return `${method} method not implemented`;\n }\n }\n };\n\n name: string;\n message: string;\n\n constructor(error: Object, param?: any) {\n this.name = error.name;\n this.message = error.message(param);\n }\n\n getError() {\n return {\n name: this.name,\n message: this.message\n };\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./utils/player-error.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/player-error.js","//@flow\n\"use strict\";\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is a number\n */\nfunction isNumber(n: number): boolean {\n return Number(n) === n;\n}\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is an integer\n */\nfunction isInt(n: number): boolean {\n return isNumber(n) && n % 1 === 0;\n}\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is a float\n */\nfunction isFloat(n: number): boolean {\n return isNumber(n) && n % 1 !== 0;\n}\n\n/**\n * @param {Array<Object>} objects - The objects to merge\n * @returns {Object} - The merged object.\n */\nfunction merge(objects: Array<Object>): Object {\n let target = {};\n for (let obj of objects) {\n Object.assign(target, obj);\n }\n return target;\n}\n\nexport {isNumber, isInt, isFloat, merge};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/util.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/util.js","//@flow\n/* eslint-disable no-unused-vars */\nimport FakeEvent from '../../../event/fake-event'\nimport FakeEventTarget from '../../../event/fake-event-target'\nimport PlayerError from '../../../utils/player-error'\nimport {CUSTOM_EVENTS} from '../../../event/events'\nimport LoggerFactory from '../../../utils/logger'\nimport Track from '../../../track/track'\nimport VideoTrack from '../../../track/video-track'\nimport AudioTrack from '../../../track/audio-track'\nimport TextTrack from '../../../track/text-track'\n\nexport default class BaseMediaSourceAdapter extends FakeEventTarget implements IMediaSourceAdapter {\n /**\n * Passing the custom events to the actual media source adapter.\n * @static\n */\n static CustomEvents: { [event: string]: string } = CUSTOM_EVENTS;\n\n /**\n * Passing the getLogger function to the actual media source adapter.\n * @type {Function}\n * @static\n */\n static getLogger: Function = LoggerFactory.getLogger;\n\n /**\n * The adapter config.\n * @member {Object} _config\n * @private\n */\n _config: ?Object;\n\n /**\n * The source object.\n * @member {Source} _sourceObj\n * @private\n */\n _sourceObj: ?Source;\n\n /**\n * The dom video element.\n * @member {HTMLVideoElement} _videoElement\n * @private\n */\n _videoElement: HTMLVideoElement;\n\n /**\n * Checks if the media source adapter is supported.\n * @function isSupported\n * @returns {boolean} - Whether the media source adapter is supported.\n * @static\n */\n static isSupported(): boolean {\n return true;\n }\n\n /**\n * Factory method to create media source adapter.\n * @function createAdapter\n * @param {HTMLVideoElement} videoElement - The video element that the media source adapter work with.\n * @param {Object} source - The source Object.\n * @param {Object} config - The media source adapter configuration.\n * @returns {IMediaSourceAdapter} - New instance of the run time media source adapter.\n * @static\n */\n static createAdapter(videoElement: HTMLVideoElement, source: Source, config: Object): IMediaSourceAdapter {\n return new this(videoElement, source, config);\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to media source adapter.\n * @param {Source} source - The source object.\n * @param {Object} config - The media source adapter configuration.\n */\n constructor(videoElement: HTMLVideoElement, source: Source, config: Object) {\n super();\n this._videoElement = videoElement;\n this._sourceObj = source;\n this._config = config;\n }\n\n /**\n * Destroys the media source adapter.\n * @function destroy\n * @returns {void}\n */\n destroy(): void {\n this._sourceObj = null;\n this._config = null;\n }\n\n /**\n * Triggers the appropriate track changed event.\n * @param {Track} track - The selected track.\n * @private\n * @returns {void}\n */\n _onTrackChanged(track: Track): void {\n if (track instanceof VideoTrack) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.VIDEO_TRACK_CHANGED, {selectedVideoTrack: track});\n } else if (track instanceof AudioTrack) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.AUDIO_TRACK_CHANGED, {selectedAudioTrack: track});\n } else if (track instanceof TextTrack) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.TEXT_TRACK_CHANGED, {selectedTextTrack: track});\n }\n }\n\n /**\n * Dispatch an adapter event forward.\n * @param {string} name - The name of the event.\n * @param {Object} payload - The event payload.\n * @returns {void}\n */\n _trigger(name: string, payload: Object): void {\n this.dispatchEvent(new FakeEvent(name, payload));\n }\n\n /** Must implemented methods by the derived media source adapter **/\n\n static canPlayType(mimeType: string): boolean {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'static canPlayType').getError();\n }\n\n load(): Promise<Object> {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'load').getError();\n }\n\n selectVideoTrack(videoTrack: VideoTrack): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'selectVideoTrack').getError();\n }\n\n selectAudioTrack(audioTrack: AudioTrack): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'selectAudioTrack').getError();\n }\n\n selectTextTrack(textTrack: TextTrack): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'selectTextTrack').getError();\n }\n\n enableAdaptiveBitrate(): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'enableAdaptiveBitrate').getError();\n }\n\n get src(): string {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'get src').getError();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/media-source/base-media-source-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/media-source/base-media-source-adapter.js","//@flow\nimport NativeAdapter from './adapters/native-adapter'\nimport LoggerFactory from '../../../utils/logger'\n\n/**\n * Media source provider\n * @classdesc\n */\nexport default class MediaSourceProvider {\n /**\n * The logger of the media source provider\n * @member {any} _logger\n * @static\n * @private\n */\n static _logger: any = LoggerFactory.getLogger('MediaSourceProvider');\n /**\n * The media source adapter registry\n * @member {Array<IMediaSourceAdapter>} _mediaSourceAdapters\n * @static\n * @private\n */\n static _mediaSourceAdapters: Array<typeof IMediaSourceAdapter> = [NativeAdapter];\n /**\n * The selected adapter for playback\n * @type {null|IMediaSourceAdapter}\n * @static\n * @private\n */\n static _selectedAdapter: ?(typeof IMediaSourceAdapter) = null;\n\n /**\n * Add a media source adapter to the registry\n * @function register\n * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to register\n * @static\n * @returns {void}\n */\n static register(mediaSourceAdapter: typeof IMediaSourceAdapter): void {\n if (mediaSourceAdapter) {\n if (!MediaSourceProvider._mediaSourceAdapters.includes(mediaSourceAdapter)) {\n MediaSourceProvider._logger.debug(`Adapter <${mediaSourceAdapter.id}> has been registered successfully`);\n MediaSourceProvider._mediaSourceAdapters.push(mediaSourceAdapter);\n } else {\n MediaSourceProvider._logger.debug(`Adapter <${mediaSourceAdapter.id}> is already registered, do not register again`);\n }\n }\n }\n\n /**\n * Remove a media source adapter from the registry\n * @function unRegister\n * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to unRegister\n * @static\n * @returns {void}\n */\n static unRegister(mediaSourceAdapter: typeof IMediaSourceAdapter): void {\n let index = MediaSourceProvider._mediaSourceAdapters.indexOf(mediaSourceAdapter);\n if (index > -1) {\n MediaSourceProvider._logger.debug(`Unregistered <${mediaSourceAdapter.id}> adapter`);\n MediaSourceProvider._mediaSourceAdapters.splice(index, 1);\n }\n }\n\n /**\n * Checks if one of the registered media source adapters can play a given mime type\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @static\n * @returns {boolean} - If one of the adapters can play the specific mime type\n */\n static canPlayType(mimeType: string): boolean {\n let mediaSourceAdapters = MediaSourceProvider._mediaSourceAdapters;\n for (let i = 0; i < mediaSourceAdapters.length; i++) {\n if (mediaSourceAdapters[i].canPlayType(mimeType)) {\n MediaSourceProvider._selectedAdapter = mediaSourceAdapters[i];\n MediaSourceProvider._logger.debug(`Selected adapter is <${MediaSourceProvider._selectedAdapter.id}>`);\n return true;\n }\n }\n return false;\n }\n\n /**\n * Get the appropriate media source adapter to the video source\n * @function getMediaSourceAdapter\n * @param {HTMLVideoElement} videoElement - The video element which requires adapter for a given mimeType\n * @param {Source} source - The selected source object\n * @param {Object} config - The player configuration\n * @returns {IMediaSourceAdapter|null} - The selected media source adapter, or null if such doesn't exists\n * @static\n */\n static getMediaSourceAdapter(videoElement: HTMLVideoElement, source: Source, config: Object): ?IMediaSourceAdapter {\n if (videoElement && source && config) {\n if (!MediaSourceProvider._selectedAdapter) {\n MediaSourceProvider.canPlayType(source.mimetype);\n }\n return MediaSourceProvider._selectedAdapter ? MediaSourceProvider._selectedAdapter.createAdapter(videoElement, source, config.engines) : null;\n }\n return null;\n }\n}\n\nconst registerMediaSourceAdapter = MediaSourceProvider.register;\nexport {registerMediaSourceAdapter};\n\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/media-source/media-source-provider.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/media-source/media-source-provider.js","//@flow\nimport Player from '../player'\nimport LoggerFactory from '../utils/logger'\nimport {merge} from '../utils/util'\nimport EventManager from '../event/event-manager'\nimport PlayerError from '../utils/player-error'\n\n/** The BasePlugin responsible to implement the plugin interface.\n * Contains several default implementations.\n * Other plugins should extend this class.\n * @classdesc\n */\nexport default class BasePlugin implements IPlugin {\n /**\n * The runtime configuration of the plugin.\n * @member\n */\n config: Object;\n /**\n * The name of the plugin.\n * @member\n */\n name: string;\n /**\n * The logger of the plugin.\n * @member\n */\n logger: any;\n /**\n * Reference to the actual player.\n * @member\n */\n player: Player;\n /**\n * The event manager of the plugin.\n * @member\n */\n eventManager: EventManager;\n /**\n * The default configuration of the plugin.\n * Inherited plugins should override this property.\n * @type {Object}\n * @static\n * @member\n */\n static defaultConfig: Object = {};\n\n /**\n * Factory method to create the actual plugin.\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} config - The plugin configuration\n * @returns {BasePlugin} - New runtime plugin instance\n * @static\n * @public\n */\n static createPlugin(name: string, player: Player, config: Object = {}): BasePlugin {\n return new this(name, player, config);\n }\n\n /**\n * Returns under what conditions the plugin is valid.\n * Plugin must implement this method.\n * @returns {boolean} - Whether the plugin is valid and can be initiated. Default implementation is true\n * @static\n * @public\n * @abstract\n */\n static isValid(): boolean {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'isValid()').getError();\n }\n\n /**\n * constructor\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} config - The plugin configuration\n * @constructor\n * @private\n */\n constructor(name: string, player: Player, config: Object) {\n this.name = name;\n this.player = player;\n this.eventManager = new EventManager();\n this.logger = LoggerFactory.getLogger(this.name);\n this.config = merge([this.constructor.defaultConfig, config]);\n }\n\n /**\n * Getter for the configuration of the plugin.\n * @param {string} attr - The key in the plugin configuration (optional).\n * @returns {*} - If attribute is provided, returns its value. Else, Returns the config of the plugin.\n * @public\n */\n getConfig(attr?: string): any {\n if (attr) {\n return this.config[attr];\n }\n return this.config;\n }\n\n /**\n * Updates the config of the plugin.\n * @param {Object} update - The updated configuration.\n * @public\n * @returns {void}\n */\n updateConfig(update: Object): void {\n this.config = merge([this.config, update]);\n }\n\n /**\n * Runs the destroy logic of the plugin.\n * plugin must implement this method.\n * @public\n * @abstract\n * @returns {void}\n */\n destroy(): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'destroy()').getError();\n }\n\n /**\n * Getter for the plugin's name.\n * @returns {string} - The name of the plugin.\n * @public\n */\n getName(): string {\n return this.name;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./plugin/base-plugin.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/plugin/base-plugin.js","//@flow\nimport BasePlugin from './base-plugin'\nimport PlayerError from '../utils/player-error'\nimport Player from '../player'\nimport LoggerFactory from '../utils/logger'\n\n/**\n * The logger of the PluginManager class.\n * @private\n * @const\n */\nconst logger = LoggerFactory.getLogger(\"PluginManager\");\n\n/** The PluginManager responsible for register plugins definitions and store plugins instances.\n * @classdesc\n */\nexport default class PluginManager {\n /**\n * The registry of the plugins.\n * Maps plugin's name to his class.\n * @type {Map}\n * @static\n * @private\n */\n static _registry: Map<string, Function> = new Map();\n /**\n * The active plugins in the player.\n * Maps plugin's name to his instance.\n * @type {Map}\n * @private\n */\n _plugins: Map<string, BasePlugin> = new Map();\n\n /**\n * Writes the plugin in the registry.\n * Maps: plugin name -> plugin class.\n * @param {string} name - The plugin name\n * @param {Function} handler - The plugin class\n * @returns {boolean} - If the registration request succeeded\n * @static\n * @public\n */\n static register(name: string, handler: Function): boolean {\n if (typeof handler !== 'function' || handler.prototype instanceof BasePlugin === false) {\n throw new PlayerError(PlayerError.TYPE.NOT_VALID_HANDLER).getError();\n }\n if (!PluginManager._registry.has(name)) {\n PluginManager._registry.set(name, handler);\n logger.debug(`Plugin <${name}> has been registered successfully`);\n return true;\n }\n logger.debug(`Plugin <${name}> is already registered, do not register again`);\n return false;\n }\n\n /**\n * Removes the plugin from the registry.\n * @param {string} name - The plugin name\n * @static\n * @public\n * @returns {void}\n */\n static unRegister(name: string): void {\n if (PluginManager._registry.has(name)) {\n PluginManager._registry.delete(name);\n logger.debug(`Unregistered <${name}> plugin.`);\n }\n }\n\n /**\n * Creates and store new instance of the plugin in case isValid() of the plugin returns true.\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} [config={}] - The plugin configuration\n * @returns {boolean} - Whether the plugin load was successful\n * @public\n */\n load(name: string, player: Player, config: Object = {}): boolean {\n if (!PluginManager._registry.has(name)) {\n throw new PlayerError(PlayerError.TYPE.NOT_REGISTERED_PLUGIN, name).getError();\n }\n let pluginClass = PluginManager._registry.get(name);\n if (pluginClass != null && pluginClass.isValid()) {\n this._plugins.set(name, pluginClass.createPlugin(name, player, config));\n logger.debug(`Plugin <${name}> has been loaded`);\n return true;\n }\n logger.debug(`Plugin <${name}> isn\\'t loaded, isValid()=false`);\n return false;\n }\n\n /**\n * Iterates over all the plugins and calls private _destroy.\n * @public\n * @returns {void}\n */\n destroy(): void {\n this._plugins.forEach(this._destroy.bind(this));\n }\n\n /**\n * Calls destroy() method of the plugin's impl.\n * @param {BasePlugin} plugin - The plugin instance\n * @param {string} name - The plugin name\n * @private\n * @returns {void}\n */\n _destroy(plugin: BasePlugin, name: string): void {\n plugin.destroy();\n this._plugins.delete(name);\n }\n\n /**\n * Returns the plugin's instance.\n * @param {string} name - The plugin name\n * @returns {BasePlugin} - The plugin instance\n * @public\n */\n get(name: string): ?BasePlugin {\n return this._plugins.get(name);\n }\n}\n\n/**\n * Export the register method.\n * @type {function}\n * @constant\n */\nconst registerPlugin = PluginManager.register;\nexport {registerPlugin};\n\n\n\n// WEBPACK FOOTER //\n// ./plugin/plugin-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/plugin/plugin-manager.js","//@flow\n\n/**\n * The possible player state types.\n * @const\n * @type {{IDLE: string, LOADING: string, PLAYING: string, PAUSED: string, BUFFERING: string}}\n */\nconst PLAYER_STATE_TYPES: { [state: string]: string } = {\n IDLE: \"idle\",\n LOADING: \"loading\",\n PLAYING: \"playing\",\n PAUSED: \"paused\",\n BUFFERING: \"buffering\"\n};\n\nexport default PLAYER_STATE_TYPES;\n\n\n\n// WEBPACK FOOTER //\n// ./state/state-types.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/state/state-types.js","//@flow\n\n/**\n * A simple multimap template.\n * @constructor\n * @struct\n * @template T\n */\nclass MultiMap<T> {\n _map: Map<string, T[]>;\n\n constructor() {\n /** @private {!Object.<string, !Array.<T>>} */\n this._map = new Map();\n }\n\n /**\n * Add a key, value pair to the map.\n * @param {string} key -\n * @param {T} value -\n * @returns {void}\n */\n push(key: string, value: T): void {\n if (this._map.has(key)) {\n let list = this._map.get(key);\n if (Array.isArray(list)) {\n list.push(value);\n this._map.set(key, list);\n }\n } else {\n this._map.set(key, [value]);\n }\n }\n\n /**\n * Set an array of values for the key, overwriting any previous data.\n * @param {string} key -\n * @param {!Array.<T>} values -\n * @returns {void}\n */\n set(key: string, values: T[]): void {\n this._map.set(key, values);\n }\n\n /**\n * Check for a key.\n * @param {string} key -\n * @return {boolean} true if the key exists.\n */\n has(key: string): boolean {\n return this._map.has(key);\n }\n\n /**\n * Get a list of values by key.\n * @param {string} key -\n * @return {Array.<T>} or null if no suZch key exists.\n */\n get(key: string): Array<T> {\n let list = this._map.get(key);\n // slice() clones the list so that it and the map can each be modified\n // without affecting the other.\n return list ? list.slice() : [];\n }\n\n /**\n * Get a list of all values.\n * @returns {!Array.<T>} -\n */\n getAll(): T[] {\n let list: T[] = [];\n for (var value of this._map.values()) {\n list = list.concat(value);\n }\n return list;\n }\n\n /**\n * Remove a specific value, if it exists.\n * @param {string} key -\n * @param {T} value -\n * @returns {void}\n */\n remove(key: string, value: T): void {\n if (!this._map.has(key)) return;\n let list = this._map.get(key);\n if (Array.isArray(list)) {\n for (let i = 0; i < list.length; ++i) {\n if (list[i] == value) {\n list.splice(i, 1);\n --i;\n }\n }\n }\n }\n\n /**\n * Get all keys from the multimap.\n * @return {!Array.<string>}\n */\n // eslint-disable-next-line no-undef\n keys(): Iterator<string> {\n return this._map.keys();\n }\n\n\n /**\n * Clear all keys and values from the multimap.\n * @returns {void}\n */\n clear(): void {\n this._map.clear();\n }\n}\n\nexport default MultiMap;\n\n\n\n// WEBPACK FOOTER //\n// ./utils/multi-map.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/multi-map.js","module.exports = {\n\t\"name\": \"playkit-js\",\n\t\"version\": \"0.2.0\",\n\t\"main\": \"dist/playkit.js\",\n\t\"scripts\": {\n\t\t\"clean\": \"rm -rf ./dist\",\n\t\t\"prebuild\": \"npm run clean\",\n\t\t\"build:prod\": \"NODE_ENV=production webpack\",\n\t\t\"build\": \"webpack\",\n\t\t\"dev\": \"webpack --progress --colors --watch\",\n\t\t\"test\": \"NODE_ENV=test karma start --color\",\n\t\t\"test:chrome\": \"NODE_ENV=test karma start --color --browsers Chrome\",\n\t\t\"test:chrome:dots\": \"NODE_ENV=test karma start --color --browsers Chrome --reporters dots\",\n\t\t\"test:firefox\": \"NODE_ENV=test karma start --color --browsers Firefox\",\n\t\t\"test:safari\": \"NODE_ENV=test karma start --color --browsers Safari\",\n\t\t\"test:watch\": \"NODE_ENV=test karma start --color --auto-watch\",\n\t\t\"start\": \"webpack-dev-server\",\n\t\t\"release\": \"npm run build:prod && npm run commit:dist && standard-version\",\n\t\t\"publish\": \"git push --follow-tags --no-verify origin develop\",\n\t\t\"eslint\": \"eslint . --color\",\n\t\t\"flow\": \"flow check\",\n\t\t\"eslint:flow:test\": \"npm run eslint && npm run flow && npm run test\",\n\t\t\"commit:dist\": \"git add --all dist && (git commit -m 'chore: update dist' || exit 0)\",\n\t\t\"prepush-msg:build\": \"echo '\\nRunning build before push...\\n' && exit 0\",\n\t\t\"prepush-msg:dist\": \"echo '\\nAdding dist files to a seperate commit...\\n' && exit 0\",\n\t\t\"prepush-msg:done\": \"echo '\\nPre push tasks are done.\\n' && exit 0\"\n\t},\n\t\"pre-push\": [\n\t\t\"prepush-msg:build\",\n\t\t\"prebuild\",\n\t\t\"build\",\n\t\t\"build:prod\",\n\t\t\"prepush-msg:dist\",\n\t\t\"commit:dist\",\n\t\t\"prepush-msg:done\"\n\t],\n\t\"devDependencies\": {\n\t\t\"babel-cli\": \"^6.18.0\",\n\t\t\"babel-core\": \"^6.18.2\",\n\t\t\"babel-eslint\": \"^7.1.1\",\n\t\t\"babel-loader\": \"^6.2.7\",\n\t\t\"babel-plugin-istanbul\": \"^4.0.0\",\n\t\t\"babel-plugin-transform-class-properties\": \"^6.22.0\",\n\t\t\"babel-plugin-transform-flow-strip-types\": \"^6.22.0\",\n\t\t\"babel-preset-es2015\": \"^6.18.0\",\n\t\t\"babel-register\": \"^6.23.0\",\n\t\t\"chai\": \"^3.5.0\",\n\t\t\"cross-env\": \"^3.1.4\",\n\t\t\"eslint\": \"^3.10.0\",\n\t\t\"eslint-loader\": \"^1.6.1\",\n\t\t\"eslint-plugin-flowtype\": \"^2.30.0\",\n\t\t\"eslint-plugin-import\": \"^2.2.0\",\n\t\t\"eslint-plugin-mocha-no-only\": \"^0.0.5\",\n\t\t\"flow-bin\": \"latest\",\n\t\t\"istanbul\": \"^0.4.5\",\n\t\t\"karma\": \"^1.5.0\",\n\t\t\"karma-chai\": \"^0.1.0\",\n\t\t\"karma-chrome-launcher\": \"^2.0.0\",\n\t\t\"karma-cli\": \"^1.0.1\",\n\t\t\"karma-coverage\": \"^1.1.1\",\n\t\t\"karma-firefox-launcher\": \"^1.0.1\",\n\t\t\"karma-ie-launcher\": \"^1.0.0\",\n\t\t\"karma-mocha\": \"^1.3.0\",\n\t\t\"karma-safari-launcher\": \"^1.0.0\",\n\t\t\"karma-sourcemap-loader\": \"^0.3.7\",\n\t\t\"karma-webpack\": \"^2.0.2\",\n\t\t\"mocha\": \"^3.2.0\",\n\t\t\"mocha-cli\": \"^1.0.1\",\n\t\t\"pre-push\": \"^0.1.1\",\n\t\t\"sinon\": \"^2.0.0\",\n\t\t\"sinon-chai\": \"^2.8.0\",\n\t\t\"standard-version\": \"^4.0.0\",\n\t\t\"uglifyjs-webpack-plugin\": \"^0.4.3\",\n\t\t\"webpack\": \"latest\",\n\t\t\"webpack-dev-server\": \"latest\"\n\t},\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/kaltura/playkit-js\"\n\t},\n\t\"keywords\": [\n\t\t\"kaltura\",\n\t\t\"player\",\n\t\t\"html5 player\"\n\t],\n\t\"license\": \"AGPLV3\",\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/kaltura/playkit-js/issues\"\n\t},\n\t\"homepage\": \"https://github.com/kaltura/playkit-js\",\n\t\"dependencies\": {\n\t\t\"js-logger\": \"^1.3.0\"\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../package.json\n// module id = 18\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///package.json","//@flow\nimport FakeEventTarget from '../../event/fake-event-target'\nimport FakeEvent from '../../event/fake-event'\nimport EventManager from '../../event/event-manager'\nimport {HTML5_EVENTS as Html5Events, CUSTOM_EVENTS as CustomEvents} from '../../event/events'\nimport MediaSourceProvider from './media-source/media-source-provider'\nimport VideoTrack from '../../track/video-track'\nimport AudioTrack from '../../track/audio-track'\nimport TextTrack from '../../track/text-track'\n\nexport default class Html5 extends FakeEventTarget implements IEngine {\n /**\n * The video element.\n * @type {HTMLVideoElement}\n * @private\n */\n _el: HTMLVideoElement;\n /**\n * The event manager of the engine.\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * The selected media source adapter of the engine.\n * @type {IMediaSourceAdapter}\n * @private\n */\n _mediaSourceAdapter: ?IMediaSourceAdapter;\n\n /**\n * @type {string} - The engine name.\n */\n static EngineName: string = \"html5\";\n\n /**\n * Checks if the engine can play a given mime type.\n * @param {string} mimeType - The mime type to check.\n * @returns {boolean} - Whether the engine can play the mime type.\n */\n static canPlayType(mimeType) {\n return MediaSourceProvider.canPlayType(mimeType);\n }\n\n /**\n * @constructor\n * @param {Source} source - The selected source object.\n * @param {Object} config - The player configuration.\n */\n constructor(source: Source, config: Object) {\n super();\n this._createVideoElement();\n this._eventManager = new EventManager();\n this._loadMediaSourceAdapter(source, config);\n this.attach();\n }\n\n /**\n * Destroys the engine.\n * @public\n * @returns {void}\n */\n destroy(): void {\n this.detach();\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.destroy();\n }\n if (this._el) {\n this.pause();\n this._el.removeAttribute('src');\n if (this._el.parentNode) {\n this._el.parentNode.removeChild(this._el);\n }\n }\n this._eventManager.destroy();\n }\n\n /**\n * Listen to the video element events and triggers them from the engine.\n * @public\n * @returns {void}\n */\n attach(): void {\n for (let playerEvent in Html5Events) {\n this._eventManager.listen(this._el, Html5Events[playerEvent], () => {\n this.dispatchEvent(new FakeEvent(Html5Events[playerEvent]));\n });\n }\n if (this._mediaSourceAdapter) { // listen and dispatch adaptive bitrate changed event\n this._eventManager.listen(this._mediaSourceAdapter, CustomEvents.VIDEO_TRACK_CHANGED, (event: FakeEvent) => {\n this.dispatchEvent(event);\n });\n this._eventManager.listen(this._mediaSourceAdapter, CustomEvents.AUDIO_TRACK_CHANGED, (event: FakeEvent) => {\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this._mediaSourceAdapter, CustomEvents.TEXT_TRACK_CHANGED, (event: FakeEvent) => {\n return this.dispatchEvent(event);\n });\n }\n }\n\n /**\n * Remove the listeners of the video element events.\n * @public\n * @returns {void}\n */\n detach(): void {\n for (let playerEvent in Html5Events) {\n this._eventManager.unlisten(this._el, Html5Events[playerEvent]);\n }\n if (this._mediaSourceAdapter) { // unlisten to adaptive bitrate changed\n this._eventManager.unlisten(this._mediaSourceAdapter, CustomEvents.VIDEO_TRACK_CHANGED);\n this._eventManager.unlisten(this._mediaSourceAdapter, CustomEvents.AUDIO_TRACK_CHANGED);\n this._eventManager.unlisten(this._mediaSourceAdapter, CustomEvents.TEXT_TRACK_CHANGED);\n }\n }\n\n /**\n * @returns {HTMLVideoElement} - The video element.\n * @public\n */\n getVideoElement(): HTMLVideoElement {\n return this._el;\n }\n\n /**\n * Creates a video element dom object.\n * @private\n * @returns {void}\n */\n _createVideoElement(): void {\n this._el = document.createElement(\"video\");\n //Set attributes\n this._el.style.width = \"640px\";\n this._el.style.height = \"360px\";\n this._el.style.backgroundColor = \"black\";\n this._el.controls = true;\n if (document && document.body) {\n document.body.appendChild(this._el);\n }\n }\n\n /**\n * Loads the appropriate media source extension adapter.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The media source extension configuration.\n * @private\n * @returns {void}\n */\n _loadMediaSourceAdapter(source: Source, config: Object): void {\n this._mediaSourceAdapter = MediaSourceProvider.getMediaSourceAdapter(this.getVideoElement(), source, config);\n }\n\n /**\n * Select a new video track.\n * @param {VideoTrack} videoTrack - The video track object to set.\n * @returns {void}\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectVideoTrack(videoTrack);\n }\n }\n\n /**\n * Select a new audio track.\n * @param {AudioTrack} audioTrack - The video track object to set.\n * @returns {void}\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectAudioTrack(audioTrack);\n }\n }\n\n /**\n * Select a new text track.\n * @param {TextTrack} textTrack - The text track object to set.\n * @returns {void}\n */\n selectTextTrack(textTrack: TextTrack): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectTextTrack(textTrack);\n }\n }\n\n /**\n * Enables adaptive bitrate switching according to the media source extension logic.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.enableAdaptiveBitrate();\n }\n }\n\n /**\n * Set a source.\n * @param {string} source - Source to set.\n * @public\n * @returns {void}\n */\n set src(source: string): void {\n this._el.src = source;\n }\n\n /**\n * Get the source url.\n * @returns {string} - The source url.\n * @public\n */\n get src(): string {\n if (this._mediaSourceAdapter) {\n return this._mediaSourceAdapter.src;\n }\n return \"\";\n }\n\n //playback interface\n /**\n * Start/resume playback.\n * @public\n * @returns {void}\n */\n play(): void {\n return this._el.play();\n }\n\n /**\n * Pause playback.\n * @public\n * @returns {void}\n */\n pause(): void {\n return this._el.pause();\n }\n\n /**\n * Load media.\n * @public\n * @returns {Promise<Object>} - The loaded data\n */\n load(): Promise<Object> {\n return this._mediaSourceAdapter ? this._mediaSourceAdapter.load() : Promise.resolve({});\n }\n\n /**\n * Get the current time in seconds.\n * @returns {Number} - The current playback time.\n * @public\n */\n get currentTime(): number {\n return this._el.currentTime;\n }\n\n /**\n * Set the current time in seconds.\n * @param {Number} to - The number to set in seconds.\n * @public\n * @returns {void}\n */\n set currentTime(to: number): void {\n this._el.currentTime = to;\n }\n\n /**\n * Get the duration in seconds.\n * @returns {Number} - The playback duration.\n * @public\n */\n get duration(): number {\n return this._el.duration;\n }\n\n /**\n * Set playback volume.\n * @param {Number} vol - The volume to set.\n * @public\n * @returns {void}\n */\n set volume(vol: number): void {\n this._el.volume = vol;\n }\n\n /**\n * Get playback volume.\n * @returns {Number} - The volume value of the video element.\n * @public\n */\n get volume(): number {\n return this._el.volume;\n }\n\n ready() {\n }\n\n /**\n * Get paused state.\n * @returns {boolean} - The paused value of the video element.\n * @public\n */\n get paused(): boolean {\n return this._el.paused;\n }\n\n /**\n * Get seeking state.\n * @returns {boolean} - The seeking value of the video element.\n * @public\n */\n get seeking(): boolean {\n return this._el.seeking;\n }\n\n /**\n * Get the first seekable range (part) of the video in seconds.\n * @returns {TimeRanges} - First seekable range (part) of the video in seconds.\n * @public\n */\n get seekable(): TimeRanges {\n return this._el.seekable;\n }\n\n /**\n * Get the first played range (part) of the video in seconds.\n * @returns {TimeRanges} - First played range (part) of the video in seconds.\n * @public\n */\n get played(): TimeRanges {\n return this._el.played;\n }\n\n /**\n * Get the first buffered range (part) of the video in seconds.\n * @returns {TimeRanges} - First buffered range (part) of the video in seconds.\n * @public\n */\n get buffered(): TimeRanges {\n return this._el.buffered;\n }\n\n /**\n * Set player muted state.\n * @param {boolean} mute - The new mute value.\n * @public\n * @returns {void}\n */\n set muted(mute: boolean): void {\n this._el.muted = mute;\n }\n\n /**\n * Get player muted state.\n * @returns {boolean} - The muted value of the video element.\n * @public\n */\n get muted(): boolean {\n return this._el.muted;\n }\n\n /**\n * Get the default mute value.\n * @returns {boolean} - The defaultMuted of the video element.\n * @public\n */\n get defaultMuted(): boolean {\n return this._el.defaultMuted;\n }\n\n /**\n * Sets an image to be shown while the video is downloading, or until the user hits the play button.\n * @param {string} poster - The image url to be shown.\n * @returns {void}\n * @public\n */\n set poster(poster: string): void {\n this._el.poster = poster;\n }\n\n /**\n * Gets an image to be shown while the video is downloading, or until the user hits the play button.\n * @returns {poster} - The image url.\n * @public\n */\n get poster(): string {\n return this._el.poster;\n }\n\n /**\n * Specifies if and how the author thinks that the video should be loaded when the page loads.\n * @param {string} preload - The preload value.\n * @public\n * @returns {void}\n */\n set preload(preload: string): void {\n this._el.preload = preload;\n }\n\n /**\n * Gets the preload value of the video element.\n * @returns {string} - The preload value.\n * @public\n */\n get preload(): string {\n return this._el.preload;\n }\n\n /**\n * Set if the video will automatically start playing as soon as it can do so without stopping.\n * @param {boolean} autoplay - The autoplay value.\n * @public\n * @returns {void}\n */\n set autoplay(autoplay: boolean): void {\n this._el.autoplay = autoplay;\n }\n\n /**\n * Gets the autoplay value of the video element.\n * @returns {boolean} - The autoplay value.\n * @public\n */\n get autoplay(): boolean {\n return this._el.autoplay;\n }\n\n /**\n * Set to specifies that the video will start over again, every time it is finished.\n * @param {boolean} loop - the loop value.\n * @public\n * @returns {void}\n */\n set loop(loop: boolean) {\n this._el.loop = loop;\n }\n\n /**\n * Gets the loop value of the video element.\n * @returns {boolean} - The loop value.\n * @public\n */\n get loop(): boolean {\n return this._el.loop;\n }\n\n /**\n * Set to specifies that video controls should be displayed.\n * @param {boolean} controls - the controls value.\n * @public\n * @returns {void}\n */\n set controls(controls: boolean): void {\n this._el.controls = controls;\n }\n\n /**\n * Gets the controls value of the video element.\n * @returns {boolean} - The controls value.\n * @public\n */\n get controls(): boolean {\n return this._el.controls;\n }\n\n /**\n * Sets the current playback speed of the audio/video.\n * @param {Number} playbackRate - The playback speed value.\n * @public\n * @returns {void}\n */\n set playbackRate(playbackRate: number): void {\n this._el.playbackRate = playbackRate;\n }\n\n /**\n * Gets the current playback speed of the audio/video.\n * @returns {Number} - The current playback speed value.\n * @public\n */\n get playbackRate(): number {\n return this._el.playbackRate;\n }\n\n /**\n * Sets the default playback speed of the audio/video.\n * @param {Number} defaultPlaybackRate - The default playback speed value.\n * @public\n * @returns {void}\n */\n set defaultPlaybackRate(defaultPlaybackRate: number) {\n this._el.defaultPlaybackRate = defaultPlaybackRate;\n }\n\n /**\n * Gets the default playback speed of the audio/video.\n * @returns {Number} - The default playback speed value.\n * @public\n */\n get defaultPlaybackRate(): number {\n return this._el.defaultPlaybackRate;\n }\n\n /**\n * The ended property returns whether the playback of the audio/video has ended.\n * @returns {boolean} - The ended value.\n * @public\n */\n get ended(): boolean {\n return this._el.ended;\n }\n\n /**\n * The error property returns a MediaError object.\n * @returns {MediaError} - The MediaError object has a code property containing the error state of the audio/video.\n * @public\n */\n get error(): ?MediaError {\n return this._el.error;\n }\n\n /**\n * @returns {Number} - The current network state (activity) of the audio/video.\n * @public\n */\n get networkState(): number {\n return this._el.networkState;\n }\n\n /**\n * Indicates if the audio/video is ready to play or not.\n * @returns {Number} - The current ready state of the audio/video.\n * 0 = HAVE_NOTHING - no information whether or not the audio/video is ready.\n * 1 = HAVE_METADATA - metadata for the audio/video is ready.\n * 2 = HAVE_CURRENT_DATA - data for the current playback position is available, but not enough data to play next frame/millisecond.\n * 3 = HAVE_FUTURE_DATA - data for the current and at least the next frame is available.\n * 4 = HAVE_ENOUGH_DATA - enough data available to start playing.\n */\n get readyState(): number {\n return this._el.readyState;\n }\n\n /**\n * @returns {Number} - The height of the video player, in pixels.\n * @public\n */\n get videoHeight(): number {\n return this._el.videoHeight;\n }\n\n /**\n * @returns {Number} - The width of the video player, in pixels.\n * @public\n */\n get videoWidth(): number {\n return this._el.videoWidth;\n }\n\n /**\n * Test video element to check if html5 engine is supported.\n */\n static TEST_VID: HTMLVideoElement;\n\n /**\n * Checks if the html5 engine is supported.\n * @returns {boolean} - The isSupported result.\n * @static\n * @public\n */\n static isSupported() {\n try {\n Html5.TEST_VID = document.createElement('video');\n Html5.TEST_VID.volume = 0.5;\n } catch (e) {\n return false;\n }\n return !!Html5.TEST_VID.canPlayType;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/html5.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/html5.js","//@flow\nimport EventManager from '../../../../event/event-manager'\nimport {HTML5_EVENTS as Html5Events} from '../../../../event/events'\nimport Track from '../../../../track/track'\nimport VideoTrack from '../../../../track/video-track'\nimport AudioTrack from '../../../../track/audio-track'\nimport TextTrack from '../../../../track/text-track'\nimport BaseMediaSourceAdapter from '../base-media-source-adapter'\n\n/**\n * An illustration of media source extension for progressive download\n * @classdesc\n * @implements {IMediaSourceAdapter}\n */\nexport default class NativeAdapter extends BaseMediaSourceAdapter {\n /**\n * The id of the Adapter\n * @member {string} id\n * @static\n * @public\n */\n static id: string = 'NativeAdapter';\n\n /**\n * The adapter logger\n * @member {any} _logger\n * @private\n * @static\n */\n static _logger = BaseMediaSourceAdapter.getLogger(NativeAdapter.id);\n /**\n * The event manager of the class.\n * @member {EventManager} - _eventManager\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n _loadPromise: ?Promise<Object>;\n\n /**\n * Checks if NativeAdapter can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @returns {boolean} - Whether the native adapter can play a specific mime type\n * @static\n */\n static canPlayType(mimeType: string): boolean {\n let canPlayType = (typeof mimeType === 'string') ? !!(document.createElement(\"video\").canPlayType(mimeType.toLowerCase())) : false;\n NativeAdapter._logger.debug('canPlayType result for mimeType:' + mimeType + ' is ' + canPlayType.toString());\n return canPlayType;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to NativeAdapter\n * @param {Source} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n constructor(videoElement: HTMLVideoElement, source: Source, config: Object) {\n NativeAdapter._logger.debug('Creating adapter');\n super(videoElement, source, config);\n this._eventManager = new EventManager();\n }\n\n /**\n * Load the video source\n * @function load\n * @returns {Promise<Object>} - The loaded data\n */\n load(): Promise<Object> {\n if (!this._loadPromise) {\n this._loadPromise = new Promise((resolve, reject) => {\n // We're using 'loadeddata' event for native hls (on 'loadedmetadata' native hls doesn't have tracks yet).\n this._eventManager.listen(this._videoElement, Html5Events.LOADED_DATA, () => {\n this._eventManager.unlisten(this._videoElement, Html5Events.LOADED_DATA);\n let data = {tracks: this._getParsedTracks()};\n NativeAdapter._logger.debug('The source has been loaded successfully');\n resolve(data);\n });\n this._eventManager.listen(this._videoElement, Html5Events.ERROR, (error) => {\n this._eventManager.unlisten(this._videoElement, Html5Events.ERROR);\n NativeAdapter._logger.error(error);\n reject(error);\n });\n if (this._sourceObj && this._sourceObj.url) {\n this._videoElement.src = this._sourceObj.url;\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroys the native adapter.\n * @function destroy\n * @returns {void}\n */\n destroy(): void {\n NativeAdapter._logger.debug('destroy');\n super.destroy();\n this._eventManager.destroy();\n this._loadPromise = null;\n }\n\n /**\n * Get the parsed tracks\n * @function _getParsedTracks\n * @returns {Array<Track>} - The parsed tracks\n * @private\n */\n _getParsedTracks(): Array<Track> {\n let videoTracks = this._getParsedVideoTracks();\n let audioTracks = this._getParsedAudioTracks();\n let textTracks = this._getParsedTextTracks();\n return videoTracks.concat(audioTracks).concat(textTracks);\n }\n\n /**\n * Get the parsed video tracks\n * @function _getParsedVideoTracks\n * @returns {Array<Track>} - The parsed video tracks\n * @private\n */\n _getParsedVideoTracks(): Array<Track> {\n let videoTracks = this._videoElement.videoTracks;\n let parsedTracks = [];\n if (videoTracks) {\n for (let i = 0; i < videoTracks.length; i++) {\n let settings = {\n id: videoTracks[i].id,\n active: videoTracks[i].selected,\n label: videoTracks[i].label,\n language: videoTracks[i].language,\n index: i\n };\n parsedTracks.push(new VideoTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed audio tracks\n * @function _getParsedAudioTracks\n * @returns {Array<Track>} - The parsed audio tracks\n * @private\n */\n _getParsedAudioTracks(): Array<Track> {\n let audioTracks = this._videoElement.audioTracks;\n let parsedTracks = [];\n if (audioTracks) {\n for (let i = 0; i < audioTracks.length; i++) {\n let settings = {\n id: audioTracks[i].id,\n active: audioTracks[i].enabled,\n label: audioTracks[i].label,\n language: audioTracks[i].language,\n index: i\n };\n parsedTracks.push(new AudioTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed text tracks\n * @function _getParsedTextTracks\n * @returns {Array<Track>} - The parsed text tracks\n * @private\n */\n _getParsedTextTracks(): Array<Track> {\n let textTracks = this._videoElement.textTracks;\n let parsedTracks = [];\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n let settings = {\n kind: textTracks[i].kind,\n active: textTracks[i].mode === 'showing',\n label: textTracks[i].label,\n language: textTracks[i].language,\n index: i\n };\n parsedTracks.push(new TextTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Select a video track\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the track to select\n * @returns {void}\n * @public\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n let videoTracks = this._videoElement.videoTracks;\n if ((videoTrack instanceof VideoTrack) && videoTracks && videoTracks[videoTrack.index]) {\n this._disableVideoTracks();\n videoTracks[videoTrack.index].selected = true;\n this._onTrackChanged(videoTrack);\n }\n }\n\n /**\n * Select an audio track\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select\n * @returns {void}\n * @public\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n let audioTracks = this._videoElement.audioTracks;\n if ((audioTrack instanceof AudioTrack) && audioTracks && audioTracks[audioTrack.index]) {\n this._disableAudioTracks();\n audioTracks[audioTrack.index].enabled = true;\n this._onTrackChanged(audioTrack);\n }\n }\n\n /**\n * Select a text track\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select\n * @returns {void}\n * @public\n */\n selectTextTrack(textTrack: TextTrack): void {\n let textTracks = this._videoElement.textTracks;\n if ((textTrack instanceof TextTrack) && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions') && textTracks && textTracks[textTrack.index]) {\n this._disableTextTracks();\n textTracks[textTrack.index].mode = 'showing';\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Enables adaptive bitrate\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n NativeAdapter._logger.debug('Enabling adaptive bitrate not supported');\n }\n\n /**\n * Disables all the existing video tracks.\n * @private\n * @returns {void}\n */\n _disableVideoTracks(): void {\n let videoTracks = this._videoElement.videoTracks;\n if (videoTracks) {\n for (let i = 0; i < videoTracks.length; i++) {\n videoTracks[i].selected = false;\n }\n }\n }\n\n /**\n * Disables all the existing audio tracks.\n * @private\n * @returns {void}\n */\n _disableAudioTracks(): void {\n let audioTracks = this._videoElement.audioTracks;\n if (audioTracks) {\n for (let i = 0; i < audioTracks.length; i++) {\n audioTracks[i].enabled = false;\n }\n }\n }\n\n /**\n * Disables all the existing text tracks.\n * @private\n * @returns {void}\n */\n _disableTextTracks(): void {\n let textTracks = this._videoElement.textTracks;\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n textTracks[i].mode = 'disabled';\n }\n }\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * @public\n * @returns {string} - The src url.\n */\n get src(): string {\n return this._videoElement.src;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/media-source/adapters/native-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/media-source/adapters/native-adapter.js","//@flow\nimport Player from './player'\nimport LoggerFactory from './utils/logger'\nimport * as packageData from '../package.json'\nimport BaseMediaSourceAdapter from './engines/html5/media-source/base-media-source-adapter'\nimport {registerMediaSourceAdapter} from './engines/html5/media-source/media-source-provider'\nimport {registerPlugin} from './plugin/plugin-manager'\nimport BasePlugin from './plugin/base-plugin'\nimport Track from './track/track'\nimport VideoTrack from './track/video-track'\nimport AudioTrack from './track/audio-track'\nimport TextTrack from './track/text-track'\n\n// Playkit version\nlet VERSION = packageData.version;\n\nLoggerFactory.getLogger().log(\"%c Playkit \" + VERSION, \"color: yellow; font-size: large\");\nLoggerFactory.getLogger().log(\"%c For more details see https://github.com/kaltura/playkit-js\", \"color: yellow;\");\n\n/**\n * @param {Object} config - The configuration of the player\n * @returns {Player} - The player instance\n */\nexport function playkit(config: Object = {}) {\n return new Player(config);\n}\n\n// Export the media source adapters necessary utils\nexport {registerMediaSourceAdapter, BaseMediaSourceAdapter};\n\n// Export the plugin framework\nexport {registerPlugin, BasePlugin};\n\n// Export the tracks classes\nexport {Track, VideoTrack, AudioTrack, TextTrack};\n\n//export version\nexport {VERSION};\nexport default playkit;\n\n\n\n// WEBPACK FOOTER //\n// ./playkit.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/playkit.js","//@flow\nimport Player from '../player'\nimport EventManager from '../event/event-manager'\nimport State from './state'\nimport PlayerStates from './state-types'\nimport {HTML5_EVENTS as Html5Events, CUSTOM_EVENTS as CustomEvents} from '../event/events'\nimport FakeEvent from '../event/fake-event'\nimport LoggerFactory from '../utils/logger'\n\n/**\n * Define a transition object.\n */\ntype Transition = {\n [state: string]: {\n [event: string]: Function\n }\n}\n\n/**\n * This class responsible to manage all the state machine of the player.\n * @classdesc\n */\nexport default class StateManager {\n /**\n * The logger of the class.\n * @member\n * @type {any}\n * @private\n */\n _logger: any;\n /**\n * Reference to the actual player.\n * @member\n * @type {Player}\n * @private\n */\n _player: Player;\n /**\n * The event manager of the class.\n * @member\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * Holds the current state of the player.\n * @member\n * @type {State}\n * @private\n */\n _curState: State;\n /**\n * Holds the previous state of the player.\n * @member\n * @type {State | null}\n * @private\n */\n _prevState: State | null;\n /**\n * Holds the state history of the player.\n * @member\n * @type {Array<State>}\n * @private\n */\n _history: Array<State>;\n /**\n * The possible transitions from one state to another.\n * @type {Array<Transition>}\n * @private\n */\n _transitions: Transition = {\n [PlayerStates.IDLE]: {\n [Html5Events.LOAD_START]: () => {\n this._updateState(PlayerStates.LOADING);\n this._dispatchEvent();\n },\n [Html5Events.PLAY]: () => {\n this._updateState(PlayerStates.BUFFERING);\n this._dispatchEvent();\n }\n },\n [PlayerStates.LOADING]: {\n [Html5Events.LOADED_METADATA]: () => {\n if (this._player.config.autoPlay) {\n this._updateState(PlayerStates.PLAYING);\n } else {\n this._updateState(PlayerStates.PAUSED);\n }\n this._dispatchEvent();\n },\n [Html5Events.ERROR]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n }\n },\n [PlayerStates.PAUSED]: {\n [Html5Events.PLAY]: () => {\n this._updateState(PlayerStates.PLAYING);\n this._dispatchEvent();\n },\n [Html5Events.PLAYING]: () => {\n this._updateState(PlayerStates.PLAYING);\n this._dispatchEvent();\n },\n [Html5Events.ENDED]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n }\n },\n [PlayerStates.PLAYING]: {\n [Html5Events.PAUSE]: () => {\n this._updateState(PlayerStates.PAUSED);\n this._dispatchEvent();\n },\n [Html5Events.WAITING]: () => {\n this._updateState(PlayerStates.BUFFERING);\n this._dispatchEvent();\n },\n [Html5Events.ENDED]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n },\n [Html5Events.ERROR]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n }\n },\n [PlayerStates.BUFFERING]: {\n [Html5Events.PLAYING]: () => {\n this._updateState(PlayerStates.PLAYING);\n this._dispatchEvent();\n },\n [Html5Events.PAUSE]: () => {\n this._updateState(PlayerStates.PAUSED);\n this._dispatchEvent();\n }\n }\n };\n\n /**\n * @constructor\n * @param {Player} player - Reference to the player.\n */\n constructor(player: Player) {\n this._player = player;\n this._logger = LoggerFactory.getLogger(\"StateManager\");\n this._eventManager = new EventManager();\n this._history = [];\n this._prevState = null;\n this._curState = new State(PlayerStates.IDLE);\n this._attachListeners();\n }\n\n /**\n * Register to all necessary events which impacts on the player state.\n * @private\n * @returns {void}\n */\n _attachListeners(): void {\n this._eventManager.listen(this._player, Html5Events.ERROR, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.ENDED, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.PLAY, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.LOAD_START, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.PLAYING, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.LOADED_METADATA, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.PAUSE, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.WAITING, this._doTransition.bind(this));\n }\n\n /**\n * Performs a state transition depends on the event which occurs in the player system.\n * @param {FakeEvent} event - The event occurs in the player system.\n * @private\n * @returns {void}\n */\n _doTransition(event: FakeEvent): void {\n this._logger.debug('Do transition request', event);\n let transition = this._transitions[this._curState.type];\n if (typeof transition[event.type] === 'function') {\n transition[event.type]();\n }\n }\n\n /**\n * Updates the player's state.\n * @param {string} type - The type of the new state.\n * @private\n * @returns {void}\n */\n _updateState(type: string): void {\n if (this._curState.type !== type) {\n this._curState.duration = Date.now() / 1000;\n this._history.push(this._curState);\n this._prevState = this._curState;\n this._curState = new State(type);\n this._logger.debug(`Switch player state: from ${this._prevState.type} to ${this._curState.type}`)\n }\n }\n\n /**\n * Fires the playerStateChanged event after state has been changed.\n * @private\n * @returns {void}\n */\n _dispatchEvent(): void {\n let event = new FakeEvent(CustomEvents.PLAYER_STATE_CHANGED, {\n 'oldState': this._prevState,\n 'newState': this._curState\n });\n this._player.dispatchEvent(event);\n }\n\n /**\n * Destroys the state manager.\n * @public\n * @returns {void}\n */\n destroy(): void {\n this._history = [];\n this._eventManager.destroy();\n }\n\n /**\n * Getter to the current state of the player.\n * @public\n * @returns {State} - The current state object\n */\n get currentState(): State {\n return this._curState;\n }\n\n /**\n * Getter to the previous state of the player.\n * @public\n * @returns {State|null} - The previous state object, or null if such doesn't exists\n */\n get previousState(): State | null {\n return this._prevState;\n }\n\n /**\n * Getter to the state history of the player.\n * @public\n * @returns {Array.<State>} - The full states history objects\n */\n get history(): Array<State> {\n return this._history;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./state/state-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/state/state-manager.js","//@flow\n\n/**\n * This class describes a player state.\n * @classdesc\n */\nexport default class State {\n /**\n * The type of the state.\n * Can be one of those describes in states.js\n * @member\n * @type {string}\n * @public\n */\n type: string;\n /**\n * The duration that the player was in this state.\n * @member\n * @type {number}\n * @private\n */\n _duration: number;\n /**\n * The timestamp that this state started.\n * @member\n * @type {number}\n * @private\n */\n _timestamp: number;\n\n /**\n * @constructor\n * @param {string} type - The type of the state.\n */\n constructor(type: string) {\n this.type = type;\n this._duration = 0;\n this._timestamp = Date.now() / 1000;\n }\n\n /**\n * Getter for the duration of the state.\n * @returns {number} - The duration of the state\n */\n get duration(): number {\n return this._duration;\n }\n\n /**\n * Setter for the duration of the state.\n * @param {number} endTime - The timestamp of the next state.\n */\n set duration(endTime: number): void {\n this._duration = endTime - this._timestamp;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./state/state.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/state/state.js","//@flow\nconst TRACK_TYPES: {[track: string]: string} = {\n VIDEO: \"video\",\n AUDIO: \"audio\",\n TEXT: \"text\"\n};\n\nexport default TRACK_TYPES;\n\n\n\n// WEBPACK FOOTER //\n// ./track/track-types.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/track-types.js","/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (typeof define === 'function' && define.amd) {\r\n\t\tdefine(Logger);\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/js-logger/src/logger.js\n// module id = 8\n// module chunks = 0 1\n\n\n// WEBPACK FOOTER //\n// webpack:///~/js-logger/src/logger.js","// @flow\n\n// Import core\nimport * as Playkit from 'playkit-js';\n\n// Import OVP and OTT providers\nimport OvpProvider from 'playkit-js-providers/dist/ovpProvider';\n\n// Import UI\nimport PlaykitUI from 'playkit-js-ui';\nimport '../node_modules/playkit-js-ui/src/styles/style.css';\n\n// Import media source adapters\nimport 'playkit-js-hls';\nimport 'playkit-js-dash';\n\n// TODO: Import plugins\n\nexport {Playkit, OvpProvider, PlaykitUI};\n\n\n\n\n// WEBPACK FOOTER //\n// ./index.js","(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[\"PlaykitJsProviders\"] = factory();\n\telse\n\t\troot[\"PlaykitJsProviders\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 24);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap c25ced737c8594c7041b\n\n\n// WEBPACK FOOTER //\n// webpack:/providers/webpack/bootstrap c25ced737c8594c7041b","//@flow\n\n/**\n * Request builder\n * @classdesc\n */\nexport default class RequestBuilder {\n\n /**\n * @member - Service name\n * @type {string}\n */\n service: string;\n /**\n * @member - Service action\n * @type {string}\n */\n action: string;\n /**\n * @member - Service params\n * @type {any}\n */\n params: any;\n /**\n * @member - Service headers\n * @type {Map<string, string>}\n */\n headers: Map<string, string>;\n /**\n * @member - Service base url\n * @type {Map<string, string>}\n */\n baseUrl: string;\n /**\n * @member - Service method (POST,GET,DELETE etc..)\n * @type {string}\n */\n method: string;\n /**\n * @member - Service tag\n * @type {string}\n */\n tag: string;\n\n /**\n * @constructor\n * @param {Map<string, string>} headers The request headers\n */\n constructor(headers: Map<string, string> = new Map()) {\n this.headers = headers;\n this.headers.set(\"Content-Type\", \"application/json\");\n }\n\n /**\n * Builds restful service URL\n * @function getUrl\n * @returns {string} The service URL\n */\n getUrl(): string {\n if (!this.baseUrl) {\n throw new Error(\"baseUrl is mandatory for request builder\");\n }\n let url = this.baseUrl + '/service/' + this.service + (this.action ? '/action/' + this.action : '');\n return url;\n }\n\n /**\n * Executes service\n * @function doHttpRequest\n * @returns {Promise.<any>} Service response as promise\n */\n doHttpRequest(): Promise<any> {\n let request = new XMLHttpRequest();\n return new Promise((resolve, reject) => {\n request.onreadystatechange = function () {\n if (request.readyState === 4) {\n if (request.status === 200) {\n let jsonResponse = JSON.parse(request.responseText);\n if (jsonResponse && typeof(jsonResponse) === 'object' && jsonResponse.code && jsonResponse.message)\n reject(jsonResponse);\n else\n resolve(jsonResponse);\n } else {\n reject(request.responseText);\n }\n }\n };\n request.open(this.method, this.getUrl());\n this.headers.forEach((value, key) => {\n request.setRequestHeader(key, value);\n });\n request.send(this.params);\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/request-builder.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/request-builder.js","//@flow\n\nconst defaultConfig: Object = {\n beUrl: \"http://www.kaltura.com/api_v3\",\n baseUrl: \"https://cdnapisec.kaltura.com\",\n serviceParams: {\n clientTag: \"playkit-js\",\n apiVersion: '3.3.0',\n format: 1\n }\n};\n\nexport default class Configuration {\n\n static set(clientConfig?: Object) {\n if (clientConfig) {\n Object.assign(defaultConfig, clientConfig);\n }\n }\n\n static get(): Object {\n return defaultConfig;\n }\n}\n\nexport {Configuration};\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/config.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/config.js","//@flow\n\nimport {Enum} from 'enumify';\n\nexport class Scheme extends Enum {\n}\nScheme.initEnum({\n PLAYREADY_CENC: \"drm.PLAYREADY_CENC\",\n WIDEVINE_CENC: \"drm.WIDEVINE_CENC\",\n FAIRPLAY: \"fairplay.FAIRPLAY\",\n PLAYREADY: \"playReady.PLAYREADY\",\n WIDEVINE: \"widevine.WIDEVINE\"\n});\n\n\nexport class KalturaRuleActionType extends Enum {\n}\nKalturaRuleActionType.initEnum({\n DRM_POLICY: \"drm.DRM_POLICY\",\n BLOCK: 1,\n PREVIEW: 2,\n LIMIT_FLAVORS: 3,\n ADD_TO_STORAGE: 4,\n LIMIT_DELIVERY_PROFILES: 5,\n SERVE_FROM_REMOTE_SERVER: 6,\n REQUEST_HOST_REGEX: 7,\n LIMIT_THUMBNAIL_CAPTURE: 8\n});\n\nexport class Status extends Enum {\n}\nStatus.initEnum({\n ERROR: -1,\n QUEUED: 0,\n CONVERTING: 1,\n READY: 2,\n DELETED: 3,\n NOT_APPLICABLE: 4,\n TEMP: 5,\n WAIT_FOR_CONVERT: 6,\n IMPORTING: 7,\n VALIDATING: 8,\n EXPORTING: 9\n});\n\nexport class MetadataObjectType extends Enum {\n}\nMetadataObjectType.initEnum({\n AD_CUE_POINT: \"adCuePointMetadata.AdCuePoint\",\n ANNOTATION: \"annotationMetadata.Annotation\",\n CODE_CUE_POINT: \"codeCuePointMetadata.CodeCuePoint\",\n THUMB_CUE_POINT: \"thumbCuePointMetadata.thumbCuePoint\",\n ENTRY: 1,\n CATEGORY: 2,\n USER: 3,\n PARTNER: 4,\n DYNAMIC_OBJECT: 5\n});\n\nexport class MetadataStatus extends Enum {\n}\nMetadataStatus.initEnum({\n VALID: 1,\n INVALID: 2,\n DELETED: 3\n});\n\n\nexport class EntryStatus extends Enum {\n}\nEntryStatus.initEnum({\n ERROR_IMPORTING: -2,\n ERROR_CONVERTING: -1,\n SCAN_FAILURE: \"virusScan.ScanFailure\",\n IMPORT: 0,\n INFECTED: \"virusScan.Infected\",\n PRECONVERT: 1,\n READY: 2,\n DELETED: 3,\n PENDING: 4,\n MODERATE: 5,\n BLOCKED: 6,\n NO_CONTENT: 7\n});\n\nexport class EntryModerationStatus extends Enum {\n}\nEntryModerationStatus.initEnum({\n PENDING_MODERATION: 1,\n APPROVED: 2,\n REJECTED: 3,\n FLAGGED_FOR_REVIEW: 4,\n MODERATE: 5,\n AUTO_APPROVED: 6\n});\n\nexport class EntryType extends Enum {\n}\nEntryType.initEnum({\n AUTOMATIC: {value: -1},\n EXTERNAL_MEDIA: {value: \"externalMedia.externalMedia\"},\n MEDIA_CLIP: {value: 1},\n MIX: {value: 2},\n PLAYLIST: {value: 5},\n DATA: {value: 6},\n LIVE_STREAM: {value: 7},\n LIVE_CHANNEL: {value: 8},\n DOCUMENT: {value: 10}\n});\n\nexport class MediaType extends Enum {\n}\nMediaType.initEnum({\n VIDEO: {value: 1},\n IMAGE: {value: 2},\n AUDIO: {value: 5},\n LIVE_STREAM_FLASH: {value: 201},\n LIVE_STREAM_WINDOWS_MEDIA: {value: 202},\n LIVE_STREAM_REAL_MEDIA: {value: 203},\n LIVE_STREAM_QUICKTIME: {value: 204}\n});\n\n\nexport class MediaEntryType extends Enum {\n}\nMediaEntryType.initEnum(['Vod', 'Live', 'Image', 'Audio', 'Unknown']);\n\nexport class UIConfType extends Enum {\n}\nUIConfType.initEnum({\n PLAYER: 1,\n CONTRIBUTION_WIZARD: 2,\n SIMPLE_EDITOR: 3,\n ADVANCED_EDITOR: 4,\n PLAYLIST: 5,\n APP_STUDIO: 6,\n KRECORD: 7,\n PLAYER_V3: 8,\n KMC_ACCOUNT: 9,\n KMC_ANALYTICS: 10,\n KMC_CONTENT: 11,\n KMC_DASHBOARD: 12,\n KMC_LOGIN: 13,\n PLAYER_SL: 14,\n CLIENTSIDE_ENCODER: 15,\n KMC_GENERAL: 16,\n KMC_ROLES_AND_PERMISSIONS: 17,\n CLIPPER: 18,\n KSR: 19,\n KUPLOAD: 20,\n WEBCASTING: 21\n});\n\nexport class UIConfCreationMode extends Enum {\n}\nUIConfCreationMode.initEnum({\n WIZARD: 2,\n ADVANCED: 3\n});\n\n\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/enums.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/enums.js","//@flow\nimport MultiRequestBuilder from '../../multi-request-builder'\nimport Configuration from '../config'\n\nconst config = Configuration.get();\nconst SERVICE_NAME: string = \"multirequest\";\n\n/**\n * Base for all ovp services\n * @classdesc\n */\nexport default class OvpService {\n /**\n * Gets a new instance of MultiRequestBuilder with ovp params\n * @function getMultirequest\n * @param {string} ks The ks\n * @param {string} partnerId The partner ID\n * @returns {MultiRequestBuilder} The multi request builder\n * @static\n */\n static getMultirequest(ks: string, partnerId?: number): MultiRequestBuilder {\n let ovpParams = config.serviceParams;\n Object.assign(ovpParams, {ks: ks});\n if (partnerId) {\n Object.assign(ovpParams, {partnerId: partnerId});\n }\n let multiReq = new MultiRequestBuilder();\n multiReq.method = \"POST\";\n multiReq.service = SERVICE_NAME;\n multiReq.baseUrl = config.beUrl;\n multiReq.params = ovpParams;\n return multiReq;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/ovp-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/ovp-service.js","//@flow\n\n/**\n * Base service result\n * @classdesc\n */\nexport default class ServiceResult {\n\n /**\n * @member - Is service returned an error\n * @type {boolean}\n */\n hasError: boolean = false;\n /**\n * @member - The service error\n * @type {ServiceError}\n */\n error: ServiceError;\n /**\n * @member - The service result data\n * @type {Object}\n */\n data: Object;\n\n /**\n * @constructor\n * @param {Object} response - Service response\n */\n constructor(response: Object) {\n if (response.objectType === \"KalturaAPIException\") {\n this.hasError = true;\n this.error = new ServiceError(response.code, response.message);\n }\n else {\n this.data = response;\n }\n }\n}\n\n/**\n * Service error\n * @classdesc\n */\nclass ServiceError {\n /**\n * @member - The error code\n * @type {string}\n */\n code: string;\n /**\n * @member - The error message\n * @type {string}\n */\n message: string;\n\n /**\n * @constructor\n * @param {string} code - The result code\n * @param {string} message - The result message\n */\n constructor(code: string, message: string) {\n this.code = code;\n this.message = message;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/base-service-result.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/base-service-result.js","//@flow\nimport * as JsLogger from 'js-logger';\n\nclass LoggerFactory {\n constructor(options?: Object) {\n JsLogger.useDefaults(options || {});\n }\n\n get(name?: string) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n}\n\nlet Logger = new LoggerFactory({defaultLevel: JsLogger.DEBUG});\nconst LOG_LEVEL: {[level: string]: Object} = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nexport default Logger;\nexport {LOG_LEVEL};\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./util/logger.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/util/logger.js","//@flow\nimport RequestBuilder from './request-builder'\nimport ServiceResult from './base-service-result'\nimport Logger from \"../util/logger\";\n/**\n * @constant\n */\nconst logger = Logger.get(\"OvpProvider\");\n\n/**\n * Multi Request builder\n * @classdesc\n */\nexport default class MultiRequestBuilder extends RequestBuilder {\n\n /**\n * @member - Array of requests\n * @type {Array<RequestBuilder>}\n */\n requests: Array<RequestBuilder> = [];\n\n /**\n * @constructor\n */\n constructor() {\n super();\n }\n\n /**\n * Adds request to requests array\n * @function add\n * @param {RequestBuilder} request The request\n * @returns {MultiRequestBuilder} The multiRequest\n */\n add(request: RequestBuilder): MultiRequestBuilder {\n this.requests.push(request);\n let requestParams = {};\n let serviceDef: Object = {service: request.service, action: request.action};\n Object.assign(requestParams, {[this.requests.length]: Object.assign(serviceDef, request.params)});\n Object.assign(requestParams, this.params);\n this.params = requestParams;\n return this;\n }\n\n /**\n * Executes a multi request\n * @function execute\n * @returns {Promise} The multirequest execution promisie\n */\n execute(): Promise<Object> {\n try {\n this.params = JSON.stringify(this.params);\n }\n catch (err) {\n logger.error(`${err.message}`);\n }\n return new Promise((resolve, reject) => {\n this.doHttpRequest().then(data => {\n resolve(new MultiRequestResult(data));\n },\n err => {\n let errorText: string = `Error on multiRequest execution, error <${err}>.`;\n reject(errorText);\n\n });\n });\n }\n\n}\n\n/**\n * Multi Request result object\n * @classdesc\n */\nexport class MultiRequestResult {\n\n /**\n * @member - Is success\n * @type {boolean}\n */\n success: boolean;\n /**\n * @member - Multi request response data\n * @type {Object}\n */\n results: Array<ServiceResult> = [];\n\n /**\n * @constructor\n * @param {Object} response data\n */\n constructor(response: Object) {\n this.success = true;\n response.forEach((result) => {\n let serviceResult: ServiceResult = new ServiceResult(result);\n this.results.push(serviceResult);\n if (serviceResult.hasError) {\n logger.error(`Service returned an error with error code: ${serviceResult.error.code} and message: ${serviceResult.error.message}.`);\n this.success = false;\n return;\n }\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/multi-request-builder.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/multi-request-builder.js","//@flow\nimport Drm from '../entities/drm'\n\n/**\n * Media source\n * @classdesc\n */\nexport default class MediaSource {\n /**\n * @member - media source ID\n * @type {string}\n */\n id: string;\n /**\n * @member - media source URL\n * @type {string}\n */\n url: string;\n /**\n * @member - media source mimetype\n * @type {string}\n */\n mimetype: string;\n /**\n * @member - media source drm data\n * @type {Array<Drm>}\n */\n drmData: Array<Drm>;\n\n /**\n * @constructor\n */\n constructor(){}\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-source.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-source.js","//@flow\nimport MediaSource from './media-source'\nimport {MediaEntryType} from '../k-provider/enums'\n\n/**\n * Media entry\n * @classdesc\n */\nexport default class MediaEntry {\n\n /**\n * @member - entry ID\n * @type {string}\n */\n id: string;\n /**\n * @member - entry sources\n * @type {Array<MediaSource>}\n */\n sources: Array<MediaSource>;\n /**\n * @member - entry duration\n * @type {number}\n */\n duration: number;\n /**\n * @member - entry type\n * @type {MediaEntryType}\n */\n type: MediaEntryType;\n /**\n * @member - entry metadata\n * @type {Map<string,string>}\n */\n metaData: Map<string,string>;\n\n /**\n * @constructor\n */\n constructor() {\n this.metaData = new Map();\n this.type = MediaEntryType.Unknown;\n }\n\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-entry.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-entry.js","//@flow\n\nimport {Scheme} from '../k-provider/enums';\n\n/**\n * Drm data\n * @classdesc\n */\nexport default class Drm {\n\n /**\n * @member - license URL\n * @type {string}\n */\n licenseUrl: string;\n /**\n * @member - drm scheme\n * @type {Scheme}\n */\n scheme: Scheme;\n\n /**\n * @constructor\n * @param {string} licenseUrl - the license URL\n * @param {Scheme} scheme - the drm scheme\n */\n constructor(licenseUrl: string, scheme: Scheme) {\n this.licenseUrl = licenseUrl;\n this.scheme = scheme;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./entities/drm.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/drm.js","//@flow\nimport {Status} from '../../enums'\n\n/**\n * Ovp BE FlavorAsset\n * @classdesc\n */\nexport default class KalturaFlavorAsset {\n /**\n * @member - The ID of the Flavor Asset\n * @type {string}\n */\n id: string;\n /**\n * @member -The Flavor Params used to create this Flavor Asset\n * @type {string}\n */\n flavorParamsId: string;\n /**\n * @member -The file extension\n * @type {string}\n */\n fileExt: string;\n /**\n * @member - The overall bitrate (in KBits) of the Flavor Asset\n * @type {string}\n */\n bitrate: number;\n /**\n * @member - The width of the Flavor Asset\n * @type {number}\n */\n width: number;\n /**\n * @member - The height of the Flavor Asset\n * @type {number}\n */\n height: number;\n /**\n * @member - The frame rate (in FPS) of the Flavor Asset\n * @type {number}\n */\n frameRate: number;\n /**\n * @member - True if this Flavor Asset is the original source\n * @type {number}\n */\n isOriginal: boolean;\n /**\n * @member - True if this Flavor Asset is playable in KDP\n * @type {boolean}\n */\n isWeb: boolean;\n /**\n * @member - The container format\n * @type {boolean}\n */\n containerFormat: string;\n /**\n *@member - The video codec\n * @type {boolean}\n */\n videoCodecId: string;\n /**\n * @member - The status of the Flavor Asset\n * @type {string}\n */\n status: Status;\n /**\n * @member - The language of the flavor asset\n * @type {Status}\n */\n language: string;\n /**\n * @member - The label of the flavor asset\n * @type {string}\n */\n label: string;\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n constructor(data: any) {\n this.id = data.id;\n this.flavorParamsId = data.flavorParamsId;\n this.fileExt = data.fileExt;\n this.bitrate = data.bitrate;\n this.width = data.width;\n this.height = data.height;\n this.id = data.id;\n this.frameRate = data.frameRate;\n this.isOriginal = data.isOriginal;\n this.isWeb = data.isWeb;\n this.containerFormat = data.containerFormat;\n this.videoCodecId = data.videoCodecId;\n this.status = data.status;\n this.language = data.language;\n this.label = data.label;\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-flavor-asset.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-flavor-asset.js","//@flow\nimport {EntryType, MediaType} from '../../enums'\n\n/**\n * Ovp BE MediaEntry\n * @classdesc\n */\nexport default class KalturaMediaEntry {\n /**\n * @member - The entry id\n * @type {string}\n */\n id: string;\n /**\n * @member - Entry name (Min 1 chars)\n * @type {string}\n */\n name: string;\n /**\n * @member - The URL used for playback. This is not the download URL.\n * @type {string}\n */\n dataUrl: string;\n /**\n * @member - Comma separated flavor params ids that exists for this media entry\n * @type {string}\n */\n flavorParamsIds: string;\n /**\n * @member - The entry duration\n * @type {number}\n */\n duration: number;\n /**\n * @member - The type of the entry, this is auto filled by the derived entry object\n * @type {EntryType}\n */\n type: EntryType;\n /**\n * @member - The type of the entry, this is auto filled by the derived entry object (Image, Audio etc.)\n * @type {MediaType}\n */\n entryType: MediaType;\n\n /**\n * @constructor\n * @param {Object} entry The json response\n */\n constructor(entry: Object) {\n this.id = entry.id;\n this.name = entry.name;\n this.dataUrl = entry.dataUrl;\n this.type = entry.type;\n this.entryType = entry.mediaType;\n this.flavorParamsIds = entry.flavorParamsIds;\n this.duration = entry.duration;\n }\n}\n\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-media-entry.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-media-entry.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport KalturaMetadata from './kaltura-metadata'\n\n/**\n * Ovp BE Metadata list response\n * @classdesc\n */\nexport default class KalturaMetadataListResponse extends ServiceResult {\n totalCount: number;\n /**\n * @member -The mata data array\n * @type {Array<KalturaMetadata>}\n */\n metas: Array<KalturaMetadata>;\n\n /**\n * @constructor\n * @param {Object} responseObj The response\n */\n constructor(responseObj: Object) {\n super(responseObj);\n if (!this.hasError) {\n this.totalCount = responseObj.totalCount;\n if (this.totalCount > 0) {\n this.metas = [];\n responseObj.objects.map(meta => this.metas.push(new KalturaMetadata(meta)));\n }\n\n }\n }\n}\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-metadata-list-response.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-metadata-list-response.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport KalturaAccessControlMessage from './kaltura-access-control-message'\nimport KalturaPlaybackSource from './kaltura-playback-source'\nimport KalturaRuleAction from './kaltura-rule-action'\nimport KalturaFlavorAsset from './kaltura-flavor-asset'\n\n/**\n * Ovp BE playback context response\n * @classdesc\n */\nexport default class KalturaPlaybackContext extends ServiceResult {\n /**\n * @member - The playback sources\n * @type {Array<KalturaPlaybackSource>}\n */\n sources: Array<KalturaPlaybackSource> = [];\n /**\n * @member - Array of actions as received from the rules that invalidated\n * @type {Array<KalturaRuleAction>}\n */\n actions: Array<KalturaRuleAction> = [];\n /**\n * @member - Array of actions as received from the rules that invalidated\n * @type {Array<KalturaAccessControlMessage>}\n */\n messages: Array<KalturaAccessControlMessage> = [];\n /**\n * @member - The flavor assets\n * @type {Array<KalturaFlavorAsset>}\n */\n flavorAssets: Array<KalturaFlavorAsset> = [];\n\n /**\n * @constructor\n * @param {Object} response The response\n */\n constructor(response: Object) {\n super(response);\n if (!this.hasError) {\n\n let messages = response.messages;\n if (messages) {\n messages.map(message => this.messages.push(new KalturaAccessControlMessage(message)));\n }\n\n let actions = response.actions;\n if (actions) {\n actions.map(action => this.actions.push(new KalturaRuleAction(action)));\n }\n\n let sources = response.sources;\n if (sources) {\n sources.map(source => this.sources.push(new KalturaPlaybackSource(source)));\n }\n\n let flavorAssets = response.flavorAssets;\n if (flavorAssets) {\n flavorAssets.map(flavor => this.flavorAssets.push(new KalturaFlavorAsset(flavor)));\n }\n }\n\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-playback-context.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-playback-context.js","//@flow\nimport KalturaDrmPlaybackPluginData from './kaltura-drm-playback-plugin-data'\n\n/**\n * Ovp BE playback source\n * @classdesc\n */\nexport default class KalturaPlaybackSource {\n /**\n * @member - source format according to delivery profile streamer type (applehttp, mpegdash etc.)\n * @type {string}\n */\n format: string;\n /**\n * @member - delivery profile Id\n * @type {string}\n */\n deliveryProfileId: string;\n /**\n * @member - The source URL\n * @type {string}\n */\n url: string;\n /**\n * @member - comma separated string according to deliveryProfile media protocols ('http,https' etc.)\n * @type {string}\n */\n protocols: string;\n /**\n * @member - comma separated string of flavor ids\n * @type {string}\n */\n flavorIds: string;\n /**\n * @member - drm data object containing relevant license url ,scheme name and certificate\n * @type {Array<KalturaDrmPlaybackPluginData>}\n */\n drm: Array<KalturaDrmPlaybackPluginData> = [];\n\n /**\n * @constructor\n * @param {Object} source The response\n */\n constructor(source: Object) {\n this.format = source.format;\n this.deliveryProfileId = source.deliveryProfileId;\n this.url = source.url;\n this.protocols = source.protocols;\n this.flavorIds = source.flavorIds;\n\n if (source.drm) {\n source.drm.map(drm => this.drm.push(new KalturaDrmPlaybackPluginData(drm)));\n }\n\n\n }\n\n /**\n * Checks if source has DRM data\n * @function hasDrmData\n * @returns {boolean} Is source has DRM\n */\n hasDrmData(): boolean {\n return this.drm && this.drm.length > 0;\n }\n\n /**\n * Checks if source has flavor IDs\n * @function hasFlavorIds\n * @returns {boolean} Is source ha flavor IDs\n */\n hasFlavorIds(): boolean {\n return !!this.flavorIds && this.flavorIds.length > 0;\n }\n\n /**\n * Returns source desired protocol if supported\n * @param {string} protocol - the desired protocol for the source (base play url protocol)\n * @returns {string} - protocol if protocol is in the protocols list - if not empty string returned\n */\n getProtocol(protocol: string): string {\n let returnValue: string = \"\";\n if (this.protocols && this.protocols.length > 0) {\n let protocolsArr: Array<string> = this.protocols.split(\",\");\n protocolsArr.forEach((p) => {\n if (p == protocol) {\n returnValue = p;\n }\n });\n }\n else if (protocol == \"http\") {\n return protocol;\n }\n return returnValue;\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-playback-source.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-playback-source.js","'use strict';\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\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.copyProperties = copyProperties;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar INITIALIZED = Symbol();\n\n/**\n * This is an abstract class that is not intended to be\n * used directly. Extend it to turn your class into an enum\n * (initialization is performed via `MyClass.initEnum()`).\n */\n\nvar Enum = exports.Enum = function () {\n /**\n * `initEnum()` closes the class. Then calling this constructor\n * throws an exception.\n * \n * If your subclass has a constructor then you can control\n * what properties are added to `this` via the argument you\n * pass to `super()`. No arguments are fine, too.\n */\n\n function Enum() {\n var instanceProperties = arguments.length <= 0 || arguments[0] === undefined ? undefined : arguments[0];\n\n _classCallCheck(this, Enum);\n\n // new.target would be better than this.constructor,\n // but isn’t supported by Babel\n if ({}.hasOwnProperty.call(this.constructor, INITIALIZED)) {\n throw new Error('Enum classes can’t be instantiated');\n }\n if ((typeof instanceProperties === 'undefined' ? 'undefined' : _typeof(instanceProperties)) === 'object' && instanceProperties !== null) {\n copyProperties(this, instanceProperties);\n }\n }\n /**\n * Set up the enum, close the class.\n * \n * @param arg Either an object whose properties provide the names\n * and values (which must be mutable objects) of the enum constants.\n * Or an Array whose elements are used as the names of the enum constants\n * The values are create by instantiating the current class.\n */\n\n _createClass(Enum, [{\n key: 'toString',\n\n /**\n * Default `toString()` method for enum constant.\n */\n value: function toString() {\n return this.constructor.name + '.' + this.name;\n }\n }], [{\n key: 'initEnum',\n value: function initEnum(arg) {\n Object.defineProperty(this, 'enumValues', {\n value: [],\n configurable: false,\n writable: false,\n enumerable: true\n });\n if (Array.isArray(arg)) {\n this._enumValuesFromArray(arg);\n } else {\n this._enumValuesFromObject(arg);\n }\n Object.freeze(this.enumValues);\n this[INITIALIZED] = true;\n return this;\n }\n }, {\n key: '_enumValuesFromArray',\n value: function _enumValuesFromArray(arr) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = arr[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n\n this._pushEnumValue(new this(), key);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n }, {\n key: '_enumValuesFromObject',\n value: function _enumValuesFromObject(obj) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = Object.keys(obj)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n\n var value = new this(obj[key]);\n this._pushEnumValue(value, key);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n }, {\n key: '_pushEnumValue',\n value: function _pushEnumValue(enumValue, name) {\n enumValue.name = name;\n enumValue.ordinal = this.enumValues.length;\n Object.defineProperty(this, name, {\n value: enumValue,\n configurable: false,\n writable: false,\n enumerable: true\n });\n this.enumValues.push(enumValue);\n }\n\n /**\n * Given the name of an enum constant, return its value.\n */\n\n }, {\n key: 'enumValueOf',\n value: function enumValueOf(name) {\n return this.enumValues.find(function (x) {\n return x.name === name;\n });\n }\n\n /**\n * Make enum classes iterable\n */\n\n }, {\n key: Symbol.iterator,\n value: function value() {\n return this.enumValues[Symbol.iterator]();\n }\n }]);\n\n return Enum;\n}();\n\nfunction copyProperties(target, source) {\n // Ideally, we’d use Reflect.ownKeys() here,\n // but I don’t want to depend on a polyfill\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = Object.getOwnPropertyNames(source)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var key = _step3.value;\n\n var desc = Object.getOwnPropertyDescriptor(source, key);\n Object.defineProperty(target, key, desc);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return target;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/enumify/lib/enumify.js\n// module id = 16\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///~/enumify/lib/enumify.js","//@flow\nimport OvpService from '../services/ovp-service'\nimport MultiRequestBuilder from '../../multi-request-builder'\nimport {MultiRequestResult} from '../../multi-request-builder'\n\n/**\n * Data loaders manager\n * @classdesc\n */\nexport default class DataLoaderManager {\n /**\n * @member - Lodaers response map index\n * @type {Map<string,Array<number>>}\n * @private\n * @static\n */\n static _loadersResponseMap: Map<string, Array<number>> = new Map();\n /**\n * @member - Loaders multi request\n * @type {MultiRequestBuilder}\n * @private\n */\n _multiRequest: MultiRequestBuilder;\n /**\n * @member - Loaders multi response\n * @type {MultiRequestResult}\n * @private\n */\n _multiResponse: MultiRequestResult;\n /**\n * @member - Loaders to execute\n * @type {Map<string,Function>}\n * @private\n */\n _loaders: Map<string, ILoader> = new Map();\n\n /**\n * @constructor\n * @param {string} partnerID Then partner ID\n * @param {string} ks The ks\n */\n constructor(partnerID: number, ks: string = \"\") {\n this._multiRequest = OvpService.getMultirequest(ks, partnerID);\n }\n\n /**\n * Add loader too execution loaders map\n * @function\n * @param {Function} loader Loader to add\n * @param {Object} params Loader params\n * @returns {void}\n */\n add(loader: typeof ILoader, params: Object): void {\n let execution_loader = new loader(params);\n if (execution_loader.isValid()) {\n this._loaders.set(loader.name, execution_loader);\n //Get the start index from the multiReqeust before adding current execution_loader requests\n let startIndex = this._multiRequest.requests.length;\n //Get the requests\n let requests = execution_loader.requests;\n //Add requests to muktiRequest queue\n requests.forEach((request) => {\n this._multiRequest.add(request);\n });\n //Create range array of current execution_loader requests\n let executionLoaderResponseMap = Array.from(new Array(requests.length), (val, index) => index + startIndex);\n //Add to map\n DataLoaderManager._loadersResponseMap.set(loader.name, executionLoaderResponseMap);\n }\n }\n\n /**\n * Get data from all loaders using multi request\n * @function\n * @returns {Promise} Promise\n */\n fetchData(): Promise<any> {\n return new Promise((resolve, reject) => {\n this._multiRequest.execute()\n .then(response => {\n this._multiResponse = response;\n if (!response.success) {\n reject(response);\n }\n else {\n let preparedData: Object = this.prepareData(response);\n if (preparedData.success) {\n resolve(this._loaders);\n }\n else {\n reject({success: false, data: preparedData.error});\n }\n }\n },\n err => {\n reject(err);\n });\n });\n }\n\n prepareData(response: MultiRequestResult): Object {\n this._loaders.forEach(function (loader, name) {\n let loaderDataIndexes = DataLoaderManager._loadersResponseMap.get(name);\n try {\n if (loaderDataIndexes != null) {\n loader.response = (response.results.slice(loaderDataIndexes[0], loaderDataIndexes[loaderDataIndexes.length - 1] + 1));\n }\n }\n catch (err) {\n return {success: false, error: err};\n }\n });\n return {success: true, data: this._loaders};\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/data-loader-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/data-loader-manager.js","//@flow\n\nimport RequestBuilder from '../../request-builder'\nimport BaseEntryService from '../services/base-entry-service'\nimport MetaDataService from '../services/meta-data-service'\nimport Configuration from '../config'\nimport KalturaPlaybackContext from '../response-types/kaltura-playback-context'\nimport KalturaMetadataListResponse from '../response-types/kaltura-metadata-list-response'\nimport KalturaBaseEntryListResponse from '../response-types/kaltura-base-entry-list-response'\n\nconst config = Configuration.get();\n\n/**\n * Media entry loader\n * @classdesc\n */\nexport default class MediaEntryLoader implements ILoader {\n static get name(): string {\n return \"media\";\n }\n\n _entryId: string;\n _requests: Array<RequestBuilder>;\n _response: any = {};\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n constructor(params: Object) {\n this.requests = this.buildRequests(params);\n this._entryId = params.entryId;\n }\n\n set requests(requests: Array<RequestBuilder>) {\n this._requests = requests;\n }\n\n get requests(): Array<RequestBuilder> {\n return this._requests;\n }\n\n set response(response: any) {\n let mediaEntryResponse: KalturaBaseEntryListResponse = new KalturaBaseEntryListResponse(response[0].data);\n this._response.entry = mediaEntryResponse.entries[0];\n this._response.playBackContextResult = new KalturaPlaybackContext(response[1].data);\n this._response.metadataListResult = new KalturaMetadataListResponse(response[2].data);\n }\n\n get response(): any {\n return this._response;\n }\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n buildRequests(params: Object): Array<RequestBuilder> {\n let requests: Array<RequestBuilder> = [];\n requests.push(BaseEntryService.list(config.beUrl, params.ks, params.entryId));\n requests.push(BaseEntryService.getPlaybackContext(config.beUrl, params.ks, params.entryId));\n requests.push(MetaDataService.list(config.beUrl, params.ks, params.entryId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n isValid(): boolean {\n return !!this._entryId;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/media-entry-loader.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/media-entry-loader.js","//@flow\nimport SessionService from '../services/session-service'\nimport Configuration from '../config'\nimport RequestBuilder from '../../request-builder'\n\nconst config = Configuration.get();\n/**\n * Media entry loader\n * @classdesc\n */\nexport default class SessionLoader implements ILoader {\n static get name(): string {\n return \"session\";\n }\n\n /**\n * @member - partner ID\n * @type {number}\n * @private\n */\n _partnerId: number;\n _requests: Array<RequestBuilder>;\n _response: any = {};\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n constructor(params: Object) {\n this.requests = this.buildRequests(params);\n this._partnerId = params.partnerId;\n }\n\n set requests(requests: Array<RequestBuilder>) {\n this._requests = requests;\n }\n\n get requests(): Array<RequestBuilder> {\n return this._requests;\n }\n\n set response(response: any) {\n this._response.ks = response[0].data.ks;\n }\n\n get response(): any {\n return this._response.ks;\n }\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n buildRequests(params: Object): Array<RequestBuilder> {\n let requests: Array<RequestBuilder> = [];\n requests.push(SessionService.anonymousSession(config.beUrl, params.partnerId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n isValid(): boolean {\n return !!this._partnerId;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/session-loader.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/session-loader.js","//@flow\nimport UiConfService from '../services/ui-conf-service'\nimport KalturaUiConfResponse from '../response-types/kalturaUIConfResponse'\nimport Configuration from '../config'\nimport RequestBuilder from '../../request-builder'\n\nconst config = Configuration.get();\n\nexport default class UiConfigLoader implements ILoader {\n static get name(): string {\n return \"uiConf\";\n }\n\n /**\n * @member - uiConf ID\n * @type {number}\n * @private\n */\n _uiConfId: number;\n _requests: Array<RequestBuilder>;\n _response: any = {};\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n constructor(params: Object) {\n this.requests = this.buildRequests(params);\n this._uiConfId = params.uiConfId;\n }\n\n set requests(requests: Array<RequestBuilder>) {\n this._requests = requests;\n }\n\n get requests(): Array<RequestBuilder> {\n return this._requests;\n }\n\n set response(response: any) {\n this._response.uiConf = new KalturaUiConfResponse(response[0].data);\n }\n\n get response(): any {\n if (this._response != null && this._response.uiConf != null && this._response.uiConf.config != null)\n try {\n return JSON.parse(this._response.uiConf.config).plugins;\n }\n catch (err) {\n return null;\n }\n else\n return null;\n }\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n buildRequests(params: Object): Array<RequestBuilder> {\n let requests: Array<RequestBuilder> = [];\n requests.push(UiConfService.get(config.beUrl, params.ks, params.uiConfId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n isValid(): boolean {\n return !!this._uiConfId;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/ui-config-loader.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/ui-config-loader.js","//@flow\nimport KalturaMediaEntry from './response-types/kaltura-media-entry'\nimport KalturaPlaybackContext from './response-types/kaltura-playback-context'\nimport KalturaPlaybackSource from './response-types/kaltura-playback-source'\nimport KalturaFlavorAsset from './response-types/kaltura-flavor-asset'\nimport KalturaMetadataListResponse from './response-types/kaltura-metadata-list-response'\nimport PlaySourceUrlBuilder from \"./play-source-url-builder\"\nimport XmlParser from '../xml-parser'\nimport {MediaEntryType, EntryType, MediaType} from '../enums'\nimport Logger from '../../util/logger'\nimport Configuration from './config'\nimport {MediaFormat} from '../../entities/media-format'\nimport MediaEntry from '../../entities/media-entry'\nimport Drm from '../../entities/drm'\nimport MediaSource from '../../entities/media-source'\n\nconst config = Configuration.get();\n/**\n * @constant\n */\nconst logger = Logger.get(\"OvpProvider\");\n\n/**\n * @constant\n * @type {Map<string, MediaFormat>}\n */\nconst SUPPORTED_FORMATS: Map<string, MediaFormat> = new Map([\n [\"mpegdash\", MediaFormat.dash],\n [\"applehttp\", MediaFormat.hls],\n [\"url\", MediaFormat.mp4]\n]);\n\n/**\n * Ovp provider parser\n * @classdesc\n */\nexport default class ProviderParser {\n\n /**\n * Returns parsed media entry by given OVP response objects\n * @function getMediaEntry\n * @param {string} ks The ks\n * @param {number} partnerID The partner ID\n * @param {number} uiConfId The uiConf ID\n * @param {any} mediaEntryResponse The media entry response\n * @returns {MediaEntry} The media entry\n * @static\n */\n static getMediaEntry(ks: string, partnerID: number, uiConfId: number, mediaEntryResponse: any): MediaEntry {\n let mediaEntry: MediaEntry = new MediaEntry();\n let entry = mediaEntryResponse.entry;\n let playbackContext = mediaEntryResponse.playBackContextResult;\n let metadataList = mediaEntryResponse.metadataListResult;\n let kalturaSources: Array<KalturaPlaybackSource> = playbackContext.sources;\n let sources: Array<MediaSource> = [];\n\n if (kalturaSources && kalturaSources.length > 0) {\n kalturaSources.forEach((source) => {\n sources.push(this.parseSource(source, ks, partnerID, uiConfId, entry, playbackContext));\n });\n }\n else {\n sources = [];\n }\n\n mediaEntry.sources = sources;\n\n let metadata: Map<string,string> = this.parseMetaData(metadataList);\n mediaEntry.metaData = metadata;\n mediaEntry.id = entry.id;\n mediaEntry.duration = entry.duration;\n\n let type: MediaEntryType = MediaEntryType.Unknown;\n\n switch (entry.entryType) {\n case MediaType.IMAGE.value:\n type = MediaEntryType.Image;\n break;\n case MediaType.AUDIO.value:\n type = MediaEntryType.Audio;\n break;\n default:\n switch (entry.type) {\n case EntryType.MEDIA_CLIP.value:\n type = MediaEntryType.Vod;\n break;\n case EntryType.LIVE_STREAM.value:\n case EntryType.LIVE_CHANNEL.value:\n type = MediaEntryType.Live;\n break;\n default:\n type = MediaEntryType.Unknown;\n }\n }\n mediaEntry.type = type;\n\n return mediaEntry;\n }\n\n /**\n *\n * @param {KalturaPlaybackSource} source The source\n * @param {string} ks The ks\n * @param {number} partnerID The partner ID\n * @param {number} uiConfId The uiConf ID\n * @param {KalturaMediaEntry} entry The entry\n * @param {KalturaPlaybackContext} playbackContext The playback context\n * @returns {MediaSource} The parsed media source\n * @static\n */\n static parseSource(source: KalturaPlaybackSource, ks: string, partnerID: number, uiConfId: number, entry: KalturaMediaEntry, playbackContext: KalturaPlaybackContext): MediaSource {\n let playUrl: string = \"\";\n let mediaFormat = SUPPORTED_FORMATS.get(source.format);\n let mediaSource: MediaSource = new MediaSource();\n // in case playbackSource doesn't have flavors we don't need to build the url and we'll use the provided one.\n if (source.hasFlavorIds()) {\n let splittedUrl: Array<string> = config.baseUrl.split(\"/\");\n let baseProtocol: string;\n if (splittedUrl && splittedUrl.length > 0) {\n baseProtocol = splittedUrl[0].substring(0, splittedUrl[0].length - 1);\n }\n else {\n baseProtocol = \"http\";\n }\n\n let extension: string = \"\";\n if (!mediaFormat) {\n let flavorIdsArr = source.flavorIds.split(\",\");\n let flavors: Array<KalturaFlavorAsset> = playbackContext.flavorAssets.filter(flavor => flavorIdsArr.indexOf(flavor.id) != -1);\n if (flavors && flavors.length > 0) {\n extension = flavors[0].fileExt;\n }\n }\n else {\n extension = mediaFormat.pathExt;\n mediaSource.mimetype = mediaFormat.mimeType;\n }\n\n playUrl = PlaySourceUrlBuilder.build({\n entryId: entry.id,\n flavorIds: source.flavorIds,\n format: source.format,\n ks: ks,\n partnerId: partnerID,\n uiConfId: uiConfId,\n extension: extension,\n protocol: source.getProtocol(baseProtocol)\n });\n\n }\n else {\n playUrl = source.url;\n }\n\n if (playUrl == \"\") {\n logger.error(`failed to create play url from source, discarding source: (${entry.id}_${source.deliveryProfileId}), ${source.format}.`);\n return mediaSource;\n }\n\n\n mediaSource.url = playUrl;\n mediaSource.id = entry.id + \"_\" + source.deliveryProfileId + \",\" + source.format;\n if (source.hasDrmData()) {\n let drmParams: Array<Drm> = [];\n source.drm.forEach((drm) => {\n drmParams.push(new Drm(drm.licenseURL, drm.scheme));\n });\n mediaSource.drmData = drmParams;\n }\n return mediaSource;\n }\n\n /**\n * Ovp metadata parser\n * @function parseMetaData\n * @param {KalturaMetadataListResponse} metadataList The metadata list\n * @returns {Map<string,string>} Parsed metadata\n * @static\n */\n static parseMetaData(metadataList: KalturaMetadataListResponse): Map<string,string> {\n let metadata: Object = {};\n if (metadataList && metadataList.metas && metadataList.metas.length > 0) {\n metadataList.metas.forEach((meta) => {\n let metaXml: Object;\n let domParser: DOMParser = new DOMParser();\n meta.xml = meta.xml.replace(/\\r?\\n|\\r/g, \"\");\n meta.xml = meta.xml.replace(/>\\s*/g, '>');\n meta.xml = meta.xml.replace(/>\\s*/g, '>');\n metaXml = domParser.parseFromString(meta.xml, 'text/xml');\n let metasObj: Object = XmlParser.xmlToJson(metaXml);\n let metaKeys = Object.keys(metasObj.metadata);\n metaKeys.forEach((key) => {\n metadata[key] = metasObj.metadata[key][\"#text\"];\n })\n\n })\n }\n return metadata;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/provider-parser.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/provider-parser.js","//@flow\nimport {Enum} from 'enumify';\n\nexport class MediaFormat extends Enum {\n}\nMediaFormat.initEnum({\n dash: {\n get mimeType() {\n return \"application/dash+xml\";\n },\n get pathExt() {\n return \"mpd\";\n }\n },\n hls: {\n get mimeType() {\n return \"application/x-mpegURL\";\n },\n get pathExt() {\n return \"m3u8\";\n }\n },\n wvm: {\n get mimeType() {\n return \"video/wvm\";\n },\n get pathExt() {\n return \"wvm\";\n }\n },\n mp4: {\n get mimeType() {\n return \"video/mp4\";\n },\n get pathExt() {\n return \"mp4\";\n }\n },\n mp3: {\n get mimeType() {\n return \"audio/mpeg\";\n },\n get pathExt() {\n return \"mp3\";\n }\n }\n});\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-format.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-format.js","//@flow\nimport Logger from '../../util/logger'\nimport ProviderParser from './provider-parser'\nimport DataLoaderManager from './loaders/data-loader-manager'\nimport MediaEntryLoader from './loaders/media-entry-loader'\nimport SessionLoader from './loaders/session-loader'\nimport UiConfigLoader from './loaders/ui-config-loader'\nimport Configuration from './config'\nimport MediaEntry from '../../entities/media-entry'\nimport MediaSource from '../../entities/media-source'\n\n/**\n * @constant\n */\nconst logger = Logger.get(\"OvpProvider\");\n\ntype playerConfig = {\n id: string,\n session: Object,\n sources: Array<MediaSource>,\n duration: number,\n type: string,\n metadata: Object,\n plugins: Object\n};\n\n/**\n * Ovp provider\n * @classdesc\n */\nexport class OvpProvider {\n /**\n * @member - ks\n * @type {string}\n */\n ks: string;\n /**\n * @member - partner ID\n * @type {number}\n */\n partnerID: number;\n /**\n * @member - is anonymous\n * @type {boolean}\n * @private\n */\n _isAnonymous: boolean;\n /**\n * @member - uiConf ID\n * @type {number}\n * @private\n */\n _uiConfId: number;\n /**\n * @member - Data loader\n * @type {DataLoaderManager}\n * @private\n */\n _dataLoader: DataLoaderManager;\n\n /**\n * @constructor\n * @param {number} partnerID The partner ID\n * @param {string} [ks=\"\"] The provider ks (has empty string as default value)\n * @param {Object} [config] The provider config(optional)\n */\n constructor(partnerID: number, ks: string = \"\", config?: Object) {\n this.partnerID = partnerID;\n this.ks = ks;\n this._isAnonymous = !this.ks;\n Configuration.set(config);\n }\n\n /**\n * Returns player json configuration\n * @function getConfig\n * @param {string} entryId The entry ID\n * @param {number} uiConfId The uiConf ID\n * @returns {Promise} The provider config object as promise\n */\n getConfig(entryId?: string, uiConfId?: number): Promise<Object> {\n if (uiConfId != null) {\n this._uiConfId = uiConfId;\n }\n this._dataLoader = new DataLoaderManager(this.partnerID, this.ks);\n return new Promise((resolve, reject) => {\n if (this.validateParams(entryId, uiConfId)) {\n let ks: string = this.ks;\n if (this._isAnonymous) {\n ks = \"{1:result:ks}\";\n this._dataLoader.add(SessionLoader, {partnerId: this.partnerID});\n }\n this._dataLoader.add(MediaEntryLoader, {entryId: entryId, ks: ks});\n this._dataLoader.add(UiConfigLoader, {uiConfId: uiConfId, ks: ks});\n this._dataLoader.fetchData()\n .then(response => {\n resolve(this.parseDataFromResponse(response));\n },\n err => {\n reject(err);\n });\n }\n else {\n reject({success: false, data: \"Missing mandatory parameter\"});\n }\n });\n }\n\n /**\n * Parses BE data to json configuration object\n * @function parseDataFromResponse\n * @param {Map<string,Function>} data The data to parse\n * @returns {Object} The parsed config object\n */\n parseDataFromResponse(data: Map<string, Function>): Object {\n logger.debug(\"Data parsing started\");\n let config: playerConfig = {\n id: \"\",\n session: {\n partnerID: this.partnerID,\n uiConfID: this._uiConfId,\n },\n sources: [],\n duration: 0,\n type: \"Unknown\",\n metadata: {},\n plugins: {}\n };\n if (data != null) {\n if (data.has(SessionLoader.name)) {\n let sessionLoader = data.get(SessionLoader.name);\n if (sessionLoader != null && sessionLoader.response != null) {\n this.ks = sessionLoader.response;\n this._isAnonymous = !this.ks;\n config.session.ks = this.ks;\n }\n }\n if (data.has(UiConfigLoader.name)) {\n let uiConfLoader = data.get(UiConfigLoader.name);\n let pluginsJson: Object = {};\n if (uiConfLoader != null) {\n pluginsJson = uiConfLoader.response;\n }\n config.plugins = pluginsJson;\n }\n if (data.has(MediaEntryLoader.name)) {\n let mediaLoader = data.get(MediaEntryLoader.name);\n if (mediaLoader != null && mediaLoader.response != null) {\n let mediaEntry: MediaEntry = ProviderParser.getMediaEntry(this.ks, this.partnerID, this._uiConfId, mediaLoader.response);\n config.id = mediaEntry.id;\n config.sources = mediaEntry.sources;\n config.duration = mediaEntry.duration;\n config.type = mediaEntry.type.name;\n config.metadata = mediaEntry.metaData;\n }\n }\n }\n logger.debug(\"Data parsing finished\", config);\n return (config);\n }\n\n /**\n * Parameters validation function\n * @param {string} entryId The entry ID\n * @param {number} uiConfId The uiConfID\n * @returns {boolean} Is valid params\n */\n validateParams(entryId?: string, uiConfId?: number): boolean {\n return !!entryId || !!uiConfId;\n }\n\n}\n\nexport default OvpProvider;\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/ovp-provider.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/ovp-provider.js","//@flow\nimport Configuration from './config'\n\nconst config = Configuration.get();\n\n/**\n * Media source url builder\n * @classdesc\n */\nexport default class PlaySourceUrlBuilder {\n\n /**\n * Returns source url by given url params\n * @function build\n * @param {Object} urlParams The params\n * @returns {string} The URL\n * @static\n */\n static build(urlParams: Object): string {\n let baseUrl: string = config.baseUrl;\n let partnerId: string = urlParams.partnerId;\n let entryId: string = urlParams.entryId;\n let ks: string = urlParams.ks;\n let uiConfId: string = urlParams.uiConfId;\n let format: string = urlParams.format;\n let protocol: string = urlParams.protocol;\n let extension: string = urlParams.extension;\n let flavorIds: string = urlParams.flavorIds;\n\n if (baseUrl == \"\" && partnerId == \"\" && entryId == \"\" && extension == \"\" && format == \"\") {\n return \"\";\n }\n\n let playUrl = baseUrl;\n if (!PlaySourceUrlBuilder.endsWith(baseUrl, \"/\")) {\n playUrl += \"/\";\n }\n playUrl += \"p/\" + partnerId + \"/sp/\" + partnerId + \"00\" + \"/playManifest/entryId/\" + entryId + \"/protocol/\" + protocol + \"/format/\" + format;\n\n if (flavorIds != \"\") {\n playUrl += \"/falvorIds/\" + flavorIds;\n }\n else if (uiConfId != \"\") {\n playUrl += \"/uiConfId/\" + uiConfId;\n }\n\n if (this.ks != \"\") {\n playUrl += \"/ks/\" + ks;\n }\n\n playUrl += \"/a.\" + extension;\n\n if (uiConfId && flavorIds != \"\") {\n playUrl += \"?uiConfId=.\" + uiConfId;\n }\n\n return playUrl;\n }\n\n /**\n * Checks if given string end with search string\n * @param {string} string The given string\n * @param {string} searchString The string to search\n * @returns {boolean} Is given string end with search string\n */\n static endsWith(string: string, searchString: string): boolean {\n if (typeof string !== 'string') {\n return false;\n }\n if (typeof searchString !== 'string') {\n return false;\n }\n\n return string.indexOf(searchString, string.length - searchString.length) != -1;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/play-source-url-builder.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/play-source-url-builder.js","//@flow\n\n/**\n * Ovp BE access control message\n * @classdesc\n */\nexport default class KalturaAccessControlMessage {\n /**\n * @member - The access control message\n * @type {string}\n */\n message: string;\n /**\n * @member - The access control message code\n * @@type {string}\n */\n code: string;\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n constructor(data: Object) {\n this.message = data.message;\n this.code = data.code\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-access-control-message.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-access-control-message.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport KalturaMediaEntry from './kaltura-media-entry'\n\n/**\n * Ovp BE BaseEntryList service response\n * @classdesc\n */\nexport default class KalturaBaseEntryListResponse extends ServiceResult {\n /**\n * @member - The total count\n * @type {number}\n */\n totalCount: number;\n /**\n * @member - The entries\n * @type {Array<KalturaMediaEntry>}\n */\n entries: Array<KalturaMediaEntry>;\n\n /**\n * @constructor\n * @param {Object} responseObj The json response\n */\n constructor(responseObj: Object) {\n super(responseObj);\n if (!this.hasError) {\n this.totalCount = responseObj.totalCount;\n if (this.totalCount > 0) {\n this.entries = [];\n responseObj.objects.map(entry => this.entries.push(new KalturaMediaEntry(entry)));\n }\n }\n }\n}\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-base-entry-list-response.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-base-entry-list-response.js","//@flow\nimport {Scheme} from '../../enums'\n\n/**\n * Ovp BE DrmPlaybackPluginData\n * @classdesc\n */\nexport default class KalturaDrmPlaybackPluginData {\n /**\n * @member - The drm scheme\n * @type {Scheme}\n */\n scheme: Scheme;\n\n /**\n * @member - The license URL\n * @type {string}\n */\n licenseURL: string;\n\n /**\n * @constructor\n * @param {Object} drm The json response\n */\n constructor(drm: any) {\n this.scheme = drm.scheme;\n this.licenseURL = drm.licenseURL;\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-drm-playback-plugin-data.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-drm-playback-plugin-data.js","//@flow\nimport {MetadataObjectType, MetadataStatus} from '../../enums'\n\n/**\n * Ovp BE Metadata\n * @classdesc\n */\nexport default class KalturaMetadata {\n id: number;\n metadataProfileId: number;\n metadataProfileVersion: number;\n metadataObjectType: MetadataObjectType;\n objectId: string;\n version: number;\n created: Date;\n updated: Date;\n status: MetadataStatus;\n /**\n * @member - The Metadata xml - represented as XML string\n * @type {string}\n */\n xml: string;\n\n /**\n * @constructor\n * @param {Object} data The response\n */\n constructor(data: Object) {\n this.id = data.id;\n this.metadataProfileId = data.metadataProfileId;\n this.metadataProfileVersion = data.metadataProfileVersion;\n this.metadataProfileId = data.metadataProfileId;\n this.metadataObjectType = data.metadataObjectType;\n this.objectId = data.objectId;\n this.version = data.version;\n this.created = new Date(0);\n this.created.setUTCSeconds(data.createdAt);\n this.updated = new Date(0);\n this.updated.setUTCSeconds(data.updatedAt);\n this.status = data.status;\n this.xml = data.xml;\n\n }\n}\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-metadata.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-metadata.js","//@flow\nimport {KalturaRuleActionType} from '../../enums'\n\n/**\n * Ovp BE rule action\n * @classdesc\n */\nexport default class KalturaRuleAction {\n /**\n * @member - The type of the action\n * @type {KalturaRuleActionType}\n */\n type: KalturaRuleActionType;\n\n /**\n * @constructor\n * @param {Object} data The response\n */\n constructor(data: Object) {\n this.type = data.type;\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-rule-action.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-rule-action.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport {UIConfType, UIConfCreationMode} from '../../enums';\n\n/**\n * Ovp BE Ui config response\n * @classdesc\n */\nexport default class KalturaUiConfResponse extends ServiceResult {\n /**\n * @member -Name of the uiConf, this is not a primary key\n * @type {string}\n */\n name: string;\n /**\n * @member -Name of the uiConf, this is not a primary key\n * @type {string}\n */\n description: string;\n objTypeAsString: string;\n width: number;\n height: number;\n htmlParams: string;\n swfUrl: string;\n confFilePath: string;\n confFile: string;\n confFileFeatures: string;\n name: string;\n /**\n * @member -plugins configuration represented as Json string\n * @type {string}\n */\n config: string;\n confVars: string;\n useCdn: boolean;\n tags: string;\n swfUrlVersion: string;\n created: Date;\n updated: Date;\n html5Url: string;\n version: string;\n partnerTags: string;\n objType: UIConfType;\n creationMode: UIConfCreationMode;\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n constructor(data: Object) {\n super(data);\n if (!this.hasError) {\n this.name = data.name;\n\n this.description = data.description;\n this.objTypeAsString = data.objTypeAsString;\n this.width = data.width;\n this.height = data.height;\n this.htmlParams = data.htmlParams;\n this.swfUrl = data.swfUrl;\n this.confFilePath = data.confFilePath;\n this.confFile = data.confFile;\n this.confFileFeatures = data.confFileFeatures;\n this.config = data.config;\n this.confVars = data.confVars;\n this.useCdn = data.useCdn;\n this.tags = data.tags;\n this.swfUrlVersion = data.swfUrlVersion;\n this.created = new Date(0);\n this.created.setUTCSeconds(data.createdAt);\n this.updated = new Date(0);\n this.updated.setUTCSeconds(data.updatedAt);\n this.html5Url = data.description;\n this.version = data.description;\n this.partnerTags = data.description;\n this.objType = data.description;\n this.creationMode = data.description;\n\n }\n }\n}\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kalturaUIConfResponse.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kalturaUIConfResponse.js","//@flow\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"baseEntry\";\n\n/**\n * Ovp BaseEntry service methods\n * @classdesc\n */\nexport default class BaseEntryService extends OvpService {\n\n /**\n * Creates an instance of RequestBuilder for baseentry.getPlaybackContext\n * @function getPlaybackContext\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static getPlaybackContext(baseUrl: string, ks: string, entryId: string): RequestBuilder {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"getPlaybackContext\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"baseEntry-getPlaybackContext\";\n let contextDataParams = {objectType: \"KalturaContextDataParams\", flavorTags: \"all\"};\n let params = {entryId: entryId, ks: ks, contextDataParams: contextDataParams};\n request.params = params;\n return request;\n }\n\n /**\n * Creates an instance of RequestBuilder for baseentry.list\n * @function list\n * @param {string} baseUrl The base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static list(baseUrl: string, ks: string, entryId: string): RequestBuilder {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"list\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"list\";\n request.params = BaseEntryService.getEntryListReqParams(entryId, ks);\n return request;\n }\n\n /**\n * Gets baseentry.list service params\n * @function getEntryListReqParams\n * @param {string} entryId The entry ID\n * @param {string} ks The ks\n * @returns {{ks: string, filter: {redirectFromEntryId: string}, responseProfile: {fields: string, type: number}}} The service params object\n * @static\n */\n static getEntryListReqParams(entryId: string, ks: string): any {\n let filterParams = {redirectFromEntryId: entryId};\n let responseProfileParams = {\n fields: \"id,name,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags\",\n type: 1\n };\n return {ks: ks, filter: filterParams, responseProfile: responseProfileParams};\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/base-entry-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/base-entry-service.js","//@flow\n\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"metadata_metadata\";\n\n/**\n * Ovp metadata_metadata service methods\n * @classdesc\n */\nexport default class MetaDataService extends OvpService {\n /**\n * Creates an instance of RequestBuilder for metadata_metadata.list\n * @function getPlaybackContext\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static list(baseUrl: string, ks: string, entryId: string) {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"list\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"metadata_metadata-list\";\n let filter = {objectType: \"KalturaMetadataFilter\", objectIdEqual: entryId, metadataObjectTypeEqual: \"1\"};\n let params = {filter: filter, ks: ks};\n request.params = params;\n return request;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/meta-data-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/meta-data-service.js","//@flow\n\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"session\";\n\n/**\n * Ovp session service methods\n * @classdesc\n */\nexport default class SessionService extends OvpService {\n /**\n * Creates an instance of RequestBuilder for session.startWidgetSession\n * @function anonymousSession\n * @param {string} baseUrl The service base URL\n * @param {string} partnerId The partner ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static anonymousSession(baseUrl: string, partnerId: number) {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"startWidgetSession\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"session-startWidget\";\n request.params = {widgetId: \"_\" + partnerId};\n return request;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/session-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/session-service.js","//@flow\n\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"uiconf\";\n\n/**\n * Ovp uiconf service methods\n * @classdesc\n */\nexport default class UiConfService extends OvpService {\n /**\n * Creates an instance of RequestBuilder for uiconf.get\n * @function get\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} uiConfID The uiConf ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static get(baseUrl: string, ks: string, uiConfID: number) {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"get\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"uiconf-get\";\n let responseProfileParams = {\n fields: \"config\",\n type: 1\n };\n request.params = {id: uiConfID, responseProfile: responseProfileParams, ks: ks};\n return request;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/ui-conf-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/ui-conf-service.js","//@flow\n\n/**\n * Xml parser\n * @classdesc\n */\nexport default class XmlParser {\n /**\n * Parses xml string to json object\n * @param {string} xml The xml to parse\n * @returns {{}} The parsed xml as Json object\n * @static\n */\n static xmlToJson(xml: Object) {\n let obj = {};\n if (xml.nodeType == 1) {\n if (xml.attributes.length > 0) {\n obj[\"@attributes\"] = {};\n for (let j = 0; j < xml.attributes.length; j++) {\n let attribute = xml.attributes.item(j);\n obj[\"@attributes\"][attribute.nodeName] = attribute.nodeValue;\n }\n }\n }\n else if (xml.nodeType == 3) {\n obj = xml.nodeValue;\n }\n if (xml.hasChildNodes()) {\n for (let i = 0; i < xml.childNodes.length; i++) {\n let item = xml.childNodes.item(i);\n let nodeName = item.nodeName;\n if (typeof (obj[nodeName]) == \"undefined\") {\n obj[nodeName] = this.xmlToJson(item);\n }\n else {\n if (typeof (obj[nodeName].push) == \"undefined\") {\n let old = obj[nodeName];\n obj[nodeName] = [];\n obj[nodeName].push(old);\n }\n obj[nodeName].push(this.xmlToJson(item));\n }\n }\n }\n return obj;\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/xml-parser.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/xml-parser.js","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"playkit-js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsUi\"] = factory(require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsUi\"] = factory(root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_48__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 28);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 22c3c46a80b1c7885159\n\n\n// WEBPACK FOOTER //\n// webpack:/ui/webpack/bootstrap 22c3c46a80b1c7885159","!function() {\n 'use strict';\n function VNode() {}\n function h(nodeName, attributes) {\n var lastSimple, child, simple, i, children = EMPTY_CHILDREN;\n for (i = arguments.length; i-- > 2; ) stack.push(arguments[i]);\n if (attributes && null != attributes.children) {\n if (!stack.length) stack.push(attributes.children);\n delete attributes.children;\n }\n while (stack.length) if ((child = stack.pop()) && void 0 !== child.pop) for (i = child.length; i--; ) stack.push(child[i]); else {\n if (child === !0 || child === !1) child = null;\n if (simple = 'function' != typeof nodeName) if (null == child) child = ''; else if ('number' == typeof child) child = String(child); else if ('string' != typeof child) simple = !1;\n if (simple && lastSimple) children[children.length - 1] += child; else if (children === EMPTY_CHILDREN) children = [ child ]; else children.push(child);\n lastSimple = simple;\n }\n var p = new VNode();\n p.nodeName = nodeName;\n p.children = children;\n p.attributes = null == attributes ? void 0 : attributes;\n p.key = null == attributes ? void 0 : attributes.key;\n if (void 0 !== options.vnode) options.vnode(p);\n return p;\n }\n function extend(obj, props) {\n for (var i in props) obj[i] = props[i];\n return obj;\n }\n function cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n }\n function enqueueRender(component) {\n if (!component.__d && (component.__d = !0) && 1 == items.push(component)) (options.debounceRendering || setTimeout)(rerender);\n }\n function rerender() {\n var p, list = items;\n items = [];\n while (p = list.pop()) if (p.__d) renderComponent(p);\n }\n function isSameNodeType(node, vnode, hydrating) {\n if ('string' == typeof vnode || 'number' == typeof vnode) return void 0 !== node.splitText;\n if ('string' == typeof vnode.nodeName) return !node._componentConstructor && isNamedNode(node, vnode.nodeName); else return hydrating || node._componentConstructor === vnode.nodeName;\n }\n function isNamedNode(node, nodeName) {\n return node.__n === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n }\n function getNodeProps(vnode) {\n var props = extend({}, vnode.attributes);\n props.children = vnode.children;\n var defaultProps = vnode.nodeName.defaultProps;\n if (void 0 !== defaultProps) for (var i in defaultProps) if (void 0 === props[i]) props[i] = defaultProps[i];\n return props;\n }\n function createNode(nodeName, isSvg) {\n var node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n node.__n = nodeName;\n return node;\n }\n function removeNode(node) {\n if (node.parentNode) node.parentNode.removeChild(node);\n }\n function setAccessor(node, name, old, value, isSvg) {\n if ('className' === name) name = 'class';\n if ('key' === name) ; else if ('ref' === name) {\n if (old) old(null);\n if (value) value(node);\n } else if ('class' === name && !isSvg) node.className = value || ''; else if ('style' === name) {\n if (!value || 'string' == typeof value || 'string' == typeof old) node.style.cssText = value || '';\n if (value && 'object' == typeof value) {\n if ('string' != typeof old) for (var i in old) if (!(i in value)) node.style[i] = '';\n for (var i in value) node.style[i] = 'number' == typeof value[i] && IS_NON_DIMENSIONAL.test(i) === !1 ? value[i] + 'px' : value[i];\n }\n } else if ('dangerouslySetInnerHTML' === name) {\n if (value) node.innerHTML = value.__html || '';\n } else if ('o' == name[0] && 'n' == name[1]) {\n var useCapture = name !== (name = name.replace(/Capture$/, ''));\n name = name.toLowerCase().substring(2);\n if (value) {\n if (!old) node.addEventListener(name, eventProxy, useCapture);\n } else node.removeEventListener(name, eventProxy, useCapture);\n (node.__l || (node.__l = {}))[name] = value;\n } else if ('list' !== name && 'type' !== name && !isSvg && name in node) {\n setProperty(node, name, null == value ? '' : value);\n if (null == value || value === !1) node.removeAttribute(name);\n } else {\n var ns = isSvg && name !== (name = name.replace(/^xlink\\:?/, ''));\n if (null == value || value === !1) if (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase()); else node.removeAttribute(name); else if ('function' != typeof value) if (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value); else node.setAttribute(name, value);\n }\n }\n function setProperty(node, name, value) {\n try {\n node[name] = value;\n } catch (e) {}\n }\n function eventProxy(e) {\n return this.__l[e.type](options.event && options.event(e) || e);\n }\n function flushMounts() {\n var c;\n while (c = mounts.pop()) {\n if (options.afterMount) options.afterMount(c);\n if (c.componentDidMount) c.componentDidMount();\n }\n }\n function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n if (!diffLevel++) {\n isSvgMode = null != parent && void 0 !== parent.ownerSVGElement;\n hydrating = null != dom && !('__preactattr_' in dom);\n }\n var ret = idiff(dom, vnode, context, mountAll, componentRoot);\n if (parent && ret.parentNode !== parent) parent.appendChild(ret);\n if (!--diffLevel) {\n hydrating = !1;\n if (!componentRoot) flushMounts();\n }\n return ret;\n }\n function idiff(dom, vnode, context, mountAll, componentRoot) {\n var out = dom, prevSvgMode = isSvgMode;\n if (null == vnode) vnode = '';\n if ('string' == typeof vnode) {\n if (dom && void 0 !== dom.splitText && dom.parentNode && (!dom._component || componentRoot)) {\n if (dom.nodeValue != vnode) dom.nodeValue = vnode;\n } else {\n out = document.createTextNode(vnode);\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n recollectNodeTree(dom, !0);\n }\n }\n out.__preactattr_ = !0;\n return out;\n }\n if ('function' == typeof vnode.nodeName) return buildComponentFromVNode(dom, vnode, context, mountAll);\n isSvgMode = 'svg' === vnode.nodeName ? !0 : 'foreignObject' === vnode.nodeName ? !1 : isSvgMode;\n if (!dom || !isNamedNode(dom, String(vnode.nodeName))) {\n out = createNode(String(vnode.nodeName), isSvgMode);\n if (dom) {\n while (dom.firstChild) out.appendChild(dom.firstChild);\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n recollectNodeTree(dom, !0);\n }\n }\n var fc = out.firstChild, props = out.__preactattr_ || (out.__preactattr_ = {}), vchildren = vnode.children;\n if (!hydrating && vchildren && 1 === vchildren.length && 'string' == typeof vchildren[0] && null != fc && void 0 !== fc.splitText && null == fc.nextSibling) {\n if (fc.nodeValue != vchildren[0]) fc.nodeValue = vchildren[0];\n } else if (vchildren && vchildren.length || null != fc) innerDiffNode(out, vchildren, context, mountAll, hydrating || null != props.dangerouslySetInnerHTML);\n diffAttributes(out, vnode.attributes, props);\n isSvgMode = prevSvgMode;\n return out;\n }\n function innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n var j, c, vchild, child, originalChildren = dom.childNodes, children = [], keyed = {}, keyedLen = 0, min = 0, len = originalChildren.length, childrenLen = 0, vlen = vchildren ? vchildren.length : 0;\n if (0 !== len) for (var i = 0; i < len; i++) {\n var _child = originalChildren[i], props = _child.__preactattr_, key = vlen && props ? _child._component ? _child._component.__k : props.key : null;\n if (null != key) {\n keyedLen++;\n keyed[key] = _child;\n } else if (props || (void 0 !== _child.splitText ? isHydrating ? _child.nodeValue.trim() : !0 : isHydrating)) children[childrenLen++] = _child;\n }\n if (0 !== vlen) for (var i = 0; i < vlen; i++) {\n vchild = vchildren[i];\n child = null;\n var key = vchild.key;\n if (null != key) {\n if (keyedLen && void 0 !== keyed[key]) {\n child = keyed[key];\n keyed[key] = void 0;\n keyedLen--;\n }\n } else if (!child && min < childrenLen) for (j = min; j < childrenLen; j++) if (void 0 !== children[j] && isSameNodeType(c = children[j], vchild, isHydrating)) {\n child = c;\n children[j] = void 0;\n if (j === childrenLen - 1) childrenLen--;\n if (j === min) min++;\n break;\n }\n child = idiff(child, vchild, context, mountAll);\n if (child && child !== dom) if (i >= len) dom.appendChild(child); else if (child !== originalChildren[i]) if (child === originalChildren[i + 1]) removeNode(originalChildren[i]); else dom.insertBefore(child, originalChildren[i] || null);\n }\n if (keyedLen) for (var i in keyed) if (void 0 !== keyed[i]) recollectNodeTree(keyed[i], !1);\n while (min <= childrenLen) if (void 0 !== (child = children[childrenLen--])) recollectNodeTree(child, !1);\n }\n function recollectNodeTree(node, unmountOnly) {\n var component = node._component;\n if (component) unmountComponent(component); else {\n if (null != node.__preactattr_ && node.__preactattr_.ref) node.__preactattr_.ref(null);\n if (unmountOnly === !1 || null == node.__preactattr_) removeNode(node);\n removeChildren(node);\n }\n }\n function removeChildren(node) {\n node = node.lastChild;\n while (node) {\n var next = node.previousSibling;\n recollectNodeTree(node, !0);\n node = next;\n }\n }\n function diffAttributes(dom, attrs, old) {\n var name;\n for (name in old) if ((!attrs || null == attrs[name]) && null != old[name]) setAccessor(dom, name, old[name], old[name] = void 0, isSvgMode);\n for (name in attrs) if (!('children' === name || 'innerHTML' === name || name in old && attrs[name] === ('value' === name || 'checked' === name ? dom[name] : old[name]))) setAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n }\n function collectComponent(component) {\n var name = component.constructor.name;\n (components[name] || (components[name] = [])).push(component);\n }\n function createComponent(Ctor, props, context) {\n var inst, list = components[Ctor.name];\n if (Ctor.prototype && Ctor.prototype.render) {\n inst = new Ctor(props, context);\n Component.call(inst, props, context);\n } else {\n inst = new Component(props, context);\n inst.constructor = Ctor;\n inst.render = doRender;\n }\n if (list) for (var i = list.length; i--; ) if (list[i].constructor === Ctor) {\n inst.__b = list[i].__b;\n list.splice(i, 1);\n break;\n }\n return inst;\n }\n function doRender(props, state, context) {\n return this.constructor(props, context);\n }\n function setComponentProps(component, props, opts, context, mountAll) {\n if (!component.__x) {\n component.__x = !0;\n if (component.__r = props.ref) delete props.ref;\n if (component.__k = props.key) delete props.key;\n if (!component.base || mountAll) {\n if (component.componentWillMount) component.componentWillMount();\n } else if (component.componentWillReceiveProps) component.componentWillReceiveProps(props, context);\n if (context && context !== component.context) {\n if (!component.__c) component.__c = component.context;\n component.context = context;\n }\n if (!component.__p) component.__p = component.props;\n component.props = props;\n component.__x = !1;\n if (0 !== opts) if (1 === opts || options.syncComponentUpdates !== !1 || !component.base) renderComponent(component, 1, mountAll); else enqueueRender(component);\n if (component.__r) component.__r(component);\n }\n }\n function renderComponent(component, opts, mountAll, isChild) {\n if (!component.__x) {\n var rendered, inst, cbase, props = component.props, state = component.state, context = component.context, previousProps = component.__p || props, previousState = component.__s || state, previousContext = component.__c || context, isUpdate = component.base, nextBase = component.__b, initialBase = isUpdate || nextBase, initialChildComponent = component._component, skip = !1;\n if (isUpdate) {\n component.props = previousProps;\n component.state = previousState;\n component.context = previousContext;\n if (2 !== opts && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === !1) skip = !0; else if (component.componentWillUpdate) component.componentWillUpdate(props, state, context);\n component.props = props;\n component.state = state;\n component.context = context;\n }\n component.__p = component.__s = component.__c = component.__b = null;\n component.__d = !1;\n if (!skip) {\n rendered = component.render(props, state, context);\n if (component.getChildContext) context = extend(extend({}, context), component.getChildContext());\n var toUnmount, base, childComponent = rendered && rendered.nodeName;\n if ('function' == typeof childComponent) {\n var childProps = getNodeProps(rendered);\n inst = initialChildComponent;\n if (inst && inst.constructor === childComponent && childProps.key == inst.__k) setComponentProps(inst, childProps, 1, context, !1); else {\n toUnmount = inst;\n component._component = inst = createComponent(childComponent, childProps, context);\n inst.__b = inst.__b || nextBase;\n inst.__u = component;\n setComponentProps(inst, childProps, 0, context, !1);\n renderComponent(inst, 1, mountAll, !0);\n }\n base = inst.base;\n } else {\n cbase = initialBase;\n toUnmount = initialChildComponent;\n if (toUnmount) cbase = component._component = null;\n if (initialBase || 1 === opts) {\n if (cbase) cbase._component = null;\n base = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, !0);\n }\n }\n if (initialBase && base !== initialBase && inst !== initialChildComponent) {\n var baseParent = initialBase.parentNode;\n if (baseParent && base !== baseParent) {\n baseParent.replaceChild(base, initialBase);\n if (!toUnmount) {\n initialBase._component = null;\n recollectNodeTree(initialBase, !1);\n }\n }\n }\n if (toUnmount) unmountComponent(toUnmount);\n component.base = base;\n if (base && !isChild) {\n var componentRef = component, t = component;\n while (t = t.__u) (componentRef = t).base = base;\n base._component = componentRef;\n base._componentConstructor = componentRef.constructor;\n }\n }\n if (!isUpdate || mountAll) mounts.unshift(component); else if (!skip) {\n flushMounts();\n if (component.componentDidUpdate) component.componentDidUpdate(previousProps, previousState, previousContext);\n if (options.afterUpdate) options.afterUpdate(component);\n }\n if (null != component.__h) while (component.__h.length) component.__h.pop().call(component);\n if (!diffLevel && !isChild) flushMounts();\n }\n }\n function buildComponentFromVNode(dom, vnode, context, mountAll) {\n var c = dom && dom._component, originalComponent = c, oldDom = dom, isDirectOwner = c && dom._componentConstructor === vnode.nodeName, isOwner = isDirectOwner, props = getNodeProps(vnode);\n while (c && !isOwner && (c = c.__u)) isOwner = c.constructor === vnode.nodeName;\n if (c && isOwner && (!mountAll || c._component)) {\n setComponentProps(c, props, 3, context, mountAll);\n dom = c.base;\n } else {\n if (originalComponent && !isDirectOwner) {\n unmountComponent(originalComponent);\n dom = oldDom = null;\n }\n c = createComponent(vnode.nodeName, props, context);\n if (dom && !c.__b) {\n c.__b = dom;\n oldDom = null;\n }\n setComponentProps(c, props, 1, context, mountAll);\n dom = c.base;\n if (oldDom && dom !== oldDom) {\n oldDom._component = null;\n recollectNodeTree(oldDom, !1);\n }\n }\n return dom;\n }\n function unmountComponent(component) {\n if (options.beforeUnmount) options.beforeUnmount(component);\n var base = component.base;\n component.__x = !0;\n if (component.componentWillUnmount) component.componentWillUnmount();\n component.base = null;\n var inner = component._component;\n if (inner) unmountComponent(inner); else if (base) {\n if (base.__preactattr_ && base.__preactattr_.ref) base.__preactattr_.ref(null);\n component.__b = base;\n removeNode(base);\n collectComponent(component);\n removeChildren(base);\n }\n if (component.__r) component.__r(null);\n }\n function Component(props, context) {\n this.__d = !0;\n this.context = context;\n this.props = props;\n this.state = this.state || {};\n }\n function render(vnode, parent, merge) {\n return diff(merge, vnode, {}, !1, parent, !1);\n }\n var options = {};\n var stack = [];\n var EMPTY_CHILDREN = [];\n var IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n var items = [];\n var mounts = [];\n var diffLevel = 0;\n var isSvgMode = !1;\n var hydrating = !1;\n var components = {};\n extend(Component.prototype, {\n setState: function(state, callback) {\n var s = this.state;\n if (!this.__s) this.__s = extend({}, s);\n extend(s, 'function' == typeof state ? state(s, this.props) : state);\n if (callback) (this.__h = this.__h || []).push(callback);\n enqueueRender(this);\n },\n forceUpdate: function(callback) {\n if (callback) (this.__h = this.__h || []).push(callback);\n renderComponent(this, 2);\n },\n render: function() {}\n });\n var preact = {\n h: h,\n createElement: h,\n cloneElement: cloneElement,\n Component: Component,\n render: render,\n rerender: rerender,\n options: options\n };\n if ('undefined' != typeof module) module.exports = preact; else self.preact = preact;\n}();\n//# sourceMappingURL=preact.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/preact/dist/preact.js\n// module id = 0\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/preact/dist/preact.js","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('preact'), require('redux')) :\n\ttypeof define === 'function' && define.amd ? define(['preact', 'redux'], factory) :\n\t(global.preactRedux = factory(global.preact,global.Redux));\n}(this, (function (preact,redux) {\n\nvar Children = {\n\tonly: function only(children) {\n\t\treturn children && children[0] || null;\n\t}\n};\n\nfunction proptype() {}\nproptype.isRequired = proptype;\n\nvar PropTypes = {\n\telement: proptype,\n\tfunc: proptype,\n\tshape: function shape() {\n\t\treturn proptype;\n\t},\n\tinstanceOf: function instanceOf() {\n\t\treturn proptype;\n\t}\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n};\n\n\n\n\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\n\n\n\n\n\n\n\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar get = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\nvar objectWithoutProperties = function (obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n};\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n\n\nvar set = function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if (\"value\" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n};\n\n// encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nvar CLEARED = null;\nvar nullListeners = {\n notify: function notify() {}\n};\n\nfunction createListenerCollection() {\n // the current/next pattern is copied from redux's createStore code.\n // TODO: refactor+expose that code to be reusable here?\n var current = [];\n var next = [];\n\n return {\n clear: function clear() {\n next = CLEARED;\n current = CLEARED;\n },\n notify: function notify() {\n var listeners = current = next;\n for (var i = 0; i < listeners.length; i++) {\n listeners[i]();\n }\n },\n subscribe: function subscribe(listener) {\n var isSubscribed = true;\n if (next === current) next = current.slice();\n next.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed || current === CLEARED) return;\n isSubscribed = false;\n\n if (next === current) next = current.slice();\n next.splice(next.indexOf(listener), 1);\n };\n }\n };\n}\n\nvar Subscription = function () {\n function Subscription(store, parentSub) {\n classCallCheck(this, Subscription);\n\n this.store = store;\n this.parentSub = parentSub;\n this.unsubscribe = null;\n this.listeners = nullListeners;\n }\n\n Subscription.prototype.addNestedSub = function addNestedSub(listener) {\n this.trySubscribe();\n return this.listeners.subscribe(listener);\n };\n\n Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() {\n this.listeners.notify();\n };\n\n Subscription.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.unsubscribe);\n };\n\n Subscription.prototype.trySubscribe = function trySubscribe() {\n if (!this.unsubscribe) {\n // this.onStateChange is set by connectAdvanced.initSubscription()\n this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);\n\n this.listeners = createListenerCollection();\n }\n };\n\n Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n this.listeners.clear();\n this.listeners = nullListeners;\n }\n };\n\n return Subscription;\n}();\n\nvar storeShape = PropTypes.shape({\n subscribe: PropTypes.func.isRequired,\n dispatch: PropTypes.func.isRequired,\n getState: PropTypes.func.isRequired\n});\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}\n\nvar didWarnAboutReceivingStore = false;\nfunction warnAboutReceivingStore() {\n if (didWarnAboutReceivingStore) {\n return;\n }\n didWarnAboutReceivingStore = true;\n\n warning('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');\n}\n\nvar Provider = function (_Component) {\n inherits(Provider, _Component);\n\n Provider.prototype.getChildContext = function getChildContext() {\n return { store: this.store, storeSubscription: null };\n };\n\n function Provider(props, context) {\n classCallCheck(this, Provider);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.store = props.store;\n return _this;\n }\n\n Provider.prototype.render = function render() {\n return Children.only(this.props.children);\n };\n\n return Provider;\n}(preact.Component);\n\n{\n Provider.prototype.componentWillReceiveProps = function (nextProps) {\n var store = this.store;\n var nextStore = nextProps.store;\n\n\n if (store !== nextStore) {\n warnAboutReceivingStore();\n }\n };\n}\n\nProvider.childContextTypes = {\n store: storeShape.isRequired,\n storeSubscription: PropTypes.instanceOf(Subscription)\n};\nProvider.displayName = 'Provider';\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\n\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n arguments: true,\n arity: true\n};\n\nvar isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function';\n\nvar index = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n var keys = Object.getOwnPropertyNames(sourceComponent);\n\n /* istanbul ignore else */\n if (isGetOwnPropertySymbolsAvailable) {\n keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent));\n }\n\n for (var i = 0; i < keys.length; ++i) {\n if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) {\n try {\n targetComponent[keys[i]] = sourceComponent[keys[i]];\n } catch (error) {}\n }\n }\n }\n\n return targetComponent;\n};\n\nvar invariant = function () {}\n\nvar hotReloadingVersion = 0;\nfunction connectAdvanced(\n/*\n selectorFactory is a func that is responsible for returning the selector function used to\n compute new props from state, props, and dispatch. For example:\n export default connectAdvanced((dispatch, options) => (state, props) => ({\n thing: state.things[props.thingId],\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\n }))(YourComponent)\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\n props. Do not use connectAdvanced directly without memoizing results between calls to your\n selector, otherwise the Connect component will re-render on every state or props change.\n*/\nselectorFactory) {\n var _contextTypes, _childContextTypes;\n\n var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n var _ref$getDisplayName = _ref.getDisplayName;\n var getDisplayName = _ref$getDisplayName === undefined ? function (name) {\n return 'ConnectAdvanced(' + name + ')';\n } : _ref$getDisplayName;\n var _ref$methodName = _ref.methodName;\n var methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName;\n var _ref$renderCountProp = _ref.renderCountProp;\n var renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp;\n var _ref$shouldHandleStat = _ref.shouldHandleStateChanges;\n var shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat;\n var _ref$storeKey = _ref.storeKey;\n var storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey;\n var _ref$withRef = _ref.withRef;\n var withRef = _ref$withRef === undefined ? false : _ref$withRef;\n var connectOptions = objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']);\n\n var subscriptionKey = storeKey + 'Subscription';\n var version = hotReloadingVersion++;\n\n var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = storeShape, _contextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _contextTypes);\n var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _childContextTypes);\n\n return function wrapWithConnect(WrappedComponent) {\n invariant(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + WrappedComponent));\n\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n withRef: withRef,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent\n });\n\n var Connect = function (_Component) {\n inherits(Connect, _Component);\n\n function Connect(props, context) {\n classCallCheck(this, Connect);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.version = version;\n _this.state = {};\n _this.renderCount = 0;\n _this.store = _this.props[storeKey] || _this.context[storeKey];\n _this.parentSub = props[subscriptionKey] || context[subscriptionKey];\n\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n\n invariant(_this.store, 'Could not find \"' + storeKey + '\" in either the context or ' + ('props of \"' + displayName + '\". ') + 'Either wrap the root component in a <Provider>, ' + ('or explicitly pass \"' + storeKey + '\" as a prop to \"' + displayName + '\".'));\n\n // make sure `getState` is properly bound in order to avoid breaking\n // custom store implementations that rely on the store's context\n _this.getState = _this.store.getState.bind(_this.store);\n\n _this.initSelector();\n _this.initSubscription();\n return _this;\n }\n\n Connect.prototype.getChildContext = function getChildContext() {\n var _ref2;\n\n return _ref2 = {}, _ref2[subscriptionKey] = this.subscription || this.parentSub, _ref2;\n };\n\n Connect.prototype.componentDidMount = function componentDidMount() {\n if (!shouldHandleStateChanges) return;\n\n // componentWillMount fires during server side rendering, but componentDidMount and\n // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.\n // Otherwise, unsubscription would never take place during SSR, causing a memory leak.\n // To handle the case where a child component may have triggered a state change by\n // dispatching an action in its componentWillMount, we have to re-run the select and maybe\n // re-render.\n this.subscription.trySubscribe();\n this.selector.run(this.props);\n if (this.selector.shouldComponentUpdate) this.forceUpdate();\n };\n\n Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n this.selector.run(nextProps);\n };\n\n Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() {\n return this.selector.shouldComponentUpdate;\n };\n\n Connect.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.subscription) this.subscription.tryUnsubscribe();\n // these are just to guard against extra memory leakage if a parent element doesn't\n // dereference this instance properly, such as an async callback that never finishes\n this.subscription = null;\n this.store = null;\n this.parentSub = null;\n this.selector.run = function () {};\n };\n\n Connect.prototype.getWrappedInstance = function getWrappedInstance() {\n invariant(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.'));\n return this.wrappedInstance;\n };\n\n Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) {\n this.wrappedInstance = ref;\n };\n\n Connect.prototype.initSelector = function initSelector() {\n var dispatch = this.store.dispatch;\n var getState = this.getState;\n\n var sourceSelector = selectorFactory(dispatch, selectorFactoryOptions);\n\n // wrap the selector in an object that tracks its results between runs\n var selector = this.selector = {\n shouldComponentUpdate: true,\n props: sourceSelector(getState(), this.props),\n run: function runComponentSelector(props) {\n try {\n var nextProps = sourceSelector(getState(), props);\n if (selector.error || nextProps !== selector.props) {\n selector.shouldComponentUpdate = true;\n selector.props = nextProps;\n selector.error = null;\n }\n } catch (error) {\n selector.shouldComponentUpdate = true;\n selector.error = error;\n }\n }\n };\n };\n\n Connect.prototype.initSubscription = function initSubscription() {\n var _this2 = this;\n\n if (shouldHandleStateChanges) {\n (function () {\n var subscription = _this2.subscription = new Subscription(_this2.store, _this2.parentSub);\n var dummyState = {};\n\n subscription.onStateChange = function onStateChange() {\n this.selector.run(this.props);\n\n if (!this.selector.shouldComponentUpdate) {\n subscription.notifyNestedSubs();\n } else {\n this.componentDidUpdate = function componentDidUpdate() {\n this.componentDidUpdate = undefined;\n subscription.notifyNestedSubs();\n };\n\n this.setState(dummyState);\n }\n }.bind(_this2);\n })();\n }\n };\n\n Connect.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.subscription) && this.subscription.isSubscribed();\n };\n\n Connect.prototype.addExtraProps = function addExtraProps(props) {\n if (!withRef && !renderCountProp) return props;\n // make a shallow copy so that fields added don't leak to the original selector.\n // this is especially important for 'ref' since that's a reference back to the component\n // instance. a singleton memoized selector would then be holding a reference to the\n // instance, preventing the instance from being garbage collected, and that would be bad\n var withExtras = _extends({}, props);\n if (withRef) withExtras.ref = this.setWrappedInstance;\n if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;\n return withExtras;\n };\n\n Connect.prototype.render = function render() {\n var selector = this.selector;\n selector.shouldComponentUpdate = false;\n\n if (selector.error) {\n throw selector.error;\n } else {\n return preact.h(WrappedComponent, this.addExtraProps(selector.props));\n }\n };\n\n return Connect;\n }(preact.Component);\n\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = displayName;\n Connect.childContextTypes = childContextTypes;\n Connect.contextTypes = contextTypes;\n\n\n {\n Connect.prototype.componentWillUpdate = function componentWillUpdate() {\n // We are hot reloading!\n if (this.version !== version) {\n this.version = version;\n this.initSelector();\n\n if (this.subscription) this.subscription.tryUnsubscribe();\n this.initSubscription();\n if (shouldHandleStateChanges) this.subscription.trySubscribe();\n }\n };\n }\n\n return index(Connect, WrappedComponent);\n };\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n\n var countA = 0;\n var countB = 0;\n\n for (var key in a) {\n if (hasOwn.call(a, key) && a[key] !== b[key]) return false;\n countA++;\n }\n\n for (var _key in b) {\n if (hasOwn.call(b, _key)) countB++;\n }\n\n return countA === countB;\n}\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetPrototype = Object.getPrototypeOf;\n\n/**\n * Gets the `[[Prototype]]` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {null|Object} Returns the `[[Prototype]]`.\n */\nfunction getPrototype(value) {\n return nativeGetPrototype(Object(value));\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 * 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 === 'undefined' ? 'undefined' : _typeof(value)) == 'object';\n}\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = Function.prototype.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/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\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,\n * 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) || 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' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;\n}\n\nfunction verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.');\n }\n}\n\nfunction wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n}\n\n// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n// \n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\nfunction getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\n\n// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n// \n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n// \n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n// \n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n// \nfunction wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}\n\nfunction whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\n\nfunction whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return { dispatch: dispatch };\n }) : undefined;\n}\n\nfunction whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && (typeof mapDispatchToProps === 'undefined' ? 'undefined' : _typeof(mapDispatchToProps)) === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return redux.bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\n\nvar defaultMapDispatchToPropsFactories = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];\n\nfunction whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\n\nfunction whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\n\nvar defaultMapStateToPropsFactories = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];\n\nfunction defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, stateProps, dispatchProps);\n}\n\nfunction wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName;\n var pure = _ref.pure;\n var areMergedPropsEqual = _ref.areMergedPropsEqual;\n\n var hasRunOnce = false;\n var mergedProps = void 0;\n\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n\n verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\n\nfunction whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\n\nfunction whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\n\nvar defaultMergePropsFactories = [whenMergePropsIsFunction, whenMergePropsIsOmitted];\n\nfunction verify(selector, methodName, displayName) {\n if (!selector) {\n throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.');\n } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {\n if (!selector.hasOwnProperty('dependsOnOwnProps')) {\n warning('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.');\n }\n }\n}\n\nfunction verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {\n verify(mapStateToProps, 'mapStateToProps', displayName);\n verify(mapDispatchToProps, 'mapDispatchToProps', displayName);\n verify(mergeProps, 'mergeProps', displayName);\n}\n\nfunction impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\n\nfunction pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual;\n var areOwnPropsEqual = _ref.areOwnPropsEqual;\n var areStatePropsEqual = _ref.areStatePropsEqual;\n\n var hasRunAtLeastOnce = false;\n var state = void 0;\n var ownProps = void 0;\n var stateProps = void 0;\n var dispatchProps = void 0;\n var mergedProps = void 0;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state);\n state = nextState;\n ownProps = nextOwnProps;\n\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n}\n\n// TODO: Add more comments\n\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nfunction finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps;\n var initMapDispatchToProps = _ref2.initMapDispatchToProps;\n var initMergeProps = _ref2.initMergeProps;\n var options = objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}\n\n/*\n connect is a facade over connectAdvanced. It turns its args into a compatible\n selectorFactory, which has the signature:\n\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\n \n connect passes its args to connectAdvanced as options, which will in turn pass them to\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\n\n selectorFactory returns a final props selector from its mapStateToProps,\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\n mergePropsFactories, and pure args.\n\n The resulting final props selector is called by the Connect component instance whenever\n it receives new props or store state.\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error('Invalid value of type ' + (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.');\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n}\n\n// createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\nfunction createConnect() {\n var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var _ref$connectHOC = _ref.connectHOC;\n var connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC;\n var _ref$mapStateToPropsF = _ref.mapStateToPropsFactories;\n var mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF;\n var _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories;\n var mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro;\n var _ref$mergePropsFactor = _ref.mergePropsFactories;\n var mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor;\n var _ref$selectorFactory = _ref.selectorFactory;\n var selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];\n\n var _ref2$pure = _ref2.pure;\n var pure = _ref2$pure === undefined ? true : _ref2$pure;\n var _ref2$areStatesEqual = _ref2.areStatesEqual;\n var areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual;\n var _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual;\n var areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua;\n var _ref2$areStatePropsEq = _ref2.areStatePropsEqual;\n var areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq;\n var _ref2$areMergedPropsE = _ref2.areMergedPropsEqual;\n var areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE;\n var extraOptions = objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}\n\nvar connect$1 = createConnect();\n\n\n\nvar lib$1 = {\n\tProvider: Provider,\n\tconnect: connect$1,\n\tconnectAdvanced: connectAdvanced\n};\n\nreturn lib$1;\n\n})));\n//# sourceMappingURL=preact-redux.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/preact-redux/dist/preact-redux.js\n// module id = 1\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/preact-redux/dist/preact-redux.js","//@flow\nimport { Component } from 'preact';\nimport Player from 'playkit-js';\nimport LoggerFactory from '../utils/logger';\n\nclass BaseComponent extends Component {\n player: Player;\n name: string;\n config: Object;\n logger: any;\n\n constructor(obj?: IControlParams = { config: {} }) {\n super();\n\n this.name = obj.name;\n this.player = obj.player;\n this.config = obj.config;\n this.logger = LoggerFactory.getLogger(`UI ${this.name}`);\n this.logger.debug(`Initialized`);\n }\n\n getConfig(attr?: string): any {\n if (attr) {\n return this.config[attr];\n }\n return this.config;\n }\n\n get defaultConfig() {\n return {}\n }\n}\n\nexport default BaseComponent;\n\n\n\n// WEBPACK FOOTER //\n// ./components/base.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/base.js","//@flow\nimport { bindActionCreators } from 'redux';\n\nexport function bindActions(actions) {\n\treturn dispatch => ({\n\t\t...bindActionCreators(actions, dispatch)\n\t});\n}\n\n\n\n// WEBPACK FOOTER //\n// ./utils/bind-actions.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/bind-actions.js","import { h, Component } from 'preact';\n\nclass Icon extends Component {\n\n render(props) {\n switch (props.type) {\n case 'maximize':\n return (\n <svg className='icon icon-maximize' viewBox='0 0 1024 1024'>\n <path d='M800 269.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z' />\n <path d='M224 754.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z' />\n </svg>\n )\n case 'minimize':\n return (\n <svg className='icon icon-minimize' viewBox='0 0 1024 1024'>\n <path d='M672 306.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z' />\n <path d='M352 717.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z' />\n </svg>\n )\n\n case 'play':\n return (\n <svg className='icon icon-play' viewBox='0 0 1024 1024'>\n <path d='M796.806 461.202c44.919 28.075 44.739 73.706 0 101.668l-459.472 287.171c-44.919 28.075-81.334 7.915-81.334-45.305v-585.4c0-53.096 36.595-73.266 81.334-45.305l459.472 287.171z' />\n </svg>\n )\n\n case 'pause':\n return (\n <svg className='icon icon-pause' viewBox='0 0 1024 1024'>\n <path d='M256 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314zM640 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314z' />\n </svg>\n )\n\n case 'volume-base':\n return (\n <svg className='icon volume-base' viewBox='0 0 1024 1024'>\n <path d='M224 352l234.504-156.336c29.545-19.697 53.496-7.194 53.496 28.053v576.566c0 35.19-24.059 47.677-53.496 28.053l-234.504-156.336h-127.906c-17.725 0-32.094-14.581-32.094-31.853v-256.295c0-17.592 14.012-31.853 32.094-31.853h127.906zM288 637.748l160 106.667v-464.83l-160 106.667v251.496zM128 416v192h96v-192h-96z' />\n </svg>\n )\n\n case 'volume-waves':\n return (\n <svg className='icon volume-waves' viewBox='0 0 1024 1024'>\n <path d='M802.017 837.177c82.359-86.627 129.183-201.774 129.183-324.26 0-123.976-47.976-240.409-132.127-327.329-12.293-12.697-32.552-13.025-45.249-0.732s-13.025 32.552-0.732 45.249c72.692 75.084 114.109 175.597 114.109 282.812 0 105.928-40.422 205.331-111.566 280.162-12.177 12.808-11.666 33.063 1.143 45.24s33.063 11.666 45.24-1.143z' />\n <path d='M667.436 743.221c67.761-60.884 107.273-147.888 107.273-241.233 0-87.318-34.552-169.203-94.836-229.446-12.501-12.493-32.762-12.486-45.255 0.015s-12.486 32.762 0.015 45.255c48.375 48.342 76.075 113.989 76.075 184.176 0 75.021-31.679 144.776-86.048 193.627-13.146 11.812-14.227 32.044-2.416 45.19s32.044 14.227 45.19 2.416z' />\n </svg>\n )\n\n case 'volume-mute':\n return (\n <svg className='icon volume-mute' viewBox='0 0 1024 1024'>\n <path d='M768 466.745l-67.986-67.986c-12.213-12.213-32.654-12.393-45.151 0.104-12.584 12.584-12.543 32.711-0.104 45.151l67.986 67.986-67.986 67.986c-12.213 12.213-12.393 32.654 0.104 45.151 12.584 12.584 32.711 12.543 45.151 0.104l67.986-67.986 67.986 67.986c12.213 12.213 32.654 12.393 45.151-0.104 12.584-12.584 12.543-32.711 0.104-45.151l-67.986-67.986 67.986-67.986c12.213-12.213 12.393-32.654-0.104-45.151-12.584-12.584-32.711-12.543-45.151-0.104l-67.986 67.986z' />\n </svg>\n )\n\n case 'close':\n return (\n <svg className='icon icon-close' viewBox='0 0 1024 1024'>\n <path d='M573.162 512l214.269-214.269c16.772-16.772 16.688-44.071-0.202-60.96-17.007-17.007-44.182-16.98-60.96-0.202l-214.269 214.269-214.269-214.269c-16.772-16.772-44.071-16.688-60.96 0.202-17.007 17.007-16.98 44.182-0.202 60.96l214.269 214.269-214.269 214.269c-16.772 16.772-16.688 44.071 0.202 60.96 17.007 17.007 44.182 16.98 60.96 0.202l214.269-214.269 214.269 214.269c16.772 16.772 44.071 16.688 60.96-0.202 17.007-17.007 16.98-44.182 0.202-60.96l-214.269-214.269z' />\n </svg>\n )\n\n case 'share':\n return (\n <svg className='icon icon-share' viewBox='0 0 1024 1024'>\n <path d='M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.129-5.295 0-58.91 47.756-106.667 106.667-106.667s106.667 47.756 106.667 106.667c0 58.91-47.756 106.667-106.667 106.667-33.894 0-64.095-15.808-83.633-40.454l-236.467 142.445c-0.132-3.064-0.394-6.095-0.779-9.087l7.271-12.835-0.117 53.333-7.183-12.743c0.399-3.046 0.67-6.131 0.806-9.252l236.467 142.383c19.538-24.648 49.741-40.457 83.636-40.457 58.91 0 106.667 47.756 106.667 106.667s-47.756 106.667-106.667 106.667c-58.91 0-106.667-47.756-106.667-106.667 0-1.775 0.043-3.539 0.129-5.293l-236.19-142.216c-19.528 24.867-49.868 40.841-83.939 40.841-58.91 0-106.667-47.756-106.667-106.667s47.756-106.667 106.667-106.667c34.091 0 64.447 15.993 83.974 40.886zM234.667 554.667c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 341.333c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 768c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667z' />\n </svg>\n )\n\n case 'settings':\n return (\n <svg className='icon icon-share' viewBox='0 0 1024 1024'>\n <path d='M829.945 549.126c2.784-24.116 2.784-48.445 0.269-70.702-1.182-6.772-7.090-11.696-13.674-11.641-33.039 0.582-62.975-19.389-75.126-50.118s-3.971-65.772 20.504-87.92c4.293-3.894 4.818-10.455 1.003-15.228-14.831-18.927-31.796-36.079-50.521-51.087-4.614-3.687-11.301-3.148-16.127 2.145-15.732 16.059-37.322 25.023-59.382 24.831-9.828 0.044-19.574-1.802-29.307-5.686-30.997-13.082-50.429-44.232-48.535-78.046 0.365-5.803-3.87-10.878-9.583-11.551-23.919-2.769-48.074-2.831-71.958-0.192-5.836 0.654-10.191 5.68-10.009 11.47 1.121 33.146-18.329 63.547-49.925 76.834-8.987 3.423-18.538 5.129-27.498 5.028-22.472 0.224-44.067-8.707-60.526-25.487-2.197-2.386-5.29-3.748-8.24-3.758-2.663 0.016-5.248 0.905-7.105 2.334-19.136 15.052-36.496 32.233-51.558 50.977-3.729 4.732-3.187 11.536 1.058 15.449 24.89 22.573 32.935 58.34 19.426 90.928-14.22 29.886-44.875 48.43-77.941 47.151-5.576-0.215-10.363 3.934-11.003 10.013-2.916 24.025-2.916 48.315-0.231 70.764 1.178 6.84 7.155 11.808 14.518 11.713l2.428 0.007c31.565 0.659 59.701 20.063 71.6 49.499 12.239 30.769 4.278 65.898-20.252 88.586-4.217 3.829-4.736 10.275-0.976 14.991 14.777 18.932 31.665 36.115 50.227 51.128 4.694 3.762 11.505 3.223 16.349-2.081 15.725-16.101 37.337-25.092 59.378-24.895 9.894-0.057 19.705 1.819 29.5 5.78 30.753 13.169 50.063 44.084 48.378 77.965-0.373 5.795 3.857 10.867 9.602 11.539 23.908 2.78 48.053 2.842 71.923 0.192 5.851-0.659 10.215-5.702 10.027-11.562-1.088-33.118 18.371-63.473 49.584-76.583 9.014-3.552 18.622-5.354 27.841-5.307 22.555-0.225 44.218 8.804 60.434 25.505 2.224 2.395 5.343 3.76 8.371 3.769 2.474-0.012 4.874-0.847 6.896-2.43 19.227-14.971 36.653-32.121 51.726-50.848 3.737-4.743 3.194-11.563-0.941-15.379-24.391-21.907-32.789-56.564-21.134-87.207s40.964-50.957 73.904-51.116h5.704c5.586-0.028 10.269-4.227 10.905-9.777zM893.526 556.438c-4.321 37.715-36.171 66.271-74.323 66.464h-5.711c-6.33 0.031-11.99 3.953-14.24 9.87s-0.629 12.609 4.385 17.116c29.020 26.748 32.567 71.325 7.936 102.582-18.378 22.837-39.342 43.468-62.397 61.42-13.128 10.284-29.303 15.909-46.22 15.991-21.004-0.056-41.043-8.825-54.839-23.692-3.514-3.616-8.356-5.634-13.867-5.583-1.555-0.007-3.097 0.282-3.877 0.581-6.088 2.559-9.967 8.609-9.749 15.235 1.257 39.227-27.828 72.841-66.88 77.241-28.725 3.189-57.719 3.114-86.45-0.227-39.585-4.631-68.615-39.444-66.083-78.749 0.331-6.679-3.529-12.859-9.057-15.234-1.449-0.585-2.998-0.881-5.025-0.873-5.074-0.045-9.947 1.982-12.693 4.763-26.775 29.494-71.875 33.067-103.071 8.066-22.458-18.164-42.771-38.831-60.335-61.337-24.602-30.847-21.012-75.5 7.982-101.818 4.881-4.515 6.479-11.568 4.088-17.58-2.239-5.538-7.562-9.209-12.866-9.327-39.748 0.506-72.828-26.991-79.581-66.425-3.538-29.147-3.538-58.616-0.060-87.234 4.085-39.084 37.791-68.296 77.064-66.784 7.502 0.29 14.456-3.916 17.001-9.164 2.519-6.098 0.94-13.122-4.133-17.724-29.022-26.738-32.57-71.311-7.956-102.538 18.292-22.765 39.115-43.375 62.322-61.626 13.199-10.169 29.368-15.731 46.323-15.833 21.063 0.065 41.146 8.908 54.704 23.656 3.559 3.623 8.44 5.642 14.175 5.592 1.605 0.017 3.199-0.268 3.668-0.426 6.11-2.574 9.998-8.651 9.771-15.356-1.228-39.209 27.864-72.786 66.897-77.161 28.715-3.173 57.697-3.098 86.456 0.231 39.539 4.653 68.54 39.409 66.051 78.92-0.369 6.596 3.446 12.713 8.931 15.035 1.507 0.6 3.114 0.905 5.156 0.898 5.087 0.044 9.973-1.985 12.671-4.704 26.66-29.444 71.625-33.068 102.694-8.244 22.604 18.117 43.043 38.781 60.715 61.337 24.728 30.927 21.142 75.751-8.215 102.378-4.724 4.275-6.301 11.031-3.958 16.955s8.114 9.775 14.774 9.659c38.18-0.325 70.992 27.018 77.822 66.463 3.343 28.966 3.343 58.22 0 87.185zM511.951 597.037c47.144-0.118 85.24-38.367 85.169-85.511 0-34.617-20.872-65.819-52.867-79.034s-68.802-5.836-93.231 18.69c-24.429 24.527-31.66 61.363-18.317 93.305s44.628 52.688 79.245 52.55zM512.158 661.036c-60.477 0.242-115.178-36.032-138.507-91.881s-10.686-120.254 32.026-163.138c42.712-42.884 107.066-55.785 163.008-32.679s92.434 77.661 92.434 138.139c0.124 82.417-66.545 149.353-148.962 149.559z' />\n </svg>\n )\n\n case 'check':\n return (\n <svg className='icon check-icon' viewBox='0 0 1024 1024'>\n <path d='M342.481 563.894c-12.577-12.416-32.838-12.285-45.254 0.292s-12.285 32.838 0.292 45.254l118.857 117.333c13.275 13.105 34.901 12.123 46.933-2.131l297.143-352c11.4-13.505 9.694-33.694-3.811-45.094s-33.694-9.694-45.094 3.811l-274.828 325.566-94.238-93.030z' />\n </svg>\n )\n case 'language':\n return (\n <svg className='icon language-icon' viewBox='0 0 1024 1024'>\n <path d='M625.773 808.031c29.752-39.944 63.443-97.069 83.311-168.977 41.798-3.715 74.872-8.022 98.271-11.57-32.456 82.71-98.638 148.558-181.582 180.547zM216.562 627.283c23.516 3.506 56.799 7.797 98.279 11.528 19.868 72.017 53.601 129.224 83.378 169.219-83.002-32.014-149.226-97.945-181.657-180.747zM400.147 215.201c-29.835 40.32-64.161 98.037-84.572 169.695-42.123 3.731-75.423 8.072-98.938 11.629 32.698-83.353 99.656-149.61 183.51-181.323zM807.438 396.725c-23.641-3.523-57.158-7.847-98.947-11.587-20.402-71.766-54.778-129.567-84.639-169.937 83.912 31.73 150.912 98.070 183.585 181.523zM720.095 436.644c48.952 4.817 84.472 10.209 102.995 13.331 3.99 20.068 6.127 40.796 6.127 62.024 0 21.262-2.137 42.031-6.152 62.141-18.248 3.172-53.376 8.615-102.753 13.448 3.84-23.908 6.069-49.102 6.069-75.59 0-26.296-2.304-51.431-6.286-75.356zM537.043 597.206v-170.396c48.576 0.551 92.653 2.646 131.178 5.426 5.050 25.119 8.072 51.74 8.072 79.763 0 28.216-2.913 54.87-7.789 79.939-38.283 2.713-82.343 4.742-131.462 5.267zM486.957 195.859v180.856c-43.175 0.442-82.443 1.995-117.429 4.149 31.939-95.382 89.99-161.656 112.237-184.612 1.72-0.159 3.464-0.259 5.192-0.392zM542.286 196.26c22.297 22.906 80.456 89.080 112.345 184.771-35.261-2.229-74.646-3.848-117.587-4.307v-180.864c1.745 0.142 3.506 0.234 5.242 0.401zM347.706 512c0-28.074 3.047-54.762 8.156-79.955 38.191-2.696 82.134-4.708 131.094-5.234v170.387c-48.71-0.551-92.895-2.655-131.495-5.443-4.858-25.018-7.755-51.606-7.755-79.755zM194.783 512c0-21.262 2.137-42.031 6.144-62.125 18.282-3.181 53.501-8.64 103.012-13.482-4.007 24-6.319 49.219-6.319 75.606 0 26.396 2.221 51.506 6.027 75.339-48.826-4.808-84.246-10.184-102.737-13.306-3.99-20.068-6.127-40.804-6.127-62.033zM481.338 827.706c-22.389-22.314-81.016-87.469-112.662-184.779 35.437 2.262 75.047 3.898 118.28 4.366v180.839c-1.87-0.142-3.757-0.25-5.618-0.426zM542.653 827.706c-1.862 0.175-3.74 0.284-5.61 0.426v-180.839c43.509-0.442 83.044-2.012 118.222-4.199-31.672 97.244-90.265 162.349-112.612 184.612zM512 128c-211.734 0-384 172.257-384 384 0 211.734 172.266 384 384 384s384-172.266 384-384c0-211.743-172.266-384-384-384z' />\n </svg>\n )\n\n default:\n break;\n }\n }\n}\n\nexport default Icon;\n\n\n\n// WEBPACK FOOTER //\n// ./components/icon/icon.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/icon/icon.js","function n(n){return n&&\"object\"==typeof n&&\"default\"in n?n.default:n}function t(n){return null!==n&&void 0!==n}function r(n,t){var o=e({},n);for(var i in t)t.hasOwnProperty(i)&&(o[i]=n[i]&&t[i]&&\"object\"==typeof n[i]&&\"object\"==typeof t[i]?r(n[i],t[i]):n[i]||t[i]);return o}function e(n,t){for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function o(n){if(n=n||{},\"string\"==typeof n&&(n=n.split(\",\")),\"join\"in n){for(var t={},r=0;r<n.length;r++){var e=n[r].trim();e&&(t[e.split(\".\").pop()]=e)}return t}return n}function i(n,t){return v=t||h,n&&n.replace(/\\{\\{([\\w.-]+)\\}\\}/g,u)}function u(n,t){for(var r=t.split(\".\"),e=v,o=0;o<r.length;o++)if(null==(e=e[r[o]]))return\"\";return\"string\"==typeof e&&e.match(/\\{\\{/)&&(e=i(e,v)),e}function c(n,r,e,o,u,c){r&&(n=r+\".\"+n);var a=e&&f(e,n);return(u||0===u)&&a&&\"object\"==typeof a&&(a=a.splice?a[u]||a[0]:0===u&&t(a.none)?a.none:1===u&&t(a.one||a.singular)?a.one||a.singular:a.some||a.many||a.plural||a.other||a),a&&i(a,o)||c||null}function a(n,t,r){var i={};t=t||{},n=o(n);for(var u in n)if(n.hasOwnProperty(u)&&n[u]){var a=n[u];r||\"string\"!=typeof a?a.nodeName===g&&(a=e({fallback:a.children&&a.children[0]},a.attributes),i[u]=c(a.id,t.scope,t.dictionary,a.fields,a.plural,a.fallback)):i[u]=c(a,t.scope,t.dictionary)}return i}var l=require(\"preact\"),f=n(require(\"dlv\")),p=/[?&#]intl=show/,s=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getChildContext=function(){var n=this.props,t=n.scope,o=n.definition,i=n.mark,u=e({},this.context.intl||{});return t&&(u.scope=t),o&&(u.dictionary=r(u.dictionary||{},o)),(i||\"undefined\"!=typeof location&&String(location).match(p))&&(u.mark=!0),{intl:u}},t.prototype.render=function(n){var t=n.children;return t&&t[0]||null},t}(l.Component),d=function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];if(n.length>1){return y(n[0],n[1])}var r=n[0];return function(n){return y(n,r)}},y=function(n,t){return function(r){return l.h(s,t||{},l.h(n,r))}},h={},v,g=function(n,t){var r=n.id,e=n.children,o=n.plural,i=n.fields,u=t.intl,a=e&&e[0],p=c(r,u&&u.scope,u&&u.dictionary,i,o,a);if(u&&u.mark){var s=\"dictionary\"+(u&&u.scope?\".\"+u.scope:\"\")+\".\"+r;return l.h(\"mark\",{style:\"background: \"+(p?f(u,s)?\"rgba(119,231,117,.5)\":\"rgba(229,226,41,.5)\":\"rgba(228,147,51,.5)\"),title:r},p)}return p},b=function(n,t){var r=n.children,e=t.intl,o=r&&r[0];return o&&l.cloneElement(o,a(o.attributes,e,!0))},m=function(n){return function(t){return function(r,e){var o=\"function\"==typeof n?n(r):n,i=a(o,e.intl);return l.h(t,assign({},r,i))}}};d.intl=d,d.IntlProvider=s,d.Text=g,d.Localizer=b,d.withText=m,module.exports=d;\n//# sourceMappingURL=preact-i18n.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/preact-i18n/dist/preact-i18n.js\n// module id = 5\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/preact-i18n/dist/preact-i18n.js","import createStore from './createStore';\nimport combineReducers from './combineReducers';\nimport bindActionCreators from './bindActionCreators';\nimport applyMiddleware from './applyMiddleware';\nimport compose from './compose';\nimport warning from './utils/warning';\n\n/*\n* This is a dummy function to check if the function name has been altered by minification.\n* If the function has been minified and NODE_ENV !== 'production', warn the user.\n*/\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \\'production\\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { createStore, combineReducers, bindActionCreators, applyMiddleware, compose };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/index.js\n// module id = 6\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/index.js","/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nexport default function warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/utils/warning.js\n// module id = 7\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/utils/warning.js","//@flow\n\nexport const types = {\n ADD_PLAYER_CLASS: 'shell/ADD_PLAYER_CLASS',\n REMOVE_PLAYER_CLASS: 'shell/REMOVE_PLAYER_CLASS',\n UPDATE_IS_MOBILE: 'shell/UPDATE_IS_MOBILE'\n}\n\nexport const initialState = {\n playerClasses: []\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.ADD_PLAYER_CLASS:\n return {\n ...state,\n playerClasses: [...state.playerClasses, action.className]\n }\n\n case types.REMOVE_PLAYER_CLASS:\n return {\n ...state,\n playerClasses: state.playerClasses.filter(c => c !== action.className)\n }\n\n case types.UPDATE_IS_MOBILE:\n return {\n ...state,\n isMobile: action.isMobile\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n addPlayerClass: (className: string) => ({ type: types.ADD_PLAYER_CLASS, className }),\n removePlayerClass: (className: string) => ({ type: types.REMOVE_PLAYER_CLASS, className }),\n updateIsMobile: (isMobile: boolean) => ({ type: types.UPDATE_IS_MOBILE, isMobile })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/shell.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/shell.js","//@flow\n\nexport const types = {\n TOGGLE_PLAY: 'play-pause/TOGGLE_PLAY'\n}\n\nexport const initialState = {\n isPlaying: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.TOGGLE_PLAY:\n return {\n ...state,\n isPlaying: action.isPlaying\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n toggleIsPlaying: (isPlaying: boolean) => ({ type: types.TOGGLE_PLAY, isPlaying })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/play-pause.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/play-pause.js","//@flow\n\nexport const types = {\n TOGGLE_SHARE_OVERLAY: 'share/TOGGLE_SHARE_OVERLAY'\n}\n\nexport const initialState = {\n overlayOpen: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.TOGGLE_SHARE_OVERLAY:\n return {\n ...state,\n overlayOpen: action.show\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n toggleShareOverlay: (show: boolean) => ({ type: types.TOGGLE_SHARE_OVERLAY, show })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/share.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/share.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;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\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// ../node_modules/process/browser.js\n// module id = 11\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/process/browser.js","import isPlainObject from 'lodash-es/isPlainObject';\nimport $$observable from 'symbol-observable';\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nexport var ActionTypes = {\n INIT: '@@redux/INIT'\n\n /**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n};export default function createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n function getState() {\n return currentState;\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected listener to be a function.');\n }\n\n var isSubscribed = true;\n\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n isSubscribed = false;\n\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer;\n dispatch({ type: ActionTypes.INIT });\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object') {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return { unsubscribe: unsubscribe };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch({ type: ActionTypes.INIT });\n\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/createStore.js\n// module id = 12\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/createStore.js","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\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 * 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) || baseGetTag(value) != objectTag) {\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' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/isPlainObject.js\n// module id = 13\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/isPlainObject.js","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_Symbol.js\n// module id = 14\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_Symbol.js","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/webpack/buildin/global.js\n// module id = 15\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/webpack/buildin/global.js","/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nexport default function compose() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(undefined, arguments));\n };\n });\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/compose.js\n// module id = 16\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/compose.js","//@flow\nexport const types = {\n UPDATE_PLAYER_STATE: 'engine/UPDATE_PLAYER_STATE',\n UPDATE_IS_PLAYING: 'engine/UPDATE_IS_PLAYING',\n UPDATE_CURRENT_TIME: 'engine/UPDATE_CURRENT_TIME',\n UPDATE_DURATION: 'engine/UPDATE_DURATION',\n UPDATE_VOLUME: 'engine/UPDATE_VOLUME',\n UPDATE_MUTED: 'engine/UPDATE_MUTED',\n UPDATE_METADATA_LOADING_STATUS: 'engine/UPDATE_METADATA_LOADING_STATUS',\n UPDATE_AUDIO_TRACKS: 'engine/UPDATE_AUDIO_TRACKS',\n UPDATE_VIDEO_TRACKS: 'engine/UPDATE_VIDEO_TRACKS',\n UPDATE_TEXT_TRACKS: 'engine/UPDATE_TEXT_TRACKS'\n}\n\nexport const initialState = {\n\tisPlaying: false,\n metadataLoaded: false,\n playerState: {\n previousState: '',\n currentState: ''\n },\n currentTime: 0,\n duration: 0,\n volume: 1,\n muted: false,\n videoTracks: [],\n audioTracks: [],\n textTracks: []\n}\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_PLAYER_STATE:\n return {\n ...state,\n playerState: action.playerState\n }\n\n case types.UPDATE_IS_PLAYING:\n return {\n ...state,\n isPlaying: action.isPlaying\n }\n\n case types.UPDATE_CURRENT_TIME:\n return {\n ...state,\n currentTime: action.currentTime\n }\n\n case types.UPDATE_DURATION:\n return {\n ...state,\n duration: action.duration\n }\n\n case types.UPDATE_VOLUME:\n return {\n ...state,\n volume: action.volume\n }\n\n case types.UPDATE_MUTED:\n return {\n ...state,\n muted: action.muted\n }\n\n case types.UPDATE_METADATA_LOADING_STATUS:\n return {\n ...state,\n metadataLoaded: action.metadataLoaded\n }\n\n case types.UPDATE_AUDIO_TRACKS:\n return {\n ...state,\n audioTracks: action.tracks\n }\n\n case types.UPDATE_VIDEO_TRACKS:\n return {\n ...state,\n videoTracks: action.tracks\n }\n\n case types.UPDATE_TEXT_TRACKS:\n return {\n ...state,\n textTracks: action.tracks\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updatePlayerState: (prevoiusState: string, currentState: string) => ({ type: types.UPDATE_PLAYER_STATE, playerState: {prevoiusState, currentState} }),\n updateIsPlaying: (isPlaying: boolean) => ({ type: types.UPDATE_IS_PLAYING, isPlaying }),\n updateCurrentTime: (currentTime: number) => ({ type: types.UPDATE_CURRENT_TIME, currentTime }),\n updateDuration: (duration: number) => ({ type: types.UPDATE_DURATION, duration }),\n updateVolume: (volume: number) => ({ type: types.UPDATE_VOLUME, volume }),\n updateMuted: (muted: boolean) => ({ type: types.UPDATE_MUTED, muted }),\n updateMetadataLoadingStatus: (metadataLoaded: boolean) => ({ type: types.UPDATE_METADATA_LOADING_STATUS, metadataLoaded }),\n updateAudioTracks: (tracks) => ({ type: types.UPDATE_AUDIO_TRACKS, tracks }),\n updateVideoTracks: (tracks) => ({ type: types.UPDATE_VIDEO_TRACKS, tracks }),\n updateTextTracks: (tracks) => ({ type: types.UPDATE_TEXT_TRACKS, tracks })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/engine.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/engine.js","//@flow\n\nexport const types = {\n UPDATE_SEEKBAR_DRAGGING_STATUS: 'seekbar/UPDATE_SEEKBAR_DRAGGING_STATUS',\n UPDATE_CURRENT_TIME: 'seekbar/UPDATE_CURRENT_TIME',\n UPDATE_DURATION: 'seekbar/UPDATE_DURATION'\n}\n\nexport const initialState = {\n\tcurrentTime: 0,\n duration: 0,\n draggingActive: false\n}\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_SEEKBAR_DRAGGING_STATUS:\n return {\n ...state,\n draggingActive: action.draggingActive\n }\n\n case types.UPDATE_CURRENT_TIME:\n return {\n ...state,\n currentTime: action.currentTime\n }\n\n case types.UPDATE_DURATION:\n return {\n ...state,\n duration: action.duration\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateSeekbarDraggingStatus: (draggingActive: boolean) => ({ type: types.UPDATE_SEEKBAR_DRAGGING_STATUS, draggingActive }),\n updateDuration: (duration: number) => ({ type: types.UPDATE_DURATION, duration }),\n updateCurrentTime: (currentTime: number) => ({ type: types.UPDATE_CURRENT_TIME, currentTime })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/seekbar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/seekbar.js","//@flow\n\nexport const types = {\n UPDATE_VOLUME: 'volume/UPDATE_VOLUME',\n UPDATE_VOLUME_DRAGGING_STATUS: 'volume/UPDATE_VOLUME_DRAGGING_STATUS',\n UPDATE_MUTED: 'volume/UPDATE_MUTED'\n}\n\nexport const initialState = {\n draggingActive: false,\n volume: 1,\n muted: false\n}\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_VOLUME:\n return {\n ...state,\n volume: action.volume\n }\n\n case types.UPDATE_VOLUME_DRAGGING_STATUS:\n return {\n ...state,\n draggingActive: action.draggingActive\n }\n\n case types.UPDATE_MUTED:\n return {\n ...state,\n muted: action.muted\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateVolume: (volume: number) => ({ type: types.UPDATE_VOLUME, volume }),\n updateVolumeDraggingStatus: (draggingActive: boolean) => ({ type: types.UPDATE_VOLUME_DRAGGING_STATUS, draggingActive }),\n updateMuted: (muted: boolean) => ({ type: types.UPDATE_MUTED, muted })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/volume.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/volume.js","//@flow\nexport const types = {\n UPDATE_FULLSCREEN: 'fullscreen/UPDATE_FULLSCREEN'\n}\n\nexport const initialState = {\n fullscreen: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_FULLSCREEN:\n return {\n ...state,\n fullscreen: action.fullscreen\n }\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateFullscreen: (fullscreen: boolean) => ({ type: types.UPDATE_FULLSCREEN, fullscreen })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/fullscreen.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/fullscreen.js","//@flow\n\nexport const types = {\n UPDATE_LOADING_SPINNER_STATE: 'loading/UPDATE_LOADING_SPINNER_STATE'\n}\n\nexport const initialState = {\n showLoadingSpinner: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_LOADING_SPINNER_STATE:\n return {\n ...state,\n show: action.show\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateLoadingSpinnerState: (show: boolean) => ({ type: types.UPDATE_LOADING_SPINNER_STATE, show })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/loading.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/loading.js","//@flow\n\nexport const types = {\n TOGGLE_CVAA_OVERLAY: 'share/TOGGLE_CVAA_OVERLAY'\n}\n\nexport const initialState = {\n overlayOpen: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.TOGGLE_CVAA_OVERLAY:\n return {\n ...state,\n overlayOpen: action.show\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n toggleCVAAOverlay: (show: boolean) => ({ type: types.TOGGLE_CVAA_OVERLAY, show })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/cvaa.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/cvaa.js","//@flow\n\nexport const types = {\n UPDATE_QUALITY: 'settings/UPDATE_QUALITY',\n UPDATE_SPEED: 'settings/UPDATE_SPEED'\n}\n\nexport const initialState = {\n quality: 1,\n speed: 2\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_QUALITY:\n return {\n ...state,\n quality: action.quality\n }\n\n case types.UPDATE_SPEED:\n return {\n ...state,\n speed: action.speed\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateQuality: (quality: string) => ({ type: types.UPDATE_QUALITY, quality }),\n updateSpeed: (speed: string) => ({ type: types.UPDATE_SPEED, speed })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/settings.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/settings.js","//@flow\n\nfunction toHHMMSS(input) {\n var sec_num = parseInt(input, 10);\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n var seconds = sec_num - (hours * 3600) - (minutes * 60);\n\n if (hours < 10) {hours = \"0\"+hours;}\n if (minutes < 10) {minutes = \"0\"+minutes;}\n if (seconds < 10) {seconds = \"0\"+seconds;}\n\n return `${minutes}:${seconds}`;\n}\n\nexport {toHHMMSS};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/time-format.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/time-format.js","//@flow\nimport { h, Component } from 'preact';\n\nclass SmartContainer extends Component {\n render(props) {\n return (\n <div className='smart-container top left'>\n {props.children}\n </div>\n )\n }\n}\n\nexport default SmartContainer;\n\n\n\n// WEBPACK FOOTER //\n// ./components/smart-container/smart-container.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/smart-container/smart-container.js","//@flow\nimport { h, Component } from 'preact';\nimport DropDownMenu from '../dropdown-menu/dropdown-menu';\n\nclass SmartContainer extends Component {\n render(props) {\n return (\n <div className='smart-container-item select-menu-item'>\n <label htmlFor='quality'>{props.label}</label>\n <DropDownMenu onSelect={o => props.onSelect(o)} options={props.options} />\n </div>\n )\n }\n}\n\nexport default SmartContainer;\n\n\n\n// WEBPACK FOOTER //\n// ./components/smart-container/smart-container-item.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/smart-container/smart-container-item.js","//@flow\nimport { h, Component } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/shell';\nimport Icon from '../icon/icon';\n\n@connect(null, bindActions(actions))\nclass Overlay extends Component {\n\n componentDidUpdate() {\n this.props.open ? this.props.addPlayerClass('overlay-active') : this.props.removePlayerClass('overlay-active');\n }\n\n render(props) {\n var overlayClass = 'overlay';\n if (props.type) overlayClass += ` ${props.type}-overlay`;\n if (props.open) overlayClass += ' active'\n\n return (\n <div className={overlayClass} role='dialog'>\n <Localizer>\n <a onClick={() => props.onClose()} aria-label={<Text id='core.close' />} className='close-overlay'><Icon type='close' /></a>\n </Localizer>\n { props.children }\n </div>\n )\n }\n}\n\nexport default Overlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/overlay/overlay.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/overlay/overlay.js","//@flow\nimport {h, render} from 'preact';\nimport {Provider} from 'preact-redux';\nimport {IntlProvider} from 'preact-i18n';\nimport { createStore } from 'redux';\n\nimport reducer from './store';\nimport definition from './fr.json';\n\nimport EngineConnector from './components/engine-connector/engine-connector';\nimport Shell from './components/shell/shell';\nimport OverlayPlay from './components/overlay-play/overlay-play';\nimport Loading from './components/loading/loading';\nimport PlayPauseControl from './components/play-pause/play-pause';\nimport SeekBarControl from './components/seekbar/seekbar';\nimport VolumeControl from './components/volume/volume';\nimport ShareControl from './components/share/share'\nimport SettingsControl from './components/settings/settings';\nimport LanguageControl from './components/language/language';\nimport FullscreenControl from './components/fullscreen/fullscreen';\nimport TimeDisplay from './components/time-display/time-display';\nimport TopBar from './components/top-bar/top-bar';\nimport BottomBar from './components/bottom-bar/bottom-bar';\nimport ShareOverlay from './components/share-overlay/share-overlay';\nimport CVAAOverlay from './components/cvaa-overlay/cvaa-overlay';\nimport KeyboardControl from './components/keyboard';\n\nclass UIManager {\n player: any;\n config: any;\n\n constructor(player, config) {\n this.player = player;\n this.config = config;\n this.config.ui = {\n \"translations\": {\n \"controls\": {\n \"language\": \"שפה\"\n }\n },\n \"components\": {\n \"Loading\": {\n \"enabled\": true\n },\n \"OverlayPlay\": {\n \"enabled\": true\n }\n }\n }\n }\n\n buildCustomUI(template): void {\n this._buildUI(template);\n }\n\n buildDefaultUI(): void {\n const store = createStore(reducer, window.devToolsExtension && window.devToolsExtension({ name: `playkit #${this.config.target}`, instanceId: this.config.target }));\n\n let template = (\n <Provider store={store}>\n <IntlProvider definition={definition}>\n <Shell>\n <div className='player-holder' />\n <EngineConnector player={this.player} />\n <KeyboardControl player={this.player} />\n <Loading player={this.player} />\n <div className='player-gui'>\n <OverlayPlay player={this.player} />\n <TopBar>\n <div className='left-controls'>\n <div className='video-playing-title'>L21 Earth Time Lapse View from Space, ISS</div>\n </div>\n <div className='right-controls'>\n <ShareControl player={this.player} />\n </div>\n </TopBar>\n <BottomBar>\n <SeekBarControl showFramePreview showTimeBubble player={this.player} />\n <div className='left-controls'>\n <PlayPauseControl player={this.player} />\n <TimeDisplay format='current / total' player={this.player} />\n </div>\n <div className='right-controls'>\n <VolumeControl player={this.player} />\n <LanguageControl player={this.player} />\n <SettingsControl player={this.player} />\n <FullscreenControl player={this.player} />\n </div>\n </BottomBar>\n <ShareOverlay />\n <CVAAOverlay />\n </div>\n </Shell>\n </IntlProvider>\n </Provider>\n );\n this._buildUI(template);\n }\n\n _buildUI(template) {\n if (!this.player) return;\n\n let playerWrapper = document.createElement('div');\n document.body.appendChild(playerWrapper);\n render(template, playerWrapper);\n\n let playerElement = document.getElementsByTagName('video')[this.config.target === 'player1' ? 0 : 1];\n // let playerElement = document.getElementById(this.config.target); // the right way\n playerElement.removeAttribute('style');\n playerWrapper.getElementsByClassName('player-holder')[0].appendChild(playerElement);\n }\n\n release(): void { }\n\n}\n\nexport default UIManager;\n\n\n\n\n// WEBPACK FOOTER //\n// ./ui-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/ui-manager.js","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_baseGetTag.js\n// module id = 29\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_baseGetTag.js","import freeGlobal from './_freeGlobal.js';\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\nexport default root;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_root.js\n// module id = 30\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_root.js","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_freeGlobal.js\n// module id = 31\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_freeGlobal.js","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\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 nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_getRawTag.js\n// module id = 32\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_getRawTag.js","/** 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 nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_objectToString.js\n// module id = 33\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_objectToString.js","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_getPrototype.js\n// module id = 34\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_getPrototype.js","/**\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\nexport default overArg;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_overArg.js\n// module id = 35\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_overArg.js","/**\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 != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/isObjectLike.js\n// module id = 36\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/isObjectLike.js","module.exports = require('./lib/index');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/symbol-observable/index.js\n// module id = 37\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/symbol-observable/index.js","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _ponyfill = require('./ponyfill');\n\nvar _ponyfill2 = _interopRequireDefault(_ponyfill);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar root; /* global window */\n\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = (0, _ponyfill2['default'])(root);\nexports['default'] = result;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/symbol-observable/lib/index.js\n// module id = 38\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/symbol-observable/lib/index.js","module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tif(!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, \"loaded\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"id\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/webpack/buildin/module.js\n// module id = 39\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/webpack/buildin/module.js","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\nexports['default'] = symbolObservablePonyfill;\nfunction symbolObservablePonyfill(root) {\n\tvar result;\n\tvar _Symbol = root.Symbol;\n\n\tif (typeof _Symbol === 'function') {\n\t\tif (_Symbol.observable) {\n\t\t\tresult = _Symbol.observable;\n\t\t} else {\n\t\t\tresult = _Symbol('observable');\n\t\t\t_Symbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/symbol-observable/lib/ponyfill.js\n// module id = 40\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/symbol-observable/lib/ponyfill.js","import { ActionTypes } from './createStore';\nimport isPlainObject from 'lodash-es/isPlainObject';\nimport warning from './utils/warning';\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionName = actionType && '\"' + actionType.toString() + '\"' || 'an action';\n\n return 'Given action ' + actionName + ', reducer \"' + key + '\" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return 'The ' + argumentName + ' has unexpected type of \"' + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + '\". Expected argument to be an object with the following ' + ('keys: \"' + reducerKeys.join('\", \"') + '\"');\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n\n if (unexpectedKeys.length > 0) {\n return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('\"' + unexpectedKeys.join('\", \"') + '\" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('\"' + reducerKeys.join('\", \"') + '\". Unexpected keys will be ignored.');\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, { type: ActionTypes.INIT });\n\n if (typeof initialState === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');\n }\n\n var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');\n if (typeof reducer(undefined, { type: type }) === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined when probed with a random type. ' + ('Don\\'t try to handle ' + ActionTypes.INIT + ' or other actions in \"redux/*\" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');\n }\n });\n}\n\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\nexport default function combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning('No reducer provided for key \"' + key + '\"');\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n var finalReducerKeys = Object.keys(finalReducers);\n\n var unexpectedKeyCache = void 0;\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError = void 0;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments[1];\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n return hasChanged ? nextState : state;\n };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/combineReducers.js\n// module id = 41\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/combineReducers.js","import warning from './utils/warning';\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(undefined, arguments));\n };\n}\n\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass a single function as the first argument,\n * and get a function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\nexport default function bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?');\n }\n\n var keys = Object.keys(actionCreators);\n var boundActionCreators = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var actionCreator = actionCreators[key];\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n } else {\n warning('bindActionCreators expected a function actionCreator for key \\'' + key + '\\', instead received type \\'' + typeof actionCreator + '\\'.');\n }\n }\n return boundActionCreators;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/bindActionCreators.js\n// module id = 42\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/bindActionCreators.js","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nimport compose from './compose';\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\nexport default function applyMiddleware() {\n for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function (reducer, preloadedState, enhancer) {\n var store = createStore(reducer, preloadedState, enhancer);\n var _dispatch = store.dispatch;\n var chain = [];\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch(action) {\n return _dispatch(action);\n }\n };\n chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(undefined, chain)(store.dispatch);\n\n return _extends({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/applyMiddleware.js\n// module id = 43\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/applyMiddleware.js","!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):e.dlv=n()}(this,function(){function e(e,n,t,o){for(o=0,n=n.split?n.split(\".\"):n;e&&o<n.length;)e=e[n[o++]];return void 0===e?t:e}return e});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/dlv/dist/dlv.umd.js\n// module id = 44\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/dlv/dist/dlv.umd.js","//@flow\nimport { combineReducers } from 'redux';\nimport engine from './reducers/engine';\nimport shell from './reducers/shell';\nimport playPause from './reducers/play-pause';\nimport seekbar from './reducers/seekbar';\nimport volume from './reducers/volume';\nimport fullscreen from './reducers/fullscreen';\nimport loading from './reducers/loading';\nimport share from './reducers/share';\nimport cvaa from './reducers/cvaa';\nimport settings from './reducers/settings';\n\nconst reducer = combineReducers({\n engine,\n shell,\n seekbar,\n volume,\n fullscreen,\n loading,\n playPause,\n share,\n cvaa,\n settings\n});\n\nexport default reducer;\n\n\n\n// WEBPACK FOOTER //\n// ./store.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/store.js","module.exports = {\n\t\"core\": {\n\t\t\"disable\": \"Disable\",\n\t\t\"auto\": \"Auto\",\n\t\t\"close\": \"Close\"\n\t},\n\t\"controls\": {\n\t\t\"play\": \"Play\",\n\t\t\"pause\": \"Pause\",\n\t\t\"share\": \"Share\",\n\t\t\"language\": \"Language\",\n\t\t\"settings\": \"Settings\",\n\t\t\"fullscreen\": \"Fullscreen\"\n\t},\n\t\"settings\": {\n\t\t\"quality\": \"Quality\",\n\t\t\"speed\": \"Speed\"\n\t},\n\t\"language\": {\n\t\t\"audio\": \"Audio\",\n\t\t\"captions\": \"Captions\",\n\t\t\"advanced_captions_settings\": \"Advanced captions settings\"\n\t},\n\t\"share\": {\n\t\t\"share_title\": \"Partager\",\n\t\t\"link_options\": \"Options de lien\"\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./fr.json\n// module id = 46\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/fr.json","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { default as reduce, actions } from '../../reducers/engine';\nimport BaseComponent from '../base';\n\n@connect(reduce, bindActions(actions))\nclass EngineConnector extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'EngineConnector', player: obj.player});\n }\n\n componentDidMount() {\n this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED, (e) => {\n this.props.updatePlayerState(e.payload.oldState.type, e.payload.newState.type);\n });\n\n this.player.addEventListener(this.player.Event.TIME_UPDATE, () => {\n this.props.updateCurrentTime(this.player.currentTime);\n });\n\n this.player.addEventListener(this.player.Event.LOADED_METADATA, () => {\n this.props.updateDuration(this.player.duration);\n this.props.updateMetadataLoadingStatus(true);\n\n const TrackType = this.player.Track;\n let audioTracks = this.player.getTracks(TrackType.AUDIO);\n let videoTracks = this.player.getTracks(TrackType.VIDEO);\n let textTracks = this.player.getTracks(TrackType.TEXT);\n this.props.updateAudioTracks(audioTracks);\n this.props.updateVideoTracks(videoTracks);\n this.props.updateTextTracks(textTracks);\n });\n\n this.player.addEventListener(this.player.Event.VOLUME_CHANGE, () => {\n this.props.updateVolume(this.player.volume);\n });\n\n this.player.addEventListener(this.player.Event.PLAY, () => {\n this.props.updateIsPlaying(true);\n });\n\n this.player.addEventListener(this.player.Event.PAUSE, () => {\n this.props.updateIsPlaying(false);\n });\n }\n\n shouldComponentUpdate() { return false; }\n\n render() {\n return <span />\n }\n}\n\nexport default EngineConnector;\n\n\n\n// WEBPACK FOOTER //\n// ./components/engine-connector/engine-connector.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/engine-connector/engine-connector.js","module.exports = __WEBPACK_EXTERNAL_MODULE_48__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}\n// module id = 48\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/ui/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","//@flow\nimport * as JsLogger from 'js-logger';\n\nconst LOG_LEVEL: { [level: string]: Object } = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nclass LoggerFactory {\n constructor(options?: Object) {\n JsLogger.useDefaults(options || {});\n }\n\n getLogger(name?: string) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n}\n\nconst lf = new LoggerFactory({defaultLevel: JsLogger.DEBUG});\n\nexport default lf;\nexport {LOG_LEVEL};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/logger.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/logger.js","/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (typeof define === 'function' && define.amd) {\r\n\t\tdefine(Logger);\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/js-logger/src/logger.js\n// module id = 50\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/js-logger/src/logger.js","//@flow\nimport { h } from 'preact';\nimport BaseComponent from '../base';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/shell';\nimport { isMobile } from '../../utils/is-mobile';\n\nconst mapStateToProps = state => ({\n metadataLoaded: state.engine.metadataLoaded,\n currentState: state.engine.playerState.currentState,\n playerClasses: state.shell.playerClasses,\n isMobile: state.shell.isMobile\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass Shell extends BaseComponent {\n constructor() {\n super({name: 'Shell'});\n }\n\n componentDidMount() {\n this.props.updateIsMobile(isMobile());\n }\n\n render(props) {\n var playerClasses = 'player skin-default';\n playerClasses += ` ${props.playerClasses.join(' ')}`;\n\n if (this.props.metadataLoaded) playerClasses += ` metadata-loaded`;\n if (this.props.metadataLoaded) playerClasses += ` state-${this.props.currentState}`;\n\n return (\n <div className={playerClasses}>\n { props.children }\n </div>\n )\n }\n}\n\nexport default Shell;\n\n\n\n// WEBPACK FOOTER //\n// ./components/shell/shell.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/shell/shell.js","//@flow\n\nfunction isMobile() {\n return typeof window.orientation !== \"undefined\" || navigator.userAgent.indexOf(\"IEMobile\") !== -1;\n}\n\nexport {isMobile}\n\n\n\n// WEBPACK FOOTER //\n// ./utils/is-mobile.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/is-mobile.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/play-pause';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n isPlaying: state.engine.isPlaying\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass OverlayPlay extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'OverlayPlay', player: obj.player});\n }\n\n togglePlayPause() {\n this.logger.debug('Toggle play');\n this.setState({animation: true});\n setTimeout(() => {\n this.setState({animation: false});\n }, 400);\n if (this.player.paused) {\n this.player.play();\n }\n else {\n this.player.pause();\n }\n }\n\n render(props) {\n return (\n <div className={`overlay-play ${this.state.animation ? 'in' : ''}`} onClick={() => this.togglePlayPause()}>\n { props.isPlaying ? <Icon type='play' /> : <Icon type='pause' /> }\n </div>\n )\n }\n}\n\nexport default OverlayPlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/overlay-play/overlay-play.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/overlay-play/overlay-play.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/loading';\nimport BaseComponent from '../base';\n\nconst mapStateToProps = state => ({\n show: state.loading.show\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass Loading extends BaseComponent {\n constructor(obj: IControlParams) {\n super({name: 'Loading', player: obj.player});\n }\n\n componentDidMount() {\n this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED, e => {\n if (e.payload.newState.type === 'idle' || e.payload.newState.type === 'playing' || e.payload.newState.type === 'paused') {\n this.props.updateLoadingSpinnerState(false);\n }\n else {\n this.props.updateLoadingSpinnerState(true);\n }\n });\n }\n\n render(props) {\n return (\n <div className={props.show ? 'loading-backdrop show' : 'loading-backdrop'}>\n <div className='spinner-container'>\n <div className='spinner'>\n {[...Array(8)].map(() => <span />)}\n </div>\n </div>\n </div>\n )\n }\n\n}\n\nexport default Loading;\n\n\n\n// WEBPACK FOOTER //\n// ./components/loading/loading.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/loading/loading.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/play-pause';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n isPlaying: state.engine.isPlaying\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass PlayPauseControl extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'PlayPause', player: obj.player});\n }\n\n togglePlayPause() {\n this.logger.debug('Toggle play');\n if (this.player.paused) {\n this.player.play();\n }\n else {\n this.player.pause();\n }\n }\n\n render() {\n var controlButtonClass = this.props.isPlaying ? 'control-button is-playing' : 'control-button';\n\n return (\n <div className='control-button-container control-play-pause'>\n <Localizer>\n <button aria-label={<Text id={this.props.isPlaying ? 'controls.pause' : 'controls.play'} />} className={controlButtonClass} onClick={() => this.togglePlayPause()}>\n <Icon type='play' />\n <Icon type='pause' />\n </button>\n </Localizer>\n </div>\n )\n }\n}\n\nexport default PlayPauseControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/play-pause/play-pause.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/play-pause/play-pause.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/seekbar';\nimport BaseComponent from '../base';\nimport { toHHMMSS } from '../../utils/time-format';\n\nconst mapStateToProps = state => ({\n virtualProgress: state.seekbar.virtualTime,\n currentTime: state.seekbar.currentTime,\n duration: state.engine.duration,\n isDraggingActive: state.seekbar.draggingActive\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass SeekBarControl extends BaseComponent {\n _seekBarElement: HTMLElement;\n _playerElement: HTMLElement;\n\n constructor(obj: IControlParams) {\n super({name: 'SeekBar', player: obj.player});\n }\n\n componentDidMount() {\n this._playerElement = document.getElementsByClassName('player')[0];\n this._seekBarElement = document.getElementsByClassName('seek-bar')[0];\n\n this.setState({virtualTime: 0});\n\n this.player.addEventListener(this.player.Event.TIME_UPDATE, () => {\n this.props.updateCurrentTime(this.player.currentTime);\n });\n }\n\n onSeekbarMouseDown = e => {\n this.props.updateSeekbarDraggingStatus(true);\n if (this.props.isDraggingActive) {\n let time = this.getTime(e);\n this.updateSeekBarProgress(time, this.player.duration);\n }\n }\n\n onSeekbarMouseUp = e => {\n let time = this.getTime(e);\n this.player.currentTime = time;\n this.updateSeekBarProgress(time, this.player.duration);\n this.props.updateSeekbarDraggingStatus(false);\n this.logger.debug(`Seek to ${time}s`);\n }\n\n onSeekbarMouseMove = e => {\n let time = this.getTime(e);\n this.updateSeekBarProgress(time, this.player.duration, true);\n\n if (this.props.isDraggingActive) {\n this.updateSeekBarProgress(time, this.player.duration);\n }\n }\n\n updateSeekBarProgress(currentTime: number, duration: number, virtual: boolean = false) {\n if (virtual) {\n this.setState({virtualTime: currentTime});\n }\n else {\n this.props.updateCurrentTime(currentTime);\n }\n }\n\n getTime(e: Event): Number {\n let time = this.player.duration * ((e.clientX - this._seekBarElement.offsetLeft - this._playerElement.offsetLeft) / this._seekBarElement.clientWidth);\n time = parseFloat(time.toFixed(2));\n if (time < 0) return 0;\n if (time > this.player.duration) return this.player.duration;\n return time;\n }\n\n getThumbSpriteOffset() {\n return - (Math.ceil(100 * this.state.virtualTime / this.player.duration) * 160) + 'px 0px';\n }\n\n render(props) {\n var virtualProgressWidth = `${this.state.virtualTime / props.duration * 100}%`;\n var progressWidth = `${props.currentTime / props.duration * 100}%`;\n var framePreviewStyle = 'background-image: url(http://cfvod.kaltura.com/p/1914121/sp/191412100/thumbnail/entry_id/1_fet8ffop/version/100001/width/160/vid_slices/100); ';\n framePreviewStyle += `background-position: ${this.getThumbSpriteOffset()}`\n\n return (\n <div className='seek-bar' role='slider'\n aria-label='Seek slider' aria-valuemin='0' aria-valuemax={Math.round(this.player.duration)} aria-valuenow={Math.round(this.player.currentTime)}\n aria-valuetext={`${toHHMMSS(this.player.currentTime)} of ${toHHMMSS(this.player.duration)}`}\n onMouseMove={e => this.onSeekbarMouseMove(e)} onMouseDown={e => this.onSeekbarMouseDown(e)} onMouseUp={e => this.onSeekbarMouseUp(e)}>\n <div className='progress-bar'>\n <div className='progress' style={{width: progressWidth}}>\n <a className='scrubber' />\n </div>\n <div className='virtual-progress' style={{width: virtualProgressWidth}}>\n {\n props.showFramePreview ?\n (<div className='frame-preview'>\n <div className='frame-preview-img' style={framePreviewStyle} />\n </div>) : ''\n }\n { this.props.showTimeBubble ? <div className='time-preview'>{ toHHMMSS(this.state.virtualTime)}</div> : '' }\n </div>\n <div className='buffered' style='width: 60%;' />\n </div>\n </div>\n )\n }\n\n}\nexport default SeekBarControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/seekbar/seekbar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/seekbar/seekbar.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/volume';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n isDraggingActive: state.volume.isDraggingActive,\n volume: state.volume.volume,\n muted: state.volume.muted,\n isMobile: state.shell.isMobile\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass VolumeControl extends BaseComponent {\n _volumeControlElement: HTMLElement;\n _volumeProgressBarElement: HTMLElement;\n\n constructor(obj: IControlParams) {\n super({name: 'Volume', player: obj.player});\n }\n\n componentDidMount() {\n this._volumeControlElement = document.getElementsByClassName('volume-control')[0];\n this._volumeProgressBarElement = this._volumeControlElement.getElementsByClassName('bar')[0];\n\n this.player.addEventListener(this.player.Event.LOADED_METADATA, () => {\n this.props.updateVolume(this.player.volume);\n })\n\n this.player.addEventListener(this.player.Event.VOLUME_CHANGE, () => {\n this.props.updateVolume(this.player.volume);\n });\n }\n\n getVolumeProgessHeight(): string {\n return this.props.muted ? '0%' : Math.round(this.props.volume * 100) + '%';\n }\n\n onVolumeProgressBarMouseDown() {\n this.props.updateVolumeDraggingStatus(true);\n }\n\n onVolumeProgressBarClick(e: Event) {\n this.changeVolume(e);\n }\n\n onVolumeControlButtonClick() {\n this.logger.debug(`Toggle mute. ${this.player.muted} => ${!this.player.muted}`);\n this.props.updateMuted(!this.props.muted);\n this.player.muted = !this.player.muted;\n }\n\n changeVolume(e: Event) {\n let barHeight = this._volumeProgressBarElement.clientHeight;\n let topY = this.getCoords(this._volumeProgressBarElement).top;\n let clickY = e.clientY;\n let volume = 1 - ((clickY - topY) / barHeight);\n volume = parseFloat(volume.toFixed(2));\n this.logger.debug(`Change volume from ${this.player.volume} => ${volume}`);\n this.player.volume = volume;\n if (this.props.muted) {\n this.player.muted = false;\n this.props.updateMuted(false);\n }\n }\n\n getCoords(el: HTMLElement): {top: number, left: number} {\n let box = el.getBoundingClientRect();\n\n return {\n top: box.top + pageYOffset,\n left: box.left + pageXOffset\n }\n }\n\n render() {\n var controlButtonClass = 'control-button-container volume-control';\n if (this.props.isDraggingActive) controlButtonClass += ' dragging-active';\n if (this.props.muted || this.props.volume === 0) controlButtonClass += ' is-muted';\n\n if (!this.props.isMobile) return false;\n\n return (\n <div className={controlButtonClass}>\n <button className='control-button' onClick={() => this.onVolumeControlButtonClick()} aria-label='Volume'>\n <Icon type='volume-base' />\n <Icon type='volume-waves' />\n <Icon type='volume-mute' />\n </button>\n <div className='volume-control-bar' role='slider'\n aria-valuemin='0' aria-valuemaz='100' aria-valuenow={this.player.volume * 100}\n aria-valuetext={`${this.player.volume * 100}% volume ${this.player.muted ? 'muted' : ''}`}>\n <div className='bar' onMouseDown={() => this.onVolumeProgressBarMouseDown()} onClick={e => this.onVolumeProgressBarClick(e)}>\n <div className='progress' style={{height: this.getVolumeProgessHeight()}} />\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default VolumeControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/volume/volume.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/volume/volume.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/share';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n overlayOpen: state.share.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass ShareControl extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'Share', player: obj.player});\n }\n\n render(props) {\n return (\n <div className='control-button-container control-share'>\n <button className='control-button control-button-rounded' onClick={() => props.toggleShareOverlay(!props.overlayOpen)} aria-label='Share'>\n <Icon type='share' />\n </button>\n </div>\n )\n }\n}\n\nexport default ShareControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/share/share.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/share/share.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/settings';\nimport BaseComponent from '../base';\nimport SmartContainer from '../smart-container/smart-container';\nimport SmartContainerItem from '../smart-container/smart-container-item';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n videoTracks: state.engine.videoTracks\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass SettingsControl extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'Settings', player: obj.player});\n }\n\n componentDidMount() {\n this.setState({smartContainerOpen: false});\n }\n\n onControlButtonClick() {\n this.setState({smartContainerOpen: !this.state.smartContainerOpen});\n }\n\n onSpeedChange(o) {\n this.props.updateSpeed(o.value);\n }\n\n onQualityChange(o) {\n this.props.updateQuality(o.value);\n }\n\n render(props) {\n var speedOptions = [\n { value: 1, label: 'Auto (360)', active: true },\n { value: 2, label: '240' },\n { value: 3, label: '144' }\n ]\n return (\n <div className='control-button-container control-settings'>\n <Localizer>\n <button aria-label={<Text id='controls.settings' />} className={this.state.smartContainerOpen ? 'control-button active' : 'control-button'} onClick={() => this.onControlButtonClick()}>\n <Icon type='settings' />\n </button>\n </Localizer>\n { !this.state.smartContainerOpen ? '' :\n <SmartContainer>\n {\n props.videoTracks.length <= 0 ? '' :\n <Localizer>\n <SmartContainerItem label={<Text id='settings.quality' />} options={qualityOptions} onSelect={(o) => this.onQualityChange(o)} />\n </Localizer>\n }\n <Localizer>\n <SmartContainerItem label={<Text id='settings.speed' />} options={speedOptions} onSelect={(o) => this.onSpeedChange(o)} />\n </Localizer>\n </SmartContainer>\n }\n </div>\n )\n }\n}\n\nexport default SettingsControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/settings/settings.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/settings/settings.js","//@flow\nimport { h, Component } from 'preact';\nimport Icon from '../icon/icon';\n\nclass DropDownMenu extends Component {\n\n componentWillMount() {\n this.setState({dropMenuActive: false});\n }\n\n isSelected(o): boolean {\n return o.active;\n }\n\n onSelect(o) {\n this.props.onSelect(o);\n this.setState({dropMenuActive: false});\n }\n\n render(props) {\n return (\n <div className='dropdown top left'>\n <div className='dropdown-button' onClick={() => this.setState({dropMenuActive: !this.state.dropMenuActive})}>\n {props.options.filter(t => t.active).length > 0 ? props.options.filter(t => t.active)[0].label : ''}\n </div>\n {\n !this.state.dropMenuActive ? '' :\n <div className='dropdown-menu'>\n {\n props.options.map(o => (\n <div className={this.isSelected(o) ? 'dropdown-menu-item active' : 'dropdown-menu-item'} onClick={() => this.onSelect(o)}>\n <span>{o.label}</span>\n { this.isSelected(o) ? <Icon type='check' /> : '' }\n </div>\n ))\n }\n </div>\n }\n </div>\n )\n }\n}\n\nexport default DropDownMenu;\n\n\n\n// WEBPACK FOOTER //\n// ./components/dropdown-menu/dropdown-menu.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/dropdown-menu/dropdown-menu.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport BaseComponent from '../base';\nimport SmartContainer from '../smart-container/smart-container';\nimport SmartContainerItem from '../smart-container/smart-container-item';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n audioTracks: state.engine.audioTracks,\n textTracks: state.engine.textTracks\n});\n\n@connect(mapStateToProps)\nclass LanguageControl extends BaseComponent {\n constructor(obj: IControlParams) {\n super({name: 'LanguageControl', player: obj.player});\n }\n\n componentDidMount() {\n this.setState({smartContainerOpen: false});\n }\n\n onControlButtonClick() {\n this.setState({smartContainerOpen: !this.state.smartContainerOpen});\n }\n\n onAudioChange(audioTrack) {\n // this.player.selectTrack(audioTrack);\n this.player._engine.selectTextTrack(audioTrack); // workaround untill bug fixed in playkit-js\n }\n\n onCaptionsChange(textTrack) {\n // this.player.selectTrack(textTrack);\n this.player._engine.selectTextTrack(textTrack); // workaround untill bug fixed in playkit-js\n }\n\n render(props) {\n return props.audioTracks.length === 0 && props.audioTracks.length === 0 ? false : (\n <div className='control-button-container control-language'>\n <Localizer>\n <button aria-label={<Text id='controls.language' />} className={this.state.smartContainerOpen ? 'control-button active' : 'control-button'} onClick={() => this.onControlButtonClick()}>\n <Icon type='language' />\n </button>\n </Localizer>\n { !this.state.smartContainerOpen ? '' :\n <SmartContainer>\n {\n props.audioTracks.length <= 0 ? '' :\n <Localizer>\n <SmartContainerItem label={<Text id='language.audio' />} options={props.audioTracks} onSelect={audioTrack => this.onAudioChange(audioTrack)} />\n </Localizer>\n }\n {\n props.textTracks.length <= 0 ? '' :\n <Localizer>\n <SmartContainerItem label={<Text id='language.captions' />} options={props.textTracks} onSelect={textTrack => this.onCaptionsChange(textTrack)} />\n </Localizer>\n }\n {\n props.textTracks.length <= 0 ? '' :\n <div className='smart-container-item'>\n <a href='#'><Text id='language.advanced_captions_settings'>Advanced captions settings</Text></a>\n </div>\n }\n </SmartContainer>\n }\n </div>\n )\n }\n}\n\nexport default LanguageControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/language/language.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/language/language.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/fullscreen';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n fullscreen: state.fullscreen.fullscreen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass FullscreenControl extends BaseComponent {\n _playerElement: HTMLElement;\n\n constructor() {\n super({name: 'Fullscreen'});\n }\n\n componentDidMount() {\n this._playerElement = document.getElementsByClassName('player')[0];\n\n document.addEventListener('webkitfullscreenchange', () => {\n this.props.updateFullscreen(document.webkitIsFullScreen);\n });\n }\n\n enterFullscreen() {\n this._playerElement.webkitRequestFullscreen();\n }\n exitFullscreen() {\n document.webkitCancelFullScreen();\n }\n\n toggleFullscreen() {\n this.logger.debug(`Toggle fullscreen`);\n this.props.fullscreen ? this.exitFullscreen() : this.enterFullscreen();\n }\n\n render() {\n return (\n <div className='control-button-container control-fullscreen'>\n <Localizer>\n <button aria-label={<Text id='controls.fullscreen' />} className={this.props.fullscreen ? 'control-button is-fullscreen' : 'control-button'} onClick={() => this.toggleFullscreen()}>\n <Icon type='maximize' />\n <Icon type='minimize' />\n </button>\n </Localizer>\n </div>\n )\n }\n}\n\nexport default FullscreenControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/fullscreen/fullscreen.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/fullscreen/fullscreen.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport BaseComponent from '../base';\nimport { toHHMMSS } from '../../utils/time-format';\n\nconst mapStateToProps = state => ({\n currentTime: state.seekbar.currentTime,\n duration: state.engine.duration\n});\n\n@connect(mapStateToProps)\nclass TimeDisplay extends BaseComponent {\n constructor(obj: IControlParams) {\n super({name: 'TimeDisplay', player: obj.player, config: obj.config});\n }\n\n getTimeDisplay(): string {\n var result = this.props.format ? this.props.format : 'current / total',\n current = toHHMMSS(this.props.currentTime),\n total = toHHMMSS(this.props.duration),\n left = toHHMMSS(this.props.duration - this.props.currentTime);\n\n result = result.replace(/current/g, current);\n result = result.replace(/total/g, total);\n result = result.replace(/left/g, left);\n\n return result;\n }\n\n render() {\n return (\n <div className='time-display'>\n <span>{this.getTimeDisplay()}</span>\n </div>\n )\n }\n}\n\nexport default TimeDisplay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/time-display/time-display.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/time-display/time-display.js","import { h, Component } from 'preact';\n\nclass TopBar extends Component {\n render(props) {\n return (\n <div className='top-bar'>{ props.children }</div>\n )\n }\n}\n\nexport default TopBar;\n\n\n\n// WEBPACK FOOTER //\n// ./components/top-bar/top-bar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/top-bar/top-bar.js","import { h, Component } from 'preact';\n\nclass BottomBar extends Component {\n render(props) {\n return (\n <div className='bottom-bar'>{ props.children }</div>\n )\n }\n}\n\nexport default BottomBar;\n\n\n\n// WEBPACK FOOTER //\n// ./components/bottom-bar/bottom-bar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/bottom-bar/bottom-bar.js","//@flow\nimport { h } from 'preact';\nimport { Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/share';\nimport BaseComponent from '../base';\nimport Overlay from '../overlay/overlay';\n\nconst mapStateToProps = state => ({\n open: state.share.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass ShareOverlay extends BaseComponent {\n constructor() {\n super({name: 'ShareOverlay'});\n }\n\n render(props) {\n return !props.open ? '' : (\n <Overlay open={props.open} onClose={() => props.toggleShareOverlay(false)} type='share'>\n <div className='title'>\n <Text id='share.share_title' />\n </div>\n <div className='share-icons'>\n <a className='share-btn facebook-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M432 405.333h-80v106.667h80v320h133.333v-320h97.12l9.547-106.667h-106.667v-44.453c0-25.467 5.12-35.547 29.733-35.547h76.933v-133.333h-101.547c-95.893 0-138.453 42.213-138.453 123.067v90.267z' />\n </svg>\n </a>\n <a className='share-btn twitter-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M832 316.614c-23.547 10.29-48.853 17.221-75.413 20.345 27.12-15.987 47.947-41.319 57.733-71.508-25.36 14.806-53.467 25.568-83.387 31.37-23.92-25.122-58.080-40.82-95.84-40.82-84.773 0-147.067 77.861-127.92 158.687-109.093-5.381-205.84-56.833-270.613-135.035-34.4 58.094-17.84 134.090 40.613 172.574-21.493-0.683-41.76-6.484-59.44-16.171-1.44 59.879 42.16 115.898 105.307 128.368-18.48 4.935-38.72 6.090-59.307 2.205 16.693 51.347 65.173 88.702 122.667 89.752-55.2 42.605-124.747 61.637-194.4 53.552 58.107 36.673 127.147 58.067 201.28 58.067 243.787 0 381.52-202.684 373.2-384.473 25.653-18.244 47.92-41.004 65.52-66.914v0z' />\n </svg>\n </a>\n <a className='share-btn google-plus-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M352 556.8h127.040c-5.12 32.928-38.4 96.64-127.040 96.64-76.48 0-138.88-63.328-138.88-141.44 0-78.080 62.4-141.44 138.88-141.44 43.52 0 72.64 18.56 89.28 34.56l60.8-58.56c-39.040-36.48-89.6-58.56-150.080-58.56-123.84 0-224 100.16-224 224s100.16 224 224 224c129.28 0 215.072-90.88 215.072-218.88 0-14.72-1.632-25.92-3.552-37.12h-211.52v76.8zM800 544v96h-64v-96h-96v-64h96v-96h64v96h96v64h-96z' />\n </svg>\n </a>\n <a className='share-btn linkedin-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M324.8 290.087c0 36.506-29.6 66.087-66.133 66.087s-66.133-29.581-66.133-66.087c0-36.48 29.6-66.087 66.133-66.087s66.133 29.607 66.133 66.087zM325.333 409.043h-133.333v422.957h133.333v-422.957zM538.187 409.043h-132.48v422.957h132.507v-222.026c0-123.45 160.773-133.549 160.773 0v222.026h133.013v-267.811c0-208.306-237.92-200.719-293.813-98.179v-56.967z' />\n </svg>\n </a>\n <a className='share-btn email-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M256 768c-35.346 0-64-28.654-64-64v-352c0-35.346 28.654-64 64-64h512c35.346 0 64 28.654 64 64v352c0 35.346-28.654 64-64 64h-512zM512 467.488l147.52-115.488h-295.040l147.52 115.488zM748.48 352l-211.2 179.2c-0.713 1.308-1.572 2.532-2.56 3.648-12.707 12.158-32.733 12.158-45.44 0-0.988-1.116-1.847-2.34-2.56-3.648l-211.2-179.2h-19.52v352h512v-352h-19.52z' />\n </svg>\n </a>\n <a className='share-btn embed-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M377.989 579.335c12.669 12.904 12.669 33.777 0 46.68-12.733 12.969-33.427 12.969-46.16 0l-104.727-106.667c-12.669-12.904-12.669-33.777 0-46.68l104.727-106.667c12.733-12.969 33.427-12.969 46.16 0 12.669 12.904 12.669 33.777 0 46.68l-81.812 83.327 81.812 83.327zM646.011 412.68c-12.669-12.904-12.669-33.777 0-46.68 12.733-12.969 33.427-12.969 46.16 0l104.727 106.667c12.669 12.904 12.669 33.777 0 46.68l-104.727 106.667c-12.733 12.969-33.427 12.969-46.16 0-12.669-12.904-12.669-33.777 0-46.68l81.812-83.327-81.812-83.327zM572.293 250.6c17.455 4.445 28.025 22.388 23.686 40.066l-104.727 426.669c-4.349 17.719-22.048 28.535-39.545 24.079-17.455-4.445-28.025-22.388-23.686-40.066l104.727-426.669c4.349-17.719 22.048-28.535 39.545-24.079z' />\n </svg>\n </a>\n </div>\n <div>\n <div className='form-group has-icon' style='width: 300px;'>\n <input type='text' placeholder='Share URL' className='form-control' value='https://cdnapisec.kaltura.com/index.php?assetId=123456' readOnly />\n <svg className='icon' style='width:32px;height:32px;' viewBox='0 0 1024 1024'>\n <path d='M355.028 445.537c12.497 12.497 12.497 32.758 0 45.255s-32.758 12.497-45.255 0l-24.141-24.141c-49.92-49.92-49.832-130.999 0.094-180.925 49.984-49.984 130.995-50.025 180.955-0.064l113.266 113.266c49.964 49.964 49.935 130.955-0.064 180.955-12.497 12.497-32.758 12.497-45.255 0s-12.497-32.758 0-45.255c25.013-25.013 25.027-65.482 0.064-90.445l-113.266-113.266c-24.957-24.957-65.445-24.936-90.445 0.064-24.955 24.955-24.998 65.511-0.094 90.416l24.141 24.141zM668.972 578.463c-12.497-12.497-12.497-32.758 0-45.255s32.758-12.497 45.255 0l24.141 24.141c49.92 49.92 49.832 130.999-0.094 180.925-49.984 49.984-130.995 50.025-180.955 0.064l-113.266-113.266c-49.964-49.964-49.935-130.955 0.064-180.955 12.497-12.497 32.758-12.497 45.255 0s12.497 32.758 0 45.255c-25.013 25.013-25.027 65.482-0.064 90.445l113.266 113.266c24.957 24.957 65.445 24.936 90.445-0.064 24.955-24.955 24.998-65.511 0.094-90.416l-24.141-24.141z' />\n </svg>\n </div>\n </div>\n <a><Text id='share.link_options' /></a>\n </Overlay>\n )\n }\n}\n\nexport default ShareOverlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/share-overlay/share-overlay.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/share-overlay/share-overlay.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/cvaa';\nimport BaseComponent from '../base';\nimport Overlay from '../overlay/overlay';\n\nconst mapStateToProps = state => ({\n open: state.cvaa.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass CVAAOverlay extends BaseComponent {\n constructor() {\n super({name: 'CVAAOverlay'});\n }\n\n render(props) {\n return !props.open ? '' : (\n <Overlay type='cvaa'>\n <div className='title'>\n Advanced captions settings\n </div>\n <div className='sample'>Sample</div>\n <div className='sample black-bg'>Sample</div>\n <div className='sample yellow-text'>Sample</div>\n </Overlay>\n )\n }\n}\n\nexport default CVAAOverlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/cvaa-overlay/cvaa-overlay.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/cvaa-overlay/cvaa-overlay.js","//@flow\nimport BaseComponent from './base';\n\nclass KeyboardControl extends BaseComponent {\n // _playerElement: HTMLElement;\n\n constructor(obj: IControlParams) {\n super({name: 'Keyboard', player: obj.player});\n\n // this._playerElement = document.getElementsByClassName('player')[0];\n\n document.body.onkeydown = (e) => {\n let time, newVolume;\n switch(e.which) {\n case 32: // space\n this.logger.debug(\"Keydown space\");\n this.player.paused ? this.player.play() : this.player.pause();\n break;\n\n case 38: // up\n this.logger.debug(\"Keydown up\");\n newVolume = Math.round(this.player.volume * 100) + 5;\n this.logger.debug(`Changing volume. ${this.player.volume} => ${newVolume}`);\n if (this.player.muted) {\n this.player.muted = false;\n }\n this.player.volume = newVolume / 100;\n break;\n\n case 40: // down\n this.logger.debug(\"Keydown down\");\n newVolume = Math.round(this.player.volume * 100) - 5;\n if (newVolume < 5) {\n this.player.muted = true;\n return;\n }\n this.logger.debug(`Changing volume. ${this.player.volume} => ${newVolume}`);\n this.player.volume = newVolume / 100;\n break;\n\n case 37: // left\n this.logger.debug(\"Keydown left\");\n time = (this.player.currentTime - 5) > 0 ? this.player.currentTime - 5 : 0;\n this.player.currentTime = time;\n break;\n\n case 39: // right\n this.logger.debug(\"Keydown right\");\n time = (this.player.currentTime + 5) > this.player.duration ? this.player.duration : this.player.currentTime + 5;\n this.player.currentTime = time;\n break;\n\n default: return;\n }\n }\n\n this.disableKeyboardCommandsOnControls();\n }\n\n disableKeyboardCommandsOnControls() {\n let controlButtonsElements = Array.from(document.getElementsByClassName('control-button'));\n controlButtonsElements.forEach((element) => {\n element.onkeydown = (e) => e.preventDefault();\n });\n }\n}\n\nexport default KeyboardControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/keyboard.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/keyboard.js","// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!../../../css-loader/index.js!./style.css\");\nif(typeof content === 'string') content = [[module.id, content, '']];\n// Prepare cssTransformation\nvar transform;\n\nvar options = {}\noptions.transform = transform\n// add the styles to the DOM\nvar update = require(\"!../../../style-loader/lib/addStyles.js\")(content, options);\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(module.hot) {\n\t// When the styles change, update the <style> tags\n\tif(!content.locals) {\n\t\tmodule.hot.accept(\"!!../../../css-loader/index.js!./style.css\", function() {\n\t\t\tvar newContent = require(\"!!../../../css-loader/index.js!./style.css\");\n\t\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\t\t\tupdate(newContent);\n\t\t});\n\t}\n\t// When the module is disposed, remove the <style> tags\n\tmodule.hot.dispose(function() { update(); });\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/playkit-js-ui/src/styles/style.css\n// module id = 4\n// module chunks = 0","exports = module.exports = require(\"../../../css-loader/lib/css-base.js\")(undefined);\n// imports\n\n\n// module\nexports.push([module.id, \".row{display:block}.row:after{content:'';clear:both;display:block}.form-group{margin:10px auto;position:relative;max-width:100%}.form-group.has-error .form-control{border-color:#db1f26}.form-group.has-error .form-control:focus{border-color:#fff}.form-group.has-icon .form-control{padding-left:34px}.form-group .icon{position:absolute;top:2px;left:2px;fill:rgba(255,255,255,0.4)}.form-control{height:36px;width:100%;min-width:72px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(0,0,0,0.4);font-size:15px;line-height:18px;color:#fff;padding:8px 10px;text-overflow:ellipsis}.form-control::-webkit-input-placeholder{color:rgba(255,255,255,0.6)}.form-control:focus{background-color:#fff;border-color:#fff;color:#333}.form-control:focus::-webkit-input-placeholder{color:#ccc}.form-control:focus+.icon{fill:#999}textarea.form-control{min-height:72px}@-webkit-keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.dropdown{position:relative}.dropdown.active .dropdown-menu{display:block;opacity:1}.dropdown.top .dropdown-menu{margin-bottom:10px;bottom:100%}.dropdown.bottom .dropdown-menu{margin-top:10px;top:100%}.dropdown.right .dropdown-menu{left:0}.dropdown.left .dropdown-menu{right:0}.dropdown .dropdown-button{font-size:15px;font-weight:bold;line-height:18px;color:#fff;cursor:pointer}.dropdown .dropdown-menu{display:block;opacity:1;position:absolute;background-color:#333333;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;padding:6px 0;z-index:5;-webkit-animation:openDropmenu 100ms ease-out forwards;animation:openDropmenu 100ms ease-out forwards;max-height:173px;overflow-y:auto}.dropdown .dropdown-menu .dropdown-menu-item{padding:2px 10px 2px 16px;white-space:nowrap;min-height:30px;cursor:pointer}.dropdown .dropdown-menu .dropdown-menu-item:hover{color:#fff}.dropdown .dropdown-menu .dropdown-menu-item.active{color:#01ACCD;fill:#01ACCD}.dropdown .dropdown-menu .dropdown-menu-item .check-icon{display:inline-block;margin-left:16px;vertical-align:middle;width:24px;height:24px}.dropdown .dropdown-menu .dropdown-menu-item span{vertical-align:middle;line-height:26px}.tooltip{display:inline-block;height:22px;border-radius:4px;background-color:#FFFFFF;padding:3px 13px;color:#333333;font-size:13px;font-weight:bold;line-height:16px;box-shadow:0 0 8px 0 rgba(0,0,0,0.3)}.player .control-button{width:32px;height:32px;background:transparent;display:inline-block;opacity:0.8;border:none;padding:0;cursor:pointer;fill:#fff}.player .control-button svg{width:32px;height:32px}.player .control-button:hover,.player .control-button.active{opacity:1}.player .control-button.control-button-rounded{width:36px;height:36px;padding:2px}.player .control-button.control-button-rounded:hover{background-color:rgba(0,0,0,0.4);border-radius:18px}.player .control-button-container{display:inline-block;position:relative;vertical-align:top}a{color:#01ACCD;text-decoration:underline;font-size:15px;line-height:18px}a:hover{color:#01819a}a:active{opacity:0.7}.player{position:relative;max-width:854px;width:100%;background-color:#000;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.player:-webkit-full-screen{width:100%;height:100%;max-width:none}.player *{box-sizing:border-box;outline:none}.player ::-moz-selection{background-color:rgba(0,0,0,0.1)}.player ::selection{background-color:rgba(0,0,0,0.1)}.player video{width:100%}.player .player-gui{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;overflow:hidden;font-size:0;font-family:\\\"Lato\\\",sans-serif}.player .player-gui input,.player .player-gui textarea{font-family:\\\"Lato\\\",sans-serif}.player.metadata-loaded .player-gui,.player.state-paused .player-gui,.player.overlay-active .player-gui,.player.menu-active .player-gui{opacity:1}video::-webkit-media-controls{display:none !important}video::-webkit-media-controls-start-playback-button{display:none !important;-webkit-appearance:none}@-webkit-keyframes openOverlay{from{opacity:0}to{opacity:1}}@keyframes openOverlay{from{opacity:0}to{opacity:1}}.overlay{position:absolute;display:none;opacity:0;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.42);z-index:4;text-align:center;color:#fff;padding:80px 20px 0;-webkit-animation:openOverlay 100ms ease-in-out forwards;animation:openOverlay 100ms ease-in-out forwards}.overlay.active{display:block;opacity:1}.overlay .title{font-size:24px;font-weight:bold;line-height:29px;margin-bottom:60px}.overlay .close-overlay{position:absolute;top:48px;right:48px;z-index:5;fill:#fff;cursor:pointer}.overlay .close-overlay .icon-close{width:24px;height:24px}@media screen and (max-width: 768px){.overlay{padding:36px 20px 0}.overlay .close-overlay{top:38px}.overlay .title{margin-bottom:24px}}@media screen and (max-width: 480px){.overlay{padding:16px 24px 0}.overlay .close-overlay{top:15px;right:24px}.overlay .title{font-size:16px;line-height:19px;margin-bottom:36px}}@-webkit-keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.smart-container{background-color:#222222;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;position:absolute;right:0px;min-width:193px;font-size:15px;z-index:5;display:block;-webkit-animation:openSmartContainer 100ms ease-out forwards;animation:openSmartContainer 100ms ease-out forwards}.smart-container.top{bottom:100%;margin-bottom:6px}.smart-container.top:before{display:block;content:' ';position:absolute;bottom:-6px;left:0;width:100%;height:6px}.smart-container.bottom{top:100%;margin-top:6px}.smart-container.right{left:0px}.smart-container.left{right:0px}.smart-container .smart-container-item{margin:16px;color:rgba(244,244,244,0.8);white-space:nowrap}.smart-container .smart-container-item:after{display:block;content:' ';clear:both}.smart-container .smart-container-item.select-menu-item label{float:left}.smart-container .smart-container-item.select-menu-item .dropdown{float:right}.overlay.share-overlay .share-icons{margin:60px 0}.overlay.share-overlay .share-btn{height:36px;width:36px;border-radius:18px;background-color:rgba(0,0,0,0.4);display:inline-block;margin:0 8px;-webkit-transition:-webkit-transform 100ms;transition:transform 100ms;will-change:transform;padding:2px}.overlay.share-overlay .share-btn:hover{-webkit-transform:scale(1.1667);-ms-transform:scale(1.1667);transform:scale(1.1667)}.overlay.share-overlay .share-btn.facebook-share-btn{background-color:#3B5998}.overlay.share-overlay .share-btn.twitter-share-btn{background-color:#1DA1F2}.overlay.share-overlay .share-btn.google-plus-share-btn{background-color:#DD4B39}.overlay.share-overlay .share-btn.linkedin-share-btn{background-color:#00A0DC}@media screen and (max-width: 768px){.overlay.share-overlay .share-icons{margin:40px 0}}@media screen and (max-width: 480px){.overlay.share-overlay .share-icons{margin:20px 0}}.overlay.cvaa-overlay .sample{border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:36px;text-align:center;padding:0 28px;display:inline-block;margin:0 12px;cursor:pointer}.overlay.cvaa-overlay .sample.black-bg{background-color:#000}.overlay.cvaa-overlay .sample.yellow-text{color:#FAFF00}@-webkit-keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}@keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}.loading-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.3);-webkit-transition:100ms opacity;transition:100ms opacity;opacity:0}.loading-backdrop.show{opacity:1}.loading-backdrop.show .spinner-container{display:block}.loading-backdrop .spinner-container{display:none;position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50px, -50px, 0);transform:translate3d(-50px, -50px, 0)}.spinner{width:100px;height:100px;position:relative;-webkit-animation:kaltura-spinner 2.5s infinite;animation:kaltura-spinner 2.5s infinite}.spinner span{width:8px;height:8px;background-color:#fff;display:block;border-radius:8px;position:absolute;top:50%;left:50%;margin-top:-4px;margin-left:-4px}.spinner span:nth-child(1){-webkit-transform:rotate(45deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(45deg) translateX(-25px) translateY(-25px);transform:rotate(45deg) translateX(-25px) translateY(-25px);background-color:#da1f26}.spinner span:nth-child(2){-webkit-transform:rotate(90deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(90deg) translateX(-25px) translateY(-25px);transform:rotate(90deg) translateX(-25px) translateY(-25px);background-color:#06a885}.spinner span:nth-child(3){-webkit-transform:rotate(135deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(135deg) translateX(-25px) translateY(-25px);transform:rotate(135deg) translateX(-25px) translateY(-25px);background-color:#009344}.spinner span:nth-child(4){-webkit-transform:rotate(180deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(180deg) translateX(-25px) translateY(-25px);transform:rotate(180deg) translateX(-25px) translateY(-25px);background-color:#f8a61a}.spinner span:nth-child(5){-webkit-transform:rotate(225deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(225deg) translateX(-25px) translateY(-25px);transform:rotate(225deg) translateX(-25px) translateY(-25px);background-color:#1b4a97}.spinner span:nth-child(6){-webkit-transform:rotate(270deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(270deg) translateX(-25px) translateY(-25px);transform:rotate(270deg) translateX(-25px) translateY(-25px);background-color:#00abcc}.spinner span:nth-child(7){-webkit-transform:rotate(315deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(315deg) translateX(-25px) translateY(-25px);transform:rotate(315deg) translateX(-25px) translateY(-25px);background-color:#b1d238}.spinner span:nth-child(8){-webkit-transform:rotate(360deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(360deg) translateX(-25px) translateY(-25px);transform:rotate(360deg) translateX(-25px) translateY(-25px);background-color:#fcd203}.control-button-container.control-play-pause .control-button{-webkit-transition:400ms -webkit-transform;transition:400ms transform}.control-button-container.control-play-pause .control-button .icon-pause{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:0;display:none}.control-button-container.control-play-pause .control-button .icon-play{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}.control-button-container.control-play-pause .control-button.is-playing .icon-pause{opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing .icon-play{opacity:0;display:none}@media screen and (max-width: 480px){.control-button-container.control-play-pause{display:none}}.control-button-container.volume-control:hover .volume-control-bar{display:block !important}.control-button-container.volume-control.is-muted .volume-waves{opacity:0;-webkit-transform:translateX(-5px);-ms-transform:translateX(-5px);transform:translateX(-5px)}.control-button-container.volume-control.is-muted .volume-mute{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.volume-control.dragging-active .volume-control-bar{display:block}.control-button-container.volume-control .volume-waves{-webkit-transform:translateX(0px);-ms-transform:translateX(0px);transform:translateX(0px)}.control-button-container.volume-control .volume-mute{opacity:1;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.control-button-container.volume-control .volume-waves,.control-button-container.volume-control .volume-mute{-webkit-transition:300ms -webkit-transform, 300ms opacity;transition:300ms transform, 300ms opacity}.control-button-container.volume-control svg{position:absolute;top:0;left:0}.volume-control-bar{position:absolute;z-index:2;bottom:38px;left:0px;display:block;height:112px;width:34px;border-radius:4px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);background-color:#333333;padding:6px;display:none}.volume-control-bar:before{position:absolute;width:34px;height:14px;bottom:-8px;left:0;content:' ';display:block}.volume-control-bar .bar{background-color:#424242;height:100%;position:relative;cursor:ns-resize}.volume-control-bar .progress{position:absolute;bottom:0px;left:0px;width:100%;border-radius:0 0 2px 2px;background-color:#01ACCD}.control-button-container.control-fullscreen .control-button{-webkit-transition:100ms -webkit-transform;transition:100ms transform;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.control-fullscreen .control-button .icon-minimize{display:none}.control-button-container.control-fullscreen .control-button:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-maximize{display:none}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-minimize{display:block}.player .seek-bar{padding:6px 0;cursor:pointer}.player .seek-bar:hover .progress-bar .scrubber,.player .seek-bar.dragging-active .progress-bar .scrubber{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.player .seek-bar:hover .progress-bar .virtual-progress,.player .seek-bar.dragging-active .progress-bar .virtual-progress{display:block}.player .seek-bar .progress-bar{height:4px;background-color:rgba(255,255,255,0.3);border-radius:2px;position:relative}.player .seek-bar .progress-bar .progress{position:absolute;top:0;left:0;height:100%;z-index:2;border-radius:2px 0 0 2px;background-color:#01ACCD}.player .seek-bar .progress-bar .virtual-progress{display:none}.player .seek-bar .progress-bar .buffered,.player .seek-bar .progress-bar .virtual-progress{position:absolute;top:0;left:0;height:100%;z-index:1;border-radius:2px 0 0 2px;background-color:rgba(255,255,255,0.3)}.player .seek-bar .progress-bar .buffered .frame-preview-img,.player .seek-bar .progress-bar .virtual-progress .frame-preview-img{background-size:auto 100%;width:100%;height:100%;position:relative}.player .seek-bar .progress-bar .buffered .frame-preview,.player .seek-bar .progress-bar .virtual-progress .frame-preview{position:absolute;bottom:16px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:94px;width:164px;border:2px solid rgba(255,255,255,0.2);border-radius:4px}.player .seek-bar .progress-bar .buffered .time-preview,.player .seek-bar .progress-bar .virtual-progress .time-preview{position:absolute;bottom:22px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:22px;min-width:48px;padding:0 3px;text-align:center;border-radius:3px;background-color:rgba(0,0,0,0.7);font-size:13px;font-weight:bold;line-height:22px;color:#fff}.player .seek-bar .progress-bar .scrubber{position:absolute;z-index:3;cursor:pointer;display:block;top:-6px;right:-8px;border-radius:8px;height:16px;width:16px;background-color:#FFFFFF;box-shadow:0 0 31px 0 rgba(0,0,0,0.3);-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:100ms -webkit-transform;transition:100ms transform}.player .seek-bar .progress-bar .scrubber:active{opacity:1;cursor:-webkit-grabbing;cursor:grabbing}@media screen and (max-width: 480px){.virtual-progress{display:none}}.player .time-display{display:inline-block;line-height:32px;vertical-align:top;font-size:14px;padding:0 23px;font-weight:bold}@media screen and (max-width: 480px){.player .time-display{padding:0 12px 0 0}}.player .video-playing-title{font-size:15px;font-weight:bold;line-height:18px;padding:6px 0}.player .bottom-bar{position:absolute;bottom:0;left:0;width:100%;background:-webkit-linear-gradient(270deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:6px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .bottom-bar .left-controls{float:left;text-align:left}.player .bottom-bar .right-controls{float:right;text-align:left}.player .bottom-bar .right-controls .control-button-container{margin:0 6px}.player .bottom-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .bottom-bar,.player.hover .bottom-bar,.player.state-paused .bottom-bar,.player.menu-active .bottom-bar{opacity:1}.player.overlay-active .bottom-bar{opacity:0}@media screen and (max-width: 480px){.player .bottom-bar{padding:6px 8px}}.player .top-bar{position:absolute;top:0;left:0;width:100%;background:-webkit-linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(0deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:14px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .top-bar .left-controls{float:left;text-align:left}.player .top-bar .right-controls{float:right;text-align:left}.player .top-bar .right-controls .control-button-container{margin:0 6px}.player .top-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .top-bar,.player.hover .top-bar,.player.state-paused .top-bar,.player.menu-active .top-bar{opacity:1}.player.overlay-active .top-bar{opacity:0}@media screen and (max-width: 480px){.player .top-bar{padding:8px 8px 20px 8px}}@-webkit-keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}@keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}.overlay-play{position:absolute;top:0;left:0;width:100%;height:100%}.overlay-play.in .icon{-webkit-animation:overlayPlayIconIn 400ms linear forwards;animation:overlayPlayIconIn 400ms linear forwards}.overlay-play .icon{width:144px;height:144px;fill:#fff;position:absolute;top:50%;left:50%;margin:-72px 0 0 -72px;opacity:0}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/css-loader!../node_modules/playkit-js-ui/src/styles/style.css\n// module id = 5\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/css-loader/lib/css-base.js\n// module id = 6\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tmemo[selector] = fn.call(this, selector);\n\t\t}\n\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n\t// tags it will allow on a page\n\tif (!options.singleton) options.singleton = isOldIE();\n\n\t// By default, add <style> tags to the <head> element\n\tif (!options.insertInto) options.insertInto = \"head\";\n\n\t// By default, add <style> tags to the bottom of the target\n\tif (!options.insertAt) options.insertAt = \"bottom\";\n\n\tvar styles = listToStyles(list, options);\n\n\taddStylesToDom(styles, options);\n\n\treturn function update (newList) {\n\t\tvar mayRemove = [];\n\n\t\tfor (var i = 0; i < styles.length; i++) {\n\t\t\tvar item = styles[i];\n\t\t\tvar domStyle = stylesInDom[item.id];\n\n\t\t\tdomStyle.refs--;\n\t\t\tmayRemove.push(domStyle);\n\t\t}\n\n\t\tif(newList) {\n\t\t\tvar newStyles = listToStyles(newList, options);\n\t\t\taddStylesToDom(newStyles, options);\n\t\t}\n\n\t\tfor (var i = 0; i < mayRemove.length; i++) {\n\t\t\tvar domStyle = mayRemove[i];\n\n\t\t\tif(domStyle.refs === 0) {\n\t\t\t\tfor (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();\n\n\t\t\t\tdelete stylesInDom[domStyle.id];\n\t\t\t}\n\t\t}\n\t};\n};\n\nfunction addStylesToDom (styles, options) {\n\tfor (var i = 0; i < styles.length; i++) {\n\t\tvar item = styles[i];\n\t\tvar domStyle = stylesInDom[item.id];\n\n\t\tif(domStyle) {\n\t\t\tdomStyle.refs++;\n\n\t\t\tfor(var j = 0; j < domStyle.parts.length; j++) {\n\t\t\t\tdomStyle.parts[j](item.parts[j]);\n\t\t\t}\n\n\t\t\tfor(; j < item.parts.length; j++) {\n\t\t\t\tdomStyle.parts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\t\t} else {\n\t\t\tvar parts = [];\n\n\t\t\tfor(var j = 0; j < item.parts.length; j++) {\n\t\t\t\tparts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\n\t\t\tstylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};\n\t\t}\n\t}\n}\n\nfunction listToStyles (list, options) {\n\tvar styles = [];\n\tvar newStyles = {};\n\n\tfor (var i = 0; i < list.length; i++) {\n\t\tvar item = list[i];\n\t\tvar id = options.base ? item[0] + options.base : item[0];\n\t\tvar css = item[1];\n\t\tvar media = item[2];\n\t\tvar sourceMap = item[3];\n\t\tvar part = {css: css, media: media, sourceMap: sourceMap};\n\n\t\tif(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});\n\t\telse newStyles[id].parts.push(part);\n\t}\n\n\treturn styles;\n}\n\nfunction insertStyleElement (options, style) {\n\tvar target = getElement(options.insertInto)\n\n\tif (!target) {\n\t\tthrow new Error(\"Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.\");\n\t}\n\n\tvar lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];\n\n\tif (options.insertAt === \"top\") {\n\t\tif (!lastStyleElementInsertedAtTop) {\n\t\t\ttarget.insertBefore(style, target.firstChild);\n\t\t} else if (lastStyleElementInsertedAtTop.nextSibling) {\n\t\t\ttarget.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);\n\t\t} else {\n\t\t\ttarget.appendChild(style);\n\t\t}\n\t\tstylesInsertedAtTop.push(style);\n\t} else if (options.insertAt === \"bottom\") {\n\t\ttarget.appendChild(style);\n\t} else {\n\t\tthrow new Error(\"Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.\");\n\t}\n}\n\nfunction removeStyleElement (style) {\n\tif (style.parentNode === null) return false;\n\tstyle.parentNode.removeChild(style);\n\n\tvar idx = stylesInsertedAtTop.indexOf(style);\n\tif(idx >= 0) {\n\t\tstylesInsertedAtTop.splice(idx, 1);\n\t}\n}\n\nfunction createStyleElement (options) {\n\tvar style = document.createElement(\"style\");\n\n\toptions.attrs.type = \"text/css\";\n\n\taddAttrs(style, options.attrs);\n\tinsertStyleElement(options, style);\n\n\treturn style;\n}\n\nfunction createLinkElement (options) {\n\tvar link = document.createElement(\"link\");\n\n\toptions.attrs.type = \"text/css\";\n\toptions.attrs.rel = \"stylesheet\";\n\n\taddAttrs(link, options.attrs);\n\tinsertStyleElement(options, link);\n\n\treturn link;\n}\n\nfunction addAttrs (el, attrs) {\n\tObject.keys(attrs).forEach(function (key) {\n\t\tel.setAttribute(key, attrs[key]);\n\t});\n}\n\nfunction addStyle (obj, options) {\n\tvar style, update, remove, result;\n\n\t// If a transform function was defined, run it on the css\n\tif (options.transform && obj.css) {\n\t result = options.transform(obj.css);\n\n\t if (result) {\n\t \t// If transform returns a value, use that instead of the original css.\n\t \t// This allows running runtime transformations on the css.\n\t \tobj.css = result;\n\t } else {\n\t \t// If the transform function returns a falsy value, don't add this css.\n\t \t// This allows conditional loading of css\n\t \treturn function() {\n\t \t\t// noop\n\t \t};\n\t }\n\t}\n\n\tif (options.singleton) {\n\t\tvar styleIndex = singletonCounter++;\n\n\t\tstyle = singleton || (singleton = createStyleElement(options));\n\n\t\tupdate = applyToSingletonTag.bind(null, style, styleIndex, false);\n\t\tremove = applyToSingletonTag.bind(null, style, styleIndex, true);\n\n\t} else if (\n\t\tobj.sourceMap &&\n\t\ttypeof URL === \"function\" &&\n\t\ttypeof URL.createObjectURL === \"function\" &&\n\t\ttypeof URL.revokeObjectURL === \"function\" &&\n\t\ttypeof Blob === \"function\" &&\n\t\ttypeof btoa === \"function\"\n\t) {\n\t\tstyle = createLinkElement(options);\n\t\tupdate = updateLink.bind(null, style, options);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\n\t\t\tif(style.href) URL.revokeObjectURL(style.href);\n\t\t};\n\t} else {\n\t\tstyle = createStyleElement(options);\n\t\tupdate = applyToTag.bind(null, style);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\t\t};\n\t}\n\n\tupdate(obj);\n\n\treturn function updateStyle (newObj) {\n\t\tif (newObj) {\n\t\t\tif (\n\t\t\t\tnewObj.css === obj.css &&\n\t\t\t\tnewObj.media === obj.media &&\n\t\t\t\tnewObj.sourceMap === obj.sourceMap\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdate(obj = newObj);\n\t\t} else {\n\t\t\tremove();\n\t\t}\n\t};\n}\n\nvar replaceText = (function () {\n\tvar textStore = [];\n\n\treturn function (index, replacement) {\n\t\ttextStore[index] = replacement;\n\n\t\treturn textStore.filter(Boolean).join('\\n');\n\t};\n})();\n\nfunction applyToSingletonTag (style, index, remove, obj) {\n\tvar css = remove ? \"\" : obj.css;\n\n\tif (style.styleSheet) {\n\t\tstyle.styleSheet.cssText = replaceText(index, css);\n\t} else {\n\t\tvar cssNode = document.createTextNode(css);\n\t\tvar childNodes = style.childNodes;\n\n\t\tif (childNodes[index]) style.removeChild(childNodes[index]);\n\n\t\tif (childNodes.length) {\n\t\t\tstyle.insertBefore(cssNode, childNodes[index]);\n\t\t} else {\n\t\t\tstyle.appendChild(cssNode);\n\t\t}\n\t}\n}\n\nfunction applyToTag (style, obj) {\n\tvar css = obj.css;\n\tvar media = obj.media;\n\n\tif(media) {\n\t\tstyle.setAttribute(\"media\", media)\n\t}\n\n\tif(style.styleSheet) {\n\t\tstyle.styleSheet.cssText = css;\n\t} else {\n\t\twhile(style.firstChild) {\n\t\t\tstyle.removeChild(style.firstChild);\n\t\t}\n\n\t\tstyle.appendChild(document.createTextNode(css));\n\t}\n}\n\nfunction updateLink (link, options, obj) {\n\tvar css = obj.css;\n\tvar sourceMap = obj.sourceMap;\n\n\t/*\n\t\tIf convertToAbsoluteUrls isn't defined, but sourcemaps are enabled\n\t\tand there is no publicPath defined then lets turn convertToAbsoluteUrls\n\t\ton by default. Otherwise default to the convertToAbsoluteUrls option\n\t\tdirectly\n\t*/\n\tvar autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;\n\n\tif (options.convertToAbsoluteUrls || autoFixUrls) {\n\t\tcss = fixUrls(css);\n\t}\n\n\tif (sourceMap) {\n\t\t// http://stackoverflow.com/a/26603875\n\t\tcss += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\n\t}\n\n\tvar blob = new Blob([css], { type: \"text/css\" });\n\n\tvar oldSrc = link.href;\n\n\tlink.href = URL.createObjectURL(blob);\n\n\tif(oldSrc) URL.revokeObjectURL(oldSrc);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/style-loader/lib/addStyles.js\n// module id = 7\n// module chunks = 0","\n/**\n * When source maps are enabled, `style-loader` uses a link element with a data-uri to\n * embed the css on the page. This breaks all relative urls because now they are relative to a\n * bundle instead of the current page.\n *\n * One solution is to only use full urls, but that may be impossible.\n *\n * Instead, this function \"fixes\" the relative urls to be absolute according to the current page location.\n *\n * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.\n *\n */\n\nmodule.exports = function (css) {\n // get current location\n var location = typeof window !== \"undefined\" && window.location;\n\n if (!location) {\n throw new Error(\"fixUrls requires window.location\");\n }\n\n\t// blank or null?\n\tif (!css || typeof css !== \"string\") {\n\t return css;\n }\n\n var baseUrl = location.protocol + \"//\" + location.host;\n var currentDir = baseUrl + location.pathname.replace(/\\/[^\\/]*$/, \"/\");\n\n\t// convert each url(...)\n\t/*\n\tThis regular expression is just a way to recursively match brackets within\n\ta string.\n\n\t /url\\s*\\( = Match on the word \"url\" with any whitespace after it and then a parens\n\t ( = Start a capturing group\n\t (?: = Start a non-capturing group\n\t [^)(] = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t (?: = Start another non-capturing groups\n\t [^)(]+ = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t [^)(]* = Match anything that isn't a parentheses\n\t \\) = Match a end parentheses\n\t ) = End Group\n *\\) = Match anything and then a close parens\n ) = Close non-capturing group\n * = Match anything\n ) = Close capturing group\n\t \\) = Match a close parens\n\n\t /gi = Get all matches, not the first. Be case insensitive.\n\t */\n\tvar fixedCss = css.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi, function(fullMatch, origUrl) {\n\t\t// strip quotes (if they exist)\n\t\tvar unquotedOrigUrl = origUrl\n\t\t\t.trim()\n\t\t\t.replace(/^\"(.*)\"$/, function(o, $1){ return $1; })\n\t\t\t.replace(/^'(.*)'$/, function(o, $1){ return $1; });\n\n\t\t// already a full url? no change\n\t\tif (/^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/)/i.test(unquotedOrigUrl)) {\n\t\t return fullMatch;\n\t\t}\n\n\t\t// convert the url to a full url\n\t\tvar newUrl;\n\n\t\tif (unquotedOrigUrl.indexOf(\"//\") === 0) {\n\t\t \t//TODO: should we add protocol?\n\t\t\tnewUrl = unquotedOrigUrl;\n\t\t} else if (unquotedOrigUrl.indexOf(\"/\") === 0) {\n\t\t\t// path should be relative to the base url\n\t\t\tnewUrl = baseUrl + unquotedOrigUrl; // already starts with '/'\n\t\t} else {\n\t\t\t// path should be relative to current directory\n\t\t\tnewUrl = currentDir + unquotedOrigUrl.replace(/^\\.\\//, \"\"); // Strip leading './'\n\t\t}\n\n\t\t// send back the fixed url(...)\n\t\treturn \"url(\" + JSON.stringify(newUrl) + \")\";\n\t});\n\n\t// send back the fixed css\n\treturn fixedCss;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/style-loader/lib/urls.js\n// module id = 8\n// module chunks = 0","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"hls.js\"), require(\"playkit-js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"hls.js\", \"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsHls\"] = factory(require(\"hls.js\"), require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsHls\"] = factory(root[\"Hls\"], root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///hls/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 3d553f6cfbde57d4496a\n\n\n// WEBPACK FOOTER //\n// webpack:/hls/webpack/bootstrap 3d553f6cfbde57d4496a","//@flow\nimport Hlsjs from 'hls.js'\nimport {registerMediaSourceAdapter, BaseMediaSourceAdapter} from 'playkit-js'\nimport {Track, VideoTrack, AudioTrack, TextTrack} from 'playkit-js'\n\n/**\n * Adapter of hls.js lib for hls content\n * @classdesc\n */\nexport default class HlsAdapter extends BaseMediaSourceAdapter {\n /**\n * The id of the adapter.\n * @member {string} id\n * @static\n * @private\n */\n static id: string = 'HlsAdapter';\n /**\n * The adapter logger.\n * @member {any} _logger\n * @static\n * @private\n */\n static _logger = BaseMediaSourceAdapter.getLogger(HlsAdapter.id);\n /**\n * The supported mime types by the hls adapter.\n * @member {Array<string>} _hlsMimeType\n * @static\n * @private\n */\n static _hlsMimeTypes: Array<string> = [\n 'application/x-mpegurl',\n 'application/vnd.apple.mpegurl',\n 'audio/mpegurl',\n 'audio/x-mpegurl',\n 'video/x-mpegurl',\n 'video/mpegurl',\n 'application/mpegurl'\n ];\n /**\n * The hls player instance.\n * @member {any} _hls\n * @private\n */\n _hls: any;\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n _loadPromise: ?Promise<Object>;\n /**\n * Reference to the player tracks.\n * @member {Array<Track>} - _playerTracks\n * @type {Array<Track>}\n * @private\n */\n _playerTracks: Array<Track>;\n\n /**\n * Checks if hls adapter can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check.\n * @returns {boolean} - Whether the hls adapter can play a specific mime type.\n * @static\n */\n static canPlayType(mimeType: string): boolean {\n let canHlsPlayType = (typeof mimeType === 'string') ? HlsAdapter._hlsMimeTypes.includes(mimeType.toLowerCase()) : false;\n HlsAdapter._logger.debug('canPlayType result for mimeType:' + mimeType + ' is ' + canHlsPlayType.toString());\n return canHlsPlayType;\n }\n\n /**\n * Checks if the hls adapter is supported.\n * @function isSupported\n * @returns {boolean} - Whether hls is supported.\n * @static\n */\n static isSupported(): boolean {\n let isHlsSupported = Hlsjs.isSupported();\n HlsAdapter._logger.debug('isSupported:' + isHlsSupported);\n return isHlsSupported;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which will bind to the hls adapter\n * @param {Object} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n constructor(videoElement: HTMLVideoElement, source: Source, config: Object) {\n HlsAdapter._logger.debug('Creating adapter. Hls version: ' + Hlsjs.version);\n super(videoElement, source, config);\n this._hls = new Hlsjs(this._config);\n this._addBindings();\n }\n\n /**\n * Adds the required bindings with hls.js.\n * @function _addBindings\n * @private\n * @returns {void}\n */\n _addBindings(): void {\n this._hls.on(Hlsjs.Events.ERROR, this._onError.bind(this));\n this._hls.on(Hlsjs.Events.LEVEL_SWITCHED, this._onLevelSwitched.bind(this));\n this._hls.on(Hlsjs.Events.AUDIO_TRACK_SWITCHED, this._onAudioTrackSwitched.bind(this));\n }\n\n /**\n * Load the video source\n * @function load\n * @returns {Promise<Object>} - The loaded data\n * @override\n */\n load(): Promise<Object> {\n if (!this._loadPromise) {\n this._loadPromise = new Promise((resolve) => {\n this._hls.on(Hlsjs.Events.MANIFEST_LOADED, (event: string, data: any) => {\n HlsAdapter._logger.debug('The source has been loaded successfully');\n this._playerTracks = this._parseTracks(data);\n resolve({tracks: this._playerTracks});\n });\n if (this._sourceObj && this._sourceObj.url) {\n this._hls.loadSource(this._sourceObj.url);\n this._hls.attachMedia(this._videoElement);\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroying the hls adapter.\n * @function destroy\n * @override\n */\n destroy(): void {\n HlsAdapter._logger.debug('destroy');\n super.destroy();\n this._loadPromise = null;\n this._removeBindings();\n this._hls.detachMedia();\n this._hls.destroy();\n }\n\n /**\n * Parse the hls tracks into player tracks.\n * @param {any} data - The event data.\n * @returns {Array<Track>} - The parsed tracks.\n * @private\n */\n _parseTracks(data: any): Array<Track> {\n let audioTracks = this._parseAudioTracks(data.audioTracks || []);\n let videoTracks = this._parseVideoTracks(data.levels || []);\n let textTracks = this._parseTextTracks(this._videoElement.textTracks || []);\n return audioTracks.concat(videoTracks).concat(textTracks);\n }\n\n /**\n * Parse hls audio tracks into player audio tracks.\n * @param {Array<Object>} hlsAudioTracks - The hls audio tracks.\n * @returns {Array<AudioTrack>} - The parsed audio tracks.\n * @private\n */\n _parseAudioTracks(hlsAudioTracks: Array<Object>): Array<AudioTrack> {\n let audioTracks = [];\n for (let i = 0; i < hlsAudioTracks.length; i++) {\n // Create audio tracks\n let settings = {\n id: hlsAudioTracks[i].id,\n active: this._hls.audioTrack === hlsAudioTracks[i].id,\n label: hlsAudioTracks[i].name,\n language: hlsAudioTracks[i].lang,\n index: i\n };\n audioTracks.push(new AudioTrack(settings));\n }\n return audioTracks;\n }\n\n /**\n * Parse hls video tracks into player video tracks.\n * @param {Array<Object>} hlsVideoTracks - The hls video tracks.\n * @returns {Array<VideoTrack>} - The parsed video tracks.\n * @private\n */\n _parseVideoTracks(hlsVideoTracks: Array<Object>): Array<VideoTrack> {\n let videoTracks = [];\n for (let i = 0; i < hlsVideoTracks.length; i++) {\n // Create video tracks\n let settings = {\n active: this._hls.startLevel === i,\n label: hlsVideoTracks[i].name,\n bandwidth: hlsVideoTracks[i].bitrate,\n language: '',\n index: i\n };\n videoTracks.push(new VideoTrack(settings));\n }\n return videoTracks;\n }\n\n /**\n * Parse native video tag text tracks into player text tracks.\n * @param {TextTrackList} vidTextTracks - The native video tag text tracks.\n * @returns {Array<TextTrack>} - The parsed text tracks.\n * @private\n */\n _parseTextTracks(vidTextTracks: TextTrackList | Array<Object>): Array<TextTrack> {\n let textTracks = [];\n for (let i = 0; i < vidTextTracks.length; i++) {\n // Create text tracks\n let settings = {\n active: vidTextTracks[i].mode === 'showing',\n label: vidTextTracks[i].label,\n kind: vidTextTracks[i].kind,\n language: vidTextTracks[i].language,\n index: i\n };\n textTracks.push(new TextTrack(settings));\n }\n return textTracks;\n }\n\n /**\n * Select an audio track.\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select.\n * @returns {void}\n * @public\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n if (audioTrack instanceof AudioTrack && !audioTrack.active && this._hls.audioTracks) {\n this._hls.audioTrack = audioTrack.id;\n }\n }\n\n /**\n * Select a video track.\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the track to select.\n * @returns {void}\n * @public\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n if (videoTrack instanceof VideoTrack && (!videoTrack.active || this._hls.autoLevelEnabled) && this._hls.levels) {\n this._hls.nextLevel = videoTrack.index;\n }\n }\n\n /**\n * Select a text track.\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select.\n * @returns {void}\n * @public\n */\n selectTextTrack(textTrack: TextTrack): void {\n if (textTrack instanceof TextTrack && !textTrack.active && this._videoElement.textTracks) {\n this._disableAllTextTracks();\n this._videoElement.textTracks[textTrack.index].mode = 'showing';\n HlsAdapter._logger.debug('Text track changed', textTrack);\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Enables adaptive bitrate switching according to hls.js logic.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n this._hls.nextLevel = -1;\n }\n\n /**\n * Triggers on video track selection (auto or manually) the 'videotrackchanged' event forward.\n * @function _onLevelSwitched\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n _onLevelSwitched(event: string, data: any): void {\n let videoTrack = this._playerTracks.find((track) => {\n return (track instanceof VideoTrack && track.index === data.level);\n });\n HlsAdapter._logger.debug('Video track changed', videoTrack);\n this._onTrackChanged(videoTrack);\n }\n\n /**\n * Triggers on audio track selection (auto or manually) the 'audiotrackchanged' event forward.\n * @function _onAudioTrackSwitched\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n _onAudioTrackSwitched(event: string, data: any): void {\n let audioTrack = this._playerTracks.find((track) => {\n return (track instanceof AudioTrack && track.id === data.id);\n });\n HlsAdapter._logger.debug('Audio track changed', audioTrack);\n this._onTrackChanged(audioTrack);\n }\n\n /**\n * Disables all the video tag text tracks.\n * @returns {void}\n * @private\n */\n _disableAllTextTracks() {\n let vidTextTracks = this._videoElement.textTracks;\n for (let i = 0; i < vidTextTracks.length; i++) {\n vidTextTracks[i].mode = 'hidden';\n }\n }\n\n /**\n * Handles hls errors.\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n _onError(event: string, data: any): void {\n let errorType = data.type;\n let errorDetails = data.details;\n let errorFatal = data.fatal;\n if (errorFatal) {\n switch (errorType) {\n case Hlsjs.ErrorTypes.NETWORK_ERROR:\n HlsAdapter._logger.error(\"fatal network error encountered, try to recover\");\n this._hls.startLoad();\n break;\n case Hlsjs.ErrorTypes.MEDIA_ERROR:\n HlsAdapter._logger.error(\"fatal media error encountered, try to recover\");\n this._hls.recoverMediaError();\n break;\n default:\n HlsAdapter._logger.error(\"fatal error, cannot recover\");\n this.destroy();\n break;\n }\n } else {\n switch (errorDetails) {\n case Hlsjs.ErrorDetails.MANIFEST_LOAD_ERROR:\n case Hlsjs.ErrorDetails.MANIFEST_LOAD_TIMEOUT:\n case Hlsjs.ErrorDetails.MANIFEST_PARSING_ERROR:\n case Hlsjs.ErrorDetails.LEVEL_LOAD_ERROR:\n case Hlsjs.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n case Hlsjs.ErrorDetails.LEVEL_SWITCH_ERROR:\n case Hlsjs.ErrorDetails.FRAG_LOAD_ERROR:\n case Hlsjs.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case Hlsjs.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case Hlsjs.ErrorDetails.FRAG_PARSING_ERROR:\n case Hlsjs.ErrorDetails.BUFFER_APPEND_ERROR:\n case Hlsjs.ErrorDetails.BUFFER_APPENDING_ERROR:\n HlsAdapter._logger.error(errorType, errorDetails);\n break;\n default:\n break;\n }\n }\n }\n\n /**\n * Removes hls.js bindings.\n * @returns {void}\n * @private\n */\n _removeBindings(): void {\n this._hls.off(Hlsjs.Events.ERROR, this._onError);\n this._hls.off(Hlsjs.Events.LEVEL_SWITCHED, this._onLevelSwitched);\n this._hls.off(Hlsjs.Events.AUDIO_TRACK_SWITCHED, this._onAudioTrackSwitched);\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * In case the adapter preformed a load it will return the manifest url.\n * @public\n * @returns {string} - The src url.\n */\n get src(): string {\n if (this._loadPromise && this._sourceObj) {\n return this._sourceObj.url;\n }\n return \"\";\n }\n}\n\n// Register hls adapter to the media source adapter provider.\nif (HlsAdapter.isSupported()) {\n registerMediaSourceAdapter(HlsAdapter);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./hls-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///hls/hls-adapter.js","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"hls.js\",\"commonjs2\":\"hls.js\",\"amd\":\"hls.js\",\"root\":\"Hls\"}\n// module id = 1\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/hls/external {\"commonjs\":\"hls.js\",\"commonjs2\":\"hls.js\",\"amd\":\"hls.js\",\"root\":\"Hls\"}","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}\n// module id = 2\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/hls/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","(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})\n\n\n// WEBPACK FOOTER //\n// node_modules/browser-pack/_prelude.js","// 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 } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\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\n\n// WEBPACK FOOTER //\n// node_modules/events/events.js","// see https://tools.ietf.org/html/rfc1808\r\n\r\n/* jshint ignore:start */\r\n(function(root) { \r\n/* jshint ignore:end */\r\n\r\n var URL_REGEX = /^((?:[^\\/;?#]+:)?)(\\/\\/[^\\/\\;?#]*)?(.*?)??(;.*?)?(\\?.*?)?(#.*?)?$/;\r\n var FIRST_SEGMENT_REGEX = /^([^\\/;?#]*)(.*)$/;\r\n var SLASH_DOT_REGEX = /(?:\\/|^)\\.(?=\\/)/g;\r\n var SLASH_DOT_DOT_REGEX = /(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/).*?(?=\\/)/g;\r\n\r\n var URLToolkit = { // jshint ignore:line\r\n // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //\r\n // E.g\r\n // With opts.alwaysNormalize = false (default, spec compliant)\r\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g\r\n // With opts.alwaysNormalize = true (default, not spec compliant)\r\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/g\r\n buildAbsoluteURL: function(baseURL, relativeURL, opts) {\r\n opts = opts || {};\r\n // remove any remaining space and CRLF\r\n baseURL = baseURL.trim();\r\n relativeURL = relativeURL.trim();\r\n if (!relativeURL) {\r\n // 2a) If the embedded URL is entirely empty, it inherits the\r\n // entire base URL (i.e., is set equal to the base URL)\r\n // and we are done.\r\n if (!opts.alwaysNormalize) {\r\n return baseURL;\r\n }\r\n var basePartsForNormalise = this.parseURL(baseURL);\r\n if (!baseParts) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n basePartsForNormalise.path = URLToolkit.normalizePath(basePartsForNormalise.path);\r\n return URLToolkit.buildURLFromParts(basePartsForNormalise);\r\n }\r\n var relativeParts = this.parseURL(relativeURL);\r\n if (!relativeParts) {\r\n throw new Error('Error trying to parse relative URL.');\r\n }\r\n if (relativeParts.scheme) {\r\n // 2b) If the embedded URL starts with a scheme name, it is\r\n // interpreted as an absolute URL and we are done.\r\n if (!opts.alwaysNormalize) {\r\n return relativeURL;\r\n }\r\n relativeParts.path = URLToolkit.normalizePath(relativeParts.path);\r\n return URLToolkit.buildURLFromParts(relativeParts);\r\n }\r\n var baseParts = this.parseURL(baseURL);\r\n if (!baseParts) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== '/') {\r\n // If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc\r\n // This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'\r\n var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);\r\n baseParts.netLoc = pathParts[1];\r\n baseParts.path = pathParts[2];\r\n }\r\n if (baseParts.netLoc && !baseParts.path) {\r\n baseParts.path = '/';\r\n }\r\n var builtParts = {\r\n // 2c) Otherwise, the embedded URL inherits the scheme of\r\n // the base URL.\r\n scheme: baseParts.scheme,\r\n netLoc: relativeParts.netLoc,\r\n path: null,\r\n params: relativeParts.params,\r\n query: relativeParts.query,\r\n fragment: relativeParts.fragment\r\n };\r\n if (!relativeParts.netLoc) {\r\n // 3) If the embedded URL's <net_loc> is non-empty, we skip to\r\n // Step 7. Otherwise, the embedded URL inherits the <net_loc>\r\n // (if any) of the base URL.\r\n builtParts.netLoc = baseParts.netLoc;\r\n // 4) If the embedded URL path is preceded by a slash \"/\", the\r\n // path is not relative and we skip to Step 7.\r\n if (relativeParts.path[0] !== '/') {\r\n if (!relativeParts.path) {\r\n // 5) If the embedded URL path is empty (and not preceded by a\r\n // slash), then the embedded URL inherits the base URL path\r\n builtParts.path = baseParts.path;\r\n // 5a) if the embedded URL's <params> is non-empty, we skip to\r\n // step 7; otherwise, it inherits the <params> of the base\r\n // URL (if any) and\r\n if (!relativeParts.params) {\r\n builtParts.params = baseParts.params;\r\n // 5b) if the embedded URL's <query> is non-empty, we skip to\r\n // step 7; otherwise, it inherits the <query> of the base\r\n // URL (if any) and we skip to step 7.\r\n if (!relativeParts.query) {\r\n builtParts.query = baseParts.query;\r\n }\r\n }\r\n } else {\r\n // 6) The last segment of the base URL's path (anything\r\n // following the rightmost slash \"/\", or the entire path if no\r\n // slash is present) is removed and the embedded URL's path is\r\n // appended in its place.\r\n var baseURLPath = baseParts.path;\r\n var newPath = baseURLPath.substring(0, baseURLPath.lastIndexOf('/') + 1) + relativeParts.path;\r\n builtParts.path = URLToolkit.normalizePath(newPath);\r\n }\r\n }\r\n }\r\n if (builtParts.path === null) {\r\n builtParts.path = opts.alwaysNormalize ? URLToolkit.normalizePath(relativeParts.path) : relativeParts.path;\r\n }\r\n return URLToolkit.buildURLFromParts(builtParts);\r\n },\r\n parseURL: function(url) {\r\n var parts = URL_REGEX.exec(url);\r\n if (!parts) {\r\n return null;\r\n }\r\n return {\r\n scheme: parts[1] || '',\r\n netLoc: parts[2] || '',\r\n path: parts[3] || '',\r\n params: parts[4] || '',\r\n query: parts[5] || '',\r\n fragment: parts[6] || ''\r\n };\r\n },\r\n normalizePath: function(path) {\r\n // The following operations are\r\n // then applied, in order, to the new path:\r\n // 6a) All occurrences of \"./\", where \".\" is a complete path\r\n // segment, are removed.\r\n // 6b) If the path ends with \".\" as a complete path segment,\r\n // that \".\" is removed.\r\n path = path.split('').reverse().join('').replace(SLASH_DOT_REGEX, '');\r\n // 6c) All occurrences of \"<segment>/../\", where <segment> is a\r\n // complete path segment not equal to \"..\", are removed.\r\n // Removal of these path segments is performed iteratively,\r\n // removing the leftmost matching pattern on each iteration,\r\n // until no matching pattern remains.\r\n // 6d) If the path ends with \"<segment>/..\", where <segment> is a\r\n // complete path segment not equal to \"..\", that\r\n // \"<segment>/..\" is removed.\r\n while (path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, '')).length) {} // jshint ignore:line\r\n return path.split('').reverse().join('');\r\n },\r\n buildURLFromParts: function(parts) {\r\n return parts.scheme + parts.netLoc + parts.path + parts.params + parts.query + parts.fragment;\r\n }\r\n };\r\n\r\n/* jshint ignore:start */\r\n if(typeof exports === 'object' && typeof module === 'object')\r\n module.exports = URLToolkit;\r\n else if(typeof define === 'function' && define.amd)\r\n define([], function() { return URLToolkit; });\r\n else if(typeof exports === 'object')\r\n exports[\"URLToolkit\"] = URLToolkit;\r\n else\r\n root[\"URLToolkit\"] = URLToolkit;\r\n})(this);\r\n/* jshint ignore:end */\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/url-toolkit/src/url-toolkit.js","var 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\n\n// WEBPACK FOOTER //\n// node_modules/webworkify/index.js","/**\n * HLS config\n */\n'use strict';\n\nimport AbrController from './controller/abr-controller';\nimport BufferController from './controller/buffer-controller';\nimport CapLevelController from './controller/cap-level-controller';\nimport FPSController from './controller/fps-controller';\nimport XhrLoader from './utils/xhr-loader';\n//import FetchLoader from './utils/fetch-loader';\n//#if altaudio\nimport AudioTrackController from './controller/audio-track-controller';\nimport AudioStreamController from './controller/audio-stream-controller';\n//#endif\n\n//#if subtitle\nimport Cues from './utils/cues';\nimport TimelineController from './controller/timeline-controller';\nimport SubtitleTrackController from './controller/subtitle-track-controller';\nimport SubtitleStreamController from './controller/subtitle-stream-controller';\n//#endif\n\nexport var hlsDefaultConfig = {\n autoStartLoad: true, // used by stream-controller\n startPosition: -1, // used by stream-controller\n defaultAudioCodec: undefined, // used by stream-controller\n debug: false, // used by logger\n capLevelOnFPSDrop: false, // used by fps-controller\n capLevelToPlayerSize: false, // used by cap-level-controller\n initialLiveManifestSize: 1, // used by stream-controller\n maxBufferLength: 30, // used by stream-controller\n maxBufferSize: 60 * 1000 * 1000, // used by stream-controller\n maxBufferHole: 0.5, // used by stream-controller\n maxSeekHole: 2, // used by stream-controller\n lowBufferWatchdogPeriod: 0.5, // used by stream-controller\n highBufferWatchdogPeriod: 3, // used by stream-controller\n nudgeOffset: 0.1, // used by stream-controller\n nudgeMaxRetry : 3, // used by stream-controller\n maxFragLookUpTolerance: 0.25, // used by stream-controller\n liveSyncDurationCount:3, // used by stream-controller\n liveMaxLatencyDurationCount: Infinity, // used by stream-controller\n liveSyncDuration: undefined, // used by stream-controller\n liveMaxLatencyDuration: undefined, // used by stream-controller\n maxMaxBufferLength: 600, // used by stream-controller\n enableWorker: true, // used by demuxer\n enableSoftwareAES: true, // used by decrypter\n manifestLoadingTimeOut: 10000, // used by playlist-loader\n manifestLoadingMaxRetry: 1, // used by playlist-loader\n manifestLoadingRetryDelay: 1000, // used by playlist-loader\n manifestLoadingMaxRetryTimeout: 64000, // used by playlist-loader\n startLevel: undefined, // used by level-controller\n levelLoadingTimeOut: 10000, // used by playlist-loader\n levelLoadingMaxRetry: 4, // used by playlist-loader\n levelLoadingRetryDelay: 1000, // used by playlist-loader\n levelLoadingMaxRetryTimeout: 64000, // used by playlist-loader\n fragLoadingTimeOut: 20000, // used by fragment-loader\n fragLoadingMaxRetry: 6, // used by fragment-loader\n fragLoadingRetryDelay: 1000, // used by fragment-loader\n fragLoadingMaxRetryTimeout: 64000, // used by fragment-loader\n fragLoadingLoopThreshold: 3, // used by stream-controller\n startFragPrefetch: false, // used by stream-controller\n fpsDroppedMonitoringPeriod: 5000, // used by fps-controller\n fpsDroppedMonitoringThreshold: 0.2, // used by fps-controller\n appendErrorMaxRetry: 3, // used by buffer-controller\n loader: XhrLoader,\n //loader: FetchLoader,\n fLoader: undefined,\n pLoader: undefined,\n xhrSetup: undefined,\n fetchSetup: undefined,\n abrController: AbrController,\n bufferController: BufferController,\n capLevelController: CapLevelController,\n fpsController: FPSController,\n//#if altaudio\n audioStreamController: AudioStreamController,\n audioTrackController : AudioTrackController,\n//#endif\n//#if subtitle\n subtitleStreamController: SubtitleStreamController,\n subtitleTrackController: SubtitleTrackController,\n timelineController: TimelineController,\n cueHandler: Cues,\n enableCEA708Captions: true, // used by timeline-controller\n enableWebVTT: true, // used by timeline-controller\n captionsTextTrack1Label: 'English', // used by timeline-controller\n captionsTextTrack1LanguageCode: 'en', // used by timeline-controller\n captionsTextTrack2Label: 'Spanish', // used by timeline-controller\n captionsTextTrack2LanguageCode: 'es', // used by timeline-controller\n//#endif\n stretchShortVideoTrack: false, // used by mp4-remuxer\n forceKeyFrameOnDiscontinuity: true, // used by ts-demuxer\n abrEwmaFastLive: 3, // used by abr-controller\n abrEwmaSlowLive: 9, // used by abr-controller\n abrEwmaFastVoD: 3, // used by abr-controller\n abrEwmaSlowVoD: 9, // used by abr-controller\n abrEwmaDefaultEstimate: 5e5, // 500 kbps // used by abr-controller\n abrBandWidthFactor : 0.95, // used by abr-controller\n abrBandWidthUpFactor : 0.7, // used by abr-controller\n abrMaxWithRealBitrate : false, // used by abr-controller\n maxStarvationDelay : 4, // used by abr-controller\n maxLoadingDelay : 4, // used by abr-controller\n minAutoBitrate: 0 // used by hls\n };\n\n\n\n// WEBPACK FOOTER //\n// src/config.js","/*\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\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport BufferHelper from '../helper/buffer-helper';\nimport {ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\nimport EwmaBandWidthEstimator from '../utils/ewma-bandwidth-estimator';\n\nclass AbrController extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.FRAG_LOADING,\n Event.FRAG_LOADED,\n Event.FRAG_BUFFERED,\n Event.ERROR);\n this.lastLoadedFragLevel = 0;\n this._nextAutoLevel = -1;\n this.hls = hls;\n this.onCheck = this._abandonRulesCheck.bind(this);\n }\n\n destroy() {\n this.clearTimer();\n EventHandler.prototype.destroy.call(this);\n }\n\n onFragLoading(data) {\n let 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 let hls = this.hls,\n level = data.frag.level,\n isLive = hls.levels[level].details.live,\n config = hls.config,\n ewmaFast, ewmaSlow;\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 EwmaBandWidthEstimator(hls,ewmaSlow,ewmaFast,config.abrEwmaDefaultEstimate);\n }\n this.fragCurrent = frag;\n }\n }\n\n _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 let hls = this.hls, v = hls.media,frag = this.fragCurrent, loader = frag.loader, minAutoLevel = hls.minAutoLevel;\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.warn('frag loader destroy or aborted, disarm abandonRules');\n this.clearTimer();\n return;\n }\n let 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 let 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 let levels = hls.levels,\n 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\n // compute expected fragment length using frag duration and level bitrate. also ensure that expected len is gte than already loaded size\n level = levels[frag.level],\n levelBitrate = level.realBitrate ? Math.max(level.realBitrate,level.bitrate) : level.bitrate,\n expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levelBitrate / 8)),\n pos = v.currentTime,\n fragLoadedDelay = (expectedLen - stats.loaded) / loadRate,\n bufferStarvationDelay = (BufferHelper.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 let fragLevelNextLoadedDelay, nextLoadLevel;\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 > minAutoLevel ; 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 let levelNextBitrate = levels[nextLoadLevel].realBitrate ? Math.max(levels[nextLoadLevel].realBitrate,levels[nextLoadLevel].bitrate) : levels[nextLoadLevel].bitrate;\n fragLevelNextLoadedDelay = frag.duration * levelNextBitrate / (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 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(Event.FRAG_LOAD_EMERGENCY_ABORTED, {frag: frag, stats: stats });\n }\n }\n }\n }\n }\n\n onFragLoaded(data) {\n let frag = data.frag;\n if (frag.type === 'main' && !isNaN(frag.sn)) {\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\n // compute level average bitrate\n if (this.hls.config.abrMaxWithRealBitrate) {\n const level = this.hls.levels[frag.level];\n let loadedBytes = (level.loaded ? level.loaded.bytes : 0) + data.stats.loaded;\n let loadedDuration = (level.loaded ? level.loaded.duration : 0) + data.frag.duration;\n level.loaded = { bytes : loadedBytes, duration : loadedDuration };\n level.realBitrate = Math.round(8*loadedBytes/loadedDuration);\n }\n // if fragment has been loaded to perform a bitrate test,\n if (data.frag.bitrateTest) {\n let stats = data.stats;\n stats.tparsed = stats.tbuffered = stats.tload;\n this.onFragBuffered(data);\n }\n }\n }\n\n onFragBuffered(data) {\n var stats = data.stats, 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' && !isNaN(frag.sn) && ((!frag.bitrateTest || stats.tload === stats.tbuffered))) {\n // use tparsed-trequest instead of tbuffered-trequest to compute fragLoadingProcessing; rationale is that buffer appending only happens once media is attached\n // 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\n // as a consequence it could happen really late in the process. meaning that appending duration might appears huge ... leading to underestimated throughput estimation\n let fragLoadingProcessingMs = stats.tparsed - stats.trequest;\n 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 stats.bwEstimate = this._bwEstimator.getEstimate();\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 onError(data) {\n // stop timer in case of frag loading error\n switch(data.details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n this.clearTimer();\n break;\n default:\n break;\n }\n }\n\n clearTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n }\n\n // return next auto level\n get nextAutoLevel() {\n const forcedAutoLevel = this._nextAutoLevel;\n const bwEstimator = this._bwEstimator;\n // in case next auto level has been forced, and bw not available or not reliable, return forced value\n if (forcedAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {\n return forcedAutoLevel;\n }\n // compute next level using ABR logic\n let nextABRAutoLevel = this._nextABRAutoLevel;\n // if forced auto level has been defined, use it to cap ABR computed quality level\n if (forcedAutoLevel !== -1) {\n nextABRAutoLevel = Math.min(forcedAutoLevel,nextABRAutoLevel);\n }\n return nextABRAutoLevel;\n }\n get _nextABRAutoLevel() {\n var hls = this.hls, maxAutoLevel = hls.maxAutoLevel, levels = hls.levels, config = hls.config, minAutoLevel = hls.minAutoLevel;\n const v = hls.media,\n currentLevel = this.lastLoadedFragLevel,\n currentFragDuration = this.fragCurrent ? this.fragCurrent.duration : 0,\n pos = (v ? v.currentTime : 0),\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 // bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.\n bufferStarvationDelay = (BufferHelper.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 let 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.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 let maxStarvationDelay = currentFragDuration ? Math.min(currentFragDuration,config.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 let 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 // cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration\n const maxLoadingDelay = currentFragDuration ? Math.min(currentFragDuration,config.maxLoadingDelay) : config.maxLoadingDelay;\n maxStarvationDelay = maxLoadingDelay - bitrateTestDelay;\n 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 _findBestLevel(currentLevel,currentFragDuration,currentBw,minAutoLevel,maxAutoLevel,maxFetchDuration,bwFactor,bwUpFactor,levels) {\n for (let i = maxAutoLevel; i >= minAutoLevel; i--) {\n let levelInfo = levels[i],\n levelDetails = levelInfo.details,\n avgDuration = levelDetails ? levelDetails.totalduration/levelDetails.fragments.length : currentFragDuration,\n live = levelDetails ? levelDetails.live : false,\n adjustedbw;\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 const bitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate,levels[i].bitrate) : levels[i].bitrate,\n fetchDuration = bitrate * avgDuration / adjustedbw;\n\n 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 live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches\n // 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 ...\n // special case to support startLevel = -1 (bitrateTest) on live streams : in that case we should not exit loop so that _findBestLevel will return -1\n (!fetchDuration || (live && !this.bitrateTestDelay) || fetchDuration < maxFetchDuration) ) {\n // as we are looping from highest to lowest, this will return the best achievable quality level\n return i;\n }\n }\n // not enough time budget even with quality level 0 ... rebuffering might happen\n return -1;\n }\n\n set nextAutoLevel(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n}\n\nexport default AbrController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/abr-controller.js","/*\n * Audio Stream Controller\n*/\n\nimport BinarySearch from '../utils/binary-search';\nimport BufferHelper from '../helper/buffer-helper';\nimport Demuxer from '../demux/demuxer';\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport LevelHelper from '../helper/level-helper';\nimport TimeRanges from '../utils/timeRanges';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nconst 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 BUFFER_FLUSHING : 'BUFFER_FLUSHING',\n ENDED : 'ENDED',\n ERROR : 'ERROR',\n WAITING_INIT_PTS : 'WAITING_INIT_PTS'\n};\n\nclass AudioStreamController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.AUDIO_TRACKS_UPDATED,\n Event.AUDIO_TRACK_SWITCHING,\n Event.AUDIO_TRACK_LOADED,\n Event.KEY_LOADED,\n Event.FRAG_LOADED,\n Event.FRAG_PARSING_INIT_SEGMENT,\n Event.FRAG_PARSING_DATA,\n Event.FRAG_PARSED,\n Event.ERROR,\n Event.BUFFER_CREATED,\n Event.BUFFER_APPENDED,\n Event.BUFFER_FLUSHED,\n Event.INIT_PTS_FOUND);\n\n this.config = hls.config;\n this.audioCodecSwap = false;\n this.ticks = 0;\n this._state = State.STOPPED;\n this.ontick = this.tick.bind(this);\n this.initPTS=[];\n this.waitingFragment=null;\n }\n\n destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n EventHandler.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n\n //Signal that video PTS was found\n onInitPtsFound(data) {\n var demuxerId=data.id, cc = data.frag.cc, initPTS = data.initPTS;\n if(demuxerId === 'main') {\n //Always update the new INIT PTS\n //Can change due level switch\n this.initPTS[cc] = initPTS;\n logger.log(`InitPTS for cc:${cc} found from video track:${initPTS}`);\n\n //If we are waiting we need to demux/remux the waiting frag\n //With the new initPTS\n if (this.state === State.WAITING_INIT_PTS) {\n logger.log('sending pending audio frag to demuxer');\n this.state = State.FRAG_LOADING;\n //We have audio frag waiting or video pts\n //Let process it\n this.onFragLoaded(this.waitingFragment);\n //Lets clean the waiting frag\n this.waitingFragment = null;\n }\n }\n }\n\n startLoad(startPosition) {\n if (this.tracks) {\n var lastCurrentTime = this.lastCurrentTime;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.fragLoadError = 0;\n if (lastCurrentTime > 0 && startPosition === -1) {\n logger.log(`audio:override startPosition with lastCurrentTime @${lastCurrentTime.toFixed(3)}`);\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 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 set state(nextState) {\n if (this.state !== nextState) {\n const previousState = this.state;\n this._state = nextState;\n logger.log(`audio stream:${previousState}->${nextState}`);\n }\n }\n\n get state() {\n return this._state;\n }\n\n 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 doTick() {\n var pos, track, trackDetails, hls = this.hls, 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 case State.BUFFER_FLUSHING:\n break;\n case State.STARTING:\n this.state = State.WAITING_TRACK;\n this.loadedmetadata = false;\n break;\n case State.IDLE:\n const tracks = this.tracks;\n // audio tracks not received => exit loop\n if (!tracks) {\n break;\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 (!this.media &&\n (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 let media = this.mediaBuffer ? this.mediaBuffer : this.media,\n bufferInfo = BufferHelper.bufferInfo(media,pos,config.maxBufferHole),\n bufferLen = bufferInfo.len,\n bufferEnd = bufferInfo.end,\n fragPrevious = this.fragPrevious,\n maxBufLen = config.maxMaxBufferLength,\n audioSwitch = this.audioSwitch,\n trackId = this.trackId;\n\n // if buffer length is less than maxBufLen try to load a new fragment\n if ((bufferLen < maxBufLen || audioSwitch) && trackId < tracks.length) {\n trackDetails = tracks[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 (!audioSwitch && !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(Event.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 let fragments = trackDetails.fragments,\n fragLen = fragments.length,\n start = fragments[0].start,\n end = fragments[fragLen-1].start + fragments[fragLen-1].duration,\n frag;\n\n // When switching audio track, reload audio as close as possible to currentTime\n if(audioSwitch){\n if (trackDetails.live && !trackDetails.PTSKnown) {\n logger.log(`switching audiotrack, live stream, unknown PTS,load first fragment`);\n bufferEnd = 0;\n } else {\n bufferEnd = pos;\n // if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime\n if (trackDetails.PTSKnown && pos < start) {\n // if everything is buffered from pos to start or if audio buffer upfront, let's seek to start\n if (bufferInfo.end > start || bufferInfo.nextStart) {\n logger.log('alt audio track ahead of main track, seek to start of alt audio track');\n this.media.currentTime = start + 0.05;\n } else {\n return;\n }\n }\n }\n }\n if (trackDetails.initSegment && !trackDetails.initSegment.data) {\n frag = trackDetails.initSegment;\n }\n // if bufferEnd before start of playlist, load first fragment\n else if (bufferEnd <= start) {\n frag = fragments[0];\n if (trackDetails.live && frag.loadIdx && frag.loadIdx === this.fragLoadIdx) {\n // we just loaded this first fragment, and we are still lagging behind the start of the live playlist\n // let's force seek to start\n const nextBuffered = bufferInfo.nextStart ? bufferInfo.nextStart : start;\n logger.log(`no alt audio available @currentTime:${this.media.currentTime}, seeking @${nextBuffered + 0.05}`);\n this.media.currentTime = nextBuffered + 0.05;\n return;\n }\n } else {\n let foundFrag;\n let maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n const fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;\n let fragmentWithinToleranceTest = (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 // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments\n let candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);\n if ((candidate.start + candidate.duration - candidateLookupTolerance) <= bufferEnd) {\n return 1;\n }// if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n };\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n // Prefer the next fragment if it's within tolerance\n if (fragNext && !fragmentWithinToleranceTest(fragNext)) {\n foundFrag = fragNext;\n } else {\n foundFrag = BinarySearch.search(fragments, fragmentWithinToleranceTest);\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.log(`SN just loaded, load next one: ${frag.sn}`);\n } else {\n frag = null;\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 && (frag.decryptdata.uri != null) && (frag.decryptdata.key == null)) {\n logger.log(`Loading key for ${frag.sn} of [${trackDetails.startSN} ,${trackDetails.endSN}],track ${trackId}`);\n this.state = State.KEY_LOADING;\n hls.trigger(Event.KEY_LOADING, {frag: frag});\n } else {\n logger.log(`Loading ${frag.sn} of [${trackDetails.startSN} ,${trackDetails.endSN}],track ${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 let 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 if (!isNaN(frag.sn)) {\n this.nextLoadPosition = frag.start + frag.duration;\n }\n hls.trigger(Event.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.log(`audioStreamController: retryDate reached, switch back to IDLE state`);\n this.state = State.IDLE;\n }\n break;\n case State.WAITING_INIT_PTS:\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 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 let config = this.config;\n if(this.tracks && config.autoStartLoad) {\n this.startLoad(config.startPosition);\n }\n }\n\n onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n 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(track => {\n if(track.details) {\n track.details.fragments.forEach(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 = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n\n 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 onMediaEnded() {\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n\n onAudioTracksUpdated(data) {\n logger.log('audio tracks updated');\n this.tracks = data.audioTracks;\n }\n\n onAudioTrackSwitching(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 this.waitingFragment=null;\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\n //should we switch tracks ?\n if(altAudio){\n this.audioSwitch = true;\n //main audio track are handled by stream-controller, just do something if switching to alt audio track\n this.state=State.IDLE;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n }\n this.tick();\n }\n\n onAudioTrackLoaded(data) {\n var newDetails = data.details,\n trackId = data.id,\n track = this.tracks[trackId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n logger.log(`track ${trackId} loaded [${newDetails.startSN},${newDetails.endSN}],duration:${duration}`);\n\n if (newDetails.live) {\n var curDetails = track.details;\n if (curDetails && newDetails.fragments.length > 0) {\n // we already have details for that level, merge them\n LevelHelper.mergeDetails(curDetails,newDetails);\n sliding = newDetails.fragments[0].start;\n // TODO\n //this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n logger.log(`live audio playlist sliding:${sliding.toFixed(3)}`);\n } else {\n logger.log('live audio playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n logger.log('live audio playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n track.details = newDetails;\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 let startTimeOffset = newDetails.startTimeOffset;\n if(!isNaN(startTimeOffset)) {\n 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 onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n\n onFragLoaded(data) {\n var fragCurrent = this.fragCurrent,\n fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING &&\n fragCurrent &&\n fragLoaded.type === 'audio' &&\n fragLoaded.level === fragCurrent.level &&\n fragLoaded.sn === fragCurrent.sn) {\n var track = this.tracks[this.trackId],\n details = track.details,\n duration = details.totalduration,\n trackId = fragCurrent.level,\n sn = fragCurrent.sn,\n cc = fragCurrent.cc,\n audioCodec = this.config.defaultAudioCodec || track.audioCodec || 'mp4a.40.2',\n stats = this.stats = data.stats;\n if (sn === 'initSegment') {\n this.state = State.IDLE;\n\n stats.tparsed = stats.tbuffered = performance.now();\n details.initSegment.data = data.payload;\n this.hls.trigger(Event.FRAG_BUFFERED, {stats: stats, frag: fragCurrent, id : 'audio'});\n this.tick();\n } else {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.appended = false;\n if(!this.demuxer) {\n this.demuxer = new Demuxer(this.hls,'audio');\n }\n //Check if we have video initPTS\n // If not we need to wait for it\n let initPTS = this.initPTS[cc];\n let initSegmentData = details.initSegment ? details.initSegment.data : [];\n if (details.initSegment || initPTS !== undefined){\n this.pendingBuffering = true;\n 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 let accurateTimeOffset = false; //details.PTSKnown || !details.live;\n this.demuxer.push(data.payload, initSegmentData, audioCodec, null, fragCurrent, duration, accurateTimeOffset, initPTS);\n } else {\n 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}`);\n this.waitingFragment=data;\n this.state=State.WAITING_INIT_PTS;\n }\n }\n }\n this.fragLoadError = 0;\n }\n\n onFragParsingInitSegment(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'audio' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n let tracks = data.tracks, track;\n\n // delete any video track found on audio demuxer\n if (tracks.video) {\n delete tracks.video;\n }\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(Event.BUFFER_CODECS,tracks);\n logger.log(`audio track:audio,container:${track.container},codecs[level/parsed]=[${track.levelCodec}/${track.codec}]`);\n let initSegment = track.initSegment;\n if (initSegment) {\n let appendObj = {type: 'audio', data: initSegment, parent : 'audio',content : 'initSegment'};\n if (this.audioSwitch) {\n this.pendingData = [appendObj];\n } else {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(Event.BUFFER_APPENDING, appendObj);\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n }\n\n onFragParsingData(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'audio' &&\n data.type === 'audio' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n let trackId= this.trackId,\n track = this.tracks[trackId],\n hls = this.hls;\n\n if (isNaN(data.endPTS)) {\n data.endPTS = data.startPTS + fragCurrent.duration;\n data.endDTS = data.startDTS + fragCurrent.duration;\n }\n\n 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 LevelHelper.updateFragPTSDTS(track.details,fragCurrent,data.startPTS,data.endPTS);\n\n let audioSwitch = this.audioSwitch, media = this.media, appendOnBufferFlush = false;\n //Only flush audio from old audio tracks when PTS is known on new audio track\n if(audioSwitch && media) {\n if (media.readyState) {\n let currentTime = media.currentTime;\n logger.log('switching audio track : currentTime:'+ currentTime);\n if (currentTime >= data.startPTS) {\n logger.log('switching audio track : flushing all audio');\n this.state = State.BUFFER_FLUSHING;\n hls.trigger(Event.BUFFER_FLUSHING, {startOffset: 0 , endOffset: Number.POSITIVE_INFINITY, type : 'audio'});\n appendOnBufferFlush = true;\n //Lets announce that the initial audio track switch flush occur\n this.audioSwitch = false;\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : trackId});\n }\n } else {\n //Lets announce that the initial audio track switch flush occur\n this.audioSwitch=false;\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : trackId});\n }\n }\n\n\n let pendingData = this.pendingData;\n if(!this.audioSwitch) {\n [data.data1, data.data2].forEach(buffer => {\n if (buffer && buffer.length) {\n pendingData.push({type: data.type, data: buffer, parent : 'audio',content : 'data'});\n }\n });\n if (!appendOnBufferFlush && pendingData.length) {\n pendingData.forEach(appendObj => {\n // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)\n // in that case it is useless to append following segments\n if (this.state === State.PARSING) {\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(Event.BUFFER_APPENDING, appendObj);\n }\n });\n this.pendingData = [];\n this.appended = true;\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsed(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'audio' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n\n\n onBufferCreated(data) {\n let audioTrack = data.tracks.audio;\n if (audioTrack) {\n this.mediaBuffer = audioTrack.buffer;\n this.loadedmetadata = true;\n }\n }\n\n onBufferAppended(data) {\n if (data.parent === 'audio') {\n const state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = (data.pending > 0);\n this._checkAppendedParsed();\n }\n }\n }\n\n _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n let frag = this.fragCurrent, stats = this.stats, hls = this.hls;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = performance.now();\n hls.trigger(Event.FRAG_BUFFERED, {stats: stats, frag: frag, id : 'audio'});\n let media = this.mediaBuffer ? this.mediaBuffer : this.media;\n logger.log(`audio buffered : ${TimeRanges.toString(media.buffered)}`);\n if (this.audioSwitch && this.appended) {\n this.audioSwitch = false;\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : this.trackId});\n }\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n\n onError(data) {\n let 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 ErrorDetails.FRAG_LOAD_ERROR:\n case 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 let 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.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.error(`audioStreamController: ${data.details} reaches max retry, redispatch as fatal ...`);\n // switch error to fatal\n data.fatal = true;\n this.state = State.ERROR;\n }\n }\n break;\n case ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case ErrorDetails.AUDIO_TRACK_LOAD_ERROR:\n case ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:\n case ErrorDetails.KEY_LOAD_ERROR:\n case 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.warn(`audioStreamController: ${data.details} while loading frag,switch to ${this.state} state ...`);\n }\n break;\n case ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (data.parent === 'audio' && (this.state === State.PARSING || this.state === State.PARSED)) {\n const media = this.mediaBuffer,\n currentTime = this.media.currentTime,\n mediaBuffered = media && BufferHelper.isBuffered(media,currentTime) && BufferHelper.isBuffered(media,currentTime+0.5);\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n const config = this.config;\n if(config.maxMaxBufferLength >= config.maxBufferLength) {\n // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...\n config.maxMaxBufferLength/=2;\n logger.warn(`audio:reduce max buffer length to ${config.maxMaxBufferLength}s`);\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\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/video-dev/hls.js/pull/708\n // in that case flush the whole audio buffer to recover\n logger.warn('buffer full error also media.currentTime is not buffered, flush audio buffer');\n this.fragCurrent = null;\n // flush everything\n this.state = State.BUFFER_FLUSHING;\n this.hls.trigger(Event.BUFFER_FLUSHING, {startOffset: 0 , endOffset: Number.POSITIVE_INFINITY, type : 'audio'});\n }\n }\n break;\n default:\n break;\n }\n }\n\n onBufferFlushed() {\n let pendingData = this.pendingData;\n if (pendingData && pendingData.length) {\n logger.log('appending pending audio data on Buffer Flushed');\n pendingData.forEach(appendObj => {\n this.hls.trigger(Event.BUFFER_APPENDING, appendObj);\n });\n this.appended = true;\n this.pendingData = [];\n this.state = State.PARSED;\n } else {\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}\nexport default AudioStreamController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/audio-stream-controller.js","/*\n * audio track controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nclass AudioTrackController extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.MANIFEST_LOADING,\n Event.MANIFEST_LOADED,\n Event.AUDIO_TRACK_LOADED);\n this.ticks = 0;\n this.ontick = this.tick.bind(this);\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n 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 doTick() {\n this.updateTrack(this.trackId);\n }\n onManifestLoading() {\n // reset audio tracks on manifest loading\n this.tracks = [];\n this.trackId = -1;\n }\n\n onManifestLoaded(data) {\n let tracks = data.audioTracks || [];\n let defaultFound = false;\n this.tracks = tracks;\n this.hls.trigger(Event.AUDIO_TRACKS_UPDATED, {audioTracks : tracks});\n // loop through available audio tracks and autoselect default if needed\n let id = 0;\n tracks.forEach(track => {\n if(track.default) {\n this.audioTrack = id;\n defaultFound = true;\n return;\n }\n id++;\n });\n if (defaultFound === false && tracks.length) {\n logger.log('no default audio track defined, use first audio track as default');\n this.audioTrack = 0;\n }\n }\n\n onAudioTrackLoaded(data) {\n if (data.id < this.tracks.length) {\n 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 get audioTracks() {\n return this.tracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n get audioTrack() {\n return this.trackId;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n set audioTrack(audioTrackId) {\n if (this.trackId !== audioTrackId || this.tracks[audioTrackId].details === undefined) {\n this.setAudioTrackInternal(audioTrackId);\n }\n }\n\n 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.log(`switching to audioTrack ${newId}`);\n let audioTrack = this.tracks[newId],\n hls = this.hls,\n type = audioTrack.type,\n url = audioTrack.url,\n eventObj = {id: newId, type : type, url : url};\n // keep AUDIO_TRACK_SWITCH for legacy reason\n hls.trigger(Event.AUDIO_TRACK_SWITCH, eventObj);\n hls.trigger(Event.AUDIO_TRACK_SWITCHING, eventObj);\n // check if we need to load playlist for this audio Track\n let 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.log(`(re)loading playlist for audioTrack ${newId}`);\n hls.trigger(Event.AUDIO_TRACK_LOADING, {url: url, id: newId});\n }\n }\n }\n\n updateTrack(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.log(`updating audioTrack ${newId}`);\n let audioTrack = this.tracks[newId], url = audioTrack.url;\n // check if we need to load playlist for this audio Track\n let 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.log(`(re)loading playlist for audioTrack ${newId}`);\n this.hls.trigger(Event.AUDIO_TRACK_LOADING, {url: url, id: newId});\n }\n }\n }\n}\n\nexport default AudioTrackController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/audio-track-controller.js","/*\n * Buffer Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n\n\nclass BufferController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHING,\n Event.MEDIA_DETACHING,\n Event.MANIFEST_PARSED,\n Event.BUFFER_RESET,\n Event.BUFFER_APPENDING,\n Event.BUFFER_CODECS,\n Event.BUFFER_EOS,\n Event.BUFFER_FLUSHING,\n Event.LEVEL_PTS_UPDATED,\n Event.LEVEL_UPDATED);\n\n // the value that we have set mediasource.duration to\n // (the actual duration may be tweaked slighly by the browser)\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 this.tracks = {};\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n onLevelPtsUpdated(data) {\n let type = data.type;\n let audioTrack = this.tracks.audio;\n\n // Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)\n // in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`\n // 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\n // `SourceBuffer.abort()` and adjusting `SourceBuffer.timestampOffset` if `SourceBuffer.updating` is false or awaiting `updateend`\n // event if SB is in updating state.\n // More info here: https://github.com/video-dev/hls.js/issues/332#issuecomment-257986486\n\n if (type === 'audio' && audioTrack && audioTrack.container === 'audio/mpeg') { // Chrome audio mp3 track\n let audioBuffer = this.sourceBuffer.audio;\n let delta = Math.abs(audioBuffer.timestampOffset - data.start);\n\n // adjust timestamp offset if time delta is greater than 100ms\n if (delta > 0.1) {\n let updating = audioBuffer.updating;\n\n try {\n audioBuffer.abort();\n } catch (err) {\n updating = true;\n logger.warn('can not abort audio buffer: ' + err);\n }\n\n if (!updating) {\n logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + data.start);\n audioBuffer.timestampOffset = data.start;\n } else {\n this.audioTimestampOffset = data.start;\n }\n }\n }\n }\n\n onManifestParsed(data) {\n let 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.log(`${sourceBufferNb} sourceBuffer(s) expected`);\n }\n this.sourceBufferNb = sourceBufferNb;\n }\n\n onMediaAttaching(data) {\n let 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 onMediaDetaching() {\n 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.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 URL.revokeObjectURL(this.media.src);\n this.media.removeAttribute('src');\n this.media.load();\n }\n\n this.mediaSource = null;\n this.media = null;\n this.pendingTracks = {};\n this.tracks = {};\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(Event.MEDIA_DETACHED);\n }\n\n onMediaSourceOpen() {\n logger.log('media source opened');\n this.hls.trigger(Event.MEDIA_ATTACHED, { media : this.media });\n let 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 checkPendingTracks() {\n // if any buffer codecs pending, check if we have enough to create sourceBuffers\n let 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 && (\n this.sourceBufferNb <= pendingTracksNb ||\n 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 onMediaSourceClose() {\n logger.log('media source closed');\n }\n\n onMediaSourceEnded() {\n logger.log('media source ended');\n }\n\n\n onSBUpdateEnd() {\n // update timestampOffset\n if (this.audioTimestampOffset) {\n let audioBuffer = this.sourceBuffer.audio;\n logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + this.audioTimestampOffset);\n audioBuffer.timestampOffset = this.audioTimestampOffset;\n delete this.audioTimestampOffset;\n }\n\n if (this._needsFlush) {\n this.doFlush();\n }\n\n if (this._needsEos) {\n this.checkEos();\n }\n this.appending = false;\n let parent = this.parent;\n // count nb of pending segments waiting for appending on this sourcebuffer\n let pending = this.segments.reduce( (counter, segment) => (segment.parent === parent) ? counter + 1 : counter , 0);\n this.hls.trigger(Event.BUFFER_APPENDED, { parent : parent, pending : pending });\n\n // don't append in flushing mode\n if (!this._needsFlush) {\n this.doAppending();\n }\n\n this.updateMediaElementDuration();\n }\n\n onSBUpdateError(event) {\n 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 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 }\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n\n 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) { this.pendingTracks[trackName] = tracks[trackName]; }\n let 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\n createSourceBuffers(tracks) {\n var sourceBuffer = this.sourceBuffer,mediaSource = this.mediaSource;\n\n for (let trackName in tracks) {\n if(!sourceBuffer[trackName]) {\n let track = tracks[trackName];\n // use levelCodec as first priority\n let codec = track.levelCodec || track.codec;\n let mimeType = `${track.container};codecs=${codec}`;\n logger.log(`creating sourceBuffer(${mimeType})`);\n try {\n let sb = sourceBuffer[trackName] = mediaSource.addSourceBuffer(mimeType);\n sb.addEventListener('updateend', this.onsbue);\n sb.addEventListener('error', this.onsbe);\n this.tracks[trackName] = {codec: codec, container: track.container};\n track.buffer = sb;\n } catch(err) {\n logger.error(`error while trying to add sourceBuffer:${err.message}`);\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_ADD_CODEC_ERROR, fatal: false, err: err, mimeType : mimeType});\n }\n }\n }\n this.hls.trigger(Event.BUFFER_CREATED, { tracks : tracks } );\n }\n\n 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 onBufferAppendFail(data) {\n 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false});\n }\n\n // on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()\n onBufferEos(data) {\n var sb = this.sourceBuffer;\n let dataType = data.type;\n for(let type in sb) {\n if (!dataType || type === dataType) {\n if (!sb[type].ended) {\n sb[type].ended = true;\n 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 checkEos() {\n var sb = this.sourceBuffer, mediaSource = this.mediaSource;\n if (!mediaSource || mediaSource.readyState !== 'open') {\n this._needsEos = false;\n return;\n }\n for(let type in sb) {\n let sbobj = sb[type];\n if (!sbobj.ended) {\n return;\n }\n if(sbobj.updating) {\n this._needsEos = true;\n return;\n }\n }\n 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 try {\n mediaSource.endOfStream();\n } catch(e) {\n logger.warn('exception while calling mediaSource.endOfStream()');\n }\n this._needsEos = false;\n }\n\n\n 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 onLevelUpdated(event) {\n let 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/video-dev/hls.js/issues/355\n updateMediaElementDuration() {\n let media = this.media,\n mediaSource = this.mediaSource,\n sourceBuffer = this.sourceBuffer,\n levelDuration = this._levelDuration;\n if (levelDuration === null || !media || !mediaSource || !sourceBuffer || media.readyState === 0 || mediaSource.readyState !== 'open') {\n return;\n }\n for (let 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 let duration = media.duration;\n // 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\n if ((levelDuration > this._msDuration && levelDuration > duration) || (duration === Infinity || isNaN(duration) )) {\n logger.log(`Updating mediasource duration to ${levelDuration.toFixed(3)}`);\n this._msDuration = mediaSource.duration = levelDuration;\n }\n }\n\n 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 try {\n for (var type in sourceBuffer) {\n appended += sourceBuffer[type].buffered.length;\n }\n } catch(error) {\n // error could be thrown while accessing buffered, in case sourcebuffer has already been removed from MediaSource\n // this is harmess at this stage, catch this to avoid reporting an internal exception\n logger.error('error while accessing sourceBuffer.buffered');\n }\n this.appended = appended;\n this.hls.trigger(Event.BUFFER_FLUSHED);\n }\n }\n\n doAppending() {\n var hls = this.hls, sourceBuffer = this.sourceBuffer, segments = this.segments;\n if (Object.keys(sourceBuffer).length) {\n if (this.media.error) {\n this.segments = [];\n 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 let segment = segments.shift();\n try {\n let type = segment.type, sb = sourceBuffer[type];\n if(sb) {\n if(!sb.updating) {\n // reset sourceBuffer ended flag before appending segment\n sb.ended = false;\n //logger.log(`appending ${segment.content} ${type} SB, size:${segment.data.length}, ${segment.parent}`);\n this.parent = segment.parent;\n sb.appendBuffer(segment.data);\n this.appendError = 0;\n this.appended++;\n this.appending = true;\n } else {\n segments.unshift(segment);\n }\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.error(`error while trying to append buffer:${err.message}`);\n segments.unshift(segment);\n var event = {type: ErrorTypes.MEDIA_ERROR, parent : segment.parent};\n if(err.code !== 22) {\n if (this.appendError) {\n this.appendError++;\n } else {\n this.appendError = 1;\n }\n event.details = ErrorDetails.BUFFER_APPEND_ERROR;\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.log(`fail ${hls.config.appendErrorMaxRetry} times to append segment in sourceBuffer`);\n segments = [];\n event.fatal = true;\n hls.trigger(Event.ERROR, event);\n return;\n } else {\n event.fatal = false;\n hls.trigger(Event.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 = ErrorDetails.BUFFER_FULL_ERROR;\n event.fatal = false;\n hls.trigger(Event.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 flushBuffer(startOffset, endOffset, typeIn) {\n var sb, i, bufStart, bufEnd, flushStart, flushEnd, sourceBuffer = this.sourceBuffer;\n if (Object.keys(sourceBuffer).length) {\n logger.log(`flushBuffer,pos/start/end: ${this.media.currentTime.toFixed(3)}/${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 try {\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.log(`flush ${type} [${flushStart},${flushEnd}], of [${bufStart},${bufEnd}], pos:${this.media.currentTime}`);\n sb.remove(flushStart, flushEnd);\n return false;\n }\n }\n } catch(e) {\n logger.warn('exception while accessing sourcebuffer, it might have been removed from MediaSource');\n }\n } else {\n //logger.log('abort ' + type + ' append in progress');\n // this will abort any appending in progress\n //sb.abort();\n logger.warn('cannot flush, sb updating in progress');\n return false;\n }\n }\n } else {\n logger.warn('abort flushing too many retries');\n }\n logger.log('buffer flushed');\n }\n // everything flushed !\n return true;\n }\n}\n\nexport default BufferController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/buffer-controller.js","/*\n * cap stream level to media size dimension controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\n\nclass CapLevelController extends EventHandler {\n\tconstructor(hls) {\n super(hls,\n Event.FPS_DROP_LEVEL_CAPPING,\n Event.MEDIA_ATTACHING,\n Event.MANIFEST_PARSED);\n\t}\n\n\tdestroy() {\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 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\tonMediaAttaching(data) {\n this.media = data.media instanceof HTMLVideoElement ? data.media : null;\n }\n\n onManifestParsed(data) {\n const hls = this.hls;\n if (hls.config.capLevelToPlayerSize) {\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n this.levels = data.levels;\n 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 detectPlayerSize() {\n if (this.media) {\n let levelsLength = this.levels ? this.levels.length : 0;\n if (levelsLength) {\n const hls = this.hls;\n hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);\n if (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 hls.streamController.nextLevelSwitch();\n }\n this.autoLevelCapping = 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 getMaxLevel(capLevelIndex) {\n let result = 0,\n i,\n level,\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 isLevelRestricted(level) {\n return (this.restrictedLevels && this.restrictedLevels.indexOf(level) !== -1) ? true : false;\n }\n\n get contentScaleFactor() {\n let pixelRatio = 1;\n try {\n pixelRatio = window.devicePixelRatio;\n } catch(e) {}\n return pixelRatio;\n }\n\n get mediaWidth() {\n let width;\n const media = this.media;\n if (media) {\n width = media.width || media.clientWidth || media.offsetWidth;\n width *= this.contentScaleFactor;\n }\n return width;\n }\n\n get mediaHeight() {\n let height;\n const media = this.media;\n if (media) {\n height = media.height || media.clientHeight || media.offsetHeight;\n height *= this.contentScaleFactor;\n }\n return height;\n }\n}\n\nexport default CapLevelController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/cap-level-controller.js","/*\n * FPS Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nclass FPSController extends EventHandler{\n\n constructor(hls) {\n super(hls, Event.MEDIA_ATTACHING);\n }\n\n destroy() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.isVideoPlaybackQualityAvailable = false;\n }\n\n onMediaAttaching(data) {\n const config = this.hls.config;\n if (config.capLevelOnFPSDrop) {\n const video = this.video = data.media instanceof HTMLVideoElement ? data.media : null;\n if (typeof video.getVideoPlaybackQuality === 'function') {\n this.isVideoPlaybackQualityAvailable = true;\n }\n clearInterval(this.timer);\n this.timer = setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod);\n }\n }\n\n checkFPS(video, decodedFrames, droppedFrames) {\n let currentTime = performance.now();\n if (decodedFrames) {\n if (this.lastTime) {\n let currentPeriod = currentTime - this.lastTime,\n currentDropped = droppedFrames - this.lastDroppedFrames,\n currentDecoded = decodedFrames - this.lastDecodedFrames,\n droppedFPS = 1000 * currentDropped / currentPeriod,\n hls = this.hls;\n hls.trigger(Event.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 > hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {\n let currentLevel = hls.currentLevel;\n logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);\n if (currentLevel > 0 && (hls.autoLevelCapping === -1 || hls.autoLevelCapping >= currentLevel)) {\n currentLevel = currentLevel - 1;\n hls.trigger(Event.FPS_DROP_LEVEL_CAPPING, {level: currentLevel, droppedLevel: hls.currentLevel});\n hls.autoLevelCapping = currentLevel;\n hls.streamController.nextLevelSwitch();\n }\n }\n }\n }\n this.lastTime = currentTime;\n this.lastDroppedFrames = droppedFrames;\n this.lastDecodedFrames = decodedFrames;\n }\n }\n\n checkFPSInterval() {\n const video = this.video;\n if (video) {\n if (this.isVideoPlaybackQualityAvailable) {\n let videoPlaybackQuality = video.getVideoPlaybackQuality();\n this.checkFPS(video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);\n } else {\n this.checkFPS(video, video.webkitDecodedFrameCount, video.webkitDroppedFrameCount);\n }\n }\n }\n}\n\nexport default FPSController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/fps-controller.js","/*\n * id3 metadata track controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\n\nclass ID3TrackController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.FRAG_PARSING_METADATA);\n this.id3Track = undefined;\n this.media = undefined;\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n // Add ID3 metatadata text track.\n onMediaAttached(data) {\n this.media = data.media;\n if (!this.media) {\n return;\n }\n\n this.id3Track = this.media.addTextTrack('metadata', 'id3');\n this.id3Track.mode = 'hidden';\n }\n\n onMediaDetaching() {\n this.media = undefined;\n }\n\n onFragParsingMetadata(data) {\n const fragment = data.frag;\n const samples = data.samples;\n const startTime = fragment.start;\n let endTime = fragment.start + fragment.duration;\n // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE\n if (startTime === endTime) {\n endTime += 0.0001;\n }\n\n // Attempt to recreate Safari functionality by creating\n // WebKitDataCue objects when available and store the decoded\n // ID3 data in the value property of the cue\n let Cue = window.WebKitDataCue || window.VTTCue || window.TextTrackCue;\n\n for (let i = 0; i < samples.length; i++) {\n let id3Frame = this.parseID3Frame(samples[i].data);\n let frame = this.decodeID3Frame(id3Frame);\n if (frame) {\n let cue = new Cue(startTime, endTime, '');\n cue.value = frame;\n this.id3Track.addCue(cue);\n }\n }\n }\n\n parseID3Frame(data) {\n if (data.length < 21) {\n return undefined;\n }\n\n /* http://id3.org/id3v2.3.0\n [0] = 'I'\n [1] = 'D'\n [2] = '3'\n [3,4] = {Version}\n [5] = {Flags}\n [6-9] = {ID3 Size}\n [10-13] = {Frame ID}\n [14-17] = {Frame Size}\n [18,19] = {Frame Flags}\n */\n if (data[0] === 73 && // I\n data[1] === 68 && // D\n data[2] === 51) { // 3\n\n let type = String.fromCharCode(data[10], data[11], data[12], data[13]);\n data = data.subarray(20);\n return { type, data };\n }\n }\n\n decodeID3Frame(frame) {\n if (frame.type === 'TXXX') {\n return this.decodeTxxxFrame(frame);\n } else if (frame.type === 'PRIV') {\n return this.decodePrivFrame(frame);\n } else if (frame.type[0] === 'T') {\n return this.decodeTextFrame(frame);\n } else {\n return undefined;\n }\n }\n\n decodeTxxxFrame(frame) {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Description}\\0{Value}\n */\n\n if (frame.size < 2) {\n return undefined;\n }\n\n if (frame.data[0] !== 3) {\n //only support UTF-8\n return undefined;\n }\n\n let index = 1;\n let description = this.utf8ArrayToStr(frame.data.subarray(index));\n\n index += description.length + 1;\n let value = this.utf8ArrayToStr(frame.data.subarray(index));\n\n return { key: 'TXXX', description, data: value };\n }\n\n decodeTextFrame(frame) {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Value}\n */\n\n if (frame.size < 2) {\n return undefined;\n }\n\n if (frame.data[0] !== 3) {\n //only support UTF-8\n return undefined;\n }\n\n let data = frame.data.subarray(1);\n return { key: frame.type, data: this.utf8ArrayToStr(data) };\n }\n\n decodePrivFrame(frame) {\n /*\n Format: <text string>\\0<binary data>\n */\n\n if (frame.size < 2) {\n return undefined;\n }\n\n let owner = this.utf8ArrayToStr(frame.data);\n let privateData = frame.data.subarray(owner.length + 1);\n\n return { key: 'PRIV', info: owner, data: privateData.buffer };\n }\n\n // http://stackoverflow.com/questions/8936984/uint8array-to-string-in-javascript/22373197\n // http://www.onicos.com/staff/iz/amuse/javascript/expert/utf.txt\n /* utf.js - UTF-8 <=> UTF-16 convertion\n *\n * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>\n * Version: 1.0\n * LastModified: Dec 25 1999\n * This library is free. You can redistribute it and/or modify it.\n */\n utf8ArrayToStr(array) {\n\n let char2;\n let char3;\n let out = '';\n let i = 0;\n let length = array.length;\n\n while (i < length) {\n let c = array[i++];\n switch (c >> 4) {\n case 0:\n return out;\n case 1: case 2: case 3: case 4: case 5: case 6: case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12: case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode(((c & 0x0F) << 12) |\n ((char2 & 0x3F) << 6) |\n ((char3 & 0x3F) << 0));\n break;\n }\n }\n\n return out;\n }\n}\n\nexport default ID3TrackController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/id3-track-controller.js","/*\n * Level Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport BufferHelper from '../helper/buffer-helper';\n\nclass LevelController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MANIFEST_LOADED,\n Event.LEVEL_LOADED,\n Event.FRAG_LOADED,\n Event.ERROR);\n this.ontick = this.tick.bind(this);\n this._manualLevel = -1;\n }\n\n destroy() {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n this._manualLevel = -1;\n }\n\n startLoad() {\n this.canload = true;\n let levels = this._levels;\n // clean up live level details to force reload them, and reset load errors\n if(levels) {\n levels.forEach(level => {\n level.loadError = 0;\n const levelDetails = level.details;\n if (levelDetails && levelDetails.live) {\n level.details = undefined;\n }\n });\n }\n // speed up live playlist refresh if timer exists\n if (this.timer) {\n this.tick();\n }\n }\n\n stopLoad() {\n this.canload = false;\n }\n\n onManifestLoaded(data) {\n var levels0 = [],\n levels = [],\n bitrateStart,\n bitrateSet = {},\n videoCodecFound = false,\n audioCodecFound = false,\n hls = this.hls,\n brokenmp4inmp3 = /chrome|firefox/.test(navigator.userAgent.toLowerCase()),\n checkSupported = function(type,codec) { return MediaSource.isTypeSupported(`${type}/mp4;codecs=${codec}`);};\n\n // regroup redundant level together\n data.levels.forEach(level => {\n if(level.videoCodec) {\n videoCodecFound = true;\n }\n // erase audio codec info if browser does not support mp4a.40.34. demuxer will autodetect codec and fallback to mpeg/audio\n if(brokenmp4inmp3 && level.audioCodec && level.audioCodec.indexOf('mp4a.40.34') !== -1) {\n level.audioCodec = undefined;\n }\n if(level.audioCodec || (level.attrs && level.attrs.AUDIO)) {\n audioCodecFound = true;\n }\n let 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(level => {\n if(level.videoCodec) {\n levels.push(level);\n }\n });\n } else {\n levels = levels0;\n }\n // only keep level with supported audio/video codecs\n levels = levels.filter(function(level) {\n let audioCodec = level.audioCodec, videoCodec = level.videoCodec;\n return (!audioCodec || checkSupported('audio',audioCodec)) &&\n (!videoCodec || checkSupported('video',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 (let i = 0; i < levels.length; i++) {\n if (levels[i].bitrate === bitrateStart) {\n this._firstLevel = i;\n logger.log(`manifest loaded,${levels.length} level(s) found, first bitrate:${bitrateStart}`);\n break;\n }\n }\n hls.trigger(Event.MANIFEST_PARSED, {levels: levels, firstLevel: this._firstLevel, stats: data.stats, audio : audioCodecFound, video : videoCodecFound, altAudio : data.audioTracks.length > 0});\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 get levels() {\n return this._levels;\n }\n\n get level() {\n return this._level;\n }\n\n set level(newLevel) {\n let 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 setLevelInternal(newLevel) {\n const levels = this._levels;\n const hls = this.hls;\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.log(`switching to level ${newLevel}`);\n this._level = newLevel;\n var levelProperties = levels[newLevel];\n levelProperties.level = newLevel;\n // LEVEL_SWITCH to be deprecated in next major release\n hls.trigger(Event.LEVEL_SWITCH, levelProperties);\n hls.trigger(Event.LEVEL_SWITCHING, levelProperties);\n }\n var level = levels[newLevel], 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 hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: newLevel, id: urlId});\n }\n } else {\n // invalid level id given, trigger error\n hls.trigger(Event.ERROR, {type : ErrorTypes.OTHER_ERROR, details: ErrorDetails.LEVEL_SWITCH_ERROR, level: newLevel, fatal: false, reason: 'invalid level idx'});\n }\n }\n\n get manualLevel() {\n return this._manualLevel;\n }\n\n set manualLevel(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 get firstLevel() {\n return this._firstLevel;\n }\n\n set firstLevel(newLevel) {\n this._firstLevel = newLevel;\n }\n\n get startLevel() {\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 let 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\n set startLevel(newLevel) {\n this._startLevel = newLevel;\n }\n\n onError(data) {\n if(data.fatal) {\n return;\n }\n\n let details = data.details, hls = this.hls, levelId, level, levelError = false;\n // try to recover not fatal errors\n switch(details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n case ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case ErrorDetails.KEY_LOAD_ERROR:\n case ErrorDetails.KEY_LOAD_TIMEOUT:\n levelId = data.frag.level;\n break;\n case ErrorDetails.LEVEL_LOAD_ERROR:\n case ErrorDetails.LEVEL_LOAD_TIMEOUT:\n levelId = data.context.level;\n levelError = true;\n break;\n case ErrorDetails.REMUX_ALLOC_ERROR:\n levelId = data.level;\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.loadError) {\n level.loadError = 1;\n } else {\n level.loadError++;\n }\n // if any redundant streams available and if we haven't try them all (level.loadError is reseted on successful frag/level load.\n // if level.loadError reaches nbRedundantLevel it means that we tried them all, no hope => let's switch down\n const nbRedundantLevel = level.url.length;\n if (nbRedundantLevel > 1 && level.loadError < nbRedundantLevel) {\n level.urlId = (level.urlId + 1) % nbRedundantLevel;\n level.details = undefined;\n 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 let recoverable = ((this._manualLevel === -1) && levelId);\n if (recoverable) {\n logger.warn(`level controller,${details}: switch-down for next fragment`);\n hls.nextAutoLevel = Math.max(0,levelId-1);\n } else if(level && level.details && level.details.live) {\n 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 === ErrorDetails.LEVEL_LOAD_ERROR ||\n details === ErrorDetails.LEVEL_LOAD_TIMEOUT) {\n let media = hls.media,\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && BufferHelper.isBuffered(media,media.currentTime) && BufferHelper.isBuffered(media,media.currentTime+0.5);\n if (mediaBuffered) {\n let retryDelay = hls.config.levelLoadingRetryDelay;\n logger.warn(`level controller,${details}, but media buffered, retry in ${retryDelay}ms`);\n this.timer = setTimeout(this.ontick,retryDelay);\n // boolean used to inform stream controller not to switch back to IDLE on non fatal error\n data.levelRetry = true;\n } else {\n 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 // switch error to fatal\n data.fatal = true;\n }\n }\n }\n }\n }\n\n // reset level load error counter on successful frag loaded\n onFragLoaded(data) {\n const fragLoaded = data.frag;\n if (fragLoaded && fragLoaded.type === 'main') {\n const level = this._levels[fragLoaded.level];\n if (level) {\n level.loadError = 0;\n }\n }\n }\n\n onLevelLoaded(data) {\n const levelId = data.level;\n // only process level loaded events matching with expected level\n if (levelId === this._level) {\n let curLevel = this._levels[levelId];\n // reset level load error counter on successful level loaded\n curLevel.loadError = 0;\n let newDetails = data.details;\n // if current playlist is a live playlist, arm a timer to reload it\n if (newDetails.live) {\n let reloadInterval = 1000*( newDetails.averagetargetduration ? newDetails.averagetargetduration : newDetails.targetduration),\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.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.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 tick() {\n var levelId = this._level;\n if (levelId !== undefined && this.canload) {\n var level = this._levels[levelId];\n if (level && level.url) {\n var urlId = level.urlId;\n this.hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: levelId, id: urlId});\n }\n }\n }\n\n get nextLoadLevel() {\n if (this._manualLevel !== -1) {\n return this._manualLevel;\n } else {\n return this.hls.nextAutoLevel;\n }\n }\n\n set nextLoadLevel(nextLevel) {\n this.level = nextLevel;\n if (this._manualLevel === -1) {\n this.hls.nextAutoLevel = nextLevel;\n }\n }\n}\n\nexport default LevelController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/level-controller.js","/*\n * Stream Controller\n*/\n\nimport BinarySearch from '../utils/binary-search';\nimport BufferHelper from '../helper/buffer-helper';\nimport Demuxer from '../demux/demuxer';\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport LevelHelper from '../helper/level-helper';\nimport TimeRanges from '../utils/timeRanges';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nconst State = {\n STOPPED : 'STOPPED',\n IDLE : 'IDLE',\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 BUFFER_FLUSHING : 'BUFFER_FLUSHING',\n ENDED : 'ENDED',\n ERROR : 'ERROR'\n};\n\nclass StreamController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.MANIFEST_LOADING,\n Event.MANIFEST_PARSED,\n Event.LEVEL_LOADED,\n Event.KEY_LOADED,\n Event.FRAG_LOADED,\n Event.FRAG_LOAD_EMERGENCY_ABORTED,\n Event.FRAG_PARSING_INIT_SEGMENT,\n Event.FRAG_PARSING_DATA,\n Event.FRAG_PARSED,\n Event.ERROR,\n Event.AUDIO_TRACK_SWITCHING,\n Event.AUDIO_TRACK_SWITCHED,\n Event.BUFFER_CREATED,\n Event.BUFFER_APPENDED,\n Event.BUFFER_FLUSHED);\n\n this.config = hls.config;\n this.audioCodecSwap = false;\n this.ticks = 0;\n this._state = State.STOPPED;\n this.ontick = this.tick.bind(this);\n }\n\n destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n EventHandler.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n\n startLoad(startPosition) {\n if (this.levels) {\n let lastCurrentTime = this.lastCurrentTime, 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 (!this.startFragRequested) {\n // determine load level\n let 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 // if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime\n if (lastCurrentTime > 0 && startPosition === -1) {\n logger.log(`override startPosition with lastCurrentTime @${lastCurrentTime.toFixed(3)}`);\n startPosition = lastCurrentTime;\n }\n this.state = State.IDLE;\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime = startPosition;\n this.tick();\n } else {\n this.forceStartLoad = true;\n this.state = State.STOPPED;\n }\n }\n\n 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 this.forceStartLoad = false;\n }\n\n 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 doTick() {\n switch(this.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n break;\n case State.BUFFER_FLUSHING:\n // in buffer flushing state, reset fragLoadError counter\n this.fragLoadError = 0;\n break;\n case State.IDLE:\n this._doTickIdle();\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.log(`mediaController: retryDate reached, switch back to IDLE state`);\n this.state = State.IDLE;\n }\n break;\n case State.ERROR:\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 _doTickIdle() {\n const 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 start level loaded and media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (this.levelLastLoaded !== undefined && !media &&\n (this.startFragRequested || !config.startFragPrefetch)) {\n return;\n }\n\n // if we have not yet loaded any fragment, start loading from start position\n let pos;\n if (this.loadedmetadata) {\n pos = media.currentTime;\n } else {\n pos = this.nextLoadPosition;\n }\n // determine next load level\n let level = hls.nextLoadLevel,\n levelInfo = this.levels[level];\n\n if (!levelInfo) {\n return;\n }\n\n let levelBitrate = levelInfo.bitrate,\n maxBufLen;\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 if (levelBitrate) {\n maxBufLen = Math.max(8 * config.maxBufferSize / levelBitrate, 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 const bufferInfo = BufferHelper.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;\n }\n\n // if buffer length is less than maxBufLen try to load a new fragment ...\n 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 this.level = hls.nextLoadLevel = level;\n\n const levelDetails = levelInfo.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;\n }\n\n // we just got done loading the final fragment, check if we need to finalize media stream\n let fragPrevious = this.fragPrevious;\n if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN) {\n // fragPrevious is last fragment. retrieve level duration using last frag start offset + duration\n // real duration might be lower than initial duration if there are drifts between real frag duration and playlist signaling\n const duration = Math.min(media.duration,fragPrevious.start + fragPrevious.duration);\n // if 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 (audio/video offsets...)\n // tolerate up to one frag duration to cope with these cases.\n // 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\n if (duration - Math.max(bufferInfo.end,fragPrevious.start) <= Math.max(0.2,fragPrevious.duration)) {\n // Finalize the media stream\n let data = {};\n if (this.altAudio) {\n data.type = 'video';\n }\n this.hls.trigger(Event.BUFFER_EOS,data);\n this.state = State.ENDED;\n return;\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 this._fetchPayloadOrEos(pos, bufferInfo, levelDetails);\n }\n\n _fetchPayloadOrEos(pos, bufferInfo, levelDetails) {\n const 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;\n }\n\n // find fragment index, contiguous with end of buffer position\n let start = fragments[0].start,\n end = fragments[fragLen-1].start + fragments[fragLen-1].duration,\n bufferEnd = bufferInfo.end,\n frag;\n\n if (levelDetails.initSegment && !levelDetails.initSegment.data) {\n frag = levelDetails.initSegment;\n } else {\n // in case of live playlist we need to ensure that requested position is not located before playlist start\n if (levelDetails.live) {\n let initialLiveManifestSize = this.config.initialLiveManifestSize;\n if(fragLen < initialLiveManifestSize){\n logger.warn(`Can not start playback of a level, reason: not enough fragments ${fragLen} < ${initialLiveManifestSize}`);\n return;\n }\n\n frag = this._ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen);\n // if it explicitely returns null don't load any fragment and exit function now\n if (frag === null) {\n return;\n }\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 }\n if (!frag) {\n frag = this._findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails);\n }\n if(frag) {\n this._loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd);\n }\n return;\n }\n\n _ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen) {\n const config = this.hls.config, media = this.media;\n\n let frag;\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 let maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount*levelDetails.targetduration;\n\n if (bufferEnd < Math.max(start-config.maxFragLookUpTolerance, end - maxLatency)) {\n let liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);\n 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.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.log(`live playlist, switching playlist, unknown, load middle frag : ${frag.sn}`);\n }\n }\n return frag;\n }\n\n _findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails) {\n const config = this.hls.config;\n let frag;\n let foundFrag;\n let maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n const fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;\n let fragmentWithinToleranceTest = (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 // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments\n let candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);\n if (candidate.start + candidate.duration - candidateLookupTolerance <= bufferEnd) {\n return 1;\n } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n };\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n // Prefer the next fragment if it's within tolerance\n if (fragNext && !fragmentWithinToleranceTest(fragNext)) {\n foundFrag = fragNext;\n } else {\n foundFrag = BinarySearch.search(fragments, fragmentWithinToleranceTest);\n }\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen-1];\n }\n if (foundFrag) {\n frag = foundFrag;\n const curSNIdx = frag.sn - levelDetails.startSN;\n const sameLevel = fragPrevious && frag.level === fragPrevious.level;\n const prevFrag = fragments[curSNIdx - 1];\n const nextFrag = fragments[curSNIdx + 1];\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.sn === fragPrevious.sn) {\n if (sameLevel && !frag.backtracked) {\n if (frag.sn < levelDetails.endSN) {\n let deltaPTS = fragPrevious.deltaPTS;\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 = prevFrag;\n 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 = nextFrag;\n logger.log(`SN just loaded, load next one: ${frag.sn}`);\n }\n } else {\n frag = null;\n }\n } else if (frag.backtracked) {\n // Only backtrack a max of 1 consecutive fragment to prevent sliding back too far when little or no frags start with keyframes\n if (nextFrag && nextFrag.backtracked) {\n logger.warn(`Already backtracked from fragment ${nextFrag.sn}, will not backtrack to fragment ${frag.sn}. Loading fragment ${nextFrag.sn}`);\n frag = nextFrag;\n } else {\n // If a fragment has dropped frames and it's in a same level/sequence, load the previous fragment to try and find the keyframe\n // 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\n logger.warn('Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe');\n frag.dropped = 0;\n if (prevFrag) {\n if (prevFrag.loadCounter) {\n prevFrag.loadCounter--;\n }\n frag = prevFrag;\n frag.backtracked = true;\n } else {\n frag = null;\n }\n }\n }\n }\n }\n return frag;\n }\n\n _loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd) {\n const 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 && frag.decryptdata.uri != null) && (frag.decryptdata.key == null)) {\n logger.log(`Loading key for ${frag.sn} of [${levelDetails.startSN} ,${levelDetails.endSN}],level ${level}`);\n this.state = State.KEY_LOADING;\n hls.trigger(Event.KEY_LOADING, {frag: frag});\n } else {\n 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 let 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 if (!isNaN(frag.sn)) {\n this.nextLoadPosition = frag.start + frag.duration;\n }\n frag.autoLevel = hls.autoLevelEnabled;\n frag.bitrateTest = this.bitrateTest;\n hls.trigger(Event.FRAG_LOADING, {frag: frag});\n // lazy demuxer init, as this could take some time ... do it during frag loading\n if (!this.demuxer) {\n this.demuxer = new Demuxer(hls,'main');\n }\n this.state = State.FRAG_LOADING;\n return;\n }\n }\n\n set state(nextState) {\n if (this.state !== nextState) {\n const previousState = this.state;\n this._state = nextState;\n logger.log(`main stream:${previousState}->${nextState}`);\n this.hls.trigger(Event.STREAM_STATE_TRANSITION, {previousState, nextState});\n }\n }\n\n get state() {\n return this._state;\n }\n\n getBufferedFrag(position) {\n return BinarySearch.search(this._bufferedFrags, function(frag) {\n if (position < frag.startPTS) {\n return -1;\n } else if (position > frag.endPTS) {\n return 1;\n }\n return 0;\n });\n }\n\n get currentLevel() {\n let media = this.media;\n if (media) {\n const frag = this.getBufferedFrag(media.currentTime);\n if (frag) {\n return frag.level;\n }\n }\n return -1;\n }\n\n get nextBufferedFrag() {\n let media = this.media;\n if (media) {\n // first get end range of current fragment\n return this.followingBufferedFrag(this.getBufferedFrag(media.currentTime));\n } else {\n return null;\n }\n }\n\n followingBufferedFrag(frag) {\n if (frag) {\n // try to get range of next fragment (500ms after this range)\n return this.getBufferedFrag(frag.endPTS + 0.5);\n }\n return null;\n }\n\n get nextLevel() {\n const frag = this.nextBufferedFrag;\n if (frag) {\n return frag.level;\n } else {\n return -1;\n }\n }\n\n _checkFragmentChanged() {\n var fragPlayingCurrent, currentTime, 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 (BufferHelper.isBuffered(video,currentTime)) {\n fragPlayingCurrent = this.getBufferedFrag(currentTime);\n } else if (BufferHelper.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 fragPlayingCurrent = this.getBufferedFrag(currentTime + 0.1);\n }\n if (fragPlayingCurrent) {\n var fragPlaying = fragPlayingCurrent;\n if (fragPlaying !== this.fragPlaying) {\n this.hls.trigger(Event.FRAG_CHANGED, {frag: fragPlaying});\n const fragPlayingLevel = fragPlaying.level;\n if (!this.fragPlaying || this.fragPlaying.level !== fragPlayingLevel) {\n this.hls.trigger(Event.LEVEL_SWITCHED, {level: fragPlayingLevel});\n }\n this.fragPlaying = 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 immediateLevelSwitch() {\n logger.log('immediateLevelSwitch');\n if (!this.immediateSwitch) {\n this.immediateSwitch = true;\n let media = this.media, previouslyPaused;\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 // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // flush everything\n this.flushMainBuffer(0,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 immediateLevelSwitchEnd() {\n let media = this.media;\n if (media && media.buffered.length) {\n this.immediateSwitch = false;\n if(BufferHelper.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 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 let media = this.media;\n // ensure that media is defined and that metadata are available (to retrieve currentTime)\n if (media && media.readyState) {\n let fetchdelay, fragPlayingCurrent, nextBufferedFrag;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n fragPlayingCurrent = this.getBufferedFrag(media.currentTime);\n if (fragPlayingCurrent && fragPlayingCurrent.startPTS > 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.flushMainBuffer(0,fragPlayingCurrent.startPTS - 1);\n }\n if (!media.paused) {\n // add a safety delay of 1s\n var nextLevelId = this.hls.nextLoadLevel,nextLevel = this.levels[nextLevelId], 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 nextBufferedFrag = this.getBufferedFrag(media.currentTime + fetchdelay);\n if (nextBufferedFrag) {\n // we can flush buffer range following this one without stalling playback\n nextBufferedFrag = this.followingBufferedFrag(nextBufferedFrag);\n if (nextBufferedFrag) {\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.flushMainBuffer(nextBufferedFrag.startPTS , Number.POSITIVE_INFINITY);\n }\n }\n }\n }\n\n flushMainBuffer(startOffset,endOffset) {\n this.state = State.BUFFER_FLUSHING;\n let flushScope = {startOffset: startOffset, endOffset: endOffset};\n // if alternate audio tracks are used, only flush video, otherwise flush everything\n if (this.altAudio) {\n flushScope.type = 'video';\n }\n this.hls.trigger(Event.BUFFER_FLUSHING, flushScope);\n }\n\n 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 let config = this.config;\n if(this.levels && config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n\n onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n 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(level => {\n if(level.details) {\n level.details.fragments.forEach(fragment => {\n fragment.loadCounter = undefined;\n fragment.backtracked = 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 = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n\n onMediaSeeking() {\n let media = this.media, currentTime = media ? media.currentTime : undefined, config = this.config;\n if (!isNaN(currentTime)) {\n logger.log(`media seeking to ${currentTime.toFixed(3)}`);\n }\n let mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media;\n let bufferInfo = BufferHelper.bufferInfo(mediaBuffer,currentTime,this.config.maxBufferHole);\n if (this.state === State.FRAG_LOADING) {\n let 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 let 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.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.log('seeking outside of buffer but within currently loaded fragment range');\n }\n }\n } else if (this.state === State.ENDED) {\n // if seeking to unbuffered area, clean up fragPrevious\n if (bufferInfo.len === 0) {\n this.fragPrevious = 0;\n }\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 // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target\n if(!this.loadedmetadata) {\n this.nextLoadPosition = this.startPosition = currentTime;\n }\n // tick to speed up processing\n this.tick();\n }\n\n onMediaSeeked() {\n const media = this.media, currentTime = media ? media.currentTime : undefined;\n if (!isNaN(currentTime)) {\n logger.log(`media seeked to ${currentTime.toFixed(3)}`);\n }\n // tick to speed up FRAGMENT_PLAYING triggering\n this.tick();\n }\n\n onMediaEnded() {\n logger.log('media ended');\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n\n onManifestLoading() {\n // reset buffer on manifest loading\n logger.log('trigger BUFFER_RESET');\n this.hls.trigger(Event.BUFFER_RESET);\n this._bufferedFrags = [];\n this.stalled = false;\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n onManifestParsed(data) {\n var aac = false, heaac = false, codec;\n data.levels.forEach(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.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 let config = this.config;\n if (config.autoStartLoad || this.forceStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n\n 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.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 LevelHelper.mergeDetails(curDetails,newDetails);\n sliding = newDetails.fragments[0].start;\n this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n logger.log(`live playlist sliding:${sliding.toFixed(3)}`);\n } else {\n logger.log('live playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n 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(Event.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 let startTimeOffset = newDetails.startTimeOffset;\n if(!isNaN(startTimeOffset)) {\n if (startTimeOffset < 0) {\n logger.log(`negative start time offset ${startTimeOffset}, count from end of last fragment`);\n startTimeOffset = sliding + duration + startTimeOffset;\n }\n 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.log(`configure startPosition to ${this.startPosition}`);\n } else {\n this.startPosition = 0;\n }\n }\n this.lastCurrentTime = this.startPosition;\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 onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n\n onFragLoaded(data) {\n var fragCurrent = this.fragCurrent,\n fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING &&\n fragCurrent &&\n fragLoaded.type === 'main' &&\n fragLoaded.level === fragCurrent.level &&\n fragLoaded.sn === fragCurrent.sn) {\n let stats = data.stats,\n currentLevel = this.levels[fragCurrent.level],\n details = currentLevel.details;\n 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 this.stats = stats;\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(Event.FRAG_BUFFERED, {stats: stats, frag: fragCurrent, id : 'main'});\n this.tick();\n } else if (fragLoaded.sn === 'initSegment') {\n this.state = State.IDLE;\n stats.tparsed = stats.tbuffered = performance.now();\n details.initSegment.data = data.payload;\n this.hls.trigger(Event.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 let duration = details.totalduration,\n level = fragCurrent.level,\n sn = fragCurrent.sn,\n audioCodec = this.config.defaultAudioCodec || currentLevel.audioCodec;\n if(this.audioCodecSwap) {\n 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.pendingBuffering = true;\n this.appended = false;\n logger.log(`Parsing ${sn} of [${details.startSN} ,${details.endSN}],level ${level}, cc ${fragCurrent.cc}`);\n let demuxer = this.demuxer;\n if (!demuxer) {\n demuxer = this.demuxer = new Demuxer(this.hls,'main');\n }\n // 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)\n let media = this.media;\n let mediaSeeking = media && media.seeking;\n let accurateTimeOffset = !mediaSeeking && (details.PTSKnown || !details.live);\n let initSegmentData = details.initSegment ? details.initSegment.data : [];\n demuxer.push(data.payload, initSegmentData,audioCodec, currentLevel.videoCodec, fragCurrent, duration, accurateTimeOffset,undefined);\n }\n }\n this.fragLoadError = 0;\n }\n\n onFragParsingInitSegment(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'main' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n var tracks = data.tracks, trackName, 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.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 && track.container !== 'audio/mpeg') { // Exclude mpeg audio\n audioCodec = 'mp4a.40.2';\n 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 this.hls.trigger(Event.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.log(`main track:${trackName},container:${track.container},codecs[level/parsed]=[${track.levelCodec}/${track.codec}]`);\n var initSegment = track.initSegment;\n if (initSegment) {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(Event.BUFFER_APPENDING, {type: trackName, data: initSegment, parent : 'main', content : 'initSegment'});\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsingData(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'main' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n !(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 = fragCurrent;\n if (isNaN(data.endPTS)) {\n data.endPTS = data.startPTS + fragCurrent.duration;\n data.endDTS = data.startDTS + fragCurrent.duration;\n }\n\n 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 // Detect gaps in a fragment and try to fix it by finding a keyframe in the previous fragment (see _findFragments)\n if(data.type === 'video') {\n frag.dropped = data.dropped;\n if (frag.dropped) {\n if (!frag.backtracked) {\n logger.warn('missing video frame(s), backtracking fragment');\n // Return back to the IDLE state without appending to buffer\n // Causes findFragments to backtrack a segment and find the keyframe\n // Audio fragments arriving before video sets the nextLoadPosition, causing _findFragments to skip the backtracked fragment\n frag.backtracked = true;\n this.nextLoadPosition = data.startPTS;\n this.state = State.IDLE;\n this.fragPrevious = frag;\n this.tick();\n return;\n } else {\n logger.warn('Already backtracked on this fragment, appending with the gap');\n }\n } else {\n // Only reset the backtracked flag if we've loaded the frag without any dropped frames\n frag.backtracked = false;\n }\n }\n\n var drift = LevelHelper.updateFragPTSDTS(level.details,frag,data.startPTS,data.endPTS,data.startDTS,data.endDTS),\n hls = this.hls;\n hls.trigger(Event.LEVEL_PTS_UPDATED, {details: level.details, level: this.level, drift: drift, type: data.type, start: data.startPTS, end: data.endPTS});\n\n // has remuxer dropped video frames located before first keyframe ?\n [data.data1, data.data2].forEach(buffer => {\n // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)\n // in that case it is useless to append following segments\n if (buffer && buffer.length && this.state === State.PARSING) {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n hls.trigger(Event.BUFFER_APPENDING, {type: data.type, data: buffer, parent : 'main',content : 'data'});\n }\n });\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsed(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'main' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n\n onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url,\n trackId = data.id;\n // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered\n // don't do anything if we switch to alt audio: audio stream controller is handling it.\n // we will just have to change buffer scheduling on audioTrackSwitched\n if (!altAudio) {\n if (this.mediaBuffer !== this.media) {\n logger.log(`switching on main audio, use media.buffered to schedule main fragment loading`);\n this.mediaBuffer = this.media;\n let 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.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 let hls = this.hls;\n // switching to main audio, flush all audio and trigger track switched\n hls.trigger(Event.BUFFER_FLUSHING, {startOffset: 0 , endOffset: Number.POSITIVE_INFINITY, type : 'audio'});\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : trackId});\n this.altAudio = false;\n }\n }\n\n onAudioTrackSwitched(data) {\n var trackId = data.id,\n altAudio = !!this.hls.audioTracks[trackId].url;\n if (altAudio) {\n let videoBuffer = this.videoBuffer;\n // if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered\n if (videoBuffer && this.mediaBuffer !== videoBuffer) {\n logger.log(`switching on alternate audio, use video.buffered to schedule main fragment loading`);\n this.mediaBuffer = videoBuffer;\n }\n }\n this.altAudio = altAudio;\n this.tick();\n }\n\n\n\n onBufferCreated(data) {\n let tracks = data.tracks, mediaTrack, name, alternate = false;\n for(var type in tracks) {\n let 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.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 onBufferAppended(data) {\n if (data.parent === 'main') {\n const state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = (data.pending > 0);\n this._checkAppendedParsed();\n }\n }\n }\n\n _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n const frag = this.fragCurrent;\n if (frag) {\n const media = this.mediaBuffer ? this.mediaBuffer : this.media;\n logger.log(`main buffered : ${TimeRanges.toString(media.buffered)}`);\n // filter fragments potentially evicted from buffer. this is to avoid memleak on live streams\n let bufferedFrags = this._bufferedFrags.filter(frag => {return BufferHelper.isBuffered(media,(frag.startPTS + frag.endPTS) / 2);});\n // push new range\n bufferedFrags.push(frag);\n // sort frags, as we use BinarySearch for lookup in getBufferedFrag ...\n this._bufferedFrags = bufferedFrags.sort(function(a,b) {return (a.startPTS - b.startPTS);});\n this.fragPrevious = frag;\n const stats = this.stats;\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(Event.FRAG_BUFFERED, {stats: stats, frag: frag, id : 'main'});\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n\n onError(data) {\n let 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 let media = this.media,\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && BufferHelper.isBuffered(media,media.currentTime) && BufferHelper.isBuffered(media,media.currentTime+0.5);\n switch(data.details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n case ErrorDetails.KEY_LOAD_ERROR:\n case ErrorDetails.KEY_LOAD_TIMEOUT:\n if(!data.fatal) {\n var loadError = this.fragLoadError;\n if(loadError) {\n loadError++;\n } else {\n loadError=1;\n }\n let config = this.config;\n // keep retrying / don't raise fatal network error if current position is buffered or if in automode with current level not 0\n if (loadError <= config.fragLoadingMaxRetry || mediaBuffered || (frag.autoLevel && frag.level)) {\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.warn(`mediaController: frag loading failed, retry in ${delay} ms`);\n this.retryDate = performance.now() + delay;\n // retry loading state\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 this.nextLoadPosition = this.startPosition;\n }\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n logger.error(`mediaController: ${data.details} reaches max retry, redispatch as fatal ...`);\n // switch error to fatal\n data.fatal = true;\n this.state = State.ERROR;\n }\n }\n break;\n case 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 // switch error to fatal\n data.fatal = true;\n this.state = State.ERROR;\n }\n }\n }\n break;\n case ErrorDetails.LEVEL_LOAD_ERROR:\n case ErrorDetails.LEVEL_LOAD_TIMEOUT:\n if(this.state !== State.ERROR) {\n if (data.fatal) {\n // if fatal error, stop processing\n this.state = State.ERROR;\n logger.warn(`streamController: ${data.details},switch to ${this.state} state ...`);\n } else {\n // in case of non fatal error while loading level, if level controller is not retrying to load level , switch back to IDLE\n if (!data.levelRetry && this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n }\n }\n break;\n case ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (data.parent === 'main' && (this.state === State.PARSING || this.state === State.PARSED)) {\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n this._reduceMaxBufferLength(this.config.maxBufferLength);\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/video-dev/hls.js/pull/708\n // in that case flush the whole buffer to recover\n logger.warn('buffer full error also media.currentTime is not buffered, flush everything');\n this.fragCurrent = null;\n // flush everything\n this.flushMainBuffer(0,Number.POSITIVE_INFINITY);\n }\n }\n break;\n default:\n break;\n }\n }\n\n _reduceMaxBufferLength(minLength) {\n let 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.warn(`main:reduce max buffer length to ${config.maxMaxBufferLength}s`);\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n }\n\n_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 let currentTime = media.currentTime,\n mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media,\n buffered = mediaBuffer.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 let startPosition = media.seeking ? currentTime : this.startPosition,\n startPositionBuffered = BufferHelper.isBuffered(mediaBuffer,startPosition);\n // if currentTime not matching with expected startPosition or startPosition not buffered\n if (currentTime !== startPosition || !startPositionBuffered) {\n 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.log(`target start position not buffered, seek to buffered.start(0) ${startPosition}`);\n }\n logger.log(`adjust currentTime from ${currentTime} to ${startPosition}`);\n media.currentTime = startPosition;\n }\n } else if (this.immediateSwitch) {\n this.immediateLevelSwitchEnd();\n } else {\n let bufferInfo = BufferHelper.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), // not playing if nothing buffered\n jumpThreshold = 0.5, // tolerance needed as some browsers stalls playback before reaching buffered range end\n playheadMoving = currentTime !== this.lastCurrentTime,\n config = this.config;\n\n if (playheadMoving) {\n // played moving, but was previously stalled => now not stuck anymore\n if (this.stallReported) {\n logger.warn(`playback not stuck anymore @${currentTime}, after ${Math.round(performance.now()-this.stalled)}ms`);\n this.stallReported = false;\n }\n this.stalled = undefined;\n this.nudgeRetry = 0;\n } else {\n // playhead not moving\n if(expectedPlaying) {\n // playhead not moving BUT media expected to play\n const tnow = performance.now();\n const hls = this.hls;\n if(!this.stalled) {\n // stall just detected, store current time\n this.stalled = tnow;\n this.stallReported = false;\n } else {\n // playback already stalled, check stalling duration\n // if stalling for more than a given threshold, let's try to recover\n const stalledDuration = tnow - this.stalled;\n const bufferLen = bufferInfo.len;\n let nudgeRetry = this.nudgeRetry || 0;\n // have we reached stall deadline ?\n if (bufferLen <= jumpThreshold && stalledDuration > config.lowBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n logger.warn(`playback stalling in low buffer @${currentTime}`);\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer : bufferLen});\n }\n // if buffer len is below threshold, try to jump to start of next buffer range if close\n // no buffer available @ currentTime, check if next buffer is close (within a config.maxSeekHole second range)\n var nextBufferStart = bufferInfo.nextStart, delta = nextBufferStart-currentTime;\n if(nextBufferStart &&\n (delta < config.maxSeekHole) &&\n (delta > 0)) {\n this.nudgeRetry = ++nudgeRetry;\n const nudgeOffset = nudgeRetry * config.nudgeOffset;\n // next buffer is close ! adjust currentTime to nextBufferStart\n // this will ensure effective video decoding\n logger.log(`adjust currentTime from ${media.currentTime} to next buffered @ ${nextBufferStart} + nudge ${nudgeOffset}`);\n media.currentTime = nextBufferStart + nudgeOffset;\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole : nextBufferStart + nudgeOffset - currentTime});\n }\n } else if (bufferLen > jumpThreshold && stalledDuration > config.highBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n logger.warn(`playback stalling in high buffer @${currentTime}`);\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer : bufferLen});\n }\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n this.nudgeRetry = ++nudgeRetry;\n if (nudgeRetry < config.nudgeMaxRetry) {\n const currentTime = media.currentTime;\n const targetTime = currentTime + nudgeRetry * config.nudgeOffset;\n logger.log(`adjust currentTime from ${currentTime} to ${targetTime}`);\n // playback stalled in buffered area ... let's nudge currentTime to try to overcome this\n media.currentTime = targetTime;\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_NUDGE_ON_STALL, fatal: false});\n } else {\n logger.error(`still stuck in high buffer @${currentTime} after ${config.nudgeMaxRetry}, raise fatal error`);\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: true});\n }\n }\n }\n }\n }\n }\n }\n }\n\n 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 this.nextLoadPosition = this.startPosition;\n }\n this.tick();\n }\n\n onBufferFlushed() {\n /* after successful buffer flushing, filter flushed fragments from bufferedFrags\n use mediaBuffered instead of media (so that we will check against video.buffered ranges in case of alt audio track)\n */\n const media = this.mediaBuffer ? this.mediaBuffer : this.media;\n this._bufferedFrags = this._bufferedFrags.filter(frag => {return BufferHelper.isBuffered(media,(frag.startPTS + frag.endPTS) / 2);});\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 swapAudioCodec() {\n this.audioCodecSwap = !this.audioCodecSwap;\n }\n\n computeLivePosition(sliding, levelDetails) {\n let 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 get liveSyncPosition() {\n return this._liveSyncPosition;\n }\n\n set liveSyncPosition(value) {\n this._liveSyncPosition = value;\n }\n}\nexport default StreamController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/stream-controller.js","/*\n * Subtitle Stream Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nclass SubtitleStreamController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.ERROR,\n Event.SUBTITLE_TRACKS_UPDATED,\n Event.SUBTITLE_TRACK_SWITCH,\n Event.SUBTITLE_TRACK_LOADED,\n Event.SUBTITLE_FRAG_PROCESSED);\n this.config = hls.config;\n this.vttFragSNsProcessed = {};\n this.vttFragQueues = undefined;\n this.currentlyProcessing = null;\n this.currentTrackId = -1;\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n // Remove all queued items and create a new, empty queue for each track.\n clearVttFragQueues() {\n this.vttFragQueues = {};\n this.tracks.forEach(track => {\n this.vttFragQueues[track.id] = [];\n });\n }\n\n // If no frag is being processed and queue isn't empty, initiate processing of next frag in line.\n nextFrag() {\n if(this.currentlyProcessing === null && this.currentTrackId > -1 && this.vttFragQueues[this.currentTrackId].length) {\n let frag = this.currentlyProcessing = this.vttFragQueues[this.currentTrackId].shift();\n this.hls.trigger(Event.FRAG_LOADING, {frag});\n }\n }\n\n // When fragment has finished processing, add sn to list of completed if successful.\n onSubtitleFragProcessed(data) {\n if(data.success) {\n this.vttFragSNsProcessed[data.frag.trackId].push(data.frag.sn);\n }\n this.currentlyProcessing = null;\n this.nextFrag();\n }\n\n // If something goes wrong, procede to next frag, if we were processing one.\n onError(data) {\n let frag = data.frag;\n // don't handle frag error not related to subtitle fragment\n if (frag && frag.type !== 'subtitle') {\n return;\n }\n if(this.currentlyProcessing) {\n this.currentlyProcessing = null;\n this.nextFrag();\n }\n }\n\n // Got all new subtitle tracks.\n onSubtitleTracksUpdated(data) {\n logger.log('subtitle tracks updated');\n this.tracks = data.subtitleTracks;\n this.clearVttFragQueues();\n this.vttFragSNsProcessed = {};\n this.tracks.forEach(track => {\n this.vttFragSNsProcessed[track.id] = [];\n });\n }\n\n onSubtitleTrackSwitch(data) {\n this.currentTrackId = data.id;\n this.clearVttFragQueues();\n }\n\n // Got a new set of subtitle fragments.\n onSubtitleTrackLoaded(data) {\n const processedFragSNs = this.vttFragSNsProcessed[data.id],\n fragQueue = this.vttFragQueues[data.id],\n currentFragSN = !!this.currentlyProcessing ? this.currentlyProcessing.sn : -1;\n\n const alreadyProcessed = function(frag) {\n return processedFragSNs.indexOf(frag.sn) > -1;\n };\n\n const alreadyInQueue = function(frag) {\n return fragQueue.some(fragInQueue => {return fragInQueue.sn === frag.sn;});\n };\n\n // Add all fragments that haven't been, aren't currently being and aren't waiting to be processed, to queue.\n data.details.fragments.forEach(frag => {\n if(!(alreadyProcessed(frag) || frag.sn === currentFragSN || alreadyInQueue(frag))) {\n // Frags don't know their subtitle track ID, so let's just add that...\n frag.trackId = data.id;\n fragQueue.push(frag);\n }\n });\n\n this.nextFrag();\n }\n}\nexport default SubtitleStreamController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/subtitle-stream-controller.js","/*\n * audio track controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nfunction filterSubtitleTracks(textTrackList) {\n let tracks = [];\n for (let i = 0; i < textTrackList.length; i++) {\n if (textTrackList[i].kind === 'subtitles') {\n tracks.push(textTrackList[i]);\n }\n }\n return tracks;\n}\n\nclass SubtitleTrackController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.MANIFEST_LOADING,\n Event.MANIFEST_LOADED,\n Event.SUBTITLE_TRACK_LOADED);\n this.tracks = [];\n this.trackId = -1;\n this.media = undefined;\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n // Listen for subtitle track change, then extract the current track ID.\n onMediaAttached(data) {\n this.media = data.media;\n if (!this.media) {\n return;\n }\n\n this.media.textTracks.addEventListener('change', () => {\n // Media is undefined when switching streams via loadSource()\n if (!this.media) {\n return;\n }\n\n let trackId = -1;\n let tracks = filterSubtitleTracks(this.media.textTracks);\n for (let id = 0; id < tracks.length; id++) {\n if (tracks[id].mode === 'showing') {\n trackId = id;\n }\n }\n // Setting current subtitleTrack will invoke code.\n this.subtitleTrack = trackId;\n });\n }\n\n onMediaDetaching() {\n // TODO: Remove event listeners.\n this.media = undefined;\n }\n\n // Reset subtitle tracks on manifest loading\n onManifestLoading() {\n this.tracks = [];\n this.trackId = -1;\n }\n\n // Fired whenever a new manifest is loaded.\n onManifestLoaded(data) {\n let tracks = data.subtitles || [];\n let defaultFound = false;\n this.tracks = tracks;\n this.trackId = -1;\n this.hls.trigger(Event.SUBTITLE_TRACKS_UPDATED, {subtitleTracks : tracks});\n\n // loop through available subtitle tracks and autoselect default if needed\n // TODO: improve selection logic to handle forced, etc\n tracks.forEach(track => {\n if (track.default) {\n this.subtitleTrack = track.id;\n defaultFound = true;\n }\n });\n }\n\n // Trigger subtitle track playlist reload.\n onTick() {\n const trackId = this.trackId;\n const subtitleTrack = this.tracks[trackId];\n if (!subtitleTrack) {\n return;\n }\n\n const details = subtitleTrack.details;\n // check if we need to load playlist for this subtitle Track\n if (details === undefined || details.live === true) {\n // track not retrieved yet, or live playlist we need to (re)load it\n logger.log(`(re)loading playlist for subtitle track ${trackId}`);\n this.hls.trigger(Event.SUBTITLE_TRACK_LOADING, {url: subtitleTrack.url, id: trackId});\n }\n }\n\n onSubtitleTrackLoaded(data) {\n if (data.id < this.tracks.length) {\n logger.log(`subtitle track ${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(() => {\n this.onTick();\n }, 1000 * data.details.targetduration, this);\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 subtitle tracks list from playlist **/\n get subtitleTracks() {\n return this.tracks;\n }\n\n /** get index of the selected subtitle track (index in subtitle track lists) **/\n get subtitleTrack() {\n return this.trackId;\n }\n\n /** select a subtitle track, based on its index in subtitle track lists**/\n set subtitleTrack(subtitleTrackId) {\n if (this.trackId !== subtitleTrackId) {// || this.tracks[subtitleTrackId].details === undefined) {\n this.setSubtitleTrackInternal(subtitleTrackId);\n }\n }\n\n setSubtitleTrackInternal(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.log(`switching to subtitle track ${newId}`);\n let subtitleTrack = this.tracks[newId];\n this.hls.trigger(Event.SUBTITLE_TRACK_SWITCH, {id: newId});\n // check if we need to load playlist for this subtitle Track\n let details = subtitleTrack.details;\n if (details === undefined || details.live === true) {\n // track not retrieved yet, or live playlist we need to (re)load it\n logger.log(`(re)loading playlist for subtitle track ${newId}`);\n this.hls.trigger(Event.SUBTITLE_TRACK_LOADING, {url: subtitleTrack.url, id: newId});\n }\n }\n }\n}\n\nexport default SubtitleTrackController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/subtitle-track-controller.js","/*\n * Timeline Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport Cea608Parser from '../utils/cea-608-parser';\nimport WebVTTParser from '../utils/webvtt-parser';\nimport {logger} from '../utils/logger';\n\nfunction clearCurrentCues(track) {\n if (track && track.cues) {\n while (track.cues.length > 0) {\n track.removeCue(track.cues[0]);\n }\n }\n}\n\nfunction reuseVttTextTrack(inUseTrack, manifestTrack) {\n return inUseTrack && inUseTrack.label === manifestTrack.name && !(inUseTrack.textTrack1 || inUseTrack.textTrack2);\n}\n\nfunction intersection(x1, x2, y1, y2) {\n return Math.min(x2, y2) - Math.max(x1, y1);\n}\n\nclass TimelineController extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.MEDIA_ATTACHING,\n Event.MEDIA_DETACHING,\n Event.FRAG_PARSING_USERDATA,\n Event.MANIFEST_LOADING,\n Event.MANIFEST_LOADED,\n Event.FRAG_LOADED,\n Event.LEVEL_SWITCHING,\n Event.INIT_PTS_FOUND);\n\n this.hls = hls;\n this.config = hls.config;\n this.enabled = true;\n this.Cues = hls.config.cueHandler;\n this.textTracks = [];\n this.tracks = [];\n this.unparsedVttFrags = [];\n this.initPTS = undefined;\n this.cueRanges = [];\n\n if (this.config.enableCEA708Captions)\n {\n var self = this;\n var sendAddTrackEvent = function (track, media)\n {\n var e = null;\n try {\n e = new window.Event('addtrack');\n } catch (err) {\n //for IE11\n e = document.createEvent('Event');\n e.initEvent('addtrack', false, false);\n }\n e.track = track;\n media.dispatchEvent(e);\n };\n\n var channel1 =\n {\n 'newCue': function(startTime, endTime, screen)\n {\n if (!self.textTrack1)\n {\n //Enable reuse of existing text track.\n var existingTrack1 = self.getExistingTrack('1');\n if (!existingTrack1)\n {\n const textTrack1 = self.createTextTrack('captions', self.config.captionsTextTrack1Label, self.config.captionsTextTrack1LanguageCode);\n if (textTrack1) {\n textTrack1.textTrack1 = true;\n self.textTrack1 = textTrack1;\n }\n }\n else\n {\n self.textTrack1 = existingTrack1;\n clearCurrentCues(self.textTrack1);\n\n sendAddTrackEvent(self.textTrack1, self.media);\n }\n }\n self.addCues('textTrack1', startTime, endTime, screen);\n }\n };\n\n var channel2 =\n {\n 'newCue': function(startTime, endTime, screen)\n {\n if (!self.textTrack2)\n {\n //Enable reuse of existing text track.\n var existingTrack2 = self.getExistingTrack('2');\n if (!existingTrack2)\n {\n const textTrack2 = self.createTextTrack('captions', self.config.captionsTextTrack2Label, self.config.captionsTextTrack1LanguageCode);\n if (textTrack2) {\n textTrack2.textTrack2 = true;\n self.textTrack2 = textTrack2;\n }\n }\n else\n {\n self.textTrack2 = existingTrack2;\n clearCurrentCues(self.textTrack2);\n\n sendAddTrackEvent(self.textTrack2, self.media);\n }\n }\n self.addCues('textTrack2', startTime, endTime, screen);\n }\n };\n\n this.cea608Parser = new Cea608Parser(0, channel1, channel2);\n }\n }\n\n addCues(channel, startTime, endTime, screen) {\n // skip cues which overlap more than 50% with previously parsed time ranges\n const ranges = this.cueRanges;\n let merged = false;\n for (let i = ranges.length; i--;) {\n let cueRange = ranges[i];\n let overlap = intersection(cueRange[0], cueRange[1], startTime, endTime);\n if (overlap >= 0) {\n cueRange[0] = Math.min(cueRange[0], startTime);\n cueRange[1] = Math.max(cueRange[1], endTime);\n merged = true;\n if ((overlap / (endTime - startTime)) > 0.5) {\n return;\n }\n }\n }\n if (!merged) {\n ranges.push([startTime, endTime]);\n }\n this.Cues.newCue(this[channel], startTime, endTime, screen);\n }\n\n // Triggered when an initial PTS is found; used for synchronisation of WebVTT.\n onInitPtsFound(data) {\n if (typeof this.initPTS === 'undefined') {\n this.initPTS = data.initPTS;\n }\n\n // Due to asynchrony, initial PTS may arrive later than the first VTT fragments are loaded.\n // Parse any unparsed fragments upon receiving the initial PTS.\n if (this.unparsedVttFrags.length) {\n this.unparsedVttFrags.forEach(frag => {\n this.onFragLoaded(frag);\n });\n this.unparsedVttFrags = [];\n }\n }\n\n getExistingTrack(channelNumber) {\n const media = this.media;\n if (media) {\n for (let i = 0; i < media.textTracks.length; i++) {\n let textTrack = media.textTracks[i];\n let propName = 'textTrack' + channelNumber;\n if (textTrack[propName] === true) {\n return textTrack;\n }\n }\n }\n return null;\n }\n\n createTextTrack(kind, label, lang) {\n const media = this.media;\n if (media)\n {\n return media.addTextTrack(kind, label, lang);\n }\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n onMediaAttaching(data) {\n this.media = data.media;\n }\n\n onMediaDetaching() {\n clearCurrentCues(this.textTrack1);\n clearCurrentCues(this.textTrack2);\n }\n\n onManifestLoading()\n {\n this.lastSn = -1; // Detect discontiguity in fragment parsing\n this.prevCC = -1;\n this.vttCCs = {ccOffset: 0, presentationOffset: 0}; // Detect discontinuity in subtitle manifests\n\n // clear outdated subtitles\n const media = this.media;\n if (media) {\n const textTracks = media.textTracks;\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n clearCurrentCues(textTracks[i]);\n }\n }\n }\n }\n\n onManifestLoaded(data) {\n this.textTracks = [];\n this.unparsedVttFrags = this.unparsedVttFrags || [];\n this.initPTS = undefined;\n this.cueRanges = [];\n\n if (this.config.enableWebVTT) {\n this.tracks = data.subtitles || [];\n const inUseTracks = this.media ? this.media.textTracks : [];\n\n this.tracks.forEach((track, index) => {\n let textTrack;\n if (index < inUseTracks.length) {\n const inUseTrack = inUseTracks[index];\n // Reuse tracks with the same label, but do not reuse 608/708 tracks\n if (reuseVttTextTrack(inUseTrack, track)) {\n textTrack = inUseTrack;\n }\n }\n if (!textTrack) {\n textTrack = this.createTextTrack('subtitles', track.name, track.lang);\n }\n textTrack.mode = track.default ? 'showing' : 'hidden';\n this.textTracks.push(textTrack);\n });\n }\n }\n\n onLevelSwitching() {\n this.enabled = this.hls.currentLevel.closedCaptions !== 'NONE';\n }\n\n onFragLoaded(data) {\n let frag = data.frag,\n payload = data.payload;\n if (frag.type === 'main') {\n var sn = frag.sn;\n // if this frag isn't contiguous, clear the parser so cues with bad start/end times aren't added to the textTrack\n if (sn !== this.lastSn + 1) {\n const cea608Parser = this.cea608Parser;\n if (cea608Parser) {\n cea608Parser.reset();\n }\n }\n this.lastSn = sn;\n }\n // If fragment is subtitle type, parse as WebVTT.\n else if (frag.type === 'subtitle') {\n if (payload.byteLength) {\n // We need an initial synchronisation PTS. Store fragments as long as none has arrived.\n if (typeof this.initPTS === 'undefined') {\n this.unparsedVttFrags.push(data);\n return;\n }\n let vttCCs = this.vttCCs;\n if (!vttCCs[frag.cc]) {\n vttCCs[frag.cc] = { start: frag.start, prevCC: this.prevCC, new: true };\n this.prevCC = frag.cc;\n }\n let textTracks = this.textTracks,\n hls = this.hls;\n\n // Parse the WebVTT file contents.\n WebVTTParser.parse(payload, this.initPTS, vttCCs, frag.cc, function (cues) {\n const currentTrack = textTracks[frag.trackId];\n // Add cues and trigger event with success true.\n cues.forEach(cue => {\n // Sometimes there are cue overlaps on segmented vtts so the same\n // cue can appear more than once in different vtt files.\n // This avoid showing duplicated cues with same timecode and text.\n if (!currentTrack.cues.getCueById(cue.id)) {\n currentTrack.addCue(cue);\n }\n });\n hls.trigger(Event.SUBTITLE_FRAG_PROCESSED, {success: true, frag: frag});\n },\n function (e) {\n // Something went wrong while parsing. Trigger event with success false.\n logger.log(`Failed to parse VTT cue: ${e}`);\n hls.trigger(Event.SUBTITLE_FRAG_PROCESSED, {success: false, frag: frag});\n });\n }\n else {\n // In case there is no payload, finish unsuccessfully.\n this.hls.trigger(Event.SUBTITLE_FRAG_PROCESSED, {success: false, frag: frag});\n }\n }\n }\n\n 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 && this.config.enableCEA708Captions) {\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 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;\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\nexport default TimelineController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/timeline-controller.js","export default class AESCrypto {\n constructor(subtle,iv) {\n this.subtle = subtle;\n this.aesIV = iv;\n }\n\n decrypt(data, key) {\n return this.subtle.decrypt({name: 'AES-CBC', iv: this.aesIV}, key, data);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/aes-crypto.js","class AESDecryptor {\n constructor() {\n // Static after running initTable\n this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n this.subMix = [new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];\n this.invSubMix = [new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];\n this.sBox = new Uint32Array(256);\n this.invSBox = new Uint32Array(256);\n\n // Changes during runtime\n this.key = new Uint32Array(0);\n\n this.initTable();\n }\n\n // Using view.getUint32() also swaps the byte order.\n uint8ArrayToUint32Array_(arrayBuffer) {\n let view = new DataView(arrayBuffer);\n let newArray = new Uint32Array(4);\n for (let i = 0; i < 4; i++) {\n newArray[i] = view.getUint32(i * 4);\n }\n return newArray;\n }\n\n initTable() {\n let sBox = this.sBox;\n let invSBox = this.invSBox;\n let subMix = this.subMix;\n let subMix0 = subMix[0];\n let subMix1 = subMix[1];\n let subMix2 = subMix[2];\n let subMix3 = subMix[3];\n let invSubMix = this.invSubMix;\n let invSubMix0 = invSubMix[0];\n let invSubMix1 = invSubMix[1];\n let invSubMix2 = invSubMix[2];\n let invSubMix3 = invSubMix[3];\n\n let d = new Uint32Array(256);\n let x = 0;\n let xi = 0;\n let i = 0;\n for (i = 0; i < 256; i++) {\n if (i < 128) {\n d[i] = i << 1;\n } else {\n d[i] = (i << 1) ^ 0x11b;\n }\n }\n\n for (i = 0; i < 256; i++) {\n let sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);\n sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;\n sBox[x] = sx;\n invSBox[sx] = x;\n\n // Compute multiplication\n let x2 = d[x];\n let x4 = d[x2];\n let x8 = d[x4];\n\n // Compute sub/invSub bytes, mix columns tables\n let t = (d[sx] * 0x101) ^ (sx * 0x1010100);\n subMix0[x] = (t << 24) | (t >>> 8);\n subMix1[x] = (t << 16) | (t >>> 16);\n subMix2[x] = (t << 8) | (t >>> 24);\n subMix3[x] = t;\n\n // Compute inv sub bytes, inv mix columns tables\n t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);\n invSubMix0[sx] = (t << 24) | (t >>> 8);\n invSubMix1[sx] = (t << 16) | (t >>> 16);\n invSubMix2[sx] = (t << 8) | (t >>> 24);\n invSubMix3[sx] = t;\n\n // Compute next counter\n if (!x) {\n x = xi = 1;\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]];\n xi ^= d[d[xi]];\n }\n }\n }\n\n expandKey(keyBuffer) {\n // convert keyBuffer to Uint32Array\n let key = this.uint8ArrayToUint32Array_(keyBuffer);\n let sameKey = true;\n let offset = 0;\n\n while (offset < key.length && sameKey) {\n sameKey = (key[offset] === this.key[offset]);\n offset++;\n }\n\n if (sameKey) {\n return;\n }\n\n this.key = key;\n let keySize = this.keySize = key.length;\n\n if (keySize !== 4 && keySize !== 6 && keySize !== 8) {\n throw new Error('Invalid aes key size=' + keySize);\n }\n\n let ksRows = this.ksRows = (keySize + 6 + 1) * 4;\n let ksRow;\n let invKsRow;\n\n let keySchedule = this.keySchedule = new Uint32Array(ksRows);\n let invKeySchedule = this.invKeySchedule = new Uint32Array(ksRows);\n let sbox = this.sBox;\n let rcon = this.rcon;\n\n let invSubMix = this.invSubMix;\n let invSubMix0 = invSubMix[0];\n let invSubMix1 = invSubMix[1];\n let invSubMix2 = invSubMix[2];\n let invSubMix3 = invSubMix[3];\n\n let prev;\n let t;\n\n for (ksRow = 0; ksRow < ksRows; ksRow++) {\n if (ksRow < keySize) {\n prev = keySchedule[ksRow] = key[ksRow];\n continue;\n }\n t = prev;\n\n if (ksRow % keySize === 0) {\n // Rot word\n t = (t << 8) | (t >>> 24);\n\n // Sub word\n t = (sbox[t >>> 24] << 24) | (sbox[(t >>> 16) & 0xff] << 16) | (sbox[(t >>> 8) & 0xff] << 8) | sbox[t & 0xff];\n\n // Mix Rcon\n t ^= rcon[(ksRow / keySize) | 0] << 24;\n } else if (keySize > 6 && ksRow % keySize === 4) {\n // Sub word\n t = (sbox[t >>> 24] << 24) | (sbox[(t >>> 16) & 0xff] << 16) | (sbox[(t >>> 8) & 0xff] << 8) | sbox[t & 0xff];\n }\n\n keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;\n }\n\n for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n ksRow = ksRows - invKsRow;\n if (invKsRow & 3) {\n t = keySchedule[ksRow];\n } else {\n t = keySchedule[ksRow - 4];\n }\n\n if (invKsRow < 4 || ksRow <= 4) {\n invKeySchedule[invKsRow] = t;\n } else {\n invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[(t >>> 16) & 0xff]] ^ invSubMix2[sbox[(t >>> 8) & 0xff]] ^ invSubMix3[sbox[t & 0xff]];\n }\n\n invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;\n }\n }\n\n // Adding this as a method greatly improves performance.\n networkToHostOrderSwap(word) {\n return (word << 24) | ((word & 0xff00) << 8) | ((word & 0xff0000) >> 8) | (word >>> 24);\n }\n\n decrypt(inputArrayBuffer, offset, aesIV) {\n let nRounds = this.keySize + 6;\n let invKeySchedule = this.invKeySchedule;\n let invSBOX = this.invSBox;\n\n let invSubMix = this.invSubMix;\n let invSubMix0 = invSubMix[0];\n let invSubMix1 = invSubMix[1];\n let invSubMix2 = invSubMix[2];\n let invSubMix3 = invSubMix[3];\n\n let initVector = this.uint8ArrayToUint32Array_(aesIV);\n let initVector0 = initVector[0];\n let initVector1 = initVector[1];\n let initVector2 = initVector[2];\n let initVector3 = initVector[3];\n\n let inputInt32 = new Int32Array(inputArrayBuffer);\n let outputInt32 = new Int32Array(inputInt32.length);\n\n let t0, t1, t2, t3;\n let s0, s1, s2, s3;\n let inputWords0, inputWords1, inputWords2, inputWords3;\n\n var ksRow, i;\n let swapWord = this.networkToHostOrderSwap;\n\n while (offset < inputInt32.length) {\n inputWords0 = swapWord(inputInt32[offset]);\n inputWords1 = swapWord(inputInt32[offset + 1]);\n inputWords2 = swapWord(inputInt32[offset + 2]);\n inputWords3 = swapWord(inputInt32[offset + 3]);\n\n s0 = inputWords0 ^ invKeySchedule[0];\n s1 = inputWords3 ^ invKeySchedule[1];\n s2 = inputWords2 ^ invKeySchedule[2];\n s3 = inputWords1 ^ invKeySchedule[3];\n\n ksRow = 4;\n\n // Iterate through the rounds of decryption\n for (i = 1; i < nRounds; i++) {\n t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[(s1 >> 16) & 0xff] ^ invSubMix2[(s2 >> 8) & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[(s2 >> 16) & 0xff] ^ invSubMix2[(s3 >> 8) & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[(s3 >> 16) & 0xff] ^ invSubMix2[(s0 >> 8) & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[(s0 >> 16) & 0xff] ^ invSubMix2[(s1 >> 8) & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n // Update state\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n\n ksRow = ksRow + 4;\n }\n\n // Shift rows, sub bytes, add round key\n t0 = ((invSBOX[s0 >>> 24] << 24) ^ (invSBOX[(s1 >> 16) & 0xff] << 16) ^ (invSBOX[(s2 >> 8) & 0xff] << 8) ^ invSBOX[s3 & 0xff]) ^ invKeySchedule[ksRow];\n t1 = ((invSBOX[s1 >>> 24] << 24) ^ (invSBOX[(s2 >> 16) & 0xff] << 16) ^ (invSBOX[(s3 >> 8) & 0xff] << 8) ^ invSBOX[s0 & 0xff]) ^ invKeySchedule[ksRow + 1];\n t2 = ((invSBOX[s2 >>> 24] << 24) ^ (invSBOX[(s3 >> 16) & 0xff] << 16) ^ (invSBOX[(s0 >> 8) & 0xff] << 8) ^ invSBOX[s1 & 0xff]) ^ invKeySchedule[ksRow + 2];\n t3 = ((invSBOX[s3 >>> 24] << 24) ^ (invSBOX[(s0 >> 16) & 0xff] << 16) ^ (invSBOX[(s1 >> 8) & 0xff] << 8) ^ invSBOX[s2 & 0xff]) ^ invKeySchedule[ksRow + 3];\n ksRow = ksRow + 3;\n\n // Write\n outputInt32[offset] = swapWord(t0 ^ initVector0);\n outputInt32[offset + 1] = swapWord(t3 ^ initVector1);\n outputInt32[offset + 2] = swapWord(t2 ^ initVector2);\n outputInt32[offset + 3] = swapWord(t1 ^ initVector3);\n\n // reset initVector to last 4 unsigned int\n initVector0 = inputWords0;\n initVector1 = inputWords1;\n initVector2 = inputWords2;\n initVector3 = inputWords3;\n\n offset = offset + 4;\n }\n\n return outputInt32.buffer;\n }\n\n destroy() {\n this.key = undefined;\n this.keySize = undefined;\n this.ksRows = undefined;\n\n this.sBox = undefined;\n this.invSBox = undefined;\n this.subMix = undefined;\n this.invSubMix = undefined;\n this.keySchedule = undefined;\n this.invKeySchedule = undefined;\n\n this.rcon = undefined;\n }\n}\n\nexport default AESDecryptor;\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/aes-decryptor.js","import AESCrypto from './aes-crypto';\nimport FastAESKey from './fast-aes-key';\nimport AESDecryptor from './aes-decryptor';\n\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\n/*globals self: false */\n\nclass Decrypter {\n constructor(observer,config) {\n this.observer = observer;\n this.config = config;\n this.logEnabled = true;\n try {\n const browserCrypto = crypto ? crypto : self.crypto;\n this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;\n } catch (e) {}\n this.disableWebCrypto = !this.subtle;\n }\n\n isSync() {\n return (this.disableWebCrypto && this.config.enableSoftwareAES);\n }\n\n decrypt(data, key, iv, callback) {\n if (this.disableWebCrypto && this.config.enableSoftwareAES) {\n if (this.logEnabled) {\n logger.log('JS AES decrypt');\n this.logEnabled = false;\n }\n let decryptor = this.decryptor;\n if (!decryptor) {\n this.decryptor = decryptor = new AESDecryptor();\n }\n decryptor.expandKey(key);\n callback(decryptor.decrypt(data, 0, iv));\n }\n else {\n if (this.logEnabled) {\n logger.log('WebCrypto AES decrypt');\n this.logEnabled = false;\n }\n const subtle = this.subtle;\n if (this.key !== key) {\n this.key = key;\n this.fastAesKey = new FastAESKey(subtle,key);\n }\n\n this.fastAesKey.expandKey().\n then((aesKey) => {\n // decrypt using web crypto\n let crypto = new AESCrypto(subtle,iv);\n crypto.decrypt(data, aesKey).\n catch ((err) => {\n this.onWebCryptoError(err, data, key, iv, callback);\n }).\n then((result) => {\n callback(result);\n });\n }).\n catch ((err) => {\n this.onWebCryptoError(err, data, key, iv, callback);\n });\n }\n }\n\n onWebCryptoError(err, data, key, iv, callback) {\n if (this.config.enableSoftwareAES) {\n logger.log('WebCrypto Error, disable WebCrypto API');\n this.disableWebCrypto = true;\n this.logEnabled = true;\n this.decrypt(data, key, iv, callback);\n }\n else {\n logger.error(`decrypting error : ${err.message}`);\n this.observer.trigger(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details : ErrorDetails.FRAG_DECRYPT_ERROR, fatal : true, reason : err.message});\n }\n }\n\n destroy() {\n let decryptor = this.decryptor;\n if (decryptor) {\n decryptor.destroy();\n this.decryptor = undefined;\n }\n }\n}\n\nexport default Decrypter;\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/decrypter.js","class FastAESKey {\n constructor(subtle,key) {\n this.subtle = subtle;\n this.key = key;\n }\n\n expandKey() {\n return this.subtle.importKey('raw', this.key, {name: 'AES-CBC'}, false, ['encrypt', 'decrypt']);\n }\n}\n\nexport default FastAESKey;\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/fast-aes-key.js","/**\n * AAC demuxer\n */\nimport ADTS from './adts';\nimport {logger} from '../utils/logger';\nimport ID3 from '../demux/id3';\n\n class AACDemuxer {\n\n constructor(observer, remuxer, config) {\n this.observer = observer;\n this.config = config;\n this.remuxer = remuxer;\n }\n\n resetInitSegment(initSegment,audioCodec,videoCodec, duration) {\n this._audioTrack = {container : 'audio/adts', type: 'audio', id :-1, sequenceNumber: 0, isAAC : true , samples : [], len : 0, manifestCodec : audioCodec, duration : duration, inputTimeScale : 90000};\n }\n\n resetTimeStamp() {\n }\n\n static probe(data) {\n // check if data contains ID3 timestamp and ADTS sync word\n var id3 = new ID3(data), offset, length;\n if(id3.hasTimeStamp) {\n // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1\n // Layer bits (position 14 and 15) in header should be always 0 for ADTS\n // More info https://wiki.multimedia.cx/index.php?title=ADTS\n for (offset = id3.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {\n if ((data[offset] === 0xff) && (data[offset+1] & 0xf6) === 0xf0) {\n //logger.log('ADTS sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset, contiguous,accurateTimeOffset) {\n var track,\n id3 = new ID3(data),\n pts = 90*id3.timeStamp,\n config, frameLength, frameDuration, frameIndex, offset, headerLength, stamp, length, aacSample;\n\n track = this._audioTrack;\n\n // Look for ADTS header\n for (offset = id3.length, length = data.length; offset < length - 1; offset++) {\n if ((data[offset] === 0xff) && (data[offset+1] & 0xf6) === 0xf0) {\n break;\n }\n }\n\n if (!track.samplerate) {\n config = ADTS.getAudioConfig(this.observer,data, offset, track.manifestCodec);\n track.config = config.config;\n track.samplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n logger.log(`parsed codec:${track.codec},rate:${config.samplerate},nb channel:${config.channelCount}`);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.samplerate;\n while ((offset + 5) < length) {\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) |\n (data[offset + 4] << 3) |\n ((data[offset + 5] & 0xE0) >>> 5);\n frameLength -= headerLength;\n //stamp = pes.pts;\n\n if ((frameLength > 0) && ((offset + headerLength + frameLength) <= length)) {\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 < (length - 1); offset++) {\n if ((data[offset] === 0xff) && ((data[offset + 1] & 0xf6) === 0xf0)) {\n break;\n }\n }\n } else {\n break;\n }\n }\n this.remuxer.remux(track,\n {samples : []},\n {samples : [ { pts: pts, dts : pts, data : id3.payload}], inputTimeScale : 90000},\n {samples : []},\n timeOffset,\n contiguous,\n accurateTimeOffset);\n }\n\n destroy() {\n }\n\n}\n\nexport default AACDemuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/aacdemuxer.js","/**\n * ADTS parser helper\n */\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n\n const ADTS = {\n getAudioConfig : function(observer, data, offset, audioCodec) {\n var adtsObjectType, // :int\n adtsSampleingIndex, // :int\n adtsExtensionSampleingIndex, // :int\n adtsChanelConfig, // :int\n config,\n userAgent = navigator.userAgent.toLowerCase(),\n manifestCodec = audioCodec,\n adtsSampleingRates = [\n 96000, 88200,\n 64000, 48000,\n 44100, 32000,\n 24000, 22050,\n 16000, 12000,\n 11025, 8000,\n 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: ErrorTypes.MEDIA_ERROR, details: 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.log(`manifest codec:${audioCodec},ADTS data:type:${adtsObjectType},sampleingIndex:${adtsSampleingIndex}[${adtsSampleingRates[adtsSampleingIndex]}Hz],channelConfig:${adtsChanelConfig}`);\n // firefox: freq less than 24kHz = AAC SBR (HE-AAC)\n if (/firefox/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/Opera ...)\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) ||\n (audioCodec.indexOf('mp4a.40.5') !== -1))) ||\n (!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) ||\n (!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), manifestCodec : manifestCodec};\n }\n};\n\nmodule.exports = ADTS;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/adts.js","/* inline demuxer.\n * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)\n */\n\nimport Event from '../events';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport Decrypter from '../crypt/decrypter';\nimport AACDemuxer from '../demux/aacdemuxer';\nimport MP4Demuxer from '../demux/mp4demuxer';\nimport TSDemuxer from '../demux/tsdemuxer';\nimport MP3Demuxer from '../demux/mp3demuxer';\nimport MP4Remuxer from '../remux/mp4-remuxer';\nimport PassThroughRemuxer from '../remux/passthrough-remuxer';\n\nclass DemuxerInline {\n\n constructor(observer,typeSupported, config, vendor) {\n this.observer = observer;\n this.typeSupported = typeSupported;\n this.config = config;\n this.vendor = vendor;\n }\n\n destroy() {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n }\n }\n\n push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {\n if ((data.byteLength > 0) && (decryptdata != null) && (decryptdata.key != null) && (decryptdata.method === 'AES-128')) {\n let decrypter = this.decrypter;\n if (decrypter == null) {\n decrypter = this.decrypter = new Decrypter(this.observer, this.config);\n }\n var localthis = this;\n // performance.now() not available on WebWorker, at least on Safari Desktop\n var startTime;\n try {\n startTime = performance.now();\n } catch(error) {\n startTime = Date.now();\n }\n decrypter.decrypt(data, decryptdata.key.buffer, decryptdata.iv.buffer, function (decryptedData) {\n var endTime;\n try {\n endTime = performance.now();\n } catch(error) {\n endTime = Date.now();\n }\n localthis.observer.trigger(Event.FRAG_DECRYPTED, { stats: { tstart: startTime, tdecrypt: endTime } });\n localthis.pushDecrypted(new Uint8Array(decryptedData), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset,defaultInitPTS);\n });\n } else {\n this.pushDecrypted(new Uint8Array(data), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration,accurateTimeOffset,defaultInitPTS);\n }\n }\n\n pushDecrypted(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration,accurateTimeOffset,defaultInitPTS) {\n var demuxer = this.demuxer;\n if (!demuxer || \n // in case of continuity change, we might switch from content type (AAC container to TS container for example)\n // so let's check that current demuxer is still valid\n (discontinuity && !this.probe(data))) {\n const observer = this.observer;\n const typeSupported = this.typeSupported;\n const config = this.config;\n const muxConfig = [ {demux : TSDemuxer, remux : MP4Remuxer},\n {demux : MP3Demuxer, remux : MP4Remuxer},\n {demux : AACDemuxer, remux : MP4Remuxer},\n {demux : MP4Demuxer, remux : PassThroughRemuxer}];\n\n // probe for content type\n for (let i in muxConfig) {\n const mux = muxConfig[i];\n const probe = mux.demux.probe;\n if(probe(data)) {\n const remuxer = this.remuxer = new mux.remux(observer,config,typeSupported, this.vendor);\n demuxer = new mux.demux(observer,remuxer,config,typeSupported);\n this.probe = probe;\n break;\n }\n }\n if(!demuxer) {\n observer.trigger(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'no demux matching with content found'});\n return;\n }\n this.demuxer = demuxer;\n }\n const remuxer = this.remuxer;\n\n if (discontinuity || trackSwitch) {\n demuxer.resetInitSegment(initSegment,audioCodec,videoCodec,duration);\n remuxer.resetInitSegment();\n }\n if (discontinuity) {\n demuxer.resetTimeStamp();\n remuxer.resetTimeStamp(defaultInitPTS);\n }\n if (typeof demuxer.setDecryptData === 'function') {\n demuxer.setDecryptData(decryptdata);\n }\n demuxer.append(data,timeOffset,contiguous,accurateTimeOffset);\n }\n}\n\nexport default DemuxerInline;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/demuxer-inline.js","/* 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\n import DemuxerInline from '../demux/demuxer-inline';\n import Event from '../events';\n import {enableLogs} from '../utils/logger';\n import EventEmitter from 'events';\n\nvar DemuxerWorker = function (self) {\n // observer setup\n var observer = new EventEmitter();\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...data);\n };\n\n var forwardMessage = function(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 let config = JSON.parse(data.config);\n self.demuxer = new DemuxerInline(observer, data.typeSupported, config, data.vendor);\n try {\n enableLogs(config.debug === true);\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(data.data, data.decryptdata, data.initSegment, data.audioCodec, data.videoCodec, data.timeOffset,data.discontinuity, data.trackSwitch,data.contiguous,data.duration,data.accurateTimeOffset,data.defaultInitPTS);\n break;\n default:\n break;\n }\n });\n\n // forward events to main thread\n observer.on(Event.FRAG_DECRYPTED, forwardMessage);\n observer.on(Event.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(Event.FRAG_PARSED, forwardMessage);\n observer.on(Event.ERROR, forwardMessage);\n observer.on(Event.FRAG_PARSING_METADATA, forwardMessage);\n observer.on(Event.FRAG_PARSING_USERDATA, forwardMessage);\n observer.on(Event.INIT_PTS_FOUND, forwardMessage);\n\n // special case for FRAG_PARSING_DATA: pass data1/data2 as transferable object (no copy)\n observer.on(Event.FRAG_PARSING_DATA, function(ev, data) {\n let transferable = [];\n let message = {event: ev, data:data};\n if (data.data1) {\n message.data1 = data.data1.buffer;\n transferable.push(data.data1.buffer);\n delete data.data1;\n }\n if (data.data2) {\n message.data2 = data.data2.buffer;\n transferable.push(data.data2.buffer);\n delete data.data2;\n }\n self.postMessage(message,transferable);\n });\n};\n\nexport default DemuxerWorker;\n\n\n\n\n// WEBPACK FOOTER //\n// src/demux/demuxer-worker.js","import Event from '../events';\nimport DemuxerInline from '../demux/demuxer-inline';\nimport DemuxerWorker from '../demux/demuxer-worker';\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport EventEmitter from 'events';\n\nclass Demuxer {\n\n constructor(hls, id) {\n this.hls = hls;\n this.id = id;\n // observer setup\n const observer = this.observer = new EventEmitter();\n const config = hls.config;\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...data);\n };\n\n var forwardMessage = function(ev,data) {\n data = data || {};\n data.frag = this.frag;\n data.id = this.id;\n hls.trigger(ev,data);\n }.bind(this);\n\n // forward events to main thread\n observer.on(Event.FRAG_DECRYPTED, forwardMessage);\n observer.on(Event.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(Event.FRAG_PARSING_DATA, forwardMessage);\n observer.on(Event.FRAG_PARSED, forwardMessage);\n observer.on(Event.ERROR, forwardMessage);\n observer.on(Event.FRAG_PARSING_METADATA, forwardMessage);\n observer.on(Event.FRAG_PARSING_USERDATA, forwardMessage);\n observer.on(Event.INIT_PTS_FOUND, forwardMessage);\n\n const typeSupported = {\n mp4 : MediaSource.isTypeSupported('video/mp4'),\n mpeg: MediaSource.isTypeSupported('audio/mpeg'),\n mp3: MediaSource.isTypeSupported('audio/mp4; codecs=\"mp3\"')\n };\n // navigator.vendor is not always available in Web Worker\n // refer to https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/navigator\n const vendor = navigator.vendor;\n if (config.enableWorker && (typeof(Worker) !== 'undefined')) {\n logger.log('demuxing in webworker');\n let w;\n try {\n let work = require('webworkify');\n w = this.w = work(DemuxerWorker);\n this.onwmsg = this.onWorkerMessage.bind(this);\n w.addEventListener('message', this.onwmsg);\n w.onerror = function(event) { hls.trigger(Event.ERROR, {type: ErrorTypes.OTHER_ERROR, details: ErrorDetails.INTERNAL_EXCEPTION, fatal: true, event : 'demuxerWorker', err : { message : event.message + ' (' + event.filename + ':' + event.lineno + ')' }});};\n w.postMessage({cmd: 'init', typeSupported : typeSupported, vendor : vendor, id : id, config: JSON.stringify(config)});\n } catch(err) {\n 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 DemuxerInline(observer,typeSupported,config,vendor);\n this.w = undefined;\n }\n } else {\n this.demuxer = new DemuxerInline(observer,typeSupported,config, vendor);\n }\n }\n\n destroy() {\n let w = this.w;\n if (w) {\n w.removeEventListener('message', this.onwmsg);\n w.terminate();\n this.w = null;\n } else {\n let demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n this.demuxer = null;\n }\n }\n let observer = this.observer;\n if (observer) {\n observer.removeAllListeners();\n this.observer = null;\n }\n }\n\n push(data, initSegment, audioCodec, videoCodec, frag, duration,accurateTimeOffset,defaultInitPTS) {\n const w = this.w;\n const timeOffset = !isNaN(frag.startDTS) ? frag.startDTS : frag.start;\n const decryptdata = frag.decryptdata;\n const lastFrag = this.frag;\n const discontinuity = !(lastFrag && (frag.cc === lastFrag.cc));\n const trackSwitch = !(lastFrag && (frag.level === lastFrag.level));\n const nextSN = lastFrag && (frag.sn === (lastFrag.sn+1));\n const contiguous = !trackSwitch && nextSN;\n if (discontinuity) {\n logger.log(`${this.id}:discontinuity detected`);\n }\n if (trackSwitch) {\n logger.log(`${this.id}:switch detected`);\n }\n this.frag = frag;\n if (w) {\n // post fragment payload as transferable objects (no copy)\n w.postMessage({cmd: 'demux', data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset,defaultInitPTS}, [data]);\n } else {\n let demuxer = this.demuxer;\n if (demuxer) {\n demuxer.push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset,defaultInitPTS);\n }\n }\n }\n\n onWorkerMessage(ev) {\n let 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 Event.FRAG_PARSING_DATA:\n data.data.data1 = new Uint8Array(data.data1);\n if (data.data2) {\n data.data.data2 = new Uint8Array(data.data2);\n }\n /* falls through */\n default:\n data.data = data.data || {};\n data.data.frag = this.frag;\n data.data.id = this.id;\n hls.trigger(data.event, data.data);\n break;\n }\n }\n}\n\nexport default Demuxer;\n\n\n\n\n// WEBPACK FOOTER //\n// src/demux/demuxer.js","/**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.\n*/\n\nimport {logger} from '../utils/logger';\n\nclass ExpGolomb {\n\n constructor(data) {\n this.data = data;\n // the number of bytes left to examine in this.data\n this.bytesAvailable = 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 loadWord() {\n var\n data = this.data,\n bytesAvailable = this.bytesAvailable,\n position = data.byteLength - bytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, bytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(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 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 readBits(size) {\n var\n bits = Math.min(this.bitsAvailable, size), // :uint\n valu = this.word >>> (32 - bits); // :uint\n if (size > 32) {\n 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 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 skipUEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():void\n skipEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():uint\n readUEG() {\n var clz = this.skipLZ(); // :uint\n return this.readBits(clz + 1) - 1;\n }\n\n // ():int\n 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 readBoolean() {\n return 1 === this.readBits(1);\n }\n\n // ():int\n readUByte() {\n return this.readBits(8);\n }\n\n // ():int\n readUShort() {\n return this.readBits(16);\n }\n // ():int\n 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 skipScalingList(count) {\n var\n 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 readSPS() {\n var\n frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n profileIdc,profileCompat,levelIdc,\n numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n i,\n readUByte = this.readUByte.bind(this),\n readBits = this.readBits.bind(this),\n readUEG = this.readUEG.bind(this),\n readBoolean = this.readBoolean.bind(this),\n skipBits = this.skipBits.bind(this),\n skipEG = this.skipEG.bind(this),\n skipUEG = this.skipUEG.bind(this),\n skipScalingList = this.skipScalingList.bind(this);\n\n readUByte();\n profileIdc = readUByte(); // profile_idc\n profileCompat = readBits(5); // constraint_set[0-4]_flag, u(5)\n skipBits(3); // reserved_zero_3bits u(3),\n levelIdc = readUByte(); //level_idc u(8)\n skipUEG(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n if (profileIdc === 100 ||\n profileIdc === 110 ||\n profileIdc === 122 ||\n profileIdc === 244 ||\n profileIdc === 44 ||\n profileIdc === 83 ||\n profileIdc === 86 ||\n profileIdc === 118 ||\n profileIdc === 128) {\n var chromaFormatIdc = readUEG();\n if (chromaFormatIdc === 3) {\n skipBits(1); // separate_colour_plane_flag\n }\n skipUEG(); // bit_depth_luma_minus8\n skipUEG(); // bit_depth_chroma_minus8\n skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (readBoolean()) { // seq_scaling_matrix_present_flag\n scalingListCount = (chromaFormatIdc !== 3) ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (readBoolean()) { // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16);\n } else {\n skipScalingList(64);\n }\n }\n }\n }\n }\n skipUEG(); // log2_max_frame_num_minus4\n var picOrderCntType = readUEG();\n if (picOrderCntType === 0) {\n readUEG(); //log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n skipBits(1); // delta_pic_order_always_zero_flag\n skipEG(); // offset_for_non_ref_pic\n skipEG(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = readUEG();\n for(i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n skipEG(); // offset_for_ref_frame[ i ]\n }\n }\n skipUEG(); // max_num_ref_frames\n skipBits(1); // gaps_in_frame_num_value_allowed_flag\n picWidthInMbsMinus1 = readUEG();\n picHeightInMapUnitsMinus1 = readUEG();\n frameMbsOnlyFlag = readBits(1);\n if (frameMbsOnlyFlag === 0) {\n skipBits(1); // mb_adaptive_frame_field_flag\n }\n skipBits(1); // direct_8x8_inference_flag\n if (readBoolean()) { // frame_cropping_flag\n frameCropLeftOffset = readUEG();\n frameCropRightOffset = readUEG();\n frameCropTopOffset = readUEG();\n frameCropBottomOffset = readUEG();\n }\n let pixelRatio = [1,1];\n if (readBoolean()) {\n // vui_parameters_present_flag\n if (readBoolean()) {\n // aspect_ratio_info_present_flag\n const aspectRatioIdc = readUByte();\n switch (aspectRatioIdc) {\n case 1: pixelRatio = [1,1]; break;\n case 2: pixelRatio = [12,11]; break;\n case 3: pixelRatio = [10,11]; break;\n case 4: pixelRatio = [16,11]; break;\n case 5: pixelRatio = [40,33]; break;\n case 6: pixelRatio = [24,11]; break;\n case 7: pixelRatio = [20,11]; break;\n case 8: pixelRatio = [32,11]; break;\n case 9: pixelRatio = [80,33]; break;\n case 10: pixelRatio = [18,11]; break;\n case 11: pixelRatio = [15,11]; break;\n case 12: pixelRatio = [64,33]; break;\n case 13: pixelRatio = [160,99]; break;\n case 14: pixelRatio = [4,3]; break;\n case 15: pixelRatio = [3,2]; break;\n case 16: pixelRatio = [2,1]; break;\n case 255: {\n pixelRatio = [readUByte() << 8 | readUByte(), readUByte() << 8 | readUByte()];\n break;\n }\n }\n }\n }\n return {\n width: Math.ceil((((picWidthInMbsMinus1 + 1) * 16) - frameCropLeftOffset * 2 - frameCropRightOffset * 2)),\n height: ((2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16) - ((frameMbsOnlyFlag? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset)),\n pixelRatio : pixelRatio\n };\n }\n\n 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\nexport default ExpGolomb;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/exp-golomb.js","/**\n * ID3 parser\n */\nimport {logger} from '../utils/logger';\n//import Hex from '../utils/hex';\n\n class ID3 {\n\n constructor(data) {\n this._hasTimeStamp = false;\n this._length = 0;\n var offset = 0, byte1,byte2,byte3,byte4,tagSize,endPos,header,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.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.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 readUTF(data,start,len) {\n\n var result = '',offset = start, end = start + len;\n do {\n result += String.fromCharCode(data[offset++]);\n } while(offset < end);\n return result;\n }\n\n _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 +\n data[offset++] << 16 +\n data[offset++] << 8 +\n data[offset++];\n\n tagFlags = data[offset++] << 8 +\n 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) +\n (data[offset++] << 15) +\n (data[offset++] << 7) +\n data[offset++]) /45;\n\n if (pts33Bit) {\n timestamp += 47721858.84; // 2^32 / 90\n }\n timestamp = Math.round(timestamp);\n logger.trace(`ID3 timestamp found: ${timestamp}`);\n this._timeStamp = timestamp;\n }\n break;\n default:\n break;\n }\n }\n }\n\n get hasTimeStamp() {\n return this._hasTimeStamp;\n }\n\n get timeStamp() {\n return this._timeStamp;\n }\n\n get length() {\n return this._length;\n }\n\n get payload() {\n return this._payload;\n }\n\n}\n\nexport default ID3;\n\n\n\n\n// WEBPACK FOOTER //\n// src/demux/id3.js","/**\n * MP3 demuxer\n */\nimport ID3 from '../demux/id3';\nimport MpegAudio from './mpegaudio';\n\n class MP3Demuxer {\n\n constructor(observer, remuxer, config) {\n this.observer = observer;\n this.config = config;\n this.remuxer = remuxer;\n }\n\n resetInitSegment(initSegment,audioCodec,videoCodec, duration) {\n this._audioTrack = {container : 'audio/mpeg', type: 'audio', id :-1, sequenceNumber: 0, isAAC : false , samples : [], len : 0, manifestCodec : audioCodec, duration : duration, inputTimeScale : 90000};\n }\n\n resetTimeStamp() {\n }\n\n static probe(data) {\n // check if data contains ID3 timestamp and MPEG sync word\n var id3 = new ID3(data), offset, length;\n if (id3.hasTimeStamp) {\n // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1\n // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)\n // More info http://www.mp3-tech.org/programmer/frame_header.html\n for (offset = id3.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {\n if ((data[offset] === 0xff) && (data[offset+1] & 0xe0) === 0xe0 && (data[offset+1] & 0x06) !== 0x00) {\n //logger.log('MPEG sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset,contiguous,accurateTimeOffset) {\n var id3 = new ID3(data);\n var pts = 90*id3.timeStamp;\n var afterID3 = id3.length;\n var offset, length;\n\n // Look for MPEG header\n for (offset = afterID3, length = data.length; offset < length - 1; offset++) {\n if ((data[offset] === 0xff) && (data[offset+1] & 0xe0) === 0xe0 && (data[offset+1] & 0x06) !== 0x00) {\n break;\n }\n }\n\n MpegAudio.parse(this._audioTrack, data, id3.length, pts);\n\n this.remuxer.remux(this._audioTrack,\n {samples : []},\n {samples : [ { pts: pts, dts : pts, data : id3.payload}], inputTimeScale : 90000},\n {samples : []},\n timeOffset,\n contiguous,\n accurateTimeOffset);\n }\n\n destroy() {\n }\n}\n\nexport default MP3Demuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/mp3demuxer.js","/**\n * MP4 demuxer\n */\n//import {logger} from '../utils/logger';\nimport Event from '../events';\n\n\n class MP4Demuxer {\n\n constructor(observer, remuxer) {\n this.observer = observer;\n this.remuxer = remuxer;\n }\n\n resetTimeStamp() {\n\n }\n\n resetInitSegment(initSegment,audioCodec,videoCodec, duration) {\n //jshint unused:false\n const initData = this.initData = MP4Demuxer.parseInitSegment(initSegment);\n var tracks = {};\n if (initData.audio) {\n tracks.audio = { container : 'audio/mp4', codec : audioCodec, initSegment : initSegment};\n }\n if (initData.video) {\n tracks.video = { container : 'video/mp4', codec : videoCodec, initSegment : initSegment};\n }\n this.observer.trigger(Event.FRAG_PARSING_INIT_SEGMENT,{ tracks : tracks });\n }\n\n static probe(data) {\n if (data.length >= 8) {\n const dataType = MP4Demuxer.bin2str(data.subarray(4,8));\n return (['moof','ftyp','styp'].indexOf(dataType) >= 0);\n }\n return false;\n }\n\n\n static bin2str(buffer) {\n return String.fromCharCode.apply(null, buffer);\n }\n\n static readUint32(buffer, offset) {\n const val = buffer[offset] << 24 |\n buffer[offset + 1] << 16 |\n buffer[offset + 2] << 8 |\n buffer[offset + 3];\n return val < 0 ? 4294967296 + val : val;\n }\n\n // Find the data for a box specified by its path\n static findBox(data, path) {\n var results = [],\n i, size, type, end, subresults;\n\n if (!path.length) {\n // short-circuit the search for empty paths\n return null;\n }\n\n for (i = 0; i < data.byteLength;) {\n size = MP4Demuxer.readUint32(data, i);\n type = MP4Demuxer.bin2str(data.subarray(i + 4, i + 8));\n\n end = size > 1 ? i + size : data.byteLength;\n\n if (type === path[0]) {\n if (path.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push(data.subarray(i + 8, end));\n } else {\n // recursively search for the next box along the path\n subresults = MP4Demuxer.findBox(data.subarray(i + 8, end), path.slice(1));\n if (subresults.length) {\n results = results.concat(subresults);\n }\n }\n }\n i = end;\n }\n\n // we've finished searching all of data\n return results;\n }\n\n\n\n/**\n * Parses an MP4 initialization segment and extracts stream type and\n * timescale values for any declared tracks. Timescale values indicate the\n * number of clock ticks per second to assume for time-based values\n * elsewhere in the MP4.\n *\n * To determine the start time of an MP4, you need two pieces of\n * information: the timescale unit and the earliest base media decode\n * time. Multiple timescales can be specified within an MP4 but the\n * base media decode time is always expressed in the timescale from\n * the media header box for the track:\n * ```\n * moov > trak > mdia > mdhd.timescale\n * moov > trak > mdia > hdlr\n * ```\n * @param init {Uint8Array} the bytes of the init segment\n * @return {object} a hash of track type to timescale values or null if\n * the init segment is malformed.\n */\n static parseInitSegment(initSegment) {\n var result = [];\n var traks = MP4Demuxer.findBox(initSegment, ['moov', 'trak']);\n\n traks.forEach(trak => {\n const tkhd = MP4Demuxer.findBox(trak, ['tkhd'])[0];\n if (tkhd) {\n let version = tkhd[0];\n let index = version === 0 ? 12 : 20;\n let trackId = MP4Demuxer.readUint32(tkhd, index);\n\n const mdhd = MP4Demuxer.findBox(trak, ['mdia', 'mdhd'])[0];\n if (mdhd) {\n version = mdhd[0];\n index = version === 0 ? 12 : 20;\n const timescale = MP4Demuxer.readUint32(mdhd, index);\n\n const hdlr = MP4Demuxer.findBox(trak, ['mdia', 'hdlr'])[0];\n if (hdlr) {\n const hdlrType = MP4Demuxer.bin2str(hdlr.subarray(8, 12));\n let type = { 'soun' : 'audio', 'vide' : 'video'}[hdlrType];\n if (type) {\n result[trackId] = { timescale : timescale , type : type};\n result[type] = { timescale : timescale , id : trackId};\n }\n }\n }\n }\n });\n return result;\n }\n\n\n/**\n * Determine the base media decode start time, in seconds, for an MP4\n * fragment. If multiple fragments are specified, the earliest time is\n * returned.\n *\n * The base media decode time can be parsed from track fragment\n * metadata:\n * ```\n * moof > traf > tfdt.baseMediaDecodeTime\n * ```\n * It requires the timescale value from the mdhd to interpret.\n *\n * @param timescale {object} a hash of track ids to timescale values.\n * @return {number} the earliest base media decode start time for the\n * fragment, in seconds\n */\nstatic startDTS(initData, fragment) {\n var trafs, baseTimes, result;\n\n // we need info from two childrend of each track fragment box\n trafs = MP4Demuxer.findBox(fragment, ['moof', 'traf']);\n\n // determine the start times for each track\n baseTimes = [].concat.apply([], trafs.map(function(traf) {\n return MP4Demuxer.findBox(traf, ['tfhd']).map(function(tfhd) {\n var id, scale, baseTime;\n\n // get the track id from the tfhd\n id = MP4Demuxer.readUint32(tfhd, 4);\n // assume a 90kHz clock if no timescale was specified\n scale = initData[id].timescale || 90e3;\n\n // get the base media decode time from the tfdt\n baseTime = MP4Demuxer.findBox(traf, ['tfdt']).map(function(tfdt) {\n var version, result;\n\n version = tfdt[0];\n result = MP4Demuxer.readUint32(tfdt, 4);\n if (version === 1) {\n result *= Math.pow(2, 32);\n\n result += MP4Demuxer.readUint32(tfdt, 8);\n }\n return result;\n })[0];\n baseTime = baseTime || Infinity;\n\n // convert base time to seconds\n return baseTime / scale;\n });\n }));\n\n // return the minimum\n result = Math.min.apply(null, baseTimes);\n return isFinite(result) ? result : 0;\n}\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset,contiguous,accurateTimeOffset) {\n const initData = this.initData;\n const startDTS = MP4Demuxer.startDTS(initData,data);\n this.remuxer.remux(initData.audio, initData.video, null, null, startDTS, contiguous,accurateTimeOffset,data);\n }\n\n destroy() {\n }\n\n}\n\nexport default MP4Demuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/mp4demuxer.js","/**\n * MPEG parser helper\n */\nimport {logger} from '../utils/logger';\n\nconst MpegAudio = {\n\n onFrame: function(track, data, bitRate, sampleRate, channelCount, frameIndex, pts) {\n var frameDuration = 1152 * 90000 / sampleRate;\n var stamp = pts + frameIndex * frameDuration;\n\n track.config = [];\n track.channelCount = channelCount;\n track.samplerate = sampleRate;\n track.samples.push({unit: data, pts: stamp, dts: stamp});\n track.len += data.length;\n },\n\n onNoise: function(data) {\n logger.warn('mpeg audio has noise: ' + data.length + ' bytes');\n },\n\n parseFrames: function(track, data, start, end, frameIndex, pts) {\n var BitratesMap = [\n 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448,\n 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384,\n 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320,\n 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256,\n 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160];\n var SamplingRateMap = [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000];\n\n if (start + 2 > end) {\n return -1; // we need at least 2 bytes to detect sync pattern\n }\n if (data[start] === 0xFF || (data[start + 1] & 0xE0) === 0xE0) {\n // Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference\n if (start + 24 > end) {\n return -1;\n }\n var headerB = (data[start + 1] >> 3) & 3;\n var headerC = (data[start + 1] >> 1) & 3;\n var headerE = (data[start + 2] >> 4) & 15;\n var headerF = (data[start + 2] >> 2) & 3;\n var headerG = !!(data[start + 2] & 2);\n if (headerB !== 1 && headerE !== 0 && headerE !== 15 && headerF !== 3) {\n var columnInBitrates = headerB === 3 ? (3 - headerC) : (headerC === 3 ? 3 : 4);\n var bitRate = BitratesMap[columnInBitrates * 14 + headerE - 1] * 1000;\n var columnInSampleRates = headerB === 3 ? 0 : headerB === 2 ? 1 : 2;\n var sampleRate = SamplingRateMap[columnInSampleRates * 3 + headerF];\n var padding = headerG ? 1 : 0;\n var channelCount = data[start + 3] >> 6 === 3 ? 1 : 2; // If bits of channel mode are `11` then it is a single channel (Mono)\n var frameLength = headerC === 3 ?\n ((headerB === 3 ? 12 : 6) * bitRate / sampleRate + padding) << 2 :\n ((headerB === 3 ? 144 : 72) * bitRate / sampleRate + padding) | 0;\n if (start + frameLength > end) {\n return -1;\n }\n\n this.onFrame(track, data.subarray(start, start + frameLength), bitRate, sampleRate, channelCount, frameIndex, pts);\n\n return frameLength;\n }\n }\n // noise or ID3, trying to skip\n var offset = start + 2;\n while (offset < end) {\n if (data[offset - 1] === 0xFF && (data[offset] & 0xE0) === 0xE0) {\n // sync pattern is found\n this.onNoise(data.subarray(start, offset - 1));\n\n return offset - start - 1;\n }\n offset++;\n }\n return -1;\n },\n\n parse: function(track, data, offset, pts) {\n var length = data.length;\n var frameIndex = 0;\n var parsed;\n\n while (offset < length &&\n (parsed = this.parseFrames(track, data, offset, length, frameIndex++, pts)) > 0) {\n offset += parsed;\n }\n }\n};\n\nmodule.exports = MpegAudio;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/mpegaudio.js","/**\n * SAMPLE-AES decrypter\n*/\n\n import Decrypter from '../crypt/decrypter';\n\n class SampleAesDecrypter {\n\n constructor(observer, config, decryptdata, discardEPB) {\n this.decryptdata = decryptdata;\n this.discardEPB = discardEPB;\n this.decrypter = new Decrypter(observer, config);\n }\n\n decryptBuffer(encryptedData, callback) {\n this.decrypter.decrypt(encryptedData, this.decryptdata.key.buffer, this.decryptdata.iv.buffer, callback);\n }\n\n // AAC - encrypt all full 16 bytes blocks starting from offset 16\n decryptAacSample(samples, sampleIndex, callback, sync) {\n let curUnit = samples[sampleIndex].unit;\n let encryptedData = curUnit.subarray(16, curUnit.length - curUnit.length % 16);\n let encryptedBuffer = encryptedData.buffer.slice(\n encryptedData.byteOffset,\n encryptedData.byteOffset + encryptedData.length);\n\n let localthis = this;\n this.decryptBuffer(encryptedBuffer, function (decryptedData) {\n decryptedData = new Uint8Array(decryptedData);\n curUnit.set(decryptedData, 16);\n\n if (!sync) {\n localthis.decryptAacSamples(samples, sampleIndex + 1, callback);\n }\n });\n }\n\n decryptAacSamples(samples, sampleIndex, callback) {\n for (;; sampleIndex++) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n\n if (samples[sampleIndex].unit.length < 32) {\n continue;\n }\n\n let sync = this.decrypter.isSync();\n\n this.decryptAacSample(samples, sampleIndex, callback, sync);\n\n if (!sync) {\n return;\n }\n }\n }\n\n // AVC - encrypt one 16 bytes block out of ten, starting from offset 32\n getAvcEncryptedData(decodedData) {\n let encryptedDataLen = Math.floor((decodedData.length - 48) / 160) * 16 + 16;\n let encryptedData = new Int8Array(encryptedDataLen);\n let outputPos = 0;\n for (let inputPos = 32; inputPos <= decodedData.length - 16; inputPos += 160, outputPos += 16) {\n encryptedData.set(decodedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return encryptedData;\n }\n\n getAvcDecryptedUnit(decodedData, decryptedData) {\n decryptedData = new Uint8Array(decryptedData);\n let inputPos = 0;\n for (let outputPos = 32; outputPos <= decodedData.length - 16; outputPos += 160, inputPos += 16) {\n decodedData.set(decryptedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return decodedData;\n }\n\n decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync) {\n let decodedData = this.discardEPB(curUnit.data);\n let encryptedData = this.getAvcEncryptedData(decodedData);\n let localthis = this;\n\n this.decryptBuffer(encryptedData.buffer, function (decryptedData) {\n curUnit.data = localthis.getAvcDecryptedUnit(decodedData, decryptedData);\n\n if (!sync) {\n localthis.decryptAvcSamples(samples, sampleIndex, unitIndex + 1, callback);\n }\n });\n }\n\n decryptAvcSamples(samples, sampleIndex, unitIndex, callback) {\n for (;; sampleIndex++, unitIndex = 0) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n\n let curUnits = samples[sampleIndex].units;\n for (;; unitIndex++) {\n if (unitIndex >= curUnits.length) {\n break;\n }\n\n let curUnit = curUnits[unitIndex];\n if (curUnit.length <= 48 || (curUnit.type !== 1 && curUnit.type !== 5)) {\n continue;\n }\n\n let sync = this.decrypter.isSync();\n\n this.decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync);\n\n if (!sync) {\n return;\n }\n }\n }\n }\n }\n\n export default SampleAesDecrypter;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/sample-aes.js","/**\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 ADTS from './adts';\n import MpegAudio from './mpegaudio';\n import Event from '../events';\n import ExpGolomb from './exp-golomb';\n import SampleAesDecrypter from './sample-aes';\n// import Hex from '../utils/hex';\n import {logger} from '../utils/logger';\n import {ErrorTypes, ErrorDetails} from '../errors';\n\n class TSDemuxer {\n\n constructor(observer, remuxer, config, typeSupported) {\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n this.remuxer = remuxer;\n this.sampleAes = null;\n }\n\n setDecryptData(decryptdata) {\n if ((decryptdata != null) && (decryptdata.key != null) && (decryptdata.method === 'SAMPLE-AES')) {\n this.sampleAes = new SampleAesDecrypter(this.observer, this.config, decryptdata, this.discardEPB);\n } else {\n this.sampleAes = null;\n }\n }\n\n static 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 resetInitSegment(initSegment,audioCodec,videoCodec, duration) {\n this.pmtParsed = false;\n this._pmtId = -1;\n this._avcTrack = {container : 'video/mp2t', type: 'video', id :-1, inputTimeScale : 90000, sequenceNumber: 0, samples : [], len : 0, dropped : 0};\n this._audioTrack = {container : 'video/mp2t', type: 'audio', id :-1, inputTimeScale : 90000, duration: duration, sequenceNumber: 0, samples : [], len : 0, isAAC: true};\n this._id3Track = {type: 'id3', id :-1, inputTimeScale : 90000, sequenceNumber: 0, samples : [], len : 0};\n this._txtTrack = {type: 'text', id: -1, inputTimeScale : 90000, sequenceNumber: 0, samples : [], len : 0};\n // flush any partial content\n this.aacOverFlow = null;\n this.aacLastPTS = null;\n this.avcSample = null;\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this._duration = duration;\n }\n\n resetTimeStamp() {\n }\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset, contiguous,accurateTimeOffset) {\n var start, len = data.length, stt, pid, atf, offset,pes,\n unknownPIDs = false;\n this.contiguous = contiguous;\n var pmtParsed = this.pmtParsed,\n avcTrack = this._avcTrack,\n audioTrack = this._audioTrack,\n id3Track = this._id3Track,\n avcId = avcTrack.id,\n audioId = audioTrack.id,\n id3Id = id3Track.id,\n pmtId = this._pmtId,\n avcData = avcTrack.pesData,\n audioData = audioTrack.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 parseMPEGPES = this._parseMPEGPES.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 }\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 audioId:\n if (stt) {\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n }\n audioData = {data: [], size: 0};\n }\n if (audioData) {\n audioData.data.push(data.subarray(offset, start + 188));\n audioData.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 let parsedPIDs = parsePMT(data, offset, this.typeSupported.mpeg === true || this.typeSupported.mp3 === true, this.sampleAes != null);\n\n // only update track id if track PID found while parsing PMT\n // this is to avoid resetting the PID to -1 in case\n // track PID transiently disappears from the stream\n // this could happen in case of transient missing audio samples for example\n avcId = parsedPIDs.avc;\n if (avcId > 0) {\n avcTrack.id = avcId;\n }\n audioId = parsedPIDs.audio;\n if (audioId > 0) {\n audioTrack.id = audioId;\n audioTrack.isAAC = parsedPIDs.isAAC;\n }\n id3Id = parsedPIDs.id3;\n if (id3Id > 0) {\n id3Track.id = id3Id;\n }\n if (unknownPIDs && !pmtParsed) {\n 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(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details: 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 (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n audioTrack.pesData = null;\n } else {\n if (audioData && audioData.size) {\n logger.log('last AAC PES packet truncated,might overlap between fragments');\n }\n // either audioData null or PES truncated, keep it for next frag parsing\n audioTrack.pesData = audioData;\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\n if (this.sampleAes == null) {\n this.remuxer.remux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);\n } else {\n this.decryptAndRemux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n\n decryptAndRemux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n if (audioTrack.samples && audioTrack.isAAC) {\n let localthis = this;\n this.sampleAes.decryptAacSamples(audioTrack.samples, 0, function() {\n localthis.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n });\n } else {\n this.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n\n decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n if (videoTrack.samples) {\n let localthis = this;\n this.sampleAes.decryptAvcSamples(videoTrack.samples, 0, 0, function () {\n localthis.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n });\n } else {\n this.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n\n destroy() {\n this._initPTS = this._initDTS = undefined;\n this._duration = 0;\n }\n\n _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 _parsePMT(data, offset, mpegSupported, isSampleAes) {\n var sectionLength, tableEnd, programInfoLength, pid, result = { audio : -1, avc : -1, id3 : -1, isAAC : true};\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 case 0xcf: // SAMPLE-AES AAC\n if (!isSampleAes) {\n logger.log('unkown stream type:' + data[offset]);\n break;\n }\n /* falls through */\n\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.audio === -1) {\n result.audio = pid;\n }\n break;\n\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\n case 0xdb: // SAMPLE-AES AVC\n if (!isSampleAes) {\n logger.log('unkown stream type:' + data[offset]);\n break;\n }\n /* falls through */\n\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\n // ISO/IEC 11172-3 (MPEG-1 audio)\n // or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)\n case 0x03:\n case 0x04:\n //logger.log('MPEG PID:' + pid);\n if (!mpegSupported) {\n logger.log('MPEG audio found, not supported in this browser for now');\n } else if (result.audio === -1) {\n result.audio = pid;\n result.isAAC = false;\n }\n break;\n\n case 0x24:\n logger.warn('HEVC stream type found, not supported for now');\n break;\n\n default:\n 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 _parsePES(stream) {\n var i = 0, frag, pesFlags, pesPrefix, pesLen, pesHdrLen, pesData, pesPts, pesDts, payloadStartOffset, 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 let 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 parsed length is not zero and greater than total received length, 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 if (pesPts - pesDts > 60*90000) {\n logger.warn(`${Math.round((pesPts - pesDts)/90000)}s delta between PTS and DTS, align them`);\n pesPts = pesDts;\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 for( let j = 0, dataLen = data.length; j < dataLen ; j++) {\n frag = data[j];\n let 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 pushAccesUnit(avcSample,avcTrack) {\n if (avcSample.units.length && avcSample.frame) {\n const samples = avcTrack.samples;\n const nbSamples = samples.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 ||\n avcSample.key === true ||\n (avcTrack.sps && (nbSamples || this.contiguous))) {\n avcSample.id = nbSamples;\n samples.push(avcSample);\n } else {\n // dropped samples, track it\n avcTrack.dropped++;\n }\n }\n if(avcSample.debug.length) {\n logger.log(avcSample.pts + '/' + avcSample.dts + ':' + avcSample.debug);\n }\n }\n\n _parseAVCPES(pes,last) {\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(unit => {\n switch(unit.type) {\n //NDR\n case 1:\n push = true;\n if(debug && avcSample) {\n avcSample.debug += 'NDR ';\n }\n avcSample.frame = true;\n // retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR\n let data = unit.data;\n if (data.length > 4) {\n let sliceType = new ExpGolomb(data).readSliceType();\n // 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice\n // SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.\n // An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.\n // I slice: A slice that is not an SI slice that is decoded using intra prediction only.\n //if (sliceType === 2 || sliceType === 7) {\n if (sliceType === 2 || sliceType === 4 || sliceType === 7 || sliceType === 9) {\n avcSample.key = true;\n }\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 avcSample.frame = true;\n break;\n //SEI\n case 6:\n push = true;\n if(debug && avcSample) {\n avcSample.debug += 'SEI ';\n }\n expGolombDecoder = new ExpGolomb(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 }\n else if (payloadSize < expGolombDecoder.bytesAvailable)\n {\n for (i = 0; i<payloadSize; i++)\n {\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 ExpGolomb(unit.data);\n var config = expGolombDecoder.readSPS();\n track.width = config.width;\n track.height = config.height;\n track.pixelRatio = config.pixelRatio;\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 let units = avcSample.units;\n 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 _createAVCSample(key,pts,dts,debug) {\n return { key : key, pts : pts, dts : dts, units : [], debug : debug};\n }\n\n _insertSampleInOrder(arr, data) {\n var len = arr.length;\n if (len > 0) {\n if (data.pts >= arr[len-1].pts)\n {\n arr.push(data);\n }\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 }\n else {\n arr.push(data);\n }\n }\n\n _getLastNalUnit() {\n let avcSample = this.avcSample, lastUnit;\n // try to fallback to previous sample if current one is empty\n if (!avcSample || avcSample.units.length === 0) {\n let track = this._avcTrack, samples = track.samples;\n avcSample = samples[samples.length-1];\n }\n if (avcSample) {\n let units = avcSample.units;\n lastUnit = units[units.length - 1];\n }\n return lastUnit;\n }\n\n _parseAVCNALu(array) {\n var i = 0, len = array.byteLength, value, overflow, track = this._avcTrack, state = track.naluState || 0, lastState = state;\n var units = [], unit, unitType, lastUnitStart = -1, lastUnitType;\n //logger.log('PES:' + Hex.hexDump(array));\n\n if (state === -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 = array[0] & 0x1f;\n state = 0;\n i = 1;\n }\n\n while (i < len) {\n value = array[i++];\n // optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case\n if (!state) {\n state = value ? 0 : 1;\n continue;\n }\n if (state === 1) {\n state = value ? 0 : 2;\n continue;\n }\n // here we have state either equal to 2 or 3\n if(!value) {\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 let 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 let 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 }\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 let lastUnit = this._getLastNalUnit();\n if (lastUnit) {\n let 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 discardEPB(data) {\n var length = data.byteLength,\n EPBPositions = [],\n i = 1,\n newLength, newData;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 &&\n data[i + 1] === 0 &&\n 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 _parseAACPES(pes) {\n var track = this._audioTrack,\n data = pes.data,\n pts = pes.pts,\n startOffset = 0,\n aacOverFlow = this.aacOverFlow,\n aacLastPTS = this.aacLastPTS,\n config, frameLength, frameDuration, frameIndex, offset, headerLength, stamp, len, 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.warn(`parsing error:${reason}`);\n this.observer.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason});\n if (fatal) {\n return;\n }\n }\n if (!track.samplerate) {\n const audioCodec = this.audioCodec;\n config = ADTS.getAudioConfig(this.observer,data, offset, audioCodec);\n track.config = config.config;\n track.samplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n logger.log(`parsed codec:${track.codec},rate:${config.samplerate},nb channel:${config.channelCount}`);\n }\n frameIndex = 0;\n frameDuration = 1024 * 90000 / track.samplerate;\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.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) |\n (data[offset + 4] << 3) |\n ((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 _parseMPEGPES(pes) {\n MpegAudio.parse(this._audioTrack, pes.data, 0, pes.pts);\n }\n\n _parseID3PES(pes) {\n this._id3Track.samples.push(pes);\n }\n}\n\nexport default TSDemuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/tsdemuxer.js","export const 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 a mux Error (demuxing/remuxing)\n MUX_ERROR: 'muxError',\n // Identifier for all other errors\n OTHER_ERROR: 'otherError'\n};\n\nexport const 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: {id : demuxer Id,frag: fragment object, reason : parsing error description }\n FRAG_DECRYPT_ERROR: 'fragDecryptError',\n // Identifier for a fragment parsing error event - data: { id : demuxer Id, reason : parsing error description }\n // will be renamed DEMUX_PARSING_ERROR and switched to MUX_ERROR in the next major release\n FRAG_PARSING_ERROR: 'fragParsingError',\n // 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 }\n REMUX_ALLOC_ERROR : 'remuxAllocError',\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 a buffer nudge on stall (playback is stuck although currentTime is in a buffered area)\n BUFFER_NUDGE_ON_STALL : 'bufferNudgeOnStall',\n // Identifier for an internal exception happening inside hls.js while handling an event\n INTERNAL_EXCEPTION: 'internalException',\n // Malformed WebVTT contents\n WEBVTT_EXCEPTION: 'webVTTException'\n};\n\n\n\n// WEBPACK FOOTER //\n// src/errors.js","/*\n*\n* All objects in the event handling chain should inherit from this class\n*\n*/\n\nimport {logger} from './utils/logger';\nimport {ErrorTypes, ErrorDetails} from './errors';\nimport Event from './events';\n\nclass EventHandler {\n\n constructor(hls, ...events) {\n this.hls = hls;\n this.onEvent = this.onEvent.bind(this);\n this.handledEvents = events;\n this.useGenericHandler = true;\n\n this.registerListeners();\n }\n\n destroy() {\n this.unregisterListeners();\n }\n\n isEventHandler() {\n return typeof this.handledEvents === 'object' && this.handledEvents.length && typeof this.onEvent === 'function';\n }\n\n 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 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 onEvent(event, data) {\n this.onEventGeneric(event, data);\n }\n\n onEventGeneric(event, data) {\n var eventToFunction = function(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.error(`internal error happened while processing ${event}:${err.message}`);\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.OTHER_ERROR, details: ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event : event, err : err});\n }\n }\n}\n\nexport default EventHandler;\n\n\n\n// WEBPACK FOOTER //\n// src/event-handler.js","module.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 reset - data: { }\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, pending : nb of segments waiting for appending for this segment parent}\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 - 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 buffer has been flushed - data: { }\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 switch is requested - data: { level : id of new level } // deprecated in favor LEVEL_SWITCHING\n LEVEL_SWITCH: 'hlsLevelSwitch',\n // fired when a level switch is requested - data: { level : id of new level }\n LEVEL_SWITCHING: 'hlsLevelSwitching',\n // fired when a level switch is effective - data: { level : id of new level }\n LEVEL_SWITCHED: 'hlsLevelSwitched',\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 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 } // deprecated in favor AUDIO_TRACK_SWITCHING\n AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',\n // fired when an audio track switching is requested - data: { id : audio track id }\n AUDIO_TRACK_SWITCHING: 'hlsAudioTrackSwitching',\n // fired when an audio track switch actually occurs - data: { id : audio track id }\n AUDIO_TRACK_SWITCHED: 'hlsAudioTrackSwitched',\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 to notify that subtitle track lists has been updated - data: { subtitleTracks : subtitleTracks }\n SUBTITLE_TRACKS_UPDATED: 'hlsSubtitleTracksUpdated',\n // fired when an subtitle track switch occurs - data: { id : subtitle track id }\n SUBTITLE_TRACK_SWITCH: 'hlsSubtitleTrackSwitch',\n // fired when a subtitle track loading starts - data: { url : subtitle track URL, id : subtitle track id }\n SUBTITLE_TRACK_LOADING: 'hlsSubtitleTrackLoading',\n // fired when a subtitle track loading finishes - data: { details : levelDetails object, id : subtitle track id, stats : { trequest, tfirst, tload, mtime } }\n SUBTITLE_TRACK_LOADED: 'hlsSubtitleTrackLoaded',\n // fired when a subtitle fragment has been processed - data: { success : boolean, frag : the processed frag }\n SUBTITLE_FRAG_PROCESSED: 'hlsSubtitleFragProcessed',\n // fired when the first timestamp is found - data: { id : demuxer id, initPTS: initPTS, frag : fragment object }\n INIT_PTS_FOUND: 'hlsInitPtsFound',\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 a fragment has finished decrypting - data: { id : demuxer id, frag: fragment object, stats : { tstart, tdecrypt } }\n FRAG_DECRYPTED: 'hlsFragDecrypted',\n // 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 }\n FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',\n // fired when parsing sei text is completed - data: { id : demuxer id, frag: fragment object, samples : [ sei samples pes ] }\n FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',\n // fired when parsing id3 is completed - data: { id : demuxer id, frag: fragment object, samples : [ id3 samples pes ] }\n FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',\n // 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}\n FRAG_PARSING_DATA: 'hlsFragParsingData',\n // fired when fragment parsing is completed - data: { id : demuxer id, frag: fragment object }\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, bwEstimate } }\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 - data: { }\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\n\n// WEBPACK FOOTER //\n// src/events.js","/**\n * AAC helper\n */\n\nclass AAC {\n static getSilentFrame(codec,channelCount) {\n switch(codec) {\n case 'mp4a.40.2':\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 break;\n // handle HE-AAC below (mp4a.40.5 / mp4a.40.29)\n default:\n if (channelCount === 1) {\n // 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\n 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]);\n } else if (channelCount === 2) {\n // 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\n 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]);\n } else if (channelCount === 3) {\n // 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\n 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]);\n }\n break;\n }\n return null;\n }\n}\n\nexport default AAC;\n\n\n\n// WEBPACK FOOTER //\n// src/helper/aac.js","/**\n * Buffer Helper utils, providing methods dealing buffer length retrieval\n*/\n\nconst BufferHelper = {\n isBuffered : function(media,position) {\n if (media) {\n let buffered = media.buffered;\n for (let 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 bufferInfo : function(media, pos,maxHoleDuration) {\n if (media) {\n var vbuffered = media.buffered, buffered = [],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: pos, end: pos, nextStart : undefined} ;\n }\n },\n\n bufferedInfo : function(buffered,pos,maxHoleDuration) {\n var buffered2 = [],\n // bufferStart and bufferEnd are buffer boundaries around current video position\n bufferLen,bufferStart, bufferEnd,bufferStartNext,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\nmodule.exports = BufferHelper;\n\n\n\n// WEBPACK FOOTER //\n// src/helper/buffer-helper.js","/**\n * Level Helper class, providing methods dealing with playlist sliding and drift\n*/\n\nimport {logger} from '../utils/logger';\n\nconst LevelHelper = {\n\n mergeDetails : function(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 newFrag.backtracked = oldFrag.backtracked;\n newFrag.dropped = oldFrag.dropped;\n PTSFrag = newFrag;\n }\n }\n }\n\n if(ccOffset) {\n 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,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 updateFragPTSDTS : function(details,frag,startPTS,endPTS,startDTS,endDTS) {\n // update frag PTS/DTS\n if(!isNaN(frag.startPTS)) {\n // delta PTS between audio and video\n let 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 const drift = startPTS - frag.start;\n frag.start = frag.startPTS = startPTS;\n frag.endPTS = endPTS;\n frag.startDTS = startDTS;\n frag.endDTS = endDTS;\n frag.duration = endPTS - startPTS;\n\n const sn = frag.sn;\n // exit if sn out of range\n if (!details || sn < details.startSN || sn > details.endSN) {\n return 0;\n }\n var fragIdx, fragments, i;\n fragIdx = sn - details.startSN;\n fragments = details.fragments;\n frag = fragments[fragIdx];\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 updatePTS : function(fragments,fromIdx, toIdx) {\n var fragFrom = fragments[fromIdx],fragTo = fragments[toIdx], 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.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.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 = Math.max(fragFrom.start - fragTo.duration, 0);\n }\n }\n }\n};\n\nmodule.exports = LevelHelper;\n\n\n\n// WEBPACK FOOTER //\n// src/helper/level-helper.js","/**\n * HLS interface\n */\n'use strict';\n\nimport URLToolkit from 'url-toolkit';\nimport Event from './events';\nimport {ErrorTypes, ErrorDetails} from './errors';\nimport PlaylistLoader from './loader/playlist-loader';\nimport FragmentLoader from './loader/fragment-loader';\nimport KeyLoader from './loader/key-loader';\n\nimport StreamController from './controller/stream-controller';\nimport LevelController from './controller/level-controller';\nimport ID3TrackController from './controller/id3-track-controller';\n\nimport {logger, enableLogs} from './utils/logger';\nimport EventEmitter from 'events';\nimport {hlsDefaultConfig} from './config';\n\nclass Hls {\n\n static get version() {\n // replaced with browserify-versionify transform\n return '0.7.9';\n }\n\n static isSupported() {\n const mediaSource = window.MediaSource = window.MediaSource || window.WebKitMediaSource;\n const sourceBuffer = window.SourceBuffer = window.SourceBuffer || window.WebKitSourceBuffer;\n const isTypeSupported = mediaSource &&\n typeof mediaSource.isTypeSupported === 'function' &&\n mediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"');\n\n // if SourceBuffer is exposed ensure its API is valid\n // safari and old version of Chrome doe not expose SourceBuffer globally so checking SourceBuffer.prototype is impossible\n const sourceBufferValidAPI = !sourceBuffer ||\n (sourceBuffer.prototype &&\n typeof sourceBuffer.prototype.appendBuffer === 'function' &&\n typeof sourceBuffer.prototype.remove === 'function');\n return isTypeSupported && sourceBufferValidAPI;\n }\n\n static get Events() {\n return Event;\n }\n\n static get ErrorTypes() {\n return ErrorTypes;\n }\n\n static get ErrorDetails() {\n return ErrorDetails;\n }\n\n static get DefaultConfig() {\n if(!Hls.defaultConfig) {\n return hlsDefaultConfig;\n }\n return Hls.defaultConfig;\n }\n\n static set DefaultConfig(defaultConfig) {\n Hls.defaultConfig = defaultConfig;\n }\n\n constructor(config = {}) {\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) { continue; }\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 enableLogs(config.debug);\n this.config = config;\n this._autoLevelCapping = -1;\n // observer setup\n var observer = this.observer = new EventEmitter();\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...data);\n };\n this.on = observer.on.bind(observer);\n this.off = observer.off.bind(observer);\n this.trigger = observer.trigger.bind(observer);\n\n // core controllers and network loaders\n const abrController = this.abrController = new config.abrController(this);\n const bufferController = new config.bufferController(this);\n const capLevelController = new config.capLevelController(this);\n const fpsController = new config.fpsController(this);\n const playListLoader = new PlaylistLoader(this);\n const fragmentLoader = new FragmentLoader(this);\n const keyLoader = new KeyLoader(this);\n const id3TrackController = new ID3TrackController(this);\n\n // network controllers\n const levelController = this.levelController = new LevelController(this);\n const streamController = this.streamController = new StreamController(this);\n let networkControllers = [levelController, streamController];\n\n // optional audio stream controller\n let Controller = config.audioStreamController;\n if (Controller) {\n networkControllers.push(new Controller(this));\n }\n this.networkControllers = networkControllers;\n\n let coreComponents = [ playListLoader, fragmentLoader, keyLoader, abrController, bufferController, capLevelController, fpsController, id3TrackController ];\n\n // optional audio track and subtitle controller\n Controller = config.audioTrackController;\n if (Controller) {\n let audioTrackController = new Controller(this);\n this.audioTrackController = audioTrackController;\n coreComponents.push(audioTrackController);\n }\n\n Controller = config.subtitleTrackController;\n if (Controller) {\n let subtitleTrackController = new Controller(this);\n this.subtitleTrackController = subtitleTrackController;\n coreComponents.push(subtitleTrackController);\n }\n\n // optional subtitle controller\n [config.subtitleStreamController, config.timelineController].forEach(Controller => {\n if (Controller) {\n coreComponents.push(new Controller(this));\n }\n });\n this.coreComponents = coreComponents;\n }\n\n destroy() {\n logger.log('destroy');\n this.trigger(Event.DESTROYING);\n this.detachMedia();\n this.coreComponents.concat(this.networkControllers).forEach(component => {component.destroy();});\n this.url = null;\n this.observer.removeAllListeners();\n this._autoLevelCapping = -1;\n }\n\n attachMedia(media) {\n logger.log('attachMedia');\n this.media = media;\n this.trigger(Event.MEDIA_ATTACHING, {media: media});\n }\n\n detachMedia() {\n logger.log('detachMedia');\n this.trigger(Event.MEDIA_DETACHING);\n this.media = null;\n }\n\n loadSource(url) {\n url = URLToolkit.buildAbsoluteURL(window.location.href, url, { alwaysNormalize: true });\n logger.log(`loadSource:${url}`);\n this.url = url;\n // when attaching to a source URL, trigger a playlist load\n this.trigger(Event.MANIFEST_LOADING, {url: url});\n }\n\n startLoad(startPosition=-1) {\n logger.log(`startLoad(${startPosition})`);\n this.networkControllers.forEach(controller => {controller.startLoad(startPosition);});\n }\n\n stopLoad() {\n logger.log('stopLoad');\n this.networkControllers.forEach(controller => {controller.stopLoad();});\n }\n\n swapAudioCodec() {\n logger.log('swapAudioCodec');\n this.streamController.swapAudioCodec();\n }\n\n recoverMediaError() {\n logger.log('recoverMediaError');\n var media = this.media;\n this.detachMedia();\n this.attachMedia(media);\n }\n\n /** Return all quality levels **/\n get levels() {\n return this.levelController.levels;\n }\n\n /** Return current playback quality level **/\n get currentLevel() {\n return this.streamController.currentLevel;\n }\n\n /* set quality level immediately (-1 for automatic level selection) */\n set currentLevel(newLevel) {\n 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 get nextLevel() {\n return this.streamController.nextLevel;\n }\n\n /* set quality level for next fragment (-1 for automatic level selection) */\n set nextLevel(newLevel) {\n 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 get loadLevel() {\n return this.levelController.level;\n }\n\n /* set quality level for current/next loaded fragment (-1 for automatic level selection) */\n set loadLevel(newLevel) {\n logger.log(`set loadLevel:${newLevel}`);\n this.levelController.manualLevel = newLevel;\n }\n\n /** Return the quality level of next loaded fragment **/\n get nextLoadLevel() {\n return this.levelController.nextLoadLevel;\n }\n\n /** set quality level of next loaded fragment **/\n set nextLoadLevel(level) {\n this.levelController.nextLoadLevel = level;\n }\n\n /** Return first level (index of first level referenced in manifest)\n **/\n get firstLevel() {\n return Math.max(this.levelController.firstLevel, this.minAutoLevel);\n }\n\n /** set first level (index of first level referenced in manifest)\n **/\n set firstLevel(newLevel) {\n 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 get startLevel() {\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 set startLevel(newLevel) {\n logger.log(`set startLevel:${newLevel}`);\n const hls = this;\n // if not in automatic start level detection, ensure startLevel is greater than minAutoLevel\n if (newLevel !== -1) {\n newLevel = Math.max(newLevel,hls.minAutoLevel);\n }\n hls.levelController.startLevel = newLevel;\n }\n\n /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n get autoLevelCapping() {\n return this._autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n set autoLevelCapping(newLevel) {\n logger.log(`set autoLevelCapping:${newLevel}`);\n this._autoLevelCapping = newLevel;\n }\n\n /* check if we are in automatic level selection mode */\n get autoLevelEnabled() {\n return (this.levelController.manualLevel === -1);\n }\n\n /* return manual level */\n get manualLevel() {\n return this.levelController.manualLevel;\n }\n\n /* return min level selectable in auto mode according to config.minAutoBitrate */\n get minAutoLevel() {\n let hls = this, levels = hls.levels, minAutoBitrate = hls.config.minAutoBitrate, len = levels ? levels.length : 0;\n for (let i = 0; i < len; i++) {\n const levelNextBitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate,levels[i].bitrate) : levels[i].bitrate;\n if (levelNextBitrate > minAutoBitrate) {\n return i;\n }\n }\n return 0;\n }\n\n /* return max level selectable in auto mode according to autoLevelCapping */\n get maxAutoLevel() {\n const hls = this;\n const levels = hls.levels;\n const autoLevelCapping = hls.autoLevelCapping;\n let 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 // return next auto level\n get nextAutoLevel() {\n const hls = this;\n // ensure next auto level is between min and max auto level\n return Math.min(Math.max(hls.abrController.nextAutoLevel,hls.minAutoLevel),hls.maxAutoLevel);\n }\n\n // this setter is used to force next auto level\n // 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)\n // forced value is valid for one fragment. upon succesful frag loading at forced level, this value will be resetted to -1 by ABR controller\n set nextAutoLevel(nextLevel) {\n const hls = this;\n hls.abrController.nextAutoLevel = Math.max(hls.minAutoLevel,nextLevel);\n }\n\n /** get alternate audio tracks list from playlist **/\n get audioTracks() {\n const audioTrackController = this.audioTrackController;\n return audioTrackController ? audioTrackController.audioTracks : [];\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n get audioTrack() {\n const audioTrackController = this.audioTrackController;\n return audioTrackController ? audioTrackController.audioTrack : -1;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n set audioTrack(audioTrackId) {\n const audioTrackController = this.audioTrackController;\n if (audioTrackController) {\n audioTrackController.audioTrack = audioTrackId;\n }\n }\n\n get liveSyncPosition() {\n return this.streamController.liveSyncPosition;\n }\n\n /** get alternate subtitle tracks list from playlist **/\n get subtitleTracks() {\n const subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTracks : [];\n }\n\n /** get index of the selected subtitle track (index in subtitle track lists) **/\n get subtitleTrack() {\n const subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTrack : -1;\n }\n\n /** select an subtitle track, based on its index in subtitle track lists**/\n set subtitleTrack(subtitleTrackId) {\n const subtitleTrackController = this.subtitleTrackController;\n if (subtitleTrackController) {\n subtitleTrackController.subtitleTrack = subtitleTrackId;\n }\n }\n}\n\nexport default Hls;\n\n\n\n// WEBPACK FOOTER //\n// src/hls.js","// 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 = require('./hls.js').default;\n\n\n\n// WEBPACK FOOTER //\n// src/index.js","/*\n * Fragment Loader\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nclass FragmentLoader extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.FRAG_LOADING);\n this.loaders = {};\n }\n\n destroy() {\n let loaders = this.loaders;\n for (let loaderName in loaders) {\n let loader = loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n EventHandler.prototype.destroy.call(this);\n }\n\n onFragLoading(data) {\n let 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.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 let loaderContext, loaderConfig, loaderCallbacks;\n loaderContext = { url : frag.url, frag : frag, responseType : 'arraybuffer', progressData : false};\n let start = frag.byteRangeStartOffset, 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 loadsuccess(response, stats, context) {\n let payload = response.data, frag = context.frag;\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[frag.type] = undefined;\n this.hls.trigger(Event.FRAG_LOADED, {payload: payload, frag: frag, stats: stats});\n }\n\n loaderror(response, context) {\n let loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.FRAG_LOAD_ERROR, fatal: false, frag: context.frag, response: response});\n }\n\n loadtimeout(stats, context) {\n let loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.FRAG_LOAD_TIMEOUT, fatal: false, frag: context.frag});\n }\n\n // data will be used for progressive parsing\n loadprogress(stats, context, data) { // jshint ignore:line\n let frag = context.frag;\n frag.loaded = stats.loaded;\n this.hls.trigger(Event.FRAG_LOAD_PROGRESS, {frag: frag, stats: stats});\n }\n}\n\nexport default FragmentLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/loader/fragment-loader.js","/*\n * Decrypt key Loader\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nclass KeyLoader extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.KEY_LOADING);\n this.loaders = {};\n this.decryptkey = null;\n this.decrypturl = null;\n }\n\n destroy() {\n for (let loaderName in this.loaders) {\n let loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n EventHandler.prototype.destroy.call(this);\n }\n\n onKeyLoading(data) {\n let 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 let config = this.hls.config;\n\n if (loader) {\n logger.warn(`abort previous key 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 let loaderContext, loaderConfig, loaderCallbacks;\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(Event.KEY_LOADED, {frag: frag});\n }\n }\n\n loadsuccess(response, stats, context) {\n let 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[frag.type] = undefined;\n this.hls.trigger(Event.KEY_LOADED, {frag: frag});\n }\n\n loaderror(response, context) {\n let frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.KEY_LOAD_ERROR, fatal: false, frag: frag, response: response});\n }\n\n loadtimeout(stats, context) {\n let frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.KEY_LOAD_TIMEOUT, fatal: false, frag: frag});\n }\n}\n\nexport default KeyLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/loader/key-loader.js","/**\n * Playlist Loader\n*/\n\nimport URLToolkit from 'url-toolkit';\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport AttrList from '../utils/attr-list';\nimport {logger} from '../utils/logger';\n\n// https://regex101.com is your friend\nconst MASTER_PLAYLIST_REGEX = /#EXT-X-STREAM-INF:([^\\n\\r]*)[\\r\\n]+([^\\r\\n]+)/g;\nconst MASTER_PLAYLIST_MEDIA_REGEX = /#EXT-X-MEDIA:(.*)/g;\nconst LEVEL_PLAYLIST_REGEX_FAST = /#EXTINF:(\\d*(?:\\.\\d+)?)(?:,(.*))?|(?!#)(\\S.+)|#EXT-X-BYTERANGE: *(.+)|#EXT-X-PROGRAM-DATE-TIME:(.+)|#.*/g;\nconst 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?/;\n\nclass LevelKey {\n\n constructor() {\n this.method = null;\n this.key = null;\n this.iv = null;\n this._uri = null;\n }\n\n get uri() {\n if (!this._uri && this.reluri) {\n this._uri = URLToolkit.buildAbsoluteURL(this.baseuri, this.reluri, { alwaysNormalize: true });\n }\n return this._uri;\n }\n\n}\n\nclass Fragment {\n\n constructor() {\n this._url = null;\n this._byteRange = null;\n this._decryptdata = null;\n this.tagList = [];\n }\n\n get url() {\n if (!this._url && this.relurl) {\n this._url = URLToolkit.buildAbsoluteURL(this.baseurl, this.relurl, { alwaysNormalize: true });\n }\n return this._url;\n }\n\n set url(value) {\n this._url = value;\n }\n\n get programDateTime() {\n if (!this._programDateTime && this.rawProgramDateTime) {\n this._programDateTime = new Date(Date.parse(this.rawProgramDateTime));\n }\n return this._programDateTime;\n }\n\n get byteRange() {\n if (!this._byteRange) {\n let byteRange = this._byteRange = [];\n if (this.rawByteRange) {\n const params = this.rawByteRange.split('@', 2);\n if (params.length === 1) {\n const lastByteRangeEndOffset = this.lastByteRangeEndOffset;\n byteRange[0] = lastByteRangeEndOffset ? lastByteRangeEndOffset : 0;\n } else {\n byteRange[0] = parseInt(params[1]);\n }\n byteRange[1] = parseInt(params[0]) + byteRange[0];\n }\n }\n return this._byteRange;\n }\n\n get byteRangeStartOffset() {\n return this.byteRange[0];\n }\n\n get byteRangeEndOffset() {\n return this.byteRange[1];\n }\n\n get decryptdata() {\n if (!this._decryptdata) {\n this._decryptdata = this.fragmentDecryptdataFromLevelkey(this.levelkey, this.sn);\n }\n return this._decryptdata;\n }\n\n /**\n * Utility method for parseLevelPlaylist to create an initialization vector for a given segment\n * @returns {Uint8Array}\n */\n 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 fragmentDecryptdataFromLevelkey(levelkey, segmentNumber) {\n var decryptdata = levelkey;\n\n if (levelkey && levelkey.method && levelkey.uri && !levelkey.iv) {\n decryptdata = new LevelKey();\n decryptdata.method = levelkey.method;\n decryptdata.baseuri = levelkey.baseuri;\n decryptdata.reluri = levelkey.reluri;\n decryptdata.iv = this.createInitializationVector(segmentNumber);\n }\n\n return decryptdata;\n }\n\n cloneObj(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n}\n\nclass PlaylistLoader extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MANIFEST_LOADING,\n Event.LEVEL_LOADING,\n Event.AUDIO_TRACK_LOADING,\n Event.SUBTITLE_TRACK_LOADING);\n this.loaders = {};\n }\n\n destroy() {\n for (let loaderName in this.loaders) {\n let loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n EventHandler.prototype.destroy.call(this);\n }\n\n onManifestLoading(data) {\n this.load(data.url, { type : 'manifest'});\n }\n\n onLevelLoading(data) {\n this.load(data.url, { type : 'level', level : data.level, id : data.id});\n }\n\n onAudioTrackLoading(data) {\n this.load(data.url, { type : 'audioTrack', id : data.id});\n }\n\n onSubtitleTrackLoading(data) {\n this.load(data.url, { type : 'subtitleTrack', id : data.id});\n }\n\n load(url, context) {\n let loader = this.loaders[context.type];\n if (loader) {\n let loaderContext = loader.context;\n if (loaderContext && loaderContext.url === url) {\n logger.trace(`playlist request ongoing`);\n return;\n } else {\n logger.warn(`abort previous loader for type:${context.type}`);\n loader.abort();\n }\n }\n let config = this.hls.config,\n retry,\n timeout,\n retryDelay,\n maxRetryDelay;\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.log(`loading playlist for ${context.type} ${context.level || context.id}`);\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 let loaderConfig, loaderCallbacks;\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 resolve(url, baseUrl) {\n return URLToolkit.buildAbsoluteURL(baseUrl, url, { alwaysNormalize: true });\n }\n\n parseMasterPlaylist(string, baseurl) {\n let levels = [], result;\n MASTER_PLAYLIST_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_REGEX.exec(string)) != null){\n const level = {};\n\n var attrs = level.attrs = new AttrList(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 (let i = 0; i < codecs.length; i++) {\n const 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 parseMasterPlaylistMedia(string, baseurl, type) {\n let result, medias = [], id = 0;\n MASTER_PLAYLIST_MEDIA_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_MEDIA_REGEX.exec(string)) != null){\n const media = {};\n var attrs = new AttrList(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 media.id = id++;\n medias.push(media);\n }\n }\n return medias;\n }\n\n avc1toavcoti(codec) {\n var result, 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 parseLevelPlaylist(string, baseurl, id, type) {\n var currentSN = 0,\n totalduration = 0,\n level = {type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0},\n levelkey = new LevelKey(),\n cc = 0,\n prevFrag = null,\n frag = new Fragment(),\n result,\n i;\n\n LEVEL_PLAYLIST_REGEX_FAST.lastIndex = 0;\n\n while ((result = LEVEL_PLAYLIST_REGEX_FAST.exec(string)) !== null) {\n const duration = result[1];\n if (duration) { // INF\n frag.duration = parseFloat(duration);\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n const title = (' ' + result[2]).slice(1);\n frag.title = title ? title : null;\n frag.tagList.push(title ? [ 'INF',duration,title ] : [ 'INF',duration ]);\n } else if (result[3]) { // url\n if (!isNaN(frag.duration)) {\n const sn = currentSN++;\n frag.type = type;\n frag.start = totalduration;\n frag.levelkey = levelkey;\n frag.sn = sn;\n frag.level = id;\n frag.cc = cc;\n frag.baseurl = baseurl;\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.relurl = (' ' + result[3]).slice(1);\n\n level.fragments.push(frag);\n prevFrag = frag;\n totalduration += frag.duration;\n\n frag = new Fragment();\n }\n } else if (result[4]) { // X-BYTERANGE\n frag.rawByteRange = (' ' + result[4]).slice(1);\n if (prevFrag) {\n const lastByteRangeEndOffset = prevFrag.byteRangeEndOffset;\n if (lastByteRangeEndOffset) {\n frag.lastByteRangeEndOffset = lastByteRangeEndOffset;\n }\n }\n } else if (result[5]) { // PROGRAM-DATE-TIME\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.rawProgramDateTime = (' ' + result[5]).slice(1);\n frag.tagList.push(['PROGRAM-DATE-TIME', frag.rawProgramDateTime]);\n } else {\n result = result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);\n for (i = 1; i < result.length; i++) {\n if (result[i] !== undefined) {\n break;\n }\n }\n\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n const value1 = (' ' + result[i+1]).slice(1);\n const value2 = (' ' + result[i+2]).slice(1);\n\n switch (result[i]) {\n case '#':\n frag.tagList.push(value2 ? [ value1,value2 ] : [ value1 ]);\n break;\n case 'PLAYLIST-TYPE':\n level.type = value1.toUpperCase();\n break;\n case 'MEDIA-SEQUENCE':\n currentSN = level.startSN = parseInt(value1);\n break;\n case 'TARGETDURATION':\n level.targetduration = parseFloat(value1);\n break;\n case 'VERSION':\n level.version = parseInt(value1);\n break;\n case 'EXTM3U':\n break;\n case 'ENDLIST':\n level.live = false;\n break;\n case 'DIS':\n cc++;\n frag.tagList.push(['DIS']);\n break;\n case 'DISCONTINUITY-SEQ':\n cc = parseInt(value1);\n break;\n case 'KEY':\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4\n var decryptparams = value1;\n var keyAttrs = new AttrList(decryptparams);\n var decryptmethod = keyAttrs.enumeratedString('METHOD'),\n decrypturi = keyAttrs.URI,\n decryptiv = keyAttrs.hexadecimalInteger('IV');\n if (decryptmethod) {\n levelkey = new LevelKey();\n if ((decrypturi) && (['AES-128', 'SAMPLE-AES'].indexOf(decryptmethod) >= 0)) {\n levelkey.method = decryptmethod;\n // URI to get the key\n levelkey.baseuri = baseurl;\n levelkey.reluri = decrypturi;\n levelkey.key = null;\n // Initialization Vector (IV)\n levelkey.iv = decryptiv;\n }\n }\n break;\n case 'START':\n let startParams = value1;\n let startAttrs = new AttrList(startParams);\n let startTimeOffset = startAttrs.decimalFloatingPoint('TIME-OFFSET');\n //TIME-OFFSET can be 0\n if ( !isNaN(startTimeOffset) ) {\n level.startTimeOffset = startTimeOffset;\n }\n break;\n case 'MAP':\n let mapAttrs = new AttrList(value1);\n frag.relurl = mapAttrs.URI;\n frag.rawByteRange = mapAttrs.BYTERANGE;\n frag.baseurl = baseurl;\n frag.level = id;\n frag.type = type;\n frag.sn = 'initSegment';\n level.initSegment = frag;\n frag = new Fragment();\n break;\n default:\n logger.warn(`line parsed but not handled: ${result}`);\n break;\n }\n }\n }\n frag = prevFrag;\n //logger.log('found ' + level.fragments.length + ' fragments');\n if(frag && !frag.relurl) {\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 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 let isLevel = (type !== 'audioTrack' && type !== 'subtitleTrack'),\n levelId = !isNaN(level) ? level : !isNaN(id) ? id : 0,\n levelDetails = this.parseLevelPlaylist(string, url, levelId, (type === 'audioTrack' ? 'audio' : (type === 'subtitleTrack' ? 'subtitle' : 'main') ));\n levelDetails.tload = stats.tload;\n if (type === 'manifest') {\n // first request, stream manifest (no master playlist), fire manifest loaded event with level details\n hls.trigger(Event.MANIFEST_LOADED, {levels: [{url: url, details : levelDetails}], audioTracks : [], url: url, stats: stats});\n }\n stats.tparsed = performance.now();\n if (levelDetails.targetduration) {\n if (isLevel) {\n hls.trigger(Event.LEVEL_LOADED, {details: levelDetails, level: level || 0, id: id || 0, stats: stats});\n } else {\n if (type === 'audioTrack') {\n hls.trigger(Event.AUDIO_TRACK_LOADED, {details: levelDetails, id: id, stats: stats});\n }\n else if (type === 'subtitleTrack') {\n hls.trigger(Event.SUBTITLE_TRACK_LOADED, {details: levelDetails, id: id, stats: stats});\n }\n }\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'invalid targetduration'});\n }\n } else {\n let levels = this.parseMasterPlaylist(string, url);\n // multi level playlist, parse level info\n if (levels.length) {\n let audioTracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO');\n let subtitles = this.parseMasterPlaylistMedia(string, url, 'SUBTITLES');\n if (audioTracks.length) {\n // check if we have found an audio track embedded in main playlist (audio track without URI attribute)\n let embeddedAudioFound = false;\n audioTracks.forEach(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.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(Event.MANIFEST_LOADED, {levels, audioTracks, subtitles, url, stats});\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no level found in manifest'});\n }\n }\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter'});\n }\n }\n\n loaderror(response, context) {\n var details, fatal,loader = context.loader;\n switch(context.type) {\n case 'manifest':\n details = ErrorDetails.MANIFEST_LOAD_ERROR;\n fatal = true;\n break;\n case 'level':\n details = ErrorDetails.LEVEL_LOAD_ERROR;\n fatal = false;\n break;\n case 'audioTrack':\n details = 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(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, response: response, context : context});\n }\n\n loadtimeout(stats, context) {\n var details, fatal, loader = context.loader;\n switch(context.type) {\n case 'manifest':\n details = ErrorDetails.MANIFEST_LOAD_TIMEOUT;\n fatal = true;\n break;\n case 'level':\n details = ErrorDetails.LEVEL_LOAD_TIMEOUT;\n fatal = false;\n break;\n case 'audioTrack':\n details = 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(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, context : context});\n }\n}\n\nexport default PlaylistLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/loader/playlist-loader.js","/**\n * Generate MP4 Box\n*/\n\n//import Hex from '../utils/hex';\n\nconst UINT32_MAX = Math.pow(2, 32) - 1;\n\nclass MP4 {\n static 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 '.mp3': [],\n mvex: [],\n mvhd: [],\n pasp: [],\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] = [\n i.charCodeAt(0),\n i.charCodeAt(1),\n i.charCodeAt(2),\n i.charCodeAt(3)\n ];\n }\n }\n\n var videoHdlr = new Uint8Array([\n 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,\n 0x6f, 0x48, 0x61, 0x6e,\n 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n\n var audioHdlr = new Uint8Array([\n 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,\n 0x64, 0x48, 0x61, 0x6e,\n 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([\n 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([\n 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([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00, // sample_count\n ]);\n MP4.VMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00,\n 0x00, 0x00,\n 0x00, 0x00 // opcolor\n ]);\n MP4.SMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance\n 0x00, 0x00 // reserved\n ]);\n\n MP4.STSD = new Uint8Array([\n 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 static box(type) {\n var\n 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 static hdlr(type) {\n return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);\n }\n\n static mdat(data) {\n return MP4.box(MP4.types.mdat, data);\n }\n\n static mdhd(timescale, duration) {\n duration *= timescale;\n const upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n const lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.mdhd, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n (timescale >> 24) & 0xFF,\n (timescale >> 16) & 0xFF,\n (timescale >> 8) & 0xFF,\n timescale & 0xFF, // timescale\n (upperWordDuration >> 24),\n (upperWordDuration >> 16) & 0xFF,\n (upperWordDuration >> 8) & 0xFF,\n upperWordDuration & 0xFF,\n (lowerWordDuration >> 24),\n (lowerWordDuration >> 16) & 0xFF,\n (lowerWordDuration >> 8) & 0xFF,\n lowerWordDuration & 0xFF,\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00\n ]));\n }\n\n static 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 static mfhd(sequenceNumber) {\n return MP4.box(MP4.types.mfhd, new Uint8Array([\n 0x00,\n 0x00, 0x00, 0x00, // flags\n (sequenceNumber >> 24),\n (sequenceNumber >> 16) & 0xFF,\n (sequenceNumber >> 8) & 0xFF,\n sequenceNumber & 0xFF, // sequence_number\n ]));\n }\n\n static 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 static 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 static moov(tracks) {\n var\n 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 static mvex(tracks) {\n var\n 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 static mvhd(timescale,duration) {\n duration*=timescale;\n const upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n const lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n var\n bytes = new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n (timescale >> 24) & 0xFF,\n (timescale >> 16) & 0xFF,\n (timescale >> 8) & 0xFF,\n timescale & 0xFF, // timescale\n (upperWordDuration >> 24),\n (upperWordDuration >> 16) & 0xFF,\n (upperWordDuration >> 8) & 0xFF,\n upperWordDuration & 0xFF,\n (lowerWordDuration >> 24),\n (lowerWordDuration >> 16) & 0xFF,\n (lowerWordDuration >> 8) & 0xFF,\n lowerWordDuration & 0xFF,\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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 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 static sdtp(track) {\n var\n 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) |\n (flags.isDependedOn << 2) |\n (flags.hasRedundancy);\n }\n\n return MP4.box(MP4.types.sdtp, bytes);\n }\n\n static 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 static avc1(track) {\n var sps = [], pps = [], i, data, 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([\n 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([\n track.pps.length // numOfPictureParameterSets\n ]).concat(pps))), // \"PPS\"\n width = track.width,\n height = track.height,\n hSpacing = track.pixelRatio[0],\n vSpacing = track.pixelRatio[1];\n //console.log('avcc:' + Hex.hexDump(avcc));\n return MP4.box(MP4.types.avc1, new Uint8Array([\n 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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n (width >> 8) & 0xFF,\n width & 0xff, // width\n (height >> 8) & 0xFF,\n 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,\n 0x64, 0x61, 0x69, 0x6C, //dailymotion/hls.js\n 0x79, 0x6D, 0x6F, 0x74,\n 0x69, 0x6F, 0x6E, 0x2F,\n 0x68, 0x6C, 0x73, 0x2E,\n 0x6A, 0x73, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11]), // pre_defined = -1\n avcc,\n MP4.box(MP4.types.btrt, new Uint8Array([\n 0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0])), // avgBitrate\n MP4.box(MP4.types.pasp, new Uint8Array([\n (hSpacing >> 24), // hSpacing\n (hSpacing >> 16) & 0xFF,\n (hSpacing >> 8) & 0xFF,\n hSpacing & 0xFF,\n (vSpacing >> 24), // vSpacing\n (vSpacing >> 16) & 0xFF,\n (vSpacing >> 8) & 0xFF,\n vSpacing & 0xFF]))\n );\n }\n\n static esds(track) {\n var configlen = track.config.length;\n return new Uint8Array([\n 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 static mp4a(track) {\n var samplerate = track.samplerate;\n return MP4.box(MP4.types.mp4a, new Uint8Array([\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n (samplerate >> 8) & 0xFF,\n samplerate & 0xff, //\n 0x00, 0x00]),\n MP4.box(MP4.types.esds, MP4.esds(track)));\n }\n\n static mp3(track) {\n var samplerate = track.samplerate;\n return MP4.box(MP4.types['.mp3'], new Uint8Array([\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n (samplerate >> 8) & 0xFF,\n samplerate & 0xff, //\n 0x00, 0x00]));\n }\n\n static stsd(track) {\n if (track.type === 'audio') {\n if (!track.isAAC && track.codec === 'mp3') {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));\n }\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 static tkhd(track) {\n var id = track.id,\n duration = track.duration*track.timescale,\n width = track.width,\n height = track.height,\n upperWordDuration = Math.floor(duration / (UINT32_MAX + 1)),\n lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.tkhd, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n (id >> 24) & 0xFF,\n (id >> 16) & 0xFF,\n (id >> 8) & 0xFF,\n id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n (upperWordDuration >> 24),\n (upperWordDuration >> 16) & 0xFF,\n (upperWordDuration >> 8) & 0xFF,\n upperWordDuration & 0xFF,\n (lowerWordDuration >> 24),\n (lowerWordDuration >> 16) & 0xFF,\n (lowerWordDuration >> 8) & 0xFF,\n lowerWordDuration & 0xFF,\n 0x00, 0x00, 0x00, 0x00,\n 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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n (width >> 8) & 0xFF,\n width & 0xFF,\n 0x00, 0x00, // width\n (height >> 8) & 0xFF,\n height & 0xFF,\n 0x00, 0x00 // height\n ]));\n }\n\n static traf(track,baseMediaDecodeTime) {\n var sampleDependencyTable = MP4.sdtp(track),\n id = track.id,\n upperWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime / (UINT32_MAX + 1)),\n lowerWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime % (UINT32_MAX + 1));\n return MP4.box(MP4.types.traf,\n MP4.box(MP4.types.tfhd, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (id >> 24),\n (id >> 16) & 0XFF,\n (id >> 8) & 0XFF,\n (id & 0xFF) // track_ID\n ])),\n MP4.box(MP4.types.tfdt, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n (upperWordBaseMediaDecodeTime >>24),\n (upperWordBaseMediaDecodeTime >> 16) & 0XFF,\n (upperWordBaseMediaDecodeTime >> 8) & 0XFF,\n (upperWordBaseMediaDecodeTime & 0xFF),\n (lowerWordBaseMediaDecodeTime >>24),\n (lowerWordBaseMediaDecodeTime >> 16) & 0XFF,\n (lowerWordBaseMediaDecodeTime >> 8) & 0XFF,\n (lowerWordBaseMediaDecodeTime & 0xFF)\n ])),\n MP4.trun(track,\n sampleDependencyTable.length +\n 16 + // tfhd\n 20 + // 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 static trak(track) {\n track.duration = track.duration || 0xffffffff;\n return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));\n }\n\n static trex(track) {\n var id = track.id;\n return MP4.box(MP4.types.trex, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (id >> 24),\n (id >> 16) & 0XFF,\n (id >> 8) & 0XFF,\n (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 static trun(track, offset) {\n var samples= track.samples || [],\n len = samples.length,\n arraylen = 12 + (16 * len),\n array = new Uint8Array(arraylen),\n i,sample,duration,size,flags,cts;\n offset += 8 + arraylen;\n array.set([\n 0x00, // version 0\n 0x00, 0x0f, 0x01, // flags\n (len >>> 24) & 0xFF,\n (len >>> 16) & 0xFF,\n (len >>> 8) & 0xFF,\n len & 0xFF, // sample_count\n (offset >>> 24) & 0xFF,\n (offset >>> 16) & 0xFF,\n (offset >>> 8) & 0xFF,\n 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([\n (duration >>> 24) & 0xFF,\n (duration >>> 16) & 0xFF,\n (duration >>> 8) & 0xFF,\n duration & 0xFF, // sample_duration\n (size >>> 24) & 0xFF,\n (size >>> 16) & 0xFF,\n (size >>> 8) & 0xFF,\n size & 0xFF, // sample_size\n (flags.isLeading << 2) | flags.dependsOn,\n (flags.isDependedOn << 6) |\n (flags.hasRedundancy << 4) |\n (flags.paddingValue << 1) |\n flags.isNonSync,\n flags.degradPrio & 0xF0 << 8,\n flags.degradPrio & 0x0F, // sample_flags\n (cts >>> 24) & 0xFF,\n (cts >>> 16) & 0xFF,\n (cts >>> 8) & 0xFF,\n cts & 0xFF // sample_composition_time_offset\n ],12+16*i);\n }\n return MP4.box(MP4.types.trun, array);\n }\n\n static initSegment(tracks) {\n if (!MP4.types) {\n MP4.init();\n }\n var movie = MP4.moov(tracks), 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\nexport default MP4;\n\n\n\n// WEBPACK FOOTER //\n// src/remux/mp4-generator.js"," /**\n * fMP4 remuxer\n*/\n\n\nimport AAC from '../helper/aac';\nimport Event from '../events';\nimport {logger} from '../utils/logger';\nimport MP4 from '../remux/mp4-generator';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n\n// 10 seconds\nconst MAX_SILENT_FRAME_DURATION = 10 * 1000;\n\nclass MP4Remuxer {\n constructor(observer, config, typeSupported, vendor) {\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n const userAgent = navigator.userAgent;\n this.isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');\n this.ISGenerated = false;\n }\n\n destroy() {\n }\n\n resetTimeStamp(defaultTimeStamp) {\n this._initPTS = this._initDTS = defaultTimeStamp;\n }\n\n resetInitSegment() {\n this.ISGenerated = false;\n }\n\n remux(audioTrack,videoTrack,id3Track,textTrack,timeOffset, contiguous,accurateTimeOffset) {\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 nextAudioPts, which is\n // calculated in remuxAudio.\n //logger.log('nb AAC samples:' + audioTrack.samples.length);\n if (audioTrack.samples.length) {\n // if initSegment was generated without video samples, regenerate it again\n if (!audioTrack.timescale) {\n logger.warn('regenerate InitSegment as audio detected');\n this.generateIS(audioTrack,videoTrack,timeOffset);\n }\n let audioData = this.remuxAudio(audioTrack,timeOffset,contiguous,accurateTimeOffset);\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n let audioTrackLength;\n if (audioData) {\n audioTrackLength = audioData.endPTS - audioData.startPTS;\n }\n // if initSegment was generated without video samples, regenerate it again\n if (!videoTrack.timescale) {\n logger.warn('regenerate InitSegment as video detected');\n this.generateIS(audioTrack,videoTrack,timeOffset);\n }\n this.remuxVideo(videoTrack,timeOffset,contiguous,audioTrackLength, accurateTimeOffset);\n }\n } else {\n let videoData;\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n videoData = this.remuxVideo(videoTrack,timeOffset,contiguous, accurateTimeOffset);\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(Event.FRAG_PARSED);\n }\n\n generateIS(audioTrack,videoTrack,timeOffset) {\n var observer = this.observer,\n audioSamples = audioTrack.samples,\n videoSamples = videoTrack.samples,\n typeSupported = this.typeSupported,\n container = 'audio/mp4',\n tracks = {},\n data = { tracks : tracks },\n computePTSDTS = (this._initPTS === undefined),\n initPTS, initDTS;\n\n if (computePTSDTS) {\n initPTS = initDTS = Infinity;\n }\n if (audioTrack.config && audioSamples.length) {\n // let's use audio sampling rate as MP4 time scale.\n // rationale is that there is a integer nb of audio frames per audio sample (1024 for AAC)\n // using audio sampling rate here helps having an integer MP4 frame duration\n // this avoids potential rounding issue and AV sync issue\n audioTrack.timescale = audioTrack.samplerate;\n logger.log (`audio sampling rate : ${audioTrack.samplerate}`);\n if (!audioTrack.isAAC) {\n if (typeSupported.mpeg) { // Chrome and Safari\n container = 'audio/mpeg';\n audioTrack.codec = '';\n } else if (typeSupported.mp3) { // Firefox\n audioTrack.codec = 'mp3';\n }\n }\n tracks.audio = {\n container : container,\n codec : audioTrack.codec,\n initSegment : !audioTrack.isAAC && typeSupported.mpeg ? new Uint8Array() : MP4.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 - audioTrack.inputTimeScale * timeOffset;\n }\n }\n\n if (videoTrack.sps && videoTrack.pps && videoSamples.length) {\n // let's use input time scale as MP4 video timescale\n // we use input time scale straight away to avoid rounding issues on frame duration / cts computation\n const inputTimeScale = videoTrack.inputTimeScale;\n videoTrack.timescale = inputTimeScale;\n tracks.video = {\n container : 'video/mp4',\n codec : videoTrack.codec,\n initSegment : MP4.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 - inputTimeScale * timeOffset);\n initDTS = Math.min(initDTS,videoSamples[0].dts - inputTimeScale * timeOffset);\n this.observer.trigger(Event.INIT_PTS_FOUND, { initPTS: initPTS});\n }\n }\n\n if(Object.keys(tracks).length) {\n observer.trigger(Event.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(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'no audio/video samples found'});\n }\n }\n\n remuxVideo(track, timeOffset, contiguous, audioTrackLength, accurateTimeOffset) {\n var offset = 8,\n timeScale = track.timescale,\n mp4SampleDuration,\n mdat, moof,\n firstPTS, firstDTS,\n nextDTS,\n lastPTS, lastDTS,\n inputSamples = track.samples,\n outputSamples = [],\n nbSamples = inputSamples.length,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS;\n\n // for (let i = 0; i < track.samples.length; i++) {\n // let avcSample = track.samples[i];\n // let units = avcSample.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 // if parsed fragment is contiguous with last one, let's use last DTS value as reference\n let nextAvcDts = this.nextAvcDts;\n\n const isSafari = this.isSafari;\n\n // Safari does not like overlapping DTS on consecutive fragments. let's use nextAvcDts to overcome this if fragments are consecutive\n if (isSafari) {\n // also consider consecutive fragments as being contiguous (even if a level switch occurs),\n // for sake of clarity:\n // consecutive fragments are frags with\n // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR\n // - less than 200 ms PTS gaps (timeScale/5)\n contiguous |= (inputSamples.length && nextAvcDts &&\n ((accurateTimeOffset && Math.abs(timeOffset-nextAvcDts/timeScale) < 0.1) ||\n Math.abs((inputSamples[0].pts-nextAvcDts-initDTS)) < timeScale/5)\n );\n }\n\n if (!contiguous) {\n // if not contiguous, let's use target timeOffset\n nextAvcDts = timeOffset*timeScale;\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 inputSamples.forEach(function(sample) {\n sample.pts = ptsNormalize(sample.pts-initDTS, nextAvcDts);\n sample.dts = ptsNormalize(sample.dts-initDTS, nextAvcDts);\n });\n\n // sort video samples by DTS then PTS then demux id order\n inputSamples.sort(function(a, b) {\n const deltadts = a.dts - b.dts;\n const deltapts = a.pts - b.pts;\n return deltadts ? deltadts : deltapts ? deltapts : (a.id - b.id);\n });\n\n // handle broken streams with PTS < DTS, tolerance up 200ms (18000 in 90kHz timescale)\n let PTSDTSshift = inputSamples.reduce( (prev, curr) => Math.max(Math.min(prev,curr.pts-curr.dts),-18000),0);\n if (PTSDTSshift < 0) {\n logger.warn(`PTS < DTS detected in video samples, shifting DTS by ${Math.round(PTSDTSshift/90)} ms to overcome this issue`);\n for (let i = 0; i < inputSamples.length; i++) {\n inputSamples[i].dts += PTSDTSshift;\n }\n }\n\n // compute first DTS and last DTS, normalize them against reference value\n let sample = inputSamples[0];\n firstDTS = Math.max(sample.dts,0);\n firstPTS = Math.max(sample.pts,0);\n\n // check timestamp continuity accross consecutive fragments (this is to remove inter-fragment gap/hole)\n let 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.log(`AVC:${delta} ms hole between fragments detected,filling it`);\n } else if (delta < -1) {\n 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;\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;\n 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(sample.dts,0);\n lastPTS = Math.max(sample.pts,0,lastDTS);\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)/(inputSamples.length-1));\n }\n\n let nbNalu = 0, naluLen = 0;\n for (let i = 0 ; i < nbSamples; i++) {\n // compute total/avc sample length and nb of NAL units\n let sample = inputSamples[i], units = sample.units, nbUnits = units.length, sampleLen = 0;\n for (let j = 0; j < nbUnits; j++) {\n sampleLen += units[j].data.length;\n }\n naluLen += sampleLen;\n nbNalu += nbUnits;\n sample.length = sampleLen;\n\n // normalize PTS/DTS\n if (isSafari) {\n // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples\n sample.dts = firstDTS + i*mp4SampleDuration;\n } else {\n // ensure sample monotonic DTS\n sample.dts = Math.max(sample.dts,firstDTS);\n }\n // ensure that computed value is greater or equal than sample DTS\n sample.pts = Math.max(sample.pts , sample.dts);\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 let mdatSize = naluLen + (4 * nbNalu) + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch(err) {\n this.observer.trigger(Event.ERROR, {type : ErrorTypes.MUX_ERROR, details: ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes : mdatSize, reason: `fail allocating video mdat ${mdatSize}`});\n return;\n }\n let view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(MP4.types.mdat, 4);\n\n for (let i = 0 ; i < nbSamples; i++) {\n let avcSample = inputSamples[i],\n avcSampleUnits = avcSample.units,\n mp4SampleLength = 0,\n compositionTimeOffset;\n // convert NALU bitstream to MP4 format (prepend NALU with size field)\n for(let j = 0, nbUnits = avcSampleUnits.length; j < nbUnits ; j++) {\n let unit = avcSampleUnits[j],\n unitData = unit.data,\n unitDataLen = unit.data.byteLength;\n view.setUint32(offset, unitDataLen);\n offset += 4;\n mdat.set(unitData, offset);\n offset += unitDataLen;\n mp4SampleLength += 4 + unitDataLen;\n }\n\n if(!isSafari) {\n // expected sample duration is the Decoding Timestamp diff of consecutive samples\n if (i < nbSamples - 1) {\n mp4SampleDuration = inputSamples[i+1].dts - avcSample.dts;\n } else {\n let config = this.config,\n lastFrameDuration = avcSample.dts - inputSamples[i > 0 ? i-1 : i].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 let maxBufferHole = config.maxBufferHole,\n maxSeekHole = config.maxSeekHole,\n gapTolerance = Math.floor(Math.min(maxBufferHole, maxSeekHole) * timeScale),\n deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * timeScale : this.nextAudioPts) - 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.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 compositionTimeOffset = Math.round(avcSample.pts - avcSample.dts);\n } else {\n compositionTimeOffset = Math.max(0,mp4SampleDuration*Math.round((avcSample.pts - avcSample.dts)/mp4SampleDuration));\n }\n\n\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${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;\n let 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 let 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 = MP4.moof(track.sequenceNumber++, firstDTS , track);\n track.samples = [];\n\n let data = {\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / timeScale,\n endPTS: (lastPTS + mp4SampleDuration) / timeScale,\n startDTS: firstDTS / timeScale,\n endDTS: this.nextAvcDts / timeScale,\n type: 'video',\n nb: outputSamples.length,\n dropped : dropped\n };\n this.observer.trigger(Event.FRAG_PARSING_DATA, data);\n return data;\n }\n\n remuxAudio(track, timeOffset, contiguous,accurateTimeOffset) {\n const inputTimeScale = track.inputTimeScale,\n mp4timeScale = track.timescale,\n scaleFactor = inputTimeScale/mp4timeScale,\n mp4SampleDuration = track.isAAC ? 1024 : 1152,\n inputSampleDuration = mp4SampleDuration * scaleFactor,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS,\n rawMPEG = !track.isAAC && this.typeSupported.mpeg;\n\n var offset,\n mp4Sample,\n fillFrame,\n mdat, moof,\n firstPTS, lastPTS,\n inputSamples = track.samples,\n outputSamples = [],\n nextAudioPts = this.nextAudioPts;\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\n // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR\n // - less than 20 audio frames distance\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 contiguous |= (inputSamples.length && nextAudioPts &&\n ((accurateTimeOffset && Math.abs(timeOffset-nextAudioPts/inputTimeScale) < 0.1) ||\n Math.abs((inputSamples[0].pts-nextAudioPts-initDTS)) < 20*inputSampleDuration)\n );\n\n if (!contiguous) {\n // if fragments are not contiguous, let's use timeOffset to compute next Audio PTS\n nextAudioPts = timeOffset*inputTimeScale;\n }\n\n // compute normalized PTS\n inputSamples.forEach(function(sample) {\n sample.pts = sample.dts = ptsNormalize(sample.pts - initDTS, nextAudioPts);\n });\n\n // sort based on normalized PTS (this is to avoid sorting issues in case timestamp\n // reloop in the middle of our samples array)\n inputSamples.sort(function(a, b) {\n return a.pts - b.pts;\n });\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\n // only inject/drop audio frames in case time offset is accurate\n if (accurateTimeOffset && track.isAAC) {\n for (let i = 0, nextPts = nextAudioPts; i < inputSamples.length; ) {\n // First, let's see how far off this frame is from where we expect it to be\n var sample = inputSamples[i], delta;\n let pts = sample.pts;\n delta = pts - nextPts;\n\n const duration = Math.abs(1000*delta/inputTimeScale);\n\n // If we're overlapping by more than a duration, drop this sample\n if (delta <= -inputSampleDuration) {\n logger.warn(`Dropping 1 audio frame @ ${(nextPts/inputTimeScale).toFixed(3)}s due to ${duration} ms overlap.`);\n inputSamples.splice(i, 1);\n track.len -= sample.unit.length;\n // Don't touch nextPtsNorm or i\n }\n\n // Insert missing frames if:\n // 1: We're more than one frame away\n // 2: Not more than MAX_SILENT_FRAME_DURATION away\n // 3: currentTime (aka nextPtsNorm) is not 0\n else if (delta >= inputSampleDuration && duration < MAX_SILENT_FRAME_DURATION && nextPts) {\n var missing = Math.round(delta / inputSampleDuration);\n logger.warn(`Injecting ${missing} audio frame @ ${(nextPts/inputTimeScale).toFixed(3)}s due to ${Math.round(1000*delta/inputTimeScale)} ms gap.`);\n for (var j = 0; j < missing; j++) {\n let newStamp = Math.max(nextPts,0);\n fillFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n if (!fillFrame) {\n logger.log('Unable to get silent frame for given audio codec; duplicating last frame instead.');\n fillFrame = sample.unit.subarray();\n }\n inputSamples.splice(i, 0, {unit: fillFrame, pts: newStamp, dts: newStamp});\n track.len += fillFrame.length;\n nextPts += inputSampleDuration;\n i++;\n }\n\n // Adjust sample to next expected pts\n sample.pts = sample.dts = nextPts;\n nextPts += inputSampleDuration;\n i++;\n } else {\n // Otherwise, just adjust pts\n if (Math.abs(delta) > (0.1 * inputSampleDuration)) {\n //logger.log(`Invalid frame delta ${Math.round(delta + inputSampleDuration)} at PTS ${Math.round(pts / 90)} (should be ${Math.round(inputSampleDuration)}).`);\n }\n sample.pts = sample.dts = nextPts;\n nextPts += inputSampleDuration;\n i++;\n }\n }\n }\n\n\n for (let j =0 , nbSamples = inputSamples.length; j < nbSamples ; j++) {\n let audioSample = inputSamples[j];\n let unit = audioSample.unit;\n let pts = audioSample.pts;\n //logger.log(`Audio/PTS:${Math.round(pts/90)}`);\n // if not first sample\n if (lastPTS !== undefined) {\n mp4Sample.duration = Math.round((pts - lastPTS) / scaleFactor);\n } else {\n let delta = Math.round(1000 * (pts - nextAudioPts) / inputTimeScale),\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 && track.isAAC) {\n // log delta\n if (delta) {\n if (delta > 0 && delta < MAX_SILENT_FRAME_DURATION) {\n numMissingFrames = Math.round((pts - nextAudioPts) / inputSampleDuration);\n logger.log(`${delta} ms hole between AAC samples detected,filling it`);\n if (numMissingFrames > 0) {\n fillFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n if (!fillFrame) {\n fillFrame = unit.subarray();\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.log(`drop overlapping AAC sample, expected/parsed/delta:${(nextAudioPts/inputTimeScale).toFixed(3)}s/${(pts/inputTimeScale).toFixed(3)}s/${(-delta)}ms`);\n track.len -= unit.byteLength;\n continue;\n }\n // set PTS/DTS to expected PTS/DTS\n pts = nextAudioPts;\n }\n }\n // remember first PTS of our audioSamples, ensure value is positive\n firstPTS = Math.max(0, pts);\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 let mdatSize = rawMPEG ? track.len : track.len + 8;\n offset = rawMPEG ? 0 : 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch(err) {\n this.observer.trigger(Event.ERROR, {type : ErrorTypes.MUX_ERROR, details: ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes : mdatSize, reason: `fail allocating audio mdat ${mdatSize}`});\n return;\n }\n if (!rawMPEG) {\n const view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(MP4.types.mdat, 4);\n }\n } else {\n // no audio samples\n return;\n }\n for (let i = 0; i < numMissingFrames; i++) {\n fillFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n if (!fillFrame) {\n logger.log('Unable to get silent frame for given audio codec; duplicating this frame instead.');\n fillFrame = unit.subarray();\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 outputSamples.push(mp4Sample);\n }\n }\n mdat.set(unit, offset);\n let unitLen = unit.byteLength;\n offset += unitLen;\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${audioSample.pts}/${audioSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(audioSample.pts/4294967296).toFixed(3)}');\n mp4Sample = {\n size: unitLen,\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 outputSamples.push(mp4Sample);\n lastPTS = pts;\n }\n var lastSampleDuration = 0;\n var nbSamples = outputSamples.length;\n //set last sample duration as being identical to previous sample\n if (nbSamples >= 2) {\n lastSampleDuration = outputSamples[nbSamples - 2].duration;\n mp4Sample.duration = lastSampleDuration;\n }\n if (nbSamples) {\n // next audio sample PTS should be equal to last sample PTS + duration\n this.nextAudioPts = nextAudioPts = lastPTS + scaleFactor * lastSampleDuration;\n //logger.log('Audio/PTS/PTSend:' + audioSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));\n track.len = 0;\n track.samples = outputSamples;\n if (rawMPEG) {\n moof = new Uint8Array();\n } else {\n moof = MP4.moof(track.sequenceNumber++, firstPTS / scaleFactor, track);\n }\n track.samples = [];\n const start = firstPTS / inputTimeScale;\n const end = nextAudioPts / inputTimeScale;\n const audioData = {\n data1: moof,\n data2: mdat,\n startPTS: start,\n endPTS: end,\n startDTS: start,\n endDTS: end,\n type: 'audio',\n nb: nbSamples\n };\n this.observer.trigger(Event.FRAG_PARSING_DATA, audioData);\n return audioData;\n }\n return null;\n }\n\n remuxEmptyAudio(track, timeOffset, contiguous, videoData) {\n let inputTimeScale = track.inputTimeScale,\n mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale,\n scaleFactor = inputTimeScale/mp4timeScale,\n nextAudioPts = this.nextAudioPts,\n\n // sync with video's timestamp\n startDTS = (nextAudioPts !== undefined ? nextAudioPts : videoData.startDTS * inputTimeScale) + this._initDTS,\n endDTS = videoData.endDTS * inputTimeScale + this._initDTS,\n // one sample's duration value\n sampleDuration = 1024,\n frameDuration = scaleFactor * sampleDuration,\n\n // samples count of this segment's duration\n nbSamples = Math.ceil((endDTS - startDTS) / frameDuration),\n\n // silent frame\n silentFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n\n logger.warn('remux empty Audio');\n // Can't remux if we can't generate a silent frame...\n if (!silentFrame) {\n logger.trace('Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!');\n return;\n }\n\n let samples = [];\n for(var i = 0; i < nbSamples; i++) {\n var stamp = startDTS + i * frameDuration;\n samples.push({unit: silentFrame, pts: stamp, dts: stamp});\n track.len += silentFrame.length;\n }\n track.samples = samples;\n\n this.remuxAudio(track, timeOffset, contiguous);\n }\n\n remuxID3(track,timeOffset) {\n var length = track.samples.length, sample;\n const inputTimeScale = track.inputTimeScale;\n const initPTS = this._initPTS;\n const initDTS = this._initDTS;\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 - initPTS) / inputTimeScale);\n sample.dts = ((sample.dts - initDTS) / inputTimeScale);\n }\n this.observer.trigger(Event.FRAG_PARSING_METADATA, {\n samples:track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n\n remuxText(track,timeOffset) {\n track.samples.sort(function(a, b) {\n return (a.pts-b.pts);\n });\n\n var length = track.samples.length, sample;\n const inputTimeScale = track.inputTimeScale;\n const initPTS = this._initPTS;\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 - initPTS) / inputTimeScale);\n }\n this.observer.trigger(Event.FRAG_PARSING_USERDATA, {\n samples:track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n\n _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}\n\nexport default MP4Remuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/remux/mp4-remuxer.js","/**\n * passthrough remuxer\n*/\nimport Event from '../events';\n\nclass PassThroughRemuxer {\n constructor(observer) {\n this.observer = observer;\n }\n\n destroy() {\n }\n\n resetTimeStamp() {\n }\n\n resetInitSegment() {\n }\n\n remux(audioTrack,videoTrack,id3Track,textTrack,timeOffset, contiguous,accurateTimeOffset,rawData) {\n var observer = this.observer;\n var streamType = '';\n if (audioTrack) {\n streamType += 'audio';\n }\n if (videoTrack) {\n streamType += 'video';\n }\n observer.trigger(Event.FRAG_PARSING_DATA, {\n data1: rawData,\n startPTS: timeOffset,\n startDTS: timeOffset,\n type: streamType,\n nb: 1,\n dropped : 0\n });\n //notify end of parsing\n observer.trigger(Event.FRAG_PARSED);\n }\n}\n\nexport default PassThroughRemuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/remux/passthrough-remuxer.js","const DECIMAL_RESOLUTION_REGEX = /^(\\d+)x(\\d+)$/;\nconst ATTR_LIST_REGEX = /\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g;\n\n// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js\nclass AttrList {\n\n constructor(attrs) {\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 decimalInteger(attrName) {\n const intValue = parseInt(this[attrName], 10);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n\n hexadecimalInteger(attrName) {\n if(this[attrName]) {\n let stringValue = (this[attrName] || '0x').slice(2);\n stringValue = ((stringValue.length & 1) ? '0' : '') + stringValue;\n\n const value = new Uint8Array(stringValue.length / 2);\n for (let 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 hexadecimalIntegerAsNumber(attrName) {\n const intValue = parseInt(this[attrName], 16);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n\n decimalFloatingPoint(attrName) {\n return parseFloat(this[attrName]);\n }\n\n enumeratedString(attrName) {\n return this[attrName];\n }\n\n decimalResolution(attrName) {\n const res = DECIMAL_RESOLUTION_REGEX.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 static parseAttrList(input) {\n var match, attrs = {};\n ATTR_LIST_REGEX.lastIndex = 0;\n while ((match = ATTR_LIST_REGEX.exec(input)) !== null) {\n var value = match[2], quote = '\"';\n\n if (value.indexOf(quote) === 0 &&\n 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\nexport default AttrList;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/attr-list.js","var 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(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 }\n else if (comparisonResult < 0) {\n maxIndex = currentIndex - 1;\n }\n else {\n return currentElement;\n }\n }\n \n return null;\n }\n};\n\nmodule.exports = BinarySearch;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/binary-search.js","/**\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(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 = 100;\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(newTime) {\n this.time = newTime;\n },\n log : function(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(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\nclass PenState {\n\n constructor(foreground, underline, italics, background, flash) {\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 reset() {\n this.foreground = 'white';\n this.underline = false;\n this.italics = false;\n this.background = 'black';\n this.flash = false;\n }\n\n 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 isDefault() {\n return (this.foreground === 'white' && !this.underline && !this.italics &&\n this.background === 'black' && !this.flash);\n }\n\n equals(other) {\n return ( (this.foreground === other.foreground) &&\n (this.underline === other.underline) &&\n (this.italics === other.italics) &&\n (this.background === other.background) &&\n (this.flash === other.flash) );\n }\n\n 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 toString() {\n return ('color=' + this.foreground + ', underline=' + this.underline + ', italics=' + this.italics +\n ', background=' + this.background + ', flash=' + this.flash);\n }\n}\n\n/**\n * Unicode character with styling and background.\n * @constructor\n */\nclass StyledUnicodeChar\n{\n\n constructor(uchar, foreground, underline, italics, background, flash) {\n this.uchar = uchar || ' '; // unicode character\n this.penState = new PenState(foreground, underline,italics, background, flash);\n }\n\n reset() {\n this.uchar = ' ';\n this.penState.reset();\n }\n\n setChar(uchar, newPenState) {\n this.uchar = uchar;\n this.penState.copy(newPenState);\n }\n\n setPenState(newPenState) {\n this.penState.copy(newPenState);\n }\n\n equals(other) {\n return this.uchar === other.uchar && this.penState.equals(other.penState);\n }\n\n copy(newChar) {\n this.uchar = newChar.uchar;\n this.penState.copy(newChar.penState);\n }\n\n isEmpty() {\n return this.uchar === ' ' && this.penState.isDefault();\n }\n}\n\n/**\n * CEA-608 row consisting of NR_COLS instances of StyledUnicodeChar.\n * @constructor\n */\nclass Row {\n constructor() {\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 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 copy(other) {\n for (var i = 0 ; i < NR_COLS; i ++) {\n this.chars[i].copy(other.chars[i]);\n }\n }\n\n 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 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 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 backSpace() {\n this.moveCursor(-1);\n this.chars[this.pos].setChar(' ', this.currPenState);\n }\n\n insertChar(byte) {\n if (byte >= 0x90) { //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) +\n ' (' + 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 clearFromPos(startPos) {\n var i;\n for (i = startPos ; i < NR_COLS ; i++) {\n this.chars[i].reset();\n }\n }\n\n clear() {\n this.clearFromPos(0);\n this.pos = 0;\n this.currPenState.reset();\n }\n\n clearToEndOfRow() {\n this.clearFromPos(this.pos);\n }\n\n 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 setPenStyles(styles) {\n this.currPenState.setStyles(styles);\n var currChar = this.chars[this.pos];\n currChar.setPenState(this.currPenState);\n }\n}\n\n/**\n * Keep a CEA-608 screen of 32x15 styled characters\n * @constructor\n*/\nclass CaptionScreen {\n\n constructor() {\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 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 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 copy(other) {\n for (var i = 0 ; i < NR_ROWS ; i++) {\n this.rows[i].copy(other.rows[i]);\n }\n }\n\n 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 backSpace() {\n var row = this.rows[this.currRow];\n row.backSpace();\n }\n\n 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 insertChar(char) {\n var row = this.rows[this.currRow];\n row.insertChar(char);\n }\n\n setPen(styles) {\n var row = this.rows[this.currRow];\n row.setPenStyles(styles);\n }\n\n moveCursor(relPos) {\n var row = this.rows[this.currRow];\n row.moveCursor(relPos);\n }\n\n setCursor(absPos) {\n logger.log('INFO', 'setCursor: ' + absPos);\n var row = this.rows[this.currRow];\n row.setCursor(absPos);\n }\n\n 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\n //Make sure this only affects Roll-up Captions by checking this.nrRollUpRows\n if (this.nrRollUpRows && this.currRow !== newRow) {\n //clear all rows first\n for (let i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n\n //Copy this.nrRollUpRows rows from lastOutputScreen and place it in the newRow location\n //topRowIndex - the start of rows to copy (inclusive index)\n var topRowIndex = this.currRow + 1 - (this.nrRollUpRows);\n //We only copy if the last position was already shown.\n //We use the cueStartTime value to check this.\n const lastOutputScreen = this.lastOutputScreen;\n if (lastOutputScreen) {\n var prevLineTime = lastOutputScreen.rows[topRowIndex].cueStartTime;\n if(prevLineTime && prevLineTime < logger.time) {\n for (let i = 0; i < this.nrRollUpRows; i++) {\n this.rows[newRow-this.nrRollUpRows+i+1].copy(lastOutputScreen.rows[topRowIndex+i]);\n }\n }\n }\n }\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 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 setRollUpRows(nrRows) {\n this.nrRollUpRows = nrRows;\n }\n\n 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 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 getTextAndFormat() {\n return this.rows;\n }\n}\n\n//var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];\n\nclass Cea608Channel\n{\n constructor(channelNumber, outputFilter) {\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 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 getHandler() {\n return this.outputFilter;\n }\n\n setHandler(newHandler) {\n this.outputFilter = newHandler;\n }\n\n setPAC(pacData) {\n this.writeScreen.setPAC(pacData);\n }\n\n setBkgData(bkgData) {\n this.writeScreen.setBkgData(bkgData);\n }\n\n 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 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 ccRCL() { // 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 ccBS() { // 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 ccAOF() { // Reserved (formerly Alarm Off)\n return;\n }\n\n ccAON() { // Reserved (formerly Alarm On)\n return;\n }\n\n ccDER() { // 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 ccRU(nrRows) { //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 ccFON() { //Flash On\n logger.log('INFO', 'FON - Flash On');\n this.writeScreen.setPen({flash : true});\n }\n\n ccRDC() { // Resume Direct Captioning (switch mode to PaintOn)\n logger.log('INFO', 'RDC - Resume Direct Captioning');\n this.setMode('MODE_PAINT-ON');\n }\n\n ccTR() { // Text Restart in text mode (not supported, however)\n logger.log('INFO', 'TR');\n this.setMode('MODE_TEXT');\n }\n\n ccRTD() { // Resume Text Display in Text mode (not supported, however)\n logger.log('INFO', 'RTD');\n this.setMode('MODE_TEXT');\n }\n\n ccEDM() { // Erase Displayed Memory\n logger.log('INFO', 'EDM - Erase Displayed Memory');\n this.displayedMemory.reset();\n this.outputDataUpdate();\n }\n\n ccCR() { // Carriage Return\n logger.log('CR - Carriage Return');\n this.writeScreen.rollUp();\n this.outputDataUpdate();\n }\n\n ccENM() { //Erase Non-Displayed Memory\n logger.log('INFO', 'ENM - Erase Non-displayed Memory');\n this.nonDisplayedMemory.reset();\n }\n\n ccEOC() { //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 ccTO(nrCols) { // Tab Offset 1,2, or 3 columns\n logger.log('INFO', 'TO(' + nrCols + ') - Tab Offset');\n this.writeScreen.moveCursor(nrCols);\n }\n\n ccMIDROW(secondByte) { // 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 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()) { // 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 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\nclass Cea608Parser {\n\n constructor(field, out1, out2) {\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 getHandler(index) {\n return this.channels[index].getHandler();\n }\n\n 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 addData(t, byteList) {\n var cmdFound, a, 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]) +\n ' 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 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 { //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 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 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 { // 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 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 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 parseBackgroundAttributes(a, b) {\n var bkgData,\n index,\n chNr,\n 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 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 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\nexport default Cea608Parser;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/cea-608-parser.js","import { fixLineBreaks } from './vttparser';\n\nconst Cues = {\n\n newCue: function(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 {\n row = captionScreen.rows[r];\n indenting = true;\n indent = 0;\n text = '';\n\n if (!row.isEmpty())\n {\n for (var c=0; c<row.chars.length; c++)\n {\n if (row.chars[c].uchar.match(/\\s/) && indenting)\n {\n indent++;\n }\n else\n {\n text += row.chars[c].uchar;\n indenting = false;\n }\n }\n //To be used for cleaning-up orphaned roll-up captions\n row.cueStartTime = startTime;\n\n // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE\n if (startTime === endTime)\n {\n endTime += 0.0001;\n }\n\n cue = new VTTCue(startTime, endTime, fixLineBreaks(text.trim()));\n\n if (indent >= 16)\n {\n indent--;\n }\n else\n {\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 {\n cue.line = r + 1;\n }\n else\n {\n cue.line = (r > 7 ? r - 2 : r + 1);\n }\n cue.align = 'left';\n // Clamp the position between 0 and 100 - if out of these bounds, Firefox throws an exception and captions break\n cue.position = Math.max(0, Math.min(100, 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\\//) ? 50 : 0)));\n track.addCue(cue);\n }\n }\n }\n\n};\n\nmodule.exports = Cues;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/cues.js","/*\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\nimport EWMA from '../utils/ewma';\n\n\nclass EwmaBandWidthEstimator {\n\n constructor(hls,slow,fast,defaultEstimate) {\n this.hls = hls;\n this.defaultEstimate_ = defaultEstimate;\n this.minWeight_ = 0.001;\n this.minDelayMs_ = 50;\n this.slow_ = new EWMA(slow);\n this.fast_ = new EWMA(fast);\n }\n\n sample(durationMs,numBytes) {\n durationMs = Math.max(durationMs, this.minDelayMs_);\n var bandwidth = 8000* numBytes / durationMs,\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 canEstimate() {\n let fast = this.fast_;\n return (fast && fast.getTotalWeight() >= this.minWeight_);\n }\n\n\n 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 destroy() {\n }\n}\nexport default EwmaBandWidthEstimator;\n\n\n\n\n// WEBPACK FOOTER //\n// src/utils/ewma-bandwidth-estimator.js","/*\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\nclass EWMA {\n\n // About half of the estimated value will be from the last |halfLife| samples by weight.\n constructor(halfLife) {\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 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 getTotalWeight() {\n return this.totalWeight_;\n }\n\n 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\nexport default EWMA;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/ewma.js","'use strict';\n\nfunction noop() {}\n\nconst fakeLogger = {\n trace: noop,\n debug: noop,\n log: noop,\n warn: noop,\n info: noop,\n error: noop\n};\n\nlet 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 const func = self.console[type];\n if (func) {\n return function(...args) {\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, ...functions) {\n functions.forEach(function(type) {\n exportedLogger[type] = debugConfig[type] ? debugConfig[type].bind(debugConfig) : consolePrintFn(type);\n });\n}\n\nexport var enableLogs = function(debugConfig) {\n if (debugConfig === true || typeof debugConfig === 'object') {\n exportLoggerFunctions(debugConfig,\n // Remove out from list here to hard-disable a log-level\n //'trace',\n 'debug',\n 'log',\n 'info',\n 'warn',\n 'error'\n );\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 }\n else {\n exportedLogger = fakeLogger;\n }\n};\n\nexport var logger = exportedLogger;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/logger.js","/**\n * TimeRanges to string helper\n */\n\nconst TimeRanges = {\n toString : function(r) {\n var log = '', 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\nmodule.exports = TimeRanges;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/timeRanges.js","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport default (function() {\n if (typeof window !== 'undefined' && window.VTTCue) {\n return window.VTTCue;\n }\n\n var autoKeyword = 'auto';\n var directionSetting = {\n '': true,\n lr: true,\n rl: true\n };\n var alignSetting = {\n start: true,\n middle: true,\n end: true,\n left: true,\n right: true\n };\n\n function findDirectionSetting(value) {\n if (typeof value !== 'string') {\n return false;\n }\n var dir = directionSetting[value.toLowerCase()];\n return dir ? value.toLowerCase() : false;\n }\n\n function findAlignSetting(value) {\n if (typeof value !== 'string') {\n return false;\n }\n var align = alignSetting[value.toLowerCase()];\n return align ? value.toLowerCase() : false;\n }\n\n function extend(obj) {\n var i = 1;\n for (; i < arguments.length; i++) {\n var cobj = arguments[i];\n for (var p in cobj) {\n obj[p] = cobj[p];\n }\n }\n\n return obj;\n }\n\n function VTTCue(startTime, endTime, text) {\n var cue = this;\n var isIE8 = (function () {\n if (typeof navigator === 'undefined') {\n return;\n }\n return (/MSIE\\s8\\.0/).test(navigator.userAgent);\n })();\n var baseObj = {};\n\n if (isIE8) {\n cue = document.createElement('custom');\n } else {\n baseObj.enumerable = true;\n }\n\n /**\n * Shim implementation specific properties. These properties are not in\n * the spec.\n */\n\n // Lets us know when the VTTCue's data has changed in such a way that we need\n // to recompute its display state. This lets us compute its display state\n // lazily.\n cue.hasBeenReset = false;\n\n /**\n * VTTCue and TextTrackCue properties\n * http://dev.w3.org/html5/webvtt/#vttcue-interface\n */\n\n var _id = '';\n var _pauseOnExit = false;\n var _startTime = startTime;\n var _endTime = endTime;\n var _text = text;\n var _region = null;\n var _vertical = '';\n var _snapToLines = true;\n var _line = 'auto';\n var _lineAlign = 'start';\n var _position = 50;\n var _positionAlign = 'middle';\n var _size = 50;\n var _align = 'middle';\n\n Object.defineProperty(cue, 'id', extend({}, baseObj, {\n get: function () {\n return _id;\n },\n set: function (value) {\n _id = '' + value;\n }\n }));\n\n Object.defineProperty(cue, 'pauseOnExit', extend({}, baseObj, {\n get: function () {\n return _pauseOnExit;\n },\n set: function (value) {\n _pauseOnExit = !!value;\n }\n }));\n\n Object.defineProperty(cue, 'startTime', extend({}, baseObj, {\n get: function () {\n return _startTime;\n },\n set: function (value) {\n if (typeof value !== 'number') {\n throw new TypeError('Start time must be set to a number.');\n }\n _startTime = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'endTime', extend({}, baseObj, {\n get: function () {\n return _endTime;\n },\n set: function (value) {\n if (typeof value !== 'number') {\n throw new TypeError('End time must be set to a number.');\n }\n _endTime = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'text', extend({}, baseObj, {\n get: function () {\n return _text;\n },\n set: function (value) {\n _text = '' + value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'region', extend({}, baseObj, {\n get: function () {\n return _region;\n },\n set: function (value) {\n _region = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'vertical', extend({}, baseObj, {\n get: function () {\n return _vertical;\n },\n set: function (value) {\n var setting = findDirectionSetting(value);\n // Have to check for false because the setting an be an empty string.\n if (setting === false) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _vertical = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'snapToLines', extend({}, baseObj, {\n get: function () {\n return _snapToLines;\n },\n set: function (value) {\n _snapToLines = !!value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'line', extend({}, baseObj, {\n get: function () {\n return _line;\n },\n set: function (value) {\n if (typeof value !== 'number' && value !== autoKeyword) {\n throw new SyntaxError('An invalid number or illegal string was specified.');\n }\n _line = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'lineAlign', extend({}, baseObj, {\n get: function () {\n return _lineAlign;\n },\n set: function (value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _lineAlign = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'position', extend({}, baseObj, {\n get: function () {\n return _position;\n },\n set: function (value) {\n if (value < 0 || value > 100) {\n throw new Error('Position must be between 0 and 100.');\n }\n _position = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'positionAlign', extend({}, baseObj, {\n get: function () {\n return _positionAlign;\n },\n set: function (value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _positionAlign = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'size', extend({}, baseObj, {\n get: function () {\n return _size;\n },\n set: function (value) {\n if (value < 0 || value > 100) {\n throw new Error('Size must be between 0 and 100.');\n }\n _size = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'align', extend({}, baseObj, {\n get: function () {\n return _align;\n },\n set: function (value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _align = setting;\n this.hasBeenReset = true;\n }\n }));\n\n /**\n * Other <track> spec defined properties\n */\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state\n cue.displayState = undefined;\n\n if (isIE8) {\n return cue;\n }\n }\n\n /**\n * VTTCue methods\n */\n\n VTTCue.prototype.getCueAsHTML = function () {\n // Assume WebVTT.convertCueToDOMTree is on the global.\n var WebVTT = window.WebVTT;\n return WebVTT.convertCueToDOMTree(window, this.text);\n };\n\n return VTTCue;\n})();\n\n\n\n// WEBPACK FOOTER //\n// src/utils/vttcue.js","/*\n * Source: https://github.com/mozilla/vtt.js/blob/master/dist/vtt.js#L1716\n */\n\nimport VTTCue from './vttcue';\n\nconst StringDecoder = function StringDecoder() {\n return {\n decode: function(data) {\n if (!data) {\n return '';\n }\n if (typeof data !== 'string') {\n throw new Error('Error - expected string data.');\n }\n return decodeURIComponent(encodeURIComponent(data));\n },\n };\n };\n\nfunction VTTParser() {\n this.window = window;\n this.state = 'INITIAL';\n this.buffer = '';\n this.decoder = new StringDecoder();\n this.regionList = [];\n}\n\n\n// Try to parse input as a time stamp.\nfunction parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(':', ''), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}\n\n// A settings object holds key/value pairs and will ignore anything but the first\n// assignment to a specific key.\nfunction Settings() {\n this.values = Object.create(null);\n}\n\nSettings.prototype = {\n // Only accept the first assignment to any key.\n set: function(k, v) {\n if (!this.get(k) && v !== '') {\n this.values[k] = v;\n }\n },\n // Return the value for a key, or a default value.\n // If 'defaultKey' is passed then 'dflt' is assumed to be an object with\n // a number of possible default values as properties where 'defaultKey' is\n // the key of the property that will be chosen; otherwise it's assumed to be\n // a single value.\n get: function(k, dflt, defaultKey) {\n if (defaultKey) {\n return this.has(k) ? this.values[k] : dflt[defaultKey];\n }\n return this.has(k) ? this.values[k] : dflt;\n },\n // Check whether we have a value for a key.\n has: function(k) {\n return k in this.values;\n },\n // Accept a setting if its one of the given alternatives.\n alt: function(k, v, a) {\n for (var n = 0; n < a.length; ++n) {\n if (v === a[n]) {\n this.set(k, v);\n break;\n }\n }\n },\n // Accept a setting if its a valid (signed) integer.\n integer: function(k, v) {\n if (/^-?\\d+$/.test(v)) { // integer\n this.set(k, parseInt(v, 10));\n }\n },\n // Accept a setting if its a valid percentage.\n percent: function(k, v) {\n var m;\n if ((m = v.match(/^([\\d]{1,3})(\\.[\\d]*)?%$/))) {\n v = parseFloat(v);\n if (v >= 0 && v <= 100) {\n this.set(k, v);\n return true;\n }\n }\n return false;\n }\n};\n\n// Helper function to parse input into groups separated by 'groupDelim', and\n// interprete each group as a key/value pair separated by 'keyValueDelim'.\nfunction parseOptions(input, callback, keyValueDelim, groupDelim) {\n var groups = groupDelim ? input.split(groupDelim) : [input];\n for (var i in groups) {\n if (typeof groups[i] !== 'string') {\n continue;\n }\n var kv = groups[i].split(keyValueDelim);\n if (kv.length !== 2) {\n continue;\n }\n var k = kv[0];\n var v = kv[1];\n callback(k, v);\n }\n}\n\nvar defaults = new VTTCue(0, 0, 0);\n// 'middle' was changed to 'center' in the spec: https://github.com/w3c/webvtt/pull/244\n// Chrome and Safari don't yet support this change, but FF does\nvar center = defaults.align === 'middle' ? 'middle' : 'center';\n\nfunction parseCue(input, cue, regionList) {\n // Remember the original input if we need to throw an error.\n var oInput = input;\n // 4.1 WebVTT timestamp\n function consumeTimeStamp() {\n var ts = parseTimeStamp(input);\n if (ts === null) {\n throw new Error('Malformed timestamp: ' + oInput);\n }\n // Remove time stamp from input.\n input = input.replace(/^[^\\sa-zA-Z-]+/, '');\n return ts;\n }\n\n // 4.4.2 WebVTT cue settings\n function consumeCueSettings(input, cue) {\n var settings = new Settings();\n\n parseOptions(input, function(k, v) {\n switch (k) {\n case 'region':\n // Find the last region we parsed with the same region id.\n for (var i = regionList.length - 1; i >= 0; i--) {\n if (regionList[i].id === v) {\n settings.set(k, regionList[i].region);\n break;\n }\n }\n break;\n case 'vertical':\n settings.alt(k, v, ['rl', 'lr']);\n break;\n case 'line':\n var vals = v.split(','),\n vals0 = vals[0];\n settings.integer(k, vals0);\n if (settings.percent(k, vals0)) {\n settings.set('snapToLines', false);\n }\n settings.alt(k, vals0, ['auto']);\n if (vals.length === 2) {\n settings.alt('lineAlign', vals[1], ['start', center, 'end']);\n }\n break;\n case 'position':\n vals = v.split(',');\n settings.percent(k, vals[0]);\n if (vals.length === 2) {\n settings.alt('positionAlign', vals[1], ['start', center, 'end', 'line-left', 'line-right', 'auto']);\n }\n break;\n case 'size':\n settings.percent(k, v);\n break;\n case 'align':\n settings.alt(k, v, ['start', center, 'end', 'left', 'right']);\n break;\n }\n }, /:/, /\\s/);\n\n // Apply default values for any missing fields.\n cue.region = settings.get('region', null);\n cue.vertical = settings.get('vertical', '');\n var line = settings.get('line', 'auto');\n if (line === 'auto' && defaults.line === -1) {\n // set numeric line number for Safari\n line = -1;\n }\n cue.line = line;\n cue.lineAlign = settings.get('lineAlign', 'start');\n cue.snapToLines = settings.get('snapToLines', true);\n cue.size = settings.get('size', 100);\n cue.align = settings.get('align', center);\n var position = settings.get('position', 'auto');\n if (position === 'auto' && defaults.position === 50) {\n // set numeric position for Safari\n position = cue.align === 'start' || cue.align === 'left' ? 0 : cue.align === 'end' || cue.align === 'right' ? 100 : 50;\n }\n cue.position = position;\n }\n\n function skipWhitespace() {\n input = input.replace(/^\\s+/, '');\n }\n\n // 4.1 WebVTT cue timings.\n skipWhitespace();\n cue.startTime = consumeTimeStamp(); // (1) collect cue start time\n skipWhitespace();\n if (input.substr(0, 3) !== '-->') { // (3) next characters must match '-->'\n throw new Error('Malformed time stamp (time stamps must be separated by \\'-->\\'): ' +\n oInput);\n }\n input = input.substr(3);\n skipWhitespace();\n cue.endTime = consumeTimeStamp(); // (5) collect cue end time\n\n // 4.1 WebVTT cue settings list.\n skipWhitespace();\n consumeCueSettings(input, cue);\n}\n\nfunction fixLineBreaks(input) {\n return input.replace(/<br(?: \\/)?>/gi, '\\n');\n}\n\nVTTParser.prototype = {\n parse: function(data) {\n var self = this;\n\n // If there is no data then we won't decode it, but will just try to parse\n // whatever is in buffer already. This may occur in circumstances, for\n // example when flush() is called.\n if (data) {\n // Try to decode the data that we received.\n self.buffer += self.decoder.decode(data, {stream: true});\n }\n\n function collectNextLine() {\n var buffer = self.buffer;\n var pos = 0;\n\n buffer = fixLineBreaks(buffer);\n\n while (pos < buffer.length && buffer[pos] !== '\\r' && buffer[pos] !== '\\n') {\n ++pos;\n }\n var line = buffer.substr(0, pos);\n // Advance the buffer early in case we fail below.\n if (buffer[pos] === '\\r') {\n ++pos;\n }\n if (buffer[pos] === '\\n') {\n ++pos;\n }\n self.buffer = buffer.substr(pos);\n return line;\n }\n\n // 3.2 WebVTT metadata header syntax\n function parseHeader(input) {\n parseOptions(input, function(k, v) {\n switch (k) {\n case 'Region':\n // 3.3 WebVTT region metadata header syntax\n console.log('parse region', v);\n //parseRegion(v);\n break;\n }\n }, /:/);\n }\n\n // 5.1 WebVTT file parsing.\n try {\n var line;\n if (self.state === 'INITIAL') {\n // We can't start parsing until we have the first line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n line = collectNextLine();\n\n var m = line.match(/^WEBVTT([ \\t].*)?$/);\n if (!m || !m[0]) {\n throw new Error('Malformed WebVTT signature.');\n }\n\n self.state = 'HEADER';\n }\n\n var alreadyCollectedLine = false;\n while (self.buffer) {\n // We can't parse a line until we have the full line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n if (!alreadyCollectedLine) {\n line = collectNextLine();\n } else {\n alreadyCollectedLine = false;\n }\n\n switch (self.state) {\n case 'HEADER':\n // 13-18 - Allow a header (metadata) under the WEBVTT line.\n if (/:/.test(line)) {\n parseHeader(line);\n } else if (!line) {\n // An empty line terminates the header and starts the body (cues).\n self.state = 'ID';\n }\n continue;\n case 'NOTE':\n // Ignore NOTE blocks.\n if (!line) {\n self.state = 'ID';\n }\n continue;\n case 'ID':\n // Check for the start of NOTE blocks.\n if (/^NOTE($|[ \\t])/.test(line)) {\n self.state = 'NOTE';\n break;\n }\n // 19-29 - Allow any number of line terminators, then initialize new cue values.\n if (!line) {\n continue;\n }\n self.cue = new VTTCue(0, 0, '');\n self.state = 'CUE';\n // 30-39 - Check if self line contains an optional identifier or timing data.\n if (line.indexOf('-->') === -1) {\n self.cue.id = line;\n continue;\n }\n // Process line as start of a cue.\n /*falls through*/\n case 'CUE':\n // 40 - Collect cue timings and settings.\n try {\n parseCue(line, self.cue, self.regionList);\n } catch (e) {\n // In case of an error ignore rest of the cue.\n self.cue = null;\n self.state = 'BADCUE';\n continue;\n }\n self.state = 'CUETEXT';\n continue;\n case 'CUETEXT':\n var hasSubstring = line.indexOf('-->') !== -1;\n // 34 - If we have an empty line then report the cue.\n // 35 - If we have the special substring '-->' then report the cue,\n // but do not collect the line as we need to process the current\n // one as a new cue.\n if (!line || hasSubstring && (alreadyCollectedLine = true)) {\n // We are done parsing self cue.\n if (self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n self.state = 'ID';\n continue;\n }\n if (self.cue.text) {\n self.cue.text += '\\n';\n }\n self.cue.text += line;\n continue;\n case 'BADCUE': // BADCUE\n // 54-62 - Collect and discard the remaining cue.\n if (!line) {\n self.state = 'ID';\n }\n continue;\n }\n }\n } catch (e) {\n\n // If we are currently parsing a cue, report what we have.\n if (self.state === 'CUETEXT' && self.cue && self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n // Enter BADWEBVTT state if header was not parsed correctly otherwise\n // another exception occurred so enter BADCUE state.\n self.state = self.state === 'INITIAL' ? 'BADWEBVTT' : 'BADCUE';\n }\n return this;\n },\n flush: function() {\n var self = this;\n try {\n // Finish decoding the stream.\n self.buffer += self.decoder.decode();\n // Synthesize the end of the current cue or region.\n if (self.cue || self.state === 'HEADER') {\n self.buffer += '\\n\\n';\n self.parse();\n }\n // If we've flushed, parsed, and we're still on the INITIAL state then\n // that means we don't have enough of the stream to parse the first\n // line.\n if (self.state === 'INITIAL') {\n throw new Error('Malformed WebVTT signature.');\n }\n } catch (e) {\n throw e;\n }\n if (self.onflush) {\n self.onflush();\n }\n return this;\n }\n};\n\nexport { fixLineBreaks };\n\nexport default VTTParser;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/vttparser.js","import VTTParser from './vttparser';\n\n// String.prototype.startsWith is not supported in IE11\nconst startsWith = function(inputString, searchString, position) {\n return inputString.substr(position || 0, searchString.length) === searchString;\n};\n\nconst cueString2millis = function(timeString) {\n let ts = parseInt(timeString.substr(-3));\n let secs = parseInt(timeString.substr(-6,2));\n let mins = parseInt(timeString.substr(-9,2));\n let hours = timeString.length > 9 ? parseInt(timeString.substr(0, timeString.indexOf(':'))) : 0;\n\n if (isNaN(ts) || isNaN(secs) || isNaN(mins) || isNaN(hours)) {\n return -1;\n }\n\n ts += 1000 * secs;\n ts += 60*1000 * mins;\n ts += 60*60*1000 * hours;\n\n return ts;\n};\n\n// From https://github.com/darkskyapp/string-hash\nconst hash = function(text) {\n let hash = 5381;\n let i = text.length;\n while (i) {\n hash = (hash * 33) ^ text.charCodeAt(--i);\n }\n return (hash >>> 0).toString();\n};\n\nconst calculateOffset = function(vttCCs, cc, presentationTime) {\n let currCC = vttCCs[cc];\n let prevCC = vttCCs[currCC.prevCC];\n\n // This is the first discontinuity or cues have been processed since the last discontinuity\n // Offset = current discontinuity time\n if (!prevCC || (!prevCC.new && currCC.new)) {\n vttCCs.ccOffset = vttCCs.presentationOffset = currCC.start;\n currCC.new = false;\n return;\n }\n\n // There have been discontinuities since cues were last parsed.\n // Offset = time elapsed\n while (prevCC && prevCC.new) {\n vttCCs.ccOffset += currCC.start - prevCC.start;\n currCC.new = false;\n currCC = prevCC;\n prevCC = vttCCs[currCC.prevCC];\n }\n\n vttCCs.presentationOffset = presentationTime;\n};\n\nconst WebVTTParser = {\n parse: function(vttByteArray, syncPTS, vttCCs, cc, callBack, errorCallBack) {\n // Convert byteArray into string, replacing any somewhat exotic linefeeds with \"\\n\", then split on that character.\n let re = /\\r\\n|\\n\\r|\\n|\\r/g;\n let vttLines = String.fromCharCode.apply(null, new Uint8Array(vttByteArray)).trim().replace(re, '\\n').split('\\n');\n let cueTime = '00:00.000';\n let mpegTs = 0;\n let localTime = 0;\n let presentationTime = 0;\n let cues = [];\n let parsingError;\n let inHeader = true;\n // let VTTCue = VTTCue || window.TextTrackCue;\n\n // Create parser object using VTTCue with TextTrackCue fallback on certain browsers.\n let parser = new VTTParser();\n\n parser.oncue = function(cue) {\n // Adjust cue timing; clamp cues to start no earlier than - and drop cues that don't end after - 0 on timeline.\n let currCC = vttCCs[cc];\n let cueOffset = vttCCs.ccOffset;\n\n // Update offsets for new discontinuities\n if (currCC && currCC.new) {\n if (localTime !== undefined) {\n // When local time is provided, offset = discontinuity start time - local time\n cueOffset = vttCCs.ccOffset = currCC.start;\n } else {\n calculateOffset(vttCCs, cc, presentationTime);\n }\n }\n\n if (presentationTime) {\n // If we have MPEGTS, offset = presentation time + discontinuity offset\n cueOffset = presentationTime + vttCCs.ccOffset - vttCCs.presentationOffset;\n }\n\n cue.startTime += cueOffset - localTime;\n cue.endTime += cueOffset - localTime;\n\n // Create a unique hash id for a cue based on start/end times and text.\n // This helps timeline-controller to avoid showing repeated captions.\n cue.id = hash(cue.startTime) + hash(cue.endTime) + hash(cue.text);\n\n // Fix encoding of special characters. TODO: Test with all sorts of weird characters.\n cue.text = decodeURIComponent(escape(cue.text));\n if (cue.endTime > 0) {\n cues.push(cue);\n }\n };\n\n parser.onparsingerror = function(e) {\n parsingError = e;\n };\n\n parser.onflush = function() {\n if (parsingError && errorCallBack) {\n errorCallBack(parsingError);\n return;\n }\n callBack(cues);\n };\n\n // Go through contents line by line.\n vttLines.forEach(line => {\n if (inHeader) {\n // Look for X-TIMESTAMP-MAP in header.\n if (startsWith(line, 'X-TIMESTAMP-MAP=')) {\n // Once found, no more are allowed anyway, so stop searching.\n inHeader = false;\n // Extract LOCAL and MPEGTS.\n line.substr(16).split(',').forEach(timestamp => {\n if (startsWith(timestamp, 'LOCAL:')) {\n cueTime = timestamp.substr(6);\n } else if (startsWith(timestamp, 'MPEGTS:')) {\n mpegTs = parseInt(timestamp.substr(7));\n }\n });\n try {\n // Calculate subtitle offset in milliseconds.\n // If sync PTS is less than zero, we have a 33-bit wraparound, which is fixed by adding 2^33 = 8589934592.\n syncPTS = syncPTS < 0 ? syncPTS + 8589934592 : syncPTS;\n // Adjust MPEGTS by sync PTS.\n mpegTs -= syncPTS;\n // Convert cue time to seconds\n localTime = cueString2millis(cueTime) / 1000;\n // Convert MPEGTS to seconds from 90kHz.\n presentationTime = mpegTs / 90000;\n\n if (localTime === -1) {\n parsingError = new Error(`Malformed X-TIMESTAMP-MAP: ${line}`);\n }\n }\n catch(e) {\n parsingError = new Error(`Malformed X-TIMESTAMP-MAP: ${line}`);\n }\n // Return without parsing X-TIMESTAMP-MAP line.\n return;\n } else if (line === '') {\n inHeader = false;\n }\n }\n // Parse line by default.\n parser.parse(line+'\\n');\n });\n\n parser.flush();\n }\n};\n\n\nmodule.exports = WebVTTParser;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/webvtt-parser.js","/**\n * XHR based logger\n*/\n\nimport {logger} from '../utils/logger';\n\nclass XhrLoader {\n\n constructor(config) {\n if (config && config.xhrSetup) {\n this.xhrSetup = config.xhrSetup;\n }\n }\n\n destroy() {\n this.abort();\n this.loader = null;\n }\n\n 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 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 loadInternal() {\n var xhr, 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 let stats = this.stats;\n stats.tfirst = 0;\n stats.loaded = 0;\n const xhrSetup = this.xhrSetup;\n\n try {\n if (xhrSetup) {\n try {\n xhrSetup(xhr, context.url);\n } catch (e) {\n // fix xhrSetup: (xhr, url) => {xhr.setRequestHeader(\"Content-Language\", \"test\");}\n // not working, as xhr.setRequestHeader expects xhr.readyState === OPEN\n xhr.open('GET', context.url, true);\n xhrSetup(xhr, context.url);\n }\n }\n if (!xhr.readyState) {\n xhr.open('GET', context.url, true);\n }\n } catch (e) {\n // IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS\n this.callbacks.onError({ code : xhr.status, text: e.message }, context);\n return;\n }\n\n if (context.rangeEnd) {\n xhr.setRequestHeader('Range','bytes=' + context.rangeStart + '-' + (context.rangeEnd-1));\n }\n xhr.onreadystatechange = this.readystatechange.bind(this);\n xhr.onprogress = this.loadprogress.bind(this);\n xhr.responseType = context.responseType;\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 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 // >= HEADERS_RECEIVED\n if (readyState >=2) {\n // clear xhr timeout and rearm it if readyState less than 4\n window.clearTimeout(this.requestTimeout);\n if (stats.tfirst === 0) {\n stats.tfirst = Math.max(performance.now(), stats.trequest);\n }\n if (readyState === 4) {\n let 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 let data,len;\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 let 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.error(`${status} while loading ${context.url}` );\n this.callbacks.onError({ code : status, text : xhr.statusText}, context);\n } else {\n // retry\n 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 } else {\n // readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout);\n }\n }\n }\n\n loadtimeout() {\n logger.warn(`timeout while loading ${this.context.url}` );\n this.callbacks.onTimeout(this.stats, this.context);\n }\n\n loadprogress(event) {\n var stats = this.stats;\n stats.loaded = event.loaded;\n if (event.lengthComputable) {\n stats.total = event.total;\n }\n let 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\nexport default XhrLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/xhr-loader.js","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"shaka-player\"), require(\"playkit-js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"shaka-player\", \"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsDash\"] = factory(require(\"shaka-player\"), require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsDash\"] = factory(root[\"shaka\"], root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///dash/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 37792bb50222e2c929fb\n\n\n// WEBPACK FOOTER //\n// webpack:/dash/webpack/bootstrap 37792bb50222e2c929fb","// @flow\nimport shaka from 'shaka-player';\nimport {registerMediaSourceAdapter, BaseMediaSourceAdapter} from 'playkit-js'\nimport {Track, VideoTrack, AudioTrack, TextTrack} from 'playkit-js'\n\n/**\n * Adapter of shaka lib for dash content\n * @classdesc\n */\nexport default class DashAdapter extends BaseMediaSourceAdapter {\n /**\n * The id of Adapter\n * @member {string} id\n * @static\n * @public\n */\n static id = 'DashAdapter';\n /**\n * The adapter logger\n * @member {any} _logger\n * @private\n * @static\n */\n static _logger = BaseMediaSourceAdapter.getLogger(DashAdapter.id);\n /**\n * The supported mime type by the dash adapter\n * @member {string} _dashMimeType\n * @static\n * @private\n */\n static _dashMimeType = 'application/dash+xml';\n /**\n * The shaka player instance\n * @member {any} _shaka\n * @private\n */\n _shaka: any;\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n _loadPromise: ?Promise<Object>;\n\n /**\n * Checks if dash adapter can play a given mime type\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @returns {boolean} - Whether the dash adapter can play a specific mime type\n * @static\n */\n static canPlayType(mimeType: string): boolean {\n let canPlayType = typeof mimeType === 'string' ? mimeType.toLowerCase() === DashAdapter._dashMimeType : false;\n DashAdapter._logger.debug('canPlayType result for mimeType: ' + mimeType + ' is ' + canPlayType.toString());\n return canPlayType;\n }\n\n /**\n * Checks if the dash adapter is supported\n * @function isSupported\n * @returns {boolean} - Whether dash is supported.\n * @static\n */\n static isSupported(): boolean {\n shaka.polyfill.installAll();\n let isSupported = shaka.Player.isBrowserSupported();\n DashAdapter._logger.debug('isSupported:' + isSupported);\n return isSupported;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to the dash adapter\n * @param {Object} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n constructor(videoElement: HTMLVideoElement, source: Object, config: Object = {}) {\n DashAdapter._logger.debug('Creating adapter. Shaka version: ' + shaka.Player.version);\n super(videoElement, source, config);\n this._shaka = new shaka.Player(videoElement);\n this._shaka.configure(config);\n this._addBindings();\n }\n\n /**\n * Add the required bindings to shaka.\n * @function _addBindings\n * @private\n * @returns {void}\n */\n _addBindings(): void {\n this._shaka.addEventListener('adaptation', this._onAdaptation.bind(this));\n this._shaka.addEventListener('error', this._onError.bind(this));\n }\n\n /**\n * Remove the bindings to shaka.\n * @function _removeBindings\n * @private\n * @returns {void}\n */\n _removeBindings(): void {\n this._shaka.removeEventListener('adaptation', this._onAdaptation);\n this._shaka.removeEventListener('error', this._onError);\n }\n\n /**\n * Load the video source\n * @function load\n * @override\n */\n load(): Promise<Object> {\n if (!this._loadPromise) {\n this._loadPromise = new Promise((resolve, reject) => {\n if (this._sourceObj && this._sourceObj.url) {\n this._shaka.load(this._sourceObj.url).then(() => {\n let data = {tracks: this._getParsedTracks()};\n DashAdapter._logger.debug('The source has been loaded successfully');\n resolve(data);\n }).catch((error) => {\n reject(error);\n this._onError(error);\n });\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroying the dash adapter\n * @function destroy\n * @override\n */\n destroy(): void {\n DashAdapter._logger.debug('destroy');\n super.destroy();\n this._loadPromise = null;\n this._removeBindings();\n this._shaka.destroy();\n }\n\n /**\n * Get the original video tracks\n * @function _getVideoTracks\n * @returns {Array<Object>} - The original video tracks\n * @private\n */\n _getVideoTracks(): Array<Object> {\n let variantTracks = this._shaka.getVariantTracks();\n let activeVariantTrack = variantTracks.filter((variantTrack) => {\n return variantTrack.active;\n })[0];\n let videoTracks = variantTracks.filter((variantTrack) => {\n return variantTrack.audioId === activeVariantTrack.audioId;\n });\n return videoTracks;\n }\n\n /**\n * Get the original audio tracks\n * @function _getAudioTracks\n * @returns {Array<Object>} - The original audio tracks\n * @private\n */\n _getAudioTracks(): Array<Object> {\n let variantTracks = this._shaka.getVariantTracks();\n let activeVariantTrack = variantTracks.filter((variantTrack) => {\n return variantTrack.active;\n })[0];\n let audioTracks = variantTracks.filter((variantTrack) => {\n return variantTrack.videoId === activeVariantTrack.videoId;\n });\n return audioTracks;\n }\n\n /**\n * Get the parsed tracks\n * @function _getParsedTracks\n * @returns {Array<Track>} - The parsed tracks\n * @private\n */\n _getParsedTracks(): Array<Track> {\n let videoTracks = this._getParsedVideoTracks();\n let audioTracks = this._getParsedAudioTracks();\n let textTracks = this._getParsedTextTracks();\n return videoTracks.concat(audioTracks).concat(textTracks);\n }\n\n /**\n * Get the parsed video tracks\n * @function _getParsedVideoTracks\n * @returns {Array<VideoTrack>} - The parsed video tracks\n * @private\n */\n _getParsedVideoTracks(): Array<VideoTrack> {\n let videoTracks = this._getVideoTracks();\n let parsedTracks = [];\n if (videoTracks) {\n for (let i = 0; i < videoTracks.length; i++) {\n let settings = {\n id: videoTracks[i].id,\n bandwidth: videoTracks[i].bandwidth,\n active: videoTracks[i].active,\n label: videoTracks[i].label,\n index: i\n };\n parsedTracks.push(new VideoTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed audio tracks\n * @function _getParsedAudioTracks\n * @returns {Array<AudioTrack>} - The parsed audio tracks\n * @private\n */\n _getParsedAudioTracks(): Array<AudioTrack> {\n let audioTracks = this._getAudioTracks();\n let parsedTracks = [];\n if (audioTracks) {\n for (let i = 0; i < audioTracks.length; i++) {\n let settings = {\n id: audioTracks[i].id,\n active: audioTracks[i].active,\n label: audioTracks[i].label,\n language: audioTracks[i].language,\n index: i\n };\n parsedTracks.push(new AudioTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed text tracks\n * @function _getParsedTextTracks\n * @returns {Array<TextTrack>} - The parsed text tracks\n * @private\n */\n _getParsedTextTracks(): Array<TextTrack> {\n let textTracks = this._shaka.getTextTracks();\n let parsedTracks = [];\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n let settings = {\n kind: textTracks[i].kind ? textTracks[i].kind + 's' : \"\",\n active: textTracks[i].active,\n label: textTracks[i].label,\n language: textTracks[i].language,\n index: i\n };\n parsedTracks.push(new TextTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Select a video track\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the video track to select\n * @returns {void}\n * @public\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n let videoTracks = this._getVideoTracks();\n if ((videoTrack instanceof VideoTrack) && videoTracks) {\n let selectedVideoTrack = videoTracks[videoTrack.index];\n if (selectedVideoTrack) {\n this._shaka.configure({abr:{enabled: false}});\n if (!selectedVideoTrack.active) {\n this._shaka.selectVariantTrack(videoTracks[videoTrack.index], true);\n this._onTrackChanged(videoTrack);\n }\n }\n }\n }\n\n /**\n * Select an audio track\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select\n * @returns {void}\n * @public\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n if ((audioTrack instanceof AudioTrack) && !audioTrack.active) {\n this._shaka.selectAudioLanguage(audioTrack.language);\n this._onTrackChanged(audioTrack);\n }\n }\n\n /**\n * Select a text track\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select\n * @returns {void}\n * @public\n */\n selectTextTrack(textTrack: TextTrack): void {\n if ((textTrack instanceof TextTrack) && !textTrack.active && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions')) {\n this._shaka.selectTextLanguage(textTrack.language);\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Enables adaptive bitrate switching\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n this._shaka.configure({abr:{enabled: true}});\n }\n\n /**\n * An handler to shaka adaptation event\n * @function _onAdaptation\n * @returns {void}\n * @private\n */\n _onAdaptation(): void {\n let selectedVideoTrack = this._getParsedVideoTracks().filter(function (videoTrack) {\n return videoTrack.active;\n })[0];\n this._onTrackChanged(selectedVideoTrack);\n }\n\n /**\n * An handler to shaka error event\n * @function _onError\n * @param {any} error - the error\n * @returns {void}\n * @private\n */\n _onError(error: any): void {\n DashAdapter._logger.error(error);\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * In case the adapter preformed a load it will return the manifest url.\n * @public\n * @returns {string} - The src url.\n */\n get src(): string {\n if (this._loadPromise && this._sourceObj) {\n return this._sourceObj.url;\n }\n return \"\";\n }\n}\n\n// Register DashAdapter to the media source adapter manager\nif (DashAdapter.isSupported()) {\n registerMediaSourceAdapter(DashAdapter);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./dash-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///dash/dash-adapter.js","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"shaka-player\",\"commonjs2\":\"shaka-player\",\"amd\":\"shaka-player\",\"root\":\"shaka\"}\n// module id = 1\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/dash/external {\"commonjs\":\"shaka-player\",\"commonjs2\":\"shaka-player\",\"amd\":\"shaka-player\",\"root\":\"shaka\"}","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}\n// module id = 2\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/dash/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","// Copyright 2006 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Bootstrap for the Google JS Library (Closure).\n *\n * In uncompiled mode base.js will write out Closure's deps file, unless the\n * global <code>CLOSURE_NO_DEPS</code> is set to true. This allows projects to\n * include their own deps file(s) from different locations.\n *\n *\n * @provideGoog\n */\n\n\n/**\n * @define {boolean} Overridden to true by the compiler when --closure_pass\n * or --mark_as_compiled is specified.\n */\nvar COMPILED = false;\n\n\n/**\n * Base namespace for the Closure library. Checks to see goog is already\n * defined in the current scope before assigning to prevent clobbering if\n * base.js is loaded more than once.\n *\n * @const\n */\nvar goog = goog || {};\n\n\n/**\n * Reference to the global context. In most cases this will be 'window'.\n */\ngoog.global = this;\n\n\n/**\n * A hook for overriding the define values in uncompiled mode.\n *\n * In uncompiled mode, {@code CLOSURE_UNCOMPILED_DEFINES} may be defined before\n * loading base.js. If a key is defined in {@code CLOSURE_UNCOMPILED_DEFINES},\n * {@code goog.define} will use the value instead of the default value. This\n * allows flags to be overwritten without compilation (this is normally\n * accomplished with the compiler's \"define\" flag).\n *\n * Example:\n * <pre>\n * var CLOSURE_UNCOMPILED_DEFINES = {'goog.DEBUG': false};\n * </pre>\n *\n * @type {Object.<string, (string|number|boolean)>|undefined}\n */\ngoog.global.CLOSURE_UNCOMPILED_DEFINES;\n\n\n/**\n * A hook for overriding the define values in uncompiled or compiled mode,\n * like CLOSURE_UNCOMPILED_DEFINES but effective in compiled code. In\n * uncompiled code CLOSURE_UNCOMPILED_DEFINES takes precedence.\n *\n * Also unlike CLOSURE_UNCOMPILED_DEFINES the values must be number, boolean or\n * string literals or the compiler will emit an error.\n *\n * While any @define value may be set, only those set with goog.define will be\n * effective for uncompiled code.\n *\n * Example:\n * <pre>\n * var CLOSURE_DEFINES = {'goog.DEBUG': false};\n * </pre>\n *\n * @type {Object.<string, (string|number|boolean)>|undefined}\n */\ngoog.global.CLOSURE_DEFINES;\n\n\n/**\n * Returns true if the specified value is not undefined.\n * WARNING: Do not use this to test if an object has a property. Use the in\n * operator instead.\n *\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is defined.\n */\ngoog.isDef = function(val) {\n // void 0 always evaluates to undefined and hence we do not need to depend on\n // the definition of the global variable named 'undefined'.\n return val !== void 0;\n};\n\n\n/**\n * Builds an object structure for the provided namespace path, ensuring that\n * names that already exist are not overwritten. For example:\n * \"a.b.c\" -> a = {};a.b={};a.b.c={};\n * Used by goog.provide and goog.exportSymbol.\n * @param {string} name name of the object that this file defines.\n * @param {*=} opt_object the object to expose at the end of the path.\n * @param {Object=} opt_objectToExportTo The object to add the path to; default\n * is |goog.global|.\n * @private\n */\ngoog.exportPath_ = function(name, opt_object, opt_objectToExportTo) {\n var parts = name.split('.');\n var cur = opt_objectToExportTo || goog.global;\n\n // Internet Explorer exhibits strange behavior when throwing errors from\n // methods externed in this manner. See the testExportSymbolExceptions in\n // base_test.html for an example.\n if (!(parts[0] in cur) && cur.execScript) {\n cur.execScript('var ' + parts[0]);\n }\n\n // Certain browsers cannot parse code in the form for((a in b); c;);\n // This pattern is produced by the JSCompiler when it collapses the\n // statement above into the conditional loop below. To prevent this from\n // happening, use a for-loop and reserve the init logic as below.\n\n // Parentheses added to eliminate strict JS warning in Firefox.\n for (var part; parts.length && (part = parts.shift());) {\n if (!parts.length && goog.isDef(opt_object)) {\n // last part and we have an object; use it\n cur[part] = opt_object;\n } else if (cur[part]) {\n cur = cur[part];\n } else {\n cur = cur[part] = {};\n }\n }\n};\n\n\n/**\n * Defines a named value. In uncompiled mode, the value is retreived from\n * CLOSURE_DEFINES or CLOSURE_UNCOMPILED_DEFINES if the object is defined and\n * has the property specified, and otherwise used the defined defaultValue.\n * When compiled, the default can be overridden using compiler command-line\n * options.\n *\n * @param {string} name The distinguished name to provide.\n * @param {string|number|boolean} defaultValue\n */\ngoog.define = function(name, defaultValue) {\n var value = defaultValue;\n if (!COMPILED) {\n if (goog.global.CLOSURE_UNCOMPILED_DEFINES &&\n Object.prototype.hasOwnProperty.call(\n goog.global.CLOSURE_UNCOMPILED_DEFINES, name)) {\n value = goog.global.CLOSURE_UNCOMPILED_DEFINES[name];\n } else if (goog.global.CLOSURE_DEFINES &&\n Object.prototype.hasOwnProperty.call(\n goog.global.CLOSURE_DEFINES, name)) {\n value = goog.global.CLOSURE_DEFINES[name];\n }\n }\n goog.exportPath_(name, value);\n};\n\n\n/**\n * @define {boolean} DEBUG is provided as a convenience so that debugging code\n * that should not be included in a production js_binary can be easily stripped\n * by specifying --define goog.DEBUG=false to the JSCompiler. For example, most\n * toString() methods should be declared inside an \"if (goog.DEBUG)\" conditional\n * because they are generally used for debugging purposes and it is difficult\n * for the JSCompiler to statically determine whether they are used.\n */\ngoog.DEBUG = true;\n\n\n/**\n * @define {string} LOCALE defines the locale being used for compilation. It is\n * used to select locale specific data to be compiled in js binary. BUILD rule\n * can specify this value by \"--define goog.LOCALE=<locale_name>\" as JSCompiler\n * option.\n *\n * Take into account that the locale code format is important. You should use\n * the canonical Unicode format with hyphen as a delimiter. Language must be\n * lowercase, Language Script - Capitalized, Region - UPPERCASE.\n * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN.\n *\n * See more info about locale codes here:\n * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers\n *\n * For language codes you should use values defined by ISO 693-1. See it here\n * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from\n * this rule: the Hebrew language. For legacy reasons the old code (iw) should\n * be used instead of the new code (he), see http://wiki/Main/IIISynonyms.\n */\ngoog.define('goog.LOCALE', 'en'); // default to en\n\n\n/**\n * @define {boolean} Whether this code is running on trusted sites.\n *\n * On untrusted sites, several native functions can be defined or overridden by\n * external libraries like Prototype, Datejs, and JQuery and setting this flag\n * to false forces closure to use its own implementations when possible.\n *\n * If your JavaScript can be loaded by a third party site and you are wary about\n * relying on non-standard implementations, specify\n * \"--define goog.TRUSTED_SITE=false\" to the JSCompiler.\n */\ngoog.define('goog.TRUSTED_SITE', true);\n\n\n/**\n * @define {boolean} Whether a project is expected to be running in strict mode.\n *\n * This define can be used to trigger alternate implementations compatible with\n * running in EcmaScript Strict mode or warn about unavailable functionality.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode\n */\ngoog.define('goog.STRICT_MODE_COMPATIBLE', false);\n\n\n/**\n * Creates object stubs for a namespace. The presence of one or more\n * goog.provide() calls indicate that the file defines the given\n * objects/namespaces. Provided objects must not be null or undefined.\n * Build tools also scan for provide/require statements\n * to discern dependencies, build dependency files (see deps.js), etc.\n * @see goog.require\n * @param {string} name Namespace provided by this file in the form\n * \"goog.package.part\".\n */\ngoog.provide = function(name) {\n if (!COMPILED) {\n // Ensure that the same namespace isn't provided twice.\n // A goog.module/goog.provide maps a goog.require to a specific file\n if (goog.isProvided_(name)) {\n throw Error('Namespace \"' + name + '\" already declared.');\n }\n delete goog.implicitNamespaces_[name];\n\n var namespace = name;\n while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) {\n if (goog.getObjectByName(namespace)) {\n break;\n }\n goog.implicitNamespaces_[namespace] = true;\n }\n }\n\n goog.exportPath_(name);\n};\n\n\n/**\n * Forward declares a symbol. This is an indication to the compiler that the\n * symbol may be used in the source yet is not required and may not be provided\n * in compilation.\n *\n * The most common usage of forward declaration is code that takes a type as a\n * function parameter but does not need to require it. By forward declaring\n * instead of requiring, no hard dependency is made, and (if not required\n * elsewhere) the namespace may never be required and thus, not be pulled\n * into the JavaScript binary. If it is required elsewhere, it will be type\n * checked as normal.\n *\n *\n * @param {string} name The namespace to forward declare in the form of\n * \"goog.package.part\".\n */\ngoog.forwardDeclare = function(name) {};\n\n\nif (!COMPILED) {\n\n /**\n * Check if the given name has been goog.provided. This will return false for\n * names that are available only as implicit namespaces.\n * @param {string} name name of the object to look for.\n * @return {boolean} Whether the name has been provided.\n * @private\n */\n goog.isProvided_ = function(name) {\n return (!goog.implicitNamespaces_[name] &&\n goog.isDefAndNotNull(goog.getObjectByName(name)));\n };\n\n /**\n * Namespaces implicitly defined by goog.provide. For example,\n * goog.provide('goog.events.Event') implicitly declares that 'goog' and\n * 'goog.events' must be namespaces.\n *\n * @type {Object.<string, (boolean|undefined)>}\n * @private\n */\n goog.implicitNamespaces_ = {};\n}\n\n\n/**\n * Returns an object based on its fully qualified external name. The object\n * is not found if null or undefined. If you are using a compilation pass that\n * renames property names beware that using this function will not find renamed\n * properties.\n *\n * @param {string} name The fully qualified name.\n * @param {Object=} opt_obj The object within which to look; default is\n * |goog.global|.\n * @return {?} The value (object or primitive) or, if not found, null.\n */\ngoog.getObjectByName = function(name, opt_obj) {\n var parts = name.split('.');\n var cur = opt_obj || goog.global;\n for (var part; part = parts.shift(); ) {\n if (goog.isDefAndNotNull(cur[part])) {\n cur = cur[part];\n } else {\n return null;\n }\n }\n return cur;\n};\n\n\n/**\n * Globalizes a whole namespace, such as goog or goog.lang.\n *\n * @param {Object} obj The namespace to globalize.\n * @param {Object=} opt_global The object to add the properties to.\n * @deprecated Properties may be explicitly exported to the global scope, but\n * this should no longer be done in bulk.\n */\ngoog.globalize = function(obj, opt_global) {\n var global = opt_global || goog.global;\n for (var x in obj) {\n global[x] = obj[x];\n }\n};\n\n\n/**\n * Adds a dependency from a file to the files it requires.\n * @param {string} relPath The path to the js file.\n * @param {Array} provides An array of strings with the names of the objects\n * this file provides.\n * @param {Array} requires An array of strings with the names of the objects\n * this file requires.\n */\ngoog.addDependency = function(relPath, provides, requires) {\n if (goog.DEPENDENCIES_ENABLED) {\n var provide, require;\n var path = relPath.replace(/\\\\/g, '/');\n var deps = goog.dependencies_;\n for (var i = 0; provide = provides[i]; i++) {\n deps.nameToPath[provide] = path;\n }\n for (var j = 0; require = requires[j]; j++) {\n if (!(path in deps.requires)) {\n deps.requires[path] = {};\n }\n deps.requires[path][require] = true;\n }\n }\n};\n\n\n\n\n// NOTE(nnaze): The debug DOM loader was included in base.js as an original way\n// to do \"debug-mode\" development. The dependency system can sometimes be\n// confusing, as can the debug DOM loader's asynchronous nature.\n//\n// With the DOM loader, a call to goog.require() is not blocking -- the script\n// will not load until some point after the current script. If a namespace is\n// needed at runtime, it needs to be defined in a previous script, or loaded via\n// require() with its registered dependencies.\n// User-defined namespaces may need their own deps file. See http://go/js_deps,\n// http://go/genjsdeps, or, externally, DepsWriter.\n// https://developers.google.com/closure/library/docs/depswriter\n//\n// Because of legacy clients, the DOM loader can't be easily removed from\n// base.js. Work is being done to make it disableable or replaceable for\n// different environments (DOM-less JavaScript interpreters like Rhino or V8,\n// for example). See bootstrap/ for more information.\n\n\n/**\n * @define {boolean} Whether to enable the debug loader.\n *\n * If enabled, a call to goog.require() will attempt to load the namespace by\n * appending a script tag to the DOM (if the namespace has been registered).\n *\n * If disabled, goog.require() will simply assert that the namespace has been\n * provided (and depend on the fact that some outside tool correctly ordered\n * the script).\n */\ngoog.define('goog.ENABLE_DEBUG_LOADER', true);\n\n\n/**\n * @param {string} msg\n * @private\n */\ngoog.logToConsole_ = function(msg) {\n if (goog.global.console) {\n goog.global.console['error'](msg);\n }\n};\n\n\n/**\n * Implements a system for the dynamic resolution of dependencies that works in\n * parallel with the BUILD system. Note that all calls to goog.require will be\n * stripped by the JSCompiler when the --closure_pass option is used.\n * @see goog.provide\n * @param {string} name Namespace to include (as was given in goog.provide()) in\n * the form \"goog.package.part\".\n * @return {?} If called within a goog.module file, the associated namespace or\n * module otherwise null.\n */\ngoog.require = function(name) {\n\n // If the object already exists we do not need do do anything.\n if (!COMPILED) {\n if (goog.isProvided_(name)) {\n return null;\n }\n\n if (goog.ENABLE_DEBUG_LOADER) {\n var path = goog.getPathFromDeps_(name);\n if (path) {\n goog.included_[path] = true;\n goog.writeScripts_();\n return null;\n }\n }\n\n var errorMessage = 'goog.require could not find: ' + name;\n goog.logToConsole_(errorMessage);\n\n throw Error(errorMessage);\n }\n};\n\n\n/**\n * Path for included scripts.\n * @type {string}\n */\ngoog.basePath = '';\n\n\n/**\n * A hook for overriding the base path.\n * @type {string|undefined}\n */\ngoog.global.CLOSURE_BASE_PATH;\n\n\n/**\n * Whether to load Closure's deps file automatically.\n * Shaka sets this to true since we are placing deps.js in a non-standard\n * location. Running Shaka in uncompiled mode will require loading deps.js\n * explicitly.\n * @type {boolean|undefined}\n */\ngoog.global.CLOSURE_NO_DEPS = true;\n\n\n/**\n * A function to import a single script. This is meant to be overridden when\n * Closure is being run in non-HTML contexts, such as web workers. It's defined\n * in the global scope so that it can be set before base.js is loaded, which\n * allows deps.js to be imported properly.\n *\n * The function is passed the script source, which is a relative URI. It should\n * return true if the script was imported, false otherwise.\n * @type {(function(string): boolean)|undefined}\n */\ngoog.global.CLOSURE_IMPORT_SCRIPT;\n\n\n/**\n * True if goog.dependencies_ is available.\n * @const {boolean}\n */\ngoog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;\n\n\nif (goog.DEPENDENCIES_ENABLED) {\n /**\n * Object used to keep track of urls that have already been added. This record\n * allows the prevention of circular dependencies.\n * @type {Object}\n * @private\n */\n goog.included_ = {};\n\n\n /**\n * This object is used to keep track of dependencies and other data that is\n * used for loading scripts.\n * @private\n * @type {Object}\n */\n goog.dependencies_ = {\n nameToPath: {}, // many to 1\n requires: {}, // 1 to many\n // Used when resolving dependencies to prevent us from visiting file twice.\n visited: {},\n written: {} // Used to keep track of script files we have written.\n };\n\n\n /**\n * Tries to detect whether is in the context of an HTML document.\n * @return {boolean} True if it looks like HTML document.\n * @private\n */\n goog.inHtmlDocument_ = function() {\n var doc = goog.global.document;\n return typeof doc != 'undefined' &&\n 'write' in doc; // XULDocument misses write.\n };\n\n\n /**\n * Tries to detect the base path of base.js script that bootstraps Closure.\n * @private\n */\n goog.findBasePath_ = function() {\n if (goog.global.CLOSURE_BASE_PATH) {\n goog.basePath = goog.global.CLOSURE_BASE_PATH;\n return;\n } else if (!goog.inHtmlDocument_()) {\n return;\n }\n var doc = goog.global.document;\n var scripts = doc.getElementsByTagName('script');\n // Search backwards since the current script is in almost all cases the one\n // that has base.js.\n for (var i = scripts.length - 1; i >= 0; --i) {\n var src = scripts[i].src;\n var qmark = src.lastIndexOf('?');\n var l = qmark == -1 ? src.length : qmark;\n if (src.substr(l - 7, 7) == 'base.js') {\n goog.basePath = src.substr(0, l - 7);\n return;\n }\n }\n };\n\n\n /**\n * Imports a script if, and only if, that script hasn't already been imported.\n * (Must be called at execution time)\n * @param {string} src Script source.\n * @param {string=} opt_sourceText The optionally source text to evaluate\n * @private\n */\n goog.importScript_ = function(src, opt_sourceText) {\n var importScript = goog.global.CLOSURE_IMPORT_SCRIPT ||\n goog.writeScriptTag_;\n if (importScript(src, opt_sourceText)) {\n goog.dependencies_.written[src] = true;\n }\n };\n\n\n /**\n * The default implementation of the import function. Writes a script tag to\n * import the script.\n *\n * @param {string} src The script url.\n * @param {string=} opt_sourceText The optionally source text to evaluate\n * @return {boolean} True if the script was imported, false otherwise.\n * @private\n */\n goog.writeScriptTag_ = function(src, opt_sourceText) {\n if (goog.inHtmlDocument_()) {\n var doc = goog.global.document;\n\n // If the user tries to require a new symbol after document load,\n // something has gone terribly wrong. Doing a document.write would\n // wipe out the page.\n if (doc.readyState == 'complete') {\n // Certain test frameworks load base.js multiple times, which tries\n // to write deps.js each time. If that happens, just fail silently.\n // These frameworks wipe the page between each load of base.js, so this\n // is OK.\n var isDeps = /\\bdeps.js$/.test(src);\n if (isDeps) {\n return false;\n } else {\n throw Error('Cannot write \"' + src + '\" after document load');\n }\n }\n\n if (opt_sourceText === undefined) {\n doc.write(\n '<script type=\"text/javascript\" src=\"' +\n src + '\"></' + 'script>');\n } else {\n doc.write(\n '<script type=\"text/javascript\">' +\n opt_sourceText + '</' + 'script>');\n }\n return true;\n } else {\n return false;\n }\n };\n\n\n /**\n * Resolves dependencies based on the dependencies added using addDependency\n * and calls importScript_ in the correct order.\n * @private\n */\n goog.writeScripts_ = function() {\n // The scripts we need to write this time.\n var scripts = [];\n var seenScript = {};\n var deps = goog.dependencies_;\n\n function visitNode(path) {\n if (path in deps.written) {\n return;\n }\n\n // We have already visited this one. We can get here if we have cyclic\n // dependencies.\n if (path in deps.visited) {\n if (!(path in seenScript)) {\n seenScript[path] = true;\n scripts.push(path);\n }\n return;\n }\n\n deps.visited[path] = true;\n\n if (path in deps.requires) {\n for (var requireName in deps.requires[path]) {\n // If the required name is defined, we assume that it was already\n // bootstrapped by other means.\n if (!goog.isProvided_(requireName)) {\n if (requireName in deps.nameToPath) {\n visitNode(deps.nameToPath[requireName]);\n } else {\n throw Error('Undefined nameToPath for ' + requireName);\n }\n }\n }\n }\n\n if (!(path in seenScript)) {\n seenScript[path] = true;\n scripts.push(path);\n }\n }\n\n for (var path in goog.included_) {\n if (!deps.written[path]) {\n visitNode(path);\n }\n }\n\n // record that we are going to load all these scripts.\n for (var i = 0; i < scripts.length; i++) {\n var path = scripts[i];\n goog.dependencies_.written[path] = true;\n }\n\n for (var i = 0; i < scripts.length; i++) {\n var path = scripts[i];\n if (path) {\n goog.importScript_(goog.basePath + path);\n }\n }\n };\n\n\n /**\n * Looks at the dependency rules and tries to determine the script file that\n * fulfills a particular rule.\n * @param {string} rule In the form goog.namespace.Class or project.script.\n * @return {?string} Url corresponding to the rule, or null.\n * @private\n */\n goog.getPathFromDeps_ = function(rule) {\n if (rule in goog.dependencies_.nameToPath) {\n return goog.dependencies_.nameToPath[rule];\n } else {\n return null;\n }\n };\n\n goog.findBasePath_();\n\n // Allow projects to manage the deps files themselves.\n if (!goog.global.CLOSURE_NO_DEPS) {\n goog.importScript_(goog.basePath + 'deps.js');\n }\n}\n\n\n\n//==============================================================================\n// Language Enhancements\n//==============================================================================\n\n\n/**\n * Returns true if the specified value is defined and not null.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is defined and not null.\n */\ngoog.isDefAndNotNull = function(val) {\n // Note that undefined == null.\n return val != null;\n};\n\n\n/**\n * Returns true if the specified value is a string.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is a string.\n */\ngoog.isString = function(val) {\n return typeof val == 'string';\n};\n\n\n/**\n * Exposes an unobfuscated global namespace path for the given object.\n * Note that fields of the exported object *will* be obfuscated, unless they are\n * exported in turn via this function or goog.exportProperty.\n *\n * Also handy for making public items that are defined in anonymous closures.\n *\n * ex. goog.exportSymbol('public.path.Foo', Foo);\n *\n * ex. goog.exportSymbol('public.path.Foo.staticFunction', Foo.staticFunction);\n * public.path.Foo.staticFunction();\n *\n * ex. goog.exportSymbol('public.path.Foo.prototype.myMethod',\n * Foo.prototype.myMethod);\n * new public.path.Foo().myMethod();\n *\n * @param {string} publicPath Unobfuscated name to export.\n * @param {*} object Object the name should point to.\n * @param {Object=} opt_objectToExportTo The object to add the path to; default\n * is goog.global.\n */\ngoog.exportSymbol = function(publicPath, object, opt_objectToExportTo) {\n goog.exportPath_(publicPath, object, opt_objectToExportTo);\n};\n\n\n/**\n * Exports a property unobfuscated into the object's namespace.\n * ex. goog.exportProperty(Foo, 'staticFunction', Foo.staticFunction);\n * ex. goog.exportProperty(Foo.prototype, 'myMethod', Foo.prototype.myMethod);\n * @param {Object} object Object whose static property is being exported.\n * @param {string} publicName Unobfuscated name to export.\n * @param {*} symbol Object the name should point to.\n */\ngoog.exportProperty = function(object, publicName, symbol) {\n object[publicName] = symbol;\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * Usage:\n * <pre>\n * function ParentClass(a, b) { }\n * ParentClass.prototype.foo = function(a) { };\n *\n * function ChildClass(a, b, c) {\n * ChildClass.base(this, 'constructor', a, b);\n * }\n * goog.inherits(ChildClass, ParentClass);\n *\n * var child = new ChildClass('a', 'b', 'see');\n * child.foo(); // This works.\n * </pre>\n *\n * @param {Function} childCtor Child class.\n * @param {Function} parentCtor Parent class.\n */\ngoog.inherits = function(childCtor, parentCtor) {\n /** @constructor */\n function tempCtor() {}\n tempCtor.prototype = parentCtor.prototype;\n childCtor.superClass_ = parentCtor.prototype;\n childCtor.prototype = new tempCtor();\n /** @override */\n childCtor.prototype.constructor = childCtor;\n\n /**\n * Calls superclass constructor/method.\n *\n * This function is only available if you use goog.inherits to\n * express inheritance relationships between classes.\n *\n * NOTE: This is a replacement for goog.base and for superClass_\n * property defined in childCtor.\n *\n * @param {!Object} me Should always be \"this\".\n * @param {string} methodName The method name to call. Calling\n * superclass constructor can be done with the special string\n * 'constructor'.\n * @param {...*} var_args The arguments to pass to superclass\n * method/constructor.\n * @return {*} The return value of the superclass method/constructor.\n */\n childCtor.base = function(me, methodName, var_args) {\n var args = Array.prototype.slice.call(arguments, 2);\n return parentCtor.prototype[methodName].apply(me, args);\n };\n};\n\n\n/*\n * To support uncompiled, strict mode bundles that use eval to divide source\n * like so:\n * eval('someSource;//# sourceUrl sourcefile.js');\n * We need to export the globally defined symbols \"goog\" and \"COMPILED\".\n * Exporting \"goog\" breaks the compiler optimizations, so we required that\n * be defined externally.\n * NOTE: We don't use goog.exportSymbol here because we don't want to trigger\n * extern generation when that compiler option is enabled.\n */\nif (!COMPILED) {\n goog.global['COMPILED'] = COMPILED;\n}\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/third_party/closure/goog/base.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastProxy');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.cast.CastSender');\ngoog.require('shaka.cast.CastUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.IDestroyable');\n\n\n\n/**\n * A proxy to switch between local and remote playback for Chromecast in a way\n * that is transparent to the app's controls.\n *\n * @constructor\n * @struct\n * @param {!HTMLMediaElement} video The local video element associated with the\n * local Player instance.\n * @param {!shaka.Player} player A local Player instance.\n * @param {string} receiverAppId The ID of the cast receiver application.\n * @implements {shaka.util.IDestroyable}\n * @extends {shaka.util.FakeEventTarget}\n * @export\n */\nshaka.cast.CastProxy = function(video, player, receiverAppId) {\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {HTMLMediaElement} */\n this.localVideo_ = video;\n\n /** @private {shaka.Player} */\n this.localPlayer_ = player;\n\n /** @private {Object} */\n this.videoProxy_ = null;\n\n /** @private {Object} */\n this.playerProxy_ = null;\n\n /** @private {shaka.util.FakeEventTarget} */\n this.videoEventTarget_ = null;\n\n /** @private {shaka.util.FakeEventTarget} */\n this.playerEventTarget_ = null;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = null;\n\n /** @private {shaka.cast.CastSender} */\n this.sender_ = new shaka.cast.CastSender(\n receiverAppId,\n this.onCastStatusChanged_.bind(this),\n this.onRemoteEvent_.bind(this),\n this.onResumeLocal_.bind(this),\n this.getInitState_.bind(this));\n\n this.init_();\n};\ngoog.inherits(shaka.cast.CastProxy, shaka.util.FakeEventTarget);\n\n\n/**\n * Destroys the proxy and the underlying local Player.\n *\n * @param {boolean=} opt_forceDisconnect If true, force the receiver app to shut\n * down by disconnecting. Does nothing if not connected.\n * @override\n * @export\n */\nshaka.cast.CastProxy.prototype.destroy = function(opt_forceDisconnect) {\n if (opt_forceDisconnect && this.sender_) {\n this.sender_.forceDisconnect();\n }\n\n var async = [\n this.eventManager_ ? this.eventManager_.destroy() : null,\n this.localPlayer_ ? this.localPlayer_.destroy() : null,\n this.sender_ ? this.sender_.destroy() : null\n ];\n\n this.localVideo_ = null;\n this.localPlayer_ = null;\n this.videoProxy_ = null;\n this.playerProxy_ = null;\n this.eventManager_ = null;\n this.sender_ = null;\n\n return Promise.all(async);\n};\n\n\n/**\n * @event shaka.cast.CastProxy.CastStatusChangedEvent\n * @description Fired when cast status changes. The status change will be\n * reflected in canCast() and isCasting().\n * @property {string} type\n * 'caststatuschanged'\n * @exportDoc\n */\n\n\n/**\n * Get a proxy for the video element that delegates to local and remote video\n * elements as appropriate.\n *\n * @suppress {invalidCasts} to cast proxy Objects to unrelated types\n * @return {HTMLMediaElement}\n * @export\n */\nshaka.cast.CastProxy.prototype.getVideo = function() {\n return /** @type {HTMLMediaElement} */(this.videoProxy_);\n};\n\n\n/**\n * Get a proxy for the Player that delegates to local and remote Player objects\n * as appropriate.\n *\n * @suppress {invalidCasts} to cast proxy Objects to unrelated types\n * @return {shaka.Player}\n * @export\n */\nshaka.cast.CastProxy.prototype.getPlayer = function() {\n return /** @type {shaka.Player} */(this.playerProxy_);\n};\n\n\n/**\n * @return {boolean} True if the cast API is available and there are receivers.\n * @export\n */\nshaka.cast.CastProxy.prototype.canCast = function() {\n return this.sender_ ?\n this.sender_.apiReady() && this.sender_.hasReceivers() :\n false;\n};\n\n\n/**\n * @return {boolean} True if we are currently casting.\n * @export\n */\nshaka.cast.CastProxy.prototype.isCasting = function() {\n return this.sender_ ? this.sender_.isCasting() : false;\n};\n\n\n/**\n * @return {string} The name of the Cast receiver device, if isCasting().\n * @export\n */\nshaka.cast.CastProxy.prototype.receiverName = function() {\n return this.sender_ ? this.sender_.receiverName() : '';\n};\n\n\n/**\n * @return {!Promise} Resolved when connected to a receiver. Rejected if the\n * connection fails or is canceled by the user.\n * @export\n */\nshaka.cast.CastProxy.prototype.cast = function() {\n var initState = this.getInitState_();\n\n // TODO: transfer manually-selected tracks?\n // TODO: transfer side-loaded text tracks?\n\n return this.sender_.cast(initState).then(function() {\n // Unload the local manifest when casting succeeds.\n return this.localPlayer_.unload();\n }.bind(this));\n};\n\n\n/**\n * Set application-specific data.\n *\n * @param {Object} appData Application-specific data to relay to the receiver.\n * @export\n */\nshaka.cast.CastProxy.prototype.setAppData = function(appData) {\n this.sender_.setAppData(appData);\n};\n\n\n/**\n * Show a dialog where user can choose to disconnect from the cast connection.\n * @export\n */\nshaka.cast.CastProxy.prototype.suggestDisconnect = function() {\n this.sender_.showDisconnectDialog();\n};\n\n\n/**\n * Force the receiver app to shut down by disconnecting.\n * @export\n */\nshaka.cast.CastProxy.prototype.forceDisconnect = function() {\n this.sender_.forceDisconnect();\n};\n\n\n/**\n * Initialize the Proxies and the Cast sender.\n * @private\n */\nshaka.cast.CastProxy.prototype.init_ = function() {\n this.sender_.init();\n\n this.eventManager_ = new shaka.util.EventManager();\n\n shaka.cast.CastUtils.VideoEvents.forEach(function(name) {\n this.eventManager_.listen(this.localVideo_, name,\n this.videoProxyLocalEvent_.bind(this));\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerEvents.forEach(function(name) {\n this.eventManager_.listen(this.localPlayer_, name,\n this.playerProxyLocalEvent_.bind(this));\n }.bind(this));\n\n // We would like to use Proxy here, but it is not supported on IE11 or Safari.\n this.videoProxy_ = {};\n for (var k in this.localVideo_) {\n Object.defineProperty(this.videoProxy_, k, {\n configurable: false,\n enumerable: true,\n get: this.videoProxyGet_.bind(this, k),\n set: this.videoProxySet_.bind(this, k)\n });\n }\n\n this.playerProxy_ = {};\n for (var k in /** @type {Object} */(this.localPlayer_)) {\n Object.defineProperty(this.playerProxy_, k, {\n configurable: false,\n enumerable: true,\n get: this.playerProxyGet_.bind(this, k)\n });\n }\n\n this.videoEventTarget_ = new shaka.util.FakeEventTarget();\n this.videoEventTarget_.dispatchTarget =\n /** @type {EventTarget} */(this.videoProxy_);\n\n this.playerEventTarget_ = new shaka.util.FakeEventTarget();\n this.playerEventTarget_.dispatchTarget =\n /** @type {EventTarget} */(this.playerProxy_);\n};\n\n\n/**\n * @return {shaka.cast.CastUtils.InitStateType} initState Video and player state\n * to be sent to the receiver.\n * @private\n */\nshaka.cast.CastProxy.prototype.getInitState_ = function() {\n var initState = {\n 'video': {},\n 'player': {},\n 'playerAfterLoad': {},\n 'manifest': this.localPlayer_.getManifestUri(),\n 'startTime': null\n };\n\n // Pause local playback before capturing state.\n this.localVideo_.pause();\n\n shaka.cast.CastUtils.VideoInitStateAttributes.forEach(function(name) {\n initState['video'][name] = this.localVideo_[name];\n }.bind(this));\n\n // If the video is still playing, set the startTime.\n // Has no effect if nothing is loaded.\n if (!this.localVideo_.ended) {\n initState['startTime'] = this.localVideo_.currentTime;\n }\n\n shaka.cast.CastUtils.PlayerInitState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = /** @type {Object} */(this.localPlayer_)[getter]();\n\n initState['player'][setter] = value;\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerInitAfterLoadState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = /** @type {Object} */(this.localPlayer_)[getter]();\n\n initState['playerAfterLoad'][setter] = value;\n }.bind(this));\n\n return initState;\n};\n\n\n/**\n * Dispatch an event to notify the app that the status has changed.\n * @private\n */\nshaka.cast.CastProxy.prototype.onCastStatusChanged_ = function() {\n var event = new shaka.util.FakeEvent('caststatuschanged');\n this.dispatchEvent(event);\n};\n\n\n/**\n * Transfer remote state back and resume local playback.\n * @private\n */\nshaka.cast.CastProxy.prototype.onResumeLocal_ = function() {\n // Transfer back the player state.\n shaka.cast.CastUtils.PlayerInitState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = this.sender_.get('player', getter)();\n /** @type {Object} */(this.localPlayer_)[setter](value);\n }.bind(this));\n\n // Get the most recent manifest URI and ended state.\n var manifestUri = this.sender_.get('player', 'getManifestUri')();\n var ended = this.sender_.get('video', 'ended');\n\n var manifestReady = Promise.resolve();\n var autoplay = this.localVideo_.autoplay;\n\n var startTime = null;\n\n // If the video is still playing, set the startTime.\n // Has no effect if nothing is loaded.\n if (!ended) {\n startTime = this.sender_.get('video', 'currentTime');\n }\n\n // Now load the manifest, if present.\n if (manifestUri) {\n // Don't autoplay the content until we finish setting up initial state.\n this.localVideo_.autoplay = false;\n manifestReady = this.localPlayer_.load(manifestUri, startTime);\n // Pass any errors through to the app.\n manifestReady.catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong error type!');\n var event = new shaka.util.FakeEvent('error', { 'detail': error });\n this.localPlayer_.dispatchEvent(event);\n }.bind(this));\n }\n\n // Get the video state into a temp variable since we will apply it async.\n var videoState = {};\n shaka.cast.CastUtils.VideoInitStateAttributes.forEach(function(name) {\n videoState[name] = this.sender_.get('video', name);\n }.bind(this));\n\n // Finally, take on video state and player's \"after load\" state.\n manifestReady.then(function() {\n shaka.cast.CastUtils.VideoInitStateAttributes.forEach(function(name) {\n this.localVideo_[name] = videoState[name];\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerInitAfterLoadState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = this.sender_.get('player', getter)();\n /** @type {Object} */(this.localPlayer_)[setter](value);\n }.bind(this));\n\n // Restore original autoplay setting.\n this.localVideo_.autoplay = autoplay;\n if (manifestUri) {\n // Resume playback with transferred state.\n this.localVideo_.play();\n }\n }.bind(this));\n};\n\n\n/**\n * @param {string} name\n * @return {?}\n * @private\n */\nshaka.cast.CastProxy.prototype.videoProxyGet_ = function(name) {\n if (name == 'addEventListener') {\n return this.videoEventTarget_.addEventListener.bind(\n this.videoEventTarget_);\n }\n if (name == 'removeEventListener') {\n return this.videoEventTarget_.removeEventListener.bind(\n this.videoEventTarget_);\n }\n\n // If we are casting, but the first update has not come in yet, use local\n // values, but not local methods.\n if (this.sender_.isCasting() && !this.sender_.hasRemoteProperties()) {\n var value = this.localVideo_[name];\n if (typeof value != 'function') {\n return value;\n }\n }\n\n // Use local values and methods if we are not casting.\n if (!this.sender_.isCasting()) {\n var value = this.localVideo_[name];\n if (typeof value == 'function') {\n value = value.bind(this.localVideo_);\n }\n return value;\n }\n\n return this.sender_.get('video', name);\n};\n\n\n/**\n * @param {string} name\n * @param {?} value\n * @private\n */\nshaka.cast.CastProxy.prototype.videoProxySet_ = function(name, value) {\n if (!this.sender_.isCasting()) {\n this.localVideo_[name] = value;\n return;\n }\n\n this.sender_.set('video', name, value);\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.cast.CastProxy.prototype.videoProxyLocalEvent_ = function(event) {\n if (this.sender_.isCasting()) {\n // Ignore any unexpected local events while casting. Events can still be\n // fired by the local video and Player when we unload() after the Cast\n // connection is complete.\n return;\n }\n\n // Convert this real Event into a FakeEvent for dispatch from our\n // FakeEventListener.\n var fakeEvent = new shaka.util.FakeEvent(event.type, event);\n this.videoEventTarget_.dispatchEvent(fakeEvent);\n};\n\n\n/**\n * @param {string} name\n * @return {?}\n * @private\n */\nshaka.cast.CastProxy.prototype.playerProxyGet_ = function(name) {\n if (name == 'addEventListener') {\n return this.playerEventTarget_.addEventListener.bind(\n this.playerEventTarget_);\n }\n if (name == 'removeEventListener') {\n return this.playerEventTarget_.removeEventListener.bind(\n this.playerEventTarget_);\n }\n\n if (name == 'getNetworkingEngine') {\n // Always returns a local instance, in case you need to make a request.\n // Issues a warning, in case you think you are making a remote request\n // or affecting remote filters.\n if (this.sender_.isCasting()) {\n shaka.log.warning('NOTE: getNetworkingEngine() is always local!');\n }\n return this.localPlayer_.getNetworkingEngine.bind(this.localPlayer_);\n }\n\n // If we are casting, but the first update has not come in yet, use local\n // getters, but not local methods.\n if (this.sender_.isCasting() && !this.sender_.hasRemoteProperties()) {\n if (shaka.cast.CastUtils.PlayerGetterMethods.indexOf(name) >= 0) {\n var value = /** @type {Object} */(this.localPlayer_)[name];\n goog.asserts.assert(typeof value == 'function', 'only methods on Player');\n return value.bind(this.localPlayer_);\n }\n }\n\n // Use local getters and methods if we are not casting.\n if (!this.sender_.isCasting()) {\n var value = /** @type {Object} */(this.localPlayer_)[name];\n goog.asserts.assert(typeof value == 'function', 'only methods on Player');\n return value.bind(this.localPlayer_);\n }\n\n return this.sender_.get('player', name);\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.cast.CastProxy.prototype.playerProxyLocalEvent_ = function(event) {\n if (this.sender_.isCasting()) {\n // Ignore any unexpected local events while casting.\n return;\n }\n\n this.playerEventTarget_.dispatchEvent(event);\n};\n\n\n/**\n * @param {string} targetName\n * @param {!shaka.util.FakeEvent} event\n * @private\n */\nshaka.cast.CastProxy.prototype.onRemoteEvent_ = function(targetName, event) {\n goog.asserts.assert(this.sender_.isCasting(),\n 'Should only receive remote events while casting');\n if (!this.sender_.isCasting()) {\n // Ignore any unexpected remote events.\n return;\n }\n\n if (targetName == 'video') {\n this.videoEventTarget_.dispatchEvent(event);\n } else if (targetName == 'player') {\n this.playerEventTarget_.dispatchEvent(event);\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_proxy.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.abr.Ewma');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Computes an exponentionally-weighted moving average.\n *\n * @param {number} halfLife About half of the estimated value will be from the\n * last |halfLife| samples by weight.\n * @struct\n * @constructor\n */\nshaka.abr.Ewma = function(halfLife) {\n goog.asserts.assert(halfLife > 0, 'expected halfLife to be positive');\n\n /**\n * Larger values of alpha expire historical data more slowly.\n * @private {number}\n */\n this.alpha_ = Math.exp(Math.log(0.5) / halfLife);\n\n /** @private {number} */\n this.estimate_ = 0;\n\n /** @private {number} */\n this.totalWeight_ = 0;\n};\n\n\n/**\n * Takes a sample.\n *\n * @param {number} weight\n * @param {number} value\n */\nshaka.abr.Ewma.prototype.sample = function(weight, value) {\n var adjAlpha = Math.pow(this.alpha_, weight);\n var newEstimate = value * (1 - adjAlpha) + adjAlpha * this.estimate_;\n\n if (!isNaN(newEstimate)) {\n this.estimate_ = newEstimate;\n this.totalWeight_ += weight;\n }\n};\n\n\n/**\n * @return {number}\n */\nshaka.abr.Ewma.prototype.getEstimate = function() {\n var zeroFactor = 1 - Math.pow(this.alpha_, this.totalWeight_);\n return this.estimate_ / zeroFactor;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/abr/ewma.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.abr.EwmaBandwidthEstimator');\n\ngoog.require('shaka.abr.Ewma');\n\n\n\n/**\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 * @constructor\n * @struct\n */\nshaka.abr.EwmaBandwidthEstimator = function() {\n /**\n * A fast-moving average.\n * Half of the estimate is based on the last 2 seconds of sample history.\n * @private {!shaka.abr.Ewma}\n */\n this.fast_ = new shaka.abr.Ewma(2);\n\n /**\n * A slow-moving average.\n * Half of the estimate is based on the last 5 seconds of sample history.\n * @private {!shaka.abr.Ewma}\n */\n this.slow_ = new shaka.abr.Ewma(5);\n\n /**\n * Number of bytes sampled.\n * @private {number}\n */\n this.bytesSampled_ = 0;\n\n /**\n * Initial estimate used when there is not enough data.\n * @see shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE\n * @private {number}\n */\n this.defaultEstimate_ = shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE;\n\n /**\n * Minimum number of bytes sampled before we trust the estimate. If we have\n * not sampled much data, our estimate may not be accurate enough to trust.\n * If bytesSampled_ is less than minTotalBytes_, we use defaultEstimate_.\n * This specific value is based on experimentation.\n *\n * @private {number}\n * @const\n */\n this.minTotalBytes_ = 128e3; // 128kB\n\n /**\n * Minimum number of bytes, under which samples are discarded. Our models do\n * not include latency information, so connection startup time (time to first\n * byte) is considered part of the download time. Because of this, we should\n * ignore very small downloads which would cause our estimate to be too low.\n * This specific value is based on experimentation.\n *\n * @private {number}\n * @const\n */\n this.minBytes_ = 16e3; // 16kB\n};\n\n\n/**\n * Contains the default estimate to use when there is not enough data.\n * This is a relatively safe default, since 3G cell connections are faster than\n * this. For slower connections, such as 2G, the default estimate may be too\n * high. This default can be changed at runtime using\n * {@link shaka.Player#configure} and {@link shakaExtern.AbrConfiguration}.\n * @const {number}\n */\nshaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE = 500e3; // 500kbps\n\n\n/**\n * Takes a bandwidth sample.\n *\n * @param {number} durationMs The amount of time, in milliseconds, for a\n * particular request.\n * @param {number} numBytes The total number of bytes transferred in that\n * request.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.sample = function(\n durationMs, numBytes) {\n if (numBytes < this.minBytes_) {\n return;\n }\n\n var bandwidth = 8000 * numBytes / durationMs;\n var weight = durationMs / 1000;\n\n this.bytesSampled_ += numBytes;\n this.fast_.sample(weight, bandwidth);\n this.slow_.sample(weight, bandwidth);\n};\n\n\n/**\n * Sets the default bandwidth estimate to use if there is not enough data.\n *\n * @param {number} estimate The default bandwidth estimate, in bit/sec.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.setDefaultEstimate = function(\n estimate) {\n this.defaultEstimate_ = estimate;\n};\n\n\n/**\n * Gets the current bandwidth estimate.\n *\n * @return {number} The bandwidth estimate in bits per second.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.getBandwidthEstimate = function() {\n if (this.bytesSampled_ < this.minTotalBytes_) {\n return this.defaultEstimate_;\n }\n\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};\n\n\n/**\n * @return {boolean} True if there is enough data to produce a meaningful\n * estimate.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.hasGoodEstimate = function() {\n return this.bytesSampled_ >= this.minTotalBytes_;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/abr/ewma_bandwidth_estimator.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.log');\n\n\n/**\n * @namespace shaka.log\n * @summary\n * A console logging framework which is compiled out for deployment. This is\n * only available when using the uncompiled version.\n * @exportDoc\n */\n\n\n/**\n * Log levels.\n * @enum {number}\n * @exportDoc\n */\nshaka.log.Level = {\n NONE: 0,\n ERROR: 1,\n WARNING: 2,\n INFO: 3,\n DEBUG: 4,\n V1: 5,\n V2: 6\n};\n\n\n/**\n * @define {number} the maximum log level.\n */\ngoog.define('shaka.log.MAX_LOG_LEVEL', 3);\n\n\n/** @type {function(*, ...*)} */\nshaka.log.error = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.warning = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.info = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.debug = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.v1 = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.v2 = function() {};\n\n\n// IE8 has no console unless it is opened in advance.\n// IE9 console methods are not Functions and have no bind.\nif (window.console && window.console.log.bind) {\n if (!COMPILED) {\n /** @type {number} */\n shaka.log.currentLevel;\n\n /**\n * Change the log level. Useful for debugging in uncompiled mode.\n *\n * @param {number} level\n * @exportDoc\n */\n shaka.log.setLevel = function(level) {\n var nop = function() {};\n var log = shaka.log;\n var Level = shaka.log.Level;\n\n shaka.log.currentLevel = level;\n\n log.error = (level >= Level.ERROR) ? console.error.bind(console) : nop;\n log.warning = (level >= Level.WARNING) ? console.warn.bind(console) : nop;\n log.info = (level >= Level.INFO) ? console.info.bind(console) : nop;\n log.debug = (level >= Level.DEBUG) ? console.log.bind(console) : nop;\n log.v1 = (level >= Level.V1) ? console.debug.bind(console) : nop;\n log.v2 = (level >= Level.V2) ? console.debug.bind(console) : nop;\n };\n\n shaka.log.setLevel(shaka.log.MAX_LOG_LEVEL);\n } else {\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.ERROR) {\n shaka.log.error = console.error.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.WARNING) {\n shaka.log.warning = console.warn.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.INFO) {\n shaka.log.info = console.info.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.DEBUG) {\n shaka.log.debug = console.log.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.V1) {\n shaka.log.v1 = console.debug.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.V2) {\n shaka.log.v2 = console.debug.bind(console);\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/debug/log.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Error');\n\n\n\n/**\n * Creates a new Error.\n *\n * @param {shaka.util.Error.Severity} severity\n * @param {shaka.util.Error.Category} category\n * @param {shaka.util.Error.Code} code\n * @param {...*} var_args\n *\n * @constructor\n * @struct\n * @export\n * @extends {Error}\n */\nshaka.util.Error = function(severity, category, code, var_args) {\n this.severity = severity;\n this.category = category;\n this.code = code;\n this.data = Array.prototype.slice.call(arguments, 3);\n\n // This improves formatting of Errors in failure messages in the tests.\n if (!COMPILED) {\n var categoryName = 'UNKNOWN';\n var codeName = 'UNKNOWN';\n\n for (var k in shaka.util.Error.Category) {\n if (shaka.util.Error.Category[k] == this.category)\n categoryName = k;\n }\n for (var k in shaka.util.Error.Code) {\n if (shaka.util.Error.Code[k] == this.code)\n codeName = k;\n }\n\n /**\n * A human-readable version of the category and code.\n * <i>(Only available in uncompiled mode.)</i>\n *\n * @const {string}\n * @exportDoc\n */\n this.message = 'Shaka Error ' + categoryName + '.' + codeName +\n ' (' + this.data.toString() + ')';\n try {\n throw new Error(this.message);\n } catch (e) {\n /**\n * A stack-trace showing where the error occurred.\n * <i>(Only available in uncompiled mode.)</i>\n *\n * @const {string}\n * @exportDoc\n */\n this.stack = e.stack;\n }\n }\n};\n\n\n/**\n * @type {shaka.util.Error.Severity}\n * @expose\n */\nshaka.util.Error.prototype.severity;\n\n\n/**\n * @const {shaka.util.Error.Category}\n * @expose\n */\nshaka.util.Error.prototype.category;\n\n\n/**\n * @const {shaka.util.Error.Code}\n * @expose\n */\nshaka.util.Error.prototype.code;\n\n\n/**\n * @const {!Array.<*>}\n * @expose\n */\nshaka.util.Error.prototype.data;\n\n\n/**\n * @return {string}\n * @override\n */\nshaka.util.Error.prototype.toString = function() {\n return 'shaka.util.Error ' + JSON.stringify(this, null, ' ');\n};\n\n\n/**\n * @enum {number}\n * @export\n */\nshaka.util.Error.Severity = {\n /**\n * An error occurred, but the Player is attempting to recover from the error.\n *\n * If the Player cannot ultimately recover, it still may not throw a CRITICAL\n * error. For example, retrying for a media segment will never result in\n * a CRITICAL error (the Player will just retry forever).\n */\n 'RECOVERABLE': 1,\n\n /**\n * A critical error that the library cannot recover from. These usually cause\n * the Player to stop loading or updating. A new manifest must be loaded\n * to reset the library.\n */\n 'CRITICAL': 2\n};\n\n\n/**\n * @enum {number}\n * @export\n */\nshaka.util.Error.Category = {\n /** Errors from the network stack. */\n 'NETWORK': 1,\n\n /** Errors parsing text streams. */\n 'TEXT': 2,\n\n /** Errors parsing or processing audio or video streams. */\n 'MEDIA': 3,\n\n /** Errors parsing the Manifest. */\n 'MANIFEST': 4,\n\n /** Errors related to streaming. */\n 'STREAMING': 5,\n\n /** Errors related to DRM. */\n 'DRM': 6,\n\n /** Miscellaneous errors from the player. */\n 'PLAYER': 7,\n\n /** Errors related to cast. */\n 'CAST': 8,\n\n /** Errors in the database storage (offline). */\n 'STORAGE': 9\n};\n\n\n/**\n * @enum {number}\n * @export\n */\nshaka.util.Error.Code = {\n /**\n * A network request was made using an unsupported URI scheme.\n * <br> error.data[0] is the URI.\n */\n 'UNSUPPORTED_SCHEME': 1000,\n\n /**\n * An HTTP network request returned an HTTP status that indicated a failure.\n * <br> error.data[0] is the URI.\n * <br> error.data[1] is the status code.\n * <br> error.data[2] is the response text, or null if the response could not\n * be interpretted as text.\n * <br> error.data[3] is the map of response headers.\n */\n 'BAD_HTTP_STATUS': 1001,\n\n /**\n * An HTTP network request failed with an error, but not from the server.\n * <br> error.data[0] is the URI.\n */\n 'HTTP_ERROR': 1002,\n\n /**\n * A network request timed out.\n * <br> error.data[0] is the URI.\n */\n 'TIMEOUT': 1003,\n\n /**\n * A network request was made with a malformed data URI.\n * <br> error.data[0] is the URI.\n */\n 'MALFORMED_DATA_URI': 1004,\n\n /**\n * A network request was made with a data URI using an unknown encoding.\n * <br> error.data[0] is the URI.\n */\n 'UNKNOWN_DATA_URI_ENCODING': 1005,\n\n /**\n * A request filter threw an error.\n * <br> error.data[0] is the original error.\n */\n 'REQUEST_FILTER_ERROR': 1006,\n\n /**\n * A response filter threw an error.\n * <br> error.data[0] is the original error.\n */\n 'RESPONSE_FILTER_ERROR': 1007,\n\n\n /** The text parser failed to parse a text stream due to an invalid header. */\n 'INVALID_TEXT_HEADER': 2000,\n\n /** The text parser failed to parse a text stream due to an invalid cue. */\n 'INVALID_TEXT_CUE': 2001,\n\n // RETIRED: 'INVALID_TEXT_SETTINGS': 2002,\n\n /**\n * Was unable to detect the encoding of the response text. Suggest adding\n * byte-order-markings to the response data.\n */\n 'UNABLE_TO_DETECT_ENCODING': 2003,\n\n /** The response data contains invalid Unicode character encoding. */\n 'BAD_ENCODING': 2004,\n\n /**\n * The XML parser failed to parse an xml stream, or the XML lacks mandatory\n * elements for TTML.\n */\n 'INVALID_XML': 2005,\n\n // RETIRED: 'INVALID_TTML': 2006,\n\n /**\n * MP4 segment does not contain TTML.\n */\n 'INVALID_MP4_TTML': 2007,\n\n /**\n * MP4 segment does not contain VTT.\n */\n 'INVALID_MP4_VTT': 2008,\n\n\n /**\n * Some component tried to read past the end of a buffer. The segment index,\n * init segment, or PSSH may be malformed.\n */\n 'BUFFER_READ_OUT_OF_BOUNDS': 3000,\n\n /**\n * Some component tried to parse an integer that was too large to fit in a\n * JavaScript number without rounding error. JavaScript can only natively\n * represent integers up to 53 bits.\n */\n 'JS_INTEGER_OVERFLOW': 3001,\n\n /**\n * The EBML parser used to parse the WebM container encountered an integer,\n * ID, or other field larger than the maximum supported by the parser.\n */\n 'EBML_OVERFLOW': 3002,\n\n /**\n * The EBML parser used to parse the WebM container encountered a floating-\n * point field of a size not supported by the parser.\n */\n 'EBML_BAD_FLOATING_POINT_SIZE': 3003,\n\n /**\n * The MP4 SIDX parser found the wrong box type.\n * Either the segment index range is incorrect or the data is corrupt.\n */\n 'MP4_SIDX_WRONG_BOX_TYPE': 3004,\n\n /**\n * The MP4 SIDX parser encountered an invalid timescale.\n * The segment index data may be corrupt.\n */\n 'MP4_SIDX_INVALID_TIMESCALE': 3005,\n\n /** The MP4 SIDX parser encountered a type of SIDX that is not supported. */\n 'MP4_SIDX_TYPE_NOT_SUPPORTED': 3006,\n\n /**\n * The WebM Cues parser was unable to locate the Cues element.\n * The segment index data may be corrupt.\n */\n 'WEBM_CUES_ELEMENT_MISSING': 3007,\n\n /**\n * The WebM header parser was unable to locate the Ebml element.\n * The init segment data may be corrupt.\n */\n 'WEBM_EBML_HEADER_ELEMENT_MISSING': 3008,\n\n /**\n * The WebM header parser was unable to locate the Segment element.\n * The init segment data may be corrupt.\n */\n 'WEBM_SEGMENT_ELEMENT_MISSING': 3009,\n\n /**\n * The WebM header parser was unable to locate the Info element.\n * The init segment data may be corrupt.\n */\n 'WEBM_INFO_ELEMENT_MISSING': 3010,\n\n /**\n * The WebM header parser was unable to locate the Duration element.\n * The init segment data may be corrupt or may have been incorrectly encoded.\n * Shaka requires a duration in WebM DASH content.\n */\n 'WEBM_DURATION_ELEMENT_MISSING': 3011,\n\n /**\n * The WebM Cues parser was unable to locate the Cue Track Positions element.\n * The segment index data may be corrupt.\n */\n 'WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING': 3012,\n\n /**\n * The WebM Cues parser was unable to locate the Cue Time element.\n * The segment index data may be corrupt.\n */\n 'WEBM_CUE_TIME_ELEMENT_MISSING': 3013,\n\n /**\n * A MediaSource operation failed.\n * <br> error.data[0] is a MediaError code from the video element.\n */\n 'MEDIA_SOURCE_OPERATION_FAILED': 3014,\n\n /**\n * A MediaSource operation threw an exception.\n * <br> error.data[0] is the exception that was thrown.\n */\n 'MEDIA_SOURCE_OPERATION_THREW': 3015,\n\n /**\n * The video element reported an error.\n * <br> error.data[0] is a MediaError code from the video element.\n * <br> On Edge & IE, error.data[1] is a Microsoft extended error code in hex.\n */\n 'VIDEO_ERROR': 3016,\n\n /**\n * A MediaSource operation threw QuotaExceededError and recovery failed. The\n * content cannot be played correctly because the segments are too large for\n * the browser/platform. This may occur when attempting to play very high\n * quality, very high bitrate content on low-end devices.\n * <br> error.data[0] is the type of content which caused the error.\n */\n 'QUOTA_EXCEEDED_ERROR': 3017,\n\n\n /**\n * The Player was unable to guess the manifest type based on file extension\n * or MIME type. To fix, try one of the following:\n * <br><ul>\n * <li>Rename the manifest so that the URI ends in a well-known extension.\n * <li>Configure the server to send a recognizable Content-Type header.\n * <li>Configure the server to accept a HEAD request for the manifest.\n * </ul>\n * <br> error.data[0] is the manifest URI.\n */\n 'UNABLE_TO_GUESS_MANIFEST_TYPE': 4000,\n\n /** The DASH Manifest contained invalid XML markup. */\n 'DASH_INVALID_XML': 4001,\n\n /**\n * The DASH Manifest contained a Representation with insufficient segment\n * information.\n */\n 'DASH_NO_SEGMENT_INFO': 4002,\n\n /** The DASH Manifest contained an AdaptationSet with no Representations. */\n 'DASH_EMPTY_ADAPTATION_SET': 4003,\n\n /** The DASH Manifest contained an Period with no AdaptationSets. */\n 'DASH_EMPTY_PERIOD': 4004,\n\n /**\n * The DASH Manifest does not specify an init segment with a WebM container.\n */\n 'DASH_WEBM_MISSING_INIT': 4005,\n\n /** The DASH Manifest contained an unsupported container format. */\n 'DASH_UNSUPPORTED_CONTAINER': 4006,\n\n /** The embedded PSSH data has invalid encoding. */\n 'DASH_PSSH_BAD_ENCODING': 4007,\n\n /**\n * There is an AdaptationSet whose Representations do not have any common\n * key-systems.\n */\n 'DASH_NO_COMMON_KEY_SYSTEM': 4008,\n\n /** Having multiple key IDs per Representation is not supported. */\n 'DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED': 4009,\n\n /** The DASH Manifest specifies conflicting key IDs. */\n 'DASH_CONFLICTING_KEY_IDS': 4010,\n\n /**\n * The manifest contains a period with no playable streams.\n * Either the period was originally empty, or the streams within cannot be\n * played on this browser or platform.\n */\n 'UNPLAYABLE_PERIOD': 4011,\n\n /**\n * There exist some streams that could be decoded, but restrictions imposed\n * by the application or the key system prevent us from playing. This may\n * happen under the following conditions:\n * <ul>\n * <li>The application has given restrictions to the Player that restrict\n * at least one content type completely (e.g. no playable audio).\n * <li>The key system has imposed output restrictions that cannot be met\n * (such as HDCP) and there are no unrestricted alternatives.\n * </ul>\n */\n 'RESTRICTIONS_CANNOT_BE_MET': 4012,\n\n // RETIRED: 'INTERNAL_ERROR_KEY_STATUS': 4013,\n\n /**\n * No valid periods were found in the manifest. Please check that your\n * manifest is correct and free of typos.\n */\n 'NO_PERIODS': 4014,\n\n /**\n * HLS playlist doesn't start with a mandory #EXTM3U tag.\n */\n 'HLS_PLAYLIST_HEADER_MISSING': 4015,\n\n /**\n * HLS tag has an invalid name that doesn't start with '#EXT'\n */\n 'INVALID_HLS_TAG': 4016,\n\n /**\n * HLS playlist has both Master and Media/Segment tags.\n */\n 'HLS_INVALID_PLAYLIST_HIERARCHY': 4017,\n\n /**\n * A Representation has an id that is the same as another Representation in\n * the same Period. This makes manifest updates impossible since we cannot\n * map the updated Representation to the old one.\n */\n 'DASH_DUPLICATE_REPRESENTATION_ID': 4018,\n\n // RETIRED: 'HLS_MEDIA_INIT_SECTION_INFO_MISSING': 4019,\n\n /**\n * HLS manifest has several #EXT-X-MAP tags. We can only\n * support one at the moment.\n */\n 'HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND': 4020,\n\n /**\n * HLS parser was unable to guess mime type of a stream.\n * <br> error.data[0] is the stream file's extension.\n */\n 'HLS_COULD_NOT_GUESS_MIME_TYPE': 4021,\n\n /**\n * No Master Playlist has been provided. Master playlist provides\n * vital information about the streams (like codecs) that is\n * required for MediaSource. We don't support directly providing\n * a Media Playlist.\n */\n 'HLS_MASTER_PLAYLIST_NOT_PROVIDED': 4022,\n\n /**\n * One of the required attributes was not provided.\n * HLS manifest is invalid.\n * <br> error.data[0] is the missing attribute's name.\n */\n 'HLS_REQUIRED_ATTRIBUTE_MISSING': 4023,\n\n /**\n * One of the required tags was not provided.\n * HLS manifest is invalid.\n * <br> error.data[0] is the missing tag's name.\n */\n 'HLS_REQUIRED_TAG_MISSING': 4024,\n\n /**\n * HLS parser was unable to guess codecs of a stream.\n * <br> error.data[0] is the list of all codecs for the variant.\n */\n 'HLS_COULD_NOT_GUESS_CODECS': 4025,\n\n /**\n * HLS parser has encountered encrypted content with unsupported\n * KEYFORMAT attributes.\n */\n 'HLS_KEYFORMATS_NOT_SUPPORTED': 4026,\n\n\n // RETIRED: 'INCONSISTENT_BUFFER_STATE': 5000,\n // RETIRED: 'INVALID_SEGMENT_INDEX': 5001,\n // RETIRED: 'SEGMENT_DOES_NOT_EXIST': 5002,\n // RETIRED: 'CANNOT_SATISFY_BYTE_LIMIT': 5003,\n // RETIRED: 'BAD_SEGMENT': 5004,\n\n /**\n * The StreamingEngine called onChooseStreams() but the callback receiver\n * did not return the correct number or type of Streams.\n *\n * This can happen when there is multi-Period content where one Period is\n * video+audio and another is video-only or audio-only. We don't support this\n * case because it is incompatible with MSE. When the browser reaches the\n * transition, it will pause, waiting for the audio stream.\n */\n 'INVALID_STREAMS_CHOSEN': 5005,\n\n\n /**\n * The manifest indicated protected content, but the manifest parser was\n * unable to determine what key systems should be used.\n */\n 'NO_RECOGNIZED_KEY_SYSTEMS': 6000,\n\n /**\n * None of the requested key system configurations are available. This may\n * happen under the following conditions:\n * <ul>\n * <li> The key system is not supported.\n * <li> The key system does not support the features requested (e.g.\n * persistent state).\n * <li> A user prompt was shown and the user denied access.\n * <li> The key system is not available from unsecure contexts. (ie.\n requires HTTPS) See https://goo.gl/EEhZqT.\n * </ul>\n */\n 'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,\n\n /**\n * The browser found one of the requested key systems, but it failed to\n * create an instance of the CDM for some unknown reason.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_CREATE_CDM': 6002,\n\n /**\n * The browser found one of the requested key systems and created an instance\n * of the CDM, but it failed to attach the CDM to the video for some unknown\n * reason.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_ATTACH_TO_VIDEO': 6003,\n\n /**\n * The CDM rejected the server certificate supplied by the application.\n * The certificate may be malformed or in an unsupported format.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'INVALID_SERVER_CERTIFICATE': 6004,\n\n /**\n * The CDM refused to create a session for some unknown reason.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_CREATE_SESSION': 6005,\n\n /**\n * The CDM was unable to generate a license request for the init data it was\n * given. The init data may be malformed or in an unsupported format.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_GENERATE_LICENSE_REQUEST': 6006,\n\n /**\n * The license request failed. This could be a timeout, a network failure, or\n * a rejection by the server.\n * <br> error.data[0] is a shaka.util.Error from the networking engine.\n */\n 'LICENSE_REQUEST_FAILED': 6007,\n\n /**\n * The license response was rejected by the CDM. The server's response may be\n * invalid or malformed for this CDM.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'LICENSE_RESPONSE_REJECTED': 6008,\n\n // RETIRED: 'NO_LICENSE_SERVER_SPECIFIED': 6009,\n\n /**\n * The manifest does not specify any DRM info, but the content is encrypted.\n * Either the manifest or the manifest parser are broken.\n */\n 'ENCRYPTED_CONTENT_WITHOUT_DRM_INFO': 6010,\n\n // RETIRED: 'WRONG_KEYS': 6011,\n\n /**\n * No license server was given for the key system signaled by the manifest.\n * A license server URI is required for every key system.\n */\n 'NO_LICENSE_SERVER_GIVEN': 6012,\n\n /**\n * A required offline session was removed. The content is not playable.\n */\n 'OFFLINE_SESSION_REMOVED': 6013,\n\n /**\n * The license has expired. This is triggered when playback is stalled on a\n * 'waitingforkeys' event and there are any expired keys in the key status map\n * of any active session.\n */\n 'EXPIRED': 6014,\n\n\n /**\n * The call to Player.load() was interrupted by a call to Player.unload()\n * or another call to Player.load().\n */\n 'LOAD_INTERRUPTED': 7000,\n\n\n /**\n * The Cast API is unavailable. This may be because of one of the following:\n * - The browser may not have Cast support\n * - The browser may be missing a necessary Cast extension\n * - The Cast sender library may not be loaded in your app\n */\n 'CAST_API_UNAVAILABLE': 8000,\n\n /**\n * No cast receivers are available at this time.\n */\n 'NO_CAST_RECEIVERS': 8001,\n\n /**\n * The library is already casting.\n */\n 'ALREADY_CASTING': 8002,\n\n /**\n * A Cast SDK error that we did not explicitly plan for has occurred.\n * Check data[0] and refer to the Cast SDK documentation for details.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'UNEXPECTED_CAST_ERROR': 8003,\n\n /**\n * The cast operation was canceled by the user.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'CAST_CANCELED_BY_USER': 8004,\n\n /**\n * The cast connection timed out.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'CAST_CONNECTION_TIMED_OUT': 8005,\n\n /**\n * The requested receiver app ID does not exist or is unavailable.\n * Check the requested app ID for typos.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'CAST_RECEIVER_APP_UNAVAILABLE': 8006,\n\n\n /**\n * Offline storage is not supported on this browser; it is required for\n * offline support.\n */\n 'STORAGE_NOT_SUPPORTED': 9000,\n\n /**\n * An unknown error occurred in the IndexedDB.\n * <br> On Firefox, one common source for UnknownError calls is reverting\n * Firefox to an old version. This makes the indexedDB storage inaccessible\n * for older versions. The only way to fix this is to delete the storage\n * data in your profile. See https://goo.gl/eKVPPe.\n * <br> error.data[0] is the error object.\n */\n 'INDEXED_DB_ERROR': 9001,\n\n /**\n * The operation was aborted. For example, by a call to destroy().\n */\n 'OPERATION_ABORTED': 9002,\n\n /**\n * The specified item was not found in the IndexedDB.\n * <br> error.data[0] is the offline URI.\n */\n 'REQUESTED_ITEM_NOT_FOUND': 9003,\n\n /**\n * A network request was made with a malformed offline URI.\n * <br> error.data[0] is the URI.\n */\n 'MALFORMED_OFFLINE_URI': 9004,\n\n /**\n * The specified content is live or in-progress.\n * Live and in-progress streams cannot be stored offline.\n * <br> error.data[0] is the URI.\n */\n 'CANNOT_STORE_LIVE_OFFLINE': 9005,\n\n /**\n * There is already a store operation in-progress, wait until it completes\n * before starting another.\n */\n 'STORE_ALREADY_IN_PROGRESS': 9006,\n\n /**\n * The specified manifest is encrypted but does not specify any init data.\n * Without init data specified in the manifest, the content will not be\n * playable offline.\n * <br> error.data[0] is the URI.\n */\n 'NO_INIT_DATA_FOR_OFFLINE': 9007,\n\n /**\n * shaka.offline.Storage was constructed with a Player proxy instead of a\n * local player instance. To fix this, use Player directly with Storage\n * instead of the results of CastProxy.prototype.getPlayer().\n */\n 'LOCAL_PLAYER_INSTANCE_REQUIRED': 9008\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/error.js","// Copyright 2006 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Class for parsing and formatting URIs.\n *\n * Use new goog.Uri(string) to parse a URI string.\n *\n * e.g: <code>var myUri = new goog.Uri(window.location);</code>\n *\n * Implements RFC 3986 for parsing/formatting URIs.\n * http://www.ietf.org/rfc/rfc3986.txt\n *\n * Some changes have been made to the interface (more like .NETs), though the\n * internal representation is now of un-encoded parts, this will change the\n * behavior slightly.\n *\n */\n\ngoog.provide('goog.Uri');\ngoog.provide('goog.Uri.QueryData');\n\ngoog.require('goog.uri.utils');\ngoog.require('goog.uri.utils.ComponentIndex');\n\n\n\n/**\n * This class contains setters and getters for the parts of the URI.\n * The <code>getXyz</code>/<code>setXyz</code> methods return the decoded part\n * -- so<code>new goog.Uri('/foo%20bar').getPath()</code> will return the\n * decoded path, <code>/foo bar</code>.\n *\n * Reserved characters (see RFC 3986 section 2.2) can be present in\n * their percent-encoded form in scheme, domain, and path URI components and\n * will not be auto-decoded. For example:\n * <code>new goog.Uri('rel%61tive/path%2fto/resource').getPath()</code> will\n * return <code>relative/path%2fto/resource</code>.\n *\n * The constructor accepts an optional unparsed, raw URI string. The parser\n * is relaxed, so special characters that aren't escaped but don't cause\n * ambiguities will not cause parse failures.\n *\n * All setters return <code>this</code> and so may be chained, a la\n * <code>new goog.Uri('/foo').setFragment('part').toString()</code>.\n *\n * @param {*=} opt_uri Optional string URI to parse, or if a goog.Uri is\n * passed, a clone is created.\n *\n * @constructor\n */\ngoog.Uri = function(opt_uri) {\n // Parse in the uri string\n var m;\n if (opt_uri instanceof goog.Uri) {\n this.setScheme(opt_uri.getScheme());\n this.setUserInfo(opt_uri.getUserInfo());\n this.setDomain(opt_uri.getDomain());\n this.setPort(opt_uri.getPort());\n this.setPath(opt_uri.getPath());\n this.setQueryData(opt_uri.getQueryData().clone());\n this.setFragment(opt_uri.getFragment());\n } else if (opt_uri && (m = goog.uri.utils.split(String(opt_uri)))) {\n // Set the parts -- decoding as we do so.\n // COMPATABILITY NOTE - In IE, unmatched fields may be empty strings,\n // whereas in other browsers they will be undefined.\n this.setScheme(m[goog.uri.utils.ComponentIndex.SCHEME] || '', true);\n this.setUserInfo(m[goog.uri.utils.ComponentIndex.USER_INFO] || '', true);\n this.setDomain(m[goog.uri.utils.ComponentIndex.DOMAIN] || '', true);\n this.setPort(m[goog.uri.utils.ComponentIndex.PORT]);\n this.setPath(m[goog.uri.utils.ComponentIndex.PATH] || '', true);\n this.setQueryData(m[goog.uri.utils.ComponentIndex.QUERY_DATA] || '', true);\n this.setFragment(m[goog.uri.utils.ComponentIndex.FRAGMENT] || '', true);\n } else {\n this.queryData_ = new goog.Uri.QueryData(null, null);\n }\n};\n\n\n/**\n * Scheme such as \"http\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.scheme_ = '';\n\n\n/**\n * User credentials in the form \"username:password\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.userInfo_ = '';\n\n\n/**\n * Domain part, e.g. \"www.google.com\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.domain_ = '';\n\n\n/**\n * Port, e.g. 8080.\n * @type {?number}\n * @private\n */\ngoog.Uri.prototype.port_ = null;\n\n\n/**\n * Path, e.g. \"/tests/img.png\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.path_ = '';\n\n\n/**\n * Object representing query data.\n * @type {!goog.Uri.QueryData}\n * @private\n */\ngoog.Uri.prototype.queryData_;\n\n\n/**\n * The fragment without the #.\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.fragment_ = '';\n\n\n/**\n * @return {string} The string form of the url.\n * @override\n */\ngoog.Uri.prototype.toString = function() {\n var out = [];\n\n var scheme = this.getScheme();\n if (scheme) {\n out.push(goog.Uri.encodeSpecialChars_(\n scheme, goog.Uri.reDisallowedInSchemeOrUserInfo_, true), ':');\n }\n\n var domain = this.getDomain();\n if (domain) {\n out.push('//');\n\n var userInfo = this.getUserInfo();\n if (userInfo) {\n out.push(goog.Uri.encodeSpecialChars_(\n userInfo, goog.Uri.reDisallowedInSchemeOrUserInfo_, true), '@');\n }\n\n out.push(goog.Uri.removeDoubleEncoding_(encodeURIComponent(domain)));\n\n var port = this.getPort();\n if (port != null) {\n out.push(':', String(port));\n }\n }\n\n var path = this.getPath();\n if (path) {\n if (this.hasDomain() && path.charAt(0) != '/') {\n out.push('/');\n }\n out.push(goog.Uri.encodeSpecialChars_(\n path,\n path.charAt(0) == '/' ?\n goog.Uri.reDisallowedInAbsolutePath_ :\n goog.Uri.reDisallowedInRelativePath_,\n true));\n }\n\n var query = this.getEncodedQuery();\n if (query) {\n out.push('?', query);\n }\n\n var fragment = this.getFragment();\n if (fragment) {\n out.push('#', goog.Uri.encodeSpecialChars_(\n fragment, goog.Uri.reDisallowedInFragment_));\n }\n return out.join('');\n};\n\n\n/**\n * Resolves the given relative URI (a goog.Uri object), using the URI\n * represented by this instance as the base URI.\n *\n * There are several kinds of relative URIs:<br>\n * 1. foo - replaces the last part of the path, the whole query and fragment<br>\n * 2. /foo - replaces the the path, the query and fragment<br>\n * 3. //foo - replaces everything from the domain on. foo is a domain name<br>\n * 4. ?foo - replace the query and fragment<br>\n * 5. #foo - replace the fragment only\n *\n * Additionally, if relative URI has a non-empty path, all \"..\" and \".\"\n * segments will be resolved, as described in RFC 3986.\n *\n * @param {goog.Uri} relativeUri The relative URI to resolve.\n * @return {!goog.Uri} The resolved URI.\n */\ngoog.Uri.prototype.resolve = function(relativeUri) {\n\n var absoluteUri = this.clone();\n if (absoluteUri.scheme_ === 'data') {\n // Cannot have a relative URI to a data URI.\n absoluteUri = new goog.Uri();\n }\n\n // we satisfy these conditions by looking for the first part of relativeUri\n // that is not blank and applying defaults to the rest\n\n var overridden = relativeUri.hasScheme();\n\n if (overridden) {\n absoluteUri.setScheme(relativeUri.getScheme());\n } else {\n overridden = relativeUri.hasUserInfo();\n }\n\n if (overridden) {\n absoluteUri.setUserInfo(relativeUri.getUserInfo());\n } else {\n overridden = relativeUri.hasDomain();\n }\n\n if (overridden) {\n absoluteUri.setDomain(relativeUri.getDomain());\n } else {\n overridden = relativeUri.hasPort();\n }\n\n var path = relativeUri.getPath();\n if (overridden) {\n absoluteUri.setPort(relativeUri.getPort());\n } else {\n overridden = relativeUri.hasPath();\n if (overridden) {\n // resolve path properly\n if (path.charAt(0) != '/') {\n // path is relative\n if (this.hasDomain() && !this.hasPath()) {\n // RFC 3986, section 5.2.3, case 1\n path = '/' + path;\n } else {\n // RFC 3986, section 5.2.3, case 2\n var lastSlashIndex = absoluteUri.getPath().lastIndexOf('/');\n if (lastSlashIndex != -1) {\n path = absoluteUri.getPath().substr(0, lastSlashIndex + 1) + path;\n }\n }\n }\n path = goog.Uri.removeDotSegments(path);\n }\n }\n\n if (overridden) {\n absoluteUri.setPath(path);\n } else {\n overridden = relativeUri.hasQuery();\n }\n\n if (overridden) {\n absoluteUri.setQueryData(relativeUri.getQueryData().clone());\n } else {\n overridden = relativeUri.hasFragment();\n }\n\n if (overridden) {\n absoluteUri.setFragment(relativeUri.getFragment());\n }\n\n return absoluteUri;\n};\n\n\n/**\n * Clones the URI instance.\n * @return {!goog.Uri} New instance of the URI object.\n */\ngoog.Uri.prototype.clone = function() {\n return new goog.Uri(this);\n};\n\n\n/**\n * @return {string} The encoded scheme/protocol for the URI.\n */\ngoog.Uri.prototype.getScheme = function() {\n return this.scheme_;\n};\n\n\n/**\n * Sets the scheme/protocol.\n * @param {string} newScheme New scheme value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setScheme = function(newScheme, opt_decode) {\n this.scheme_ = opt_decode ? goog.Uri.decodeOrEmpty_(newScheme, true) :\n newScheme;\n\n // remove an : at the end of the scheme so somebody can pass in\n // window.location.protocol\n if (this.scheme_) {\n this.scheme_ = this.scheme_.replace(/:$/, '');\n }\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the scheme has been set.\n */\ngoog.Uri.prototype.hasScheme = function() {\n return !!this.scheme_;\n};\n\n\n/**\n * @return {string} The decoded user info.\n */\ngoog.Uri.prototype.getUserInfo = function() {\n return this.userInfo_;\n};\n\n\n/**\n * Sets the userInfo.\n * @param {string} newUserInfo New userInfo value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setUserInfo = function(newUserInfo, opt_decode) {\n this.userInfo_ = opt_decode ? goog.Uri.decodeOrEmpty_(newUserInfo) :\n newUserInfo;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the user info has been set.\n */\ngoog.Uri.prototype.hasUserInfo = function() {\n return !!this.userInfo_;\n};\n\n\n/**\n * @return {string} The decoded domain.\n */\ngoog.Uri.prototype.getDomain = function() {\n return this.domain_;\n};\n\n\n/**\n * Sets the domain.\n * @param {string} newDomain New domain value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setDomain = function(newDomain, opt_decode) {\n this.domain_ = opt_decode ? goog.Uri.decodeOrEmpty_(newDomain, true) :\n newDomain;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the domain has been set.\n */\ngoog.Uri.prototype.hasDomain = function() {\n return !!this.domain_;\n};\n\n\n/**\n * @return {?number} The port number.\n */\ngoog.Uri.prototype.getPort = function() {\n return this.port_;\n};\n\n\n/**\n * Sets the port number.\n * @param {*} newPort Port number. Will be explicitly casted to a number.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setPort = function(newPort) {\n if (newPort) {\n newPort = Number(newPort);\n if (isNaN(newPort) || newPort < 0) {\n throw Error('Bad port number ' + newPort);\n }\n this.port_ = newPort;\n } else {\n this.port_ = null;\n }\n\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the port has been set.\n */\ngoog.Uri.prototype.hasPort = function() {\n return this.port_ != null;\n};\n\n\n/**\n * @return {string} The decoded path.\n */\ngoog.Uri.prototype.getPath = function() {\n return this.path_;\n};\n\n\n/**\n * Sets the path.\n * @param {string} newPath New path value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setPath = function(newPath, opt_decode) {\n this.path_ = opt_decode ? goog.Uri.decodeOrEmpty_(newPath, true) : newPath;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the path has been set.\n */\ngoog.Uri.prototype.hasPath = function() {\n return !!this.path_;\n};\n\n\n/**\n * @return {boolean} Whether the query string has been set.\n */\ngoog.Uri.prototype.hasQuery = function() {\n return this.queryData_.toString() !== '';\n};\n\n\n/**\n * Sets the query data.\n * @param {goog.Uri.QueryData|string|undefined} queryData QueryData object.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * Applies only if queryData is a string.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setQueryData = function(queryData, opt_decode) {\n if (queryData instanceof goog.Uri.QueryData) {\n this.queryData_ = queryData;\n } else {\n if (!opt_decode) {\n // QueryData accepts encoded query string, so encode it if\n // opt_decode flag is not true.\n queryData = goog.Uri.encodeSpecialChars_(queryData,\n goog.Uri.reDisallowedInQuery_);\n }\n this.queryData_ = new goog.Uri.QueryData(queryData, null);\n }\n\n return this;\n};\n\n\n/**\n * @return {string} The encoded URI query, not including the ?.\n */\ngoog.Uri.prototype.getEncodedQuery = function() {\n return this.queryData_.toString();\n};\n\n\n/**\n * @return {string} The decoded URI query, not including the ?.\n */\ngoog.Uri.prototype.getDecodedQuery = function() {\n return this.queryData_.toDecodedString();\n};\n\n\n/**\n * Returns the query data.\n * @return {!goog.Uri.QueryData} QueryData object.\n */\ngoog.Uri.prototype.getQueryData = function() {\n return this.queryData_;\n};\n\n\n/**\n * @return {string} The URI fragment, not including the #.\n */\ngoog.Uri.prototype.getFragment = function() {\n return this.fragment_;\n};\n\n\n/**\n * Sets the URI fragment.\n * @param {string} newFragment New fragment value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setFragment = function(newFragment, opt_decode) {\n this.fragment_ = opt_decode ? goog.Uri.decodeOrEmpty_(newFragment) :\n newFragment;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the URI has a fragment set.\n */\ngoog.Uri.prototype.hasFragment = function() {\n return !!this.fragment_;\n};\n\n\n//==============================================================================\n// Static members\n//==============================================================================\n\n\n/**\n * Removes dot segments in given path component, as described in\n * RFC 3986, section 5.2.4.\n *\n * @param {string} path A non-empty path component.\n * @return {string} Path component with removed dot segments.\n */\ngoog.Uri.removeDotSegments = function(path) {\n if (path == '..' || path == '.') {\n return '';\n\n } else if (path.indexOf('./') == -1 &&\n path.indexOf('/.') == -1) {\n // This optimization detects uris which do not contain dot-segments,\n // and as a consequence do not require any processing.\n return path;\n\n } else {\n var leadingSlash = (path.lastIndexOf('/', 0) == 0);\n var segments = path.split('/');\n var out = [];\n\n for (var pos = 0; pos < segments.length; ) {\n var segment = segments[pos++];\n\n if (segment == '.') {\n if (leadingSlash && pos == segments.length) {\n out.push('');\n }\n } else if (segment == '..') {\n if (out.length > 1 || out.length == 1 && out[0] != '') {\n out.pop();\n }\n if (leadingSlash && pos == segments.length) {\n out.push('');\n }\n } else {\n out.push(segment);\n leadingSlash = true;\n }\n }\n\n return out.join('/');\n }\n};\n\n\n/**\n * Decodes a value or returns the empty string if it isn't defined or empty.\n * @param {string|undefined} val Value to decode.\n * @param {boolean=} opt_preserveReserved If true, restricted characters will\n * not be decoded.\n * @return {string} Decoded value.\n * @private\n */\ngoog.Uri.decodeOrEmpty_ = function(val, opt_preserveReserved) {\n // Don't use UrlDecode() here because val is not a query parameter.\n if (!val) {\n return '';\n }\n\n return opt_preserveReserved ? decodeURI(val) : decodeURIComponent(val);\n};\n\n\n/**\n * If unescapedPart is non null, then escapes any characters in it that aren't\n * valid characters in a url and also escapes any special characters that\n * appear in extra.\n *\n * @param {*} unescapedPart The string to encode.\n * @param {RegExp} extra A character set of characters in [\\01-\\177].\n * @param {boolean=} opt_removeDoubleEncoding If true, remove double percent\n * encoding.\n * @return {?string} null iff unescapedPart == null.\n * @private\n */\ngoog.Uri.encodeSpecialChars_ = function(unescapedPart, extra,\n opt_removeDoubleEncoding) {\n if (goog.isString(unescapedPart)) {\n var encoded = encodeURI(unescapedPart).\n replace(extra, goog.Uri.encodeChar_);\n if (opt_removeDoubleEncoding) {\n // encodeURI double-escapes %XX sequences used to represent restricted\n // characters in some URI components, remove the double escaping here.\n encoded = goog.Uri.removeDoubleEncoding_(encoded);\n }\n return encoded;\n }\n return null;\n};\n\n\n/**\n * Converts a character in [\\01-\\177] to its unicode character equivalent.\n * @param {string} ch One character string.\n * @return {string} Encoded string.\n * @private\n */\ngoog.Uri.encodeChar_ = function(ch) {\n var n = ch.charCodeAt(0);\n return '%' + ((n >> 4) & 0xf).toString(16) + (n & 0xf).toString(16);\n};\n\n\n/**\n * Removes double percent-encoding from a string.\n * @param {string} doubleEncodedString String\n * @return {string} String with double encoding removed.\n * @private\n */\ngoog.Uri.removeDoubleEncoding_ = function(doubleEncodedString) {\n return doubleEncodedString.replace(/%25([0-9a-fA-F]{2})/g, '%$1');\n};\n\n\n/**\n * Regular expression for characters that are disallowed in the scheme or\n * userInfo part of the URI.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInSchemeOrUserInfo_ = /[#\\/\\?@]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in a relative path.\n * Colon is included due to RFC 3986 3.3.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInRelativePath_ = /[\\#\\?:]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in an absolute path.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInAbsolutePath_ = /[\\#\\?]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in the query.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInQuery_ = /[\\#\\?@]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in the fragment.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInFragment_ = /#/g;\n\n\n\n/**\n * Class used to represent URI query parameters. It is essentially a hash of\n * name-value pairs, though a name can be present more than once.\n *\n * Has the same interface as the collections in goog.structs.\n *\n * @param {?string=} opt_query Optional encoded query string to parse into\n * the object.\n * @param {goog.Uri=} opt_uri Optional uri object that should have its\n * cache invalidated when this object updates. Deprecated -- this\n * is no longer required.\n * @constructor\n * @final\n */\ngoog.Uri.QueryData = function(opt_query, opt_uri) {\n /**\n * Encoded query string, or null if it requires computing from the key map.\n * @type {?string}\n * @private\n */\n this.encodedQuery_ = opt_query || null;\n};\n\n\n/**\n * If the underlying key map is not yet initialized, it parses the\n * query string and fills the map with parsed data.\n * @private\n */\ngoog.Uri.QueryData.prototype.ensureKeyMapInitialized_ = function() {\n if (!this.keyMap_) {\n this.keyMap_ = {};\n this.count_ = 0;\n\n if (this.encodedQuery_) {\n var pairs = this.encodedQuery_.split('&');\n for (var i = 0; i < pairs.length; i++) {\n var indexOfEquals = pairs[i].indexOf('=');\n var name = null;\n var value = null;\n if (indexOfEquals >= 0) {\n name = pairs[i].substring(0, indexOfEquals);\n value = pairs[i].substring(indexOfEquals + 1);\n } else {\n name = pairs[i];\n }\n name = decodeURIComponent(name.replace(/\\+/g, ' '));\n value = value || '';\n this.add(name, decodeURIComponent(value.replace(/\\+/g, ' ')));\n }\n }\n }\n};\n\n\n/**\n * The map containing name/value or name/array-of-values pairs.\n * May be null if it requires parsing from the query string.\n *\n * We need to use a Map because we cannot guarantee that the key names will\n * not be problematic for IE.\n *\n * @type {Object.<string, !Array.<string>>}\n * @private\n */\ngoog.Uri.QueryData.prototype.keyMap_ = null;\n\n\n/**\n * The number of params, or null if it requires computing.\n * @type {?number}\n * @private\n */\ngoog.Uri.QueryData.prototype.count_ = null;\n\n\n/**\n * @return {?number} The number of parameters.\n */\ngoog.Uri.QueryData.prototype.getCount = function() {\n this.ensureKeyMapInitialized_();\n return this.count_;\n};\n\n\n/**\n * Adds a key value pair.\n * @param {string} key Name.\n * @param {*} value Value.\n * @return {!goog.Uri.QueryData} Instance of this object.\n */\ngoog.Uri.QueryData.prototype.add = function(key, value) {\n this.ensureKeyMapInitialized_();\n // Invalidate the cache.\n this.encodedQuery_ = null;\n\n var values = this.keyMap_.hasOwnProperty(key) && this.keyMap_[key];\n if (!values) {\n this.keyMap_[key] = (values = []);\n }\n values.push(value);\n this.count_++;\n return this;\n};\n\n\n/**\n * @return {string} Encoded query string.\n * @override\n */\ngoog.Uri.QueryData.prototype.toString = function() {\n if (this.encodedQuery_) {\n return this.encodedQuery_;\n }\n\n if (!this.keyMap_) {\n return '';\n }\n\n var sb = [];\n\n for (var key in this.keyMap_) {\n var encodedKey = encodeURIComponent(key);\n var val = this.keyMap_[key];\n for (var j = 0; j < val.length; j++) {\n var param = encodedKey;\n // Ensure that null and undefined are encoded into the url as\n // literal strings.\n if (val[j] !== '') {\n param += '=' + encodeURIComponent(val[j]);\n }\n sb.push(param);\n }\n }\n\n return this.encodedQuery_ = sb.join('&');\n};\n\n\n/**\n * @return {string} Decoded query string.\n */\ngoog.Uri.QueryData.prototype.toDecodedString = function() {\n return goog.Uri.decodeOrEmpty_(this.toString());\n};\n\n\n/**\n * Clone the query data instance.\n * @return {!goog.Uri.QueryData} New instance of the QueryData object.\n */\ngoog.Uri.QueryData.prototype.clone = function() {\n var rv = new goog.Uri.QueryData();\n rv.encodedQuery_ = this.encodedQuery_;\n if (this.keyMap_) {\n var cloneMap = {};\n for (var key in this.keyMap_) {\n cloneMap[key] = this.keyMap_[key].concat();\n }\n rv.keyMap_ = cloneMap;\n rv.count_ = this.count_;\n }\n return rv;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/third_party/closure/goog/uri/uri.js","// Copyright 2008 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Simple utilities for splitting URI strings.\n *\n * Uses features of RFC 3986 for parsing/formatting URIs:\n * http://www.ietf.org/rfc/rfc3986.txt\n *\n * @author gboyer@google.com (Garrett Boyer) - The \"lightened\" design.\n * @author msamuel@google.com (Mike Samuel) - Domain knowledge and regexes.\n */\n\ngoog.provide('goog.uri.utils');\ngoog.provide('goog.uri.utils.ComponentIndex');\n\n\n/**\n * A regular expression for breaking a URI into its component parts.\n *\n * {@link http://www.ietf.org/rfc/rfc3986.txt} says in Appendix B\n * As the \"first-match-wins\" algorithm is identical to the \"greedy\"\n * disambiguation method used by POSIX regular expressions, it is natural and\n * commonplace to use a regular expression for parsing the potential five\n * components of a URI reference.\n *\n * The following line is the regular expression for breaking-down a\n * well-formed URI reference into its components.\n *\n * <pre>\n * ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\n * 12 3 4 5 6 7 8 9\n * </pre>\n *\n * The numbers in the second line above are only to assist readability; they\n * indicate the reference points for each subexpression (i.e., each paired\n * parenthesis). We refer to the value matched for subexpression <n> as $<n>.\n * For example, matching the above expression to\n * <pre>\n * http://www.ics.uci.edu/pub/ietf/uri/#Related\n * </pre>\n * results in the following subexpression matches:\n * <pre>\n * $1 = http:\n * $2 = http\n * $3 = //www.ics.uci.edu\n * $4 = www.ics.uci.edu\n * $5 = /pub/ietf/uri/\n * $6 = <undefined>\n * $7 = <undefined>\n * $8 = #Related\n * $9 = Related\n * </pre>\n * where <undefined> indicates that the component is not present, as is the\n * case for the query component in the above example. Therefore, we can\n * determine the value of the five components as\n * <pre>\n * scheme = $2\n * authority = $4\n * path = $5\n * query = $7\n * fragment = $9\n * </pre>\n *\n * The regular expression has been modified slightly to expose the\n * userInfo, domain, and port separately from the authority.\n * The modified version yields\n * <pre>\n * $1 = http scheme\n * $2 = <undefined> userInfo -\\\n * $3 = www.ics.uci.edu domain | authority\n * $4 = <undefined> port -/\n * $5 = /pub/ietf/uri/ path\n * $6 = <undefined> query without ?\n * $7 = Related fragment without #\n * </pre>\n * @type {!RegExp}\n * @private\n */\ngoog.uri.utils.splitRe_ = new RegExp(\n '^' +\n '(?:' +\n '([^:/?#.]+)' + // scheme - ignore special characters\n // used by other URL parts such as :,\n // ?, /, #, and .\n ':)?' +\n '(?://' +\n '(?:([^/?#]*)@)?' + // userInfo\n '([^/#?]*?)' + // domain\n '(?::([0-9]+))?' + // port\n '(?=[/#?]|$)' + // authority-terminating character\n ')?' +\n '([^?#]+)?' + // path\n '(?:\\\\?([^#]*))?' + // query\n '(?:#(.*))?' + // fragment\n '$');\n\n\n/**\n * The index of each URI component in the return value of goog.uri.utils.split.\n * @enum {number}\n */\ngoog.uri.utils.ComponentIndex = {\n SCHEME: 1,\n USER_INFO: 2,\n DOMAIN: 3,\n PORT: 4,\n PATH: 5,\n QUERY_DATA: 6,\n FRAGMENT: 7\n};\n\n\n/**\n * Splits a URI into its component parts.\n *\n * Each component can be accessed via the component indices; for example:\n * <pre>\n * goog.uri.utils.split(someStr)[goog.uri.utils.CompontentIndex.QUERY_DATA];\n * </pre>\n *\n * @param {string} uri The URI string to examine.\n * @return {!Array.<string|undefined>} Each component still URI-encoded.\n * Each component that is present will contain the encoded value, whereas\n * components that are not present will be undefined or empty, depending\n * on the browser's regular expression implementation. Never null, since\n * arbitrary strings may still look like path names.\n */\ngoog.uri.utils.split = function(uri) {\n // See @return comment -- never null.\n return /** @type {!Array.<string|undefined>} */ (\n uri.match(goog.uri.utils.splitRe_));\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/third_party/closure/goog/uri/utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Functional');\n\n\n/**\n * @namespace shaka.util.Functional\n * @summary A set of functional utility functions.\n */\n\n\n/**\n * Creates a promise chain that calls the given callback for each element in\n * the array in a catch of a promise.\n *\n * e.g.:\n * Promise.reject().catch(callback(array[0])).catch(callback(array[1]));\n *\n * @param {!Array.<ELEM>} array\n * @param {function(ELEM):!Promise.<RESULT>} callback\n * @return {!Promise.<RESULT>}\n * @template ELEM,RESULT\n */\nshaka.util.Functional.createFallbackPromiseChain = function(array, callback) {\n return array.reduce(function(callback, promise, elem) {\n return promise.catch(callback.bind(null, elem));\n }.bind(null, callback), Promise.reject());\n};\n\n\n/**\n * Returns the first array concatenated to the second; used to collapse an\n * array of arrays into a single array.\n *\n * @param {!Array.<T>} all\n * @param {!Array.<T>} part\n * @return {!Array.<T>}\n * @template T\n */\nshaka.util.Functional.collapseArrays = function(all, part) {\n return all.concat(part);\n};\n\n\n/**\n * A no-op function. Useful in promise chains.\n */\nshaka.util.Functional.noop = function() {};\n\n\n/**\n * Returns if the given value is not null; useful for filtering out null values.\n *\n * @param {T} value\n * @return {boolean}\n * @template T\n */\nshaka.util.Functional.isNotNull = function(value) {\n return value != null;\n};\n\n\n/**\n * Creates a function that returns whether the given value is equal to the given\n * value.\n *\n * @param {T} compare\n * @return {function(T):boolean}\n * @template T\n */\nshaka.util.Functional.isEqualFunc = function(compare) {\n return function(a) { return a == compare; };\n};\n\n\n/**\n * Creates a function that returns whether the given value is not equal to the\n * given value.\n *\n * @param {T} compare\n * @return {function(T):boolean}\n * @template T\n */\nshaka.util.Functional.isNotEqualFunc = function(compare) {\n return function(a) { return a != compare; };\n};\n\n\n/**\n * Used to filter out duplicates in an array.\n * Returns true the first time the element is encountered. Returns false\n * for all the subsequent encounters.\n *\n * @param {T} item\n * @param {number} position\n * @param {!Array.<T>} self\n * @return {boolean}\n * @template T\n * @example [1, 1, 2].filter(shaka.util.Functional.isNotDuplicate) -> [1, 2]\n */\nshaka.util.Functional.isNotDuplicate = function(item, position, self) {\n return self.indexOf(item) == position;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/functional.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.ManifestParserUtils');\n\ngoog.require('goog.Uri');\ngoog.require('shaka.util.Functional');\n\n\n/**\n * @namespace shaka.util.ManifestParserUtils\n * @summary Utility functions for manifest parsing.\n */\n\n\n/**\n * Resolves an array of relative URIs to the given base URIs. This will result\n * in M*N number of URIs.\n *\n * @param {!Array.<string>} baseUris\n * @param {!Array.<string>} relativeUris\n * @return {!Array.<string>}\n */\nshaka.util.ManifestParserUtils.resolveUris = function(baseUris, relativeUris) {\n var Functional = shaka.util.Functional;\n if (relativeUris.length == 0)\n return baseUris;\n\n var relativeAsGoog =\n relativeUris.map(function(uri) { return new goog.Uri(uri); });\n // Resolve each URI relative to each base URI, creating an Array of Arrays.\n // Then flatten the Arrays into a single Array.\n return baseUris.map(function(uri) { return new goog.Uri(uri); })\n .map(function(base) { return relativeAsGoog.map(base.resolve.bind(base)); })\n .reduce(Functional.collapseArrays, [])\n .map(function(uri) { return uri.toString(); });\n};\n\n\n/**\n * Creates a DrmInfo object from the given info.\n *\n * @param {string} keySystem\n * @param {Array.<shakaExtern.InitDataOverride>} initData\n * @return {shakaExtern.DrmInfo}\n */\nshaka.util.ManifestParserUtils.createDrmInfo = function(keySystem, initData) {\n return {\n keySystem: keySystem,\n licenseServerUri: '',\n distinctiveIdentifierRequired: false,\n persistentStateRequired: false,\n audioRobustness: '',\n videoRobustness: '',\n serverCertificate: null,\n initData: initData || [],\n keyIds: []\n };\n};\n\n\n/**\n * @enum {string}\n */\nshaka.util.ManifestParserUtils.ContentType = {\n VIDEO: 'video',\n AUDIO: 'audio',\n TEXT: 'text',\n APPLICATION: 'application'\n};\n\n\n/**\n * @enum {string}\n */\nshaka.util.ManifestParserUtils.TextStreamKind = {\n SUBTITLE: 'subtitle',\n CLOSED_CAPTION: 'caption'\n};\n\n\n/**\n * Specifies how tolerant the player is to inaccurate segment start times and\n * end times within a manifest. For example, gaps or overlaps between segments\n * in a SegmentTimeline which are greater than or equal to this value will\n * result in a warning message.\n *\n * @const {number}\n */\nshaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS = 1 / 15;\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/manifest_parser_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.ConfigUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\n\n\n/**\n * @param {!Object} destination\n * @param {!Object} source\n * @param {!Object} template supplies default values\n * @param {!Object} overrides\n * Supplies override type checking. When the current path matches the key in\n * this object, each sub-value must match the type in this object. If this\n * contains an Object, it is used as the template.\n * @param {string} path to this part of the config\n */\nshaka.util.ConfigUtils.mergeConfigObjects =\n function(destination, source, template, overrides, path) {\n goog.asserts.assert(destination, 'Destination config must not be null!');\n\n /**\n * @type {boolean}\n * If true, don't validate the keys in the next level.\n */\n var ignoreKeys = path in overrides;\n\n for (var k in source) {\n var subPath = path + '.' + k;\n var subTemplate = ignoreKeys ? overrides[path] : template[k];\n\n /**\n * @type {boolean}\n * If true, simply copy the object over and don't verify.\n */\n var copyObject = !!({\n '.abr.manager': true\n })[subPath] || !!({\n 'serverCertificate': true\n })[k];\n\n // The order of these checks is important.\n if (!ignoreKeys && !(k in destination)) {\n shaka.log.error('Invalid config, unrecognized key ' + subPath);\n } else if (source[k] === undefined) {\n // An explicit 'undefined' value causes the key to be deleted from the\n // destination config and replaced with a default from the template if\n // possible.\n if (subTemplate === undefined || ignoreKeys) {\n delete destination[k];\n } else {\n destination[k] = subTemplate;\n }\n } else if (copyObject) {\n destination[k] = source[k];\n } else if (typeof destination[k] == 'object' &&\n typeof source[k] == 'object') {\n shaka.util.ConfigUtils.mergeConfigObjects(\n destination[k], source[k], subTemplate, overrides, subPath);\n } else if (typeof source[k] != typeof subTemplate) {\n shaka.log.error('Invalid config, wrong type for ' + subPath);\n } else if (typeof destination[k] == 'function' &&\n destination[k].length != source[k].length) {\n shaka.log.warning(\n 'Invalid config, wrong number of arguments for ' + subPath);\n destination[k] = source[k];\n } else {\n destination[k] = source[k];\n }\n }\n};\n\n\n/**\n * Performs a deep clone of the given simple object. This does not copy\n * prototypes, custom properties (e.g. read-only), or multiple references to\n * the same object. This uses JSON to clone.\n *\n * @template T\n * @param {T} arg\n * @return {T}\n */\nshaka.util.ConfigUtils.cloneObject = function(arg) {\n return JSON.parse(JSON.stringify(arg));\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/config_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.PublicPromise');\n\n\n\n/**\n * A utility to create Promises with convenient public resolve and reject\n * methods.\n *\n * @constructor\n * @struct\n * @extends {Promise.<T>}\n * @return {Promise.<T>}\n * @template T\n */\nshaka.util.PublicPromise = function() {\n var resolvePromise;\n var rejectPromise;\n\n // Promise.call causes an error. It seems that inheriting from a native\n // Promise is not permitted by JavaScript interpreters.\n\n // The work-around is to construct a Promise object, modify it to look like\n // the compiler's picture of PublicPromise, then return it. The caller of\n // new PublicPromise will receive |promise| instead of |this|, and the\n // compiler will be aware of the additional properties |resolve| and\n // |reject|.\n\n var promise = new Promise(function(resolve, reject) {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n\n promise.resolve = resolvePromise;\n promise.reject = rejectPromise;\n\n return promise;\n};\n\n\n/** @type {function(T=)} */\nshaka.util.PublicPromise.prototype.resolve;\n\n\n/** @type {function(*=)} */\nshaka.util.PublicPromise.prototype.reject;\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/public_promise.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.net.NetworkingEngine');\n\ngoog.require('goog.Uri');\ngoog.require('goog.asserts');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * NetworkingEngine wraps all networking operations. This accepts plugins that\n * handle the actual request. A plugin is registered using registerScheme.\n * Each scheme has at most one plugin to handle the request.\n *\n * @param {function(number, number)=} opt_onSegmentDownloaded Called\n * when a segment is downloaded. Passed the duration, in milliseconds, that\n * the request took; and the total number of bytes transferred.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n * @export\n */\nshaka.net.NetworkingEngine = function(opt_onSegmentDownloaded) {\n /** @private {boolean} */\n this.destroyed_ = false;\n\n /** @private {!Array.<!Promise>} */\n this.requests_ = [];\n\n /** @private {!Array.<shakaExtern.RequestFilter>} */\n this.requestFilters_ = [];\n\n /** @private {!Array.<shakaExtern.ResponseFilter>} */\n this.responseFilters_ = [];\n\n /** @private {?function(number, number)} */\n this.onSegmentDownloaded_ = opt_onSegmentDownloaded || null;\n};\n\n\n/**\n * Request types. Allows a filter to decide which requests to read/alter.\n *\n * @enum {number}\n * @export\n */\nshaka.net.NetworkingEngine.RequestType = {\n 'MANIFEST': 0,\n 'SEGMENT': 1,\n 'LICENSE': 2,\n 'APP': 3\n};\n\n\n/**\n * Contains the scheme plugins.\n *\n * @private {!Object.<string, ?shakaExtern.SchemePlugin>}\n */\nshaka.net.NetworkingEngine.schemes_ = {};\n\n\n/**\n * Registers a scheme plugin. This plugin will handle all requests with the\n * given scheme. If a plugin with the same scheme already exists, it is\n * replaced.\n *\n * @param {string} scheme\n * @param {shakaExtern.SchemePlugin} plugin\n * @export\n */\nshaka.net.NetworkingEngine.registerScheme = function(scheme, plugin) {\n shaka.net.NetworkingEngine.schemes_[scheme] = plugin;\n};\n\n\n/**\n * Removes a scheme plugin.\n *\n * @param {string} scheme\n * @export\n */\nshaka.net.NetworkingEngine.unregisterScheme = function(scheme) {\n delete shaka.net.NetworkingEngine.schemes_[scheme];\n};\n\n\n/**\n * Registers a new request filter. All filters are applied in the order they\n * are registered.\n *\n * @param {shakaExtern.RequestFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.registerRequestFilter = function(filter) {\n this.requestFilters_.push(filter);\n};\n\n\n/**\n * Removes a request filter.\n *\n * @param {shakaExtern.RequestFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.unregisterRequestFilter =\n function(filter) {\n var filters = this.requestFilters_;\n var i = filters.indexOf(filter);\n if (i >= 0) {\n filters.splice(i, 1);\n }\n};\n\n\n/**\n * Clear all request filters.\n *\n * @export\n */\nshaka.net.NetworkingEngine.prototype.clearAllRequestFilters = function() {\n this.requestFilters_ = [];\n};\n\n\n/**\n * Registers a new response filter. All filters are applied in the order they\n * are registered.\n *\n * @param {shakaExtern.ResponseFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.registerResponseFilter = function(filter) {\n this.responseFilters_.push(filter);\n};\n\n\n/**\n * Removes a response filter.\n *\n * @param {shakaExtern.ResponseFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.unregisterResponseFilter =\n function(filter) {\n var filters = this.responseFilters_;\n var i = filters.indexOf(filter);\n if (i >= 0) {\n filters.splice(i, 1);\n }\n};\n\n\n/**\n * Clear all response filters.\n *\n * @export\n */\nshaka.net.NetworkingEngine.prototype.clearAllResponseFilters = function() {\n this.responseFilters_ = [];\n};\n\n\n/**\n * Gets a copy of the default retry parameters.\n *\n * @return {shakaExtern.RetryParameters}\n */\nshaka.net.NetworkingEngine.defaultRetryParameters = function() {\n // Use a function rather than a constant member so the calling code can\n // modify the values without affecting other call results.\n return {\n maxAttempts: 2,\n baseDelay: 1000,\n backoffFactor: 2,\n fuzzFactor: 0.5,\n timeout: 0\n };\n};\n\n\n/**\n * Makes a simple network request for the given URIs.\n *\n * @param {!Array.<string>} uris\n * @param {shakaExtern.RetryParameters} retryParams\n * @return {shakaExtern.Request}\n */\nshaka.net.NetworkingEngine.makeRequest = function(\n uris, retryParams) {\n return {\n uris: uris,\n method: 'GET',\n body: null,\n headers: {},\n allowCrossSiteCredentials: false,\n retryParameters: retryParams\n };\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.net.NetworkingEngine.prototype.destroy = function() {\n var Functional = shaka.util.Functional;\n this.destroyed_ = true;\n this.requestFilters_ = [];\n this.responseFilters_ = [];\n\n var cleanup = [];\n for (var i = 0; i < this.requests_.length; ++i) {\n cleanup.push(this.requests_[i].catch(Functional.noop));\n }\n return Promise.all(cleanup);\n};\n\n\n/**\n * Makes a network request and returns the resulting data.\n *\n * @param {shaka.net.NetworkingEngine.RequestType} type\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.net.NetworkingEngine.prototype.request = function(type, request) {\n var cloneObject = shaka.util.ConfigUtils.cloneObject;\n\n // New requests made after destroy is called are rejected.\n if (this.destroyed_)\n return Promise.reject();\n\n goog.asserts.assert(request.uris && request.uris.length,\n 'Request without URIs!');\n\n // If a request comes from outside the library, some parameters may be left\n // undefined. To make it easier for application developers, we will fill them\n // in with defaults if necessary.\n //\n // We clone retryParameters and uris so that if a filter modifies the request,\n // then it doesn't contaminate future requests.\n request.method = request.method || 'GET';\n request.headers = request.headers || {};\n request.retryParameters = request.retryParameters ?\n cloneObject(request.retryParameters) :\n shaka.net.NetworkingEngine.defaultRetryParameters();\n request.uris = cloneObject(request.uris);\n\n var filterStartMs = Date.now();\n\n // Send to the filter first, in-case they change the URI.\n var p = Promise.resolve();\n this.requestFilters_.forEach(function(requestFilter) {\n // Request filters are resolved sequentially.\n p = p.then(requestFilter.bind(null, type, request));\n });\n\n // Catch any errors thrown by request filters, and substitute\n // them with a Shaka-native error.\n p = p.catch(function(e) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.REQUEST_FILTER_ERROR, e);\n });\n\n // Send out the request, and get a response.\n // The entire code is inside a then clause; thus, if a filter\n // rejects or errors, the networking engine will never send.\n p = p.then(function() {\n var filterTimeMs = (Date.now() - filterStartMs);\n\n var retry = request.retryParameters || {};\n var maxAttempts = retry.maxAttempts || 1;\n var backoffFactor = retry.backoffFactor || 2.0;\n var delay = (retry.baseDelay == null ? 1000 : retry.baseDelay);\n\n var p = this.send_(type, request, 0, filterTimeMs);\n for (var i = 1; i < maxAttempts; i++) {\n var index = i % request.uris.length;\n p = p.catch(function(delay, index, err) {\n if (err && err.severity == shaka.util.Error.Severity.RECOVERABLE)\n return this.resend_(type, request, delay, index, filterTimeMs);\n throw err;\n }.bind(this, delay, index));\n delay *= backoffFactor;\n }\n\n return p;\n }.bind(this));\n\n // Add the request to the array.\n this.requests_.push(p);\n return p.then(function(response) {\n if (this.requests_.indexOf(p) >= 0) {\n this.requests_.splice(this.requests_.indexOf(p), 1);\n }\n if (this.onSegmentDownloaded_ && !response.fromCache &&\n type == shaka.net.NetworkingEngine.RequestType.SEGMENT) {\n this.onSegmentDownloaded_(response.timeMs, response.data.byteLength);\n }\n return response;\n }.bind(this)).catch(function(e) {\n // Ignore if using |Promise.reject()| to signal destroy.\n if (e) {\n goog.asserts.assert(e instanceof shaka.util.Error, 'Wrong error type');\n e.severity = shaka.util.Error.Severity.CRITICAL;\n }\n\n if (this.requests_.indexOf(p) >= 0) {\n this.requests_.splice(this.requests_.indexOf(p), 1);\n }\n return Promise.reject(e);\n }.bind(this));\n};\n\n\n/**\n * Sends the given request to the correct plugin. This does not handle retry.\n *\n * @param {shaka.net.NetworkingEngine.RequestType} type\n * @param {shakaExtern.Request} request\n * @param {number} index\n * @param {number} requestFilterTime\n * @return {!Promise.<shakaExtern.Response>}\n * @private\n */\nshaka.net.NetworkingEngine.prototype.send_ = function(\n type, request, index, requestFilterTime) {\n // Retries sent after destroy is called are rejected.\n if (this.destroyed_)\n return Promise.reject();\n\n var uri = new goog.Uri(request.uris[index]);\n var scheme = uri.getScheme();\n\n if (!scheme) {\n // If there is no scheme, infer one from the location.\n scheme = shaka.net.NetworkingEngine.getLocationProtocol_();\n goog.asserts.assert(scheme[scheme.length - 1] == ':',\n 'location.protocol expected to end with a colon!');\n // Drop the colon.\n scheme = scheme.slice(0, -1);\n\n // Override the original URI to make the scheme explicit.\n uri.setScheme(scheme);\n request.uris[index] = uri.toString();\n }\n\n var plugin = shaka.net.NetworkingEngine.schemes_[scheme];\n if (!plugin) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.UNSUPPORTED_SCHEME,\n uri));\n }\n\n var startTimeMs = Date.now();\n return plugin(request.uris[index], request, type).then(function(response) {\n if (response.timeMs == undefined)\n response.timeMs = Date.now() - startTimeMs;\n var filterStartMs = Date.now();\n\n var p = Promise.resolve();\n this.responseFilters_.forEach(function(responseFilter) {\n // Response filters are resolved sequentially.\n p = p.then(function() {\n return Promise.resolve(responseFilter(type, response));\n }.bind(this));\n });\n\n // Catch any errors thrown by response filters, and substitute\n // them with a Shaka-native error.\n p = p.catch(function(e) {\n var severity = shaka.util.Error.Severity.CRITICAL;\n if (e instanceof shaka.util.Error)\n severity = e.severity;\n\n throw new shaka.util.Error(\n severity,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.RESPONSE_FILTER_ERROR, e);\n });\n\n return p.then(function() {\n response.timeMs += Date.now() - filterStartMs;\n response.timeMs += requestFilterTime;\n\n return response;\n });\n }.bind(this));\n};\n\n\n/**\n * Resends the request after applying a delay. This does not handle retry.\n *\n * @param {shaka.net.NetworkingEngine.RequestType} type\n * @param {shakaExtern.Request} request\n * @param {number} delayMs The current base delay.\n * @param {number} index\n * @param {number} requestFilterTime\n * @return {!Promise.<shakaExtern.Response>}\n * @private\n */\nshaka.net.NetworkingEngine.prototype.resend_ =\n function(type, request, delayMs, index, requestFilterTime) {\n var p = new shaka.util.PublicPromise();\n\n // Fuzz the delay to avoid tons of clients hitting the server at once\n // after it recovers from whatever is causing it to fail.\n var retry = request.retryParameters || {};\n var fuzzFactor = (retry.fuzzFactor == null ? 0.5 : retry.fuzzFactor);\n var negToPosOne = (Math.random() * 2.0) - 1.0;\n var negToPosFuzzFactor = negToPosOne * fuzzFactor;\n var fuzzedDelay = delayMs * (1.0 + negToPosFuzzFactor);\n shaka.net.NetworkingEngine.setTimeout_(p.resolve, fuzzedDelay);\n\n return p.then(this.send_.bind(this, type, request, index, requestFilterTime));\n};\n\n\n/**\n * This is here only for testability. We can't mock location in our tests on\n * all browsers, so instead we mock this.\n *\n * @return {string} The value of location.protocol.\n * @private\n */\nshaka.net.NetworkingEngine.getLocationProtocol_ = function() {\n return location.protocol;\n};\n\n\n/**\n * This is here only for testability. Mocking global setTimeout can lead to\n * unintended interactions with other tests. So instead, we mock this.\n *\n * @param {Function} fn The callback to invoke when the timeout expires.\n * @param {number} timeoutMs The timeout in milliseconds.\n * @return {number} The timeout ID.\n * @private\n */\nshaka.net.NetworkingEngine.setTimeout_ = function(fn, timeoutMs) {\n return window.setTimeout(fn, timeoutMs);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/net/networking_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.ArrayUtils');\n\n\n/**\n * @namespace shaka.util.ArrayUtils\n * @summary Array utility functions.\n */\n\n\n/**\n * Remove duplicate entries from an array. Order N^2, so use with caution.\n * @param {!Array.<T>} array\n * @param {function(T, T): boolean=} opt_compareFn An optional function which\n * will be used to compare items in the array.\n * @return {!Array.<T>}\n * @template T\n */\nshaka.util.ArrayUtils.removeDuplicates = function(array, opt_compareFn) {\n var result = [];\n for (var i = 0; i < array.length; ++i) {\n var matchFound = false;\n for (var j = 0; j < result.length; ++j) {\n matchFound = opt_compareFn ? opt_compareFn(array[i], result[j]) :\n array[i] === result[j];\n if (matchFound) break;\n }\n if (!matchFound) {\n result.push(array[i]);\n }\n }\n return result;\n};\n\n\n/**\n * Find an item in an array. For use when comparison of entries via == will\n * not suffice.\n * @param {!Array.<T>} array\n * @param {T} value\n * @param {function(T, T): boolean} compareFn A function which will be used to\n * compare items in the array.\n * @return {number} The index, or -1 if not found.\n * @template T\n */\nshaka.util.ArrayUtils.indexOf = function(array, value, compareFn) {\n for (var i = 0; i < array.length; ++i) {\n if (compareFn(array[i], value)) {\n return i;\n }\n }\n return -1;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/array_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.MultiMap');\n\n\n\n/**\n * A simple multimap template.\n * @constructor\n * @struct\n * @template T\n */\nshaka.util.MultiMap = function() {\n /** @private {!Object.<string, !Array.<T>>} */\n this.map_ = {};\n};\n\n\n/**\n * Add a key, value pair to the map.\n * @param {string} key\n * @param {T} value\n */\nshaka.util.MultiMap.prototype.push = function(key, value) {\n if (this.map_.hasOwnProperty(key)) {\n this.map_[key].push(value);\n } else {\n this.map_[key] = [value];\n }\n};\n\n\n/**\n * Get a list of values by key.\n * @param {string} key\n * @return {Array.<T>} or null if no such key exists.\n */\nshaka.util.MultiMap.prototype.get = function(key) {\n var list = this.map_[key];\n // slice() clones the list so that it and the map can each be modified\n // without affecting the other.\n return list ? list.slice() : null;\n};\n\n\n/**\n * Get a list of all values.\n * @return {!Array.<T>}\n */\nshaka.util.MultiMap.prototype.getAll = function() {\n var list = [];\n for (var key in this.map_) {\n list.push.apply(list, this.map_[key]);\n }\n return list;\n};\n\n\n/**\n * Remove a specific value, if it exists.\n * @param {string} key\n * @param {T} value\n */\nshaka.util.MultiMap.prototype.remove = function(key, value) {\n var list = this.map_[key];\n if (!list) return;\n for (var i = 0; i < list.length; ++i) {\n if (list[i] == value) {\n list.splice(i, 1);\n --i;\n }\n }\n};\n\n\n/**\n * Clear all keys and values from the multimap.\n */\nshaka.util.MultiMap.prototype.clear = function() {\n this.map_ = {};\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/multi_map.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.EventManager');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.MultiMap');\n\n\n\n/**\n * Creates a new EventManager. An EventManager maintains a collection of \"event\n * bindings\" between event targets and event listeners.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n */\nshaka.util.EventManager = function() {\n /**\n * Maps an event type to an array of event bindings.\n * @private {shaka.util.MultiMap.<!shaka.util.EventManager.Binding_>}\n */\n this.bindingMap_ = new shaka.util.MultiMap();\n};\n\n\n/**\n * @typedef {function(!Event)}\n */\nshaka.util.EventManager.ListenerType;\n\n\n/**\n * Detaches all event listeners.\n * @override\n */\nshaka.util.EventManager.prototype.destroy = function() {\n this.removeAll();\n this.bindingMap_ = null;\n return Promise.resolve();\n};\n\n\n/**\n * Attaches an event listener to an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {shaka.util.EventManager.ListenerType} listener The event listener.\n */\nshaka.util.EventManager.prototype.listen = function(target, type, listener) {\n if (!this.bindingMap_) return;\n\n var binding = new shaka.util.EventManager.Binding_(target, type, listener);\n this.bindingMap_.push(type, binding);\n};\n\n\n/**\n * Attaches an event listener to an event target. The listener will be removed\n * when the first instance of the event is fired.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {shaka.util.EventManager.ListenerType} listener The event listener.\n */\nshaka.util.EventManager.prototype.listenOnce =\n function(target, type, listener) {\n // Install a shim listener that will stop listening after the first event.\n this.listen(target, type, function(event) {\n // Stop listening to this event.\n this.unlisten(target, type);\n // Call the original listener.\n listener(event);\n }.bind(this));\n};\n\n\n/**\n * Detaches an event listener from an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n */\nshaka.util.EventManager.prototype.unlisten = function(target, type) {\n if (!this.bindingMap_) return;\n\n var list = this.bindingMap_.get(type) || [];\n\n for (var i = 0; i < list.length; ++i) {\n var binding = list[i];\n\n if (binding.target == target) {\n binding.unlisten();\n this.bindingMap_.remove(type, binding);\n }\n }\n};\n\n\n/**\n * Detaches all event listeners from all targets.\n */\nshaka.util.EventManager.prototype.removeAll = function() {\n if (!this.bindingMap_) return;\n\n var list = this.bindingMap_.getAll();\n\n for (var i = 0; i < list.length; ++i) {\n list[i].unlisten();\n }\n\n this.bindingMap_.clear();\n};\n\n\n\n/**\n * Creates a new Binding_ and attaches the event listener to the event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {shaka.util.EventManager.ListenerType} listener The event listener.\n * @constructor\n * @private\n */\nshaka.util.EventManager.Binding_ = function(target, type, listener) {\n /** @type {EventTarget} */\n this.target = target;\n\n /** @type {string} */\n this.type = type;\n\n /** @type {?shaka.util.EventManager.ListenerType} */\n this.listener = listener;\n\n this.target.addEventListener(type, listener, false);\n};\n\n\n/**\n * Detaches the event listener from the event target. This does nothing if the\n * event listener is already detached.\n */\nshaka.util.EventManager.Binding_.prototype.unlisten = function() {\n goog.asserts.assert(this.target, 'Missing target');\n this.target.removeEventListener(this.type, this.listener, false);\n\n this.target = null;\n this.listener = null;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/event_manager.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.MapUtils');\n\n\n/**\n * @namespace shaka.util.MapUtils\n * @summary A set of map/object utility functions.\n */\n\n\n/**\n * Returns true if the map is empty; otherwise, returns false.\n *\n * @param {Object.<KEY, VALUE>} object\n * @return {boolean}\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.empty = function(object) {\n return !object || Object.keys(object).length == 0;\n};\n\n\n/**\n * Gets the map's values.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @return {!Array.<VALUE>}\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.values = function(object) {\n return Object.keys(object).map(function(key) { return object[key]; });\n};\n\n\n/**\n * Converts the values in the given Map to a different value.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @param {function(VALUE, KEY=):OUTPUT} callback\n * @return {!Object.<KEY, OUTPUT>}\n * @template KEY,VALUE,OUTPUT\n */\nshaka.util.MapUtils.map = function(object, callback) {\n return Object.keys(object).reduce(function(ret, key) {\n var value = object[key];\n ret[key] = callback(value, key);\n return ret;\n }, {});\n};\n\n\n/**\n * Returns true if every entry matches the predicate.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @param {function(KEY, VALUE):boolean} callback\n * @return {boolean}\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.every = function(object, callback) {\n return Object.keys(object).every(function(key) {\n return callback(key, object[key]);\n });\n};\n\n\n/**\n * Invokes the callback for each entry in the map.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @param {function(KEY, VALUE)} callback\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.forEach = function(object, callback) {\n Object.keys(object).forEach(function(key) {\n callback(key, object[key]);\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/map_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.StringUtils');\n\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\n\n\n/**\n * @namespace shaka.util.StringUtils\n * @summary A set of string utility functions.\n * @exportDoc\n */\n\n\n/**\n * Creates a string from the given buffer as UTF-8 encoding.\n *\n * @param {?BufferSource} data\n * @return {string}\n * @throws {shaka.util.Error}\n * @export\n */\nshaka.util.StringUtils.fromUTF8 = function(data) {\n if (!data) return '';\n\n var uint8 = new Uint8Array(data);\n // If present, strip off the UTF-8 BOM.\n if (uint8[0] == 0xef && uint8[1] == 0xbb && uint8[2] == 0xbf) {\n uint8 = uint8.subarray(3);\n }\n\n // http://stackoverflow.com/a/13691499\n var utf8 = shaka.util.StringUtils.fromCharCode_(uint8);\n // This converts each character in the string to an escape sequence. If the\n // character is in the ASCII range, it is not converted; otherwise it is\n // converted to a URI escape sequence.\n // Example: '\\x67\\x35\\xe3\\x82\\xac' -> 'g#%E3%82%AC'\n var escaped = escape(utf8);\n // Decode the escaped sequence. This will interpret UTF-8 sequences into the\n // correct character.\n // Example: 'g#%E3%82%AC' -> 'g#€'\n try {\n return decodeURIComponent(escaped);\n } catch (e) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.BAD_ENCODING);\n }\n};\n\n\n/**\n * Creates a string from the given buffer as UTF-16 encoding.\n *\n * @param {?BufferSource} data\n * @param {boolean} littleEndian true to read little endian, false to read big.\n * @param {boolean=} opt_noThrow true to avoid throwing in cases where we may\n * expect invalid input. If noThrow is true and the data has an odd length,\n * it will be truncated.\n * @return {string}\n * @throws {shaka.util.Error}\n * @export\n */\nshaka.util.StringUtils.fromUTF16 = function(data, littleEndian, opt_noThrow) {\n if (!data) return '';\n\n if (!opt_noThrow && data.byteLength % 2 != 0) {\n shaka.log.error('Data has an incorrect length, must be even.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.BAD_ENCODING);\n }\n\n /** @type {ArrayBuffer} */\n var buffer;\n if (data instanceof ArrayBuffer) {\n buffer = data;\n } else {\n // Have to create a new buffer because the argument may be a smaller\n // view on a larger ArrayBuffer. We cannot use an ArrayBufferView in\n // a DataView.\n var temp = new Uint8Array(data.byteLength);\n temp.set(new Uint8Array(data));\n buffer = temp.buffer;\n }\n\n // Use a DataView to ensure correct endianness.\n var length = Math.floor(data.byteLength / 2);\n var arr = new Uint16Array(length);\n var dataView = new DataView(buffer);\n for (var i = 0; i < length; i++) {\n arr[i] = dataView.getUint16(i * 2, littleEndian);\n }\n return shaka.util.StringUtils.fromCharCode_(arr);\n};\n\n\n/**\n * Creates a string from the given buffer, auto-detecting the encoding that is\n * being used. If it cannot detect the encoding, it will throw an exception.\n *\n * @param {?BufferSource} data\n * @return {string}\n * @throws {shaka.util.Error}\n * @export\n */\nshaka.util.StringUtils.fromBytesAutoDetect = function(data) {\n var StringUtils = shaka.util.StringUtils;\n\n var uint8 = new Uint8Array(data);\n if (uint8[0] == 0xef && uint8[1] == 0xbb && uint8[2] == 0xbf)\n return StringUtils.fromUTF8(uint8);\n else if (uint8[0] == 0xfe && uint8[1] == 0xff)\n return StringUtils.fromUTF16(uint8.subarray(2), false /* littleEndian */);\n else if (uint8[0] == 0xff && uint8[1] == 0xfe)\n return StringUtils.fromUTF16(uint8.subarray(2), true /* littleEndian */);\n\n var isAscii = (function(arr, i) {\n // arr[i] >= ' ' && arr[i] <= '~';\n return arr.byteLength <= i || (arr[i] >= 0x20 && arr[i] <= 0x7e);\n }.bind(null, uint8));\n\n shaka.log.debug('Unable to find byte-order-mark, making an educated guess.');\n if (uint8[0] == 0 && uint8[2] == 0)\n return StringUtils.fromUTF16(data, false /* littleEndian */);\n else if (uint8[1] == 0 && uint8[3] == 0)\n return StringUtils.fromUTF16(data, true /* littleEndian */);\n else if (isAscii(0) && isAscii(1) && isAscii(2) && isAscii(3))\n return StringUtils.fromUTF8(data);\n\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.UNABLE_TO_DETECT_ENCODING);\n};\n\n\n/**\n * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.\n *\n * @param {string} str\n * @return {!ArrayBuffer}\n * @export\n */\nshaka.util.StringUtils.toUTF8 = function(str) {\n // http://stackoverflow.com/a/13691499\n // Converts the given string to a URI encoded string. If a character falls\n // in the ASCII range, it is not converted; otherwise it will be converted to\n // a series of URI escape sequences according to UTF-8.\n // Example: 'g#€' -> 'g#%E3%82%AC'\n var encoded = encodeURIComponent(str);\n // Convert each escape sequence individually into a character. Each escape\n // sequence is interpreted as a code-point, so if an escape sequence happens\n // to be part of a multi-byte sequence, each byte will be converted to a\n // single character.\n // Example: 'g#%E3%82%AC' -> '\\x67\\x35\\xe3\\x82\\xac'\n var utf8 = unescape(encoded);\n\n var result = new Uint8Array(utf8.length);\n for (var i = 0; i < utf8.length; ++i) {\n result[i] = utf8.charCodeAt(i);\n }\n return result.buffer;\n};\n\n\n/**\n * Creates a new string from the given array of char codes.\n *\n * @param {!TypedArray} args\n * @return {string}\n * @private\n */\nshaka.util.StringUtils.fromCharCode_ = function(args) {\n var max = 16000;\n var ret = '';\n for (var i = 0; i < args.length; i += max) {\n var subArray = args.subarray(i, i + max);\n ret += String.fromCharCode.apply(null, subArray);\n }\n\n return ret;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/string_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Timer');\n\n\n\n/**\n * A simple cancelable timer.\n * @param {Function} callback\n * @constructor\n * @struct\n */\nshaka.util.Timer = function(callback) {\n /** @private {?number} */\n this.id_ = null;\n\n /** @private {Function} */\n this.callback_ = (function() {\n this.id_ = null;\n callback();\n }.bind(this));\n};\n\n\n/**\n * Cancel the timer, if it's running.\n */\nshaka.util.Timer.prototype.cancel = function() {\n if (this.id_ != null) {\n clearTimeout(this.id_);\n this.id_ = null;\n }\n};\n\n\n/**\n * Schedule the timer, canceling any previous scheduling.\n * @param {number} seconds\n */\nshaka.util.Timer.prototype.schedule = function(seconds) {\n this.cancel();\n this.id_ = setTimeout(this.callback_, seconds * 1000);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/timer.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * @namespace shaka.util.Uint8ArrayUtils\n * @summary A set of Uint8Array utility functions.\n * @exportDoc\n */\n\n\n/**\n * Convert a Uint8Array to a base64 string. The output will always use the\n * alternate encoding/alphabet also known as \"base64url\".\n * @param {!Uint8Array} arr\n * @param {boolean=} opt_padding If true, pad the output with equals signs.\n * Defaults to true.\n * @return {string}\n * @export\n */\nshaka.util.Uint8ArrayUtils.toBase64 = function(arr, opt_padding) {\n // btoa expects a \"raw string\" where each character is interpreted as a byte.\n var bytes = String.fromCharCode.apply(null, arr);\n var padding = (opt_padding == undefined) ? true : opt_padding;\n var base64 = window.btoa(bytes).replace(/\\+/g, '-').replace(/\\//g, '_');\n return padding ? base64 : base64.replace(/=*$/, '');\n};\n\n\n/**\n * Convert a base64 string to a Uint8Array. Accepts either the standard\n * alphabet or the alternate \"base64url\" alphabet.\n * @param {string} str\n * @return {!Uint8Array}\n * @export\n */\nshaka.util.Uint8ArrayUtils.fromBase64 = function(str) {\n // atob creates a \"raw string\" where each character is interpreted as a byte.\n var bytes = window.atob(str.replace(/-/g, '+').replace(/_/g, '/'));\n var result = new Uint8Array(bytes.length);\n for (var i = 0; i < bytes.length; ++i) {\n result[i] = bytes.charCodeAt(i);\n }\n return result;\n};\n\n\n/**\n * Convert a hex string to a Uint8Array.\n * @param {string} str\n * @return {!Uint8Array}\n * @export\n */\nshaka.util.Uint8ArrayUtils.fromHex = function(str) {\n var arr = new Uint8Array(str.length / 2);\n for (var i = 0; i < str.length; i += 2) {\n arr[i / 2] = window.parseInt(str.substr(i, 2), 16);\n }\n return arr;\n};\n\n\n/**\n * Convert a Uint8Array to a hex string.\n * @param {!Uint8Array} arr\n * @return {string}\n * @export\n */\nshaka.util.Uint8ArrayUtils.toHex = function(arr) {\n var hex = '';\n for (var i = 0; i < arr.length; ++i) {\n var value = arr[i].toString(16);\n if (value.length == 1) value = '0' + value;\n hex += value;\n }\n return hex;\n};\n\n\n/**\n * Compare two Uint8Arrays for equality.\n * @param {Uint8Array} arr1\n * @param {Uint8Array} arr2\n * @return {boolean}\n * @export\n */\nshaka.util.Uint8ArrayUtils.equal = function(arr1, arr2) {\n if (!arr1 && !arr2) return true;\n if (!arr1 || !arr2) return false;\n if (arr1.length != arr2.length) return false;\n for (var i = 0; i < arr1.length; ++i) {\n if (arr1[i] != arr2[i]) return false;\n }\n return true;\n};\n\n\n/**\n * Concatenate Uint8Arrays.\n * @param {...Uint8Array} var_args\n * @return {Uint8Array}\n * @export\n */\nshaka.util.Uint8ArrayUtils.concat = function(var_args) {\n var totalLength = 0;\n for (var i = 0; i < arguments.length; ++i) {\n totalLength += arguments[i].length;\n }\n\n var result = new Uint8Array(totalLength);\n var offset = 0;\n for (var i = 0; i < arguments.length; ++i) {\n result.set(arguments[i], offset);\n offset += arguments[i].length;\n }\n return result;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/uint8array_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.DrmEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.ArrayUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.Timer');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n\n/**\n * @constructor\n * @param {!shaka.net.NetworkingEngine} networkingEngine\n * @param {function(!shaka.util.Error)} onError Called when an error occurs.\n * @param {function(!Object.<string, string>)} onKeyStatus Called when key\n * status changes. Argument is a map of hex key IDs to statuses.\n * @param {function(string, number)} onExpirationUpdated\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.DrmEngine = function(\n networkingEngine, onError, onKeyStatus, onExpirationUpdated) {\n /** @private {Array.<string>} */\n this.supportedTypes_ = null;\n\n /** @private {MediaKeys} */\n this.mediaKeys_ = null;\n\n /** @private {HTMLMediaElement} */\n this.video_ = null;\n\n /** @private {boolean} */\n this.initialized_ = false;\n\n /** @private {?shakaExtern.DrmInfo} */\n this.currentDrmInfo_ = null;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {!Array.<shaka.media.DrmEngine.ActiveSession>} */\n this.activeSessions_ = [];\n\n /** @private {!Array.<string>} */\n this.offlineSessionIds_ = [];\n\n /** @private {!shaka.util.PublicPromise} */\n this.allSessionsLoaded_ = new shaka.util.PublicPromise();\n\n /** @private {shaka.net.NetworkingEngine} */\n this.networkingEngine_ = networkingEngine;\n\n /** @private {?shakaExtern.DrmConfiguration} */\n this.config_ = null;\n\n /** @private {?function(!shaka.util.Error)} */\n this.onError_ = (function(err) {\n this.allSessionsLoaded_.reject(err);\n onError(err);\n }.bind(this));\n\n /** @private {!Object.<string, string>} */\n this.keyStatusByKeyId_ = {};\n\n /** @private {?function(!Object.<string, string>)} */\n this.onKeyStatus_ = onKeyStatus;\n\n /** @private {?function(string, number)} */\n this.onExpirationUpdated_ = onExpirationUpdated;\n\n /** @private {shaka.util.Timer} */\n this.keyStatusTimer_ = new shaka.util.Timer(\n this.processKeyStatusChanges_.bind(this));\n\n /** @private {boolean} */\n this.destroyed_ = false;\n\n /** @private {boolean} */\n this.isOffline_ = false;\n\n /** @private {!Array.<!MediaKeyMessageEvent>} */\n this.mediaKeyMessageEvents_ = [];\n\n /** @private {boolean} */\n this.initialRequestsSent_ = false;\n\n /** @private {?number} */\n this.expirationInterval_ = setInterval(this.pollExpiration_.bind(this), 1000);\n\n // Add a catch to the Promise to avoid console logs about uncaught errors.\n this.allSessionsLoaded_.catch(function() {});\n};\n\n\n/**\n * @typedef {{\n * loaded: boolean,\n * initData: Uint8Array,\n * session: !MediaKeySession,\n * oldExpiration: number,\n * updatePromise: shaka.util.PublicPromise\n * }}\n *\n * @description A record to track sessions and suppress duplicate init data.\n * @property {boolean} loaded\n * True once the key status has been updated (to a non-pending state). This\n * does not mean the session is 'usable'.\n * @property {Uint8Array} initData\n * The init data used to create the session.\n * @property {!MediaKeySession} session\n * The session object.\n * @property {number} oldExpiration\n * The expiration of the session on the last check. This is used to fire\n * an event when it changes.\n * @property {shaka.util.PublicPromise} updatePromise\n * An optional Promise that will be resolved/rejected on the next update()\n * call. This is used to track the 'license-release' message when calling\n * remove().\n */\nshaka.media.DrmEngine.ActiveSession;\n\n\n/** @override */\nshaka.media.DrmEngine.prototype.destroy = function() {\n var Functional = shaka.util.Functional;\n this.destroyed_ = true;\n\n var async = this.activeSessions_.map(function(activeSession) {\n // Ignore any errors when closing the sessions. One such error would be\n // an invalid state error triggered by closing a session which has not\n // generated any key requests.\n // Chrome sometimes returns |undefined|: https://crbug.com/690664\n var p = activeSession.session.close() || Promise.resolve();\n return p.catch(Functional.noop);\n });\n this.allSessionsLoaded_.reject();\n\n if (this.eventManager_)\n async.push(this.eventManager_.destroy());\n\n if (this.video_) {\n goog.asserts.assert(!this.video_.src, 'video src must be removed first!');\n async.push(this.video_.setMediaKeys(null).catch(Functional.noop));\n }\n\n if (this.expirationInterval_) {\n clearInterval(this.expirationInterval_);\n this.expirationInterval_ = null;\n }\n\n if (this.keyStatusTimer_) {\n this.keyStatusTimer_.cancel();\n }\n this.keyStatusTimer_ = null;\n\n this.currentDrmInfo_ = null;\n this.supportedTypes_ = null;\n this.mediaKeys_ = null;\n this.video_ = null;\n this.eventManager_ = null;\n this.activeSessions_ = [];\n this.offlineSessionIds_ = [];\n this.networkingEngine_ = null; // We don't own it, don't destroy() it.\n this.config_ = null;\n this.onError_ = null;\n this.onExpirationUpdated_ = null;\n\n return Promise.all(async);\n};\n\n\n/**\n * Called by the Player to provide an updated configuration any time it changes.\n * Must be called at least once before init().\n *\n * @param {shakaExtern.DrmConfiguration} config\n */\nshaka.media.DrmEngine.prototype.configure = function(config) {\n this.config_ = config;\n};\n\n\n/**\n * Negotiate for a key system and set up MediaKeys.\n * @param {!shakaExtern.Manifest} manifest The manifest is read for MIME type\n * and DRM information to query EME. If the 'clearKeys' configuration is\n * used, the manifest will be modified to force the use of Clear Key.\n * @param {boolean} offline True if we are storing or loading offline content.\n * @return {!Promise} Resolved if/when a key system has been chosen.\n */\nshaka.media.DrmEngine.prototype.init = function(manifest, offline) {\n goog.asserts.assert(this.config_,\n 'DrmEngine configure() must be called before init()!');\n\n /** @type {!Object.<string, MediaKeySystemConfiguration>} */\n var configsByKeySystem = {};\n\n /** @type {!Array.<string>} */\n var keySystemsInOrder = [];\n\n // |isOffline_| determines what kind of session to create. The argument to\n // |prepareMediaKeyConfigs_| determines the kind of CDM to query for. So\n // we still need persistent state when we are loading offline sessions.\n this.isOffline_ = offline;\n this.offlineSessionIds_ = manifest.offlineSessionIds;\n this.prepareMediaKeyConfigs_(\n manifest, offline || manifest.offlineSessionIds.length > 0,\n configsByKeySystem, keySystemsInOrder);\n\n if (!keySystemsInOrder.length) {\n // Unencrypted.\n this.initialized_ = true;\n return Promise.resolve();\n }\n\n return this.queryMediaKeys_(configsByKeySystem, keySystemsInOrder);\n};\n\n\n/**\n * Attach MediaKeys to the video element and start processing events.\n * @param {HTMLMediaElement} video\n * @return {!Promise}\n */\nshaka.media.DrmEngine.prototype.attach = function(video) {\n if (!this.mediaKeys_) {\n // Unencrypted, or so we think. We listen for encrypted events in order to\n // warn when the stream is encrypted, even though the manifest does not know\n // it.\n // Don't complain about this twice, so just listenOnce().\n this.eventManager_.listenOnce(video, 'encrypted', function(event) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.ENCRYPTED_CONTENT_WITHOUT_DRM_INFO));\n }.bind(this));\n return Promise.resolve();\n }\n\n this.video_ = video;\n\n this.eventManager_.listenOnce(this.video_, 'play', this.onPlay_.bind(this));\n\n var setMediaKeys = this.video_.setMediaKeys(this.mediaKeys_);\n setMediaKeys = setMediaKeys.catch(function(exception) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_ATTACH_TO_VIDEO,\n exception.message));\n });\n\n var setServerCertificate = null;\n if (this.currentDrmInfo_.serverCertificate) {\n setServerCertificate = this.mediaKeys_.setServerCertificate(\n this.currentDrmInfo_.serverCertificate).then(function(supported) {\n if (!supported) {\n shaka.log.warning('Server certificates are not supported by the key' +\n ' system. The server certificate has been ignored.');\n }\n }).catch(function(exception) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.INVALID_SERVER_CERTIFICATE,\n exception.message));\n });\n }\n\n return Promise.all([setMediaKeys, setServerCertificate]).then(function() {\n if (this.destroyed_) return Promise.reject();\n\n this.createOrLoad();\n if (!this.currentDrmInfo_.initData.length &&\n !this.offlineSessionIds_.length) {\n // Explicit init data for any one stream or an offline session is\n // sufficient to suppress 'encrypted' events for all streams.\n var onEncrypted = /** @type {shaka.util.EventManager.ListenerType} */(\n this.onEncrypted_.bind(this));\n this.eventManager_.listen(this.video_, 'encrypted', onEncrypted);\n }\n }.bind(this)).catch(function(error) {\n if (this.destroyed_) return Promise.resolve(); // Ignore destruction errors\n return Promise.reject(error);\n }.bind(this));\n};\n\n\n/**\n * Removes the given offline sessions and deletes their data. Must call init()\n * before this. This will wait until the 'license-release' message is handled\n * and the resulting Promise will be rejected if there is an error with that.\n *\n * @param {!Array.<string>} sessions\n * @return {!Promise}\n */\nshaka.media.DrmEngine.prototype.removeSessions = function(sessions) {\n goog.asserts.assert(this.mediaKeys_ || !sessions.length,\n 'Must call init() before removeSessions');\n return Promise.all(sessions.map(function(sessionId) {\n return this.loadOfflineSession_(sessionId).then(function(session) {\n // This will be null on error, such as session not found.\n if (session) {\n var p = new shaka.util.PublicPromise();\n // TODO: Consider adding a timeout to get the 'message' event.\n // Note that the 'message' event will get raised after the remove()\n // promise resolves.\n\n for (var i = 0; i < this.activeSessions_.length; i++) {\n if (this.activeSessions_[i].session == session) {\n this.activeSessions_[i].updatePromise = p;\n break;\n }\n }\n return Promise.all([session.remove(), p]);\n }\n }.bind(this));\n }.bind(this)));\n};\n\n\n/**\n * Creates the sessions for the init data and waits for them to become ready.\n *\n * @return {!Promise}\n */\nshaka.media.DrmEngine.prototype.createOrLoad = function() {\n var initDatas = this.currentDrmInfo_ ? this.currentDrmInfo_.initData : [];\n initDatas.forEach(function(initDataOverride) {\n this.createTemporarySession_(\n initDataOverride.initDataType, initDataOverride.initData);\n }.bind(this));\n this.offlineSessionIds_.forEach(function(sessionId) {\n this.loadOfflineSession_(sessionId);\n }.bind(this));\n\n if (!initDatas.length && !this.offlineSessionIds_.length)\n this.allSessionsLoaded_.resolve();\n return this.allSessionsLoaded_;\n};\n\n\n/** @return {boolean} */\nshaka.media.DrmEngine.prototype.initialized = function() {\n return this.initialized_;\n};\n\n\n/** @return {string} */\nshaka.media.DrmEngine.prototype.keySystem = function() {\n return this.currentDrmInfo_ ? this.currentDrmInfo_.keySystem : '';\n};\n\n\n/**\n * Returns an array of the media types supported by the current key system.\n * These will be full mime types (e.g. 'video/webm; codecs=\"vp8\"').\n *\n * @return {Array.<string>}\n */\nshaka.media.DrmEngine.prototype.getSupportedTypes = function() {\n return this.supportedTypes_;\n};\n\n\n/**\n * Returns the ID of the sessions currently active.\n *\n * @return {!Array.<string>}\n */\nshaka.media.DrmEngine.prototype.getSessionIds = function() {\n return this.activeSessions_.map(function(session) {\n return session.session.sessionId;\n });\n};\n\n\n/**\n * Returns the next expiration time, or Infinity.\n * @return {number}\n */\nshaka.media.DrmEngine.prototype.getExpiration = function() {\n var expirations = this.activeSessions_.map(function(session) {\n var expiration = session.session.expiration;\n return isNaN(expiration) ? Infinity : expiration;\n });\n // This will equal Infinity if there are no entries.\n return Math.min.apply(Math, expirations);\n};\n\n\n/**\n * Returns the DrmInfo that was used to initialize the current key system.\n *\n * @return {?shakaExtern.DrmInfo}\n */\nshaka.media.DrmEngine.prototype.getDrmInfo = function() {\n return this.currentDrmInfo_;\n};\n\n\n/**\n * @param {!shakaExtern.Manifest} manifest\n * @param {boolean} offline True if we are storing or loading offline content.\n * @param {!Object.<string, MediaKeySystemConfiguration>} configsByKeySystem\n * (Output parameter.) A dictionary of configs, indexed by key system.\n * @param {!Array.<string>} keySystemsInOrder\n * (Output parameter.) A list of key systems in the order in which we\n * encounter them.\n * @see https://goo.gl/nwdYnY for MediaKeySystemConfiguration spec\n * @private\n */\nshaka.media.DrmEngine.prototype.prepareMediaKeyConfigs_ =\n function(manifest, offline, configsByKeySystem, keySystemsInOrder) {\n var clearKeyDrmInfo = this.configureClearKey_();\n\n manifest.periods.forEach(function(period) {\n period.variants.forEach(function(variant) {\n // clearKey config overrides manifest DrmInfo if present.\n // The manifest is modified so that filtering in Player still works.\n if (clearKeyDrmInfo) {\n variant.drmInfos = [clearKeyDrmInfo];\n }\n\n variant.drmInfos.forEach(function(drmInfo) {\n this.fillInDrmInfoDefaults_(drmInfo);\n\n // Chromecast has a variant of PlayReady that uses a different key\n // system ID. Since manifest parsers convert the standard PlayReady\n // UUID to the standard PlayReady key system ID, here we will switch\n // to the Chromecast version if we are running on that platform.\n // Note that this must come after fillInDrmInfoDefaults_, since the\n // player config uses the standard PlayReady ID for license server\n // configuration.\n if (window.cast && window.cast.__platform__) {\n if (drmInfo.keySystem == 'com.microsoft.playready') {\n drmInfo.keySystem = 'com.chromecast.playready';\n }\n }\n\n var config = configsByKeySystem[drmInfo.keySystem];\n if (!config) {\n config = {\n // ignore initDataTypes\n audioCapabilities: [],\n videoCapabilities: [],\n distinctiveIdentifier: 'optional',\n persistentState: offline ? 'required' : 'optional',\n sessionTypes: [offline ? 'persistent-license' : 'temporary'],\n label: drmInfo.keySystem,\n drmInfos: [] // tracked by us, ignored by EME\n };\n configsByKeySystem[drmInfo.keySystem] = config;\n keySystemsInOrder.push(drmInfo.keySystem);\n }\n\n config.drmInfos.push(drmInfo);\n\n if (drmInfo.distinctiveIdentifierRequired)\n config.distinctiveIdentifier = 'required';\n\n if (drmInfo.persistentStateRequired)\n config.persistentState = 'required';\n\n var streams = [];\n if (variant.video) streams.push(variant.video);\n if (variant.audio) streams.push(variant.audio);\n\n streams.forEach(function(stream) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n /** @type {!Array.<!MediaKeySystemMediaCapability>} */\n var capabilities = (stream.type == ContentType.VIDEO) ?\n config.videoCapabilities : config.audioCapabilities;\n /** @type {string} */\n var robustness = ((stream.type == ContentType.VIDEO) ?\n drmInfo.videoRobustness : drmInfo.audioRobustness) || '';\n\n var fullMimeType = stream.mimeType;\n if (stream.codecs) {\n fullMimeType += '; codecs=\"' + stream.codecs + '\"';\n }\n\n capabilities.push({\n robustness: robustness,\n contentType: fullMimeType\n });\n }.bind(this)); // streams.forEach (variant.video, variant.audio)\n }.bind(this)); // variant.drmInfos.forEach\n }.bind(this)); // periods.variants.forEach\n }.bind(this)); // manifest.perios.forEach\n};\n\n\n/**\n * @param {!Object.<string, MediaKeySystemConfiguration>} configsByKeySystem\n * A dictionary of configs, indexed by key system.\n * @param {!Array.<string>} keySystemsInOrder\n * A list of key systems in the order in which we should query them.\n * On a browser which supports multiple key systems, the order may indicate\n * a real preference for the application.\n * @return {!Promise} Resolved if/when a key system has been chosen.\n * @private\n */\nshaka.media.DrmEngine.prototype.queryMediaKeys_ =\n function(configsByKeySystem, keySystemsInOrder) {\n if (keySystemsInOrder.length == 1 && keySystemsInOrder[0] == '') {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.NO_RECOGNIZED_KEY_SYSTEMS));\n }\n\n // Wait to reject this initial Promise until we have built the entire chain.\n var instigator = new shaka.util.PublicPromise();\n var p = instigator;\n\n // Try key systems with configured license servers first. We only have to try\n // key systems without configured license servers for diagnostic reasons, so\n // that we can differentiate between \"none of these key systems are available\"\n // and \"some are available, but you did not configure them properly.\" The\n // former takes precedence.\n [true, false].forEach(function(shouldHaveLicenseServer) {\n keySystemsInOrder.forEach(function(keySystem) {\n var config = configsByKeySystem[keySystem];\n\n var hasLicenseServer = config.drmInfos.some(function(info) {\n return !!info.licenseServerUri;\n });\n if (hasLicenseServer != shouldHaveLicenseServer) return;\n\n // If there are no tracks of a type, these should be not present.\n // Otherwise the query will fail.\n if (config.audioCapabilities.length == 0) {\n delete config.audioCapabilities;\n }\n if (config.videoCapabilities.length == 0) {\n delete config.videoCapabilities;\n }\n\n p = p.catch(function() {\n if (this.destroyed_) return Promise.reject();\n return navigator.requestMediaKeySystemAccess(keySystem, [config]);\n }.bind(this));\n }.bind(this));\n }.bind(this));\n\n p = p.catch(function() {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE));\n });\n\n p = p.then(function(mediaKeySystemAccess) {\n if (this.destroyed_) return Promise.reject();\n\n // TODO: Remove once Edge has released a fix for https://goo.gl/qMeV7v\n var isEdge = navigator.userAgent.indexOf('Edge/') >= 0;\n\n // Store the capabilities of the key system.\n var realConfig = mediaKeySystemAccess.getConfiguration();\n var audioCaps = realConfig.audioCapabilities || [];\n var videoCaps = realConfig.videoCapabilities || [];\n var caps = audioCaps.concat(videoCaps);\n this.supportedTypes_ = caps.map(function(c) { return c.contentType; });\n if (isEdge) {\n // Edge 14 does not report correct capabilities. It will only report the\n // first MIME type even if the others are supported. To work around this,\n // set the supported types to null, which Player will use as a signal that\n // the information is not available.\n // See: https://goo.gl/qMeV7v\n this.supportedTypes_ = null;\n }\n goog.asserts.assert(!this.supportedTypes_ || this.supportedTypes_.length,\n 'We should get at least one supported MIME type');\n\n var originalConfig = configsByKeySystem[mediaKeySystemAccess.keySystem];\n this.createCurrentDrmInfo_(\n mediaKeySystemAccess.keySystem, originalConfig,\n originalConfig.drmInfos);\n\n if (!this.currentDrmInfo_.licenseServerUri) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.NO_LICENSE_SERVER_GIVEN));\n }\n\n return mediaKeySystemAccess.createMediaKeys();\n }.bind(this)).then(function(mediaKeys) {\n if (this.destroyed_) return Promise.reject();\n\n this.mediaKeys_ = mediaKeys;\n this.initialized_ = true;\n }.bind(this)).catch(function(exception) {\n if (this.destroyed_) return Promise.resolve(); // Ignore destruction errors\n\n // Don't rewrap a shaka.util.Error from earlier in the chain:\n this.currentDrmInfo_ = null;\n this.supportedTypes_ = null;\n if (exception instanceof shaka.util.Error) {\n return Promise.reject(exception);\n }\n\n // We failed to create MediaKeys. This generally shouldn't happen.\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_CDM,\n exception.message));\n }.bind(this));\n\n instigator.reject();\n return p;\n};\n\n\n/**\n * Use this.config_ to fill in missing values in drmInfo.\n * @param {shakaExtern.DrmInfo} drmInfo\n * @private\n */\nshaka.media.DrmEngine.prototype.fillInDrmInfoDefaults_ = function(drmInfo) {\n var keySystem = drmInfo.keySystem;\n\n if (!keySystem) {\n // This is a placeholder from the manifest parser for an unrecognized key\n // system. Skip this entry, to avoid logging nonsensical errors.\n return;\n }\n\n if (!drmInfo.licenseServerUri) {\n var server = this.config_.servers[keySystem];\n if (server) {\n drmInfo.licenseServerUri = server;\n } else {\n shaka.log.error('No license server configured for ' + keySystem);\n }\n }\n\n if (!drmInfo.keyIds) {\n drmInfo.keyIds = [];\n }\n\n var advanced = this.config_.advanced[keySystem];\n if (advanced) {\n if (!drmInfo.distinctiveIdentifierRequired) {\n drmInfo.distinctiveIdentifierRequired =\n advanced.distinctiveIdentifierRequired;\n }\n\n if (!drmInfo.persistentStateRequired) {\n drmInfo.persistentStateRequired = advanced.persistentStateRequired;\n }\n\n if (!drmInfo.videoRobustness) {\n drmInfo.videoRobustness = advanced.videoRobustness;\n }\n\n if (!drmInfo.audioRobustness) {\n drmInfo.audioRobustness = advanced.audioRobustness;\n }\n\n if (!drmInfo.serverCertificate) {\n drmInfo.serverCertificate = advanced.serverCertificate;\n }\n }\n};\n\n\n/**\n * Create a DrmInfo using configured clear keys.\n * The server URI will be a data URI which decodes to a clearkey license.\n * @return {?shakaExtern.DrmInfo} or null if clear keys are not configured.\n * @private\n * @see https://goo.gl/6nPdhF for the spec on the clearkey license format.\n */\nshaka.media.DrmEngine.prototype.configureClearKey_ = function() {\n var hasClearKeys = !shaka.util.MapUtils.empty(this.config_.clearKeys);\n if (!hasClearKeys) return null;\n\n var StringUtils = shaka.util.StringUtils;\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n var keys = [];\n var keyIds = [];\n\n for (var keyIdHex in this.config_.clearKeys) {\n var keyHex = this.config_.clearKeys[keyIdHex];\n\n var keyId = Uint8ArrayUtils.fromHex(keyIdHex);\n var key = Uint8ArrayUtils.fromHex(keyHex);\n var keyObj = {\n kty: 'oct',\n kid: Uint8ArrayUtils.toBase64(keyId, false),\n k: Uint8ArrayUtils.toBase64(key, false)\n };\n\n keys.push(keyObj);\n keyIds.push(keyObj.kid);\n }\n\n var jwkSet = {keys: keys};\n var license = JSON.stringify(jwkSet);\n\n // Use the keyids init data since is suggested by EME.\n // Suggestion: https://goo.gl/R72xp4\n // Format: https://goo.gl/75RCP6\n var initDataStr = JSON.stringify({'kids': keyIds});\n var initData = new Uint8Array(StringUtils.toUTF8(initDataStr));\n var initDatas = [{initData: initData, initDataType: 'keyids'}];\n\n return {\n keySystem: 'org.w3.clearkey',\n licenseServerUri: 'data:application/json;base64,' + window.btoa(license),\n distinctiveIdentifierRequired: false,\n persistentStateRequired: false,\n audioRobustness: '',\n videoRobustness: '',\n serverCertificate: null,\n initData: initDatas,\n keyIds: []\n };\n};\n\n\n/**\n * Creates a DrmInfo object describing the settings used to initialize the\n * engine.\n *\n * @param {string} keySystem\n * @param {MediaKeySystemConfiguration} config\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @private\n */\nshaka.media.DrmEngine.prototype.createCurrentDrmInfo_ = function(\n keySystem, config, drmInfos) {\n /** @type {!Array.<string>} */\n var licenseServers = [];\n\n /** @type {!Array.<!Uint8Array>} */\n var serverCerts = [];\n\n /** @type {!Array.<!shakaExtern.InitDataOverride>} */\n var initDatas = [];\n\n /** @type {!Array.<string>} */\n var keyIds = [];\n\n this.processDrmInfos_(drmInfos, licenseServers, serverCerts, initDatas,\n keyIds);\n\n if (serverCerts.length > 1) {\n shaka.log.warning('Multiple unique server certificates found! ' +\n 'Only the first will be used.');\n }\n\n if (licenseServers.length > 1) {\n shaka.log.warning('Multiple unique license server URIs found! ' +\n 'Only the first will be used.');\n }\n\n // TODO: This only works when all DrmInfo have the same robustness.\n var audioRobustness =\n config.audioCapabilities ? config.audioCapabilities[0].robustness : '';\n var videoRobustness =\n config.videoCapabilities ? config.videoCapabilities[0].robustness : '';\n this.currentDrmInfo_ = {\n keySystem: keySystem,\n licenseServerUri: licenseServers[0],\n distinctiveIdentifierRequired: (config.distinctiveIdentifier == 'required'),\n persistentStateRequired: (config.persistentState == 'required'),\n audioRobustness: audioRobustness,\n videoRobustness: videoRobustness,\n serverCertificate: serverCerts[0],\n initData: initDatas,\n keyIds: keyIds\n };\n};\n\n\n/**\n * Extract license server, server cert, and init data from DrmInfos, taking\n * care to eliminate duplicates.\n *\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @param {!Array.<string>} licenseServers\n * @param {!Array.<!Uint8Array>} serverCerts\n * @param {!Array.<!shakaExtern.InitDataOverride>} initDatas\n * @param {!Array.<string>} keyIds\n * @private\n */\nshaka.media.DrmEngine.prototype.processDrmInfos_ =\n function(drmInfos, licenseServers, serverCerts, initDatas, keyIds) {\n /**\n * @param {shakaExtern.InitDataOverride} a\n * @param {shakaExtern.InitDataOverride} b\n * @return {boolean}\n */\n function initDataOverrideEqual(a, b) {\n if (a.keyId && a.keyId == b.keyId) {\n // Two initDatas with the same keyId are considered to be the same,\n // unless that \"same keyId\" is null.\n return true;\n }\n return a.initDataType == b.initDataType &&\n shaka.util.Uint8ArrayUtils.equal(a.initData, b.initData);\n }\n\n drmInfos.forEach(function(drmInfo) {\n // Aliases:\n var ArrayUtils = shaka.util.ArrayUtils;\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n\n // Build an array of unique license servers.\n if (licenseServers.indexOf(drmInfo.licenseServerUri) == -1) {\n licenseServers.push(drmInfo.licenseServerUri);\n }\n\n // Build an array of unique server certs.\n if (drmInfo.serverCertificate) {\n if (ArrayUtils.indexOf(serverCerts, drmInfo.serverCertificate,\n Uint8ArrayUtils.equal) == -1) {\n serverCerts.push(drmInfo.serverCertificate);\n }\n }\n\n // Build an array of unique init datas.\n if (drmInfo.initData) {\n drmInfo.initData.forEach(function(initDataOverride) {\n if (ArrayUtils.indexOf(initDatas, initDataOverride,\n initDataOverrideEqual) == -1) {\n initDatas.push(initDataOverride);\n }\n });\n }\n\n if (drmInfo.keyIds) {\n for (var i = 0; i < drmInfo.keyIds.length; ++i) {\n if (keyIds.indexOf(drmInfo.keyIds[i]) == -1) {\n keyIds.push(drmInfo.keyIds[i]);\n }\n }\n }\n });\n};\n\n\n/**\n * @param {!MediaEncryptedEvent} event\n * @private\n */\nshaka.media.DrmEngine.prototype.onEncrypted_ = function(event) {\n // Aliases:\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n\n var initData = new Uint8Array(event.initData);\n\n // Suppress duplicate init data.\n // Note that some init data are extremely large and can't portably be used as\n // keys in a dictionary.\n for (var i = 0; i < this.activeSessions_.length; ++i) {\n if (Uint8ArrayUtils.equal(initData, this.activeSessions_[i].initData)) {\n shaka.log.debug('Ignoring duplicate init data.');\n return;\n }\n }\n\n this.createTemporarySession_(event.initDataType, initData);\n};\n\n\n/**\n * @param {string} sessionId\n * @return {!Promise.<MediaKeySession>}\n * @private\n */\nshaka.media.DrmEngine.prototype.loadOfflineSession_ = function(sessionId) {\n var session;\n try {\n session = this.mediaKeys_.createSession('persistent-license');\n } catch (exception) {\n var error = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_SESSION,\n exception.message);\n this.onError_(error);\n return Promise.reject(error);\n }\n\n this.eventManager_.listen(session, 'message',\n /** @type {shaka.util.EventManager.ListenerType} */(\n this.onSessionMessage_.bind(this)));\n this.eventManager_.listen(session, 'keystatuseschange',\n this.onKeyStatusesChange_.bind(this));\n\n var activeSession = {\n initData: null,\n session: session,\n loaded: false,\n oldExpiration: Infinity,\n updatePromise: null\n };\n this.activeSessions_.push(activeSession);\n\n return session.load(sessionId).then(function(present) {\n if (this.destroyed_) return;\n\n if (!present) {\n var i = this.activeSessions_.indexOf(activeSession);\n goog.asserts.assert(i >= 0, 'Session must be in the array');\n this.activeSessions_.splice(i, 1);\n\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.OFFLINE_SESSION_REMOVED));\n return;\n }\n\n // TODO: We should get a key status change event. Remove once Chrome CDM\n // is fixed.\n activeSession.loaded = true;\n if (this.activeSessions_.every(function(s) { return s.loaded; }))\n this.allSessionsLoaded_.resolve();\n\n return session;\n }.bind(this), function(error) {\n if (this.destroyed_) return;\n\n var i = this.activeSessions_.indexOf(activeSession);\n goog.asserts.assert(i >= 0, 'Session must be in the array');\n this.activeSessions_.splice(i, 1);\n\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_SESSION,\n error.message));\n }.bind(this));\n};\n\n\n/**\n * @param {string} initDataType\n * @param {!Uint8Array} initData\n * @private\n */\nshaka.media.DrmEngine.prototype.createTemporarySession_ =\n function(initDataType, initData) {\n var session;\n try {\n if (this.isOffline_) {\n session = this.mediaKeys_.createSession('persistent-license');\n } else {\n session = this.mediaKeys_.createSession();\n }\n } catch (exception) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_SESSION,\n exception.message));\n return;\n }\n\n this.eventManager_.listen(session, 'message',\n /** @type {shaka.util.EventManager.ListenerType} */(\n this.onSessionMessage_.bind(this)));\n this.eventManager_.listen(session, 'keystatuseschange',\n this.onKeyStatusesChange_.bind(this));\n this.activeSessions_.push({\n initData: initData,\n session: session,\n loaded: false,\n oldExpiration: Infinity,\n updatePromise: null\n });\n\n session.generateRequest(initDataType, initData.buffer).catch(function(error) {\n if (this.destroyed_) return;\n\n for (var i = 0; i < this.activeSessions_.length; ++i) {\n if (this.activeSessions_[i].session == session) {\n this.activeSessions_.splice(i, 1);\n break;\n }\n }\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_GENERATE_LICENSE_REQUEST,\n error.message));\n }.bind(this));\n};\n\n\n/**\n * @param {!MediaKeyMessageEvent} event\n * @private\n */\nshaka.media.DrmEngine.prototype.onSessionMessage_ = function(event) {\n if (this.delayLicenseRequest_())\n this.mediaKeyMessageEvents_.push(event);\n else\n this.sendLicenseRequest_(event);\n};\n\n\n/**\n * @return {boolean}\n * @private\n */\nshaka.media.DrmEngine.prototype.delayLicenseRequest_ = function() {\n return (this.config_.delayLicenseRequestUntilPlayed &&\n this.video_.paused && !this.initialRequestsSent_);\n};\n\n\n/**\n * Sends a license request.\n * @param {!MediaKeyMessageEvent} event\n * @private\n */\nshaka.media.DrmEngine.prototype.sendLicenseRequest_ = function(event) {\n /** @type {!MediaKeySession} */\n var session = event.target;\n\n var updatePromise;\n for (var i = 0; i < this.activeSessions_.length; i++) {\n if (this.activeSessions_[i].session == session) {\n updatePromise = this.activeSessions_[i].updatePromise;\n break;\n }\n }\n\n var requestType = shaka.net.NetworkingEngine.RequestType.LICENSE;\n var request = shaka.net.NetworkingEngine.makeRequest(\n [this.currentDrmInfo_.licenseServerUri], this.config_.retryParameters);\n request.body = event.message;\n request.method = 'POST';\n // NOTE: allowCrossSiteCredentials can be set in a request filter.\n\n if (this.currentDrmInfo_.keySystem == 'com.microsoft.playready' ||\n this.currentDrmInfo_.keySystem == 'com.chromecast.playready') {\n this.unpackPlayReadyRequest_(request);\n }\n\n this.networkingEngine_.request(requestType, request)\n .then(function(response) {\n if (this.destroyed_) return Promise.reject();\n\n // Request succeeded, now pass the response to the CDM.\n return session.update(response.data).then(function() {\n if (updatePromise)\n updatePromise.resolve();\n });\n }.bind(this), function(error) {\n // Ignore destruction errors\n if (this.destroyed_) return Promise.resolve();\n\n // Request failed!\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong NetworkingEngine error type!');\n var shakaErr = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.LICENSE_REQUEST_FAILED,\n error);\n this.onError_(shakaErr);\n if (updatePromise)\n updatePromise.reject(shakaErr);\n }.bind(this)).catch(function(error) {\n // Ignore destruction errors\n if (this.destroyed_) return Promise.resolve();\n\n // Session update failed!\n var shakaErr = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.LICENSE_RESPONSE_REJECTED,\n error.message);\n this.onError_(shakaErr);\n if (updatePromise)\n updatePromise.reject(shakaErr);\n }.bind(this));\n};\n\n\n/**\n * Unpack PlayReady license requests. Modifies the request object.\n * @param {shakaExtern.Request} request\n * @private\n */\nshaka.media.DrmEngine.prototype.unpackPlayReadyRequest_ = function(request) {\n // On IE and Edge, the raw license message is UTF-16-encoded XML. We need to\n // unpack the Challenge element (base64-encoded string containing the actual\n // license request) and any HttpHeader elements (sent as request headers).\n\n // Example XML:\n\n // <PlayReadyKeyMessage type=\"LicenseAcquisition\">\n // <LicenseAcquisition Version=\"1\">\n // <Challenge encoding=\"base64encoded\">{Base64Data}</Challenge>\n // <HttpHeaders>\n // <HttpHeader>\n // <name>Content-Type</name>\n // <value>text/xml; charset=utf-8</value>\n // </HttpHeader>\n // <HttpHeader>\n // <name>SOAPAction</name>\n // <value>http://schemas.microsoft.com/DRM/etc/etc</value>\n // </HttpHeader>\n // </HttpHeaders>\n // </LicenseAcquisition>\n // </PlayReadyKeyMessage>\n\n var xml = shaka.util.StringUtils.fromUTF16(\n request.body, true /* littleEndian */, true /* noThrow */);\n if (xml.indexOf('PlayReadyKeyMessage') == -1) {\n // This does not appear to be a wrapped message as on IE and Edge. Some\n // clients do not need this unwrapping, so we will assume this is one of\n // them. Note that \"xml\" at this point probably looks like random garbage,\n // since we interpreted UTF-8 as UTF-16.\n shaka.log.debug('PlayReady request is already unwrapped.');\n request.headers['Content-Type'] = 'text/xml; charset=utf-8';\n return;\n }\n shaka.log.debug('Unwrapping PlayReady request.');\n var dom = new DOMParser().parseFromString(xml, 'application/xml');\n\n // Set request headers.\n var headers = dom.getElementsByTagName('HttpHeader');\n for (var i = 0; i < headers.length; ++i) {\n var name = headers[i].querySelector('name');\n var value = headers[i].querySelector('value');\n goog.asserts.assert(name && value, 'Malformed PlayReady headers!');\n request.headers[name.textContent] = value.textContent;\n }\n\n // Unpack the base64-encoded challenge.\n var challenge = dom.querySelector('Challenge');\n goog.asserts.assert(challenge, 'Malformed PlayReady challenge!');\n goog.asserts.assert(challenge.getAttribute('encoding') == 'base64encoded',\n 'Unexpected PlayReady challenge encoding!');\n request.body =\n shaka.util.Uint8ArrayUtils.fromBase64(challenge.textContent).buffer;\n};\n\n\n/**\n * @param {!Event} event\n * @private\n * @suppress {invalidCasts} to swap keyId and status\n */\nshaka.media.DrmEngine.prototype.onKeyStatusesChange_ = function(event) {\n var session = /** @type {!MediaKeySession} */(event.target);\n\n // Locate the session in the active sessions list.\n var i;\n for (i = 0; i < this.activeSessions_.length; ++i) {\n if (this.activeSessions_[i].session == session) {\n break;\n }\n }\n goog.asserts.assert(i < this.activeSessions_.length,\n 'Key status change for inactive session!');\n if (i == this.activeSessions_.length) return;\n\n var keyStatusMap = session.keyStatuses;\n var hasExpiredKeys = false;\n\n keyStatusMap.forEach(function(status, keyId) {\n // The spec has changed a few times on the exact order of arguments here.\n // As of 2016-06-30, Edge has the order reversed compared to the current\n // EME spec. Given the back and forth in the spec, it may not be the only\n // one. Try to detect this and compensate:\n if (typeof keyId == 'string') {\n var tmp = keyId;\n keyId = /** @type {ArrayBuffer} */(status);\n status = /** @type {string} */(tmp);\n }\n\n // Microsoft's implementation in Edge seems to present key IDs as\n // little-endian UUIDs, rather than big-endian or just plain array of bytes.\n // standard: 6e 5a 1d 26 - 27 57 - 47 d7 - 80 46 ea a5 d1 d3 4b 5a\n // on Edge: 26 1d 5a 6e - 57 27 - d7 47 - 80 46 ea a5 d1 d3 4b 5a\n // Bug filed: https://goo.gl/gnRSkJ\n\n // NOTE that we skip this if byteLength != 16. This is used for the IE11\n // and Edge 12 EME polyfill, which uses single-byte dummy key IDs.\n if (this.currentDrmInfo_.keySystem == 'com.microsoft.playready' &&\n keyId.byteLength == 16) {\n // Read out some fields in little-endian:\n var dataView = new DataView(keyId);\n var part0 = dataView.getUint32(0, true /* LE */);\n var part1 = dataView.getUint16(4, true /* LE */);\n var part2 = dataView.getUint16(6, true /* LE */);\n // Write it back in big-endian:\n dataView.setUint32(0, part0, false /* BE */);\n dataView.setUint16(4, part1, false /* BE */);\n dataView.setUint16(6, part2, false /* BE */);\n }\n\n // Microsoft's implementation in IE11 and Edge seems to never set key\n // status to 'usable'. It is stuck forever at 'status-pending'. In spite\n // of this, the keys do seem to be usable and content plays correctly.\n // Bug filed: https://goo.gl/fcXEy1\n if (this.currentDrmInfo_.keySystem == 'com.microsoft.playready' &&\n status == 'status-pending') {\n status = 'usable';\n }\n\n if (status != 'status-pending') {\n this.activeSessions_[i].loaded = true;\n if (this.activeSessions_.every(function(s) { return s.loaded; }))\n this.allSessionsLoaded_.resolve();\n }\n\n if (status == 'expired') {\n hasExpiredKeys = true;\n }\n\n var keyIdHex = shaka.util.Uint8ArrayUtils.toHex(new Uint8Array(keyId));\n\n this.keyStatusByKeyId_[keyIdHex] = status;\n }.bind(this));\n\n // If the session has expired, close it.\n // Some CDMs do not have sub-second time resolution, so the key status may\n // fire with hundreds of milliseconds left until the stated expiration time.\n var msUntilExpiration = session.expiration - Date.now();\n if (msUntilExpiration < 0 || (hasExpiredKeys && msUntilExpiration < 1000)) {\n // If this is part of a remove(), we don't want to close the session until\n // the update is complete. Otherwise, we will orphan the session.\n if (!this.activeSessions_[i].updatePromise) {\n shaka.log.debug('Session has expired', session);\n this.activeSessions_.splice(i, 1);\n session.close();\n }\n }\n\n // Batch up key status changes before checking them or notifying Player.\n // This handles cases where the statuses of multiple sessions are set\n // simultaneously by the browser before dispatching key status changes for\n // each of them. By batching these up, we only send one status change event\n // and at most one EXPIRED error on expiration.\n this.keyStatusTimer_.schedule(0.5);\n};\n\n\n/**\n * @private\n */\nshaka.media.DrmEngine.prototype.processKeyStatusChanges_ = function() {\n // If all keys are expired, fire an error.\n function isExpired(keyId, status) {\n return status == 'expired';\n }\n var MapUtils = shaka.util.MapUtils;\n // Note that every() is always true for an empty map,\n // but we shouldn't fire an error for a lack of key status info.\n var allExpired = !MapUtils.empty(this.keyStatusByKeyId_) &&\n MapUtils.every(this.keyStatusByKeyId_, isExpired);\n\n if (allExpired) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.EXPIRED));\n }\n\n this.onKeyStatus_(this.keyStatusByKeyId_);\n};\n\n\n/**\n * Returns true if the browser has recent EME APIs.\n *\n * @return {boolean}\n */\nshaka.media.DrmEngine.isBrowserSupported = function() {\n var basic =\n !!window.MediaKeys &&\n !!window.navigator &&\n !!window.navigator.requestMediaKeySystemAccess &&\n !!window.MediaKeySystemAccess &&\n !!window.MediaKeySystemAccess.prototype.getConfiguration;\n\n return basic;\n};\n\n\n/**\n * Returns a Promise to a map of EME support for well-known key systems.\n *\n * @return {!Promise.<!Object.<string, ?shakaExtern.DrmSupportType>>}\n */\nshaka.media.DrmEngine.probeSupport = function() {\n goog.asserts.assert(shaka.media.DrmEngine.isBrowserSupported(),\n 'Must have basic EME support');\n\n var tests = [];\n var testKeySystems = [\n 'org.w3.clearkey',\n 'com.widevine.alpha',\n 'com.microsoft.playready',\n 'com.apple.fps.2_0',\n 'com.apple.fps.1_0',\n 'com.apple.fps',\n 'com.adobe.primetime'\n ];\n\n var basicVideoCapabilities = [\n { contentType: 'video/mp4; codecs=\"avc1.42E01E\"' },\n { contentType: 'video/webm; codecs=\"vp8\"' }\n ];\n\n var basicConfig = {\n videoCapabilities: basicVideoCapabilities\n };\n var offlineConfig = {\n videoCapabilities: basicVideoCapabilities,\n persistentState: 'required',\n sessionTypes: ['persistent-license']\n };\n\n // Try the offline config first, then fall back to the basic config.\n var configs = [offlineConfig, basicConfig];\n\n var support = {};\n testKeySystems.forEach(function(keySystem) {\n var p = navigator.requestMediaKeySystemAccess(keySystem, configs)\n .then(function(access) {\n // Edge doesn't return supported session types, but current versions\n // do not support persistent-license. If sessionTypes is missing,\n // assume no support for persistent-license.\n // TODO: polyfill Edge to return known supported session types.\n // Edge bug: https://goo.gl/z0URJ0\n // Firefox does return supported session types, but will still let you\n // create a session even if the type is unsupported.\n // Firefox bug: https://goo.gl/lB4H3i\n var sessionTypes = access.getConfiguration().sessionTypes;\n var persistentState = sessionTypes ?\n sessionTypes.indexOf('persistent-license') >= 0 : false;\n support[keySystem] = {persistentState: persistentState};\n return access.createMediaKeys();\n }).catch(function() {\n // Either the request failed or createMediaKeys failed.\n // Either way, write null to the support object.\n support[keySystem] = null;\n });\n tests.push(p);\n });\n\n return Promise.all(tests).then(function() {\n return support;\n });\n};\n\n\n/**\n * @private\n */\nshaka.media.DrmEngine.prototype.onPlay_ = function() {\n for (var i = 0; i < this.mediaKeyMessageEvents_.length; i++) {\n this.sendLicenseRequest_(this.mediaKeyMessageEvents_[i]);\n }\n\n this.initialRequestsSent_ = true;\n this.mediaKeyMessageEvents_ = [];\n};\n\n\n/**\n * Checks if a variant is compatible with the key system.\n * @param {!shakaExtern.Variant} variant\n * @return {boolean}\n**/\nshaka.media.DrmEngine.prototype.isSupportedByKeySystem = function(variant) {\n var keySystem = this.keySystem();\n return variant.drmInfos.length == 0 ||\n variant.drmInfos.some(function(drmInfo) {\n return drmInfo.keySystem == keySystem;\n });\n};\n\n\n/**\n * Checks if two DrmInfos can be decrypted using the\n * same key system. Clear content is considered compatible\n * with every key system.\n *\n * @param {!Array.<!shakaExtern.DrmInfo>} drms1\n * @param {!Array.<!shakaExtern.DrmInfo>} drms2\n * @return {boolean}\n */\nshaka.media.DrmEngine.areDrmCompatible = function(drms1, drms2) {\n if (!drms1.length || !drms2.length) return true;\n\n return shaka.media.DrmEngine.getCommonDrmInfos(\n drms1, drms2).length > 0;\n};\n\n\n/**\n * Returns an array of drm infos that are present in both input arrays.\n * If one of the arrays is empty, returns the other one since clear\n * content is considered compatible with every drm info.\n *\n * @param {!Array.<!shakaExtern.DrmInfo>} drms1\n * @param {!Array.<!shakaExtern.DrmInfo>} drms2\n * @return {!Array.<!shakaExtern.DrmInfo>}\n */\nshaka.media.DrmEngine.getCommonDrmInfos = function(drms1, drms2) {\n if (!drms1.length) return drms2;\n if (!drms2.length) return drms1;\n\n var commonDrms = [];\n\n for (var i = 0; i < drms1.length; i++) {\n for (var j = 0; j < drms2.length; j++) {\n // This method is only called to compare drmInfos of a video\n // and an audio adaptations, so we shouldn't have to worry about\n // checking robustness.\n if (drms1[i].keySystem == drms2[j].keySystem) {\n var drm1 = drms1[i];\n var drm2 = drms2[j];\n var initData = [];\n initData = initData.concat(drm1.initData || []);\n initData = initData.concat(drm2.initData || []);\n var keyIds = [];\n keyIds = keyIds.concat(drm1.keyIds);\n keyIds = keyIds.concat(drm2.keyIds);\n var mergedDrm = {\n keySystem: drm1.keySystem,\n licenseServerUri: drm1.licenseServerUri || drm2.licenseServerUri,\n distinctiveIdentifierRequired: drm1.distinctiveIdentifierRequired ||\n drm2.distinctiveIdentifierRequired,\n persistentStateRequired: drm1.persistentStateRequired ||\n drm2.persistentStateRequired,\n videoRobustness: drm1.videoRobustness || drm2.videoRobustness,\n audioRobustness: drm1.audioRobustness || drm2.audioRobustness,\n serverCertificate: drm1.serverCertificate || drm2.serverCertificate,\n initData: initData,\n keyIds: keyIds\n };\n commonDrms.push(mergedDrm);\n break;\n }\n }\n }\n\n return commonDrms;\n};\n\n\n/**\n * Called in an interval timer to poll the expiration times of the sessions. We\n * don't get an event from EME when the expiration updates, so we poll it so we\n * can fire an event when it happens.\n * @private\n */\nshaka.media.DrmEngine.prototype.pollExpiration_ = function() {\n this.activeSessions_.forEach(function(session) {\n var old = session.oldExpiration;\n var new_ = session.session.expiration;\n if (isNaN(new_))\n new_ = Infinity;\n\n if (new_ != old) {\n this.onExpirationUpdated_(session.session.sessionId, new_);\n session.oldExpiration = new_;\n }\n }.bind(this));\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/drm_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.TextEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.IDestroyable');\n\n\n\n/**\n * Manages text parsers and cues.\n *\n * @struct\n * @constructor\n * @param {TextTrack} track\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.TextEngine = function(track) {\n /** @private {shakaExtern.TextParser} */\n this.parser_ = null;\n\n /** @private {TextTrack} */\n this.track_ = track;\n\n /** @private {number} */\n this.timestampOffset_ = 0;\n\n /** @private {number} */\n this.appendWindowEnd_ = Infinity;\n\n /** @private {?number} */\n this.bufferStart_ = null;\n\n /** @private {?number} */\n this.bufferEnd_ = null;\n};\n\n\n/** @private {!Object.<string, !shakaExtern.TextParserPlugin>} */\nshaka.media.TextEngine.parserMap_ = {};\n\n\n/**\n * @param {string} mimeType\n * @param {!shakaExtern.TextParserPlugin} plugin\n * @export\n */\nshaka.media.TextEngine.registerParser = function(mimeType, plugin) {\n // Assume that if the function is expecting no parameters, it must be\n // a stateful text parser factory. Otherwise, assume that it is a\n // stateless text parser.\n if (plugin.length == 0) {\n shaka.media.TextEngine.parserMap_[mimeType] = plugin;\n } else {\n shaka.log.warning('The use of stateless text parsers is deprecated.');\n shaka.media.TextEngine.parserMap_[mimeType] =\n shaka.media.TextEngine.TextParserWrapper_.bind(null, plugin);\n }\n};\n\n\n/**\n * @param {string} mimeType\n * @export\n */\nshaka.media.TextEngine.unregisterParser = function(mimeType) {\n delete shaka.media.TextEngine.parserMap_[mimeType];\n};\n\n\n/**\n * @param {string} mimeType\n * @return {boolean}\n */\nshaka.media.TextEngine.isTypeSupported = function(mimeType) {\n return !!shaka.media.TextEngine.parserMap_[mimeType];\n};\n\n\n/**\n * Creates a cue using the best platform-specific interface available.\n *\n * @param {number} startTime\n * @param {number} endTime\n * @param {string} payload\n * @return {TextTrackCue} or null if the parameters were invalid.\n * @export\n */\nshaka.media.TextEngine.makeCue = function(startTime, endTime, payload) {\n if (startTime >= endTime) {\n // IE/Edge will throw in this case.\n // See issue #501\n shaka.log.warning('Invalid cue times: ' + startTime + ' - ' + endTime);\n return null;\n }\n\n return new VTTCue(startTime, endTime, payload);\n};\n\n\n/** @override */\nshaka.media.TextEngine.prototype.destroy = function() {\n if (this.track_) {\n this.removeWhere_(function(cue) { return true; });\n }\n\n this.parser_ = null;\n this.track_ = null;\n\n return Promise.resolve();\n};\n\n\n/**\n * Initialize the parser. This can be called multiple times, but must be called\n * at least once before appendBuffer.\n *\n * @param {string} mimeType\n */\nshaka.media.TextEngine.prototype.initParser = function(mimeType) {\n var factory = shaka.media.TextEngine.parserMap_[mimeType];\n goog.asserts.assert(\n factory,\n 'Text type negotiation should have happened already');\n this.parser_ = new factory();\n};\n\n\n/**\n * @param {!ArrayBuffer} buffer\n * @param {?number} startTime\n * @param {?number} endTime\n * @return {!Promise}\n */\nshaka.media.TextEngine.prototype.appendBuffer =\n function(buffer, startTime, endTime) {\n goog.asserts.assert(this.parser_, 'The parser should already be initialized');\n\n // Start the operation asynchronously to avoid blocking the caller.\n return Promise.resolve().then(function() {\n // Check that TextEngine hasn't been destroyed.\n if (!this.track_) return;\n\n if (startTime == null || endTime == null) {\n this.parser_.parseInit(buffer);\n return;\n }\n\n /** @type {shakaExtern.TextParser.TimeContext} **/\n var time = {\n periodStart: this.timestampOffset_,\n segmentStart: startTime,\n segmentEnd: endTime\n };\n\n // Parse the buffer and add the new cues.\n var cues = this.parser_.parseMedia(buffer, time);\n\n for (var i = 0; i < cues.length; ++i) {\n if (cues[i].startTime >= this.appendWindowEnd_) break;\n this.track_.addCue(cues[i]);\n }\n\n // NOTE: We update the buffered range from the start and end times passed\n // down from the segment reference, not with the start and end times of the\n // parsed cues. This is important because some segments may contain no\n // cues, but we must still consider those ranges buffered.\n if (this.bufferStart_ == null) {\n this.bufferStart_ = startTime;\n } else {\n // We already had something in buffer, and we assume we are extending the\n // range from the end.\n goog.asserts.assert((startTime - this.bufferEnd_) <= 1,\n 'There should not be a gap in text references >1s');\n }\n this.bufferEnd_ = Math.min(endTime, this.appendWindowEnd_);\n }.bind(this));\n};\n\n\n/**\n * @param {number} start\n * @param {number} end\n * @return {!Promise}\n */\nshaka.media.TextEngine.prototype.remove = function(start, end) {\n // Start the operation asynchronously to avoid blocking the caller.\n return Promise.resolve().then(function() {\n // Check that TextEngine hasn't been destroyed.\n if (!this.track_) return;\n\n this.removeWhere_(function(cue) {\n if (cue.startTime >= end || cue.endTime <= start) {\n // Outside the remove range. Hang on to it.\n return false;\n }\n return true;\n });\n\n if (this.bufferStart_ == null) {\n goog.asserts.assert(this.bufferEnd_ == null,\n 'end must be null if start is null');\n } else {\n goog.asserts.assert(this.bufferEnd_ != null,\n 'end must be non-null if start is non-null');\n\n // Update buffered range.\n if (end <= this.bufferStart_ || start >= this.bufferEnd_) {\n // No intersection. Nothing was removed.\n } else if (start <= this.bufferStart_ && end >= this.bufferEnd_) {\n // We wiped out everything.\n goog.asserts.assert(\n this.track_.cues.length == 0, 'should be no cues left');\n this.bufferStart_ = this.bufferEnd_ = null;\n } else if (start <= this.bufferStart_ && end < this.bufferEnd_) {\n // We removed from the beginning of the range.\n this.bufferStart_ = end;\n } else if (start > this.bufferStart_ && end >= this.bufferEnd_) {\n // We removed from the end of the range.\n this.bufferEnd_ = start;\n } else {\n // We removed from the middle? StreamingEngine isn't supposed to.\n goog.asserts.assert(\n false, 'removal from the middle is not supported by TextEngine');\n }\n }\n }.bind(this));\n};\n\n\n/** @param {number} timestampOffset */\nshaka.media.TextEngine.prototype.setTimestampOffset =\n function(timestampOffset) {\n this.timestampOffset_ = timestampOffset;\n};\n\n\n/** @param {number} windowEnd */\nshaka.media.TextEngine.prototype.setAppendWindowEnd =\n function(windowEnd) {\n this.appendWindowEnd_ = windowEnd;\n};\n\n\n/**\n * @return {?number} Time in seconds of the beginning of the buffered range,\n * or null if nothing is buffered.\n */\nshaka.media.TextEngine.prototype.bufferStart = function() {\n return this.bufferStart_;\n};\n\n\n/**\n * @return {?number} Time in seconds of the end of the buffered range,\n * or null if nothing is buffered.\n */\nshaka.media.TextEngine.prototype.bufferEnd = function() {\n return this.bufferEnd_;\n};\n\n\n/**\n * @param {number} t A timestamp\n * @return {boolean}\n */\nshaka.media.TextEngine.prototype.isBuffered = function(t) {\n return t >= this.bufferStart_ && t < this.bufferEnd_;\n};\n\n\n/**\n * @param {number} t A timestamp\n * @return {number} Number of seconds ahead of 't' we have buffered\n */\nshaka.media.TextEngine.prototype.bufferedAheadOf = function(t) {\n if (this.bufferEnd_ == null || this.bufferEnd_ < t) return 0;\n\n goog.asserts.assert(\n this.bufferStart_ != null, 'start should not be null if end is not null');\n\n return this.bufferEnd_ - Math.max(t, this.bufferStart_);\n};\n\n\n/**\n * Remove all cues for which the matching function returns true.\n *\n * @param {function(!TextTrackCue):boolean} predicate\n * @private\n */\nshaka.media.TextEngine.prototype.removeWhere_ = function(predicate) {\n var cues = this.track_.cues;\n var removeMe = [];\n\n // Remove these in another loop to avoid mutating the TextTrackCueList\n // while iterating over it. This allows us to avoid making assumptions\n // about whether or not this.track_.remove() will alter that list.\n for (var i = 0; i < cues.length; ++i) {\n if (predicate(cues[i])) {\n removeMe.push(cues[i]);\n }\n }\n\n for (var i = 0; i < removeMe.length; ++i) {\n this.track_.removeCue(removeMe[i]);\n }\n};\n\n\n\n/**\n * @param {Function} parser\n * @constructor\n * @implements {shakaExtern.TextParser}\n * @private\n */\nshaka.media.TextEngine.TextParserWrapper_ = function(parser) {\n this.parser = parser;\n};\n\n\n/** @override **/\nshaka.media.TextEngine.TextParserWrapper_.prototype.parseInit = function(data) {\n this.parser(data, 0, null, null);\n};\n\n\n/** @override **/\nshaka.media.TextEngine.TextParserWrapper_.prototype.parseMedia = function(\n data, time) {\n return this.parser(data,\n time.periodStart,\n time.segmentStart,\n time.segmentEnd);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/text_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.TimeRangesUtils');\n\n\n/**\n * @namespace shaka.media.TimeRangesUtils\n * @summary A set of utility functions for dealing with TimeRanges objects.\n */\n\n\n/**\n * Gets the first timestamp in buffer.\n *\n * @param {TimeRanges} b\n * @return {?number} The first buffered timestamp, in seconds, if |buffered|\n * is non-empty; otherwise, return null.\n */\nshaka.media.TimeRangesUtils.bufferStart = function(b) {\n if (!b) return null;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return null;\n // Workaround Edge bug: https://goo.gl/BtxKgb\n if (b.length == 1 && b.start(0) < 0) return 0;\n return b.length ? b.start(0) : null;\n};\n\n\n/**\n * Gets the last timestamp in buffer.\n *\n * @param {TimeRanges} b\n * @return {?number} The last buffered timestamp, in seconds, if |buffered|\n * is non-empty; otherwise, return null.\n */\nshaka.media.TimeRangesUtils.bufferEnd = function(b) {\n if (!b) return null;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return null;\n return b.length ? b.end(b.length - 1) : null;\n};\n\n\n/**\n * Determines if the given time is inside a buffered range. This includes gaps,\n * meaning if the playhead is in a gap, it is considered buffered.\n *\n * @param {TimeRanges} b\n * @param {number} time\n * @return {boolean}\n */\nshaka.media.TimeRangesUtils.isBuffered = function(b, time) {\n if (!b || !b.length) return false;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return false;\n\n return time >= b.start(0) && time <= b.end(b.length - 1);\n};\n\n\n/**\n * Computes how far ahead of the given timestamp is buffered. To provide smooth\n * playback while jumping gaps, we don't include the gaps when calculating this.\n * This only includes the amount of content that is buffered.\n *\n * @param {TimeRanges} b\n * @param {number} time\n * @return {number} The number of seconds buffered, in seconds, ahead of the\n * given time.\n */\nshaka.media.TimeRangesUtils.bufferedAheadOf = function(b, time) {\n if (!b || !b.length) return 0;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return 0;\n\n // NOTE: On IE11, buffered ranges may show appended data before the associated\n // append operation is complete.\n\n // We calculate buffered amount by ONLY accounting for the content buffered\n // (i.e. we ignore the times of the gaps). We also buffer through all gaps.\n // So start at the end and add up all buffers until |time|.\n var result = 0;\n for (var i = b.length - 1; i >= 0 && b.end(i) > time; --i) {\n result += b.end(i) - Math.max(b.start(i), time);\n }\n\n return result;\n};\n\n\n/**\n * Determines if the given time is inside a gap between buffered ranges. If it\n * is, this returns the index of the buffer that is *ahead* of the gap.\n *\n * @param {TimeRanges} b\n * @param {number} time\n * @return {?number} The index of the buffer after the gap, or null if not in a\n * gap.\n */\nshaka.media.TimeRangesUtils.getGapIndex = function(b, time) {\n if (!b || !b.length) return null;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return null;\n\n // IE/Edge stops 0.5 seconds before a gap, so it needs a much larger\n // threshold, but we don't want to punish other browsers that stop closer.\n // See: https://goo.gl/cuAcYd\n var threshold = 0.1;\n if (/(Edge|Trident)\\//.test(navigator.userAgent))\n threshold = 0.5;\n\n for (var i = 0; i < b.length; i++) {\n if (b.start(i) > time && (i == 0 || b.end(i - 1) - time <= threshold)) {\n return i;\n }\n }\n\n return null;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/time_ranges_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.MediaSourceEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.media.TimeRangesUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * MediaSourceEngine wraps all operations on MediaSource and SourceBuffers.\n * All asynchronous operations return a Promise, and all operations are\n * internally synchronized and serialized as needed. Operations that can\n * be done in parallel will be done in parallel.\n *\n * @param {HTMLMediaElement} video The video element, used to read error codes\n * when MediaSource operations fail.\n * @param {MediaSource} mediaSource The MediaSource, which must be in the\n * 'open' state.\n * @param {TextTrack} textTrack The TextTrack to use for subtitles/captions.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.MediaSourceEngine = function(video, mediaSource, textTrack) {\n goog.asserts.assert(mediaSource.readyState == 'open',\n 'The MediaSource should be in the \\'open\\' state.');\n\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {MediaSource} */\n this.mediaSource_ = mediaSource;\n\n /** @private {TextTrack} */\n this.textTrack_ = textTrack;\n\n /** @private {!Object.<shaka.util.ManifestParserUtils.ContentType,\n SourceBuffer>} */\n this.sourceBuffers_ = {};\n\n /** @private {shaka.media.TextEngine} */\n this.textEngine_ = null;\n\n /**\n * @private {!Object.<string,\n * !Array.<shaka.media.MediaSourceEngine.Operation>>}\n */\n this.queues_ = {};\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {boolean} */\n this.destroyed_ = false;\n};\n\n\n/**\n * @typedef {{\n * start: function(),\n * p: !shaka.util.PublicPromise\n * }}\n *\n * @summary An operation in queue.\n * @property {function()} start\n * The function which starts the operation.\n * @property {!shaka.util.PublicPromise} p\n * The PublicPromise which is associated with this operation.\n */\nshaka.media.MediaSourceEngine.Operation;\n\n\n/**\n * Checks if a certain type is supported.\n *\n * @param {string} mimeType\n * @return {boolean}\n */\nshaka.media.MediaSourceEngine.isTypeSupported = function(mimeType) {\n return shaka.media.TextEngine.isTypeSupported(mimeType) ||\n MediaSource.isTypeSupported(mimeType);\n};\n\n\n/**\n * Returns true if the browser has the basic APIs we need.\n *\n * @return {boolean}\n */\nshaka.media.MediaSourceEngine.isBrowserSupported = function() {\n return !!window.MediaSource && !!window.MediaSource.isTypeSupported;\n};\n\n\n/**\n * Returns a map of MediaSource support for well-known types.\n *\n * @return {!Object.<string, boolean>}\n */\nshaka.media.MediaSourceEngine.probeSupport = function() {\n goog.asserts.assert(shaka.media.MediaSourceEngine.isBrowserSupported(),\n 'Requires basic support');\n var support = {};\n var testMimeTypes = [\n // MP4 types\n 'video/mp4; codecs=\"avc1.42E01E\"',\n 'video/mp4; codecs=\"avc3.42E01E\"',\n 'video/mp4; codecs=\"hvc1.1.6.L93.90\"',\n 'audio/mp4; codecs=\"mp4a.40.2\"',\n 'audio/mp4; codecs=\"ac-3\"',\n 'audio/mp4; codecs=\"ec-3\"',\n // WebM types\n 'video/webm; codecs=\"vp8\"',\n 'video/webm; codecs=\"vp9\"',\n 'video/webm; codecs=\"av1\"',\n 'audio/webm; codecs=\"vorbis\"',\n 'audio/webm; codecs=\"opus\"',\n // MPEG2 TS types (video/ is also used for audio: http://goo.gl/tYHXiS)\n 'video/mp2t; codecs=\"avc1.42E01E\"',\n 'video/mp2t; codecs=\"avc3.42E01E\"',\n 'video/mp2t; codecs=\"hvc1.1.6.L93.90\"',\n 'video/mp2t; codecs=\"mp4a.40.2\"',\n 'video/mp2t; codecs=\"ac-3\"',\n 'video/mp2t; codecs=\"ec-3\"',\n 'video/mp2t; codecs=\"mp4a.40.2\"',\n // WebVTT types\n 'text/vtt',\n 'application/mp4; codecs=\"wvtt\"',\n // TTML types\n 'application/ttml+xml',\n 'application/mp4; codecs=\"stpp\"'\n ];\n\n testMimeTypes.forEach(function(type) {\n support[type] = shaka.media.MediaSourceEngine.isTypeSupported(type);\n var basicType = type.split(';')[0];\n support[basicType] = support[basicType] || support[type];\n });\n\n return support;\n};\n\n\n/**\n * @override\n */\nshaka.media.MediaSourceEngine.prototype.destroy = function() {\n var Functional = shaka.util.Functional;\n this.destroyed_ = true;\n\n var cleanup = [];\n\n for (var contentType in this.queues_) {\n // Make a local copy of the queue and the first item.\n var q = this.queues_[contentType];\n var inProgress = q[0];\n\n // Drop everything else out of the queue.\n this.queues_[contentType] = q.slice(0, 1);\n\n // We will wait for this item to complete/fail.\n if (inProgress) {\n cleanup.push(inProgress.p.catch(Functional.noop));\n }\n\n // The rest will be rejected silently if possible.\n for (var i = 1; i < q.length; ++i) {\n q[i].p.catch(Functional.noop);\n q[i].p.reject();\n }\n }\n\n if (this.textEngine_) {\n cleanup.push(this.textEngine_.destroy());\n }\n\n return Promise.all(cleanup).then(function() {\n this.eventManager_.destroy();\n this.eventManager_ = null;\n this.video_ = null;\n this.mediaSource_ = null;\n this.textTrack_ = null;\n this.textEngine_ = null;\n this.sourceBuffers_ = {};\n if (!COMPILED) {\n for (var contentType in this.queues_) {\n goog.asserts.assert(\n this.queues_[contentType].length == 0,\n contentType + ' queue should be empty after destroy!');\n }\n }\n this.queues_ = {};\n }.bind(this));\n};\n\n\n/**\n * Initialize MediaSourceEngine.\n *\n * Note that it is not valid to call this multiple times, except to add or\n * reinitialize text streams.\n *\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType, string>}\n * typeConfig A map of content types to full MIME types.\n * For example: { 'audio': 'audio/webm; codecs=\"vorbis\"',\n * 'video': 'video/webm; codecs=\"vp9\"', 'text': 'text/vtt' }.\n * All types given must be supported.\n *\n * @throws InvalidAccessError if blank MIME types are given\n * @throws NotSupportedError if unsupported MIME types are given\n * @throws QuotaExceededError if the browser can't support that many buffers\n */\nshaka.media.MediaSourceEngine.prototype.init = function(typeConfig) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n for (var contentType in typeConfig) {\n var mimeType = typeConfig[contentType];\n goog.asserts.assert(\n shaka.media.MediaSourceEngine.isTypeSupported(mimeType),\n 'Type negotiation should happen before MediaSourceEngine.init!');\n\n if (contentType == ContentType.TEXT) {\n this.reinitText(mimeType);\n } else {\n var sourceBuffer = this.mediaSource_.addSourceBuffer(mimeType);\n this.eventManager_.listen(\n sourceBuffer, 'error', this.onError_.bind(this, contentType));\n this.eventManager_.listen(\n sourceBuffer, 'updateend', this.onUpdateEnd_.bind(this, contentType));\n this.sourceBuffers_[contentType] = sourceBuffer;\n this.queues_[contentType] = [];\n }\n }\n};\n\n\n/**\n * Reinitialize the TextEngine for a new text type.\n * @param {string} mimeType\n */\nshaka.media.MediaSourceEngine.prototype.reinitText = function(mimeType) {\n if (!this.textEngine_) {\n this.textEngine_ = new shaka.media.TextEngine(this.textTrack_);\n }\n this.textEngine_.initParser(mimeType);\n};\n\n\n/**\n * Gets the first timestamp in buffer for the given content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {?number} The timestamp in seconds, or null if nothing is buffered.\n */\nshaka.media.MediaSourceEngine.prototype.bufferStart = function(contentType) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.bufferStart();\n }\n return shaka.media.TimeRangesUtils.bufferStart(\n this.getBuffered_(contentType));\n};\n\n\n/**\n * Gets the last timestamp in buffer for the given content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {?number} The timestamp in seconds, or null if nothing is buffered.\n */\nshaka.media.MediaSourceEngine.prototype.bufferEnd = function(contentType) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.bufferEnd();\n }\n return shaka.media.TimeRangesUtils.bufferEnd(this.getBuffered_(contentType));\n};\n\n\n/**\n * Determines if the given time is inside the buffered range of the given\n * content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} time\n * @return {boolean}\n */\nshaka.media.MediaSourceEngine.prototype.isBuffered = function(\n contentType, time) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.isBuffered(time);\n } else {\n var buffered = this.getBuffered_(contentType);\n return shaka.media.TimeRangesUtils.isBuffered(buffered, time);\n }\n};\n\n\n/**\n * Computes how far ahead of the given timestamp is buffered for the given\n * content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} time\n * @return {number} The amount of time buffered ahead in seconds.\n */\nshaka.media.MediaSourceEngine.prototype.bufferedAheadOf =\n function(contentType, time) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.bufferedAheadOf(time);\n } else {\n var buffered = this.getBuffered_(contentType);\n return shaka.media.TimeRangesUtils.bufferedAheadOf(buffered, time);\n }\n};\n\n\n/**\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {TimeRanges} The buffered ranges for the given content type, or\n * null if the buffered ranges could not be obtained.\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.getBuffered_ = function(contentType) {\n try {\n return this.sourceBuffers_[contentType].buffered;\n } catch (exception) {\n // Note: previous MediaSource errors may cause access to |buffered| to\n // throw.\n shaka.log.error('failed to get buffered range for ' + contentType,\n exception);\n return null;\n }\n};\n\n\n/**\n * Enqueue an operation to append data to the SourceBuffer.\n * Start and end times are needed for TextEngine, but not for MediaSource.\n * Start and end times may be null for initialization segments, if present they\n * are relative to the presentation timeline.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {!ArrayBuffer} data\n * @param {?number} startTime\n * @param {?number} endTime\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.appendBuffer =\n function(contentType, data, startTime, endTime) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.appendBuffer(data, startTime, endTime);\n }\n return this.enqueueOperation_(\n contentType,\n this.append_.bind(this, contentType, data));\n};\n\n\n/**\n * Enqueue an operation to remove data from the SourceBuffer.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} startTime\n * @param {number} endTime\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.remove =\n function(contentType, startTime, endTime) {\n // On IE11, this operation would be permitted, but would have no effect!\n // See https://github.com/google/shaka-player/issues/251\n goog.asserts.assert(endTime < Number.MAX_VALUE,\n 'remove() with MAX_VALUE or Infinity is not IE-compatible!');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.remove(startTime, endTime);\n }\n return this.enqueueOperation_(\n contentType,\n this.remove_.bind(this, contentType, startTime, endTime));\n};\n\n\n/**\n * Enqueue an operation to clear the SourceBuffer.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.clear = function(contentType) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.remove(0, Infinity);\n }\n // Note that not all platforms allow clearing to Infinity.\n return this.enqueueOperation_(\n contentType,\n this.remove_.bind(this, contentType, 0, this.mediaSource_.duration));\n};\n\n\n/**\n * Enqueue an operation to flush the SourceBuffer.\n * This is a workaround for what we believe is a Chromecast bug.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.flush = function(contentType) {\n // Flush the pipeline. Necessary on Chromecast, even though we have removed\n // everything.\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n // Nothing to flush for text.\n return Promise.resolve();\n }\n return this.enqueueOperation_(\n contentType,\n this.flush_.bind(this, contentType));\n};\n\n\n/**\n * Sets the timestamp offset and append window end for the given content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} timestampOffset The timestamp offset. Segments which start\n * at time t will be inserted at time t + timestampOffset instead. This\n * value does not affect segments which have already been inserted.\n * @param {?number} appendWindowEnd The timestamp to set the append window end\n * to. Media beyond this value will be truncated.\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.setStreamProperties = function(\n contentType, timestampOffset, appendWindowEnd) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n this.textEngine_.setTimestampOffset(timestampOffset);\n if (appendWindowEnd != null)\n this.textEngine_.setAppendWindowEnd(appendWindowEnd);\n return Promise.resolve();\n }\n\n if (appendWindowEnd == null)\n appendWindowEnd = Infinity;\n\n return Promise.all([\n // Queue an abort() to help MSE splice together overlapping segments.\n // We set appendWindowEnd when we change periods in DASH content, and the\n // period transition may result in overlap.\n //\n // An abort() also helps with MPEG2-TS. When we append a TS segment, we\n // always enter a PARSING_MEDIA_SEGMENT state and we can't change the\n // timestamp offset. By calling abort(), we reset the state so we can\n // set it.\n //\n // Note that abort() resets both appendWindowStart and appendWindowEnd;\n // however, we don't use appendWindowStart.\n this.enqueueOperation_(\n contentType,\n this.abort_.bind(this, contentType)),\n this.enqueueOperation_(\n contentType,\n this.setTimestampOffset_.bind(this, contentType, timestampOffset)),\n this.enqueueOperation_(\n contentType,\n this.setAppendWindowEnd_.bind(this, contentType, appendWindowEnd))\n ]);\n};\n\n\n/**\n * @param {string=} opt_reason Valid reasons are 'network' and 'decode'.\n * @return {!Promise}\n * @see http://w3c.github.io/media-source/#idl-def-EndOfStreamError\n */\nshaka.media.MediaSourceEngine.prototype.endOfStream = function(opt_reason) {\n return this.enqueueBlockingOperation_(function() {\n // Chrome won't let me pass undefined, but it will let me omit the\n // argument. Firefox does not have this problem.\n // TODO: File a bug about this.\n if (opt_reason) {\n this.mediaSource_.endOfStream(opt_reason);\n } else {\n this.mediaSource_.endOfStream();\n }\n }.bind(this));\n};\n\n\n/**\n * We only support increasing duration at this time. Decreasing duration\n * causes the MSE removal algorithm to run, which results in an 'updateend'\n * event. Supporting this scenario would be complicated, and is not currently\n * needed.\n *\n * @param {number} duration\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.setDuration = function(duration) {\n goog.asserts.assert(\n isNaN(this.mediaSource_.duration) ||\n this.mediaSource_.duration <= duration,\n 'duration cannot decrease: ' + this.mediaSource_.duration + ' -> ' +\n duration);\n return this.enqueueBlockingOperation_(function() {\n this.mediaSource_.duration = duration;\n }.bind(this));\n};\n\n\n/**\n * Get the current MediaSource duration.\n *\n * @return {number}\n */\nshaka.media.MediaSourceEngine.prototype.getDuration = function() {\n return this.mediaSource_.duration;\n};\n\n\n/**\n * Append data to the SourceBuffer.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {!ArrayBuffer} data\n * @throws QuotaExceededError if the browser's buffer is full\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.append_ =\n function(contentType, data) {\n // This will trigger an 'updateend' event.\n this.sourceBuffers_[contentType].appendBuffer(data);\n};\n\n\n/**\n * Remove data from the SourceBuffer.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} startTime\n * @param {number} endTime\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.remove_ =\n function(contentType, startTime, endTime) {\n if (endTime <= startTime) {\n // Ignore removal of inverted or empty ranges.\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n return;\n }\n\n // This will trigger an 'updateend' event.\n this.sourceBuffers_[contentType].remove(startTime, endTime);\n};\n\n\n/**\n * Call abort() on the SourceBuffer.\n * This resets MSE's last_decode_timestamp on all track buffers, which should\n * trigger the splicing logic for overlapping segments.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.abort_ = function(contentType) {\n // Save the append window end, which is reset on abort().\n var appendWindowEnd = this.sourceBuffers_[contentType].appendWindowEnd;\n\n // This will not trigger an 'updateend' event, since nothing is happening.\n // This is only to reset MSE internals, not to abort an actual operation.\n this.sourceBuffers_[contentType].abort();\n\n // Restore the append window end.\n this.sourceBuffers_[contentType].appendWindowEnd = appendWindowEnd;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * Nudge the playhead to force the media pipeline to be flushed.\n * This seems to be necessary on Chromecast to get new content to replace old\n * content.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.flush_ = function(contentType) {\n // Never use flush_ if there's data. It causes a hiccup in playback.\n goog.asserts.assert(\n this.video_.buffered.length == 0,\n 'MediaSourceEngine.flush_ should only be used after clearing all data!');\n\n // Seeking forces the pipeline to be flushed.\n this.video_.currentTime -= 0.001;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * Set the SourceBuffer's timestamp offset.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} timestampOffset\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.setTimestampOffset_ =\n function(contentType, timestampOffset) {\n this.sourceBuffers_[contentType].timestampOffset = timestampOffset;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * Set the SourceBuffer's append window end.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} appendWindowEnd\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.setAppendWindowEnd_ =\n function(contentType, appendWindowEnd) {\n var fudge = 1 / 25; // one frame, assuming a low framerate\n this.sourceBuffers_[contentType].appendWindowEnd = appendWindowEnd + fudge;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {!Event} event\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.onError_ =\n function(contentType, event) {\n var operation = this.queues_[contentType][0];\n goog.asserts.assert(operation, 'Spurious error event!');\n goog.asserts.assert(!this.sourceBuffers_[contentType].updating,\n 'SourceBuffer should not be updating on error!');\n var code = this.video_.error ? this.video_.error.code : 0;\n operation.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_FAILED,\n code));\n // Do not pop from queue. An 'updateend' event will fire next, and to avoid\n // synchronizing these two event handlers, we will allow that one to pop from\n // the queue as normal. Note that because the operation has already been\n // rejected, the call to resolve() in the 'updateend' handler will have no\n // effect.\n};\n\n\n/**\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.onUpdateEnd_ = function(contentType) {\n var operation = this.queues_[contentType][0];\n goog.asserts.assert(operation, 'Spurious updateend event!');\n if (!operation) return;\n goog.asserts.assert(!this.sourceBuffers_[contentType].updating,\n 'SourceBuffer should not be updating on updateend!');\n operation.p.resolve();\n this.popFromQueue_(contentType);\n};\n\n\n/**\n * Enqueue an operation and start it if appropriate.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {function()} start\n * @return {!Promise}\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.enqueueOperation_ =\n function(contentType, start) {\n if (this.destroyed_) return Promise.reject();\n\n var operation = {\n start: start,\n p: new shaka.util.PublicPromise()\n };\n this.queues_[contentType].push(operation);\n\n if (this.queues_[contentType].length == 1) {\n try {\n operation.start();\n } catch (exception) {\n if (exception.name == 'QuotaExceededError') {\n operation.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR,\n contentType));\n } else {\n operation.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW,\n exception));\n }\n this.popFromQueue_(contentType);\n }\n }\n return operation.p;\n};\n\n\n/**\n * Enqueue an operation which must block all other operations on all\n * SourceBuffers.\n *\n * @param {function()} run\n * @return {!Promise}\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.enqueueBlockingOperation_ =\n function(run) {\n if (this.destroyed_) return Promise.reject();\n\n var allWaiters = [];\n\n // Enqueue a 'wait' operation onto each queue.\n // This operation signals its readiness when it starts.\n // When all wait operations are ready, the real operation takes place.\n for (var contentType in this.sourceBuffers_) {\n var ready = new shaka.util.PublicPromise();\n var operation = {\n start: function(ready) { ready.resolve(); }.bind(null, ready),\n p: ready\n };\n\n this.queues_[contentType].push(operation);\n allWaiters.push(ready);\n\n if (this.queues_[contentType].length == 1) {\n operation.start();\n }\n }\n\n // Return a Promise to the real operation, which waits to begin until there\n // are no other in-progress operations on any SourceBuffers.\n return Promise.all(allWaiters).then(function() {\n if (!COMPILED) {\n // If we did it correctly, nothing is updating.\n for (var contentType in this.sourceBuffers_) {\n goog.asserts.assert(\n this.sourceBuffers_[contentType].updating == false,\n 'SourceBuffers should not be updating after a blocking op!');\n }\n }\n\n var ret;\n // Run the real operation, which is synchronous.\n try {\n run();\n } catch (exception) {\n ret = Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW,\n exception));\n }\n\n // Unblock the queues.\n for (var contentType in this.sourceBuffers_) {\n this.popFromQueue_(contentType);\n }\n\n return ret;\n }.bind(this), function() {\n // One of the waiters failed, which means we've been destroyed.\n goog.asserts.assert(this.destroyed_, 'Should be destroyed by now');\n // We haven't popped from the queue. Canceled waiters have been removed by\n // destroy. What's left now should just be resolved waiters. In uncompiled\n // mode, we will maintain good hygiene and make sure the assert at the end\n // of destroy passes. In compiled mode, the queues are wiped in destroy.\n if (!COMPILED) {\n for (var contentType in this.sourceBuffers_) {\n if (this.queues_[contentType].length) {\n goog.asserts.assert(\n this.queues_[contentType].length == 1,\n 'Should be at most one item in queue!');\n goog.asserts.assert(\n allWaiters.indexOf(this.queues_[contentType][0].p) != -1,\n 'The item in queue should be one of our waiters!');\n this.queues_[contentType].shift();\n }\n }\n }\n return Promise.reject();\n }.bind(this));\n};\n\n\n/**\n * Pop from the front of the queue and start a new operation.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.popFromQueue_ = function(contentType) {\n // Remove the in-progress operation, which is now complete.\n this.queues_[contentType].shift();\n // Retrieve the next operation, if any, from the queue and start it.\n var next = this.queues_[contentType][0];\n if (next) {\n try {\n next.start();\n } catch (exception) {\n next.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW,\n exception));\n this.popFromQueue_(contentType);\n }\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/media_source_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.LanguageUtils');\n\ngoog.require('goog.asserts');\n\n\n/**\n * @namespace shaka.util.LanguageUtils\n * @summary A set of language utility functions.\n */\n\n\n/**\n * Compares two language tags as defined by RFC 5646 and ISO 639. The\n * comparison takes sublanguages into account via the |fuzz| parameter.\n * The caller is expected to normalize the inputs first.\n *\n * @see shaka.util.LanguageUtils.normalize()\n * @see IETF RFC 5646\n * @see ISO 639\n *\n * @param {shaka.util.LanguageUtils.MatchType} fuzz What kind of match is\n * acceptable.\n * @param {string} preference The user's preferred language tag.\n * @param {string} candidate An available language tag.\n * @return {boolean}\n */\nshaka.util.LanguageUtils.match = function(fuzz, preference, candidate) {\n // Alias.\n var LanguageUtils = shaka.util.LanguageUtils;\n\n goog.asserts.assert(preference == LanguageUtils.normalize(preference),\n 'Language pref should be normalized first');\n goog.asserts.assert(candidate == LanguageUtils.normalize(candidate),\n 'Language candidate should be normalized first');\n\n if (candidate == preference) {\n return true;\n }\n\n if (fuzz >= shaka.util.LanguageUtils.MatchType.BASE_LANGUAGE_OKAY &&\n candidate == preference.split('-')[0]) {\n return true;\n }\n\n if (fuzz >= shaka.util.LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY &&\n candidate.split('-')[0] == preference.split('-')[0]) {\n return true;\n }\n\n return false;\n};\n\n\n/**\n * A match type for fuzzy-matching logic.\n *\n * @enum {number}\n */\nshaka.util.LanguageUtils.MatchType = {\n /** Accepts an exact match. */\n EXACT: 0,\n /** Accepts a less-specific version of the preferred sublanguage. */\n BASE_LANGUAGE_OKAY: 1,\n /** Accepts a different sublanguage of the preferred base language. */\n OTHER_SUB_LANGUAGE_OKAY: 2\n};\n\n\n/**\n * Normalize the language tag.\n *\n * RFC 5646 specifies that language tags are case insensitive and that the\n * shortest representation of the base language should always be used.\n * This will convert the tag to lower-case and map 3-letter codes (ISO 639-2)\n * to 2-letter codes (ISO 639-1) whenever possible.\n *\n * @param {string} lang\n * @return {string}\n *\n * @see IETF RFC 5646\n * @see ISO 639\n */\nshaka.util.LanguageUtils.normalize = function(lang) {\n var fields = lang.toLowerCase().split('-');\n var base = fields[0];\n var replacement = shaka.util.LanguageUtils.isoMap_[base];\n if (replacement) {\n fields[0] = replacement;\n }\n return fields.join('-');\n};\n\n\n/**\n * A map from 3-letter language codes (ISO 639-2) to 2-letter language codes\n * (ISO 639-1) for all languages which have both in the registry.\n *\n * @const {!Object.<string, string>}\n * @private\n */\nshaka.util.LanguageUtils.isoMap_ = {\n 'aar': 'aa', 'abk': 'ab', 'afr': 'af', 'aka': 'ak', 'alb': 'sq', 'amh': 'am',\n 'ara': 'ar', 'arg': 'an', 'arm': 'hy', 'asm': 'as', 'ava': 'av', 'ave': 'ae',\n 'aym': 'ay', 'aze': 'az', 'bak': 'ba', 'bam': 'bm', 'baq': 'eu', 'bel': 'be',\n 'ben': 'bn', 'bih': 'bh', 'bis': 'bi', 'bod': 'bo', 'bos': 'bs', 'bre': 'br',\n 'bul': 'bg', 'bur': 'my', 'cat': 'ca', 'ces': 'cs', 'cha': 'ch', 'che': 'ce',\n 'chi': 'zh', 'chu': 'cu', 'chv': 'cv', 'cor': 'kw', 'cos': 'co', 'cre': 'cr',\n 'cym': 'cy', 'cze': 'cs', 'dan': 'da', 'deu': 'de', 'div': 'dv', 'dut': 'nl',\n 'dzo': 'dz', 'ell': 'el', 'eng': 'en', 'epo': 'eo', 'est': 'et', 'eus': 'eu',\n 'ewe': 'ee', 'fao': 'fo', 'fas': 'fa', 'fij': 'fj', 'fin': 'fi', 'fra': 'fr',\n 'fre': 'fr', 'fry': 'fy', 'ful': 'ff', 'geo': 'ka', 'ger': 'de', 'gla': 'gd',\n 'gle': 'ga', 'glg': 'gl', 'glv': 'gv', 'gre': 'el', 'grn': 'gn', 'guj': 'gu',\n 'hat': 'ht', 'hau': 'ha', 'heb': 'he', 'her': 'hz', 'hin': 'hi', 'hmo': 'ho',\n 'hrv': 'hr', 'hun': 'hu', 'hye': 'hy', 'ibo': 'ig', 'ice': 'is', 'ido': 'io',\n 'iii': 'ii', 'iku': 'iu', 'ile': 'ie', 'ina': 'ia', 'ind': 'id', 'ipk': 'ik',\n 'isl': 'is', 'ita': 'it', 'jav': 'jv', 'jpn': 'ja', 'kal': 'kl', 'kan': 'kn',\n 'kas': 'ks', 'kat': 'ka', 'kau': 'kr', 'kaz': 'kk', 'khm': 'km', 'kik': 'ki',\n 'kin': 'rw', 'kir': 'ky', 'kom': 'kv', 'kon': 'kg', 'kor': 'ko', 'kua': 'kj',\n 'kur': 'ku', 'lao': 'lo', 'lat': 'la', 'lav': 'lv', 'lim': 'li', 'lin': 'ln',\n 'lit': 'lt', 'ltz': 'lb', 'lub': 'lu', 'lug': 'lg', 'mac': 'mk', 'mah': 'mh',\n 'mal': 'ml', 'mao': 'mi', 'mar': 'mr', 'may': 'ms', 'mkd': 'mk', 'mlg': 'mg',\n 'mlt': 'mt', 'mon': 'mn', 'mri': 'mi', 'msa': 'ms', 'mya': 'my', 'nau': 'na',\n 'nav': 'nv', 'nbl': 'nr', 'nde': 'nd', 'ndo': 'ng', 'nep': 'ne', 'nld': 'nl',\n 'nno': 'nn', 'nob': 'nb', 'nor': 'no', 'nya': 'ny', 'oci': 'oc', 'oji': 'oj',\n 'ori': 'or', 'orm': 'om', 'oss': 'os', 'pan': 'pa', 'per': 'fa', 'pli': 'pi',\n 'pol': 'pl', 'por': 'pt', 'pus': 'ps', 'que': 'qu', 'roh': 'rm', 'ron': 'ro',\n 'rum': 'ro', 'run': 'rn', 'rus': 'ru', 'sag': 'sg', 'san': 'sa', 'sin': 'si',\n 'slk': 'sk', 'slo': 'sk', 'slv': 'sl', 'sme': 'se', 'smo': 'sm', 'sna': 'sn',\n 'snd': 'sd', 'som': 'so', 'sot': 'st', 'spa': 'es', 'sqi': 'sq', 'srd': 'sc',\n 'srp': 'sr', 'ssw': 'ss', 'sun': 'su', 'swa': 'sw', 'swe': 'sv', 'tah': 'ty',\n 'tam': 'ta', 'tat': 'tt', 'tel': 'te', 'tgk': 'tg', 'tgl': 'tl', 'tha': 'th',\n 'tib': 'bo', 'tir': 'ti', 'ton': 'to', 'tsn': 'tn', 'tso': 'ts', 'tuk': 'tk',\n 'tur': 'tr', 'twi': 'tw', 'uig': 'ug', 'ukr': 'uk', 'urd': 'ur', 'uzb': 'uz',\n 'ven': 've', 'vie': 'vi', 'vol': 'vo', 'wel': 'cy', 'wln': 'wa', 'wol': 'wo',\n 'xho': 'xh', 'yid': 'yi', 'yor': 'yo', 'zha': 'za', 'zho': 'zh', 'zul': 'zu'\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/language_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.StreamUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.MediaSourceEngine');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.util.ArrayUtils');\ngoog.require('shaka.util.LanguageUtils');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n/**\n * @param {shakaExtern.Variant} variant\n * @param {shakaExtern.Restrictions} restrictions\n * Configured restrictions from the user.\n * @param {{width: number, height: number}} maxHwRes\n * The maximum resolution the hardware can handle.\n * This is applied separately from user restrictions because the setting\n * should not be easily replaced by the user's configuration.\n * @return {boolean}\n */\nshaka.util.StreamUtils.meetsRestrictions = function(\n variant, restrictions, maxHwRes) {\n var video = variant.video;\n if (video) {\n if (video.width < restrictions.minWidth ||\n video.width > restrictions.maxWidth || video.width > maxHwRes.width ||\n video.height < restrictions.minHeight ||\n video.height > restrictions.maxHeight ||\n video.height > maxHwRes.height ||\n (video.width * video.height) < restrictions.minPixels ||\n (video.width * video.height) > restrictions.maxPixels) {\n return false;\n }\n }\n\n if (variant.bandwidth < restrictions.minBandwidth ||\n variant.bandwidth > restrictions.maxBandwidth) {\n return false;\n }\n\n return true;\n};\n\n\n/**\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Restrictions} restrictions\n * @param {{width: number, height: number}} maxHwRes\n * @return {boolean} Whether the tracks changed.\n */\nshaka.util.StreamUtils.applyRestrictions =\n function(period, restrictions, maxHwRes) {\n var tracksChanged = false;\n\n period.variants.forEach(function(variant) {\n var originalAllowed = variant.allowedByApplication;\n variant.allowedByApplication = shaka.util.StreamUtils.meetsRestrictions(\n variant, restrictions, maxHwRes);\n\n if (originalAllowed != variant.allowedByApplication) {\n tracksChanged = true;\n }\n });\n\n return tracksChanged;\n};\n\n\n/**\n * Alters the given Period to filter out any unplayable streams.\n *\n * @param {shaka.media.DrmEngine} drmEngine\n * @param {!Object.<string, shakaExtern.Stream>} activeStreams\n * @param {shakaExtern.Period} period\n */\nshaka.util.StreamUtils.filterPeriod = function(\n drmEngine, activeStreams, period) {\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var activeVideo = activeStreams[ContentType.VIDEO];\n var activeAudio = activeStreams[ContentType.AUDIO];\n\n // Filter variants\n for (var i = 0; i < period.variants.length; ++i) {\n var variant = period.variants[i];\n if (!StreamUtils.variantIsCompatible_(\n variant, drmEngine, activeAudio, activeVideo)) {\n shaka.log.debug('Dropping Variant (not compatible with key system, ' +\n 'platform, or active Variant)', variant);\n period.variants.splice(i, 1);\n --i;\n continue;\n }\n }\n\n // Filter text streams\n for (var i = 0; i < period.textStreams.length; ++i) {\n var stream = period.textStreams[i];\n var fullMimeType = StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n if (!shaka.media.TextEngine.isTypeSupported(fullMimeType)) {\n shaka.log.debug('Dropping text stream. Is not supported by the ' +\n 'platform.', stream);\n period.textStreams.splice(i, 1);\n --i;\n }\n }\n};\n\n\n/**\n * Checks if a stream is compatible with the key system, platform,\n * and active stream.\n *\n * @param {?shakaExtern.Stream} stream\n * @param {shaka.media.DrmEngine} drmEngine\n * @param {?shakaExtern.Stream} activeStream\n * @return {boolean}\n * @private\n */\nshaka.util.StreamUtils.streamIsCompatible_ =\n function(stream, drmEngine, activeStream) {\n if (!stream) return true;\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n goog.asserts.assert(stream.type != ContentType.TEXT,\n 'Should not be called on a text stream!');\n\n var drmSupportedMimeTypes = null;\n if (drmEngine && drmEngine.initialized()) {\n drmSupportedMimeTypes = drmEngine.getSupportedTypes();\n }\n\n // Check if stream can be played by the platform\n var fullMimeType = shaka.util.StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n\n if (!shaka.media.MediaSourceEngine.isTypeSupported(fullMimeType))\n return false;\n\n // Check if stream can be handled by the key system.\n // There's no need to check that the stream is supported by the\n // chosen key system since the caller has already verified that.\n if (drmSupportedMimeTypes && stream.encrypted &&\n drmSupportedMimeTypes.indexOf(fullMimeType) < 0) {\n return false;\n }\n\n // Lastly, check if active stream can switch to the stream\n // Basic mime types and basic codecs need to match.\n // For example, we can't adapt between WebM and MP4,\n // nor can we adapt between mp4a.* to ec-3.\n // We can switch between text types on the fly,\n // so don't run this check on text.\n if (activeStream) {\n if (stream.mimeType != activeStream.mimeType ||\n stream.codecs.split('.')[0] != activeStream.codecs.split('.')[0]) {\n return false;\n }\n }\n\n return true;\n};\n\n\n/**\n * Checks if a variant is compatible with the key system, platform,\n * and active stream.\n *\n * @param {!shakaExtern.Variant} variant\n * @param {shaka.media.DrmEngine} drmEngine\n * @param {shakaExtern.Stream} activeAudio\n * @param {shakaExtern.Stream} activeVideo\n * @return {boolean}\n * @private\n */\nshaka.util.StreamUtils.variantIsCompatible_ =\n function(variant, drmEngine, activeAudio, activeVideo) {\n var StreamUtils = shaka.util.StreamUtils;\n if (drmEngine && drmEngine.initialized()) {\n if (!drmEngine.isSupportedByKeySystem(variant)) return false;\n }\n\n return StreamUtils.streamIsCompatible_(variant.audio,\n drmEngine,\n activeAudio) &&\n StreamUtils.streamIsCompatible_(variant.video, drmEngine, activeVideo);\n};\n\n\n/**\n * Gets an array of Track objects for the given Period\n *\n * @param {shakaExtern.Period} period\n * @param {?number} activeAudioId\n * @param {?number} activeVideoId\n * @return {!Array.<shakaExtern.Track>}\n */\nshaka.util.StreamUtils.getVariantTracks =\n function(period, activeAudioId, activeVideoId) {\n var StreamUtils = shaka.util.StreamUtils;\n var variants = StreamUtils.getPlayableVariants(period.variants);\n var label = null;\n var tracks = variants.map(function(variant) {\n var isActive;\n if (variant.video && variant.audio) {\n isActive = activeVideoId == variant.video.id &&\n activeAudioId == variant.audio.id;\n } else {\n isActive = (variant.video && activeVideoId == variant.video.id) ||\n (variant.audio && activeAudioId == variant.audio.id);\n }\n var codecs = '';\n if (variant.video) codecs += variant.video.codecs;\n if (variant.audio) {\n if (codecs != '') codecs += ', ';\n codecs += variant.audio.codecs;\n label = variant.audio.label;\n }\n\n var audioCodec = variant.audio ? variant.audio.codecs : null;\n var videoCodec = variant.video ? variant.video.codecs : null;\n var mimeType = null;\n if (variant.video) mimeType = variant.video.mimeType;\n else if (variant.audio) mimeType = variant.audio.mimeType;\n\n var kind = null;\n if (variant.audio) kind = variant.audio.kind;\n else if (variant.video) kind = variant.video.kind;\n\n var audioRoles = variant.audio ? variant.audio.roles : [];\n var videoRoles = variant.video ? variant.video.roles : [];\n var roles = shaka.util.ArrayUtils.removeDuplicates(\n audioRoles.concat(videoRoles));\n return {\n id: variant.id,\n active: isActive,\n type: 'variant',\n bandwidth: variant.bandwidth,\n language: variant.language,\n label: label,\n kind: kind || null,\n width: variant.video ? variant.video.width : null,\n height: variant.video ? variant.video.height : null,\n frameRate: variant.video ? variant.video.frameRate : undefined,\n mimeType: mimeType,\n codecs: codecs,\n audioCodec: audioCodec,\n videoCodec: videoCodec,\n primary: variant.primary,\n roles: roles,\n videoId: variant.video ? variant.video.id : null,\n audioId: variant.audio ? variant.audio.id : null\n };\n });\n\n return tracks;\n};\n\n\n/**\n * Gets an array of text Track objects for the given Period.\n *\n * @param {shakaExtern.Period} period\n * @param {?number} activeStreamId\n * @return {!Array.<shakaExtern.Track>}\n */\nshaka.util.StreamUtils.getTextTracks = function(period, activeStreamId) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n return period.textStreams.map(function(stream) {\n return {\n id: stream.id,\n active: activeStreamId == stream.id,\n type: ContentType.TEXT,\n language: stream.language,\n label: stream.label,\n kind: stream.kind,\n mimeType: stream.mimeType,\n codecs: stream.codecs || null,\n audioCodec: null,\n videoCodec: null,\n primary: stream.primary,\n roles: stream.roles\n };\n });\n};\n\n\n/**\n * Find the Variant for the given track.\n *\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Track} track\n * @return {?shakaExtern.Variant}\n */\nshaka.util.StreamUtils.findVariantForTrack = function(period, track) {\n for (var i = 0; i < period.variants.length; i++) {\n if (period.variants[i].id == track.id)\n return period.variants[i];\n }\n return null;\n};\n\n\n/**\n * Find the text stream for the given track.\n *\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Track} track\n * @return {?shakaExtern.Stream}\n */\nshaka.util.StreamUtils.findTextStreamForTrack = function(period, track) {\n for (var i = 0; i < period.textStreams.length; i++) {\n if (period.textStreams[i].id == track.id)\n return period.textStreams[i];\n }\n return null;\n};\n\n\n/**\n * Determines if the given variant is playable.\n * @param {!shakaExtern.Variant} variant\n * @return {boolean}\n */\nshaka.util.StreamUtils.isPlayable = function(variant) {\n return variant.allowedByApplication && variant.allowedByKeySystem;\n};\n\n\n/**\n * Filters out not playable variants.\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @return {!Array.<!shakaExtern.Variant>}\n */\nshaka.util.StreamUtils.getPlayableVariants = function(variants) {\n return variants.filter(function(variant) {\n return shaka.util.StreamUtils.isPlayable(variant);\n });\n};\n\n\n/**\n * Chooses variants according to the given config.\n *\n * @param {shakaExtern.Period} period\n * @param {string} preferredLanguage\n * @param {!Object=} opt_languageMatches\n * @param {string=} opt_role\n * @return {!Array.<!shakaExtern.Variant>}\n */\nshaka.util.StreamUtils.filterVariantsByRoleAndLanguage = function(\n period, preferredLanguage, opt_languageMatches, opt_role) {\n var LanguageUtils = shaka.util.LanguageUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var variants = shaka.util.StreamUtils.getPlayableVariants(period.variants);\n\n // Initially choose the first language in the list.\n /** @type {!Array.<!shakaExtern.Variant>} */\n var chosen = variants.filter(function(variant) {\n return variant.language == variants[0].language;\n });\n\n // Prefer primary variants.\n var primaryVariants = variants.filter(function(variant) {\n return variant.primary;\n });\n if (primaryVariants.length) chosen = primaryVariants;\n\n // Choose based on language preference. Favor exact matches, then\n // base matches, finally different subtags. Execute in reverse order so\n // the later steps override the previous ones.\n if (preferredLanguage) {\n var pref = LanguageUtils.normalize(preferredLanguage);\n [LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY,\n LanguageUtils.MatchType.BASE_LANGUAGE_OKAY,\n LanguageUtils.MatchType.EXACT]\n .forEach(function(matchType) {\n var betterLangMatchFound = false;\n variants.forEach(function(variant) {\n pref = LanguageUtils.normalize(pref);\n var lang = LanguageUtils.normalize(variant.language);\n if (LanguageUtils.match(matchType, pref, lang)) {\n if (betterLangMatchFound) {\n chosen.push(variant);\n } else {\n chosen = [variant];\n betterLangMatchFound = true;\n }\n if (opt_languageMatches) {\n opt_languageMatches[ContentType.AUDIO] = true;\n }\n }\n }); // forEach(variant)\n }); // forEach(matchType)\n } // if (preferredLanguage)\n\n // Choose based on role preference. If there's no exact match, return\n // what was chosen based on the language preference.\n var role = opt_role || '';\n if (role) {\n var chosenWithRoles = chosen.filter(function(variant) {\n return (variant.audio && (variant.audio.roles.indexOf(role) > - 1)) ||\n (variant.video && (variant.video.roles.indexOf(role) > - 1));\n });\n if (chosenWithRoles.length) return chosenWithRoles;\n else {\n shaka.log.warning(\n 'No exact match for the role is found. Returning the selection ' +\n 'based on language preference.');\n }\n }\n return chosen;\n};\n\n\n/**\n * Chooses text streams according to the given config.\n *\n * @param {shakaExtern.Period} period\n * @param {string} preferredLanguage\n * @param {!Object=} opt_languageMatches\n * @param {string=} opt_role\n * @return {!Array.<!shakaExtern.Stream>}\n */\nshaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage = function(\n period, preferredLanguage, opt_languageMatches, opt_role) {\n var LanguageUtils = shaka.util.LanguageUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var streams = period.textStreams;\n\n // Choose all the streams.\n /** @type {!Array.<!shakaExtern.Stream>} */\n var chosen = streams;\n\n // Prefer primary text streams.\n var primaryStreams = streams.filter(function(stream) {\n return stream.primary;\n });\n if (primaryStreams.length) chosen = primaryStreams;\n\n // Override based on language preference. Favor exact matches, then\n // base matches, finally different subtags. Execute in reverse order so\n // the later steps override the previous ones.\n if (preferredLanguage) {\n var pref = LanguageUtils.normalize(preferredLanguage);\n [LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY,\n LanguageUtils.MatchType.BASE_LANGUAGE_OKAY,\n LanguageUtils.MatchType.EXACT]\n .forEach(function(matchType) {\n var betterLangMatchFound = false;\n streams.forEach(function(stream) {\n var lang = LanguageUtils.normalize(stream.language);\n if (LanguageUtils.match(matchType, pref, lang)) {\n if (betterLangMatchFound) {\n chosen.push(stream);\n } else {\n chosen = [stream];\n betterLangMatchFound = true;\n }\n if (opt_languageMatches)\n opt_languageMatches[ContentType.TEXT] = true;\n }\n }); // forEach(stream)\n }); // forEach(matchType)\n } // if (preferredLanguage)\n // Choose based on role preference. If there's no exact match, return\n // what was chosen based on the language preference.\n var role = opt_role || '';\n if (role) {\n var chosenWithRoles = chosen.filter(function(stream) {\n return (stream && (stream.roles.indexOf(role) > - 1));\n });\n if (chosenWithRoles.length) return chosenWithRoles;\n else {\n shaka.log.warning(\n 'No exact match for the role is found. Returning the selection ' +\n 'based on language preference.');\n }\n }\n return chosen;\n};\n\n\n/**\n * Finds a Variant with given audio and video streams.\n * Returns null if none was found.\n *\n * @param {?shakaExtern.Stream} audio\n * @param {?shakaExtern.Stream} video\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @return {?shakaExtern.Variant}\n */\nshaka.util.StreamUtils.getVariantByStreams = function(audio, video, variants) {\n for (var i = 0; i < variants.length; i++) {\n if (variants[i].audio == audio && variants[i].video == video)\n return variants[i];\n }\n\n return null;\n};\n\n\n/**\n * Finds a Variant with the given video and audio streams, by stream ID.\n * Returns null if none were found.\n *\n * @param {?number} audioId\n * @param {?number} videoId\n * @param {!Array.<shakaExtern.Variant>} variants\n * @return {?shakaExtern.Variant}\n */\nshaka.util.StreamUtils.getVariantByStreamIds = function(\n audioId, videoId, variants) {\n function matchesId(id, stream) {\n if (id == null)\n return stream == null;\n else\n return stream.id == id;\n }\n\n for (var i = 0; i < variants.length; i++) {\n if (matchesId(audioId, variants[i].audio) &&\n matchesId(videoId, variants[i].video)) {\n return variants[i];\n }\n }\n\n return null;\n};\n\n\n/**\n * Takes a MIME type and optional codecs string and produces the full MIME type.\n *\n * @param {string} mimeType\n * @param {string=} opt_codecs\n * @return {string}\n */\nshaka.util.StreamUtils.getFullMimeType = function(mimeType, opt_codecs) {\n var fullMimeType = mimeType;\n if (opt_codecs) {\n fullMimeType += '; codecs=\"' + opt_codecs + '\"';\n }\n return fullMimeType;\n};\n\n\n/**\n * Gets the index of the Period that contains the given time.\n * @param {shakaExtern.Manifest} manifest\n * @param {number} time The time in seconds from the start of the presentation.\n * @return {number}\n */\nshaka.util.StreamUtils.findPeriodContainingTime = function(manifest, time) {\n for (var i = manifest.periods.length - 1; i > 0; --i) {\n var period = manifest.periods[i];\n if (time >= period.startTime)\n return i;\n }\n return 0;\n};\n\n\n/**\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.Stream} stream\n * @return {number} The index of the Period which contains |stream|, or -1 if\n * no Period contains |stream|.\n */\nshaka.util.StreamUtils.findPeriodContainingStream = function(manifest, stream) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n for (var periodIdx = 0; periodIdx < manifest.periods.length; ++periodIdx) {\n var period = manifest.periods[periodIdx];\n if (stream.type == ContentType.TEXT) {\n for (var j = 0; j < period.textStreams.length; ++j) {\n var textStream = period.textStreams[j];\n if (textStream == stream)\n return periodIdx;\n }\n } else {\n for (var j = 0; j < period.variants.length; ++j) {\n var variant = period.variants[j];\n if (variant.audio == stream || variant.video == stream ||\n (variant.video && variant.video.trickModeVideo == stream)) {\n return periodIdx;\n }\n }\n }\n }\n return -1;\n};\n\n\n/**\n * Gets the rebuffering goal from the manifest and configuration.\n *\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.StreamingConfiguration} config\n * @param {number} scaleFactor\n *\n * @return {number}\n */\nshaka.util.StreamUtils.getRebufferingGoal = function(\n manifest, config, scaleFactor) {\n return scaleFactor *\n Math.max(manifest.minBufferTime || 0, config.rebufferingGoal);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/stream_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.abr.SimpleAbrManager');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.abr.EwmaBandwidthEstimator');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * <p>\n * This defines the default ABR manager for the Player. An instance of this\n * class is used when no ABR manager is given.\n * </p>\n * <p>\n * The behavior of this class is to take throughput samples using\n * segmentDownloaded to estimate the current network bandwidth. Then it will\n * use that to choose the streams that best fit the current bandwidth. It will\n * always pick the highest bandwidth variant it thinks can be played.\n * </p>\n * <p>\n * After the initial choice (in chooseStreams), this class will call\n * switchCallback() when there is a better choice. switchCallback() will not\n * be called more than once per\n * ({@link shaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS}).\n * </p>\n * <p>\n * This does not adapt for text streams, it will always select the first one.\n * </p>\n *\n * @constructor\n * @struct\n * @implements {shakaExtern.AbrManager}\n * @export\n */\nshaka.abr.SimpleAbrManager = function() {\n /** @private {?shakaExtern.AbrManager.SwitchCallback} */\n this.switch_ = null;\n\n /** @private {boolean} */\n this.enabled_ = false;\n\n /** @private {shaka.abr.EwmaBandwidthEstimator} */\n this.bandwidthEstimator_ = new shaka.abr.EwmaBandwidthEstimator();\n\n /**\n * A filtered list of Variants to choose from.\n * @private {!Array.<!shakaExtern.Variant>}\n */\n this.variants_ = [];\n\n /**\n * A filtered list of text streams to choose from.\n * @private {!Array.<!shakaExtern.Stream>}\n */\n this.textStreams_ = [];\n\n /** @private {boolean} */\n this.startupComplete_ = false;\n\n /**\n * The last wall-clock time, in milliseconds, when Streams were chosen via\n * chooseStreams() or switch_().\n *\n * @private {?number}\n */\n this.lastTimeChosenMs_ = null;\n\n /** @private {shakaExtern.Restrictions} */\n this.restrictions_ = {\n minWidth: 0,\n maxWidth: Infinity,\n minHeight: 0,\n maxHeight: Infinity,\n minPixels: 0,\n maxPixels: Infinity,\n minBandwidth: 0,\n maxBandwidth: Infinity\n };\n};\n\n\n/**\n * The minimum amount of time that must pass between switches, in milliseconds.\n * This keeps us from changing too often and annoying the user.\n *\n * @const {number}\n */\nshaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS = 8000;\n\n\n/**\n * The fraction of the estimated bandwidth which we should try to use when\n * upgrading.\n *\n * @private\n * @const {number}\n */\nshaka.abr.SimpleAbrManager.BANDWIDTH_UPGRADE_TARGET_ = 0.85;\n\n\n/**\n * The largest fraction of the estimated bandwidth we should use. We should\n * downgrade to avoid this.\n *\n * @private\n * @const {number}\n */\nshaka.abr.SimpleAbrManager.BANDWIDTH_DOWNGRADE_TARGET_ = 0.95;\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.stop = function() {\n this.switch_ = null;\n this.enabled_ = false;\n this.variants_ = [];\n this.textStreams_ = [];\n this.lastTimeChosenMs_ = null;\n\n // Don't reset |startupComplete_|: if we've left the startup interval then we\n // can start using bandwidth estimates right away if init() is called again.\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.init = function(switchCallback) {\n this.switch_ = switchCallback;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.chooseStreams = function(\n mediaTypesToUpdate) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n // Choose streams for the specific types requested.\n var chosen = {};\n\n if (mediaTypesToUpdate.indexOf(ContentType.AUDIO) > -1 ||\n mediaTypesToUpdate.indexOf(ContentType.VIDEO) > -1) {\n // Choose a new Variant\n var variant = this.chooseVariant_(this.variants_);\n if (variant && variant.video)\n chosen[ContentType.VIDEO] = variant.video;\n\n if (variant && variant.audio)\n chosen[ContentType.AUDIO] = variant.audio;\n }\n\n if (mediaTypesToUpdate.indexOf(ContentType.TEXT) > -1) {\n // We don't adapt text, so just choose stream 0.\n chosen[ContentType.TEXT] = this.textStreams_[0];\n }\n\n this.lastTimeChosenMs_ = Date.now();\n return chosen;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.enable = function() {\n this.enabled_ = true;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.disable = function() {\n this.enabled_ = false;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.segmentDownloaded = function(\n deltaTimeMs, numBytes) {\n shaka.log.v2('Segment downloaded:',\n 'deltaTimeMs=' + deltaTimeMs,\n 'numBytes=' + numBytes);\n goog.asserts.assert(deltaTimeMs >= 0, 'expected a non-negative duration');\n this.bandwidthEstimator_.sample(deltaTimeMs, numBytes);\n\n if ((this.lastTimeChosenMs_ != null) && this.enabled_)\n this.suggestStreams_();\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.getBandwidthEstimate = function() {\n return this.bandwidthEstimator_.getBandwidthEstimate();\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setDefaultEstimate = function(estimate) {\n this.bandwidthEstimator_.setDefaultEstimate(estimate);\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setRestrictions = function(restrictions) {\n this.restrictions_ = restrictions;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setVariants = function(variants) {\n this.variants_ = variants;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setTextStreams = function(streams) {\n this.textStreams_ = streams;\n};\n\n\n/**\n * Calls switch_() with which Streams to switch to.\n *\n * @private\n */\nshaka.abr.SimpleAbrManager.prototype.suggestStreams_ = function() {\n shaka.log.v2('Suggesting Streams...');\n goog.asserts.assert(this.lastTimeChosenMs_ != null,\n 'lastTimeChosenMs_ should not be null');\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n if (!this.startupComplete_) {\n // Check if we've got enough data yet.\n if (!this.bandwidthEstimator_.hasGoodEstimate()) {\n shaka.log.v2('Still waiting for a good estimate...');\n return;\n }\n this.startupComplete_ = true;\n } else {\n // Check if we've left the switch interval.\n var now = Date.now();\n var delta = now - this.lastTimeChosenMs_;\n if (delta < shaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS) {\n shaka.log.v2('Still within switch interval...');\n return;\n }\n }\n\n var chosen = this.chooseStreams([ContentType.AUDIO, ContentType.VIDEO]);\n var currentBandwidthKbps =\n Math.round(this.bandwidthEstimator_.getBandwidthEstimate() / 1000.0);\n shaka.log.debug(\n 'Calling switch_(), bandwidth=' + currentBandwidthKbps + ' kbps');\n // If any of these chosen streams are already chosen, Player will filter them\n // out before passing the choices on to StreamingEngine.\n this.switch_(chosen);\n};\n\n\n/**\n * Chooses a Variant with an optimal bandwidth.\n *\n * @param {!Array.<shakaExtern.Variant>} variants\n * @return {shakaExtern.Variant}\n * @private\n */\nshaka.abr.SimpleAbrManager.prototype.chooseVariant_ = function(variants) {\n // Alias.\n var SimpleAbrManager = shaka.abr.SimpleAbrManager;\n\n // Get sorted Streams.\n var sortedVariants = SimpleAbrManager.filterAndSortVariants_(\n this.restrictions_, variants);\n var currentBandwidth = this.bandwidthEstimator_.getBandwidthEstimate();\n\n if (variants.length && !sortedVariants.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET);\n }\n\n // Start by assuming that we will use the first Stream.\n var chosen = sortedVariants[0];\n\n for (var i = 0; i < sortedVariants.length; ++i) {\n var variant = sortedVariants[i];\n var nextVariant = sortedVariants[i + 1] || {bandwidth: Infinity};\n\n var minBandwidth = variant.bandwidth /\n SimpleAbrManager.BANDWIDTH_DOWNGRADE_TARGET_;\n var maxBandwidth = nextVariant.bandwidth /\n SimpleAbrManager.BANDWIDTH_UPGRADE_TARGET_;\n shaka.log.v2('Bandwidth ranges:',\n (variant.bandwidth / 1e6).toFixed(3),\n (minBandwidth / 1e6).toFixed(3),\n (maxBandwidth / 1e6).toFixed(3));\n\n if (currentBandwidth >= minBandwidth && currentBandwidth <= maxBandwidth)\n chosen = variant;\n }\n\n return chosen;\n};\n\n\n/**\n * @param {shakaExtern.Restrictions} restrictions\n * @param {!Array.<shakaExtern.Variant>} variants\n * @return {!Array.<shakaExtern.Variant>} variants filtered according to\n * |restrictions| and sorted in ascending order of bandwidth.\n * @private\n */\nshaka.abr.SimpleAbrManager.filterAndSortVariants_ = function(\n restrictions, variants) {\n return variants\n .filter(function(variant) {\n return shaka.util.StreamUtils.meetsRestrictions(\n variant, restrictions,\n /* maxHwRes */ {width: Infinity, height: Infinity});\n })\n .sort(function(v1, v2) {\n return v1.bandwidth - v2.bandwidth;\n });\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/abr/simple_abr_manager.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.FakeEvent');\n\n\n\n/**\n * Create an Event work-alike object based on the dictionary.\n * The event should contain all of the same properties from the dict.\n *\n * @param {string} type\n * @param {Object=} opt_dict\n * @constructor\n * @extends {Event}\n */\nshaka.util.FakeEvent = function(type, opt_dict) {\n // Take properties from dict if present.\n var dict = opt_dict || {};\n for (var key in dict) {\n this[key] = dict[key];\n }\n\n\n // These Properties below cannot be set by dict. They are all provided for\n // compatibility with native events.\n\n /** @const {boolean} */\n this.bubbles = false;\n\n /** @type {boolean} */\n this.cancelable = false;\n\n /** @type {boolean} */\n this.defaultPrevented = false;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n this.timeStamp = window.performance && window.performance.now ?\n window.performance.now() : Date.now();\n\n /** @const {string} */\n this.type = type;\n\n /** @const {boolean} */\n this.isTrusted = false;\n\n /** @type {EventTarget} */\n this.currentTarget = null;\n\n /** @type {EventTarget} */\n this.target = null;\n\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n this.stopped = false;\n};\n\n\n/**\n * Prevents the default action of the event. Has no effect if the event isn't\n * cancellable.\n * @override\n */\nshaka.util.FakeEvent.prototype.preventDefault = function() {\n if (this.cancelable)\n this.defaultPrevented = true;\n};\n\n\n/**\n * Stops processing event listeners for this event. Provided for compatibility\n * with native Events.\n * @override\n */\nshaka.util.FakeEvent.prototype.stopImmediatePropagation = function() {\n this.stopped = true;\n};\n\n\n/**\n * Does nothing, since FakeEvents do not bubble. Provided for compatibility\n * with native Events.\n * @override\n */\nshaka.util.FakeEvent.prototype.stopPropagation = function() {};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/fake_event.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastUtils');\n\ngoog.require('shaka.util.FakeEvent');\n\n\n/**\n * @namespace shaka.cast.CastUtils\n * @summary A set of cast utility functions and variables shared between sender\n * and receiver.\n */\n\n\n/**\n * HTMLMediaElement events that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoEvents = [\n 'ended',\n 'play',\n 'playing',\n 'pause',\n 'pausing',\n 'ratechange',\n 'seeked',\n 'seeking',\n 'timeupdate',\n 'volumechange'\n];\n\n\n/**\n * HTMLMediaElement attributes that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoAttributes = [\n 'buffered',\n 'currentTime',\n 'duration',\n 'ended',\n 'loop',\n 'muted',\n 'paused',\n 'playbackRate',\n 'seeking',\n 'videoHeight',\n 'videoWidth',\n 'volume'\n];\n\n\n/**\n * HTMLMediaElement attributes that are transferred when casting begins.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoInitStateAttributes = [\n 'loop',\n 'playbackRate'\n];\n\n\n/**\n * HTMLMediaElement methods with no return value that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoVoidMethods = [\n 'pause',\n 'play'\n];\n\n\n/**\n * Player events that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerEvents = [\n 'adaptation',\n 'buffering',\n 'emsg',\n 'error',\n 'loading',\n 'unloading',\n 'texttrackvisibility',\n 'timelineregionadded',\n 'timelineregionenter',\n 'timelineregionexit',\n 'trackschanged'\n];\n\n\n/**\n * Player getter methods that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerGetterMethods = [\n 'drmInfo',\n 'getAudioLanguages',\n 'getConfiguration',\n 'getExpiration',\n 'getManifestUri',\n 'getPlaybackRate',\n 'getPlayheadTimeAsDate',\n 'getTextLanguages',\n 'getTextTracks',\n 'getTracks',\n 'getStats',\n 'getVariantTracks',\n 'isBuffering',\n 'isInProgress',\n 'isLive',\n 'isTextTrackVisible',\n 'keySystem',\n 'seekRange'\n];\n\n\n/**\n * Player getter and setter methods that are used to transfer state when casting\n * begins.\n * @const {!Array.<!Array.<string>>}\n */\nshaka.cast.CastUtils.PlayerInitState = [\n ['getConfiguration', 'configure']\n];\n\n\n/**\n * Player getter and setter methods that are used to transfer state after\n * after load() is resolved.\n * @const {!Array.<!Array.<string>>}\n */\nshaka.cast.CastUtils.PlayerInitAfterLoadState = [\n ['isTextTrackVisible', 'setTextTrackVisibility']\n];\n\n\n/**\n * Player methods with no return value that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerVoidMethods = [\n 'addTextTrack',\n 'cancelTrickPlay',\n 'configure',\n 'resetConfiguration',\n 'selectAudioLanguage',\n 'selectTextLanguage',\n 'selectTextTrack',\n 'selectTrack',\n 'selectVariantTrack',\n 'setTextTrackVisibility',\n 'trickPlay'\n];\n\n\n/**\n * Player methods returning a Promise that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerPromiseMethods = [\n // The opt_manifestFactory method is not supported.\n 'load',\n 'unload'\n];\n\n\n/**\n * @typedef {{\n * video: Object,\n * player: Object,\n * manifest: ?string,\n * startTime: ?number\n * }}\n * @property {Object} video\n * Dictionary of video properties to be set.\n * @property {Object} player\n * Dictionary of player setters to be called.\n * @property {?string} manifest\n * The currently-selected manifest, if present.\n * @property {?number} startTime\n * The playback start time, if currently playing.\n */\nshaka.cast.CastUtils.InitStateType;\n\n\n/**\n * The namespace for Shaka messages on the cast bus.\n * @const {string}\n */\nshaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE = 'urn:x-cast:com.google.shaka.v2';\n\n\n/**\n * The namespace for generic messages on the cast bus.\n * @const {string}\n */\nshaka.cast.CastUtils.GENERIC_MESSAGE_NAMESPACE =\n 'urn:x-cast:com.google.cast.media';\n\n\n/**\n * Serialize as JSON, but specially encode things JSON will not otherwise\n * represent.\n * @param {?} thing\n * @return {string}\n */\nshaka.cast.CastUtils.serialize = function(thing) {\n return JSON.stringify(thing, function(key, value) {\n if (key == 'manager') {\n // ABR manager can't be serialized.\n return undefined;\n }\n if (typeof value == 'function') {\n // Functions can't be (safely) serialized.\n return undefined;\n }\n if (value instanceof Event || value instanceof shaka.util.FakeEvent) {\n // Events don't serialize to JSON well because of the DOM objects\n // and other complex objects they contain. So we strip these out.\n // Note that using Object.keys or JSON.stringify directly on the event\n // will not capture its properties. We must use a for loop.\n var simpleEvent = {};\n for (var eventKey in value) {\n var eventValue = value[eventKey];\n if (eventValue && typeof eventValue == 'object') {\n // Strip out non-null object types because they are complex and we\n // don't need them.\n } else if (eventKey in Event) {\n // Strip out keys that are found on Event itself because they are\n // class-level constants we don't need, like Event.MOUSEMOVE == 16.\n } else {\n simpleEvent[eventKey] = eventValue;\n }\n }\n return simpleEvent;\n }\n if (value instanceof TimeRanges) {\n // TimeRanges must be unpacked into plain data for serialization.\n return shaka.cast.CastUtils.unpackTimeRanges_(value);\n }\n if (typeof value == 'number') {\n // NaN and infinity cannot be represented directly in JSON.\n if (isNaN(value)) return 'NaN';\n if (isFinite(value)) return value;\n if (value < 0) return '-Infinity';\n return 'Infinity';\n }\n return value;\n });\n};\n\n\n/**\n * Deserialize JSON using our special encodings.\n * @param {string} str\n * @return {?}\n */\nshaka.cast.CastUtils.deserialize = function(str) {\n return JSON.parse(str, function(key, value) {\n if (value == 'NaN') {\n return NaN;\n } else if (value == '-Infinity') {\n return -Infinity;\n } else if (value == 'Infinity') {\n return Infinity;\n } else if (value && typeof value == 'object' &&\n value['__type__'] == 'TimeRanges') {\n // TimeRanges objects have been unpacked and sent as plain data.\n // Simulate the original TimeRanges object.\n return shaka.cast.CastUtils.simulateTimeRanges_(value);\n }\n return value;\n });\n};\n\n\n/**\n * @param {!TimeRanges} ranges\n * @return {Object}\n * @private\n */\nshaka.cast.CastUtils.unpackTimeRanges_ = function(ranges) {\n var obj = {\n '__type__': 'TimeRanges', // a signal to deserialize\n 'length': ranges.length,\n 'start': [],\n 'end': []\n };\n\n for (var i = 0; i < ranges.length; ++i) {\n obj['start'].push(ranges.start(i));\n obj['end'].push(ranges.end(i));\n }\n\n return obj;\n};\n\n\n/**\n * Creates a simulated TimeRanges object from data sent by the cast receiver.\n * @param {?} obj\n * @return {{\n * length: number,\n * start: function(number): number,\n * end: function(number): number\n * }}\n * @private\n */\nshaka.cast.CastUtils.simulateTimeRanges_ = function(obj) {\n return {\n length: obj.length,\n // NOTE: a more complete simulation would throw when |i| was out of range,\n // but for simplicity we will assume a well-behaved application that uses\n // length instead of catch to stop iterating.\n start: function(i) { return obj.start[i]; },\n end: function(i) { return obj.end[i]; }\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastSender');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.cast.CastUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * @constructor\n * @struct\n * @param {string} receiverAppId The ID of the cast receiver application.\n * @param {function()} onStatusChanged A callback invoked when the cast status\n * changes.\n * @param {function(string, !shaka.util.FakeEvent)} onRemoteEvent A callback\n * invoked with target name and event when a remote event is received.\n * @param {function()} onResumeLocal A callback invoked when the local player\n * should resume playback. Called before cached remote state is wiped.\n * @param {function()} onInitStateRequired A callback to get local player's.\n * state. Invoked when casting is initiated from Chrome's cast button.\n * @implements {shaka.util.IDestroyable}\n */\nshaka.cast.CastSender =\n function(receiverAppId, onStatusChanged, onRemoteEvent, onResumeLocal,\n onInitStateRequired) {\n /** @private {string} */\n this.receiverAppId_ = receiverAppId;\n\n /** @private {?function()} */\n this.onStatusChanged_ = onStatusChanged;\n\n /** @private {?function(string, !shaka.util.FakeEvent)} */\n this.onRemoteEvent_ = onRemoteEvent;\n\n /** @private {?function()} */\n this.onResumeLocal_ = onResumeLocal;\n\n /** @private {?function()} */\n this.onInitStateRequired_ = onInitStateRequired;\n\n /** @private {boolean} */\n this.apiReady_ = false;\n\n /** @private {boolean} */\n this.hasReceivers_ = false;\n\n /** @private {boolean} */\n this.isCasting_ = false;\n\n /** @private {string} */\n this.receiverName_ = '';\n\n /** @private {Object} */\n this.appData_ = null;\n\n /** @private {chrome.cast.Session} */\n this.session_ = null;\n\n /** @private {Object} */\n this.cachedProperties_ = {\n 'video': {},\n 'player': {}\n };\n\n /** @private {number} */\n this.nextAsyncCallId_ = 0;\n\n /** @private {Object.<string, !shaka.util.PublicPromise>} */\n this.asyncCallPromises_ = {};\n\n /** @private {shaka.util.PublicPromise} */\n this.castPromise_ = null;\n};\n\n\n/** @override */\nshaka.cast.CastSender.prototype.destroy = function() {\n this.rejectAllPromises_();\n if (this.session_) {\n this.session_.leave(function() {}, function() {});\n this.session_ = null;\n }\n\n this.onStatusChanged_ = null;\n this.onRemoteEvent_ = null;\n this.onResumeLocal_ = null;\n this.apiReady_ = false;\n this.hasReceivers_ = false;\n this.isCasting_ = false;\n this.appData_ = null;\n this.cachedProperties_ = null;\n this.asyncCallPromises_ = null;\n this.castPromise_ = null;\n\n return Promise.resolve();\n};\n\n\n/**\n * @return {boolean} True if the cast API is available.\n */\nshaka.cast.CastSender.prototype.apiReady = function() {\n return this.apiReady_;\n};\n\n\n/**\n * @return {boolean} True if there are receivers.\n */\nshaka.cast.CastSender.prototype.hasReceivers = function() {\n return this.hasReceivers_;\n};\n\n\n/**\n * @return {boolean} True if we are currently casting.\n */\nshaka.cast.CastSender.prototype.isCasting = function() {\n return this.isCasting_;\n};\n\n\n/**\n * @return {string} The name of the Cast receiver device, if isCasting().\n */\nshaka.cast.CastSender.prototype.receiverName = function() {\n return this.receiverName_;\n};\n\n\n/**\n * @return {boolean} True if we have a cache of remote properties from the\n * receiver.\n */\nshaka.cast.CastSender.prototype.hasRemoteProperties = function() {\n return Object.keys(this.cachedProperties_['video']).length != 0;\n};\n\n\n/**\n * Initialize the Cast API.\n */\nshaka.cast.CastSender.prototype.init = function() {\n // Check for the cast extension.\n if (!window.chrome || !chrome.cast || !chrome.cast.isAvailable) {\n // Not available yet, so wait to be notified if/when it is available.\n window.__onGCastApiAvailable = (function(loaded) {\n if (loaded) {\n this.init();\n }\n }).bind(this);\n return;\n }\n\n // The API is now available.\n delete window.__onGCastApiAvailable;\n this.apiReady_ = true;\n this.onStatusChanged_();\n\n var sessionRequest = new chrome.cast.SessionRequest(this.receiverAppId_);\n var apiConfig = new chrome.cast.ApiConfig(sessionRequest,\n this.onExistingSessionJoined_.bind(this),\n this.onReceiverStatusChanged_.bind(this),\n 'origin_scoped');\n\n // TODO: have never seen this fail. when would it and how should we react?\n chrome.cast.initialize(apiConfig,\n function() { shaka.log.debug('CastSender: init'); },\n function(error) { shaka.log.error('CastSender: init error', error); });\n};\n\n\n/**\n * Set application-specific data.\n *\n * @param {Object} appData Application-specific data to relay to the receiver.\n */\nshaka.cast.CastSender.prototype.setAppData = function(appData) {\n this.appData_ = appData;\n if (this.isCasting_) {\n this.sendMessage_({\n 'type': 'appData',\n 'appData': this.appData_\n });\n }\n};\n\n\n/**\n * @param {shaka.cast.CastUtils.InitStateType} initState Video and player state\n * to be sent to the receiver.\n * @return {!Promise} Resolved when connected to a receiver. Rejected if the\n * connection fails or is canceled by the user.\n */\nshaka.cast.CastSender.prototype.cast = function(initState) {\n if (!this.apiReady_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.CAST,\n shaka.util.Error.Code.CAST_API_UNAVAILABLE));\n }\n if (!this.hasReceivers_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.CAST,\n shaka.util.Error.Code.NO_CAST_RECEIVERS));\n }\n if (this.isCasting_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.CAST,\n shaka.util.Error.Code.ALREADY_CASTING));\n }\n\n this.castPromise_ = new shaka.util.PublicPromise();\n chrome.cast.requestSession(\n this.onSessionInitiated_.bind(this, initState),\n this.onConnectionError_.bind(this));\n return this.castPromise_;\n};\n\n\n/**\n * Shows user a cast dialog where they can choose to stop\n * casting. Relies on Chrome to perform disconnect if they do.\n * Doesn't do anything if not connected.\n */\nshaka.cast.CastSender.prototype.showDisconnectDialog = function() {\n if (!this.isCasting_) {\n return;\n }\n var initState = this.onInitStateRequired_();\n\n chrome.cast.requestSession(\n this.onSessionInitiated_.bind(this, initState),\n this.onConnectionError_.bind(this));\n};\n\n\n/**\n * Forces the receiver app to shut down by disconnecting. Does nothing if not\n * connected.\n */\nshaka.cast.CastSender.prototype.forceDisconnect = function() {\n if (!this.isCasting_) {\n return;\n }\n\n this.rejectAllPromises_();\n if (this.session_) {\n this.session_.stop(function() {}, function() {});\n this.session_ = null;\n }\n};\n\n\n/**\n * Getter for properties of remote objects.\n * @param {string} targetName\n * @param {string} property\n * @return {?}\n */\nshaka.cast.CastSender.prototype.get = function(targetName, property) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n if (targetName == 'video') {\n if (shaka.cast.CastUtils.VideoVoidMethods.indexOf(property) >= 0) {\n return this.remoteCall_.bind(this, targetName, property);\n }\n } else if (targetName == 'player') {\n if (shaka.cast.CastUtils.PlayerVoidMethods.indexOf(property) >= 0) {\n return this.remoteCall_.bind(this, targetName, property);\n }\n if (shaka.cast.CastUtils.PlayerPromiseMethods.indexOf(property) >= 0) {\n return this.remoteAsyncCall_.bind(this, targetName, property);\n }\n if (shaka.cast.CastUtils.PlayerGetterMethods.indexOf(property) >= 0) {\n return this.propertyGetter_.bind(this, targetName, property);\n }\n }\n\n return this.propertyGetter_(targetName, property);\n};\n\n\n/**\n * Setter for properties of remote objects.\n * @param {string} targetName\n * @param {string} property\n * @param {?} value\n */\nshaka.cast.CastSender.prototype.set = function(targetName, property, value) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n\n this.cachedProperties_[targetName][property] = value;\n this.sendMessage_({\n 'type': 'set',\n 'targetName': targetName,\n 'property': property,\n 'value': value\n });\n};\n\n\n/**\n * @param {shaka.cast.CastUtils.InitStateType} initState\n * @param {chrome.cast.Session} session\n * @private\n */\nshaka.cast.CastSender.prototype.onSessionInitiated_ =\n function(initState, session) {\n shaka.log.debug('CastSender: onSessionInitiated');\n this.onSessionCreated_(session);\n\n this.sendMessage_({\n 'type': 'init',\n 'initState': initState,\n 'appData': this.appData_\n });\n\n this.castPromise_.resolve();\n};\n\n\n/**\n * @param {chrome.cast.Error} error\n * @private\n */\nshaka.cast.CastSender.prototype.onConnectionError_ = function(error) {\n // Default error code:\n var code = shaka.util.Error.Code.UNEXPECTED_CAST_ERROR;\n\n switch (error.code) {\n case 'cancel':\n code = shaka.util.Error.Code.CAST_CANCELED_BY_USER;\n break;\n case 'timeout':\n code = shaka.util.Error.Code.CAST_CONNECTION_TIMED_OUT;\n break;\n case 'receiver_unavailable':\n code = shaka.util.Error.Code.CAST_RECEIVER_APP_UNAVAILABLE;\n break;\n }\n\n this.castPromise_.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.CAST,\n code,\n error));\n};\n\n\n/**\n * @param {string} targetName\n * @param {string} property\n * @return {?}\n * @private\n */\nshaka.cast.CastSender.prototype.propertyGetter_ =\n function(targetName, property) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n return this.cachedProperties_[targetName][property];\n};\n\n\n/**\n * @param {string} targetName\n * @param {string} methodName\n * @private\n */\nshaka.cast.CastSender.prototype.remoteCall_ =\n function(targetName, methodName) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n var args = Array.prototype.slice.call(arguments, 2);\n this.sendMessage_({\n 'type': 'call',\n 'targetName': targetName,\n 'methodName': methodName,\n 'args': args\n });\n};\n\n\n/**\n * @param {string} targetName\n * @param {string} methodName\n * @return {!Promise}\n * @private\n */\nshaka.cast.CastSender.prototype.remoteAsyncCall_ =\n function(targetName, methodName) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n var args = Array.prototype.slice.call(arguments, 2);\n\n var p = new shaka.util.PublicPromise();\n var id = this.nextAsyncCallId_.toString();\n this.nextAsyncCallId_++;\n this.asyncCallPromises_[id] = p;\n\n this.sendMessage_({\n 'type': 'asyncCall',\n 'targetName': targetName,\n 'methodName': methodName,\n 'args': args,\n 'id': id\n });\n return p;\n};\n\n\n/**\n * @param {chrome.cast.Session} session\n * @private\n */\nshaka.cast.CastSender.prototype.onExistingSessionJoined_ = function(session) {\n shaka.log.debug('CastSender: onExistingSessionJoined');\n\n var initState = this.onInitStateRequired_();\n\n this.castPromise_ = new shaka.util.PublicPromise();\n\n this.onSessionInitiated_(initState, session);\n};\n\n\n/**\n * @param {string} availability\n * @private\n */\nshaka.cast.CastSender.prototype.onReceiverStatusChanged_ =\n function(availability) {\n // The cast extension is telling us whether there are any cast receiver\n // devices available.\n shaka.log.debug('CastSender: receiver status', availability);\n this.hasReceivers_ = availability == 'available';\n this.onStatusChanged_();\n};\n\n\n/**\n * @param {chrome.cast.Session} session\n * @private\n */\nshaka.cast.CastSender.prototype.onSessionCreated_ = function(session) {\n this.session_ = session;\n this.session_.addUpdateListener(this.onConnectionStatusChanged_.bind(this));\n this.session_.addMessageListener(\n shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE,\n this.onMessageReceived_.bind(this));\n this.onConnectionStatusChanged_();\n};\n\n\n/**\n * @private\n */\nshaka.cast.CastSender.prototype.onConnectionStatusChanged_ = function() {\n var connected = this.session_ ? this.session_.status == 'connected' : false;\n shaka.log.debug('CastSender: connection status', connected);\n if (this.isCasting_ && !connected) {\n // Tell CastProxy to transfer state back to local player.\n this.onResumeLocal_();\n\n // Clear whatever we have cached.\n for (var targetName in this.cachedProperties_) {\n this.cachedProperties_[targetName] = {};\n }\n\n this.rejectAllPromises_();\n }\n\n this.isCasting_ = connected;\n this.receiverName_ = connected ? this.session_.receiver.friendlyName : '';\n this.onStatusChanged_();\n};\n\n\n/**\n * Reject any async call promises that are still pending.\n * @private\n */\nshaka.cast.CastSender.prototype.rejectAllPromises_ = function() {\n for (var id in this.asyncCallPromises_) {\n var p = this.asyncCallPromises_[id];\n delete this.asyncCallPromises_[id];\n\n // Reject pending async operations as if they were interrupted.\n // At the moment, load() is the only async operation we are worried\n // about.\n p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.PLAYER,\n shaka.util.Error.Code.LOAD_INTERRUPTED));\n }\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages are\n * read with quoted properties.\n * @param {string} namespace\n * @param {string} serialized\n * @private\n */\nshaka.cast.CastSender.prototype.onMessageReceived_ =\n function(namespace, serialized) {\n var message = shaka.cast.CastUtils.deserialize(serialized);\n shaka.log.v2('CastSender: message', message);\n\n switch (message['type']) {\n case 'event':\n var targetName = message['targetName'];\n var event = message['event'];\n var fakeEvent = new shaka.util.FakeEvent(event['type'], event);\n this.onRemoteEvent_(targetName, fakeEvent);\n break;\n case 'update':\n var update = message['update'];\n for (var targetName in update) {\n var target = this.cachedProperties_[targetName] || {};\n for (var property in update[targetName]) {\n target[property] = update[targetName][property];\n }\n }\n break;\n case 'asyncComplete':\n var id = message['id'];\n var error = message['error'];\n var p = this.asyncCallPromises_[id];\n delete this.asyncCallPromises_[id];\n\n goog.asserts.assert(p, 'Unexpected async id');\n if (!p) break;\n\n if (error) {\n // This is a hacky way to reconstruct the serialized error.\n var reconstructedError = new shaka.util.Error(\n error.severity, error.category, error.code);\n for (var k in error) {\n (/** @type {Object} */(reconstructedError))[k] = error[k];\n }\n p.reject(reconstructedError);\n } else {\n p.resolve();\n }\n break;\n }\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages passed\n * in here were created with quoted property names.\n * @param {!Object} message\n * @private\n */\nshaka.cast.CastSender.prototype.sendMessage_ = function(message) {\n var serialized = shaka.cast.CastUtils.serialize(message);\n // TODO: have never seen this fail. When would it and how should we react?\n this.session_.sendMessage(shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE,\n serialized,\n function() {}, // success callback\n shaka.log.error); // error callback\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_sender.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.FakeEventTarget');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.MultiMap');\n\n\n\n/**\n * A work-alike for EventTarget. Only DOM elements may be true EventTargets,\n * but this can be used as a base class to provide event dispatch to non-DOM\n * classes. Only FakeEvents should be dispatched.\n *\n * @struct\n * @constructor\n * @implements {EventTarget}\n * @exportInterface\n */\nshaka.util.FakeEventTarget = function() {\n /**\n * @private {!shaka.util.MultiMap.<shaka.util.FakeEventTarget.ListenerType>}\n */\n this.listeners_ = new shaka.util.MultiMap();\n\n /**\n * The target of all dispatched events. Defaults to |this|.\n * @type {EventTarget}\n */\n this.dispatchTarget = this;\n};\n\n\n/**\n * These are the listener types defined in the closure extern for EventTarget.\n * @typedef {EventListener|function(!Event):(boolean|undefined)}\n * @exportInterface\n */\nshaka.util.FakeEventTarget.ListenerType;\n\n\n/**\n * Add an event listener to this object.\n *\n * @param {string} type The event type to listen for.\n * @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or\n * listener object to invoke.\n * @param {(EventListenerOptions|boolean)=} opt_options Ignored.\n * @override\n * @exportInterface\n */\nshaka.util.FakeEventTarget.prototype.addEventListener =\n function(type, listener, opt_options) {\n this.listeners_.push(type, listener);\n};\n\n\n/**\n * Remove an event listener from this object.\n *\n * @param {string} type The event type for which you wish to remove a listener.\n * @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or\n * listener object to remove.\n * @param {(EventListenerOptions|boolean)=} opt_options Ignored.\n * @override\n * @exportInterface\n */\nshaka.util.FakeEventTarget.prototype.removeEventListener =\n function(type, listener, opt_options) {\n this.listeners_.remove(type, listener);\n};\n\n\n/**\n * Dispatch an event from this object.\n *\n * @param {!Event} event The event to be dispatched from this object.\n * @return {boolean} True if the default action was prevented.\n * @override\n * @exportInterface\n */\nshaka.util.FakeEventTarget.prototype.dispatchEvent = function(event) {\n // In many browsers, it is complex to overwrite properties of actual Events.\n // Here we expect only to dispatch FakeEvents, which are simpler.\n goog.asserts.assert(event instanceof shaka.util.FakeEvent,\n 'FakeEventTarget can only dispatch FakeEvents!');\n\n var list = this.listeners_.get(event.type) || [];\n\n for (var i = 0; i < list.length; ++i) {\n // Do this every time, since events can be re-dispatched from handlers.\n event.target = this.dispatchTarget;\n event.currentTarget = this.dispatchTarget;\n\n var listener = list[i];\n try {\n if (listener.handleEvent) {\n listener.handleEvent(event);\n } else {\n listener.call(this, event);\n }\n } catch (exception) {\n // Exceptions during event handlers should not affect the caller,\n // but should appear on the console as uncaught, according to MDN:\n // http://goo.gl/N6Ff27\n shaka.log.error('Uncaught exception in event handler', exception);\n }\n\n if (event.stopped) {\n break;\n }\n }\n\n return event.defaultPrevented;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/fake_event_target.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastReceiver');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.cast.CastUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.IDestroyable');\n\n\n\n/**\n * A receiver to communicate between the Chromecast-hosted player and the\n * sender application.\n *\n * @constructor\n * @struct\n * @param {!HTMLMediaElement} video The local video element associated with the\n * local Player instance.\n * @param {!shaka.Player} player A local Player instance.\n * @param {function(Object)=} opt_appDataCallback A callback to handle\n * application-specific data passed from the sender.\n * @param {function(string):string=} opt_contentIdCallback A callback to\n * retrieve manifest URI from the provided content id.\n * @implements {shaka.util.IDestroyable}\n * @extends {shaka.util.FakeEventTarget}\n * @export\n */\nshaka.cast.CastReceiver =\n function(video, player, opt_appDataCallback, opt_contentIdCallback) {\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {shaka.Player} */\n this.player_ = player;\n\n /** @private {Object} */\n this.targets_ = {\n 'video': video,\n 'player': player\n };\n\n /** @private {?function(Object)} */\n this.appDataCallback_ = opt_appDataCallback || function() {};\n\n /** @private {?function(string):string} */\n this.opt_contentIdCallback_ = opt_contentIdCallback ||\n /** @param {string} contentId\n @return {string} */\n function(contentId) { return contentId; };\n\n /** @private {boolean} */\n this.isConnected_ = false;\n\n /** @private {boolean} */\n this.isIdle_ = true;\n\n /** @private {cast.receiver.CastMessageBus} */\n this.shakaBus_ = null;\n\n /** @private {cast.receiver.CastMessageBus} */\n this.genericBus_ = null;\n\n /** @private {?number} */\n this.pollTimerId_ = null;\n\n this.init_();\n};\ngoog.inherits(shaka.cast.CastReceiver, shaka.util.FakeEventTarget);\n\n\n/**\n * @return {boolean} True if the cast API is available and there are receivers.\n * @export\n */\nshaka.cast.CastReceiver.prototype.isConnected = function() {\n return this.isConnected_;\n};\n\n\n/**\n * @return {boolean} True if the receiver is not currently doing loading or\n * playing anything.\n * @export\n */\nshaka.cast.CastReceiver.prototype.isIdle = function() {\n return this.isIdle_;\n};\n\n\n/**\n * Destroys the underlying Player, then terminates the cast receiver app.\n *\n * @override\n * @export\n */\nshaka.cast.CastReceiver.prototype.destroy = function() {\n var p = this.player_ ? this.player_.destroy() : Promise.resolve();\n\n if (this.pollTimerId_ != null) {\n window.clearTimeout(this.pollTimerId_);\n }\n\n this.video_ = null;\n this.player_ = null;\n this.targets_ = null;\n this.appDataCallback_ = null;\n this.isConnected_ = false;\n this.isIdle_ = true;\n this.shakaBus_ = null;\n this.genericBus_ = null;\n this.pollTimerId_ = null;\n\n return p.then(function() {\n var manager = cast.receiver.CastReceiverManager.getInstance();\n manager.stop();\n });\n};\n\n\n/** @private */\nshaka.cast.CastReceiver.prototype.init_ = function() {\n var manager = cast.receiver.CastReceiverManager.getInstance();\n manager.onSenderConnected = this.onSendersChanged_.bind(this);\n manager.onSenderDisconnected = this.onSendersChanged_.bind(this);\n manager.onSystemVolumeChanged = this.fakeVolumeChangeEvent_.bind(this);\n\n this.genericBus_ = manager.getCastMessageBus(\n shaka.cast.CastUtils.GENERIC_MESSAGE_NAMESPACE);\n this.genericBus_.onMessage = this.onGenericMessage_.bind(this);\n\n this.shakaBus_ = manager.getCastMessageBus(\n shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE);\n this.shakaBus_.onMessage = this.onShakaMessage_.bind(this);\n\n if (!COMPILED) {\n // Sometimes it is useful to load the receiver app in Chrome to work on the\n // UI. To avoid log spam caused by the SDK trying to connect to web sockets\n // that don't exist, in uncompiled mode we check if the hosting browser is a\n // Chromecast before starting the receiver manager. We wouldn't do browser\n // detection except for debugging, so only do this in uncompiled mode.\n var isChromecast = navigator.userAgent.indexOf('CrKey') >= 0;\n if (isChromecast) {\n manager.start();\n }\n } else {\n manager.start();\n }\n\n shaka.cast.CastUtils.VideoEvents.forEach(function(name) {\n this.video_.addEventListener(name, this.proxyEvent_.bind(this, 'video'));\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerEvents.forEach(function(name) {\n this.player_.addEventListener(name, this.proxyEvent_.bind(this, 'player'));\n }.bind(this));\n\n // In our tests, the original Chromecast seems to have trouble decoding above\n // 1080p. It would be a waste to select a higher res anyway, given that the\n // device only outputs 1080p to begin with.\n\n // Chromecast has an extension to query the device/display's resolution.\n if (cast.__platform__ && cast.__platform__.canDisplayType(\n 'video/mp4; codecs=\"avc1.640028\"; width=3840; height=2160')) {\n // The device & display can both do 4k. Assume a 4k limit.\n this.player_.setMaxHardwareResolution(3840, 2160);\n } else {\n // Chromecast has always been able to do 1080p. Assume a 1080p limit.\n this.player_.setMaxHardwareResolution(1920, 1080);\n }\n\n // Maintain idle state.\n this.player_.addEventListener('loading', function() {\n // No longer idle once loading. This allows us to show the spinner during\n // the initial buffering phase.\n this.isIdle_ = false;\n this.onCastStatusChanged_();\n }.bind(this));\n this.video_.addEventListener('playing', function() {\n // No longer idle once playing. This allows us to replay a video without\n // reloading.\n this.isIdle_ = false;\n this.onCastStatusChanged_();\n }.bind(this));\n this.video_.addEventListener('pause', function() {\n this.onCastStatusChanged_();\n }.bind(this));\n this.player_.addEventListener('unloading', function() {\n // Go idle when unloading content.\n this.isIdle_ = true;\n this.onCastStatusChanged_();\n }.bind(this));\n this.video_.addEventListener('ended', function() {\n // Go idle 5 seconds after 'ended', assuming we haven't started again or\n // been destroyed.\n window.setTimeout(function() {\n if (this.video_ && this.video_.ended) {\n this.isIdle_ = true;\n this.onCastStatusChanged_();\n }\n }.bind(this), 5000);\n }.bind(this));\n\n // Do not start polling until after the sender's 'init' message is handled.\n};\n\n\n/** @private */\nshaka.cast.CastReceiver.prototype.onSendersChanged_ = function() {\n var manager = cast.receiver.CastReceiverManager.getInstance();\n this.isConnected_ = manager.getSenders().length != 0;\n this.onCastStatusChanged_();\n};\n\n\n/**\n * Dispatch an event to notify the receiver app that the status has changed.\n * @private\n */\nshaka.cast.CastReceiver.prototype.onCastStatusChanged_ = function() {\n // Do this asynchronously so that synchronous changes to idle state (such as\n // Player calling unload() as part of load()) are coalesced before the event\n // goes out.\n Promise.resolve().then(function() {\n var event = new shaka.util.FakeEvent('caststatuschanged');\n this.dispatchEvent(event);\n this.sendMediaStatus_(0);\n }.bind(this));\n};\n\n\n/**\n * Take on initial state from the sender.\n * @param {shaka.cast.CastUtils.InitStateType} initState\n * @param {Object} appData\n * @private\n */\nshaka.cast.CastReceiver.prototype.initState_ = function(initState, appData) {\n // Take on player state first.\n for (var k in initState['player']) {\n var v = initState['player'][k];\n // All player state vars are setters to be called.\n /** @type {Object} */(this.player_)[k](v);\n }\n\n // Now process custom app data, which may add additional player configs:\n this.appDataCallback_(appData);\n\n var manifestReady = Promise.resolve();\n var autoplay = this.video_.autoplay;\n\n // Now load the manifest, if present.\n if (initState['manifest']) {\n // Don't autoplay the content until we finish setting up initial state.\n this.video_.autoplay = false;\n manifestReady = this.player_.load(\n initState['manifest'], initState['startTime']);\n // Pass any errors through to the app.\n manifestReady.catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong error type!');\n var event = new shaka.util.FakeEvent('error', { 'detail': error });\n this.player_.dispatchEvent(event);\n }.bind(this));\n }\n\n // Finally, take on video state and player's \"after load\" state.\n manifestReady.then(function() {\n for (var k in initState['video']) {\n var v = initState['video'][k];\n this.video_[k] = v;\n }\n\n for (var k in initState['playerAfterLoad']) {\n var v = initState['playerAfterLoad'][k];\n // All player state vars are setters to be called.\n /** @type {Object} */(this.player_)[k](v);\n }\n\n // Restore original autoplay setting.\n this.video_.autoplay = autoplay;\n if (initState['manifest']) {\n // Resume playback with transferred state.\n this.video_.play();\n // Notify generic controllers of the state change.\n this.sendMediaStatus_(0);\n }\n }.bind(this));\n};\n\n\n/**\n * @param {string} targetName\n * @param {!Event} event\n * @private\n */\nshaka.cast.CastReceiver.prototype.proxyEvent_ = function(targetName, event) {\n // Poll and send an update right before we send the event. Some events\n // indicate an attribute change, so that change should be visible when the\n // event is handled.\n this.pollAttributes_();\n\n this.sendMessage_({\n 'type': 'event',\n 'targetName': targetName,\n 'event': event\n }, this.shakaBus_);\n};\n\n\n/** @private */\nshaka.cast.CastReceiver.prototype.pollAttributes_ = function() {\n // The poll timer may have been pre-empted by an event.\n // To avoid polling too often, we clear it here.\n if (this.pollTimerId_ != null) {\n window.clearTimeout(this.pollTimerId_);\n }\n // Since we know the timer has been cleared, start a new one now.\n // This will be preempted by events, including 'timeupdate'.\n this.pollTimerId_ = window.setTimeout(this.pollAttributes_.bind(this), 500);\n\n var update = {\n 'video': {},\n 'player': {}\n };\n\n shaka.cast.CastUtils.VideoAttributes.forEach(function(name) {\n update['video'][name] = this.video_[name];\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerGetterMethods.forEach(function(name) {\n update['player'][name] = /** @type {Object} */(this.player_)[name]();\n }.bind(this));\n\n // Volume attributes are tied to the system volume.\n var manager = cast.receiver.CastReceiverManager.getInstance();\n var systemVolume = manager.getSystemVolume();\n if (systemVolume) {\n update['video']['volume'] = systemVolume.level;\n update['video']['muted'] = systemVolume.muted;\n }\n\n this.sendMessage_({\n 'type': 'update',\n 'update': update\n }, this.shakaBus_);\n};\n\n\n/**\n * Dispatch a fake 'volumechange' event to mimic the video element, since volume\n * changes are routed to the system volume on the receiver.\n * @private\n */\nshaka.cast.CastReceiver.prototype.fakeVolumeChangeEvent_ = function() {\n // Volume attributes are tied to the system volume.\n var manager = cast.receiver.CastReceiverManager.getInstance();\n var systemVolume = manager.getSystemVolume();\n goog.asserts.assert(systemVolume, 'System volume should not be null!');\n\n if (systemVolume) {\n // Send an update message with just the latest volume level and muted state.\n this.sendMessage_({\n 'type': 'update',\n 'update': {\n 'video': {\n 'volume': systemVolume.level,\n 'muted': systemVolume.muted\n }\n }\n }, this.shakaBus_);\n }\n\n // Send another message with a 'volumechange' event to update the sender's UI.\n this.sendMessage_({\n 'type': 'event',\n 'targetName': 'video',\n 'event': {'type': 'volumechange'}\n }, this.shakaBus_);\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages are\n * read with quoted properties.\n * @param {cast.receiver.CastMessageBus.Event} event\n * @private\n */\nshaka.cast.CastReceiver.prototype.onShakaMessage_ = function(event) {\n var message = shaka.cast.CastUtils.deserialize(event.data);\n shaka.log.debug('CastReceiver: message', message);\n\n switch (message['type']) {\n case 'init':\n this.initState_(message['initState'], message['appData']);\n // The sender is supposed to reflect the cast system volume after\n // connecting. Using fakeVolumeChangeEvent_() would create a race on the\n // sender side, since it would have volume properties, but no others.\n // This would lead to hasRemoteProperties() being true, even though a\n // complete set had never been sent.\n // Now that we have init state, this is a good time for the first update\n // message anyway.\n this.pollAttributes_();\n break;\n case 'appData':\n this.appDataCallback_(message['appData']);\n break;\n case 'set':\n var targetName = message['targetName'];\n var property = message['property'];\n var value = message['value'];\n\n if (targetName == 'video') {\n // Volume attributes must be rerouted to the system.\n var manager = cast.receiver.CastReceiverManager.getInstance();\n if (property == 'volume') {\n manager.setSystemVolumeLevel(value);\n break;\n } else if (property == 'muted') {\n manager.setSystemVolumeMuted(value);\n break;\n }\n }\n\n this.targets_[targetName][property] = value;\n break;\n case 'call':\n var targetName = message['targetName'];\n var methodName = message['methodName'];\n var args = message['args'];\n var target = this.targets_[targetName];\n target[methodName].apply(target, args);\n break;\n case 'asyncCall':\n var targetName = message['targetName'];\n var methodName = message['methodName'];\n var args = message['args'];\n var id = message['id'];\n var senderId = event.senderId;\n var target = this.targets_[targetName];\n var p = target[methodName].apply(target, args);\n // Replies must go back to the specific sender who initiated, so that we\n // don't have to deal with conflicting IDs between senders.\n p.then(this.sendAsyncComplete_.bind(this, senderId, id, /* error */ null),\n this.sendAsyncComplete_.bind(this, senderId, id));\n break;\n }\n};\n\n\n/**\n * @param {cast.receiver.CastMessageBus.Event} event\n * @private\n */\nshaka.cast.CastReceiver.prototype.onGenericMessage_ = function(event) {\n var message = shaka.cast.CastUtils.deserialize(event.data);\n shaka.log.debug('CastReceiver: message', message);\n // TODO(ismena): error message on duplicate request id from the same sender\n switch (message['type']) {\n case 'PLAY':\n this.video_.play();\n // Notify generic controllers that the player state changed.\n // requestId=0 (the parameter) means that the message was not\n // triggered by a GET_STATUS request.\n this.sendMediaStatus_(0);\n break;\n case 'PAUSE':\n this.video_.pause();\n this.sendMediaStatus_(0);\n break;\n case 'SEEK':\n var currentTime = message['currentTime'];\n var resumeState = message['resumeState'];\n if (currentTime != null)\n this.video_.currentTime = Number(currentTime);\n if (resumeState && resumeState == 'PLAYBACK_START') {\n this.video_.play();\n this.sendMediaStatus_(0);\n } else if (resumeState && resumeState == 'PLAYBACK_PAUSE') {\n this.video_.pause();\n this.sendMediaStatus_(0);\n }\n break;\n case 'STOP':\n this.player_.unload().then(function() {\n this.sendMediaStatus_(0);\n }.bind(this));\n break;\n case 'GET_STATUS':\n // TODO(ismena): According to the SDK this is supposed to be a\n // unicast message to the sender that requested the status,\n // but it doesn't appear to be working.\n // Look into what's going on there and change this to be a\n // unicast.\n this.sendMediaStatus_(Number(message['requestId']));\n break;\n case 'VOLUME':\n var volumeObject = message['volume'];\n var level = volumeObject['level'];\n var muted = volumeObject['muted'];\n var oldVolumeLevel = this.video_.volume;\n var oldVolumeMuted = this.video_.muted;\n if (level != null)\n this.video_.volume = Number(level);\n if (muted != null)\n this.video_.muted = muted;\n // Notify generic controllers if the volume changed.\n if (oldVolumeLevel != this.video_.volume ||\n oldVolumeMuted != this.video_.muted) {\n this.sendMediaStatus_(0);\n }\n break;\n case 'LOAD':\n var mediaInfo = message['media'];\n var contentId = mediaInfo['contentId'];\n var currentTime = message['currentTime'];\n var manifestUri = this.opt_contentIdCallback_(contentId);\n var autoplay = message['autoplay'] || true;\n if (autoplay)\n this.video_.autoplay = true;\n this.player_.load(manifestUri, currentTime).then(function() {\n // Notify generic controllers that the media has changed.\n var media = {\n 'contentId': manifestUri,\n 'streamType': this.player_.isLive() ? 'LIVE' : 'BUFFERED',\n // TODO: Is there a use case when this would be required?\n // Sending an empty string for now since it's a mandatory\n // field.\n 'contentType': ''\n };\n this.sendMediaStatus_(0, media);\n }.bind(this)).catch(function(error) {\n // Load failed. Dispatch the error message to the sender.\n var type = 'LOAD_FAILED';\n if (error.category == shaka.util.Error.Category.PLAYER &&\n error.code == shaka.util.Error.Code.LOAD_INTERRUPTED) {\n type = 'LOAD_CANCELLED';\n }\n\n this.sendMessage_({\n 'requestId': Number(message['requestId']),\n 'type': type\n }, this.genericBus_);\n }.bind(this));\n break;\n default:\n shaka.log.warning(\n 'Unrecognized message type from the generic Chromecast controller!',\n message['type']);\n // Dispatch an error to the sender.\n this.sendMessage_({\n 'requestId': Number(message['requestId']),\n 'type': 'INVALID_REQUEST',\n 'reason': 'INVALID_COMMAND'\n }, this.genericBus_);\n break;\n }\n};\n\n\n/**\n * Tell the sender that the async operation is complete.\n * @param {string} senderId\n * @param {string} id\n * @param {shaka.util.Error} error\n * @private\n */\nshaka.cast.CastReceiver.prototype.sendAsyncComplete_ =\n function(senderId, id, error) {\n this.sendMessage_({\n 'type': 'asyncComplete',\n 'id': id,\n 'error': error\n }, this.shakaBus_, senderId);\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages passed\n * in here were created with quoted property names.\n * @param {!Object} message\n * @param {cast.receiver.CastMessageBus} bus\n * @param {string=} opt_senderId\n * @private\n */\nshaka.cast.CastReceiver.prototype.sendMessage_ =\n function(message, bus, opt_senderId) {\n // Cuts log spam when debugging the receiver UI in Chrome.\n if (!this.isConnected_) return;\n\n var serialized = shaka.cast.CastUtils.serialize(message);\n if (opt_senderId) {\n bus.getCastChannel(opt_senderId).send(serialized);\n } else {\n bus.broadcast(serialized);\n }\n};\n\n\n/**\n * @return {string}\n * @private\n */\nshaka.cast.CastReceiver.prototype.getPlayState_ = function() {\n var playState = shaka.cast.CastReceiver.PLAY_STATE;\n if (this.isIdle_)\n return playState.IDLE;\n else if (this.player_.isBuffering())\n return playState.BUFFERING;\n else if (this.video_.paused)\n return playState.PAUSED;\n else\n return playState.PLAYING;\n};\n\n\n/**\n * @param {number} requestId\n * @param {Object=} opt_media\n * @private\n */\nshaka.cast.CastReceiver.prototype.sendMediaStatus_ =\n function(requestId, opt_media) {\n var mediaStatus = {\n // mediaSessionId is a unique ID for the playback of this specific session.\n // It's used to identify a specific instance of a playback.\n // We don't support multiple playbacks, so just return 0.\n 'mediaSessionId': 0,\n 'playbackRate': this.video_.playbackRate,\n 'playerState': this.getPlayState_(),\n 'currentTime': this.video_.currentTime,\n // supportedMediaCommands is a sum of all the flags of commands that the\n // player supports.\n // The list of comands with respective flags is:\n // 1 - Pause\n // 2 - Seek\n // 4 - Stream volume\n // 8 - Stream mute\n // 16 - Skip forward\n // 32 - Skip backward\n // We support pause, seek, volume and mute which gives a value of\n // 1+2+4+8=15\n 'supportedMediaCommands': 15,\n 'volume': {\n 'level': this.video_.volume,\n 'muted': this.video_.muted\n }\n };\n\n if (opt_media)\n mediaStatus['media'] = opt_media;\n\n var ret = {\n 'requestId': requestId,\n 'type': 'MEDIA_STATUS',\n 'status': [mediaStatus]\n };\n\n this.sendMessage_(ret, this.genericBus_);\n};\n\n\n/**\n * @enum {string}\n */\nshaka.cast.CastReceiver.PLAY_STATE = {\n IDLE: 'IDLE',\n PLAYING: 'PLAYING',\n BUFFERING: 'BUFFERING',\n PAUSED: 'PAUSED'\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_receiver.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.Player');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.abr.EwmaBandwidthEstimator');\ngoog.require('shaka.abr.SimpleAbrManager');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.MediaSourceEngine');\ngoog.require('shaka.media.Playhead');\ngoog.require('shaka.media.PlayheadObserver');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.media.StreamingEngine');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.CancelableChain');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * Construct a Player.\n *\n * @param {!HTMLMediaElement} video Any existing TextTracks attached to this\n * element that were not created by Shaka will be disabled. A new TextTrack\n * may be created to display captions or subtitles.\n * @param {function(shaka.Player)=} opt_dependencyInjector Optional callback\n * which is called to inject mocks into the Player. Used for testing.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n * @extends {shaka.util.FakeEventTarget}\n * @export\n */\nshaka.Player = function(video, opt_dependencyInjector) {\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {boolean} */\n this.destroyed_ = false;\n\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {TextTrack} */\n this.textTrack_ = null;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {shakaExtern.AbrManager} */\n this.defaultAbrManager_ = new shaka.abr.SimpleAbrManager();\n\n /** @private {shaka.net.NetworkingEngine} */\n this.networkingEngine_ = null;\n\n /** @private {shaka.media.DrmEngine} */\n this.drmEngine_ = null;\n\n /** @private {MediaSource} */\n this.mediaSource_ = null;\n\n /** @private {shaka.media.MediaSourceEngine} */\n this.mediaSourceEngine_ = null;\n\n /** @private {Promise} */\n this.mediaSourceOpen_ = null;\n\n /** @private {shaka.media.Playhead} */\n this.playhead_ = null;\n\n /** @private {shaka.media.PlayheadObserver} */\n this.playheadObserver_ = null;\n\n /** @private {shaka.media.StreamingEngine} */\n this.streamingEngine_ = null;\n\n /** @private {shakaExtern.ManifestParser} */\n this.parser_ = null;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = null;\n\n /** @private {?string} */\n this.manifestUri_ = null;\n\n /**\n * Contains an ID for use with creating streams. The manifest parser should\n * start with small IDs, so this starts with a large one.\n * @private {number}\n */\n this.nextExternalStreamId_ = 1e9;\n\n /** @private {!Array.<number>} */\n this.loadingTextStreamIds_ = [];\n\n /** @private {boolean} */\n this.buffering_ = false;\n\n /** @private {boolean} */\n this.switchingPeriods_ = true;\n\n /** @private {shaka.util.CancelableChain} */\n this.loadChain_ = null;\n\n /** @private {Promise} */\n this.unloadChain_ = null;\n\n /**\n * @private {!Object.<shaka.util.ManifestParserUtils.ContentType, {\n * stream: shakaExtern.Stream,\n * clearBuffer: boolean\n * }>}\n */\n this.deferredSwitches_ = {};\n\n /** @private {!Array.<shakaExtern.TimelineRegionInfo>} */\n this.pendingTimelineRegions_ = [];\n\n /**\n * A map of Period number to a map of content type to stream id.\n * @private {!Object.<number, !Object.<string, number>>}\n */\n this.activeStreamsByPeriod_ = {};\n\n /** @private {?shakaExtern.PlayerConfiguration} */\n this.config_ = this.defaultConfig_();\n\n /** @private {{width: number, height: number}} */\n this.maxHwRes_ = { width: Infinity, height: Infinity };\n\n /** @private {shakaExtern.Stats} */\n this.stats_ = this.getCleanStats_();\n\n /** @private {number} */\n this.lastTimeStatsUpdateTimestamp_ = 0;\n\n /** @private {string} */\n this.currentAudioLanguage_ = this.config_.preferredAudioLanguage;\n\n /** @private {string} */\n this.currentTextLanguage_ = this.config_.preferredTextLanguage;\n\n /** @private {string} */\n this.currentVariantRole_ = '';\n\n /** @private {string} */\n this.currentTextRole_ = '';\n\n if (opt_dependencyInjector)\n opt_dependencyInjector(this);\n\n this.networkingEngine_ = this.createNetworkingEngine();\n this.initialize_();\n};\ngoog.inherits(shaka.Player, shaka.util.FakeEventTarget);\n\n\n/**\n * After destruction, a Player object cannot be used again.\n *\n * @override\n * @export\n */\nshaka.Player.prototype.destroy = function() {\n this.destroyed_ = true;\n\n var cancelation = Promise.resolve();\n if (this.loadChain_) {\n // A load is in progress. Cancel it.\n cancelation = this.loadChain_.cancel(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.PLAYER,\n shaka.util.Error.Code.LOAD_INTERRUPTED));\n }\n\n return cancelation.then(function() {\n var p = Promise.all([\n // We need to destroy the current fields as well as waiting for an\n // existing unload to complete. It is fine to call destroyStreaming_ if\n // there is an unload since it resets the fields immediately.\n this.unloadChain_,\n this.destroyStreaming_(),\n this.eventManager_ ? this.eventManager_.destroy() : null,\n this.networkingEngine_ ? this.networkingEngine_.destroy() : null\n ]);\n\n this.video_ = null;\n this.textTrack_ = null;\n this.eventManager_ = null;\n this.defaultAbrManager_ = null;\n this.networkingEngine_ = null;\n this.config_ = null;\n\n return p;\n }.bind(this));\n};\n\n\n/**\n * @define {string} A version number taken from git at compile time.\n */\ngoog.define('GIT_VERSION', 'v2.1.4-debug');\n\n\n/**\n * @const {string}\n * @export\n */\nshaka.Player.version = GIT_VERSION;\n\n\n/**\n * @event shaka.Player.ErrorEvent\n * @description Fired when a playback error occurs.\n * @property {string} type\n * 'error'\n * @property {!shaka.util.Error} detail\n * An object which contains details on the error. The error's 'category' and\n * 'code' properties will identify the specific error that occured. In an\n * uncompiled build, you can also use the 'message' and 'stack' properties\n * to debug.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.EmsgEvent\n * @description Fired when a non-typical emsg is found in a segment.\n * @property {string} type\n * 'emsg'\n * @property {shakaExtern.EmsgInfo} detail\n * An object which contains the content of the emsg box.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TimelineRegionAdded\n * @description Fired when a media timeline region is added.\n * @property {string} type\n * 'timelineregionadded'\n * @property {shakaExtern.TimelineRegionInfo} detail\n * An object which contains a description of the region.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TimelineRegionEnter\n * @description Fired when the playhead enters a timeline region.\n * @property {string} type\n * 'timelineregionenter'\n * @property {shakaExtern.TimelineRegionInfo} detail\n * An object which contains a description of the region.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TimelineRegionExit\n * @description Fired when the playhead exits a timeline region.\n * @property {string} type\n * 'timelineregionexit'\n * @property {shakaExtern.TimelineregionInfo} detail\n * An object which contains a description of the region.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.BufferingEvent\n * @description Fired when the player's buffering state changes.\n * @property {string} type\n * 'buffering'\n * @property {boolean} buffering\n * True when the Player enters the buffering state.\n * False when the Player leaves the buffering state.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.LoadingEvent\n * @description Fired when the player begins loading.\n * Used by the Cast receiver to determine idle state.\n * @property {string} type\n * 'loading'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.UnloadingEvent\n * @description Fired when the player unloads or fails to load.\n * Used by the Cast receiver to determine idle state.\n * @property {string} type\n * 'unloading'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TextTrackVisibilityEvent\n * @description Fired when text track visibility changes.\n * @property {string} type\n * 'texttrackvisibility'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TracksChangedEvent\n * @description Fired when the list of tracks changes. For example, this will\n * happen when changing periods or when track restrictions change.\n * @property {string} type\n * 'trackschanged'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.AdaptationEvent\n * @description Fired when an automatic adaptation causes the active tracks\n * to change. Does not fire when the application calls selectVariantTrack()\n * selectTextTrack(), selectAudioLanguage() or selectTextLanguage().\n * @property {string} type\n * 'adaptation'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.ExpirationUpdatedEvent\n * @description Fired when there is a change in the expiration times of an\n * EME session.\n * @property {string} type\n * 'expirationupdated'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.LargeGapEvent\n * @description Fired when the playhead enters a large gap. If\n * |config.streaming.jumpLargeGaps| is set, the default action of this event\n * is to jump the gap; this can be prevented by calling preventDefault() on\n * the event object.\n * @property {string} type\n * 'largegap'\n * @property {number} currentTime\n * The current time of the playhead.\n * @property {number} gapSize\n * The size of the gap, in seconds.\n * @exportDoc\n */\n\n\n/** @private {!Object.<string, function():*>} */\nshaka.Player.supportPlugins_ = {};\n\n\n/**\n * Registers a plugin callback that will be called with support(). The\n * callback will return the value that will be stored in the return value from\n * support().\n *\n * @param {string} name\n * @param {function():*} callback\n * @export\n */\nshaka.Player.registerSupportPlugin = function(name, callback) {\n shaka.Player.supportPlugins_[name] = callback;\n};\n\n\n/**\n * Return whether the browser provides basic support. If this returns false,\n * Shaka Player cannot be used at all. In this case, do not construct a Player\n * instance and do not use the library.\n *\n * @return {boolean}\n * @export\n */\nshaka.Player.isBrowserSupported = function() {\n // Basic features needed for the library to be usable.\n var basic = !!window.Promise && !!window.Uint8Array &&\n !!Array.prototype.forEach;\n\n return basic &&\n shaka.media.MediaSourceEngine.isBrowserSupported() &&\n shaka.media.DrmEngine.isBrowserSupported();\n};\n\n\n/**\n * Probes the browser to determine what features are supported. This makes a\n * number of requests to EME/MSE/etc which may result in user prompts. This\n * should only be used for diagnostics.\n *\n * NOTE: This may show a request to the user for permission.\n *\n * @see https://goo.gl/ovYLvl\n * @return {!Promise.<shakaExtern.SupportType>}\n * @export\n */\nshaka.Player.probeSupport = function() {\n goog.asserts.assert(shaka.Player.isBrowserSupported(),\n 'Must have basic support');\n return shaka.media.DrmEngine.probeSupport().then(function(drm) {\n var manifest = shaka.media.ManifestParser.probeSupport();\n var media = shaka.media.MediaSourceEngine.probeSupport();\n var ret = {\n manifest: manifest,\n media: media,\n drm: drm\n };\n\n var plugins = shaka.Player.supportPlugins_;\n for (var name in plugins) {\n ret[name] = plugins[name]();\n }\n\n return ret;\n });\n};\n\n\n/**\n * Load a manifest.\n *\n * @param {string} manifestUri\n * @param {number=} opt_startTime Optional start time, in seconds, to begin\n * playback. Defaults to 0 for VOD and to the live edge for live.\n * @param {shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * Optional manifest parser factory to override auto-detection or use an\n * unregistered parser.\n * @return {!Promise} Resolved when the manifest has been loaded and playback\n * has begun; rejected when an error occurs or the call was interrupted by\n * destroy(), unload() or another call to load().\n * @export\n */\nshaka.Player.prototype.load = function(manifestUri, opt_startTime,\n opt_manifestParserFactory) {\n var unloadPromise = this.unload();\n var loadChain = new shaka.util.CancelableChain();\n this.loadChain_ = loadChain;\n this.dispatchEvent(new shaka.util.FakeEvent('loading'));\n\n var startTime = Date.now();\n\n return loadChain.then(function() {\n return unloadPromise;\n }).then(function() {\n // Not tracked in stats because it should be insignificant.\n // Logged in case it is not.\n shaka.log.debug('Unload latency:', (Date.now() - startTime) / 1000);\n\n this.stats_ = this.getCleanStats_();\n\n this.eventManager_.listen(this.video_, 'playing',\n this.updateState_.bind(this));\n this.eventManager_.listen(this.video_, 'pause',\n this.updateState_.bind(this));\n this.eventManager_.listen(this.video_, 'ended',\n this.updateState_.bind(this));\n\n goog.asserts.assert(this.networkingEngine_, 'Must not be destroyed');\n return shaka.media.ManifestParser.getFactory(\n manifestUri,\n this.networkingEngine_,\n this.config_.manifest.retryParameters,\n opt_manifestParserFactory);\n }.bind(this)).then(function(factory) {\n\n this.parser_ = new factory();\n this.parser_.configure(this.config_.manifest);\n goog.asserts.assert(this.networkingEngine_, 'Must not be destroyed');\n var playerInterface = {\n networkingEngine: this.networkingEngine_,\n filterPeriod: this.filterPeriod_.bind(this),\n onTimelineRegionAdded: this.onTimelineRegionAdded_.bind(this),\n onEvent: this.onEvent_.bind(this),\n onError: this.onError_.bind(this)\n };\n\n if (this.parser_.start.length > 2) {\n goog.asserts.assert(false, 'Old ManifestParser interface is deprecated');\n shaka.log.warning(\n 'The ManifestParser interface has changed. Please upgrade your ' +\n 'plugin to accept the PlayerInterface structure. See the ' +\n 'ManifestParser documentation for details.');\n // Use a string index here so the compiler doesn't complain about the\n // incorrect arguments.\n return this.parser_['start'](\n manifestUri, this.networkingEngine_, playerInterface.filterPeriod,\n playerInterface.onError, playerInterface.onEvent);\n }\n\n return this.parser_.start(manifestUri, playerInterface);\n }.bind(this)).then(function(manifest) {\n\n if (manifest.periods.length == 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.NO_PERIODS);\n }\n\n this.manifest_ = manifest;\n this.manifestUri_ = manifestUri;\n this.drmEngine_ = this.createDrmEngine();\n this.drmEngine_.configure(this.config_.drm);\n return this.drmEngine_.init(manifest, false /* isOffline */);\n }.bind(this)).then(function() {\n\n // Re-filter the manifest after DRM has been initialized.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n\n this.lastTimeStatsUpdateTimestamp_ = Date.now() / 1000;\n\n // Copy preferred languages from the config again, in case the config was\n // changed between construction and playback.\n this.currentAudioLanguage_ = this.config_.preferredAudioLanguage;\n this.currentTextLanguage_ = this.config_.preferredTextLanguage;\n\n // Wait for MediaSource to open before continuing.\n return Promise.all([\n this.drmEngine_.attach(this.video_),\n this.mediaSourceOpen_\n ]);\n }.bind(this)).then(function() {\n this.config_.abr.manager.init(this.switch_.bind(this));\n\n // MediaSource is open, so create the Playhead, MediaSourceEngine, and\n // StreamingEngine.\n this.playhead_ = this.createPlayhead(opt_startTime);\n this.playheadObserver_ = this.createPlayheadObserver();\n this.mediaSourceEngine_ = this.createMediaSourceEngine();\n\n this.streamingEngine_ = this.createStreamingEngine();\n this.streamingEngine_.configure(this.config_.streaming);\n\n // If the content is multi-codec and the browser can play more than one of\n // them, choose codecs now before we initialize streaming.\n this.chooseCodecsAndFilterManifest_();\n\n return this.streamingEngine_.init();\n }.bind(this)).then(function() {\n if (this.config_.streaming.startAtSegmentBoundary) {\n var time = this.adjustStartTime_(this.playhead_.getTime());\n this.playhead_.setStartTime(time);\n }\n\n // Re-filter the manifest after streams have been chosen.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n // Dispatch a 'trackschanged' event now that all initial filtering is done.\n this.onTracksChanged_();\n // Since the first streams just became active, send an adaptation event.\n this.onAdaptation_();\n\n // Now that we've filtered out variants that aren't compatible with the\n // active one, update abr manager with filtered variants for the current\n // period.\n var currentPeriod = this.streamingEngine_.getCurrentPeriod();\n var variants = shaka.util.StreamUtils.filterVariantsByRoleAndLanguage(\n currentPeriod, this.currentAudioLanguage_);\n this.config_.abr.manager.setVariants(variants);\n\n var hasPrimary = currentPeriod.variants.some(function(variant) {\n return variant.primary;\n });\n if (!this.currentAudioLanguage_ && !hasPrimary) {\n shaka.log.warning('No preferred audio language set. We will choose an ' +\n 'arbitrary language initially');\n }\n\n this.pendingTimelineRegions_.forEach(\n this.playheadObserver_.addTimelineRegion.bind(this.playheadObserver_));\n this.pendingTimelineRegions_ = [];\n\n // Wait for the 'loadeddata' event to measure load() latency.\n this.eventManager_.listenOnce(this.video_, 'loadeddata', function() {\n // Compute latency in seconds (Date.now() gives ms):\n var latency = (Date.now() - startTime) / 1000;\n this.stats_.loadLatency = latency;\n shaka.log.debug('Load latency:', latency);\n }.bind(this));\n\n this.loadChain_ = null;\n }.bind(this)).finalize().catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong error type!');\n shaka.log.debug('load() failed:', error);\n\n // If we haven't started another load, clear the loadChain_ member.\n if (this.loadChain_ == loadChain) {\n this.loadChain_ = null;\n this.dispatchEvent(new shaka.util.FakeEvent('unloading'));\n }\n return Promise.reject(error);\n }.bind(this));\n};\n\n\n/**\n * In case of multiple usable codecs, choose one based on lowest average\n * bandwidth and filter out the rest.\n * @private\n */\nshaka.Player.prototype.chooseCodecsAndFilterManifest_ = function() {\n function variantCodecs(variant) {\n // Only consider the base of the codec string. For example, these should\n // both be considered the same codec: avc1.42c01e, avc1.4d401f\n var baseVideoCodec =\n variant.video ? variant.video.codecs.split('.')[0] : '';\n var baseAudioCodec =\n variant.audio ? variant.audio.codecs.split('.')[0] : '';\n return baseVideoCodec + '-' + baseAudioCodec;\n }\n\n // Organize variants into buckets by codecs.\n var variantsByCodecs = {};\n this.manifest_.periods.forEach(function(period) {\n period.variants.forEach(function(variant) {\n var codecs = variantCodecs(variant);\n if (!(codecs in variantsByCodecs)) {\n variantsByCodecs[codecs] = [];\n }\n variantsByCodecs[codecs].push(variant);\n });\n });\n\n // Compute the average bandwidth for each group of variants.\n // Choose the lowest-bandwidth codecs.\n var bestCodecs = null;\n var lowestAverageBandwidth = Infinity;\n shaka.util.MapUtils.forEach(variantsByCodecs, function(codecs, variants) {\n var sum = 0;\n var num = 0;\n variants.forEach(function(variant) {\n sum += variant.bandwidth;\n ++num;\n });\n var averageBandwidth = sum / num;\n shaka.log.debug('codecs', codecs, 'avg bandwidth', averageBandwidth);\n\n if (averageBandwidth < lowestAverageBandwidth) {\n bestCodecs = codecs;\n lowestAverageBandwidth = averageBandwidth;\n }\n });\n goog.asserts.assert(bestCodecs != null, 'Should have chosen codecs!');\n goog.asserts.assert(!isNaN(lowestAverageBandwidth),\n 'Bandwidth should be a number!');\n\n // Filter out any variants that don't match, forcing AbrManager to choose from\n // the most efficient variants possible.\n this.manifest_.periods.forEach(function(period) {\n period.variants = period.variants.filter(function(variant) {\n var codecs = variantCodecs(variant);\n if (codecs == bestCodecs) return true;\n\n shaka.log.debug('Dropping Variant (better codec available)', variant);\n return false;\n });\n });\n};\n\n\n/**\n * Creates a new instance of DrmEngine. This can be replaced by tests to\n * create fake instances instead.\n *\n * @return {!shaka.media.DrmEngine}\n */\nshaka.Player.prototype.createDrmEngine = function() {\n goog.asserts.assert(this.networkingEngine_, 'Must not be destroyed');\n return new shaka.media.DrmEngine(\n this.networkingEngine_,\n this.onError_.bind(this),\n this.onKeyStatus_.bind(this),\n this.onExpirationUpdated_.bind(this));\n};\n\n\n/**\n * Creates a new instance of NetworkingEngine. This can be replaced by tests\n * to create fake instances instead.\n *\n * @return {!shaka.net.NetworkingEngine}\n */\nshaka.Player.prototype.createNetworkingEngine = function() {\n return new shaka.net.NetworkingEngine(this.onSegmentDownloaded_.bind(this));\n};\n\n\n/**\n * Creates a new instance of Playhead. This can be replaced by tests to create\n * fake instances instead.\n *\n * @param {number=} opt_startTime\n * @return {!shaka.media.Playhead}\n */\nshaka.Player.prototype.createPlayhead = function(opt_startTime) {\n goog.asserts.assert(this.manifest_, 'Must have manifest');\n return new shaka.media.Playhead(\n this.video_, this.manifest_, this.config_.streaming,\n opt_startTime || null, this.onSeek_.bind(this), this.onEvent_.bind(this));\n};\n\n\n/**\n * Creates a new instance of PlayheadOvserver. This can be replaced by tests to\n * create fake instances instead.\n *\n * @return {!shaka.media.PlayheadObserver}\n */\nshaka.Player.prototype.createPlayheadObserver = function() {\n goog.asserts.assert(this.manifest_, 'Must have manifest');\n return new shaka.media.PlayheadObserver(\n this.video_, this.manifest_, this.config_.streaming,\n this.onBuffering_.bind(this), this.onEvent_.bind(this),\n this.onChangePeriod_.bind(this));\n};\n\n\n/**\n * Create and open MediaSource. Potentially slow.\n *\n * @return {!Promise}\n */\nshaka.Player.prototype.createMediaSource = function() {\n this.mediaSource_ = new MediaSource();\n var ret = new shaka.util.PublicPromise();\n this.eventManager_.listen(this.mediaSource_, 'sourceopen', ret.resolve);\n this.video_.src = window.URL.createObjectURL(this.mediaSource_);\n return ret;\n};\n\n\n/**\n * Creates a new instance of MediaSourceEngine. This can be replaced by tests\n * to create fake instances instead.\n *\n * @return {!shaka.media.MediaSourceEngine}\n */\nshaka.Player.prototype.createMediaSourceEngine = function() {\n return new shaka.media.MediaSourceEngine(\n this.video_, this.mediaSource_, this.textTrack_);\n};\n\n\n/**\n * Creates a new instance of StreamingEngine. This can be replaced by tests\n * to create fake instances instead.\n *\n * @return {!shaka.media.StreamingEngine}\n */\nshaka.Player.prototype.createStreamingEngine = function() {\n goog.asserts.assert(\n this.playhead_ && this.playheadObserver_ && this.mediaSourceEngine_ &&\n this.manifest_,\n 'Must not be destroyed');\n\n var playerInterface = {\n playhead: this.playhead_,\n mediaSourceEngine: this.mediaSourceEngine_,\n netEngine: this.networkingEngine_,\n onChooseStreams: this.onChooseStreams_.bind(this),\n onCanSwitch: this.canSwitch_.bind(this),\n onError: this.onError_.bind(this),\n onEvent: this.onEvent_.bind(this),\n onManifestUpdate: this.onManifestUpdate_.bind(this),\n onSegmentAppended: this.onSegmentAppended_.bind(this)\n };\n return new shaka.media.StreamingEngine(this.manifest_, playerInterface);\n};\n\n\n/**\n * Configure the Player instance.\n *\n * The config object passed in need not be complete. It will be merged with\n * the existing Player configuration.\n *\n * Config keys and types will be checked. If any problems with the config\n * object are found, errors will be reported through logs.\n *\n * @param {!Object} config This should follow the form of\n * {@link shakaExtern.PlayerConfiguration}, but you may omit any field you do\n * not wish to change.\n * @export\n */\nshaka.Player.prototype.configure = function(config) {\n goog.asserts.assert(this.config_, 'Config must not be null!');\n\n if (config.abr && config.abr.manager &&\n config.abr.manager != this.config_.abr.manager) {\n this.config_.abr.manager.stop();\n config.abr.manager.init(this.switch_.bind(this));\n }\n\n shaka.util.ConfigUtils.mergeConfigObjects(\n this.config_, config, this.defaultConfig_(), this.configOverrides_(), '');\n\n this.applyConfig_();\n};\n\n\n/**\n * Apply config changes.\n * @private\n */\nshaka.Player.prototype.applyConfig_ = function() {\n if (this.parser_) {\n this.parser_.configure(this.config_.manifest);\n }\n if (this.drmEngine_) {\n this.drmEngine_.configure(this.config_.drm);\n }\n if (this.streamingEngine_) {\n this.streamingEngine_.configure(this.config_.streaming);\n\n // Need to apply the restrictions to every period.\n try {\n // this.filterPeriod_() may throw.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n } catch (error) {\n this.onError_(error);\n }\n\n // May need to choose new streams.\n shaka.log.debug('Choosing new streams after changing configuration');\n var period = this.streamingEngine_.getCurrentPeriod();\n this.chooseStreamsAndSwitch_(period);\n }\n\n // Simply enable/disable ABR with each call, since multiple calls to these\n // methods have no effect.\n if (this.config_.abr.enabled && !this.switchingPeriods_) {\n this.config_.abr.manager.enable();\n } else {\n this.config_.abr.manager.disable();\n }\n\n this.config_.abr.manager.setDefaultEstimate(\n this.config_.abr.defaultBandwidthEstimate);\n this.config_.abr.manager.setRestrictions(this.config_.abr.restrictions);\n};\n\n\n/**\n * Return a copy of the current configuration. Modifications of the returned\n * value will not affect the Player's active configuration. You must call\n * player.configure() to make changes.\n *\n * @return {shakaExtern.PlayerConfiguration}\n * @export\n */\nshaka.Player.prototype.getConfiguration = function() {\n goog.asserts.assert(this.config_, 'Config must not be null!');\n\n var ret = this.defaultConfig_();\n shaka.util.ConfigUtils.mergeConfigObjects(\n ret, this.config_, this.defaultConfig_(), this.configOverrides_(), '');\n return ret;\n};\n\n\n/**\n * Reset configuration to default.\n * @export\n */\nshaka.Player.prototype.resetConfiguration = function() {\n var config = this.defaultConfig_();\n\n if (config.abr && config.abr.manager &&\n config.abr.manager != this.config_.abr.manager) {\n this.config_.abr.manager.stop();\n config.abr.manager.init(this.switch_.bind(this));\n }\n\n // Don't call mergeConfigObjects_(), since that would not reset open-ended\n // dictionaries like drm.servers.\n this.config_ = this.defaultConfig_();\n\n this.applyConfig_();\n};\n\n\n/**\n * @return {HTMLMediaElement} A reference to the HTML Media Element passed\n * in during initialization.\n * @export\n */\nshaka.Player.prototype.getMediaElement = function() {\n return this.video_;\n};\n\n\n/**\n * @return {shaka.net.NetworkingEngine} A reference to the Player's networking\n * engine. Applications may use this to make requests through Shaka's\n * networking plugins.\n * @export\n */\nshaka.Player.prototype.getNetworkingEngine = function() {\n return this.networkingEngine_;\n};\n\n\n/**\n * @return {?string} If a manifest is loaded, returns the manifest URI given in\n * the last call to load(). Otherwise, returns null.\n * @export\n */\nshaka.Player.prototype.getManifestUri = function() {\n return this.manifestUri_;\n};\n\n\n/**\n * @return {boolean} True if the current stream is live. False otherwise.\n * @export\n */\nshaka.Player.prototype.isLive = function() {\n return this.manifest_ ?\n this.manifest_.presentationTimeline.isLive() :\n false;\n};\n\n\n/**\n * @return {boolean} True if the current stream is in-progress VOD.\n * False otherwise.\n * @export\n */\nshaka.Player.prototype.isInProgress = function() {\n return this.manifest_ ?\n this.manifest_.presentationTimeline.isInProgress() :\n false;\n};\n\n\n/**\n * Get the seekable range for the current stream.\n * @return {{start: number, end: number}}\n * @export\n */\nshaka.Player.prototype.seekRange = function() {\n var start = 0;\n var end = 0;\n if (this.manifest_) {\n var timeline = this.manifest_.presentationTimeline;\n start = timeline.getSegmentAvailabilityStart();\n end = timeline.getSeekRangeEnd();\n }\n return {'start': start, 'end': end};\n};\n\n\n/**\n * Get the key system currently being used by EME. This returns the empty\n * string if not using EME.\n *\n * @return {string}\n * @export\n */\nshaka.Player.prototype.keySystem = function() {\n return this.drmEngine_ ? this.drmEngine_.keySystem() : '';\n};\n\n\n/**\n * Get the DrmInfo used to initialize EME. This returns null when not using\n * EME.\n *\n * @return {?shakaExtern.DrmInfo}\n * @export\n */\nshaka.Player.prototype.drmInfo = function() {\n return this.drmEngine_ ? this.drmEngine_.getDrmInfo() : null;\n};\n\n\n/**\n * The next known expiration time for any EME session. If the sessions never\n * expire, or there are no EME sessions, this returns Infinity.\n *\n * @return {number}\n * @export\n */\nshaka.Player.prototype.getExpiration = function() {\n return this.drmEngine_ ? this.drmEngine_.getExpiration() : Infinity;\n};\n\n\n/**\n * @return {boolean} True if the Player is in a buffering state.\n * @export\n */\nshaka.Player.prototype.isBuffering = function() {\n return this.buffering_;\n};\n\n\n/**\n * Unload the current manifest and make the Player available for re-use.\n *\n * @return {!Promise} Resolved when streaming has stopped and the previous\n * content, if any, has been unloaded.\n * @export\n */\nshaka.Player.prototype.unload = function() {\n if (this.destroyed_) return Promise.resolve();\n this.dispatchEvent(new shaka.util.FakeEvent('unloading'));\n\n var p = Promise.resolve();\n if (this.loadChain_) {\n // A load is in progress, cancel it.\n var interrupt = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.PLAYER,\n shaka.util.Error.Code.LOAD_INTERRUPTED);\n p = this.loadChain_.cancel(interrupt);\n }\n\n return p.then(function() {\n // If there is an existing unload operation, use that.\n if (!this.unloadChain_) {\n this.unloadChain_ = this.resetStreaming_().then(function() {\n this.unloadChain_ = null;\n }.bind(this));\n }\n return this.unloadChain_;\n }.bind(this));\n};\n\n\n/**\n * Gets the current effective playback rate. If using trick play, it will\n * return the current trick play rate; otherwise, it will return the video\n * playback rate.\n * @return {number}\n * @export\n */\nshaka.Player.prototype.getPlaybackRate = function() {\n return this.playhead_ ? this.playhead_.getPlaybackRate() : 0;\n};\n\n\n/**\n * Skip through the content without playing. Simulated using repeated seeks.\n *\n * Trick play will be canceled automatically if the playhead hits the beginning\n * or end of the seekable range for the content.\n *\n * @param {number} rate The playback rate to simulate. For example, a rate of\n * 2.5 would result in 2.5 seconds of content being skipped every second.\n * To trick-play backward, use a negative rate.\n * @export\n */\nshaka.Player.prototype.trickPlay = function(rate) {\n shaka.log.debug('Trick play rate', rate);\n if (this.playhead_)\n this.playhead_.setPlaybackRate(rate);\n\n if (this.streamingEngine_)\n this.streamingEngine_.setTrickPlay(rate != 1);\n};\n\n\n/**\n * Cancel trick-play.\n * @export\n */\nshaka.Player.prototype.cancelTrickPlay = function() {\n shaka.log.debug('Trick play canceled');\n if (this.playhead_)\n this.playhead_.setPlaybackRate(1);\n\n if (this.streamingEngine_)\n this.streamingEngine_.setTrickPlay(false);\n};\n\n\n/**\n * Return a list of variant and text tracks available for the current Period.\n * If there are multiple Periods, then you must seek to the Period before\n * being able to switch.\n *\n * @return {!Array.<shakaExtern.Track>}\n * @export\n * @deprecated Use getVariantTracks() or getTextTracks()\n */\nshaka.Player.prototype.getTracks = function() {\n shaka.log.warning('shaka.Player.getTracks() is being deprecated and will ' +\n 'be removed in v2.2. Use getVariantTracks() to get a ' +\n 'list of variant tracks or getTextTracks() for text.');\n\n var tracks = this.getVariantTracks();\n return tracks.concat(this.getTextTracks());\n};\n\n\n/**\n * Select a specific track. For variant tracks, this disables adaptation.\n * Note that AdaptationEvents are not fired for manual track selections.\n *\n * @param {shakaExtern.Track} track\n * @param {boolean=} opt_clearBuffer\n * @export\n * @deprecated Use selectVariantTrack() or selectTextTrack()\n */\nshaka.Player.prototype.selectTrack = function(track, opt_clearBuffer) {\n shaka.log.warning('shaka.Player.selectTrack() is being deprecated and will ' +\n 'be removed in v2.2. Use selectVariantTrack() to select ' +\n 'a new variant track or selectTextTrack() for text.');\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (track.type == ContentType.TEXT) {\n this.selectTextTrack(track);\n } else {\n // Disable ABR for variant track changes.\n var config = {abr: {enabled: false}};\n this.configure(config);\n this.selectVariantTrack(track, opt_clearBuffer);\n }\n};\n\n\n/**\n * Return a list of variant tracks available for the current\n * Period. If there are multiple Periods, then you must seek to the Period\n * before being able to switch.\n *\n * @return {!Array.<shakaExtern.Track>}\n * @export\n */\nshaka.Player.prototype.getVariantTracks = function() {\n if (!this.manifest_)\n return [];\n this.assertCorrectActiveStreams_();\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var currentPeriod = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.playhead_.getTime());\n var activeStreams = this.activeStreamsByPeriod_[currentPeriod] || {};\n return shaka.util.StreamUtils.getVariantTracks(\n this.manifest_.periods[currentPeriod], activeStreams[ContentType.AUDIO],\n activeStreams[ContentType.VIDEO]);\n};\n\n\n/**\n * Return a list of text tracks available for the current\n * Period. If there are multiple Periods, then you must seek to the Period\n * before being able to switch.\n *\n * @return {!Array.<shakaExtern.Track>}\n * @export\n */\nshaka.Player.prototype.getTextTracks = function() {\n if (!this.manifest_)\n return [];\n this.assertCorrectActiveStreams_();\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var currentPeriod = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.playhead_.getTime());\n var activeStreams = this.activeStreamsByPeriod_[currentPeriod] || {};\n return shaka.util.StreamUtils\n .getTextTracks(\n this.manifest_.periods[currentPeriod],\n activeStreams[ContentType.TEXT])\n .filter(function(track) {\n // Don't show any tracks that are being loaded still.\n return this.loadingTextStreamIds_.indexOf(track.id) < 0;\n }.bind(this));\n};\n\n\n/**\n * Select a specific text track. Note that AdaptationEvents are not\n * fired for manual track selections.\n *\n * @param {shakaExtern.Track} track\n * @export\n */\nshaka.Player.prototype.selectTextTrack = function(track) {\n if (!this.streamingEngine_)\n return;\n\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var period = this.streamingEngine_.getCurrentPeriod();\n var stream = StreamUtils.findTextStreamForTrack(period, track);\n\n if (!stream) {\n shaka.log.error('Unable to find the track with id \"' + track.id +\n '\"; did we change Periods?');\n return;\n }\n\n this.addToSwitchHistory_(stream, /* fromAdaptation */ false);\n\n // Create empty object first and initialize the fields through\n // [] to allow field names to be expressions.\n var streamsToSwitch = {};\n streamsToSwitch[ContentType.TEXT] = stream;\n this.deferredSwitch_(streamsToSwitch, /* opt_clearBuffer */ true);\n};\n\n\n/**\n * Select a specific track. Note that AdaptationEvents are not fired for manual\n * track selections.\n *\n * @param {shakaExtern.Track} track\n * @param {boolean=} opt_clearBuffer\n * @export\n */\nshaka.Player.prototype.selectVariantTrack = function(track, opt_clearBuffer) {\n if (!this.streamingEngine_)\n return;\n\n if (this.config_.abr.enabled) {\n shaka.log.warning('Changing tracks while abr manager is enabled will ' +\n 'likely result in the selected track being overriden. ' +\n 'Consider disabling abr before calling ' +\n 'selectVariantTrack().');\n }\n\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var streamsToSwitch = {};\n\n var period = this.streamingEngine_.getCurrentPeriod();\n var variant = StreamUtils.findVariantForTrack(period, track);\n var activeStreams = this.streamingEngine_.getActiveStreams();\n if (variant) {\n // Double check that the track is allowed to be played.\n // The track list should only contain playable variants,\n // but if resctrictions change and selectVariantTrack()\n // is called before the track list is updated, we could\n // get a now-restricted variant.\n var variantIsPlayable = StreamUtils.isPlayable(variant);\n if (!variantIsPlayable) {\n shaka.log.error('Unable to switch to track with id \"' + track.id +\n '\" because it is restricted.');\n return;\n }\n\n if (variant.audio) {\n // Update active streams even if we're not switching\n // in case active streams haven't been set up yet.\n this.updateActiveStreams_(variant.audio);\n if (variant.audio != activeStreams[ContentType.AUDIO])\n streamsToSwitch[ContentType.AUDIO] = variant.audio;\n }\n if (variant.video) {\n this.updateActiveStreams_(variant.video);\n if (variant.video != activeStreams[ContentType.VIDEO])\n streamsToSwitch[ContentType.VIDEO] = variant.video;\n }\n }\n\n // Add entries to the history.\n shaka.util.MapUtils.values(streamsToSwitch).forEach(function(stream) {\n this.addToSwitchHistory_(stream, /* fromAdaptation */ false);\n }.bind(this));\n\n // Save current text stream to ensure that it doesn't get overridden\n // by a default one inside shaka.Player.configure()\n var currentTextStream = activeStreams[ContentType.TEXT];\n\n if (currentTextStream) {\n streamsToSwitch[ContentType.TEXT] = currentTextStream;\n }\n\n this.deferredSwitch_(streamsToSwitch, opt_clearBuffer);\n};\n\n\n/**\n * Return a list of audio languages available for the current\n * Period.\n *\n * @return {!Array.<string>}\n * @export\n */\nshaka.Player.prototype.getAudioLanguages = function() {\n if (!this.streamingEngine_) {\n return [];\n }\n\n var StreamUtils = shaka.util.StreamUtils;\n var period = this.streamingEngine_.getCurrentPeriod();\n var variants = StreamUtils.getPlayableVariants(period.variants);\n return variants.map(function(variant) {\n return variant.language;\n }).filter(shaka.util.Functional.isNotDuplicate);\n};\n\n\n/**\n * Return a list of text languages available for the current\n * Period.\n *\n * @return {!Array.<string>}\n * @export\n */\nshaka.Player.prototype.getTextLanguages = function() {\n if (!this.streamingEngine_) {\n return [];\n }\n\n var period = this.streamingEngine_.getCurrentPeriod();\n return period.textStreams.map(function(stream) {\n return stream.language;\n }).filter(shaka.util.Functional.isNotDuplicate);\n};\n\n\n/**\n * Sets currentAudioLanguage to the selected language and chooses\n * new variant in that language if need be.\n *\n * @param {!string} language\n * @param {string=} opt_role\n * @export\n */\nshaka.Player.prototype.selectAudioLanguage = function(language, opt_role) {\n if (!this.streamingEngine_) return;\n var period = this.streamingEngine_.getCurrentPeriod();\n this.currentAudioLanguage_ = language;\n this.currentVariantRole_ = opt_role || '';\n this.chooseStreamsAndSwitch_(period);\n};\n\n\n/**\n * Sets currentTextLanguage to the selected language and chooses\n * new text stream in that language if need be.\n *\n * @param {!string} language\n * @param {string=} opt_role\n * @export\n */\nshaka.Player.prototype.selectTextLanguage = function(language, opt_role) {\n if (!this.streamingEngine_) return;\n var period = this.streamingEngine_.getCurrentPeriod();\n this.currentTextLanguage_ = language;\n this.currentTextRole_ = opt_role || '';\n this.chooseStreamsAndSwitch_(period);\n};\n\n\n/**\n * @return {boolean} True if the current text track is visible.\n * @export\n */\nshaka.Player.prototype.isTextTrackVisible = function() {\n return this.textTrack_.mode == 'showing';\n};\n\n\n/**\n * Set the visibility of the current text track, if any.\n *\n * @param {boolean} on\n * @export\n */\nshaka.Player.prototype.setTextTrackVisibility = function(on) {\n this.textTrack_.mode = on ? 'showing' : 'hidden';\n this.onTextTrackVisibility_();\n};\n\n\n/**\n * Returns current playhead time as a Date.\n *\n * @return {Date}\n * @export\n */\nshaka.Player.prototype.getPlayheadTimeAsDate = function() {\n if (!this.manifest_) return null;\n goog.asserts.assert(this.isLive(),\n 'getPlayheadTimeInUTC should be called on a live stream!');\n var time =\n this.manifest_.presentationTimeline.getPresentationStartTime() * 1000 +\n this.video_.currentTime * 1000;\n\n return new Date(time);\n};\n\n\n/**\n * Return playback and adaptation stats.\n *\n * @return {shakaExtern.Stats}\n * @export\n */\nshaka.Player.prototype.getStats = function() {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n this.updateTimeStats_();\n this.updateState_();\n\n var video = null;\n var variant = null;\n var videoInfo = this.video_ && this.video_.getVideoPlaybackQuality ?\n this.video_.getVideoPlaybackQuality() : {};\n\n if (this.playhead_ && this.manifest_) {\n var periodIdx = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.playhead_.getTime());\n var period = this.manifest_.periods[periodIdx];\n var activeStreams = this.activeStreamsByPeriod_[periodIdx];\n\n variant = shaka.util.StreamUtils.getVariantByStreamIds(\n activeStreams[ContentType.AUDIO],\n activeStreams[ContentType.VIDEO],\n period.variants);\n\n video = variant.video || {};\n }\n\n if (!video) video = {};\n if (!variant) variant = {};\n\n // Clone the internal object so our state cannot be tampered with.\n var cloneObject = shaka.util.ConfigUtils.cloneObject;\n return {\n // Not tracked in this.stats_:\n width: video.width || 0,\n height: video.height || 0,\n streamBandwidth: variant.bandwidth || 0,\n decodedFrames: Number(videoInfo.totalVideoFrames),\n droppedFrames: Number(videoInfo.droppedVideoFrames),\n estimatedBandwidth: this.config_.abr.manager.getBandwidthEstimate(),\n\n loadLatency: this.stats_.loadLatency,\n playTime: this.stats_.playTime,\n bufferingTime: this.stats_.bufferingTime,\n // Deep-clone the objects as well as the arrays that contain them:\n switchHistory: cloneObject(this.stats_.switchHistory),\n stateHistory: cloneObject(this.stats_.stateHistory)\n };\n};\n\n\n/**\n * Adds the given text track to the current Period. Load() must resolve before\n * calling. The current Period or the presentation must have a duration. This\n * returns a Promise that will resolve when the track can be switched to and\n * will resolve with the track that was created.\n *\n * @param {string} uri\n * @param {string} language\n * @param {string} kind\n * @param {string} mime\n * @param {string=} opt_codec\n * @param {string=} opt_label\n * @return {!Promise.<shakaExtern.Track>}\n * @export\n */\nshaka.Player.prototype.addTextTrack = function(\n uri, language, kind, mime, opt_codec, opt_label) {\n if (!this.streamingEngine_) {\n shaka.log.error(\n 'Must call load() and wait for it to resolve before adding text ' +\n 'tracks.');\n return Promise.reject();\n }\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Get the Period duration.\n var period = this.streamingEngine_.getCurrentPeriod();\n /** @type {number} */\n var periodDuration;\n for (var i = 0; i < this.manifest_.periods.length; i++) {\n if (this.manifest_.periods[i] == period) {\n if (i == this.manifest_.periods.length - 1) {\n periodDuration = this.manifest_.presentationTimeline.getDuration() -\n period.startTime;\n if (periodDuration == Infinity) {\n shaka.log.error(\n 'The current Period or the presentation must have a duration ' +\n 'to add external text tracks.');\n return Promise.reject();\n }\n } else {\n var nextPeriod = this.manifest_.periods[i + 1];\n periodDuration = nextPeriod.startTime - period.startTime;\n }\n break;\n }\n }\n\n /** @type {shakaExtern.Stream} */\n var stream = {\n id: this.nextExternalStreamId_++,\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: function(time) { return 1; },\n getSegmentReference: function(ref) {\n if (ref != 1) return null;\n return new shaka.media.SegmentReference(\n 1, 0, periodDuration, function() { return [uri]; }, 0, null);\n },\n initSegmentReference: null,\n presentationTimeOffset: 0,\n mimeType: mime,\n codecs: opt_codec || '',\n kind: kind,\n encrypted: false,\n keyId: null,\n language: language,\n label: opt_label || null,\n type: ContentType.TEXT,\n primary: false,\n trickModeVideo: null,\n containsEmsgBoxes: false,\n roles: []\n };\n\n // Add the stream to the loading list to ensure it isn't switched to while it\n // is initializing.\n this.loadingTextStreamIds_.push(stream.id);\n period.textStreams.push(stream);\n\n return this.streamingEngine_.notifyNewTextStream(stream).then(function() {\n if (this.destroyed_) return;\n\n // If this was the first text stream, StreamingEngine will start streaming\n // it in notifyNewTextStream. So update the active stream.\n var curPeriodIdx = this.manifest_.periods.indexOf(period);\n var activeStreams = this.streamingEngine_.getActiveStreams();\n if (activeStreams[ContentType.TEXT]) {\n this.activeStreamsByPeriod_[curPeriodIdx][ContentType.TEXT] =\n activeStreams[ContentType.TEXT].id;\n }\n\n // Remove the stream from the loading list.\n this.loadingTextStreamIds_.splice(\n this.loadingTextStreamIds_.indexOf(stream.id), 1);\n\n shaka.log.debug('Choosing new streams after adding a text stream');\n this.chooseStreamsAndSwitch_(period);\n this.onTracksChanged_();\n\n return {\n id: stream.id,\n active: false,\n type: ContentType.TEXT,\n bandwidth: 0,\n language: language,\n label: opt_label || null,\n kind: kind,\n width: null,\n height: null\n };\n }.bind(this));\n};\n\n\n/**\n * Set the maximum resolution that the platform's hardware can handle.\n * This will be called automatically by shaka.cast.CastReceiver to enforce\n * limitations of the Chromecast hardware.\n *\n * @param {number} width\n * @param {number} height\n * @export\n */\nshaka.Player.prototype.setMaxHardwareResolution = function(width, height) {\n this.maxHwRes_.width = width;\n this.maxHwRes_.height = height;\n};\n\n\n/**\n * Initialize the Player.\n * @private\n */\nshaka.Player.prototype.initialize_ = function() {\n // Start the (potentially slow) process of opening MediaSource now.\n this.mediaSourceOpen_ = this.createMediaSource();\n\n // If the video element has TextTracks, disable them. If we see one that\n // was created by a previous instance of Shaka Player, reuse it.\n for (var i = 0; i < this.video_.textTracks.length; ++i) {\n var track = this.video_.textTracks[i];\n track.mode = 'disabled';\n\n if (track.label == shaka.Player.TextTrackLabel_) {\n this.textTrack_ = track;\n }\n }\n\n if (!this.textTrack_) {\n // As far as I can tell, there is no observable difference between setting\n // kind to 'subtitles' or 'captions' when creating the TextTrack object.\n // The individual text tracks from the manifest will still have their own\n // kinds which can be displayed in the app's UI.\n this.textTrack_ = this.video_.addTextTrack(\n 'subtitles', shaka.Player.TextTrackLabel_);\n }\n this.textTrack_.mode = 'hidden';\n\n // TODO: test that in all cases, the built-in CC controls in the video element\n // are toggling our TextTrack.\n\n // Listen for video errors.\n this.eventManager_.listen(this.video_, 'error',\n this.onVideoError_.bind(this));\n};\n\n\n/**\n * @param {!shakaExtern.Stream} stream\n * @param {boolean} fromAdaptation\n * @private\n */\nshaka.Player.prototype.addToSwitchHistory_ = function(stream, fromAdaptation) {\n this.stats_.switchHistory.push({\n timestamp: Date.now() / 1000,\n id: stream.id,\n type: stream.type,\n fromAdaptation: fromAdaptation\n });\n\n this.updateActiveStreams_(stream);\n};\n\n\n/**\n * @param {!shakaExtern.Stream} stream\n * @private\n */\nshaka.Player.prototype.updateActiveStreams_ = function(stream) {\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n var periodIndex =\n shaka.util.StreamUtils.findPeriodContainingStream(this.manifest_, stream);\n if (!this.activeStreamsByPeriod_[periodIndex])\n this.activeStreamsByPeriod_[periodIndex] = {};\n this.activeStreamsByPeriod_[periodIndex][stream.type] = stream.id;\n};\n\n\n/**\n * Destroy members responsible for streaming.\n *\n * @return {!Promise}\n * @private\n */\nshaka.Player.prototype.destroyStreaming_ = function() {\n if (this.eventManager_) {\n this.eventManager_.unlisten(this.mediaSource_, 'sourceopen');\n this.eventManager_.unlisten(this.video_, 'loadeddata');\n this.eventManager_.unlisten(this.video_, 'playing');\n this.eventManager_.unlisten(this.video_, 'pause');\n this.eventManager_.unlisten(this.video_, 'ended');\n }\n\n if (this.video_) {\n this.video_.removeAttribute('src');\n this.video_.load();\n }\n\n var p = Promise.all([\n this.config_ ? this.config_.abr.manager.stop() : null,\n this.drmEngine_ ? this.drmEngine_.destroy() : null,\n this.mediaSourceEngine_ ? this.mediaSourceEngine_.destroy() : null,\n this.playhead_ ? this.playhead_.destroy() : null,\n this.playheadObserver_ ? this.playheadObserver_.destroy() : null,\n this.streamingEngine_ ? this.streamingEngine_.destroy() : null,\n this.parser_ ? this.parser_.stop() : null\n ]);\n\n this.drmEngine_ = null;\n this.mediaSourceEngine_ = null;\n this.playhead_ = null;\n this.playheadObserver_ = null;\n this.streamingEngine_ = null;\n this.parser_ = null;\n this.manifest_ = null;\n this.manifestUri_ = null;\n this.mediaSourceOpen_ = null;\n this.mediaSource_ = null;\n this.pendingTimelineRegions_ = [];\n this.activeStreamsByPeriod_ = {};\n this.deferredSwitches_ = {};\n this.stats_ = this.getCleanStats_();\n\n return p;\n};\n\n\n/**\n * Reset the streaming system.\n * @return {!Promise}\n * @private\n */\nshaka.Player.prototype.resetStreaming_ = function() {\n if (!this.parser_) {\n // Nothing is playing, so this is effectively a no-op.\n return Promise.resolve();\n }\n\n // Destroy the streaming system before we recreate everything.\n return this.destroyStreaming_().then(function() {\n if (this.destroyed_) return;\n\n // Force an exit from the buffering state.\n this.onBuffering_(false);\n\n // Start the (potentially slow) process of opening MediaSource now.\n this.mediaSourceOpen_ = this.createMediaSource();\n }.bind(this));\n};\n\n\n/**\n * @const {string}\n * @private\n */\nshaka.Player.TextTrackLabel_ = 'Shaka Player TextTrack';\n\n\n/**\n * @return {!Object}\n * @private\n */\nshaka.Player.prototype.configOverrides_ = function() {\n return {\n '.drm.servers': '',\n '.drm.clearKeys': '',\n '.drm.advanced': {\n distinctiveIdentifierRequired: false,\n persistentStateRequired: false,\n videoRobustness: '',\n audioRobustness: '',\n serverCertificate: null\n }\n };\n};\n\n\n/**\n * @return {shakaExtern.PlayerConfiguration}\n * @private\n */\nshaka.Player.prototype.defaultConfig_ = function() {\n return {\n drm: {\n retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(),\n // These will all be verified by special cases in mergeConfigObjects_():\n servers: {}, // key is arbitrary key system ID, value must be string\n clearKeys: {}, // key is arbitrary key system ID, value must be string\n advanced: {}, // key is arbitrary key system ID, value is a record type\n delayLicenseRequestUntilPlayed: false\n },\n manifest: {\n retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(),\n dash: {\n customScheme: function(node) {\n // Reference node to keep closure from removing it.\n // If the argument is removed, it breaks our function length check\n // in mergeConfigObjects_().\n // TODO: Find a better solution if possible.\n // NOTE: Chrome App Content Security Policy prohibits usage of new\n // Function()\n\n if (node) return null;\n },\n clockSyncUri: '',\n ignoreDrmInfo: false\n },\n hls: {\n defaultTimeOffset: 0\n }\n },\n streaming: {\n retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(),\n infiniteRetriesForLiveStreams: true,\n rebufferingGoal: 2,\n bufferingGoal: 10,\n bufferBehind: 30,\n ignoreTextStreamFailures: false,\n startAtSegmentBoundary: false,\n smallGapLimit: 0.5,\n jumpLargeGaps: false\n },\n abr: {\n manager: this.defaultAbrManager_,\n enabled: true,\n defaultBandwidthEstimate:\n shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE,\n restrictions: {\n minWidth: 0,\n maxWidth: Infinity,\n minHeight: 0,\n maxHeight: Infinity,\n minPixels: 0,\n maxPixels: Infinity,\n minBandwidth: 0,\n maxBandwidth: Infinity\n }\n },\n preferredAudioLanguage: '',\n preferredTextLanguage: '',\n restrictions: {\n minWidth: 0,\n maxWidth: Infinity,\n minHeight: 0,\n maxHeight: Infinity,\n minPixels: 0,\n maxPixels: Infinity,\n minBandwidth: 0,\n maxBandwidth: Infinity\n }\n };\n};\n\n\n/**\n * @return {shakaExtern.Stats}\n * @private\n */\nshaka.Player.prototype.getCleanStats_ = function() {\n return {\n // These are not tracked in the private stats structure and are only here to\n // satisfy the compiler.\n width: NaN,\n height: NaN,\n streamBandwidth: NaN,\n decodedFrames: NaN,\n droppedFrames: NaN,\n estimatedBandwidth: NaN,\n\n // These are tracked in the private stats structure to avoid the need for\n // many private member variables.\n loadLatency: NaN,\n playTime: 0,\n bufferingTime: 0,\n switchHistory: [],\n stateHistory: []\n };\n};\n\n\n/**\n * @param {shakaExtern.Period} period\n * @private\n */\nshaka.Player.prototype.filterPeriod_ = function(period) {\n goog.asserts.assert(this.video_, 'Must not be destroyed');\n var StreamUtils = shaka.util.StreamUtils;\n\n var activeStreams =\n this.streamingEngine_ ? this.streamingEngine_.getActiveStreams() : {};\n StreamUtils.filterPeriod(this.drmEngine_, activeStreams, period);\n\n // Check for playable variants before restrictions to give a different error\n // if we have restricted all the tracks rather than there being none.\n var hasPlayableVariants =\n StreamUtils.getPlayableVariants(period.variants).length > 0;\n\n var tracksChanged = shaka.util.StreamUtils.applyRestrictions(\n period, this.config_.restrictions, this.maxHwRes_);\n if (tracksChanged && this.streamingEngine_ &&\n this.streamingEngine_.getCurrentPeriod() == period) {\n this.onTracksChanged_();\n }\n\n // Check for playable variants again. If the first check found variants, but\n // not the second, then all variants are restricted.\n var allVariantsRestricted =\n StreamUtils.getPlayableVariants(period.variants).length < 1;\n\n if (!hasPlayableVariants) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.UNPLAYABLE_PERIOD);\n } else if (allVariantsRestricted) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET);\n }\n};\n\n\n/**\n * Switches to the given streams, deferring switches if needed.\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType,\n shakaExtern.Stream>} streamsByType\n * @param {boolean=} opt_clearBuffer\n * @private\n */\nshaka.Player.prototype.deferredSwitch_ = function(\n streamsByType, opt_clearBuffer) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n for (var type in streamsByType) {\n var stream = streamsByType[type];\n var clearBuffer = opt_clearBuffer || false;\n // TODO: consider adding a cue replacement algorithm to TextEngine to remove\n // this special case for text:\n if (type == ContentType.TEXT) clearBuffer = true;\n if (this.switchingPeriods_) {\n this.deferredSwitches_[type] = {stream: stream, clearBuffer: clearBuffer};\n } else {\n this.streamingEngine_.switch(type, stream, clearBuffer);\n }\n }\n};\n\n\n/**\n * Verifies that the active streams according to the player match those in\n * StreamingEngine.\n * @private\n */\nshaka.Player.prototype.assertCorrectActiveStreams_ = function() {\n if (!this.streamingEngine_ || !this.manifest_ || COMPILED) return;\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var streamingActive = this.streamingEngine_.getActiveStreams();\n var mainStream =\n streamingActive[ContentType.VIDEO] || streamingActive[ContentType.AUDIO];\n if (!mainStream)\n return;\n\n var streamingPeriodIndex =\n StreamUtils.findPeriodContainingStream(this.manifest_, mainStream);\n var currentPeriodIndex =\n this.manifest_.periods.indexOf(this.streamingEngine_.getCurrentPeriod());\n if (streamingPeriodIndex < 0 || streamingPeriodIndex != currentPeriodIndex)\n return;\n\n var playerActive = this.activeStreamsByPeriod_[currentPeriodIndex] || {};\n for (var type in streamingActive) {\n var activeId = streamingActive[type].id;\n if (this.deferredSwitches_[type])\n activeId = this.deferredSwitches_[type].stream.id;\n goog.asserts.assert(activeId == playerActive[type],\n 'Inconsistent active stream');\n }\n};\n\n\n/** @private */\nshaka.Player.prototype.updateTimeStats_ = function() {\n // Only count while we're loaded.\n if (!this.manifest_)\n return;\n\n var now = Date.now() / 1000;\n if (this.buffering_)\n this.stats_.bufferingTime += (now - this.lastTimeStatsUpdateTimestamp_);\n else\n this.stats_.playTime += (now - this.lastTimeStatsUpdateTimestamp_);\n\n this.lastTimeStatsUpdateTimestamp_ = now;\n};\n\n\n/**\n * @param {number} time\n * @return {number}\n * @private\n */\nshaka.Player.prototype.adjustStartTime_ = function(time) {\n var activeStreams = this.streamingEngine_.getActiveStreams();\n var period = this.streamingEngine_.getCurrentPeriod();\n\n // This method is called after StreamingEngine.init resolves, this means that\n // all the active streams have had createSegmentIndex called.\n function getAdjustedTime(stream, time) {\n if (!stream) return null;\n var idx = stream.findSegmentPosition(time - period.startTime);\n if (idx == null) return null;\n var ref = stream.getSegmentReference(idx);\n if (!ref) return null;\n var refTime = ref.startTime + period.startTime;\n goog.asserts.assert(refTime <= time, 'Segment should start before time');\n return refTime;\n }\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var videoStartTime = getAdjustedTime(activeStreams[ContentType.VIDEO], time);\n var audioStartTime = getAdjustedTime(activeStreams[ContentType.AUDIO], time);\n\n // If we have both video and audio times, pick the larger one. If we picked\n // the smaller one, that one will download an entire segment to buffer the\n // difference.\n if (videoStartTime != null && audioStartTime != null)\n return Math.max(videoStartTime, audioStartTime);\n else if (videoStartTime != null)\n return videoStartTime;\n else if (audioStartTime != null)\n return audioStartTime;\n else\n return time;\n};\n\n\n/**\n * Callback from NetworkingEngine.\n *\n * @param {number} deltaTimeMs\n * @param {number} numBytes\n * @private\n */\nshaka.Player.prototype.onSegmentDownloaded_ = function(deltaTimeMs, numBytes) {\n this.config_.abr.manager.segmentDownloaded(deltaTimeMs, numBytes);\n};\n\n\n/**\n * Callback from PlayheadObserver.\n *\n * @param {boolean} buffering\n * @private\n */\nshaka.Player.prototype.onBuffering_ = function(buffering) {\n // Before setting |buffering_|, update the time spent in the previous state.\n this.updateTimeStats_();\n this.buffering_ = buffering;\n this.updateState_();\n\n if (this.playhead_)\n this.playhead_.setBuffering(buffering);\n\n var event = new shaka.util.FakeEvent('buffering', { 'buffering': buffering });\n this.dispatchEvent(event);\n};\n\n\n/**\n * Callback from PlayheadObserver.\n * @private\n */\nshaka.Player.prototype.onChangePeriod_ = function() {\n this.onTracksChanged_();\n};\n\n\n/**\n * Called from potential initiators of state change, or before returning stats\n * to the user.\n *\n * This method decides if state has actually changed, updates the last entry,\n * and adds a new one if needed.\n *\n * @private\n */\nshaka.Player.prototype.updateState_ = function() {\n if (this.destroyed_) return;\n\n var newState;\n if (this.buffering_) {\n newState = 'buffering';\n } else if (this.video_.ended) {\n newState = 'ended';\n } else if (this.video_.paused) {\n newState = 'paused';\n } else {\n newState = 'playing';\n }\n\n var now = Date.now() / 1000;\n if (this.stats_.stateHistory.length) {\n var lastIndex = this.stats_.stateHistory.length - 1;\n var lastEntry = this.stats_.stateHistory[lastIndex];\n lastEntry.duration = now - lastEntry.timestamp;\n\n if (newState == lastEntry.state) {\n // The state has not changed, so do not add anything to the history.\n return;\n }\n }\n\n this.stats_.stateHistory.push({\n timestamp: now,\n state: newState,\n duration: 0\n });\n};\n\n\n/**\n * Callback from Playhead.\n *\n * @private\n */\nshaka.Player.prototype.onSeek_ = function() {\n if (this.playheadObserver_)\n this.playheadObserver_.seeked();\n if (this.streamingEngine_)\n this.streamingEngine_.seeked();\n};\n\n\n/**\n * Chooses streams from the given Period.\n *\n * @param {!shakaExtern.Period} period\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @param {!Array.<!shakaExtern.Stream>} textStreams\n * @param {boolean=} opt_chooseAll If true, choose streams of every type.\n * @return {!Object.<string, !shakaExtern.Stream>} A map of stream types to\n * chosen streams.\n * @private\n */\nshaka.Player.prototype.chooseStreams_ =\n function(period, variants, textStreams, opt_chooseAll) {\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Issue an error if there are no playable variants\n if (!variants || variants.length < 1) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET));\n return {};\n }\n\n // Update abr manager with newly filtered streams and variants.\n this.config_.abr.manager.setVariants(variants);\n this.config_.abr.manager.setTextStreams(textStreams);\n\n var needsUpdate = [];\n if (opt_chooseAll) {\n needsUpdate = [ContentType.VIDEO, ContentType.AUDIO];\n if (period.textStreams.length) needsUpdate.push(ContentType.TEXT);\n }\n\n // Check if any of the active streams is no longer available\n // or is using the wrong language.\n var activeStreams = this.streamingEngine_.getActiveStreams();\n // activePeriod may reasonably be null before StreamingEngine is streaming.\n var activePeriod = this.streamingEngine_.getActivePeriod();\n var activeVariant = shaka.util.StreamUtils.getVariantByStreams(\n activeStreams[ContentType.AUDIO],\n activeStreams[ContentType.VIDEO],\n activePeriod ? activePeriod.variants : period.variants);\n\n if (activeVariant) {\n if (!activeVariant.allowedByApplication ||\n !activeVariant.allowedByKeySystem) {\n needsUpdate.push(ContentType.AUDIO);\n needsUpdate.push(ContentType.VIDEO);\n }\n\n for (var type in activeStreams) {\n var stream = activeStreams[type];\n if (stream.type == ContentType.AUDIO &&\n stream.language != variants[0].language) {\n needsUpdate.push(type);\n } else if (stream.type == ContentType.TEXT && textStreams.length > 0 &&\n stream.language != textStreams[0].language) {\n needsUpdate.push(type);\n }\n }\n }\n\n needsUpdate = needsUpdate.filter(shaka.util.Functional.isNotDuplicate);\n\n if (needsUpdate.length > 0) {\n shaka.log.debug('Choosing new streams for', needsUpdate);\n var chosen = {};\n try {\n chosen = this.config_.abr.manager.chooseStreams(needsUpdate);\n } catch (err) {\n this.onError_(err);\n }\n\n return chosen;\n } else {\n shaka.log.debug('No new streams need to be chosen.');\n return {};\n }\n};\n\n\n/**\n * Chooses streams from the given Period and switches to them.\n * Called after a config change, a new text stream, or a key status event.\n *\n * @param {!shakaExtern.Period} period\n * @private\n */\nshaka.Player.prototype.chooseStreamsAndSwitch_ = function(period) {\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Create empty object first and initialize the fields through\n // [] to allow field names to be expressions.\n var languageMatches = {};\n languageMatches[ContentType.AUDIO] = false;\n languageMatches[ContentType.TEXT] = false;\n\n var variants = shaka.util.StreamUtils.filterVariantsByRoleAndLanguage(\n period, this.currentAudioLanguage_, languageMatches,\n this.currentVariantRole_);\n var textStreams = shaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage(\n period, this.currentTextLanguage_, languageMatches,\n this.currentTextRole_);\n\n // chooseStreams_ filters out choices which are already active.\n var chosen = this.chooseStreams_(period, variants, textStreams);\n\n for (var type in chosen) {\n this.addToSwitchHistory_(chosen[type], /* fromAdaptation */ true);\n }\n\n // Because we're running this after a config change (manual language change),\n // a new text stream, or a key status event, and because active streams have\n // been filtered out already, it is always okay to clear the buffer for what\n // remains.\n this.deferredSwitch_(chosen, /* opt_clearBuffer */ true);\n\n // Send an adaptation event so that the UI can show the new language/tracks.\n this.onAdaptation_();\n\n if (chosen[ContentType.TEXT]) {\n // If audio and text tracks have different languages, and the text track\n // matches the user's preference, then show the captions.\n if (chosen[ContentType.AUDIO] &&\n languageMatches[ContentType.TEXT] &&\n chosen[ContentType.TEXT].language !=\n chosen[ContentType.AUDIO].language) {\n this.textTrack_.mode = 'showing';\n this.onTextTrackVisibility_();\n }\n }\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @param {!shakaExtern.Period} period\n * @return {!Object.<string, !shakaExtern.Stream>} A map of stream types to\n * chosen streams.\n * @private\n */\nshaka.Player.prototype.onChooseStreams_ = function(period) {\n shaka.log.debug('onChooseStreams_', period);\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n\n // We are switching Periods, so the AbrManager will be disabled. But if we\n // want to abr.enabled, we do not want to call AbrManager.enable before\n // canSwitch_ is called.\n this.switchingPeriods_ = true;\n this.config_.abr.manager.disable();\n\n shaka.log.debug('Choosing new streams after period changed');\n var variants = shaka.util.StreamUtils.filterVariantsByRoleAndLanguage(\n period, this.currentAudioLanguage_, /* opt_languageMatches */ undefined,\n this.currentVariantRole_);\n\n var textStreams = shaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage(\n period, this.currentTextLanguage_, /* opt_languageMatches */ undefined,\n this.currentTextRole_);\n\n shaka.log.v2('onChooseStreams_, variants and text streams: ',\n variants, textStreams);\n\n var chosen = this.chooseStreams_(\n period, variants, textStreams, /* opt_chooseAll */ true);\n shaka.log.v2('onChooseStreams_, chosen=', chosen);\n\n // Override the chosen streams with the ones picked in\n // selectVariant/TextTrack. NOTE: The apparent race between\n // selectVariant/TextTrack and period transition is handled by\n // StreamingEngine, which will re-request tracks for thetransition if any\n // of these deferred selections are from the wrong period.\n for (var type in this.deferredSwitches_) {\n // We are choosing initial tracks, so no segments from this Period have\n // been downloaded yet. Therefore, it is okay to ignore the .clearBuffer\n // member of this structure.\n chosen[type] = this.deferredSwitches_[type].stream;\n }\n this.deferredSwitches_ = {};\n\n for (var type in chosen) {\n this.addToSwitchHistory_(chosen[type], /* fromAdaptation */ true);\n }\n\n // Don't fire a tracks-changed event since we aren't inside the new Period\n // yet.\n\n return chosen;\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @private\n */\nshaka.Player.prototype.canSwitch_ = function() {\n shaka.log.debug('canSwitch_');\n this.switchingPeriods_ = false;\n if (this.config_.abr.enabled)\n this.config_.abr.manager.enable();\n\n // If we still have deferred switches, switch now.\n for (var type in this.deferredSwitches_) {\n var info = this.deferredSwitches_[type];\n this.streamingEngine_.switch(type, info.stream, info.clearBuffer);\n }\n this.deferredSwitches_ = {};\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @private\n */\nshaka.Player.prototype.onManifestUpdate_ = function() {\n if (this.parser_ && this.parser_.update)\n this.parser_.update();\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @private\n */\nshaka.Player.prototype.onSegmentAppended_ = function() {\n if (this.playhead_)\n this.playhead_.onSegmentAppended();\n};\n\n\n/**\n * Callback from AbrManager.\n *\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType,\n * !shakaExtern.Stream>} streamsByType\n * @param {boolean=} opt_clearBuffer\n * @private\n */\nshaka.Player.prototype.switch_ = function(streamsByType, opt_clearBuffer) {\n shaka.log.debug('switch_');\n goog.asserts.assert(this.config_.abr.enabled,\n 'AbrManager should not call switch while disabled!');\n goog.asserts.assert(!this.switchingPeriods_,\n 'AbrManager should not call switch while transitioning between Periods!');\n\n // We have adapted to a new stream, record it in the history. Only add if\n // we are actually switching the stream.\n var oldActive = this.streamingEngine_.getActiveStreams();\n for (var type in streamsByType) {\n var stream = streamsByType[type];\n if (oldActive[type] != stream) {\n this.addToSwitchHistory_(stream, /* fromAdaptation */ true);\n } else {\n // If it's the same, remove it from the map.\n // This allows us to avoid onAdaptation_() when nothing has changed.\n delete streamsByType[type];\n }\n }\n\n if (shaka.util.MapUtils.empty(streamsByType)) {\n // There's nothing to change.\n return;\n }\n\n if (!this.streamingEngine_) {\n // There's no way to change it.\n return;\n }\n\n for (var type in streamsByType) {\n var clearBuffer = opt_clearBuffer || false;\n this.streamingEngine_.switch(type, streamsByType[type], clearBuffer);\n }\n this.onAdaptation_();\n};\n\n\n/**\n * Dispatches a 'adaptation' event.\n * @private\n */\nshaka.Player.prototype.onAdaptation_ = function() {\n // In the next frame, dispatch a 'adaptation' event.\n // This gives StreamingEngine time to absorb the changes before the user\n // tries to query them.\n Promise.resolve().then(function() {\n if (this.destroyed_) return;\n var event = new shaka.util.FakeEvent('adaptation');\n this.dispatchEvent(event);\n }.bind(this));\n};\n\n\n/**\n * Dispatches a 'trackschanged' event.\n * @private\n */\nshaka.Player.prototype.onTracksChanged_ = function() {\n // In the next frame, dispatch a 'trackschanged' event.\n // This gives StreamingEngine time to absorb the changes before the user\n // tries to query them.\n Promise.resolve().then(function() {\n if (this.destroyed_) return;\n var event = new shaka.util.FakeEvent('trackschanged');\n this.dispatchEvent(event);\n }.bind(this));\n};\n\n\n/** @private */\nshaka.Player.prototype.onTextTrackVisibility_ = function() {\n var event = new shaka.util.FakeEvent('texttrackvisibility');\n this.dispatchEvent(event);\n};\n\n\n/**\n * @param {!shaka.util.Error} error\n * @private\n */\nshaka.Player.prototype.onError_ = function(error) {\n // Errors dispatched after destroy is called are irrelevant.\n if (this.destroyed_) return;\n\n goog.asserts.assert(error instanceof shaka.util.Error, 'Wrong error type!');\n\n var event = new shaka.util.FakeEvent('error', { 'detail': error });\n this.dispatchEvent(event);\n};\n\n\n/**\n * @param {shakaExtern.TimelineRegionInfo} region\n * @private\n */\nshaka.Player.prototype.onTimelineRegionAdded_ = function(region) {\n if (this.playheadObserver_) {\n this.playheadObserver_.addTimelineRegion(region);\n } else {\n this.pendingTimelineRegions_.push(region);\n }\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.Player.prototype.onEvent_ = function(event) {\n this.dispatchEvent(event);\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.Player.prototype.onVideoError_ = function(event) {\n if (!this.video_.error) return;\n\n var code = this.video_.error.code;\n if (code == 1 /* MEDIA_ERR_ABORTED */) {\n // Ignore this error code, which should only occur when navigating away or\n // deliberately stopping playback of HTTP content.\n return;\n }\n\n // Extra error information from MS Edge and IE11:\n var extended = this.video_.error.msExtendedCode;\n if (extended) {\n // Convert to unsigned:\n if (extended < 0) {\n extended += Math.pow(2, 32);\n }\n // Format as hex:\n extended = extended.toString(16);\n }\n\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.VIDEO_ERROR,\n code, extended));\n};\n\n\n/**\n * @param {!Object.<string, string>} keyStatusMap A map of hex key IDs to\n * statuses.\n * @private\n */\nshaka.Player.prototype.onKeyStatus_ = function(keyStatusMap) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n goog.asserts.assert(this.streamingEngine_, 'Should have been initialized.');\n // 'usable', 'released', 'output-downscaled', 'status-pending' are statuses\n // of the usable keys.\n // 'expired' status is being handled separately in DrmEngine.\n var restrictedStatuses = ['output-restricted', 'internal-error'];\n\n var period = this.streamingEngine_.getCurrentPeriod();\n var tracksChanged = false;\n\n period.variants.forEach(function(variant) {\n var streams = [];\n if (variant.audio) streams.push(variant.audio);\n if (variant.video) streams.push(variant.video);\n\n streams.forEach(function(stream) {\n var originalAllowed = variant.allowedByKeySystem;\n\n // Only update if we have a key ID for the stream. If the key isn't\n // present, then we don't have that key and it should be restricted.\n if (stream.keyId) {\n var keyStatus = keyStatusMap[stream.keyId];\n variant.allowedByKeySystem =\n !!keyStatus && restrictedStatuses.indexOf(keyStatus) < 0;\n }\n\n if (originalAllowed != variant.allowedByKeySystem) {\n tracksChanged = true;\n }\n });\n });\n\n var activeStreams = this.streamingEngine_.getActiveStreams();\n var activeVariant = shaka.util.StreamUtils.getVariantByStreams(\n activeStreams[ContentType.AUDIO], activeStreams[ContentType.VIDEO],\n period.variants);\n if (activeVariant && !activeVariant.allowedByKeySystem) {\n shaka.log.debug('Choosing new streams after key status changed');\n this.chooseStreamsAndSwitch_(period);\n }\n\n if (tracksChanged)\n this.onTracksChanged_();\n};\n\n\n/**\n * Callback from DrmEngine\n * @param {string} keyId\n * @param {number} expiration\n * @private\n */\nshaka.Player.prototype.onExpirationUpdated_ = function(keyId, expiration) {\n if (this.parser_ && this.parser_.onExpirationUpdated)\n this.parser_.onExpirationUpdated(keyId, expiration);\n\n var event = new shaka.util.FakeEvent('expirationupdated');\n this.dispatchEvent(event);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/player.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.XmlUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\n\n\n/**\n * @namespace shaka.util.XmlUtils\n * @summary A set of XML utility functions.\n */\n\n\n/**\n * Finds a child XML element.\n * @param {!Element} elem The parent XML element.\n * @param {string} name The child XML element's tag name.\n * @return {Element} The child XML element, or null if a child XML element does\n * not exist with the given tag name OR if there exists more than one\n * child XML element with the given tag name.\n */\nshaka.util.XmlUtils.findChild = function(elem, name) {\n var children = shaka.util.XmlUtils.findChildren(elem, name);\n if (children.length != 1)\n return null;\n return children[0];\n};\n\n\n/**\n * Finds child XML elements.\n * @param {!Element} elem The parent XML element.\n * @param {string} name The child XML element's tag name.\n * @return {!Array.<!Element>} The child XML elements.\n */\nshaka.util.XmlUtils.findChildren = function(elem, name) {\n return Array.prototype.filter.call(elem.childNodes, function(child) {\n goog.asserts.assert(\n child.tagName != name || child instanceof Element,\n 'child element should be an Element');\n return child.tagName == name;\n });\n};\n\n\n/**\n * Gets the text contents of a node.\n * @param {!Element} elem The XML element.\n * @return {?string} The text contents, or null if there are none.\n */\nshaka.util.XmlUtils.getContents = function(elem) {\n var contents = elem.firstChild;\n\n // check content\n if (!contents || contents.nodeType != Node.TEXT_NODE)\n return null;\n\n // read merged text content from all text nodes (fixes MSIE 11 bug)\n return elem.textContent.trim();\n};\n\n\n/**\n * Parses an attribute by its name.\n * @param {!Element} elem The XML element.\n * @param {string} name The attribute name.\n * @param {function(string): (T|null)} parseFunction A function that parses\n * the attribute.\n * @param {(T|null)=} opt_defaultValue The attribute's default value, if not\n * specified, the attibute's default value is null.\n * @return {(T|null)} The parsed attribute on success, or the attribute's\n * default value if the attribute does not exist or could not be parsed.\n * @template T\n */\nshaka.util.XmlUtils.parseAttr = function(\n elem, name, parseFunction, opt_defaultValue) {\n var parsedValue = null;\n\n var value = elem.getAttribute(name);\n if (value != null)\n parsedValue = parseFunction(value);\n\n if (parsedValue == null)\n return opt_defaultValue != undefined ? opt_defaultValue : null;\n\n return parsedValue;\n};\n\n\n/**\n * Parses an XML date string.\n * @param {string} dateString\n * @return {?number} The parsed date in seconds on success; otherwise, return\n * null.\n */\nshaka.util.XmlUtils.parseDate = function(dateString) {\n if (!dateString)\n return null;\n\n var result = Date.parse(dateString);\n return (!isNaN(result) ? Math.floor(result / 1000.0) : null);\n};\n\n\n/**\n * Parses an XML duration string.\n * Negative values are not supported. Years and months are treated as exactly\n * 365 and 30 days respectively.\n * @param {string} durationString The duration string, e.g., \"PT1H3M43.2S\",\n * which means 1 hour, 3 minutes, and 43.2 seconds.\n * @return {?number} The parsed duration in seconds on success; otherwise,\n * return null.\n * @see {@link http://www.datypic.com/sc/xsd/t-xsd_duration.html}\n */\nshaka.util.XmlUtils.parseDuration = function(durationString) {\n if (!durationString)\n return null;\n\n var re = '^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?' +\n '(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$';\n var matches = new RegExp(re).exec(durationString);\n\n if (!matches) {\n shaka.log.warning('Invalid duration string:', durationString);\n return null;\n }\n\n // Note: Number(null) == 0 but Number(undefined) == NaN.\n var years = Number(matches[1] || null);\n var months = Number(matches[2] || null);\n var days = Number(matches[3] || null);\n var hours = Number(matches[4] || null);\n var minutes = Number(matches[5] || null);\n var seconds = Number(matches[6] || null);\n\n // Assume a year always has 365 days and a month always has 30 days.\n var d = (60 * 60 * 24 * 365) * years +\n (60 * 60 * 24 * 30) * months +\n (60 * 60 * 24) * days +\n (60 * 60) * hours +\n 60 * minutes +\n seconds;\n return isFinite(d) ? d : null;\n};\n\n\n/**\n * Parses a range string.\n * @param {string} rangeString The range string, e.g., \"101-9213\".\n * @return {?{start: number, end: number}} The parsed range on success;\n * otherwise, return null.\n */\nshaka.util.XmlUtils.parseRange = function(rangeString) {\n var matches = /([0-9]+)-([0-9]+)/.exec(rangeString);\n\n if (!matches)\n return null;\n\n var start = Number(matches[1]);\n if (!isFinite(start))\n return null;\n\n var end = Number(matches[2]);\n if (!isFinite(end))\n return null;\n\n return {start: start, end: end};\n};\n\n\n/**\n * Parses an integer.\n * @param {string} intString The integer string.\n * @return {?number} The parsed integer on success; otherwise, return null.\n */\nshaka.util.XmlUtils.parseInt = function(intString) {\n var n = Number(intString);\n return (n % 1 === 0) ? n : null;\n};\n\n\n/**\n * Parses a positive integer.\n * @param {string} intString The integer string.\n * @return {?number} The parsed positive integer on success; otherwise,\n * return null.\n */\nshaka.util.XmlUtils.parsePositiveInt = function(intString) {\n var n = Number(intString);\n return (n % 1 === 0) && (n > 0) ? n : null;\n};\n\n\n/**\n * Parses a non-negative integer.\n * @param {string} intString The integer string.\n * @return {?number} The parsed non-negative integer on success; otherwise,\n * return null.\n */\nshaka.util.XmlUtils.parseNonNegativeInt = function(intString) {\n var n = Number(intString);\n return (n % 1 === 0) && (n >= 0) ? n : null;\n};\n\n\n/**\n * Parses a floating point number.\n * @param {string} floatString The floating point number string.\n * @return {?number} The parsed floating point number on success; otherwise,\n * return null. May return -Infinity or Infinity.\n */\nshaka.util.XmlUtils.parseFloat = function(floatString) {\n var n = Number(floatString);\n return !isNaN(n) ? n : null;\n};\n\n\n/**\n * Evaluate a division expressed as a string\n * @param {string} exprString\n * The expression to evaluate, e.g. \"200/2\". Can also be a single number\n * @return {?number} The evaluated expression as floating point number on\n * success; otherwise return null.\n */\nshaka.util.XmlUtils.evalDivision = function(exprString) {\n var res;\n var n;\n if (res = exprString.match(/^(\\d+)\\/(\\d+)$/)) {\n n = Number(res[1] / res[2]);\n } else {\n n = Number(exprString);\n }\n return !isNaN(n) ? n : null;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/xml_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.ContentProtection');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.Uint8ArrayUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.ContentProtection\n * @summary A set of functions for parsing and interpreting ContentProtection\n * elements.\n */\n\n\n/**\n * @typedef {{\n * defaultKeyId: ?string,\n * defaultInit: Array.<shakaExtern.InitDataOverride>,\n * drmInfos: !Array.<shakaExtern.DrmInfo>,\n * firstRepresentation: boolean\n * }}\n *\n * @description\n * Contains information about the ContentProtection elements found at the\n * AdaptationSet level.\n *\n * @property {?string} defaultKeyId\n * The default key ID to use. This is used by parseKeyIds as a default. This\n * can be null to indicate that there is no default.\n * @property {Array.<shakaExtern.InitDataOverride>} defaultInit\n * The default init data override. This can be null to indicate that there\n * is no default.\n * @property {!Array.<shakaExtern.DrmInfo>} drmInfos\n * The DrmInfo objects.\n * @property {boolean} firstRepresentation\n * True when first parsed; changed to false after the first call to\n * parseKeyIds. This is used to determine if a dummy key-system should be\n * overwritten; namely that the first representation can replace the dummy\n * from the AdaptationSet.\n */\nshaka.dash.ContentProtection.Context;\n\n\n/**\n * @typedef {{\n * node: !Element,\n * schemeUri: string,\n * keyId: ?string,\n * init: Array.<shakaExtern.InitDataOverride>\n * }}\n *\n * @description\n * The parsed result of a single ContentProtection element.\n *\n * @property {!Element} node\n * The ContentProtection XML element.\n * @property {string} schemeUri\n * The scheme URI.\n * @property {?string} keyId\n * The default key ID, if present.\n * @property {Array.<shakaExtern.InitDataOverride>} init\n * The init data, if present. If there is no init data, it will be null. If\n * this is non-null, there is at least one element.\n */\nshaka.dash.ContentProtection.Element;\n\n\n/**\n * A map of scheme URI to key system name.\n *\n * @const {!Object.<string, string>}\n * @private\n */\nshaka.dash.ContentProtection.defaultKeySystems_ = {\n 'urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b': 'org.w3.clearkey',\n 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed': 'com.widevine.alpha',\n 'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95': 'com.microsoft.playready',\n 'urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb': 'com.adobe.primetime'\n};\n\n\n/**\n * @const {string}\n * @private\n */\nshaka.dash.ContentProtection.MP4Protection_ =\n 'urn:mpeg:dash:mp4protection:2011';\n\n\n/**\n * Parses info from the ContentProtection elements at the AdaptationSet level.\n *\n * @param {!Array.<!Element>} elems\n * @param {shakaExtern.DashContentProtectionCallback} callback\n * @param {boolean} ignoreDrmInfo\n * @return {shaka.dash.ContentProtection.Context}\n */\nshaka.dash.ContentProtection.parseFromAdaptationSet = function(\n elems, callback, ignoreDrmInfo) {\n var ContentProtection = shaka.dash.ContentProtection;\n var Functional = shaka.util.Functional;\n var MapUtils = shaka.util.MapUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var parsed = ContentProtection.parseElements_(elems);\n /** @type {Array.<shakaExtern.InitDataOverride>} */\n var defaultInit = null;\n /** @type {?string} */\n var defaultKeyId = null;\n /** @type {!Array.<shakaExtern.DrmInfo>} */\n var drmInfos = [];\n var parsedNonCenc = [];\n\n // Get the default key ID; if there are multiple, they must all match.\n var keyIds = parsed.map(function(elem) { return elem.keyId; })\n .filter(Functional.isNotNull);\n if (keyIds.length > 0) {\n defaultKeyId = keyIds[0];\n if (keyIds.some(Functional.isNotEqualFunc(defaultKeyId))) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_CONFLICTING_KEY_IDS);\n }\n }\n\n if (!ignoreDrmInfo) {\n // Find the default key ID and init data. Create a new array of all the\n // non-CENC elements.\n parsedNonCenc = parsed.filter(function(elem) {\n if (elem.schemeUri == ContentProtection.MP4Protection_) {\n goog.asserts.assert(!elem.init || elem.init.length,\n 'Init data must be null or non-empty.');\n defaultInit = elem.init || defaultInit;\n return false;\n } else {\n return true;\n }\n });\n\n if (parsedNonCenc.length > 0) {\n drmInfos = ContentProtection.convertElements_(\n defaultInit, callback, parsedNonCenc);\n\n // If there are no drmInfos after parsing, then add a dummy entry.\n // This may be removed in parseKeyIds.\n if (drmInfos.length == 0) {\n drmInfos = [ManifestParserUtils.createDrmInfo('', defaultInit)];\n }\n }\n }\n\n // If there are only CENC element(s) or ignoreDrmInfo flag is set, assume all\n // key-systems are supported.\n if (parsed.length > 0 && (ignoreDrmInfo || !parsedNonCenc.length)) {\n var keySystems = ContentProtection.defaultKeySystems_;\n drmInfos =\n MapUtils.values(keySystems)\n .map(function(keySystem) {\n return ManifestParserUtils.createDrmInfo(keySystem, defaultInit);\n });\n }\n\n // attach the default keyId, if it exists, to every initData\n if (defaultKeyId) {\n drmInfos.forEach(function(drmInfo) {\n drmInfo.initData.forEach(function(initData) {\n initData.keyId = defaultKeyId;\n });\n });\n }\n\n return {\n defaultKeyId: defaultKeyId,\n defaultInit: defaultInit,\n drmInfos: drmInfos,\n firstRepresentation: true\n };\n};\n\n\n/**\n * Parses the given ContentProtection elements found at the Representation\n * level. This may update the |context|.\n *\n * @param {!Array.<!Element>} elems\n * @param {shakaExtern.DashContentProtectionCallback} callback\n * @param {shaka.dash.ContentProtection.Context} context\n * @param {boolean} ignoreDrmInfo\n * @return {?string} The parsed key ID\n */\nshaka.dash.ContentProtection.parseFromRepresentation = function(\n elems, callback, context, ignoreDrmInfo) {\n var ContentProtection = shaka.dash.ContentProtection;\n var repContext = ContentProtection.parseFromAdaptationSet(\n elems, callback, ignoreDrmInfo);\n\n if (context.firstRepresentation) {\n var asUnknown = context.drmInfos.length == 1 &&\n !context.drmInfos[0].keySystem;\n var asUnencrypted = context.drmInfos.length == 0;\n var repUnencrypted = repContext.drmInfos.length == 0;\n\n // There are two cases when we need to replace the |drmInfos| in the context\n // with those in the Representation:\n // * The AdaptationSet does not list any ContentProtection.\n // * The AdaptationSet only lists unknown key-systems.\n if (asUnencrypted || (asUnknown && !repUnencrypted)) {\n context.drmInfos = repContext.drmInfos;\n }\n context.firstRepresentation = false;\n } else if (repContext.drmInfos.length > 0) {\n // If this is not the first Representation, then we need to remove entries\n // from the context that do not appear in this Representation.\n context.drmInfos = context.drmInfos.filter(function(asInfo) {\n return repContext.drmInfos.some(function(repInfo) {\n return repInfo.keySystem == asInfo.keySystem;\n });\n });\n // If we have filtered out all key-systems, throw an error.\n if (context.drmInfos.length == 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_COMMON_KEY_SYSTEM);\n }\n }\n\n return repContext.defaultKeyId || context.defaultKeyId;\n};\n\n\n/**\n * Creates DrmInfo objects from the given element.\n *\n * @param {Array.<shakaExtern.InitDataOverride>} defaultInit\n * @param {shakaExtern.DashContentProtectionCallback} callback\n * @param {!Array.<shaka.dash.ContentProtection.Element>} elements\n * @return {!Array.<shakaExtern.DrmInfo>}\n * @private\n */\nshaka.dash.ContentProtection.convertElements_ = function(\n defaultInit, callback, elements) {\n var Functional = shaka.util.Functional;\n return elements.map(\n /**\n * @param {shaka.dash.ContentProtection.Element} element\n * @return {!Array.<shakaExtern.DrmInfo>}\n */\n function(element) {\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var ContentProtection = shaka.dash.ContentProtection;\n var keySystem = ContentProtection.defaultKeySystems_[element.schemeUri];\n if (keySystem) {\n goog.asserts.assert(!element.init || element.init.length,\n 'Init data must be null or non-empty.');\n var initData = element.init || defaultInit;\n return [ManifestParserUtils.createDrmInfo(keySystem, initData)];\n } else {\n goog.asserts.assert(\n callback, 'ContentProtection callback is required');\n return callback(element.node) || [];\n }\n }).reduce(Functional.collapseArrays, []);\n};\n\n\n/**\n * Parses the given ContentProtection elements. If there is an error, it\n * removes those elements.\n *\n * @param {!Array.<!Element>} elems\n * @return {!Array.<shaka.dash.ContentProtection.Element>}\n * @private\n */\nshaka.dash.ContentProtection.parseElements_ = function(elems) {\n var Functional = shaka.util.Functional;\n return elems.map(\n /**\n * @param {!Element} elem\n * @return {?shaka.dash.ContentProtection.Element}\n */\n function(elem) {\n /** @type {?string} */\n var schemeUri = elem.getAttribute('schemeIdUri');\n /** @type {?string} */\n var keyId = elem.getAttribute('cenc:default_KID');\n /** @type {!Array.<string>} */\n var psshs = shaka.util.XmlUtils.findChildren(elem, 'cenc:pssh')\n .map(shaka.util.XmlUtils.getContents);\n\n if (!schemeUri) {\n shaka.log.error('Missing required schemeIdUri attribute on',\n 'ContentProtection element', elem);\n return null;\n }\n\n schemeUri = schemeUri.toLowerCase();\n if (keyId) {\n keyId = keyId.replace(/-/g, '').toLowerCase();\n if (keyId.indexOf(' ') >= 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED);\n }\n }\n\n /** @type {!Array.<shakaExtern.InitDataOverride>} */\n var init = [];\n try {\n init = psshs.map(function(pssh) {\n /** @type {shakaExtern.InitDataOverride} */\n var ret = {\n initDataType: 'cenc',\n initData: shaka.util.Uint8ArrayUtils.fromBase64(pssh),\n keyId: null\n };\n return ret;\n });\n } catch (e) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_PSSH_BAD_ENCODING);\n }\n\n /** @type {shaka.dash.ContentProtection.Element} */\n var element = {\n node: elem,\n schemeUri: schemeUri,\n keyId: keyId,\n init: (init.length > 0 ? init : null)\n };\n return element;\n }).filter(Functional.isNotNull);\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/content_protection.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.MpdUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.MpdUtils\n * @summary MPD processing utility functions.\n */\n\n\n/**\n * @typedef {{\n * start: number,\n * unscaledStart: number,\n * end: number\n * }}\n *\n * @description\n * Defines a time range of a media segment. Times are in seconds.\n *\n * @property {number} start\n * The start time of the range.\n * @property {number} unscaledStart\n * The start time of the range in representation timescale units.\n * @property {number} end\n * The end time (exclusive) of the range.\n */\nshaka.dash.MpdUtils.TimeRange;\n\n\n/**\n * @typedef {{\n * timescale: number,\n * segmentDuration: ?number,\n * startNumber: number,\n * presentationTimeOffset: number,\n * unscaledPresentationTimeOffset: number,\n * timeline: Array.<shaka.dash.MpdUtils.TimeRange>\n * }}\n *\n * @description\n * Contains common information between SegmentList and SegmentTemplate items.\n *\n * @property {number} timescale\n * The time-scale of the representation.\n * @property {?number} segmentDuration\n * The duration of the segments in seconds, if given.\n * @property {number} startNumber\n * The start number of the segments; 1 or greater.\n * @property {number} presentationTimeOffset\n * The presentationTimeOffset of the representation, in seconds.\n * @property {number} unscaledPresentationTimeOffset\n * The presentationTimeOffset of the representation, in timescale units.\n * @property {Array.<shaka.dash.MpdUtils.TimeRange>} timeline\n * The timeline of the representation, if given. Times in seconds.\n */\nshaka.dash.MpdUtils.SegmentInfo;\n\n\n/**\n * Fills a SegmentTemplate URI template. This function does not validate the\n * resulting URI.\n *\n * @param {string} uriTemplate\n * @param {?string} representationId\n * @param {?number} number\n * @param {?number} bandwidth\n * @param {?number} time\n * @return {string} A URI string.\n * @see ISO/IEC 23009-1:2014 section 5.3.9.4.4\n */\nshaka.dash.MpdUtils.fillUriTemplate = function(\n uriTemplate, representationId, number, bandwidth, time) {\n if (time != null) {\n goog.asserts.assert(Math.abs(time - Math.round(time)) < 0.2,\n 'Calculated $Time$ values must be close to integers!');\n time = Math.round(time);\n }\n\n /** @type {!Object.<string, ?number|?string>} */\n var valueTable = {\n 'RepresentationID': representationId,\n 'Number': number,\n 'Bandwidth': bandwidth,\n 'Time': time\n };\n\n var re = /\\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)d)?\\$/g;\n var uri = uriTemplate.replace(re, function(match, name, widthString) {\n if (match == '$$') {\n return '$';\n }\n\n var value = valueTable[name];\n goog.asserts.assert(value !== undefined, 'Unrecognized identifier');\n\n // Note that |value| may be 0 or ''.\n if (value == null) {\n shaka.log.warning(\n 'URL template does not have an available substitution for identifier',\n '\"' + name + '\":',\n uriTemplate);\n return match;\n }\n\n if (name == 'RepresentationID' && widthString) {\n shaka.log.warning(\n 'URL template should not contain a width specifier for identifier',\n '\"RepresentationID\":',\n uriTemplate);\n widthString = undefined;\n }\n\n var valueString = value.toString();\n\n // Create padding string.\n var width = window.parseInt(widthString, 10) || 1;\n var paddingSize = Math.max(0, width - valueString.length);\n var padding = (new Array(paddingSize + 1)).join('0');\n\n return padding + valueString;\n });\n\n return uri;\n};\n\n\n/**\n * Expands a SegmentTimeline into an array-based timeline. The results are in\n * seconds.\n *\n * @param {!Element} segmentTimeline\n * @param {number} timescale\n * @param {number} presentationTimeOffset\n * @param {number} periodDuration The Period's duration in seconds.\n * Infinity indicates that the Period continues indefinitely.\n * @return {!Array.<shaka.dash.MpdUtils.TimeRange>}\n */\nshaka.dash.MpdUtils.createTimeline = function(\n segmentTimeline, timescale, presentationTimeOffset, periodDuration) {\n goog.asserts.assert(\n timescale > 0 && timescale < Infinity,\n 'timescale must be a positive, finite integer');\n goog.asserts.assert(periodDuration > 0,\n 'period duration must be a positive integer');\n\n // Alias.\n var XmlUtils = shaka.util.XmlUtils;\n\n var timePoints = XmlUtils.findChildren(segmentTimeline, 'S');\n\n /** @type {!Array.<shaka.dash.MpdUtils.TimeRange>} */\n var timeline = [];\n var lastEndTime = 0;\n\n for (var i = 0; i < timePoints.length; ++i) {\n var timePoint = timePoints[i];\n var t = XmlUtils.parseAttr(timePoint, 't', XmlUtils.parseNonNegativeInt);\n var d = XmlUtils.parseAttr(timePoint, 'd', XmlUtils.parseNonNegativeInt);\n var r = XmlUtils.parseAttr(timePoint, 'r', XmlUtils.parseInt);\n\n // Adjust start considering the presentation time offset\n if (t != null)\n t -= presentationTimeOffset;\n\n if (!d) {\n shaka.log.warning(\n '\"S\" element must have a duration:',\n 'ignoring the remaining \"S\" elements.',\n timePoint);\n return timeline;\n }\n\n var startTime = t != null ? t : lastEndTime;\n\n var repeat = r || 0;\n if (repeat < 0) {\n if (i + 1 < timePoints.length) {\n var nextTimePoint = timePoints[i + 1];\n var nextStartTime = XmlUtils.parseAttr(\n nextTimePoint, 't', XmlUtils.parseNonNegativeInt);\n if (nextStartTime == null) {\n shaka.log.warning(\n '\"S\" element cannot have a negative repeat',\n 'if the next \"S\" element does not have a valid start time:',\n 'ignoring the remaining \"S\" elements.',\n timePoint);\n return timeline;\n } else if (startTime >= nextStartTime) {\n shaka.log.warning(\n '\"S\" element cannot have a negative repeat',\n 'if its start time exceeds the next \"S\" element\\'s start time:',\n 'ignoring the remaining \"S\" elements.',\n timePoint);\n return timeline;\n }\n repeat = Math.ceil((nextStartTime - startTime) / d) - 1;\n } else {\n if (periodDuration == Infinity) {\n // The DASH spec. actually allows the last \"S\" element to have a\n // negative repeat value even when the Period has an infinite\n // duration. No one uses this feature and no one ever should, ever.\n shaka.log.warning(\n 'The last \"S\" element cannot have a negative repeat',\n 'if the Period has an infinite duration:',\n 'ignoring the last \"S\" element.',\n timePoint);\n return timeline;\n } else if (startTime / timescale >= periodDuration) {\n shaka.log.warning(\n 'The last \"S\" element cannot have a negative repeat',\n 'if its start time exceeds the Period\\'s duration:',\n 'igoring the last \"S\" element.',\n timePoint);\n return timeline;\n }\n repeat = Math.ceil((periodDuration * timescale - startTime) / d) - 1;\n }\n }\n\n // The end of the last segment may end before the start of the current\n // segment (a gap) or may end after the start of the current segment (an\n // overlap). If there is a gap/overlap then stretch/compress the end of\n // the last segment to the start of the current segment.\n //\n // Note: it is possible to move the start of the current segment to the\n // end of the last segment, but this would complicate the computation of\n // the $Time$ placeholder later on.\n if ((timeline.length > 0) && (startTime != lastEndTime)) {\n var delta = startTime - lastEndTime;\n\n if (Math.abs(delta / timescale) >=\n shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS) {\n shaka.log.warning(\n 'SegmentTimeline contains a large gap/overlap:',\n 'the content may have errors in it.',\n timePoint);\n }\n\n timeline[timeline.length - 1].end = startTime / timescale;\n }\n\n for (var j = 0; j <= repeat; ++j) {\n var endTime = startTime + d;\n var item = {\n start: startTime / timescale,\n end: endTime / timescale,\n unscaledStart: startTime\n };\n timeline.push(item);\n\n startTime = endTime;\n lastEndTime = endTime;\n }\n }\n\n return timeline;\n};\n\n\n/**\n * Parses common segment info for SegmentList and SegmentTemplate.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * Gets the element that contains the segment info.\n * @return {shaka.dash.MpdUtils.SegmentInfo}\n */\nshaka.dash.MpdUtils.parseSegmentInfo = function(context, callback) {\n goog.asserts.assert(\n callback(context.representation),\n 'There must be at least one element of the given type.');\n var MpdUtils = shaka.dash.MpdUtils;\n var XmlUtils = shaka.util.XmlUtils;\n\n var timescaleStr = MpdUtils.inheritAttribute(context, callback, 'timescale');\n var timescale = 1;\n if (timescaleStr) {\n timescale = XmlUtils.parsePositiveInt(timescaleStr) || 1;\n }\n\n var durationStr = MpdUtils.inheritAttribute(context, callback, 'duration');\n var segmentDuration = XmlUtils.parsePositiveInt(durationStr || '');\n if (segmentDuration) {\n segmentDuration /= timescale;\n }\n\n var startNumberStr =\n MpdUtils.inheritAttribute(context, callback, 'startNumber');\n var presentationTimeOffset =\n MpdUtils.inheritAttribute(context, callback, 'presentationTimeOffset');\n var startNumber = XmlUtils.parseNonNegativeInt(startNumberStr || '');\n if (startNumberStr == null || startNumber == null)\n startNumber = 1;\n\n var timelineNode =\n MpdUtils.inheritChild(context, callback, 'SegmentTimeline');\n /** @type {Array.<shaka.dash.MpdUtils.TimeRange>} */\n var timeline = null;\n if (timelineNode) {\n timeline = MpdUtils.createTimeline(\n timelineNode, timescale, Number(presentationTimeOffset),\n context.periodInfo.duration || Infinity);\n }\n\n var pto = (Number(presentationTimeOffset) / timescale) || 0;\n return {\n timescale: timescale,\n segmentDuration: segmentDuration,\n startNumber: startNumber,\n presentationTimeOffset: pto,\n unscaledPresentationTimeOffset: Number(presentationTimeOffset),\n timeline: timeline\n };\n};\n\n\n/**\n * Searches the inheritance for a Segment* with the given attribute.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * Gets the Element that contains the attribute to inherit.\n * @param {string} attribute\n * @return {?string}\n */\nshaka.dash.MpdUtils.inheritAttribute = function(context, callback, attribute) {\n var Functional = shaka.util.Functional;\n goog.asserts.assert(\n callback(context.representation),\n 'There must be at least one element of the given type');\n\n /** @type {!Array.<!Element>} */\n var nodes = [\n callback(context.representation),\n callback(context.adaptationSet),\n callback(context.period)\n ].filter(Functional.isNotNull);\n\n return nodes\n .map(function(s) { return s.getAttribute(attribute); })\n .reduce(function(all, part) { return all || part; });\n};\n\n\n/**\n * Searches the inheritance for a Segment* with the given child.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * Gets the Element that contains the child to inherit.\n * @param {string} child\n * @return {Element}\n */\nshaka.dash.MpdUtils.inheritChild = function(context, callback, child) {\n var Functional = shaka.util.Functional;\n goog.asserts.assert(\n callback(context.representation),\n 'There must be at least one element of the given type');\n\n /** @type {!Array.<!Element>} */\n var nodes = [\n callback(context.representation),\n callback(context.adaptationSet),\n callback(context.period)\n ].filter(Functional.isNotNull);\n\n var XmlUtils = shaka.util.XmlUtils;\n return nodes\n .map(function(s) { return XmlUtils.findChild(s, child); })\n .reduce(function(all, part) { return all || part; });\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/mpd_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.InitSegmentReference');\ngoog.provide('shaka.media.SegmentReference');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Creates an InitSegmentReference, which provides the location to an\n * initialization segment.\n *\n * @param {function():!Array.<string>} uris\n * A function that creates the URIs of the resource containing the segment.\n * @param {number} startByte The offset from the start of the resource to the\n * start of the segment.\n * @param {?number} endByte The offset from the start of the resource to the\n * end of the segment, inclusive. null indicates that the segment extends\n * to the end of the resource.\n *\n * @constructor\n * @struct\n * @export\n */\nshaka.media.InitSegmentReference = function(uris, startByte, endByte) {\n /** @type {function():!Array.<string>} */\n this.getUris = uris;\n\n /** @const {number} */\n this.startByte = startByte;\n\n /** @const {?number} */\n this.endByte = endByte;\n};\n\n\n\n/**\n * Creates a SegmentReference, which provides the start time, end time, and\n * location to a media segment.\n *\n * @param {number} position The segment's position within a particular Period.\n * The following should hold true between any two SegmentReferences from the\n * same Period, r1 and r2:\n * IF r2.position > r1.position THEN\n * [ (r2.startTime > r1.startTime) OR\n * (r2.startTime == r1.startTime AND r2.endTime >= r1.endTime) ]\n * @param {number} startTime The segment's start time in seconds, relative to\n * the start of a particular Period.\n * @param {number} endTime The segment's end time in seconds, relative to\n * the start of a particular Period. The segment ends the instant before\n * this time, so |endTime| must be strictly greater than |startTime|.\n * @param {function():!Array.<string>} uris\n * A function that creates the URIs of the resource containing the segment.\n * @param {number} startByte The offset from the start of the resource to the\n * start of the segment.\n * @param {?number} endByte The offset from the start of the resource to the\n * end of the segment, inclusive. null indicates that the segment extends\n * to the end of the resource.\n *\n * @constructor\n * @struct\n * @export\n */\nshaka.media.SegmentReference = function(\n position, startTime, endTime, uris, startByte, endByte) {\n goog.asserts.assert(startTime < endTime,\n 'startTime must be less than endTime');\n goog.asserts.assert((startByte < endByte) || (endByte == null),\n 'startByte must be < endByte');\n /** @const {number} */\n this.position = position;\n\n /** @const {number} */\n this.startTime = startTime;\n\n /** @const {number} */\n this.endTime = endTime;\n\n /** @type {function():!Array.<string>} */\n this.getUris = uris;\n\n /** @const {number} */\n this.startByte = startByte;\n\n /** @const {?number} */\n this.endByte = endByte;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/segment_reference.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.DataViewReader');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\n\n\n\n/**\n * Creates a DataViewReader, which abstracts a DataView object.\n *\n * @param {!DataView} dataView The DataView.\n * @param {shaka.util.DataViewReader.Endianness} endianness The endianness.\n *\n * @struct\n * @constructor\n * @export\n */\nshaka.util.DataViewReader = function(dataView, endianness) {\n /** @private {!DataView} */\n this.dataView_ = dataView;\n\n /** @private {boolean} */\n this.littleEndian_ =\n endianness == shaka.util.DataViewReader.Endianness.LITTLE_ENDIAN;\n\n /** @private {number} */\n this.position_ = 0;\n};\n\n\n/**\n * Endianness.\n * @enum {number}\n * @export\n */\nshaka.util.DataViewReader.Endianness = {\n BIG_ENDIAN: 0,\n LITTLE_ENDIAN: 1\n};\n\n\n/**\n * @return {boolean} True if the reader has more data, false otherwise.\n * @export\n */\nshaka.util.DataViewReader.prototype.hasMoreData = function() {\n return this.position_ < this.dataView_.byteLength;\n};\n\n\n/**\n * Gets the current byte position.\n * @return {number}\n * @export\n */\nshaka.util.DataViewReader.prototype.getPosition = function() {\n return this.position_;\n};\n\n\n/**\n * Gets the byte length of the DataView.\n * @return {number}\n * @export\n */\nshaka.util.DataViewReader.prototype.getLength = function() {\n return this.dataView_.byteLength;\n};\n\n\n/**\n * Reads an unsigned 8 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint8 = function() {\n try {\n var value = this.dataView_.getUint8(this.position_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 1;\n return value;\n};\n\n\n/**\n * Reads an unsigned 16 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint16 = function() {\n try {\n var value = this.dataView_.getUint16(this.position_, this.littleEndian_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 2;\n return value;\n};\n\n\n/**\n * Reads an unsigned 32 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint32 = function() {\n try {\n var value = this.dataView_.getUint32(this.position_, this.littleEndian_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 4;\n return value;\n};\n\n\n/**\n * Reads a signed 32 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readInt32 = function() {\n try {\n var value = this.dataView_.getInt32(this.position_, this.littleEndian_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 4;\n return value;\n};\n\n\n/**\n * Reads an unsigned 64 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view or\n * when reading an integer too large to store accurately in JavaScript.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint64 = function() {\n var low, high;\n\n try {\n if (this.littleEndian_) {\n low = this.dataView_.getUint32(this.position_, true);\n high = this.dataView_.getUint32(this.position_ + 4, true);\n } else {\n high = this.dataView_.getUint32(this.position_, false);\n low = this.dataView_.getUint32(this.position_ + 4, false);\n }\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n\n if (high > 0x1FFFFF) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.JS_INTEGER_OVERFLOW);\n }\n\n this.position_ += 8;\n\n // NOTE: This is subtle, but in JavaScript you can't shift left by 32 and get\n // the full range of 53-bit values possible. You must multiply by 2^32.\n return (high * Math.pow(2, 32)) + low;\n};\n\n\n/**\n * Reads the specified number of raw bytes.\n * @param {number} bytes The number of bytes to read.\n * @return {!Uint8Array}\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readBytes = function(bytes) {\n goog.asserts.assert(bytes > 0, 'Bad call to DataViewReader.readBytes');\n if (this.position_ + bytes > this.dataView_.byteLength) {\n this.throwOutOfBounds_();\n }\n var value = this.dataView_.buffer.slice(\n this.position_, this.position_ + bytes);\n this.position_ += bytes;\n return new Uint8Array(value);\n};\n\n\n/**\n * Skips the specified number of bytes.\n * @param {number} bytes The number of bytes to skip.\n * @throws {shaka.util.Error} when skipping past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.skip = function(bytes) {\n goog.asserts.assert(bytes >= 0, 'Bad call to DataViewReader.skip');\n if (this.position_ + bytes > this.dataView_.byteLength) {\n this.throwOutOfBounds_();\n }\n this.position_ += bytes;\n};\n\n\n/**\n * Keeps reading until it reaches a byte that equals to zero. The text is\n * assumed to be UTF-8.\n * @return {string}\n * @export\n */\nshaka.util.DataViewReader.prototype.readTerminatedString = function() {\n var start = this.position_;\n while (this.hasMoreData()) {\n var value = this.dataView_.getUint8(this.position_);\n if (value == 0) break;\n this.position_ += 1;\n }\n\n var ret = this.dataView_.buffer.slice(start, this.position_);\n // skip string termination\n this.position_ += 1;\n return shaka.util.StringUtils.fromUTF8(ret);\n};\n\n\n/**\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.util.DataViewReader.prototype.throwOutOfBounds_ = function() {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.BUFFER_READ_OUT_OF_BOUNDS);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/data_view_reader.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Mp4Parser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.DataViewReader');\n\n\n\n/**\n * Create a new MP4 Parser\n * @struct\n * @constructor\n * @export\n */\nshaka.util.Mp4Parser = function() {\n /**\n * @type {!Object.<number, shaka.util.Mp4Parser.BoxType_>}\n * @private\n */\n this.headers_ = [];\n\n /**\n * @type {!Object.<number, !shaka.util.Mp4Parser.CallbackType>}\n * @private\n */\n this.boxDefinitions_ = [];\n};\n\n\n/**\n * @typedef {{\n * parser: !shaka.util.Mp4Parser,\n * start: number,\n * size: number,\n * version: ?number,\n * flags: ?number,\n * reader: !shaka.util.DataViewReader\n * }}\n *\n * @property {!shaka.util.Mp4Parser} parser\n * The parser that parsed this box. The parser can be used to parse child\n * boxes where the configuration of the current parser is needed to parsed\n * other boxes.\n * @property {number} start\n * The start of this box (before the header) in the original buffer. This\n * start position is the absolute position.\n * @property {number} size\n * The size of this box (including the header).\n * @property {?number} version\n * The version for a full box, null for basic boxes.\n * @property {?number} flags\n * The flags for a full box, null for basic boxes.\n * @property {!shaka.util.DataViewReader} reader\n * The reader for this box is only for this box. Reading or not reading to\n * the end will have no affect on the parser reading other sibling boxes.\n * @exportInterface\n */\nshaka.util.Mp4Parser.ParsedBox;\n\n\n/**\n * @typedef {function(!shaka.util.Mp4Parser.ParsedBox)}\n * @exportInterface\n */\nshaka.util.Mp4Parser.CallbackType;\n\n\n/**\n * An enum used to track the type of box so that the correct values can be\n * read from the header.\n *\n * @enum {number}\n * @private\n */\nshaka.util.Mp4Parser.BoxType_ = {\n BASIC_BOX: 0,\n FULL_BOX: 1\n};\n\n\n/**\n * Delcare a box type as a Box.\n *\n * @param {string} type\n * @param {!shaka.util.Mp4Parser.CallbackType} definition\n * @return {!shaka.util.Mp4Parser}\n * @export\n */\nshaka.util.Mp4Parser.prototype.box = function(type, definition) {\n var typeCode = shaka.util.Mp4Parser.typeFromString_(type);\n this.headers_[typeCode] = shaka.util.Mp4Parser.BoxType_.BASIC_BOX;\n this.boxDefinitions_[typeCode] = definition;\n return this;\n};\n\n\n/**\n * Declare a box type as a Full Box.\n *\n * @param {string} type\n * @param {!shaka.util.Mp4Parser.CallbackType} definition\n * @return {!shaka.util.Mp4Parser}\n * @export\n */\nshaka.util.Mp4Parser.prototype.fullBox = function(type, definition) {\n var typeCode = shaka.util.Mp4Parser.typeFromString_(type);\n this.headers_[typeCode] = shaka.util.Mp4Parser.BoxType_.FULL_BOX;\n this.boxDefinitions_[typeCode] = definition;\n return this;\n};\n\n\n/**\n * Parse the given data using the added callbacks.\n *\n * @param {!ArrayBuffer} data\n * @export\n */\nshaka.util.Mp4Parser.prototype.parse = function(data) {\n var reader = new shaka.util.DataViewReader(\n new DataView(data),\n shaka.util.DataViewReader.Endianness.BIG_ENDIAN);\n\n while (reader.hasMoreData()) {\n this.parseNext(0, reader);\n }\n};\n\n\n/**\n * Parse the next box on the current level.\n *\n * @param {number} absStart The absolute start position in the original\n * byte array\n * @param {!shaka.util.DataViewReader} reader\n * @export\n */\nshaka.util.Mp4Parser.prototype.parseNext = function(absStart, reader) {\n var start = reader.getPosition();\n\n var size = reader.readUint32();\n var type = reader.readUint32();\n\n switch (size) {\n case 0:\n size = reader.getLength() - start;\n break;\n case 1:\n size = reader.readUint64();\n break;\n }\n\n var boxDefinition = this.boxDefinitions_[type];\n\n if (boxDefinition) {\n var version = null;\n var flags = null;\n\n if (this.headers_[type] == shaka.util.Mp4Parser.BoxType_.FULL_BOX) {\n var versionAndFlags = reader.readUint32();\n version = versionAndFlags >>> 24;\n flags = versionAndFlags & 0xFFFFFF;\n }\n\n // Read the whole payload so that the current level can be safely read\n // regardless of how the payload is parsed.\n var payloadSize = start + size - reader.getPosition();\n var payload = (payloadSize > 0) ?\n reader.readBytes(payloadSize).buffer :\n new ArrayBuffer(0);\n\n var payloadReader = new shaka.util.DataViewReader(\n new DataView(payload),\n shaka.util.DataViewReader.Endianness.BIG_ENDIAN);\n\n /** @type {shaka.util.Mp4Parser.ParsedBox } */\n var box = {\n parser: this,\n version: version,\n flags: flags,\n reader: payloadReader,\n size: size,\n start: start + absStart\n };\n\n boxDefinition(box);\n } else {\n // Move the read head to be at the end of the box.\n reader.skip(start + size - reader.getPosition());\n }\n};\n\n\n/**\n * A callback that tells the Mp4 parser to treat the body of a box as a series\n * of boxes. The number of boxes is limited by the size of the parent box.\n *\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @export\n */\nshaka.util.Mp4Parser.children = function(box) {\n while (box.reader.hasMoreData()) {\n box.parser.parseNext(box.start, box.reader);\n }\n};\n\n\n/**\n * A callback that tells the Mp4 parser to treat the body of a box as a sample\n * description. A sample description box has a fixed number of children. The\n * number of children is represented by a 4 byte unsigned integer. Each child\n * is a box.\n *\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @export\n */\nshaka.util.Mp4Parser.sampleDescription = function(box) {\n for (var count = box.reader.readUint32(); count > 0; count -= 1) {\n box.parser.parseNext(box.start, box.reader);\n }\n};\n\n\n/**\n * Create a callback that tells the Mp4 parser to treat the body of a box as a\n * binary blob and how to handle it.\n *\n * @param {!function(!Uint8Array)} callback\n * @return {!shaka.util.Mp4Parser.CallbackType}\n * @export\n */\nshaka.util.Mp4Parser.allData = function(callback) {\n return function(box) {\n var all = box.reader.getLength() - box.reader.getPosition();\n callback(box.reader.readBytes(all));\n };\n};\n\n\n/**\n * Convert an ascii string name to the integer type for a box.\n *\n * @param {string} name The name of the box. The name must be four\n * characters long.\n * @return {number}\n * @private\n */\nshaka.util.Mp4Parser.typeFromString_ = function(name) {\n goog.asserts.assert(\n name.length == 4,\n 'Mp4 box names must be 4 characters long');\n\n var code = 0;\n for (var i = 0; i < name.length; i++) {\n code = (code << 8) | name.charCodeAt(i);\n }\n return code;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/mp4_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Mp4SegmentIndexParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Mp4Parser');\n\n\n/**\n * Parses SegmentReferences from an ISO BMFF SIDX structure.\n * @param {!ArrayBuffer} sidxData The MP4's container's SIDX.\n * @param {number} sidxOffset The SIDX's offset, in bytes, from the start of\n * the MP4 container.\n * @param {!Array.<string>} uris The possible locations of the MP4 file that\n * contains the segments.\n * @param {number} presentationTimeOffset\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @throws {shaka.util.Error}\n */\nshaka.media.Mp4SegmentIndexParser = function(\n sidxData, sidxOffset, uris, presentationTimeOffset) {\n\n var Mp4SegmentIndexParser = shaka.media.Mp4SegmentIndexParser;\n\n var references;\n\n var parser = new shaka.util.Mp4Parser()\n .fullBox('sidx', function(box) {\n references = Mp4SegmentIndexParser.parseSIDX_(\n sidxOffset,\n presentationTimeOffset,\n uris,\n box);\n });\n\n if (sidxData) {\n parser.parse(sidxData);\n }\n\n if (references) {\n return references;\n } else {\n shaka.log.error('Invalid box type, expected \"sidx\".');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MP4_SIDX_WRONG_BOX_TYPE);\n }\n};\n\n\n/**\n * Parse a SIDX box from the given reader.\n *\n * @param {number} sidxOffset\n * @param {number} presentationTimeOffset\n * @param {!Array.<string>} uris The possible locations of the MP4 file that\n * contains the segments.\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.media.Mp4SegmentIndexParser.parseSIDX_ = function(\n sidxOffset,\n presentationTimeOffset,\n uris,\n box) {\n\n goog.asserts.assert(\n box.version != null,\n 'SIDX is a full box and should have a valid version.');\n\n var references = [];\n\n // Parse the SIDX structure.\n // Skip reference_ID (32 bits).\n box.reader.skip(4);\n\n var timescale = box.reader.readUint32();\n\n if (timescale == 0) {\n shaka.log.error('Invalid timescale.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MP4_SIDX_INVALID_TIMESCALE);\n }\n\n var earliestPresentationTime;\n var firstOffset;\n\n if (box.version == 0) {\n earliestPresentationTime = box.reader.readUint32();\n firstOffset = box.reader.readUint32();\n } else {\n earliestPresentationTime = box.reader.readUint64();\n firstOffset = box.reader.readUint64();\n }\n\n // Skip reserved (16 bits).\n box.reader.skip(2);\n\n // Add references.\n var referenceCount = box.reader.readUint16();\n\n // Substract the presentationTimeOffset\n var unscaledStartTime = earliestPresentationTime - presentationTimeOffset;\n var startByte = sidxOffset + box.size + firstOffset;\n\n for (var i = 0; i < referenceCount; i++) {\n // |chunk| is 1 bit for |referenceType|, and 31 bits for |referenceSize|.\n var chunk = box.reader.readUint32();\n var referenceType = (chunk & 0x80000000) >>> 31;\n var referenceSize = chunk & 0x7FFFFFFF;\n\n var subsegmentDuration = box.reader.readUint32();\n\n // Skipping 1 bit for |startsWithSap|, 3 bits for |sapType|, and 28 bits\n // for |sapDelta|.\n box.reader.skip(4);\n\n // If |referenceType| is 1 then the reference is to another SIDX.\n // We do not support this.\n if (referenceType == 1) {\n shaka.log.error('Heirarchical SIDXs are not supported.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MP4_SIDX_TYPE_NOT_SUPPORTED);\n }\n\n references.push(\n new shaka.media.SegmentReference(\n references.length,\n unscaledStartTime / timescale,\n (unscaledStartTime + subsegmentDuration) / timescale,\n function() { return uris; },\n startByte,\n startByte + referenceSize - 1));\n\n unscaledStartTime += subsegmentDuration;\n startByte += referenceSize;\n }\n\n return references;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/mp4_segment_index_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.SegmentIndex');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n\n/**\n * Creates a SegmentIndex.\n *\n * @param {!Array.<!shaka.media.SegmentReference>} references The list of\n * SegmentReferences, which must be sorted first by their start times\n * (ascending) and second by their end times (ascending), and have\n * continuous, increasing positions.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n * @export\n */\nshaka.media.SegmentIndex = function(references) {\n if (!COMPILED) {\n shaka.media.SegmentIndex.assertCorrectReferences_(references);\n }\n\n /** @private {Array.<!shaka.media.SegmentReference>} */\n this.references_ = references;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.media.SegmentIndex.prototype.destroy = function() {\n this.references_ = null;\n return Promise.resolve();\n};\n\n\n/**\n * Finds the position of the segment for the given time, in seconds, relative\n * to the start of a particular Period. Returns the position of the segment\n * with the largest end time if more than one segment is known for the given\n * time.\n *\n * @param {number} time\n * @return {?number} The position of the segment, or null\n * if the position of the segment could not be determined.\n * @export\n */\nshaka.media.SegmentIndex.prototype.find = function(time) {\n // For live streams, searching from the end is faster. For VOD, it balances\n // out either way. In both cases, references_.length is small enough that the\n // difference isn't huge.\n for (var i = this.references_.length - 1; i >= 0; --i) {\n var r = this.references_[i];\n // Note that a segment ends immediately before the end time.\n if ((time >= r.startTime) && (time < r.endTime)) {\n return r.position;\n }\n }\n if (this.references_.length && time < this.references_[0].startTime)\n return this.references_[0].position;\n\n return null;\n};\n\n\n/**\n * Gets the SegmentReference for the segment at the given position.\n *\n * @param {number} position The position of the segment.\n * @return {shaka.media.SegmentReference} The SegmentReference, or null if\n * no such SegmentReference exists.\n * @export\n */\nshaka.media.SegmentIndex.prototype.get = function(position) {\n if (this.references_.length == 0)\n return null;\n\n var index = position - this.references_[0].position;\n if (index < 0 || index >= this.references_.length)\n return null;\n\n return this.references_[index];\n};\n\n\n/**\n * Merges the given SegmentReferences. Supports extending the original\n * references only. Will not replace old references or interleave new ones.\n *\n * @param {!Array.<!shaka.media.SegmentReference>} references The list of\n * SegmentReferences, which must be sorted first by their start times\n * (ascending) and second by their end times (ascending), and have\n * continuous, increasing positions.\n * @export\n */\nshaka.media.SegmentIndex.prototype.merge = function(references) {\n if (!COMPILED) {\n shaka.media.SegmentIndex.assertCorrectReferences_(references);\n }\n\n var newReferences = [];\n var i = 0;\n var j = 0;\n\n while ((i < this.references_.length) && (j < references.length)) {\n var r1 = this.references_[i];\n var r2 = references[j];\n\n if (r1.startTime < r2.startTime) {\n newReferences.push(r1);\n i++;\n } else if (r1.startTime > r2.startTime) {\n // Drop the new reference if it would have to be interleaved with the\n // old one. Issue a warning, since this is not a supported update.\n shaka.log.warning('Refusing to rewrite original references on update!');\n j++;\n } else {\n // When period is changed, fitSegmentReference will expand the last\n // segment to the start of the next period. So, it is valid to have end\n // time updated to the last segment reference in a period\n if (Math.abs(r1.endTime - r2.endTime) > 0.1) {\n goog.asserts.assert(r2.endTime > r1.endTime &&\n i == this.references_.length - 1 &&\n j == references.length - 1,\n 'This should be an update of the last segment in a period');\n newReferences.push(r2);\n } else {\n // Drop the new reference if there's an old reference with the\n // same time.\n newReferences.push(r1);\n }\n i++;\n j++;\n }\n }\n\n while (i < this.references_.length) {\n newReferences.push(this.references_[i++]);\n }\n\n if (newReferences.length) {\n // The rest of these refs may need to be renumbered.\n var nextPosition = newReferences[newReferences.length - 1].position + 1;\n while (j < references.length) {\n var r = references[j++];\n var r2 = new shaka.media.SegmentReference(nextPosition++,\n r.startTime, r.endTime, r.getUris, r.startByte, r.endByte);\n newReferences.push(r2);\n }\n } else {\n newReferences = references;\n }\n\n if (!COMPILED) {\n shaka.media.SegmentIndex.assertCorrectReferences_(newReferences);\n }\n\n this.references_ = newReferences;\n};\n\n\n/**\n * Removes all SegmentReferences that end before the given time.\n *\n * @param {number} time The time in seconds.\n * @export\n */\nshaka.media.SegmentIndex.prototype.evict = function(time) {\n for (var i = 0; i < this.references_.length; ++i) {\n if (this.references_[i].endTime > time)\n break;\n }\n this.references_.splice(0, i);\n};\n\n\n/**\n * Expands the first SegmentReference so it begins at the start of its Period\n * if it already begins close to the start of its Period, and expands or\n * contracts the last SegmentReference so it ends at the end of its Period for\n * VOD presentations.\n *\n * @param {?number} periodDuration\n */\nshaka.media.SegmentIndex.prototype.fit = function(periodDuration) {\n if (this.references_.length == 0)\n return;\n\n /** @const {number} */\n var tolerance = shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS;\n\n goog.asserts.assert(periodDuration != null,\n 'Period duration must be known for static content!');\n goog.asserts.assert(periodDuration != Infinity,\n 'Period duration must be finite for static content!');\n\n var lastReference = this.references_[this.references_.length - 1];\n\n // Sanity check.\n goog.asserts.assert(\n lastReference.startTime < periodDuration,\n 'lastReference cannot begin after the end of the Period');\n if (lastReference.startTime > periodDuration) return;\n\n // Log warning if necessary.\n if (lastReference.endTime <= periodDuration - tolerance) {\n shaka.log.warning(\n 'The last segment should not end before the end of the Period.',\n lastReference);\n } else if (lastReference.endTime >= periodDuration + tolerance) {\n shaka.log.warning(\n 'The last segment should not end after the end of the Period.',\n lastReference);\n }\n\n // Adjust the last SegmentReference.\n this.references_[this.references_.length - 1] =\n new shaka.media.SegmentReference(\n lastReference.position,\n lastReference.startTime, periodDuration,\n lastReference.getUris,\n lastReference.startByte, lastReference.endByte);\n};\n\n\nif (!COMPILED) {\n /**\n * Asserts that the given SegmentReferences are sorted and have continuous,\n * increasing positions.\n *\n * @param {!Array.<shaka.media.SegmentReference>} references\n * @private\n */\n shaka.media.SegmentIndex.assertCorrectReferences_ = function(references) {\n goog.asserts.assert(references.every(function(r2, i) {\n if (i == 0) return true;\n var r1 = references[i - 1];\n if (r2.position != r1.position + 1) return false;\n if (r1.startTime < r2.startTime) {\n return true;\n } else if (r1.startTime > r2.startTime) {\n return false;\n } else {\n if (r1.endTime <= r2.endTime) {\n return true;\n } else {\n return false;\n }\n }\n }), 'SegmentReferences are incorrect');\n };\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/segment_index.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.EbmlElement');\ngoog.provide('shaka.util.EbmlParser');\n\ngoog.require('shaka.util.DataViewReader');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n\n/**\n * Creates an Extensible Binary Markup Language (EBML) parser.\n * @param {!DataView} dataView The EBML data.\n * @constructor\n * @struct\n */\nshaka.util.EbmlParser = function(dataView) {\n /** @private {!DataView} */\n this.dataView_ = dataView;\n\n /** @private {!shaka.util.DataViewReader} */\n this.reader_ = new shaka.util.DataViewReader(\n dataView,\n shaka.util.DataViewReader.Endianness.BIG_ENDIAN);\n\n // If not already constructed, build a list of EBML dynamic size constants.\n // This is not done at load-time to avoid exceptions on unsupported browsers.\n if (!shaka.util.EbmlParser.DYNAMIC_SIZES) {\n shaka.util.EbmlParser.DYNAMIC_SIZES = [\n new Uint8Array([0xff]),\n new Uint8Array([0x7f, 0xff]),\n new Uint8Array([0x3f, 0xff, 0xff]),\n new Uint8Array([0x1f, 0xff, 0xff, 0xff]),\n new Uint8Array([0x0f, 0xff, 0xff, 0xff, 0xff]),\n new Uint8Array([0x07, 0xff, 0xff, 0xff, 0xff, 0xff]),\n new Uint8Array([0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]),\n new Uint8Array([0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])\n ];\n }\n};\n\n\n/** @const {!Array.<!Uint8Array>} */\nshaka.util.EbmlParser.DYNAMIC_SIZES;\n\n\n/**\n * @return {boolean} True if the parser has more data, false otherwise.\n */\nshaka.util.EbmlParser.prototype.hasMoreData = function() {\n return this.reader_.hasMoreData();\n};\n\n\n/**\n * Parses an EBML element from the parser's current position, and advances\n * the parser.\n * @return {!shaka.util.EbmlElement} The EBML element.\n * @throws {shaka.util.Error}\n * @see http://matroska.org/technical/specs/rfc/index.html\n */\nshaka.util.EbmlParser.prototype.parseElement = function() {\n var id = this.parseId_();\n\n // Parse the element's size.\n var vint = this.parseVint_();\n var size;\n if (shaka.util.EbmlParser.isDynamicSizeValue_(vint)) {\n // If this has an unknown size, assume that it takes up the rest of the\n // data.\n size = this.dataView_.byteLength - this.reader_.getPosition();\n } else {\n size = shaka.util.EbmlParser.getVintValue_(vint);\n }\n\n // Note that if the element's size is larger than the buffer then we are\n // parsing a \"partial element\". This may occur if for example we are\n // parsing the beginning of some WebM container data, but our buffer does\n // not contain the entire WebM container data.\n var elementSize =\n this.reader_.getPosition() + size <= this.dataView_.byteLength ?\n size :\n this.dataView_.byteLength - this.reader_.getPosition();\n\n var dataView = new DataView(\n this.dataView_.buffer,\n this.dataView_.byteOffset + this.reader_.getPosition(), elementSize);\n\n this.reader_.skip(elementSize);\n\n return new shaka.util.EbmlElement(id, dataView);\n};\n\n\n/**\n * Parses an EBML ID from the parser's current position, and advances the\n * parser.\n * @throws {shaka.util.Error}\n * @return {number} The EBML ID.\n * @private\n */\nshaka.util.EbmlParser.prototype.parseId_ = function() {\n var vint = this.parseVint_();\n\n if (vint.length > 7) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_OVERFLOW);\n }\n\n var id = 0;\n for (var i = 0; i < vint.length; i++) {\n // Note that we cannot use << since |value| may exceed 32 bits.\n id = (256 * id) + vint[i];\n }\n\n return id;\n};\n\n\n/**\n * Parses a variable sized integer from the parser's current position, and\n * advances the parser.\n * For example:\n * 1 byte wide: 1xxx xxxx\n * 2 bytes wide: 01xx xxxx xxxx xxxx\n * 3 bytes wide: 001x xxxx xxxx xxxx xxxx xxxx\n * @throws {shaka.util.Error}\n * @return {!Uint8Array} The variable sized integer.\n * @private\n */\nshaka.util.EbmlParser.prototype.parseVint_ = function() {\n var firstByte = this.reader_.readUint8();\n var numBytes;\n\n // Determine the byte width of the variable sized integer.\n for (numBytes = 1; numBytes <= 8; numBytes++) {\n var mask = 0x1 << (8 - numBytes);\n if (firstByte & mask) {\n break;\n }\n }\n\n if (numBytes > 8) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_OVERFLOW);\n }\n\n var vint = new Uint8Array(numBytes);\n vint[0] = firstByte;\n\n // Include the remaining bytes.\n for (var i = 1; i < numBytes; i++) {\n vint[i] = this.reader_.readUint8();\n }\n\n return vint;\n};\n\n\n/**\n * Gets the value of a variable sized integer.\n * For example, the x's below are part of the vint's value.\n * 7-bit value: 1xxx xxxx\n * 14-bit value: 01xx xxxx xxxx xxxx\n * 21-bit value: 001x xxxx xxxx xxxx xxxx xxxx\n * @param {!Uint8Array} vint The variable sized integer.\n * @throws {shaka.util.Error}\n * @return {number} The value of the variable sized integer.\n * @private\n */\nshaka.util.EbmlParser.getVintValue_ = function(vint) {\n // If |vint| is 8 bytes wide then we must ensure that it does not have more\n // than 53 meaningful bits. For example, assume |vint| is 8 bytes wide,\n // so it has the following structure,\n // 0000 0001 | xxxx xxxx ...\n // Thus, the first 3 bits following the first byte of |vint| must be 0.\n if ((vint.length == 8) && (vint[1] & 0xe0)) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.JS_INTEGER_OVERFLOW);\n }\n\n // Mask out the first few bits of |vint|'s first byte to get the most\n // significant bits of |vint|'s value. If |vint| is 8 bytes wide then |value|\n // will be set to 0.\n var mask = 0x1 << (8 - vint.length);\n var value = vint[0] & (mask - 1);\n\n // Add the remaining bytes.\n for (var i = 1; i < vint.length; i++) {\n // Note that we cannot use << since |value| may exceed 32 bits.\n value = (256 * value) + vint[i];\n }\n\n return value;\n};\n\n\n/**\n * Checks if the given variable sized integer represents a dynamic size value.\n * @param {!Uint8Array} vint The variable sized integer.\n * @return {boolean} true if |vint| represents a dynamic size value,\n * false otherwise.\n * @private\n */\nshaka.util.EbmlParser.isDynamicSizeValue_ = function(vint) {\n var EbmlParser = shaka.util.EbmlParser;\n var uint8ArrayEqual = shaka.util.Uint8ArrayUtils.equal;\n\n for (var i = 0; i < EbmlParser.DYNAMIC_SIZES.length; i++) {\n if (uint8ArrayEqual(vint, EbmlParser.DYNAMIC_SIZES[i])) {\n return true;\n }\n }\n\n return false;\n};\n\n\n\n/**\n * Creates an EbmlElement.\n * @param {number} id The ID.\n * @param {!DataView} dataView The DataView.\n * @constructor\n */\nshaka.util.EbmlElement = function(id, dataView) {\n /** @type {number} */\n this.id = id;\n\n /** @private {!DataView} */\n this.dataView_ = dataView;\n};\n\n\n/**\n * Gets the element's offset from the beginning of the buffer.\n * @return {number}\n */\nshaka.util.EbmlElement.prototype.getOffset = function() {\n return this.dataView_.byteOffset;\n};\n\n\n/**\n * Interpret the element's data as a list of sub-elements.\n * @throws {shaka.util.Error}\n * @return {!shaka.util.EbmlParser} A parser over the sub-elements.\n */\nshaka.util.EbmlElement.prototype.createParser = function() {\n return new shaka.util.EbmlParser(this.dataView_);\n};\n\n\n/**\n * Interpret the element's data as an unsigned integer.\n * @throws {shaka.util.Error}\n * @return {number}\n */\nshaka.util.EbmlElement.prototype.getUint = function() {\n if (this.dataView_.byteLength > 8) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_OVERFLOW);\n }\n\n // Ensure we have at most 53 meaningful bits.\n if ((this.dataView_.byteLength == 8) && (this.dataView_.getUint8(0) & 0xe0)) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.JS_INTEGER_OVERFLOW);\n }\n\n var value = 0;\n\n for (var i = 0; i < this.dataView_.byteLength; i++) {\n var chunk = this.dataView_.getUint8(i);\n value = (256 * value) + chunk;\n }\n\n return value;\n};\n\n\n/**\n * Interpret the element's data as a floating point number (32 bits or 64 bits).\n * 80-bit floating point numbers are not supported.\n * @throws {shaka.util.Error}\n * @return {number}\n */\nshaka.util.EbmlElement.prototype.getFloat = function() {\n if (this.dataView_.byteLength == 4) {\n return this.dataView_.getFloat32(0);\n } else if (this.dataView_.byteLength == 8) {\n return this.dataView_.getFloat64(0);\n } else {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_BAD_FLOATING_POINT_SIZE);\n }\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/ebml_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.WebmSegmentIndexParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.EbmlElement');\ngoog.require('shaka.util.EbmlParser');\ngoog.require('shaka.util.Error');\n\n\n\n/**\n * Creates a WebM Cues element parser.\n *\n * @constructor\n * @struct\n */\nshaka.media.WebmSegmentIndexParser = function() {};\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.EBML_ID = 0x1a45dfa3;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.SEGMENT_ID = 0x18538067;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.INFO_ID = 0x1549a966;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.TIMECODE_SCALE_ID = 0x2ad7b1;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.DURATION_ID = 0x4489;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUES_ID = 0x1c53bb6b;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_POINT_ID = 0xbb;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_TIME_ID = 0xb3;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_TRACK_POSITIONS_ID = 0xb7;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_CLUSTER_POSITION = 0xf1;\n\n\n/**\n * Parses SegmentReferences from a WebM container.\n * @param {!ArrayBuffer} cuesData The WebM container's \"Cueing Data\" section.\n * @param {!ArrayBuffer} initData The WebM container's headers.\n * @param {!Array.<string>} uris The possible locations of the WebM file that\n * contains the segments.\n * @param {number} presentationTimeOffset\n\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @throws {shaka.util.Error}\n * @see http://www.matroska.org/technical/specs/index.html\n * @see http://www.webmproject.org/docs/container/\n */\nshaka.media.WebmSegmentIndexParser.prototype.parse = function(\n cuesData, initData, uris, presentationTimeOffset) {\n var tuple = this.parseWebmContainer_(initData);\n var parser = new shaka.util.EbmlParser(new DataView(cuesData));\n var cuesElement = parser.parseElement();\n if (cuesElement.id != shaka.media.WebmSegmentIndexParser.CUES_ID) {\n shaka.log.error('Not a Cues element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_CUES_ELEMENT_MISSING);\n }\n\n return this.parseCues_(\n cuesElement, tuple.segmentOffset, tuple.timecodeScale, tuple.duration,\n uris, presentationTimeOffset);\n};\n\n\n/**\n * Parses a WebM container to get the segment's offset, timecode scale, and\n * duration.\n *\n * @param {!ArrayBuffer} initData\n * @return {{segmentOffset: number, timecodeScale: number, duration: number}}\n * The segment's offset in bytes, the segment's timecode scale in seconds,\n * and the duration in seconds.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseWebmContainer_ = function(\n initData) {\n var parser = new shaka.util.EbmlParser(new DataView(initData));\n\n // Check that the WebM container data starts with the EBML header, but\n // skip its contents.\n var ebmlElement = parser.parseElement();\n if (ebmlElement.id != shaka.media.WebmSegmentIndexParser.EBML_ID) {\n shaka.log.error('Not an EBML element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_EBML_HEADER_ELEMENT_MISSING);\n }\n\n var segmentElement = parser.parseElement();\n if (segmentElement.id != shaka.media.WebmSegmentIndexParser.SEGMENT_ID) {\n shaka.log.error('Not a Segment element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_SEGMENT_ELEMENT_MISSING);\n }\n\n // This value is used as the initial offset to the first referenced segment.\n var segmentOffset = segmentElement.getOffset();\n\n // Parse the Segment element to get the segment info.\n var segmentInfo = this.parseSegment_(segmentElement);\n return {\n segmentOffset: segmentOffset,\n timecodeScale: segmentInfo.timecodeScale,\n duration: segmentInfo.duration\n };\n};\n\n\n/**\n * Parses a WebM Info element to get the segment's timecode scale and duration.\n * @param {!shaka.util.EbmlElement} segmentElement\n * @return {{timecodeScale: number, duration: number}} The segment's timecode\n * scale in seconds and duration in seconds.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseSegment_ = function(\n segmentElement) {\n var parser = segmentElement.createParser();\n\n // Find the Info element.\n var infoElement = null;\n while (parser.hasMoreData()) {\n var elem = parser.parseElement();\n if (elem.id != shaka.media.WebmSegmentIndexParser.INFO_ID) {\n continue;\n }\n\n infoElement = elem;\n\n break;\n }\n\n if (!infoElement) {\n shaka.log.error('Not an Info element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_INFO_ELEMENT_MISSING);\n }\n\n return this.parseInfo_(infoElement);\n};\n\n\n/**\n * Parses a WebM Info element to get the segment's timecode scale and duration.\n * @param {!shaka.util.EbmlElement} infoElement\n * @return {{timecodeScale: number, duration: number}} The segment's timecode\n * scale in seconds and duration in seconds.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseInfo_ = function(\n infoElement) {\n var parser = infoElement.createParser();\n\n // The timecode scale factor in units of [nanoseconds / T], where [T] are the\n // units used to express all other time values in the WebM container. By\n // default it's assumed that [T] == [milliseconds].\n var timecodeScaleNanoseconds = 1000000;\n /** @type {?number} */\n var durationScale = null;\n\n while (parser.hasMoreData()) {\n var elem = parser.parseElement();\n if (elem.id == shaka.media.WebmSegmentIndexParser.TIMECODE_SCALE_ID) {\n timecodeScaleNanoseconds = elem.getUint();\n } else if (elem.id == shaka.media.WebmSegmentIndexParser.DURATION_ID) {\n durationScale = elem.getFloat();\n }\n }\n if (durationScale == null) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_DURATION_ELEMENT_MISSING);\n }\n\n // The timecode scale factor in units of [seconds / T].\n var timecodeScale = timecodeScaleNanoseconds / 1000000000;\n // The duration is stored in units of [T]\n var durationSeconds = durationScale * timecodeScale;\n\n return {timecodeScale: timecodeScale, duration: durationSeconds};\n};\n\n\n/**\n * Parses a WebM CuesElement.\n * @param {!shaka.util.EbmlElement} cuesElement\n * @param {number} segmentOffset\n * @param {number} timecodeScale\n * @param {number} duration\n * @param {!Array.<string>} uris\n * @param {number} presentationTimeOffset\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseCues_ = function(\n cuesElement, segmentOffset, timecodeScale, duration, uris,\n presentationTimeOffset) {\n var references = [];\n var getUris = function() { return uris; };\n\n var parser = cuesElement.createParser();\n\n var lastTime = -1;\n var lastOffset = -1;\n\n while (parser.hasMoreData()) {\n var elem = parser.parseElement();\n if (elem.id != shaka.media.WebmSegmentIndexParser.CUE_POINT_ID) {\n continue;\n }\n\n var tuple = this.parseCuePoint_(elem);\n if (!tuple) {\n continue;\n }\n\n // Substract presentationTimeOffset from unscalled time\n var currentTime = timecodeScale *\n (tuple.unscaledTime - presentationTimeOffset);\n var currentOffset = segmentOffset + tuple.relativeOffset;\n\n if (lastTime >= 0) {\n goog.asserts.assert(lastOffset >= 0, 'last offset cannot be 0');\n\n references.push(\n new shaka.media.SegmentReference(\n references.length,\n lastTime, currentTime,\n getUris,\n lastOffset, currentOffset - 1));\n }\n\n lastTime = currentTime;\n lastOffset = currentOffset;\n }\n\n if (lastTime >= 0) {\n goog.asserts.assert(lastOffset >= 0, 'last offset cannot be 0');\n\n references.push(\n new shaka.media.SegmentReference(\n references.length, lastTime, duration, getUris, lastOffset, null));\n }\n\n return references;\n};\n\n\n/**\n * Parses a WebM CuePointElement to get an \"unadjusted\" segment reference.\n * @param {shaka.util.EbmlElement} cuePointElement\n * @return {{unscaledTime: number, relativeOffset: number}} The referenced\n * segment's start time in units of [T] (see parseInfo_()), and the\n * referenced segment's offset in bytes, relative to a WebM Segment\n * element.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseCuePoint_ = function(\n cuePointElement) {\n var parser = cuePointElement.createParser();\n\n // Parse CueTime element.\n var cueTimeElement = parser.parseElement();\n if (cueTimeElement.id != shaka.media.WebmSegmentIndexParser.CUE_TIME_ID) {\n shaka.log.warning('Not a CueTime element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_CUE_TIME_ELEMENT_MISSING);\n }\n var unscaledTime = cueTimeElement.getUint();\n\n // Parse CueTrackPositions element.\n var cueTrackPositionsElement = parser.parseElement();\n if (cueTrackPositionsElement.id !=\n shaka.media.WebmSegmentIndexParser.CUE_TRACK_POSITIONS_ID) {\n shaka.log.warning('Not a CueTrackPositions element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING);\n }\n\n var cueTrackParser = cueTrackPositionsElement.createParser();\n var relativeOffset = 0;\n\n while (cueTrackParser.hasMoreData()) {\n var elem = cueTrackParser.parseElement();\n if (elem.id != shaka.media.WebmSegmentIndexParser.CUE_CLUSTER_POSITION) {\n continue;\n }\n\n relativeOffset = elem.getUint();\n break;\n }\n\n return { unscaledTime: unscaledTime, relativeOffset: relativeOffset };\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/webm_segment_index_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.SegmentBase');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.MpdUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.Mp4SegmentIndexParser');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.WebmSegmentIndexParser');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.SegmentBase\n * @summary A set of functions for parsing SegmentBase elements.\n */\n\n\n/**\n * Creates an init segment reference from a Context object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * @return {shaka.media.InitSegmentReference}\n */\nshaka.dash.SegmentBase.createInitSegment = function(context, callback) {\n var MpdUtils = shaka.dash.MpdUtils;\n var XmlUtils = shaka.util.XmlUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var initialization =\n MpdUtils.inheritChild(context, callback, 'Initialization');\n if (!initialization)\n return null;\n\n var resolvedUris = context.representation.baseUris;\n var uri = initialization.getAttribute('sourceURL');\n if (uri) {\n resolvedUris =\n ManifestParserUtils.resolveUris(context.representation.baseUris, [uri]);\n }\n\n var startByte = 0;\n var endByte = null;\n var range = XmlUtils.parseAttr(initialization, 'range', XmlUtils.parseRange);\n if (range) {\n startByte = range.start;\n endByte = range.end;\n }\n\n var getUris = function() { return resolvedUris; };\n return new shaka.media.InitSegmentReference(getUris, startByte, endByte);\n};\n\n\n/**\n * Creates a new Stream object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @throws shaka.util.Error When there is a parsing error.\n * @return {shaka.dash.DashParser.StreamInfo}\n */\nshaka.dash.SegmentBase.createStream = function(context, requestInitSegment) {\n goog.asserts.assert(context.representation.segmentBase,\n 'Should only be called with SegmentBase');\n // Since SegmentBase does not need updates, simply treat any call as\n // the initial parse.\n var MpdUtils = shaka.dash.MpdUtils;\n var SegmentBase = shaka.dash.SegmentBase;\n\n var presentationTimeOffset = MpdUtils.inheritAttribute(\n context, SegmentBase.fromInheritance_, 'presentationTimeOffset');\n\n var init =\n SegmentBase.createInitSegment(context, SegmentBase.fromInheritance_);\n var index = SegmentBase.createSegmentIndex_(\n context, requestInitSegment, init, Number(presentationTimeOffset));\n\n return {\n createSegmentIndex: index.createSegmentIndex,\n findSegmentPosition: index.findSegmentPosition,\n getSegmentReference: index.getSegmentReference,\n initSegmentReference: init,\n presentationTimeOffset: Number(presentationTimeOffset) || 0\n };\n};\n\n\n/**\n * Creates segment index info for the given info.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {shaka.media.InitSegmentReference} init\n * @param {!Array.<string>} uris\n * @param {number} startByte\n * @param {?number} endByte\n * @param {string} containerType\n * @param {number} presentationTimeOffset\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n */\nshaka.dash.SegmentBase.createSegmentIndexFromUris = function(\n context, requestInitSegment, init, uris,\n startByte, endByte, containerType, presentationTimeOffset) {\n var presentationTimeline = context.presentationTimeline;\n var fitLast = !context.dynamic || !context.periodInfo.isLastPeriod;\n var periodStartTime = context.periodInfo.start;\n var periodDuration = context.periodInfo.duration;\n\n // Create a local variable to bind to so we can set to null to help the GC.\n var localRequest = requestInitSegment;\n var segmentIndex = null;\n var create = function() {\n var async = [\n localRequest(uris, startByte, endByte),\n containerType == 'webm' ?\n localRequest(init.getUris(), init.startByte, init.endByte) :\n null\n ];\n\n localRequest = null;\n return Promise.all(async).then(function(results) {\n var indexData = results[0];\n var initData = results[1] || null;\n var references = null;\n\n if (containerType == 'mp4') {\n references = shaka.media.Mp4SegmentIndexParser(\n indexData, startByte, uris, presentationTimeOffset);\n } else {\n goog.asserts.assert(initData, 'WebM requires init data');\n var parser = new shaka.media.WebmSegmentIndexParser();\n references = parser.parse(indexData, initData, uris,\n presentationTimeOffset);\n }\n\n presentationTimeline.notifySegments(periodStartTime, references);\n\n // Since containers are never updated, we don't need to store the\n // segmentIndex in the map.\n goog.asserts.assert(!segmentIndex,\n 'Should not call createSegmentIndex twice');\n\n segmentIndex = new shaka.media.SegmentIndex(references);\n if (fitLast)\n segmentIndex.fit(periodDuration);\n });\n };\n var get = function(i) {\n goog.asserts.assert(segmentIndex, 'Must call createSegmentIndex first');\n return segmentIndex.get(i);\n };\n var find = function(t) {\n goog.asserts.assert(segmentIndex, 'Must call createSegmentIndex first');\n return segmentIndex.find(t);\n };\n\n return {\n createSegmentIndex: create,\n findSegmentPosition: find,\n getSegmentReference: get\n };\n};\n\n\n/**\n * @param {?shaka.dash.DashParser.InheritanceFrame} frame\n * @return {Element}\n * @private\n */\nshaka.dash.SegmentBase.fromInheritance_ = function(frame) {\n return frame.segmentBase;\n};\n\n\n/**\n * Creates segment index info from a Context object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {shaka.media.InitSegmentReference} init\n * @param {number} presentationTimeOffset\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.SegmentBase.createSegmentIndex_ = function(\n context, requestInitSegment, init, presentationTimeOffset) {\n var MpdUtils = shaka.dash.MpdUtils;\n var SegmentBase = shaka.dash.SegmentBase;\n var XmlUtils = shaka.util.XmlUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var contentType = context.representation.contentType;\n var containerType = context.representation.mimeType.split('/')[1];\n if (contentType != ContentType.TEXT && containerType != 'mp4' &&\n containerType != 'webm') {\n shaka.log.error(\n 'SegmentBase specifies an unsupported container type.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_UNSUPPORTED_CONTAINER);\n }\n\n if ((containerType == 'webm') && !init) {\n shaka.log.error(\n 'SegmentBase does not contain sufficient segment information:',\n 'the SegmentBase uses a WebM container,',\n 'but does not contain an Initialization element.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_WEBM_MISSING_INIT);\n }\n\n var representationIndex = MpdUtils.inheritChild(\n context, SegmentBase.fromInheritance_, 'RepresentationIndex');\n var indexRangeElem = MpdUtils.inheritAttribute(\n context, SegmentBase.fromInheritance_, 'indexRange');\n\n var indexUris = context.representation.baseUris;\n var indexRange = XmlUtils.parseRange(indexRangeElem || '');\n if (representationIndex) {\n var representationUri = representationIndex.getAttribute('sourceURL');\n if (representationUri) {\n indexUris = ManifestParserUtils.resolveUris(\n context.representation.baseUris, [representationUri]);\n }\n\n indexRange = XmlUtils.parseAttr(\n representationIndex, 'range', XmlUtils.parseRange, indexRange);\n }\n\n if (!indexRange) {\n shaka.log.error(\n 'SegmentBase does not contain sufficient segment information:',\n 'the SegmentBase does not contain @indexRange',\n 'or a RepresentationIndex element.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n\n return shaka.dash.SegmentBase.createSegmentIndexFromUris(\n context, requestInitSegment, init, indexUris, indexRange.start,\n indexRange.end, containerType, presentationTimeOffset);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/segment_base.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.SegmentList');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.MpdUtils');\ngoog.require('shaka.dash.SegmentBase');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.SegmentList\n * @summary A set of functions for parsing SegmentList elements.\n */\n\n\n/**\n * Creates a new Stream object or updates the Stream in the manifest.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Object.<string, !shaka.media.SegmentIndex>} segmentIndexMap\n * @return {shaka.dash.DashParser.StreamInfo}\n */\nshaka.dash.SegmentList.createStream = function(context, segmentIndexMap) {\n goog.asserts.assert(context.representation.segmentList,\n 'Should only be called with SegmentList');\n var SegmentList = shaka.dash.SegmentList;\n\n var init = shaka.dash.SegmentBase.createInitSegment(\n context, SegmentList.fromInheritance_);\n var info = SegmentList.parseSegmentListInfo_(context);\n\n SegmentList.checkSegmentListInfo_(context, info);\n\n /** @type {shaka.media.SegmentIndex} */\n var segmentIndex = null;\n var id = null;\n if (context.period.id && context.representation.id) {\n // Only check/store the index if period and representation IDs are set.\n id = context.period.id + ',' + context.representation.id;\n segmentIndex = segmentIndexMap[id];\n }\n\n var references = SegmentList.createSegmentReferences_(\n context.periodInfo.duration, info.startNumber,\n context.representation.baseUris, info);\n\n if (segmentIndex) {\n segmentIndex.merge(references);\n var start = context.presentationTimeline.getSegmentAvailabilityStart();\n segmentIndex.evict(start - context.periodInfo.start);\n } else {\n context.presentationTimeline.notifySegments(\n context.periodInfo.start, references);\n segmentIndex = new shaka.media.SegmentIndex(references);\n if (id && context.dynamic)\n segmentIndexMap[id] = segmentIndex;\n }\n\n if (!context.dynamic || !context.periodInfo.isLastPeriod)\n segmentIndex.fit(context.periodInfo.duration);\n\n return {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex),\n initSegmentReference: init,\n presentationTimeOffset: info.presentationTimeOffset\n };\n};\n\n\n/**\n * @typedef {{\n * mediaUri: string,\n * start: number,\n * end: ?number\n * }}\n *\n * @property {string} mediaUri\n * The URI of the segment.\n * @property {number} start\n * The start byte of the segment.\n * @property {?number} end\n * The end byte of the segment, or null.\n */\nshaka.dash.SegmentList.MediaSegment;\n\n\n/**\n * @typedef {{\n * segmentDuration: ?number,\n * startTime: number,\n * startNumber: number,\n * presentationTimeOffset: number,\n * timeline: Array.<shaka.dash.MpdUtils.TimeRange>,\n * mediaSegments: !Array.<shaka.dash.SegmentList.MediaSegment>\n * }}\n * @private\n *\n * @description\n * Contains information about a SegmentList.\n *\n * @property {?number} segmentDuration\n * The duration of the segments, if given.\n * @property {number} startTime\n * The start time of the first segment, in seconds.\n * @property {number} startNumber\n * The start number of the segments; 1 or greater.\n * @property {number} presentationTimeOffset\n * The presentationTimeOffset of the representation, in seconds.\n * @property {Array.<shaka.dash.MpdUtils.TimeRange>} timeline\n * The timeline of the representation, if given. Times in seconds.\n * @property {!Array.<shaka.dash.SegmentList.MediaSegment>} mediaSegments\n * The URI and byte-ranges of the media segments.\n */\nshaka.dash.SegmentList.SegmentListInfo;\n\n\n/**\n * @param {?shaka.dash.DashParser.InheritanceFrame} frame\n * @return {Element}\n * @private\n */\nshaka.dash.SegmentList.fromInheritance_ = function(frame) {\n return frame.segmentList;\n};\n\n\n/**\n * Parses the SegmentList items to create an info object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {shaka.dash.SegmentList.SegmentListInfo}\n * @private\n */\nshaka.dash.SegmentList.parseSegmentListInfo_ = function(context) {\n var SegmentList = shaka.dash.SegmentList;\n var MpdUtils = shaka.dash.MpdUtils;\n\n var mediaSegments = SegmentList.parseMediaSegments_(context);\n var segmentInfo =\n MpdUtils.parseSegmentInfo(context, SegmentList.fromInheritance_);\n\n var startNumber = segmentInfo.startNumber;\n if (startNumber == 0) {\n shaka.log.warning('SegmentList@startNumber must be > 0');\n startNumber = 1;\n }\n\n var startTime = 0;\n if (segmentInfo.segmentDuration) {\n // See DASH sec. 5.3.9.5.3\n // Don't use presentationTimeOffset for @duration.\n startTime = segmentInfo.segmentDuration * (startNumber - 1);\n } else if (segmentInfo.timeline && segmentInfo.timeline.length > 0) {\n // The presentationTimeOffset was considered in timeline creation\n startTime = segmentInfo.timeline[0].start;\n }\n\n return {\n segmentDuration: segmentInfo.segmentDuration,\n startTime: startTime,\n startNumber: startNumber,\n presentationTimeOffset: segmentInfo.presentationTimeOffset,\n timeline: segmentInfo.timeline,\n mediaSegments: mediaSegments\n };\n};\n\n\n/**\n * Checks whether a SegmentListInfo object is valid.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentList.SegmentListInfo} info\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.SegmentList.checkSegmentListInfo_ = function(context, info) {\n if (!info.segmentDuration && !info.timeline &&\n info.mediaSegments.length > 1) {\n shaka.log.warning(\n 'SegmentList does not contain sufficient segment information:',\n 'the SegmentList specifies multiple segments,',\n 'but does not specify a segment duration or timeline.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n\n if (!info.segmentDuration && !context.periodInfo.duration && !info.timeline &&\n info.mediaSegments.length == 1) {\n shaka.log.warning(\n 'SegmentList does not contain sufficient segment information:',\n 'the SegmentList specifies one segment,',\n 'but does not specify a segment duration, period duration,',\n 'or timeline.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n\n if (info.timeline && info.timeline.length == 0) {\n shaka.log.warning(\n 'SegmentList does not contain sufficient segment information:',\n 'the SegmentList has an empty timeline.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n};\n\n\n/**\n * Creates an array of segment references for the given data.\n *\n * @param {?number} periodDuration in seconds.\n * @param {number} startNumber\n * @param {!Array.<string>} baseUris\n * @param {shaka.dash.SegmentList.SegmentListInfo} info\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.dash.SegmentList.createSegmentReferences_ = function(\n periodDuration, startNumber, baseUris, info) {\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var max = info.mediaSegments.length;\n if (info.timeline && info.timeline.length != info.mediaSegments.length) {\n max = Math.min(info.timeline.length, info.mediaSegments.length);\n shaka.log.warning(\n 'The number of items in the segment timeline and the number of segment',\n 'URLs do not match, truncating', info.mediaSegments.length, 'to', max);\n }\n\n /** @type {!Array.<!shaka.media.SegmentReference>} */\n var references = [];\n var prevEndTime = info.startTime;\n for (var i = 0; i < max; i++) {\n var segment = info.mediaSegments[i];\n var mediaUri = ManifestParserUtils.resolveUris(\n baseUris, [segment.mediaUri]);\n\n var startTime = prevEndTime;\n var endTime;\n\n if (info.segmentDuration != null) {\n endTime = startTime + info.segmentDuration;\n } else if (info.timeline) {\n // Ignore the timepoint start since they are continuous.\n endTime = info.timeline[i].end;\n } else {\n // If segmentDuration and timeline are null then there must\n // only be one segment.\n goog.asserts.assert(\n info.mediaSegments.length == 1 && periodDuration,\n 'There should only be one segment with a Period duration.');\n endTime = startTime + periodDuration;\n }\n\n var getUris = (function(uris) { return uris; }.bind(null, mediaUri));\n references.push(\n new shaka.media.SegmentReference(\n i + startNumber, startTime, endTime, getUris, segment.start,\n segment.end));\n prevEndTime = endTime;\n }\n\n return references;\n};\n\n\n/**\n * Parses the media URIs from the context.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {!Array.<shaka.dash.SegmentList.MediaSegment>}\n * @private\n */\nshaka.dash.SegmentList.parseMediaSegments_ = function(context) {\n var Functional = shaka.util.Functional;\n /** @type {!Array.<!Element>} */\n var segmentLists = [\n context.representation.segmentList,\n context.adaptationSet.segmentList,\n context.period.segmentList\n ].filter(Functional.isNotNull);\n\n var XmlUtils = shaka.util.XmlUtils;\n // Search each SegmentList for one with at least one SegmentURL element,\n // select the first one, and convert each SegmentURL element to a tuple.\n return segmentLists\n .map(function(node) { return XmlUtils.findChildren(node, 'SegmentURL'); })\n .reduce(function(all, part) { return all.length > 0 ? all : part; })\n .map(function(urlNode) {\n if (urlNode.getAttribute('indexRange') &&\n !context.indexRangeWarningGiven) {\n context.indexRangeWarningGiven = true;\n shaka.log.warning(\n 'We do not support the SegmentURL@indexRange attribute on ' +\n 'SegmentList. We only use the SegmentList@duration attribute ' +\n 'or SegmentTimeline, which must be accurate.');\n }\n\n var uri = urlNode.getAttribute('media');\n var range = XmlUtils.parseAttr(\n urlNode, 'mediaRange', XmlUtils.parseRange, {start: 0, end: null});\n return {mediaUri: uri, start: range.start, end: range.end};\n });\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/segment_list.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.SegmentTemplate');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.MpdUtils');\ngoog.require('shaka.dash.SegmentBase');\ngoog.require('shaka.log');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n/**\n * @namespace shaka.dash.SegmentTemplate\n * @summary A set of functions for parsing SegmentTemplate elements.\n */\n\n\n/**\n * Creates a new Stream object or updates the Stream in the manifest.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {!Object.<string, !shaka.media.SegmentIndex>} segmentIndexMap\n * @param {boolean} isUpdate True if the manifest is being updated.\n * @throws shaka.util.Error When there is a parsing error.\n * @return {shaka.dash.DashParser.StreamInfo}\n */\nshaka.dash.SegmentTemplate.createStream = function(\n context, requestInitSegment, segmentIndexMap, isUpdate) {\n goog.asserts.assert(context.representation.segmentTemplate,\n 'Should only be called with SegmentTemplate');\n var SegmentTemplate = shaka.dash.SegmentTemplate;\n\n var init = SegmentTemplate.createInitSegment_(context);\n var info = SegmentTemplate.parseSegmentTemplateInfo_(context);\n\n SegmentTemplate.checkSegmentTemplateInfo_(context, info);\n\n /** @type {?shaka.dash.DashParser.SegmentIndexFunctions} */\n var segmentIndexFunctions = null;\n if (info.indexTemplate) {\n segmentIndexFunctions = SegmentTemplate.createFromIndexTemplate_(\n context, requestInitSegment, init, info);\n } else if (info.segmentDuration) {\n if (!isUpdate) {\n context.presentationTimeline.notifyMaxSegmentDuration(\n info.segmentDuration);\n }\n segmentIndexFunctions = SegmentTemplate.createFromDuration_(context, info);\n } else {\n /** @type {shaka.media.SegmentIndex} */\n var segmentIndex = null;\n var id = null;\n if (context.period.id && context.representation.id) {\n // Only check/store the index if period and representation IDs are set.\n id = context.period.id + ',' + context.representation.id;\n segmentIndex = segmentIndexMap[id];\n }\n\n var references = SegmentTemplate.createFromTimeline_(context, info);\n\n if (segmentIndex) {\n segmentIndex.merge(references);\n var start = context.presentationTimeline.getSegmentAvailabilityStart();\n segmentIndex.evict(start - context.periodInfo.start);\n } else {\n context.presentationTimeline.notifySegments(\n context.periodInfo.start, references);\n segmentIndex = new shaka.media.SegmentIndex(references);\n if (id && context.dynamic)\n segmentIndexMap[id] = segmentIndex;\n }\n\n if (!context.dynamic || !context.periodInfo.isLastPeriod)\n segmentIndex.fit(context.periodInfo.duration);\n\n segmentIndexFunctions = {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex)\n };\n }\n\n return {\n createSegmentIndex: segmentIndexFunctions.createSegmentIndex,\n findSegmentPosition: segmentIndexFunctions.findSegmentPosition,\n getSegmentReference: segmentIndexFunctions.getSegmentReference,\n initSegmentReference: init,\n presentationTimeOffset: info.presentationTimeOffset\n };\n};\n\n\n/**\n * @typedef {{\n * timescale: number,\n * segmentDuration: ?number,\n * startNumber: number,\n * presentationTimeOffset: number,\n * unscaledPresentationTimeOffset: number,\n * timeline: Array.<shaka.dash.MpdUtils.TimeRange>,\n * mediaTemplate: ?string,\n * indexTemplate: ?string\n * }}\n * @private\n *\n * @description\n * Contains information about a SegmentTemplate.\n *\n * @property {number} timescale\n * The time-scale of the representation.\n * @property {?number} segmentDuration\n * The duration of the segments in seconds, if given.\n * @property {number} startNumber\n * The start number of the segments; 1 or greater.\n * @property {number} presentationTimeOffset\n * The presentationTimeOffset of the representation, in seconds.\n * @property {number} unscaledPresentationTimeOffset\n * The presentationTimeOffset of the representation, in timescale units.\n * @property {Array.<shaka.dash.MpdUtils.TimeRange>} timeline\n * The timeline of the representation, if given. Times in seconds.\n * @property {?string} mediaTemplate\n * The media URI template, if given.\n * @property {?string} indexTemplate\n * The index URI template, if given.\n */\nshaka.dash.SegmentTemplate.SegmentTemplateInfo;\n\n\n/**\n * @param {?shaka.dash.DashParser.InheritanceFrame} frame\n * @return {Element}\n * @private\n */\nshaka.dash.SegmentTemplate.fromInheritance_ = function(frame) {\n return frame.segmentTemplate;\n};\n\n\n/**\n * Parses a SegmentTemplate element into an info object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {shaka.dash.SegmentTemplate.SegmentTemplateInfo}\n * @private\n */\nshaka.dash.SegmentTemplate.parseSegmentTemplateInfo_ = function(context) {\n var SegmentTemplate = shaka.dash.SegmentTemplate;\n var MpdUtils = shaka.dash.MpdUtils;\n var segmentInfo =\n MpdUtils.parseSegmentInfo(context, SegmentTemplate.fromInheritance_);\n\n var media = MpdUtils.inheritAttribute(\n context, SegmentTemplate.fromInheritance_, 'media');\n var index = MpdUtils.inheritAttribute(\n context, SegmentTemplate.fromInheritance_, 'index');\n\n return {\n segmentDuration: segmentInfo.segmentDuration,\n timescale: segmentInfo.timescale,\n startNumber: segmentInfo.startNumber,\n presentationTimeOffset: segmentInfo.presentationTimeOffset,\n unscaledPresentationTimeOffset: segmentInfo.unscaledPresentationTimeOffset,\n timeline: segmentInfo.timeline,\n mediaTemplate: media,\n indexTemplate: index\n };\n};\n\n\n/**\n * Verifies a SegmentTemplate info object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.SegmentTemplate.checkSegmentTemplateInfo_ = function(context, info) {\n var n = 0;\n n += info.indexTemplate ? 1 : 0;\n n += info.timeline ? 1 : 0;\n n += info.segmentDuration ? 1 : 0;\n\n if (n == 0) {\n shaka.log.error(\n 'SegmentTemplate does not contain any segment information:',\n 'the SegmentTemplate must contain either an index URL template',\n 'a SegmentTimeline, or a segment duration.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n } else if (n != 1) {\n shaka.log.warning(\n 'SegmentTemplate containes multiple segment information sources:',\n 'the SegmentTemplate should only contain an index URL template,',\n 'a SegmentTimeline or a segment duration.',\n context.representation);\n if (info.indexTemplate) {\n shaka.log.info('Using the index URL template by default.');\n info.timeline = null;\n info.segmentDuration = null;\n } else {\n goog.asserts.assert(info.timeline, 'There should be a timeline');\n shaka.log.info('Using the SegmentTimeline by default.');\n info.segmentDuration = null;\n }\n }\n\n if (!info.indexTemplate && !info.mediaTemplate) {\n shaka.log.error(\n 'SegmentTemplate does not contain sufficient segment information:',\n 'the SegmentTemplate\\'s media URL template is missing.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n};\n\n\n/**\n * Creates segment index functions from a index URL template.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {shaka.media.InitSegmentReference} init\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @throws shaka.util.Error When there is a parsing error.\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n * @private\n */\nshaka.dash.SegmentTemplate.createFromIndexTemplate_ = function(\n context, requestInitSegment, init, info) {\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n // Determine the container type.\n var containerType = context.representation.mimeType.split('/')[1];\n if ((containerType != 'mp4') && (containerType != 'webm')) {\n shaka.log.error(\n 'SegmentTemplate specifies an unsupported container type.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_UNSUPPORTED_CONTAINER);\n }\n\n if ((containerType == 'webm') && !init) {\n shaka.log.error(\n 'SegmentTemplate does not contain sufficient segment information:',\n 'the SegmentTemplate uses a WebM container,',\n 'but does not contain an initialization URL template.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_WEBM_MISSING_INIT);\n }\n\n goog.asserts.assert(info.indexTemplate, 'must be using index template');\n var filledTemplate = MpdUtils.fillUriTemplate(\n info.indexTemplate, context.representation.id,\n null, context.bandwidth || null, null);\n\n var resolvedUris = ManifestParserUtils.resolveUris(\n context.representation.baseUris, [filledTemplate]);\n\n return shaka.dash.SegmentBase.createSegmentIndexFromUris(\n context, requestInitSegment, init, resolvedUris, 0, null, containerType,\n info.presentationTimeOffset);\n};\n\n\n/**\n * Creates segment index functions from a segment duration.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n * @private\n */\nshaka.dash.SegmentTemplate.createFromDuration_ = function(context, info) {\n goog.asserts.assert(info.mediaTemplate,\n 'There should be a media template with duration');\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var periodDuration = context.periodInfo.duration;\n var segmentDuration = info.segmentDuration;\n var startNumber = info.startNumber;\n var timescale = info.timescale;\n\n var template = info.mediaTemplate;\n var bandwidth = context.bandwidth || null;\n var id = context.representation.id;\n var baseUris = context.representation.baseUris;\n\n var find = function(periodTime) {\n if (periodTime < 0)\n return null;\n else if (periodDuration && periodTime >= periodDuration)\n return null;\n\n return Math.floor(periodTime / segmentDuration);\n };\n var get = function(position) {\n var segmentStart = position * segmentDuration;\n\n // Do not construct segments references that should not exist.\n if (segmentStart < 0)\n return null;\n else if (periodDuration && segmentStart >= periodDuration)\n return null;\n\n var getUris = function() {\n var mediaUri = MpdUtils.fillUriTemplate(\n template, id, position + startNumber, bandwidth,\n segmentStart * timescale);\n return ManifestParserUtils.resolveUris(baseUris, [mediaUri]);\n };\n\n return new shaka.media.SegmentReference(\n position, segmentStart, segmentStart + segmentDuration, getUris, 0,\n null);\n };\n\n return {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: find,\n getSegmentReference: get\n };\n};\n\n\n/**\n * Creates segment references from a timeline.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.dash.SegmentTemplate.createFromTimeline_ = function(context, info) {\n goog.asserts.assert(info.mediaTemplate,\n 'There should be a media template with a timeline');\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n /** @type {!Array.<!shaka.media.SegmentReference>} */\n var references = [];\n for (var i = 0; i < info.timeline.length; i++) {\n var start = info.timeline[i].start;\n var unscaledStart = info.timeline[i].unscaledStart;\n var end = info.timeline[i].end;\n\n // Note: i = k - 1, where k indicates the k'th segment listed in the MPD.\n // (See section 5.3.9.5.3 of the DASH spec.)\n var segmentReplacement = i + info.startNumber;\n\n // Consider the presentation time offset in segment uri computation\n var timeReplacement = unscaledStart +\n info.unscaledPresentationTimeOffset;\n var createUris = (function(\n template, repId, bandwidth, baseUris, segmentId, time) {\n var mediaUri = MpdUtils.fillUriTemplate(\n template, repId, segmentId, bandwidth, time);\n return ManifestParserUtils.resolveUris(baseUris, [mediaUri])\n .map(function(g) { return g.toString(); });\n }.bind(null, info.mediaTemplate, context.representation.id,\n context.bandwidth || null, context.representation.baseUris,\n segmentReplacement, timeReplacement));\n\n references.push(new shaka.media.SegmentReference(\n segmentReplacement, start, end, createUris, 0, null));\n }\n\n return references;\n};\n\n\n/**\n * Creates an init segment reference from a context object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {shaka.media.InitSegmentReference}\n * @private\n */\nshaka.dash.SegmentTemplate.createInitSegment_ = function(context) {\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var SegmentTemplate = shaka.dash.SegmentTemplate;\n\n var initialization = MpdUtils.inheritAttribute(\n context, SegmentTemplate.fromInheritance_, 'initialization');\n if (!initialization)\n return null;\n\n var repId = context.representation.id;\n var bandwidth = context.bandwidth || null;\n var baseUris = context.representation.baseUris;\n var getUris = function() {\n goog.asserts.assert(initialization, 'Should have returned earler');\n var filledTemplate = MpdUtils.fillUriTemplate(\n initialization, repId, null, bandwidth, null);\n var resolvedUris = ManifestParserUtils.resolveUris(\n baseUris, [filledTemplate]);\n return resolvedUris;\n };\n\n return new shaka.media.InitSegmentReference(getUris, 0, null);\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/segment_template.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.ManifestParser');\n\ngoog.require('goog.Uri');\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\n\n\n/**\n * @namespace shaka.media.ManifestParser\n * @summary An interface to register manifest parsers.\n * @exportDoc\n */\n\n\n/**\n * Contains the parser factory functions indexed by MIME type.\n *\n * @type {!Object.<string, shakaExtern.ManifestParser.Factory>}\n */\nshaka.media.ManifestParser.parsersByMime = {};\n\n\n/**\n * Contains the parser factory functions indexed by file extension.\n *\n * @type {!Object.<string, shakaExtern.ManifestParser.Factory>}\n */\nshaka.media.ManifestParser.parsersByExtension = {};\n\n\n/**\n * Registers a manifest parser by file extension.\n *\n * @param {string} extension The file extension of the manifest.\n * @param {shakaExtern.ManifestParser.Factory} parserFactory The factory\n * used to create parser instances.\n * @export\n */\nshaka.media.ManifestParser.registerParserByExtension = function(\n extension, parserFactory) {\n shaka.media.ManifestParser.parsersByExtension[extension] = parserFactory;\n};\n\n\n/**\n * Registers a manifest parser by MIME type.\n *\n * @param {string} mimeType The MIME type of the manifest.\n * @param {shakaExtern.ManifestParser.Factory} parserFactory The factory\n * used to create parser instances.\n * @export\n */\nshaka.media.ManifestParser.registerParserByMime = function(\n mimeType, parserFactory) {\n shaka.media.ManifestParser.parsersByMime[mimeType] = parserFactory;\n};\n\n\n/**\n * Returns a map of manifest support for well-known types.\n *\n * @return {!Object.<string, boolean>}\n */\nshaka.media.ManifestParser.probeSupport = function() {\n // Make sure all registered parsers are shown.\n var support = {};\n for (var type in shaka.media.ManifestParser.parsersByMime) {\n support[type] = true;\n }\n for (var type in shaka.media.ManifestParser.parsersByExtension) {\n support[type] = true;\n }\n\n // Make sure all well-known types are tested as well, just to show an explicit\n // false for things people might be expecting.\n var testMimeTypes = [\n // DASH\n 'application/dash+xml',\n // HLS\n 'application/x-mpegurl',\n 'application/vnd.apple.mpegurl',\n // SmoothStreaming\n 'application/vnd.ms-sstr+xml'\n ];\n var testExtensions = [\n // DASH\n 'mpd',\n // HLS\n 'm3u8',\n // SmoothStreaming\n 'ism'\n ];\n\n testMimeTypes.forEach(function(type) {\n support[type] = !!shaka.media.ManifestParser.parsersByMime[type];\n });\n testExtensions.forEach(function(type) {\n support[type] = !!shaka.media.ManifestParser.parsersByExtension[type];\n });\n\n return support;\n};\n\n\n/**\n * Finds a manifest parser factory to parse the given manifest.\n *\n * @param {string} manifestUri\n * @param {!shaka.net.NetworkingEngine} netEngine\n * @param {shakaExtern.RetryParameters} retryParams\n * @param {shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * @return {!Promise.<shakaExtern.ManifestParser.Factory>}\n */\nshaka.media.ManifestParser.getFactory = function(\n manifestUri, netEngine, retryParams, opt_manifestParserFactory) {\n var factory = opt_manifestParserFactory;\n var extension;\n\n if (!factory) {\n // Try to choose a manifest parser by file extension.\n var uriObj = new goog.Uri(manifestUri);\n var uriPieces = uriObj.getPath().split('/');\n var uriFilename = uriPieces.pop();\n var filenamePieces = uriFilename.split('.');\n // Only one piece means there is no extension.\n if (filenamePieces.length > 1) {\n extension = filenamePieces.pop().toLowerCase();\n factory = shaka.media.ManifestParser.parsersByExtension[extension];\n }\n }\n\n if (factory)\n return Promise.resolve(factory);\n\n // Try to choose a manifest parser by MIME type.\n var headRequest =\n shaka.net.NetworkingEngine.makeRequest([manifestUri], retryParams);\n headRequest.method = 'HEAD';\n var type = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n\n return netEngine.request(type, headRequest).then(\n function(response) {\n var mimeType = response.headers['content-type'];\n // https://goo.gl/yzKDRx says this header should always be available,\n // but just to be safe:\n if (mimeType) {\n mimeType = mimeType.toLowerCase();\n }\n factory = shaka.media.ManifestParser.parsersByMime[mimeType];\n if (!factory) {\n shaka.log.error(\n 'Unable to guess manifest type by file extension ' +\n 'or by MIME type.', extension, mimeType);\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.UNABLE_TO_GUESS_MANIFEST_TYPE,\n manifestUri));\n }\n return factory;\n }, function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Incorrect error type');\n shaka.log.error('HEAD request to guess manifest type failed!', error);\n error.severity = shaka.util.Error.Severity.CRITICAL;\n return Promise.reject(error);\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/manifest_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.PresentationTimeline');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\n\n\n\n/**\n * Creates a PresentationTimeline.\n *\n * @param {?number} presentationStartTime The wall-clock time, in seconds,\n * when the presentation started or will start. Only required for live.\n * @param {number} presentationDelay The delay to give the presentation, in\n * seconds. Only required for live.\n *\n * @see {shakaExtern.Manifest}\n * @see {@tutorial architecture}\n *\n * @constructor\n * @struct\n * @export\n */\nshaka.media.PresentationTimeline = function(\n presentationStartTime, presentationDelay) {\n /** @private {?number} */\n this.presentationStartTime_ = presentationStartTime;\n\n /** @private {number} */\n this.presentationDelay_ = presentationDelay;\n\n /** @private {number} */\n this.duration_ = Infinity;\n\n /** @private {number} */\n this.segmentAvailabilityDuration_ = Infinity;\n\n /** @private {?number} */\n this.maxSegmentDuration_ = 1;\n\n /** @private {number} */\n this.clockOffset_ = 0;\n\n /** @private {boolean} */\n this.static_ = true;\n};\n\n\n/**\n * @return {number} The presentation's duration in seconds.\n * Infinity indicates that the presentation continues indefinitely.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getDuration = function() {\n return this.duration_;\n};\n\n\n/**\n * Sets the presentation's duration.\n *\n * @param {number} duration The presentation's duration in seconds.\n * Infinity indicates that the presentation continues indefinitely.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setDuration = function(duration) {\n goog.asserts.assert(duration > 0, 'duration must be > 0');\n this.duration_ = duration;\n};\n\n\n/**\n * @return {?number} The presentation's start time in seconds.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getPresentationStartTime =\n function() {\n return this.presentationStartTime_;\n};\n\n\n/**\n * Sets the clock offset, which is the the difference between the client's clock\n * and the server's clock, in milliseconds (i.e., serverTime = Date.now() +\n * clockOffset).\n *\n * @param {number} offset The clock offset, in ms.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setClockOffset = function(offset) {\n this.clockOffset_ = offset;\n};\n\n\n/**\n * Sets the presentation's static flag.\n *\n * @param {boolean} isStatic If true, the presentation is static, meaning all\n * segments are available at once.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setStatic = function(isStatic) {\n // NOTE: the argument name is not \"static\" because that's a keyword in ES6\n this.static_ = isStatic;\n};\n\n\n/**\n * Gets the presentation's segment availability duration, which is the amount\n * of time, in seconds, that the start of a segment remains available after the\n * live-edge moves past the end of that segment. Infinity indicates that\n * segments remain available indefinitely. For example, if your live\n * presentation has a 5 minute DVR window and your segments are 10 seconds long\n * then the segment availability duration should be 4 minutes and 50 seconds.\n *\n * @return {number} The presentation's segment availability duration.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSegmentAvailabilityDuration =\n function() {\n return this.segmentAvailabilityDuration_;\n};\n\n\n/**\n * Sets the presentation's segment availability duration. The segment\n * availability duration should only be set for live.\n *\n * @param {number} segmentAvailabilityDuration The presentation's new segment\n * availability duration in seconds.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setSegmentAvailabilityDuration =\n function(segmentAvailabilityDuration) {\n goog.asserts.assert(segmentAvailabilityDuration >= 0,\n 'segmentAvailabilityDuration must be >= 0');\n this.segmentAvailabilityDuration_ = segmentAvailabilityDuration;\n};\n\n\n/**\n * Gives PresentationTimeline a Stream's segments so it can size and position\n * the segment availability window, and account for missing segment\n * information. This function should be called once for each Stream (no more,\n * no less).\n *\n * @param {number} periodStartTime\n * @param {!Array.<!shaka.media.SegmentReference>} references\n * @export\n */\nshaka.media.PresentationTimeline.prototype.notifySegments = function(\n periodStartTime, references) {\n if (references.length == 0)\n return;\n\n this.maxSegmentDuration_ = references.reduce(\n function(max, r) { return Math.max(max, r.endTime - r.startTime); },\n this.maxSegmentDuration_);\n\n shaka.log.v1('notifySegments:',\n 'maxSegmentDuration=' + this.maxSegmentDuration_);\n};\n\n\n/**\n * Gives PresentationTimeline a Stream's maximum segment duration so it can\n * size and position the segment availability window. This function should be\n * called once for each Stream (no more, no less), but does not have to be\n * called if notifySegments() is called instead for a particular stream.\n *\n * @param {number} maxSegmentDuration The maximum segment duration for a\n * particular stream.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.notifyMaxSegmentDuration = function(\n maxSegmentDuration) {\n this.maxSegmentDuration_ = Math.max(\n this.maxSegmentDuration_, maxSegmentDuration);\n\n shaka.log.v1('notifyNewSegmentDuration:',\n 'maxSegmentDuration=' + this.maxSegmentDuration_);\n};\n\n\n/**\n * @return {boolean} True if the presentation is live; otherwise, return\n * false.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.isLive = function() {\n return this.duration_ == Infinity &&\n !this.static_;\n};\n\n\n/**\n * @return {boolean} True if the presentation is in progress (meaning not live,\n * but also not completely available); otherwise, return false.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.isInProgress = function() {\n return this.duration_ != Infinity &&\n !this.static_;\n};\n\n\n/**\n * Gets the presentation's current segment availability start time. Segments\n * ending at or before this time should be assumed to be unavailable.\n *\n * @return {number} The current segment availability start time, in seconds,\n * relative to the start of the presentation.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSegmentAvailabilityStart =\n function() {\n return this.getSafeAvailabilityStart(0 /* delay */);\n};\n\n\n/**\n * Gets the presentation's current segment availability start time, offset by\n * the given amount. This is used to ensure that we don't \"fall\" back out of\n * the availability window while we are buffering.\n *\n * @param {number} offset The offset to add to the start time.\n * @return {number} The current segment availability start time, in seconds,\n * relative to the start of the presentation.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSafeAvailabilityStart =\n function(offset) {\n if (this.segmentAvailabilityDuration_ == Infinity)\n return 0;\n\n var end = this.getSegmentAvailabilityEnd();\n var start = Math.min(end - this.segmentAvailabilityDuration_ + offset, end);\n return Math.max(0, start);\n};\n\n\n/**\n * Gets the presentation's current segment availability end time. Segments\n * starting after this time should be assumed to be unavailable.\n *\n * @return {number} The current segment availability end time, in seconds,\n * relative to the start of the presentation. Always returns the\n * presentation's duration for video-on-demand.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSegmentAvailabilityEnd =\n function() {\n if (!this.isLive() && !this.isInProgress())\n return this.duration_;\n\n return Math.min(this.getLiveEdge_(), this.duration_);\n};\n\n\n/**\n * Gets the seek range end.\n *\n * @return {number}\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSeekRangeEnd = function() {\n var useDelay = this.isLive() || this.isInProgress();\n var delay = useDelay ? this.presentationDelay_ : 0;\n return Math.max(0, this.getSegmentAvailabilityEnd() - delay);\n};\n\n\n/**\n * @return {number} The current presentation time in seconds.\n * @private\n */\nshaka.media.PresentationTimeline.prototype.getLiveEdge_ = function() {\n goog.asserts.assert(this.presentationStartTime_ != null,\n 'Cannot compute timeline live edge without start time');\n var now = (Date.now() + this.clockOffset_) / 1000.0;\n return Math.max(\n 0, now - this.maxSegmentDuration_ - this.presentationStartTime_);\n};\n\n\nif (!COMPILED) {\n /**\n * Debug only: assert that the timeline parameters make sense for the type of\n * presentation (VOD, IPR, live).\n */\n shaka.media.PresentationTimeline.prototype.assertIsValid = function() {\n if (this.isLive()) {\n // Implied by isLive(): infinite and dynamic.\n // Live streams should have a start time.\n goog.asserts.assert(this.presentationStartTime_ != null,\n 'Detected as live stream, but does not match our model of live!');\n } else if (this.isInProgress()) {\n // Implied by isInProgress(): finite and dynamic.\n // IPR streams should have a start time, and segments should not expire.\n goog.asserts.assert(this.presentationStartTime_ != null &&\n this.segmentAvailabilityDuration_ == Infinity,\n 'Detected as IPR stream, but does not match our model of IPR!');\n } else { // VOD\n // VOD segments should not expire and the presentation should be finite\n // and static.\n goog.asserts.assert(this.segmentAvailabilityDuration_ == Infinity &&\n this.duration_ != Infinity &&\n this.static_,\n 'Detected as VOD stream, but does not match our model of VOD!');\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/presentation_timeline.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.DashParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.ContentProtection');\ngoog.require('shaka.dash.SegmentBase');\ngoog.require('shaka.dash.SegmentList');\ngoog.require('shaka.dash.SegmentTemplate');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.LanguageUtils');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n\n/**\n * Creates a new DASH parser.\n *\n * @struct\n * @constructor\n * @implements {shakaExtern.ManifestParser}\n * @export\n */\nshaka.dash.DashParser = function() {\n /** @private {?shakaExtern.ManifestConfiguration} */\n this.config_ = null;\n\n /** @private {?shakaExtern.ManifestParser.PlayerInterface} */\n this.playerInterface_ = null;\n\n /** @private {!Array.<string>} */\n this.manifestUris_ = [];\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = null;\n\n /** @private {!Array.<string>} */\n this.periodIds_ = [];\n\n /** @private {number} */\n this.globalId_ = 1;\n\n /**\n * A map of IDs to SegmentIndex objects.\n * ID: Period@id,AdaptationSet@id,@Representation@id\n * e.g.: '1,5,23'\n * @private {!Object.<string, !shaka.media.SegmentIndex>}\n */\n this.segmentIndexMap_ = {};\n\n /**\n * The update period in seconds; or 0 for no updates.\n * @private {number}\n */\n this.updatePeriod_ = 0;\n\n /** @private {?number} */\n this.updateTimer_ = null;\n};\n\n\n/**\n * Contains the minimum amount of time, in seconds, between manifest update\n * requests.\n *\n * @private\n * @const {number}\n */\nshaka.dash.DashParser.MIN_UPDATE_PERIOD_ = 3;\n\n\n/**\n * The default MPD@suggestedPresentationDelay in seconds.\n *\n * @private\n * @const {number}\n */\nshaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_ = 10;\n\n\n/**\n * @typedef {\n * !function(!Array.<string>, ?number, ?number):!Promise.<!ArrayBuffer>\n * }\n */\nshaka.dash.DashParser.RequestInitSegmentCallback;\n\n\n/**\n * @typedef {{\n * segmentBase: Element,\n * segmentList: Element,\n * segmentTemplate: Element,\n * baseUris: !Array.<string>,\n * width: (number|undefined),\n * height: (number|undefined),\n * contentType: string,\n * mimeType: string,\n * codecs: string,\n * frameRate: (number|undefined),\n * containsEmsgBoxes: boolean,\n * id: string\n * }}\n *\n * @description\n * A collection of elements and properties which are inherited across levels\n * of a DASH manifest.\n *\n * @property {Element} segmentBase\n * The XML node for SegmentBase.\n * @property {Element} segmentList\n * The XML node for SegmentList.\n * @property {Element} segmentTemplate\n * The XML node for SegmentTemplate.\n * @property {!Array.<string>} baseUris\n * An array of absolute base URIs for the frame.\n * @property {(number|undefined)} width\n * The inherited width value.\n * @property {(number|undefined)} height\n * The inherited height value.\n * @property {string} contentType\n * The inherited media type.\n * @property {string} mimeType\n * The inherited MIME type value.\n * @property {string} codecs\n * The inherited codecs value.\n * @property {(number|undefined)} frameRate\n * The inherited framerate value.\n * @property {boolean} containsEmsgBoxes\n * Whether there are 'emsg' boxes.\n * @property {string} id\n * The ID of the element.\n */\nshaka.dash.DashParser.InheritanceFrame;\n\n\n/**\n * @typedef {{\n * dynamic: boolean,\n * presentationTimeline: !shaka.media.PresentationTimeline,\n * period: ?shaka.dash.DashParser.InheritanceFrame,\n * periodInfo: ?shaka.dash.DashParser.PeriodInfo,\n * adaptationSet: ?shaka.dash.DashParser.InheritanceFrame,\n * representation: ?shaka.dash.DashParser.InheritanceFrame,\n * bandwidth: (number|undefined),\n * indexRangeWarningGiven: boolean\n * }}\n *\n * @description\n * Contains context data for the streams.\n *\n * @property {boolean} dynamic\n * True if the MPD is dynamic (not all segments available at once)\n * @property {!shaka.media.PresentationTimeline} presentationTimeline\n * The PresentationTimeline.\n * @property {?shaka.dash.DashParser.InheritanceFrame} period\n * The inheritance from the Period element.\n * @property {?shaka.dash.DashParser.PeriodInfo} periodInfo\n * The Period info for the current Period.\n * @property {?shaka.dash.DashParser.InheritanceFrame} adaptationSet\n * The inheritance from the AdaptationSet element.\n * @property {?shaka.dash.DashParser.InheritanceFrame} representation\n * The inheritance from the Representation element.\n * @property {(number|undefined)} bandwidth\n * The bandwidth of the Representation.\n * @property {boolean} indexRangeWarningGiven\n * True if the warning about SegmentURL@indexRange has been printed.\n */\nshaka.dash.DashParser.Context;\n\n\n/**\n * @typedef {{\n * start: number,\n * duration: ?number,\n * node: !Element,\n * isLastPeriod: boolean\n * }}\n *\n * @description\n * Contains information about a Period element.\n *\n * @property {number} start\n * The start time of the period.\n * @property {?number} duration\n * The duration of the period; or null if the duration is not given. This\n * will be non-null for all periods except the last.\n * @property {!Element} node\n * The XML Node for the Period.\n * @property {boolean} isLastPeriod\n * Whether this Period is the last one in the manifest.\n */\nshaka.dash.DashParser.PeriodInfo;\n\n\n/**\n * @typedef {{\n * id: string,\n * contentType: ?string,\n * language: string,\n * main: boolean,\n * streams: !Array.<shakaExtern.Stream>,\n * drmInfos: !Array.<shakaExtern.DrmInfo>,\n * trickModeFor: ?string,\n * representationIds: !Array.<string>\n * }}\n *\n * @description\n * Contains information about an AdaptationSet element.\n *\n * @property {string} id\n * The unique ID of the adaptation set.\n * @property {?string} contentType\n * The content type of the AdaptationSet.\n * @property {string} language\n * The language of the AdaptationSet.\n * @property {boolean} main\n * Whether the AdaptationSet has the 'main' type.\n * @property {!Array.<shakaExtern.Stream>} streams\n * The streams this AdaptationSet contains.\n * @property {!Array.<shakaExtern.DrmInfo>} drmInfos\n * The DRM info for the AdaptationSet.\n * @property {?string} trickModeFor\n * If non-null, this AdaptationInfo represents trick mode tracks. This\n * property is the ID of the normal AdaptationSet these tracks should be\n * associated with.\n * @property {!Array.<string>} representationIds\n * An array of the IDs of the Representations this AdaptationSet contains.\n */\nshaka.dash.DashParser.AdaptationInfo;\n\n\n/**\n * @typedef {{\n * createSegmentIndex: shakaExtern.CreateSegmentIndexFunction,\n * findSegmentPosition: shakaExtern.FindSegmentPositionFunction,\n * getSegmentReference: shakaExtern.GetSegmentReferenceFunction\n * }}\n *\n * @description\n * Contains functions used to create and find segment references.\n *\n * @property {shakaExtern.CreateSegmentIndexFunction} createSegmentIndex\n * The createSegmentIndex function.\n * @property {shakaExtern.FindSegmentPositionFunction} findSegmentPosition\n * The findSegmentPosition function.\n * @property {shakaExtern.GetSegmentReferenceFunction} getSegmentReference\n * The getSegmentReference function.\n */\nshaka.dash.DashParser.SegmentIndexFunctions;\n\n\n/**\n * @typedef {{\n * createSegmentIndex: shakaExtern.CreateSegmentIndexFunction,\n * findSegmentPosition: shakaExtern.FindSegmentPositionFunction,\n * getSegmentReference: shakaExtern.GetSegmentReferenceFunction,\n * initSegmentReference: shaka.media.InitSegmentReference,\n * presentationTimeOffset: (number|undefined)\n * }}\n *\n * @description\n * Contains information about a Stream. This is passed from the createStream\n * methods.\n *\n * @property {shakaExtern.CreateSegmentIndexFunction} createSegmentIndex\n * The createSegmentIndex function for the stream.\n * @property {shakaExtern.FindSegmentPositionFunction} findSegmentPosition\n * The findSegmentPosition function for the stream.\n * @property {shakaExtern.GetSegmentReferenceFunction} getSegmentReference\n * The getSegmentReference function for the stream.\n * @property {shaka.media.InitSegmentReference} initSegmentReference\n * The init segment for the stream.\n * @property {(number|undefined)} presentationTimeOffset\n * The presentationTimeOffset for the stream.\n */\nshaka.dash.DashParser.StreamInfo;\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.configure = function(config) {\n goog.asserts.assert(config.dash != null,\n 'DashManifestConfiguration should not be null!');\n\n this.config_ = config;\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.start = function(uri, playerInterface) {\n goog.asserts.assert(this.config_, 'Must call configure() before start()!');\n this.manifestUris_ = [uri];\n this.playerInterface_ = playerInterface;\n return this.requestManifest_().then(function() {\n if (this.playerInterface_)\n this.setUpdateTimer_(0);\n return this.manifest_;\n }.bind(this));\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.stop = function() {\n this.playerInterface_ = null;\n this.config_ = null;\n\n this.manifestUris_ = [];\n this.manifest_ = null;\n this.periodIds_ = [];\n this.segmentIndexMap_ = {};\n if (this.updateTimer_ != null) {\n window.clearTimeout(this.updateTimer_);\n this.updateTimer_ = null;\n }\n\n return Promise.resolve();\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.update = function() {\n this.requestManifest_().catch(function(error) {\n if (!this.playerInterface_) return;\n this.playerInterface_.onError(error);\n }.bind(this));\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.onExpirationUpdated = function(\n sessionId, expiration) {\n // No-op\n};\n\n\n/**\n * Makes a network request for the manifest and parses the resulting data.\n *\n * @return {!Promise}\n * @private\n */\nshaka.dash.DashParser.prototype.requestManifest_ = function() {\n var requestType = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n var request = shaka.net.NetworkingEngine.makeRequest(\n this.manifestUris_, this.config_.retryParameters);\n return this.playerInterface_.networkingEngine.request(requestType, request)\n .then(function(response) {\n // Detect calls to stop().\n if (!this.playerInterface_)\n return;\n\n // This may throw; but it will result in a failed promise.\n return this.parseManifest_(response.data, response.uri);\n }.bind(this));\n};\n\n\n/**\n * Parses the manifest XML. This also handles updates and will update the\n * stored manifest.\n *\n * @param {!ArrayBuffer} data\n * @param {string} finalManifestUri The final manifest URI, which may\n * differ from this.manifestUri_ if there has been a redirect.\n * @return {!Promise}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parseManifest_ =\n function(data, finalManifestUri) {\n var Error = shaka.util.Error;\n var Functional = shaka.util.Functional;\n var XmlUtils = shaka.util.XmlUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var string = shaka.util.StringUtils.fromUTF8(data);\n var parser = new DOMParser();\n var xml = null;\n var mpd = null;\n\n try {\n xml = parser.parseFromString(string, 'text/xml');\n } catch (exception) {}\n if (xml) {\n // parseFromString returns a Document object. A Document is a Node but not\n // an Element, so it cannot be used in XmlUtils (technically it can but the\n // types don't match). The |documentElement| member defines the top-level\n // element in the document.\n if (xml.documentElement.tagName == 'MPD')\n mpd = xml.documentElement;\n }\n if (mpd && mpd.getElementsByTagName('parsererror').length > 0)\n mpd = null; // It had a parser error in it.\n if (!mpd) {\n throw new Error(\n Error.Severity.CRITICAL, Error.Category.MANIFEST,\n Error.Code.DASH_INVALID_XML);\n }\n\n // Get any Location elements. This will update the manifest location and\n // the base URI.\n /** @type {!Array.<string>} */\n var manifestBaseUris = [finalManifestUri];\n /** @type {!Array.<string>} */\n var locations = XmlUtils.findChildren(mpd, 'Location')\n .map(XmlUtils.getContents)\n .filter(Functional.isNotNull);\n if (locations.length > 0) {\n this.manifestUris_ = locations;\n manifestBaseUris = locations;\n }\n\n var uris = XmlUtils.findChildren(mpd, 'BaseURL').map(XmlUtils.getContents);\n var baseUris = ManifestParserUtils.resolveUris(manifestBaseUris, uris);\n\n var minBufferTime =\n XmlUtils.parseAttr(mpd, 'minBufferTime', XmlUtils.parseDuration);\n this.updatePeriod_ = /** @type {number} */ (XmlUtils.parseAttr(\n mpd, 'minimumUpdatePeriod', XmlUtils.parseDuration, -1));\n\n var presentationStartTime = XmlUtils.parseAttr(\n mpd, 'availabilityStartTime', XmlUtils.parseDate);\n var segmentAvailabilityDuration = XmlUtils.parseAttr(\n mpd, 'timeShiftBufferDepth', XmlUtils.parseDuration);\n var suggestedPresentationDelay = XmlUtils.parseAttr(\n mpd, 'suggestedPresentationDelay', XmlUtils.parseDuration);\n var maxSegmentDuration = XmlUtils.parseAttr(\n mpd, 'maxSegmentDuration', XmlUtils.parseDuration);\n var mpdType = mpd.getAttribute('type') || 'static';\n\n var presentationTimeline;\n if (this.manifest_) {\n presentationTimeline = this.manifest_.presentationTimeline;\n } else {\n // DASH IOP v3.0 suggests using a default delay between minBufferTime and\n // timeShiftBufferDepth. This is literally the range of all feasible\n // choices for the value. Nothing older than timeShiftBufferDepth is still\n // available, and anything less than minBufferTime will cause buffering\n // issues.\n //\n // We have decided that our default will be 1.5 * minBufferTime, or 10s,\n // whichever is larger. This is fairly conservative. Content providers\n // should provide a suggestedPresentationDelay whenever possible to optimize\n // the live streaming experience.\n var defaultPresentationDelay = Math.max(\n shaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_,\n minBufferTime * 1.5);\n var presentationDelay = suggestedPresentationDelay != null ?\n suggestedPresentationDelay : defaultPresentationDelay;\n presentationTimeline = new shaka.media.PresentationTimeline(\n presentationStartTime, presentationDelay);\n }\n\n /** @type {shaka.dash.DashParser.Context} */\n var context = {\n // Don't base on updatePeriod_ since emsg boxes can cause manifest updates.\n dynamic: mpdType != 'static',\n presentationTimeline: presentationTimeline,\n period: null,\n periodInfo: null,\n adaptationSet: null,\n representation: null,\n bandwidth: undefined,\n indexRangeWarningGiven: false\n };\n\n var periodsAndDuration = this.parsePeriods_(context, baseUris, mpd);\n var duration = periodsAndDuration.duration;\n var periods = periodsAndDuration.periods;\n\n presentationTimeline.setStatic(mpdType == 'static');\n presentationTimeline.setDuration(duration || Infinity);\n presentationTimeline.setSegmentAvailabilityDuration(\n segmentAvailabilityDuration != null ?\n segmentAvailabilityDuration :\n Infinity);\n // Use @maxSegmentDuration to override smaller, derived values.\n presentationTimeline.notifyMaxSegmentDuration(maxSegmentDuration || 1);\n if (!COMPILED) presentationTimeline.assertIsValid();\n\n if (this.manifest_) {\n // This is a manifest update, so we're done.\n return Promise.resolve();\n }\n\n // This is the first manifest parse, so we cannot return until we calculate\n // the clock offset.\n var timingElements = XmlUtils.findChildren(mpd, 'UTCTiming');\n\n var isLive = presentationTimeline.isLive();\n\n return this.parseUtcTiming_(\n baseUris, timingElements, isLive).then(function(offset) {\n // Detect calls to stop().\n if (!this.playerInterface_)\n return;\n\n presentationTimeline.setClockOffset(offset);\n\n this.manifest_ = {\n presentationTimeline: presentationTimeline,\n periods: periods,\n offlineSessionIds: [],\n minBufferTime: minBufferTime || 0\n };\n }.bind(this));\n};\n\n\n/**\n * Reads and parses the periods from the manifest. This first does some\n * partial parsing so the start and duration is available when parsing children.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Array.<string>} baseUris\n * @param {!Element} mpd\n * @return {{periods: !Array.<shakaExtern.Period>, duration: ?number}}\n * @private\n */\nshaka.dash.DashParser.prototype.parsePeriods_ = function(\n context, baseUris, mpd) {\n var Functional = shaka.util.Functional;\n var XmlUtils = shaka.util.XmlUtils;\n var presentationDuration = XmlUtils.parseAttr(\n mpd, 'mediaPresentationDuration', XmlUtils.parseDuration);\n\n var periods = [];\n var prevEnd = 0;\n var periodNodes = XmlUtils.findChildren(mpd, 'Period');\n for (var i = 0; i < periodNodes.length; i++) {\n var elem = periodNodes[i];\n var start = /** @type {number} */ (\n XmlUtils.parseAttr(elem, 'start', XmlUtils.parseDuration, prevEnd));\n var givenDuration =\n XmlUtils.parseAttr(elem, 'duration', XmlUtils.parseDuration);\n\n var periodDuration = null;\n if (i != periodNodes.length - 1) {\n // \"The difference between the start time of a Period and the start time\n // of the following Period is the duration of the media content\n // represented by this Period.\"\n var nextPeriod = periodNodes[i + 1];\n var nextStart =\n XmlUtils.parseAttr(nextPeriod, 'start', XmlUtils.parseDuration);\n if (nextStart != null)\n periodDuration = nextStart - start;\n } else if (presentationDuration != null) {\n // \"The Period extends until the Period.start of the next Period, or\n // until the end of the Media Presentation in the case of the last\n // Period.\"\n periodDuration = presentationDuration - start;\n }\n\n if (periodDuration && givenDuration && periodDuration != givenDuration) {\n shaka.log.warning('There is a gap/overlap between Periods', elem);\n }\n // Only use the @duration in the MPD if we can't calculate it. We should\n // favor the @start of the following Period. This ensures that there aren't\n // gaps between Periods.\n if (periodDuration == null)\n periodDuration = givenDuration;\n\n\n // Parse child nodes.\n var info = {\n start: start,\n duration: periodDuration,\n node: elem,\n isLastPeriod: periodDuration == null || i == periodNodes.length - 1\n };\n var period = this.parsePeriod_(context, baseUris, info);\n periods.push(period);\n\n // If there are any new periods, call the callback and add them to the\n // manifest. If this is the first parse, it will see all of them as new.\n var periodId = context.period.id;\n if (this.periodIds_.every(Functional.isNotEqualFunc(periodId))) {\n this.playerInterface_.filterPeriod(period);\n this.periodIds_.push(periodId);\n if (this.manifest_)\n this.manifest_.periods.push(period);\n }\n\n\n if (periodDuration == null) {\n if (i != periodNodes.length - 1) {\n // If the duration is still null and we aren't at the end, then we will\n // skip any remaining periods.\n shaka.log.warning(\n 'Skipping Period', i + 1, 'and any subsequent Periods:', 'Period',\n i + 1, 'does not have a valid start time.', periods[i + 1]);\n }\n\n // The duration is unknown, so the end is unknown.\n prevEnd = null;\n break;\n }\n\n prevEnd = start + periodDuration;\n }\n\n if (presentationDuration != null) {\n if (prevEnd != presentationDuration) {\n shaka.log.warning(\n '@mediaPresentationDuration does not match the total duration of all',\n 'Periods.');\n // Assume @mediaPresentationDuration is correct.\n }\n return {\n periods: periods,\n duration: presentationDuration\n };\n } else {\n return {\n periods: periods,\n duration: prevEnd\n };\n }\n};\n\n\n/**\n * Parses a Period XML element. Unlike the other parse methods, this is not\n * given the Node; it is given a PeriodInfo structure. Also, partial parsing\n * was done before this was called so start and duration are valid.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Array.<string>} baseUris\n * @param {shaka.dash.DashParser.PeriodInfo} periodInfo\n * @return {shakaExtern.Period}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parsePeriod_ = function(\n context, baseUris, periodInfo) {\n var Functional = shaka.util.Functional;\n var XmlUtils = shaka.util.XmlUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n context.period = this.createFrame_(periodInfo.node, null, baseUris);\n context.periodInfo = periodInfo;\n\n // If the period doesn't have an ID, give it one based on its start time.\n if (!context.period.id) {\n shaka.log.info(\n 'No Period ID given for Period with start time ' + periodInfo.start +\n ', Assigning a default');\n context.period.id = '__shaka_period_' + periodInfo.start;\n }\n\n var eventStreamNodes = XmlUtils.findChildren(periodInfo.node, 'EventStream');\n eventStreamNodes.forEach(\n this.parseEventStream_.bind(this, periodInfo.start, periodInfo.duration));\n\n var adaptationSetNodes =\n XmlUtils.findChildren(periodInfo.node, 'AdaptationSet');\n var adaptationSets = adaptationSetNodes\n .map(this.parseAdaptationSet_.bind(this, context))\n .filter(Functional.isNotNull);\n\n var representationIds = adaptationSets\n .map(function(as) { return as.representationIds; })\n .reduce(Functional.collapseArrays, []);\n var uniqueRepIds = representationIds.filter(Functional.isNotDuplicate);\n if (context.dynamic && representationIds.length != uniqueRepIds.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_DUPLICATE_REPRESENTATION_ID);\n }\n\n var normalAdaptationSets = adaptationSets\n .filter(function(as) { return !as.trickModeFor; });\n\n var trickModeAdaptationSets = adaptationSets\n .filter(function(as) { return as.trickModeFor; });\n\n // Attach trick mode tracks to normal tracks.\n trickModeAdaptationSets.forEach(function(trickModeSet) {\n // There may be multiple trick mode streams, but we do not currently\n // support that. Just choose one.\n var trickModeVideo = trickModeSet.streams[0];\n var targetId = trickModeSet.trickModeFor;\n normalAdaptationSets.forEach(function(normalSet) {\n if (normalSet.id == targetId) {\n normalSet.streams.forEach(function(stream) {\n stream.trickModeVideo = trickModeVideo;\n });\n }\n });\n });\n\n var videoSets = this.getSetsOfType_(normalAdaptationSets, ContentType.VIDEO);\n var audioSets = this.getSetsOfType_(normalAdaptationSets, ContentType.AUDIO);\n\n if (!videoSets.length && !audioSets.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_EMPTY_PERIOD);\n }\n\n // In case of audio-only or video-only content, we create an array of one item\n // containing a null. This way, the double-loop works for all kinds of\n // content.\n if (!audioSets.length) {\n audioSets = [null];\n }\n if (!videoSets.length) {\n videoSets = [null];\n }\n\n // TODO: Limit number of combinations. Come up with a heuristic\n // to decide which audio tracks to combine with which video tracks.\n var variants = [];\n for (var i = 0; i < audioSets.length; i++) {\n for (var j = 0; j < videoSets.length; j++) {\n var audioSet = audioSets[i];\n var videoSet = videoSets[j];\n this.createVariants_(audioSet, videoSet, variants);\n }\n }\n\n var textSets = this.getSetsOfType_(normalAdaptationSets, ContentType.TEXT);\n var textStreams = [];\n for (var i = 0; i < textSets.length; i++) {\n textStreams.push.apply(textStreams, textSets[i].streams);\n }\n\n return {\n startTime: periodInfo.start,\n textStreams: textStreams,\n variants: variants\n };\n};\n\n\n/**\n * @param {!Array.<!shaka.dash.DashParser.AdaptationInfo>} adaptationSets\n * @param {string} type\n * @return {!Array.<!shaka.dash.DashParser.AdaptationInfo>}\n * @private\n */\nshaka.dash.DashParser.prototype.getSetsOfType_ = function(\n adaptationSets, type) {\n return adaptationSets.filter(function(as) {\n return as.contentType == type;\n });\n};\n\n\n/**\n * Combines Streams into Variants\n *\n * @param {?shaka.dash.DashParser.AdaptationInfo} audio\n * @param {?shaka.dash.DashParser.AdaptationInfo} video\n * @param {!Array.<shakaExtern.Variant>} variants New variants are pushed onto\n * this array.\n * @private\n */\nshaka.dash.DashParser.prototype.createVariants_ =\n function(audio, video, variants) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Since both audio and video are of the same type, this assertion will catch\n // certain mistakes at runtime that the compiler would miss.\n goog.asserts.assert(!audio || audio.contentType == ContentType.AUDIO,\n 'Audio parameter mismatch!');\n goog.asserts.assert(!video || video.contentType == ContentType.VIDEO,\n 'Video parameter mismatch!');\n\n /** @type {number} */\n var bandwidth;\n /** @type {shakaExtern.Variant} */\n var variant;\n\n if (!audio && !video) {\n return;\n } else if (audio && video) {\n // Audio+video variants\n var DrmEngine = shaka.media.DrmEngine;\n if (DrmEngine.areDrmCompatible(audio.drmInfos, video.drmInfos)) {\n var drmInfos = DrmEngine.getCommonDrmInfos(audio.drmInfos,\n video.drmInfos);\n\n for (var i = 0; i < audio.streams.length; i++) {\n for (var j = 0; j < video.streams.length; j++) {\n // Explicit cast, followed by assertion. These should both be defined\n // in the case of DASH, but the type of Stream.bandwidth allows for\n // undefined in order to support HLS.\n bandwidth = /** @type {number} */(\n video.streams[j].bandwidth +\n audio.streams[i].bandwidth);\n goog.asserts.assert(bandwidth,\n 'Bandwidth must be defined and non-zero!');\n variant = {\n id: this.globalId_++,\n language: audio.language,\n primary: audio.main || video.main,\n audio: audio.streams[i],\n video: video.streams[j],\n bandwidth: bandwidth,\n drmInfos: drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n\n variants.push(variant);\n }\n }\n }\n } else {\n // Audio or video only variants\n var set = audio || video;\n for (var i = 0; i < set.streams.length; i++) {\n // Explicit cast, followed by assertion. These should both be defined\n // in the case of DASH, but the type allows for undefined in order to\n // support HLS.\n bandwidth = /** @type {number} */(set.streams[i].bandwidth);\n goog.asserts.assert(bandwidth,\n 'Bandwidth must be defined and non-zero!');\n variant = {\n id: this.globalId_++,\n language: set.language || 'und',\n primary: set.main,\n audio: audio ? set.streams[i] : null,\n video: video ? set.streams[i] : null,\n bandwidth: bandwidth,\n drmInfos: set.drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n\n variants.push(variant);\n }\n }\n};\n\n\n/**\n * Parses an AdaptationSet XML element.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Element} elem The AdaptationSet element.\n * @return {?shaka.dash.DashParser.AdaptationInfo}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parseAdaptationSet_ = function(context, elem) {\n var XmlUtils = shaka.util.XmlUtils;\n var Functional = shaka.util.Functional;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var ContentType = ManifestParserUtils.ContentType;\n\n context.adaptationSet = this.createFrame_(elem, context.period, null);\n\n var main = false;\n var roleElements = XmlUtils.findChildren(elem, 'Role');\n var roleValues = roleElements.map(function(role) {\n return role.getAttribute('value');\n }).filter(Functional.isNotNull);\n\n // Default kind for text streams is 'subtitle' if unspecified in the manifest.\n var kind = undefined;\n if (context.adaptationSet.contentType == ManifestParserUtils.ContentType.TEXT)\n kind = ManifestParserUtils.TextStreamKind.SUBTITLE;\n\n for (var i = 0; i < roleElements.length; i++) {\n var scheme = roleElements[i].getAttribute('schemeIdUri');\n if (scheme == null || scheme == 'urn:mpeg:dash:role:2011') {\n // These only apply for the given scheme, but allow them to be specified\n // if there is no scheme specified.\n // See: DASH section 5.8.5.5\n var value = roleElements[i].getAttribute('value');\n switch (value) {\n case 'main':\n main = true;\n break;\n case 'caption':\n case 'subtitle':\n kind = value;\n break;\n }\n }\n }\n\n var essentialProperties = XmlUtils.findChildren(elem, 'EssentialProperty');\n // ID of real AdaptationSet if this is a trick mode set:\n var trickModeFor = null;\n var unrecognizedEssentialProperty = false;\n essentialProperties.forEach(function(prop) {\n var schemeId = prop.getAttribute('schemeIdUri');\n if (schemeId == 'http://dashif.org/guidelines/trickmode') {\n trickModeFor = prop.getAttribute('value');\n } else {\n unrecognizedEssentialProperty = true;\n }\n });\n\n // According to DASH spec (2014) section 5.8.4.8, \"the successful processing\n // of the descriptor is essential to properly use the information in the\n // parent element\". According to DASH IOP v3.3, section 3.3.4, \"if the scheme\n // or the value\" for EssentialProperty is not recognized, \"the DASH client\n // shall ignore the parent element.\"\n if (unrecognizedEssentialProperty) {\n // Stop parsing this AdaptationSet and let the caller filter out the nulls.\n return null;\n }\n\n var contentProtectionElems = XmlUtils.findChildren(elem, 'ContentProtection');\n var contentProtection = shaka.dash.ContentProtection.parseFromAdaptationSet(\n contentProtectionElems, this.config_.dash.customScheme,\n this.config_.dash.ignoreDrmInfo);\n\n var language =\n shaka.util.LanguageUtils.normalize(elem.getAttribute('lang') || 'und');\n\n // non-standard attribute(yet) supported by Kaltura\n var label = elem.getAttribute('label');\n\n // Parse Representations into Streams.\n var representations = XmlUtils.findChildren(elem, 'Representation');\n var streams = representations\n .map(this.parseRepresentation_.bind(this, context, contentProtection,\n kind, language, label, main, roleValues))\n .filter(function(s) { return !!s; });\n\n if (streams.length == 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_EMPTY_ADAPTATION_SET);\n }\n\n // If AdaptationSet's type is unknown or is ambiguously \"application\",\n // guess based on the information in the first stream. If the attributes\n // mimeType and codecs are split across levels, they will both be inherited\n // down to the stream level by this point, so the stream will have all the\n // necessary information.\n if (!context.adaptationSet.contentType ||\n context.adaptationSet.contentType == ContentType.APPLICATION) {\n var mimeType = streams[0].mimeType;\n var codecs = streams[0].codecs;\n context.adaptationSet.contentType =\n shaka.dash.DashParser.guessContentType_(mimeType, codecs);\n\n streams.forEach(function(stream) {\n stream.type = context.adaptationSet.contentType;\n });\n }\n\n streams.forEach(function(stream) {\n // Some DRM license providers require that we have a default\n // key ID from the manifest in the wrapped license request.\n // Thus, it should be put in drmInfo to be accessible to request filters.\n contentProtection.drmInfos.forEach(function(drmInfo) {\n if (stream.keyId) {\n drmInfo.keyIds.push(stream.keyId);\n }\n });\n });\n\n var repIds = representations\n .map(function(node) { return node.getAttribute('id'); })\n .filter(shaka.util.Functional.isNotNull);\n\n return {\n id: context.adaptationSet.id || ('__fake__' + this.globalId_++),\n contentType: context.adaptationSet.contentType,\n language: language,\n main: main,\n streams: streams,\n drmInfos: contentProtection.drmInfos,\n trickModeFor: trickModeFor,\n representationIds: repIds\n };\n};\n\n\n/**\n * Parses a Representation XML element.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.ContentProtection.Context} contentProtection\n * @param {(string|undefined)} kind\n * @param {string} language\n * @param {string} label\n * @param {boolean} isPrimary\n * @param {!Array.<string>} roles\n * @param {!Element} node\n * @return {?shakaExtern.Stream} The Stream, or null when there is a\n * non-critical parsing error.\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parseRepresentation_ = function(\n context, contentProtection, kind, language, label, isPrimary, roles, node) {\n var XmlUtils = shaka.util.XmlUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n context.representation = this.createFrame_(node, context.adaptationSet, null);\n if (!this.verifyRepresentation_(context.representation)) {\n shaka.log.warning('Skipping Representation', context.representation);\n return null;\n }\n\n context.bandwidth =\n XmlUtils.parseAttr(node, 'bandwidth', XmlUtils.parsePositiveInt) ||\n undefined;\n\n /** @type {?shaka.dash.DashParser.StreamInfo} */\n var streamInfo;\n var requestInitSegment = this.requestInitSegment_.bind(this);\n if (context.representation.segmentBase) {\n streamInfo = shaka.dash.SegmentBase.createStream(\n context, requestInitSegment);\n } else if (context.representation.segmentList) {\n streamInfo = shaka.dash.SegmentList.createStream(\n context, this.segmentIndexMap_);\n } else if (context.representation.segmentTemplate) {\n streamInfo = shaka.dash.SegmentTemplate.createStream(\n context, requestInitSegment, this.segmentIndexMap_, !!this.manifest_);\n } else {\n goog.asserts.assert(\n context.representation.contentType == ContentType.TEXT ||\n context.representation.contentType == ContentType.APPLICATION,\n 'Must have Segment* with non-text streams.');\n\n var baseUris = context.representation.baseUris;\n var duration = context.periodInfo.duration || 0;\n streamInfo = {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition:\n /** @return {?number} */ function(/** number */ time) {\n if (time >= 0 && time < duration)\n return 1;\n else\n return null;\n },\n getSegmentReference:\n /** @return {shaka.media.SegmentReference} */\n function(/** number */ ref) {\n if (ref != 1)\n return null;\n\n return new shaka.media.SegmentReference(\n 1, 0, duration, function() { return baseUris; }, 0, null);\n },\n initSegmentReference: null,\n presentationTimeOffset: 0\n };\n }\n\n var contentProtectionElems = XmlUtils.findChildren(node, 'ContentProtection');\n var keyId = shaka.dash.ContentProtection.parseFromRepresentation(\n contentProtectionElems, this.config_.dash.customScheme,\n contentProtection, this.config_.dash.ignoreDrmInfo);\n\n return {\n id: this.globalId_++,\n createSegmentIndex: streamInfo.createSegmentIndex,\n findSegmentPosition: streamInfo.findSegmentPosition,\n getSegmentReference: streamInfo.getSegmentReference,\n initSegmentReference: streamInfo.initSegmentReference,\n presentationTimeOffset: streamInfo.presentationTimeOffset,\n mimeType: context.representation.mimeType,\n codecs: context.representation.codecs,\n frameRate: context.representation.frameRate,\n bandwidth: context.bandwidth,\n width: context.representation.width,\n height: context.representation.height,\n kind: kind,\n encrypted: contentProtection.drmInfos.length > 0,\n keyId: keyId,\n language: language,\n label: label,\n type: context.adaptationSet.contentType,\n primary: isPrimary,\n trickModeVideo: null,\n containsEmsgBoxes: context.representation.containsEmsgBoxes,\n roles: roles\n };\n};\n\n\n/**\n * Called when the update timer ticks.\n *\n * @private\n */\nshaka.dash.DashParser.prototype.onUpdate_ = function() {\n goog.asserts.assert(this.updateTimer_, 'Should only be called by timer');\n goog.asserts.assert(this.updatePeriod_ >= 0,\n 'There should be an update period');\n\n shaka.log.info('Updating manifest...');\n\n this.updateTimer_ = null;\n var startTime = Date.now();\n\n this.requestManifest_().then(function() {\n // Detect a call to stop()\n if (!this.playerInterface_)\n return;\n\n // Ensure the next update occurs within |updatePeriod_| seconds by taking\n // into account the time it took to update the manifest.\n var endTime = Date.now();\n this.setUpdateTimer_((endTime - startTime) / 1000.0);\n }.bind(this)).catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Should only receive a Shaka error');\n\n // Try updating again, but ensure we haven't been destroyed.\n if (this.playerInterface_) {\n // We will retry updating, so override the severity of the error.\n error.severity = shaka.util.Error.Severity.RECOVERABLE;\n this.playerInterface_.onError(error);\n\n this.setUpdateTimer_(0);\n }\n }.bind(this));\n};\n\n\n/**\n * Sets the update timer. Does nothing if the manifest does not specify an\n * update period.\n *\n * @param {number} offset An offset, in seconds, to apply to the manifest's\n * update period.\n * @private\n */\nshaka.dash.DashParser.prototype.setUpdateTimer_ = function(offset) {\n // NOTE: An updatePeriod_ of -1 means the attribute was missing.\n // An attribute which is present and set to 0 should still result in periodic\n // updates. For more, see: https://github.com/google/shaka-player/issues/331\n if (this.updatePeriod_ < 0)\n return;\n goog.asserts.assert(this.updateTimer_ == null,\n 'Timer should not be already set');\n\n var period =\n Math.max(shaka.dash.DashParser.MIN_UPDATE_PERIOD_, this.updatePeriod_);\n var interval = Math.max(period - offset, 0);\n shaka.log.debug('updateInterval', interval);\n\n var callback = this.onUpdate_.bind(this);\n this.updateTimer_ = window.setTimeout(callback, 1000 * interval);\n};\n\n\n/**\n * Creates a new inheritance frame for the given element.\n *\n * @param {!Element} elem\n * @param {?shaka.dash.DashParser.InheritanceFrame} parent\n * @param {Array.<string>} baseUris\n * @return {shaka.dash.DashParser.InheritanceFrame}\n * @private\n */\nshaka.dash.DashParser.prototype.createFrame_ = function(\n elem, parent, baseUris) {\n goog.asserts.assert(parent || baseUris,\n 'Must provide either parent or baseUris');\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var XmlUtils = shaka.util.XmlUtils;\n parent = parent || /** @type {shaka.dash.DashParser.InheritanceFrame} */ ({\n contentType: '',\n mimeType: '',\n codecs: '',\n containsEmsgBoxes: false,\n frameRate: undefined\n });\n baseUris = baseUris || parent.baseUris;\n\n var parseNumber = XmlUtils.parseNonNegativeInt;\n var evalDivision = XmlUtils.evalDivision;\n var uris = XmlUtils.findChildren(elem, 'BaseURL').map(XmlUtils.getContents);\n\n var contentType = elem.getAttribute('contentType') || parent.contentType;\n var mimeType = elem.getAttribute('mimeType') || parent.mimeType;\n var codecs = elem.getAttribute('codecs') || parent.codecs;\n var frameRate =\n XmlUtils.parseAttr(elem, 'frameRate', evalDivision) || parent.frameRate;\n var containsEmsgBoxes =\n !!XmlUtils.findChildren(elem, 'InbandEventStream').length;\n\n if (!contentType) {\n contentType = shaka.dash.DashParser.guessContentType_(mimeType, codecs);\n }\n\n return {\n baseUris: ManifestParserUtils.resolveUris(baseUris, uris),\n segmentBase: XmlUtils.findChild(elem, 'SegmentBase') || parent.segmentBase,\n segmentList: XmlUtils.findChild(elem, 'SegmentList') || parent.segmentList,\n segmentTemplate:\n XmlUtils.findChild(elem, 'SegmentTemplate') || parent.segmentTemplate,\n width: XmlUtils.parseAttr(elem, 'width', parseNumber) || parent.width,\n height: XmlUtils.parseAttr(elem, 'height', parseNumber) || parent.height,\n contentType: contentType,\n mimeType: mimeType,\n codecs: codecs,\n frameRate: frameRate,\n containsEmsgBoxes: containsEmsgBoxes || parent.containsEmsgBoxes,\n id: elem.getAttribute('id')\n };\n};\n\n\n/**\n * Verifies that a Representation has exactly one Segment* element. Prints\n * warnings if there is a problem.\n *\n * @param {shaka.dash.DashParser.InheritanceFrame} frame\n * @return {boolean} True if the Representation is usable; otherwise return\n * false.\n * @private\n */\nshaka.dash.DashParser.prototype.verifyRepresentation_ = function(frame) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var n = 0;\n n += frame.segmentBase ? 1 : 0;\n n += frame.segmentList ? 1 : 0;\n n += frame.segmentTemplate ? 1 : 0;\n\n if (n == 0) {\n // TODO: extend with the list of MIME types registered to TextEngine.\n if (frame.contentType == ContentType.TEXT ||\n frame.contentType == ContentType.APPLICATION) {\n return true;\n } else {\n shaka.log.warning(\n 'Representation does not contain a segment information source:',\n 'the Representation must contain one of SegmentBase, SegmentList,',\n 'SegmentTemplate, or explicitly indicate that it is \"text\".',\n frame);\n return false;\n }\n }\n\n if (n != 1) {\n shaka.log.warning(\n 'Representation contains multiple segment information sources:',\n 'the Representation should only contain one of SegmentBase,',\n 'SegmentList, or SegmentTemplate.',\n frame);\n if (frame.segmentBase) {\n shaka.log.info('Using SegmentBase by default.');\n frame.segmentList = null;\n frame.segmentTemplate = null;\n } else {\n goog.asserts.assert(frame.segmentList, 'There should be a SegmentList');\n shaka.log.info('Using SegmentList by default.');\n frame.segmentTemplate = null;\n }\n }\n\n return true;\n};\n\n\n/**\n * Makes a request to the given URI and calculates the clock offset.\n *\n * @param {!Array.<string>} baseUris\n * @param {string} uri\n * @param {string} method\n * @return {!Promise.<number>}\n * @private\n */\nshaka.dash.DashParser.prototype.requestForTiming_ =\n function(baseUris, uri, method) {\n var requestUris = shaka.util.ManifestParserUtils.resolveUris(baseUris, [uri]);\n var request = shaka.net.NetworkingEngine.makeRequest(\n requestUris, this.config_.retryParameters);\n request.method = method;\n var type = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n return this.playerInterface_.networkingEngine.request(type, request)\n .then(function(response) {\n var text;\n if (method == 'HEAD') {\n if (!response.headers || !response.headers['date']) return 0;\n\n text = response.headers['date'];\n } else {\n text = shaka.util.StringUtils.fromUTF8(response.data);\n }\n\n var date = Date.parse(text);\n return isNaN(date) ? 0 : (date - Date.now());\n });\n};\n\n\n/**\n * Parses an array of UTCTiming elements.\n *\n * @param {!Array.<string>} baseUris\n * @param {!Array.<!Element>} elems\n * @param {boolean} isLive\n * @return {!Promise.<number>}\n * @private\n */\nshaka.dash.DashParser.prototype.parseUtcTiming_ =\n function(baseUris, elems, isLive) {\n var schemesAndValues = elems.map(function(elem) {\n return {\n scheme: elem.getAttribute('schemeIdUri'),\n value: elem.getAttribute('value')\n };\n });\n\n // If there's nothing specified in the manifest, but we have a default from\n // the config, use that.\n var clockSyncUri = this.config_.dash.clockSyncUri;\n if (isLive && !schemesAndValues.length && clockSyncUri) {\n schemesAndValues.push({\n scheme: 'urn:mpeg:dash:utc:http-head:2014',\n value: clockSyncUri\n });\n }\n\n var Functional = shaka.util.Functional;\n return Functional.createFallbackPromiseChain(schemesAndValues, function(sv) {\n var scheme = sv.scheme;\n var value = sv.value;\n switch (scheme) {\n // See DASH IOP Guidelines Section 4.7\n // http://goo.gl/CQFNJT\n case 'urn:mpeg:dash:utc:http-head:2014':\n // Some old ISO23009-1 drafts used 2012.\n case 'urn:mpeg:dash:utc:http-head:2012':\n return this.requestForTiming_(baseUris, value, 'HEAD');\n case 'urn:mpeg:dash:utc:http-xsdate:2014':\n case 'urn:mpeg:dash:utc:http-iso:2014':\n case 'urn:mpeg:dash:utc:http-xsdate:2012':\n case 'urn:mpeg:dash:utc:http-iso:2012':\n return this.requestForTiming_(baseUris, value, 'GET');\n case 'urn:mpeg:dash:utc:direct:2014':\n case 'urn:mpeg:dash:utc:direct:2012':\n var date = Date.parse(value);\n return isNaN(date) ? 0 : (date - Date.now());\n\n case 'urn:mpeg:dash:utc:http-ntp:2014':\n case 'urn:mpeg:dash:utc:ntp:2014':\n case 'urn:mpeg:dash:utc:sntp:2014':\n shaka.log.warning('NTP UTCTiming scheme is not supported');\n return Promise.reject();\n default:\n shaka.log.warning(\n 'Unrecognized scheme in UTCTiming element', scheme);\n return Promise.reject();\n }\n }.bind(this)).catch(function() {\n if (isLive) {\n shaka.log.warning(\n 'A UTCTiming element should always be given in live manifests! ' +\n 'This content may not play on clients with bad clocks!');\n }\n return 0;\n });\n};\n\n\n/**\n * Parses an EventStream element.\n *\n * @param {number} periodStart\n * @param {?number} periodDuration\n * @param {!Element} elem\n * @private\n */\nshaka.dash.DashParser.prototype.parseEventStream_ = function(\n periodStart, periodDuration, elem) {\n var XmlUtils = shaka.util.XmlUtils;\n var parseNumber = XmlUtils.parseNonNegativeInt;\n\n var schemeIdUri = elem.getAttribute('schemeIdUri') || '';\n var value = elem.getAttribute('value') || '';\n var timescale = XmlUtils.parseAttr(elem, 'timescale', parseNumber) || 1;\n\n XmlUtils.findChildren(elem, 'Event').forEach(function(eventNode) {\n var presentationTime =\n XmlUtils.parseAttr(eventNode, 'presentationTime', parseNumber) || 0;\n var duration = XmlUtils.parseAttr(eventNode, 'duration', parseNumber) || 0;\n\n var startTime = presentationTime / timescale + periodStart;\n var endTime = startTime + (duration / timescale);\n if (periodDuration != null) {\n // An event should not go past the Period, even if the manifest says so.\n // See: Dash sec. 5.10.2.1\n startTime = Math.min(startTime, periodStart + periodDuration);\n endTime = Math.min(endTime, periodStart + periodDuration);\n }\n\n /** @type {shakaExtern.TimelineRegionInfo} */\n var region = {\n schemeIdUri: schemeIdUri,\n value: value,\n startTime: startTime,\n endTime: endTime,\n id: eventNode.getAttribute('id') || '',\n eventElement: eventNode\n };\n\n this.playerInterface_.onTimelineRegionAdded(region);\n }.bind(this));\n};\n\n\n/**\n * Makes a network request on behalf of SegmentBase.createStream.\n *\n * @param {!Array.<string>} uris\n * @param {?number} startByte\n * @param {?number} endByte\n * @return {!Promise.<!ArrayBuffer>}\n * @private\n */\nshaka.dash.DashParser.prototype.requestInitSegment_ = function(\n uris, startByte, endByte) {\n var requestType = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n var request = shaka.net.NetworkingEngine.makeRequest(\n uris, this.config_.retryParameters);\n if (startByte != null) {\n var end = (endByte != null ? endByte : '');\n request.headers['Range'] = 'bytes=' + startByte + '-' + end;\n }\n\n return this.playerInterface_.networkingEngine.request(requestType, request)\n .then(function(response) { return response.data; });\n};\n\n\n/**\n * Guess the content type based on MIME type and codecs.\n *\n * @param {string} mimeType\n * @param {string} codecs\n * @return {string}\n * @private\n */\nshaka.dash.DashParser.guessContentType_ = function(mimeType, codecs) {\n var fullMimeType = shaka.util.StreamUtils.getFullMimeType(mimeType, codecs);\n\n if (shaka.media.TextEngine.isTypeSupported(fullMimeType)) {\n // If it's supported by TextEngine, it's definitely text.\n // We don't check MediaSourceEngine, because that would report support\n // for platform-supported video and audio types as well.\n return shaka.util.ManifestParserUtils.ContentType.TEXT;\n }\n\n // Otherwise, just split the MIME type. This handles video and audio\n // types well.\n return mimeType.split('/')[0];\n};\n\n\nshaka.media.ManifestParser.registerParserByExtension(\n 'mpd', shaka.dash.DashParser);\nshaka.media.ManifestParser.registerParserByMime(\n 'application/dash+xml', shaka.dash.DashParser);\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/dash_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.hls.Attribute');\ngoog.provide('shaka.hls.Playlist');\ngoog.provide('shaka.hls.PlaylistType');\ngoog.provide('shaka.hls.Segment');\ngoog.provide('shaka.hls.Tag');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Creates an HLS playlist object.\n *\n * @param {!string} uri\n * @param {!shaka.hls.PlaylistType} type\n * @param {!Array.<shaka.hls.Tag>} tags\n * @param {!Array.<shaka.hls.Segment>=} opt_segments\n *\n * @constructor\n * @struct\n */\nshaka.hls.Playlist = function(uri, type, tags, opt_segments) {\n /** @const {!string} */\n this.uri = uri;\n\n /** @const {shaka.hls.PlaylistType} */\n this.type = type;\n\n /** @const {!Array.<!shaka.hls.Tag>} */\n this.tags = tags;\n\n /** @const {Array.<!shaka.hls.Segment>} */\n this.segments = opt_segments || null;\n};\n\n\n/**\n * @enum {number}\n */\nshaka.hls.PlaylistType = {\n MASTER: 0,\n MEDIA: 1\n};\n\n\n\n/**\n * Creates an HLS tag object.\n *\n * @param {number} id\n * @param {!string} name\n * @param {!Array.<shaka.hls.Attribute>} attributes\n * @param {?string=} opt_value\n *\n * @constructor\n * @struct\n */\nshaka.hls.Tag = function(id, name, attributes, opt_value) {\n\n goog.asserts.assert(\n (attributes.length == 0 && opt_value) ||\n (attributes.length > 0 && !opt_value) ||\n (attributes.length == 0 && !opt_value),\n 'Tags can only take the form ' +\n '(1) <NAME>:<VALUE> ' +\n '(2) <NAME>:<ATTRIBUTE_LIST> ' +\n ' (3) <NAME>');\n\n /** @const {number} */\n this.id = id;\n\n /** @const {!string} */\n this.name = name;\n\n /** @const {Array.<shaka.hls.Attribute>} */\n this.attributes = attributes;\n\n /** @const {?string} */\n this.value = opt_value || null;\n};\n\n\n/**\n * Create the string representation of the tag.\n *\n * For the DRM system - the full tag needs to be passed down to the CDM. There\n * are two ways of doing this (1) save the original tag or (2) recreate the tag.\n * As with some cases (like in tests) the tag never existed in string form, it\n * is far easier to recreate the tag from the parsed form.\n *\n * @return {string}\n * @override\n */\nshaka.hls.Tag.prototype.toString = function() {\n\n /**\n * @param {shaka.hls.Attribute} attr\n * @return {!string}\n */\n var attr_to_str = function(attr) {\n return attr.name + '=\"' + attr.value + '\"';\n };\n\n\n // A valid tag can only follow 1 of 3 patterns.\n // 1) <NAME>:<VALUE>\n // 2) <NAME>:<ATTRIBUTE LIST>\n // 3) <NAME>\n\n if (this.value) {\n return '#' + this.name + ':' + this.value;\n }\n\n if (this.attributes.length > 0) {\n return '#' + this.name + ':' + this.attributes.map(attr_to_str).join(',');\n }\n\n return '#' + this.name;\n};\n\n\n\n/**\n * Creates an HLS attribute object.\n *\n * @param {!string} name\n * @param {!string} value\n *\n * @constructor\n * @struct\n */\nshaka.hls.Attribute = function(name, value) {\n /** @const {!string} */\n this.name = name;\n\n /** @const {!string} */\n this.value = value;\n};\n\n\n/**\n * Adds an attribute to an HLS Tag.\n *\n * @param {!shaka.hls.Attribute} attribute\n */\nshaka.hls.Tag.prototype.addAttribute = function(attribute) {\n this.attributes.push(attribute);\n};\n\n\n/**\n * Gets the first attribute of the tag with a specified name.\n *\n * @param {!string} name\n * @return {?shaka.hls.Attribute} attribute\n */\nshaka.hls.Tag.prototype.getAttribute = function(name) {\n var attributes = this.attributes.filter(function(attr) {\n return attr.name == name;\n });\n\n goog.asserts.assert(attributes.length < 2,\n 'A tag should not have multiple attributes ' +\n 'with the same name!');\n\n if (attributes.length)\n return attributes[0];\n else\n return null;\n};\n\n\n/**\n * Gets the value of the first attribute of the tag with a specified name.\n * If not found, returns an optional default value.\n *\n * @param {!string} name\n * @param {string=} opt_defaultValue\n * @return {?string}\n */\nshaka.hls.Tag.prototype.getAttributeValue = function(name, opt_defaultValue) {\n var defaultValue = opt_defaultValue || null;\n var attribute = this.getAttribute(name);\n return attribute ? attribute.value : defaultValue;\n};\n\n\n\n/**\n * Creates an HLS segment object.\n *\n * @param {!string} uri\n * @param {!Array.<shaka.hls.Tag>} tags\n *\n * @constructor\n * @struct\n */\nshaka.hls.Segment = function(uri, tags) {\n /** @const {!Array.<shaka.hls.Tag>} */\n this.tags = tags;\n\n /** @const {!string} */\n this.uri = uri;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/hls_classes.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.hls.Utils');\n\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n/**\n *\n * @param {!Array.<!shaka.hls.Tag>} tags\n * @param {!string} name\n * @return {!Array.<!shaka.hls.Tag>}\n */\nshaka.hls.Utils.filterTagsByName = function(tags, name) {\n return tags.filter(function(tag) {\n return tag.name == name;\n });\n};\n\n\n/**\n *\n * @param {!Array.<!shaka.hls.Tag>} tags\n * @param {!string} name\n * @return {?shaka.hls.Tag}\n */\nshaka.hls.Utils.getFirstTagWithName = function(tags, name) {\n var tagsWithName = shaka.hls.Utils.filterTagsByName(tags, name);\n if (!tagsWithName.length) return null;\n\n return tagsWithName[0];\n};\n\n\n/**\n * Expects an array of EXT-X-MEDIA tags. Returns the first tag that\n * has given media type and group id.\n *\n * @param {!Array.<!shaka.hls.Tag>} tags\n * @param {!string} type\n * @param {!string} groupId\n * @return {!Array<!shaka.hls.Tag>}\n */\nshaka.hls.Utils.findMediaTags = function(tags, type, groupId) {\n return tags.filter(function(tag) {\n var typeAttr = tag.getAttribute('TYPE');\n var groupIdAttr = tag.getAttribute('GROUP-ID');\n return typeAttr.value == type && groupIdAttr.value == groupId;\n });\n};\n\n\n/**\n * @param {!string} parentAbsoluteUri\n * @param {!string} uri\n * @return {!string}\n */\nshaka.hls.Utils.constructAbsoluteUri = function(parentAbsoluteUri, uri) {\n var uris = shaka.util.ManifestParserUtils.resolveUris(\n [parentAbsoluteUri], [uri]);\n\n return uris[0];\n};\n\n\n/**\n * Matches a string to an HLS comment format and returns the result.\n *\n * @param {!string} line\n * @return {boolean}\n */\nshaka.hls.Utils.isComment = function(line) {\n return /^#(?!EXT)/m.test(line);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/hls_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.TextParser');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Reads elements from strings.\n *\n * @param {string} data\n * @constructor\n * @struct\n */\nshaka.util.TextParser = function(data) {\n /**\n * @const\n * @private {string}\n */\n this.data_ = data;\n\n /** @private {number} */\n this.position_ = 0;\n};\n\n\n/** @return {boolean} Whether it is at the end of the string. */\nshaka.util.TextParser.prototype.atEnd = function() {\n return this.position_ == this.data_.length;\n};\n\n\n/**\n * Reads a line from the parser. This will read but not return the newline.\n * Returns null at the end.\n *\n * @return {?string}\n */\nshaka.util.TextParser.prototype.readLine = function() {\n return this.readRegexReturnCapture_(/(.*?)(\\n|$)/gm, 1);\n};\n\n\n/**\n * Reads a word from the parser. This will not read or return any whitespace\n * before or after the word (including newlines). Returns null at the end.\n *\n * @return {?string}\n */\nshaka.util.TextParser.prototype.readWord = function() {\n return this.readRegexReturnCapture_(/[^ \\t\\n]*/gm, 0);\n};\n\n\n/**\n * Skips any continuous whitespace from the parser. Returns null at the end.\n */\nshaka.util.TextParser.prototype.skipWhitespace = function() {\n this.readRegex(/[ \\t]+/gm);\n};\n\n\n/**\n * Reads the given regular expression from the parser. This requires the match\n * to be at the current position; there is no need to include a head anchor.\n * This requires that the regex have the global flag to be set so that it can\n * set lastIndex to start the search at the current position. Returns null at\n * the end or if the regex does not match the current position.\n *\n * @param {!RegExp} regex\n * @return {Array.<string>}\n */\nshaka.util.TextParser.prototype.readRegex = function(regex) {\n var index = this.indexOf_(regex);\n if (this.atEnd() || index == null || index.position != this.position_)\n return null;\n\n this.position_ += index.length;\n return index.results;\n};\n\n\n/**\n * Reads a regex from the parser and returns the given capture.\n *\n * @param {!RegExp} regex\n * @param {number} index\n * @return {?string}\n * @private\n */\nshaka.util.TextParser.prototype.readRegexReturnCapture_ =\n function(regex, index) {\n if (this.atEnd())\n return null;\n\n var ret = this.readRegex(regex);\n if (!ret)\n return null;\n else\n return ret[index];\n};\n\n\n/**\n * Returns the index info about a regular expression match.\n *\n * @param {!RegExp} regex\n * @return {?{position: number, length: number, results: !Array.<string>}}\n * @private\n */\nshaka.util.TextParser.prototype.indexOf_ = function(regex) {\n // The global flag is required to use lastIndex.\n goog.asserts.assert(regex.global, 'global flag should be set');\n\n regex.lastIndex = this.position_;\n var results = regex.exec(this.data_);\n if (results == null)\n return null;\n else\n return {\n position: results.index,\n length: results[0].length,\n results: results\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.hls.ManifestTextParser');\n\ngoog.require('shaka.hls.Attribute');\ngoog.require('shaka.hls.Playlist');\ngoog.require('shaka.hls.PlaylistType');\ngoog.require('shaka.hls.Segment');\ngoog.require('shaka.hls.Tag');\ngoog.require('shaka.hls.Utils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.TextParser');\n\n\n\n/**\n * Creates a new ManifestTextParser.\n *\n * @constructor\n * @struct\n */\nshaka.hls.ManifestTextParser = function() {\n /** @private {number} */\n this.globalId_ = 0;\n};\n\n\n/**\n * @param {!ArrayBuffer} data\n * @param {!string} uri\n * @return {!shaka.hls.Playlist}\n * @throws {shaka.util.Error}\n */\nshaka.hls.ManifestTextParser.prototype.parsePlaylist = function(data, uri) {\n // Get the input as a string. Normalize newlines to \\n.\n var str = shaka.util.StringUtils.fromUTF8(data);\n str = str.replace(/\\r\\n|\\r(?=[^\\n]|$)/gm, '\\n').trim();\n\n var lines = str.split(/\\n+/m);\n\n if (!/^#EXTM3U($|[ \\t\\n])/m.test(lines[0])) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_PLAYLIST_HEADER_MISSING);\n }\n\n /** shaka.hls.PlaylistType */\n var playlistType = shaka.hls.PlaylistType.MASTER;\n\n /** {Array.<shaka.hls.Tag>} */\n var tags = [];\n var i = 1;\n while (i < lines.length) {\n // Skip comments\n if (shaka.hls.Utils.isComment(lines[i])) {\n i += 1;\n continue;\n }\n\n var tag = this.parseTag_(lines[i]);\n\n if (shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS\n .indexOf(tag.name) >= 0) {\n playlistType = shaka.hls.PlaylistType.MEDIA;\n } else if (shaka.hls.ManifestTextParser.SEGMENT_TAGS\n .indexOf(tag.name) >= 0) {\n if (playlistType != shaka.hls.PlaylistType.MEDIA) {\n // Only media playlist should contain segment tags\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY);\n }\n\n var segmentsData = lines.splice(i, lines.length - i);\n var segments = this.parseSegments_(segmentsData);\n return new shaka.hls.Playlist(uri, playlistType, tags, segments);\n }\n\n tags.push(tag);\n i += 1;\n\n // EXT-X-STREAM-INF tag is followed by a uri of a media playlist.\n // Add uri to the tag object.\n if (tag.name == 'EXT-X-STREAM-INF') {\n var tagUri = new shaka.hls.Attribute('URI', lines[i]);\n tag.addAttribute(tagUri);\n i += 1;\n }\n }\n\n return new shaka.hls.Playlist(uri, playlistType, tags);\n};\n\n\n/**\n * Parses an array of strings into an HLS Segment objects.\n *\n * @param {!Array.<string>} lines\n * @return {!Array.<shaka.hls.Segment>}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.ManifestTextParser.prototype.parseSegments_ = function(lines) {\n var segments = [];\n var tags = [];\n lines.forEach(function(line) {\n if (/^(#EXT)/.test(line)) {\n var tag = this.parseTag_(line);\n tags.push(tag);\n } else if (shaka.hls.Utils.isComment(line)) {\n // Skip comments\n return;\n } else {\n var uri = line.trim();\n // Uri appears after all the tags describing the segment.\n var segment = new shaka.hls.Segment(uri, tags);\n segments.push(segment);\n tags = [];\n }\n }.bind(this));\n\n return segments;\n};\n\n\n/**\n * Parses a string into an HLS Tag object while tracking what id to use next.\n *\n * @param {!string} word\n * @return {!shaka.hls.Tag}\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.hls.ManifestTextParser.prototype.parseTag_ = function(word) {\n return shaka.hls.ManifestTextParser.parseTag(this.globalId_++, word);\n};\n\n\n/**\n * Parses a string into an HLS Tag object.\n *\n * @param {number} id\n * @param {!string} word\n * @return {!shaka.hls.Tag}\n * @throws {shaka.util.Error}\n */\nshaka.hls.ManifestTextParser.parseTag = function(id, word) {\n /* HLS tags start with '#EXT'. A tag can have a set of attributes\n (#EXT-<tagname>:<attribute list>) or a value (#EXT-<tagname>:<value>).\n Attributes' format is 'AttributeName=AttributeValue'.\n The parsing logic goes like this:\n 1) Everything before ':' is a name (we ignore '#').\n 2) Everything after should be parsed as attributes if it contains '='.\n 3) Otherwise, this is a value.\n 4) If there is no \":\", it's a simple tag with no attributes and no value */\n var blocks = word.match(/^#(EXT[^:]*)(?::(.*))?$/);\n if (!blocks) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.INVALID_HLS_TAG);\n }\n var name = blocks[1];\n var data = blocks[2];\n var attributes = [];\n\n if (data && data.indexOf('=') >= 0) {\n var parser = new shaka.util.TextParser(data);\n var blockAttrs;\n\n // Regex:\n // 1. Key name ([1])\n // 2. Equals sign\n // 3. Either:\n // a. A quoted string (everything up to the next quote, [2])\n // b. An unquoted string\n // (everything up to the next comma or end of line, [3])\n // 4. Either:\n // a. A comma\n // b. End of line\n var regex = /([^=]+)=(?:\"([^\"]*)\"|([^\",]*))(?:,|$)/g;\n while (blockAttrs = parser.readRegex(regex)) {\n var attrName = blockAttrs[1];\n var attrValue = blockAttrs[2] || blockAttrs[3];\n var attribute = new shaka.hls.Attribute(attrName, attrValue);\n attributes.push(attribute);\n }\n } else if (data) {\n return new shaka.hls.Tag(id, name, attributes, data);\n }\n\n return new shaka.hls.Tag(id, name, attributes);\n};\n\n\n/**\n * HLS tags that only appear on Media Playlists.\n * Used to determine a playlist type.\n *\n * @const {!Array<!string>}\n */\nshaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS = [\n 'EXT-X-TARGETDURATION',\n 'EXT-X-MEDIA-SEQUENCE',\n 'EXT-X-DISCONTINUITY-SEQUENCE',\n 'EXT-X-PLAYLIST-TYPE',\n 'EXT-X-MAP',\n 'EXT-X-I-FRAMES-ONLY'\n];\n\n\n/**\n * HLS tags that only appear on Segments in a Media Playlists.\n * Used to determine the start of the segments info.\n *\n * @const {!Array<!string>}\n */\nshaka.hls.ManifestTextParser.SEGMENT_TAGS = [\n 'EXTINF',\n 'EXT-X-BYTERANGE',\n 'EXT-X-DISCONTINUITY',\n 'EXT-X-PROGRAM-DATE-TIME',\n 'EXT-X-KEY',\n 'EXT-X-DATERANGE'\n];\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/manifest_text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.net.DataUriPlugin');\n\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * @namespace\n * @summary A networking plugin to handle data URIs.\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs\n * @param {string} uri\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.net.DataUriPlugin = function(uri, request) {\n return new Promise(function(resolve, reject) {\n var parsed = shaka.net.DataUriPlugin.parse(uri);\n\n /** @type {shakaExtern.Response} */\n var response = {\n uri: uri,\n data: parsed.data,\n headers: {\n 'content-type': parsed.contentType\n }\n };\n\n resolve(response);\n });\n};\n\n\n/**\n * @param {string} uri\n * @return {{data: ArrayBuffer, contentType: string}}\n */\nshaka.net.DataUriPlugin.parse = function(uri) {\n // Extract the scheme.\n var parts = uri.split(':');\n if (parts.length < 2 || parts[0] != 'data') {\n shaka.log.error('Bad data URI, failed to parse scheme');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_DATA_URI,\n uri);\n }\n var path = parts.slice(1).join(':');\n\n // Extract the encoding and MIME type (required but can be empty).\n var infoAndData = path.split(',');\n if (infoAndData.length < 2) {\n shaka.log.error('Bad data URI, failed to extract encoding and MIME type');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_DATA_URI,\n uri);\n }\n var info = infoAndData[0];\n var dataStr = window.decodeURIComponent(infoAndData.slice(1).join(','));\n\n // Extract the encoding (optional).\n var typeAndEncoding = info.split(';');\n var encoding = null;\n if (typeAndEncoding.length > 1)\n encoding = typeAndEncoding[1];\n\n // Convert the data.\n /** @type {ArrayBuffer} */\n var data;\n if (encoding == 'base64') {\n data = shaka.util.Uint8ArrayUtils.fromBase64(dataStr).buffer;\n } else if (encoding) {\n shaka.log.error('Bad data URI, unknown encoding');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.UNKNOWN_DATA_URI_ENCODING,\n uri);\n } else {\n data = shaka.util.StringUtils.toUTF8(dataStr);\n }\n\n return {data: data, contentType: typeAndEncoding[0]};\n};\n\n\nshaka.net.NetworkingEngine.registerScheme('data', shaka.net.DataUriPlugin);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/net/data_uri_plugin.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\ngoog.provide('shaka.hls.HlsParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.hls.ManifestTextParser');\ngoog.require('shaka.hls.Playlist');\ngoog.require('shaka.hls.PlaylistType');\ngoog.require('shaka.hls.Tag');\ngoog.require('shaka.hls.Utils');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.net.DataUriPlugin');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n\n/**\n * Creates a new HLS parser.\n *\n * @struct\n * @constructor\n * @implements {shakaExtern.ManifestParser}\n * @export\n */\nshaka.hls.HlsParser = function() {\n /** @private {?shakaExtern.ManifestParser.PlayerInterface} */\n this.playerInterface_ = null;\n\n /** @private {?shakaExtern.ManifestConfiguration} */\n this.config_ = null;\n\n /** @private {number} */\n this.globalId_ = 1;\n\n /** @private {!Object.<number, shaka.hls.HlsParser.StreamInfo>} */\n this.mediaTagsToStreamInfosMap_ = {};\n\n /** @private {!Object.<number, !shaka.media.SegmentIndex>} */\n this.streamsToIndexMap_ = {};\n\n /** @private {?shaka.media.PresentationTimeline} */\n this.presentationTimeline_ = null;\n\n /** @private {string} */\n this.manifestUri_ = '';\n\n /** @private {shaka.hls.ManifestTextParser} */\n this.manifestTextParser_ = new shaka.hls.ManifestTextParser();\n};\n\n\n/**\n * @typedef {{\n * stream: !shakaExtern.Stream,\n * segmentIndex: !shaka.media.SegmentIndex,\n * drmInfos: !Array.<shakaExtern.DrmInfo>\n * }}\n *\n * @description\n * Contains a stream and information about it.\n *\n * @property {!shakaExtern.Stream} stream\n * The Stream itself.\n * @property {!shaka.media.SegmentIndex} segmentIndex\n * SegmentIndex of the stream.\n * @property {!Array.<shakaExtern.DrmInfo>} drmInfos\n * DrmInfos of the stream. There may be multiple for multi-DRM content.\n */\nshaka.hls.HlsParser.StreamInfo;\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.configure = function(config) {\n this.config_ = config;\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.start = function(uri, playerInterface) {\n goog.asserts.assert(this.config_, 'Must call configure() before start()!');\n this.playerInterface_ = playerInterface;\n this.manifestUri_ = uri;\n return this.requestManifest_(uri).then(function(response) {\n return this.parseManifest_(response.data, uri);\n }.bind(this));\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.stop = function() {\n this.playerInterface_ = null;\n this.config_ = null;\n this.mediaTagsToStreamInfosMap_ = {};\n\n return Promise.resolve();\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.update = function() {\n // TODO: Implement support for live content.\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.onExpirationUpdated = function(\n sessionId, expiration) {\n // No-op\n};\n\n\n/**\n * Parses the manifest.\n *\n * @param {!ArrayBuffer} data\n * @param {string} uri\n * @return {!Promise.<!shakaExtern.Manifest>}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.hls.HlsParser.prototype.parseManifest_ = function(data, uri) {\n var playlist = this.manifestTextParser_.parsePlaylist(data, uri);\n\n // We don't support directly providing a Media Playlist.\n // See error code for details.\n if (playlist.type != shaka.hls.PlaylistType.MASTER) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_MASTER_PLAYLIST_NOT_PROVIDED);\n }\n\n // TODO: Implement support for live content.\n this.presentationTimeline_ = new shaka.media.PresentationTimeline(null, 0);\n return this.createPeriod_(playlist).then(function(period) {\n // HLS has no notion of periods. We're treating the whole presentation as\n // one period.\n this.playerInterface_.filterPeriod(period);\n return {\n presentationTimeline: this.presentationTimeline_,\n periods: [period],\n offlineSessionIds: [],\n minBufferTime: 0\n };\n }.bind(this));\n};\n\n\n/**\n * Parses a playlist into a Period object.\n *\n * @param {!shaka.hls.Playlist} playlist\n * @return {!Promise.<!shakaExtern.Period>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createPeriod_ = function(playlist) {\n var Utils = shaka.hls.Utils;\n var Functional = shaka.util.Functional;\n var tags = playlist.tags;\n\n // Create Variants for every 'EXT-X-STREAM-INF' tag.\n var variantTags = Utils.filterTagsByName(tags, 'EXT-X-STREAM-INF');\n var variantsPromises = variantTags.map(function(tag) {\n return this.createVariantsForTag_(tag, playlist);\n }.bind(this));\n\n var mediaTags = Utils.filterTagsByName(playlist.tags, 'EXT-X-MEDIA');\n var textStreamTags = mediaTags.filter(function(tag) {\n var type = shaka.hls.HlsParser.getRequiredAttributeValue_(tag, 'TYPE');\n return type == 'SUBTITLES';\n }.bind(this));\n\n // TODO: CLOSED-CAPTIONS requires the parsing of CEA-608 from the video.\n var textStreamPromises = textStreamTags.map(function(tag) {\n return this.createTextStream_(tag, playlist);\n }.bind(this));\n\n return Promise.all(variantsPromises).then(function(allVariants) {\n return Promise.all(textStreamPromises).then(function(textStreams) {\n var variants = allVariants.reduce(Functional.collapseArrays, []);\n this.fitSegments_(variants);\n return {\n startTime: 0,\n variants: variants,\n textStreams: textStreams\n };\n }.bind(this));\n }.bind(this));\n};\n\n\n/**\n * @param {!shaka.hls.Tag} tag\n * @param {!shaka.hls.Playlist} playlist\n * @return {!Promise.<!Array.<!shakaExtern.Variant>>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createVariantsForTag_ = function(tag, playlist) {\n goog.asserts.assert(tag.name == 'EXT-X-STREAM-INF',\n 'Should only be called on variant tags!');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var HlsParser = shaka.hls.HlsParser;\n var Utils = shaka.hls.Utils;\n var bandwidth =\n Number(HlsParser.getRequiredAttributeValue_(tag, 'BANDWIDTH'));\n\n // These are the default codecs to assume if none are specified.\n //\n // The video codec is H.264, with baseline profile and level 3.0.\n // http://blog.pearce.org.nz/2013/11/what-does-h264avc1-codecs-parameters.html\n //\n // The audio codec is \"low-complexity\" AAC.\n var defaultCodecs = 'avc1.42E01E,mp4a.40.2';\n\n var codecs = tag.getAttributeValue('CODECS', defaultCodecs).split(',');\n var resolutionAttr = tag.getAttribute('RESOLUTION');\n var width = null;\n var height = null;\n var frameRate = tag.getAttributeValue('FRAME-RATE');\n\n if (resolutionAttr) {\n var resBlocks = resolutionAttr.value.split('x');\n width = resBlocks[0];\n height = resBlocks[1];\n }\n\n var timeOffset = this.getTimeOffset_(playlist);\n\n var mediaTags = Utils.filterTagsByName(playlist.tags, 'EXT-X-MEDIA');\n\n var audioGroupId = tag.getAttributeValue('AUDIO');\n var videoGroupId = tag.getAttributeValue('VIDEO');\n goog.asserts.assert(audioGroupId == null || videoGroupId == null,\n 'Unexpected: both video and audio described by media tags!');\n\n // Find any associated audio or video groups and create streams for them.\n if (audioGroupId) {\n mediaTags = Utils.findMediaTags(mediaTags, 'AUDIO', audioGroupId);\n } else if (videoGroupId) {\n mediaTags = Utils.findMediaTags(mediaTags, 'VIDEO', videoGroupId);\n }\n var promises = mediaTags.map(function(tag) {\n return this.createStreamInfoFromMediaTag_(tag, codecs, timeOffset);\n }.bind(this));\n\n var audioStreamInfos = [];\n var videoStreamInfos = [];\n\n return Promise.all(promises).then(function(data) {\n if (audioGroupId) {\n audioStreamInfos = data;\n } else if (videoGroupId) {\n videoStreamInfos = data;\n }\n\n // Make an educated guess about the stream type.\n shaka.log.debug('Guessing stream type for', tag.toString());\n var type;\n if (!audioStreamInfos.length && !videoStreamInfos.length) {\n // There are no associated streams. This is either an audio-only stream,\n // a video-only stream, or a multiplexed stream.\n\n if (codecs.length == 1) {\n // There is only one codec, so it shouldn't be multiplexed.\n if (resolutionAttr || frameRate) {\n // Assume video-only.\n shaka.log.debug('Guessing video-only.');\n type = ContentType.VIDEO;\n } else {\n // Assume audio-only.\n shaka.log.debug('Guessing audio-only.');\n type = ContentType.AUDIO;\n }\n } else {\n // There are multiple codecs, so assume multiplexed content.\n // Note that the default used when CODECS is missing assumes multiple\n // (and therefore multiplexed).\n // Recombine the codec strings into one so that MediaSource isn't\n // lied to later. (That would trigger an error in Chrome.)\n shaka.log.debug('Guessing multiplexed audio+video.');\n type = ContentType.VIDEO;\n codecs = [codecs.join(',')];\n }\n } else if (audioStreamInfos.length) {\n // There are associated audio streams. Assume this is video.\n shaka.log.debug('Guessing video.');\n type = ContentType.VIDEO;\n } else {\n // There are associated video streams. Assume this is audio.\n goog.asserts.assert(videoStreamInfos.length,\n 'No video streams! This should have been handled already!');\n shaka.log.debug('Guessing audio.');\n type = ContentType.AUDIO;\n }\n\n goog.asserts.assert(type, 'Type should have been set by now!');\n return this.createStreamInfoFromVariantTag_(tag, codecs, type, timeOffset);\n }.bind(this)).then(function(streamInfo) {\n goog.asserts.assert(streamInfo, 'We should have created a stream!');\n if (streamInfo.stream.type == ContentType.AUDIO) {\n audioStreamInfos = [streamInfo];\n } else {\n videoStreamInfos = [streamInfo];\n }\n\n return this.createVariants_(\n audioStreamInfos,\n videoStreamInfos,\n bandwidth,\n width,\n height,\n frameRate);\n }.bind(this));\n};\n\n\n/**\n * @param {!Array.<!shaka.hls.HlsParser.StreamInfo>} audioInfos\n * @param {!Array.<!shaka.hls.HlsParser.StreamInfo>} videoInfos\n * @param {number} bandwidth\n * @param {?string} width\n * @param {?string} height\n * @param {?string} frameRate\n * @return {!Array.<!shakaExtern.Variant>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createVariants_ =\n function(audioInfos, videoInfos, bandwidth, width, height, frameRate) {\n var DrmEngine = shaka.media.DrmEngine;\n\n videoInfos.forEach(function(info) {\n this.addVideoAttributes_(info.stream, width, height, frameRate);\n }.bind(this));\n\n // In case of audio-only or video-only content, we create an array of\n // one item containing a null. This way, the double-loop works for all\n // kinds of content.\n // NOTE: we currently don't have support for audio-only content.\n if (!audioInfos.length)\n audioInfos = [null];\n if (!videoInfos.length)\n videoInfos = [null];\n\n var variants = [];\n for (var i = 0; i < audioInfos.length; i++) {\n for (var j = 0; j < videoInfos.length; j++) {\n var audioStream = audioInfos[i] ? audioInfos[i].stream : null;\n var videoStream = videoInfos[j] ? videoInfos[j].stream : null;\n var audioDrmInfos = audioInfos[i] ? audioInfos[i].drmInfos : null;\n var videoDrmInfos = videoInfos[j] ? videoInfos[j].drmInfos : null;\n\n var drmInfos;\n if (audioStream && videoStream) {\n if (DrmEngine.areDrmCompatible(audioDrmInfos, videoDrmInfos)) {\n drmInfos = DrmEngine.getCommonDrmInfos(audioDrmInfos, videoDrmInfos);\n } else {\n shaka.log.warning('Incompatible DRM info in HLS variant. Skipping.');\n continue;\n }\n } else if (audioStream) {\n drmInfos = audioDrmInfos;\n } else if (videoStream) {\n drmInfos = videoDrmInfos;\n }\n\n variants.push(this.createVariant_(\n audioStream, videoStream, bandwidth, drmInfos));\n }\n }\n return variants;\n};\n\n\n/**\n * @param {shakaExtern.Stream} audio\n * @param {shakaExtern.Stream} video\n * @param {number} bandwidth\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @return {!shakaExtern.Variant}\n * @private\n */\nshaka.hls.HlsParser.prototype.createVariant_ =\n function(audio, video, bandwidth, drmInfos) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Since both audio and video are of the same type, this assertion will catch\n // certain mistakes at runtime that the compiler would miss.\n goog.asserts.assert(!audio || audio.type == ContentType.AUDIO,\n 'Audio parameter mismatch!');\n goog.asserts.assert(!video || video.type == ContentType.VIDEO,\n 'Video parameter mismatch!');\n\n return {\n id: this.globalId_++,\n language: audio ? audio.language : 'und',\n primary: (!!audio && audio.primary) || (!!video && video.primary),\n audio: audio,\n video: video,\n bandwidth: bandwidth,\n drmInfos: drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n};\n\n\n/**\n * Parses an EXT-X-MEDIA tag with TYPE=\"SUBTITLES\" into a text stream.\n *\n * @param {!shaka.hls.Tag} tag\n * @param {!shaka.hls.Playlist} playlist\n * @return {!Promise.<?shakaExtern.Stream>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createTextStream_ = function(tag, playlist) {\n goog.asserts.assert(tag.name == 'EXT-X-MEDIA',\n 'Should only be called on media tags!');\n\n var type = shaka.hls.HlsParser.getRequiredAttributeValue_(tag, 'TYPE');\n goog.asserts.assert(type == 'SUBTITLES',\n 'Should only be called on tags with TYPE=\"SUBTITLES\"!');\n\n var timeOffset = this.getTimeOffset_(playlist);\n return this.createStreamInfoFromMediaTag_(tag, [], timeOffset)\n .then(function(streamInfo) {\n return streamInfo.stream;\n });\n};\n\n\n/**\n * Parse EXT-X-MEDIA media tag into a Stream object.\n *\n * @param {shaka.hls.Tag} tag\n * @param {!Array.<!string>} allCodecs\n * @param {?number} timeOffset\n * @return {!Promise.<shaka.hls.HlsParser.StreamInfo>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createStreamInfoFromMediaTag_ =\n function(tag, allCodecs, timeOffset) {\n goog.asserts.assert(tag.name == 'EXT-X-MEDIA',\n 'Should only be called on media tags!');\n\n // Check if the stream has already been created as part of another Variant\n // and return it if it has.\n if (this.mediaTagsToStreamInfosMap_[tag.id]) {\n return Promise.resolve().then(function() {\n return this.mediaTagsToStreamInfosMap_[tag.id];\n }.bind(this));\n }\n\n var HlsParser = shaka.hls.HlsParser;\n var type = HlsParser.getRequiredAttributeValue_(tag, 'TYPE').toLowerCase();\n // Shaka recognizes content types 'audio', 'video' and 'text'.\n // HLS 'subtitles' type needs to be mapped to 'text'.\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (type == 'subtitles') type = ContentType.TEXT;\n\n var LanguageUtils = shaka.util.LanguageUtils;\n var language = LanguageUtils.normalize(/** @type {string} */(\n tag.getAttributeValue('LANGUAGE', 'und')));\n var label = tag.getAttributeValue('NAME');\n\n var defaultAttr = tag.getAttribute('DEFAULT');\n var autoselectAttr = tag.getAttribute('AUTOSELECT');\n // TODO: Should we take into account some of the currently ignored attributes:\n // FORCED, INSTREAM-ID, CHARACTERISTICS, CHANNELS?\n // Attribute descriptions:\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-4.3.4.1\n\n var uri = HlsParser.getRequiredAttributeValue_(tag, 'URI');\n var primary = !!defaultAttr || !!autoselectAttr;\n return this.createStreamInfo_(uri, allCodecs, type, timeOffset, language,\n primary, label).then(function(streamInfo) {\n this.mediaTagsToStreamInfosMap_[tag.id] = streamInfo;\n return streamInfo;\n }.bind(this));\n};\n\n\n/**\n * Parse EXT-X-STREAM-INF media tag into a Stream object.\n *\n * @param {!shaka.hls.Tag} tag\n * @param {!Array.<!string>} allCodecs\n * @param {!string} type\n * @param {?number} timeOffset\n * @return {!Promise.<shaka.hls.HlsParser.StreamInfo>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createStreamInfoFromVariantTag_ =\n function(tag, allCodecs, type, timeOffset) {\n goog.asserts.assert(tag.name == 'EXT-X-STREAM-INF',\n 'Should only be called on media tags!');\n\n var uri = shaka.hls.HlsParser.getRequiredAttributeValue_(tag, 'URI');\n return this.createStreamInfo_(uri, allCodecs, type, timeOffset,\n /* language */ 'und', /* primary */ false,\n /* label */ null);\n};\n\n\n/**\n * @param {!string} uri\n * @param {!Array.<!string>} allCodecs\n * @param {!string} type\n * @param {?number} timeOffset\n * @param {!string} language\n * @param {boolean} primary\n * @param {?string} label\n * @return {!Promise.<shaka.hls.HlsParser.StreamInfo>}\n * @throws shaka.util.Error\n * @private\n */\nshaka.hls.HlsParser.prototype.createStreamInfo_ =\n function(uri, allCodecs, type, timeOffset, language, primary, label) {\n var Utils = shaka.hls.Utils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var HlsParser = shaka.hls.HlsParser;\n uri = Utils.constructAbsoluteUri(this.manifestUri_, uri);\n\n return this.requestManifest_(uri).then(function(response) {\n var playlistData = response.data;\n var playlist = this.manifestTextParser_.parsePlaylist(playlistData,\n response.uri);\n if (playlist.type != shaka.hls.PlaylistType.MEDIA) {\n // EXT-X-MEDIA tags should point to media playlists.\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY);\n }\n\n goog.asserts.assert(playlist.segments != null,\n 'Media playlist should have segments!');\n\n // Time offset can be specified on either Master or Media Playlist.\n // If Media Playlist provides it's own value, use that.\n // Otherwise, use value from the Master Playlist. If no offset\n // has been provided it will default to\n // this.config_.hls.defaultTimeOffset.\n var mediaPlaylistTimeOffset = this.getTimeOffset_(playlist);\n timeOffset = mediaPlaylistTimeOffset || timeOffset;\n\n var initSegmentReference = null;\n if (type != ContentType.TEXT) {\n initSegmentReference = this.createInitSegmentReference_(playlist);\n }\n var mediaSequenceTag = Utils.getFirstTagWithName(playlist.tags,\n 'EXT-X-MEDIA-SEQUENCE');\n\n var startPosition = mediaSequenceTag ? Number(mediaSequenceTag.value) : 0;\n var segments = this.createSegments_(playlist, startPosition);\n\n this.presentationTimeline_.notifySegments(0, segments);\n var duration =\n segments[segments.length - 1].endTime - segments[0].startTime;\n var presentationDuration = this.presentationTimeline_.getDuration();\n if (presentationDuration == Infinity || presentationDuration < duration) {\n this.presentationTimeline_.setDuration(duration);\n }\n var codecs = this.guessCodecs_(type, allCodecs);\n\n var kind = undefined;\n\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n if (type == ManifestParserUtils.ContentType.TEXT)\n kind = ManifestParserUtils.TextStreamKind.SUBTITLE;\n // TODO: CLOSED-CAPTIONS requires the parsing of CEA-608 from the video.\n\n var segmentIndex = new shaka.media.SegmentIndex(segments);\n\n var drmTags = [];\n playlist.segments.forEach(function(segment) {\n var segmentKeyTags = Utils.filterTagsByName(segment.tags, 'EXT-X-KEY');\n drmTags.push.apply(drmTags, segmentKeyTags);\n });\n\n var encrypted = false;\n var drmInfos = [];\n var keyId = null;\n\n // TODO: may still need changes to support key rotation\n drmTags.forEach(function(drmTag) {\n var method = HlsParser.getRequiredAttributeValue_(drmTag, 'METHOD');\n if (method != 'NONE') {\n encrypted = true;\n\n var keyFormat =\n HlsParser.getRequiredAttributeValue_(drmTag, 'KEYFORMAT');\n var drmParser =\n shaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_[keyFormat];\n\n var drmInfo = drmParser ? drmParser(drmTag) : null;\n if (drmInfo) {\n if (drmInfo.keyIds.length) {\n keyId = drmInfo.keyIds[0];\n }\n drmInfos.push(drmInfo);\n } else {\n shaka.log.warning('Unsupported HLS KEYFORMAT', keyFormat);\n }\n }\n });\n\n if (encrypted && !drmInfos.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_KEYFORMATS_NOT_SUPPORTED);\n }\n\n return this.guessMimeType_(type, segments[0].getUris()[0])\n .then(function(mimeType) {\n var stream = {\n id: this.globalId_++,\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex),\n initSegmentReference: initSegmentReference,\n presentationTimeOffset: timeOffset || 0,\n mimeType: mimeType,\n codecs: codecs,\n kind: kind,\n encrypted: encrypted,\n keyId: keyId,\n language: language,\n label: label || null,\n type: type,\n primary: primary,\n // TODO: trick mode\n trickModeVideo: null,\n containsEmsgBoxes: false,\n frameRate: undefined,\n width: undefined,\n height: undefined,\n bandwidth: undefined,\n roles: []\n };\n\n this.streamsToIndexMap_[stream.id] = segmentIndex;\n\n return {\n stream: stream,\n segmentIndex: segmentIndex,\n drmInfos: drmInfos\n };\n }.bind(this));\n }.bind(this));\n\n};\n\n\n/**\n * @param {!shaka.hls.Playlist} playlist\n * @return {shaka.media.InitSegmentReference}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.createInitSegmentReference_ = function(playlist) {\n var Utils = shaka.hls.Utils;\n var mapTags = Utils.filterTagsByName(playlist.tags, 'EXT-X-MAP');\n // TODO: Support multiple map tags?\n // For now, we don't support multiple map tags and will throw an error.\n if (!mapTags.length) {\n return null;\n } else if (mapTags.length > 1) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND);\n }\n\n // Map tag example: #EXT-X-MAP:URI=\"main.mp4\",BYTERANGE=\"720@0\"\n var mapTag = mapTags[0];\n var initUri = shaka.hls.HlsParser.getRequiredAttributeValue_(mapTag, 'URI');\n var uri = Utils.constructAbsoluteUri(playlist.uri, initUri);\n var startByte = 0;\n var endByte = null;\n var byterange = mapTag.getAttributeValue('BYTERANGE');\n // If BYTERANGE attribute is not specified, the segment consists\n // of the entire resourse.\n if (byterange) {\n var blocks = byterange.split('@');\n var byteLength = Number(blocks[0]);\n startByte = Number(blocks[1]);\n endByte = startByte + byteLength - 1;\n }\n\n return new shaka.media.InitSegmentReference(function() { return [uri]; },\n startByte,\n endByte);\n};\n\n\n/**\n * Parses shaka.hls.Segment objects into shaka.media.SegmentReferences.\n *\n * @param {!shaka.hls.Playlist} playlist\n * @param {number} startPosition\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createSegments_ =\n function(playlist, startPosition) {\n var hlsSegments = playlist.segments;\n var segments = [];\n\n hlsSegments.forEach(function(segment) {\n var Utils = shaka.hls.Utils;\n var tags = segment.tags;\n var uri = Utils.constructAbsoluteUri(playlist.uri, segment.uri);\n\n // Start and end times\n var extinfTag = this.getRequiredTag_(tags, 'EXTINF');\n // EXTINF tag format is '#EXTINF:<duration>,[<title>]'.\n // We're interested in the duration part.\n var extinfValues = extinfTag.value.split(',');\n var duration = Number(extinfValues[0]);\n var startTime;\n var index = hlsSegments.indexOf(segment);\n if (index == 0) {\n startTime = 0;\n } else {\n startTime = segments[index - 1].endTime;\n }\n var endTime = startTime + duration;\n\n // StartByte and EndByte\n var startByte = 0;\n var endByte = null;\n var byterange = Utils.getFirstTagWithName(tags, 'EXT-X-BYTERANGE');\n // If BYTERANGE is not specified, the segment consists of the\n // entire resourse.\n if (byterange) {\n var blocks = byterange.value.split('@');\n var byteLength = Number(blocks[0]);\n if (blocks[1]) {\n startByte = Number(blocks[1]);\n } else {\n startByte = segments[index - 1].endByte;\n }\n endByte = startByte + byteLength - 1;\n\n // Last segment has endByte of null to indicate that it extends\n // to the end of the resource.\n if (index == hlsSegments.length - 1)\n endByte = null;\n }\n segments.push(new shaka.media.SegmentReference(startPosition + index,\n startTime,\n endTime,\n function() { return [uri]; },\n startByte,\n endByte));\n }.bind(this));\n\n return segments;\n};\n\n\n/**\n * Adjusts segment references of every stream of every variant to the\n * timeline of the presentation.\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @private\n */\nshaka.hls.HlsParser.prototype.fitSegments_ = function(variants) {\n variants.forEach(function(variant) {\n var duration = this.presentationTimeline_.getDuration();\n var video = variant.video;\n var audio = variant.audio;\n if (video && this.streamsToIndexMap_[video.id]) {\n this.streamsToIndexMap_[video.id].fit(duration);\n }\n if (audio && this.streamsToIndexMap_[audio.id]) {\n this.streamsToIndexMap_[audio.id].fit(duration);\n }\n }.bind(this));\n};\n\n\n/**\n * Attempts to guess which codecs from the codecs list belong\n * to a given content type.\n *\n * @param {!string} contentType\n * @param {!Array.<!string>} codecs\n * @return {string}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.guessCodecs_ = function(contentType, codecs) {\n if (codecs.length == 1) {\n return codecs[0];\n }\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return '';\n }\n\n var HlsParser = shaka.hls.HlsParser;\n var formats = HlsParser.VIDEO_CODEC_FORMATS_;\n if (contentType == ContentType.AUDIO)\n formats = HlsParser.AUDIO_CODEC_FORMATS_;\n\n for (var i = 0; i < formats.length; i++) {\n for (var j = 0; j < codecs.length; j++) {\n if (formats[i].test(codecs[j].trim())) {\n return codecs[j].trim();\n }\n }\n }\n\n // Unable to guess codecs.\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_COULD_NOT_GUESS_CODECS,\n codecs);\n};\n\n\n/**\n * Attempts to guess stream's mime type based on content type and uri.\n *\n * @param {!string} contentType\n * @param {!string} uri\n * @return {!Promise.<!string>}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.guessMimeType_ = function(contentType, uri) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var blocks = uri.split('.');\n var extension = blocks[blocks.length - 1];\n\n if (contentType == ContentType.TEXT) {\n // HLS only supports vtt at the moment.\n return Promise.resolve('text/vtt');\n }\n\n var HlsParser = shaka.hls.HlsParser;\n var map = HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_;\n if (contentType == ContentType.VIDEO)\n map = HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_;\n\n var mimeType = map[extension];\n if (mimeType)\n return Promise.resolve(mimeType);\n\n // If unable to guess mime type, request a segment and try getting it\n // from the response.\n var headRequest = shaka.net.NetworkingEngine.makeRequest(\n [uri], this.config_.retryParameters);\n headRequest.method = 'HEAD';\n var requestType = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n return this.playerInterface_.networkingEngine.request(\n requestType, headRequest)\n .then(function(response) {\n var mimeType = response.headers['content-type'];\n if (!mimeType) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_COULD_NOT_GUESS_MIME_TYPE,\n extension);\n }\n\n return mimeType;\n });\n};\n\n\n/**\n * Get presentation time offset of the playlist if it has been specified.\n * Return null otherwise.\n *\n * @param {!shaka.hls.Playlist} playlist\n * @return {?number}\n * @private\n */\nshaka.hls.HlsParser.prototype.getTimeOffset_ = function(playlist) {\n var Utils = shaka.hls.Utils;\n var startTag = Utils.getFirstTagWithName(playlist.tags, 'EXT-X-START');\n // TODO: Should we respect the PRECISE flag?\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-4.3.5.2\n if (startTag)\n return Number(shaka.hls.HlsParser.getRequiredAttributeValue_(\n startTag, 'TIME-OFFSET'));\n\n return this.config_.hls.defaultTimeOffset;\n};\n\n\n/**\n * Find the attribute and returns its value.\n * Throws an error if attribute was not found.\n *\n * @param {shaka.hls.Tag} tag\n * @param {!string} attributeName\n * @return {!string}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.getRequiredAttributeValue_ =\n function(tag, attributeName) {\n var attribute = tag.getAttribute(attributeName);\n if (!attribute) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_REQUIRED_ATTRIBUTE_MISSING,\n attributeName);\n }\n\n return attribute.value;\n};\n\n\n/**\n * Returns a tag with a given name.\n * Throws an error if tag was not found.\n *\n * @param {!Array.<shaka.hls.Tag>} tags\n * @param {!string} tagName\n * @return {!shaka.hls.Tag}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.getRequiredTag_ = function(tags, tagName) {\n var Utils = shaka.hls.Utils;\n var tag = Utils.getFirstTagWithName(tags, tagName);\n if (!tag) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_REQUIRED_TAG_MISSING, tagName);\n }\n\n return tag;\n};\n\n\n/**\n * @param {shakaExtern.Stream} stream\n * @param {?string} width\n * @param {?string} height\n * @param {?string} frameRate\n * @private\n */\nshaka.hls.HlsParser.prototype.addVideoAttributes_ =\n function(stream, width, height, frameRate) {\n if (stream) {\n stream.width = Number(width) || undefined;\n stream.height = Number(height) || undefined;\n stream.frameRate = Number(frameRate) || undefined;\n }\n};\n\n\n/**\n * Makes a network request for the manifest and returns a Promise\n * with the resulting data.\n *\n * @param {!string} uri\n * @return {!Promise.<!shakaExtern.Response>}\n * @private\n */\nshaka.hls.HlsParser.prototype.requestManifest_ = function(uri) {\n var requestType = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n var request = shaka.net.NetworkingEngine.makeRequest(\n [uri], this.config_.retryParameters);\n return this.playerInterface_.networkingEngine.request(requestType, request);\n};\n\n\n/**\n * A list of well-known video codecs formats.\n *\n * @const {!Array<!RegExp>}\n * @private\n */\nshaka.hls.HlsParser.VIDEO_CODEC_FORMATS_ = [\n /^(avc)/,\n /^(hvc)/,\n /^(vp[8-9])$/,\n /^(av1)$/,\n /^(mp4v)/\n];\n\n\n/**\n * A list of well-known audio codecs formats.\n *\n * @const {!Array<!RegExp>}\n * @private\n */\nshaka.hls.HlsParser.AUDIO_CODEC_FORMATS_ = [\n /^(vorbis)/,\n /^(opus)/,\n /^(mp4a)/,\n /^(ac-3)$/,\n /^(ec-3)$/\n];\n\n\n/**\n * @const {!Object<string, string>}\n * @private\n */\nshaka.hls.HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_ = {\n 'mp4': 'audio/mp4',\n 'm4s': 'audio/mp4',\n 'm4i': 'audio/mp4',\n 'm4a': 'audio/mp4',\n // mpeg2 ts aslo uses video/ for audio: http://goo.gl/tYHXiS\n 'ts': 'video/mp2t'\n};\n\n\n/**\n * @const {!Object<string, string>}\n * @private\n */\nshaka.hls.HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_ = {\n 'mp4': 'video/mp4',\n 'm4s': 'video/mp4',\n 'm4i': 'video/mp4',\n 'm4v': 'video/mp4',\n 'ts': 'video/mp2t'\n};\n\n\n/**\n * @typedef {function(!shaka.hls.Tag):?shakaExtern.DrmInfo}\n * @private\n */\nshaka.hls.HlsParser.DrmParser_;\n\n\n/**\n * @param {!shaka.hls.Tag} drmTag\n * @return {?shakaExtern.DrmInfo}\n * @private\n */\nshaka.hls.HlsParser.widevineDrmParser_ = function(drmTag) {\n var HlsParser = shaka.hls.HlsParser;\n var method = HlsParser.getRequiredAttributeValue_(drmTag, 'METHOD');\n if (method != 'SAMPLE-AES-CENC') {\n shaka.log.error(\n 'Widevine in HLS is only supported with SAMPLE-AES-CENC, not', method);\n return null;\n }\n\n var uri = HlsParser.getRequiredAttributeValue_(drmTag, 'URI');\n var parsedData = shaka.net.DataUriPlugin.parse(uri);\n\n // The data encoded in the URI is a PSSH box to be used as init data.\n var pssh = new Uint8Array(parsedData.data);\n var drmInfo = shaka.util.ManifestParserUtils.createDrmInfo(\n 'com.widevine.alpha', [\n {initDataType: 'cenc', initData: pssh}\n ]);\n\n var keyId = drmTag.getAttributeValue('KEYID');\n if (keyId) {\n // This value begins with '0x':\n goog.asserts.assert(keyId.substr(0, 2) == '0x',\n 'Incorrect KEYID format!');\n // But the output does not contain the '0x':\n drmInfo.keyIds = [keyId.substr(2).toLowerCase()];\n }\n return drmInfo;\n};\n\n\n/**\n * @const {!Object.<string, shaka.hls.HlsParser.DrmParser_>}\n * @private\n */\nshaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_ = {\n /* TODO: https://github.com/google/shaka-player/issues/382\n 'com.apple.streamingkeydelivery':\n shaka.hls.HlsParser.fairplayDrmParser_,\n */\n 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed':\n shaka.hls.HlsParser.widevineDrmParser_\n};\n\n\nshaka.media.ManifestParser.registerParserByExtension(\n 'm3u8', shaka.hls.HlsParser);\nshaka.media.ManifestParser.registerParserByMime(\n 'application/x-mpegurl', shaka.hls.HlsParser);\nshaka.media.ManifestParser.registerParserByMime(\n 'application/vnd.apple.mpegurl', shaka.hls.HlsParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/hls_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.TtmlTextParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\n\n\n\n/**\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.TtmlTextParser = function() {};\n\n\n/** @override */\nshaka.media.TtmlTextParser.prototype.parseInit = function(data) {\n goog.asserts.assert(false, 'TTML does not have init segments');\n};\n\n\n/** @override */\nshaka.media.TtmlTextParser.prototype.parseMedia = function(data, time) {\n var str = shaka.util.StringUtils.fromUTF8(data);\n var ret = [];\n var parser = new DOMParser();\n var xml = null;\n\n try {\n xml = parser.parseFromString(str, 'text/xml');\n } catch (exception) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_XML);\n }\n\n if (xml) {\n // Try to get the framerate, subFrameRate and frameRateMultiplier\n // if applicable\n var frameRate = null;\n var subFrameRate = null;\n var frameRateMultiplier = null;\n var tickRate = null;\n var spaceStyle = null;\n var tts = xml.getElementsByTagName('tt');\n var tt = tts[0];\n // TTML should always have tt element\n if (!tt) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_XML);\n } else {\n frameRate = tt.getAttribute('ttp:frameRate');\n subFrameRate = tt.getAttribute('ttp:subFrameRate');\n frameRateMultiplier = tt.getAttribute('ttp:frameRateMultiplier');\n tickRate = tt.getAttribute('ttp:tickRate');\n spaceStyle = tt.getAttribute('xml:space') || 'default';\n }\n\n if (spaceStyle != 'default' && spaceStyle != 'preserve') {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_XML);\n }\n var whitespaceTrim = spaceStyle == 'default';\n\n var rateInfo = new shaka.media.TtmlTextParser.RateInfo_(\n frameRate, subFrameRate, frameRateMultiplier, tickRate);\n\n var styles = shaka.media.TtmlTextParser.getLeafNodes_(\n tt.getElementsByTagName('styling')[0]);\n var regions = shaka.media.TtmlTextParser.getLeafNodes_(\n tt.getElementsByTagName('layout')[0]);\n var textNodes = shaka.media.TtmlTextParser.getLeafNodes_(\n tt.getElementsByTagName('body')[0]);\n\n for (var i = 0; i < textNodes.length; i++) {\n var cue = shaka.media.TtmlTextParser.parseCue_(textNodes[i],\n time.periodStart,\n rateInfo,\n styles,\n regions,\n whitespaceTrim);\n if (cue)\n ret.push(cue);\n }\n }\n\n return ret;\n};\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 00:00:40:07 (7 frames) or 00:00:40:07.1 (7 frames, 1 subframe)\n */\nshaka.media.TtmlTextParser.timeColonFormatFrames_ =\n /^(\\d{2,}):(\\d{2}):(\\d{2}):(\\d{2})\\.?(\\d+)?$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 00:00:40 or 00:40\n */\nshaka.media.TtmlTextParser.timeColonFormat_ =\n /^(?:(\\d{2,}):)?(\\d{2}):(\\d{2})$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * example 01:02:43.0345555 or 02:43.03\n */\nshaka.media.TtmlTextParser.timeColonFormatMilliseconds_ =\n /^(?:(\\d{2,}):)?(\\d{2}):(\\d{2}\\.\\d{2,})$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 75f or 75.5f\n */\nshaka.media.TtmlTextParser.timeFramesFormat_ = /^(\\d*\\.?\\d*)f$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 50t or 50.5t\n */\nshaka.media.TtmlTextParser.timeTickFormat_ = /^(\\d*\\.?\\d*)t$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 3.45h, 3m or 4.20s\n */\nshaka.media.TtmlTextParser.timeHMSFormat_ =\n /^(?:(\\d*\\.?\\d*)h)?(?:(\\d*\\.?\\d*)m)?(?:(\\d*\\.?\\d*)s)?(?:(\\d*\\.?\\d*)ms)?$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 50% 10%\n */\nshaka.media.TtmlTextParser.percentValues_ = /^(\\d{1,2}|100)% (\\d{1,2}|100)%$/;\n\n\n/**\n * @const\n * @private {!Object}\n */\nshaka.media.TtmlTextParser.textAlignToLineAlign_ = {\n 'left': 'start',\n 'center': 'center',\n 'right': 'end',\n 'start': 'start',\n 'end': 'end'\n};\n\n\n/**\n * @const\n * @private {!Object}\n */\nshaka.media.TtmlTextParser.textAlignToPositionAlign_ = {\n 'left': 'line-left',\n 'center': 'center',\n 'right': 'line-right'\n};\n\n\n/**\n * Gets leaf nodes of the xml node tree. Ignores the text, br elements\n * and the spans positioned inside paragraphs\n *\n * @param {Element} element\n * @return {!Array.<!Element>}\n * @private\n */\nshaka.media.TtmlTextParser.getLeafNodes_ = function(element) {\n var result = [];\n if (!element)\n return result;\n\n var childNodes = element.childNodes;\n for (var i = 0; i < childNodes.length; i++) {\n // Currently we don't support styles applicable to span\n // elements, so they are ignored\n var isSpanChildOfP = childNodes[i].nodeName == 'span' &&\n element.nodeName == 'p';\n if (childNodes[i].nodeType == Node.ELEMENT_NODE &&\n childNodes[i].nodeName != 'br' && !isSpanChildOfP) {\n // Get the leafs the child might contain\n goog.asserts.assert(childNodes[i] instanceof Element,\n 'Node should be Element!');\n var leafChildren = shaka.media.TtmlTextParser.getLeafNodes_(\n /** @type {Element} */(childNodes[i]));\n goog.asserts.assert(leafChildren.length > 0,\n 'Only a null Element should return no leaves!');\n result = result.concat(leafChildren);\n }\n }\n\n // if no result at this point, the element itself must be a leaf\n if (!result.length) {\n result.push(element);\n }\n return result;\n};\n\n\n/**\n * Insert \\n where <br> tags are found\n *\n * @param {!Node} element\n * @param {boolean} whitespaceTrim\n * @private\n */\nshaka.media.TtmlTextParser.addNewLines_ = function(element, whitespaceTrim) {\n var childNodes = element.childNodes;\n\n for (var i = 0; i < childNodes.length; i++) {\n if (childNodes[i].nodeName == 'br' && i > 0) {\n childNodes[i - 1].textContent += '\\n';\n } else if (childNodes[i].childNodes.length > 0) {\n shaka.media.TtmlTextParser.addNewLines_(childNodes[i], whitespaceTrim);\n } else if (whitespaceTrim) {\n // Trim leading and trailing whitespace.\n var trimmed = childNodes[i].textContent.trim();\n // Collapse multiple spaces into one.\n trimmed = trimmed.replace(/\\s+/g, ' ');\n\n childNodes[i].textContent = trimmed;\n }\n }\n};\n\n\n/**\n * Parses an Element into a TextTrackCue or VTTCue.\n *\n * @param {!Element} cueElement\n * @param {number} offset\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {!Array.<!Element>} styles\n * @param {!Array.<!Element>} regions\n * @param {boolean} whitespaceTrim\n * @return {TextTrackCue}\n * @private\n */\nshaka.media.TtmlTextParser.parseCue_ = function(\n cueElement, offset, rateInfo, styles, regions, whitespaceTrim) {\n\n // Disregard empty elements:\n // TTML allows for empty elements like <div></div>.\n // If cueElement has neither time attributes, nor\n // non-whitespace text, don't try to make a cue out of it.\n if (!cueElement.hasAttribute('begin') &&\n !cueElement.hasAttribute('end') &&\n /^\\s*$/.test(cueElement.textContent))\n return null;\n\n shaka.media.TtmlTextParser.addNewLines_(cueElement, whitespaceTrim);\n\n // Get time\n var start = shaka.media.TtmlTextParser.parseTime_(\n cueElement.getAttribute('begin'), rateInfo);\n var end = shaka.media.TtmlTextParser.parseTime_(\n cueElement.getAttribute('end'), rateInfo);\n var duration = shaka.media.TtmlTextParser.parseTime_(\n cueElement.getAttribute('dur'), rateInfo);\n var payload = cueElement.textContent;\n\n if (end == null && duration != null)\n end = start + duration;\n\n if (start == null || end == null) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_TEXT_CUE);\n }\n\n start += offset;\n end += offset;\n\n var cue = shaka.media.TextEngine.makeCue(start, end, payload);\n if (!cue)\n return null;\n\n // Get other properties if available\n var region = shaka.media.TtmlTextParser.getElementFromCollection_(\n cueElement, 'region', regions);\n shaka.media.TtmlTextParser.addStyle_(cue, cueElement, region, styles);\n\n return cue;\n};\n\n\n/**\n * Adds applicable style properties to a cue.\n *\n * @param {!TextTrackCue} cue\n * @param {!Element} cueElement\n * @param {Element} region\n * @param {!Array.<!Element>} styles\n * @private\n */\nshaka.media.TtmlTextParser.addStyle_ = function(\n cue, cueElement, region, styles) {\n var TtmlTextParser = shaka.media.TtmlTextParser;\n var results = null;\n\n\n var extent = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:extent');\n if (extent) {\n results = TtmlTextParser.percentValues_.exec(extent);\n if (results != null) {\n // Use width value of the extent attribute for size.\n // Height value is ignored.\n cue.size = Number(results[1]);\n }\n }\n\n var writingMode = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:writingMode');\n var isVerticalText = true;\n if (writingMode == 'tb' || writingMode == 'tblr')\n cue.vertical = 'lr';\n else if (writingMode == 'tbrl')\n cue.vertical = 'rl';\n else\n isVerticalText = false;\n\n var origin = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:origin');\n if (origin) {\n results = TtmlTextParser.percentValues_.exec(origin);\n if (results != null) {\n // for vertical text use first coordinate of tts:origin\n // to represent line of the cue and second - for position.\n // Otherwise (horizontal), use them the other way around.\n if (isVerticalText) {\n cue.position = Number(results[2]);\n cue.line = Number(results[1]);\n } else {\n cue.position = Number(results[1]);\n cue.line = Number(results[2]);\n }\n // A boolean indicating whether the line is an integer\n // number of lines (using the line dimensions of the first\n // line of the cue), or whether it is a percentage of the\n // dimension of the video. The flag is set to true when lines\n // are counted, and false otherwise.\n cue.snapToLines = false;\n }\n }\n\n var align = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:textAlign');\n if (align) {\n cue.align = align;\n if (align == 'center') {\n if (cue.align != 'center') {\n // Workaround for a Chrome bug http://crbug.com/663797\n // Chrome does not support align = 'center'\n cue.align = 'middle';\n }\n cue.position = 'auto';\n }\n cue.positionAlign = TtmlTextParser.textAlignToPositionAlign_[align];\n cue.lineAlign = TtmlTextParser.textAlignToLineAlign_[align];\n }\n};\n\n\n/**\n * Finds a specified attribute on either the original cue element or its\n * associated region and returns the value if the attribute was found.\n *\n * @param {!Element} cueElement\n * @param {Element} region\n * @param {!Array.<!Element>} styles\n * @param {string} attribute\n * @return {?string}\n * @private\n */\nshaka.media.TtmlTextParser.getStyleAttribute_ = function(\n cueElement, region, styles, attribute) {\n\n // An attribute can be specified on region level or in a styling block\n // associated with the region or original element.\n var regionChildren = shaka.media.TtmlTextParser.getLeafNodes_(region);\n for (var i = 0; i < regionChildren.length; i++) {\n var attr = regionChildren[i].getAttribute(attribute);\n if (attr)\n return attr;\n }\n\n var getElementFromCollection_ =\n shaka.media.TtmlTextParser.getElementFromCollection_;\n var style = getElementFromCollection_(region, 'style', styles) ||\n getElementFromCollection_(cueElement, 'style', styles);\n if (style)\n return style.getAttribute(attribute);\n return null;\n};\n\n\n/**\n * Selects an item from |collection| whose id matches |attributeName|\n * from |element|.\n *\n * @param {Element} element\n * @param {string} attributeName\n * @param {!Array.<Element>} collection\n * @return {Element}\n * @private\n */\nshaka.media.TtmlTextParser.getElementFromCollection_ = function(\n element, attributeName, collection) {\n if (!element || collection.length < 1) {\n return null;\n }\n var item = null;\n var itemName = shaka.media.TtmlTextParser.getInheritedAttribute_(\n element, attributeName);\n if (itemName) {\n for (var i = 0; i < collection.length; i++) {\n if (collection[i].getAttribute('xml:id') == itemName) {\n item = collection[i];\n break;\n }\n }\n }\n\n return item;\n};\n\n\n/**\n * Traverses upwards from a given node until a given attribute is found.\n *\n * @param {!Element} element\n * @param {string} attributeName\n * @return {?string}\n * @private\n */\nshaka.media.TtmlTextParser.getInheritedAttribute_ = function(\n element, attributeName) {\n var ret = null;\n while (element) {\n ret = element.getAttribute(attributeName);\n if (ret) {\n break;\n }\n\n // Element.parentNode can lead to XMLDocument, which is not an Element and\n // has no getAttribute().\n var parentNode = element.parentNode;\n if (parentNode instanceof Element) {\n element = parentNode;\n } else {\n break;\n }\n }\n return ret;\n};\n\n\n/**\n * Parses a TTML time from the given word.\n *\n * @param {string} text\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseTime_ = function(text, rateInfo) {\n var ret = null;\n var TtmlTextParser = shaka.media.TtmlTextParser;\n\n if (TtmlTextParser.timeColonFormatFrames_.test(text)) {\n ret = TtmlTextParser.parseColonTimeWithFrames_(rateInfo, text);\n } else if (TtmlTextParser.timeColonFormat_.test(text)) {\n ret = TtmlTextParser.parseTimeFromRegex_(\n TtmlTextParser.timeColonFormat_, text);\n } else if (TtmlTextParser.timeColonFormatMilliseconds_.test(text)) {\n ret = TtmlTextParser.parseTimeFromRegex_(\n TtmlTextParser.timeColonFormatMilliseconds_, text);\n } else if (TtmlTextParser.timeFramesFormat_.test(text)) {\n ret = TtmlTextParser.parseFramesTime_(rateInfo, text);\n } else if (TtmlTextParser.timeTickFormat_.test(text)) {\n ret = TtmlTextParser.parseTickTime_(rateInfo, text);\n } else if (TtmlTextParser.timeHMSFormat_.test(text)) {\n ret = TtmlTextParser.parseTimeFromRegex_(\n TtmlTextParser.timeHMSFormat_, text);\n }\n\n return ret;\n};\n\n\n/**\n * Parses a TTML time in frame format\n *\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseFramesTime_ = function(rateInfo, text) {\n\n // 75f or 75.5f\n var results = shaka.media.TtmlTextParser.timeFramesFormat_.exec(text);\n var frames = Number(results[1]);\n\n return frames / rateInfo.frameRate;\n};\n\n\n/**\n * Parses a TTML time in tick format\n *\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseTickTime_ = function(rateInfo, text) {\n\n // 50t or 50.5t\n var results = shaka.media.TtmlTextParser.timeTickFormat_.exec(text);\n var ticks = Number(results[1]);\n\n return ticks / rateInfo.tickRate;\n};\n\n\n/**\n * Parses a TTML colon formatted time containing frames\n *\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseColonTimeWithFrames_ = function(\n rateInfo, text) {\n\n // 01:02:43:07 ('07' is frames) or 01:02:43:07.1 (subframes)\n var results = shaka.media.TtmlTextParser.timeColonFormatFrames_.exec(text);\n\n var hours = Number(results[1]);\n var minutes = Number(results[2]);\n var seconds = Number(results[3]);\n var frames = Number(results[4]);\n var subframes = Number(results[5]) || 0;\n\n frames += subframes / rateInfo.subFrameRate;\n seconds += frames / rateInfo.frameRate;\n\n return seconds + (minutes * 60) + (hours * 3600);\n};\n\n\n/**\n * Parses a TTML time with a given regex. Expects regex to be some\n * sort of a time-matcher to match hours, minutes, seconds and milliseconds\n *\n * @param {!RegExp} regex\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseTimeFromRegex_ = function(regex, text) {\n var results = regex.exec(text);\n if (results == null || results[0] == '')\n return null;\n // This capture is optional, but will still be in the array as undefined,\n // default to 0.\n var hours = Number(results[1]) || 0;\n var minutes = Number(results[2]) || 0;\n var seconds = Number(results[3]) || 0;\n var miliseconds = Number(results[4]) || 0;\n\n return (miliseconds / 1000) + seconds + (minutes * 60) + (hours * 3600);\n};\n\n\n\n/**\n * Contains information about frame/subframe rate\n * and frame rate multiplier for time in frame format.\n * ex. 01:02:03:04(4 frames) or 01:02:03:04.1(4 frames, 1 subframe)\n *\n * @param {?string} frameRate\n * @param {?string} subFrameRate\n * @param {?string} frameRateMultiplier\n * @param {?string} tickRate\n * @constructor\n * @struct\n * @private\n */\nshaka.media.TtmlTextParser.RateInfo_ = function(\n frameRate, subFrameRate, frameRateMultiplier, tickRate) {\n\n /**\n * @type {number}\n */\n this.frameRate = Number(frameRate) || 30;\n\n /**\n * @type {number}\n */\n this.subFrameRate = Number(subFrameRate) || 1;\n\n /**\n * @type {number}\n */\n this.tickRate = Number(tickRate);\n if (this.tickRate == 0) {\n if (frameRate)\n this.tickRate = this.frameRate * this.subFrameRate;\n else\n this.tickRate = 1;\n }\n\n if (frameRateMultiplier) {\n var multiplierResults = /^(\\d+) (\\d+)$/g.exec(frameRateMultiplier);\n if (multiplierResults) {\n var numerator = multiplierResults[1];\n var denominator = multiplierResults[2];\n var multiplierNum = numerator / denominator;\n this.frameRate *= multiplierNum;\n }\n }\n};\n\n\nshaka.media.TextEngine.registerParser(\n 'application/ttml+xml',\n shaka.media.TtmlTextParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/ttml_text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Mp4TtmlParser');\n\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.media.TtmlTextParser');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Mp4Parser');\n\n\n\n/**\n * @struct\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.Mp4TtmlParser = function() {\n /**\n * @type {!shakaExtern.TextParser}\n * @private\n */\n this.parser_ = new shaka.media.TtmlTextParser();\n};\n\n\n/** @override **/\nshaka.media.Mp4TtmlParser.prototype.parseInit = function(data) {\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var sawSTPP = false;\n\n new Mp4Parser()\n .box('moov', Mp4Parser.children)\n .box('trak', Mp4Parser.children)\n .box('mdia', Mp4Parser.children)\n .box('minf', Mp4Parser.children)\n .box('stbl', Mp4Parser.children)\n .fullBox('stsd', Mp4Parser.sampleDescription)\n .box('stpp', function(box) {\n sawSTPP = true;\n }).parse(data);\n\n if (!sawSTPP) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_TTML);\n }\n};\n\n\n/** @override **/\nshaka.media.Mp4TtmlParser.prototype.parseMedia = function(data, time) {\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var sawMDAT = false;\n var payload = [];\n\n new Mp4Parser()\n .box('mdat', Mp4Parser.allData(function(data) {\n sawMDAT = true;\n payload = this.parser_.parseMedia(data.buffer, time);\n }.bind(this))).parse(data);\n\n if (!sawMDAT) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_TTML);\n }\n\n return payload;\n};\n\n\nshaka.media.TextEngine.registerParser(\n 'application/mp4; codecs=\"stpp\"',\n shaka.media.Mp4TtmlParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/mp4_ttml_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.VttTextParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.TextParser');\n\n\n\n/**\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.VttTextParser = function() { };\n\n\n/** @override */\nshaka.media.VttTextParser.prototype.parseInit = function(data) {\n goog.asserts.assert(false, 'VTT does not have init segments');\n};\n\n\n/**\n * @override\n * @throws {shaka.util.Error}\n */\nshaka.media.VttTextParser.prototype.parseMedia = function(data, time) {\n var VttTextParser = shaka.media.VttTextParser;\n // Get the input as a string. Normalize newlines to \\n.\n var str = shaka.util.StringUtils.fromUTF8(data);\n str = str.replace(/\\r\\n|\\r(?=[^\\n]|$)/gm, '\\n');\n var blocks = str.split(/\\n{2,}/m);\n\n if (!/^WEBVTT($|[ \\t\\n])/m.test(blocks[0])) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_TEXT_HEADER);\n }\n\n var offset = time.segmentStart;\n // Parse X-TIMESTAMP-MAP metadata header if it's present to get\n // time offset information.\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5\n if (blocks[0].indexOf('X-TIMESTAMP-MAP') >= 0) {\n // 'X-TIMESTAMP-MAP' header is used in HLS to align text with\n // the rest of the media.\n // The header format is 'X-TIMESTAMP-MAP=MPEGTS:n,LOCAL:m'\n // (the attributes can go in any order)\n // where n is MPEG-2 time and m is cue time it maps to.\n // For example 'X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000'\n // means an offset of 10 seconds\n // 900000/MPEG_TIMESCALE - cue time.\n var cueTimeMatch =\n blocks[0].match(/LOCAL:((?:(\\d{1,}):)?(\\d{2}):(\\d{2})\\.(\\d{3}))/m);\n\n var mpegTimeMatch = blocks[0].match(/MPEGTS:(\\d+)/m);\n if (cueTimeMatch && mpegTimeMatch) {\n var parser = new shaka.util.TextParser(cueTimeMatch[1]);\n var cueTime = shaka.media.VttTextParser.parseTime_(parser);\n var mpegTime = Number(mpegTimeMatch[1]);\n var mpegTimescale = shaka.media.VttTextParser.MPEG_TIMESCALE_;\n // Apple-encoded HLS content uses absolute timestamps, so assume\n // the presence of the map tag means the content uses absolute\n // timestamps.\n offset = time.periodStart + (mpegTime / mpegTimescale - cueTime);\n }\n }\n\n var ret = [];\n for (var i = 1; i < blocks.length; i++) {\n var lines = blocks[i].split('\\n');\n var cue = VttTextParser.parseCue_(lines, offset);\n if (cue)\n ret.push(cue);\n }\n\n return ret;\n};\n\n\n/**\n * Parses a text block into a Cue object.\n *\n * @param {!Array.<string>} text\n * @param {number} timeOffset\n * @return {?TextTrackCue}\n * @private\n */\nshaka.media.VttTextParser.parseCue_ = function(text, timeOffset) {\n // Skip empty blocks.\n if (text.length == 1 && !text[0])\n return null;\n\n // Skip comment blocks.\n if (/^NOTE($|[ \\t])/.test(text[0]))\n return null;\n\n var id = null;\n var index = text[0].indexOf('-->');\n if (index < 0) {\n id = text[0];\n text.splice(0, 1);\n }\n\n // Parse the times.\n var parser = new shaka.util.TextParser(text[0]);\n var start = shaka.media.VttTextParser.parseTime_(parser);\n var expect = parser.readRegex(/[ \\t]+-->[ \\t]+/g);\n var end = shaka.media.VttTextParser.parseTime_(parser);\n\n if (start == null || expect == null || end == null) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_TEXT_CUE);\n }\n\n start += timeOffset;\n end += timeOffset;\n\n // Get the payload.\n var payload = text.slice(1).join('\\n').trim();\n\n var cue = shaka.media.TextEngine.makeCue(start, end, payload);\n if (!cue)\n return null;\n\n // Parse optional settings.\n parser.skipWhitespace();\n var word = parser.readWord();\n while (word) {\n if (!shaka.media.VttTextParser.parseSetting(cue, word)) {\n shaka.log.warning('VTT parser encountered an invalid VTT setting: ',\n word,\n ' The setting will be ignored.');\n }\n parser.skipWhitespace();\n word = parser.readWord();\n }\n\n if (id != null)\n cue.id = id;\n return cue;\n};\n\n\n/**\n * Parses a WebVTT setting from the given word.\n *\n * @param {!TextTrackCue} cue\n * @param {string} word\n * @return {boolean} True on success.\n */\nshaka.media.VttTextParser.parseSetting = function(cue, word) {\n // NOTE: positionAlign and lineAlign settings are not supported by Chrome\n // at the moment, so setting them will have no effect.\n // The bug on chromium to implement them:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=633690\n\n var results = null;\n if ((results = /^align:(start|middle|center|end|left|right)$/.exec(word))) {\n cue.align = results[1];\n if (results[1] == 'center' && cue.align != 'center') {\n // Workaround for a Chrome bug http://crbug.com/663797\n // Chrome does not support align = 'center'\n cue.position = 'auto';\n cue.align = 'middle';\n }\n } else if ((results = /^vertical:(lr|rl)$/.exec(word))) {\n cue.vertical = results[1];\n } else if ((results = /^size:(\\d{1,2}|100)%$/.exec(word))) {\n cue.size = Number(results[1]);\n }\n // There was a disagreement between a working draft and an editor draft of\n // the WebVTT spec. According to the former, optional position alignment\n // options are 'start', 'end' and 'center'. According to the latter -\n // 'line-left', 'center' and 'line-right'.\n // We are going to support both options for now.\n else if ((results =\n /^position:(\\d{1,2}|100)%(?:,(line-left|line-right|center|start|end))?$/\n .exec(word))) {\n cue.position = Number(results[1]);\n if (results[2])\n cue.positionAlign = results[2];\n } else if ((results =\n /^line:(\\d{1,2}|100)%(?:,(start|end|center))?$/.exec(word))) {\n cue.snapToLines = false;\n cue.line = Number(results[1]);\n if (results[2])\n cue.lineAlign = results[2];\n } else if ((results = /^line:(-?\\d+)(?:,(start|end|center))?$/.exec(word))) {\n cue.snapToLines = true;\n cue.line = Number(results[1]);\n if (results[2])\n cue.lineAlign = results[2];\n } else {\n return false;\n }\n\n return true;\n};\n\n\n/**\n * Parses a WebVTT time from the given parser.\n *\n * @param {!shaka.util.TextParser} parser\n * @return {?number}\n * @private\n */\nshaka.media.VttTextParser.parseTime_ = function(parser) {\n // 00:00.000 or 00:00:00.000 or 0:00:00.000\n var results = parser.readRegex(/(?:(\\d{1,}):)?(\\d{2}):(\\d{2})\\.(\\d{3})/g);\n if (results == null)\n return null;\n // This capture is optional, but will still be in the array as undefined,\n // default to 0.\n var hours = Number(results[1]) || 0;\n var minutes = Number(results[2]);\n var seconds = Number(results[3]);\n var miliseconds = Number(results[4]);\n if (minutes > 59 || seconds > 59)\n return null;\n\n return (miliseconds / 1000) + seconds + (minutes * 60) + (hours * 3600);\n};\n\n\n/**\n * @const {number}\n * @private\n */\nshaka.media.VttTextParser.MPEG_TIMESCALE_ = 90000;\n\nshaka.media.TextEngine.registerParser(\n 'text/vtt',\n shaka.media.VttTextParser);\n\nshaka.media.TextEngine.registerParser(\n 'text/vtt; codecs=\"vtt\"',\n shaka.media.VttTextParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/vtt_text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Mp4VttParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.media.VttTextParser');\ngoog.require('shaka.util.DataViewReader');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Mp4Parser');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.TextParser');\n\n\n\n/**\n * @struct\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.Mp4VttParser = function() {\n /**\n * The current time scale used by the VTT parser.\n *\n * @type {?number}\n * @private\n */\n this.timescale_ = null;\n};\n\n\n/** @override */\nshaka.media.Mp4VttParser.prototype.parseInit = function(data) {\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var sawWVTT = false;\n\n new Mp4Parser()\n .box('moov', Mp4Parser.children)\n .box('trak', Mp4Parser.children)\n .box('mdia', Mp4Parser.children)\n .fullBox('mdhd', function(box) {\n goog.asserts.assert(\n box.version == 0 || box.version == 1,\n 'MDHD version can only be 0 or 1');\n if (box.version == 0) {\n box.reader.skip(4); // skip \"creation_time\"\n box.reader.skip(4); // skip \"modification_time\"\n this.timescale_ = box.reader.readUint32();\n box.reader.skip(4); // skip \"duration\"\n } else {\n box.reader.skip(8); // skip \"creation_time\"\n box.reader.skip(8); // skip \"modification_time\"\n this.timescale_ = box.reader.readUint32();\n box.reader.skip(8); // skip \"duration\"\n }\n box.reader.skip(4); // skip \"pad\", \"language\", and \"pre-defined\"\n }.bind(this))\n .box('minf', Mp4Parser.children)\n .box('stbl', Mp4Parser.children)\n .fullBox('stsd', Mp4Parser.sampleDescription)\n .box('wvtt', function(box) {\n // A valid vtt init segment, no actual subtitles yet\n sawWVTT = true;\n }).parse(data);\n\n if (!this.timescale_) {\n // Missing timescale for VTT content. Should be located in the MDHD\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_VTT);\n }\n\n if (!sawWVTT) {\n // A WVTT box should have been seen (a valid vtt init segment with no\n // actual subtitles).\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_VTT);\n }\n};\n\n\n/** @override */\nshaka.media.Mp4VttParser.prototype.parseMedia = function(data, time) {\n var Mp4VttParser = shaka.media.Mp4VttParser;\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var baseTime = 0;\n var presentations = [];\n var payloads = [];\n var cues = [];\n\n var sawTFDT = false;\n var sawTRUN = false;\n var sawMDAT = false;\n\n new Mp4Parser()\n .box('moof', Mp4Parser.children)\n .box('traf', Mp4Parser.children)\n .fullBox('tfdt', function(box) {\n sawTFDT = true;\n goog.asserts.assert(\n box.version == 0 || box.version == 1,\n 'TFDT version can only be 0 or 1');\n baseTime = (box.version == 0) ?\n box.reader.readUint32() :\n box.reader.readUint64();\n })\n .fullBox('trun', function(box) {\n sawTRUN = true;\n goog.asserts.assert(\n box.version != null,\n 'A TRUN box should have a valid version value');\n goog.asserts.assert(\n box.flags != null,\n 'A TRUN box should have a valid flags value');\n presentations = Mp4VttParser.parseTRUN_(\n box.version, box.flags, box.reader);\n })\n .box('vtte', function(box) {\n // VTTE are empty cues, so there is no need to do any more than insert\n // a place-holder. We must add something or else the ordering between\n // the payloads and presentation times would fall out of order.\n payloads.push(null);\n })\n .box('vttc', Mp4Parser.allData(function(data) {\n payloads.push(data.buffer);\n }))\n .box('mdat', function(box) {\n sawMDAT = true;\n Mp4Parser.children(box);\n }).parse(data);\n\n if (!sawMDAT && !sawTFDT && !sawTRUN) {\n // A required box is missing\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_VTT);\n }\n\n goog.asserts.assert(\n presentations.length == payloads.length,\n 'The number of presentations should equal the number of payloads');\n\n var currentTime = baseTime;\n\n for (var i = 0; i < presentations.length; i++) {\n var presentation = presentations[i];\n var payload = payloads[i];\n\n if (presentation.duration) {\n var startTime = presentation.timeOffset ?\n baseTime + presentation.timeOffset :\n currentTime;\n\n currentTime = startTime + presentation.duration;\n\n // The payload can be null as that would mean that it was a VTTE and\n // was only inserted to keep the presentation times in sync with the\n // payloads.\n if (payload) {\n cues.push(shaka.media.Mp4VttParser.parseVTTC_(\n payload,\n time.periodStart + startTime / this.timescale_,\n time.periodStart + currentTime / this.timescale_));\n }\n }\n }\n\n return cues;\n};\n\n\n/**\n * @typedef {{\n * duration: ?number,\n * timeOffset: ?number\n * }}\n *\n * @property {?number} duration\n * The length of the segment in timescale units.\n * @property {?number} timeOffset\n * The time since the start of the segment in timescale units. Time\n * offset is based of the start of the segment. If this value is\n * missing, the accumated durations preceeding this time segment will\n * be used to create the start time.\n */\nshaka.media.Mp4VttParser.TimeSegment;\n\n\n/**\n * @param {number} version\n * @param {number} flags\n * @param {!shaka.util.DataViewReader} reader\n * @return {!Array.<shaka.media.Mp4VttParser.TimeSegment>}\n * @private\n */\nshaka.media.Mp4VttParser.parseTRUN_ = function(version, flags, reader) {\n var sampleCount = reader.readUint32();\n\n // skip \"data_offset\" if present\n if (flags & 0x000001) { reader.skip(4); }\n\n // skip \"first_sample_flags\" if present\n if (flags & 0x000004) { reader.skip(4); }\n\n var samples = [];\n\n for (var sampleIndex = 0; sampleIndex < sampleCount; sampleIndex++) {\n\n /** @type {shaka.media.Mp4VttParser.TimeSegment} */\n var sample = {\n duration: null,\n timeOffset: null\n };\n\n // read \"sample duration\" if present\n if (flags & 0x000100) { sample.duration = reader.readUint32(); }\n\n // skip \"sample_size\" if present\n if (flags & 0x000200) { reader.skip(4); }\n\n // skip \"sample_flags\" if present\n if (flags & 0x000400) {reader.skip(4); }\n\n // read \"sample_time_offset\" if present\n if (flags & 0x000800) {\n sample.timeOffset = version == 0 ?\n reader.readUint32() :\n reader.readInt32();\n }\n\n samples.push(sample);\n }\n\n return samples;\n};\n\n\n/**\n * Parses a vttc box into a cue.\n *\n * @param {!ArrayBuffer} data\n * @param {number} startTime\n * @param {number} endTime\n * @return {TextTrackCue}\n * @private\n */\nshaka.media.Mp4VttParser.parseVTTC_ = function(data, startTime, endTime) {\n var payload;\n var id;\n var settings;\n\n new shaka.util.Mp4Parser()\n .box('payl', shaka.util.Mp4Parser.allData(function(data) {\n payload = shaka.util.StringUtils.fromUTF8(data);\n }))\n .box('iden', shaka.util.Mp4Parser.allData(function(data) {\n id = shaka.util.StringUtils.fromUTF8(data);\n }))\n .box('sttg', shaka.util.Mp4Parser.allData(function(data) {\n settings = shaka.util.StringUtils.fromUTF8(data);\n }))\n .parse(data);\n\n if (payload) {\n return shaka.media.Mp4VttParser.assembleCue_(payload,\n id,\n settings,\n startTime,\n endTime);\n } else {\n return null;\n }\n};\n\n\n/**\n * Take the individual components that make a cue and create a vttc cue.\n *\n * @param {string} payload\n * @param {?string} id\n * @param {?string} settings\n * @param {number} startTime\n * @param {number} endTime\n * @return {TextTrackCue}\n * @private\n */\nshaka.media.Mp4VttParser.assembleCue_ = function(payload,\n id,\n settings,\n startTime,\n endTime) {\n var cue = shaka.media.TextEngine.makeCue(\n startTime,\n endTime,\n payload);\n\n if (cue && id) {\n cue.id = id;\n }\n\n if (cue && settings) {\n var parser = new shaka.util.TextParser(settings);\n\n var word = parser.readWord();\n\n while (word) {\n\n if (!shaka.media.VttTextParser.parseSetting(cue, word)) {\n shaka.log.warning('VTT parser encountered an invalid VTT setting: ',\n word,\n ' The setting will be ignored.');\n }\n\n parser.skipWhitespace();\n word = parser.readWord();\n }\n }\n\n return cue;\n};\n\n\nshaka.media.TextEngine.registerParser(\n 'application/mp4; codecs=\"wvtt\"',\n shaka.media.Mp4VttParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/mp4_vtt_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Playhead');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TimeRangesUtils');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * Creates a Playhead, which manages the video's current time.\n *\n * The Playhead provides mechanisms for setting the presentation's start time,\n * restricting seeking to valid time ranges, and stopping playback for startup\n * and re- buffering.\n *\n * @param {HTMLMediaElement} video\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.StreamingConfiguration} config\n * @param {?number} startTime The playhead's initial position in seconds. If\n * null, defaults to the start of the presentation for VOD and the live-edge\n * for live.\n * @param {function()} onSeek Called when the user agent seeks to a time within\n * the presentation timeline.\n * @param {function(!Event)} onEvent Called when an event is raised to be sent\n * to the application.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.Playhead = function(\n video, manifest, config, startTime, onSeek, onEvent) {\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = manifest;\n\n /** @private {?shakaExtern.StreamingConfiguration} */\n this.config_ = config;\n\n /**\n * The playhead's initial position in seconds, or null if it should\n * automatically be calculated later.\n * @private {?number}\n */\n this.startTime_ = startTime;\n\n /** @private {?function()} */\n this.onSeek_ = onSeek;\n\n /** @private {?function(!Event)} */\n this.onEvent_ = onEvent;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {boolean} */\n this.buffering_ = false;\n\n /** @private {number} */\n this.playbackRate_ = 1;\n\n /** @private {?number} */\n this.trickPlayIntervalId_ = null;\n\n /** @private {?number} */\n this.gapJumpIntervalId_ = null;\n\n /** @private {number} */\n this.prevReadyState_ = video.readyState;\n\n /** @private {boolean} */\n this.didFireLargeGap_ = false;\n\n /**\n * The wall-clock time (in milliseconds) that the stall occurred. This is\n * used to ensure we don't flush the pipeline too often.\n * @private {number}\n */\n this.stallWallTime_ = -1;\n\n /**\n * The playhead time where we think a stall occurred. When the ready state\n * says we don't have enough data and the playhead stops too long, we assume\n * we have stalled.\n * @private {number}\n */\n this.stallPlayheadTime_ = -1;\n\n /** @private {boolean} */\n this.hadSegmentAppended_ = false;\n\n\n // Check if the video has already loaded some metadata.\n if (video.readyState > 0) {\n this.onLoadedMetadata_();\n } else {\n this.eventManager_.listenOnce(\n video, 'loadedmetadata', this.onLoadedMetadata_.bind(this));\n }\n\n var pollGap = this.onPollGapJump_.bind(this);\n this.eventManager_.listen(video, 'ratechange', this.onRateChange_.bind(this));\n this.eventManager_.listen(video, 'waiting', pollGap);\n\n // We can't trust readyState or 'waiting' events on all platforms. So poll\n // the current time and if we are in a gap, jump it.\n // See: https://goo.gl/sbSHp9 and https://goo.gl/cuAcYd\n this.gapJumpIntervalId_ = setInterval(pollGap, 250);\n};\n\n\n/** @override */\nshaka.media.Playhead.prototype.destroy = function() {\n var p = this.eventManager_.destroy();\n this.eventManager_ = null;\n\n if (this.trickPlayIntervalId_ != null) {\n window.clearInterval(this.trickPlayIntervalId_);\n this.trickPlayIntervalId_ = null;\n }\n\n if (this.gapJumpIntervalId_ != null) {\n window.clearInterval(this.gapJumpIntervalId_);\n this.gapJumpIntervalId_ = null;\n }\n\n this.video_ = null;\n this.manifest_ = null;\n this.config_ = null;\n this.onSeek_ = null;\n this.onEvent_ = null;\n\n return p;\n};\n\n\n/** @param {number} startTime */\nshaka.media.Playhead.prototype.setStartTime = function(startTime) {\n if (this.video_.readyState > 0)\n this.video_.currentTime = this.clampTime_(startTime);\n else\n this.startTime_ = startTime;\n};\n\n\n/**\n * Gets the playhead's current (logical) position.\n *\n * @return {number}\n */\nshaka.media.Playhead.prototype.getTime = function() {\n if (this.video_.readyState > 0) {\n // Although we restrict the video's currentTime elsewhere, clamp it here to\n // ensure any timing issues (e.g., the user agent seeks and calls this\n // function before we receive the 'seeking' event) don't cause us to return\n // a time outside the segment availability window.\n return this.clampTime_(this.video_.currentTime);\n }\n\n return this.getStartTime_();\n};\n\n\n/**\n * Gets the playhead's initial position in seconds.\n *\n * @return {number}\n * @private\n */\nshaka.media.Playhead.prototype.getStartTime_ = function() {\n if (this.startTime_) {\n return this.clampTime_(this.startTime_);\n }\n\n var startTime;\n var timeline = this.manifest_.presentationTimeline;\n if (timeline.getDuration() < Infinity) {\n // If the presentation is VOD, or if the presentation is live but has\n // finished broadcasting, then start from the beginning.\n startTime = timeline.getSegmentAvailabilityStart();\n } else {\n // Otherwise, start near the live-edge.\n startTime = timeline.getSeekRangeEnd();\n }\n return startTime;\n};\n\n\n/**\n * Stops the playhead for buffering, or resumes the playhead after buffering.\n *\n * @param {boolean} buffering True to stop the playhead; false to allow it to\n * continue.\n */\nshaka.media.Playhead.prototype.setBuffering = function(buffering) {\n if (buffering != this.buffering_) {\n this.buffering_ = buffering;\n this.setPlaybackRate(this.playbackRate_);\n }\n};\n\n\n/**\n * Gets the current effective playback rate. This may be negative even if the\n * browser does not directly support rewinding.\n * @return {number}\n */\nshaka.media.Playhead.prototype.getPlaybackRate = function() {\n return this.playbackRate_;\n};\n\n\n/**\n * Sets the playback rate.\n * @param {number} rate\n */\nshaka.media.Playhead.prototype.setPlaybackRate = function(rate) {\n if (this.trickPlayIntervalId_ != null) {\n window.clearInterval(this.trickPlayIntervalId_);\n this.trickPlayIntervalId_ = null;\n }\n\n this.playbackRate_ = rate;\n // All major browsers support playback rates above zero. Only need fake\n // trick play for negative rates.\n this.video_.playbackRate = (this.buffering_ || rate < 0) ? 0 : rate;\n\n if (!this.buffering_ && rate < 0) {\n // Defer creating the timer until we stop buffering. This function will be\n // called again from setBuffering().\n this.trickPlayIntervalId_ = window.setInterval(function() {\n this.video_.currentTime += rate / 4;\n }.bind(this), 250);\n }\n};\n\n\n/**\n * Called when a segment is appended by StreamingEngine, but not when a clear is\n * pending. This means StreamingEngine will continue buffering forward from\n * what is buffered. So we know about any gaps before the start.\n */\nshaka.media.Playhead.prototype.onSegmentAppended = function() {\n this.hadSegmentAppended_ = true;\n this.onPollGapJump_();\n};\n\n\n/**\n * Handles a 'ratechange' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onRateChange_ = function() {\n // NOTE: This will not allow explicitly setting the playback rate to 0 while\n // the playback rate is negative. Pause will still work.\n var expectedRate =\n this.buffering_ || this.playbackRate_ < 0 ? 0 : this.playbackRate_;\n if (this.video_.playbackRate != expectedRate) {\n shaka.log.debug('Video playback rate changed to', this.video_.playbackRate);\n this.setPlaybackRate(this.video_.playbackRate);\n }\n};\n\n\n/**\n * Handles a 'loadedmetadata' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onLoadedMetadata_ = function() {\n // Move the real playhead to the start time.\n var targetTime = this.getStartTime_();\n if (Math.abs(this.video_.currentTime - targetTime) < 0.001) {\n this.eventManager_.listen(\n this.video_, 'seeking', this.onSeeking_.bind(this));\n this.eventManager_.listen(\n this.video_, 'playing', this.onPlaying_.bind(this));\n } else {\n this.eventManager_.listenOnce(\n this.video_, 'seeking', this.onSeekingToStartTime_.bind(this));\n this.video_.currentTime = targetTime;\n }\n};\n\n\n/**\n * Handles the 'seeking' event from the initial jump to the start time (if\n * there is one).\n *\n * @private\n */\nshaka.media.Playhead.prototype.onSeekingToStartTime_ = function() {\n goog.asserts.assert(this.video_.readyState > 0,\n 'readyState should be greater than 0');\n this.eventManager_.listen(this.video_, 'seeking', this.onSeeking_.bind(this));\n this.eventManager_.listen(this.video_, 'playing', this.onPlaying_.bind(this));\n};\n\n\n/**\n * Called on a recurring timer to check for gaps in the media. This is also\n * called in a 'waiting' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onPollGapJump_ = function() {\n if (this.video_.readyState == 0)\n return;\n\n // When the ready state changes, we have moved on, so we should fire the large\n // gap event if we see one.\n if (this.video_.readyState != this.prevReadyState_) {\n this.didFireLargeGap_ = false;\n this.prevReadyState_ = this.video_.readyState;\n }\n\n var smallGapLimit = this.config_.smallGapLimit;\n var currentTime = this.video_.currentTime;\n var buffered = this.video_.buffered;\n\n var gapIndex = shaka.media.TimeRangesUtils.getGapIndex(buffered, currentTime);\n\n // The current time is unbuffered or is too far from a gap.\n if (gapIndex == null) {\n if (this.video_.readyState < 3 && this.video_.playbackRate > 0) {\n // Some platforms/browsers can get stuck in the middle of a buffered range\n // (e.g. when seeking in a background tab). Flush the media pipeline to\n // help.\n //\n // Flush once we have stopped for more than 1 second inside a buffered\n // range. Note that Chromecast takes a few seconds to start playing\n // after any kind of seek, so wait 5 seconds between repeated flushes.\n if (this.stallPlayheadTime_ != currentTime) {\n this.stallPlayheadTime_ = currentTime;\n this.stallWallTime_ = Date.now();\n } else if (this.stallWallTime_ < Date.now() - 1000) {\n // Make the stall appear in the future so we don't flush for 5 seconds.\n this.stallWallTime_ = Date.now() + 5000;\n\n for (var i = 0; i < buffered.length; i++) {\n // Ignore the end of the buffered range since it may not play anymore\n // on all platforms.\n if (currentTime >= buffered.start(i) &&\n currentTime < buffered.end(i) - 0.5) {\n shaka.log.debug(\n 'Flushing media pipeline due to stall inside buffered range');\n this.video_.currentTime = this.video_.currentTime;\n break;\n }\n }\n }\n }\n return;\n }\n // If we are before the first buffered range, this could be an unbuffered\n // seek. So wait until a segment is appended so we are sure it is a gap.\n if (gapIndex == 0 && !this.hadSegmentAppended_)\n return;\n\n // StreamingEngine can buffer past the seek end, but still don't allow seeking\n // past it.\n var jumpTo = buffered.start(gapIndex);\n var seekEnd = this.manifest_.presentationTimeline.getSeekRangeEnd();\n if (jumpTo >= seekEnd)\n return;\n\n var jumpSize = jumpTo - currentTime;\n var isGapSmall = jumpSize <= smallGapLimit;\n var jumpLargeGap = false;\n\n if (!isGapSmall && !this.didFireLargeGap_) {\n this.didFireLargeGap_ = true;\n\n // Event firing is synchronous.\n var event = new shaka.util.FakeEvent(\n 'largegap', {'currentTime': currentTime, 'gapSize': jumpSize});\n event.cancelable = true;\n this.onEvent_(event);\n\n if (this.config_.jumpLargeGaps && !event.defaultPrevented)\n jumpLargeGap = true;\n else\n shaka.log.info('Ignoring large gap at', currentTime);\n }\n\n if (isGapSmall || jumpLargeGap) {\n if (gapIndex == 0) {\n shaka.log.info(\n 'Jumping forward', jumpSize,\n 'seconds because of gap before start time of', jumpTo);\n } else {\n shaka.log.info(\n 'Jumping forward', jumpSize, 'seconds because of gap starting at',\n buffered.end(gapIndex - 1), 'and ending at', jumpTo);\n }\n\n this.movePlayhead_(currentTime, jumpTo);\n }\n};\n\n\n/**\n * Handles a 'seeking' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onSeeking_ = function() {\n goog.asserts.assert(this.video_.readyState > 0,\n 'readyState should be greater than 0');\n\n this.hadSegmentAppended_ = false;\n var currentTime = this.video_.currentTime;\n var targetTime = this.reposition_(currentTime);\n\n if (Math.abs(targetTime - currentTime) > 0.001) {\n this.movePlayhead_(currentTime, targetTime);\n return;\n }\n\n shaka.log.v1('Seek to ' + currentTime);\n this.didFireLargeGap_ = false;\n this.onSeek_();\n};\n\n\n/**\n * Handles a 'playing' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onPlaying_ = function() {\n goog.asserts.assert(this.video_.readyState > 0,\n 'readyState should be greater than 0');\n\n var currentTime = this.video_.currentTime;\n var targetTime = this.reposition_(currentTime);\n\n if (Math.abs(targetTime - currentTime) > 0.001)\n this.movePlayhead_(currentTime, targetTime);\n};\n\n\n/**\n * Computes a new playhead position that's within the presentation timeline.\n *\n * @param {number} currentTime\n * @return {number} The time to reposition the playhead to.\n * @private\n */\nshaka.media.Playhead.prototype.reposition_ = function(currentTime) {\n goog.asserts.assert(this.manifest_ && this.config_, 'Must not be destroyed');\n\n /** @type {function(number)} */\n var isBuffered =\n shaka.media.TimeRangesUtils.isBuffered.bind(null, this.video_.buffered);\n\n var rebufferingGoal = shaka.util.StreamUtils.getRebufferingGoal(\n this.manifest_, this.config_, 1 /* scaleFactor */);\n\n var timeline = this.manifest_.presentationTimeline;\n var start = timeline.getSafeAvailabilityStart(0);\n var end = timeline.getSegmentAvailabilityEnd();\n\n // With live content, the beginning of the availability window is moving\n // forward. This means we cannot seek to it since we will \"fall\" outside the\n // window while we buffer. So we define a \"safe\" region that is far enough\n // away. For VOD, |safe == start|.\n var safe = timeline.getSafeAvailabilityStart(rebufferingGoal);\n\n // These are the times to seek to rather than the exact destinations. When\n // we seek, we will get another event (after a slight delay) and these steps\n // will run again. So if we seeked directly to |start|, |start| would move\n // on the next call and we would loop forever.\n //\n // Offset by 5 seconds since Chromecast takes a few seconds to start playing\n // after a seek, even when buffered.\n var seekStart = timeline.getSafeAvailabilityStart(5);\n var seekSafe = timeline.getSafeAvailabilityStart(rebufferingGoal + 5);\n\n\n if (currentTime > end) {\n shaka.log.v1('Playhead past end.');\n return end;\n }\n\n if (currentTime < start) {\n if (isBuffered(seekStart)) {\n shaka.log.v1('Playhead before start & start is buffered');\n return seekStart;\n } else {\n shaka.log.v1('Playhead before start & start is unbuffered');\n return seekSafe;\n }\n }\n\n if (currentTime >= safe || isBuffered(currentTime)) {\n shaka.log.v1('Playhead in safe region or in buffered region.');\n return currentTime;\n } else {\n shaka.log.v1('Playhead outside safe region & in unbuffered region.');\n return seekSafe;\n }\n};\n\n\n/**\n * Moves the playhead to the target time, triggering a call to onSeeking_().\n *\n * @param {number} currentTime\n * @param {number} targetTime\n * @private\n */\nshaka.media.Playhead.prototype.movePlayhead_ = function(\n currentTime, targetTime) {\n shaka.log.debug('Moving playhead...',\n 'currentTime=' + currentTime,\n 'targetTime=' + targetTime);\n this.video_.currentTime = targetTime;\n\n // Sometimes, IE and Edge ignore re-seeks. Check every 100ms and try\n // again if need be, up to 10 tries.\n // Delay stats over 100 runs of a re-seeking integration test:\n // IE - 0ms - 47%\n // IE - 100ms - 63%\n // Edge - 0ms - 2%\n // Edge - 100ms - 40%\n // Edge - 200ms - 32%\n // Edge - 300ms - 24%\n // Edge - 400ms - 2%\n // Chrome - 0ms - 100%\n // TODO: File a bug on IE/Edge about this.\n var tries = 0;\n var recheck = (function() {\n if (!this.video_) return;\n if (tries++ >= 10) return;\n\n if (this.video_.currentTime == currentTime) {\n // Sigh. Try again.\n this.video_.currentTime = targetTime;\n setTimeout(recheck, 100);\n }\n }).bind(this);\n setTimeout(recheck, 100);\n};\n\n\n/**\n * Clamps the given time to the segment availability window.\n *\n * @param {number} time The time in seconds.\n * @return {number} The clamped time in seconds.\n * @private\n */\nshaka.media.Playhead.prototype.clampTime_ = function(time) {\n var start = this.manifest_.presentationTimeline.getSegmentAvailabilityStart();\n if (time < start) return start;\n\n var end = this.manifest_.presentationTimeline.getSegmentAvailabilityEnd();\n if (time > end) return end;\n\n return time;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/playhead.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.PlayheadObserver');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.media.TimeRangesUtils');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * This observes the current playhead position to raise events. This will only\n * observe the playhead, {@link shaka.media.Playhead} will modify it. This will:\n * <ul>\n * <li>Track buffering state and call |onBuffering|.</li>\n * <li>Track current Period and call |onChangePeriod|.</li>\n * <li>Track timeline regions and raise respective events.</li>\n * </ul>\n *\n * @param {HTMLMediaElement} video\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.StreamingConfiguration} config\n * @param {function(boolean)} onBuffering Called and passed true when stopped\n * for buffering; called and passed false when proceeding after buffering.\n * If passed true, the callback should not set the video's playback rate.\n * @param {function(!Event)} onEvent Called when an event is raised to be sent\n * to the application.\n * @param {function()} onChangePeriod Called when the playhead moves to a\n * different Period.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.PlayheadObserver = function(\n video, manifest, config, onBuffering, onEvent, onChangePeriod) {\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = manifest;\n\n /** @private {?shakaExtern.StreamingConfiguration} */\n this.config_ = config;\n\n /** @private {?function(boolean)} */\n this.onBuffering_ = onBuffering;\n\n /** @private {?function(!Event)} */\n this.onEvent_ = onEvent;\n\n /** @private {?function()} */\n this.onChangePeriod_ = onChangePeriod;\n\n /** @private {!Array.<shaka.media.PlayheadObserver.TimelineRegion>} */\n this.timelineRegions_ = [];\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {boolean} */\n this.buffering_ = false;\n\n /** @private {number} */\n this.curPeriodIndex_ = -1;\n\n /** @private {?number} */\n this.watchdogTimer_ = null;\n\n\n this.startWatchdogTimer_();\n};\n\n\n/**\n * The threshold for underflow, in seconds. If there is less than this amount\n * of data buffered, we will consider the player to be out of data.\n *\n * @private {number}\n * @const\n */\nshaka.media.PlayheadObserver.UNDERFLOW_THRESHOLD_ = 0.5;\n\n\n/**\n * A fudge factor used when comparing buffered ranges to the duration to\n * determine if we have buffered all available content.\n *\n * @private {number}\n * @const\n */\nshaka.media.PlayheadObserver.FUDGE_FACTOR_ = 0.1;\n\n\n/**\n * @enum {number}\n * @private\n */\nshaka.media.PlayheadObserver.RegionLocation_ = {\n FUTURE_REGION: 1,\n INSIDE: 2,\n PAST_REGION: 3\n};\n\n\n/**\n * @typedef {{\n * info: shakaExtern.TimelineRegionInfo,\n * status: shaka.media.PlayheadObserver.RegionLocation_\n * }}\n *\n * @property {shakaExtern.TimelineRegionInfo} info\n * The info for this timeline region.\n * @property {shaka.media.PlayheadObserver.RegionLocation_} status\n * This tracks where the region is relative to the playhead. This tracks\n * whether we are before or after the region so we can raise events if we pass\n * it.\n */\nshaka.media.PlayheadObserver.TimelineRegion;\n\n\n/** @override */\nshaka.media.PlayheadObserver.prototype.destroy = function() {\n var p = this.eventManager_ ? this.eventManager_.destroy() : Promise.resolve();\n\n this.eventManager_ = null;\n this.cancelWatchdogTimer_();\n\n this.video_ = null;\n this.manifest_ = null;\n this.config_ = null;\n this.onBuffering_ = null;\n this.onEvent_ = null;\n this.onChangePeriod_ = null;\n this.timelineRegions_ = [];\n\n return p;\n};\n\n\n/** Called when a seek completes. */\nshaka.media.PlayheadObserver.prototype.seeked = function() {\n this.timelineRegions_.forEach(\n this.updateTimelineRegion_.bind(this, /* isSeek */ true));\n};\n\n\n/**\n * Adds a new timeline region. Events will be raised whenever the playhead\n * enters or exits the given region. This method will raise a\n * 'timelineregionadded' event.\n * @param {shakaExtern.TimelineRegionInfo} regionInfo\n */\nshaka.media.PlayheadObserver.prototype.addTimelineRegion = function(\n regionInfo) {\n // Check there isn't an existing event with the same scheme ID and time range.\n // This ensures that the manifest parser doesn't need to also track which\n // events have already been added.\n var hasExistingRegion = this.timelineRegions_.some(function(existing) {\n return existing.info.schemeIdUri == regionInfo.schemeIdUri &&\n existing.info.startTime == regionInfo.startTime &&\n existing.info.endTime == regionInfo.endTime;\n });\n if (hasExistingRegion) return;\n\n var region = {\n info: regionInfo,\n status: shaka.media.PlayheadObserver.RegionLocation_.FUTURE_REGION\n };\n this.timelineRegions_.push(region);\n\n var cloneTimelineInfo_ = shaka.media.PlayheadObserver.cloneTimelineInfo_;\n var event = new shaka.util.FakeEvent(\n 'timelineregionadded', {detail: cloneTimelineInfo_(regionInfo)});\n this.onEvent_(event);\n\n // Pretend this is a seek so it will ignore if it should be PAST_REGION but\n // still fire an event if it should be INSIDE.\n this.updateTimelineRegion_(/* isSeek */ true, region);\n};\n\n\n/**\n * Clones the given TimelineRegionInfo so the app can modify it without\n * modifying our internal objects.\n * @param {shakaExtern.TimelineRegionInfo} source\n * @return {shakaExtern.TimelineRegionInfo}\n * @private\n */\nshaka.media.PlayheadObserver.cloneTimelineInfo_ = function(source) {\n var copy = shaka.util.ConfigUtils.cloneObject(source);\n // cloneObject uses JSON to clone, which won't copy the DOM element.\n copy.eventElement = source.eventElement;\n return copy;\n};\n\n\n/**\n * Updates the status of a timeline region and fires any enter/exit events.\n * @param {boolean} isSeek\n * @param {shaka.media.PlayheadObserver.TimelineRegion} region\n * @private\n */\nshaka.media.PlayheadObserver.prototype.updateTimelineRegion_ = function(\n isSeek, region) {\n var RegionLocation = shaka.media.PlayheadObserver.RegionLocation_;\n var cloneTimelineInfo_ = shaka.media.PlayheadObserver.cloneTimelineInfo_;\n\n // The events are fired when the playhead enters a region. We fire both\n // events when passing over a region and not seeking since the playhead was\n // in the region but left before we saw it. We don't fire both when seeking\n // since the playhead was never in the region.\n //\n // |--------------------------------------|\n // | From \\ To | FUTURE | INSIDE | PAST |\n // | FUTURE | | enter | both* |\n // | INSIDE | exit | | exit |\n // | PAST | both* | enter | |\n // |--------------------------------------|\n // * Only when not seeking.\n var newStatus = region.info.startTime > this.video_.currentTime ?\n RegionLocation.FUTURE_REGION :\n (region.info.endTime < this.video_.currentTime ?\n RegionLocation.PAST_REGION :\n RegionLocation.INSIDE);\n var wasInside = region.status == RegionLocation.INSIDE;\n var isInside = newStatus == RegionLocation.INSIDE;\n\n if (newStatus != region.status) {\n var passedRegion = !wasInside && !isInside;\n if (!(isSeek && passedRegion)) {\n if (!wasInside) {\n this.onEvent_(new shaka.util.FakeEvent(\n 'timelineregionenter',\n {'detail': cloneTimelineInfo_(region.info)}));\n }\n if (!isInside) {\n this.onEvent_(new shaka.util.FakeEvent(\n 'timelineregionexit', {'detail': cloneTimelineInfo_(region.info)}));\n }\n }\n region.status = newStatus;\n }\n};\n\n\n/**\n * Starts the watchdog timer.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.startWatchdogTimer_ = function() {\n this.cancelWatchdogTimer_();\n this.watchdogTimer_ =\n window.setTimeout(this.onWatchdogTimer_.bind(this), 250);\n};\n\n\n/**\n * Cancels the watchdog timer, if any.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.cancelWatchdogTimer_ = function() {\n if (this.watchdogTimer_) {\n window.clearTimeout(this.watchdogTimer_);\n this.watchdogTimer_ = null;\n }\n};\n\n\n/**\n * Called on a recurring timer to detect buffering events and Period changes.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.onWatchdogTimer_ = function() {\n this.watchdogTimer_ = null;\n this.startWatchdogTimer_();\n\n goog.asserts.assert(this.manifest_ && this.config_, 'Must not be destroyed');\n var newPeriod = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.video_.currentTime);\n if (newPeriod != this.curPeriodIndex_) {\n // Ignore seek to start time, the first 'trackschanged' event is handled\n // during player.load().\n if (this.curPeriodIndex_ != -1)\n this.onChangePeriod_();\n this.curPeriodIndex_ = newPeriod;\n }\n\n // This uses an intersection of buffered ranges for both audio and video, so\n // it's an accurate way to determine if we are buffering or not.\n var bufferedAhead = shaka.media.TimeRangesUtils.bufferedAheadOf(\n this.video_.buffered, this.video_.currentTime);\n var bufferEnd = shaka.media.TimeRangesUtils.bufferEnd(this.video_.buffered);\n\n var fudgeFactor = shaka.media.PlayheadObserver.FUDGE_FACTOR_;\n var threshold = shaka.media.PlayheadObserver.UNDERFLOW_THRESHOLD_;\n\n var timeline = this.manifest_.presentationTimeline;\n var duration = timeline.getSegmentAvailabilityEnd() - fudgeFactor;\n\n var atEnd = (bufferEnd >= duration) || (this.video_.ended);\n if (!this.buffering_) {\n // If there are no buffered ranges but the playhead is at the end of\n // the video then we shouldn't enter a buffering state.\n if (!atEnd && bufferedAhead < threshold) {\n this.setBuffering_(true);\n }\n } else {\n var rebufferingGoal = shaka.util.StreamUtils.getRebufferingGoal(\n this.manifest_, this.config_, 1 /* scaleFactor */);\n if (atEnd || bufferedAhead >= rebufferingGoal) {\n this.setBuffering_(false);\n }\n }\n\n this.timelineRegions_.forEach(\n this.updateTimelineRegion_.bind(this, /* isSeek */ false));\n};\n\n\n/**\n * Stops the playhead for buffering, or resumes the playhead after buffering.\n *\n * @param {boolean} buffering True to stop the playhead; false to allow it to\n * continue.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.setBuffering_ = function(buffering) {\n if (buffering != this.buffering_) {\n this.buffering_ = buffering;\n this.onBuffering_(buffering);\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/playhead_observer.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.StreamingEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.MediaSourceEngine');\ngoog.require('shaka.media.Playhead');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.Mp4Parser');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * Creates a StreamingEngine.\n *\n * The StreamingEngine is responsible for setting up the Manifest's Streams\n * (i.e., for calling each Stream's createSegmentIndex() function), for\n * downloading segments, for co-ordinating audio, video, and text buffering,\n * and for handling Period transitions. The StreamingEngine provides an\n * interface to switch between Streams, but it does not choose which Streams to\n * switch to.\n *\n * The StreamingEngine notifies its owner when it needs to buffer a new Period,\n * so its owner can choose which Streams within that Period to initially\n * buffer. Moreover, the StreamingEngine also notifies its owner when any\n * Stream within the current Period may be switched to, so its owner can switch\n * bitrates, resolutions, or languages.\n *\n * The StreamingEngine does not need to be notified about changes to the\n * Manifest's SegmentIndexes; however, it does need to be notified when new\n * Periods are added to the Manifest, so it can set up that Period's Streams.\n *\n * To start the StreamingEngine the owner must first call configure() followed\n * by init(). The StreamingEngine will then call onChooseStreams(p) when it\n * needs to buffer Period p; it will then switch to the Streams returned from\n * that function. The StreamingEngine will call onCanSwitch() when any\n * Stream within the current Period may be switched to.\n *\n * The owner must call seeked() each time the playhead moves to a new location\n * within the presentation timeline; however, the owner may forego calling\n * seeked() when the playhead moves outside the presentation timeline.\n *\n * @param {shakaExtern.Manifest} manifest\n * @param {shaka.media.StreamingEngine.PlayerInterface} playerInterface\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.StreamingEngine = function(manifest, playerInterface) {\n /** @private {?shaka.media.StreamingEngine.PlayerInterface} */\n this.playerInterface_ = playerInterface;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = manifest;\n\n /** @private {?shakaExtern.StreamingConfiguration} */\n this.config_ = null;\n\n /** @private {number} */\n this.bufferingGoalScale_ = 1;\n\n /** @private {Promise} */\n this.setupPeriodPromise_ = Promise.resolve();\n\n /**\n * Maps a Period's index to an object that indicates that either\n * 1. the Period has not been set up (undefined)\n * 2. the Period is being set up ([a PublicPromise, false]),\n * 3. the Period is set up (i.e., all Streams within the Period are set up)\n * and can be switched to ([a PublicPromise, true]).\n *\n * @private {Array.<?{promise: shaka.util.PublicPromise, resolved: boolean}>}\n */\n this.canSwitchPeriod_ = [];\n\n /**\n * Maps a Stream's ID to an object that indicates that either\n * 1. the Stream has not been set up (undefined)\n * 2. the Stream is being set up ([a Promise instance, false]),\n * 3. the Stream is set up and can be switched to\n * ([a Promise instance, true]).\n *\n * @private {Object.<number,\n * ?{promise: shaka.util.PublicPromise, resolved: boolean}>}\n */\n this.canSwitchStream_ = {};\n\n /**\n * Maps a content type, e.g., 'audio', 'video', or 'text', to a MediaState.\n *\n * @private {Object.<shaka.util.ManifestParserUtils.ContentType,\n !shaka.media.StreamingEngine.MediaState_>}\n */\n this.mediaStates_ = {};\n\n /**\n * Set to true once one segment of each content type has been buffered.\n *\n * @private {boolean}\n */\n this.startupComplete_ = false;\n\n /**\n * Set to true on fatal error. Interrupts fetchAndAppend_().\n *\n * @private {boolean}\n */\n this.fatalError_ = false;\n\n /** @private {boolean} */\n this.destroyed_ = false;\n};\n\n\n/**\n * @typedef {{\n * playhead: !shaka.media.Playhead,\n * mediaSourceEngine: !shaka.media.MediaSourceEngine,\n * netEngine: shaka.net.NetworkingEngine,\n * onChooseStreams: function(!shakaExtern.Period):\n * !Object.<shaka.util.ManifestParserUtils.ContentType,\n * shakaExtern.Stream>,\n * onCanSwitch: function(),\n * onError: function(!shaka.util.Error),\n * onEvent: function(!Event),\n * onManifestUpdate: function(),\n * onSegmentAppended: function(),\n * onInitialStreamsSetup: (function()|undefined),\n * onStartupComplete: (function()|undefined)}\n * }}\n *\n * @property {!shaka.media.Playhead} playhead\n * The Playhead. The caller retains ownership.\n * @property {!shaka.media.MediaSourceEngine} mediaSourceEngine\n * The MediaSourceEngine. The caller retains ownership.\n * @property {shaka.net.NetworkingEngine} netEngine\n * The NetworkingEngine instance to use. The caller retains ownership.\n * @property {function(!shakaExtern.Period):\n * !Object.<shaka.util.ManifestParserUtils.ContentType,\n * shakaExtern.Stream>} onChooseStreams\n * Called when the given Period needs to be buffered. The\n * StreamingEngine will switch to the Streams returned from this function.\n * The caller cannot call switch() directly until the StreamingEngine calls\n * onCanSwitch()\n * @property {function()} onCanSwitch\n * Called when any Stream within the current Period may be switched to.\n * @property {function(!shaka.util.Error)} onError\n * Called when an error occurs. If the error is recoverable (see\n * @link{shaka.util.Error}) then the caller may invoke either\n * StreamingEngine.switch() or StreamingEngine.seeked() to attempt recovery.\n * @property {function(!Event)} onEvent\n * Called when an event occurs that should be sent to the app.\n * @property {function()} onManifestUpdate\n * Called when an embedded 'emsg' box should trigger a manifest update.\n * @property {function()} onSegmentAppended\n * Called after a segment is successfully appended to a MediaSource.\n * @property {(function()|undefined)} onInitialStreamsSetup\n * Optional callback which is called when the initial set of Streams have been\n * setup. Intended to be used by tests.\n * @property {(function()|undefined)} onStartupComplete\n * Optional callback which is called when startup has completed. Intended to\n * be used by tests.\n */\nshaka.media.StreamingEngine.PlayerInterface;\n\n\n/**\n * @typedef {{\n * type: shaka.util.ManifestParserUtils.ContentType,\n * stream: shakaExtern.Stream,\n * lastStream: ?shakaExtern.Stream,\n * lastSegmentReference: shaka.media.SegmentReference,\n * restoreStreamAfterTrickPlay: ?shakaExtern.Stream,\n * needInitSegment: boolean,\n * needPeriodIndex: number,\n * endOfStream: boolean,\n * performingUpdate: boolean,\n * updateTimer: ?number,\n * waitingToClearBuffer: boolean,\n * waitingToFlushBuffer: boolean,\n * clearingBuffer: boolean,\n * recovering: boolean,\n * hasError: boolean,\n * resumeAt: number\n * }}\n *\n * @description\n * Contains the state of a logical stream, i.e., a sequence of segmented data\n * for a particular content type. At any given time there is a Stream object\n * associated with the state of the logical stream.\n *\n * @property {shaka.util.ManifestParserUtils.ContentType} type\n * The stream's content type, e.g., 'audio', 'video', or 'text'.\n * @property {shakaExtern.Stream} stream\n * The current Stream.\n * @property {?shakaExtern.Stream} lastStream\n * The Stream of the last segment that was appended.\n * @property {shaka.media.SegmentReference} lastSegmentReference\n * The SegmentReference of the last segment that was appended.\n * @property {?shakaExtern.Stream} restoreStreamAfterTrickPlay\n * The Stream to restore after trick play mode is turned off.\n * @property {boolean} needInitSegment\n * True indicates that |stream|'s init segment must be inserted before the\n * next media segment is appended.\n * @property {boolean} endOfStream\n * True indicates that the end of the buffer has hit the end of the\n * presentation.\n * @property {number} needPeriodIndex\n * The index of the Period which needs to be buffered.\n * @property {boolean} performingUpdate\n * True indicates that an update is in progress.\n * @property {?number} updateTimer\n * A non-null value indicates that an update is scheduled.\n * @property {boolean} waitingToClearBuffer\n * True indicates that the buffer must be cleared after the current update\n * finishes.\n * @property {boolean} waitingToFlushBuffer\n * True indicates that the buffer must be flushed after it is cleared.\n * @property {boolean} clearingBuffer\n * True indicates that the buffer is being cleared.\n * @property {boolean} recovering\n * True indicates that the last segment was not appended because it could not\n * fit in the buffer.\n * @property {boolean} hasError\n * True indicates that the stream has encountered an error and has stopped\n * updates.\n * @property {number} resumeAt\n * An override for the time to start performing updates at. If the playhead\n * is behind this time, update_() will still start fetching segments from\n * this time. If the playhead is ahead of the time, this field is ignored.\n */\nshaka.media.StreamingEngine.MediaState_;\n\n\n/**\n * The minimum number seconds that will remain buffered after evicting media.\n *\n * @const {number}\n */\nshaka.media.StreamingEngine.prototype.MIN_BUFFER_LENGTH = 2;\n\n\n/** @override */\nshaka.media.StreamingEngine.prototype.destroy = function() {\n for (var type in this.mediaStates_) {\n this.cancelUpdate_(this.mediaStates_[type]);\n }\n\n this.playerInterface_ = null;\n this.manifest_ = null;\n this.setupPeriodPromise_ = null;\n this.canSwitchPeriod_ = null;\n this.canSwitchStream_ = null;\n this.mediaStates_ = null;\n this.config_ = null;\n\n this.destroyed_ = true;\n\n return Promise.resolve();\n};\n\n\n/**\n * Called by the Player to provide an updated configuration any time it changes.\n * Will be called at least once before init().\n *\n * @param {shakaExtern.StreamingConfiguration} config\n */\nshaka.media.StreamingEngine.prototype.configure = function(config) {\n this.config_ = config;\n};\n\n\n/**\n * Initializes the StreamingEngine.\n *\n * After this function is called the StreamingEngine will call\n * onChooseStreams(p) when it needs to buffer Period p and onCanSwitch() when\n * any Stream within that Period may be switched to.\n *\n * After the StreamingEngine calls onChooseStreams(p) for the first time, it\n * will begin setting up the Streams returned from that function and\n * subsequently switch to them. However, the StreamingEngine will not begin\n * setting up any other Streams until at least one segment from each of the\n * initial set of Streams has been buffered (this reduces startup latency).\n * After the StreamingEngine completes this startup phase it will begin setting\n * up each Period's Streams (while buffering in parrallel).\n *\n * When the StreamingEngine needs to buffer the next Period it will have\n * already set up that Period's Streams. So, when the StreamingEngine calls\n * onChooseStreams(p) after the first time, the StreamingEngine will\n * immediately switch to the Streams returned from that function.\n *\n * @return {!Promise}\n */\nshaka.media.StreamingEngine.prototype.init = function() {\n var MapUtils = shaka.util.MapUtils;\n goog.asserts.assert(this.config_,\n 'StreamingEngine configure() must be called before init()!');\n\n // Determine which Period we must buffer.\n var playheadTime = this.playerInterface_.playhead.getTime();\n var needPeriodIndex = this.findPeriodContainingTime_(playheadTime);\n\n // Get the initial set of Streams.\n var streamsByType = this.playerInterface_.onChooseStreams(\n this.manifest_.periods[needPeriodIndex]);\n if (MapUtils.empty(streamsByType)) {\n shaka.log.error('init: no Streams chosen');\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STREAMING,\n shaka.util.Error.Code.INVALID_STREAMS_CHOSEN));\n }\n\n // Setup the initial set of Streams and then begin each update cycle. After\n // startup completes onUpdate_() will set up the remaining Periods.\n return this.initStreams_(streamsByType).then(function() {\n shaka.log.debug('init: completed initial Stream setup');\n\n // Subtlety: onInitialStreamsSetup() may call switch() or seeked(), so we\n // must schedule an update beforehand so |updateTimer| is set.\n if (this.playerInterface_ && this.playerInterface_.onInitialStreamsSetup) {\n shaka.log.v1('init: calling onInitialStreamsSetup()...');\n this.playerInterface_.onInitialStreamsSetup();\n }\n }.bind(this));\n};\n\n\n/**\n * Gets the current Period the stream is in. This Period may not be initialized\n * yet if canSwitch(period) has not been called yet.\n * @return {shakaExtern.Period}\n */\nshaka.media.StreamingEngine.prototype.getCurrentPeriod = function() {\n var playheadTime = this.playerInterface_.playhead.getTime();\n var needPeriodIndex = this.findPeriodContainingTime_(playheadTime);\n return this.manifest_.periods[needPeriodIndex];\n};\n\n\n/**\n * Gets the Period in which we are currently buffering. This may be different\n * from the Period which contains the Playhead.\n * @return {?shakaExtern.Period}\n */\nshaka.media.StreamingEngine.prototype.getActivePeriod = function() {\n goog.asserts.assert(this.mediaStates_, 'Must be initialized');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var anyMediaState = this.mediaStates_[ContentType.VIDEO] ||\n this.mediaStates_[ContentType.AUDIO];\n return anyMediaState ?\n this.manifest_.periods[anyMediaState.needPeriodIndex] : null;\n};\n\n\n/**\n * Gets a map of all the active streams.\n * @return {!Object.<shaka.util.ManifestParserUtils.ContentType,\n * shakaExtern.Stream>}\n */\nshaka.media.StreamingEngine.prototype.getActiveStreams = function() {\n goog.asserts.assert(this.mediaStates_, 'Must be initialized');\n var MapUtils = shaka.util.MapUtils;\n return MapUtils.map(\n this.mediaStates_, function(state) {\n // Don't tell the caller about trick play streams. If we're in trick\n // play, return the stream we will go back to after we exit trick play.\n return state.restoreStreamAfterTrickPlay || state.stream;\n });\n};\n\n\n/**\n * Notifies StreamingEngine that a new text stream was added to the manifest.\n * This initializes the given stream. This returns a Promise that resolves when\n * the stream has been set up.\n *\n * @param {shakaExtern.Stream} stream\n * @return {!Promise}\n */\nshaka.media.StreamingEngine.prototype.notifyNewTextStream = function(stream) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n // Create empty object first and initialize the fields through\n // [] to allow field names to be expressions.\n /** @type {!Object.<string, shakaExtern.Stream>} */\n var streamsByType = {};\n streamsByType[ContentType.TEXT] = stream;\n return this.initStreams_(streamsByType);\n};\n\n\n/**\n * Set trick play on or off.\n * If trick play is on, related trick play streams will be used when possible.\n * @param {boolean} on\n */\nshaka.media.StreamingEngine.prototype.setTrickPlay = function(on) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var mediaState = this.mediaStates_[ContentType.VIDEO];\n if (!mediaState) return;\n\n var stream = mediaState.stream;\n if (!stream) return;\n\n shaka.log.debug('setTrickPlay', on);\n if (on) {\n var trickModeVideo = stream.trickModeVideo;\n if (!trickModeVideo) return; // Can't engage trick play.\n\n var normalVideo = mediaState.restoreStreamAfterTrickPlay;\n if (normalVideo) return; // Already in trick play.\n\n shaka.log.debug('Engaging trick mode stream', trickModeVideo);\n this.switch(ContentType.VIDEO, trickModeVideo, false);\n mediaState.restoreStreamAfterTrickPlay = stream;\n } else {\n var normalVideo = mediaState.restoreStreamAfterTrickPlay;\n if (!normalVideo) return;\n\n shaka.log.debug('Restoring non-trick-mode stream', normalVideo);\n mediaState.restoreStreamAfterTrickPlay = null;\n this.switch(ContentType.VIDEO, normalVideo, true);\n }\n};\n\n\n/**\n * Switches to the given Stream. |stream| may be from any Variant or any\n * Period.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * |stream|'s content type.\n * @param {shakaExtern.Stream} stream\n * @param {boolean} clearBuffer\n */\nshaka.media.StreamingEngine.prototype.switch = function(\n contentType, stream, clearBuffer) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var mediaState = this.mediaStates_[contentType];\n if (!mediaState && contentType == ContentType.TEXT &&\n this.config_.ignoreTextStreamFailures) {\n this.notifyNewTextStream(stream);\n return;\n }\n goog.asserts.assert(mediaState, 'switch: expected mediaState to exist');\n if (!mediaState) return;\n\n // If we are selecting a stream from a different Period, then we need to\n // handle a Period transition. Simply ignore the given stream, assuming that\n // Player will select the same track in onChooseStreams.\n var periodIndex = this.findPeriodContainingStream_(stream);\n if (clearBuffer && periodIndex != mediaState.needPeriodIndex) {\n shaka.log.debug('switch: switching to stream in another Period; clearing ' +\n 'buffer and changing Periods');\n // handlePeriodTransition_ will be called on the next update because the\n // current Period won't match the playhead Period.\n this.clearAllBuffers_();\n return;\n }\n\n if (mediaState.restoreStreamAfterTrickPlay) {\n shaka.log.debug('switch during trick play mode', stream);\n\n // Already in trick play mode, so stick with trick mode tracks if possible.\n if (stream.trickModeVideo) {\n // Use the trick mode stream, but revert to the new selection later.\n mediaState.restoreStreamAfterTrickPlay = stream;\n stream = stream.trickModeVideo;\n shaka.log.debug('switch found trick play stream', stream);\n } else {\n // No special trick mode video for this stream!\n mediaState.restoreStreamAfterTrickPlay = null;\n shaka.log.debug('switch found no special trick play stream');\n }\n }\n\n if (contentType == ContentType.TEXT) {\n // Mime types are allowed to change for text streams.\n // Reinitialize the text parser.\n var fullMimeType = shaka.util.StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n this.playerInterface_.mediaSourceEngine.reinitText(fullMimeType);\n }\n\n // Ensure the Period is ready.\n var canSwitchRecord = this.canSwitchPeriod_[periodIndex];\n goog.asserts.assert(\n canSwitchRecord && canSwitchRecord.resolved,\n 'switch: expected Period ' + periodIndex + ' to be ready');\n if (!canSwitchRecord || !canSwitchRecord.resolved) return;\n\n // Sanity check. If the Period is ready then the Stream should be ready too.\n canSwitchRecord = this.canSwitchStream_[stream.id];\n goog.asserts.assert(canSwitchRecord && canSwitchRecord.resolved,\n 'switch: expected Stream ' + stream.id + ' to be ready');\n if (!canSwitchRecord || !canSwitchRecord.resolved) return;\n\n if (mediaState.stream == stream) {\n var streamTag = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.debug('switch: Stream ' + streamTag + ' already active');\n return;\n }\n\n mediaState.stream = stream;\n mediaState.needInitSegment = true;\n\n var streamTag = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.debug('switch: switching to Stream ' + streamTag);\n\n if (clearBuffer) {\n if (mediaState.clearingBuffer) {\n // We are already going to clear the buffer, but make sure it is also\n // flushed.\n mediaState.waitingToFlushBuffer = true;\n } else if (mediaState.performingUpdate) {\n // We are performing an update, so we have to wait until it's finished.\n // onUpdate_() will call clearBuffer_() when the update has\n // finished.\n mediaState.waitingToClearBuffer = true;\n mediaState.waitingToFlushBuffer = true;\n } else {\n // Cancel the update timer, if any.\n this.cancelUpdate_(mediaState);\n // Clear right away.\n this.clearBuffer_(mediaState, /* flush */ true);\n }\n }\n};\n\n\n/**\n * Notifies the StreamingEngine that the playhead has moved to a valid time\n * within the presentation timeline.\n */\nshaka.media.StreamingEngine.prototype.seeked = function() {\n goog.asserts.assert(this.mediaStates_, 'Must not be destroyed');\n\n var playheadTime = this.playerInterface_.playhead.getTime();\n var isAllBuffered = Object.keys(this.mediaStates_).every(function(type) {\n return this.playerInterface_.mediaSourceEngine.isBuffered(\n type, playheadTime);\n }.bind(this));\n\n // Only treat as a buffered seek if every media state has a buffer. For\n // example, if we have buffered text but not video, we should still clear\n // every buffer so all media states need the same Period.\n if (isAllBuffered) {\n shaka.log.debug(\n '(all): seeked: buffered seek: playheadTime=' + playheadTime);\n return;\n }\n\n // This was an unbuffered seek (for at least one stream), clear all buffers.\n // Don't clear only some of the buffers because we can become stalled since\n // the media states are waiting for different Periods.\n shaka.log.debug('(all): seeked: unbuffered seek: clearing all buffers');\n this.clearAllBuffers_();\n};\n\n\n/**\n * Clears the buffer for every stream. Unlike clearBuffer_, this will handle\n * cases where a MediaState is performing an update. After this runs, every\n * MediaState will have a pending update.\n * @private\n */\nshaka.media.StreamingEngine.prototype.clearAllBuffers_ = function() {\n for (var type in this.mediaStates_) {\n var mediaState = this.mediaStates_[type];\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n if (mediaState.clearingBuffer) {\n // We're already clearing the buffer, so we don't need to clear the\n // buffer again.\n shaka.log.debug(logPrefix, 'clear: already clearing the buffer');\n continue;\n }\n\n if (mediaState.waitingToClearBuffer) {\n // May not be performing an update, but an update will still happen.\n // See: https://github.com/google/shaka-player/issues/334\n shaka.log.debug(logPrefix, 'clear: already waiting');\n continue;\n }\n\n if (mediaState.performingUpdate) {\n // We are performing an update, so we have to wait until it's finished.\n // onUpdate_() will call clearBuffer_() when the update has\n // finished.\n shaka.log.debug(logPrefix, 'clear: currently updating');\n mediaState.waitingToClearBuffer = true;\n continue;\n }\n\n if (this.playerInterface_.mediaSourceEngine.bufferStart(type) == null) {\n // Nothing buffered.\n shaka.log.debug(logPrefix, 'clear: nothing buffered');\n if (mediaState.updateTimer == null) {\n // Note: an update cycle stops when we buffer to the end of the\n // presentation or Period, or when we raise an error.\n this.scheduleUpdate_(mediaState, 0);\n }\n continue;\n }\n\n // An update may be scheduled, but we can just cancel it and clear the\n // buffer right away. Note: clearBuffer_() will schedule the next update.\n shaka.log.debug(logPrefix, 'clear: handling right now');\n this.cancelUpdate_(mediaState);\n this.clearBuffer_(mediaState, /* flush */ false);\n }\n};\n\n\n/**\n * Initializes the given streams and media states if required. This will\n * schedule updates for the given types.\n *\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType,\n shakaExtern.Stream>} streamsByType\n * @param {number=} opt_resumeAt\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.initStreams_ = function(\n streamsByType, opt_resumeAt) {\n var MapUtils = shaka.util.MapUtils;\n goog.asserts.assert(this.config_,\n 'StreamingEngine configure() must be called before init()!');\n\n // Determine which Period we must buffer.\n var playheadTime = this.playerInterface_.playhead.getTime();\n var needPeriodIndex = this.findPeriodContainingTime_(playheadTime);\n\n // Init MediaSourceEngine.\n var typeConfig = MapUtils.map(streamsByType, function(stream) {\n return shaka.util.StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n });\n\n this.playerInterface_.mediaSourceEngine.init(typeConfig);\n this.setDuration_();\n\n // Setup the initial set of Streams and then begin each update cycle. After\n // startup completes onUpdate_() will set up the remaining Periods.\n var streams = MapUtils.values(streamsByType);\n return this.setupStreams_(streams).then(function() {\n if (this.destroyed_) return;\n\n for (var type in streamsByType) {\n var stream = streamsByType[type];\n if (!this.mediaStates_[type]) {\n this.mediaStates_[type] = {\n stream: stream,\n type: type,\n lastStream: null,\n lastSegmentReference: null,\n restoreStreamAfterTrickPlay: null,\n needInitSegment: true,\n needPeriodIndex: needPeriodIndex,\n endOfStream: false,\n performingUpdate: false,\n updateTimer: null,\n waitingToClearBuffer: false,\n waitingToFlushBuffer: false,\n clearingBuffer: false,\n recovering: false,\n hasError: false,\n resumeAt: opt_resumeAt || 0\n };\n this.scheduleUpdate_(this.mediaStates_[type], 0);\n }\n }\n }.bind(this));\n};\n\n\n/**\n * Sets up the given Period if necessary. Calls onError() if an error\n * occurs.\n *\n * @param {number} periodIndex The Period's index.\n * @return {!Promise} A Promise which is resolved when the given Period is\n * setup.\n * @private\n */\nshaka.media.StreamingEngine.prototype.setupPeriod_ = function(periodIndex) {\n var Functional = shaka.util.Functional;\n var canSwitchRecord = this.canSwitchPeriod_[periodIndex];\n if (canSwitchRecord) {\n shaka.log.debug(\n '(all) Period ' + periodIndex + ' is being or has been set up');\n goog.asserts.assert(canSwitchRecord.promise, 'promise must not be null');\n return canSwitchRecord.promise;\n }\n\n shaka.log.debug('(all) setting up Period ' + periodIndex);\n canSwitchRecord = {\n promise: new shaka.util.PublicPromise(),\n resolved: false\n };\n this.canSwitchPeriod_[periodIndex] = canSwitchRecord;\n\n var streams = this.manifest_.periods[periodIndex].variants\n .map(function(variant) {\n var result = [];\n if (variant.audio)\n result.push(variant.audio);\n if (variant.video)\n result.push(variant.video);\n if (variant.video && variant.video.trickModeVideo)\n result.push(variant.video.trickModeVideo);\n return result;\n })\n .reduce(Functional.collapseArrays, [])\n .filter(Functional.isNotDuplicate);\n\n // Add text streams\n streams.push.apply(streams, this.manifest_.periods[periodIndex].textStreams);\n\n // Serialize Period set up.\n this.setupPeriodPromise_ = this.setupPeriodPromise_.then(function() {\n if (this.destroyed_) return;\n return this.setupStreams_(streams);\n }.bind(this)).then(function() {\n if (this.destroyed_) return;\n this.canSwitchPeriod_[periodIndex].promise.resolve();\n this.canSwitchPeriod_[periodIndex].resolved = true;\n shaka.log.v1('(all) setup Period ' + periodIndex);\n }.bind(this)).catch(function(error) {\n if (this.destroyed_) return;\n this.canSwitchPeriod_[periodIndex].promise.reject();\n delete this.canSwitchPeriod_[periodIndex];\n shaka.log.warning('(all) failed to setup Period ' + periodIndex);\n this.playerInterface_.onError(error);\n // Don't stop other Periods from being set up.\n }.bind(this));\n\n return canSwitchRecord.promise;\n};\n\n\n/**\n * Sets up the given Streams if necessary. Does NOT call onError() if an\n * error occurs.\n *\n * @param {!Array.<!shakaExtern.Stream>} streams\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.setupStreams_ = function(streams) {\n // Make sure that all the streams have unique ids.\n // (Duplicate ids will cause the player to hang).\n var uniqueStreamIds = streams.map(function(s) { return s.id; })\n .filter(shaka.util.Functional.isNotDuplicate);\n\n goog.asserts.assert(uniqueStreamIds.length == streams.length,\n 'streams should have unique ids');\n // Parallelize Stream set up.\n var async = [];\n\n for (var i = 0; i < streams.length; ++i) {\n var stream = streams[i];\n var canSwitchRecord = this.canSwitchStream_[stream.id];\n\n if (canSwitchRecord) {\n shaka.log.debug(\n '(all) Stream ' + stream.id + ' is being or has been set up');\n async.push(canSwitchRecord.promise);\n } else {\n shaka.log.v1('(all) setting up Stream ' + stream.id);\n this.canSwitchStream_[stream.id] = {\n promise: new shaka.util.PublicPromise(),\n resolved: false\n };\n async.push(stream.createSegmentIndex());\n }\n }\n\n return Promise.all(async).then(function() {\n if (this.destroyed_) return;\n\n for (var i = 0; i < streams.length; ++i) {\n var stream = streams[i];\n var canSwitchRecord = this.canSwitchStream_[stream.id];\n if (!canSwitchRecord.resolved) {\n canSwitchRecord.promise.resolve();\n canSwitchRecord.resolved = true;\n shaka.log.v1('(all) setup Stream ' + stream.id);\n }\n }\n }.bind(this)).catch(function(error) {\n if (this.destroyed_) return;\n this.canSwitchStream_[stream.id].promise.reject();\n delete this.canSwitchStream_[stream.id];\n return Promise.reject(error);\n }.bind(this));\n};\n\n\n/**\n * Sets the MediaSource's duration.\n * @private\n */\nshaka.media.StreamingEngine.prototype.setDuration_ = function() {\n var duration = this.manifest_.presentationTimeline.getDuration();\n if (duration < Infinity) {\n this.playerInterface_.mediaSourceEngine.setDuration(duration);\n } else {\n // Not all platforms support infinite durations, so set a finite duration\n // so we can append segments and so the user agent can seek.\n this.playerInterface_.mediaSourceEngine.setDuration(Math.pow(2, 32));\n }\n};\n\n\n/**\n * Called when |mediaState|'s update timer has expired.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @private\n */\nshaka.media.StreamingEngine.prototype.onUpdate_ = function(mediaState) {\n var MapUtils = shaka.util.MapUtils;\n if (this.destroyed_) return;\n\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n // Sanity check.\n goog.asserts.assert(\n !mediaState.performingUpdate && (mediaState.updateTimer != null),\n logPrefix + ' unexpected call to onUpdate_()');\n if (mediaState.performingUpdate || (mediaState.updateTimer == null)) return;\n\n goog.asserts.assert(\n !mediaState.clearingBuffer,\n logPrefix + ' onUpdate_() should not be called when clearing the buffer');\n if (mediaState.clearingBuffer) return;\n\n mediaState.updateTimer = null;\n\n // Handle pending buffer clears.\n if (mediaState.waitingToClearBuffer) {\n // Note: clearBuffer_() will schedule the next update.\n shaka.log.debug(logPrefix, 'skipping update and clearing the buffer');\n this.clearBuffer_(mediaState, mediaState.waitingToFlushBuffer);\n return;\n }\n\n // Update the MediaState.\n try {\n var delay = this.update_(mediaState);\n if (delay != null) {\n this.scheduleUpdate_(mediaState, delay);\n mediaState.hasError = false;\n }\n } catch (error) {\n this.playerInterface_.onError(error);\n return;\n }\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n\n var mediaStates = MapUtils.values(this.mediaStates_);\n\n // Check if we've buffered to the end of the Period.\n this.handlePeriodTransition_(mediaState);\n\n // Check if we've buffered to the end of the presentation.\n if (mediaStates.every(function(ms) { return ms.endOfStream; })) {\n shaka.log.v1(logPrefix, 'calling endOfStream()...');\n this.playerInterface_.mediaSourceEngine.endOfStream().then(function() {\n // If the media segments don't reach the end, then we need to update the\n // timeline duration to match the final media duration to avoid buffering\n // forever at the end.\n var duration = this.playerInterface_.mediaSourceEngine.getDuration();\n this.manifest_.presentationTimeline.setDuration(duration);\n }.bind(this));\n }\n};\n\n\n/**\n * Updates the given MediaState.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @return {?number} The number of seconds to wait until updating again or\n * null if another update does not need to be scheduled.\n * @throws {!shaka.util.Error} if an error occurs.\n * @private\n */\nshaka.media.StreamingEngine.prototype.update_ = function(mediaState) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n // Compute how far we've buffered ahead of the playhead.\n var playheadTime = this.playerInterface_.playhead.getTime();\n\n // Get the next timestamp we need.\n var timeNeeded = this.getTimeNeeded_(mediaState, playheadTime);\n shaka.log.v2(logPrefix, 'timeNeeded=' + timeNeeded);\n mediaState.resumeAt = 0;\n\n var currentPeriodIndex = this.findPeriodContainingStream_(mediaState.stream);\n var needPeriodIndex = this.findPeriodContainingTime_(timeNeeded);\n\n // Get the amount of content we have buffered, accounting for drift. This\n // is only used to determine if we have meet the buffering goal. This should\n // be the same way that PlayheadObserver uses.\n var bufferedAhead = this.playerInterface_.mediaSourceEngine.bufferedAheadOf(\n mediaState.type, playheadTime);\n\n shaka.log.v2(logPrefix,\n 'update_:',\n 'playheadTime=' + playheadTime,\n 'bufferedAhead=' + bufferedAhead);\n\n var bufferingGoal = this.getBufferingGoal_();\n\n // Check if we've buffered to the end of the presentation.\n if (timeNeeded >= this.manifest_.presentationTimeline.getDuration()) {\n // We shouldn't rebuffer if the playhead is close to the end of the\n // presentation.\n shaka.log.debug(logPrefix, 'buffered to end of presentation');\n mediaState.endOfStream = true;\n return null;\n }\n mediaState.endOfStream = false;\n\n // Check if we've buffered to the end of the Period. This should be done\n // before checking segment availability because the new Period may become\n // available once it's switched to. Note that we don't use the non-existence\n // of SegmentReferences as an indicator to determine Period boundaries\n // because SegmentIndexes can provide SegmentReferences outside its Period.\n mediaState.needPeriodIndex = needPeriodIndex;\n if (needPeriodIndex != currentPeriodIndex) {\n shaka.log.debug(logPrefix,\n 'need Period ' + needPeriodIndex,\n 'playheadTime=' + playheadTime,\n 'timeNeeded=' + timeNeeded,\n 'currentPeriodIndex=' + currentPeriodIndex);\n return null;\n }\n\n // If we've buffered to the buffering goal then schedule an update.\n if (bufferedAhead >= bufferingGoal) {\n shaka.log.v2(logPrefix, 'buffering goal met');\n\n // Do not try to predict the next update. Just poll twice every second.\n // The playback rate can change at any time, so any prediction we make now\n // could be terribly invalid soon.\n return 0.5;\n }\n\n var bufferEnd =\n this.playerInterface_.mediaSourceEngine.bufferEnd(mediaState.type);\n var reference = this.getSegmentReferenceNeeded_(\n mediaState, playheadTime, bufferEnd, currentPeriodIndex);\n if (!reference) {\n // The segment could not be found, does not exist, or is not available. In\n // any case just try again... if the manifest is incomplete or is not being\n // updated then we'll idle forever; otherwise, we'll end up getting a\n // SegmentReference eventually.\n return 1;\n }\n\n this.fetchAndAppend_(mediaState, playheadTime, currentPeriodIndex, reference);\n return null;\n};\n\n\n/**\n * Computes buffering goal.\n *\n * @return {number}\n * @private\n */\nshaka.media.StreamingEngine.prototype.getBufferingGoal_ = function() {\n goog.asserts.assert(this.manifest_, 'manifest_ should not be null');\n goog.asserts.assert(this.config_, 'config_ should not be null');\n\n var rebufferingGoal = shaka.util.StreamUtils.getRebufferingGoal(\n this.manifest_, this.config_, this.bufferingGoalScale_);\n\n return Math.max(\n rebufferingGoal,\n this.bufferingGoalScale_ * this.config_.bufferingGoal);\n};\n\n\n/**\n * Gets the next timestamp needed. Returns the playhead's position if the\n * buffer is empty; otherwise, returns the time at which the last segment\n * appended ends.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @return {number} The next timestamp needed.\n * @throws {!shaka.util.Error} if the buffer is inconsistent with our\n * expectations.\n * @private\n */\nshaka.media.StreamingEngine.prototype.getTimeNeeded_ = function(\n mediaState, playheadTime) {\n // Get the next timestamp we need. We must use |lastSegmentReference|\n // to determine this and not the actual buffer for two reasons:\n // 1. actual segments end slightly before their advertised end times, so\n // the next timestamp we need is actually larger than |bufferEnd|; and\n // 2. there may be drift (the timestamps in the segments are ahead/behind\n // of the timestamps in the manifest), but we need drift free times when\n // comparing times against presentation and Period boundaries.\n if (!mediaState.lastStream || !mediaState.lastSegmentReference) {\n return Math.max(playheadTime, mediaState.resumeAt);\n }\n\n var lastPeriodIndex =\n this.findPeriodContainingStream_(mediaState.lastStream);\n var lastPeriod = this.manifest_.periods[lastPeriodIndex];\n return lastPeriod.startTime + mediaState.lastSegmentReference.endTime;\n};\n\n\n/**\n * Gets the SegmentReference of the next segment needed.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @param {?number} bufferEnd\n * @param {number} currentPeriodIndex\n * @return {shaka.media.SegmentReference} The SegmentReference of the\n * next segment needed, or null if a segment could not be found, does not\n * exist, or is not available.\n * @private\n */\nshaka.media.StreamingEngine.prototype.getSegmentReferenceNeeded_ = function(\n mediaState, playheadTime, bufferEnd, currentPeriodIndex) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n if (mediaState.lastSegmentReference &&\n mediaState.stream == mediaState.lastStream) {\n // Something is buffered from the same Stream.\n var position = mediaState.lastSegmentReference.position + 1;\n shaka.log.v2(logPrefix, 'next position known:', 'position=' + position);\n\n return this.getSegmentReferenceIfAvailable_(\n mediaState, currentPeriodIndex, position);\n }\n\n var position;\n\n if (mediaState.lastSegmentReference) {\n // Something is buffered from another Stream.\n goog.asserts.assert(mediaState.lastStream, 'lastStream should not be null');\n shaka.log.v1(logPrefix, 'next position unknown: another Stream buffered');\n var lastPeriodIndex =\n this.findPeriodContainingStream_(mediaState.lastStream);\n var lastPeriod = this.manifest_.periods[lastPeriodIndex];\n position = this.lookupSegmentPosition_(\n mediaState,\n lastPeriod.startTime + mediaState.lastSegmentReference.endTime,\n currentPeriodIndex);\n } else {\n // Either nothing is buffered, or we have cleared part of the buffer. If\n // we still have some buffered, use that time to find the segment, otherwise\n // start at the playhead time.\n goog.asserts.assert(!mediaState.lastStream, 'lastStream should be null');\n shaka.log.v1(logPrefix, 'next position unknown: nothing buffered');\n position = this.lookupSegmentPosition_(\n mediaState, bufferEnd || playheadTime, currentPeriodIndex);\n }\n\n if (position == null)\n return null;\n\n var reference = null;\n if (bufferEnd == null) {\n // If there's positive drift then we need to get the previous segment;\n // however, we don't actually know how much drift there is, so we must\n // unconditionally get the previous segment. If it turns out that there's\n // non-positive drift then we'll just end up buffering beind the playhead a\n // little more than we needed.\n var optimalPosition = Math.max(0, position - 1);\n reference = this.getSegmentReferenceIfAvailable_(\n mediaState, currentPeriodIndex, optimalPosition);\n }\n return reference ||\n this.getSegmentReferenceIfAvailable_(\n mediaState, currentPeriodIndex, position);\n};\n\n\n/**\n * Looks up the position of the segment containing the given timestamp.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} presentationTime The timestamp needed, relative to the\n * start of the presentation.\n * @param {number} currentPeriodIndex\n * @return {?number} A segment position, or null if a segment was not be found.\n * @private\n */\nshaka.media.StreamingEngine.prototype.lookupSegmentPosition_ = function(\n mediaState, presentationTime, currentPeriodIndex) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n shaka.log.debug(logPrefix,\n 'looking up segment:',\n 'presentationTime=' + presentationTime,\n 'currentPeriod.startTime=' + currentPeriod.startTime);\n\n var lookupTime = Math.max(0, presentationTime - currentPeriod.startTime);\n var position = mediaState.stream.findSegmentPosition(lookupTime);\n\n if (position == null) {\n shaka.log.warning(logPrefix,\n 'cannot find segment:',\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'lookupTime=' + lookupTime);\n }\n\n return position;\n};\n\n\n/**\n * Gets the SegmentReference at the given position if it's available.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} currentPeriodIndex\n * @param {number} position\n * @return {shaka.media.SegmentReference}\n *\n * @private\n */\nshaka.media.StreamingEngine.prototype.getSegmentReferenceIfAvailable_ =\n function(mediaState, currentPeriodIndex, position) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n var reference = mediaState.stream.getSegmentReference(position);\n if (!reference) {\n shaka.log.v1(logPrefix,\n 'segment does not exist:',\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'position=' + position);\n return null;\n }\n\n var timeline = this.manifest_.presentationTimeline;\n var availabilityStart = timeline.getSegmentAvailabilityStart();\n var availabilityEnd = timeline.getSegmentAvailabilityEnd();\n\n if ((currentPeriod.startTime + reference.endTime < availabilityStart) ||\n (currentPeriod.startTime + reference.startTime > availabilityEnd)) {\n shaka.log.v2(logPrefix,\n 'segment is not available:',\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'reference.startTime=' + reference.startTime,\n 'reference.endTime=' + reference.endTime,\n 'availabilityStart=' + availabilityStart,\n 'availabilityEnd=' + availabilityEnd);\n return null;\n }\n\n return reference;\n};\n\n\n/**\n * Fetches and appends the given segment; sets up the given MediaState's\n * associated SourceBuffer and evicts segments if either are required\n * beforehand. Schedules another update after completing successfully.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @param {number} currentPeriodIndex The index of the current Period.\n * @param {!shaka.media.SegmentReference} reference\n * @private\n */\nshaka.media.StreamingEngine.prototype.fetchAndAppend_ = function(\n mediaState, playheadTime, currentPeriodIndex, reference) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n shaka.log.v1(logPrefix,\n 'fetchAndAppend_:',\n 'playheadTime=' + playheadTime,\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'reference.position=' + reference.position,\n 'reference.startTime=' + reference.startTime,\n 'reference.endTime=' + reference.endTime);\n\n // Subtlety: The playhead may move while asynchronous update operations are\n // in progress, so we should avoid calling playhead.getTime() in any\n // callbacks. Furthermore, switch() may be called at any time, so we should\n // also avoid using mediaState.stream or mediaState.needInitSegment in any\n // callbacks too.\n var stream = mediaState.stream;\n\n // Compute the append window end.\n var followingPeriod = this.manifest_.periods[currentPeriodIndex + 1];\n var appendWindowEnd = null;\n if (followingPeriod) {\n appendWindowEnd = followingPeriod.startTime;\n } else {\n appendWindowEnd = this.manifest_.presentationTimeline.getDuration();\n }\n goog.asserts.assert(\n (appendWindowEnd == null) || (reference.startTime <= appendWindowEnd),\n logPrefix + ' segment should start before append window end');\n\n var initSourceBuffer =\n this.initSourceBuffer_(mediaState, currentPeriodIndex, appendWindowEnd);\n\n mediaState.performingUpdate = true;\n\n // We may set |needInitSegment| to true in switch(), so set it to false here,\n // since we want it to remain true if switch() is called.\n mediaState.needInitSegment = false;\n\n shaka.log.v2(logPrefix, 'fetching segment');\n var fetchSegment = this.fetch_(reference);\n\n Promise.all([initSourceBuffer, fetchSegment]).then(function(results) {\n if (this.destroyed_ || this.fatalError_) return;\n return this.append_(mediaState,\n playheadTime,\n currentPeriod,\n stream,\n reference,\n results[1]);\n }.bind(this)).then(function() {\n if (this.destroyed_ || this.fatalError_) return;\n\n mediaState.performingUpdate = false;\n mediaState.recovering = false;\n\n if (!mediaState.waitingToClearBuffer)\n this.playerInterface_.onSegmentAppended();\n\n // Update right away.\n this.scheduleUpdate_(mediaState, 0);\n\n // Subtlety: handleStartup_() calls onStartupComplete() which may call\n // switch() or seeked(), so we must schedule an update beforehand so\n // |updateTimer| is set.\n this.handleStartup_(mediaState, stream);\n\n shaka.log.v1(logPrefix, 'finished fetch and append');\n }.bind(this)).catch(function(error) {\n if (this.destroyed_ || this.fatalError_) return;\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Should only receive a Shaka error');\n\n mediaState.performingUpdate = false;\n\n if (this.manifest_.presentationTimeline.isLive() &&\n this.config_.infiniteRetriesForLiveStreams &&\n (error.code == shaka.util.Error.Code.BAD_HTTP_STATUS ||\n error.code == shaka.util.Error.Code.HTTP_ERROR ||\n error.code == shaka.util.Error.Code.TIMEOUT)) {\n this.handleNetworkError_(mediaState, error);\n } else if (error.code == shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR) {\n this.handleQuotaExceeded_(mediaState, error);\n } else {\n shaka.log.error(logPrefix, 'failed fetch and append: code=' + error.code);\n if (mediaState.type == ContentType.TEXT &&\n this.config_.ignoreTextStreamFailures) {\n shaka.log.warning(logPrefix,\n 'Text stream failed to parse. Proceeding without it.');\n delete this.mediaStates_[ContentType.TEXT];\n } else {\n mediaState.hasError = true;\n error.severity = shaka.util.Error.Severity.CRITICAL;\n this.playerInterface_.onError(error);\n }\n }\n }.bind(this));\n};\n\n\n/**\n * Handles a network error.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {!shaka.util.Error} error\n * @private\n */\nshaka.media.StreamingEngine.prototype.handleNetworkError_ = function(\n mediaState, error) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n if (mediaState.type == ContentType.TEXT &&\n this.config_.ignoreTextStreamFailures &&\n error.code == shaka.util.Error.Code.BAD_HTTP_STATUS) {\n shaka.log.warning(logPrefix,\n 'Text stream failed to download. Proceeding without it.');\n delete this.mediaStates_[ContentType.TEXT];\n } else {\n error.severity = shaka.util.Error.Severity.RECOVERABLE;\n this.playerInterface_.onError(error);\n\n shaka.log.warning(logPrefix, 'Network error. Retrying...');\n this.scheduleUpdate_(mediaState, 4);\n }\n};\n\n\n/**\n * Handles a QUOTA_EXCEEDED_ERROR.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {!shaka.util.Error} error\n * @private\n */\nshaka.media.StreamingEngine.prototype.handleQuotaExceeded_ = function(\n mediaState, error) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n // The segment cannot fit into the SourceBuffer. Ideally, MediaSource would\n // have evicted old data to accommodate the segment; however, it may have\n // failed to do this if the segment is very large, or if it could not find\n // a suitable time range to remove.\n //\n // We can overcome the latter by trying to append the segment again;\n // however, to avoid continuous QuotaExceededErrors we must reduce the size\n // of the buffer going forward.\n //\n // If we've recently reduced the buffering goals, wait until the stream\n // which caused the first QuotaExceededError recovers. Doing this ensures\n // we don't reduce the buffering goals too quickly.\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n var mediaStates = shaka.util.MapUtils.values(this.mediaStates_);\n var waitingForAnotherStreamToRecover = mediaStates.some(function(ms) {\n return ms != mediaState && ms.recovering;\n });\n\n if (!waitingForAnotherStreamToRecover) {\n // Reduction schedule: 80%, 60%, 40%, 20%, 16%, 12%, 8%, 4%, fail.\n // Note: percentages are used for comparisons to avoid rounding errors.\n var percentBefore = Math.round(100 * this.bufferingGoalScale_);\n if (percentBefore > 20) {\n this.bufferingGoalScale_ -= 0.2;\n } else if (percentBefore > 4) {\n this.bufferingGoalScale_ -= 0.04;\n } else {\n shaka.log.error(\n logPrefix, 'MediaSource threw QuotaExceededError too many times');\n mediaState.hasError = true;\n this.fatalError_ = true;\n this.playerInterface_.onError(error);\n return;\n }\n var percentAfter = Math.round(100 * this.bufferingGoalScale_);\n shaka.log.warning(\n logPrefix,\n 'MediaSource threw QuotaExceededError:',\n 'reducing buffering goals by ' + (100 - percentAfter) + '%');\n mediaState.recovering = true;\n } else {\n shaka.log.debug(\n logPrefix,\n 'MediaSource threw QuotaExceededError:',\n 'waiting for another stream to recover...');\n }\n\n // QuotaExceededError gets thrown if evication didn't help to make room\n // for a segment. We want to wait for a while (4 seconds is just an\n // arbitrary number) before updating to give the playhead a chance to\n // advance, so we don't immidiately throw again.\n this.scheduleUpdate_(mediaState, 4);\n};\n\n\n/**\n * Sets the given MediaState's associated SourceBuffer's timestamp offset and\n * init segment if either are required. If an error occurs then neither the\n * timestamp offset or init segment are unset, since another call to switch()\n * will end up superseding them.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} currentPeriodIndex\n * @param {?number} appendWindowEnd\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.initSourceBuffer_ = function(\n mediaState, currentPeriodIndex, appendWindowEnd) {\n if (!mediaState.needInitSegment)\n return Promise.resolve();\n\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n // If we need an init segment then the Stream switched, so we've either\n // changed bitrates, Periods, or both. If we've changed Periods then we must\n // set a new timestamp offset and append window end. Note that by setting\n // these values here, we avoid having to co-ordinate ongoing updates, which\n // we would have to do if we instead set them in switch().\n var timestampOffset =\n currentPeriod.startTime - mediaState.stream.presentationTimeOffset;\n shaka.log.v1(logPrefix, 'setting timestamp offset to ' + timestampOffset);\n shaka.log.v1(logPrefix, 'setting append window end to ' + appendWindowEnd);\n var setStreamProperties =\n this.playerInterface_.mediaSourceEngine.setStreamProperties(\n mediaState.type, timestampOffset, appendWindowEnd);\n\n if (!mediaState.stream.initSegmentReference) {\n // The Stream is self initializing.\n return setStreamProperties;\n }\n\n shaka.log.v1(logPrefix, 'fetching init segment');\n var fetchInit = this.fetch_(mediaState.stream.initSegmentReference);\n var appendInit = fetchInit.then(function(initSegment) {\n if (this.destroyed_) return;\n shaka.log.v1(logPrefix, 'appending init segment');\n\n return this.playerInterface_.mediaSourceEngine.appendBuffer(\n mediaState.type, initSegment, null /* startTime */, null /* endTime */);\n }.bind(this)).catch(function(error) {\n mediaState.needInitSegment = true;\n return Promise.reject(error);\n });\n\n return Promise.all([setStreamProperties, appendInit]);\n};\n\n\n/**\n * Appends the given segment and evicts content if required to append.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Stream} stream\n * @param {!shaka.media.SegmentReference} reference\n * @param {!ArrayBuffer} segment\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.append_ = function(\n mediaState, playheadTime, period, stream, reference, segment) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n if (stream.containsEmsgBoxes) {\n new shaka.util.Mp4Parser()\n .fullBox('emsg', this.parseEMSG_.bind(this, period, reference))\n .parse(segment);\n }\n\n return this.evict_(mediaState, playheadTime).then(function() {\n if (this.destroyed_) return;\n shaka.log.v1(logPrefix, 'appending media segment');\n\n return this.playerInterface_.mediaSourceEngine.appendBuffer(\n mediaState.type, segment, reference.startTime + period.startTime,\n reference.endTime + period.startTime);\n }.bind(this)).then(function() {\n if (this.destroyed_) return;\n shaka.log.v2(logPrefix, 'appended media segment');\n\n // We must use |stream| because switch() may have been called.\n mediaState.lastStream = stream;\n mediaState.lastSegmentReference = reference;\n\n return Promise.resolve();\n }.bind(this));\n};\n\n\n/**\n * Parse the EMSG box from a MP4 container.\n *\n * @param {!shakaExtern.Period} period\n * @param {!shaka.media.SegmentReference} reference\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @private\n */\nshaka.media.StreamingEngine.prototype.parseEMSG_ = function(\n period, reference, box) {\n\n var schemeId = box.reader.readTerminatedString();\n // read rest of the data and dispatch event to the application\n var value = box.reader.readTerminatedString();\n var timescale = box.reader.readUint32();\n var presentationTimeDelta = box.reader.readUint32();\n var eventDuration = box.reader.readUint32();\n var id = box.reader.readUint32();\n var messageData = box.reader.readBytes(\n box.reader.getLength() - box.reader.getPosition());\n\n var startTime = period.startTime + reference.startTime +\n (presentationTimeDelta / timescale);\n\n // See DASH sec. 5.10.4.1\n // A special scheme in DASH used to signal manifest updates.\n if (schemeId == 'urn:mpeg:dash:event:2012') {\n this.playerInterface_.onManifestUpdate();\n } else {\n /** @type {shakaExtern.EmsgInfo} */\n var emsg = {\n startTime: startTime,\n endTime: startTime + (eventDuration / timescale),\n schemeIdUri: schemeId,\n value: value,\n timescale: timescale,\n presentationTimeDelta: presentationTimeDelta,\n eventDuration: eventDuration,\n id: id,\n messageData: messageData\n };\n\n var event = new shaka.util.FakeEvent('emsg', {'detail': emsg});\n this.playerInterface_.onEvent(event);\n }\n};\n\n\n/**\n * Evicts media to meet the max buffer behind limit.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.evict_ = function(\n mediaState, playheadTime) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.v2(logPrefix, 'checking buffer length');\n\n var startTime =\n this.playerInterface_.mediaSourceEngine.bufferStart(mediaState.type);\n if (startTime == null) {\n shaka.log.v2(logPrefix,\n 'buffer behind okay because nothing buffered:',\n 'playheadTime=' + playheadTime,\n 'bufferBehind=' + this.config_.bufferBehind);\n return Promise.resolve();\n }\n var bufferedBehind = playheadTime - startTime;\n\n var overflow = bufferedBehind - this.config_.bufferBehind;\n if (overflow <= 0) {\n shaka.log.v2(logPrefix,\n 'buffer behind okay:',\n 'playheadTime=' + playheadTime,\n 'bufferedBehind=' + bufferedBehind,\n 'bufferBehind=' + this.config_.bufferBehind,\n 'underflow=' + (-overflow));\n return Promise.resolve();\n }\n\n shaka.log.v1(logPrefix,\n 'buffer behind too large:',\n 'playheadTime=' + playheadTime,\n 'bufferedBehind=' + bufferedBehind,\n 'bufferBehind=' + this.config_.bufferBehind,\n 'overflow=' + overflow);\n\n return this.playerInterface_.mediaSourceEngine.remove(\n mediaState.type, startTime, startTime + overflow).then(function() {\n if (this.destroyed_) return;\n shaka.log.v1(logPrefix, 'evicted ' + overflow + ' seconds');\n }.bind(this));\n};\n\n\n/**\n * Sets up all known Periods when startup completes; otherwise, does nothing.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState The last\n * MediaState updated.\n * @param {shakaExtern.Stream} stream\n * @private\n */\nshaka.media.StreamingEngine.prototype.handleStartup_ = function(\n mediaState, stream) {\n var Functional = shaka.util.Functional;\n var MapUtils = shaka.util.MapUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (this.startupComplete_)\n return;\n\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n var mediaStates = MapUtils.values(this.mediaStates_);\n this.startupComplete_ = mediaStates.every(function(ms) {\n // Startup completes once we have buffered at least one segment from each\n // MediaState, not counting text.\n if (ms.type == ContentType.TEXT) return true;\n return !ms.waitingToClearBuffer &&\n !ms.clearingBuffer &&\n ms.lastSegmentReference;\n });\n\n if (!this.startupComplete_)\n return;\n\n shaka.log.debug(logPrefix, 'startup complete');\n\n // We must use |stream| because switch() may have been called.\n var currentPeriodIndex = this.findPeriodContainingStream_(stream);\n\n goog.asserts.assert(\n mediaStates.every(function(ms) {\n // It is possible for one stream (usually text) to buffer the whole\n // Period and need the next one.\n return ms.needPeriodIndex == currentPeriodIndex ||\n ms.needPeriodIndex == currentPeriodIndex + 1;\n }),\n logPrefix + ' expected all MediaStates to need same Period');\n\n // Setup the current Period if necessary, which is likely since the current\n // Period is probably the initial one.\n if (!this.canSwitchPeriod_[currentPeriodIndex]) {\n this.setupPeriod_(currentPeriodIndex).then(function() {\n shaka.log.v1(logPrefix, 'calling onCanSwitch()...');\n this.playerInterface_.onCanSwitch();\n }.bind(this)).catch(Functional.noop);\n }\n\n // Now setup all known Periods.\n for (var i = 0; i < this.manifest_.periods.length; ++i) {\n this.setupPeriod_(i).catch(Functional.noop);\n }\n\n if (this.playerInterface_.onStartupComplete) {\n shaka.log.v1(logPrefix, 'calling onStartupComplete()...');\n this.playerInterface_.onStartupComplete();\n }\n};\n\n\n/**\n * Calls onChooseStreams() when necessary.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState The last\n * MediaState updated.\n * @private\n */\nshaka.media.StreamingEngine.prototype.handlePeriodTransition_ = function(\n mediaState) {\n var Functional = shaka.util.Functional;\n var MapUtils = shaka.util.MapUtils;\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var currentPeriodIndex = this.findPeriodContainingStream_(mediaState.stream);\n if (mediaState.needPeriodIndex == currentPeriodIndex)\n return;\n\n var needPeriodIndex = mediaState.needPeriodIndex;\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n var mediaStates = MapUtils.values(this.mediaStates_);\n\n // For a Period transition to work, all media states must need the same\n // Period. If a stream needs a different Period than the one it currently\n // has, it will try to transition or stop updates assuming that another stream\n // will handle it. This only works when all streams either need the same\n // Period or are still performing updates.\n goog.asserts.assert(\n mediaStates.every(function(ms) {\n return ms.needPeriodIndex == needPeriodIndex || ms.hasError ||\n !shaka.media.StreamingEngine.isIdle_(ms);\n }),\n 'All MediaStates should need the same Period or be performing updates.');\n\n // Only call onChooseStreams() when all MediaStates need the same Period.\n var needSamePeriod = mediaStates.every(function(ms) {\n return ms.needPeriodIndex == needPeriodIndex;\n });\n if (!needSamePeriod) {\n shaka.log.debug(\n logPrefix, 'not all MediaStates need Period ' + needPeriodIndex);\n return;\n }\n\n // Only call onChooseStreams() once per Period transition.\n var allAreIdle = mediaStates.every(shaka.media.StreamingEngine.isIdle_);\n if (!allAreIdle) {\n shaka.log.debug(\n logPrefix,\n 'all MediaStates need Period ' + needPeriodIndex + ', ' +\n 'but not all MediaStates are idle');\n return;\n }\n\n shaka.log.debug(logPrefix, 'all need Period ' + needPeriodIndex);\n\n // Ensure the Period which we need to buffer is setup and then call\n // onChooseStreams().\n this.setupPeriod_(needPeriodIndex).then(function() {\n if (this.destroyed_) return;\n\n // If we seek during a Period transition, we can start another transition.\n // So we need to verify that:\n // - We are still in need of the same Period.\n // - All streams are still idle.\n // - The current stream is not in the needed Period (another transition\n // handled it).\n var allReady = mediaStates.every(function(ms) {\n var isIdle = shaka.media.StreamingEngine.isIdle_(ms);\n var currentPeriodIndex = this.findPeriodContainingStream_(ms.stream);\n return isIdle && ms.needPeriodIndex == needPeriodIndex &&\n currentPeriodIndex != needPeriodIndex;\n }.bind(this));\n if (!allReady) {\n // TODO: Write unit tests for this case.\n shaka.log.debug(logPrefix, 'ignoring transition to Period',\n needPeriodIndex, 'since another is happening');\n return;\n }\n\n var needPeriod = this.manifest_.periods[needPeriodIndex];\n\n shaka.log.v1(logPrefix, 'calling onChooseStreams()...');\n var streamsByType = this.playerInterface_.onChooseStreams(needPeriod);\n\n // Vet |streamsByType| before switching.\n for (var type in this.mediaStates_) {\n if (streamsByType[type] || type == ContentType.TEXT) continue;\n\n shaka.log.error(logPrefix,\n 'invalid Streams chosen: missing ' + type + ' Stream');\n this.playerInterface_.onError(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STREAMING,\n shaka.util.Error.Code.INVALID_STREAMS_CHOSEN));\n return;\n }\n\n for (var type in streamsByType) {\n if (this.mediaStates_[type]) continue;\n if (type == ContentType.TEXT) {\n // initStreams_ will switch streams and schedule an update.\n this.initStreams_(\n {text: streamsByType[ContentType.TEXT]}, needPeriod.startTime);\n delete streamsByType[type];\n continue;\n }\n\n shaka.log.error(logPrefix,\n 'invalid Streams chosen: unusable ' + type + ' Stream');\n this.playerInterface_.onError(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STREAMING,\n shaka.util.Error.Code.INVALID_STREAMS_CHOSEN));\n return;\n }\n\n for (var type in this.mediaStates_) {\n var stream = streamsByType[type];\n if (stream) {\n this.switch(type, stream, /* clearBuffer */ false);\n this.scheduleUpdate_(this.mediaStates_[type], 0);\n } else {\n goog.asserts.assert(type == ContentType.TEXT, 'Invalid streams chosen');\n delete this.mediaStates_[type];\n }\n }\n\n // We've already set up the Period so call onCanSwitch() right now.\n shaka.log.v1(logPrefix, 'calling onCanSwitch()...');\n this.playerInterface_.onCanSwitch();\n }.bind(this)).catch(Functional.noop);\n};\n\n\n/**\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @return {boolean} True if the given MediaState is idle; otherwise, return\n * false.\n * @private\n */\nshaka.media.StreamingEngine.isIdle_ = function(mediaState) {\n return !mediaState.performingUpdate &&\n (mediaState.updateTimer == null) &&\n !mediaState.waitingToClearBuffer &&\n !mediaState.clearingBuffer;\n};\n\n\n/**\n * @param {number} time The time, in seconds, relative to the start of the\n * presentation.\n * @return {number} The index of the Period which starts after |time|\n * @private\n */\nshaka.media.StreamingEngine.prototype.findPeriodContainingTime_ = function(\n time) {\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n return shaka.util.StreamUtils.findPeriodContainingTime(this.manifest_, time);\n};\n\n\n/**\n * @param {!shakaExtern.Stream} stream\n * @return {number} The index of the Period which contains |stream|, or -1 if\n * no Period contains |stream|.\n * @private\n */\nshaka.media.StreamingEngine.prototype.findPeriodContainingStream_ = function(\n stream) {\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n return shaka.util.StreamUtils.findPeriodContainingStream(\n this.manifest_, stream);\n};\n\n\n/**\n * Fetches the given segment.\n *\n * @param {(!shaka.media.InitSegmentReference|!shaka.media.SegmentReference)}\n * reference\n *\n * @return {!Promise.<!ArrayBuffer>}\n * @private\n */\nshaka.media.StreamingEngine.prototype.fetch_ = function(reference) {\n var requestType = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n var request = shaka.net.NetworkingEngine.makeRequest(\n reference.getUris(), this.config_.retryParameters);\n\n // Set Range header. Note that some web servers don't accept Range headers,\n // so don't set one if it's not strictly required.\n if ((reference.startByte != 0) || (reference.endByte != null)) {\n var range = 'bytes=' + reference.startByte + '-';\n if (reference.endByte != null) range += reference.endByte;\n request.headers['Range'] = range;\n }\n\n shaka.log.v2('fetching: reference=' + reference);\n var p = this.playerInterface_.netEngine.request(requestType, request);\n return p.then(function(response) {\n return response.data;\n });\n};\n\n\n/**\n * Clears the buffer and schedules another update.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {boolean} flush\n * @private\n */\nshaka.media.StreamingEngine.prototype.clearBuffer_ =\n function(mediaState, flush) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n goog.asserts.assert(\n !mediaState.performingUpdate && (mediaState.updateTimer == null),\n logPrefix + ' unexpected call to clearBuffer_()');\n\n mediaState.waitingToClearBuffer = false;\n mediaState.waitingToFlushBuffer = false;\n mediaState.clearingBuffer = true;\n\n shaka.log.debug(logPrefix, 'clearing buffer');\n var p = this.playerInterface_.mediaSourceEngine.clear(mediaState.type);\n p.then(function() {\n if (!this.destroyed_ && flush) {\n return this.playerInterface_.mediaSourceEngine.flush(mediaState.type);\n }\n }.bind(this)).then(function() {\n if (this.destroyed_) return;\n shaka.log.debug(logPrefix, 'cleared buffer');\n mediaState.lastStream = null;\n mediaState.lastSegmentReference = null;\n mediaState.clearingBuffer = false;\n mediaState.endOfStream = false;\n this.scheduleUpdate_(mediaState, 0);\n }.bind(this));\n};\n\n\n/**\n * Schedules |mediaState|'s next update.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} delay The delay in seconds.\n * @private\n */\nshaka.media.StreamingEngine.prototype.scheduleUpdate_ = function(\n mediaState, delay) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.v2(logPrefix, 'updating in ' + delay + ' seconds');\n goog.asserts.assert(mediaState.updateTimer == null,\n logPrefix + ' did not expect update to be scheduled');\n mediaState.updateTimer = window.setTimeout(\n this.onUpdate_.bind(this, mediaState), delay * 1000);\n};\n\n\n/**\n * Cancels |mediaState|'s next update if one exists.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @private\n */\nshaka.media.StreamingEngine.prototype.cancelUpdate_ = function(mediaState) {\n if (mediaState.updateTimer != null) {\n window.clearTimeout(mediaState.updateTimer);\n mediaState.updateTimer = null;\n }\n};\n\n\n/**\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @return {string} A log prefix of the form ($CONTENT_TYPE:$STREAM_ID), e.g.,\n * \"(audio:5)\" or \"(video:hd)\".\n * @private\n */\nshaka.media.StreamingEngine.logPrefix_ = function(mediaState) {\n return '(' + mediaState.type + ':' + mediaState.stream.id + ')';\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/streaming_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.net.HttpPlugin');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\n\n\n/**\n * @namespace\n * @summary A networking plugin to handle http and https URIs via XHR.\n * @param {string} uri\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.net.HttpPlugin = function(uri, request) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n\n xhr.open(request.method, uri, true);\n xhr.responseType = 'arraybuffer';\n xhr.timeout = request.retryParameters.timeout;\n xhr.withCredentials = request.allowCrossSiteCredentials;\n\n xhr.onload = function(event) {\n var target = event.target;\n goog.asserts.assert(target, 'XHR onload has no target!');\n\n var headers = target.getAllResponseHeaders().split('\\r\\n').reduce(\n function(all, part) {\n var header = part.split(': ');\n all[header[0].toLowerCase()] = header.slice(1).join(': ');\n return all;\n },\n {});\n if (target.status >= 200 && target.status <= 299 &&\n target.status != 202) {\n // Most 2xx HTTP codes are success cases.\n if (target.responseURL) {\n uri = target.responseURL;\n }\n /** @type {shakaExtern.Response} */\n var response = {\n uri: uri,\n data: target.response,\n headers: headers,\n fromCache: !!headers['x-shaka-from-cache']\n };\n resolve(response);\n } else {\n var responseText = null;\n try {\n responseText = shaka.util.StringUtils.fromBytesAutoDetect(\n target.response);\n } catch (exception) {}\n shaka.log.debug('HTTP error text:', responseText);\n\n var severity = target.status == 401 || target.status == 403 ?\n shaka.util.Error.Severity.CRITICAL :\n shaka.util.Error.Severity.RECOVERABLE;\n reject(new shaka.util.Error(\n severity,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.BAD_HTTP_STATUS,\n uri,\n target.status,\n responseText,\n headers));\n }\n };\n xhr.onerror = function(event) {\n reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.HTTP_ERROR,\n uri));\n };\n xhr.ontimeout = function(event) {\n reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.TIMEOUT,\n uri));\n };\n\n for (var k in request.headers) {\n xhr.setRequestHeader(k, request.headers[k]);\n }\n xhr.send(request.body);\n });\n};\n\n\nshaka.net.NetworkingEngine.registerScheme('http', shaka.net.HttpPlugin);\nshaka.net.NetworkingEngine.registerScheme('https', shaka.net.HttpPlugin);\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/net/http_plugin.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.DBEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.offline.IStorageEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * This manages all operations on an IndexedDB. This wraps all operations\n * in Promises. All Promises will resolve once the transaction has completed.\n * Depending on the browser, this may or may not be after the data is flushed\n * to disk. https://goo.gl/zMOeJc\n *\n * @struct\n * @constructor\n * @implements {shaka.offline.IStorageEngine}\n */\nshaka.offline.DBEngine = function() {\n goog.asserts.assert(\n shaka.offline.DBEngine.isSupported(),\n 'DBEngine should not be called when DBEngine is not supported');\n\n /** @private {IDBDatabase} */\n this.db_ = null;\n\n /** @private {!Array.<shaka.offline.DBEngine.Operation>} */\n this.operations_ = [];\n\n /** @private {!Object.<string, number>} */\n this.currentIdMap_ = {};\n};\n\n\n/**\n * @typedef {{\n * transaction: !IDBTransaction,\n * promise: !shaka.util.PublicPromise\n * }}\n *\n * @property {!IDBTransaction} transaction\n * The transaction that this operation is using.\n * @property {!shaka.util.PublicPromise} promise\n * The promise associated with the operation.\n */\nshaka.offline.DBEngine.Operation;\n\n\n/** @private {string} */\nshaka.offline.DBEngine.DB_NAME_ = 'shaka_offline_db';\n\n\n/** @private @const {number} */\nshaka.offline.DBEngine.DB_VERSION_ = 1;\n\n\n/**\n * Determines if the browsers supports IndexedDB.\n * @return {boolean}\n */\nshaka.offline.DBEngine.isSupported = function() {\n return window.indexedDB != null;\n};\n\n\n/**\n * Delete the database. There must be no open connections to the database.\n * @return {!Promise}\n */\nshaka.offline.DBEngine.deleteDatabase = function() {\n if (!window.indexedDB)\n return Promise.resolve();\n var request =\n window.indexedDB.deleteDatabase(shaka.offline.DBEngine.DB_NAME_);\n\n var p = new shaka.util.PublicPromise();\n request.onsuccess = function(event) {\n goog.asserts.assert(event.newVersion == null, 'Unexpected database update');\n p.resolve();\n };\n request.onerror = shaka.offline.DBEngine.onError_.bind(null, request, p);\n return p;\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.initialized = function() {\n return this.db_ != null;\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.init = function(storeMap, opt_retryCount) {\n goog.asserts.assert(!this.db_, 'Already initialized');\n\n return this.createConnection_(storeMap, opt_retryCount).then(function() {\n // For each store, get the next ID and store in the map.\n var stores = Object.keys(storeMap);\n return Promise.all(stores.map(function(store) {\n return this.getNextId_(store).then(function(id) {\n this.currentIdMap_[store] = id;\n }.bind(this));\n }.bind(this)));\n }.bind(this));\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.destroy = function() {\n return Promise.all(this.operations_.map(function(op) {\n try {\n // If the transaction is considered finished but has not called the\n // callbacks yet, it will still be in the list and this call will fail.\n // Simply ignore errors.\n op.transaction.abort();\n } catch (e) {}\n\n var Functional = shaka.util.Functional;\n return op.promise.catch(Functional.noop);\n })).then(function() {\n goog.asserts.assert(this.operations_.length == 0,\n 'All operations should have been closed');\n if (this.db_) {\n this.db_.close();\n this.db_ = null;\n }\n }.bind(this));\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.get = function(storeName, key) {\n var request;\n return this.createTransaction_(storeName, 'readonly', function(store) {\n request = store.get(key);\n }).then(function() { return request.result; });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.forEach = function(storeName, callback) {\n return this.createTransaction_(storeName, 'readonly', function(store) {\n var request = store.openCursor();\n request.onsuccess = function(event) {\n var cursor = event.target.result;\n if (cursor) {\n callback(cursor.value);\n cursor.continue();\n }\n };\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.insert = function(storeName, value) {\n return this.createTransaction_(storeName, 'readwrite', function(store) {\n store.put(value);\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.remove = function(storeName, key) {\n return this.createTransaction_(storeName, 'readwrite', function(store) {\n store.delete(key);\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.removeKeys = function(storeName,\n keys,\n opt_onKeyRemoved) {\n return this.createTransaction_(storeName, 'readwrite', function(store) {\n for (var i = 0; i < keys.length; i++) {\n var request = store.delete(keys[i]);\n request.onsuccess = opt_onKeyRemoved || function(event) { };\n }\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.reserveId = function(storeName) {\n goog.asserts.assert(storeName in this.currentIdMap_,\n 'Store name must be passed to init()');\n return this.currentIdMap_[storeName]++;\n};\n\n\n/**\n * Gets the ID to start at.\n *\n * @param {string} storeName\n * @return {!Promise.<number>}\n * @private\n */\nshaka.offline.DBEngine.prototype.getNextId_ = function(storeName) {\n var id = 0;\n return this.createTransaction_(storeName, 'readonly', function(store) {\n var request = store.openCursor(null, 'prev');\n request.onsuccess = function(event) {\n var cursor = event.target.result;\n if (cursor) {\n id = cursor.key + 1;\n }\n };\n }).then(function() { return id; });\n};\n\n\n/**\n * Creates a new transaction for the given store name and calls |action| to\n * modify the store. The transaction will resolve or reject the promise\n * returned by this function.\n *\n * @param {string} storeName\n * @param {string} type\n * @param {!function(IDBObjectStore)} action\n *\n * @return {!Promise}\n * @private\n */\nshaka.offline.DBEngine.prototype.createTransaction_ = function(storeName,\n type,\n action) {\n\n goog.asserts.assert(this.db_, 'Must not be destroyed');\n goog.asserts.assert(type == 'readonly' || type == 'readwrite',\n 'Type must be \"readonly\" or \"readwrite\"');\n\n var op = {\n transaction: this.db_.transaction([storeName], type),\n promise: new shaka.util.PublicPromise()\n };\n\n op.transaction.oncomplete = (function(event) {\n this.closeOperation_(op);\n op.promise.resolve();\n }.bind(this));\n\n // We will see an onabort call via:\n // 1. request error -> transaction error -> transaction abort\n // 2. transaction commit fail -> transaction abort\n // As any transaction error will result in an abort, it is better to listen\n // for an abort so that we will catch all failed transaction operations.\n op.transaction.onabort = (function(event) {\n this.closeOperation_(op);\n shaka.offline.DBEngine.onError_(op.transaction, op.promise, event);\n }.bind(this));\n\n // We need to prevent default on the onerror event or else Firefox will\n // raise an error which will cause a karma failure. This will not stop the\n // onabort callback from firing.\n op.transaction.onerror = (function(event) {\n event.preventDefault();\n }.bind(this));\n\n var store = op.transaction.objectStore(storeName);\n action(store);\n\n this.operations_.push(op);\n\n return op.promise;\n};\n\n\n/**\n * Close an open operation.\n *\n * @param {!shaka.offline.DBEngine.Operation} op\n * @private\n */\nshaka.offline.DBEngine.prototype.closeOperation_ = function(op) {\n var i = this.operations_.indexOf(op);\n goog.asserts.assert(i >= 0, 'Operation must be in the list.');\n this.operations_.splice(i, 1);\n};\n\n\n/**\n * Creates a new connection to the database.\n *\n * On IE/Edge, it is possible for the database to not be deleted when the\n * success callback is fired. This means that when we delete the database and\n * immediately create a new connection, we will connect to the old database.\n * If this happens, we need to close the connection and retry.\n *\n * @see https://goo.gl/hOYJvN\n *\n * @param {!Object.<string, string>} storeMap\n * @param {number=} opt_retryCount\n * @return {!Promise}\n * @private\n */\nshaka.offline.DBEngine.prototype.createConnection_ = function(\n storeMap, opt_retryCount) {\n var DBEngine = shaka.offline.DBEngine;\n\n var indexedDB = window.indexedDB;\n var request = indexedDB.open(DBEngine.DB_NAME_, DBEngine.DB_VERSION_);\n\n var upgraded = false;\n var createPromise = new shaka.util.PublicPromise();\n request.onupgradeneeded = function(event) {\n upgraded = true;\n var db = event.target.result;\n goog.asserts.assert(event.oldVersion == 0,\n 'Must be upgrading from version 0');\n goog.asserts.assert(db.objectStoreNames.length == 0,\n 'Version 0 database should be empty');\n for (var name in storeMap) {\n db.createObjectStore(name, {keyPath: storeMap[name]});\n }\n };\n request.onsuccess = (function(event) {\n if (opt_retryCount && !upgraded) {\n event.target.result.close();\n\n shaka.log.info('Didn\\'t get an upgrade event... trying again.');\n setTimeout(function() {\n var p = this.createConnection_(storeMap, opt_retryCount - 1);\n p.then(createPromise.resolve, createPromise.reject);\n }.bind(this), 1000);\n return;\n }\n\n\n goog.asserts.assert(opt_retryCount == undefined || upgraded,\n 'Should get upgrade event');\n this.db_ = event.target.result;\n createPromise.resolve();\n }.bind(this));\n request.onerror = DBEngine.onError_.bind(null, request, createPromise);\n\n return createPromise;\n};\n\n\n/**\n * Rejects the given Promise using the error fromt the transaction.\n *\n * @param {!IDBTransaction|!IDBRequest} errorSource\n * @param {!shaka.util.PublicPromise} promise\n * @param {Event} event\n * @private\n */\nshaka.offline.DBEngine.onError_ = function(errorSource, promise, event) {\n\n if (errorSource.error) {\n promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.INDEXED_DB_ERROR, errorSource.error));\n } else {\n promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n\n // Firefox will raise an error which will cause a karma failure.\n event.preventDefault();\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/db_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.DownloadManager');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.MapUtils');\n\n\n\n/**\n * This manages downloading segments and notifying the app of progress.\n *\n * @param {shaka.offline.IStorageEngine} storageEngine\n * @param {!shaka.net.NetworkingEngine} netEngine\n * @param {shakaExtern.RetryParameters} retryParams\n * @param {shakaExtern.OfflineConfiguration} config\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n */\nshaka.offline.DownloadManager = function(\n storageEngine, netEngine, retryParams, config) {\n /**\n * @private {!Object.<\n * string, !Array.<shaka.offline.DownloadManager.Segment>>}\n */\n this.segments_ = {};\n\n /**\n * The IDs of the segments that have been stored for an in-progress\n * download(). This is used to cleanup in destroy().\n * @private {!Array.<number>}\n */\n this.storedSegments_ = [];\n\n /** @private {?shakaExtern.OfflineConfiguration} */\n this.config_ = config;\n\n /** @private {shaka.offline.IStorageEngine} */\n this.storageEngine_ = storageEngine;\n\n /** @private {shaka.net.NetworkingEngine} */\n this.netEngine_ = netEngine;\n\n /** @private {?shakaExtern.RetryParameters} */\n this.retryParams_ = retryParams;\n\n /** @private {?shakaExtern.ManifestDB} */\n this.manifest_ = null;\n\n /** @private {Promise} */\n this.promise_ = null;\n\n /**\n * The total number of bytes for segments that include a byte range.\n * @private {number}\n */\n this.givenBytesTotal_ = 0;\n\n /**\n * The number of bytes downloaded for segments that include a byte range.\n * @private {number}\n */\n this.givenBytesDownloaded_ = 0;\n\n /**\n * The total number of bytes estimated based on bandwidth for segments that\n * do not include a byte range.\n * @private {number}\n */\n this.bandwidthBytesTotal_ = 0;\n\n /**\n * The estimated number of bytes downloaded for segments that do not have\n * a byte range.\n * @private {number}\n */\n this.bandwidthBytesDownloaded_ = 0;\n};\n\n\n/**\n * @typedef {{\n * uris: !Array.<string>,\n * startByte: number,\n * endByte: ?number,\n * bandwidthSize: number,\n * segmentDb: shakaExtern.SegmentDataDB\n * }}\n *\n * @property {!Array.<string>} uris\n * The URIs to download the segment.\n * @property {number} startByte\n * The byte index the segment starts at.\n * @property {?number} endByte\n * The byte index the segment ends at, if present.\n * @property {number} bandwidthSize\n * The size of the segment as estimated by the bandwidth and segment duration.\n * @property {shakaExtern.SegmentDataDB} segmentDb\n * The data to store in the database.\n */\nshaka.offline.DownloadManager.Segment;\n\n\n/** @override */\nshaka.offline.DownloadManager.prototype.destroy = function() {\n var storage = this.storageEngine_;\n var segments = this.storedSegments_;\n var p = this.promise_ || Promise.resolve();\n p = p.then(function() { return storage.removeKeys('segment', segments); });\n\n // Don't destroy() storageEngine since it is owned by Storage.\n\n this.segments_ = {};\n this.storedSegments_ = [];\n this.config_ = null;\n this.storageEngine_ = null;\n this.netEngine_ = null;\n this.retryParams_ = null;\n this.manifest_ = null;\n this.promise_ = null;\n return p;\n};\n\n\n/**\n * Adds a segment to the list to be downloaded.\n *\n * @param {string} type\n * @param {!shaka.media.SegmentReference|!shaka.media.InitSegmentReference} ref\n * @param {number} bandwidthSize\n * @param {shakaExtern.SegmentDataDB} segmentDb\n * The data to store in the database with the data. The |data| field of this\n * object will contain the downloaded data.\n */\nshaka.offline.DownloadManager.prototype.addSegment = function(\n type, ref, bandwidthSize, segmentDb) {\n this.segments_[type] = this.segments_[type] || [];\n this.segments_[type].push({\n uris: ref.getUris(),\n startByte: ref.startByte,\n endByte: ref.endByte,\n bandwidthSize: bandwidthSize,\n segmentDb: segmentDb\n });\n};\n\n\n/**\n * Downloads all the segments, stores them in the database, and stores the given\n * manifest object.\n *\n * @param {shakaExtern.ManifestDB} manifest\n * @return {!Promise}\n */\nshaka.offline.DownloadManager.prototype.downloadAndStore = function(manifest) {\n var MapUtils = shaka.util.MapUtils;\n // Calculate progress estimates.\n this.givenBytesTotal_ = 0;\n this.givenBytesDownloaded_ = 0;\n this.bandwidthBytesTotal_ = 0;\n this.bandwidthBytesDownloaded_ = 0;\n MapUtils.values(this.segments_).forEach(function(segments) {\n segments.forEach(function(segment) {\n if (segment.endByte != null)\n this.givenBytesTotal_ += (segment.endByte - segment.startByte + 1);\n else\n this.bandwidthBytesTotal_ += segment.bandwidthSize;\n }.bind(this));\n }.bind(this));\n\n this.manifest_ = manifest;\n // Will be updated as we download for segments without a byte-range.\n this.manifest_.size = this.givenBytesTotal_;\n\n // Create separate download chains for different content types. This will\n // allow audio and video to be downloaded in parallel.\n var async = MapUtils.values(this.segments_).map(function(segments) {\n var i = 0;\n var downloadNext = (function() {\n if (!this.config_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n if (i >= segments.length) return Promise.resolve();\n var segment = segments[i++];\n return this.downloadSegment_(segment).then(downloadNext);\n }.bind(this));\n return downloadNext();\n }.bind(this));\n this.segments_ = {};\n\n this.promise_ = Promise.all(async).then(function() {\n return this.storageEngine_.insert('manifest', manifest);\n }.bind(this)).then(function() {\n this.storedSegments_ = [];\n }.bind(this));\n return this.promise_;\n};\n\n\n/**\n * Downloads the given segment and calls the callback.\n *\n * @param {shaka.offline.DownloadManager.Segment} segment\n * @return {!Promise}\n * @private\n */\nshaka.offline.DownloadManager.prototype.downloadSegment_ = function(segment) {\n goog.asserts.assert(this.retryParams_, 'Must not be destroyed');\n var type = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n var request =\n shaka.net.NetworkingEngine.makeRequest(segment.uris, this.retryParams_);\n if (segment.startByte != 0 || segment.endByte != null) {\n var end = segment.endByte == null ? '' : segment.endByte;\n request.headers['Range'] = 'bytes=' + segment.startByte + '-' + end;\n }\n\n var byteCount;\n return this.netEngine_.request(type, request)\n .then(function(response) {\n if (!this.manifest_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n byteCount = response.data.byteLength;\n\n this.storedSegments_.push(segment.segmentDb.key);\n segment.segmentDb.data = response.data;\n return this.storageEngine_.insert('segment', segment.segmentDb);\n }.bind(this))\n .then(function() {\n if (!this.manifest_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n if (segment.endByte == null) {\n // We didn't know the size, so it was an estimate.\n this.manifest_.size += byteCount;\n this.bandwidthBytesDownloaded_ += segment.bandwidthSize;\n } else {\n goog.asserts.assert(\n byteCount == (segment.endByte - segment.startByte + 1),\n 'Incorrect download size');\n this.givenBytesDownloaded_ += byteCount;\n }\n this.updateProgress_();\n }.bind(this));\n};\n\n\n/**\n * Calls the progress callback.\n * @private\n */\nshaka.offline.DownloadManager.prototype.updateProgress_ = function() {\n var progress = (this.givenBytesDownloaded_ + this.bandwidthBytesDownloaded_) /\n (this.givenBytesTotal_ + this.bandwidthBytesTotal_);\n\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n var manifest = shaka.offline.OfflineUtils.getStoredContent(this.manifest_);\n this.config_.progressCallback(manifest, progress);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/download_manager.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.OfflineUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.offline.DBEngine');\ngoog.require('shaka.offline.IStorageEngine');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\n\n\n/** @const {!Object.<string, string>} */\nshaka.offline.OfflineUtils.DB_SCHEME = {'manifest': 'key', 'segment': 'key'};\n\n\n/**\n * Converts the given database manifest to a storedContent structure.\n *\n * @param {shakaExtern.ManifestDB} manifest\n * @return {shakaExtern.StoredContent}\n */\nshaka.offline.OfflineUtils.getStoredContent = function(manifest) {\n goog.asserts.assert(manifest.periods.length > 0,\n 'Must be at least one Period.');\n\n // Reconstruct the first period to get the variants\n var timeline = new shaka.media.PresentationTimeline(null, 0);\n var period = shaka.offline.OfflineUtils.reconstructPeriod(\n manifest.periods[0], [], timeline);\n\n var tracks = shaka.util.StreamUtils.getVariantTracks(period, null, null);\n var textTracks = shaka.util.StreamUtils.getTextTracks(period, null);\n\n tracks.push.apply(tracks, textTracks);\n\n return {\n offlineUri: 'offline:' + manifest.key,\n originalManifestUri: manifest.originalManifestUri,\n duration: manifest.duration,\n size: manifest.size,\n expiration: manifest.expiration == undefined ? Infinity :\n manifest.expiration,\n tracks: tracks,\n appMetadata: manifest.appMetadata\n };\n};\n\n\n/**\n * Reconstructs a period object from the given database period.\n *\n * @param {shakaExtern.PeriodDB} period\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @param {shaka.media.PresentationTimeline} timeline\n * @return {shakaExtern.Period}\n */\nshaka.offline.OfflineUtils.reconstructPeriod = function(\n period, drmInfos, timeline) {\n var OfflineUtils = shaka.offline.OfflineUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var textStreamsDb = period.streams.filter(function(streamDb) {\n return streamDb.contentType == ContentType.TEXT;\n });\n\n var audioStreamsDb = period.streams.filter(function(streamDb) {\n return streamDb.contentType == ContentType.AUDIO;\n });\n\n var videoStreamsDb = period.streams.filter(function(streamDb) {\n return streamDb.contentType == ContentType.VIDEO;\n });\n\n var variants =\n OfflineUtils.createVariants_(audioStreamsDb, videoStreamsDb, drmInfos);\n var textStreams = textStreamsDb.map(OfflineUtils.createStream_);\n\n period.streams.forEach(function(streamDb) {\n var refs = OfflineUtils.getSegmentReferences_(streamDb);\n timeline.notifySegments(period.startTime, refs);\n });\n\n return {\n startTime: period.startTime,\n variants: variants,\n textStreams: textStreams\n };\n};\n\n\n/**\n * @param {!shakaExtern.StreamDB} streamDb\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.offline.OfflineUtils.getSegmentReferences_ = function(streamDb) {\n return streamDb.segments.map(function(segment, i) {\n var getUris = function() { return [segment.uri]; };\n return new shaka.media.SegmentReference(\n i, segment.startTime, segment.endTime, getUris, 0, null);\n });\n};\n\n\n/**\n * Creates Variants from audio and video StreamDB collections.\n *\n * @param {!Array.<!shakaExtern.StreamDB>} audios\n * @param {!Array.<!shakaExtern.StreamDB>} videos\n * @param {!Array.<!shakaExtern.DrmInfo>} drmInfos\n * @return {!Array.<!shakaExtern.Variant>}\n * @private\n */\nshaka.offline.OfflineUtils.createVariants_ = function(\n audios, videos, drmInfos) {\n var variants = [];\n if (!audios.length && !videos.length) return variants;\n\n // Create a single null element so the double loop will work for audio-only or\n // video-only variants.\n if (!audios.length) {\n audios = [null];\n } else if (!videos.length) {\n videos = [null];\n }\n\n var OfflineUtils = shaka.offline.OfflineUtils;\n var id = 0;\n for (var i = 0; i < audios.length; i++) {\n for (var j = 0; j < videos.length; j++) {\n if (OfflineUtils.areCompatible_(audios[i], videos[j])) {\n var variant =\n OfflineUtils.createVariant_(audios[i], videos[j], drmInfos, id++);\n variants.push(variant);\n }\n }\n }\n\n return variants;\n};\n\n\n/**\n * Checks if two streams can be combined into a variant.\n *\n * @param {?shakaExtern.StreamDB} stream1\n * @param {?shakaExtern.StreamDB} stream2\n * @return {boolean}\n * @private\n */\nshaka.offline.OfflineUtils.areCompatible_ = function(stream1, stream2) {\n // Treat content that doesn't have variantIds as compatible\n // with anything for compatibility with content stored before\n // the variants were introduced.\n if (!stream1 || !stream2 || !stream1.variantIds || !stream2.variantIds)\n return true;\n\n for (var i = 0; i < stream1.variantIds.length; i++) {\n var containsId = stream2.variantIds.some(function(id) {\n return id == stream1.variantIds[i];\n });\n if (containsId) {\n return true;\n }\n }\n\n return false;\n};\n\n\n/**\n * Creates a Variant from an audio and a video StreamDBs.\n * If one of the streams is null, it creates a Variant from the other.\n *\n * @param {?shakaExtern.StreamDB} audio\n * @param {?shakaExtern.StreamDB} video\n * @param {!Array.<!shakaExtern.DrmInfo>} drmInfos\n * @param {number} id\n * @return {!shakaExtern.Variant}\n * @private\n */\nshaka.offline.OfflineUtils.createVariant_ = function(\n audio, video, drmInfos, id) {\n return {\n id: id,\n language: audio ? audio.language : '',\n // Use !! to get the compiler to use a boolean type. Otherwise it will\n // deduce the type as {boolean|shakaExtern.StreamDB} even though |audio|\n // will only be returned if it is falsy, so the type would be {boolean|null}\n primary: (!!audio && audio.primary) || (!!video && video.primary),\n audio: shaka.offline.OfflineUtils.createStream_(audio),\n video: shaka.offline.OfflineUtils.createStream_(video),\n bandwidth: 0,\n drmInfos: drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n};\n\n\n/**\n * Creates a shakaExtern.Stream from a StreamDB.\n *\n * @param {?shakaExtern.StreamDB} streamDb\n * @return {?shakaExtern.Stream}\n * @private\n */\nshaka.offline.OfflineUtils.createStream_ = function(streamDb) {\n if (!streamDb) return null;\n\n var refs =\n shaka.offline.OfflineUtils.getSegmentReferences_(streamDb);\n\n var segmentIndex = new shaka.media.SegmentIndex(refs);\n\n var initRef = streamDb.initSegmentUri ?\n new shaka.media.InitSegmentReference(\n function() { return [streamDb.initSegmentUri]; }, 0, null) :\n null;\n return {\n id: streamDb.id,\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex),\n initSegmentReference: initRef,\n presentationTimeOffset: streamDb.presentationTimeOffset,\n mimeType: streamDb.mimeType,\n codecs: streamDb.codecs,\n width: streamDb.width || undefined,\n height: streamDb.height || undefined,\n frameRate: streamDb.frameRate || undefined,\n kind: streamDb.kind,\n encrypted: streamDb.encrypted,\n keyId: streamDb.keyId,\n language: streamDb.language,\n label: streamDb.label || null,\n type: streamDb.contentType,\n primary: streamDb.primary,\n trickModeVideo: null,\n // TODO(modmaker): Store offline?\n containsEmsgBoxes: false,\n roles: []\n };\n};\n\n\n/**\n * Determines if this platform supports any form of storage engine.\n * @return {boolean}\n */\nshaka.offline.OfflineUtils.isStorageEngineSupported = function() {\n return shaka.offline.DBEngine.isSupported();\n};\n\n\n/**\n * Create a new instance of the supported storage engine. The created instance\n * will be uninitialized. If this platform does not support any storage\n * engines, this function will return null.\n * @return {shaka.offline.IStorageEngine}\n */\nshaka.offline.OfflineUtils.createStorageEngine = function() {\n return shaka.offline.DBEngine.isSupported() ?\n new shaka.offline.DBEngine() :\n null;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/offline_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.OfflineManifestParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.Error');\n\n\n\n/**\n * Creates a new offline manifest parser.\n * @struct\n * @constructor\n * @implements {shakaExtern.ManifestParser}\n */\nshaka.offline.OfflineManifestParser = function() {\n /** @private {number} */\n this.manifestId_ = -1;\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.configure = function(config) {\n // No-op\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.start =\n function(uri, playerInterface) {\n var parts = /^offline:([0-9]+)$/.exec(uri);\n if (!parts) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_OFFLINE_URI, uri));\n }\n var manifestId = Number(parts[1]);\n var storageEngine = shaka.offline.OfflineUtils.createStorageEngine();\n this.manifestId_ = manifestId;\n\n if (!storageEngine) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORAGE_NOT_SUPPORTED));\n }\n\n return storageEngine.init(shaka.offline.OfflineUtils.DB_SCHEME)\n .then(function() { return storageEngine.get('manifest', manifestId); })\n .then(function(manifest) {\n if (!manifest) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND, manifestId);\n }\n\n var OfflineManifestParser = shaka.offline.OfflineManifestParser;\n return OfflineManifestParser.reconstructManifest(manifest);\n })\n .then(\n function(ret) {\n return storageEngine.destroy().then(function() { return ret; });\n },\n function(err) {\n return storageEngine.destroy().then(function() { throw err; });\n });\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.stop = function() {\n return Promise.resolve();\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.update = function() {\n // No-op\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.onExpirationUpdated = function(\n sessionId, expiration) {\n var storageEngine = shaka.offline.OfflineUtils.createStorageEngine();\n goog.asserts.assert(storageEngine, 'Must support offline storage');\n\n storageEngine.init(shaka.offline.OfflineUtils.DB_SCHEME)\n .then(function() {\n return storageEngine.get('manifest', this.manifestId_);\n }.bind(this))\n .then(function(manifest) {\n if (!manifest) {\n // Manifest was deleted, ignore update.\n return;\n }\n if (manifest.sessionIds.indexOf(sessionId) < 0) {\n shaka.log.debug('Ignoring updated expiration for unknown session');\n return;\n }\n\n if (manifest.expiration == undefined ||\n manifest.expiration > expiration) {\n shaka.log.debug('Updating expiration for stored content');\n manifest.expiration = expiration;\n return storageEngine.insert('manifest', manifest);\n }\n })\n .catch(function(error) {\n shaka.log.error('Error updating offline manifest expiration', error);\n })\n .then(function() {\n return storageEngine.destroy();\n });\n};\n\n\n/**\n * Reconstructs a manifest object from the given database manifest.\n *\n * @param {shakaExtern.ManifestDB} manifest\n * @return {shakaExtern.Manifest}\n */\nshaka.offline.OfflineManifestParser.reconstructManifest = function(manifest) {\n var timeline = new shaka.media.PresentationTimeline(null, 0);\n timeline.setDuration(manifest.duration);\n var drmInfos = manifest.drmInfo ? [manifest.drmInfo] : [];\n return {\n presentationTimeline: timeline,\n minBufferTime: 10,\n offlineSessionIds: manifest.sessionIds,\n periods: manifest.periods.map(function(period) {\n return shaka.offline.OfflineUtils.reconstructPeriod(period,\n drmInfos,\n timeline);\n })\n };\n};\n\n\nshaka.media.ManifestParser.registerParserByMime(\n 'application/x-offline-manifest', shaka.offline.OfflineManifestParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/offline_manifest_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.OfflineScheme');\n\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.Error');\n\n\n/**\n * @namespace\n * @summary A plugin that handles requests for offline content.\n * @param {string} uri\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.offline.OfflineScheme = function(uri, request) {\n var manifestParts = /^offline:([0-9]+)$/.exec(uri);\n if (manifestParts) {\n /** @type {shakaExtern.Response} */\n var response = {\n uri: uri,\n data: new ArrayBuffer(0),\n headers: {'content-type': 'application/x-offline-manifest'}\n };\n return Promise.resolve(response);\n }\n\n var segmentParts = /^offline:[0-9]+\\/[0-9]+\\/([0-9]+)$/.exec(uri);\n if (segmentParts) {\n var segmentId = Number(segmentParts[1]);\n var scheme = shaka.offline.OfflineUtils.DB_SCHEME;\n var storageEngine = shaka.offline.OfflineUtils.createStorageEngine();\n\n if (!storageEngine) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORAGE_NOT_SUPPORTED));\n }\n\n return storageEngine.init(scheme)\n .then(function() { return storageEngine.get('segment', segmentId); })\n .then(function(segment) {\n return storageEngine.destroy().then(function() {\n if (!segment) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND, segmentId);\n }\n return {uri: uri, data: segment.data, headers: {}};\n });\n });\n }\n\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_OFFLINE_URI, uri));\n};\n\n\nshaka.net.NetworkingEngine.registerScheme(\n 'offline', shaka.offline.OfflineScheme);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/offline_scheme.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.CancelableChain');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.Error');\n\n\n\n/**\n * A Promise-based abstraction that creates cancelable Promise chains.\n * When canceled, subsequent stages of the internal Promise chain will stop.\n * A canceled chain is rejected with a user-specified value.\n *\n * A CancelableChain only supports linear Promise chains. Chains which branch\n * (more than one then() handler chained to a particular stage) are not\n * supported. You will not be prevented from treating this as if branching\n * were supported, but everything will be serialized into a linear chain.\n * Be careful!\n *\n * @constructor\n * @struct\n */\nshaka.util.CancelableChain = function() {\n /** @private {!Promise} */\n this.promise_ = Promise.resolve();\n\n /** @private {boolean} */\n this.final_ = false;\n\n /** @private {boolean} */\n this.complete_ = false;\n\n /** @private {boolean} */\n this.canceled_ = false;\n\n /** @private {shaka.util.Error} */\n this.rejectionValue_;\n\n /** @private {function()} */\n this.onCancelComplete_;\n\n /** @private {!Promise} */\n this.cancelPromise_ = new Promise(function(resolve) {\n this.onCancelComplete_ = resolve;\n }.bind(this));\n};\n\n\n/**\n * @param {function(*)} callback\n * @return {!shaka.util.CancelableChain} the chain itself.\n */\nshaka.util.CancelableChain.prototype.then = function(callback) {\n goog.asserts.assert(!this.final_, 'Chain should not be final!');\n\n this.promise_ = this.promise_.then(callback).then(function(data) {\n if (this.canceled_) {\n this.onCancelComplete_();\n return Promise.reject(this.rejectionValue_);\n }\n return Promise.resolve(data);\n }.bind(this));\n return this;\n};\n\n\n/**\n * Finalize the chain.\n * Converts the chain into a simple Promise and stops accepting new stages.\n *\n * @return {!Promise}\n */\nshaka.util.CancelableChain.prototype.finalize = function() {\n if (!this.final_) {\n this.promise_ = this.promise_.then(function(data) {\n this.complete_ = true;\n return Promise.resolve(data);\n }.bind(this), function(error) {\n this.complete_ = true;\n if (this.canceled_) {\n this.onCancelComplete_();\n return Promise.reject(this.rejectionValue_);\n }\n\n return Promise.reject(error);\n }.bind(this));\n }\n this.final_ = true;\n return this.promise_;\n};\n\n\n/**\n * Cancel the Promise chain and reject with the given value.\n *\n * @param {!shaka.util.Error} reason\n * @return {!Promise} resolved when the cancelation has been processed by the\n * the chain and no more stages will execute. Note that this may be before\n * the owner of the finalized chain has seen the rejection.\n */\nshaka.util.CancelableChain.prototype.cancel = function(reason) {\n if (this.complete_) return Promise.resolve();\n\n this.canceled_ = true;\n this.rejectionValue_ = reason;\n return this.cancelPromise_;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/cancelable_chain.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.Storage');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.Player');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.offline.DownloadManager');\ngoog.require('shaka.offline.IStorageEngine');\ngoog.require('shaka.offline.OfflineManifestParser');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.LanguageUtils');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * This manages persistent offline data including storage, listing, and deleting\n * stored manifests. Playback of offline manifests are done using Player\n * using the special URI (e.g. 'offline:12').\n *\n * First, check support() to see if offline is supported by the platform.\n * Second, configure() the storage object with callbacks to your application.\n * Third, call store(), remove(), or list() as needed.\n * When done, call destroy().\n *\n * @param {shaka.Player} player\n * The player instance to pull configuration data from.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n * @export\n */\nshaka.offline.Storage = function(player) {\n // It is an easy mistake to make to pass a Player proxy from CastProxy.\n // Rather than throw a vague exception later, throw an explicit and clear one\n // now.\n if (!player || player.constructor != shaka.Player) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.LOCAL_PLAYER_INSTANCE_REQUIRED);\n }\n\n /** @private {shaka.offline.IStorageEngine} */\n this.storageEngine_ = shaka.offline.OfflineUtils.createStorageEngine();\n\n /** @private {shaka.Player} */\n this.player_ = player;\n\n /** @private {?shakaExtern.OfflineConfiguration} */\n this.config_ = this.defaultConfig_();\n\n /** @private {shaka.media.DrmEngine} */\n this.drmEngine_ = null;\n\n /** @private {boolean} */\n this.storeInProgress_ = false;\n\n /** @private {Array.<shakaExtern.Track>} */\n this.firstPeriodTracks_ = null;\n\n /** @private {number} */\n this.manifestId_ = -1;\n\n /** @private {number} */\n this.duration_ = 0;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = null;\n\n var netEngine = player.getNetworkingEngine();\n goog.asserts.assert(netEngine, 'Player must not be destroyed');\n\n /** @private {shaka.offline.DownloadManager} */\n this.downloadManager_ = new shaka.offline.DownloadManager(\n this.storageEngine_, netEngine,\n player.getConfiguration().streaming.retryParameters, this.config_);\n};\n\n\n/**\n * Gets whether offline storage is supported. Returns true if offline storage\n * is supported for clear content. Support for offline storage of encrypted\n * content will not be determined until storage is attempted.\n *\n * @return {boolean}\n * @export\n */\nshaka.offline.Storage.support = function() {\n return shaka.offline.OfflineUtils.isStorageEngineSupported();\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.offline.Storage.prototype.destroy = function() {\n var storageEngine = this.storageEngine_;\n // Destroy the download manager first since it needs the StorageEngine to\n // clean up old segments.\n var ret = !this.downloadManager_ ?\n Promise.resolve() :\n this.downloadManager_.destroy()\n .catch(function() {})\n .then(function() {\n if (storageEngine) return storageEngine.destroy();\n });\n\n this.storageEngine_ = null;\n this.downloadManager_ = null;\n this.player_ = null;\n this.config_ = null;\n return ret;\n};\n\n\n/**\n * Sets configuration values for Storage. This is not associated with\n * Player.configure and will not change Player.\n *\n * There are two important callbacks configured here: one for download progress,\n * and one to decide which tracks to store.\n *\n * The default track selection callback will store the largest SD video track.\n * Provide your own callback to choose the tracks you want to store.\n *\n * @param {shakaExtern.OfflineConfiguration} config\n * @export\n */\nshaka.offline.Storage.prototype.configure = function(config) {\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n shaka.util.ConfigUtils.mergeConfigObjects(\n this.config_, config, this.defaultConfig_(), {}, '');\n};\n\n\n/**\n * Stores the given manifest. If the content is encrypted, and encrypted\n * content cannot be stored on this platform, the Promise will be rejected with\n * error code 6001, REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE.\n *\n * @param {string} manifestUri The URI of the manifest to store.\n * @param {!Object} appMetadata An arbitrary object from the application that\n * will be stored along-side the offline content. Use this for any\n * application-specific metadata you need associated with the stored content.\n * For details on the data types that can be stored here, please refer to\n * https://goo.gl/h62coS\n * @param {!shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * @return {!Promise.<shakaExtern.StoredContent>} A Promise to a structure\n * representing what was stored. The \"offlineUri\" member is the URI that\n * should be given to Player.load() to play this piece of content offline.\n * The \"appMetadata\" member is the appMetadata argument you passed to store().\n * @export\n */\nshaka.offline.Storage.prototype.store = function(\n manifestUri, appMetadata, opt_manifestParserFactory) {\n if (this.storeInProgress_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORE_ALREADY_IN_PROGRESS));\n }\n this.storeInProgress_ = true;\n\n /** @type {shakaExtern.ManifestDB} */\n var manifestDb;\n\n var error = null;\n var onError = function(e) { error = e; };\n return this.initIfNeeded_()\n .then(function() {\n this.checkDestroyed_();\n return this.loadInternal(\n manifestUri, onError, opt_manifestParserFactory);\n }.bind(this)).then((\n /**\n * @param {{manifest: shakaExtern.Manifest,\n * drmEngine: !shaka.media.DrmEngine}} data\n * @return {!Promise}\n */\n function(data) {\n this.checkDestroyed_();\n this.manifest_ = data.manifest;\n this.drmEngine_ = data.drmEngine;\n\n if (this.manifest_.presentationTimeline.isLive() ||\n this.manifest_.presentationTimeline.isInProgress()) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.CANNOT_STORE_LIVE_OFFLINE, manifestUri);\n }\n\n // Re-filter now that DrmEngine is initialized.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n\n this.manifestId_ = this.storageEngine_.reserveId('manifest');\n this.duration_ = 0;\n manifestDb = this.createOfflineManifest_(manifestUri, appMetadata);\n return this.downloadManager_.downloadAndStore(manifestDb);\n })\n .bind(this))\n .then(function() {\n this.checkDestroyed_();\n // Throw any errors from the manifest parser or DrmEngine.\n if (error)\n throw error;\n\n return this.cleanup_();\n }.bind(this))\n .then(function() {\n return shaka.offline.OfflineUtils.getStoredContent(manifestDb);\n }.bind(this))\n .catch(function(err) {\n var Functional = shaka.util.Functional;\n return this.cleanup_().catch(Functional.noop).then(function() {\n throw err;\n });\n }.bind(this));\n};\n\n\n/**\n * Removes the given stored content.\n *\n * @param {shakaExtern.StoredContent} content\n * @return {!Promise}\n * @export\n */\nshaka.offline.Storage.prototype.remove = function(content) {\n var uri = content.offlineUri;\n var parts = /^offline:([0-9]+)$/.exec(uri);\n if (!parts) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.MALFORMED_OFFLINE_URI, uri));\n }\n\n var error = null;\n var onError = function(e) {\n // Ignore errors if the session was already removed.\n if (e.code != shaka.util.Error.Code.OFFLINE_SESSION_REMOVED)\n error = e;\n };\n\n /** @type {shakaExtern.ManifestDB} */\n var manifestDb;\n /** @type {!shaka.media.DrmEngine} */\n var drmEngine;\n var manifestId = Number(parts[1]);\n return this.initIfNeeded_().then(function() {\n this.checkDestroyed_();\n return this.storageEngine_.get('manifest', manifestId);\n }.bind(this)).then((\n /**\n * @param {?shakaExtern.ManifestDB} data\n * @return {!Promise}\n */\n function(data) {\n this.checkDestroyed_();\n if (!data) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND, uri);\n }\n manifestDb = data;\n var manifest =\n shaka.offline.OfflineManifestParser.reconstructManifest(manifestDb);\n var netEngine = this.player_.getNetworkingEngine();\n goog.asserts.assert(netEngine, 'Player must not be destroyed');\n drmEngine = new shaka.media.DrmEngine(\n netEngine, onError, function() {}, function() {});\n drmEngine.configure(this.player_.getConfiguration().drm);\n return drmEngine.init(manifest, true /* isOffline */);\n })\n .bind(this)).then(function() {\n return drmEngine.removeSessions(manifestDb.sessionIds);\n }.bind(this)).then(function() {\n return drmEngine.destroy();\n }.bind(this)).then(function() {\n this.checkDestroyed_();\n if (error) throw error;\n var Functional = shaka.util.Functional;\n // Get every segment for every stream in the manifest.\n /** @type {!Array.<number>} */\n var segments = manifestDb.periods.map(function(period) {\n return period.streams.map(function(stream) {\n var segments = stream.segments.map(function(segment) {\n var parts = /^offline:[0-9]+\\/[0-9]+\\/([0-9]+)$/.exec(segment.uri);\n goog.asserts.assert(parts, 'Invalid offline URI');\n return Number(parts[1]);\n });\n if (stream.initSegmentUri) {\n var parts = /^offline:[0-9]+\\/[0-9]+\\/([0-9]+)$/.exec(\n stream.initSegmentUri);\n goog.asserts.assert(parts, 'Invalid offline URI');\n segments.push(Number(parts[1]));\n }\n return segments;\n }).reduce(Functional.collapseArrays, []);\n }).reduce(Functional.collapseArrays, []);\n\n // Delete all the segments.\n var deleteCount = 0;\n var segmentCount = segments.length;\n var callback = this.config_.progressCallback;\n\n return this.storageEngine_.removeKeys('segment', segments, function() {\n deleteCount++;\n callback(content, deleteCount / segmentCount);\n });\n\n }.bind(this)).then(function() {\n this.checkDestroyed_();\n this.config_.progressCallback(content, 1);\n return this.storageEngine_.remove('manifest', manifestId);\n }.bind(this));\n};\n\n\n/**\n * Lists all the stored content available.\n *\n * @return {!Promise.<!Array.<shakaExtern.StoredContent>>} A Promise to an\n * array of structures representing all stored content. The \"offlineUri\"\n * member of the structure is the URI that should be given to Player.load()\n * to play this piece of content offline. The \"appMetadata\" member is the\n * appMetadata argument you passed to store().\n * @export\n */\nshaka.offline.Storage.prototype.list = function() {\n /** @type {!Array.<shakaExtern.StoredContent>} */\n var storedContents = [];\n return this.initIfNeeded_()\n .then(function() {\n this.checkDestroyed_();\n return this.storageEngine_.forEach(\n 'manifest', function(/** shakaExtern.ManifestDB */ manifest) {\n storedContents.push(\n shaka.offline.OfflineUtils.getStoredContent(manifest));\n });\n }.bind(this))\n .then(function() { return storedContents; });\n};\n\n\n/**\n * Loads the given manifest, parses it, and constructs the DrmEngine. This\n * stops the manifest parser. This may be replaced by tests.\n *\n * @param {string} manifestUri\n * @param {function(*)} onError\n * @param {!shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * @return {!Promise.<{\n * manifest: shakaExtern.Manifest,\n * drmEngine: !shaka.media.DrmEngine\n * }>}\n */\nshaka.offline.Storage.prototype.loadInternal = function(\n manifestUri, onError, opt_manifestParserFactory) {\n\n var netEngine = /** @type {!shaka.net.NetworkingEngine} */ (\n this.player_.getNetworkingEngine());\n var config = this.player_.getConfiguration();\n\n /** @type {shakaExtern.Manifest} */\n var manifest;\n /** @type {!shaka.media.DrmEngine} */\n var drmEngine;\n /** @type {!shakaExtern.ManifestParser} */\n var manifestParser;\n\n var onKeyStatusChange = function() {};\n return shaka.media.ManifestParser\n .getFactory(\n manifestUri, netEngine, config.manifest.retryParameters,\n opt_manifestParserFactory)\n .then(function(factory) {\n this.checkDestroyed_();\n manifestParser = new factory();\n manifestParser.configure(config.manifest);\n\n var playerInterface = {\n networkingEngine: netEngine,\n filterPeriod: this.filterPeriod_.bind(this),\n onTimelineRegionAdded: function() {},\n onEvent: function() {},\n onError: onError\n };\n return manifestParser.start(manifestUri, playerInterface);\n }.bind(this))\n .then(function(data) {\n this.checkDestroyed_();\n manifest = data;\n drmEngine = new shaka.media.DrmEngine(\n netEngine, onError, onKeyStatusChange, function() {});\n drmEngine.configure(config.drm);\n return drmEngine.init(manifest, true /* isOffline */);\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return this.createSegmentIndex_(manifest);\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return drmEngine.createOrLoad();\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return manifestParser.stop();\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return {manifest: manifest, drmEngine: drmEngine};\n }.bind(this))\n .catch(function(error) {\n if (manifestParser)\n return manifestParser.stop().then(function() { throw error; });\n else\n throw error;\n });\n};\n\n\n/**\n * The default track selection function.\n *\n * @param {!Array.<shakaExtern.Track>} tracks\n * @return {!Array.<shakaExtern.Track>}\n * @private\n */\nshaka.offline.Storage.prototype.defaultTrackSelect_ = function(tracks) {\n var LanguageUtils = shaka.util.LanguageUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var selectedTracks = [];\n\n // Select variants with best language match.\n var audioLangPref = LanguageUtils.normalize(\n this.player_.getConfiguration().preferredAudioLanguage);\n var matchTypes = [\n LanguageUtils.MatchType.EXACT,\n LanguageUtils.MatchType.BASE_LANGUAGE_OKAY,\n LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY\n ];\n var allVariantTracks =\n tracks.filter(function(track) { return track.type == 'variant'; });\n // For each match type, get the tracks that match the audio preference for\n // that match type.\n var tracksByMatchType = matchTypes.map(function(match) {\n return allVariantTracks.filter(function(track) {\n var lang = LanguageUtils.normalize(track.language);\n return LanguageUtils.match(match, audioLangPref, lang);\n });\n });\n\n // Find the best match type that has any matches.\n var variantTracks;\n for (var i = 0; i < tracksByMatchType.length; i++) {\n if (tracksByMatchType[i].length) {\n variantTracks = tracksByMatchType[i];\n break;\n }\n }\n\n // Fall back to \"primary\" audio tracks, if present.\n if (!variantTracks) {\n var primaryTracks = allVariantTracks.filter(function(track) {\n return track.primary;\n });\n if (primaryTracks.length)\n variantTracks = primaryTracks;\n }\n\n // Otherwise, there is no good way to choose the language, so we don't choose\n // a language at all.\n if (!variantTracks) {\n variantTracks = allVariantTracks;\n // Issue a warning, but only if the content has multiple languages.\n // Otherwise, this warning would just be noise.\n var languages = allVariantTracks\n .map(function(track) { return track.language; })\n .filter(shaka.util.Functional.isNotDuplicate);\n if (languages.length > 1) {\n shaka.log.warning('Could not choose a good audio track based on ' +\n 'language preferences or primary tracks. An ' +\n 'arbitrary language will be stored!');\n }\n }\n\n // From previously selected variants, choose the SD ones (height <= 480).\n var tracksByHeight = variantTracks.filter(function(track) {\n return track.height && track.height <= 480;\n });\n\n // If variants don't have video or no video with height <= 480 was\n // found, proceed with the previously selected tracks.\n if (tracksByHeight.length) {\n // Sort by resolution, then select all variants which match the height\n // of the highest SD res. There may be multiple audio bitrates for the\n // same video resolution.\n tracksByHeight.sort(function(a, b) { return b.height - a.height; });\n variantTracks = tracksByHeight.filter(function(track) {\n return track.height == tracksByHeight[0].height;\n });\n }\n\n // Now sort by bandwidth.\n variantTracks.sort(function(a, b) { return a.bandwidth - b.bandwidth; });\n\n // In case there are multiple matches at different audio bitrates, select the\n // middle bandwidth one.\n if (variantTracks.length)\n selectedTracks.push(variantTracks[Math.floor(variantTracks.length / 2)]);\n\n // Since this default callback is used primarily by our own demo app and by\n // app developers who haven't thought about which tracks they want, we should\n // select all text tracks, regardless of language. This makes for a better\n // demo for us, and does not rely on user preferences for the unconfigured\n // app.\n selectedTracks.push.apply(selectedTracks, tracks.filter(function(track) {\n return track.type == ContentType.TEXT;\n }));\n\n return selectedTracks;\n};\n\n\n/**\n * @return {shakaExtern.OfflineConfiguration}\n * @private\n */\nshaka.offline.Storage.prototype.defaultConfig_ = function() {\n return {\n trackSelectionCallback: this.defaultTrackSelect_.bind(this),\n progressCallback: function(storedContent, percent) {\n // Reference arguments to keep closure from removing it.\n // If the argument is removed, it breaks our function length check\n // in mergeConfigObjects_().\n // NOTE: Chrome App Content Security Policy prohibits usage of new\n // Function().\n if (storedContent || percent) return null;\n }\n };\n};\n\n\n/**\n * Initializes the IStorageEngine if it is not already.\n *\n * @return {!Promise}\n * @private\n */\nshaka.offline.Storage.prototype.initIfNeeded_ = function() {\n if (!this.storageEngine_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORAGE_NOT_SUPPORTED));\n } else if (this.storageEngine_.initialized()) {\n return Promise.resolve();\n } else {\n var scheme = shaka.offline.OfflineUtils.DB_SCHEME;\n return this.storageEngine_.init(scheme);\n }\n};\n\n\n/**\n * @param {shakaExtern.Period} period\n * @private\n */\nshaka.offline.Storage.prototype.filterPeriod_ = function(period) {\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var activeStreams = {};\n if (this.firstPeriodTracks_) {\n var variantTracks = this.firstPeriodTracks_.filter(function(track) {\n return track.type == 'variant';\n });\n var variant = null;\n if (variantTracks.length)\n variant = StreamUtils.findVariantForTrack(period, variantTracks[0]);\n\n if (variant) {\n // Use the first variant as the container of \"active streams\". This\n // is then used to filter out the streams that are not compatible with it.\n // This ensures that in multi-Period content, all Periods have streams\n // with compatible MIME types.\n if (variant.video) activeStreams[ContentType.VIDEO] = variant.video;\n if (variant.audio) activeStreams[ContentType.AUDIO] = variant.audio;\n }\n }\n StreamUtils.filterPeriod(this.drmEngine_, activeStreams, period);\n StreamUtils.applyRestrictions(\n period, this.player_.getConfiguration().restrictions,\n /* maxHwRes */ { width: Infinity, height: Infinity });\n};\n\n\n/**\n * Cleans up the current store and destroys any objects. This object is still\n * usable after this.\n *\n * @return {!Promise}\n * @private\n */\nshaka.offline.Storage.prototype.cleanup_ = function() {\n var ret = this.drmEngine_ ? this.drmEngine_.destroy() : Promise.resolve();\n this.drmEngine_ = null;\n this.manifest_ = null;\n this.storeInProgress_ = false;\n this.firstPeriodTracks_ = null;\n this.manifestId_ = -1;\n return ret;\n};\n\n\n/**\n * Calls createSegmentIndex for all streams in the manifest.\n *\n * @param {shakaExtern.Manifest} manifest\n * @return {!Promise}\n * @private\n */\nshaka.offline.Storage.prototype.createSegmentIndex_ = function(manifest) {\n var Functional = shaka.util.Functional;\n var streams = manifest.periods\n .map(function(period) { return period.variants; })\n .reduce(Functional.collapseArrays, [])\n .map(function(variant) {\n var variantStreams = [];\n if (variant.audio) variantStreams.push(variant.audio);\n if (variant.video) variantStreams.push(variant.video);\n return variantStreams;\n })\n .reduce(Functional.collapseArrays, [])\n .filter(Functional.isNotDuplicate);\n\n var textStreams = manifest.periods\n .map(function(period) { return period.textStreams; })\n .reduce(Functional.collapseArrays, []);\n\n streams.push.apply(streams, textStreams);\n return Promise.all(\n streams.map(function(stream) { return stream.createSegmentIndex(); }));\n};\n\n\n/**\n * Creates an offline 'manifest' for the real manifest. This does not store\n * the segments yet, only adds them to the download manager through\n * createPeriod_.\n *\n * @param {string} originalManifestUri\n * @param {!Object} appMetadata\n * @return {shakaExtern.ManifestDB}\n * @private\n */\nshaka.offline.Storage.prototype.createOfflineManifest_ = function(\n originalManifestUri, appMetadata) {\n var periods = this.manifest_.periods.map(this.createPeriod_.bind(this));\n var drmInfo = this.drmEngine_.getDrmInfo();\n var sessions = this.drmEngine_.getSessionIds();\n if (drmInfo) {\n if (!sessions.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.NO_INIT_DATA_FOR_OFFLINE, originalManifestUri);\n }\n // Don't store init data since we have stored sessions.\n drmInfo.initData = [];\n }\n\n return {\n key: this.manifestId_,\n originalManifestUri: originalManifestUri,\n duration: this.duration_,\n size: 0,\n expiration: this.drmEngine_.getExpiration(),\n periods: periods,\n sessionIds: sessions,\n drmInfo: drmInfo,\n appMetadata: appMetadata\n };\n};\n\n\n/**\n * Converts a manifest Period to a database Period. This will use the current\n * configuration to get the tracks to use, then it will search each segment\n * index and add all the segments to the download manager through createStream_.\n *\n * @param {shakaExtern.Period} period\n * @return {shakaExtern.PeriodDB}\n * @private\n */\nshaka.offline.Storage.prototype.createPeriod_ = function(period) {\n var StreamUtils = shaka.util.StreamUtils;\n\n var variantTracks = StreamUtils.getVariantTracks(period, null, null);\n var textTracks = StreamUtils.getTextTracks(period, null);\n var allTracks = variantTracks.concat(textTracks);\n\n var chosenTracks = this.config_.trackSelectionCallback(allTracks);\n\n if (this.firstPeriodTracks_ == null) {\n this.firstPeriodTracks_ = chosenTracks;\n // Now that the first tracks are chosen, filter again. This ensures all\n // Periods have compatible content types.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n }\n\n for (var i = chosenTracks.length - 1; i > 0; --i) {\n var foundSimilarTracks = false;\n for (var j = i - 1; j >= 0; --j) {\n if (chosenTracks[i].type == chosenTracks[j].type &&\n chosenTracks[i].kind == chosenTracks[j].kind &&\n chosenTracks[i].language == chosenTracks[j].language) {\n shaka.log.warning(\n 'Multiple tracks of the same type/kind/language given.');\n foundSimilarTracks = true;\n break;\n }\n }\n if (foundSimilarTracks) break;\n }\n\n var streams = [];\n\n for (var i = 0; i < chosenTracks.length; i++) {\n var variant = StreamUtils.findVariantForTrack(period, chosenTracks[i]);\n if (variant) {\n // Make a rough estimation of the streams' bandwidth so download manager\n // can track the progress of the download.\n var bandwidthEstimation;\n if (variant.audio) {\n // If the audio stream has already been added to the DB\n // as part of another variant, add the ID to the list.\n // Otherwise, add it to the DB.\n var stream = streams.filter(function(s) {\n return s.id == variant.audio.id;\n })[0];\n if (stream) {\n stream.variantIds.push(variant.id);\n } else {\n // If variant has both audio and video, roughly estimate them\n // both to be 1/2 of the variant's bandwidth.\n // If variant only has one stream, it's bandwidth equals to\n // the bandwidth of the variant.\n bandwidthEstimation =\n variant.video ? variant.bandwidth / 2 : variant.bandwidth;\n streams.push(this.createStream_(period,\n variant.audio,\n bandwidthEstimation,\n variant.id));\n }\n }\n if (variant.video) {\n var stream = streams.filter(function(s) {\n return s.id == variant.video.id;\n })[0];\n if (stream) {\n stream.variantIds.push(variant.id);\n } else {\n bandwidthEstimation =\n variant.audio ? variant.bandwidth / 2 : variant.bandwidth;\n streams.push(this.createStream_(period,\n variant.video,\n bandwidthEstimation,\n variant.id));\n }\n }\n } else {\n var textStream =\n StreamUtils.findTextStreamForTrack(period, chosenTracks[i]);\n goog.asserts.assert(\n textStream, 'Could not find track with id ' + chosenTracks[i].id);\n streams.push(this.createStream_(\n period, textStream, 0 /* estimatedStreamBandwidth */));\n }\n }\n\n return {\n startTime: period.startTime,\n streams: streams\n };\n};\n\n\n/**\n * Converts a manifest stream to a database stream. This will search the\n * segment index and add all the segments to the download manager.\n *\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Stream} stream\n * @param {number} estimatedStreamBandwidth\n * @param {number=} opt_variantId\n * @return {shakaExtern.StreamDB}\n * @private\n */\nshaka.offline.Storage.prototype.createStream_ = function(\n period, stream, estimatedStreamBandwidth, opt_variantId) {\n /** @type {!Array.<shakaExtern.SegmentDB>} */\n var segmentsDb = [];\n var startTime =\n this.manifest_.presentationTimeline.getSegmentAvailabilityStart();\n var endTime = startTime;\n var i = stream.findSegmentPosition(startTime);\n var ref = (i != null ? stream.getSegmentReference(i) : null);\n while (ref) {\n var id = this.storageEngine_.reserveId('segment');\n var bandwidthSize =\n (ref.endTime - ref.startTime) * estimatedStreamBandwidth / 8;\n\n /** @type {shakaExtern.SegmentDataDB} */\n var segmentDataDb = {\n key: id,\n data: null,\n manifestKey: this.manifestId_,\n streamNumber: stream.id,\n segmentNumber: id\n };\n this.downloadManager_.addSegment(\n stream.type, ref, bandwidthSize, segmentDataDb);\n\n segmentsDb.push({\n startTime: ref.startTime,\n endTime: ref.endTime,\n uri: 'offline:' + this.manifestId_ + '/' + stream.id + '/' + id\n });\n\n endTime = ref.endTime + period.startTime;\n ref = stream.getSegmentReference(++i);\n }\n\n this.duration_ = Math.max(this.duration_, (endTime - startTime));\n var initUri = null;\n if (stream.initSegmentReference) {\n var id = this.storageEngine_.reserveId('segment');\n initUri = 'offline:' + this.manifestId_ + '/' + stream.id + '/' + id;\n\n /** @type {shakaExtern.SegmentDataDB} */\n var initDataDb = {\n key: id,\n data: null,\n manifestKey: this.manifestId_,\n streamNumber: stream.id,\n segmentNumber: -1\n };\n\n this.downloadManager_.addSegment(\n stream.contentType, stream.initSegmentReference, 0, initDataDb);\n }\n\n var variantIds = [];\n if (opt_variantId != null) variantIds.push(opt_variantId);\n\n return {\n id: stream.id,\n primary: stream.primary,\n presentationTimeOffset: stream.presentationTimeOffset || 0,\n contentType: stream.type,\n mimeType: stream.mimeType,\n codecs: stream.codecs,\n frameRate: stream.frameRate,\n kind: stream.kind,\n language: stream.language,\n label: stream.label,\n width: stream.width || null,\n height: stream.height || null,\n initSegmentUri: initUri,\n encrypted: stream.encrypted,\n keyId: stream.keyId,\n segments: segmentsDb,\n variantIds: variantIds\n };\n};\n\n\n/**\n * Throws an error if the object is destroyed.\n * @private\n */\nshaka.offline.Storage.prototype.checkDestroyed_ = function() {\n if (!this.player_) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED);\n }\n};\n\n\nshaka.Player.registerSupportPlugin('offline', shaka.offline.Storage.support);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/storage.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.installAll');\ngoog.provide('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill\n * @summary A one-stop installer for all polyfills.\n * @see http://enwp.org/polyfill\n * @exportDoc\n */\n\n\n/**\n * Install all polyfills.\n * @export\n */\nshaka.polyfill.installAll = function() {\n for (var i = 0; i < shaka.polyfill.polyfills_.length; ++i) {\n shaka.polyfill.polyfills_[i]();\n }\n};\n\n\n/**\n * Contains the polyfills that will be installed.\n * @private {!Array.<function()>}\n */\nshaka.polyfill.polyfills_ = [];\n\n\n/**\n * Registers a new polyfill to be installed.\n *\n * @param {function()} polyfill\n * @export\n */\nshaka.polyfill.register = function(polyfill) {\n shaka.polyfill.polyfills_.push(polyfill);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/all.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.Fullscreen');\n\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.Fullscreen\n *\n * @summary A polyfill to unify fullscreen APIs across browsers.\n * Many browsers have prefixed fullscreen methods on Element and document.\n * See {@link http://goo.gl/n7TYl0 Using fullscreen mode} on MDN for more\n * information.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.Fullscreen.install = function() {\n if (!window.Document) {\n // Avoid errors on very old browsers.\n return;\n }\n\n var proto = Element.prototype;\n proto.requestFullscreen = proto.requestFullscreen ||\n proto.mozRequestFullScreen ||\n proto.msRequestFullscreen ||\n proto.webkitRequestFullscreen;\n\n proto = Document.prototype;\n proto.exitFullscreen = proto.exitFullscreen ||\n proto.mozCancelFullScreen ||\n proto.msExitFullscreen ||\n proto.webkitExitFullscreen;\n\n if (!('fullscreenElement' in document)) {\n Object.defineProperty(document, 'fullscreenElement', {\n get: function() {\n return document.mozFullScreenElement ||\n document.msFullscreenElement ||\n document.webkitFullscreenElement;\n }\n });\n Object.defineProperty(document, 'fullscreenEnabled', {\n get: function() {\n return document.mozFullScreenEnabled ||\n document.msFullscreenEnabled ||\n document.webkitFullscreenEnabled;\n }\n });\n }\n\n var proxy = shaka.polyfill.Fullscreen.proxyEvent_;\n document.addEventListener('webkitfullscreenchange', proxy);\n document.addEventListener('webkitfullscreenerror', proxy);\n document.addEventListener('mozfullscreenchange', proxy);\n document.addEventListener('mozfullscreenerror', proxy);\n document.addEventListener('MSFullscreenChange', proxy);\n document.addEventListener('MSFullscreenError', proxy);\n};\n\n\n/**\n * Proxy fullscreen events after changing their name.\n * @param {!Event} event\n * @private\n */\nshaka.polyfill.Fullscreen.proxyEvent_ = function(event) {\n var eventType = event.type.replace(/^(webkit|moz|MS)/, '').toLowerCase();\n\n var newEvent;\n // IE 11 does not have an Event constructor\n if (typeof(Event) === 'function') {\n newEvent = new Event(eventType, /** @type {EventInit} */(event));\n } else {\n newEvent = document.createEvent('Event');\n newEvent.initEvent(eventType, event.bubbles, event.cancelable);\n }\n\n event.target.dispatchEvent(newEvent);\n};\n\n\nshaka.polyfill.register(shaka.polyfill.Fullscreen.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/fullscreen.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Pssh');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Mp4Parser');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n\n/**\n * Parse a PSSH box and extract the system IDs.\n *\n * @param {!Uint8Array} psshBox\n * @constructor\n * @struct\n * @throws {shaka.util.Error} if a PSSH box is truncated or contains a size\n * field over 53 bits.\n */\nshaka.util.Pssh = function(psshBox) {\n /**\n * In hex.\n * @type {!Array.<string>}\n */\n this.systemIds = [];\n\n /**\n * In hex.\n * @type {!Array.<string>}\n */\n this.cencKeyIds = [];\n\n /*\n * Array of tuples that define the startIndex + size for each\n * discrete pssh within |psshBox|\n * */\n this.dataBoundaries = [];\n\n new shaka.util.Mp4Parser()\n .fullBox('pssh', this.parseBox_.bind(this)).parse(psshBox.buffer);\n\n if (this.dataBoundaries.length == 0) {\n shaka.log.warning('No pssh box found!');\n }\n};\n\n\n/**\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @private\n */\nshaka.util.Pssh.prototype.parseBox_ = function(box) {\n goog.asserts.assert(\n box.version != null,\n 'PSSH boxes are full boxes and must have a valid version');\n\n goog.asserts.assert(\n box.flags != null,\n 'PSSH boxes are full boxes and must have a valid flag');\n\n if (box.version > 1) {\n shaka.log.warning('Unrecognized PSSH version found!');\n return;\n }\n\n var systemId = shaka.util.Uint8ArrayUtils.toHex(box.reader.readBytes(16));\n var keyIds = [];\n if (box.version > 0) {\n var numKeyIds = box.reader.readUint32();\n for (var i = 0; i < numKeyIds; ++i) {\n var keyId = shaka.util.Uint8ArrayUtils.toHex(box.reader.readBytes(16));\n keyIds.push(keyId);\n }\n }\n\n var dataSize = box.reader.readUint32();\n box.reader.skip(dataSize); // Ignore the data section.\n\n // Now that everything has been succesfully parsed from this box,\n // update member variables.\n this.cencKeyIds.push.apply(this.cencKeyIds, keyIds);\n this.systemIds.push(systemId);\n this.dataBoundaries.push({\n start: box.start,\n end: box.start + box.size - 1\n });\n\n if (box.reader.getPosition() != box.reader.getLength()) {\n shaka.log.warning('Mismatch between box size and data size!');\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/pssh.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.PatchedMediaKeysMs');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.ArrayUtils');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.Pssh');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * Install a polyfill to implement {@link http://goo.gl/blgtZZ EME draft\n * 12 March 2015} on top of ms-prefixed\n * {@link http://www.w3.org/TR/2014/WD-encrypted-media-20140218/ EME v20140218}.\n */\nshaka.polyfill.PatchedMediaKeysMs.install = function() {\n shaka.log.debug('PatchedMediaKeysMs.install');\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n // Construct fake key ID. This is not done at load-time to avoid exceptions\n // on unsupported browsers. This particular fake key ID was suggested in\n // w3c/encrypted-media#32.\n PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_ = (new Uint8Array([0])).buffer;\n\n // Delete mediaKeys to work around strict mode compatibility issues.\n delete HTMLMediaElement.prototype['mediaKeys'];\n // Work around read-only declaration for mediaKeys by using a string.\n HTMLMediaElement.prototype['mediaKeys'] = null;\n HTMLMediaElement.prototype.setMediaKeys = PatchedMediaKeysMs.setMediaKeys;\n\n // Install patches\n window.MediaKeys = PatchedMediaKeysMs.MediaKeys;\n window.MediaKeySystemAccess = PatchedMediaKeysMs.MediaKeySystemAccess;\n navigator.requestMediaKeySystemAccess =\n PatchedMediaKeysMs.requestMediaKeySystemAccess;\n};\n\n\n/**\n * An implementation of navigator.requestMediaKeySystemAccess.\n * Retrieve a MediaKeySystemAccess object.\n *\n * @this {!Navigator}\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @return {!Promise.<!MediaKeySystemAccess>}\n */\nshaka.polyfill.PatchedMediaKeysMs.requestMediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysMs.requestMediaKeySystemAccess');\n goog.asserts.assert(this == navigator,\n 'bad \"this\" for requestMediaKeySystemAccess');\n\n // Alias.\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n try {\n var access = new PatchedMediaKeysMs.MediaKeySystemAccess(\n keySystem, supportedConfigurations);\n return Promise.resolve(/** @type {!MediaKeySystemAccess} */ (access));\n } catch (exception) {\n return Promise.reject(exception);\n }\n};\n\n\n\n/**\n * An implementation of MediaKeySystemAccess.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @implements {MediaKeySystemAccess}\n * @throws {Error} if the key system is not supported.\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySystemAccess');\n\n /** @type {string} */\n this.keySystem = keySystem;\n\n /** @private {!MediaKeySystemConfiguration} */\n this.configuration_;\n\n var allowPersistentState = true;\n\n var success = false;\n for (var i = 0; i < supportedConfigurations.length; ++i) {\n var cfg = supportedConfigurations[i];\n\n // Create a new config object and start adding in the pieces which we\n // find support for. We will return this from getConfiguration() if\n // asked.\n /** @type {!MediaKeySystemConfiguration} */\n var newCfg = {\n 'audioCapabilities': [],\n 'videoCapabilities': [],\n // It is technically against spec to return these as optional, but we\n // don't truly know their values from the prefixed API:\n 'persistentState': 'optional',\n 'distinctiveIdentifier': 'optional',\n // Pretend the requested init data types are supported, since we don't\n // really know that either:\n 'initDataTypes': cfg.initDataTypes,\n 'sessionTypes': ['temporary'],\n 'label': cfg.label\n };\n\n // PatchedMediaKeysMs tests for key system availability through\n // MSMediaKeys.isTypeSupported\n var ranAnyTests = false;\n if (cfg.audioCapabilities) {\n for (var j = 0; j < cfg.audioCapabilities.length; ++j) {\n var cap = cfg.audioCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n var contentType = cap.contentType.split(';')[0];\n if (MSMediaKeys.isTypeSupported(this.keySystem, contentType)) {\n newCfg.audioCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n if (cfg.videoCapabilities) {\n for (var j = 0; j < cfg.videoCapabilities.length; ++j) {\n var cap = cfg.videoCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n var contentType = cap.contentType.split(';')[0];\n if (MSMediaKeys.isTypeSupported(this.keySystem, contentType)) {\n newCfg.videoCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n\n if (!ranAnyTests) {\n // If no specific types were requested, we check all common types to find\n // out if the key system is present at all.\n success = MSMediaKeys.isTypeSupported(this.keySystem, 'video/mp4');\n }\n if (cfg.persistentState == 'required') {\n if (allowPersistentState) {\n newCfg.persistentState = 'required';\n newCfg.sessionTypes = ['persistent-license'];\n } else {\n success = false;\n }\n }\n\n if (success) {\n this.configuration_ = newCfg;\n return;\n }\n } // for each cfg in supportedConfigurations\n\n // As per the spec, this should be a DOMException, but\n // there is not a public constructor for this\n var unsupportedKeySystemError = new Error('Unsupported keySystem');\n unsupportedKeySystemError.name = 'NotSupportedError';\n unsupportedKeySystemError.code = DOMException.NOT_SUPPORTED_ERR;\n throw unsupportedKeySystemError;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.\n createMediaKeys = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySystemAccess.createMediaKeys');\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n var mediaKeys = new PatchedMediaKeysMs.MediaKeys(this.keySystem);\n return Promise.resolve(/** @type {!MediaKeys} */ (mediaKeys));\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.\n getConfiguration = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySystemAccess.getConfiguration');\n return this.configuration_;\n};\n\n\n/**\n * An implementation of HTMLMediaElement.prototype.setMediaKeys.\n * Attach a MediaKeys object to the media element.\n *\n * @this {!HTMLMediaElement}\n * @param {MediaKeys} mediaKeys\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysMs.setMediaKeys = function(mediaKeys) {\n shaka.log.debug('PatchedMediaKeysMs.setMediaKeys');\n goog.asserts.assert(this instanceof HTMLMediaElement,\n 'bad \"this\" for setMediaKeys');\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n var newMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysMs.MediaKeys} */ (\n mediaKeys);\n var oldMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysMs.MediaKeys} */ (\n this.mediaKeys);\n\n if (oldMediaKeys && oldMediaKeys != newMediaKeys) {\n goog.asserts.assert(oldMediaKeys instanceof PatchedMediaKeysMs.MediaKeys,\n 'non-polyfill instance of oldMediaKeys');\n // Have the old MediaKeys stop listening to events on the video tag.\n oldMediaKeys.setMedia(null);\n }\n\n delete this['mediaKeys']; // in case there is an existing getter\n this['mediaKeys'] = mediaKeys; // work around read-only declaration\n\n if (newMediaKeys) {\n goog.asserts.assert(newMediaKeys instanceof PatchedMediaKeysMs.MediaKeys,\n 'non-polyfill instance of newMediaKeys');\n return newMediaKeys.setMedia(this);\n }\n\n return Promise.resolve();\n};\n\n\n\n/**\n * An implementation of MediaKeys.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @implements {MediaKeys}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys = function(keySystem) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeys');\n\n /** @private {!MSMediaKeys} */\n this.nativeMediaKeys_ = new MSMediaKeys(keySystem);\n\n /** @private {!shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.\n createSession = function(opt_sessionType) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeys.createSession');\n\n var sessionType = opt_sessionType || 'temporary';\n // For now, only 'temporary' type is supported\n if (sessionType != 'temporary') {\n throw new TypeError('Session type ' + opt_sessionType +\n ' is unsupported on this platform.');\n }\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n return new PatchedMediaKeysMs.MediaKeySession(\n this.nativeMediaKeys_, sessionType);\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.\n setServerCertificate = function(serverCertificate) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeys.setServerCertificate');\n\n // There is no equivalent in PatchedMediaKeysMs, so return failure.\n return Promise.resolve(false);\n};\n\n\n/**\n * @param {HTMLMediaElement} media\n * @protected\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.\n setMedia = function(media) {\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n // Remove any old listeners.\n this.eventManager_.removeAll();\n\n // It is valid for media to be null, it's used to flag that event handlers\n // need to be cleaned up\n if (!media) {\n return Promise.resolve();\n }\n\n // Intercept and translate these prefixed EME events.\n this.eventManager_.listen(media, 'msneedkey',\n /** @type {shaka.util.EventManager.ListenerType} */\n (PatchedMediaKeysMs.onMsNeedKey_));\n\n var self = this;\n function setMediaKeysDeferred() {\n media.msSetMediaKeys(self.nativeMediaKeys_);\n media.removeEventListener('loadedmetadata', setMediaKeysDeferred);\n }\n\n // Wrap native HTMLMediaElement.msSetMediaKeys with Promise\n try {\n // IE11/Edge requires that readyState >=1 before mediaKeys can be set, so\n // check this and wait for loadedmetadata if we are not in the correct state\n if (media.readyState >= 1) {\n media.msSetMediaKeys(this.nativeMediaKeys_);\n } else {\n media.addEventListener('loadedmetadata', setMediaKeysDeferred);\n }\n\n return Promise.resolve();\n\n } catch (exception) {\n return Promise.reject(exception);\n }\n};\n\n\n\n/**\n * An implementation of MediaKeySession.\n *\n * @constructor\n * @struct\n * @param {MSMediaKeys} nativeMediaKeys\n * @param {string} sessionType\n * @implements {MediaKeySession}\n * @extends {shaka.util.FakeEventTarget}\n */\nshaka.polyfill.PatchedMediaKeysMs.\n MediaKeySession = function(nativeMediaKeys, sessionType) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession');\n shaka.util.FakeEventTarget.call(this);\n\n // Native MediaKeySession, which will be created in generateRequest\n /** @private {MSMediaKeySession} */\n this.nativeMediaKeySession_ = null;\n\n /** @private {MSMediaKeys} */\n this.nativeMediaKeys_ = nativeMediaKeys;\n\n // Promises that are resolved later\n /** @private {Promise} */\n this.generateRequestPromise_ = null;\n\n /** @private {Promise} */\n this.updatePromise_ = null;\n\n /** @private {!shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @type {string} */\n this.sessionId = '';\n\n /** @type {number} */\n this.expiration = NaN;\n\n /** @type {!shaka.util.PublicPromise} */\n this.closed = new shaka.util.PublicPromise();\n\n /** @type {!MediaKeyStatusMap} */\n this.keyStatuses =\n new shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap();\n};\ngoog.inherits(shaka.polyfill.PatchedMediaKeysMs.MediaKeySession,\n shaka.util.FakeEventTarget);\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n generateRequest = function(initDataType, initData) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.generateRequest');\n\n this.generateRequestPromise_ = new shaka.util.PublicPromise();\n\n try {\n // This EME spec version requires a MIME content type as the 1st param\n // to createSession, but doesn't seem to matter what the value is.\n\n // NOTE: IE11 takes either Uint8Array or ArrayBuffer, but Edge 12 only\n // accepts Uint8Array.\n this.nativeMediaKeySession_ = this.nativeMediaKeys_\n .createSession('video/mp4', new Uint8Array(initData), null);\n\n // Attach session event handlers here\n this.eventManager_.listen(this.nativeMediaKeySession_, 'mskeymessage',\n /** @type {shaka.util.EventManager.ListenerType} */\n (this.onMsKeyMessage_.bind(this)));\n this.eventManager_.listen(this.nativeMediaKeySession_, 'mskeyadded',\n /** @type {shaka.util.EventManager.ListenerType} */\n (this.onMsKeyAdded_.bind(this)));\n this.eventManager_.listen(this.nativeMediaKeySession_, 'mskeyerror',\n /** @type {shaka.util.EventManager.ListenerType} */\n (this.onMsKeyError_.bind(this)));\n\n this.updateKeyStatus_('status-pending');\n } catch (exception) {\n this.generateRequestPromise_.reject(exception);\n }\n\n return this.generateRequestPromise_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n load = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.load');\n\n return Promise.reject(new Error('MediaKeySession.load not yet supported'));\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n update = function(response) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.update');\n\n this.updatePromise_ = new shaka.util.PublicPromise();\n\n try {\n // Pass through to the native session.\n // NOTE: IE11 takes either Uint8Array or ArrayBuffer, but Edge 12 only\n // accepts Uint8Array.\n this.nativeMediaKeySession_.update(new Uint8Array(response));\n } catch (exception) {\n this.updatePromise_.reject(exception);\n }\n\n return this.updatePromise_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n close = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.close');\n\n try {\n // Pass through to the native session\n // NOTE: IE seems to have spec discrepancy here - v2010218 should have\n // MediaKeySession.release, but actually uses \"close\". The next version\n // of the spec is the initial Promise based one, so it's not the target spec\n // either.\n this.nativeMediaKeySession_.close();\n\n this.closed.resolve();\n this.eventManager_.removeAll();\n } catch (exception) {\n this.closed.reject(exception);\n }\n\n return this.closed;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n remove = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.remove');\n\n return Promise.reject(new Error('MediaKeySession.remove is only ' +\n 'applicable for persistent licenses, which are not supported on ' +\n 'this platform'));\n};\n\n\n/**\n * Handler for the native media elements msNeedKey event.\n *\n * @this {!HTMLMediaElement}\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.onMsNeedKey_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsNeedKey_', event);\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n // NOTE: Because \"this\" is a real EventTarget, on IE, the event we dispatch\n // here must also be a real Event.\n var event2 = /** @type {!CustomEvent} */(document.createEvent('CustomEvent'));\n event2.initCustomEvent('encrypted', false, false, null);\n event2.initDataType = 'cenc';\n event2.initData = PatchedMediaKeysMs.NormaliseInitData_(event.initData);\n\n this.dispatchEvent(event2);\n};\n\n\n/**\n * Normalise the initData array. This is to apply browser specific work-arounds,\n * e.g. removing duplicates which appears to occur intermittently when the\n * native msneedkey event fires (i.e. event.initData contains dupes).\n *\n * @param {?Uint8Array} initData\n * @private\n * @return {?Uint8Array}\n */\nshaka.polyfill.PatchedMediaKeysMs.\n NormaliseInitData_ = function(initData) {\n if (!initData) {\n return initData;\n }\n\n var pssh = new shaka.util.Pssh(initData);\n\n // If there is only a single pssh, return the original array\n if (pssh.dataBoundaries.length <= 1) {\n return initData;\n }\n\n var unfilteredInitDatas = [];\n for (var i = 0; i < pssh.dataBoundaries.length; i++) {\n var currPssh = initData.subarray(\n pssh.dataBoundaries[i].start,\n pssh.dataBoundaries[i].end + 1); // end is exclusive, hence the +1\n\n unfilteredInitDatas.push(currPssh);\n }\n\n // Dedupe psshData\n var dedupedInitDatas = shaka.util.ArrayUtils.removeDuplicates(\n unfilteredInitDatas,\n shaka.polyfill.PatchedMediaKeysMs.compareInitDatas_);\n\n var targetLength = 0;\n for (var i = 0; i < dedupedInitDatas.length; i++) {\n targetLength += dedupedInitDatas[i].length;\n }\n\n // Concat array of Uint8Arrays back into a single Uint8Array\n var normalisedInitData = new Uint8Array(targetLength);\n var offset = 0;\n for (var i = 0; i < dedupedInitDatas.length; i++) {\n normalisedInitData.set(dedupedInitDatas[i], offset);\n offset += dedupedInitDatas[i].length;\n }\n\n return normalisedInitData;\n};\n\n\n/**\n * @param {!Uint8Array} initDataA\n * @param {!Uint8Array} initDataB\n * @return {boolean}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.compareInitDatas_ =\n function(initDataA, initDataB) {\n return shaka.util.Uint8ArrayUtils.equal(initDataA, initDataB);\n};\n\n\n/**\n * Handler for the native keymessage event on MSMediaKeySession.\n *\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n onMsKeyMessage_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsKeyMessage_', event);\n\n // We can now resolve this.generateRequestPromise (it should be non-null)\n goog.asserts.assert(this.generateRequestPromise_,\n 'generateRequestPromise_ not set in onMsKeyMessage_');\n if (this.generateRequestPromise_) {\n this.generateRequestPromise_.resolve();\n this.generateRequestPromise_ = null;\n }\n\n var isNew = this.keyStatuses.getStatus() == undefined;\n\n var event2 = new shaka.util.FakeEvent('message', {\n messageType: isNew ? 'licenserequest' : 'licenserenewal',\n message: event.message.buffer\n });\n\n this.dispatchEvent(event2);\n};\n\n\n/**\n * Handler for the native keyadded event on MSMediaKeySession.\n *\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n onMsKeyAdded_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsKeyAdded_', event);\n\n // PlayReady's concept of persistent licenses makes emulation difficult here.\n // A license policy can say that the license persists, which causes the CDM to\n // store it for use in a later session. The result is that in IE11, the CDM\n // fires 'mskeyadded' without ever firing 'mskeymessage'.\n if (this.generateRequestPromise_) {\n shaka.log.debug('Simulating completion for a PR persistent license.');\n goog.asserts.assert(!this.updatePromise_,\n 'updatePromise_ and generateRequestPromise_ set in onMsKeyAdded_');\n this.updateKeyStatus_('usable');\n this.generateRequestPromise_.resolve();\n this.generateRequestPromise_ = null;\n return;\n }\n\n // We can now resolve this.updatePromise (it should be non-null)\n goog.asserts.assert(this.updatePromise_,\n 'updatePromise_ not set in onMsKeyAdded_');\n if (this.updatePromise_) {\n this.updateKeyStatus_('usable');\n this.updatePromise_.resolve();\n this.updatePromise_ = null;\n }\n};\n\n\n/**\n * Handler for the native keyerror event on MSMediaKeySession.\n *\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n onMsKeyError_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsKeyError_', event);\n\n var error = new Error('EME PatchedMediaKeysMs key error');\n error.errorCode = this.nativeMediaKeySession_.error;\n\n if (this.generateRequestPromise_ != null) {\n this.generateRequestPromise_.reject(error);\n this.generateRequestPromise_ = null;\n } else if (this.updatePromise_ != null) {\n this.updatePromise_.reject(error);\n this.updatePromise_ = null;\n } else {\n /*\n Unexpected error - map native codes to standardised key statuses.\n Possible values of this.nativeMediaKeySession_.error.code\n\n MS_MEDIA_KEYERR_UNKNOWN = 1\n MS_MEDIA_KEYERR_CLIENT = 2\n MS_MEDIA_KEYERR_SERVICE = 3\n MS_MEDIA_KEYERR_OUTPUT = 4\n MS_MEDIA_KEYERR_HARDWARECHANGE = 5\n MS_MEDIA_KEYERR_DOMAIN = 6\n */\n\n switch (this.nativeMediaKeySession_.error.code) {\n case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:\n case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:\n this.updateKeyStatus_('output-not-allowed');\n default:\n this.updateKeyStatus_('internal-error');\n }\n }\n};\n\n\n/**\n * Update key status and dispatch a 'keystatuseschange' event.\n *\n * @param {string} status\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n updateKeyStatus_ = function(status) {\n this.keyStatuses.setStatus(status);\n var event = new shaka.util.FakeEvent('keystatuseschange');\n this.dispatchEvent(event);\n};\n\n\n\n/**\n * An implementation of MediaKeyStatusMap.\n * This fakes a map with a single key ID.\n *\n * @constructor\n * @struct\n * @implements {MediaKeyStatusMap}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap = function() {\n /**\n * @type {number}\n */\n this.size = 0;\n\n /**\n * @private {string|undefined}\n */\n this.status_ = undefined;\n};\n\n\n/**\n * @const {!ArrayBuffer}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_;\n\n\n/**\n * An internal method used by the session to set key status.\n * @param {string|undefined} status\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n setStatus = function(status) {\n this.size = status == undefined ? 0 : 1;\n this.status_ = status;\n};\n\n\n/**\n * An internal method used by the session to get key status.\n * @return {string|undefined}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n getStatus = function() {\n return this.status_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n forEach = function(fn) {\n if (this.status_) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_;\n fn(this.status_, fakeKeyId);\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n get = function(keyId) {\n if (this.has(keyId)) {\n return this.status_;\n }\n return undefined;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n has = function(keyId) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_;\n if (this.status_ &&\n shaka.util.Uint8ArrayUtils.equal(\n new Uint8Array(keyId), new Uint8Array(fakeKeyId))) {\n return true;\n }\n return false;\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n entries = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n keys = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n values = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/patchedmediakeys_ms.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.PatchedMediaKeysNop');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\n\n\n/**\n * Install a polyfill to stub out {@link http://goo.gl/blgtZZ EME draft\n * 12 March 2015} on browsers without EME. All methods will fail.\n */\nshaka.polyfill.PatchedMediaKeysNop.install = function() {\n shaka.log.debug('PatchedMediaKeysNop.install');\n\n // Alias.\n var PatchedMediaKeysNop = shaka.polyfill.PatchedMediaKeysNop;\n\n // Install patches.\n navigator.requestMediaKeySystemAccess =\n PatchedMediaKeysNop.requestMediaKeySystemAccess;\n // Delete mediaKeys to work around strict mode compatibility issues.\n delete HTMLMediaElement.prototype['mediaKeys'];\n // Work around read-only declaration for mediaKeys by using a string.\n HTMLMediaElement.prototype['mediaKeys'] = null;\n HTMLMediaElement.prototype.setMediaKeys = PatchedMediaKeysNop.setMediaKeys;\n // These are not usable, but allow Player.isBrowserSupported to pass.\n window.MediaKeys = PatchedMediaKeysNop.MediaKeys;\n window.MediaKeySystemAccess = PatchedMediaKeysNop.MediaKeySystemAccess;\n};\n\n\n/**\n * An implementation of navigator.requestMediaKeySystemAccess.\n * Retrieve a MediaKeySystemAccess object.\n *\n * @this {!Navigator}\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @return {!Promise.<!MediaKeySystemAccess>}\n */\nshaka.polyfill.PatchedMediaKeysNop.requestMediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysNop.requestMediaKeySystemAccess');\n goog.asserts.assert(this == navigator,\n 'bad \"this\" for requestMediaKeySystemAccess');\n\n\n return Promise.reject(new Error(\n 'The key system specified is not supported.'));\n};\n\n\n/**\n * An implementation of HTMLMediaElement.prototype.setMediaKeys.\n * Attach a MediaKeys object to the media element.\n *\n * @this {!HTMLMediaElement}\n * @param {MediaKeys} mediaKeys\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysNop.setMediaKeys = function(mediaKeys) {\n shaka.log.debug('PatchedMediaKeysNop.setMediaKeys');\n goog.asserts.assert(this instanceof HTMLMediaElement,\n 'bad \"this\" for setMediaKeys');\n\n if (mediaKeys == null) {\n return Promise.resolve();\n }\n\n return Promise.reject(new Error('MediaKeys not supported.'));\n};\n\n\n\n/**\n * An unusable constructor for MediaKeys.\n * @constructor\n * @struct\n * @implements {MediaKeys}\n */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeys = function() {\n throw new TypeError('Illegal constructor.');\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.createSession =\n function() {};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.setServerCertificate =\n function() {};\n\n\n\n/**\n * An unusable constructor for MediaKeySystemAccess.\n * @constructor\n * @struct\n * @implements {MediaKeySystemAccess}\n */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess = function() {\n throw new TypeError('Illegal constructor.');\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.\n getConfiguration = function() {};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.\n createMediaKeys = function() {};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.\n keySystem;\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/patchedmediakeys_nop.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.PatchedMediaKeysWebkit');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * Store api prefix.\n *\n * @private {string}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.prefix_ = '';\n\n\n/**\n * Install a polyfill to implement {@link http://goo.gl/blgtZZ EME draft\n * 12 March 2015} on top of webkit-prefixed\n * {@link http://goo.gl/FSpoAo EME v0.1b}.\n *\n * @param {string} prefix\n */\nshaka.polyfill.PatchedMediaKeysWebkit.install = function(prefix) {\n shaka.log.debug('PatchedMediaKeysWebkit.install');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n PatchedMediaKeysWebkit.prefix_ = prefix;\n var prefixApi = PatchedMediaKeysWebkit.prefixApi_;\n\n goog.asserts.assert(\n HTMLMediaElement.prototype[prefixApi('generateKeyRequest')],\n 'PatchedMediaKeysWebkit APIs not available!');\n\n // Construct fake key ID. This is not done at load-time to avoid exceptions\n // on unsupported browsers. This particular fake key ID was suggested in\n // w3c/encrypted-media#32.\n PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_ =\n (new Uint8Array([0])).buffer;\n\n // Install patches.\n navigator.requestMediaKeySystemAccess =\n PatchedMediaKeysWebkit.requestMediaKeySystemAccess;\n // Delete mediaKeys to work around strict mode compatibility issues.\n delete HTMLMediaElement.prototype['mediaKeys'];\n // Work around read-only declaration for mediaKeys by using a string.\n HTMLMediaElement.prototype['mediaKeys'] = null;\n HTMLMediaElement.prototype.setMediaKeys = PatchedMediaKeysWebkit.setMediaKeys;\n window.MediaKeys = PatchedMediaKeysWebkit.MediaKeys;\n window.MediaKeySystemAccess = PatchedMediaKeysWebkit.MediaKeySystemAccess;\n};\n\n\n/**\n * Prefix api by stored prefix.\n *\n * @param {string} api\n * @return {string}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.prefixApi_ = function(api) {\n var prefix = shaka.polyfill.PatchedMediaKeysWebkit.prefix_;\n if (prefix) {\n return prefix + api.charAt(0).toUpperCase() + api.slice(1);\n }\n return api;\n};\n\n\n/**\n * An implementation of navigator.requestMediaKeySystemAccess.\n * Retrieve a MediaKeySystemAccess object.\n *\n * @this {!Navigator}\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @return {!Promise.<!MediaKeySystemAccess>}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.requestMediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysWebkit.requestMediaKeySystemAccess');\n goog.asserts.assert(this == navigator,\n 'bad \"this\" for requestMediaKeySystemAccess');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n try {\n var access = new PatchedMediaKeysWebkit.MediaKeySystemAccess(\n keySystem, supportedConfigurations);\n return Promise.resolve(/** @type {!MediaKeySystemAccess} */ (access));\n } catch (exception) {\n return Promise.reject(exception);\n }\n};\n\n\n/**\n * An implementation of HTMLMediaElement.prototype.setMediaKeys.\n * Attach a MediaKeys object to the media element.\n *\n * @this {!HTMLMediaElement}\n * @param {MediaKeys} mediaKeys\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.setMediaKeys = function(mediaKeys) {\n shaka.log.debug('PatchedMediaKeysWebkit.setMediaKeys');\n goog.asserts.assert(this instanceof HTMLMediaElement,\n 'bad \"this\" for setMediaKeys');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n\n var newMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys} */ (\n mediaKeys);\n var oldMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys} */ (\n this.mediaKeys);\n\n if (oldMediaKeys && oldMediaKeys != newMediaKeys) {\n goog.asserts.assert(\n oldMediaKeys instanceof PatchedMediaKeysWebkit.MediaKeys,\n 'non-polyfill instance of oldMediaKeys');\n // Have the old MediaKeys stop listening to events on the video tag.\n oldMediaKeys.setMedia(null);\n }\n\n delete this['mediaKeys']; // in case there is an existing getter\n this['mediaKeys'] = mediaKeys; // work around read-only declaration\n\n if (newMediaKeys) {\n goog.asserts.assert(\n newMediaKeys instanceof PatchedMediaKeysWebkit.MediaKeys,\n 'non-polyfill instance of newMediaKeys');\n newMediaKeys.setMedia(this);\n }\n\n return Promise.resolve();\n};\n\n\n/**\n * For some of this polyfill's implementation, we need to query a video element.\n * But for some embedded systems, it is memory-expensive to create multiple\n * video elements. Therefore, we check the document to see if we can borrow one\n * to query before we fall back to creating one temporarily.\n *\n * @return {!HTMLVideoElement}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.getVideoElement_ = function() {\n var videos = document.getElementsByTagName('video');\n var tmpVideo = videos.length ? videos[0] : document.createElement('video');\n return /** @type {!HTMLVideoElement} */(tmpVideo);\n};\n\n\n\n/**\n * An implementation of MediaKeySystemAccess.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @implements {MediaKeySystemAccess}\n * @throws {Error} if the key system is not supported.\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySystemAccess');\n\n /** @type {string} */\n this.keySystem = keySystem;\n\n /** @private {string} */\n this.internalKeySystem_ = keySystem;\n\n /** @private {!MediaKeySystemConfiguration} */\n this.configuration_;\n\n // This is only a guess, since we don't really know from the prefixed API.\n var allowPersistentState = true;\n\n if (keySystem == 'org.w3.clearkey') {\n // ClearKey's string must be prefixed in v0.1b.\n this.internalKeySystem_ = 'webkit-org.w3.clearkey';\n // ClearKey doesn't support persistence.\n allowPersistentState = false;\n }\n\n var success = false;\n var tmpVideo = shaka.polyfill.PatchedMediaKeysWebkit.getVideoElement_();\n for (var i = 0; i < supportedConfigurations.length; ++i) {\n var cfg = supportedConfigurations[i];\n\n // Create a new config object and start adding in the pieces which we\n // find support for. We will return this from getConfiguration() if\n // asked.\n /** @type {!MediaKeySystemConfiguration} */\n var newCfg = {\n 'audioCapabilities': [],\n 'videoCapabilities': [],\n // It is technically against spec to return these as optional, but we\n // don't truly know their values from the prefixed API:\n 'persistentState': 'optional',\n 'distinctiveIdentifier': 'optional',\n // Pretend the requested init data types are supported, since we don't\n // really know that either:\n 'initDataTypes': cfg.initDataTypes,\n 'sessionTypes': ['temporary'],\n 'label': cfg.label\n };\n\n // v0.1b tests for key system availability with an extra argument on\n // canPlayType.\n var ranAnyTests = false;\n if (cfg.audioCapabilities) {\n for (var j = 0; j < cfg.audioCapabilities.length; ++j) {\n var cap = cfg.audioCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n // In Chrome <= 40, if you ask about Widevine-encrypted audio support,\n // you get a false-negative when you specify codec information.\n // Work around this by stripping codec info for audio types.\n var contentType = cap.contentType.split(';')[0];\n if (tmpVideo.canPlayType(contentType, this.internalKeySystem_)) {\n newCfg.audioCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n if (cfg.videoCapabilities) {\n for (var j = 0; j < cfg.videoCapabilities.length; ++j) {\n var cap = cfg.videoCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n if (tmpVideo.canPlayType(cap.contentType, this.internalKeySystem_)) {\n newCfg.videoCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n\n if (!ranAnyTests) {\n // If no specific types were requested, we check all common types to find\n // out if the key system is present at all.\n success = tmpVideo.canPlayType('video/mp4', this.internalKeySystem_) ||\n tmpVideo.canPlayType('video/webm', this.internalKeySystem_);\n }\n if (cfg.persistentState == 'required') {\n if (allowPersistentState) {\n newCfg.persistentState = 'required';\n newCfg.sessionTypes = ['persistent-license'];\n } else {\n success = false;\n }\n }\n\n if (success) {\n this.configuration_ = newCfg;\n return;\n }\n } // for each cfg in supportedConfigurations\n\n var message = 'Unsupported keySystem';\n if (keySystem == 'org.w3.clearkey' || keySystem == 'com.widevine.alpha') {\n message = 'None of the requested configurations were supported.';\n }\n var unsupportedError = new Error(message);\n unsupportedError.name = 'NotSupportedError';\n unsupportedError.code = DOMException.NOT_SUPPORTED_ERR;\n throw unsupportedError;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.\n createMediaKeys = function() {\n shaka.log.debug(\n 'PatchedMediaKeysWebkit.MediaKeySystemAccess.createMediaKeys');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n var mediaKeys = new PatchedMediaKeysWebkit.MediaKeys(this.internalKeySystem_);\n return Promise.resolve(/** @type {!MediaKeys} */ (mediaKeys));\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.\n getConfiguration = function() {\n shaka.log.debug(\n 'PatchedMediaKeysWebkit.MediaKeySystemAccess.getConfiguration');\n return this.configuration_;\n};\n\n\n\n/**\n * An implementation of MediaKeys.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @implements {MediaKeys}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys = function(keySystem) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys');\n\n /** @private {string} */\n this.keySystem_ = keySystem;\n\n /** @private {HTMLMediaElement} */\n this.media_ = null;\n\n /** @private {!shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /**\n * @private {!Array.<!shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession>}\n */\n this.newSessions_ = [];\n\n /**\n * @private {!Object.<string,\n * !shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession>}\n */\n this.sessionMap_ = {};\n};\n\n\n/**\n * @param {HTMLMediaElement} media\n * @protected\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setMedia =\n function(media) {\n this.media_ = media;\n\n // Remove any old listeners.\n this.eventManager_.removeAll();\n\n var prefix = shaka.polyfill.PatchedMediaKeysWebkit.prefix_;\n if (media) {\n // Intercept and translate these prefixed EME events.\n this.eventManager_.listen(media, prefix + 'needkey',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitNeedKey_.bind(this)));\n\n this.eventManager_.listen(media, prefix + 'keymessage',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitKeyMessage_.bind(this)));\n\n this.eventManager_.listen(media, prefix + 'keyadded',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitKeyAdded_.bind(this)));\n\n this.eventManager_.listen(media, prefix + 'keyerror',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitKeyError_.bind(this)));\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.createSession =\n function(opt_sessionType) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.createSession');\n\n var sessionType = opt_sessionType || 'temporary';\n // TODO: Consider adding support for persistent-release once Chrome has\n // implemented it natively. http://crbug.com/448888\n // This is a non-issue if we've deprecated the polyfill by then, since\n // prefixed EME is on its way out.\n if (sessionType != 'temporary' && sessionType != 'persistent-license') {\n throw new TypeError('Session type ' + opt_sessionType +\n ' is unsupported on this platform.');\n }\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n\n // Unprefixed EME allows for session creation without a video tag or src.\n // Prefixed EME requires both a valid HTMLMediaElement and a src.\n var media = this.media_ || /** @type {!HTMLMediaElement} */(\n document.createElement('video'));\n if (!media.src) media.src = 'about:blank';\n\n var session = new PatchedMediaKeysWebkit.MediaKeySession(\n media, this.keySystem_, sessionType);\n this.newSessions_.push(session);\n return session;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setServerCertificate =\n function(serverCertificate) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.setServerCertificate');\n\n // There is no equivalent in v0.1b, so return failure.\n return Promise.resolve(false);\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitNeedKey_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitNeedKey_', event);\n goog.asserts.assert(this.media_, 'media_ not set in onWebkitNeedKey_');\n\n var event2 = document.createEvent('CustomEvent');\n event2.initCustomEvent('encrypted', false, false, null);\n\n // not used by v0.1b EME, but given a valid value\n event2.initDataType = 'webm';\n event2.initData = event.initData;\n\n this.media_.dispatchEvent(event2);\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyMessage_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitKeyMessage_', event);\n\n var session = this.findSession_(event.sessionId);\n if (!session) {\n shaka.log.error('Session not found', event.sessionId);\n return;\n }\n\n var isNew = session.keyStatuses.getStatus() == undefined;\n\n var event2 = new shaka.util.FakeEvent('message', {\n messageType: isNew ? 'licenserequest' : 'licenserenewal',\n message: event.message\n });\n\n session.generated();\n session.dispatchEvent(event2);\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyAdded_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitKeyAdded_', event);\n\n var session = this.findSession_(event.sessionId);\n goog.asserts.assert(session, 'unable to find session in onWebkitKeyAdded_');\n if (session) {\n session.ready();\n }\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyError_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitKeyError_', event);\n\n var session = this.findSession_(event.sessionId);\n goog.asserts.assert(session, 'unable to find session in onWebkitKeyError_');\n if (session) {\n session.handleError(event);\n }\n};\n\n\n/**\n * @param {string} sessionId\n * @return {shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.findSession_ =\n function(sessionId) {\n var session = this.sessionMap_[sessionId];\n if (session) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.findSession_', session);\n return session;\n }\n\n session = this.newSessions_.shift();\n if (session) {\n session.sessionId = sessionId;\n this.sessionMap_[sessionId] = session;\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.findSession_', session);\n return session;\n }\n\n return null;\n};\n\n\n\n/**\n * An implementation of MediaKeySession.\n *\n * @param {!HTMLMediaElement} media\n * @param {string} keySystem\n * @param {string} sessionType\n *\n * @constructor\n * @struct\n * @implements {MediaKeySession}\n * @extends {shaka.util.FakeEventTarget}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession =\n function(media, keySystem, sessionType) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession');\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {!HTMLMediaElement} */\n this.media_ = media;\n\n /** @private {boolean} */\n this.initialized_ = false;\n\n /** @private {shaka.util.PublicPromise} */\n this.generatePromise_ = null;\n\n /** @private {shaka.util.PublicPromise} */\n this.updatePromise_ = null;\n\n /** @private {string} */\n this.keySystem_ = keySystem;\n\n /** @private {string} */\n this.type_ = sessionType;\n\n /** @type {string} */\n this.sessionId = '';\n\n /** @type {number} */\n this.expiration = NaN;\n\n /** @type {!shaka.util.PublicPromise} */\n this.closed = new shaka.util.PublicPromise();\n\n /** @type {!MediaKeyStatusMap} */\n this.keyStatuses =\n new shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap();\n};\ngoog.inherits(shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession,\n shaka.util.FakeEventTarget);\n\n\n/**\n * Signals that the license request has been generated. This resolves the\n * 'generateRequest' promise.\n *\n * @protected\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generated =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.generated');\n\n if (this.generatePromise_) {\n this.generatePromise_.resolve();\n this.generatePromise_ = null;\n }\n};\n\n\n/**\n * Signals that the session is 'ready', which is the terminology used in older\n * versions of EME. The new signal is to resolve the 'update' promise. This\n * translates between the two.\n *\n * @protected\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.ready =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.ready');\n\n this.updateKeyStatus_('usable');\n\n if (this.updatePromise_) {\n this.updatePromise_.resolve();\n }\n this.updatePromise_ = null;\n};\n\n\n/**\n * Either rejects a promise, or dispatches an error event, as appropriate.\n *\n * @param {!MediaKeyEvent} event\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.handleError =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.handleError', event);\n\n // This does not match the DOMException we get in current WD EME, but it will\n // at least provide some information which can be used to look into the\n // problem.\n var error = new Error('EME v0.1b key error');\n error.errorCode = event.errorCode;\n error.errorCode.systemCode = event.systemCode;\n\n // The presence or absence of sessionId indicates whether this corresponds to\n // generateRequest() or update().\n if (!event.sessionId && this.generatePromise_) {\n error.method = 'generateRequest';\n if (event.systemCode == 45) {\n error.message = 'Unsupported session type.';\n }\n this.generatePromise_.reject(error);\n this.generatePromise_ = null;\n } else if (event.sessionId && this.updatePromise_) {\n error.method = 'update';\n this.updatePromise_.reject(error);\n this.updatePromise_ = null;\n } else {\n // This mapping of key statuses is imperfect at best.\n var code = event.errorCode.code;\n var systemCode = event.systemCode;\n if (code == MediaKeyError['MEDIA_KEYERR_OUTPUT']) {\n this.updateKeyStatus_('output-restricted');\n } else if (systemCode == 1) {\n this.updateKeyStatus_('expired');\n } else {\n this.updateKeyStatus_('internal-error');\n }\n }\n};\n\n\n/**\n * Logic which is shared between generateRequest() and load(), both of which\n * are ultimately implemented with webkitGenerateKeyRequest in prefixed EME.\n *\n * @param {?BufferSource} initData\n * @param {?string} offlineSessionId\n * @return {!Promise}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generate_ =\n function(initData, offlineSessionId) {\n if (this.initialized_) {\n return Promise.reject(new Error('The session is already initialized.'));\n }\n\n this.initialized_ = true;\n\n /** @type {!Uint8Array} */\n var mangledInitData;\n\n try {\n if (this.type_ == 'persistent-license') {\n var StringUtils = shaka.util.StringUtils;\n if (!offlineSessionId) {\n // Persisting the initial license.\n // Prefix the init data with a tag to indicate persistence.\n var prefix = StringUtils.toUTF8('PERSISTENT|');\n var result = new Uint8Array(prefix.byteLength + initData.byteLength);\n result.set(new Uint8Array(prefix), 0);\n result.set(new Uint8Array(initData), prefix.byteLength);\n mangledInitData = result;\n } else {\n // Loading a stored license.\n // Prefix the init data (which is really a session ID) with a tag to\n // indicate that we are loading a persisted session.\n mangledInitData = new Uint8Array(\n StringUtils.toUTF8('LOAD_SESSION|' + offlineSessionId));\n }\n } else {\n // Streaming.\n goog.asserts.assert(this.type_ == 'temporary',\n 'expected temporary session');\n goog.asserts.assert(!offlineSessionId,\n 'unexpected offline session ID');\n mangledInitData = new Uint8Array(initData);\n }\n\n goog.asserts.assert(mangledInitData,\n 'init data not set!');\n } catch (exception) {\n return Promise.reject(exception);\n }\n\n goog.asserts.assert(this.generatePromise_ == null,\n 'generatePromise_ should be null');\n this.generatePromise_ = new shaka.util.PublicPromise();\n\n // Because we are hacking media.src in createSession to better emulate\n // unprefixed EME's ability to create sessions and license requests without a\n // video tag, we can get ourselves into trouble. It seems that sometimes,\n // the setting of media.src hasn't been processed by some other thread, and\n // GKR can throw an exception. If this occurs, wait 10 ms and try again at\n // most once. This situation should only occur when init data is available\n // ahead of the 'needkey' event.\n\n var prefixApi = shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_;\n var generateKeyRequestName = prefixApi('generateKeyRequest');\n try {\n this.media_[generateKeyRequestName](this.keySystem_, mangledInitData);\n } catch (exception) {\n if (exception.name != 'InvalidStateError') {\n this.generatePromise_ = null;\n return Promise.reject(exception);\n }\n\n setTimeout(function() {\n try {\n this.media_[generateKeyRequestName](this.keySystem_, mangledInitData);\n } catch (exception) {\n this.generatePromise_.reject(exception);\n this.generatePromise_ = null;\n }\n }.bind(this), 10);\n }\n\n return this.generatePromise_;\n};\n\n\n/**\n * An internal version of update which defers new calls while old ones are in\n * progress.\n *\n * @param {!shaka.util.PublicPromise} promise The promise associated with this\n * call.\n * @param {?BufferSource} response\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update_ =\n function(promise, response) {\n if (this.updatePromise_) {\n // We already have an update in-progress, so defer this one until after the\n // old one is resolved. Execute this whether the original one succeeds or\n // fails.\n this.updatePromise_.then(\n this.update_.bind(this, promise, response)\n ).catch(\n this.update_.bind(this, promise, response)\n );\n return;\n }\n\n this.updatePromise_ = promise;\n\n var key;\n var keyId;\n\n if (this.keySystem_ == 'webkit-org.w3.clearkey') {\n // The current EME version of clearkey wants a structured JSON response.\n // The v0.1b version wants just a raw key. Parse the JSON response and\n // extract the key and key ID.\n var StringUtils = shaka.util.StringUtils;\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n var licenseString = StringUtils.fromUTF8(response);\n var jwkSet = /** @type {JWKSet} */ (JSON.parse(licenseString));\n var kty = jwkSet.keys[0].kty;\n if (kty != 'oct') {\n // Reject the promise.\n var error = new Error('Response is not a valid JSON Web Key Set.');\n this.updatePromise_.reject(error);\n this.updatePromise_ = null;\n }\n key = Uint8ArrayUtils.fromBase64(jwkSet.keys[0].k);\n keyId = Uint8ArrayUtils.fromBase64(jwkSet.keys[0].kid);\n } else {\n // The key ID is not required.\n key = new Uint8Array(response);\n keyId = null;\n }\n\n var prefixApi = shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_;\n var addKeyName = prefixApi('addKey');\n try {\n this.media_[addKeyName](this.keySystem_, key, keyId, this.sessionId);\n } catch (exception) {\n // Reject the promise.\n this.updatePromise_.reject(exception);\n this.updatePromise_ = null;\n }\n};\n\n\n/**\n * Update key status and dispatch a 'keystatuseschange' event.\n *\n * @param {string} status\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.\n updateKeyStatus_ = function(status) {\n this.keyStatuses.setStatus(status);\n var event = new shaka.util.FakeEvent('keystatuseschange');\n this.dispatchEvent(event);\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.\n generateRequest = function(initDataType, initData) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.generateRequest');\n return this.generate_(initData, null);\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.load =\n function(sessionId) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.load');\n if (this.type_ == 'persistent-license') {\n return this.generate_(null, sessionId);\n } else {\n return Promise.reject(new Error('Not a persistent session.'));\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update =\n function(response) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.update', response);\n goog.asserts.assert(this.sessionId, 'update without session ID');\n\n var nextUpdatePromise = new shaka.util.PublicPromise();\n this.update_(nextUpdatePromise, response);\n return nextUpdatePromise;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.close =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.close');\n\n // This will remove a persistent session, but it's also the only way to\n // free CDM resources on v0.1b.\n if (this.type_ != 'persistent-license') {\n // sessionId may reasonably be null if no key request has been generated\n // yet. Unprefixed EME will return a rejected promise in this case.\n // We will use the same error message that Chrome 41 uses in its EME\n // implementation.\n if (!this.sessionId) {\n this.closed.reject(new Error('The session is not callable.'));\n return this.closed;\n }\n\n // This may throw an exception, but we ignore it because we are only using\n // it to clean up resources in v0.1b. We still consider the session closed.\n // We can't let the exception propagate because MediaKeySession.close()\n // should not throw.\n var prefixApi = shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_;\n var cancelKeyRequestName = prefixApi('cancelKeyRequest');\n try {\n this.media_[cancelKeyRequestName](this.keySystem_, this.sessionId);\n } catch (exception) {}\n }\n\n // Resolve the 'closed' promise and return it.\n this.closed.resolve();\n return this.closed;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.remove =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.remove');\n\n if (this.type_ != 'persistent-license') {\n return Promise.reject(new Error('Not a persistent session.'));\n }\n\n return this.close();\n};\n\n\n\n/**\n * An implementation of MediaKeyStatusMap.\n * This fakes a map with a single key ID.\n *\n * @constructor\n * @struct\n * @implements {MediaKeyStatusMap}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap = function() {\n /**\n * @type {number}\n */\n this.size = 0;\n\n /**\n * @private {string|undefined}\n */\n this.status_ = undefined;\n};\n\n\n/**\n * @const {!ArrayBuffer}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_;\n\n\n/**\n * An internal method used by the session to set key status.\n * @param {string|undefined} status\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.setStatus =\n function(status) {\n this.size = status == undefined ? 0 : 1;\n this.status_ = status;\n};\n\n\n/**\n * An internal method used by the session to get key status.\n * @return {string|undefined}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.getStatus =\n function() {\n return this.status_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.forEach =\n function(fn) {\n if (this.status_) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_;\n fn(this.status_, fakeKeyId);\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.get =\n function(keyId) {\n if (this.has(keyId)) {\n return this.status_;\n }\n return undefined;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.has =\n function(keyId) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_;\n if (this.status_ &&\n shaka.util.Uint8ArrayUtils.equal(\n new Uint8Array(keyId), new Uint8Array(fakeKeyId))) {\n return true;\n }\n return false;\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.\n entries = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.\n keys = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.\n values = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/patchedmediakeys_webkit.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.MediaSource');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.MediaSource\n *\n * @summary A polyfill to patch MSE bugs.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.MediaSource.install = function() {\n shaka.log.debug('MediaSource.install');\n\n if (!window.MediaSource) {\n shaka.log.info('No MSE implementation available.');\n return;\n }\n\n // Detection is complicated by the fact that Safari does not expose\n // SourceBuffer on window. So we can't detect missing features by accessing\n // SourceBuffer.prototype. That is why we use navigator to detect Safari and\n // particular versions of it.\n var vendor = navigator.vendor;\n var version = navigator.appVersion;\n if (!vendor || !version || vendor.indexOf('Apple') < 0) {\n shaka.log.info('Using native MSE as-is.');\n return;\n }\n\n if (version.indexOf('Version/8') >= 0) {\n // Safari 8 does not implement appendWindowEnd. If we ignore the\n // incomplete MSE implementation, some content (especially multi-period)\n // will fail to play correctly. The best we can do is blacklist Safari 8.\n shaka.log.info('Blacklisting Safari 8 MSE.');\n shaka.polyfill.MediaSource.blacklist_();\n } else if (version.indexOf('Version/9') >= 0) {\n shaka.log.info('Patching Safari 9 MSE bugs.');\n // Safari 9 does not correctly implement abort() on SourceBuffer.\n // Calling abort() causes a decoder failure, rather than resetting the\n // decode timestamp as called for by the spec.\n // Bug filed: http://goo.gl/UZ2rPp\n shaka.polyfill.MediaSource.stubAbort_();\n } else if (version.indexOf('Version/10') >= 0) {\n shaka.log.info('Patching Safari 10 MSE bugs.');\n // Safari 10 does not correctly implement abort() on SourceBuffer.\n // Calling abort() before appending a segment causes that segment to be\n // incomplete in buffer.\n // Bug filed: https://goo.gl/rC3CLj\n shaka.polyfill.MediaSource.stubAbort_();\n // Safari 10 fires spurious 'updateend' events after endOfStream().\n // Bug filed: https://goo.gl/qCeTZr\n shaka.polyfill.MediaSource.patchEndOfStreamEvents_();\n } else {\n shaka.log.info('Using native MSE as-is.');\n }\n};\n\n\n/**\n * Blacklist the current browser by making MediaSourceEngine.isBrowserSupported\n * fail later.\n *\n * @private\n */\nshaka.polyfill.MediaSource.blacklist_ = function() {\n window['MediaSource'] = null;\n};\n\n\n/**\n * Stub out abort(). On some buggy MSE implementations, calling abort() causes\n * various problems.\n *\n * @private\n */\nshaka.polyfill.MediaSource.stubAbort_ = function() {\n var addSourceBuffer = MediaSource.prototype.addSourceBuffer;\n MediaSource.prototype.addSourceBuffer = function() {\n var sourceBuffer = addSourceBuffer.apply(this, arguments);\n sourceBuffer.abort = function() {}; // Stub out for buggy implementations.\n return sourceBuffer;\n };\n};\n\n\n/**\n * Patch endOfStream() to get rid of 'updateend' events that should not fire.\n * These extra events confuse MediaSourceEngine, which relies on correct events\n * to manage SourceBuffer state.\n *\n * @private\n */\nshaka.polyfill.MediaSource.patchEndOfStreamEvents_ = function() {\n var endOfStream = MediaSource.prototype.endOfStream;\n MediaSource.prototype.endOfStream = function() {\n // This bug manifests only when endOfStream() results in the truncation\n // of the MediaSource's duration. So first we must calculate what the\n // new duration will be.\n var newDuration = 0;\n for (var i = 0; i < this.sourceBuffers.length; ++i) {\n var buffer = this.sourceBuffers[i];\n var bufferEnd = buffer.buffered.end(buffer.buffered.length - 1);\n newDuration = Math.max(newDuration, bufferEnd);\n }\n\n // If the duration is going to be reduced, suppress the next 'updateend'\n // event on each SourceBuffer.\n if (!isNaN(this.duration) &&\n newDuration < this.duration) {\n this.ignoreUpdateEnd_ = true;\n for (var i = 0; i < this.sourceBuffers.length; ++i) {\n var buffer = this.sourceBuffers[i];\n buffer.eventSuppressed_ = false;\n }\n }\n\n return endOfStream.apply(this, arguments);\n };\n\n var addSourceBuffer = MediaSource.prototype.addSourceBuffer;\n MediaSource.prototype.addSourceBuffer = function() {\n // After adding a new source buffer, add an event listener to allow us to\n // suppress events.\n var sourceBuffer = addSourceBuffer.apply(this, arguments);\n sourceBuffer.mediaSource_ = this;\n sourceBuffer.addEventListener('updateend',\n shaka.polyfill.MediaSource.ignoreUpdateEnd_, false);\n\n if (!this.cleanUpHandlerInstalled_) {\n // If we haven't already, install an event listener to allow us to clean\n // up listeners when MediaSource is torn down.\n this.addEventListener('sourceclose',\n shaka.polyfill.MediaSource.cleanUpListeners_, false);\n this.cleanUpHandlerInstalled_ = true;\n }\n return sourceBuffer;\n };\n};\n\n\n/**\n * An event listener for 'updateend' which selectively suppresses the events.\n *\n * @see shaka.polyfill.MediaSource.patchEndOfStreamEvents_\n *\n * @param {Event} event\n * @private\n */\nshaka.polyfill.MediaSource.ignoreUpdateEnd_ = function(event) {\n var sourceBuffer = event.target;\n var mediaSource = sourceBuffer.mediaSource_;\n\n if (mediaSource.ignoreUpdateEnd_) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n sourceBuffer.eventSuppressed_ = true;\n\n for (var i = 0; i < mediaSource.sourceBuffers.length; ++i) {\n var buffer = mediaSource.sourceBuffers[i];\n if (buffer.eventSuppressed_ == false) {\n // More events need to be suppressed.\n return;\n }\n }\n\n // All events have been suppressed, all buffers are out of 'updating'\n // mode. Stop suppressing events.\n mediaSource.ignoreUpdateEnd_ = false;\n }\n};\n\n\n/**\n * An event listener for 'sourceclose' which cleans up listeners for 'updateend'\n * to avoid memory leaks.\n *\n * @see shaka.polyfill.MediaSource.patchEndOfStreamEvents_\n * @see shaka.polyfill.MediaSource.ignoreUpdateEnd_\n *\n * @param {Event} event\n * @private\n */\nshaka.polyfill.MediaSource.cleanUpListeners_ = function(event) {\n var mediaSource = event.target;\n for (var i = 0; i < mediaSource.sourceBuffers.length; ++i) {\n var buffer = mediaSource.sourceBuffers[i];\n buffer.removeEventListener('updateend',\n shaka.polyfill.MediaSource.ignoreUpdateEnd_, false);\n }\n mediaSource.removeEventListener('sourceclose',\n shaka.polyfill.MediaSource.cleanUpListeners_, false);\n};\n\n\nshaka.polyfill.register(shaka.polyfill.MediaSource.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/mediasource.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.Promise');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n\n/**\n * @summary A polyfill to implement Promises, primarily for IE.\n * Only partially supports thenables, but otherwise passes the A+ conformance\n * tests.\n * Note that Promise.all() and Promise.race() are not tested by that suite.\n *\n * @constructor\n * @struct\n * @param {function(function(*), function(*))=} opt_callback\n * @template T\n */\nshaka.polyfill.Promise = function(opt_callback) {\n /** @private {!Array.<shaka.polyfill.Promise.Child>} */\n this.thens_ = [];\n\n /** @private {!Array.<shaka.polyfill.Promise.Child>} */\n this.catches_ = [];\n\n /** @private {shaka.polyfill.Promise.State} */\n this.state_ = shaka.polyfill.Promise.State.PENDING;\n\n /** @private {*} */\n this.value_;\n\n // External callers must supply the callback. Internally, we may construct\n // child Promises without it, since we can directly access their resolve_ and\n // reject_ methods when convenient.\n if (opt_callback) {\n try {\n opt_callback(this.resolve_.bind(this), this.reject_.bind(this));\n } catch (e) {\n this.reject_(e);\n }\n }\n};\n\n\n/**\n * @typedef {{\n * promise: !shaka.polyfill.Promise,\n * callback: (function(*)|undefined)\n * }}\n *\n * @summary A child promise, used for chaining.\n * @description\n * Only exists in the context of a then or catch chain.\n * @property {!shaka.polyfill.Promise} promise\n * The child promise.\n * @property {(function(*)|undefined)} callback\n * The then or catch callback to be invoked as part of this chain.\n */\nshaka.polyfill.Promise.Child;\n\n\n/**\n * @enum {number}\n */\nshaka.polyfill.Promise.State = {\n PENDING: 0,\n RESOLVED: 1,\n REJECTED: 2\n};\n\n\n/**\n * Install the polyfill if needed.\n * @param {boolean=} opt_force If true, force the polyfill to be installed.\n * Used in some unit tests.\n */\nshaka.polyfill.Promise.install = function(opt_force) {\n // Decide on the best way to invoke a callback as soon as possible.\n // Precompute the setImmediate/clearImmediate convenience methods to avoid the\n // overhead of this switch every time a callback has to be invoked.\n if (window.setImmediate) {\n // For IE and node.js:\n shaka.polyfill.Promise.setImmediate_ = function(callback) {\n return window.setImmediate(callback);\n };\n shaka.polyfill.Promise.clearImmediate_ = function(id) {\n return window.clearImmediate(id);\n };\n } else {\n // For everyone else:\n shaka.polyfill.Promise.setImmediate_ = function(callback) {\n return window.setTimeout(callback, 0);\n };\n shaka.polyfill.Promise.clearImmediate_ = function(id) {\n return window.clearTimeout(id);\n };\n }\n\n if (window.Promise && !opt_force) {\n shaka.log.info('Using native Promises.');\n return;\n }\n\n shaka.log.info('Using Promises polyfill.');\n // Quoted to work around type-checking, since our then() signature doesn't\n // exactly match that of a native Promise.\n window['Promise'] = shaka.polyfill.Promise;\n\n // Explicitly installed because the compiler won't necessarily attach them\n // to the compiled constructor. Exporting them will only attach them to\n // their original namespace, which isn't the same as attaching them to the\n // constructor unless you also export the constructor.\n window['Promise'].resolve = shaka.polyfill.Promise.resolve;\n window['Promise'].reject = shaka.polyfill.Promise.reject;\n window['Promise'].all = shaka.polyfill.Promise.all;\n window['Promise'].race = shaka.polyfill.Promise.race;\n\n // These are manually exported as well, because allowing the compiler to\n // export them for us will cause the polyfill to end up in our generated\n // externs. Since nobody should be accessing this directly using the\n // shaka.polyfill namespace, it is okay not to @export these methods.\n window['Promise']['prototype']['then'] =\n shaka.polyfill.Promise.prototype.then;\n window['Promise']['prototype']['catch'] =\n shaka.polyfill.Promise.prototype.catch;\n};\n\n\n/**\n * Uninstall the polyfill. Used in some unit tests.\n */\nshaka.polyfill.Promise.uninstall = function() {\n // Do nothing if there is no native implementation.\n if (shaka.polyfill.Promise.nativePromise_) {\n shaka.log.info('Removing Promise polyfill.');\n window['Promise'] = shaka.polyfill.Promise.nativePromise_;\n shaka.polyfill.Promise.q_ = [];\n }\n};\n\n\n/**\n * @param {*} value\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.resolve = function(value) {\n var p = new shaka.polyfill.Promise();\n p.resolve_(undefined);\n return p.then(function() {\n return value;\n });\n};\n\n\n/**\n * @param {*} reason\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.reject = function(reason) {\n var p = new shaka.polyfill.Promise();\n p.reject_(reason);\n return p;\n};\n\n\n/**\n * @param {!Array.<!shaka.polyfill.Promise>} others\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.all = function(others) {\n var p = new shaka.polyfill.Promise();\n if (!others.length) {\n p.resolve_([]);\n return p;\n }\n\n // The array of results must be in the same order as the array of Promises\n // passed to all(). So we pre-allocate the array and keep a count of how\n // many have resolved. Only when all have resolved is the returned Promise\n // itself resolved.\n var count = 0;\n var values = new Array(others.length);\n var resolve = function(p, i, newValue) {\n goog.asserts.assert(p.state_ != shaka.polyfill.Promise.State.RESOLVED,\n 'Invalid Promise state in Promise.all');\n // If one of the Promises in the array was rejected, this Promise was\n // rejected and new values are ignored. In such a case, the values array\n // and its contents continue to be alive in memory until all of the Promises\n // in the array have completed.\n if (p.state_ == shaka.polyfill.Promise.State.PENDING) {\n values[i] = newValue;\n count++;\n if (count == values.length) {\n p.resolve_(values);\n }\n }\n };\n\n var reject = p.reject_.bind(p);\n for (var i = 0; i < others.length; ++i) {\n if (others[i] && others[i].then) {\n others[i].then(resolve.bind(null, p, i), reject);\n } else {\n resolve(p, i, others[i]);\n }\n }\n return p;\n};\n\n\n/**\n * @param {!Array.<!shaka.polyfill.Promise>} others\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.race = function(others) {\n var p = new shaka.polyfill.Promise();\n\n // The returned Promise is resolved or rejected as soon as one of the others\n // is.\n var resolve = p.resolve_.bind(p);\n var reject = p.reject_.bind(p);\n for (var i = 0; i < others.length; ++i) {\n if (others[i] && others[i].then) {\n others[i].then(resolve, reject);\n } else {\n resolve(others[i]);\n }\n }\n return p;\n};\n\n\n/**\n * @param {function(*)=} opt_successCallback\n * @param {function(*)=} opt_failCallback\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.prototype.then = function(opt_successCallback,\n opt_failCallback) {\n // then() returns a child Promise which is chained onto this one.\n var child = new shaka.polyfill.Promise();\n switch (this.state_) {\n case shaka.polyfill.Promise.State.RESOLVED:\n // This is already resolved, so we can chain to the child ASAP.\n this.schedule_(child, opt_successCallback);\n break;\n case shaka.polyfill.Promise.State.REJECTED:\n // This is already rejected, so we can chain to the child ASAP.\n this.schedule_(child, opt_failCallback);\n break;\n case shaka.polyfill.Promise.State.PENDING:\n // This is pending, so we have to track both callbacks and the child\n // in order to chain later.\n this.thens_.push({ promise: child, callback: opt_successCallback});\n this.catches_.push({ promise: child, callback: opt_failCallback});\n break;\n }\n\n return child;\n};\n\n\n/**\n * @param {function(*)=} opt_callback\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.prototype.catch = function(opt_callback) {\n // Devolves into a two-argument call to 'then'.\n return this.then(undefined, opt_callback);\n};\n\n\n/**\n * @param {*} value\n * @private\n */\nshaka.polyfill.Promise.prototype.resolve_ = function(value) {\n // Ignore resolve calls if we aren't still pending.\n if (this.state_ == shaka.polyfill.Promise.State.PENDING) {\n this.value_ = value;\n this.state_ = shaka.polyfill.Promise.State.RESOLVED;\n // Schedule calls to all of the chained callbacks.\n for (var i = 0; i < this.thens_.length; ++i) {\n this.schedule_(this.thens_[i].promise, this.thens_[i].callback);\n }\n this.thens_ = [];\n this.catches_ = [];\n }\n};\n\n\n/**\n * @param {*} reason\n * @private\n */\nshaka.polyfill.Promise.prototype.reject_ = function(reason) {\n // Ignore reject calls if we aren't still pending.\n if (this.state_ == shaka.polyfill.Promise.State.PENDING) {\n this.value_ = reason;\n this.state_ = shaka.polyfill.Promise.State.REJECTED;\n // Schedule calls to all of the chained callbacks.\n for (var i = 0; i < this.catches_.length; ++i) {\n this.schedule_(this.catches_[i].promise, this.catches_[i].callback);\n }\n this.thens_ = [];\n this.catches_ = [];\n }\n};\n\n\n/**\n * @param {!shaka.polyfill.Promise} child\n * @param {function(*)|undefined} callback\n * @private\n */\nshaka.polyfill.Promise.prototype.schedule_ = function(child, callback) {\n goog.asserts.assert(this.state_ != shaka.polyfill.Promise.State.PENDING,\n 'Invalid Promise state in Promise.schedule_');\n var Promise = shaka.polyfill.Promise;\n\n var wrapper = function() {\n if (callback && typeof callback == 'function') {\n // Wrap around the callback. Exceptions thrown by the callback are\n // converted to failures.\n try {\n var value = callback(this.value_);\n } catch (exception) {\n child.reject_(exception);\n return;\n }\n\n // According to the spec, 'then' in a thenable may only be accessed once\n // and any thrown exceptions in the getter must cause the Promise chain\n // to fail.\n var then;\n try {\n then = value && value.then;\n } catch (exception) {\n child.reject_(exception);\n return;\n }\n\n if (value instanceof Promise) {\n // If the returned value is a Promise, we bind it's state to the child.\n if (value == child) {\n // Without this, a bad calling pattern can cause an infinite loop.\n child.reject_(new TypeError('Chaining cycle detected'));\n } else {\n value.then(child.resolve_.bind(child), child.reject_.bind(child));\n }\n } else if (then) {\n // If the returned value is thenable, chain it to the child.\n Promise.handleThenable_(value, then, child);\n } else {\n // If the returned value is not a Promise, the child is resolved with\n // that value.\n child.resolve_(value);\n }\n } else if (this.state_ == Promise.State.RESOLVED) {\n // No callback for this state, so just chain on down the line.\n child.resolve_(this.value_);\n } else {\n // No callback for this state, so just chain on down the line.\n child.reject_(this.value_);\n }\n };\n\n // Enqueue a call to the wrapper.\n Promise.q_.push(wrapper.bind(this));\n if (Promise.flushTimer_ == null) {\n Promise.flushTimer_ = Promise.setImmediate_(Promise.flush);\n }\n};\n\n\n/**\n * @param {!Object} thenable\n * @param {Function} then\n * @param {!shaka.polyfill.Promise} child\n * @private\n */\nshaka.polyfill.Promise.handleThenable_ = function(thenable, then, child) {\n var Promise = shaka.polyfill.Promise;\n try {\n var sealed = false;\n then.call(thenable, function(value) {\n if (sealed) return;\n sealed = true;\n\n var nextThen;\n try {\n nextThen = value && value.then;\n } catch (exception) {\n child.reject_(exception);\n return;\n }\n\n if (nextThen) {\n Promise.handleThenable_(value, nextThen, child);\n } else {\n child.resolve_(value);\n }\n }, child.reject_.bind(child));\n } catch (exception) {\n child.reject_(exception);\n }\n};\n\n\n/**\n * Flush the queue of callbacks.\n * Used directly by some unit tests.\n */\nshaka.polyfill.Promise.flush = function() {\n var Promise = shaka.polyfill.Promise;\n\n // Flush as long as we have callbacks. This means we can finish a chain more\n // quickly, since we avoid the overhead of multiple calls to setTimeout, each\n // of which has a minimum resolution of as much as 15ms on IE11.\n // This helps to fix the out-of-order task bug on IE:\n // https://github.com/google/shaka-player/issues/251#issuecomment-178146242\n while (Promise.q_.length) {\n // Callbacks may enqueue other callbacks, so clear the timer ID and swap the\n // queue before we do anything else.\n if (Promise.flushTimer_ != null) {\n Promise.clearImmediate_(Promise.flushTimer_);\n Promise.flushTimer_ = null;\n }\n var q = Promise.q_;\n Promise.q_ = [];\n\n for (var i = 0; i < q.length; ++i) {\n q[i]();\n }\n }\n};\n\n\n/**\n * @param {function()} callback\n * @return {number}\n * Schedule a callback as soon as possible.\n * Bound in shaka.polyfill.Promise.install() to a specific implementation.\n * @private\n */\nshaka.polyfill.Promise.setImmediate_ = function(callback) { return 0; };\n\n\n/**\n * @param {number} id\n * Clear a scheduled callback.\n * Bound in shaka.polyfill.Promise.install() to a specific implementation.\n * @private\n */\nshaka.polyfill.Promise.clearImmediate_ = function(id) {};\n\n\n/**\n * A timer ID to flush the queue.\n * @private {?number}\n */\nshaka.polyfill.Promise.flushTimer_ = null;\n\n\n/**\n * A queue of callbacks to be invoked ASAP in the next frame.\n * @private {!Array.<function()>}\n */\nshaka.polyfill.Promise.q_ = [];\n\n\n/** @private {?} */\nshaka.polyfill.Promise.nativePromise_ = window.Promise;\n\n\nshaka.polyfill.register(shaka.polyfill.Promise.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/promise.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.VideoPlaybackQuality');\n\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.VideoPlaybackQuality\n *\n * @summary A polyfill to provide MSE VideoPlaybackQuality metrics.\n * Many browsers do not yet provide this API, and Chrome currently provides\n * similar data through individual prefixed attributes on HTMLVideoElement.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.VideoPlaybackQuality.install = function() {\n if (!window.HTMLVideoElement) {\n // Avoid errors on very old browsers.\n return;\n }\n\n var proto = HTMLVideoElement.prototype;\n if (proto.getVideoPlaybackQuality) {\n // No polyfill needed.\n return;\n }\n\n if ('webkitDroppedFrameCount' in proto) {\n proto.getVideoPlaybackQuality =\n shaka.polyfill.VideoPlaybackQuality.webkit_;\n }\n};\n\n\n/**\n * @this {HTMLVideoElement}\n * @return {!VideoPlaybackQuality}\n * @private\n */\nshaka.polyfill.VideoPlaybackQuality.webkit_ = function() {\n return {\n 'droppedVideoFrames': this.webkitDroppedFrameCount,\n 'totalVideoFrames': this.webkitDecodedFrameCount,\n // Not provided by this polyfill:\n 'corruptedVideoFrames': 0,\n 'creationTime': NaN,\n 'totalFrameDelay': 0\n };\n};\n\n\nshaka.polyfill.register(shaka.polyfill.VideoPlaybackQuality.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/videoplaybackquality.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.VTTCue');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.VTTCue\n *\n * @summary A polyfill to provide VTTCue.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.VTTCue.install = function() {\n if (window.VTTCue) {\n shaka.log.info('Using native VTTCue.');\n return;\n }\n\n if (!window.TextTrackCue) {\n shaka.log.error('VTTCue not available.');\n return;\n }\n\n var constructorLength = TextTrackCue.length;\n if (constructorLength == 3) {\n shaka.log.info('Using VTTCue polyfill from 3 argument TextTrackCue.');\n window.VTTCue = shaka.polyfill.VTTCue.from3ArgsTextTrackCue_;\n } else if (constructorLength == 6) {\n shaka.log.info('Using VTTCue polyfill from 6 argument TextTrackCue.');\n window.VTTCue = shaka.polyfill.VTTCue.from6ArgsTextTrackCue_;\n } else if (shaka.polyfill.VTTCue.canUse3ArgsTextTrackCue_()) {\n shaka.log.info('Using VTTCue polyfill from 3 argument TextTrackCue.');\n window.VTTCue = shaka.polyfill.VTTCue.from3ArgsTextTrackCue_;\n }\n};\n\n\n/**\n * Draft spec TextTrackCue with 3 constructor arguments.\n * See {@link https://goo.gl/ZXBWZi W3C Working Draft 25 October 2012}.\n *\n * @param {number} startTime\n * @param {number} endTime\n * @param {string} text\n * @return {TextTrackCue}\n * @private\n */\nshaka.polyfill.VTTCue.from3ArgsTextTrackCue_ = function(startTime, endTime,\n text) {\n return new window.TextTrackCue(startTime, endTime, text);\n};\n\n\n/**\n * Draft spec TextTrackCue with 6 constructor arguments (5th & 6th are\n * optional).\n * See {@link https://goo.gl/AYFqUh W3C Working Draft 29 March 2012}.\n * Quoting the access to the TextTrackCue object to avoid the compiler\n * complaining.\n *\n * @param {number} startTime\n * @param {number} endTime\n * @param {string} text\n * @return {TextTrackCue}\n * @private\n */\nshaka.polyfill.VTTCue.from6ArgsTextTrackCue_ = function(startTime, endTime,\n text) {\n var id = startTime + '-' + endTime + '-' + text;\n return new window['TextTrackCue'](id, startTime, endTime, text);\n};\n\n\n/**\n * IE10, IE11 and Edge returns TextTrackCue.length = 0 although it accepts 3\n * constructor arguments.\n *\n * @return {boolean}\n * @private\n */\nshaka.polyfill.VTTCue.canUse3ArgsTextTrackCue_ = function() {\n try {\n return !!shaka.polyfill.VTTCue.from3ArgsTextTrackCue_(1, 2, '');\n } catch (error) {\n return false;\n }\n};\n\n\nshaka.polyfill.register(shaka.polyfill.VTTCue.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/vttcue.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.IndexedDB');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.IndexedDB\n *\n * @summary A polyfill to patch indexed db bugs.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.IndexedDB.install = function() {\n shaka.log.debug('IndexedDB.install');\n\n var agent = navigator.userAgent;\n if (agent && agent.indexOf('CrKey') >= 0) {\n shaka.log.debug('Removing IndexedDB from ChromeCast');\n delete window.indexedDB;\n goog.asserts.assert(\n !window.indexedDB, 'Failed to override window.indexedDB');\n }\n};\n\nshaka.polyfill.register(shaka.polyfill.IndexedDB.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/indexed_db.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\ngoog.provide('shaka.polyfill.MathRound');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n/**\n * @namespace shaka.polyfill.MathRound\n *\n * @summary A polyfill to patch math round bug on some browsers.\n */\n\n\n/**\n @const {number}\n @private\n */\nshaka.polyfill.MathRound.MAX_ACCURATE_INPUT_ = 0x10000000000000;\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.MathRound.install = function() {\n shaka.log.debug('mathRound.install');\n\n var testNumber = shaka.polyfill.MathRound.MAX_ACCURATE_INPUT_ + 1;\n if (Math.round(testNumber) != testNumber) {\n shaka.log.debug('polyfill Math.round');\n var original_mathRound = Math.round;\n Math.round = function(number) {\n var result = number;\n // https://stackoverflow.com/questions/12830742/javascript-math-round-bug-in-ie\n // Due to the precision of JavaScript numbers, the number must be integer\n if (number <= shaka.polyfill.MathRound.MAX_ACCURATE_INPUT_) {\n result = original_mathRound(number);\n }\n return result;\n };\n }\n};\n\nshaka.polyfill.register(shaka.polyfill.MathRound.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/mathround.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.MediaKeys');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.PatchedMediaKeysMs');\ngoog.require('shaka.polyfill.PatchedMediaKeysNop');\ngoog.require('shaka.polyfill.PatchedMediaKeysWebkit');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.MediaKeys\n *\n * @summary A polyfill to unify EME APIs across browser versions.\n *\n * The {@link https://w3c.github.io/encrypted-media/ EME spec} is still a\n * work-in-progress. As such, we need to provide a consistent API to the Shaka\n * Player. Until the spec is completely stable, the API provided by this\n * polyfill may lag behind the latest spec developments.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.MediaKeys.install = function() {\n shaka.log.debug('MediaKeys.install');\n\n if (!window.HTMLVideoElement) {\n // Avoid errors on very old browsers.\n return;\n }\n\n if (navigator.requestMediaKeySystemAccess &&\n MediaKeySystemAccess.prototype.getConfiguration) {\n shaka.log.info('Using native EME as-is.');\n } else if (HTMLMediaElement.prototype.webkitGenerateKeyRequest) {\n shaka.log.info('Using webkit-prefixed EME v0.1b');\n shaka.polyfill.PatchedMediaKeysWebkit.install('webkit');\n } else if (HTMLMediaElement.prototype.generateKeyRequest) {\n shaka.log.info('Using nonprefixed EME v0.1b');\n shaka.polyfill.PatchedMediaKeysWebkit.install('');\n } else if (window.MSMediaKeys) {\n shaka.log.info('Using ms-prefixed EME v20140218');\n shaka.polyfill.PatchedMediaKeysMs.install();\n } else {\n shaka.log.info('EME not available.');\n shaka.polyfill.PatchedMediaKeysNop.install();\n }\n};\n\n\nshaka.polyfill.register(shaka.polyfill.MediaKeys.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/mediakeys.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.VideoPlayPromise');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.VideoPlayPromise\n *\n * @summary A polyfill to silence the play() Promise in HTML5 video.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.VideoPlayPromise.install = function() {\n shaka.log.debug('VideoPlayPromise.install');\n\n if (window.HTMLMediaElement) {\n var originalPlay = HTMLMediaElement.prototype.play;\n HTMLMediaElement.prototype.play = function() {\n var p = originalPlay.apply(this, arguments);\n if (p) {\n // This browser is returning a Promise from play().\n // If the play() call fails or is interrupted, the Promise will be\n // rejected. Some apps, however, don't listen to this Promise,\n // especially since it is not available cross-browser. If the Promise\n // is rejected without anyone listening for the failure, an error will\n // appear in the JS console.\n // To avoid confusion over this innocuous \"error\", we will install a\n // catch handler on the Promise. This does not prevent the app from\n // also catching failures and handling them. It only prevents the\n // console message.\n p.catch(function() {});\n }\n return p;\n };\n }\n};\n\nshaka.polyfill.register(shaka.polyfill.VideoPlayPromise.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/video_play_promise.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///kaltura-player.min.js","webpack:///webpack/bootstrap fd0d76b9299a74bc6e92","webpack:///webpack:///core/webpack/universalModuleDefinition","webpack:///webpack:/core/webpack/bootstrap 2c6e69a47798e2a1ec2f","webpack:///webpack:///core/track/track.js","webpack:///webpack:///core/utils/logger.js","webpack:///webpack:///core/event/fake-event.js","webpack:///webpack:///core/track/audio-track.js","webpack:///webpack:///core/track/text-track.js","webpack:///webpack:///core/track/video-track.js","webpack:///webpack:///core/event/event-manager.js","webpack:///webpack:///core/event/events.js","webpack:///webpack:///core/player.js","webpack:///webpack:///core/event/fake-event-target.js","webpack:///webpack:///core/utils/player-error.js","webpack:///webpack:///core/utils/util.js","webpack:///webpack:///core/engines/html5/media-source/base-media-source-adapter.js","webpack:///webpack:///core/engines/html5/media-source/media-source-provider.js","webpack:///webpack:///core/plugin/base-plugin.js","webpack:///webpack:///core/plugin/plugin-manager.js","webpack:///webpack:///core/state/state-types.js","webpack:///webpack:///core/utils/multi-map.js","webpack:///webpack:///package.json","webpack:///webpack:///core/engines/html5/html5.js","webpack:///webpack:///core/engines/html5/media-source/adapters/native-adapter.js","webpack:///webpack:///core/playkit.js","webpack:///webpack:///core/state/state-manager.js","webpack:///webpack:///core/state/state.js","webpack:///webpack:///core/track/track-types.js","webpack:///webpack:///~/js-logger/src/logger.js","webpack:///webpack:///core/player-config.json","webpack:///webpack:///providers/webpack/universalModuleDefinition","webpack:///webpack:/providers/webpack/bootstrap 638014c152c6bb21e972","webpack:///webpack:///providers/k-provider/request-builder.js","webpack:///webpack:///providers/k-provider/ovp/config.js","webpack:///webpack:///providers/k-provider/enums.js","webpack:///webpack:///providers/k-provider/ovp/services/ovp-service.js","webpack:///webpack:///providers/k-provider/base-service-result.js","webpack:///webpack:///providers/util/logger.js","webpack:///webpack:///providers/k-provider/multi-request-builder.js","webpack:///webpack:///providers/entities/media-sources.js","webpack:///webpack:///providers/entities/media-entry.js","webpack:///webpack:///providers/entities/drm.js","webpack:///webpack:///providers/entities/media-format.js","webpack:///webpack:///providers/entities/media-source.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-flavor-asset.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-media-entry.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-metadata-list-response.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-playback-context.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-playback-source.js","webpack:///webpack:///~/enumify/lib/enumify.js","webpack:///webpack:///providers/k-provider/ovp/loaders/data-loader-manager.js","webpack:///webpack:///providers/k-provider/ovp/loaders/media-entry-loader.js","webpack:///webpack:///providers/k-provider/ovp/loaders/session-loader.js","webpack:///webpack:///providers/k-provider/ovp/loaders/ui-config-loader.js","webpack:///webpack:///providers/k-provider/ovp/provider-parser.js","webpack:///webpack:///providers/k-provider/ovp/ovp-provider.js","webpack:///webpack:///providers/k-provider/ovp/play-source-url-builder.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-access-control-message.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-base-entry-list-response.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-drm-playback-plugin-data.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-metadata.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-rule-action.js","webpack:///webpack:///providers/k-provider/ovp/response-types/kaltura-ui-conf-response.js","webpack:///webpack:///providers/k-provider/ovp/services/base-entry-service.js","webpack:///webpack:///providers/k-provider/ovp/services/meta-data-service.js","webpack:///webpack:///providers/k-provider/ovp/services/session-service.js","webpack:///webpack:///providers/k-provider/ovp/services/ui-conf-service.js","webpack:///webpack:///providers/k-provider/xml-parser.js","webpack:///./index.js","webpack:///webpack:///ui/webpack/universalModuleDefinition","webpack:///webpack:/ui/webpack/bootstrap 8f60fb2e6e6b40ac1263","webpack:///webpack:///node_modules/preact/dist/preact.js","webpack:///webpack:///node_modules/preact-redux/dist/preact-redux.js","webpack:///webpack:///ui/components/base.js","webpack:///webpack:///ui/utils/bind-actions.js","webpack:///webpack:///ui/components/icon/icon.js","webpack:///webpack:///node_modules/preact-i18n/dist/preact-i18n.js","webpack:///webpack:///node_modules/redux/es/index.js","webpack:///webpack:///node_modules/redux/es/utils/warning.js","webpack:///webpack:///ui/reducers/shell.js","webpack:///webpack:///ui/reducers/play-pause.js","webpack:///webpack:///ui/reducers/share.js","webpack:///webpack:///ui/reducers/cvaa.js","webpack:///webpack:///node_modules/process/browser.js","webpack:///webpack:///node_modules/redux/es/createStore.js","webpack:///webpack:///node_modules/lodash-es/isPlainObject.js","webpack:///webpack:///node_modules/lodash-es/_Symbol.js","webpack:///webpack:///node_modules/webpack/buildin/global.js","webpack:///webpack:///node_modules/redux/es/compose.js","webpack:///webpack:///ui/reducers/engine.js","webpack:///webpack:///ui/reducers/seekbar.js","webpack:///webpack:///ui/reducers/volume.js","webpack:///webpack:///ui/reducers/fullscreen.js","webpack:///webpack:///ui/reducers/loading.js","webpack:///webpack:///ui/reducers/settings.js","webpack:///webpack:///ui/utils/time-format.js","webpack:///webpack:///ui/components/smart-container/smart-container.js","webpack:///webpack:///ui/components/smart-container/smart-container-item.js","webpack:///webpack:///ui/components/overlay/overlay.js","webpack:///webpack:///ui/ui-manager.js","webpack:///webpack:///node_modules/lodash-es/_baseGetTag.js","webpack:///webpack:///node_modules/lodash-es/_root.js","webpack:///webpack:///node_modules/lodash-es/_freeGlobal.js","webpack:///webpack:///node_modules/lodash-es/_getRawTag.js","webpack:///webpack:///node_modules/lodash-es/_objectToString.js","webpack:///webpack:///node_modules/lodash-es/_getPrototype.js","webpack:///webpack:///node_modules/lodash-es/_overArg.js","webpack:///webpack:///node_modules/lodash-es/isObjectLike.js","webpack:///webpack:///node_modules/symbol-observable/index.js","webpack:///webpack:///node_modules/symbol-observable/lib/index.js","webpack:///webpack:///node_modules/webpack/buildin/module.js","webpack:///webpack:///node_modules/symbol-observable/lib/ponyfill.js","webpack:///webpack:///node_modules/redux/es/combineReducers.js","webpack:///webpack:///node_modules/redux/es/bindActionCreators.js","webpack:///webpack:///node_modules/redux/es/applyMiddleware.js","webpack:///webpack:///node_modules/dlv/dist/dlv.umd.js","webpack:///webpack:///ui/store.js","webpack:///webpack:///ui/fr.json","webpack:///webpack:///ui/components/engine-connector/engine-connector.js","webpack:///webpack:/ui/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","webpack:///webpack:///ui/utils/logger.js","webpack:///webpack:///node_modules/js-logger/src/logger.js","webpack:///webpack:///ui/components/shell/shell.js","webpack:///webpack:///ui/utils/is-mobile.js","webpack:///webpack:///ui/components/overlay-play/overlay-play.js","webpack:///webpack:///ui/components/loading/loading.js","webpack:///webpack:///ui/components/play-pause/play-pause.js","webpack:///webpack:///ui/components/seekbar/seekbar.js","webpack:///webpack:///ui/components/volume/volume.js","webpack:///webpack:///ui/components/share/share.js","webpack:///webpack:///ui/components/settings/settings.js","webpack:///webpack:///ui/components/dropdown-menu/dropdown-menu.js","webpack:///webpack:///ui/components/language/language.js","webpack:///webpack:///ui/components/fullscreen/fullscreen.js","webpack:///webpack:///ui/components/time-display/time-display.js","webpack:///webpack:///ui/components/top-bar/top-bar.js","webpack:///webpack:///ui/components/bottom-bar/bottom-bar.js","webpack:///webpack:///ui/components/share-overlay/share-overlay.js","webpack:///webpack:///ui/components/cvaa-overlay/cvaa-overlay.js","webpack:///webpack:///ui/components/keyboard.js","webpack:///../node_modules/playkit-js-ui/src/styles/style.css?b4f7","webpack:///../node_modules/playkit-js-ui/src/styles/style.css","webpack:///../node_modules/css-loader/lib/css-base.js","webpack:///../node_modules/style-loader/lib/addStyles.js","webpack:///../node_modules/style-loader/lib/urls.js","webpack:///webpack:///hls/webpack/universalModuleDefinition","webpack:///webpack:/hls/webpack/bootstrap 971dbcb0968c12c8d961","webpack:///webpack:///hls/hls-adapter.js","webpack:///webpack:/hls/external {\"commonjs\":\"hls.js\",\"commonjs2\":\"hls.js\",\"amd\":\"hls.js\",\"root\":\"Hls\"}","webpack:///webpack:/hls/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","webpack:///node_modules/browser-pack/_prelude.js","webpack:///node_modules/events/events.js","webpack:///node_modules/url-toolkit/src/url-toolkit.js","webpack:///node_modules/webworkify/index.js","webpack:///src/config.js","webpack:///src/controller/abr-controller.js","webpack:///src/controller/audio-stream-controller.js","webpack:///src/controller/audio-track-controller.js","webpack:///src/controller/buffer-controller.js","webpack:///src/controller/cap-level-controller.js","webpack:///src/controller/fps-controller.js","webpack:///src/controller/id3-track-controller.js","webpack:///src/controller/level-controller.js","webpack:///src/controller/stream-controller.js","webpack:///src/controller/subtitle-stream-controller.js","webpack:///src/controller/subtitle-track-controller.js","webpack:///src/controller/timeline-controller.js","webpack:///src/crypt/aes-crypto.js","webpack:///src/crypt/aes-decryptor.js","webpack:///src/crypt/decrypter.js","webpack:///src/crypt/fast-aes-key.js","webpack:///src/demux/aacdemuxer.js","webpack:///src/demux/adts.js","webpack:///src/demux/demuxer-inline.js","webpack:///src/demux/demuxer-worker.js","webpack:///src/demux/demuxer.js","webpack:///src/demux/exp-golomb.js","webpack:///src/demux/id3.js","webpack:///src/demux/mp3demuxer.js","webpack:///src/demux/mp4demuxer.js","webpack:///src/demux/mpegaudio.js","webpack:///src/demux/sample-aes.js","webpack:///src/demux/tsdemuxer.js","webpack:///src/errors.js","webpack:///src/event-handler.js","webpack:///src/events.js","webpack:///src/helper/aac.js","webpack:///src/helper/buffer-helper.js","webpack:///src/helper/level-helper.js","webpack:///src/hls.js","webpack:///src/index.js","webpack:///src/loader/fragment-loader.js","webpack:///src/loader/key-loader.js","webpack:///src/loader/playlist-loader.js","webpack:///src/remux/mp4-generator.js","webpack:///src/remux/mp4-remuxer.js","webpack:///src/remux/passthrough-remuxer.js","webpack:///src/utils/attr-list.js","webpack:///src/utils/binary-search.js","webpack:///src/utils/cea-608-parser.js","webpack:///src/utils/cues.js","webpack:///src/utils/discontinuities.js","webpack:///src/utils/ewma-bandwidth-estimator.js","webpack:///src/utils/ewma.js","webpack:///src/utils/logger.js","webpack:///src/utils/timeRanges.js","webpack:///src/utils/vttcue.js","webpack:///src/utils/vttparser.js","webpack:///src/utils/webvtt-parser.js","webpack:///src/utils/xhr-loader.js","webpack:///webpack:///dash/webpack/universalModuleDefinition","webpack:///webpack:/dash/webpack/bootstrap 249eeb77a61a9c7bb545","webpack:///webpack:///dash/dash-adapter.js","webpack:///webpack:/dash/external {\"commonjs\":\"shaka-player\",\"commonjs2\":\"shaka-player\",\"amd\":\"shaka-player\",\"root\":\"shaka\"}","webpack:///webpack:/dash/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","webpack:///../node_modules/shaka-player/third_party/closure/goog/base.js","webpack:///../node_modules/shaka-player/lib/cast/cast_proxy.js","webpack:///../node_modules/shaka-player/lib/abr/ewma.js","webpack:///../node_modules/shaka-player/lib/abr/ewma_bandwidth_estimator.js","webpack:///../node_modules/shaka-player/lib/debug/log.js","webpack:///../node_modules/shaka-player/lib/util/error.js","webpack:///../node_modules/shaka-player/third_party/closure/goog/uri/uri.js","webpack:///../node_modules/shaka-player/third_party/closure/goog/uri/utils.js","webpack:///../node_modules/shaka-player/lib/util/functional.js","webpack:///../node_modules/shaka-player/lib/util/manifest_parser_utils.js","webpack:///../node_modules/shaka-player/lib/util/config_utils.js","webpack:///../node_modules/shaka-player/lib/util/public_promise.js","webpack:///../node_modules/shaka-player/lib/net/networking_engine.js","webpack:///../node_modules/shaka-player/lib/util/array_utils.js","webpack:///../node_modules/shaka-player/lib/util/multi_map.js","webpack:///../node_modules/shaka-player/lib/util/event_manager.js","webpack:///../node_modules/shaka-player/lib/util/map_utils.js","webpack:///../node_modules/shaka-player/lib/util/string_utils.js","webpack:///../node_modules/shaka-player/lib/util/timer.js","webpack:///../node_modules/shaka-player/lib/util/uint8array_utils.js","webpack:///../node_modules/shaka-player/lib/media/drm_engine.js","webpack:///../node_modules/shaka-player/lib/media/text_engine.js","webpack:///../node_modules/shaka-player/lib/media/time_ranges_utils.js","webpack:///../node_modules/shaka-player/lib/media/media_source_engine.js","webpack:///../node_modules/shaka-player/lib/util/language_utils.js","webpack:///../node_modules/shaka-player/lib/util/stream_utils.js","webpack:///../node_modules/shaka-player/lib/abr/simple_abr_manager.js","webpack:///../node_modules/shaka-player/lib/util/fake_event.js","webpack:///../node_modules/shaka-player/lib/cast/cast_utils.js","webpack:///../node_modules/shaka-player/lib/cast/cast_sender.js","webpack:///../node_modules/shaka-player/lib/util/fake_event_target.js","webpack:///../node_modules/shaka-player/lib/cast/cast_receiver.js","webpack:///../node_modules/shaka-player/lib/player.js","webpack:///../node_modules/shaka-player/lib/util/xml_utils.js","webpack:///../node_modules/shaka-player/lib/dash/content_protection.js","webpack:///../node_modules/shaka-player/lib/dash/mpd_utils.js","webpack:///../node_modules/shaka-player/lib/media/segment_reference.js","webpack:///../node_modules/shaka-player/lib/util/data_view_reader.js","webpack:///../node_modules/shaka-player/lib/util/mp4_parser.js","webpack:///../node_modules/shaka-player/lib/media/mp4_segment_index_parser.js","webpack:///../node_modules/shaka-player/lib/media/segment_index.js","webpack:///../node_modules/shaka-player/lib/util/ebml_parser.js","webpack:///../node_modules/shaka-player/lib/media/webm_segment_index_parser.js","webpack:///../node_modules/shaka-player/lib/dash/segment_base.js","webpack:///../node_modules/shaka-player/lib/dash/segment_list.js","webpack:///../node_modules/shaka-player/lib/dash/segment_template.js","webpack:///../node_modules/shaka-player/lib/media/manifest_parser.js","webpack:///../node_modules/shaka-player/lib/media/presentation_timeline.js","webpack:///../node_modules/shaka-player/lib/dash/dash_parser.js","webpack:///../node_modules/shaka-player/lib/hls/hls_classes.js","webpack:///../node_modules/shaka-player/lib/hls/hls_utils.js","webpack:///../node_modules/shaka-player/lib/util/text_parser.js","webpack:///../node_modules/shaka-player/lib/hls/manifest_text_parser.js","webpack:///../node_modules/shaka-player/lib/net/data_uri_plugin.js","webpack:///../node_modules/shaka-player/lib/hls/hls_parser.js","webpack:///../node_modules/shaka-player/lib/media/ttml_text_parser.js","webpack:///../node_modules/shaka-player/lib/media/mp4_ttml_parser.js","webpack:///../node_modules/shaka-player/lib/media/vtt_text_parser.js","webpack:///../node_modules/shaka-player/lib/media/mp4_vtt_parser.js","webpack:///../node_modules/shaka-player/lib/media/playhead.js","webpack:///../node_modules/shaka-player/lib/media/playhead_observer.js","webpack:///../node_modules/shaka-player/lib/media/streaming_engine.js","webpack:///../node_modules/shaka-player/lib/net/http_plugin.js","webpack:///../node_modules/shaka-player/lib/offline/db_engine.js","webpack:///../node_modules/shaka-player/lib/offline/download_manager.js","webpack:///../node_modules/shaka-player/lib/offline/offline_utils.js","webpack:///../node_modules/shaka-player/lib/offline/offline_manifest_parser.js","webpack:///../node_modules/shaka-player/lib/offline/offline_scheme.js","webpack:///../node_modules/shaka-player/lib/util/cancelable_chain.js","webpack:///../node_modules/shaka-player/lib/offline/storage.js","webpack:///../node_modules/shaka-player/lib/polyfill/all.js","webpack:///../node_modules/shaka-player/lib/polyfill/fullscreen.js","webpack:///../node_modules/shaka-player/lib/util/pssh.js","webpack:///../node_modules/shaka-player/lib/polyfill/patchedmediakeys_ms.js","webpack:///../node_modules/shaka-player/lib/polyfill/patchedmediakeys_nop.js","webpack:///../node_modules/shaka-player/lib/polyfill/patchedmediakeys_webkit.js","webpack:///../node_modules/shaka-player/lib/polyfill/mediasource.js","webpack:///../node_modules/shaka-player/lib/polyfill/promise.js","webpack:///../node_modules/shaka-player/lib/polyfill/videoplaybackquality.js","webpack:///../node_modules/shaka-player/lib/polyfill/vttcue.js","webpack:///../node_modules/shaka-player/lib/polyfill/indexed_db.js","webpack:///../node_modules/shaka-player/lib/polyfill/mathround.js","webpack:///../node_modules/shaka-player/lib/polyfill/mediakeys.js","webpack:///../node_modules/shaka-player/lib/polyfill/video_play_promise.js","webpack:///./setup.js","webpack:///./session-id.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","value","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","length","descriptor","writable","key","protoProps","staticProps","Track","settings","arguments","undefined","_id","id","_active","active","_label","label","_language","language","_index","index","set","default","LOG_LEVEL","_jsLogger","JsLogger","obj","newObj","DEBUG","INFO","TIME","WARN","ERROR","OFF","LoggerFactory","options","useDefaults","lf","defaultLevel","FakeEvent","type","payload","bubbles","cancelable","defaultPrevented","timeStamp","window","performance","now","Date","isTrusted","currentTarget","stopped","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","setPrototypeOf","__proto__","_track","_track2","AudioTrack","_Track","getPrototypeOf","apply","TextTrack","_this","_kind","kind","VideoTrack","_bandwidth","bandwidth","_interopRequireDefault","_multiMap","_multiMap2","_fakeEvent","EventManager","_bindingMap","removeAll","Promise","resolve","listener","binding","Binding_","push","list","unlisten","remove","listeners","getAll","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","Symbol","iterator","next","done","err","return","clear","addEventListener","removeEventListener","CUSTOM_EVENTS","HTML5_EVENTS","PLAYER_EVENTS","_util","ABORT","CAN_PLAY","CAN_PLAY_THROUGH","DURATION_CHANGE","EMPTIED","ENDED","LOADED_DATA","LOADED_METADATA","LOAD_START","PAUSE","PLAY","PLAYING","PROGRESS","RATE_CHANGE","SEEKED","SEEKING","STALLED","SUSPEND","TIME_UPDATE","VOLUME_CHANGE","WAITING","VIDEO_TRACK_CHANGED","AUDIO_TRACK_CHANGED","TEXT_TRACK_CHANGED","TRACKS_CHANGED","PLAYER_STATE_CHANGED","FIRST_PLAY","SOURCE_SELECTED","merge","_typeof","_eventManager","_eventManager2","_fakeEvent2","_fakeEventTarget","_fakeEventTarget2","_events","_stateTypes","_stateTypes2","_logger","_logger2","_html","_html2","_pluginManager","_pluginManager2","_stateManager","_stateManager2","_trackTypes","_trackTypes2","_videoTrack","_videoTrack2","_audioTrack","_audioTrack2","_textTrack","_textTrack2","_playerConfig","_playerConfig2","Player","_FakeEventTarget","config","_tracks","_firstPlay","_readyPromise","reject","listen","configure","_config","mergeDeep","_defaultConfig","_selectEngine","_attachMedia","_loadPlugins","_handlePlaybackConfig","warn","_engine","destroy","plugins","load","sources","playback","streamPriority","_selectEngineByPriority","_this2","_ret","priority","engineId","engine","toLowerCase","format","_engines","find","formatSources","source","canPlayType","mimetype","_loadEngine","v","dispatchEvent","selectedSource","createEngine","_this3","playerEvent","event","_markActiveTrack","selectedVideoTrack","selectedAudioTrack","selectedTextTrack","_onPlay","bind","muted","preload","autoplay","play","_getTracksByType","filter","track","VIDEO","AUDIO","TEXT","selectVideoTrack","selectAudioTrack","selectTextTrack","hideTextTrack","map","enableAdaptiveBitrate","tracks","getTracks","_this4","then","data","catch","error","_this5","src","ready","pause","sessionId","session","to","isNumber","boundedTo","duration","currentTime","vol","isFloat","boundedVol","volume","paused","seeking","mute","copyDeep","getLogger","FakeEventTarget","_listeners","dispatchTarget","handleEvent","exception","PlayerError","param","message","TYPE","NOT_REGISTERED_PLUGIN","NOT_VALID_HANDLER","NOT_IMPLEMENTED_METHOD","method","_toConsumableArray","arr","Array","isArray","arr2","from","_defineProperty","Number","isInt","objects","assign","isObject","item","_len","_key","shift","concat","node","slice","forEach","e","keys","_playerError","_playerError2","BaseMediaSourceAdapter","videoElement","_videoElement","_sourceObj","_trigger","CustomEvents","getError","videoTrack","audioTrack","textTrack","mimeType","registerMediaSourceAdapter","_nativeAdapter","_nativeAdapter2","MediaSourceProvider","mediaSourceAdapter","_mediaSourceAdapters","includes","debug","indexOf","splice","mediaSourceAdapters","_selectedAdapter","createAdapter","register","_player","BasePlugin","player","eventManager","logger","defaultConfig","attr","update","registerPlugin","_basePlugin","_basePlugin2","PluginManager","_plugins","Map","_registry","has","pluginClass","isValid","createPlugin","_destroy","plugin","delete","handler","PLAYER_STATE_TYPES","IDLE","LOADING","PAUSED","BUFFERING","MultiMap","_map","values","version","main","scripts","clean","prebuild","build:prod","build","dev","test","test:chrome","test:chrome:dots","test:firefox","test:safari","test:watch","start","release","publish","eslint","flow","eslint:flow:test","commit:dist","prepush-msg:build","prepush-msg:dist","prepush-msg:done","pre-push","devDependencies","babel-cli","babel-core","babel-eslint","babel-loader","babel-plugin-istanbul","babel-plugin-transform-class-properties","babel-plugin-transform-flow-strip-types","babel-preset-es2015","babel-register","chai","cross-env","eslint-loader","eslint-plugin-flowtype","eslint-plugin-import","eslint-plugin-mocha-no-only","flow-bin","istanbul","karma","karma-chai","karma-chrome-launcher","karma-cli","karma-coverage","karma-firefox-launcher","karma-ie-launcher","karma-mocha","karma-safari-launcher","karma-sourcemap-loader","karma-webpack","mocha","mocha-cli","sinon","sinon-chai","standard-version","uglifyjs-webpack-plugin","webpack","webpack-dev-server","repository","url","keywords","license","bugs","homepage","dependencies","js-logger","_mediaSourceProvider","_mediaSourceProvider2","Html5","_createVideoElement","_loadMediaSourceAdapter","attach","detach","_mediaSourceAdapter","_el","removeAttribute","parentNode","removeChild","document","createElement","style","width","height","backgroundColor","controls","body","appendChild","getMediaSourceAdapter","getVideoElement","seekable","played","buffered","defaultMuted","poster","loop","playbackRate","defaultPlaybackRate","ended","networkState","readyState","videoHeight","videoWidth","TEST_VID","_get","receiver","Function","desc","getOwnPropertyDescriptor","parent","_baseMediaSourceAdapter","_baseMediaSourceAdapter2","NativeAdapter","_BaseMediaSourceAdapt","toString","_loadPromise","_getParsedTracks","videoTracks","_getParsedVideoTracks","audioTracks","_getParsedAudioTracks","textTracks","_getParsedTextTracks","parsedTracks","selected","enabled","mode","_disableVideoTracks","_onTrackChanged","_disableAudioTracks","_disableTextTracks","playkit","_player2","VERSION","_package","packageData","log","_state","_state2","StateManager","_PlayerStates$IDLE","_PlayerStates$LOADING","_PlayerStates$PAUSED","_PlayerStates$PLAYING","_PlayerStates$BUFFERI","_transitions","_updateState","_dispatchEvent","autoPlay","_history","_prevState","_curState","_attachListeners","_doTransition","transition","oldState","newState","State","_duration","_timestamp","endTime","TRACK_TYPES","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_RESULT__","global","Logger","logHandler","contextualLoggersByNameMap","scope","func","args","defineLogLevel","ContextualLogger","defaultContext","context","setLevel","filterLevel","info","newLevel","enabledFor","lvl","invoke","time","timeEnd","level","msgArgs","globalLogger","L","setHandler","createDefaultHandler","formatter","messages","unshift","timerStartTimeByLabelMap","invokeConsoleMethod","hdlr","console","timerLabel","getTime","RequestBuilder","headers","baseUrl","Error","service","action","request","XMLHttpRequest","onreadystatechange","status","jsonResponse","JSON","parse","responseText","code","open","getUrl","setRequestHeader","send","params","beUrl","serviceParams","clientTag","apiVersion","Configuration","clientConfig","UIConfCreationMode","UIConfType","MediaEntryType","MediaType","EntryType","EntryModerationStatus","EntryStatus","MetadataStatus","MetadataObjectType","Status","KalturaRuleActionType","Scheme","_enumify","_Enum","Enum","initEnum","PLAYREADY_CENC","WIDEVINE_CENC","FAIRPLAY","PLAYREADY","WIDEVINE","_Enum2","DRM_POLICY","BLOCK","PREVIEW","LIMIT_FLAVORS","ADD_TO_STORAGE","LIMIT_DELIVERY_PROFILES","SERVE_FROM_REMOTE_SERVER","REQUEST_HOST_REGEX","LIMIT_THUMBNAIL_CAPTURE","_Enum3","QUEUED","CONVERTING","READY","DELETED","NOT_APPLICABLE","TEMP","WAIT_FOR_CONVERT","IMPORTING","VALIDATING","EXPORTING","_Enum4","AD_CUE_POINT","ANNOTATION","CODE_CUE_POINT","THUMB_CUE_POINT","ENTRY","CATEGORY","USER","PARTNER","DYNAMIC_OBJECT","_Enum5","VALID","INVALID","_Enum6","ERROR_IMPORTING","ERROR_CONVERTING","SCAN_FAILURE","IMPORT","INFECTED","PRECONVERT","PENDING","MODERATE","BLOCKED","NO_CONTENT","_Enum7","PENDING_MODERATION","APPROVED","REJECTED","FLAGGED_FOR_REVIEW","AUTO_APPROVED","_Enum8","AUTOMATIC","EXTERNAL_MEDIA","MEDIA_CLIP","MIX","PLAYLIST","DATA","LIVE_STREAM","LIVE_CHANNEL","DOCUMENT","_Enum9","IMAGE","LIVE_STREAM_FLASH","LIVE_STREAM_WINDOWS_MEDIA","LIVE_STREAM_REAL_MEDIA","LIVE_STREAM_QUICKTIME","_Enum10","_Enum11","PLAYER","CONTRIBUTION_WIZARD","SIMPLE_EDITOR","ADVANCED_EDITOR","APP_STUDIO","KRECORD","PLAYER_V3","KMC_ACCOUNT","KMC_ANALYTICS","KMC_CONTENT","KMC_DASHBOARD","KMC_LOGIN","PLAYER_SL","CLIENTSIDE_ENCODER","KMC_GENERAL","KMC_ROLES_AND_PERMISSIONS","CLIPPER","KSR","KUPLOAD","WEBCASTING","_Enum12","WIZARD","ADVANCED","_multiRequestBuilder","_multiRequestBuilder2","_config2","OvpService","ks","partnerId","ovpParams","multiReq","ServiceResult","response","hasError","objectType","ServiceError","MultiRequestResult","_requestBuilder","_requestBuilder2","_baseServiceResult","_baseServiceResult2","MultiRequestBuilder","_RequestBuilder","requests","requestParams","serviceDef","stringify","doHttpRequest","errorText","results","success","result","serviceResult","_mediaSource","MediaSources","progressive","dash","hls","mediaFormat","_enums","_mediaSources","MediaEntry","metaData","Unknown","Drm","licenseUrl","scheme","MediaFormat","pathExt","wvm","mp4","mp3","_drm","MediaSource","KalturaFlavorAsset","flavorParamsId","fileExt","bitrate","frameRate","isOriginal","isWeb","containerFormat","videoCodecId","KalturaMediaEntry","entry","dataUrl","entryType","mediaType","flavorParamsIds","_kalturaMetadata","_kalturaMetadata2","KalturaMetadataListResponse","_ServiceResult","responseObj","totalCount","metas","meta","_kalturaAccessControlMessage","_kalturaAccessControlMessage2","_kalturaPlaybackSource","_kalturaPlaybackSource2","_kalturaRuleAction","_kalturaRuleAction2","_kalturaFlavorAsset","_kalturaFlavorAsset2","KalturaPlaybackContext","actions","flavorAssets","flavor","_kalturaDrmPlaybackPluginData","_kalturaDrmPlaybackPluginData2","KalturaPlaybackSource","drm","deliveryProfileId","protocols","flavorIds","protocol","returnValue","split","copyProperties","_iteratorNormalCompletion3","_didIteratorError3","_iteratorError3","_step3","_iterator3","getOwnPropertyNames","INITIALIZED","instanceProperties","arg","_enumValuesFromArray","_enumValuesFromObject","freeze","enumValues","_pushEnumValue","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","enumValue","ordinal","x","_ovpService","_ovpService2","DataLoaderManager","partnerID","_loaders","_multiRequest","getMultirequest","loader","execution_loader","startIndex","add","executionLoaderResponseMap","val","_loadersResponseMap","execute","_multiResponse","preparedData","prepareData","loaderDataIndexes","_baseEntryService","_baseEntryService2","_metaDataService","_metaDataService2","_kalturaPlaybackContext","_kalturaPlaybackContext2","_kalturaMetadataListResponse","_kalturaMetadataListResponse2","_kalturaBaseEntryListResponse","_kalturaBaseEntryListResponse2","MediaEntryLoader","_response","buildRequests","_entryId","entryId","getPlaybackContext","_requests","mediaEntryResponse","entries","playBackContextResult","metadataListResult","_sessionService","_sessionService2","SessionLoader","_partnerId","anonymousSession","_uiConfService","_uiConfService2","_kalturaUiConfResponse","_kalturaUiConfResponse2","UiConfigLoader","_uiConfId","uiConfId","uiConf","_kalturaMediaEntry","_playSourceUrlBuilder","_playSourceUrlBuilder2","_xmlParser","_xmlParser2","_mediaFormat","_mediaEntry","_mediaEntry2","_drm2","_mediaSource2","_mediaSources2","SUPPORTED_FORMATS","ProviderParser","mediaEntry","playbackContext","metadataList","kalturaSources","parsedSource","parseSource","metadata","parseMetaData","Image","Audio","Vod","Live","playUrl","mediaSource","hasFlavorIds","splittedUrl","baseProtocol","substring","extension","flavorIdsArr","flavors","getProtocol","hasDrmData","drmParams","licenseURL","drmData","metaXml","domParser","DOMParser","xml","replace","parseFromString","metasObj","xmlToJson","OvpProvider","_providerParser","_providerParser2","_dataLoaderManager","_dataLoaderManager2","_mediaEntryLoader","_mediaEntryLoader2","_sessionLoader","_sessionLoader2","_uiConfigLoader","_uiConfigLoader2","_isAnonymous","_dataLoader","validateParams","fetchData","parseDataFromResponse","uiConfID","sessionLoader","uiConfLoader","pluginsJson","mediaLoader","getMediaEntry","PlaySourceUrlBuilder","urlParams","endsWith","string","searchString","KalturaAccessControlMessage","_kalturaMediaEntry2","KalturaBaseEntryListResponse","KalturaDrmPlaybackPluginData","KalturaMetadata","metadataProfileId","metadataProfileVersion","metadataObjectType","objectId","created","setUTCSeconds","createdAt","updated","updatedAt","KalturaRuleAction","KalturaUiConfResponse","description","objTypeAsString","htmlParams","swfUrl","confFilePath","confFile","confFileFeatures","confVars","useCdn","tags","swfUrlVersion","html5Url","partnerTags","objType","creationMode","BaseEntryService","_OvpService","tag","contextDataParams","flavorTags","getEntryListReqParams","redirectFromEntryId","responseProfile","fields","MetaDataService","objectIdEqual","metadataObjectTypeEqual","SessionService","widgetId","UiConfService","responseProfileParams","XmlParser","nodeType","attributes","j","attribute","nodeName","nodeValue","hasChildNodes","childNodes","old","setup","PlaykitUI","Playkit","_playkitJs","_ovpProvider","_ovpProvider2","_playkitJsUi","_playkitJsUi2","_setup","_setup2","__WEBPACK_EXTERNAL_MODULE_48__","VNode","h","lastSimple","child","simple","children","EMPTY_CHILDREN","stack","pop","String","vnode","extend","cloneElement","enqueueRender","component","__d","items","debounceRendering","setTimeout","rerender","renderComponent","isSameNodeType","hydrating","splitText","_componentConstructor","isNamedNode","__n","getNodeProps","defaultProps","createNode","isSvg","createElementNS","removeNode","setAccessor","cssText","IS_NON_DIMENSIONAL","innerHTML","__html","useCapture","eventProxy","__l","setProperty","ns","removeAttributeNS","setAttributeNS","setAttribute","className","flushMounts","mounts","afterMount","componentDidMount","diff","dom","mountAll","componentRoot","diffLevel","isSvgMode","ownerSVGElement","ret","idiff","out","prevSvgMode","_component","createTextNode","replaceChild","recollectNodeTree","__preactattr_","buildComponentFromVNode","firstChild","fc","vchildren","nextSibling","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","isHydrating","vchild","originalChildren","keyed","keyedLen","min","len","childrenLen","vlen","_child","__k","trim","insertBefore","unmountOnly","unmountComponent","ref","removeChildren","lastChild","previousSibling","attrs","collectComponent","components","createComponent","Ctor","inst","render","Component","doRender","__b","state","setComponentProps","opts","__x","__r","base","componentWillMount","componentWillReceiveProps","__c","__p","syncComponentUpdates","isChild","rendered","cbase","previousProps","previousState","__s","previousContext","isUpdate","nextBase","initialBase","initialChildComponent","skip","shouldComponentUpdate","componentWillUpdate","getChildContext","toUnmount","childComponent","childProps","__u","baseParent","componentRef","t","componentDidUpdate","afterUpdate","__h","originalComponent","oldDom","isDirectOwner","isOwner","beforeUnmount","componentWillUnmount","inner","setState","callback","forceUpdate","preact","redux","proptype","createListenerCollection","current","CLEARED","notify","subscribe","isSubscribed","warning","warnAboutReceivingStore","didWarnAboutReceivingStore","connectAdvanced","selectorFactory","_contextTypes","_childContextTypes","_ref","_ref$getDisplayName","getDisplayName","_ref$methodName","methodName","_ref$renderCountProp","renderCountProp","_ref$shouldHandleStat","shouldHandleStateChanges","_ref$storeKey","storeKey","_ref$withRef","withRef","connectOptions","objectWithoutProperties","subscriptionKey","hotReloadingVersion","contextTypes","storeShape","PropTypes","instanceOf","Subscription","childContextTypes","WrappedComponent","invariant","wrappedComponentName","displayName","selectorFactoryOptions","_extends","Connect","_Component","classCallCheck","possibleConstructorReturn","renderCount","store","parentSub","setWrappedInstance","getState","initSelector","initSubscription","inherits","_ref2","subscription","trySubscribe","selector","run","nextProps","tryUnsubscribe","getWrappedInstance","wrappedInstance","dispatch","sourceSelector","dummyState","onStateChange","notifyNestedSubs","Boolean","addExtraProps","withExtras","shallowEqual","a","b","countA","countB","hasOwn","getPrototype","nativeGetPrototype","isHostObject","isObjectLike","isPlainObject","objectToString","objectTag","proto","funcToString","objectCtorString","verifyPlainObject","wrapMapToPropsConstant","getConstant","constantSelector","constant","dependsOnOwnProps","getDependsOnOwnProps","mapToProps","wrapMapToPropsFunc","proxy","stateOrDispatch","ownProps","whenMapDispatchToPropsIsFunction","mapDispatchToProps","whenMapDispatchToPropsIsMissing","whenMapDispatchToPropsIsObject","bindActionCreators","whenMapStateToPropsIsFunction","mapStateToProps","whenMapStateToPropsIsMissing","defaultMergeProps","stateProps","dispatchProps","wrapMergePropsFunc","mergeProps","pure","areMergedPropsEqual","hasRunOnce","mergedProps","nextMergedProps","whenMergePropsIsFunction","whenMergePropsIsOmitted","verify","verifySubselectors","impureFinalPropsSelectorFactory","pureFinalPropsSelectorFactory","handleFirstCall","firstState","firstOwnProps","hasRunAtLeastOnce","handleNewPropsAndNewState","handleNewProps","handleNewState","nextStateProps","statePropsChanged","areStatePropsEqual","handleSubsequentCalls","nextState","nextOwnProps","propsChanged","areOwnPropsEqual","stateChanged","areStatesEqual","finalPropsSelectorFactory","initMapStateToProps","initMapDispatchToProps","initMergeProps","match","factories","strictEqual","Children","only","isRequired","element","shape","nullListeners","unsubscribe","addNestedSub","Provider","storeSubscription","REACT_STATICS","getDefaultProps","mixins","propTypes","KNOWN_STATICS","caller","arity","isGetOwnPropertySymbolsAvailable","getOwnPropertySymbols","targetComponent","sourceComponent","customStatics","objectProto","defaultMapDispatchToPropsFactories","defaultMapStateToPropsFactories","defaultMergePropsFactories","connect","_ref$connectHOC","connectHOC","_ref$mapStateToPropsF","mapStateToPropsFactories","_ref$mapDispatchToPro","mapDispatchToPropsFactories","_ref$mergePropsFactor","mergePropsFactories","_ref$selectorFactory","_ref2$pure","_ref2$areStatesEqual","_ref2$areOwnPropsEqua","_ref2$areStatePropsEq","_ref2$areMergedPropsE","extraOptions","_preact","BaseComponent","bindActions","_redux","Icon","viewBox","r","u","f","none","one","singular","some","many","plural","other","g","fallback","dictionary","definition","mark","intl","location","y","title","IntlProvider","Text","Localizer","withText","__webpack_exports__","process","isCrushed","__WEBPACK_IMPORTED_MODULE_0__createStore__","__WEBPACK_IMPORTED_MODULE_1__combineReducers__","__WEBPACK_IMPORTED_MODULE_2__bindActionCreators__","__WEBPACK_IMPORTED_MODULE_3__applyMiddleware__","__WEBPACK_IMPORTED_MODULE_4__compose__","__WEBPACK_IMPORTED_MODULE_5__utils_warning__","env","NODE_ENV","types","ADD_PLAYER_CLASS","REMOVE_PLAYER_CLASS","UPDATE_IS_MOBILE","initialState","playerClasses","isMobile","addPlayerClass","removePlayerClass","updateIsMobile","TOGGLE_PLAY","isPlaying","toggleIsPlaying","TOGGLE_SHARE_OVERLAY","overlayOpen","show","toggleShareOverlay","TOGGLE_CVAA_OVERLAY","toggleCVAAOverlay","defaultSetTimout","defaultClearTimeout","runTimeout","fun","cachedSetTimeout","runClearTimeout","marker","cachedClearTimeout","clearTimeout","cleanUpNextTick","draining","currentQueue","queue","queueIndex","drainQueue","timeout","Item","array","noop","nextTick","browser","argv","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","cwd","chdir","dir","umask","createStore","reducer","preloadedState","enhancer","ensureCanMutateNextListeners","nextListeners","currentListeners","currentState","__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__","isDispatching","currentReducer","replaceReducer","nextReducer","ActionTypes","INIT","observable","outerSubscribe","observer","observeState","__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default","__WEBPACK_IMPORTED_MODULE_1_symbol_observable__","__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__","__WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__","__WEBPACK_IMPORTED_MODULE_1__getPrototype_js__","funcProto","__WEBPACK_IMPORTED_MODULE_0__root_js__","eval","compose","funcs","reduce","UPDATE_PLAYER_STATE","UPDATE_IS_PLAYING","UPDATE_CURRENT_TIME","UPDATE_DURATION","UPDATE_VOLUME","UPDATE_MUTED","UPDATE_METADATA_LOADING_STATUS","UPDATE_AUDIO_TRACKS","UPDATE_VIDEO_TRACKS","UPDATE_TEXT_TRACKS","metadataLoaded","playerState","updatePlayerState","prevoiusState","updateIsPlaying","updateCurrentTime","updateDuration","updateVolume","updateMuted","updateMetadataLoadingStatus","updateAudioTracks","updateVideoTracks","updateTextTracks","UPDATE_SEEKBAR_DRAGGING_STATUS","draggingActive","updateSeekbarDraggingStatus","UPDATE_VOLUME_DRAGGING_STATUS","updateVolumeDraggingStatus","UPDATE_FULLSCREEN","fullscreen","updateFullscreen","UPDATE_LOADING_SPINNER_STATE","showLoadingSpinner","updateLoadingSpinnerState","UPDATE_QUALITY","UPDATE_SPEED","quality","speed","updateQuality","updateSpeed","toHHMMSS","input","sec_num","parseInt","hours","Math","floor","minutes","seconds","SmartContainer","_dropdownMenu","_dropdownMenu2","htmlFor","onSelect","_dec","_class","_preactI18n","_preactRedux","_bindActions","_shell","_icon","_icon2","Overlay","overlayClass","role","onClick","onClose","aria-label","_store","_store2","_fr","_fr2","_engineConnector","_engineConnector2","_shell2","_overlayPlay","_overlayPlay2","_loading","_loading2","_playPause","_playPause2","_seekbar","_seekbar2","_volume","_volume2","_share","_share2","_settings","_settings2","_language2","_fullscreen","_fullscreen2","_timeDisplay","_timeDisplay2","_topBar","_topBar2","_bottomBar","_bottomBar2","_shareOverlay","_shareOverlay2","_cvaaOverlay","_cvaaOverlay2","_keyboard","_keyboard2","UIManager","ui","translations","Loading","OverlayPlay","template","_buildUI","devToolsExtension","instanceId","showFramePreview","showTimeBubble","playerWrapper","playerElement","getElementsByTagName","getElementsByClassName","baseGetTag","undefinedTag","nullTag","symToStringTag","__WEBPACK_IMPORTED_MODULE_1__getRawTag_js__","__WEBPACK_IMPORTED_MODULE_2__objectToString_js__","__WEBPACK_IMPORTED_MODULE_0__Symbol_js__","toStringTag","__WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__","freeSelf","freeGlobal","getRawTag","isOwn","unmasked","nativeObjectToString","__WEBPACK_IMPORTED_MODULE_0__overArg_js__","overArg","transform","_ponyfill","_ponyfill2","webpackPolyfill","deprecate","paths","symbolObservablePonyfill","_Symbol","getUndefinedStateErrorMessage","actionType","getUnexpectedStateShapeWarningMessage","inputState","reducers","unexpectedKeyCache","reducerKeys","argumentName","__WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__","join","unexpectedKeys","assertReducerShape","random","combineReducers","finalReducers","__WEBPACK_IMPORTED_MODULE_2__utils_warning__","finalReducerKeys","shapeAssertionError","warningMessage","hasChanged","_i","previousStateForKey","nextStateForKey","errorMessage","bindActionCreator","actionCreator","actionCreators","boundActionCreators","__WEBPACK_IMPORTED_MODULE_0__utils_warning__","applyMiddleware","middlewares","_dispatch","chain","middlewareAPI","middleware","__WEBPACK_IMPORTED_MODULE_0__compose__","_engine2","_cvaa","_cvaa2","shell","seekbar","loading","playPause","share","cvaa","core","disable","auto","close","audio","captions","advanced_captions_settings","share_title","link_options","_base","_base2","EngineConnector","_BaseComponent","Event","_isMobile","Shell","orientation","navigator","userAgent","animation","togglePlayPause","PlayPauseControl","controlButtonClass","_timeFormat","virtualProgress","virtualTime","isDraggingActive","SeekBarControl","onSeekbarMouseDown","updateSeekBarProgress","onSeekbarMouseUp","onSeekbarMouseMove","_playerElement","_seekBarElement","clientX","offsetLeft","clientWidth","parseFloat","toFixed","ceil","virtualProgressWidth","progressWidth","framePreviewStyle","getThumbSpriteOffset","aria-valuemin","aria-valuemax","round","aria-valuenow","aria-valuetext","onMouseMove","onMouseDown","onMouseUp","VolumeControl","_volumeControlElement","_volumeProgressBarElement","changeVolume","barHeight","clientHeight","topY","getCoords","top","clickY","clientY","el","box","getBoundingClientRect","pageYOffset","left","pageXOffset","onVolumeControlButtonClick","aria-valuemaz","onVolumeProgressBarMouseDown","onVolumeProgressBarClick","getVolumeProgessHeight","ShareControl","_smartContainer","_smartContainer2","_smartContainerItem","_smartContainerItem2","SettingsControl","smartContainerOpen","speedOptions","qualityOptions","onControlButtonClick","onQualityChange","onSpeedChange","DropDownMenu","dropMenuActive","activeOptions","getActiveOptionLabel","isSelected","LanguageControl","audioOptions","textOptions","onAudioChange","onCaptionsChange","FullscreenControl","webkitIsFullScreen","webkitRequestFullscreen","webkitCancelFullScreen","exitFullscreen","enterFullscreen","toggleFullscreen","TimeDisplay","total","getTimeDisplay","TopBar","BottomBar","_overlay","_overlay2","ShareOverlay","fill","placeholder","readOnly","CVAAOverlay","KeyboardControl","onkeydown","newVolume","which","disableKeyboardCommandsOnControls","preventDefault","content","locals","cssWithMappingToString","useSourceMap","cssMapping","btoa","sourceMapping","toComment","sourceRoot","sourceMap","unescape","encodeURIComponent","mediaQuery","alreadyImportedModules","addStylesToDom","styles","domStyle","stylesInDom","refs","parts","addStyle","listToStyles","newStyles","css","media","part","insertStyleElement","getElement","insertInto","lastStyleElementInsertedAtTop","stylesInsertedAtTop","insertAt","removeStyleElement","idx","createStyleElement","addAttrs","createLinkElement","link","rel","singleton","styleIndex","singletonCounter","applyToSingletonTag","URL","createObjectURL","revokeObjectURL","Blob","updateLink","href","applyToTag","styleSheet","replaceText","cssNode","autoFixUrls","convertToAbsoluteUrls","fixUrls","blob","oldSrc","isOldIE","fn","memo","all","atob","querySelector","newList","mayRemove","textStore","replacement","host","currentDir","pathname","fullMatch","origUrl","unquotedOrigUrl","$1","newUrl","__WEBPACK_EXTERNAL_MODULE_1__","__WEBPACK_EXTERNAL_MODULE_2__","_hls","_hls2","HlsAdapter","_addBindings","canHlsPlayType","_hlsMimeTypes","isHlsSupported","isSupported","Events","_onError","LEVEL_SWITCHED","_onLevelSwitched","AUDIO_TRACK_SWITCHED","_onAudioTrackSwitched","MANIFEST_LOADED","_playerTracks","_parseTracks","loadSource","attachMedia","_removeBindings","detachMedia","_parseAudioTracks","_parseVideoTracks","levels","_parseTextTracks","hlsAudioTracks","lang","hlsVideoTracks","startLevel","vidTextTracks","autoLevelEnabled","nextLevel","_disableAllTextTracks","errorType","errorDetails","details","fatal","ErrorTypes","NETWORK_ERROR","startLoad","MEDIA_ERROR","recoverMediaError","ErrorDetails","MANIFEST_LOAD_ERROR","MANIFEST_LOAD_TIMEOUT","MANIFEST_PARSING_ERROR","LEVEL_LOAD_ERROR","LEVEL_LOAD_TIMEOUT","LEVEL_SWITCH_ERROR","FRAG_LOAD_ERROR","FRAG_LOOP_LOADING_ERROR","FRAG_LOAD_TIMEOUT","FRAG_PARSING_ERROR","BUFFER_APPEND_ERROR","BUFFER_APPENDING_ERROR","require","1","_dereq_","EventEmitter","_maxListeners","isFunction","isUndefined","defaultMaxListeners","setMaxListeners","isNaN","er","newListener","warned","trace","fired","position","listenerCount","evlistener","emitter","2","URL_REGEX","FIRST_SEGMENT_REGEX","SLASH_DOT_REGEX","SLASH_DOT_DOT_REGEX","URLToolkit","buildAbsoluteURL","baseURL","relativeURL","alwaysNormalize","basePartsForNormalise","parseURL","baseParts","path","normalizePath","buildURLFromParts","relativeParts","netLoc","pathParts","exec","builtParts","query","fragment","baseURLPath","newPath","lastIndexOf","reverse","3","bundleFn","cache","resolveSources","workerSources","depPath","depKey","wkey","cacheKeys","exp","pow","wcache","skey","scache","webkitURL","mozURL","msURL","bare","workerUrl","worker","Worker","objectURL","4","hlsDefaultConfig","_abrController","_abrController2","_bufferController","_bufferController2","_capLevelController","_capLevelController2","_fpsController","_fpsController2","_xhrLoader","_xhrLoader2","_audioTrackController","_audioTrackController2","_audioStreamController","_audioStreamController2","_cues","_cues2","_timelineController","_timelineController2","_subtitleTrackController","_subtitleTrackController2","_subtitleStreamController","_subtitleStreamController2","autoStartLoad","startPosition","defaultAudioCodec","capLevelOnFPSDrop","capLevelToPlayerSize","initialLiveManifestSize","maxBufferLength","maxBufferSize","maxBufferHole","maxSeekHole","lowBufferWatchdogPeriod","highBufferWatchdogPeriod","nudgeOffset","nudgeMaxRetry","maxFragLookUpTolerance","liveSyncDurationCount","liveMaxLatencyDurationCount","Infinity","liveSyncDuration","liveMaxLatencyDuration","maxMaxBufferLength","enableWorker","enableSoftwareAES","manifestLoadingTimeOut","manifestLoadingMaxRetry","manifestLoadingRetryDelay","manifestLoadingMaxRetryTimeout","levelLoadingTimeOut","levelLoadingMaxRetry","levelLoadingRetryDelay","levelLoadingMaxRetryTimeout","fragLoadingTimeOut","fragLoadingMaxRetry","fragLoadingRetryDelay","fragLoadingMaxRetryTimeout","fragLoadingLoopThreshold","startFragPrefetch","fpsDroppedMonitoringPeriod","fpsDroppedMonitoringThreshold","appendErrorMaxRetry","fLoader","pLoader","xhrSetup","fetchSetup","abrController","bufferController","capLevelController","fpsController","audioStreamController","audioTrackController","subtitleStreamController","subtitleTrackController","timelineController","cueHandler","enableCEA708Captions","enableWebVTT","captionsTextTrack1Label","captionsTextTrack1LanguageCode","captionsTextTrack2Label","captionsTextTrack2LanguageCode","stretchShortVideoTrack","forceKeyFrameOnDiscontinuity","abrEwmaFastLive","abrEwmaSlowLive","abrEwmaFastVoD","abrEwmaSlowVoD","abrEwmaDefaultEstimate","abrBandWidthFactor","abrBandWidthUpFactor","abrMaxWithRealBitrate","maxStarvationDelay","maxLoadingDelay","minAutoBitrate","10","14","15","16","5","50","59","6","7","8","9","_events2","_eventHandler","_eventHandler2","_bufferHelper","_bufferHelper2","_errors","_ewmaBandwidthEstimator","_ewmaBandwidthEstimator2","AbrController","_EventHandler","FRAG_LOADING","FRAG_LOADED","FRAG_BUFFERED","lastLoadedFragLevel","_nextAutoLevel","timer","_bwEstimator","onCheck","_abandonRulesCheck","clearTimer","frag","setInterval","isLive","live","ewmaFast","ewmaSlow","fragCurrent","minAutoLevel","stats","aborted","autoLevel","requestDelay","trequest","abs","loadRate","max","bw","loaded","levelBitrate","realBitrate","expectedLen","pos","fragLoadedDelay","bufferStarvationDelay","bufferInfo","end","fragLevelNextLoadedDelay","nextLoadLevel","levelNextBitrate","sample","abort","trigger","FRAG_LOAD_EMERGENCY_ABORTED","sn","loadedBytes","bytes","loadedDuration","bitrateTest","tparsed","tbuffered","tload","onFragBuffered","loadCounter","fragLoadingProcessingMs","tfirst","bwEstimate","getEstimate","bitrateTestDelay","clearInterval","currentLevel","currentFragDuration","currentBw","maxAutoLevel","maxFetchDuration","bwFactor","bwUpFactor","levelInfo","levelDetails","avgDuration","totalduration","fragments","adjustedbw","fetchDuration","forcedAutoLevel","bwEstimator","canEstimate","nextABRAutoLevel","_nextABRAutoLevel","avgbw","bestLevel","_findBestLevel","33","34","35","37","52","54","_binarySearch","_binarySearch2","_demuxer","_demuxer2","_levelHelper","_levelHelper2","_timeRanges","_timeRanges2","_discontinuities","STOPPED","STARTING","KEY_LOADING","FRAG_LOADING_WAITING_RETRY","WAITING_TRACK","PARSING","PARSED","BUFFER_FLUSHING","WAITING_INIT_PTS","AudioStreamController","MEDIA_ATTACHED","MEDIA_DETACHING","AUDIO_TRACKS_UPDATED","AUDIO_TRACK_SWITCHING","AUDIO_TRACK_LOADED","KEY_LOADED","FRAG_PARSING_INIT_SEGMENT","FRAG_PARSING_DATA","FRAG_PARSED","BUFFER_CREATED","BUFFER_APPENDED","BUFFER_FLUSHED","INIT_PTS_FOUND","audioCodecSwap","ticks","ontick","tick","initPTS","waitingFragment","videoTrackCC","stopLoad","demuxerId","cc","lastCurrentTime","fragLoadError","nextLoadPosition","fragPrevious","demuxer","doTick","trackDetails","loadedmetadata","startFragRequested","mediaBuffer","bufferLen","bufferEnd","maxBufLen","audioSwitch","trackId","endSN","BUFFER_EOS","fragLen","PTSKnown","nextStart","initSegment","findFragWithCC","loadIdx","fragLoadIdx","nextBuffered","foundFrag","fragNext","fragmentWithinToleranceTest","candidate","candidateLookupTolerance","search","startSN","decryptdata","uri","maxThreshold","retryDate","isSeeking","waitingFrag","waitingFragCC","onFragLoaded","onvseeking","onMediaSeeking","onvended","onMediaEnded","onvseeked","altAudio","newDetails","sliding","curDetails","mergeDetails","startTimeOffset","fragLoaded","audioCodec","appended","initSegmentData","pendingBuffering","fragNew","video","levelCodec","codec","BUFFER_CODECS","container","appendObj","pendingData","BUFFER_APPENDING","endPTS","startPTS","endDTS","startDTS","nb","updateFragPTSDTS","appendOnBufferFlush","startOffset","endOffset","POSITIVE_INFINITY","data1","data2","buffer","_checkAppendedParsed","pending","loadError","delay","AUDIO_TRACK_LOAD_ERROR","AUDIO_TRACK_LOAD_TIMEOUT","KEY_LOAD_ERROR","KEY_LOAD_TIMEOUT","BUFFER_FULL_ERROR","isBuffered","25","38","48","51","55","AudioTrackController","MANIFEST_LOADING","updateTrack","defaultFound","targetduration","newId","eventObj","AUDIO_TRACK_SWITCH","AUDIO_TRACK_LOADING","audioTrackId","setAudioTrackInternal","BufferController","MEDIA_ATTACHING","MANIFEST_PARSED","BUFFER_RESET","LEVEL_PTS_UPDATED","LEVEL_UPDATED","_msDuration","_levelDuration","onsbue","onSBUpdateEnd","onsbe","onSBUpdateError","pendingTracks","audioBuffer","sourceBuffer","timestampOffset","updating","audioTimestampOffset","audioExpected","videoExpected","sourceBufferNb","ms","onmso","onMediaSourceOpen","onmse","onMediaSourceEnded","onmsc","onMediaSourceClose","endOfStream","flushRange","segments","MEDIA_DETACHED","checkPendingTracks","pendingTracksNb","createSourceBuffers","doAppending","_needsFlush","doFlush","_needsEos","checkEos","appending","counter","segment","updateMediaElementDuration","sb","removeSourceBuffer","trackName","addSourceBuffer","BUFFER_ADD_CODEC_ERROR","dataType","sbobj","flushBufferCounter","levelDuration","range","flushBuffer","appendBuffer","appendError","typeIn","bufStart","bufEnd","flushStart","flushEnd","CapLevelController","FPS_DROP_LEVEL_CAPPING","restrictedLevels","autoLevelCapping","isLevelAllowed","droppedLevel","HTMLVideoElement","firstLevel","getMaxLevel","detectPlayerSize","levelsLength","streamController","nextLevelSwitch","capLevelIndex","validLevels","getMaxLevelByMediaSize","mediaWidth","mediaHeight","offsetWidth","contentScaleFactor","offsetHeight","maxLevelIndex","curLevel","pixelRatio","devicePixelRatio","FPSController","isVideoPlaybackQualityAvailable","getVideoPlaybackQuality","checkFPSInterval","decodedFrames","droppedFrames","lastTime","currentPeriod","currentDropped","lastDroppedFrames","currentDecoded","lastDecodedFrames","droppedFPS","FPS_DROP","totalDroppedFrames","videoPlaybackQuality","checkFPS","totalVideoFrames","droppedVideoFrames","webkitDecodedFrameCount","webkitDroppedFrameCount","11","_id2","ID3TrackController","FRAG_PARSING_METADATA","id3Track","addTextTrack","samples","Cue","WebKitDataCue","VTTCue","TextTrackCue","frames","getID3Frames","startTime","pts","frame","isTimeStampFrame","cue","addCue","27","12","LevelController","LEVEL_LOADED","_manualLevel","canload","_levels","bitrateStart","levels0","bitrateSet","videoCodecFound","audioCodecFound","brokenmp4inmp3","checkSupported","isTypeSupported","videoCodec","redundantLevelId","urlId","sort","_firstLevel","MANIFEST_INCOMPATIBLE_CODECS_ERROR","reason","_level","levelProperties","LEVEL_SWITCH","LEVEL_SWITCHING","LEVEL_LOADING","OTHER_ERROR","levelId","levelError","REMUX_ALLOC_ERROR","nbRedundantLevel","nextAutoLevel","mediaBuffered","retryDelay","levelRetry","reloadInterval","averagetargetduration","setLevelInternal","_startLevel","configStartLevel","13","WAITING_LEVEL","StreamController","forceStartLoad","_doTickIdle","_checkBuffer","_checkFragmentChanged","levelLastLoaded","_fetchPayloadOrEos","_ensureFragmentAtLivePoint","_findFragment","_loadFragmentOrKey","maxLatency","liveSyncPosition","computeLivePosition","targetSN","curSNIdx","sameLevel","prevFrag","nextFrag","backtracked","deltaPTS","dropped","_bufferedFrags","getBufferedFrag","fragPlayingCurrent","fragPlaying","FRAG_CHANGED","fragPlayingLevel","immediateSwitch","previouslyPaused","flushMainBuffer","fetchdelay","nextBufferedFrag","nextLevelId","fragLastKbps","followingBufferedFrag","maxStartPTS","flushScope","onMediaSeeked","tolerance","fragStartOffset","fragEndOffset","stalled","aac","heaac","audioCodecSwitch","startLevelLoaded","newLevelId","lastAudioCodec","mediaSeeking","accurateTimeOffset","ua","channelCount","drift","videoBuffer","mediaTrack","alternate","bufferedFrags","_reduceMaxBufferLength","minLength","startPositionBuffered","firstbufferedPosition","immediateLevelSwitchEnd","expectedPlaying","playheadMoving","stallReported","nudgeRetry","tnow","stalledDuration","BUFFER_STALLED_ERROR","nextBufferStart","delta","BUFFER_SEEK_OVER_HOLE","hole","_currentTime","targetTime","BUFFER_NUDGE_ON_STALL","targetLatency","STREAM_STATE_TRANSITION","_liveSyncPosition","SubtitleStreamController","SUBTITLE_TRACKS_UPDATED","SUBTITLE_TRACK_SWITCH","SUBTITLE_TRACK_LOADED","SUBTITLE_FRAG_PROCESSED","vttFragSNsProcessed","vttFragQueues","currentlyProcessing","currentTrackId","subtitleTracks","clearVttFragQueues","processedFragSNs","fragQueue","currentFragSN","alreadyProcessed","alreadyInQueue","fragInQueue","filterSubtitleTracks","textTrackList","SubtitleTrackController","subtitleTrack","trackChangeListener","_onTextTracksChanged","subtitles","SUBTITLE_TRACK_LOADING","onTick","subtitleTrackId","setSubtitleTrackInternal","clearCurrentCues","cues","removeCue","reuseVttTextTrack","inUseTrack","manifestTrack","textTrack1","textTrack2","intersection","x1","x2","y1","y2","_cea608Parser","_cea608Parser2","_webvttParser","_webvttParser2","TimelineController","FRAG_PARSING_USERDATA","Cues","unparsedVttFrags","cueRanges","sendAddTrackEvent","createEvent","initEvent","channel1","newCue","screen","existingTrack1","getExistingTrack","createTextTrack","addCues","channel2","existingTrack2","cea608Parser","channel","ranges","merged","cueRange","overlap","channelNumber","propName","lastSn","prevCC","vttCCs","ccOffset","presentationOffset","inUseTracks","closedCaptions","reset","byteLength","new","currentTrack","getCueById","ccdatas","extractCea608Data","addData","byteArray","tmpByte","ccbyte1","ccbyte2","ccValid","ccType","count","actualCCBytes","49","58","17","AESCrypto","subtle","iv","aesIV","decrypt","18","AESDecryptor","rcon","subMix","Uint32Array","invSubMix","sBox","invSBox","initTable","arrayBuffer","view","DataView","newArray","getUint32","subMix0","subMix1","subMix2","subMix3","invSubMix0","invSubMix1","invSubMix2","invSubMix3","xi","sx","x4","x8","keyBuffer","uint8ArrayToUint32Array_","sameKey","offset","keySize","ksRows","ksRow","invKsRow","keySchedule","invKeySchedule","sbox","prev","word","inputArrayBuffer","nRounds","invSBOX","initVector","initVector0","initVector1","initVector2","initVector3","inputInt32","Int32Array","outputInt32","t0","t1","t2","t3","s0","s1","s2","s3","inputWords0","inputWords1","inputWords2","inputWords3","swapWord","networkToHostOrderSwap","19","_aesCrypto","_aesCrypto2","_fastAesKey","_fastAesKey2","_aesDecryptor","_aesDecryptor2","Decrypter","logEnabled","browserCrypto","crypto","webkitSubtle","disableWebCrypto","decryptor","expandKey","fastAesKey","aesKey","onWebCryptoError","FRAG_DECRYPT_ERROR","20","FastAESKey","importKey","21","_adts","_adts2","AACDemuxer","remuxer","sequenceNumber","isAAC","manifestCodec","inputTimeScale","timeOffset","contiguous","id3Data","getID3Data","getTimeStamp","frameIndex","stamp","id3Samples","dts","isHeader","initTrackConfig","appendFrame","remux","probe","22","ADTS","getAudioConfig","adtsObjectType","adtsSampleingIndex","adtsExtensionSampleingIndex","adtsChanelConfig","adtsSampleingRates","samplerate","isHeaderPattern","getHeaderLength","getFullFrameLength","headerLength","frameLength","newOffset","getFrameDuration","frameDuration","header","parseFrameHeader","aacSample","unit","subarray","23","_decrypter","_decrypter2","_aacdemuxer","_aacdemuxer2","_mp4demuxer","_mp4demuxer2","_tsdemuxer","_tsdemuxer2","_mp3demuxer","_mp3demuxer2","_mp4Remuxer","_mp4Remuxer2","_passthroughRemuxer","_passthroughRemuxer2","DemuxerInline","typeSupported","vendor","discontinuity","trackSwitch","defaultInitPTS","decrypter","localthis","decryptedData","FRAG_DECRYPTED","tstart","tdecrypt","pushDecrypted","Uint8Array","muxConfig","demux","mux","_remuxer","resetInitSegment","resetTimeStamp","setDecryptData","append","28","29","32","45","46","24","_demuxerInline","_demuxerInline2","_events3","_events4","DemuxerWorker","_len2","_key2","forwardMessage","ev","postMessage","cmd","enableLogs","transferable","_demuxerWorker","_demuxerWorker2","Demuxer","mpeg","w","work","onwmsg","onWorkerMessage","onerror","INTERNAL_EXCEPTION","filename","lineno","terminate","lastFrag","nextSN","26","ExpGolomb","bytesAvailable","bitsAvailable","workingBytes","availableBytes","skipBytes","loadWord","size","bits","valu","readBits","leadingZeroCount","skipLZ","skipBits","clz","readUEG","deltaScale","lastScale","nextScale","readEG","profileIdc","numRefFramesInPicOrderCntCycle","picWidthInMbsMinus1","picHeightInMapUnitsMinus1","frameMbsOnlyFlag","scalingListCount","frameCropLeftOffset","frameCropRightOffset","frameCropTopOffset","frameCropBottomOffset","readUByte","readBoolean","skipEG","skipUEG","skipScalingList","chromaFormatIdc","picOrderCntType","ID3","front","_readSize","isFooter","_readTimeStamp","fromCharCode","frameData","_getFrameData","_decodeFrame","_decodePrivFrame","_decodeTextFrame","_decodeURLFrame","timeStampFrame","pts33Bit","timestamp","owner","_utf8ArrayToStr","privateData","text","char2","char3","_mpegaudio","_mpegaudio2","MP3Demuxer","30","UINT32_MAX","MP4Demuxer","initData","parseInitSegment","_startDTS","getStartDTS","offsetStartDTS","bin2str","subresults","endbox","readUint32","findBox","trak","tkhd","mdhd","timescale","hdlrType","soun","vide","trafs","baseTimes","traf","tfhd","scale","baseTime","tfdt","isFinite","baseMediaDecodeTime","writeUint32","upper","lower","MpegAudio","BitratesMap","SamplingRateMap","parseHeader","sampleRate","headerB","headerC","headerE","headerF","headerG","columnInBitrates","bitRate","columnInSampleRates","padding","31","SampleAesDecrypter","discardEPB","encryptedData","sampleIndex","sync","curUnit","encryptedBuffer","byteOffset","decryptBuffer","decryptAacSamples","isSync","decryptAacSample","decodedData","encryptedDataLen","Int8Array","outputPos","inputPos","unitIndex","getAvcEncryptedData","getAvcDecryptedUnit","decryptAvcSamples","curUnits","units","decryptAvcSample","_expGolomb","_expGolomb2","_sampleAes","_sampleAes2","TSDemuxer","sampleAes","pmtParsed","_pmtId","_avcTrack","_id3Track","_txtTrack","aacOverFlow","aacLastPTS","avcSample","stt","pid","pes","unknownPIDs","avcTrack","avcId","audioId","id3Id","pmtId","avcData","pesData","audioData","parsePAT","_parsePAT","parsePMT","_parsePMT","parsePES","_parsePES","parseAVCPES","_parseAVCPES","parseAACPES","_parseAACPES","parseMPEGPES","_parseMPEGPES","parseID3PES","_parseID3PES","parsedPIDs","avc","id3","decryptAndRemux","decryptAndRemuxAvc","_initPTS","_initDTS","mpegSupported","isSampleAes","sectionLength","tableEnd","programInfoLength","stream","pesFlags","pesLen","pesHdrLen","pesPts","pesDts","payloadStartOffset","newData","dataLen","nbSamples","sps","last","expGolombDecoder","_parseAVCNALu","spsfound","sliceType","readSliceType","_createAVCSample","payloadType","payloadSize","endOfCaptions","readUShort","readUInt","firstByte","secondByte","totalCCs","_insertSampleInOrder","readSPS","codecarray","codecstring","pps","pushAccesUnit","lastUnit","overflow","unitType","lastUnitType","naluState","lastState","lastUnitStart","_getLastNalUnit","tmp","_lastUnit","_tmp","newLength","EPBPositions","sourceIndex","newPTS","MUX_ERROR","WEBVTT_EXCEPTION","EventHandler","onEvent","events","handledEvents","useGenericHandler","registerListeners","unregisterListeners","isEventHandler","onEventGeneric","eventToFunction","funcName","FRAG_LOAD_PROGRESS","DESTROYING","36","AAC","BufferHelper","maxHoleDuration","vbuffered","bufferedInfo","bufferStart","bufferStartNext","buffered2","buf2len","buf2end","LevelHelper","oldDetails","PTSFrag","oldfragments","newfragments","oldFrag","newFrag","fragIdx","updatePTS","fromIdx","toIdx","fragFrom","fragTo","fragToPTS","39","_urlToolkit","_urlToolkit2","_playlistLoader","_playlistLoader2","_fragmentLoader","_fragmentLoader2","_keyLoader","_keyLoader2","_streamController","_streamController2","_levelController","_levelController2","_id3TrackController","_id3TrackController2","Hls","DefaultConfig","prop","_autoLevelCapping","playListLoader","fragmentLoader","keyLoader","id3TrackController","levelController","networkControllers","Controller","coreComponents","WebKitMediaSource","SourceBuffer","WebKitSourceBuffer","sourceBufferValidAPI","controller","swapAudioCodec","loadLevel","immediateLevelSwitch","manualLevel","41","42","43","40","FragmentLoader","loaders","loaderName","loaderContext","loaderConfig","loaderCallbacks","responseType","progressData","byteRangeStartOffset","byteRangeEndOffset","rangeStart","rangeEnd","maxRetry","maxRetryDelay","onSuccess","loadsuccess","onError","loaderror","onTimeout","loadtimeout","onProgress","loadprogress","networkDetails","KeyLoader","decryptkey","decrypturl","_attrList","_attrList2","MASTER_PLAYLIST_REGEX","MASTER_PLAYLIST_MEDIA_REGEX","LEVEL_PLAYLIST_REGEX_FAST","RegExp","LEVEL_PLAYLIST_REGEX_SLOW","LevelKey","_uri","reluri","baseuri","Fragment","_url","_byteRange","_decryptdata","tagList","segmentNumber","uint8View","levelkey","createInitializationVector","relurl","baseurl","_programDateTime","rawProgramDateTime","byteRange","rawByteRange","lastByteRangeEndOffset","fragmentDecryptdataFromLevelkey","PlaylistLoader","retry","lastIndex","resolution","decimalResolution","decimalInteger","NAME","codecs","CODECS","avc1toavcoti","medias","groupId","DEFAULT","autoselect","AUTOSELECT","forced","FORCED","URI","LANGUAGE","avcdata","substr","currentSN","value1","value2","toUpperCase","decryptparams","keyAttrs","decryptmethod","enumeratedString","decrypturi","decryptiv","hexadecimalInteger","startParams","startAttrs","decimalFloatingPoint","mapAttrs","BYTERANGE","isLevel","parseLevelPlaylist","parseMasterPlaylist","parseMasterPlaylistMedia","embeddedAudioFound","47","44","MP4","avc1","avcC","btrt","dinf","dref","esds","ftyp","mdat","mdia","mfhd","minf","moof","moov","mp4a",".mp3","mvex","mvhd","pasp","sdtp","stbl","stco","stsc","stsd","stsz","stts","trun","trex","vmhd","smhd","charCodeAt","videoHdlr","audioHdlr","HDLR_TYPES","STTS","STSC","STCO","STSZ","VMHD","SMHD","STSD","majorBrand","avc1Brand","minorVersion","FTYP","DINF","upperWordDuration","lowerWordDuration","boxes","flags","dependsOn","isDependedOn","hasRedundancy","avcc","hSpacing","vSpacing","configlen","sampleDependencyTable","upperWordBaseMediaDecodeTime","lowerWordBaseMediaDecodeTime","cts","arraylen","isLeading","paddingValue","isNonSync","degradPrio","init","movie","_aac","_aac2","_mp4Generator","_mp4Generator2","MP4Remuxer","isSafari","ISGenerated","defaultTimeStamp","refPTS","ptsNormalize","_PTSNormalize","timeScale","initDTS","initPTSDelta","generateIS","remuxAudio","audioTrackLength","remuxVideo","videoData","remuxEmptyAudio","remuxID3","remuxText","audioSamples","videoSamples","computePTSDTS","mp4SampleDuration","firstPTS","firstDTS","lastPTS","lastDTS","inputSamples","outputSamples","nextAvcDts","deltadts","deltapts","PTSDTSshift","curr","nbNalu","naluLen","_sample","nbUnits","sampleLen","mdatSize","setUint32","_i2","avcSampleUnits","mp4SampleLength","compositionTimeOffset","_j","_nbUnits","unitData","unitDataLen","lastFrameDuration","gapTolerance","deltaToFrameEnd","nextAudioPts","mp4Sample","fillFrame","mp4timeScale","scaleFactor","inputSampleDuration","rawMPEG","nextPts","missing","newStamp","getSilentFrame","_j2","_nbSamples","audioSample","_pts","_delta","numMissingFrames","_i3","unitLen","lastSampleDuration","silentFrame","reference","PassThroughRemuxer","rawData","streamType","DECIMAL_RESOLUTION_REGEX","ATTR_LIST_REGEX","AttrList","parseAttrList","attrName","intValue","MAX_SAFE_INTEGER","stringValue","res","BinarySearch","comparisonFunction","minIndex","maxIndex","currentIndex","currentElement","comparisonResult","specialCea608CharsCodes","92","94","95","96","123","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","WARNING","verboseLevel","setTime","newTime","severity","msg","minLevel","numArrayToHexArray","numArray","hexArray","PenState","foreground","underline","italics","background","flash","attribs","newPenState","StyledUnicodeChar","uchar","penState","copy","equals","newChar","isDefault","Row","chars","currPenState","equal","empty","isEmpty","absPos","relPos","newPos","setPenState","setCursor","moveCursor","setChar","backSpace","char","startPos","clearFromPos","setStyles","CaptionScreen","rows","currRow","nrRollUpRows","clearToEndOfRow","insertChar","setPenStyles","pacData","newRow","row","topRowIndex","lastOutputScreen","prevLineTime","cueStartTime","indent","prevPos","color","setPen","bkgData","nrRows","getDisplayText","topRow","asOneRow","displayText","rowNr","rowText","getTextString","Cea608Channel","outputFilter","chNr","verbose","displayedMemory","nonDisplayedMemory","currRollUpRow","writeScreen","lastCueEndTime","newHandler","setPAC","setBkgData","newMode","outputDataUpdate","setMode","setRollUpRows","rollUp","nrCols","colorIndex","colors","updateData","Cea608Parser","field","out1","out2","outputs","channels","currChNr","lastCmdA","lastCmdB","bufferedData","dataCounters","getHandler","byteList","cmdFound","charsFound","parseCmd","parseMidrow","parsePAC","parseBackgroundAttributes","parseChars","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","_vttparser","captionScreen","indenting","fixLineBreaks","line","align","57","CC","_ewma","_ewma2","EwmaBandWidthEstimator","slow","fast","defaultEstimate","defaultEstimate_","minWeight_","minDelayMs_","slow_","fast_","durationMs","numBytes","weight","getTotalWeight","53","EWMA","halfLife","alpha_","estimate_","totalWeight_","adjAlpha","zeroFactor","formatMsg","consolePrintFn","exportLoggerFunctions","debugConfig","functions","exportedLogger","fakeLogger","TimeRanges","56","findDirectionSetting","directionSetting","findAlignSetting","alignSetting","cobj","isIE8","baseObj","hasBeenReset","_pauseOnExit","_startTime","_endTime","_text","_region","_vertical","_snapToLines","_line","_lineAlign","_position","_positionAlign","_size","_align","setting","SyntaxError","autoKeyword","displayState","","lr","rl","middle","right","getCueAsHTML","WebVTT","convertCueToDOMTree","VTTParser","decoder","StringDecoder","regionList","parseTimeStamp","computeSeconds","Settings","parseOptions","keyValueDelim","groupDelim","groups","kv","k","parseCue","consumeTimeStamp","ts","oInput","skipWhitespace","region","alt","vals","vals0","integer","percent","center","vertical","defaults","lineAlign","snapToLines","_vttcue","_vttcue2","decode","decodeURIComponent","dflt","defaultKey","collectNextLine","alreadyCollectedLine","hasSubstring","oncue","flush","onflush","_vttparser2","startsWith","inputString","cueString2millis","timeString","secs","mins","hash","calculateOffset","presentationTime","currCC","WebVTTParser","vttByteArray","syncPTS","callBack","errorCallBack","re","vttLines","cueTime","mpegTs","localTime","parsingError","inHeader","parser","cueOffset","escape","onparsingerror","XhrLoader","requestTimeout","retryTimeout","callbacks","loadInternal","xhr","XDomainRequest","readystatechange","onprogress","responseURL","statusText","lengthComputable","_shakaPlayer","_shakaPlayer2","DashAdapter","_shaka","_dashMimeType","polyfill","installAll","isBrowserSupported","_onAdaptation","variantTracks","getVariantTracks","activeVariantTrack","variantTrack","videoId","_getVideoTracks","_getAudioTracks","getTextTracks","abr","selectVariantTrack","selectAudioLanguage","selectTextLanguage","setTextTrackVisibility","goog.exportSymbol","publicPath","cur","goog.global","execScript","goog.inherits","ba","childCtor","tempCtor","shaka.util.FakeEventTarget","parentCtor","superClass_","childCtor.base","me","var_args","shaka.abr.Ewma","ca","shaka.abr.Ewma.prototype.sample","da","newEstimate","shaka.abr.Ewma.prototype.getEstimate","ea","shaka.abr.EwmaBandwidthEstimator","fa","bytesSampled_","shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE","shaka.log.error","ga","shaka.util.Error","category","goog.Uri","ia","opt_uri","setScheme","scheme_","setUserInfo","userInfo_","setDomain","domain_","setPort","port_","setPath","path_","setQueryData","clone","queryData_","setFragment","fragment_","goog.uri.utils.splitRe_","SCHEME","goog.Uri.decodeOrEmpty_","USER_INFO","DOMAIN","PORT","PATH","QUERY_DATA","FRAGMENT","goog.Uri.QueryData","goog.Uri.prototype.setScheme","ja","newScheme","opt_decode","goog.Uri.prototype.setPort","ka","newPort","goog.Uri.prototype.setQueryData","la","queryData","goog.Uri.encodeSpecialChars_","goog.Uri.reDisallowedInQuery_","na","opt_preserveReserved","decodeURI","qa","unescapedPart","extra","opt_removeDoubleEncoding","encoded","encodeURI","goog.Uri.encodeChar_","wa","ch","oa","opt_query","encodedQuery_","goog.Uri.QueryData.prototype.clone","ma","rv","keyMap_","cloneMap","count_","shaka.util.Functional.createFallbackPromiseChain","xa","promise","elem","shaka.util.Functional.collapseArrays","shaka.util.Functional.noop","shaka.util.Functional.isNotNull","ya","shaka.util.Functional.isNotEqualFunc","za","compare","shaka.util.Functional.isNotDuplicate","Aa","shaka.util.ManifestParserUtils.resolveUris","z","baseUris","relativeUris","relativeAsGoog","shaka.util.ManifestParserUtils.createDrmInfo","Ba","keySystem","licenseServerUri","distinctiveIdentifierRequired","persistentStateRequired","audioRobustness","videoRobustness","serverCertificate","keyIds","shaka.util.ConfigUtils.mergeConfigObjects","Ca","destination","overrides","ignoreKeys","subPath","subTemplate","copyObject",".abr.manager","shaka.util.ConfigUtils.cloneObject","Da","shaka.util.PublicPromise","A","resolvePromise","rejectPromise","shaka.net.NetworkingEngine","B","opt_onSegmentDownloaded","destroyed_","requests_","requestFilters_","responseFilters_","onSegmentDownloaded_","shaka.net.NetworkingEngine.defaultRetryParameters","Fa","maxAttempts","baseDelay","backoffFactor","fuzzFactor","shaka.net.NetworkingEngine.makeRequest","C","uris","retryParams","allowCrossSiteCredentials","retryParameters","shaka.util.ArrayUtils.removeDuplicates","Ga","opt_compareFn","matchFound","shaka.util.ArrayUtils.indexOf","Ha","compareFn","shaka.util.MultiMap","Ia","map_","shaka.util.EventManager","D","bindingMap_","shaka.util.EventManager.prototype.listen","E","shaka.util.EventManager.Binding_","shaka.util.EventManager.prototype.listenOnce","La","shaka.util.EventManager.prototype.removeAll","Ja","Ka","shaka.util.MapUtils.empty","Ma","shaka.util.MapUtils.values","Na","shaka.util.MapUtils.map","Oa","shaka.util.MapUtils.every","Pa","every","shaka.util.MapUtils.forEach","Qa","shaka.util.StringUtils.fromUTF8","F","uint8","escaped","shaka.util.StringUtils.fromCharCode_","shaka.util.Error.Severity.CRITICAL","shaka.util.Error.Category.TEXT","shaka.util.Error.Code.BAD_ENCODING","Sa","littleEndian","opt_noThrow","ArrayBuffer","temp","Uint16Array","dataView","getUint16","Ta","shaka.util.StringUtils.fromUTF16","isAscii","shaka.util.Error.Code.UNABLE_TO_DETECT_ENCODING","Ua","str","utf8","Ra","shaka.util.Timer","Va","id_","callback_","shaka.util.Timer.prototype.schedule","Wa","cancel","shaka.util.Uint8ArrayUtils.toBase64","Xa","opt_padding","base64","shaka.util.Uint8ArrayUtils.fromBase64","Ya","Za","shaka.util.Uint8ArrayUtils.toHex","$a","hex","shaka.util.Uint8ArrayUtils.equal","ab","arr1","shaka.media.DrmEngine","bb","networkingEngine","onKeyStatus","onExpirationUpdated","video_","mediaKeys_","supportedTypes_","initialized_","currentDrmInfo_","eventManager_","activeSessions_","offlineSessionIds_","allSessionsLoaded_","networkingEngine_","config_","onError_","keyStatusByKeyId_","onKeyStatus_","onExpirationUpdated_","keyStatusTimer_","processKeyStatusChanges_","isOffline_","mediaKeyMessageEvents_","initialRequestsSent_","expirationInterval_","pollExpiration_","eb","shaka.media.DrmEngine.prototype.attach","listenOnce","shaka.util.Error.Category.DRM","shaka.util.Error.Code.ENCRYPTED_CONTENT_WITHOUT_DRM_INFO","onPlay_","setMediaKeys","shaka.util.Error.Code.FAILED_TO_ATTACH_TO_VIDEO","setServerCertificate","shaka.util.Error.Code.INVALID_SERVER_CERTIFICATE","fb","createOrLoad","onEncrypted_","shaka.media.DrmEngine.prototype.removeSessions","gb","sessions","loadOfflineSession_","updatePromise","shaka.media.DrmEngine.prototype.createOrLoad","initDatas","initDataOverride","createTemporarySession_","initDataType","shaka.media.DrmEngine.prototype.getSessionIds","jb","cb","shaka.media.DrmEngine.prototype.prepareMediaKeyConfigs_","manifest","offline","configsByKeySystem","keySystemsInOrder","clearKeyDrmInfo","configureClearKey_","periods","period","variants","variant","drmInfos","drmInfo","fillInDrmInfoDefaults_","cast","__platform__","audioCapabilities","videoCapabilities","distinctiveIdentifier","persistentState","sessionTypes","streams","capabilities","robustness","fullMimeType","contentType","shaka.media.DrmEngine.prototype.queryMediaKeys_","db","shaka.util.Error.Code.NO_RECOGNIZED_KEY_SYSTEMS","instigator","shouldHaveLicenseServer","requestMediaKeySystemAccess","shaka.util.Error.Code.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE","mediaKeySystemAccess","isEdge","realConfig","getConfiguration","originalConfig","createCurrentDrmInfo_","createMediaKeys","shaka.util.Error.Code.NO_LICENSE_SERVER_GIVEN","mediaKeys","shaka.util.Error.Code.FAILED_TO_CREATE_CDM","shaka.media.DrmEngine.prototype.fillInDrmInfoDefaults_","lb","server","servers","advanced","shaka.media.DrmEngine.prototype.configureClearKey_","kb","clearKeys","keyIdHex","keyHex","keyId","shaka.util.Uint8ArrayUtils.fromHex","keyObj","kty","kid","initDataStr","kids","shaka.util.StringUtils.toUTF8","shaka.media.DrmEngine.prototype.createCurrentDrmInfo_","mb","licenseServers","serverCerts","processDrmInfos_","shaka.media.DrmEngine.prototype.processDrmInfos_","initDataOverrideEqual","hb","shaka.media.DrmEngine.prototype.loadOfflineSession_","createSession","shaka.util.Error.Code.FAILED_TO_CREATE_SESSION","onSessionMessage_","onKeyStatusesChange_","activeSession","oldExpiration","present","shaka.util.Error.Code.OFFLINE_SESSION_REMOVED","shaka.media.DrmEngine.prototype.createTemporarySession_","ib","generateRequest","shaka.util.Error.Code.FAILED_TO_GENERATE_LICENSE_REQUEST","ob","shaka.media.DrmEngine.prototype.sendLicenseRequest_","unpackPlayReadyRequest_","shaka.net.NetworkingEngine.RequestType.LICENSE","shakaErr","shaka.util.Error.Code.LICENSE_REQUEST_FAILED","shaka.util.Error.Code.LICENSE_RESPONSE_REJECTED","shaka.media.DrmEngine.prototype.unpackPlayReadyRequest_","pb","textContent","qb","tests","basicVideoCapabilities","configs","support","testKeySystems","access","shaka.media.DrmEngine.prototype.isSupportedByKeySystem","rb","shaka.media.DrmEngine.getCommonDrmInfos","drms1","drms2","commonDrms","drm1","drm2","shaka.media.TextEngine","tb","parser_","track_","timestampOffset_","appendWindowEnd_","bufferEnd_","bufferStart_","shaka.media.TextEngine.registerParser","vb","shaka.media.TextEngine.parserMap_","shaka.media.TextEngine.TextParserWrapper_.bind","shaka.media.TextEngine.makeCue","xb","zb","shaka.media.TextEngine.prototype.appendBuffer","parseInit","parseMedia","periodStart","segmentStart","segmentEnd","shaka.media.TextEngine.prototype.removeWhere_","yb","predicate","removeMe","shaka.media.TextEngine.TextParserWrapper_","wb","shaka.media.TimeRangesUtils.bufferEnd","Ab","shaka.media.TimeRangesUtils.isBuffered","Bb","shaka.media.TimeRangesUtils.bufferedAheadOf","Cb","shaka.media.MediaSourceEngine","Db","mediaSource_","textTrack_","sourceBuffers_","textEngine_","queues_","shaka.media.MediaSourceEngine.probeSupport","Eb","testMimeTypes","basicType","shaka.media.MediaSourceEngine.prototype.reinitText","Fb","shaka.media.MediaSourceEngine.prototype.bufferStart","Gb","Ib","shaka.media.MediaSourceEngine.prototype.getBuffered_","shaka.media.MediaSourceEngine.prototype.appendBuffer","Jb","enqueueOperation_","append_","shaka.media.MediaSourceEngine.prototype.clear","Lb","remove_","shaka.media.MediaSourceEngine.prototype.setStreamProperties","Mb","appendWindowEnd","abort_","setTimestampOffset_","setAppendWindowEnd_","Kb","shaka.media.MediaSourceEngine.prototype.enqueueOperation_","operation","shaka.util.Error.Category.MEDIA","shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR","shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW","popFromQueue_","shaka.media.MediaSourceEngine.prototype.enqueueBlockingOperation_","Nb","allWaiters","shaka.media.MediaSourceEngine.prototype.popFromQueue_","Ob","shaka.util.LanguageUtils.match","Pb","fuzz","preference","shaka.util.LanguageUtils.MatchType.BASE_LANGUAGE_OKAY","shaka.util.LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY","shaka.util.LanguageUtils.normalize","Sb","shaka.util.LanguageUtils.isoMap_","shaka.util.StreamUtils.meetsRestrictions","Ub","restrictions","maxHwRes","minWidth","maxWidth","minHeight","maxHeight","minPixels","maxPixels","minBandwidth","maxBandwidth","shaka.util.StreamUtils.applyRestrictions","Vb","tracksChanged","originalAllowed","allowedByApplication","shaka.util.StreamUtils.filterPeriod","Wb","drmEngine","activeStreams","activeVideo","activeAudio","isSupportedByKeySystem","shaka.util.StreamUtils.streamIsCompatible_","textStreams","shaka.util.StreamUtils.getFullMimeType","Xb","activeStream","drmSupportedMimeTypes","encrypted","shaka.util.StreamUtils.getVariantTracks","Zb","activeAudioId","activeVideoId","shaka.util.StreamUtils.getPlayableVariants","isActive","roles","primary","shaka.util.StreamUtils.getTextTracks","ac","activeStreamId","shaka.util.StreamUtils.findVariantForTrack","bc","shaka.util.StreamUtils.findTextStreamForTrack","$b","allowedByKeySystem","shaka.util.StreamUtils.filterVariantsByRoleAndLanguage","dc","preferredLanguage","opt_languageMatches","opt_role","chosen","primaryVariants","pref","EXACT","matchType","betterLangMatchFound","chosenWithRoles","shaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage","ec","primaryStreams","shaka.util.StreamUtils.getVariantByStreams","shaka.util.StreamUtils.getVariantByStreamIds","gc","matchesId","Yb","opt_codecs","shaka.util.StreamUtils.findPeriodContainingTime","hc","shaka.util.StreamUtils.findPeriodContainingStream","ic","periodIdx","trickModeVideo","shaka.abr.SimpleAbrManager","H","switch_","enabled_","bandwidthEstimator_","variants_","textStreams_","startupComplete_","lastTimeChosenMs_","restrictions_","shaka.abr.SimpleAbrManager.filterAndSortVariants_","jc","v1","v2","shaka.util.FakeEvent","I","opt_dict","dict","vc","thing","eventKey","simpleEvent","eventValue","__type__","shaka.cast.CastUtils.deserialize","wc","NaN","shaka.cast.CastUtils.simulateTimeRanges_","xc","shaka.cast.CastSender","yc","receiverAppId","onStatusChanged","onRemoteEvent","onResumeLocal","onInitStateRequired","receiverAppId_","onStatusChanged_","onRemoteEvent_","onResumeLocal_","onInitStateRequired_","isCasting_","hasReceivers_","apiReady_","receiverName_","session_","appData_","cachedProperties_","nextAsyncCallId_","asyncCallPromises_","castPromise_","shaka.cast.CastSender.prototype.rejectAllPromises_","zc","shaka.util.Error.Severity.RECOVERABLE","shaka.util.Error.Category.PLAYER","shaka.util.Error.Code.LOAD_INTERRUPTED","shaka.cast.CastSender.prototype.sendMessage_","Ac","serialized","shaka.cast.CastUtils.serialize","sendMessage","shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE","listeners_","shaka.cast.CastProxy","J","shaka.util.FakeEventTarget.call","localVideo_","localPlayer_","playerEventTarget_","videoEventTarget_","playerProxy_","videoProxy_","sender_","onCastStatusChanged_","getInitState_","init_","Bc","shaka.cast.CastProxy.prototype.init_","shaka.cast.CastUtils.VideoEvents.forEach","videoProxyLocalEvent_","shaka.cast.CastUtils.PlayerEvents.forEach","playerProxyLocalEvent_","videoProxyGet_","videoProxySet_","playerProxyGet_","shaka.cast.CastReceiver","K","opt_appDataCallback","opt_contentIdCallback","player_","targets_","appDataCallback_","opt_contentIdCallback_","contentId","isConnected_","isIdle_","pollTimerId_","genericBus_","shakaBus_","Cc","shaka.cast.CastReceiver.prototype.init_","manager","CastReceiverManager","getInstance","onSenderConnected","onSendersChanged_","onSenderDisconnected","onSystemVolumeChanged","fakeVolumeChangeEvent_","getCastMessageBus","shaka.cast.CastUtils.GENERIC_MESSAGE_NAMESPACE","onMessage","onGenericMessage_","onShakaMessage_","proxyEvent_","canDisplayType","setMaxHardwareResolution","shaka.cast.CastReceiver.prototype.onCastStatusChanged_","Dc","sendMediaStatus_","shaka.cast.CastReceiver.prototype.initState_","Ec","initState","appData","manifestReady","detail","playerAfterLoad","shaka.cast.CastReceiver.prototype.sendMessage_","Fc","bus","opt_senderId","getCastChannel","broadcast","shaka.cast.CastReceiver.prototype.sendMediaStatus_","requestId","opt_media","playState","shaka.cast.CastReceiver.PLAY_STATE","mediaStatus","mediaSessionId","getPlayState_","buffering_","supportedMediaCommands","sendMessage_","shaka.util.XmlUtils.findChild","Hc","shaka.util.XmlUtils.findChildren","M","tagName","shaka.util.XmlUtils.getContents","Ic","contents","Node","TEXT_NODE","shaka.util.XmlUtils.parseAttr","N","parseFunction","opt_defaultValue","parsedValue","getAttribute","shaka.util.XmlUtils.parseDate","Jc","dateString","shaka.util.XmlUtils.parseDuration","Kc","durationString","matches","shaka.util.XmlUtils.parseRange","Lc","rangeString","shaka.util.XmlUtils.parseInt","Mc","intString","shaka.util.XmlUtils.parsePositiveInt","Nc","shaka.util.XmlUtils.parseNonNegativeInt","Oc","shaka.util.XmlUtils.evalDivision","Pc","exprString","Rc","elems","ignoreDrmInfo","parsed","shaka.dash.ContentProtection.parseElements_","defaultInit","defaultKeyId","parsedNonCenc","shaka.util.Error.Category.MANIFEST","shaka.util.Error.Code.DASH_CONFLICTING_KEY_IDS","shaka.dash.ContentProtection.MP4Protection_","schemeUri","shaka.dash.ContentProtection.convertElements_","shaka.dash.ContentProtection.defaultKeySystems_","firstRepresentation","shaka.dash.ContentProtection.parseFromRepresentation","Uc","repContext","shaka.dash.ContentProtection.parseFromAdaptationSet","asUnknown","repUnencrypted","asInfo","repInfo","shaka.util.Error.Code.DASH_NO_COMMON_KEY_SYSTEM","Tc","elements","Sc","psshs","shaka.util.Error.Code.DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED","pssh","shaka.util.Error.Code.DASH_PSSH_BAD_ENCODING","shaka.dash.MpdUtils.fillUriTemplate","Vc","uriTemplate","representationId","number","valueTable","RepresentationID","Bandwidth","Time","widthString","valueString","shaka.dash.MpdUtils.parseSegmentInfo","Wc","timescaleStr","shaka.dash.MpdUtils.inheritAttribute","durationStr","segmentDuration","startNumberStr","presentationTimeOffset","startNumber","timelineNode","shaka.dash.MpdUtils.inheritChild","timeline","periodInfo","timePoints","lastEndTime","timePoint","repeat","nextStartTime","periodDuration","unscaledStart","unscaledPresentationTimeOffset","Xc","representation","adaptationSet","Yc","shaka.media.InitSegmentReference","Zc","startByte","endByte","getUris","shaka.media.SegmentReference","O","shaka.util.DataViewReader","P","endianness","dataView_","littleEndian_","shaka.util.DataViewReader.Endianness.LITTLE_ENDIAN","position_","shaka.util.DataViewReader.prototype.throwOutOfBounds_","ad","shaka.util.Error.Code.BUFFER_READ_OUT_OF_BOUNDS","shaka.util.Mp4Parser","Q","headers_","boxDefinitions_","shaka.util.Mp4Parser.children","R","reader","hasMoreData","parseNext","cd","shaka.util.Mp4Parser.allData","dd","readBytes","shaka.util.Mp4Parser.typeFromString_","bd","shaka.media.Mp4SegmentIndexParser","ed","sidxData","sidxOffset","references","fullBox","shaka.media.Mp4SegmentIndexParser.parseSIDX_","shaka.util.Error.Code.MP4_SIDX_WRONG_BOX_TYPE","fd","shaka.util.Error.Code.MP4_SIDX_INVALID_TIMESCALE","earliestPresentationTime","readUint64","firstOffset","referenceCount","readUint16","unscaledStartTime","chunk","referenceType","referenceSize","subsegmentDuration","shaka.util.Error.Code.MP4_SIDX_TYPE_NOT_SUPPORTED","shaka.media.SegmentIndex","S","references_","shaka.media.SegmentIndex.prototype.fit","gd","lastReference","shaka.util.EbmlParser","hd","reader_","BIG_ENDIAN","shaka.util.EbmlParser.DYNAMIC_SIZES","jd","shaka.util.EbmlParser.prototype.parseElement","vint","parseVint_","parseId_","shaka.util.Error.Code.EBML_OVERFLOW","shaka.util.EbmlParser.DYNAMIC_SIZES.length","shaka.util.Error.Code.JS_INTEGER_OVERFLOW","elementSize","shaka.util.EbmlElement","shaka.util.EbmlParser.prototype.parseVint_","kd","readUint8","ld","shaka.util.EbmlElement.prototype.getUint","md","getUint8","shaka.media.WebmSegmentIndexParser","nd","shaka.media.WebmSegmentIndexParser.prototype.parseCues_","od","cuesElement","segmentOffset","timecodeScale","lastOffset","parseElement","shaka.media.WebmSegmentIndexParser.CUE_POINT_ID","tuple","parseCuePoint_","unscaledTime","currentOffset","relativeOffset","shaka.media.WebmSegmentIndexParser.prototype.parseCuePoint_","pd","cuePointElement","cueTimeElement","shaka.media.WebmSegmentIndexParser.CUE_TIME_ID","shaka.util.Error.Code.WEBM_CUE_TIME_ELEMENT_MISSING","getUint","cueTrackPositionsElement","shaka.media.WebmSegmentIndexParser.CUE_TRACK_POSITIONS_ID","shaka.util.Error.Code.WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING","cueTrackParser","shaka.media.WebmSegmentIndexParser.CUE_CLUSTER_POSITION","shaka.dash.SegmentBase.createInitSegment","qd","initialization","resolvedUris","shaka.dash.SegmentBase.createStream","rd","requestInitSegment","shaka.dash.SegmentBase.fromInheritance_","containerType","shaka.util.Error.Code.DASH_UNSUPPORTED_CONTAINER","shaka.util.Error.Code.DASH_WEBM_MISSING_INIT","representationIndex","indexRangeElem","indexUris","indexRange","representationUri","shaka.util.Error.Code.DASH_NO_SEGMENT_INFO","shaka.dash.SegmentBase.createSegmentIndexFromUris","createSegmentIndex","findSegmentPosition","getSegmentReference","initSegmentReference","td","presentationTimeline","fitLast","dynamic","isLastPeriod","localRequest","segmentIndex","async","indexData","notifySegments","periodStartTime","fit","sd","segmentBase","shaka.dash.SegmentList.createStream","ud","segmentIndexMap","shaka.dash.SegmentList.fromInheritance_","mediaSegments","shaka.dash.SegmentList.parseMediaSegments_","segmentInfo","shaka.dash.SegmentList.createSegmentReferences_","evict","getSegmentAvailabilityStart","vd","segmentList","xd","prevEndTime","mediaUri","wd","urlNode","indexRangeWarningGiven","shaka.dash.SegmentTemplate.createStream","yd","shaka.dash.SegmentTemplate.createInitSegment_","shaka.dash.SegmentTemplate.fromInheritance_","mediaTemplate","indexTemplate","filledTemplate","notifyMaxSegmentDuration","segmentIndexFunctions","shaka.dash.SegmentTemplate.createFromDuration_","shaka.dash.SegmentTemplate.createFromTimeline_","Ad","segmentTemplate","Bd","periodTime","Cd","segmentReplacement","repId","segmentId","zd","shaka.media.ManifestParser.probeSupport","Fd","shaka.media.ManifestParser.parsersByMime","shaka.media.ManifestParser.parsersByExtension","shaka.media.ManifestParser.getFactory","Gd","manifestUri","netEngine","opt_manifestParserFactory","filenamePieces","headRequest","shaka.net.NetworkingEngine.RequestType.MANIFEST","shaka.util.Error.Code.UNABLE_TO_GUESS_MANIFEST_TYPE","shaka.media.PresentationTimeline","T","presentationStartTime","presentationDelay","presentationStartTime_","presentationDelay_","segmentAvailabilityDuration_","duration_","maxSegmentDuration_","clockOffset_","static_","shaka.dash.DashParser","Hd","playerInterface_","manifestUris_","manifest_","periodIds_","globalId_","segmentIndexMap_","updatePeriod_","updateTimer_","shaka.dash.DashParser.prototype.requestManifest_","Id","parseManifest_","shaka.dash.DashParser.prototype.parseManifest_","Kd","finalManifestUri","mpd","documentElement","shaka.util.Error.Code.DASH_INVALID_XML","manifestBaseUris","locations","minBufferTime","segmentAvailabilityDuration","suggestedPresentationDelay","maxSegmentDuration","mpdType","defaultPresentationDelay","shaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_","periodsAndDuration","parsePeriods_","setStatic","setDuration","setSegmentAvailabilityDuration","timingElements","parseUtcTiming_","setClockOffset","offlineSessionIds","shaka.dash.DashParser.prototype.parsePeriods_","Ld","presentationDuration","prevEnd","periodNodes","givenDuration","parsePeriod_","periodId","filterPeriod","shaka.dash.DashParser.prototype.parsePeriod_","Nd","createFrame_","parseEventStream_","adaptationSets","parseAdaptationSet_","representationIds","as","uniqueRepIds","shaka.util.Error.Code.DASH_DUPLICATE_REPRESENTATION_ID","normalAdaptationSets","trickModeFor","trickModeSet","targetId","normalSet","videoSets","getSetsOfType_","audioSets","shaka.util.Error.Code.DASH_EMPTY_PERIOD","createVariants_","textSets","shaka.dash.DashParser.prototype.getSetsOfType_","Pd","shaka.dash.DashParser.prototype.createVariants_","Qd","shaka.dash.DashParser.prototype.setUpdateTimer_","Jd","onUpdate_","shaka.dash.DashParser.MIN_UPDATE_PERIOD_","shaka.dash.DashParser.prototype.createFrame_","Od","containsEmsgBoxes","shaka.dash.DashParser.guessContentType_","shaka.dash.DashParser.prototype.verifyRepresentation_","Sd","APPLICATION","shaka.dash.DashParser.prototype.requestForTiming_","Td","requestUris","date","shaka.dash.DashParser.prototype.parseUtcTiming_","Md","schemesAndValues","clockSyncUri","sv","requestForTiming_","Rd","shaka.hls.Playlist","Ud","opt_segments","shaka.hls.Tag","Vd","opt_value","shaka.hls.Attribute","Wd","Xd","shaka.hls.Tag.prototype.getAttributeValue","defaultValue","shaka.hls.Segment","Yd","shaka.hls.Utils.filterTagsByName","Zd","shaka.hls.Utils.getFirstTagWithName","$d","tagsWithName","shaka.hls.Utils.findMediaTags","ae","typeAttr","groupIdAttr","shaka.util.TextParser","be","data_","shaka.util.TextParser.prototype.readRegex","ce","regex","indexOf_","atEnd","shaka.util.TextParser.prototype.readRegexReturnCapture_","de","readRegex","shaka.hls.ManifestTextParser","ee","shaka.hls.ManifestTextParser.prototype.parsePlaylist","fe","lines","shaka.util.Error.Code.HLS_PLAYLIST_HEADER_MISSING","playlistType","MASTER","shaka.hls.ManifestTextParser.parseTag","parseTag_","shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS.indexOf","MEDIA","shaka.hls.ManifestTextParser.SEGMENT_TAGS.indexOf","shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY","segmentsData","parseSegments_","tagUri","shaka.hls.ManifestTextParser.prototype.parseSegments_","je","ge","blocks","shaka.util.Error.Code.INVALID_HLS_TAG","blockAttrs","shaka.net.DataUriPlugin","ke","shaka.net.DataUriPlugin.parse","content-type","shaka.hls.HlsParser","le","mediaTagsToStreamInfosMap_","streamsToIndexMap_","presentationTimeline_","manifestUri_","manifestTextParser_","ne","shaka.hls.HlsParser.prototype.parseManifest_","playlist","parsePlaylist","shaka.util.Error.Code.HLS_MASTER_PLAYLIST_NOT_PROVIDED","createPeriod_","shaka.hls.HlsParser.prototype.createPeriod_","oe","variantsPromises","createVariantsForTag_","textStreamPromises","shaka.hls.HlsParser.getRequiredAttributeValue_","createTextStream_","allVariants","fitSegments_","shaka.hls.HlsParser.prototype.createVariantsForTag_","pe","getAttributeValue","defaultCodecs","resolutionAttr","resBlocks","getTimeOffset_","mediaTags","audioGroupId","videoGroupId","promises","createStreamInfoFromMediaTag_","audioStreamInfos","videoStreamInfos","createStreamInfo_","createStreamInfoFromVariantTag_","allCodecs","streamInfo","shaka.hls.HlsParser.prototype.createVariants_","ve","audioInfos","videoInfos","audioStream","videoStream","audioDrmInfos","videoDrmInfos","createVariant_","shaka.hls.HlsParser.prototype.createVariant_","xe","shaka.hls.HlsParser.prototype.createTextStream_","qe","shaka.hls.HlsParser.prototype.createStreamInfoFromMediaTag_","te","defaultAttr","autoselectAttr","shaka.hls.HlsParser.prototype.createStreamInfo_","ue","requestManifest_","createInitSegmentReference_","mediaSequenceTag","createSegments_","getDuration","guessCodecs_","SUBTITLE","drmTags","segmentKeyTags","drmTag","keyFormat","drmParser","shaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_","shaka.util.Error.Code.HLS_KEYFORMATS_NOT_SUPPORTED","guessMimeType_","shaka.hls.HlsParser.prototype.createInitSegmentReference_","ye","mapTags","shaka.util.Error.Code.HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND","mapTag","initUri","byterange","shaka.hls.HlsParser.prototype.createSegments_","ze","hlsSegments","extinfValues","getRequiredTag_","shaka.hls.HlsParser.prototype.fitSegments_","shaka.hls.HlsParser.prototype.guessCodecs_","Ae","formats","shaka.hls.HlsParser.VIDEO_CODEC_FORMATS_","shaka.hls.HlsParser.AUDIO_CODEC_FORMATS_","shaka.util.Error.Code.HLS_COULD_NOT_GUESS_CODECS","shaka.hls.HlsParser.prototype.guessMimeType_","Ce","shaka.hls.HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_","shaka.hls.HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_","shaka.net.NetworkingEngine.RequestType.SEGMENT","shaka.util.Error.Code.HLS_COULD_NOT_GUESS_MIME_TYPE","shaka.hls.HlsParser.prototype.getTimeOffset_","se","startTag","defaultTimeOffset","U","attributeName","shaka.util.Error.Code.HLS_REQUIRED_ATTRIBUTE_MISSING","shaka.hls.HlsParser.prototype.getRequiredTag_","De","shaka.util.Error.Code.HLS_REQUIRED_TAG_MISSING","shaka.media.TtmlTextParser","Ie","Ke","isSpanChildOfP","ELEMENT_NODE","leafChildren","shaka.media.TtmlTextParser.getLeafNodes_","shaka.media.TtmlTextParser.addNewLines_","Le","whitespaceTrim","trimmed","shaka.media.TtmlTextParser.getStyleAttribute_","Oe","cueElement","regionChildren","getElementFromCollection_","shaka.media.TtmlTextParser.getElementFromCollection_","Ne","collection","Element","itemName","shaka.media.TtmlTextParser.parseTime_","Me","rateInfo","shaka.media.TtmlTextParser.timeColonFormatFrames_.test","shaka.media.TtmlTextParser.timeColonFormatFrames_.exec","subFrameRate","shaka.media.TtmlTextParser.timeColonFormat_.test","shaka.media.TtmlTextParser.parseTimeFromRegex_","shaka.media.TtmlTextParser.timeColonFormat_","shaka.media.TtmlTextParser.timeColonFormatMilliseconds_.test","shaka.media.TtmlTextParser.timeColonFormatMilliseconds_","shaka.media.TtmlTextParser.timeFramesFormat_.test","shaka.media.TtmlTextParser.timeFramesFormat_.exec","shaka.media.TtmlTextParser.timeTickFormat_.test","shaka.media.TtmlTextParser.timeTickFormat_.exec","tickRate","shaka.media.TtmlTextParser.timeHMSFormat_.test","shaka.media.TtmlTextParser.timeHMSFormat_","Ye","shaka.media.TtmlTextParser.RateInfo_","Je","frameRateMultiplier","multiplierResults","shaka.media.Mp4TtmlParser","Ze","shaka.media.VttTextParser","$e","bf","positionAlign","shaka.media.VttTextParser.parseTime_","af","shaka.media.Mp4VttParser","cf","timescale_","shaka.media.Mp4VttParser.parseVTTC_","df","shaka.media.Mp4VttParser.assembleCue_","ef","readRegexReturnCapture_","shaka.media.VttTextParser.parseSetting","shaka.media.Playhead","ff","onSeek","startTime_","onSeek_","onEvent_","playbackRate_","gapJumpIntervalId_","trickPlayIntervalId_","prevReadyState_","didFireLargeGap_","stallPlayheadTime_","stallWallTime_","hadSegmentAppended_","onLoadedMetadata_","pollGap","onPollGapJump_","onRateChange_","shaka.media.Playhead.prototype.setStartTime","gf","clampTime_","shaka.media.Playhead.prototype.getTime","jf","getStartTime_","shaka.media.Playhead.prototype.getStartTime_","kf","getSeekRangeEnd","shaka.media.Playhead.prototype.setPlaybackRate","rate","shaka.media.Playhead.prototype.reposition_","nf","shaka.media.TimeRangesUtils.isBuffered.bind","rebufferingGoal","getSegmentAvailabilityEnd","safe","getSafeAvailabilityStart","seekStart","seekSafe","shaka.media.Playhead.prototype.movePlayhead_","mf","tries","recheck","shaka.media.Playhead.prototype.clampTime_","hf","shaka.media.PlayheadObserver","of","onBuffering","onChangePeriod","onBuffering_","onChangePeriod_","timelineRegions_","curPeriodIndex_","watchdogTimer_","startWatchdogTimer_","shaka.media.PlayheadObserver.cloneTimelineInfo_","rf","eventElement","shaka.media.PlayheadObserver.prototype.startWatchdogTimer_","pf","cancelWatchdogTimer_","onWatchdogTimer_","shaka.media.PlayheadObserver.prototype.cancelWatchdogTimer_","qf","shaka.media.StreamingEngine","sf","playerInterface","bufferingGoalScale_","setupPeriodPromise_","canSwitchPeriod_","canSwitchStream_","mediaStates_","fatalError_","V","shaka.media.StreamingEngine.prototype.getCurrentPeriod","findPeriodContainingTime_","playhead","shaka.media.StreamingEngine.prototype.getActiveStreams","vf","restoreStreamAfterTrickPlay","shaka.media.StreamingEngine.prototype.notifyNewTextStream","wf","streamsByType","initStreams_","shaka.media.StreamingEngine.prototype.setTrickPlay","xf","normalVideo","mediaState","switch","shaka.media.StreamingEngine.prototype.switch","yf","clearBuffer","ignoreTextStreamFailures","notifyNewTextStream","periodIndex","findPeriodContainingStream_","needPeriodIndex","clearAllBuffers_","reinitText","mediaSourceEngine","canSwitchRecord","resolved","needInitSegment","clearingBuffer","waitingToFlushBuffer","performingUpdate","waitingToClearBuffer","cancelUpdate_","clearBuffer_","shaka.media.StreamingEngine.prototype.seeked","Bf","playheadTime","getBuffered_","shaka.media.StreamingEngine.prototype.clearAllBuffers_","zf","updateTimer","scheduleUpdate_","shaka.media.StreamingEngine.prototype.initStreams_","uf","opt_resumeAt","typeConfig","setDuration_","setupStreams_","lastStream","lastSegmentReference","recovering","resumeAt","shaka.media.StreamingEngine.prototype.setupPeriod_","Ff","shaka.media.StreamingEngine.prototype.setupStreams_","Ef","shaka.media.StreamingEngine.prototype.setDuration_","Df","Gf","shaka.media.StreamingEngine.prototype.update_","timeNeeded","getTimeNeeded_","currentPeriodIndex","bufferingGoal","getBufferingGoal_","bufferedAhead","getSegmentReferenceIfAvailable_","getSegmentReferenceNeeded_","fetchAndAppend_","shaka.media.StreamingEngine.prototype.getSegmentReferenceIfAvailable_","If","availabilityEnd","shaka.media.StreamingEngine.prototype.fetchAndAppend_","Jf","followingPeriod","initSourceBuffer","initSourceBuffer_","fetchSegment","fetch_","onSegmentAppended","handleStartup_","infiniteRetriesForLiveStreams","shaka.util.Error.Code.BAD_HTTP_STATUS","shaka.util.Error.Code.HTTP_ERROR","shaka.util.Error.Code.TIMEOUT","handleNetworkError_","handleQuotaExceeded_","shaka.media.StreamingEngine.prototype.handleQuotaExceeded_","Of","percentBefore","shaka.media.StreamingEngine.prototype.initSourceBuffer_","Kf","setStreamProperties","appendInit","shaka.media.StreamingEngine.prototype.append_","Mf","parseEMSG_","evict_","Pf","shaka.media.StreamingEngine.prototype.evict_","bufferBehind","shaka.media.StreamingEngine.prototype.handleStartup_","Nf","setupPeriod_","onCanSwitch","onStartupComplete","shaka.media.StreamingEngine.prototype.handlePeriodTransition_","Hf","mediaStates","shaka.media.StreamingEngine.isIdle_","needPeriod","onChooseStreams","shaka.util.Error.Category.STREAMING","shaka.util.Error.Code.INVALID_STREAMS_CHOSEN","Qf","shaka.media.StreamingEngine.prototype.fetch_","Lf","Range","shaka.media.StreamingEngine.prototype.clearBuffer_","Af","flush_","shaka.media.StreamingEngine.prototype.scheduleUpdate_","Cf","shaka.media.StreamingEngine.prototype.cancelUpdate_","tf","shaka.net.HttpPlugin","Rf","withCredentials","onload","xhr.onload","getAllResponseHeaders","fromCache","shaka.util.StringUtils.fromBytesAutoDetect","shaka.util.Error.Category.NETWORK","xhr.onerror","ontimeout","xhr.ontimeout","shaka.offline.DBEngine","Sf","db_","operations_","currentIdMap_","shaka.offline.DBEngine.prototype.insert","Wf","storeName","createTransaction_","put","Xf","shaka.offline.DBEngine.prototype.removeKeys","opt_onKeyRemoved","onsuccess","shaka.offline.DBEngine.prototype.getNextId_","Uf","openCursor","request.onsuccess","cursor","shaka.offline.DBEngine.prototype.createTransaction_","Vf","op","transaction","oncomplete","closeOperation_","onabort","shaka.offline.DBEngine.onError_","objectStore","shaka.offline.DBEngine.prototype.createConnection_","Tf","storeMap","opt_retryCount","indexedDB","shaka.offline.DBEngine.DB_NAME_","shaka.offline.DBEngine.DB_VERSION_","upgraded","createPromise","onupgradeneeded","request.onupgradeneeded","createObjectStore","keyPath","createConnection_","shaka.offline.DBEngine.onError_.bind","Yf","errorSource","shaka.util.Error.Category.STORAGE","shaka.util.Error.Code.INDEXED_DB_ERROR","shaka.util.Error.Code.OPERATION_ABORTED","shaka.offline.OfflineUtils.getStoredContent","$f","shaka.offline.OfflineUtils.reconstructPeriod","offlineUri","originalManifestUri","expiration","appMetadata","ag","textStreamsDb","streamDb","shaka.offline.OfflineUtils.createVariants_","shaka.offline.OfflineUtils.createStream_","shaka.offline.OfflineUtils.getSegmentReferences_","dg","bg","audios","videos","shaka.offline.OfflineUtils.areCompatible_","eg","stream1","stream2","variantIds","cg","initSegmentUri","shaka.offline.OfflineUtils.createStorageEngine","fg","shaka.offline.DownloadManager","gg","storageEngine","segments_","storedSegments_","storageEngine_","netEngine_","retryParams_","promise_","bandwidthBytesDownloaded_","bandwidthBytesTotal_","givenBytesDownloaded_","givenBytesTotal_","shaka.offline.DownloadManager.prototype.addSegment","hg","bandwidthSize","segmentDb","shaka.offline.DownloadManager.prototype.downloadAndStore","ig","downloadNext","downloadSegment_","insert","shaka.offline.DownloadManager.prototype.downloadSegment_","jg","byteCount","progress","updateProgress_","progressCallback","shaka.offline.OfflineManifestParser","kg","manifestId_","lg","sessionIds","shaka.offline.OfflineScheme","mg","segmentParts","shaka.offline.OfflineUtils.DB_SCHEME","shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND","shaka.util.Error.Code.STORAGE_NOT_SUPPORTED","shaka.util.Error.Code.MALFORMED_OFFLINE_URI","shaka.util.CancelableChain","ng","canceled_","complete_","final_","cancelPromise_","onCancelComplete_","shaka.util.CancelableChain.prototype.finalize","og","rejectionValue_","shaka.Player","W","opt_dependencyInjector","defaultAbrManager_","streamingEngine_","playheadObserver_","playhead_","mediaSourceOpen_","mediaSourceEngine_","drmEngine_","nextExternalStreamId_","loadingTextStreamIds_","switchingPeriods_","unloadChain_","loadChain_","deferredSwitches_","pendingTimelineRegions_","activeStreamsByPeriod_","defaultConfig_","maxHwRes_","stats_","getCleanStats_","lastTimeStatsUpdateTimestamp_","currentAudioLanguage_","preferredAudioLanguage","currentTextLanguage_","preferredTextLanguage","currentTextRole_","currentVariantRole_","createNetworkingEngine","initialize_","createMediaSource","shaka.Player.TextTrackLabel_","onVideoError_","ug","shaka.Player.prototype.chooseCodecsAndFilterManifest_","variantCodecs","variantsByCodecs","bestCodecs","lowestAverageBandwidth","sum","num","averageBandwidth","shaka.Player.prototype.createMediaSource","rg","zg","shaka.Player.prototype.applyConfig_","streaming","filterPeriod_","chooseStreamsAndSwitch_","getCurrentPeriod","enable","setDefaultEstimate","defaultBandwidthEstimate","setRestrictions","shaka.Player.prototype.addToSwitchHistory_","Cg","fromAdaptation","switchHistory","updateActiveStreams_","shaka.Player.prototype.updateActiveStreams_","Eg","shaka.Player.prototype.destroyStreaming_","sg","stop","shaka.Player.prototype.resetStreaming_","Bg","destroyStreaming_","shaka.Player.prototype.configOverrides_","yg",".drm.servers",".drm.clearKeys",".drm.advanced","shaka.Player.prototype.defaultConfig_","pg","delayLicenseRequestUntilPlayed","customScheme","startAtSegmentBoundary","smallGapLimit","jumpLargeGaps","shaka.Player.prototype.getCleanStats_","qg","streamBandwidth","estimatedBandwidth","loadLatency","playTime","bufferingTime","stateHistory","Dg","shaka.Player.prototype.deferredSwitch_","opt_clearBuffer","shaka.Player.prototype.updateTimeStats_","Gg","shaka.Player.prototype.adjustStartTime_","vg","getAdjustedTime","getActiveStreams","videoStartTime","audioStartTime","Hg","shaka.Player.prototype.chooseStreams_","opt_chooseAll","shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET","setVariants","setTextStreams","needsUpdate","anyMediaState","activeVariant","activePeriod","chooseStreams","shaka.Player.prototype.chooseStreamsAndSwitch_","Ag","languageMatches","chooseStreams_","addToSwitchHistory_","deferredSwitch_","onAdaptation_","onTextTrackVisibility_","shaka.Player.prototype.onAdaptation_","xg","shaka.Player.prototype.onTracksChanged_","wg","shaka.Player.prototype.onTextTrackVisibility_","Fg","shaka.offline.Storage","X","shaka.util.Error.Code.LOCAL_PLAYER_INSTANCE_REQUIRED","storeInProgress_","firstPeriodTracks_","downloadManager_","shaka.offline.Storage.support","Jg","Lg","shaka.offline.Storage.prototype.loadInternal","onKeyStatusChange","manifestParser","checkDestroyed_","onTimelineRegionAdded","createSegmentIndex_","shaka.offline.Storage.prototype.defaultConfig_","Ig","trackSelectionCallback","defaultTrackSelect_","storedContent","shaka.offline.Storage.prototype.initIfNeeded_","Kg","shaka.offline.Storage.prototype.cleanup_","Mg","shaka.offline.Storage.prototype.createSegmentIndex_","Ng","variantStreams","Og","shaka.offline.Storage.prototype.createStream_","estimatedStreamBandwidth","opt_variantId","segmentsDb","addSegment","manifestKey","streamNumber","shaka.offline.Storage.prototype.checkDestroyed_","Y","shaka.polyfill.register","Qg","shaka.polyfill.polyfills_.push","shaka.polyfill.Fullscreen.proxyEvent_","Rg","eventType","newEvent","shaka.util.Pssh","Sg","psshBox","systemIds","cencKeyIds","dataBoundaries","parseBox_","shaka.polyfill.PatchedMediaKeysMs.requestMediaKeySystemAccess","Tg","supportedConfigurations","shaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess","Ug","cfg","newCfg","initDataTypes","ranAnyTests","cap","MSMediaKeys","configuration_","unsupportedKeySystemError","DOMException","NOT_SUPPORTED_ERR","shaka.polyfill.PatchedMediaKeysMs.setMediaKeys","Wg","oldMediaKeys","setMedia","shaka.polyfill.PatchedMediaKeysMs.MediaKeys","Vg","nativeMediaKeys_","shaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.setMedia","Xg","setMediaKeysDeferred","msSetMediaKeys","shaka.polyfill.PatchedMediaKeysMs.onMsNeedKey_","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession","Yg","nativeMediaKeys","nativeMediaKeySession_","updatePromise_","generateRequestPromise_","closed","keyStatuses","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap","Zg","event2","initCustomEvent","unfilteredInitDatas","dedupedInitDatas","shaka.polyfill.PatchedMediaKeysMs.compareInitDatas_","targetLength","normalisedInitData","bh","initDataA","initDataB","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.updateKeyStatus_","ah","setStatus","$g","status_","shaka.polyfill.PatchedMediaKeysNop.requestMediaKeySystemAccess","dh","shaka.polyfill.PatchedMediaKeysNop.setMediaKeys","eh","shaka.polyfill.PatchedMediaKeysNop.MediaKeys","fh","shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess","gh","shaka.polyfill.PatchedMediaKeysWebkit.install","ih","prefix","shaka.polyfill.PatchedMediaKeysWebkit.prefix_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_","shaka.polyfill.PatchedMediaKeysWebkit.requestMediaKeySystemAccess","HTMLMediaElement","shaka.polyfill.PatchedMediaKeysWebkit.setMediaKeys","MediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys","MediaKeySystemAccess","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess","shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_","oh","api","charAt","kh","lh","nh","internalKeySystem_","allowPersistentState","tmpVideo","unsupportedError","mh","keySystem_","media_","newSessions_","sessionMap_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setMedia","ph","onWebkitNeedKey_","onWebkitKeyMessage_","onWebkitKeyAdded_","onWebkitKeyError_","rh","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.findSession_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession","qh","sessionType","generatePromise_","type_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap","uh","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generate_","offlineSessionId","mangledInitData","generateKeyRequestName","sh","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.updateKeyStatus_","th","shaka.polyfill.MediaSource.stubAbort_","vh","MediaSource.prototype.addSourceBuffer","sourceBuffer.abort","shaka.polyfill.MediaSource.patchEndOfStreamEvents_","wh","MediaSource.prototype.endOfStream","newDuration","sourceBuffers","ignoreUpdateEnd_","eventSuppressed_","shaka.polyfill.MediaSource.ignoreUpdateEnd_","cleanUpHandlerInstalled_","shaka.polyfill.MediaSource.cleanUpListeners_","xh","stopPropagation","stopImmediatePropagation","yh","shaka.polyfill.Promise","Z","opt_callback","thens_","catches_","state_","shaka.polyfill.Promise.State.PENDING","resolve_","reject_","shaka.polyfill.Promise.resolve","Ah","shaka.polyfill.Promise.reject","Bh","shaka.polyfill.Promise.all","Ch","others","newValue","shaka.polyfill.Promise.race","Dh","Eh","shaka.polyfill.Promise.prototype.schedule_","shaka.polyfill.Promise.q_.push","wrapper","value_","shaka.polyfill.Promise.handleThenable_","RESOLVED","shaka.polyfill.Promise.flushTimer_","shaka.polyfill.Promise.setImmediate_","shaka.polyfill.Promise.flush","Gh","thenable","sealed","nextThen","Jh","shaka.polyfill.Promise.q_.length","shaka.polyfill.Promise.clearImmediate_","q","shaka.polyfill.Promise.q_","Ih","Kh","shaka.polyfill.VideoPlaybackQuality.webkit_","Lh","corruptedVideoFrames","creationTime","totalFrameDelay","shaka.polyfill.VTTCue.from3ArgsTextTrackCue_","Mh","shaka.polyfill.VTTCue.from6ArgsTextTrackCue_","Nh","goog.global.CLOSURE_NO_DEPS","CLOSURE_NO_DEPS","shaka.abr.EwmaBandwidthEstimator.prototype.setDefaultEstimate","estimate","getBandwidthEstimate","shaka.abr.EwmaBandwidthEstimator.prototype.getBandwidthEstimate","minTotalBytes_","shaka.util.Error.prototype.toString","Severity","shaka.util.Error.Severity","Category","shaka.util.Error.Category","Code","shaka.util.Error.Code","goog$Uri.prototype","goog.Uri.prototype","goog.Uri.prototype.toString","getScheme","goog.Uri.reDisallowedInSchemeOrUserInfo_","domain","getDomain","userInfo","getUserInfo","port","getPort","getPath","hasDomain","goog.Uri.reDisallowedInAbsolutePath_","goog.Uri.reDisallowedInRelativePath_","getEncodedQuery","getFragment","goog.Uri.reDisallowedInFragment_","goog.Uri.prototype.resolve","relativeUri","absoluteUri","overridden","hasPath","lastSlashIndex","leadingSlash","goog.Uri.QueryData.prototype.toString","encodedKey","NetworkingEngine","RequestType","shaka.net.NetworkingEngine.RequestType","shaka.net.NetworkingEngine.schemes_","registerScheme","shaka.net.NetworkingEngine.registerScheme","unregisterScheme","shaka.net.NetworkingEngine.unregisterScheme","registerRequestFilter","shaka.net.NetworkingEngine.prototype.registerRequestFilter","goog.exportProperty","unregisterRequestFilter","shaka.net.NetworkingEngine.prototype.unregisterRequestFilter","filters","clearAllRequestFilters","shaka.net.NetworkingEngine.prototype.clearAllRequestFilters","registerResponseFilter","shaka.net.NetworkingEngine.prototype.registerResponseFilter","unregisterResponseFilter","shaka.net.NetworkingEngine.prototype.unregisterResponseFilter","clearAllResponseFilters","shaka.net.NetworkingEngine.prototype.clearAllResponseFilters","shaka.net.NetworkingEngine.prototype.destroy","cleanup","shaka.net.NetworkingEngine.prototype.request","filterStartMs","requestFilter","shaka.util.Error.Code.REQUEST_FILTER_ERROR","filterTimeMs","send_","resend_","timeMs","shaka.net.NetworkingEngine.prototype.send_","requestFilterTime","shaka.util.Error.Code.UNSUPPORTED_SCHEME","startTimeMs","responseFilter","shaka.util.Error.Code.RESPONSE_FILTER_ERROR","shaka.util.MultiMap.prototype.push","shaka.util.MultiMap.prototype.get","shaka.util.MultiMap.prototype.remove","shaka.util.EventManager.prototype.destroy","shaka.util.EventManager.prototype.unlisten","shaka.util.EventManager.Binding_.prototype.unlisten","fromUTF8","fromUTF16","fromBytesAutoDetect","toUTF8","shaka.util.Timer.prototype.cancel","toBase64","fromBase64","fromHex","toHex","shaka.util.Uint8ArrayUtils.concat","totalLength","shaka$media$DrmEngine.prototype","shaka.media.DrmEngine.prototype.destroy","shaka.media.DrmEngine.prototype","shaka.media.DrmEngine.prototype.configure","shaka.media.DrmEngine.prototype.init","prepareMediaKeyConfigs_","queryMediaKeys_","shaka.media.DrmEngine.prototype.keySystem","getExpiration","shaka.media.DrmEngine.prototype.getExpiration","expirations","shaka.media.DrmEngine.prototype.onEncrypted_","shaka.media.DrmEngine.prototype.onSessionMessage_","delayLicenseRequest_","sendLicenseRequest_","shaka.media.DrmEngine.prototype.onKeyStatusesChange_","hasExpiredKeys","part0","part1","part2","setUint16","msUntilExpiration","schedule","shaka.media.DrmEngine.prototype.processKeyStatusChanges_","isExpired","shaka.util.Error.Code.EXPIRED","shaka.media.DrmEngine.prototype.onPlay_","shaka.media.DrmEngine.prototype.pollExpiration_","new_","registerParser","unregisterParser","shaka.media.TextEngine.unregisterParser","makeCue","shaka.media.TextEngine.prototype.destroy","removeWhere_","shaka.media.TextEngine.prototype.remove","shaka.media.TextEngine.TextParserWrapper_.prototype.parseInit","shaka.media.TextEngine.TextParserWrapper_.prototype.parseMedia","shaka$media$MediaSourceEngine.prototype","shaka.media.MediaSourceEngine.prototype","shaka.media.MediaSourceEngine.prototype.destroy","inProgress","shaka.media.MediaSourceEngine.prototype.init","onUpdateEnd_","shaka.media.MediaSourceEngine.prototype.remove","shaka.media.MediaSourceEngine.prototype.endOfStream","opt_reason","enqueueBlockingOperation_","shaka.media.MediaSourceEngine.prototype.setDuration","shaka.media.MediaSourceEngine.prototype.getDuration","shaka_media_MediaSourceEngine_prototype$append_","shaka.media.MediaSourceEngine.prototype.append_","shaka.media.MediaSourceEngine.prototype.remove_","shaka.media.MediaSourceEngine.prototype.abort_","shaka.media.MediaSourceEngine.prototype.flush_","shaka.media.MediaSourceEngine.prototype.setTimestampOffset_","shaka.media.MediaSourceEngine.prototype.setAppendWindowEnd_","fudge","shaka_media_MediaSourceEngine_prototype$onError_","shaka.media.MediaSourceEngine.prototype.onError_","shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_FAILED","shaka.media.MediaSourceEngine.prototype.onUpdateEnd_","BASE_LANGUAGE_OKAY","OTHER_SUB_LANGUAGE_OKAY","aar","abk","afr","aka","alb","amh","ara","arm","asm","ava","ave","aym","aze","bak","bam","baq","bel","ben","bih","bis","bod","bos","bre","bul","bur","cat","ces","cha","che","chi","chu","chv","cor","cos","cre","cym","cze","dan","deu","div","dut","dzo","ell","eng","epo","est","eus","ewe","fao","fas","fij","fin","fra","fre","fry","ful","geo","ger","gla","gle","glg","glv","gre","grn","guj","hat","hau","heb","her","hin","hmo","hrv","hun","hye","ibo","ice","ido","iii","iku","ile","ina","ind","ipk","isl","ita","jav","jpn","kal","kan","kas","kat","kau","kaz","khm","kik","kin","kir","kom","kon","kor","kua","kur","lao","lat","lav","lim","lin","lit","ltz","lub","lug","mac","mah","mal","mao","mar","may","mkd","mlg","mlt","mon","mri","msa","mya","nau","nav","nbl","nde","ndo","nep","nld","nno","nob","nor","nya","oci","oji","ori","orm","oss","pan","per","pli","pol","por","pus","que","roh","ron","rum","rus","sag","san","sin","slk","slo","slv","sme","smo","sna","snd","som","sot","spa","sqi","srd","srp","ssw","sun","swa","swe","tah","tam","tat","tel","tgk","tgl","tha","tib","tir","ton","tsn","tso","tuk","tur","twi","uig","ukr","urd","uzb","ven","vie","wel","wln","wol","xho","yid","yor","zha","zho","zul","SimpleAbrManager","shaka.abr.SimpleAbrManager.prototype.stop","shaka.abr.SimpleAbrManager.prototype.init","switchCallback","shaka.abr.SimpleAbrManager.prototype.chooseStreams","mediaTypesToUpdate","sortedVariants","chooseVariant_","currentBandwidth","shaka.abr.SimpleAbrManager.BANDWIDTH_UPGRADE_TARGET_","shaka.abr.SimpleAbrManager.BANDWIDTH_DOWNGRADE_TARGET_","shaka.abr.SimpleAbrManager.prototype.enable","shaka.abr.SimpleAbrManager.prototype.disable","segmentDownloaded","shaka.abr.SimpleAbrManager.prototype.segmentDownloaded","deltaTimeMs","minBytes_","suggestStreams_","shaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS","shaka.abr.SimpleAbrManager.prototype.getBandwidthEstimate","shaka.abr.SimpleAbrManager.prototype.setDefaultEstimate","shaka.abr.SimpleAbrManager.prototype.setRestrictions","shaka.abr.SimpleAbrManager.prototype.setVariants","shaka.abr.SimpleAbrManager.prototype.setTextStreams","shaka.util.FakeEvent.prototype.preventDefault","shaka.util.FakeEvent.prototype.stopImmediatePropagation","shaka.util.FakeEvent.prototype.stopPropagation","shaka.cast.CastUtils.VideoEvents","shaka.cast.CastUtils.VideoAttributes","shaka.cast.CastUtils.VideoInitStateAttributes","shaka.cast.CastUtils.VideoVoidMethods","shaka.cast.CastUtils.PlayerEvents","shaka.cast.CastUtils.PlayerGetterMethods","shaka.cast.CastUtils.PlayerInitState","shaka.cast.CastUtils.PlayerInitAfterLoadState","shaka.cast.CastUtils.PlayerVoidMethods","shaka.cast.CastUtils.PlayerPromiseMethods","shaka$cast$CastSender.prototype","shaka.cast.CastSender.prototype","shaka.cast.CastSender.prototype.destroy","rejectAllPromises_","leave","isCasting","shaka.cast.CastSender.prototype.isCasting","receiverName","shaka.cast.CastSender.prototype.receiverName","shaka.cast.CastSender.prototype.init","chrome","isAvailable","__onGCastApiAvailable","sessionRequest","SessionRequest","apiConfig","ApiConfig","onExistingSessionJoined_","onReceiverStatusChanged_","initialize","setAppData","shaka.cast.CastSender.prototype.setAppData","shaka.cast.CastSender.prototype.cast","shaka.util.Error.Category.CAST","shaka.util.Error.Code.ALREADY_CASTING","requestSession","onSessionInitiated_","onConnectionError_","shaka.util.Error.Code.NO_CAST_RECEIVERS","shaka.util.Error.Code.CAST_API_UNAVAILABLE","forceDisconnect","shaka.cast.CastSender.prototype.forceDisconnect","shaka.cast.CastSender.prototype.get","targetName","shaka.cast.CastUtils.VideoVoidMethods.indexOf","remoteCall_","shaka.cast.CastUtils.PlayerVoidMethods.indexOf","shaka.cast.CastUtils.PlayerPromiseMethods.indexOf","remoteAsyncCall_","shaka.cast.CastUtils.PlayerGetterMethods.indexOf","propertyGetter_","shaka.cast.CastSender.prototype.set","shaka.cast.CastSender.prototype.onSessionInitiated_","onSessionCreated_","addUpdateListener","onConnectionStatusChanged_","addMessageListener","onMessageReceived_","shaka.cast.CastSender.prototype.onConnectionError_","shaka.util.Error.Code.UNEXPECTED_CAST_ERROR","shaka.util.Error.Code.CAST_CANCELED_BY_USER","shaka.util.Error.Code.CAST_CONNECTION_TIMED_OUT","shaka.util.Error.Code.CAST_RECEIVER_APP_UNAVAILABLE","shaka.cast.CastSender.prototype.propertyGetter_","shaka.cast.CastSender.prototype.remoteCall_","shaka.cast.CastSender.prototype.remoteAsyncCall_","shaka.cast.CastSender.prototype.onExistingSessionJoined_","shaka.cast.CastSender.prototype.onReceiverStatusChanged_","availability","shaka.cast.CastSender.prototype.onConnectionStatusChanged_","connected","friendlyName","shaka.cast.CastSender.prototype.onMessageReceived_","namespace","fakeEvent","reconstructedError","shaka.util.FakeEventTarget.prototype.addEventListener","shaka.util.FakeEventTarget.prototype.removeEventListener","shaka.util.FakeEventTarget.prototype.dispatchEvent","CastProxy","shaka.cast.CastProxy.prototype.destroy","opt_forceDisconnect","getVideo","shaka.cast.CastProxy.prototype.getVideo","getPlayer","shaka.cast.CastProxy.prototype.getPlayer","canCast","shaka.cast.CastProxy.prototype.canCast","shaka.cast.CastProxy.prototype.isCasting","shaka.cast.CastProxy.prototype.receiverName","shaka.cast.CastProxy.prototype.cast","unload","shaka.cast.CastProxy.prototype.setAppData","suggestDisconnect","shaka.cast.CastProxy.prototype.suggestDisconnect","shaka.cast.CastProxy.prototype.forceDisconnect","shaka$cast$CastProxy.prototype","shaka.cast.CastProxy.prototype.getInitState_","shaka.cast.CastUtils.VideoInitStateAttributes.forEach","shaka.cast.CastUtils.PlayerInitState.forEach","pair","setter","shaka.cast.CastUtils.PlayerInitAfterLoadState.forEach","shaka.cast.CastProxy.prototype","shaka_cast_CastProxy_prototype$onCastStatusChanged_","shaka.cast.CastProxy.prototype.onCastStatusChanged_","shaka_cast_CastProxy_prototype$onResumeLocal_","shaka.cast.CastProxy.prototype.onResumeLocal_","videoState","shaka.cast.CastProxy.prototype.videoProxyGet_","shaka.cast.CastProxy.prototype.videoProxySet_","shaka.cast.CastProxy.prototype.videoProxyLocalEvent_","shaka.cast.CastProxy.prototype.playerProxyGet_","getNetworkingEngine","shaka.cast.CastProxy.prototype.playerProxyLocalEvent_","shaka_cast_CastProxy_prototype$onRemoteEvent_","shaka.cast.CastProxy.prototype.onRemoteEvent_","CastReceiver","isConnected","shaka.cast.CastReceiver.prototype.isConnected","isIdle","shaka.cast.CastReceiver.prototype.isIdle","shaka.cast.CastReceiver.prototype.destroy","shaka$cast$CastReceiver.prototype","shaka.cast.CastReceiver.prototype","shaka.cast.CastReceiver.prototype.onSendersChanged_","getSenders","shaka.cast.CastReceiver.prototype.proxyEvent_","pollAttributes_","shaka.cast.CastReceiver.prototype.pollAttributes_","shaka.cast.CastUtils.VideoAttributes.forEach","shaka.cast.CastUtils.PlayerGetterMethods.forEach","systemVolume","getSystemVolume","shaka.cast.CastReceiver.prototype.fakeVolumeChangeEvent_","shaka.cast.CastReceiver.prototype.onShakaMessage_","initState_","setSystemVolumeLevel","setSystemVolumeMuted","senderId","sendAsyncComplete_","shaka.cast.CastReceiver.prototype.onGenericMessage_","resumeState","volumeObject","oldVolumeLevel","oldVolumeMuted","mediaInfo","shaka.cast.CastReceiver.prototype.sendAsyncComplete_","urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb","InitSegmentReference","SegmentReference","DataViewReader","LITTLE_ENDIAN","Endianness","shaka.util.DataViewReader.Endianness","shaka.util.DataViewReader.prototype.hasMoreData","getPosition","shaka.util.DataViewReader.prototype.getPosition","getLength","shaka.util.DataViewReader.prototype.getLength","shaka.util.DataViewReader.prototype.readUint8","throwOutOfBounds_","shaka.util.DataViewReader.prototype.readUint16","shaka.util.DataViewReader.prototype.readUint32","readInt32","shaka.util.DataViewReader.prototype.readInt32","getInt32","shaka.util.DataViewReader.prototype.readUint64","low","high","shaka.util.DataViewReader.prototype.readBytes","shaka.util.DataViewReader.prototype.skip","readTerminatedString","shaka.util.DataViewReader.prototype.readTerminatedString","Mp4Parser","shaka.util.Mp4Parser.prototype.box","typeCode","BASIC_BOX","shaka.util.Mp4Parser.prototype.fullBox","FULL_BOX","shaka.util.Mp4Parser.prototype.parse","shaka.util.Mp4Parser.prototype.parseNext","absStart","boxDefinition","versionAndFlags","payloadReader","sampleDescription","shaka.util.Mp4Parser.sampleDescription","allData","SegmentIndex","shaka.media.SegmentIndex.prototype.destroy","shaka.media.SegmentIndex.prototype.find","shaka.media.SegmentIndex.prototype.get","shaka.media.SegmentIndex.prototype.merge","nextPosition","newReferences","r1","r2","shaka.media.SegmentIndex.prototype.evict","shaka.util.EbmlParser.prototype.hasMoreData","shaka.media.WebmSegmentIndexParser.prototype.parse","cuesData","shaka.media.WebmSegmentIndexParser.EBML_ID","shaka.util.Error.Code.WEBM_EBML_HEADER_ELEMENT_MISSING","segmentElement","shaka.media.WebmSegmentIndexParser.SEGMENT_ID","shaka.util.Error.Code.WEBM_SEGMENT_ELEMENT_MISSING","infoElement","shaka.media.WebmSegmentIndexParser.INFO_ID","shaka.util.Error.Code.WEBM_INFO_ELEMENT_MISSING","timecodeScaleNanoseconds","durationScale","shaka.media.WebmSegmentIndexParser.TIMECODE_SCALE_ID","shaka.media.WebmSegmentIndexParser.DURATION_ID","getFloat32","shaka.util.Error.Code.EBML_BAD_FLOATING_POINT_SIZE","getFloat64","shaka.util.Error.Code.WEBM_DURATION_ELEMENT_MISSING","shaka.media.WebmSegmentIndexParser.CUES_ID","shaka.util.Error.Code.WEBM_CUES_ELEMENT_MISSING","parseCues_","registerParserByExtension","shaka.media.ManifestParser.registerParserByExtension","parserFactory","registerParserByMime","shaka.media.ManifestParser.registerParserByMime","PresentationTimeline","shaka.media.PresentationTimeline.prototype.getDuration","shaka.media.PresentationTimeline.prototype.setDuration","getPresentationStartTime","shaka.media.PresentationTimeline.prototype.getPresentationStartTime","shaka.media.PresentationTimeline.prototype.setClockOffset","shaka.media.PresentationTimeline.prototype.setStatic","isStatic","getSegmentAvailabilityDuration","shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityDuration","shaka.media.PresentationTimeline.prototype.setSegmentAvailabilityDuration","shaka.media.PresentationTimeline.prototype.notifySegments","shaka.media.PresentationTimeline.prototype.notifyMaxSegmentDuration","shaka.media.PresentationTimeline.prototype.isLive","isInProgress","shaka.media.PresentationTimeline.prototype.isInProgress","shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityStart","shaka.media.PresentationTimeline.prototype.getSafeAvailabilityStart","shaka.media.PresentationTimeline.prototype.getSegmentAvailabilityEnd","getLiveEdge_","shaka.media.PresentationTimeline.prototype.getSeekRangeEnd","DashParser","shaka$dash$DashParser.prototype","shaka.dash.DashParser.prototype","shaka.dash.DashParser.prototype.configure","shaka.dash.DashParser.prototype.start","setUpdateTimer_","shaka.dash.DashParser.prototype.stop","shaka.dash.DashParser.prototype.update","shaka.dash.DashParser.prototype.onExpirationUpdated","shaka.dash.DashParser.prototype.parseAdaptationSet_","roleElements","roleValues","unrecognizedEssentialProperty","contentProtectionElems","contentProtection","representations","parseRepresentation_","shaka.util.Error.Code.DASH_EMPTY_ADAPTATION_SET","repIds","shaka.dash.DashParser.prototype.parseRepresentation_","isPrimary","verifyRepresentation_","requestInitSegment_","shaka_dash_DashParser_prototype$onUpdate_","shaka.dash.DashParser.prototype.onUpdate_","shaka.dash.DashParser.prototype.parseEventStream_","schemeIdUri","eventNode","shaka.dash.DashParser.prototype.requestInitSegment_","shaka.hls.Tag.prototype.toString","attr_to_str","shaka.hls.Tag.prototype.getAttribute","shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS","shaka.hls.ManifestTextParser.SEGMENT_TAGS","DataUriPlugin","shaka.util.Error.Code.MALFORMED_DATA_URI","infoAndData","dataStr","typeAndEncoding","encoding","shaka.util.Error.Code.UNKNOWN_DATA_URI_ENCODING","HlsParser","shaka$hls$HlsParser.prototype","shaka.hls.HlsParser.prototype","shaka.hls.HlsParser.prototype.configure","shaka.hls.HlsParser.prototype.start","shaka.hls.HlsParser.prototype.stop","shaka.hls.HlsParser.prototype.update","shaka.hls.HlsParser.prototype.onExpirationUpdated","m4s","m4i","m4a","m4v","shaka.hls.HlsParser.widevineDrmParser_","parsedData","m3u8","shaka.media.TtmlTextParser.prototype.parseInit","shaka.media.TtmlTextParser.prototype.parseMedia","shaka.util.Error.Code.INVALID_XML","tt","spaceStyle","regions","textNodes","hasAttribute","shaka.util.Error.Code.INVALID_TEXT_CUE","extent","shaka.media.TtmlTextParser.percentValues_.exec","writingMode","isVerticalText","origin","shaka.media.TtmlTextParser.textAlignToPositionAlign_","shaka.media.TtmlTextParser.textAlignToLineAlign_","shaka.media.TtmlTextParser.timeColonFormatFrames_","shaka.media.TtmlTextParser.timeFramesFormat_","shaka.media.TtmlTextParser.timeTickFormat_","shaka.media.TtmlTextParser.percentValues_","shaka.media.Mp4TtmlParser.prototype.parseInit","sawSTPP","shaka.util.Error.Code.INVALID_MP4_TTML","shaka.media.Mp4TtmlParser.prototype.parseMedia","sawMDAT","shaka.media.VttTextParser.prototype.parseInit","shaka.media.VttTextParser.prototype.parseMedia","shaka.util.Error.Code.INVALID_TEXT_HEADER","cueTimeMatch","mpegTimeMatch","shaka.media.VttTextParser.MPEG_TIMESCALE_","expect","shaka.media.Mp4VttParser.prototype.parseInit","sawWVTT","shaka.util.Error.Code.INVALID_MP4_VTT","shaka.media.Mp4VttParser.prototype.parseMedia","presentations","payloads","sawTFDT","sawTRUN","sampleCount","presentation","shaka$media$Playhead.prototype","shaka.media.Playhead.prototype.destroy","shaka.media.Playhead.prototype","getPlaybackRate","shaka.media.Playhead.prototype.getPlaybackRate","shaka.media.Playhead.prototype.onSegmentAppended","shaka.media.Playhead.prototype.onRateChange_","setPlaybackRate","shaka.media.Playhead.prototype.onLoadedMetadata_","onSeeking_","onPlaying_","onSeekingToStartTime_","shaka.media.Playhead.prototype.onSeekingToStartTime_","shaka.media.Playhead.prototype.onPollGapJump_","threshold","gapIndex","jumpTo","jumpSize","isGapSmall","jumpLargeGap","gapSize","movePlayhead_","shaka.media.Playhead.prototype.onSeeking_","reposition_","shaka.media.Playhead.prototype.onPlaying_","shaka.media.PlayheadObserver.prototype.destroy","addTimelineRegion","shaka.media.PlayheadObserver.prototype.addTimelineRegion","regionInfo","existing","FUTURE_REGION","updateTimelineRegion_","shaka.media.PlayheadObserver.prototype.updateTimelineRegion_","isSeek","newStatus","PAST_REGION","INSIDE","wasInside","isInside","shaka.media.PlayheadObserver.prototype.onWatchdogTimer_","newPeriod","shaka.media.PlayheadObserver.FUDGE_FACTOR_","buffering","setBuffering_","shaka.media.PlayheadObserver.UNDERFLOW_THRESHOLD_","shaka$media$StreamingEngine.prototype","shaka.media.StreamingEngine.prototype","shaka.media.StreamingEngine.prototype.destroy","shaka.media.StreamingEngine.prototype.configure","shaka.media.StreamingEngine.prototype.init","onInitialStreamsSetup","shaka_media_StreamingEngine_prototype$onUpdate_","shaka.media.StreamingEngine.prototype.onUpdate_","update_","handlePeriodTransition_","shaka.media.StreamingEngine.prototype.parseEMSG_","schemeId","presentationTimeDelta","eventDuration","messageData","onManifestUpdate","HttpPlugin","http","https","shaka$offline$DBEngine.prototype","shaka.offline.DBEngine.prototype","shaka.offline.DBEngine.prototype.init","stores","getNextId_","shaka.offline.DBEngine.prototype.destroy","shaka.offline.DBEngine.prototype.get","shaka.offline.DBEngine.prototype.forEach","continue","shaka.offline.DBEngine.prototype.remove","shaka.offline.DownloadManager.prototype.destroy","storage","removeKeys","shaka$offline$OfflineManifestParser.prototype","shaka.offline.OfflineManifestParser.prototype","shaka.offline.OfflineManifestParser.prototype.configure","shaka.offline.OfflineManifestParser.prototype.start","manifestId","shaka.offline.OfflineManifestParser.reconstructManifest","shaka.offline.OfflineManifestParser.prototype.stop","shaka.offline.OfflineManifestParser.prototype.update","shaka.offline.OfflineManifestParser.prototype.onExpirationUpdated","OfflineScheme","shaka.util.CancelableChain.prototype.then","shaka.util.CancelableChain.prototype.cancel","shaka.Player.prototype.destroy","cancelation","GIT_VERSION","shaka.Player.supportPlugins_","registerSupportPlugin","shaka.Player.registerSupportPlugin","shaka.Player.isBrowserSupported","probeSupport","shaka.Player.probeSupport","shaka.media.DrmEngine.probeSupport","shaka.Player.prototype.load","opt_startTime","unloadPromise","loadChain","finalize","updateState_","onTimelineRegionAdded_","shaka.util.Error.Code.NO_PERIODS","createDrmEngine","createPlayhead","createPlayheadObserver","createMediaSourceEngine","createStreamingEngine","onChooseStreams_","canSwitch_","onManifestUpdate_","onSegmentAppended_","chooseCodecsAndFilterManifest_","adjustStartTime_","setStartTime","onTracksChanged_","shaka.Player.prototype.configure","configOverrides_","applyConfig_","shaka.Player.prototype.getConfiguration","resetConfiguration","shaka.Player.prototype.resetConfiguration","getMediaElement","shaka.Player.prototype.getMediaElement","shaka.Player.prototype.getNetworkingEngine","getManifestUri","shaka.Player.prototype.getManifestUri","shaka.Player.prototype.isLive","shaka.Player.prototype.isInProgress","seekRange","shaka.Player.prototype.seekRange","shaka.Player.prototype.keySystem","shaka.Player.prototype.drmInfo","shaka.Player.prototype.getExpiration","isBuffering","shaka.Player.prototype.isBuffering","shaka.Player.prototype.unload","interrupt","resetStreaming_","shaka.Player.prototype.getPlaybackRate","trickPlay","shaka.Player.prototype.trickPlay","setTrickPlay","cancelTrickPlay","shaka.Player.prototype.cancelTrickPlay","shaka.Player.prototype.getTracks","selectTrack","shaka.Player.prototype.selectTrack","shaka.Player.prototype.getVariantTracks","shaka.Player.prototype.getTextTracks","shaka.Player.prototype.selectTextTrack","streamsToSwitch","shaka.Player.prototype.selectVariantTrack","currentTextStream","getAudioLanguages","shaka.Player.prototype.getAudioLanguages","getTextLanguages","shaka.Player.prototype.getTextLanguages","shaka.Player.prototype.selectAudioLanguage","shaka.Player.prototype.selectTextLanguage","isTextTrackVisible","shaka.Player.prototype.isTextTrackVisible","shaka.Player.prototype.setTextTrackVisibility","getPlayheadTimeAsDate","shaka.Player.prototype.getPlayheadTimeAsDate","getStats","shaka.Player.prototype.getStats","updateTimeStats_","videoInfo","shaka.Player.prototype.addTextTrack","mime","opt_codec","opt_label","curPeriodIdx","shaka.Player.prototype.setMaxHardwareResolution","shaka$Player.prototype","shaka.Player.prototype","shaka_Player_prototype$filterPeriod_","shaka.Player.prototype.filterPeriod_","hasPlayableVariants","allVariantsRestricted","shaka.util.Error.Code.UNPLAYABLE_PERIOD","shaka_Player_prototype$onSegmentDownloaded_","shaka.Player.prototype.onSegmentDownloaded_","shaka_Player_prototype$onBuffering_","shaka.Player.prototype.onBuffering_","shaka_Player_prototype$onChangePeriod_","shaka.Player.prototype.onChangePeriod_","shaka.Player.prototype.updateState_","lastEntry","shaka_Player_prototype$onSeek_","shaka.Player.prototype.onSeek_","seeked","shaka.Player.prototype.onChooseStreams_","shaka.Player.prototype.canSwitch_","shaka.Player.prototype.onManifestUpdate_","shaka.Player.prototype.onSegmentAppended_","shaka_Player_prototype$switch_","shaka.Player.prototype.switch_","oldActive","shaka_Player_prototype$onError_","shaka.Player.prototype.onError_","shaka.Player.prototype.onTimelineRegionAdded_","shaka_Player_prototype$onEvent_","shaka.Player.prototype.onEvent_","shaka.Player.prototype.onVideoError_","extended","msExtendedCode","shaka.util.Error.Code.VIDEO_ERROR","shaka_Player_prototype$onKeyStatus_","shaka.Player.prototype.onKeyStatus_","keyStatusMap","restrictedStatuses","keyStatus","shaka_Player_prototype$onExpirationUpdated_","shaka.Player.prototype.onExpirationUpdated_","Storage","shaka.offline.Storage.prototype.destroy","shaka.offline.Storage.prototype.configure","shaka.offline.Storage.prototype.store","shaka.util.Error.Code.STORE_ALREADY_IN_PROGRESS","manifestDb","initIfNeeded_","shaka.util.Error.Code.CANNOT_STORE_LIVE_OFFLINE","createOfflineManifest_","getSessionIds","shaka.util.Error.Code.NO_INIT_DATA_FOR_OFFLINE","downloadAndStore","cleanup_","shaka.offline.Storage.prototype.remove","removeSessions","deleteCount","segmentCount","shaka.offline.Storage.prototype.list","storedContents","shaka.offline.Storage.prototype.defaultTrackSelect_","selectedTracks","audioLangPref","matchTypes","allVariantTracks","tracksByMatchType","primaryTracks","tracksByHeight","shaka.offline.Storage.prototype.filterPeriod_","shaka.offline.Storage.prototype.createPeriod_","chosenTracks","foundSimilarTracks","bandwidthEstimation","createStream_","shaka.polyfill.installAll","shaka.polyfill.polyfills_.length","shaka.polyfill.polyfills_","shaka.polyfill.Fullscreen.install","Document","requestFullscreen","mozRequestFullScreen","msRequestFullscreen","mozCancelFullScreen","msExitFullscreen","webkitExitFullscreen","mozFullScreenElement","msFullscreenElement","webkitFullscreenElement","mozFullScreenEnabled","msFullscreenEnabled","webkitFullscreenEnabled","shaka.polyfill.IndexedDB.install","agent","shaka.polyfill.MathRound.install","testNumber","original_mathRound","Math.round","shaka.polyfill.MathRound.MAX_ACCURATE_INPUT_","shaka.util.Pssh.prototype.parseBox_","systemId","numKeyIds","dataSize","shaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.createMediaKeys","shaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.getConfiguration","shaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.createSession","opt_sessionType","shaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.setServerCertificate","shaka$polyfill$PatchedMediaKeysMs$MediaKeySession.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.generateRequest","onMsKeyMessage_","onMsKeyAdded_","onMsKeyError_","updateKeyStatus_","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.load","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.update","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.close","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.remove","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.onMsKeyMessage_","messageType","getStatus","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.onMsKeyAdded_","shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.onMsKeyError_","errorCode","MSMediaKeyError","MS_MEDIA_KEYERR_OUTPUT","MS_MEDIA_KEYERR_HARDWARECHANGE","shaka$polyfill$PatchedMediaKeysMs$MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.setStatus","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.getStatus","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.forEach","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.get","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.has","fakeKeyId","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.entries","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.keys","shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.values","shaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.createSession","shaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.setServerCertificate","shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.getConfiguration","shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.createMediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.createMediaKeys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.getConfiguration","shaka$polyfill$PatchedMediaKeysWebkit$MediaKeys.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.createSession","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setServerCertificate","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitNeedKey_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyMessage_","findSession_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyAdded_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyError_","systemCode","MediaKeyError","MEDIA_KEYERR_OUTPUT","shaka$polyfill$PatchedMediaKeysWebkit$MediaKeySession.prototype","shaka_polyfill_PatchedMediaKeysWebkit_MediaKeySession_prototype$update_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update_","licenseString","jwkSet","addKeyName","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generateRequest","generate_","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.load","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update","nextUpdatePromise","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.close","cancelKeyRequestName","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.remove","jh","shaka$polyfill$PatchedMediaKeysWebkit$MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.setStatus","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.getStatus","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.forEach","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.get","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.has","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.entries","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.keys","shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.values","shaka.polyfill.MediaKeys.install","webkitGenerateKeyRequest","generateKeyRequest","shaka.polyfill.MediaSource.install","appVersion","shaka.polyfill.Promise.prototype.then","opt_successCallback","opt_failCallback","schedule_","shaka.polyfill.Promise.prototype.catch","shaka.polyfill.Promise.prototype.resolve_","shaka.polyfill.Promise.prototype.reject_","shaka.polyfill.Promise.install","opt_force","setImmediate","clearImmediate","race","shaka.polyfill.VideoPlayPromise.install","originalPlay","HTMLMediaElement.prototype.play","shaka.polyfill.VideoPlaybackQuality.install","shaka.polyfill.VTTCue.install","constructorLength","shaka","_sessionId2","getConfig","entryID","_sessionId","_generateGUID","S4","_addSessionId","delimiter","primaryGUID","secondGUID","_replaceSecondGUID","secondGUIDRegex","newSessionId","handleSessionId","sessionIdRegex"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,OAAA,mBAAAH,GACA,gBAAAC,SACAA,QAAA,cAAAD,IAEAD,EAAA,cAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,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jCpC5V,OAAOC,eAAenB,EAAS,cAC7B+B,OAAO,IAmET/B,EAAQ6D,Q6SxqjCO81N","file":"kaltura-player.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(\"KalturaPlayer\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"KalturaPlayer\"] = factory();\n\telse\n\t\troot[\"KalturaPlayer\"] = 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(\"KalturaPlayer\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"KalturaPlayer\"] = factory();\n\telse\n\t\troot[\"KalturaPlayer\"] = 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/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Playkit\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Playkit\"] = factory();\n\telse\n\t\troot[\"Playkit\"] = 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\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\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.l = 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// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 21);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 * General track representation of the player.\n * @classdesc\n */\nvar Track = function () {\n _createClass(Track, [{\n key: \"id\",\n\n\n /**\n * Getter for the track id.\n * @public\n * @returns {?string} - The track id.\n */\n\n /**\n * The language of the track.\n * @member\n * @type {string}\n * @private\n */\n\n /**\n * The active mode of the track.\n * @member\n * @type {boolean}\n * @private\n */\n get: function get() {\n return this._id;\n }\n\n /**\n * Getter for the active mode of the track.\n * @public\n * @returns {boolean} - The active mode of the track.\n */\n\n /**\n * The index of the track.\n * @member\n * @type {number}\n * @private\n */\n\n /**\n * The label of the track.\n * @member\n * @type {string}\n * @private\n */\n\n /**\n * The id of the track.\n * @member\n * @type {string}\n * @private\n */\n\n }, {\n key: \"active\",\n get: function get() {\n return this._active;\n }\n\n /**\n * Setter for the active mode of the track.\n * @public\n * @param {boolean} value - Whether the track is active or not.\n */\n ,\n set: function set(value) {\n this._active = value;\n }\n\n /**\n * Getter for the label of the track.\n * @public\n * @returns {string} - The label of the track.\n */\n\n }, {\n key: \"label\",\n get: function get() {\n return this._label;\n }\n\n /**\n * Getter for the language of the track.\n * @public\n * @returns {string} - The language of the track.\n */\n\n }, {\n key: \"language\",\n get: function get() {\n return this._language;\n }\n\n /**\n * Getter for the index of the track.\n * @public\n * @returns {number} - The index of the track.\n */\n\n }, {\n key: \"index\",\n get: function get() {\n return this._index;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n\n }]);\n\n function Track() {\n var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Track);\n\n this._id = settings.id;\n this._active = settings.active;\n this._label = settings.label;\n this._language = settings.language;\n this._index = settings.index;\n }\n\n return Track;\n}();\n\nexports.default = Track;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.LOG_LEVEL = undefined;\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 _jsLogger = __webpack_require__(25);\n\nvar JsLogger = _interopRequireWildcard(_jsLogger);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LOG_LEVEL = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nvar LoggerFactory = function () {\n function LoggerFactory(options) {\n _classCallCheck(this, LoggerFactory);\n\n JsLogger.useDefaults(options || {});\n }\n\n _createClass(LoggerFactory, [{\n key: \"getLogger\",\n value: function getLogger(name) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n }]);\n\n return LoggerFactory;\n}();\n\nvar lf = new LoggerFactory({ defaultLevel: JsLogger.DEBUG });\n\nexports.default = lf;\nexports.LOG_LEVEL = LOG_LEVEL;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 * Create an Event work-alike object based on the dictionary.\n * The event should contain all of the same properties from the dict.\n * @param {string} type -\n * @param {Object=} opt_dict -\n * @constructor\n * @extends {Event}\n */\nvar FakeEvent = function () {\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n\n\n /** @type {EventTarget} */\n\n\n /** @const {string} */\n\n\n /** @const {boolean} */\n\n /** @const {boolean} */\n function FakeEvent(type, payload) {\n _classCallCheck(this, FakeEvent);\n\n // These Properties below cannot be set by dict. They are all provided for\n // compatibility with native events.\n\n /** @const {boolean} */\n this.bubbles = false;\n\n /** @const {boolean} */\n this.cancelable = false;\n\n /** @const {boolean} */\n this.defaultPrevented = false;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n this.timeStamp = window.performance ? window.performance.now() : Date.now();\n\n /** @const {string} */\n this.type = type;\n\n /** @const {boolean} */\n this.isTrusted = false;\n\n /** @type {EventTarget} */\n this.currentTarget = null;\n\n /** @type {EventTarget} */\n this.target = null;\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n this.stopped = false;\n\n this.payload = payload;\n }\n\n /**\n * Does nothing, since FakeEvents have no default. Provided for compatibility\n * with native Events.\n * @override\n */\n\n\n /** @type {EventTarget} */\n\n\n /** @const {boolean} */\n\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n\n\n /** @const {boolean} */\n\n\n _createClass(FakeEvent, [{\n key: \"preventDefault\",\n value: function preventDefault() {}\n\n /**\n * Stops processing event listeners for this event. Provided for compatibility\n * with native Events.\n * @override\n */\n\n }, {\n key: \"stopImmediatePropagation\",\n value: function stopImmediatePropagation() {\n this.stopped = true;\n }\n\n /**\n * Does nothing, since FakeEvents do not bubble. Provided for compatibility\n * with native Events.\n * @override\n */\n\n }, {\n key: \"stopPropagation\",\n value: function stopPropagation() {}\n }]);\n\n return FakeEvent;\n}();\n\nexports.default = FakeEvent;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\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\n/**\n * Audio track representation of the player.\n * @classdesc\n */\nvar AudioTrack = function (_Track) {\n _inherits(AudioTrack, _Track);\n\n function AudioTrack() {\n _classCallCheck(this, AudioTrack);\n\n return _possibleConstructorReturn(this, (AudioTrack.__proto__ || Object.getPrototypeOf(AudioTrack)).apply(this, arguments));\n }\n\n return AudioTrack;\n}(_track2.default);\n\nexports.default = AudioTrack;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\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\n/**\n * Text track representation of the player.\n * @classdesc\n */\nvar TextTrack = function (_Track) {\n _inherits(TextTrack, _Track);\n\n _createClass(TextTrack, [{\n key: 'kind',\n\n\n /**\n * Getter for the kind of the text track.\n * @public\n * @returns {string} - The kind of the text track.\n */\n get: function get() {\n return this._kind;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n\n /**\n * The kind of the text track:\n * subtitles/captions/metadata.\n * @member\n * @type {string}\n * @private\n */\n\n }]);\n\n function TextTrack() {\n var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, TextTrack);\n\n var _this = _possibleConstructorReturn(this, (TextTrack.__proto__ || Object.getPrototypeOf(TextTrack)).call(this, settings));\n\n _this._kind = settings.kind;\n return _this;\n }\n\n return TextTrack;\n}(_track2.default);\n\nexports.default = TextTrack;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\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\n/**\n * Video track representation of the player.\n * @classdesc\n */\nvar VideoTrack = function (_Track) {\n _inherits(VideoTrack, _Track);\n\n _createClass(VideoTrack, [{\n key: 'bandwidth',\n\n\n /**\n * Getter for the kind of the text track.\n * @public\n * @returns {string} - The kind of the text track.\n */\n get: function get() {\n return this._bandwidth;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n\n /**\n * The kind of the text track:\n * subtitles/captions/metadata.\n * @member\n * @type {string}\n * @private\n */\n\n }]);\n\n function VideoTrack() {\n var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, VideoTrack);\n\n var _this = _possibleConstructorReturn(this, (VideoTrack.__proto__ || Object.getPrototypeOf(VideoTrack)).call(this, settings));\n\n _this._bandwidth = settings.bandwidth;\n return _this;\n }\n\n return VideoTrack;\n}(_track2.default);\n\nexports.default = VideoTrack;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _multiMap = __webpack_require__(17);\n\nvar _multiMap2 = _interopRequireDefault(_multiMap);\n\nvar _fakeEvent = __webpack_require__(2);\n\nvar _fakeEvent2 = _interopRequireDefault(_fakeEvent);\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\n/**\n * Creates a new EventManager. An EventManager maintains a collection of \"event\n * bindings\" between event targets and event listeners.\n *\n * @struct\n * @constructor\n * @implements {IDestroyable}\n */\nvar EventManager = function () {\n function EventManager() {\n _classCallCheck(this, EventManager);\n\n /**\n * Maps an event type to an array of event bindings.\n * @private {MultiMap.<!EventManager.Binding_>}\n */\n this._bindingMap = new _multiMap2.default();\n }\n\n /**\n * Detaches all event listeners.\n * @override\n */\n\n\n _createClass(EventManager, [{\n key: 'destroy',\n value: function destroy() {\n this.removeAll();\n this._bindingMap = null;\n return Promise.resolve();\n }\n\n /**\n * Attaches an event listener to an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {EventManager.ListenerType} listener The event listener.\n * @returns {void}\n */\n\n }, {\n key: 'listen',\n value: function listen(target, type, listener) {\n var binding = new Binding_(target, type, listener);\n if (this._bindingMap) {\n this._bindingMap.push(type, binding);\n }\n }\n\n /**\n * Detaches an event listener from an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @returns {void}\n */\n\n }, {\n key: 'unlisten',\n value: function unlisten(target, type) {\n if (this._bindingMap) {\n var list = this._bindingMap.get(type);\n\n for (var i = 0; i < list.length; ++i) {\n var binding = list[i];\n\n if (binding.target == target) {\n binding.unlisten();\n if (this._bindingMap) {\n this._bindingMap.remove(type, binding);\n }\n }\n }\n }\n }\n\n /**\n * Detaches all event listeners from all targets.\n * @returns {void}\n */\n\n }, {\n key: 'removeAll',\n value: function removeAll() {\n if (this._bindingMap) {\n var listeners = this._bindingMap.getAll();\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = listeners[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var listener = _step.value;\n\n listener.unlisten();\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n if (this._bindingMap) {\n this._bindingMap.clear();\n }\n }\n }\n }]);\n\n return EventManager;\n}();\n\n/**\n * @typedef {function(!Event)}\n */\n\n\n/**\n * Creates a new Binding_ and attaches the event listener to the event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {EventManager.ListenerType} listener The event listener.\n * @constructor\n * @private\n */\nvar Binding_ = function () {\n function Binding_(target, type, listener) {\n _classCallCheck(this, Binding_);\n\n /** @type {EventTarget} */\n this.target = target;\n\n /** @type {string} */\n this.type = type;\n\n /** @type {?EventManager.ListenerType} */\n this.listener = listener;\n\n this.target.addEventListener(type, listener, false);\n }\n\n /**\n * Detaches the event listener from the event target. This does nothing if the\n * event listener is already detached.\n * @returns {void}\n */\n\n\n _createClass(Binding_, [{\n key: 'unlisten',\n value: function unlisten() {\n if (!this.target) return;\n\n this.target.removeEventListener(this.type, this.listener, false);\n\n this.target = null;\n this.listener = null;\n }\n }]);\n\n return Binding_;\n}();\n\nexports.default = EventManager;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CUSTOM_EVENTS = exports.HTML5_EVENTS = exports.PLAYER_EVENTS = undefined;\n\nvar _util = __webpack_require__(11);\n\nvar HTML5_EVENTS = {\n /**\n * Fires when the loading of an audio/video is aborted\n */\n ABORT: 'abort',\n /**\n * Fires when the browser can start playing the audio/video\n */\n CAN_PLAY: 'canplay',\n /**\n * Fires when the browser can play through the audio/video without stopping for buffering\n */\n CAN_PLAY_THROUGH: 'canplaythrough',\n /**\n * Fires when the duration of the audio/video is changed\n */\n DURATION_CHANGE: 'durationchange',\n /**\n * Fires when the current playlist is empty\n */\n EMPTIED: 'emptied',\n /**\n * Fires when the current playlist is ended\n */\n ENDED: 'ended',\n /**\n * Fires when an error occurred during the loading of an audio/video\n */\n ERROR: 'error',\n /**\n * Fires when the browser has loaded the current frame of the audio/video\n */\n LOADED_DATA: 'loadeddata',\n /**\n * Fires when the browser has loaded meta data for the audio/video\n */\n LOADED_METADATA: 'loadedmetadata',\n /**\n * Fires when the browser starts looking for the audio/video\n */\n LOAD_START: 'loadstart',\n /**\n * Fires when the audio/video has been paused\n */\n PAUSE: 'pause',\n /**\n * Fires when the audio/video has been started or is no longer paused\n */\n PLAY: 'play',\n /**\n * Fires when the audio/video is playing after having been paused or stopped for buffering\n */\n PLAYING: 'playing',\n /**\n * Fires when the browser is downloading the audio/video\n */\n PROGRESS: 'progress',\n /**\n * Fires when the playing speed of the audio/video is changed\n */\n RATE_CHANGE: 'ratechange',\n /**\n * Fires when the user is finished moving/skipping to a new position in the audio/video\n */\n SEEKED: 'seeked',\n /**\n * Fires when the user starts moving/skipping to a new position in the audio/video\n */\n SEEKING: 'seeking',\n /**\n * Fires when the browser is trying to get media data, but data is not available\n */\n STALLED: 'stalled',\n /**\n * Fires when the browser is intentionally not getting media data\n */\n SUSPEND: 'suspend',\n /**\n * Fires when the current playback position has changed\n */\n TIME_UPDATE: 'timeupdate',\n /**\n * Fires when the volume has been changed\n */\n VOLUME_CHANGE: 'volumechange',\n /**\n * Fires when the video stops because it needs to buffer the next frame\n */\n WAITING: 'waiting'\n};\n\n\nvar CUSTOM_EVENTS = {\n /**\n * Fires when the active video track has been changed\n */\n VIDEO_TRACK_CHANGED: 'videotrackchanged',\n /**\n * Fires when the active audio track has been changed\n */\n AUDIO_TRACK_CHANGED: 'audiotrackchanged',\n /**\n * Fires when the active text track has been changed\n */\n TEXT_TRACK_CHANGED: 'texttrackchanged',\n /**\n * Fires when the player tracks have been changed\n */\n TRACKS_CHANGED: 'trackschanged',\n /**\n * Fires when the player state has been changed\n */\n PLAYER_STATE_CHANGED: 'playerstatechanged',\n /**\n * Fires on the first play\n */\n FIRST_PLAY: 'firstplay',\n /**\n * Fires when the player has selected the source to play\n */\n SOURCE_SELECTED: 'sourceselected'\n};\n\nvar PLAYER_EVENTS = (0, _util.merge)([HTML5_EVENTS, CUSTOM_EVENTS]);\n\nexports.PLAYER_EVENTS = PLAYER_EVENTS;\nexports.HTML5_EVENTS = HTML5_EVENTS;\nexports.CUSTOM_EVENTS = CUSTOM_EVENTS;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 && obj !== Symbol.prototype ? \"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\nvar _eventManager = __webpack_require__(6);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _fakeEvent = __webpack_require__(2);\n\nvar _fakeEvent2 = _interopRequireDefault(_fakeEvent);\n\nvar _fakeEventTarget = __webpack_require__(9);\n\nvar _fakeEventTarget2 = _interopRequireDefault(_fakeEventTarget);\n\nvar _events = __webpack_require__(7);\n\nvar _stateTypes = __webpack_require__(16);\n\nvar _stateTypes2 = _interopRequireDefault(_stateTypes);\n\nvar _util = __webpack_require__(11);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _html = __webpack_require__(19);\n\nvar _html2 = _interopRequireDefault(_html);\n\nvar _pluginManager = __webpack_require__(15);\n\nvar _pluginManager2 = _interopRequireDefault(_pluginManager);\n\nvar _stateManager = __webpack_require__(22);\n\nvar _stateManager2 = _interopRequireDefault(_stateManager);\n\nvar _trackTypes = __webpack_require__(24);\n\nvar _trackTypes2 = _interopRequireDefault(_trackTypes);\n\nvar _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\n\nvar _videoTrack = __webpack_require__(5);\n\nvar _videoTrack2 = _interopRequireDefault(_videoTrack);\n\nvar _audioTrack = __webpack_require__(3);\n\nvar _audioTrack2 = _interopRequireDefault(_audioTrack);\n\nvar _textTrack = __webpack_require__(4);\n\nvar _textTrack2 = _interopRequireDefault(_textTrack);\n\nvar _playerConfig = __webpack_require__(26);\n\nvar _playerConfig2 = _interopRequireDefault(_playerConfig);\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\n/**\n * The HTML5 player class.\n * @classdesc\n */\nvar Player = function (_FakeEventTarget) {\n _inherits(Player, _FakeEventTarget);\n\n /**\n * @param {Object} config - The configuration for the player instance.\n * @constructor\n */\n\n /**\n * The player class logger.\n * @type {any}\n * @static\n * @private\n */\n function Player(config) {\n _classCallCheck(this, Player);\n\n var _this = _possibleConstructorReturn(this, (Player.__proto__ || Object.getPrototypeOf(Player)).call(this));\n\n _this._tracks = [];\n _this._firstPlay = true;\n _this._stateManager = new _stateManager2.default(_this);\n _this._pluginManager = new _pluginManager2.default();\n _this._eventManager = new _eventManager2.default();\n _this._readyPromise = new Promise(function (resolve, reject) {\n _this._eventManager.listen(_this, _events.CUSTOM_EVENTS.TRACKS_CHANGED, function () {\n resolve();\n });\n _this._eventManager.listen(_this, _events.HTML5_EVENTS.ERROR, reject);\n });\n _this.configure(config);\n return _this;\n }\n\n /**\n * Configures the player according to given configuration.\n * @param {Object} config - The configuration for the player instance.\n * @returns {void}\n */\n\n /**\n * The available engines of the player.\n * @type {Array<typeof IEngine>}\n * @private\n */\n\n /**\n * The plugin manager of the player.\n * @type {PluginManager}\n * @private\n */\n\n /**\n * The event manager of the player.\n * @type {EventManager}\n * @private\n */\n\n /**\n * The runtime configuration of the player.\n * @type {Object}\n * @private\n */\n\n /**\n * The playback engine.\n * @type {IEngine}\n * @private\n */\n\n /**\n * The state manager of the player.\n * @type {StateManager}\n * @private\n */\n\n /**\n * The tracks of the player.\n * @type {Array<Track>}\n * @private\n */\n\n /**\n * The player ready promise\n * @type {Promise<*>}\n * @private\n */\n\n /**\n * Whether the play is the first or not\n * @type {boolean}\n * @private\n */\n\n\n _createClass(Player, [{\n key: 'configure',\n value: function configure(config) {\n this._config = (0, _util.mergeDeep)(Player._defaultConfig(), config);\n if (this._selectEngine()) {\n this._attachMedia();\n this._loadPlugins();\n this._handlePlaybackConfig();\n } else {\n Player._logger.warn(\"No playable engines was found to play the given sources\");\n }\n }\n\n /**\n * Destroys the player.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n if (this._engine) {\n this._engine.destroy();\n }\n this._eventManager.destroy();\n this._pluginManager.destroy();\n this._stateManager.destroy();\n this._config = {};\n this._tracks = [];\n this._readyPromise = null;\n this._firstPlay = true;\n }\n\n /**\n * @returns {Object} - The default configuration of the player.\n * @private\n * @static\n */\n\n }, {\n key: '_loadPlugins',\n\n\n /**\n * Loads the configured plugins.\n * @private\n * @returns {void}\n */\n value: function _loadPlugins() {\n var plugins = this._config.plugins;\n for (var name in plugins) {\n this._pluginManager.load(name, this, plugins[name]);\n }\n }\n\n /**\n * Selects the engine to create based on a given configuration.\n * @private\n * @returns {boolean} - Whether a proper engine was found.\n */\n\n }, {\n key: '_selectEngine',\n value: function _selectEngine() {\n if (this._config.sources && this._config.playback && this._config.playback.streamPriority) {\n return this._selectEngineByPriority();\n }\n return false;\n }\n\n /**\n * Selects an engine to play a source according to a given stream priority.\n * @return {boolean} - Whether a proper engine was found to play the given sources\n * according to the priority.\n * @private\n */\n\n }, {\n key: '_selectEngineByPriority',\n value: function _selectEngineByPriority() {\n var _this2 = this;\n\n var streamPriority = this._config.playback.streamPriority;\n var sources = this._config.sources;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n var _loop = function _loop() {\n var priority = _step.value;\n\n var engineId = typeof priority.engine === 'string' ? priority.engine.toLowerCase() : '';\n var format = typeof priority.format === 'string' ? priority.format.toLowerCase() : '';\n var engine = Player._engines.find(function (engine) {\n return engine.id === engineId;\n });\n if (engine) {\n var formatSources = sources[format];\n if (formatSources && formatSources.length > 0) {\n var source = formatSources[0];\n if (engine.canPlayType(source.mimetype)) {\n _this2._loadEngine(engine, source);\n return {\n v: true\n };\n }\n }\n }\n };\n\n for (var _iterator = streamPriority[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ret = _loop();\n\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return false;\n }\n\n /**\n * Loads the selected engine.\n * @param {IEngine} engine - The selected engine.\n * @param {Source} source - The selected source object.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_loadEngine',\n value: function _loadEngine(engine, source) {\n this.dispatchEvent(new _fakeEvent2.default(_events.CUSTOM_EVENTS.SOURCE_SELECTED, { selectedSource: source }));\n this._engine = engine.createEngine(source, this._config);\n }\n\n /**\n * Listen to all HTML5 defined events and trigger them on the player\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_attachMedia',\n value: function _attachMedia() {\n var _this3 = this;\n\n if (this._engine) {\n for (var playerEvent in _events.HTML5_EVENTS) {\n this._eventManager.listen(this._engine, _events.HTML5_EVENTS[playerEvent], function (event) {\n return _this3.dispatchEvent(event);\n });\n }\n this._eventManager.listen(this._engine, _events.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED, function (event) {\n _this3._markActiveTrack(event.payload.selectedVideoTrack);\n return _this3.dispatchEvent(event);\n });\n this._eventManager.listen(this._engine, _events.CUSTOM_EVENTS.AUDIO_TRACK_CHANGED, function (event) {\n _this3._markActiveTrack(event.payload.selectedAudioTrack);\n return _this3.dispatchEvent(event);\n });\n this._eventManager.listen(this._engine, _events.CUSTOM_EVENTS.TEXT_TRACK_CHANGED, function (event) {\n _this3._markActiveTrack(event.payload.selectedTextTrack);\n return _this3.dispatchEvent(event);\n });\n this._eventManager.listen(this, _events.HTML5_EVENTS.PLAY, this._onPlay.bind(this));\n }\n }\n }, {\n key: '_handlePlaybackConfig',\n value: function _handlePlaybackConfig() {\n if (this._config.playback) {\n if (this._config.playback.muted) {\n this.muted = true;\n }\n if (this._config.playback.preload === \"auto\") {\n this.load();\n }\n if (this._config.playback.autoplay) {\n this.play();\n }\n }\n }\n\n /**\n * Returns the tracks according to the filter. if no filter given returns the all tracks.\n * @function getTracks\n * @param {string} [type] - a tracks filter, should be 'video', 'audio' or 'text'.\n * @returns {Array<Track>} - The parsed tracks.\n * @public\n */\n\n }, {\n key: 'getTracks',\n value: function getTracks(type) {\n return this._getTracksByType(type);\n }\n\n /**\n * Returns the tracks according to the filter. if no filter given returns the all tracks.\n * @function _getTracksByType\n * @param {string} [type] - a tracks filter, should be 'video', 'audio' or 'text'.\n * @returns {Array<Track>} - The parsed tracks.\n * @private\n */\n\n }, {\n key: '_getTracksByType',\n value: function _getTracksByType(type) {\n return !type ? this._tracks : this._tracks.filter(function (track) {\n if (type === _trackTypes2.default.VIDEO) {\n return track instanceof _videoTrack2.default;\n } else if (type === _trackTypes2.default.AUDIO) {\n return track instanceof _audioTrack2.default;\n } else if (type === _trackTypes2.default.TEXT) {\n return track instanceof _textTrack2.default;\n } else {\n return true;\n }\n });\n }\n\n /**\n * Select a track\n * @function selectTrack\n * @param {Track} track - the track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectTrack',\n value: function selectTrack(track) {\n if (this._engine) {\n if (track instanceof _videoTrack2.default) {\n this._engine.selectVideoTrack(track);\n } else if (track instanceof _audioTrack2.default) {\n this._engine.selectAudioTrack(track);\n } else if (track instanceof _textTrack2.default) {\n this._engine.selectTextTrack(track);\n }\n }\n }\n\n /**\n * Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'hideTextTrack',\n value: function hideTextTrack() {\n if (this._engine) {\n this._engine.hideTextTrack();\n this._getTracksByType(_trackTypes2.default.TEXT).map(function (track) {\n return track.active = false;\n });\n }\n }\n\n /**\n * Enables adaptive bitrate switching.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'enableAdaptiveBitrate',\n value: function enableAdaptiveBitrate() {\n if (this._engine) {\n this._engine.enableAdaptiveBitrate();\n }\n }\n\n /**\n * Mark the selected track as active\n * @function _markActiveTrack\n * @param {Track} track - the track to mark\n * @returns {void}\n * @private\n */\n\n }, {\n key: '_markActiveTrack',\n value: function _markActiveTrack(track) {\n var type = void 0;\n if (track instanceof _videoTrack2.default) {\n type = _trackTypes2.default.VIDEO;\n } else if (track instanceof _audioTrack2.default) {\n type = _trackTypes2.default.AUDIO;\n } else if (track instanceof _textTrack2.default) {\n type = _trackTypes2.default.TEXT;\n }\n if (type) {\n var tracks = this.getTracks(type);\n for (var i = 0; i < tracks.length; i++) {\n tracks[i].active = track.index === i;\n }\n }\n }\n\n /**\n * @function _onPlay\n * @return {void}\n * @private\n */\n\n }, {\n key: '_onPlay',\n value: function _onPlay() {\n if (this._firstPlay) {\n this._firstPlay = false;\n this.dispatchEvent(new _fakeEvent2.default(_events.CUSTOM_EVENTS.FIRST_PLAY));\n }\n }\n\n /**\n * Get the player config.\n * @returns {Object} - The player configuration.\n * @public\n */\n\n }, {\n key: 'ready',\n\n\n // <editor-fold desc=\"Playback Interface\">\n /**\n * The player readiness\n * @public\n * @returns {Promise<*>} - The ready promise\n */\n value: function ready() {\n return this._readyPromise ? this._readyPromise : Promise.resolve();\n }\n\n /**\n * Load media\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'load',\n value: function load() {\n var _this4 = this;\n\n if (this._engine) {\n this._engine.load().then(function (data) {\n _this4._tracks = data.tracks;\n _this4.dispatchEvent(new _fakeEvent2.default(_events.CUSTOM_EVENTS.TRACKS_CHANGED, { tracks: _this4._tracks }));\n }).catch(function (error) {\n _this4.dispatchEvent(new _fakeEvent2.default(_events.HTML5_EVENTS.ERROR, error));\n });\n }\n }\n\n /**\n * Start/resume playback.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'play',\n value: function play() {\n var _this5 = this;\n\n if (this._engine) {\n if (this._engine.src) {\n this._engine.play();\n } else {\n this.load();\n this.ready().then(function () {\n _this5._engine.play();\n });\n }\n }\n }\n\n /**\n * Pause playback.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'pause',\n value: function pause() {\n if (this._engine) {\n return this._engine.pause();\n }\n }\n\n /**\n * Set the current time in seconds.\n * @param {Number} to - The number to set in seconds.\n * @public\n */\n\n }, {\n key: 'buffered',\n value: function buffered() {}\n\n /**\n * Set player muted state.\n * @param {boolean} mute - The mute value.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'config',\n get: function get() {\n return this._config;\n }\n\n /**\n * Set player session id\n * @param {string} sessionId - the player session id to set\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'sessionId',\n set: function set(sessionId) {\n this._config.session = this._config.session || {};\n this._config.session.id = sessionId;\n }\n }, {\n key: 'currentTime',\n set: function set(to) {\n if (this._engine) {\n if ((0, _util.isNumber)(to)) {\n var boundedTo = to;\n if (to < 0) {\n boundedTo = 0;\n }\n if (boundedTo > this._engine.duration) {\n boundedTo = this._engine.duration;\n }\n this._engine.currentTime = boundedTo;\n }\n }\n }\n\n /**\n * Get the current time in seconds.\n * @returns {?Number} - The playback current time.\n * @public\n */\n ,\n get: function get() {\n if (this._engine) {\n return this._engine.currentTime;\n }\n }\n\n /**\n * Get the duration in seconds.\n * @returns {?Number} - The playback duration.\n * @public\n */\n\n }, {\n key: 'duration',\n get: function get() {\n if (this._engine) {\n return this._engine.duration;\n }\n }\n\n /**\n * Set playback volume.\n * @param {Number} vol - The volume to set.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'volume',\n set: function set(vol) {\n if (this._engine) {\n if ((0, _util.isFloat)(vol)) {\n var boundedVol = vol;\n if (boundedVol < 0) {\n boundedVol = 0;\n }\n if (boundedVol > 1) {\n boundedVol = 1;\n }\n this._engine.volume = boundedVol;\n }\n }\n }\n\n /**\n * Get playback volume.\n * @returns {?Number} - The playback volume.\n * @public\n */\n ,\n get: function get() {\n if (this._engine) {\n return this._engine.volume;\n }\n }\n\n // </editor-fold>\n\n // <editor-fold desc=\"State\">\n /**\n * Get paused state.\n * @returns {?boolean} - Whether the video is paused or not.\n * @public\n */\n\n }, {\n key: 'paused',\n get: function get() {\n if (this._engine) {\n return this._engine.paused;\n }\n }\n\n /**\n * Get seeking state.\n * @returns {?boolean} - Whether the video is seeking or not.\n * @public\n */\n\n }, {\n key: 'seeking',\n get: function get() {\n if (this._engine) {\n return this._engine.seeking;\n }\n }\n }, {\n key: 'muted',\n set: function set(mute) {\n if (this._engine) {\n this._engine.muted = mute;\n }\n }\n\n /**\n * Get player muted state.\n * @returns {?boolean} - Whether the video is muted or not.\n * @public\n */\n ,\n get: function get() {\n if (this._engine) {\n return this._engine.muted;\n }\n }\n\n /**\n * Get the player source.\n * @returns {?string} - The current source of the player.\n * @public\n */\n\n }, {\n key: 'src',\n get: function get() {\n if (this._engine) {\n return this._engine.src;\n }\n }\n\n /**\n * Get the player events.\n * @returns {Object} - The events of the player.\n * @public\n */\n\n }, {\n key: 'Event',\n get: function get() {\n return _events.PLAYER_EVENTS;\n }\n\n /**\n * Get the player states.\n * @returns {Object} - The states of the player.\n * @public\n */\n\n }, {\n key: 'State',\n get: function get() {\n return _stateTypes2.default;\n }\n\n /**\n * Get the player tracks types.\n * @returns {Object} - The tracks types of the player.\n * @public\n */\n\n }, {\n key: 'Track',\n get: function get() {\n return _trackTypes2.default;\n }\n\n // </editor-fold>\n\n }], [{\n key: '_defaultConfig',\n value: function _defaultConfig() {\n return (0, _util.copyDeep)(_playerConfig2.default);\n }\n }]);\n\n return Player;\n}(_fakeEventTarget2.default);\n\nPlayer._logger = _logger2.default.getLogger('Player');\nPlayer._engines = [_html2.default];\nexports.default = Player;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _fakeEvent = __webpack_require__(2);\n\nvar _fakeEvent2 = _interopRequireDefault(_fakeEvent);\n\nvar _multiMap = __webpack_require__(17);\n\nvar _multiMap2 = _interopRequireDefault(_multiMap);\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\n/**\n * A work-alike for EventTarget. Only DOM elements may be true EventTargets,\n * but this can be used as a base class to provide event dispatch to non-DOM\n * classes. Only FakeEvents should be dispatched.\n *\n * @struct\n * @constructor\n * @implements {EventTarget}\n * @export\n */\nvar FakeEventTarget = function () {\n function FakeEventTarget() {\n _classCallCheck(this, FakeEventTarget);\n\n /**\n * @private {!MultiMap.<FakeEventTarget.ListenerType>}\n */\n this._listeners = new _multiMap2.default();\n\n /**\n * The target of all dispatched events. Defaults to |this|.\n * @type {EventTarget}\n */\n this.dispatchTarget = this;\n }\n\n /**\n * Add an event listener to this object.\n *\n * @param {string} type The event type to listen for.\n * @param {FakeEventTarget.ListenerType} listener The callback or\n * listener object to invoke.\n * @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have\n * parents, so events neither capture nor bubble.\n * @override\n * @export\n */\n\n\n _createClass(FakeEventTarget, [{\n key: 'addEventListener',\n value: function addEventListener(type, listener) {\n this._listeners.push(type, listener);\n }\n\n /**\n * Remove an event listener from this object.\n *\n * @param {string} type The event type for which you wish to remove a listener.\n * @param {FakeEventTarget.ListenerType} listener The callback or\n * listener object to remove.\n * @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have\n * parents, so events neither capture nor bubble.\n * @override\n * @export\n */\n\n }, {\n key: 'removeEventListener',\n value: function removeEventListener(type, listener) {\n this._listeners.remove(type, listener);\n }\n\n /**\n * Dispatch an event from this object.\n *\n * @param {!Event} event The event to be dispatched from this object.\n * @return {boolean} True if the default action was prevented.\n * @override\n * @export\n */\n\n }, {\n key: 'dispatchEvent',\n value: function dispatchEvent(event) {\n // In many browsers, it is complex to overwrite properties of actual Events.\n // Here we expect only to dispatch FakeEvents, which are simpler.\n //goog.asserts.assert(event instanceof FakeEvent,\n // 'FakeEventTarget can only dispatch FakeEvents!');\n\n var list = this._listeners.get(event.type) || [];\n\n for (var i = 0; i < list.length; ++i) {\n // Do this every time, since events can be re-dispatched from handlers.\n event.target = this.dispatchTarget;\n event.currentTarget = this.dispatchTarget;\n\n var listener = list[i];\n try {\n if (listener.handleEvent) {\n listener.handleEvent(event);\n } else {\n listener.call(this, event);\n }\n } catch (exception) {\n // Exceptions during event handlers should not affect the caller,\n // but should appear on the console as uncaught, according to MDN:\n // http://goo.gl/N6Ff27\n // TODO: add log\n }\n\n if (event.stopped) {\n break;\n }\n }\n\n return event.defaultPrevented;\n }\n }]);\n\n return FakeEventTarget;\n}();\n\n/**\n * These are the listener types defined in the closure extern for EventTarget.\n * @typedef {EventListener|function(!Event):(boolean|undefined)}\n */\n\n\nexports.default = FakeEventTarget;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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\nvar PlayerError = function () {\n function PlayerError(error, param) {\n _classCallCheck(this, PlayerError);\n\n this.name = error.name;\n this.message = error.message(param);\n }\n\n _createClass(PlayerError, [{\n key: \"getError\",\n value: function getError() {\n return {\n name: this.name,\n message: this.message\n };\n }\n }]);\n\n return PlayerError;\n}();\n\nPlayerError.TYPE = {\n NOT_REGISTERED_PLUGIN: {\n name: \"PluginNotRegisteredException\",\n message: function message(name) {\n return \"Cannot load \" + name + \" plugin. Name not found in the registry\";\n }\n },\n NOT_VALID_HANDLER: {\n name: \"PluginHandlerIsNotValidException\",\n message: function message() {\n return \"To activate plugin you must provide a class derived from BasePlugin\";\n }\n },\n NOT_IMPLEMENTED_METHOD: {\n name: \"NotImplementedException\",\n message: function message(method) {\n return method + \" method not implemented\";\n }\n }\n};\nexports.default = PlayerError;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is a number\n */\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 && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _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\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction isNumber(n) {\n return Number(n) === n;\n}\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is an integer\n */\nfunction isInt(n) {\n return isNumber(n) && n % 1 === 0;\n}\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is a float\n */\nfunction isFloat(n) {\n return isNumber(n) && n % 1 !== 0;\n}\n\n/**\n * @param {Array<Object>} objects - The objects to merge\n * @returns {Object} - The merged object.\n */\nfunction merge(objects) {\n var target = {};\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = objects[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var obj = _step.value;\n\n Object.assign(target, obj);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return target;\n}\n\n/**\n * @param {any} item - The item to check.\n * @returns {boolean} - Whether the item is an object.\n */\nfunction isObject(item) {\n return item && (typeof item === \"undefined\" ? \"undefined\" : _typeof(item)) === 'object' && !Array.isArray(item);\n}\n\n/**\n * @param {any} target - The target object.\n * @param {any} sources - The objects to merge.\n * @returns {Object} - The merged object.\n */\nfunction mergeDeep(target) {\n for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n sources[_key - 1] = arguments[_key];\n }\n\n if (!sources.length) {\n return target;\n }\n var source = sources.shift();\n if (isObject(target) && isObject(source)) {\n for (var key in source) {\n if (isObject(source[key])) {\n if (!target[key]) Object.assign(target, _defineProperty({}, key, {}));\n mergeDeep(target[key], source[key]);\n } else {\n Object.assign(target, _defineProperty({}, key, source[key]));\n }\n }\n }\n return mergeDeep.apply(undefined, [target].concat(_toConsumableArray(sources)));\n}\n\n/**\n * @param {any} data - The data to copy.\n * @returns {any} - The copied data.\n */\nfunction copyDeep(data) {\n var node = void 0;\n if (Array.isArray(data)) {\n node = data.length > 0 ? data.slice(0) : [];\n node.forEach(function (e, i) {\n if ((typeof e === \"undefined\" ? \"undefined\" : _typeof(e)) === \"object\" && e !== {} || Array.isArray(e) && e.length > 0) {\n node[i] = copyDeep(e);\n }\n });\n } else if ((typeof data === \"undefined\" ? \"undefined\" : _typeof(data)) === \"object\") {\n node = Object.assign({}, data);\n Object.keys(node).forEach(function (key) {\n if (_typeof(node[key]) === \"object\" && node[key] !== {} || Array.isArray(node[key]) && node[key].length > 0) {\n node[key] = copyDeep(node[key]);\n }\n });\n } else {\n node = data;\n }\n return node;\n}\n\nexports.isNumber = isNumber;\nexports.isInt = isInt;\nexports.isFloat = isFloat;\nexports.isObject = isObject;\nexports.merge = merge;\nexports.mergeDeep = mergeDeep;\nexports.copyDeep = copyDeep;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _fakeEvent = __webpack_require__(2);\n\nvar _fakeEvent2 = _interopRequireDefault(_fakeEvent);\n\nvar _fakeEventTarget = __webpack_require__(9);\n\nvar _fakeEventTarget2 = _interopRequireDefault(_fakeEventTarget);\n\nvar _playerError = __webpack_require__(10);\n\nvar _playerError2 = _interopRequireDefault(_playerError);\n\nvar _events = __webpack_require__(7);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\n\nvar _videoTrack = __webpack_require__(5);\n\nvar _videoTrack2 = _interopRequireDefault(_videoTrack);\n\nvar _audioTrack = __webpack_require__(3);\n\nvar _audioTrack2 = _interopRequireDefault(_audioTrack);\n\nvar _textTrack = __webpack_require__(4);\n\nvar _textTrack2 = _interopRequireDefault(_textTrack);\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/* eslint-disable no-unused-vars */\n\n\nvar BaseMediaSourceAdapter = function (_FakeEventTarget) {\n _inherits(BaseMediaSourceAdapter, _FakeEventTarget);\n\n _createClass(BaseMediaSourceAdapter, null, [{\n key: 'isSupported',\n\n\n /**\n * Checks if the media source adapter is supported.\n * @function isSupported\n * @returns {boolean} - Whether the media source adapter is supported.\n * @static\n */\n\n\n /**\n * The adapter config.\n * @member {Object} _config\n * @private\n */\n\n\n /**\n * The source object.\n * @member {Source} _sourceObj\n * @private\n */\n\n\n /**\n * The dom video element.\n * @member {HTMLVideoElement} _videoElement\n * @private\n */\n\n /**\n * Passing the custom events to the actual media source adapter.\n * @static\n */\n value: function isSupported() {\n return true;\n }\n\n /**\n * Factory method to create media source adapter.\n * @function createAdapter\n * @param {HTMLVideoElement} videoElement - The video element that the media source adapter work with.\n * @param {Object} source - The source Object.\n * @param {Object} config - The media source adapter configuration.\n * @returns {IMediaSourceAdapter} - New instance of the run time media source adapter.\n * @static\n */\n\n\n /**\n * Passing the getLogger function to the actual media source adapter.\n * @type {Function}\n * @static\n */\n\n }, {\n key: 'createAdapter',\n value: function createAdapter(videoElement, source, config) {\n return new this(videoElement, source, config);\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to media source adapter.\n * @param {Source} source - The source object.\n * @param {Object} config - The media source adapter configuration.\n */\n\n }]);\n\n function BaseMediaSourceAdapter(videoElement, source, config) {\n _classCallCheck(this, BaseMediaSourceAdapter);\n\n var _this = _possibleConstructorReturn(this, (BaseMediaSourceAdapter.__proto__ || Object.getPrototypeOf(BaseMediaSourceAdapter)).call(this));\n\n _this._videoElement = videoElement;\n _this._sourceObj = source;\n _this._config = config;\n return _this;\n }\n\n /**\n * Destroys the media source adapter.\n * @function destroy\n * @returns {void}\n */\n\n\n _createClass(BaseMediaSourceAdapter, [{\n key: 'destroy',\n value: function destroy() {\n this._sourceObj = null;\n this._config = null;\n }\n\n /**\n * Triggers the appropriate track changed event.\n * @param {Track} track - The selected track.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_onTrackChanged',\n value: function _onTrackChanged(track) {\n if (track instanceof _videoTrack2.default) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.VIDEO_TRACK_CHANGED, { selectedVideoTrack: track });\n } else if (track instanceof _audioTrack2.default) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.AUDIO_TRACK_CHANGED, { selectedAudioTrack: track });\n } else if (track instanceof _textTrack2.default) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.TEXT_TRACK_CHANGED, { selectedTextTrack: track });\n }\n }\n\n /**\n * Dispatch an adapter event forward.\n * @param {string} name - The name of the event.\n * @param {Object} payload - The event payload.\n * @returns {void}\n */\n\n }, {\n key: '_trigger',\n value: function _trigger(name, payload) {\n this.dispatchEvent(new _fakeEvent2.default(name, payload));\n }\n\n /** Must implemented methods by the derived media source adapter **/\n\n }, {\n key: 'load',\n value: function load() {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'load').getError();\n }\n }, {\n key: 'selectVideoTrack',\n value: function selectVideoTrack(videoTrack) {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'selectVideoTrack').getError();\n }\n }, {\n key: 'selectAudioTrack',\n value: function selectAudioTrack(audioTrack) {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'selectAudioTrack').getError();\n }\n }, {\n key: 'selectTextTrack',\n value: function selectTextTrack(textTrack) {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'selectTextTrack').getError();\n }\n }, {\n key: 'hideTextTrack',\n value: function hideTextTrack() {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'hideTextTrack').getError();\n }\n }, {\n key: 'enableAdaptiveBitrate',\n value: function enableAdaptiveBitrate() {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'enableAdaptiveBitrate').getError();\n }\n }, {\n key: 'src',\n get: function get() {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'get src').getError();\n }\n }], [{\n key: 'canPlayType',\n value: function canPlayType(mimeType) {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'static canPlayType').getError();\n }\n }]);\n\n return BaseMediaSourceAdapter;\n}(_fakeEventTarget2.default);\n\nBaseMediaSourceAdapter.CustomEvents = _events.CUSTOM_EVENTS;\nBaseMediaSourceAdapter.getLogger = _logger2.default.getLogger;\nexports.default = BaseMediaSourceAdapter;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.registerMediaSourceAdapter = undefined;\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 _nativeAdapter = __webpack_require__(20);\n\nvar _nativeAdapter2 = _interopRequireDefault(_nativeAdapter);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\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\n/**\n * Media source provider\n * @classdesc\n */\nvar MediaSourceProvider = function () {\n function MediaSourceProvider() {\n _classCallCheck(this, MediaSourceProvider);\n }\n\n _createClass(MediaSourceProvider, null, [{\n key: 'register',\n\n\n /**\n * Add a media source adapter to the registry.\n * @function register\n * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to register.\n * @static\n * @returns {void}\n */\n\n /**\n * The media source adapter registry.\n * @member {Array<IMediaSourceAdapter>} _mediaSourceAdapters\n * @static\n * @private\n */\n value: function register(mediaSourceAdapter) {\n if (mediaSourceAdapter) {\n if (!MediaSourceProvider._mediaSourceAdapters.includes(mediaSourceAdapter)) {\n MediaSourceProvider._logger.debug('Adapter <' + mediaSourceAdapter.id + '> has been registered successfully');\n MediaSourceProvider._mediaSourceAdapters.push(mediaSourceAdapter);\n } else {\n MediaSourceProvider._logger.debug('Adapter <' + mediaSourceAdapter.id + '> is already registered, do not register again');\n }\n }\n }\n\n /**\n * Remove a media source adapter from the registry.\n * @function unRegister\n * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to unRegister.\n * @static\n * @returns {void}\n */\n\n /**\n * The selected adapter for playback.\n * @type {null|IMediaSourceAdapter}\n * @static\n * @private\n */\n\n /**\n * The logger of the media source provider.\n * @member {any} _logger\n * @static\n * @private\n */\n\n }, {\n key: 'unRegister',\n value: function unRegister(mediaSourceAdapter) {\n var index = MediaSourceProvider._mediaSourceAdapters.indexOf(mediaSourceAdapter);\n if (index > -1) {\n MediaSourceProvider._logger.debug('Unregistered <' + mediaSourceAdapter.id + '> adapter');\n MediaSourceProvider._mediaSourceAdapters.splice(index, 1);\n }\n }\n\n /**\n * Checks if one of the registered media source adapters can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check.\n * @static\n * @returns {boolean} - If one of the adapters can play the specific mime type.\n */\n\n }, {\n key: 'canPlayType',\n value: function canPlayType(mimeType) {\n var mediaSourceAdapters = MediaSourceProvider._mediaSourceAdapters;\n for (var i = 0; i < mediaSourceAdapters.length; i++) {\n if (mediaSourceAdapters[i].canPlayType(mimeType)) {\n MediaSourceProvider._selectedAdapter = mediaSourceAdapters[i];\n MediaSourceProvider._logger.debug('Selected adapter is <' + MediaSourceProvider._selectedAdapter.id + '>');\n return true;\n }\n }\n return false;\n }\n\n /**\n * Get the appropriate media source adapter to the video source.\n * @function getMediaSourceAdapter\n * @param {HTMLVideoElement} videoElement - The video element which requires adapter for a given mimeType.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The player configuration.\n * @returns {IMediaSourceAdapter|null} - The selected media source adapter, or null if such doesn't exists.\n * @static\n */\n\n }, {\n key: 'getMediaSourceAdapter',\n value: function getMediaSourceAdapter(videoElement, source, config) {\n if (videoElement && source && config) {\n if (!MediaSourceProvider._selectedAdapter) {\n MediaSourceProvider.canPlayType(source.mimetype);\n }\n return MediaSourceProvider._selectedAdapter ? MediaSourceProvider._selectedAdapter.createAdapter(videoElement, source, config) : null;\n }\n return null;\n }\n\n /**\n * Destroys the media source adapter provider necessary props.\n * @static\n * @returns {void}\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n MediaSourceProvider._selectedAdapter = null;\n }\n }]);\n\n return MediaSourceProvider;\n}();\n\nMediaSourceProvider._logger = _logger2.default.getLogger('MediaSourceProvider');\nMediaSourceProvider._mediaSourceAdapters = [_nativeAdapter2.default];\nMediaSourceProvider._selectedAdapter = null;\nexports.default = MediaSourceProvider;\n\n\nvar registerMediaSourceAdapter = MediaSourceProvider.register;\nexports.registerMediaSourceAdapter = registerMediaSourceAdapter;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _player = __webpack_require__(8);\n\nvar _player2 = _interopRequireDefault(_player);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _util = __webpack_require__(11);\n\nvar _eventManager = __webpack_require__(6);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _playerError = __webpack_require__(10);\n\nvar _playerError2 = _interopRequireDefault(_playerError);\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\n/** The BasePlugin responsible to implement the plugin interface.\n * Contains several default implementations.\n * Other plugins should extend this class.\n * @classdesc\n */\nvar BasePlugin = function () {\n _createClass(BasePlugin, null, [{\n key: 'createPlugin',\n\n\n /**\n * Factory method to create the actual plugin.\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} config - The plugin configuration\n * @returns {BasePlugin} - New runtime plugin instance\n * @static\n * @public\n */\n\n /**\n * The event manager of the plugin.\n * @member\n */\n\n /**\n * The logger of the plugin.\n * @member\n */\n\n /**\n * The runtime configuration of the plugin.\n * @member\n */\n value: function createPlugin(name, player) {\n var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n return new this(name, player, config);\n }\n\n /**\n * Returns under what conditions the plugin is valid.\n * Plugin must implement this method.\n * @returns {boolean} - Whether the plugin is valid and can be initiated. Default implementation is true\n * @static\n * @public\n * @abstract\n */\n\n /**\n * The default configuration of the plugin.\n * Inherited plugins should override this property.\n * @type {Object}\n * @static\n * @member\n */\n\n /**\n * Reference to the actual player.\n * @member\n */\n\n /**\n * The name of the plugin.\n * @member\n */\n\n }, {\n key: 'isValid',\n value: function isValid() {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'isValid()').getError();\n }\n\n /**\n * constructor\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} config - The plugin configuration\n * @constructor\n * @private\n */\n\n }]);\n\n function BasePlugin(name, player, config) {\n _classCallCheck(this, BasePlugin);\n\n this.name = name;\n this.player = player;\n this.eventManager = new _eventManager2.default();\n this.logger = _logger2.default.getLogger(this.name);\n this.config = (0, _util.merge)([this.constructor.defaultConfig, config]);\n }\n\n /**\n * Getter for the configuration of the plugin.\n * @param {string} attr - The key in the plugin configuration (optional).\n * @returns {*} - If attribute is provided, returns its value. Else, Returns the config of the plugin.\n * @public\n */\n\n\n _createClass(BasePlugin, [{\n key: 'getConfig',\n value: function getConfig(attr) {\n if (attr) {\n return this.config[attr];\n }\n return this.config;\n }\n\n /**\n * Updates the config of the plugin.\n * @param {Object} update - The updated configuration.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'updateConfig',\n value: function updateConfig(update) {\n this.config = (0, _util.merge)([this.config, update]);\n }\n\n /**\n * Runs the destroy logic of the plugin.\n * plugin must implement this method.\n * @public\n * @abstract\n * @returns {void}\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_IMPLEMENTED_METHOD, 'destroy()').getError();\n }\n\n /**\n * Getter for the plugin's name.\n * @returns {string} - The name of the plugin.\n * @public\n */\n\n }, {\n key: 'getName',\n value: function getName() {\n return this.name;\n }\n }]);\n\n return BasePlugin;\n}();\n\nBasePlugin.defaultConfig = {};\nexports.default = BasePlugin;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.registerPlugin = undefined;\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 _basePlugin = __webpack_require__(14);\n\nvar _basePlugin2 = _interopRequireDefault(_basePlugin);\n\nvar _playerError = __webpack_require__(10);\n\nvar _playerError2 = _interopRequireDefault(_playerError);\n\nvar _player = __webpack_require__(8);\n\nvar _player2 = _interopRequireDefault(_player);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\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\n/**\n * The logger of the PluginManager class.\n * @private\n * @const\n */\nvar logger = _logger2.default.getLogger(\"PluginManager\");\n\n/** The PluginManager responsible for register plugins definitions and store plugins instances.\n * @classdesc\n */\n\nvar PluginManager = function () {\n function PluginManager() {\n _classCallCheck(this, PluginManager);\n\n this._plugins = new Map();\n }\n /**\n * The registry of the plugins.\n * Maps plugin's name to his class.\n * @type {Map}\n * @static\n * @private\n */\n\n /**\n * The active plugins in the player.\n * Maps plugin's name to his instance.\n * @type {Map}\n * @private\n */\n\n\n _createClass(PluginManager, [{\n key: 'load',\n\n\n /**\n * Creates and store new instance of the plugin in case isValid() of the plugin returns true.\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} [config={}] - The plugin configuration\n * @returns {boolean} - Whether the plugin load was successful\n * @public\n */\n value: function load(name, player) {\n var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n if (!PluginManager._registry.has(name)) {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_REGISTERED_PLUGIN, name).getError();\n }\n var pluginClass = PluginManager._registry.get(name);\n if (pluginClass != null && pluginClass.isValid()) {\n this._plugins.set(name, pluginClass.createPlugin(name, player, config));\n logger.debug('Plugin <' + name + '> has been loaded');\n return true;\n }\n logger.debug('Plugin <' + name + '> isn\\'t loaded, isValid()=false');\n return false;\n }\n\n /**\n * Iterates over all the plugins and calls private _destroy.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this._plugins.forEach(this._destroy.bind(this));\n }\n\n /**\n * Calls destroy() method of the plugin's impl.\n * @param {BasePlugin} plugin - The plugin instance\n * @param {string} name - The plugin name\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_destroy',\n value: function _destroy(plugin, name) {\n plugin.destroy();\n this._plugins.delete(name);\n }\n\n /**\n * Returns the plugin's instance.\n * @param {string} name - The plugin name\n * @returns {BasePlugin} - The plugin instance\n * @public\n */\n\n }, {\n key: 'get',\n value: function get(name) {\n return this._plugins.get(name);\n }\n }], [{\n key: 'register',\n\n\n /**\n * Writes the plugin in the registry.\n * Maps: plugin name -> plugin class.\n * @param {string} name - The plugin name\n * @param {Function} handler - The plugin class\n * @returns {boolean} - If the registration request succeeded\n * @static\n * @public\n */\n value: function register(name, handler) {\n if (typeof handler !== 'function' || handler.prototype instanceof _basePlugin2.default === false) {\n throw new _playerError2.default(_playerError2.default.TYPE.NOT_VALID_HANDLER).getError();\n }\n if (!PluginManager._registry.has(name)) {\n PluginManager._registry.set(name, handler);\n logger.debug('Plugin <' + name + '> has been registered successfully');\n return true;\n }\n logger.debug('Plugin <' + name + '> is already registered, do not register again');\n return false;\n }\n\n /**\n * Removes the plugin from the registry.\n * @param {string} name - The plugin name\n * @static\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'unRegister',\n value: function unRegister(name) {\n if (PluginManager._registry.has(name)) {\n PluginManager._registry.delete(name);\n logger.debug('Unregistered <' + name + '> plugin.');\n }\n }\n }]);\n\n return PluginManager;\n}();\n\n/**\n * Export the register method.\n * @type {function}\n * @constant\n */\n\n\nPluginManager._registry = new Map();\nexports.default = PluginManager;\nvar registerPlugin = PluginManager.register;\nexports.registerPlugin = registerPlugin;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar PLAYER_STATE_TYPES = {\n IDLE: \"idle\",\n LOADING: \"loading\",\n PLAYING: \"playing\",\n PAUSED: \"paused\",\n BUFFERING: \"buffering\"\n};\n\nexports.default = PLAYER_STATE_TYPES;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 * A simple multimap template.\n * @constructor\n * @struct\n * @template T\n */\nvar MultiMap = function () {\n function MultiMap() {\n _classCallCheck(this, MultiMap);\n\n /** @private {!Object.<string, !Array.<T>>} */\n this._map = new Map();\n }\n\n /**\n * Add a key, value pair to the map.\n * @param {string} key -\n * @param {T} value -\n * @returns {void}\n */\n\n\n _createClass(MultiMap, [{\n key: \"push\",\n value: function push(key, value) {\n if (this._map.has(key)) {\n var list = this._map.get(key);\n if (Array.isArray(list)) {\n list.push(value);\n this._map.set(key, list);\n }\n } else {\n this._map.set(key, [value]);\n }\n }\n\n /**\n * Set an array of values for the key, overwriting any previous data.\n * @param {string} key -\n * @param {!Array.<T>} values -\n * @returns {void}\n */\n\n }, {\n key: \"set\",\n value: function set(key, values) {\n this._map.set(key, values);\n }\n\n /**\n * Check for a key.\n * @param {string} key -\n * @return {boolean} true if the key exists.\n */\n\n }, {\n key: \"has\",\n value: function has(key) {\n return this._map.has(key);\n }\n\n /**\n * Get a list of values by key.\n * @param {string} key -\n * @return {Array.<T>} or null if no suZch key exists.\n */\n\n }, {\n key: \"get\",\n value: function get(key) {\n var list = this._map.get(key);\n // slice() clones the list so that it and the map can each be modified\n // without affecting the other.\n return list ? list.slice() : [];\n }\n\n /**\n * Get a list of all values.\n * @returns {!Array.<T>} -\n */\n\n }, {\n key: \"getAll\",\n value: function getAll() {\n var list = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = this._map.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var value = _step.value;\n\n list = list.concat(value);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return list;\n }\n\n /**\n * Remove a specific value, if it exists.\n * @param {string} key -\n * @param {T} value -\n * @returns {void}\n */\n\n }, {\n key: \"remove\",\n value: function remove(key, value) {\n if (!this._map.has(key)) return;\n var list = this._map.get(key);\n if (Array.isArray(list)) {\n for (var i = 0; i < list.length; ++i) {\n if (list[i] == value) {\n list.splice(i, 1);\n --i;\n }\n }\n }\n }\n\n /**\n * Get all keys from the multimap.\n * @return {!Array.<string>}\n */\n // eslint-disable-next-line no-undef\n\n }, {\n key: \"keys\",\n value: function keys() {\n return this._map.keys();\n }\n\n /**\n * Clear all keys and values from the multimap.\n * @returns {void}\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n this._map.clear();\n }\n }]);\n\n return MultiMap;\n}();\n\nexports.default = MultiMap;\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports) {\n\nmodule.exports = {\n\t\"name\": \"playkit-js\",\n\t\"version\": \"0.2.0\",\n\t\"main\": \"dist/playkit.js\",\n\t\"scripts\": {\n\t\t\"clean\": \"rm -rf ./dist\",\n\t\t\"prebuild\": \"npm run clean\",\n\t\t\"build:prod\": \"NODE_ENV=production webpack\",\n\t\t\"build\": \"webpack\",\n\t\t\"dev\": \"webpack --progress --colors --watch\",\n\t\t\"test\": \"NODE_ENV=test karma start --color\",\n\t\t\"test:chrome\": \"NODE_ENV=test karma start --color --browsers Chrome\",\n\t\t\"test:chrome:dots\": \"NODE_ENV=test karma start --color --browsers Chrome --reporters dots\",\n\t\t\"test:firefox\": \"NODE_ENV=test karma start --color --browsers Firefox\",\n\t\t\"test:safari\": \"NODE_ENV=test karma start --color --browsers Safari\",\n\t\t\"test:watch\": \"NODE_ENV=test karma start --color --auto-watch\",\n\t\t\"start\": \"webpack-dev-server\",\n\t\t\"release\": \"npm run build:prod && npm run commit:dist && standard-version\",\n\t\t\"publish\": \"git push --follow-tags --no-verify origin develop\",\n\t\t\"eslint\": \"eslint . --color\",\n\t\t\"flow\": \"flow check\",\n\t\t\"eslint:flow:test\": \"npm run eslint && npm run flow && npm run test\",\n\t\t\"commit:dist\": \"git add --all dist && (git commit -m 'chore: update dist' || exit 0)\",\n\t\t\"prepush-msg:build\": \"echo '\\nRunning build before push...\\n' && exit 0\",\n\t\t\"prepush-msg:dist\": \"echo '\\nAdding dist files to a seperate commit...\\n' && exit 0\",\n\t\t\"prepush-msg:done\": \"echo '\\nPre push tasks are done.\\n' && exit 0\"\n\t},\n\t\"pre-push\": [\n\t\t\"prepush-msg:build\",\n\t\t\"prebuild\",\n\t\t\"build\",\n\t\t\"build:prod\",\n\t\t\"prepush-msg:dist\",\n\t\t\"commit:dist\",\n\t\t\"prepush-msg:done\"\n\t],\n\t\"devDependencies\": {\n\t\t\"babel-cli\": \"^6.18.0\",\n\t\t\"babel-core\": \"^6.18.2\",\n\t\t\"babel-eslint\": \"^7.1.1\",\n\t\t\"babel-loader\": \"^6.2.7\",\n\t\t\"babel-plugin-istanbul\": \"^4.0.0\",\n\t\t\"babel-plugin-transform-class-properties\": \"^6.22.0\",\n\t\t\"babel-plugin-transform-flow-strip-types\": \"^6.22.0\",\n\t\t\"babel-preset-es2015\": \"^6.18.0\",\n\t\t\"babel-register\": \"^6.23.0\",\n\t\t\"chai\": \"^3.5.0\",\n\t\t\"cross-env\": \"^3.1.4\",\n\t\t\"eslint\": \"^3.10.0\",\n\t\t\"eslint-loader\": \"^1.6.1\",\n\t\t\"eslint-plugin-flowtype\": \"^2.30.0\",\n\t\t\"eslint-plugin-import\": \"^2.2.0\",\n\t\t\"eslint-plugin-mocha-no-only\": \"^0.0.5\",\n\t\t\"flow-bin\": \"latest\",\n\t\t\"istanbul\": \"^0.4.5\",\n\t\t\"karma\": \"^1.5.0\",\n\t\t\"karma-chai\": \"^0.1.0\",\n\t\t\"karma-chrome-launcher\": \"^2.0.0\",\n\t\t\"karma-cli\": \"^1.0.1\",\n\t\t\"karma-coverage\": \"^1.1.1\",\n\t\t\"karma-firefox-launcher\": \"^1.0.1\",\n\t\t\"karma-ie-launcher\": \"^1.0.0\",\n\t\t\"karma-mocha\": \"^1.3.0\",\n\t\t\"karma-safari-launcher\": \"^1.0.0\",\n\t\t\"karma-sourcemap-loader\": \"^0.3.7\",\n\t\t\"karma-webpack\": \"^2.0.2\",\n\t\t\"mocha\": \"^3.2.0\",\n\t\t\"mocha-cli\": \"^1.0.1\",\n\t\t\"pre-push\": \"^0.1.1\",\n\t\t\"sinon\": \"^2.0.0\",\n\t\t\"sinon-chai\": \"^2.8.0\",\n\t\t\"standard-version\": \"^4.0.0\",\n\t\t\"uglifyjs-webpack-plugin\": \"^0.4.3\",\n\t\t\"webpack\": \"latest\",\n\t\t\"webpack-dev-server\": \"latest\"\n\t},\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/kaltura/playkit-js\"\n\t},\n\t\"keywords\": [\n\t\t\"kaltura\",\n\t\t\"player\",\n\t\t\"html5 player\"\n\t],\n\t\"license\": \"AGPLV3\",\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/kaltura/playkit-js/issues\"\n\t},\n\t\"homepage\": \"https://github.com/kaltura/playkit-js\",\n\t\"dependencies\": {\n\t\t\"js-logger\": \"^1.3.0\"\n\t}\n};\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _fakeEventTarget = __webpack_require__(9);\n\nvar _fakeEventTarget2 = _interopRequireDefault(_fakeEventTarget);\n\nvar _fakeEvent = __webpack_require__(2);\n\nvar _fakeEvent2 = _interopRequireDefault(_fakeEvent);\n\nvar _eventManager = __webpack_require__(6);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _events = __webpack_require__(7);\n\nvar _mediaSourceProvider = __webpack_require__(13);\n\nvar _mediaSourceProvider2 = _interopRequireDefault(_mediaSourceProvider);\n\nvar _videoTrack = __webpack_require__(5);\n\nvar _videoTrack2 = _interopRequireDefault(_videoTrack);\n\nvar _audioTrack = __webpack_require__(3);\n\nvar _audioTrack2 = _interopRequireDefault(_audioTrack);\n\nvar _textTrack = __webpack_require__(4);\n\nvar _textTrack2 = _interopRequireDefault(_textTrack);\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\nvar Html5 = function (_FakeEventTarget) {\n _inherits(Html5, _FakeEventTarget);\n\n _createClass(Html5, null, [{\n key: 'createEngine',\n\n\n /**\n * Factory method to create an engine.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The player configuration.\n * @returns {IEngine} - New instance of the run time engine.\n * @public\n * @static\n */\n\n /**\n * The selected media source adapter of the engine.\n * @type {IMediaSourceAdapter}\n * @private\n */\n\n /**\n * The video element.\n * @type {HTMLVideoElement}\n * @private\n */\n value: function createEngine(source, config) {\n return new this(source, config);\n }\n\n /**\n * Checks if the engine can play a given mime type.\n * @param {string} mimeType - The mime type to check.\n * @returns {boolean} - Whether the engine can play the mime type.\n * @public\n * @static\n */\n\n\n /**\n * @type {string} - The engine id.\n */\n\n /**\n * The event manager of the engine.\n * @type {EventManager}\n * @private\n */\n\n }, {\n key: 'canPlayType',\n value: function canPlayType(mimeType) {\n return _mediaSourceProvider2.default.canPlayType(mimeType);\n }\n\n /**\n * @constructor\n * @param {Source} source - The selected source object.\n * @param {Object} config - The player configuration.\n */\n\n }]);\n\n function Html5(source, config) {\n _classCallCheck(this, Html5);\n\n var _this = _possibleConstructorReturn(this, (Html5.__proto__ || Object.getPrototypeOf(Html5)).call(this));\n\n _this._eventManager = new _eventManager2.default();\n _this._createVideoElement();\n _this._loadMediaSourceAdapter(source, config);\n _this.attach();\n return _this;\n }\n\n /**\n * Destroys the engine.\n * @public\n * @returns {void}\n */\n\n\n _createClass(Html5, [{\n key: 'destroy',\n value: function destroy() {\n this.detach();\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.destroy();\n _mediaSourceProvider2.default.destroy();\n }\n if (this._el) {\n this.pause();\n this._el.removeAttribute('src');\n if (this._el.parentNode) {\n this._el.parentNode.removeChild(this._el);\n }\n }\n this._eventManager.destroy();\n }\n\n /**\n * Listen to the video element events and triggers them from the engine.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'attach',\n value: function attach() {\n var _this2 = this;\n\n var _loop = function _loop(playerEvent) {\n _this2._eventManager.listen(_this2._el, _events.HTML5_EVENTS[playerEvent], function () {\n _this2.dispatchEvent(new _fakeEvent2.default(_events.HTML5_EVENTS[playerEvent]));\n });\n };\n\n for (var playerEvent in _events.HTML5_EVENTS) {\n _loop(playerEvent);\n }\n if (this._mediaSourceAdapter) {\n this._eventManager.listen(this._mediaSourceAdapter, _events.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED, function (event) {\n _this2.dispatchEvent(event);\n });\n this._eventManager.listen(this._mediaSourceAdapter, _events.CUSTOM_EVENTS.AUDIO_TRACK_CHANGED, function (event) {\n return _this2.dispatchEvent(event);\n });\n this._eventManager.listen(this._mediaSourceAdapter, _events.CUSTOM_EVENTS.TEXT_TRACK_CHANGED, function (event) {\n return _this2.dispatchEvent(event);\n });\n }\n }\n\n /**\n * Remove the listeners of the video element events.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'detach',\n value: function detach() {\n for (var playerEvent in _events.HTML5_EVENTS) {\n this._eventManager.unlisten(this._el, _events.HTML5_EVENTS[playerEvent]);\n }\n if (this._mediaSourceAdapter) {\n // unlisten to adaptive bitrate changed\n this._eventManager.unlisten(this._mediaSourceAdapter, _events.CUSTOM_EVENTS.VIDEO_TRACK_CHANGED);\n this._eventManager.unlisten(this._mediaSourceAdapter, _events.CUSTOM_EVENTS.AUDIO_TRACK_CHANGED);\n this._eventManager.unlisten(this._mediaSourceAdapter, _events.CUSTOM_EVENTS.TEXT_TRACK_CHANGED);\n }\n }\n\n /**\n * @returns {HTMLVideoElement} - The video element.\n * @public\n */\n\n }, {\n key: 'getVideoElement',\n value: function getVideoElement() {\n return this._el;\n }\n\n /**\n * Creates a video element dom object.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_createVideoElement',\n value: function _createVideoElement() {\n this._el = document.createElement(\"video\");\n //Set attributes\n this._el.style.width = \"640px\";\n this._el.style.height = \"360px\";\n this._el.style.backgroundColor = \"black\";\n this._el.controls = true;\n if (document && document.body) {\n document.body.appendChild(this._el);\n }\n }\n\n /**\n * Loads the appropriate media source extension adapter.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The media source extension configuration.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_loadMediaSourceAdapter',\n value: function _loadMediaSourceAdapter(source, config) {\n this._mediaSourceAdapter = _mediaSourceProvider2.default.getMediaSourceAdapter(this.getVideoElement(), source, config);\n }\n\n /**\n * Select a new video track.\n * @param {VideoTrack} videoTrack - The video track object to set.\n * @returns {void}\n */\n\n }, {\n key: 'selectVideoTrack',\n value: function selectVideoTrack(videoTrack) {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectVideoTrack(videoTrack);\n }\n }\n\n /**\n * Select a new audio track.\n * @param {AudioTrack} audioTrack - The video track object to set.\n * @returns {void}\n */\n\n }, {\n key: 'selectAudioTrack',\n value: function selectAudioTrack(audioTrack) {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectAudioTrack(audioTrack);\n }\n }\n\n /**\n * Select a new text track.\n * @param {TextTrack} textTrack - The text track object to set.\n * @returns {void}\n */\n\n }, {\n key: 'selectTextTrack',\n value: function selectTextTrack(textTrack) {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectTextTrack(textTrack);\n }\n }\n\n /**\n * Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'hideTextTrack',\n value: function hideTextTrack() {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.hideTextTrack();\n }\n }\n\n /**\n * Enables adaptive bitrate switching according to the media source extension logic.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'enableAdaptiveBitrate',\n value: function enableAdaptiveBitrate() {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.enableAdaptiveBitrate();\n }\n }\n\n /**\n * Set a source.\n * @param {string} source - Source to set.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'play',\n\n\n //playback interface\n /**\n * Start/resume playback.\n * @public\n * @returns {void}\n */\n value: function play() {\n return this._el.play();\n }\n\n /**\n * Pause playback.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'pause',\n value: function pause() {\n return this._el.pause();\n }\n\n /**\n * Load media.\n * @public\n * @returns {Promise<Object>} - The loaded data\n */\n\n }, {\n key: 'load',\n value: function load() {\n return this._mediaSourceAdapter ? this._mediaSourceAdapter.load() : Promise.resolve({});\n }\n\n /**\n * Get the current time in seconds.\n * @returns {Number} - The current playback time.\n * @public\n */\n\n }, {\n key: 'ready',\n value: function ready() {}\n\n /**\n * Get paused state.\n * @returns {boolean} - The paused value of the video element.\n * @public\n */\n\n }, {\n key: 'src',\n set: function set(source) {\n this._el.src = source;\n }\n\n /**\n * Get the source url.\n * @returns {string} - The source url.\n * @public\n */\n ,\n get: function get() {\n if (this._mediaSourceAdapter) {\n return this._mediaSourceAdapter.src;\n }\n return \"\";\n }\n }, {\n key: 'currentTime',\n get: function get() {\n return this._el.currentTime;\n }\n\n /**\n * Set the current time in seconds.\n * @param {Number} to - The number to set in seconds.\n * @public\n * @returns {void}\n */\n ,\n set: function set(to) {\n this._el.currentTime = to;\n }\n\n /**\n * Get the duration in seconds.\n * @returns {Number} - The playback duration.\n * @public\n */\n\n }, {\n key: 'duration',\n get: function get() {\n return this._el.duration;\n }\n\n /**\n * Set playback volume.\n * @param {Number} vol - The volume to set.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'volume',\n set: function set(vol) {\n this._el.volume = vol;\n }\n\n /**\n * Get playback volume.\n * @returns {Number} - The volume value of the video element.\n * @public\n */\n ,\n get: function get() {\n return this._el.volume;\n }\n }, {\n key: 'paused',\n get: function get() {\n return this._el.paused;\n }\n\n /**\n * Get seeking state.\n * @returns {boolean} - The seeking value of the video element.\n * @public\n */\n\n }, {\n key: 'seeking',\n get: function get() {\n return this._el.seeking;\n }\n\n /**\n * Get the first seekable range (part) of the video in seconds.\n * @returns {TimeRanges} - First seekable range (part) of the video in seconds.\n * @public\n */\n\n }, {\n key: 'seekable',\n get: function get() {\n return this._el.seekable;\n }\n\n /**\n * Get the first played range (part) of the video in seconds.\n * @returns {TimeRanges} - First played range (part) of the video in seconds.\n * @public\n */\n\n }, {\n key: 'played',\n get: function get() {\n return this._el.played;\n }\n\n /**\n * Get the first buffered range (part) of the video in seconds.\n * @returns {TimeRanges} - First buffered range (part) of the video in seconds.\n * @public\n */\n\n }, {\n key: 'buffered',\n get: function get() {\n return this._el.buffered;\n }\n\n /**\n * Set player muted state.\n * @param {boolean} mute - The new mute value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'muted',\n set: function set(mute) {\n this._el.muted = mute;\n }\n\n /**\n * Get player muted state.\n * @returns {boolean} - The muted value of the video element.\n * @public\n */\n ,\n get: function get() {\n return this._el.muted;\n }\n\n /**\n * Get the default mute value.\n * @returns {boolean} - The defaultMuted of the video element.\n * @public\n */\n\n }, {\n key: 'defaultMuted',\n get: function get() {\n return this._el.defaultMuted;\n }\n\n /**\n * Sets an image to be shown while the video is downloading, or until the user hits the play button.\n * @param {string} poster - The image url to be shown.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'poster',\n set: function set(poster) {\n this._el.poster = poster;\n }\n\n /**\n * Gets an image to be shown while the video is downloading, or until the user hits the play button.\n * @returns {poster} - The image url.\n * @public\n */\n ,\n get: function get() {\n return this._el.poster;\n }\n\n /**\n * Specifies if and how the author thinks that the video should be loaded when the page loads.\n * @param {string} preload - The preload value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'preload',\n set: function set(preload) {\n this._el.preload = preload;\n }\n\n /**\n * Gets the preload value of the video element.\n * @returns {string} - The preload value.\n * @public\n */\n ,\n get: function get() {\n return this._el.preload;\n }\n\n /**\n * Set if the video will automatically start playing as soon as it can do so without stopping.\n * @param {boolean} autoplay - The autoplay value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'autoplay',\n set: function set(autoplay) {\n this._el.autoplay = autoplay;\n }\n\n /**\n * Gets the autoplay value of the video element.\n * @returns {boolean} - The autoplay value.\n * @public\n */\n ,\n get: function get() {\n return this._el.autoplay;\n }\n\n /**\n * Set to specifies that the video will start over again, every time it is finished.\n * @param {boolean} loop - the loop value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'loop',\n set: function set(loop) {\n this._el.loop = loop;\n }\n\n /**\n * Gets the loop value of the video element.\n * @returns {boolean} - The loop value.\n * @public\n */\n ,\n get: function get() {\n return this._el.loop;\n }\n\n /**\n * Set to specifies that video controls should be displayed.\n * @param {boolean} controls - the controls value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'controls',\n set: function set(controls) {\n this._el.controls = controls;\n }\n\n /**\n * Gets the controls value of the video element.\n * @returns {boolean} - The controls value.\n * @public\n */\n ,\n get: function get() {\n return this._el.controls;\n }\n\n /**\n * Sets the current playback speed of the audio/video.\n * @param {Number} playbackRate - The playback speed value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'playbackRate',\n set: function set(playbackRate) {\n this._el.playbackRate = playbackRate;\n }\n\n /**\n * Gets the current playback speed of the audio/video.\n * @returns {Number} - The current playback speed value.\n * @public\n */\n ,\n get: function get() {\n return this._el.playbackRate;\n }\n\n /**\n * Sets the default playback speed of the audio/video.\n * @param {Number} defaultPlaybackRate - The default playback speed value.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'defaultPlaybackRate',\n set: function set(defaultPlaybackRate) {\n this._el.defaultPlaybackRate = defaultPlaybackRate;\n }\n\n /**\n * Gets the default playback speed of the audio/video.\n * @returns {Number} - The default playback speed value.\n * @public\n */\n ,\n get: function get() {\n return this._el.defaultPlaybackRate;\n }\n\n /**\n * The ended property returns whether the playback of the audio/video has ended.\n * @returns {boolean} - The ended value.\n * @public\n */\n\n }, {\n key: 'ended',\n get: function get() {\n return this._el.ended;\n }\n\n /**\n * The error property returns a MediaError object.\n * @returns {MediaError} - The MediaError object has a code property containing the error state of the audio/video.\n * @public\n */\n\n }, {\n key: 'error',\n get: function get() {\n return this._el.error;\n }\n\n /**\n * @returns {Number} - The current network state (activity) of the audio/video.\n * @public\n */\n\n }, {\n key: 'networkState',\n get: function get() {\n return this._el.networkState;\n }\n\n /**\n * Indicates if the audio/video is ready to play or not.\n * @returns {Number} - The current ready state of the audio/video.\n * 0 = HAVE_NOTHING - no information whether or not the audio/video is ready.\n * 1 = HAVE_METADATA - metadata for the audio/video is ready.\n * 2 = HAVE_CURRENT_DATA - data for the current playback position is available, but not enough data to play next frame/millisecond.\n * 3 = HAVE_FUTURE_DATA - data for the current and at least the next frame is available.\n * 4 = HAVE_ENOUGH_DATA - enough data available to start playing.\n */\n\n }, {\n key: 'readyState',\n get: function get() {\n return this._el.readyState;\n }\n\n /**\n * @returns {Number} - The height of the video player, in pixels.\n * @public\n */\n\n }, {\n key: 'videoHeight',\n get: function get() {\n return this._el.videoHeight;\n }\n\n /**\n * @returns {Number} - The width of the video player, in pixels.\n * @public\n */\n\n }, {\n key: 'videoWidth',\n get: function get() {\n return this._el.videoWidth;\n }\n\n /**\n * Test video element to check if html5 engine is supported.\n */\n\n }], [{\n key: 'isSupported',\n\n\n /**\n * Checks if the html5 engine is supported.\n * @returns {boolean} - The isSupported result.\n * @static\n * @public\n */\n value: function isSupported() {\n try {\n Html5.TEST_VID = document.createElement('video');\n Html5.TEST_VID.volume = 0.5;\n } catch (e) {\n return false;\n }\n return !!Html5.TEST_VID.canPlayType;\n }\n }]);\n\n return Html5;\n}(_fakeEventTarget2.default);\n\nHtml5.id = \"html5\";\nexports.default = Html5;\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _get = function get(object, property, receiver) { 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 { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\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 _eventManager = __webpack_require__(6);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _events = __webpack_require__(7);\n\nvar _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\n\nvar _videoTrack = __webpack_require__(5);\n\nvar _videoTrack2 = _interopRequireDefault(_videoTrack);\n\nvar _audioTrack = __webpack_require__(3);\n\nvar _audioTrack2 = _interopRequireDefault(_audioTrack);\n\nvar _textTrack = __webpack_require__(4);\n\nvar _textTrack2 = _interopRequireDefault(_textTrack);\n\nvar _baseMediaSourceAdapter = __webpack_require__(12);\n\nvar _baseMediaSourceAdapter2 = _interopRequireDefault(_baseMediaSourceAdapter);\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\n/**\n * An illustration of media source extension for progressive download\n * @classdesc\n * @implements {IMediaSourceAdapter}\n */\nvar NativeAdapter = function (_BaseMediaSourceAdapt) {\n _inherits(NativeAdapter, _BaseMediaSourceAdapt);\n\n _createClass(NativeAdapter, null, [{\n key: 'canPlayType',\n\n\n /**\n * Checks if NativeAdapter can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @returns {boolean} - Whether the native adapter can play a specific mime type\n * @static\n */\n\n /**\n * The event manager of the class.\n * @member {EventManager} - _eventManager\n * @type {EventManager}\n * @private\n */\n\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n\n /**\n * The id of the Adapter\n * @member {string} id\n * @static\n * @public\n */\n value: function canPlayType(mimeType) {\n var canPlayType = typeof mimeType === 'string' ? !!document.createElement(\"video\").canPlayType(mimeType.toLowerCase()) : false;\n NativeAdapter._logger.debug('canPlayType result for mimeType:' + mimeType + ' is ' + canPlayType.toString());\n return canPlayType;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to NativeAdapter\n * @param {Source} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n\n\n /**\n * The adapter logger\n * @member {any} _logger\n * @private\n * @static\n */\n\n }]);\n\n function NativeAdapter(videoElement, source, config) {\n _classCallCheck(this, NativeAdapter);\n\n NativeAdapter._logger.debug('Creating adapter');\n\n var _this = _possibleConstructorReturn(this, (NativeAdapter.__proto__ || Object.getPrototypeOf(NativeAdapter)).call(this, videoElement, source, config));\n\n _this._eventManager = new _eventManager2.default();\n return _this;\n }\n\n /**\n * Load the video source\n * @function load\n * @returns {Promise<Object>} - The loaded data\n */\n\n\n _createClass(NativeAdapter, [{\n key: 'load',\n value: function load() {\n var _this2 = this;\n\n if (!this._loadPromise) {\n this._loadPromise = new Promise(function (resolve, reject) {\n // We're using 'loadeddata' event for native hls (on 'loadedmetadata' native hls doesn't have tracks yet).\n _this2._eventManager.listen(_this2._videoElement, _events.HTML5_EVENTS.LOADED_DATA, function () {\n _this2._eventManager.unlisten(_this2._videoElement, _events.HTML5_EVENTS.LOADED_DATA);\n var data = { tracks: _this2._getParsedTracks() };\n NativeAdapter._logger.debug('The source has been loaded successfully');\n resolve(data);\n });\n _this2._eventManager.listen(_this2._videoElement, _events.HTML5_EVENTS.ERROR, function (error) {\n _this2._eventManager.unlisten(_this2._videoElement, _events.HTML5_EVENTS.ERROR);\n NativeAdapter._logger.error(error);\n reject(error);\n });\n if (_this2._sourceObj && _this2._sourceObj.url) {\n _this2._videoElement.src = _this2._sourceObj.url;\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroys the native adapter.\n * @function destroy\n * @returns {void}\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n NativeAdapter._logger.debug('destroy');\n _get(NativeAdapter.prototype.__proto__ || Object.getPrototypeOf(NativeAdapter.prototype), 'destroy', this).call(this);\n this._eventManager.destroy();\n this._loadPromise = null;\n }\n\n /**\n * Get the parsed tracks\n * @function _getParsedTracks\n * @returns {Array<Track>} - The parsed tracks\n * @private\n */\n\n }, {\n key: '_getParsedTracks',\n value: function _getParsedTracks() {\n var videoTracks = this._getParsedVideoTracks();\n var audioTracks = this._getParsedAudioTracks();\n var textTracks = this._getParsedTextTracks();\n return videoTracks.concat(audioTracks).concat(textTracks);\n }\n\n /**\n * Get the parsed video tracks\n * @function _getParsedVideoTracks\n * @returns {Array<Track>} - The parsed video tracks\n * @private\n */\n\n }, {\n key: '_getParsedVideoTracks',\n value: function _getParsedVideoTracks() {\n var videoTracks = this._videoElement.videoTracks;\n var parsedTracks = [];\n if (videoTracks) {\n for (var i = 0; i < videoTracks.length; i++) {\n var settings = {\n id: videoTracks[i].id,\n active: videoTracks[i].selected,\n label: videoTracks[i].label,\n language: videoTracks[i].language,\n index: i\n };\n parsedTracks.push(new _videoTrack2.default(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed audio tracks\n * @function _getParsedAudioTracks\n * @returns {Array<Track>} - The parsed audio tracks\n * @private\n */\n\n }, {\n key: '_getParsedAudioTracks',\n value: function _getParsedAudioTracks() {\n var audioTracks = this._videoElement.audioTracks;\n var parsedTracks = [];\n if (audioTracks) {\n for (var i = 0; i < audioTracks.length; i++) {\n var settings = {\n id: audioTracks[i].id,\n active: audioTracks[i].enabled,\n label: audioTracks[i].label,\n language: audioTracks[i].language,\n index: i\n };\n parsedTracks.push(new _audioTrack2.default(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed text tracks\n * @function _getParsedTextTracks\n * @returns {Array<Track>} - The parsed text tracks\n * @private\n */\n\n }, {\n key: '_getParsedTextTracks',\n value: function _getParsedTextTracks() {\n var textTracks = this._videoElement.textTracks;\n var parsedTracks = [];\n if (textTracks) {\n for (var i = 0; i < textTracks.length; i++) {\n var settings = {\n kind: textTracks[i].kind,\n active: textTracks[i].mode === 'showing',\n label: textTracks[i].label,\n language: textTracks[i].language,\n index: i\n };\n parsedTracks.push(new _textTrack2.default(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Select a video track\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectVideoTrack',\n value: function selectVideoTrack(videoTrack) {\n var videoTracks = this._videoElement.videoTracks;\n if (videoTrack instanceof _videoTrack2.default && videoTracks && videoTracks[videoTrack.index]) {\n this._disableVideoTracks();\n videoTracks[videoTrack.index].selected = true;\n this._onTrackChanged(videoTrack);\n }\n }\n\n /**\n * Select an audio track\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectAudioTrack',\n value: function selectAudioTrack(audioTrack) {\n var audioTracks = this._videoElement.audioTracks;\n if (audioTrack instanceof _audioTrack2.default && audioTracks && audioTracks[audioTrack.index]) {\n this._disableAudioTracks();\n audioTracks[audioTrack.index].enabled = true;\n this._onTrackChanged(audioTrack);\n }\n }\n\n /**\n * Select a text track\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectTextTrack',\n value: function selectTextTrack(textTrack) {\n var textTracks = this._videoElement.textTracks;\n if (textTrack instanceof _textTrack2.default && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions') && textTracks && textTracks[textTrack.index]) {\n this._disableTextTracks();\n textTracks[textTrack.index].mode = 'showing';\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'hideTextTrack',\n value: function hideTextTrack() {\n this._disableTextTracks();\n }\n\n /**\n * Enables adaptive bitrate\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'enableAdaptiveBitrate',\n value: function enableAdaptiveBitrate() {\n NativeAdapter._logger.debug('Enabling adaptive bitrate not supported');\n }\n\n /**\n * Disables all the existing video tracks.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_disableVideoTracks',\n value: function _disableVideoTracks() {\n var videoTracks = this._videoElement.videoTracks;\n if (videoTracks) {\n for (var i = 0; i < videoTracks.length; i++) {\n videoTracks[i].selected = false;\n }\n }\n }\n\n /**\n * Disables all the existing audio tracks.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_disableAudioTracks',\n value: function _disableAudioTracks() {\n var audioTracks = this._videoElement.audioTracks;\n if (audioTracks) {\n for (var i = 0; i < audioTracks.length; i++) {\n audioTracks[i].enabled = false;\n }\n }\n }\n\n /**\n * Disables all the existing text tracks.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_disableTextTracks',\n value: function _disableTextTracks() {\n var textTracks = this._videoElement.textTracks;\n if (textTracks) {\n for (var i = 0; i < textTracks.length; i++) {\n textTracks[i].mode = 'disabled';\n }\n }\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * @public\n * @returns {string} - The src url.\n */\n\n }, {\n key: 'src',\n get: function get() {\n return this._videoElement.src;\n }\n }]);\n\n return NativeAdapter;\n}(_baseMediaSourceAdapter2.default);\n\nNativeAdapter.id = 'NativeAdapter';\nNativeAdapter._logger = _baseMediaSourceAdapter2.default.getLogger(NativeAdapter.id);\nexports.default = NativeAdapter;\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.VERSION = exports.TextTrack = exports.AudioTrack = exports.VideoTrack = exports.Track = exports.BasePlugin = exports.registerPlugin = exports.BaseMediaSourceAdapter = exports.registerMediaSourceAdapter = undefined;\nexports.playkit = playkit;\n\nvar _player = __webpack_require__(8);\n\nvar _player2 = _interopRequireDefault(_player);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _package = __webpack_require__(18);\n\nvar packageData = _interopRequireWildcard(_package);\n\nvar _baseMediaSourceAdapter = __webpack_require__(12);\n\nvar _baseMediaSourceAdapter2 = _interopRequireDefault(_baseMediaSourceAdapter);\n\nvar _mediaSourceProvider = __webpack_require__(13);\n\nvar _pluginManager = __webpack_require__(15);\n\nvar _basePlugin = __webpack_require__(14);\n\nvar _basePlugin2 = _interopRequireDefault(_basePlugin);\n\nvar _track = __webpack_require__(0);\n\nvar _track2 = _interopRequireDefault(_track);\n\nvar _videoTrack = __webpack_require__(5);\n\nvar _videoTrack2 = _interopRequireDefault(_videoTrack);\n\nvar _audioTrack = __webpack_require__(3);\n\nvar _audioTrack2 = _interopRequireDefault(_audioTrack);\n\nvar _textTrack = __webpack_require__(4);\n\nvar _textTrack2 = _interopRequireDefault(_textTrack);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Playkit version\nvar VERSION = packageData.version;\n\n\n_logger2.default.getLogger().log(\"%c Playkit \" + VERSION, \"color: yellow; font-size: large\");\n_logger2.default.getLogger().log(\"%c For more details see https://github.com/kaltura/playkit-js\", \"color: yellow;\");\n\n/**\n * @param {Object} config - The configuration of the player\n * @returns {Player} - The player instance\n */\nfunction playkit() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n return new _player2.default(config);\n}\n\n// Export the media source adapters necessary utils\nexports.registerMediaSourceAdapter = _mediaSourceProvider.registerMediaSourceAdapter;\nexports.BaseMediaSourceAdapter = _baseMediaSourceAdapter2.default;\n\n// Export the plugin framework\n\nexports.registerPlugin = _pluginManager.registerPlugin;\nexports.BasePlugin = _basePlugin2.default;\n\n// Export the tracks classes\n\nexports.Track = _track2.default;\nexports.VideoTrack = _videoTrack2.default;\nexports.AudioTrack = _audioTrack2.default;\nexports.TextTrack = _textTrack2.default;\n\n//export version\n\nexports.VERSION = VERSION;\nexports.default = playkit;\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _player = __webpack_require__(8);\n\nvar _player2 = _interopRequireDefault(_player);\n\nvar _eventManager = __webpack_require__(6);\n\nvar _eventManager2 = _interopRequireDefault(_eventManager);\n\nvar _state = __webpack_require__(23);\n\nvar _state2 = _interopRequireDefault(_state);\n\nvar _stateTypes = __webpack_require__(16);\n\nvar _stateTypes2 = _interopRequireDefault(_stateTypes);\n\nvar _events = __webpack_require__(7);\n\nvar _fakeEvent = __webpack_require__(2);\n\nvar _fakeEvent2 = _interopRequireDefault(_fakeEvent);\n\nvar _logger = __webpack_require__(1);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * This class responsible to manage all the state machine of the player.\n * @classdesc\n */\n\n\n/**\n * Define a transition object.\n */\nvar StateManager = function () {\n\n /**\n * @constructor\n * @param {Player} player - Reference to the player.\n */\n\n /**\n * Holds the state history of the player.\n * @member\n * @type {Array<State>}\n * @private\n */\n\n /**\n * Holds the current state of the player.\n * @member\n * @type {State}\n * @private\n */\n\n /**\n * Reference to the actual player.\n * @member\n * @type {Player}\n * @private\n */\n function StateManager(player) {\n var _this = this,\n _PlayerStates$IDLE,\n _PlayerStates$LOADING,\n _PlayerStates$PAUSED,\n _PlayerStates$PLAYING,\n _PlayerStates$BUFFERI,\n _transitions;\n\n _classCallCheck(this, StateManager);\n\n this._transitions = (_transitions = {}, _defineProperty(_transitions, _stateTypes2.default.IDLE, (_PlayerStates$IDLE = {}, _defineProperty(_PlayerStates$IDLE, _events.HTML5_EVENTS.LOAD_START, function () {\n _this._updateState(_stateTypes2.default.LOADING);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$IDLE, _events.HTML5_EVENTS.PLAY, function () {\n _this._updateState(_stateTypes2.default.BUFFERING);\n _this._dispatchEvent();\n }), _PlayerStates$IDLE)), _defineProperty(_transitions, _stateTypes2.default.LOADING, (_PlayerStates$LOADING = {}, _defineProperty(_PlayerStates$LOADING, _events.HTML5_EVENTS.LOADED_METADATA, function () {\n if (_this._player.config.autoPlay) {\n _this._updateState(_stateTypes2.default.PLAYING);\n } else {\n _this._updateState(_stateTypes2.default.PAUSED);\n }\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$LOADING, _events.HTML5_EVENTS.ERROR, function () {\n _this._updateState(_stateTypes2.default.IDLE);\n _this._dispatchEvent();\n }), _PlayerStates$LOADING)), _defineProperty(_transitions, _stateTypes2.default.PAUSED, (_PlayerStates$PAUSED = {}, _defineProperty(_PlayerStates$PAUSED, _events.HTML5_EVENTS.PLAY, function () {\n _this._updateState(_stateTypes2.default.PLAYING);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$PAUSED, _events.HTML5_EVENTS.PLAYING, function () {\n _this._updateState(_stateTypes2.default.PLAYING);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$PAUSED, _events.HTML5_EVENTS.ENDED, function () {\n _this._updateState(_stateTypes2.default.IDLE);\n _this._dispatchEvent();\n }), _PlayerStates$PAUSED)), _defineProperty(_transitions, _stateTypes2.default.PLAYING, (_PlayerStates$PLAYING = {}, _defineProperty(_PlayerStates$PLAYING, _events.HTML5_EVENTS.PAUSE, function () {\n _this._updateState(_stateTypes2.default.PAUSED);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$PLAYING, _events.HTML5_EVENTS.WAITING, function () {\n _this._updateState(_stateTypes2.default.BUFFERING);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$PLAYING, _events.HTML5_EVENTS.ENDED, function () {\n _this._updateState(_stateTypes2.default.IDLE);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$PLAYING, _events.HTML5_EVENTS.ERROR, function () {\n _this._updateState(_stateTypes2.default.IDLE);\n _this._dispatchEvent();\n }), _PlayerStates$PLAYING)), _defineProperty(_transitions, _stateTypes2.default.BUFFERING, (_PlayerStates$BUFFERI = {}, _defineProperty(_PlayerStates$BUFFERI, _events.HTML5_EVENTS.PLAYING, function () {\n _this._updateState(_stateTypes2.default.PLAYING);\n _this._dispatchEvent();\n }), _defineProperty(_PlayerStates$BUFFERI, _events.HTML5_EVENTS.PAUSE, function () {\n _this._updateState(_stateTypes2.default.PAUSED);\n _this._dispatchEvent();\n }), _PlayerStates$BUFFERI)), _transitions);\n\n this._player = player;\n this._logger = _logger2.default.getLogger(\"StateManager\");\n this._eventManager = new _eventManager2.default();\n this._history = [];\n this._prevState = null;\n this._curState = new _state2.default(_stateTypes2.default.IDLE);\n this._attachListeners();\n }\n\n /**\n * Register to all necessary events which impacts on the player state.\n * @private\n * @returns {void}\n */\n\n /**\n * The possible transitions from one state to another.\n * @type {Array<Transition>}\n * @private\n */\n\n /**\n * Holds the previous state of the player.\n * @member\n * @type {State | null}\n * @private\n */\n\n /**\n * The event manager of the class.\n * @member\n * @type {EventManager}\n * @private\n */\n\n /**\n * The logger of the class.\n * @member\n * @type {any}\n * @private\n */\n\n\n _createClass(StateManager, [{\n key: '_attachListeners',\n value: function _attachListeners() {\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.ERROR, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.ENDED, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.PLAY, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.LOAD_START, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.PLAYING, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.LOADED_METADATA, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.PAUSE, this._doTransition.bind(this));\n this._eventManager.listen(this._player, _events.HTML5_EVENTS.WAITING, this._doTransition.bind(this));\n }\n\n /**\n * Performs a state transition depends on the event which occurs in the player system.\n * @param {FakeEvent} event - The event occurs in the player system.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_doTransition',\n value: function _doTransition(event) {\n this._logger.debug('Do transition request', event);\n var transition = this._transitions[this._curState.type];\n if (typeof transition[event.type] === 'function') {\n transition[event.type]();\n }\n }\n\n /**\n * Updates the player's state.\n * @param {string} type - The type of the new state.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_updateState',\n value: function _updateState(type) {\n if (this._curState.type !== type) {\n this._curState.duration = Date.now() / 1000;\n this._history.push(this._curState);\n this._prevState = this._curState;\n this._curState = new _state2.default(type);\n this._logger.debug('Switch player state: from ' + this._prevState.type + ' to ' + this._curState.type);\n }\n }\n\n /**\n * Fires the playerStateChanged event after state has been changed.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_dispatchEvent',\n value: function _dispatchEvent() {\n var event = new _fakeEvent2.default(_events.CUSTOM_EVENTS.PLAYER_STATE_CHANGED, {\n 'oldState': this._prevState,\n 'newState': this._curState\n });\n this._player.dispatchEvent(event);\n }\n\n /**\n * Destroys the state manager.\n * @public\n * @returns {void}\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this._history = [];\n this._eventManager.destroy();\n }\n\n /**\n * Getter to the current state of the player.\n * @public\n * @returns {State} - The current state object\n */\n\n }, {\n key: 'currentState',\n get: function get() {\n return this._curState;\n }\n\n /**\n * Getter to the previous state of the player.\n * @public\n * @returns {State|null} - The previous state object, or null if such doesn't exists\n */\n\n }, {\n key: 'previousState',\n get: function get() {\n return this._prevState;\n }\n\n /**\n * Getter to the state history of the player.\n * @public\n * @returns {Array.<State>} - The full states history objects\n */\n\n }, {\n key: 'history',\n get: function get() {\n return this._history;\n }\n }]);\n\n return StateManager;\n}();\n\nexports.default = StateManager;\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 * This class describes a player state.\n * @classdesc\n */\nvar State = function () {\n\n /**\n * @constructor\n * @param {string} type - The type of the state.\n */\n\n /**\n * The duration that the player was in this state.\n * @member\n * @type {number}\n * @private\n */\n function State(type) {\n _classCallCheck(this, State);\n\n this.type = type;\n this._duration = 0;\n this._timestamp = Date.now() / 1000;\n }\n\n /**\n * Getter for the duration of the state.\n * @returns {number} - The duration of the state\n */\n\n /**\n * The timestamp that this state started.\n * @member\n * @type {number}\n * @private\n */\n\n /**\n * The type of the state.\n * Can be one of those describes in states.js\n * @member\n * @type {string}\n * @public\n */\n\n\n _createClass(State, [{\n key: \"duration\",\n get: function get() {\n return this._duration;\n }\n\n /**\n * Setter for the duration of the state.\n * @param {number} endTime - The timestamp of the next state.\n */\n ,\n set: function set(endTime) {\n this._duration = endTime - this._timestamp;\n }\n }]);\n\n return State;\n}();\n\nexports.default = State;\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar TRACK_TYPES = {\n VIDEO: \"video\",\n AUDIO: \"audio\",\n TEXT: \"text\"\n};\n\nexports.default = TRACK_TYPES;\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (true) {\r\n\t\t!(__WEBPACK_AMD_DEFINE_FACTORY__ = (Logger),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports) {\n\nmodule.exports = {\n\t\"playback\": {\n\t\t\"preload\": \"none\",\n\t\t\"autoplay\": false,\n\t\t\"muted\": false,\n\t\t\"streamPriority\": [\n\t\t\t{\n\t\t\t\t\"engine\": \"html5\",\n\t\t\t\t\"format\": \"hls\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"engine\": \"html5\",\n\t\t\t\t\"format\": \"dash\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"engine\": \"html5\",\n\t\t\t\t\"format\": \"progressive\"\n\t\t\t}\n\t\t]\n\t},\n\t\"plugins\": {}\n};\n\n/***/ })\n/******/ ]);\n});\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\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[\"PlaykitJsProviders\"] = factory();\n\telse\n\t\troot[\"PlaykitJsProviders\"] = 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/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\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.l = 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// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 25);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 && obj !== Symbol.prototype ? \"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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Request builder\n * @classdesc\n */\nvar RequestBuilder = function () {\n\n /**\n * @constructor\n * @param {Map<string, string>} headers The request headers\n */\n\n /**\n * @member - Service method (POST,GET,DELETE etc..)\n * @type {string}\n */\n\n /**\n * @member - Service headers\n * @type {Map<string, string>}\n */\n\n /**\n * @member - Service action\n * @type {string}\n */\n function RequestBuilder() {\n var headers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Map();\n\n _classCallCheck(this, RequestBuilder);\n\n this.headers = headers;\n this.headers.set(\"Content-Type\", \"application/json\");\n }\n\n /**\n * Builds restful service URL\n * @function getUrl\n * @returns {string} The service URL\n */\n\n /**\n * @member - Service tag\n * @type {string}\n */\n\n /**\n * @member - Service base url\n * @type {Map<string, string>}\n */\n\n /**\n * @member - Service params\n * @type {any}\n */\n\n\n /**\n * @member - Service name\n * @type {string}\n */\n\n\n _createClass(RequestBuilder, [{\n key: \"getUrl\",\n value: function getUrl() {\n if (!this.baseUrl) {\n throw new Error(\"baseUrl is mandatory for request builder\");\n }\n var url = this.baseUrl + '/service/' + this.service + (this.action ? '/action/' + this.action : '');\n return url;\n }\n\n /**\n * Executes service\n * @function doHttpRequest\n * @returns {Promise.<any>} Service response as promise\n */\n\n }, {\n key: \"doHttpRequest\",\n value: function doHttpRequest() {\n var _this = this;\n\n var request = new XMLHttpRequest();\n return new Promise(function (resolve, reject) {\n request.onreadystatechange = function () {\n if (request.readyState === 4) {\n if (request.status === 200) {\n var jsonResponse = JSON.parse(request.responseText);\n if (jsonResponse && (typeof jsonResponse === \"undefined\" ? \"undefined\" : _typeof(jsonResponse)) === 'object' && jsonResponse.code && jsonResponse.message) reject(jsonResponse);else resolve(jsonResponse);\n } else {\n reject(request.responseText);\n }\n }\n };\n request.open(_this.method, _this.getUrl());\n _this.headers.forEach(function (value, key) {\n request.setRequestHeader(key, value);\n });\n request.send(_this.params);\n });\n }\n }]);\n\n return RequestBuilder;\n}();\n\nexports.default = RequestBuilder;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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\nvar defaultConfig = {\n beUrl: \"http://www.kaltura.com/api_v3\",\n baseUrl: \"https://cdnapisec.kaltura.com\",\n serviceParams: {\n clientTag: \"playkit-js\",\n apiVersion: '3.3.0',\n format: 1\n }\n};\n\nvar Configuration = function () {\n function Configuration() {\n _classCallCheck(this, Configuration);\n }\n\n _createClass(Configuration, null, [{\n key: \"set\",\n value: function set(clientConfig) {\n if (clientConfig) {\n Object.assign(defaultConfig, clientConfig);\n }\n }\n }, {\n key: \"get\",\n value: function get() {\n return defaultConfig;\n }\n }]);\n\n return Configuration;\n}();\n\nexports.default = Configuration;\nexports.Configuration = Configuration;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.UIConfCreationMode = exports.UIConfType = exports.MediaEntryType = exports.MediaType = exports.EntryType = exports.EntryModerationStatus = exports.EntryStatus = exports.MetadataStatus = exports.MetadataObjectType = exports.Status = exports.KalturaRuleActionType = exports.Scheme = undefined;\n\nvar _enumify = __webpack_require__(18);\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\nvar Scheme = exports.Scheme = function (_Enum) {\n _inherits(Scheme, _Enum);\n\n function Scheme() {\n _classCallCheck(this, Scheme);\n\n return _possibleConstructorReturn(this, (Scheme.__proto__ || Object.getPrototypeOf(Scheme)).apply(this, arguments));\n }\n\n return Scheme;\n}(_enumify.Enum);\n\nScheme.initEnum({\n PLAYREADY_CENC: \"drm.PLAYREADY_CENC\",\n WIDEVINE_CENC: \"drm.WIDEVINE_CENC\",\n FAIRPLAY: \"fairplay.FAIRPLAY\",\n PLAYREADY: \"playReady.PLAYREADY\",\n WIDEVINE: \"widevine.WIDEVINE\"\n});\n\nvar KalturaRuleActionType = exports.KalturaRuleActionType = function (_Enum2) {\n _inherits(KalturaRuleActionType, _Enum2);\n\n function KalturaRuleActionType() {\n _classCallCheck(this, KalturaRuleActionType);\n\n return _possibleConstructorReturn(this, (KalturaRuleActionType.__proto__ || Object.getPrototypeOf(KalturaRuleActionType)).apply(this, arguments));\n }\n\n return KalturaRuleActionType;\n}(_enumify.Enum);\n\nKalturaRuleActionType.initEnum({\n DRM_POLICY: \"drm.DRM_POLICY\",\n BLOCK: 1,\n PREVIEW: 2,\n LIMIT_FLAVORS: 3,\n ADD_TO_STORAGE: 4,\n LIMIT_DELIVERY_PROFILES: 5,\n SERVE_FROM_REMOTE_SERVER: 6,\n REQUEST_HOST_REGEX: 7,\n LIMIT_THUMBNAIL_CAPTURE: 8\n});\n\nvar Status = exports.Status = function (_Enum3) {\n _inherits(Status, _Enum3);\n\n function Status() {\n _classCallCheck(this, Status);\n\n return _possibleConstructorReturn(this, (Status.__proto__ || Object.getPrototypeOf(Status)).apply(this, arguments));\n }\n\n return Status;\n}(_enumify.Enum);\n\nStatus.initEnum({\n ERROR: -1,\n QUEUED: 0,\n CONVERTING: 1,\n READY: 2,\n DELETED: 3,\n NOT_APPLICABLE: 4,\n TEMP: 5,\n WAIT_FOR_CONVERT: 6,\n IMPORTING: 7,\n VALIDATING: 8,\n EXPORTING: 9\n});\n\nvar MetadataObjectType = exports.MetadataObjectType = function (_Enum4) {\n _inherits(MetadataObjectType, _Enum4);\n\n function MetadataObjectType() {\n _classCallCheck(this, MetadataObjectType);\n\n return _possibleConstructorReturn(this, (MetadataObjectType.__proto__ || Object.getPrototypeOf(MetadataObjectType)).apply(this, arguments));\n }\n\n return MetadataObjectType;\n}(_enumify.Enum);\n\nMetadataObjectType.initEnum({\n AD_CUE_POINT: \"adCuePointMetadata.AdCuePoint\",\n ANNOTATION: \"annotationMetadata.Annotation\",\n CODE_CUE_POINT: \"codeCuePointMetadata.CodeCuePoint\",\n THUMB_CUE_POINT: \"thumbCuePointMetadata.thumbCuePoint\",\n ENTRY: 1,\n CATEGORY: 2,\n USER: 3,\n PARTNER: 4,\n DYNAMIC_OBJECT: 5\n});\n\nvar MetadataStatus = exports.MetadataStatus = function (_Enum5) {\n _inherits(MetadataStatus, _Enum5);\n\n function MetadataStatus() {\n _classCallCheck(this, MetadataStatus);\n\n return _possibleConstructorReturn(this, (MetadataStatus.__proto__ || Object.getPrototypeOf(MetadataStatus)).apply(this, arguments));\n }\n\n return MetadataStatus;\n}(_enumify.Enum);\n\nMetadataStatus.initEnum({\n VALID: 1,\n INVALID: 2,\n DELETED: 3\n});\n\nvar EntryStatus = exports.EntryStatus = function (_Enum6) {\n _inherits(EntryStatus, _Enum6);\n\n function EntryStatus() {\n _classCallCheck(this, EntryStatus);\n\n return _possibleConstructorReturn(this, (EntryStatus.__proto__ || Object.getPrototypeOf(EntryStatus)).apply(this, arguments));\n }\n\n return EntryStatus;\n}(_enumify.Enum);\n\nEntryStatus.initEnum({\n ERROR_IMPORTING: -2,\n ERROR_CONVERTING: -1,\n SCAN_FAILURE: \"virusScan.ScanFailure\",\n IMPORT: 0,\n INFECTED: \"virusScan.Infected\",\n PRECONVERT: 1,\n READY: 2,\n DELETED: 3,\n PENDING: 4,\n MODERATE: 5,\n BLOCKED: 6,\n NO_CONTENT: 7\n});\n\nvar EntryModerationStatus = exports.EntryModerationStatus = function (_Enum7) {\n _inherits(EntryModerationStatus, _Enum7);\n\n function EntryModerationStatus() {\n _classCallCheck(this, EntryModerationStatus);\n\n return _possibleConstructorReturn(this, (EntryModerationStatus.__proto__ || Object.getPrototypeOf(EntryModerationStatus)).apply(this, arguments));\n }\n\n return EntryModerationStatus;\n}(_enumify.Enum);\n\nEntryModerationStatus.initEnum({\n PENDING_MODERATION: 1,\n APPROVED: 2,\n REJECTED: 3,\n FLAGGED_FOR_REVIEW: 4,\n MODERATE: 5,\n AUTO_APPROVED: 6\n});\n\nvar EntryType = exports.EntryType = function (_Enum8) {\n _inherits(EntryType, _Enum8);\n\n function EntryType() {\n _classCallCheck(this, EntryType);\n\n return _possibleConstructorReturn(this, (EntryType.__proto__ || Object.getPrototypeOf(EntryType)).apply(this, arguments));\n }\n\n return EntryType;\n}(_enumify.Enum);\n\nEntryType.initEnum({\n AUTOMATIC: { value: -1 },\n EXTERNAL_MEDIA: { value: \"externalMedia.externalMedia\" },\n MEDIA_CLIP: { value: 1 },\n MIX: { value: 2 },\n PLAYLIST: { value: 5 },\n DATA: { value: 6 },\n LIVE_STREAM: { value: 7 },\n LIVE_CHANNEL: { value: 8 },\n DOCUMENT: { value: 10 }\n});\n\nvar MediaType = exports.MediaType = function (_Enum9) {\n _inherits(MediaType, _Enum9);\n\n function MediaType() {\n _classCallCheck(this, MediaType);\n\n return _possibleConstructorReturn(this, (MediaType.__proto__ || Object.getPrototypeOf(MediaType)).apply(this, arguments));\n }\n\n return MediaType;\n}(_enumify.Enum);\n\nMediaType.initEnum({\n VIDEO: { value: 1 },\n IMAGE: { value: 2 },\n AUDIO: { value: 5 },\n LIVE_STREAM_FLASH: { value: 201 },\n LIVE_STREAM_WINDOWS_MEDIA: { value: 202 },\n LIVE_STREAM_REAL_MEDIA: { value: 203 },\n LIVE_STREAM_QUICKTIME: { value: 204 }\n});\n\nvar MediaEntryType = exports.MediaEntryType = function (_Enum10) {\n _inherits(MediaEntryType, _Enum10);\n\n function MediaEntryType() {\n _classCallCheck(this, MediaEntryType);\n\n return _possibleConstructorReturn(this, (MediaEntryType.__proto__ || Object.getPrototypeOf(MediaEntryType)).apply(this, arguments));\n }\n\n return MediaEntryType;\n}(_enumify.Enum);\n\nMediaEntryType.initEnum(['Vod', 'Live', 'Image', 'Audio', 'Unknown']);\n\nvar UIConfType = exports.UIConfType = function (_Enum11) {\n _inherits(UIConfType, _Enum11);\n\n function UIConfType() {\n _classCallCheck(this, UIConfType);\n\n return _possibleConstructorReturn(this, (UIConfType.__proto__ || Object.getPrototypeOf(UIConfType)).apply(this, arguments));\n }\n\n return UIConfType;\n}(_enumify.Enum);\n\nUIConfType.initEnum({\n PLAYER: 1,\n CONTRIBUTION_WIZARD: 2,\n SIMPLE_EDITOR: 3,\n ADVANCED_EDITOR: 4,\n PLAYLIST: 5,\n APP_STUDIO: 6,\n KRECORD: 7,\n PLAYER_V3: 8,\n KMC_ACCOUNT: 9,\n KMC_ANALYTICS: 10,\n KMC_CONTENT: 11,\n KMC_DASHBOARD: 12,\n KMC_LOGIN: 13,\n PLAYER_SL: 14,\n CLIENTSIDE_ENCODER: 15,\n KMC_GENERAL: 16,\n KMC_ROLES_AND_PERMISSIONS: 17,\n CLIPPER: 18,\n KSR: 19,\n KUPLOAD: 20,\n WEBCASTING: 21\n});\n\nvar UIConfCreationMode = exports.UIConfCreationMode = function (_Enum12) {\n _inherits(UIConfCreationMode, _Enum12);\n\n function UIConfCreationMode() {\n _classCallCheck(this, UIConfCreationMode);\n\n return _possibleConstructorReturn(this, (UIConfCreationMode.__proto__ || Object.getPrototypeOf(UIConfCreationMode)).apply(this, arguments));\n }\n\n return UIConfCreationMode;\n}(_enumify.Enum);\n\nUIConfCreationMode.initEnum({\n WIZARD: 2,\n ADVANCED: 3\n});\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _multiRequestBuilder = __webpack_require__(6);\n\nvar _multiRequestBuilder2 = _interopRequireDefault(_multiRequestBuilder);\n\nvar _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\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 config = _config2.default.get();\nvar SERVICE_NAME = \"multirequest\";\n\n/**\n * Base for all ovp services\n * @classdesc\n */\n\nvar OvpService = function () {\n function OvpService() {\n _classCallCheck(this, OvpService);\n }\n\n _createClass(OvpService, null, [{\n key: 'getMultirequest',\n\n /**\n * Gets a new instance of MultiRequestBuilder with ovp params\n * @function getMultirequest\n * @param {string} ks The ks\n * @param {string} partnerId The partner ID\n * @returns {MultiRequestBuilder} The multi request builder\n * @static\n */\n value: function getMultirequest(ks, partnerId) {\n var ovpParams = config.serviceParams;\n Object.assign(ovpParams, { ks: ks });\n if (partnerId) {\n Object.assign(ovpParams, { partnerId: partnerId });\n }\n var multiReq = new _multiRequestBuilder2.default();\n multiReq.method = \"POST\";\n multiReq.service = SERVICE_NAME;\n multiReq.baseUrl = config.beUrl;\n multiReq.params = ovpParams;\n return multiReq;\n }\n }]);\n\n return OvpService;\n}();\n\nexports.default = OvpService;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Base service result\n * @classdesc\n */\nvar ServiceResult =\n\n/**\n * @constructor\n * @param {Object} response - Service response\n */\n\n/**\n * @member - The service error\n * @type {ServiceError}\n */\n\n/**\n * @member - The service result data\n * @type {Object}\n */\nfunction ServiceResult(response) {\n _classCallCheck(this, ServiceResult);\n\n this.hasError = false;\n\n if (response.objectType === \"KalturaAPIException\") {\n this.hasError = true;\n this.error = new ServiceError(response.code, response.message);\n } else {\n this.data = response;\n }\n}\n\n/**\n * @member - Is service returned an error\n * @type {boolean}\n */\n;\n\n/**\n * Service error\n * @classdesc\n */\n\n\nexports.default = ServiceResult;\n\nvar ServiceError =\n\n/**\n * @constructor\n * @param {string} code - The result code\n * @param {string} message - The result message\n */\n\n/**\n * @member - The error code\n * @type {string}\n */\nfunction ServiceError(code, message) {\n _classCallCheck(this, ServiceError);\n\n this.code = code;\n this.message = message;\n}\n/**\n * @member - The error message\n * @type {string}\n */\n;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.LOG_LEVEL = undefined;\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 _jsLogger = __webpack_require__(8);\n\nvar JsLogger = _interopRequireWildcard(_jsLogger);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LoggerFactory = function () {\n function LoggerFactory(options) {\n _classCallCheck(this, LoggerFactory);\n\n JsLogger.useDefaults(options || {});\n }\n\n _createClass(LoggerFactory, [{\n key: \"get\",\n value: function get(name) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n }]);\n\n return LoggerFactory;\n}();\n\nvar Logger = new LoggerFactory({ defaultLevel: JsLogger.DEBUG });\nvar LOG_LEVEL = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nexports.default = Logger;\nexports.LOG_LEVEL = LOG_LEVEL;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.MultiRequestResult = undefined;\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 _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\n\nvar _baseServiceResult = __webpack_require__(4);\n\nvar _baseServiceResult2 = _interopRequireDefault(_baseServiceResult);\n\nvar _logger = __webpack_require__(5);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return 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\n/**\n * @constant\n */\nvar logger = _logger2.default.get(\"OvpProvider\");\n\n/**\n * Multi Request builder\n * @classdesc\n */\n\nvar MultiRequestBuilder = function (_RequestBuilder) {\n _inherits(MultiRequestBuilder, _RequestBuilder);\n\n /**\n * @constructor\n */\n function MultiRequestBuilder() {\n _classCallCheck(this, MultiRequestBuilder);\n\n var _this = _possibleConstructorReturn(this, (MultiRequestBuilder.__proto__ || Object.getPrototypeOf(MultiRequestBuilder)).call(this));\n\n _this.requests = [];\n return _this;\n }\n\n /**\n * Adds request to requests array\n * @function add\n * @param {RequestBuilder} request The request\n * @returns {MultiRequestBuilder} The multiRequest\n */\n\n\n /**\n * @member - Array of requests\n * @type {Array<RequestBuilder>}\n */\n\n\n _createClass(MultiRequestBuilder, [{\n key: 'add',\n value: function add(request) {\n this.requests.push(request);\n var requestParams = {};\n var serviceDef = { service: request.service, action: request.action };\n Object.assign(requestParams, _defineProperty({}, this.requests.length, Object.assign(serviceDef, request.params)));\n Object.assign(requestParams, this.params);\n this.params = requestParams;\n return this;\n }\n\n /**\n * Executes a multi request\n * @function execute\n * @returns {Promise} The multirequest execution promisie\n */\n\n }, {\n key: 'execute',\n value: function execute() {\n var _this2 = this;\n\n try {\n this.params = JSON.stringify(this.params);\n } catch (err) {\n logger.error('' + err.message);\n }\n return new Promise(function (resolve, reject) {\n _this2.doHttpRequest().then(function (data) {\n resolve(new MultiRequestResult(data));\n }, function (err) {\n var errorText = 'Error on multiRequest execution, error <' + err + '>.';\n reject(errorText);\n });\n });\n }\n }]);\n\n return MultiRequestBuilder;\n}(_requestBuilder2.default);\n\n/**\n * Multi Request result object\n * @classdesc\n */\n\n\nexports.default = MultiRequestBuilder;\n\nvar MultiRequestResult =\n\n/**\n * @constructor\n * @param {Object} response data\n */\n\n\n/**\n * @member - Is success\n * @type {boolean}\n */\nexports.MultiRequestResult = function MultiRequestResult(response) {\n var _this3 = this;\n\n _classCallCheck(this, MultiRequestResult);\n\n this.results = [];\n\n this.success = true;\n response.forEach(function (result) {\n var serviceResult = new _baseServiceResult2.default(result);\n _this3.results.push(serviceResult);\n if (serviceResult.hasError) {\n logger.error('Service returned an error with error code: ' + serviceResult.error.code + ' and message: ' + serviceResult.error.message + '.');\n _this3.success = false;\n return;\n }\n });\n}\n/**\n * @member - Multi request response data\n * @type {Object}\n */\n;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _mediaSource = __webpack_require__(12);\n\nvar _mediaSource2 = _interopRequireDefault(_mediaSource);\n\nvar _mediaFormat = __webpack_require__(11);\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\n/**\n * Container for the media sources aggregated by stream format.\n * @classdesc\n */\nvar MediaSources = function () {\n\n /**\n * @constructor\n */\n\n /**\n * Dash media sources container.\n * @type {Array<MediaSource>}\n * @public\n */\n function MediaSources() {\n _classCallCheck(this, MediaSources);\n\n this.progressive = [];\n this.dash = [];\n this.hls = [];\n }\n\n /**\n * Maps the source to one of the containers according to his media format.\n * @param {MediaSource} source - The source to add to one of the containers.\n * @param {MediaFormat} mediaFormat - The media format of the source.\n * @returns {void}\n */\n\n /**\n * Hls media sources container.\n * @type {Array<MediaSource>}\n * @public\n */\n\n /**\n * Progressive download media sources container.\n * @type {Array<MediaSource>}\n * @public\n */\n\n\n _createClass(MediaSources, [{\n key: 'map',\n value: function map(source, mediaFormat) {\n if (mediaFormat) {\n switch (mediaFormat.name) {\n case 'mp4':\n this.progressive.push(source);\n break;\n case 'dash':\n this.dash.push(source);\n break;\n case 'hls':\n this.hls.push(source);\n break;\n default:\n break;\n }\n }\n }\n }]);\n\n return MediaSources;\n}();\n\nexports.default = MediaSources;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (true) {\r\n\t\t!(__WEBPACK_AMD_DEFINE_FACTORY__ = (Logger),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _enums = __webpack_require__(2);\n\nvar _mediaSources = __webpack_require__(7);\n\nvar _mediaSources2 = _interopRequireDefault(_mediaSources);\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\n/**\n * Media entry\n * @classdesc\n */\nvar MediaEntry =\n\n/**\n * @constructor\n */\n\n/**\n * @member - entry type\n * @type {MediaEntryType}\n */\n\n/**\n * @member - entry sources\n * @type {MediaSources}\n */\nfunction MediaEntry() {\n _classCallCheck(this, MediaEntry);\n\n this.metaData = new Map();\n this.type = _enums.MediaEntryType.Unknown;\n}\n/**\n * @member - entry metadata\n * @type {Map<string,string>}\n */\n\n/**\n * @member - entry duration\n * @type {number}\n */\n\n\n/**\n * @member - entry ID\n * @type {string}\n */\n;\n\nexports.default = MediaEntry;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _enums = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Drm data\n * @classdesc\n */\nvar Drm =\n\n/**\n * @constructor\n * @param {string} licenseUrl - the license URL\n * @param {Scheme} scheme - the drm scheme\n */\n\n\n/**\n * @member - license URL\n * @type {string}\n */\nfunction Drm(licenseUrl, scheme) {\n _classCallCheck(this, Drm);\n\n this.licenseUrl = licenseUrl;\n this.scheme = scheme;\n}\n/**\n * @member - drm scheme\n * @type {Scheme}\n */\n;\n\nexports.default = Drm;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.MediaFormat = undefined;\n\nvar _enumify = __webpack_require__(18);\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\nvar MediaFormat = exports.MediaFormat = function (_Enum) {\n _inherits(MediaFormat, _Enum);\n\n function MediaFormat() {\n _classCallCheck(this, MediaFormat);\n\n return _possibleConstructorReturn(this, (MediaFormat.__proto__ || Object.getPrototypeOf(MediaFormat)).apply(this, arguments));\n }\n\n return MediaFormat;\n}(_enumify.Enum);\n\nMediaFormat.initEnum({\n dash: {\n get mimeType() {\n return \"application/dash+xml\";\n },\n get pathExt() {\n return \"mpd\";\n }\n },\n hls: {\n get mimeType() {\n return \"application/x-mpegURL\";\n },\n get pathExt() {\n return \"m3u8\";\n }\n },\n wvm: {\n get mimeType() {\n return \"video/wvm\";\n },\n get pathExt() {\n return \"wvm\";\n }\n },\n mp4: {\n get mimeType() {\n return \"video/mp4\";\n },\n get pathExt() {\n return \"mp4\";\n }\n },\n mp3: {\n get mimeType() {\n return \"audio/mpeg\";\n },\n get pathExt() {\n return \"mp3\";\n }\n }\n});\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _drm = __webpack_require__(10);\n\nvar _drm2 = _interopRequireDefault(_drm);\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\n/**\n * Media source\n * @classdesc\n */\nvar MediaSource =\n\n/**\n * @constructor\n */\n\n/**\n * @member - media source mimetype\n * @type {string}\n */\n\n/**\n * @member - media source ID\n * @type {string}\n */\nfunction MediaSource() {\n _classCallCheck(this, MediaSource);\n}\n/**\n * @member - media source drm data\n * @type {Array<Drm>}\n */\n\n/**\n * @member - media source URL\n * @type {string}\n */\n;\n\nexports.default = MediaSource;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _enums = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Ovp BE FlavorAsset\n * @classdesc\n */\nvar KalturaFlavorAsset =\n\n/**\n * @constructor\n * @param {Object} data The json response\n */\n\n/**\n * @member - The language of the flavor asset\n * @type {Status}\n */\n\n/**\n *@member - The video codec\n * @type {boolean}\n */\n\n/**\n * @member - True if this Flavor Asset is playable in KDP\n * @type {boolean}\n */\n\n/**\n * @member - The frame rate (in FPS) of the Flavor Asset\n * @type {number}\n */\n\n/**\n * @member - The width of the Flavor Asset\n * @type {number}\n */\n\n/**\n * @member -The file extension\n * @type {string}\n */\n\n/**\n * @member - The ID of the Flavor Asset\n * @type {string}\n */\nfunction KalturaFlavorAsset(data) {\n _classCallCheck(this, KalturaFlavorAsset);\n\n this.id = data.id;\n this.flavorParamsId = data.flavorParamsId;\n this.fileExt = data.fileExt;\n this.bitrate = data.bitrate;\n this.width = data.width;\n this.height = data.height;\n this.id = data.id;\n this.frameRate = data.frameRate;\n this.isOriginal = data.isOriginal;\n this.isWeb = data.isWeb;\n this.containerFormat = data.containerFormat;\n this.videoCodecId = data.videoCodecId;\n this.status = data.status;\n this.language = data.language;\n this.label = data.label;\n}\n/**\n * @member - The label of the flavor asset\n * @type {string}\n */\n\n/**\n * @member - The status of the Flavor Asset\n * @type {string}\n */\n\n/**\n * @member - The container format\n * @type {boolean}\n */\n\n/**\n * @member - True if this Flavor Asset is the original source\n * @type {number}\n */\n\n/**\n * @member - The height of the Flavor Asset\n * @type {number}\n */\n\n/**\n * @member - The overall bitrate (in KBits) of the Flavor Asset\n * @type {string}\n */\n\n/**\n * @member -The Flavor Params used to create this Flavor Asset\n * @type {string}\n */\n;\n\nexports.default = KalturaFlavorAsset;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _enums = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Ovp BE MediaEntry\n * @classdesc\n */\nvar KalturaMediaEntry =\n\n/**\n * @constructor\n * @param {Object} entry The json response\n */\n\n/**\n * @member - The type of the entry, this is auto filled by the derived entry object\n * @type {EntryType}\n */\n\n/**\n * @member - Comma separated flavor params ids that exists for this media entry\n * @type {string}\n */\n\n/**\n * @member - Entry name (Min 1 chars)\n * @type {string}\n */\nfunction KalturaMediaEntry(entry) {\n _classCallCheck(this, KalturaMediaEntry);\n\n this.id = entry.id;\n this.name = entry.name;\n this.dataUrl = entry.dataUrl;\n this.type = entry.type;\n this.entryType = entry.mediaType;\n this.flavorParamsIds = entry.flavorParamsIds;\n this.duration = entry.duration;\n}\n/**\n * @member - The type of the entry, this is auto filled by the derived entry object (Image, Audio etc.)\n * @type {MediaType}\n */\n\n/**\n * @member - The entry duration\n * @type {number}\n */\n\n/**\n * @member - The URL used for playback. This is not the download URL.\n * @type {string}\n */\n\n/**\n * @member - The entry id\n * @type {string}\n */\n;\n\nexports.default = KalturaMediaEntry;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _baseServiceResult = __webpack_require__(4);\n\nvar _baseServiceResult2 = _interopRequireDefault(_baseServiceResult);\n\nvar _kalturaMetadata = __webpack_require__(30);\n\nvar _kalturaMetadata2 = _interopRequireDefault(_kalturaMetadata);\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\n/**\n * Ovp BE Metadata list response\n * @classdesc\n */\nvar KalturaMetadataListResponse = function (_ServiceResult) {\n _inherits(KalturaMetadataListResponse, _ServiceResult);\n\n /**\n * @constructor\n * @param {Object} responseObj The response\n */\n function KalturaMetadataListResponse(responseObj) {\n _classCallCheck(this, KalturaMetadataListResponse);\n\n var _this = _possibleConstructorReturn(this, (KalturaMetadataListResponse.__proto__ || Object.getPrototypeOf(KalturaMetadataListResponse)).call(this, responseObj));\n\n if (!_this.hasError) {\n _this.totalCount = responseObj.totalCount;\n if (_this.totalCount > 0) {\n _this.metas = [];\n responseObj.objects.map(function (meta) {\n return _this.metas.push(new _kalturaMetadata2.default(meta));\n });\n }\n }\n return _this;\n }\n /**\n * @member -The mata data array\n * @type {Array<KalturaMetadata>}\n */\n\n\n return KalturaMetadataListResponse;\n}(_baseServiceResult2.default);\n\nexports.default = KalturaMetadataListResponse;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _baseServiceResult = __webpack_require__(4);\n\nvar _baseServiceResult2 = _interopRequireDefault(_baseServiceResult);\n\nvar _kalturaAccessControlMessage = __webpack_require__(27);\n\nvar _kalturaAccessControlMessage2 = _interopRequireDefault(_kalturaAccessControlMessage);\n\nvar _kalturaPlaybackSource = __webpack_require__(17);\n\nvar _kalturaPlaybackSource2 = _interopRequireDefault(_kalturaPlaybackSource);\n\nvar _kalturaRuleAction = __webpack_require__(31);\n\nvar _kalturaRuleAction2 = _interopRequireDefault(_kalturaRuleAction);\n\nvar _kalturaFlavorAsset = __webpack_require__(13);\n\nvar _kalturaFlavorAsset2 = _interopRequireDefault(_kalturaFlavorAsset);\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\n/**\n * Ovp BE playback context response\n * @classdesc\n */\nvar KalturaPlaybackContext = function (_ServiceResult) {\n _inherits(KalturaPlaybackContext, _ServiceResult);\n\n /**\n * @constructor\n * @param {Object} response The response\n */\n\n /**\n * @member - Array of actions as received from the rules that invalidated\n * @type {Array<KalturaAccessControlMessage>}\n */\n\n /**\n * @member - The playback sources\n * @type {Array<KalturaPlaybackSource>}\n */\n function KalturaPlaybackContext(response) {\n _classCallCheck(this, KalturaPlaybackContext);\n\n var _this = _possibleConstructorReturn(this, (KalturaPlaybackContext.__proto__ || Object.getPrototypeOf(KalturaPlaybackContext)).call(this, response));\n\n _this.sources = [];\n _this.actions = [];\n _this.messages = [];\n _this.flavorAssets = [];\n\n if (!_this.hasError) {\n\n var messages = response.messages;\n if (messages) {\n messages.map(function (message) {\n return _this.messages.push(new _kalturaAccessControlMessage2.default(message));\n });\n }\n\n var actions = response.actions;\n if (actions) {\n actions.map(function (action) {\n return _this.actions.push(new _kalturaRuleAction2.default(action));\n });\n }\n\n var sources = response.sources;\n if (sources) {\n sources.map(function (source) {\n return _this.sources.push(new _kalturaPlaybackSource2.default(source));\n });\n }\n\n var flavorAssets = response.flavorAssets;\n if (flavorAssets) {\n flavorAssets.map(function (flavor) {\n return _this.flavorAssets.push(new _kalturaFlavorAsset2.default(flavor));\n });\n }\n }\n\n return _this;\n }\n /**\n * @member - The flavor assets\n * @type {Array<KalturaFlavorAsset>}\n */\n\n /**\n * @member - Array of actions as received from the rules that invalidated\n * @type {Array<KalturaRuleAction>}\n */\n\n\n return KalturaPlaybackContext;\n}(_baseServiceResult2.default);\n\nexports.default = KalturaPlaybackContext;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _kalturaDrmPlaybackPluginData = __webpack_require__(29);\n\nvar _kalturaDrmPlaybackPluginData2 = _interopRequireDefault(_kalturaDrmPlaybackPluginData);\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\n/**\n * Ovp BE playback source\n * @classdesc\n */\nvar KalturaPlaybackSource = function () {\n\n /**\n * @constructor\n * @param {Object} source The response\n */\n\n /**\n * @member - comma separated string of flavor ids\n * @type {string}\n */\n\n /**\n * @member - The source URL\n * @type {string}\n */\n\n /**\n * @member - source format according to delivery profile streamer type (applehttp, mpegdash etc.)\n * @type {string}\n */\n function KalturaPlaybackSource(source) {\n var _this = this;\n\n _classCallCheck(this, KalturaPlaybackSource);\n\n this.drm = [];\n\n this.format = source.format;\n this.deliveryProfileId = source.deliveryProfileId;\n this.url = source.url;\n this.protocols = source.protocols;\n this.flavorIds = source.flavorIds;\n\n if (source.drm) {\n source.drm.map(function (drm) {\n return _this.drm.push(new _kalturaDrmPlaybackPluginData2.default(drm));\n });\n }\n }\n\n /**\n * Checks if source has DRM data\n * @function hasDrmData\n * @returns {boolean} Is source has DRM\n */\n\n /**\n * @member - drm data object containing relevant license url ,scheme name and certificate\n * @type {Array<KalturaDrmPlaybackPluginData>}\n */\n\n /**\n * @member - comma separated string according to deliveryProfile media protocols ('http,https' etc.)\n * @type {string}\n */\n\n /**\n * @member - delivery profile Id\n * @type {string}\n */\n\n\n _createClass(KalturaPlaybackSource, [{\n key: \"hasDrmData\",\n value: function hasDrmData() {\n return this.drm && this.drm.length > 0;\n }\n\n /**\n * Checks if source has flavor IDs\n * @function hasFlavorIds\n * @returns {boolean} Is source ha flavor IDs\n */\n\n }, {\n key: \"hasFlavorIds\",\n value: function hasFlavorIds() {\n return !!this.flavorIds && this.flavorIds.length > 0;\n }\n\n /**\n * Returns source desired protocol if supported\n * @param {string} protocol - the desired protocol for the source (base play url protocol)\n * @returns {string} - protocol if protocol is in the protocols list - if not empty string returned\n */\n\n }, {\n key: \"getProtocol\",\n value: function getProtocol(protocol) {\n var returnValue = \"\";\n if (this.protocols && this.protocols.length > 0) {\n var protocolsArr = this.protocols.split(\",\");\n protocolsArr.forEach(function (p) {\n if (p == protocol) {\n returnValue = p;\n }\n });\n } else if (protocol == \"http\") {\n return protocol;\n }\n return returnValue;\n }\n }]);\n\n return KalturaPlaybackSource;\n}();\n\nexports.default = KalturaPlaybackSource;\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\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\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.copyProperties = copyProperties;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar INITIALIZED = Symbol();\n\n/**\n * This is an abstract class that is not intended to be\n * used directly. Extend it to turn your class into an enum\n * (initialization is performed via `MyClass.initEnum()`).\n */\n\nvar Enum = exports.Enum = function () {\n /**\n * `initEnum()` closes the class. Then calling this constructor\n * throws an exception.\n * \n * If your subclass has a constructor then you can control\n * what properties are added to `this` via the argument you\n * pass to `super()`. No arguments are fine, too.\n */\n\n function Enum() {\n var instanceProperties = arguments.length <= 0 || arguments[0] === undefined ? undefined : arguments[0];\n\n _classCallCheck(this, Enum);\n\n // new.target would be better than this.constructor,\n // but isn’t supported by Babel\n if ({}.hasOwnProperty.call(this.constructor, INITIALIZED)) {\n throw new Error('Enum classes can’t be instantiated');\n }\n if ((typeof instanceProperties === 'undefined' ? 'undefined' : _typeof(instanceProperties)) === 'object' && instanceProperties !== null) {\n copyProperties(this, instanceProperties);\n }\n }\n /**\n * Set up the enum, close the class.\n * \n * @param arg Either an object whose properties provide the names\n * and values (which must be mutable objects) of the enum constants.\n * Or an Array whose elements are used as the names of the enum constants\n * The values are create by instantiating the current class.\n */\n\n _createClass(Enum, [{\n key: 'toString',\n\n /**\n * Default `toString()` method for enum constant.\n */\n value: function toString() {\n return this.constructor.name + '.' + this.name;\n }\n }], [{\n key: 'initEnum',\n value: function initEnum(arg) {\n Object.defineProperty(this, 'enumValues', {\n value: [],\n configurable: false,\n writable: false,\n enumerable: true\n });\n if (Array.isArray(arg)) {\n this._enumValuesFromArray(arg);\n } else {\n this._enumValuesFromObject(arg);\n }\n Object.freeze(this.enumValues);\n this[INITIALIZED] = true;\n return this;\n }\n }, {\n key: '_enumValuesFromArray',\n value: function _enumValuesFromArray(arr) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = arr[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n\n this._pushEnumValue(new this(), key);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n }, {\n key: '_enumValuesFromObject',\n value: function _enumValuesFromObject(obj) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = Object.keys(obj)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n\n var value = new this(obj[key]);\n this._pushEnumValue(value, key);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n }, {\n key: '_pushEnumValue',\n value: function _pushEnumValue(enumValue, name) {\n enumValue.name = name;\n enumValue.ordinal = this.enumValues.length;\n Object.defineProperty(this, name, {\n value: enumValue,\n configurable: false,\n writable: false,\n enumerable: true\n });\n this.enumValues.push(enumValue);\n }\n\n /**\n * Given the name of an enum constant, return its value.\n */\n\n }, {\n key: 'enumValueOf',\n value: function enumValueOf(name) {\n return this.enumValues.find(function (x) {\n return x.name === name;\n });\n }\n\n /**\n * Make enum classes iterable\n */\n\n }, {\n key: Symbol.iterator,\n value: function value() {\n return this.enumValues[Symbol.iterator]();\n }\n }]);\n\n return Enum;\n}();\n\nfunction copyProperties(target, source) {\n // Ideally, we’d use Reflect.ownKeys() here,\n // but I don’t want to depend on a polyfill\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = Object.getOwnPropertyNames(source)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var key = _step3.value;\n\n var desc = Object.getOwnPropertyDescriptor(source, key);\n Object.defineProperty(target, key, desc);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return target;\n}\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _ovpService = __webpack_require__(3);\n\nvar _ovpService2 = _interopRequireDefault(_ovpService);\n\nvar _multiRequestBuilder = __webpack_require__(6);\n\nvar _multiRequestBuilder2 = _interopRequireDefault(_multiRequestBuilder);\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\n/**\n * Data loaders manager\n * @classdesc\n */\nvar DataLoaderManager = function () {\n\n /**\n * @constructor\n * @param {string} partnerID Then partner ID\n * @param {string} ks The ks\n */\n\n /**\n * @member - Lodaers response map index\n * @type {Map<string,Array<number>>}\n * @private\n * @static\n */\n function DataLoaderManager(partnerID) {\n var ks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"\";\n\n _classCallCheck(this, DataLoaderManager);\n\n this._loaders = new Map();\n\n this._multiRequest = _ovpService2.default.getMultirequest(ks, partnerID);\n }\n\n /**\n * Add loader too execution loaders map\n * @function\n * @param {Function} loader Loader to add\n * @param {Object} params Loader params\n * @returns {void}\n */\n\n /**\n * @member - Loaders to execute\n * @type {Map<string,Function>}\n * @private\n */\n\n /**\n * @member - Loaders multi request\n * @type {MultiRequestBuilder}\n * @private\n */\n\n /**\n * @member - Loaders multi response\n * @type {MultiRequestResult}\n * @private\n */\n\n\n _createClass(DataLoaderManager, [{\n key: 'add',\n value: function add(loader, params) {\n var _this = this;\n\n var execution_loader = new loader(params);\n if (execution_loader.isValid()) {\n this._loaders.set(loader.name, execution_loader);\n //Get the start index from the multiReqeust before adding current execution_loader requests\n var startIndex = this._multiRequest.requests.length;\n //Get the requests\n var requests = execution_loader.requests;\n //Add requests to muktiRequest queue\n requests.forEach(function (request) {\n _this._multiRequest.add(request);\n });\n //Create range array of current execution_loader requests\n var executionLoaderResponseMap = Array.from(new Array(requests.length), function (val, index) {\n return index + startIndex;\n });\n //Add to map\n DataLoaderManager._loadersResponseMap.set(loader.name, executionLoaderResponseMap);\n }\n }\n\n /**\n * Get data from all loaders using multi request\n * @function\n * @returns {Promise} Promise\n */\n\n }, {\n key: 'fetchData',\n value: function fetchData() {\n var _this2 = this;\n\n return new Promise(function (resolve, reject) {\n _this2._multiRequest.execute().then(function (response) {\n _this2._multiResponse = response;\n if (!response.success) {\n reject(response);\n } else {\n var preparedData = _this2.prepareData(response);\n if (preparedData.success) {\n resolve(_this2._loaders);\n } else {\n reject({ success: false, data: preparedData.error });\n }\n }\n }, function (err) {\n reject(err);\n });\n });\n }\n }, {\n key: 'prepareData',\n value: function prepareData(response) {\n this._loaders.forEach(function (loader, name) {\n var loaderDataIndexes = DataLoaderManager._loadersResponseMap.get(name);\n try {\n if (loaderDataIndexes != null) {\n loader.response = response.results.slice(loaderDataIndexes[0], loaderDataIndexes[loaderDataIndexes.length - 1] + 1);\n }\n } catch (err) {\n return { success: false, error: err };\n }\n });\n return { success: true, data: this._loaders };\n }\n }]);\n\n return DataLoaderManager;\n}();\n\nDataLoaderManager._loadersResponseMap = new Map();\nexports.default = DataLoaderManager;\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\n\nvar _baseEntryService = __webpack_require__(33);\n\nvar _baseEntryService2 = _interopRequireDefault(_baseEntryService);\n\nvar _metaDataService = __webpack_require__(34);\n\nvar _metaDataService2 = _interopRequireDefault(_metaDataService);\n\nvar _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\n\nvar _kalturaPlaybackContext = __webpack_require__(16);\n\nvar _kalturaPlaybackContext2 = _interopRequireDefault(_kalturaPlaybackContext);\n\nvar _kalturaMetadataListResponse = __webpack_require__(15);\n\nvar _kalturaMetadataListResponse2 = _interopRequireDefault(_kalturaMetadataListResponse);\n\nvar _kalturaBaseEntryListResponse = __webpack_require__(28);\n\nvar _kalturaBaseEntryListResponse2 = _interopRequireDefault(_kalturaBaseEntryListResponse);\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 config = _config2.default.get();\n\n/**\n * Media entry loader\n * @classdesc\n */\n\nvar MediaEntryLoader = function () {\n _createClass(MediaEntryLoader, null, [{\n key: 'name',\n get: function get() {\n return \"media\";\n }\n }]);\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n function MediaEntryLoader(params) {\n _classCallCheck(this, MediaEntryLoader);\n\n this._response = {};\n\n this.requests = this.buildRequests(params);\n this._entryId = params.entryId;\n }\n\n _createClass(MediaEntryLoader, [{\n key: 'buildRequests',\n\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function buildRequests(params) {\n var requests = [];\n requests.push(_baseEntryService2.default.list(config.beUrl, params.ks, params.entryId));\n requests.push(_baseEntryService2.default.getPlaybackContext(config.beUrl, params.ks, params.entryId));\n requests.push(_metaDataService2.default.list(config.beUrl, params.ks, params.entryId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n\n }, {\n key: 'isValid',\n value: function isValid() {\n return !!this._entryId;\n }\n }, {\n key: 'requests',\n set: function set(requests) {\n this._requests = requests;\n },\n get: function get() {\n return this._requests;\n }\n }, {\n key: 'response',\n set: function set(response) {\n var mediaEntryResponse = new _kalturaBaseEntryListResponse2.default(response[0].data);\n this._response.entry = mediaEntryResponse.entries[0];\n this._response.playBackContextResult = new _kalturaPlaybackContext2.default(response[1].data);\n this._response.metadataListResult = new _kalturaMetadataListResponse2.default(response[2].data);\n },\n get: function get() {\n return this._response;\n }\n }]);\n\n return MediaEntryLoader;\n}();\n\nexports.default = MediaEntryLoader;\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _sessionService = __webpack_require__(35);\n\nvar _sessionService2 = _interopRequireDefault(_sessionService);\n\nvar _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\n\nvar _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\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 config = _config2.default.get();\n/**\n * Media entry loader\n * @classdesc\n */\n\nvar SessionLoader = function () {\n _createClass(SessionLoader, null, [{\n key: 'name',\n get: function get() {\n return \"session\";\n }\n\n /**\n * @member - partner ID\n * @type {number}\n * @private\n */\n\n }]);\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n function SessionLoader(params) {\n _classCallCheck(this, SessionLoader);\n\n this._response = {};\n\n this.requests = this.buildRequests(params);\n this._partnerId = params.partnerId;\n }\n\n _createClass(SessionLoader, [{\n key: 'buildRequests',\n\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function buildRequests(params) {\n var requests = [];\n requests.push(_sessionService2.default.anonymousSession(config.beUrl, params.partnerId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n\n }, {\n key: 'isValid',\n value: function isValid() {\n return !!this._partnerId;\n }\n }, {\n key: 'requests',\n set: function set(requests) {\n this._requests = requests;\n },\n get: function get() {\n return this._requests;\n }\n }, {\n key: 'response',\n set: function set(response) {\n this._response.ks = response[0].data.ks;\n },\n get: function get() {\n return this._response.ks;\n }\n }]);\n\n return SessionLoader;\n}();\n\nexports.default = SessionLoader;\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _uiConfService = __webpack_require__(37);\n\nvar _uiConfService2 = _interopRequireDefault(_uiConfService);\n\nvar _kalturaUiConfResponse = __webpack_require__(32);\n\nvar _kalturaUiConfResponse2 = _interopRequireDefault(_kalturaUiConfResponse);\n\nvar _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\n\nvar _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\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 config = _config2.default.get();\n\nvar UiConfigLoader = function () {\n _createClass(UiConfigLoader, null, [{\n key: 'name',\n get: function get() {\n return \"uiConf\";\n }\n\n /**\n * @member - uiConf ID\n * @type {number}\n * @private\n */\n\n }]);\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n function UiConfigLoader(params) {\n _classCallCheck(this, UiConfigLoader);\n\n this._response = {};\n\n this.requests = this.buildRequests(params);\n this._uiConfId = params.uiConfId;\n }\n\n _createClass(UiConfigLoader, [{\n key: 'buildRequests',\n\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function buildRequests(params) {\n var requests = [];\n requests.push(_uiConfService2.default.get(config.beUrl, params.ks, params.uiConfId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n\n }, {\n key: 'isValid',\n value: function isValid() {\n return !!this._uiConfId;\n }\n }, {\n key: 'requests',\n set: function set(requests) {\n this._requests = requests;\n },\n get: function get() {\n return this._requests;\n }\n }, {\n key: 'response',\n set: function set(response) {\n this._response.uiConf = new _kalturaUiConfResponse2.default(response[0].data);\n },\n get: function get() {\n if (this._response != null && this._response.uiConf != null && this._response.uiConf.config != null) try {\n return JSON.parse(this._response.uiConf.config).plugins;\n } catch (err) {\n return null;\n } else return null;\n }\n }]);\n\n return UiConfigLoader;\n}();\n\nexports.default = UiConfigLoader;\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _kalturaMediaEntry = __webpack_require__(14);\n\nvar _kalturaMediaEntry2 = _interopRequireDefault(_kalturaMediaEntry);\n\nvar _kalturaPlaybackContext = __webpack_require__(16);\n\nvar _kalturaPlaybackContext2 = _interopRequireDefault(_kalturaPlaybackContext);\n\nvar _kalturaPlaybackSource = __webpack_require__(17);\n\nvar _kalturaPlaybackSource2 = _interopRequireDefault(_kalturaPlaybackSource);\n\nvar _kalturaFlavorAsset = __webpack_require__(13);\n\nvar _kalturaFlavorAsset2 = _interopRequireDefault(_kalturaFlavorAsset);\n\nvar _kalturaMetadataListResponse = __webpack_require__(15);\n\nvar _kalturaMetadataListResponse2 = _interopRequireDefault(_kalturaMetadataListResponse);\n\nvar _playSourceUrlBuilder = __webpack_require__(26);\n\nvar _playSourceUrlBuilder2 = _interopRequireDefault(_playSourceUrlBuilder);\n\nvar _xmlParser = __webpack_require__(38);\n\nvar _xmlParser2 = _interopRequireDefault(_xmlParser);\n\nvar _enums = __webpack_require__(2);\n\nvar _logger = __webpack_require__(5);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\n\nvar _mediaFormat = __webpack_require__(11);\n\nvar _mediaEntry = __webpack_require__(9);\n\nvar _mediaEntry2 = _interopRequireDefault(_mediaEntry);\n\nvar _drm = __webpack_require__(10);\n\nvar _drm2 = _interopRequireDefault(_drm);\n\nvar _mediaSource = __webpack_require__(12);\n\nvar _mediaSource2 = _interopRequireDefault(_mediaSource);\n\nvar _mediaSources = __webpack_require__(7);\n\nvar _mediaSources2 = _interopRequireDefault(_mediaSources);\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 config = _config2.default.get();\n/**\n * @constant\n */\nvar logger = _logger2.default.get(\"OvpProvider\");\n\n/**\n * @constant\n * @type {Map<string, MediaFormat>}\n */\nvar SUPPORTED_FORMATS = new Map([[\"mpegdash\", _mediaFormat.MediaFormat.dash], [\"applehttp\", _mediaFormat.MediaFormat.hls], [\"url\", _mediaFormat.MediaFormat.mp4]]);\n\n/**\n * Ovp provider parser\n * @classdesc\n */\n\nvar ProviderParser = function () {\n function ProviderParser() {\n _classCallCheck(this, ProviderParser);\n }\n\n _createClass(ProviderParser, null, [{\n key: 'getMediaEntry',\n\n\n /**\n * Returns parsed media entry by given OVP response objects\n * @function getMediaEntry\n * @param {string} ks The ks\n * @param {number} partnerID The partner ID\n * @param {number} uiConfId The uiConf ID\n * @param {any} mediaEntryResponse The media entry response\n * @returns {MediaEntry} The media entry\n * @static\n */\n value: function getMediaEntry(ks, partnerID, uiConfId, mediaEntryResponse) {\n var _this = this;\n\n var mediaEntry = new _mediaEntry2.default();\n var entry = mediaEntryResponse.entry;\n var playbackContext = mediaEntryResponse.playBackContextResult;\n var metadataList = mediaEntryResponse.metadataListResult;\n var kalturaSources = playbackContext.sources;\n var sources = new _mediaSources2.default();\n if (kalturaSources && kalturaSources.length > 0) {\n kalturaSources.forEach(function (source) {\n var parsedSource = _this.parseSource(source, ks, partnerID, uiConfId, entry, playbackContext);\n var mediaFormat = SUPPORTED_FORMATS.get(source.format);\n sources.map(parsedSource, mediaFormat);\n });\n }\n\n mediaEntry.sources = sources;\n\n var metadata = this.parseMetaData(metadataList);\n mediaEntry.metaData = metadata;\n mediaEntry.id = entry.id;\n mediaEntry.duration = entry.duration;\n\n var type = _enums.MediaEntryType.Unknown;\n\n switch (entry.entryType) {\n case _enums.MediaType.IMAGE.value:\n type = _enums.MediaEntryType.Image;\n break;\n case _enums.MediaType.AUDIO.value:\n type = _enums.MediaEntryType.Audio;\n break;\n default:\n switch (entry.type) {\n case _enums.EntryType.MEDIA_CLIP.value:\n type = _enums.MediaEntryType.Vod;\n break;\n case _enums.EntryType.LIVE_STREAM.value:\n case _enums.EntryType.LIVE_CHANNEL.value:\n type = _enums.MediaEntryType.Live;\n break;\n default:\n type = _enums.MediaEntryType.Unknown;\n }\n }\n mediaEntry.type = type;\n\n return mediaEntry;\n }\n\n /**\n *\n * @param {KalturaPlaybackSource} source The source\n * @param {string} ks The ks\n * @param {number} partnerID The partner ID\n * @param {number} uiConfId The uiConf ID\n * @param {KalturaMediaEntry} entry The entry\n * @param {KalturaPlaybackContext} playbackContext The playback context\n * @returns {MediaSource} The parsed media source\n * @static\n */\n\n }, {\n key: 'parseSource',\n value: function parseSource(source, ks, partnerID, uiConfId, entry, playbackContext) {\n var playUrl = \"\";\n var mediaFormat = SUPPORTED_FORMATS.get(source.format);\n var mediaSource = new _mediaSource2.default();\n // in case playbackSource doesn't have flavors we don't need to build the url and we'll use the provided one.\n if (source.hasFlavorIds()) {\n var splittedUrl = config.baseUrl.split(\"/\");\n var baseProtocol = void 0;\n if (splittedUrl && splittedUrl.length > 0) {\n baseProtocol = splittedUrl[0].substring(0, splittedUrl[0].length - 1);\n } else {\n baseProtocol = \"http\";\n }\n\n var extension = \"\";\n if (!mediaFormat) {\n var flavorIdsArr = source.flavorIds.split(\",\");\n var flavors = playbackContext.flavorAssets.filter(function (flavor) {\n return flavorIdsArr.indexOf(flavor.id) != -1;\n });\n if (flavors && flavors.length > 0) {\n extension = flavors[0].fileExt;\n }\n } else {\n extension = mediaFormat.pathExt;\n mediaSource.mimetype = mediaFormat.mimeType;\n }\n\n playUrl = _playSourceUrlBuilder2.default.build({\n entryId: entry.id,\n flavorIds: source.flavorIds,\n format: source.format,\n ks: ks,\n partnerId: partnerID,\n uiConfId: uiConfId,\n extension: extension,\n protocol: source.getProtocol(baseProtocol)\n });\n } else {\n playUrl = source.url;\n }\n\n if (playUrl == \"\") {\n logger.error('failed to create play url from source, discarding source: (' + entry.id + '_' + source.deliveryProfileId + '), ' + source.format + '.');\n return mediaSource;\n }\n\n mediaSource.url = playUrl;\n mediaSource.id = entry.id + \"_\" + source.deliveryProfileId + \",\" + source.format;\n if (source.hasDrmData()) {\n var drmParams = [];\n source.drm.forEach(function (drm) {\n drmParams.push(new _drm2.default(drm.licenseURL, drm.scheme));\n });\n mediaSource.drmData = drmParams;\n }\n return mediaSource;\n }\n\n /**\n * Ovp metadata parser\n * @function parseMetaData\n * @param {KalturaMetadataListResponse} metadataList The metadata list\n * @returns {Map<string,string>} Parsed metadata\n * @static\n */\n\n }, {\n key: 'parseMetaData',\n value: function parseMetaData(metadataList) {\n var metadata = {};\n if (metadataList && metadataList.metas && metadataList.metas.length > 0) {\n metadataList.metas.forEach(function (meta) {\n var metaXml = void 0;\n var domParser = new DOMParser();\n meta.xml = meta.xml.replace(/\\r?\\n|\\r/g, \"\");\n meta.xml = meta.xml.replace(/>\\s*/g, '>');\n meta.xml = meta.xml.replace(/>\\s*/g, '>');\n metaXml = domParser.parseFromString(meta.xml, 'text/xml');\n var metasObj = _xmlParser2.default.xmlToJson(metaXml);\n var metaKeys = Object.keys(metasObj.metadata);\n metaKeys.forEach(function (key) {\n metadata[key] = metasObj.metadata[key][\"#text\"];\n });\n });\n }\n return metadata;\n }\n }]);\n\n return ProviderParser;\n}();\n\nexports.default = ProviderParser;\n\n/***/ }),\n/* 24 */,\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.OvpProvider = undefined;\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 _logger = __webpack_require__(5);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _providerParser = __webpack_require__(23);\n\nvar _providerParser2 = _interopRequireDefault(_providerParser);\n\nvar _dataLoaderManager = __webpack_require__(19);\n\nvar _dataLoaderManager2 = _interopRequireDefault(_dataLoaderManager);\n\nvar _mediaEntryLoader = __webpack_require__(20);\n\nvar _mediaEntryLoader2 = _interopRequireDefault(_mediaEntryLoader);\n\nvar _sessionLoader = __webpack_require__(21);\n\nvar _sessionLoader2 = _interopRequireDefault(_sessionLoader);\n\nvar _uiConfigLoader = __webpack_require__(22);\n\nvar _uiConfigLoader2 = _interopRequireDefault(_uiConfigLoader);\n\nvar _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\n\nvar _mediaEntry = __webpack_require__(9);\n\nvar _mediaEntry2 = _interopRequireDefault(_mediaEntry);\n\nvar _mediaSources = __webpack_require__(7);\n\nvar _mediaSources2 = _interopRequireDefault(_mediaSources);\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\n/**\n * @constant\n */\nvar logger = _logger2.default.get(\"OvpProvider\");\n\n/**\n * Ovp provider\n * @classdesc\n */\nvar OvpProvider = exports.OvpProvider = function () {\n\n /**\n * @constructor\n * @param {number} partnerID The partner ID\n * @param {string} [ks=\"\"] The provider ks (has empty string as default value)\n * @param {Object} [config] The provider config(optional)\n */\n\n /**\n * @member - uiConf ID\n * @type {number}\n * @private\n */\n\n /**\n * @member - partner ID\n * @type {number}\n */\n function OvpProvider(partnerID) {\n var ks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"\";\n var config = arguments[2];\n\n _classCallCheck(this, OvpProvider);\n\n this.partnerID = partnerID;\n this.ks = ks;\n this._isAnonymous = !this.ks;\n _config2.default.set(config);\n }\n\n /**\n * Returns player json configuration\n * @function getConfig\n * @param {string} entryId The entry ID\n * @param {number} uiConfId The uiConf ID\n * @returns {Promise} The provider config object as promise\n */\n\n /**\n * @member - Data loader\n * @type {DataLoaderManager}\n * @private\n */\n\n /**\n * @member - is anonymous\n * @type {boolean}\n * @private\n */\n\n /**\n * @member - ks\n * @type {string}\n */\n\n\n _createClass(OvpProvider, [{\n key: 'getConfig',\n value: function getConfig(entryId, uiConfId) {\n var _this = this;\n\n if (uiConfId != null) {\n this._uiConfId = uiConfId;\n }\n this._dataLoader = new _dataLoaderManager2.default(this.partnerID, this.ks);\n return new Promise(function (resolve, reject) {\n if (_this.validateParams(entryId, uiConfId)) {\n var ks = _this.ks;\n if (_this._isAnonymous) {\n ks = \"{1:result:ks}\";\n _this._dataLoader.add(_sessionLoader2.default, { partnerId: _this.partnerID });\n }\n _this._dataLoader.add(_mediaEntryLoader2.default, { entryId: entryId, ks: ks });\n _this._dataLoader.add(_uiConfigLoader2.default, { uiConfId: uiConfId, ks: ks });\n _this._dataLoader.fetchData().then(function (response) {\n resolve(_this.parseDataFromResponse(response));\n }, function (err) {\n reject(err);\n });\n } else {\n reject({ success: false, data: \"Missing mandatory parameter\" });\n }\n });\n }\n\n /**\n * Parses BE data to json configuration object\n * @function parseDataFromResponse\n * @param {Map<string,Function>} data The data to parse\n * @returns {Object} The parsed config object\n */\n\n }, {\n key: 'parseDataFromResponse',\n value: function parseDataFromResponse(data) {\n logger.debug(\"Data parsing started\");\n var config = {\n id: \"\",\n session: {\n partnerID: this.partnerID,\n uiConfID: this._uiConfId\n },\n sources: new _mediaSources2.default(),\n duration: 0,\n type: \"Unknown\",\n metadata: {},\n plugins: {}\n };\n if (data != null) {\n if (data.has(_sessionLoader2.default.name)) {\n var sessionLoader = data.get(_sessionLoader2.default.name);\n if (sessionLoader != null && sessionLoader.response != null) {\n this.ks = sessionLoader.response;\n this._isAnonymous = !this.ks;\n config.session.ks = this.ks;\n }\n }\n if (data.has(_uiConfigLoader2.default.name)) {\n var uiConfLoader = data.get(_uiConfigLoader2.default.name);\n var pluginsJson = {};\n if (uiConfLoader != null) {\n pluginsJson = uiConfLoader.response;\n }\n config.plugins = pluginsJson;\n }\n if (data.has(_mediaEntryLoader2.default.name)) {\n var mediaLoader = data.get(_mediaEntryLoader2.default.name);\n if (mediaLoader != null && mediaLoader.response != null) {\n var mediaEntry = _providerParser2.default.getMediaEntry(this.ks, this.partnerID, this._uiConfId, mediaLoader.response);\n config.id = mediaEntry.id;\n config.sources = mediaEntry.sources;\n config.duration = mediaEntry.duration;\n config.type = mediaEntry.type.name;\n config.metadata = mediaEntry.metaData;\n }\n }\n }\n logger.debug(\"Data parsing finished\", config);\n return config;\n }\n\n /**\n * Parameters validation function\n * @param {string} entryId The entry ID\n * @param {number} uiConfId The uiConfID\n * @returns {boolean} Is valid params\n */\n\n }, {\n key: 'validateParams',\n value: function validateParams(entryId, uiConfId) {\n return !!entryId || !!uiConfId;\n }\n }]);\n\n return OvpProvider;\n}();\n\nexports.default = OvpProvider;\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _config = __webpack_require__(1);\n\nvar _config2 = _interopRequireDefault(_config);\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 config = _config2.default.get();\n\n/**\n * Media source url builder\n * @classdesc\n */\n\nvar PlaySourceUrlBuilder = function () {\n function PlaySourceUrlBuilder() {\n _classCallCheck(this, PlaySourceUrlBuilder);\n }\n\n _createClass(PlaySourceUrlBuilder, null, [{\n key: \"build\",\n\n\n /**\n * Returns source url by given url params\n * @function build\n * @param {Object} urlParams The params\n * @returns {string} The URL\n * @static\n */\n value: function build(urlParams) {\n var baseUrl = config.baseUrl;\n var partnerId = urlParams.partnerId;\n var entryId = urlParams.entryId;\n var ks = urlParams.ks;\n var uiConfId = urlParams.uiConfId;\n var format = urlParams.format;\n var protocol = urlParams.protocol;\n var extension = urlParams.extension;\n var flavorIds = urlParams.flavorIds;\n\n if (baseUrl == \"\" && partnerId == \"\" && entryId == \"\" && extension == \"\" && format == \"\") {\n return \"\";\n }\n\n var playUrl = baseUrl;\n if (!PlaySourceUrlBuilder.endsWith(baseUrl, \"/\")) {\n playUrl += \"/\";\n }\n playUrl += \"p/\" + partnerId + \"/sp/\" + partnerId + \"00\" + \"/playManifest/entryId/\" + entryId + \"/protocol/\" + protocol + \"/format/\" + format;\n\n if (flavorIds != \"\") {\n playUrl += \"/falvorIds/\" + flavorIds;\n } else if (uiConfId != \"\") {\n playUrl += \"/uiConfId/\" + uiConfId;\n }\n\n if (this.ks != \"\") {\n playUrl += \"/ks/\" + ks;\n }\n\n playUrl += \"/a.\" + extension;\n\n if (uiConfId && flavorIds != \"\") {\n playUrl += \"?uiConfId=.\" + uiConfId;\n }\n\n return playUrl;\n }\n\n /**\n * Checks if given string end with search string\n * @param {string} string The given string\n * @param {string} searchString The string to search\n * @returns {boolean} Is given string end with search string\n */\n\n }, {\n key: \"endsWith\",\n value: function endsWith(string, searchString) {\n if (typeof string !== 'string') {\n return false;\n }\n if (typeof searchString !== 'string') {\n return false;\n }\n\n return string.indexOf(searchString, string.length - searchString.length) != -1;\n }\n }]);\n\n return PlaySourceUrlBuilder;\n}();\n\nexports.default = PlaySourceUrlBuilder;\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Ovp BE access control message\n * @classdesc\n */\nvar KalturaAccessControlMessage =\n\n/**\n * @constructor\n * @param {Object} data The json response\n */\n\n/**\n * @member - The access control message\n * @type {string}\n */\nfunction KalturaAccessControlMessage(data) {\n _classCallCheck(this, KalturaAccessControlMessage);\n\n this.message = data.message;\n this.code = data.code;\n}\n/**\n * @member - The access control message code\n * @@type {string}\n */\n;\n\nexports.default = KalturaAccessControlMessage;\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _baseServiceResult = __webpack_require__(4);\n\nvar _baseServiceResult2 = _interopRequireDefault(_baseServiceResult);\n\nvar _kalturaMediaEntry = __webpack_require__(14);\n\nvar _kalturaMediaEntry2 = _interopRequireDefault(_kalturaMediaEntry);\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\n/**\n * Ovp BE BaseEntryList service response\n * @classdesc\n */\nvar KalturaBaseEntryListResponse = function (_ServiceResult) {\n _inherits(KalturaBaseEntryListResponse, _ServiceResult);\n\n /**\n * @constructor\n * @param {Object} responseObj The json response\n */\n\n /**\n * @member - The total count\n * @type {number}\n */\n function KalturaBaseEntryListResponse(responseObj) {\n _classCallCheck(this, KalturaBaseEntryListResponse);\n\n var _this = _possibleConstructorReturn(this, (KalturaBaseEntryListResponse.__proto__ || Object.getPrototypeOf(KalturaBaseEntryListResponse)).call(this, responseObj));\n\n if (!_this.hasError) {\n _this.totalCount = responseObj.totalCount;\n if (_this.totalCount > 0) {\n _this.entries = [];\n responseObj.objects.map(function (entry) {\n return _this.entries.push(new _kalturaMediaEntry2.default(entry));\n });\n }\n }\n return _this;\n }\n /**\n * @member - The entries\n * @type {Array<KalturaMediaEntry>}\n */\n\n\n return KalturaBaseEntryListResponse;\n}(_baseServiceResult2.default);\n\nexports.default = KalturaBaseEntryListResponse;\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _enums = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Ovp BE DrmPlaybackPluginData\n * @classdesc\n */\nvar KalturaDrmPlaybackPluginData =\n\n/**\n * @constructor\n * @param {Object} drm The json response\n */\n\n/**\n * @member - The drm scheme\n * @type {Scheme}\n */\nfunction KalturaDrmPlaybackPluginData(drm) {\n _classCallCheck(this, KalturaDrmPlaybackPluginData);\n\n this.scheme = drm.scheme;\n this.licenseURL = drm.licenseURL;\n}\n\n/**\n * @member - The license URL\n * @type {string}\n */\n;\n\nexports.default = KalturaDrmPlaybackPluginData;\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _enums = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Ovp BE Metadata\n * @classdesc\n */\nvar KalturaMetadata =\n\n/**\n * @constructor\n * @param {Object} data The response\n */\nfunction KalturaMetadata(data) {\n _classCallCheck(this, KalturaMetadata);\n\n this.id = data.id;\n this.metadataProfileId = data.metadataProfileId;\n this.metadataProfileVersion = data.metadataProfileVersion;\n this.metadataProfileId = data.metadataProfileId;\n this.metadataObjectType = data.metadataObjectType;\n this.objectId = data.objectId;\n this.version = data.version;\n this.created = new Date(0);\n this.created.setUTCSeconds(data.createdAt);\n this.updated = new Date(0);\n this.updated.setUTCSeconds(data.updatedAt);\n this.status = data.status;\n this.xml = data.xml;\n}\n/**\n * @member - The Metadata xml - represented as XML string\n * @type {string}\n */\n;\n\nexports.default = KalturaMetadata;\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _enums = __webpack_require__(2);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Ovp BE rule action\n * @classdesc\n */\nvar KalturaRuleAction =\n\n/**\n * @constructor\n * @param {Object} data The response\n */\nfunction KalturaRuleAction(data) {\n _classCallCheck(this, KalturaRuleAction);\n\n this.type = data.type;\n}\n/**\n * @member - The type of the action\n * @type {KalturaRuleActionType}\n */\n;\n\nexports.default = KalturaRuleAction;\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _baseServiceResult = __webpack_require__(4);\n\nvar _baseServiceResult2 = _interopRequireDefault(_baseServiceResult);\n\nvar _enums = __webpack_require__(2);\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\n/**\n * Ovp BE Ui config response\n * @classdesc\n */\nvar KalturaUiConfResponse = function (_ServiceResult) {\n _inherits(KalturaUiConfResponse, _ServiceResult);\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n\n /**\n * @member -plugins configuration represented as Json string\n * @type {string}\n */\n\n /**\n * @member -Name of the uiConf, this is not a primary key\n * @type {string}\n */\n function KalturaUiConfResponse(data) {\n _classCallCheck(this, KalturaUiConfResponse);\n\n var _this = _possibleConstructorReturn(this, (KalturaUiConfResponse.__proto__ || Object.getPrototypeOf(KalturaUiConfResponse)).call(this, data));\n\n if (!_this.hasError) {\n _this.name = data.name;\n\n _this.description = data.description;\n _this.objTypeAsString = data.objTypeAsString;\n _this.width = data.width;\n _this.height = data.height;\n _this.htmlParams = data.htmlParams;\n _this.swfUrl = data.swfUrl;\n _this.confFilePath = data.confFilePath;\n _this.confFile = data.confFile;\n _this.confFileFeatures = data.confFileFeatures;\n _this.config = data.config;\n _this.confVars = data.confVars;\n _this.useCdn = data.useCdn;\n _this.tags = data.tags;\n _this.swfUrlVersion = data.swfUrlVersion;\n _this.created = new Date(0);\n _this.created.setUTCSeconds(data.createdAt);\n _this.updated = new Date(0);\n _this.updated.setUTCSeconds(data.updatedAt);\n _this.html5Url = data.description;\n _this.version = data.description;\n _this.partnerTags = data.description;\n _this.objType = data.description;\n _this.creationMode = data.description;\n }\n return _this;\n }\n /**\n * @member -Name of the uiConf, this is not a primary key\n * @type {string}\n */\n\n\n return KalturaUiConfResponse;\n}(_baseServiceResult2.default);\n\nexports.default = KalturaUiConfResponse;\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _ovpService = __webpack_require__(3);\n\nvar _ovpService2 = _interopRequireDefault(_ovpService);\n\nvar _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\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\nvar SERVICE_NAME = \"baseEntry\";\n\n/**\n * Ovp BaseEntry service methods\n * @classdesc\n */\n\nvar BaseEntryService = function (_OvpService) {\n _inherits(BaseEntryService, _OvpService);\n\n function BaseEntryService() {\n _classCallCheck(this, BaseEntryService);\n\n return _possibleConstructorReturn(this, (BaseEntryService.__proto__ || Object.getPrototypeOf(BaseEntryService)).apply(this, arguments));\n }\n\n _createClass(BaseEntryService, null, [{\n key: 'getPlaybackContext',\n\n\n /**\n * Creates an instance of RequestBuilder for baseentry.getPlaybackContext\n * @function getPlaybackContext\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function getPlaybackContext(baseUrl, ks, entryId) {\n var request = new _requestBuilder2.default();\n request.service = SERVICE_NAME;\n request.action = \"getPlaybackContext\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"baseEntry-getPlaybackContext\";\n var contextDataParams = { objectType: \"KalturaContextDataParams\", flavorTags: \"all\" };\n var params = { entryId: entryId, ks: ks, contextDataParams: contextDataParams };\n request.params = params;\n return request;\n }\n\n /**\n * Creates an instance of RequestBuilder for baseentry.list\n * @function list\n * @param {string} baseUrl The base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n\n }, {\n key: 'list',\n value: function list(baseUrl, ks, entryId) {\n var request = new _requestBuilder2.default();\n request.service = SERVICE_NAME;\n request.action = \"list\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"list\";\n request.params = BaseEntryService.getEntryListReqParams(entryId, ks);\n return request;\n }\n\n /**\n * Gets baseentry.list service params\n * @function getEntryListReqParams\n * @param {string} entryId The entry ID\n * @param {string} ks The ks\n * @returns {{ks: string, filter: {redirectFromEntryId: string}, responseProfile: {fields: string, type: number}}} The service params object\n * @static\n */\n\n }, {\n key: 'getEntryListReqParams',\n value: function getEntryListReqParams(entryId, ks) {\n var filterParams = { redirectFromEntryId: entryId };\n var responseProfileParams = {\n fields: \"id,name,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags\",\n type: 1\n };\n return { ks: ks, filter: filterParams, responseProfile: responseProfileParams };\n }\n }]);\n\n return BaseEntryService;\n}(_ovpService2.default);\n\nexports.default = BaseEntryService;\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _ovpService = __webpack_require__(3);\n\nvar _ovpService2 = _interopRequireDefault(_ovpService);\n\nvar _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\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\nvar SERVICE_NAME = \"metadata_metadata\";\n\n/**\n * Ovp metadata_metadata service methods\n * @classdesc\n */\n\nvar MetaDataService = function (_OvpService) {\n _inherits(MetaDataService, _OvpService);\n\n function MetaDataService() {\n _classCallCheck(this, MetaDataService);\n\n return _possibleConstructorReturn(this, (MetaDataService.__proto__ || Object.getPrototypeOf(MetaDataService)).apply(this, arguments));\n }\n\n _createClass(MetaDataService, null, [{\n key: 'list',\n\n /**\n * Creates an instance of RequestBuilder for metadata_metadata.list\n * @function getPlaybackContext\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function list(baseUrl, ks, entryId) {\n var request = new _requestBuilder2.default();\n request.service = SERVICE_NAME;\n request.action = \"list\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"metadata_metadata-list\";\n var filter = { objectType: \"KalturaMetadataFilter\", objectIdEqual: entryId, metadataObjectTypeEqual: \"1\" };\n var params = { filter: filter, ks: ks };\n request.params = params;\n return request;\n }\n }]);\n\n return MetaDataService;\n}(_ovpService2.default);\n\nexports.default = MetaDataService;\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _ovpService = __webpack_require__(3);\n\nvar _ovpService2 = _interopRequireDefault(_ovpService);\n\nvar _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\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\nvar SERVICE_NAME = \"session\";\n\n/**\n * Ovp session service methods\n * @classdesc\n */\n\nvar SessionService = function (_OvpService) {\n _inherits(SessionService, _OvpService);\n\n function SessionService() {\n _classCallCheck(this, SessionService);\n\n return _possibleConstructorReturn(this, (SessionService.__proto__ || Object.getPrototypeOf(SessionService)).apply(this, arguments));\n }\n\n _createClass(SessionService, null, [{\n key: 'anonymousSession',\n\n /**\n * Creates an instance of RequestBuilder for session.startWidgetSession\n * @function anonymousSession\n * @param {string} baseUrl The service base URL\n * @param {string} partnerId The partner ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function anonymousSession(baseUrl, partnerId) {\n var request = new _requestBuilder2.default();\n request.service = SERVICE_NAME;\n request.action = \"startWidgetSession\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"session-startWidget\";\n request.params = { widgetId: \"_\" + partnerId };\n return request;\n }\n }]);\n\n return SessionService;\n}(_ovpService2.default);\n\nexports.default = SessionService;\n\n/***/ }),\n/* 36 */,\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _ovpService = __webpack_require__(3);\n\nvar _ovpService2 = _interopRequireDefault(_ovpService);\n\nvar _requestBuilder = __webpack_require__(0);\n\nvar _requestBuilder2 = _interopRequireDefault(_requestBuilder);\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\nvar SERVICE_NAME = \"uiconf\";\n\n/**\n * Ovp uiconf service methods\n * @classdesc\n */\n\nvar UiConfService = function (_OvpService) {\n _inherits(UiConfService, _OvpService);\n\n function UiConfService() {\n _classCallCheck(this, UiConfService);\n\n return _possibleConstructorReturn(this, (UiConfService.__proto__ || Object.getPrototypeOf(UiConfService)).apply(this, arguments));\n }\n\n _createClass(UiConfService, null, [{\n key: 'get',\n\n /**\n * Creates an instance of RequestBuilder for uiconf.get\n * @function get\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} uiConfID The uiConf ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n value: function get(baseUrl, ks, uiConfID) {\n var request = new _requestBuilder2.default();\n request.service = SERVICE_NAME;\n request.action = \"get\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"uiconf-get\";\n var responseProfileParams = {\n fields: \"config\",\n type: 1\n };\n request.params = { id: uiConfID, responseProfile: responseProfileParams, ks: ks };\n return request;\n }\n }]);\n\n return UiConfService;\n}(_ovpService2.default);\n\nexports.default = UiConfService;\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 * Xml parser\n * @classdesc\n */\nvar XmlParser = function () {\n function XmlParser() {\n _classCallCheck(this, XmlParser);\n }\n\n _createClass(XmlParser, null, [{\n key: \"xmlToJson\",\n\n /**\n * Parses xml string to json object\n * @param {string} xml The xml to parse\n * @returns {{}} The parsed xml as Json object\n * @static\n */\n value: function xmlToJson(xml) {\n var obj = {};\n if (xml.nodeType == 1) {\n if (xml.attributes.length > 0) {\n obj[\"@attributes\"] = {};\n for (var j = 0; j < xml.attributes.length; j++) {\n var attribute = xml.attributes.item(j);\n obj[\"@attributes\"][attribute.nodeName] = attribute.nodeValue;\n }\n }\n } else if (xml.nodeType == 3) {\n obj = xml.nodeValue;\n }\n if (xml.hasChildNodes()) {\n for (var i = 0; i < xml.childNodes.length; i++) {\n var item = xml.childNodes.item(i);\n var nodeName = item.nodeName;\n if (typeof obj[nodeName] == \"undefined\") {\n obj[nodeName] = this.xmlToJson(item);\n } else {\n if (typeof obj[nodeName].push == \"undefined\") {\n var old = obj[nodeName];\n obj[nodeName] = [];\n obj[nodeName].push(old);\n }\n obj[nodeName].push(this.xmlToJson(item));\n }\n }\n }\n return obj;\n }\n }]);\n\n return XmlParser;\n}();\n\nexports.default = XmlParser;\n\n/***/ })\n/******/ ]);\n});\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.setup = exports.PlaykitUI = exports.OvpProvider = exports.Playkit = undefined;\n\nvar _playkitJs = __webpack_require__(0);\n\nvar Playkit = _interopRequireWildcard(_playkitJs);\n\nvar _ovpProvider = __webpack_require__(1);\n\nvar _ovpProvider2 = _interopRequireDefault(_ovpProvider);\n\nvar _playkitJsUi = __webpack_require__(3);\n\nvar _playkitJsUi2 = _interopRequireDefault(_playkitJsUi);\n\n__webpack_require__(4);\n\n__webpack_require__(9);\n\n__webpack_require__(11);\n\nvar _setup = __webpack_require__(13);\n\nvar _setup2 = _interopRequireDefault(_setup);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n// TODO: Import plugins\n\n// Import OVP and OTT providers\nexports.Playkit = Playkit;\nexports.OvpProvider = _ovpProvider2.default;\nexports.PlaykitUI = _playkitJsUi2.default;\nexports.setup = _setup2.default;\n\n// Import media source adapters\n\n\n// Import UI\n\n\n// Import core\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(0));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsUi\"] = factory(require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsUi\"] = factory(root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_48__) {\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/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 28);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n!function() {\n 'use strict';\n function VNode() {}\n function h(nodeName, attributes) {\n var lastSimple, child, simple, i, children = EMPTY_CHILDREN;\n for (i = arguments.length; i-- > 2; ) stack.push(arguments[i]);\n if (attributes && null != attributes.children) {\n if (!stack.length) stack.push(attributes.children);\n delete attributes.children;\n }\n while (stack.length) if ((child = stack.pop()) && void 0 !== child.pop) for (i = child.length; i--; ) stack.push(child[i]); else {\n if (child === !0 || child === !1) child = null;\n if (simple = 'function' != typeof nodeName) if (null == child) child = ''; else if ('number' == typeof child) child = String(child); else if ('string' != typeof child) simple = !1;\n if (simple && lastSimple) children[children.length - 1] += child; else if (children === EMPTY_CHILDREN) children = [ child ]; else children.push(child);\n lastSimple = simple;\n }\n var p = new VNode();\n p.nodeName = nodeName;\n p.children = children;\n p.attributes = null == attributes ? void 0 : attributes;\n p.key = null == attributes ? void 0 : attributes.key;\n if (void 0 !== options.vnode) options.vnode(p);\n return p;\n }\n function extend(obj, props) {\n for (var i in props) obj[i] = props[i];\n return obj;\n }\n function cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n }\n function enqueueRender(component) {\n if (!component.__d && (component.__d = !0) && 1 == items.push(component)) (options.debounceRendering || setTimeout)(rerender);\n }\n function rerender() {\n var p, list = items;\n items = [];\n while (p = list.pop()) if (p.__d) renderComponent(p);\n }\n function isSameNodeType(node, vnode, hydrating) {\n if ('string' == typeof vnode || 'number' == typeof vnode) return void 0 !== node.splitText;\n if ('string' == typeof vnode.nodeName) return !node._componentConstructor && isNamedNode(node, vnode.nodeName); else return hydrating || node._componentConstructor === vnode.nodeName;\n }\n function isNamedNode(node, nodeName) {\n return node.__n === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n }\n function getNodeProps(vnode) {\n var props = extend({}, vnode.attributes);\n props.children = vnode.children;\n var defaultProps = vnode.nodeName.defaultProps;\n if (void 0 !== defaultProps) for (var i in defaultProps) if (void 0 === props[i]) props[i] = defaultProps[i];\n return props;\n }\n function createNode(nodeName, isSvg) {\n var node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n node.__n = nodeName;\n return node;\n }\n function removeNode(node) {\n if (node.parentNode) node.parentNode.removeChild(node);\n }\n function setAccessor(node, name, old, value, isSvg) {\n if ('className' === name) name = 'class';\n if ('key' === name) ; else if ('ref' === name) {\n if (old) old(null);\n if (value) value(node);\n } else if ('class' === name && !isSvg) node.className = value || ''; else if ('style' === name) {\n if (!value || 'string' == typeof value || 'string' == typeof old) node.style.cssText = value || '';\n if (value && 'object' == typeof value) {\n if ('string' != typeof old) for (var i in old) if (!(i in value)) node.style[i] = '';\n for (var i in value) node.style[i] = 'number' == typeof value[i] && IS_NON_DIMENSIONAL.test(i) === !1 ? value[i] + 'px' : value[i];\n }\n } else if ('dangerouslySetInnerHTML' === name) {\n if (value) node.innerHTML = value.__html || '';\n } else if ('o' == name[0] && 'n' == name[1]) {\n var useCapture = name !== (name = name.replace(/Capture$/, ''));\n name = name.toLowerCase().substring(2);\n if (value) {\n if (!old) node.addEventListener(name, eventProxy, useCapture);\n } else node.removeEventListener(name, eventProxy, useCapture);\n (node.__l || (node.__l = {}))[name] = value;\n } else if ('list' !== name && 'type' !== name && !isSvg && name in node) {\n setProperty(node, name, null == value ? '' : value);\n if (null == value || value === !1) node.removeAttribute(name);\n } else {\n var ns = isSvg && name !== (name = name.replace(/^xlink\\:?/, ''));\n if (null == value || value === !1) if (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase()); else node.removeAttribute(name); else if ('function' != typeof value) if (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value); else node.setAttribute(name, value);\n }\n }\n function setProperty(node, name, value) {\n try {\n node[name] = value;\n } catch (e) {}\n }\n function eventProxy(e) {\n return this.__l[e.type](options.event && options.event(e) || e);\n }\n function flushMounts() {\n var c;\n while (c = mounts.pop()) {\n if (options.afterMount) options.afterMount(c);\n if (c.componentDidMount) c.componentDidMount();\n }\n }\n function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n if (!diffLevel++) {\n isSvgMode = null != parent && void 0 !== parent.ownerSVGElement;\n hydrating = null != dom && !('__preactattr_' in dom);\n }\n var ret = idiff(dom, vnode, context, mountAll, componentRoot);\n if (parent && ret.parentNode !== parent) parent.appendChild(ret);\n if (!--diffLevel) {\n hydrating = !1;\n if (!componentRoot) flushMounts();\n }\n return ret;\n }\n function idiff(dom, vnode, context, mountAll, componentRoot) {\n var out = dom, prevSvgMode = isSvgMode;\n if (null == vnode) vnode = '';\n if ('string' == typeof vnode) {\n if (dom && void 0 !== dom.splitText && dom.parentNode && (!dom._component || componentRoot)) {\n if (dom.nodeValue != vnode) dom.nodeValue = vnode;\n } else {\n out = document.createTextNode(vnode);\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n recollectNodeTree(dom, !0);\n }\n }\n out.__preactattr_ = !0;\n return out;\n }\n if ('function' == typeof vnode.nodeName) return buildComponentFromVNode(dom, vnode, context, mountAll);\n isSvgMode = 'svg' === vnode.nodeName ? !0 : 'foreignObject' === vnode.nodeName ? !1 : isSvgMode;\n if (!dom || !isNamedNode(dom, String(vnode.nodeName))) {\n out = createNode(String(vnode.nodeName), isSvgMode);\n if (dom) {\n while (dom.firstChild) out.appendChild(dom.firstChild);\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n recollectNodeTree(dom, !0);\n }\n }\n var fc = out.firstChild, props = out.__preactattr_ || (out.__preactattr_ = {}), vchildren = vnode.children;\n if (!hydrating && vchildren && 1 === vchildren.length && 'string' == typeof vchildren[0] && null != fc && void 0 !== fc.splitText && null == fc.nextSibling) {\n if (fc.nodeValue != vchildren[0]) fc.nodeValue = vchildren[0];\n } else if (vchildren && vchildren.length || null != fc) innerDiffNode(out, vchildren, context, mountAll, hydrating || null != props.dangerouslySetInnerHTML);\n diffAttributes(out, vnode.attributes, props);\n isSvgMode = prevSvgMode;\n return out;\n }\n function innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n var j, c, vchild, child, originalChildren = dom.childNodes, children = [], keyed = {}, keyedLen = 0, min = 0, len = originalChildren.length, childrenLen = 0, vlen = vchildren ? vchildren.length : 0;\n if (0 !== len) for (var i = 0; i < len; i++) {\n var _child = originalChildren[i], props = _child.__preactattr_, key = vlen && props ? _child._component ? _child._component.__k : props.key : null;\n if (null != key) {\n keyedLen++;\n keyed[key] = _child;\n } else if (props || (void 0 !== _child.splitText ? isHydrating ? _child.nodeValue.trim() : !0 : isHydrating)) children[childrenLen++] = _child;\n }\n if (0 !== vlen) for (var i = 0; i < vlen; i++) {\n vchild = vchildren[i];\n child = null;\n var key = vchild.key;\n if (null != key) {\n if (keyedLen && void 0 !== keyed[key]) {\n child = keyed[key];\n keyed[key] = void 0;\n keyedLen--;\n }\n } else if (!child && min < childrenLen) for (j = min; j < childrenLen; j++) if (void 0 !== children[j] && isSameNodeType(c = children[j], vchild, isHydrating)) {\n child = c;\n children[j] = void 0;\n if (j === childrenLen - 1) childrenLen--;\n if (j === min) min++;\n break;\n }\n child = idiff(child, vchild, context, mountAll);\n if (child && child !== dom) if (i >= len) dom.appendChild(child); else if (child !== originalChildren[i]) if (child === originalChildren[i + 1]) removeNode(originalChildren[i]); else dom.insertBefore(child, originalChildren[i] || null);\n }\n if (keyedLen) for (var i in keyed) if (void 0 !== keyed[i]) recollectNodeTree(keyed[i], !1);\n while (min <= childrenLen) if (void 0 !== (child = children[childrenLen--])) recollectNodeTree(child, !1);\n }\n function recollectNodeTree(node, unmountOnly) {\n var component = node._component;\n if (component) unmountComponent(component); else {\n if (null != node.__preactattr_ && node.__preactattr_.ref) node.__preactattr_.ref(null);\n if (unmountOnly === !1 || null == node.__preactattr_) removeNode(node);\n removeChildren(node);\n }\n }\n function removeChildren(node) {\n node = node.lastChild;\n while (node) {\n var next = node.previousSibling;\n recollectNodeTree(node, !0);\n node = next;\n }\n }\n function diffAttributes(dom, attrs, old) {\n var name;\n for (name in old) if ((!attrs || null == attrs[name]) && null != old[name]) setAccessor(dom, name, old[name], old[name] = void 0, isSvgMode);\n for (name in attrs) if (!('children' === name || 'innerHTML' === name || name in old && attrs[name] === ('value' === name || 'checked' === name ? dom[name] : old[name]))) setAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n }\n function collectComponent(component) {\n var name = component.constructor.name;\n (components[name] || (components[name] = [])).push(component);\n }\n function createComponent(Ctor, props, context) {\n var inst, list = components[Ctor.name];\n if (Ctor.prototype && Ctor.prototype.render) {\n inst = new Ctor(props, context);\n Component.call(inst, props, context);\n } else {\n inst = new Component(props, context);\n inst.constructor = Ctor;\n inst.render = doRender;\n }\n if (list) for (var i = list.length; i--; ) if (list[i].constructor === Ctor) {\n inst.__b = list[i].__b;\n list.splice(i, 1);\n break;\n }\n return inst;\n }\n function doRender(props, state, context) {\n return this.constructor(props, context);\n }\n function setComponentProps(component, props, opts, context, mountAll) {\n if (!component.__x) {\n component.__x = !0;\n if (component.__r = props.ref) delete props.ref;\n if (component.__k = props.key) delete props.key;\n if (!component.base || mountAll) {\n if (component.componentWillMount) component.componentWillMount();\n } else if (component.componentWillReceiveProps) component.componentWillReceiveProps(props, context);\n if (context && context !== component.context) {\n if (!component.__c) component.__c = component.context;\n component.context = context;\n }\n if (!component.__p) component.__p = component.props;\n component.props = props;\n component.__x = !1;\n if (0 !== opts) if (1 === opts || options.syncComponentUpdates !== !1 || !component.base) renderComponent(component, 1, mountAll); else enqueueRender(component);\n if (component.__r) component.__r(component);\n }\n }\n function renderComponent(component, opts, mountAll, isChild) {\n if (!component.__x) {\n var rendered, inst, cbase, props = component.props, state = component.state, context = component.context, previousProps = component.__p || props, previousState = component.__s || state, previousContext = component.__c || context, isUpdate = component.base, nextBase = component.__b, initialBase = isUpdate || nextBase, initialChildComponent = component._component, skip = !1;\n if (isUpdate) {\n component.props = previousProps;\n component.state = previousState;\n component.context = previousContext;\n if (2 !== opts && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === !1) skip = !0; else if (component.componentWillUpdate) component.componentWillUpdate(props, state, context);\n component.props = props;\n component.state = state;\n component.context = context;\n }\n component.__p = component.__s = component.__c = component.__b = null;\n component.__d = !1;\n if (!skip) {\n rendered = component.render(props, state, context);\n if (component.getChildContext) context = extend(extend({}, context), component.getChildContext());\n var toUnmount, base, childComponent = rendered && rendered.nodeName;\n if ('function' == typeof childComponent) {\n var childProps = getNodeProps(rendered);\n inst = initialChildComponent;\n if (inst && inst.constructor === childComponent && childProps.key == inst.__k) setComponentProps(inst, childProps, 1, context, !1); else {\n toUnmount = inst;\n component._component = inst = createComponent(childComponent, childProps, context);\n inst.__b = inst.__b || nextBase;\n inst.__u = component;\n setComponentProps(inst, childProps, 0, context, !1);\n renderComponent(inst, 1, mountAll, !0);\n }\n base = inst.base;\n } else {\n cbase = initialBase;\n toUnmount = initialChildComponent;\n if (toUnmount) cbase = component._component = null;\n if (initialBase || 1 === opts) {\n if (cbase) cbase._component = null;\n base = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, !0);\n }\n }\n if (initialBase && base !== initialBase && inst !== initialChildComponent) {\n var baseParent = initialBase.parentNode;\n if (baseParent && base !== baseParent) {\n baseParent.replaceChild(base, initialBase);\n if (!toUnmount) {\n initialBase._component = null;\n recollectNodeTree(initialBase, !1);\n }\n }\n }\n if (toUnmount) unmountComponent(toUnmount);\n component.base = base;\n if (base && !isChild) {\n var componentRef = component, t = component;\n while (t = t.__u) (componentRef = t).base = base;\n base._component = componentRef;\n base._componentConstructor = componentRef.constructor;\n }\n }\n if (!isUpdate || mountAll) mounts.unshift(component); else if (!skip) {\n flushMounts();\n if (component.componentDidUpdate) component.componentDidUpdate(previousProps, previousState, previousContext);\n if (options.afterUpdate) options.afterUpdate(component);\n }\n if (null != component.__h) while (component.__h.length) component.__h.pop().call(component);\n if (!diffLevel && !isChild) flushMounts();\n }\n }\n function buildComponentFromVNode(dom, vnode, context, mountAll) {\n var c = dom && dom._component, originalComponent = c, oldDom = dom, isDirectOwner = c && dom._componentConstructor === vnode.nodeName, isOwner = isDirectOwner, props = getNodeProps(vnode);\n while (c && !isOwner && (c = c.__u)) isOwner = c.constructor === vnode.nodeName;\n if (c && isOwner && (!mountAll || c._component)) {\n setComponentProps(c, props, 3, context, mountAll);\n dom = c.base;\n } else {\n if (originalComponent && !isDirectOwner) {\n unmountComponent(originalComponent);\n dom = oldDom = null;\n }\n c = createComponent(vnode.nodeName, props, context);\n if (dom && !c.__b) {\n c.__b = dom;\n oldDom = null;\n }\n setComponentProps(c, props, 1, context, mountAll);\n dom = c.base;\n if (oldDom && dom !== oldDom) {\n oldDom._component = null;\n recollectNodeTree(oldDom, !1);\n }\n }\n return dom;\n }\n function unmountComponent(component) {\n if (options.beforeUnmount) options.beforeUnmount(component);\n var base = component.base;\n component.__x = !0;\n if (component.componentWillUnmount) component.componentWillUnmount();\n component.base = null;\n var inner = component._component;\n if (inner) unmountComponent(inner); else if (base) {\n if (base.__preactattr_ && base.__preactattr_.ref) base.__preactattr_.ref(null);\n component.__b = base;\n removeNode(base);\n collectComponent(component);\n removeChildren(base);\n }\n if (component.__r) component.__r(null);\n }\n function Component(props, context) {\n this.__d = !0;\n this.context = context;\n this.props = props;\n this.state = this.state || {};\n }\n function render(vnode, parent, merge) {\n return diff(merge, vnode, {}, !1, parent, !1);\n }\n var options = {};\n var stack = [];\n var EMPTY_CHILDREN = [];\n var IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n var items = [];\n var mounts = [];\n var diffLevel = 0;\n var isSvgMode = !1;\n var hydrating = !1;\n var components = {};\n extend(Component.prototype, {\n setState: function(state, callback) {\n var s = this.state;\n if (!this.__s) this.__s = extend({}, s);\n extend(s, 'function' == typeof state ? state(s, this.props) : state);\n if (callback) (this.__h = this.__h || []).push(callback);\n enqueueRender(this);\n },\n forceUpdate: function(callback) {\n if (callback) (this.__h = this.__h || []).push(callback);\n renderComponent(this, 2);\n },\n render: function() {}\n });\n var preact = {\n h: h,\n createElement: h,\n cloneElement: cloneElement,\n Component: Component,\n render: render,\n rerender: rerender,\n options: options\n };\n if (true) module.exports = preact; else self.preact = preact;\n}();\n//# sourceMappingURL=preact.js.map\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function (global, factory) {\n\t true ? module.exports = factory(__webpack_require__(0), __webpack_require__(6)) :\n\ttypeof define === 'function' && define.amd ? define(['preact', 'redux'], factory) :\n\t(global.preactRedux = factory(global.preact,global.Redux));\n}(this, (function (preact,redux) {\n\nvar Children = {\n\tonly: function only(children) {\n\t\treturn children && children[0] || null;\n\t}\n};\n\nfunction proptype() {}\nproptype.isRequired = proptype;\n\nvar PropTypes = {\n\telement: proptype,\n\tfunc: proptype,\n\tshape: function shape() {\n\t\treturn proptype;\n\t},\n\tinstanceOf: function instanceOf() {\n\t\treturn proptype;\n\t}\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n};\n\n\n\n\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\n\n\n\n\n\n\n\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar get = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\nvar objectWithoutProperties = function (obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n};\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n\n\nvar set = function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if (\"value\" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n};\n\n// encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nvar CLEARED = null;\nvar nullListeners = {\n notify: function notify() {}\n};\n\nfunction createListenerCollection() {\n // the current/next pattern is copied from redux's createStore code.\n // TODO: refactor+expose that code to be reusable here?\n var current = [];\n var next = [];\n\n return {\n clear: function clear() {\n next = CLEARED;\n current = CLEARED;\n },\n notify: function notify() {\n var listeners = current = next;\n for (var i = 0; i < listeners.length; i++) {\n listeners[i]();\n }\n },\n subscribe: function subscribe(listener) {\n var isSubscribed = true;\n if (next === current) next = current.slice();\n next.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed || current === CLEARED) return;\n isSubscribed = false;\n\n if (next === current) next = current.slice();\n next.splice(next.indexOf(listener), 1);\n };\n }\n };\n}\n\nvar Subscription = function () {\n function Subscription(store, parentSub) {\n classCallCheck(this, Subscription);\n\n this.store = store;\n this.parentSub = parentSub;\n this.unsubscribe = null;\n this.listeners = nullListeners;\n }\n\n Subscription.prototype.addNestedSub = function addNestedSub(listener) {\n this.trySubscribe();\n return this.listeners.subscribe(listener);\n };\n\n Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() {\n this.listeners.notify();\n };\n\n Subscription.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.unsubscribe);\n };\n\n Subscription.prototype.trySubscribe = function trySubscribe() {\n if (!this.unsubscribe) {\n // this.onStateChange is set by connectAdvanced.initSubscription()\n this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);\n\n this.listeners = createListenerCollection();\n }\n };\n\n Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n this.listeners.clear();\n this.listeners = nullListeners;\n }\n };\n\n return Subscription;\n}();\n\nvar storeShape = PropTypes.shape({\n subscribe: PropTypes.func.isRequired,\n dispatch: PropTypes.func.isRequired,\n getState: PropTypes.func.isRequired\n});\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}\n\nvar didWarnAboutReceivingStore = false;\nfunction warnAboutReceivingStore() {\n if (didWarnAboutReceivingStore) {\n return;\n }\n didWarnAboutReceivingStore = true;\n\n warning('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');\n}\n\nvar Provider = function (_Component) {\n inherits(Provider, _Component);\n\n Provider.prototype.getChildContext = function getChildContext() {\n return { store: this.store, storeSubscription: null };\n };\n\n function Provider(props, context) {\n classCallCheck(this, Provider);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.store = props.store;\n return _this;\n }\n\n Provider.prototype.render = function render() {\n return Children.only(this.props.children);\n };\n\n return Provider;\n}(preact.Component);\n\n{\n Provider.prototype.componentWillReceiveProps = function (nextProps) {\n var store = this.store;\n var nextStore = nextProps.store;\n\n\n if (store !== nextStore) {\n warnAboutReceivingStore();\n }\n };\n}\n\nProvider.childContextTypes = {\n store: storeShape.isRequired,\n storeSubscription: PropTypes.instanceOf(Subscription)\n};\nProvider.displayName = 'Provider';\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\n\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n arguments: true,\n arity: true\n};\n\nvar isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function';\n\nvar index = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n var keys = Object.getOwnPropertyNames(sourceComponent);\n\n /* istanbul ignore else */\n if (isGetOwnPropertySymbolsAvailable) {\n keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent));\n }\n\n for (var i = 0; i < keys.length; ++i) {\n if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) {\n try {\n targetComponent[keys[i]] = sourceComponent[keys[i]];\n } catch (error) {}\n }\n }\n }\n\n return targetComponent;\n};\n\nvar invariant = function () {}\n\nvar hotReloadingVersion = 0;\nfunction connectAdvanced(\n/*\n selectorFactory is a func that is responsible for returning the selector function used to\n compute new props from state, props, and dispatch. For example:\n export default connectAdvanced((dispatch, options) => (state, props) => ({\n thing: state.things[props.thingId],\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\n }))(YourComponent)\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\n props. Do not use connectAdvanced directly without memoizing results between calls to your\n selector, otherwise the Connect component will re-render on every state or props change.\n*/\nselectorFactory) {\n var _contextTypes, _childContextTypes;\n\n var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n var _ref$getDisplayName = _ref.getDisplayName;\n var getDisplayName = _ref$getDisplayName === undefined ? function (name) {\n return 'ConnectAdvanced(' + name + ')';\n } : _ref$getDisplayName;\n var _ref$methodName = _ref.methodName;\n var methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName;\n var _ref$renderCountProp = _ref.renderCountProp;\n var renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp;\n var _ref$shouldHandleStat = _ref.shouldHandleStateChanges;\n var shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat;\n var _ref$storeKey = _ref.storeKey;\n var storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey;\n var _ref$withRef = _ref.withRef;\n var withRef = _ref$withRef === undefined ? false : _ref$withRef;\n var connectOptions = objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']);\n\n var subscriptionKey = storeKey + 'Subscription';\n var version = hotReloadingVersion++;\n\n var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = storeShape, _contextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _contextTypes);\n var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _childContextTypes);\n\n return function wrapWithConnect(WrappedComponent) {\n invariant(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + WrappedComponent));\n\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n withRef: withRef,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent\n });\n\n var Connect = function (_Component) {\n inherits(Connect, _Component);\n\n function Connect(props, context) {\n classCallCheck(this, Connect);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.version = version;\n _this.state = {};\n _this.renderCount = 0;\n _this.store = _this.props[storeKey] || _this.context[storeKey];\n _this.parentSub = props[subscriptionKey] || context[subscriptionKey];\n\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n\n invariant(_this.store, 'Could not find \"' + storeKey + '\" in either the context or ' + ('props of \"' + displayName + '\". ') + 'Either wrap the root component in a <Provider>, ' + ('or explicitly pass \"' + storeKey + '\" as a prop to \"' + displayName + '\".'));\n\n // make sure `getState` is properly bound in order to avoid breaking\n // custom store implementations that rely on the store's context\n _this.getState = _this.store.getState.bind(_this.store);\n\n _this.initSelector();\n _this.initSubscription();\n return _this;\n }\n\n Connect.prototype.getChildContext = function getChildContext() {\n var _ref2;\n\n return _ref2 = {}, _ref2[subscriptionKey] = this.subscription || this.parentSub, _ref2;\n };\n\n Connect.prototype.componentDidMount = function componentDidMount() {\n if (!shouldHandleStateChanges) return;\n\n // componentWillMount fires during server side rendering, but componentDidMount and\n // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.\n // Otherwise, unsubscription would never take place during SSR, causing a memory leak.\n // To handle the case where a child component may have triggered a state change by\n // dispatching an action in its componentWillMount, we have to re-run the select and maybe\n // re-render.\n this.subscription.trySubscribe();\n this.selector.run(this.props);\n if (this.selector.shouldComponentUpdate) this.forceUpdate();\n };\n\n Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n this.selector.run(nextProps);\n };\n\n Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() {\n return this.selector.shouldComponentUpdate;\n };\n\n Connect.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.subscription) this.subscription.tryUnsubscribe();\n // these are just to guard against extra memory leakage if a parent element doesn't\n // dereference this instance properly, such as an async callback that never finishes\n this.subscription = null;\n this.store = null;\n this.parentSub = null;\n this.selector.run = function () {};\n };\n\n Connect.prototype.getWrappedInstance = function getWrappedInstance() {\n invariant(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.'));\n return this.wrappedInstance;\n };\n\n Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) {\n this.wrappedInstance = ref;\n };\n\n Connect.prototype.initSelector = function initSelector() {\n var dispatch = this.store.dispatch;\n var getState = this.getState;\n\n var sourceSelector = selectorFactory(dispatch, selectorFactoryOptions);\n\n // wrap the selector in an object that tracks its results between runs\n var selector = this.selector = {\n shouldComponentUpdate: true,\n props: sourceSelector(getState(), this.props),\n run: function runComponentSelector(props) {\n try {\n var nextProps = sourceSelector(getState(), props);\n if (selector.error || nextProps !== selector.props) {\n selector.shouldComponentUpdate = true;\n selector.props = nextProps;\n selector.error = null;\n }\n } catch (error) {\n selector.shouldComponentUpdate = true;\n selector.error = error;\n }\n }\n };\n };\n\n Connect.prototype.initSubscription = function initSubscription() {\n var _this2 = this;\n\n if (shouldHandleStateChanges) {\n (function () {\n var subscription = _this2.subscription = new Subscription(_this2.store, _this2.parentSub);\n var dummyState = {};\n\n subscription.onStateChange = function onStateChange() {\n this.selector.run(this.props);\n\n if (!this.selector.shouldComponentUpdate) {\n subscription.notifyNestedSubs();\n } else {\n this.componentDidUpdate = function componentDidUpdate() {\n this.componentDidUpdate = undefined;\n subscription.notifyNestedSubs();\n };\n\n this.setState(dummyState);\n }\n }.bind(_this2);\n })();\n }\n };\n\n Connect.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.subscription) && this.subscription.isSubscribed();\n };\n\n Connect.prototype.addExtraProps = function addExtraProps(props) {\n if (!withRef && !renderCountProp) return props;\n // make a shallow copy so that fields added don't leak to the original selector.\n // this is especially important for 'ref' since that's a reference back to the component\n // instance. a singleton memoized selector would then be holding a reference to the\n // instance, preventing the instance from being garbage collected, and that would be bad\n var withExtras = _extends({}, props);\n if (withRef) withExtras.ref = this.setWrappedInstance;\n if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;\n return withExtras;\n };\n\n Connect.prototype.render = function render() {\n var selector = this.selector;\n selector.shouldComponentUpdate = false;\n\n if (selector.error) {\n throw selector.error;\n } else {\n return preact.h(WrappedComponent, this.addExtraProps(selector.props));\n }\n };\n\n return Connect;\n }(preact.Component);\n\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = displayName;\n Connect.childContextTypes = childContextTypes;\n Connect.contextTypes = contextTypes;\n\n\n {\n Connect.prototype.componentWillUpdate = function componentWillUpdate() {\n // We are hot reloading!\n if (this.version !== version) {\n this.version = version;\n this.initSelector();\n\n if (this.subscription) this.subscription.tryUnsubscribe();\n this.initSubscription();\n if (shouldHandleStateChanges) this.subscription.trySubscribe();\n }\n };\n }\n\n return index(Connect, WrappedComponent);\n };\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n\n var countA = 0;\n var countB = 0;\n\n for (var key in a) {\n if (hasOwn.call(a, key) && a[key] !== b[key]) return false;\n countA++;\n }\n\n for (var _key in b) {\n if (hasOwn.call(b, _key)) countB++;\n }\n\n return countA === countB;\n}\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetPrototype = Object.getPrototypeOf;\n\n/**\n * Gets the `[[Prototype]]` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {null|Object} Returns the `[[Prototype]]`.\n */\nfunction getPrototype(value) {\n return nativeGetPrototype(Object(value));\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 * 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 === 'undefined' ? 'undefined' : _typeof(value)) == 'object';\n}\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = Function.prototype.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/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\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,\n * 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) || 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' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;\n}\n\nfunction verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.');\n }\n}\n\nfunction wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n}\n\n// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n// \n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\nfunction getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\n\n// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n// \n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n// \n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n// \n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n// \nfunction wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}\n\nfunction whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\n\nfunction whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return { dispatch: dispatch };\n }) : undefined;\n}\n\nfunction whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && (typeof mapDispatchToProps === 'undefined' ? 'undefined' : _typeof(mapDispatchToProps)) === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return redux.bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\n\nvar defaultMapDispatchToPropsFactories = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];\n\nfunction whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\n\nfunction whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\n\nvar defaultMapStateToPropsFactories = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];\n\nfunction defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, stateProps, dispatchProps);\n}\n\nfunction wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName;\n var pure = _ref.pure;\n var areMergedPropsEqual = _ref.areMergedPropsEqual;\n\n var hasRunOnce = false;\n var mergedProps = void 0;\n\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n\n verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\n\nfunction whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\n\nfunction whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\n\nvar defaultMergePropsFactories = [whenMergePropsIsFunction, whenMergePropsIsOmitted];\n\nfunction verify(selector, methodName, displayName) {\n if (!selector) {\n throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.');\n } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {\n if (!selector.hasOwnProperty('dependsOnOwnProps')) {\n warning('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.');\n }\n }\n}\n\nfunction verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {\n verify(mapStateToProps, 'mapStateToProps', displayName);\n verify(mapDispatchToProps, 'mapDispatchToProps', displayName);\n verify(mergeProps, 'mergeProps', displayName);\n}\n\nfunction impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\n\nfunction pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual;\n var areOwnPropsEqual = _ref.areOwnPropsEqual;\n var areStatePropsEqual = _ref.areStatePropsEqual;\n\n var hasRunAtLeastOnce = false;\n var state = void 0;\n var ownProps = void 0;\n var stateProps = void 0;\n var dispatchProps = void 0;\n var mergedProps = void 0;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state);\n state = nextState;\n ownProps = nextOwnProps;\n\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n}\n\n// TODO: Add more comments\n\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nfunction finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps;\n var initMapDispatchToProps = _ref2.initMapDispatchToProps;\n var initMergeProps = _ref2.initMergeProps;\n var options = objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}\n\n/*\n connect is a facade over connectAdvanced. It turns its args into a compatible\n selectorFactory, which has the signature:\n\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\n \n connect passes its args to connectAdvanced as options, which will in turn pass them to\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\n\n selectorFactory returns a final props selector from its mapStateToProps,\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\n mergePropsFactories, and pure args.\n\n The resulting final props selector is called by the Connect component instance whenever\n it receives new props or store state.\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error('Invalid value of type ' + (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.');\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n}\n\n// createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\nfunction createConnect() {\n var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var _ref$connectHOC = _ref.connectHOC;\n var connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC;\n var _ref$mapStateToPropsF = _ref.mapStateToPropsFactories;\n var mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF;\n var _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories;\n var mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro;\n var _ref$mergePropsFactor = _ref.mergePropsFactories;\n var mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor;\n var _ref$selectorFactory = _ref.selectorFactory;\n var selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];\n\n var _ref2$pure = _ref2.pure;\n var pure = _ref2$pure === undefined ? true : _ref2$pure;\n var _ref2$areStatesEqual = _ref2.areStatesEqual;\n var areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual;\n var _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual;\n var areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua;\n var _ref2$areStatePropsEq = _ref2.areStatePropsEqual;\n var areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq;\n var _ref2$areMergedPropsE = _ref2.areMergedPropsEqual;\n var areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE;\n var extraOptions = objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}\n\nvar connect$1 = createConnect();\n\n\n\nvar lib$1 = {\n\tProvider: Provider,\n\tconnect: connect$1,\n\tconnectAdvanced: connectAdvanced\n};\n\nreturn lib$1;\n\n})));\n//# sourceMappingURL=preact-redux.js.map\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\n\nvar _playkitJs = __webpack_require__(48);\n\nvar _playkitJs2 = _interopRequireDefault(_playkitJs);\n\nvar _logger = __webpack_require__(49);\n\nvar _logger2 = _interopRequireDefault(_logger);\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\nvar BaseComponent = function (_Component) {\n _inherits(BaseComponent, _Component);\n\n function BaseComponent() {\n var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { config: {} };\n\n _classCallCheck(this, BaseComponent);\n\n var _this = _possibleConstructorReturn(this, (BaseComponent.__proto__ || Object.getPrototypeOf(BaseComponent)).call(this));\n\n _this.name = obj.name;\n _this.player = obj.player;\n _this.config = obj.config;\n _this.logger = _logger2.default.getLogger('UI ' + _this.name);\n _this.logger.debug('Initialized');\n return _this;\n }\n\n _createClass(BaseComponent, [{\n key: 'getConfig',\n value: function getConfig(attr) {\n if (attr) {\n return this.config[attr];\n }\n return this.config;\n }\n }, {\n key: 'defaultConfig',\n get: function get() {\n return {};\n }\n }]);\n\n return BaseComponent;\n}(_preact.Component);\n\nexports.default = BaseComponent;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports.bindActions = bindActions;\n\nvar _redux = __webpack_require__(6);\n\nfunction bindActions(actions) {\n\treturn function (dispatch) {\n\t\treturn _extends({}, (0, _redux.bindActionCreators)(actions, dispatch));\n\t};\n}\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\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\nvar Icon = function (_Component) {\n _inherits(Icon, _Component);\n\n function Icon() {\n _classCallCheck(this, Icon);\n\n return _possibleConstructorReturn(this, (Icon.__proto__ || Object.getPrototypeOf(Icon)).apply(this, arguments));\n }\n\n _createClass(Icon, [{\n key: 'render',\n value: function render(props) {\n switch (props.type) {\n case 'maximize':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-maximize', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M800 269.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z' }),\n (0, _preact.h)('path', { d: 'M224 754.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z' })\n );\n case 'minimize':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-minimize', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M672 306.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z' }),\n (0, _preact.h)('path', { d: 'M352 717.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z' })\n );\n\n case 'play':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-play', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M796.806 461.202c44.919 28.075 44.739 73.706 0 101.668l-459.472 287.171c-44.919 28.075-81.334 7.915-81.334-45.305v-585.4c0-53.096 36.595-73.266 81.334-45.305l459.472 287.171z' })\n );\n\n case 'pause':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-pause', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M256 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314zM640 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314z' })\n );\n\n case 'volume-base':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon volume-base', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M224 352l234.504-156.336c29.545-19.697 53.496-7.194 53.496 28.053v576.566c0 35.19-24.059 47.677-53.496 28.053l-234.504-156.336h-127.906c-17.725 0-32.094-14.581-32.094-31.853v-256.295c0-17.592 14.012-31.853 32.094-31.853h127.906zM288 637.748l160 106.667v-464.83l-160 106.667v251.496zM128 416v192h96v-192h-96z' })\n );\n\n case 'volume-waves':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon volume-waves', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M802.017 837.177c82.359-86.627 129.183-201.774 129.183-324.26 0-123.976-47.976-240.409-132.127-327.329-12.293-12.697-32.552-13.025-45.249-0.732s-13.025 32.552-0.732 45.249c72.692 75.084 114.109 175.597 114.109 282.812 0 105.928-40.422 205.331-111.566 280.162-12.177 12.808-11.666 33.063 1.143 45.24s33.063 11.666 45.24-1.143z' }),\n (0, _preact.h)('path', { d: 'M667.436 743.221c67.761-60.884 107.273-147.888 107.273-241.233 0-87.318-34.552-169.203-94.836-229.446-12.501-12.493-32.762-12.486-45.255 0.015s-12.486 32.762 0.015 45.255c48.375 48.342 76.075 113.989 76.075 184.176 0 75.021-31.679 144.776-86.048 193.627-13.146 11.812-14.227 32.044-2.416 45.19s32.044 14.227 45.19 2.416z' })\n );\n\n case 'volume-mute':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon volume-mute', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M768 466.745l-67.986-67.986c-12.213-12.213-32.654-12.393-45.151 0.104-12.584 12.584-12.543 32.711-0.104 45.151l67.986 67.986-67.986 67.986c-12.213 12.213-12.393 32.654 0.104 45.151 12.584 12.584 32.711 12.543 45.151 0.104l67.986-67.986 67.986 67.986c12.213 12.213 32.654 12.393 45.151-0.104 12.584-12.584 12.543-32.711 0.104-45.151l-67.986-67.986 67.986-67.986c12.213-12.213 12.393-32.654-0.104-45.151-12.584-12.584-32.711-12.543-45.151-0.104l-67.986 67.986z' })\n );\n\n case 'close':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-close', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M573.162 512l214.269-214.269c16.772-16.772 16.688-44.071-0.202-60.96-17.007-17.007-44.182-16.98-60.96-0.202l-214.269 214.269-214.269-214.269c-16.772-16.772-44.071-16.688-60.96 0.202-17.007 17.007-16.98 44.182-0.202 60.96l214.269 214.269-214.269 214.269c-16.772 16.772-16.688 44.071 0.202 60.96 17.007 17.007 44.182 16.98 60.96 0.202l214.269-214.269 214.269 214.269c16.772 16.772 44.071 16.688 60.96-0.202 17.007-17.007 16.98-44.182 0.202-60.96l-214.269-214.269z' })\n );\n\n case 'share':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-share', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.129-5.295 0-58.91 47.756-106.667 106.667-106.667s106.667 47.756 106.667 106.667c0 58.91-47.756 106.667-106.667 106.667-33.894 0-64.095-15.808-83.633-40.454l-236.467 142.445c-0.132-3.064-0.394-6.095-0.779-9.087l7.271-12.835-0.117 53.333-7.183-12.743c0.399-3.046 0.67-6.131 0.806-9.252l236.467 142.383c19.538-24.648 49.741-40.457 83.636-40.457 58.91 0 106.667 47.756 106.667 106.667s-47.756 106.667-106.667 106.667c-58.91 0-106.667-47.756-106.667-106.667 0-1.775 0.043-3.539 0.129-5.293l-236.19-142.216c-19.528 24.867-49.868 40.841-83.939 40.841-58.91 0-106.667-47.756-106.667-106.667s47.756-106.667 106.667-106.667c34.091 0 64.447 15.993 83.974 40.886zM234.667 554.667c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 341.333c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 768c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667z' })\n );\n\n case 'settings':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon icon-share', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M829.945 549.126c2.784-24.116 2.784-48.445 0.269-70.702-1.182-6.772-7.090-11.696-13.674-11.641-33.039 0.582-62.975-19.389-75.126-50.118s-3.971-65.772 20.504-87.92c4.293-3.894 4.818-10.455 1.003-15.228-14.831-18.927-31.796-36.079-50.521-51.087-4.614-3.687-11.301-3.148-16.127 2.145-15.732 16.059-37.322 25.023-59.382 24.831-9.828 0.044-19.574-1.802-29.307-5.686-30.997-13.082-50.429-44.232-48.535-78.046 0.365-5.803-3.87-10.878-9.583-11.551-23.919-2.769-48.074-2.831-71.958-0.192-5.836 0.654-10.191 5.68-10.009 11.47 1.121 33.146-18.329 63.547-49.925 76.834-8.987 3.423-18.538 5.129-27.498 5.028-22.472 0.224-44.067-8.707-60.526-25.487-2.197-2.386-5.29-3.748-8.24-3.758-2.663 0.016-5.248 0.905-7.105 2.334-19.136 15.052-36.496 32.233-51.558 50.977-3.729 4.732-3.187 11.536 1.058 15.449 24.89 22.573 32.935 58.34 19.426 90.928-14.22 29.886-44.875 48.43-77.941 47.151-5.576-0.215-10.363 3.934-11.003 10.013-2.916 24.025-2.916 48.315-0.231 70.764 1.178 6.84 7.155 11.808 14.518 11.713l2.428 0.007c31.565 0.659 59.701 20.063 71.6 49.499 12.239 30.769 4.278 65.898-20.252 88.586-4.217 3.829-4.736 10.275-0.976 14.991 14.777 18.932 31.665 36.115 50.227 51.128 4.694 3.762 11.505 3.223 16.349-2.081 15.725-16.101 37.337-25.092 59.378-24.895 9.894-0.057 19.705 1.819 29.5 5.78 30.753 13.169 50.063 44.084 48.378 77.965-0.373 5.795 3.857 10.867 9.602 11.539 23.908 2.78 48.053 2.842 71.923 0.192 5.851-0.659 10.215-5.702 10.027-11.562-1.088-33.118 18.371-63.473 49.584-76.583 9.014-3.552 18.622-5.354 27.841-5.307 22.555-0.225 44.218 8.804 60.434 25.505 2.224 2.395 5.343 3.76 8.371 3.769 2.474-0.012 4.874-0.847 6.896-2.43 19.227-14.971 36.653-32.121 51.726-50.848 3.737-4.743 3.194-11.563-0.941-15.379-24.391-21.907-32.789-56.564-21.134-87.207s40.964-50.957 73.904-51.116h5.704c5.586-0.028 10.269-4.227 10.905-9.777zM893.526 556.438c-4.321 37.715-36.171 66.271-74.323 66.464h-5.711c-6.33 0.031-11.99 3.953-14.24 9.87s-0.629 12.609 4.385 17.116c29.020 26.748 32.567 71.325 7.936 102.582-18.378 22.837-39.342 43.468-62.397 61.42-13.128 10.284-29.303 15.909-46.22 15.991-21.004-0.056-41.043-8.825-54.839-23.692-3.514-3.616-8.356-5.634-13.867-5.583-1.555-0.007-3.097 0.282-3.877 0.581-6.088 2.559-9.967 8.609-9.749 15.235 1.257 39.227-27.828 72.841-66.88 77.241-28.725 3.189-57.719 3.114-86.45-0.227-39.585-4.631-68.615-39.444-66.083-78.749 0.331-6.679-3.529-12.859-9.057-15.234-1.449-0.585-2.998-0.881-5.025-0.873-5.074-0.045-9.947 1.982-12.693 4.763-26.775 29.494-71.875 33.067-103.071 8.066-22.458-18.164-42.771-38.831-60.335-61.337-24.602-30.847-21.012-75.5 7.982-101.818 4.881-4.515 6.479-11.568 4.088-17.58-2.239-5.538-7.562-9.209-12.866-9.327-39.748 0.506-72.828-26.991-79.581-66.425-3.538-29.147-3.538-58.616-0.060-87.234 4.085-39.084 37.791-68.296 77.064-66.784 7.502 0.29 14.456-3.916 17.001-9.164 2.519-6.098 0.94-13.122-4.133-17.724-29.022-26.738-32.57-71.311-7.956-102.538 18.292-22.765 39.115-43.375 62.322-61.626 13.199-10.169 29.368-15.731 46.323-15.833 21.063 0.065 41.146 8.908 54.704 23.656 3.559 3.623 8.44 5.642 14.175 5.592 1.605 0.017 3.199-0.268 3.668-0.426 6.11-2.574 9.998-8.651 9.771-15.356-1.228-39.209 27.864-72.786 66.897-77.161 28.715-3.173 57.697-3.098 86.456 0.231 39.539 4.653 68.54 39.409 66.051 78.92-0.369 6.596 3.446 12.713 8.931 15.035 1.507 0.6 3.114 0.905 5.156 0.898 5.087 0.044 9.973-1.985 12.671-4.704 26.66-29.444 71.625-33.068 102.694-8.244 22.604 18.117 43.043 38.781 60.715 61.337 24.728 30.927 21.142 75.751-8.215 102.378-4.724 4.275-6.301 11.031-3.958 16.955s8.114 9.775 14.774 9.659c38.18-0.325 70.992 27.018 77.822 66.463 3.343 28.966 3.343 58.22 0 87.185zM511.951 597.037c47.144-0.118 85.24-38.367 85.169-85.511 0-34.617-20.872-65.819-52.867-79.034s-68.802-5.836-93.231 18.69c-24.429 24.527-31.66 61.363-18.317 93.305s44.628 52.688 79.245 52.55zM512.158 661.036c-60.477 0.242-115.178-36.032-138.507-91.881s-10.686-120.254 32.026-163.138c42.712-42.884 107.066-55.785 163.008-32.679s92.434 77.661 92.434 138.139c0.124 82.417-66.545 149.353-148.962 149.559z' })\n );\n\n case 'check':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon check-icon', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M342.481 563.894c-12.577-12.416-32.838-12.285-45.254 0.292s-12.285 32.838 0.292 45.254l118.857 117.333c13.275 13.105 34.901 12.123 46.933-2.131l297.143-352c11.4-13.505 9.694-33.694-3.811-45.094s-33.694-9.694-45.094 3.811l-274.828 325.566-94.238-93.030z' })\n );\n case 'language':\n return (0, _preact.h)(\n 'svg',\n { className: 'icon language-icon', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M625.773 808.031c29.752-39.944 63.443-97.069 83.311-168.977 41.798-3.715 74.872-8.022 98.271-11.57-32.456 82.71-98.638 148.558-181.582 180.547zM216.562 627.283c23.516 3.506 56.799 7.797 98.279 11.528 19.868 72.017 53.601 129.224 83.378 169.219-83.002-32.014-149.226-97.945-181.657-180.747zM400.147 215.201c-29.835 40.32-64.161 98.037-84.572 169.695-42.123 3.731-75.423 8.072-98.938 11.629 32.698-83.353 99.656-149.61 183.51-181.323zM807.438 396.725c-23.641-3.523-57.158-7.847-98.947-11.587-20.402-71.766-54.778-129.567-84.639-169.937 83.912 31.73 150.912 98.070 183.585 181.523zM720.095 436.644c48.952 4.817 84.472 10.209 102.995 13.331 3.99 20.068 6.127 40.796 6.127 62.024 0 21.262-2.137 42.031-6.152 62.141-18.248 3.172-53.376 8.615-102.753 13.448 3.84-23.908 6.069-49.102 6.069-75.59 0-26.296-2.304-51.431-6.286-75.356zM537.043 597.206v-170.396c48.576 0.551 92.653 2.646 131.178 5.426 5.050 25.119 8.072 51.74 8.072 79.763 0 28.216-2.913 54.87-7.789 79.939-38.283 2.713-82.343 4.742-131.462 5.267zM486.957 195.859v180.856c-43.175 0.442-82.443 1.995-117.429 4.149 31.939-95.382 89.99-161.656 112.237-184.612 1.72-0.159 3.464-0.259 5.192-0.392zM542.286 196.26c22.297 22.906 80.456 89.080 112.345 184.771-35.261-2.229-74.646-3.848-117.587-4.307v-180.864c1.745 0.142 3.506 0.234 5.242 0.401zM347.706 512c0-28.074 3.047-54.762 8.156-79.955 38.191-2.696 82.134-4.708 131.094-5.234v170.387c-48.71-0.551-92.895-2.655-131.495-5.443-4.858-25.018-7.755-51.606-7.755-79.755zM194.783 512c0-21.262 2.137-42.031 6.144-62.125 18.282-3.181 53.501-8.64 103.012-13.482-4.007 24-6.319 49.219-6.319 75.606 0 26.396 2.221 51.506 6.027 75.339-48.826-4.808-84.246-10.184-102.737-13.306-3.99-20.068-6.127-40.804-6.127-62.033zM481.338 827.706c-22.389-22.314-81.016-87.469-112.662-184.779 35.437 2.262 75.047 3.898 118.28 4.366v180.839c-1.87-0.142-3.757-0.25-5.618-0.426zM542.653 827.706c-1.862 0.175-3.74 0.284-5.61 0.426v-180.839c43.509-0.442 83.044-2.012 118.222-4.199-31.672 97.244-90.265 162.349-112.612 184.612zM512 128c-211.734 0-384 172.257-384 384 0 211.734 172.266 384 384 384s384-172.266 384-384c0-211.743-172.266-384-384-384z' })\n );\n\n default:\n break;\n }\n }\n }]);\n\n return Icon;\n}(_preact.Component);\n\nexports.default = Icon;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\nfunction n(n){return n&&\"object\"==typeof n&&\"default\"in n?n.default:n}function t(n){return null!==n&&void 0!==n}function r(n,t){var o=e({},n);for(var i in t)t.hasOwnProperty(i)&&(o[i]=n[i]&&t[i]&&\"object\"==typeof n[i]&&\"object\"==typeof t[i]?r(n[i],t[i]):n[i]||t[i]);return o}function e(n,t){for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function o(n){if(n=n||{},\"string\"==typeof n&&(n=n.split(\",\")),\"join\"in n){for(var t={},r=0;r<n.length;r++){var e=n[r].trim();e&&(t[e.split(\".\").pop()]=e)}return t}return n}function i(n,t){return v=t||h,n&&n.replace(/\\{\\{([\\w.-]+)\\}\\}/g,u)}function u(n,t){for(var r=t.split(\".\"),e=v,o=0;o<r.length;o++)if(null==(e=e[r[o]]))return\"\";return\"string\"==typeof e&&e.match(/\\{\\{/)&&(e=i(e,v)),e}function c(n,r,e,o,u,c){r&&(n=r+\".\"+n);var a=e&&f(e,n);return(u||0===u)&&a&&\"object\"==typeof a&&(a=a.splice?a[u]||a[0]:0===u&&t(a.none)?a.none:1===u&&t(a.one||a.singular)?a.one||a.singular:a.some||a.many||a.plural||a.other||a),a&&i(a,o)||c||null}function a(n,t,r){var i={};t=t||{},n=o(n);for(var u in n)if(n.hasOwnProperty(u)&&n[u]){var a=n[u];r||\"string\"!=typeof a?a.nodeName===g&&(a=e({fallback:a.children&&a.children[0]},a.attributes),i[u]=c(a.id,t.scope,t.dictionary,a.fields,a.plural,a.fallback)):i[u]=c(a,t.scope,t.dictionary)}return i}var l=__webpack_require__(0),f=n(__webpack_require__(44)),p=/[?&#]intl=show/,s=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getChildContext=function(){var n=this.props,t=n.scope,o=n.definition,i=n.mark,u=e({},this.context.intl||{});return t&&(u.scope=t),o&&(u.dictionary=r(u.dictionary||{},o)),(i||\"undefined\"!=typeof location&&String(location).match(p))&&(u.mark=!0),{intl:u}},t.prototype.render=function(n){var t=n.children;return t&&t[0]||null},t}(l.Component),d=function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];if(n.length>1){return y(n[0],n[1])}var r=n[0];return function(n){return y(n,r)}},y=function(n,t){return function(r){return l.h(s,t||{},l.h(n,r))}},h={},v,g=function(n,t){var r=n.id,e=n.children,o=n.plural,i=n.fields,u=t.intl,a=e&&e[0],p=c(r,u&&u.scope,u&&u.dictionary,i,o,a);if(u&&u.mark){var s=\"dictionary\"+(u&&u.scope?\".\"+u.scope:\"\")+\".\"+r;return l.h(\"mark\",{style:\"background: \"+(p?f(u,s)?\"rgba(119,231,117,.5)\":\"rgba(229,226,41,.5)\":\"rgba(228,147,51,.5)\"),title:r},p)}return p},b=function(n,t){var r=n.children,e=t.intl,o=r&&r[0];return o&&l.cloneElement(o,a(o.attributes,e,!0))},m=function(n){return function(t){return function(r,e){var o=\"function\"==typeof n?n(r):n,i=a(o,e.intl);return l.h(t,assign({},r,i))}}};d.intl=d,d.IntlProvider=s,d.Text=g,d.Localizer=b,d.withText=m,module.exports=d;\n//# sourceMappingURL=preact-i18n.js.map\n\n/***/ }),\n/* 6 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(13);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(41);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(42);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(43);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(7);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"createStore\", function() { return __WEBPACK_IMPORTED_MODULE_0__createStore__[\"b\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"combineReducers\", function() { return __WEBPACK_IMPORTED_MODULE_1__combineReducers__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"bindActionCreators\", function() { return __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"applyMiddleware\", function() { return __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"compose\", function() { return __WEBPACK_IMPORTED_MODULE_4__compose__[\"a\"]; });\n\n\n\n\n\n\n\n/*\n* This is a dummy function to check if the function name has been altered by minification.\n* If the function has been minified and NODE_ENV !== 'production', warn the user.\n*/\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n __WEBPACK_IMPORTED_MODULE_5__utils_warning__[\"a\" /* default */]('You are currently using minified code outside of NODE_ENV === \\'production\\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');\n}\n\n\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(12)))\n\n/***/ }),\n/* 7 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = warning;\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _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\nvar types = exports.types = {\n ADD_PLAYER_CLASS: 'shell/ADD_PLAYER_CLASS',\n REMOVE_PLAYER_CLASS: 'shell/REMOVE_PLAYER_CLASS',\n UPDATE_IS_MOBILE: 'shell/UPDATE_IS_MOBILE'\n};\n\nvar initialState = exports.initialState = {\n playerClasses: []\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.ADD_PLAYER_CLASS:\n return _extends({}, state, {\n playerClasses: [].concat(_toConsumableArray(state.playerClasses), [action.className])\n });\n\n case types.REMOVE_PLAYER_CLASS:\n return _extends({}, state, {\n playerClasses: state.playerClasses.filter(function (c) {\n return c !== action.className;\n })\n });\n\n case types.UPDATE_IS_MOBILE:\n return _extends({}, state, {\n isMobile: action.isMobile\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n addPlayerClass: function addPlayerClass(className) {\n return { type: types.ADD_PLAYER_CLASS, className: className };\n },\n removePlayerClass: function removePlayerClass(className) {\n return { type: types.REMOVE_PLAYER_CLASS, className: className };\n },\n updateIsMobile: function updateIsMobile(isMobile) {\n return { type: types.UPDATE_IS_MOBILE, isMobile: isMobile };\n }\n};\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n TOGGLE_PLAY: 'play-pause/TOGGLE_PLAY'\n};\n\nvar initialState = exports.initialState = {\n isPlaying: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.TOGGLE_PLAY:\n return _extends({}, state, {\n isPlaying: action.isPlaying\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n toggleIsPlaying: function toggleIsPlaying(isPlaying) {\n return { type: types.TOGGLE_PLAY, isPlaying: isPlaying };\n }\n};\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n TOGGLE_SHARE_OVERLAY: 'share/TOGGLE_SHARE_OVERLAY'\n};\n\nvar initialState = exports.initialState = {\n overlayOpen: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.TOGGLE_SHARE_OVERLAY:\n return _extends({}, state, {\n overlayOpen: action.show\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n toggleShareOverlay: function toggleShareOverlay(show) {\n return { type: types.TOGGLE_SHARE_OVERLAY, show: show };\n }\n};\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n TOGGLE_CVAA_OVERLAY: 'share/TOGGLE_CVAA_OVERLAY'\n};\n\nvar initialState = exports.initialState = {\n overlayOpen: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.TOGGLE_CVAA_OVERLAY:\n return _extends({}, state, {\n overlayOpen: action.show\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n toggleCVAAOverlay: function toggleCVAAOverlay(show) {\n return { type: types.TOGGLE_CVAA_OVERLAY, show: show };\n }\n};\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports) {\n\n// 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;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\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/* 13 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ActionTypes; });\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = createStore;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(14);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(37);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_symbol_observable__);\n\n\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar ActionTypes = {\n INIT: '@@redux/INIT'\n\n /**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n};function createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n function getState() {\n return currentState;\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected listener to be a function.');\n }\n\n var isSubscribed = true;\n\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n isSubscribed = false;\n\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action) {\n if (!__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__[\"a\" /* default */](action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer;\n dispatch({ type: ActionTypes.INIT });\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object') {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return { unsubscribe: unsubscribe };\n }\n }, _ref[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = function () {\n return this;\n }, _ref;\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch({ type: ActionTypes.INIT });\n\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = observable, _ref2;\n}\n\n/***/ }),\n/* 14 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(29);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(34);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(36);\n\n\n\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\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 * 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 (!__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__[\"a\" /* default */](value) || __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__[\"a\" /* default */](value) != objectTag) {\n return false;\n }\n var proto = __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__[\"a\" /* default */](value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isPlainObject);\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(30);\n\n\n/** Built-in value references. */\nvar Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__[\"a\" /* default */].Symbol;\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (Symbol);\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports) {\n\nvar g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = compose;\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nfunction compose() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(undefined, arguments));\n };\n });\n}\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n UPDATE_PLAYER_STATE: 'engine/UPDATE_PLAYER_STATE',\n UPDATE_IS_PLAYING: 'engine/UPDATE_IS_PLAYING',\n UPDATE_CURRENT_TIME: 'engine/UPDATE_CURRENT_TIME',\n UPDATE_DURATION: 'engine/UPDATE_DURATION',\n UPDATE_VOLUME: 'engine/UPDATE_VOLUME',\n UPDATE_MUTED: 'engine/UPDATE_MUTED',\n UPDATE_METADATA_LOADING_STATUS: 'engine/UPDATE_METADATA_LOADING_STATUS',\n UPDATE_AUDIO_TRACKS: 'engine/UPDATE_AUDIO_TRACKS',\n UPDATE_VIDEO_TRACKS: 'engine/UPDATE_VIDEO_TRACKS',\n UPDATE_TEXT_TRACKS: 'engine/UPDATE_TEXT_TRACKS'\n};\n\nvar initialState = exports.initialState = {\n isPlaying: false,\n metadataLoaded: false,\n playerState: {\n previousState: '',\n currentState: ''\n },\n currentTime: 0,\n duration: 0,\n volume: 1,\n muted: false,\n videoTracks: [],\n audioTracks: [],\n textTracks: []\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.UPDATE_PLAYER_STATE:\n return _extends({}, state, {\n playerState: action.playerState\n });\n\n case types.UPDATE_IS_PLAYING:\n return _extends({}, state, {\n isPlaying: action.isPlaying\n });\n\n case types.UPDATE_CURRENT_TIME:\n return _extends({}, state, {\n currentTime: action.currentTime\n });\n\n case types.UPDATE_DURATION:\n return _extends({}, state, {\n duration: action.duration\n });\n\n case types.UPDATE_VOLUME:\n return _extends({}, state, {\n volume: action.volume\n });\n\n case types.UPDATE_MUTED:\n return _extends({}, state, {\n muted: action.muted\n });\n\n case types.UPDATE_METADATA_LOADING_STATUS:\n return _extends({}, state, {\n metadataLoaded: action.metadataLoaded\n });\n\n case types.UPDATE_AUDIO_TRACKS:\n return _extends({}, state, {\n audioTracks: action.tracks\n });\n\n case types.UPDATE_VIDEO_TRACKS:\n return _extends({}, state, {\n videoTracks: action.tracks\n });\n\n case types.UPDATE_TEXT_TRACKS:\n return _extends({}, state, {\n textTracks: action.tracks\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n updatePlayerState: function updatePlayerState(prevoiusState, currentState) {\n return { type: types.UPDATE_PLAYER_STATE, playerState: { prevoiusState: prevoiusState, currentState: currentState } };\n },\n updateIsPlaying: function updateIsPlaying(isPlaying) {\n return { type: types.UPDATE_IS_PLAYING, isPlaying: isPlaying };\n },\n updateCurrentTime: function updateCurrentTime(currentTime) {\n return { type: types.UPDATE_CURRENT_TIME, currentTime: currentTime };\n },\n updateDuration: function updateDuration(duration) {\n return { type: types.UPDATE_DURATION, duration: duration };\n },\n updateVolume: function updateVolume(volume) {\n return { type: types.UPDATE_VOLUME, volume: volume };\n },\n updateMuted: function updateMuted(muted) {\n return { type: types.UPDATE_MUTED, muted: muted };\n },\n updateMetadataLoadingStatus: function updateMetadataLoadingStatus(metadataLoaded) {\n return { type: types.UPDATE_METADATA_LOADING_STATUS, metadataLoaded: metadataLoaded };\n },\n updateAudioTracks: function updateAudioTracks(tracks) {\n return { type: types.UPDATE_AUDIO_TRACKS, tracks: tracks };\n },\n updateVideoTracks: function updateVideoTracks(tracks) {\n return { type: types.UPDATE_VIDEO_TRACKS, tracks: tracks };\n },\n updateTextTracks: function updateTextTracks(tracks) {\n return { type: types.UPDATE_TEXT_TRACKS, tracks: tracks };\n }\n};\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n UPDATE_SEEKBAR_DRAGGING_STATUS: 'seekbar/UPDATE_SEEKBAR_DRAGGING_STATUS',\n UPDATE_CURRENT_TIME: 'seekbar/UPDATE_CURRENT_TIME',\n UPDATE_DURATION: 'seekbar/UPDATE_DURATION'\n};\n\nvar initialState = exports.initialState = {\n currentTime: 0,\n duration: 0,\n draggingActive: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.UPDATE_SEEKBAR_DRAGGING_STATUS:\n return _extends({}, state, {\n draggingActive: action.draggingActive\n });\n\n case types.UPDATE_CURRENT_TIME:\n return _extends({}, state, {\n currentTime: action.currentTime\n });\n\n case types.UPDATE_DURATION:\n return _extends({}, state, {\n duration: action.duration\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n updateSeekbarDraggingStatus: function updateSeekbarDraggingStatus(draggingActive) {\n return { type: types.UPDATE_SEEKBAR_DRAGGING_STATUS, draggingActive: draggingActive };\n },\n updateDuration: function updateDuration(duration) {\n return { type: types.UPDATE_DURATION, duration: duration };\n },\n updateCurrentTime: function updateCurrentTime(currentTime) {\n return { type: types.UPDATE_CURRENT_TIME, currentTime: currentTime };\n }\n};\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n UPDATE_VOLUME: 'volume/UPDATE_VOLUME',\n UPDATE_VOLUME_DRAGGING_STATUS: 'volume/UPDATE_VOLUME_DRAGGING_STATUS',\n UPDATE_MUTED: 'volume/UPDATE_MUTED'\n};\n\nvar initialState = exports.initialState = {\n draggingActive: false,\n volume: 1,\n muted: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.UPDATE_VOLUME:\n return _extends({}, state, {\n volume: action.volume\n });\n\n case types.UPDATE_VOLUME_DRAGGING_STATUS:\n return _extends({}, state, {\n draggingActive: action.draggingActive\n });\n\n case types.UPDATE_MUTED:\n return _extends({}, state, {\n muted: action.muted\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n updateVolume: function updateVolume(volume) {\n return { type: types.UPDATE_VOLUME, volume: volume };\n },\n updateVolumeDraggingStatus: function updateVolumeDraggingStatus(draggingActive) {\n return { type: types.UPDATE_VOLUME_DRAGGING_STATUS, draggingActive: draggingActive };\n },\n updateMuted: function updateMuted(muted) {\n return { type: types.UPDATE_MUTED, muted: muted };\n }\n};\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n UPDATE_FULLSCREEN: 'fullscreen/UPDATE_FULLSCREEN'\n};\n\nvar initialState = exports.initialState = {\n fullscreen: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.UPDATE_FULLSCREEN:\n return _extends({}, state, {\n fullscreen: action.fullscreen\n });\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n updateFullscreen: function updateFullscreen(fullscreen) {\n return { type: types.UPDATE_FULLSCREEN, fullscreen: fullscreen };\n }\n};\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n UPDATE_LOADING_SPINNER_STATE: 'loading/UPDATE_LOADING_SPINNER_STATE'\n};\n\nvar initialState = exports.initialState = {\n showLoadingSpinner: false\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.UPDATE_LOADING_SPINNER_STATE:\n return _extends({}, state, {\n show: action.show\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n updateLoadingSpinnerState: function updateLoadingSpinnerState(show) {\n return { type: types.UPDATE_LOADING_SPINNER_STATE, show: show };\n }\n};\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar types = exports.types = {\n UPDATE_QUALITY: 'settings/UPDATE_QUALITY',\n UPDATE_SPEED: 'settings/UPDATE_SPEED'\n};\n\nvar initialState = exports.initialState = {\n quality: 1,\n speed: 2\n};\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case types.UPDATE_QUALITY:\n return _extends({}, state, {\n quality: action.quality\n });\n\n case types.UPDATE_SPEED:\n return _extends({}, state, {\n speed: action.speed\n });\n\n default:\n return state;\n }\n};\n\nvar actions = exports.actions = {\n updateQuality: function updateQuality(quality) {\n return { type: types.UPDATE_QUALITY, quality: quality };\n },\n updateSpeed: function updateSpeed(speed) {\n return { type: types.UPDATE_SPEED, speed: speed };\n }\n};\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nfunction toHHMMSS(input) {\n var sec_num = parseInt(input, 10);\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - hours * 3600) / 60);\n var seconds = sec_num - hours * 3600 - minutes * 60;\n\n if (hours < 10) {\n hours = \"0\" + hours;\n }\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n return minutes + \":\" + seconds;\n}\n\nexports.toHHMMSS = toHHMMSS;\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\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\nvar SmartContainer = function (_Component) {\n _inherits(SmartContainer, _Component);\n\n function SmartContainer() {\n _classCallCheck(this, SmartContainer);\n\n return _possibleConstructorReturn(this, (SmartContainer.__proto__ || Object.getPrototypeOf(SmartContainer)).apply(this, arguments));\n }\n\n _createClass(SmartContainer, [{\n key: 'render',\n value: function render(props) {\n return (0, _preact.h)(\n 'div',\n { className: 'smart-container top left' },\n props.children\n );\n }\n }]);\n\n return SmartContainer;\n}(_preact.Component);\n\nexports.default = SmartContainer;\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\n\nvar _dropdownMenu = __webpack_require__(60);\n\nvar _dropdownMenu2 = _interopRequireDefault(_dropdownMenu);\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\nvar SmartContainer = function (_Component) {\n _inherits(SmartContainer, _Component);\n\n function SmartContainer() {\n _classCallCheck(this, SmartContainer);\n\n return _possibleConstructorReturn(this, (SmartContainer.__proto__ || Object.getPrototypeOf(SmartContainer)).apply(this, arguments));\n }\n\n _createClass(SmartContainer, [{\n key: 'render',\n value: function render(props) {\n return (0, _preact.h)(\n 'div',\n { className: 'smart-container-item select-menu-item' },\n (0, _preact.h)(\n 'label',\n { htmlFor: 'quality' },\n props.label\n ),\n (0, _preact.h)(_dropdownMenu2.default, { onSelect: function onSelect(o) {\n return props.onSelect(o);\n }, options: props.options })\n );\n }\n }]);\n\n return SmartContainer;\n}(_preact.Component);\n\nexports.default = SmartContainer;\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _shell = __webpack_require__(8);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar Overlay = (_dec = (0, _preactRedux.connect)(null, (0, _bindActions.bindActions)(_shell.actions)), _dec(_class = function (_Component) {\n _inherits(Overlay, _Component);\n\n function Overlay() {\n _classCallCheck(this, Overlay);\n\n return _possibleConstructorReturn(this, (Overlay.__proto__ || Object.getPrototypeOf(Overlay)).apply(this, arguments));\n }\n\n _createClass(Overlay, [{\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.props.removePlayerClass('overlay-active');\n }\n }, {\n key: 'componentWillMount',\n value: function componentWillMount() {\n this.props.addPlayerClass('overlay-active');\n }\n }, {\n key: 'render',\n value: function render(props) {\n var overlayClass = 'overlay';\n if (props.type) overlayClass += ' ' + props.type + '-overlay';\n if (props.open) overlayClass += ' active';\n\n return (0, _preact.h)(\n 'div',\n { className: overlayClass, role: 'dialog' },\n (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(\n 'a',\n { onClick: function onClick() {\n return props.onClose();\n }, 'aria-label': (0, _preact.h)(_preactI18n.Text, { id: 'core.close' }), className: 'close-overlay' },\n (0, _preact.h)(_icon2.default, { type: 'close' })\n )\n ),\n props.children\n );\n }\n }]);\n\n return Overlay;\n}(_preact.Component)) || _class);\nexports.default = Overlay;\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _redux = __webpack_require__(6);\n\nvar _store = __webpack_require__(45);\n\nvar _store2 = _interopRequireDefault(_store);\n\nvar _fr = __webpack_require__(46);\n\nvar _fr2 = _interopRequireDefault(_fr);\n\nvar _engineConnector = __webpack_require__(47);\n\nvar _engineConnector2 = _interopRequireDefault(_engineConnector);\n\nvar _shell = __webpack_require__(51);\n\nvar _shell2 = _interopRequireDefault(_shell);\n\nvar _overlayPlay = __webpack_require__(53);\n\nvar _overlayPlay2 = _interopRequireDefault(_overlayPlay);\n\nvar _loading = __webpack_require__(54);\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _playPause = __webpack_require__(55);\n\nvar _playPause2 = _interopRequireDefault(_playPause);\n\nvar _seekbar = __webpack_require__(56);\n\nvar _seekbar2 = _interopRequireDefault(_seekbar);\n\nvar _volume = __webpack_require__(57);\n\nvar _volume2 = _interopRequireDefault(_volume);\n\nvar _share = __webpack_require__(58);\n\nvar _share2 = _interopRequireDefault(_share);\n\nvar _settings = __webpack_require__(59);\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _language = __webpack_require__(61);\n\nvar _language2 = _interopRequireDefault(_language);\n\nvar _fullscreen = __webpack_require__(62);\n\nvar _fullscreen2 = _interopRequireDefault(_fullscreen);\n\nvar _timeDisplay = __webpack_require__(63);\n\nvar _timeDisplay2 = _interopRequireDefault(_timeDisplay);\n\nvar _topBar = __webpack_require__(64);\n\nvar _topBar2 = _interopRequireDefault(_topBar);\n\nvar _bottomBar = __webpack_require__(65);\n\nvar _bottomBar2 = _interopRequireDefault(_bottomBar);\n\nvar _shareOverlay = __webpack_require__(66);\n\nvar _shareOverlay2 = _interopRequireDefault(_shareOverlay);\n\nvar _cvaaOverlay = __webpack_require__(67);\n\nvar _cvaaOverlay2 = _interopRequireDefault(_cvaaOverlay);\n\nvar _keyboard = __webpack_require__(68);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\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 UIManager = function () {\n function UIManager(player, config) {\n _classCallCheck(this, UIManager);\n\n this.player = player;\n this.config = config;\n this.config.ui = {\n \"translations\": {\n \"controls\": {\n \"language\": \"שפה\"\n }\n },\n \"components\": {\n \"Loading\": {\n \"enabled\": true\n },\n \"OverlayPlay\": {\n \"enabled\": true\n }\n }\n };\n }\n\n _createClass(UIManager, [{\n key: 'buildCustomUI',\n value: function buildCustomUI(template) {\n this._buildUI(template);\n }\n }, {\n key: 'buildDefaultUI',\n value: function buildDefaultUI() {\n var store = (0, _redux.createStore)(_store2.default, window.devToolsExtension && window.devToolsExtension({ name: 'playkit #' + this.config.target, instanceId: this.config.target }));\n\n var template = (0, _preact.h)(\n _preactRedux.Provider,\n { store: store },\n (0, _preact.h)(\n _preactI18n.IntlProvider,\n { definition: _fr2.default },\n (0, _preact.h)(\n _shell2.default,\n null,\n (0, _preact.h)('div', { className: 'player-holder' }),\n (0, _preact.h)(_engineConnector2.default, { player: this.player }),\n (0, _preact.h)(_keyboard2.default, { player: this.player }),\n (0, _preact.h)(_loading2.default, { player: this.player }),\n (0, _preact.h)(\n 'div',\n { className: 'player-gui' },\n (0, _preact.h)(_overlayPlay2.default, { player: this.player }),\n (0, _preact.h)(\n _topBar2.default,\n null,\n (0, _preact.h)(\n 'div',\n { className: 'left-controls' },\n (0, _preact.h)(\n 'div',\n { className: 'video-playing-title' },\n 'L21 Earth Time Lapse View from Space, ISS'\n )\n ),\n (0, _preact.h)(\n 'div',\n { className: 'right-controls' },\n (0, _preact.h)(_share2.default, { player: this.player })\n )\n ),\n (0, _preact.h)(\n _bottomBar2.default,\n null,\n (0, _preact.h)(_seekbar2.default, { showFramePreview: true, showTimeBubble: true, player: this.player }),\n (0, _preact.h)(\n 'div',\n { className: 'left-controls' },\n (0, _preact.h)(_playPause2.default, { player: this.player }),\n (0, _preact.h)(_timeDisplay2.default, { format: 'current / total', player: this.player })\n ),\n (0, _preact.h)(\n 'div',\n { className: 'right-controls' },\n (0, _preact.h)(_volume2.default, { player: this.player }),\n (0, _preact.h)(_language2.default, { player: this.player }),\n (0, _preact.h)(_settings2.default, { player: this.player }),\n (0, _preact.h)(_fullscreen2.default, { player: this.player })\n )\n ),\n (0, _preact.h)(_shareOverlay2.default, null),\n (0, _preact.h)(_cvaaOverlay2.default, null)\n )\n )\n )\n );\n this._buildUI(template);\n }\n }, {\n key: '_buildUI',\n value: function _buildUI(template) {\n if (!this.player) return;\n\n var playerWrapper = document.createElement('div');\n document.body.appendChild(playerWrapper);\n (0, _preact.render)(template, playerWrapper);\n\n var playerElement = document.getElementsByTagName('video')[this.config.target === 'player1' ? 0 : 1];\n // let playerElement = document.getElementById(this.config.target); // the right way\n playerElement.removeAttribute('style');\n playerWrapper.getElementsByClassName('player-holder')[0].appendChild(playerElement);\n }\n }, {\n key: 'release',\n value: function release() {}\n }]);\n\n return UIManager;\n}();\n\nexports.default = UIManager;\n\n/***/ }),\n/* 29 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(15);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(32);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(33);\n\n\n\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__[\"a\" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__[\"a\" /* default */].toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__[\"a\" /* default */](value)\n : __WEBPACK_IMPORTED_MODULE_2__objectToString_js__[\"a\" /* default */](value);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (baseGetTag);\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(31);\n\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 = __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__[\"a\" /* default */] || freeSelf || Function('return this')();\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (root);\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (freeGlobal);\n\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(16)))\n\n/***/ }),\n/* 32 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(15);\n\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\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 nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__[\"a\" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__[\"a\" /* default */].toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (getRawTag);\n\n\n/***/ }),\n/* 33 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\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 nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (objectToString);\n\n\n/***/ }),\n/* 34 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(35);\n\n\n/** Built-in value references. */\nvar getPrototype = __WEBPACK_IMPORTED_MODULE_0__overArg_js__[\"a\" /* default */](Object.getPrototypeOf, Object);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (getPrototype);\n\n\n/***/ }),\n/* 35 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\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/* harmony default export */ __webpack_exports__[\"a\"] = (overArg);\n\n\n/***/ }),\n/* 36 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\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 != null && typeof value == 'object';\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isObjectLike);\n\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(38);\n\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(global, module) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _ponyfill = __webpack_require__(40);\n\nvar _ponyfill2 = _interopRequireDefault(_ponyfill);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar root; /* global window */\n\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (true) {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = (0, _ponyfill2['default'])(root);\nexports['default'] = result;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16), __webpack_require__(39)(module)))\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tif(!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, \"loaded\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"id\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\nexports['default'] = symbolObservablePonyfill;\nfunction symbolObservablePonyfill(root) {\n\tvar result;\n\tvar _Symbol = root.Symbol;\n\n\tif (typeof _Symbol === 'function') {\n\t\tif (_Symbol.observable) {\n\t\t\tresult = _Symbol.observable;\n\t\t} else {\n\t\t\tresult = _Symbol('observable');\n\t\t\t_Symbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n\n/***/ }),\n/* 41 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__[\"a\"] = combineReducers;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(13);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(14);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(7);\n\n\n\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionName = actionType && '\"' + actionType.toString() + '\"' || 'an action';\n\n return 'Given action ' + actionName + ', reducer \"' + key + '\" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === __WEBPACK_IMPORTED_MODULE_0__createStore__[\"a\" /* ActionTypes */].INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!__WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__[\"a\" /* default */](inputState)) {\n return 'The ' + argumentName + ' has unexpected type of \"' + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + '\". Expected argument to be an object with the following ' + ('keys: \"' + reducerKeys.join('\", \"') + '\"');\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n\n if (unexpectedKeys.length > 0) {\n return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('\"' + unexpectedKeys.join('\", \"') + '\" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('\"' + reducerKeys.join('\", \"') + '\". Unexpected keys will be ignored.');\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, { type: __WEBPACK_IMPORTED_MODULE_0__createStore__[\"a\" /* ActionTypes */].INIT });\n\n if (typeof initialState === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');\n }\n\n var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');\n if (typeof reducer(undefined, { type: type }) === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined when probed with a random type. ' + ('Don\\'t try to handle ' + __WEBPACK_IMPORTED_MODULE_0__createStore__[\"a\" /* ActionTypes */].INIT + ' or other actions in \"redux/*\" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');\n }\n });\n}\n\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n __WEBPACK_IMPORTED_MODULE_2__utils_warning__[\"a\" /* default */]('No reducer provided for key \"' + key + '\"');\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n var finalReducerKeys = Object.keys(finalReducers);\n\n var unexpectedKeyCache = void 0;\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError = void 0;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments[1];\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n __WEBPACK_IMPORTED_MODULE_2__utils_warning__[\"a\" /* default */](warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n return hasChanged ? nextState : state;\n };\n}\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(12)))\n\n/***/ }),\n/* 42 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = bindActionCreators;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_warning__ = __webpack_require__(7);\n\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(undefined, arguments));\n };\n}\n\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass a single function as the first argument,\n * and get a function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?');\n }\n\n var keys = Object.keys(actionCreators);\n var boundActionCreators = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var actionCreator = actionCreators[key];\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n } else {\n __WEBPACK_IMPORTED_MODULE_0__utils_warning__[\"a\" /* default */]('bindActionCreators expected a function actionCreator for key \\'' + key + '\\', instead received type \\'' + typeof actionCreator + '\\'.');\n }\n }\n return boundActionCreators;\n}\n\n/***/ }),\n/* 43 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = applyMiddleware;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(17);\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\n\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function (reducer, preloadedState, enhancer) {\n var store = createStore(reducer, preloadedState, enhancer);\n var _dispatch = store.dispatch;\n var chain = [];\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch(action) {\n return _dispatch(action);\n }\n };\n chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = __WEBPACK_IMPORTED_MODULE_0__compose__[\"a\" /* default */].apply(undefined, chain)(store.dispatch);\n\n return _extends({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports, __webpack_require__) {\n\n!function(e,n){ true?module.exports=n():\"function\"==typeof define&&define.amd?define(n):e.dlv=n()}(this,function(){function e(e,n,t,o){for(o=0,n=n.split?n.split(\".\"):n;e&&o<n.length;)e=e[n[o++]];return void 0===e?t:e}return e});\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _redux = __webpack_require__(6);\n\nvar _engine = __webpack_require__(18);\n\nvar _engine2 = _interopRequireDefault(_engine);\n\nvar _shell = __webpack_require__(8);\n\nvar _shell2 = _interopRequireDefault(_shell);\n\nvar _playPause = __webpack_require__(9);\n\nvar _playPause2 = _interopRequireDefault(_playPause);\n\nvar _seekbar = __webpack_require__(19);\n\nvar _seekbar2 = _interopRequireDefault(_seekbar);\n\nvar _volume = __webpack_require__(20);\n\nvar _volume2 = _interopRequireDefault(_volume);\n\nvar _fullscreen = __webpack_require__(21);\n\nvar _fullscreen2 = _interopRequireDefault(_fullscreen);\n\nvar _loading = __webpack_require__(22);\n\nvar _loading2 = _interopRequireDefault(_loading);\n\nvar _share = __webpack_require__(10);\n\nvar _share2 = _interopRequireDefault(_share);\n\nvar _cvaa = __webpack_require__(11);\n\nvar _cvaa2 = _interopRequireDefault(_cvaa);\n\nvar _settings = __webpack_require__(23);\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar reducer = (0, _redux.combineReducers)({\n engine: _engine2.default,\n shell: _shell2.default,\n seekbar: _seekbar2.default,\n volume: _volume2.default,\n fullscreen: _fullscreen2.default,\n loading: _loading2.default,\n playPause: _playPause2.default,\n share: _share2.default,\n cvaa: _cvaa2.default,\n settings: _settings2.default\n});\nexports.default = reducer;\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports) {\n\nmodule.exports = {\n\t\"core\": {\n\t\t\"disable\": \"Disable\",\n\t\t\"auto\": \"Auto\",\n\t\t\"close\": \"Close\"\n\t},\n\t\"controls\": {\n\t\t\"play\": \"Play\",\n\t\t\"pause\": \"Pause\",\n\t\t\"share\": \"Share\",\n\t\t\"language\": \"Language\",\n\t\t\"settings\": \"Settings\",\n\t\t\"fullscreen\": \"Fullscreen\"\n\t},\n\t\"settings\": {\n\t\t\"quality\": \"Quality\",\n\t\t\"speed\": \"Speed\"\n\t},\n\t\"language\": {\n\t\t\"audio\": \"Audio\",\n\t\t\"captions\": \"Captions\",\n\t\t\"advanced_captions_settings\": \"Advanced captions settings\"\n\t},\n\t\"share\": {\n\t\t\"share_title\": \"Share\",\n\t\t\"link_options\": \"Link options\"\n\t}\n};\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _engine = __webpack_require__(18);\n\nvar _engine2 = _interopRequireDefault(_engine);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\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\nvar EngineConnector = (_dec = (0, _preactRedux.connect)(_engine2.default, (0, _bindActions.bindActions)(_engine.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(EngineConnector, _BaseComponent);\n\n function EngineConnector(obj) {\n _classCallCheck(this, EngineConnector);\n\n return _possibleConstructorReturn(this, (EngineConnector.__proto__ || Object.getPrototypeOf(EngineConnector)).call(this, { name: 'EngineConnector', player: obj.player }));\n }\n\n _createClass(EngineConnector, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED, function (e) {\n _this2.props.updatePlayerState(e.payload.oldState.type, e.payload.newState.type);\n });\n\n this.player.addEventListener(this.player.Event.TIME_UPDATE, function () {\n _this2.props.updateCurrentTime(_this2.player.currentTime);\n });\n\n this.player.addEventListener(this.player.Event.LOADED_METADATA, function () {\n _this2.props.updateDuration(_this2.player.duration);\n _this2.props.updateMetadataLoadingStatus(true);\n\n var TrackType = _this2.player.Track;\n var tracks = _this2.player.getTracks();\n var audioTracks = tracks.filter(function (t) {\n return t.constructor.name === 'AudioTrack';\n });\n var videoTracks = tracks.filter(function (t) {\n return t.constructor.name === 'VideoTrack';\n });\n var textTracks = tracks.filter(function (t) {\n return t.constructor.name === 'TextTrack';\n });\n\n _this2.props.updateAudioTracks(audioTracks);\n _this2.props.updateVideoTracks(videoTracks);\n _this2.props.updateTextTracks(textTracks);\n });\n\n this.player.addEventListener(this.player.Event.VOLUME_CHANGE, function () {\n _this2.props.updateVolume(_this2.player.volume);\n });\n\n this.player.addEventListener(this.player.Event.PLAY, function () {\n _this2.props.updateIsPlaying(true);\n });\n\n this.player.addEventListener(this.player.Event.PAUSE, function () {\n _this2.props.updateIsPlaying(false);\n });\n }\n }, {\n key: 'shouldComponentUpdate',\n value: function shouldComponentUpdate() {\n return false;\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)('span', null);\n }\n }]);\n\n return EngineConnector;\n}(_base2.default)) || _class);\nexports.default = EngineConnector;\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_48__;\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.LOG_LEVEL = undefined;\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 _jsLogger = __webpack_require__(50);\n\nvar JsLogger = _interopRequireWildcard(_jsLogger);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar LOG_LEVEL = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nvar LoggerFactory = function () {\n function LoggerFactory(options) {\n _classCallCheck(this, LoggerFactory);\n\n JsLogger.useDefaults(options || {});\n }\n\n _createClass(LoggerFactory, [{\n key: \"getLogger\",\n value: function getLogger(name) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n }]);\n\n return LoggerFactory;\n}();\n\nvar lf = new LoggerFactory({ defaultLevel: JsLogger.DEBUG });\n\nexports.default = lf;\nexports.LOG_LEVEL = LOG_LEVEL;\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (true) {\r\n\t\t!(__WEBPACK_AMD_DEFINE_FACTORY__ = (Logger),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _shell = __webpack_require__(8);\n\nvar _isMobile = __webpack_require__(52);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n metadataLoaded: state.engine.metadataLoaded,\n currentState: state.engine.playerState.currentState,\n playerClasses: state.shell.playerClasses,\n isMobile: state.shell.isMobile\n };\n};\n\nvar Shell = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_shell.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(Shell, _BaseComponent);\n\n function Shell() {\n _classCallCheck(this, Shell);\n\n return _possibleConstructorReturn(this, (Shell.__proto__ || Object.getPrototypeOf(Shell)).call(this, { name: 'Shell' }));\n }\n\n _createClass(Shell, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.props.updateIsMobile((0, _isMobile.isMobile)());\n }\n }, {\n key: 'render',\n value: function render(props) {\n var playerClasses = 'player skin-default';\n playerClasses += ' ' + props.playerClasses.join(' ');\n\n if (this.props.metadataLoaded) playerClasses += ' metadata-loaded';\n if (this.props.metadataLoaded) playerClasses += ' state-' + this.props.currentState;\n\n return (0, _preact.h)(\n 'div',\n { className: playerClasses },\n props.children\n );\n }\n }]);\n\n return Shell;\n}(_base2.default)) || _class);\nexports.default = Shell;\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nfunction isMobile() {\n return typeof window.orientation !== \"undefined\" || navigator.userAgent.indexOf(\"IEMobile\") !== -1;\n}\n\nexports.isMobile = isMobile;\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _playPause = __webpack_require__(9);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n isPlaying: state.engine.isPlaying\n };\n};\n\nvar OverlayPlay = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_playPause.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(OverlayPlay, _BaseComponent);\n\n function OverlayPlay(obj) {\n _classCallCheck(this, OverlayPlay);\n\n return _possibleConstructorReturn(this, (OverlayPlay.__proto__ || Object.getPrototypeOf(OverlayPlay)).call(this, { name: 'OverlayPlay', player: obj.player }));\n }\n\n _createClass(OverlayPlay, [{\n key: 'togglePlayPause',\n value: function togglePlayPause() {\n var _this2 = this;\n\n this.logger.debug('Toggle play');\n this.setState({ animation: true });\n setTimeout(function () {\n _this2.setState({ animation: false });\n }, 400);\n if (this.player.paused) {\n this.player.play();\n } else {\n this.player.pause();\n }\n }\n }, {\n key: 'render',\n value: function render(props) {\n var _this3 = this;\n\n return (0, _preact.h)(\n 'div',\n { className: 'overlay-play ' + (this.state.animation ? 'in' : ''), onClick: function onClick() {\n return _this3.togglePlayPause();\n } },\n props.isPlaying ? (0, _preact.h)(_icon2.default, { type: 'play' }) : (0, _preact.h)(_icon2.default, { type: 'pause' })\n );\n }\n }]);\n\n return OverlayPlay;\n}(_base2.default)) || _class);\nexports.default = OverlayPlay;\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _loading = __webpack_require__(22);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _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\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n show: state.loading.show\n };\n};\n\nvar Loading = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_loading.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(Loading, _BaseComponent);\n\n function Loading(obj) {\n _classCallCheck(this, Loading);\n\n return _possibleConstructorReturn(this, (Loading.__proto__ || Object.getPrototypeOf(Loading)).call(this, { name: 'Loading', player: obj.player }));\n }\n\n _createClass(Loading, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED, function (e) {\n if (e.payload.newState.type === 'idle' || e.payload.newState.type === 'playing' || e.payload.newState.type === 'paused') {\n _this2.props.updateLoadingSpinnerState(false);\n } else {\n _this2.props.updateLoadingSpinnerState(true);\n }\n });\n }\n }, {\n key: 'render',\n value: function render(props) {\n return (0, _preact.h)(\n 'div',\n { className: props.show ? 'loading-backdrop show' : 'loading-backdrop' },\n (0, _preact.h)(\n 'div',\n { className: 'spinner-container' },\n (0, _preact.h)(\n 'div',\n { className: 'spinner' },\n [].concat(_toConsumableArray(Array(8))).map(function () {\n return (0, _preact.h)('span', null);\n })\n )\n )\n );\n }\n }]);\n\n return Loading;\n}(_base2.default)) || _class);\nexports.default = Loading;\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _playPause = __webpack_require__(9);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n isPlaying: state.engine.isPlaying\n };\n};\n\nvar PlayPauseControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_playPause.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(PlayPauseControl, _BaseComponent);\n\n function PlayPauseControl(obj) {\n _classCallCheck(this, PlayPauseControl);\n\n return _possibleConstructorReturn(this, (PlayPauseControl.__proto__ || Object.getPrototypeOf(PlayPauseControl)).call(this, { name: 'PlayPause', player: obj.player }));\n }\n\n _createClass(PlayPauseControl, [{\n key: 'togglePlayPause',\n value: function togglePlayPause() {\n this.logger.debug('Toggle play');\n if (this.player.paused) {\n this.player.play();\n } else {\n this.player.pause();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var controlButtonClass = this.props.isPlaying ? 'control-button is-playing' : 'control-button';\n\n return (0, _preact.h)(\n 'div',\n { className: 'control-button-container control-play-pause' },\n (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(\n 'button',\n { 'aria-label': (0, _preact.h)(_preactI18n.Text, { id: this.props.isPlaying ? 'controls.pause' : 'controls.play' }), className: controlButtonClass, onClick: function onClick() {\n return _this2.togglePlayPause();\n } },\n (0, _preact.h)(_icon2.default, { type: 'play' }),\n (0, _preact.h)(_icon2.default, { type: 'pause' })\n )\n )\n );\n }\n }]);\n\n return PlayPauseControl;\n}(_base2.default)) || _class);\nexports.default = PlayPauseControl;\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _seekbar = __webpack_require__(19);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _timeFormat = __webpack_require__(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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n virtualProgress: state.seekbar.virtualTime,\n currentTime: state.seekbar.currentTime,\n duration: state.engine.duration,\n isDraggingActive: state.seekbar.draggingActive\n };\n};\n\nvar SeekBarControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_seekbar.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(SeekBarControl, _BaseComponent);\n\n function SeekBarControl(obj) {\n _classCallCheck(this, SeekBarControl);\n\n var _this = _possibleConstructorReturn(this, (SeekBarControl.__proto__ || Object.getPrototypeOf(SeekBarControl)).call(this, { name: 'SeekBar', player: obj.player }));\n\n _this.onSeekbarMouseDown = function (e) {\n _this.props.updateSeekbarDraggingStatus(true);\n if (_this.props.isDraggingActive) {\n var time = _this.getTime(e);\n _this.updateSeekBarProgress(time, _this.player.duration);\n }\n };\n\n _this.onSeekbarMouseUp = function (e) {\n var time = _this.getTime(e);\n _this.player.currentTime = time;\n _this.updateSeekBarProgress(time, _this.player.duration);\n _this.props.updateSeekbarDraggingStatus(false);\n _this.logger.debug('Seek to ' + time + 's');\n };\n\n _this.onSeekbarMouseMove = function (e) {\n var time = _this.getTime(e);\n _this.updateSeekBarProgress(time, _this.player.duration, true);\n\n if (_this.props.isDraggingActive) {\n _this.updateSeekBarProgress(time, _this.player.duration);\n }\n };\n\n return _this;\n }\n\n _createClass(SeekBarControl, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this._playerElement = document.getElementsByClassName('player')[0];\n this._seekBarElement = document.getElementsByClassName('seek-bar')[0];\n\n this.setState({ virtualTime: 0 });\n\n this.player.addEventListener(this.player.Event.TIME_UPDATE, function () {\n _this2.props.updateCurrentTime(_this2.player.currentTime);\n });\n }\n }, {\n key: 'updateSeekBarProgress',\n value: function updateSeekBarProgress(currentTime, duration) {\n var virtual = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (virtual) {\n this.setState({ virtualTime: currentTime });\n } else {\n this.props.updateCurrentTime(currentTime);\n }\n }\n }, {\n key: 'getTime',\n value: function getTime(e) {\n var time = this.player.duration * ((e.clientX - this._seekBarElement.offsetLeft - this._playerElement.offsetLeft) / this._seekBarElement.clientWidth);\n time = parseFloat(time.toFixed(2));\n if (time < 0) return 0;\n if (time > this.player.duration) return this.player.duration;\n return time;\n }\n }, {\n key: 'getThumbSpriteOffset',\n value: function getThumbSpriteOffset() {\n return -(Math.ceil(100 * this.state.virtualTime / this.player.duration) * 160) + 'px 0px';\n }\n }, {\n key: 'render',\n value: function render(props) {\n var _this3 = this;\n\n var virtualProgressWidth = this.state.virtualTime / props.duration * 100 + '%';\n var progressWidth = props.currentTime / props.duration * 100 + '%';\n var framePreviewStyle = 'background-image: url(http://cfvod.kaltura.com/p/1914121/sp/191412100/thumbnail/entry_id/1_fet8ffop/version/100001/width/160/vid_slices/100); ';\n framePreviewStyle += 'background-position: ' + this.getThumbSpriteOffset();\n\n return (0, _preact.h)(\n 'div',\n { className: 'seek-bar', role: 'slider',\n 'aria-label': 'Seek slider', 'aria-valuemin': '0', 'aria-valuemax': Math.round(this.player.duration), 'aria-valuenow': Math.round(this.player.currentTime),\n 'aria-valuetext': (0, _timeFormat.toHHMMSS)(this.player.currentTime) + ' of ' + (0, _timeFormat.toHHMMSS)(this.player.duration),\n onMouseMove: function onMouseMove(e) {\n return _this3.onSeekbarMouseMove(e);\n }, onMouseDown: function onMouseDown(e) {\n return _this3.onSeekbarMouseDown(e);\n }, onMouseUp: function onMouseUp(e) {\n return _this3.onSeekbarMouseUp(e);\n } },\n (0, _preact.h)(\n 'div',\n { className: 'progress-bar' },\n (0, _preact.h)(\n 'div',\n { className: 'progress', style: { width: progressWidth } },\n (0, _preact.h)('a', { className: 'scrubber' })\n ),\n (0, _preact.h)(\n 'div',\n { className: 'virtual-progress', style: { width: virtualProgressWidth } },\n props.showFramePreview ? (0, _preact.h)(\n 'div',\n { className: 'frame-preview' },\n (0, _preact.h)('div', { className: 'frame-preview-img', style: framePreviewStyle })\n ) : '',\n this.props.showTimeBubble ? (0, _preact.h)(\n 'div',\n { className: 'time-preview' },\n (0, _timeFormat.toHHMMSS)(this.state.virtualTime)\n ) : ''\n ),\n (0, _preact.h)('div', { className: 'buffered', style: 'width: 60%;' })\n )\n );\n }\n }]);\n\n return SeekBarControl;\n}(_base2.default)) || _class);\nexports.default = SeekBarControl;\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _volume = __webpack_require__(20);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n isDraggingActive: state.volume.isDraggingActive,\n volume: state.volume.volume,\n muted: state.volume.muted,\n isMobile: state.shell.isMobile\n };\n};\n\nvar VolumeControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_volume.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(VolumeControl, _BaseComponent);\n\n function VolumeControl(obj) {\n _classCallCheck(this, VolumeControl);\n\n return _possibleConstructorReturn(this, (VolumeControl.__proto__ || Object.getPrototypeOf(VolumeControl)).call(this, { name: 'Volume', player: obj.player }));\n }\n\n _createClass(VolumeControl, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this._volumeControlElement = document.getElementsByClassName('volume-control')[0];\n this._volumeProgressBarElement = this._volumeControlElement.getElementsByClassName('bar')[0];\n\n this.player.addEventListener(this.player.Event.LOADED_METADATA, function () {\n _this2.props.updateVolume(_this2.player.volume);\n });\n\n this.player.addEventListener(this.player.Event.VOLUME_CHANGE, function () {\n _this2.props.updateVolume(_this2.player.volume);\n });\n }\n }, {\n key: 'getVolumeProgessHeight',\n value: function getVolumeProgessHeight() {\n return this.props.muted ? '0%' : Math.round(this.props.volume * 100) + '%';\n }\n }, {\n key: 'onVolumeProgressBarMouseDown',\n value: function onVolumeProgressBarMouseDown() {\n this.props.updateVolumeDraggingStatus(true);\n }\n }, {\n key: 'onVolumeProgressBarClick',\n value: function onVolumeProgressBarClick(e) {\n this.changeVolume(e);\n }\n }, {\n key: 'onVolumeControlButtonClick',\n value: function onVolumeControlButtonClick() {\n this.logger.debug('Toggle mute. ' + this.player.muted + ' => ' + !this.player.muted);\n this.props.updateMuted(!this.props.muted);\n this.player.muted = !this.player.muted;\n }\n }, {\n key: 'changeVolume',\n value: function changeVolume(e) {\n var barHeight = this._volumeProgressBarElement.clientHeight;\n var topY = this.getCoords(this._volumeProgressBarElement).top;\n var clickY = e.clientY;\n var volume = 1 - (clickY - topY) / barHeight;\n volume = parseFloat(volume.toFixed(2));\n this.logger.debug('Change volume from ' + this.player.volume + ' => ' + volume);\n this.player.volume = volume;\n if (this.props.muted) {\n this.player.muted = false;\n this.props.updateMuted(false);\n }\n }\n }, {\n key: 'getCoords',\n value: function getCoords(el) {\n var box = el.getBoundingClientRect();\n\n return {\n top: box.top + pageYOffset,\n left: box.left + pageXOffset\n };\n }\n }, {\n key: 'render',\n value: function render() {\n var _this3 = this;\n\n var controlButtonClass = 'control-button-container volume-control';\n if (this.props.isDraggingActive) controlButtonClass += ' dragging-active';\n if (this.props.muted || this.props.volume === 0) controlButtonClass += ' is-muted';\n\n return (0, _preact.h)(\n 'div',\n { className: controlButtonClass },\n (0, _preact.h)(\n 'button',\n { className: 'control-button', onClick: function onClick() {\n return _this3.onVolumeControlButtonClick();\n }, 'aria-label': 'Volume' },\n (0, _preact.h)(_icon2.default, { type: 'volume-base' }),\n (0, _preact.h)(_icon2.default, { type: 'volume-waves' }),\n (0, _preact.h)(_icon2.default, { type: 'volume-mute' })\n ),\n (0, _preact.h)(\n 'div',\n { className: 'volume-control-bar', role: 'slider',\n 'aria-valuemin': '0', 'aria-valuemaz': '100', 'aria-valuenow': this.player.volume * 100,\n 'aria-valuetext': this.player.volume * 100 + '% volume ' + (this.player.muted ? 'muted' : '') },\n (0, _preact.h)(\n 'div',\n { className: 'bar', onMouseDown: function onMouseDown() {\n return _this3.onVolumeProgressBarMouseDown();\n }, onClick: function onClick(e) {\n return _this3.onVolumeProgressBarClick(e);\n } },\n (0, _preact.h)('div', { className: 'progress', style: { height: this.getVolumeProgessHeight() } })\n )\n )\n );\n }\n }]);\n\n return VolumeControl;\n}(_base2.default)) || _class);\nexports.default = VolumeControl;\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _share = __webpack_require__(10);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n overlayOpen: state.share.overlayOpen\n };\n};\n\nvar ShareControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_share.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(ShareControl, _BaseComponent);\n\n function ShareControl(obj) {\n _classCallCheck(this, ShareControl);\n\n return _possibleConstructorReturn(this, (ShareControl.__proto__ || Object.getPrototypeOf(ShareControl)).call(this, { name: 'Share', player: obj.player }));\n }\n\n _createClass(ShareControl, [{\n key: 'render',\n value: function render(props) {\n return (0, _preact.h)(\n 'div',\n { className: 'control-button-container control-share' },\n (0, _preact.h)(\n 'button',\n { className: 'control-button control-button-rounded', onClick: function onClick() {\n return props.toggleShareOverlay(!props.overlayOpen);\n }, 'aria-label': 'Share' },\n (0, _preact.h)(_icon2.default, { type: 'share' })\n )\n );\n }\n }]);\n\n return ShareControl;\n}(_base2.default)) || _class);\nexports.default = ShareControl;\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _settings = __webpack_require__(23);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _smartContainer = __webpack_require__(25);\n\nvar _smartContainer2 = _interopRequireDefault(_smartContainer);\n\nvar _smartContainerItem = __webpack_require__(26);\n\nvar _smartContainerItem2 = _interopRequireDefault(_smartContainerItem);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n videoTracks: state.engine.videoTracks\n };\n};\n\nvar SettingsControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_settings.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(SettingsControl, _BaseComponent);\n\n function SettingsControl(obj) {\n _classCallCheck(this, SettingsControl);\n\n return _possibleConstructorReturn(this, (SettingsControl.__proto__ || Object.getPrototypeOf(SettingsControl)).call(this, { name: 'Settings', player: obj.player }));\n }\n\n _createClass(SettingsControl, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.setState({ smartContainerOpen: false });\n }\n }, {\n key: 'onControlButtonClick',\n value: function onControlButtonClick() {\n this.setState({ smartContainerOpen: !this.state.smartContainerOpen });\n }\n }, {\n key: 'onSpeedChange',\n value: function onSpeedChange(o) {\n this.props.updateSpeed(o.value);\n }\n }, {\n key: 'onQualityChange',\n value: function onQualityChange(o) {\n this.props.updateQuality(o.value);\n }\n }, {\n key: 'render',\n value: function render(props) {\n var _this2 = this;\n\n var speedOptions = [{ value: 1, label: 'Auto (360)', active: true }, { value: 2, label: '240' }, { value: 3, label: '144' }];\n var qualityOptions = props.videoTracks.map(function (t) {\n return { label: t.label || t.language, active: t.active, value: t };\n });\n\n return (0, _preact.h)(\n 'div',\n { className: 'control-button-container control-settings' },\n (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(\n 'button',\n { 'aria-label': (0, _preact.h)(_preactI18n.Text, { id: 'controls.settings' }), className: this.state.smartContainerOpen ? 'control-button active' : 'control-button', onClick: function onClick() {\n return _this2.onControlButtonClick();\n } },\n (0, _preact.h)(_icon2.default, { type: 'settings' })\n )\n ),\n !this.state.smartContainerOpen ? '' : (0, _preact.h)(\n _smartContainer2.default,\n null,\n props.videoTracks.length <= 0 ? '' : (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(_smartContainerItem2.default, { label: (0, _preact.h)(_preactI18n.Text, { id: 'settings.quality' }), options: qualityOptions, onSelect: function onSelect(o) {\n return _this2.onQualityChange(o);\n } })\n ),\n (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(_smartContainerItem2.default, { label: (0, _preact.h)(_preactI18n.Text, { id: 'settings.speed' }), options: speedOptions, onSelect: function onSelect(o) {\n return _this2.onSpeedChange(o);\n } })\n )\n )\n );\n }\n }]);\n\n return SettingsControl;\n}(_base2.default)) || _class);\nexports.default = SettingsControl;\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar DropDownMenu = function (_Component) {\n _inherits(DropDownMenu, _Component);\n\n function DropDownMenu() {\n _classCallCheck(this, DropDownMenu);\n\n return _possibleConstructorReturn(this, (DropDownMenu.__proto__ || Object.getPrototypeOf(DropDownMenu)).apply(this, arguments));\n }\n\n _createClass(DropDownMenu, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n this.setState({ dropMenuActive: false });\n }\n }, {\n key: 'isSelected',\n value: function isSelected(o) {\n return o.active;\n }\n }, {\n key: 'onSelect',\n value: function onSelect(o) {\n this.props.onSelect(o.value);\n this.setState({ dropMenuActive: false });\n }\n }, {\n key: 'getActiveOptionLabel',\n value: function getActiveOptionLabel() {\n var activeOptions = this.props.options.filter(function (t) {\n return t.active;\n });\n return activeOptions.length > 0 ? activeOptions[0].label : this.props.options[0].label;\n }\n }, {\n key: 'render',\n value: function render(props) {\n var _this2 = this;\n\n return (0, _preact.h)(\n 'div',\n { className: 'dropdown top left' },\n (0, _preact.h)(\n 'div',\n { className: 'dropdown-button', onClick: function onClick() {\n return _this2.setState({ dropMenuActive: !_this2.state.dropMenuActive });\n } },\n this.getActiveOptionLabel()\n ),\n !this.state.dropMenuActive ? '' : (0, _preact.h)(\n 'div',\n { className: 'dropdown-menu' },\n props.options.map(function (o) {\n return (0, _preact.h)(\n 'div',\n { className: _this2.isSelected(o) ? 'dropdown-menu-item active' : 'dropdown-menu-item', onClick: function onClick() {\n return _this2.onSelect(o);\n } },\n (0, _preact.h)(\n 'span',\n null,\n o.label\n ),\n _this2.isSelected(o) ? (0, _preact.h)(_icon2.default, { type: 'check' }) : ''\n );\n })\n )\n );\n }\n }]);\n\n return DropDownMenu;\n}(_preact.Component);\n\nexports.default = DropDownMenu;\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _cvaa = __webpack_require__(11);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _smartContainer = __webpack_require__(25);\n\nvar _smartContainer2 = _interopRequireDefault(_smartContainer);\n\nvar _smartContainerItem = __webpack_require__(26);\n\nvar _smartContainerItem2 = _interopRequireDefault(_smartContainerItem);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n audioTracks: state.engine.audioTracks,\n textTracks: state.engine.textTracks,\n overlayOpen: state.cvaa.overlayOpen\n };\n};\n\nvar LanguageControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_cvaa.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(LanguageControl, _BaseComponent);\n\n function LanguageControl(obj) {\n _classCallCheck(this, LanguageControl);\n\n return _possibleConstructorReturn(this, (LanguageControl.__proto__ || Object.getPrototypeOf(LanguageControl)).call(this, { name: 'LanguageControl', player: obj.player }));\n }\n\n _createClass(LanguageControl, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.setState({ smartContainerOpen: false });\n }\n }, {\n key: 'onControlButtonClick',\n value: function onControlButtonClick() {\n this.setState({ smartContainerOpen: !this.state.smartContainerOpen });\n }\n }, {\n key: 'onAudioChange',\n value: function onAudioChange(audioTrack) {\n // this.player.selectTrack(audioTrack);\n this.player._engine.selectTextTrack(audioTrack); // workaround untill bug fixed in playkit-js\n }\n }, {\n key: 'onCaptionsChange',\n value: function onCaptionsChange(textTrack) {\n // this.player.selectTrack(textTrack);\n this.player._engine.selectTextTrack(textTrack); // workaround untill bug fixed in playkit-js\n }\n }, {\n key: 'render',\n value: function render(props) {\n var _this2 = this;\n\n var audioOptions = props.audioTracks.map(function (t) {\n return { label: t.label || t.language, active: t.active, value: t };\n });\n var textOptions = props.textTracks.map(function (t) {\n return { label: t.label || t.language, active: t.active, value: t };\n });\n\n return props.audioTracks.length === 0 && props.audioTracks.length === 0 ? false : (0, _preact.h)(\n 'div',\n { className: 'control-button-container control-language' },\n (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(\n 'button',\n { 'aria-label': (0, _preact.h)(_preactI18n.Text, { id: 'controls.language' }), className: this.state.smartContainerOpen ? 'control-button active' : 'control-button', onClick: function onClick() {\n return _this2.onControlButtonClick();\n } },\n (0, _preact.h)(_icon2.default, { type: 'language' })\n )\n ),\n !this.state.smartContainerOpen ? '' : (0, _preact.h)(\n _smartContainer2.default,\n null,\n props.audioTracks.length <= 0 ? '' : (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(_smartContainerItem2.default, { label: (0, _preact.h)(_preactI18n.Text, { id: 'language.audio' }), options: audioOptions, onSelect: function onSelect(audioTrack) {\n return _this2.onAudioChange(audioTrack);\n } })\n ),\n props.textTracks.length <= 0 ? '' : (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(_smartContainerItem2.default, { label: (0, _preact.h)(_preactI18n.Text, { id: 'language.captions' }), options: textOptions, onSelect: function onSelect(textTrack) {\n return _this2.onCaptionsChange(textTrack);\n } })\n ),\n props.textTracks.length <= 0 ? '' : (0, _preact.h)(\n 'div',\n { className: 'smart-container-item' },\n (0, _preact.h)(\n 'a',\n { onClick: function onClick() {\n return props.toggleCVAAOverlay(!props.overlayOpen);\n } },\n (0, _preact.h)(\n _preactI18n.Text,\n { id: 'language.advanced_captions_settings' },\n 'Advanced captions settings'\n )\n )\n )\n )\n );\n }\n }]);\n\n return LanguageControl;\n}(_base2.default)) || _class);\nexports.default = LanguageControl;\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _fullscreen = __webpack_require__(21);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _icon = __webpack_require__(4);\n\nvar _icon2 = _interopRequireDefault(_icon);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n fullscreen: state.fullscreen.fullscreen\n };\n};\n\nvar FullscreenControl = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_fullscreen.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(FullscreenControl, _BaseComponent);\n\n function FullscreenControl() {\n _classCallCheck(this, FullscreenControl);\n\n return _possibleConstructorReturn(this, (FullscreenControl.__proto__ || Object.getPrototypeOf(FullscreenControl)).call(this, { name: 'Fullscreen' }));\n }\n\n _createClass(FullscreenControl, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this._playerElement = document.getElementsByClassName('player')[0];\n\n document.addEventListener('webkitfullscreenchange', function () {\n _this2.props.updateFullscreen(document.webkitIsFullScreen);\n });\n }\n }, {\n key: 'enterFullscreen',\n value: function enterFullscreen() {\n this._playerElement.webkitRequestFullscreen();\n }\n }, {\n key: 'exitFullscreen',\n value: function exitFullscreen() {\n document.webkitCancelFullScreen();\n }\n }, {\n key: 'toggleFullscreen',\n value: function toggleFullscreen() {\n this.logger.debug('Toggle fullscreen');\n this.props.fullscreen ? this.exitFullscreen() : this.enterFullscreen();\n }\n }, {\n key: 'render',\n value: function render() {\n var _this3 = this;\n\n return (0, _preact.h)(\n 'div',\n { className: 'control-button-container control-fullscreen' },\n (0, _preact.h)(\n _preactI18n.Localizer,\n null,\n (0, _preact.h)(\n 'button',\n { 'aria-label': (0, _preact.h)(_preactI18n.Text, { id: 'controls.fullscreen' }), className: this.props.fullscreen ? 'control-button is-fullscreen' : 'control-button', onClick: function onClick() {\n return _this3.toggleFullscreen();\n } },\n (0, _preact.h)(_icon2.default, { type: 'maximize' }),\n (0, _preact.h)(_icon2.default, { type: 'minimize' })\n )\n )\n );\n }\n }]);\n\n return FullscreenControl;\n}(_base2.default)) || _class);\nexports.default = FullscreenControl;\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _timeFormat = __webpack_require__(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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n currentTime: state.seekbar.currentTime,\n duration: state.engine.duration\n };\n};\n\nvar TimeDisplay = (_dec = (0, _preactRedux.connect)(mapStateToProps), _dec(_class = function (_BaseComponent) {\n _inherits(TimeDisplay, _BaseComponent);\n\n function TimeDisplay(obj) {\n _classCallCheck(this, TimeDisplay);\n\n return _possibleConstructorReturn(this, (TimeDisplay.__proto__ || Object.getPrototypeOf(TimeDisplay)).call(this, { name: 'TimeDisplay', player: obj.player, config: obj.config }));\n }\n\n _createClass(TimeDisplay, [{\n key: 'getTimeDisplay',\n value: function getTimeDisplay() {\n var result = this.props.format ? this.props.format : 'current / total',\n current = (0, _timeFormat.toHHMMSS)(this.props.currentTime),\n total = (0, _timeFormat.toHHMMSS)(this.props.duration),\n left = (0, _timeFormat.toHHMMSS)(this.props.duration - this.props.currentTime);\n\n result = result.replace(/current/g, current);\n result = result.replace(/total/g, total);\n result = result.replace(/left/g, left);\n\n return result;\n }\n }, {\n key: 'render',\n value: function render() {\n return (0, _preact.h)(\n 'div',\n { className: 'time-display' },\n (0, _preact.h)(\n 'span',\n null,\n this.getTimeDisplay()\n )\n );\n }\n }]);\n\n return TimeDisplay;\n}(_base2.default)) || _class);\nexports.default = TimeDisplay;\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\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\nvar TopBar = function (_Component) {\n _inherits(TopBar, _Component);\n\n function TopBar() {\n _classCallCheck(this, TopBar);\n\n return _possibleConstructorReturn(this, (TopBar.__proto__ || Object.getPrototypeOf(TopBar)).apply(this, arguments));\n }\n\n _createClass(TopBar, [{\n key: 'render',\n value: function render(props) {\n return (0, _preact.h)(\n 'div',\n { className: 'top-bar' },\n props.children\n );\n }\n }]);\n\n return TopBar;\n}(_preact.Component);\n\nexports.default = TopBar;\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _preact = __webpack_require__(0);\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\nvar BottomBar = function (_Component) {\n _inherits(BottomBar, _Component);\n\n function BottomBar() {\n _classCallCheck(this, BottomBar);\n\n return _possibleConstructorReturn(this, (BottomBar.__proto__ || Object.getPrototypeOf(BottomBar)).apply(this, arguments));\n }\n\n _createClass(BottomBar, [{\n key: 'render',\n value: function render(props) {\n return (0, _preact.h)(\n 'div',\n { className: 'bottom-bar' },\n props.children\n );\n }\n }]);\n\n return BottomBar;\n}(_preact.Component);\n\nexports.default = BottomBar;\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactI18n = __webpack_require__(5);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _share = __webpack_require__(10);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _overlay = __webpack_require__(27);\n\nvar _overlay2 = _interopRequireDefault(_overlay);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n open: state.share.overlayOpen\n };\n};\n\nvar ShareOverlay = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_share.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(ShareOverlay, _BaseComponent);\n\n function ShareOverlay() {\n _classCallCheck(this, ShareOverlay);\n\n return _possibleConstructorReturn(this, (ShareOverlay.__proto__ || Object.getPrototypeOf(ShareOverlay)).call(this, { name: 'ShareOverlay' }));\n }\n\n _createClass(ShareOverlay, [{\n key: 'render',\n value: function render(props) {\n return !props.open ? '' : (0, _preact.h)(\n _overlay2.default,\n { open: props.open, onClose: function onClose() {\n return props.toggleShareOverlay(false);\n }, type: 'share' },\n (0, _preact.h)(\n 'div',\n { className: 'title' },\n (0, _preact.h)(_preactI18n.Text, { id: 'share.share_title' })\n ),\n (0, _preact.h)(\n 'div',\n { className: 'share-icons' },\n (0, _preact.h)(\n 'a',\n { className: 'share-btn facebook-share-btn' },\n (0, _preact.h)(\n 'svg',\n { style: 'width:32px;height:32px', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { fill: '#fff', d: 'M432 405.333h-80v106.667h80v320h133.333v-320h97.12l9.547-106.667h-106.667v-44.453c0-25.467 5.12-35.547 29.733-35.547h76.933v-133.333h-101.547c-95.893 0-138.453 42.213-138.453 123.067v90.267z' })\n )\n ),\n (0, _preact.h)(\n 'a',\n { className: 'share-btn twitter-share-btn' },\n (0, _preact.h)(\n 'svg',\n { style: 'width:32px;height:32px', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { fill: '#fff', d: 'M832 316.614c-23.547 10.29-48.853 17.221-75.413 20.345 27.12-15.987 47.947-41.319 57.733-71.508-25.36 14.806-53.467 25.568-83.387 31.37-23.92-25.122-58.080-40.82-95.84-40.82-84.773 0-147.067 77.861-127.92 158.687-109.093-5.381-205.84-56.833-270.613-135.035-34.4 58.094-17.84 134.090 40.613 172.574-21.493-0.683-41.76-6.484-59.44-16.171-1.44 59.879 42.16 115.898 105.307 128.368-18.48 4.935-38.72 6.090-59.307 2.205 16.693 51.347 65.173 88.702 122.667 89.752-55.2 42.605-124.747 61.637-194.4 53.552 58.107 36.673 127.147 58.067 201.28 58.067 243.787 0 381.52-202.684 373.2-384.473 25.653-18.244 47.92-41.004 65.52-66.914v0z' })\n )\n ),\n (0, _preact.h)(\n 'a',\n { className: 'share-btn google-plus-share-btn' },\n (0, _preact.h)(\n 'svg',\n { style: 'width:32px;height:32px', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { fill: '#fff', d: 'M352 556.8h127.040c-5.12 32.928-38.4 96.64-127.040 96.64-76.48 0-138.88-63.328-138.88-141.44 0-78.080 62.4-141.44 138.88-141.44 43.52 0 72.64 18.56 89.28 34.56l60.8-58.56c-39.040-36.48-89.6-58.56-150.080-58.56-123.84 0-224 100.16-224 224s100.16 224 224 224c129.28 0 215.072-90.88 215.072-218.88 0-14.72-1.632-25.92-3.552-37.12h-211.52v76.8zM800 544v96h-64v-96h-96v-64h96v-96h64v96h96v64h-96z' })\n )\n ),\n (0, _preact.h)(\n 'a',\n { className: 'share-btn linkedin-share-btn' },\n (0, _preact.h)(\n 'svg',\n { style: 'width:32px;height:32px', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { fill: '#fff', d: 'M324.8 290.087c0 36.506-29.6 66.087-66.133 66.087s-66.133-29.581-66.133-66.087c0-36.48 29.6-66.087 66.133-66.087s66.133 29.607 66.133 66.087zM325.333 409.043h-133.333v422.957h133.333v-422.957zM538.187 409.043h-132.48v422.957h132.507v-222.026c0-123.45 160.773-133.549 160.773 0v222.026h133.013v-267.811c0-208.306-237.92-200.719-293.813-98.179v-56.967z' })\n )\n ),\n (0, _preact.h)(\n 'a',\n { className: 'share-btn email-share-btn' },\n (0, _preact.h)(\n 'svg',\n { style: 'width:32px;height:32px', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { fill: '#fff', d: 'M256 768c-35.346 0-64-28.654-64-64v-352c0-35.346 28.654-64 64-64h512c35.346 0 64 28.654 64 64v352c0 35.346-28.654 64-64 64h-512zM512 467.488l147.52-115.488h-295.040l147.52 115.488zM748.48 352l-211.2 179.2c-0.713 1.308-1.572 2.532-2.56 3.648-12.707 12.158-32.733 12.158-45.44 0-0.988-1.116-1.847-2.34-2.56-3.648l-211.2-179.2h-19.52v352h512v-352h-19.52z' })\n )\n ),\n (0, _preact.h)(\n 'a',\n { className: 'share-btn embed-share-btn' },\n (0, _preact.h)(\n 'svg',\n { style: 'width:32px;height:32px', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { fill: '#fff', d: 'M377.989 579.335c12.669 12.904 12.669 33.777 0 46.68-12.733 12.969-33.427 12.969-46.16 0l-104.727-106.667c-12.669-12.904-12.669-33.777 0-46.68l104.727-106.667c12.733-12.969 33.427-12.969 46.16 0 12.669 12.904 12.669 33.777 0 46.68l-81.812 83.327 81.812 83.327zM646.011 412.68c-12.669-12.904-12.669-33.777 0-46.68 12.733-12.969 33.427-12.969 46.16 0l104.727 106.667c12.669 12.904 12.669 33.777 0 46.68l-104.727 106.667c-12.733 12.969-33.427 12.969-46.16 0-12.669-12.904-12.669-33.777 0-46.68l81.812-83.327-81.812-83.327zM572.293 250.6c17.455 4.445 28.025 22.388 23.686 40.066l-104.727 426.669c-4.349 17.719-22.048 28.535-39.545 24.079-17.455-4.445-28.025-22.388-23.686-40.066l104.727-426.669c4.349-17.719 22.048-28.535 39.545-24.079z' })\n )\n )\n ),\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n 'div',\n { className: 'form-group has-icon', style: 'width: 300px;' },\n (0, _preact.h)('input', { type: 'text', placeholder: 'Share URL', className: 'form-control', value: 'https://cdnapisec.kaltura.com/index.php?assetId=123456', readOnly: true }),\n (0, _preact.h)(\n 'svg',\n { className: 'icon', style: 'width:32px;height:32px;', viewBox: '0 0 1024 1024' },\n (0, _preact.h)('path', { d: 'M355.028 445.537c12.497 12.497 12.497 32.758 0 45.255s-32.758 12.497-45.255 0l-24.141-24.141c-49.92-49.92-49.832-130.999 0.094-180.925 49.984-49.984 130.995-50.025 180.955-0.064l113.266 113.266c49.964 49.964 49.935 130.955-0.064 180.955-12.497 12.497-32.758 12.497-45.255 0s-12.497-32.758 0-45.255c25.013-25.013 25.027-65.482 0.064-90.445l-113.266-113.266c-24.957-24.957-65.445-24.936-90.445 0.064-24.955 24.955-24.998 65.511-0.094 90.416l24.141 24.141zM668.972 578.463c-12.497-12.497-12.497-32.758 0-45.255s32.758-12.497 45.255 0l24.141 24.141c49.92 49.92 49.832 130.999-0.094 180.925-49.984 49.984-130.995 50.025-180.955 0.064l-113.266-113.266c-49.964-49.964-49.935-130.955 0.064-180.955 12.497-12.497 32.758-12.497 45.255 0s12.497 32.758 0 45.255c-25.013 25.013-25.027 65.482-0.064 90.445l113.266 113.266c24.957 24.957 65.445 24.936 90.445-0.064 24.955-24.955 24.998-65.511 0.094-90.416l-24.141-24.141z' })\n )\n )\n ),\n (0, _preact.h)(\n 'a',\n null,\n (0, _preact.h)(_preactI18n.Text, { id: 'share.link_options' })\n )\n );\n }\n }]);\n\n return ShareOverlay;\n}(_base2.default)) || _class);\nexports.default = ShareOverlay;\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _dec, _class;\n\nvar _preact = __webpack_require__(0);\n\nvar _preactRedux = __webpack_require__(1);\n\nvar _bindActions = __webpack_require__(3);\n\nvar _cvaa = __webpack_require__(11);\n\nvar _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _overlay = __webpack_require__(27);\n\nvar _overlay2 = _interopRequireDefault(_overlay);\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\nvar mapStateToProps = function mapStateToProps(state) {\n return {\n open: state.cvaa.overlayOpen\n };\n};\n\nvar CVAAOverlay = (_dec = (0, _preactRedux.connect)(mapStateToProps, (0, _bindActions.bindActions)(_cvaa.actions)), _dec(_class = function (_BaseComponent) {\n _inherits(CVAAOverlay, _BaseComponent);\n\n function CVAAOverlay() {\n _classCallCheck(this, CVAAOverlay);\n\n return _possibleConstructorReturn(this, (CVAAOverlay.__proto__ || Object.getPrototypeOf(CVAAOverlay)).call(this, { name: 'CVAAOverlay' }));\n }\n\n _createClass(CVAAOverlay, [{\n key: 'render',\n value: function render(props) {\n return !props.open ? '' : (0, _preact.h)(\n _overlay2.default,\n { open: props.open, onClose: function onClose() {\n return props.toggleCVAAOverlay(false);\n }, type: 'cvaa' },\n (0, _preact.h)(\n 'div',\n { className: 'title' },\n 'Advanced captions settings'\n ),\n (0, _preact.h)(\n 'div',\n null,\n (0, _preact.h)(\n 'div',\n { className: 'sample' },\n 'Sample'\n ),\n (0, _preact.h)(\n 'div',\n { className: 'sample black-bg' },\n 'Sample'\n ),\n (0, _preact.h)(\n 'div',\n { className: 'sample yellow-text' },\n 'Sample'\n )\n ),\n (0, _preact.h)(\n 'a',\n { className: 'button-save-cvaa' },\n 'Set custom caption'\n )\n );\n }\n }]);\n\n return CVAAOverlay;\n}(_base2.default)) || _class);\nexports.default = CVAAOverlay;\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\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 _base = __webpack_require__(2);\n\nvar _base2 = _interopRequireDefault(_base);\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\nvar KeyboardControl = function (_BaseComponent) {\n _inherits(KeyboardControl, _BaseComponent);\n\n // _playerElement: HTMLElement;\n\n function KeyboardControl(obj) {\n _classCallCheck(this, KeyboardControl);\n\n // this._playerElement = document.getElementsByClassName('player')[0];\n\n var _this = _possibleConstructorReturn(this, (KeyboardControl.__proto__ || Object.getPrototypeOf(KeyboardControl)).call(this, { name: 'Keyboard', player: obj.player }));\n\n document.body.onkeydown = function (e) {\n var time = void 0,\n newVolume = void 0;\n switch (e.which) {\n case 32:\n // space\n _this.logger.debug(\"Keydown space\");\n _this.player.paused ? _this.player.play() : _this.player.pause();\n break;\n\n case 38:\n // up\n _this.logger.debug(\"Keydown up\");\n newVolume = Math.round(_this.player.volume * 100) + 5;\n _this.logger.debug('Changing volume. ' + _this.player.volume + ' => ' + newVolume);\n if (_this.player.muted) {\n _this.player.muted = false;\n }\n _this.player.volume = newVolume / 100;\n break;\n\n case 40:\n // down\n _this.logger.debug(\"Keydown down\");\n newVolume = Math.round(_this.player.volume * 100) - 5;\n if (newVolume < 5) {\n _this.player.muted = true;\n return;\n }\n _this.logger.debug('Changing volume. ' + _this.player.volume + ' => ' + newVolume);\n _this.player.volume = newVolume / 100;\n break;\n\n case 37:\n // left\n _this.logger.debug(\"Keydown left\");\n time = _this.player.currentTime - 5 > 0 ? _this.player.currentTime - 5 : 0;\n _this.player.currentTime = time;\n break;\n\n case 39:\n // right\n _this.logger.debug(\"Keydown right\");\n time = _this.player.currentTime + 5 > _this.player.duration ? _this.player.duration : _this.player.currentTime + 5;\n _this.player.currentTime = time;\n break;\n\n default:\n return;\n }\n };\n\n _this.disableKeyboardCommandsOnControls();\n return _this;\n }\n\n _createClass(KeyboardControl, [{\n key: 'disableKeyboardCommandsOnControls',\n value: function disableKeyboardCommandsOnControls() {\n var controlButtonsElements = Array.from(document.getElementsByClassName('control-button'));\n controlButtonsElements.forEach(function (element) {\n element.onkeydown = function (e) {\n return e.preventDefault();\n };\n });\n }\n }]);\n\n return KeyboardControl;\n}(_base2.default);\n\nexports.default = KeyboardControl;\n\n/***/ })\n/******/ ]);\n});\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = __webpack_require__(5);\nif(typeof content === 'string') content = [[module.i, content, '']];\n// Prepare cssTransformation\nvar transform;\n\nvar options = {}\noptions.transform = transform\n// add the styles to the DOM\nvar update = __webpack_require__(7)(content, options);\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(false) {\n\t// When the styles change, update the <style> tags\n\tif(!content.locals) {\n\t\tmodule.hot.accept(\"!!../../../css-loader/index.js!./style.css\", function() {\n\t\t\tvar newContent = require(\"!!../../../css-loader/index.js!./style.css\");\n\t\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\t\t\tupdate(newContent);\n\t\t});\n\t}\n\t// When the module is disposed, remove the <style> tags\n\tmodule.hot.dispose(function() { update(); });\n}\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(6)(undefined);\n// imports\n\n\n// module\nexports.push([module.i, \".row{display:block}.row:after{content:'';clear:both;display:block}.form-group{margin:10px auto;position:relative;max-width:100%}.form-group.has-error .form-control{border-color:#db1f26}.form-group.has-error .form-control:focus{border-color:#fff}.form-group.has-icon .form-control{padding-left:34px}.form-group .icon{position:absolute;top:2px;left:2px;fill:rgba(255,255,255,0.4)}.form-control{height:36px;width:100%;min-width:72px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(0,0,0,0.4);font-size:15px;line-height:18px;color:#fff;padding:8px 10px;text-overflow:ellipsis}.form-control::-webkit-input-placeholder{color:rgba(255,255,255,0.6)}.form-control:focus{background-color:#fff;border-color:#fff;color:#333}.form-control:focus::-webkit-input-placeholder{color:#ccc}.form-control:focus+.icon{fill:#999}textarea.form-control{min-height:72px}@-webkit-keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.dropdown{position:relative}.dropdown.active .dropdown-menu{display:block;opacity:1}.dropdown.top .dropdown-menu{margin-bottom:10px;bottom:100%}.dropdown.bottom .dropdown-menu{margin-top:10px;top:100%}.dropdown.right .dropdown-menu{left:0}.dropdown.left .dropdown-menu{right:0}.dropdown .dropdown-button{font-size:15px;font-weight:bold;line-height:18px;color:#fff;cursor:pointer}.dropdown .dropdown-menu{display:block;opacity:1;position:absolute;background-color:#333333;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;padding:6px 0;z-index:5;-webkit-animation:openDropmenu 100ms ease-out forwards;animation:openDropmenu 100ms ease-out forwards;max-height:173px;overflow-y:auto}.dropdown .dropdown-menu .dropdown-menu-item{padding:2px 10px 2px 16px;white-space:nowrap;min-height:30px;cursor:pointer}.dropdown .dropdown-menu .dropdown-menu-item:hover{color:#fff}.dropdown .dropdown-menu .dropdown-menu-item.active{color:#01ACCD;fill:#01ACCD}.dropdown .dropdown-menu .dropdown-menu-item .check-icon{display:inline-block;margin-left:16px;vertical-align:middle;width:24px;height:24px}.dropdown .dropdown-menu .dropdown-menu-item span{vertical-align:middle;line-height:26px}.tooltip{display:inline-block;height:22px;border-radius:4px;background-color:#FFFFFF;padding:3px 13px;color:#333333;font-size:13px;font-weight:bold;line-height:16px;box-shadow:0 0 8px 0 rgba(0,0,0,0.3)}.player .control-button{width:32px;height:32px;background:transparent;display:inline-block;opacity:0.8;border:none;padding:0;cursor:pointer;fill:#fff}.player .control-button svg{width:32px;height:32px}.player .control-button:hover,.player .control-button.active{opacity:1}.player .control-button.control-button-rounded{width:36px;height:36px;padding:2px}.player .control-button.control-button-rounded:hover{background-color:rgba(0,0,0,0.4);border-radius:18px}.player .control-button-container{display:inline-block;position:relative;vertical-align:top}a{color:#01ACCD;text-decoration:underline;font-size:15px;line-height:18px}a:hover{color:#01819a}a:active{opacity:0.7}.player{position:relative;max-width:854px;width:100%;background-color:#000;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.player:-webkit-full-screen{width:100%;height:100%;max-width:none}.player *{box-sizing:border-box;outline:none}.player ::-moz-selection{background-color:rgba(0,0,0,0.1)}.player ::selection{background-color:rgba(0,0,0,0.1)}.player video{width:100%}.player .player-gui{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;overflow:hidden;font-size:0;font-family:\\\"Lato\\\",sans-serif}.player .player-gui input,.player .player-gui textarea{font-family:\\\"Lato\\\",sans-serif}.player.metadata-loaded .player-gui,.player.state-paused .player-gui,.player.overlay-active .player-gui,.player.menu-active .player-gui{opacity:1}video::-webkit-media-controls{display:none !important}video::-webkit-media-controls-start-playback-button{display:none !important;-webkit-appearance:none}video::cue{background-color:transparent}.player.captions-yellow-text video::cue{color:#FAFF00}.player.captions-black-bg video::cue{background-color:#000}@-webkit-keyframes openOverlay{from{opacity:0}to{opacity:1}}@keyframes openOverlay{from{opacity:0}to{opacity:1}}.overlay{position:absolute;display:none;opacity:0;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.42);z-index:4;text-align:center;color:#fff;padding:80px 20px 0;-webkit-animation:openOverlay 100ms ease-in-out forwards;animation:openOverlay 100ms ease-in-out forwards}.overlay.active{display:block;opacity:1}.overlay .title{font-size:24px;font-weight:bold;line-height:29px;margin-bottom:60px}.overlay .close-overlay{position:absolute;top:48px;right:48px;z-index:5;fill:#fff;cursor:pointer}.overlay .close-overlay .icon-close{width:24px;height:24px}@media screen and (max-width: 768px){.overlay{padding:36px 20px 0}.overlay .close-overlay{top:38px}.overlay .title{margin-bottom:24px}}@media screen and (max-width: 480px){.overlay{padding:16px 24px 0}.overlay .close-overlay{top:15px;right:24px}.overlay .title{font-size:16px;line-height:19px;margin-bottom:36px}}@-webkit-keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.smart-container{background-color:#222222;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;position:absolute;right:0px;min-width:193px;font-size:15px;z-index:5;display:block;-webkit-animation:openSmartContainer 100ms ease-out forwards;animation:openSmartContainer 100ms ease-out forwards}.smart-container.top{bottom:100%;margin-bottom:6px}.smart-container.top:before{display:block;content:' ';position:absolute;bottom:-6px;left:0;width:100%;height:6px}.smart-container.bottom{top:100%;margin-top:6px}.smart-container.right{left:0px}.smart-container.left{right:0px}.smart-container .smart-container-item{margin:16px;color:rgba(244,244,244,0.8);white-space:nowrap}.smart-container .smart-container-item:after{display:block;content:' ';clear:both}.smart-container .smart-container-item.select-menu-item label{float:left}.smart-container .smart-container-item.select-menu-item .dropdown{float:right}.overlay.share-overlay .share-icons{margin:60px 0}.overlay.share-overlay .share-btn{height:36px;width:36px;border-radius:18px;background-color:rgba(0,0,0,0.4);display:inline-block;margin:0 8px;-webkit-transition:-webkit-transform 100ms;transition:transform 100ms;will-change:transform;padding:2px}.overlay.share-overlay .share-btn:hover{-webkit-transform:scale(1.1667);-ms-transform:scale(1.1667);transform:scale(1.1667)}.overlay.share-overlay .share-btn.facebook-share-btn{background-color:#3B5998}.overlay.share-overlay .share-btn.twitter-share-btn{background-color:#1DA1F2}.overlay.share-overlay .share-btn.google-plus-share-btn{background-color:#DD4B39}.overlay.share-overlay .share-btn.linkedin-share-btn{background-color:#00A0DC}@media screen and (max-width: 768px){.overlay.share-overlay .share-icons{margin:40px 0}}@media screen and (max-width: 480px){.overlay.share-overlay .share-icons{margin:20px 0}}.overlay.cvaa-overlay .sample{border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:36px;text-align:center;padding:0 31px;display:inline-block;margin:0 12px;cursor:pointer}.overlay.cvaa-overlay .sample.black-bg{background-color:#000}.overlay.cvaa-overlay .sample.yellow-text{color:#FAFF00}.overlay.cvaa-overlay .button-save-cvaa{margin-top:50px;height:40px;width:400px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:38px;text-align:center;display:inline-block;color:#fff;text-decoration:none;cursor:pointer}@-webkit-keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}@keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}.loading-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.3);-webkit-transition:100ms opacity;transition:100ms opacity;opacity:0}.loading-backdrop.show{opacity:1}.loading-backdrop.show .spinner-container{display:block}.loading-backdrop .spinner-container{display:none;position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50px, -50px, 0);transform:translate3d(-50px, -50px, 0)}.spinner{width:100px;height:100px;position:relative;-webkit-animation:kaltura-spinner 2.5s infinite;animation:kaltura-spinner 2.5s infinite}.spinner span{width:8px;height:8px;background-color:#fff;display:block;border-radius:8px;position:absolute;top:50%;left:50%;margin-top:-4px;margin-left:-4px}.spinner span:nth-child(1){-webkit-transform:rotate(45deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(45deg) translateX(-25px) translateY(-25px);transform:rotate(45deg) translateX(-25px) translateY(-25px);background-color:#da1f26}.spinner span:nth-child(2){-webkit-transform:rotate(90deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(90deg) translateX(-25px) translateY(-25px);transform:rotate(90deg) translateX(-25px) translateY(-25px);background-color:#06a885}.spinner span:nth-child(3){-webkit-transform:rotate(135deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(135deg) translateX(-25px) translateY(-25px);transform:rotate(135deg) translateX(-25px) translateY(-25px);background-color:#009344}.spinner span:nth-child(4){-webkit-transform:rotate(180deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(180deg) translateX(-25px) translateY(-25px);transform:rotate(180deg) translateX(-25px) translateY(-25px);background-color:#f8a61a}.spinner span:nth-child(5){-webkit-transform:rotate(225deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(225deg) translateX(-25px) translateY(-25px);transform:rotate(225deg) translateX(-25px) translateY(-25px);background-color:#1b4a97}.spinner span:nth-child(6){-webkit-transform:rotate(270deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(270deg) translateX(-25px) translateY(-25px);transform:rotate(270deg) translateX(-25px) translateY(-25px);background-color:#00abcc}.spinner span:nth-child(7){-webkit-transform:rotate(315deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(315deg) translateX(-25px) translateY(-25px);transform:rotate(315deg) translateX(-25px) translateY(-25px);background-color:#b1d238}.spinner span:nth-child(8){-webkit-transform:rotate(360deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(360deg) translateX(-25px) translateY(-25px);transform:rotate(360deg) translateX(-25px) translateY(-25px);background-color:#fcd203}.control-button-container.control-play-pause .control-button{-webkit-transition:400ms -webkit-transform;transition:400ms transform}.control-button-container.control-play-pause .control-button .icon-pause{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:0;display:none}.control-button-container.control-play-pause .control-button .icon-play{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}.control-button-container.control-play-pause .control-button.is-playing .icon-pause{opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing .icon-play{opacity:0;display:none}@media screen and (max-width: 480px){.control-button-container.control-play-pause{display:none}}.control-button-container.volume-control:hover .volume-control-bar{display:block !important}.control-button-container.volume-control.is-muted .volume-waves{opacity:0;-webkit-transform:translateX(-5px);-ms-transform:translateX(-5px);transform:translateX(-5px)}.control-button-container.volume-control.is-muted .volume-mute{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.volume-control.dragging-active .volume-control-bar{display:block}.control-button-container.volume-control .volume-waves{-webkit-transform:translateX(0px);-ms-transform:translateX(0px);transform:translateX(0px)}.control-button-container.volume-control .volume-mute{opacity:1;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.control-button-container.volume-control .volume-waves,.control-button-container.volume-control .volume-mute{-webkit-transition:300ms -webkit-transform, 300ms opacity;transition:300ms transform, 300ms opacity}.control-button-container.volume-control svg{position:absolute;top:0;left:0}.volume-control-bar{position:absolute;z-index:2;bottom:38px;left:0px;display:block;height:112px;width:34px;border-radius:4px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);background-color:#333333;padding:6px;display:none}.volume-control-bar:before{position:absolute;width:34px;height:14px;bottom:-8px;left:0;content:' ';display:block}.volume-control-bar .bar{background-color:#424242;height:100%;position:relative;cursor:ns-resize}.volume-control-bar .progress{position:absolute;bottom:0px;left:0px;width:100%;border-radius:0 0 2px 2px;background-color:#01ACCD}.control-button-container.control-fullscreen .control-button{-webkit-transition:100ms -webkit-transform;transition:100ms transform;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.control-fullscreen .control-button .icon-minimize{display:none}.control-button-container.control-fullscreen .control-button:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-maximize{display:none}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-minimize{display:block}.player .seek-bar{padding:6px 0;cursor:pointer}.player .seek-bar:hover .progress-bar .scrubber,.player .seek-bar.dragging-active .progress-bar .scrubber{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.player .seek-bar:hover .progress-bar .virtual-progress,.player .seek-bar.dragging-active .progress-bar .virtual-progress{display:block}.player .seek-bar .progress-bar{height:4px;background-color:rgba(255,255,255,0.3);border-radius:2px;position:relative}.player .seek-bar .progress-bar .progress{position:absolute;top:0;left:0;height:100%;z-index:2;border-radius:2px 0 0 2px;background-color:#01ACCD}.player .seek-bar .progress-bar .virtual-progress{display:none}.player .seek-bar .progress-bar .buffered,.player .seek-bar .progress-bar .virtual-progress{position:absolute;top:0;left:0;height:100%;z-index:1;border-radius:2px 0 0 2px;background-color:rgba(255,255,255,0.3)}.player .seek-bar .progress-bar .buffered .frame-preview-img,.player .seek-bar .progress-bar .virtual-progress .frame-preview-img{background-size:auto 100%;width:100%;height:100%;position:relative}.player .seek-bar .progress-bar .buffered .frame-preview,.player .seek-bar .progress-bar .virtual-progress .frame-preview{position:absolute;bottom:16px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:94px;width:164px;border:2px solid rgba(255,255,255,0.2);border-radius:4px}.player .seek-bar .progress-bar .buffered .time-preview,.player .seek-bar .progress-bar .virtual-progress .time-preview{position:absolute;bottom:22px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:22px;min-width:48px;padding:0 3px;text-align:center;border-radius:3px;background-color:rgba(0,0,0,0.7);font-size:13px;font-weight:bold;line-height:22px;color:#fff}.player .seek-bar .progress-bar .scrubber{position:absolute;z-index:3;cursor:pointer;display:block;top:-6px;right:-8px;border-radius:8px;height:16px;width:16px;background-color:#FFFFFF;box-shadow:0 0 31px 0 rgba(0,0,0,0.3);-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:100ms -webkit-transform;transition:100ms transform}.player .seek-bar .progress-bar .scrubber:active{opacity:1;cursor:-webkit-grabbing;cursor:grabbing}@media screen and (max-width: 480px){.virtual-progress{display:none}}.player .time-display{display:inline-block;line-height:32px;vertical-align:top;font-size:14px;padding:0 23px;font-weight:bold}@media screen and (max-width: 480px){.player .time-display{padding:0 12px 0 0}}.player .video-playing-title{font-size:15px;font-weight:bold;line-height:18px;padding:6px 0}.player .bottom-bar{position:absolute;bottom:0;left:0;width:100%;background:-webkit-linear-gradient(270deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:6px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .bottom-bar .left-controls{float:left;text-align:left}.player .bottom-bar .right-controls{float:right;text-align:left}.player .bottom-bar .right-controls .control-button-container{margin:0 6px}.player .bottom-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .bottom-bar,.player.hover .bottom-bar,.player.state-paused .bottom-bar,.player.menu-active .bottom-bar{opacity:1}.player.overlay-active .bottom-bar{opacity:0}@media screen and (max-width: 480px){.player .bottom-bar{padding:6px 8px}}.player .top-bar{position:absolute;top:0;left:0;width:100%;background:-webkit-linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(0deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:14px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .top-bar .left-controls{float:left;text-align:left}.player .top-bar .right-controls{float:right;text-align:left}.player .top-bar .right-controls .control-button-container{margin:0 6px}.player .top-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .top-bar,.player.hover .top-bar,.player.state-paused .top-bar,.player.menu-active .top-bar{opacity:1}.player.overlay-active .top-bar{opacity:0}@media screen and (max-width: 480px){.player .top-bar{padding:8px 8px 20px 8px}}@-webkit-keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}@keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}.overlay-play{position:absolute;top:0;left:0;width:100%;height:100%}.overlay-play.in .icon{-webkit-animation:overlayPlayIconIn 400ms linear forwards;animation:overlayPlayIconIn 400ms linear forwards}.overlay-play .icon{width:144px;height:144px;fill:#fff;position:absolute;top:50%;left:50%;margin:-72px 0 0 -72px;opacity:0}\", \"\"]);\n\n// exports\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tmemo[selector] = fn.call(this, selector);\n\t\t}\n\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = __webpack_require__(8);\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n\t// tags it will allow on a page\n\tif (!options.singleton) options.singleton = isOldIE();\n\n\t// By default, add <style> tags to the <head> element\n\tif (!options.insertInto) options.insertInto = \"head\";\n\n\t// By default, add <style> tags to the bottom of the target\n\tif (!options.insertAt) options.insertAt = \"bottom\";\n\n\tvar styles = listToStyles(list, options);\n\n\taddStylesToDom(styles, options);\n\n\treturn function update (newList) {\n\t\tvar mayRemove = [];\n\n\t\tfor (var i = 0; i < styles.length; i++) {\n\t\t\tvar item = styles[i];\n\t\t\tvar domStyle = stylesInDom[item.id];\n\n\t\t\tdomStyle.refs--;\n\t\t\tmayRemove.push(domStyle);\n\t\t}\n\n\t\tif(newList) {\n\t\t\tvar newStyles = listToStyles(newList, options);\n\t\t\taddStylesToDom(newStyles, options);\n\t\t}\n\n\t\tfor (var i = 0; i < mayRemove.length; i++) {\n\t\t\tvar domStyle = mayRemove[i];\n\n\t\t\tif(domStyle.refs === 0) {\n\t\t\t\tfor (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();\n\n\t\t\t\tdelete stylesInDom[domStyle.id];\n\t\t\t}\n\t\t}\n\t};\n};\n\nfunction addStylesToDom (styles, options) {\n\tfor (var i = 0; i < styles.length; i++) {\n\t\tvar item = styles[i];\n\t\tvar domStyle = stylesInDom[item.id];\n\n\t\tif(domStyle) {\n\t\t\tdomStyle.refs++;\n\n\t\t\tfor(var j = 0; j < domStyle.parts.length; j++) {\n\t\t\t\tdomStyle.parts[j](item.parts[j]);\n\t\t\t}\n\n\t\t\tfor(; j < item.parts.length; j++) {\n\t\t\t\tdomStyle.parts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\t\t} else {\n\t\t\tvar parts = [];\n\n\t\t\tfor(var j = 0; j < item.parts.length; j++) {\n\t\t\t\tparts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\n\t\t\tstylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};\n\t\t}\n\t}\n}\n\nfunction listToStyles (list, options) {\n\tvar styles = [];\n\tvar newStyles = {};\n\n\tfor (var i = 0; i < list.length; i++) {\n\t\tvar item = list[i];\n\t\tvar id = options.base ? item[0] + options.base : item[0];\n\t\tvar css = item[1];\n\t\tvar media = item[2];\n\t\tvar sourceMap = item[3];\n\t\tvar part = {css: css, media: media, sourceMap: sourceMap};\n\n\t\tif(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});\n\t\telse newStyles[id].parts.push(part);\n\t}\n\n\treturn styles;\n}\n\nfunction insertStyleElement (options, style) {\n\tvar target = getElement(options.insertInto)\n\n\tif (!target) {\n\t\tthrow new Error(\"Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.\");\n\t}\n\n\tvar lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];\n\n\tif (options.insertAt === \"top\") {\n\t\tif (!lastStyleElementInsertedAtTop) {\n\t\t\ttarget.insertBefore(style, target.firstChild);\n\t\t} else if (lastStyleElementInsertedAtTop.nextSibling) {\n\t\t\ttarget.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);\n\t\t} else {\n\t\t\ttarget.appendChild(style);\n\t\t}\n\t\tstylesInsertedAtTop.push(style);\n\t} else if (options.insertAt === \"bottom\") {\n\t\ttarget.appendChild(style);\n\t} else {\n\t\tthrow new Error(\"Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.\");\n\t}\n}\n\nfunction removeStyleElement (style) {\n\tif (style.parentNode === null) return false;\n\tstyle.parentNode.removeChild(style);\n\n\tvar idx = stylesInsertedAtTop.indexOf(style);\n\tif(idx >= 0) {\n\t\tstylesInsertedAtTop.splice(idx, 1);\n\t}\n}\n\nfunction createStyleElement (options) {\n\tvar style = document.createElement(\"style\");\n\n\toptions.attrs.type = \"text/css\";\n\n\taddAttrs(style, options.attrs);\n\tinsertStyleElement(options, style);\n\n\treturn style;\n}\n\nfunction createLinkElement (options) {\n\tvar link = document.createElement(\"link\");\n\n\toptions.attrs.type = \"text/css\";\n\toptions.attrs.rel = \"stylesheet\";\n\n\taddAttrs(link, options.attrs);\n\tinsertStyleElement(options, link);\n\n\treturn link;\n}\n\nfunction addAttrs (el, attrs) {\n\tObject.keys(attrs).forEach(function (key) {\n\t\tel.setAttribute(key, attrs[key]);\n\t});\n}\n\nfunction addStyle (obj, options) {\n\tvar style, update, remove, result;\n\n\t// If a transform function was defined, run it on the css\n\tif (options.transform && obj.css) {\n\t result = options.transform(obj.css);\n\n\t if (result) {\n\t \t// If transform returns a value, use that instead of the original css.\n\t \t// This allows running runtime transformations on the css.\n\t \tobj.css = result;\n\t } else {\n\t \t// If the transform function returns a falsy value, don't add this css.\n\t \t// This allows conditional loading of css\n\t \treturn function() {\n\t \t\t// noop\n\t \t};\n\t }\n\t}\n\n\tif (options.singleton) {\n\t\tvar styleIndex = singletonCounter++;\n\n\t\tstyle = singleton || (singleton = createStyleElement(options));\n\n\t\tupdate = applyToSingletonTag.bind(null, style, styleIndex, false);\n\t\tremove = applyToSingletonTag.bind(null, style, styleIndex, true);\n\n\t} else if (\n\t\tobj.sourceMap &&\n\t\ttypeof URL === \"function\" &&\n\t\ttypeof URL.createObjectURL === \"function\" &&\n\t\ttypeof URL.revokeObjectURL === \"function\" &&\n\t\ttypeof Blob === \"function\" &&\n\t\ttypeof btoa === \"function\"\n\t) {\n\t\tstyle = createLinkElement(options);\n\t\tupdate = updateLink.bind(null, style, options);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\n\t\t\tif(style.href) URL.revokeObjectURL(style.href);\n\t\t};\n\t} else {\n\t\tstyle = createStyleElement(options);\n\t\tupdate = applyToTag.bind(null, style);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\t\t};\n\t}\n\n\tupdate(obj);\n\n\treturn function updateStyle (newObj) {\n\t\tif (newObj) {\n\t\t\tif (\n\t\t\t\tnewObj.css === obj.css &&\n\t\t\t\tnewObj.media === obj.media &&\n\t\t\t\tnewObj.sourceMap === obj.sourceMap\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdate(obj = newObj);\n\t\t} else {\n\t\t\tremove();\n\t\t}\n\t};\n}\n\nvar replaceText = (function () {\n\tvar textStore = [];\n\n\treturn function (index, replacement) {\n\t\ttextStore[index] = replacement;\n\n\t\treturn textStore.filter(Boolean).join('\\n');\n\t};\n})();\n\nfunction applyToSingletonTag (style, index, remove, obj) {\n\tvar css = remove ? \"\" : obj.css;\n\n\tif (style.styleSheet) {\n\t\tstyle.styleSheet.cssText = replaceText(index, css);\n\t} else {\n\t\tvar cssNode = document.createTextNode(css);\n\t\tvar childNodes = style.childNodes;\n\n\t\tif (childNodes[index]) style.removeChild(childNodes[index]);\n\n\t\tif (childNodes.length) {\n\t\t\tstyle.insertBefore(cssNode, childNodes[index]);\n\t\t} else {\n\t\t\tstyle.appendChild(cssNode);\n\t\t}\n\t}\n}\n\nfunction applyToTag (style, obj) {\n\tvar css = obj.css;\n\tvar media = obj.media;\n\n\tif(media) {\n\t\tstyle.setAttribute(\"media\", media)\n\t}\n\n\tif(style.styleSheet) {\n\t\tstyle.styleSheet.cssText = css;\n\t} else {\n\t\twhile(style.firstChild) {\n\t\t\tstyle.removeChild(style.firstChild);\n\t\t}\n\n\t\tstyle.appendChild(document.createTextNode(css));\n\t}\n}\n\nfunction updateLink (link, options, obj) {\n\tvar css = obj.css;\n\tvar sourceMap = obj.sourceMap;\n\n\t/*\n\t\tIf convertToAbsoluteUrls isn't defined, but sourcemaps are enabled\n\t\tand there is no publicPath defined then lets turn convertToAbsoluteUrls\n\t\ton by default. Otherwise default to the convertToAbsoluteUrls option\n\t\tdirectly\n\t*/\n\tvar autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;\n\n\tif (options.convertToAbsoluteUrls || autoFixUrls) {\n\t\tcss = fixUrls(css);\n\t}\n\n\tif (sourceMap) {\n\t\t// http://stackoverflow.com/a/26603875\n\t\tcss += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\n\t}\n\n\tvar blob = new Blob([css], { type: \"text/css\" });\n\n\tvar oldSrc = link.href;\n\n\tlink.href = URL.createObjectURL(blob);\n\n\tif(oldSrc) URL.revokeObjectURL(oldSrc);\n}\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\n\n/**\n * When source maps are enabled, `style-loader` uses a link element with a data-uri to\n * embed the css on the page. This breaks all relative urls because now they are relative to a\n * bundle instead of the current page.\n *\n * One solution is to only use full urls, but that may be impossible.\n *\n * Instead, this function \"fixes\" the relative urls to be absolute according to the current page location.\n *\n * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.\n *\n */\n\nmodule.exports = function (css) {\n // get current location\n var location = typeof window !== \"undefined\" && window.location;\n\n if (!location) {\n throw new Error(\"fixUrls requires window.location\");\n }\n\n\t// blank or null?\n\tif (!css || typeof css !== \"string\") {\n\t return css;\n }\n\n var baseUrl = location.protocol + \"//\" + location.host;\n var currentDir = baseUrl + location.pathname.replace(/\\/[^\\/]*$/, \"/\");\n\n\t// convert each url(...)\n\t/*\n\tThis regular expression is just a way to recursively match brackets within\n\ta string.\n\n\t /url\\s*\\( = Match on the word \"url\" with any whitespace after it and then a parens\n\t ( = Start a capturing group\n\t (?: = Start a non-capturing group\n\t [^)(] = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t (?: = Start another non-capturing groups\n\t [^)(]+ = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t [^)(]* = Match anything that isn't a parentheses\n\t \\) = Match a end parentheses\n\t ) = End Group\n *\\) = Match anything and then a close parens\n ) = Close non-capturing group\n * = Match anything\n ) = Close capturing group\n\t \\) = Match a close parens\n\n\t /gi = Get all matches, not the first. Be case insensitive.\n\t */\n\tvar fixedCss = css.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi, function(fullMatch, origUrl) {\n\t\t// strip quotes (if they exist)\n\t\tvar unquotedOrigUrl = origUrl\n\t\t\t.trim()\n\t\t\t.replace(/^\"(.*)\"$/, function(o, $1){ return $1; })\n\t\t\t.replace(/^'(.*)'$/, function(o, $1){ return $1; });\n\n\t\t// already a full url? no change\n\t\tif (/^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/)/i.test(unquotedOrigUrl)) {\n\t\t return fullMatch;\n\t\t}\n\n\t\t// convert the url to a full url\n\t\tvar newUrl;\n\n\t\tif (unquotedOrigUrl.indexOf(\"//\") === 0) {\n\t\t \t//TODO: should we add protocol?\n\t\t\tnewUrl = unquotedOrigUrl;\n\t\t} else if (unquotedOrigUrl.indexOf(\"/\") === 0) {\n\t\t\t// path should be relative to the base url\n\t\t\tnewUrl = baseUrl + unquotedOrigUrl; // already starts with '/'\n\t\t} else {\n\t\t\t// path should be relative to current directory\n\t\t\tnewUrl = currentDir + unquotedOrigUrl.replace(/^\\.\\//, \"\"); // Strip leading './'\n\t\t}\n\n\t\t// send back the fixed url(...)\n\t\treturn \"url(\" + JSON.stringify(newUrl) + \")\";\n\t});\n\n\t// send back the fixed css\n\treturn fixedCss;\n};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(10), __webpack_require__(0));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"hls.js\", \"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsHls\"] = factory(require(\"hls.js\"), require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsHls\"] = factory(root[\"Hls\"], root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {\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/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _get = function get(object, property, receiver) { 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 { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\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 _hls = __webpack_require__(1);\n\nvar _hls2 = _interopRequireDefault(_hls);\n\nvar _playkitJs = __webpack_require__(2);\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\n/**\n * Adapter of hls.js lib for hls content\n * @classdesc\n */\nvar HlsAdapter = function (_BaseMediaSourceAdapt) {\n _inherits(HlsAdapter, _BaseMediaSourceAdapt);\n\n _createClass(HlsAdapter, null, [{\n key: 'canPlayType',\n\n\n /**\n * Checks if hls adapter can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check.\n * @returns {boolean} - Whether the hls adapter can play a specific mime type.\n * @static\n */\n\n /**\n * The hls player instance.\n * @member {any} _hls\n * @private\n */\n\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n\n /**\n * Reference to the player tracks.\n * @member {Array<Track>} - _playerTracks\n * @type {Array<Track>}\n * @private\n */\n\n /**\n * The adapter logger.\n * @member {any} _logger\n * @static\n * @private\n */\n value: function canPlayType(mimeType) {\n var canHlsPlayType = typeof mimeType === 'string' ? HlsAdapter._hlsMimeTypes.includes(mimeType.toLowerCase()) : false;\n HlsAdapter._logger.debug('canPlayType result for mimeType:' + mimeType + ' is ' + canHlsPlayType.toString());\n return canHlsPlayType;\n }\n\n /**\n * Checks if the hls adapter is supported.\n * @function isSupported\n * @returns {boolean} - Whether hls is supported.\n * @static\n */\n\n /**\n * The supported mime types by the hls adapter.\n * @member {Array<string>} _hlsMimeType\n * @static\n * @private\n */\n\n /**\n * The id of the adapter.\n * @member {string} id\n * @static\n * @private\n */\n\n }, {\n key: 'isSupported',\n value: function isSupported() {\n var isHlsSupported = _hls2.default.isSupported();\n HlsAdapter._logger.debug('isSupported:' + isHlsSupported);\n return isHlsSupported;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which will bind to the hls adapter\n * @param {Object} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n\n }]);\n\n function HlsAdapter(videoElement, source, config) {\n _classCallCheck(this, HlsAdapter);\n\n HlsAdapter._logger.debug('Creating adapter. Hls version: ' + _hls2.default.version);\n\n var _this = _possibleConstructorReturn(this, (HlsAdapter.__proto__ || Object.getPrototypeOf(HlsAdapter)).call(this, videoElement, source, config));\n\n _this._hls = new _hls2.default(_this._config);\n _this._addBindings();\n return _this;\n }\n\n /**\n * Adds the required bindings with hls.js.\n * @function _addBindings\n * @private\n * @returns {void}\n */\n\n\n _createClass(HlsAdapter, [{\n key: '_addBindings',\n value: function _addBindings() {\n this._hls.on(_hls2.default.Events.ERROR, this._onError.bind(this));\n this._hls.on(_hls2.default.Events.LEVEL_SWITCHED, this._onLevelSwitched.bind(this));\n this._hls.on(_hls2.default.Events.AUDIO_TRACK_SWITCHED, this._onAudioTrackSwitched.bind(this));\n }\n\n /**\n * Load the video source\n * @function load\n * @returns {Promise<Object>} - The loaded data\n * @override\n */\n\n }, {\n key: 'load',\n value: function load() {\n var _this2 = this;\n\n if (!this._loadPromise) {\n this._loadPromise = new Promise(function (resolve) {\n _this2._hls.on(_hls2.default.Events.MANIFEST_LOADED, function (event, data) {\n HlsAdapter._logger.debug('The source has been loaded successfully');\n _this2._playerTracks = _this2._parseTracks(data);\n resolve({ tracks: _this2._playerTracks });\n });\n if (_this2._sourceObj && _this2._sourceObj.url) {\n _this2._hls.loadSource(_this2._sourceObj.url);\n _this2._hls.attachMedia(_this2._videoElement);\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroying the hls adapter.\n * @function destroy\n * @override\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n HlsAdapter._logger.debug('destroy');\n _get(HlsAdapter.prototype.__proto__ || Object.getPrototypeOf(HlsAdapter.prototype), 'destroy', this).call(this);\n this._loadPromise = null;\n this._removeBindings();\n this._hls.detachMedia();\n this._hls.destroy();\n }\n\n /**\n * Parse the hls tracks into player tracks.\n * @param {any} data - The event data.\n * @returns {Array<Track>} - The parsed tracks.\n * @private\n */\n\n }, {\n key: '_parseTracks',\n value: function _parseTracks(data) {\n var audioTracks = this._parseAudioTracks(data.audioTracks || []);\n var videoTracks = this._parseVideoTracks(data.levels || []);\n var textTracks = this._parseTextTracks(this._videoElement.textTracks || []);\n return audioTracks.concat(videoTracks).concat(textTracks);\n }\n\n /**\n * Parse hls audio tracks into player audio tracks.\n * @param {Array<Object>} hlsAudioTracks - The hls audio tracks.\n * @returns {Array<AudioTrack>} - The parsed audio tracks.\n * @private\n */\n\n }, {\n key: '_parseAudioTracks',\n value: function _parseAudioTracks(hlsAudioTracks) {\n var audioTracks = [];\n for (var i = 0; i < hlsAudioTracks.length; i++) {\n // Create audio tracks\n var settings = {\n id: hlsAudioTracks[i].id,\n active: this._hls.audioTrack === hlsAudioTracks[i].id,\n label: hlsAudioTracks[i].name,\n language: hlsAudioTracks[i].lang,\n index: i\n };\n audioTracks.push(new _playkitJs.AudioTrack(settings));\n }\n return audioTracks;\n }\n\n /**\n * Parse hls video tracks into player video tracks.\n * @param {Array<Object>} hlsVideoTracks - The hls video tracks.\n * @returns {Array<VideoTrack>} - The parsed video tracks.\n * @private\n */\n\n }, {\n key: '_parseVideoTracks',\n value: function _parseVideoTracks(hlsVideoTracks) {\n var videoTracks = [];\n for (var i = 0; i < hlsVideoTracks.length; i++) {\n // Create video tracks\n var settings = {\n active: this._hls.startLevel === i,\n label: hlsVideoTracks[i].name,\n bandwidth: hlsVideoTracks[i].bitrate,\n language: '',\n index: i\n };\n videoTracks.push(new _playkitJs.VideoTrack(settings));\n }\n return videoTracks;\n }\n\n /**\n * Parse native video tag text tracks into player text tracks.\n * @param {TextTrackList} vidTextTracks - The native video tag text tracks.\n * @returns {Array<TextTrack>} - The parsed text tracks.\n * @private\n */\n\n }, {\n key: '_parseTextTracks',\n value: function _parseTextTracks(vidTextTracks) {\n var textTracks = [];\n for (var i = 0; i < vidTextTracks.length; i++) {\n // Create text tracks\n var settings = {\n active: vidTextTracks[i].mode === 'showing',\n label: vidTextTracks[i].label,\n kind: vidTextTracks[i].kind,\n language: vidTextTracks[i].language,\n index: i\n };\n textTracks.push(new _playkitJs.TextTrack(settings));\n }\n return textTracks;\n }\n\n /**\n * Select an audio track.\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectAudioTrack',\n value: function selectAudioTrack(audioTrack) {\n if (audioTrack instanceof _playkitJs.AudioTrack && !audioTrack.active && this._hls.audioTracks) {\n this._hls.audioTrack = audioTrack.id;\n }\n }\n\n /**\n * Select a video track.\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the track to select.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectVideoTrack',\n value: function selectVideoTrack(videoTrack) {\n if (videoTrack instanceof _playkitJs.VideoTrack && (!videoTrack.active || this._hls.autoLevelEnabled) && this._hls.levels) {\n this._hls.nextLevel = videoTrack.index;\n }\n }\n\n /**\n * Select a text track.\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select.\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectTextTrack',\n value: function selectTextTrack(textTrack) {\n if (textTrack instanceof _playkitJs.TextTrack && !textTrack.active && this._videoElement.textTracks) {\n this._disableAllTextTracks();\n this._videoElement.textTracks[textTrack.index].mode = 'showing';\n HlsAdapter._logger.debug('Text track changed', textTrack);\n this._onTrackChanged(textTrack);\n }\n }\n\n /** Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'hideTextTrack',\n value: function hideTextTrack() {\n this._disableAllTextTracks();\n }\n\n /**\n * Enables adaptive bitrate switching according to hls.js logic.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'enableAdaptiveBitrate',\n value: function enableAdaptiveBitrate() {\n this._hls.nextLevel = -1;\n }\n\n /**\n * Triggers on video track selection (auto or manually) the 'videotrackchanged' event forward.\n * @function _onLevelSwitched\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_onLevelSwitched',\n value: function _onLevelSwitched(event, data) {\n var videoTrack = this._playerTracks.find(function (track) {\n return track instanceof _playkitJs.VideoTrack && track.index === data.level;\n });\n HlsAdapter._logger.debug('Video track changed', videoTrack);\n this._onTrackChanged(videoTrack);\n }\n\n /**\n * Triggers on audio track selection (auto or manually) the 'audiotrackchanged' event forward.\n * @function _onAudioTrackSwitched\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_onAudioTrackSwitched',\n value: function _onAudioTrackSwitched(event, data) {\n var audioTrack = this._playerTracks.find(function (track) {\n return track instanceof _playkitJs.AudioTrack && track.id === data.id;\n });\n HlsAdapter._logger.debug('Audio track changed', audioTrack);\n this._onTrackChanged(audioTrack);\n }\n\n /**\n * Disables all the video tag text tracks.\n * @returns {void}\n * @private\n */\n\n }, {\n key: '_disableAllTextTracks',\n value: function _disableAllTextTracks() {\n var vidTextTracks = this._videoElement.textTracks;\n for (var i = 0; i < vidTextTracks.length; i++) {\n vidTextTracks[i].mode = 'hidden';\n }\n }\n\n /**\n * Handles hls errors.\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_onError',\n value: function _onError(event, data) {\n var errorType = data.type;\n var errorDetails = data.details;\n var errorFatal = data.fatal;\n if (errorFatal) {\n switch (errorType) {\n case _hls2.default.ErrorTypes.NETWORK_ERROR:\n HlsAdapter._logger.error(\"fatal network error encountered, try to recover\");\n this._hls.startLoad();\n break;\n case _hls2.default.ErrorTypes.MEDIA_ERROR:\n HlsAdapter._logger.error(\"fatal media error encountered, try to recover\");\n this._hls.recoverMediaError();\n break;\n default:\n HlsAdapter._logger.error(\"fatal error, cannot recover\");\n this.destroy();\n break;\n }\n } else {\n switch (errorDetails) {\n case _hls2.default.ErrorDetails.MANIFEST_LOAD_ERROR:\n case _hls2.default.ErrorDetails.MANIFEST_LOAD_TIMEOUT:\n case _hls2.default.ErrorDetails.MANIFEST_PARSING_ERROR:\n case _hls2.default.ErrorDetails.LEVEL_LOAD_ERROR:\n case _hls2.default.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n case _hls2.default.ErrorDetails.LEVEL_SWITCH_ERROR:\n case _hls2.default.ErrorDetails.FRAG_LOAD_ERROR:\n case _hls2.default.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case _hls2.default.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case _hls2.default.ErrorDetails.FRAG_PARSING_ERROR:\n case _hls2.default.ErrorDetails.BUFFER_APPEND_ERROR:\n case _hls2.default.ErrorDetails.BUFFER_APPENDING_ERROR:\n HlsAdapter._logger.error(errorType, errorDetails);\n break;\n default:\n break;\n }\n }\n }\n\n /**\n * Removes hls.js bindings.\n * @returns {void}\n * @private\n */\n\n }, {\n key: '_removeBindings',\n value: function _removeBindings() {\n this._hls.off(_hls2.default.Events.ERROR, this._onError);\n this._hls.off(_hls2.default.Events.LEVEL_SWITCHED, this._onLevelSwitched);\n this._hls.off(_hls2.default.Events.AUDIO_TRACK_SWITCHED, this._onAudioTrackSwitched);\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * In case the adapter preformed a load it will return the manifest url.\n * @public\n * @returns {string} - The src url.\n */\n\n }, {\n key: 'src',\n get: function get() {\n if (this._loadPromise && this._sourceObj) {\n return this._sourceObj.url;\n }\n return \"\";\n }\n }]);\n\n return HlsAdapter;\n}(_playkitJs.BaseMediaSourceAdapter);\n\n// Register hls adapter to the media source adapter provider.\n\n\nHlsAdapter.id = 'HlsAdapter';\nHlsAdapter._logger = _playkitJs.BaseMediaSourceAdapter.getLogger(HlsAdapter.id);\nHlsAdapter._hlsMimeTypes = ['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/x-mpegurl', 'video/x-mpegurl', 'video/mpegurl', 'application/mpegurl'];\nexports.default = HlsAdapter;\nif (HlsAdapter.isSupported()) {\n (0, _playkitJs.registerMediaSourceAdapter)(HlsAdapter);\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n/***/ })\n/******/ ]);\n});\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar 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// 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 } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\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){\n// see https://tools.ietf.org/html/rfc1808\r\n\r\n/* jshint ignore:start */\r\n(function(root) { \r\n/* jshint ignore:end */\r\n\r\n var URL_REGEX = /^((?:[^\\/;?#]+:)?)(\\/\\/[^\\/\\;?#]*)?(.*?)??(;.*?)?(\\?.*?)?(#.*?)?$/;\r\n var FIRST_SEGMENT_REGEX = /^([^\\/;?#]*)(.*)$/;\r\n var SLASH_DOT_REGEX = /(?:\\/|^)\\.(?=\\/)/g;\r\n var SLASH_DOT_DOT_REGEX = /(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/).*?(?=\\/)/g;\r\n\r\n var URLToolkit = { // jshint ignore:line\r\n // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //\r\n // E.g\r\n // With opts.alwaysNormalize = false (default, spec compliant)\r\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g\r\n // With opts.alwaysNormalize = true (default, not spec compliant)\r\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/g\r\n buildAbsoluteURL: function(baseURL, relativeURL, opts) {\r\n opts = opts || {};\r\n // remove any remaining space and CRLF\r\n baseURL = baseURL.trim();\r\n relativeURL = relativeURL.trim();\r\n if (!relativeURL) {\r\n // 2a) If the embedded URL is entirely empty, it inherits the\r\n // entire base URL (i.e., is set equal to the base URL)\r\n // and we are done.\r\n if (!opts.alwaysNormalize) {\r\n return baseURL;\r\n }\r\n var basePartsForNormalise = this.parseURL(baseURL);\r\n if (!baseParts) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n basePartsForNormalise.path = URLToolkit.normalizePath(basePartsForNormalise.path);\r\n return URLToolkit.buildURLFromParts(basePartsForNormalise);\r\n }\r\n var relativeParts = this.parseURL(relativeURL);\r\n if (!relativeParts) {\r\n throw new Error('Error trying to parse relative URL.');\r\n }\r\n if (relativeParts.scheme) {\r\n // 2b) If the embedded URL starts with a scheme name, it is\r\n // interpreted as an absolute URL and we are done.\r\n if (!opts.alwaysNormalize) {\r\n return relativeURL;\r\n }\r\n relativeParts.path = URLToolkit.normalizePath(relativeParts.path);\r\n return URLToolkit.buildURLFromParts(relativeParts);\r\n }\r\n var baseParts = this.parseURL(baseURL);\r\n if (!baseParts) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== '/') {\r\n // If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc\r\n // This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'\r\n var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);\r\n baseParts.netLoc = pathParts[1];\r\n baseParts.path = pathParts[2];\r\n }\r\n if (baseParts.netLoc && !baseParts.path) {\r\n baseParts.path = '/';\r\n }\r\n var builtParts = {\r\n // 2c) Otherwise, the embedded URL inherits the scheme of\r\n // the base URL.\r\n scheme: baseParts.scheme,\r\n netLoc: relativeParts.netLoc,\r\n path: null,\r\n params: relativeParts.params,\r\n query: relativeParts.query,\r\n fragment: relativeParts.fragment\r\n };\r\n if (!relativeParts.netLoc) {\r\n // 3) If the embedded URL's <net_loc> is non-empty, we skip to\r\n // Step 7. Otherwise, the embedded URL inherits the <net_loc>\r\n // (if any) of the base URL.\r\n builtParts.netLoc = baseParts.netLoc;\r\n // 4) If the embedded URL path is preceded by a slash \"/\", the\r\n // path is not relative and we skip to Step 7.\r\n if (relativeParts.path[0] !== '/') {\r\n if (!relativeParts.path) {\r\n // 5) If the embedded URL path is empty (and not preceded by a\r\n // slash), then the embedded URL inherits the base URL path\r\n builtParts.path = baseParts.path;\r\n // 5a) if the embedded URL's <params> is non-empty, we skip to\r\n // step 7; otherwise, it inherits the <params> of the base\r\n // URL (if any) and\r\n if (!relativeParts.params) {\r\n builtParts.params = baseParts.params;\r\n // 5b) if the embedded URL's <query> is non-empty, we skip to\r\n // step 7; otherwise, it inherits the <query> of the base\r\n // URL (if any) and we skip to step 7.\r\n if (!relativeParts.query) {\r\n builtParts.query = baseParts.query;\r\n }\r\n }\r\n } else {\r\n // 6) The last segment of the base URL's path (anything\r\n // following the rightmost slash \"/\", or the entire path if no\r\n // slash is present) is removed and the embedded URL's path is\r\n // appended in its place.\r\n var baseURLPath = baseParts.path;\r\n var newPath = baseURLPath.substring(0, baseURLPath.lastIndexOf('/') + 1) + relativeParts.path;\r\n builtParts.path = URLToolkit.normalizePath(newPath);\r\n }\r\n }\r\n }\r\n if (builtParts.path === null) {\r\n builtParts.path = opts.alwaysNormalize ? URLToolkit.normalizePath(relativeParts.path) : relativeParts.path;\r\n }\r\n return URLToolkit.buildURLFromParts(builtParts);\r\n },\r\n parseURL: function(url) {\r\n var parts = URL_REGEX.exec(url);\r\n if (!parts) {\r\n return null;\r\n }\r\n return {\r\n scheme: parts[1] || '',\r\n netLoc: parts[2] || '',\r\n path: parts[3] || '',\r\n params: parts[4] || '',\r\n query: parts[5] || '',\r\n fragment: parts[6] || ''\r\n };\r\n },\r\n normalizePath: function(path) {\r\n // The following operations are\r\n // then applied, in order, to the new path:\r\n // 6a) All occurrences of \"./\", where \".\" is a complete path\r\n // segment, are removed.\r\n // 6b) If the path ends with \".\" as a complete path segment,\r\n // that \".\" is removed.\r\n path = path.split('').reverse().join('').replace(SLASH_DOT_REGEX, '');\r\n // 6c) All occurrences of \"<segment>/../\", where <segment> is a\r\n // complete path segment not equal to \"..\", are removed.\r\n // Removal of these path segments is performed iteratively,\r\n // removing the leftmost matching pattern on each iteration,\r\n // until no matching pattern remains.\r\n // 6d) If the path ends with \"<segment>/..\", where <segment> is a\r\n // complete path segment not equal to \"..\", that\r\n // \"<segment>/..\" is removed.\r\n while (path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, '')).length) {} // jshint ignore:line\r\n return path.split('').reverse().join('');\r\n },\r\n buildURLFromParts: function(parts) {\r\n return parts.scheme + parts.netLoc + parts.path + parts.params + parts.query + parts.fragment;\r\n }\r\n };\r\n\r\n/* jshint ignore:start */\r\n if(typeof exports === 'object' && typeof module === 'object')\r\n module.exports = URLToolkit;\r\n else if(typeof define === 'function' && define.amd)\r\n define([], function() { return URLToolkit; });\r\n else if(typeof exports === 'object')\r\n exports[\"URLToolkit\"] = URLToolkit;\r\n else\r\n root[\"URLToolkit\"] = URLToolkit;\r\n})(this);\r\n/* jshint ignore:end */\r\n\n},{}],3:[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},{}],4:[function(_dereq_,module,exports){\n/**\n * HLS config\n */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.hlsDefaultConfig = undefined;\n\nvar _abrController = _dereq_(5);\n\nvar _abrController2 = _interopRequireDefault(_abrController);\n\nvar _bufferController = _dereq_(8);\n\nvar _bufferController2 = _interopRequireDefault(_bufferController);\n\nvar _capLevelController = _dereq_(9);\n\nvar _capLevelController2 = _interopRequireDefault(_capLevelController);\n\nvar _fpsController = _dereq_(10);\n\nvar _fpsController2 = _interopRequireDefault(_fpsController);\n\nvar _xhrLoader = _dereq_(59);\n\nvar _xhrLoader2 = _interopRequireDefault(_xhrLoader);\n\nvar _audioTrackController = _dereq_(7);\n\nvar _audioTrackController2 = _interopRequireDefault(_audioTrackController);\n\nvar _audioStreamController = _dereq_(6);\n\nvar _audioStreamController2 = _interopRequireDefault(_audioStreamController);\n\nvar _cues = _dereq_(50);\n\nvar _cues2 = _interopRequireDefault(_cues);\n\nvar _timelineController = _dereq_(16);\n\nvar _timelineController2 = _interopRequireDefault(_timelineController);\n\nvar _subtitleTrackController = _dereq_(15);\n\nvar _subtitleTrackController2 = _interopRequireDefault(_subtitleTrackController);\n\nvar _subtitleStreamController = _dereq_(14);\n\nvar _subtitleStreamController2 = _interopRequireDefault(_subtitleStreamController);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//#endif\n\n//#endif\n\n//#if subtitle\n\n//import FetchLoader from './utils/fetch-loader';\n//#if altaudio\nvar hlsDefaultConfig = exports.hlsDefaultConfig = {\n autoStartLoad: true, // used by stream-controller\n startPosition: -1, // used by stream-controller\n defaultAudioCodec: undefined, // used by stream-controller\n debug: false, // used by logger\n capLevelOnFPSDrop: false, // used by fps-controller\n capLevelToPlayerSize: false, // used by cap-level-controller\n initialLiveManifestSize: 1, // used by stream-controller\n maxBufferLength: 30, // used by stream-controller\n maxBufferSize: 60 * 1000 * 1000, // used by stream-controller\n maxBufferHole: 0.5, // used by stream-controller\n maxSeekHole: 2, // used by stream-controller\n lowBufferWatchdogPeriod: 0.5, // used by stream-controller\n highBufferWatchdogPeriod: 3, // used by stream-controller\n nudgeOffset: 0.1, // used by stream-controller\n nudgeMaxRetry: 3, // used by stream-controller\n maxFragLookUpTolerance: 0.25, // used by stream-controller\n liveSyncDurationCount: 3, // used by stream-controller\n liveMaxLatencyDurationCount: Infinity, // used by stream-controller\n liveSyncDuration: undefined, // used by stream-controller\n liveMaxLatencyDuration: undefined, // used by stream-controller\n maxMaxBufferLength: 600, // used by stream-controller\n enableWorker: true, // used by demuxer\n enableSoftwareAES: true, // used by decrypter\n manifestLoadingTimeOut: 10000, // used by playlist-loader\n manifestLoadingMaxRetry: 1, // used by playlist-loader\n manifestLoadingRetryDelay: 1000, // used by playlist-loader\n manifestLoadingMaxRetryTimeout: 64000, // used by playlist-loader\n startLevel: undefined, // used by level-controller\n levelLoadingTimeOut: 10000, // used by playlist-loader\n levelLoadingMaxRetry: 4, // used by playlist-loader\n levelLoadingRetryDelay: 1000, // used by playlist-loader\n levelLoadingMaxRetryTimeout: 64000, // used by playlist-loader\n fragLoadingTimeOut: 20000, // used by fragment-loader\n fragLoadingMaxRetry: 6, // used by fragment-loader\n fragLoadingRetryDelay: 1000, // used by fragment-loader\n fragLoadingMaxRetryTimeout: 64000, // used by fragment-loader\n fragLoadingLoopThreshold: 3, // used by stream-controller\n startFragPrefetch: false, // used by stream-controller\n fpsDroppedMonitoringPeriod: 5000, // used by fps-controller\n fpsDroppedMonitoringThreshold: 0.2, // used by fps-controller\n appendErrorMaxRetry: 3, // used by buffer-controller\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 //#if altaudio\n audioStreamController: _audioStreamController2.default,\n audioTrackController: _audioTrackController2.default,\n //#endif\n //#if subtitle\n subtitleStreamController: _subtitleStreamController2.default,\n subtitleTrackController: _subtitleTrackController2.default,\n timelineController: _timelineController2.default,\n cueHandler: _cues2.default,\n enableCEA708Captions: true, // used by timeline-controller\n enableWebVTT: true, // used by timeline-controller\n captionsTextTrack1Label: 'English', // used by timeline-controller\n captionsTextTrack1LanguageCode: 'en', // used by timeline-controller\n captionsTextTrack2Label: 'Spanish', // used by timeline-controller\n captionsTextTrack2LanguageCode: 'es', // used by timeline-controller\n //#endif\n stretchShortVideoTrack: false, // used by mp4-remuxer\n forceKeyFrameOnDiscontinuity: true, // used by ts-demuxer\n abrEwmaFastLive: 3, // used by abr-controller\n abrEwmaSlowLive: 9, // used by abr-controller\n abrEwmaFastVoD: 3, // used by abr-controller\n abrEwmaSlowVoD: 9, // used by abr-controller\n abrEwmaDefaultEstimate: 5e5, // 500 kbps // used by abr-controller\n abrBandWidthFactor: 0.95, // used by abr-controller\n abrBandWidthUpFactor: 0.7, // used by abr-controller\n abrMaxWithRealBitrate: false, // used by abr-controller\n maxStarvationDelay: 4, // used by abr-controller\n maxLoadingDelay: 4, // used by abr-controller\n minAutoBitrate: 0 // used by hls\n};\n\n},{\"10\":10,\"14\":14,\"15\":15,\"16\":16,\"5\":5,\"50\":50,\"59\":59,\"6\":6,\"7\":7,\"8\":8,\"9\":9}],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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _bufferHelper = _dereq_(37);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _errors = _dereq_(33);\n\nvar _logger = _dereq_(54);\n\nvar _ewmaBandwidthEstimator = _dereq_(52);\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, (AbrController.__proto__ || 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._nextAutoLevel = -1;\n _this.hls = hls;\n _this.timer = null;\n _this._bwEstimator = null;\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 minAutoLevel = hls.minAutoLevel;\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 level = levels[frag.level],\n levelBitrate = level.realBitrate ? Math.max(level.realBitrate, level.bitrate) : level.bitrate,\n expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levelBitrate / 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 > minAutoLevel; 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 var levelNextBitrate = levels[nextLoadLevel].realBitrate ? Math.max(levels[nextLoadLevel].realBitrate, levels[nextLoadLevel].bitrate) : levels[nextLoadLevel].bitrate;\n fragLevelNextLoadedDelay = frag.duration * levelNextBitrate / (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 _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' && !isNaN(frag.sn)) {\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\n // compute level average bitrate\n if (this.hls.config.abrMaxWithRealBitrate) {\n var level = this.hls.levels[frag.level];\n var loadedBytes = (level.loaded ? level.loaded.bytes : 0) + data.stats.loaded;\n var loadedDuration = (level.loaded ? level.loaded.duration : 0) + data.frag.duration;\n level.loaded = { bytes: loadedBytes, duration: loadedDuration };\n level.realBitrate = Math.round(8 * loadedBytes / loadedDuration);\n }\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' && !isNaN(frag.sn) && (!frag.bitrateTest || stats.tload === stats.tbuffered)) {\n // use tparsed-trequest instead of tbuffered-trequest to compute fragLoadingProcessing; rationale is that buffer appending only happens once media is attached\n // 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\n // as a consequence it could happen really late in the process. meaning that appending duration might appears huge ... leading to underestimated throughput estimation\n var fragLoadingProcessingMs = stats.tparsed - 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 stats.bwEstimate = this._bwEstimator.getEstimate();\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 clearInterval(this.timer);\n this.timer = null;\n }\n\n // return next auto level\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 live = levelDetails ? levelDetails.live : false,\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].realBitrate ? Math.max(levels[i].realBitrate, levels[i].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 live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches\n // 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 ...\n // special case to support startLevel = -1 (bitrateTest) on live streams : in that case we should not exit loop so that _findBestLevel will return -1\n !fetchDuration || live && !this.bitrateTestDelay || fetchDuration < maxFetchDuration)) {\n // as we are looping from highest to lowest, this will return the best achievable quality level\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: 'nextAutoLevel',\n get: function get() {\n var forcedAutoLevel = this._nextAutoLevel;\n var bwEstimator = this._bwEstimator;\n // in case next auto level has been forced, and bw not available or not reliable, return forced value\n if (forcedAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {\n return forcedAutoLevel;\n }\n // compute next level using ABR logic\n var nextABRAutoLevel = this._nextABRAutoLevel;\n // if forced auto level has been defined, use it to cap ABR computed quality level\n if (forcedAutoLevel !== -1) {\n nextABRAutoLevel = Math.min(forcedAutoLevel, nextABRAutoLevel);\n }\n return nextABRAutoLevel;\n },\n set: function set(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n }, {\n key: '_nextABRAutoLevel',\n get: function get() {\n var hls = this.hls,\n maxAutoLevel = hls.maxAutoLevel,\n levels = hls.levels,\n config = hls.config,\n minAutoLevel = hls.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 = currentFragDuration ? Math.min(currentFragDuration, config.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 // cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration\n var maxLoadingDelay = currentFragDuration ? Math.min(currentFragDuration, config.maxLoadingDelay) : config.maxLoadingDelay;\n maxStarvationDelay = 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},{\"33\":33,\"34\":34,\"35\":35,\"37\":37,\"52\":52,\"54\":54}],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 _binarySearch = _dereq_(48);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(37);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(25);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(38);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(55);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(33);\n\nvar _logger = _dereq_(54);\n\nvar _discontinuities = _dereq_(51);\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 BUFFER_FLUSHING: 'BUFFER_FLUSHING',\n ENDED: 'ENDED',\n ERROR: 'ERROR',\n WAITING_INIT_PTS: 'WAITING_INIT_PTS'\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, (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));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this._state = State.STOPPED;\n _this.ontick = _this.tick.bind(_this);\n _this.initPTS = [];\n _this.waitingFragment = null;\n _this.videoTrackCC = null;\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 //Signal that video PTS was found\n\n }, {\n key: 'onInitPtsFound',\n value: function onInitPtsFound(data) {\n var demuxerId = data.id,\n cc = data.frag.cc,\n initPTS = data.initPTS;\n if (demuxerId === 'main') {\n //Always update the new INIT PTS\n //Can change due level switch\n this.initPTS[cc] = initPTS;\n this.videoTrackCC = cc;\n _logger.logger.log('InitPTS for cc:' + cc + ' found from video track:' + initPTS);\n\n //If we are waiting we need to demux/remux the waiting frag\n //With the new initPTS\n if (this.state === State.WAITING_INIT_PTS) {\n this.tick();\n }\n }\n }\n }, {\n key: 'startLoad',\n value: function startLoad(startPosition) {\n if (this.tracks) {\n var lastCurrentTime = this.lastCurrentTime;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.fragLoadError = 0;\n if (lastCurrentTime > 0 && startPosition === -1) {\n _logger.logger.log('audio:override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));\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 case State.BUFFER_FLUSHING:\n break;\n case State.STARTING:\n this.state = State.WAITING_TRACK;\n this.loadedmetadata = false;\n break;\n case State.IDLE:\n var tracks = this.tracks;\n // audio tracks not received => exit loop\n if (!tracks) {\n break;\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 (!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 if (pos === undefined) {\n break;\n }\n }\n var media = this.mediaBuffer ? this.mediaBuffer : this.media,\n 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 audioSwitch = this.audioSwitch,\n trackId = this.trackId;\n\n // if buffer length is less than maxBufLen try to load a new fragment\n if ((bufferLen < maxBufLen || audioSwitch) && trackId < tracks.length) {\n trackDetails = tracks[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 (!audioSwitch && !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 // When switching audio track, reload audio as close as possible to currentTime\n if (audioSwitch) {\n if (trackDetails.live && !trackDetails.PTSKnown) {\n _logger.logger.log('switching audiotrack, live stream, unknown PTS,load first fragment');\n bufferEnd = 0;\n } else {\n bufferEnd = pos;\n // if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime\n if (trackDetails.PTSKnown && pos < start) {\n // if everything is buffered from pos to start or if audio buffer upfront, let's seek to start\n if (bufferInfo.end > start || bufferInfo.nextStart) {\n _logger.logger.log('alt audio track ahead of main track, seek to start of alt audio track');\n this.media.currentTime = start + 0.05;\n } else {\n return;\n }\n }\n }\n }\n if (trackDetails.initSegment && !trackDetails.initSegment.data) {\n frag = trackDetails.initSegment;\n }\n // if bufferEnd before start of playlist, load first fragment\n else if (bufferEnd <= start) {\n frag = fragments[0];\n if (this.videoTrackCC !== null && frag.cc !== this.videoTrackCC) {\n // Ensure we find a fragment which matches the continuity of the video track\n frag = (0, _discontinuities.findFragWithCC)(fragments, this.videoTrackCC);\n }\n if (trackDetails.live && frag.loadIdx && frag.loadIdx === this.fragLoadIdx) {\n // we just loaded this first fragment, and we are still lagging behind the start of the live playlist\n // let's force seek to start\n var nextBuffered = bufferInfo.nextStart ? bufferInfo.nextStart : start;\n _logger.logger.log('no alt audio available @currentTime:' + this.media.currentTime + ', seeking @' + (nextBuffered + 0.05));\n this.media.currentTime = nextBuffered + 0.05;\n return;\n }\n } else {\n var foundFrag = void 0;\n var maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n var fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;\n var fragmentWithinToleranceTest = function fragmentWithinToleranceTest(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 // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments\n var candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);\n if (candidate.start + candidate.duration - candidateLookupTolerance <= bufferEnd) {\n return 1;\n } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n };\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n // Prefer the next fragment if it's within tolerance\n if (fragNext && !fragmentWithinToleranceTest(fragNext)) {\n foundFrag = fragNext;\n } else {\n foundFrag = _binarySearch2.default.search(fragments, fragmentWithinToleranceTest);\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 if (frag) {\n //logger.log(' loading frag ' + i +',pos/bufEnd:' + pos.toFixed(3) + '/' + bufferEnd.toFixed(3));\n if (frag.decryptdata && frag.decryptdata.uri != null && frag.decryptdata.key == null) {\n _logger.logger.log('Loading key for ' + frag.sn + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + 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 + ', cc: ' + frag.cc + ' of [' + trackDetails.startSN + ' ,' + trackDetails.endSN + '],track ' + 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 if (!isNaN(frag.sn)) {\n this.nextLoadPosition = frag.start + frag.duration;\n }\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.WAITING_INIT_PTS:\n if (this.initPTS[this.videoTrackCC] === undefined) {\n break;\n }\n\n // Ensure we don't get stuck in the WAITING_INIT_PTS state if the waiting frag CC doesn't match any initPTS\n var waitingFrag = this.waitingFragment;\n if (waitingFrag) {\n var waitingFragCC = waitingFrag.frag.cc;\n if (this.videoTrackCC !== waitingFragCC) {\n _logger.logger.warn('Waiting fragment CC (' + waitingFragCC + ') does not match video track CC (' + this.videoTrackCC + ')');\n this.waitingFragment = null;\n this.state = State.IDLE;\n } else {\n this.state = State.FRAG_LOADING;\n this.onFragLoaded(this.waitingFragment);\n this.waitingFragment = null;\n }\n } else {\n this.state = State.IDLE;\n }\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 = this.mediaBuffer = 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: 'onAudioTrackSwitching',\n value: function onAudioTrackSwitching(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\n this.fragCurrent = null;\n this.state = State.PAUSED;\n this.waitingFragment = null;\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\n //should we switch tracks ?\n if (altAudio) {\n this.audioSwitch = true;\n //main audio track are handled by stream-controller, just do something if switching to alt audio track\n this.state = State.IDLE;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n }\n this.tick();\n }\n }, {\n key: 'onAudioTrackLoaded',\n value: function onAudioTrackLoaded(data) {\n var newDetails = data.details,\n trackId = data.id,\n track = this.tracks[trackId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n _logger.logger.log('track ' + trackId + ' loaded [' + newDetails.startSN + ',' + newDetails.endSN + '],duration:' + duration);\n\n if (newDetails.live) {\n var curDetails = track.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 // TODO\n //this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n _logger.logger.log('live audio playlist sliding:' + sliding.toFixed(3));\n } else {\n _logger.logger.log('live audio playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n _logger.logger.log('live audio playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n track.details = newDetails;\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 = newDetails.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 fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING && fragCurrent && fragLoaded.type === 'audio' && fragLoaded.level === fragCurrent.level && fragLoaded.sn === fragCurrent.sn) {\n var track = this.tracks[this.trackId],\n details = track.details,\n duration = details.totalduration,\n trackId = fragCurrent.level,\n sn = fragCurrent.sn,\n cc = fragCurrent.cc,\n audioCodec = this.config.defaultAudioCodec || track.audioCodec || 'mp4a.40.2',\n stats = this.stats = data.stats;\n if (sn === 'initSegment') {\n this.state = State.IDLE;\n\n stats.tparsed = stats.tbuffered = performance.now();\n details.initSegment.data = data.payload;\n this.hls.trigger(_events2.default.FRAG_BUFFERED, { stats: stats, frag: fragCurrent, id: 'audio' });\n this.tick();\n } else {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.appended = false;\n if (!this.demuxer) {\n this.demuxer = new _demuxer2.default(this.hls, 'audio');\n }\n //Check if we have video initPTS\n // If not we need to wait for it\n var initPTS = this.initPTS[cc];\n var initSegmentData = details.initSegment ? details.initSegment.data : [];\n if (details.initSegment || initPTS !== undefined) {\n this.pendingBuffering = true;\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 = false; //details.PTSKnown || !details.live;\n this.demuxer.push(data.payload, initSegmentData, audioCodec, null, fragCurrent, duration, accurateTimeOffset, initPTS);\n } else {\n _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);\n this.waitingFragment = data;\n this.state = State.WAITING_INIT_PTS;\n }\n }\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n var fragNew = data.frag;\n if (fragCurrent && data.id === 'audio' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === State.PARSING) {\n var tracks = data.tracks,\n track = void 0;\n\n // delete any video track found on audio demuxer\n if (tracks.video) {\n delete tracks.video;\n }\n\n // include levelCodec in audio and video tracks\n track = tracks.audio;\n if (track) {\n track.levelCodec = track.codec;\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 var appendObj = { type: 'audio', data: initSegment, parent: 'audio', content: 'initSegment' };\n if (this.audioSwitch) {\n this.pendingData = [appendObj];\n } else {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n }\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 var fragNew = data.frag;\n if (fragCurrent && data.id === 'audio' && data.type === 'audio' && fragNew.sn === fragCurrent.sn && fragNew.level === fragCurrent.level && this.state === State.PARSING) {\n var trackId = this.trackId,\n track = this.tracks[trackId],\n hls = this.hls;\n\n if (isNaN(data.endPTS)) {\n data.endPTS = data.startPTS + fragCurrent.duration;\n data.endDTS = data.startDTS + fragCurrent.duration;\n }\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, fragCurrent, data.startPTS, data.endPTS);\n\n var audioSwitch = this.audioSwitch,\n media = this.media,\n appendOnBufferFlush = false;\n //Only flush audio from old audio tracks when PTS is known on new audio track\n if (audioSwitch && media) {\n if (media.readyState) {\n var currentTime = media.currentTime;\n _logger.logger.log('switching audio track : currentTime:' + currentTime);\n if (currentTime >= data.startPTS) {\n _logger.logger.log('switching audio track : flushing all audio');\n this.state = State.BUFFER_FLUSHING;\n hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n appendOnBufferFlush = true;\n //Lets announce that the initial audio track switch flush occur\n this.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n }\n } else {\n //Lets announce that the initial audio track switch flush occur\n this.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n }\n }\n\n var pendingData = this.pendingData;\n if (!this.audioSwitch) {\n [data.data1, data.data2].forEach(function (buffer) {\n if (buffer && buffer.length) {\n pendingData.push({ type: data.type, data: buffer, parent: 'audio', content: 'data' });\n }\n });\n if (!appendOnBufferFlush && pendingData.length) {\n pendingData.forEach(function (appendObj) {\n // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)\n // in that case it is useless to append following segments\n if (_this2.state === State.PARSING) {\n // arm pending Buffering flag before appending a segment\n _this2.pendingBuffering = true;\n _this2.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n }\n });\n this.pendingData = [];\n this.appended = true;\n }\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 var fragNew = data.frag;\n if (fragCurrent && data.id === 'audio' && fragNew.sn === fragCurrent.sn && fragNew.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 var state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = data.pending > 0;\n this._checkAppendedParsed();\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n var frag = this.fragCurrent,\n stats = this.stats,\n hls = this.hls;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = performance.now();\n 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 if (this.audioSwitch && this.appended) {\n this.audioSwitch = false;\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: this.trackId });\n }\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 // switch error to fatal\n data.fatal = true;\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 case _errors.ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (data.parent === 'audio' && (this.state === State.PARSING || this.state === State.PARSED)) {\n var media = this.mediaBuffer,\n currentTime = this.media.currentTime,\n mediaBuffered = media && _bufferHelper2.default.isBuffered(media, currentTime) && _bufferHelper2.default.isBuffered(media, currentTime + 0.5);\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n var _config = this.config;\n if (_config.maxMaxBufferLength >= _config.maxBufferLength) {\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('audio:reduce max buffer length to ' + _config.maxMaxBufferLength + 's');\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * _config.fragLoadingLoopThreshold;\n }\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/video-dev/hls.js/pull/708\n // in that case flush the whole audio buffer to recover\n _logger.logger.warn('buffer full error also media.currentTime is not buffered, flush audio buffer');\n this.fragCurrent = null;\n // flush everything\n this.state = State.BUFFER_FLUSHING;\n this.hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n }\n }\n break;\n default:\n break;\n }\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n var _this3 = this;\n\n var pendingData = this.pendingData;\n if (pendingData && pendingData.length) {\n _logger.logger.log('appending pending audio data on Buffer Flushed');\n pendingData.forEach(function (appendObj) {\n _this3.hls.trigger(_events2.default.BUFFER_APPENDING, appendObj);\n });\n this.appended = true;\n this.pendingData = [];\n this.state = State.PARSED;\n } else {\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 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('audio stream:' + previousState + '->' + nextState);\n }\n },\n get: function get() {\n return this._state;\n }\n }]);\n\n return AudioStreamController;\n}(_eventHandler2.default);\n\nexports.default = AudioStreamController;\n\n},{\"25\":25,\"33\":33,\"34\":34,\"35\":35,\"37\":37,\"38\":38,\"48\":48,\"51\":51,\"54\":54,\"55\":55}],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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(54);\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 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));\n\n _this.ticks = 0;\n _this.ontick = _this.tick.bind(_this);\n return _this;\n }\n\n _createClass(AudioTrackController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\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 this.updateTrack(this.trackId);\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 hls = this.hls,\n type = audioTrack.type,\n url = audioTrack.url,\n eventObj = { id: newId, type: type, url: url };\n // keep AUDIO_TRACK_SWITCH for legacy reason\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCH, eventObj);\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHING, eventObj);\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 hls.trigger(_events2.default.AUDIO_TRACK_LOADING, { url: url, id: newId });\n }\n }\n }\n }, {\n key: 'updateTrack',\n value: function updateTrack(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('updating audioTrack ' + newId);\n var audioTrack = this.tracks[newId],\n url = audioTrack.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},{\"34\":34,\"35\":35,\"54\":54}],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\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(54);\n\nvar _errors = _dereq_(33);\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 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));\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 _this.tracks = {};\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: 'onLevelPtsUpdated',\n value: function onLevelPtsUpdated(data) {\n var type = data.type;\n var audioTrack = this.tracks.audio;\n\n // Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)\n // in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`\n // 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\n // `SourceBuffer.abort()` and adjusting `SourceBuffer.timestampOffset` if `SourceBuffer.updating` is false or awaiting `updateend`\n // event if SB is in updating state.\n // More info here: https://github.com/video-dev/hls.js/issues/332#issuecomment-257986486\n\n if (type === 'audio' && audioTrack && audioTrack.container === 'audio/mpeg') {\n // Chrome audio mp3 track\n var audioBuffer = this.sourceBuffer.audio;\n var delta = Math.abs(audioBuffer.timestampOffset - data.start);\n\n // adjust timestamp offset if time delta is greater than 100ms\n if (delta > 0.1) {\n var updating = audioBuffer.updating;\n\n try {\n audioBuffer.abort();\n } catch (err) {\n updating = true;\n _logger.logger.warn('can not abort audio buffer: ' + err);\n }\n\n if (!updating) {\n _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + data.start);\n audioBuffer.timestampOffset = data.start;\n } else {\n this.audioTimestampOffset = data.start;\n }\n }\n }\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 URL.revokeObjectURL(this.media.src);\n this.media.removeAttribute('src');\n this.media.load();\n }\n\n this.mediaSource = null;\n this.media = null;\n this.pendingTracks = {};\n this.tracks = {};\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 // update timestampOffset\n if (this.audioTimestampOffset) {\n var audioBuffer = this.sourceBuffer.audio;\n _logger.logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + this.audioTimestampOffset);\n audioBuffer.timestampOffset = this.audioTimestampOffset;\n delete this.audioTimestampOffset;\n }\n\n if (this._needsFlush) {\n this.doFlush();\n }\n\n if (this._needsEos) {\n this.checkEos();\n }\n this.appending = false;\n var parent = this.parent;\n // count nb of pending segments waiting for appending on this sourcebuffer\n var pending = this.segments.reduce(function (counter, segment) {\n return segment.parent === parent ? counter + 1 : counter;\n }, 0);\n this.hls.trigger(_events2.default.BUFFER_APPENDED, { parent: parent, pending: pending });\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 this.tracks[trackName] = { codec: codec, container: track.container };\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 });\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 var sbobj = sb[type];\n if (!sbobj.ended) {\n return;\n }\n if (sbobj.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 try {\n mediaSource.endOfStream();\n } catch (e) {\n _logger.logger.warn('exception while calling mediaSource.endOfStream()');\n }\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/video-dev/hls.js/issues/355\n\n }, {\n key: 'updateMediaElementDuration',\n value: function updateMediaElementDuration() {\n var media = this.media,\n mediaSource = this.mediaSource,\n sourceBuffer = this.sourceBuffer,\n levelDuration = this._levelDuration;\n if (levelDuration === null || !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 var duration = media.duration;\n // 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\n if (levelDuration > this._msDuration && levelDuration > duration || duration === Infinity || isNaN(duration)) {\n _logger.logger.log('Updating mediasource duration to ' + levelDuration.toFixed(3));\n this._msDuration = mediaSource.duration = 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 try {\n for (var type in sourceBuffer) {\n appended += sourceBuffer[type].buffered.length;\n }\n } catch (error) {\n // error could be thrown while accessing buffered, in case sourcebuffer has already been removed from MediaSource\n // this is harmess at this stage, catch this to avoid reporting an internal exception\n _logger.logger.error('error while accessing sourceBuffer.buffered');\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 sb = sourceBuffer[type];\n if (sb) {\n if (!sb.updating) {\n // reset sourceBuffer ended flag before appending segment\n sb.ended = false;\n //logger.log(`appending ${segment.content} ${type} SB, size:${segment.data.length}, ${segment.parent}`);\n this.parent = segment.parent;\n sb.appendBuffer(segment.data);\n this.appendError = 0;\n this.appended++;\n this.appending = true;\n } else {\n segments.unshift(segment);\n }\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, parent: segment.parent };\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 /* 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 event.fatal = false;\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.toFixed(3) + '/' + 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 try {\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 } catch (e) {\n _logger.logger.warn('exception while accessing sourcebuffer, it might have been removed from MediaSource');\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},{\"33\":33,\"34\":34,\"35\":35,\"54\":54}],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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\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, (CapLevelController.__proto__ || 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 // Don't add a restricted level more than once\n if (CapLevelController.isLevelAllowed(data.droppedLevel, this.restrictedLevels)) {\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 var hls = this.hls;\n this.restrictedLevels = [];\n if (hls.config.capLevelToPlayerSize) {\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n this.levels = data.levels;\n 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 var hls = this.hls;\n hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);\n if (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 hls.streamController.nextLevelSwitch();\n }\n this.autoLevelCapping = 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 _this2 = this;\n\n if (!this.levels) {\n return -1;\n }\n\n var validLevels = this.levels.filter(function (level, index) {\n return CapLevelController.isLevelAllowed(index, _this2.restrictedLevels) && index <= capLevelIndex;\n });\n\n return CapLevelController.getMaxLevelByMediaSize(validLevels, this.mediaWidth, this.mediaHeight);\n }\n }, {\n key: 'mediaWidth',\n get: function get() {\n var width = void 0;\n var media = this.media;\n if (media) {\n width = media.width || media.clientWidth || media.offsetWidth;\n width *= CapLevelController.contentScaleFactor;\n }\n return width;\n }\n }, {\n key: 'mediaHeight',\n get: function get() {\n var height = void 0;\n var media = this.media;\n if (media) {\n height = media.height || media.clientHeight || media.offsetHeight;\n height *= CapLevelController.contentScaleFactor;\n }\n return height;\n }\n }], [{\n key: 'isLevelAllowed',\n value: function isLevelAllowed(level) {\n var restrictedLevels = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n return restrictedLevels.indexOf(level) === -1;\n }\n }, {\n key: 'getMaxLevelByMediaSize',\n value: function getMaxLevelByMediaSize(levels, width, height) {\n if (!levels || levels && !levels.length) {\n return -1;\n }\n\n // Levels can have the same dimensions but differing bandwidths - since levels are ordered, we can look to the next\n // to determine whether we've chosen the greatest bandwidth for the media's dimensions\n var atGreatestBandiwdth = function atGreatestBandiwdth(curLevel, nextLevel) {\n if (!nextLevel) {\n return true;\n }\n return curLevel.width !== nextLevel.width || curLevel.height !== nextLevel.height;\n };\n\n // If we run through the loop without breaking, the media's dimensions are greater than every level, so default to\n // the max level\n var maxLevelIndex = levels.length - 1;\n\n for (var i = 0; i < levels.length; i += 1) {\n var level = levels[i];\n if ((level.width >= width || level.height >= height) && atGreatestBandiwdth(level, levels[i + 1])) {\n maxLevelIndex = i;\n break;\n }\n }\n\n return maxLevelIndex;\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\n return CapLevelController;\n}(_eventHandler2.default);\n\nexports.default = CapLevelController;\n\n},{\"34\":34,\"35\":35}],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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(54);\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, (FPSController.__proto__ || 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 var config = this.hls.config;\n if (config.capLevelOnFPSDrop) {\n var video = this.video = data.media instanceof HTMLVideoElement ? data.media : null;\n if (typeof video.getVideoPlaybackQuality === 'function') {\n this.isVideoPlaybackQualityAvailable = true;\n }\n clearInterval(this.timer);\n this.timer = setInterval(this.checkFPSInterval.bind(this), 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 hls = this.hls;\n 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 > hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {\n var currentLevel = hls.currentLevel;\n _logger.logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);\n if (currentLevel > 0 && (hls.autoLevelCapping === -1 || hls.autoLevelCapping >= currentLevel)) {\n currentLevel = currentLevel - 1;\n hls.trigger(_events2.default.FPS_DROP_LEVEL_CAPPING, { level: currentLevel, droppedLevel: hls.currentLevel });\n hls.autoLevelCapping = currentLevel;\n 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 var video = this.video;\n if (video) {\n if (this.isVideoPlaybackQualityAvailable) {\n var videoPlaybackQuality = video.getVideoPlaybackQuality();\n this.checkFPS(video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);\n } else {\n this.checkFPS(video, video.webkitDecodedFrameCount, video.webkitDroppedFrameCount);\n }\n }\n }\n }]);\n\n return FPSController;\n}(_eventHandler2.default);\n\nexports.default = FPSController;\n\n},{\"34\":34,\"35\":35,\"54\":54}],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 _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _id = _dereq_(27);\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\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 * id3 metadata track controller\n */\n\nvar ID3TrackController = function (_EventHandler) {\n _inherits(ID3TrackController, _EventHandler);\n\n function ID3TrackController(hls) {\n _classCallCheck(this, ID3TrackController);\n\n 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));\n\n _this.id3Track = undefined;\n _this.media = undefined;\n return _this;\n }\n\n _createClass(ID3TrackController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n\n // Add ID3 metatadata text track.\n\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n this.media = data.media;\n if (!this.media) {\n return;\n }\n\n this.id3Track = this.media.addTextTrack('metadata', 'id3');\n this.id3Track.mode = 'hidden';\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n this.media = undefined;\n }\n }, {\n key: 'onFragParsingMetadata',\n value: function onFragParsingMetadata(data) {\n var fragment = data.frag;\n var samples = data.samples;\n\n // Attempt to recreate Safari functionality by creating\n // WebKitDataCue objects when available and store the decoded\n // ID3 data in the value property of the cue\n var Cue = window.WebKitDataCue || window.VTTCue || window.TextTrackCue;\n\n for (var i = 0; i < samples.length; i++) {\n var frames = _id2.default.getID3Frames(samples[i].data);\n if (frames) {\n var startTime = samples[i].pts;\n var endTime = i < samples.length - 1 ? samples[i + 1].pts : fragment.endPTS;\n\n // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE\n if (startTime === endTime) {\n endTime += 0.0001;\n }\n\n for (var j = 0; j < frames.length; j++) {\n var frame = frames[j];\n // Safari doesn't put the timestamp frame in the TextTrack\n if (!_id2.default.isTimeStampFrame(frame)) {\n var cue = new Cue(startTime, endTime, '');\n cue.value = frame;\n this.id3Track.addCue(cue);\n }\n }\n }\n }\n }\n }]);\n\n return ID3TrackController;\n}(_eventHandler2.default);\n\nexports.default = ID3TrackController;\n\n},{\"27\":27,\"34\":34,\"35\":35}],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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(54);\n\nvar _errors = _dereq_(33);\n\nvar _bufferHelper = _dereq_(37);\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, (LevelController.__proto__ || Object.getPrototypeOf(LevelController)).call(this, hls, _events2.default.MANIFEST_LOADED, _events2.default.LEVEL_LOADED, _events2.default.FRAG_LOADED, _events2.default.ERROR));\n\n _this.ontick = _this.tick.bind(_this);\n _this._manualLevel = -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 var levels = this._levels;\n // clean up live level details to force reload them, and reset load errors\n if (levels) {\n levels.forEach(function (level) {\n level.loadError = 0;\n var levelDetails = level.details;\n if (levelDetails && levelDetails.live) {\n level.details = undefined;\n }\n });\n }\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 bitrateSet = {},\n videoCodecFound = false,\n audioCodecFound = false,\n hls = this.hls,\n brokenmp4inmp3 = /chrome|firefox/.test(navigator.userAgent.toLowerCase()),\n checkSupported = function checkSupported(type, codec) {\n return MediaSource.isTypeSupported(type + '/mp4;codecs=' + codec);\n };\n\n // regroup redundant level together\n data.levels.forEach(function (level) {\n if (level.videoCodec) {\n videoCodecFound = true;\n }\n // erase audio codec info if browser does not support mp4a.40.34. demuxer will autodetect codec and fallback to mpeg/audio\n if (brokenmp4inmp3 && level.audioCodec && level.audioCodec.indexOf('mp4a.40.34') !== -1) {\n level.audioCodec = undefined;\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 // only keep level with supported audio/video codecs\n levels = levels.filter(function (level) {\n var audioCodec = level.audioCodec,\n videoCodec = level.videoCodec;\n return (!audioCodec || checkSupported('audio', audioCodec)) && (!videoCodec || checkSupported('video', 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 (var 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: 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 var hls = this.hls;\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 var levelProperties = levels[newLevel];\n levelProperties.level = newLevel;\n // LEVEL_SWITCH to be deprecated in next major release\n hls.trigger(_events2.default.LEVEL_SWITCH, levelProperties);\n hls.trigger(_events2.default.LEVEL_SWITCHING, levelProperties);\n }\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 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 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 case _errors.ErrorDetails.REMUX_ALLOC_ERROR:\n levelId = data.level;\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.loadError) {\n level.loadError = 1;\n } else {\n level.loadError++;\n }\n // if any redundant streams available and if we haven't try them all (level.loadError is reseted on successful frag/level load.\n // if level.loadError reaches nbRedundantLevel it means that we tried them all, no hope => let's switch down\n var nbRedundantLevel = level.url.length;\n if (nbRedundantLevel > 1 && level.loadError < nbRedundantLevel) {\n level.urlId = (level.urlId + 1) % nbRedundantLevel;\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 + ': switch-down for next fragment');\n hls.nextAutoLevel = Math.max(0, levelId - 1);\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 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 // boolean used to inform stream controller not to switch back to IDLE on non fatal error\n data.levelRetry = true;\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 // switch error to fatal\n data.fatal = true;\n }\n }\n }\n }\n }\n\n // reset level load error counter on successful frag loaded\n\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var fragLoaded = data.frag;\n if (fragLoaded && fragLoaded.type === 'main') {\n var level = this._levels[fragLoaded.level];\n if (level) {\n level.loadError = 0;\n }\n }\n }\n }, {\n key: 'onLevelLoaded',\n value: function onLevelLoaded(data) {\n var levelId = data.level;\n // only process level loaded events matching with expected level\n if (levelId === this._level) {\n var curLevel = this._levels[levelId];\n // reset level load error counter on successful level loaded\n curLevel.loadError = 0;\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 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 if (level && level.url) {\n var urlId = level.urlId;\n this.hls.trigger(_events2.default.LEVEL_LOADING, { url: level.url[urlId], level: levelId, id: urlId });\n }\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.nextAutoLevel;\n }\n },\n set: function set(nextLevel) {\n this.level = nextLevel;\n if (this._manualLevel === -1) {\n this.hls.nextAutoLevel = nextLevel;\n }\n }\n }]);\n\n return LevelController;\n}(_eventHandler2.default);\n\nexports.default = LevelController;\n\n},{\"33\":33,\"34\":34,\"35\":35,\"37\":37,\"54\":54}],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\nvar _binarySearch = _dereq_(48);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nvar _bufferHelper = _dereq_(37);\n\nvar _bufferHelper2 = _interopRequireDefault(_bufferHelper);\n\nvar _demuxer = _dereq_(25);\n\nvar _demuxer2 = _interopRequireDefault(_demuxer);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _levelHelper = _dereq_(38);\n\nvar _levelHelper2 = _interopRequireDefault(_levelHelper);\n\nvar _timeRanges = _dereq_(55);\n\nvar _timeRanges2 = _interopRequireDefault(_timeRanges);\n\nvar _errors = _dereq_(33);\n\nvar _logger = _dereq_(54);\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 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 BUFFER_FLUSHING: 'BUFFER_FLUSHING',\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, (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));\n\n _this.config = hls.config;\n _this.audioCodecSwap = false;\n _this.ticks = 0;\n _this._state = State.STOPPED;\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 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 (!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 // if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime\n if (lastCurrentTime > 0 && startPosition === -1) {\n _logger.logger.log('override startPosition with lastCurrentTime @' + lastCurrentTime.toFixed(3));\n startPosition = lastCurrentTime;\n }\n this.state = State.IDLE;\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime = startPosition;\n this.tick();\n } else {\n this.forceStartLoad = true;\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 this.forceStartLoad = false;\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 break;\n case State.BUFFER_FLUSHING:\n // in buffer flushing state, reset fragLoadError counter\n this.fragLoadError = 0;\n break;\n case State.IDLE:\n this._doTickIdle();\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.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 start level loaded and media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (this.levelLastLoaded !== undefined && !media && (this.startFragRequested || !config.startFragPrefetch)) {\n return;\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 levelInfo = this.levels[level];\n\n if (!levelInfo) {\n return;\n }\n\n var levelBitrate = levelInfo.bitrate,\n maxBufLen = void 0;\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 if (levelBitrate) {\n maxBufLen = Math.max(8 * config.maxBufferSize / levelBitrate, 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;\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 this.level = hls.nextLoadLevel = level;\n\n var levelDetails = levelInfo.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;\n }\n\n // we just got done loading the final fragment, and currentPos is buffered, and there is no other buffered range after ...\n // rationale is that in case there are any buffered rangesafter, it means that there are unbuffered portion in between\n // so we should not switch to ENDED in that case, to be able to buffer themx\n var fragPrevious = this.fragPrevious;\n if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN && bufferLen && !bufferInfo.nextStart) {\n // fragPrevious is last fragment. retrieve level duration using last frag start offset + duration\n // real duration might be lower than initial duration if there are drifts between real frag duration and playlist signaling\n var duration = Math.min(media.duration, fragPrevious.start + fragPrevious.duration);\n // if 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 (audio/video offsets...)\n // tolerate up to one frag duration to cope with these cases.\n // 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\n if (duration - Math.max(bufferInfo.end, fragPrevious.start) <= Math.max(0.2, fragPrevious.duration)) {\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;\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 this._fetchPayloadOrEos(pos, bufferInfo, levelDetails);\n }\n }, {\n key: '_fetchPayloadOrEos',\n value: function _fetchPayloadOrEos(pos, bufferInfo, levelDetails) {\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;\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 if (levelDetails.initSegment && !levelDetails.initSegment.data) {\n frag = levelDetails.initSegment;\n } else {\n // in case of live playlist we need to ensure that requested position is not located before playlist start\n if (levelDetails.live) {\n var initialLiveManifestSize = this.config.initialLiveManifestSize;\n if (fragLen < initialLiveManifestSize) {\n _logger.logger.warn('Can not start playback of a level, reason: not enough fragments ' + fragLen + ' < ' + initialLiveManifestSize);\n return;\n }\n\n frag = this._ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen);\n // if it explicitely returns null don't load any fragment and exit function now\n if (frag === null) {\n return;\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 }\n if (!frag) {\n frag = this._findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails);\n }\n if (frag) {\n this._loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd);\n }\n return;\n }\n }, {\n key: '_ensureFragmentAtLivePoint',\n value: function _ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen) {\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 - config.maxFragLookUpTolerance, 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 this.nextLoadPosition = liveSyncPosition;\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(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails) {\n var config = this.hls.config;\n var frag = void 0;\n var foundFrag = void 0;\n var maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n var fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;\n var fragmentWithinToleranceTest = function fragmentWithinToleranceTest(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 // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments\n var candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);\n if (candidate.start + candidate.duration - candidateLookupTolerance <= bufferEnd) {\n return 1;\n } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n };\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n // Prefer the next fragment if it's within tolerance\n if (fragNext && !fragmentWithinToleranceTest(fragNext)) {\n foundFrag = fragNext;\n } else {\n foundFrag = _binarySearch2.default.search(fragments, fragmentWithinToleranceTest);\n }\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen - 1];\n }\n if (foundFrag) {\n frag = foundFrag;\n var curSNIdx = frag.sn - levelDetails.startSN;\n var sameLevel = fragPrevious && frag.level === fragPrevious.level;\n var prevFrag = fragments[curSNIdx - 1];\n var nextFrag = fragments[curSNIdx + 1];\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.sn === fragPrevious.sn) {\n if (sameLevel && !frag.backtracked) {\n if (frag.sn < levelDetails.endSN) {\n var deltaPTS = fragPrevious.deltaPTS;\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 = prevFrag;\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 = nextFrag;\n _logger.logger.log('SN just loaded, load next one: ' + frag.sn);\n }\n } else {\n frag = null;\n }\n } else if (frag.backtracked) {\n // Only backtrack a max of 1 consecutive fragment to prevent sliding back too far when little or no frags start with keyframes\n if (nextFrag && nextFrag.backtracked) {\n _logger.logger.warn('Already backtracked from fragment ' + nextFrag.sn + ', will not backtrack to fragment ' + frag.sn + '. Loading fragment ' + nextFrag.sn);\n frag = nextFrag;\n } else {\n // If a fragment has dropped frames and it's in a same level/sequence, load the previous fragment to try and find the keyframe\n // 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\n _logger.logger.warn('Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe');\n frag.dropped = 0;\n if (prevFrag) {\n if (prevFrag.loadCounter) {\n prevFrag.loadCounter--;\n }\n frag = prevFrag;\n frag.backtracked = true;\n } else if (curSNIdx) {\n // can't backtrack on very first fragment\n frag = null;\n }\n }\n }\n }\n }\n return frag;\n }\n }, {\n key: '_loadFragmentOrKey',\n value: function _loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd) {\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 && 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;\n }\n } else {\n frag.loadCounter = 1;\n }\n frag.loadIdx = this.fragLoadIdx;\n this.fragCurrent = frag;\n this.startFragRequested = true;\n if (!isNaN(frag.sn)) {\n this.nextLoadPosition = frag.start + frag.duration;\n }\n frag.autoLevel = hls.autoLevelEnabled;\n frag.bitrateTest = this.bitrateTest;\n hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n // lazy demuxer init, as this could take some time ... do it during frag loading\n if (!this.demuxer) {\n this.demuxer = new _demuxer2.default(hls, 'main');\n }\n this.state = State.FRAG_LOADING;\n return;\n }\n }\n }, {\n key: 'getBufferedFrag',\n value: function getBufferedFrag(position) {\n return _binarySearch2.default.search(this._bufferedFrags, function (frag) {\n if (position < frag.startPTS) {\n return -1;\n } else if (position > frag.endPTS) {\n return 1;\n }\n return 0;\n });\n }\n }, {\n key: 'followingBufferedFrag',\n value: function followingBufferedFrag(frag) {\n if (frag) {\n // try to get range of next fragment (500ms after this range)\n return this.getBufferedFrag(frag.endPTS + 0.5);\n }\n return null;\n }\n }, {\n key: '_checkFragmentChanged',\n value: function _checkFragmentChanged() {\n var fragPlayingCurrent,\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 fragPlayingCurrent = this.getBufferedFrag(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 fragPlayingCurrent = this.getBufferedFrag(currentTime + 0.1);\n }\n if (fragPlayingCurrent) {\n var fragPlaying = fragPlayingCurrent;\n if (fragPlaying !== this.fragPlaying) {\n this.hls.trigger(_events2.default.FRAG_CHANGED, { frag: fragPlaying });\n var fragPlayingLevel = fragPlaying.level;\n if (!this.fragPlaying || this.fragPlaying.level !== fragPlayingLevel) {\n this.hls.trigger(_events2.default.LEVEL_SWITCHED, { level: fragPlayingLevel });\n }\n this.fragPlaying = 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 // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // flush everything\n this.flushMainBuffer(0, 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 fragPlayingCurrent = void 0,\n nextBufferedFrag = void 0;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n fragPlayingCurrent = this.getBufferedFrag(media.currentTime);\n if (fragPlayingCurrent && fragPlayingCurrent.startPTS > 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.flushMainBuffer(0, fragPlayingCurrent.startPTS - 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 nextBufferedFrag = this.getBufferedFrag(media.currentTime + fetchdelay);\n if (nextBufferedFrag) {\n // we can flush buffer range following this one without stalling playback\n nextBufferedFrag = this.followingBufferedFrag(nextBufferedFrag);\n if (nextBufferedFrag) {\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 // start flush position is the start PTS of next buffered frag.\n // we use frag.naxStartPTS which is max(audio startPTS, video startPTS).\n // in case there is a small PTS Delta between audio and video, using maxStartPTS avoids flushing last samples from current fragment\n this.flushMainBuffer(nextBufferedFrag.maxStartPTS, Number.POSITIVE_INFINITY);\n }\n }\n }\n }\n }, {\n key: 'flushMainBuffer',\n value: function flushMainBuffer(startOffset, endOffset) {\n this.state = State.BUFFER_FLUSHING;\n var flushScope = { startOffset: startOffset, endOffset: endOffset };\n // if alternate audio tracks are used, only flush video, otherwise flush everything\n if (this.altAudio) {\n flushScope.type = 'video';\n }\n this.hls.trigger(_events2.default.BUFFER_FLUSHING, flushScope);\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 fragment.backtracked = 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 = this.mediaBuffer = 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 if (!isNaN(currentTime)) {\n _logger.logger.log('media seeking to ' + currentTime.toFixed(3));\n }\n var mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media;\n var bufferInfo = _bufferHelper2.default.bufferInfo(mediaBuffer, currentTime, this.config.maxBufferHole);\n if (this.state === State.FRAG_LOADING) {\n var 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 // if seeking to unbuffered area, clean up fragPrevious\n if (bufferInfo.len === 0) {\n this.fragPrevious = 0;\n }\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 // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target\n if (!this.loadedmetadata) {\n this.nextLoadPosition = this.startPosition = currentTime;\n }\n // tick to speed up processing\n this.tick();\n }\n }, {\n key: 'onMediaSeeked',\n value: function onMediaSeeked() {\n var media = this.media,\n currentTime = media ? media.currentTime : undefined;\n if (!isNaN(currentTime)) {\n _logger.logger.log('media seeked to ' + currentTime.toFixed(3));\n }\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._bufferedFrags = [];\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 || this.forceStartLoad) {\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 this.lastCurrentTime = this.startPosition;\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 this.stats = stats;\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 if (fragLoaded.sn === 'initSegment') {\n this.state = State.IDLE;\n stats.tparsed = stats.tbuffered = performance.now();\n details.initSegment.data = data.payload;\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 var duration = details.totalduration,\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.pendingBuffering = true;\n this.appended = false;\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) and if media is not seeking (this is to overcome potential timestamp drifts between playlists and fragments)\n var media = this.media;\n var mediaSeeking = media && media.seeking;\n var accurateTimeOffset = !mediaSeeking && (details.PTSKnown || !details.live);\n var initSegmentData = details.initSegment ? details.initSegment.data : [];\n demuxer.push(data.payload, initSegmentData, audioCodec, currentLevel.videoCodec, fragCurrent, duration, accurateTimeOffset, undefined);\n }\n }\n this.fragLoadError = 0;\n }\n }, {\n key: 'onFragParsingInitSegment',\n value: function onFragParsingInitSegment(data) {\n var fragCurrent = this.fragCurrent;\n var fragNew = data.frag;\n if (fragCurrent && data.id === 'main' && fragNew.sn === fragCurrent.sn && fragNew.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 && track.container !== 'audio/mpeg') {\n // Exclude mpeg audio\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 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.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\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 var fragNew = data.frag;\n 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\n this.state === State.PARSING) {\n var level = this.levels[this.level],\n frag = fragCurrent;\n if (isNaN(data.endPTS)) {\n data.endPTS = data.startPTS + fragCurrent.duration;\n data.endDTS = data.startDTS + fragCurrent.duration;\n }\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 // Detect gaps in a fragment and try to fix it by finding a keyframe in the previous fragment (see _findFragments)\n if (data.type === 'video') {\n frag.dropped = data.dropped;\n if (frag.dropped) {\n if (!frag.backtracked) {\n _logger.logger.warn('missing video frame(s), backtracking fragment');\n // Return back to the IDLE state without appending to buffer\n // Causes findFragments to backtrack a segment and find the keyframe\n // Audio fragments arriving before video sets the nextLoadPosition, causing _findFragments to skip the backtracked fragment\n frag.backtracked = true;\n this.nextLoadPosition = data.startPTS;\n this.state = State.IDLE;\n this.fragPrevious = frag;\n this.tick();\n return;\n } else {\n _logger.logger.warn('Already backtracked on this fragment, appending with the gap');\n }\n } else {\n // Only reset the backtracked flag if we've loaded the frag without any dropped frames\n frag.backtracked = false;\n }\n }\n\n var drift = _levelHelper2.default.updateFragPTSDTS(level.details, frag, 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, type: data.type, start: data.startPTS, end: data.endPTS });\n\n // has remuxer dropped video frames located before first keyframe ?\n [data.data1, data.data2].forEach(function (buffer) {\n // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)\n // in that case it is useless to append following segments\n if (buffer && buffer.length && _this2.state === State.PARSING) {\n _this2.appended = true;\n // arm pending Buffering flag before appending a segment\n _this2.pendingBuffering = true;\n hls.trigger(_events2.default.BUFFER_APPENDING, { type: data.type, data: buffer, parent: 'main', content: 'data' });\n }\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 var fragNew = data.frag;\n if (fragCurrent && data.id === 'main' && fragNew.sn === fragCurrent.sn && fragNew.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: 'onAudioTrackSwitching',\n value: function onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url,\n trackId = data.id;\n // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered\n // don't do anything if we switch to alt audio: audio stream controller is handling it.\n // we will just have to change buffer scheduling on audioTrackSwitched\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 var hls = this.hls;\n // switching to main audio, flush all audio and trigger track switched\n hls.trigger(_events2.default.BUFFER_FLUSHING, { startOffset: 0, endOffset: Number.POSITIVE_INFINITY, type: 'audio' });\n hls.trigger(_events2.default.AUDIO_TRACK_SWITCHED, { id: trackId });\n this.altAudio = false;\n }\n }\n }, {\n key: 'onAudioTrackSwitched',\n value: function onAudioTrackSwitched(data) {\n var trackId = data.id,\n altAudio = !!this.hls.audioTracks[trackId].url;\n if (altAudio) {\n var videoBuffer = this.videoBuffer;\n // if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered\n if (videoBuffer && this.mediaBuffer !== videoBuffer) {\n _logger.logger.log('switching on alternate audio, use video.buffered to schedule main fragment loading');\n this.mediaBuffer = videoBuffer;\n }\n }\n this.altAudio = altAudio;\n this.tick();\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 var state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = data.pending > 0;\n this._checkAppendedParsed();\n }\n }\n }\n }, {\n key: '_checkAppendedParsed',\n value: function _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n var frag = this.fragCurrent;\n if (frag) {\n var media = this.mediaBuffer ? this.mediaBuffer : this.media;\n _logger.logger.log('main buffered : ' + _timeRanges2.default.toString(media.buffered));\n // filter fragments potentially evicted from buffer. this is to avoid memleak on live streams\n var bufferedFrags = this._bufferedFrags.filter(function (frag) {\n return _bufferHelper2.default.isBuffered(media, (frag.startPTS + frag.endPTS) / 2);\n });\n // push new range\n bufferedFrags.push(frag);\n // sort frags, as we use BinarySearch for lookup in getBufferedFrag ...\n this._bufferedFrags = bufferedFrags.sort(function (a, b) {\n return a.startPTS - b.startPTS;\n });\n this.fragPrevious = frag;\n var stats = this.stats;\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 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 case _errors.ErrorDetails.KEY_LOAD_ERROR:\n case _errors.ErrorDetails.KEY_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 or if in automode with current level not 0\n if (loadError <= config.fragLoadingMaxRetry || mediaBuffered || frag.autoLevel && frag.level) {\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 // 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 this.nextLoadPosition = this.startPosition;\n }\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n _logger.logger.error('mediaController: ' + data.details + ' reaches max retry, redispatch as fatal ...');\n // switch error to fatal\n data.fatal = true;\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 // switch error to fatal\n data.fatal = true;\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 if (this.state !== State.ERROR) {\n if (data.fatal) {\n // if fatal error, stop processing\n this.state = State.ERROR;\n _logger.logger.warn('streamController: ' + data.details + ',switch to ' + this.state + ' state ...');\n } else {\n // in case of non fatal error while loading level, if level controller is not retrying to load level , switch back to IDLE\n if (!data.levelRetry && this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n }\n }\n break;\n case _errors.ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (data.parent === 'main' && (this.state === State.PARSING || this.state === State.PARSED)) {\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n this._reduceMaxBufferLength(this.config.maxBufferLength);\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/video-dev/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 // flush everything\n this.flushMainBuffer(0, 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('main:reduce max buffer length to ' + config.maxMaxBufferLength + 's');\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 config = this.config;\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 mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media,\n buffered = mediaBuffer.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 = media.seeking ? currentTime : this.startPosition,\n startPositionBuffered = _bufferHelper2.default.isBuffered(mediaBuffer, startPosition),\n firstbufferedPosition = buffered.start(0);\n // if currentTime not matching with expected startPosition or startPosition not buffered\n if (currentTime !== startPosition || !startPositionBuffered && Math.abs(startPosition - firstbufferedPosition) < config.maxSeekHole) {\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 = firstbufferedPosition;\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 !== this.lastCurrentTime;\n\n if (playheadMoving) {\n // played moving, but was previously stalled => now not stuck anymore\n if (this.stallReported) {\n _logger.logger.warn('playback not stuck anymore @' + currentTime + ', after ' + Math.round(performance.now() - this.stalled) + 'ms');\n this.stallReported = false;\n }\n this.stalled = undefined;\n this.nudgeRetry = 0;\n } else {\n // playhead not moving\n if (expectedPlaying) {\n // playhead not moving BUT media expected to play\n var tnow = performance.now();\n var hls = this.hls;\n if (!this.stalled) {\n // stall just detected, store current time\n this.stalled = tnow;\n this.stallReported = false;\n } else {\n // playback already stalled, check stalling duration\n // if stalling for more than a given threshold, let's try to recover\n var stalledDuration = tnow - this.stalled;\n var bufferLen = bufferInfo.len;\n var nudgeRetry = this.nudgeRetry || 0;\n // have we reached stall deadline ?\n if (bufferLen <= jumpThreshold && stalledDuration > config.lowBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n _logger.logger.warn('playback stalling in low buffer @' + currentTime);\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });\n }\n // if buffer len is below threshold, try to jump to start of next buffer range if close\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 this.nudgeRetry = ++nudgeRetry;\n var nudgeOffset = nudgeRetry * config.nudgeOffset;\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 ' + nudgeOffset);\n media.currentTime = nextBufferStart + nudgeOffset;\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole: nextBufferStart + nudgeOffset - currentTime });\n }\n } else if (bufferLen > jumpThreshold && stalledDuration > config.highBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n _logger.logger.warn('playback stalling in high buffer @' + currentTime);\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer: bufferLen });\n }\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n this.nudgeRetry = ++nudgeRetry;\n if (nudgeRetry < config.nudgeMaxRetry) {\n var _currentTime = media.currentTime;\n var targetTime = _currentTime + nudgeRetry * config.nudgeOffset;\n _logger.logger.log('adjust currentTime from ' + _currentTime + ' to ' + targetTime);\n // playback stalled in buffered area ... let's nudge currentTime to try to overcome this\n media.currentTime = targetTime;\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_NUDGE_ON_STALL, fatal: false });\n } else {\n _logger.logger.error('still stuck in high buffer @' + currentTime + ' after ' + config.nudgeMaxRetry + ', raise fatal error');\n hls.trigger(_events2.default.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.BUFFER_STALLED_ERROR, fatal: true });\n }\n }\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 this.nextLoadPosition = this.startPosition;\n }\n this.tick();\n }\n }, {\n key: 'onBufferFlushed',\n value: function onBufferFlushed() {\n /* after successful buffer flushing, filter flushed fragments from bufferedFrags\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 this._bufferedFrags = this._bufferedFrags.filter(function (frag) {\n return _bufferHelper2.default.isBuffered(media, (frag.startPTS + frag.endPTS) / 2);\n });\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('main stream:' + previousState + '->' + 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 frag = this.getBufferedFrag(media.currentTime);\n if (frag) {\n return frag.level;\n }\n }\n return -1;\n }\n }, {\n key: 'nextBufferedFrag',\n get: function get() {\n var media = this.media;\n if (media) {\n // first get end range of current fragment\n return this.followingBufferedFrag(this.getBufferedFrag(media.currentTime));\n } else {\n return null;\n }\n }\n }, {\n key: 'nextLevel',\n get: function get() {\n var frag = this.nextBufferedFrag;\n if (frag) {\n return 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},{\"25\":25,\"33\":33,\"34\":34,\"35\":35,\"37\":37,\"38\":38,\"48\":48,\"54\":54,\"55\":55}],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\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(54);\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 * Subtitle Stream Controller\n */\n\nvar SubtitleStreamController = function (_EventHandler) {\n _inherits(SubtitleStreamController, _EventHandler);\n\n function SubtitleStreamController(hls) {\n _classCallCheck(this, SubtitleStreamController);\n\n 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));\n\n _this.config = hls.config;\n _this.vttFragSNsProcessed = {};\n _this.vttFragQueues = undefined;\n _this.currentlyProcessing = null;\n _this.currentTrackId = -1;\n return _this;\n }\n\n _createClass(SubtitleStreamController, [{\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n\n // Remove all queued items and create a new, empty queue for each track.\n\n }, {\n key: 'clearVttFragQueues',\n value: function clearVttFragQueues() {\n var _this2 = this;\n\n this.vttFragQueues = {};\n this.tracks.forEach(function (track) {\n _this2.vttFragQueues[track.id] = [];\n });\n }\n\n // If no frag is being processed and queue isn't empty, initiate processing of next frag in line.\n\n }, {\n key: 'nextFrag',\n value: function nextFrag() {\n if (this.currentlyProcessing === null && this.currentTrackId > -1 && this.vttFragQueues[this.currentTrackId].length) {\n var frag = this.currentlyProcessing = this.vttFragQueues[this.currentTrackId].shift();\n this.hls.trigger(_events2.default.FRAG_LOADING, { frag: frag });\n }\n }\n\n // When fragment has finished processing, add sn to list of completed if successful.\n\n }, {\n key: 'onSubtitleFragProcessed',\n value: function onSubtitleFragProcessed(data) {\n if (data.success) {\n this.vttFragSNsProcessed[data.frag.trackId].push(data.frag.sn);\n }\n this.currentlyProcessing = null;\n this.nextFrag();\n }\n\n // If something goes wrong, procede to next frag, if we were processing one.\n\n }, {\n key: 'onError',\n value: function onError(data) {\n var frag = data.frag;\n // don't handle frag error not related to subtitle fragment\n if (frag && frag.type !== 'subtitle') {\n return;\n }\n if (this.currentlyProcessing) {\n this.currentlyProcessing = null;\n this.nextFrag();\n }\n }\n\n // Got all new subtitle tracks.\n\n }, {\n key: 'onSubtitleTracksUpdated',\n value: function onSubtitleTracksUpdated(data) {\n var _this3 = this;\n\n _logger.logger.log('subtitle tracks updated');\n this.tracks = data.subtitleTracks;\n this.clearVttFragQueues();\n this.vttFragSNsProcessed = {};\n this.tracks.forEach(function (track) {\n _this3.vttFragSNsProcessed[track.id] = [];\n });\n }\n }, {\n key: 'onSubtitleTrackSwitch',\n value: function onSubtitleTrackSwitch(data) {\n this.currentTrackId = data.id;\n this.clearVttFragQueues();\n }\n\n // Got a new set of subtitle fragments.\n\n }, {\n key: 'onSubtitleTrackLoaded',\n value: function onSubtitleTrackLoaded(data) {\n var processedFragSNs = this.vttFragSNsProcessed[data.id],\n fragQueue = this.vttFragQueues[data.id],\n currentFragSN = !!this.currentlyProcessing ? this.currentlyProcessing.sn : -1;\n\n var alreadyProcessed = function alreadyProcessed(frag) {\n return processedFragSNs.indexOf(frag.sn) > -1;\n };\n\n var alreadyInQueue = function alreadyInQueue(frag) {\n return fragQueue.some(function (fragInQueue) {\n return fragInQueue.sn === frag.sn;\n });\n };\n\n // Add all fragments that haven't been, aren't currently being and aren't waiting to be processed, to queue.\n data.details.fragments.forEach(function (frag) {\n if (!(alreadyProcessed(frag) || frag.sn === currentFragSN || alreadyInQueue(frag))) {\n // Frags don't know their subtitle track ID, so let's just add that...\n frag.trackId = data.id;\n fragQueue.push(frag);\n }\n });\n\n this.nextFrag();\n }\n }]);\n\n return SubtitleStreamController;\n}(_eventHandler2.default);\n\nexports.default = SubtitleStreamController;\n\n},{\"34\":34,\"35\":35,\"54\":54}],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\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _logger = _dereq_(54);\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\nfunction filterSubtitleTracks(textTrackList) {\n var tracks = [];\n for (var i = 0; i < textTrackList.length; i++) {\n if (textTrackList[i].kind === 'subtitles') {\n tracks.push(textTrackList[i]);\n }\n }\n return tracks;\n}\n\nvar SubtitleTrackController = function (_EventHandler) {\n _inherits(SubtitleTrackController, _EventHandler);\n\n function SubtitleTrackController(hls) {\n _classCallCheck(this, SubtitleTrackController);\n\n 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));\n\n _this.tracks = [];\n _this.trackId = -1;\n _this.media = undefined;\n return _this;\n }\n\n _createClass(SubtitleTrackController, [{\n key: '_onTextTracksChanged',\n value: function _onTextTracksChanged() {\n // Media is undefined when switching streams via loadSource()\n if (!this.media) {\n return;\n }\n\n var trackId = -1;\n var tracks = filterSubtitleTracks(this.media.textTracks);\n for (var id = 0; id < tracks.length; id++) {\n if (tracks[id].mode === 'showing') {\n trackId = id;\n }\n }\n\n // Setting current subtitleTrack will invoke code.\n this.subtitleTrack = trackId;\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n _eventHandler2.default.prototype.destroy.call(this);\n }\n\n // Listen for subtitle track change, then extract the current track ID.\n\n }, {\n key: 'onMediaAttached',\n value: function onMediaAttached(data) {\n this.media = data.media;\n if (!this.media) {\n return;\n }\n\n this.trackChangeListener = this._onTextTracksChanged.bind(this);\n this.media.textTracks.addEventListener('change', this.trackChangeListener);\n }\n }, {\n key: 'onMediaDetaching',\n value: function onMediaDetaching() {\n if (!this.media) {\n return;\n }\n\n this.media.textTracks.removeEventListener('change', this.trackChangeListener);\n\n this.media = undefined;\n }\n\n // Reset subtitle tracks on manifest loading\n\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n this.tracks = [];\n this.trackId = -1;\n }\n\n // Fired whenever a new manifest is loaded.\n\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var _this2 = this;\n\n var tracks = data.subtitles || [];\n var defaultFound = false;\n this.tracks = tracks;\n this.trackId = -1;\n this.hls.trigger(_events2.default.SUBTITLE_TRACKS_UPDATED, { subtitleTracks: tracks });\n\n // loop through available subtitle tracks and autoselect default if needed\n // TODO: improve selection logic to handle forced, etc\n tracks.forEach(function (track) {\n if (track.default) {\n _this2.subtitleTrack = track.id;\n defaultFound = true;\n }\n });\n }\n\n // Trigger subtitle track playlist reload.\n\n }, {\n key: 'onTick',\n value: function onTick() {\n var trackId = this.trackId;\n var subtitleTrack = this.tracks[trackId];\n if (!subtitleTrack) {\n return;\n }\n\n var details = subtitleTrack.details;\n // check if we need to load playlist for this subtitle Track\n if (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 subtitle track ' + trackId);\n this.hls.trigger(_events2.default.SUBTITLE_TRACK_LOADING, { url: subtitleTrack.url, id: trackId });\n }\n }\n }, {\n key: 'onSubtitleTrackLoaded',\n value: function onSubtitleTrackLoaded(data) {\n var _this3 = this;\n\n if (data.id < this.tracks.length) {\n _logger.logger.log('subtitle track ' + 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(function () {\n _this3.onTick();\n }, 1000 * data.details.targetduration, this);\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 subtitle tracks list from playlist **/\n\n }, {\n key: 'setSubtitleTrackInternal',\n value: function setSubtitleTrackInternal(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 subtitle track ' + newId);\n var subtitleTrack = this.tracks[newId];\n this.hls.trigger(_events2.default.SUBTITLE_TRACK_SWITCH, { id: newId });\n // check if we need to load playlist for this subtitle Track\n var details = subtitleTrack.details;\n if (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 subtitle track ' + newId);\n this.hls.trigger(_events2.default.SUBTITLE_TRACK_LOADING, { url: subtitleTrack.url, id: newId });\n }\n }\n }\n }, {\n key: 'subtitleTracks',\n get: function get() {\n return this.tracks;\n }\n\n /** get index of the selected subtitle track (index in subtitle track lists) **/\n\n }, {\n key: 'subtitleTrack',\n get: function get() {\n return this.trackId;\n }\n\n /** select a subtitle track, based on its index in subtitle track lists**/\n ,\n set: function set(subtitleTrackId) {\n if (this.trackId !== subtitleTrackId) {\n // || this.tracks[subtitleTrackId].details === undefined) {\n this.setSubtitleTrackInternal(subtitleTrackId);\n }\n }\n }]);\n\n return SubtitleTrackController;\n}(_eventHandler2.default);\n\nexports.default = SubtitleTrackController;\n\n},{\"34\":34,\"35\":35,\"54\":54}],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\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _cea608Parser = _dereq_(49);\n\nvar _cea608Parser2 = _interopRequireDefault(_cea608Parser);\n\nvar _webvttParser = _dereq_(58);\n\nvar _webvttParser2 = _interopRequireDefault(_webvttParser);\n\nvar _logger = _dereq_(54);\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\nfunction clearCurrentCues(track) {\n if (track && track.cues) {\n while (track.cues.length > 0) {\n track.removeCue(track.cues[0]);\n }\n }\n}\n\nfunction reuseVttTextTrack(inUseTrack, manifestTrack) {\n return inUseTrack && inUseTrack.label === manifestTrack.name && !(inUseTrack.textTrack1 || inUseTrack.textTrack2);\n}\n\nfunction intersection(x1, x2, y1, y2) {\n return Math.min(x2, y2) - Math.max(x1, y1);\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, (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));\n\n _this.hls = hls;\n _this.config = hls.config;\n _this.enabled = true;\n _this.Cues = hls.config.cueHandler;\n _this.textTracks = [];\n _this.tracks = [];\n _this.unparsedVttFrags = [];\n _this.initPTS = undefined;\n _this.cueRanges = [];\n\n if (_this.config.enableCEA708Captions) {\n var self = _this;\n var sendAddTrackEvent = function sendAddTrackEvent(track, media) {\n var e = null;\n try {\n e = new window.Event('addtrack');\n } catch (err) {\n //for IE11\n e = document.createEvent('Event');\n e.initEvent('addtrack', false, false);\n }\n e.track = track;\n media.dispatchEvent(e);\n };\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 var textTrack1 = self.createTextTrack('captions', self.config.captionsTextTrack1Label, self.config.captionsTextTrack1LanguageCode);\n if (textTrack1) {\n textTrack1.textTrack1 = true;\n self.textTrack1 = textTrack1;\n }\n } else {\n self.textTrack1 = existingTrack1;\n clearCurrentCues(self.textTrack1);\n\n sendAddTrackEvent(self.textTrack1, self.media);\n }\n }\n self.addCues('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 var textTrack2 = self.createTextTrack('captions', self.config.captionsTextTrack2Label, self.config.captionsTextTrack1LanguageCode);\n if (textTrack2) {\n textTrack2.textTrack2 = true;\n self.textTrack2 = textTrack2;\n }\n } else {\n self.textTrack2 = existingTrack2;\n clearCurrentCues(self.textTrack2);\n\n sendAddTrackEvent(self.textTrack2, self.media);\n }\n }\n self.addCues('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: 'addCues',\n value: function addCues(channel, startTime, endTime, screen) {\n // skip cues which overlap more than 50% with previously parsed time ranges\n var ranges = this.cueRanges;\n var merged = false;\n for (var i = ranges.length; i--;) {\n var cueRange = ranges[i];\n var overlap = intersection(cueRange[0], cueRange[1], startTime, endTime);\n if (overlap >= 0) {\n cueRange[0] = Math.min(cueRange[0], startTime);\n cueRange[1] = Math.max(cueRange[1], endTime);\n merged = true;\n if (overlap / (endTime - startTime) > 0.5) {\n return;\n }\n }\n }\n if (!merged) {\n ranges.push([startTime, endTime]);\n }\n this.Cues.newCue(this[channel], startTime, endTime, screen);\n }\n\n // Triggered when an initial PTS is found; used for synchronisation of WebVTT.\n\n }, {\n key: 'onInitPtsFound',\n value: function onInitPtsFound(data) {\n var _this2 = this;\n\n if (typeof this.initPTS === 'undefined') {\n this.initPTS = data.initPTS;\n }\n\n // Due to asynchrony, initial PTS may arrive later than the first VTT fragments are loaded.\n // Parse any unparsed fragments upon receiving the initial PTS.\n if (this.unparsedVttFrags.length) {\n this.unparsedVttFrags.forEach(function (frag) {\n _this2.onFragLoaded(frag);\n });\n this.unparsedVttFrags = [];\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 var media = this.media;\n if (media) {\n return 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 clearCurrentCues(this.textTrack1);\n clearCurrentCues(this.textTrack2);\n }\n }, {\n key: 'onManifestLoading',\n value: function onManifestLoading() {\n this.lastSn = -1; // Detect discontiguity in fragment parsing\n this.prevCC = -1;\n this.vttCCs = { ccOffset: 0, presentationOffset: 0 }; // Detect discontinuity in subtitle manifests\n\n // clear outdated subtitles\n var media = this.media;\n if (media) {\n var textTracks = media.textTracks;\n if (textTracks) {\n for (var i = 0; i < textTracks.length; i++) {\n clearCurrentCues(textTracks[i]);\n }\n }\n }\n }\n }, {\n key: 'onManifestLoaded',\n value: function onManifestLoaded(data) {\n var _this3 = this;\n\n this.textTracks = [];\n this.unparsedVttFrags = this.unparsedVttFrags || [];\n this.initPTS = undefined;\n this.cueRanges = [];\n\n if (this.config.enableWebVTT) {\n this.tracks = data.subtitles || [];\n var inUseTracks = this.media ? this.media.textTracks : [];\n\n this.tracks.forEach(function (track, index) {\n var textTrack = void 0;\n if (index < inUseTracks.length) {\n var inUseTrack = inUseTracks[index];\n // Reuse tracks with the same label, but do not reuse 608/708 tracks\n if (reuseVttTextTrack(inUseTrack, track)) {\n textTrack = inUseTrack;\n }\n }\n if (!textTrack) {\n textTrack = _this3.createTextTrack('subtitles', track.name, track.lang);\n }\n textTrack.mode = track.default ? 'showing' : 'hidden';\n _this3.textTracks.push(textTrack);\n });\n }\n }\n }, {\n key: 'onLevelSwitching',\n value: function onLevelSwitching() {\n this.enabled = this.hls.currentLevel.closedCaptions !== 'NONE';\n }\n }, {\n key: 'onFragLoaded',\n value: function onFragLoaded(data) {\n var frag = data.frag,\n payload = data.payload;\n if (frag.type === 'main') {\n var sn = frag.sn;\n // if this frag isn't contiguous, clear the parser so cues with bad start/end times aren't added to the textTrack\n if (sn !== this.lastSn + 1) {\n var cea608Parser = this.cea608Parser;\n if (cea608Parser) {\n cea608Parser.reset();\n }\n }\n this.lastSn = sn;\n }\n // If fragment is subtitle type, parse as WebVTT.\n else if (frag.type === 'subtitle') {\n if (payload.byteLength) {\n // We need an initial synchronisation PTS. Store fragments as long as none has arrived.\n if (typeof this.initPTS === 'undefined') {\n this.unparsedVttFrags.push(data);\n return;\n }\n var vttCCs = this.vttCCs;\n if (!vttCCs[frag.cc]) {\n vttCCs[frag.cc] = { start: frag.start, prevCC: this.prevCC, new: true };\n this.prevCC = frag.cc;\n }\n var textTracks = this.textTracks,\n hls = this.hls;\n\n // Parse the WebVTT file contents.\n _webvttParser2.default.parse(payload, this.initPTS, vttCCs, frag.cc, function (cues) {\n var currentTrack = textTracks[frag.trackId];\n // Add cues and trigger event with success true.\n cues.forEach(function (cue) {\n // Sometimes there are cue overlaps on segmented vtts so the same\n // cue can appear more than once in different vtt files.\n // This avoid showing duplicated cues with same timecode and text.\n if (!currentTrack.cues.getCueById(cue.id)) {\n currentTrack.addCue(cue);\n }\n });\n hls.trigger(_events2.default.SUBTITLE_FRAG_PROCESSED, { success: true, frag: frag });\n }, function (e) {\n // Something went wrong while parsing. Trigger event with success false.\n _logger.logger.log('Failed to parse VTT cue: ' + e);\n hls.trigger(_events2.default.SUBTITLE_FRAG_PROCESSED, { success: false, frag: frag });\n });\n } else {\n // In case there is no payload, finish unsuccessfully.\n this.hls.trigger(_events2.default.SUBTITLE_FRAG_PROCESSED, { success: false, frag: frag });\n }\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 && this.config.enableCEA708Captions) {\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;\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},{\"34\":34,\"35\":35,\"49\":49,\"54\":54,\"58\":58}],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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AESCrypto = function () {\n function AESCrypto(subtle, iv) {\n _classCallCheck(this, AESCrypto);\n\n this.subtle = subtle;\n this.aesIV = iv;\n }\n\n _createClass(AESCrypto, [{\n key: 'decrypt',\n value: function decrypt(data, key) {\n return this.subtle.decrypt({ name: 'AES-CBC', iv: this.aesIV }, key, data);\n }\n }]);\n\n return AESCrypto;\n}();\n\nexports.default = AESCrypto;\n\n},{}],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; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar AESDecryptor = function () {\n function AESDecryptor() {\n _classCallCheck(this, AESDecryptor);\n\n // Static after running initTable\n this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n this.subMix = [new Uint32Array(256), new Uint32Array(256), new Uint32Array(256), new Uint32Array(256)];\n this.invSubMix = [new Uint32Array(256), new Uint32Array(256), new Uint32Array(256), new Uint32Array(256)];\n this.sBox = new Uint32Array(256);\n this.invSBox = new Uint32Array(256);\n\n // Changes during runtime\n this.key = new Uint32Array(0);\n\n this.initTable();\n }\n\n // Using view.getUint32() also swaps the byte order.\n\n\n _createClass(AESDecryptor, [{\n key: 'uint8ArrayToUint32Array_',\n value: function uint8ArrayToUint32Array_(arrayBuffer) {\n var view = new DataView(arrayBuffer);\n var newArray = new Uint32Array(4);\n for (var i = 0; i < 4; i++) {\n newArray[i] = view.getUint32(i * 4);\n }\n return newArray;\n }\n }, {\n key: 'initTable',\n value: function initTable() {\n var sBox = this.sBox;\n var invSBox = this.invSBox;\n var subMix = this.subMix;\n var subMix0 = subMix[0];\n var subMix1 = subMix[1];\n var subMix2 = subMix[2];\n var subMix3 = subMix[3];\n var invSubMix = this.invSubMix;\n var invSubMix0 = invSubMix[0];\n var invSubMix1 = invSubMix[1];\n var invSubMix2 = invSubMix[2];\n var invSubMix3 = invSubMix[3];\n\n var d = new Uint32Array(256);\n var x = 0;\n var xi = 0;\n var i = 0;\n for (i = 0; i < 256; i++) {\n if (i < 128) {\n d[i] = i << 1;\n } else {\n d[i] = i << 1 ^ 0x11b;\n }\n }\n\n for (i = 0; i < 256; i++) {\n var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n sx = sx >>> 8 ^ sx & 0xff ^ 0x63;\n sBox[x] = sx;\n invSBox[sx] = x;\n\n // Compute multiplication\n var x2 = d[x];\n var x4 = d[x2];\n var x8 = d[x4];\n\n // Compute sub/invSub bytes, mix columns tables\n var t = d[sx] * 0x101 ^ sx * 0x1010100;\n subMix0[x] = t << 24 | t >>> 8;\n subMix1[x] = t << 16 | t >>> 16;\n subMix2[x] = t << 8 | t >>> 24;\n subMix3[x] = t;\n\n // Compute inv sub bytes, inv mix columns tables\n t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n invSubMix0[sx] = t << 24 | t >>> 8;\n invSubMix1[sx] = t << 16 | t >>> 16;\n invSubMix2[sx] = t << 8 | t >>> 24;\n invSubMix3[sx] = t;\n\n // Compute next counter\n if (!x) {\n x = xi = 1;\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]];\n xi ^= d[d[xi]];\n }\n }\n }\n }, {\n key: 'expandKey',\n value: function expandKey(keyBuffer) {\n // convert keyBuffer to Uint32Array\n var key = this.uint8ArrayToUint32Array_(keyBuffer);\n var sameKey = true;\n var offset = 0;\n\n while (offset < key.length && sameKey) {\n sameKey = key[offset] === this.key[offset];\n offset++;\n }\n\n if (sameKey) {\n return;\n }\n\n this.key = key;\n var keySize = this.keySize = key.length;\n\n if (keySize !== 4 && keySize !== 6 && keySize !== 8) {\n throw new Error('Invalid aes key size=' + keySize);\n }\n\n var ksRows = this.ksRows = (keySize + 6 + 1) * 4;\n var ksRow = void 0;\n var invKsRow = void 0;\n\n var keySchedule = this.keySchedule = new Uint32Array(ksRows);\n var invKeySchedule = this.invKeySchedule = new Uint32Array(ksRows);\n var sbox = this.sBox;\n var rcon = this.rcon;\n\n var invSubMix = this.invSubMix;\n var invSubMix0 = invSubMix[0];\n var invSubMix1 = invSubMix[1];\n var invSubMix2 = invSubMix[2];\n var invSubMix3 = invSubMix[3];\n\n var prev = void 0;\n var t = void 0;\n\n for (ksRow = 0; ksRow < ksRows; ksRow++) {\n if (ksRow < keySize) {\n prev = keySchedule[ksRow] = key[ksRow];\n continue;\n }\n t = prev;\n\n if (ksRow % keySize === 0) {\n // Rot word\n t = t << 8 | t >>> 24;\n\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n\n // Mix Rcon\n t ^= rcon[ksRow / keySize | 0] << 24;\n } else if (keySize > 6 && ksRow % keySize === 4) {\n // Sub word\n t = sbox[t >>> 24] << 24 | sbox[t >>> 16 & 0xff] << 16 | sbox[t >>> 8 & 0xff] << 8 | sbox[t & 0xff];\n }\n\n keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;\n }\n\n for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n ksRow = ksRows - invKsRow;\n if (invKsRow & 3) {\n t = keySchedule[ksRow];\n } else {\n t = keySchedule[ksRow - 4];\n }\n\n if (invKsRow < 4 || ksRow <= 4) {\n invKeySchedule[invKsRow] = t;\n } else {\n invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[t >>> 16 & 0xff]] ^ invSubMix2[sbox[t >>> 8 & 0xff]] ^ invSubMix3[sbox[t & 0xff]];\n }\n\n invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;\n }\n }\n\n // Adding this as a method greatly improves performance.\n\n }, {\n key: 'networkToHostOrderSwap',\n value: function networkToHostOrderSwap(word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n }\n }, {\n key: 'decrypt',\n value: function decrypt(inputArrayBuffer, offset, aesIV) {\n var nRounds = this.keySize + 6;\n var invKeySchedule = this.invKeySchedule;\n var invSBOX = this.invSBox;\n\n var invSubMix = this.invSubMix;\n var invSubMix0 = invSubMix[0];\n var invSubMix1 = invSubMix[1];\n var invSubMix2 = invSubMix[2];\n var invSubMix3 = invSubMix[3];\n\n var initVector = this.uint8ArrayToUint32Array_(aesIV);\n var initVector0 = initVector[0];\n var initVector1 = initVector[1];\n var initVector2 = initVector[2];\n var initVector3 = initVector[3];\n\n var inputInt32 = new Int32Array(inputArrayBuffer);\n var outputInt32 = new Int32Array(inputInt32.length);\n\n var t0 = void 0,\n t1 = void 0,\n t2 = void 0,\n t3 = void 0;\n var s0 = void 0,\n s1 = void 0,\n s2 = void 0,\n s3 = void 0;\n var inputWords0 = void 0,\n inputWords1 = void 0,\n inputWords2 = void 0,\n inputWords3 = void 0;\n\n var ksRow, i;\n var swapWord = this.networkToHostOrderSwap;\n\n while (offset < inputInt32.length) {\n inputWords0 = swapWord(inputInt32[offset]);\n inputWords1 = swapWord(inputInt32[offset + 1]);\n inputWords2 = swapWord(inputInt32[offset + 2]);\n inputWords3 = swapWord(inputInt32[offset + 3]);\n\n s0 = inputWords0 ^ invKeySchedule[0];\n s1 = inputWords3 ^ invKeySchedule[1];\n s2 = inputWords2 ^ invKeySchedule[2];\n s3 = inputWords1 ^ invKeySchedule[3];\n\n ksRow = 4;\n\n // Iterate through the rounds of decryption\n for (i = 1; i < nRounds; i++) {\n t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[s1 >> 16 & 0xff] ^ invSubMix2[s2 >> 8 & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[s2 >> 16 & 0xff] ^ invSubMix2[s3 >> 8 & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[s3 >> 16 & 0xff] ^ invSubMix2[s0 >> 8 & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[s0 >> 16 & 0xff] ^ invSubMix2[s1 >> 8 & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n // Update state\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n\n ksRow = ksRow + 4;\n }\n\n // Shift rows, sub bytes, add round key\n t0 = invSBOX[s0 >>> 24] << 24 ^ invSBOX[s1 >> 16 & 0xff] << 16 ^ invSBOX[s2 >> 8 & 0xff] << 8 ^ invSBOX[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSBOX[s1 >>> 24] << 24 ^ invSBOX[s2 >> 16 & 0xff] << 16 ^ invSBOX[s3 >> 8 & 0xff] << 8 ^ invSBOX[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSBOX[s2 >>> 24] << 24 ^ invSBOX[s3 >> 16 & 0xff] << 16 ^ invSBOX[s0 >> 8 & 0xff] << 8 ^ invSBOX[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSBOX[s3 >>> 24] << 24 ^ invSBOX[s0 >> 16 & 0xff] << 16 ^ invSBOX[s1 >> 8 & 0xff] << 8 ^ invSBOX[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n ksRow = ksRow + 3;\n\n // Write\n outputInt32[offset] = swapWord(t0 ^ initVector0);\n outputInt32[offset + 1] = swapWord(t3 ^ initVector1);\n outputInt32[offset + 2] = swapWord(t2 ^ initVector2);\n outputInt32[offset + 3] = swapWord(t1 ^ initVector3);\n\n // reset initVector to last 4 unsigned int\n initVector0 = inputWords0;\n initVector1 = inputWords1;\n initVector2 = inputWords2;\n initVector3 = inputWords3;\n\n offset = offset + 4;\n }\n\n return outputInt32.buffer;\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.key = undefined;\n this.keySize = undefined;\n this.ksRows = undefined;\n\n this.sBox = undefined;\n this.invSBox = undefined;\n this.subMix = undefined;\n this.invSubMix = undefined;\n this.keySchedule = undefined;\n this.invKeySchedule = undefined;\n\n this.rcon = undefined;\n }\n }]);\n\n return AESDecryptor;\n}();\n\nexports.default = AESDecryptor;\n\n},{}],19:[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 _aesCrypto = _dereq_(17);\n\nvar _aesCrypto2 = _interopRequireDefault(_aesCrypto);\n\nvar _fastAesKey = _dereq_(20);\n\nvar _fastAesKey2 = _interopRequireDefault(_fastAesKey);\n\nvar _aesDecryptor = _dereq_(18);\n\nvar _aesDecryptor2 = _interopRequireDefault(_aesDecryptor);\n\nvar _errors = _dereq_(33);\n\nvar _logger = _dereq_(54);\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\n/*globals self: false */\n\nvar Decrypter = function () {\n function Decrypter(observer, config) {\n _classCallCheck(this, Decrypter);\n\n this.observer = observer;\n this.config = config;\n this.logEnabled = true;\n try {\n var browserCrypto = crypto ? crypto : self.crypto;\n this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;\n } catch (e) {}\n this.disableWebCrypto = !this.subtle;\n }\n\n _createClass(Decrypter, [{\n key: 'isSync',\n value: function isSync() {\n return this.disableWebCrypto && this.config.enableSoftwareAES;\n }\n }, {\n key: 'decrypt',\n value: function decrypt(data, key, iv, callback) {\n var _this = this;\n\n if (this.disableWebCrypto && this.config.enableSoftwareAES) {\n if (this.logEnabled) {\n _logger.logger.log('JS AES decrypt');\n this.logEnabled = false;\n }\n var decryptor = this.decryptor;\n if (!decryptor) {\n this.decryptor = decryptor = new _aesDecryptor2.default();\n }\n decryptor.expandKey(key);\n callback(decryptor.decrypt(data, 0, iv));\n } else {\n if (this.logEnabled) {\n _logger.logger.log('WebCrypto AES decrypt');\n this.logEnabled = false;\n }\n var subtle = this.subtle;\n if (this.key !== key) {\n this.key = key;\n this.fastAesKey = new _fastAesKey2.default(subtle, key);\n }\n\n this.fastAesKey.expandKey().then(function (aesKey) {\n // decrypt using web crypto\n var crypto = new _aesCrypto2.default(subtle, iv);\n crypto.decrypt(data, aesKey).catch(function (err) {\n _this.onWebCryptoError(err, data, key, iv, callback);\n }).then(function (result) {\n callback(result);\n });\n }).catch(function (err) {\n _this.onWebCryptoError(err, data, key, iv, callback);\n });\n }\n }\n }, {\n key: 'onWebCryptoError',\n value: function onWebCryptoError(err, data, key, iv, callback) {\n if (this.config.enableSoftwareAES) {\n _logger.logger.log('WebCrypto Error, disable WebCrypto API');\n this.disableWebCrypto = true;\n this.logEnabled = true;\n this.decrypt(data, key, iv, callback);\n } else {\n _logger.logger.error('decrypting error : ' + err.message);\n this.observer.trigger(Event.ERROR, { type: _errors.ErrorTypes.MEDIA_ERROR, details: _errors.ErrorDetails.FRAG_DECRYPT_ERROR, fatal: true, reason: err.message });\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n var decryptor = this.decryptor;\n if (decryptor) {\n decryptor.destroy();\n this.decryptor = undefined;\n }\n }\n }]);\n\n return Decrypter;\n}();\n\nexports.default = Decrypter;\n\n},{\"17\":17,\"18\":18,\"20\":20,\"33\":33,\"54\":54}],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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar FastAESKey = function () {\n function FastAESKey(subtle, key) {\n _classCallCheck(this, FastAESKey);\n\n this.subtle = subtle;\n this.key = key;\n }\n\n _createClass(FastAESKey, [{\n key: 'expandKey',\n value: function expandKey() {\n return this.subtle.importKey('raw', this.key, { name: 'AES-CBC' }, false, ['encrypt', 'decrypt']);\n }\n }]);\n\n return FastAESKey;\n}();\n\nexports.default = FastAESKey;\n\n},{}],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 * AAC demuxer\n */\n\n\nvar _adts = _dereq_(22);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _logger = _dereq_(54);\n\nvar _id = _dereq_(27);\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, remuxer, config) {\n _classCallCheck(this, AACDemuxer);\n\n this.observer = observer;\n this.config = config;\n this.remuxer = remuxer;\n }\n\n _createClass(AACDemuxer, [{\n key: 'resetInitSegment',\n value: function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {\n this._audioTrack = { container: 'audio/adts', type: 'audio', id: -1, sequenceNumber: 0, isAAC: true, samples: [], len: 0, manifestCodec: audioCodec, duration: duration, inputTimeScale: 90000 };\n }\n }, {\n key: 'resetTimeStamp',\n value: function resetTimeStamp() {}\n }, {\n key: 'append',\n\n\n // feed incoming data to the front of the parsing pipeline\n value: function append(data, timeOffset, contiguous, accurateTimeOffset) {\n var track = this._audioTrack,\n id3Data = _id2.default.getID3Data(data, 0),\n pts = 90 * _id2.default.getTimeStamp(id3Data),\n frameIndex = 0,\n stamp = pts,\n length = data.length,\n offset = id3Data.length;\n\n var id3Samples = [{ pts: stamp, dts: stamp, data: id3Data }];\n\n while (offset < length - 1) {\n if (_adts2.default.isHeader(data, offset) && offset + 5 < length) {\n _adts2.default.initTrackConfig(track, this.observer, data, offset, track.manifestCodec);\n var frame = _adts2.default.appendFrame(track, data, offset, pts, frameIndex);\n if (frame) {\n offset += frame.length;\n stamp = frame.sample.pts;\n frameIndex++;\n } else {\n _logger.logger.log('Unable to parse AAC frame');\n break;\n }\n } else if (_id2.default.isHeader(data, offset)) {\n id3Data = _id2.default.getID3Data(data, offset);\n id3Samples.push({ pts: stamp, dts: stamp, data: id3Data });\n offset += id3Data.length;\n } else {\n //nothing found, keep looking\n offset++;\n }\n }\n\n this.remuxer.remux(track, { samples: [] }, { samples: id3Samples, inputTimeScale: 90000 }, { 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 word\n var offset, length;\n var id3Data = _id2.default.getID3Data(data, 0);\n if (id3Data && _id2.default.getTimeStamp(id3Data) !== undefined) {\n // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1\n // Layer bits (position 14 and 15) in header should be always 0 for ADTS\n // More info https://wiki.multimedia.cx/index.php?title=ADTS\n for (offset = id3Data.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {\n if (_adts2.default.probe(data, offset)) {\n _logger.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},{\"22\":22,\"27\":27,\"54\":54}],22:[function(_dereq_,module,exports){\n'use strict';\n\nvar _logger = _dereq_(54);\n\nvar _errors = _dereq_(33);\n\n/**\n * ADTS parser helper\n */\nvar ADTS = {\n getAudioConfig: 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 manifestCodec = audioCodec,\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: freq less than 24kHz = AAC SBR (HE-AAC)\n if (/firefox/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/Opera ...)\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, manifestCodec: manifestCodec };\n },\n\n isHeaderPattern: function isHeaderPattern(data, offset) {\n return data[offset] === 0xff && (data[offset + 1] & 0xf6) === 0xf0;\n },\n\n getHeaderLength: function getHeaderLength(data, offset) {\n return !!(data[offset + 1] & 0x01) ? 7 : 9;\n },\n\n getFullFrameLength: function getFullFrameLength(data, offset) {\n return (data[offset + 3] & 0x03) << 11 | data[offset + 4] << 3 | (data[offset + 5] & 0xE0) >>> 5;\n },\n\n isHeader: function isHeader(data, offset) {\n // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1\n // Layer bits (position 14 and 15) in header should be always 0 for ADTS\n // More info https://wiki.multimedia.cx/index.php?title=ADTS\n if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {\n return true;\n }\n return false;\n },\n\n probe: function probe(data, offset) {\n // same as isHeader but we also check that ADTS frame follows last ADTS frame \n // or end of data is reached\n if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {\n // ADTS header Length\n var headerLength = this.getHeaderLength(data, offset);\n // ADTS frame Length\n var frameLength = headerLength;\n if (offset + 5 < data.length) {\n frameLength = this.getFullFrameLength(data, offset);\n }\n var newOffset = offset + frameLength;\n if (newOffset === data.length || newOffset + 1 < data.length && this.isHeaderPattern(data, newOffset)) {\n return true;\n }\n }\n return false;\n },\n\n initTrackConfig: function initTrackConfig(track, observer, data, offset, audioCodec) {\n if (!track.samplerate) {\n var config = this.getAudioConfig(observer, data, offset, audioCodec);\n track.config = config.config;\n track.samplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n _logger.logger.log('parsed codec:' + track.codec + ',rate:' + config.samplerate + ',nb channel:' + config.channelCount);\n }\n },\n\n getFrameDuration: function getFrameDuration(samplerate) {\n return 1024 * 90000 / samplerate;\n },\n\n appendFrame: function appendFrame(track, data, offset, pts, frameIndex) {\n var frameDuration = this.getFrameDuration(track.samplerate);\n var header = this.parseFrameHeader(data, offset, pts, frameIndex, frameDuration);\n if (header) {\n var stamp = header.stamp;\n var headerLength = header.headerLength;\n var frameLength = header.frameLength;\n\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n var aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n\n track.samples.push(aacSample);\n track.len += frameLength;\n\n return { sample: aacSample, length: frameLength + headerLength };\n }\n\n return undefined;\n },\n\n parseFrameHeader: function parseFrameHeader(data, offset, pts, frameIndex, frameDuration) {\n var headerLength, frameLength, stamp;\n var length = data.length;\n\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n headerLength = this.getHeaderLength(data, offset);\n // retrieve frame size\n frameLength = this.getFullFrameLength(data, offset);\n frameLength -= headerLength;\n\n if (frameLength > 0 && offset + headerLength + frameLength <= length) {\n stamp = pts + frameIndex * frameDuration;\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n return { headerLength: headerLength, frameLength: frameLength, stamp: stamp };\n }\n\n return undefined;\n }\n};\n\nmodule.exports = ADTS;\n\n},{\"33\":33,\"54\":54}],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; }; }(); /* inline demuxer.\n * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)\n */\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(33);\n\nvar _decrypter = _dereq_(19);\n\nvar _decrypter2 = _interopRequireDefault(_decrypter);\n\nvar _aacdemuxer = _dereq_(21);\n\nvar _aacdemuxer2 = _interopRequireDefault(_aacdemuxer);\n\nvar _mp4demuxer = _dereq_(29);\n\nvar _mp4demuxer2 = _interopRequireDefault(_mp4demuxer);\n\nvar _tsdemuxer = _dereq_(32);\n\nvar _tsdemuxer2 = _interopRequireDefault(_tsdemuxer);\n\nvar _mp3demuxer = _dereq_(28);\n\nvar _mp3demuxer2 = _interopRequireDefault(_mp3demuxer);\n\nvar _mp4Remuxer = _dereq_(45);\n\nvar _mp4Remuxer2 = _interopRequireDefault(_mp4Remuxer);\n\nvar _passthroughRemuxer = _dereq_(46);\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(observer, typeSupported, config, vendor) {\n _classCallCheck(this, DemuxerInline);\n\n this.observer = observer;\n this.typeSupported = typeSupported;\n this.config = config;\n this.vendor = vendor;\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, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {\n if (data.byteLength > 0 && decryptdata != null && decryptdata.key != null && decryptdata.method === 'AES-128') {\n var decrypter = this.decrypter;\n if (decrypter == null) {\n decrypter = this.decrypter = new _decrypter2.default(this.observer, this.config);\n }\n var localthis = this;\n // performance.now() not available on WebWorker, at least on Safari Desktop\n var startTime;\n try {\n startTime = performance.now();\n } catch (error) {\n startTime = Date.now();\n }\n decrypter.decrypt(data, decryptdata.key.buffer, decryptdata.iv.buffer, function (decryptedData) {\n var endTime;\n try {\n endTime = performance.now();\n } catch (error) {\n endTime = Date.now();\n }\n localthis.observer.trigger(_events2.default.FRAG_DECRYPTED, { stats: { tstart: startTime, tdecrypt: endTime } });\n localthis.pushDecrypted(new Uint8Array(decryptedData), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);\n });\n } else {\n this.pushDecrypted(new Uint8Array(data), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);\n }\n }\n }, {\n key: 'pushDecrypted',\n value: function pushDecrypted(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {\n var demuxer = this.demuxer;\n if (!demuxer ||\n // in case of continuity change, we might switch from content type (AAC container to TS container for example)\n // so let's check that current demuxer is still valid\n discontinuity && !this.probe(data)) {\n var observer = this.observer;\n var typeSupported = this.typeSupported;\n var config = this.config;\n // probing order is AAC/MP3/TS/MP4\n var muxConfig = [{ demux: _aacdemuxer2.default, remux: _mp4Remuxer2.default }, { demux: _mp3demuxer2.default, remux: _mp4Remuxer2.default }, { demux: _tsdemuxer2.default, remux: _mp4Remuxer2.default }, { demux: _mp4demuxer2.default, remux: _passthroughRemuxer2.default }];\n\n // probe for content type\n for (var i = 0, len = muxConfig.length; i < len; i++) {\n var mux = muxConfig[i];\n var probe = mux.demux.probe;\n if (probe(data)) {\n var _remuxer = this.remuxer = new mux.remux(observer, config, typeSupported, this.vendor);\n demuxer = new mux.demux(observer, _remuxer, config, typeSupported);\n this.probe = probe;\n break;\n }\n }\n if (!demuxer) {\n 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' });\n return;\n }\n this.demuxer = demuxer;\n }\n var remuxer = this.remuxer;\n\n if (discontinuity || trackSwitch) {\n demuxer.resetInitSegment(initSegment, audioCodec, videoCodec, duration);\n remuxer.resetInitSegment();\n }\n if (discontinuity) {\n demuxer.resetTimeStamp(defaultInitPTS);\n remuxer.resetTimeStamp(defaultInitPTS);\n }\n if (typeof demuxer.setDecryptData === 'function') {\n demuxer.setDecryptData(decryptdata);\n }\n demuxer.append(data, timeOffset, contiguous, accurateTimeOffset);\n }\n }]);\n\n return DemuxerInline;\n}();\n\nexports.default = DemuxerInline;\n\n},{\"19\":19,\"21\":21,\"28\":28,\"29\":29,\"32\":32,\"33\":33,\"35\":35,\"45\":45,\"46\":46}],24:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _demuxerInline = _dereq_(23);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(54);\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.typeSupported, config, data.vendor);\n try {\n (0, _logger.enableLogs)(config.debug === true);\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(data.data, data.decryptdata, data.initSegment, data.audioCodec, data.videoCodec, data.timeOffset, data.discontinuity, data.trackSwitch, data.contiguous, data.duration, data.accurateTimeOffset, data.defaultInitPTS);\n break;\n default:\n break;\n }\n });\n\n // forward events to main thread\n observer.on(_events2.default.FRAG_DECRYPTED, forwardMessage);\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 observer.on(_events2.default.INIT_PTS_FOUND, 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 transferable = [];\n var message = { event: ev, data: data };\n if (data.data1) {\n message.data1 = data.data1.buffer;\n transferable.push(data.data1.buffer);\n delete data.data1;\n }\n if (data.data2) {\n message.data2 = data.data2.buffer;\n transferable.push(data.data2.buffer);\n delete data.data2;\n }\n self.postMessage(message, transferable);\n });\n};\n\nexports.default = DemuxerWorker;\n\n},{\"1\":1,\"23\":23,\"35\":35,\"54\":54}],25:[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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _demuxerInline = _dereq_(23);\n\nvar _demuxerInline2 = _interopRequireDefault(_demuxerInline);\n\nvar _demuxerWorker = _dereq_(24);\n\nvar _demuxerWorker2 = _interopRequireDefault(_demuxerWorker);\n\nvar _logger = _dereq_(54);\n\nvar _errors = _dereq_(33);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\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 // observer setup\n var observer = this.observer = new _events4.default();\n var config = hls.config;\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 (ev, data) {\n data = data || {};\n data.frag = this.frag;\n data.id = this.id;\n hls.trigger(ev, data);\n }.bind(this);\n\n // forward events to main thread\n observer.on(_events2.default.FRAG_DECRYPTED, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(_events2.default.FRAG_PARSING_DATA, 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 observer.on(_events2.default.INIT_PTS_FOUND, forwardMessage);\n\n var typeSupported = {\n mp4: MediaSource.isTypeSupported('video/mp4'),\n mpeg: MediaSource.isTypeSupported('audio/mpeg'),\n mp3: MediaSource.isTypeSupported('audio/mp4; codecs=\"mp3\"')\n };\n // navigator.vendor is not always available in Web Worker\n // refer to https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/navigator\n var vendor = navigator.vendor;\n if (config.enableWorker && typeof Worker !== 'undefined') {\n _logger.logger.log('demuxing in webworker');\n var w = void 0;\n try {\n var work = _dereq_(3);\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, vendor: vendor, id: id, config: JSON.stringify(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(observer, typeSupported, config, vendor);\n this.w = undefined;\n }\n } else {\n this.demuxer = new _demuxerInline2.default(observer, typeSupported, config, vendor);\n }\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 observer = this.observer;\n if (observer) {\n observer.removeAllListeners();\n this.observer = null;\n }\n }\n }, {\n key: 'push',\n value: function push(data, initSegment, audioCodec, videoCodec, frag, duration, accurateTimeOffset, defaultInitPTS) {\n var w = this.w;\n var timeOffset = !isNaN(frag.startDTS) ? frag.startDTS : frag.start;\n var decryptdata = frag.decryptdata;\n var lastFrag = this.frag;\n var discontinuity = !(lastFrag && frag.cc === lastFrag.cc);\n var trackSwitch = !(lastFrag && frag.level === lastFrag.level);\n var nextSN = lastFrag && frag.sn === lastFrag.sn + 1;\n var contiguous = !trackSwitch && nextSN;\n if (discontinuity) {\n _logger.logger.log(this.id + ':discontinuity detected');\n }\n if (trackSwitch) {\n _logger.logger.log(this.id + ':switch detected');\n }\n this.frag = frag;\n if (w) {\n // post fragment payload as transferable objects (no copy)\n 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]);\n } else {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);\n }\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 if (data.data2) {\n data.data.data2 = new Uint8Array(data.data2);\n }\n /* falls through */\n default:\n data.data = data.data || {};\n data.data.frag = this.frag;\n data.data.id = this.id;\n hls.trigger(data.event, data.data);\n break;\n }\n }\n }]);\n\n return Demuxer;\n}();\n\nexports.default = Demuxer;\n\n},{\"1\":1,\"23\":23,\"24\":24,\"3\":3,\"33\":33,\"35\":35,\"54\":54}],26:[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_(54);\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 = 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 data = this.data,\n bytesAvailable = this.bytesAvailable,\n position = data.byteLength - bytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, bytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(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 profileIdc,\n profileCompat,\n levelIdc,\n numRefFramesInPicOrderCntCycle,\n picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n i,\n readUByte = this.readUByte.bind(this),\n readBits = this.readBits.bind(this),\n readUEG = this.readUEG.bind(this),\n readBoolean = this.readBoolean.bind(this),\n skipBits = this.skipBits.bind(this),\n skipEG = this.skipEG.bind(this),\n skipUEG = this.skipUEG.bind(this),\n skipScalingList = this.skipScalingList.bind(this);\n\n readUByte();\n profileIdc = readUByte(); // profile_idc\n profileCompat = readBits(5); // constraint_set[0-4]_flag, u(5)\n skipBits(3); // reserved_zero_3bits u(3),\n levelIdc = readUByte(); //level_idc u(8)\n 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 = readUEG();\n if (chromaFormatIdc === 3) {\n skipBits(1); // separate_colour_plane_flag\n }\n skipUEG(); // bit_depth_luma_minus8\n skipUEG(); // bit_depth_chroma_minus8\n skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (readBoolean()) {\n // seq_scaling_matrix_present_flag\n scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (readBoolean()) {\n // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16);\n } else {\n skipScalingList(64);\n }\n }\n }\n }\n }\n skipUEG(); // log2_max_frame_num_minus4\n var picOrderCntType = readUEG();\n if (picOrderCntType === 0) {\n readUEG(); //log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n skipBits(1); // delta_pic_order_always_zero_flag\n skipEG(); // offset_for_non_ref_pic\n skipEG(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = readUEG();\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n skipEG(); // offset_for_ref_frame[ i ]\n }\n }\n skipUEG(); // max_num_ref_frames\n skipBits(1); // gaps_in_frame_num_value_allowed_flag\n picWidthInMbsMinus1 = readUEG();\n picHeightInMapUnitsMinus1 = readUEG();\n frameMbsOnlyFlag = readBits(1);\n if (frameMbsOnlyFlag === 0) {\n skipBits(1); // mb_adaptive_frame_field_flag\n }\n skipBits(1); // direct_8x8_inference_flag\n if (readBoolean()) {\n // frame_cropping_flag\n frameCropLeftOffset = readUEG();\n frameCropRightOffset = readUEG();\n frameCropTopOffset = readUEG();\n frameCropBottomOffset = readUEG();\n }\n var pixelRatio = [1, 1];\n if (readBoolean()) {\n // vui_parameters_present_flag\n if (readBoolean()) {\n // aspect_ratio_info_present_flag\n var aspectRatioIdc = readUByte();\n switch (aspectRatioIdc) {\n case 1:\n pixelRatio = [1, 1];break;\n case 2:\n pixelRatio = [12, 11];break;\n case 3:\n pixelRatio = [10, 11];break;\n case 4:\n pixelRatio = [16, 11];break;\n case 5:\n pixelRatio = [40, 33];break;\n case 6:\n pixelRatio = [24, 11];break;\n case 7:\n pixelRatio = [20, 11];break;\n case 8:\n pixelRatio = [32, 11];break;\n case 9:\n pixelRatio = [80, 33];break;\n case 10:\n pixelRatio = [18, 11];break;\n case 11:\n pixelRatio = [15, 11];break;\n case 12:\n pixelRatio = [64, 33];break;\n case 13:\n pixelRatio = [160, 99];break;\n case 14:\n pixelRatio = [4, 3];break;\n case 15:\n pixelRatio = [3, 2];break;\n case 16:\n pixelRatio = [2, 1];break;\n case 255:\n {\n pixelRatio = [readUByte() << 8 | readUByte(), readUByte() << 8 | readUByte()];\n break;\n }\n }\n }\n }\n return {\n width: Math.ceil((picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2),\n height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - (frameMbsOnlyFlag ? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset),\n pixelRatio: pixelRatio\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},{\"54\":54}],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 * ID3 parser\n */\nvar ID3 = function () {\n function ID3() {\n _classCallCheck(this, ID3);\n }\n\n _createClass(ID3, null, [{\n key: 'isHeader',\n\n /**\n * Returns true if an ID3 header can be found at offset in data\n * @param {Uint8Array} data - The data to search in\n * @param {number} offset - The offset at which to start searching\n * @return {boolean} - True if an ID3 header is found\n */\n value: function isHeader(data, offset) {\n /*\n * http://id3.org/id3v2.3.0\n * [0] = 'I'\n * [1] = 'D'\n * [2] = '3'\n * [3,4] = {Version}\n * [5] = {Flags}\n * [6-9] = {ID3 Size}\n *\n * An ID3v2 tag can be detected with the following pattern:\n * $49 44 33 yy yy xx zz zz zz zz\n * Where yy is less than $FF, xx is the 'flags' byte and zz is less than $80\n */\n if (offset + 10 <= data.length) {\n //look for 'ID3' identifier\n if (data[offset] === 0x49 && data[offset + 1] === 0x44 && data[offset + 2] === 0x33) {\n //check version is within range\n if (data[offset + 3] < 0xFF && data[offset + 4] < 0xFF) {\n //check size is within range\n if (data[offset + 6] < 0x80 && data[offset + 7] < 0x80 && data[offset + 8] < 0x80 && data[offset + 9] < 0x80) {\n return true;\n }\n }\n }\n }\n\n return false;\n }\n\n /**\n * Returns true if an ID3 footer can be found at offset in data\n * @param {Uint8Array} data - The data to search in\n * @param {number} offset - The offset at which to start searching\n * @return {boolean} - True if an ID3 footer is found\n */\n\n }, {\n key: 'isFooter',\n value: function isFooter(data, offset) {\n /*\n * The footer is a copy of the header, but with a different identifier\n */\n if (offset + 10 <= data.length) {\n //look for '3DI' identifier\n if (data[offset] === 0x33 && data[offset + 1] === 0x44 && data[offset + 2] === 0x49) {\n //check version is within range\n if (data[offset + 3] < 0xFF && data[offset + 4] < 0xFF) {\n //check size is within range\n if (data[offset + 6] < 0x80 && data[offset + 7] < 0x80 && data[offset + 8] < 0x80 && data[offset + 9] < 0x80) {\n return true;\n }\n }\n }\n }\n\n return false;\n }\n\n /**\n * Returns any adjacent ID3 tags found in data starting at offset, as one block of data\n * @param {Uint8Array} data - The data to search in\n * @param {number} offset - The offset at which to start searching\n * @return {Uint8Array} - The block of data containing any ID3 tags found\n */\n\n }, {\n key: 'getID3Data',\n value: function getID3Data(data, offset) {\n var front = offset;\n var length = 0;\n\n while (ID3.isHeader(data, offset)) {\n //ID3 header is 10 bytes\n length += 10;\n\n var size = ID3._readSize(data, offset + 6);\n length += size;\n\n if (ID3.isFooter(data, offset + 10)) {\n //ID3 footer is 10 bytes\n length += 10;\n }\n\n offset += length;\n }\n\n if (length > 0) {\n return data.subarray(front, front + length);\n }\n\n return undefined;\n }\n }, {\n key: '_readSize',\n value: function _readSize(data, offset) {\n var size = 0;\n size = (data[offset] & 0x7f) << 21;\n size |= (data[offset + 1] & 0x7f) << 14;\n size |= (data[offset + 2] & 0x7f) << 7;\n size |= data[offset + 3] & 0x7f;\n return size;\n }\n\n /**\n * Searches for the Elementary Stream timestamp found in the ID3 data chunk\n * @param {Uint8Array} data - Block of data containing one or more ID3 tags\n * @return {number} - The timestamp\n */\n\n }, {\n key: 'getTimeStamp',\n value: function getTimeStamp(data) {\n var frames = ID3.getID3Frames(data);\n for (var i = 0; i < frames.length; i++) {\n var frame = frames[i];\n if (ID3.isTimeStampFrame(frame)) {\n return ID3._readTimeStamp(frame);\n }\n }\n\n return undefined;\n }\n\n /**\n * Returns true if the ID3 frame is an Elementary Stream timestamp frame\n * @param {ID3 frame} frame\n */\n\n }, {\n key: 'isTimeStampFrame',\n value: function isTimeStampFrame(frame) {\n return frame && frame.key === 'PRIV' && frame.info === 'com.apple.streaming.transportStreamTimestamp';\n }\n }, {\n key: '_getFrameData',\n value: function _getFrameData(data) {\n /*\n Frame ID $xx xx xx xx (four characters)\n Size $xx xx xx xx\n Flags $xx xx\n */\n var type = String.fromCharCode(data[0], data[1], data[2], data[3]);\n var size = ID3._readSize(data, 4);\n\n //skip frame id, size, and flags\n var offset = 10;\n\n return { type: type, size: size, data: data.subarray(offset, offset + size) };\n }\n\n /**\n * Returns an array of ID3 frames found in all the ID3 tags in the id3Data\n * @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags\n * @return {ID3 frame[]} - Array of ID3 frame objects\n */\n\n }, {\n key: 'getID3Frames',\n value: function getID3Frames(id3Data) {\n var offset = 0;\n var frames = [];\n\n while (ID3.isHeader(id3Data, offset)) {\n var size = ID3._readSize(id3Data, offset + 6);\n //skip past ID3 header\n offset += 10;\n var end = offset + size;\n //loop through frames in the ID3 tag\n while (offset + 8 < end) {\n var frameData = ID3._getFrameData(id3Data.subarray(offset));\n var frame = ID3._decodeFrame(frameData);\n if (frame) {\n frames.push(frame);\n }\n //skip frame header and frame data\n offset += frameData.size + 10;\n }\n\n if (ID3.isFooter(id3Data, offset)) {\n offset += 10;\n }\n }\n\n return frames;\n }\n }, {\n key: '_decodeFrame',\n value: function _decodeFrame(frame) {\n if (frame.type === 'PRIV') {\n return ID3._decodePrivFrame(frame);\n } else if (frame.type[0] === 'T') {\n return ID3._decodeTextFrame(frame);\n } else if (frame.type[0] === 'W') {\n return ID3._decodeURLFrame(frame);\n }\n\n return undefined;\n }\n }, {\n key: '_readTimeStamp',\n value: function _readTimeStamp(timeStampFrame) {\n if (timeStampFrame.data.byteLength === 8) {\n var data = new Uint8Array(timeStampFrame.data);\n // timestamp is 33 bit expressed as a big-endian eight-octet number,\n // with the upper 31 bits set to zero.\n var pts33Bit = data[3] & 0x1;\n var timestamp = (data[4] << 23) + (data[5] << 15) + (data[6] << 7) + data[7];\n timestamp /= 45;\n\n if (pts33Bit) {\n timestamp += 47721858.84; // 2^32 / 90\n }\n\n return Math.round(timestamp);\n }\n\n return undefined;\n }\n }, {\n key: '_decodePrivFrame',\n value: function _decodePrivFrame(frame) {\n /*\n Format: <text string>\\0<binary data>\n */\n if (frame.size < 2) {\n return undefined;\n }\n\n var owner = ID3._utf8ArrayToStr(frame.data);\n var privateData = new Uint8Array(frame.data.subarray(owner.length + 1));\n\n return { key: frame.type, info: owner, data: privateData.buffer };\n }\n }, {\n key: '_decodeTextFrame',\n value: function _decodeTextFrame(frame) {\n if (frame.size < 2) {\n return undefined;\n }\n\n if (frame.type === 'TXXX') {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Description}\\0{Value}\n */\n var index = 1;\n var description = ID3._utf8ArrayToStr(frame.data.subarray(index));\n\n index += description.length + 1;\n var value = ID3._utf8ArrayToStr(frame.data.subarray(index));\n\n return { key: frame.type, info: description, data: value };\n } else {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Value}\n */\n var text = ID3._utf8ArrayToStr(frame.data.subarray(1));\n return { key: frame.type, data: text };\n }\n }\n }, {\n key: '_decodeURLFrame',\n value: function _decodeURLFrame(frame) {\n if (frame.type === 'WXXX') {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Description}\\0{URL}\n */\n if (frame.size < 2) {\n return undefined;\n }\n\n var index = 1;\n var description = ID3._utf8ArrayToStr(frame.data.subarray(index));\n\n index += description.length + 1;\n var value = ID3._utf8ArrayToStr(frame.data.subarray(index));\n\n return { key: frame.type, info: description, data: value };\n } else {\n /*\n Format:\n [0-?] = {URL}\n */\n var url = ID3._utf8ArrayToStr(frame.data);\n return { key: frame.type, data: url };\n }\n }\n\n // http://stackoverflow.com/questions/8936984/uint8array-to-string-in-javascript/22373197\n // http://www.onicos.com/staff/iz/amuse/javascript/expert/utf.txt\n /* utf.js - UTF-8 <=> UTF-16 convertion\n *\n * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>\n * Version: 1.0\n * LastModified: Dec 25 1999\n * This library is free. You can redistribute it and/or modify it.\n */\n\n }, {\n key: '_utf8ArrayToStr',\n value: function _utf8ArrayToStr(array) {\n\n var char2 = void 0;\n var char3 = void 0;\n var out = '';\n var i = 0;\n var length = array.length;\n\n while (i < length) {\n var c = array[i++];\n switch (c >> 4) {\n case 0:\n return out;\n case 1:case 2:case 3:case 4:case 5:case 6:case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12:case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode((c & 0x1F) << 6 | char2 & 0x3F);\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode((c & 0x0F) << 12 | (char2 & 0x3F) << 6 | (char3 & 0x3F) << 0);\n break;\n }\n }\n\n return out;\n }\n }]);\n\n return ID3;\n}();\n\nexports.default = ID3;\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 * MP3 demuxer\n */\n\n\nvar _id = _dereq_(27);\n\nvar _id2 = _interopRequireDefault(_id);\n\nvar _logger = _dereq_(54);\n\nvar _mpegaudio = _dereq_(30);\n\nvar _mpegaudio2 = _interopRequireDefault(_mpegaudio);\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 MP3Demuxer = function () {\n function MP3Demuxer(observer, remuxer, config) {\n _classCallCheck(this, MP3Demuxer);\n\n this.observer = observer;\n this.config = config;\n this.remuxer = remuxer;\n }\n\n _createClass(MP3Demuxer, [{\n key: 'resetInitSegment',\n value: function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {\n this._audioTrack = { container: 'audio/mpeg', type: 'audio', id: -1, sequenceNumber: 0, isAAC: false, samples: [], len: 0, manifestCodec: audioCodec, duration: duration, inputTimeScale: 90000 };\n }\n }, {\n key: 'resetTimeStamp',\n value: function resetTimeStamp() {}\n }, {\n key: 'append',\n\n\n // feed incoming data to the front of the parsing pipeline\n value: function append(data, timeOffset, contiguous, accurateTimeOffset) {\n var id3Data = _id2.default.getID3Data(data, 0);\n var pts = 90 * _id2.default.getTimeStamp(id3Data);\n var offset = id3Data.length;\n var length = data.length;\n var frameIndex = 0,\n stamp = 0;\n var track = this._audioTrack;\n\n var id3Samples = [{ pts: pts, dts: pts, data: id3Data }];\n\n while (offset < length) {\n if (_mpegaudio2.default.isHeader(data, offset)) {\n var frame = _mpegaudio2.default.appendFrame(track, data, offset, pts, frameIndex);\n if (frame) {\n offset += frame.length;\n stamp = frame.sample.pts;\n frameIndex++;\n } else {\n //logger.log('Unable to parse Mpeg audio frame');\n break;\n }\n } else if (_id2.default.isHeader(data, offset)) {\n id3Data = _id2.default.getID3Data(data, offset);\n id3Samples.push({ pts: stamp, dts: stamp, data: id3Data });\n offset += id3Data.length;\n } else {\n //nothing found, keep looking\n offset++;\n }\n }\n\n this.remuxer.remux(track, { samples: [] }, { samples: id3Samples, inputTimeScale: 90000 }, { 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 MPEG sync word\n var offset, length;\n var id3Data = _id2.default.getID3Data(data, 0);\n if (id3Data && _id2.default.getTimeStamp(id3Data) !== undefined) {\n // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1\n // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)\n // More info http://www.mp3-tech.org/programmer/frame_header.html\n for (offset = id3Data.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {\n if (_mpegaudio2.default.probe(data, offset)) {\n _logger.logger.log('MPEG Audio sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n }]);\n\n return MP3Demuxer;\n}();\n\nexports.default = MP3Demuxer;\n\n},{\"27\":27,\"30\":30,\"54\":54}],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 * MP4 demuxer\n */\n//import {logger} from '../utils/logger';\n\n\nvar _events = _dereq_(35);\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 UINT32_MAX = Math.pow(2, 32) - 1;\n\nvar MP4Demuxer = function () {\n function MP4Demuxer(observer, remuxer) {\n _classCallCheck(this, MP4Demuxer);\n\n this.observer = observer;\n this.remuxer = remuxer;\n }\n\n _createClass(MP4Demuxer, [{\n key: 'resetTimeStamp',\n value: function resetTimeStamp(initPTS) {\n this.initPTS = initPTS;\n }\n }, {\n key: 'resetInitSegment',\n value: function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {\n //jshint unused:false\n if (initSegment && initSegment.byteLength) {\n var initData = this.initData = MP4Demuxer.parseInitSegment(initSegment);\n var tracks = {};\n if (initData.audio) {\n tracks.audio = { container: 'audio/mp4', codec: audioCodec, initSegment: duration ? initSegment : null };\n }\n if (initData.video) {\n tracks.video = { container: 'video/mp4', codec: videoCodec, initSegment: duration ? initSegment : null };\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_INIT_SEGMENT, { tracks: tracks });\n } else {\n if (audioCodec) {\n this.audioCodec = audioCodec;\n }\n if (videoCodec) {\n this.videoCodec = videoCodec;\n }\n }\n }\n }, {\n key: 'append',\n\n\n // feed incoming data to the front of the parsing pipeline\n value: function append(data, timeOffset, contiguous, accurateTimeOffset) {\n var initData = this.initData;\n if (!initData) {\n this.resetInitSegment(data, this.audioCodec, this.videoCodec);\n initData = this.initData;\n }\n var startDTS = void 0,\n initPTS = this.initPTS;\n if (initPTS === undefined) {\n var _startDTS = MP4Demuxer.getStartDTS(initData, data);\n this.initPTS = initPTS = _startDTS - timeOffset;\n this.observer.trigger(_events2.default.INIT_PTS_FOUND, { initPTS: initPTS });\n }\n MP4Demuxer.offsetStartDTS(initData, data, initPTS);\n startDTS = MP4Demuxer.getStartDTS(initData, data);\n this.remuxer.remux(initData.audio, initData.video, null, null, startDTS, contiguous, accurateTimeOffset, data);\n }\n }, {\n key: 'destroy',\n value: function destroy() {}\n }], [{\n key: 'probe',\n value: function probe(data) {\n if (data.length >= 8) {\n var dataType = MP4Demuxer.bin2str(data.subarray(4, 8));\n return ['moof', 'ftyp', 'styp'].indexOf(dataType) >= 0;\n }\n return false;\n }\n }, {\n key: 'bin2str',\n value: function bin2str(buffer) {\n return String.fromCharCode.apply(null, buffer);\n }\n }, {\n key: 'readUint32',\n value: function readUint32(buffer, offset) {\n if (buffer.data) {\n offset += buffer.start;\n buffer = buffer.data;\n }\n\n var val = buffer[offset] << 24 | buffer[offset + 1] << 16 | buffer[offset + 2] << 8 | buffer[offset + 3];\n return val < 0 ? 4294967296 + val : val;\n }\n }, {\n key: 'writeUint32',\n value: function writeUint32(buffer, offset, value) {\n if (buffer.data) {\n offset += buffer.start;\n buffer = buffer.data;\n }\n buffer[offset] = value >> 24;\n buffer[offset + 1] = value >> 16 & 0xff;\n buffer[offset + 2] = value >> 8 & 0xff;\n buffer[offset + 3] = value & 0xff;\n }\n\n // Find the data for a box specified by its path\n\n }, {\n key: 'findBox',\n value: function findBox(data, path) {\n var results = [],\n i,\n size,\n type,\n end,\n subresults,\n start,\n endbox;\n\n if (data.data) {\n start = data.start;\n end = data.end;\n data = data.data;\n } else {\n start = 0;\n end = data.byteLength;\n }\n\n if (!path.length) {\n // short-circuit the search for empty paths\n return null;\n }\n\n for (i = start; i < end;) {\n size = MP4Demuxer.readUint32(data, i);\n type = MP4Demuxer.bin2str(data.subarray(i + 4, i + 8));\n endbox = size > 1 ? i + size : end;\n\n if (type === path[0]) {\n\n if (path.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push({ data: data, start: i + 8, end: endbox });\n } else {\n // recursively search for the next box along the path\n subresults = MP4Demuxer.findBox({ data: data, start: i + 8, end: endbox }, path.slice(1));\n if (subresults.length) {\n results = results.concat(subresults);\n }\n }\n }\n i = endbox;\n }\n\n // we've finished searching all of data\n return results;\n }\n\n /**\n * Parses an MP4 initialization segment and extracts stream type and\n * timescale values for any declared tracks. Timescale values indicate the\n * number of clock ticks per second to assume for time-based values\n * elsewhere in the MP4.\n *\n * To determine the start time of an MP4, you need two pieces of\n * information: the timescale unit and the earliest base media decode\n * time. Multiple timescales can be specified within an MP4 but the\n * base media decode time is always expressed in the timescale from\n * the media header box for the track:\n * ```\n * moov > trak > mdia > mdhd.timescale\n * moov > trak > mdia > hdlr\n * ```\n * @param init {Uint8Array} the bytes of the init segment\n * @return {object} a hash of track type to timescale values or null if\n * the init segment is malformed.\n */\n\n }, {\n key: 'parseInitSegment',\n value: function parseInitSegment(initSegment) {\n var result = [];\n var traks = MP4Demuxer.findBox(initSegment, ['moov', 'trak']);\n\n traks.forEach(function (trak) {\n var tkhd = MP4Demuxer.findBox(trak, ['tkhd'])[0];\n if (tkhd) {\n var version = tkhd.data[tkhd.start];\n var index = version === 0 ? 12 : 20;\n var trackId = MP4Demuxer.readUint32(tkhd, index);\n\n var mdhd = MP4Demuxer.findBox(trak, ['mdia', 'mdhd'])[0];\n if (mdhd) {\n version = mdhd.data[mdhd.start];\n index = version === 0 ? 12 : 20;\n var timescale = MP4Demuxer.readUint32(mdhd, index);\n\n var hdlr = MP4Demuxer.findBox(trak, ['mdia', 'hdlr'])[0];\n if (hdlr) {\n var hdlrType = MP4Demuxer.bin2str(hdlr.data.subarray(hdlr.start + 8, hdlr.start + 12));\n var type = { 'soun': 'audio', 'vide': 'video' }[hdlrType];\n if (type) {\n result[trackId] = { timescale: timescale, type: type };\n result[type] = { timescale: timescale, id: trackId };\n }\n }\n }\n }\n });\n return result;\n }\n\n /**\n * Determine the base media decode start time, in seconds, for an MP4\n * fragment. If multiple fragments are specified, the earliest time is\n * returned.\n *\n * The base media decode time can be parsed from track fragment\n * metadata:\n * ```\n * moof > traf > tfdt.baseMediaDecodeTime\n * ```\n * It requires the timescale value from the mdhd to interpret.\n *\n * @param timescale {object} a hash of track ids to timescale values.\n * @return {number} the earliest base media decode start time for the\n * fragment, in seconds\n */\n\n }, {\n key: 'getStartDTS',\n value: function getStartDTS(initData, fragment) {\n var trafs, baseTimes, result;\n\n // we need info from two childrend of each track fragment box\n trafs = MP4Demuxer.findBox(fragment, ['moof', 'traf']);\n\n // determine the start times for each track\n baseTimes = [].concat.apply([], trafs.map(function (traf) {\n return MP4Demuxer.findBox(traf, ['tfhd']).map(function (tfhd) {\n var id, scale, baseTime;\n\n // get the track id from the tfhd\n id = MP4Demuxer.readUint32(tfhd, 4);\n // assume a 90kHz clock if no timescale was specified\n scale = initData[id].timescale || 90e3;\n\n // get the base media decode time from the tfdt\n baseTime = MP4Demuxer.findBox(traf, ['tfdt']).map(function (tfdt) {\n var version, result;\n\n version = tfdt.data[tfdt.start];\n result = MP4Demuxer.readUint32(tfdt, 4);\n if (version === 1) {\n result *= Math.pow(2, 32);\n\n result += MP4Demuxer.readUint32(tfdt, 8);\n }\n return result;\n })[0];\n baseTime = baseTime || Infinity;\n\n // convert base time to seconds\n return baseTime / scale;\n });\n }));\n\n // return the minimum\n result = Math.min.apply(null, baseTimes);\n return isFinite(result) ? result : 0;\n }\n }, {\n key: 'offsetStartDTS',\n value: function offsetStartDTS(initData, fragment, timeOffset) {\n MP4Demuxer.findBox(fragment, ['moof', 'traf']).map(function (traf) {\n return MP4Demuxer.findBox(traf, ['tfhd']).map(function (tfhd) {\n // get the track id from the tfhd\n var id = MP4Demuxer.readUint32(tfhd, 4);\n // assume a 90kHz clock if no timescale was specified\n var timescale = initData[id].timescale || 90e3;\n\n // get the base media decode time from the tfdt\n MP4Demuxer.findBox(traf, ['tfdt']).map(function (tfdt) {\n var version = tfdt.data[tfdt.start];\n var baseMediaDecodeTime = MP4Demuxer.readUint32(tfdt, 4);\n if (version === 0) {\n MP4Demuxer.writeUint32(tfdt, 4, baseMediaDecodeTime - timeOffset * timescale);\n } else {\n baseMediaDecodeTime *= Math.pow(2, 32);\n baseMediaDecodeTime += MP4Demuxer.readUint32(tfdt, 8);\n baseMediaDecodeTime -= timeOffset * timescale;\n var upper = Math.floor(baseMediaDecodeTime / (UINT32_MAX + 1));\n var lower = Math.floor(baseMediaDecodeTime % (UINT32_MAX + 1));\n MP4Demuxer.writeUint32(tfdt, 4, upper);\n MP4Demuxer.writeUint32(tfdt, 8, lower);\n }\n });\n });\n });\n }\n }]);\n\n return MP4Demuxer;\n}();\n\nexports.default = MP4Demuxer;\n\n},{\"35\":35}],30:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * MPEG parser helper\n */\n\nvar MpegAudio = {\n\n 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],\n\n SamplingRateMap: [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000],\n\n appendFrame: function appendFrame(track, data, offset, pts, frameIndex) {\n // Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference\n if (offset + 24 > data.length) {\n return undefined;\n }\n\n var header = this.parseHeader(data, offset);\n if (header && offset + header.frameLength <= data.length) {\n var frameDuration = 1152 * 90000 / header.sampleRate;\n var stamp = pts + frameIndex * frameDuration;\n var sample = { unit: data.subarray(offset, offset + header.frameLength), pts: stamp, dts: stamp };\n\n track.config = [];\n track.channelCount = header.channelCount;\n track.samplerate = header.sampleRate;\n track.samples.push(sample);\n track.len += header.frameLength;\n\n return { sample: sample, length: header.frameLength };\n }\n\n return undefined;\n },\n\n parseHeader: function parseHeader(data, offset) {\n var headerB = data[offset + 1] >> 3 & 3;\n var headerC = data[offset + 1] >> 1 & 3;\n var headerE = data[offset + 2] >> 4 & 15;\n var headerF = data[offset + 2] >> 2 & 3;\n var headerG = !!(data[offset + 2] & 2);\n if (headerB !== 1 && headerE !== 0 && headerE !== 15 && headerF !== 3) {\n var columnInBitrates = headerB === 3 ? 3 - headerC : headerC === 3 ? 3 : 4;\n var bitRate = MpegAudio.BitratesMap[columnInBitrates * 14 + headerE - 1] * 1000;\n var columnInSampleRates = headerB === 3 ? 0 : headerB === 2 ? 1 : 2;\n var sampleRate = MpegAudio.SamplingRateMap[columnInSampleRates * 3 + headerF];\n var padding = headerG ? 1 : 0;\n var channelCount = data[offset + 3] >> 6 === 3 ? 1 : 2; // If bits of channel mode are `11` then it is a single channel (Mono)\n var frameLength = headerC === 3 ? (headerB === 3 ? 12 : 6) * bitRate / sampleRate + padding << 2 : (headerB === 3 ? 144 : 72) * bitRate / sampleRate + padding | 0;\n\n return { sampleRate: sampleRate, channelCount: channelCount, frameLength: frameLength };\n }\n\n return undefined;\n },\n\n isHeaderPattern: function isHeaderPattern(data, offset) {\n return data[offset] === 0xff && (data[offset + 1] & 0xe0) === 0xe0 && (data[offset + 1] & 0x06) !== 0x00;\n },\n\n isHeader: function isHeader(data, offset) {\n // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1\n // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)\n // More info http://www.mp3-tech.org/programmer/frame_header.html\n if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {\n return true;\n }\n return false;\n },\n\n probe: function probe(data, offset) {\n // same as isHeader but we also check that MPEG frame follows last MPEG frame \n // or end of data is reached\n if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {\n // MPEG header Length\n var headerLength = 4;\n // MPEG frame Length\n var header = this.parseHeader(data, offset);\n var frameLength = headerLength;\n if (header && header.frameLength) {\n frameLength = header.frameLength;\n }\n var newOffset = offset + frameLength;\n if (newOffset === data.length || newOffset + 1 < data.length && this.isHeaderPattern(data, newOffset)) {\n return true;\n }\n }\n return false;\n }\n};\n\nmodule.exports = MpegAudio;\n\n},{}],31:[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 * SAMPLE-AES decrypter\n */\n\nvar _decrypter = _dereq_(19);\n\nvar _decrypter2 = _interopRequireDefault(_decrypter);\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 SampleAesDecrypter = function () {\n function SampleAesDecrypter(observer, config, decryptdata, discardEPB) {\n _classCallCheck(this, SampleAesDecrypter);\n\n this.decryptdata = decryptdata;\n this.discardEPB = discardEPB;\n this.decrypter = new _decrypter2.default(observer, config);\n }\n\n _createClass(SampleAesDecrypter, [{\n key: 'decryptBuffer',\n value: function decryptBuffer(encryptedData, callback) {\n this.decrypter.decrypt(encryptedData, this.decryptdata.key.buffer, this.decryptdata.iv.buffer, callback);\n }\n\n // AAC - encrypt all full 16 bytes blocks starting from offset 16\n\n }, {\n key: 'decryptAacSample',\n value: function decryptAacSample(samples, sampleIndex, callback, sync) {\n var curUnit = samples[sampleIndex].unit;\n var encryptedData = curUnit.subarray(16, curUnit.length - curUnit.length % 16);\n var encryptedBuffer = encryptedData.buffer.slice(encryptedData.byteOffset, encryptedData.byteOffset + encryptedData.length);\n\n var localthis = this;\n this.decryptBuffer(encryptedBuffer, function (decryptedData) {\n decryptedData = new Uint8Array(decryptedData);\n curUnit.set(decryptedData, 16);\n\n if (!sync) {\n localthis.decryptAacSamples(samples, sampleIndex + 1, callback);\n }\n });\n }\n }, {\n key: 'decryptAacSamples',\n value: function decryptAacSamples(samples, sampleIndex, callback) {\n for (;; sampleIndex++) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n\n if (samples[sampleIndex].unit.length < 32) {\n continue;\n }\n\n var sync = this.decrypter.isSync();\n\n this.decryptAacSample(samples, sampleIndex, callback, sync);\n\n if (!sync) {\n return;\n }\n }\n }\n\n // AVC - encrypt one 16 bytes block out of ten, starting from offset 32\n\n }, {\n key: 'getAvcEncryptedData',\n value: function getAvcEncryptedData(decodedData) {\n var encryptedDataLen = Math.floor((decodedData.length - 48) / 160) * 16 + 16;\n var encryptedData = new Int8Array(encryptedDataLen);\n var outputPos = 0;\n for (var inputPos = 32; inputPos <= decodedData.length - 16; inputPos += 160, outputPos += 16) {\n encryptedData.set(decodedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return encryptedData;\n }\n }, {\n key: 'getAvcDecryptedUnit',\n value: function getAvcDecryptedUnit(decodedData, decryptedData) {\n decryptedData = new Uint8Array(decryptedData);\n var inputPos = 0;\n for (var outputPos = 32; outputPos <= decodedData.length - 16; outputPos += 160, inputPos += 16) {\n decodedData.set(decryptedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return decodedData;\n }\n }, {\n key: 'decryptAvcSample',\n value: function decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync) {\n var decodedData = this.discardEPB(curUnit.data);\n var encryptedData = this.getAvcEncryptedData(decodedData);\n var localthis = this;\n\n this.decryptBuffer(encryptedData.buffer, function (decryptedData) {\n curUnit.data = localthis.getAvcDecryptedUnit(decodedData, decryptedData);\n\n if (!sync) {\n localthis.decryptAvcSamples(samples, sampleIndex, unitIndex + 1, callback);\n }\n });\n }\n }, {\n key: 'decryptAvcSamples',\n value: function decryptAvcSamples(samples, sampleIndex, unitIndex, callback) {\n for (;; sampleIndex++, unitIndex = 0) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n\n var curUnits = samples[sampleIndex].units;\n for (;; unitIndex++) {\n if (unitIndex >= curUnits.length) {\n break;\n }\n\n var curUnit = curUnits[unitIndex];\n if (curUnit.length <= 48 || curUnit.type !== 1 && curUnit.type !== 5) {\n continue;\n }\n\n var sync = this.decrypter.isSync();\n\n this.decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync);\n\n if (!sync) {\n return;\n }\n }\n }\n }\n }]);\n\n return SampleAesDecrypter;\n}();\n\nexports.default = SampleAesDecrypter;\n\n},{\"19\":19}],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 * 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_(22);\n\nvar _adts2 = _interopRequireDefault(_adts);\n\nvar _mpegaudio = _dereq_(30);\n\nvar _mpegaudio2 = _interopRequireDefault(_mpegaudio);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _expGolomb = _dereq_(26);\n\nvar _expGolomb2 = _interopRequireDefault(_expGolomb);\n\nvar _sampleAes = _dereq_(31);\n\nvar _sampleAes2 = _interopRequireDefault(_sampleAes);\n\nvar _logger = _dereq_(54);\n\nvar _errors = _dereq_(33);\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, remuxer, config, typeSupported) {\n _classCallCheck(this, TSDemuxer);\n\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n this.remuxer = remuxer;\n this.sampleAes = null;\n }\n\n _createClass(TSDemuxer, [{\n key: 'setDecryptData',\n value: function setDecryptData(decryptdata) {\n if (decryptdata != null && decryptdata.key != null && decryptdata.method === 'SAMPLE-AES') {\n this.sampleAes = new _sampleAes2.default(this.observer, this.config, decryptdata, this.discardEPB);\n } else {\n this.sampleAes = null;\n }\n }\n }, {\n key: 'resetInitSegment',\n value: function resetInitSegment(initSegment, audioCodec, videoCodec, duration) {\n this.pmtParsed = false;\n this._pmtId = -1;\n this._avcTrack = { container: 'video/mp2t', type: 'video', id: -1, inputTimeScale: 90000, sequenceNumber: 0, samples: [], len: 0, dropped: 0 };\n this._audioTrack = { container: 'video/mp2t', type: 'audio', id: -1, inputTimeScale: 90000, duration: duration, sequenceNumber: 0, samples: [], len: 0, isAAC: true };\n this._id3Track = { type: 'id3', id: -1, inputTimeScale: 90000, sequenceNumber: 0, samples: [], len: 0 };\n this._txtTrack = { type: 'text', id: -1, inputTimeScale: 90000, sequenceNumber: 0, samples: [], len: 0 };\n // flush any partial content\n this.aacOverFlow = null;\n this.aacLastPTS = null;\n this.avcSample = null;\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this._duration = duration;\n }\n }, {\n key: 'resetTimeStamp',\n value: function resetTimeStamp() {}\n\n // feed incoming data to the front of the parsing pipeline\n\n }, {\n key: 'append',\n value: function append(data, timeOffset, contiguous, accurateTimeOffset) {\n var start,\n len = data.length,\n stt,\n pid,\n atf,\n offset,\n pes,\n unknownPIDs = false;\n this.contiguous = contiguous;\n var pmtParsed = this.pmtParsed,\n avcTrack = this._avcTrack,\n audioTrack = this._audioTrack,\n id3Track = this._id3Track,\n avcId = avcTrack.id,\n audioId = audioTrack.id,\n id3Id = id3Track.id,\n pmtId = this._pmtId,\n avcData = avcTrack.pesData,\n audioData = audioTrack.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 parseMPEGPES = this._parseMPEGPES.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 }\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 audioId:\n if (stt) {\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n }\n audioData = { data: [], size: 0 };\n }\n if (audioData) {\n audioData.data.push(data.subarray(offset, start + 188));\n audioData.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, this.typeSupported.mpeg === true || this.typeSupported.mp3 === true, this.sampleAes != null);\n\n // only update track id if track PID found while parsing PMT\n // this is to avoid resetting the PID to -1 in case\n // track PID transiently disappears from the stream\n // this could happen in case of transient missing audio samples for example\n avcId = parsedPIDs.avc;\n if (avcId > 0) {\n avcTrack.id = avcId;\n }\n audioId = parsedPIDs.audio;\n if (audioId > 0) {\n audioTrack.id = audioId;\n audioTrack.isAAC = parsedPIDs.isAAC;\n }\n id3Id = parsedPIDs.id3;\n if (id3Id > 0) {\n id3Track.id = id3Id;\n }\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, 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 (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n audioTrack.pesData = null;\n } else {\n if (audioData && audioData.size) {\n _logger.logger.log('last AAC PES packet truncated,might overlap between fragments');\n }\n // either audioData null or PES truncated, keep it for next frag parsing\n audioTrack.pesData = audioData;\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\n if (this.sampleAes == null) {\n this.remuxer.remux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);\n } else {\n this.decryptAndRemux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n }, {\n key: 'decryptAndRemux',\n value: function decryptAndRemux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n if (audioTrack.samples && audioTrack.isAAC) {\n var localthis = this;\n this.sampleAes.decryptAacSamples(audioTrack.samples, 0, function () {\n localthis.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n });\n } else {\n this.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n }, {\n key: 'decryptAndRemuxAvc',\n value: function decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n if (videoTrack.samples) {\n var localthis = this;\n this.sampleAes.decryptAvcSamples(videoTrack.samples, 0, 0, function () {\n localthis.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n });\n } else {\n this.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n }, {\n key: 'destroy',\n value: function destroy() {\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, mpegSupported, isSampleAes) {\n var sectionLength,\n tableEnd,\n programInfoLength,\n pid,\n result = { audio: -1, avc: -1, id3: -1, isAAC: true };\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 case 0xcf:\n // SAMPLE-AES AAC\n if (!isSampleAes) {\n _logger.logger.log('unkown stream type:' + data[offset]);\n break;\n }\n /* falls through */\n\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.audio === -1) {\n result.audio = pid;\n }\n break;\n\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\n case 0xdb:\n // SAMPLE-AES AVC\n if (!isSampleAes) {\n _logger.logger.log('unkown stream type:' + data[offset]);\n break;\n }\n /* falls through */\n\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\n // ISO/IEC 11172-3 (MPEG-1 audio)\n // or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)\n case 0x03:\n case 0x04:\n //logger.log('MPEG PID:' + pid);\n if (!mpegSupported) {\n _logger.logger.log('MPEG audio found, not supported in this browser for now');\n } else if (result.audio === -1) {\n result.audio = pid;\n result.isAAC = false;\n }\n break;\n\n case 0x24:\n _logger.logger.warn('HEVC stream type found, not supported for now');\n break;\n\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 parsed length is not zero and greater than total received length, 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 if (pesPts - pesDts > 60 * 90000) {\n _logger.logger.warn(Math.round((pesPts - pesDts) / 90000) + 's delta between PTS and DTS, align them');\n pesPts = pesDts;\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 for (var j = 0, dataLen = data.length; j < dataLen; j++) {\n frag = data[j];\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.length && avcSample.frame) {\n var samples = avcTrack.samples;\n var nbSamples = samples.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 && (nbSamples || this.contiguous)) {\n avcSample.id = nbSamples;\n 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);\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 spsfound = false,\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 avcSample.frame = true;\n var data = unit.data;\n // only check slice type to detect KF in case SPS found in same packet (any keyframe is preceded by SPS ...)\n if (spsfound && data.length > 4) {\n // retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR\n var sliceType = new _expGolomb2.default(data).readSliceType();\n // 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice\n // SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.\n // An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.\n // I slice: A slice that is not an SI slice that is decoded using intra prediction only.\n //if (sliceType === 2 || sliceType === 7) {\n if (sliceType === 2 || sliceType === 4 || sliceType === 7 || sliceType === 9) {\n avcSample.key = true;\n }\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 avcSample.frame = 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 spsfound = 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.pixelRatio = config.pixelRatio;\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.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: [], 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.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;\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\n if (state === -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 = array[0] & 0x1f;\n state = 0;\n i = 1;\n }\n\n while (i < len) {\n value = array[i++];\n // optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case\n if (!state) {\n state = value ? 0 : 1;\n continue;\n }\n if (state === 1) {\n state = value ? 0 : 2;\n continue;\n }\n // here we have state either equal to 2 or 3\n if (!value) {\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 }\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._audioTrack,\n data = pes.data,\n pts = pes.pts,\n startOffset = 0,\n aacOverFlow = this.aacOverFlow,\n aacLastPTS = this.aacLastPTS,\n frameDuration,\n frameIndex,\n offset,\n stamp,\n len;\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 (_adts2.default.isHeader(data, offset)) {\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, details: _errors.ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason });\n if (fatal) {\n return;\n }\n }\n\n _adts2.default.initTrackConfig(track, this.observer, data, offset, this.audioCodec);\n frameIndex = 0;\n frameDuration = _adts2.default.getFrameDuration(track.samplerate);\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 //scan for aac samples\n while (offset < len) {\n if (_adts2.default.isHeader(data, offset) && offset + 5 < len) {\n var frame = _adts2.default.appendFrame(track, data, offset, pts, frameIndex);\n if (frame) {\n //logger.log(`${Math.round(frame.sample.pts)} : AAC`);\n offset += frame.length;\n stamp = frame.sample.pts;\n frameIndex++;\n } else {\n //logger.log('Unable to parse AAC frame');\n break;\n }\n } else {\n //nothing found, keep looking\n offset++;\n }\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: '_parseMPEGPES',\n value: function _parseMPEGPES(pes) {\n var data = pes.data;\n var length = data.length;\n var frameIndex = 0;\n var offset = 0;\n var pts = pes.pts;\n\n while (offset < length) {\n if (_mpegaudio2.default.isHeader(data, offset)) {\n var frame = _mpegaudio2.default.appendFrame(this._audioTrack, data, offset, pts, frameIndex);\n if (frame) {\n offset += frame.length;\n frameIndex++;\n } else {\n //logger.log('Unable to parse Mpeg audio frame');\n break;\n }\n } else {\n //nothing found, keep looking\n offset++;\n }\n }\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},{\"22\":22,\"26\":26,\"30\":30,\"31\":31,\"33\":33,\"35\":35,\"54\":54}],33:[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 a mux Error (demuxing/remuxing)\n MUX_ERROR: 'muxError',\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: {id : demuxer Id,frag: fragment object, reason : parsing error description }\n FRAG_DECRYPT_ERROR: 'fragDecryptError',\n // Identifier for a fragment parsing error event - data: { id : demuxer Id, reason : parsing error description }\n // will be renamed DEMUX_PARSING_ERROR and switched to MUX_ERROR in the next major release\n FRAG_PARSING_ERROR: 'fragParsingError',\n // 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 }\n REMUX_ALLOC_ERROR: 'remuxAllocError',\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 a buffer nudge on stall (playback is stuck although currentTime is in a buffered area)\n BUFFER_NUDGE_ON_STALL: 'bufferNudgeOnStall',\n // Identifier for an internal exception happening inside hls.js while handling an event\n INTERNAL_EXCEPTION: 'internalException',\n // Malformed WebVTT contents\n WEBVTT_EXCEPTION: 'webVTTException'\n};\n\n},{}],34:[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 && obj !== Symbol.prototype ? \"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_(54);\n\nvar _errors = _dereq_(33);\n\nvar _events = _dereq_(35);\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 }, 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 }, 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},{\"33\":33,\"35\":35,\"54\":54}],35:[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 reset - data: { }\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, pending : nb of segments waiting for appending for this segment parent}\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 - 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 buffer has been flushed - data: { }\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 switch is requested - data: { level : id of new level } // deprecated in favor LEVEL_SWITCHING\n LEVEL_SWITCH: 'hlsLevelSwitch',\n // fired when a level switch is requested - data: { level : id of new level }\n LEVEL_SWITCHING: 'hlsLevelSwitching',\n // fired when a level switch is effective - data: { level : id of new level }\n LEVEL_SWITCHED: 'hlsLevelSwitched',\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 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 } // deprecated in favor AUDIO_TRACK_SWITCHING\n AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',\n // fired when an audio track switching is requested - data: { id : audio track id }\n AUDIO_TRACK_SWITCHING: 'hlsAudioTrackSwitching',\n // fired when an audio track switch actually occurs - data: { id : audio track id }\n AUDIO_TRACK_SWITCHED: 'hlsAudioTrackSwitched',\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 to notify that subtitle track lists has been updated - data: { subtitleTracks : subtitleTracks }\n SUBTITLE_TRACKS_UPDATED: 'hlsSubtitleTracksUpdated',\n // fired when an subtitle track switch occurs - data: { id : subtitle track id }\n SUBTITLE_TRACK_SWITCH: 'hlsSubtitleTrackSwitch',\n // fired when a subtitle track loading starts - data: { url : subtitle track URL, id : subtitle track id }\n SUBTITLE_TRACK_LOADING: 'hlsSubtitleTrackLoading',\n // fired when a subtitle track loading finishes - data: { details : levelDetails object, id : subtitle track id, stats : { trequest, tfirst, tload, mtime } }\n SUBTITLE_TRACK_LOADED: 'hlsSubtitleTrackLoaded',\n // fired when a subtitle fragment has been processed - data: { success : boolean, frag : the processed frag }\n SUBTITLE_FRAG_PROCESSED: 'hlsSubtitleFragProcessed',\n // fired when the first timestamp is found - data: { id : demuxer id, initPTS: initPTS, frag : fragment object }\n INIT_PTS_FOUND: 'hlsInitPtsFound',\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 a fragment has finished decrypting - data: { id : demuxer id, frag: fragment object, stats : { tstart, tdecrypt } }\n FRAG_DECRYPTED: 'hlsFragDecrypted',\n // 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 }\n FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',\n // fired when parsing sei text is completed - data: { id : demuxer id, frag: fragment object, samples : [ sei samples pes ] }\n FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',\n // fired when parsing id3 is completed - data: { id : demuxer id, frag: fragment object, samples : [ id3 samples pes ] }\n FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',\n // 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}\n FRAG_PARSING_DATA: 'hlsFragParsingData',\n // fired when fragment parsing is completed - data: { id : demuxer id, frag: fragment object }\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, bwEstimate } }\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 - data: { }\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},{}],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\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(codec, channelCount) {\n switch (codec) {\n case 'mp4a.40.2':\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 break;\n // handle HE-AAC below (mp4a.40.5 / mp4a.40.29)\n default:\n if (channelCount === 1) {\n // 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\n 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]);\n } else if (channelCount === 2) {\n // 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\n 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]);\n } else if (channelCount === 3) {\n // 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\n 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]);\n }\n break;\n }\n return null;\n }\n }]);\n\n return AAC;\n}();\n\nexports.default = AAC;\n\n},{}],37:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * Buffer Helper utils, providing methods dealing buffer length retrieval\n*/\n\nvar BufferHelper = {\n isBuffered: 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 bufferInfo: 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: pos, end: pos, nextStart: undefined };\n }\n },\n\n bufferedInfo: 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\nmodule.exports = BufferHelper;\n\n},{}],38:[function(_dereq_,module,exports){\n'use strict';\n\nvar _logger = _dereq_(54);\n\nvar LevelHelper = {\n\n mergeDetails: 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 newFrag.backtracked = oldFrag.backtracked;\n newFrag.dropped = oldFrag.dropped;\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, 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 updateFragPTSDTS: function updateFragPTSDTS(details, frag, startPTS, endPTS, startDTS, endDTS) {\n // update frag PTS/DTS\n var maxStartPTS = startPTS;\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 maxStartPTS = Math.max(startPTS, frag.startPTS);\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 frag.start = frag.startPTS = startPTS;\n frag.maxStartPTS = maxStartPTS;\n frag.endPTS = endPTS;\n frag.startDTS = startDTS;\n frag.endDTS = endDTS;\n frag.duration = endPTS - startPTS;\n\n var sn = frag.sn;\n // exit if sn out of range\n if (!details || sn < details.startSN || sn > details.endSN) {\n return 0;\n }\n var fragIdx, fragments, i;\n fragIdx = sn - details.startSN;\n fragments = details.fragments;\n frag = fragments[fragIdx];\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 updatePTS: 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 = Math.max(fragFrom.start - fragTo.duration, 0);\n }\n }\n }\n}; /**\n * Level Helper class, providing methods dealing with playlist sliding and drift\n */\n\nmodule.exports = LevelHelper;\n\n},{\"54\":54}],39:[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 * HLS interface\n */\n\n\nvar _urlToolkit = _dereq_(2);\n\nvar _urlToolkit2 = _interopRequireDefault(_urlToolkit);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _errors = _dereq_(33);\n\nvar _playlistLoader = _dereq_(43);\n\nvar _playlistLoader2 = _interopRequireDefault(_playlistLoader);\n\nvar _fragmentLoader = _dereq_(41);\n\nvar _fragmentLoader2 = _interopRequireDefault(_fragmentLoader);\n\nvar _keyLoader = _dereq_(42);\n\nvar _keyLoader2 = _interopRequireDefault(_keyLoader);\n\nvar _streamController = _dereq_(13);\n\nvar _streamController2 = _interopRequireDefault(_streamController);\n\nvar _levelController = _dereq_(12);\n\nvar _levelController2 = _interopRequireDefault(_levelController);\n\nvar _id3TrackController = _dereq_(11);\n\nvar _id3TrackController2 = _interopRequireDefault(_id3TrackController);\n\nvar _logger = _dereq_(54);\n\nvar _events3 = _dereq_(1);\n\nvar _events4 = _interopRequireDefault(_events3);\n\nvar _config = _dereq_(4);\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 var mediaSource = window.MediaSource = window.MediaSource || window.WebKitMediaSource;\n var sourceBuffer = window.SourceBuffer = window.SourceBuffer || window.WebKitSourceBuffer;\n var isTypeSupported = mediaSource && typeof mediaSource.isTypeSupported === 'function' && mediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"');\n\n // if SourceBuffer is exposed ensure its API is valid\n // safari and old version of Chrome doe not expose SourceBuffer globally so checking SourceBuffer.prototype is impossible\n var sourceBufferValidAPI = !sourceBuffer || sourceBuffer.prototype && typeof sourceBuffer.prototype.appendBuffer === 'function' && typeof sourceBuffer.prototype.remove === 'function';\n return isTypeSupported && sourceBufferValidAPI;\n }\n }, {\n key: 'version',\n get: function get() {\n // replaced with browserify-versionify transform\n return '0.7.10';\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 return _config.hlsDefaultConfig;\n }\n return Hls.defaultConfig;\n },\n set: function set(defaultConfig) {\n Hls.defaultConfig = defaultConfig;\n }\n }]);\n\n function Hls() {\n var _this = this;\n\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 this._autoLevelCapping = -1;\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\n // core controllers and network loaders\n var abrController = this.abrController = new config.abrController(this);\n var bufferController = new config.bufferController(this);\n var capLevelController = new config.capLevelController(this);\n var fpsController = new config.fpsController(this);\n var playListLoader = new _playlistLoader2.default(this);\n var fragmentLoader = new _fragmentLoader2.default(this);\n var keyLoader = new _keyLoader2.default(this);\n var id3TrackController = new _id3TrackController2.default(this);\n\n // network controllers\n var levelController = this.levelController = new _levelController2.default(this);\n var streamController = this.streamController = new _streamController2.default(this);\n var networkControllers = [levelController, streamController];\n\n // optional audio stream controller\n var Controller = config.audioStreamController;\n if (Controller) {\n networkControllers.push(new Controller(this));\n }\n this.networkControllers = networkControllers;\n\n var coreComponents = [playListLoader, fragmentLoader, keyLoader, abrController, bufferController, capLevelController, fpsController, id3TrackController];\n\n // optional audio track and subtitle controller\n Controller = config.audioTrackController;\n if (Controller) {\n var audioTrackController = new Controller(this);\n this.audioTrackController = audioTrackController;\n coreComponents.push(audioTrackController);\n }\n\n Controller = config.subtitleTrackController;\n if (Controller) {\n var subtitleTrackController = new Controller(this);\n this.subtitleTrackController = subtitleTrackController;\n coreComponents.push(subtitleTrackController);\n }\n\n // optional subtitle controller\n [config.subtitleStreamController, config.timelineController].forEach(function (Controller) {\n if (Controller) {\n coreComponents.push(new Controller(_this));\n }\n });\n this.coreComponents = coreComponents;\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.coreComponents.concat(this.networkControllers).forEach(function (component) {\n component.destroy();\n });\n this.url = null;\n this.observer.removeAllListeners();\n this._autoLevelCapping = -1;\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 url = _urlToolkit2.default.buildAbsoluteURL(window.location.href, url, { alwaysNormalize: true });\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 ? arguments[0] : -1;\n\n _logger.logger.log('startLoad(' + startPosition + ')');\n this.networkControllers.forEach(function (controller) {\n controller.startLoad(startPosition);\n });\n }\n }, {\n key: 'stopLoad',\n value: function stopLoad() {\n _logger.logger.log('stopLoad');\n this.networkControllers.forEach(function (controller) {\n controller.stopLoad();\n });\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 Math.max(this.levelController.firstLevel, this.minAutoLevel);\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 var hls = this;\n // if not in automatic start level detection, ensure startLevel is greater than minAutoLevel\n if (newLevel !== -1) {\n newLevel = Math.max(newLevel, hls.minAutoLevel);\n }\n hls.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._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._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 /* return min level selectable in auto mode according to config.minAutoBitrate */\n\n }, {\n key: 'minAutoLevel',\n get: function get() {\n var hls = this,\n levels = hls.levels,\n minAutoBitrate = hls.config.minAutoBitrate,\n len = levels ? levels.length : 0;\n for (var i = 0; i < len; i++) {\n var levelNextBitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate, levels[i].bitrate) : levels[i].bitrate;\n if (levelNextBitrate > minAutoBitrate) {\n return i;\n }\n }\n return 0;\n }\n\n /* return max level selectable in auto mode according to autoLevelCapping */\n\n }, {\n key: 'maxAutoLevel',\n get: function get() {\n var hls = this;\n var levels = hls.levels;\n var autoLevelCapping = hls.autoLevelCapping;\n var maxAutoLevel = void 0;\n if (autoLevelCapping === -1 && levels && levels.length) {\n maxAutoLevel = levels.length - 1;\n } else {\n maxAutoLevel = autoLevelCapping;\n }\n return maxAutoLevel;\n }\n\n // return next auto level\n\n }, {\n key: 'nextAutoLevel',\n get: function get() {\n var hls = this;\n // ensure next auto level is between min and max auto level\n return Math.min(Math.max(hls.abrController.nextAutoLevel, hls.minAutoLevel), hls.maxAutoLevel);\n }\n\n // this setter is used to force next auto level\n // 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)\n // forced value is valid for one fragment. upon succesful frag loading at forced level, this value will be resetted to -1 by ABR controller\n ,\n set: function set(nextLevel) {\n var hls = this;\n hls.abrController.nextAutoLevel = Math.max(hls.minAutoLevel, nextLevel);\n }\n\n /** get alternate audio tracks list from playlist **/\n\n }, {\n key: 'audioTracks',\n get: function get() {\n var audioTrackController = this.audioTrackController;\n return audioTrackController ? 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 var audioTrackController = this.audioTrackController;\n return audioTrackController ? audioTrackController.audioTrack : -1;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n ,\n set: function set(audioTrackId) {\n var audioTrackController = this.audioTrackController;\n if (audioTrackController) {\n audioTrackController.audioTrack = audioTrackId;\n }\n }\n }, {\n key: 'liveSyncPosition',\n get: function get() {\n return this.streamController.liveSyncPosition;\n }\n\n /** get alternate subtitle tracks list from playlist **/\n\n }, {\n key: 'subtitleTracks',\n get: function get() {\n var subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTracks : [];\n }\n\n /** get index of the selected subtitle track (index in subtitle track lists) **/\n\n }, {\n key: 'subtitleTrack',\n get: function get() {\n var subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTrack : -1;\n }\n\n /** select an subtitle track, based on its index in subtitle track lists**/\n ,\n set: function set(subtitleTrackId) {\n var subtitleTrackController = this.subtitleTrackController;\n if (subtitleTrackController) {\n subtitleTrackController.subtitleTrack = subtitleTrackId;\n }\n }\n }]);\n\n return Hls;\n}();\n\nexports.default = Hls;\n\n},{\"1\":1,\"11\":11,\"12\":12,\"13\":13,\"2\":2,\"33\":33,\"35\":35,\"4\":4,\"41\":41,\"42\":42,\"43\":43,\"54\":54}],40:[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_(39).default;\n\n},{\"39\":39}],41:[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_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(33);\n\nvar _logger = _dereq_(54);\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, (FragmentLoader.__proto__ || 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 networkDetails = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\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, networkDetails: networkDetails });\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var networkDetails = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\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, networkDetails: networkDetails });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var networkDetails = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\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, networkDetails: networkDetails });\n }\n\n // data will be used for progressive parsing\n\n }, {\n key: 'loadprogress',\n value: function loadprogress(stats, context, data) {\n var networkDetails = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\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, networkDetails: networkDetails });\n }\n }]);\n\n return FragmentLoader;\n}(_eventHandler2.default);\n\nexports.default = FragmentLoader;\n\n},{\"33\":33,\"34\":34,\"35\":35,\"54\":54}],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\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(33);\n\nvar _logger = _dereq_(54);\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, (KeyLoader.__proto__ || 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 key 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[frag.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},{\"33\":33,\"34\":34,\"35\":35,\"54\":54}],43:[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 * Playlist Loader\n */\n\nvar _urlToolkit = _dereq_(2);\n\nvar _urlToolkit2 = _interopRequireDefault(_urlToolkit);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _eventHandler = _dereq_(34);\n\nvar _eventHandler2 = _interopRequireDefault(_eventHandler);\n\nvar _errors = _dereq_(33);\n\nvar _attrList = _dereq_(47);\n\nvar _attrList2 = _interopRequireDefault(_attrList);\n\nvar _logger = _dereq_(54);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// https://regex101.com is your friend\nvar MASTER_PLAYLIST_REGEX = /#EXT-X-STREAM-INF:([^\\n\\r]*)[\\r\\n]+([^\\r\\n]+)/g;\nvar MASTER_PLAYLIST_MEDIA_REGEX = /#EXT-X-MEDIA:(.*)/g;\n\nvar LEVEL_PLAYLIST_REGEX_FAST = new RegExp([/#EXTINF:(\\d*(?:\\.\\d+)?)(?:,(.*)\\s+)?/.source, // duration (#EXTINF:<duration>,<title>), group 1 => duration, group 2 => title\n/|(?!#)(\\S+)/.source, // segment URI, group 3 => the URI (note newline is not eaten)\n/|#EXT-X-BYTERANGE:*(.+)/.source, // next segment's byterange, group 4 => range spec (x@y)\n/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source, // next segment's program date/time group 5 => the datetime spec\n/|#.*/.source // All other non-segment oriented tags will match with all groups empty\n].join(''), 'g');\n\nvar 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?/;\n\nvar LevelKey = function () {\n function LevelKey() {\n _classCallCheck(this, LevelKey);\n\n this.method = null;\n this.key = null;\n this.iv = null;\n this._uri = null;\n }\n\n _createClass(LevelKey, [{\n key: 'uri',\n get: function get() {\n if (!this._uri && this.reluri) {\n this._uri = _urlToolkit2.default.buildAbsoluteURL(this.baseuri, this.reluri, { alwaysNormalize: true });\n }\n return this._uri;\n }\n }]);\n\n return LevelKey;\n}();\n\nvar Fragment = function () {\n function Fragment() {\n _classCallCheck(this, Fragment);\n\n this._url = null;\n this._byteRange = null;\n this._decryptdata = null;\n this.tagList = [];\n }\n\n _createClass(Fragment, [{\n key: 'createInitializationVector',\n\n\n /**\n * Utility method for parseLevelPlaylist to create an initialization vector for a given segment\n * @returns {Uint8Array}\n */\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 = new LevelKey();\n decryptdata.method = levelkey.method;\n decryptdata.baseuri = levelkey.baseuri;\n decryptdata.reluri = levelkey.reluri;\n decryptdata.iv = this.createInitializationVector(segmentNumber);\n }\n\n return decryptdata;\n }\n }, {\n key: 'cloneObj',\n value: function cloneObj(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n }, {\n key: 'url',\n get: function get() {\n if (!this._url && this.relurl) {\n this._url = _urlToolkit2.default.buildAbsoluteURL(this.baseurl, this.relurl, { alwaysNormalize: true });\n }\n return this._url;\n },\n set: function set(value) {\n this._url = value;\n }\n }, {\n key: 'programDateTime',\n get: function get() {\n if (!this._programDateTime && this.rawProgramDateTime) {\n this._programDateTime = new Date(Date.parse(this.rawProgramDateTime));\n }\n return this._programDateTime;\n }\n }, {\n key: 'byteRange',\n get: function get() {\n if (!this._byteRange) {\n var byteRange = this._byteRange = [];\n if (this.rawByteRange) {\n var params = this.rawByteRange.split('@', 2);\n if (params.length === 1) {\n var lastByteRangeEndOffset = this.lastByteRangeEndOffset;\n byteRange[0] = lastByteRangeEndOffset ? lastByteRangeEndOffset : 0;\n } else {\n byteRange[0] = parseInt(params[1]);\n }\n byteRange[1] = parseInt(params[0]) + byteRange[0];\n }\n }\n return this._byteRange;\n }\n }, {\n key: 'byteRangeStartOffset',\n get: function get() {\n return this.byteRange[0];\n }\n }, {\n key: 'byteRangeEndOffset',\n get: function get() {\n return this.byteRange[1];\n }\n }, {\n key: 'decryptdata',\n get: function get() {\n if (!this._decryptdata) {\n this._decryptdata = this.fragmentDecryptdataFromLevelkey(this.levelkey, this.sn);\n }\n return this._decryptdata;\n }\n }]);\n\n return Fragment;\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, (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));\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: 'onSubtitleTrackLoading',\n value: function onSubtitleTrackLoading(data) {\n this.load(data.url, { type: 'subtitleTrack', 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 ' + context.type + ' ' + (context.level || context.id));\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 _urlToolkit2.default.buildAbsoluteURL(baseUrl, url, { alwaysNormalize: true });\n }\n }, {\n key: 'parseMasterPlaylist',\n value: function parseMasterPlaylist(string, baseurl) {\n var levels = [],\n result = void 0;\n MASTER_PLAYLIST_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_REGEX.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 if (codec.indexOf('hvc1') !== -1) {\n level.videoCodec = 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 audioCodec = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n var result = void 0,\n medias = [],\n id = 0;\n MASTER_PLAYLIST_MEDIA_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_MEDIA_REGEX.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 if (audioCodec) {\n media.audioCodec = audioCodec;\n }\n media.id = id++;\n medias.push(media);\n }\n }\n return medias;\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: 'parseLevelPlaylist',\n value: function parseLevelPlaylist(string, baseurl, id, type) {\n var currentSN = 0,\n totalduration = 0,\n level = { type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0 },\n levelkey = new LevelKey(),\n cc = 0,\n prevFrag = null,\n frag = new Fragment(),\n result,\n i;\n\n LEVEL_PLAYLIST_REGEX_FAST.lastIndex = 0;\n\n while ((result = LEVEL_PLAYLIST_REGEX_FAST.exec(string)) !== null) {\n var duration = result[1];\n if (duration) {\n // INF\n frag.duration = parseFloat(duration);\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n var title = (' ' + result[2]).slice(1);\n frag.title = title ? title : null;\n frag.tagList.push(title ? ['INF', duration, title] : ['INF', duration]);\n } else if (result[3]) {\n // url\n if (!isNaN(frag.duration)) {\n var sn = currentSN++;\n frag.type = type;\n frag.start = totalduration;\n frag.levelkey = levelkey;\n frag.sn = sn;\n frag.level = id;\n frag.cc = cc;\n frag.baseurl = baseurl;\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.relurl = (' ' + result[3]).slice(1);\n\n level.fragments.push(frag);\n prevFrag = frag;\n totalduration += frag.duration;\n\n frag = new Fragment();\n }\n } else if (result[4]) {\n // X-BYTERANGE\n frag.rawByteRange = (' ' + result[4]).slice(1);\n if (prevFrag) {\n var lastByteRangeEndOffset = prevFrag.byteRangeEndOffset;\n if (lastByteRangeEndOffset) {\n frag.lastByteRangeEndOffset = lastByteRangeEndOffset;\n }\n }\n } else if (result[5]) {\n // PROGRAM-DATE-TIME\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.rawProgramDateTime = (' ' + result[5]).slice(1);\n frag.tagList.push(['PROGRAM-DATE-TIME', frag.rawProgramDateTime]);\n } else {\n result = result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);\n for (i = 1; i < result.length; i++) {\n if (result[i] !== undefined) {\n break;\n }\n }\n\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n var value1 = (' ' + result[i + 1]).slice(1);\n var value2 = (' ' + result[i + 2]).slice(1);\n\n switch (result[i]) {\n case '#':\n frag.tagList.push(value2 ? [value1, value2] : [value1]);\n break;\n case 'PLAYLIST-TYPE':\n level.type = value1.toUpperCase();\n break;\n case 'MEDIA-SEQUENCE':\n currentSN = level.startSN = parseInt(value1);\n break;\n case 'TARGETDURATION':\n level.targetduration = parseFloat(value1);\n break;\n case 'VERSION':\n level.version = parseInt(value1);\n break;\n case 'EXTM3U':\n break;\n case 'ENDLIST':\n level.live = false;\n break;\n case 'DIS':\n cc++;\n frag.tagList.push(['DIS']);\n break;\n case 'DISCONTINUITY-SEQ':\n cc = parseInt(value1);\n break;\n case 'KEY':\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4\n var decryptparams = value1;\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 = new LevelKey();\n if (decrypturi && ['AES-128', 'SAMPLE-AES'].indexOf(decryptmethod) >= 0) {\n levelkey.method = decryptmethod;\n // URI to get the key\n levelkey.baseuri = baseurl;\n levelkey.reluri = decrypturi;\n levelkey.key = null;\n // Initialization Vector (IV)\n levelkey.iv = decryptiv;\n }\n }\n break;\n case 'START':\n var startParams = value1;\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 'MAP':\n var mapAttrs = new _attrList2.default(value1);\n frag.relurl = mapAttrs.URI;\n frag.rawByteRange = mapAttrs.BYTERANGE;\n frag.baseurl = baseurl;\n frag.level = id;\n frag.type = type;\n frag.sn = 'initSegment';\n level.initSegment = frag;\n frag = new Fragment();\n break;\n default:\n _logger.logger.warn('line parsed but not handled: ' + result);\n break;\n }\n }\n }\n frag = prevFrag;\n //logger.log('found ' + level.fragments.length + ' fragments');\n if (frag && !frag.relurl) {\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 networkDetails = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\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' && type !== 'subtitleTrack',\n levelId = !isNaN(level) ? level : !isNaN(id) ? id : 0,\n levelDetails = this.parseLevelPlaylist(string, url, levelId, type === 'audioTrack' ? 'audio' : type === 'subtitleTrack' ? 'subtitle' : 'main');\n levelDetails.tload = stats.tload;\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, networkDetails: networkDetails });\n }\n stats.tparsed = performance.now();\n if (levelDetails.targetduration) {\n if (isLevel) {\n hls.trigger(_events2.default.LEVEL_LOADED, { details: levelDetails, level: level || 0, id: id || 0, stats: stats, networkDetails: networkDetails });\n } else {\n if (type === 'audioTrack') {\n hls.trigger(_events2.default.AUDIO_TRACK_LOADED, { details: levelDetails, id: id, stats: stats, networkDetails: networkDetails });\n } else if (type === 'subtitleTrack') {\n hls.trigger(_events2.default.SUBTITLE_TRACK_LOADED, { details: levelDetails, id: id, stats: stats, networkDetails: networkDetails });\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: 'invalid targetduration', networkDetails: networkDetails });\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', levels[0].audioCodec);\n var subtitles = this.parseMasterPlaylistMedia(string, url, 'SUBTITLES');\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, subtitles: subtitles, url: url, stats: stats, networkDetails: networkDetails });\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', networkDetails: networkDetails });\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', networkDetails: networkDetails });\n }\n }\n }, {\n key: 'loaderror',\n value: function loaderror(response, context) {\n var networkDetails = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\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, networkDetails: networkDetails });\n }\n }, {\n key: 'loadtimeout',\n value: function loadtimeout(stats, context) {\n var networkDetails = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\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, networkDetails: networkDetails });\n }\n }]);\n\n return PlaylistLoader;\n}(_eventHandler2.default);\n\nexports.default = PlaylistLoader;\n\n},{\"2\":2,\"33\":33,\"34\":34,\"35\":35,\"47\":47,\"54\":54}],44:[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 UINT32_MAX = Math.pow(2, 32) - 1;\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 '.mp3': [],\n mvex: [],\n mvhd: [],\n pasp: [],\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 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 var upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n var lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.mdhd, new Uint8Array([0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n 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)\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 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 upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n var lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n var bytes = new Uint8Array([0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n timescale >> 24 & 0xFF, timescale >> 16 & 0xFF, timescale >> 8 & 0xFF, timescale & 0xFF, // timescale\n 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\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 hSpacing = track.pixelRatio[0],\n vSpacing = track.pixelRatio[1];\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 MP4.box(MP4.types.pasp, new Uint8Array([hSpacing >> 24, // hSpacing\n hSpacing >> 16 & 0xFF, hSpacing >> 8 & 0xFF, hSpacing & 0xFF, vSpacing >> 24, // vSpacing\n vSpacing >> 16 & 0xFF, vSpacing >> 8 & 0xFF, vSpacing & 0xFF])));\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 samplerate = track.samplerate;\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 samplerate >> 8 & 0xFF, samplerate & 0xff, //\n 0x00, 0x00]), MP4.box(MP4.types.esds, MP4.esds(track)));\n }\n }, {\n key: 'mp3',\n value: function mp3(track) {\n var samplerate = track.samplerate;\n return MP4.box(MP4.types['.mp3'], 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 samplerate >> 8 & 0xFF, samplerate & 0xff, //\n 0x00, 0x00]));\n }\n }, {\n key: 'stsd',\n value: function stsd(track) {\n if (track.type === 'audio') {\n if (!track.isAAC && track.codec === 'mp3') {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));\n }\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 upperWordDuration = Math.floor(duration / (UINT32_MAX + 1)),\n lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.tkhd, new Uint8Array([0x01, // version 1\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n id >> 24 & 0xFF, id >> 16 & 0xFF, id >> 8 & 0xFF, id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n 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\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 upperWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime / (UINT32_MAX + 1)),\n lowerWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime % (UINT32_MAX + 1));\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])), MP4.box(MP4.types.tfdt, new Uint8Array([0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 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\n 20 + // 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},{}],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 * fMP4 remuxer\n */\n\nvar _aac = _dereq_(36);\n\nvar _aac2 = _interopRequireDefault(_aac);\n\nvar _events = _dereq_(35);\n\nvar _events2 = _interopRequireDefault(_events);\n\nvar _logger = _dereq_(54);\n\nvar _mp4Generator = _dereq_(44);\n\nvar _mp4Generator2 = _interopRequireDefault(_mp4Generator);\n\nvar _errors = _dereq_(33);\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\n// 10 seconds\nvar MAX_SILENT_FRAME_DURATION = 10 * 1000;\n\nvar MP4Remuxer = function () {\n function MP4Remuxer(observer, config, typeSupported, vendor) {\n _classCallCheck(this, MP4Remuxer);\n\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n var userAgent = navigator.userAgent;\n this.isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');\n this.ISGenerated = false;\n }\n\n _createClass(MP4Remuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'resetTimeStamp',\n value: function resetTimeStamp(defaultTimeStamp) {\n this._initPTS = this._initDTS = defaultTimeStamp;\n }\n }, {\n key: 'resetInitSegment',\n value: function resetInitSegment() {\n this.ISGenerated = false;\n }\n }, {\n key: 'remux',\n value: function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n // generate Init Segment if needed\n if (!this.ISGenerated) {\n this.generateIS(audioTrack, videoTrack, timeOffset);\n } else {\n if (accurateTimeOffset) {\n // check timestamp consistency. it there is more than 10s gap between expected PTS/DTS, recompute initPTS/DTS\n var refPTS = this._initPTS;\n var ptsNormalize = this._PTSNormalize;\n var timeScale = audioTrack.inputTimeScale || videoTrack.inputTimeScale;\n var initPTS = Infinity,\n initDTS = Infinity;\n var samples = audioTrack.samples;\n if (samples.length) {\n initPTS = initDTS = ptsNormalize(samples[0].pts - timeScale * timeOffset, refPTS);\n }\n samples = videoTrack.samples;\n if (samples.length) {\n var sample = samples[0];\n initPTS = Math.min(initPTS, ptsNormalize(sample.pts - timeScale * timeOffset, refPTS));\n initDTS = Math.min(initDTS, ptsNormalize(sample.dts - timeScale * timeOffset, refPTS));\n }\n if (initPTS !== Infinity) {\n var initPTSDelta = refPTS - initPTS;\n if (Math.abs(initPTSDelta) > 10 * timeScale) {\n _logger.logger.warn('timestamp inconsistency, ' + (initPTSDelta / timeScale).toFixed(3) + 's delta against expected value: missing discontinuity ? reset initPTS/initDTS');\n this._initPTS = initPTS;\n this._initDTS = initDTS;\n this.observer.trigger(_events2.default.INIT_PTS_FOUND, { initPTS: initPTS });\n }\n }\n }\n }\n\n if (this.ISGenerated) {\n // Purposefully remuxing audio before video, so that remuxVideo can use nextAudioPts, which is\n // calculated in remuxAudio.\n //logger.log('nb AAC samples:' + audioTrack.samples.length);\n if (audioTrack.samples.length) {\n // if initSegment was generated without video samples, regenerate it again\n if (!audioTrack.timescale) {\n _logger.logger.warn('regenerate InitSegment as audio detected');\n this.generateIS(audioTrack, videoTrack, timeOffset);\n }\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 // if initSegment was generated without video samples, regenerate it again\n if (!videoTrack.timescale) {\n _logger.logger.warn('regenerate InitSegment as video detected');\n this.generateIS(audioTrack, videoTrack, timeOffset);\n }\n this.remuxVideo(videoTrack, timeOffset, contiguous, audioTrackLength, accurateTimeOffset);\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, accurateTimeOffset);\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);\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 typeSupported = this.typeSupported,\n container = 'audio/mp4',\n tracks = {},\n data = { tracks: tracks },\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 // let's use audio sampling rate as MP4 time scale.\n // rationale is that there is a integer nb of audio frames per audio sample (1024 for AAC)\n // using audio sampling rate here helps having an integer MP4 frame duration\n // this avoids potential rounding issue and AV sync issue\n audioTrack.timescale = audioTrack.samplerate;\n _logger.logger.log('audio sampling rate : ' + audioTrack.samplerate);\n if (!audioTrack.isAAC) {\n if (typeSupported.mpeg) {\n // Chrome and Safari\n container = 'audio/mpeg';\n audioTrack.codec = '';\n } else if (typeSupported.mp3) {\n // Firefox\n audioTrack.codec = 'mp3';\n }\n }\n tracks.audio = {\n container: container,\n codec: audioTrack.codec,\n initSegment: !audioTrack.isAAC && typeSupported.mpeg ? new Uint8Array() : _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 - audioTrack.inputTimeScale * timeOffset;\n }\n }\n\n if (videoTrack.sps && videoTrack.pps && videoSamples.length) {\n // let's use input time scale as MP4 video timescale\n // we use input time scale straight away to avoid rounding issues on frame duration / cts computation\n var inputTimeScale = videoTrack.inputTimeScale;\n videoTrack.timescale = inputTimeScale;\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 - inputTimeScale * timeOffset);\n initDTS = Math.min(initDTS, videoSamples[0].dts - inputTimeScale * timeOffset);\n this.observer.trigger(_events2.default.INIT_PTS_FOUND, { initPTS: initPTS });\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, 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, accurateTimeOffset) {\n var offset = 8,\n timeScale = track.timescale,\n mp4SampleDuration,\n mdat,\n moof,\n firstPTS,\n firstDTS,\n nextDTS,\n lastPTS,\n lastDTS,\n inputSamples = track.samples,\n outputSamples = [],\n nbSamples = inputSamples.length,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS;\n\n // for (let i = 0; i < track.samples.length; i++) {\n // let avcSample = track.samples[i];\n // let units = avcSample.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 // if parsed fragment is contiguous with last one, let's use last DTS value as reference\n var nextAvcDts = this.nextAvcDts;\n\n var isSafari = this.isSafari;\n\n // Safari does not like overlapping DTS on consecutive fragments. let's use nextAvcDts to overcome this if fragments are consecutive\n if (isSafari) {\n // also consider consecutive fragments as being contiguous (even if a level switch occurs),\n // for sake of clarity:\n // consecutive fragments are frags with\n // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR\n // - less than 200 ms PTS gaps (timeScale/5)\n contiguous |= inputSamples.length && nextAvcDts && (accurateTimeOffset && Math.abs(timeOffset - nextAvcDts / timeScale) < 0.1 || Math.abs(inputSamples[0].pts - nextAvcDts - initDTS) < timeScale / 5);\n }\n\n if (!contiguous) {\n // if not contiguous, let's use target timeOffset\n nextAvcDts = timeOffset * timeScale;\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 inputSamples.forEach(function (sample) {\n sample.pts = ptsNormalize(sample.pts - initDTS, nextAvcDts);\n sample.dts = ptsNormalize(sample.dts - initDTS, nextAvcDts);\n });\n\n // sort video samples by DTS then PTS then demux id order\n inputSamples.sort(function (a, b) {\n var deltadts = a.dts - b.dts;\n var deltapts = a.pts - b.pts;\n return deltadts ? deltadts : deltapts ? deltapts : a.id - b.id;\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 // compute first DTS and last DTS, normalize them against reference value\n var sample = inputSamples[0];\n firstDTS = Math.max(sample.dts, 0);\n firstPTS = Math.max(sample.pts, 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;\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;\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(sample.dts, 0);\n lastPTS = Math.max(sample.pts, 0, lastDTS);\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) / (inputSamples.length - 1));\n }\n\n var nbNalu = 0,\n naluLen = 0;\n for (var _i = 0; _i < nbSamples; _i++) {\n // compute total/avc sample length and nb of NAL units\n var _sample = inputSamples[_i],\n units = _sample.units,\n nbUnits = units.length,\n sampleLen = 0;\n for (var j = 0; j < nbUnits; j++) {\n sampleLen += units[j].data.length;\n }\n naluLen += sampleLen;\n nbNalu += nbUnits;\n _sample.length = sampleLen;\n\n // normalize PTS/DTS\n if (isSafari) {\n // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples\n _sample.dts = firstDTS + _i * mp4SampleDuration;\n } else {\n // ensure sample monotonic DTS\n _sample.dts = Math.max(_sample.dts, firstDTS);\n }\n // ensure that computed value is greater or equal than sample DTS\n _sample.pts = Math.max(_sample.pts, _sample.dts);\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 var mdatSize = naluLen + 4 * nbNalu + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n 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 });\n return;\n }\n var view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n\n for (var _i2 = 0; _i2 < nbSamples; _i2++) {\n var avcSample = inputSamples[_i2],\n avcSampleUnits = avcSample.units,\n mp4SampleLength = 0,\n compositionTimeOffset = void 0;\n // convert NALU bitstream to MP4 format (prepend NALU with size field)\n for (var _j = 0, _nbUnits = avcSampleUnits.length; _j < _nbUnits; _j++) {\n var unit = avcSampleUnits[_j],\n unitData = unit.data,\n unitDataLen = unit.data.byteLength;\n view.setUint32(offset, unitDataLen);\n offset += 4;\n mdat.set(unitData, offset);\n offset += unitDataLen;\n mp4SampleLength += 4 + unitDataLen;\n }\n\n if (!isSafari) {\n // expected sample duration is the Decoding Timestamp diff of consecutive samples\n if (_i2 < nbSamples - 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) * timeScale),\n deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * timeScale : this.nextAudioPts) - 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 compositionTimeOffset = Math.round(avcSample.pts - avcSample.dts);\n } else {\n compositionTimeOffset = Math.max(0, mp4SampleDuration * Math.round((avcSample.pts - avcSample.dts) / mp4SampleDuration));\n }\n\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${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;\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, track);\n track.samples = [];\n\n var data = {\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / timeScale,\n endPTS: (lastPTS + mp4SampleDuration) / timeScale,\n startDTS: firstDTS / timeScale,\n endDTS: this.nextAvcDts / timeScale,\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 inputTimeScale = track.inputTimeScale,\n mp4timeScale = track.timescale,\n scaleFactor = inputTimeScale / mp4timeScale,\n mp4SampleDuration = track.isAAC ? 1024 : 1152,\n inputSampleDuration = mp4SampleDuration * scaleFactor,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS,\n rawMPEG = !track.isAAC && this.typeSupported.mpeg;\n\n var offset,\n mp4Sample,\n fillFrame,\n mdat,\n moof,\n firstPTS,\n lastPTS,\n inputSamples = track.samples,\n outputSamples = [],\n nextAudioPts = this.nextAudioPts;\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\n // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR\n // - less than 20 audio frames distance\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 contiguous |= inputSamples.length && nextAudioPts && (accurateTimeOffset && Math.abs(timeOffset - nextAudioPts / inputTimeScale) < 0.1 || Math.abs(inputSamples[0].pts - nextAudioPts - initDTS) < 20 * inputSampleDuration);\n\n if (!contiguous) {\n // if fragments are not contiguous, let's use timeOffset to compute next Audio PTS\n nextAudioPts = timeOffset * inputTimeScale;\n }\n\n // compute normalized PTS\n inputSamples.forEach(function (sample) {\n sample.pts = sample.dts = ptsNormalize(sample.pts - initDTS, nextAudioPts);\n });\n\n // sort based on normalized PTS (this is to avoid sorting issues in case timestamp\n // reloop in the middle of our samples array)\n inputSamples.sort(function (a, b) {\n return a.pts - b.pts;\n });\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\n // only inject/drop audio frames in case time offset is accurate\n if (accurateTimeOffset && track.isAAC) {\n for (var i = 0, nextPts = nextAudioPts; i < inputSamples.length;) {\n // First, let's see how far off this frame is from where we expect it to be\n var sample = inputSamples[i],\n delta;\n var pts = sample.pts;\n delta = pts - nextPts;\n\n var duration = Math.abs(1000 * delta / inputTimeScale);\n\n // If we're overlapping by more than a duration, drop this sample\n if (delta <= -inputSampleDuration) {\n _logger.logger.warn('Dropping 1 audio frame @ ' + (nextPts / inputTimeScale).toFixed(3) + 's due to ' + duration + ' ms overlap.');\n inputSamples.splice(i, 1);\n track.len -= sample.unit.length;\n // Don't touch nextPtsNorm or i\n }\n\n // Insert missing frames if:\n // 1: We're more than one frame away\n // 2: Not more than MAX_SILENT_FRAME_DURATION away\n // 3: currentTime (aka nextPtsNorm) is not 0\n else if (delta >= inputSampleDuration && duration < MAX_SILENT_FRAME_DURATION && nextPts) {\n var missing = Math.round(delta / inputSampleDuration);\n _logger.logger.warn('Injecting ' + missing + ' audio frame @ ' + (nextPts / inputTimeScale).toFixed(3) + 's due to ' + Math.round(1000 * delta / inputTimeScale) + ' ms gap.');\n for (var j = 0; j < missing; j++) {\n var newStamp = Math.max(nextPts, 0);\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, 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.subarray();\n }\n inputSamples.splice(i, 0, { unit: fillFrame, pts: newStamp, dts: newStamp });\n track.len += fillFrame.length;\n nextPts += inputSampleDuration;\n i++;\n }\n\n // Adjust sample to next expected pts\n sample.pts = sample.dts = nextPts;\n nextPts += inputSampleDuration;\n i++;\n } else {\n // Otherwise, just adjust pts\n if (Math.abs(delta) > 0.1 * inputSampleDuration) {\n //logger.log(`Invalid frame delta ${Math.round(delta + inputSampleDuration)} at PTS ${Math.round(pts / 90)} (should be ${Math.round(inputSampleDuration)}).`);\n }\n sample.pts = sample.dts = nextPts;\n nextPts += inputSampleDuration;\n i++;\n }\n }\n }\n\n for (var _j2 = 0, _nbSamples = inputSamples.length; _j2 < _nbSamples; _j2++) {\n var audioSample = inputSamples[_j2];\n var unit = audioSample.unit;\n var _pts = audioSample.pts;\n //logger.log(`Audio/PTS:${Math.round(pts/90)}`);\n // if not first sample\n if (lastPTS !== undefined) {\n mp4Sample.duration = Math.round((_pts - lastPTS) / scaleFactor);\n } else {\n var _delta = Math.round(1000 * (_pts - nextAudioPts) / inputTimeScale),\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 && track.isAAC) {\n // log delta\n if (_delta) {\n if (_delta > 0 && _delta < MAX_SILENT_FRAME_DURATION) {\n numMissingFrames = Math.round((_pts - nextAudioPts) / inputSampleDuration);\n _logger.logger.log(_delta + ' ms hole between AAC samples detected,filling it');\n if (numMissingFrames > 0) {\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, track.channelCount);\n if (!fillFrame) {\n fillFrame = unit.subarray();\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('drop overlapping AAC sample, expected/parsed/delta:' + (nextAudioPts / inputTimeScale).toFixed(3) + 's/' + (_pts / inputTimeScale).toFixed(3) + 's/' + -_delta + 'ms');\n track.len -= unit.byteLength;\n continue;\n }\n // set PTS/DTS to expected PTS/DTS\n _pts = nextAudioPts;\n }\n }\n // remember first PTS of our audioSamples, ensure value is positive\n firstPTS = Math.max(0, _pts);\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 var mdatSize = rawMPEG ? track.len : track.len + 8;\n offset = rawMPEG ? 0 : 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch (err) {\n 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 });\n return;\n }\n if (!rawMPEG) {\n var view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(_mp4Generator2.default.types.mdat, 4);\n }\n } else {\n // no audio samples\n return;\n }\n for (var _i3 = 0; _i3 < numMissingFrames; _i3++) {\n fillFrame = _aac2.default.getSilentFrame(track.manifestCodec || track.codec, 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.subarray();\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 outputSamples.push(mp4Sample);\n }\n }\n mdat.set(unit, offset);\n var unitLen = unit.byteLength;\n offset += unitLen;\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${audioSample.pts}/${audioSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(audioSample.pts/4294967296).toFixed(3)}');\n mp4Sample = {\n size: unitLen,\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 outputSamples.push(mp4Sample);\n lastPTS = _pts;\n }\n var lastSampleDuration = 0;\n var nbSamples = outputSamples.length;\n //set last sample duration as being identical to previous sample\n if (nbSamples >= 2) {\n lastSampleDuration = outputSamples[nbSamples - 2].duration;\n mp4Sample.duration = lastSampleDuration;\n }\n if (nbSamples) {\n // next audio sample PTS should be equal to last sample PTS + duration\n this.nextAudioPts = nextAudioPts = lastPTS + scaleFactor * lastSampleDuration;\n //logger.log('Audio/PTS/PTSend:' + audioSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));\n track.len = 0;\n track.samples = outputSamples;\n if (rawMPEG) {\n moof = new Uint8Array();\n } else {\n moof = _mp4Generator2.default.moof(track.sequenceNumber++, firstPTS / scaleFactor, track);\n }\n track.samples = [];\n var start = firstPTS / inputTimeScale;\n var end = nextAudioPts / inputTimeScale;\n var audioData = {\n data1: moof,\n data2: mdat,\n startPTS: start,\n endPTS: end,\n startDTS: start,\n endDTS: end,\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 inputTimeScale = track.inputTimeScale,\n mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale,\n scaleFactor = inputTimeScale / mp4timeScale,\n nextAudioPts = this.nextAudioPts,\n\n\n // sync with video's timestamp\n startDTS = (nextAudioPts !== undefined ? nextAudioPts : videoData.startDTS * inputTimeScale) + this._initDTS,\n endDTS = videoData.endDTS * inputTimeScale + this._initDTS,\n\n // one sample's duration value\n sampleDuration = 1024,\n frameDuration = scaleFactor * 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.manifestCodec || track.codec, track.channelCount);\n\n _logger.logger.warn('remux empty Audio');\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, 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 var inputTimeScale = track.inputTimeScale;\n var initPTS = this._initPTS;\n var initDTS = this._initDTS;\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 - initPTS) / inputTimeScale;\n sample.dts = (sample.dts - initDTS) / inputTimeScale;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_METADATA, {\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 var inputTimeScale = track.inputTimeScale;\n var initPTS = this._initPTS;\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 - initPTS) / inputTimeScale;\n }\n this.observer.trigger(_events2.default.FRAG_PARSING_USERDATA, {\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\n return MP4Remuxer;\n}();\n\nexports.default = MP4Remuxer;\n\n},{\"33\":33,\"35\":35,\"36\":36,\"44\":44,\"54\":54}],46:[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_(35);\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) {\n _classCallCheck(this, PassThroughRemuxer);\n\n this.observer = observer;\n }\n\n _createClass(PassThroughRemuxer, [{\n key: 'destroy',\n value: function destroy() {}\n }, {\n key: 'resetTimeStamp',\n value: function resetTimeStamp() {}\n }, {\n key: 'resetInitSegment',\n value: function resetInitSegment() {}\n }, {\n key: 'remux',\n value: function remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset, rawData) {\n var observer = this.observer;\n var streamType = '';\n if (audioTrack) {\n streamType += 'audio';\n }\n if (videoTrack) {\n streamType += 'video';\n }\n observer.trigger(_events2.default.FRAG_PARSING_DATA, {\n data1: rawData,\n startPTS: timeOffset,\n startDTS: timeOffset,\n type: streamType,\n nb: 1,\n dropped: 0\n });\n //notify end of parsing\n observer.trigger(_events2.default.FRAG_PARSED);\n }\n }]);\n\n return PassThroughRemuxer;\n}();\n\nexports.default = PassThroughRemuxer;\n\n},{\"35\":35}],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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DECIMAL_RESOLUTION_REGEX = /^(\\d+)x(\\d+)$/;\nvar ATTR_LIST_REGEX = /\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g;\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 = DECIMAL_RESOLUTION_REGEX.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 match,\n attrs = {};\n ATTR_LIST_REGEX.lastIndex = 0;\n while ((match = ATTR_LIST_REGEX.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},{}],48:[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},{}],49:[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 = 100;\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\n //Make sure this only affects Roll-up Captions by checking this.nrRollUpRows\n if (this.nrRollUpRows && this.currRow !== newRow) {\n //clear all rows first\n for (var i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n\n //Copy this.nrRollUpRows rows from lastOutputScreen and place it in the newRow location\n //topRowIndex - the start of rows to copy (inclusive index)\n var topRowIndex = this.currRow + 1 - this.nrRollUpRows;\n //We only copy if the last position was already shown.\n //We use the cueStartTime value to check this.\n var lastOutputScreen = this.lastOutputScreen;\n if (lastOutputScreen) {\n var prevLineTime = lastOutputScreen.rows[topRowIndex].cueStartTime;\n if (prevLineTime && prevLineTime < logger.time) {\n for (var _i = 0; _i < this.nrRollUpRows; _i++) {\n this.rows[newRow - this.nrRollUpRows + _i + 1].copy(lastOutputScreen.rows[topRowIndex + _i]);\n }\n }\n }\n }\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},{}],50:[function(_dereq_,module,exports){\n'use strict';\n\nvar _vttparser = _dereq_(57);\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 //To be used for cleaning-up orphaned roll-up captions\n row.cueStartTime = startTime;\n\n // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE\n if (startTime === endTime) {\n endTime += 0.0001;\n }\n\n cue = new VTTCue(startTime, endTime, (0, _vttparser.fixLineBreaks)(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 // Clamp the position between 0 and 100 - if out of these bounds, Firefox throws an exception and captions break\n cue.position = Math.max(0, Math.min(100, 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\\//) ? 50 : 0)));\n track.addCue(cue);\n }\n }\n }\n\n};\n\nmodule.exports = Cues;\n\n},{\"57\":57}],51:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.findFragWithCC = findFragWithCC;\n\nvar _binarySearch = _dereq_(48);\n\nvar _binarySearch2 = _interopRequireDefault(_binarySearch);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction findFragWithCC(fragments, CC) {\n return _binarySearch2.default.search(fragments, function (candidate) {\n if (candidate.cc < CC) {\n return 1;\n } else if (candidate.cc > CC) {\n return -1;\n } else {\n return 0;\n }\n });\n}\n\n},{\"48\":48}],52:[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_(53);\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},{\"53\":53}],53:[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 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},{}],54:[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 && obj !== Symbol.prototype ? \"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},{}],55:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * TimeRanges to string helper\n */\n\nvar TimeRanges = {\n toString: 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\nmodule.exports = TimeRanges;\n\n},{}],56:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\n/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexports.default = function () {\n if (typeof window !== 'undefined' && window.VTTCue) {\n return window.VTTCue;\n }\n\n var autoKeyword = 'auto';\n var directionSetting = {\n '': true,\n lr: true,\n rl: true\n };\n var alignSetting = {\n start: true,\n middle: true,\n end: true,\n left: true,\n right: true\n };\n\n function findDirectionSetting(value) {\n if (typeof value !== 'string') {\n return false;\n }\n var dir = directionSetting[value.toLowerCase()];\n return dir ? value.toLowerCase() : false;\n }\n\n function findAlignSetting(value) {\n if (typeof value !== 'string') {\n return false;\n }\n var align = alignSetting[value.toLowerCase()];\n return align ? value.toLowerCase() : false;\n }\n\n function extend(obj) {\n var i = 1;\n for (; i < arguments.length; i++) {\n var cobj = arguments[i];\n for (var p in cobj) {\n obj[p] = cobj[p];\n }\n }\n\n return obj;\n }\n\n function VTTCue(startTime, endTime, text) {\n var cue = this;\n var isIE8 = function () {\n if (typeof navigator === 'undefined') {\n return;\n }\n return (/MSIE\\s8\\.0/.test(navigator.userAgent)\n );\n }();\n var baseObj = {};\n\n if (isIE8) {\n cue = document.createElement('custom');\n } else {\n baseObj.enumerable = true;\n }\n\n /**\n * Shim implementation specific properties. These properties are not in\n * the spec.\n */\n\n // Lets us know when the VTTCue's data has changed in such a way that we need\n // to recompute its display state. This lets us compute its display state\n // lazily.\n cue.hasBeenReset = false;\n\n /**\n * VTTCue and TextTrackCue properties\n * http://dev.w3.org/html5/webvtt/#vttcue-interface\n */\n\n var _id = '';\n var _pauseOnExit = false;\n var _startTime = startTime;\n var _endTime = endTime;\n var _text = text;\n var _region = null;\n var _vertical = '';\n var _snapToLines = true;\n var _line = 'auto';\n var _lineAlign = 'start';\n var _position = 50;\n var _positionAlign = 'middle';\n var _size = 50;\n var _align = 'middle';\n\n Object.defineProperty(cue, 'id', extend({}, baseObj, {\n get: function get() {\n return _id;\n },\n set: function set(value) {\n _id = '' + value;\n }\n }));\n\n Object.defineProperty(cue, 'pauseOnExit', extend({}, baseObj, {\n get: function get() {\n return _pauseOnExit;\n },\n set: function set(value) {\n _pauseOnExit = !!value;\n }\n }));\n\n Object.defineProperty(cue, 'startTime', extend({}, baseObj, {\n get: function get() {\n return _startTime;\n },\n set: function set(value) {\n if (typeof value !== 'number') {\n throw new TypeError('Start time must be set to a number.');\n }\n _startTime = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'endTime', extend({}, baseObj, {\n get: function get() {\n return _endTime;\n },\n set: function set(value) {\n if (typeof value !== 'number') {\n throw new TypeError('End time must be set to a number.');\n }\n _endTime = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'text', extend({}, baseObj, {\n get: function get() {\n return _text;\n },\n set: function set(value) {\n _text = '' + value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'region', extend({}, baseObj, {\n get: function get() {\n return _region;\n },\n set: function set(value) {\n _region = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'vertical', extend({}, baseObj, {\n get: function get() {\n return _vertical;\n },\n set: function set(value) {\n var setting = findDirectionSetting(value);\n // Have to check for false because the setting an be an empty string.\n if (setting === false) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _vertical = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'snapToLines', extend({}, baseObj, {\n get: function get() {\n return _snapToLines;\n },\n set: function set(value) {\n _snapToLines = !!value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'line', extend({}, baseObj, {\n get: function get() {\n return _line;\n },\n set: function set(value) {\n if (typeof value !== 'number' && value !== autoKeyword) {\n throw new SyntaxError('An invalid number or illegal string was specified.');\n }\n _line = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'lineAlign', extend({}, baseObj, {\n get: function get() {\n return _lineAlign;\n },\n set: function set(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _lineAlign = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'position', extend({}, baseObj, {\n get: function get() {\n return _position;\n },\n set: function set(value) {\n if (value < 0 || value > 100) {\n throw new Error('Position must be between 0 and 100.');\n }\n _position = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'positionAlign', extend({}, baseObj, {\n get: function get() {\n return _positionAlign;\n },\n set: function set(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _positionAlign = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'size', extend({}, baseObj, {\n get: function get() {\n return _size;\n },\n set: function set(value) {\n if (value < 0 || value > 100) {\n throw new Error('Size must be between 0 and 100.');\n }\n _size = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'align', extend({}, baseObj, {\n get: function get() {\n return _align;\n },\n set: function set(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _align = setting;\n this.hasBeenReset = true;\n }\n }));\n\n /**\n * Other <track> spec defined properties\n */\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state\n cue.displayState = undefined;\n\n if (isIE8) {\n return cue;\n }\n }\n\n /**\n * VTTCue methods\n */\n\n VTTCue.prototype.getCueAsHTML = function () {\n // Assume WebVTT.convertCueToDOMTree is on the global.\n var WebVTT = window.WebVTT;\n return WebVTT.convertCueToDOMTree(window, this.text);\n };\n\n return VTTCue;\n}();\n\n},{}],57:[function(_dereq_,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.fixLineBreaks = undefined;\n\nvar _vttcue = _dereq_(56);\n\nvar _vttcue2 = _interopRequireDefault(_vttcue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar StringDecoder = function StringDecoder() {\n return {\n decode: function decode(data) {\n if (!data) {\n return '';\n }\n if (typeof data !== 'string') {\n throw new Error('Error - expected string data.');\n }\n return decodeURIComponent(encodeURIComponent(data));\n }\n };\n}; /*\n * Source: https://github.com/mozilla/vtt.js/blob/master/dist/vtt.js#L1716\n */\n\nfunction VTTParser() {\n this.window = window;\n this.state = 'INITIAL';\n this.buffer = '';\n this.decoder = new StringDecoder();\n this.regionList = [];\n}\n\n// Try to parse input as a time stamp.\nfunction parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(':', ''), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}\n\n// A settings object holds key/value pairs and will ignore anything but the first\n// assignment to a specific key.\nfunction Settings() {\n this.values = Object.create(null);\n}\n\nSettings.prototype = {\n // Only accept the first assignment to any key.\n set: function set(k, v) {\n if (!this.get(k) && v !== '') {\n this.values[k] = v;\n }\n },\n // Return the value for a key, or a default value.\n // If 'defaultKey' is passed then 'dflt' is assumed to be an object with\n // a number of possible default values as properties where 'defaultKey' is\n // the key of the property that will be chosen; otherwise it's assumed to be\n // a single value.\n get: function get(k, dflt, defaultKey) {\n if (defaultKey) {\n return this.has(k) ? this.values[k] : dflt[defaultKey];\n }\n return this.has(k) ? this.values[k] : dflt;\n },\n // Check whether we have a value for a key.\n has: function has(k) {\n return k in this.values;\n },\n // Accept a setting if its one of the given alternatives.\n alt: function alt(k, v, a) {\n for (var n = 0; n < a.length; ++n) {\n if (v === a[n]) {\n this.set(k, v);\n break;\n }\n }\n },\n // Accept a setting if its a valid (signed) integer.\n integer: function integer(k, v) {\n if (/^-?\\d+$/.test(v)) {\n // integer\n this.set(k, parseInt(v, 10));\n }\n },\n // Accept a setting if its a valid percentage.\n percent: function percent(k, v) {\n var m;\n if (m = v.match(/^([\\d]{1,3})(\\.[\\d]*)?%$/)) {\n v = parseFloat(v);\n if (v >= 0 && v <= 100) {\n this.set(k, v);\n return true;\n }\n }\n return false;\n }\n};\n\n// Helper function to parse input into groups separated by 'groupDelim', and\n// interprete each group as a key/value pair separated by 'keyValueDelim'.\nfunction parseOptions(input, callback, keyValueDelim, groupDelim) {\n var groups = groupDelim ? input.split(groupDelim) : [input];\n for (var i in groups) {\n if (typeof groups[i] !== 'string') {\n continue;\n }\n var kv = groups[i].split(keyValueDelim);\n if (kv.length !== 2) {\n continue;\n }\n var k = kv[0];\n var v = kv[1];\n callback(k, v);\n }\n}\n\nvar defaults = new _vttcue2.default(0, 0, 0);\n// 'middle' was changed to 'center' in the spec: https://github.com/w3c/webvtt/pull/244\n// Chrome and Safari don't yet support this change, but FF does\nvar center = defaults.align === 'middle' ? 'middle' : 'center';\n\nfunction parseCue(input, cue, regionList) {\n // Remember the original input if we need to throw an error.\n var oInput = input;\n // 4.1 WebVTT timestamp\n function consumeTimeStamp() {\n var ts = parseTimeStamp(input);\n if (ts === null) {\n throw new Error('Malformed timestamp: ' + oInput);\n }\n // Remove time stamp from input.\n input = input.replace(/^[^\\sa-zA-Z-]+/, '');\n return ts;\n }\n\n // 4.4.2 WebVTT cue settings\n function consumeCueSettings(input, cue) {\n var settings = new Settings();\n\n parseOptions(input, function (k, v) {\n switch (k) {\n case 'region':\n // Find the last region we parsed with the same region id.\n for (var i = regionList.length - 1; i >= 0; i--) {\n if (regionList[i].id === v) {\n settings.set(k, regionList[i].region);\n break;\n }\n }\n break;\n case 'vertical':\n settings.alt(k, v, ['rl', 'lr']);\n break;\n case 'line':\n var vals = v.split(','),\n vals0 = vals[0];\n settings.integer(k, vals0);\n if (settings.percent(k, vals0)) {\n settings.set('snapToLines', false);\n }\n settings.alt(k, vals0, ['auto']);\n if (vals.length === 2) {\n settings.alt('lineAlign', vals[1], ['start', center, 'end']);\n }\n break;\n case 'position':\n vals = v.split(',');\n settings.percent(k, vals[0]);\n if (vals.length === 2) {\n settings.alt('positionAlign', vals[1], ['start', center, 'end', 'line-left', 'line-right', 'auto']);\n }\n break;\n case 'size':\n settings.percent(k, v);\n break;\n case 'align':\n settings.alt(k, v, ['start', center, 'end', 'left', 'right']);\n break;\n }\n }, /:/, /\\s/);\n\n // Apply default values for any missing fields.\n cue.region = settings.get('region', null);\n cue.vertical = settings.get('vertical', '');\n var line = settings.get('line', 'auto');\n if (line === 'auto' && defaults.line === -1) {\n // set numeric line number for Safari\n line = -1;\n }\n cue.line = line;\n cue.lineAlign = settings.get('lineAlign', 'start');\n cue.snapToLines = settings.get('snapToLines', true);\n cue.size = settings.get('size', 100);\n cue.align = settings.get('align', center);\n var position = settings.get('position', 'auto');\n if (position === 'auto' && defaults.position === 50) {\n // set numeric position for Safari\n position = cue.align === 'start' || cue.align === 'left' ? 0 : cue.align === 'end' || cue.align === 'right' ? 100 : 50;\n }\n cue.position = position;\n }\n\n function skipWhitespace() {\n input = input.replace(/^\\s+/, '');\n }\n\n // 4.1 WebVTT cue timings.\n skipWhitespace();\n cue.startTime = consumeTimeStamp(); // (1) collect cue start time\n skipWhitespace();\n if (input.substr(0, 3) !== '-->') {\n // (3) next characters must match '-->'\n throw new Error('Malformed time stamp (time stamps must be separated by \\'-->\\'): ' + oInput);\n }\n input = input.substr(3);\n skipWhitespace();\n cue.endTime = consumeTimeStamp(); // (5) collect cue end time\n\n // 4.1 WebVTT cue settings list.\n skipWhitespace();\n consumeCueSettings(input, cue);\n}\n\nfunction fixLineBreaks(input) {\n return input.replace(/<br(?: \\/)?>/gi, '\\n');\n}\n\nVTTParser.prototype = {\n parse: function parse(data) {\n var self = this;\n\n // If there is no data then we won't decode it, but will just try to parse\n // whatever is in buffer already. This may occur in circumstances, for\n // example when flush() is called.\n if (data) {\n // Try to decode the data that we received.\n self.buffer += self.decoder.decode(data, { stream: true });\n }\n\n function collectNextLine() {\n var buffer = self.buffer;\n var pos = 0;\n\n buffer = fixLineBreaks(buffer);\n\n while (pos < buffer.length && buffer[pos] !== '\\r' && buffer[pos] !== '\\n') {\n ++pos;\n }\n var line = buffer.substr(0, pos);\n // Advance the buffer early in case we fail below.\n if (buffer[pos] === '\\r') {\n ++pos;\n }\n if (buffer[pos] === '\\n') {\n ++pos;\n }\n self.buffer = buffer.substr(pos);\n return line;\n }\n\n // 3.2 WebVTT metadata header syntax\n function parseHeader(input) {\n parseOptions(input, function (k, v) {\n switch (k) {\n case 'Region':\n // 3.3 WebVTT region metadata header syntax\n console.log('parse region', v);\n //parseRegion(v);\n break;\n }\n }, /:/);\n }\n\n // 5.1 WebVTT file parsing.\n try {\n var line;\n if (self.state === 'INITIAL') {\n // We can't start parsing until we have the first line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n line = collectNextLine();\n\n var m = line.match(/^WEBVTT([ \\t].*)?$/);\n if (!m || !m[0]) {\n throw new Error('Malformed WebVTT signature.');\n }\n\n self.state = 'HEADER';\n }\n\n var alreadyCollectedLine = false;\n while (self.buffer) {\n // We can't parse a line until we have the full line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n if (!alreadyCollectedLine) {\n line = collectNextLine();\n } else {\n alreadyCollectedLine = false;\n }\n\n switch (self.state) {\n case 'HEADER':\n // 13-18 - Allow a header (metadata) under the WEBVTT line.\n if (/:/.test(line)) {\n parseHeader(line);\n } else if (!line) {\n // An empty line terminates the header and starts the body (cues).\n self.state = 'ID';\n }\n continue;\n case 'NOTE':\n // Ignore NOTE blocks.\n if (!line) {\n self.state = 'ID';\n }\n continue;\n case 'ID':\n // Check for the start of NOTE blocks.\n if (/^NOTE($|[ \\t])/.test(line)) {\n self.state = 'NOTE';\n break;\n }\n // 19-29 - Allow any number of line terminators, then initialize new cue values.\n if (!line) {\n continue;\n }\n self.cue = new _vttcue2.default(0, 0, '');\n self.state = 'CUE';\n // 30-39 - Check if self line contains an optional identifier or timing data.\n if (line.indexOf('-->') === -1) {\n self.cue.id = line;\n continue;\n }\n // Process line as start of a cue.\n /*falls through*/\n case 'CUE':\n // 40 - Collect cue timings and settings.\n try {\n parseCue(line, self.cue, self.regionList);\n } catch (e) {\n // In case of an error ignore rest of the cue.\n self.cue = null;\n self.state = 'BADCUE';\n continue;\n }\n self.state = 'CUETEXT';\n continue;\n case 'CUETEXT':\n var hasSubstring = line.indexOf('-->') !== -1;\n // 34 - If we have an empty line then report the cue.\n // 35 - If we have the special substring '-->' then report the cue,\n // but do not collect the line as we need to process the current\n // one as a new cue.\n if (!line || hasSubstring && (alreadyCollectedLine = true)) {\n // We are done parsing self cue.\n if (self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n self.state = 'ID';\n continue;\n }\n if (self.cue.text) {\n self.cue.text += '\\n';\n }\n self.cue.text += line;\n continue;\n case 'BADCUE':\n // BADCUE\n // 54-62 - Collect and discard the remaining cue.\n if (!line) {\n self.state = 'ID';\n }\n continue;\n }\n }\n } catch (e) {\n\n // If we are currently parsing a cue, report what we have.\n if (self.state === 'CUETEXT' && self.cue && self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n // Enter BADWEBVTT state if header was not parsed correctly otherwise\n // another exception occurred so enter BADCUE state.\n self.state = self.state === 'INITIAL' ? 'BADWEBVTT' : 'BADCUE';\n }\n return this;\n },\n flush: function flush() {\n var self = this;\n try {\n // Finish decoding the stream.\n self.buffer += self.decoder.decode();\n // Synthesize the end of the current cue or region.\n if (self.cue || self.state === 'HEADER') {\n self.buffer += '\\n\\n';\n self.parse();\n }\n // If we've flushed, parsed, and we're still on the INITIAL state then\n // that means we don't have enough of the stream to parse the first\n // line.\n if (self.state === 'INITIAL') {\n throw new Error('Malformed WebVTT signature.');\n }\n } catch (e) {\n throw e;\n }\n if (self.onflush) {\n self.onflush();\n }\n return this;\n }\n};\n\nexports.fixLineBreaks = fixLineBreaks;\nexports.default = VTTParser;\n\n},{\"56\":56}],58:[function(_dereq_,module,exports){\n'use strict';\n\nvar _vttparser = _dereq_(57);\n\nvar _vttparser2 = _interopRequireDefault(_vttparser);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// String.prototype.startsWith is not supported in IE11\nvar startsWith = function startsWith(inputString, searchString, position) {\n return inputString.substr(position || 0, searchString.length) === searchString;\n};\n\nvar cueString2millis = function cueString2millis(timeString) {\n var ts = parseInt(timeString.substr(-3));\n var secs = parseInt(timeString.substr(-6, 2));\n var mins = parseInt(timeString.substr(-9, 2));\n var hours = timeString.length > 9 ? parseInt(timeString.substr(0, timeString.indexOf(':'))) : 0;\n\n if (isNaN(ts) || isNaN(secs) || isNaN(mins) || isNaN(hours)) {\n return -1;\n }\n\n ts += 1000 * secs;\n ts += 60 * 1000 * mins;\n ts += 60 * 60 * 1000 * hours;\n\n return ts;\n};\n\n// From https://github.com/darkskyapp/string-hash\nvar hash = function hash(text) {\n var hash = 5381;\n var i = text.length;\n while (i) {\n hash = hash * 33 ^ text.charCodeAt(--i);\n }\n return (hash >>> 0).toString();\n};\n\nvar calculateOffset = function calculateOffset(vttCCs, cc, presentationTime) {\n var currCC = vttCCs[cc];\n var prevCC = vttCCs[currCC.prevCC];\n\n // This is the first discontinuity or cues have been processed since the last discontinuity\n // Offset = current discontinuity time\n if (!prevCC || !prevCC.new && currCC.new) {\n vttCCs.ccOffset = vttCCs.presentationOffset = currCC.start;\n currCC.new = false;\n return;\n }\n\n // There have been discontinuities since cues were last parsed.\n // Offset = time elapsed\n while (prevCC && prevCC.new) {\n vttCCs.ccOffset += currCC.start - prevCC.start;\n currCC.new = false;\n currCC = prevCC;\n prevCC = vttCCs[currCC.prevCC];\n }\n\n vttCCs.presentationOffset = presentationTime;\n};\n\nvar WebVTTParser = {\n parse: function parse(vttByteArray, syncPTS, vttCCs, cc, callBack, errorCallBack) {\n // Convert byteArray into string, replacing any somewhat exotic linefeeds with \"\\n\", then split on that character.\n var re = /\\r\\n|\\n\\r|\\n|\\r/g;\n var vttLines = String.fromCharCode.apply(null, new Uint8Array(vttByteArray)).trim().replace(re, '\\n').split('\\n');\n var cueTime = '00:00.000';\n var mpegTs = 0;\n var localTime = 0;\n var presentationTime = 0;\n var cues = [];\n var parsingError = void 0;\n var inHeader = true;\n // let VTTCue = VTTCue || window.TextTrackCue;\n\n // Create parser object using VTTCue with TextTrackCue fallback on certain browsers.\n var parser = new _vttparser2.default();\n\n parser.oncue = function (cue) {\n // Adjust cue timing; clamp cues to start no earlier than - and drop cues that don't end after - 0 on timeline.\n var currCC = vttCCs[cc];\n var cueOffset = vttCCs.ccOffset;\n\n // Update offsets for new discontinuities\n if (currCC && currCC.new) {\n if (localTime !== undefined) {\n // When local time is provided, offset = discontinuity start time - local time\n cueOffset = vttCCs.ccOffset = currCC.start;\n } else {\n calculateOffset(vttCCs, cc, presentationTime);\n }\n }\n\n if (presentationTime) {\n // If we have MPEGTS, offset = presentation time + discontinuity offset\n cueOffset = presentationTime + vttCCs.ccOffset - vttCCs.presentationOffset;\n }\n\n cue.startTime += cueOffset - localTime;\n cue.endTime += cueOffset - localTime;\n\n // Create a unique hash id for a cue based on start/end times and text.\n // This helps timeline-controller to avoid showing repeated captions.\n cue.id = hash(cue.startTime) + hash(cue.endTime) + hash(cue.text);\n\n // Fix encoding of special characters. TODO: Test with all sorts of weird characters.\n cue.text = decodeURIComponent(escape(cue.text));\n if (cue.endTime > 0) {\n cues.push(cue);\n }\n };\n\n parser.onparsingerror = function (e) {\n parsingError = e;\n };\n\n parser.onflush = function () {\n if (parsingError && errorCallBack) {\n errorCallBack(parsingError);\n return;\n }\n callBack(cues);\n };\n\n // Go through contents line by line.\n vttLines.forEach(function (line) {\n if (inHeader) {\n // Look for X-TIMESTAMP-MAP in header.\n if (startsWith(line, 'X-TIMESTAMP-MAP=')) {\n // Once found, no more are allowed anyway, so stop searching.\n inHeader = false;\n // Extract LOCAL and MPEGTS.\n line.substr(16).split(',').forEach(function (timestamp) {\n if (startsWith(timestamp, 'LOCAL:')) {\n cueTime = timestamp.substr(6);\n } else if (startsWith(timestamp, 'MPEGTS:')) {\n mpegTs = parseInt(timestamp.substr(7));\n }\n });\n try {\n // Calculate subtitle offset in milliseconds.\n // If sync PTS is less than zero, we have a 33-bit wraparound, which is fixed by adding 2^33 = 8589934592.\n syncPTS = syncPTS < 0 ? syncPTS + 8589934592 : syncPTS;\n // Adjust MPEGTS by sync PTS.\n mpegTs -= syncPTS;\n // Convert cue time to seconds\n localTime = cueString2millis(cueTime) / 1000;\n // Convert MPEGTS to seconds from 90kHz.\n presentationTime = mpegTs / 90000;\n\n if (localTime === -1) {\n parsingError = new Error('Malformed X-TIMESTAMP-MAP: ' + line);\n }\n } catch (e) {\n parsingError = new Error('Malformed X-TIMESTAMP-MAP: ' + line);\n }\n // Return without parsing X-TIMESTAMP-MAP line.\n return;\n } else if (line === '') {\n inHeader = false;\n }\n }\n // Parse line by default.\n parser.parse(line + '\\n');\n });\n\n parser.flush();\n }\n};\n\nmodule.exports = WebVTTParser;\n\n},{\"57\":57}],59:[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_(54);\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 var stats = this.stats;\n stats.tfirst = 0;\n stats.loaded = 0;\n var xhrSetup = this.xhrSetup;\n\n try {\n if (xhrSetup) {\n try {\n xhrSetup(xhr, context.url);\n } catch (e) {\n // fix xhrSetup: (xhr, url) => {xhr.setRequestHeader(\"Content-Language\", \"test\");}\n // not working, as xhr.setRequestHeader expects xhr.readyState === OPEN\n xhr.open('GET', context.url, true);\n xhrSetup(xhr, context.url);\n }\n }\n if (!xhr.readyState) {\n xhr.open('GET', context.url, true);\n }\n } catch (e) {\n // IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS\n this.callbacks.onError({ code: xhr.status, text: e.message }, context, xhr);\n return;\n }\n\n if (context.rangeEnd) {\n xhr.setRequestHeader('Range', 'bytes=' + context.rangeStart + '-' + (context.rangeEnd - 1));\n }\n xhr.onreadystatechange = this.readystatechange.bind(this);\n xhr.onprogress = this.loadprogress.bind(this);\n xhr.responseType = context.responseType;\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 // >= HEADERS_RECEIVED\n if (readyState >= 2) {\n // clear xhr timeout and rearm it if readyState less than 4\n window.clearTimeout(this.requestTimeout);\n if (stats.tfirst === 0) {\n stats.tfirst = Math.max(performance.now(), 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, xhr);\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, xhr);\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 } else {\n // readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout);\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, null);\n }\n }, {\n key: 'loadprogress',\n value: function loadprogress(event) {\n var xhr = event.currentTarget,\n stats = this.stats;\n\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 // third arg is to provide on progress data\n onProgress(stats, this.context, null, xhr);\n }\n }\n }]);\n\n return XhrLoader;\n}();\n\nexports.default = XhrLoader;\n\n},{\"54\":54}]},{},[40])(40)\n});\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(12), __webpack_require__(0));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"shaka-player\", \"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsDash\"] = factory(require(\"shaka-player\"), require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsDash\"] = factory(root[\"shaka\"], root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {\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/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _get = function get(object, property, receiver) { 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 { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\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 _shakaPlayer = __webpack_require__(1);\n\nvar _shakaPlayer2 = _interopRequireDefault(_shakaPlayer);\n\nvar _playkitJs = __webpack_require__(2);\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\n/**\n * Adapter of shaka lib for dash content\n * @classdesc\n */\nvar DashAdapter = function (_BaseMediaSourceAdapt) {\n _inherits(DashAdapter, _BaseMediaSourceAdapt);\n\n _createClass(DashAdapter, null, [{\n key: 'canPlayType',\n\n\n /**\n * Checks if dash adapter can play a given mime type\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @returns {boolean} - Whether the dash adapter can play a specific mime type\n * @static\n */\n\n /**\n * The shaka player instance\n * @member {any} _shaka\n * @private\n */\n\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n\n /**\n * The adapter logger\n * @member {any} _logger\n * @private\n * @static\n */\n value: function canPlayType(mimeType) {\n var canPlayType = typeof mimeType === 'string' ? mimeType.toLowerCase() === DashAdapter._dashMimeType : false;\n DashAdapter._logger.debug('canPlayType result for mimeType: ' + mimeType + ' is ' + canPlayType.toString());\n return canPlayType;\n }\n\n /**\n * Checks if the dash adapter is supported\n * @function isSupported\n * @returns {boolean} - Whether dash is supported.\n * @static\n */\n\n /**\n * The supported mime type by the dash adapter\n * @member {string} _dashMimeType\n * @static\n * @private\n */\n\n /**\n * The id of Adapter\n * @member {string} id\n * @static\n * @public\n */\n\n }, {\n key: 'isSupported',\n value: function isSupported() {\n _shakaPlayer2.default.polyfill.installAll();\n var isSupported = _shakaPlayer2.default.Player.isBrowserSupported();\n DashAdapter._logger.debug('isSupported:' + isSupported);\n return isSupported;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to the dash adapter\n * @param {Object} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n\n }]);\n\n function DashAdapter(videoElement, source) {\n var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n _classCallCheck(this, DashAdapter);\n\n DashAdapter._logger.debug('Creating adapter. Shaka version: ' + _shakaPlayer2.default.Player.version);\n\n var _this = _possibleConstructorReturn(this, (DashAdapter.__proto__ || Object.getPrototypeOf(DashAdapter)).call(this, videoElement, source, config));\n\n _this._shaka = new _shakaPlayer2.default.Player(videoElement);\n _this._shaka.configure(config);\n _this._addBindings();\n return _this;\n }\n\n /**\n * Add the required bindings to shaka.\n * @function _addBindings\n * @private\n * @returns {void}\n */\n\n\n _createClass(DashAdapter, [{\n key: '_addBindings',\n value: function _addBindings() {\n this._shaka.addEventListener('adaptation', this._onAdaptation.bind(this));\n this._shaka.addEventListener('error', this._onError.bind(this));\n }\n\n /**\n * Remove the bindings to shaka.\n * @function _removeBindings\n * @private\n * @returns {void}\n */\n\n }, {\n key: '_removeBindings',\n value: function _removeBindings() {\n this._shaka.removeEventListener('adaptation', this._onAdaptation);\n this._shaka.removeEventListener('error', this._onError);\n }\n\n /**\n * Load the video source\n * @function load\n * @override\n */\n\n }, {\n key: 'load',\n value: function load() {\n var _this2 = this;\n\n if (!this._loadPromise) {\n this._loadPromise = new Promise(function (resolve, reject) {\n if (_this2._sourceObj && _this2._sourceObj.url) {\n _this2._shaka.load(_this2._sourceObj.url).then(function () {\n var data = { tracks: _this2._getParsedTracks() };\n DashAdapter._logger.debug('The source has been loaded successfully');\n resolve(data);\n }).catch(function (error) {\n reject(error);\n _this2._onError(error);\n });\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroying the dash adapter\n * @function destroy\n * @override\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n DashAdapter._logger.debug('destroy');\n _get(DashAdapter.prototype.__proto__ || Object.getPrototypeOf(DashAdapter.prototype), 'destroy', this).call(this);\n this._loadPromise = null;\n this._removeBindings();\n this._shaka.destroy();\n }\n\n /**\n * Get the original video tracks\n * @function _getVideoTracks\n * @returns {Array<Object>} - The original video tracks\n * @private\n */\n\n }, {\n key: '_getVideoTracks',\n value: function _getVideoTracks() {\n var variantTracks = this._shaka.getVariantTracks();\n var activeVariantTrack = variantTracks.filter(function (variantTrack) {\n return variantTrack.active;\n })[0];\n var videoTracks = variantTracks.filter(function (variantTrack) {\n return variantTrack.audioId === activeVariantTrack.audioId;\n });\n return videoTracks;\n }\n\n /**\n * Get the original audio tracks\n * @function _getAudioTracks\n * @returns {Array<Object>} - The original audio tracks\n * @private\n */\n\n }, {\n key: '_getAudioTracks',\n value: function _getAudioTracks() {\n var variantTracks = this._shaka.getVariantTracks();\n var activeVariantTrack = variantTracks.filter(function (variantTrack) {\n return variantTrack.active;\n })[0];\n var audioTracks = variantTracks.filter(function (variantTrack) {\n return variantTrack.videoId === activeVariantTrack.videoId;\n });\n return audioTracks;\n }\n\n /**\n * Get the parsed tracks\n * @function _getParsedTracks\n * @returns {Array<Track>} - The parsed tracks\n * @private\n */\n\n }, {\n key: '_getParsedTracks',\n value: function _getParsedTracks() {\n var videoTracks = this._getParsedVideoTracks();\n var audioTracks = this._getParsedAudioTracks();\n var textTracks = this._getParsedTextTracks();\n return videoTracks.concat(audioTracks).concat(textTracks);\n }\n\n /**\n * Get the parsed video tracks\n * @function _getParsedVideoTracks\n * @returns {Array<VideoTrack>} - The parsed video tracks\n * @private\n */\n\n }, {\n key: '_getParsedVideoTracks',\n value: function _getParsedVideoTracks() {\n var videoTracks = this._getVideoTracks();\n var parsedTracks = [];\n if (videoTracks) {\n for (var i = 0; i < videoTracks.length; i++) {\n var settings = {\n id: videoTracks[i].id,\n bandwidth: videoTracks[i].bandwidth,\n active: videoTracks[i].active,\n label: videoTracks[i].label,\n index: i\n };\n parsedTracks.push(new _playkitJs.VideoTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed audio tracks\n * @function _getParsedAudioTracks\n * @returns {Array<AudioTrack>} - The parsed audio tracks\n * @private\n */\n\n }, {\n key: '_getParsedAudioTracks',\n value: function _getParsedAudioTracks() {\n var audioTracks = this._getAudioTracks();\n var parsedTracks = [];\n if (audioTracks) {\n for (var i = 0; i < audioTracks.length; i++) {\n var settings = {\n id: audioTracks[i].id,\n active: audioTracks[i].active,\n label: audioTracks[i].label,\n language: audioTracks[i].language,\n index: i\n };\n parsedTracks.push(new _playkitJs.AudioTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed text tracks\n * @function _getParsedTextTracks\n * @returns {Array<TextTrack>} - The parsed text tracks\n * @private\n */\n\n }, {\n key: '_getParsedTextTracks',\n value: function _getParsedTextTracks() {\n var textTracks = this._shaka.getTextTracks();\n var parsedTracks = [];\n if (textTracks) {\n for (var i = 0; i < textTracks.length; i++) {\n var settings = {\n kind: textTracks[i].kind ? textTracks[i].kind + 's' : \"\",\n active: textTracks[i].active,\n label: textTracks[i].label,\n language: textTracks[i].language,\n index: i\n };\n parsedTracks.push(new _playkitJs.TextTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Select a video track\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the video track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectVideoTrack',\n value: function selectVideoTrack(videoTrack) {\n var videoTracks = this._getVideoTracks();\n if (videoTrack instanceof _playkitJs.VideoTrack && videoTracks) {\n var selectedVideoTrack = videoTracks[videoTrack.index];\n if (selectedVideoTrack) {\n this._shaka.configure({ abr: { enabled: false } });\n if (!selectedVideoTrack.active) {\n this._shaka.selectVariantTrack(videoTracks[videoTrack.index], true);\n this._onTrackChanged(videoTrack);\n }\n }\n }\n }\n\n /**\n * Select an audio track\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectAudioTrack',\n value: function selectAudioTrack(audioTrack) {\n if (audioTrack instanceof _playkitJs.AudioTrack && !audioTrack.active) {\n this._shaka.selectAudioLanguage(audioTrack.language);\n this._onTrackChanged(audioTrack);\n }\n }\n\n /**\n * Select a text track\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'selectTextTrack',\n value: function selectTextTrack(textTrack) {\n if (textTrack instanceof _playkitJs.TextTrack && !textTrack.active && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions')) {\n this._shaka.selectTextLanguage(textTrack.language);\n this._shaka.setTextTrackVisibility(true);\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'hideTextTrack',\n value: function hideTextTrack() {\n this._shaka.setTextTrackVisibility(false);\n }\n\n /**\n * Enables adaptive bitrate switching\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n\n }, {\n key: 'enableAdaptiveBitrate',\n value: function enableAdaptiveBitrate() {\n this._shaka.configure({ abr: { enabled: true } });\n }\n\n /**\n * An handler to shaka adaptation event\n * @function _onAdaptation\n * @returns {void}\n * @private\n */\n\n }, {\n key: '_onAdaptation',\n value: function _onAdaptation() {\n var selectedVideoTrack = this._getParsedVideoTracks().filter(function (videoTrack) {\n return videoTrack.active;\n })[0];\n this._onTrackChanged(selectedVideoTrack);\n }\n\n /**\n * An handler to shaka error event\n * @function _onError\n * @param {any} error - the error\n * @returns {void}\n * @private\n */\n\n }, {\n key: '_onError',\n value: function _onError(error) {\n DashAdapter._logger.error(error);\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * In case the adapter preformed a load it will return the manifest url.\n * @public\n * @returns {string} - The src url.\n */\n\n }, {\n key: 'src',\n get: function get() {\n if (this._loadPromise && this._sourceObj) {\n return this._sourceObj.url;\n }\n return \"\";\n }\n }]);\n\n return DashAdapter;\n}(_playkitJs.BaseMediaSourceAdapter);\n\n// Register DashAdapter to the media source adapter manager\n\n\nDashAdapter.id = 'DashAdapter';\nDashAdapter._logger = _playkitJs.BaseMediaSourceAdapter.getLogger(DashAdapter.id);\nDashAdapter._dashMimeType = 'application/dash+xml';\nexports.default = DashAdapter;\nif (DashAdapter.isSupported()) {\n (0, _playkitJs.registerMediaSourceAdapter)(DashAdapter);\n}\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n/***/ })\n/******/ ]);\n});\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_RESULT__;(function(){var g={};\n(function(window){var k,aa=this;aa.we=!0;function n(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.Be=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.ye=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};/*\n\n Copyright 2016 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\nfunction 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 t(a,b,c,d){this.severity=a;this.category=b;this.code=c;this.data=Array.prototype.slice.call(arguments,3)}n(\"shaka.util.Error\",t);t.prototype.toString=function(){return\"shaka.util.Error \"+JSON.stringify(this,null,\" \")};t.Severity={RECOVERABLE:1,CRITICAL:2};t.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9};\nt.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,\nMP4_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,\nDASH_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,\nHLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,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,\nOFFLINE_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};var ha=/^(?:([^:/?#.]+):)?(?:\\/\\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$/;function ia(a){var b;a instanceof ia?(ja(this,a.aa),this.Ba=a.Ba,this.ca=a.ca,ka(this,a.Ja),this.W=a.W,la(this,ma(a.a)),this.ta=a.ta):a&&(b=String(a).match(ha))?(ja(this,b[1]||\"\",!0),this.Ba=na(b[2]||\"\"),this.ca=na(b[3]||\"\",!0),ka(this,b[4]),this.W=na(b[5]||\"\",!0),la(this,b[6]||\"\",!0),this.ta=na(b[7]||\"\")):this.a=new oa(null)}k=ia.prototype;k.aa=\"\";k.Ba=\"\";k.ca=\"\";k.Ja=null;k.W=\"\";k.ta=\"\";\nk.toString=function(){var a=[],b=this.aa;b&&a.push(qa(b,ra,!0),\":\");if(b=this.ca){a.push(\"//\");var c=this.Ba;c&&a.push(qa(c,ra,!0),\"@\");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,\"%$1\"));b=this.Ja;null!=b&&a.push(\":\",String(b))}if(b=this.W)this.ca&&\"/\"!=b.charAt(0)&&a.push(\"/\"),a.push(qa(b,\"/\"==b.charAt(0)?sa:ta,!0));(b=this.a.toString())&&a.push(\"?\",b);(b=this.ta)&&a.push(\"#\",qa(b,ua));return a.join(\"\")};\nk.resolve=function(a){var b=new ia(this);\"data\"===b.aa&&(b=new ia);var c=!!a.aa;c?ja(b,a.aa):c=!!a.Ba;c?b.Ba=a.Ba:c=!!a.ca;c?b.ca=a.ca:c=null!=a.Ja;var d=a.W;if(c)ka(b,a.Ja);else if(c=!!a.W){if(\"/\"!=d.charAt(0))if(this.ca&&!this.W)d=\"/\"+d;else{var e=b.W.lastIndexOf(\"/\");-1!=e&&(d=b.W.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<\nf.length||1==f.length&&\"\"!=f[0])&&f.pop(),e&&g==d.length&&f.push(\"\")):(f.push(h),e=!0)}d=f.join(\"/\")}}c?b.W=d:c=\"\"!==a.a.toString();c?la(b,ma(a.a)):c=!!a.ta;c&&(b.ta=a.ta);return b};function ja(a,b,c){a.aa=c?na(b,!0):b;a.aa&&(a.aa=a.aa.replace(/:$/,\"\"))}function ka(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error(\"Bad port number \"+b);a.Ja=b}else a.Ja=null}function la(a,b,c){b instanceof oa?a.a=b:(c||(b=qa(b,va)),a.a=new oa(b))}\nfunction na(a,b){return a?b?decodeURI(a):decodeURIComponent(a):\"\"}function qa(a,b,c){return\"string\"==typeof a?(a=encodeURI(a).replace(b,wa),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,\"%$1\")),a):null}function wa(a){a=a.charCodeAt(0);return\"%\"+(a>>4&15).toString(16)+(a&15).toString(16)}var ra=/[#\\/\\?@]/g,ta=/[\\#\\?:]/g,sa=/[\\#\\?]/g,va=/[\\#\\?@]/g,ua=/#/g;function oa(a){this.b=a||null}oa.prototype.a=null;oa.prototype.c=null;\noa.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 ma(a){var b=new oa;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 xa(a,b){return a.reduce(function(a,b,e){return b[\"catch\"](a.bind(null,e))}.bind(null,b),Promise.reject())}function x(a,b){return a.concat(b)}function y(){}function ya(a){return null!=a}function za(a){return function(b){return b!=a}}function Aa(a,b,c){return c.indexOf(a)==b};function z(a,b){if(!b.length)return a;var c=b.map(function(a){return new ia(a)});return a.map(function(a){return new ia(a)}).map(function(a){return c.map(a.resolve.bind(a))}).reduce(x,[]).map(function(a){return a.toString()})}function Ba(a,b){return{keySystem:a,licenseServerUri:\"\",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:\"\",videoRobustness:\"\",serverCertificate:null,initData:b||[],keyIds:[]}};function Ca(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],m=!!{\".abr.manager\":!0}[h]||!!{serverCertificate:!0}[g];if(f||g in a)void 0===b[g]?void 0===l||f?delete a[g]:a[g]=l:m?a[g]=b[g]:\"object\"==typeof a[g]&&\"object\"==typeof b[g]?Ca(a[g],b[g],l,d,h):typeof b[g]==typeof l&&(a[g]=b[g])}}function Da(a){return JSON.parse(JSON.stringify(a))};function A(){var a,b,c=new Promise(function(c,e){a=c;b=e});c.resolve=a;c.reject=b;return c};function B(a){this.f=!1;this.a=[];this.b=[];this.c=[];this.h=a||null}n(\"shaka.net.NetworkingEngine\",B);B.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3};var Ea={};B.registerScheme=function(a,b){Ea[a]=b};B.unregisterScheme=function(a){delete Ea[a]};B.prototype.Ld=function(a){this.b.push(a)};B.prototype.registerRequestFilter=B.prototype.Ld;B.prototype.oe=function(a){var b=this.b;a=b.indexOf(a);0<=a&&b.splice(a,1)};B.prototype.unregisterRequestFilter=B.prototype.oe;\nB.prototype.Ic=function(){this.b=[]};B.prototype.clearAllRequestFilters=B.prototype.Ic;B.prototype.Md=function(a){this.c.push(a)};B.prototype.registerResponseFilter=B.prototype.Md;B.prototype.pe=function(a){var b=this.c;a=b.indexOf(a);0<=a&&b.splice(a,1)};B.prototype.unregisterResponseFilter=B.prototype.pe;B.prototype.Jc=function(){this.c=[]};B.prototype.clearAllResponseFilters=B.prototype.Jc;function Fa(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0}}\nfunction C(a,b){return{uris:a,method:\"GET\",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b}}B.prototype.m=function(){this.f=!0;this.b=[];this.c=[];for(var a=[],b=0;b<this.a.length;++b)a.push(this.a[b][\"catch\"](y));return Promise.all(a)};B.prototype.destroy=B.prototype.m;\nB.prototype.request=function(a,b){if(this.f)return Promise.reject();b.method=b.method||\"GET\";b.headers=b.headers||{};b.retryParameters=b.retryParameters?Da(b.retryParameters):Fa();b.uris=Da(b.uris);var c=Date.now(),d=Promise.resolve();this.b.forEach(function(c){d=d.then(c.bind(null,a,b))});d=d[\"catch\"](function(a){throw new t(2,1,1006,a);});d=d.then(function(){for(var d=Date.now()-c,f=b.retryParameters||{},g=f.maxAttempts||1,h=f.backoffFactor||2,f=null==f.baseDelay?1E3:f.baseDelay,l=this.g(a,b,0,\nd),m=1;m<g;m++)l=l[\"catch\"](function(c,e,f){if(f&&1==f.severity){f=new A;var g=b.retryParameters||{};window.setTimeout(f.resolve,c*(1+(2*Math.random()-1)*(null==g.fuzzFactor?.5:g.fuzzFactor)));return f.then(this.g.bind(this,a,b,e,d))}throw f;}.bind(this,f,m%b.uris.length)),f*=h;return l}.bind(this));this.a.push(d);return d.then(function(b){0<=this.a.indexOf(d)&&this.a.splice(this.a.indexOf(d),1);this.h&&!b.fromCache&&1==a&&this.h(b.timeMs,b.data.byteLength);return b}.bind(this))[\"catch\"](function(a){a&&\n(a.severity=2);0<=this.a.indexOf(d)&&this.a.splice(this.a.indexOf(d),1);return Promise.reject(a)}.bind(this))};B.prototype.request=B.prototype.request;\nB.prototype.g=function(a,b,c,d){if(this.f)return Promise.reject();var e=new ia(b.uris[c]),f=e.aa;f||(f=location.protocol,f=f.slice(0,-1),ja(e,f),b.uris[c]=e.toString());f=Ea[f];if(!f)return Promise.reject(new t(2,1,1E3,e));var g=Date.now();return f(b.uris[c],b,a).then(function(b){void 0==b.timeMs&&(b.timeMs=Date.now()-g);var c=Date.now(),e=Promise.resolve();this.c.forEach(function(c){e=e.then(function(){return Promise.resolve(c(a,b))}.bind(this))});e=e[\"catch\"](function(a){var b=2;a instanceof t&&\n(b=a.severity);throw new t(b,1,1007,a);});return e.then(function(){b.timeMs+=Date.now()-c;b.timeMs+=d;return b})}.bind(this))};function Ga(a,b){for(var c=[],d=0;d<a.length;++d){for(var e=!1,f=0;f<c.length&&!(e=b?b(a[d],c[f]):a[d]===c[f]);++f);e||c.push(a[d])}return c}function Ha(a,b,c){for(var d=0;d<a.length;++d)if(c(a[d],b))return d;return-1};function Ia(){this.a={}}Ia.prototype.push=function(a,b){this.a.hasOwnProperty(a)?this.a[a].push(b):this.a[a]=[b]};Ia.prototype.get=function(a){return(a=this.a[a])?a.slice():null};Ia.prototype.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)};function D(){this.a=new Ia}D.prototype.m=function(){Ja(this);this.a=null;return Promise.resolve()};function E(a,b,c,d){a.a&&(b=new Ka(b,c,d),a.a.push(c,b))}function La(a,b,c,d){E(a,b,c,function(a){this.ha(b,c);d(a)}.bind(a))}D.prototype.ha=function(a,b){if(this.a)for(var c=this.a.get(b)||[],d=0;d<c.length;++d){var e=c[d];e.target==a&&(e.ha(),this.a.remove(b,e))}};function Ja(a){if(a.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].ha();a.a.a={}}}\nfunction Ka(a,b,c){this.target=a;this.type=b;this.a=c;this.target.addEventListener(b,c,!1)}Ka.prototype.ha=function(){this.target.removeEventListener(this.type,this.a,!1);this.a=this.target=null};function Ma(a){return!a||!Object.keys(a).length}function Na(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,b){Object.keys(a).forEach(function(c){b(c,a[c])})};function F(a){if(!a)return\"\";a=new Uint8Array(a);239==a[0]&&187==a[1]&&191==a[2]&&(a=a.subarray(3));a=escape(Ra(a));try{return decodeURIComponent(a)}catch(b){throw new t(2,2,2004);}}n(\"shaka.util.StringUtils.fromUTF8\",F);\nfunction Sa(a,b,c){if(!a)return\"\";if(!c&&a.byteLength%2)throw new t(2,2,2004);if(a instanceof ArrayBuffer)var d=a;else c=new Uint8Array(a.byteLength),c.set(new Uint8Array(a)),d=c.buffer;a=Math.floor(a.byteLength/2);c=new Uint16Array(a);d=new DataView(d);for(var e=0;e<a;e++)c[e]=d.getUint16(2*e,b);return Ra(c)}n(\"shaka.util.StringUtils.fromUTF16\",Sa);\nfunction Ta(a){var b=new Uint8Array(a);if(239==b[0]&&187==b[1]&&191==b[2])return F(b);if(254==b[0]&&255==b[1])return Sa(b.subarray(2),!1);if(255==b[0]&&254==b[1])return Sa(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 Sa(a,!0);if(c(0)&&c(1)&&c(2)&&c(3))return F(a)}else return Sa(a,!1);throw new t(2,2,2003);}n(\"shaka.util.StringUtils.fromBytesAutoDetect\",Ta);\nfunction Ua(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}n(\"shaka.util.StringUtils.toUTF8\",Ua);function Ra(a){for(var b=\"\",c=0;c<a.length;c+=16E3)b+=String.fromCharCode.apply(null,a.subarray(c,c+16E3));return b};function Va(a){this.a=null;this.b=function(){this.a=null;a()}.bind(this)}Va.prototype.cancel=function(){null!=this.a&&(clearTimeout(this.a),this.a=null)};function Wa(a){a.cancel();a.a=setTimeout(a.b,500)};function Xa(a,b){var c=void 0==b?!0:b,d=window.btoa(String.fromCharCode.apply(null,a)).replace(/\\+/g,\"-\").replace(/\\//g,\"_\");return c?d:d.replace(/=*$/,\"\")}n(\"shaka.util.Uint8ArrayUtils.toBase64\",Xa);function Ya(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}n(\"shaka.util.Uint8ArrayUtils.fromBase64\",Ya);\nfunction Za(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}n(\"shaka.util.Uint8ArrayUtils.fromHex\",Za);function $a(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}n(\"shaka.util.Uint8ArrayUtils.toHex\",$a);function ab(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}n(\"shaka.util.Uint8ArrayUtils.equal\",ab);\nn(\"shaka.util.Uint8ArrayUtils.concat\",function(a){for(var b=0,c=0;c<arguments.length;++c)b+=arguments[c].length;for(var b=new Uint8Array(b),d=0,c=0;c<arguments.length;++c)b.set(arguments[c],d),d+=arguments[c].length;return b});function bb(a,b,c,d){this.j=this.i=this.v=null;this.J=!1;this.b=null;this.f=new D;this.a=[];this.o=[];this.l=new A;this.ka=a;this.h=null;this.g=function(a){this.l.reject(a);b(a)}.bind(this);this.A={};this.Ca=c;this.la=d;this.B=new Va(this.Kd.bind(this));this.ja=this.c=!1;this.G=[];this.ia=!1;this.O=setInterval(this.Jd.bind(this),1E3);this.l[\"catch\"](function(){})}k=bb.prototype;\nk.m=function(){this.c=!0;var a=this.a.map(function(a){return(a.ba.close()||Promise.resolve())[\"catch\"](y)});this.l.reject();this.f&&a.push(this.f.m());this.j&&a.push(this.j.setMediaKeys(null)[\"catch\"](y));this.O&&(clearInterval(this.O),this.O=null);this.B&&this.B.cancel();this.f=this.j=this.i=this.v=this.b=this.B=null;this.a=[];this.o=[];this.la=this.g=this.h=this.ka=null;return Promise.all(a)};k.configure=function(a){this.h=a};\nk.init=function(a,b){var c={},d=[];this.ja=b;this.o=a.offlineSessionIds;cb(this,a,b||0<a.offlineSessionIds.length,c,d);return d.length?db(this,c,d):(this.J=!0,Promise.resolve())};\nfunction eb(a,b){if(!a.i)return La(a.f,b,\"encrypted\",function(){this.g(new t(2,6,6010))}.bind(a)),Promise.resolve();a.j=b;La(a.f,a.j,\"play\",a.qd.bind(a));var c=a.j.setMediaKeys(a.i),c=c[\"catch\"](function(a){return Promise.reject(new t(2,6,6003,a.message))}),d=null;a.b.serverCertificate&&(d=a.i.setServerCertificate(a.b.serverCertificate).then(function(){})[\"catch\"](function(a){return Promise.reject(new t(2,6,6004,a.message))}));return Promise.all([c,d]).then(function(){if(this.c)return Promise.reject();\nfb(this);this.b.initData.length||this.o.length||E(this.f,this.j,\"encrypted\",this.fd.bind(this))}.bind(a))[\"catch\"](function(a){return this.c?Promise.resolve():Promise.reject(a)}.bind(a))}function gb(a,b){return Promise.all(b.map(function(a){return hb(this,a).then(function(a){if(a){for(var b=new A,c=0;c<this.a.length;c++)if(this.a[c].ba==a){this.a[c].ib=b;break}return Promise.all([a.remove(),b])}}.bind(this))}.bind(a)))}\nfunction fb(a){var b=a.b?a.b.initData:[];b.forEach(function(a){ib(this,a.initDataType,a.initData)}.bind(a));a.o.forEach(function(a){hb(this,a)}.bind(a));b.length||a.o.length||a.l.resolve();return a.l}k.keySystem=function(){return this.b?this.b.keySystem:\"\"};function jb(a){return a.a.map(function(a){return a.ba.sessionId})}k.ab=function(){var a=this.a.map(function(a){a=a.ba.expiration;return isNaN(a)?Infinity:a});return Math.min.apply(Math,a)};\nfunction cb(a,b,c,d,e){var f=kb(a);b.periods.forEach(function(a){a.variants.forEach(function(a){f&&(a.drmInfos=[f]);a.drmInfos.forEach(function(b){lb(this,b);window.cast&&window.cast.__platform__&&\"com.microsoft.playready\"==b.keySystem&&(b.keySystem=\"com.chromecast.playready\");var f=d[b.keySystem];f||(f={audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:\"optional\",persistentState:c?\"required\":\"optional\",sessionTypes:[c?\"persistent-license\":\"temporary\"],label:b.keySystem,drmInfos:[]},\nd[b.keySystem]=f,e.push(b.keySystem));f.drmInfos.push(b);b.distinctiveIdentifierRequired&&(f.distinctiveIdentifier=\"required\");b.persistentStateRequired&&(f.persistentState=\"required\");var g=[];a.video&&g.push(a.video);a.audio&&g.push(a.audio);g.forEach(function(a){var c=\"video\"==a.type?f.videoCapabilities:f.audioCapabilities,d=(\"video\"==a.type?b.videoRobustness:b.audioRobustness)||\"\",e=a.mimeType;a.codecs&&(e+='; codecs=\"'+a.codecs+'\"');c.push({robustness:d,contentType:e})}.bind(this))}.bind(this))}.bind(this))}.bind(a))}\nfunction db(a,b,c){if(1==c.length&&\"\"==c[0])return Promise.reject(new t(2,6,6E3));var d=new A,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 t(2,\n6,6001))});e=e.then(function(a){if(this.c)return Promise.reject();var c=0<=navigator.userAgent.indexOf(\"Edge/\"),d=a.getConfiguration();this.v=(d.audioCapabilities||[]).concat(d.videoCapabilities||[]).map(function(a){return a.contentType});c&&(this.v=null);c=b[a.keySystem];mb(this,a.keySystem,c,c.drmInfos);return this.b.licenseServerUri?a.createMediaKeys():Promise.reject(new t(2,6,6012))}.bind(a)).then(function(a){if(this.c)return Promise.reject();this.i=a;this.J=!0}.bind(a))[\"catch\"](function(a){if(this.c)return Promise.resolve();\nthis.v=this.b=null;return a instanceof t?Promise.reject(a):Promise.reject(new t(2,6,6002,a.message))}.bind(a));d.reject();return e}\nfunction lb(a,b){var c=b.keySystem;if(c){if(!b.licenseServerUri){var d=a.h.servers[c];d&&(b.licenseServerUri=d)}b.keyIds||(b.keyIds=[]);if(c=a.h.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)}}\nfunction kb(a){if(Ma(a.h.clearKeys))return null;var b=[],c=[],d;for(d in a.h.clearKeys){var e=a.h.clearKeys[d],f=Za(d),e=Za(e),f={kty:\"oct\",kid:Xa(f,!1),k:Xa(e,!1)};b.push(f);c.push(f.kid)}a=JSON.stringify({keys:b});c=JSON.stringify({kids:c});c=[{initData:new Uint8Array(Ua(c)),initDataType:\"keyids\"}];return{keySystem:\"org.w3.clearkey\",licenseServerUri:\"data:application/json;base64,\"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:\"\",videoRobustness:\"\",serverCertificate:null,\ninitData:c,keyIds:[]}}function mb(a,b,c,d){var e=[],f=[],g=[],h=[];nb(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}}\nfunction nb(a,b,c,d,e){function f(a,b){return a.keyId&&a.keyId==b.keyId?!0:a.initDataType==b.initDataType&&ab(a.initData,b.initData)}a.forEach(function(a){-1==b.indexOf(a.licenseServerUri)&&b.push(a.licenseServerUri);a.serverCertificate&&-1==Ha(c,a.serverCertificate,ab)&&c.push(a.serverCertificate);a.initData&&a.initData.forEach(function(a){-1==Ha(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])})}\nk.fd=function(a){for(var b=new Uint8Array(a.initData),c=0;c<this.a.length;++c)if(ab(b,this.a[c].initData))return;ib(this,a.initDataType,b)};\nfunction hb(a,b){try{var c=a.i.createSession(\"persistent-license\")}catch(f){var d=new t(2,6,6005,f.message);a.g(d);return Promise.reject(d)}E(a.f,c,\"message\",a.kc.bind(a));E(a.f,c,\"keystatuseschange\",a.ec.bind(a));var e={initData:null,ba:c,loaded:!1,zb:Infinity,ib:null};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.l.resolve(),c;this.a.splice(this.a.indexOf(e),1);this.g(new t(2,6,6013))}}.bind(a),function(a){this.c||\n(this.a.splice(this.a.indexOf(e),1),this.g(new t(2,6,6005,a.message)))}.bind(a))}\nfunction ib(a,b,c){try{var d=a.ja?a.i.createSession(\"persistent-license\"):a.i.createSession()}catch(e){a.g(new t(2,6,6005,e.message));return}E(a.f,d,\"message\",a.kc.bind(a));E(a.f,d,\"keystatuseschange\",a.ec.bind(a));a.a.push({initData:c,ba:d,loaded:!1,zb:Infinity,ib:null});d.generateRequest(b,c.buffer)[\"catch\"](function(a){if(!this.c){for(var b=0;b<this.a.length;++b)if(this.a[b].ba==d){this.a.splice(b,1);break}this.g(new t(2,6,6006,a.message))}}.bind(a))}\nk.kc=function(a){this.h.delayLicenseRequestUntilPlayed&&this.j.paused&&!this.ia?this.G.push(a):ob(this,a)};\nfunction ob(a,b){for(var c=b.target,d,e=0;e<a.a.length;e++)if(a.a[e].ba==c){d=a.a[e].ib;break}e=C([a.b.licenseServerUri],a.h.retryParameters);e.body=b.message;e.method=\"POST\";\"com.microsoft.playready\"!=a.b.keySystem&&\"com.chromecast.playready\"!=a.b.keySystem||pb(e);a.ka.request(2,e).then(function(a){return this.c?Promise.reject():c.update(a.data).then(function(){d&&d.resolve()})}.bind(a),function(a){if(this.c)return Promise.resolve();a=new t(2,6,6007,a);this.g(a);d&&d.reject(a)}.bind(a))[\"catch\"](function(a){if(this.c)return Promise.resolve();\na=new t(2,6,6008,a.message);this.g(a);d&&d.reject(a)}.bind(a))}function pb(a){var b=Sa(a.body,!0,!0);if(-1==b.indexOf(\"PlayReadyKeyMessage\"))a.headers[\"Content-Type\"]=\"text/xml; charset=utf-8\";else{for(var 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=Ya(b.querySelector(\"Challenge\").textContent).buffer}}\nk.ec=function(a){a=a.target;var b;for(b=0;b<this.a.length&&this.a[b].ba!=a;++b);if(b!=this.a.length){var c=!1;a.keyStatuses.forEach(function(a,d){if(\"string\"==typeof d){var e=d;d=a;a=e}if(\"com.microsoft.playready\"==this.b.keySystem&&16==d.byteLength){var e=new DataView(d),f=e.getUint32(0,!0),l=e.getUint16(4,!0),m=e.getUint16(6,!0);e.setUint32(0,f,!1);e.setUint16(4,l,!1);e.setUint16(6,m,!1)}\"com.microsoft.playready\"==this.b.keySystem&&\"status-pending\"==a&&(a=\"usable\");\"status-pending\"!=a&&(this.a[b].loaded=\n!0,this.a.every(function(a){return a.loaded})&&this.l.resolve());\"expired\"==a&&(c=!0);e=$a(new Uint8Array(d));this.A[e]=a}.bind(this));var d=a.expiration-Date.now();(0>d||c&&1E3>d)&&!this.a[b].ib&&(this.a.splice(b,1),a.close());Wa(this.B)}};k.Kd=function(){function a(a,c){return\"expired\"==c}!Ma(this.A)&&Pa(this.A,a)&&this.g(new t(2,6,6014));this.Ca(this.A)};\nfunction qb(){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){var c=a.getConfiguration().sessionTypes;d[b]=\n{persistentState:c?0<=c.indexOf(\"persistent-license\"):!1};return a.createMediaKeys()})[\"catch\"](function(){d[b]=null});a.push(e)});return Promise.all(a).then(function(){return d})}k.qd=function(){for(var a=0;a<this.G.length;a++)ob(this,this.G[a]);this.ia=!0;this.G=[]};function rb(a,b){var c=a.keySystem();return!b.drmInfos.length||b.drmInfos.some(function(a){return a.keySystem==c})}\nfunction sb(a,b){if(!a.length)return b;if(!b.length)return a;for(var c=[],d=0;d<a.length;d++)for(var e=0;e<b.length;e++)if(a[d].keySystem==b[e].keySystem){var f=a[d],e=b[e],g=[],g=g.concat(f.initData||[]),g=g.concat(e.initData||[]),h=[],h=h.concat(f.keyIds),h=h.concat(e.keyIds);c.push({keySystem:f.keySystem,licenseServerUri:f.licenseServerUri||e.licenseServerUri,distinctiveIdentifierRequired:f.distinctiveIdentifierRequired||e.distinctiveIdentifierRequired,persistentStateRequired:f.persistentStateRequired||\ne.persistentStateRequired,videoRobustness:f.videoRobustness||e.videoRobustness,audioRobustness:f.audioRobustness||e.audioRobustness,serverCertificate:f.serverCertificate||e.serverCertificate,initData:g,keyIds:h});break}return c}k.Jd=function(){this.a.forEach(function(a){var b=a.zb,c=a.ba.expiration;isNaN(c)&&(c=Infinity);c!=b&&(this.la(a.ba.sessionId,c),a.zb=c)}.bind(this))};function tb(a){this.f=null;this.c=a;this.h=0;this.g=Infinity;this.a=this.b=null}var ub={};function vb(a,b){ub[a]=b.length?wb.bind(null,b):b}n(\"shaka.media.TextEngine.registerParser\",vb);n(\"shaka.media.TextEngine.unregisterParser\",function(a){delete ub[a]});function xb(a,b,c){return a>=b?null:new VTTCue(a,b,c)}n(\"shaka.media.TextEngine.makeCue\",xb);tb.prototype.m=function(){this.c&&yb(this,function(){return!0});this.c=this.f=null;return Promise.resolve()};\nfunction zb(a,b,c,d){return Promise.resolve().then(function(){if(this.c)if(null==c||null==d)this.f.parseInit(b);else{for(var a=this.f.parseMedia(b,{periodStart:this.h,segmentStart:c,segmentEnd:d}),f=0;f<a.length&&!(a[f].startTime>=this.g);++f)this.c.addCue(a[f]);null==this.b&&(this.b=c);this.a=Math.min(d,this.g)}}.bind(a))}\ntb.prototype.remove=function(a,b){return Promise.resolve().then(function(){this.c&&(yb(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 yb(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 wb(a){this.Na=a}\nwb.prototype.parseInit=function(a){this.Na(a,0,null,null)};wb.prototype.parseMedia=function(a,b){return this.Na(a,b.periodStart,b.segmentStart,b.segmentEnd)};function Ab(a){return!a||1==a.length&&1E-6>a.end(0)-a.start(0)?null:a.length?a.end(a.length-1):null}function Bb(a,b){return!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0)?!1:b>=a.start(0)&&b<=a.end(a.length-1)}function Cb(a,b){if(!a||!a.length||1==a.length&&1E-6>a.end(0)-a.start(0))return 0;for(var c=0,d=a.length-1;0<=d&&a.end(d)>b;--d)c+=a.end(d)-Math.max(a.start(d),b);return c};function Db(a,b,c){this.f=a;this.N=b;this.i=c;this.c={};this.a=null;this.b={};this.g=new D;this.h=!1}\nfunction Eb(){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]=!!ub[b]||\nMediaSource.isTypeSupported(b);var c=b.split(\";\")[0];a[c]=a[c]||a[b]});return a}k=Db.prototype;k.m=function(){this.h=!0;var a=[],b;for(b in this.b){var c=this.b[b],d=c[0];this.b[b]=c.slice(0,1);d&&a.push(d.p[\"catch\"](y));for(d=1;d<c.length;++d)c[d].p[\"catch\"](y),c[d].p.reject()}this.a&&a.push(this.a.m());return Promise.all(a).then(function(){this.g.m();this.a=this.i=this.N=this.f=this.g=null;this.c={};this.b={}}.bind(this))};\nk.init=function(a){for(var b in a){var c=a[b];\"text\"==b?Fb(this,c):(c=this.N.addSourceBuffer(c),E(this.g,c,\"error\",this.je.bind(this,b)),E(this.g,c,\"updateend\",this.Ia.bind(this,b)),this.c[b]=c,this.b[b]=[])}};function Fb(a,b){a.a||(a.a=new tb(a.i));a.a.f=new ub[b]}function Gb(a,b){if(\"text\"==b)var c=a.a.b;else c=Ib(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 Ib(a,b){try{return a.c[b].buffered}catch(c){return null}}\nfunction Jb(a,b,c,d,e){return\"text\"==b?zb(a.a,c,d,e):Kb(a,b,a.ie.bind(a,b,c))}k.remove=function(a,b,c){return\"text\"==a?this.a.remove(b,c):Kb(this,a,this.qc.bind(this,a,b,c))};function Lb(a,b){return\"text\"==b?a.a.remove(0,Infinity):Kb(a,b,a.qc.bind(a,b,0,a.N.duration))}function Mb(a,b,c,d){if(\"text\"==b)return a.a.h=c,null!=d&&(a.a.g=d),Promise.resolve();null==d&&(d=Infinity);return Promise.all([Kb(a,b,a.Ec.bind(a,b)),Kb(a,b,a.Zd.bind(a,b,c)),Kb(a,b,a.Xd.bind(a,b,d))])}\nk.endOfStream=function(a){return Nb(this,function(){a?this.N.endOfStream(a):this.N.endOfStream()}.bind(this))};k.pa=function(a){return Nb(this,function(){this.N.duration=a}.bind(this))};k.Y=function(){return this.N.duration};k.ie=function(a,b){this.c[a].appendBuffer(b)};k.qc=function(a,b,c){c<=b?this.Ia(a):this.c[a].remove(b,c)};k.Ec=function(a){var b=this.c[a].appendWindowEnd;this.c[a].abort();this.c[a].appendWindowEnd=b;this.Ia(a)};k.Oc=function(a){this.f.currentTime-=.001;this.Ia(a)};\nk.Zd=function(a,b){this.c[a].timestampOffset=b;this.Ia(a)};k.Xd=function(a,b){this.c[a].appendWindowEnd=b+.04;this.Ia(a)};k.je=function(a){this.b[a][0].p.reject(new t(2,3,3014,this.f.error?this.f.error.code:0))};k.Ia=function(a){var b=this.b[a][0];b&&(b.p.resolve(),Ob(this,a))};\nfunction Kb(a,b,c){if(a.h)return Promise.reject();c={start:c,p:new A};a.b[b].push(c);if(1==a.b[b].length)try{c.start()}catch(d){\"QuotaExceededError\"==d.name?c.p.reject(new t(2,3,3017,b)):c.p.reject(new t(2,3,3015,d)),Ob(a,b)}return c.p}\nfunction Nb(a,b){if(a.h)return Promise.reject();var c=[],d;for(d in a.c){var e=new A,f={start:function(a){a.resolve()}.bind(null,e),p:e};a.b[d].push(f);c.push(e);1==a.b[d].length&&f.start()}return Promise.all(c).then(function(){var a;try{b()}catch(l){var c=Promise.reject(new t(2,3,3015,l))}for(a in this.c)Ob(this,a);return c}.bind(a),function(){return Promise.reject()}.bind(a))}function Ob(a,b){a.b[b].shift();var c=a.b[b][0];if(c)try{c.start()}catch(d){c.p.reject(new t(2,3,3015,d)),Ob(a,b)}};function Pb(a,b,c){return c==b||a>=Qb&&c==b.split(\"-\")[0]||a>=Rb&&c.split(\"-\")[0]==b.split(\"-\")[0]?!0:!1}var Qb=1,Rb=2;function Sb(a){a=a.toLowerCase().split(\"-\");var b=Tb[a[0]];b&&(a[0]=b);return a.join(\"-\")}\nvar Tb={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\",\nfry:\"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\",\nlug:\"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\",\nsrd:\"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 Ub(a,b,c){var d=a.video;return d&&(d.width<b.minWidth||d.width>b.maxWidth||d.width>c.width||d.height<b.minHeight||d.height>b.maxHeight||d.height>c.height||d.width*d.height<b.minPixels||d.width*d.height>b.maxPixels)||a.bandwidth<b.minBandwidth||a.bandwidth>b.maxBandwidth?!1:!0}function Vb(a,b,c){var d=!1;a.variants.forEach(function(a){var e=a.allowedByApplication;a.allowedByApplication=Ub(a,b,c);e!=a.allowedByApplication&&(d=!0)});return d}\nfunction Wb(a,b,c){var d=b.video,e=b.audio;for(b=0;b<c.variants.length;++b){var f=c.variants[b],g=a,h=e,l=d;(g&&g.J&&!rb(g,f)?0:Xb(f.audio,g,h)&&Xb(f.video,g,l))||(c.variants.splice(b,1),--b)}for(b=0;b<c.textStreams.length;++b)a=c.textStreams[b],ub[Yb(a.mimeType,a.codecs)]||(c.textStreams.splice(b,1),--b)}\nfunction Xb(a,b,c){if(!a)return!0;var d=null;b&&b.J&&(d=b.v);b=Yb(a.mimeType,a.codecs);return!ub[b]&&!MediaSource.isTypeSupported(b)||d&&a.encrypted&&0>d.indexOf(b)||c&&(a.mimeType!=c.mimeType||a.codecs.split(\".\")[0]!=c.codecs.split(\".\")[0])?!1:!0}\nfunction Zb(a,b,c){var d=null;return $b(a.variants).map(function(a){var e;a.video&&a.audio?e=c==a.video.id&&b==a.audio.id:e=a.video&&c==a.video.id||a.audio&&b==a.audio.id;var g=\"\";a.video&&(g+=a.video.codecs);a.audio&&(\"\"!=g&&(g+=\", \"),g+=a.audio.codecs,d=a.audio.label);var h=a.audio?a.audio.codecs:null,l=a.video?a.video.codecs:null,m=null;a.video?m=a.video.mimeType:a.audio&&(m=a.audio.mimeType);var q=null;a.audio?q=a.audio.kind:a.video&&(q=a.video.kind);var r=Ga((a.audio?a.audio.roles:[]).concat(a.video?\na.video.roles:[]));return{id:a.id,active:e,type:\"variant\",bandwidth:a.bandwidth,language:a.language,label:d,kind:q||null,width:a.video?a.video.width:null,height:a.video?a.video.height:null,frameRate:a.video?a.video.frameRate:void 0,mimeType:m,codecs:g,audioCodec:h,videoCodec:l,primary:a.primary,roles:r,videoId:a.video?a.video.id:null,audioId:a.audio?a.audio.id:null}})}\nfunction ac(a,b){return a.textStreams.map(function(a){return{id:a.id,active:b==a.id,type:\"text\",language:a.language,label:a.label,kind:a.kind,mimeType:a.mimeType,codecs:a.codecs||null,audioCodec:null,videoCodec:null,primary:a.primary,roles:a.roles}})}function bc(a,b){for(var c=0;c<a.variants.length;c++)if(a.variants[c].id==b.id)return a.variants[c];return null}function cc(a,b){for(var c=0;c<a.textStreams.length;c++)if(a.textStreams[c].id==b.id)return a.textStreams[c];return null}\nfunction $b(a){return a.filter(function(a){return a.allowedByApplication&&a.allowedByKeySystem})}\nfunction dc(a,b,c,d){var e=$b(a.variants),f=e.filter(function(a){return a.language==e[0].language});a=e.filter(function(a){return a.primary});a.length&&(f=a);if(b){var g=Sb(b);[Rb,Qb,0].forEach(function(a){var b=!1;e.forEach(function(d){g=Sb(g);var e=Sb(d.language);Pb(a,g,e)&&(b?f.push(d):(f=[d],b=!0),c&&(c.audio=!0))})})}var h=d||\"\";return h&&(b=f.filter(function(a){return a.audio&&-1<a.audio.roles.indexOf(h)||a.video&&-1<a.video.roles.indexOf(h)}),b.length)?b:f}\nfunction ec(a,b,c,d){var e=a.textStreams,f=e;a=e.filter(function(a){return a.primary});a.length&&(f=a);if(b){var g=Sb(b);[Rb,Qb,0].forEach(function(a){var b=!1;e.forEach(function(d){var e=Sb(d.language);Pb(a,g,e)&&(b?f.push(d):(f=[d],b=!0),c&&(c.text=!0))})})}var h=d||\"\";return h&&(b=f.filter(function(a){return a&&-1<a.roles.indexOf(h)}),b.length)?b:f}function fc(a,b,c){for(var d=0;d<c.length;d++)if(c[d].audio==a&&c[d].video==b)return c[d];return null}\nfunction gc(a,b,c){function d(a,b){return null==a?null==b:b.id==a}for(var e=0;e<c.length;e++)if(d(a,c[e].audio)&&d(b,c[e].video))return c[e];return null}function Yb(a,b){var c=a;b&&(c+='; codecs=\"'+b+'\"');return c}function hc(a,b){for(var c=a.periods.length-1;0<c;--c)if(b>=a.periods[c].startTime)return c;return 0}\nfunction ic(a,b){for(var c=0;c<a.periods.length;++c){var d=a.periods[c];if(\"text\"==b.type)for(var e=0;e<d.textStreams.length;++e){if(d.textStreams[e]==b)return c}else for(e=0;e<d.variants.length;++e){var f=d.variants[e];if(f.audio==b||f.video==b||f.video&&f.video.trickModeVideo==b)return c}}return-1};function H(){this.f=null;this.b=!1;this.a=new fa;this.h=[];this.g=[];this.j=!1;this.c=null;this.i={minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minBandwidth:0,maxBandwidth:Infinity}}n(\"shaka.abr.SimpleAbrManager\",H);H.prototype.stop=function(){this.f=null;this.b=!1;this.h=[];this.g=[];this.c=null};H.prototype.stop=H.prototype.stop;H.prototype.init=function(a){this.f=a};H.prototype.init=H.prototype.init;\nH.prototype.chooseStreams=function(a){var b={};if(-1<a.indexOf(\"audio\")||-1<a.indexOf(\"video\")){var c=this.h;var d=jc(this.i,c);var e=this.a.getBandwidthEstimate();if(c.length&&!d.length)throw new t(2,4,4012);for(var c=d[0],f=0;f<d.length;++f){var g=d[f],h=(d[f+1]||{bandwidth:Infinity}).bandwidth/.85;e>=g.bandwidth/.95&&e<=h&&(c=g)}(d=c)&&d.video&&(b.video=d.video);d&&d.audio&&(b.audio=d.audio)}-1<a.indexOf(\"text\")&&(b.text=this.g[0]);this.c=Date.now();return b};H.prototype.chooseStreams=H.prototype.chooseStreams;\nH.prototype.enable=function(){this.b=!0};H.prototype.enable=H.prototype.enable;H.prototype.disable=function(){this.b=!1};H.prototype.disable=H.prototype.disable;H.prototype.segmentDownloaded=function(a,b){var c=this.a;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;da(c.c,e,d);da(c.f,e,d)}if(null!=this.c&&this.b)a:{if(!this.j){if(!(128E3<=this.a.a))break a;this.j=!0}else if(8E3>Date.now()-this.c)break a;c=this.chooseStreams([\"audio\",\"video\"]);this.a.getBandwidthEstimate();this.f(c)}};\nH.prototype.segmentDownloaded=H.prototype.segmentDownloaded;H.prototype.getBandwidthEstimate=function(){return this.a.getBandwidthEstimate()};H.prototype.getBandwidthEstimate=H.prototype.getBandwidthEstimate;H.prototype.setDefaultEstimate=function(a){this.a.setDefaultEstimate(a)};H.prototype.setDefaultEstimate=H.prototype.setDefaultEstimate;H.prototype.setRestrictions=function(a){this.i=a};H.prototype.setRestrictions=H.prototype.setRestrictions;H.prototype.setVariants=function(a){this.h=a};\nH.prototype.setVariants=H.prototype.setVariants;H.prototype.setTextStreams=function(a){this.g=a};H.prototype.setTextStreams=H.prototype.setTextStreams;function jc(a,b){return b.filter(function(b){return Ub(b,a,{width:Infinity,height:Infinity})}).sort(function(a,b){return a.bandwidth-b.bandwidth})};function I(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}I.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};I.prototype.stopImmediatePropagation=function(){this.a=!0};I.prototype.stopPropagation=function(){};var kc=\"ended play playing pause pausing ratechange seeked seeking timeupdate volumechange\".split(\" \"),lc=\"buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume\".split(\" \"),mc=[\"loop\",\"playbackRate\"],nc=[\"pause\",\"play\"],oc=\"adaptation buffering emsg error loading unloading texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged\".split(\" \"),pc=\"drmInfo getAudioLanguages getConfiguration getExpiration getManifestUri getPlaybackRate getPlayheadTimeAsDate getTextLanguages getTextTracks getTracks getStats getVariantTracks isBuffering isInProgress isLive isTextTrackVisible keySystem seekRange\".split(\" \"),\nqc=[[\"getConfiguration\",\"configure\"]],rc=[[\"isTextTrackVisible\",\"setTextTrackVisibility\"]],sc=\"addTextTrack cancelTrickPlay configure resetConfiguration selectAudioLanguage selectTextLanguage selectTextTrack selectTrack selectVariantTrack setTextTrackVisibility trickPlay\".split(\" \"),uc=[\"load\",\"unload\"];\nfunction vc(a){return JSON.stringify(a,function(a,c){if(\"manager\"!=a&&\"function\"!=typeof c){if(c instanceof Event||c instanceof I){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}})}\nfunction wc(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__?xc(c):c})}function xc(a){return{length:a.length,start:function(b){return a.start[b]},end:function(b){return a.end[b]}}};function yc(a,b,c,d,e){this.J=a;this.l=b;this.B=c;this.G=d;this.v=e;this.c=this.j=this.h=!1;this.A=\"\";this.a=this.i=null;this.b={video:{},player:{}};this.o=0;this.f={};this.g=null}k=yc.prototype;k.m=function(){zc(this);this.a&&(this.a.leave(function(){},function(){}),this.a=null);this.G=this.B=this.l=null;this.c=this.j=this.h=!1;this.g=this.f=this.b=this.i=null;return Promise.resolve()};k.V=function(){return this.c};k.Fb=function(){return this.A};\nk.init=function(){if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){delete window.__onGCastApiAvailable;this.h=!0;this.l();var a=new chrome.cast.SessionRequest(this.J),a=new chrome.cast.ApiConfig(a,this.gd.bind(this),this.sd.bind(this),\"origin_scoped\");chrome.cast.initialize(a,function(){},function(){})}else window.__onGCastApiAvailable=function(a){a&&this.init()}.bind(this)};k.Ib=function(a){this.i=a;this.c&&Ac(this,{type:\"appData\",appData:this.i})};\nk.cast=function(a){if(!this.h)return Promise.reject(new t(1,8,8E3));if(!this.j)return Promise.reject(new t(1,8,8001));if(this.c)return Promise.reject(new t(1,8,8002));this.g=new A;chrome.cast.requestSession(this.Bb.bind(this,a),this.cc.bind(this));return this.g};k.$a=function(){this.c&&(zc(this),this.a&&(this.a.stop(function(){},function(){}),this.a=null))};\nk.get=function(a,b){if(\"video\"==a){if(0<=nc.indexOf(b))return this.pc.bind(this,a,b)}else if(\"player\"==a){if(0<=sc.indexOf(b))return this.pc.bind(this,a,b);if(0<=uc.indexOf(b))return this.Od.bind(this,a,b);if(0<=pc.indexOf(b))return this.lc.bind(this,a,b)}return this.lc(a,b)};k.set=function(a,b,c){this.b[a][b]=c;Ac(this,{type:\"set\",targetName:a,property:b,value:c})};\nk.Bb=function(a,b){this.a=b;this.a.addUpdateListener(this.dc.bind(this));this.a.addMessageListener(\"urn:x-cast:com.google.shaka.v2\",this.md.bind(this));this.dc();Ac(this,{type:\"init\",initState:a,appData:this.i});this.g.resolve()};k.cc=function(a){var b=8003;switch(a.code){case \"cancel\":b=8004;break;case \"timeout\":b=8005;break;case \"receiver_unavailable\":b=8006}this.g.reject(new t(2,8,b,a))};k.lc=function(a,b){return this.b[a][b]};\nk.pc=function(a,b){Ac(this,{type:\"call\",targetName:a,methodName:b,args:Array.prototype.slice.call(arguments,2)})};k.Od=function(a,b){var c=Array.prototype.slice.call(arguments,2),d=new A,e=this.o.toString();this.o++;this.f[e]=d;Ac(this,{type:\"asyncCall\",targetName:a,methodName:b,args:c,id:e});return d};k.gd=function(a){var b=this.v();this.g=new A;this.Bb(b,a)};k.sd=function(a){this.j=\"available\"==a;this.l()};\nk.dc=function(){var a=this.a?\"connected\"==this.a.status:!1;if(this.c&&!a){this.G();for(var b in this.b)this.b[b]={};zc(this)}this.A=(this.c=a)?this.a.receiver.friendlyName:\"\";this.l()};function zc(a){for(var b in a.f){var c=a.f[b];delete a.f[b];c.reject(new t(1,7,7E3))}}\nk.md=function(a,b){var c=wc(b);switch(c.type){case \"event\":var d=c.targetName,e=c.event;this.B(d,new I(e.type,e));break;case \"update\":e=c.update;for(d in e){var c=this.b[d]||{};for(f in e[d])c[f]=e[d][f]}break;case \"asyncComplete\":d=c.id;var f=c.error;c=this.f[d];delete this.f[d];if(c)if(f){d=new t(f.severity,f.category,f.code);for(e in f)d[e]=f[e];c.reject(d)}else c.resolve()}};function Ac(a,b){var c=vc(b);a.a.sendMessage(\"urn:x-cast:com.google.shaka.v2\",c,function(){},ga)};function p(){this.nb=new Ia;this.Ta=this}p.prototype.addEventListener=function(a,b){this.nb.push(a,b)};p.prototype.removeEventListener=function(a,b){this.nb.remove(a,b)};p.prototype.dispatchEvent=function(a){for(var b=this.nb.get(a.type)||[],c=0;c<b.length;++c){a.target=this.Ta;a.currentTarget=this.Ta;var d=b[c];try{d.handleEvent?d.handleEvent(a):d.call(this,a)}catch(e){}if(a.a)break}return a.defaultPrevented};function J(a,b,c){p.call(this);this.c=a;this.b=b;this.h=this.f=this.g=this.i=this.j=null;this.a=new yc(c,this.ee.bind(this),this.fe.bind(this),this.ge.bind(this),this.Vb.bind(this));Bc(this)}ba(J);n(\"shaka.cast.CastProxy\",J);J.prototype.m=function(a){a&&this.a&&this.a.$a();a=[this.h?this.h.m():null,this.b?this.b.m():null,this.a?this.a.m():null];this.a=this.h=this.i=this.j=this.b=this.c=null;return Promise.all(a)};J.prototype.destroy=J.prototype.m;J.prototype.Zc=function(){return this.j};\nJ.prototype.getVideo=J.prototype.Zc;J.prototype.Tc=function(){return this.i};J.prototype.getPlayer=J.prototype.Tc;J.prototype.Fc=function(){return this.a?this.a.h&&this.a.j:!1};J.prototype.canCast=J.prototype.Fc;J.prototype.V=function(){return this.a?this.a.V():!1};J.prototype.isCasting=J.prototype.V;J.prototype.Fb=function(){return this.a?this.a.Fb():\"\"};J.prototype.receiverName=J.prototype.Fb;J.prototype.cast=function(){var a=this.Vb();return this.a.cast(a).then(function(){return this.b.hb()}.bind(this))};\nJ.prototype.cast=J.prototype.cast;J.prototype.Ib=function(a){this.a.Ib(a)};J.prototype.setAppData=J.prototype.Ib;J.prototype.me=function(){var a=this.a;if(a.c){var b=a.v();chrome.cast.requestSession(a.Bb.bind(a,b),a.cc.bind(a))}};J.prototype.suggestDisconnect=J.prototype.me;J.prototype.$a=function(){this.a.$a()};J.prototype.forceDisconnect=J.prototype.$a;\nfunction Bc(a){a.a.init();a.h=new D;kc.forEach(function(a){E(this.h,this.c,a,this.te.bind(this))}.bind(a));oc.forEach(function(a){E(this.h,this.b,a,this.Id.bind(this))}.bind(a));a.j={};for(var b in a.c)Object.defineProperty(a.j,b,{configurable:!1,enumerable:!0,get:a.se.bind(a,b),set:a.ue.bind(a,b)});a.i={};for(b in a.b)Object.defineProperty(a.i,b,{configurable:!1,enumerable:!0,get:a.Hd.bind(a,b)});a.g=new p;a.g.Ta=a.j;a.f=new p;a.f.Ta=a.i}k=J.prototype;\nk.Vb=function(){var a={video:{},player:{},playerAfterLoad:{},manifest:this.b.Ya,startTime:null};this.c.pause();mc.forEach(function(b){a.video[b]=this.c[b]}.bind(this));this.c.ended||(a.startTime=this.c.currentTime);qc.forEach(function(b){var c=b[1];b=this.b[b[0]]();a.player[c]=b}.bind(this));rc.forEach(function(b){var c=b[1];b=this.b[b[0]]();a.playerAfterLoad[c]=b}.bind(this));return a};k.ee=function(){this.dispatchEvent(new I(\"caststatuschanged\"))};\nk.ge=function(){qc.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 I(\"error\",{detail:a}))}.bind(this)));var f={};mc.forEach(function(a){f[a]=this.a.get(\"video\",a)}.bind(this));c.then(function(){mc.forEach(function(a){this.c[a]=\nf[a]}.bind(this));rc.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))};\nk.se=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.V()&&!Object.keys(this.a.b.video).length){var b=this.c[a];if(\"function\"!=typeof b)return b}return this.a.V()?this.a.get(\"video\",a):(b=this.c[a],\"function\"==typeof b&&(b=b.bind(this.c)),b)};k.ue=function(a,b){this.a.V()?this.a.set(\"video\",a,b):this.c[a]=b};k.te=function(a){this.a.V()||this.g.dispatchEvent(new I(a.type,a))};\nk.Hd=function(a){return\"addEventListener\"==a?this.f.addEventListener.bind(this.f):\"removeEventListener\"==a?this.f.removeEventListener.bind(this.f):\"getNetworkingEngine\"==a?this.b.Wb.bind(this.b):this.a.V()&&!Object.keys(this.a.b.video).length&&0<=pc.indexOf(a)||!this.a.V()?(a=this.b[a],a.bind(this.b)):this.a.get(\"player\",a)};k.Id=function(a){this.a.V()||this.f.dispatchEvent(a)};k.fe=function(a,b){this.a.V()&&(\"video\"==a?this.g.dispatchEvent(b):\"player\"==a&&this.f.dispatchEvent(b))};function K(a,b,c,d){p.call(this);this.a=a;this.b=b;this.j={video:a,player:b};this.l=c||function(){};this.o=d||function(a){return a};this.i=!1;this.f=!0;this.h=this.g=this.c=null;Cc(this)}ba(K);n(\"shaka.cast.CastReceiver\",K);K.prototype.isConnected=function(){return this.i};K.prototype.isConnected=K.prototype.isConnected;K.prototype.ad=function(){return this.f};K.prototype.isIdle=K.prototype.ad;\nK.prototype.m=function(){var a=this.b?this.b.m():Promise.resolve();null!=this.h&&window.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;return a.then(function(){cast.receiver.CastReceiverManager.getInstance().stop()})};K.prototype.destroy=K.prototype.m;\nfunction Cc(a){var b=cast.receiver.CastReceiverManager.getInstance();b.onSenderConnected=a.jc.bind(a);b.onSenderDisconnected=a.jc.bind(a);b.onSystemVolumeChanged=a.Mc.bind(a);a.g=b.getCastMessageBus(\"urn:x-cast:com.google.cast.media\");a.g.onMessage=a.hd.bind(a);a.c=b.getCastMessageBus(\"urn:x-cast:com.google.shaka.v2\");a.c.onMessage=a.vd.bind(a);b.start();kc.forEach(function(a){this.a.addEventListener(a,this.mc.bind(this,\"video\"))}.bind(a));oc.forEach(function(a){this.b.addEventListener(a,this.mc.bind(this,\n\"player\"))}.bind(a));cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs=\"avc1.640028\"; width=3840; height=2160')?a.b.Jb(3840,2160):a.b.Jb(1920,1080);a.b.addEventListener(\"loading\",function(){this.f=!1;Dc(this)}.bind(a));a.a.addEventListener(\"playing\",function(){this.f=!1;Dc(this)}.bind(a));a.a.addEventListener(\"pause\",function(){Dc(this)}.bind(a));a.b.addEventListener(\"unloading\",function(){this.f=!0;Dc(this)}.bind(a));a.a.addEventListener(\"ended\",function(){window.setTimeout(function(){this.a&&\nthis.a.ended&&(this.f=!0,Dc(this))}.bind(this),5E3)}.bind(a))}k=K.prototype;k.jc=function(){this.i=!!cast.receiver.CastReceiverManager.getInstance().getSenders().length;Dc(this)};function Dc(a){Promise.resolve().then(function(){this.dispatchEvent(new I(\"caststatuschanged\"));L(this,0)}.bind(a))}\nfunction Ec(a,b,c){for(var d in b.player)a.b[d](b.player[d]);a.l(c);c=Promise.resolve();var e=a.a.autoplay;b.manifest&&(a.a.autoplay=!1,c=a.b.load(b.manifest,b.startTime),c[\"catch\"](function(a){this.b.dispatchEvent(new I(\"error\",{detail:a}))}.bind(a)));c.then(function(){var a;for(a in b.video){var c=b.video[a];this.a[a]=c}for(a in b.playerAfterLoad)c=b.playerAfterLoad[a],this.b[a](c);this.a.autoplay=e;b.manifest&&(this.a.play(),L(this,0))}.bind(a))}\nk.mc=function(a,b){this.Cb();Fc(this,{type:\"event\",targetName:a,event:b},this.c)};k.Cb=function(){null!=this.h&&window.clearTimeout(this.h);this.h=window.setTimeout(this.Cb.bind(this),500);var a={video:{},player:{}};lc.forEach(function(b){a.video[b]=this.a[b]}.bind(this));pc.forEach(function(b){a.player[b]=this.b[b]()}.bind(this));var b=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();b&&(a.video.volume=b.level,a.video.muted=b.muted);Fc(this,{type:\"update\",update:a},this.c)};\nk.Mc=function(){var a=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();a&&Fc(this,{type:\"update\",update:{video:{volume:a.level,muted:a.muted}}},this.c);Fc(this,{type:\"event\",targetName:\"video\",event:{type:\"volumechange\"}},this.c)};\nk.vd=function(a){var b=wc(a.data);switch(b.type){case \"init\":Ec(this,b.initState,b.appData);this.Cb();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,\nd=b.methodName,e=b.args,b=b.id,a=a.senderId,c=this.j[c],c[d].apply(c,e).then(this.vc.bind(this,a,b,null),this.vc.bind(this,a,b))}};\nk.hd=function(a){var b=wc(a.data);switch(b.type){case \"PLAY\":this.a.play();L(this,0);break;case \"PAUSE\":this.a.pause();L(this,0);break;case \"SEEK\":a=b.currentTime;var c=b.resumeState;null!=a&&(this.a.currentTime=Number(a));c&&\"PLAYBACK_START\"==c?(this.a.play(),L(this,0)):c&&\"PLAYBACK_PAUSE\"==c&&(this.a.pause(),L(this,0));break;case \"STOP\":this.b.hb().then(function(){L(this,0)}.bind(this));break;case \"GET_STATUS\":L(this,Number(b.requestId));break;case \"VOLUME\":c=b.volume;a=c.level;var c=c.muted,d=\nthis.a.volume,e=this.a.muted;null!=a&&(this.a.volume=Number(a));null!=c&&(this.a.muted=c);d==this.a.volume&&e==this.a.muted||L(this,0);break;case \"LOAD\":c=b.media.contentId;a=b.currentTime;var f=this.o(c);this.a.autoplay=!0;this.b.load(f,a).then(function(){L(this,0,{contentId:f,streamType:this.b.$()?\"LIVE\":\"BUFFERED\",contentType:\"\"})}.bind(this))[\"catch\"](function(a){var c=\"LOAD_FAILED\";7==a.category&&7E3==a.code&&(c=\"LOAD_CANCELLED\");Fc(this,{requestId:Number(b.requestId),type:c},this.g)}.bind(this));\nbreak;default:Fc(this,{requestId:Number(b.requestId),type:\"INVALID_REQUEST\",reason:\"INVALID_COMMAND\"},this.g)}};k.vc=function(a,b,c){Fc(this,{type:\"asyncComplete\",id:b,error:c},this.c,a)};function Fc(a,b,c,d){a.i&&(a=vc(b),d?c.getCastChannel(d).send(a):c.broadcast(a))}\nfunction L(a,b,c){var d=Gc,d={mediaSessionId:0,playbackRate:a.a.playbackRate,playerState:a.f?d.IDLE:a.b.ka?d.Ac:a.a.paused?d.Bc:d.Cc,currentTime:a.a.currentTime,supportedMediaCommands:15,volume:{level:a.a.volume,muted:a.a.muted}};c&&(d.media=c);Fc(a,{requestId:b,type:\"MEDIA_STATUS\",status:[d]},a.g)}var Gc={IDLE:\"IDLE\",Cc:\"PLAYING\",Ac:\"BUFFERING\",Bc:\"PAUSED\"};function Hc(a,b){var c=M(a,b);return 1!=c.length?null:c[0]}function M(a,b){return Array.prototype.filter.call(a.childNodes,function(a){return a.tagName==b})}function Ic(a){var b=a.firstChild;return b&&b.nodeType==Node.TEXT_NODE?a.textContent.trim():null}function N(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 Jc(a){if(!a)return null;a=Date.parse(a);return isNaN(a)?null:Math.floor(a/1E3)}\nfunction Kc(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 Lc(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}\nfunction Mc(a){a=Number(a);return a%1?null:a}function Nc(a){a=Number(a);return!(a%1)&&0<a?a:null}function Oc(a){a=Number(a);return!(a%1)&&0<=a?a:null}function Pc(a){var b;a=(b=a.match(/^(\\d+)\\/(\\d+)$/))?Number(b[1]/b[2]):Number(a);return isNaN(a)?null:a};var Qc={\"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\"};\nfunction Rc(a,b,c){a=Sc(a);var d=null,e=null,f=[],g=[],h=a.map(function(a){return a.keyId}).filter(ya);if(0<h.length&&(e=h[0],h.some(za(e))))throw new t(2,4,4010);c||(g=a.filter(function(a){return\"urn:mpeg:dash:mp4protection:2011\"==a.sc?(d=a.init||d,!1):!0}),0<g.length&&(f=Tc(d,b,g),f.length||(f=[Ba(\"\",d)])));0<a.length&&(c||!g.length)&&(f=Na(Qc).map(function(a){return Ba(a,d)}));e&&f.forEach(function(a){a.initData.forEach(function(a){a.keyId=e})});return{Sb:e,ze:d,drmInfos:f,Ub:!0}}\nfunction Uc(a,b,c,d){var e=Rc(a,b,d);if(c.Ub){a=1==c.drmInfos.length&&!c.drmInfos[0].keySystem;b=!e.drmInfos.length;if(!c.drmInfos.length||a&&!b)c.drmInfos=e.drmInfos;c.Ub=!1}else if(0<e.drmInfos.length&&(c.drmInfos=c.drmInfos.filter(function(a){return e.drmInfos.some(function(b){return b.keySystem==a.keySystem})}),!c.drmInfos.length))throw new t(2,4,4008);return e.Sb||c.Sb}function Tc(a,b,c){return c.map(function(c){var d=Qc[c.sc];return d?[Ba(d,c.init||a)]:b(c.node)||[]}).reduce(x,[])}\nfunction Sc(a){return a.map(function(a){var b=a.getAttribute(\"schemeIdUri\"),d=a.getAttribute(\"cenc:default_KID\"),e=M(a,\"cenc:pssh\").map(Ic);if(!b)return null;b=b.toLowerCase();if(d&&(d=d.replace(/-/g,\"\").toLowerCase(),0<=d.indexOf(\" \")))throw new t(2,4,4009);var f=[];try{f=e.map(function(a){return{initDataType:\"cenc\",initData:Ya(a),keyId:null}})}catch(g){throw new t(2,4,4007);}return{node:a,sc:b,keyId:d,init:0<f.length?f:null}}).filter(ya)};function Vc(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})}\nfunction Wc(a,b){var c=Xc(a,b,\"timescale\"),d=1;c&&(d=Nc(c)||1);c=Xc(a,b,\"duration\");(c=Nc(c||\"\"))&&(c/=d);var e=Xc(a,b,\"startNumber\"),f=Xc(a,b,\"presentationTimeOffset\"),g=Oc(e||\"\");if(null==e||null==g)g=1;var h=Yc(a,b,\"SegmentTimeline\"),e=null;if(h){for(var e=d,l=Number(f),m=a.R.duration||Infinity,h=M(h,\"S\"),q=[],r=0,v=0;v<h.length;++v){var u=h[v],w=N(u,\"t\",Oc),G=N(u,\"d\",Oc),u=N(u,\"r\",Mc);null!=w&&(w-=l);if(!G)break;w=null!=w?w:r;u=u||0;if(0>u)if(v+1<h.length){u=N(h[v+1],\"t\",Oc);if(null==u)break;\nelse if(w>=u)break;u=Math.ceil((u-w)/G)-1}else{if(Infinity==m)break;else if(w/e>=m)break;u=Math.ceil((m*e-w)/G)-1}0<q.length&&w!=r&&(q[q.length-1].end=w/e);for(var pa=0;pa<=u;++pa)r=w+G,q.push({start:w/e,end:r/e,qe:w}),w=r}e=q}return{timescale:d,P:c,za:g,presentationTimeOffset:Number(f)/d||0,Pb:Number(f),F:e}}function Xc(a,b,c){return[b(a.w),b(a.S),b(a.T)].filter(ya).map(function(a){return a.getAttribute(c)}).reduce(function(a,b){return a||b})}\nfunction Yc(a,b,c){return[b(a.w),b(a.S),b(a.T)].filter(ya).map(function(a){return Hc(a,c)}).reduce(function(a,b){return a||b})};function Zc(a,b,c){this.a=a;this.X=b;this.M=c}n(\"shaka.media.InitSegmentReference\",Zc);function O(a,b,c,d,e,f){this.position=a;this.startTime=b;this.endTime=c;this.a=d;this.X=e;this.M=f}n(\"shaka.media.SegmentReference\",O);function P(a,b){this.H=a;this.a=b==$c;this.u=0}n(\"shaka.util.DataViewReader\",P);var $c=1;P.Endianness={ve:0,xe:$c};P.prototype.Z=function(){return this.u<this.H.byteLength};P.prototype.hasMoreData=P.prototype.Z;P.prototype.Vc=function(){return this.u};P.prototype.getPosition=P.prototype.Vc;P.prototype.Qc=function(){return this.H.byteLength};P.prototype.getLength=P.prototype.Qc;P.prototype.Eb=function(){try{var a=this.H.getUint8(this.u)}catch(b){ad()}this.u+=1;return a};P.prototype.readUint8=P.prototype.Eb;\nP.prototype.oc=function(){try{var a=this.H.getUint16(this.u,this.a)}catch(b){ad()}this.u+=2;return a};P.prototype.readUint16=P.prototype.oc;P.prototype.D=function(){try{var a=this.H.getUint32(this.u,this.a)}catch(b){ad()}this.u+=4;return a};P.prototype.readUint32=P.prototype.D;P.prototype.nc=function(){try{var a=this.H.getInt32(this.u,this.a)}catch(b){ad()}this.u+=4;return a};P.prototype.readInt32=P.prototype.nc;\nP.prototype.Pa=function(){try{if(this.a){var a=this.H.getUint32(this.u,!0);var b=this.H.getUint32(this.u+4,!0)}else b=this.H.getUint32(this.u,!1),a=this.H.getUint32(this.u+4,!1)}catch(c){ad()}if(2097151<b)throw new t(2,3,3001);this.u+=8;return b*Math.pow(2,32)+a};P.prototype.readUint64=P.prototype.Pa;P.prototype.Ka=function(a){this.u+a>this.H.byteLength&&ad();var b=this.H.buffer.slice(this.u,this.u+a);this.u+=a;return new Uint8Array(b)};P.prototype.readBytes=P.prototype.Ka;\nP.prototype.I=function(a){this.u+a>this.H.byteLength&&ad();this.u+=a};P.prototype.skip=P.prototype.I;P.prototype.Db=function(){for(var a=this.u;this.Z()&&this.H.getUint8(this.u);)this.u+=1;a=this.H.buffer.slice(a,this.u);this.u+=1;return F(a)};P.prototype.readTerminatedString=P.prototype.Db;function ad(){throw new t(2,3,3E3);};function Q(){this.b=[];this.a=[]}n(\"shaka.util.Mp4Parser\",Q);Q.prototype.C=function(a,b){var c=bd(a);this.b[c]=0;this.a[c]=b;return this};Q.prototype.box=Q.prototype.C;Q.prototype.da=function(a,b){var c=bd(a);this.b[c]=1;this.a[c]=b;return this};Q.prototype.fullBox=Q.prototype.da;Q.prototype.parse=function(a){for(a=new P(new DataView(a),0);a.Z();)this.eb(0,a)};Q.prototype.parse=Q.prototype.parse;\nQ.prototype.eb=function(a,b){var c=b.u,d=b.D(),e=b.D();switch(d){case 0:d=b.H.byteLength-c;break;case 1:d=b.Pa()}var f=this.a[e];if(f){var g=null,h=null;1==this.b[e]&&(h=b.D(),g=h>>>24,h&=16777215);e=c+d-b.u;e=0<e?b.Ka(e).buffer:new ArrayBuffer(0);e=new P(new DataView(e),0);f({Na:this,version:g,Nc:h,s:e,size:d,start:c+a})}else b.I(c+d-b.u)};Q.prototype.parseNext=Q.prototype.eb;function R(a){for(;a.s.Z();)a.Na.eb(a.start,a.s)}Q.children=R;\nfunction cd(a){for(var b=a.s.D();0<b;--b)a.Na.eb(a.start,a.s)}Q.sampleDescription=cd;function dd(a){return function(b){a(b.s.Ka(b.s.H.byteLength-b.s.u))}}Q.allData=dd;function bd(a){for(var b=0,c=0;c<a.length;c++)b=b<<8|a.charCodeAt(c);return b};function ed(a,b,c,d){var e,f=(new Q).da(\"sidx\",function(a){e=fd(b,d,c,a)});a&&f.parse(a);if(e)return e;throw new t(2,3,3004);}\nfunction fd(a,b,c,d){var e=[];d.s.I(4);var f=d.s.D();if(!f)throw new t(2,3,3005);if(d.version){var g=d.s.Pa();var h=d.s.Pa()}else g=d.s.D(),h=d.s.D();d.s.I(2);var l=d.s.oc();b=g-b;a=a+d.size+h;for(h=0;h<l;h++){var m=d.s.D();g=(m&2147483648)>>>31;var m=m&2147483647,q=d.s.D();d.s.I(4);if(1==g)throw new t(2,3,3006);e.push(new O(e.length,b/f,(b+q)/f,function(){return c},a,a+m-1));b+=q;a+=m}return e};function S(a){this.a=a}n(\"shaka.media.SegmentIndex\",S);S.prototype.m=function(){this.a=null;return Promise.resolve()};S.prototype.destroy=S.prototype.m;S.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 this.a.length&&a<this.a[0].startTime?this.a[0].position:null};S.prototype.find=S.prototype.find;S.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]};\nS.prototype.get=S.prototype.get;S.prototype.xb=function(a){for(var b,c,d=[],e=c=0;c<this.a.length&&e<a.length;){var f=this.a[c];b=a[e];f.startTime<b.startTime?(d.push(f),c++):(f.startTime>b.startTime||(.1<Math.abs(f.endTime-b.endTime)?d.push(b):d.push(f),c++),e++)}for(;c<this.a.length;)d.push(this.a[c++]);if(d.length)for(c=d[d.length-1].position+1;e<a.length;)b=a[e++],b=new O(c++,b.startTime,b.endTime,b.a,b.X,b.M),d.push(b);else d=a;this.a=d};S.prototype.merge=S.prototype.xb;\nS.prototype.qb=function(a){for(var b=0;b<this.a.length&&!(this.a[b].endTime>a);++b);this.a.splice(0,b)};S.prototype.evict=S.prototype.qb;function gd(a,b){if(a.a.length){var c=a.a[a.a.length-1];c.startTime>b||(a.a[a.a.length-1]=new O(c.position,c.startTime,b,c.a,c.X,c.M))}};function hd(a){this.b=a;this.a=new P(a,0);id||(id=[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 id;hd.prototype.Z=function(){return this.a.Z()};\nfunction jd(a){var b=kd(a);if(7<b.length)throw new t(2,3,3002);for(var c=0,d=0;d<b.length;d++)c=256*c+b[d];b=c;c=kd(a);a:{for(d=0;d<id.length;d++)if(ab(c,id[d])){d=!0;break a}d=!1}if(d)c=a.b.byteLength-a.a.u;else{if(8==c.length&&c[1]&224)throw new t(2,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.u+c<=a.b.byteLength?c:a.b.byteLength-a.a.u;d=new DataView(a.b.buffer,a.b.byteOffset+a.a.u,c);a.a.I(c);return new ld(b,d)}\nfunction kd(a){var b=a.a.Eb(),c;for(c=1;8>=c&&!(b&1<<8-c);c++);if(8<c)throw new t(2,3,3002);var d=new Uint8Array(c);d[0]=b;for(b=1;b<c;b++)d[b]=a.a.Eb();return d}function ld(a,b){this.id=a;this.a=b}function md(a){if(8<a.a.byteLength)throw new t(2,3,3002);if(8==a.a.byteLength&&a.a.getUint8(0)&224)throw new t(2,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 nd(){}\nnd.prototype.parse=function(a,b,c,d){var e;b=new hd(new DataView(b));if(440786851!=jd(b).id)throw new t(2,3,3008);var f=jd(b);if(408125543!=f.id)throw new t(2,3,3009);b=f.a.byteOffset;f=new hd(f.a);for(e=null;f.Z();){var g=jd(f);if(357149030==g.id){e=g;break}}if(!e)throw new t(2,3,3010);f=new hd(e.a);e=1E6;for(g=null;f.Z();){var h=jd(f);if(2807729==h.id)e=md(h);else if(17545==h.id)if(g=h,4==g.a.byteLength)g=g.a.getFloat32(0);else if(8==g.a.byteLength)g=g.a.getFloat64(0);else throw new t(2,3,3003);\n}if(null==g)throw new t(2,3,3011);f=e/1E9;e=g*f;a=jd(new hd(new DataView(a)));if(475249515!=a.id)throw new t(2,3,3007);return od(a,b,f,e,c,d)};function od(a,b,c,d,e,f){function g(){return e}var h=[];a=new hd(a.a);for(var l=-1,m=-1;a.Z();){var q=jd(a);if(187==q.id){var r=pd(q);r&&(q=c*(r.re-f),r=b+r.Nd,0<=l&&h.push(new O(h.length,l,q,g,m,r-1)),l=q,m=r)}}0<=l&&h.push(new O(h.length,l,d,g,m,null));return h}\nfunction pd(a){var b=new hd(a.a);a=jd(b);if(179!=a.id)throw new t(2,3,3013);a=md(a);b=jd(b);if(183!=b.id)throw new t(2,3,3012);for(var b=new hd(b.a),c=0;b.Z();){var d=jd(b);if(241==d.id){c=md(d);break}}return{re:a,Nd:c}};function qd(a,b){var c=Yc(a,b,\"Initialization\");if(!c)return null;var d=a.w.U,e=c.getAttribute(\"sourceURL\");e&&(d=z(a.w.U,[e]));var e=0,f=null;if(c=N(c,\"range\",Lc))e=c.start,f=c.end;return new Zc(function(){return d},e,f)}\nfunction rd(a,b){var c=Xc(a,sd,\"presentationTimeOffset\"),d=qd(a,sd);var e=Number(c);var f=a.w.contentType,g=a.w.mimeType.split(\"/\")[1];if(\"text\"!=f&&\"mp4\"!=g&&\"webm\"!=g)throw new t(2,4,4006);if(\"webm\"==g&&!d)throw new t(2,4,4005);var f=Yc(a,sd,\"RepresentationIndex\"),h=Xc(a,sd,\"indexRange\"),l=a.w.U,h=Lc(h||\"\");if(f){var m=f.getAttribute(\"sourceURL\");m&&(l=z(a.w.U,[m]));h=N(f,\"range\",Lc,h)}if(!h)throw new t(2,4,4002);e=td(a,b,d,l,h.start,h.end,g,e);return{createSegmentIndex:e.createSegmentIndex,findSegmentPosition:e.findSegmentPosition,\ngetSegmentReference:e.getSegmentReference,initSegmentReference:d,presentationTimeOffset:Number(c)||0}}\nfunction td(a,b,c,d,e,f,g,h){var l=a.presentationTimeline,m=!a.Da||!a.R.ub,q=a.R.duration,r=b,v=null;return{createSegmentIndex:function(){var a=[r(d,e,f),\"webm\"==g?r(c.a(),c.X,c.M):null];r=null;return Promise.all(a).then(function(a){var b=a[0];a=a[1]||null;b=\"mp4\"==g?ed(b,e,d,h):(new nd).parse(b,a,d,h);l.Ha(0,b);v=new S(b);m&&gd(v,q)})},findSegmentPosition:function(a){return v.find(a)},getSegmentReference:function(a){return v.get(a)}}}function sd(a){return a.Qa};function ud(a,b){var c=qd(a,vd);var d=wd(a);var e=Wc(a,vd),f=e.za;f||(f=1);var g=0;e.P?g=e.P*(f-1):e.F&&0<e.F.length&&(g=e.F[0].start);d={P:e.P,startTime:g,za:f,presentationTimeOffset:e.presentationTimeOffset,F:e.F,Ga:d};if(!d.P&&!d.F&&1<d.Ga.length)throw new t(2,4,4002);if(!d.P&&!a.R.duration&&!d.F&&1==d.Ga.length)throw new t(2,4,4002);if(d.F&&!d.F.length)throw new t(2,4,4002);f=e=null;a.T.id&&a.w.id&&(f=a.T.id+\",\"+a.w.id,e=b[f]);g=xd(a.R.duration,d.za,a.w.U,d);e?(e.xb(g),e.qb(a.presentationTimeline.ma()-\na.R.start)):(a.presentationTimeline.Ha(0,g),e=new S(g),f&&a.Da&&(b[f]=e));a.Da&&a.R.ub||gd(e,a.R.duration);return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:e.find.bind(e),getSegmentReference:e.get.bind(e),initSegmentReference:c,presentationTimeOffset:d.presentationTimeOffset}}function vd(a){return a.oa}\nfunction xd(a,b,c,d){var e=d.Ga.length;d.F&&d.F.length!=d.Ga.length&&(e=Math.min(d.F.length,d.Ga.length));for(var f=[],g=d.startTime,h=0;h<e;h++){var l=d.Ga[h],m=z(c,[l.cd]);var q=null!=d.P?g+d.P:d.F?d.F[h].end:g+a;f.push(new O(h+b,g,q,function(a){return a}.bind(null,m),l.start,l.end));g=q}return f}\nfunction wd(a){return[a.w.oa,a.S.oa,a.T.oa].filter(ya).map(function(a){return M(a,\"SegmentURL\")}).reduce(function(a,c){return 0<a.length?a:c}).map(function(b){b.getAttribute(\"indexRange\")&&!a.$b&&(a.$b=!0);var c=b.getAttribute(\"media\");b=N(b,\"mediaRange\",Lc,{start:0,end:null});return{cd:c,start:b.start,end:b.end}})};function yd(a,b,c,d){var e=zd(a);var f=Wc(a,Ad);var g=Xc(a,Ad,\"media\"),h=Xc(a,Ad,\"index\");f={P:f.P,timescale:f.timescale,za:f.za,presentationTimeOffset:f.presentationTimeOffset,Pb:f.Pb,F:f.F,wb:g,Ma:h};g=0+(f.Ma?1:0);g+=f.F?1:0;g+=f.P?1:0;if(!g)throw new t(2,4,4002);1!=g&&(f.Ma&&(f.F=null),f.P=null);if(!f.Ma&&!f.wb)throw new t(2,4,4002);if(f.Ma){c=a.w.mimeType.split(\"/\")[1];if(\"mp4\"!=c&&\"webm\"!=c)throw new t(2,4,4006);if(\"webm\"==c&&!e)throw new t(2,4,4005);d=Vc(f.Ma,a.w.id,null,a.bandwidth||null,\nnull);d=z(a.w.U,[d]);a=td(a,b,e,d,0,null,c,f.presentationTimeOffset)}else f.P?(d||a.presentationTimeline.yb(f.P),a=Bd(a,f)):(d=b=null,a.T.id&&a.w.id&&(d=a.T.id+\",\"+a.w.id,b=c[d]),g=Cd(a,f),b?(b.xb(g),b.qb(a.presentationTimeline.ma()-a.R.start)):(a.presentationTimeline.Ha(0,g),b=new S(g),d&&a.Da&&(c[d]=b)),a.Da&&a.R.ub||gd(b,a.R.duration),a={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:b.find.bind(b),getSegmentReference:b.get.bind(b)});return{createSegmentIndex:a.createSegmentIndex,\nfindSegmentPosition:a.findSegmentPosition,getSegmentReference:a.getSegmentReference,initSegmentReference:e,presentationTimeOffset:f.presentationTimeOffset}}function Ad(a){return a.Ra}\nfunction Bd(a,b){var c=a.R.duration,d=b.P,e=b.za,f=b.timescale,g=b.wb,h=a.bandwidth||null,l=a.w.id,m=a.w.U;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(a){return 0>a||c&&a>=c?null:Math.floor(a/d)},getSegmentReference:function(a){var b=a*d;return 0>b||c&&b>=c?null:new O(a,b,b+d,function(){var c=Vc(g,l,a+e,h,b*f);return z(m,[c])},0,null)}}}\nfunction Cd(a,b){for(var c=[],d=0;d<b.F.length;d++){var e=d+b.za;c.push(new O(e,b.F[d].start,b.F[d].end,function(a,b,c,d,e,q){a=Vc(a,b,e,c,q);return z(d,[a]).map(function(a){return a.toString()})}.bind(null,b.wb,a.w.id,a.bandwidth||null,a.w.U,e,b.F[d].qe+b.Pb),0,null))}return c}function zd(a){var b=Xc(a,Ad,\"initialization\");if(!b)return null;var c=a.w.id,d=a.bandwidth||null,e=a.w.U;return new Zc(function(){var a=Vc(b,c,null,d,null);return z(e,[a])},0,null)};var Dd={},Ed={};n(\"shaka.media.ManifestParser.registerParserByExtension\",function(a,b){Ed[a]=b});n(\"shaka.media.ManifestParser.registerParserByMime\",function(a,b){Dd[a]=b});function Fd(){var a={},b;for(b in Dd)a[b]=!0;for(b in Ed)a[b]=!0;[\"application/dash+xml\",\"application/x-mpegurl\",\"application/vnd.apple.mpegurl\",\"application/vnd.ms-sstr+xml\"].forEach(function(b){a[b]=!!Dd[b]});[\"mpd\",\"m3u8\",\"ism\"].forEach(function(b){a[b]=!!Ed[b]});return a}\nfunction Gd(a,b,c,d){var e=d;e||(d=(new ia(a)).W.split(\"/\").pop().split(\".\"),1<d.length&&(d=d.pop().toLowerCase(),e=Ed[d]));if(e)return Promise.resolve(e);c=C([a],c);c.method=\"HEAD\";return b.request(0,c).then(function(b){(b=b.headers[\"content-type\"])&&(b=b.toLowerCase());return(e=Dd[b])?e:Promise.reject(new t(2,4,4E3,a))},function(a){a.severity=2;return Promise.reject(a)})};function T(a,b){this.f=a;this.i=b;this.c=this.a=Infinity;this.b=1;this.h=0;this.g=!0}n(\"shaka.media.PresentationTimeline\",T);T.prototype.Y=function(){return this.a};T.prototype.getDuration=T.prototype.Y;T.prototype.pa=function(a){this.a=a};T.prototype.setDuration=T.prototype.pa;T.prototype.Wc=function(){return this.f};T.prototype.getPresentationStartTime=T.prototype.Wc;T.prototype.wc=function(a){this.h=a};T.prototype.setClockOffset=T.prototype.wc;T.prototype.yc=function(a){this.g=a};\nT.prototype.setStatic=T.prototype.yc;T.prototype.Xc=function(){return this.c};T.prototype.getSegmentAvailabilityDuration=T.prototype.Xc;T.prototype.xc=function(a){this.c=a};T.prototype.setSegmentAvailabilityDuration=T.prototype.xc;T.prototype.Ha=function(a,b){b.length&&(this.b=b.reduce(function(a,b){return Math.max(a,b.endTime-b.startTime)},this.b))};T.prototype.notifySegments=T.prototype.Ha;T.prototype.yb=function(a){this.b=Math.max(this.b,a)};T.prototype.notifyMaxSegmentDuration=T.prototype.yb;\nT.prototype.$=function(){return Infinity==this.a&&!this.g};T.prototype.isLive=T.prototype.$;T.prototype.va=function(){return Infinity!=this.a&&!this.g};T.prototype.isInProgress=T.prototype.va;T.prototype.ma=function(){return this.Ea(0)};T.prototype.getSegmentAvailabilityStart=T.prototype.ma;T.prototype.Ea=function(a){if(Infinity==this.c)return 0;var b=this.ua();return Math.max(0,Math.min(b-this.c+a,b))};T.prototype.getSafeAvailabilityStart=T.prototype.Ea;\nT.prototype.ua=function(){return this.$()||this.va()?Math.min(Math.max(0,(Date.now()+this.h)/1E3-this.b-this.f),this.a):this.a};T.prototype.getSegmentAvailabilityEnd=T.prototype.ua;T.prototype.bb=function(){return Math.max(0,this.ua()-(this.$()||this.va()?this.i:0))};T.prototype.getSeekRangeEnd=T.prototype.bb;function Hd(){this.a=this.b=null;this.g=[];this.c=null;this.i=[];this.h=1;this.j={};this.l=0;this.f=null}n(\"shaka.dash.DashParser\",Hd);k=Hd.prototype;k.configure=function(a){this.b=a};k.start=function(a,b){this.g=[a];this.a=b;return Id(this).then(function(){this.a&&Jd(this,0);return this.c}.bind(this))};k.stop=function(){this.b=this.a=null;this.g=[];this.c=null;this.i=[];this.j={};null!=this.f&&(window.clearTimeout(this.f),this.f=null);return Promise.resolve()};k.update=function(){Id(this)[\"catch\"](function(a){if(this.a)this.a.onError(a)}.bind(this))};\nk.onExpirationUpdated=function(){};function Id(a){return a.a.networkingEngine.request(0,C(a.g,a.b.retryParameters)).then(function(a){if(this.a)return Kd(this,a.data,a.uri)}.bind(a))}\nfunction Kd(a,b,c){var d=F(b),e=new DOMParser,f=null;b=null;try{f=e.parseFromString(d,\"text/xml\")}catch(v){}f&&\"MPD\"==f.documentElement.tagName&&(b=f.documentElement);b&&0<b.getElementsByTagName(\"parsererror\").length&&(b=null);if(!b)throw new t(2,4,4001);c=[c];d=M(b,\"Location\").map(Ic).filter(ya);0<d.length&&(c=a.g=d);d=M(b,\"BaseURL\").map(Ic);c=z(c,d);var g=N(b,\"minBufferTime\",Kc);a.l=N(b,\"minimumUpdatePeriod\",Kc,-1);var h=N(b,\"availabilityStartTime\",Jc),d=N(b,\"timeShiftBufferDepth\",Kc),l=N(b,\"suggestedPresentationDelay\",\nKc),e=N(b,\"maxSegmentDuration\",Kc),f=b.getAttribute(\"type\")||\"static\";if(a.c)var m=a.c.presentationTimeline;else{var q=Math.max(10,1.5*g);m=new T(h,null!=l?l:q)}var h=Ld(a,{Da:\"static\"!=f,presentationTimeline:m,T:null,R:null,S:null,w:null,bandwidth:void 0,$b:!1},c,b),l=h.duration,r=h.periods;m.yc(\"static\"==f);m.pa(l||Infinity);m.xc(null!=d?d:Infinity);m.yb(e||1);if(a.c)return Promise.resolve();b=M(b,\"UTCTiming\");return Md(a,c,b,m.$()).then(function(a){this.a&&(m.wc(a),this.c={presentationTimeline:m,\nperiods:r,offlineSessionIds:[],minBufferTime:g||0})}.bind(a))}\nfunction Ld(a,b,c,d){var e=N(d,\"mediaPresentationDuration\",Kc),f=[],g=0;d=M(d,\"Period\");for(var h=0;h<d.length;h++){var l=d[h],g=N(l,\"start\",Kc,g),m=N(l,\"duration\",Kc),q=null;if(h!=d.length-1){var r=N(d[h+1],\"start\",Kc);null!=r&&(q=r-g)}else null!=e&&(q=e-g);null==q&&(q=m);l=Nd(a,b,c,{start:g,duration:q,node:l,ub:null==q||h==d.length-1});f.push(l);m=b.T.id;a.i.every(za(m))&&(a.a.filterPeriod(l),a.i.push(m),a.c&&a.c.periods.push(l));if(null==q){g=null;break}g+=q}return null!=e?{periods:f,duration:e}:\n{periods:f,duration:g}}\nfunction Nd(a,b,c,d){b.T=Od(d.node,null,c);b.R=d;b.T.id||(b.T.id=\"__shaka_period_\"+d.start);M(d.node,\"EventStream\").forEach(a.Fd.bind(a,d.start,d.duration));c=M(d.node,\"AdaptationSet\").map(a.Dd.bind(a,b)).filter(ya);var e=c.map(function(a){return a.Pd}).reduce(x,[]),f=e.filter(Aa);if(b.Da&&e.length!=f.length)throw new t(2,4,4018);var g=c.filter(function(a){return!a.Ob});c.filter(function(a){return a.Ob}).forEach(function(a){var b=a.streams[0],c=a.Ob;g.forEach(function(a){a.id==c&&a.streams.forEach(function(a){a.trickModeVideo=\nb})})});e=Pd(g,\"video\");f=Pd(g,\"audio\");if(!e.length&&!f.length)throw new t(2,4,4004);f.length||(f=[null]);e.length||(e=[null]);b=[];for(c=0;c<f.length;c++)for(var h=0;h<e.length;h++)Qd(a,f[c],e[h],b);a=Pd(g,\"text\");e=[];for(c=0;c<a.length;c++)e.push.apply(e,a[c].streams);return{startTime:d.start,textStreams:e,variants:b}}function Pd(a,b){return a.filter(function(a){return a.contentType==b})}\nfunction Qd(a,b,c,d){if(b||c)if(b&&c){var e=b.drmInfos;var f=c.drmInfos;if(e.length&&f.length?0<sb(e,f).length:1)for(var g=sb(b.drmInfos,c.drmInfos),e=0;e<b.streams.length;e++)for(var h=0;h<c.streams.length;h++)f=c.streams[h].bandwidth+b.streams[e].bandwidth,f={id:a.h++,language:b.language,primary:b.vb||c.vb,audio:b.streams[e],video:c.streams[h],bandwidth:f,drmInfos:g,allowedByApplication:!0,allowedByKeySystem:!0},d.push(f)}else for(g=b||c,e=0;e<g.streams.length;e++)f=g.streams[e].bandwidth,f={id:a.h++,\nlanguage:g.language||\"und\",primary:g.vb,audio:b?g.streams[e]:null,video:c?g.streams[e]:null,bandwidth:f,drmInfos:g.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},d.push(f)}\nk.Dd=function(a,b){a.S=Od(b,a.T,null);var c=!1,d=M(b,\"Role\"),e=d.map(function(a){return a.getAttribute(\"value\")}).filter(ya),f=void 0;\"text\"==a.S.contentType&&(f=\"subtitle\");for(var g=0;g<d.length;g++){var h=d[g].getAttribute(\"schemeIdUri\");if(null==h||\"urn:mpeg:dash:role:2011\"==h)switch(h=d[g].getAttribute(\"value\"),h){case \"main\":c=!0;break;case \"caption\":case \"subtitle\":f=h}}var l=null,m=!1;M(b,\"EssentialProperty\").forEach(function(a){\"http://dashif.org/guidelines/trickmode\"==a.getAttribute(\"schemeIdUri\")?\nl=a.getAttribute(\"value\"):m=!0});if(m)return null;var d=M(b,\"ContentProtection\"),q=Rc(d,this.b.dash.customScheme,this.b.dash.ignoreDrmInfo),d=Sb(b.getAttribute(\"lang\")||\"und\"),h=b.getAttribute(\"label\"),g=M(b,\"Representation\"),e=g.map(this.Gd.bind(this,a,q,f,d,h,c,e)).filter(function(a){return!!a});if(!e.length)throw new t(2,4,4003);a.S.contentType&&\"application\"!=a.S.contentType||(a.S.contentType=Rd(e[0].mimeType,e[0].codecs),e.forEach(function(b){b.type=a.S.contentType}));e.forEach(function(a){q.drmInfos.forEach(function(b){a.keyId&&\nb.keyIds.push(a.keyId)})});f=g.map(function(a){return a.getAttribute(\"id\")}).filter(ya);return{id:a.S.id||\"__fake__\"+this.h++,contentType:a.S.contentType,language:d,vb:c,streams:e,drmInfos:q.drmInfos,Ob:l,Pd:f}};\nk.Gd=function(a,b,c,d,e,f,g,h){a.w=Od(h,a.S,null);if(!Sd(a.w))return null;a.bandwidth=N(h,\"bandwidth\",Nc)||void 0;var l=this.Qd.bind(this);if(a.w.Qa)l=rd(a,l);else if(a.w.oa)l=ud(a,this.j);else if(a.w.Ra)l=yd(a,l,this.j,!!this.c);else{var m=a.w.U,q=a.R.duration||0;l={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(a){return 0<=a&&a<q?1:null},getSegmentReference:function(a){return 1!=a?null:new O(1,0,q,function(){return m},0,null)},initSegmentReference:null,presentationTimeOffset:0}}h=\nM(h,\"ContentProtection\");h=Uc(h,this.b.dash.customScheme,b,this.b.dash.ignoreDrmInfo);return{id:this.h++,createSegmentIndex:l.createSegmentIndex,findSegmentPosition:l.findSegmentPosition,getSegmentReference:l.getSegmentReference,initSegmentReference:l.initSegmentReference,presentationTimeOffset:l.presentationTimeOffset,mimeType:a.w.mimeType,codecs:a.w.codecs,frameRate:a.w.frameRate,bandwidth:a.bandwidth,width:a.w.width,height:a.w.height,kind:c,encrypted:0<b.drmInfos.length,keyId:h,language:d,label:e,\ntype:a.S.contentType,primary:f,trickModeVideo:null,containsEmsgBoxes:a.w.containsEmsgBoxes,roles:g}};k.he=function(){this.f=null;var a=Date.now();Id(this).then(function(){this.a&&Jd(this,(Date.now()-a)/1E3)}.bind(this))[\"catch\"](function(a){this.a&&(a.severity=1,this.a.onError(a),Jd(this,0))}.bind(this))};function Jd(a,b){0>a.l||(a.f=window.setTimeout(a.he.bind(a),1E3*Math.max(Math.max(3,a.l)-b,0)))}\nfunction Od(a,b,c){b=b||{contentType:\"\",mimeType:\"\",codecs:\"\",containsEmsgBoxes:!1,frameRate:void 0};c=c||b.U;var d=M(a,\"BaseURL\").map(Ic),e=a.getAttribute(\"contentType\")||b.contentType,f=a.getAttribute(\"mimeType\")||b.mimeType,g=a.getAttribute(\"codecs\")||b.codecs,h=N(a,\"frameRate\",Pc)||b.frameRate,l=!!M(a,\"InbandEventStream\").length;e||(e=Rd(f,g));return{U:z(c,d),Qa:Hc(a,\"SegmentBase\")||b.Qa,oa:Hc(a,\"SegmentList\")||b.oa,Ra:Hc(a,\"SegmentTemplate\")||b.Ra,width:N(a,\"width\",Oc)||b.width,height:N(a,\"height\",\nOc)||b.height,contentType:e,mimeType:f,codecs:g,frameRate:h,containsEmsgBoxes:l||b.containsEmsgBoxes,id:a.getAttribute(\"id\")}}function Sd(a){var b=0+(a.Qa?1:0);b+=a.oa?1:0;b+=a.Ra?1:0;if(!b)return\"text\"==a.contentType||\"application\"==a.contentType?!0:!1;1!=b&&(a.Qa&&(a.oa=null),a.Ra=null);return!0}\nfunction Td(a,b,c,d){b=z(b,[c]);b=C(b,a.b.retryParameters);b.method=d;return a.a.networkingEngine.request(0,b).then(function(a){if(\"HEAD\"==d){if(!a.headers||!a.headers.date)return 0;a=a.headers.date}else a=F(a.data);a=Date.parse(a);return isNaN(a)?0:a-Date.now()})}\nfunction Md(a,b,c,d){c=c.map(function(a){return{scheme:a.getAttribute(\"schemeIdUri\"),value:a.getAttribute(\"value\")}});var e=a.b.dash.clockSyncUri;d&&!c.length&&e&&c.push({scheme:\"urn:mpeg:dash:utc:http-head:2014\",value:e});return xa(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 Td(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 Td(this,\nb,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})}\nk.Fd=function(a,b,c){var d=c.getAttribute(\"schemeIdUri\")||\"\",e=c.getAttribute(\"value\")||\"\",f=N(c,\"timescale\",Oc)||1;M(c,\"Event\").forEach(function(c){var g=N(c,\"presentationTime\",Oc)||0,l=N(c,\"duration\",Oc)||0,g=g/f+a,l=g+l/f;null!=b&&(g=Math.min(g,a+b),l=Math.min(l,a+b));c={schemeIdUri:d,value:e,startTime:g,endTime:l,id:c.getAttribute(\"id\")||\"\",eventElement:c};this.a.onTimelineRegionAdded(c)}.bind(this))};\nk.Qd=function(a,b,c){a=C(a,this.b.retryParameters);null!=b&&(a.headers.Range=\"bytes=\"+b+\"-\"+(null!=c?c:\"\"));return this.a.networkingEngine.request(1,a).then(function(a){return a.data})};function Rd(a,b){return ub[Yb(a,b)]?\"text\":a.split(\"/\")[0]}Ed.mpd=Hd;Dd[\"application/dash+xml\"]=Hd;function Ud(a,b,c,d){this.uri=a;this.type=b;this.ga=c;this.segments=d||null}function Vd(a,b,c,d){this.id=a;this.name=b;this.a=c;this.value=d||null}Vd.prototype.toString=function(){function a(a){return a.name+'=\"'+a.value+'\"'}return this.value?\"#\"+this.name+\":\"+this.value:0<this.a.length?\"#\"+this.name+\":\"+this.a.map(a).join(\",\"):\"#\"+this.name};function Wd(a,b){this.name=a;this.value=b}Vd.prototype.getAttribute=function(a){var b=this.a.filter(function(b){return b.name==a});return b.length?b[0]:null};\nfunction Xd(a,b,c){c=c||null;return(a=a.getAttribute(b))?a.value:c}function Yd(a,b){this.ga=b;this.uri=a};function Zd(a,b){return a.filter(function(a){return a.name==b})}function $d(a,b){var c=Zd(a,b);return c.length?c[0]:null}function ae(a,b,c){return a.filter(function(a){var d=a.getAttribute(\"TYPE\");a=a.getAttribute(\"GROUP-ID\");return d.value==b&&a.value==c})};function be(a){this.b=a;this.a=0}function ce(a,b){b.lastIndex=a.a;var c=(c=b.exec(a.b))?{position:c.index,length:c[0].length,Sd:c}:null;if(a.a==a.b.length||!c||c.position!=a.a)return null;a.a+=c.length;return c.Sd}function de(a){return a.a==a.b.length?null:(a=ce(a,/[^ \\t\\n]*/gm))?a[0]:null};function ee(){this.a=0}\nfunction fe(a,b,c){b=F(b);b=b.replace(/\\r\\n|\\r(?=[^\\n]|$)/gm,\"\\n\").trim();var d=b.split(/\\n+/m);if(!/^#EXTM3U($|[ \\t\\n])/m.test(d[0]))throw new t(2,4,4015);b=0;for(var e=[],f=1;f<d.length;)if(/^#(?!EXT)/m.test(d[f]))f+=1;else{var g=d[f];g=ge(a.a++,g);if(0<=he.indexOf(g.name))b=1;else if(0<=ie.indexOf(g.name)){if(1!=b)throw new t(2,4,4017);d=d.splice(f,d.length-f);a=je(a,d);return new Ud(c,b,e,a)}e.push(g);f+=1;\"EXT-X-STREAM-INF\"==g.name&&(g.a.push(new Wd(\"URI\",d[f])),f+=1)}return new Ud(c,b,e)}\nfunction je(a,b){var c=[],d=[];b.forEach(function(a){/^(#EXT)/.test(a)?(a=ge(this.a++,a),d.push(a)):/^#(?!EXT)/m.test(a)||(c.push(new Yd(a.trim(),d)),d=[])}.bind(a));return c}function ge(a,b){var c=b.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!c)throw new t(2,4,4016);var d=c[1],e=c[2],c=[];if(e&&0<=e.indexOf(\"=\"))for(var e=new be(e),f,g=/([^=]+)=(?:\"([^\"]*)\"|([^\",]*))(?:,|$)/g;f=ce(e,g);)c.push(new Wd(f[1],f[2]||f[3]));else if(e)return new Vd(a,d,c,e);return new Vd(a,d,c)}\nvar he=\"EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-MAP EXT-X-I-FRAMES-ONLY\".split(\" \"),ie=\"EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE\".split(\" \");function ke(a){return new Promise(function(b){var c=ke.parse(a);b({uri:a,data:c.data,headers:{\"content-type\":c.contentType}})})}n(\"shaka.net.DataUriPlugin\",ke);\nke.parse=function(a){var b=a.split(\":\");if(2>b.length||\"data\"!=b[0])throw new t(2,1,1004,a);b=b.slice(1).join(\":\").split(\",\");if(2>b.length)throw new t(2,1,1004,a);var c=b[0],b=window.decodeURIComponent(b.slice(1).join(\",\")),c=c.split(\";\"),d=null;1<c.length&&(d=c[1]);if(\"base64\"==d)a=Ya(b).buffer;else{if(d)throw new t(2,1,1005,a);a=Ua(b)}return{data:a,contentType:c[0]}};Ea.data=ke;function le(){this.b=this.c=null;this.i=1;this.g={};this.f={};this.a=null;this.j=\"\";this.h=new ee}n(\"shaka.hls.HlsParser\",le);k=le.prototype;k.configure=function(a){this.b=a};k.start=function(a,b){this.c=b;this.j=a;return this.c.networkingEngine.request(0,C([a],this.b.retryParameters)).then(function(b){return ne(this,b.data,a)}.bind(this))};k.stop=function(){this.b=this.c=null;this.g={};return Promise.resolve()};k.update=function(){};k.onExpirationUpdated=function(){};\nfunction ne(a,b,c){b=fe(a.h,b,c);if(0!=b.type)throw new t(2,4,4022);a.a=new T(null,0);return oe(a,b).then(function(a){this.c.filterPeriod(a);return{presentationTimeline:this.a,periods:[a],offlineSessionIds:[],minBufferTime:0}}.bind(a))}\nfunction oe(a,b){var c=Zd(b.ga,\"EXT-X-STREAM-INF\").map(function(a){return pe(this,a,b)}.bind(a)),d=Zd(b.ga,\"EXT-X-MEDIA\").filter(function(a){return\"SUBTITLES\"==U(a,\"TYPE\")}.bind(a)).map(function(a){return qe(this,a,b)}.bind(a));return Promise.all(c).then(function(a){return Promise.all(d).then(function(b){var c=a.reduce(x,[]);re(this,c);return{startTime:0,variants:c,textStreams:b}}.bind(this))}.bind(a))}\nfunction pe(a,b,c){var d=Number(U(b,\"BANDWIDTH\")),e=Xd(b,\"CODECS\",\"avc1.42E01E,mp4a.40.2\").split(\",\"),f=b.getAttribute(\"RESOLUTION\"),g=null,h=null,l=Xd(b,\"FRAME-RATE\");if(f)var m=f.value.split(\"x\"),g=m[0],h=m[1];var q=se(a,c);c=Zd(c.ga,\"EXT-X-MEDIA\");var r=Xd(b,\"AUDIO\"),v=Xd(b,\"VIDEO\");r?c=ae(c,\"AUDIO\",r):v&&(c=ae(c,\"VIDEO\",v));c=c.map(function(a){return te(this,a,e,q)}.bind(a));var u=[],w=[];return Promise.all(c).then(function(a){r?u=a:v&&(w=a);if(u.length||w.length)var c=u.length?\"video\":\"audio\";\nelse 1==e.length?c=f||l?\"video\":\"audio\":(c=\"video\",e=[e.join(\",\")]);a=e;var d=U(b,\"URI\");return ue(this,d,a,c,q,\"und\",!1,null)}.bind(a)).then(function(a){\"audio\"==a.stream.type?u=[a]:w=[a];return ve(this,u,w,d,g,h,l)}.bind(a))}\nfunction ve(a,b,c,d,e,f,g){c.forEach(function(a){if(a=a.stream)a.width=Number(e)||void 0,a.height=Number(f)||void 0,a.frameRate=Number(g)||void 0}.bind(a));b.length||(b=[null]);c.length||(c=[null]);for(var h=[],l=0;l<b.length;l++)for(var m=0;m<c.length;m++){var q=b[l]?b[l].stream:null,r=c[m]?c[m].stream:null,v=b[l]?b[l].drmInfos:null,u=c[m]?c[m].drmInfos:null;if(q&&r)if(v.length&&u.length?0<sb(v,u).length:1)var w=sb(v,u);else continue;else q?w=v:r&&(w=u);h.push(xe(a,q,r,d,w))}return h}\nfunction xe(a,b,c,d,e){return{id:a.i++,language:b?b.language:\"und\",primary:!!b&&b.primary||!!c&&c.primary,audio:b,video:c,bandwidth:d,drmInfos:e,allowedByApplication:!0,allowedByKeySystem:!0}}function qe(a,b,c){U(b,\"TYPE\");c=se(a,c);return te(a,b,[],c).then(function(a){return a.stream})}\nfunction te(a,b,c,d){if(a.g[b.id])return Promise.resolve().then(function(){return this.g[b.id]}.bind(a));var e=U(b,\"TYPE\").toLowerCase();\"subtitles\"==e&&(e=\"text\");var f=Sb(Xd(b,\"LANGUAGE\",\"und\")),g=Xd(b,\"NAME\"),h=b.getAttribute(\"DEFAULT\"),l=b.getAttribute(\"AUTOSELECT\"),m=U(b,\"URI\");return ue(a,m,c,e,d,f,!!h||!!l,g).then(function(a){return this.g[b.id]=a}.bind(a))}\nfunction ue(a,b,c,d,e,f,g,h){b=z([a.j],[b])[0];return a.c.networkingEngine.request(0,C([b],a.b.retryParameters)).then(function(a){a=fe(this.h,a.data,a.uri);if(1!=a.type)throw new t(2,4,4017);e=se(this,a)||e;var b=null;\"text\"!=d&&(b=ye(a));var l=$d(a.ga,\"EXT-X-MEDIA-SEQUENCE\"),l=ze(this,a,l?Number(l.value):0);this.a.Ha(0,l);var r=l[l.length-1].endTime-l[0].startTime,v=this.a.Y();(Infinity==v||v<r)&&this.a.pa(r);var u=Ae(d,c),w=void 0;\"text\"==d&&(w=\"subtitle\");var G=new S(l),pa=[];a.segments.forEach(function(a){a=\nZd(a.ga,\"EXT-X-KEY\");pa.push.apply(pa,a)});var Hb=!1,tc=[],me=null;pa.forEach(function(a){if(\"NONE\"!=U(a,\"METHOD\")){Hb=!0;var b=U(a,\"KEYFORMAT\");if(a=(b=Be[b])?b(a):null)a.keyIds.length&&(me=a.keyIds[0]),tc.push(a)}});if(Hb&&!tc.length)throw new t(2,4,4026);return Ce(this,d,l[0].a()[0]).then(function(a){a={id:this.i++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:G.find.bind(G),getSegmentReference:G.get.bind(G),initSegmentReference:b,presentationTimeOffset:e||0,mimeType:a,codecs:u,\nkind:w,encrypted:Hb,keyId:me,language:f,label:h||null,type:d,primary:g,trickModeVideo:null,containsEmsgBoxes:!1,frameRate:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[]};this.f[a.id]=G;return{stream:a,Ae:G,drmInfos:tc}}.bind(this))}.bind(a))}\nfunction ye(a){var b=Zd(a.ga,\"EXT-X-MAP\");if(!b.length)return null;if(1<b.length)throw new t(2,4,4020);var b=b[0],c=U(b,\"URI\"),d=z([a.uri],[c])[0];a=0;c=null;if(b=Xd(b,\"BYTERANGE\"))a=b.split(\"@\"),b=Number(a[0]),a=Number(a[1]),c=a+b-1;return new Zc(function(){return[d]},a,c)}\nfunction ze(a,b,c){var d=b.segments,e=[];d.forEach(function(a){var f=a.ga,h=z([b.uri],[a.uri])[0],l=De(f).value.split(\",\"),l=Number(l[0]),m;(a=d.indexOf(a))?m=e[a-1].endTime:m=0;var l=m+l,q=0,r=null;if(f=$d(f,\"EXT-X-BYTERANGE\"))f=f.value.split(\"@\"),r=Number(f[0]),f[1]?q=Number(f[1]):q=e[a-1].M,r=q+r-1,a==d.length-1&&(r=null);e.push(new O(c+a,m,l,function(){return[h]},q,r))}.bind(a));return e}\nfunction re(a,b){b.forEach(function(a){var b=this.a.Y(),c=a.video;a=a.audio;c&&this.f[c.id]&&gd(this.f[c.id],b);a&&this.f[a.id]&&gd(this.f[a.id],b)}.bind(a))}function Ae(a,b){if(1==b.length)return b[0];if(\"text\"==a)return\"\";var c=Ee;\"audio\"==a&&(c=Fe);for(var d=0;d<c.length;d++)for(var e=0;e<b.length;e++)if(c[d].test(b[e].trim()))return b[e].trim();throw new t(2,4,4025,b);}\nfunction Ce(a,b,c){var d=c.split(\".\"),e=d[d.length-1];if(\"text\"==b)return Promise.resolve(\"text/vtt\");d=Ge;\"video\"==b&&(d=He);if(b=d[e])return Promise.resolve(b);c=C([c],a.b.retryParameters);c.method=\"HEAD\";return a.c.networkingEngine.request(1,c).then(function(a){a=a.headers[\"content-type\"];if(!a)throw new t(2,4,4021,e);return a})}function se(a,b){var c=$d(b.ga,\"EXT-X-START\");return c?Number(U(c,\"TIME-OFFSET\")):a.b.hls.defaultTimeOffset}\nfunction U(a,b){var c=a.getAttribute(b);if(!c)throw new t(2,4,4023,b);return c.value}function De(a){a=$d(a,\"EXTINF\");if(!a)throw new t(2,4,4024,\"EXTINF\");return a}\nvar Ee=[/^(avc)/,/^(hvc)/,/^(vp[8-9])$/,/^(av1)$/,/^(mp4v)/],Fe=[/^(vorbis)/,/^(opus)/,/^(mp4a)/,/^(ac-3)$/,/^(ec-3)$/],Ge={mp4:\"audio/mp4\",m4s:\"audio/mp4\",m4i:\"audio/mp4\",m4a:\"audio/mp4\",ts:\"video/mp2t\"},He={mp4:\"video/mp4\",m4s:\"video/mp4\",m4i:\"video/mp4\",m4v:\"video/mp4\",ts:\"video/mp2t\"},Be={\"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed\":function(a){if(\"SAMPLE-AES-CENC\"!=U(a,\"METHOD\"))return null;var b=U(a,\"URI\"),b=ke.parse(b),b=new Uint8Array(b.data),b=Ba(\"com.widevine.alpha\",[{initDataType:\"cenc\",\ninitData:b}]);if(a=Xd(a,\"KEYID\"))b.keyIds=[a.substr(2).toLowerCase()];return b}};Ed.m3u8=le;Dd[\"application/x-mpegurl\"]=le;Dd[\"application/vnd.apple.mpegurl\"]=le;function Ie(){}Ie.prototype.parseInit=function(){};\nIe.prototype.parseMedia=function(a,b){var c=F(a),d=[],e=new DOMParser,f=null;try{f=e.parseFromString(c,\"text/xml\")}catch(Hb){throw new t(2,2,2005);}if(f){var g=f.getElementsByTagName(\"tt\")[0];if(g){e=g.getAttribute(\"ttp:frameRate\");f=g.getAttribute(\"ttp:subFrameRate\");var h=g.getAttribute(\"ttp:frameRateMultiplier\");var l=g.getAttribute(\"ttp:tickRate\");c=g.getAttribute(\"xml:space\")||\"default\"}else throw new t(2,2,2005);if(\"default\"!=c&&\"preserve\"!=c)throw new t(2,2,2005);c=\"default\"==c;e=new Je(e,\nf,h,l);f=Ke(g.getElementsByTagName(\"styling\")[0]);h=Ke(g.getElementsByTagName(\"layout\")[0]);g=Ke(g.getElementsByTagName(\"body\")[0]);for(l=0;l<g.length;l++){var m=g[l],q=b.periodStart,r=e;var v=f;var u=h,w=c;if(m.hasAttribute(\"begin\")||m.hasAttribute(\"end\")||!/^\\s*$/.test(m.textContent)){Le(m,w);var w=Me(m.getAttribute(\"begin\"),r),G=Me(m.getAttribute(\"end\"),r),r=Me(m.getAttribute(\"dur\"),r),pa=m.textContent;null==G&&null!=r&&(G=w+r);if(null==w||null==G)throw new t(2,2,2001);if(q=xb(w+q,G+q,pa)){w=Ne(m,\n\"region\",u);u=q;if(G=Oe(m,w,v,\"tts:extent\"))if(r=Pe.exec(G))u.size=Number(r[1]);r=Oe(m,w,v,\"tts:writingMode\");G=!0;\"tb\"==r||\"tblr\"==r?u.vertical=\"lr\":\"tbrl\"==r?u.vertical=\"rl\":G=!1;if(r=Oe(m,w,v,\"tts:origin\"))if(r=Pe.exec(r))G?(u.position=Number(r[2]),u.line=Number(r[1])):(u.position=Number(r[1]),u.line=Number(r[2])),u.snapToLines=!1;if(v=Oe(m,w,v,\"tts:textAlign\"))u.align=v,\"center\"==v&&(\"center\"!=u.align&&(u.align=\"middle\"),u.position=\"auto\"),u.positionAlign=Qe[v],u.lineAlign=Re[v];v=q}else v=null}else v=\nnull;v&&d.push(v)}}return d};var Se=/^(\\d{2,}):(\\d{2}):(\\d{2}):(\\d{2})\\.?(\\d+)?$/,Te=/^(?:(\\d{2,}):)?(\\d{2}):(\\d{2})$/,Ue=/^(?:(\\d{2,}):)?(\\d{2}):(\\d{2}\\.\\d{2,})$/,Ve=/^(\\d*\\.?\\d*)f$/,We=/^(\\d*\\.?\\d*)t$/,Xe=/^(?:(\\d*\\.?\\d*)h)?(?:(\\d*\\.?\\d*)m)?(?:(\\d*\\.?\\d*)s)?(?:(\\d*\\.?\\d*)ms)?$/,Pe=/^(\\d{1,2}|100)% (\\d{1,2}|100)%$/,Re={left:\"start\",center:\"center\",right:\"end\",start:\"start\",end:\"end\"},Qe={left:\"line-left\",center:\"center\",right:\"line-right\"};\nfunction Ke(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=Ke(c[d]),b=b.concat(e))}b.length||b.push(a);return b}function Le(a,b){for(var c=a.childNodes,d=0;d<c.length;d++)if(\"br\"==c[d].nodeName&&0<d)c[d-1].textContent+=\"\\n\";else if(0<c[d].childNodes.length)Le(c[d],b);else if(b){var e=c[d].textContent.trim(),e=e.replace(/\\s+/g,\" \");c[d].textContent=e}}\nfunction Oe(a,b,c,d){for(var e=Ke(b),f=0;f<e.length;f++){var g=e[f].getAttribute(d);if(g)return g}e=Ne;return(a=e(b,\"style\",c)||e(a,\"style\",c))?a.getAttribute(d):null}function Ne(a,b,c){if(!a||1>c.length)return null;var d=null,e=a;for(a=null;e&&!(a=e.getAttribute(b))&&(e=e.parentNode,e instanceof Element););if(b=a)for(a=0;a<c.length;a++)if(c[a].getAttribute(\"xml:id\")==b){d=c[a];break}return d}\nfunction Me(a,b){var c=null;if(Se.test(a))var c=Se.exec(a),d=Number(c[1]),e=Number(c[2]),f=Number(c[3]),g=Number(c[4]),g=g+(Number(c[5])||0)/b.b,f=f+g/b.frameRate,c=f+60*e+3600*d;else Te.test(a)?c=Ye(Te,a):Ue.test(a)?c=Ye(Ue,a):Ve.test(a)?(c=Ve.exec(a),c=Number(c[1])/b.frameRate):We.test(a)?(c=We.exec(a),c=Number(c[1])/b.a):Xe.test(a)&&(c=Ye(Xe,a));return c}\nfunction Ye(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 Je(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])}vb(\"application/ttml+xml\",Ie);function Ze(){this.a=new Ie}Ze.prototype.parseInit=function(a){var b=!1;(new Q).C(\"moov\",R).C(\"trak\",R).C(\"mdia\",R).C(\"minf\",R).C(\"stbl\",R).da(\"stsd\",cd).C(\"stpp\",function(){b=!0}).parse(a);if(!b)throw new t(2,2,2007);};Ze.prototype.parseMedia=function(a,b){var c=!1,d=[];(new Q).C(\"mdat\",dd(function(a){c=!0;d=this.a.parseMedia(a.buffer,b)}.bind(this))).parse(a);if(!c)throw new t(2,2,2007);return d};vb('application/mp4; codecs=\"stpp\"',Ze);function $e(){}$e.prototype.parseInit=function(){};\n$e.prototype.parseMedia=function(a,b){var c=F(a),c=c.replace(/\\r\\n|\\r(?=[^\\n]|$)/gm,\"\\n\"),c=c.split(/\\n{2,}/m);if(!/^WEBVTT($|[ \\t\\n])/m.test(c[0]))throw new t(2,2,2E3);var d=b.segmentStart;if(0<=c[0].indexOf(\"X-TIMESTAMP-MAP\")){var e=c[0].match(/LOCAL:((?:(\\d{1,}):)?(\\d{2}):(\\d{2})\\.(\\d{3}))/m),f=c[0].match(/MPEGTS:(\\d+)/m);e&&f&&(d=af(new be(e[1])),d=b.periodStart+(Number(f[1])/9E4-d))}f=[];for(e=1;e<c.length;e++){var g=c[e].split(\"\\n\"),h=d;if(1==g.length&&!g[0]||/^NOTE($|[ \\t])/.test(g[0]))var l=\nnull;else{l=null;0>g[0].indexOf(\"--\\x3e\")&&(l=g[0],g.splice(0,1));var m=new be(g[0]),q=af(m),r=ce(m,/[ \\t]+--\\x3e[ \\t]+/g),v=af(m);if(null==q||!r||null==v)throw new t(2,2,2001);if(g=xb(q+h,v+h,g.slice(1).join(\"\\n\").trim())){ce(m,/[ \\t]+/gm);for(h=de(m);h;)bf(g,h),ce(m,/[ \\t]+/gm),h=de(m);null!=l&&(g.id=l);l=g}else l=null}l&&f.push(l)}return f};\nfunction bf(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=\n!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])}function af(a){a=ce(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)}vb(\"text/vtt\",$e);vb('text/vtt; codecs=\"vtt\"',$e);function cf(){this.a=null}cf.prototype.parseInit=function(a){var b=!1;(new Q).C(\"moov\",R).C(\"trak\",R).C(\"mdia\",R).da(\"mdhd\",function(a){0==a.version?(a.s.I(4),a.s.I(4),this.a=a.s.D(),a.s.I(4)):(a.s.I(8),a.s.I(8),this.a=a.s.D(),a.s.I(8));a.s.I(4)}.bind(this)).C(\"minf\",R).C(\"stbl\",R).da(\"stsd\",cd).C(\"wvtt\",function(){b=!0}).parse(a);if(!this.a)throw new t(2,2,2008);if(!b)throw new t(2,2,2008);};\ncf.prototype.parseMedia=function(a,b){var c=0,d=[],e=[],f=[],g=!1,h=!1,l=!1;(new Q).C(\"moof\",R).C(\"traf\",R).da(\"tfdt\",function(a){g=!0;c=a.version?a.s.Pa():a.s.D()}).da(\"trun\",function(a){h=!0;var b=a.version,c=a.Nc;a=a.s;var e=a.D();c&1&&a.I(4);c&4&&a.I(4);for(var f=[],g=0;g<e;g++){var l={duration:null,Nb:null};c&256&&(l.duration=a.D());c&512&&a.I(4);c&1024&&a.I(4);c&2048&&(l.Nb=b?a.nc():a.D());f.push(l)}d=f}).C(\"vtte\",function(){e.push(null)}).C(\"vttc\",dd(function(a){e.push(a.buffer)})).C(\"mdat\",\nfunction(a){l=!0;R(a)}).parse(a);if(!l&&!g&&!h)throw new t(2,2,2008);for(var m=c,q=0;q<d.length;q++){var r=d[q],v=e[q];if(r.duration){var u=r.Nb?c+r.Nb:m,m=u+r.duration;v&&f.push(df(v,b.periodStart+u/this.a,b.periodStart+m/this.a))}}return f};function df(a,b,c){var d,e,f;(new Q).C(\"payl\",dd(function(a){d=F(a)})).C(\"iden\",dd(function(a){e=F(a)})).C(\"sttg\",dd(function(a){f=F(a)})).parse(a);return d?ef(d,e,f,b,c):null}\nfunction ef(a,b,c,d,e){(a=xb(d,e,a))&&b&&(a.id=b);if(a&&c)for(b=new be(c),c=de(b);c;)bf(a,c),ce(b,/[ \\t]+/gm),c=de(b);return a}vb('application/mp4; codecs=\"wvtt\"',cf);function ff(a,b,c,d,e,f){this.a=a;this.c=b;this.l=c;this.A=d;this.J=e;this.G=f;this.b=new D;this.h=!1;this.g=1;this.j=this.f=null;this.B=a.readyState;this.i=!1;this.O=this.v=-1;this.o=!1;0<a.readyState?this.fc():La(this.b,a,\"loadedmetadata\",this.fc.bind(this));b=this.hc.bind(this);E(this.b,a,\"ratechange\",this.rd.bind(this));E(this.b,a,\"waiting\",b);this.j=setInterval(b,250)}k=ff.prototype;\nk.m=function(){var a=this.b.m();this.b=null;null!=this.f&&(window.clearInterval(this.f),this.f=null);null!=this.j&&(window.clearInterval(this.j),this.j=null);this.G=this.J=this.l=this.c=this.a=null;return a};function gf(a,b){0<a.a.readyState?a.a.currentTime=hf(a,b):a.A=b}function jf(a){return 0<a.a.readyState?hf(a,a.a.currentTime):kf(a)}function kf(a){if(a.A)return hf(a,a.A);a=a.c.presentationTimeline;return Infinity>a.Y()?a.ma():a.bb()}k.rb=function(){return this.g};\nfunction lf(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.Ab=function(){this.o=!0;this.hc()};k.rd=function(){this.a.playbackRate!=(this.h||0>this.g?0:this.g)&&lf(this,this.a.playbackRate)};\nk.fc=function(){var a=kf(this);.001>Math.abs(this.a.currentTime-a)?(E(this.b,this.a,\"seeking\",this.ic.bind(this)),E(this.b,this.a,\"playing\",this.gc.bind(this))):(La(this.b,this.a,\"seeking\",this.td.bind(this)),this.a.currentTime=a)};k.td=function(){E(this.b,this.a,\"seeking\",this.ic.bind(this));E(this.b,this.a,\"playing\",this.gc.bind(this))};\nk.hc=function(){if(this.a.readyState){this.a.readyState!=this.B&&(this.i=!1,this.B=this.a.readyState);var a=this.l.smallGapLimit,b=this.a.currentTime,c=this.a.buffered;a:{if(c&&c.length&&!(1==c.length&&1E-6>c.end(0)-c.start(0))){var d=.1;/(Edge|Trident)\\//.test(navigator.userAgent)&&(d=.5);for(var e=0;e<c.length;e++)if(c.start(e)>b&&(!e||c.end(e-1)-b<=d)){d=e;break a}}d=null}if(null==d){if(3>this.a.readyState&&0<this.a.playbackRate)if(this.O!=b)this.O=b,this.v=Date.now();else if(this.v<Date.now()-\n1E3)for(this.v=Date.now()+5E3,d=0;d<c.length;d++)if(b>=c.start(d)&&b<c.end(d)-.5){this.a.currentTime=this.a.currentTime;break}}else if(d||this.o)if(e=c.start(d),!(e>=this.c.presentationTimeline.bb())){var f=e-b,a=f<=a,g=!1;a||this.i||(this.i=!0,f=new I(\"largegap\",{currentTime:b,gapSize:f}),f.cancelable=!0,this.G(f),this.l.jumpLargeGaps&&!f.defaultPrevented&&(g=!0));if(a||g)d&&c.end(d-1),mf(this,b,e)}}};\nk.ic=function(){this.o=!1;var a=this.a.currentTime,b=nf(this,a);.001<Math.abs(b-a)?mf(this,a,b):(this.i=!1,this.J())};k.gc=function(){var a=this.a.currentTime,b=nf(this,a);.001<Math.abs(b-a)&&mf(this,a,b)};function nf(a,b){var c=Bb.bind(null,a.a.buffered),d=1*Math.max(a.c.minBufferTime||0,a.l.rebufferingGoal),e=a.c.presentationTimeline,f=e.ua(),g=e.Ea(d),h=e.Ea(5),d=e.Ea(d+5);return b>f?f:b<e.Ea(0)?c(h)?h:d:b>=g||c(b)?b:d}\nfunction mf(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 hf(a,b){var c=a.c.presentationTimeline.ma();if(b<c)return c;c=a.c.presentationTimeline.ua();return b>c?c:b};function of(a,b,c,d,e,f){this.a=a;this.g=b;this.A=c;this.l=d;this.h=e;this.B=f;this.c=[];this.j=new D;this.b=!1;this.i=-1;this.f=null;pf(this)}of.prototype.m=function(){var a=this.j?this.j.m():Promise.resolve();this.j=null;qf(this);this.B=this.h=this.l=this.A=this.g=this.a=null;this.c=[];return a};\nof.prototype.v=function(a){if(!this.c.some(function(b){return b.info.schemeIdUri==a.schemeIdUri&&b.info.startTime==a.startTime&&b.info.endTime==a.endTime})){var b={info:a,status:1};this.c.push(b);var c=new I(\"timelineregionadded\",{detail:rf(a)});this.h(c);this.o(!0,b)}};function rf(a){var b=Da(a);b.eventElement=a.eventElement;return b}\nof.prototype.o=function(a,b){var c=b.info.startTime>this.a.currentTime?1:b.info.endTime<this.a.currentTime?3:2,d=2==b.status,e=2==c;if(c!=b.status){if(!a||d||e)d||this.h(new I(\"timelineregionenter\",{detail:rf(b.info)})),e||this.h(new I(\"timelineregionexit\",{detail:rf(b.info)}));b.status=c}};function pf(a){qf(a);a.f=window.setTimeout(a.G.bind(a),250)}function qf(a){a.f&&(window.clearTimeout(a.f),a.f=null)}\nof.prototype.G=function(){this.f=null;pf(this);var a=hc(this.g,this.a.currentTime);a!=this.i&&(-1!=this.i&&this.B(),this.i=a);var a=Cb(this.a.buffered,this.a.currentTime),b=Ab(this.a.buffered)>=this.g.presentationTimeline.ua()-.1||this.a.ended;if(this.b){var c=1*Math.max(this.g.minBufferTime||0,this.A.rebufferingGoal);(b||a>=c)&&0!=this.b&&(this.b=!1,this.l(!1))}else!b&&.5>a&&1!=this.b&&(this.b=!0,this.l(!0));this.c.forEach(this.o.bind(this,!1))};function sf(a,b){this.a=b;this.b=a;this.g=null;this.i=1;this.o=Promise.resolve();this.h=[];this.j={};this.c={};this.f=this.l=this.v=!1}k=sf.prototype;k.m=function(){for(var a in this.c)tf(this.c[a]);this.g=this.c=this.j=this.h=this.o=this.b=this.a=null;this.f=!0;return Promise.resolve()};k.configure=function(a){this.g=a};k.init=function(){var a=this.a.bc(this.b.periods[hc(this.b,jf(this.a.Oa))]);return Ma(a)?Promise.reject(new t(2,5,5005)):uf(this,a).then(function(){this.a&&this.a.jd&&this.a.jd()}.bind(this))};\nfunction V(a){return a.b.periods[hc(a.b,jf(a.a.Oa))]}function vf(a){return Oa(a.c,function(a){return a.na||a.stream})}function wf(a,b){var c={};c.text=b;return uf(a,c)}function xf(a,b){var c=a.c.video;if(c){var d=c.stream;if(d)if(b){var e=d.trickModeVideo;if(e){var f=c.na;f||(yf(a,\"video\",e,!1),c.na=d)}}else if(f=c.na)c.na=null,yf(a,\"video\",f,!0)}}\nfunction yf(a,b,c,d){var e=a.c[b];if(!e&&\"text\"==b&&a.g.ignoreTextStreamFailures)wf(a,c);else if(e){var f=ic(a.b,c);d&&f!=e.wa?zf(a):(e.na&&(c.trickModeVideo?(e.na=c,c=c.trickModeVideo):e.na=null),\"text\"==b&&Fb(a.a.K,Yb(c.mimeType,c.codecs)),(b=a.h[f])&&b.La&&(b=a.j[c.id])&&b.La&&e.stream!=c&&(e.stream=c,e.cb=!0,d&&(e.sa?e.kb=!0:e.xa?(e.ra=!0,e.kb=!0):(tf(e),Af(a,e,!0)))))}}\nfunction Bf(a){var b=jf(a.a.Oa);Object.keys(a.c).every(function(a){var c=this.a.K;\"text\"==a?(a=c.a,a=b>=a.b&&b<a.a):(a=Ib(c,a),a=Bb(a,b));return a}.bind(a))||zf(a)}function zf(a){for(var b in a.c){var c=a.c[b];c.sa||c.ra||(c.xa?c.ra=!0:null==Gb(a.a.K,b)?null==c.qa&&Cf(a,c,0):(tf(c),Af(a,c,!1)))}}\nfunction uf(a,b,c){var d=hc(a.b,jf(a.a.Oa)),e=Oa(b,function(a){return Yb(a.mimeType,a.codecs)});a.a.K.init(e);Df(a);e=Na(b);return Ef(a,e).then(function(){if(!this.f)for(var a in b){var e=b[a];this.c[a]||(this.c[a]={stream:e,type:a,Fa:null,ea:null,na:null,cb:!0,wa:d,endOfStream:!1,xa:!1,qa:null,ra:!1,kb:!1,sa:!1,Gb:!1,tb:!1,rc:c||0},Cf(this,this.c[a],0))}}.bind(a))}\nfunction Ff(a,b){var c=a.h[b];if(c)return c.L;c={L:new A,La:!1};a.h[b]=c;var d=a.b.periods[b].variants.map(function(a){var b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);a.video&&a.video.trickModeVideo&&b.push(a.video.trickModeVideo);return b}).reduce(x,[]).filter(Aa);d.push.apply(d,a.b.periods[b].textStreams);a.o=a.o.then(function(){if(!this.f)return Ef(this,d)}.bind(a)).then(function(){this.f||(this.h[b].L.resolve(),this.h[b].La=!0)}.bind(a))[\"catch\"](function(a){this.f||(this.h[b].L.reject(),\ndelete this.h[b],this.a.onError(a))}.bind(a));return c.L}\nfunction Ef(a,b){b.map(function(a){return a.id}).filter(Aa);for(var c=[],d=0;d<b.length;++d){var e=b[d];var f=a.j[e.id];f?c.push(f.L):(a.j[e.id]={L:new A,La:!1},c.push(e.createSegmentIndex()))}return Promise.all(c).then(function(){if(!this.f)for(var a=0;a<b.length;++a){var c=this.j[b[a].id];c.La||(c.L.resolve(),c.La=!0)}}.bind(a))[\"catch\"](function(a){if(!this.f)return this.j[e.id].L.reject(),delete this.j[e.id],Promise.reject(a)}.bind(a))}\nfunction Df(a){var b=a.b.presentationTimeline.Y();Infinity>b?a.a.K.pa(b):a.a.K.pa(Math.pow(2,32))}k.ke=function(a){if(!this.f&&!a.xa&&null!=a.qa&&!a.sa)if(a.qa=null,a.ra)Af(this,a,a.kb);else{try{var b=Gf(this,a);null!=b&&(Cf(this,a,b),a.tb=!1)}catch(c){this.a.onError(c);return}b=Na(this.c);Hf(this,a);b.every(function(a){return a.endOfStream})&&this.a.K.endOfStream().then(function(){this.b.presentationTimeline.pa(this.a.K.Y())}.bind(this))}};\nfunction Gf(a,b){var c=jf(a.a.Oa),d=b.Fa&&b.ea?a.b.periods[ic(a.b,b.Fa)].startTime+b.ea.endTime:Math.max(c,b.rc);b.rc=0;var e=ic(a.b,b.stream),f=hc(a.b,d);var g=a.a.K;var h=b.type;\"text\"==h?(g=g.a,g=null==g.a||g.a<c?0:g.a-Math.max(c,g.b)):(g=Ib(g,h),g=Cb(g,c));h=Math.max(a.i*Math.max(a.b.minBufferTime||0,a.g.rebufferingGoal),a.i*a.g.bufferingGoal);if(d>=a.b.presentationTimeline.Y())return b.endOfStream=!0,null;b.endOfStream=!1;b.wa=f;if(f!=e)return null;if(g>=h)return.5;d=a.a.K;f=b.type;d=\"text\"==\nf?d.a.a:Ab(Ib(d,f));b.ea&&b.stream==b.Fa?(f=b.ea.position+1,d=If(a,b,e,f)):(f=b.ea?b.stream.findSegmentPosition(Math.max(0,a.b.periods[ic(a.b,b.Fa)].startTime+b.ea.endTime-a.b.periods[e].startTime)):b.stream.findSegmentPosition(Math.max(0,(d||c)-a.b.periods[e].startTime)),null==f?d=null:(g=null,null==d&&(g=If(a,b,e,Math.max(0,f-1))),d=g||If(a,b,e,f)));if(!d)return 1;Jf(a,b,c,e,d);return null}\nfunction If(a,b,c,d){c=a.b.periods[c];b=b.stream.getSegmentReference(d);if(!b)return null;a=a.b.presentationTimeline;d=a.ua();return c.startTime+b.endTime<a.ma()||c.startTime+b.startTime>d?null:b}\nfunction Jf(a,b,c,d,e){var f=a.b.periods[d],g=b.stream,h=a.b.periods[d+1],l=null,l=h?h.startTime:a.b.presentationTimeline.Y();d=Kf(a,b,d,l);b.xa=!0;b.cb=!1;h=Lf(a,e);Promise.all([d,h]).then(function(a){if(!this.f&&!this.l)return Mf(this,b,c,f,g,e,a[1])}.bind(a)).then(function(){this.f||this.l||(b.xa=!1,b.Gb=!1,b.ra||this.a.Ab(),Cf(this,b,0),Nf(this,g))}.bind(a))[\"catch\"](function(a){this.f||this.l||(b.xa=!1,this.b.presentationTimeline.$()&&this.g.infiniteRetriesForLiveStreams&&(1001==a.code||1002==\na.code||1003==a.code)?\"text\"==b.type&&this.g.ignoreTextStreamFailures&&1001==a.code?delete this.c.text:(a.severity=1,this.a.onError(a),Cf(this,b,4)):3017==a.code?Of(this,b,a):\"text\"==b.type&&this.g.ignoreTextStreamFailures?delete this.c.text:(b.tb=!0,a.severity=2,this.a.onError(a)))}.bind(a))}function Of(a,b,c){if(!Na(a.c).some(function(a){return a!=b&&a.Gb})){var d=Math.round(100*a.i);if(20<d)a.i-=.2;else if(4<d)a.i-=.04;else{b.tb=!0;a.l=!0;a.a.onError(c);return}b.Gb=!0}Cf(a,b,4)}\nfunction Kf(a,b,c,d){if(!b.cb)return Promise.resolve();c=Mb(a.a.K,b.type,a.b.periods[c].startTime-b.stream.presentationTimeOffset,d);if(!b.stream.initSegmentReference)return c;a=Lf(a,b.stream.initSegmentReference).then(function(a){if(!this.f)return Jb(this.a.K,b.type,a,null,null)}.bind(a))[\"catch\"](function(a){b.cb=!0;return Promise.reject(a)});return Promise.all([c,a])}\nfunction Mf(a,b,c,d,e,f,g){e.containsEmsgBoxes&&(new Q).da(\"emsg\",a.Ed.bind(a,d,f)).parse(g);return Pf(a,b,c).then(function(){if(!this.f)return Jb(this.a.K,b.type,g,f.startTime+d.startTime,f.endTime+d.startTime)}.bind(a)).then(function(){if(!this.f)return b.Fa=e,b.ea=f,Promise.resolve()}.bind(a))}\nk.Ed=function(a,b,c){var d=c.s.Db(),e=c.s.Db(),f=c.s.D(),g=c.s.D(),h=c.s.D(),l=c.s.D();c=c.s.Ka(c.s.H.byteLength-c.s.u);a=a.startTime+b.startTime+g/f;if(\"urn:mpeg:dash:event:2012\"==d)this.a.kd();else this.a.onEvent(new I(\"emsg\",{detail:{startTime:a,endTime:a+h/f,schemeIdUri:d,value:e,timescale:f,presentationTimeDelta:g,eventDuration:h,id:l,messageData:c}}))};\nfunction Pf(a,b,c){var d=Gb(a.a.K,b.type);if(null==d)return Promise.resolve();c=c-d-a.g.bufferBehind;return 0>=c?Promise.resolve():a.a.K.remove(b.type,d,d+c).then(function(){}.bind(a))}function Nf(a,b){if(!a.v&&(a.v=Na(a.c).every(function(a){return\"text\"==a.type?!0:!a.ra&&!a.sa&&a.ea}),a.v)){var c=ic(a.b,b);a.h[c]||Ff(a,c).then(function(){this.a.ac()}.bind(a))[\"catch\"](y);for(c=0;c<a.b.periods.length;++c)Ff(a,c)[\"catch\"](y);a.a.wd&&a.a.wd()}}\nfunction Hf(a,b){if(b.wa!=ic(a.b,b.stream)){var c=b.wa,d=Na(a.c);d.every(function(a){return a.wa==c})&&d.every(Qf)&&Ff(a,c).then(function(){if(!this.f&&d.every(function(a){var b=ic(this.b,a.stream);return Qf(a)&&a.wa==c&&b!=c}.bind(this))){var a=this.b.periods[c],b=this.a.bc(a),g;for(g in this.c)if(!b[g]&&\"text\"!=g){this.a.onError(new t(2,5,5005));return}for(g in b)if(!this.c[g])if(\"text\"==g)uf(this,{text:b.text},a.startTime),delete b[g];else{this.a.onError(new t(2,5,5005));return}for(g in this.c)(a=\nb[g])?(yf(this,g,a,!1),Cf(this,this.c[g],0)):delete this.c[g];this.a.ac()}}.bind(a))[\"catch\"](y)}}function Qf(a){return!a.xa&&null==a.qa&&!a.ra&&!a.sa}function Lf(a,b){var c=C(b.a(),a.g.retryParameters);if(b.X||null!=b.M){var d=\"bytes=\"+b.X+\"-\";null!=b.M&&(d+=b.M);c.headers.Range=d}return a.a.dd.request(1,c).then(function(a){return a.data})}\nfunction Af(a,b,c){b.ra=!1;b.kb=!1;b.sa=!0;Lb(a.a.K,b.type).then(function(){if(!this.f&&c){var a=this.a.K,e=b.type;return\"text\"==e?Promise.resolve():Kb(a,e,a.Oc.bind(a,e))}}.bind(a)).then(function(){this.f||(b.Fa=null,b.ea=null,b.sa=!1,b.endOfStream=!1,Cf(this,b,0))}.bind(a))}function Cf(a,b,c){b.qa=window.setTimeout(a.ke.bind(a,b),1E3*c)}function tf(a){null!=a.qa&&(window.clearTimeout(a.qa),a.qa=null)};function Rf(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;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},{});if(200<=b.status&&299>=b.status&&202!=b.status)b.responseURL&&(a=b.responseURL),c({uri:a,data:b.response,headers:e,fromCache:!!e[\"x-shaka-from-cache\"]});\nelse{var f=null;try{f=Ta(b.response)}catch(m){}d(new t(401==b.status||403==b.status?2:1,1,1001,a,b.status,f,e))}};e.onerror=function(){d(new t(1,1,1002,a))};e.ontimeout=function(){d(new t(1,1,1003,a))};for(var f in b.headers)e.setRequestHeader(f,b.headers[f]);e.send(b.body)})}n(\"shaka.net.HttpPlugin\",Rf);Ea.http=Rf;Ea.https=Rf;function Sf(){this.a=null;this.b=[];this.c={}}k=Sf.prototype;k.init=function(a,b){return Tf(this,a,b).then(function(){var b=Object.keys(a);return Promise.all(b.map(function(a){return Uf(this,a).then(function(b){this.c[a]=b}.bind(this))}.bind(this)))}.bind(this))};k.m=function(){return Promise.all(this.b.map(function(a){try{a.transaction.abort()}catch(b){}return a.L[\"catch\"](y)})).then(function(){this.a&&(this.a.close(),this.a=null)}.bind(this))};\nk.get=function(a,b){var c;return Vf(this,a,\"readonly\",function(a){c=a.get(b)}).then(function(){return c.result})};k.forEach=function(a,b){return Vf(this,a,\"readonly\",function(a){a.openCursor().onsuccess=function(a){if(a=a.target.result)b(a.value),a[\"continue\"]()}})};function Wf(a,b,c){return Vf(a,b,\"readwrite\",function(a){a.put(c)})}k.remove=function(a,b){return Vf(this,a,\"readwrite\",function(a){a[\"delete\"](b)})};\nfunction Xf(a,b,c){return Vf(a,\"segment\",\"readwrite\",function(a){for(var d=0;d<b.length;d++)a[\"delete\"](b[d]).onsuccess=c||function(){}})}function Uf(a,b){var c=0;return Vf(a,b,\"readonly\",function(a){a.openCursor(null,\"prev\").onsuccess=function(a){(a=a.target.result)&&(c=a.key+1)}}).then(function(){return c})}\nfunction Vf(a,b,c,d){var e={transaction:a.a.transaction([b],c),L:new A};e.transaction.oncomplete=function(){this.b.splice(this.b.indexOf(e),1);e.L.resolve()}.bind(a);e.transaction.onabort=function(a){this.b.splice(this.b.indexOf(e),1);Yf(e.transaction,e.L,a)}.bind(a);e.transaction.onerror=function(a){a.preventDefault()}.bind(a);b=e.transaction.objectStore(b);d(b);a.b.push(e);return e.L}\nfunction Tf(a,b,c){var d=window.indexedDB.open(\"shaka_offline_db\",1),e=!1,f=new A;d.onupgradeneeded=function(a){e=!0;a=a.target.result;for(var c in b)a.createObjectStore(c,{keyPath:b[c]})};d.onsuccess=function(a){c&&!e?(a.target.result.close(),setTimeout(function(){Tf(this,b,c-1).then(f.resolve,f.reject)}.bind(this),1E3)):(this.a=a.target.result,f.resolve())}.bind(a);d.onerror=Yf.bind(null,d,f);return f}\nfunction Yf(a,b,c){a.error?b.reject(new t(2,9,9001,a.error)):b.reject(new t(2,9,9002));c.preventDefault()};var Zf={manifest:\"key\",segment:\"key\"};function $f(a){var b=ag(a.periods[0],[],new T(null,0)),c=Zb(b,null,null),b=ac(b,null);c.push.apply(c,b);return{offlineUri:\"offline:\"+a.key,originalManifestUri:a.originalManifestUri,duration:a.duration,size:a.size,expiration:void 0==a.expiration?Infinity:a.expiration,tracks:c,appMetadata:a.appMetadata}}\nfunction ag(a,b,c){var d=a.streams.filter(function(a){return\"text\"==a.contentType}),e=a.streams.filter(function(a){return\"audio\"==a.contentType}),f=a.streams.filter(function(a){return\"video\"==a.contentType});b=bg(e,f,b);d=d.map(cg);a.streams.forEach(function(a){a=dg(a);c.Ha(0,a)});return{startTime:a.startTime,variants:b,textStreams:d}}function dg(a){return a.segments.map(function(a,c){return new O(c,a.startTime,a.endTime,function(){return[a.uri]},0,null)})}\nfunction bg(a,b,c){var d=[];if(!a.length&&!b.length)return d;a.length?b.length||(b=[null]):a=[null];for(var e=0,f=0;f<a.length;f++)for(var g=0;g<b.length;g++)if(eg(a[f],b[g])){var h=a[f];var l=b[g],m=c;h={id:e++,language:h?h.language:\"\",primary:!!h&&h.primary||!!l&&l.primary,audio:cg(h),video:cg(l),bandwidth:0,drmInfos:m,allowedByApplication:!0,allowedByKeySystem:!0};d.push(h)}return d}\nfunction eg(a,b){if(!(a&&b&&a.variantIds&&b.variantIds))return!0;for(var c=0;c<a.variantIds.length;c++)if(b.variantIds.some(function(b){return b==a.variantIds[c]}))return!0;return!1}\nfunction cg(a){if(!a)return null;var b=dg(a),b=new S(b);return{id:a.id,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:b.find.bind(b),getSegmentReference:b.get.bind(b),initSegmentReference:a.initSegmentUri?new Zc(function(){return[a.initSegmentUri]},0,null):null,presentationTimeOffset:a.presentationTimeOffset,mimeType:a.mimeType,codecs:a.codecs,width:a.width||void 0,height:a.height||void 0,frameRate:a.frameRate||void 0,kind:a.kind,encrypted:a.encrypted,keyId:a.keyId,language:a.language,\nlabel:a.label||null,type:a.contentType,primary:a.primary,trickModeVideo:null,containsEmsgBoxes:!1,roles:[]}}function fg(){return window.indexedDB?new Sf:null};function gg(a,b,c,d){this.b={};this.l=[];this.o=d;this.j=a;this.v=b;this.A=c;this.i=this.a=null;this.f=this.g=this.h=this.c=0}gg.prototype.m=function(){var a=this.j,b=this.l,c=this.i||Promise.resolve(),c=c.then(function(){return Xf(a,b)});this.b={};this.l=[];this.i=this.a=this.A=this.v=this.j=this.o=null;return c};function hg(a,b,c,d,e){a.b[b]=a.b[b]||[];a.b[b].push({uris:c.a(),X:c.X,M:c.M,Rb:d,Hb:e})}\nfunction ig(a,b){a.c=0;a.h=0;a.g=0;a.f=0;Na(a.b).forEach(function(a){a.forEach(function(a){null!=a.M?this.c+=a.M-a.X+1:this.g+=a.Rb}.bind(this))}.bind(a));a.a=b;a.a.size=a.c;var c=Na(a.b).map(function(a){var b=0,c=function(){if(!this.o)return Promise.reject(new t(2,9,9002));if(b>=a.length)return Promise.resolve();var d=a[b++];return jg(this,d).then(c)}.bind(this);return c()}.bind(a));a.b={};a.i=Promise.all(c).then(function(){return Wf(this.j,\"manifest\",b)}.bind(a)).then(function(){this.l=[]}.bind(a));\nreturn a.i}\nfunction jg(a,b){var c=C(b.uris,a.A);if(b.X||null!=b.M)c.headers.Range=\"bytes=\"+b.X+\"-\"+(null==b.M?\"\":b.M);var d;return a.v.request(1,c).then(function(a){if(!this.a)return Promise.reject(new t(2,9,9002));d=a.data.byteLength;this.l.push(b.Hb.key);b.Hb.data=a.data;return Wf(this.j,\"segment\",b.Hb)}.bind(a)).then(function(){if(!this.a)return Promise.reject(new t(2,9,9002));null==b.M?(this.a.size+=d,this.f+=b.Rb):this.h+=d;var a=(this.h+this.f)/(this.c+this.g),c=$f(this.a);this.o.progressCallback(c,a)}.bind(a))}\n;function kg(){this.a=-1}k=kg.prototype;k.configure=function(){};k.start=function(a){var b=/^offline:([0-9]+)$/.exec(a);if(!b)return Promise.reject(new t(2,1,9004,a));var c=Number(b[1]),d=fg();this.a=c;return d?d.init(Zf).then(function(){return d.get(\"manifest\",c)}).then(function(a){if(!a)throw new t(2,9,9003,c);return lg(a)}).then(function(a){return d.m().then(function(){return a})},function(a){return d.m().then(function(){throw a;})}):Promise.reject(new t(2,9,9E3))};k.stop=function(){return Promise.resolve()};\nk.update=function(){};k.onExpirationUpdated=function(a,b){var c=fg();c.init(Zf).then(function(){return c.get(\"manifest\",this.a)}.bind(this)).then(function(d){if(d&&!(0>d.sessionIds.indexOf(a))&&(void 0==d.expiration||d.expiration>b))return d.expiration=b,Wf(c,\"manifest\",d)})[\"catch\"](function(){}).then(function(){return c.m()})};\nfunction lg(a){var b=new T(null,0);b.pa(a.duration);var c=a.drmInfo?[a.drmInfo]:[];return{presentationTimeline:b,minBufferTime:10,offlineSessionIds:a.sessionIds,periods:a.periods.map(function(a){return ag(a,c,b)})}}Dd[\"application/x-offline-manifest\"]=kg;function mg(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=fg();return d?d.init(Zf).then(function(){return d.get(\"segment\",c)}).then(function(b){return d.m().then(function(){if(!b)throw new t(2,9,9003,c);return{uri:a,data:b.data,headers:{}}})}):Promise.reject(new t(2,9,9E3))}return Promise.reject(new t(2,1,9004,a))}\nn(\"shaka.offline.OfflineScheme\",mg);Ea.offline=mg;function ng(){this.a=Promise.resolve();this.b=this.c=this.f=!1;this.i=new Promise(function(a){this.g=a}.bind(this))}ng.prototype.then=function(a){this.a=this.a.then(a).then(function(a){return this.b?(this.g(),Promise.reject(this.h)):Promise.resolve(a)}.bind(this));return this};function og(a){a.f||(a.a=a.a.then(function(a){this.c=!0;return Promise.resolve(a)}.bind(a),function(a){this.c=!0;return this.b?(this.g(),Promise.reject(this.h)):Promise.reject(a)}.bind(a)));a.f=!0;return a.a}\nng.prototype.cancel=function(a){if(this.c)return Promise.resolve();this.b=!0;this.h=a;return this.i};function W(a,b){p.call(this);this.O=!1;this.f=a;this.A=null;this.l=new D;this.Qb=new H;this.Ya=this.c=this.h=this.a=this.v=this.g=this.Wa=this.ja=this.N=this.j=this.o=null;this.Dc=1E9;this.Va=[];this.ka=!1;this.Za=!0;this.la=this.J=null;this.G={};this.Xa=[];this.B={};this.b=pg(this);this.ob={width:Infinity,height:Infinity};this.i=qg();this.Ua=0;this.ia=this.b.preferredAudioLanguage;this.Ca=this.b.preferredTextLanguage;this.lb=this.mb=\"\";b&&b(this);this.o=new B(this.de.bind(this));this.Wa=rg(this);\nfor(var c=0;c<this.f.textTracks.length;++c){var d=this.f.textTracks[c];d.mode=\"disabled\";\"Shaka Player TextTrack\"==d.label&&(this.A=d)}this.A||(this.A=this.f.addTextTrack(\"subtitles\",\"Shaka Player TextTrack\"));this.A.mode=\"hidden\";E(this.l,this.f,\"error\",this.yd.bind(this))}ba(W);n(\"shaka.Player\",W);\nW.prototype.m=function(){this.O=!0;var a=Promise.resolve();this.J&&(a=this.J.cancel(new t(2,7,7E3)));return a.then(function(){var a=Promise.all([this.la,sg(this),this.l?this.l.m():null,this.o?this.o.m():null]);this.b=this.o=this.Qb=this.l=this.A=this.f=null;return a}.bind(this))};W.prototype.destroy=W.prototype.m;W.version=\"v2.1.4\";var tg={};W.registerSupportPlugin=function(a,b){tg[a]=b};\nW.isBrowserSupported=function(){return!!window.Promise&&!!window.Uint8Array&&!!Array.prototype.forEach&&!!window.MediaSource&&!!window.MediaSource.isTypeSupported&&!!window.MediaKeys&&!!window.navigator&&!!window.navigator.requestMediaKeySystemAccess&&!!window.MediaKeySystemAccess&&!!window.MediaKeySystemAccess.prototype.getConfiguration};W.probeSupport=function(){return qb().then(function(a){var b=Fd(),c=Eb();a={manifest:b,media:c,drm:a};for(var d in tg)a[d]=tg[d]();return a})};\nW.prototype.load=function(a,b,c){var d=this.hb(),e=new ng;this.J=e;this.dispatchEvent(new I(\"loading\"));var f=Date.now();return og(e.then(function(){return d}).then(function(){this.i=qg();E(this.l,this.f,\"playing\",this.Sa.bind(this));E(this.l,this.f,\"pause\",this.Sa.bind(this));E(this.l,this.f,\"ended\",this.Sa.bind(this));return Gd(a,this.o,this.b.manifest.retryParameters,c)}.bind(this)).then(function(b){this.h=new b;this.h.configure(this.b.manifest);b={networkingEngine:this.o,filterPeriod:this.fb.bind(this),\nonTimelineRegionAdded:this.xd.bind(this),onEvent:this.gb.bind(this),onError:this.ya.bind(this)};return 2<this.h.start.length?this.h.start(a,this.o,b.filterPeriod,b.onError,b.onEvent):this.h.start(a,b)}.bind(this)).then(function(b){if(0==b.periods.length)throw new t(2,4,4014);this.c=b;this.Ya=a;this.j=new bb(this.o,this.ya.bind(this),this.be.bind(this),this.ae.bind(this));this.j.configure(this.b.drm);return this.j.init(b,!1)}.bind(this)).then(function(){this.c.periods.forEach(this.fb.bind(this));this.Ua=\nDate.now()/1E3;this.ia=this.b.preferredAudioLanguage;this.Ca=this.b.preferredTextLanguage;return Promise.all([eb(this.j,this.f),this.Wa])}.bind(this)).then(function(){this.b.abr.manager.init(this.Lb.bind(this));this.g=new ff(this.f,this.c,this.b.streaming,b||null,this.ce.bind(this),this.gb.bind(this));this.v=new of(this.f,this.c,this.b.streaming,this.zc.bind(this),this.gb.bind(this),this.$d.bind(this));this.ja=new Db(this.f,this.N,this.A);this.a=new sf(this.c,{Oa:this.g,K:this.ja,dd:this.o,bc:this.ed.bind(this),\nac:this.Gc.bind(this),onError:this.ya.bind(this),onEvent:this.gb.bind(this),kd:this.ld.bind(this),Ab:this.ud.bind(this)});this.a.configure(this.b.streaming);ug(this);return this.a.init()}.bind(this)).then(function(){if(this.b.streaming.startAtSegmentBoundary){var a=vg(this,jf(this.g));gf(this.g,a)}this.c.periods.forEach(this.fb.bind(this));wg(this);xg(this);var a=V(this.a),b=dc(a,this.ia);this.b.abr.manager.setVariants(b);a.variants.some(function(a){return a.primary});this.Xa.forEach(this.v.v.bind(this.v));\nthis.Xa=[];La(this.l,this.f,\"loadeddata\",function(){this.i.loadLatency=(Date.now()-f)/1E3}.bind(this));this.J=null}.bind(this)))[\"catch\"](function(a){this.J==e&&(this.J=null,this.dispatchEvent(new I(\"unloading\")));return Promise.reject(a)}.bind(this))};W.prototype.load=W.prototype.load;\nfunction ug(a){function b(a){return(a.video?a.video.codecs.split(\".\")[0]:\"\")+\"-\"+(a.audio?a.audio.codecs.split(\".\")[0]:\"\")}var c={};a.c.periods.forEach(function(a){a.variants.forEach(function(a){var d=b(a);d in c||(c[d]=[]);c[d].push(a)})});var d=null,e=Infinity;Qa(c,function(a,b){var c=0,f=0;b.forEach(function(a){c+=a.bandwidth;++f});var g=c/f;g<e&&(d=a,e=g)});a.c.periods.forEach(function(a){a.variants=a.variants.filter(function(a){return b(a)==d?!0:!1})})}\nfunction rg(a){a.N=new MediaSource;var b=new A;E(a.l,a.N,\"sourceopen\",b.resolve);a.f.src=window.URL.createObjectURL(a.N);return b}W.prototype.configure=function(a){a.abr&&a.abr.manager&&a.abr.manager!=this.b.abr.manager&&(this.b.abr.manager.stop(),a.abr.manager.init(this.Lb.bind(this)));Ca(this.b,a,pg(this),yg(),\"\");zg(this)};W.prototype.configure=W.prototype.configure;\nfunction zg(a){a.h&&a.h.configure(a.b.manifest);a.j&&a.j.configure(a.b.drm);if(a.a){a.a.configure(a.b.streaming);try{a.c.periods.forEach(a.fb.bind(a))}catch(b){a.ya(b)}Ag(a,V(a.a))}a.b.abr.enabled&&!a.Za?a.b.abr.manager.enable():a.b.abr.manager.disable();a.b.abr.manager.setDefaultEstimate(a.b.abr.defaultBandwidthEstimate);a.b.abr.manager.setRestrictions(a.b.abr.restrictions)}W.prototype.getConfiguration=function(){var a=pg(this);Ca(a,this.b,pg(this),yg(),\"\");return a};\nW.prototype.getConfiguration=W.prototype.getConfiguration;W.prototype.Rd=function(){var a=pg(this);a.abr&&a.abr.manager&&a.abr.manager!=this.b.abr.manager&&(this.b.abr.manager.stop(),a.abr.manager.init(this.Lb.bind(this)));this.b=pg(this);zg(this)};W.prototype.resetConfiguration=W.prototype.Rd;W.prototype.Sc=function(){return this.f};W.prototype.getMediaElement=W.prototype.Sc;W.prototype.Wb=function(){return this.o};W.prototype.getNetworkingEngine=W.prototype.Wb;W.prototype.Rc=function(){return this.Ya};\nW.prototype.getManifestUri=W.prototype.Rc;W.prototype.$=function(){return this.c?this.c.presentationTimeline.$():!1};W.prototype.isLive=W.prototype.$;W.prototype.va=function(){return this.c?this.c.presentationTimeline.va():!1};W.prototype.isInProgress=W.prototype.va;W.prototype.Td=function(){var a=0,b=0;this.c&&(b=this.c.presentationTimeline,a=b.ma(),b=b.bb());return{start:a,end:b}};W.prototype.seekRange=W.prototype.Td;W.prototype.keySystem=function(){return this.j?this.j.keySystem():\"\"};\nW.prototype.keySystem=W.prototype.keySystem;W.prototype.drmInfo=function(){return this.j?this.j.b:null};W.prototype.drmInfo=W.prototype.drmInfo;W.prototype.ab=function(){return this.j?this.j.ab():Infinity};W.prototype.getExpiration=W.prototype.ab;W.prototype.$c=function(){return this.ka};W.prototype.isBuffering=W.prototype.$c;\nW.prototype.hb=function(){if(this.O)return Promise.resolve();this.dispatchEvent(new I(\"unloading\"));var a=Promise.resolve();this.J&&(a=this.J.cancel(new t(2,7,7E3)));return a.then(function(){this.la||(this.la=Bg(this).then(function(){this.la=null}.bind(this)));return this.la}.bind(this))};W.prototype.unload=W.prototype.hb;W.prototype.rb=function(){return this.g?this.g.rb():0};W.prototype.getPlaybackRate=W.prototype.rb;W.prototype.ne=function(a){this.g&&lf(this.g,a);this.a&&xf(this.a,1!=a)};\nW.prototype.trickPlay=W.prototype.ne;W.prototype.Hc=function(){this.g&&lf(this.g,1);this.a&&xf(this.a,!1)};W.prototype.cancelTrickPlay=W.prototype.Hc;W.prototype.getTracks=function(){return this.Yb().concat(this.Xb())};W.prototype.getTracks=W.prototype.getTracks;W.prototype.Wd=function(a,b){\"text\"==a.type?this.tc(a):(this.configure({abr:{enabled:!1}}),this.uc(a,b))};W.prototype.selectTrack=W.prototype.Wd;\nW.prototype.Yb=function(){if(!this.c)return[];var a=hc(this.c,jf(this.g)),b=this.B[a]||{};return Zb(this.c.periods[a],b.audio,b.video)};W.prototype.getVariantTracks=W.prototype.Yb;W.prototype.Xb=function(){if(!this.c)return[];var a=hc(this.c,jf(this.g));return ac(this.c.periods[a],(this.B[a]||{}).text).filter(function(a){return 0>this.Va.indexOf(a.id)}.bind(this))};W.prototype.getTextTracks=W.prototype.Xb;\nW.prototype.tc=function(a){if(this.a&&(a=cc(V(this.a),a))){Cg(this,a,!1);var b={};b.text=a;Dg(this,b,!0)}};W.prototype.selectTextTrack=W.prototype.tc;\nW.prototype.uc=function(a,b){if(this.a){var c={},d=bc(V(this.a),a),e=vf(this.a);if(d){if(!d.allowedByApplication||!d.allowedByKeySystem)return;d.audio&&(Eg(this,d.audio),d.audio!=e.audio&&(c.audio=d.audio));d.video&&(Eg(this,d.video),d.video!=e.video&&(c.video=d.video))}Na(c).forEach(function(a){Cg(this,a,!1)}.bind(this));(d=e.text)&&(c.text=d);Dg(this,c,b)}};W.prototype.selectVariantTrack=W.prototype.uc;\nW.prototype.Pc=function(){return this.a?$b(V(this.a).variants).map(function(a){return a.language}).filter(Aa):[]};W.prototype.getAudioLanguages=W.prototype.Pc;W.prototype.Yc=function(){return this.a?V(this.a).textStreams.map(function(a){return a.language}).filter(Aa):[]};W.prototype.getTextLanguages=W.prototype.Yc;W.prototype.Ud=function(a,b){if(this.a){var c=V(this.a);this.ia=a;this.mb=b||\"\";Ag(this,c)}};W.prototype.selectAudioLanguage=W.prototype.Ud;\nW.prototype.Vd=function(a,b){if(this.a){var c=V(this.a);this.Ca=a;this.lb=b||\"\";Ag(this,c)}};W.prototype.selectTextLanguage=W.prototype.Vd;W.prototype.bd=function(){return\"showing\"==this.A.mode};W.prototype.isTextTrackVisible=W.prototype.bd;W.prototype.Yd=function(a){this.A.mode=a?\"showing\":\"hidden\";Fg(this)};W.prototype.setTextTrackVisibility=W.prototype.Yd;W.prototype.Uc=function(){return this.c?new Date(1E3*this.c.presentationTimeline.f+1E3*this.f.currentTime):null};\nW.prototype.getPlayheadTimeAsDate=W.prototype.Uc;\nW.prototype.getStats=function(){Gg(this);this.Sa();var a=null,b=null,c=this.f&&this.f.getVideoPlaybackQuality?this.f.getVideoPlaybackQuality():{};this.g&&this.c&&(a=hc(this.c,jf(this.g)),b=this.B[a],b=gc(b.audio,b.video,this.c.periods[a].variants),a=b.video||{});a||(a={});b||(b={});return{width:a.width||0,height:a.height||0,streamBandwidth:b.bandwidth||0,decodedFrames:Number(c.totalVideoFrames),droppedFrames:Number(c.droppedVideoFrames),estimatedBandwidth:this.b.abr.manager.getBandwidthEstimate(),loadLatency:this.i.loadLatency,\nplayTime:this.i.playTime,bufferingTime:this.i.bufferingTime,switchHistory:Da(this.i.switchHistory),stateHistory:Da(this.i.stateHistory)}};W.prototype.getStats=W.prototype.getStats;\nW.prototype.addTextTrack=function(a,b,c,d,e,f){if(!this.a)return Promise.reject();for(var g=V(this.a),h,l=0;l<this.c.periods.length;l++)if(this.c.periods[l]==g){if(l==this.c.periods.length-1){if(h=this.c.presentationTimeline.Y()-g.startTime,Infinity==h)return Promise.reject()}else h=this.c.periods[l+1].startTime-g.startTime;break}var m={id:this.Dc++,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(b){return 1!=b?null:new O(1,0,\nh,function(){return[a]},0,null)},initSegmentReference:null,presentationTimeOffset:0,mimeType:d,codecs:e||\"\",kind:c,encrypted:!1,keyId:null,language:b,label:f||null,type:\"text\",primary:!1,trickModeVideo:null,containsEmsgBoxes:!1,roles:[]};this.Va.push(m.id);g.textStreams.push(m);return wf(this.a,m).then(function(){if(!this.O){var a=this.c.periods.indexOf(g),d=vf(this.a);d.text&&(this.B[a].text=d.text.id);this.Va.splice(this.Va.indexOf(m.id),1);Ag(this,g);wg(this);return{id:m.id,active:!1,type:\"text\",\nbandwidth:0,language:b,label:f||null,kind:c,width:null,height:null}}}.bind(this))};W.prototype.addTextTrack=W.prototype.addTextTrack;W.prototype.Jb=function(a,b){this.ob.width=a;this.ob.height=b};W.prototype.setMaxHardwareResolution=W.prototype.Jb;function Cg(a,b,c){a.i.switchHistory.push({timestamp:Date.now()/1E3,id:b.id,type:b.type,fromAdaptation:c});Eg(a,b)}function Eg(a,b){var c=ic(a.c,b);a.B[c]||(a.B[c]={});a.B[c][b.type]=b.id}\nfunction sg(a){a.l&&(a.l.ha(a.N,\"sourceopen\"),a.l.ha(a.f,\"loadeddata\"),a.l.ha(a.f,\"playing\"),a.l.ha(a.f,\"pause\"),a.l.ha(a.f,\"ended\"));a.f&&(a.f.removeAttribute(\"src\"),a.f.load());var b=Promise.all([a.b?a.b.abr.manager.stop():null,a.j?a.j.m():null,a.ja?a.ja.m():null,a.g?a.g.m():null,a.v?a.v.m():null,a.a?a.a.m():null,a.h?a.h.stop():null]);a.j=null;a.ja=null;a.g=null;a.v=null;a.a=null;a.h=null;a.c=null;a.Ya=null;a.Wa=null;a.N=null;a.Xa=[];a.B={};a.G={};a.i=qg();return b}\nfunction Bg(a){return a.h?sg(a).then(function(){this.O||(this.zc(!1),this.Wa=rg(this))}.bind(a)):Promise.resolve()}function yg(){return{\".drm.servers\":\"\",\".drm.clearKeys\":\"\",\".drm.advanced\":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:\"\",audioRobustness:\"\",serverCertificate:null}}}\nfunction pg(a){return{drm:{retryParameters:Fa(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1},manifest:{retryParameters:Fa(),dash:{customScheme:function(a){if(a)return null},clockSyncUri:\"\",ignoreDrmInfo:!1},hls:{defaultTimeOffset:0}},streaming:{retryParameters:Fa(),infiniteRetriesForLiveStreams:!0,rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1},abr:{manager:a.Qb,enabled:!0,defaultBandwidthEstimate:5E5,\nrestrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minBandwidth:0,maxBandwidth:Infinity}},preferredAudioLanguage:\"\",preferredTextLanguage:\"\",restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minBandwidth:0,maxBandwidth:Infinity}}}\nfunction qg(){return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:0,bufferingTime:0,switchHistory:[],stateHistory:[]}}k=W.prototype;k.fb=function(a){var b=this.a?vf(this.a):{};Wb(this.j,b,a);b=0<$b(a.variants).length;Vb(a,this.b.restrictions,this.ob)&&this.a&&V(this.a)==a&&wg(this);a=1>$b(a.variants).length;if(!b)throw new t(2,4,4011);if(a)throw new t(2,4,4012);};\nfunction Dg(a,b,c){for(var d in b){var e=b[d],f=c||!1;\"text\"==d&&(f=!0);a.Za?a.G[d]={stream:e,Kc:f}:yf(a.a,d,e,f)}}function Gg(a){if(a.c){var b=Date.now()/1E3;a.ka?a.i.bufferingTime+=b-a.Ua:a.i.playTime+=b-a.Ua;a.Ua=b}}\nfunction vg(a,b){function c(a,b){if(!a)return null;var c=a.findSegmentPosition(b-e.startTime);return null==c?null:(c=a.getSegmentReference(c))?c.startTime+e.startTime:null}var d=vf(a.a),e=V(a.a),f=c(d.video,b),d=c(d.audio,b);return null!=f&&null!=d?Math.max(f,d):null!=f?f:null!=d?d:b}k.de=function(a,b){this.b.abr.manager.segmentDownloaded(a,b)};k.zc=function(a){Gg(this);this.ka=a;this.Sa();if(this.g){var b=this.g;a!=b.h&&(b.h=a,lf(b,b.g))}this.dispatchEvent(new I(\"buffering\",{buffering:a}))};\nk.$d=function(){wg(this)};k.Sa=function(){if(!this.O){var a=this.ka?\"buffering\":this.f.ended?\"ended\":this.f.paused?\"paused\":\"playing\";var b=Date.now()/1E3;if(this.i.stateHistory.length){var c=this.i.stateHistory[this.i.stateHistory.length-1];c.duration=b-c.timestamp;if(a==c.state)return}this.i.stateHistory.push({timestamp:b,state:a,duration:0})}};k.ce=function(){if(this.v){var a=this.v;a.c.forEach(a.o.bind(a,!0))}this.a&&Bf(this.a)};\nfunction Hg(a,b,c,d,e){if(!c||1>c.length)return a.ya(new t(2,4,4012)),{};a.b.abr.manager.setVariants(c);a.b.abr.manager.setTextStreams(d);var f=[];e&&(f=[\"video\",\"audio\"],b.textStreams.length&&f.push(\"text\"));e=vf(a.a);var g=a.a;var h=g.c.video||g.c.audio;g=h?g.b.periods[h.wa]:null;if(b=fc(e.audio,e.video,g?g.variants:b.variants)){b.allowedByApplication&&b.allowedByKeySystem||(f.push(\"audio\"),f.push(\"video\"));for(var l in e)b=e[l],\"audio\"==b.type&&b.language!=c[0].language?f.push(l):\"text\"==b.type&&\n0<d.length&&b.language!=d[0].language&&f.push(l)}f=f.filter(Aa);if(0<f.length){c={};try{c=a.b.abr.manager.chooseStreams(f)}catch(m){a.ya(m)}return c}return{}}function Ag(a,b){var c={audio:!1,text:!1},d=dc(b,a.ia,c,a.mb),e=ec(b,a.Ca,c,a.lb),d=Hg(a,b,d,e),f;for(f in d)Cg(a,d[f],!0);Dg(a,d,!0);xg(a);d.text&&d.audio&&c.text&&d.text.language!=d.audio.language&&(a.A.mode=\"showing\",Fg(a))}\nk.ed=function(a){this.Za=!0;this.b.abr.manager.disable();var b=dc(a,this.ia,void 0,this.mb),c=ec(a,this.Ca,void 0,this.lb);a=Hg(this,a,b,c,!0);for(var d in this.G)a[d]=this.G[d].stream;this.G={};for(d in a)Cg(this,a[d],!0);return a};k.Gc=function(){this.Za=!1;this.b.abr.enabled&&this.b.abr.manager.enable();for(var a in this.G){var b=this.G[a];yf(this.a,a,b.stream,b.Kc)}this.G={}};k.ld=function(){this.h&&this.h.update&&this.h.update()};k.ud=function(){this.g&&this.g.Ab()};\nk.Lb=function(a,b){var c=vf(this.a),d;for(d in a){var e=a[d];c[d]!=e?Cg(this,e,!0):delete a[d]}if(!Ma(a)&&this.a){for(d in a)yf(this.a,d,a[d],b||!1);xg(this)}};function xg(a){Promise.resolve().then(function(){this.O||this.dispatchEvent(new I(\"adaptation\"))}.bind(a))}function wg(a){Promise.resolve().then(function(){this.O||this.dispatchEvent(new I(\"trackschanged\"))}.bind(a))}function Fg(a){a.dispatchEvent(new I(\"texttrackvisibility\"))}k.ya=function(a){this.O||this.dispatchEvent(new I(\"error\",{detail:a}))};\nk.xd=function(a){this.v?this.v.v(a):this.Xa.push(a)};k.gb=function(a){this.dispatchEvent(a)};k.yd=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.ya(new t(2,3,3016,a,b))}}};\nk.be=function(a){var b=[\"output-restricted\",\"internal-error\"],c=V(this.a),d=!1;c.variants.forEach(function(c){var e=[];c.audio&&e.push(c.audio);c.video&&e.push(c.video);e.forEach(function(e){var f=c.allowedByKeySystem;e.keyId&&(e=a[e.keyId],c.allowedByKeySystem=!!e&&0>b.indexOf(e));f!=c.allowedByKeySystem&&(d=!0)})});var e=vf(this.a);(e=fc(e.audio,e.video,c.variants))&&!e.allowedByKeySystem&&Ag(this,c);d&&wg(this)};\nk.ae=function(a,b){if(this.h&&this.h.onExpirationUpdated)this.h.onExpirationUpdated(a,b);this.dispatchEvent(new I(\"expirationupdated\"))};function X(a){if(!a||a.constructor!=W)throw new t(2,9,9008);this.a=fg();this.f=a;this.i=Ig(this);this.b=null;this.v=!1;this.j=null;this.g=-1;this.l=0;this.c=null;this.h=new gg(this.a,a.o,a.getConfiguration().streaming.retryParameters,this.i)}n(\"shaka.offline.Storage\",X);function Jg(){return!!window.indexedDB}X.support=Jg;X.prototype.m=function(){var a=this.a,b=this.h?this.h.m()[\"catch\"](function(){}).then(function(){if(a)return a.m()}):Promise.resolve();this.i=this.f=this.h=this.a=null;return b};\nX.prototype.destroy=X.prototype.m;X.prototype.configure=function(a){Ca(this.i,a,Ig(this),{},\"\")};X.prototype.configure=X.prototype.configure;\nX.prototype.le=function(a,b,c){function d(a){f=a}if(this.v)return Promise.reject(new t(2,9,9006));this.v=!0;var e,f=null;return Kg(this).then(function(){Y(this);return Lg(this,a,d,c)}.bind(this)).then(function(c){Y(this);this.c=c.manifest;this.b=c.Lc;if(this.c.presentationTimeline.$()||this.c.presentationTimeline.va())throw new t(2,9,9005,a);this.c.periods.forEach(this.o.bind(this));this.g=this.a.c.manifest++;this.l=0;c=this.c.periods.map(this.B.bind(this));var d=this.b.b,f=jb(this.b);if(d){if(!f.length)throw new t(2,\n9,9007,a);d.initData=[]}e={key:this.g,originalManifestUri:a,duration:this.l,size:0,expiration:this.b.ab(),periods:c,sessionIds:f,drmInfo:d,appMetadata:b};return ig(this.h,e)}.bind(this)).then(function(){Y(this);if(f)throw f;return Mg(this)}.bind(this)).then(function(){return $f(e)}.bind(this))[\"catch\"](function(a){return Mg(this)[\"catch\"](y).then(function(){throw a;})}.bind(this))};X.prototype.store=X.prototype.le;\nX.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 t(2,9,9004,c));var e=null,f,g,h=Number(d[1]);return Kg(this).then(function(){Y(this);return this.a.get(\"manifest\",h)}.bind(this)).then(function(a){Y(this);if(!a)throw new t(2,9,9003,c);f=a;a=lg(f);g=new bb(this.f.o,b,function(){},function(){});g.configure(this.f.getConfiguration().drm);return g.init(a,!0)}.bind(this)).then(function(){return gb(g,f.sessionIds)}.bind(this)).then(function(){return g.m()}.bind(this)).then(function(){Y(this);\nif(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(x,[])}).reduce(x,[]),c=0,d=b.length,g=this.i.progressCallback;return Xf(this.a,b,function(){c++;g(a,c/d)})}.bind(this)).then(function(){Y(this);this.i.progressCallback(a,1);return this.a.remove(\"manifest\",\nh)}.bind(this))};X.prototype.remove=X.prototype.remove;X.prototype.list=function(){var a=[];return Kg(this).then(function(){Y(this);return this.a.forEach(\"manifest\",function(b){a.push($f(b))})}.bind(this)).then(function(){return a})};X.prototype.list=X.prototype.list;\nfunction Lg(a,b,c,d){function e(){}var f=a.f.o,g=a.f.getConfiguration(),h,l,m;return Gd(b,f,g.manifest.retryParameters,d).then(function(a){Y(this);m=new a;m.configure(g.manifest);return m.start(b,{networkingEngine:f,filterPeriod:this.o.bind(this),onTimelineRegionAdded:function(){},onEvent:function(){},onError:c})}.bind(a)).then(function(a){Y(this);h=a;l=new bb(f,c,e,function(){});l.configure(g.drm);return l.init(h,!0)}.bind(a)).then(function(){Y(this);return Ng(h)}.bind(a)).then(function(){Y(this);\nreturn fb(l)}.bind(a)).then(function(){Y(this);return m.stop()}.bind(a)).then(function(){Y(this);return{manifest:h,Lc:l}}.bind(a))[\"catch\"](function(a){if(m)return m.stop().then(function(){throw a;});throw a;})}\nX.prototype.A=function(a){for(var b=[],c=Sb(this.f.getConfiguration().preferredAudioLanguage),d=[0,Qb,Rb],e=a.filter(function(a){return\"variant\"==a.type}),d=d.map(function(a){return e.filter(function(b){b=Sb(b.language);return Pb(a,c,b)})}),f,g=0;g<d.length;g++)if(d[g].length){f=d[g];break}f||(d=e.filter(function(a){return a.primary}),d.length&&(f=d));f||(f=e,e.map(function(a){return a.language}).filter(Aa));var h=f.filter(function(a){return a.height&&480>=a.height});h.length&&(h.sort(function(a,\nb){return b.height-a.height}),f=h.filter(function(a){return a.height==h[0].height}));f.sort(function(a,b){return a.bandwidth-b.bandwidth});f.length&&b.push(f[Math.floor(f.length/2)]);b.push.apply(b,a.filter(function(a){return\"text\"==a.type}));return b};function Ig(a){return{trackSelectionCallback:a.A.bind(a),progressCallback:function(a,c){if(a||c)return null}}}function Kg(a){return a.a?a.a.a?Promise.resolve():a.a.init(Zf):Promise.reject(new t(2,9,9E3))}\nX.prototype.o=function(a){var b={};if(this.j){var c=this.j.filter(function(a){return\"variant\"==a.type}),d=null;c.length&&(d=bc(a,c[0]));d&&(d.video&&(b.video=d.video),d.audio&&(b.audio=d.audio))}Wb(this.b,b,a);Vb(a,this.f.getConfiguration().restrictions,{width:Infinity,height:Infinity})};function Mg(a){var b=a.b?a.b.m():Promise.resolve();a.b=null;a.c=null;a.v=!1;a.j=null;a.g=-1;return b}\nfunction Ng(a){var b=a.periods.map(function(a){return a.variants}).reduce(x,[]).map(function(a){var b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);return b}).reduce(x,[]).filter(Aa);a=a.periods.map(function(a){return a.textStreams}).reduce(x,[]);b.push.apply(b,a);return Promise.all(b.map(function(a){return a.createSegmentIndex()}))}\nX.prototype.B=function(a){var b,c,d=Zb(a,null,null),e=ac(a,null),d=this.i.trackSelectionCallback(d.concat(e));this.j||(this.j=d,this.c.periods.forEach(this.o.bind(this)));for(e=d.length-1;0<e;--e){var f=!1;for(c=e-1;0<=c;--c)if(d[e].type==d[c].type&&d[e].kind==d[c].kind&&d[e].language==d[c].language){f=!0;break}if(f)break}f=[];for(e=0;e<d.length;e++)(b=bc(a,d[e]))?(b.audio&&((c=f.filter(function(a){return a.id==b.audio.id})[0])?c.variantIds.push(b.id):(c=b.video?b.bandwidth/2:b.bandwidth,f.push(Og(this,\na,b.audio,c,b.id)))),b.video&&((c=f.filter(function(a){return a.id==b.video.id})[0])?c.variantIds.push(b.id):(c=b.audio?b.bandwidth/2:b.bandwidth,f.push(Og(this,a,b.video,c,b.id))))):f.push(Og(this,a,cc(a,d[e]),0));return{startTime:a.startTime,streams:f}};\nfunction Og(a,b,c,d,e){var f=[],g=a.c.presentationTimeline.ma();var h=g;for(var l=c.findSegmentPosition(g),m=null!=l?c.getSegmentReference(l):null;m;)h=a.a.c.segment++,hg(a.h,c.type,m,(m.endTime-m.startTime)*d/8,{key:h,data:null,manifestKey:a.g,streamNumber:c.id,segmentNumber:h}),f.push({startTime:m.startTime,endTime:m.endTime,uri:\"offline:\"+a.g+\"/\"+c.id+\"/\"+h}),h=m.endTime+b.startTime,m=c.getSegmentReference(++l);a.l=Math.max(a.l,h-g);b=null;c.initSegmentReference&&(h=a.a.c.segment++,b=\"offline:\"+\na.g+\"/\"+c.id+\"/\"+h,hg(a.h,c.contentType,c.initSegmentReference,0,{key:h,data:null,manifestKey:a.g,streamNumber:c.id,segmentNumber:-1}));a=[];null!=e&&a.push(e);return{id:c.id,primary:c.primary,presentationTimeOffset:c.presentationTimeOffset||0,contentType:c.type,mimeType:c.mimeType,codecs:c.codecs,frameRate:c.frameRate,kind:c.kind,language:c.language,label:c.label,width:c.width||null,height:c.height||null,initSegmentUri:b,encrypted:c.encrypted,keyId:c.keyId,segments:f,variantIds:a}}\nfunction Y(a){if(!a.f)throw new t(2,9,9002);}tg.offline=Jg;n(\"shaka.polyfill.installAll\",function(){for(var a=0;a<Pg.length;++a)Pg[a]()});var Pg=[];function Qg(a){Pg.push(a)}n(\"shaka.polyfill.register\",Qg);function Rg(a){var b=a.type.replace(/^(webkit|moz|MS)/,\"\").toLowerCase();if(\"function\"===typeof Event)var c=new Event(b,a);else c=document.createEvent(\"Event\"),c.initEvent(b,a.bubbles,a.cancelable);a.target.dispatchEvent(c)}\nQg(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(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,\n\"fullscreenEnabled\",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}}));document.addEventListener(\"webkitfullscreenchange\",Rg);document.addEventListener(\"webkitfullscreenerror\",Rg);document.addEventListener(\"mozfullscreenchange\",Rg);document.addEventListener(\"mozfullscreenerror\",Rg);document.addEventListener(\"MSFullscreenChange\",Rg);document.addEventListener(\"MSFullscreenError\",Rg)}});Qg(function(){var a=navigator.userAgent;a&&0<=a.indexOf(\"CrKey\")&&delete window.indexedDB});Qg(function(){if(4503599627370497!=Math.round(4503599627370497)){var a=Math.round;Math.round=function(b){var c=b;4503599627370496>=b&&(c=a(b));return c}}});function Sg(a){this.f=[];this.b=[];this.a=[];(new Q).da(\"pssh\",this.c.bind(this)).parse(a.buffer)}Sg.prototype.c=function(a){if(!(1<a.version)){var b=$a(a.s.Ka(16)),c=[];if(0<a.version)for(var d=a.s.D(),e=0;e<d;++e){var f=$a(a.s.Ka(16));c.push(f)}d=a.s.D();a.s.I(d);this.b.push.apply(this.b,c);this.f.push(b);this.a.push({start:a.start,end:a.start+a.size-1})}};function Tg(a,b){try{var c=new Ug(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}\nfunction Ug(a,b){this.keySystem=a;for(var c=!1,d=0;d<b.length;++d){var e=b[d];var 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){g=!0;var m=l.contentType.split(\";\")[0];MSMediaKeys.isTypeSupported(this.keySystem,m)&&(f.audioCapabilities.push(l),c=!0)}}if(e.videoCapabilities)for(h=\n0;h<e.videoCapabilities.length;++h)l=e.videoCapabilities[h],l.contentType&&(g=!0,m=l.contentType.split(\";\")[0],MSMediaKeys.isTypeSupported(this.keySystem,m)&&(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}}e=Error(\"Unsupported keySystem\");e.name=\"NotSupportedError\";e.code=DOMException.NOT_SUPPORTED_ERR;throw e;}\nUg.prototype.createMediaKeys=function(){var a=new Vg(this.keySystem);return Promise.resolve(a)};Ug.prototype.getConfiguration=function(){return this.a};function Wg(a){var b=this.mediaKeys;b&&b!=a&&Xg(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?Xg(a,this):Promise.resolve()}function Vg(a){this.a=new MSMediaKeys(a);this.b=new D}Vg.prototype.createSession=function(a){if(\"temporary\"!=(a||\"temporary\"))throw new TypeError(\"Session type \"+a+\" is unsupported on this platform.\");return new Yg(this.a)};\nVg.prototype.setServerCertificate=function(){return Promise.resolve(!1)};function Xg(a,b){function c(){b.msSetMediaKeys(d.a);b.removeEventListener(\"loadedmetadata\",c)}Ja(a.b);if(!b)return Promise.resolve();E(a.b,b,\"msneedkey\",Zg);var d=a;try{return 1<=b.readyState?b.msSetMediaKeys(a.a):b.addEventListener(\"loadedmetadata\",c),Promise.resolve()}catch(e){return Promise.reject(e)}}\nfunction Yg(a){p.call(this);this.c=null;this.g=a;this.b=this.a=null;this.f=new D;this.sessionId=\"\";this.expiration=NaN;this.closed=new A;this.keyStatuses=new $g}ba(Yg);k=Yg.prototype;k.generateRequest=function(a,b){this.a=new A;try{this.c=this.g.createSession(\"video/mp4\",new Uint8Array(b),null),E(this.f,this.c,\"mskeymessage\",this.pd.bind(this)),E(this.f,this.c,\"mskeyadded\",this.nd.bind(this)),E(this.f,this.c,\"mskeyerror\",this.od.bind(this)),ah(this,\"status-pending\")}catch(c){this.a.reject(c)}return this.a};\nk.load=function(){return Promise.reject(Error(\"MediaKeySession.load not yet supported\"))};k.update=function(a){this.b=new A;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(),Ja(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\"))};\nfunction Zg(a){var b=document.createEvent(\"CustomEvent\");b.initCustomEvent(\"encrypted\",!1,!1,null);b.initDataType=\"cenc\";var c=a.initData;if(c){var d=new Sg(c);if(1>=d.a.length)a=c;else{var e=[];for(a=0;a<d.a.length;a++)e.push(c.subarray(d.a[a].start,d.a[a].end+1));c=Ga(e,bh);for(a=d=0;a<c.length;a++)d+=c[a].length;d=new Uint8Array(d);for(a=e=0;a<c.length;a++)d.set(c[a],e),e+=c[a].length;a=d}}else a=c;b.initData=a;this.dispatchEvent(b)}function bh(a,b){return ab(a,b)}\nk.pd=function(a){this.a&&(this.a.resolve(),this.a=null);this.dispatchEvent(new I(\"message\",{messageType:void 0==this.keyStatuses.sb()?\"licenserequest\":\"licenserenewal\",message:a.message.buffer}))};k.nd=function(){this.a?(ah(this,\"usable\"),this.a.resolve(),this.a=null):this.b&&(ah(this,\"usable\"),this.b.resolve(),this.b=null)};\nk.od=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:ah(this,\"output-not-allowed\");default:ah(this,\"internal-error\")}};function ah(a,b){a.keyStatuses.Kb(b);a.dispatchEvent(new I(\"keystatuseschange\"))}function $g(){this.size=0;this.a=void 0}var ch;k=$g.prototype;\nk.Kb=function(a){this.size=void 0==a?0:1;this.a=a};k.sb=function(){return this.a};k.forEach=function(a){this.a&&a(this.a,ch)};k.get=function(a){if(this.has(a))return this.a};k.has=function(a){var b=ch;return this.a&&ab(new Uint8Array(a),new Uint8Array(b))?!0:!1};k.entries=function(){};k.keys=function(){};k.values=function(){};function dh(){return Promise.reject(Error(\"The key system specified is not supported.\"))}function eh(a){return a?Promise.reject(Error(\"MediaKeys not supported.\")):Promise.resolve()}function fh(){throw new TypeError(\"Illegal constructor.\");}fh.prototype.createSession=function(){};fh.prototype.setServerCertificate=function(){};function gh(){throw new TypeError(\"Illegal constructor.\");}gh.prototype.getConfiguration=function(){};gh.prototype.createMediaKeys=function(){};var hh=\"\";function ih(a){hh=a;jh=(new Uint8Array([0])).buffer;navigator.requestMediaKeySystemAccess=kh;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=lh;window.MediaKeys=mh;window.MediaKeySystemAccess=nh}function oh(a){var b=hh;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function kh(a,b){try{var c=new nh(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}\nfunction lh(a){var b=this.mediaKeys;b&&b!=a&&ph(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&ph(a,this);return Promise.resolve()}\nfunction nh(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;var e=document.getElementsByTagName(\"video\");var f=e.length?e[0]:document.createElement(\"video\");for(var g=0;g<b.length;++g){e=b[g];var h={audioCapabilities:[],videoCapabilities:[],persistentState:\"optional\",distinctiveIdentifier:\"optional\",initDataTypes:e.initDataTypes,sessionTypes:[\"temporary\"],label:e.label},l=!1;if(e.audioCapabilities)for(var m=0;m<e.audioCapabilities.length;++m){var q=\ne.audioCapabilities[m];if(q.contentType){var l=!0,r=q.contentType.split(\";\")[0];f.canPlayType(r,this.a)&&(h.audioCapabilities.push(q),d=!0)}}if(e.videoCapabilities)for(m=0;m<e.videoCapabilities.length;++m)q=e.videoCapabilities[m],q.contentType&&(l=!0,f.canPlayType(q.contentType,this.a)&&(h.videoCapabilities.push(q),d=!0));l||(d=f.canPlayType(\"video/mp4\",this.a)||f.canPlayType(\"video/webm\",this.a));\"required\"==e.persistentState&&(c?(h.persistentState=\"required\",h.sessionTypes=[\"persistent-license\"]):\nd=!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;}nh.prototype.createMediaKeys=function(){var a=new mh(this.a);return Promise.resolve(a)};nh.prototype.getConfiguration=function(){return this.b};function mh(a){this.g=a;this.b=null;this.a=new D;this.c=[];this.f={}}\nfunction ph(a,b){a.b=b;Ja(a.a);var c=hh;b&&(E(a.a,b,c+\"needkey\",a.Cd.bind(a)),E(a.a,b,c+\"keymessage\",a.Bd.bind(a)),E(a.a,b,c+\"keyadded\",a.zd.bind(a)),E(a.a,b,c+\"keyerror\",a.Ad.bind(a)))}k=mh.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 qh(a,this.g,b);this.c.push(b);return b};\nk.setServerCertificate=function(){return Promise.resolve(!1)};k.Cd=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.Bd=function(a){var b=rh(this,a.sessionId);b&&(a=new I(\"message\",{messageType:void 0==b.keyStatuses.sb()?\"licenserequest\":\"licenserenewal\",message:a.message}),b.b&&(b.b.resolve(),b.b=null),b.dispatchEvent(a))};\nk.zd=function(a){if(a=rh(this,a.sessionId))sh(a,\"usable\"),a.a&&a.a.resolve(),a.a=null};\nk.Ad=function(a){var b=rh(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?sh(b,\"output-restricted\"):1==c?sh(b,\"expired\"):sh(b,\"internal-error\"))}};\nfunction rh(a,b){var c=a.f[b];return c?c:(c=a.c.shift())?(c.sessionId=b,a.f[b]=c):null}function qh(a,b,c){p.call(this);this.f=a;this.h=!1;this.a=this.b=null;this.c=b;this.g=c;this.sessionId=\"\";this.expiration=NaN;this.closed=new A;this.keyStatuses=new th}ba(qh);\nfunction uh(a,b,c){if(a.h)return Promise.reject(Error(\"The session is already initialized.\"));a.h=!0;try{if(\"persistent-license\"==a.g)if(c)var d=new Uint8Array(Ua(\"LOAD_SESSION|\"+c));else{var e=Ua(\"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 A;var g=oh(\"generateKeyRequest\");try{a.f[g](a.c,d)}catch(h){if(\"InvalidStateError\"!=h.name)return a.b=null,Promise.reject(h);\nsetTimeout(function(){try{this.f[g](this.c,d)}catch(l){this.b.reject(l),this.b=null}}.bind(a),10)}return a.b}k=qh.prototype;\nk.Mb=function(a,b){if(this.a)this.a.then(this.Mb.bind(this,a,b))[\"catch\"](this.Mb.bind(this,a,b));else{this.a=a;if(\"webkit-org.w3.clearkey\"==this.c){var c=F(b);var 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=Ya(d.keys[0].k);d=Ya(d.keys[0].kid)}else c=new Uint8Array(b),d=null;var e=oh(\"addKey\");try{this.f[e](this.c,c,d,this.sessionId)}catch(f){this.a.reject(f),this.a=null}}};\nfunction sh(a,b){a.keyStatuses.Kb(b);a.dispatchEvent(new I(\"keystatuseschange\"))}k.generateRequest=function(a,b){return uh(this,b,null)};k.load=function(a){return\"persistent-license\"==this.g?uh(this,null,a):Promise.reject(Error(\"Not a persistent session.\"))};k.update=function(a){var b=new A;this.Mb(b,a);return b};\nk.close=function(){if(\"persistent-license\"!=this.g){if(!this.sessionId)return this.closed.reject(Error(\"The session is not callable.\")),this.closed;var a=oh(\"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 th(){this.size=0;this.a=void 0}var jh;k=th.prototype;k.Kb=function(a){this.size=void 0==a?0:1;this.a=a};\nk.sb=function(){return this.a};k.forEach=function(a){this.a&&a(this.a,jh)};k.get=function(a){if(this.has(a))return this.a};k.has=function(a){var b=jh;return this.a&&ab(new Uint8Array(a),new Uint8Array(b))?!0:!1};k.entries=function(){};k.keys=function(){};k.values=function(){};Qg(function(){!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(HTMLMediaElement.prototype.webkitGenerateKeyRequest?ih(\"webkit\"):HTMLMediaElement.prototype.generateKeyRequest?ih(\"\"):window.MSMediaKeys?(ch=(new Uint8Array([0])).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=Wg,window.MediaKeys=Vg,window.MediaKeySystemAccess=Ug,navigator.requestMediaKeySystemAccess=\nTg):(navigator.requestMediaKeySystemAccess=dh,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=eh,window.MediaKeys=fh,window.MediaKeySystemAccess=gh))});function vh(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var b=a.apply(this,arguments);b.abort=function(){};return b}}\nfunction wh(){var a=MediaSource.prototype.endOfStream;MediaSource.prototype.endOfStream=function(){for(var b,d=0,e=0;e<this.sourceBuffers.length;++e)b=this.sourceBuffers[e],b=b.buffered.end(b.buffered.length-1),d=Math.max(d,b);if(!isNaN(this.duration)&&d<this.duration)for(this.Zb=!0,e=0;e<this.sourceBuffers.length;++e)b=this.sourceBuffers[e],b.Tb=!1;return a.apply(this,arguments)};var b=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var a=b.apply(this,arguments);\na.N=this;a.addEventListener(\"updateend\",xh,!1);this.a||(this.addEventListener(\"sourceclose\",yh,!1),this.a=!0);return a}}function xh(a){var b=a.target,c=b.N;if(c.Zb){a.preventDefault();a.stopPropagation();a.stopImmediatePropagation();b.Tb=!0;for(a=0;a<c.sourceBuffers.length;++a)if(0==c.sourceBuffers[a].Tb)return;c.Zb=!1}}function yh(a){a=a.target;for(var b=0;b<a.sourceBuffers.length;++b)a.sourceBuffers[b].removeEventListener(\"updateend\",xh,!1);a.removeEventListener(\"sourceclose\",yh,!1)}\nQg(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\")?vh():0<=b.indexOf(\"Version/10\")&&(vh(),wh()))}});function Z(a){this.c=[];this.b=[];this.Aa=zh;if(a)try{a(this.fa.bind(this),this.a.bind(this))}catch(b){this.a(b)}}var zh=0;function Ah(a){var b=new Z;b.fa(void 0);return b.then(function(){return a})}function Bh(a){var b=new Z;b.a(a);return b}function Ch(a){function b(a,b,c){a.Aa==zh&&(e[b]=c,d++,d==e.length&&a.fa(e))}var c=new Z;if(!a.length)return c.fa([]),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}\nfunction Dh(a){for(var b=new Z,c=b.fa.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.Aa){case 1:Eh(this,c,a);break;case 2:Eh(this,c,b);break;case zh:this.c.push({L:c,pb:a}),this.b.push({L:c,pb:b})}return c};Z.prototype[\"catch\"]=function(a){return this.then(void 0,a)};\nZ.prototype.fa=function(a){if(this.Aa==zh){this.jb=a;this.Aa=1;for(a=0;a<this.c.length;++a)Eh(this,this.c[a].L,this.c[a].pb);this.c=[];this.b=[]}};Z.prototype.a=function(a){if(this.Aa==zh){this.jb=a;this.Aa=2;for(a=0;a<this.b.length;++a)Eh(this,this.b[a].L,this.b[a].pb);this.c=[];this.b=[]}};\nfunction Eh(a,b,c){Fh.push(function(){if(c&&\"function\"==typeof c){try{var a=c(this.jb)}catch(f){b.a(f);return}try{var 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.fa.bind(b),b.a.bind(b)):e?Gh(a,e,b):b.fa(a)}else 1==this.Aa?b.fa(this.jb):b.a(this.jb)}.bind(a));null==Hh&&(Hh=Ih(Jh))}\nfunction Gh(a,b,c){try{var d=!1;b.call(a,function(a){if(!d){d=!0;try{var b=a&&a.then}catch(g){c.a(g);return}b?Gh(a,b,c):c.fa(a)}},c.a.bind(c))}catch(e){c.a(e)}}function Jh(){for(;Fh.length;){null!=Hh&&(Kh(Hh),Hh=null);var a=Fh;Fh=[];for(var b=0;b<a.length;++b)a[b]()}}function Ih(){return 0}function Kh(){}var Hh=null,Fh=[];\nQg(function(a){window.setImmediate?(Ih=function(a){return window.setImmediate(a)},Kh=function(a){return window.clearImmediate(a)}):(Ih=function(a){return window.setTimeout(a,0)},Kh=function(a){return window.clearTimeout(a)});if(!window.Promise||a)window.Promise=Z,window.Promise.resolve=Ah,window.Promise.reject=Bh,window.Promise.all=Ch,window.Promise.race=Dh,window.Promise.prototype.then=Z.prototype.then,window.Promise.prototype[\"catch\"]=Z.prototype[\"catch\"]});Qg(function(){if(window.HTMLMediaElement){var a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var b=a.apply(this,arguments);b&&b[\"catch\"](function(){});return b}}});function Lh(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}Qg(function(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&\"webkitDroppedFrameCount\"in a&&(a.getVideoPlaybackQuality=Lh)}});function Mh(a,b,c){return new window.TextTrackCue(a,b,c)}function Nh(a,b,c){return new window.TextTrackCue(a+\"-\"+b+\"-\"+c,a,b,c)}Qg(function(){if(!window.VTTCue&&window.TextTrackCue){var a=TextTrackCue.length;if(3==a)window.VTTCue=Mh;else if(6==a)window.VTTCue=Nh;else{try{var b=!!Mh(1,2,\"\")}catch(c){b=!1}b&&(window.VTTCue=Mh)}}});}.call(g,this));\nif (typeof(module)!=\"undefined\"&&module.exports)module.exports=g.shaka;\nelse if (true)!(__WEBPACK_AMD_DEFINE_RESULT__ = function(){return g.shaka}.call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\nelse this.shaka=g.shaka;\n})();\n\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = setup;\n\nvar _playkitJs = __webpack_require__(0);\n\nvar Playkit = _interopRequireWildcard(_playkitJs);\n\nvar _ovpProvider = __webpack_require__(1);\n\nvar _ovpProvider2 = _interopRequireDefault(_ovpProvider);\n\nvar _sessionId = __webpack_require__(14);\n\nvar _sessionId2 = _interopRequireDefault(_sessionId);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n/**\n *\n * @param {Object} config - contains partnerId and entryID\n * @return {Promise<*>} - player promise\n */\nfunction setup(config) {\n var player = Playkit.playkit();\n player.addEventListener(player.Event.SOURCE_SELECTED, function (event) {\n (0, _sessionId2.default)(event.payload.selectedSource, player);\n });\n if (config) {\n var provider = new _ovpProvider2.default(config.partnerId);\n return provider.getConfig(config.entryID).then(function (data) {\n player.configure(data);\n return Promise.resolve(player);\n }).catch(function (error) {\n return Promise.reject(error);\n });\n } else {\n return Promise.resolve(player);\n }\n}\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\n/**\n * @return {string} - GUID\n * @private\n */\nfunction _generateGUID() {\n var S4 = function S4() {\n return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);\n };\n return S4() + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + S4() + S4();\n}\n\n/**\n * @param {Object} selectedSource - selected source\n * @param {Player} player - player\n * @return {void}\n * @private\n */\nfunction _addSessionId(selectedSource, player) {\n var delimiter = selectedSource.url.indexOf('?') === -1 ? '?' : '&';\n var primaryGUID = _generateGUID();\n var secondGUID = _generateGUID();\n var sessionId = primaryGUID + ':' + secondGUID;\n selectedSource.url += delimiter + 'playSessionId=' + sessionId;\n player.sessionId = sessionId;\n}\n\n/**\n * @param {Object} selectedSource - selected source\n * @param {string} sessionId - session id\n * @param {Player} player - player\n * @return {void}\n * @private\n */\nfunction _replaceSecondGUID(selectedSource, sessionId, player) {\n var secondGUIDRegex = /:((?:[a-z0-9]|-)*)/i;\n var secondGUID = secondGUIDRegex.exec(sessionId);\n if (secondGUID && secondGUID[1]) {\n var newSessionId = sessionId.replace(secondGUID[1], _generateGUID());\n selectedSource.url = selectedSource.url.replace(sessionId, newSessionId);\n player.sessionId = newSessionId;\n }\n}\n\n/**\n * @param {Object} selectedSource - selected source\n * @param {Player} player - player\n * @return {void}\n * @public\n */\nfunction handleSessionId() {\n var selectedSource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var player = arguments[1];\n\n if (typeof selectedSource.url === 'string' && selectedSource.url.toLowerCase().indexOf('playmanifest/') !== -1) {\n var sessionIdRegex = /playSessionId=((?:[a-z0-9]|-|:)*)/i;\n var sessionId = sessionIdRegex.exec(selectedSource.url);\n if (sessionId && sessionId[1]) {\n _replaceSecondGUID(selectedSource, sessionId[1], player);\n } else {\n _addSessionId(selectedSource, player);\n }\n }\n}\n\nexports.default = handleSessionId;\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// kaltura-player.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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap fd0d76b9299a74bc6e92","(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(\"Playkit\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Playkit\"] = factory();\n\telse\n\t\troot[\"Playkit\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///core/webpack/universalModuleDefinition"," \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\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 21);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2c6e69a47798e2a1ec2f\n\n\n// WEBPACK FOOTER //\n// webpack:/core/webpack/bootstrap 2c6e69a47798e2a1ec2f","//@flow\n\n/**\n * General track representation of the player.\n * @classdesc\n */\nexport default class Track {\n /**\n * The id of the track.\n * @member\n * @type {string}\n * @private\n */\n _id: ?string;\n /**\n * The active mode of the track.\n * @member\n * @type {boolean}\n * @private\n */\n _active: boolean;\n /**\n * The label of the track.\n * @member\n * @type {string}\n * @private\n */\n _label: string;\n /**\n * The language of the track.\n * @member\n * @type {string}\n * @private\n */\n _language: string;\n /**\n * The index of the track.\n * @member\n * @type {number}\n * @private\n */\n _index: number;\n\n /**\n * Getter for the track id.\n * @public\n * @returns {?string} - The track id.\n */\n get id(): ?string {\n return this._id;\n }\n\n /**\n * Getter for the active mode of the track.\n * @public\n * @returns {boolean} - The active mode of the track.\n */\n get active(): boolean {\n return this._active;\n }\n\n /**\n * Setter for the active mode of the track.\n * @public\n * @param {boolean} value - Whether the track is active or not.\n */\n set active(value: boolean) {\n this._active = value;\n }\n\n /**\n * Getter for the label of the track.\n * @public\n * @returns {string} - The label of the track.\n */\n get label(): string {\n return this._label;\n }\n\n /**\n * Getter for the language of the track.\n * @public\n * @returns {string} - The language of the track.\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Getter for the index of the track.\n * @public\n * @returns {number} - The index of the track.\n */\n get index(): number {\n return this._index;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n constructor(settings: Object = {}) {\n this._id = settings.id;\n this._active = settings.active;\n this._label = settings.label;\n this._language = settings.language;\n this._index = settings.index;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./track/track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/track.js","//@flow\nimport * as JsLogger from 'js-logger';\n\nconst LOG_LEVEL: { [level: string]: Object } = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nclass LoggerFactory {\n constructor(options?: Object) {\n JsLogger.useDefaults(options || {});\n }\n\n getLogger(name?: string) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n}\n\nconst lf = new LoggerFactory({defaultLevel: JsLogger.DEBUG});\n\nexport default lf;\nexport {LOG_LEVEL};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/logger.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/logger.js","//@flow\n/**\n * Create an Event work-alike object based on the dictionary.\n * The event should contain all of the same properties from the dict.\n * @param {string} type -\n * @param {Object=} opt_dict -\n * @constructor\n * @extends {Event}\n */\nclass FakeEvent {\n /** @const {boolean} */\n bubbles: boolean;\n\n /** @const {boolean} */\n cancelable: boolean;\n\n /** @const {boolean} */\n defaultPrevented: boolean;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n timeStamp: number | Date;\n\n /** @const {string} */\n type: string;\n\n /** @const {boolean} */\n isTrusted: boolean;\n\n /** @type {EventTarget} */\n currentTarget: any;\n\n /** @type {EventTarget} */\n target: any;\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n stopped: boolean;\n\n payload: any;\n\n constructor(type: string, payload: any) {\n // These Properties below cannot be set by dict. They are all provided for\n // compatibility with native events.\n\n /** @const {boolean} */\n this.bubbles = false;\n\n /** @const {boolean} */\n this.cancelable = false;\n\n /** @const {boolean} */\n this.defaultPrevented = false;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n this.timeStamp = window.performance ? window.performance.now() : Date.now();\n\n /** @const {string} */\n this.type = type;\n\n /** @const {boolean} */\n this.isTrusted = false;\n\n /** @type {EventTarget} */\n this.currentTarget = null;\n\n /** @type {EventTarget} */\n this.target = null;\n\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n this.stopped = false;\n\n this.payload = payload;\n }\n\n /**\n * Does nothing, since FakeEvents have no default. Provided for compatibility\n * with native Events.\n * @override\n */\n preventDefault() {\n }\n\n /**\n * Stops processing event listeners for this event. Provided for compatibility\n * with native Events.\n * @override\n */\n stopImmediatePropagation() {\n this.stopped = true;\n }\n\n /**\n * Does nothing, since FakeEvents do not bubble. Provided for compatibility\n * with native Events.\n * @override\n */\n stopPropagation() {\n }\n}\n\nexport default FakeEvent;\n\n\n\n// WEBPACK FOOTER //\n// ./event/fake-event.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/fake-event.js","//@flow\nimport Track from './track'\n\n/**\n * Audio track representation of the player.\n * @classdesc\n */\nexport default class AudioTrack extends Track {}\n\n\n\n// WEBPACK FOOTER //\n// ./track/audio-track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/audio-track.js","//@flow\nimport Track from './track'\n\n/**\n * Text track representation of the player.\n * @classdesc\n */\nexport default class TextTrack extends Track {\n /**\n * The kind of the text track:\n * subtitles/captions/metadata.\n * @member\n * @type {string}\n * @private\n */\n _kind: string;\n\n /**\n * Getter for the kind of the text track.\n * @public\n * @returns {string} - The kind of the text track.\n */\n get kind(): string {\n return this._kind;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n constructor(settings: Object = {}) {\n super(settings);\n this._kind = settings.kind;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./track/text-track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/text-track.js","//@flow\nimport Track from './track'\n\n/**\n * Video track representation of the player.\n * @classdesc\n */\nexport default class VideoTrack extends Track {\n /**\n * The kind of the text track:\n * subtitles/captions/metadata.\n * @member\n * @type {string}\n * @private\n */\n _bandwidth: string;\n\n /**\n * Getter for the kind of the text track.\n * @public\n * @returns {string} - The kind of the text track.\n */\n get bandwidth(): string {\n return this._bandwidth;\n }\n\n /**\n * @constructor\n * @param {Object} settings - The track settings object.\n */\n constructor(settings: Object = {}) {\n super(settings);\n this._bandwidth = settings.bandwidth;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./track/video-track.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/video-track.js","//@flow\nimport MultiMap from '../utils/multi-map'\nimport FakeEvent from './fake-event'\n\n/**\n * Creates a new EventManager. An EventManager maintains a collection of \"event\n * bindings\" between event targets and event listeners.\n *\n * @struct\n * @constructor\n * @implements {IDestroyable}\n */\nclass EventManager {\n _bindingMap: MultiMap<Binding_> | null;\n\n constructor() {\n /**\n * Maps an event type to an array of event bindings.\n * @private {MultiMap.<!EventManager.Binding_>}\n */\n this._bindingMap = new MultiMap();\n }\n\n /**\n * Detaches all event listeners.\n * @override\n */\n destroy() {\n this.removeAll();\n this._bindingMap = null;\n return Promise.resolve();\n }\n\n\n /**\n * Attaches an event listener to an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {EventManager.ListenerType} listener The event listener.\n * @returns {void}\n */\n listen(target: any, type: string, listener: ListenerType): void {\n let binding = new Binding_(target, type, listener);\n if (this._bindingMap) {\n this._bindingMap.push(type, binding);\n }\n }\n\n\n /**\n * Detaches an event listener from an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @returns {void}\n */\n unlisten(target: any, type: string): void {\n if (this._bindingMap) {\n let list = this._bindingMap.get(type);\n\n for (let i = 0; i < list.length; ++i) {\n let binding = list[i];\n\n if (binding.target == target) {\n binding.unlisten();\n if (this._bindingMap) {\n this._bindingMap.remove(type, binding);\n }\n }\n }\n }\n }\n\n /**\n * Detaches all event listeners from all targets.\n * @returns {void}\n */\n removeAll(): void {\n if (this._bindingMap) {\n let listeners = this._bindingMap.getAll();\n\n for (let listener of listeners) {\n listener.unlisten();\n }\n if (this._bindingMap) {\n this._bindingMap.clear();\n }\n }\n }\n}\n\n/**\n * @typedef {function(!Event)}\n */\ntype ListenerType = (event: FakeEvent) => any;\n\n/**\n * Creates a new Binding_ and attaches the event listener to the event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {EventManager.ListenerType} listener The event listener.\n * @constructor\n * @private\n */\nclass Binding_ {\n target: any;\n type: string;\n listener: ?ListenerType;\n\n constructor(target, type, listener) {\n /** @type {EventTarget} */\n this.target = target;\n\n /** @type {string} */\n this.type = type;\n\n /** @type {?EventManager.ListenerType} */\n this.listener = listener;\n\n this.target.addEventListener(type, listener, false);\n }\n\n\n /**\n * Detaches the event listener from the event target. This does nothing if the\n * event listener is already detached.\n * @returns {void}\n */\n unlisten(): void {\n if (!this.target)\n return;\n\n this.target.removeEventListener(this.type, this.listener, false);\n\n this.target = null;\n this.listener = null;\n }\n}\n\nexport default EventManager;\n\n\n\n// WEBPACK FOOTER //\n// ./event/event-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/event-manager.js","//@flow\nimport {merge} from '../utils/util'\n\nconst HTML5_EVENTS: { [event: string]: string } = {\n /**\n * Fires when the loading of an audio/video is aborted\n */\n ABORT: 'abort',\n /**\n * Fires when the browser can start playing the audio/video\n */\n CAN_PLAY: 'canplay',\n /**\n * Fires when the browser can play through the audio/video without stopping for buffering\n */\n CAN_PLAY_THROUGH: 'canplaythrough',\n /**\n * Fires when the duration of the audio/video is changed\n */\n DURATION_CHANGE: 'durationchange',\n /**\n * Fires when the current playlist is empty\n */\n EMPTIED: 'emptied',\n /**\n * Fires when the current playlist is ended\n */\n ENDED: 'ended',\n /**\n * Fires when an error occurred during the loading of an audio/video\n */\n ERROR: 'error',\n /**\n * Fires when the browser has loaded the current frame of the audio/video\n */\n LOADED_DATA: 'loadeddata',\n /**\n * Fires when the browser has loaded meta data for the audio/video\n */\n LOADED_METADATA: 'loadedmetadata',\n /**\n * Fires when the browser starts looking for the audio/video\n */\n LOAD_START: 'loadstart',\n /**\n * Fires when the audio/video has been paused\n */\n PAUSE: 'pause',\n /**\n * Fires when the audio/video has been started or is no longer paused\n */\n PLAY: 'play',\n /**\n * Fires when the audio/video is playing after having been paused or stopped for buffering\n */\n PLAYING: 'playing',\n /**\n * Fires when the browser is downloading the audio/video\n */\n PROGRESS: 'progress',\n /**\n * Fires when the playing speed of the audio/video is changed\n */\n RATE_CHANGE: 'ratechange',\n /**\n * Fires when the user is finished moving/skipping to a new position in the audio/video\n */\n SEEKED: 'seeked',\n /**\n * Fires when the user starts moving/skipping to a new position in the audio/video\n */\n SEEKING: 'seeking',\n /**\n * Fires when the browser is trying to get media data, but data is not available\n */\n STALLED: 'stalled',\n /**\n * Fires when the browser is intentionally not getting media data\n */\n SUSPEND: 'suspend',\n /**\n * Fires when the current playback position has changed\n */\n TIME_UPDATE: 'timeupdate',\n /**\n * Fires when the volume has been changed\n */\n VOLUME_CHANGE: 'volumechange',\n /**\n * Fires when the video stops because it needs to buffer the next frame\n */\n WAITING: 'waiting',\n};\n\nconst CUSTOM_EVENTS: { [event: string]: string } = {\n /**\n * Fires when the active video track has been changed\n */\n VIDEO_TRACK_CHANGED: 'videotrackchanged',\n /**\n * Fires when the active audio track has been changed\n */\n AUDIO_TRACK_CHANGED: 'audiotrackchanged',\n /**\n * Fires when the active text track has been changed\n */\n TEXT_TRACK_CHANGED: 'texttrackchanged',\n /**\n * Fires when the player tracks have been changed\n */\n TRACKS_CHANGED: 'trackschanged',\n /**\n * Fires when the player state has been changed\n */\n PLAYER_STATE_CHANGED: 'playerstatechanged',\n /**\n * Fires on the first play\n */\n FIRST_PLAY: 'firstplay',\n /**\n * Fires when the player has selected the source to play\n */\n SOURCE_SELECTED: 'sourceselected'\n};\n\nconst PLAYER_EVENTS: { [event: string]: string } = merge([HTML5_EVENTS, CUSTOM_EVENTS]);\n\nexport {PLAYER_EVENTS, HTML5_EVENTS, CUSTOM_EVENTS};\n\n\n\n// WEBPACK FOOTER //\n// ./event/events.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/events.js","//@flow\nimport EventManager from './event/event-manager'\nimport FakeEvent from './event/fake-event'\nimport FakeEventTarget from './event/fake-event-target'\nimport {PLAYER_EVENTS as PlayerEvents, HTML5_EVENTS as Html5Events, CUSTOM_EVENTS as CustomEvents} from './event/events'\nimport PlayerStates from './state/state-types'\nimport {isNumber, isFloat, mergeDeep, copyDeep} from './utils/util'\nimport LoggerFactory from './utils/logger'\nimport Html5 from './engines/html5/html5'\nimport PluginManager from './plugin/plugin-manager'\nimport StateManager from './state/state-manager'\nimport TrackTypes from './track/track-types'\nimport Track from './track/track'\nimport VideoTrack from './track/video-track'\nimport AudioTrack from './track/audio-track'\nimport TextTrack from './track/text-track'\nimport DefaultPlayerConfig from './player-config.json'\n\n/**\n * The HTML5 player class.\n * @classdesc\n */\nexport default class Player extends FakeEventTarget {\n /**\n * The player class logger.\n * @type {any}\n * @static\n * @private\n */\n static _logger: any = LoggerFactory.getLogger('Player');\n /**\n * The plugin manager of the player.\n * @type {PluginManager}\n * @private\n */\n _pluginManager: PluginManager;\n /**\n * The event manager of the player.\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * The runtime configuration of the player.\n * @type {Object}\n * @private\n */\n _config: Object;\n /**\n * The playback engine.\n * @type {IEngine}\n * @private\n */\n _engine: IEngine;\n /**\n * The state manager of the player.\n * @type {StateManager}\n * @private\n */\n _stateManager: StateManager;\n /**\n * The tracks of the player.\n * @type {Array<Track>}\n * @private\n */\n _tracks: Array<Track>;\n /**\n * The player ready promise\n * @type {Promise<*>}\n * @private\n */\n _readyPromise: ?Promise<*>;\n /**\n * Whether the play is the first or not\n * @type {boolean}\n * @private\n */\n _firstPlay: boolean;\n /**\n * The available engines of the player.\n * @type {Array<typeof IEngine>}\n * @private\n */\n static _engines: Array<typeof IEngine> = [Html5];\n\n /**\n * @param {Object} config - The configuration for the player instance.\n * @constructor\n */\n constructor(config: Object) {\n super();\n this._tracks = [];\n this._firstPlay = true;\n this._stateManager = new StateManager(this);\n this._pluginManager = new PluginManager();\n this._eventManager = new EventManager();\n this._readyPromise = new Promise((resolve, reject) => {\n this._eventManager.listen(this, CustomEvents.TRACKS_CHANGED, () => {\n resolve();\n });\n this._eventManager.listen(this, Html5Events.ERROR, reject);\n });\n this.configure(config);\n }\n\n /**\n * Configures the player according to given configuration.\n * @param {Object} config - The configuration for the player instance.\n * @returns {void}\n */\n configure(config: Object): void {\n this._config = mergeDeep(Player._defaultConfig(), config);\n if (this._selectEngine()) {\n this._attachMedia();\n this._loadPlugins();\n this._handlePlaybackConfig();\n } else {\n Player._logger.warn(\"No playable engines was found to play the given sources\");\n }\n }\n\n /**\n * Destroys the player.\n * @returns {void}\n * @public\n */\n destroy(): void {\n if (this._engine) {\n this._engine.destroy();\n }\n this._eventManager.destroy();\n this._pluginManager.destroy();\n this._stateManager.destroy();\n this._config = {};\n this._tracks = [];\n this._readyPromise = null;\n this._firstPlay = true;\n }\n\n /**\n * @returns {Object} - The default configuration of the player.\n * @private\n * @static\n */\n static _defaultConfig(): Object {\n return copyDeep(DefaultPlayerConfig);\n }\n\n /**\n * Loads the configured plugins.\n * @private\n * @returns {void}\n */\n _loadPlugins(): void {\n let plugins = this._config.plugins;\n for (let name in plugins) {\n this._pluginManager.load(name, this, plugins[name]);\n }\n }\n\n /**\n * Selects the engine to create based on a given configuration.\n * @private\n * @returns {boolean} - Whether a proper engine was found.\n */\n _selectEngine(): boolean {\n if (this._config.sources && this._config.playback && this._config.playback.streamPriority) {\n return this._selectEngineByPriority();\n }\n return false;\n }\n\n /**\n * Selects an engine to play a source according to a given stream priority.\n * @return {boolean} - Whether a proper engine was found to play the given sources\n * according to the priority.\n * @private\n */\n _selectEngineByPriority(): boolean {\n let streamPriority = this._config.playback.streamPriority;\n let sources = this._config.sources;\n for (let priority of streamPriority) {\n let engineId = (typeof priority.engine === 'string') ? priority.engine.toLowerCase() : '';\n let format = (typeof priority.format === 'string') ? priority.format.toLowerCase() : '';\n let engine = Player._engines.find((engine) => engine.id === engineId);\n if (engine) {\n let formatSources = sources[format];\n if (formatSources && formatSources.length > 0) {\n let source = formatSources[0];\n if (engine.canPlayType(source.mimetype)) {\n this._loadEngine(engine, source);\n return true;\n }\n }\n }\n }\n return false;\n }\n\n /**\n * Loads the selected engine.\n * @param {IEngine} engine - The selected engine.\n * @param {Source} source - The selected source object.\n * @private\n * @returns {void}\n */\n _loadEngine(engine: typeof IEngine, source: Source): void {\n this.dispatchEvent(new FakeEvent(CustomEvents.SOURCE_SELECTED, {selectedSource: source}));\n this._engine = engine.createEngine(source, this._config);\n }\n\n /**\n * Listen to all HTML5 defined events and trigger them on the player\n * @private\n * @returns {void}\n */\n _attachMedia(): void {\n if (this._engine) {\n for (let playerEvent in Html5Events) {\n this._eventManager.listen(this._engine, Html5Events[playerEvent], (event: FakeEvent) => {\n return this.dispatchEvent(event);\n });\n }\n this._eventManager.listen(this._engine, CustomEvents.VIDEO_TRACK_CHANGED, (event: FakeEvent) => {\n this._markActiveTrack(event.payload.selectedVideoTrack);\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this._engine, CustomEvents.AUDIO_TRACK_CHANGED, (event: FakeEvent) => {\n this._markActiveTrack(event.payload.selectedAudioTrack);\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this._engine, CustomEvents.TEXT_TRACK_CHANGED, (event: FakeEvent) => {\n this._markActiveTrack(event.payload.selectedTextTrack);\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this, Html5Events.PLAY, this._onPlay.bind(this));\n }\n }\n\n _handlePlaybackConfig(): void {\n if (this._config.playback) {\n if (this._config.playback.muted) {\n this.muted = true;\n }\n if (this._config.playback.preload === \"auto\") {\n this.load();\n }\n if (this._config.playback.autoplay) {\n this.play();\n }\n }\n }\n\n /**\n * Returns the tracks according to the filter. if no filter given returns the all tracks.\n * @function getTracks\n * @param {string} [type] - a tracks filter, should be 'video', 'audio' or 'text'.\n * @returns {Array<Track>} - The parsed tracks.\n * @public\n */\n getTracks(type?: string): Array<Track> {\n return this._getTracksByType(type);\n }\n\n /**\n * Returns the tracks according to the filter. if no filter given returns the all tracks.\n * @function _getTracksByType\n * @param {string} [type] - a tracks filter, should be 'video', 'audio' or 'text'.\n * @returns {Array<Track>} - The parsed tracks.\n * @private\n */\n _getTracksByType(type?: string): Array<Track> {\n return !type ? this._tracks : this._tracks.filter((track: Track) => {\n if (type === TrackTypes.VIDEO) {\n return track instanceof VideoTrack;\n } else if (type === TrackTypes.AUDIO) {\n return track instanceof AudioTrack;\n } else if (type === TrackTypes.TEXT) {\n return track instanceof TextTrack;\n } else {\n return true;\n }\n });\n }\n\n /**\n * Select a track\n * @function selectTrack\n * @param {Track} track - the track to select\n * @returns {void}\n * @public\n */\n selectTrack(track: Track): void {\n if (this._engine) {\n if (track instanceof VideoTrack) {\n this._engine.selectVideoTrack(track);\n } else if (track instanceof AudioTrack) {\n this._engine.selectAudioTrack(track);\n } else if (track instanceof TextTrack) {\n this._engine.selectTextTrack(track);\n }\n }\n }\n\n /**\n * Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n hideTextTrack(): void {\n if (this._engine) {\n this._engine.hideTextTrack();\n this._getTracksByType(TrackTypes.TEXT).map(track => track.active = false);\n }\n }\n\n /**\n * Enables adaptive bitrate switching.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n if (this._engine) {\n this._engine.enableAdaptiveBitrate();\n }\n }\n\n /**\n * Mark the selected track as active\n * @function _markActiveTrack\n * @param {Track} track - the track to mark\n * @returns {void}\n * @private\n */\n _markActiveTrack(track: Track) {\n let type;\n if (track instanceof VideoTrack) {\n type = TrackTypes.VIDEO;\n } else if (track instanceof AudioTrack) {\n type = TrackTypes.AUDIO;\n } else if (track instanceof TextTrack) {\n type = TrackTypes.TEXT;\n }\n if (type) {\n let tracks = this.getTracks(type);\n for (let i = 0; i < tracks.length; i++) {\n tracks[i].active = track.index === i;\n }\n }\n }\n\n /**\n * @function _onPlay\n * @return {void}\n * @private\n */\n _onPlay(): void {\n if (this._firstPlay) {\n this._firstPlay = false;\n this.dispatchEvent(new FakeEvent(CustomEvents.FIRST_PLAY));\n }\n }\n\n /**\n * Get the player config.\n * @returns {Object} - The player configuration.\n * @public\n */\n get config(): Object {\n return this._config;\n }\n\n /**\n * Set player session id\n * @param {string} sessionId - the player session id to set\n * @returns {void}\n * @public\n */\n set sessionId(sessionId: string): void {\n this._config.session = this._config.session || {};\n this._config.session.id = sessionId;\n }\n\n // <editor-fold desc=\"Playback Interface\">\n /**\n * The player readiness\n * @public\n * @returns {Promise<*>} - The ready promise\n */\n ready(): Promise<*> {\n return this._readyPromise ? this._readyPromise : Promise.resolve();\n }\n\n /**\n * Load media\n * @public\n * @returns {void}\n */\n load(): void {\n if (this._engine) {\n this._engine.load().then((data) => {\n this._tracks = data.tracks;\n this.dispatchEvent(new FakeEvent(CustomEvents.TRACKS_CHANGED, {tracks: this._tracks}));\n }).catch((error) => {\n this.dispatchEvent(new FakeEvent(Html5Events.ERROR, error));\n });\n }\n }\n\n /**\n * Start/resume playback.\n * @returns {void}\n * @public\n */\n play(): void {\n if (this._engine) {\n if (this._engine.src) {\n this._engine.play();\n } else {\n this.load();\n this.ready().then(() => {\n this._engine.play();\n });\n }\n }\n }\n\n /**\n * Pause playback.\n * @returns {void}\n * @public\n */\n pause(): void {\n if (this._engine) {\n return this._engine.pause();\n }\n }\n\n /**\n * Set the current time in seconds.\n * @param {Number} to - The number to set in seconds.\n * @public\n */\n set currentTime(to: number): void {\n if (this._engine) {\n if (isNumber(to)) {\n let boundedTo = to;\n if (to < 0) {\n boundedTo = 0;\n }\n if (boundedTo > this._engine.duration) {\n boundedTo = this._engine.duration;\n }\n this._engine.currentTime = boundedTo;\n }\n }\n }\n\n /**\n * Get the current time in seconds.\n * @returns {?Number} - The playback current time.\n * @public\n */\n get currentTime(): ?number {\n if (this._engine) {\n return this._engine.currentTime;\n }\n }\n\n /**\n * Get the duration in seconds.\n * @returns {?Number} - The playback duration.\n * @public\n */\n get duration(): ?number {\n if (this._engine) {\n return this._engine.duration;\n }\n }\n\n /**\n * Set playback volume.\n * @param {Number} vol - The volume to set.\n * @returns {void}\n * @public\n */\n set volume(vol: number): void {\n if (this._engine) {\n if (isFloat(vol)) {\n let boundedVol = vol;\n if (boundedVol < 0) {\n boundedVol = 0;\n }\n if (boundedVol > 1) {\n boundedVol = 1;\n }\n this._engine.volume = boundedVol;\n }\n }\n }\n\n /**\n * Get playback volume.\n * @returns {?Number} - The playback volume.\n * @public\n */\n get volume(): ?number {\n if (this._engine) {\n return this._engine.volume;\n }\n }\n\n // </editor-fold>\n\n // <editor-fold desc=\"State\">\n /**\n * Get paused state.\n * @returns {?boolean} - Whether the video is paused or not.\n * @public\n */\n get paused(): ?boolean {\n if (this._engine) {\n return this._engine.paused;\n }\n }\n\n /**\n * Get seeking state.\n * @returns {?boolean} - Whether the video is seeking or not.\n * @public\n */\n get seeking(): ?boolean {\n if (this._engine) {\n return this._engine.seeking;\n }\n }\n\n buffered() {\n }\n\n /**\n * Set player muted state.\n * @param {boolean} mute - The mute value.\n * @returns {void}\n * @public\n */\n set muted(mute: boolean): void {\n if (this._engine) {\n this._engine.muted = mute;\n }\n }\n\n /**\n * Get player muted state.\n * @returns {?boolean} - Whether the video is muted or not.\n * @public\n */\n get muted(): ?boolean {\n if (this._engine) {\n return this._engine.muted;\n }\n }\n\n /**\n * Get the player source.\n * @returns {?string} - The current source of the player.\n * @public\n */\n get src(): ?string {\n if (this._engine) {\n return this._engine.src;\n }\n }\n\n /**\n * Get the player events.\n * @returns {Object} - The events of the player.\n * @public\n */\n get Event(): { [event: string]: string } {\n return PlayerEvents;\n }\n\n /**\n * Get the player states.\n * @returns {Object} - The states of the player.\n * @public\n */\n get State(): { [state: string]: string } {\n return PlayerStates;\n }\n\n /**\n * Get the player tracks types.\n * @returns {Object} - The tracks types of the player.\n * @public\n */\n get Track(): { [track: string]: string } {\n return TrackTypes;\n }\n\n// </editor-fold>\n}\n\n\n\n// WEBPACK FOOTER //\n// ./player.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/player.js","//@flow\nimport FakeEvent from './fake-event'\nimport MultiMap from '../utils/multi-map'\n\n/**\n * A work-alike for EventTarget. Only DOM elements may be true EventTargets,\n * but this can be used as a base class to provide event dispatch to non-DOM\n * classes. Only FakeEvents should be dispatched.\n *\n * @struct\n * @constructor\n * @implements {EventTarget}\n * @export\n */\nclass FakeEventTarget {\n _listeners: MultiMap<ListenerType>;\n dispatchTarget: FakeEventTarget;\n\n constructor() {\n /**\n * @private {!MultiMap.<FakeEventTarget.ListenerType>}\n */\n this._listeners = new MultiMap();\n\n /**\n * The target of all dispatched events. Defaults to |this|.\n * @type {EventTarget}\n */\n this.dispatchTarget = this;\n }\n\n /**\n * Add an event listener to this object.\n *\n * @param {string} type The event type to listen for.\n * @param {FakeEventTarget.ListenerType} listener The callback or\n * listener object to invoke.\n * @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have\n * parents, so events neither capture nor bubble.\n * @override\n * @export\n */\n addEventListener(type: string, listener: ListenerType) {\n this._listeners.push(type, listener);\n }\n\n /**\n * Remove an event listener from this object.\n *\n * @param {string} type The event type for which you wish to remove a listener.\n * @param {FakeEventTarget.ListenerType} listener The callback or\n * listener object to remove.\n * @param {boolean=} opt_capturing Ignored. FakeEventTargets do not have\n * parents, so events neither capture nor bubble.\n * @override\n * @export\n */\n removeEventListener(type: string, listener: ListenerType) {\n this._listeners.remove(type, listener);\n }\n\n /**\n * Dispatch an event from this object.\n *\n * @param {!Event} event The event to be dispatched from this object.\n * @return {boolean} True if the default action was prevented.\n * @override\n * @export\n */\n dispatchEvent(event: FakeEvent) {\n // In many browsers, it is complex to overwrite properties of actual Events.\n // Here we expect only to dispatch FakeEvents, which are simpler.\n //goog.asserts.assert(event instanceof FakeEvent,\n // 'FakeEventTarget can only dispatch FakeEvents!');\n\n let list = this._listeners.get(event.type) || [];\n\n for (let i = 0; i < list.length; ++i) {\n // Do this every time, since events can be re-dispatched from handlers.\n event.target = this.dispatchTarget;\n event.currentTarget = this.dispatchTarget;\n\n let listener = list[i];\n try {\n if (listener.handleEvent) {\n listener.handleEvent(event);\n } else {\n listener.call(this, event);\n }\n } catch (exception) {\n // Exceptions during event handlers should not affect the caller,\n // but should appear on the console as uncaught, according to MDN:\n // http://goo.gl/N6Ff27\n // TODO: add log\n }\n\n if (event.stopped) {\n break;\n }\n }\n\n return event.defaultPrevented;\n }\n}\n\n/**\n * These are the listener types defined in the closure extern for EventTarget.\n * @typedef {EventListener|function(!Event):(boolean|undefined)}\n */\ndeclare function ListenerType(event: FakeEvent): (boolean | void);\n\nexport default FakeEventTarget;\n\n\n\n// WEBPACK FOOTER //\n// ./event/fake-event-target.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/event/fake-event-target.js","//@flow\nexport default class PlayerError {\n static TYPE: {[name: string]: Object} = {\n NOT_REGISTERED_PLUGIN: {\n name: \"PluginNotRegisteredException\",\n message: function (name) {\n return `Cannot load ${name} plugin. Name not found in the registry`;\n }\n },\n NOT_VALID_HANDLER: {\n name: \"PluginHandlerIsNotValidException\",\n message: function () {\n return \"To activate plugin you must provide a class derived from BasePlugin\";\n }\n },\n NOT_IMPLEMENTED_METHOD: {\n name: \"NotImplementedException\",\n message: function (method) {\n return `${method} method not implemented`;\n }\n }\n };\n\n name: string;\n message: string;\n\n constructor(error: Object, param?: any) {\n this.name = error.name;\n this.message = error.message(param);\n }\n\n getError() {\n return {\n name: this.name,\n message: this.message\n };\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./utils/player-error.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/player-error.js","//@flow\n\"use strict\";\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is a number\n */\nfunction isNumber(n: number): boolean {\n return Number(n) === n;\n}\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is an integer\n */\nfunction isInt(n: number): boolean {\n return isNumber(n) && n % 1 === 0;\n}\n\n/**\n * @param {number} n - A certain number\n * @returns {boolean} - If the input is a float\n */\nfunction isFloat(n: number): boolean {\n return isNumber(n) && n % 1 !== 0;\n}\n\n/**\n * @param {Array<Object>} objects - The objects to merge\n * @returns {Object} - The merged object.\n */\nfunction merge(objects: Array<Object>): Object {\n let target = {};\n for (let obj of objects) {\n Object.assign(target, obj);\n }\n return target;\n}\n\n/**\n * @param {any} item - The item to check.\n * @returns {boolean} - Whether the item is an object.\n */\nfunction isObject(item: any) {\n return (item && typeof item === 'object' && !Array.isArray(item));\n}\n\n/**\n * @param {any} target - The target object.\n * @param {any} sources - The objects to merge.\n * @returns {Object} - The merged object.\n */\nfunction mergeDeep(target: any, ...sources: any): Object {\n if (!sources.length) {\n return target;\n }\n const source = sources.shift();\n if (isObject(target) && isObject(source)) {\n for (const key in source) {\n if (isObject(source[key])) {\n if (!target[key]) Object.assign(target, {[key]: {}});\n mergeDeep(target[key], source[key]);\n } else {\n Object.assign(target, {[key]: source[key]});\n }\n }\n }\n return mergeDeep(target, ...sources);\n}\n\n/**\n * @param {any} data - The data to copy.\n * @returns {any} - The copied data.\n */\nfunction copyDeep(data: any): any {\n let node;\n if (Array.isArray(data)) {\n node = data.length > 0 ? data.slice(0) : [];\n node.forEach((e, i) => {\n if (\n (typeof e === \"object\" && e !== {}) ||\n (Array.isArray(e) && e.length > 0)\n ) {\n node[i] = copyDeep(e);\n }\n });\n } else if (typeof data === \"object\") {\n node = Object.assign({}, data);\n Object.keys(node).forEach((key) => {\n if (\n (typeof node[key] === \"object\" && node[key] !== {}) ||\n (Array.isArray(node[key]) && node[key].length > 0)\n ) {\n node[key] = copyDeep(node[key]);\n }\n });\n } else {\n node = data;\n }\n return node;\n}\n\nexport {isNumber, isInt, isFloat, isObject, merge, mergeDeep, copyDeep};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/util.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/util.js","//@flow\n/* eslint-disable no-unused-vars */\nimport FakeEvent from '../../../event/fake-event'\nimport FakeEventTarget from '../../../event/fake-event-target'\nimport PlayerError from '../../../utils/player-error'\nimport {CUSTOM_EVENTS} from '../../../event/events'\nimport LoggerFactory from '../../../utils/logger'\nimport Track from '../../../track/track'\nimport VideoTrack from '../../../track/video-track'\nimport AudioTrack from '../../../track/audio-track'\nimport TextTrack from '../../../track/text-track'\n\nexport default class BaseMediaSourceAdapter extends FakeEventTarget implements IMediaSourceAdapter {\n /**\n * Passing the custom events to the actual media source adapter.\n * @static\n */\n static CustomEvents: { [event: string]: string } = CUSTOM_EVENTS;\n\n /**\n * Passing the getLogger function to the actual media source adapter.\n * @type {Function}\n * @static\n */\n static getLogger: Function = LoggerFactory.getLogger;\n\n /**\n * The adapter config.\n * @member {Object} _config\n * @private\n */\n _config: ?Object;\n\n /**\n * The source object.\n * @member {Source} _sourceObj\n * @private\n */\n _sourceObj: ?Source;\n\n /**\n * The dom video element.\n * @member {HTMLVideoElement} _videoElement\n * @private\n */\n _videoElement: HTMLVideoElement;\n\n /**\n * Checks if the media source adapter is supported.\n * @function isSupported\n * @returns {boolean} - Whether the media source adapter is supported.\n * @static\n */\n static isSupported(): boolean {\n return true;\n }\n\n /**\n * Factory method to create media source adapter.\n * @function createAdapter\n * @param {HTMLVideoElement} videoElement - The video element that the media source adapter work with.\n * @param {Object} source - The source Object.\n * @param {Object} config - The media source adapter configuration.\n * @returns {IMediaSourceAdapter} - New instance of the run time media source adapter.\n * @static\n */\n static createAdapter(videoElement: HTMLVideoElement, source: Source, config: Object): IMediaSourceAdapter {\n return new this(videoElement, source, config);\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to media source adapter.\n * @param {Source} source - The source object.\n * @param {Object} config - The media source adapter configuration.\n */\n constructor(videoElement: HTMLVideoElement, source: Source, config: Object) {\n super();\n this._videoElement = videoElement;\n this._sourceObj = source;\n this._config = config;\n }\n\n /**\n * Destroys the media source adapter.\n * @function destroy\n * @returns {void}\n */\n destroy(): void {\n this._sourceObj = null;\n this._config = null;\n }\n\n /**\n * Triggers the appropriate track changed event.\n * @param {Track} track - The selected track.\n * @private\n * @returns {void}\n */\n _onTrackChanged(track: Track): void {\n if (track instanceof VideoTrack) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.VIDEO_TRACK_CHANGED, {selectedVideoTrack: track});\n } else if (track instanceof AudioTrack) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.AUDIO_TRACK_CHANGED, {selectedAudioTrack: track});\n } else if (track instanceof TextTrack) {\n this._trigger(BaseMediaSourceAdapter.CustomEvents.TEXT_TRACK_CHANGED, {selectedTextTrack: track});\n }\n }\n\n /**\n * Dispatch an adapter event forward.\n * @param {string} name - The name of the event.\n * @param {Object} payload - The event payload.\n * @returns {void}\n */\n _trigger(name: string, payload: Object): void {\n this.dispatchEvent(new FakeEvent(name, payload));\n }\n\n /** Must implemented methods by the derived media source adapter **/\n\n static canPlayType(mimeType: string): boolean {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'static canPlayType').getError();\n }\n\n load(): Promise<Object> {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'load').getError();\n }\n\n selectVideoTrack(videoTrack: VideoTrack): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'selectVideoTrack').getError();\n }\n\n selectAudioTrack(audioTrack: AudioTrack): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'selectAudioTrack').getError();\n }\n\n selectTextTrack(textTrack: TextTrack): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'selectTextTrack').getError();\n }\n\n hideTextTrack(): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'hideTextTrack').getError();\n }\n\n enableAdaptiveBitrate(): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'enableAdaptiveBitrate').getError();\n }\n\n get src(): string {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'get src').getError();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/media-source/base-media-source-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/media-source/base-media-source-adapter.js","//@flow\nimport NativeAdapter from './adapters/native-adapter'\nimport LoggerFactory from '../../../utils/logger'\n\n/**\n * Media source provider\n * @classdesc\n */\nexport default class MediaSourceProvider {\n /**\n * The logger of the media source provider.\n * @member {any} _logger\n * @static\n * @private\n */\n static _logger: any = LoggerFactory.getLogger('MediaSourceProvider');\n /**\n * The media source adapter registry.\n * @member {Array<IMediaSourceAdapter>} _mediaSourceAdapters\n * @static\n * @private\n */\n static _mediaSourceAdapters: Array<typeof IMediaSourceAdapter> = [NativeAdapter];\n /**\n * The selected adapter for playback.\n * @type {null|IMediaSourceAdapter}\n * @static\n * @private\n */\n static _selectedAdapter: ?(typeof IMediaSourceAdapter) = null;\n\n /**\n * Add a media source adapter to the registry.\n * @function register\n * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to register.\n * @static\n * @returns {void}\n */\n static register(mediaSourceAdapter: typeof IMediaSourceAdapter): void {\n if (mediaSourceAdapter) {\n if (!MediaSourceProvider._mediaSourceAdapters.includes(mediaSourceAdapter)) {\n MediaSourceProvider._logger.debug(`Adapter <${mediaSourceAdapter.id}> has been registered successfully`);\n MediaSourceProvider._mediaSourceAdapters.push(mediaSourceAdapter);\n } else {\n MediaSourceProvider._logger.debug(`Adapter <${mediaSourceAdapter.id}> is already registered, do not register again`);\n }\n }\n }\n\n /**\n * Remove a media source adapter from the registry.\n * @function unRegister\n * @param {IMediaSourceAdapter} mediaSourceAdapter - The media source adapter to unRegister.\n * @static\n * @returns {void}\n */\n static unRegister(mediaSourceAdapter: typeof IMediaSourceAdapter): void {\n let index = MediaSourceProvider._mediaSourceAdapters.indexOf(mediaSourceAdapter);\n if (index > -1) {\n MediaSourceProvider._logger.debug(`Unregistered <${mediaSourceAdapter.id}> adapter`);\n MediaSourceProvider._mediaSourceAdapters.splice(index, 1);\n }\n }\n\n /**\n * Checks if one of the registered media source adapters can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check.\n * @static\n * @returns {boolean} - If one of the adapters can play the specific mime type.\n */\n static canPlayType(mimeType: string): boolean {\n let mediaSourceAdapters = MediaSourceProvider._mediaSourceAdapters;\n for (let i = 0; i < mediaSourceAdapters.length; i++) {\n if (mediaSourceAdapters[i].canPlayType(mimeType)) {\n MediaSourceProvider._selectedAdapter = mediaSourceAdapters[i];\n MediaSourceProvider._logger.debug(`Selected adapter is <${MediaSourceProvider._selectedAdapter.id}>`);\n return true;\n }\n }\n return false;\n }\n\n /**\n * Get the appropriate media source adapter to the video source.\n * @function getMediaSourceAdapter\n * @param {HTMLVideoElement} videoElement - The video element which requires adapter for a given mimeType.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The player configuration.\n * @returns {IMediaSourceAdapter|null} - The selected media source adapter, or null if such doesn't exists.\n * @static\n */\n static getMediaSourceAdapter(videoElement: HTMLVideoElement, source: Source, config: Object): ?IMediaSourceAdapter {\n if (videoElement && source && config) {\n if (!MediaSourceProvider._selectedAdapter) {\n MediaSourceProvider.canPlayType(source.mimetype);\n }\n return MediaSourceProvider._selectedAdapter ? MediaSourceProvider._selectedAdapter.createAdapter(videoElement, source, config) : null;\n }\n return null;\n }\n\n /**\n * Destroys the media source adapter provider necessary props.\n * @static\n * @returns {void}\n */\n static destroy(): void {\n MediaSourceProvider._selectedAdapter = null;\n }\n}\n\nconst registerMediaSourceAdapter = MediaSourceProvider.register;\nexport {registerMediaSourceAdapter};\n\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/media-source/media-source-provider.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/media-source/media-source-provider.js","//@flow\nimport Player from '../player'\nimport LoggerFactory from '../utils/logger'\nimport {merge} from '../utils/util'\nimport EventManager from '../event/event-manager'\nimport PlayerError from '../utils/player-error'\n\n/** The BasePlugin responsible to implement the plugin interface.\n * Contains several default implementations.\n * Other plugins should extend this class.\n * @classdesc\n */\nexport default class BasePlugin implements IPlugin {\n /**\n * The runtime configuration of the plugin.\n * @member\n */\n config: Object;\n /**\n * The name of the plugin.\n * @member\n */\n name: string;\n /**\n * The logger of the plugin.\n * @member\n */\n logger: any;\n /**\n * Reference to the actual player.\n * @member\n */\n player: Player;\n /**\n * The event manager of the plugin.\n * @member\n */\n eventManager: EventManager;\n /**\n * The default configuration of the plugin.\n * Inherited plugins should override this property.\n * @type {Object}\n * @static\n * @member\n */\n static defaultConfig: Object = {};\n\n /**\n * Factory method to create the actual plugin.\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} config - The plugin configuration\n * @returns {BasePlugin} - New runtime plugin instance\n * @static\n * @public\n */\n static createPlugin(name: string, player: Player, config: Object = {}): BasePlugin {\n return new this(name, player, config);\n }\n\n /**\n * Returns under what conditions the plugin is valid.\n * Plugin must implement this method.\n * @returns {boolean} - Whether the plugin is valid and can be initiated. Default implementation is true\n * @static\n * @public\n * @abstract\n */\n static isValid(): boolean {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'isValid()').getError();\n }\n\n /**\n * constructor\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} config - The plugin configuration\n * @constructor\n * @private\n */\n constructor(name: string, player: Player, config: Object) {\n this.name = name;\n this.player = player;\n this.eventManager = new EventManager();\n this.logger = LoggerFactory.getLogger(this.name);\n this.config = merge([this.constructor.defaultConfig, config]);\n }\n\n /**\n * Getter for the configuration of the plugin.\n * @param {string} attr - The key in the plugin configuration (optional).\n * @returns {*} - If attribute is provided, returns its value. Else, Returns the config of the plugin.\n * @public\n */\n getConfig(attr?: string): any {\n if (attr) {\n return this.config[attr];\n }\n return this.config;\n }\n\n /**\n * Updates the config of the plugin.\n * @param {Object} update - The updated configuration.\n * @public\n * @returns {void}\n */\n updateConfig(update: Object): void {\n this.config = merge([this.config, update]);\n }\n\n /**\n * Runs the destroy logic of the plugin.\n * plugin must implement this method.\n * @public\n * @abstract\n * @returns {void}\n */\n destroy(): void {\n throw new PlayerError(PlayerError.TYPE.NOT_IMPLEMENTED_METHOD, 'destroy()').getError();\n }\n\n /**\n * Getter for the plugin's name.\n * @returns {string} - The name of the plugin.\n * @public\n */\n getName(): string {\n return this.name;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./plugin/base-plugin.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/plugin/base-plugin.js","//@flow\nimport BasePlugin from './base-plugin'\nimport PlayerError from '../utils/player-error'\nimport Player from '../player'\nimport LoggerFactory from '../utils/logger'\n\n/**\n * The logger of the PluginManager class.\n * @private\n * @const\n */\nconst logger = LoggerFactory.getLogger(\"PluginManager\");\n\n/** The PluginManager responsible for register plugins definitions and store plugins instances.\n * @classdesc\n */\nexport default class PluginManager {\n /**\n * The registry of the plugins.\n * Maps plugin's name to his class.\n * @type {Map}\n * @static\n * @private\n */\n static _registry: Map<string, Function> = new Map();\n /**\n * The active plugins in the player.\n * Maps plugin's name to his instance.\n * @type {Map}\n * @private\n */\n _plugins: Map<string, BasePlugin> = new Map();\n\n /**\n * Writes the plugin in the registry.\n * Maps: plugin name -> plugin class.\n * @param {string} name - The plugin name\n * @param {Function} handler - The plugin class\n * @returns {boolean} - If the registration request succeeded\n * @static\n * @public\n */\n static register(name: string, handler: Function): boolean {\n if (typeof handler !== 'function' || handler.prototype instanceof BasePlugin === false) {\n throw new PlayerError(PlayerError.TYPE.NOT_VALID_HANDLER).getError();\n }\n if (!PluginManager._registry.has(name)) {\n PluginManager._registry.set(name, handler);\n logger.debug(`Plugin <${name}> has been registered successfully`);\n return true;\n }\n logger.debug(`Plugin <${name}> is already registered, do not register again`);\n return false;\n }\n\n /**\n * Removes the plugin from the registry.\n * @param {string} name - The plugin name\n * @static\n * @public\n * @returns {void}\n */\n static unRegister(name: string): void {\n if (PluginManager._registry.has(name)) {\n PluginManager._registry.delete(name);\n logger.debug(`Unregistered <${name}> plugin.`);\n }\n }\n\n /**\n * Creates and store new instance of the plugin in case isValid() of the plugin returns true.\n * @param {string} name - The plugin name\n * @param {Player} player - The player reference\n * @param {Object} [config={}] - The plugin configuration\n * @returns {boolean} - Whether the plugin load was successful\n * @public\n */\n load(name: string, player: Player, config: Object = {}): boolean {\n if (!PluginManager._registry.has(name)) {\n throw new PlayerError(PlayerError.TYPE.NOT_REGISTERED_PLUGIN, name).getError();\n }\n let pluginClass = PluginManager._registry.get(name);\n if (pluginClass != null && pluginClass.isValid()) {\n this._plugins.set(name, pluginClass.createPlugin(name, player, config));\n logger.debug(`Plugin <${name}> has been loaded`);\n return true;\n }\n logger.debug(`Plugin <${name}> isn\\'t loaded, isValid()=false`);\n return false;\n }\n\n /**\n * Iterates over all the plugins and calls private _destroy.\n * @public\n * @returns {void}\n */\n destroy(): void {\n this._plugins.forEach(this._destroy.bind(this));\n }\n\n /**\n * Calls destroy() method of the plugin's impl.\n * @param {BasePlugin} plugin - The plugin instance\n * @param {string} name - The plugin name\n * @private\n * @returns {void}\n */\n _destroy(plugin: BasePlugin, name: string): void {\n plugin.destroy();\n this._plugins.delete(name);\n }\n\n /**\n * Returns the plugin's instance.\n * @param {string} name - The plugin name\n * @returns {BasePlugin} - The plugin instance\n * @public\n */\n get(name: string): ?BasePlugin {\n return this._plugins.get(name);\n }\n}\n\n/**\n * Export the register method.\n * @type {function}\n * @constant\n */\nconst registerPlugin = PluginManager.register;\nexport {registerPlugin};\n\n\n\n// WEBPACK FOOTER //\n// ./plugin/plugin-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/plugin/plugin-manager.js","//@flow\n\n/**\n * The possible player state types.\n * @const\n * @type {{IDLE: string, LOADING: string, PLAYING: string, PAUSED: string, BUFFERING: string}}\n */\nconst PLAYER_STATE_TYPES: { [state: string]: string } = {\n IDLE: \"idle\",\n LOADING: \"loading\",\n PLAYING: \"playing\",\n PAUSED: \"paused\",\n BUFFERING: \"buffering\"\n};\n\nexport default PLAYER_STATE_TYPES;\n\n\n\n// WEBPACK FOOTER //\n// ./state/state-types.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/state/state-types.js","//@flow\n\n/**\n * A simple multimap template.\n * @constructor\n * @struct\n * @template T\n */\nclass MultiMap<T> {\n _map: Map<string, T[]>;\n\n constructor() {\n /** @private {!Object.<string, !Array.<T>>} */\n this._map = new Map();\n }\n\n /**\n * Add a key, value pair to the map.\n * @param {string} key -\n * @param {T} value -\n * @returns {void}\n */\n push(key: string, value: T): void {\n if (this._map.has(key)) {\n let list = this._map.get(key);\n if (Array.isArray(list)) {\n list.push(value);\n this._map.set(key, list);\n }\n } else {\n this._map.set(key, [value]);\n }\n }\n\n /**\n * Set an array of values for the key, overwriting any previous data.\n * @param {string} key -\n * @param {!Array.<T>} values -\n * @returns {void}\n */\n set(key: string, values: T[]): void {\n this._map.set(key, values);\n }\n\n /**\n * Check for a key.\n * @param {string} key -\n * @return {boolean} true if the key exists.\n */\n has(key: string): boolean {\n return this._map.has(key);\n }\n\n /**\n * Get a list of values by key.\n * @param {string} key -\n * @return {Array.<T>} or null if no suZch key exists.\n */\n get(key: string): Array<T> {\n let list = this._map.get(key);\n // slice() clones the list so that it and the map can each be modified\n // without affecting the other.\n return list ? list.slice() : [];\n }\n\n /**\n * Get a list of all values.\n * @returns {!Array.<T>} -\n */\n getAll(): T[] {\n let list: T[] = [];\n for (var value of this._map.values()) {\n list = list.concat(value);\n }\n return list;\n }\n\n /**\n * Remove a specific value, if it exists.\n * @param {string} key -\n * @param {T} value -\n * @returns {void}\n */\n remove(key: string, value: T): void {\n if (!this._map.has(key)) return;\n let list = this._map.get(key);\n if (Array.isArray(list)) {\n for (let i = 0; i < list.length; ++i) {\n if (list[i] == value) {\n list.splice(i, 1);\n --i;\n }\n }\n }\n }\n\n /**\n * Get all keys from the multimap.\n * @return {!Array.<string>}\n */\n // eslint-disable-next-line no-undef\n keys(): Iterator<string> {\n return this._map.keys();\n }\n\n\n /**\n * Clear all keys and values from the multimap.\n * @returns {void}\n */\n clear(): void {\n this._map.clear();\n }\n}\n\nexport default MultiMap;\n\n\n\n// WEBPACK FOOTER //\n// ./utils/multi-map.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/utils/multi-map.js","module.exports = {\n\t\"name\": \"playkit-js\",\n\t\"version\": \"0.2.0\",\n\t\"main\": \"dist/playkit.js\",\n\t\"scripts\": {\n\t\t\"clean\": \"rm -rf ./dist\",\n\t\t\"prebuild\": \"npm run clean\",\n\t\t\"build:prod\": \"NODE_ENV=production webpack\",\n\t\t\"build\": \"webpack\",\n\t\t\"dev\": \"webpack --progress --colors --watch\",\n\t\t\"test\": \"NODE_ENV=test karma start --color\",\n\t\t\"test:chrome\": \"NODE_ENV=test karma start --color --browsers Chrome\",\n\t\t\"test:chrome:dots\": \"NODE_ENV=test karma start --color --browsers Chrome --reporters dots\",\n\t\t\"test:firefox\": \"NODE_ENV=test karma start --color --browsers Firefox\",\n\t\t\"test:safari\": \"NODE_ENV=test karma start --color --browsers Safari\",\n\t\t\"test:watch\": \"NODE_ENV=test karma start --color --auto-watch\",\n\t\t\"start\": \"webpack-dev-server\",\n\t\t\"release\": \"npm run build:prod && npm run commit:dist && standard-version\",\n\t\t\"publish\": \"git push --follow-tags --no-verify origin develop\",\n\t\t\"eslint\": \"eslint . --color\",\n\t\t\"flow\": \"flow check\",\n\t\t\"eslint:flow:test\": \"npm run eslint && npm run flow && npm run test\",\n\t\t\"commit:dist\": \"git add --all dist && (git commit -m 'chore: update dist' || exit 0)\",\n\t\t\"prepush-msg:build\": \"echo '\\nRunning build before push...\\n' && exit 0\",\n\t\t\"prepush-msg:dist\": \"echo '\\nAdding dist files to a seperate commit...\\n' && exit 0\",\n\t\t\"prepush-msg:done\": \"echo '\\nPre push tasks are done.\\n' && exit 0\"\n\t},\n\t\"pre-push\": [\n\t\t\"prepush-msg:build\",\n\t\t\"prebuild\",\n\t\t\"build\",\n\t\t\"build:prod\",\n\t\t\"prepush-msg:dist\",\n\t\t\"commit:dist\",\n\t\t\"prepush-msg:done\"\n\t],\n\t\"devDependencies\": {\n\t\t\"babel-cli\": \"^6.18.0\",\n\t\t\"babel-core\": \"^6.18.2\",\n\t\t\"babel-eslint\": \"^7.1.1\",\n\t\t\"babel-loader\": \"^6.2.7\",\n\t\t\"babel-plugin-istanbul\": \"^4.0.0\",\n\t\t\"babel-plugin-transform-class-properties\": \"^6.22.0\",\n\t\t\"babel-plugin-transform-flow-strip-types\": \"^6.22.0\",\n\t\t\"babel-preset-es2015\": \"^6.18.0\",\n\t\t\"babel-register\": \"^6.23.0\",\n\t\t\"chai\": \"^3.5.0\",\n\t\t\"cross-env\": \"^3.1.4\",\n\t\t\"eslint\": \"^3.10.0\",\n\t\t\"eslint-loader\": \"^1.6.1\",\n\t\t\"eslint-plugin-flowtype\": \"^2.30.0\",\n\t\t\"eslint-plugin-import\": \"^2.2.0\",\n\t\t\"eslint-plugin-mocha-no-only\": \"^0.0.5\",\n\t\t\"flow-bin\": \"latest\",\n\t\t\"istanbul\": \"^0.4.5\",\n\t\t\"karma\": \"^1.5.0\",\n\t\t\"karma-chai\": \"^0.1.0\",\n\t\t\"karma-chrome-launcher\": \"^2.0.0\",\n\t\t\"karma-cli\": \"^1.0.1\",\n\t\t\"karma-coverage\": \"^1.1.1\",\n\t\t\"karma-firefox-launcher\": \"^1.0.1\",\n\t\t\"karma-ie-launcher\": \"^1.0.0\",\n\t\t\"karma-mocha\": \"^1.3.0\",\n\t\t\"karma-safari-launcher\": \"^1.0.0\",\n\t\t\"karma-sourcemap-loader\": \"^0.3.7\",\n\t\t\"karma-webpack\": \"^2.0.2\",\n\t\t\"mocha\": \"^3.2.0\",\n\t\t\"mocha-cli\": \"^1.0.1\",\n\t\t\"pre-push\": \"^0.1.1\",\n\t\t\"sinon\": \"^2.0.0\",\n\t\t\"sinon-chai\": \"^2.8.0\",\n\t\t\"standard-version\": \"^4.0.0\",\n\t\t\"uglifyjs-webpack-plugin\": \"^0.4.3\",\n\t\t\"webpack\": \"latest\",\n\t\t\"webpack-dev-server\": \"latest\"\n\t},\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/kaltura/playkit-js\"\n\t},\n\t\"keywords\": [\n\t\t\"kaltura\",\n\t\t\"player\",\n\t\t\"html5 player\"\n\t],\n\t\"license\": \"AGPLV3\",\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/kaltura/playkit-js/issues\"\n\t},\n\t\"homepage\": \"https://github.com/kaltura/playkit-js\",\n\t\"dependencies\": {\n\t\t\"js-logger\": \"^1.3.0\"\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../package.json\n// module id = 18\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///package.json","//@flow\nimport FakeEventTarget from '../../event/fake-event-target'\nimport FakeEvent from '../../event/fake-event'\nimport EventManager from '../../event/event-manager'\nimport {HTML5_EVENTS as Html5Events, CUSTOM_EVENTS as CustomEvents} from '../../event/events'\nimport MediaSourceProvider from './media-source/media-source-provider'\nimport VideoTrack from '../../track/video-track'\nimport AudioTrack from '../../track/audio-track'\nimport TextTrack from '../../track/text-track'\n\nexport default class Html5 extends FakeEventTarget implements IEngine {\n /**\n * The video element.\n * @type {HTMLVideoElement}\n * @private\n */\n _el: HTMLVideoElement;\n /**\n * The event manager of the engine.\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * The selected media source adapter of the engine.\n * @type {IMediaSourceAdapter}\n * @private\n */\n _mediaSourceAdapter: ?IMediaSourceAdapter;\n\n /**\n * @type {string} - The engine id.\n */\n static id: string = \"html5\";\n\n /**\n * Factory method to create an engine.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The player configuration.\n * @returns {IEngine} - New instance of the run time engine.\n * @public\n * @static\n */\n static createEngine(source: Source, config: Object): IEngine {\n return new this(source, config);\n }\n\n /**\n * Checks if the engine can play a given mime type.\n * @param {string} mimeType - The mime type to check.\n * @returns {boolean} - Whether the engine can play the mime type.\n * @public\n * @static\n */\n static canPlayType(mimeType): boolean {\n return MediaSourceProvider.canPlayType(mimeType);\n }\n\n /**\n * @constructor\n * @param {Source} source - The selected source object.\n * @param {Object} config - The player configuration.\n */\n constructor(source: Source, config: Object) {\n super();\n this._eventManager = new EventManager();\n this._createVideoElement();\n this._loadMediaSourceAdapter(source, config);\n this.attach();\n }\n\n /**\n * Destroys the engine.\n * @public\n * @returns {void}\n */\n destroy(): void {\n this.detach();\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.destroy();\n MediaSourceProvider.destroy();\n }\n if (this._el) {\n this.pause();\n this._el.removeAttribute('src');\n if (this._el.parentNode) {\n this._el.parentNode.removeChild(this._el);\n }\n }\n this._eventManager.destroy();\n }\n\n /**\n * Listen to the video element events and triggers them from the engine.\n * @public\n * @returns {void}\n */\n attach(): void {\n for (let playerEvent in Html5Events) {\n this._eventManager.listen(this._el, Html5Events[playerEvent], () => {\n this.dispatchEvent(new FakeEvent(Html5Events[playerEvent]));\n });\n }\n if (this._mediaSourceAdapter) {\n this._eventManager.listen(this._mediaSourceAdapter, CustomEvents.VIDEO_TRACK_CHANGED, (event: FakeEvent) => {\n this.dispatchEvent(event);\n });\n this._eventManager.listen(this._mediaSourceAdapter, CustomEvents.AUDIO_TRACK_CHANGED, (event: FakeEvent) => {\n return this.dispatchEvent(event);\n });\n this._eventManager.listen(this._mediaSourceAdapter, CustomEvents.TEXT_TRACK_CHANGED, (event: FakeEvent) => {\n return this.dispatchEvent(event);\n });\n }\n }\n\n /**\n * Remove the listeners of the video element events.\n * @public\n * @returns {void}\n */\n detach(): void {\n for (let playerEvent in Html5Events) {\n this._eventManager.unlisten(this._el, Html5Events[playerEvent]);\n }\n if (this._mediaSourceAdapter) { // unlisten to adaptive bitrate changed\n this._eventManager.unlisten(this._mediaSourceAdapter, CustomEvents.VIDEO_TRACK_CHANGED);\n this._eventManager.unlisten(this._mediaSourceAdapter, CustomEvents.AUDIO_TRACK_CHANGED);\n this._eventManager.unlisten(this._mediaSourceAdapter, CustomEvents.TEXT_TRACK_CHANGED);\n }\n }\n\n /**\n * @returns {HTMLVideoElement} - The video element.\n * @public\n */\n getVideoElement(): HTMLVideoElement {\n return this._el;\n }\n\n /**\n * Creates a video element dom object.\n * @private\n * @returns {void}\n */\n _createVideoElement(): void {\n this._el = document.createElement(\"video\");\n //Set attributes\n this._el.style.width = \"640px\";\n this._el.style.height = \"360px\";\n this._el.style.backgroundColor = \"black\";\n this._el.controls = true;\n if (document && document.body) {\n document.body.appendChild(this._el);\n }\n }\n\n /**\n * Loads the appropriate media source extension adapter.\n * @param {Source} source - The selected source object.\n * @param {Object} config - The media source extension configuration.\n * @private\n * @returns {void}\n */\n _loadMediaSourceAdapter(source: Source, config: Object): void {\n this._mediaSourceAdapter = MediaSourceProvider.getMediaSourceAdapter(this.getVideoElement(), source, config);\n }\n\n /**\n * Select a new video track.\n * @param {VideoTrack} videoTrack - The video track object to set.\n * @returns {void}\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectVideoTrack(videoTrack);\n }\n }\n\n /**\n * Select a new audio track.\n * @param {AudioTrack} audioTrack - The video track object to set.\n * @returns {void}\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectAudioTrack(audioTrack);\n }\n }\n\n /**\n * Select a new text track.\n * @param {TextTrack} textTrack - The text track object to set.\n * @returns {void}\n */\n selectTextTrack(textTrack: TextTrack): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.selectTextTrack(textTrack);\n }\n }\n\n /**\n * Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n hideTextTrack(): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.hideTextTrack();\n }\n }\n\n /**\n * Enables adaptive bitrate switching according to the media source extension logic.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n if (this._mediaSourceAdapter) {\n this._mediaSourceAdapter.enableAdaptiveBitrate();\n }\n }\n\n /**\n * Set a source.\n * @param {string} source - Source to set.\n * @public\n * @returns {void}\n */\n set src(source: string): void {\n this._el.src = source;\n }\n\n /**\n * Get the source url.\n * @returns {string} - The source url.\n * @public\n */\n get src(): string {\n if (this._mediaSourceAdapter) {\n return this._mediaSourceAdapter.src;\n }\n return \"\";\n }\n\n //playback interface\n /**\n * Start/resume playback.\n * @public\n * @returns {void}\n */\n play(): void {\n return this._el.play();\n }\n\n /**\n * Pause playback.\n * @public\n * @returns {void}\n */\n pause(): void {\n return this._el.pause();\n }\n\n /**\n * Load media.\n * @public\n * @returns {Promise<Object>} - The loaded data\n */\n load(): Promise<Object> {\n return this._mediaSourceAdapter ? this._mediaSourceAdapter.load() : Promise.resolve({});\n }\n\n /**\n * Get the current time in seconds.\n * @returns {Number} - The current playback time.\n * @public\n */\n get currentTime(): number {\n return this._el.currentTime;\n }\n\n /**\n * Set the current time in seconds.\n * @param {Number} to - The number to set in seconds.\n * @public\n * @returns {void}\n */\n set currentTime(to: number): void {\n this._el.currentTime = to;\n }\n\n /**\n * Get the duration in seconds.\n * @returns {Number} - The playback duration.\n * @public\n */\n get duration(): number {\n return this._el.duration;\n }\n\n /**\n * Set playback volume.\n * @param {Number} vol - The volume to set.\n * @public\n * @returns {void}\n */\n set volume(vol: number): void {\n this._el.volume = vol;\n }\n\n /**\n * Get playback volume.\n * @returns {Number} - The volume value of the video element.\n * @public\n */\n get volume(): number {\n return this._el.volume;\n }\n\n ready() {\n }\n\n /**\n * Get paused state.\n * @returns {boolean} - The paused value of the video element.\n * @public\n */\n get paused(): boolean {\n return this._el.paused;\n }\n\n /**\n * Get seeking state.\n * @returns {boolean} - The seeking value of the video element.\n * @public\n */\n get seeking(): boolean {\n return this._el.seeking;\n }\n\n /**\n * Get the first seekable range (part) of the video in seconds.\n * @returns {TimeRanges} - First seekable range (part) of the video in seconds.\n * @public\n */\n get seekable(): TimeRanges {\n return this._el.seekable;\n }\n\n /**\n * Get the first played range (part) of the video in seconds.\n * @returns {TimeRanges} - First played range (part) of the video in seconds.\n * @public\n */\n get played(): TimeRanges {\n return this._el.played;\n }\n\n /**\n * Get the first buffered range (part) of the video in seconds.\n * @returns {TimeRanges} - First buffered range (part) of the video in seconds.\n * @public\n */\n get buffered(): TimeRanges {\n return this._el.buffered;\n }\n\n /**\n * Set player muted state.\n * @param {boolean} mute - The new mute value.\n * @public\n * @returns {void}\n */\n set muted(mute: boolean): void {\n this._el.muted = mute;\n }\n\n /**\n * Get player muted state.\n * @returns {boolean} - The muted value of the video element.\n * @public\n */\n get muted(): boolean {\n return this._el.muted;\n }\n\n /**\n * Get the default mute value.\n * @returns {boolean} - The defaultMuted of the video element.\n * @public\n */\n get defaultMuted(): boolean {\n return this._el.defaultMuted;\n }\n\n /**\n * Sets an image to be shown while the video is downloading, or until the user hits the play button.\n * @param {string} poster - The image url to be shown.\n * @returns {void}\n * @public\n */\n set poster(poster: string): void {\n this._el.poster = poster;\n }\n\n /**\n * Gets an image to be shown while the video is downloading, or until the user hits the play button.\n * @returns {poster} - The image url.\n * @public\n */\n get poster(): string {\n return this._el.poster;\n }\n\n /**\n * Specifies if and how the author thinks that the video should be loaded when the page loads.\n * @param {string} preload - The preload value.\n * @public\n * @returns {void}\n */\n set preload(preload: string): void {\n this._el.preload = preload;\n }\n\n /**\n * Gets the preload value of the video element.\n * @returns {string} - The preload value.\n * @public\n */\n get preload(): string {\n return this._el.preload;\n }\n\n /**\n * Set if the video will automatically start playing as soon as it can do so without stopping.\n * @param {boolean} autoplay - The autoplay value.\n * @public\n * @returns {void}\n */\n set autoplay(autoplay: boolean): void {\n this._el.autoplay = autoplay;\n }\n\n /**\n * Gets the autoplay value of the video element.\n * @returns {boolean} - The autoplay value.\n * @public\n */\n get autoplay(): boolean {\n return this._el.autoplay;\n }\n\n /**\n * Set to specifies that the video will start over again, every time it is finished.\n * @param {boolean} loop - the loop value.\n * @public\n * @returns {void}\n */\n set loop(loop: boolean) {\n this._el.loop = loop;\n }\n\n /**\n * Gets the loop value of the video element.\n * @returns {boolean} - The loop value.\n * @public\n */\n get loop(): boolean {\n return this._el.loop;\n }\n\n /**\n * Set to specifies that video controls should be displayed.\n * @param {boolean} controls - the controls value.\n * @public\n * @returns {void}\n */\n set controls(controls: boolean): void {\n this._el.controls = controls;\n }\n\n /**\n * Gets the controls value of the video element.\n * @returns {boolean} - The controls value.\n * @public\n */\n get controls(): boolean {\n return this._el.controls;\n }\n\n /**\n * Sets the current playback speed of the audio/video.\n * @param {Number} playbackRate - The playback speed value.\n * @public\n * @returns {void}\n */\n set playbackRate(playbackRate: number): void {\n this._el.playbackRate = playbackRate;\n }\n\n /**\n * Gets the current playback speed of the audio/video.\n * @returns {Number} - The current playback speed value.\n * @public\n */\n get playbackRate(): number {\n return this._el.playbackRate;\n }\n\n /**\n * Sets the default playback speed of the audio/video.\n * @param {Number} defaultPlaybackRate - The default playback speed value.\n * @public\n * @returns {void}\n */\n set defaultPlaybackRate(defaultPlaybackRate: number) {\n this._el.defaultPlaybackRate = defaultPlaybackRate;\n }\n\n /**\n * Gets the default playback speed of the audio/video.\n * @returns {Number} - The default playback speed value.\n * @public\n */\n get defaultPlaybackRate(): number {\n return this._el.defaultPlaybackRate;\n }\n\n /**\n * The ended property returns whether the playback of the audio/video has ended.\n * @returns {boolean} - The ended value.\n * @public\n */\n get ended(): boolean {\n return this._el.ended;\n }\n\n /**\n * The error property returns a MediaError object.\n * @returns {MediaError} - The MediaError object has a code property containing the error state of the audio/video.\n * @public\n */\n get error(): ?MediaError {\n return this._el.error;\n }\n\n /**\n * @returns {Number} - The current network state (activity) of the audio/video.\n * @public\n */\n get networkState(): number {\n return this._el.networkState;\n }\n\n /**\n * Indicates if the audio/video is ready to play or not.\n * @returns {Number} - The current ready state of the audio/video.\n * 0 = HAVE_NOTHING - no information whether or not the audio/video is ready.\n * 1 = HAVE_METADATA - metadata for the audio/video is ready.\n * 2 = HAVE_CURRENT_DATA - data for the current playback position is available, but not enough data to play next frame/millisecond.\n * 3 = HAVE_FUTURE_DATA - data for the current and at least the next frame is available.\n * 4 = HAVE_ENOUGH_DATA - enough data available to start playing.\n */\n get readyState(): number {\n return this._el.readyState;\n }\n\n /**\n * @returns {Number} - The height of the video player, in pixels.\n * @public\n */\n get videoHeight(): number {\n return this._el.videoHeight;\n }\n\n /**\n * @returns {Number} - The width of the video player, in pixels.\n * @public\n */\n get videoWidth(): number {\n return this._el.videoWidth;\n }\n\n /**\n * Test video element to check if html5 engine is supported.\n */\n static TEST_VID: HTMLVideoElement;\n\n /**\n * Checks if the html5 engine is supported.\n * @returns {boolean} - The isSupported result.\n * @static\n * @public\n */\n static isSupported() {\n try {\n Html5.TEST_VID = document.createElement('video');\n Html5.TEST_VID.volume = 0.5;\n } catch (e) {\n return false;\n }\n return !!Html5.TEST_VID.canPlayType;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/html5.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/html5.js","//@flow\nimport EventManager from '../../../../event/event-manager'\nimport {HTML5_EVENTS as Html5Events} from '../../../../event/events'\nimport Track from '../../../../track/track'\nimport VideoTrack from '../../../../track/video-track'\nimport AudioTrack from '../../../../track/audio-track'\nimport TextTrack from '../../../../track/text-track'\nimport BaseMediaSourceAdapter from '../base-media-source-adapter'\n\n/**\n * An illustration of media source extension for progressive download\n * @classdesc\n * @implements {IMediaSourceAdapter}\n */\nexport default class NativeAdapter extends BaseMediaSourceAdapter {\n /**\n * The id of the Adapter\n * @member {string} id\n * @static\n * @public\n */\n static id: string = 'NativeAdapter';\n\n /**\n * The adapter logger\n * @member {any} _logger\n * @private\n * @static\n */\n static _logger = BaseMediaSourceAdapter.getLogger(NativeAdapter.id);\n /**\n * The event manager of the class.\n * @member {EventManager} - _eventManager\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n _loadPromise: ?Promise<Object>;\n\n /**\n * Checks if NativeAdapter can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @returns {boolean} - Whether the native adapter can play a specific mime type\n * @static\n */\n static canPlayType(mimeType: string): boolean {\n let canPlayType = (typeof mimeType === 'string') ? !!(document.createElement(\"video\").canPlayType(mimeType.toLowerCase())) : false;\n NativeAdapter._logger.debug('canPlayType result for mimeType:' + mimeType + ' is ' + canPlayType.toString());\n return canPlayType;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to NativeAdapter\n * @param {Source} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n constructor(videoElement: HTMLVideoElement, source: Source, config: Object) {\n NativeAdapter._logger.debug('Creating adapter');\n super(videoElement, source, config);\n this._eventManager = new EventManager();\n }\n\n /**\n * Load the video source\n * @function load\n * @returns {Promise<Object>} - The loaded data\n */\n load(): Promise<Object> {\n if (!this._loadPromise) {\n this._loadPromise = new Promise((resolve, reject) => {\n // We're using 'loadeddata' event for native hls (on 'loadedmetadata' native hls doesn't have tracks yet).\n this._eventManager.listen(this._videoElement, Html5Events.LOADED_DATA, () => {\n this._eventManager.unlisten(this._videoElement, Html5Events.LOADED_DATA);\n let data = {tracks: this._getParsedTracks()};\n NativeAdapter._logger.debug('The source has been loaded successfully');\n resolve(data);\n });\n this._eventManager.listen(this._videoElement, Html5Events.ERROR, (error) => {\n this._eventManager.unlisten(this._videoElement, Html5Events.ERROR);\n NativeAdapter._logger.error(error);\n reject(error);\n });\n if (this._sourceObj && this._sourceObj.url) {\n this._videoElement.src = this._sourceObj.url;\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroys the native adapter.\n * @function destroy\n * @returns {void}\n */\n destroy(): void {\n NativeAdapter._logger.debug('destroy');\n super.destroy();\n this._eventManager.destroy();\n this._loadPromise = null;\n }\n\n /**\n * Get the parsed tracks\n * @function _getParsedTracks\n * @returns {Array<Track>} - The parsed tracks\n * @private\n */\n _getParsedTracks(): Array<Track> {\n let videoTracks = this._getParsedVideoTracks();\n let audioTracks = this._getParsedAudioTracks();\n let textTracks = this._getParsedTextTracks();\n return videoTracks.concat(audioTracks).concat(textTracks);\n }\n\n /**\n * Get the parsed video tracks\n * @function _getParsedVideoTracks\n * @returns {Array<Track>} - The parsed video tracks\n * @private\n */\n _getParsedVideoTracks(): Array<Track> {\n let videoTracks = this._videoElement.videoTracks;\n let parsedTracks = [];\n if (videoTracks) {\n for (let i = 0; i < videoTracks.length; i++) {\n let settings = {\n id: videoTracks[i].id,\n active: videoTracks[i].selected,\n label: videoTracks[i].label,\n language: videoTracks[i].language,\n index: i\n };\n parsedTracks.push(new VideoTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed audio tracks\n * @function _getParsedAudioTracks\n * @returns {Array<Track>} - The parsed audio tracks\n * @private\n */\n _getParsedAudioTracks(): Array<Track> {\n let audioTracks = this._videoElement.audioTracks;\n let parsedTracks = [];\n if (audioTracks) {\n for (let i = 0; i < audioTracks.length; i++) {\n let settings = {\n id: audioTracks[i].id,\n active: audioTracks[i].enabled,\n label: audioTracks[i].label,\n language: audioTracks[i].language,\n index: i\n };\n parsedTracks.push(new AudioTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed text tracks\n * @function _getParsedTextTracks\n * @returns {Array<Track>} - The parsed text tracks\n * @private\n */\n _getParsedTextTracks(): Array<Track> {\n let textTracks = this._videoElement.textTracks;\n let parsedTracks = [];\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n let settings = {\n kind: textTracks[i].kind,\n active: textTracks[i].mode === 'showing',\n label: textTracks[i].label,\n language: textTracks[i].language,\n index: i\n };\n parsedTracks.push(new TextTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Select a video track\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the track to select\n * @returns {void}\n * @public\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n let videoTracks = this._videoElement.videoTracks;\n if ((videoTrack instanceof VideoTrack) && videoTracks && videoTracks[videoTrack.index]) {\n this._disableVideoTracks();\n videoTracks[videoTrack.index].selected = true;\n this._onTrackChanged(videoTrack);\n }\n }\n\n /**\n * Select an audio track\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select\n * @returns {void}\n * @public\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n let audioTracks = this._videoElement.audioTracks;\n if ((audioTrack instanceof AudioTrack) && audioTracks && audioTracks[audioTrack.index]) {\n this._disableAudioTracks();\n audioTracks[audioTrack.index].enabled = true;\n this._onTrackChanged(audioTrack);\n }\n }\n\n /**\n * Select a text track\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select\n * @returns {void}\n * @public\n */\n selectTextTrack(textTrack: TextTrack): void {\n let textTracks = this._videoElement.textTracks;\n if ((textTrack instanceof TextTrack) && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions') && textTracks && textTracks[textTrack.index]) {\n this._disableTextTracks();\n textTracks[textTrack.index].mode = 'showing';\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n hideTextTrack(): void {\n this._disableTextTracks();\n }\n\n /**\n * Enables adaptive bitrate\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n NativeAdapter._logger.debug('Enabling adaptive bitrate not supported');\n }\n\n /**\n * Disables all the existing video tracks.\n * @private\n * @returns {void}\n */\n _disableVideoTracks(): void {\n let videoTracks = this._videoElement.videoTracks;\n if (videoTracks) {\n for (let i = 0; i < videoTracks.length; i++) {\n videoTracks[i].selected = false;\n }\n }\n }\n\n /**\n * Disables all the existing audio tracks.\n * @private\n * @returns {void}\n */\n _disableAudioTracks(): void {\n let audioTracks = this._videoElement.audioTracks;\n if (audioTracks) {\n for (let i = 0; i < audioTracks.length; i++) {\n audioTracks[i].enabled = false;\n }\n }\n }\n\n /**\n * Disables all the existing text tracks.\n * @private\n * @returns {void}\n */\n _disableTextTracks(): void {\n let textTracks = this._videoElement.textTracks;\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n textTracks[i].mode = 'disabled';\n }\n }\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * @public\n * @returns {string} - The src url.\n */\n get src(): string {\n return this._videoElement.src;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./engines/html5/media-source/adapters/native-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/engines/html5/media-source/adapters/native-adapter.js","//@flow\nimport Player from './player'\nimport LoggerFactory from './utils/logger'\nimport * as packageData from '../package.json'\nimport BaseMediaSourceAdapter from './engines/html5/media-source/base-media-source-adapter'\nimport {registerMediaSourceAdapter} from './engines/html5/media-source/media-source-provider'\nimport {registerPlugin} from './plugin/plugin-manager'\nimport BasePlugin from './plugin/base-plugin'\nimport Track from './track/track'\nimport VideoTrack from './track/video-track'\nimport AudioTrack from './track/audio-track'\nimport TextTrack from './track/text-track'\n\n// Playkit version\nlet VERSION = packageData.version;\n\nLoggerFactory.getLogger().log(\"%c Playkit \" + VERSION, \"color: yellow; font-size: large\");\nLoggerFactory.getLogger().log(\"%c For more details see https://github.com/kaltura/playkit-js\", \"color: yellow;\");\n\n/**\n * @param {Object} config - The configuration of the player\n * @returns {Player} - The player instance\n */\nexport function playkit(config: Object = {}) {\n return new Player(config);\n}\n\n// Export the media source adapters necessary utils\nexport {registerMediaSourceAdapter, BaseMediaSourceAdapter};\n\n// Export the plugin framework\nexport {registerPlugin, BasePlugin};\n\n// Export the tracks classes\nexport {Track, VideoTrack, AudioTrack, TextTrack};\n\n//export version\nexport {VERSION};\nexport default playkit;\n\n\n\n// WEBPACK FOOTER //\n// ./playkit.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/playkit.js","//@flow\nimport Player from '../player'\nimport EventManager from '../event/event-manager'\nimport State from './state'\nimport PlayerStates from './state-types'\nimport {HTML5_EVENTS as Html5Events, CUSTOM_EVENTS as CustomEvents} from '../event/events'\nimport FakeEvent from '../event/fake-event'\nimport LoggerFactory from '../utils/logger'\n\n/**\n * Define a transition object.\n */\ntype Transition = {\n [state: string]: {\n [event: string]: Function\n }\n}\n\n/**\n * This class responsible to manage all the state machine of the player.\n * @classdesc\n */\nexport default class StateManager {\n /**\n * The logger of the class.\n * @member\n * @type {any}\n * @private\n */\n _logger: any;\n /**\n * Reference to the actual player.\n * @member\n * @type {Player}\n * @private\n */\n _player: Player;\n /**\n * The event manager of the class.\n * @member\n * @type {EventManager}\n * @private\n */\n _eventManager: EventManager;\n /**\n * Holds the current state of the player.\n * @member\n * @type {State}\n * @private\n */\n _curState: State;\n /**\n * Holds the previous state of the player.\n * @member\n * @type {State | null}\n * @private\n */\n _prevState: State | null;\n /**\n * Holds the state history of the player.\n * @member\n * @type {Array<State>}\n * @private\n */\n _history: Array<State>;\n /**\n * The possible transitions from one state to another.\n * @type {Array<Transition>}\n * @private\n */\n _transitions: Transition = {\n [PlayerStates.IDLE]: {\n [Html5Events.LOAD_START]: () => {\n this._updateState(PlayerStates.LOADING);\n this._dispatchEvent();\n },\n [Html5Events.PLAY]: () => {\n this._updateState(PlayerStates.BUFFERING);\n this._dispatchEvent();\n }\n },\n [PlayerStates.LOADING]: {\n [Html5Events.LOADED_METADATA]: () => {\n if (this._player.config.autoPlay) {\n this._updateState(PlayerStates.PLAYING);\n } else {\n this._updateState(PlayerStates.PAUSED);\n }\n this._dispatchEvent();\n },\n [Html5Events.ERROR]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n }\n },\n [PlayerStates.PAUSED]: {\n [Html5Events.PLAY]: () => {\n this._updateState(PlayerStates.PLAYING);\n this._dispatchEvent();\n },\n [Html5Events.PLAYING]: () => {\n this._updateState(PlayerStates.PLAYING);\n this._dispatchEvent();\n },\n [Html5Events.ENDED]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n }\n },\n [PlayerStates.PLAYING]: {\n [Html5Events.PAUSE]: () => {\n this._updateState(PlayerStates.PAUSED);\n this._dispatchEvent();\n },\n [Html5Events.WAITING]: () => {\n this._updateState(PlayerStates.BUFFERING);\n this._dispatchEvent();\n },\n [Html5Events.ENDED]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n },\n [Html5Events.ERROR]: () => {\n this._updateState(PlayerStates.IDLE);\n this._dispatchEvent();\n }\n },\n [PlayerStates.BUFFERING]: {\n [Html5Events.PLAYING]: () => {\n this._updateState(PlayerStates.PLAYING);\n this._dispatchEvent();\n },\n [Html5Events.PAUSE]: () => {\n this._updateState(PlayerStates.PAUSED);\n this._dispatchEvent();\n }\n }\n };\n\n /**\n * @constructor\n * @param {Player} player - Reference to the player.\n */\n constructor(player: Player) {\n this._player = player;\n this._logger = LoggerFactory.getLogger(\"StateManager\");\n this._eventManager = new EventManager();\n this._history = [];\n this._prevState = null;\n this._curState = new State(PlayerStates.IDLE);\n this._attachListeners();\n }\n\n /**\n * Register to all necessary events which impacts on the player state.\n * @private\n * @returns {void}\n */\n _attachListeners(): void {\n this._eventManager.listen(this._player, Html5Events.ERROR, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.ENDED, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.PLAY, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.LOAD_START, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.PLAYING, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.LOADED_METADATA, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.PAUSE, this._doTransition.bind(this));\n this._eventManager.listen(this._player, Html5Events.WAITING, this._doTransition.bind(this));\n }\n\n /**\n * Performs a state transition depends on the event which occurs in the player system.\n * @param {FakeEvent} event - The event occurs in the player system.\n * @private\n * @returns {void}\n */\n _doTransition(event: FakeEvent): void {\n this._logger.debug('Do transition request', event);\n let transition = this._transitions[this._curState.type];\n if (typeof transition[event.type] === 'function') {\n transition[event.type]();\n }\n }\n\n /**\n * Updates the player's state.\n * @param {string} type - The type of the new state.\n * @private\n * @returns {void}\n */\n _updateState(type: string): void {\n if (this._curState.type !== type) {\n this._curState.duration = Date.now() / 1000;\n this._history.push(this._curState);\n this._prevState = this._curState;\n this._curState = new State(type);\n this._logger.debug(`Switch player state: from ${this._prevState.type} to ${this._curState.type}`)\n }\n }\n\n /**\n * Fires the playerStateChanged event after state has been changed.\n * @private\n * @returns {void}\n */\n _dispatchEvent(): void {\n let event = new FakeEvent(CustomEvents.PLAYER_STATE_CHANGED, {\n 'oldState': this._prevState,\n 'newState': this._curState\n });\n this._player.dispatchEvent(event);\n }\n\n /**\n * Destroys the state manager.\n * @public\n * @returns {void}\n */\n destroy(): void {\n this._history = [];\n this._eventManager.destroy();\n }\n\n /**\n * Getter to the current state of the player.\n * @public\n * @returns {State} - The current state object\n */\n get currentState(): State {\n return this._curState;\n }\n\n /**\n * Getter to the previous state of the player.\n * @public\n * @returns {State|null} - The previous state object, or null if such doesn't exists\n */\n get previousState(): State | null {\n return this._prevState;\n }\n\n /**\n * Getter to the state history of the player.\n * @public\n * @returns {Array.<State>} - The full states history objects\n */\n get history(): Array<State> {\n return this._history;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./state/state-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/state/state-manager.js","//@flow\n\n/**\n * This class describes a player state.\n * @classdesc\n */\nexport default class State {\n /**\n * The type of the state.\n * Can be one of those describes in states.js\n * @member\n * @type {string}\n * @public\n */\n type: string;\n /**\n * The duration that the player was in this state.\n * @member\n * @type {number}\n * @private\n */\n _duration: number;\n /**\n * The timestamp that this state started.\n * @member\n * @type {number}\n * @private\n */\n _timestamp: number;\n\n /**\n * @constructor\n * @param {string} type - The type of the state.\n */\n constructor(type: string) {\n this.type = type;\n this._duration = 0;\n this._timestamp = Date.now() / 1000;\n }\n\n /**\n * Getter for the duration of the state.\n * @returns {number} - The duration of the state\n */\n get duration(): number {\n return this._duration;\n }\n\n /**\n * Setter for the duration of the state.\n * @param {number} endTime - The timestamp of the next state.\n */\n set duration(endTime: number): void {\n this._duration = endTime - this._timestamp;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./state/state.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/state/state.js","//@flow\nconst TRACK_TYPES: {[track: string]: string} = {\n VIDEO: \"video\",\n AUDIO: \"audio\",\n TEXT: \"text\"\n};\n\nexport default TRACK_TYPES;\n\n\n\n// WEBPACK FOOTER //\n// ./track/track-types.js\n\n\n// WEBPACK FOOTER //\n// webpack:///core/track/track-types.js","/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (typeof define === 'function' && define.amd) {\r\n\t\tdefine(Logger);\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/js-logger/src/logger.js\n// module id = 8\n// module chunks = 0 1\n\n\n// WEBPACK FOOTER //\n// webpack:///~/js-logger/src/logger.js","module.exports = {\n\t\"playback\": {\n\t\t\"preload\": \"none\",\n\t\t\"autoplay\": false,\n\t\t\"muted\": false,\n\t\t\"streamPriority\": [\n\t\t\t{\n\t\t\t\t\"engine\": \"html5\",\n\t\t\t\t\"format\": \"hls\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"engine\": \"html5\",\n\t\t\t\t\"format\": \"dash\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"engine\": \"html5\",\n\t\t\t\t\"format\": \"progressive\"\n\t\t\t}\n\t\t]\n\t},\n\t\"plugins\": {}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./player-config.json\n// module id = 26\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///core/player-config.json","(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[\"PlaykitJsProviders\"] = factory();\n\telse\n\t\troot[\"PlaykitJsProviders\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 25);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 638014c152c6bb21e972\n\n\n// WEBPACK FOOTER //\n// webpack:/providers/webpack/bootstrap 638014c152c6bb21e972","//@flow\n\n/**\n * Request builder\n * @classdesc\n */\nexport default class RequestBuilder {\n\n /**\n * @member - Service name\n * @type {string}\n */\n service: string;\n /**\n * @member - Service action\n * @type {string}\n */\n action: string;\n /**\n * @member - Service params\n * @type {any}\n */\n params: any;\n /**\n * @member - Service headers\n * @type {Map<string, string>}\n */\n headers: Map<string, string>;\n /**\n * @member - Service base url\n * @type {Map<string, string>}\n */\n baseUrl: string;\n /**\n * @member - Service method (POST,GET,DELETE etc..)\n * @type {string}\n */\n method: string;\n /**\n * @member - Service tag\n * @type {string}\n */\n tag: string;\n\n /**\n * @constructor\n * @param {Map<string, string>} headers The request headers\n */\n constructor(headers: Map<string, string> = new Map()) {\n this.headers = headers;\n this.headers.set(\"Content-Type\", \"application/json\");\n }\n\n /**\n * Builds restful service URL\n * @function getUrl\n * @returns {string} The service URL\n */\n getUrl(): string {\n if (!this.baseUrl) {\n throw new Error(\"baseUrl is mandatory for request builder\");\n }\n let url = this.baseUrl + '/service/' + this.service + (this.action ? '/action/' + this.action : '');\n return url;\n }\n\n /**\n * Executes service\n * @function doHttpRequest\n * @returns {Promise.<any>} Service response as promise\n */\n doHttpRequest(): Promise<any> {\n let request = new XMLHttpRequest();\n return new Promise((resolve, reject) => {\n request.onreadystatechange = function () {\n if (request.readyState === 4) {\n if (request.status === 200) {\n let jsonResponse = JSON.parse(request.responseText);\n if (jsonResponse && typeof(jsonResponse) === 'object' && jsonResponse.code && jsonResponse.message)\n reject(jsonResponse);\n else\n resolve(jsonResponse);\n } else {\n reject(request.responseText);\n }\n }\n };\n request.open(this.method, this.getUrl());\n this.headers.forEach((value, key) => {\n request.setRequestHeader(key, value);\n });\n request.send(this.params);\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/request-builder.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/request-builder.js","//@flow\n\nconst defaultConfig: Object = {\n beUrl: \"http://www.kaltura.com/api_v3\",\n baseUrl: \"https://cdnapisec.kaltura.com\",\n serviceParams: {\n clientTag: \"playkit-js\",\n apiVersion: '3.3.0',\n format: 1\n }\n};\n\nexport default class Configuration {\n\n static set(clientConfig?: Object) {\n if (clientConfig) {\n Object.assign(defaultConfig, clientConfig);\n }\n }\n\n static get(): Object {\n return defaultConfig;\n }\n}\n\nexport {Configuration};\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/config.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/config.js","//@flow\n\nimport {Enum} from 'enumify';\n\nexport class Scheme extends Enum {\n}\nScheme.initEnum({\n PLAYREADY_CENC: \"drm.PLAYREADY_CENC\",\n WIDEVINE_CENC: \"drm.WIDEVINE_CENC\",\n FAIRPLAY: \"fairplay.FAIRPLAY\",\n PLAYREADY: \"playReady.PLAYREADY\",\n WIDEVINE: \"widevine.WIDEVINE\"\n});\n\n\nexport class KalturaRuleActionType extends Enum {\n}\nKalturaRuleActionType.initEnum({\n DRM_POLICY: \"drm.DRM_POLICY\",\n BLOCK: 1,\n PREVIEW: 2,\n LIMIT_FLAVORS: 3,\n ADD_TO_STORAGE: 4,\n LIMIT_DELIVERY_PROFILES: 5,\n SERVE_FROM_REMOTE_SERVER: 6,\n REQUEST_HOST_REGEX: 7,\n LIMIT_THUMBNAIL_CAPTURE: 8\n});\n\nexport class Status extends Enum {\n}\nStatus.initEnum({\n ERROR: -1,\n QUEUED: 0,\n CONVERTING: 1,\n READY: 2,\n DELETED: 3,\n NOT_APPLICABLE: 4,\n TEMP: 5,\n WAIT_FOR_CONVERT: 6,\n IMPORTING: 7,\n VALIDATING: 8,\n EXPORTING: 9\n});\n\nexport class MetadataObjectType extends Enum {\n}\nMetadataObjectType.initEnum({\n AD_CUE_POINT: \"adCuePointMetadata.AdCuePoint\",\n ANNOTATION: \"annotationMetadata.Annotation\",\n CODE_CUE_POINT: \"codeCuePointMetadata.CodeCuePoint\",\n THUMB_CUE_POINT: \"thumbCuePointMetadata.thumbCuePoint\",\n ENTRY: 1,\n CATEGORY: 2,\n USER: 3,\n PARTNER: 4,\n DYNAMIC_OBJECT: 5\n});\n\nexport class MetadataStatus extends Enum {\n}\nMetadataStatus.initEnum({\n VALID: 1,\n INVALID: 2,\n DELETED: 3\n});\n\n\nexport class EntryStatus extends Enum {\n}\nEntryStatus.initEnum({\n ERROR_IMPORTING: -2,\n ERROR_CONVERTING: -1,\n SCAN_FAILURE: \"virusScan.ScanFailure\",\n IMPORT: 0,\n INFECTED: \"virusScan.Infected\",\n PRECONVERT: 1,\n READY: 2,\n DELETED: 3,\n PENDING: 4,\n MODERATE: 5,\n BLOCKED: 6,\n NO_CONTENT: 7\n});\n\nexport class EntryModerationStatus extends Enum {\n}\nEntryModerationStatus.initEnum({\n PENDING_MODERATION: 1,\n APPROVED: 2,\n REJECTED: 3,\n FLAGGED_FOR_REVIEW: 4,\n MODERATE: 5,\n AUTO_APPROVED: 6\n});\n\nexport class EntryType extends Enum {\n}\nEntryType.initEnum({\n AUTOMATIC: {value: -1},\n EXTERNAL_MEDIA: {value: \"externalMedia.externalMedia\"},\n MEDIA_CLIP: {value: 1},\n MIX: {value: 2},\n PLAYLIST: {value: 5},\n DATA: {value: 6},\n LIVE_STREAM: {value: 7},\n LIVE_CHANNEL: {value: 8},\n DOCUMENT: {value: 10}\n});\n\nexport class MediaType extends Enum {\n}\nMediaType.initEnum({\n VIDEO: {value: 1},\n IMAGE: {value: 2},\n AUDIO: {value: 5},\n LIVE_STREAM_FLASH: {value: 201},\n LIVE_STREAM_WINDOWS_MEDIA: {value: 202},\n LIVE_STREAM_REAL_MEDIA: {value: 203},\n LIVE_STREAM_QUICKTIME: {value: 204}\n});\n\n\nexport class MediaEntryType extends Enum {\n}\nMediaEntryType.initEnum(['Vod', 'Live', 'Image', 'Audio', 'Unknown']);\n\nexport class UIConfType extends Enum {\n}\nUIConfType.initEnum({\n PLAYER: 1,\n CONTRIBUTION_WIZARD: 2,\n SIMPLE_EDITOR: 3,\n ADVANCED_EDITOR: 4,\n PLAYLIST: 5,\n APP_STUDIO: 6,\n KRECORD: 7,\n PLAYER_V3: 8,\n KMC_ACCOUNT: 9,\n KMC_ANALYTICS: 10,\n KMC_CONTENT: 11,\n KMC_DASHBOARD: 12,\n KMC_LOGIN: 13,\n PLAYER_SL: 14,\n CLIENTSIDE_ENCODER: 15,\n KMC_GENERAL: 16,\n KMC_ROLES_AND_PERMISSIONS: 17,\n CLIPPER: 18,\n KSR: 19,\n KUPLOAD: 20,\n WEBCASTING: 21\n});\n\nexport class UIConfCreationMode extends Enum {\n}\nUIConfCreationMode.initEnum({\n WIZARD: 2,\n ADVANCED: 3\n});\n\n\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/enums.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/enums.js","//@flow\nimport MultiRequestBuilder from '../../multi-request-builder'\nimport Configuration from '../config'\n\nconst config = Configuration.get();\nconst SERVICE_NAME: string = \"multirequest\";\n\n/**\n * Base for all ovp services\n * @classdesc\n */\nexport default class OvpService {\n /**\n * Gets a new instance of MultiRequestBuilder with ovp params\n * @function getMultirequest\n * @param {string} ks The ks\n * @param {string} partnerId The partner ID\n * @returns {MultiRequestBuilder} The multi request builder\n * @static\n */\n static getMultirequest(ks: string, partnerId?: number): MultiRequestBuilder {\n let ovpParams = config.serviceParams;\n Object.assign(ovpParams, {ks: ks});\n if (partnerId) {\n Object.assign(ovpParams, {partnerId: partnerId});\n }\n let multiReq = new MultiRequestBuilder();\n multiReq.method = \"POST\";\n multiReq.service = SERVICE_NAME;\n multiReq.baseUrl = config.beUrl;\n multiReq.params = ovpParams;\n return multiReq;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/ovp-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/ovp-service.js","//@flow\n\n/**\n * Base service result\n * @classdesc\n */\nexport default class ServiceResult {\n\n /**\n * @member - Is service returned an error\n * @type {boolean}\n */\n hasError: boolean = false;\n /**\n * @member - The service error\n * @type {ServiceError}\n */\n error: ServiceError;\n /**\n * @member - The service result data\n * @type {Object}\n */\n data: Object;\n\n /**\n * @constructor\n * @param {Object} response - Service response\n */\n constructor(response: Object) {\n if (response.objectType === \"KalturaAPIException\") {\n this.hasError = true;\n this.error = new ServiceError(response.code, response.message);\n }\n else {\n this.data = response;\n }\n }\n}\n\n/**\n * Service error\n * @classdesc\n */\nclass ServiceError {\n /**\n * @member - The error code\n * @type {string}\n */\n code: string;\n /**\n * @member - The error message\n * @type {string}\n */\n message: string;\n\n /**\n * @constructor\n * @param {string} code - The result code\n * @param {string} message - The result message\n */\n constructor(code: string, message: string) {\n this.code = code;\n this.message = message;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/base-service-result.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/base-service-result.js","//@flow\nimport * as JsLogger from 'js-logger';\n\nclass LoggerFactory {\n constructor(options?: Object) {\n JsLogger.useDefaults(options || {});\n }\n\n get(name?: string) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n}\n\nlet Logger = new LoggerFactory({defaultLevel: JsLogger.DEBUG});\nconst LOG_LEVEL: {[level: string]: Object} = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nexport default Logger;\nexport {LOG_LEVEL};\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./util/logger.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/util/logger.js","//@flow\nimport RequestBuilder from './request-builder'\nimport ServiceResult from './base-service-result'\nimport Logger from \"../util/logger\";\n/**\n * @constant\n */\nconst logger = Logger.get(\"OvpProvider\");\n\n/**\n * Multi Request builder\n * @classdesc\n */\nexport default class MultiRequestBuilder extends RequestBuilder {\n\n /**\n * @member - Array of requests\n * @type {Array<RequestBuilder>}\n */\n requests: Array<RequestBuilder> = [];\n\n /**\n * @constructor\n */\n constructor() {\n super();\n }\n\n /**\n * Adds request to requests array\n * @function add\n * @param {RequestBuilder} request The request\n * @returns {MultiRequestBuilder} The multiRequest\n */\n add(request: RequestBuilder): MultiRequestBuilder {\n this.requests.push(request);\n let requestParams = {};\n let serviceDef: Object = {service: request.service, action: request.action};\n Object.assign(requestParams, {[this.requests.length]: Object.assign(serviceDef, request.params)});\n Object.assign(requestParams, this.params);\n this.params = requestParams;\n return this;\n }\n\n /**\n * Executes a multi request\n * @function execute\n * @returns {Promise} The multirequest execution promisie\n */\n execute(): Promise<Object> {\n try {\n this.params = JSON.stringify(this.params);\n }\n catch (err) {\n logger.error(`${err.message}`);\n }\n return new Promise((resolve, reject) => {\n this.doHttpRequest().then(data => {\n resolve(new MultiRequestResult(data));\n },\n err => {\n let errorText: string = `Error on multiRequest execution, error <${err}>.`;\n reject(errorText);\n\n });\n });\n }\n\n}\n\n/**\n * Multi Request result object\n * @classdesc\n */\nexport class MultiRequestResult {\n\n /**\n * @member - Is success\n * @type {boolean}\n */\n success: boolean;\n /**\n * @member - Multi request response data\n * @type {Object}\n */\n results: Array<ServiceResult> = [];\n\n /**\n * @constructor\n * @param {Object} response data\n */\n constructor(response: Object) {\n this.success = true;\n response.forEach((result) => {\n let serviceResult: ServiceResult = new ServiceResult(result);\n this.results.push(serviceResult);\n if (serviceResult.hasError) {\n logger.error(`Service returned an error with error code: ${serviceResult.error.code} and message: ${serviceResult.error.message}.`);\n this.success = false;\n return;\n }\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/multi-request-builder.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/multi-request-builder.js","// @flow\nimport MediaSource from './media-source'\nimport {MediaFormat} from './media-format'\n\n/**\n * Container for the media sources aggregated by stream format.\n * @classdesc\n */\nexport default class MediaSources {\n /**\n * Progressive download media sources container.\n * @type {Array<MediaSource>}\n * @public\n */\n progressive: Array<MediaSource>;\n /**\n * Dash media sources container.\n * @type {Array<MediaSource>}\n * @public\n */\n dash: Array<MediaSource>;\n /**\n * Hls media sources container.\n * @type {Array<MediaSource>}\n * @public\n */\n hls: Array<MediaSource>;\n\n /**\n * @constructor\n */\n constructor() {\n this.progressive = [];\n this.dash = [];\n this.hls = [];\n }\n\n /**\n * Maps the source to one of the containers according to his media format.\n * @param {MediaSource} source - The source to add to one of the containers.\n * @param {MediaFormat} mediaFormat - The media format of the source.\n * @returns {void}\n */\n map(source: MediaSource, mediaFormat: ?MediaFormat) {\n if (mediaFormat) {\n switch (mediaFormat.name) {\n case 'mp4':\n this.progressive.push(source);\n break;\n case 'dash':\n this.dash.push(source);\n break;\n case 'hls':\n this.hls.push(source);\n break;\n default:\n break;\n }\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-sources.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-sources.js","//@flow\nimport {MediaEntryType} from '../k-provider/enums'\nimport MediaSources from './media-sources'\n\n/**\n * Media entry\n * @classdesc\n */\nexport default class MediaEntry {\n\n /**\n * @member - entry ID\n * @type {string}\n */\n id: string;\n /**\n * @member - entry sources\n * @type {MediaSources}\n */\n sources: MediaSources;\n /**\n * @member - entry duration\n * @type {number}\n */\n duration: number;\n /**\n * @member - entry type\n * @type {MediaEntryType}\n */\n type: MediaEntryType;\n /**\n * @member - entry metadata\n * @type {Map<string,string>}\n */\n metaData: Map<string, string>;\n\n /**\n * @constructor\n */\n constructor() {\n this.metaData = new Map();\n this.type = MediaEntryType.Unknown;\n }\n\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-entry.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-entry.js","//@flow\n\nimport {Scheme} from '../k-provider/enums';\n\n/**\n * Drm data\n * @classdesc\n */\nexport default class Drm {\n\n /**\n * @member - license URL\n * @type {string}\n */\n licenseUrl: string;\n /**\n * @member - drm scheme\n * @type {Scheme}\n */\n scheme: Scheme;\n\n /**\n * @constructor\n * @param {string} licenseUrl - the license URL\n * @param {Scheme} scheme - the drm scheme\n */\n constructor(licenseUrl: string, scheme: Scheme) {\n this.licenseUrl = licenseUrl;\n this.scheme = scheme;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./entities/drm.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/drm.js","//@flow\nimport {Enum} from 'enumify';\n\nexport class MediaFormat extends Enum {\n}\nMediaFormat.initEnum({\n dash: {\n get mimeType() {\n return \"application/dash+xml\";\n },\n get pathExt() {\n return \"mpd\";\n }\n },\n hls: {\n get mimeType() {\n return \"application/x-mpegURL\";\n },\n get pathExt() {\n return \"m3u8\";\n }\n },\n wvm: {\n get mimeType() {\n return \"video/wvm\";\n },\n get pathExt() {\n return \"wvm\";\n }\n },\n mp4: {\n get mimeType() {\n return \"video/mp4\";\n },\n get pathExt() {\n return \"mp4\";\n }\n },\n mp3: {\n get mimeType() {\n return \"audio/mpeg\";\n },\n get pathExt() {\n return \"mp3\";\n }\n }\n});\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-format.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-format.js","//@flow\nimport Drm from '../entities/drm'\n\n/**\n * Media source\n * @classdesc\n */\nexport default class MediaSource {\n /**\n * @member - media source ID\n * @type {string}\n */\n id: string;\n /**\n * @member - media source URL\n * @type {string}\n */\n url: string;\n /**\n * @member - media source mimetype\n * @type {string}\n */\n mimetype: string;\n /**\n * @member - media source drm data\n * @type {Array<Drm>}\n */\n drmData: Array<Drm>;\n\n /**\n * @constructor\n */\n constructor(){}\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./entities/media-source.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/entities/media-source.js","//@flow\nimport {Status} from '../../enums'\n\n/**\n * Ovp BE FlavorAsset\n * @classdesc\n */\nexport default class KalturaFlavorAsset {\n /**\n * @member - The ID of the Flavor Asset\n * @type {string}\n */\n id: string;\n /**\n * @member -The Flavor Params used to create this Flavor Asset\n * @type {string}\n */\n flavorParamsId: string;\n /**\n * @member -The file extension\n * @type {string}\n */\n fileExt: string;\n /**\n * @member - The overall bitrate (in KBits) of the Flavor Asset\n * @type {string}\n */\n bitrate: number;\n /**\n * @member - The width of the Flavor Asset\n * @type {number}\n */\n width: number;\n /**\n * @member - The height of the Flavor Asset\n * @type {number}\n */\n height: number;\n /**\n * @member - The frame rate (in FPS) of the Flavor Asset\n * @type {number}\n */\n frameRate: number;\n /**\n * @member - True if this Flavor Asset is the original source\n * @type {number}\n */\n isOriginal: boolean;\n /**\n * @member - True if this Flavor Asset is playable in KDP\n * @type {boolean}\n */\n isWeb: boolean;\n /**\n * @member - The container format\n * @type {boolean}\n */\n containerFormat: string;\n /**\n *@member - The video codec\n * @type {boolean}\n */\n videoCodecId: string;\n /**\n * @member - The status of the Flavor Asset\n * @type {string}\n */\n status: Status;\n /**\n * @member - The language of the flavor asset\n * @type {Status}\n */\n language: string;\n /**\n * @member - The label of the flavor asset\n * @type {string}\n */\n label: string;\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n constructor(data: any) {\n this.id = data.id;\n this.flavorParamsId = data.flavorParamsId;\n this.fileExt = data.fileExt;\n this.bitrate = data.bitrate;\n this.width = data.width;\n this.height = data.height;\n this.id = data.id;\n this.frameRate = data.frameRate;\n this.isOriginal = data.isOriginal;\n this.isWeb = data.isWeb;\n this.containerFormat = data.containerFormat;\n this.videoCodecId = data.videoCodecId;\n this.status = data.status;\n this.language = data.language;\n this.label = data.label;\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-flavor-asset.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-flavor-asset.js","//@flow\nimport {EntryType, MediaType} from '../../enums'\n\n/**\n * Ovp BE MediaEntry\n * @classdesc\n */\nexport default class KalturaMediaEntry {\n /**\n * @member - The entry id\n * @type {string}\n */\n id: string;\n /**\n * @member - Entry name (Min 1 chars)\n * @type {string}\n */\n name: string;\n /**\n * @member - The URL used for playback. This is not the download URL.\n * @type {string}\n */\n dataUrl: string;\n /**\n * @member - Comma separated flavor params ids that exists for this media entry\n * @type {string}\n */\n flavorParamsIds: string;\n /**\n * @member - The entry duration\n * @type {number}\n */\n duration: number;\n /**\n * @member - The type of the entry, this is auto filled by the derived entry object\n * @type {EntryType}\n */\n type: EntryType;\n /**\n * @member - The type of the entry, this is auto filled by the derived entry object (Image, Audio etc.)\n * @type {MediaType}\n */\n entryType: MediaType;\n\n /**\n * @constructor\n * @param {Object} entry The json response\n */\n constructor(entry: Object) {\n this.id = entry.id;\n this.name = entry.name;\n this.dataUrl = entry.dataUrl;\n this.type = entry.type;\n this.entryType = entry.mediaType;\n this.flavorParamsIds = entry.flavorParamsIds;\n this.duration = entry.duration;\n }\n}\n\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-media-entry.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-media-entry.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport KalturaMetadata from './kaltura-metadata'\n\n/**\n * Ovp BE Metadata list response\n * @classdesc\n */\nexport default class KalturaMetadataListResponse extends ServiceResult {\n totalCount: number;\n /**\n * @member -The mata data array\n * @type {Array<KalturaMetadata>}\n */\n metas: Array<KalturaMetadata>;\n\n /**\n * @constructor\n * @param {Object} responseObj The response\n */\n constructor(responseObj: Object) {\n super(responseObj);\n if (!this.hasError) {\n this.totalCount = responseObj.totalCount;\n if (this.totalCount > 0) {\n this.metas = [];\n responseObj.objects.map(meta => this.metas.push(new KalturaMetadata(meta)));\n }\n\n }\n }\n}\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-metadata-list-response.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-metadata-list-response.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport KalturaAccessControlMessage from './kaltura-access-control-message'\nimport KalturaPlaybackSource from './kaltura-playback-source'\nimport KalturaRuleAction from './kaltura-rule-action'\nimport KalturaFlavorAsset from './kaltura-flavor-asset'\n\n/**\n * Ovp BE playback context response\n * @classdesc\n */\nexport default class KalturaPlaybackContext extends ServiceResult {\n /**\n * @member - The playback sources\n * @type {Array<KalturaPlaybackSource>}\n */\n sources: Array<KalturaPlaybackSource> = [];\n /**\n * @member - Array of actions as received from the rules that invalidated\n * @type {Array<KalturaRuleAction>}\n */\n actions: Array<KalturaRuleAction> = [];\n /**\n * @member - Array of actions as received from the rules that invalidated\n * @type {Array<KalturaAccessControlMessage>}\n */\n messages: Array<KalturaAccessControlMessage> = [];\n /**\n * @member - The flavor assets\n * @type {Array<KalturaFlavorAsset>}\n */\n flavorAssets: Array<KalturaFlavorAsset> = [];\n\n /**\n * @constructor\n * @param {Object} response The response\n */\n constructor(response: Object) {\n super(response);\n if (!this.hasError) {\n\n let messages = response.messages;\n if (messages) {\n messages.map(message => this.messages.push(new KalturaAccessControlMessage(message)));\n }\n\n let actions = response.actions;\n if (actions) {\n actions.map(action => this.actions.push(new KalturaRuleAction(action)));\n }\n\n let sources = response.sources;\n if (sources) {\n sources.map(source => this.sources.push(new KalturaPlaybackSource(source)));\n }\n\n let flavorAssets = response.flavorAssets;\n if (flavorAssets) {\n flavorAssets.map(flavor => this.flavorAssets.push(new KalturaFlavorAsset(flavor)));\n }\n }\n\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-playback-context.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-playback-context.js","//@flow\nimport KalturaDrmPlaybackPluginData from './kaltura-drm-playback-plugin-data'\n\n/**\n * Ovp BE playback source\n * @classdesc\n */\nexport default class KalturaPlaybackSource {\n /**\n * @member - source format according to delivery profile streamer type (applehttp, mpegdash etc.)\n * @type {string}\n */\n format: string;\n /**\n * @member - delivery profile Id\n * @type {string}\n */\n deliveryProfileId: string;\n /**\n * @member - The source URL\n * @type {string}\n */\n url: string;\n /**\n * @member - comma separated string according to deliveryProfile media protocols ('http,https' etc.)\n * @type {string}\n */\n protocols: string;\n /**\n * @member - comma separated string of flavor ids\n * @type {string}\n */\n flavorIds: string;\n /**\n * @member - drm data object containing relevant license url ,scheme name and certificate\n * @type {Array<KalturaDrmPlaybackPluginData>}\n */\n drm: Array<KalturaDrmPlaybackPluginData> = [];\n\n /**\n * @constructor\n * @param {Object} source The response\n */\n constructor(source: Object) {\n this.format = source.format;\n this.deliveryProfileId = source.deliveryProfileId;\n this.url = source.url;\n this.protocols = source.protocols;\n this.flavorIds = source.flavorIds;\n\n if (source.drm) {\n source.drm.map(drm => this.drm.push(new KalturaDrmPlaybackPluginData(drm)));\n }\n\n\n }\n\n /**\n * Checks if source has DRM data\n * @function hasDrmData\n * @returns {boolean} Is source has DRM\n */\n hasDrmData(): boolean {\n return this.drm && this.drm.length > 0;\n }\n\n /**\n * Checks if source has flavor IDs\n * @function hasFlavorIds\n * @returns {boolean} Is source ha flavor IDs\n */\n hasFlavorIds(): boolean {\n return !!this.flavorIds && this.flavorIds.length > 0;\n }\n\n /**\n * Returns source desired protocol if supported\n * @param {string} protocol - the desired protocol for the source (base play url protocol)\n * @returns {string} - protocol if protocol is in the protocols list - if not empty string returned\n */\n getProtocol(protocol: string): string {\n let returnValue: string = \"\";\n if (this.protocols && this.protocols.length > 0) {\n let protocolsArr: Array<string> = this.protocols.split(\",\");\n protocolsArr.forEach((p) => {\n if (p == protocol) {\n returnValue = p;\n }\n });\n }\n else if (protocol == \"http\") {\n return protocol;\n }\n return returnValue;\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-playback-source.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-playback-source.js","'use strict';\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\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.copyProperties = copyProperties;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar INITIALIZED = Symbol();\n\n/**\n * This is an abstract class that is not intended to be\n * used directly. Extend it to turn your class into an enum\n * (initialization is performed via `MyClass.initEnum()`).\n */\n\nvar Enum = exports.Enum = function () {\n /**\n * `initEnum()` closes the class. Then calling this constructor\n * throws an exception.\n * \n * If your subclass has a constructor then you can control\n * what properties are added to `this` via the argument you\n * pass to `super()`. No arguments are fine, too.\n */\n\n function Enum() {\n var instanceProperties = arguments.length <= 0 || arguments[0] === undefined ? undefined : arguments[0];\n\n _classCallCheck(this, Enum);\n\n // new.target would be better than this.constructor,\n // but isn’t supported by Babel\n if ({}.hasOwnProperty.call(this.constructor, INITIALIZED)) {\n throw new Error('Enum classes can’t be instantiated');\n }\n if ((typeof instanceProperties === 'undefined' ? 'undefined' : _typeof(instanceProperties)) === 'object' && instanceProperties !== null) {\n copyProperties(this, instanceProperties);\n }\n }\n /**\n * Set up the enum, close the class.\n * \n * @param arg Either an object whose properties provide the names\n * and values (which must be mutable objects) of the enum constants.\n * Or an Array whose elements are used as the names of the enum constants\n * The values are create by instantiating the current class.\n */\n\n _createClass(Enum, [{\n key: 'toString',\n\n /**\n * Default `toString()` method for enum constant.\n */\n value: function toString() {\n return this.constructor.name + '.' + this.name;\n }\n }], [{\n key: 'initEnum',\n value: function initEnum(arg) {\n Object.defineProperty(this, 'enumValues', {\n value: [],\n configurable: false,\n writable: false,\n enumerable: true\n });\n if (Array.isArray(arg)) {\n this._enumValuesFromArray(arg);\n } else {\n this._enumValuesFromObject(arg);\n }\n Object.freeze(this.enumValues);\n this[INITIALIZED] = true;\n return this;\n }\n }, {\n key: '_enumValuesFromArray',\n value: function _enumValuesFromArray(arr) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = arr[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n\n this._pushEnumValue(new this(), key);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n }, {\n key: '_enumValuesFromObject',\n value: function _enumValuesFromObject(obj) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = Object.keys(obj)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n\n var value = new this(obj[key]);\n this._pushEnumValue(value, key);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n }, {\n key: '_pushEnumValue',\n value: function _pushEnumValue(enumValue, name) {\n enumValue.name = name;\n enumValue.ordinal = this.enumValues.length;\n Object.defineProperty(this, name, {\n value: enumValue,\n configurable: false,\n writable: false,\n enumerable: true\n });\n this.enumValues.push(enumValue);\n }\n\n /**\n * Given the name of an enum constant, return its value.\n */\n\n }, {\n key: 'enumValueOf',\n value: function enumValueOf(name) {\n return this.enumValues.find(function (x) {\n return x.name === name;\n });\n }\n\n /**\n * Make enum classes iterable\n */\n\n }, {\n key: Symbol.iterator,\n value: function value() {\n return this.enumValues[Symbol.iterator]();\n }\n }]);\n\n return Enum;\n}();\n\nfunction copyProperties(target, source) {\n // Ideally, we’d use Reflect.ownKeys() here,\n // but I don’t want to depend on a polyfill\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = Object.getOwnPropertyNames(source)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var key = _step3.value;\n\n var desc = Object.getOwnPropertyDescriptor(source, key);\n Object.defineProperty(target, key, desc);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return target;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/enumify/lib/enumify.js\n// module id = 18\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///~/enumify/lib/enumify.js","//@flow\nimport OvpService from '../services/ovp-service'\nimport MultiRequestBuilder from '../../multi-request-builder'\nimport {MultiRequestResult} from '../../multi-request-builder'\n\n/**\n * Data loaders manager\n * @classdesc\n */\nexport default class DataLoaderManager {\n /**\n * @member - Lodaers response map index\n * @type {Map<string,Array<number>>}\n * @private\n * @static\n */\n static _loadersResponseMap: Map<string, Array<number>> = new Map();\n /**\n * @member - Loaders multi request\n * @type {MultiRequestBuilder}\n * @private\n */\n _multiRequest: MultiRequestBuilder;\n /**\n * @member - Loaders multi response\n * @type {MultiRequestResult}\n * @private\n */\n _multiResponse: MultiRequestResult;\n /**\n * @member - Loaders to execute\n * @type {Map<string,Function>}\n * @private\n */\n _loaders: Map<string, ILoader> = new Map();\n\n /**\n * @constructor\n * @param {string} partnerID Then partner ID\n * @param {string} ks The ks\n */\n constructor(partnerID: number, ks: string = \"\") {\n this._multiRequest = OvpService.getMultirequest(ks, partnerID);\n }\n\n /**\n * Add loader too execution loaders map\n * @function\n * @param {Function} loader Loader to add\n * @param {Object} params Loader params\n * @returns {void}\n */\n add(loader: typeof ILoader, params: Object): void {\n let execution_loader = new loader(params);\n if (execution_loader.isValid()) {\n this._loaders.set(loader.name, execution_loader);\n //Get the start index from the multiReqeust before adding current execution_loader requests\n let startIndex = this._multiRequest.requests.length;\n //Get the requests\n let requests = execution_loader.requests;\n //Add requests to muktiRequest queue\n requests.forEach((request) => {\n this._multiRequest.add(request);\n });\n //Create range array of current execution_loader requests\n let executionLoaderResponseMap = Array.from(new Array(requests.length), (val, index) => index + startIndex);\n //Add to map\n DataLoaderManager._loadersResponseMap.set(loader.name, executionLoaderResponseMap);\n }\n }\n\n /**\n * Get data from all loaders using multi request\n * @function\n * @returns {Promise} Promise\n */\n fetchData(): Promise<any> {\n return new Promise((resolve, reject) => {\n this._multiRequest.execute()\n .then(response => {\n this._multiResponse = response;\n if (!response.success) {\n reject(response);\n }\n else {\n let preparedData: Object = this.prepareData(response);\n if (preparedData.success) {\n resolve(this._loaders);\n }\n else {\n reject({success: false, data: preparedData.error});\n }\n }\n },\n err => {\n reject(err);\n });\n });\n }\n\n prepareData(response: MultiRequestResult): Object {\n this._loaders.forEach(function (loader, name) {\n let loaderDataIndexes = DataLoaderManager._loadersResponseMap.get(name);\n try {\n if (loaderDataIndexes != null) {\n loader.response = (response.results.slice(loaderDataIndexes[0], loaderDataIndexes[loaderDataIndexes.length - 1] + 1));\n }\n }\n catch (err) {\n return {success: false, error: err};\n }\n });\n return {success: true, data: this._loaders};\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/data-loader-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/data-loader-manager.js","//@flow\n\nimport RequestBuilder from '../../request-builder'\nimport BaseEntryService from '../services/base-entry-service'\nimport MetaDataService from '../services/meta-data-service'\nimport Configuration from '../config'\nimport KalturaPlaybackContext from '../response-types/kaltura-playback-context'\nimport KalturaMetadataListResponse from '../response-types/kaltura-metadata-list-response'\nimport KalturaBaseEntryListResponse from '../response-types/kaltura-base-entry-list-response'\n\nconst config = Configuration.get();\n\n/**\n * Media entry loader\n * @classdesc\n */\nexport default class MediaEntryLoader implements ILoader {\n static get name(): string {\n return \"media\";\n }\n\n _entryId: string;\n _requests: Array<RequestBuilder>;\n _response: any = {};\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n constructor(params: Object) {\n this.requests = this.buildRequests(params);\n this._entryId = params.entryId;\n }\n\n set requests(requests: Array<RequestBuilder>) {\n this._requests = requests;\n }\n\n get requests(): Array<RequestBuilder> {\n return this._requests;\n }\n\n set response(response: any) {\n let mediaEntryResponse: KalturaBaseEntryListResponse = new KalturaBaseEntryListResponse(response[0].data);\n this._response.entry = mediaEntryResponse.entries[0];\n this._response.playBackContextResult = new KalturaPlaybackContext(response[1].data);\n this._response.metadataListResult = new KalturaMetadataListResponse(response[2].data);\n }\n\n get response(): any {\n return this._response;\n }\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n buildRequests(params: Object): Array<RequestBuilder> {\n let requests: Array<RequestBuilder> = [];\n requests.push(BaseEntryService.list(config.beUrl, params.ks, params.entryId));\n requests.push(BaseEntryService.getPlaybackContext(config.beUrl, params.ks, params.entryId));\n requests.push(MetaDataService.list(config.beUrl, params.ks, params.entryId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n isValid(): boolean {\n return !!this._entryId;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/media-entry-loader.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/media-entry-loader.js","//@flow\nimport SessionService from '../services/session-service'\nimport Configuration from '../config'\nimport RequestBuilder from '../../request-builder'\n\nconst config = Configuration.get();\n/**\n * Media entry loader\n * @classdesc\n */\nexport default class SessionLoader implements ILoader {\n static get name(): string {\n return \"session\";\n }\n\n /**\n * @member - partner ID\n * @type {number}\n * @private\n */\n _partnerId: number;\n _requests: Array<RequestBuilder>;\n _response: any = {};\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n constructor(params: Object) {\n this.requests = this.buildRequests(params);\n this._partnerId = params.partnerId;\n }\n\n set requests(requests: Array<RequestBuilder>) {\n this._requests = requests;\n }\n\n get requests(): Array<RequestBuilder> {\n return this._requests;\n }\n\n set response(response: any) {\n this._response.ks = response[0].data.ks;\n }\n\n get response(): any {\n return this._response.ks;\n }\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n buildRequests(params: Object): Array<RequestBuilder> {\n let requests: Array<RequestBuilder> = [];\n requests.push(SessionService.anonymousSession(config.beUrl, params.partnerId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n isValid(): boolean {\n return !!this._partnerId;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/session-loader.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/session-loader.js","//@flow\nimport UiConfService from '../services/ui-conf-service'\nimport KalturaUiConfResponse from '../response-types/kaltura-ui-conf-response'\nimport Configuration from '../config'\nimport RequestBuilder from '../../request-builder'\n\nconst config = Configuration.get();\n\nexport default class UiConfigLoader implements ILoader {\n static get name(): string {\n return \"uiConf\";\n }\n\n /**\n * @member - uiConf ID\n * @type {number}\n * @private\n */\n _uiConfId: number;\n _requests: Array<RequestBuilder>;\n _response: any = {};\n\n /**\n * @constructor\n * @param {Object} params loader params\n */\n constructor(params: Object) {\n this.requests = this.buildRequests(params);\n this._uiConfId = params.uiConfId;\n }\n\n set requests(requests: Array<RequestBuilder>) {\n this._requests = requests;\n }\n\n get requests(): Array<RequestBuilder> {\n return this._requests;\n }\n\n set response(response: any) {\n this._response.uiConf = new KalturaUiConfResponse(response[0].data);\n }\n\n get response(): any {\n if (this._response != null && this._response.uiConf != null && this._response.uiConf.config != null)\n try {\n return JSON.parse(this._response.uiConf.config).plugins;\n }\n catch (err) {\n return null;\n }\n else\n return null;\n }\n\n /**\n * Builds loader requests\n * @function\n * @param {Object} params Requests parameters\n * @returns {RequestBuilder} The request builder\n * @static\n */\n buildRequests(params: Object): Array<RequestBuilder> {\n let requests: Array<RequestBuilder> = [];\n requests.push(UiConfService.get(config.beUrl, params.ks, params.uiConfId));\n return requests;\n }\n\n /**\n * Loader validation function\n * @function\n * @returns {boolean} Is valid\n */\n isValid(): boolean {\n return !!this._uiConfId;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/loaders/ui-config-loader.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/loaders/ui-config-loader.js","//@flow\nimport KalturaMediaEntry from './response-types/kaltura-media-entry'\nimport KalturaPlaybackContext from './response-types/kaltura-playback-context'\nimport KalturaPlaybackSource from './response-types/kaltura-playback-source'\nimport KalturaFlavorAsset from './response-types/kaltura-flavor-asset'\nimport KalturaMetadataListResponse from './response-types/kaltura-metadata-list-response'\nimport PlaySourceUrlBuilder from \"./play-source-url-builder\"\nimport XmlParser from '../xml-parser'\nimport {MediaEntryType, EntryType, MediaType} from '../enums'\nimport Logger from '../../util/logger'\nimport Configuration from './config'\nimport {MediaFormat} from '../../entities/media-format'\nimport MediaEntry from '../../entities/media-entry'\nimport Drm from '../../entities/drm'\nimport MediaSource from '../../entities/media-source'\nimport MediaSources from '../../entities/media-sources'\n\nconst config = Configuration.get();\n/**\n * @constant\n */\nconst logger = Logger.get(\"OvpProvider\");\n\n/**\n * @constant\n * @type {Map<string, MediaFormat>}\n */\nconst SUPPORTED_FORMATS: Map<string, MediaFormat> = new Map([\n [\"mpegdash\", MediaFormat.dash],\n [\"applehttp\", MediaFormat.hls],\n [\"url\", MediaFormat.mp4]\n]);\n\n/**\n * Ovp provider parser\n * @classdesc\n */\nexport default class ProviderParser {\n\n /**\n * Returns parsed media entry by given OVP response objects\n * @function getMediaEntry\n * @param {string} ks The ks\n * @param {number} partnerID The partner ID\n * @param {number} uiConfId The uiConf ID\n * @param {any} mediaEntryResponse The media entry response\n * @returns {MediaEntry} The media entry\n * @static\n */\n static getMediaEntry(ks: string, partnerID: number, uiConfId: number, mediaEntryResponse: any): MediaEntry {\n let mediaEntry: MediaEntry = new MediaEntry();\n let entry = mediaEntryResponse.entry;\n let playbackContext = mediaEntryResponse.playBackContextResult;\n let metadataList = mediaEntryResponse.metadataListResult;\n let kalturaSources: Array<KalturaPlaybackSource> = playbackContext.sources;\n let sources: MediaSources = new MediaSources();\n if (kalturaSources && kalturaSources.length > 0) {\n kalturaSources.forEach((source) => {\n let parsedSource = this.parseSource(source, ks, partnerID, uiConfId, entry, playbackContext);\n let mediaFormat = SUPPORTED_FORMATS.get(source.format);\n sources.map(parsedSource, mediaFormat);\n });\n }\n\n mediaEntry.sources = sources;\n\n let metadata: Map<string, string> = this.parseMetaData(metadataList);\n mediaEntry.metaData = metadata;\n mediaEntry.id = entry.id;\n mediaEntry.duration = entry.duration;\n\n let type: MediaEntryType = MediaEntryType.Unknown;\n\n switch (entry.entryType) {\n case MediaType.IMAGE.value:\n type = MediaEntryType.Image;\n break;\n case MediaType.AUDIO.value:\n type = MediaEntryType.Audio;\n break;\n default:\n switch (entry.type) {\n case EntryType.MEDIA_CLIP.value:\n type = MediaEntryType.Vod;\n break;\n case EntryType.LIVE_STREAM.value:\n case EntryType.LIVE_CHANNEL.value:\n type = MediaEntryType.Live;\n break;\n default:\n type = MediaEntryType.Unknown;\n }\n }\n mediaEntry.type = type;\n\n return mediaEntry;\n }\n\n /**\n *\n * @param {KalturaPlaybackSource} source The source\n * @param {string} ks The ks\n * @param {number} partnerID The partner ID\n * @param {number} uiConfId The uiConf ID\n * @param {KalturaMediaEntry} entry The entry\n * @param {KalturaPlaybackContext} playbackContext The playback context\n * @returns {MediaSource} The parsed media source\n * @static\n */\n static parseSource(source: KalturaPlaybackSource, ks: string, partnerID: number, uiConfId: number, entry: KalturaMediaEntry, playbackContext: KalturaPlaybackContext): MediaSource {\n let playUrl: string = \"\";\n let mediaFormat = SUPPORTED_FORMATS.get(source.format);\n let mediaSource: MediaSource = new MediaSource();\n // in case playbackSource doesn't have flavors we don't need to build the url and we'll use the provided one.\n if (source.hasFlavorIds()) {\n let splittedUrl: Array<string> = config.baseUrl.split(\"/\");\n let baseProtocol: string;\n if (splittedUrl && splittedUrl.length > 0) {\n baseProtocol = splittedUrl[0].substring(0, splittedUrl[0].length - 1);\n }\n else {\n baseProtocol = \"http\";\n }\n\n let extension: string = \"\";\n if (!mediaFormat) {\n let flavorIdsArr = source.flavorIds.split(\",\");\n let flavors: Array<KalturaFlavorAsset> = playbackContext.flavorAssets.filter(flavor => flavorIdsArr.indexOf(flavor.id) != -1);\n if (flavors && flavors.length > 0) {\n extension = flavors[0].fileExt;\n }\n }\n else {\n extension = mediaFormat.pathExt;\n mediaSource.mimetype = mediaFormat.mimeType;\n }\n\n playUrl = PlaySourceUrlBuilder.build({\n entryId: entry.id,\n flavorIds: source.flavorIds,\n format: source.format,\n ks: ks,\n partnerId: partnerID,\n uiConfId: uiConfId,\n extension: extension,\n protocol: source.getProtocol(baseProtocol)\n });\n\n }\n else {\n playUrl = source.url;\n }\n\n if (playUrl == \"\") {\n logger.error(`failed to create play url from source, discarding source: (${entry.id}_${source.deliveryProfileId}), ${source.format}.`);\n return mediaSource;\n }\n\n mediaSource.url = playUrl;\n mediaSource.id = entry.id + \"_\" + source.deliveryProfileId + \",\" + source.format;\n if (source.hasDrmData()) {\n let drmParams: Array<Drm> = [];\n source.drm.forEach((drm) => {\n drmParams.push(new Drm(drm.licenseURL, drm.scheme));\n });\n mediaSource.drmData = drmParams;\n }\n return mediaSource;\n }\n\n /**\n * Ovp metadata parser\n * @function parseMetaData\n * @param {KalturaMetadataListResponse} metadataList The metadata list\n * @returns {Map<string,string>} Parsed metadata\n * @static\n */\n static parseMetaData(metadataList: KalturaMetadataListResponse): Map<string, string> {\n let metadata: Object = {};\n if (metadataList && metadataList.metas && metadataList.metas.length > 0) {\n metadataList.metas.forEach((meta) => {\n let metaXml: Object;\n let domParser: DOMParser = new DOMParser();\n meta.xml = meta.xml.replace(/\\r?\\n|\\r/g, \"\");\n meta.xml = meta.xml.replace(/>\\s*/g, '>');\n meta.xml = meta.xml.replace(/>\\s*/g, '>');\n metaXml = domParser.parseFromString(meta.xml, 'text/xml');\n let metasObj: Object = XmlParser.xmlToJson(metaXml);\n let metaKeys = Object.keys(metasObj.metadata);\n metaKeys.forEach((key) => {\n metadata[key] = metasObj.metadata[key][\"#text\"];\n })\n\n })\n }\n return metadata;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/provider-parser.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/provider-parser.js","//@flow\nimport Logger from '../../util/logger'\nimport ProviderParser from './provider-parser'\nimport DataLoaderManager from './loaders/data-loader-manager'\nimport MediaEntryLoader from './loaders/media-entry-loader'\nimport SessionLoader from './loaders/session-loader'\nimport UiConfigLoader from './loaders/ui-config-loader'\nimport Configuration from './config'\nimport MediaEntry from '../../entities/media-entry'\nimport MediaSources from '../../entities/media-sources'\n/**\n * @constant\n */\nconst logger = Logger.get(\"OvpProvider\");\n\ntype playerConfig = {\n id: string,\n session: Object,\n sources: MediaSources,\n duration: number,\n type: string,\n metadata: Object,\n plugins: Object\n};\n\n/**\n * Ovp provider\n * @classdesc\n */\nexport class OvpProvider {\n /**\n * @member - ks\n * @type {string}\n */\n ks: string;\n /**\n * @member - partner ID\n * @type {number}\n */\n partnerID: number;\n /**\n * @member - is anonymous\n * @type {boolean}\n * @private\n */\n _isAnonymous: boolean;\n /**\n * @member - uiConf ID\n * @type {number}\n * @private\n */\n _uiConfId: number;\n /**\n * @member - Data loader\n * @type {DataLoaderManager}\n * @private\n */\n _dataLoader: DataLoaderManager;\n\n /**\n * @constructor\n * @param {number} partnerID The partner ID\n * @param {string} [ks=\"\"] The provider ks (has empty string as default value)\n * @param {Object} [config] The provider config(optional)\n */\n constructor(partnerID: number, ks: string = \"\", config?: Object) {\n this.partnerID = partnerID;\n this.ks = ks;\n this._isAnonymous = !this.ks;\n Configuration.set(config);\n }\n\n /**\n * Returns player json configuration\n * @function getConfig\n * @param {string} entryId The entry ID\n * @param {number} uiConfId The uiConf ID\n * @returns {Promise} The provider config object as promise\n */\n getConfig(entryId?: string, uiConfId?: number): Promise<Object> {\n if (uiConfId != null) {\n this._uiConfId = uiConfId;\n }\n this._dataLoader = new DataLoaderManager(this.partnerID, this.ks);\n return new Promise((resolve, reject) => {\n if (this.validateParams(entryId, uiConfId)) {\n let ks: string = this.ks;\n if (this._isAnonymous) {\n ks = \"{1:result:ks}\";\n this._dataLoader.add(SessionLoader, {partnerId: this.partnerID});\n }\n this._dataLoader.add(MediaEntryLoader, {entryId: entryId, ks: ks});\n this._dataLoader.add(UiConfigLoader, {uiConfId: uiConfId, ks: ks});\n this._dataLoader.fetchData()\n .then(response => {\n resolve(this.parseDataFromResponse(response));\n },\n err => {\n reject(err);\n });\n }\n else {\n reject({success: false, data: \"Missing mandatory parameter\"});\n }\n });\n }\n\n /**\n * Parses BE data to json configuration object\n * @function parseDataFromResponse\n * @param {Map<string,Function>} data The data to parse\n * @returns {Object} The parsed config object\n */\n parseDataFromResponse(data: Map<string, Function>): Object {\n logger.debug(\"Data parsing started\");\n let config: playerConfig = {\n id: \"\",\n session: {\n partnerID: this.partnerID,\n uiConfID: this._uiConfId,\n },\n sources: new MediaSources(),\n duration: 0,\n type: \"Unknown\",\n metadata: {},\n plugins: {}\n };\n if (data != null) {\n if (data.has(SessionLoader.name)) {\n let sessionLoader = data.get(SessionLoader.name);\n if (sessionLoader != null && sessionLoader.response != null) {\n this.ks = sessionLoader.response;\n this._isAnonymous = !this.ks;\n config.session.ks = this.ks;\n }\n }\n if (data.has(UiConfigLoader.name)) {\n let uiConfLoader = data.get(UiConfigLoader.name);\n let pluginsJson: Object = {};\n if (uiConfLoader != null) {\n pluginsJson = uiConfLoader.response;\n }\n config.plugins = pluginsJson;\n }\n if (data.has(MediaEntryLoader.name)) {\n let mediaLoader = data.get(MediaEntryLoader.name);\n if (mediaLoader != null && mediaLoader.response != null) {\n let mediaEntry: MediaEntry = ProviderParser.getMediaEntry(this.ks, this.partnerID, this._uiConfId, mediaLoader.response);\n config.id = mediaEntry.id;\n config.sources = mediaEntry.sources;\n config.duration = mediaEntry.duration;\n config.type = mediaEntry.type.name;\n config.metadata = mediaEntry.metaData;\n }\n }\n }\n logger.debug(\"Data parsing finished\", config);\n return (config);\n }\n\n /**\n * Parameters validation function\n * @param {string} entryId The entry ID\n * @param {number} uiConfId The uiConfID\n * @returns {boolean} Is valid params\n */\n validateParams(entryId?: string, uiConfId?: number): boolean {\n return !!entryId || !!uiConfId;\n }\n\n}\n\nexport default OvpProvider;\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/ovp-provider.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/ovp-provider.js","//@flow\nimport Configuration from './config'\n\nconst config = Configuration.get();\n\n/**\n * Media source url builder\n * @classdesc\n */\nexport default class PlaySourceUrlBuilder {\n\n /**\n * Returns source url by given url params\n * @function build\n * @param {Object} urlParams The params\n * @returns {string} The URL\n * @static\n */\n static build(urlParams: Object): string {\n let baseUrl: string = config.baseUrl;\n let partnerId: string = urlParams.partnerId;\n let entryId: string = urlParams.entryId;\n let ks: string = urlParams.ks;\n let uiConfId: string = urlParams.uiConfId;\n let format: string = urlParams.format;\n let protocol: string = urlParams.protocol;\n let extension: string = urlParams.extension;\n let flavorIds: string = urlParams.flavorIds;\n\n if (baseUrl == \"\" && partnerId == \"\" && entryId == \"\" && extension == \"\" && format == \"\") {\n return \"\";\n }\n\n let playUrl = baseUrl;\n if (!PlaySourceUrlBuilder.endsWith(baseUrl, \"/\")) {\n playUrl += \"/\";\n }\n playUrl += \"p/\" + partnerId + \"/sp/\" + partnerId + \"00\" + \"/playManifest/entryId/\" + entryId + \"/protocol/\" + protocol + \"/format/\" + format;\n\n if (flavorIds != \"\") {\n playUrl += \"/falvorIds/\" + flavorIds;\n }\n else if (uiConfId != \"\") {\n playUrl += \"/uiConfId/\" + uiConfId;\n }\n\n if (this.ks != \"\") {\n playUrl += \"/ks/\" + ks;\n }\n\n playUrl += \"/a.\" + extension;\n\n if (uiConfId && flavorIds != \"\") {\n playUrl += \"?uiConfId=.\" + uiConfId;\n }\n\n return playUrl;\n }\n\n /**\n * Checks if given string end with search string\n * @param {string} string The given string\n * @param {string} searchString The string to search\n * @returns {boolean} Is given string end with search string\n */\n static endsWith(string: string, searchString: string): boolean {\n if (typeof string !== 'string') {\n return false;\n }\n if (typeof searchString !== 'string') {\n return false;\n }\n\n return string.indexOf(searchString, string.length - searchString.length) != -1;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/play-source-url-builder.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/play-source-url-builder.js","//@flow\n\n/**\n * Ovp BE access control message\n * @classdesc\n */\nexport default class KalturaAccessControlMessage {\n /**\n * @member - The access control message\n * @type {string}\n */\n message: string;\n /**\n * @member - The access control message code\n * @@type {string}\n */\n code: string;\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n constructor(data: Object) {\n this.message = data.message;\n this.code = data.code\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-access-control-message.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-access-control-message.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport KalturaMediaEntry from './kaltura-media-entry'\n\n/**\n * Ovp BE BaseEntryList service response\n * @classdesc\n */\nexport default class KalturaBaseEntryListResponse extends ServiceResult {\n /**\n * @member - The total count\n * @type {number}\n */\n totalCount: number;\n /**\n * @member - The entries\n * @type {Array<KalturaMediaEntry>}\n */\n entries: Array<KalturaMediaEntry>;\n\n /**\n * @constructor\n * @param {Object} responseObj The json response\n */\n constructor(responseObj: Object) {\n super(responseObj);\n if (!this.hasError) {\n this.totalCount = responseObj.totalCount;\n if (this.totalCount > 0) {\n this.entries = [];\n responseObj.objects.map(entry => this.entries.push(new KalturaMediaEntry(entry)));\n }\n }\n }\n}\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-base-entry-list-response.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-base-entry-list-response.js","//@flow\nimport {Scheme} from '../../enums'\n\n/**\n * Ovp BE DrmPlaybackPluginData\n * @classdesc\n */\nexport default class KalturaDrmPlaybackPluginData {\n /**\n * @member - The drm scheme\n * @type {Scheme}\n */\n scheme: Scheme;\n\n /**\n * @member - The license URL\n * @type {string}\n */\n licenseURL: string;\n\n /**\n * @constructor\n * @param {Object} drm The json response\n */\n constructor(drm: any) {\n this.scheme = drm.scheme;\n this.licenseURL = drm.licenseURL;\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-drm-playback-plugin-data.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-drm-playback-plugin-data.js","//@flow\nimport {MetadataObjectType, MetadataStatus} from '../../enums'\n\n/**\n * Ovp BE Metadata\n * @classdesc\n */\nexport default class KalturaMetadata {\n id: number;\n metadataProfileId: number;\n metadataProfileVersion: number;\n metadataObjectType: MetadataObjectType;\n objectId: string;\n version: number;\n created: Date;\n updated: Date;\n status: MetadataStatus;\n /**\n * @member - The Metadata xml - represented as XML string\n * @type {string}\n */\n xml: string;\n\n /**\n * @constructor\n * @param {Object} data The response\n */\n constructor(data: Object) {\n this.id = data.id;\n this.metadataProfileId = data.metadataProfileId;\n this.metadataProfileVersion = data.metadataProfileVersion;\n this.metadataProfileId = data.metadataProfileId;\n this.metadataObjectType = data.metadataObjectType;\n this.objectId = data.objectId;\n this.version = data.version;\n this.created = new Date(0);\n this.created.setUTCSeconds(data.createdAt);\n this.updated = new Date(0);\n this.updated.setUTCSeconds(data.updatedAt);\n this.status = data.status;\n this.xml = data.xml;\n\n }\n}\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-metadata.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-metadata.js","//@flow\nimport {KalturaRuleActionType} from '../../enums'\n\n/**\n * Ovp BE rule action\n * @classdesc\n */\nexport default class KalturaRuleAction {\n /**\n * @member - The type of the action\n * @type {KalturaRuleActionType}\n */\n type: KalturaRuleActionType;\n\n /**\n * @constructor\n * @param {Object} data The response\n */\n constructor(data: Object) {\n this.type = data.type;\n }\n}\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-rule-action.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-rule-action.js","//@flow\nimport ServiceResult from '../../base-service-result'\nimport {UIConfType, UIConfCreationMode} from '../../enums';\n\n/**\n * Ovp BE Ui config response\n * @classdesc\n */\nexport default class KalturaUiConfResponse extends ServiceResult {\n /**\n * @member -Name of the uiConf, this is not a primary key\n * @type {string}\n */\n name: string;\n /**\n * @member -Name of the uiConf, this is not a primary key\n * @type {string}\n */\n description: string;\n objTypeAsString: string;\n width: number;\n height: number;\n htmlParams: string;\n swfUrl: string;\n confFilePath: string;\n confFile: string;\n confFileFeatures: string;\n name: string;\n /**\n * @member -plugins configuration represented as Json string\n * @type {string}\n */\n config: string;\n confVars: string;\n useCdn: boolean;\n tags: string;\n swfUrlVersion: string;\n created: Date;\n updated: Date;\n html5Url: string;\n version: string;\n partnerTags: string;\n objType: UIConfType;\n creationMode: UIConfCreationMode;\n\n /**\n * @constructor\n * @param {Object} data The json response\n */\n constructor(data: Object) {\n super(data);\n if (!this.hasError) {\n this.name = data.name;\n\n this.description = data.description;\n this.objTypeAsString = data.objTypeAsString;\n this.width = data.width;\n this.height = data.height;\n this.htmlParams = data.htmlParams;\n this.swfUrl = data.swfUrl;\n this.confFilePath = data.confFilePath;\n this.confFile = data.confFile;\n this.confFileFeatures = data.confFileFeatures;\n this.config = data.config;\n this.confVars = data.confVars;\n this.useCdn = data.useCdn;\n this.tags = data.tags;\n this.swfUrlVersion = data.swfUrlVersion;\n this.created = new Date(0);\n this.created.setUTCSeconds(data.createdAt);\n this.updated = new Date(0);\n this.updated.setUTCSeconds(data.updatedAt);\n this.html5Url = data.description;\n this.version = data.description;\n this.partnerTags = data.description;\n this.objType = data.description;\n this.creationMode = data.description;\n\n }\n }\n}\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/response-types/kaltura-ui-conf-response.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/response-types/kaltura-ui-conf-response.js","//@flow\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"baseEntry\";\n\n/**\n * Ovp BaseEntry service methods\n * @classdesc\n */\nexport default class BaseEntryService extends OvpService {\n\n /**\n * Creates an instance of RequestBuilder for baseentry.getPlaybackContext\n * @function getPlaybackContext\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static getPlaybackContext(baseUrl: string, ks: string, entryId: string): RequestBuilder {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"getPlaybackContext\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"baseEntry-getPlaybackContext\";\n let contextDataParams = {objectType: \"KalturaContextDataParams\", flavorTags: \"all\"};\n let params = {entryId: entryId, ks: ks, contextDataParams: contextDataParams};\n request.params = params;\n return request;\n }\n\n /**\n * Creates an instance of RequestBuilder for baseentry.list\n * @function list\n * @param {string} baseUrl The base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static list(baseUrl: string, ks: string, entryId: string): RequestBuilder {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"list\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"list\";\n request.params = BaseEntryService.getEntryListReqParams(entryId, ks);\n return request;\n }\n\n /**\n * Gets baseentry.list service params\n * @function getEntryListReqParams\n * @param {string} entryId The entry ID\n * @param {string} ks The ks\n * @returns {{ks: string, filter: {redirectFromEntryId: string}, responseProfile: {fields: string, type: number}}} The service params object\n * @static\n */\n static getEntryListReqParams(entryId: string, ks: string): any {\n let filterParams = {redirectFromEntryId: entryId};\n let responseProfileParams = {\n fields: \"id,name,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags\",\n type: 1\n };\n return {ks: ks, filter: filterParams, responseProfile: responseProfileParams};\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/base-entry-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/base-entry-service.js","//@flow\n\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"metadata_metadata\";\n\n/**\n * Ovp metadata_metadata service methods\n * @classdesc\n */\nexport default class MetaDataService extends OvpService {\n /**\n * Creates an instance of RequestBuilder for metadata_metadata.list\n * @function getPlaybackContext\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} entryId The entry ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static list(baseUrl: string, ks: string, entryId: string) {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"list\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"metadata_metadata-list\";\n let filter = {objectType: \"KalturaMetadataFilter\", objectIdEqual: entryId, metadataObjectTypeEqual: \"1\"};\n let params = {filter: filter, ks: ks};\n request.params = params;\n return request;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/meta-data-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/meta-data-service.js","//@flow\n\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"session\";\n\n/**\n * Ovp session service methods\n * @classdesc\n */\nexport default class SessionService extends OvpService {\n /**\n * Creates an instance of RequestBuilder for session.startWidgetSession\n * @function anonymousSession\n * @param {string} baseUrl The service base URL\n * @param {string} partnerId The partner ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static anonymousSession(baseUrl: string, partnerId: number) {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"startWidgetSession\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"session-startWidget\";\n request.params = {widgetId: \"_\" + partnerId};\n return request;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/session-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/session-service.js","//@flow\n\nimport OvpService from './ovp-service'\nimport RequestBuilder from '../../request-builder'\n\nconst SERVICE_NAME: string = \"uiconf\";\n\n/**\n * Ovp uiconf service methods\n * @classdesc\n */\nexport default class UiConfService extends OvpService {\n /**\n * Creates an instance of RequestBuilder for uiconf.get\n * @function get\n * @param {string} baseUrl The service base URL\n * @param {string} ks The ks\n * @param {string} uiConfID The uiConf ID\n * @returns {RequestBuilder} The request builder\n * @static\n */\n static get(baseUrl: string, ks: string, uiConfID: number) {\n let request = new RequestBuilder();\n request.service = SERVICE_NAME;\n request.action = \"get\";\n request.method = \"POST\";\n request.baseUrl = baseUrl;\n request.tag = \"uiconf-get\";\n let responseProfileParams = {\n fields: \"config\",\n type: 1\n };\n request.params = {id: uiConfID, responseProfile: responseProfileParams, ks: ks};\n return request;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/ovp/services/ui-conf-service.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/ovp/services/ui-conf-service.js","//@flow\n\n/**\n * Xml parser\n * @classdesc\n */\nexport default class XmlParser {\n /**\n * Parses xml string to json object\n * @param {string} xml The xml to parse\n * @returns {{}} The parsed xml as Json object\n * @static\n */\n static xmlToJson(xml: Object) {\n let obj = {};\n if (xml.nodeType == 1) {\n if (xml.attributes.length > 0) {\n obj[\"@attributes\"] = {};\n for (let j = 0; j < xml.attributes.length; j++) {\n let attribute = xml.attributes.item(j);\n obj[\"@attributes\"][attribute.nodeName] = attribute.nodeValue;\n }\n }\n }\n else if (xml.nodeType == 3) {\n obj = xml.nodeValue;\n }\n if (xml.hasChildNodes()) {\n for (let i = 0; i < xml.childNodes.length; i++) {\n let item = xml.childNodes.item(i);\n let nodeName = item.nodeName;\n if (typeof (obj[nodeName]) == \"undefined\") {\n obj[nodeName] = this.xmlToJson(item);\n }\n else {\n if (typeof (obj[nodeName].push) == \"undefined\") {\n let old = obj[nodeName];\n obj[nodeName] = [];\n obj[nodeName].push(old);\n }\n obj[nodeName].push(this.xmlToJson(item));\n }\n }\n }\n return obj;\n }\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ./k-provider/xml-parser.js\n\n\n// WEBPACK FOOTER //\n// webpack:///providers/k-provider/xml-parser.js","// @flow\n\n// Import core\nimport * as Playkit from 'playkit-js';\n\n// Import OVP and OTT providers\nimport OvpProvider from 'playkit-js-providers/dist/ovpProvider';\n\n// Import UI\nimport PlaykitUI from 'playkit-js-ui';\nimport '../node_modules/playkit-js-ui/src/styles/style.css';\n\n// Import media source adapters\nimport 'playkit-js-hls';\nimport 'playkit-js-dash';\n\nimport setup from './setup'\n// TODO: Import plugins\n\nexport {Playkit, OvpProvider, PlaykitUI, setup};\n\n\n\n\n// WEBPACK FOOTER //\n// ./index.js","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"playkit-js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsUi\"] = factory(require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsUi\"] = factory(root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_48__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 28);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 8f60fb2e6e6b40ac1263\n\n\n// WEBPACK FOOTER //\n// webpack:/ui/webpack/bootstrap 8f60fb2e6e6b40ac1263","!function() {\n 'use strict';\n function VNode() {}\n function h(nodeName, attributes) {\n var lastSimple, child, simple, i, children = EMPTY_CHILDREN;\n for (i = arguments.length; i-- > 2; ) stack.push(arguments[i]);\n if (attributes && null != attributes.children) {\n if (!stack.length) stack.push(attributes.children);\n delete attributes.children;\n }\n while (stack.length) if ((child = stack.pop()) && void 0 !== child.pop) for (i = child.length; i--; ) stack.push(child[i]); else {\n if (child === !0 || child === !1) child = null;\n if (simple = 'function' != typeof nodeName) if (null == child) child = ''; else if ('number' == typeof child) child = String(child); else if ('string' != typeof child) simple = !1;\n if (simple && lastSimple) children[children.length - 1] += child; else if (children === EMPTY_CHILDREN) children = [ child ]; else children.push(child);\n lastSimple = simple;\n }\n var p = new VNode();\n p.nodeName = nodeName;\n p.children = children;\n p.attributes = null == attributes ? void 0 : attributes;\n p.key = null == attributes ? void 0 : attributes.key;\n if (void 0 !== options.vnode) options.vnode(p);\n return p;\n }\n function extend(obj, props) {\n for (var i in props) obj[i] = props[i];\n return obj;\n }\n function cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n }\n function enqueueRender(component) {\n if (!component.__d && (component.__d = !0) && 1 == items.push(component)) (options.debounceRendering || setTimeout)(rerender);\n }\n function rerender() {\n var p, list = items;\n items = [];\n while (p = list.pop()) if (p.__d) renderComponent(p);\n }\n function isSameNodeType(node, vnode, hydrating) {\n if ('string' == typeof vnode || 'number' == typeof vnode) return void 0 !== node.splitText;\n if ('string' == typeof vnode.nodeName) return !node._componentConstructor && isNamedNode(node, vnode.nodeName); else return hydrating || node._componentConstructor === vnode.nodeName;\n }\n function isNamedNode(node, nodeName) {\n return node.__n === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n }\n function getNodeProps(vnode) {\n var props = extend({}, vnode.attributes);\n props.children = vnode.children;\n var defaultProps = vnode.nodeName.defaultProps;\n if (void 0 !== defaultProps) for (var i in defaultProps) if (void 0 === props[i]) props[i] = defaultProps[i];\n return props;\n }\n function createNode(nodeName, isSvg) {\n var node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n node.__n = nodeName;\n return node;\n }\n function removeNode(node) {\n if (node.parentNode) node.parentNode.removeChild(node);\n }\n function setAccessor(node, name, old, value, isSvg) {\n if ('className' === name) name = 'class';\n if ('key' === name) ; else if ('ref' === name) {\n if (old) old(null);\n if (value) value(node);\n } else if ('class' === name && !isSvg) node.className = value || ''; else if ('style' === name) {\n if (!value || 'string' == typeof value || 'string' == typeof old) node.style.cssText = value || '';\n if (value && 'object' == typeof value) {\n if ('string' != typeof old) for (var i in old) if (!(i in value)) node.style[i] = '';\n for (var i in value) node.style[i] = 'number' == typeof value[i] && IS_NON_DIMENSIONAL.test(i) === !1 ? value[i] + 'px' : value[i];\n }\n } else if ('dangerouslySetInnerHTML' === name) {\n if (value) node.innerHTML = value.__html || '';\n } else if ('o' == name[0] && 'n' == name[1]) {\n var useCapture = name !== (name = name.replace(/Capture$/, ''));\n name = name.toLowerCase().substring(2);\n if (value) {\n if (!old) node.addEventListener(name, eventProxy, useCapture);\n } else node.removeEventListener(name, eventProxy, useCapture);\n (node.__l || (node.__l = {}))[name] = value;\n } else if ('list' !== name && 'type' !== name && !isSvg && name in node) {\n setProperty(node, name, null == value ? '' : value);\n if (null == value || value === !1) node.removeAttribute(name);\n } else {\n var ns = isSvg && name !== (name = name.replace(/^xlink\\:?/, ''));\n if (null == value || value === !1) if (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase()); else node.removeAttribute(name); else if ('function' != typeof value) if (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value); else node.setAttribute(name, value);\n }\n }\n function setProperty(node, name, value) {\n try {\n node[name] = value;\n } catch (e) {}\n }\n function eventProxy(e) {\n return this.__l[e.type](options.event && options.event(e) || e);\n }\n function flushMounts() {\n var c;\n while (c = mounts.pop()) {\n if (options.afterMount) options.afterMount(c);\n if (c.componentDidMount) c.componentDidMount();\n }\n }\n function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n if (!diffLevel++) {\n isSvgMode = null != parent && void 0 !== parent.ownerSVGElement;\n hydrating = null != dom && !('__preactattr_' in dom);\n }\n var ret = idiff(dom, vnode, context, mountAll, componentRoot);\n if (parent && ret.parentNode !== parent) parent.appendChild(ret);\n if (!--diffLevel) {\n hydrating = !1;\n if (!componentRoot) flushMounts();\n }\n return ret;\n }\n function idiff(dom, vnode, context, mountAll, componentRoot) {\n var out = dom, prevSvgMode = isSvgMode;\n if (null == vnode) vnode = '';\n if ('string' == typeof vnode) {\n if (dom && void 0 !== dom.splitText && dom.parentNode && (!dom._component || componentRoot)) {\n if (dom.nodeValue != vnode) dom.nodeValue = vnode;\n } else {\n out = document.createTextNode(vnode);\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n recollectNodeTree(dom, !0);\n }\n }\n out.__preactattr_ = !0;\n return out;\n }\n if ('function' == typeof vnode.nodeName) return buildComponentFromVNode(dom, vnode, context, mountAll);\n isSvgMode = 'svg' === vnode.nodeName ? !0 : 'foreignObject' === vnode.nodeName ? !1 : isSvgMode;\n if (!dom || !isNamedNode(dom, String(vnode.nodeName))) {\n out = createNode(String(vnode.nodeName), isSvgMode);\n if (dom) {\n while (dom.firstChild) out.appendChild(dom.firstChild);\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n recollectNodeTree(dom, !0);\n }\n }\n var fc = out.firstChild, props = out.__preactattr_ || (out.__preactattr_ = {}), vchildren = vnode.children;\n if (!hydrating && vchildren && 1 === vchildren.length && 'string' == typeof vchildren[0] && null != fc && void 0 !== fc.splitText && null == fc.nextSibling) {\n if (fc.nodeValue != vchildren[0]) fc.nodeValue = vchildren[0];\n } else if (vchildren && vchildren.length || null != fc) innerDiffNode(out, vchildren, context, mountAll, hydrating || null != props.dangerouslySetInnerHTML);\n diffAttributes(out, vnode.attributes, props);\n isSvgMode = prevSvgMode;\n return out;\n }\n function innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n var j, c, vchild, child, originalChildren = dom.childNodes, children = [], keyed = {}, keyedLen = 0, min = 0, len = originalChildren.length, childrenLen = 0, vlen = vchildren ? vchildren.length : 0;\n if (0 !== len) for (var i = 0; i < len; i++) {\n var _child = originalChildren[i], props = _child.__preactattr_, key = vlen && props ? _child._component ? _child._component.__k : props.key : null;\n if (null != key) {\n keyedLen++;\n keyed[key] = _child;\n } else if (props || (void 0 !== _child.splitText ? isHydrating ? _child.nodeValue.trim() : !0 : isHydrating)) children[childrenLen++] = _child;\n }\n if (0 !== vlen) for (var i = 0; i < vlen; i++) {\n vchild = vchildren[i];\n child = null;\n var key = vchild.key;\n if (null != key) {\n if (keyedLen && void 0 !== keyed[key]) {\n child = keyed[key];\n keyed[key] = void 0;\n keyedLen--;\n }\n } else if (!child && min < childrenLen) for (j = min; j < childrenLen; j++) if (void 0 !== children[j] && isSameNodeType(c = children[j], vchild, isHydrating)) {\n child = c;\n children[j] = void 0;\n if (j === childrenLen - 1) childrenLen--;\n if (j === min) min++;\n break;\n }\n child = idiff(child, vchild, context, mountAll);\n if (child && child !== dom) if (i >= len) dom.appendChild(child); else if (child !== originalChildren[i]) if (child === originalChildren[i + 1]) removeNode(originalChildren[i]); else dom.insertBefore(child, originalChildren[i] || null);\n }\n if (keyedLen) for (var i in keyed) if (void 0 !== keyed[i]) recollectNodeTree(keyed[i], !1);\n while (min <= childrenLen) if (void 0 !== (child = children[childrenLen--])) recollectNodeTree(child, !1);\n }\n function recollectNodeTree(node, unmountOnly) {\n var component = node._component;\n if (component) unmountComponent(component); else {\n if (null != node.__preactattr_ && node.__preactattr_.ref) node.__preactattr_.ref(null);\n if (unmountOnly === !1 || null == node.__preactattr_) removeNode(node);\n removeChildren(node);\n }\n }\n function removeChildren(node) {\n node = node.lastChild;\n while (node) {\n var next = node.previousSibling;\n recollectNodeTree(node, !0);\n node = next;\n }\n }\n function diffAttributes(dom, attrs, old) {\n var name;\n for (name in old) if ((!attrs || null == attrs[name]) && null != old[name]) setAccessor(dom, name, old[name], old[name] = void 0, isSvgMode);\n for (name in attrs) if (!('children' === name || 'innerHTML' === name || name in old && attrs[name] === ('value' === name || 'checked' === name ? dom[name] : old[name]))) setAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n }\n function collectComponent(component) {\n var name = component.constructor.name;\n (components[name] || (components[name] = [])).push(component);\n }\n function createComponent(Ctor, props, context) {\n var inst, list = components[Ctor.name];\n if (Ctor.prototype && Ctor.prototype.render) {\n inst = new Ctor(props, context);\n Component.call(inst, props, context);\n } else {\n inst = new Component(props, context);\n inst.constructor = Ctor;\n inst.render = doRender;\n }\n if (list) for (var i = list.length; i--; ) if (list[i].constructor === Ctor) {\n inst.__b = list[i].__b;\n list.splice(i, 1);\n break;\n }\n return inst;\n }\n function doRender(props, state, context) {\n return this.constructor(props, context);\n }\n function setComponentProps(component, props, opts, context, mountAll) {\n if (!component.__x) {\n component.__x = !0;\n if (component.__r = props.ref) delete props.ref;\n if (component.__k = props.key) delete props.key;\n if (!component.base || mountAll) {\n if (component.componentWillMount) component.componentWillMount();\n } else if (component.componentWillReceiveProps) component.componentWillReceiveProps(props, context);\n if (context && context !== component.context) {\n if (!component.__c) component.__c = component.context;\n component.context = context;\n }\n if (!component.__p) component.__p = component.props;\n component.props = props;\n component.__x = !1;\n if (0 !== opts) if (1 === opts || options.syncComponentUpdates !== !1 || !component.base) renderComponent(component, 1, mountAll); else enqueueRender(component);\n if (component.__r) component.__r(component);\n }\n }\n function renderComponent(component, opts, mountAll, isChild) {\n if (!component.__x) {\n var rendered, inst, cbase, props = component.props, state = component.state, context = component.context, previousProps = component.__p || props, previousState = component.__s || state, previousContext = component.__c || context, isUpdate = component.base, nextBase = component.__b, initialBase = isUpdate || nextBase, initialChildComponent = component._component, skip = !1;\n if (isUpdate) {\n component.props = previousProps;\n component.state = previousState;\n component.context = previousContext;\n if (2 !== opts && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === !1) skip = !0; else if (component.componentWillUpdate) component.componentWillUpdate(props, state, context);\n component.props = props;\n component.state = state;\n component.context = context;\n }\n component.__p = component.__s = component.__c = component.__b = null;\n component.__d = !1;\n if (!skip) {\n rendered = component.render(props, state, context);\n if (component.getChildContext) context = extend(extend({}, context), component.getChildContext());\n var toUnmount, base, childComponent = rendered && rendered.nodeName;\n if ('function' == typeof childComponent) {\n var childProps = getNodeProps(rendered);\n inst = initialChildComponent;\n if (inst && inst.constructor === childComponent && childProps.key == inst.__k) setComponentProps(inst, childProps, 1, context, !1); else {\n toUnmount = inst;\n component._component = inst = createComponent(childComponent, childProps, context);\n inst.__b = inst.__b || nextBase;\n inst.__u = component;\n setComponentProps(inst, childProps, 0, context, !1);\n renderComponent(inst, 1, mountAll, !0);\n }\n base = inst.base;\n } else {\n cbase = initialBase;\n toUnmount = initialChildComponent;\n if (toUnmount) cbase = component._component = null;\n if (initialBase || 1 === opts) {\n if (cbase) cbase._component = null;\n base = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, !0);\n }\n }\n if (initialBase && base !== initialBase && inst !== initialChildComponent) {\n var baseParent = initialBase.parentNode;\n if (baseParent && base !== baseParent) {\n baseParent.replaceChild(base, initialBase);\n if (!toUnmount) {\n initialBase._component = null;\n recollectNodeTree(initialBase, !1);\n }\n }\n }\n if (toUnmount) unmountComponent(toUnmount);\n component.base = base;\n if (base && !isChild) {\n var componentRef = component, t = component;\n while (t = t.__u) (componentRef = t).base = base;\n base._component = componentRef;\n base._componentConstructor = componentRef.constructor;\n }\n }\n if (!isUpdate || mountAll) mounts.unshift(component); else if (!skip) {\n flushMounts();\n if (component.componentDidUpdate) component.componentDidUpdate(previousProps, previousState, previousContext);\n if (options.afterUpdate) options.afterUpdate(component);\n }\n if (null != component.__h) while (component.__h.length) component.__h.pop().call(component);\n if (!diffLevel && !isChild) flushMounts();\n }\n }\n function buildComponentFromVNode(dom, vnode, context, mountAll) {\n var c = dom && dom._component, originalComponent = c, oldDom = dom, isDirectOwner = c && dom._componentConstructor === vnode.nodeName, isOwner = isDirectOwner, props = getNodeProps(vnode);\n while (c && !isOwner && (c = c.__u)) isOwner = c.constructor === vnode.nodeName;\n if (c && isOwner && (!mountAll || c._component)) {\n setComponentProps(c, props, 3, context, mountAll);\n dom = c.base;\n } else {\n if (originalComponent && !isDirectOwner) {\n unmountComponent(originalComponent);\n dom = oldDom = null;\n }\n c = createComponent(vnode.nodeName, props, context);\n if (dom && !c.__b) {\n c.__b = dom;\n oldDom = null;\n }\n setComponentProps(c, props, 1, context, mountAll);\n dom = c.base;\n if (oldDom && dom !== oldDom) {\n oldDom._component = null;\n recollectNodeTree(oldDom, !1);\n }\n }\n return dom;\n }\n function unmountComponent(component) {\n if (options.beforeUnmount) options.beforeUnmount(component);\n var base = component.base;\n component.__x = !0;\n if (component.componentWillUnmount) component.componentWillUnmount();\n component.base = null;\n var inner = component._component;\n if (inner) unmountComponent(inner); else if (base) {\n if (base.__preactattr_ && base.__preactattr_.ref) base.__preactattr_.ref(null);\n component.__b = base;\n removeNode(base);\n collectComponent(component);\n removeChildren(base);\n }\n if (component.__r) component.__r(null);\n }\n function Component(props, context) {\n this.__d = !0;\n this.context = context;\n this.props = props;\n this.state = this.state || {};\n }\n function render(vnode, parent, merge) {\n return diff(merge, vnode, {}, !1, parent, !1);\n }\n var options = {};\n var stack = [];\n var EMPTY_CHILDREN = [];\n var IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n var items = [];\n var mounts = [];\n var diffLevel = 0;\n var isSvgMode = !1;\n var hydrating = !1;\n var components = {};\n extend(Component.prototype, {\n setState: function(state, callback) {\n var s = this.state;\n if (!this.__s) this.__s = extend({}, s);\n extend(s, 'function' == typeof state ? state(s, this.props) : state);\n if (callback) (this.__h = this.__h || []).push(callback);\n enqueueRender(this);\n },\n forceUpdate: function(callback) {\n if (callback) (this.__h = this.__h || []).push(callback);\n renderComponent(this, 2);\n },\n render: function() {}\n });\n var preact = {\n h: h,\n createElement: h,\n cloneElement: cloneElement,\n Component: Component,\n render: render,\n rerender: rerender,\n options: options\n };\n if ('undefined' != typeof module) module.exports = preact; else self.preact = preact;\n}();\n//# sourceMappingURL=preact.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/preact/dist/preact.js\n// module id = 0\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/preact/dist/preact.js","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('preact'), require('redux')) :\n\ttypeof define === 'function' && define.amd ? define(['preact', 'redux'], factory) :\n\t(global.preactRedux = factory(global.preact,global.Redux));\n}(this, (function (preact,redux) {\n\nvar Children = {\n\tonly: function only(children) {\n\t\treturn children && children[0] || null;\n\t}\n};\n\nfunction proptype() {}\nproptype.isRequired = proptype;\n\nvar PropTypes = {\n\telement: proptype,\n\tfunc: proptype,\n\tshape: function shape() {\n\t\treturn proptype;\n\t},\n\tinstanceOf: function instanceOf() {\n\t\treturn proptype;\n\t}\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n};\n\n\n\n\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\n\n\n\n\n\n\n\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar get = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\nvar objectWithoutProperties = function (obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n};\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n\n\nvar set = function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if (\"value\" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n};\n\n// encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nvar CLEARED = null;\nvar nullListeners = {\n notify: function notify() {}\n};\n\nfunction createListenerCollection() {\n // the current/next pattern is copied from redux's createStore code.\n // TODO: refactor+expose that code to be reusable here?\n var current = [];\n var next = [];\n\n return {\n clear: function clear() {\n next = CLEARED;\n current = CLEARED;\n },\n notify: function notify() {\n var listeners = current = next;\n for (var i = 0; i < listeners.length; i++) {\n listeners[i]();\n }\n },\n subscribe: function subscribe(listener) {\n var isSubscribed = true;\n if (next === current) next = current.slice();\n next.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed || current === CLEARED) return;\n isSubscribed = false;\n\n if (next === current) next = current.slice();\n next.splice(next.indexOf(listener), 1);\n };\n }\n };\n}\n\nvar Subscription = function () {\n function Subscription(store, parentSub) {\n classCallCheck(this, Subscription);\n\n this.store = store;\n this.parentSub = parentSub;\n this.unsubscribe = null;\n this.listeners = nullListeners;\n }\n\n Subscription.prototype.addNestedSub = function addNestedSub(listener) {\n this.trySubscribe();\n return this.listeners.subscribe(listener);\n };\n\n Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() {\n this.listeners.notify();\n };\n\n Subscription.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.unsubscribe);\n };\n\n Subscription.prototype.trySubscribe = function trySubscribe() {\n if (!this.unsubscribe) {\n // this.onStateChange is set by connectAdvanced.initSubscription()\n this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);\n\n this.listeners = createListenerCollection();\n }\n };\n\n Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n this.listeners.clear();\n this.listeners = nullListeners;\n }\n };\n\n return Subscription;\n}();\n\nvar storeShape = PropTypes.shape({\n subscribe: PropTypes.func.isRequired,\n dispatch: PropTypes.func.isRequired,\n getState: PropTypes.func.isRequired\n});\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}\n\nvar didWarnAboutReceivingStore = false;\nfunction warnAboutReceivingStore() {\n if (didWarnAboutReceivingStore) {\n return;\n }\n didWarnAboutReceivingStore = true;\n\n warning('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');\n}\n\nvar Provider = function (_Component) {\n inherits(Provider, _Component);\n\n Provider.prototype.getChildContext = function getChildContext() {\n return { store: this.store, storeSubscription: null };\n };\n\n function Provider(props, context) {\n classCallCheck(this, Provider);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.store = props.store;\n return _this;\n }\n\n Provider.prototype.render = function render() {\n return Children.only(this.props.children);\n };\n\n return Provider;\n}(preact.Component);\n\n{\n Provider.prototype.componentWillReceiveProps = function (nextProps) {\n var store = this.store;\n var nextStore = nextProps.store;\n\n\n if (store !== nextStore) {\n warnAboutReceivingStore();\n }\n };\n}\n\nProvider.childContextTypes = {\n store: storeShape.isRequired,\n storeSubscription: PropTypes.instanceOf(Subscription)\n};\nProvider.displayName = 'Provider';\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\n\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n arguments: true,\n arity: true\n};\n\nvar isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function';\n\nvar index = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n var keys = Object.getOwnPropertyNames(sourceComponent);\n\n /* istanbul ignore else */\n if (isGetOwnPropertySymbolsAvailable) {\n keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent));\n }\n\n for (var i = 0; i < keys.length; ++i) {\n if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) {\n try {\n targetComponent[keys[i]] = sourceComponent[keys[i]];\n } catch (error) {}\n }\n }\n }\n\n return targetComponent;\n};\n\nvar invariant = function () {}\n\nvar hotReloadingVersion = 0;\nfunction connectAdvanced(\n/*\n selectorFactory is a func that is responsible for returning the selector function used to\n compute new props from state, props, and dispatch. For example:\n export default connectAdvanced((dispatch, options) => (state, props) => ({\n thing: state.things[props.thingId],\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\n }))(YourComponent)\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\n props. Do not use connectAdvanced directly without memoizing results between calls to your\n selector, otherwise the Connect component will re-render on every state or props change.\n*/\nselectorFactory) {\n var _contextTypes, _childContextTypes;\n\n var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n var _ref$getDisplayName = _ref.getDisplayName;\n var getDisplayName = _ref$getDisplayName === undefined ? function (name) {\n return 'ConnectAdvanced(' + name + ')';\n } : _ref$getDisplayName;\n var _ref$methodName = _ref.methodName;\n var methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName;\n var _ref$renderCountProp = _ref.renderCountProp;\n var renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp;\n var _ref$shouldHandleStat = _ref.shouldHandleStateChanges;\n var shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat;\n var _ref$storeKey = _ref.storeKey;\n var storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey;\n var _ref$withRef = _ref.withRef;\n var withRef = _ref$withRef === undefined ? false : _ref$withRef;\n var connectOptions = objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']);\n\n var subscriptionKey = storeKey + 'Subscription';\n var version = hotReloadingVersion++;\n\n var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = storeShape, _contextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _contextTypes);\n var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = PropTypes.instanceOf(Subscription), _childContextTypes);\n\n return function wrapWithConnect(WrappedComponent) {\n invariant(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + WrappedComponent));\n\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n withRef: withRef,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent\n });\n\n var Connect = function (_Component) {\n inherits(Connect, _Component);\n\n function Connect(props, context) {\n classCallCheck(this, Connect);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props, context));\n\n _this.version = version;\n _this.state = {};\n _this.renderCount = 0;\n _this.store = _this.props[storeKey] || _this.context[storeKey];\n _this.parentSub = props[subscriptionKey] || context[subscriptionKey];\n\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n\n invariant(_this.store, 'Could not find \"' + storeKey + '\" in either the context or ' + ('props of \"' + displayName + '\". ') + 'Either wrap the root component in a <Provider>, ' + ('or explicitly pass \"' + storeKey + '\" as a prop to \"' + displayName + '\".'));\n\n // make sure `getState` is properly bound in order to avoid breaking\n // custom store implementations that rely on the store's context\n _this.getState = _this.store.getState.bind(_this.store);\n\n _this.initSelector();\n _this.initSubscription();\n return _this;\n }\n\n Connect.prototype.getChildContext = function getChildContext() {\n var _ref2;\n\n return _ref2 = {}, _ref2[subscriptionKey] = this.subscription || this.parentSub, _ref2;\n };\n\n Connect.prototype.componentDidMount = function componentDidMount() {\n if (!shouldHandleStateChanges) return;\n\n // componentWillMount fires during server side rendering, but componentDidMount and\n // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.\n // Otherwise, unsubscription would never take place during SSR, causing a memory leak.\n // To handle the case where a child component may have triggered a state change by\n // dispatching an action in its componentWillMount, we have to re-run the select and maybe\n // re-render.\n this.subscription.trySubscribe();\n this.selector.run(this.props);\n if (this.selector.shouldComponentUpdate) this.forceUpdate();\n };\n\n Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n this.selector.run(nextProps);\n };\n\n Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() {\n return this.selector.shouldComponentUpdate;\n };\n\n Connect.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.subscription) this.subscription.tryUnsubscribe();\n // these are just to guard against extra memory leakage if a parent element doesn't\n // dereference this instance properly, such as an async callback that never finishes\n this.subscription = null;\n this.store = null;\n this.parentSub = null;\n this.selector.run = function () {};\n };\n\n Connect.prototype.getWrappedInstance = function getWrappedInstance() {\n invariant(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.'));\n return this.wrappedInstance;\n };\n\n Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) {\n this.wrappedInstance = ref;\n };\n\n Connect.prototype.initSelector = function initSelector() {\n var dispatch = this.store.dispatch;\n var getState = this.getState;\n\n var sourceSelector = selectorFactory(dispatch, selectorFactoryOptions);\n\n // wrap the selector in an object that tracks its results between runs\n var selector = this.selector = {\n shouldComponentUpdate: true,\n props: sourceSelector(getState(), this.props),\n run: function runComponentSelector(props) {\n try {\n var nextProps = sourceSelector(getState(), props);\n if (selector.error || nextProps !== selector.props) {\n selector.shouldComponentUpdate = true;\n selector.props = nextProps;\n selector.error = null;\n }\n } catch (error) {\n selector.shouldComponentUpdate = true;\n selector.error = error;\n }\n }\n };\n };\n\n Connect.prototype.initSubscription = function initSubscription() {\n var _this2 = this;\n\n if (shouldHandleStateChanges) {\n (function () {\n var subscription = _this2.subscription = new Subscription(_this2.store, _this2.parentSub);\n var dummyState = {};\n\n subscription.onStateChange = function onStateChange() {\n this.selector.run(this.props);\n\n if (!this.selector.shouldComponentUpdate) {\n subscription.notifyNestedSubs();\n } else {\n this.componentDidUpdate = function componentDidUpdate() {\n this.componentDidUpdate = undefined;\n subscription.notifyNestedSubs();\n };\n\n this.setState(dummyState);\n }\n }.bind(_this2);\n })();\n }\n };\n\n Connect.prototype.isSubscribed = function isSubscribed() {\n return Boolean(this.subscription) && this.subscription.isSubscribed();\n };\n\n Connect.prototype.addExtraProps = function addExtraProps(props) {\n if (!withRef && !renderCountProp) return props;\n // make a shallow copy so that fields added don't leak to the original selector.\n // this is especially important for 'ref' since that's a reference back to the component\n // instance. a singleton memoized selector would then be holding a reference to the\n // instance, preventing the instance from being garbage collected, and that would be bad\n var withExtras = _extends({}, props);\n if (withRef) withExtras.ref = this.setWrappedInstance;\n if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;\n return withExtras;\n };\n\n Connect.prototype.render = function render() {\n var selector = this.selector;\n selector.shouldComponentUpdate = false;\n\n if (selector.error) {\n throw selector.error;\n } else {\n return preact.h(WrappedComponent, this.addExtraProps(selector.props));\n }\n };\n\n return Connect;\n }(preact.Component);\n\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = displayName;\n Connect.childContextTypes = childContextTypes;\n Connect.contextTypes = contextTypes;\n\n\n {\n Connect.prototype.componentWillUpdate = function componentWillUpdate() {\n // We are hot reloading!\n if (this.version !== version) {\n this.version = version;\n this.initSelector();\n\n if (this.subscription) this.subscription.tryUnsubscribe();\n this.initSubscription();\n if (shouldHandleStateChanges) this.subscription.trySubscribe();\n }\n };\n }\n\n return index(Connect, WrappedComponent);\n };\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n\n var countA = 0;\n var countB = 0;\n\n for (var key in a) {\n if (hasOwn.call(a, key) && a[key] !== b[key]) return false;\n countA++;\n }\n\n for (var _key in b) {\n if (hasOwn.call(b, _key)) countB++;\n }\n\n return countA === countB;\n}\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetPrototype = Object.getPrototypeOf;\n\n/**\n * Gets the `[[Prototype]]` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {null|Object} Returns the `[[Prototype]]`.\n */\nfunction getPrototype(value) {\n return nativeGetPrototype(Object(value));\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 * 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 === 'undefined' ? 'undefined' : _typeof(value)) == 'object';\n}\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = Function.prototype.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/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\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,\n * 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) || 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' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;\n}\n\nfunction verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.');\n }\n}\n\nfunction wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n}\n\n// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n// \n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\nfunction getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\n\n// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n// \n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n// \n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n// \n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n// \nfunction wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n };\n\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n verifyPlainObject(props, displayName, methodName);\n\n return props;\n };\n\n return proxy;\n };\n}\n\nfunction whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\n\nfunction whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return { dispatch: dispatch };\n }) : undefined;\n}\n\nfunction whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && (typeof mapDispatchToProps === 'undefined' ? 'undefined' : _typeof(mapDispatchToProps)) === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return redux.bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\n\nvar defaultMapDispatchToPropsFactories = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];\n\nfunction whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\n\nfunction whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\n\nvar defaultMapStateToPropsFactories = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];\n\nfunction defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, stateProps, dispatchProps);\n}\n\nfunction wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName;\n var pure = _ref.pure;\n var areMergedPropsEqual = _ref.areMergedPropsEqual;\n\n var hasRunOnce = false;\n var mergedProps = void 0;\n\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n\n verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\n\nfunction whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\n\nfunction whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\n\nvar defaultMergePropsFactories = [whenMergePropsIsFunction, whenMergePropsIsOmitted];\n\nfunction verify(selector, methodName, displayName) {\n if (!selector) {\n throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.');\n } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {\n if (!selector.hasOwnProperty('dependsOnOwnProps')) {\n warning('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.');\n }\n }\n}\n\nfunction verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {\n verify(mapStateToProps, 'mapStateToProps', displayName);\n verify(mapDispatchToProps, 'mapDispatchToProps', displayName);\n verify(mergeProps, 'mergeProps', displayName);\n}\n\nfunction impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\n\nfunction pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual;\n var areOwnPropsEqual = _ref.areOwnPropsEqual;\n var areStatePropsEqual = _ref.areStatePropsEqual;\n\n var hasRunAtLeastOnce = false;\n var state = void 0;\n var ownProps = void 0;\n var stateProps = void 0;\n var dispatchProps = void 0;\n var mergedProps = void 0;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state);\n state = nextState;\n ownProps = nextOwnProps;\n\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n}\n\n// TODO: Add more comments\n\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nfunction finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps;\n var initMapDispatchToProps = _ref2.initMapDispatchToProps;\n var initMergeProps = _ref2.initMergeProps;\n var options = objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}\n\n/*\n connect is a facade over connectAdvanced. It turns its args into a compatible\n selectorFactory, which has the signature:\n\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\n \n connect passes its args to connectAdvanced as options, which will in turn pass them to\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\n\n selectorFactory returns a final props selector from its mapStateToProps,\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\n mergePropsFactories, and pure args.\n\n The resulting final props selector is called by the Connect component instance whenever\n it receives new props or store state.\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error('Invalid value of type ' + (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.');\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n}\n\n// createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\nfunction createConnect() {\n var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var _ref$connectHOC = _ref.connectHOC;\n var connectHOC = _ref$connectHOC === undefined ? connectAdvanced : _ref$connectHOC;\n var _ref$mapStateToPropsF = _ref.mapStateToPropsFactories;\n var mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF;\n var _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories;\n var mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro;\n var _ref$mergePropsFactor = _ref.mergePropsFactories;\n var mergePropsFactories = _ref$mergePropsFactor === undefined ? defaultMergePropsFactories : _ref$mergePropsFactor;\n var _ref$selectorFactory = _ref.selectorFactory;\n var selectorFactory = _ref$selectorFactory === undefined ? finalPropsSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {\n var _ref2 = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];\n\n var _ref2$pure = _ref2.pure;\n var pure = _ref2$pure === undefined ? true : _ref2$pure;\n var _ref2$areStatesEqual = _ref2.areStatesEqual;\n var areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual;\n var _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual;\n var areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? shallowEqual : _ref2$areOwnPropsEqua;\n var _ref2$areStatePropsEq = _ref2.areStatePropsEqual;\n var areStatePropsEqual = _ref2$areStatePropsEq === undefined ? shallowEqual : _ref2$areStatePropsEq;\n var _ref2$areMergedPropsE = _ref2.areMergedPropsEqual;\n var areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? shallowEqual : _ref2$areMergedPropsE;\n var extraOptions = objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return 'Connect(' + name + ')';\n },\n\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n\n }, extraOptions));\n };\n}\n\nvar connect$1 = createConnect();\n\n\n\nvar lib$1 = {\n\tProvider: Provider,\n\tconnect: connect$1,\n\tconnectAdvanced: connectAdvanced\n};\n\nreturn lib$1;\n\n})));\n//# sourceMappingURL=preact-redux.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/preact-redux/dist/preact-redux.js\n// module id = 1\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/preact-redux/dist/preact-redux.js","//@flow\nimport { Component } from 'preact';\nimport Player from 'playkit-js';\nimport LoggerFactory from '../utils/logger';\n\nclass BaseComponent extends Component {\n player: Player;\n name: string;\n config: Object;\n logger: any;\n\n constructor(obj?: IControlParams = { config: {} }) {\n super();\n\n this.name = obj.name;\n this.player = obj.player;\n this.config = obj.config;\n this.logger = LoggerFactory.getLogger(`UI ${this.name}`);\n this.logger.debug(`Initialized`);\n }\n\n getConfig(attr?: string): any {\n if (attr) {\n return this.config[attr];\n }\n return this.config;\n }\n\n get defaultConfig() {\n return {}\n }\n}\n\nexport default BaseComponent;\n\n\n\n// WEBPACK FOOTER //\n// ./components/base.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/base.js","//@flow\nimport { bindActionCreators } from 'redux';\n\nexport function bindActions(actions) {\n\treturn dispatch => ({\n\t\t...bindActionCreators(actions, dispatch)\n\t});\n}\n\n\n\n// WEBPACK FOOTER //\n// ./utils/bind-actions.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/bind-actions.js","import { h, Component } from 'preact';\n\nclass Icon extends Component {\n\n render(props) {\n switch (props.type) {\n case 'maximize':\n return (\n <svg className='icon icon-maximize' viewBox='0 0 1024 1024'>\n <path d='M800 269.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z' />\n <path d='M224 754.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z' />\n </svg>\n )\n case 'minimize':\n return (\n <svg className='icon icon-minimize' viewBox='0 0 1024 1024'>\n <path d='M672 306.745v-114.745c0-17.673-14.327-32-32-32s-32 14.327-32 32v192c0 17.673 14.327 32 32 32h192c17.673 0 32-14.327 32-32s-14.327-32-32-32h-114.745l137.373-137.373c12.497-12.497 12.497-32.758 0-45.255s-32.758-12.497-45.255 0l-137.373 137.373z' />\n <path d='M352 717.255v114.745c0 17.673 14.327 32 32 32s32-14.327 32-32v-192c0-17.673-14.327-32-32-32h-192c-17.673 0-32 14.327-32 32s14.327 32 32 32h114.745l-137.373 137.373c-12.497 12.497-12.497 32.758 0 45.255s32.758 12.497 45.255 0l137.373-137.373z' />\n </svg>\n )\n\n case 'play':\n return (\n <svg className='icon icon-play' viewBox='0 0 1024 1024'>\n <path d='M796.806 461.202c44.919 28.075 44.739 73.706 0 101.668l-459.472 287.171c-44.919 28.075-81.334 7.915-81.334-45.305v-585.4c0-53.096 36.595-73.266 81.334-45.305l459.472 287.171z' />\n </svg>\n )\n\n case 'pause':\n return (\n <svg className='icon icon-pause' viewBox='0 0 1024 1024'>\n <path d='M256 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314zM640 287.843c0-35.259 28.407-63.843 64-63.843 35.346 0 64 28.564 64 63.843v448.314c0 35.259-28.407 63.843-64 63.843-35.346 0-64-28.564-64-63.843v-448.314z' />\n </svg>\n )\n\n case 'volume-base':\n return (\n <svg className='icon volume-base' viewBox='0 0 1024 1024'>\n <path d='M224 352l234.504-156.336c29.545-19.697 53.496-7.194 53.496 28.053v576.566c0 35.19-24.059 47.677-53.496 28.053l-234.504-156.336h-127.906c-17.725 0-32.094-14.581-32.094-31.853v-256.295c0-17.592 14.012-31.853 32.094-31.853h127.906zM288 637.748l160 106.667v-464.83l-160 106.667v251.496zM128 416v192h96v-192h-96z' />\n </svg>\n )\n\n case 'volume-waves':\n return (\n <svg className='icon volume-waves' viewBox='0 0 1024 1024'>\n <path d='M802.017 837.177c82.359-86.627 129.183-201.774 129.183-324.26 0-123.976-47.976-240.409-132.127-327.329-12.293-12.697-32.552-13.025-45.249-0.732s-13.025 32.552-0.732 45.249c72.692 75.084 114.109 175.597 114.109 282.812 0 105.928-40.422 205.331-111.566 280.162-12.177 12.808-11.666 33.063 1.143 45.24s33.063 11.666 45.24-1.143z' />\n <path d='M667.436 743.221c67.761-60.884 107.273-147.888 107.273-241.233 0-87.318-34.552-169.203-94.836-229.446-12.501-12.493-32.762-12.486-45.255 0.015s-12.486 32.762 0.015 45.255c48.375 48.342 76.075 113.989 76.075 184.176 0 75.021-31.679 144.776-86.048 193.627-13.146 11.812-14.227 32.044-2.416 45.19s32.044 14.227 45.19 2.416z' />\n </svg>\n )\n\n case 'volume-mute':\n return (\n <svg className='icon volume-mute' viewBox='0 0 1024 1024'>\n <path d='M768 466.745l-67.986-67.986c-12.213-12.213-32.654-12.393-45.151 0.104-12.584 12.584-12.543 32.711-0.104 45.151l67.986 67.986-67.986 67.986c-12.213 12.213-12.393 32.654 0.104 45.151 12.584 12.584 32.711 12.543 45.151 0.104l67.986-67.986 67.986 67.986c12.213 12.213 32.654 12.393 45.151-0.104 12.584-12.584 12.543-32.711 0.104-45.151l-67.986-67.986 67.986-67.986c12.213-12.213 12.393-32.654-0.104-45.151-12.584-12.584-32.711-12.543-45.151-0.104l-67.986 67.986z' />\n </svg>\n )\n\n case 'close':\n return (\n <svg className='icon icon-close' viewBox='0 0 1024 1024'>\n <path d='M573.162 512l214.269-214.269c16.772-16.772 16.688-44.071-0.202-60.96-17.007-17.007-44.182-16.98-60.96-0.202l-214.269 214.269-214.269-214.269c-16.772-16.772-44.071-16.688-60.96 0.202-17.007 17.007-16.98 44.182-0.202 60.96l214.269 214.269-214.269 214.269c-16.772 16.772-16.688 44.071 0.202 60.96 17.007 17.007 44.182 16.98 60.96 0.202l214.269-214.269 214.269 214.269c16.772 16.772 44.071 16.688 60.96-0.202 17.007-17.007 16.98-44.182 0.202-60.96l-214.269-214.269z' />\n </svg>\n )\n\n case 'share':\n return (\n <svg className='icon icon-share' viewBox='0 0 1024 1024'>\n <path d='M318.641 446.219l236.155-142.257c-0.086-1.754-0.129-3.52-0.129-5.295 0-58.91 47.756-106.667 106.667-106.667s106.667 47.756 106.667 106.667c0 58.91-47.756 106.667-106.667 106.667-33.894 0-64.095-15.808-83.633-40.454l-236.467 142.445c-0.132-3.064-0.394-6.095-0.779-9.087l7.271-12.835-0.117 53.333-7.183-12.743c0.399-3.046 0.67-6.131 0.806-9.252l236.467 142.383c19.538-24.648 49.741-40.457 83.636-40.457 58.91 0 106.667 47.756 106.667 106.667s-47.756 106.667-106.667 106.667c-58.91 0-106.667-47.756-106.667-106.667 0-1.775 0.043-3.539 0.129-5.293l-236.19-142.216c-19.528 24.867-49.868 40.841-83.939 40.841-58.91 0-106.667-47.756-106.667-106.667s47.756-106.667 106.667-106.667c34.091 0 64.447 15.993 83.974 40.886zM234.667 554.667c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 341.333c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667zM661.333 768c23.564 0 42.667-19.103 42.667-42.667s-19.103-42.667-42.667-42.667c-23.564 0-42.667 19.103-42.667 42.667s19.103 42.667 42.667 42.667z' />\n </svg>\n )\n\n case 'settings':\n return (\n <svg className='icon icon-share' viewBox='0 0 1024 1024'>\n <path d='M829.945 549.126c2.784-24.116 2.784-48.445 0.269-70.702-1.182-6.772-7.090-11.696-13.674-11.641-33.039 0.582-62.975-19.389-75.126-50.118s-3.971-65.772 20.504-87.92c4.293-3.894 4.818-10.455 1.003-15.228-14.831-18.927-31.796-36.079-50.521-51.087-4.614-3.687-11.301-3.148-16.127 2.145-15.732 16.059-37.322 25.023-59.382 24.831-9.828 0.044-19.574-1.802-29.307-5.686-30.997-13.082-50.429-44.232-48.535-78.046 0.365-5.803-3.87-10.878-9.583-11.551-23.919-2.769-48.074-2.831-71.958-0.192-5.836 0.654-10.191 5.68-10.009 11.47 1.121 33.146-18.329 63.547-49.925 76.834-8.987 3.423-18.538 5.129-27.498 5.028-22.472 0.224-44.067-8.707-60.526-25.487-2.197-2.386-5.29-3.748-8.24-3.758-2.663 0.016-5.248 0.905-7.105 2.334-19.136 15.052-36.496 32.233-51.558 50.977-3.729 4.732-3.187 11.536 1.058 15.449 24.89 22.573 32.935 58.34 19.426 90.928-14.22 29.886-44.875 48.43-77.941 47.151-5.576-0.215-10.363 3.934-11.003 10.013-2.916 24.025-2.916 48.315-0.231 70.764 1.178 6.84 7.155 11.808 14.518 11.713l2.428 0.007c31.565 0.659 59.701 20.063 71.6 49.499 12.239 30.769 4.278 65.898-20.252 88.586-4.217 3.829-4.736 10.275-0.976 14.991 14.777 18.932 31.665 36.115 50.227 51.128 4.694 3.762 11.505 3.223 16.349-2.081 15.725-16.101 37.337-25.092 59.378-24.895 9.894-0.057 19.705 1.819 29.5 5.78 30.753 13.169 50.063 44.084 48.378 77.965-0.373 5.795 3.857 10.867 9.602 11.539 23.908 2.78 48.053 2.842 71.923 0.192 5.851-0.659 10.215-5.702 10.027-11.562-1.088-33.118 18.371-63.473 49.584-76.583 9.014-3.552 18.622-5.354 27.841-5.307 22.555-0.225 44.218 8.804 60.434 25.505 2.224 2.395 5.343 3.76 8.371 3.769 2.474-0.012 4.874-0.847 6.896-2.43 19.227-14.971 36.653-32.121 51.726-50.848 3.737-4.743 3.194-11.563-0.941-15.379-24.391-21.907-32.789-56.564-21.134-87.207s40.964-50.957 73.904-51.116h5.704c5.586-0.028 10.269-4.227 10.905-9.777zM893.526 556.438c-4.321 37.715-36.171 66.271-74.323 66.464h-5.711c-6.33 0.031-11.99 3.953-14.24 9.87s-0.629 12.609 4.385 17.116c29.020 26.748 32.567 71.325 7.936 102.582-18.378 22.837-39.342 43.468-62.397 61.42-13.128 10.284-29.303 15.909-46.22 15.991-21.004-0.056-41.043-8.825-54.839-23.692-3.514-3.616-8.356-5.634-13.867-5.583-1.555-0.007-3.097 0.282-3.877 0.581-6.088 2.559-9.967 8.609-9.749 15.235 1.257 39.227-27.828 72.841-66.88 77.241-28.725 3.189-57.719 3.114-86.45-0.227-39.585-4.631-68.615-39.444-66.083-78.749 0.331-6.679-3.529-12.859-9.057-15.234-1.449-0.585-2.998-0.881-5.025-0.873-5.074-0.045-9.947 1.982-12.693 4.763-26.775 29.494-71.875 33.067-103.071 8.066-22.458-18.164-42.771-38.831-60.335-61.337-24.602-30.847-21.012-75.5 7.982-101.818 4.881-4.515 6.479-11.568 4.088-17.58-2.239-5.538-7.562-9.209-12.866-9.327-39.748 0.506-72.828-26.991-79.581-66.425-3.538-29.147-3.538-58.616-0.060-87.234 4.085-39.084 37.791-68.296 77.064-66.784 7.502 0.29 14.456-3.916 17.001-9.164 2.519-6.098 0.94-13.122-4.133-17.724-29.022-26.738-32.57-71.311-7.956-102.538 18.292-22.765 39.115-43.375 62.322-61.626 13.199-10.169 29.368-15.731 46.323-15.833 21.063 0.065 41.146 8.908 54.704 23.656 3.559 3.623 8.44 5.642 14.175 5.592 1.605 0.017 3.199-0.268 3.668-0.426 6.11-2.574 9.998-8.651 9.771-15.356-1.228-39.209 27.864-72.786 66.897-77.161 28.715-3.173 57.697-3.098 86.456 0.231 39.539 4.653 68.54 39.409 66.051 78.92-0.369 6.596 3.446 12.713 8.931 15.035 1.507 0.6 3.114 0.905 5.156 0.898 5.087 0.044 9.973-1.985 12.671-4.704 26.66-29.444 71.625-33.068 102.694-8.244 22.604 18.117 43.043 38.781 60.715 61.337 24.728 30.927 21.142 75.751-8.215 102.378-4.724 4.275-6.301 11.031-3.958 16.955s8.114 9.775 14.774 9.659c38.18-0.325 70.992 27.018 77.822 66.463 3.343 28.966 3.343 58.22 0 87.185zM511.951 597.037c47.144-0.118 85.24-38.367 85.169-85.511 0-34.617-20.872-65.819-52.867-79.034s-68.802-5.836-93.231 18.69c-24.429 24.527-31.66 61.363-18.317 93.305s44.628 52.688 79.245 52.55zM512.158 661.036c-60.477 0.242-115.178-36.032-138.507-91.881s-10.686-120.254 32.026-163.138c42.712-42.884 107.066-55.785 163.008-32.679s92.434 77.661 92.434 138.139c0.124 82.417-66.545 149.353-148.962 149.559z' />\n </svg>\n )\n\n case 'check':\n return (\n <svg className='icon check-icon' viewBox='0 0 1024 1024'>\n <path d='M342.481 563.894c-12.577-12.416-32.838-12.285-45.254 0.292s-12.285 32.838 0.292 45.254l118.857 117.333c13.275 13.105 34.901 12.123 46.933-2.131l297.143-352c11.4-13.505 9.694-33.694-3.811-45.094s-33.694-9.694-45.094 3.811l-274.828 325.566-94.238-93.030z' />\n </svg>\n )\n case 'language':\n return (\n <svg className='icon language-icon' viewBox='0 0 1024 1024'>\n <path d='M625.773 808.031c29.752-39.944 63.443-97.069 83.311-168.977 41.798-3.715 74.872-8.022 98.271-11.57-32.456 82.71-98.638 148.558-181.582 180.547zM216.562 627.283c23.516 3.506 56.799 7.797 98.279 11.528 19.868 72.017 53.601 129.224 83.378 169.219-83.002-32.014-149.226-97.945-181.657-180.747zM400.147 215.201c-29.835 40.32-64.161 98.037-84.572 169.695-42.123 3.731-75.423 8.072-98.938 11.629 32.698-83.353 99.656-149.61 183.51-181.323zM807.438 396.725c-23.641-3.523-57.158-7.847-98.947-11.587-20.402-71.766-54.778-129.567-84.639-169.937 83.912 31.73 150.912 98.070 183.585 181.523zM720.095 436.644c48.952 4.817 84.472 10.209 102.995 13.331 3.99 20.068 6.127 40.796 6.127 62.024 0 21.262-2.137 42.031-6.152 62.141-18.248 3.172-53.376 8.615-102.753 13.448 3.84-23.908 6.069-49.102 6.069-75.59 0-26.296-2.304-51.431-6.286-75.356zM537.043 597.206v-170.396c48.576 0.551 92.653 2.646 131.178 5.426 5.050 25.119 8.072 51.74 8.072 79.763 0 28.216-2.913 54.87-7.789 79.939-38.283 2.713-82.343 4.742-131.462 5.267zM486.957 195.859v180.856c-43.175 0.442-82.443 1.995-117.429 4.149 31.939-95.382 89.99-161.656 112.237-184.612 1.72-0.159 3.464-0.259 5.192-0.392zM542.286 196.26c22.297 22.906 80.456 89.080 112.345 184.771-35.261-2.229-74.646-3.848-117.587-4.307v-180.864c1.745 0.142 3.506 0.234 5.242 0.401zM347.706 512c0-28.074 3.047-54.762 8.156-79.955 38.191-2.696 82.134-4.708 131.094-5.234v170.387c-48.71-0.551-92.895-2.655-131.495-5.443-4.858-25.018-7.755-51.606-7.755-79.755zM194.783 512c0-21.262 2.137-42.031 6.144-62.125 18.282-3.181 53.501-8.64 103.012-13.482-4.007 24-6.319 49.219-6.319 75.606 0 26.396 2.221 51.506 6.027 75.339-48.826-4.808-84.246-10.184-102.737-13.306-3.99-20.068-6.127-40.804-6.127-62.033zM481.338 827.706c-22.389-22.314-81.016-87.469-112.662-184.779 35.437 2.262 75.047 3.898 118.28 4.366v180.839c-1.87-0.142-3.757-0.25-5.618-0.426zM542.653 827.706c-1.862 0.175-3.74 0.284-5.61 0.426v-180.839c43.509-0.442 83.044-2.012 118.222-4.199-31.672 97.244-90.265 162.349-112.612 184.612zM512 128c-211.734 0-384 172.257-384 384 0 211.734 172.266 384 384 384s384-172.266 384-384c0-211.743-172.266-384-384-384z' />\n </svg>\n )\n\n default:\n break;\n }\n }\n}\n\nexport default Icon;\n\n\n\n// WEBPACK FOOTER //\n// ./components/icon/icon.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/icon/icon.js","function n(n){return n&&\"object\"==typeof n&&\"default\"in n?n.default:n}function t(n){return null!==n&&void 0!==n}function r(n,t){var o=e({},n);for(var i in t)t.hasOwnProperty(i)&&(o[i]=n[i]&&t[i]&&\"object\"==typeof n[i]&&\"object\"==typeof t[i]?r(n[i],t[i]):n[i]||t[i]);return o}function e(n,t){for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function o(n){if(n=n||{},\"string\"==typeof n&&(n=n.split(\",\")),\"join\"in n){for(var t={},r=0;r<n.length;r++){var e=n[r].trim();e&&(t[e.split(\".\").pop()]=e)}return t}return n}function i(n,t){return v=t||h,n&&n.replace(/\\{\\{([\\w.-]+)\\}\\}/g,u)}function u(n,t){for(var r=t.split(\".\"),e=v,o=0;o<r.length;o++)if(null==(e=e[r[o]]))return\"\";return\"string\"==typeof e&&e.match(/\\{\\{/)&&(e=i(e,v)),e}function c(n,r,e,o,u,c){r&&(n=r+\".\"+n);var a=e&&f(e,n);return(u||0===u)&&a&&\"object\"==typeof a&&(a=a.splice?a[u]||a[0]:0===u&&t(a.none)?a.none:1===u&&t(a.one||a.singular)?a.one||a.singular:a.some||a.many||a.plural||a.other||a),a&&i(a,o)||c||null}function a(n,t,r){var i={};t=t||{},n=o(n);for(var u in n)if(n.hasOwnProperty(u)&&n[u]){var a=n[u];r||\"string\"!=typeof a?a.nodeName===g&&(a=e({fallback:a.children&&a.children[0]},a.attributes),i[u]=c(a.id,t.scope,t.dictionary,a.fields,a.plural,a.fallback)):i[u]=c(a,t.scope,t.dictionary)}return i}var l=require(\"preact\"),f=n(require(\"dlv\")),p=/[?&#]intl=show/,s=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getChildContext=function(){var n=this.props,t=n.scope,o=n.definition,i=n.mark,u=e({},this.context.intl||{});return t&&(u.scope=t),o&&(u.dictionary=r(u.dictionary||{},o)),(i||\"undefined\"!=typeof location&&String(location).match(p))&&(u.mark=!0),{intl:u}},t.prototype.render=function(n){var t=n.children;return t&&t[0]||null},t}(l.Component),d=function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];if(n.length>1){return y(n[0],n[1])}var r=n[0];return function(n){return y(n,r)}},y=function(n,t){return function(r){return l.h(s,t||{},l.h(n,r))}},h={},v,g=function(n,t){var r=n.id,e=n.children,o=n.plural,i=n.fields,u=t.intl,a=e&&e[0],p=c(r,u&&u.scope,u&&u.dictionary,i,o,a);if(u&&u.mark){var s=\"dictionary\"+(u&&u.scope?\".\"+u.scope:\"\")+\".\"+r;return l.h(\"mark\",{style:\"background: \"+(p?f(u,s)?\"rgba(119,231,117,.5)\":\"rgba(229,226,41,.5)\":\"rgba(228,147,51,.5)\"),title:r},p)}return p},b=function(n,t){var r=n.children,e=t.intl,o=r&&r[0];return o&&l.cloneElement(o,a(o.attributes,e,!0))},m=function(n){return function(t){return function(r,e){var o=\"function\"==typeof n?n(r):n,i=a(o,e.intl);return l.h(t,assign({},r,i))}}};d.intl=d,d.IntlProvider=s,d.Text=g,d.Localizer=b,d.withText=m,module.exports=d;\n//# sourceMappingURL=preact-i18n.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/preact-i18n/dist/preact-i18n.js\n// module id = 5\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/preact-i18n/dist/preact-i18n.js","import createStore from './createStore';\nimport combineReducers from './combineReducers';\nimport bindActionCreators from './bindActionCreators';\nimport applyMiddleware from './applyMiddleware';\nimport compose from './compose';\nimport warning from './utils/warning';\n\n/*\n* This is a dummy function to check if the function name has been altered by minification.\n* If the function has been minified and NODE_ENV !== 'production', warn the user.\n*/\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \\'production\\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { createStore, combineReducers, bindActionCreators, applyMiddleware, compose };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/index.js\n// module id = 6\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/index.js","/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nexport default function warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n /* eslint-disable no-empty */\n } catch (e) {}\n /* eslint-enable no-empty */\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/utils/warning.js\n// module id = 7\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/utils/warning.js","//@flow\n\nexport const types = {\n ADD_PLAYER_CLASS: 'shell/ADD_PLAYER_CLASS',\n REMOVE_PLAYER_CLASS: 'shell/REMOVE_PLAYER_CLASS',\n UPDATE_IS_MOBILE: 'shell/UPDATE_IS_MOBILE'\n}\n\nexport const initialState = {\n playerClasses: []\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.ADD_PLAYER_CLASS:\n return {\n ...state,\n playerClasses: [...state.playerClasses, action.className]\n }\n\n case types.REMOVE_PLAYER_CLASS:\n return {\n ...state,\n playerClasses: state.playerClasses.filter(c => c !== action.className)\n }\n\n case types.UPDATE_IS_MOBILE:\n return {\n ...state,\n isMobile: action.isMobile\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n addPlayerClass: (className: string) => ({ type: types.ADD_PLAYER_CLASS, className }),\n removePlayerClass: (className: string) => ({ type: types.REMOVE_PLAYER_CLASS, className }),\n updateIsMobile: (isMobile: boolean) => ({ type: types.UPDATE_IS_MOBILE, isMobile })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/shell.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/shell.js","//@flow\n\nexport const types = {\n TOGGLE_PLAY: 'play-pause/TOGGLE_PLAY'\n}\n\nexport const initialState = {\n isPlaying: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.TOGGLE_PLAY:\n return {\n ...state,\n isPlaying: action.isPlaying\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n toggleIsPlaying: (isPlaying: boolean) => ({ type: types.TOGGLE_PLAY, isPlaying })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/play-pause.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/play-pause.js","//@flow\n\nexport const types = {\n TOGGLE_SHARE_OVERLAY: 'share/TOGGLE_SHARE_OVERLAY'\n}\n\nexport const initialState = {\n overlayOpen: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.TOGGLE_SHARE_OVERLAY:\n return {\n ...state,\n overlayOpen: action.show\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n toggleShareOverlay: (show: boolean) => ({ type: types.TOGGLE_SHARE_OVERLAY, show })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/share.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/share.js","//@flow\n\nexport const types = {\n TOGGLE_CVAA_OVERLAY: 'share/TOGGLE_CVAA_OVERLAY'\n}\n\nexport const initialState = {\n overlayOpen: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.TOGGLE_CVAA_OVERLAY:\n return {\n ...state,\n overlayOpen: action.show\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n toggleCVAAOverlay: (show: boolean) => ({ type: types.TOGGLE_CVAA_OVERLAY, show })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/cvaa.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/cvaa.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;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\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// ../node_modules/process/browser.js\n// module id = 12\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/process/browser.js","import isPlainObject from 'lodash-es/isPlainObject';\nimport $$observable from 'symbol-observable';\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nexport var ActionTypes = {\n INIT: '@@redux/INIT'\n\n /**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n};export default function createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n function getState() {\n return currentState;\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected listener to be a function.');\n }\n\n var isSubscribed = true;\n\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n isSubscribed = false;\n\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer;\n dispatch({ type: ActionTypes.INIT });\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object') {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return { unsubscribe: unsubscribe };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch({ type: ActionTypes.INIT });\n\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/createStore.js\n// module id = 13\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/createStore.js","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\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 * 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) || baseGetTag(value) != objectTag) {\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' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/isPlainObject.js\n// module id = 14\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/isPlainObject.js","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_Symbol.js\n// module id = 15\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_Symbol.js","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/webpack/buildin/global.js\n// module id = 16\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/webpack/buildin/global.js","/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nexport default function compose() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(undefined, arguments));\n };\n });\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/compose.js\n// module id = 17\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/compose.js","//@flow\nexport const types = {\n UPDATE_PLAYER_STATE: 'engine/UPDATE_PLAYER_STATE',\n UPDATE_IS_PLAYING: 'engine/UPDATE_IS_PLAYING',\n UPDATE_CURRENT_TIME: 'engine/UPDATE_CURRENT_TIME',\n UPDATE_DURATION: 'engine/UPDATE_DURATION',\n UPDATE_VOLUME: 'engine/UPDATE_VOLUME',\n UPDATE_MUTED: 'engine/UPDATE_MUTED',\n UPDATE_METADATA_LOADING_STATUS: 'engine/UPDATE_METADATA_LOADING_STATUS',\n UPDATE_AUDIO_TRACKS: 'engine/UPDATE_AUDIO_TRACKS',\n UPDATE_VIDEO_TRACKS: 'engine/UPDATE_VIDEO_TRACKS',\n UPDATE_TEXT_TRACKS: 'engine/UPDATE_TEXT_TRACKS'\n}\n\nexport const initialState = {\n\tisPlaying: false,\n metadataLoaded: false,\n playerState: {\n previousState: '',\n currentState: ''\n },\n currentTime: 0,\n duration: 0,\n volume: 1,\n muted: false,\n videoTracks: [],\n audioTracks: [],\n textTracks: []\n}\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_PLAYER_STATE:\n return {\n ...state,\n playerState: action.playerState\n }\n\n case types.UPDATE_IS_PLAYING:\n return {\n ...state,\n isPlaying: action.isPlaying\n }\n\n case types.UPDATE_CURRENT_TIME:\n return {\n ...state,\n currentTime: action.currentTime\n }\n\n case types.UPDATE_DURATION:\n return {\n ...state,\n duration: action.duration\n }\n\n case types.UPDATE_VOLUME:\n return {\n ...state,\n volume: action.volume\n }\n\n case types.UPDATE_MUTED:\n return {\n ...state,\n muted: action.muted\n }\n\n case types.UPDATE_METADATA_LOADING_STATUS:\n return {\n ...state,\n metadataLoaded: action.metadataLoaded\n }\n\n case types.UPDATE_AUDIO_TRACKS:\n return {\n ...state,\n audioTracks: action.tracks\n }\n\n case types.UPDATE_VIDEO_TRACKS:\n return {\n ...state,\n videoTracks: action.tracks\n }\n\n case types.UPDATE_TEXT_TRACKS:\n return {\n ...state,\n textTracks: action.tracks\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updatePlayerState: (prevoiusState: string, currentState: string) => ({ type: types.UPDATE_PLAYER_STATE, playerState: {prevoiusState, currentState} }),\n updateIsPlaying: (isPlaying: boolean) => ({ type: types.UPDATE_IS_PLAYING, isPlaying }),\n updateCurrentTime: (currentTime: number) => ({ type: types.UPDATE_CURRENT_TIME, currentTime }),\n updateDuration: (duration: number) => ({ type: types.UPDATE_DURATION, duration }),\n updateVolume: (volume: number) => ({ type: types.UPDATE_VOLUME, volume }),\n updateMuted: (muted: boolean) => ({ type: types.UPDATE_MUTED, muted }),\n updateMetadataLoadingStatus: (metadataLoaded: boolean) => ({ type: types.UPDATE_METADATA_LOADING_STATUS, metadataLoaded }),\n updateAudioTracks: (tracks) => ({ type: types.UPDATE_AUDIO_TRACKS, tracks }),\n updateVideoTracks: (tracks) => ({ type: types.UPDATE_VIDEO_TRACKS, tracks }),\n updateTextTracks: (tracks) => ({ type: types.UPDATE_TEXT_TRACKS, tracks })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/engine.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/engine.js","//@flow\n\nexport const types = {\n UPDATE_SEEKBAR_DRAGGING_STATUS: 'seekbar/UPDATE_SEEKBAR_DRAGGING_STATUS',\n UPDATE_CURRENT_TIME: 'seekbar/UPDATE_CURRENT_TIME',\n UPDATE_DURATION: 'seekbar/UPDATE_DURATION'\n}\n\nexport const initialState = {\n\tcurrentTime: 0,\n duration: 0,\n draggingActive: false\n}\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_SEEKBAR_DRAGGING_STATUS:\n return {\n ...state,\n draggingActive: action.draggingActive\n }\n\n case types.UPDATE_CURRENT_TIME:\n return {\n ...state,\n currentTime: action.currentTime\n }\n\n case types.UPDATE_DURATION:\n return {\n ...state,\n duration: action.duration\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateSeekbarDraggingStatus: (draggingActive: boolean) => ({ type: types.UPDATE_SEEKBAR_DRAGGING_STATUS, draggingActive }),\n updateDuration: (duration: number) => ({ type: types.UPDATE_DURATION, duration }),\n updateCurrentTime: (currentTime: number) => ({ type: types.UPDATE_CURRENT_TIME, currentTime })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/seekbar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/seekbar.js","//@flow\n\nexport const types = {\n UPDATE_VOLUME: 'volume/UPDATE_VOLUME',\n UPDATE_VOLUME_DRAGGING_STATUS: 'volume/UPDATE_VOLUME_DRAGGING_STATUS',\n UPDATE_MUTED: 'volume/UPDATE_MUTED'\n}\n\nexport const initialState = {\n draggingActive: false,\n volume: 1,\n muted: false\n}\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_VOLUME:\n return {\n ...state,\n volume: action.volume\n }\n\n case types.UPDATE_VOLUME_DRAGGING_STATUS:\n return {\n ...state,\n draggingActive: action.draggingActive\n }\n\n case types.UPDATE_MUTED:\n return {\n ...state,\n muted: action.muted\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateVolume: (volume: number) => ({ type: types.UPDATE_VOLUME, volume }),\n updateVolumeDraggingStatus: (draggingActive: boolean) => ({ type: types.UPDATE_VOLUME_DRAGGING_STATUS, draggingActive }),\n updateMuted: (muted: boolean) => ({ type: types.UPDATE_MUTED, muted })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/volume.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/volume.js","//@flow\nexport const types = {\n UPDATE_FULLSCREEN: 'fullscreen/UPDATE_FULLSCREEN'\n}\n\nexport const initialState = {\n fullscreen: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_FULLSCREEN:\n return {\n ...state,\n fullscreen: action.fullscreen\n }\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateFullscreen: (fullscreen: boolean) => ({ type: types.UPDATE_FULLSCREEN, fullscreen })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/fullscreen.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/fullscreen.js","//@flow\n\nexport const types = {\n UPDATE_LOADING_SPINNER_STATE: 'loading/UPDATE_LOADING_SPINNER_STATE'\n}\n\nexport const initialState = {\n showLoadingSpinner: false\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_LOADING_SPINNER_STATE:\n return {\n ...state,\n show: action.show\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateLoadingSpinnerState: (show: boolean) => ({ type: types.UPDATE_LOADING_SPINNER_STATE, show })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/loading.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/loading.js","//@flow\n\nexport const types = {\n UPDATE_QUALITY: 'settings/UPDATE_QUALITY',\n UPDATE_SPEED: 'settings/UPDATE_SPEED'\n}\n\nexport const initialState = {\n quality: 1,\n speed: 2\n};\n\nexport default (state = initialState, action) => {\n switch (action.type) {\n case types.UPDATE_QUALITY:\n return {\n ...state,\n quality: action.quality\n }\n\n case types.UPDATE_SPEED:\n return {\n ...state,\n speed: action.speed\n }\n\n default:\n return state;\n }\n}\n\nexport const actions = {\n updateQuality: (quality: string) => ({ type: types.UPDATE_QUALITY, quality }),\n updateSpeed: (speed: string) => ({ type: types.UPDATE_SPEED, speed })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./reducers/settings.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/reducers/settings.js","//@flow\n\nfunction toHHMMSS(input) {\n var sec_num = parseInt(input, 10);\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n var seconds = sec_num - (hours * 3600) - (minutes * 60);\n\n if (hours < 10) {hours = \"0\"+hours;}\n if (minutes < 10) {minutes = \"0\"+minutes;}\n if (seconds < 10) {seconds = \"0\"+seconds;}\n\n return `${minutes}:${seconds}`;\n}\n\nexport {toHHMMSS};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/time-format.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/time-format.js","//@flow\nimport { h, Component } from 'preact';\n\nclass SmartContainer extends Component {\n render(props) {\n return (\n <div className='smart-container top left'>\n {props.children}\n </div>\n )\n }\n}\n\nexport default SmartContainer;\n\n\n\n// WEBPACK FOOTER //\n// ./components/smart-container/smart-container.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/smart-container/smart-container.js","//@flow\nimport { h, Component } from 'preact';\nimport DropDownMenu from '../dropdown-menu/dropdown-menu';\n\nclass SmartContainer extends Component {\n render(props) {\n return (\n <div className='smart-container-item select-menu-item'>\n <label htmlFor='quality'>{props.label}</label>\n <DropDownMenu onSelect={o => props.onSelect(o)} options={props.options} />\n </div>\n )\n }\n}\n\nexport default SmartContainer;\n\n\n\n// WEBPACK FOOTER //\n// ./components/smart-container/smart-container-item.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/smart-container/smart-container-item.js","//@flow\nimport { h, Component } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/shell';\nimport Icon from '../icon/icon';\n\n@connect(null, bindActions(actions))\nclass Overlay extends Component {\n\n componentWillUnmount() {\n this.props.removePlayerClass('overlay-active');\n }\n\n componentWillMount() {\n this.props.addPlayerClass('overlay-active');\n }\n\n render(props) {\n var overlayClass = 'overlay';\n if (props.type) overlayClass += ` ${props.type}-overlay`;\n if (props.open) overlayClass += ' active'\n\n return (\n <div className={overlayClass} role='dialog'>\n <Localizer>\n <a onClick={() => props.onClose()} aria-label={<Text id='core.close' />} className='close-overlay'><Icon type='close' /></a>\n </Localizer>\n { props.children }\n </div>\n )\n }\n}\n\nexport default Overlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/overlay/overlay.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/overlay/overlay.js","//@flow\nimport {h, render} from 'preact';\nimport {Provider} from 'preact-redux';\nimport {IntlProvider} from 'preact-i18n';\nimport { createStore } from 'redux';\n\nimport reducer from './store';\nimport definition from './fr.json';\n\nimport EngineConnector from './components/engine-connector/engine-connector';\nimport Shell from './components/shell/shell';\nimport OverlayPlay from './components/overlay-play/overlay-play';\nimport Loading from './components/loading/loading';\nimport PlayPauseControl from './components/play-pause/play-pause';\nimport SeekBarControl from './components/seekbar/seekbar';\nimport VolumeControl from './components/volume/volume';\nimport ShareControl from './components/share/share'\nimport SettingsControl from './components/settings/settings';\nimport LanguageControl from './components/language/language';\nimport FullscreenControl from './components/fullscreen/fullscreen';\nimport TimeDisplay from './components/time-display/time-display';\nimport TopBar from './components/top-bar/top-bar';\nimport BottomBar from './components/bottom-bar/bottom-bar';\nimport ShareOverlay from './components/share-overlay/share-overlay';\nimport CVAAOverlay from './components/cvaa-overlay/cvaa-overlay';\nimport KeyboardControl from './components/keyboard';\n\nclass UIManager {\n player: any;\n config: any;\n\n constructor(player, config) {\n this.player = player;\n this.config = config;\n this.config.ui = {\n \"translations\": {\n \"controls\": {\n \"language\": \"שפה\"\n }\n },\n \"components\": {\n \"Loading\": {\n \"enabled\": true\n },\n \"OverlayPlay\": {\n \"enabled\": true\n }\n }\n }\n }\n\n buildCustomUI(template): void {\n this._buildUI(template);\n }\n\n buildDefaultUI(): void {\n const store = createStore(reducer, window.devToolsExtension && window.devToolsExtension({ name: `playkit #${this.config.target}`, instanceId: this.config.target }));\n\n let template = (\n <Provider store={store}>\n <IntlProvider definition={definition}>\n <Shell>\n <div className='player-holder' />\n <EngineConnector player={this.player} />\n <KeyboardControl player={this.player} />\n <Loading player={this.player} />\n <div className='player-gui'>\n <OverlayPlay player={this.player} />\n <TopBar>\n <div className='left-controls'>\n <div className='video-playing-title'>L21 Earth Time Lapse View from Space, ISS</div>\n </div>\n <div className='right-controls'>\n <ShareControl player={this.player} />\n </div>\n </TopBar>\n <BottomBar>\n <SeekBarControl showFramePreview showTimeBubble player={this.player} />\n <div className='left-controls'>\n <PlayPauseControl player={this.player} />\n <TimeDisplay format='current / total' player={this.player} />\n </div>\n <div className='right-controls'>\n <VolumeControl player={this.player} />\n <LanguageControl player={this.player} />\n <SettingsControl player={this.player} />\n <FullscreenControl player={this.player} />\n </div>\n </BottomBar>\n <ShareOverlay />\n <CVAAOverlay />\n </div>\n </Shell>\n </IntlProvider>\n </Provider>\n );\n this._buildUI(template);\n }\n\n _buildUI(template) {\n if (!this.player) return;\n\n let playerWrapper = document.createElement('div');\n document.body.appendChild(playerWrapper);\n render(template, playerWrapper);\n\n let playerElement = document.getElementsByTagName('video')[this.config.target === 'player1' ? 0 : 1];\n // let playerElement = document.getElementById(this.config.target); // the right way\n playerElement.removeAttribute('style');\n playerWrapper.getElementsByClassName('player-holder')[0].appendChild(playerElement);\n }\n\n release(): void { }\n\n}\n\nexport default UIManager;\n\n\n\n\n// WEBPACK FOOTER //\n// ./ui-manager.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/ui-manager.js","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_baseGetTag.js\n// module id = 29\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_baseGetTag.js","import freeGlobal from './_freeGlobal.js';\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\nexport default root;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_root.js\n// module id = 30\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_root.js","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_freeGlobal.js\n// module id = 31\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_freeGlobal.js","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\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 nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_getRawTag.js\n// module id = 32\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_getRawTag.js","/** 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 nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_objectToString.js\n// module id = 33\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_objectToString.js","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_getPrototype.js\n// module id = 34\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_getPrototype.js","/**\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\nexport default overArg;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/_overArg.js\n// module id = 35\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/_overArg.js","/**\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 != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/lodash-es/isObjectLike.js\n// module id = 36\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/lodash-es/isObjectLike.js","module.exports = require('./lib/index');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/symbol-observable/index.js\n// module id = 37\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/symbol-observable/index.js","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _ponyfill = require('./ponyfill');\n\nvar _ponyfill2 = _interopRequireDefault(_ponyfill);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar root; /* global window */\n\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = (0, _ponyfill2['default'])(root);\nexports['default'] = result;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/symbol-observable/lib/index.js\n// module id = 38\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/symbol-observable/lib/index.js","module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tif(!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, \"loaded\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, \"id\", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/webpack/buildin/module.js\n// module id = 39\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/webpack/buildin/module.js","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\nexports['default'] = symbolObservablePonyfill;\nfunction symbolObservablePonyfill(root) {\n\tvar result;\n\tvar _Symbol = root.Symbol;\n\n\tif (typeof _Symbol === 'function') {\n\t\tif (_Symbol.observable) {\n\t\t\tresult = _Symbol.observable;\n\t\t} else {\n\t\t\tresult = _Symbol('observable');\n\t\t\t_Symbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/symbol-observable/lib/ponyfill.js\n// module id = 40\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/symbol-observable/lib/ponyfill.js","import { ActionTypes } from './createStore';\nimport isPlainObject from 'lodash-es/isPlainObject';\nimport warning from './utils/warning';\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionName = actionType && '\"' + actionType.toString() + '\"' || 'an action';\n\n return 'Given action ' + actionName + ', reducer \"' + key + '\" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return 'The ' + argumentName + ' has unexpected type of \"' + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + '\". Expected argument to be an object with the following ' + ('keys: \"' + reducerKeys.join('\", \"') + '\"');\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n\n if (unexpectedKeys.length > 0) {\n return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('\"' + unexpectedKeys.join('\", \"') + '\" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('\"' + reducerKeys.join('\", \"') + '\". Unexpected keys will be ignored.');\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, { type: ActionTypes.INIT });\n\n if (typeof initialState === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');\n }\n\n var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');\n if (typeof reducer(undefined, { type: type }) === 'undefined') {\n throw new Error('Reducer \"' + key + '\" returned undefined when probed with a random type. ' + ('Don\\'t try to handle ' + ActionTypes.INIT + ' or other actions in \"redux/*\" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');\n }\n });\n}\n\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\nexport default function combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning('No reducer provided for key \"' + key + '\"');\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n var finalReducerKeys = Object.keys(finalReducers);\n\n var unexpectedKeyCache = void 0;\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError = void 0;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments[1];\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n return hasChanged ? nextState : state;\n };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/combineReducers.js\n// module id = 41\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/combineReducers.js","import warning from './utils/warning';\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(undefined, arguments));\n };\n}\n\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass a single function as the first argument,\n * and get a function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\nexport default function bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?');\n }\n\n var keys = Object.keys(actionCreators);\n var boundActionCreators = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var actionCreator = actionCreators[key];\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n } else {\n warning('bindActionCreators expected a function actionCreator for key \\'' + key + '\\', instead received type \\'' + typeof actionCreator + '\\'.');\n }\n }\n return boundActionCreators;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/bindActionCreators.js\n// module id = 42\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/bindActionCreators.js","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nimport compose from './compose';\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\nexport default function applyMiddleware() {\n for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function (reducer, preloadedState, enhancer) {\n var store = createStore(reducer, preloadedState, enhancer);\n var _dispatch = store.dispatch;\n var chain = [];\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch(action) {\n return _dispatch(action);\n }\n };\n chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(undefined, chain)(store.dispatch);\n\n return _extends({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/redux/es/applyMiddleware.js\n// module id = 43\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/redux/es/applyMiddleware.js","!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):e.dlv=n()}(this,function(){function e(e,n,t,o){for(o=0,n=n.split?n.split(\".\"):n;e&&o<n.length;)e=e[n[o++]];return void 0===e?t:e}return e});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/dlv/dist/dlv.umd.js\n// module id = 44\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/dlv/dist/dlv.umd.js","//@flow\nimport { combineReducers } from 'redux';\nimport engine from './reducers/engine';\nimport shell from './reducers/shell';\nimport playPause from './reducers/play-pause';\nimport seekbar from './reducers/seekbar';\nimport volume from './reducers/volume';\nimport fullscreen from './reducers/fullscreen';\nimport loading from './reducers/loading';\nimport share from './reducers/share';\nimport cvaa from './reducers/cvaa';\nimport settings from './reducers/settings';\n\nconst reducer = combineReducers({\n engine,\n shell,\n seekbar,\n volume,\n fullscreen,\n loading,\n playPause,\n share,\n cvaa,\n settings\n});\n\nexport default reducer;\n\n\n\n// WEBPACK FOOTER //\n// ./store.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/store.js","module.exports = {\n\t\"core\": {\n\t\t\"disable\": \"Disable\",\n\t\t\"auto\": \"Auto\",\n\t\t\"close\": \"Close\"\n\t},\n\t\"controls\": {\n\t\t\"play\": \"Play\",\n\t\t\"pause\": \"Pause\",\n\t\t\"share\": \"Share\",\n\t\t\"language\": \"Language\",\n\t\t\"settings\": \"Settings\",\n\t\t\"fullscreen\": \"Fullscreen\"\n\t},\n\t\"settings\": {\n\t\t\"quality\": \"Quality\",\n\t\t\"speed\": \"Speed\"\n\t},\n\t\"language\": {\n\t\t\"audio\": \"Audio\",\n\t\t\"captions\": \"Captions\",\n\t\t\"advanced_captions_settings\": \"Advanced captions settings\"\n\t},\n\t\"share\": {\n\t\t\"share_title\": \"Share\",\n\t\t\"link_options\": \"Link options\"\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./fr.json\n// module id = 46\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/fr.json","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { default as reduce, actions } from '../../reducers/engine';\nimport BaseComponent from '../base';\n\n@connect(reduce, bindActions(actions))\nclass EngineConnector extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'EngineConnector', player: obj.player});\n }\n\n componentDidMount() {\n this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED, (e) => {\n this.props.updatePlayerState(e.payload.oldState.type, e.payload.newState.type);\n });\n\n this.player.addEventListener(this.player.Event.TIME_UPDATE, () => {\n this.props.updateCurrentTime(this.player.currentTime);\n });\n\n this.player.addEventListener(this.player.Event.LOADED_METADATA, () => {\n this.props.updateDuration(this.player.duration);\n this.props.updateMetadataLoadingStatus(true);\n\n const TrackType = this.player.Track;\n var tracks = this.player.getTracks();\n let audioTracks = tracks.filter(t => t.constructor.name === 'AudioTrack');\n let videoTracks = tracks.filter(t => t.constructor.name === 'VideoTrack');\n let textTracks = tracks.filter(t => t.constructor.name === 'TextTrack');\n\n this.props.updateAudioTracks(audioTracks);\n this.props.updateVideoTracks(videoTracks);\n this.props.updateTextTracks(textTracks);\n });\n\n this.player.addEventListener(this.player.Event.VOLUME_CHANGE, () => {\n this.props.updateVolume(this.player.volume);\n });\n\n this.player.addEventListener(this.player.Event.PLAY, () => {\n this.props.updateIsPlaying(true);\n });\n\n this.player.addEventListener(this.player.Event.PAUSE, () => {\n this.props.updateIsPlaying(false);\n });\n }\n\n shouldComponentUpdate() { return false; }\n\n render() {\n return <span />\n }\n}\n\nexport default EngineConnector;\n\n\n\n// WEBPACK FOOTER //\n// ./components/engine-connector/engine-connector.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/engine-connector/engine-connector.js","module.exports = __WEBPACK_EXTERNAL_MODULE_48__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}\n// module id = 48\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/ui/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","//@flow\nimport * as JsLogger from 'js-logger';\n\nconst LOG_LEVEL: { [level: string]: Object } = {\n \"DEBUG\": JsLogger.DEBUG,\n \"INFO\": JsLogger.INFO,\n \"TIME\": JsLogger.TIME,\n \"WARN\": JsLogger.WARN,\n \"ERROR\": JsLogger.ERROR,\n \"OFF\": JsLogger.OFF\n};\n\nclass LoggerFactory {\n constructor(options?: Object) {\n JsLogger.useDefaults(options || {});\n }\n\n getLogger(name?: string) {\n if (!name) {\n return JsLogger;\n }\n return JsLogger.get(name);\n }\n}\n\nconst lf = new LoggerFactory({defaultLevel: JsLogger.DEBUG});\n\nexport default lf;\nexport {LOG_LEVEL};\n\n\n\n// WEBPACK FOOTER //\n// ./utils/logger.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/logger.js","/*!\r\n * js-logger - http://github.com/jonnyreeves/js-logger\r\n * Jonny Reeves, http://jonnyreeves.co.uk/\r\n * js-logger may be freely distributed under the MIT license.\r\n */\r\n(function (global) {\r\n\t\"use strict\";\r\n\r\n\t// Top level module for the global, static logger instance.\r\n\tvar Logger = { };\r\n\r\n\t// For those that are at home that are keeping score.\r\n\tLogger.VERSION = \"1.3.0\";\r\n\r\n\t// Function which handles all incoming log messages.\r\n\tvar logHandler;\r\n\r\n\t// Map of ContextualLogger instances by name; used by Logger.get() to return the same named instance.\r\n\tvar contextualLoggersByNameMap = {};\r\n\r\n\t// Polyfill for ES5's Function.bind.\r\n\tvar bind = function(scope, func) {\r\n\t\treturn function() {\r\n\t\t\treturn func.apply(scope, arguments);\r\n\t\t};\r\n\t};\r\n\r\n\t// Super exciting object merger-matron 9000 adding another 100 bytes to your download.\r\n\tvar merge = function () {\r\n\t\tvar args = arguments, target = args[0], key, i;\r\n\t\tfor (i = 1; i < args.length; i++) {\r\n\t\t\tfor (key in args[i]) {\r\n\t\t\t\tif (!(key in target) && args[i].hasOwnProperty(key)) {\r\n\t\t\t\t\ttarget[key] = args[i][key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\r\n\t};\r\n\r\n\t// Helper to define a logging level object; helps with optimisation.\r\n\tvar defineLogLevel = function(value, name) {\r\n\t\treturn { value: value, name: name };\r\n\t};\r\n\r\n\t// Predefined logging levels.\r\n\tLogger.DEBUG = defineLogLevel(1, 'DEBUG');\r\n\tLogger.INFO = defineLogLevel(2, 'INFO');\r\n\tLogger.TIME = defineLogLevel(3, 'TIME');\r\n\tLogger.WARN = defineLogLevel(4, 'WARN');\r\n\tLogger.ERROR = defineLogLevel(8, 'ERROR');\r\n\tLogger.OFF = defineLogLevel(99, 'OFF');\r\n\r\n\t// Inner class which performs the bulk of the work; ContextualLogger instances can be configured independently\r\n\t// of each other.\r\n\tvar ContextualLogger = function(defaultContext) {\r\n\t\tthis.context = defaultContext;\r\n\t\tthis.setLevel(defaultContext.filterLevel);\r\n\t\tthis.log = this.info; // Convenience alias.\r\n\t};\r\n\r\n\tContextualLogger.prototype = {\r\n\t\t// Changes the current logging level for the logging instance.\r\n\t\tsetLevel: function (newLevel) {\r\n\t\t\t// Ensure the supplied Level object looks valid.\r\n\t\t\tif (newLevel && \"value\" in newLevel) {\r\n\t\t\t\tthis.context.filterLevel = newLevel;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Is the logger configured to output messages at the supplied level?\r\n\t\tenabledFor: function (lvl) {\r\n\t\t\tvar filterLevel = this.context.filterLevel;\r\n\t\t\treturn lvl.value >= filterLevel.value;\r\n\t\t},\r\n\r\n\t\tdebug: function () {\r\n\t\t\tthis.invoke(Logger.DEBUG, arguments);\r\n\t\t},\r\n\r\n\t\tinfo: function () {\r\n\t\t\tthis.invoke(Logger.INFO, arguments);\r\n\t\t},\r\n\r\n\t\twarn: function () {\r\n\t\t\tthis.invoke(Logger.WARN, arguments);\r\n\t\t},\r\n\r\n\t\terror: function () {\r\n\t\t\tthis.invoke(Logger.ERROR, arguments);\r\n\t\t},\r\n\r\n\t\ttime: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'start' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttimeEnd: function (label) {\r\n\t\t\tif (typeof label === 'string' && label.length > 0) {\r\n\t\t\t\tthis.invoke(Logger.TIME, [ label, 'end' ]);\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Invokes the logger callback if it's not being filtered.\r\n\t\tinvoke: function (level, msgArgs) {\r\n\t\t\tif (logHandler && this.enabledFor(level)) {\r\n\t\t\t\tlogHandler(msgArgs, merge({ level: level }, this.context));\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Protected instance which all calls to the to level `Logger` module will be routed through.\r\n\tvar globalLogger = new ContextualLogger({ filterLevel: Logger.OFF });\r\n\r\n\t// Configure the global Logger instance.\r\n\t(function() {\r\n\t\t// Shortcut for optimisers.\r\n\t\tvar L = Logger;\r\n\r\n\t\tL.enabledFor = bind(globalLogger, globalLogger.enabledFor);\r\n\t\tL.debug = bind(globalLogger, globalLogger.debug);\r\n\t\tL.time = bind(globalLogger, globalLogger.time);\r\n\t\tL.timeEnd = bind(globalLogger, globalLogger.timeEnd);\r\n\t\tL.info = bind(globalLogger, globalLogger.info);\r\n\t\tL.warn = bind(globalLogger, globalLogger.warn);\r\n\t\tL.error = bind(globalLogger, globalLogger.error);\r\n\r\n\t\t// Don't forget the convenience alias!\r\n\t\tL.log = L.info;\r\n\t}());\r\n\r\n\t// Set the global logging handler. The supplied function should expect two arguments, the first being an arguments\r\n\t// object with the supplied log messages and the second being a context object which contains a hash of stateful\r\n\t// parameters which the logging function can consume.\r\n\tLogger.setHandler = function (func) {\r\n\t\tlogHandler = func;\r\n\t};\r\n\r\n\t// Sets the global logging filter level which applies to *all* previously registered, and future Logger instances.\r\n\t// (note that named loggers (retrieved via `Logger.get`) can be configured independently if required).\r\n\tLogger.setLevel = function(level) {\r\n\t\t// Set the globalLogger's level.\r\n\t\tglobalLogger.setLevel(level);\r\n\r\n\t\t// Apply this level to all registered contextual loggers.\r\n\t\tfor (var key in contextualLoggersByNameMap) {\r\n\t\t\tif (contextualLoggersByNameMap.hasOwnProperty(key)) {\r\n\t\t\t\tcontextualLoggersByNameMap[key].setLevel(level);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Retrieve a ContextualLogger instance. Note that named loggers automatically inherit the global logger's level,\r\n\t// default context and log handler.\r\n\tLogger.get = function (name) {\r\n\t\t// All logger instances are cached so they can be configured ahead of use.\r\n\t\treturn contextualLoggersByNameMap[name] ||\r\n\t\t\t(contextualLoggersByNameMap[name] = new ContextualLogger(merge({ name: name }, globalLogger.context)));\r\n\t};\r\n\r\n\t// CreateDefaultHandler returns a handler function which can be passed to `Logger.setHandler()` which will\r\n\t// write to the window's console object (if present); the optional options object can be used to customise the\r\n\t// formatter used to format each log message.\r\n\tLogger.createDefaultHandler = function (options) {\r\n\t\toptions = options || {};\r\n\r\n\t\toptions.formatter = options.formatter || function defaultMessageFormatter(messages, context) {\r\n\t\t\t// Prepend the logger's name to the log message for easy identification.\r\n\t\t\tif (context.name) {\r\n\t\t\t\tmessages.unshift(\"[\" + context.name + \"]\");\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Map of timestamps by timer labels used to track `#time` and `#timeEnd()` invocations in environments\r\n\t\t// that don't offer a native console method.\r\n\t\tvar timerStartTimeByLabelMap = {};\r\n\r\n\t\t// Support for IE8+ (and other, slightly more sane environments)\r\n\t\tvar invokeConsoleMethod = function (hdlr, messages) {\r\n\t\t\tFunction.prototype.apply.call(hdlr, console, messages);\r\n\t\t};\r\n\r\n\t\t// Check for the presence of a logger.\r\n\t\tif (typeof console === \"undefined\") {\r\n\t\t\treturn function () { /* no console */ };\r\n\t\t}\r\n\r\n\t\treturn function(messages, context) {\r\n\t\t\t// Convert arguments object to Array.\r\n\t\t\tmessages = Array.prototype.slice.call(messages);\r\n\r\n\t\t\tvar hdlr = console.log;\r\n\t\t\tvar timerLabel;\r\n\r\n\t\t\tif (context.level === Logger.TIME) {\r\n\t\t\t\ttimerLabel = (context.name ? '[' + context.name + '] ' : '') + messages[0];\r\n\r\n\t\t\t\tif (messages[1] === 'start') {\r\n\t\t\t\t\tif (console.time) {\r\n\t\t\t\t\t\tconsole.time(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttimerStartTimeByLabelMap[timerLabel] = new Date().getTime();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (console.timeEnd) {\r\n\t\t\t\t\t\tconsole.timeEnd(timerLabel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tinvokeConsoleMethod(hdlr, [ timerLabel + ': ' +\r\n\t\t\t\t\t\t\t(new Date().getTime() - timerStartTimeByLabelMap[timerLabel]) + 'ms' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Delegate through to custom warn/error loggers if present on the console.\r\n\t\t\t\tif (context.level === Logger.WARN && console.warn) {\r\n\t\t\t\t\thdlr = console.warn;\r\n\t\t\t\t} else if (context.level === Logger.ERROR && console.error) {\r\n\t\t\t\t\thdlr = console.error;\r\n\t\t\t\t} else if (context.level === Logger.INFO && console.info) {\r\n\t\t\t\t\thdlr = console.info;\r\n\t\t\t\t}\r\n\r\n\t\t\t\toptions.formatter(messages, context);\r\n\t\t\t\tinvokeConsoleMethod(hdlr, messages);\r\n\t\t\t}\r\n\t\t};\r\n\t};\r\n\r\n\t// Configure and example a Default implementation which writes to the `window.console` (if present). The\r\n\t// `options` hash can be used to configure the default logLevel and provide a custom message formatter.\r\n\tLogger.useDefaults = function(options) {\r\n\t\tLogger.setLevel(options && options.defaultLevel || Logger.DEBUG);\r\n\t\tLogger.setHandler(Logger.createDefaultHandler(options));\r\n\t};\r\n\r\n\t// Export to popular environments boilerplate.\r\n\tif (typeof define === 'function' && define.amd) {\r\n\t\tdefine(Logger);\r\n\t}\r\n\telse if (typeof module !== 'undefined' && module.exports) {\r\n\t\tmodule.exports = Logger;\r\n\t}\r\n\telse {\r\n\t\tLogger._prevLogger = global.Logger;\r\n\r\n\t\tLogger.noConflict = function () {\r\n\t\t\tglobal.Logger = Logger._prevLogger;\r\n\t\t\treturn Logger;\r\n\t\t};\r\n\r\n\t\tglobal.Logger = Logger;\r\n\t}\r\n}(this));\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/js-logger/src/logger.js\n// module id = 50\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:///node_modules/js-logger/src/logger.js","//@flow\nimport { h } from 'preact';\nimport BaseComponent from '../base';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/shell';\nimport { isMobile } from '../../utils/is-mobile';\n\nconst mapStateToProps = state => ({\n metadataLoaded: state.engine.metadataLoaded,\n currentState: state.engine.playerState.currentState,\n playerClasses: state.shell.playerClasses,\n isMobile: state.shell.isMobile\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass Shell extends BaseComponent {\n constructor() {\n super({name: 'Shell'});\n }\n\n componentDidMount() {\n this.props.updateIsMobile(isMobile());\n }\n\n render(props) {\n var playerClasses = 'player skin-default';\n playerClasses += ` ${props.playerClasses.join(' ')}`;\n\n if (this.props.metadataLoaded) playerClasses += ` metadata-loaded`;\n if (this.props.metadataLoaded) playerClasses += ` state-${this.props.currentState}`;\n\n return (\n <div className={playerClasses}>\n { props.children }\n </div>\n )\n }\n}\n\nexport default Shell;\n\n\n\n// WEBPACK FOOTER //\n// ./components/shell/shell.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/shell/shell.js","//@flow\n\nfunction isMobile() {\n return typeof window.orientation !== \"undefined\" || navigator.userAgent.indexOf(\"IEMobile\") !== -1;\n}\n\nexport {isMobile}\n\n\n\n// WEBPACK FOOTER //\n// ./utils/is-mobile.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/utils/is-mobile.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/play-pause';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n isPlaying: state.engine.isPlaying\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass OverlayPlay extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'OverlayPlay', player: obj.player});\n }\n\n togglePlayPause() {\n this.logger.debug('Toggle play');\n this.setState({animation: true});\n setTimeout(() => {\n this.setState({animation: false});\n }, 400);\n if (this.player.paused) {\n this.player.play();\n }\n else {\n this.player.pause();\n }\n }\n\n render(props) {\n return (\n <div className={`overlay-play ${this.state.animation ? 'in' : ''}`} onClick={() => this.togglePlayPause()}>\n { props.isPlaying ? <Icon type='play' /> : <Icon type='pause' /> }\n </div>\n )\n }\n}\n\nexport default OverlayPlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/overlay-play/overlay-play.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/overlay-play/overlay-play.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/loading';\nimport BaseComponent from '../base';\n\nconst mapStateToProps = state => ({\n show: state.loading.show\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass Loading extends BaseComponent {\n constructor(obj: IControlParams) {\n super({name: 'Loading', player: obj.player});\n }\n\n componentDidMount() {\n this.player.addEventListener(this.player.Event.PLAYER_STATE_CHANGED, e => {\n if (e.payload.newState.type === 'idle' || e.payload.newState.type === 'playing' || e.payload.newState.type === 'paused') {\n this.props.updateLoadingSpinnerState(false);\n }\n else {\n this.props.updateLoadingSpinnerState(true);\n }\n });\n }\n\n render(props) {\n return (\n <div className={props.show ? 'loading-backdrop show' : 'loading-backdrop'}>\n <div className='spinner-container'>\n <div className='spinner'>\n {[...Array(8)].map(() => <span />)}\n </div>\n </div>\n </div>\n )\n }\n\n}\n\nexport default Loading;\n\n\n\n// WEBPACK FOOTER //\n// ./components/loading/loading.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/loading/loading.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/play-pause';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n isPlaying: state.engine.isPlaying\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass PlayPauseControl extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'PlayPause', player: obj.player});\n }\n\n togglePlayPause() {\n this.logger.debug('Toggle play');\n if (this.player.paused) {\n this.player.play();\n }\n else {\n this.player.pause();\n }\n }\n\n render() {\n var controlButtonClass = this.props.isPlaying ? 'control-button is-playing' : 'control-button';\n\n return (\n <div className='control-button-container control-play-pause'>\n <Localizer>\n <button aria-label={<Text id={this.props.isPlaying ? 'controls.pause' : 'controls.play'} />} className={controlButtonClass} onClick={() => this.togglePlayPause()}>\n <Icon type='play' />\n <Icon type='pause' />\n </button>\n </Localizer>\n </div>\n )\n }\n}\n\nexport default PlayPauseControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/play-pause/play-pause.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/play-pause/play-pause.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/seekbar';\nimport BaseComponent from '../base';\nimport { toHHMMSS } from '../../utils/time-format';\n\nconst mapStateToProps = state => ({\n virtualProgress: state.seekbar.virtualTime,\n currentTime: state.seekbar.currentTime,\n duration: state.engine.duration,\n isDraggingActive: state.seekbar.draggingActive\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass SeekBarControl extends BaseComponent {\n _seekBarElement: HTMLElement;\n _playerElement: HTMLElement;\n\n constructor(obj: IControlParams) {\n super({name: 'SeekBar', player: obj.player});\n }\n\n componentDidMount() {\n this._playerElement = document.getElementsByClassName('player')[0];\n this._seekBarElement = document.getElementsByClassName('seek-bar')[0];\n\n this.setState({virtualTime: 0});\n\n this.player.addEventListener(this.player.Event.TIME_UPDATE, () => {\n this.props.updateCurrentTime(this.player.currentTime);\n });\n }\n\n onSeekbarMouseDown = e => {\n this.props.updateSeekbarDraggingStatus(true);\n if (this.props.isDraggingActive) {\n let time = this.getTime(e);\n this.updateSeekBarProgress(time, this.player.duration);\n }\n }\n\n onSeekbarMouseUp = e => {\n let time = this.getTime(e);\n this.player.currentTime = time;\n this.updateSeekBarProgress(time, this.player.duration);\n this.props.updateSeekbarDraggingStatus(false);\n this.logger.debug(`Seek to ${time}s`);\n }\n\n onSeekbarMouseMove = e => {\n let time = this.getTime(e);\n this.updateSeekBarProgress(time, this.player.duration, true);\n\n if (this.props.isDraggingActive) {\n this.updateSeekBarProgress(time, this.player.duration);\n }\n }\n\n updateSeekBarProgress(currentTime: number, duration: number, virtual: boolean = false) {\n if (virtual) {\n this.setState({virtualTime: currentTime});\n }\n else {\n this.props.updateCurrentTime(currentTime);\n }\n }\n\n getTime(e: Event): Number {\n let time = this.player.duration * ((e.clientX - this._seekBarElement.offsetLeft - this._playerElement.offsetLeft) / this._seekBarElement.clientWidth);\n time = parseFloat(time.toFixed(2));\n if (time < 0) return 0;\n if (time > this.player.duration) return this.player.duration;\n return time;\n }\n\n getThumbSpriteOffset() {\n return - (Math.ceil(100 * this.state.virtualTime / this.player.duration) * 160) + 'px 0px';\n }\n\n render(props) {\n var virtualProgressWidth = `${this.state.virtualTime / props.duration * 100}%`;\n var progressWidth = `${props.currentTime / props.duration * 100}%`;\n var framePreviewStyle = 'background-image: url(http://cfvod.kaltura.com/p/1914121/sp/191412100/thumbnail/entry_id/1_fet8ffop/version/100001/width/160/vid_slices/100); ';\n framePreviewStyle += `background-position: ${this.getThumbSpriteOffset()}`\n\n return (\n <div className='seek-bar' role='slider'\n aria-label='Seek slider' aria-valuemin='0' aria-valuemax={Math.round(this.player.duration)} aria-valuenow={Math.round(this.player.currentTime)}\n aria-valuetext={`${toHHMMSS(this.player.currentTime)} of ${toHHMMSS(this.player.duration)}`}\n onMouseMove={e => this.onSeekbarMouseMove(e)} onMouseDown={e => this.onSeekbarMouseDown(e)} onMouseUp={e => this.onSeekbarMouseUp(e)}>\n <div className='progress-bar'>\n <div className='progress' style={{width: progressWidth}}>\n <a className='scrubber' />\n </div>\n <div className='virtual-progress' style={{width: virtualProgressWidth}}>\n {\n props.showFramePreview ?\n (<div className='frame-preview'>\n <div className='frame-preview-img' style={framePreviewStyle} />\n </div>) : ''\n }\n { this.props.showTimeBubble ? <div className='time-preview'>{ toHHMMSS(this.state.virtualTime)}</div> : '' }\n </div>\n <div className='buffered' style='width: 60%;' />\n </div>\n </div>\n )\n }\n\n}\nexport default SeekBarControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/seekbar/seekbar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/seekbar/seekbar.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/volume';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n isDraggingActive: state.volume.isDraggingActive,\n volume: state.volume.volume,\n muted: state.volume.muted,\n isMobile: state.shell.isMobile\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass VolumeControl extends BaseComponent {\n _volumeControlElement: HTMLElement;\n _volumeProgressBarElement: HTMLElement;\n\n constructor(obj: IControlParams) {\n super({name: 'Volume', player: obj.player});\n }\n\n componentDidMount() {\n this._volumeControlElement = document.getElementsByClassName('volume-control')[0];\n this._volumeProgressBarElement = this._volumeControlElement.getElementsByClassName('bar')[0];\n\n this.player.addEventListener(this.player.Event.LOADED_METADATA, () => {\n this.props.updateVolume(this.player.volume);\n })\n\n this.player.addEventListener(this.player.Event.VOLUME_CHANGE, () => {\n this.props.updateVolume(this.player.volume);\n });\n }\n\n getVolumeProgessHeight(): string {\n return this.props.muted ? '0%' : Math.round(this.props.volume * 100) + '%';\n }\n\n onVolumeProgressBarMouseDown() {\n this.props.updateVolumeDraggingStatus(true);\n }\n\n onVolumeProgressBarClick(e: Event) {\n this.changeVolume(e);\n }\n\n onVolumeControlButtonClick() {\n this.logger.debug(`Toggle mute. ${this.player.muted} => ${!this.player.muted}`);\n this.props.updateMuted(!this.props.muted);\n this.player.muted = !this.player.muted;\n }\n\n changeVolume(e: Event) {\n let barHeight = this._volumeProgressBarElement.clientHeight;\n let topY = this.getCoords(this._volumeProgressBarElement).top;\n let clickY = e.clientY;\n let volume = 1 - ((clickY - topY) / barHeight);\n volume = parseFloat(volume.toFixed(2));\n this.logger.debug(`Change volume from ${this.player.volume} => ${volume}`);\n this.player.volume = volume;\n if (this.props.muted) {\n this.player.muted = false;\n this.props.updateMuted(false);\n }\n }\n\n getCoords(el: HTMLElement): {top: number, left: number} {\n let box = el.getBoundingClientRect();\n\n return {\n top: box.top + pageYOffset,\n left: box.left + pageXOffset\n }\n }\n\n render() {\n var controlButtonClass = 'control-button-container volume-control';\n if (this.props.isDraggingActive) controlButtonClass += ' dragging-active';\n if (this.props.muted || this.props.volume === 0) controlButtonClass += ' is-muted';\n\n return (\n <div className={controlButtonClass}>\n <button className='control-button' onClick={() => this.onVolumeControlButtonClick()} aria-label='Volume'>\n <Icon type='volume-base' />\n <Icon type='volume-waves' />\n <Icon type='volume-mute' />\n </button>\n <div className='volume-control-bar' role='slider'\n aria-valuemin='0' aria-valuemaz='100' aria-valuenow={this.player.volume * 100}\n aria-valuetext={`${this.player.volume * 100}% volume ${this.player.muted ? 'muted' : ''}`}>\n <div className='bar' onMouseDown={() => this.onVolumeProgressBarMouseDown()} onClick={e => this.onVolumeProgressBarClick(e)}>\n <div className='progress' style={{height: this.getVolumeProgessHeight()}} />\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default VolumeControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/volume/volume.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/volume/volume.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/share';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n overlayOpen: state.share.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass ShareControl extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'Share', player: obj.player});\n }\n\n render(props) {\n return (\n <div className='control-button-container control-share'>\n <button className='control-button control-button-rounded' onClick={() => props.toggleShareOverlay(!props.overlayOpen)} aria-label='Share'>\n <Icon type='share' />\n </button>\n </div>\n )\n }\n}\n\nexport default ShareControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/share/share.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/share/share.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/settings';\nimport BaseComponent from '../base';\nimport SmartContainer from '../smart-container/smart-container';\nimport SmartContainerItem from '../smart-container/smart-container-item';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n videoTracks: state.engine.videoTracks\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass SettingsControl extends BaseComponent {\n\n constructor(obj: IControlParams) {\n super({name: 'Settings', player: obj.player});\n }\n\n componentDidMount() {\n this.setState({smartContainerOpen: false});\n }\n\n onControlButtonClick() {\n this.setState({smartContainerOpen: !this.state.smartContainerOpen});\n }\n\n onSpeedChange(o) {\n this.props.updateSpeed(o.value);\n }\n\n onQualityChange(o) {\n this.props.updateQuality(o.value);\n }\n\n render(props) {\n var speedOptions = [\n { value: 1, label: 'Auto (360)', active: true },\n { value: 2, label: '240' },\n { value: 3, label: '144' }\n ];\n var qualityOptions = props.videoTracks.map(t => ({ label: t.label || t.language, active: t.active, value: t }));\n\n return (\n <div className='control-button-container control-settings'>\n <Localizer>\n <button aria-label={<Text id='controls.settings' />} className={this.state.smartContainerOpen ? 'control-button active' : 'control-button'} onClick={() => this.onControlButtonClick()}>\n <Icon type='settings' />\n </button>\n </Localizer>\n { !this.state.smartContainerOpen ? '' :\n <SmartContainer>\n {\n props.videoTracks.length <= 0 ? '' :\n <Localizer>\n <SmartContainerItem label={<Text id='settings.quality' />} options={qualityOptions} onSelect={(o) => this.onQualityChange(o)} />\n </Localizer>\n }\n <Localizer>\n <SmartContainerItem label={<Text id='settings.speed' />} options={speedOptions} onSelect={(o) => this.onSpeedChange(o)} />\n </Localizer>\n </SmartContainer>\n }\n </div>\n )\n }\n}\n\nexport default SettingsControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/settings/settings.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/settings/settings.js","//@flow\nimport { h, Component } from 'preact';\nimport Icon from '../icon/icon';\n\nclass DropDownMenu extends Component {\n\n componentWillMount() {\n this.setState({dropMenuActive: false});\n }\n\n isSelected(o): boolean {\n return o.active;\n }\n\n onSelect(o) {\n this.props.onSelect(o.value);\n this.setState({dropMenuActive: false});\n }\n\n getActiveOptionLabel(): string {\n let activeOptions = this.props.options.filter(t => t.active);\n return activeOptions.length > 0 ? activeOptions[0].label : this.props.options[0].label;\n }\n\n render(props) {\n return (\n <div className='dropdown top left'>\n <div className='dropdown-button' onClick={() => this.setState({dropMenuActive: !this.state.dropMenuActive})}>\n {this.getActiveOptionLabel()}\n </div>\n {\n !this.state.dropMenuActive ? '' :\n <div className='dropdown-menu'>\n {\n props.options.map(o => (\n <div className={this.isSelected(o) ? 'dropdown-menu-item active' : 'dropdown-menu-item'} onClick={() => this.onSelect(o)}>\n <span>{o.label}</span>\n { this.isSelected(o) ? <Icon type='check' /> : '' }\n </div>\n ))\n }\n </div>\n }\n </div>\n )\n }\n}\n\nexport default DropDownMenu;\n\n\n\n// WEBPACK FOOTER //\n// ./components/dropdown-menu/dropdown-menu.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/dropdown-menu/dropdown-menu.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/cvaa';\nimport BaseComponent from '../base';\nimport SmartContainer from '../smart-container/smart-container';\nimport SmartContainerItem from '../smart-container/smart-container-item';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n audioTracks: state.engine.audioTracks,\n textTracks: state.engine.textTracks,\n overlayOpen: state.cvaa.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass LanguageControl extends BaseComponent {\n constructor(obj: IControlParams) {\n super({name: 'LanguageControl', player: obj.player});\n }\n\n componentDidMount() {\n this.setState({smartContainerOpen: false});\n }\n\n onControlButtonClick() {\n this.setState({smartContainerOpen: !this.state.smartContainerOpen});\n }\n\n onAudioChange(audioTrack) {\n // this.player.selectTrack(audioTrack);\n this.player._engine.selectTextTrack(audioTrack); // workaround untill bug fixed in playkit-js\n }\n\n onCaptionsChange(textTrack) {\n // this.player.selectTrack(textTrack);\n this.player._engine.selectTextTrack(textTrack); // workaround untill bug fixed in playkit-js\n }\n\n render(props) {\n var audioOptions = props.audioTracks.map(t => ({ label: t.label || t.language, active: t.active, value: t }));\n var textOptions = props.textTracks.map(t => ({ label: t.label || t.language, active: t.active, value: t }));\n\n return props.audioTracks.length === 0 && props.audioTracks.length === 0 ? false : (\n <div className='control-button-container control-language'>\n <Localizer>\n <button aria-label={<Text id='controls.language' />} className={this.state.smartContainerOpen ? 'control-button active' : 'control-button'} onClick={() => this.onControlButtonClick()}>\n <Icon type='language' />\n </button>\n </Localizer>\n { !this.state.smartContainerOpen ? '' :\n <SmartContainer>\n {\n props.audioTracks.length <= 0 ? '' :\n <Localizer>\n <SmartContainerItem label={<Text id='language.audio' />} options={audioOptions} onSelect={audioTrack => this.onAudioChange(audioTrack)} />\n </Localizer>\n }\n {\n props.textTracks.length <= 0 ? '' :\n <Localizer>\n <SmartContainerItem label={<Text id='language.captions' />} options={textOptions} onSelect={textTrack => this.onCaptionsChange(textTrack)} />\n </Localizer>\n }\n {\n props.textTracks.length <= 0 ? '' :\n <div className='smart-container-item'>\n <a onClick={() => props.toggleCVAAOverlay(!props.overlayOpen)}><Text id='language.advanced_captions_settings'>Advanced captions settings</Text></a>\n </div>\n }\n </SmartContainer>\n }\n </div>\n )\n }\n}\n\nexport default LanguageControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/language/language.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/language/language.js","//@flow\nimport { h } from 'preact';\nimport { Localizer, Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/fullscreen';\nimport BaseComponent from '../base';\nimport Icon from '../icon/icon';\n\nconst mapStateToProps = state => ({\n fullscreen: state.fullscreen.fullscreen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass FullscreenControl extends BaseComponent {\n _playerElement: HTMLElement;\n\n constructor() {\n super({name: 'Fullscreen'});\n }\n\n componentDidMount() {\n this._playerElement = document.getElementsByClassName('player')[0];\n\n document.addEventListener('webkitfullscreenchange', () => {\n this.props.updateFullscreen(document.webkitIsFullScreen);\n });\n }\n\n enterFullscreen() {\n this._playerElement.webkitRequestFullscreen();\n }\n exitFullscreen() {\n document.webkitCancelFullScreen();\n }\n\n toggleFullscreen() {\n this.logger.debug(`Toggle fullscreen`);\n this.props.fullscreen ? this.exitFullscreen() : this.enterFullscreen();\n }\n\n render() {\n return (\n <div className='control-button-container control-fullscreen'>\n <Localizer>\n <button aria-label={<Text id='controls.fullscreen' />} className={this.props.fullscreen ? 'control-button is-fullscreen' : 'control-button'} onClick={() => this.toggleFullscreen()}>\n <Icon type='maximize' />\n <Icon type='minimize' />\n </button>\n </Localizer>\n </div>\n )\n }\n}\n\nexport default FullscreenControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/fullscreen/fullscreen.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/fullscreen/fullscreen.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport BaseComponent from '../base';\nimport { toHHMMSS } from '../../utils/time-format';\n\nconst mapStateToProps = state => ({\n currentTime: state.seekbar.currentTime,\n duration: state.engine.duration\n});\n\n@connect(mapStateToProps)\nclass TimeDisplay extends BaseComponent {\n constructor(obj: IControlParams) {\n super({name: 'TimeDisplay', player: obj.player, config: obj.config});\n }\n\n getTimeDisplay(): string {\n var result = this.props.format ? this.props.format : 'current / total',\n current = toHHMMSS(this.props.currentTime),\n total = toHHMMSS(this.props.duration),\n left = toHHMMSS(this.props.duration - this.props.currentTime);\n\n result = result.replace(/current/g, current);\n result = result.replace(/total/g, total);\n result = result.replace(/left/g, left);\n\n return result;\n }\n\n render() {\n return (\n <div className='time-display'>\n <span>{this.getTimeDisplay()}</span>\n </div>\n )\n }\n}\n\nexport default TimeDisplay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/time-display/time-display.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/time-display/time-display.js","import { h, Component } from 'preact';\n\nclass TopBar extends Component {\n render(props) {\n return (\n <div className='top-bar'>{ props.children }</div>\n )\n }\n}\n\nexport default TopBar;\n\n\n\n// WEBPACK FOOTER //\n// ./components/top-bar/top-bar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/top-bar/top-bar.js","import { h, Component } from 'preact';\n\nclass BottomBar extends Component {\n render(props) {\n return (\n <div className='bottom-bar'>{ props.children }</div>\n )\n }\n}\n\nexport default BottomBar;\n\n\n\n// WEBPACK FOOTER //\n// ./components/bottom-bar/bottom-bar.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/bottom-bar/bottom-bar.js","//@flow\nimport { h } from 'preact';\nimport { Text } from 'preact-i18n';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/share';\nimport BaseComponent from '../base';\nimport Overlay from '../overlay/overlay';\n\nconst mapStateToProps = state => ({\n open: state.share.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass ShareOverlay extends BaseComponent {\n constructor() {\n super({name: 'ShareOverlay'});\n }\n\n render(props) {\n return !props.open ? '' : (\n <Overlay open={props.open} onClose={() => props.toggleShareOverlay(false)} type='share'>\n <div className='title'>\n <Text id='share.share_title' />\n </div>\n <div className='share-icons'>\n <a className='share-btn facebook-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M432 405.333h-80v106.667h80v320h133.333v-320h97.12l9.547-106.667h-106.667v-44.453c0-25.467 5.12-35.547 29.733-35.547h76.933v-133.333h-101.547c-95.893 0-138.453 42.213-138.453 123.067v90.267z' />\n </svg>\n </a>\n <a className='share-btn twitter-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M832 316.614c-23.547 10.29-48.853 17.221-75.413 20.345 27.12-15.987 47.947-41.319 57.733-71.508-25.36 14.806-53.467 25.568-83.387 31.37-23.92-25.122-58.080-40.82-95.84-40.82-84.773 0-147.067 77.861-127.92 158.687-109.093-5.381-205.84-56.833-270.613-135.035-34.4 58.094-17.84 134.090 40.613 172.574-21.493-0.683-41.76-6.484-59.44-16.171-1.44 59.879 42.16 115.898 105.307 128.368-18.48 4.935-38.72 6.090-59.307 2.205 16.693 51.347 65.173 88.702 122.667 89.752-55.2 42.605-124.747 61.637-194.4 53.552 58.107 36.673 127.147 58.067 201.28 58.067 243.787 0 381.52-202.684 373.2-384.473 25.653-18.244 47.92-41.004 65.52-66.914v0z' />\n </svg>\n </a>\n <a className='share-btn google-plus-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M352 556.8h127.040c-5.12 32.928-38.4 96.64-127.040 96.64-76.48 0-138.88-63.328-138.88-141.44 0-78.080 62.4-141.44 138.88-141.44 43.52 0 72.64 18.56 89.28 34.56l60.8-58.56c-39.040-36.48-89.6-58.56-150.080-58.56-123.84 0-224 100.16-224 224s100.16 224 224 224c129.28 0 215.072-90.88 215.072-218.88 0-14.72-1.632-25.92-3.552-37.12h-211.52v76.8zM800 544v96h-64v-96h-96v-64h96v-96h64v96h96v64h-96z' />\n </svg>\n </a>\n <a className='share-btn linkedin-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M324.8 290.087c0 36.506-29.6 66.087-66.133 66.087s-66.133-29.581-66.133-66.087c0-36.48 29.6-66.087 66.133-66.087s66.133 29.607 66.133 66.087zM325.333 409.043h-133.333v422.957h133.333v-422.957zM538.187 409.043h-132.48v422.957h132.507v-222.026c0-123.45 160.773-133.549 160.773 0v222.026h133.013v-267.811c0-208.306-237.92-200.719-293.813-98.179v-56.967z' />\n </svg>\n </a>\n <a className='share-btn email-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M256 768c-35.346 0-64-28.654-64-64v-352c0-35.346 28.654-64 64-64h512c35.346 0 64 28.654 64 64v352c0 35.346-28.654 64-64 64h-512zM512 467.488l147.52-115.488h-295.040l147.52 115.488zM748.48 352l-211.2 179.2c-0.713 1.308-1.572 2.532-2.56 3.648-12.707 12.158-32.733 12.158-45.44 0-0.988-1.116-1.847-2.34-2.56-3.648l-211.2-179.2h-19.52v352h512v-352h-19.52z' />\n </svg>\n </a>\n <a className='share-btn embed-share-btn'>\n <svg style='width:32px;height:32px' viewBox='0 0 1024 1024'>\n <path fill='#fff' d='M377.989 579.335c12.669 12.904 12.669 33.777 0 46.68-12.733 12.969-33.427 12.969-46.16 0l-104.727-106.667c-12.669-12.904-12.669-33.777 0-46.68l104.727-106.667c12.733-12.969 33.427-12.969 46.16 0 12.669 12.904 12.669 33.777 0 46.68l-81.812 83.327 81.812 83.327zM646.011 412.68c-12.669-12.904-12.669-33.777 0-46.68 12.733-12.969 33.427-12.969 46.16 0l104.727 106.667c12.669 12.904 12.669 33.777 0 46.68l-104.727 106.667c-12.733 12.969-33.427 12.969-46.16 0-12.669-12.904-12.669-33.777 0-46.68l81.812-83.327-81.812-83.327zM572.293 250.6c17.455 4.445 28.025 22.388 23.686 40.066l-104.727 426.669c-4.349 17.719-22.048 28.535-39.545 24.079-17.455-4.445-28.025-22.388-23.686-40.066l104.727-426.669c4.349-17.719 22.048-28.535 39.545-24.079z' />\n </svg>\n </a>\n </div>\n <div>\n <div className='form-group has-icon' style='width: 300px;'>\n <input type='text' placeholder='Share URL' className='form-control' value='https://cdnapisec.kaltura.com/index.php?assetId=123456' readOnly />\n <svg className='icon' style='width:32px;height:32px;' viewBox='0 0 1024 1024'>\n <path d='M355.028 445.537c12.497 12.497 12.497 32.758 0 45.255s-32.758 12.497-45.255 0l-24.141-24.141c-49.92-49.92-49.832-130.999 0.094-180.925 49.984-49.984 130.995-50.025 180.955-0.064l113.266 113.266c49.964 49.964 49.935 130.955-0.064 180.955-12.497 12.497-32.758 12.497-45.255 0s-12.497-32.758 0-45.255c25.013-25.013 25.027-65.482 0.064-90.445l-113.266-113.266c-24.957-24.957-65.445-24.936-90.445 0.064-24.955 24.955-24.998 65.511-0.094 90.416l24.141 24.141zM668.972 578.463c-12.497-12.497-12.497-32.758 0-45.255s32.758-12.497 45.255 0l24.141 24.141c49.92 49.92 49.832 130.999-0.094 180.925-49.984 49.984-130.995 50.025-180.955 0.064l-113.266-113.266c-49.964-49.964-49.935-130.955 0.064-180.955 12.497-12.497 32.758-12.497 45.255 0s12.497 32.758 0 45.255c-25.013 25.013-25.027 65.482-0.064 90.445l113.266 113.266c24.957 24.957 65.445 24.936 90.445-0.064 24.955-24.955 24.998-65.511 0.094-90.416l-24.141-24.141z' />\n </svg>\n </div>\n </div>\n <a><Text id='share.link_options' /></a>\n </Overlay>\n )\n }\n}\n\nexport default ShareOverlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/share-overlay/share-overlay.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/share-overlay/share-overlay.js","//@flow\nimport { h } from 'preact';\nimport { connect } from 'preact-redux';\nimport { bindActions } from '../../utils/bind-actions';\nimport { actions } from '../../reducers/cvaa';\nimport BaseComponent from '../base';\nimport Overlay from '../overlay/overlay';\n\nconst mapStateToProps = state => ({\n open: state.cvaa.overlayOpen\n});\n\n@connect(mapStateToProps, bindActions(actions))\nclass CVAAOverlay extends BaseComponent {\n constructor() {\n super({name: 'CVAAOverlay'});\n }\n\n render(props) {\n return !props.open ? '' : (\n <Overlay open={props.open} onClose={() => props.toggleCVAAOverlay(false)} type='cvaa'>\n <div className='title'>\n Advanced captions settings\n </div>\n <div>\n <div className='sample'>Sample</div>\n <div className='sample black-bg'>Sample</div>\n <div className='sample yellow-text'>Sample</div>\n </div>\n <a className='button-save-cvaa'>Set custom caption</a>\n </Overlay>\n )\n }\n}\n\nexport default CVAAOverlay;\n\n\n\n// WEBPACK FOOTER //\n// ./components/cvaa-overlay/cvaa-overlay.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/cvaa-overlay/cvaa-overlay.js","//@flow\nimport BaseComponent from './base';\n\nclass KeyboardControl extends BaseComponent {\n // _playerElement: HTMLElement;\n\n constructor(obj: IControlParams) {\n super({name: 'Keyboard', player: obj.player});\n\n // this._playerElement = document.getElementsByClassName('player')[0];\n\n document.body.onkeydown = (e) => {\n let time, newVolume;\n switch(e.which) {\n case 32: // space\n this.logger.debug(\"Keydown space\");\n this.player.paused ? this.player.play() : this.player.pause();\n break;\n\n case 38: // up\n this.logger.debug(\"Keydown up\");\n newVolume = Math.round(this.player.volume * 100) + 5;\n this.logger.debug(`Changing volume. ${this.player.volume} => ${newVolume}`);\n if (this.player.muted) {\n this.player.muted = false;\n }\n this.player.volume = newVolume / 100;\n break;\n\n case 40: // down\n this.logger.debug(\"Keydown down\");\n newVolume = Math.round(this.player.volume * 100) - 5;\n if (newVolume < 5) {\n this.player.muted = true;\n return;\n }\n this.logger.debug(`Changing volume. ${this.player.volume} => ${newVolume}`);\n this.player.volume = newVolume / 100;\n break;\n\n case 37: // left\n this.logger.debug(\"Keydown left\");\n time = (this.player.currentTime - 5) > 0 ? this.player.currentTime - 5 : 0;\n this.player.currentTime = time;\n break;\n\n case 39: // right\n this.logger.debug(\"Keydown right\");\n time = (this.player.currentTime + 5) > this.player.duration ? this.player.duration : this.player.currentTime + 5;\n this.player.currentTime = time;\n break;\n\n default: return;\n }\n }\n\n this.disableKeyboardCommandsOnControls();\n }\n\n disableKeyboardCommandsOnControls() {\n let controlButtonsElements = Array.from(document.getElementsByClassName('control-button'));\n controlButtonsElements.forEach((element) => {\n element.onkeydown = (e) => e.preventDefault();\n });\n }\n}\n\nexport default KeyboardControl;\n\n\n\n// WEBPACK FOOTER //\n// ./components/keyboard.js\n\n\n// WEBPACK FOOTER //\n// webpack:///ui/components/keyboard.js","// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!../../../css-loader/index.js!./style.css\");\nif(typeof content === 'string') content = [[module.id, content, '']];\n// Prepare cssTransformation\nvar transform;\n\nvar options = {}\noptions.transform = transform\n// add the styles to the DOM\nvar update = require(\"!../../../style-loader/lib/addStyles.js\")(content, options);\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(module.hot) {\n\t// When the styles change, update the <style> tags\n\tif(!content.locals) {\n\t\tmodule.hot.accept(\"!!../../../css-loader/index.js!./style.css\", function() {\n\t\t\tvar newContent = require(\"!!../../../css-loader/index.js!./style.css\");\n\t\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\t\t\tupdate(newContent);\n\t\t});\n\t}\n\t// When the module is disposed, remove the <style> tags\n\tmodule.hot.dispose(function() { update(); });\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/playkit-js-ui/src/styles/style.css\n// module id = 4\n// module chunks = 0","exports = module.exports = require(\"../../../css-loader/lib/css-base.js\")(undefined);\n// imports\n\n\n// module\nexports.push([module.id, \".row{display:block}.row:after{content:'';clear:both;display:block}.form-group{margin:10px auto;position:relative;max-width:100%}.form-group.has-error .form-control{border-color:#db1f26}.form-group.has-error .form-control:focus{border-color:#fff}.form-group.has-icon .form-control{padding-left:34px}.form-group .icon{position:absolute;top:2px;left:2px;fill:rgba(255,255,255,0.4)}.form-control{height:36px;width:100%;min-width:72px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(0,0,0,0.4);font-size:15px;line-height:18px;color:#fff;padding:8px 10px;text-overflow:ellipsis}.form-control::-webkit-input-placeholder{color:rgba(255,255,255,0.6)}.form-control:focus{background-color:#fff;border-color:#fff;color:#333}.form-control:focus::-webkit-input-placeholder{color:#ccc}.form-control:focus+.icon{fill:#999}textarea.form-control{min-height:72px}@-webkit-keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openDropmenu{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.dropdown{position:relative}.dropdown.active .dropdown-menu{display:block;opacity:1}.dropdown.top .dropdown-menu{margin-bottom:10px;bottom:100%}.dropdown.bottom .dropdown-menu{margin-top:10px;top:100%}.dropdown.right .dropdown-menu{left:0}.dropdown.left .dropdown-menu{right:0}.dropdown .dropdown-button{font-size:15px;font-weight:bold;line-height:18px;color:#fff;cursor:pointer}.dropdown .dropdown-menu{display:block;opacity:1;position:absolute;background-color:#333333;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;padding:6px 0;z-index:5;-webkit-animation:openDropmenu 100ms ease-out forwards;animation:openDropmenu 100ms ease-out forwards;max-height:173px;overflow-y:auto}.dropdown .dropdown-menu .dropdown-menu-item{padding:2px 10px 2px 16px;white-space:nowrap;min-height:30px;cursor:pointer}.dropdown .dropdown-menu .dropdown-menu-item:hover{color:#fff}.dropdown .dropdown-menu .dropdown-menu-item.active{color:#01ACCD;fill:#01ACCD}.dropdown .dropdown-menu .dropdown-menu-item .check-icon{display:inline-block;margin-left:16px;vertical-align:middle;width:24px;height:24px}.dropdown .dropdown-menu .dropdown-menu-item span{vertical-align:middle;line-height:26px}.tooltip{display:inline-block;height:22px;border-radius:4px;background-color:#FFFFFF;padding:3px 13px;color:#333333;font-size:13px;font-weight:bold;line-height:16px;box-shadow:0 0 8px 0 rgba(0,0,0,0.3)}.player .control-button{width:32px;height:32px;background:transparent;display:inline-block;opacity:0.8;border:none;padding:0;cursor:pointer;fill:#fff}.player .control-button svg{width:32px;height:32px}.player .control-button:hover,.player .control-button.active{opacity:1}.player .control-button.control-button-rounded{width:36px;height:36px;padding:2px}.player .control-button.control-button-rounded:hover{background-color:rgba(0,0,0,0.4);border-radius:18px}.player .control-button-container{display:inline-block;position:relative;vertical-align:top}a{color:#01ACCD;text-decoration:underline;font-size:15px;line-height:18px}a:hover{color:#01819a}a:active{opacity:0.7}.player{position:relative;max-width:854px;width:100%;background-color:#000;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.player:-webkit-full-screen{width:100%;height:100%;max-width:none}.player *{box-sizing:border-box;outline:none}.player ::-moz-selection{background-color:rgba(0,0,0,0.1)}.player ::selection{background-color:rgba(0,0,0,0.1)}.player video{width:100%}.player .player-gui{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;overflow:hidden;font-size:0;font-family:\\\"Lato\\\",sans-serif}.player .player-gui input,.player .player-gui textarea{font-family:\\\"Lato\\\",sans-serif}.player.metadata-loaded .player-gui,.player.state-paused .player-gui,.player.overlay-active .player-gui,.player.menu-active .player-gui{opacity:1}video::-webkit-media-controls{display:none !important}video::-webkit-media-controls-start-playback-button{display:none !important;-webkit-appearance:none}video::cue{background-color:transparent}.player.captions-yellow-text video::cue{color:#FAFF00}.player.captions-black-bg video::cue{background-color:#000}@-webkit-keyframes openOverlay{from{opacity:0}to{opacity:1}}@keyframes openOverlay{from{opacity:0}to{opacity:1}}.overlay{position:absolute;display:none;opacity:0;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.42);z-index:4;text-align:center;color:#fff;padding:80px 20px 0;-webkit-animation:openOverlay 100ms ease-in-out forwards;animation:openOverlay 100ms ease-in-out forwards}.overlay.active{display:block;opacity:1}.overlay .title{font-size:24px;font-weight:bold;line-height:29px;margin-bottom:60px}.overlay .close-overlay{position:absolute;top:48px;right:48px;z-index:5;fill:#fff;cursor:pointer}.overlay .close-overlay .icon-close{width:24px;height:24px}@media screen and (max-width: 768px){.overlay{padding:36px 20px 0}.overlay .close-overlay{top:38px}.overlay .title{margin-bottom:24px}}@media screen and (max-width: 480px){.overlay{padding:16px 24px 0}.overlay .close-overlay{top:15px;right:24px}.overlay .title{font-size:16px;line-height:19px;margin-bottom:36px}}@-webkit-keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes openSmartContainer{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.smart-container{background-color:#222222;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);border-radius:4px;position:absolute;right:0px;min-width:193px;font-size:15px;z-index:5;display:block;-webkit-animation:openSmartContainer 100ms ease-out forwards;animation:openSmartContainer 100ms ease-out forwards}.smart-container.top{bottom:100%;margin-bottom:6px}.smart-container.top:before{display:block;content:' ';position:absolute;bottom:-6px;left:0;width:100%;height:6px}.smart-container.bottom{top:100%;margin-top:6px}.smart-container.right{left:0px}.smart-container.left{right:0px}.smart-container .smart-container-item{margin:16px;color:rgba(244,244,244,0.8);white-space:nowrap}.smart-container .smart-container-item:after{display:block;content:' ';clear:both}.smart-container .smart-container-item.select-menu-item label{float:left}.smart-container .smart-container-item.select-menu-item .dropdown{float:right}.overlay.share-overlay .share-icons{margin:60px 0}.overlay.share-overlay .share-btn{height:36px;width:36px;border-radius:18px;background-color:rgba(0,0,0,0.4);display:inline-block;margin:0 8px;-webkit-transition:-webkit-transform 100ms;transition:transform 100ms;will-change:transform;padding:2px}.overlay.share-overlay .share-btn:hover{-webkit-transform:scale(1.1667);-ms-transform:scale(1.1667);transform:scale(1.1667)}.overlay.share-overlay .share-btn.facebook-share-btn{background-color:#3B5998}.overlay.share-overlay .share-btn.twitter-share-btn{background-color:#1DA1F2}.overlay.share-overlay .share-btn.google-plus-share-btn{background-color:#DD4B39}.overlay.share-overlay .share-btn.linkedin-share-btn{background-color:#00A0DC}@media screen and (max-width: 768px){.overlay.share-overlay .share-icons{margin:40px 0}}@media screen and (max-width: 480px){.overlay.share-overlay .share-icons{margin:20px 0}}.overlay.cvaa-overlay .sample{border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:36px;text-align:center;padding:0 31px;display:inline-block;margin:0 12px;cursor:pointer}.overlay.cvaa-overlay .sample.black-bg{background-color:#000}.overlay.cvaa-overlay .sample.yellow-text{color:#FAFF00}.overlay.cvaa-overlay .button-save-cvaa{margin-top:50px;height:40px;width:400px;border:2px solid rgba(255,255,255,0.2);border-radius:4px;font-size:16px;font-weight:bold;line-height:38px;text-align:center;display:inline-block;color:#fff;text-decoration:none;cursor:pointer}@-webkit-keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}@keyframes kaltura-spinner{0%{-webkit-transform:rotate(0deg) scale(0.7);transform:rotate(0deg) scale(0.7);opacity:1}70%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}82%{-webkit-transform:rotate(360deg) scale(0);transform:rotate(360deg) scale(0);opacity:0}87%{-webkit-transform:rotate(360deg) scale(0.9);transform:rotate(360deg) scale(0.9);opacity:1}100%{-webkit-transform:rotate(360deg) scale(0.7);transform:rotate(360deg) scale(0.7);opacity:1}}.loading-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.3);-webkit-transition:100ms opacity;transition:100ms opacity;opacity:0}.loading-backdrop.show{opacity:1}.loading-backdrop.show .spinner-container{display:block}.loading-backdrop .spinner-container{display:none;position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50px, -50px, 0);transform:translate3d(-50px, -50px, 0)}.spinner{width:100px;height:100px;position:relative;-webkit-animation:kaltura-spinner 2.5s infinite;animation:kaltura-spinner 2.5s infinite}.spinner span{width:8px;height:8px;background-color:#fff;display:block;border-radius:8px;position:absolute;top:50%;left:50%;margin-top:-4px;margin-left:-4px}.spinner span:nth-child(1){-webkit-transform:rotate(45deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(45deg) translateX(-25px) translateY(-25px);transform:rotate(45deg) translateX(-25px) translateY(-25px);background-color:#da1f26}.spinner span:nth-child(2){-webkit-transform:rotate(90deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(90deg) translateX(-25px) translateY(-25px);transform:rotate(90deg) translateX(-25px) translateY(-25px);background-color:#06a885}.spinner span:nth-child(3){-webkit-transform:rotate(135deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(135deg) translateX(-25px) translateY(-25px);transform:rotate(135deg) translateX(-25px) translateY(-25px);background-color:#009344}.spinner span:nth-child(4){-webkit-transform:rotate(180deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(180deg) translateX(-25px) translateY(-25px);transform:rotate(180deg) translateX(-25px) translateY(-25px);background-color:#f8a61a}.spinner span:nth-child(5){-webkit-transform:rotate(225deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(225deg) translateX(-25px) translateY(-25px);transform:rotate(225deg) translateX(-25px) translateY(-25px);background-color:#1b4a97}.spinner span:nth-child(6){-webkit-transform:rotate(270deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(270deg) translateX(-25px) translateY(-25px);transform:rotate(270deg) translateX(-25px) translateY(-25px);background-color:#00abcc}.spinner span:nth-child(7){-webkit-transform:rotate(315deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(315deg) translateX(-25px) translateY(-25px);transform:rotate(315deg) translateX(-25px) translateY(-25px);background-color:#b1d238}.spinner span:nth-child(8){-webkit-transform:rotate(360deg) translateX(-25px) translateY(-25px);-ms-transform:rotate(360deg) translateX(-25px) translateY(-25px);transform:rotate(360deg) translateX(-25px) translateY(-25px);background-color:#fcd203}.control-button-container.control-play-pause .control-button{-webkit-transition:400ms -webkit-transform;transition:400ms transform}.control-button-container.control-play-pause .control-button .icon-pause{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:0;display:none}.control-button-container.control-play-pause .control-button .icon-play{-webkit-transition:400ms opacity;transition:400ms opacity;opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}.control-button-container.control-play-pause .control-button.is-playing .icon-pause{opacity:1;display:block}.control-button-container.control-play-pause .control-button.is-playing .icon-play{opacity:0;display:none}@media screen and (max-width: 480px){.control-button-container.control-play-pause{display:none}}.control-button-container.volume-control:hover .volume-control-bar{display:block !important}.control-button-container.volume-control.is-muted .volume-waves{opacity:0;-webkit-transform:translateX(-5px);-ms-transform:translateX(-5px);transform:translateX(-5px)}.control-button-container.volume-control.is-muted .volume-mute{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.volume-control.dragging-active .volume-control-bar{display:block}.control-button-container.volume-control .volume-waves{-webkit-transform:translateX(0px);-ms-transform:translateX(0px);transform:translateX(0px)}.control-button-container.volume-control .volume-mute{opacity:1;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}.control-button-container.volume-control .volume-waves,.control-button-container.volume-control .volume-mute{-webkit-transition:300ms -webkit-transform, 300ms opacity;transition:300ms transform, 300ms opacity}.control-button-container.volume-control svg{position:absolute;top:0;left:0}.volume-control-bar{position:absolute;z-index:2;bottom:38px;left:0px;display:block;height:112px;width:34px;border-radius:4px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.3);background-color:#333333;padding:6px;display:none}.volume-control-bar:before{position:absolute;width:34px;height:14px;bottom:-8px;left:0;content:' ';display:block}.volume-control-bar .bar{background-color:#424242;height:100%;position:relative;cursor:ns-resize}.volume-control-bar .progress{position:absolute;bottom:0px;left:0px;width:100%;border-radius:0 0 2px 2px;background-color:#01ACCD}.control-button-container.control-fullscreen .control-button{-webkit-transition:100ms -webkit-transform;transition:100ms transform;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.control-button-container.control-fullscreen .control-button .icon-minimize{display:none}.control-button-container.control-fullscreen .control-button:hover{-webkit-transform:scale(1.1);-ms-transform:scale(1.1);transform:scale(1.1)}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-maximize{display:none}.control-button-container.control-fullscreen .control-button.is-fullscreen .icon-minimize{display:block}.player .seek-bar{padding:6px 0;cursor:pointer}.player .seek-bar:hover .progress-bar .scrubber,.player .seek-bar.dragging-active .progress-bar .scrubber{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.player .seek-bar:hover .progress-bar .virtual-progress,.player .seek-bar.dragging-active .progress-bar .virtual-progress{display:block}.player .seek-bar .progress-bar{height:4px;background-color:rgba(255,255,255,0.3);border-radius:2px;position:relative}.player .seek-bar .progress-bar .progress{position:absolute;top:0;left:0;height:100%;z-index:2;border-radius:2px 0 0 2px;background-color:#01ACCD}.player .seek-bar .progress-bar .virtual-progress{display:none}.player .seek-bar .progress-bar .buffered,.player .seek-bar .progress-bar .virtual-progress{position:absolute;top:0;left:0;height:100%;z-index:1;border-radius:2px 0 0 2px;background-color:rgba(255,255,255,0.3)}.player .seek-bar .progress-bar .buffered .frame-preview-img,.player .seek-bar .progress-bar .virtual-progress .frame-preview-img{background-size:auto 100%;width:100%;height:100%;position:relative}.player .seek-bar .progress-bar .buffered .frame-preview,.player .seek-bar .progress-bar .virtual-progress .frame-preview{position:absolute;bottom:16px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:94px;width:164px;border:2px solid rgba(255,255,255,0.2);border-radius:4px}.player .seek-bar .progress-bar .buffered .time-preview,.player .seek-bar .progress-bar .virtual-progress .time-preview{position:absolute;bottom:22px;right:0;-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);height:22px;min-width:48px;padding:0 3px;text-align:center;border-radius:3px;background-color:rgba(0,0,0,0.7);font-size:13px;font-weight:bold;line-height:22px;color:#fff}.player .seek-bar .progress-bar .scrubber{position:absolute;z-index:3;cursor:pointer;display:block;top:-6px;right:-8px;border-radius:8px;height:16px;width:16px;background-color:#FFFFFF;box-shadow:0 0 31px 0 rgba(0,0,0,0.3);-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transition:100ms -webkit-transform;transition:100ms transform}.player .seek-bar .progress-bar .scrubber:active{opacity:1;cursor:-webkit-grabbing;cursor:grabbing}@media screen and (max-width: 480px){.virtual-progress{display:none}}.player .time-display{display:inline-block;line-height:32px;vertical-align:top;font-size:14px;padding:0 23px;font-weight:bold}@media screen and (max-width: 480px){.player .time-display{padding:0 12px 0 0}}.player .video-playing-title{font-size:15px;font-weight:bold;line-height:18px;padding:6px 0}.player .bottom-bar{position:absolute;bottom:0;left:0;width:100%;background:-webkit-linear-gradient(270deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:6px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .bottom-bar .left-controls{float:left;text-align:left}.player .bottom-bar .right-controls{float:right;text-align:left}.player .bottom-bar .right-controls .control-button-container{margin:0 6px}.player .bottom-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .bottom-bar,.player.hover .bottom-bar,.player.state-paused .bottom-bar,.player.menu-active .bottom-bar{opacity:1}.player.overlay-active .bottom-bar{opacity:0}@media screen and (max-width: 480px){.player .bottom-bar{padding:6px 8px}}.player .top-bar{position:absolute;top:0;left:0;width:100%;background:-webkit-linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.6) 100%);background:linear-gradient(0deg, transparent 0%, rgba(0,0,0,0.6) 100%);padding:14px 16px;color:#fff;opacity:0;-webkit-transition:100ms opacity;transition:100ms opacity}.player .top-bar .left-controls{float:left;text-align:left}.player .top-bar .right-controls{float:right;text-align:left}.player .top-bar .right-controls .control-button-container{margin:0 6px}.player .top-bar .right-controls .control-button-container:last-child{margin-right:0}.player:hover .top-bar,.player.hover .top-bar,.player.state-paused .top-bar,.player.menu-active .top-bar{opacity:1}.player.overlay-active .top-bar{opacity:0}@media screen and (max-width: 480px){.player .top-bar{padding:8px 8px 20px 8px}}@-webkit-keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}@keyframes overlayPlayIconIn{from{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:0;-webkit-transform:scale(1);transform:scale(1)}}.overlay-play{position:absolute;top:0;left:0;width:100%;height:100%}.overlay-play.in .icon{-webkit-animation:overlayPlayIconIn 400ms linear forwards;animation:overlayPlayIconIn 400ms linear forwards}.overlay-play .icon{width:144px;height:144px;fill:#fff;position:absolute;top:50%;left:50%;margin:-72px 0 0 -72px;opacity:0}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/css-loader!../node_modules/playkit-js-ui/src/styles/style.css\n// module id = 5\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/css-loader/lib/css-base.js\n// module id = 6\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tmemo[selector] = fn.call(this, selector);\n\t\t}\n\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n\t// tags it will allow on a page\n\tif (!options.singleton) options.singleton = isOldIE();\n\n\t// By default, add <style> tags to the <head> element\n\tif (!options.insertInto) options.insertInto = \"head\";\n\n\t// By default, add <style> tags to the bottom of the target\n\tif (!options.insertAt) options.insertAt = \"bottom\";\n\n\tvar styles = listToStyles(list, options);\n\n\taddStylesToDom(styles, options);\n\n\treturn function update (newList) {\n\t\tvar mayRemove = [];\n\n\t\tfor (var i = 0; i < styles.length; i++) {\n\t\t\tvar item = styles[i];\n\t\t\tvar domStyle = stylesInDom[item.id];\n\n\t\t\tdomStyle.refs--;\n\t\t\tmayRemove.push(domStyle);\n\t\t}\n\n\t\tif(newList) {\n\t\t\tvar newStyles = listToStyles(newList, options);\n\t\t\taddStylesToDom(newStyles, options);\n\t\t}\n\n\t\tfor (var i = 0; i < mayRemove.length; i++) {\n\t\t\tvar domStyle = mayRemove[i];\n\n\t\t\tif(domStyle.refs === 0) {\n\t\t\t\tfor (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();\n\n\t\t\t\tdelete stylesInDom[domStyle.id];\n\t\t\t}\n\t\t}\n\t};\n};\n\nfunction addStylesToDom (styles, options) {\n\tfor (var i = 0; i < styles.length; i++) {\n\t\tvar item = styles[i];\n\t\tvar domStyle = stylesInDom[item.id];\n\n\t\tif(domStyle) {\n\t\t\tdomStyle.refs++;\n\n\t\t\tfor(var j = 0; j < domStyle.parts.length; j++) {\n\t\t\t\tdomStyle.parts[j](item.parts[j]);\n\t\t\t}\n\n\t\t\tfor(; j < item.parts.length; j++) {\n\t\t\t\tdomStyle.parts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\t\t} else {\n\t\t\tvar parts = [];\n\n\t\t\tfor(var j = 0; j < item.parts.length; j++) {\n\t\t\t\tparts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\n\t\t\tstylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};\n\t\t}\n\t}\n}\n\nfunction listToStyles (list, options) {\n\tvar styles = [];\n\tvar newStyles = {};\n\n\tfor (var i = 0; i < list.length; i++) {\n\t\tvar item = list[i];\n\t\tvar id = options.base ? item[0] + options.base : item[0];\n\t\tvar css = item[1];\n\t\tvar media = item[2];\n\t\tvar sourceMap = item[3];\n\t\tvar part = {css: css, media: media, sourceMap: sourceMap};\n\n\t\tif(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});\n\t\telse newStyles[id].parts.push(part);\n\t}\n\n\treturn styles;\n}\n\nfunction insertStyleElement (options, style) {\n\tvar target = getElement(options.insertInto)\n\n\tif (!target) {\n\t\tthrow new Error(\"Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.\");\n\t}\n\n\tvar lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];\n\n\tif (options.insertAt === \"top\") {\n\t\tif (!lastStyleElementInsertedAtTop) {\n\t\t\ttarget.insertBefore(style, target.firstChild);\n\t\t} else if (lastStyleElementInsertedAtTop.nextSibling) {\n\t\t\ttarget.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);\n\t\t} else {\n\t\t\ttarget.appendChild(style);\n\t\t}\n\t\tstylesInsertedAtTop.push(style);\n\t} else if (options.insertAt === \"bottom\") {\n\t\ttarget.appendChild(style);\n\t} else {\n\t\tthrow new Error(\"Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.\");\n\t}\n}\n\nfunction removeStyleElement (style) {\n\tif (style.parentNode === null) return false;\n\tstyle.parentNode.removeChild(style);\n\n\tvar idx = stylesInsertedAtTop.indexOf(style);\n\tif(idx >= 0) {\n\t\tstylesInsertedAtTop.splice(idx, 1);\n\t}\n}\n\nfunction createStyleElement (options) {\n\tvar style = document.createElement(\"style\");\n\n\toptions.attrs.type = \"text/css\";\n\n\taddAttrs(style, options.attrs);\n\tinsertStyleElement(options, style);\n\n\treturn style;\n}\n\nfunction createLinkElement (options) {\n\tvar link = document.createElement(\"link\");\n\n\toptions.attrs.type = \"text/css\";\n\toptions.attrs.rel = \"stylesheet\";\n\n\taddAttrs(link, options.attrs);\n\tinsertStyleElement(options, link);\n\n\treturn link;\n}\n\nfunction addAttrs (el, attrs) {\n\tObject.keys(attrs).forEach(function (key) {\n\t\tel.setAttribute(key, attrs[key]);\n\t});\n}\n\nfunction addStyle (obj, options) {\n\tvar style, update, remove, result;\n\n\t// If a transform function was defined, run it on the css\n\tif (options.transform && obj.css) {\n\t result = options.transform(obj.css);\n\n\t if (result) {\n\t \t// If transform returns a value, use that instead of the original css.\n\t \t// This allows running runtime transformations on the css.\n\t \tobj.css = result;\n\t } else {\n\t \t// If the transform function returns a falsy value, don't add this css.\n\t \t// This allows conditional loading of css\n\t \treturn function() {\n\t \t\t// noop\n\t \t};\n\t }\n\t}\n\n\tif (options.singleton) {\n\t\tvar styleIndex = singletonCounter++;\n\n\t\tstyle = singleton || (singleton = createStyleElement(options));\n\n\t\tupdate = applyToSingletonTag.bind(null, style, styleIndex, false);\n\t\tremove = applyToSingletonTag.bind(null, style, styleIndex, true);\n\n\t} else if (\n\t\tobj.sourceMap &&\n\t\ttypeof URL === \"function\" &&\n\t\ttypeof URL.createObjectURL === \"function\" &&\n\t\ttypeof URL.revokeObjectURL === \"function\" &&\n\t\ttypeof Blob === \"function\" &&\n\t\ttypeof btoa === \"function\"\n\t) {\n\t\tstyle = createLinkElement(options);\n\t\tupdate = updateLink.bind(null, style, options);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\n\t\t\tif(style.href) URL.revokeObjectURL(style.href);\n\t\t};\n\t} else {\n\t\tstyle = createStyleElement(options);\n\t\tupdate = applyToTag.bind(null, style);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\t\t};\n\t}\n\n\tupdate(obj);\n\n\treturn function updateStyle (newObj) {\n\t\tif (newObj) {\n\t\t\tif (\n\t\t\t\tnewObj.css === obj.css &&\n\t\t\t\tnewObj.media === obj.media &&\n\t\t\t\tnewObj.sourceMap === obj.sourceMap\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdate(obj = newObj);\n\t\t} else {\n\t\t\tremove();\n\t\t}\n\t};\n}\n\nvar replaceText = (function () {\n\tvar textStore = [];\n\n\treturn function (index, replacement) {\n\t\ttextStore[index] = replacement;\n\n\t\treturn textStore.filter(Boolean).join('\\n');\n\t};\n})();\n\nfunction applyToSingletonTag (style, index, remove, obj) {\n\tvar css = remove ? \"\" : obj.css;\n\n\tif (style.styleSheet) {\n\t\tstyle.styleSheet.cssText = replaceText(index, css);\n\t} else {\n\t\tvar cssNode = document.createTextNode(css);\n\t\tvar childNodes = style.childNodes;\n\n\t\tif (childNodes[index]) style.removeChild(childNodes[index]);\n\n\t\tif (childNodes.length) {\n\t\t\tstyle.insertBefore(cssNode, childNodes[index]);\n\t\t} else {\n\t\t\tstyle.appendChild(cssNode);\n\t\t}\n\t}\n}\n\nfunction applyToTag (style, obj) {\n\tvar css = obj.css;\n\tvar media = obj.media;\n\n\tif(media) {\n\t\tstyle.setAttribute(\"media\", media)\n\t}\n\n\tif(style.styleSheet) {\n\t\tstyle.styleSheet.cssText = css;\n\t} else {\n\t\twhile(style.firstChild) {\n\t\t\tstyle.removeChild(style.firstChild);\n\t\t}\n\n\t\tstyle.appendChild(document.createTextNode(css));\n\t}\n}\n\nfunction updateLink (link, options, obj) {\n\tvar css = obj.css;\n\tvar sourceMap = obj.sourceMap;\n\n\t/*\n\t\tIf convertToAbsoluteUrls isn't defined, but sourcemaps are enabled\n\t\tand there is no publicPath defined then lets turn convertToAbsoluteUrls\n\t\ton by default. Otherwise default to the convertToAbsoluteUrls option\n\t\tdirectly\n\t*/\n\tvar autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;\n\n\tif (options.convertToAbsoluteUrls || autoFixUrls) {\n\t\tcss = fixUrls(css);\n\t}\n\n\tif (sourceMap) {\n\t\t// http://stackoverflow.com/a/26603875\n\t\tcss += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\n\t}\n\n\tvar blob = new Blob([css], { type: \"text/css\" });\n\n\tvar oldSrc = link.href;\n\n\tlink.href = URL.createObjectURL(blob);\n\n\tif(oldSrc) URL.revokeObjectURL(oldSrc);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/style-loader/lib/addStyles.js\n// module id = 7\n// module chunks = 0","\n/**\n * When source maps are enabled, `style-loader` uses a link element with a data-uri to\n * embed the css on the page. This breaks all relative urls because now they are relative to a\n * bundle instead of the current page.\n *\n * One solution is to only use full urls, but that may be impossible.\n *\n * Instead, this function \"fixes\" the relative urls to be absolute according to the current page location.\n *\n * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.\n *\n */\n\nmodule.exports = function (css) {\n // get current location\n var location = typeof window !== \"undefined\" && window.location;\n\n if (!location) {\n throw new Error(\"fixUrls requires window.location\");\n }\n\n\t// blank or null?\n\tif (!css || typeof css !== \"string\") {\n\t return css;\n }\n\n var baseUrl = location.protocol + \"//\" + location.host;\n var currentDir = baseUrl + location.pathname.replace(/\\/[^\\/]*$/, \"/\");\n\n\t// convert each url(...)\n\t/*\n\tThis regular expression is just a way to recursively match brackets within\n\ta string.\n\n\t /url\\s*\\( = Match on the word \"url\" with any whitespace after it and then a parens\n\t ( = Start a capturing group\n\t (?: = Start a non-capturing group\n\t [^)(] = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t (?: = Start another non-capturing groups\n\t [^)(]+ = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t [^)(]* = Match anything that isn't a parentheses\n\t \\) = Match a end parentheses\n\t ) = End Group\n *\\) = Match anything and then a close parens\n ) = Close non-capturing group\n * = Match anything\n ) = Close capturing group\n\t \\) = Match a close parens\n\n\t /gi = Get all matches, not the first. Be case insensitive.\n\t */\n\tvar fixedCss = css.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi, function(fullMatch, origUrl) {\n\t\t// strip quotes (if they exist)\n\t\tvar unquotedOrigUrl = origUrl\n\t\t\t.trim()\n\t\t\t.replace(/^\"(.*)\"$/, function(o, $1){ return $1; })\n\t\t\t.replace(/^'(.*)'$/, function(o, $1){ return $1; });\n\n\t\t// already a full url? no change\n\t\tif (/^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/)/i.test(unquotedOrigUrl)) {\n\t\t return fullMatch;\n\t\t}\n\n\t\t// convert the url to a full url\n\t\tvar newUrl;\n\n\t\tif (unquotedOrigUrl.indexOf(\"//\") === 0) {\n\t\t \t//TODO: should we add protocol?\n\t\t\tnewUrl = unquotedOrigUrl;\n\t\t} else if (unquotedOrigUrl.indexOf(\"/\") === 0) {\n\t\t\t// path should be relative to the base url\n\t\t\tnewUrl = baseUrl + unquotedOrigUrl; // already starts with '/'\n\t\t} else {\n\t\t\t// path should be relative to current directory\n\t\t\tnewUrl = currentDir + unquotedOrigUrl.replace(/^\\.\\//, \"\"); // Strip leading './'\n\t\t}\n\n\t\t// send back the fixed url(...)\n\t\treturn \"url(\" + JSON.stringify(newUrl) + \")\";\n\t});\n\n\t// send back the fixed css\n\treturn fixedCss;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/style-loader/lib/urls.js\n// module id = 8\n// module chunks = 0","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"hls.js\"), require(\"playkit-js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"hls.js\", \"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsHls\"] = factory(require(\"hls.js\"), require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsHls\"] = factory(root[\"Hls\"], root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///hls/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 971dbcb0968c12c8d961\n\n\n// WEBPACK FOOTER //\n// webpack:/hls/webpack/bootstrap 971dbcb0968c12c8d961","//@flow\nimport Hlsjs from 'hls.js'\nimport {registerMediaSourceAdapter, BaseMediaSourceAdapter} from 'playkit-js'\nimport {Track, VideoTrack, AudioTrack, TextTrack} from 'playkit-js'\n\n/**\n * Adapter of hls.js lib for hls content\n * @classdesc\n */\nexport default class HlsAdapter extends BaseMediaSourceAdapter {\n /**\n * The id of the adapter.\n * @member {string} id\n * @static\n * @private\n */\n static id: string = 'HlsAdapter';\n /**\n * The adapter logger.\n * @member {any} _logger\n * @static\n * @private\n */\n static _logger = BaseMediaSourceAdapter.getLogger(HlsAdapter.id);\n /**\n * The supported mime types by the hls adapter.\n * @member {Array<string>} _hlsMimeType\n * @static\n * @private\n */\n static _hlsMimeTypes: Array<string> = [\n 'application/x-mpegurl',\n 'application/vnd.apple.mpegurl',\n 'audio/mpegurl',\n 'audio/x-mpegurl',\n 'video/x-mpegurl',\n 'video/mpegurl',\n 'application/mpegurl'\n ];\n /**\n * The hls player instance.\n * @member {any} _hls\n * @private\n */\n _hls: any;\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n _loadPromise: ?Promise<Object>;\n /**\n * Reference to the player tracks.\n * @member {Array<Track>} - _playerTracks\n * @type {Array<Track>}\n * @private\n */\n _playerTracks: Array<Track>;\n\n /**\n * Checks if hls adapter can play a given mime type.\n * @function canPlayType\n * @param {string} mimeType - The mime type to check.\n * @returns {boolean} - Whether the hls adapter can play a specific mime type.\n * @static\n */\n static canPlayType(mimeType: string): boolean {\n let canHlsPlayType = (typeof mimeType === 'string') ? HlsAdapter._hlsMimeTypes.includes(mimeType.toLowerCase()) : false;\n HlsAdapter._logger.debug('canPlayType result for mimeType:' + mimeType + ' is ' + canHlsPlayType.toString());\n return canHlsPlayType;\n }\n\n /**\n * Checks if the hls adapter is supported.\n * @function isSupported\n * @returns {boolean} - Whether hls is supported.\n * @static\n */\n static isSupported(): boolean {\n let isHlsSupported = Hlsjs.isSupported();\n HlsAdapter._logger.debug('isSupported:' + isHlsSupported);\n return isHlsSupported;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which will bind to the hls adapter\n * @param {Object} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n constructor(videoElement: HTMLVideoElement, source: Source, config: Object) {\n HlsAdapter._logger.debug('Creating adapter. Hls version: ' + Hlsjs.version);\n super(videoElement, source, config);\n this._hls = new Hlsjs(this._config);\n this._addBindings();\n }\n\n /**\n * Adds the required bindings with hls.js.\n * @function _addBindings\n * @private\n * @returns {void}\n */\n _addBindings(): void {\n this._hls.on(Hlsjs.Events.ERROR, this._onError.bind(this));\n this._hls.on(Hlsjs.Events.LEVEL_SWITCHED, this._onLevelSwitched.bind(this));\n this._hls.on(Hlsjs.Events.AUDIO_TRACK_SWITCHED, this._onAudioTrackSwitched.bind(this));\n }\n\n /**\n * Load the video source\n * @function load\n * @returns {Promise<Object>} - The loaded data\n * @override\n */\n load(): Promise<Object> {\n if (!this._loadPromise) {\n this._loadPromise = new Promise((resolve) => {\n this._hls.on(Hlsjs.Events.MANIFEST_LOADED, (event: string, data: any) => {\n HlsAdapter._logger.debug('The source has been loaded successfully');\n this._playerTracks = this._parseTracks(data);\n resolve({tracks: this._playerTracks});\n });\n if (this._sourceObj && this._sourceObj.url) {\n this._hls.loadSource(this._sourceObj.url);\n this._hls.attachMedia(this._videoElement);\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroying the hls adapter.\n * @function destroy\n * @override\n */\n destroy(): void {\n HlsAdapter._logger.debug('destroy');\n super.destroy();\n this._loadPromise = null;\n this._removeBindings();\n this._hls.detachMedia();\n this._hls.destroy();\n }\n\n /**\n * Parse the hls tracks into player tracks.\n * @param {any} data - The event data.\n * @returns {Array<Track>} - The parsed tracks.\n * @private\n */\n _parseTracks(data: any): Array<Track> {\n let audioTracks = this._parseAudioTracks(data.audioTracks || []);\n let videoTracks = this._parseVideoTracks(data.levels || []);\n let textTracks = this._parseTextTracks(this._videoElement.textTracks || []);\n return audioTracks.concat(videoTracks).concat(textTracks);\n }\n\n /**\n * Parse hls audio tracks into player audio tracks.\n * @param {Array<Object>} hlsAudioTracks - The hls audio tracks.\n * @returns {Array<AudioTrack>} - The parsed audio tracks.\n * @private\n */\n _parseAudioTracks(hlsAudioTracks: Array<Object>): Array<AudioTrack> {\n let audioTracks = [];\n for (let i = 0; i < hlsAudioTracks.length; i++) {\n // Create audio tracks\n let settings = {\n id: hlsAudioTracks[i].id,\n active: this._hls.audioTrack === hlsAudioTracks[i].id,\n label: hlsAudioTracks[i].name,\n language: hlsAudioTracks[i].lang,\n index: i\n };\n audioTracks.push(new AudioTrack(settings));\n }\n return audioTracks;\n }\n\n /**\n * Parse hls video tracks into player video tracks.\n * @param {Array<Object>} hlsVideoTracks - The hls video tracks.\n * @returns {Array<VideoTrack>} - The parsed video tracks.\n * @private\n */\n _parseVideoTracks(hlsVideoTracks: Array<Object>): Array<VideoTrack> {\n let videoTracks = [];\n for (let i = 0; i < hlsVideoTracks.length; i++) {\n // Create video tracks\n let settings = {\n active: this._hls.startLevel === i,\n label: hlsVideoTracks[i].name,\n bandwidth: hlsVideoTracks[i].bitrate,\n language: '',\n index: i\n };\n videoTracks.push(new VideoTrack(settings));\n }\n return videoTracks;\n }\n\n /**\n * Parse native video tag text tracks into player text tracks.\n * @param {TextTrackList} vidTextTracks - The native video tag text tracks.\n * @returns {Array<TextTrack>} - The parsed text tracks.\n * @private\n */\n _parseTextTracks(vidTextTracks: TextTrackList | Array<Object>): Array<TextTrack> {\n let textTracks = [];\n for (let i = 0; i < vidTextTracks.length; i++) {\n // Create text tracks\n let settings = {\n active: vidTextTracks[i].mode === 'showing',\n label: vidTextTracks[i].label,\n kind: vidTextTracks[i].kind,\n language: vidTextTracks[i].language,\n index: i\n };\n textTracks.push(new TextTrack(settings));\n }\n return textTracks;\n }\n\n /**\n * Select an audio track.\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select.\n * @returns {void}\n * @public\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n if (audioTrack instanceof AudioTrack && !audioTrack.active && this._hls.audioTracks) {\n this._hls.audioTrack = audioTrack.id;\n }\n }\n\n /**\n * Select a video track.\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the track to select.\n * @returns {void}\n * @public\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n if (videoTrack instanceof VideoTrack && (!videoTrack.active || this._hls.autoLevelEnabled) && this._hls.levels) {\n this._hls.nextLevel = videoTrack.index;\n }\n }\n\n /**\n * Select a text track.\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select.\n * @returns {void}\n * @public\n */\n selectTextTrack(textTrack: TextTrack): void {\n if (textTrack instanceof TextTrack && !textTrack.active && this._videoElement.textTracks) {\n this._disableAllTextTracks();\n this._videoElement.textTracks[textTrack.index].mode = 'showing';\n HlsAdapter._logger.debug('Text track changed', textTrack);\n this._onTrackChanged(textTrack);\n }\n }\n\n /** Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n hideTextTrack(): void {\n this._disableAllTextTracks();\n }\n\n /**\n * Enables adaptive bitrate switching according to hls.js logic.\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n this._hls.nextLevel = -1;\n }\n\n /**\n * Triggers on video track selection (auto or manually) the 'videotrackchanged' event forward.\n * @function _onLevelSwitched\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n _onLevelSwitched(event: string, data: any): void {\n let videoTrack = this._playerTracks.find((track) => {\n return (track instanceof VideoTrack && track.index === data.level);\n });\n HlsAdapter._logger.debug('Video track changed', videoTrack);\n this._onTrackChanged(videoTrack);\n }\n\n /**\n * Triggers on audio track selection (auto or manually) the 'audiotrackchanged' event forward.\n * @function _onAudioTrackSwitched\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n _onAudioTrackSwitched(event: string, data: any): void {\n let audioTrack = this._playerTracks.find((track) => {\n return (track instanceof AudioTrack && track.id === data.id);\n });\n HlsAdapter._logger.debug('Audio track changed', audioTrack);\n this._onTrackChanged(audioTrack);\n }\n\n /**\n * Disables all the video tag text tracks.\n * @returns {void}\n * @private\n */\n _disableAllTextTracks() {\n let vidTextTracks = this._videoElement.textTracks;\n for (let i = 0; i < vidTextTracks.length; i++) {\n vidTextTracks[i].mode = 'hidden';\n }\n }\n\n /**\n * Handles hls errors.\n * @param {string} event - The event name.\n * @param {any} data - The event data object.\n * @private\n * @returns {void}\n */\n _onError(event: string, data: any): void {\n let errorType = data.type;\n let errorDetails = data.details;\n let errorFatal = data.fatal;\n if (errorFatal) {\n switch (errorType) {\n case Hlsjs.ErrorTypes.NETWORK_ERROR:\n HlsAdapter._logger.error(\"fatal network error encountered, try to recover\");\n this._hls.startLoad();\n break;\n case Hlsjs.ErrorTypes.MEDIA_ERROR:\n HlsAdapter._logger.error(\"fatal media error encountered, try to recover\");\n this._hls.recoverMediaError();\n break;\n default:\n HlsAdapter._logger.error(\"fatal error, cannot recover\");\n this.destroy();\n break;\n }\n } else {\n switch (errorDetails) {\n case Hlsjs.ErrorDetails.MANIFEST_LOAD_ERROR:\n case Hlsjs.ErrorDetails.MANIFEST_LOAD_TIMEOUT:\n case Hlsjs.ErrorDetails.MANIFEST_PARSING_ERROR:\n case Hlsjs.ErrorDetails.LEVEL_LOAD_ERROR:\n case Hlsjs.ErrorDetails.LEVEL_LOAD_TIMEOUT:\n case Hlsjs.ErrorDetails.LEVEL_SWITCH_ERROR:\n case Hlsjs.ErrorDetails.FRAG_LOAD_ERROR:\n case Hlsjs.ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case Hlsjs.ErrorDetails.FRAG_LOAD_TIMEOUT:\n case Hlsjs.ErrorDetails.FRAG_PARSING_ERROR:\n case Hlsjs.ErrorDetails.BUFFER_APPEND_ERROR:\n case Hlsjs.ErrorDetails.BUFFER_APPENDING_ERROR:\n HlsAdapter._logger.error(errorType, errorDetails);\n break;\n default:\n break;\n }\n }\n }\n\n /**\n * Removes hls.js bindings.\n * @returns {void}\n * @private\n */\n _removeBindings(): void {\n this._hls.off(Hlsjs.Events.ERROR, this._onError);\n this._hls.off(Hlsjs.Events.LEVEL_SWITCHED, this._onLevelSwitched);\n this._hls.off(Hlsjs.Events.AUDIO_TRACK_SWITCHED, this._onAudioTrackSwitched);\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * In case the adapter preformed a load it will return the manifest url.\n * @public\n * @returns {string} - The src url.\n */\n get src(): string {\n if (this._loadPromise && this._sourceObj) {\n return this._sourceObj.url;\n }\n return \"\";\n }\n}\n\n// Register hls adapter to the media source adapter provider.\nif (HlsAdapter.isSupported()) {\n registerMediaSourceAdapter(HlsAdapter);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./hls-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///hls/hls-adapter.js","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"hls.js\",\"commonjs2\":\"hls.js\",\"amd\":\"hls.js\",\"root\":\"Hls\"}\n// module id = 1\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/hls/external {\"commonjs\":\"hls.js\",\"commonjs2\":\"hls.js\",\"amd\":\"hls.js\",\"root\":\"Hls\"}","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}\n// module id = 2\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/hls/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","(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})\n\n\n// WEBPACK FOOTER //\n// node_modules/browser-pack/_prelude.js","// 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 } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\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\n\n// WEBPACK FOOTER //\n// node_modules/events/events.js","// see https://tools.ietf.org/html/rfc1808\r\n\r\n/* jshint ignore:start */\r\n(function(root) { \r\n/* jshint ignore:end */\r\n\r\n var URL_REGEX = /^((?:[^\\/;?#]+:)?)(\\/\\/[^\\/\\;?#]*)?(.*?)??(;.*?)?(\\?.*?)?(#.*?)?$/;\r\n var FIRST_SEGMENT_REGEX = /^([^\\/;?#]*)(.*)$/;\r\n var SLASH_DOT_REGEX = /(?:\\/|^)\\.(?=\\/)/g;\r\n var SLASH_DOT_DOT_REGEX = /(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/).*?(?=\\/)/g;\r\n\r\n var URLToolkit = { // jshint ignore:line\r\n // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //\r\n // E.g\r\n // With opts.alwaysNormalize = false (default, spec compliant)\r\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g\r\n // With opts.alwaysNormalize = true (default, not spec compliant)\r\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/g\r\n buildAbsoluteURL: function(baseURL, relativeURL, opts) {\r\n opts = opts || {};\r\n // remove any remaining space and CRLF\r\n baseURL = baseURL.trim();\r\n relativeURL = relativeURL.trim();\r\n if (!relativeURL) {\r\n // 2a) If the embedded URL is entirely empty, it inherits the\r\n // entire base URL (i.e., is set equal to the base URL)\r\n // and we are done.\r\n if (!opts.alwaysNormalize) {\r\n return baseURL;\r\n }\r\n var basePartsForNormalise = this.parseURL(baseURL);\r\n if (!baseParts) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n basePartsForNormalise.path = URLToolkit.normalizePath(basePartsForNormalise.path);\r\n return URLToolkit.buildURLFromParts(basePartsForNormalise);\r\n }\r\n var relativeParts = this.parseURL(relativeURL);\r\n if (!relativeParts) {\r\n throw new Error('Error trying to parse relative URL.');\r\n }\r\n if (relativeParts.scheme) {\r\n // 2b) If the embedded URL starts with a scheme name, it is\r\n // interpreted as an absolute URL and we are done.\r\n if (!opts.alwaysNormalize) {\r\n return relativeURL;\r\n }\r\n relativeParts.path = URLToolkit.normalizePath(relativeParts.path);\r\n return URLToolkit.buildURLFromParts(relativeParts);\r\n }\r\n var baseParts = this.parseURL(baseURL);\r\n if (!baseParts) {\r\n throw new Error('Error trying to parse base URL.');\r\n }\r\n if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== '/') {\r\n // If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc\r\n // This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'\r\n var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);\r\n baseParts.netLoc = pathParts[1];\r\n baseParts.path = pathParts[2];\r\n }\r\n if (baseParts.netLoc && !baseParts.path) {\r\n baseParts.path = '/';\r\n }\r\n var builtParts = {\r\n // 2c) Otherwise, the embedded URL inherits the scheme of\r\n // the base URL.\r\n scheme: baseParts.scheme,\r\n netLoc: relativeParts.netLoc,\r\n path: null,\r\n params: relativeParts.params,\r\n query: relativeParts.query,\r\n fragment: relativeParts.fragment\r\n };\r\n if (!relativeParts.netLoc) {\r\n // 3) If the embedded URL's <net_loc> is non-empty, we skip to\r\n // Step 7. Otherwise, the embedded URL inherits the <net_loc>\r\n // (if any) of the base URL.\r\n builtParts.netLoc = baseParts.netLoc;\r\n // 4) If the embedded URL path is preceded by a slash \"/\", the\r\n // path is not relative and we skip to Step 7.\r\n if (relativeParts.path[0] !== '/') {\r\n if (!relativeParts.path) {\r\n // 5) If the embedded URL path is empty (and not preceded by a\r\n // slash), then the embedded URL inherits the base URL path\r\n builtParts.path = baseParts.path;\r\n // 5a) if the embedded URL's <params> is non-empty, we skip to\r\n // step 7; otherwise, it inherits the <params> of the base\r\n // URL (if any) and\r\n if (!relativeParts.params) {\r\n builtParts.params = baseParts.params;\r\n // 5b) if the embedded URL's <query> is non-empty, we skip to\r\n // step 7; otherwise, it inherits the <query> of the base\r\n // URL (if any) and we skip to step 7.\r\n if (!relativeParts.query) {\r\n builtParts.query = baseParts.query;\r\n }\r\n }\r\n } else {\r\n // 6) The last segment of the base URL's path (anything\r\n // following the rightmost slash \"/\", or the entire path if no\r\n // slash is present) is removed and the embedded URL's path is\r\n // appended in its place.\r\n var baseURLPath = baseParts.path;\r\n var newPath = baseURLPath.substring(0, baseURLPath.lastIndexOf('/') + 1) + relativeParts.path;\r\n builtParts.path = URLToolkit.normalizePath(newPath);\r\n }\r\n }\r\n }\r\n if (builtParts.path === null) {\r\n builtParts.path = opts.alwaysNormalize ? URLToolkit.normalizePath(relativeParts.path) : relativeParts.path;\r\n }\r\n return URLToolkit.buildURLFromParts(builtParts);\r\n },\r\n parseURL: function(url) {\r\n var parts = URL_REGEX.exec(url);\r\n if (!parts) {\r\n return null;\r\n }\r\n return {\r\n scheme: parts[1] || '',\r\n netLoc: parts[2] || '',\r\n path: parts[3] || '',\r\n params: parts[4] || '',\r\n query: parts[5] || '',\r\n fragment: parts[6] || ''\r\n };\r\n },\r\n normalizePath: function(path) {\r\n // The following operations are\r\n // then applied, in order, to the new path:\r\n // 6a) All occurrences of \"./\", where \".\" is a complete path\r\n // segment, are removed.\r\n // 6b) If the path ends with \".\" as a complete path segment,\r\n // that \".\" is removed.\r\n path = path.split('').reverse().join('').replace(SLASH_DOT_REGEX, '');\r\n // 6c) All occurrences of \"<segment>/../\", where <segment> is a\r\n // complete path segment not equal to \"..\", are removed.\r\n // Removal of these path segments is performed iteratively,\r\n // removing the leftmost matching pattern on each iteration,\r\n // until no matching pattern remains.\r\n // 6d) If the path ends with \"<segment>/..\", where <segment> is a\r\n // complete path segment not equal to \"..\", that\r\n // \"<segment>/..\" is removed.\r\n while (path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, '')).length) {} // jshint ignore:line\r\n return path.split('').reverse().join('');\r\n },\r\n buildURLFromParts: function(parts) {\r\n return parts.scheme + parts.netLoc + parts.path + parts.params + parts.query + parts.fragment;\r\n }\r\n };\r\n\r\n/* jshint ignore:start */\r\n if(typeof exports === 'object' && typeof module === 'object')\r\n module.exports = URLToolkit;\r\n else if(typeof define === 'function' && define.amd)\r\n define([], function() { return URLToolkit; });\r\n else if(typeof exports === 'object')\r\n exports[\"URLToolkit\"] = URLToolkit;\r\n else\r\n root[\"URLToolkit\"] = URLToolkit;\r\n})(this);\r\n/* jshint ignore:end */\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/url-toolkit/src/url-toolkit.js","var 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\n\n// WEBPACK FOOTER //\n// node_modules/webworkify/index.js","/**\n * HLS config\n */\n'use strict';\n\nimport AbrController from './controller/abr-controller';\nimport BufferController from './controller/buffer-controller';\nimport CapLevelController from './controller/cap-level-controller';\nimport FPSController from './controller/fps-controller';\nimport XhrLoader from './utils/xhr-loader';\n//import FetchLoader from './utils/fetch-loader';\n//#if altaudio\nimport AudioTrackController from './controller/audio-track-controller';\nimport AudioStreamController from './controller/audio-stream-controller';\n//#endif\n\n//#if subtitle\nimport Cues from './utils/cues';\nimport TimelineController from './controller/timeline-controller';\nimport SubtitleTrackController from './controller/subtitle-track-controller';\nimport SubtitleStreamController from './controller/subtitle-stream-controller';\n//#endif\n\nexport var hlsDefaultConfig = {\n autoStartLoad: true, // used by stream-controller\n startPosition: -1, // used by stream-controller\n defaultAudioCodec: undefined, // used by stream-controller\n debug: false, // used by logger\n capLevelOnFPSDrop: false, // used by fps-controller\n capLevelToPlayerSize: false, // used by cap-level-controller\n initialLiveManifestSize: 1, // used by stream-controller\n maxBufferLength: 30, // used by stream-controller\n maxBufferSize: 60 * 1000 * 1000, // used by stream-controller\n maxBufferHole: 0.5, // used by stream-controller\n maxSeekHole: 2, // used by stream-controller\n lowBufferWatchdogPeriod: 0.5, // used by stream-controller\n highBufferWatchdogPeriod: 3, // used by stream-controller\n nudgeOffset: 0.1, // used by stream-controller\n nudgeMaxRetry : 3, // used by stream-controller\n maxFragLookUpTolerance: 0.25, // used by stream-controller\n liveSyncDurationCount:3, // used by stream-controller\n liveMaxLatencyDurationCount: Infinity, // used by stream-controller\n liveSyncDuration: undefined, // used by stream-controller\n liveMaxLatencyDuration: undefined, // used by stream-controller\n maxMaxBufferLength: 600, // used by stream-controller\n enableWorker: true, // used by demuxer\n enableSoftwareAES: true, // used by decrypter\n manifestLoadingTimeOut: 10000, // used by playlist-loader\n manifestLoadingMaxRetry: 1, // used by playlist-loader\n manifestLoadingRetryDelay: 1000, // used by playlist-loader\n manifestLoadingMaxRetryTimeout: 64000, // used by playlist-loader\n startLevel: undefined, // used by level-controller\n levelLoadingTimeOut: 10000, // used by playlist-loader\n levelLoadingMaxRetry: 4, // used by playlist-loader\n levelLoadingRetryDelay: 1000, // used by playlist-loader\n levelLoadingMaxRetryTimeout: 64000, // used by playlist-loader\n fragLoadingTimeOut: 20000, // used by fragment-loader\n fragLoadingMaxRetry: 6, // used by fragment-loader\n fragLoadingRetryDelay: 1000, // used by fragment-loader\n fragLoadingMaxRetryTimeout: 64000, // used by fragment-loader\n fragLoadingLoopThreshold: 3, // used by stream-controller\n startFragPrefetch: false, // used by stream-controller\n fpsDroppedMonitoringPeriod: 5000, // used by fps-controller\n fpsDroppedMonitoringThreshold: 0.2, // used by fps-controller\n appendErrorMaxRetry: 3, // used by buffer-controller\n loader: XhrLoader,\n //loader: FetchLoader,\n fLoader: undefined,\n pLoader: undefined,\n xhrSetup: undefined,\n fetchSetup: undefined,\n abrController: AbrController,\n bufferController: BufferController,\n capLevelController: CapLevelController,\n fpsController: FPSController,\n//#if altaudio\n audioStreamController: AudioStreamController,\n audioTrackController : AudioTrackController,\n//#endif\n//#if subtitle\n subtitleStreamController: SubtitleStreamController,\n subtitleTrackController: SubtitleTrackController,\n timelineController: TimelineController,\n cueHandler: Cues,\n enableCEA708Captions: true, // used by timeline-controller\n enableWebVTT: true, // used by timeline-controller\n captionsTextTrack1Label: 'English', // used by timeline-controller\n captionsTextTrack1LanguageCode: 'en', // used by timeline-controller\n captionsTextTrack2Label: 'Spanish', // used by timeline-controller\n captionsTextTrack2LanguageCode: 'es', // used by timeline-controller\n//#endif\n stretchShortVideoTrack: false, // used by mp4-remuxer\n forceKeyFrameOnDiscontinuity: true, // used by ts-demuxer\n abrEwmaFastLive: 3, // used by abr-controller\n abrEwmaSlowLive: 9, // used by abr-controller\n abrEwmaFastVoD: 3, // used by abr-controller\n abrEwmaSlowVoD: 9, // used by abr-controller\n abrEwmaDefaultEstimate: 5e5, // 500 kbps // used by abr-controller\n abrBandWidthFactor : 0.95, // used by abr-controller\n abrBandWidthUpFactor : 0.7, // used by abr-controller\n abrMaxWithRealBitrate : false, // used by abr-controller\n maxStarvationDelay : 4, // used by abr-controller\n maxLoadingDelay : 4, // used by abr-controller\n minAutoBitrate: 0 // used by hls\n };\n\n\n\n// WEBPACK FOOTER //\n// src/config.js","/*\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\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport BufferHelper from '../helper/buffer-helper';\nimport {ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\nimport EwmaBandWidthEstimator from '../utils/ewma-bandwidth-estimator';\n\nclass AbrController extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.FRAG_LOADING,\n Event.FRAG_LOADED,\n Event.FRAG_BUFFERED,\n Event.ERROR);\n this.lastLoadedFragLevel = 0;\n this._nextAutoLevel = -1;\n this.hls = hls;\n this.timer = null;\n this._bwEstimator = null;\n this.onCheck = this._abandonRulesCheck.bind(this);\n }\n\n destroy() {\n this.clearTimer();\n EventHandler.prototype.destroy.call(this);\n }\n\n onFragLoading(data) {\n let 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 let hls = this.hls,\n level = data.frag.level,\n isLive = hls.levels[level].details.live,\n config = hls.config,\n ewmaFast, ewmaSlow;\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 EwmaBandWidthEstimator(hls,ewmaSlow,ewmaFast,config.abrEwmaDefaultEstimate);\n }\n this.fragCurrent = frag;\n }\n }\n\n _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 let hls = this.hls, v = hls.media,frag = this.fragCurrent, loader = frag.loader, minAutoLevel = hls.minAutoLevel;\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.warn('frag loader destroy or aborted, disarm abandonRules');\n this.clearTimer();\n return;\n }\n let 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 let 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 let levels = hls.levels,\n 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\n // compute expected fragment length using frag duration and level bitrate. also ensure that expected len is gte than already loaded size\n level = levels[frag.level],\n levelBitrate = level.realBitrate ? Math.max(level.realBitrate,level.bitrate) : level.bitrate,\n expectedLen = stats.total ? stats.total : Math.max(stats.loaded, Math.round(frag.duration * levelBitrate / 8)),\n pos = v.currentTime,\n fragLoadedDelay = (expectedLen - stats.loaded) / loadRate,\n bufferStarvationDelay = (BufferHelper.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 let fragLevelNextLoadedDelay, nextLoadLevel;\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 > minAutoLevel ; 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 let levelNextBitrate = levels[nextLoadLevel].realBitrate ? Math.max(levels[nextLoadLevel].realBitrate,levels[nextLoadLevel].bitrate) : levels[nextLoadLevel].bitrate;\n fragLevelNextLoadedDelay = frag.duration * levelNextBitrate / (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 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(Event.FRAG_LOAD_EMERGENCY_ABORTED, {frag: frag, stats: stats });\n }\n }\n }\n }\n }\n\n onFragLoaded(data) {\n let frag = data.frag;\n if (frag.type === 'main' && !isNaN(frag.sn)) {\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\n // compute level average bitrate\n if (this.hls.config.abrMaxWithRealBitrate) {\n const level = this.hls.levels[frag.level];\n let loadedBytes = (level.loaded ? level.loaded.bytes : 0) + data.stats.loaded;\n let loadedDuration = (level.loaded ? level.loaded.duration : 0) + data.frag.duration;\n level.loaded = { bytes : loadedBytes, duration : loadedDuration };\n level.realBitrate = Math.round(8*loadedBytes/loadedDuration);\n }\n // if fragment has been loaded to perform a bitrate test,\n if (data.frag.bitrateTest) {\n let stats = data.stats;\n stats.tparsed = stats.tbuffered = stats.tload;\n this.onFragBuffered(data);\n }\n }\n }\n\n onFragBuffered(data) {\n var stats = data.stats, 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' && !isNaN(frag.sn) && ((!frag.bitrateTest || stats.tload === stats.tbuffered))) {\n // use tparsed-trequest instead of tbuffered-trequest to compute fragLoadingProcessing; rationale is that buffer appending only happens once media is attached\n // 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\n // as a consequence it could happen really late in the process. meaning that appending duration might appears huge ... leading to underestimated throughput estimation\n let fragLoadingProcessingMs = stats.tparsed - stats.trequest;\n 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 stats.bwEstimate = this._bwEstimator.getEstimate();\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 onError(data) {\n // stop timer in case of frag loading error\n switch(data.details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n this.clearTimer();\n break;\n default:\n break;\n }\n }\n\n clearTimer() {\n clearInterval(this.timer);\n this.timer = null;\n }\n\n // return next auto level\n get nextAutoLevel() {\n const forcedAutoLevel = this._nextAutoLevel;\n const bwEstimator = this._bwEstimator;\n // in case next auto level has been forced, and bw not available or not reliable, return forced value\n if (forcedAutoLevel !== -1 && (!bwEstimator || !bwEstimator.canEstimate())) {\n return forcedAutoLevel;\n }\n // compute next level using ABR logic\n let nextABRAutoLevel = this._nextABRAutoLevel;\n // if forced auto level has been defined, use it to cap ABR computed quality level\n if (forcedAutoLevel !== -1) {\n nextABRAutoLevel = Math.min(forcedAutoLevel,nextABRAutoLevel);\n }\n return nextABRAutoLevel;\n }\n get _nextABRAutoLevel() {\n var hls = this.hls, maxAutoLevel = hls.maxAutoLevel, levels = hls.levels, config = hls.config, minAutoLevel = hls.minAutoLevel;\n const v = hls.media,\n currentLevel = this.lastLoadedFragLevel,\n currentFragDuration = this.fragCurrent ? this.fragCurrent.duration : 0,\n pos = (v ? v.currentTime : 0),\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 // bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.\n bufferStarvationDelay = (BufferHelper.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 let 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.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 let maxStarvationDelay = currentFragDuration ? Math.min(currentFragDuration,config.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 let 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 // cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration\n const maxLoadingDelay = currentFragDuration ? Math.min(currentFragDuration,config.maxLoadingDelay) : config.maxLoadingDelay;\n maxStarvationDelay = maxLoadingDelay - bitrateTestDelay;\n 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 _findBestLevel(currentLevel,currentFragDuration,currentBw,minAutoLevel,maxAutoLevel,maxFetchDuration,bwFactor,bwUpFactor,levels) {\n for (let i = maxAutoLevel; i >= minAutoLevel; i--) {\n let levelInfo = levels[i],\n levelDetails = levelInfo.details,\n avgDuration = levelDetails ? levelDetails.totalduration/levelDetails.fragments.length : currentFragDuration,\n live = levelDetails ? levelDetails.live : false,\n adjustedbw;\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 const bitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate,levels[i].bitrate) : levels[i].bitrate,\n fetchDuration = bitrate * avgDuration / adjustedbw;\n\n 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 live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches\n // 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 ...\n // special case to support startLevel = -1 (bitrateTest) on live streams : in that case we should not exit loop so that _findBestLevel will return -1\n (!fetchDuration || (live && !this.bitrateTestDelay) || fetchDuration < maxFetchDuration) ) {\n // as we are looping from highest to lowest, this will return the best achievable quality level\n return i;\n }\n }\n // not enough time budget even with quality level 0 ... rebuffering might happen\n return -1;\n }\n\n set nextAutoLevel(nextLevel) {\n this._nextAutoLevel = nextLevel;\n }\n}\n\nexport default AbrController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/abr-controller.js","/*\n * Audio Stream Controller\n*/\n\nimport BinarySearch from '../utils/binary-search';\nimport BufferHelper from '../helper/buffer-helper';\nimport Demuxer from '../demux/demuxer';\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport LevelHelper from '../helper/level-helper';\nimport TimeRanges from '../utils/timeRanges';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\nimport { findFragWithCC } from '../utils/discontinuities';\n\nconst 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 BUFFER_FLUSHING : 'BUFFER_FLUSHING',\n ENDED : 'ENDED',\n ERROR : 'ERROR',\n WAITING_INIT_PTS : 'WAITING_INIT_PTS'\n};\n\nclass AudioStreamController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.AUDIO_TRACKS_UPDATED,\n Event.AUDIO_TRACK_SWITCHING,\n Event.AUDIO_TRACK_LOADED,\n Event.KEY_LOADED,\n Event.FRAG_LOADED,\n Event.FRAG_PARSING_INIT_SEGMENT,\n Event.FRAG_PARSING_DATA,\n Event.FRAG_PARSED,\n Event.ERROR,\n Event.BUFFER_CREATED,\n Event.BUFFER_APPENDED,\n Event.BUFFER_FLUSHED,\n Event.INIT_PTS_FOUND);\n\n this.config = hls.config;\n this.audioCodecSwap = false;\n this.ticks = 0;\n this._state = State.STOPPED;\n this.ontick = this.tick.bind(this);\n this.initPTS=[];\n this.waitingFragment=null;\n this.videoTrackCC = null;\n }\n\n destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n EventHandler.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n\n //Signal that video PTS was found\n onInitPtsFound(data) {\n var demuxerId=data.id, cc = data.frag.cc, initPTS = data.initPTS;\n if(demuxerId === 'main') {\n //Always update the new INIT PTS\n //Can change due level switch\n this.initPTS[cc] = initPTS;\n this.videoTrackCC = cc;\n logger.log(`InitPTS for cc:${cc} found from video track:${initPTS}`);\n\n //If we are waiting we need to demux/remux the waiting frag\n //With the new initPTS\n if (this.state === State.WAITING_INIT_PTS) {\n this.tick();\n }\n }\n }\n\n startLoad(startPosition) {\n if (this.tracks) {\n var lastCurrentTime = this.lastCurrentTime;\n this.stopLoad();\n if (!this.timer) {\n this.timer = setInterval(this.ontick, 100);\n }\n this.fragLoadError = 0;\n if (lastCurrentTime > 0 && startPosition === -1) {\n logger.log(`audio:override startPosition with lastCurrentTime @${lastCurrentTime.toFixed(3)}`);\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 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 set state(nextState) {\n if (this.state !== nextState) {\n const previousState = this.state;\n this._state = nextState;\n logger.log(`audio stream:${previousState}->${nextState}`);\n }\n }\n\n get state() {\n return this._state;\n }\n\n 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 doTick() {\n var pos, track, trackDetails, hls = this.hls, 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 case State.BUFFER_FLUSHING:\n break;\n case State.STARTING:\n this.state = State.WAITING_TRACK;\n this.loadedmetadata = false;\n break;\n case State.IDLE:\n const tracks = this.tracks;\n // audio tracks not received => exit loop\n if (!tracks) {\n break;\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 (!this.media &&\n (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 if (pos === undefined) {\n break;\n }\n }\n let media = this.mediaBuffer ? this.mediaBuffer : this.media,\n bufferInfo = BufferHelper.bufferInfo(media,pos,config.maxBufferHole),\n bufferLen = bufferInfo.len,\n bufferEnd = bufferInfo.end,\n fragPrevious = this.fragPrevious,\n maxBufLen = config.maxMaxBufferLength,\n audioSwitch = this.audioSwitch,\n trackId = this.trackId;\n\n // if buffer length is less than maxBufLen try to load a new fragment\n if ((bufferLen < maxBufLen || audioSwitch) && trackId < tracks.length) {\n trackDetails = tracks[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 (!audioSwitch && !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(Event.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 let fragments = trackDetails.fragments,\n fragLen = fragments.length,\n start = fragments[0].start,\n end = fragments[fragLen-1].start + fragments[fragLen-1].duration,\n frag;\n\n // When switching audio track, reload audio as close as possible to currentTime\n if(audioSwitch){\n if (trackDetails.live && !trackDetails.PTSKnown) {\n logger.log(`switching audiotrack, live stream, unknown PTS,load first fragment`);\n bufferEnd = 0;\n } else {\n bufferEnd = pos;\n // if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime\n if (trackDetails.PTSKnown && pos < start) {\n // if everything is buffered from pos to start or if audio buffer upfront, let's seek to start\n if (bufferInfo.end > start || bufferInfo.nextStart) {\n logger.log('alt audio track ahead of main track, seek to start of alt audio track');\n this.media.currentTime = start + 0.05;\n } else {\n return;\n }\n }\n }\n }\n if (trackDetails.initSegment && !trackDetails.initSegment.data) {\n frag = trackDetails.initSegment;\n }\n // if bufferEnd before start of playlist, load first fragment\n else if (bufferEnd <= start) {\n frag = fragments[0];\n if (this.videoTrackCC !== null && frag.cc !== this.videoTrackCC) {\n // Ensure we find a fragment which matches the continuity of the video track\n frag = findFragWithCC(fragments, this.videoTrackCC);\n }\n if (trackDetails.live && frag.loadIdx && frag.loadIdx === this.fragLoadIdx) {\n // we just loaded this first fragment, and we are still lagging behind the start of the live playlist\n // let's force seek to start\n const nextBuffered = bufferInfo.nextStart ? bufferInfo.nextStart : start;\n logger.log(`no alt audio available @currentTime:${this.media.currentTime}, seeking @${nextBuffered + 0.05}`);\n this.media.currentTime = nextBuffered + 0.05;\n return;\n }\n } else {\n let foundFrag;\n let maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n const fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;\n let fragmentWithinToleranceTest = (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 // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments\n let candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);\n if ((candidate.start + candidate.duration - candidateLookupTolerance) <= bufferEnd) {\n return 1;\n }// if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n };\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n // Prefer the next fragment if it's within tolerance\n if (fragNext && !fragmentWithinToleranceTest(fragNext)) {\n foundFrag = fragNext;\n } else {\n foundFrag = BinarySearch.search(fragments, fragmentWithinToleranceTest);\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.log(`SN just loaded, load next one: ${frag.sn}`);\n } else {\n frag = null;\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 && (frag.decryptdata.uri != null) && (frag.decryptdata.key == null)) {\n logger.log(`Loading key for ${frag.sn} of [${trackDetails.startSN} ,${trackDetails.endSN}],track ${trackId}`);\n this.state = State.KEY_LOADING;\n hls.trigger(Event.KEY_LOADING, {frag: frag});\n } else {\n logger.log(`Loading ${frag.sn}, cc: ${frag.cc} of [${trackDetails.startSN} ,${trackDetails.endSN}],track ${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 let 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 if (!isNaN(frag.sn)) {\n this.nextLoadPosition = frag.start + frag.duration;\n }\n hls.trigger(Event.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.log(`audioStreamController: retryDate reached, switch back to IDLE state`);\n this.state = State.IDLE;\n }\n break;\n case State.WAITING_INIT_PTS:\n if (this.initPTS[this.videoTrackCC] === undefined) {\n break;\n }\n\n // Ensure we don't get stuck in the WAITING_INIT_PTS state if the waiting frag CC doesn't match any initPTS\n const waitingFrag = this.waitingFragment;\n if (waitingFrag) {\n const waitingFragCC = waitingFrag.frag.cc;\n if (this.videoTrackCC !== waitingFragCC) {\n logger.warn(`Waiting fragment CC (${waitingFragCC}) does not match video track CC (${this.videoTrackCC})`);\n this.waitingFragment = null;\n this.state = State.IDLE;\n } else {\n this.state = State.FRAG_LOADING;\n this.onFragLoaded(this.waitingFragment);\n this.waitingFragment = null;\n }\n } else {\n this.state = State.IDLE;\n }\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 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 let config = this.config;\n if(this.tracks && config.autoStartLoad) {\n this.startLoad(config.startPosition);\n }\n }\n\n onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n 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(track => {\n if(track.details) {\n track.details.fragments.forEach(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 = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n\n 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 onMediaEnded() {\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n\n onAudioTracksUpdated(data) {\n logger.log('audio tracks updated');\n this.tracks = data.audioTracks;\n }\n\n onAudioTrackSwitching(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\n this.fragCurrent = null;\n this.state = State.PAUSED;\n this.waitingFragment=null;\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\n //should we switch tracks ?\n if(altAudio){\n this.audioSwitch = true;\n //main audio track are handled by stream-controller, just do something if switching to alt audio track\n this.state=State.IDLE;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n if (this.fragLoadIdx !== undefined) {\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n }\n }\n this.tick();\n }\n\n onAudioTrackLoaded(data) {\n var newDetails = data.details,\n trackId = data.id,\n track = this.tracks[trackId],\n duration = newDetails.totalduration,\n sliding = 0;\n\n logger.log(`track ${trackId} loaded [${newDetails.startSN},${newDetails.endSN}],duration:${duration}`);\n\n if (newDetails.live) {\n var curDetails = track.details;\n if (curDetails && newDetails.fragments.length > 0) {\n // we already have details for that level, merge them\n LevelHelper.mergeDetails(curDetails,newDetails);\n sliding = newDetails.fragments[0].start;\n // TODO\n //this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n logger.log(`live audio playlist sliding:${sliding.toFixed(3)}`);\n } else {\n logger.log('live audio playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n logger.log('live audio playlist - first load, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n }\n track.details = newDetails;\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 let startTimeOffset = newDetails.startTimeOffset;\n if(!isNaN(startTimeOffset)) {\n 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 onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n\n onFragLoaded(data) {\n var fragCurrent = this.fragCurrent,\n fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING &&\n fragCurrent &&\n fragLoaded.type === 'audio' &&\n fragLoaded.level === fragCurrent.level &&\n fragLoaded.sn === fragCurrent.sn) {\n var track = this.tracks[this.trackId],\n details = track.details,\n duration = details.totalduration,\n trackId = fragCurrent.level,\n sn = fragCurrent.sn,\n cc = fragCurrent.cc,\n audioCodec = this.config.defaultAudioCodec || track.audioCodec || 'mp4a.40.2',\n stats = this.stats = data.stats;\n if (sn === 'initSegment') {\n this.state = State.IDLE;\n\n stats.tparsed = stats.tbuffered = performance.now();\n details.initSegment.data = data.payload;\n this.hls.trigger(Event.FRAG_BUFFERED, {stats: stats, frag: fragCurrent, id : 'audio'});\n this.tick();\n } else {\n this.state = State.PARSING;\n // transmux the MPEG-TS data to ISO-BMFF segments\n this.appended = false;\n if(!this.demuxer) {\n this.demuxer = new Demuxer(this.hls,'audio');\n }\n //Check if we have video initPTS\n // If not we need to wait for it\n let initPTS = this.initPTS[cc];\n let initSegmentData = details.initSegment ? details.initSegment.data : [];\n if (details.initSegment || initPTS !== undefined) {\n this.pendingBuffering = true;\n 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 let accurateTimeOffset = false; //details.PTSKnown || !details.live;\n this.demuxer.push(data.payload, initSegmentData, audioCodec, null, fragCurrent, duration, accurateTimeOffset, initPTS);\n } else {\n 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}`);\n this.waitingFragment=data;\n this.state=State.WAITING_INIT_PTS;\n }\n }\n }\n this.fragLoadError = 0;\n }\n\n onFragParsingInitSegment(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'audio' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n let tracks = data.tracks, track;\n\n // delete any video track found on audio demuxer\n if (tracks.video) {\n delete tracks.video;\n }\n\n // include levelCodec in audio and video tracks\n track = tracks.audio;\n if(track) {\n track.levelCodec = track.codec;\n track.id = data.id;\n this.hls.trigger(Event.BUFFER_CODECS,tracks);\n logger.log(`audio track:audio,container:${track.container},codecs[level/parsed]=[${track.levelCodec}/${track.codec}]`);\n let initSegment = track.initSegment;\n if (initSegment) {\n let appendObj = {type: 'audio', data: initSegment, parent : 'audio',content : 'initSegment'};\n if (this.audioSwitch) {\n this.pendingData = [appendObj];\n } else {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(Event.BUFFER_APPENDING, appendObj);\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n }\n\n onFragParsingData(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'audio' &&\n data.type === 'audio' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n let trackId= this.trackId,\n track = this.tracks[trackId],\n hls = this.hls;\n\n if (isNaN(data.endPTS)) {\n data.endPTS = data.startPTS + fragCurrent.duration;\n data.endDTS = data.startDTS + fragCurrent.duration;\n }\n\n 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 LevelHelper.updateFragPTSDTS(track.details,fragCurrent,data.startPTS,data.endPTS);\n\n let audioSwitch = this.audioSwitch, media = this.media, appendOnBufferFlush = false;\n //Only flush audio from old audio tracks when PTS is known on new audio track\n if(audioSwitch && media) {\n if (media.readyState) {\n let currentTime = media.currentTime;\n logger.log('switching audio track : currentTime:'+ currentTime);\n if (currentTime >= data.startPTS) {\n logger.log('switching audio track : flushing all audio');\n this.state = State.BUFFER_FLUSHING;\n hls.trigger(Event.BUFFER_FLUSHING, {startOffset: 0 , endOffset: Number.POSITIVE_INFINITY, type : 'audio'});\n appendOnBufferFlush = true;\n //Lets announce that the initial audio track switch flush occur\n this.audioSwitch = false;\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : trackId});\n }\n } else {\n //Lets announce that the initial audio track switch flush occur\n this.audioSwitch=false;\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : trackId});\n }\n }\n\n\n let pendingData = this.pendingData;\n if(!this.audioSwitch) {\n [data.data1, data.data2].forEach(buffer => {\n if (buffer && buffer.length) {\n pendingData.push({type: data.type, data: buffer, parent : 'audio',content : 'data'});\n }\n });\n if (!appendOnBufferFlush && pendingData.length) {\n pendingData.forEach(appendObj => {\n // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)\n // in that case it is useless to append following segments\n if (this.state === State.PARSING) {\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(Event.BUFFER_APPENDING, appendObj);\n }\n });\n this.pendingData = [];\n this.appended = true;\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsed(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'audio' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n\n\n onBufferCreated(data) {\n let audioTrack = data.tracks.audio;\n if (audioTrack) {\n this.mediaBuffer = audioTrack.buffer;\n this.loadedmetadata = true;\n }\n }\n\n onBufferAppended(data) {\n if (data.parent === 'audio') {\n const state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = (data.pending > 0);\n this._checkAppendedParsed();\n }\n }\n }\n\n _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n let frag = this.fragCurrent, stats = this.stats, hls = this.hls;\n if (frag) {\n this.fragPrevious = frag;\n stats.tbuffered = performance.now();\n hls.trigger(Event.FRAG_BUFFERED, {stats: stats, frag: frag, id : 'audio'});\n let media = this.mediaBuffer ? this.mediaBuffer : this.media;\n logger.log(`audio buffered : ${TimeRanges.toString(media.buffered)}`);\n if (this.audioSwitch && this.appended) {\n this.audioSwitch = false;\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : this.trackId});\n }\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n\n onError(data) {\n let 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 ErrorDetails.FRAG_LOAD_ERROR:\n case 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 let 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.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.error(`audioStreamController: ${data.details} reaches max retry, redispatch as fatal ...`);\n // switch error to fatal\n data.fatal = true;\n this.state = State.ERROR;\n }\n }\n break;\n case ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case ErrorDetails.AUDIO_TRACK_LOAD_ERROR:\n case ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:\n case ErrorDetails.KEY_LOAD_ERROR:\n case 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.warn(`audioStreamController: ${data.details} while loading frag,switch to ${this.state} state ...`);\n }\n break;\n case ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (data.parent === 'audio' && (this.state === State.PARSING || this.state === State.PARSED)) {\n const media = this.mediaBuffer,\n currentTime = this.media.currentTime,\n mediaBuffered = media && BufferHelper.isBuffered(media,currentTime) && BufferHelper.isBuffered(media,currentTime+0.5);\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n const config = this.config;\n if(config.maxMaxBufferLength >= config.maxBufferLength) {\n // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...\n config.maxMaxBufferLength/=2;\n logger.warn(`audio:reduce max buffer length to ${config.maxMaxBufferLength}s`);\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\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/video-dev/hls.js/pull/708\n // in that case flush the whole audio buffer to recover\n logger.warn('buffer full error also media.currentTime is not buffered, flush audio buffer');\n this.fragCurrent = null;\n // flush everything\n this.state = State.BUFFER_FLUSHING;\n this.hls.trigger(Event.BUFFER_FLUSHING, {startOffset: 0 , endOffset: Number.POSITIVE_INFINITY, type : 'audio'});\n }\n }\n break;\n default:\n break;\n }\n }\n\n onBufferFlushed() {\n let pendingData = this.pendingData;\n if (pendingData && pendingData.length) {\n logger.log('appending pending audio data on Buffer Flushed');\n pendingData.forEach(appendObj => {\n this.hls.trigger(Event.BUFFER_APPENDING, appendObj);\n });\n this.appended = true;\n this.pendingData = [];\n this.state = State.PARSED;\n } else {\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}\nexport default AudioStreamController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/audio-stream-controller.js","/*\n * audio track controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nclass AudioTrackController extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.MANIFEST_LOADING,\n Event.MANIFEST_LOADED,\n Event.AUDIO_TRACK_LOADED);\n this.ticks = 0;\n this.ontick = this.tick.bind(this);\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n 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 doTick() {\n this.updateTrack(this.trackId);\n }\n onManifestLoading() {\n // reset audio tracks on manifest loading\n this.tracks = [];\n this.trackId = -1;\n }\n\n onManifestLoaded(data) {\n let tracks = data.audioTracks || [];\n let defaultFound = false;\n this.tracks = tracks;\n this.hls.trigger(Event.AUDIO_TRACKS_UPDATED, {audioTracks : tracks});\n // loop through available audio tracks and autoselect default if needed\n let id = 0;\n tracks.forEach(track => {\n if(track.default) {\n this.audioTrack = id;\n defaultFound = true;\n return;\n }\n id++;\n });\n if (defaultFound === false && tracks.length) {\n logger.log('no default audio track defined, use first audio track as default');\n this.audioTrack = 0;\n }\n }\n\n onAudioTrackLoaded(data) {\n if (data.id < this.tracks.length) {\n 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 get audioTracks() {\n return this.tracks;\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n get audioTrack() {\n return this.trackId;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n set audioTrack(audioTrackId) {\n if (this.trackId !== audioTrackId || this.tracks[audioTrackId].details === undefined) {\n this.setAudioTrackInternal(audioTrackId);\n }\n }\n\n 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.log(`switching to audioTrack ${newId}`);\n let audioTrack = this.tracks[newId],\n hls = this.hls,\n type = audioTrack.type,\n url = audioTrack.url,\n eventObj = {id: newId, type : type, url : url};\n // keep AUDIO_TRACK_SWITCH for legacy reason\n hls.trigger(Event.AUDIO_TRACK_SWITCH, eventObj);\n hls.trigger(Event.AUDIO_TRACK_SWITCHING, eventObj);\n // check if we need to load playlist for this audio Track\n let 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.log(`(re)loading playlist for audioTrack ${newId}`);\n hls.trigger(Event.AUDIO_TRACK_LOADING, {url: url, id: newId});\n }\n }\n }\n\n updateTrack(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.log(`updating audioTrack ${newId}`);\n let audioTrack = this.tracks[newId], url = audioTrack.url;\n // check if we need to load playlist for this audio Track\n let 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.log(`(re)loading playlist for audioTrack ${newId}`);\n this.hls.trigger(Event.AUDIO_TRACK_LOADING, {url: url, id: newId});\n }\n }\n }\n}\n\nexport default AudioTrackController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/audio-track-controller.js","/*\n * Buffer Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n\n\nclass BufferController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHING,\n Event.MEDIA_DETACHING,\n Event.MANIFEST_PARSED,\n Event.BUFFER_RESET,\n Event.BUFFER_APPENDING,\n Event.BUFFER_CODECS,\n Event.BUFFER_EOS,\n Event.BUFFER_FLUSHING,\n Event.LEVEL_PTS_UPDATED,\n Event.LEVEL_UPDATED);\n\n // the value that we have set mediasource.duration to\n // (the actual duration may be tweaked slighly by the browser)\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 this.tracks = {};\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n onLevelPtsUpdated(data) {\n let type = data.type;\n let audioTrack = this.tracks.audio;\n\n // Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)\n // in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`\n // 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\n // `SourceBuffer.abort()` and adjusting `SourceBuffer.timestampOffset` if `SourceBuffer.updating` is false or awaiting `updateend`\n // event if SB is in updating state.\n // More info here: https://github.com/video-dev/hls.js/issues/332#issuecomment-257986486\n\n if (type === 'audio' && audioTrack && audioTrack.container === 'audio/mpeg') { // Chrome audio mp3 track\n let audioBuffer = this.sourceBuffer.audio;\n let delta = Math.abs(audioBuffer.timestampOffset - data.start);\n\n // adjust timestamp offset if time delta is greater than 100ms\n if (delta > 0.1) {\n let updating = audioBuffer.updating;\n\n try {\n audioBuffer.abort();\n } catch (err) {\n updating = true;\n logger.warn('can not abort audio buffer: ' + err);\n }\n\n if (!updating) {\n logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + data.start);\n audioBuffer.timestampOffset = data.start;\n } else {\n this.audioTimestampOffset = data.start;\n }\n }\n }\n }\n\n onManifestParsed(data) {\n let 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.log(`${sourceBufferNb} sourceBuffer(s) expected`);\n }\n this.sourceBufferNb = sourceBufferNb;\n }\n\n onMediaAttaching(data) {\n let 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 onMediaDetaching() {\n 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.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 URL.revokeObjectURL(this.media.src);\n this.media.removeAttribute('src');\n this.media.load();\n }\n\n this.mediaSource = null;\n this.media = null;\n this.pendingTracks = {};\n this.tracks = {};\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(Event.MEDIA_DETACHED);\n }\n\n onMediaSourceOpen() {\n logger.log('media source opened');\n this.hls.trigger(Event.MEDIA_ATTACHED, { media : this.media });\n let 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 checkPendingTracks() {\n // if any buffer codecs pending, check if we have enough to create sourceBuffers\n let 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 && (\n this.sourceBufferNb <= pendingTracksNb ||\n 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 onMediaSourceClose() {\n logger.log('media source closed');\n }\n\n onMediaSourceEnded() {\n logger.log('media source ended');\n }\n\n\n onSBUpdateEnd() {\n // update timestampOffset\n if (this.audioTimestampOffset) {\n let audioBuffer = this.sourceBuffer.audio;\n logger.warn('change mpeg audio timestamp offset from ' + audioBuffer.timestampOffset + ' to ' + this.audioTimestampOffset);\n audioBuffer.timestampOffset = this.audioTimestampOffset;\n delete this.audioTimestampOffset;\n }\n\n if (this._needsFlush) {\n this.doFlush();\n }\n\n if (this._needsEos) {\n this.checkEos();\n }\n this.appending = false;\n let parent = this.parent;\n // count nb of pending segments waiting for appending on this sourcebuffer\n let pending = this.segments.reduce( (counter, segment) => (segment.parent === parent) ? counter + 1 : counter , 0);\n this.hls.trigger(Event.BUFFER_APPENDED, { parent : parent, pending : pending });\n\n // don't append in flushing mode\n if (!this._needsFlush) {\n this.doAppending();\n }\n\n this.updateMediaElementDuration();\n }\n\n onSBUpdateError(event) {\n 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 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 }\n this.sourceBuffer = {};\n this.flushRange = [];\n this.segments = [];\n this.appended = 0;\n }\n\n 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) { this.pendingTracks[trackName] = tracks[trackName]; }\n let 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\n createSourceBuffers(tracks) {\n var sourceBuffer = this.sourceBuffer,mediaSource = this.mediaSource;\n\n for (let trackName in tracks) {\n if(!sourceBuffer[trackName]) {\n let track = tracks[trackName];\n // use levelCodec as first priority\n let codec = track.levelCodec || track.codec;\n let mimeType = `${track.container};codecs=${codec}`;\n logger.log(`creating sourceBuffer(${mimeType})`);\n try {\n let sb = sourceBuffer[trackName] = mediaSource.addSourceBuffer(mimeType);\n sb.addEventListener('updateend', this.onsbue);\n sb.addEventListener('error', this.onsbe);\n this.tracks[trackName] = {codec: codec, container: track.container};\n track.buffer = sb;\n } catch(err) {\n logger.error(`error while trying to add sourceBuffer:${err.message}`);\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_ADD_CODEC_ERROR, fatal: false, err: err, mimeType : mimeType});\n }\n }\n }\n this.hls.trigger(Event.BUFFER_CREATED, { tracks : tracks } );\n }\n\n 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 onBufferAppendFail(data) {\n 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_APPENDING_ERROR, fatal: false});\n }\n\n // on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()\n onBufferEos(data) {\n var sb = this.sourceBuffer;\n let dataType = data.type;\n for(let type in sb) {\n if (!dataType || type === dataType) {\n if (!sb[type].ended) {\n sb[type].ended = true;\n 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 checkEos() {\n var sb = this.sourceBuffer, mediaSource = this.mediaSource;\n if (!mediaSource || mediaSource.readyState !== 'open') {\n this._needsEos = false;\n return;\n }\n for(let type in sb) {\n let sbobj = sb[type];\n if (!sbobj.ended) {\n return;\n }\n if(sbobj.updating) {\n this._needsEos = true;\n return;\n }\n }\n 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 try {\n mediaSource.endOfStream();\n } catch(e) {\n logger.warn('exception while calling mediaSource.endOfStream()');\n }\n this._needsEos = false;\n }\n\n\n 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 onLevelUpdated(event) {\n let 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/video-dev/hls.js/issues/355\n updateMediaElementDuration() {\n let media = this.media,\n mediaSource = this.mediaSource,\n sourceBuffer = this.sourceBuffer,\n levelDuration = this._levelDuration;\n if (levelDuration === null || !media || !mediaSource || !sourceBuffer || media.readyState === 0 || mediaSource.readyState !== 'open') {\n return;\n }\n for (let 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 let duration = media.duration;\n // 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\n if ((levelDuration > this._msDuration && levelDuration > duration) || (duration === Infinity || isNaN(duration) )) {\n logger.log(`Updating mediasource duration to ${levelDuration.toFixed(3)}`);\n this._msDuration = mediaSource.duration = levelDuration;\n }\n }\n\n 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 try {\n for (var type in sourceBuffer) {\n appended += sourceBuffer[type].buffered.length;\n }\n } catch(error) {\n // error could be thrown while accessing buffered, in case sourcebuffer has already been removed from MediaSource\n // this is harmess at this stage, catch this to avoid reporting an internal exception\n logger.error('error while accessing sourceBuffer.buffered');\n }\n this.appended = appended;\n this.hls.trigger(Event.BUFFER_FLUSHED);\n }\n }\n\n doAppending() {\n var hls = this.hls, sourceBuffer = this.sourceBuffer, segments = this.segments;\n if (Object.keys(sourceBuffer).length) {\n if (this.media.error) {\n this.segments = [];\n 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 let segment = segments.shift();\n try {\n let type = segment.type, sb = sourceBuffer[type];\n if(sb) {\n if(!sb.updating) {\n // reset sourceBuffer ended flag before appending segment\n sb.ended = false;\n //logger.log(`appending ${segment.content} ${type} SB, size:${segment.data.length}, ${segment.parent}`);\n this.parent = segment.parent;\n sb.appendBuffer(segment.data);\n this.appendError = 0;\n this.appended++;\n this.appending = true;\n } else {\n segments.unshift(segment);\n }\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.error(`error while trying to append buffer:${err.message}`);\n segments.unshift(segment);\n var event = {type: ErrorTypes.MEDIA_ERROR, parent : segment.parent};\n if(err.code !== 22) {\n if (this.appendError) {\n this.appendError++;\n } else {\n this.appendError = 1;\n }\n event.details = ErrorDetails.BUFFER_APPEND_ERROR;\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.log(`fail ${hls.config.appendErrorMaxRetry} times to append segment in sourceBuffer`);\n segments = [];\n event.fatal = true;\n hls.trigger(Event.ERROR, event);\n return;\n } else {\n event.fatal = false;\n hls.trigger(Event.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 = ErrorDetails.BUFFER_FULL_ERROR;\n event.fatal = false;\n hls.trigger(Event.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 flushBuffer(startOffset, endOffset, typeIn) {\n var sb, i, bufStart, bufEnd, flushStart, flushEnd, sourceBuffer = this.sourceBuffer;\n if (Object.keys(sourceBuffer).length) {\n logger.log(`flushBuffer,pos/start/end: ${this.media.currentTime.toFixed(3)}/${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 try {\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.log(`flush ${type} [${flushStart},${flushEnd}], of [${bufStart},${bufEnd}], pos:${this.media.currentTime}`);\n sb.remove(flushStart, flushEnd);\n return false;\n }\n }\n } catch(e) {\n logger.warn('exception while accessing sourcebuffer, it might have been removed from MediaSource');\n }\n } else {\n //logger.log('abort ' + type + ' append in progress');\n // this will abort any appending in progress\n //sb.abort();\n logger.warn('cannot flush, sb updating in progress');\n return false;\n }\n }\n } else {\n logger.warn('abort flushing too many retries');\n }\n logger.log('buffer flushed');\n }\n // everything flushed !\n return true;\n }\n}\n\nexport default BufferController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/buffer-controller.js","/*\n * cap stream level to media size dimension controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\n\nclass CapLevelController extends EventHandler {\n\tconstructor(hls) {\n super(hls,\n Event.FPS_DROP_LEVEL_CAPPING,\n Event.MEDIA_ATTACHING,\n Event.MANIFEST_PARSED);\n\t}\n\n\tdestroy() {\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 onFpsDropLevelCapping(data) {\n\t // Don't add a restricted level more than once\n if (CapLevelController.isLevelAllowed(data.droppedLevel, this.restrictedLevels)) {\n this.restrictedLevels.push(data.droppedLevel);\n }\n }\n\n\tonMediaAttaching(data) {\n this.media = data.media instanceof HTMLVideoElement ? data.media : null;\n }\n\n onManifestParsed(data) {\n const hls = this.hls;\n this.restrictedLevels = [];\n if (hls.config.capLevelToPlayerSize) {\n this.autoLevelCapping = Number.POSITIVE_INFINITY;\n this.levels = data.levels;\n 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 detectPlayerSize() {\n if (this.media) {\n let levelsLength = this.levels ? this.levels.length : 0;\n if (levelsLength) {\n const hls = this.hls;\n hls.autoLevelCapping = this.getMaxLevel(levelsLength - 1);\n if (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 hls.streamController.nextLevelSwitch();\n }\n this.autoLevelCapping = 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 getMaxLevel(capLevelIndex) {\n if (!this.levels) {\n return -1;\n }\n\n const validLevels = this.levels.filter((level, index) =>\n CapLevelController.isLevelAllowed(index, this.restrictedLevels) && index <= capLevelIndex\n );\n\n return CapLevelController.getMaxLevelByMediaSize(validLevels, this.mediaWidth, this.mediaHeight);\n }\n\n get mediaWidth() {\n let width;\n const media = this.media;\n if (media) {\n width = media.width || media.clientWidth || media.offsetWidth;\n width *= CapLevelController.contentScaleFactor;\n }\n return width;\n }\n\n get mediaHeight() {\n let height;\n const media = this.media;\n if (media) {\n height = media.height || media.clientHeight || media.offsetHeight;\n height *= CapLevelController.contentScaleFactor;\n }\n return height;\n }\n\n static get contentScaleFactor() {\n let pixelRatio = 1;\n try {\n pixelRatio = window.devicePixelRatio;\n } catch(e) {}\n return pixelRatio;\n }\n\n static isLevelAllowed(level, restrictedLevels = []) {\n return restrictedLevels.indexOf(level) === -1;\n }\n\n static getMaxLevelByMediaSize(levels, width, height) {\n if (!levels || (levels && !levels.length)) {\n return -1;\n }\n\n // Levels can have the same dimensions but differing bandwidths - since levels are ordered, we can look to the next\n // to determine whether we've chosen the greatest bandwidth for the media's dimensions\n const atGreatestBandiwdth = (curLevel, nextLevel) => {\n if (!nextLevel) {\n return true;\n }\n return curLevel.width !== nextLevel.width || curLevel.height !== nextLevel.height;\n };\n\n // If we run through the loop without breaking, the media's dimensions are greater than every level, so default to\n // the max level\n let maxLevelIndex = levels.length - 1;\n\n for (let i = 0; i < levels.length; i+= 1) {\n const level = levels[i];\n if ((level.width >= width || level.height >= height) && atGreatestBandiwdth(level, levels[i + 1])) {\n maxLevelIndex = i;\n break;\n }\n }\n\n return maxLevelIndex;\n }\n}\n\nexport default CapLevelController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/cap-level-controller.js","/*\n * FPS Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nclass FPSController extends EventHandler{\n\n constructor(hls) {\n super(hls, Event.MEDIA_ATTACHING);\n }\n\n destroy() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.isVideoPlaybackQualityAvailable = false;\n }\n\n onMediaAttaching(data) {\n const config = this.hls.config;\n if (config.capLevelOnFPSDrop) {\n const video = this.video = data.media instanceof HTMLVideoElement ? data.media : null;\n if (typeof video.getVideoPlaybackQuality === 'function') {\n this.isVideoPlaybackQualityAvailable = true;\n }\n clearInterval(this.timer);\n this.timer = setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod);\n }\n }\n\n checkFPS(video, decodedFrames, droppedFrames) {\n let currentTime = performance.now();\n if (decodedFrames) {\n if (this.lastTime) {\n let currentPeriod = currentTime - this.lastTime,\n currentDropped = droppedFrames - this.lastDroppedFrames,\n currentDecoded = decodedFrames - this.lastDecodedFrames,\n droppedFPS = 1000 * currentDropped / currentPeriod,\n hls = this.hls;\n hls.trigger(Event.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 > hls.config.fpsDroppedMonitoringThreshold * currentDecoded) {\n let currentLevel = hls.currentLevel;\n logger.warn('drop FPS ratio greater than max allowed value for currentLevel: ' + currentLevel);\n if (currentLevel > 0 && (hls.autoLevelCapping === -1 || hls.autoLevelCapping >= currentLevel)) {\n currentLevel = currentLevel - 1;\n hls.trigger(Event.FPS_DROP_LEVEL_CAPPING, {level: currentLevel, droppedLevel: hls.currentLevel});\n hls.autoLevelCapping = currentLevel;\n hls.streamController.nextLevelSwitch();\n }\n }\n }\n }\n this.lastTime = currentTime;\n this.lastDroppedFrames = droppedFrames;\n this.lastDecodedFrames = decodedFrames;\n }\n }\n\n checkFPSInterval() {\n const video = this.video;\n if (video) {\n if (this.isVideoPlaybackQualityAvailable) {\n let videoPlaybackQuality = video.getVideoPlaybackQuality();\n this.checkFPS(video, videoPlaybackQuality.totalVideoFrames, videoPlaybackQuality.droppedVideoFrames);\n } else {\n this.checkFPS(video, video.webkitDecodedFrameCount, video.webkitDroppedFrameCount);\n }\n }\n }\n}\n\nexport default FPSController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/fps-controller.js","/*\n * id3 metadata track controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport ID3 from '../demux/id3';\n\nclass ID3TrackController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.FRAG_PARSING_METADATA);\n this.id3Track = undefined;\n this.media = undefined;\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n // Add ID3 metatadata text track.\n onMediaAttached(data) {\n this.media = data.media;\n if (!this.media) {\n return;\n }\n\n this.id3Track = this.media.addTextTrack('metadata', 'id3');\n this.id3Track.mode = 'hidden';\n }\n\n onMediaDetaching() {\n this.media = undefined;\n }\n\n onFragParsingMetadata(data) {\n const fragment = data.frag;\n const samples = data.samples;\n\n // Attempt to recreate Safari functionality by creating\n // WebKitDataCue objects when available and store the decoded\n // ID3 data in the value property of the cue\n let Cue = window.WebKitDataCue || window.VTTCue || window.TextTrackCue;\n\n for (let i = 0; i < samples.length; i++) {\n const frames = ID3.getID3Frames(samples[i].data);\n if (frames) {\n const startTime = samples[i].pts;\n let endTime = i < samples.length - 1 ? samples[i+1].pts : fragment.endPTS;\n\n // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE\n if (startTime === endTime) {\n endTime += 0.0001;\n }\n\n for(let j = 0; j < frames.length; j++) {\n const frame = frames[j];\n // Safari doesn't put the timestamp frame in the TextTrack\n if (!ID3.isTimeStampFrame(frame)) {\n const cue = new Cue(startTime, endTime, '');\n cue.value = frame;\n this.id3Track.addCue(cue);\n }\n }\n }\n }\n }\n}\n\nexport default ID3TrackController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/id3-track-controller.js","/*\n * Level Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport BufferHelper from '../helper/buffer-helper';\n\nclass LevelController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MANIFEST_LOADED,\n Event.LEVEL_LOADED,\n Event.FRAG_LOADED,\n Event.ERROR);\n this.ontick = this.tick.bind(this);\n this._manualLevel = -1;\n }\n\n destroy() {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = null;\n }\n this._manualLevel = -1;\n }\n\n startLoad() {\n this.canload = true;\n let levels = this._levels;\n // clean up live level details to force reload them, and reset load errors\n if(levels) {\n levels.forEach(level => {\n level.loadError = 0;\n const levelDetails = level.details;\n if (levelDetails && levelDetails.live) {\n level.details = undefined;\n }\n });\n }\n // speed up live playlist refresh if timer exists\n if (this.timer) {\n this.tick();\n }\n }\n\n stopLoad() {\n this.canload = false;\n }\n\n onManifestLoaded(data) {\n var levels0 = [],\n levels = [],\n bitrateStart,\n bitrateSet = {},\n videoCodecFound = false,\n audioCodecFound = false,\n hls = this.hls,\n brokenmp4inmp3 = /chrome|firefox/.test(navigator.userAgent.toLowerCase()),\n checkSupported = function(type,codec) { return MediaSource.isTypeSupported(`${type}/mp4;codecs=${codec}`);};\n\n // regroup redundant level together\n data.levels.forEach(level => {\n if(level.videoCodec) {\n videoCodecFound = true;\n }\n // erase audio codec info if browser does not support mp4a.40.34. demuxer will autodetect codec and fallback to mpeg/audio\n if(brokenmp4inmp3 && level.audioCodec && level.audioCodec.indexOf('mp4a.40.34') !== -1) {\n level.audioCodec = undefined;\n }\n if(level.audioCodec || (level.attrs && level.attrs.AUDIO)) {\n audioCodecFound = true;\n }\n let 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(level => {\n if(level.videoCodec) {\n levels.push(level);\n }\n });\n } else {\n levels = levels0;\n }\n // only keep level with supported audio/video codecs\n levels = levels.filter(function(level) {\n let audioCodec = level.audioCodec, videoCodec = level.videoCodec;\n return (!audioCodec || checkSupported('audio',audioCodec)) &&\n (!videoCodec || checkSupported('video',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 (let i = 0; i < levels.length; i++) {\n if (levels[i].bitrate === bitrateStart) {\n this._firstLevel = i;\n logger.log(`manifest loaded,${levels.length} level(s) found, first bitrate:${bitrateStart}`);\n break;\n }\n }\n hls.trigger(Event.MANIFEST_PARSED, {levels: levels, firstLevel: this._firstLevel, stats: data.stats, audio : audioCodecFound, video : videoCodecFound, altAudio : data.audioTracks.length > 0});\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 get levels() {\n return this._levels;\n }\n\n get level() {\n return this._level;\n }\n\n set level(newLevel) {\n let 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 setLevelInternal(newLevel) {\n const levels = this._levels;\n const hls = this.hls;\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.log(`switching to level ${newLevel}`);\n this._level = newLevel;\n var levelProperties = levels[newLevel];\n levelProperties.level = newLevel;\n // LEVEL_SWITCH to be deprecated in next major release\n hls.trigger(Event.LEVEL_SWITCH, levelProperties);\n hls.trigger(Event.LEVEL_SWITCHING, levelProperties);\n }\n var level = levels[newLevel], 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 hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: newLevel, id: urlId});\n }\n } else {\n // invalid level id given, trigger error\n hls.trigger(Event.ERROR, {type : ErrorTypes.OTHER_ERROR, details: ErrorDetails.LEVEL_SWITCH_ERROR, level: newLevel, fatal: false, reason: 'invalid level idx'});\n }\n }\n\n get manualLevel() {\n return this._manualLevel;\n }\n\n set manualLevel(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 get firstLevel() {\n return this._firstLevel;\n }\n\n set firstLevel(newLevel) {\n this._firstLevel = newLevel;\n }\n\n get startLevel() {\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 let 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\n set startLevel(newLevel) {\n this._startLevel = newLevel;\n }\n\n onError(data) {\n if(data.fatal) {\n return;\n }\n\n let details = data.details, hls = this.hls, levelId, level, levelError = false;\n // try to recover not fatal errors\n switch(details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n case ErrorDetails.FRAG_LOOP_LOADING_ERROR:\n case ErrorDetails.KEY_LOAD_ERROR:\n case ErrorDetails.KEY_LOAD_TIMEOUT:\n levelId = data.frag.level;\n break;\n case ErrorDetails.LEVEL_LOAD_ERROR:\n case ErrorDetails.LEVEL_LOAD_TIMEOUT:\n levelId = data.context.level;\n levelError = true;\n break;\n case ErrorDetails.REMUX_ALLOC_ERROR:\n levelId = data.level;\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.loadError) {\n level.loadError = 1;\n } else {\n level.loadError++;\n }\n // if any redundant streams available and if we haven't try them all (level.loadError is reseted on successful frag/level load.\n // if level.loadError reaches nbRedundantLevel it means that we tried them all, no hope => let's switch down\n const nbRedundantLevel = level.url.length;\n if (nbRedundantLevel > 1 && level.loadError < nbRedundantLevel) {\n level.urlId = (level.urlId + 1) % nbRedundantLevel;\n level.details = undefined;\n 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 let recoverable = ((this._manualLevel === -1) && levelId);\n if (recoverable) {\n logger.warn(`level controller,${details}: switch-down for next fragment`);\n hls.nextAutoLevel = Math.max(0,levelId-1);\n } else if(level && level.details && level.details.live) {\n 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 === ErrorDetails.LEVEL_LOAD_ERROR ||\n details === ErrorDetails.LEVEL_LOAD_TIMEOUT) {\n let media = hls.media,\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && BufferHelper.isBuffered(media,media.currentTime) && BufferHelper.isBuffered(media,media.currentTime+0.5);\n if (mediaBuffered) {\n let retryDelay = hls.config.levelLoadingRetryDelay;\n logger.warn(`level controller,${details}, but media buffered, retry in ${retryDelay}ms`);\n this.timer = setTimeout(this.ontick,retryDelay);\n // boolean used to inform stream controller not to switch back to IDLE on non fatal error\n data.levelRetry = true;\n } else {\n 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 // switch error to fatal\n data.fatal = true;\n }\n }\n }\n }\n }\n\n // reset level load error counter on successful frag loaded\n onFragLoaded(data) {\n const fragLoaded = data.frag;\n if (fragLoaded && fragLoaded.type === 'main') {\n const level = this._levels[fragLoaded.level];\n if (level) {\n level.loadError = 0;\n }\n }\n }\n\n onLevelLoaded(data) {\n const levelId = data.level;\n // only process level loaded events matching with expected level\n if (levelId === this._level) {\n let curLevel = this._levels[levelId];\n // reset level load error counter on successful level loaded\n curLevel.loadError = 0;\n let newDetails = data.details;\n // if current playlist is a live playlist, arm a timer to reload it\n if (newDetails.live) {\n let reloadInterval = 1000*( newDetails.averagetargetduration ? newDetails.averagetargetduration : newDetails.targetduration),\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.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.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 tick() {\n var levelId = this._level;\n if (levelId !== undefined && this.canload) {\n var level = this._levels[levelId];\n if (level && level.url) {\n var urlId = level.urlId;\n this.hls.trigger(Event.LEVEL_LOADING, {url: level.url[urlId], level: levelId, id: urlId});\n }\n }\n }\n\n get nextLoadLevel() {\n if (this._manualLevel !== -1) {\n return this._manualLevel;\n } else {\n return this.hls.nextAutoLevel;\n }\n }\n\n set nextLoadLevel(nextLevel) {\n this.level = nextLevel;\n if (this._manualLevel === -1) {\n this.hls.nextAutoLevel = nextLevel;\n }\n }\n}\n\nexport default LevelController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/level-controller.js","/*\n * Stream Controller\n*/\n\nimport BinarySearch from '../utils/binary-search';\nimport BufferHelper from '../helper/buffer-helper';\nimport Demuxer from '../demux/demuxer';\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport LevelHelper from '../helper/level-helper';\nimport TimeRanges from '../utils/timeRanges';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nconst State = {\n STOPPED : 'STOPPED',\n IDLE : 'IDLE',\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 BUFFER_FLUSHING : 'BUFFER_FLUSHING',\n ENDED : 'ENDED',\n ERROR : 'ERROR'\n};\n\nclass StreamController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.MANIFEST_LOADING,\n Event.MANIFEST_PARSED,\n Event.LEVEL_LOADED,\n Event.KEY_LOADED,\n Event.FRAG_LOADED,\n Event.FRAG_LOAD_EMERGENCY_ABORTED,\n Event.FRAG_PARSING_INIT_SEGMENT,\n Event.FRAG_PARSING_DATA,\n Event.FRAG_PARSED,\n Event.ERROR,\n Event.AUDIO_TRACK_SWITCHING,\n Event.AUDIO_TRACK_SWITCHED,\n Event.BUFFER_CREATED,\n Event.BUFFER_APPENDED,\n Event.BUFFER_FLUSHED);\n\n this.config = hls.config;\n this.audioCodecSwap = false;\n this.ticks = 0;\n this._state = State.STOPPED;\n this.ontick = this.tick.bind(this);\n }\n\n destroy() {\n this.stopLoad();\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\n EventHandler.prototype.destroy.call(this);\n this.state = State.STOPPED;\n }\n\n startLoad(startPosition) {\n if (this.levels) {\n let lastCurrentTime = this.lastCurrentTime, 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 (!this.startFragRequested) {\n // determine load level\n let 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 // if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime\n if (lastCurrentTime > 0 && startPosition === -1) {\n logger.log(`override startPosition with lastCurrentTime @${lastCurrentTime.toFixed(3)}`);\n startPosition = lastCurrentTime;\n }\n this.state = State.IDLE;\n this.nextLoadPosition = this.startPosition = this.lastCurrentTime = startPosition;\n this.tick();\n } else {\n this.forceStartLoad = true;\n this.state = State.STOPPED;\n }\n }\n\n 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 this.forceStartLoad = false;\n }\n\n 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 doTick() {\n switch(this.state) {\n case State.ERROR:\n //don't do anything in error state to avoid breaking further ...\n break;\n case State.BUFFER_FLUSHING:\n // in buffer flushing state, reset fragLoadError counter\n this.fragLoadError = 0;\n break;\n case State.IDLE:\n this._doTickIdle();\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.log(`mediaController: retryDate reached, switch back to IDLE state`);\n this.state = State.IDLE;\n }\n break;\n case State.ERROR:\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 _doTickIdle() {\n const 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 start level loaded and media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop\n if (this.levelLastLoaded !== undefined && !media &&\n (this.startFragRequested || !config.startFragPrefetch)) {\n return;\n }\n\n // if we have not yet loaded any fragment, start loading from start position\n let pos;\n if (this.loadedmetadata) {\n pos = media.currentTime;\n } else {\n pos = this.nextLoadPosition;\n }\n // determine next load level\n let level = hls.nextLoadLevel,\n levelInfo = this.levels[level];\n\n if (!levelInfo) {\n return;\n }\n\n let levelBitrate = levelInfo.bitrate,\n maxBufLen;\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 if (levelBitrate) {\n maxBufLen = Math.max(8 * config.maxBufferSize / levelBitrate, 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 const bufferInfo = BufferHelper.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;\n }\n\n // if buffer length is less than maxBufLen try to load a new fragment ...\n 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 this.level = hls.nextLoadLevel = level;\n\n const levelDetails = levelInfo.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;\n }\n\n // we just got done loading the final fragment, and currentPos is buffered, and there is no other buffered range after ...\n // rationale is that in case there are any buffered rangesafter, it means that there are unbuffered portion in between\n // so we should not switch to ENDED in that case, to be able to buffer themx\n let fragPrevious = this.fragPrevious;\n if (!levelDetails.live && fragPrevious && fragPrevious.sn === levelDetails.endSN && bufferLen && !bufferInfo.nextStart) {\n // fragPrevious is last fragment. retrieve level duration using last frag start offset + duration\n // real duration might be lower than initial duration if there are drifts between real frag duration and playlist signaling\n const duration = Math.min(media.duration,fragPrevious.start + fragPrevious.duration);\n // if 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 (audio/video offsets...)\n // tolerate up to one frag duration to cope with these cases.\n // 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\n if (duration - Math.max(bufferInfo.end,fragPrevious.start) <= Math.max(0.2,fragPrevious.duration)) {\n // Finalize the media stream\n let data = {};\n if (this.altAudio) {\n data.type = 'video';\n }\n this.hls.trigger(Event.BUFFER_EOS,data);\n this.state = State.ENDED;\n return;\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 this._fetchPayloadOrEos(pos, bufferInfo, levelDetails);\n }\n\n _fetchPayloadOrEos(pos, bufferInfo, levelDetails) {\n const 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;\n }\n\n // find fragment index, contiguous with end of buffer position\n let start = fragments[0].start,\n end = fragments[fragLen-1].start + fragments[fragLen-1].duration,\n bufferEnd = bufferInfo.end,\n frag;\n\n if (levelDetails.initSegment && !levelDetails.initSegment.data) {\n frag = levelDetails.initSegment;\n } else {\n // in case of live playlist we need to ensure that requested position is not located before playlist start\n if (levelDetails.live) {\n let initialLiveManifestSize = this.config.initialLiveManifestSize;\n if(fragLen < initialLiveManifestSize){\n logger.warn(`Can not start playback of a level, reason: not enough fragments ${fragLen} < ${initialLiveManifestSize}`);\n return;\n }\n\n frag = this._ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen);\n // if it explicitely returns null don't load any fragment and exit function now\n if (frag === null) {\n return;\n }\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 }\n if (!frag) {\n frag = this._findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails);\n }\n if(frag) {\n this._loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd);\n }\n return;\n }\n\n _ensureFragmentAtLivePoint(levelDetails, bufferEnd, start, end, fragPrevious, fragments, fragLen) {\n const config = this.hls.config, media = this.media;\n\n let frag;\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 let maxLatency = config.liveMaxLatencyDuration !== undefined ? config.liveMaxLatencyDuration : config.liveMaxLatencyDurationCount*levelDetails.targetduration;\n\n if (bufferEnd < Math.max(start-config.maxFragLookUpTolerance, end - maxLatency)) {\n let liveSyncPosition = this.liveSyncPosition = this.computeLivePosition(start, levelDetails);\n 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 this.nextLoadPosition = liveSyncPosition;\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.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.log(`live playlist, switching playlist, unknown, load middle frag : ${frag.sn}`);\n }\n }\n return frag;\n }\n\n _findFragment(start, fragPrevious, fragLen, fragments, bufferEnd, end, levelDetails) {\n const config = this.hls.config;\n let frag;\n let foundFrag;\n let maxFragLookUpTolerance = config.maxFragLookUpTolerance;\n const fragNext = fragPrevious ? fragments[fragPrevious.sn - fragments[0].sn + 1] : undefined;\n let fragmentWithinToleranceTest = (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 // Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments\n let candidateLookupTolerance = Math.min(maxFragLookUpTolerance, candidate.duration);\n if (candidate.start + candidate.duration - candidateLookupTolerance <= bufferEnd) {\n return 1;\n } // if maxFragLookUpTolerance will have negative value then don't return -1 for first element\n else if (candidate.start - candidateLookupTolerance > bufferEnd && candidate.start) {\n return -1;\n }\n return 0;\n };\n\n if (bufferEnd < end) {\n if (bufferEnd > end - maxFragLookUpTolerance) {\n maxFragLookUpTolerance = 0;\n }\n // Prefer the next fragment if it's within tolerance\n if (fragNext && !fragmentWithinToleranceTest(fragNext)) {\n foundFrag = fragNext;\n } else {\n foundFrag = BinarySearch.search(fragments, fragmentWithinToleranceTest);\n }\n } else {\n // reach end of playlist\n foundFrag = fragments[fragLen-1];\n }\n if (foundFrag) {\n frag = foundFrag;\n const curSNIdx = frag.sn - levelDetails.startSN;\n const sameLevel = fragPrevious && frag.level === fragPrevious.level;\n const prevFrag = fragments[curSNIdx - 1];\n const nextFrag = fragments[curSNIdx + 1];\n //logger.log('find SN matching with pos:' + bufferEnd + ':' + frag.sn);\n if (fragPrevious && frag.sn === fragPrevious.sn) {\n if (sameLevel && !frag.backtracked) {\n if (frag.sn < levelDetails.endSN) {\n let deltaPTS = fragPrevious.deltaPTS;\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 = prevFrag;\n 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 = nextFrag;\n logger.log(`SN just loaded, load next one: ${frag.sn}`);\n }\n } else {\n frag = null;\n }\n } else if (frag.backtracked) {\n // Only backtrack a max of 1 consecutive fragment to prevent sliding back too far when little or no frags start with keyframes\n if (nextFrag && nextFrag.backtracked) {\n logger.warn(`Already backtracked from fragment ${nextFrag.sn}, will not backtrack to fragment ${frag.sn}. Loading fragment ${nextFrag.sn}`);\n frag = nextFrag;\n } else {\n // If a fragment has dropped frames and it's in a same level/sequence, load the previous fragment to try and find the keyframe\n // 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\n logger.warn('Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe');\n frag.dropped = 0;\n if (prevFrag) {\n if (prevFrag.loadCounter) {\n prevFrag.loadCounter--;\n }\n frag = prevFrag;\n frag.backtracked = true;\n } else if (curSNIdx) {\n // can't backtrack on very first fragment\n frag = null;\n }\n }\n }\n }\n }\n return frag;\n }\n\n _loadFragmentOrKey(frag, level, levelDetails, pos, bufferEnd) {\n const 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 && frag.decryptdata.uri != null) && (frag.decryptdata.key == null)) {\n logger.log(`Loading key for ${frag.sn} of [${levelDetails.startSN} ,${levelDetails.endSN}],level ${level}`);\n this.state = State.KEY_LOADING;\n hls.trigger(Event.KEY_LOADING, {frag: frag});\n } else {\n 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 let 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(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: 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 if (!isNaN(frag.sn)) {\n this.nextLoadPosition = frag.start + frag.duration;\n }\n frag.autoLevel = hls.autoLevelEnabled;\n frag.bitrateTest = this.bitrateTest;\n hls.trigger(Event.FRAG_LOADING, {frag: frag});\n // lazy demuxer init, as this could take some time ... do it during frag loading\n if (!this.demuxer) {\n this.demuxer = new Demuxer(hls,'main');\n }\n this.state = State.FRAG_LOADING;\n return;\n }\n }\n\n set state(nextState) {\n if (this.state !== nextState) {\n const previousState = this.state;\n this._state = nextState;\n logger.log(`main stream:${previousState}->${nextState}`);\n this.hls.trigger(Event.STREAM_STATE_TRANSITION, {previousState, nextState});\n }\n }\n\n get state() {\n return this._state;\n }\n\n getBufferedFrag(position) {\n return BinarySearch.search(this._bufferedFrags, function(frag) {\n if (position < frag.startPTS) {\n return -1;\n } else if (position > frag.endPTS) {\n return 1;\n }\n return 0;\n });\n }\n\n get currentLevel() {\n let media = this.media;\n if (media) {\n const frag = this.getBufferedFrag(media.currentTime);\n if (frag) {\n return frag.level;\n }\n }\n return -1;\n }\n\n get nextBufferedFrag() {\n let media = this.media;\n if (media) {\n // first get end range of current fragment\n return this.followingBufferedFrag(this.getBufferedFrag(media.currentTime));\n } else {\n return null;\n }\n }\n\n followingBufferedFrag(frag) {\n if (frag) {\n // try to get range of next fragment (500ms after this range)\n return this.getBufferedFrag(frag.endPTS + 0.5);\n }\n return null;\n }\n\n get nextLevel() {\n const frag = this.nextBufferedFrag;\n if (frag) {\n return frag.level;\n } else {\n return -1;\n }\n }\n\n _checkFragmentChanged() {\n var fragPlayingCurrent, currentTime, 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 (BufferHelper.isBuffered(video,currentTime)) {\n fragPlayingCurrent = this.getBufferedFrag(currentTime);\n } else if (BufferHelper.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 fragPlayingCurrent = this.getBufferedFrag(currentTime + 0.1);\n }\n if (fragPlayingCurrent) {\n var fragPlaying = fragPlayingCurrent;\n if (fragPlaying !== this.fragPlaying) {\n this.hls.trigger(Event.FRAG_CHANGED, {frag: fragPlaying});\n const fragPlayingLevel = fragPlaying.level;\n if (!this.fragPlaying || this.fragPlaying.level !== fragPlayingLevel) {\n this.hls.trigger(Event.LEVEL_SWITCHED, {level: fragPlayingLevel});\n }\n this.fragPlaying = 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 immediateLevelSwitch() {\n logger.log('immediateLevelSwitch');\n if (!this.immediateSwitch) {\n this.immediateSwitch = true;\n let media = this.media, previouslyPaused;\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 // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n // flush everything\n this.flushMainBuffer(0,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 immediateLevelSwitchEnd() {\n let media = this.media;\n if (media && media.buffered.length) {\n this.immediateSwitch = false;\n if(BufferHelper.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 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 let media = this.media;\n // ensure that media is defined and that metadata are available (to retrieve currentTime)\n if (media && media.readyState) {\n let fetchdelay, fragPlayingCurrent, nextBufferedFrag;\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * this.config.fragLoadingLoopThreshold;\n fragPlayingCurrent = this.getBufferedFrag(media.currentTime);\n if (fragPlayingCurrent && fragPlayingCurrent.startPTS > 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.flushMainBuffer(0,fragPlayingCurrent.startPTS - 1);\n }\n if (!media.paused) {\n // add a safety delay of 1s\n var nextLevelId = this.hls.nextLoadLevel,nextLevel = this.levels[nextLevelId], 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 nextBufferedFrag = this.getBufferedFrag(media.currentTime + fetchdelay);\n if (nextBufferedFrag) {\n // we can flush buffer range following this one without stalling playback\n nextBufferedFrag = this.followingBufferedFrag(nextBufferedFrag);\n if (nextBufferedFrag) {\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 // start flush position is the start PTS of next buffered frag.\n // we use frag.naxStartPTS which is max(audio startPTS, video startPTS).\n // in case there is a small PTS Delta between audio and video, using maxStartPTS avoids flushing last samples from current fragment\n this.flushMainBuffer(nextBufferedFrag.maxStartPTS , Number.POSITIVE_INFINITY);\n }\n }\n }\n }\n\n flushMainBuffer(startOffset,endOffset) {\n this.state = State.BUFFER_FLUSHING;\n let flushScope = {startOffset: startOffset, endOffset: endOffset};\n // if alternate audio tracks are used, only flush video, otherwise flush everything\n if (this.altAudio) {\n flushScope.type = 'video';\n }\n this.hls.trigger(Event.BUFFER_FLUSHING, flushScope);\n }\n\n 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 let config = this.config;\n if(this.levels && config.autoStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n\n onMediaDetaching() {\n var media = this.media;\n if (media && media.ended) {\n 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(level => {\n if(level.details) {\n level.details.fragments.forEach(fragment => {\n fragment.loadCounter = undefined;\n fragment.backtracked = 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 = this.mediaBuffer = null;\n this.loadedmetadata = false;\n this.stopLoad();\n }\n\n onMediaSeeking() {\n let media = this.media, currentTime = media ? media.currentTime : undefined, config = this.config;\n if (!isNaN(currentTime)) {\n logger.log(`media seeking to ${currentTime.toFixed(3)}`);\n }\n let mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media;\n let bufferInfo = BufferHelper.bufferInfo(mediaBuffer,currentTime,this.config.maxBufferHole);\n if (this.state === State.FRAG_LOADING) {\n let 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 let 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.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.log('seeking outside of buffer but within currently loaded fragment range');\n }\n }\n } else if (this.state === State.ENDED) {\n // if seeking to unbuffered area, clean up fragPrevious\n if (bufferInfo.len === 0) {\n this.fragPrevious = 0;\n }\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 // in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target\n if(!this.loadedmetadata) {\n this.nextLoadPosition = this.startPosition = currentTime;\n }\n // tick to speed up processing\n this.tick();\n }\n\n onMediaSeeked() {\n const media = this.media, currentTime = media ? media.currentTime : undefined;\n if (!isNaN(currentTime)) {\n logger.log(`media seeked to ${currentTime.toFixed(3)}`);\n }\n // tick to speed up FRAGMENT_PLAYING triggering\n this.tick();\n }\n\n onMediaEnded() {\n logger.log('media ended');\n // reset startPosition and lastCurrentTime to restart playback @ stream beginning\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n\n onManifestLoading() {\n // reset buffer on manifest loading\n logger.log('trigger BUFFER_RESET');\n this.hls.trigger(Event.BUFFER_RESET);\n this._bufferedFrags = [];\n this.stalled = false;\n this.startPosition = this.lastCurrentTime = 0;\n }\n\n onManifestParsed(data) {\n var aac = false, heaac = false, codec;\n data.levels.forEach(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.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 let config = this.config;\n if (config.autoStartLoad || this.forceStartLoad) {\n this.hls.startLoad(config.startPosition);\n }\n }\n\n 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.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 LevelHelper.mergeDetails(curDetails,newDetails);\n sliding = newDetails.fragments[0].start;\n this.liveSyncPosition = this.computeLivePosition(sliding, curDetails);\n if (newDetails.PTSKnown) {\n logger.log(`live playlist sliding:${sliding.toFixed(3)}`);\n } else {\n logger.log('live playlist - outdated PTS, unknown sliding');\n }\n } else {\n newDetails.PTSKnown = false;\n 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(Event.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 let startTimeOffset = newDetails.startTimeOffset;\n if(!isNaN(startTimeOffset)) {\n if (startTimeOffset < 0) {\n logger.log(`negative start time offset ${startTimeOffset}, count from end of last fragment`);\n startTimeOffset = sliding + duration + startTimeOffset;\n }\n 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.log(`configure startPosition to ${this.startPosition}`);\n } else {\n this.startPosition = 0;\n }\n }\n this.lastCurrentTime = this.startPosition;\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 onKeyLoaded() {\n if (this.state === State.KEY_LOADING) {\n this.state = State.IDLE;\n this.tick();\n }\n }\n\n onFragLoaded(data) {\n var fragCurrent = this.fragCurrent,\n fragLoaded = data.frag;\n if (this.state === State.FRAG_LOADING &&\n fragCurrent &&\n fragLoaded.type === 'main' &&\n fragLoaded.level === fragCurrent.level &&\n fragLoaded.sn === fragCurrent.sn) {\n let stats = data.stats,\n currentLevel = this.levels[fragCurrent.level],\n details = currentLevel.details;\n 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 this.stats = stats;\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(Event.FRAG_BUFFERED, {stats: stats, frag: fragCurrent, id : 'main'});\n this.tick();\n } else if (fragLoaded.sn === 'initSegment') {\n this.state = State.IDLE;\n stats.tparsed = stats.tbuffered = performance.now();\n details.initSegment.data = data.payload;\n this.hls.trigger(Event.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 let duration = details.totalduration,\n level = fragCurrent.level,\n sn = fragCurrent.sn,\n audioCodec = this.config.defaultAudioCodec || currentLevel.audioCodec;\n if(this.audioCodecSwap) {\n 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.pendingBuffering = true;\n this.appended = false;\n logger.log(`Parsing ${sn} of [${details.startSN} ,${details.endSN}],level ${level}, cc ${fragCurrent.cc}`);\n let demuxer = this.demuxer;\n if (!demuxer) {\n demuxer = this.demuxer = new Demuxer(this.hls,'main');\n }\n // 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)\n let media = this.media;\n let mediaSeeking = media && media.seeking;\n let accurateTimeOffset = !mediaSeeking && (details.PTSKnown || !details.live);\n let initSegmentData = details.initSegment ? details.initSegment.data : [];\n demuxer.push(data.payload, initSegmentData,audioCodec, currentLevel.videoCodec, fragCurrent, duration, accurateTimeOffset,undefined);\n }\n }\n this.fragLoadError = 0;\n }\n\n onFragParsingInitSegment(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'main' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n var tracks = data.tracks, trackName, 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.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 && track.container !== 'audio/mpeg') { // Exclude mpeg audio\n audioCodec = 'mp4a.40.2';\n 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 this.hls.trigger(Event.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.log(`main track:${trackName},container:${track.container},codecs[level/parsed]=[${track.levelCodec}/${track.codec}]`);\n var initSegment = track.initSegment;\n if (initSegment) {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n this.hls.trigger(Event.BUFFER_APPENDING, {type: trackName, data: initSegment, parent : 'main', content : 'initSegment'});\n }\n }\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsingData(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'main' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n !(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 = fragCurrent;\n if (isNaN(data.endPTS)) {\n data.endPTS = data.startPTS + fragCurrent.duration;\n data.endDTS = data.startDTS + fragCurrent.duration;\n }\n\n 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 // Detect gaps in a fragment and try to fix it by finding a keyframe in the previous fragment (see _findFragments)\n if(data.type === 'video') {\n frag.dropped = data.dropped;\n if (frag.dropped) {\n if (!frag.backtracked) {\n logger.warn('missing video frame(s), backtracking fragment');\n // Return back to the IDLE state without appending to buffer\n // Causes findFragments to backtrack a segment and find the keyframe\n // Audio fragments arriving before video sets the nextLoadPosition, causing _findFragments to skip the backtracked fragment\n frag.backtracked = true;\n this.nextLoadPosition = data.startPTS;\n this.state = State.IDLE;\n this.fragPrevious = frag;\n this.tick();\n return;\n } else {\n logger.warn('Already backtracked on this fragment, appending with the gap');\n }\n } else {\n // Only reset the backtracked flag if we've loaded the frag without any dropped frames\n frag.backtracked = false;\n }\n }\n\n var drift = LevelHelper.updateFragPTSDTS(level.details,frag,data.startPTS,data.endPTS,data.startDTS,data.endDTS),\n hls = this.hls;\n hls.trigger(Event.LEVEL_PTS_UPDATED, {details: level.details, level: this.level, drift: drift, type: data.type, start: data.startPTS, end: data.endPTS});\n\n // has remuxer dropped video frames located before first keyframe ?\n [data.data1, data.data2].forEach(buffer => {\n // only append in PARSING state (rationale is that an appending error could happen synchronously on first segment appending)\n // in that case it is useless to append following segments\n if (buffer && buffer.length && this.state === State.PARSING) {\n this.appended = true;\n // arm pending Buffering flag before appending a segment\n this.pendingBuffering = true;\n hls.trigger(Event.BUFFER_APPENDING, {type: data.type, data: buffer, parent : 'main',content : 'data'});\n }\n });\n //trigger handler right now\n this.tick();\n }\n }\n\n onFragParsed(data) {\n const fragCurrent = this.fragCurrent;\n const fragNew = data.frag;\n if (fragCurrent &&\n data.id === 'main' &&\n fragNew.sn === fragCurrent.sn &&\n fragNew.level === fragCurrent.level &&\n this.state === State.PARSING) {\n this.stats.tparsed = performance.now();\n this.state = State.PARSED;\n this._checkAppendedParsed();\n }\n }\n\n onAudioTrackSwitching(data) {\n // if any URL found on new audio track, it is an alternate audio track\n var altAudio = !!data.url,\n trackId = data.id;\n // if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered\n // don't do anything if we switch to alt audio: audio stream controller is handling it.\n // we will just have to change buffer scheduling on audioTrackSwitched\n if (!altAudio) {\n if (this.mediaBuffer !== this.media) {\n logger.log(`switching on main audio, use media.buffered to schedule main fragment loading`);\n this.mediaBuffer = this.media;\n let 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.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 let hls = this.hls;\n // switching to main audio, flush all audio and trigger track switched\n hls.trigger(Event.BUFFER_FLUSHING, {startOffset: 0 , endOffset: Number.POSITIVE_INFINITY, type : 'audio'});\n hls.trigger(Event.AUDIO_TRACK_SWITCHED, {id : trackId});\n this.altAudio = false;\n }\n }\n\n onAudioTrackSwitched(data) {\n var trackId = data.id,\n altAudio = !!this.hls.audioTracks[trackId].url;\n if (altAudio) {\n let videoBuffer = this.videoBuffer;\n // if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered\n if (videoBuffer && this.mediaBuffer !== videoBuffer) {\n logger.log(`switching on alternate audio, use video.buffered to schedule main fragment loading`);\n this.mediaBuffer = videoBuffer;\n }\n }\n this.altAudio = altAudio;\n this.tick();\n }\n\n\n\n onBufferCreated(data) {\n let tracks = data.tracks, mediaTrack, name, alternate = false;\n for(var type in tracks) {\n let 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.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 onBufferAppended(data) {\n if (data.parent === 'main') {\n const state = this.state;\n if (state === State.PARSING || state === State.PARSED) {\n // check if all buffers have been appended\n this.pendingBuffering = (data.pending > 0);\n this._checkAppendedParsed();\n }\n }\n }\n\n _checkAppendedParsed() {\n //trigger handler right now\n if (this.state === State.PARSED && (!this.appended || !this.pendingBuffering)) {\n const frag = this.fragCurrent;\n if (frag) {\n const media = this.mediaBuffer ? this.mediaBuffer : this.media;\n logger.log(`main buffered : ${TimeRanges.toString(media.buffered)}`);\n // filter fragments potentially evicted from buffer. this is to avoid memleak on live streams\n let bufferedFrags = this._bufferedFrags.filter(frag => {return BufferHelper.isBuffered(media,(frag.startPTS + frag.endPTS) / 2);});\n // push new range\n bufferedFrags.push(frag);\n // sort frags, as we use BinarySearch for lookup in getBufferedFrag ...\n this._bufferedFrags = bufferedFrags.sort(function(a,b) {return (a.startPTS - b.startPTS);});\n this.fragPrevious = frag;\n const stats = this.stats;\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(Event.FRAG_BUFFERED, {stats: stats, frag: frag, id : 'main'});\n this.state = State.IDLE;\n }\n this.tick();\n }\n }\n\n onError(data) {\n let 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 let media = this.media,\n // 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end\n mediaBuffered = media && BufferHelper.isBuffered(media,media.currentTime) && BufferHelper.isBuffered(media,media.currentTime+0.5);\n switch(data.details) {\n case ErrorDetails.FRAG_LOAD_ERROR:\n case ErrorDetails.FRAG_LOAD_TIMEOUT:\n case ErrorDetails.KEY_LOAD_ERROR:\n case ErrorDetails.KEY_LOAD_TIMEOUT:\n if(!data.fatal) {\n var loadError = this.fragLoadError;\n if(loadError) {\n loadError++;\n } else {\n loadError=1;\n }\n let config = this.config;\n // keep retrying / don't raise fatal network error if current position is buffered or if in automode with current level not 0\n if (loadError <= config.fragLoadingMaxRetry || mediaBuffered || (frag.autoLevel && frag.level)) {\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.warn(`mediaController: frag loading failed, retry in ${delay} ms`);\n this.retryDate = performance.now() + delay;\n // retry loading state\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 this.nextLoadPosition = this.startPosition;\n }\n this.state = State.FRAG_LOADING_WAITING_RETRY;\n } else {\n logger.error(`mediaController: ${data.details} reaches max retry, redispatch as fatal ...`);\n // switch error to fatal\n data.fatal = true;\n this.state = State.ERROR;\n }\n }\n break;\n case 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 // switch error to fatal\n data.fatal = true;\n this.state = State.ERROR;\n }\n }\n }\n break;\n case ErrorDetails.LEVEL_LOAD_ERROR:\n case ErrorDetails.LEVEL_LOAD_TIMEOUT:\n if(this.state !== State.ERROR) {\n if (data.fatal) {\n // if fatal error, stop processing\n this.state = State.ERROR;\n logger.warn(`streamController: ${data.details},switch to ${this.state} state ...`);\n } else {\n // in case of non fatal error while loading level, if level controller is not retrying to load level , switch back to IDLE\n if (!data.levelRetry && this.state === State.WAITING_LEVEL) {\n this.state = State.IDLE;\n }\n }\n }\n break;\n case ErrorDetails.BUFFER_FULL_ERROR:\n // if in appending state\n if (data.parent === 'main' && (this.state === State.PARSING || this.state === State.PARSED)) {\n // reduce max buf len if current position is buffered\n if (mediaBuffered) {\n this._reduceMaxBufferLength(this.config.maxBufferLength);\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/video-dev/hls.js/pull/708\n // in that case flush the whole buffer to recover\n logger.warn('buffer full error also media.currentTime is not buffered, flush everything');\n this.fragCurrent = null;\n // flush everything\n this.flushMainBuffer(0,Number.POSITIVE_INFINITY);\n }\n }\n break;\n default:\n break;\n }\n }\n\n _reduceMaxBufferLength(minLength) {\n let 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.warn(`main:reduce max buffer length to ${config.maxMaxBufferLength}s`);\n // increase fragment load Index to avoid frag loop loading error after buffer flush\n this.fragLoadIdx += 2 * config.fragLoadingLoopThreshold;\n }\n }\n\n_checkBuffer() {\n var media = this.media,\n config = this.config;\n // if ready state different from HAVE_NOTHING (numeric value 0), we are allowed to seek\n if(media && media.readyState) {\n let currentTime = media.currentTime,\n mediaBuffer = this.mediaBuffer ? this.mediaBuffer : media,\n buffered = mediaBuffer.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 let startPosition = media.seeking ? currentTime : this.startPosition,\n startPositionBuffered = BufferHelper.isBuffered(mediaBuffer,startPosition),\n firstbufferedPosition = buffered.start(0);\n // if currentTime not matching with expected startPosition or startPosition not buffered\n if (currentTime !== startPosition ||\n (!startPositionBuffered && (Math.abs(startPosition-firstbufferedPosition) < config.maxSeekHole))) {\n logger.log(`target start position:${startPosition}`);\n // if startPosition not buffered, let's seek to buffered.start(0)\n if(!startPositionBuffered) {\n startPosition = firstbufferedPosition;\n logger.log(`target start position not buffered, seek to buffered.start(0) ${startPosition}`);\n }\n logger.log(`adjust currentTime from ${currentTime} to ${startPosition}`);\n media.currentTime = startPosition;\n }\n } else if (this.immediateSwitch) {\n this.immediateLevelSwitchEnd();\n } else {\n let bufferInfo = BufferHelper.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), // not playing if nothing buffered\n jumpThreshold = 0.5, // tolerance needed as some browsers stalls playback before reaching buffered range end\n playheadMoving = currentTime !== this.lastCurrentTime;\n\n if (playheadMoving) {\n // played moving, but was previously stalled => now not stuck anymore\n if (this.stallReported) {\n logger.warn(`playback not stuck anymore @${currentTime}, after ${Math.round(performance.now()-this.stalled)}ms`);\n this.stallReported = false;\n }\n this.stalled = undefined;\n this.nudgeRetry = 0;\n } else {\n // playhead not moving\n if(expectedPlaying) {\n // playhead not moving BUT media expected to play\n const tnow = performance.now();\n const hls = this.hls;\n if(!this.stalled) {\n // stall just detected, store current time\n this.stalled = tnow;\n this.stallReported = false;\n } else {\n // playback already stalled, check stalling duration\n // if stalling for more than a given threshold, let's try to recover\n const stalledDuration = tnow - this.stalled;\n const bufferLen = bufferInfo.len;\n let nudgeRetry = this.nudgeRetry || 0;\n // have we reached stall deadline ?\n if (bufferLen <= jumpThreshold && stalledDuration > config.lowBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n logger.warn(`playback stalling in low buffer @${currentTime}`);\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer : bufferLen});\n }\n // if buffer len is below threshold, try to jump to start of next buffer range if close\n // no buffer available @ currentTime, check if next buffer is close (within a config.maxSeekHole second range)\n var nextBufferStart = bufferInfo.nextStart, delta = nextBufferStart-currentTime;\n if(nextBufferStart &&\n (delta < config.maxSeekHole) &&\n (delta > 0)) {\n this.nudgeRetry = ++nudgeRetry;\n const nudgeOffset = nudgeRetry * config.nudgeOffset;\n // next buffer is close ! adjust currentTime to nextBufferStart\n // this will ensure effective video decoding\n logger.log(`adjust currentTime from ${media.currentTime} to next buffered @ ${nextBufferStart} + nudge ${nudgeOffset}`);\n media.currentTime = nextBufferStart + nudgeOffset;\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole : nextBufferStart + nudgeOffset - currentTime});\n }\n } else if (bufferLen > jumpThreshold && stalledDuration > config.highBufferWatchdogPeriod * 1000) {\n // report stalled error once\n if (!this.stallReported) {\n this.stallReported = true;\n logger.warn(`playback stalling in high buffer @${currentTime}`);\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: false, buffer : bufferLen});\n }\n // reset stalled so to rearm watchdog timer\n this.stalled = undefined;\n this.nudgeRetry = ++nudgeRetry;\n if (nudgeRetry < config.nudgeMaxRetry) {\n const currentTime = media.currentTime;\n const targetTime = currentTime + nudgeRetry * config.nudgeOffset;\n logger.log(`adjust currentTime from ${currentTime} to ${targetTime}`);\n // playback stalled in buffered area ... let's nudge currentTime to try to overcome this\n media.currentTime = targetTime;\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_NUDGE_ON_STALL, fatal: false});\n } else {\n logger.error(`still stuck in high buffer @${currentTime} after ${config.nudgeMaxRetry}, raise fatal error`);\n hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: true});\n }\n }\n }\n }\n }\n }\n }\n }\n\n 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 this.nextLoadPosition = this.startPosition;\n }\n this.tick();\n }\n\n onBufferFlushed() {\n /* after successful buffer flushing, filter flushed fragments from bufferedFrags\n use mediaBuffered instead of media (so that we will check against video.buffered ranges in case of alt audio track)\n */\n const media = this.mediaBuffer ? this.mediaBuffer : this.media;\n this._bufferedFrags = this._bufferedFrags.filter(frag => {return BufferHelper.isBuffered(media,(frag.startPTS + frag.endPTS) / 2);});\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 swapAudioCodec() {\n this.audioCodecSwap = !this.audioCodecSwap;\n }\n\n computeLivePosition(sliding, levelDetails) {\n let 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 get liveSyncPosition() {\n return this._liveSyncPosition;\n }\n\n set liveSyncPosition(value) {\n this._liveSyncPosition = value;\n }\n}\nexport default StreamController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/stream-controller.js","/*\n * Subtitle Stream Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nclass SubtitleStreamController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.ERROR,\n Event.SUBTITLE_TRACKS_UPDATED,\n Event.SUBTITLE_TRACK_SWITCH,\n Event.SUBTITLE_TRACK_LOADED,\n Event.SUBTITLE_FRAG_PROCESSED);\n this.config = hls.config;\n this.vttFragSNsProcessed = {};\n this.vttFragQueues = undefined;\n this.currentlyProcessing = null;\n this.currentTrackId = -1;\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n // Remove all queued items and create a new, empty queue for each track.\n clearVttFragQueues() {\n this.vttFragQueues = {};\n this.tracks.forEach(track => {\n this.vttFragQueues[track.id] = [];\n });\n }\n\n // If no frag is being processed and queue isn't empty, initiate processing of next frag in line.\n nextFrag() {\n if(this.currentlyProcessing === null && this.currentTrackId > -1 && this.vttFragQueues[this.currentTrackId].length) {\n let frag = this.currentlyProcessing = this.vttFragQueues[this.currentTrackId].shift();\n this.hls.trigger(Event.FRAG_LOADING, {frag});\n }\n }\n\n // When fragment has finished processing, add sn to list of completed if successful.\n onSubtitleFragProcessed(data) {\n if(data.success) {\n this.vttFragSNsProcessed[data.frag.trackId].push(data.frag.sn);\n }\n this.currentlyProcessing = null;\n this.nextFrag();\n }\n\n // If something goes wrong, procede to next frag, if we were processing one.\n onError(data) {\n let frag = data.frag;\n // don't handle frag error not related to subtitle fragment\n if (frag && frag.type !== 'subtitle') {\n return;\n }\n if(this.currentlyProcessing) {\n this.currentlyProcessing = null;\n this.nextFrag();\n }\n }\n\n // Got all new subtitle tracks.\n onSubtitleTracksUpdated(data) {\n logger.log('subtitle tracks updated');\n this.tracks = data.subtitleTracks;\n this.clearVttFragQueues();\n this.vttFragSNsProcessed = {};\n this.tracks.forEach(track => {\n this.vttFragSNsProcessed[track.id] = [];\n });\n }\n\n onSubtitleTrackSwitch(data) {\n this.currentTrackId = data.id;\n this.clearVttFragQueues();\n }\n\n // Got a new set of subtitle fragments.\n onSubtitleTrackLoaded(data) {\n const processedFragSNs = this.vttFragSNsProcessed[data.id],\n fragQueue = this.vttFragQueues[data.id],\n currentFragSN = !!this.currentlyProcessing ? this.currentlyProcessing.sn : -1;\n\n const alreadyProcessed = function(frag) {\n return processedFragSNs.indexOf(frag.sn) > -1;\n };\n\n const alreadyInQueue = function(frag) {\n return fragQueue.some(fragInQueue => {return fragInQueue.sn === frag.sn;});\n };\n\n // Add all fragments that haven't been, aren't currently being and aren't waiting to be processed, to queue.\n data.details.fragments.forEach(frag => {\n if(!(alreadyProcessed(frag) || frag.sn === currentFragSN || alreadyInQueue(frag))) {\n // Frags don't know their subtitle track ID, so let's just add that...\n frag.trackId = data.id;\n fragQueue.push(frag);\n }\n });\n\n this.nextFrag();\n }\n}\nexport default SubtitleStreamController;\n\n\n\n\n// WEBPACK FOOTER //\n// src/controller/subtitle-stream-controller.js","/*\n * audio track controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {logger} from '../utils/logger';\n\nfunction filterSubtitleTracks(textTrackList) {\n let tracks = [];\n for (let i = 0; i < textTrackList.length; i++) {\n if (textTrackList[i].kind === 'subtitles') {\n tracks.push(textTrackList[i]);\n }\n }\n return tracks;\n}\n\nclass SubtitleTrackController extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MEDIA_ATTACHED,\n Event.MEDIA_DETACHING,\n Event.MANIFEST_LOADING,\n Event.MANIFEST_LOADED,\n Event.SUBTITLE_TRACK_LOADED);\n this.tracks = [];\n this.trackId = -1;\n this.media = undefined;\n }\n\n _onTextTracksChanged() {\n // Media is undefined when switching streams via loadSource()\n if (!this.media) {\n return;\n }\n\n let trackId = -1;\n let tracks = filterSubtitleTracks(this.media.textTracks);\n for (let id = 0; id < tracks.length; id++) {\n if (tracks[id].mode === 'showing') {\n trackId = id;\n }\n }\n\n // Setting current subtitleTrack will invoke code.\n this.subtitleTrack = trackId;\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n // Listen for subtitle track change, then extract the current track ID.\n onMediaAttached(data) {\n this.media = data.media;\n if (!this.media) {\n return;\n }\n\n this.trackChangeListener = this._onTextTracksChanged.bind(this);\n this.media.textTracks.addEventListener('change', this.trackChangeListener);\n }\n\n onMediaDetaching() {\n if (!this.media) {\n return;\n }\n\n this.media.textTracks.removeEventListener('change', this.trackChangeListener);\n\n this.media = undefined;\n }\n\n // Reset subtitle tracks on manifest loading\n onManifestLoading() {\n this.tracks = [];\n this.trackId = -1;\n }\n\n // Fired whenever a new manifest is loaded.\n onManifestLoaded(data) {\n let tracks = data.subtitles || [];\n let defaultFound = false;\n this.tracks = tracks;\n this.trackId = -1;\n this.hls.trigger(Event.SUBTITLE_TRACKS_UPDATED, {subtitleTracks : tracks});\n\n // loop through available subtitle tracks and autoselect default if needed\n // TODO: improve selection logic to handle forced, etc\n tracks.forEach(track => {\n if (track.default) {\n this.subtitleTrack = track.id;\n defaultFound = true;\n }\n });\n }\n\n // Trigger subtitle track playlist reload.\n onTick() {\n const trackId = this.trackId;\n const subtitleTrack = this.tracks[trackId];\n if (!subtitleTrack) {\n return;\n }\n\n const details = subtitleTrack.details;\n // check if we need to load playlist for this subtitle Track\n if (details === undefined || details.live === true) {\n // track not retrieved yet, or live playlist we need to (re)load it\n logger.log(`(re)loading playlist for subtitle track ${trackId}`);\n this.hls.trigger(Event.SUBTITLE_TRACK_LOADING, {url: subtitleTrack.url, id: trackId});\n }\n }\n\n onSubtitleTrackLoaded(data) {\n if (data.id < this.tracks.length) {\n logger.log(`subtitle track ${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(() => {\n this.onTick();\n }, 1000 * data.details.targetduration, this);\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 subtitle tracks list from playlist **/\n get subtitleTracks() {\n return this.tracks;\n }\n\n /** get index of the selected subtitle track (index in subtitle track lists) **/\n get subtitleTrack() {\n return this.trackId;\n }\n\n /** select a subtitle track, based on its index in subtitle track lists**/\n set subtitleTrack(subtitleTrackId) {\n if (this.trackId !== subtitleTrackId) {// || this.tracks[subtitleTrackId].details === undefined) {\n this.setSubtitleTrackInternal(subtitleTrackId);\n }\n }\n\n setSubtitleTrackInternal(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.log(`switching to subtitle track ${newId}`);\n let subtitleTrack = this.tracks[newId];\n this.hls.trigger(Event.SUBTITLE_TRACK_SWITCH, {id: newId});\n // check if we need to load playlist for this subtitle Track\n let details = subtitleTrack.details;\n if (details === undefined || details.live === true) {\n // track not retrieved yet, or live playlist we need to (re)load it\n logger.log(`(re)loading playlist for subtitle track ${newId}`);\n this.hls.trigger(Event.SUBTITLE_TRACK_LOADING, {url: subtitleTrack.url, id: newId});\n }\n }\n }\n}\n\nexport default SubtitleTrackController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/subtitle-track-controller.js","/*\n * Timeline Controller\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport Cea608Parser from '../utils/cea-608-parser';\nimport WebVTTParser from '../utils/webvtt-parser';\nimport {logger} from '../utils/logger';\n\nfunction clearCurrentCues(track) {\n if (track && track.cues) {\n while (track.cues.length > 0) {\n track.removeCue(track.cues[0]);\n }\n }\n}\n\nfunction reuseVttTextTrack(inUseTrack, manifestTrack) {\n return inUseTrack && inUseTrack.label === manifestTrack.name && !(inUseTrack.textTrack1 || inUseTrack.textTrack2);\n}\n\nfunction intersection(x1, x2, y1, y2) {\n return Math.min(x2, y2) - Math.max(x1, y1);\n}\n\nclass TimelineController extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.MEDIA_ATTACHING,\n Event.MEDIA_DETACHING,\n Event.FRAG_PARSING_USERDATA,\n Event.MANIFEST_LOADING,\n Event.MANIFEST_LOADED,\n Event.FRAG_LOADED,\n Event.LEVEL_SWITCHING,\n Event.INIT_PTS_FOUND);\n\n this.hls = hls;\n this.config = hls.config;\n this.enabled = true;\n this.Cues = hls.config.cueHandler;\n this.textTracks = [];\n this.tracks = [];\n this.unparsedVttFrags = [];\n this.initPTS = undefined;\n this.cueRanges = [];\n\n if (this.config.enableCEA708Captions)\n {\n var self = this;\n var sendAddTrackEvent = function (track, media)\n {\n var e = null;\n try {\n e = new window.Event('addtrack');\n } catch (err) {\n //for IE11\n e = document.createEvent('Event');\n e.initEvent('addtrack', false, false);\n }\n e.track = track;\n media.dispatchEvent(e);\n };\n\n var channel1 =\n {\n 'newCue': function(startTime, endTime, screen)\n {\n if (!self.textTrack1)\n {\n //Enable reuse of existing text track.\n var existingTrack1 = self.getExistingTrack('1');\n if (!existingTrack1)\n {\n const textTrack1 = self.createTextTrack('captions', self.config.captionsTextTrack1Label, self.config.captionsTextTrack1LanguageCode);\n if (textTrack1) {\n textTrack1.textTrack1 = true;\n self.textTrack1 = textTrack1;\n }\n }\n else\n {\n self.textTrack1 = existingTrack1;\n clearCurrentCues(self.textTrack1);\n\n sendAddTrackEvent(self.textTrack1, self.media);\n }\n }\n self.addCues('textTrack1', startTime, endTime, screen);\n }\n };\n\n var channel2 =\n {\n 'newCue': function(startTime, endTime, screen)\n {\n if (!self.textTrack2)\n {\n //Enable reuse of existing text track.\n var existingTrack2 = self.getExistingTrack('2');\n if (!existingTrack2)\n {\n const textTrack2 = self.createTextTrack('captions', self.config.captionsTextTrack2Label, self.config.captionsTextTrack1LanguageCode);\n if (textTrack2) {\n textTrack2.textTrack2 = true;\n self.textTrack2 = textTrack2;\n }\n }\n else\n {\n self.textTrack2 = existingTrack2;\n clearCurrentCues(self.textTrack2);\n\n sendAddTrackEvent(self.textTrack2, self.media);\n }\n }\n self.addCues('textTrack2', startTime, endTime, screen);\n }\n };\n\n this.cea608Parser = new Cea608Parser(0, channel1, channel2);\n }\n }\n\n addCues(channel, startTime, endTime, screen) {\n // skip cues which overlap more than 50% with previously parsed time ranges\n const ranges = this.cueRanges;\n let merged = false;\n for (let i = ranges.length; i--;) {\n let cueRange = ranges[i];\n let overlap = intersection(cueRange[0], cueRange[1], startTime, endTime);\n if (overlap >= 0) {\n cueRange[0] = Math.min(cueRange[0], startTime);\n cueRange[1] = Math.max(cueRange[1], endTime);\n merged = true;\n if ((overlap / (endTime - startTime)) > 0.5) {\n return;\n }\n }\n }\n if (!merged) {\n ranges.push([startTime, endTime]);\n }\n this.Cues.newCue(this[channel], startTime, endTime, screen);\n }\n\n // Triggered when an initial PTS is found; used for synchronisation of WebVTT.\n onInitPtsFound(data) {\n if (typeof this.initPTS === 'undefined') {\n this.initPTS = data.initPTS;\n }\n\n // Due to asynchrony, initial PTS may arrive later than the first VTT fragments are loaded.\n // Parse any unparsed fragments upon receiving the initial PTS.\n if (this.unparsedVttFrags.length) {\n this.unparsedVttFrags.forEach(frag => {\n this.onFragLoaded(frag);\n });\n this.unparsedVttFrags = [];\n }\n }\n\n getExistingTrack(channelNumber) {\n const media = this.media;\n if (media) {\n for (let i = 0; i < media.textTracks.length; i++) {\n let textTrack = media.textTracks[i];\n let propName = 'textTrack' + channelNumber;\n if (textTrack[propName] === true) {\n return textTrack;\n }\n }\n }\n return null;\n }\n\n createTextTrack(kind, label, lang) {\n const media = this.media;\n if (media)\n {\n return media.addTextTrack(kind, label, lang);\n }\n }\n\n destroy() {\n EventHandler.prototype.destroy.call(this);\n }\n\n onMediaAttaching(data) {\n this.media = data.media;\n }\n\n onMediaDetaching() {\n clearCurrentCues(this.textTrack1);\n clearCurrentCues(this.textTrack2);\n }\n\n onManifestLoading()\n {\n this.lastSn = -1; // Detect discontiguity in fragment parsing\n this.prevCC = -1;\n this.vttCCs = {ccOffset: 0, presentationOffset: 0}; // Detect discontinuity in subtitle manifests\n\n // clear outdated subtitles\n const media = this.media;\n if (media) {\n const textTracks = media.textTracks;\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n clearCurrentCues(textTracks[i]);\n }\n }\n }\n }\n\n onManifestLoaded(data) {\n this.textTracks = [];\n this.unparsedVttFrags = this.unparsedVttFrags || [];\n this.initPTS = undefined;\n this.cueRanges = [];\n\n if (this.config.enableWebVTT) {\n this.tracks = data.subtitles || [];\n const inUseTracks = this.media ? this.media.textTracks : [];\n\n this.tracks.forEach((track, index) => {\n let textTrack;\n if (index < inUseTracks.length) {\n const inUseTrack = inUseTracks[index];\n // Reuse tracks with the same label, but do not reuse 608/708 tracks\n if (reuseVttTextTrack(inUseTrack, track)) {\n textTrack = inUseTrack;\n }\n }\n if (!textTrack) {\n textTrack = this.createTextTrack('subtitles', track.name, track.lang);\n }\n textTrack.mode = track.default ? 'showing' : 'hidden';\n this.textTracks.push(textTrack);\n });\n }\n }\n\n onLevelSwitching() {\n this.enabled = this.hls.currentLevel.closedCaptions !== 'NONE';\n }\n\n onFragLoaded(data) {\n let frag = data.frag,\n payload = data.payload;\n if (frag.type === 'main') {\n var sn = frag.sn;\n // if this frag isn't contiguous, clear the parser so cues with bad start/end times aren't added to the textTrack\n if (sn !== this.lastSn + 1) {\n const cea608Parser = this.cea608Parser;\n if (cea608Parser) {\n cea608Parser.reset();\n }\n }\n this.lastSn = sn;\n }\n // If fragment is subtitle type, parse as WebVTT.\n else if (frag.type === 'subtitle') {\n if (payload.byteLength) {\n // We need an initial synchronisation PTS. Store fragments as long as none has arrived.\n if (typeof this.initPTS === 'undefined') {\n this.unparsedVttFrags.push(data);\n return;\n }\n let vttCCs = this.vttCCs;\n if (!vttCCs[frag.cc]) {\n vttCCs[frag.cc] = { start: frag.start, prevCC: this.prevCC, new: true };\n this.prevCC = frag.cc;\n }\n let textTracks = this.textTracks,\n hls = this.hls;\n\n // Parse the WebVTT file contents.\n WebVTTParser.parse(payload, this.initPTS, vttCCs, frag.cc, function (cues) {\n const currentTrack = textTracks[frag.trackId];\n // Add cues and trigger event with success true.\n cues.forEach(cue => {\n // Sometimes there are cue overlaps on segmented vtts so the same\n // cue can appear more than once in different vtt files.\n // This avoid showing duplicated cues with same timecode and text.\n if (!currentTrack.cues.getCueById(cue.id)) {\n currentTrack.addCue(cue);\n }\n });\n hls.trigger(Event.SUBTITLE_FRAG_PROCESSED, {success: true, frag: frag});\n },\n function (e) {\n // Something went wrong while parsing. Trigger event with success false.\n logger.log(`Failed to parse VTT cue: ${e}`);\n hls.trigger(Event.SUBTITLE_FRAG_PROCESSED, {success: false, frag: frag});\n });\n }\n else {\n // In case there is no payload, finish unsuccessfully.\n this.hls.trigger(Event.SUBTITLE_FRAG_PROCESSED, {success: false, frag: frag});\n }\n }\n }\n\n 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 && this.config.enableCEA708Captions) {\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 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;\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\nexport default TimelineController;\n\n\n\n// WEBPACK FOOTER //\n// src/controller/timeline-controller.js","export default class AESCrypto {\n constructor(subtle,iv) {\n this.subtle = subtle;\n this.aesIV = iv;\n }\n\n decrypt(data, key) {\n return this.subtle.decrypt({name: 'AES-CBC', iv: this.aesIV}, key, data);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/aes-crypto.js","class AESDecryptor {\n constructor() {\n // Static after running initTable\n this.rcon = [0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n this.subMix = [new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];\n this.invSubMix = [new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];\n this.sBox = new Uint32Array(256);\n this.invSBox = new Uint32Array(256);\n\n // Changes during runtime\n this.key = new Uint32Array(0);\n\n this.initTable();\n }\n\n // Using view.getUint32() also swaps the byte order.\n uint8ArrayToUint32Array_(arrayBuffer) {\n let view = new DataView(arrayBuffer);\n let newArray = new Uint32Array(4);\n for (let i = 0; i < 4; i++) {\n newArray[i] = view.getUint32(i * 4);\n }\n return newArray;\n }\n\n initTable() {\n let sBox = this.sBox;\n let invSBox = this.invSBox;\n let subMix = this.subMix;\n let subMix0 = subMix[0];\n let subMix1 = subMix[1];\n let subMix2 = subMix[2];\n let subMix3 = subMix[3];\n let invSubMix = this.invSubMix;\n let invSubMix0 = invSubMix[0];\n let invSubMix1 = invSubMix[1];\n let invSubMix2 = invSubMix[2];\n let invSubMix3 = invSubMix[3];\n\n let d = new Uint32Array(256);\n let x = 0;\n let xi = 0;\n let i = 0;\n for (i = 0; i < 256; i++) {\n if (i < 128) {\n d[i] = i << 1;\n } else {\n d[i] = (i << 1) ^ 0x11b;\n }\n }\n\n for (i = 0; i < 256; i++) {\n let sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);\n sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;\n sBox[x] = sx;\n invSBox[sx] = x;\n\n // Compute multiplication\n let x2 = d[x];\n let x4 = d[x2];\n let x8 = d[x4];\n\n // Compute sub/invSub bytes, mix columns tables\n let t = (d[sx] * 0x101) ^ (sx * 0x1010100);\n subMix0[x] = (t << 24) | (t >>> 8);\n subMix1[x] = (t << 16) | (t >>> 16);\n subMix2[x] = (t << 8) | (t >>> 24);\n subMix3[x] = t;\n\n // Compute inv sub bytes, inv mix columns tables\n t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);\n invSubMix0[sx] = (t << 24) | (t >>> 8);\n invSubMix1[sx] = (t << 16) | (t >>> 16);\n invSubMix2[sx] = (t << 8) | (t >>> 24);\n invSubMix3[sx] = t;\n\n // Compute next counter\n if (!x) {\n x = xi = 1;\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]];\n xi ^= d[d[xi]];\n }\n }\n }\n\n expandKey(keyBuffer) {\n // convert keyBuffer to Uint32Array\n let key = this.uint8ArrayToUint32Array_(keyBuffer);\n let sameKey = true;\n let offset = 0;\n\n while (offset < key.length && sameKey) {\n sameKey = (key[offset] === this.key[offset]);\n offset++;\n }\n\n if (sameKey) {\n return;\n }\n\n this.key = key;\n let keySize = this.keySize = key.length;\n\n if (keySize !== 4 && keySize !== 6 && keySize !== 8) {\n throw new Error('Invalid aes key size=' + keySize);\n }\n\n let ksRows = this.ksRows = (keySize + 6 + 1) * 4;\n let ksRow;\n let invKsRow;\n\n let keySchedule = this.keySchedule = new Uint32Array(ksRows);\n let invKeySchedule = this.invKeySchedule = new Uint32Array(ksRows);\n let sbox = this.sBox;\n let rcon = this.rcon;\n\n let invSubMix = this.invSubMix;\n let invSubMix0 = invSubMix[0];\n let invSubMix1 = invSubMix[1];\n let invSubMix2 = invSubMix[2];\n let invSubMix3 = invSubMix[3];\n\n let prev;\n let t;\n\n for (ksRow = 0; ksRow < ksRows; ksRow++) {\n if (ksRow < keySize) {\n prev = keySchedule[ksRow] = key[ksRow];\n continue;\n }\n t = prev;\n\n if (ksRow % keySize === 0) {\n // Rot word\n t = (t << 8) | (t >>> 24);\n\n // Sub word\n t = (sbox[t >>> 24] << 24) | (sbox[(t >>> 16) & 0xff] << 16) | (sbox[(t >>> 8) & 0xff] << 8) | sbox[t & 0xff];\n\n // Mix Rcon\n t ^= rcon[(ksRow / keySize) | 0] << 24;\n } else if (keySize > 6 && ksRow % keySize === 4) {\n // Sub word\n t = (sbox[t >>> 24] << 24) | (sbox[(t >>> 16) & 0xff] << 16) | (sbox[(t >>> 8) & 0xff] << 8) | sbox[t & 0xff];\n }\n\n keySchedule[ksRow] = prev = (keySchedule[ksRow - keySize] ^ t) >>> 0;\n }\n\n for (invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n ksRow = ksRows - invKsRow;\n if (invKsRow & 3) {\n t = keySchedule[ksRow];\n } else {\n t = keySchedule[ksRow - 4];\n }\n\n if (invKsRow < 4 || ksRow <= 4) {\n invKeySchedule[invKsRow] = t;\n } else {\n invKeySchedule[invKsRow] = invSubMix0[sbox[t >>> 24]] ^ invSubMix1[sbox[(t >>> 16) & 0xff]] ^ invSubMix2[sbox[(t >>> 8) & 0xff]] ^ invSubMix3[sbox[t & 0xff]];\n }\n\n invKeySchedule[invKsRow] = invKeySchedule[invKsRow] >>> 0;\n }\n }\n\n // Adding this as a method greatly improves performance.\n networkToHostOrderSwap(word) {\n return (word << 24) | ((word & 0xff00) << 8) | ((word & 0xff0000) >> 8) | (word >>> 24);\n }\n\n decrypt(inputArrayBuffer, offset, aesIV) {\n let nRounds = this.keySize + 6;\n let invKeySchedule = this.invKeySchedule;\n let invSBOX = this.invSBox;\n\n let invSubMix = this.invSubMix;\n let invSubMix0 = invSubMix[0];\n let invSubMix1 = invSubMix[1];\n let invSubMix2 = invSubMix[2];\n let invSubMix3 = invSubMix[3];\n\n let initVector = this.uint8ArrayToUint32Array_(aesIV);\n let initVector0 = initVector[0];\n let initVector1 = initVector[1];\n let initVector2 = initVector[2];\n let initVector3 = initVector[3];\n\n let inputInt32 = new Int32Array(inputArrayBuffer);\n let outputInt32 = new Int32Array(inputInt32.length);\n\n let t0, t1, t2, t3;\n let s0, s1, s2, s3;\n let inputWords0, inputWords1, inputWords2, inputWords3;\n\n var ksRow, i;\n let swapWord = this.networkToHostOrderSwap;\n\n while (offset < inputInt32.length) {\n inputWords0 = swapWord(inputInt32[offset]);\n inputWords1 = swapWord(inputInt32[offset + 1]);\n inputWords2 = swapWord(inputInt32[offset + 2]);\n inputWords3 = swapWord(inputInt32[offset + 3]);\n\n s0 = inputWords0 ^ invKeySchedule[0];\n s1 = inputWords3 ^ invKeySchedule[1];\n s2 = inputWords2 ^ invKeySchedule[2];\n s3 = inputWords1 ^ invKeySchedule[3];\n\n ksRow = 4;\n\n // Iterate through the rounds of decryption\n for (i = 1; i < nRounds; i++) {\n t0 = invSubMix0[s0 >>> 24] ^ invSubMix1[(s1 >> 16) & 0xff] ^ invSubMix2[(s2 >> 8) & 0xff] ^ invSubMix3[s3 & 0xff] ^ invKeySchedule[ksRow];\n t1 = invSubMix0[s1 >>> 24] ^ invSubMix1[(s2 >> 16) & 0xff] ^ invSubMix2[(s3 >> 8) & 0xff] ^ invSubMix3[s0 & 0xff] ^ invKeySchedule[ksRow + 1];\n t2 = invSubMix0[s2 >>> 24] ^ invSubMix1[(s3 >> 16) & 0xff] ^ invSubMix2[(s0 >> 8) & 0xff] ^ invSubMix3[s1 & 0xff] ^ invKeySchedule[ksRow + 2];\n t3 = invSubMix0[s3 >>> 24] ^ invSubMix1[(s0 >> 16) & 0xff] ^ invSubMix2[(s1 >> 8) & 0xff] ^ invSubMix3[s2 & 0xff] ^ invKeySchedule[ksRow + 3];\n // Update state\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n\n ksRow = ksRow + 4;\n }\n\n // Shift rows, sub bytes, add round key\n t0 = ((invSBOX[s0 >>> 24] << 24) ^ (invSBOX[(s1 >> 16) & 0xff] << 16) ^ (invSBOX[(s2 >> 8) & 0xff] << 8) ^ invSBOX[s3 & 0xff]) ^ invKeySchedule[ksRow];\n t1 = ((invSBOX[s1 >>> 24] << 24) ^ (invSBOX[(s2 >> 16) & 0xff] << 16) ^ (invSBOX[(s3 >> 8) & 0xff] << 8) ^ invSBOX[s0 & 0xff]) ^ invKeySchedule[ksRow + 1];\n t2 = ((invSBOX[s2 >>> 24] << 24) ^ (invSBOX[(s3 >> 16) & 0xff] << 16) ^ (invSBOX[(s0 >> 8) & 0xff] << 8) ^ invSBOX[s1 & 0xff]) ^ invKeySchedule[ksRow + 2];\n t3 = ((invSBOX[s3 >>> 24] << 24) ^ (invSBOX[(s0 >> 16) & 0xff] << 16) ^ (invSBOX[(s1 >> 8) & 0xff] << 8) ^ invSBOX[s2 & 0xff]) ^ invKeySchedule[ksRow + 3];\n ksRow = ksRow + 3;\n\n // Write\n outputInt32[offset] = swapWord(t0 ^ initVector0);\n outputInt32[offset + 1] = swapWord(t3 ^ initVector1);\n outputInt32[offset + 2] = swapWord(t2 ^ initVector2);\n outputInt32[offset + 3] = swapWord(t1 ^ initVector3);\n\n // reset initVector to last 4 unsigned int\n initVector0 = inputWords0;\n initVector1 = inputWords1;\n initVector2 = inputWords2;\n initVector3 = inputWords3;\n\n offset = offset + 4;\n }\n\n return outputInt32.buffer;\n }\n\n destroy() {\n this.key = undefined;\n this.keySize = undefined;\n this.ksRows = undefined;\n\n this.sBox = undefined;\n this.invSBox = undefined;\n this.subMix = undefined;\n this.invSubMix = undefined;\n this.keySchedule = undefined;\n this.invKeySchedule = undefined;\n\n this.rcon = undefined;\n }\n}\n\nexport default AESDecryptor;\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/aes-decryptor.js","import AESCrypto from './aes-crypto';\nimport FastAESKey from './fast-aes-key';\nimport AESDecryptor from './aes-decryptor';\n\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\n/*globals self: false */\n\nclass Decrypter {\n constructor(observer,config) {\n this.observer = observer;\n this.config = config;\n this.logEnabled = true;\n try {\n const browserCrypto = crypto ? crypto : self.crypto;\n this.subtle = browserCrypto.subtle || browserCrypto.webkitSubtle;\n } catch (e) {}\n this.disableWebCrypto = !this.subtle;\n }\n\n isSync() {\n return (this.disableWebCrypto && this.config.enableSoftwareAES);\n }\n\n decrypt(data, key, iv, callback) {\n if (this.disableWebCrypto && this.config.enableSoftwareAES) {\n if (this.logEnabled) {\n logger.log('JS AES decrypt');\n this.logEnabled = false;\n }\n let decryptor = this.decryptor;\n if (!decryptor) {\n this.decryptor = decryptor = new AESDecryptor();\n }\n decryptor.expandKey(key);\n callback(decryptor.decrypt(data, 0, iv));\n }\n else {\n if (this.logEnabled) {\n logger.log('WebCrypto AES decrypt');\n this.logEnabled = false;\n }\n const subtle = this.subtle;\n if (this.key !== key) {\n this.key = key;\n this.fastAesKey = new FastAESKey(subtle,key);\n }\n\n this.fastAesKey.expandKey().\n then((aesKey) => {\n // decrypt using web crypto\n let crypto = new AESCrypto(subtle,iv);\n crypto.decrypt(data, aesKey).\n catch ((err) => {\n this.onWebCryptoError(err, data, key, iv, callback);\n }).\n then((result) => {\n callback(result);\n });\n }).\n catch ((err) => {\n this.onWebCryptoError(err, data, key, iv, callback);\n });\n }\n }\n\n onWebCryptoError(err, data, key, iv, callback) {\n if (this.config.enableSoftwareAES) {\n logger.log('WebCrypto Error, disable WebCrypto API');\n this.disableWebCrypto = true;\n this.logEnabled = true;\n this.decrypt(data, key, iv, callback);\n }\n else {\n logger.error(`decrypting error : ${err.message}`);\n this.observer.trigger(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details : ErrorDetails.FRAG_DECRYPT_ERROR, fatal : true, reason : err.message});\n }\n }\n\n destroy() {\n let decryptor = this.decryptor;\n if (decryptor) {\n decryptor.destroy();\n this.decryptor = undefined;\n }\n }\n}\n\nexport default Decrypter;\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/decrypter.js","class FastAESKey {\n constructor(subtle,key) {\n this.subtle = subtle;\n this.key = key;\n }\n\n expandKey() {\n return this.subtle.importKey('raw', this.key, {name: 'AES-CBC'}, false, ['encrypt', 'decrypt']);\n }\n}\n\nexport default FastAESKey;\n\n\n\n// WEBPACK FOOTER //\n// src/crypt/fast-aes-key.js","/**\n * AAC demuxer\n */\nimport ADTS from './adts';\nimport { logger } from '../utils/logger';\nimport ID3 from '../demux/id3';\n\nclass AACDemuxer {\n\n constructor(observer, remuxer, config) {\n this.observer = observer;\n this.config = config;\n this.remuxer = remuxer;\n }\n\n resetInitSegment(initSegment, audioCodec, videoCodec, duration) {\n this._audioTrack = { container: 'audio/adts', type: 'audio', id: -1, sequenceNumber: 0, isAAC: true, samples: [], len: 0, manifestCodec: audioCodec, duration: duration, inputTimeScale: 90000 };\n }\n\n resetTimeStamp() {\n }\n\n static probe(data) {\n // check if data contains ID3 timestamp and ADTS sync word\n var offset, length;\n let id3Data = ID3.getID3Data(data, 0);\n if (id3Data && ID3.getTimeStamp(id3Data) !== undefined) {\n // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1\n // Layer bits (position 14 and 15) in header should be always 0 for ADTS\n // More info https://wiki.multimedia.cx/index.php?title=ADTS\n for (offset = id3Data.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {\n if (ADTS.probe(data, offset)) {\n logger.log('ADTS sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset, contiguous, accurateTimeOffset) {\n var track = this._audioTrack,\n id3Data = ID3.getID3Data(data, 0),\n pts = 90 * ID3.getTimeStamp(id3Data),\n frameIndex = 0,\n stamp = pts,\n length = data.length,\n offset = id3Data.length;\n\n let id3Samples = [{ pts: stamp, dts: stamp, data: id3Data }];\n\n while (offset < length - 1) {\n if (ADTS.isHeader(data, offset) && (offset + 5) < length) {\n ADTS.initTrackConfig(track, this.observer, data, offset, track.manifestCodec);\n var frame = ADTS.appendFrame(track, data, offset, pts, frameIndex);\n if (frame) {\n offset += frame.length;\n stamp = frame.sample.pts;\n frameIndex++;\n } else {\n logger.log('Unable to parse AAC frame');\n break;\n }\n } else if (ID3.isHeader(data, offset)) {\n id3Data = ID3.getID3Data(data, offset);\n id3Samples.push({ pts: stamp, dts: stamp, data: id3Data });\n offset += id3Data.length;\n } else {\n //nothing found, keep looking\n offset++;\n }\n }\n\n this.remuxer.remux(track,\n { samples: [] },\n { samples: id3Samples, inputTimeScale: 90000 },\n { samples: [] },\n timeOffset,\n contiguous,\n accurateTimeOffset);\n }\n\n destroy() {\n }\n\n}\n\nexport default AACDemuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/aacdemuxer.js","/**\n * ADTS parser helper\n */\nimport { logger } from '../utils/logger';\nimport { ErrorTypes, ErrorDetails } from '../errors';\n\nconst ADTS = {\n getAudioConfig: function (observer, data, offset, audioCodec) {\n var adtsObjectType, // :int\n adtsSampleingIndex, // :int\n adtsExtensionSampleingIndex, // :int\n adtsChanelConfig, // :int\n config,\n userAgent = navigator.userAgent.toLowerCase(),\n manifestCodec = audioCodec,\n adtsSampleingRates = [\n 96000, 88200,\n 64000, 48000,\n 44100, 32000,\n 24000, 22050,\n 16000, 12000,\n 11025, 8000,\n 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: ErrorTypes.MEDIA_ERROR, details: 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.log(`manifest codec:${audioCodec},ADTS data:type:${adtsObjectType},sampleingIndex:${adtsSampleingIndex}[${adtsSampleingRates[adtsSampleingIndex]}Hz],channelConfig:${adtsChanelConfig}`);\n // firefox: freq less than 24kHz = AAC SBR (HE-AAC)\n if (/firefox/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/Opera ...)\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) ||\n (audioCodec.indexOf('mp4a.40.5') !== -1))) ||\n (!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) ||\n (!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), manifestCodec: manifestCodec };\n },\n\n isHeaderPattern: function (data, offset) {\n return data[offset] === 0xff && (data[offset + 1] & 0xf6) === 0xf0;\n },\n\n getHeaderLength: function (data, offset) {\n return (!!(data[offset + 1] & 0x01) ? 7 : 9);\n },\n\n getFullFrameLength: function (data, offset) {\n return ((data[offset + 3] & 0x03) << 11) |\n (data[offset + 4] << 3) |\n ((data[offset + 5] & 0xE0) >>> 5);\n },\n\n isHeader: function (data, offset) {\n // Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1\n // Layer bits (position 14 and 15) in header should be always 0 for ADTS\n // More info https://wiki.multimedia.cx/index.php?title=ADTS\n if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {\n return true;\n }\n return false;\n },\n\n probe: function (data, offset) {\n // same as isHeader but we also check that ADTS frame follows last ADTS frame \n // or end of data is reached\n if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {\n // ADTS header Length\n let headerLength = this.getHeaderLength(data, offset);\n // ADTS frame Length\n let frameLength = headerLength;\n if (offset + 5 < data.length) {\n frameLength = this.getFullFrameLength(data, offset);\n }\n let newOffset = offset + frameLength;\n if (newOffset === data.length || (newOffset + 1 < data.length && this.isHeaderPattern(data, newOffset))) {\n return true;\n }\n }\n return false;\n },\n\n initTrackConfig: function (track, observer, data, offset, audioCodec) {\n if (!track.samplerate) {\n var config = this.getAudioConfig(observer, data, offset, audioCodec);\n track.config = config.config;\n track.samplerate = config.samplerate;\n track.channelCount = config.channelCount;\n track.codec = config.codec;\n track.manifestCodec = config.manifestCodec;\n logger.log(`parsed codec:${track.codec},rate:${config.samplerate},nb channel:${config.channelCount}`);\n }\n },\n\n getFrameDuration: function (samplerate) {\n return 1024 * 90000 / samplerate;\n },\n\n appendFrame: function (track, data, offset, pts, frameIndex) {\n var frameDuration = this.getFrameDuration(track.samplerate);\n var header = this.parseFrameHeader(data, offset, pts, frameIndex, frameDuration);\n if (header) {\n var stamp = header.stamp;\n var headerLength = header.headerLength;\n var frameLength = header.frameLength;\n\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n var aacSample = { unit: data.subarray(offset + headerLength, offset + headerLength + frameLength), pts: stamp, dts: stamp };\n\n track.samples.push(aacSample);\n track.len += frameLength;\n\n return { sample: aacSample, length: frameLength + headerLength };\n }\n\n return undefined;\n },\n\n parseFrameHeader: function (data, offset, pts, frameIndex, frameDuration) {\n var headerLength, frameLength, stamp;\n var length = data.length;\n\n // The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header\n headerLength = this.getHeaderLength(data, offset);\n // retrieve frame size\n frameLength = this.getFullFrameLength(data, offset);\n frameLength -= headerLength;\n\n if ((frameLength > 0) && ((offset + headerLength + frameLength) <= length)) {\n stamp = pts + frameIndex * frameDuration;\n //logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}/${(stamp/90).toFixed(0)}`);\n return { headerLength, frameLength, stamp };\n }\n\n return undefined;\n }\n};\n\nmodule.exports = ADTS;\n\n\n// WEBPACK FOOTER //\n// src/demux/adts.js","/* inline demuxer.\n * probe fragments and instantiate appropriate demuxer depending on content type (TSDemuxer, AACDemuxer, ...)\n */\n\nimport Event from '../events';\nimport { ErrorTypes, ErrorDetails } from '../errors';\nimport Decrypter from '../crypt/decrypter';\nimport AACDemuxer from '../demux/aacdemuxer';\nimport MP4Demuxer from '../demux/mp4demuxer';\nimport TSDemuxer from '../demux/tsdemuxer';\nimport MP3Demuxer from '../demux/mp3demuxer';\nimport MP4Remuxer from '../remux/mp4-remuxer';\nimport PassThroughRemuxer from '../remux/passthrough-remuxer';\n\nclass DemuxerInline {\n\n constructor(observer, typeSupported, config, vendor) {\n this.observer = observer;\n this.typeSupported = typeSupported;\n this.config = config;\n this.vendor = vendor;\n }\n\n destroy() {\n var demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n }\n }\n\n push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {\n if ((data.byteLength > 0) && (decryptdata != null) && (decryptdata.key != null) && (decryptdata.method === 'AES-128')) {\n let decrypter = this.decrypter;\n if (decrypter == null) {\n decrypter = this.decrypter = new Decrypter(this.observer, this.config);\n }\n var localthis = this;\n // performance.now() not available on WebWorker, at least on Safari Desktop\n var startTime;\n try {\n startTime = performance.now();\n } catch (error) {\n startTime = Date.now();\n }\n decrypter.decrypt(data, decryptdata.key.buffer, decryptdata.iv.buffer, function (decryptedData) {\n var endTime;\n try {\n endTime = performance.now();\n } catch (error) {\n endTime = Date.now();\n }\n localthis.observer.trigger(Event.FRAG_DECRYPTED, { stats: { tstart: startTime, tdecrypt: endTime } });\n localthis.pushDecrypted(new Uint8Array(decryptedData), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);\n });\n } else {\n this.pushDecrypted(new Uint8Array(data), decryptdata, new Uint8Array(initSegment), audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS);\n }\n }\n\n pushDecrypted(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset, defaultInitPTS) {\n var demuxer = this.demuxer;\n if (!demuxer ||\n // in case of continuity change, we might switch from content type (AAC container to TS container for example)\n // so let's check that current demuxer is still valid\n (discontinuity && !this.probe(data))) {\n const observer = this.observer;\n const typeSupported = this.typeSupported;\n const config = this.config;\n // probing order is AAC/MP3/TS/MP4\n const muxConfig = [{ demux: AACDemuxer, remux: MP4Remuxer },\n { demux: MP3Demuxer, remux: MP4Remuxer },\n { demux: TSDemuxer, remux: MP4Remuxer },\n { demux: MP4Demuxer, remux: PassThroughRemuxer }];\n\n // probe for content type\n for (let i = 0, len = muxConfig.length; i < len; i++) {\n const mux = muxConfig[i];\n const probe = mux.demux.probe;\n if (probe(data)) {\n const remuxer = this.remuxer = new mux.remux(observer, config, typeSupported, this.vendor);\n demuxer = new mux.demux(observer, remuxer, config, typeSupported);\n this.probe = probe;\n break;\n }\n }\n if (!demuxer) {\n observer.trigger(Event.ERROR, { type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: true, reason: 'no demux matching with content found' });\n return;\n }\n this.demuxer = demuxer;\n }\n const remuxer = this.remuxer;\n\n if (discontinuity || trackSwitch) {\n demuxer.resetInitSegment(initSegment, audioCodec, videoCodec, duration);\n remuxer.resetInitSegment();\n }\n if (discontinuity) {\n demuxer.resetTimeStamp(defaultInitPTS);\n remuxer.resetTimeStamp(defaultInitPTS);\n }\n if (typeof demuxer.setDecryptData === 'function') {\n demuxer.setDecryptData(decryptdata);\n }\n demuxer.append(data, timeOffset, contiguous, accurateTimeOffset);\n }\n}\n\nexport default DemuxerInline;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/demuxer-inline.js","/* 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\n import DemuxerInline from '../demux/demuxer-inline';\n import Event from '../events';\n import {enableLogs} from '../utils/logger';\n import EventEmitter from 'events';\n\nvar DemuxerWorker = function (self) {\n // observer setup\n var observer = new EventEmitter();\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...data);\n };\n\n var forwardMessage = function(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 let config = JSON.parse(data.config);\n self.demuxer = new DemuxerInline(observer, data.typeSupported, config, data.vendor);\n try {\n enableLogs(config.debug === true);\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(data.data, data.decryptdata, data.initSegment, data.audioCodec, data.videoCodec, data.timeOffset,data.discontinuity, data.trackSwitch,data.contiguous,data.duration,data.accurateTimeOffset,data.defaultInitPTS);\n break;\n default:\n break;\n }\n });\n\n // forward events to main thread\n observer.on(Event.FRAG_DECRYPTED, forwardMessage);\n observer.on(Event.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(Event.FRAG_PARSED, forwardMessage);\n observer.on(Event.ERROR, forwardMessage);\n observer.on(Event.FRAG_PARSING_METADATA, forwardMessage);\n observer.on(Event.FRAG_PARSING_USERDATA, forwardMessage);\n observer.on(Event.INIT_PTS_FOUND, forwardMessage);\n\n // special case for FRAG_PARSING_DATA: pass data1/data2 as transferable object (no copy)\n observer.on(Event.FRAG_PARSING_DATA, function(ev, data) {\n let transferable = [];\n let message = {event: ev, data:data};\n if (data.data1) {\n message.data1 = data.data1.buffer;\n transferable.push(data.data1.buffer);\n delete data.data1;\n }\n if (data.data2) {\n message.data2 = data.data2.buffer;\n transferable.push(data.data2.buffer);\n delete data.data2;\n }\n self.postMessage(message,transferable);\n });\n};\n\nexport default DemuxerWorker;\n\n\n\n\n// WEBPACK FOOTER //\n// src/demux/demuxer-worker.js","import Event from '../events';\nimport DemuxerInline from '../demux/demuxer-inline';\nimport DemuxerWorker from '../demux/demuxer-worker';\nimport {logger} from '../utils/logger';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport EventEmitter from 'events';\n\nclass Demuxer {\n\n constructor(hls, id) {\n this.hls = hls;\n this.id = id;\n // observer setup\n const observer = this.observer = new EventEmitter();\n const config = hls.config;\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...data);\n };\n\n var forwardMessage = function(ev,data) {\n data = data || {};\n data.frag = this.frag;\n data.id = this.id;\n hls.trigger(ev,data);\n }.bind(this);\n\n // forward events to main thread\n observer.on(Event.FRAG_DECRYPTED, forwardMessage);\n observer.on(Event.FRAG_PARSING_INIT_SEGMENT, forwardMessage);\n observer.on(Event.FRAG_PARSING_DATA, forwardMessage);\n observer.on(Event.FRAG_PARSED, forwardMessage);\n observer.on(Event.ERROR, forwardMessage);\n observer.on(Event.FRAG_PARSING_METADATA, forwardMessage);\n observer.on(Event.FRAG_PARSING_USERDATA, forwardMessage);\n observer.on(Event.INIT_PTS_FOUND, forwardMessage);\n\n const typeSupported = {\n mp4 : MediaSource.isTypeSupported('video/mp4'),\n mpeg: MediaSource.isTypeSupported('audio/mpeg'),\n mp3: MediaSource.isTypeSupported('audio/mp4; codecs=\"mp3\"')\n };\n // navigator.vendor is not always available in Web Worker\n // refer to https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/navigator\n const vendor = navigator.vendor;\n if (config.enableWorker && (typeof(Worker) !== 'undefined')) {\n logger.log('demuxing in webworker');\n let w;\n try {\n let work = require('webworkify');\n w = this.w = work(DemuxerWorker);\n this.onwmsg = this.onWorkerMessage.bind(this);\n w.addEventListener('message', this.onwmsg);\n w.onerror = function(event) { hls.trigger(Event.ERROR, {type: ErrorTypes.OTHER_ERROR, details: ErrorDetails.INTERNAL_EXCEPTION, fatal: true, event : 'demuxerWorker', err : { message : event.message + ' (' + event.filename + ':' + event.lineno + ')' }});};\n w.postMessage({cmd: 'init', typeSupported : typeSupported, vendor : vendor, id : id, config: JSON.stringify(config)});\n } catch(err) {\n 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 DemuxerInline(observer,typeSupported,config,vendor);\n this.w = undefined;\n }\n } else {\n this.demuxer = new DemuxerInline(observer,typeSupported,config, vendor);\n }\n }\n\n destroy() {\n let w = this.w;\n if (w) {\n w.removeEventListener('message', this.onwmsg);\n w.terminate();\n this.w = null;\n } else {\n let demuxer = this.demuxer;\n if (demuxer) {\n demuxer.destroy();\n this.demuxer = null;\n }\n }\n let observer = this.observer;\n if (observer) {\n observer.removeAllListeners();\n this.observer = null;\n }\n }\n\n push(data, initSegment, audioCodec, videoCodec, frag, duration,accurateTimeOffset,defaultInitPTS) {\n const w = this.w;\n const timeOffset = !isNaN(frag.startDTS) ? frag.startDTS : frag.start;\n const decryptdata = frag.decryptdata;\n const lastFrag = this.frag;\n const discontinuity = !(lastFrag && (frag.cc === lastFrag.cc));\n const trackSwitch = !(lastFrag && (frag.level === lastFrag.level));\n const nextSN = lastFrag && (frag.sn === (lastFrag.sn+1));\n const contiguous = !trackSwitch && nextSN;\n if (discontinuity) {\n logger.log(`${this.id}:discontinuity detected`);\n }\n if (trackSwitch) {\n logger.log(`${this.id}:switch detected`);\n }\n this.frag = frag;\n if (w) {\n // post fragment payload as transferable objects (no copy)\n w.postMessage({cmd: 'demux', data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset,defaultInitPTS}, [data]);\n } else {\n let demuxer = this.demuxer;\n if (demuxer) {\n demuxer.push(data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset,defaultInitPTS);\n }\n }\n }\n\n onWorkerMessage(ev) {\n let 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 Event.FRAG_PARSING_DATA:\n data.data.data1 = new Uint8Array(data.data1);\n if (data.data2) {\n data.data.data2 = new Uint8Array(data.data2);\n }\n /* falls through */\n default:\n data.data = data.data || {};\n data.data.frag = this.frag;\n data.data.id = this.id;\n hls.trigger(data.event, data.data);\n break;\n }\n }\n}\n\nexport default Demuxer;\n\n\n\n\n// WEBPACK FOOTER //\n// src/demux/demuxer.js","/**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.\n*/\n\nimport {logger} from '../utils/logger';\n\nclass ExpGolomb {\n\n constructor(data) {\n this.data = data;\n // the number of bytes left to examine in this.data\n this.bytesAvailable = 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 loadWord() {\n var\n data = this.data,\n bytesAvailable = this.bytesAvailable,\n position = data.byteLength - bytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, bytesAvailable);\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n workingBytes.set(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 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 readBits(size) {\n var\n bits = Math.min(this.bitsAvailable, size), // :uint\n valu = this.word >>> (32 - bits); // :uint\n if (size > 32) {\n 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 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 skipUEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():void\n skipEG() {\n this.skipBits(1 + this.skipLZ());\n }\n\n // ():uint\n readUEG() {\n var clz = this.skipLZ(); // :uint\n return this.readBits(clz + 1) - 1;\n }\n\n // ():int\n 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 readBoolean() {\n return 1 === this.readBits(1);\n }\n\n // ():int\n readUByte() {\n return this.readBits(8);\n }\n\n // ():int\n readUShort() {\n return this.readBits(16);\n }\n // ():int\n 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 skipScalingList(count) {\n var\n 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 readSPS() {\n var\n frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n profileIdc,profileCompat,levelIdc,\n numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n i,\n readUByte = this.readUByte.bind(this),\n readBits = this.readBits.bind(this),\n readUEG = this.readUEG.bind(this),\n readBoolean = this.readBoolean.bind(this),\n skipBits = this.skipBits.bind(this),\n skipEG = this.skipEG.bind(this),\n skipUEG = this.skipUEG.bind(this),\n skipScalingList = this.skipScalingList.bind(this);\n\n readUByte();\n profileIdc = readUByte(); // profile_idc\n profileCompat = readBits(5); // constraint_set[0-4]_flag, u(5)\n skipBits(3); // reserved_zero_3bits u(3),\n levelIdc = readUByte(); //level_idc u(8)\n skipUEG(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n if (profileIdc === 100 ||\n profileIdc === 110 ||\n profileIdc === 122 ||\n profileIdc === 244 ||\n profileIdc === 44 ||\n profileIdc === 83 ||\n profileIdc === 86 ||\n profileIdc === 118 ||\n profileIdc === 128) {\n var chromaFormatIdc = readUEG();\n if (chromaFormatIdc === 3) {\n skipBits(1); // separate_colour_plane_flag\n }\n skipUEG(); // bit_depth_luma_minus8\n skipUEG(); // bit_depth_chroma_minus8\n skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (readBoolean()) { // seq_scaling_matrix_present_flag\n scalingListCount = (chromaFormatIdc !== 3) ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (readBoolean()) { // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16);\n } else {\n skipScalingList(64);\n }\n }\n }\n }\n }\n skipUEG(); // log2_max_frame_num_minus4\n var picOrderCntType = readUEG();\n if (picOrderCntType === 0) {\n readUEG(); //log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n skipBits(1); // delta_pic_order_always_zero_flag\n skipEG(); // offset_for_non_ref_pic\n skipEG(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = readUEG();\n for(i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n skipEG(); // offset_for_ref_frame[ i ]\n }\n }\n skipUEG(); // max_num_ref_frames\n skipBits(1); // gaps_in_frame_num_value_allowed_flag\n picWidthInMbsMinus1 = readUEG();\n picHeightInMapUnitsMinus1 = readUEG();\n frameMbsOnlyFlag = readBits(1);\n if (frameMbsOnlyFlag === 0) {\n skipBits(1); // mb_adaptive_frame_field_flag\n }\n skipBits(1); // direct_8x8_inference_flag\n if (readBoolean()) { // frame_cropping_flag\n frameCropLeftOffset = readUEG();\n frameCropRightOffset = readUEG();\n frameCropTopOffset = readUEG();\n frameCropBottomOffset = readUEG();\n }\n let pixelRatio = [1,1];\n if (readBoolean()) {\n // vui_parameters_present_flag\n if (readBoolean()) {\n // aspect_ratio_info_present_flag\n const aspectRatioIdc = readUByte();\n switch (aspectRatioIdc) {\n case 1: pixelRatio = [1,1]; break;\n case 2: pixelRatio = [12,11]; break;\n case 3: pixelRatio = [10,11]; break;\n case 4: pixelRatio = [16,11]; break;\n case 5: pixelRatio = [40,33]; break;\n case 6: pixelRatio = [24,11]; break;\n case 7: pixelRatio = [20,11]; break;\n case 8: pixelRatio = [32,11]; break;\n case 9: pixelRatio = [80,33]; break;\n case 10: pixelRatio = [18,11]; break;\n case 11: pixelRatio = [15,11]; break;\n case 12: pixelRatio = [64,33]; break;\n case 13: pixelRatio = [160,99]; break;\n case 14: pixelRatio = [4,3]; break;\n case 15: pixelRatio = [3,2]; break;\n case 16: pixelRatio = [2,1]; break;\n case 255: {\n pixelRatio = [readUByte() << 8 | readUByte(), readUByte() << 8 | readUByte()];\n break;\n }\n }\n }\n }\n return {\n width: Math.ceil((((picWidthInMbsMinus1 + 1) * 16) - frameCropLeftOffset * 2 - frameCropRightOffset * 2)),\n height: ((2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16) - ((frameMbsOnlyFlag? 2 : 4) * (frameCropTopOffset + frameCropBottomOffset)),\n pixelRatio : pixelRatio\n };\n }\n\n 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\nexport default ExpGolomb;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/exp-golomb.js","/**\n * ID3 parser\n */\n class ID3 {\n /**\n * Returns true if an ID3 header can be found at offset in data\n * @param {Uint8Array} data - The data to search in\n * @param {number} offset - The offset at which to start searching\n * @return {boolean} - True if an ID3 header is found\n */\n static isHeader(data, offset) {\n /*\n * http://id3.org/id3v2.3.0\n * [0] = 'I'\n * [1] = 'D'\n * [2] = '3'\n * [3,4] = {Version}\n * [5] = {Flags}\n * [6-9] = {ID3 Size}\n *\n * An ID3v2 tag can be detected with the following pattern:\n * $49 44 33 yy yy xx zz zz zz zz\n * Where yy is less than $FF, xx is the 'flags' byte and zz is less than $80\n */\n if (offset + 10 <= data.length) {\n //look for 'ID3' identifier\n if (data[offset] === 0x49 && data[offset+1] === 0x44 && data[offset+2] === 0x33) {\n //check version is within range\n if (data[offset+3] < 0xFF && data[offset+4] < 0xFF) {\n //check size is within range\n if (data[offset+6] < 0x80 && data[offset+7] < 0x80 && data[offset+8] < 0x80 && data[offset+9] < 0x80) {\n return true;\n }\n }\n }\n }\n\n return false;\n }\n\n /**\n * Returns true if an ID3 footer can be found at offset in data\n * @param {Uint8Array} data - The data to search in\n * @param {number} offset - The offset at which to start searching\n * @return {boolean} - True if an ID3 footer is found\n */\n static isFooter(data, offset) {\n /*\n * The footer is a copy of the header, but with a different identifier\n */\n if (offset + 10 <= data.length) {\n //look for '3DI' identifier\n if (data[offset] === 0x33 && data[offset+1] === 0x44 && data[offset+2] === 0x49) {\n //check version is within range\n if (data[offset+3] < 0xFF && data[offset+4] < 0xFF) {\n //check size is within range\n if (data[offset+6] < 0x80 && data[offset+7] < 0x80 && data[offset+8] < 0x80 && data[offset+9] < 0x80) {\n return true;\n }\n }\n }\n }\n\n return false;\n }\n\n /**\n * Returns any adjacent ID3 tags found in data starting at offset, as one block of data\n * @param {Uint8Array} data - The data to search in\n * @param {number} offset - The offset at which to start searching\n * @return {Uint8Array} - The block of data containing any ID3 tags found\n */\n static getID3Data(data, offset) {\n const front = offset;\n let length = 0;\n\n while (ID3.isHeader(data, offset)) {\n //ID3 header is 10 bytes\n length += 10;\n\n const size = ID3._readSize(data, offset + 6);\n length += size;\n\n if (ID3.isFooter(data, offset + 10)) {\n //ID3 footer is 10 bytes\n length += 10;\n }\n\n offset += length;\n }\n\n if (length > 0) {\n return data.subarray(front, front + length);\n }\n\n return undefined;\n }\n\n static _readSize(data, offset) {\n let size = 0;\n size = ((data[offset] & 0x7f) << 21);\n size |= ((data[offset+1] & 0x7f) << 14);\n size |= ((data[offset+2] & 0x7f) << 7);\n size |= (data[offset+3] & 0x7f);\n return size;\n }\n\n /**\n * Searches for the Elementary Stream timestamp found in the ID3 data chunk\n * @param {Uint8Array} data - Block of data containing one or more ID3 tags\n * @return {number} - The timestamp\n */\n static getTimeStamp(data) {\n const frames = ID3.getID3Frames(data);\n for(let i = 0; i < frames.length; i++) {\n const frame = frames[i];\n if (ID3.isTimeStampFrame(frame)) {\n return ID3._readTimeStamp(frame);\n }\n }\n\n return undefined;\n }\n\n /**\n * Returns true if the ID3 frame is an Elementary Stream timestamp frame\n * @param {ID3 frame} frame\n */\n static isTimeStampFrame(frame) {\n return (frame && frame.key === 'PRIV' && frame.info === 'com.apple.streaming.transportStreamTimestamp');\n }\n\n static _getFrameData(data) {\n /*\n Frame ID $xx xx xx xx (four characters)\n Size $xx xx xx xx\n Flags $xx xx\n */\n const type = String.fromCharCode(data[0], data[1], data[2], data[3]);\n const size = ID3._readSize(data, 4);\n\n //skip frame id, size, and flags\n let offset = 10;\n\n return { type, size, data: data.subarray(offset, offset + size) };\n }\n\n /**\n * Returns an array of ID3 frames found in all the ID3 tags in the id3Data\n * @param {Uint8Array} id3Data - The ID3 data containing one or more ID3 tags\n * @return {ID3 frame[]} - Array of ID3 frame objects\n */\n static getID3Frames(id3Data) {\n let offset = 0;\n const frames = [];\n\n while (ID3.isHeader(id3Data, offset)) {\n const size = ID3._readSize(id3Data, offset + 6);\n //skip past ID3 header\n offset += 10;\n const end = offset + size;\n //loop through frames in the ID3 tag\n while (offset + 8 < end) {\n const frameData = ID3._getFrameData(id3Data.subarray(offset));\n const frame = ID3._decodeFrame(frameData);\n if (frame) {\n frames.push(frame);\n }\n //skip frame header and frame data\n offset += frameData.size + 10;\n }\n\n if (ID3.isFooter(id3Data, offset)) {\n offset += 10;\n }\n }\n\n return frames;\n }\n\n static _decodeFrame(frame) {\n if (frame.type === 'PRIV') {\n return ID3._decodePrivFrame(frame);\n } else if (frame.type[0] === 'T') {\n return ID3._decodeTextFrame(frame);\n } else if (frame.type[0] === 'W') {\n return ID3._decodeURLFrame(frame);\n }\n\n return undefined;\n }\n\n static _readTimeStamp(timeStampFrame) {\n if (timeStampFrame.data.byteLength === 8) {\n const data = new Uint8Array(timeStampFrame.data);\n // timestamp is 33 bit expressed as a big-endian eight-octet number,\n // with the upper 31 bits set to zero.\n const pts33Bit = data[3] & 0x1;\n let timestamp = (data[4] << 23) +\n (data[5] << 15) +\n (data[6] << 7) +\n data[7];\n timestamp /= 45;\n\n if (pts33Bit) {\n timestamp += 47721858.84; // 2^32 / 90\n }\n\n return Math.round(timestamp);\n }\n\n return undefined;\n }\n\n static _decodePrivFrame(frame) {\n /*\n Format: <text string>\\0<binary data>\n */\n if (frame.size < 2) {\n return undefined;\n }\n\n const owner = ID3._utf8ArrayToStr(frame.data);\n const privateData = new Uint8Array(frame.data.subarray(owner.length + 1));\n\n return { key: frame.type, info: owner, data: privateData.buffer };\n }\n\n static _decodeTextFrame(frame) {\n if (frame.size < 2) {\n return undefined;\n }\n\n if (frame.type === 'TXXX') {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Description}\\0{Value}\n */\n let index = 1;\n const description = ID3._utf8ArrayToStr(frame.data.subarray(index));\n\n index += description.length + 1;\n const value = ID3._utf8ArrayToStr(frame.data.subarray(index));\n\n return { key: frame.type, info: description, data: value };\n } else {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Value}\n */\n const text = ID3._utf8ArrayToStr(frame.data.subarray(1));\n return { key: frame.type, data: text };\n }\n }\n\n static _decodeURLFrame(frame) {\n if (frame.type === 'WXXX') {\n /*\n Format:\n [0] = {Text Encoding}\n [1-?] = {Description}\\0{URL}\n */\n if (frame.size < 2) {\n return undefined;\n }\n\n let index = 1;\n const description = ID3._utf8ArrayToStr(frame.data.subarray(index));\n\n index += description.length + 1;\n const value = ID3._utf8ArrayToStr(frame.data.subarray(index));\n\n return { key: frame.type, info: description, data: value };\n } else {\n /*\n Format:\n [0-?] = {URL}\n */\n const url = ID3._utf8ArrayToStr(frame.data);\n return { key: frame.type, data: url };\n }\n }\n\n // http://stackoverflow.com/questions/8936984/uint8array-to-string-in-javascript/22373197\n // http://www.onicos.com/staff/iz/amuse/javascript/expert/utf.txt\n /* utf.js - UTF-8 <=> UTF-16 convertion\n *\n * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>\n * Version: 1.0\n * LastModified: Dec 25 1999\n * This library is free. You can redistribute it and/or modify it.\n */\n static _utf8ArrayToStr(array) {\n\n let char2;\n let char3;\n let out = '';\n let i = 0;\n let length = array.length;\n\n while (i < length) {\n let c = array[i++];\n switch (c >> 4) {\n case 0:\n return out;\n case 1: case 2: case 3: case 4: case 5: case 6: case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12: case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode(((c & 0x0F) << 12) |\n ((char2 & 0x3F) << 6) |\n ((char3 & 0x3F) << 0));\n break;\n }\n }\n\n return out;\n }\n}\n\nexport default ID3;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/id3.js","/**\n * MP3 demuxer\n */\nimport ID3 from '../demux/id3';\nimport { logger } from '../utils/logger';\nimport MpegAudio from './mpegaudio';\n\nclass MP3Demuxer {\n\n constructor(observer, remuxer, config) {\n this.observer = observer;\n this.config = config;\n this.remuxer = remuxer;\n }\n\n resetInitSegment(initSegment, audioCodec, videoCodec, duration) {\n this._audioTrack = { container: 'audio/mpeg', type: 'audio', id: -1, sequenceNumber: 0, isAAC: false, samples: [], len: 0, manifestCodec: audioCodec, duration: duration, inputTimeScale: 90000 };\n }\n\n resetTimeStamp() {\n }\n\n static probe(data) {\n // check if data contains ID3 timestamp and MPEG sync word\n var offset, length;\n let id3Data = ID3.getID3Data(data, 0);\n if (id3Data && ID3.getTimeStamp(id3Data) !== undefined) {\n // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1\n // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)\n // More info http://www.mp3-tech.org/programmer/frame_header.html\n for (offset = id3Data.length, length = Math.min(data.length - 1, offset + 100); offset < length; offset++) {\n if (MpegAudio.probe(data, offset)) {\n logger.log('MPEG Audio sync word found !');\n return true;\n }\n }\n }\n return false;\n }\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset, contiguous, accurateTimeOffset) {\n let id3Data = ID3.getID3Data(data, 0);\n let pts = 90 * ID3.getTimeStamp(id3Data);\n var offset = id3Data.length;\n var length = data.length;\n var frameIndex = 0, stamp = 0;\n var track = this._audioTrack;\n\n let id3Samples = [{ pts: pts, dts: pts, data: id3Data }];\n\n while (offset < length) {\n if (MpegAudio.isHeader(data, offset)) {\n var frame = MpegAudio.appendFrame(track, data, offset, pts, frameIndex);\n if (frame) {\n offset += frame.length;\n stamp = frame.sample.pts;\n frameIndex++;\n } else {\n //logger.log('Unable to parse Mpeg audio frame');\n break;\n }\n } else if (ID3.isHeader(data, offset)) {\n id3Data = ID3.getID3Data(data, offset);\n id3Samples.push({ pts: stamp, dts: stamp, data: id3Data });\n offset += id3Data.length;\n } else {\n //nothing found, keep looking\n offset++;\n }\n }\n\n this.remuxer.remux(track,\n { samples: [] },\n { samples: id3Samples, inputTimeScale: 90000 },\n { samples: [] },\n timeOffset,\n contiguous,\n accurateTimeOffset);\n }\n\n destroy() {\n }\n}\n\nexport default MP3Demuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/mp3demuxer.js","/**\n * MP4 demuxer\n */\n//import {logger} from '../utils/logger';\nimport Event from '../events';\n\nconst UINT32_MAX = Math.pow(2, 32) - 1;\n\n class MP4Demuxer {\n\n constructor(observer, remuxer) {\n this.observer = observer;\n this.remuxer = remuxer;\n }\n\n resetTimeStamp(initPTS) {\n this.initPTS = initPTS;\n }\n\n resetInitSegment(initSegment,audioCodec,videoCodec, duration) {\n //jshint unused:false\n if (initSegment && initSegment.byteLength) {\n const initData = this.initData = MP4Demuxer.parseInitSegment(initSegment);\n var tracks = {};\n if (initData.audio) {\n tracks.audio = { container : 'audio/mp4', codec : audioCodec, initSegment : duration ? initSegment : null };\n }\n if (initData.video) {\n tracks.video = { container : 'video/mp4', codec : videoCodec, initSegment : duration ? initSegment : null };\n }\n this.observer.trigger(Event.FRAG_PARSING_INIT_SEGMENT,{ tracks : tracks });\n } else {\n if (audioCodec) {\n this.audioCodec = audioCodec;\n }\n if (videoCodec) {\n this.videoCodec = videoCodec;\n }\n }\n }\n\n static probe(data) {\n if (data.length >= 8) {\n const dataType = MP4Demuxer.bin2str(data.subarray(4,8));\n return (['moof','ftyp','styp'].indexOf(dataType) >= 0);\n }\n return false;\n }\n\n\n static bin2str(buffer) {\n return String.fromCharCode.apply(null, buffer);\n }\n\n static readUint32(buffer, offset) {\n if (buffer.data) {\n offset += buffer.start;\n buffer = buffer.data;\n }\n\n const val = buffer[offset] << 24 |\n buffer[offset + 1] << 16 |\n buffer[offset + 2] << 8 |\n buffer[offset + 3];\n return val < 0 ? 4294967296 + val : val;\n }\n\n static writeUint32(buffer, offset, value) {\n if (buffer.data) {\n offset += buffer.start;\n buffer = buffer.data;\n }\n buffer[offset] = value >> 24;\n buffer[offset+1] = (value >> 16) & 0xff;\n buffer[offset+2] = (value >> 8) & 0xff;\n buffer[offset+3] = value & 0xff;\n }\n\n\n // Find the data for a box specified by its path\n static findBox(data,path) {\n var results = [],\n i, size, type, end, subresults, start, endbox;\n\n if (data.data) {\n start = data.start;\n end = data.end;\n data = data.data;\n } else {\n start = 0;\n end = data.byteLength;\n }\n\n if (!path.length) {\n // short-circuit the search for empty paths\n return null;\n }\n\n for (i = start; i < end;) {\n size = MP4Demuxer.readUint32(data, i);\n type = MP4Demuxer.bin2str(data.subarray(i + 4, i + 8));\n endbox = size > 1 ? i + size : end;\n\n if (type === path[0]) {\n\n if (path.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push({ data : data, start : i + 8, end : endbox});\n } else {\n // recursively search for the next box along the path\n subresults = MP4Demuxer.findBox({ data : data, start : i +8, end : endbox }, path.slice(1));\n if (subresults.length) {\n results = results.concat(subresults);\n }\n }\n }\n i = endbox;\n }\n\n // we've finished searching all of data\n return results;\n }\n\n\n\n/**\n * Parses an MP4 initialization segment and extracts stream type and\n * timescale values for any declared tracks. Timescale values indicate the\n * number of clock ticks per second to assume for time-based values\n * elsewhere in the MP4.\n *\n * To determine the start time of an MP4, you need two pieces of\n * information: the timescale unit and the earliest base media decode\n * time. Multiple timescales can be specified within an MP4 but the\n * base media decode time is always expressed in the timescale from\n * the media header box for the track:\n * ```\n * moov > trak > mdia > mdhd.timescale\n * moov > trak > mdia > hdlr\n * ```\n * @param init {Uint8Array} the bytes of the init segment\n * @return {object} a hash of track type to timescale values or null if\n * the init segment is malformed.\n */\n static parseInitSegment(initSegment) {\n var result = [];\n var traks = MP4Demuxer.findBox(initSegment, ['moov', 'trak']);\n\n traks.forEach(trak => {\n const tkhd = MP4Demuxer.findBox(trak, ['tkhd'])[0];\n if (tkhd) {\n let version = tkhd.data[tkhd.start];\n let index = version === 0 ? 12 : 20;\n let trackId = MP4Demuxer.readUint32(tkhd, index);\n\n const mdhd = MP4Demuxer.findBox(trak, ['mdia', 'mdhd'])[0];\n if (mdhd) {\n version = mdhd.data[mdhd.start];\n index = version === 0 ? 12 : 20;\n const timescale = MP4Demuxer.readUint32(mdhd, index);\n\n const hdlr = MP4Demuxer.findBox(trak, ['mdia', 'hdlr'])[0];\n if (hdlr) {\n const hdlrType = MP4Demuxer.bin2str(hdlr.data.subarray(hdlr.start+8, hdlr.start+12));\n let type = { 'soun' : 'audio', 'vide' : 'video'}[hdlrType];\n if (type) {\n result[trackId] = { timescale : timescale , type : type};\n result[type] = { timescale : timescale , id : trackId};\n }\n }\n }\n }\n });\n return result;\n }\n\n\n/**\n * Determine the base media decode start time, in seconds, for an MP4\n * fragment. If multiple fragments are specified, the earliest time is\n * returned.\n *\n * The base media decode time can be parsed from track fragment\n * metadata:\n * ```\n * moof > traf > tfdt.baseMediaDecodeTime\n * ```\n * It requires the timescale value from the mdhd to interpret.\n *\n * @param timescale {object} a hash of track ids to timescale values.\n * @return {number} the earliest base media decode start time for the\n * fragment, in seconds\n */\nstatic getStartDTS(initData, fragment) {\n var trafs, baseTimes, result;\n\n // we need info from two childrend of each track fragment box\n trafs = MP4Demuxer.findBox(fragment, ['moof', 'traf']);\n\n // determine the start times for each track\n baseTimes = [].concat.apply([], trafs.map(function(traf) {\n return MP4Demuxer.findBox(traf, ['tfhd']).map(function(tfhd) {\n var id, scale, baseTime;\n\n // get the track id from the tfhd\n id = MP4Demuxer.readUint32(tfhd, 4);\n // assume a 90kHz clock if no timescale was specified\n scale = initData[id].timescale || 90e3;\n\n // get the base media decode time from the tfdt\n baseTime = MP4Demuxer.findBox(traf, ['tfdt']).map(function(tfdt) {\n var version, result;\n\n version = tfdt.data[tfdt.start];\n result = MP4Demuxer.readUint32(tfdt, 4);\n if (version === 1) {\n result *= Math.pow(2, 32);\n\n result += MP4Demuxer.readUint32(tfdt, 8);\n }\n return result;\n })[0];\n baseTime = baseTime || Infinity;\n\n // convert base time to seconds\n return baseTime / scale;\n });\n }));\n\n // return the minimum\n result = Math.min.apply(null, baseTimes);\n return isFinite(result) ? result : 0;\n}\n\n\n\n\nstatic offsetStartDTS(initData,fragment,timeOffset) {\n MP4Demuxer.findBox(fragment, ['moof', 'traf']).map(function(traf) {\n return MP4Demuxer.findBox(traf, ['tfhd']).map(function(tfhd) {\n // get the track id from the tfhd\n var id = MP4Demuxer.readUint32(tfhd, 4);\n // assume a 90kHz clock if no timescale was specified\n var timescale = initData[id].timescale || 90e3;\n\n // get the base media decode time from the tfdt\n MP4Demuxer.findBox(traf, ['tfdt']).map(function(tfdt) {\n var version = tfdt.data[tfdt.start];\n var baseMediaDecodeTime = MP4Demuxer.readUint32(tfdt, 4);\n if (version === 0) {\n MP4Demuxer.writeUint32(tfdt, 4, baseMediaDecodeTime - timeOffset*timescale);\n } else {\n baseMediaDecodeTime *= Math.pow(2, 32);\n baseMediaDecodeTime += MP4Demuxer.readUint32(tfdt, 8);\n baseMediaDecodeTime -= timeOffset*timescale;\n const upper = Math.floor(baseMediaDecodeTime / (UINT32_MAX + 1));\n const lower = Math.floor(baseMediaDecodeTime % (UINT32_MAX + 1));\n MP4Demuxer.writeUint32(tfdt, 4, upper);\n MP4Demuxer.writeUint32(tfdt, 8, lower);\n }\n });\n });\n });\n}\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset,contiguous,accurateTimeOffset) {\n let initData = this.initData;\n if(!initData) {\n this.resetInitSegment(data,this.audioCodec,this.videoCodec);\n initData = this.initData;\n }\n let startDTS, initPTS = this.initPTS;\n if (initPTS === undefined) {\n let startDTS = MP4Demuxer.getStartDTS(initData,data);\n this.initPTS = initPTS = startDTS - timeOffset;\n this.observer.trigger(Event.INIT_PTS_FOUND, { initPTS: initPTS});\n }\n MP4Demuxer.offsetStartDTS(initData,data,initPTS);\n startDTS = MP4Demuxer.getStartDTS(initData,data);\n this.remuxer.remux(initData.audio, initData.video, null, null, startDTS, contiguous,accurateTimeOffset,data);\n }\n\n destroy() {\n }\n\n}\n\nexport default MP4Demuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/mp4demuxer.js","/**\n * MPEG parser helper\n */\n\nconst MpegAudio = {\n\n BitratesMap: [\n 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448,\n 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384,\n 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320,\n 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256,\n 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160],\n\n SamplingRateMap: [44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000],\n\n appendFrame: function (track, data, offset, pts, frameIndex) {\n // Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference\n if (offset + 24 > data.length) {\n return undefined;\n }\n\n var header = this.parseHeader(data, offset);\n if (header && offset + header.frameLength <= data.length) {\n var frameDuration = 1152 * 90000 / header.sampleRate;\n var stamp = pts + frameIndex * frameDuration;\n var sample = { unit: data.subarray(offset, offset + header.frameLength), pts: stamp, dts: stamp };\n\n track.config = [];\n track.channelCount = header.channelCount;\n track.samplerate = header.sampleRate;\n track.samples.push(sample);\n track.len += header.frameLength;\n\n return { sample, length: header.frameLength };\n }\n\n return undefined;\n },\n\n parseHeader: function (data, offset) {\n var headerB = (data[offset + 1] >> 3) & 3;\n var headerC = (data[offset + 1] >> 1) & 3;\n var headerE = (data[offset + 2] >> 4) & 15;\n var headerF = (data[offset + 2] >> 2) & 3;\n var headerG = !!(data[offset + 2] & 2);\n if (headerB !== 1 && headerE !== 0 && headerE !== 15 && headerF !== 3) {\n var columnInBitrates = headerB === 3 ? (3 - headerC) : (headerC === 3 ? 3 : 4);\n var bitRate = MpegAudio.BitratesMap[columnInBitrates * 14 + headerE - 1] * 1000;\n var columnInSampleRates = headerB === 3 ? 0 : headerB === 2 ? 1 : 2;\n var sampleRate = MpegAudio.SamplingRateMap[columnInSampleRates * 3 + headerF];\n var padding = headerG ? 1 : 0;\n var channelCount = data[offset + 3] >> 6 === 3 ? 1 : 2; // If bits of channel mode are `11` then it is a single channel (Mono)\n var frameLength = headerC === 3 ?\n ((headerB === 3 ? 12 : 6) * bitRate / sampleRate + padding) << 2 :\n ((headerB === 3 ? 144 : 72) * bitRate / sampleRate + padding) | 0;\n\n return { sampleRate, channelCount, frameLength };\n }\n\n return undefined;\n },\n\n isHeaderPattern: function (data, offset) {\n return data[offset] === 0xff && (data[offset + 1] & 0xe0) === 0xe0 && (data[offset + 1] & 0x06) !== 0x00;\n },\n\n isHeader: function (data, offset) {\n // Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1\n // Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)\n // More info http://www.mp3-tech.org/programmer/frame_header.html\n if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {\n return true;\n }\n return false;\n },\n\n probe: function (data, offset) {\n // same as isHeader but we also check that MPEG frame follows last MPEG frame \n // or end of data is reached\n if (offset + 1 < data.length && this.isHeaderPattern(data, offset)) {\n // MPEG header Length\n let headerLength = 4;\n // MPEG frame Length\n let header = this.parseHeader(data, offset);\n let frameLength = headerLength;\n if (header && header.frameLength) {\n frameLength = header.frameLength;\n }\n let newOffset = offset + frameLength;\n if (newOffset === data.length || (newOffset + 1 < data.length && this.isHeaderPattern(data, newOffset))) {\n return true;\n }\n }\n return false;\n }\n};\n\nmodule.exports = MpegAudio;\n\n\n// WEBPACK FOOTER //\n// src/demux/mpegaudio.js","/**\n * SAMPLE-AES decrypter\n*/\n\n import Decrypter from '../crypt/decrypter';\n\n class SampleAesDecrypter {\n\n constructor(observer, config, decryptdata, discardEPB) {\n this.decryptdata = decryptdata;\n this.discardEPB = discardEPB;\n this.decrypter = new Decrypter(observer, config);\n }\n\n decryptBuffer(encryptedData, callback) {\n this.decrypter.decrypt(encryptedData, this.decryptdata.key.buffer, this.decryptdata.iv.buffer, callback);\n }\n\n // AAC - encrypt all full 16 bytes blocks starting from offset 16\n decryptAacSample(samples, sampleIndex, callback, sync) {\n let curUnit = samples[sampleIndex].unit;\n let encryptedData = curUnit.subarray(16, curUnit.length - curUnit.length % 16);\n let encryptedBuffer = encryptedData.buffer.slice(\n encryptedData.byteOffset,\n encryptedData.byteOffset + encryptedData.length);\n\n let localthis = this;\n this.decryptBuffer(encryptedBuffer, function (decryptedData) {\n decryptedData = new Uint8Array(decryptedData);\n curUnit.set(decryptedData, 16);\n\n if (!sync) {\n localthis.decryptAacSamples(samples, sampleIndex + 1, callback);\n }\n });\n }\n\n decryptAacSamples(samples, sampleIndex, callback) {\n for (;; sampleIndex++) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n\n if (samples[sampleIndex].unit.length < 32) {\n continue;\n }\n\n let sync = this.decrypter.isSync();\n\n this.decryptAacSample(samples, sampleIndex, callback, sync);\n\n if (!sync) {\n return;\n }\n }\n }\n\n // AVC - encrypt one 16 bytes block out of ten, starting from offset 32\n getAvcEncryptedData(decodedData) {\n let encryptedDataLen = Math.floor((decodedData.length - 48) / 160) * 16 + 16;\n let encryptedData = new Int8Array(encryptedDataLen);\n let outputPos = 0;\n for (let inputPos = 32; inputPos <= decodedData.length - 16; inputPos += 160, outputPos += 16) {\n encryptedData.set(decodedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return encryptedData;\n }\n\n getAvcDecryptedUnit(decodedData, decryptedData) {\n decryptedData = new Uint8Array(decryptedData);\n let inputPos = 0;\n for (let outputPos = 32; outputPos <= decodedData.length - 16; outputPos += 160, inputPos += 16) {\n decodedData.set(decryptedData.subarray(inputPos, inputPos + 16), outputPos);\n }\n return decodedData;\n }\n\n decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync) {\n let decodedData = this.discardEPB(curUnit.data);\n let encryptedData = this.getAvcEncryptedData(decodedData);\n let localthis = this;\n\n this.decryptBuffer(encryptedData.buffer, function (decryptedData) {\n curUnit.data = localthis.getAvcDecryptedUnit(decodedData, decryptedData);\n\n if (!sync) {\n localthis.decryptAvcSamples(samples, sampleIndex, unitIndex + 1, callback);\n }\n });\n }\n\n decryptAvcSamples(samples, sampleIndex, unitIndex, callback) {\n for (;; sampleIndex++, unitIndex = 0) {\n if (sampleIndex >= samples.length) {\n callback();\n return;\n }\n\n let curUnits = samples[sampleIndex].units;\n for (;; unitIndex++) {\n if (unitIndex >= curUnits.length) {\n break;\n }\n\n let curUnit = curUnits[unitIndex];\n if (curUnit.length <= 48 || (curUnit.type !== 1 && curUnit.type !== 5)) {\n continue;\n }\n\n let sync = this.decrypter.isSync();\n\n this.decryptAvcSample(samples, sampleIndex, unitIndex, callback, curUnit, sync);\n\n if (!sync) {\n return;\n }\n }\n }\n }\n }\n\n export default SampleAesDecrypter;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/sample-aes.js","/**\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 ADTS from './adts';\n import MpegAudio from './mpegaudio';\n import Event from '../events';\n import ExpGolomb from './exp-golomb';\n import SampleAesDecrypter from './sample-aes';\n// import Hex from '../utils/hex';\n import {logger} from '../utils/logger';\n import {ErrorTypes, ErrorDetails} from '../errors';\n\n class TSDemuxer {\n\n constructor(observer, remuxer, config, typeSupported) {\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n this.remuxer = remuxer;\n this.sampleAes = null;\n }\n\n setDecryptData(decryptdata) {\n if ((decryptdata != null) && (decryptdata.key != null) && (decryptdata.method === 'SAMPLE-AES')) {\n this.sampleAes = new SampleAesDecrypter(this.observer, this.config, decryptdata, this.discardEPB);\n } else {\n this.sampleAes = null;\n }\n }\n\n static 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 resetInitSegment(initSegment,audioCodec,videoCodec, duration) {\n this.pmtParsed = false;\n this._pmtId = -1;\n this._avcTrack = {container : 'video/mp2t', type: 'video', id :-1, inputTimeScale : 90000, sequenceNumber: 0, samples : [], len : 0, dropped : 0};\n this._audioTrack = {container : 'video/mp2t', type: 'audio', id :-1, inputTimeScale : 90000, duration: duration, sequenceNumber: 0, samples : [], len : 0, isAAC: true};\n this._id3Track = {type: 'id3', id :-1, inputTimeScale : 90000, sequenceNumber: 0, samples : [], len : 0};\n this._txtTrack = {type: 'text', id: -1, inputTimeScale : 90000, sequenceNumber: 0, samples : [], len : 0};\n // flush any partial content\n this.aacOverFlow = null;\n this.aacLastPTS = null;\n this.avcSample = null;\n this.audioCodec = audioCodec;\n this.videoCodec = videoCodec;\n this._duration = duration;\n }\n\n resetTimeStamp() {\n }\n\n // feed incoming data to the front of the parsing pipeline\n append(data, timeOffset, contiguous,accurateTimeOffset) {\n var start, len = data.length, stt, pid, atf, offset,pes,\n unknownPIDs = false;\n this.contiguous = contiguous;\n var pmtParsed = this.pmtParsed,\n avcTrack = this._avcTrack,\n audioTrack = this._audioTrack,\n id3Track = this._id3Track,\n avcId = avcTrack.id,\n audioId = audioTrack.id,\n id3Id = id3Track.id,\n pmtId = this._pmtId,\n avcData = avcTrack.pesData,\n audioData = audioTrack.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 parseMPEGPES = this._parseMPEGPES.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 }\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 audioId:\n if (stt) {\n if (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n }\n audioData = {data: [], size: 0};\n }\n if (audioData) {\n audioData.data.push(data.subarray(offset, start + 188));\n audioData.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 let parsedPIDs = parsePMT(data, offset, this.typeSupported.mpeg === true || this.typeSupported.mp3 === true, this.sampleAes != null);\n\n // only update track id if track PID found while parsing PMT\n // this is to avoid resetting the PID to -1 in case\n // track PID transiently disappears from the stream\n // this could happen in case of transient missing audio samples for example\n avcId = parsedPIDs.avc;\n if (avcId > 0) {\n avcTrack.id = avcId;\n }\n audioId = parsedPIDs.audio;\n if (audioId > 0) {\n audioTrack.id = audioId;\n audioTrack.isAAC = parsedPIDs.isAAC;\n }\n id3Id = parsedPIDs.id3;\n if (id3Id > 0) {\n id3Track.id = id3Id;\n }\n if (unknownPIDs && !pmtParsed) {\n 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(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details: 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 (audioData && (pes = parsePES(audioData))) {\n if (audioTrack.isAAC) {\n parseAACPES(pes);\n } else {\n parseMPEGPES(pes);\n }\n audioTrack.pesData = null;\n } else {\n if (audioData && audioData.size) {\n logger.log('last AAC PES packet truncated,might overlap between fragments');\n }\n // either audioData null or PES truncated, keep it for next frag parsing\n audioTrack.pesData = audioData;\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\n if (this.sampleAes == null) {\n this.remuxer.remux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);\n } else {\n this.decryptAndRemux(audioTrack, avcTrack, id3Track, this._txtTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n\n decryptAndRemux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n if (audioTrack.samples && audioTrack.isAAC) {\n let localthis = this;\n this.sampleAes.decryptAacSamples(audioTrack.samples, 0, function() {\n localthis.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n });\n } else {\n this.decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n\n decryptAndRemuxAvc(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset) {\n if (videoTrack.samples) {\n let localthis = this;\n this.sampleAes.decryptAvcSamples(videoTrack.samples, 0, 0, function () {\n localthis.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n });\n } else {\n this.remuxer.remux(audioTrack, videoTrack, id3Track, textTrack, timeOffset, contiguous, accurateTimeOffset);\n }\n }\n\n destroy() {\n this._initPTS = this._initDTS = undefined;\n this._duration = 0;\n }\n\n _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 _parsePMT(data, offset, mpegSupported, isSampleAes) {\n var sectionLength, tableEnd, programInfoLength, pid, result = { audio : -1, avc : -1, id3 : -1, isAAC : true};\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 case 0xcf: // SAMPLE-AES AAC\n if (!isSampleAes) {\n logger.log('unkown stream type:' + data[offset]);\n break;\n }\n /* falls through */\n\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.audio === -1) {\n result.audio = pid;\n }\n break;\n\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\n case 0xdb: // SAMPLE-AES AVC\n if (!isSampleAes) {\n logger.log('unkown stream type:' + data[offset]);\n break;\n }\n /* falls through */\n\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\n // ISO/IEC 11172-3 (MPEG-1 audio)\n // or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)\n case 0x03:\n case 0x04:\n //logger.log('MPEG PID:' + pid);\n if (!mpegSupported) {\n logger.log('MPEG audio found, not supported in this browser for now');\n } else if (result.audio === -1) {\n result.audio = pid;\n result.isAAC = false;\n }\n break;\n\n case 0x24:\n logger.warn('HEVC stream type found, not supported for now');\n break;\n\n default:\n 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 _parsePES(stream) {\n var i = 0, frag, pesFlags, pesPrefix, pesLen, pesHdrLen, pesData, pesPts, pesDts, payloadStartOffset, 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 let 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 parsed length is not zero and greater than total received length, 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 if (pesPts - pesDts > 60*90000) {\n logger.warn(`${Math.round((pesPts - pesDts)/90000)}s delta between PTS and DTS, align them`);\n pesPts = pesDts;\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 for( let j = 0, dataLen = data.length; j < dataLen ; j++) {\n frag = data[j];\n let 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 pushAccesUnit(avcSample,avcTrack) {\n if (avcSample.units.length && avcSample.frame) {\n const samples = avcTrack.samples;\n const nbSamples = samples.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 ||\n avcSample.key === true ||\n (avcTrack.sps && (nbSamples || this.contiguous))) {\n avcSample.id = nbSamples;\n samples.push(avcSample);\n } else {\n // dropped samples, track it\n avcTrack.dropped++;\n }\n }\n if(avcSample.debug.length) {\n logger.log(avcSample.pts + '/' + avcSample.dts + ':' + avcSample.debug);\n }\n }\n\n _parseAVCPES(pes,last) {\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 spsfound = false,\n i;\n //free pes.data to save up some memory\n pes.data = null;\n\n units.forEach(unit => {\n switch(unit.type) {\n //NDR\n case 1:\n push = true;\n if(debug && avcSample) {\n avcSample.debug += 'NDR ';\n }\n avcSample.frame = true;\n let data = unit.data;\n // only check slice type to detect KF in case SPS found in same packet (any keyframe is preceded by SPS ...)\n if (spsfound && data.length > 4) {\n // retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR\n let sliceType = new ExpGolomb(data).readSliceType();\n // 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice\n // SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.\n // An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.\n // I slice: A slice that is not an SI slice that is decoded using intra prediction only.\n //if (sliceType === 2 || sliceType === 7) {\n if (sliceType === 2 || sliceType === 4 || sliceType === 7 || sliceType === 9) {\n avcSample.key = true;\n }\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 avcSample.frame = true;\n break;\n //SEI\n case 6:\n push = true;\n if(debug && avcSample) {\n avcSample.debug += 'SEI ';\n }\n expGolombDecoder = new ExpGolomb(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 }\n else if (payloadSize < expGolombDecoder.bytesAvailable)\n {\n for (i = 0; i<payloadSize; i++)\n {\n expGolombDecoder.readUByte();\n }\n }\n }\n break;\n //SPS\n case 7:\n push = true;\n spsfound = true;\n if(debug && avcSample) {\n avcSample.debug += 'SPS ';\n }\n if(!track.sps) {\n expGolombDecoder = new ExpGolomb(unit.data);\n var config = expGolombDecoder.readSPS();\n track.width = config.width;\n track.height = config.height;\n track.pixelRatio = config.pixelRatio;\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 let units = avcSample.units;\n 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 _createAVCSample(key,pts,dts,debug) {\n return { key : key, pts : pts, dts : dts, units : [], debug : debug};\n }\n\n _insertSampleInOrder(arr, data) {\n var len = arr.length;\n if (len > 0) {\n if (data.pts >= arr[len-1].pts)\n {\n arr.push(data);\n }\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 }\n else {\n arr.push(data);\n }\n }\n\n _getLastNalUnit() {\n let avcSample = this.avcSample, lastUnit;\n // try to fallback to previous sample if current one is empty\n if (!avcSample || avcSample.units.length === 0) {\n let track = this._avcTrack, samples = track.samples;\n avcSample = samples[samples.length-1];\n }\n if (avcSample) {\n let units = avcSample.units;\n lastUnit = units[units.length - 1];\n }\n return lastUnit;\n }\n\n _parseAVCNALu(array) {\n var i = 0, len = array.byteLength, value, overflow, track = this._avcTrack, state = track.naluState || 0, lastState = state;\n var units = [], unit, unitType, lastUnitStart = -1, lastUnitType;\n //logger.log('PES:' + Hex.hexDump(array));\n\n if (state === -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 = array[0] & 0x1f;\n state = 0;\n i = 1;\n }\n\n while (i < len) {\n value = array[i++];\n // optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case\n if (!state) {\n state = value ? 0 : 1;\n continue;\n }\n if (state === 1) {\n state = value ? 0 : 2;\n continue;\n }\n // here we have state either equal to 2 or 3\n if(!value) {\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 let 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 let 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 }\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 let lastUnit = this._getLastNalUnit();\n if (lastUnit) {\n let 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 discardEPB(data) {\n var length = data.byteLength,\n EPBPositions = [],\n i = 1,\n newLength, newData;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 &&\n data[i + 1] === 0 &&\n 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 _parseAACPES(pes) {\n var track = this._audioTrack,\n data = pes.data,\n pts = pes.pts,\n startOffset = 0,\n aacOverFlow = this.aacOverFlow,\n aacLastPTS = this.aacLastPTS,\n frameDuration, frameIndex, offset, stamp, len;\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 (ADTS.isHeader(data, offset)) {\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.warn(`parsing error:${reason}`);\n this.observer.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: fatal, reason: reason});\n if (fatal) {\n return;\n }\n }\n\n ADTS.initTrackConfig(track, this.observer, data, offset, this.audioCodec);\n frameIndex = 0;\n frameDuration = ADTS.getFrameDuration(track.samplerate);\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.log(`AAC: align PTS for overlapping frames by ${Math.round((newPTS-pts)/90)}`);\n pts=newPTS;\n }\n }\n\n //scan for aac samples\n while (offset < len) {\n if (ADTS.isHeader(data, offset) && (offset + 5) < len) {\n var frame = ADTS.appendFrame(track, data, offset, pts, frameIndex);\n if (frame) {\n //logger.log(`${Math.round(frame.sample.pts)} : AAC`);\n offset += frame.length;\n stamp = frame.sample.pts;\n frameIndex++;\n } else {\n //logger.log('Unable to parse AAC frame');\n break;\n }\n } else {\n //nothing found, keep looking\n offset++;\n }\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 _parseMPEGPES(pes) {\n var data = pes.data;\n var length = data.length;\n var frameIndex = 0;\n var offset = 0;\n var pts = pes.pts;\n\n while (offset < length) {\n if (MpegAudio.isHeader(data, offset)) {\n var frame = MpegAudio.appendFrame(this._audioTrack, data, offset, pts, frameIndex);\n if (frame) {\n offset += frame.length;\n frameIndex++;\n } else {\n //logger.log('Unable to parse Mpeg audio frame');\n break;\n }\n } else {\n //nothing found, keep looking\n offset++;\n }\n }\n }\n\n _parseID3PES(pes) {\n this._id3Track.samples.push(pes);\n }\n}\n\nexport default TSDemuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/demux/tsdemuxer.js","export const 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 a mux Error (demuxing/remuxing)\n MUX_ERROR: 'muxError',\n // Identifier for all other errors\n OTHER_ERROR: 'otherError'\n};\n\nexport const 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: {id : demuxer Id,frag: fragment object, reason : parsing error description }\n FRAG_DECRYPT_ERROR: 'fragDecryptError',\n // Identifier for a fragment parsing error event - data: { id : demuxer Id, reason : parsing error description }\n // will be renamed DEMUX_PARSING_ERROR and switched to MUX_ERROR in the next major release\n FRAG_PARSING_ERROR: 'fragParsingError',\n // 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 }\n REMUX_ALLOC_ERROR : 'remuxAllocError',\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 a buffer nudge on stall (playback is stuck although currentTime is in a buffered area)\n BUFFER_NUDGE_ON_STALL : 'bufferNudgeOnStall',\n // Identifier for an internal exception happening inside hls.js while handling an event\n INTERNAL_EXCEPTION: 'internalException',\n // Malformed WebVTT contents\n WEBVTT_EXCEPTION: 'webVTTException'\n};\n\n\n\n// WEBPACK FOOTER //\n// src/errors.js","/*\n*\n* All objects in the event handling chain should inherit from this class\n*\n*/\n\nimport {logger} from './utils/logger';\nimport {ErrorTypes, ErrorDetails} from './errors';\nimport Event from './events';\n\nclass EventHandler {\n\n constructor(hls, ...events) {\n this.hls = hls;\n this.onEvent = this.onEvent.bind(this);\n this.handledEvents = events;\n this.useGenericHandler = true;\n\n this.registerListeners();\n }\n\n destroy() {\n this.unregisterListeners();\n }\n\n isEventHandler() {\n return typeof this.handledEvents === 'object' && this.handledEvents.length && typeof this.onEvent === 'function';\n }\n\n 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 }, this);\n }\n }\n\n unregisterListeners() {\n if (this.isEventHandler()) {\n this.handledEvents.forEach(function(event) {\n this.hls.off(event, this.onEvent);\n }, this);\n }\n }\n\n /**\n * arguments: event (string), data (any)\n */\n onEvent(event, data) {\n this.onEventGeneric(event, data);\n }\n\n onEventGeneric(event, data) {\n var eventToFunction = function(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.error(`internal error happened while processing ${event}:${err.message}`);\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.OTHER_ERROR, details: ErrorDetails.INTERNAL_EXCEPTION, fatal: false, event : event, err : err});\n }\n }\n}\n\nexport default EventHandler;\n\n\n\n// WEBPACK FOOTER //\n// src/event-handler.js","module.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 reset - data: { }\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, pending : nb of segments waiting for appending for this segment parent}\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 - 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 buffer has been flushed - data: { }\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 switch is requested - data: { level : id of new level } // deprecated in favor LEVEL_SWITCHING\n LEVEL_SWITCH: 'hlsLevelSwitch',\n // fired when a level switch is requested - data: { level : id of new level }\n LEVEL_SWITCHING: 'hlsLevelSwitching',\n // fired when a level switch is effective - data: { level : id of new level }\n LEVEL_SWITCHED: 'hlsLevelSwitched',\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 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 } // deprecated in favor AUDIO_TRACK_SWITCHING\n AUDIO_TRACK_SWITCH: 'hlsAudioTrackSwitch',\n // fired when an audio track switching is requested - data: { id : audio track id }\n AUDIO_TRACK_SWITCHING: 'hlsAudioTrackSwitching',\n // fired when an audio track switch actually occurs - data: { id : audio track id }\n AUDIO_TRACK_SWITCHED: 'hlsAudioTrackSwitched',\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 to notify that subtitle track lists has been updated - data: { subtitleTracks : subtitleTracks }\n SUBTITLE_TRACKS_UPDATED: 'hlsSubtitleTracksUpdated',\n // fired when an subtitle track switch occurs - data: { id : subtitle track id }\n SUBTITLE_TRACK_SWITCH: 'hlsSubtitleTrackSwitch',\n // fired when a subtitle track loading starts - data: { url : subtitle track URL, id : subtitle track id }\n SUBTITLE_TRACK_LOADING: 'hlsSubtitleTrackLoading',\n // fired when a subtitle track loading finishes - data: { details : levelDetails object, id : subtitle track id, stats : { trequest, tfirst, tload, mtime } }\n SUBTITLE_TRACK_LOADED: 'hlsSubtitleTrackLoaded',\n // fired when a subtitle fragment has been processed - data: { success : boolean, frag : the processed frag }\n SUBTITLE_FRAG_PROCESSED: 'hlsSubtitleFragProcessed',\n // fired when the first timestamp is found - data: { id : demuxer id, initPTS: initPTS, frag : fragment object }\n INIT_PTS_FOUND: 'hlsInitPtsFound',\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 a fragment has finished decrypting - data: { id : demuxer id, frag: fragment object, stats : { tstart, tdecrypt } }\n FRAG_DECRYPTED: 'hlsFragDecrypted',\n // 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 }\n FRAG_PARSING_INIT_SEGMENT: 'hlsFragParsingInitSegment',\n // fired when parsing sei text is completed - data: { id : demuxer id, frag: fragment object, samples : [ sei samples pes ] }\n FRAG_PARSING_USERDATA: 'hlsFragParsingUserdata',\n // fired when parsing id3 is completed - data: { id : demuxer id, frag: fragment object, samples : [ id3 samples pes ] }\n FRAG_PARSING_METADATA: 'hlsFragParsingMetadata',\n // 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}\n FRAG_PARSING_DATA: 'hlsFragParsingData',\n // fired when fragment parsing is completed - data: { id : demuxer id, frag: fragment object }\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, bwEstimate } }\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 - data: { }\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\n\n// WEBPACK FOOTER //\n// src/events.js","/**\n * AAC helper\n */\n\nclass AAC {\n static getSilentFrame(codec,channelCount) {\n switch(codec) {\n case 'mp4a.40.2':\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 break;\n // handle HE-AAC below (mp4a.40.5 / mp4a.40.29)\n default:\n if (channelCount === 1) {\n // 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\n 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]);\n } else if (channelCount === 2) {\n // 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\n 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]);\n } else if (channelCount === 3) {\n // 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\n 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]);\n }\n break;\n }\n return null;\n }\n}\n\nexport default AAC;\n\n\n\n// WEBPACK FOOTER //\n// src/helper/aac.js","/**\n * Buffer Helper utils, providing methods dealing buffer length retrieval\n*/\n\nconst BufferHelper = {\n isBuffered : function(media,position) {\n if (media) {\n let buffered = media.buffered;\n for (let 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 bufferInfo : function(media, pos,maxHoleDuration) {\n if (media) {\n var vbuffered = media.buffered, buffered = [],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: pos, end: pos, nextStart : undefined} ;\n }\n },\n\n bufferedInfo : function(buffered,pos,maxHoleDuration) {\n var buffered2 = [],\n // bufferStart and bufferEnd are buffer boundaries around current video position\n bufferLen,bufferStart, bufferEnd,bufferStartNext,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\nmodule.exports = BufferHelper;\n\n\n\n// WEBPACK FOOTER //\n// src/helper/buffer-helper.js","/**\n * Level Helper class, providing methods dealing with playlist sliding and drift\n*/\n\nimport {logger} from '../utils/logger';\n\nconst LevelHelper = {\n\n mergeDetails : function(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 newFrag.backtracked = oldFrag.backtracked;\n newFrag.dropped = oldFrag.dropped;\n PTSFrag = newFrag;\n }\n }\n }\n\n if(ccOffset) {\n 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,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 updateFragPTSDTS : function(details,frag,startPTS,endPTS,startDTS,endDTS) {\n // update frag PTS/DTS\n let maxStartPTS = startPTS;\n if(!isNaN(frag.startPTS)) {\n // delta PTS between audio and video\n let 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 maxStartPTS = Math.max(startPTS,frag.startPTS);\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 const drift = startPTS - frag.start;\n frag.start = frag.startPTS = startPTS;\n frag.maxStartPTS = maxStartPTS;\n frag.endPTS = endPTS;\n frag.startDTS = startDTS;\n frag.endDTS = endDTS;\n frag.duration = endPTS - startPTS;\n\n const sn = frag.sn;\n // exit if sn out of range\n if (!details || sn < details.startSN || sn > details.endSN) {\n return 0;\n }\n var fragIdx, fragments, i;\n fragIdx = sn - details.startSN;\n fragments = details.fragments;\n frag = fragments[fragIdx];\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 updatePTS : function(fragments,fromIdx, toIdx) {\n var fragFrom = fragments[fromIdx],fragTo = fragments[toIdx], 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.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.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 = Math.max(fragFrom.start - fragTo.duration, 0);\n }\n }\n }\n};\n\nmodule.exports = LevelHelper;\n\n\n\n// WEBPACK FOOTER //\n// src/helper/level-helper.js","/**\n * HLS interface\n */\nimport URLToolkit from 'url-toolkit';\nimport Event from './events';\nimport {ErrorTypes, ErrorDetails} from './errors';\nimport PlaylistLoader from './loader/playlist-loader';\nimport FragmentLoader from './loader/fragment-loader';\nimport KeyLoader from './loader/key-loader';\n\nimport StreamController from './controller/stream-controller';\nimport LevelController from './controller/level-controller';\nimport ID3TrackController from './controller/id3-track-controller';\n\nimport {logger, enableLogs} from './utils/logger';\nimport EventEmitter from 'events';\nimport {hlsDefaultConfig} from './config';\n\nclass Hls {\n\n static get version() {\n // replaced with browserify-versionify transform\n return '0.7.10';\n }\n\n static isSupported() {\n const mediaSource = window.MediaSource = window.MediaSource || window.WebKitMediaSource;\n const sourceBuffer = window.SourceBuffer = window.SourceBuffer || window.WebKitSourceBuffer;\n const isTypeSupported = mediaSource &&\n typeof mediaSource.isTypeSupported === 'function' &&\n mediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"');\n\n // if SourceBuffer is exposed ensure its API is valid\n // safari and old version of Chrome doe not expose SourceBuffer globally so checking SourceBuffer.prototype is impossible\n const sourceBufferValidAPI = !sourceBuffer ||\n (sourceBuffer.prototype &&\n typeof sourceBuffer.prototype.appendBuffer === 'function' &&\n typeof sourceBuffer.prototype.remove === 'function');\n return isTypeSupported && sourceBufferValidAPI;\n }\n\n static get Events() {\n return Event;\n }\n\n static get ErrorTypes() {\n return ErrorTypes;\n }\n\n static get ErrorDetails() {\n return ErrorDetails;\n }\n\n static get DefaultConfig() {\n if(!Hls.defaultConfig) {\n return hlsDefaultConfig;\n }\n return Hls.defaultConfig;\n }\n\n static set DefaultConfig(defaultConfig) {\n Hls.defaultConfig = defaultConfig;\n }\n\n constructor(config = {}) {\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) { continue; }\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 enableLogs(config.debug);\n this.config = config;\n this._autoLevelCapping = -1;\n // observer setup\n var observer = this.observer = new EventEmitter();\n observer.trigger = function trigger (event, ...data) {\n observer.emit(event, event, ...data);\n };\n\n observer.off = function off (event, ...data) {\n observer.removeListener(event, ...data);\n };\n this.on = observer.on.bind(observer);\n this.off = observer.off.bind(observer);\n this.trigger = observer.trigger.bind(observer);\n\n // core controllers and network loaders\n const abrController = this.abrController = new config.abrController(this);\n const bufferController = new config.bufferController(this);\n const capLevelController = new config.capLevelController(this);\n const fpsController = new config.fpsController(this);\n const playListLoader = new PlaylistLoader(this);\n const fragmentLoader = new FragmentLoader(this);\n const keyLoader = new KeyLoader(this);\n const id3TrackController = new ID3TrackController(this);\n\n // network controllers\n const levelController = this.levelController = new LevelController(this);\n const streamController = this.streamController = new StreamController(this);\n let networkControllers = [levelController, streamController];\n\n // optional audio stream controller\n let Controller = config.audioStreamController;\n if (Controller) {\n networkControllers.push(new Controller(this));\n }\n this.networkControllers = networkControllers;\n\n let coreComponents = [ playListLoader, fragmentLoader, keyLoader, abrController, bufferController, capLevelController, fpsController, id3TrackController ];\n\n // optional audio track and subtitle controller\n Controller = config.audioTrackController;\n if (Controller) {\n let audioTrackController = new Controller(this);\n this.audioTrackController = audioTrackController;\n coreComponents.push(audioTrackController);\n }\n\n Controller = config.subtitleTrackController;\n if (Controller) {\n let subtitleTrackController = new Controller(this);\n this.subtitleTrackController = subtitleTrackController;\n coreComponents.push(subtitleTrackController);\n }\n\n // optional subtitle controller\n [config.subtitleStreamController, config.timelineController].forEach(Controller => {\n if (Controller) {\n coreComponents.push(new Controller(this));\n }\n });\n this.coreComponents = coreComponents;\n }\n\n destroy() {\n logger.log('destroy');\n this.trigger(Event.DESTROYING);\n this.detachMedia();\n this.coreComponents.concat(this.networkControllers).forEach(component => {component.destroy();});\n this.url = null;\n this.observer.removeAllListeners();\n this._autoLevelCapping = -1;\n }\n\n attachMedia(media) {\n logger.log('attachMedia');\n this.media = media;\n this.trigger(Event.MEDIA_ATTACHING, {media: media});\n }\n\n detachMedia() {\n logger.log('detachMedia');\n this.trigger(Event.MEDIA_DETACHING);\n this.media = null;\n }\n\n loadSource(url) {\n url = URLToolkit.buildAbsoluteURL(window.location.href, url, { alwaysNormalize: true });\n logger.log(`loadSource:${url}`);\n this.url = url;\n // when attaching to a source URL, trigger a playlist load\n this.trigger(Event.MANIFEST_LOADING, {url: url});\n }\n\n startLoad(startPosition=-1) {\n logger.log(`startLoad(${startPosition})`);\n this.networkControllers.forEach(controller => {controller.startLoad(startPosition);});\n }\n\n stopLoad() {\n logger.log('stopLoad');\n this.networkControllers.forEach(controller => {controller.stopLoad();});\n }\n\n swapAudioCodec() {\n logger.log('swapAudioCodec');\n this.streamController.swapAudioCodec();\n }\n\n recoverMediaError() {\n logger.log('recoverMediaError');\n var media = this.media;\n this.detachMedia();\n this.attachMedia(media);\n }\n\n /** Return all quality levels **/\n get levels() {\n return this.levelController.levels;\n }\n\n /** Return current playback quality level **/\n get currentLevel() {\n return this.streamController.currentLevel;\n }\n\n /* set quality level immediately (-1 for automatic level selection) */\n set currentLevel(newLevel) {\n 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 get nextLevel() {\n return this.streamController.nextLevel;\n }\n\n /* set quality level for next fragment (-1 for automatic level selection) */\n set nextLevel(newLevel) {\n 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 get loadLevel() {\n return this.levelController.level;\n }\n\n /* set quality level for current/next loaded fragment (-1 for automatic level selection) */\n set loadLevel(newLevel) {\n logger.log(`set loadLevel:${newLevel}`);\n this.levelController.manualLevel = newLevel;\n }\n\n /** Return the quality level of next loaded fragment **/\n get nextLoadLevel() {\n return this.levelController.nextLoadLevel;\n }\n\n /** set quality level of next loaded fragment **/\n set nextLoadLevel(level) {\n this.levelController.nextLoadLevel = level;\n }\n\n /** Return first level (index of first level referenced in manifest)\n **/\n get firstLevel() {\n return Math.max(this.levelController.firstLevel, this.minAutoLevel);\n }\n\n /** set first level (index of first level referenced in manifest)\n **/\n set firstLevel(newLevel) {\n 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 get startLevel() {\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 set startLevel(newLevel) {\n logger.log(`set startLevel:${newLevel}`);\n const hls = this;\n // if not in automatic start level detection, ensure startLevel is greater than minAutoLevel\n if (newLevel !== -1) {\n newLevel = Math.max(newLevel,hls.minAutoLevel);\n }\n hls.levelController.startLevel = newLevel;\n }\n\n /** Return the capping/max level value that could be used by automatic level selection algorithm **/\n get autoLevelCapping() {\n return this._autoLevelCapping;\n }\n\n /** set the capping/max level value that could be used by automatic level selection algorithm **/\n set autoLevelCapping(newLevel) {\n logger.log(`set autoLevelCapping:${newLevel}`);\n this._autoLevelCapping = newLevel;\n }\n\n /* check if we are in automatic level selection mode */\n get autoLevelEnabled() {\n return (this.levelController.manualLevel === -1);\n }\n\n /* return manual level */\n get manualLevel() {\n return this.levelController.manualLevel;\n }\n\n /* return min level selectable in auto mode according to config.minAutoBitrate */\n get minAutoLevel() {\n let hls = this, levels = hls.levels, minAutoBitrate = hls.config.minAutoBitrate, len = levels ? levels.length : 0;\n for (let i = 0; i < len; i++) {\n const levelNextBitrate = levels[i].realBitrate ? Math.max(levels[i].realBitrate,levels[i].bitrate) : levels[i].bitrate;\n if (levelNextBitrate > minAutoBitrate) {\n return i;\n }\n }\n return 0;\n }\n\n /* return max level selectable in auto mode according to autoLevelCapping */\n get maxAutoLevel() {\n const hls = this;\n const levels = hls.levels;\n const autoLevelCapping = hls.autoLevelCapping;\n let 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 // return next auto level\n get nextAutoLevel() {\n const hls = this;\n // ensure next auto level is between min and max auto level\n return Math.min(Math.max(hls.abrController.nextAutoLevel,hls.minAutoLevel),hls.maxAutoLevel);\n }\n\n // this setter is used to force next auto level\n // 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)\n // forced value is valid for one fragment. upon succesful frag loading at forced level, this value will be resetted to -1 by ABR controller\n set nextAutoLevel(nextLevel) {\n const hls = this;\n hls.abrController.nextAutoLevel = Math.max(hls.minAutoLevel,nextLevel);\n }\n\n /** get alternate audio tracks list from playlist **/\n get audioTracks() {\n const audioTrackController = this.audioTrackController;\n return audioTrackController ? audioTrackController.audioTracks : [];\n }\n\n /** get index of the selected audio track (index in audio track lists) **/\n get audioTrack() {\n const audioTrackController = this.audioTrackController;\n return audioTrackController ? audioTrackController.audioTrack : -1;\n }\n\n /** select an audio track, based on its index in audio track lists**/\n set audioTrack(audioTrackId) {\n const audioTrackController = this.audioTrackController;\n if (audioTrackController) {\n audioTrackController.audioTrack = audioTrackId;\n }\n }\n\n get liveSyncPosition() {\n return this.streamController.liveSyncPosition;\n }\n\n /** get alternate subtitle tracks list from playlist **/\n get subtitleTracks() {\n const subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTracks : [];\n }\n\n /** get index of the selected subtitle track (index in subtitle track lists) **/\n get subtitleTrack() {\n const subtitleTrackController = this.subtitleTrackController;\n return subtitleTrackController ? subtitleTrackController.subtitleTrack : -1;\n }\n\n /** select an subtitle track, based on its index in subtitle track lists**/\n set subtitleTrack(subtitleTrackId) {\n const subtitleTrackController = this.subtitleTrackController;\n if (subtitleTrackController) {\n subtitleTrackController.subtitleTrack = subtitleTrackId;\n }\n }\n}\n\nexport default Hls;\n\n\n\n// WEBPACK FOOTER //\n// src/hls.js","// 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 = require('./hls.js').default;\n\n\n\n// WEBPACK FOOTER //\n// src/index.js","/*\n * Fragment Loader\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nclass FragmentLoader extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.FRAG_LOADING);\n this.loaders = {};\n }\n\n destroy() {\n let loaders = this.loaders;\n for (let loaderName in loaders) {\n let loader = loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n EventHandler.prototype.destroy.call(this);\n }\n\n onFragLoading(data) {\n let 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.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 let loaderContext, loaderConfig, loaderCallbacks;\n loaderContext = { url : frag.url, frag : frag, responseType : 'arraybuffer', progressData : false};\n let start = frag.byteRangeStartOffset, 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 loadsuccess(response, stats, context, networkDetails=null) {\n let payload = response.data, frag = context.frag;\n // detach fragment loader on load success\n frag.loader = undefined;\n this.loaders[frag.type] = undefined;\n this.hls.trigger(Event.FRAG_LOADED, {payload: payload, frag: frag, stats: stats, networkDetails: networkDetails});\n }\n\n loaderror(response, context, networkDetails=null) {\n let loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.FRAG_LOAD_ERROR, fatal: false, frag: context.frag, response: response, networkDetails: networkDetails});\n }\n\n loadtimeout(stats, context, networkDetails=null) {\n let loader = context.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.FRAG_LOAD_TIMEOUT, fatal: false, frag: context.frag, networkDetails: networkDetails});\n }\n\n // data will be used for progressive parsing\n loadprogress(stats, context, data, networkDetails=null) { // jshint ignore:line\n let frag = context.frag;\n frag.loaded = stats.loaded;\n this.hls.trigger(Event.FRAG_LOAD_PROGRESS, {frag: frag, stats: stats, networkDetails: networkDetails});\n }\n}\n\nexport default FragmentLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/loader/fragment-loader.js","/*\n * Decrypt key Loader\n*/\n\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport {logger} from '../utils/logger';\n\nclass KeyLoader extends EventHandler {\n\n constructor(hls) {\n super(hls, Event.KEY_LOADING);\n this.loaders = {};\n this.decryptkey = null;\n this.decrypturl = null;\n }\n\n destroy() {\n for (let loaderName in this.loaders) {\n let loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n EventHandler.prototype.destroy.call(this);\n }\n\n onKeyLoading(data) {\n let 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 let config = this.hls.config;\n\n if (loader) {\n logger.warn(`abort previous key 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 let loaderContext, loaderConfig, loaderCallbacks;\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(Event.KEY_LOADED, {frag: frag});\n }\n }\n\n loadsuccess(response, stats, context) {\n let 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[frag.type] = undefined;\n this.hls.trigger(Event.KEY_LOADED, {frag: frag});\n }\n\n loaderror(response, context) {\n let frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.KEY_LOAD_ERROR, fatal: false, frag: frag, response: response});\n }\n\n loadtimeout(stats, context) {\n let frag = context.frag,\n loader = frag.loader;\n if (loader) {\n loader.abort();\n }\n this.loaders[context.type] = undefined;\n this.hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.KEY_LOAD_TIMEOUT, fatal: false, frag: frag});\n }\n}\n\nexport default KeyLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/loader/key-loader.js","/**\n * Playlist Loader\n*/\n\nimport URLToolkit from 'url-toolkit';\nimport Event from '../events';\nimport EventHandler from '../event-handler';\nimport {ErrorTypes, ErrorDetails} from '../errors';\nimport AttrList from '../utils/attr-list';\nimport {logger} from '../utils/logger';\n\n// https://regex101.com is your friend\nconst MASTER_PLAYLIST_REGEX = /#EXT-X-STREAM-INF:([^\\n\\r]*)[\\r\\n]+([^\\r\\n]+)/g;\nconst MASTER_PLAYLIST_MEDIA_REGEX = /#EXT-X-MEDIA:(.*)/g;\n\nconst LEVEL_PLAYLIST_REGEX_FAST = new RegExp([\n /#EXTINF:(\\d*(?:\\.\\d+)?)(?:,(.*)\\s+)?/.source, // duration (#EXTINF:<duration>,<title>), group 1 => duration, group 2 => title\n /|(?!#)(\\S+)/.source, // segment URI, group 3 => the URI (note newline is not eaten)\n /|#EXT-X-BYTERANGE:*(.+)/.source, // next segment's byterange, group 4 => range spec (x@y)\n /|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source, // next segment's program date/time group 5 => the datetime spec\n /|#.*/.source // All other non-segment oriented tags will match with all groups empty\n].join(''), 'g');\n\nconst 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?/;\n\nclass LevelKey {\n\n constructor() {\n this.method = null;\n this.key = null;\n this.iv = null;\n this._uri = null;\n }\n\n get uri() {\n if (!this._uri && this.reluri) {\n this._uri = URLToolkit.buildAbsoluteURL(this.baseuri, this.reluri, { alwaysNormalize: true });\n }\n return this._uri;\n }\n\n}\n\nclass Fragment {\n\n constructor() {\n this._url = null;\n this._byteRange = null;\n this._decryptdata = null;\n this.tagList = [];\n }\n\n get url() {\n if (!this._url && this.relurl) {\n this._url = URLToolkit.buildAbsoluteURL(this.baseurl, this.relurl, { alwaysNormalize: true });\n }\n return this._url;\n }\n\n set url(value) {\n this._url = value;\n }\n\n get programDateTime() {\n if (!this._programDateTime && this.rawProgramDateTime) {\n this._programDateTime = new Date(Date.parse(this.rawProgramDateTime));\n }\n return this._programDateTime;\n }\n\n get byteRange() {\n if (!this._byteRange) {\n let byteRange = this._byteRange = [];\n if (this.rawByteRange) {\n const params = this.rawByteRange.split('@', 2);\n if (params.length === 1) {\n const lastByteRangeEndOffset = this.lastByteRangeEndOffset;\n byteRange[0] = lastByteRangeEndOffset ? lastByteRangeEndOffset : 0;\n } else {\n byteRange[0] = parseInt(params[1]);\n }\n byteRange[1] = parseInt(params[0]) + byteRange[0];\n }\n }\n return this._byteRange;\n }\n\n get byteRangeStartOffset() {\n return this.byteRange[0];\n }\n\n get byteRangeEndOffset() {\n return this.byteRange[1];\n }\n\n get decryptdata() {\n if (!this._decryptdata) {\n this._decryptdata = this.fragmentDecryptdataFromLevelkey(this.levelkey, this.sn);\n }\n return this._decryptdata;\n }\n\n /**\n * Utility method for parseLevelPlaylist to create an initialization vector for a given segment\n * @returns {Uint8Array}\n */\n 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 fragmentDecryptdataFromLevelkey(levelkey, segmentNumber) {\n var decryptdata = levelkey;\n\n if (levelkey && levelkey.method && levelkey.uri && !levelkey.iv) {\n decryptdata = new LevelKey();\n decryptdata.method = levelkey.method;\n decryptdata.baseuri = levelkey.baseuri;\n decryptdata.reluri = levelkey.reluri;\n decryptdata.iv = this.createInitializationVector(segmentNumber);\n }\n\n return decryptdata;\n }\n\n cloneObj(obj) {\n return JSON.parse(JSON.stringify(obj));\n }\n}\n\nclass PlaylistLoader extends EventHandler {\n\n constructor(hls) {\n super(hls,\n Event.MANIFEST_LOADING,\n Event.LEVEL_LOADING,\n Event.AUDIO_TRACK_LOADING,\n Event.SUBTITLE_TRACK_LOADING);\n this.loaders = {};\n }\n\n destroy() {\n for (let loaderName in this.loaders) {\n let loader = this.loaders[loaderName];\n if (loader) {\n loader.destroy();\n }\n }\n this.loaders = {};\n EventHandler.prototype.destroy.call(this);\n }\n\n onManifestLoading(data) {\n this.load(data.url, { type : 'manifest'});\n }\n\n onLevelLoading(data) {\n this.load(data.url, { type : 'level', level : data.level, id : data.id});\n }\n\n onAudioTrackLoading(data) {\n this.load(data.url, { type : 'audioTrack', id : data.id});\n }\n\n onSubtitleTrackLoading(data) {\n this.load(data.url, { type : 'subtitleTrack', id : data.id});\n }\n\n load(url, context) {\n let loader = this.loaders[context.type];\n if (loader) {\n let loaderContext = loader.context;\n if (loaderContext && loaderContext.url === url) {\n logger.trace(`playlist request ongoing`);\n return;\n } else {\n logger.warn(`abort previous loader for type:${context.type}`);\n loader.abort();\n }\n }\n let config = this.hls.config,\n retry,\n timeout,\n retryDelay,\n maxRetryDelay;\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.log(`loading playlist for ${context.type} ${context.level || context.id}`);\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 let loaderConfig, loaderCallbacks;\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 resolve(url, baseUrl) {\n return URLToolkit.buildAbsoluteURL(baseUrl, url, { alwaysNormalize: true });\n }\n\n parseMasterPlaylist(string, baseurl) {\n let levels = [], result;\n MASTER_PLAYLIST_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_REGEX.exec(string)) != null){\n const level = {};\n\n var attrs = level.attrs = new AttrList(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 (let i = 0; i < codecs.length; i++) {\n const codec = codecs[i];\n if (codec.indexOf('avc1') !== -1) {\n level.videoCodec = this.avc1toavcoti(codec);\n } else if (codec.indexOf('hvc1') !== -1) {\n level.videoCodec = codec;\n } else {\n level.audioCodec = codec;\n }\n }\n }\n\n levels.push(level);\n }\n return levels;\n }\n\n parseMasterPlaylistMedia(string, baseurl, type, audioCodec=null) {\n let result, medias = [], id = 0;\n MASTER_PLAYLIST_MEDIA_REGEX.lastIndex = 0;\n while ((result = MASTER_PLAYLIST_MEDIA_REGEX.exec(string)) != null){\n const media = {};\n var attrs = new AttrList(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 if (audioCodec) {\n media.audioCodec = audioCodec;\n }\n media.id = id++;\n medias.push(media);\n }\n }\n return medias;\n }\n\n avc1toavcoti(codec) {\n var result, 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 parseLevelPlaylist(string, baseurl, id, type) {\n var currentSN = 0,\n totalduration = 0,\n level = {type: null, version: null, url: baseurl, fragments: [], live: true, startSN: 0},\n levelkey = new LevelKey(),\n cc = 0,\n prevFrag = null,\n frag = new Fragment(),\n result,\n i;\n\n LEVEL_PLAYLIST_REGEX_FAST.lastIndex = 0;\n\n while ((result = LEVEL_PLAYLIST_REGEX_FAST.exec(string)) !== null) {\n const duration = result[1];\n if (duration) { // INF\n frag.duration = parseFloat(duration);\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n const title = (' ' + result[2]).slice(1);\n frag.title = title ? title : null;\n frag.tagList.push(title ? [ 'INF',duration,title ] : [ 'INF',duration ]);\n } else if (result[3]) { // url\n if (!isNaN(frag.duration)) {\n const sn = currentSN++;\n frag.type = type;\n frag.start = totalduration;\n frag.levelkey = levelkey;\n frag.sn = sn;\n frag.level = id;\n frag.cc = cc;\n frag.baseurl = baseurl;\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.relurl = (' ' + result[3]).slice(1);\n\n level.fragments.push(frag);\n prevFrag = frag;\n totalduration += frag.duration;\n\n frag = new Fragment();\n }\n } else if (result[4]) { // X-BYTERANGE\n frag.rawByteRange = (' ' + result[4]).slice(1);\n if (prevFrag) {\n const lastByteRangeEndOffset = prevFrag.byteRangeEndOffset;\n if (lastByteRangeEndOffset) {\n frag.lastByteRangeEndOffset = lastByteRangeEndOffset;\n }\n }\n } else if (result[5]) { // PROGRAM-DATE-TIME\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n frag.rawProgramDateTime = (' ' + result[5]).slice(1);\n frag.tagList.push(['PROGRAM-DATE-TIME', frag.rawProgramDateTime]);\n } else {\n result = result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);\n for (i = 1; i < result.length; i++) {\n if (result[i] !== undefined) {\n break;\n }\n }\n\n // avoid sliced strings https://github.com/video-dev/hls.js/issues/939\n const value1 = (' ' + result[i+1]).slice(1);\n const value2 = (' ' + result[i+2]).slice(1);\n\n switch (result[i]) {\n case '#':\n frag.tagList.push(value2 ? [ value1,value2 ] : [ value1 ]);\n break;\n case 'PLAYLIST-TYPE':\n level.type = value1.toUpperCase();\n break;\n case 'MEDIA-SEQUENCE':\n currentSN = level.startSN = parseInt(value1);\n break;\n case 'TARGETDURATION':\n level.targetduration = parseFloat(value1);\n break;\n case 'VERSION':\n level.version = parseInt(value1);\n break;\n case 'EXTM3U':\n break;\n case 'ENDLIST':\n level.live = false;\n break;\n case 'DIS':\n cc++;\n frag.tagList.push(['DIS']);\n break;\n case 'DISCONTINUITY-SEQ':\n cc = parseInt(value1);\n break;\n case 'KEY':\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-08#section-3.4.4\n var decryptparams = value1;\n var keyAttrs = new AttrList(decryptparams);\n var decryptmethod = keyAttrs.enumeratedString('METHOD'),\n decrypturi = keyAttrs.URI,\n decryptiv = keyAttrs.hexadecimalInteger('IV');\n if (decryptmethod) {\n levelkey = new LevelKey();\n if ((decrypturi) && (['AES-128', 'SAMPLE-AES'].indexOf(decryptmethod) >= 0)) {\n levelkey.method = decryptmethod;\n // URI to get the key\n levelkey.baseuri = baseurl;\n levelkey.reluri = decrypturi;\n levelkey.key = null;\n // Initialization Vector (IV)\n levelkey.iv = decryptiv;\n }\n }\n break;\n case 'START':\n let startParams = value1;\n let startAttrs = new AttrList(startParams);\n let startTimeOffset = startAttrs.decimalFloatingPoint('TIME-OFFSET');\n //TIME-OFFSET can be 0\n if ( !isNaN(startTimeOffset) ) {\n level.startTimeOffset = startTimeOffset;\n }\n break;\n case 'MAP':\n let mapAttrs = new AttrList(value1);\n frag.relurl = mapAttrs.URI;\n frag.rawByteRange = mapAttrs.BYTERANGE;\n frag.baseurl = baseurl;\n frag.level = id;\n frag.type = type;\n frag.sn = 'initSegment';\n level.initSegment = frag;\n frag = new Fragment();\n break;\n default:\n logger.warn(`line parsed but not handled: ${result}`);\n break;\n }\n }\n }\n frag = prevFrag;\n //logger.log('found ' + level.fragments.length + ' fragments');\n if(frag && !frag.relurl) {\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 loadsuccess(response, stats, context, networkDetails=null) {\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 let isLevel = (type !== 'audioTrack' && type !== 'subtitleTrack'),\n levelId = !isNaN(level) ? level : !isNaN(id) ? id : 0,\n levelDetails = this.parseLevelPlaylist(string, url, levelId, (type === 'audioTrack' ? 'audio' : (type === 'subtitleTrack' ? 'subtitle' : 'main') ));\n levelDetails.tload = stats.tload;\n if (type === 'manifest') {\n // first request, stream manifest (no master playlist), fire manifest loaded event with level details\n hls.trigger(Event.MANIFEST_LOADED, {levels: [{url: url, details : levelDetails}], audioTracks : [], url: url, stats: stats, networkDetails: networkDetails});\n }\n stats.tparsed = performance.now();\n if (levelDetails.targetduration) {\n if (isLevel) {\n hls.trigger(Event.LEVEL_LOADED, {details: levelDetails, level: level || 0, id: id || 0, stats: stats, networkDetails: networkDetails});\n } else {\n if (type === 'audioTrack') {\n hls.trigger(Event.AUDIO_TRACK_LOADED, {details: levelDetails, id: id, stats: stats, networkDetails: networkDetails});\n }\n else if (type === 'subtitleTrack') {\n hls.trigger(Event.SUBTITLE_TRACK_LOADED, {details: levelDetails, id: id, stats: stats, networkDetails: networkDetails});\n }\n }\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'invalid targetduration', networkDetails: networkDetails});\n }\n } else {\n let levels = this.parseMasterPlaylist(string, url);\n // multi level playlist, parse level info\n if (levels.length) {\n let audioTracks = this.parseMasterPlaylistMedia(string, url, 'AUDIO', levels[0].audioCodec);\n let subtitles = this.parseMasterPlaylistMedia(string, url, 'SUBTITLES');\n if (audioTracks.length) {\n // check if we have found an audio track embedded in main playlist (audio track without URI attribute)\n let embeddedAudioFound = false;\n audioTracks.forEach(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.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(Event.MANIFEST_LOADED, {levels, audioTracks, subtitles, url, stats, networkDetails});\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no level found in manifest', networkDetails: networkDetails});\n }\n }\n } else {\n hls.trigger(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: ErrorDetails.MANIFEST_PARSING_ERROR, fatal: true, url: url, reason: 'no EXTM3U delimiter', networkDetails: networkDetails});\n }\n }\n\n loaderror(response, context, networkDetails=null) {\n var details, fatal,loader = context.loader;\n switch(context.type) {\n case 'manifest':\n details = ErrorDetails.MANIFEST_LOAD_ERROR;\n fatal = true;\n break;\n case 'level':\n details = ErrorDetails.LEVEL_LOAD_ERROR;\n fatal = false;\n break;\n case 'audioTrack':\n details = 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(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, response: response, context : context, networkDetails: networkDetails});\n }\n\n loadtimeout(stats, context, networkDetails=null) {\n var details, fatal, loader = context.loader;\n switch(context.type) {\n case 'manifest':\n details = ErrorDetails.MANIFEST_LOAD_TIMEOUT;\n fatal = true;\n break;\n case 'level':\n details = ErrorDetails.LEVEL_LOAD_TIMEOUT;\n fatal = false;\n break;\n case 'audioTrack':\n details = 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(Event.ERROR, {type: ErrorTypes.NETWORK_ERROR, details: details, fatal: fatal, url: loader.url, loader: loader, context : context, networkDetails: networkDetails});\n }\n}\n\nexport default PlaylistLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/loader/playlist-loader.js","/**\n * Generate MP4 Box\n*/\n\n//import Hex from '../utils/hex';\n\nconst UINT32_MAX = Math.pow(2, 32) - 1;\n\nclass MP4 {\n static 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 '.mp3': [],\n mvex: [],\n mvhd: [],\n pasp: [],\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] = [\n i.charCodeAt(0),\n i.charCodeAt(1),\n i.charCodeAt(2),\n i.charCodeAt(3)\n ];\n }\n }\n\n var videoHdlr = new Uint8Array([\n 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,\n 0x6f, 0x48, 0x61, 0x6e,\n 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n\n var audioHdlr = new Uint8Array([\n 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,\n 0x64, 0x48, 0x61, 0x6e,\n 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([\n 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([\n 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([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00, // sample_count\n ]);\n MP4.VMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00,\n 0x00, 0x00,\n 0x00, 0x00 // opcolor\n ]);\n MP4.SMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance\n 0x00, 0x00 // reserved\n ]);\n\n MP4.STSD = new Uint8Array([\n 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 static box(type) {\n var\n 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 static hdlr(type) {\n return MP4.box(MP4.types.hdlr, MP4.HDLR_TYPES[type]);\n }\n\n static mdat(data) {\n return MP4.box(MP4.types.mdat, data);\n }\n\n static mdhd(timescale, duration) {\n duration *= timescale;\n const upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n const lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.mdhd, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n (timescale >> 24) & 0xFF,\n (timescale >> 16) & 0xFF,\n (timescale >> 8) & 0xFF,\n timescale & 0xFF, // timescale\n (upperWordDuration >> 24),\n (upperWordDuration >> 16) & 0xFF,\n (upperWordDuration >> 8) & 0xFF,\n upperWordDuration & 0xFF,\n (lowerWordDuration >> 24),\n (lowerWordDuration >> 16) & 0xFF,\n (lowerWordDuration >> 8) & 0xFF,\n lowerWordDuration & 0xFF,\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00\n ]));\n }\n\n static 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 static mfhd(sequenceNumber) {\n return MP4.box(MP4.types.mfhd, new Uint8Array([\n 0x00,\n 0x00, 0x00, 0x00, // flags\n (sequenceNumber >> 24),\n (sequenceNumber >> 16) & 0xFF,\n (sequenceNumber >> 8) & 0xFF,\n sequenceNumber & 0xFF, // sequence_number\n ]));\n }\n\n static 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 static 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 static moov(tracks) {\n var\n 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 static mvex(tracks) {\n var\n 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 static mvhd(timescale,duration) {\n duration*=timescale;\n const upperWordDuration = Math.floor(duration / (UINT32_MAX + 1));\n const lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n var\n bytes = new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n (timescale >> 24) & 0xFF,\n (timescale >> 16) & 0xFF,\n (timescale >> 8) & 0xFF,\n timescale & 0xFF, // timescale\n (upperWordDuration >> 24),\n (upperWordDuration >> 16) & 0xFF,\n (upperWordDuration >> 8) & 0xFF,\n upperWordDuration & 0xFF,\n (lowerWordDuration >> 24),\n (lowerWordDuration >> 16) & 0xFF,\n (lowerWordDuration >> 8) & 0xFF,\n lowerWordDuration & 0xFF,\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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 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 static sdtp(track) {\n var\n 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) |\n (flags.isDependedOn << 2) |\n (flags.hasRedundancy);\n }\n\n return MP4.box(MP4.types.sdtp, bytes);\n }\n\n static 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 static avc1(track) {\n var sps = [], pps = [], i, data, 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([\n 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([\n track.pps.length // numOfPictureParameterSets\n ]).concat(pps))), // \"PPS\"\n width = track.width,\n height = track.height,\n hSpacing = track.pixelRatio[0],\n vSpacing = track.pixelRatio[1];\n //console.log('avcc:' + Hex.hexDump(avcc));\n return MP4.box(MP4.types.avc1, new Uint8Array([\n 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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n (width >> 8) & 0xFF,\n width & 0xff, // width\n (height >> 8) & 0xFF,\n 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,\n 0x64, 0x61, 0x69, 0x6C, //dailymotion/hls.js\n 0x79, 0x6D, 0x6F, 0x74,\n 0x69, 0x6F, 0x6E, 0x2F,\n 0x68, 0x6C, 0x73, 0x2E,\n 0x6A, 0x73, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11]), // pre_defined = -1\n avcc,\n MP4.box(MP4.types.btrt, new Uint8Array([\n 0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0])), // avgBitrate\n MP4.box(MP4.types.pasp, new Uint8Array([\n (hSpacing >> 24), // hSpacing\n (hSpacing >> 16) & 0xFF,\n (hSpacing >> 8) & 0xFF,\n hSpacing & 0xFF,\n (vSpacing >> 24), // vSpacing\n (vSpacing >> 16) & 0xFF,\n (vSpacing >> 8) & 0xFF,\n vSpacing & 0xFF]))\n );\n }\n\n static esds(track) {\n var configlen = track.config.length;\n return new Uint8Array([\n 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 static mp4a(track) {\n var samplerate = track.samplerate;\n return MP4.box(MP4.types.mp4a, new Uint8Array([\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n (samplerate >> 8) & 0xFF,\n samplerate & 0xff, //\n 0x00, 0x00]),\n MP4.box(MP4.types.esds, MP4.esds(track)));\n }\n\n static mp3(track) {\n var samplerate = track.samplerate;\n return MP4.box(MP4.types['.mp3'], new Uint8Array([\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, track.channelCount, // channelcount\n 0x00, 0x10, // sampleSize:16bits\n 0x00, 0x00, 0x00, 0x00, // reserved2\n (samplerate >> 8) & 0xFF,\n samplerate & 0xff, //\n 0x00, 0x00]));\n }\n\n static stsd(track) {\n if (track.type === 'audio') {\n if (!track.isAAC && track.codec === 'mp3') {\n return MP4.box(MP4.types.stsd, MP4.STSD, MP4.mp3(track));\n }\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 static tkhd(track) {\n var id = track.id,\n duration = track.duration*track.timescale,\n width = track.width,\n height = track.height,\n upperWordDuration = Math.floor(duration / (UINT32_MAX + 1)),\n lowerWordDuration = Math.floor(duration % (UINT32_MAX + 1));\n return MP4.box(MP4.types.tkhd, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // modification_time\n (id >> 24) & 0xFF,\n (id >> 16) & 0xFF,\n (id >> 8) & 0xFF,\n id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n (upperWordDuration >> 24),\n (upperWordDuration >> 16) & 0xFF,\n (upperWordDuration >> 8) & 0xFF,\n upperWordDuration & 0xFF,\n (lowerWordDuration >> 24),\n (lowerWordDuration >> 16) & 0xFF,\n (lowerWordDuration >> 8) & 0xFF,\n lowerWordDuration & 0xFF,\n 0x00, 0x00, 0x00, 0x00,\n 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,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n (width >> 8) & 0xFF,\n width & 0xFF,\n 0x00, 0x00, // width\n (height >> 8) & 0xFF,\n height & 0xFF,\n 0x00, 0x00 // height\n ]));\n }\n\n static traf(track,baseMediaDecodeTime) {\n var sampleDependencyTable = MP4.sdtp(track),\n id = track.id,\n upperWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime / (UINT32_MAX + 1)),\n lowerWordBaseMediaDecodeTime = Math.floor(baseMediaDecodeTime % (UINT32_MAX + 1));\n return MP4.box(MP4.types.traf,\n MP4.box(MP4.types.tfhd, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (id >> 24),\n (id >> 16) & 0XFF,\n (id >> 8) & 0XFF,\n (id & 0xFF) // track_ID\n ])),\n MP4.box(MP4.types.tfdt, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n (upperWordBaseMediaDecodeTime >>24),\n (upperWordBaseMediaDecodeTime >> 16) & 0XFF,\n (upperWordBaseMediaDecodeTime >> 8) & 0XFF,\n (upperWordBaseMediaDecodeTime & 0xFF),\n (lowerWordBaseMediaDecodeTime >>24),\n (lowerWordBaseMediaDecodeTime >> 16) & 0XFF,\n (lowerWordBaseMediaDecodeTime >> 8) & 0XFF,\n (lowerWordBaseMediaDecodeTime & 0xFF)\n ])),\n MP4.trun(track,\n sampleDependencyTable.length +\n 16 + // tfhd\n 20 + // 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 static trak(track) {\n track.duration = track.duration || 0xffffffff;\n return MP4.box(MP4.types.trak, MP4.tkhd(track), MP4.mdia(track));\n }\n\n static trex(track) {\n var id = track.id;\n return MP4.box(MP4.types.trex, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (id >> 24),\n (id >> 16) & 0XFF,\n (id >> 8) & 0XFF,\n (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 static trun(track, offset) {\n var samples= track.samples || [],\n len = samples.length,\n arraylen = 12 + (16 * len),\n array = new Uint8Array(arraylen),\n i,sample,duration,size,flags,cts;\n offset += 8 + arraylen;\n array.set([\n 0x00, // version 0\n 0x00, 0x0f, 0x01, // flags\n (len >>> 24) & 0xFF,\n (len >>> 16) & 0xFF,\n (len >>> 8) & 0xFF,\n len & 0xFF, // sample_count\n (offset >>> 24) & 0xFF,\n (offset >>> 16) & 0xFF,\n (offset >>> 8) & 0xFF,\n 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([\n (duration >>> 24) & 0xFF,\n (duration >>> 16) & 0xFF,\n (duration >>> 8) & 0xFF,\n duration & 0xFF, // sample_duration\n (size >>> 24) & 0xFF,\n (size >>> 16) & 0xFF,\n (size >>> 8) & 0xFF,\n size & 0xFF, // sample_size\n (flags.isLeading << 2) | flags.dependsOn,\n (flags.isDependedOn << 6) |\n (flags.hasRedundancy << 4) |\n (flags.paddingValue << 1) |\n flags.isNonSync,\n flags.degradPrio & 0xF0 << 8,\n flags.degradPrio & 0x0F, // sample_flags\n (cts >>> 24) & 0xFF,\n (cts >>> 16) & 0xFF,\n (cts >>> 8) & 0xFF,\n cts & 0xFF // sample_composition_time_offset\n ],12+16*i);\n }\n return MP4.box(MP4.types.trun, array);\n }\n\n static initSegment(tracks) {\n if (!MP4.types) {\n MP4.init();\n }\n var movie = MP4.moov(tracks), 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\nexport default MP4;\n\n\n\n// WEBPACK FOOTER //\n// src/remux/mp4-generator.js"," /**\n * fMP4 remuxer\n*/\n\n\nimport AAC from '../helper/aac';\nimport Event from '../events';\nimport {logger} from '../utils/logger';\nimport MP4 from '../remux/mp4-generator';\nimport {ErrorTypes, ErrorDetails} from '../errors';\n\n// 10 seconds\nconst MAX_SILENT_FRAME_DURATION = 10 * 1000;\n\nclass MP4Remuxer {\n constructor(observer, config, typeSupported, vendor) {\n this.observer = observer;\n this.config = config;\n this.typeSupported = typeSupported;\n const userAgent = navigator.userAgent;\n this.isSafari = vendor && vendor.indexOf('Apple') > -1 && userAgent && !userAgent.match('CriOS');\n this.ISGenerated = false;\n }\n\n destroy() {\n }\n\n resetTimeStamp(defaultTimeStamp) {\n this._initPTS = this._initDTS = defaultTimeStamp;\n }\n\n resetInitSegment() {\n this.ISGenerated = false;\n }\n\n remux(audioTrack,videoTrack,id3Track,textTrack,timeOffset, contiguous,accurateTimeOffset) {\n // generate Init Segment if needed\n if (!this.ISGenerated) {\n this.generateIS(audioTrack,videoTrack,timeOffset);\n } else {\n if (accurateTimeOffset) {\n // check timestamp consistency. it there is more than 10s gap between expected PTS/DTS, recompute initPTS/DTS\n const refPTS = this._initPTS;\n const ptsNormalize = this._PTSNormalize;\n const timeScale = audioTrack.inputTimeScale || videoTrack.inputTimeScale;\n let initPTS = Infinity, initDTS = Infinity;\n let samples = audioTrack.samples;\n if (samples.length) {\n initPTS = initDTS = ptsNormalize(samples[0].pts - timeScale * timeOffset, refPTS);\n }\n samples = videoTrack.samples;\n if (samples.length) {\n let sample = samples[0];\n initPTS = Math.min(initPTS,ptsNormalize(sample.pts - timeScale * timeOffset, refPTS));\n initDTS = Math.min(initDTS,ptsNormalize(sample.dts - timeScale * timeOffset, refPTS));\n }\n if (initPTS !== Infinity) {\n const initPTSDelta = refPTS - initPTS;\n if (Math.abs(initPTSDelta) > 10 * timeScale) {\n logger.warn(`timestamp inconsistency, ${(initPTSDelta/timeScale).toFixed(3)}s delta against expected value: missing discontinuity ? reset initPTS/initDTS`);\n this._initPTS = initPTS;\n this._initDTS = initDTS;\n this.observer.trigger(Event.INIT_PTS_FOUND, { initPTS: initPTS});\n }\n }\n }\n }\n\n if (this.ISGenerated) {\n // Purposefully remuxing audio before video, so that remuxVideo can use nextAudioPts, which is\n // calculated in remuxAudio.\n //logger.log('nb AAC samples:' + audioTrack.samples.length);\n if (audioTrack.samples.length) {\n // if initSegment was generated without video samples, regenerate it again\n if (!audioTrack.timescale) {\n logger.warn('regenerate InitSegment as audio detected');\n this.generateIS(audioTrack,videoTrack,timeOffset);\n }\n let audioData = this.remuxAudio(audioTrack,timeOffset,contiguous,accurateTimeOffset);\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n let audioTrackLength;\n if (audioData) {\n audioTrackLength = audioData.endPTS - audioData.startPTS;\n }\n // if initSegment was generated without video samples, regenerate it again\n if (!videoTrack.timescale) {\n logger.warn('regenerate InitSegment as video detected');\n this.generateIS(audioTrack,videoTrack,timeOffset);\n }\n this.remuxVideo(videoTrack,timeOffset,contiguous,audioTrackLength, accurateTimeOffset);\n }\n } else {\n let videoData;\n //logger.log('nb AVC samples:' + videoTrack.samples.length);\n if (videoTrack.samples.length) {\n videoData = this.remuxVideo(videoTrack,timeOffset,contiguous, accurateTimeOffset);\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(Event.FRAG_PARSED);\n }\n\n generateIS(audioTrack,videoTrack,timeOffset) {\n var observer = this.observer,\n audioSamples = audioTrack.samples,\n videoSamples = videoTrack.samples,\n typeSupported = this.typeSupported,\n container = 'audio/mp4',\n tracks = {},\n data = { tracks : tracks },\n computePTSDTS = (this._initPTS === undefined),\n initPTS, initDTS;\n\n if (computePTSDTS) {\n initPTS = initDTS = Infinity;\n }\n if (audioTrack.config && audioSamples.length) {\n // let's use audio sampling rate as MP4 time scale.\n // rationale is that there is a integer nb of audio frames per audio sample (1024 for AAC)\n // using audio sampling rate here helps having an integer MP4 frame duration\n // this avoids potential rounding issue and AV sync issue\n audioTrack.timescale = audioTrack.samplerate;\n logger.log (`audio sampling rate : ${audioTrack.samplerate}`);\n if (!audioTrack.isAAC) {\n if (typeSupported.mpeg) { // Chrome and Safari\n container = 'audio/mpeg';\n audioTrack.codec = '';\n } else if (typeSupported.mp3) { // Firefox\n audioTrack.codec = 'mp3';\n }\n }\n tracks.audio = {\n container : container,\n codec : audioTrack.codec,\n initSegment : !audioTrack.isAAC && typeSupported.mpeg ? new Uint8Array() : MP4.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 - audioTrack.inputTimeScale * timeOffset;\n }\n }\n\n if (videoTrack.sps && videoTrack.pps && videoSamples.length) {\n // let's use input time scale as MP4 video timescale\n // we use input time scale straight away to avoid rounding issues on frame duration / cts computation\n const inputTimeScale = videoTrack.inputTimeScale;\n videoTrack.timescale = inputTimeScale;\n tracks.video = {\n container : 'video/mp4',\n codec : videoTrack.codec,\n initSegment : MP4.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 - inputTimeScale * timeOffset);\n initDTS = Math.min(initDTS,videoSamples[0].dts - inputTimeScale * timeOffset);\n this.observer.trigger(Event.INIT_PTS_FOUND, { initPTS: initPTS});\n }\n }\n\n if(Object.keys(tracks).length) {\n observer.trigger(Event.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(Event.ERROR, {type : ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, fatal: false, reason: 'no audio/video samples found'});\n }\n }\n\n remuxVideo(track, timeOffset, contiguous, audioTrackLength, accurateTimeOffset) {\n var offset = 8,\n timeScale = track.timescale,\n mp4SampleDuration,\n mdat, moof,\n firstPTS, firstDTS,\n nextDTS,\n lastPTS, lastDTS,\n inputSamples = track.samples,\n outputSamples = [],\n nbSamples = inputSamples.length,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS;\n\n // for (let i = 0; i < track.samples.length; i++) {\n // let avcSample = track.samples[i];\n // let units = avcSample.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 // if parsed fragment is contiguous with last one, let's use last DTS value as reference\n let nextAvcDts = this.nextAvcDts;\n\n const isSafari = this.isSafari;\n\n // Safari does not like overlapping DTS on consecutive fragments. let's use nextAvcDts to overcome this if fragments are consecutive\n if (isSafari) {\n // also consider consecutive fragments as being contiguous (even if a level switch occurs),\n // for sake of clarity:\n // consecutive fragments are frags with\n // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR\n // - less than 200 ms PTS gaps (timeScale/5)\n contiguous |= (inputSamples.length && nextAvcDts &&\n ((accurateTimeOffset && Math.abs(timeOffset-nextAvcDts/timeScale) < 0.1) ||\n Math.abs((inputSamples[0].pts-nextAvcDts-initDTS)) < timeScale/5)\n );\n }\n\n if (!contiguous) {\n // if not contiguous, let's use target timeOffset\n nextAvcDts = timeOffset*timeScale;\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 inputSamples.forEach(function(sample) {\n sample.pts = ptsNormalize(sample.pts-initDTS, nextAvcDts);\n sample.dts = ptsNormalize(sample.dts-initDTS, nextAvcDts);\n });\n\n // sort video samples by DTS then PTS then demux id order\n inputSamples.sort(function(a, b) {\n const deltadts = a.dts - b.dts;\n const deltapts = a.pts - b.pts;\n return deltadts ? deltadts : deltapts ? deltapts : (a.id - b.id);\n });\n\n // handle broken streams with PTS < DTS, tolerance up 200ms (18000 in 90kHz timescale)\n let PTSDTSshift = inputSamples.reduce( (prev, curr) => Math.max(Math.min(prev,curr.pts-curr.dts),-18000),0);\n if (PTSDTSshift < 0) {\n logger.warn(`PTS < DTS detected in video samples, shifting DTS by ${Math.round(PTSDTSshift/90)} ms to overcome this issue`);\n for (let i = 0; i < inputSamples.length; i++) {\n inputSamples[i].dts += PTSDTSshift;\n }\n }\n\n // compute first DTS and last DTS, normalize them against reference value\n let sample = inputSamples[0];\n firstDTS = Math.max(sample.dts,0);\n firstPTS = Math.max(sample.pts,0);\n\n // check timestamp continuity accross consecutive fragments (this is to remove inter-fragment gap/hole)\n let 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.log(`AVC:${delta} ms hole between fragments detected,filling it`);\n } else if (delta < -1) {\n 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;\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;\n 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(sample.dts,0);\n lastPTS = Math.max(sample.pts,0,lastDTS);\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)/(inputSamples.length-1));\n }\n\n let nbNalu = 0, naluLen = 0;\n for (let i = 0 ; i < nbSamples; i++) {\n // compute total/avc sample length and nb of NAL units\n let sample = inputSamples[i], units = sample.units, nbUnits = units.length, sampleLen = 0;\n for (let j = 0; j < nbUnits; j++) {\n sampleLen += units[j].data.length;\n }\n naluLen += sampleLen;\n nbNalu += nbUnits;\n sample.length = sampleLen;\n\n // normalize PTS/DTS\n if (isSafari) {\n // sample DTS is computed using a constant decoding offset (mp4SampleDuration) between samples\n sample.dts = firstDTS + i*mp4SampleDuration;\n } else {\n // ensure sample monotonic DTS\n sample.dts = Math.max(sample.dts,firstDTS);\n }\n // ensure that computed value is greater or equal than sample DTS\n sample.pts = Math.max(sample.pts , sample.dts);\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 let mdatSize = naluLen + (4 * nbNalu) + 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch(err) {\n this.observer.trigger(Event.ERROR, {type : ErrorTypes.MUX_ERROR, details: ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes : mdatSize, reason: `fail allocating video mdat ${mdatSize}`});\n return;\n }\n let view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(MP4.types.mdat, 4);\n\n for (let i = 0 ; i < nbSamples; i++) {\n let avcSample = inputSamples[i],\n avcSampleUnits = avcSample.units,\n mp4SampleLength = 0,\n compositionTimeOffset;\n // convert NALU bitstream to MP4 format (prepend NALU with size field)\n for(let j = 0, nbUnits = avcSampleUnits.length; j < nbUnits ; j++) {\n let unit = avcSampleUnits[j],\n unitData = unit.data,\n unitDataLen = unit.data.byteLength;\n view.setUint32(offset, unitDataLen);\n offset += 4;\n mdat.set(unitData, offset);\n offset += unitDataLen;\n mp4SampleLength += 4 + unitDataLen;\n }\n\n if(!isSafari) {\n // expected sample duration is the Decoding Timestamp diff of consecutive samples\n if (i < nbSamples - 1) {\n mp4SampleDuration = inputSamples[i+1].dts - avcSample.dts;\n } else {\n let config = this.config,\n lastFrameDuration = avcSample.dts - inputSamples[i > 0 ? i-1 : i].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 let maxBufferHole = config.maxBufferHole,\n maxSeekHole = config.maxSeekHole,\n gapTolerance = Math.floor(Math.min(maxBufferHole, maxSeekHole) * timeScale),\n deltaToFrameEnd = (audioTrackLength ? firstPTS + audioTrackLength * timeScale : this.nextAudioPts) - 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.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 compositionTimeOffset = Math.round(avcSample.pts - avcSample.dts);\n } else {\n compositionTimeOffset = Math.max(0,mp4SampleDuration*Math.round((avcSample.pts - avcSample.dts)/mp4SampleDuration));\n }\n\n\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${avcSample.pts}/${avcSample.dts}/${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;\n let 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 let 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 = MP4.moof(track.sequenceNumber++, firstDTS , track);\n track.samples = [];\n\n let data = {\n data1: moof,\n data2: mdat,\n startPTS: firstPTS / timeScale,\n endPTS: (lastPTS + mp4SampleDuration) / timeScale,\n startDTS: firstDTS / timeScale,\n endDTS: this.nextAvcDts / timeScale,\n type: 'video',\n nb: outputSamples.length,\n dropped : dropped\n };\n this.observer.trigger(Event.FRAG_PARSING_DATA, data);\n return data;\n }\n\n remuxAudio(track, timeOffset, contiguous,accurateTimeOffset) {\n const inputTimeScale = track.inputTimeScale,\n mp4timeScale = track.timescale,\n scaleFactor = inputTimeScale/mp4timeScale,\n mp4SampleDuration = track.isAAC ? 1024 : 1152,\n inputSampleDuration = mp4SampleDuration * scaleFactor,\n ptsNormalize = this._PTSNormalize,\n initDTS = this._initDTS,\n rawMPEG = !track.isAAC && this.typeSupported.mpeg;\n\n var offset,\n mp4Sample,\n fillFrame,\n mdat, moof,\n firstPTS, lastPTS,\n inputSamples = track.samples,\n outputSamples = [],\n nextAudioPts = this.nextAudioPts;\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\n // - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR\n // - less than 20 audio frames distance\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 contiguous |= (inputSamples.length && nextAudioPts &&\n ((accurateTimeOffset && Math.abs(timeOffset-nextAudioPts/inputTimeScale) < 0.1) ||\n Math.abs((inputSamples[0].pts-nextAudioPts-initDTS)) < 20*inputSampleDuration)\n );\n\n if (!contiguous) {\n // if fragments are not contiguous, let's use timeOffset to compute next Audio PTS\n nextAudioPts = timeOffset*inputTimeScale;\n }\n\n // compute normalized PTS\n inputSamples.forEach(function(sample) {\n sample.pts = sample.dts = ptsNormalize(sample.pts - initDTS, nextAudioPts);\n });\n\n // sort based on normalized PTS (this is to avoid sorting issues in case timestamp\n // reloop in the middle of our samples array)\n inputSamples.sort(function(a, b) {\n return a.pts - b.pts;\n });\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\n // only inject/drop audio frames in case time offset is accurate\n if (accurateTimeOffset && track.isAAC) {\n for (let i = 0, nextPts = nextAudioPts; i < inputSamples.length; ) {\n // First, let's see how far off this frame is from where we expect it to be\n var sample = inputSamples[i], delta;\n let pts = sample.pts;\n delta = pts - nextPts;\n\n const duration = Math.abs(1000*delta/inputTimeScale);\n\n // If we're overlapping by more than a duration, drop this sample\n if (delta <= -inputSampleDuration) {\n logger.warn(`Dropping 1 audio frame @ ${(nextPts/inputTimeScale).toFixed(3)}s due to ${duration} ms overlap.`);\n inputSamples.splice(i, 1);\n track.len -= sample.unit.length;\n // Don't touch nextPtsNorm or i\n }\n\n // Insert missing frames if:\n // 1: We're more than one frame away\n // 2: Not more than MAX_SILENT_FRAME_DURATION away\n // 3: currentTime (aka nextPtsNorm) is not 0\n else if (delta >= inputSampleDuration && duration < MAX_SILENT_FRAME_DURATION && nextPts) {\n var missing = Math.round(delta / inputSampleDuration);\n logger.warn(`Injecting ${missing} audio frame @ ${(nextPts/inputTimeScale).toFixed(3)}s due to ${Math.round(1000*delta/inputTimeScale)} ms gap.`);\n for (var j = 0; j < missing; j++) {\n let newStamp = Math.max(nextPts,0);\n fillFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n if (!fillFrame) {\n logger.log('Unable to get silent frame for given audio codec; duplicating last frame instead.');\n fillFrame = sample.unit.subarray();\n }\n inputSamples.splice(i, 0, {unit: fillFrame, pts: newStamp, dts: newStamp});\n track.len += fillFrame.length;\n nextPts += inputSampleDuration;\n i++;\n }\n\n // Adjust sample to next expected pts\n sample.pts = sample.dts = nextPts;\n nextPts += inputSampleDuration;\n i++;\n } else {\n // Otherwise, just adjust pts\n if (Math.abs(delta) > (0.1 * inputSampleDuration)) {\n //logger.log(`Invalid frame delta ${Math.round(delta + inputSampleDuration)} at PTS ${Math.round(pts / 90)} (should be ${Math.round(inputSampleDuration)}).`);\n }\n sample.pts = sample.dts = nextPts;\n nextPts += inputSampleDuration;\n i++;\n }\n }\n }\n\n\n for (let j =0 , nbSamples = inputSamples.length; j < nbSamples ; j++) {\n let audioSample = inputSamples[j];\n let unit = audioSample.unit;\n let pts = audioSample.pts;\n //logger.log(`Audio/PTS:${Math.round(pts/90)}`);\n // if not first sample\n if (lastPTS !== undefined) {\n mp4Sample.duration = Math.round((pts - lastPTS) / scaleFactor);\n } else {\n let delta = Math.round(1000 * (pts - nextAudioPts) / inputTimeScale),\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 && track.isAAC) {\n // log delta\n if (delta) {\n if (delta > 0 && delta < MAX_SILENT_FRAME_DURATION) {\n numMissingFrames = Math.round((pts - nextAudioPts) / inputSampleDuration);\n logger.log(`${delta} ms hole between AAC samples detected,filling it`);\n if (numMissingFrames > 0) {\n fillFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n if (!fillFrame) {\n fillFrame = unit.subarray();\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.log(`drop overlapping AAC sample, expected/parsed/delta:${(nextAudioPts/inputTimeScale).toFixed(3)}s/${(pts/inputTimeScale).toFixed(3)}s/${(-delta)}ms`);\n track.len -= unit.byteLength;\n continue;\n }\n // set PTS/DTS to expected PTS/DTS\n pts = nextAudioPts;\n }\n }\n // remember first PTS of our audioSamples, ensure value is positive\n firstPTS = Math.max(0, pts);\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 let mdatSize = rawMPEG ? track.len : track.len + 8;\n offset = rawMPEG ? 0 : 8;\n try {\n mdat = new Uint8Array(mdatSize);\n } catch(err) {\n this.observer.trigger(Event.ERROR, {type : ErrorTypes.MUX_ERROR, details: ErrorDetails.REMUX_ALLOC_ERROR, fatal: false, bytes : mdatSize, reason: `fail allocating audio mdat ${mdatSize}`});\n return;\n }\n if (!rawMPEG) {\n const view = new DataView(mdat.buffer);\n view.setUint32(0, mdatSize);\n mdat.set(MP4.types.mdat, 4);\n }\n } else {\n // no audio samples\n return;\n }\n for (let i = 0; i < numMissingFrames; i++) {\n fillFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n if (!fillFrame) {\n logger.log('Unable to get silent frame for given audio codec; duplicating this frame instead.');\n fillFrame = unit.subarray();\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 outputSamples.push(mp4Sample);\n }\n }\n mdat.set(unit, offset);\n let unitLen = unit.byteLength;\n offset += unitLen;\n //console.log('PTS/DTS/initDTS/normPTS/normDTS/relative PTS : ${audioSample.pts}/${audioSample.dts}/${initDTS}/${ptsnorm}/${dtsnorm}/${(audioSample.pts/4294967296).toFixed(3)}');\n mp4Sample = {\n size: unitLen,\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 outputSamples.push(mp4Sample);\n lastPTS = pts;\n }\n var lastSampleDuration = 0;\n var nbSamples = outputSamples.length;\n //set last sample duration as being identical to previous sample\n if (nbSamples >= 2) {\n lastSampleDuration = outputSamples[nbSamples - 2].duration;\n mp4Sample.duration = lastSampleDuration;\n }\n if (nbSamples) {\n // next audio sample PTS should be equal to last sample PTS + duration\n this.nextAudioPts = nextAudioPts = lastPTS + scaleFactor * lastSampleDuration;\n //logger.log('Audio/PTS/PTSend:' + audioSample.pts.toFixed(0) + '/' + this.nextAacDts.toFixed(0));\n track.len = 0;\n track.samples = outputSamples;\n if (rawMPEG) {\n moof = new Uint8Array();\n } else {\n moof = MP4.moof(track.sequenceNumber++, firstPTS / scaleFactor, track);\n }\n track.samples = [];\n const start = firstPTS / inputTimeScale;\n const end = nextAudioPts / inputTimeScale;\n const audioData = {\n data1: moof,\n data2: mdat,\n startPTS: start,\n endPTS: end,\n startDTS: start,\n endDTS: end,\n type: 'audio',\n nb: nbSamples\n };\n this.observer.trigger(Event.FRAG_PARSING_DATA, audioData);\n return audioData;\n }\n return null;\n }\n\n remuxEmptyAudio(track, timeOffset, contiguous, videoData) {\n let inputTimeScale = track.inputTimeScale,\n mp4timeScale = track.samplerate ? track.samplerate : inputTimeScale,\n scaleFactor = inputTimeScale/mp4timeScale,\n nextAudioPts = this.nextAudioPts,\n\n // sync with video's timestamp\n startDTS = (nextAudioPts !== undefined ? nextAudioPts : videoData.startDTS * inputTimeScale) + this._initDTS,\n endDTS = videoData.endDTS * inputTimeScale + this._initDTS,\n // one sample's duration value\n sampleDuration = 1024,\n frameDuration = scaleFactor * sampleDuration,\n\n // samples count of this segment's duration\n nbSamples = Math.ceil((endDTS - startDTS) / frameDuration),\n\n // silent frame\n silentFrame = AAC.getSilentFrame(track.manifestCodec || track.codec,track.channelCount);\n\n logger.warn('remux empty Audio');\n // Can't remux if we can't generate a silent frame...\n if (!silentFrame) {\n logger.trace('Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!');\n return;\n }\n\n let samples = [];\n for(var i = 0; i < nbSamples; i++) {\n var stamp = startDTS + i * frameDuration;\n samples.push({unit: silentFrame, pts: stamp, dts: stamp});\n track.len += silentFrame.length;\n }\n track.samples = samples;\n\n this.remuxAudio(track, timeOffset, contiguous);\n }\n\n remuxID3(track,timeOffset) {\n var length = track.samples.length, sample;\n const inputTimeScale = track.inputTimeScale;\n const initPTS = this._initPTS;\n const initDTS = this._initDTS;\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 - initPTS) / inputTimeScale);\n sample.dts = ((sample.dts - initDTS) / inputTimeScale);\n }\n this.observer.trigger(Event.FRAG_PARSING_METADATA, {\n samples:track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n\n remuxText(track,timeOffset) {\n track.samples.sort(function(a, b) {\n return (a.pts-b.pts);\n });\n\n var length = track.samples.length, sample;\n const inputTimeScale = track.inputTimeScale;\n const initPTS = this._initPTS;\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 - initPTS) / inputTimeScale);\n }\n this.observer.trigger(Event.FRAG_PARSING_USERDATA, {\n samples:track.samples\n });\n }\n\n track.samples = [];\n timeOffset = timeOffset;\n }\n\n _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}\n\nexport default MP4Remuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/remux/mp4-remuxer.js","/**\n * passthrough remuxer\n*/\nimport Event from '../events';\n\nclass PassThroughRemuxer {\n constructor(observer) {\n this.observer = observer;\n }\n\n destroy() {\n }\n\n resetTimeStamp() {\n }\n\n resetInitSegment() {\n }\n\n remux(audioTrack,videoTrack,id3Track,textTrack,timeOffset, contiguous,accurateTimeOffset,rawData) {\n var observer = this.observer;\n var streamType = '';\n if (audioTrack) {\n streamType += 'audio';\n }\n if (videoTrack) {\n streamType += 'video';\n }\n observer.trigger(Event.FRAG_PARSING_DATA, {\n data1: rawData,\n startPTS: timeOffset,\n startDTS: timeOffset,\n type: streamType,\n nb: 1,\n dropped : 0\n });\n //notify end of parsing\n observer.trigger(Event.FRAG_PARSED);\n }\n}\n\nexport default PassThroughRemuxer;\n\n\n\n// WEBPACK FOOTER //\n// src/remux/passthrough-remuxer.js","const DECIMAL_RESOLUTION_REGEX = /^(\\d+)x(\\d+)$/;\nconst ATTR_LIST_REGEX = /\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g;\n\n// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js\nclass AttrList {\n\n constructor(attrs) {\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 decimalInteger(attrName) {\n const intValue = parseInt(this[attrName], 10);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n\n hexadecimalInteger(attrName) {\n if(this[attrName]) {\n let stringValue = (this[attrName] || '0x').slice(2);\n stringValue = ((stringValue.length & 1) ? '0' : '') + stringValue;\n\n const value = new Uint8Array(stringValue.length / 2);\n for (let 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 hexadecimalIntegerAsNumber(attrName) {\n const intValue = parseInt(this[attrName], 16);\n if (intValue > Number.MAX_SAFE_INTEGER) {\n return Infinity;\n }\n return intValue;\n }\n\n decimalFloatingPoint(attrName) {\n return parseFloat(this[attrName]);\n }\n\n enumeratedString(attrName) {\n return this[attrName];\n }\n\n decimalResolution(attrName) {\n const res = DECIMAL_RESOLUTION_REGEX.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 static parseAttrList(input) {\n var match, attrs = {};\n ATTR_LIST_REGEX.lastIndex = 0;\n while ((match = ATTR_LIST_REGEX.exec(input)) !== null) {\n var value = match[2], quote = '\"';\n\n if (value.indexOf(quote) === 0 &&\n 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\nexport default AttrList;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/attr-list.js","var 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(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 }\n else if (comparisonResult < 0) {\n maxIndex = currentIndex - 1;\n }\n else {\n return currentElement;\n }\n }\n \n return null;\n }\n};\n\nmodule.exports = BinarySearch;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/binary-search.js","/**\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(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 = 100;\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(newTime) {\n this.time = newTime;\n },\n log : function(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(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\nclass PenState {\n\n constructor(foreground, underline, italics, background, flash) {\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 reset() {\n this.foreground = 'white';\n this.underline = false;\n this.italics = false;\n this.background = 'black';\n this.flash = false;\n }\n\n 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 isDefault() {\n return (this.foreground === 'white' && !this.underline && !this.italics &&\n this.background === 'black' && !this.flash);\n }\n\n equals(other) {\n return ( (this.foreground === other.foreground) &&\n (this.underline === other.underline) &&\n (this.italics === other.italics) &&\n (this.background === other.background) &&\n (this.flash === other.flash) );\n }\n\n 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 toString() {\n return ('color=' + this.foreground + ', underline=' + this.underline + ', italics=' + this.italics +\n ', background=' + this.background + ', flash=' + this.flash);\n }\n}\n\n/**\n * Unicode character with styling and background.\n * @constructor\n */\nclass StyledUnicodeChar\n{\n\n constructor(uchar, foreground, underline, italics, background, flash) {\n this.uchar = uchar || ' '; // unicode character\n this.penState = new PenState(foreground, underline,italics, background, flash);\n }\n\n reset() {\n this.uchar = ' ';\n this.penState.reset();\n }\n\n setChar(uchar, newPenState) {\n this.uchar = uchar;\n this.penState.copy(newPenState);\n }\n\n setPenState(newPenState) {\n this.penState.copy(newPenState);\n }\n\n equals(other) {\n return this.uchar === other.uchar && this.penState.equals(other.penState);\n }\n\n copy(newChar) {\n this.uchar = newChar.uchar;\n this.penState.copy(newChar.penState);\n }\n\n isEmpty() {\n return this.uchar === ' ' && this.penState.isDefault();\n }\n}\n\n/**\n * CEA-608 row consisting of NR_COLS instances of StyledUnicodeChar.\n * @constructor\n */\nclass Row {\n constructor() {\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 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 copy(other) {\n for (var i = 0 ; i < NR_COLS; i ++) {\n this.chars[i].copy(other.chars[i]);\n }\n }\n\n 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 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 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 backSpace() {\n this.moveCursor(-1);\n this.chars[this.pos].setChar(' ', this.currPenState);\n }\n\n insertChar(byte) {\n if (byte >= 0x90) { //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) +\n ' (' + 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 clearFromPos(startPos) {\n var i;\n for (i = startPos ; i < NR_COLS ; i++) {\n this.chars[i].reset();\n }\n }\n\n clear() {\n this.clearFromPos(0);\n this.pos = 0;\n this.currPenState.reset();\n }\n\n clearToEndOfRow() {\n this.clearFromPos(this.pos);\n }\n\n 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 setPenStyles(styles) {\n this.currPenState.setStyles(styles);\n var currChar = this.chars[this.pos];\n currChar.setPenState(this.currPenState);\n }\n}\n\n/**\n * Keep a CEA-608 screen of 32x15 styled characters\n * @constructor\n*/\nclass CaptionScreen {\n\n constructor() {\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 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 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 copy(other) {\n for (var i = 0 ; i < NR_ROWS ; i++) {\n this.rows[i].copy(other.rows[i]);\n }\n }\n\n 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 backSpace() {\n var row = this.rows[this.currRow];\n row.backSpace();\n }\n\n 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 insertChar(char) {\n var row = this.rows[this.currRow];\n row.insertChar(char);\n }\n\n setPen(styles) {\n var row = this.rows[this.currRow];\n row.setPenStyles(styles);\n }\n\n moveCursor(relPos) {\n var row = this.rows[this.currRow];\n row.moveCursor(relPos);\n }\n\n setCursor(absPos) {\n logger.log('INFO', 'setCursor: ' + absPos);\n var row = this.rows[this.currRow];\n row.setCursor(absPos);\n }\n\n 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\n //Make sure this only affects Roll-up Captions by checking this.nrRollUpRows\n if (this.nrRollUpRows && this.currRow !== newRow) {\n //clear all rows first\n for (let i = 0; i < NR_ROWS; i++) {\n this.rows[i].clear();\n }\n\n //Copy this.nrRollUpRows rows from lastOutputScreen and place it in the newRow location\n //topRowIndex - the start of rows to copy (inclusive index)\n var topRowIndex = this.currRow + 1 - (this.nrRollUpRows);\n //We only copy if the last position was already shown.\n //We use the cueStartTime value to check this.\n const lastOutputScreen = this.lastOutputScreen;\n if (lastOutputScreen) {\n var prevLineTime = lastOutputScreen.rows[topRowIndex].cueStartTime;\n if(prevLineTime && prevLineTime < logger.time) {\n for (let i = 0; i < this.nrRollUpRows; i++) {\n this.rows[newRow-this.nrRollUpRows+i+1].copy(lastOutputScreen.rows[topRowIndex+i]);\n }\n }\n }\n }\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 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 setRollUpRows(nrRows) {\n this.nrRollUpRows = nrRows;\n }\n\n 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 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 getTextAndFormat() {\n return this.rows;\n }\n}\n\n//var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];\n\nclass Cea608Channel\n{\n constructor(channelNumber, outputFilter) {\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 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 getHandler() {\n return this.outputFilter;\n }\n\n setHandler(newHandler) {\n this.outputFilter = newHandler;\n }\n\n setPAC(pacData) {\n this.writeScreen.setPAC(pacData);\n }\n\n setBkgData(bkgData) {\n this.writeScreen.setBkgData(bkgData);\n }\n\n 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 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 ccRCL() { // 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 ccBS() { // 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 ccAOF() { // Reserved (formerly Alarm Off)\n return;\n }\n\n ccAON() { // Reserved (formerly Alarm On)\n return;\n }\n\n ccDER() { // 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 ccRU(nrRows) { //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 ccFON() { //Flash On\n logger.log('INFO', 'FON - Flash On');\n this.writeScreen.setPen({flash : true});\n }\n\n ccRDC() { // Resume Direct Captioning (switch mode to PaintOn)\n logger.log('INFO', 'RDC - Resume Direct Captioning');\n this.setMode('MODE_PAINT-ON');\n }\n\n ccTR() { // Text Restart in text mode (not supported, however)\n logger.log('INFO', 'TR');\n this.setMode('MODE_TEXT');\n }\n\n ccRTD() { // Resume Text Display in Text mode (not supported, however)\n logger.log('INFO', 'RTD');\n this.setMode('MODE_TEXT');\n }\n\n ccEDM() { // Erase Displayed Memory\n logger.log('INFO', 'EDM - Erase Displayed Memory');\n this.displayedMemory.reset();\n this.outputDataUpdate();\n }\n\n ccCR() { // Carriage Return\n logger.log('CR - Carriage Return');\n this.writeScreen.rollUp();\n this.outputDataUpdate();\n }\n\n ccENM() { //Erase Non-Displayed Memory\n logger.log('INFO', 'ENM - Erase Non-displayed Memory');\n this.nonDisplayedMemory.reset();\n }\n\n ccEOC() { //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 ccTO(nrCols) { // Tab Offset 1,2, or 3 columns\n logger.log('INFO', 'TO(' + nrCols + ') - Tab Offset');\n this.writeScreen.moveCursor(nrCols);\n }\n\n ccMIDROW(secondByte) { // 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 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()) { // 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 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\nclass Cea608Parser {\n\n constructor(field, out1, out2) {\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 getHandler(index) {\n return this.channels[index].getHandler();\n }\n\n 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 addData(t, byteList) {\n var cmdFound, a, 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]) +\n ' 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 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 { //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 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 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 { // 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 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 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 parseBackgroundAttributes(a, b) {\n var bkgData,\n index,\n chNr,\n 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 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 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\nexport default Cea608Parser;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/cea-608-parser.js","import { fixLineBreaks } from './vttparser';\n\nconst Cues = {\n\n newCue: function(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 {\n row = captionScreen.rows[r];\n indenting = true;\n indent = 0;\n text = '';\n\n if (!row.isEmpty())\n {\n for (var c=0; c<row.chars.length; c++)\n {\n if (row.chars[c].uchar.match(/\\s/) && indenting)\n {\n indent++;\n }\n else\n {\n text += row.chars[c].uchar;\n indenting = false;\n }\n }\n //To be used for cleaning-up orphaned roll-up captions\n row.cueStartTime = startTime;\n\n // Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE\n if (startTime === endTime)\n {\n endTime += 0.0001;\n }\n\n cue = new VTTCue(startTime, endTime, fixLineBreaks(text.trim()));\n\n if (indent >= 16)\n {\n indent--;\n }\n else\n {\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 {\n cue.line = r + 1;\n }\n else\n {\n cue.line = (r > 7 ? r - 2 : r + 1);\n }\n cue.align = 'left';\n // Clamp the position between 0 and 100 - if out of these bounds, Firefox throws an exception and captions break\n cue.position = Math.max(0, Math.min(100, 100 * (indent / 32) + (navigator.userAgent.match(/Firefox\\//) ? 50 : 0)));\n track.addCue(cue);\n }\n }\n }\n\n};\n\nmodule.exports = Cues;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/cues.js","import BinarySearch from './binary-search';\n\nexport function findFragWithCC(fragments, CC) {\n return BinarySearch.search(fragments, (candidate) => {\n if (candidate.cc < CC) {\n return 1;\n } else if (candidate.cc > CC) {\n return -1;\n } else {\n return 0;\n }\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// src/utils/discontinuities.js","/*\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\nimport EWMA from '../utils/ewma';\n\n\nclass EwmaBandWidthEstimator {\n\n constructor(hls,slow,fast,defaultEstimate) {\n this.hls = hls;\n this.defaultEstimate_ = defaultEstimate;\n this.minWeight_ = 0.001;\n this.minDelayMs_ = 50;\n this.slow_ = new EWMA(slow);\n this.fast_ = new EWMA(fast);\n }\n\n sample(durationMs,numBytes) {\n durationMs = Math.max(durationMs, this.minDelayMs_);\n var bandwidth = 8000* numBytes / durationMs,\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 canEstimate() {\n let fast = this.fast_;\n return (fast && fast.getTotalWeight() >= this.minWeight_);\n }\n\n\n 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 destroy() {\n }\n}\nexport default EwmaBandWidthEstimator;\n\n\n\n\n// WEBPACK FOOTER //\n// src/utils/ewma-bandwidth-estimator.js","/*\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\nclass EWMA {\n\n // About half of the estimated value will be from the last |halfLife| samples by weight.\n constructor(halfLife) {\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 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 getTotalWeight() {\n return this.totalWeight_;\n }\n\n 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\nexport default EWMA;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/ewma.js","function noop() {}\n\nconst fakeLogger = {\n trace: noop,\n debug: noop,\n log: noop,\n warn: noop,\n info: noop,\n error: noop\n};\n\nlet 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 const func = self.console[type];\n if (func) {\n return function(...args) {\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, ...functions) {\n functions.forEach(function(type) {\n exportedLogger[type] = debugConfig[type] ? debugConfig[type].bind(debugConfig) : consolePrintFn(type);\n });\n}\n\nexport var enableLogs = function(debugConfig) {\n if (debugConfig === true || typeof debugConfig === 'object') {\n exportLoggerFunctions(debugConfig,\n // Remove out from list here to hard-disable a log-level\n //'trace',\n 'debug',\n 'log',\n 'info',\n 'warn',\n 'error'\n );\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 }\n else {\n exportedLogger = fakeLogger;\n }\n};\n\nexport var logger = exportedLogger;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/logger.js","/**\n * TimeRanges to string helper\n */\n\nconst TimeRanges = {\n toString : function(r) {\n var log = '', 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\nmodule.exports = TimeRanges;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/timeRanges.js","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport default (function() {\n if (typeof window !== 'undefined' && window.VTTCue) {\n return window.VTTCue;\n }\n\n var autoKeyword = 'auto';\n var directionSetting = {\n '': true,\n lr: true,\n rl: true\n };\n var alignSetting = {\n start: true,\n middle: true,\n end: true,\n left: true,\n right: true\n };\n\n function findDirectionSetting(value) {\n if (typeof value !== 'string') {\n return false;\n }\n var dir = directionSetting[value.toLowerCase()];\n return dir ? value.toLowerCase() : false;\n }\n\n function findAlignSetting(value) {\n if (typeof value !== 'string') {\n return false;\n }\n var align = alignSetting[value.toLowerCase()];\n return align ? value.toLowerCase() : false;\n }\n\n function extend(obj) {\n var i = 1;\n for (; i < arguments.length; i++) {\n var cobj = arguments[i];\n for (var p in cobj) {\n obj[p] = cobj[p];\n }\n }\n\n return obj;\n }\n\n function VTTCue(startTime, endTime, text) {\n var cue = this;\n var isIE8 = (function () {\n if (typeof navigator === 'undefined') {\n return;\n }\n return (/MSIE\\s8\\.0/).test(navigator.userAgent);\n })();\n var baseObj = {};\n\n if (isIE8) {\n cue = document.createElement('custom');\n } else {\n baseObj.enumerable = true;\n }\n\n /**\n * Shim implementation specific properties. These properties are not in\n * the spec.\n */\n\n // Lets us know when the VTTCue's data has changed in such a way that we need\n // to recompute its display state. This lets us compute its display state\n // lazily.\n cue.hasBeenReset = false;\n\n /**\n * VTTCue and TextTrackCue properties\n * http://dev.w3.org/html5/webvtt/#vttcue-interface\n */\n\n var _id = '';\n var _pauseOnExit = false;\n var _startTime = startTime;\n var _endTime = endTime;\n var _text = text;\n var _region = null;\n var _vertical = '';\n var _snapToLines = true;\n var _line = 'auto';\n var _lineAlign = 'start';\n var _position = 50;\n var _positionAlign = 'middle';\n var _size = 50;\n var _align = 'middle';\n\n Object.defineProperty(cue, 'id', extend({}, baseObj, {\n get: function () {\n return _id;\n },\n set: function (value) {\n _id = '' + value;\n }\n }));\n\n Object.defineProperty(cue, 'pauseOnExit', extend({}, baseObj, {\n get: function () {\n return _pauseOnExit;\n },\n set: function (value) {\n _pauseOnExit = !!value;\n }\n }));\n\n Object.defineProperty(cue, 'startTime', extend({}, baseObj, {\n get: function () {\n return _startTime;\n },\n set: function (value) {\n if (typeof value !== 'number') {\n throw new TypeError('Start time must be set to a number.');\n }\n _startTime = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'endTime', extend({}, baseObj, {\n get: function () {\n return _endTime;\n },\n set: function (value) {\n if (typeof value !== 'number') {\n throw new TypeError('End time must be set to a number.');\n }\n _endTime = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'text', extend({}, baseObj, {\n get: function () {\n return _text;\n },\n set: function (value) {\n _text = '' + value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'region', extend({}, baseObj, {\n get: function () {\n return _region;\n },\n set: function (value) {\n _region = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'vertical', extend({}, baseObj, {\n get: function () {\n return _vertical;\n },\n set: function (value) {\n var setting = findDirectionSetting(value);\n // Have to check for false because the setting an be an empty string.\n if (setting === false) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _vertical = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'snapToLines', extend({}, baseObj, {\n get: function () {\n return _snapToLines;\n },\n set: function (value) {\n _snapToLines = !!value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'line', extend({}, baseObj, {\n get: function () {\n return _line;\n },\n set: function (value) {\n if (typeof value !== 'number' && value !== autoKeyword) {\n throw new SyntaxError('An invalid number or illegal string was specified.');\n }\n _line = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'lineAlign', extend({}, baseObj, {\n get: function () {\n return _lineAlign;\n },\n set: function (value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _lineAlign = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'position', extend({}, baseObj, {\n get: function () {\n return _position;\n },\n set: function (value) {\n if (value < 0 || value > 100) {\n throw new Error('Position must be between 0 and 100.');\n }\n _position = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'positionAlign', extend({}, baseObj, {\n get: function () {\n return _positionAlign;\n },\n set: function (value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _positionAlign = setting;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'size', extend({}, baseObj, {\n get: function () {\n return _size;\n },\n set: function (value) {\n if (value < 0 || value > 100) {\n throw new Error('Size must be between 0 and 100.');\n }\n _size = value;\n this.hasBeenReset = true;\n }\n }));\n\n Object.defineProperty(cue, 'align', extend({}, baseObj, {\n get: function () {\n return _align;\n },\n set: function (value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError('An invalid or illegal string was specified.');\n }\n _align = setting;\n this.hasBeenReset = true;\n }\n }));\n\n /**\n * Other <track> spec defined properties\n */\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state\n cue.displayState = undefined;\n\n if (isIE8) {\n return cue;\n }\n }\n\n /**\n * VTTCue methods\n */\n\n VTTCue.prototype.getCueAsHTML = function () {\n // Assume WebVTT.convertCueToDOMTree is on the global.\n var WebVTT = window.WebVTT;\n return WebVTT.convertCueToDOMTree(window, this.text);\n };\n\n return VTTCue;\n})();\n\n\n\n// WEBPACK FOOTER //\n// src/utils/vttcue.js","/*\n * Source: https://github.com/mozilla/vtt.js/blob/master/dist/vtt.js#L1716\n */\n\nimport VTTCue from './vttcue';\n\nconst StringDecoder = function StringDecoder() {\n return {\n decode: function(data) {\n if (!data) {\n return '';\n }\n if (typeof data !== 'string') {\n throw new Error('Error - expected string data.');\n }\n return decodeURIComponent(encodeURIComponent(data));\n },\n };\n };\n\nfunction VTTParser() {\n this.window = window;\n this.state = 'INITIAL';\n this.buffer = '';\n this.decoder = new StringDecoder();\n this.regionList = [];\n}\n\n\n// Try to parse input as a time stamp.\nfunction parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(':', ''), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}\n\n// A settings object holds key/value pairs and will ignore anything but the first\n// assignment to a specific key.\nfunction Settings() {\n this.values = Object.create(null);\n}\n\nSettings.prototype = {\n // Only accept the first assignment to any key.\n set: function(k, v) {\n if (!this.get(k) && v !== '') {\n this.values[k] = v;\n }\n },\n // Return the value for a key, or a default value.\n // If 'defaultKey' is passed then 'dflt' is assumed to be an object with\n // a number of possible default values as properties where 'defaultKey' is\n // the key of the property that will be chosen; otherwise it's assumed to be\n // a single value.\n get: function(k, dflt, defaultKey) {\n if (defaultKey) {\n return this.has(k) ? this.values[k] : dflt[defaultKey];\n }\n return this.has(k) ? this.values[k] : dflt;\n },\n // Check whether we have a value for a key.\n has: function(k) {\n return k in this.values;\n },\n // Accept a setting if its one of the given alternatives.\n alt: function(k, v, a) {\n for (var n = 0; n < a.length; ++n) {\n if (v === a[n]) {\n this.set(k, v);\n break;\n }\n }\n },\n // Accept a setting if its a valid (signed) integer.\n integer: function(k, v) {\n if (/^-?\\d+$/.test(v)) { // integer\n this.set(k, parseInt(v, 10));\n }\n },\n // Accept a setting if its a valid percentage.\n percent: function(k, v) {\n var m;\n if ((m = v.match(/^([\\d]{1,3})(\\.[\\d]*)?%$/))) {\n v = parseFloat(v);\n if (v >= 0 && v <= 100) {\n this.set(k, v);\n return true;\n }\n }\n return false;\n }\n};\n\n// Helper function to parse input into groups separated by 'groupDelim', and\n// interprete each group as a key/value pair separated by 'keyValueDelim'.\nfunction parseOptions(input, callback, keyValueDelim, groupDelim) {\n var groups = groupDelim ? input.split(groupDelim) : [input];\n for (var i in groups) {\n if (typeof groups[i] !== 'string') {\n continue;\n }\n var kv = groups[i].split(keyValueDelim);\n if (kv.length !== 2) {\n continue;\n }\n var k = kv[0];\n var v = kv[1];\n callback(k, v);\n }\n}\n\nvar defaults = new VTTCue(0, 0, 0);\n// 'middle' was changed to 'center' in the spec: https://github.com/w3c/webvtt/pull/244\n// Chrome and Safari don't yet support this change, but FF does\nvar center = defaults.align === 'middle' ? 'middle' : 'center';\n\nfunction parseCue(input, cue, regionList) {\n // Remember the original input if we need to throw an error.\n var oInput = input;\n // 4.1 WebVTT timestamp\n function consumeTimeStamp() {\n var ts = parseTimeStamp(input);\n if (ts === null) {\n throw new Error('Malformed timestamp: ' + oInput);\n }\n // Remove time stamp from input.\n input = input.replace(/^[^\\sa-zA-Z-]+/, '');\n return ts;\n }\n\n // 4.4.2 WebVTT cue settings\n function consumeCueSettings(input, cue) {\n var settings = new Settings();\n\n parseOptions(input, function(k, v) {\n switch (k) {\n case 'region':\n // Find the last region we parsed with the same region id.\n for (var i = regionList.length - 1; i >= 0; i--) {\n if (regionList[i].id === v) {\n settings.set(k, regionList[i].region);\n break;\n }\n }\n break;\n case 'vertical':\n settings.alt(k, v, ['rl', 'lr']);\n break;\n case 'line':\n var vals = v.split(','),\n vals0 = vals[0];\n settings.integer(k, vals0);\n if (settings.percent(k, vals0)) {\n settings.set('snapToLines', false);\n }\n settings.alt(k, vals0, ['auto']);\n if (vals.length === 2) {\n settings.alt('lineAlign', vals[1], ['start', center, 'end']);\n }\n break;\n case 'position':\n vals = v.split(',');\n settings.percent(k, vals[0]);\n if (vals.length === 2) {\n settings.alt('positionAlign', vals[1], ['start', center, 'end', 'line-left', 'line-right', 'auto']);\n }\n break;\n case 'size':\n settings.percent(k, v);\n break;\n case 'align':\n settings.alt(k, v, ['start', center, 'end', 'left', 'right']);\n break;\n }\n }, /:/, /\\s/);\n\n // Apply default values for any missing fields.\n cue.region = settings.get('region', null);\n cue.vertical = settings.get('vertical', '');\n var line = settings.get('line', 'auto');\n if (line === 'auto' && defaults.line === -1) {\n // set numeric line number for Safari\n line = -1;\n }\n cue.line = line;\n cue.lineAlign = settings.get('lineAlign', 'start');\n cue.snapToLines = settings.get('snapToLines', true);\n cue.size = settings.get('size', 100);\n cue.align = settings.get('align', center);\n var position = settings.get('position', 'auto');\n if (position === 'auto' && defaults.position === 50) {\n // set numeric position for Safari\n position = cue.align === 'start' || cue.align === 'left' ? 0 : cue.align === 'end' || cue.align === 'right' ? 100 : 50;\n }\n cue.position = position;\n }\n\n function skipWhitespace() {\n input = input.replace(/^\\s+/, '');\n }\n\n // 4.1 WebVTT cue timings.\n skipWhitespace();\n cue.startTime = consumeTimeStamp(); // (1) collect cue start time\n skipWhitespace();\n if (input.substr(0, 3) !== '-->') { // (3) next characters must match '-->'\n throw new Error('Malformed time stamp (time stamps must be separated by \\'-->\\'): ' +\n oInput);\n }\n input = input.substr(3);\n skipWhitespace();\n cue.endTime = consumeTimeStamp(); // (5) collect cue end time\n\n // 4.1 WebVTT cue settings list.\n skipWhitespace();\n consumeCueSettings(input, cue);\n}\n\nfunction fixLineBreaks(input) {\n return input.replace(/<br(?: \\/)?>/gi, '\\n');\n}\n\nVTTParser.prototype = {\n parse: function(data) {\n var self = this;\n\n // If there is no data then we won't decode it, but will just try to parse\n // whatever is in buffer already. This may occur in circumstances, for\n // example when flush() is called.\n if (data) {\n // Try to decode the data that we received.\n self.buffer += self.decoder.decode(data, {stream: true});\n }\n\n function collectNextLine() {\n var buffer = self.buffer;\n var pos = 0;\n\n buffer = fixLineBreaks(buffer);\n\n while (pos < buffer.length && buffer[pos] !== '\\r' && buffer[pos] !== '\\n') {\n ++pos;\n }\n var line = buffer.substr(0, pos);\n // Advance the buffer early in case we fail below.\n if (buffer[pos] === '\\r') {\n ++pos;\n }\n if (buffer[pos] === '\\n') {\n ++pos;\n }\n self.buffer = buffer.substr(pos);\n return line;\n }\n\n // 3.2 WebVTT metadata header syntax\n function parseHeader(input) {\n parseOptions(input, function(k, v) {\n switch (k) {\n case 'Region':\n // 3.3 WebVTT region metadata header syntax\n console.log('parse region', v);\n //parseRegion(v);\n break;\n }\n }, /:/);\n }\n\n // 5.1 WebVTT file parsing.\n try {\n var line;\n if (self.state === 'INITIAL') {\n // We can't start parsing until we have the first line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n line = collectNextLine();\n\n var m = line.match(/^WEBVTT([ \\t].*)?$/);\n if (!m || !m[0]) {\n throw new Error('Malformed WebVTT signature.');\n }\n\n self.state = 'HEADER';\n }\n\n var alreadyCollectedLine = false;\n while (self.buffer) {\n // We can't parse a line until we have the full line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n if (!alreadyCollectedLine) {\n line = collectNextLine();\n } else {\n alreadyCollectedLine = false;\n }\n\n switch (self.state) {\n case 'HEADER':\n // 13-18 - Allow a header (metadata) under the WEBVTT line.\n if (/:/.test(line)) {\n parseHeader(line);\n } else if (!line) {\n // An empty line terminates the header and starts the body (cues).\n self.state = 'ID';\n }\n continue;\n case 'NOTE':\n // Ignore NOTE blocks.\n if (!line) {\n self.state = 'ID';\n }\n continue;\n case 'ID':\n // Check for the start of NOTE blocks.\n if (/^NOTE($|[ \\t])/.test(line)) {\n self.state = 'NOTE';\n break;\n }\n // 19-29 - Allow any number of line terminators, then initialize new cue values.\n if (!line) {\n continue;\n }\n self.cue = new VTTCue(0, 0, '');\n self.state = 'CUE';\n // 30-39 - Check if self line contains an optional identifier or timing data.\n if (line.indexOf('-->') === -1) {\n self.cue.id = line;\n continue;\n }\n // Process line as start of a cue.\n /*falls through*/\n case 'CUE':\n // 40 - Collect cue timings and settings.\n try {\n parseCue(line, self.cue, self.regionList);\n } catch (e) {\n // In case of an error ignore rest of the cue.\n self.cue = null;\n self.state = 'BADCUE';\n continue;\n }\n self.state = 'CUETEXT';\n continue;\n case 'CUETEXT':\n var hasSubstring = line.indexOf('-->') !== -1;\n // 34 - If we have an empty line then report the cue.\n // 35 - If we have the special substring '-->' then report the cue,\n // but do not collect the line as we need to process the current\n // one as a new cue.\n if (!line || hasSubstring && (alreadyCollectedLine = true)) {\n // We are done parsing self cue.\n if (self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n self.state = 'ID';\n continue;\n }\n if (self.cue.text) {\n self.cue.text += '\\n';\n }\n self.cue.text += line;\n continue;\n case 'BADCUE': // BADCUE\n // 54-62 - Collect and discard the remaining cue.\n if (!line) {\n self.state = 'ID';\n }\n continue;\n }\n }\n } catch (e) {\n\n // If we are currently parsing a cue, report what we have.\n if (self.state === 'CUETEXT' && self.cue && self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n // Enter BADWEBVTT state if header was not parsed correctly otherwise\n // another exception occurred so enter BADCUE state.\n self.state = self.state === 'INITIAL' ? 'BADWEBVTT' : 'BADCUE';\n }\n return this;\n },\n flush: function() {\n var self = this;\n try {\n // Finish decoding the stream.\n self.buffer += self.decoder.decode();\n // Synthesize the end of the current cue or region.\n if (self.cue || self.state === 'HEADER') {\n self.buffer += '\\n\\n';\n self.parse();\n }\n // If we've flushed, parsed, and we're still on the INITIAL state then\n // that means we don't have enough of the stream to parse the first\n // line.\n if (self.state === 'INITIAL') {\n throw new Error('Malformed WebVTT signature.');\n }\n } catch (e) {\n throw e;\n }\n if (self.onflush) {\n self.onflush();\n }\n return this;\n }\n};\n\nexport { fixLineBreaks };\n\nexport default VTTParser;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/vttparser.js","import VTTParser from './vttparser';\n\n// String.prototype.startsWith is not supported in IE11\nconst startsWith = function(inputString, searchString, position) {\n return inputString.substr(position || 0, searchString.length) === searchString;\n};\n\nconst cueString2millis = function(timeString) {\n let ts = parseInt(timeString.substr(-3));\n let secs = parseInt(timeString.substr(-6,2));\n let mins = parseInt(timeString.substr(-9,2));\n let hours = timeString.length > 9 ? parseInt(timeString.substr(0, timeString.indexOf(':'))) : 0;\n\n if (isNaN(ts) || isNaN(secs) || isNaN(mins) || isNaN(hours)) {\n return -1;\n }\n\n ts += 1000 * secs;\n ts += 60*1000 * mins;\n ts += 60*60*1000 * hours;\n\n return ts;\n};\n\n// From https://github.com/darkskyapp/string-hash\nconst hash = function(text) {\n let hash = 5381;\n let i = text.length;\n while (i) {\n hash = (hash * 33) ^ text.charCodeAt(--i);\n }\n return (hash >>> 0).toString();\n};\n\nconst calculateOffset = function(vttCCs, cc, presentationTime) {\n let currCC = vttCCs[cc];\n let prevCC = vttCCs[currCC.prevCC];\n\n // This is the first discontinuity or cues have been processed since the last discontinuity\n // Offset = current discontinuity time\n if (!prevCC || (!prevCC.new && currCC.new)) {\n vttCCs.ccOffset = vttCCs.presentationOffset = currCC.start;\n currCC.new = false;\n return;\n }\n\n // There have been discontinuities since cues were last parsed.\n // Offset = time elapsed\n while (prevCC && prevCC.new) {\n vttCCs.ccOffset += currCC.start - prevCC.start;\n currCC.new = false;\n currCC = prevCC;\n prevCC = vttCCs[currCC.prevCC];\n }\n\n vttCCs.presentationOffset = presentationTime;\n};\n\nconst WebVTTParser = {\n parse: function(vttByteArray, syncPTS, vttCCs, cc, callBack, errorCallBack) {\n // Convert byteArray into string, replacing any somewhat exotic linefeeds with \"\\n\", then split on that character.\n let re = /\\r\\n|\\n\\r|\\n|\\r/g;\n let vttLines = String.fromCharCode.apply(null, new Uint8Array(vttByteArray)).trim().replace(re, '\\n').split('\\n');\n let cueTime = '00:00.000';\n let mpegTs = 0;\n let localTime = 0;\n let presentationTime = 0;\n let cues = [];\n let parsingError;\n let inHeader = true;\n // let VTTCue = VTTCue || window.TextTrackCue;\n\n // Create parser object using VTTCue with TextTrackCue fallback on certain browsers.\n let parser = new VTTParser();\n\n parser.oncue = function(cue) {\n // Adjust cue timing; clamp cues to start no earlier than - and drop cues that don't end after - 0 on timeline.\n let currCC = vttCCs[cc];\n let cueOffset = vttCCs.ccOffset;\n\n // Update offsets for new discontinuities\n if (currCC && currCC.new) {\n if (localTime !== undefined) {\n // When local time is provided, offset = discontinuity start time - local time\n cueOffset = vttCCs.ccOffset = currCC.start;\n } else {\n calculateOffset(vttCCs, cc, presentationTime);\n }\n }\n\n if (presentationTime) {\n // If we have MPEGTS, offset = presentation time + discontinuity offset\n cueOffset = presentationTime + vttCCs.ccOffset - vttCCs.presentationOffset;\n }\n\n cue.startTime += cueOffset - localTime;\n cue.endTime += cueOffset - localTime;\n\n // Create a unique hash id for a cue based on start/end times and text.\n // This helps timeline-controller to avoid showing repeated captions.\n cue.id = hash(cue.startTime) + hash(cue.endTime) + hash(cue.text);\n\n // Fix encoding of special characters. TODO: Test with all sorts of weird characters.\n cue.text = decodeURIComponent(escape(cue.text));\n if (cue.endTime > 0) {\n cues.push(cue);\n }\n };\n\n parser.onparsingerror = function(e) {\n parsingError = e;\n };\n\n parser.onflush = function() {\n if (parsingError && errorCallBack) {\n errorCallBack(parsingError);\n return;\n }\n callBack(cues);\n };\n\n // Go through contents line by line.\n vttLines.forEach(line => {\n if (inHeader) {\n // Look for X-TIMESTAMP-MAP in header.\n if (startsWith(line, 'X-TIMESTAMP-MAP=')) {\n // Once found, no more are allowed anyway, so stop searching.\n inHeader = false;\n // Extract LOCAL and MPEGTS.\n line.substr(16).split(',').forEach(timestamp => {\n if (startsWith(timestamp, 'LOCAL:')) {\n cueTime = timestamp.substr(6);\n } else if (startsWith(timestamp, 'MPEGTS:')) {\n mpegTs = parseInt(timestamp.substr(7));\n }\n });\n try {\n // Calculate subtitle offset in milliseconds.\n // If sync PTS is less than zero, we have a 33-bit wraparound, which is fixed by adding 2^33 = 8589934592.\n syncPTS = syncPTS < 0 ? syncPTS + 8589934592 : syncPTS;\n // Adjust MPEGTS by sync PTS.\n mpegTs -= syncPTS;\n // Convert cue time to seconds\n localTime = cueString2millis(cueTime) / 1000;\n // Convert MPEGTS to seconds from 90kHz.\n presentationTime = mpegTs / 90000;\n\n if (localTime === -1) {\n parsingError = new Error(`Malformed X-TIMESTAMP-MAP: ${line}`);\n }\n }\n catch(e) {\n parsingError = new Error(`Malformed X-TIMESTAMP-MAP: ${line}`);\n }\n // Return without parsing X-TIMESTAMP-MAP line.\n return;\n } else if (line === '') {\n inHeader = false;\n }\n }\n // Parse line by default.\n parser.parse(line+'\\n');\n });\n\n parser.flush();\n }\n};\n\n\nmodule.exports = WebVTTParser;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/webvtt-parser.js","/**\n * XHR based logger\n*/\n\nimport {logger} from '../utils/logger';\n\nclass XhrLoader {\n\n constructor(config) {\n if (config && config.xhrSetup) {\n this.xhrSetup = config.xhrSetup;\n }\n }\n\n destroy() {\n this.abort();\n this.loader = null;\n }\n\n 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 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 loadInternal() {\n var xhr, 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 let stats = this.stats;\n stats.tfirst = 0;\n stats.loaded = 0;\n const xhrSetup = this.xhrSetup;\n\n try {\n if (xhrSetup) {\n try {\n xhrSetup(xhr, context.url);\n } catch (e) {\n // fix xhrSetup: (xhr, url) => {xhr.setRequestHeader(\"Content-Language\", \"test\");}\n // not working, as xhr.setRequestHeader expects xhr.readyState === OPEN\n xhr.open('GET', context.url, true);\n xhrSetup(xhr, context.url);\n }\n }\n if (!xhr.readyState) {\n xhr.open('GET', context.url, true);\n }\n } catch (e) {\n // IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS\n this.callbacks.onError({ code : xhr.status, text: e.message }, context, xhr);\n return;\n }\n\n if (context.rangeEnd) {\n xhr.setRequestHeader('Range','bytes=' + context.rangeStart + '-' + (context.rangeEnd-1));\n }\n xhr.onreadystatechange = this.readystatechange.bind(this);\n xhr.onprogress = this.loadprogress.bind(this);\n xhr.responseType = context.responseType;\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 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 // >= HEADERS_RECEIVED\n if (readyState >=2) {\n // clear xhr timeout and rearm it if readyState less than 4\n window.clearTimeout(this.requestTimeout);\n if (stats.tfirst === 0) {\n stats.tfirst = Math.max(performance.now(), stats.trequest);\n }\n if (readyState === 4) {\n let 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 let data,len;\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 let response = { url : xhr.responseURL, data : data };\n this.callbacks.onSuccess(response, stats, context, xhr);\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.error(`${status} while loading ${context.url}` );\n this.callbacks.onError({ code : status, text : xhr.statusText}, context, xhr);\n } else {\n // retry\n 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 } else {\n // readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet\n this.requestTimeout = window.setTimeout(this.loadtimeout.bind(this), config.timeout);\n }\n }\n }\n\n loadtimeout() {\n logger.warn(`timeout while loading ${this.context.url}` );\n this.callbacks.onTimeout(this.stats, this.context, null);\n }\n\n loadprogress(event) {\n var xhr = event.currentTarget,\n stats = this.stats;\n\n stats.loaded = event.loaded;\n if (event.lengthComputable) {\n stats.total = event.total;\n }\n let onProgress = this.callbacks.onProgress;\n if (onProgress) {\n // third arg is to provide on progress data\n onProgress(stats, this.context, null, xhr);\n }\n }\n}\n\nexport default XhrLoader;\n\n\n\n// WEBPACK FOOTER //\n// src/utils/xhr-loader.js","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"shaka-player\"), require(\"playkit-js\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"shaka-player\", \"playkit-js\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"PlaykitJsDash\"] = factory(require(\"shaka-player\"), require(\"playkit-js\"));\n\telse\n\t\troot[\"PlaykitJsDash\"] = factory(root[\"shaka\"], root[\"Playkit\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition\n\n\n// WEBPACK FOOTER //\n// webpack:///dash/webpack/universalModuleDefinition"," \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 \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\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.l = 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// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 249eeb77a61a9c7bb545\n\n\n// WEBPACK FOOTER //\n// webpack:/dash/webpack/bootstrap 249eeb77a61a9c7bb545","// @flow\nimport shaka from 'shaka-player';\nimport {registerMediaSourceAdapter, BaseMediaSourceAdapter} from 'playkit-js'\nimport {Track, VideoTrack, AudioTrack, TextTrack} from 'playkit-js'\n\n/**\n * Adapter of shaka lib for dash content\n * @classdesc\n */\nexport default class DashAdapter extends BaseMediaSourceAdapter {\n /**\n * The id of Adapter\n * @member {string} id\n * @static\n * @public\n */\n static id = 'DashAdapter';\n /**\n * The adapter logger\n * @member {any} _logger\n * @private\n * @static\n */\n static _logger = BaseMediaSourceAdapter.getLogger(DashAdapter.id);\n /**\n * The supported mime type by the dash adapter\n * @member {string} _dashMimeType\n * @static\n * @private\n */\n static _dashMimeType = 'application/dash+xml';\n /**\n * The shaka player instance\n * @member {any} _shaka\n * @private\n */\n _shaka: any;\n /**\n * The load promise\n * @member {Promise<Object>} - _loadPromise\n * @type {Promise<Object>}\n * @private\n */\n _loadPromise: ?Promise<Object>;\n\n /**\n * Checks if dash adapter can play a given mime type\n * @function canPlayType\n * @param {string} mimeType - The mime type to check\n * @returns {boolean} - Whether the dash adapter can play a specific mime type\n * @static\n */\n static canPlayType(mimeType: string): boolean {\n let canPlayType = typeof mimeType === 'string' ? mimeType.toLowerCase() === DashAdapter._dashMimeType : false;\n DashAdapter._logger.debug('canPlayType result for mimeType: ' + mimeType + ' is ' + canPlayType.toString());\n return canPlayType;\n }\n\n /**\n * Checks if the dash adapter is supported\n * @function isSupported\n * @returns {boolean} - Whether dash is supported.\n * @static\n */\n static isSupported(): boolean {\n shaka.polyfill.installAll();\n let isSupported = shaka.Player.isBrowserSupported();\n DashAdapter._logger.debug('isSupported:' + isSupported);\n return isSupported;\n }\n\n /**\n * @constructor\n * @param {HTMLVideoElement} videoElement - The video element which bind to the dash adapter\n * @param {Object} source - The source object\n * @param {Object} config - The media source adapter configuration\n */\n constructor(videoElement: HTMLVideoElement, source: Object, config: Object = {}) {\n DashAdapter._logger.debug('Creating adapter. Shaka version: ' + shaka.Player.version);\n super(videoElement, source, config);\n this._shaka = new shaka.Player(videoElement);\n this._shaka.configure(config);\n this._addBindings();\n }\n\n /**\n * Add the required bindings to shaka.\n * @function _addBindings\n * @private\n * @returns {void}\n */\n _addBindings(): void {\n this._shaka.addEventListener('adaptation', this._onAdaptation.bind(this));\n this._shaka.addEventListener('error', this._onError.bind(this));\n }\n\n /**\n * Remove the bindings to shaka.\n * @function _removeBindings\n * @private\n * @returns {void}\n */\n _removeBindings(): void {\n this._shaka.removeEventListener('adaptation', this._onAdaptation);\n this._shaka.removeEventListener('error', this._onError);\n }\n\n /**\n * Load the video source\n * @function load\n * @override\n */\n load(): Promise<Object> {\n if (!this._loadPromise) {\n this._loadPromise = new Promise((resolve, reject) => {\n if (this._sourceObj && this._sourceObj.url) {\n this._shaka.load(this._sourceObj.url).then(() => {\n let data = {tracks: this._getParsedTracks()};\n DashAdapter._logger.debug('The source has been loaded successfully');\n resolve(data);\n }).catch((error) => {\n reject(error);\n this._onError(error);\n });\n }\n });\n }\n return this._loadPromise;\n }\n\n /**\n * Destroying the dash adapter\n * @function destroy\n * @override\n */\n destroy(): void {\n DashAdapter._logger.debug('destroy');\n super.destroy();\n this._loadPromise = null;\n this._removeBindings();\n this._shaka.destroy();\n }\n\n /**\n * Get the original video tracks\n * @function _getVideoTracks\n * @returns {Array<Object>} - The original video tracks\n * @private\n */\n _getVideoTracks(): Array<Object> {\n let variantTracks = this._shaka.getVariantTracks();\n let activeVariantTrack = variantTracks.filter((variantTrack) => {\n return variantTrack.active;\n })[0];\n let videoTracks = variantTracks.filter((variantTrack) => {\n return variantTrack.audioId === activeVariantTrack.audioId;\n });\n return videoTracks;\n }\n\n /**\n * Get the original audio tracks\n * @function _getAudioTracks\n * @returns {Array<Object>} - The original audio tracks\n * @private\n */\n _getAudioTracks(): Array<Object> {\n let variantTracks = this._shaka.getVariantTracks();\n let activeVariantTrack = variantTracks.filter((variantTrack) => {\n return variantTrack.active;\n })[0];\n let audioTracks = variantTracks.filter((variantTrack) => {\n return variantTrack.videoId === activeVariantTrack.videoId;\n });\n return audioTracks;\n }\n\n /**\n * Get the parsed tracks\n * @function _getParsedTracks\n * @returns {Array<Track>} - The parsed tracks\n * @private\n */\n _getParsedTracks(): Array<Track> {\n let videoTracks = this._getParsedVideoTracks();\n let audioTracks = this._getParsedAudioTracks();\n let textTracks = this._getParsedTextTracks();\n return videoTracks.concat(audioTracks).concat(textTracks);\n }\n\n /**\n * Get the parsed video tracks\n * @function _getParsedVideoTracks\n * @returns {Array<VideoTrack>} - The parsed video tracks\n * @private\n */\n _getParsedVideoTracks(): Array<VideoTrack> {\n let videoTracks = this._getVideoTracks();\n let parsedTracks = [];\n if (videoTracks) {\n for (let i = 0; i < videoTracks.length; i++) {\n let settings = {\n id: videoTracks[i].id,\n bandwidth: videoTracks[i].bandwidth,\n active: videoTracks[i].active,\n label: videoTracks[i].label,\n index: i\n };\n parsedTracks.push(new VideoTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed audio tracks\n * @function _getParsedAudioTracks\n * @returns {Array<AudioTrack>} - The parsed audio tracks\n * @private\n */\n _getParsedAudioTracks(): Array<AudioTrack> {\n let audioTracks = this._getAudioTracks();\n let parsedTracks = [];\n if (audioTracks) {\n for (let i = 0; i < audioTracks.length; i++) {\n let settings = {\n id: audioTracks[i].id,\n active: audioTracks[i].active,\n label: audioTracks[i].label,\n language: audioTracks[i].language,\n index: i\n };\n parsedTracks.push(new AudioTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Get the parsed text tracks\n * @function _getParsedTextTracks\n * @returns {Array<TextTrack>} - The parsed text tracks\n * @private\n */\n _getParsedTextTracks(): Array<TextTrack> {\n let textTracks = this._shaka.getTextTracks();\n let parsedTracks = [];\n if (textTracks) {\n for (let i = 0; i < textTracks.length; i++) {\n let settings = {\n kind: textTracks[i].kind ? textTracks[i].kind + 's' : \"\",\n active: textTracks[i].active,\n label: textTracks[i].label,\n language: textTracks[i].language,\n index: i\n };\n parsedTracks.push(new TextTrack(settings));\n }\n }\n return parsedTracks;\n }\n\n /**\n * Select a video track\n * @function selectVideoTrack\n * @param {VideoTrack} videoTrack - the video track to select\n * @returns {void}\n * @public\n */\n selectVideoTrack(videoTrack: VideoTrack): void {\n let videoTracks = this._getVideoTracks();\n if ((videoTrack instanceof VideoTrack) && videoTracks) {\n let selectedVideoTrack = videoTracks[videoTrack.index];\n if (selectedVideoTrack) {\n this._shaka.configure({abr: {enabled: false}});\n if (!selectedVideoTrack.active) {\n this._shaka.selectVariantTrack(videoTracks[videoTrack.index], true);\n this._onTrackChanged(videoTrack);\n }\n }\n }\n }\n\n /**\n * Select an audio track\n * @function selectAudioTrack\n * @param {AudioTrack} audioTrack - the audio track to select\n * @returns {void}\n * @public\n */\n selectAudioTrack(audioTrack: AudioTrack): void {\n if ((audioTrack instanceof AudioTrack) && !audioTrack.active) {\n this._shaka.selectAudioLanguage(audioTrack.language);\n this._onTrackChanged(audioTrack);\n }\n }\n\n /**\n * Select a text track\n * @function selectTextTrack\n * @param {TextTrack} textTrack - the track to select\n * @returns {void}\n * @public\n */\n selectTextTrack(textTrack: TextTrack): void {\n if ((textTrack instanceof TextTrack) && !textTrack.active && (textTrack.kind === 'subtitles' || textTrack.kind === 'captions')) {\n this._shaka.selectTextLanguage(textTrack.language);\n this._shaka.setTextTrackVisibility(true);\n this._onTrackChanged(textTrack);\n }\n }\n\n /**\n * Hide the text track\n * @function hideTextTrack\n * @returns {void}\n * @public\n */\n hideTextTrack(): void {\n this._shaka.setTextTrackVisibility(false);\n }\n\n /**\n * Enables adaptive bitrate switching\n * @function enableAdaptiveBitrate\n * @returns {void}\n * @public\n */\n enableAdaptiveBitrate(): void {\n this._shaka.configure({abr: {enabled: true}});\n }\n\n /**\n * An handler to shaka adaptation event\n * @function _onAdaptation\n * @returns {void}\n * @private\n */\n _onAdaptation(): void {\n let selectedVideoTrack = this._getParsedVideoTracks().filter(function (videoTrack) {\n return videoTrack.active;\n })[0];\n this._onTrackChanged(selectedVideoTrack);\n }\n\n /**\n * An handler to shaka error event\n * @function _onError\n * @param {any} error - the error\n * @returns {void}\n * @private\n */\n _onError(error: any): void {\n DashAdapter._logger.error(error);\n }\n\n /**\n * Getter for the src that the adapter plays on the video element.\n * In case the adapter preformed a load it will return the manifest url.\n * @public\n * @returns {string} - The src url.\n */\n get src(): string {\n if (this._loadPromise && this._sourceObj) {\n return this._sourceObj.url;\n }\n return \"\";\n }\n}\n\n// Register DashAdapter to the media source adapter manager\nif (DashAdapter.isSupported()) {\n registerMediaSourceAdapter(DashAdapter);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./dash-adapter.js\n\n\n// WEBPACK FOOTER //\n// webpack:///dash/dash-adapter.js","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"shaka-player\",\"commonjs2\":\"shaka-player\",\"amd\":\"shaka-player\",\"root\":\"shaka\"}\n// module id = 1\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/dash/external {\"commonjs\":\"shaka-player\",\"commonjs2\":\"shaka-player\",\"amd\":\"shaka-player\",\"root\":\"shaka\"}","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}\n// module id = 2\n// module chunks = 0\n\n\n// WEBPACK FOOTER //\n// webpack:/dash/external {\"commonjs\":\"playkit-js\",\"commonjs2\":\"playkit-js\",\"amd\":\"playkit-js\",\"root\":\"Playkit\"}","// Copyright 2006 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Bootstrap for the Google JS Library (Closure).\n *\n * In uncompiled mode base.js will write out Closure's deps file, unless the\n * global <code>CLOSURE_NO_DEPS</code> is set to true. This allows projects to\n * include their own deps file(s) from different locations.\n *\n *\n * @provideGoog\n */\n\n\n/**\n * @define {boolean} Overridden to true by the compiler when --closure_pass\n * or --mark_as_compiled is specified.\n */\nvar COMPILED = false;\n\n\n/**\n * Base namespace for the Closure library. Checks to see goog is already\n * defined in the current scope before assigning to prevent clobbering if\n * base.js is loaded more than once.\n *\n * @const\n */\nvar goog = goog || {};\n\n\n/**\n * Reference to the global context. In most cases this will be 'window'.\n */\ngoog.global = this;\n\n\n/**\n * A hook for overriding the define values in uncompiled mode.\n *\n * In uncompiled mode, {@code CLOSURE_UNCOMPILED_DEFINES} may be defined before\n * loading base.js. If a key is defined in {@code CLOSURE_UNCOMPILED_DEFINES},\n * {@code goog.define} will use the value instead of the default value. This\n * allows flags to be overwritten without compilation (this is normally\n * accomplished with the compiler's \"define\" flag).\n *\n * Example:\n * <pre>\n * var CLOSURE_UNCOMPILED_DEFINES = {'goog.DEBUG': false};\n * </pre>\n *\n * @type {Object.<string, (string|number|boolean)>|undefined}\n */\ngoog.global.CLOSURE_UNCOMPILED_DEFINES;\n\n\n/**\n * A hook for overriding the define values in uncompiled or compiled mode,\n * like CLOSURE_UNCOMPILED_DEFINES but effective in compiled code. In\n * uncompiled code CLOSURE_UNCOMPILED_DEFINES takes precedence.\n *\n * Also unlike CLOSURE_UNCOMPILED_DEFINES the values must be number, boolean or\n * string literals or the compiler will emit an error.\n *\n * While any @define value may be set, only those set with goog.define will be\n * effective for uncompiled code.\n *\n * Example:\n * <pre>\n * var CLOSURE_DEFINES = {'goog.DEBUG': false};\n * </pre>\n *\n * @type {Object.<string, (string|number|boolean)>|undefined}\n */\ngoog.global.CLOSURE_DEFINES;\n\n\n/**\n * Returns true if the specified value is not undefined.\n * WARNING: Do not use this to test if an object has a property. Use the in\n * operator instead.\n *\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is defined.\n */\ngoog.isDef = function(val) {\n // void 0 always evaluates to undefined and hence we do not need to depend on\n // the definition of the global variable named 'undefined'.\n return val !== void 0;\n};\n\n\n/**\n * Builds an object structure for the provided namespace path, ensuring that\n * names that already exist are not overwritten. For example:\n * \"a.b.c\" -> a = {};a.b={};a.b.c={};\n * Used by goog.provide and goog.exportSymbol.\n * @param {string} name name of the object that this file defines.\n * @param {*=} opt_object the object to expose at the end of the path.\n * @param {Object=} opt_objectToExportTo The object to add the path to; default\n * is |goog.global|.\n * @private\n */\ngoog.exportPath_ = function(name, opt_object, opt_objectToExportTo) {\n var parts = name.split('.');\n var cur = opt_objectToExportTo || goog.global;\n\n // Internet Explorer exhibits strange behavior when throwing errors from\n // methods externed in this manner. See the testExportSymbolExceptions in\n // base_test.html for an example.\n if (!(parts[0] in cur) && cur.execScript) {\n cur.execScript('var ' + parts[0]);\n }\n\n // Certain browsers cannot parse code in the form for((a in b); c;);\n // This pattern is produced by the JSCompiler when it collapses the\n // statement above into the conditional loop below. To prevent this from\n // happening, use a for-loop and reserve the init logic as below.\n\n // Parentheses added to eliminate strict JS warning in Firefox.\n for (var part; parts.length && (part = parts.shift());) {\n if (!parts.length && goog.isDef(opt_object)) {\n // last part and we have an object; use it\n cur[part] = opt_object;\n } else if (cur[part]) {\n cur = cur[part];\n } else {\n cur = cur[part] = {};\n }\n }\n};\n\n\n/**\n * Defines a named value. In uncompiled mode, the value is retreived from\n * CLOSURE_DEFINES or CLOSURE_UNCOMPILED_DEFINES if the object is defined and\n * has the property specified, and otherwise used the defined defaultValue.\n * When compiled, the default can be overridden using compiler command-line\n * options.\n *\n * @param {string} name The distinguished name to provide.\n * @param {string|number|boolean} defaultValue\n */\ngoog.define = function(name, defaultValue) {\n var value = defaultValue;\n if (!COMPILED) {\n if (goog.global.CLOSURE_UNCOMPILED_DEFINES &&\n Object.prototype.hasOwnProperty.call(\n goog.global.CLOSURE_UNCOMPILED_DEFINES, name)) {\n value = goog.global.CLOSURE_UNCOMPILED_DEFINES[name];\n } else if (goog.global.CLOSURE_DEFINES &&\n Object.prototype.hasOwnProperty.call(\n goog.global.CLOSURE_DEFINES, name)) {\n value = goog.global.CLOSURE_DEFINES[name];\n }\n }\n goog.exportPath_(name, value);\n};\n\n\n/**\n * @define {boolean} DEBUG is provided as a convenience so that debugging code\n * that should not be included in a production js_binary can be easily stripped\n * by specifying --define goog.DEBUG=false to the JSCompiler. For example, most\n * toString() methods should be declared inside an \"if (goog.DEBUG)\" conditional\n * because they are generally used for debugging purposes and it is difficult\n * for the JSCompiler to statically determine whether they are used.\n */\ngoog.DEBUG = true;\n\n\n/**\n * @define {string} LOCALE defines the locale being used for compilation. It is\n * used to select locale specific data to be compiled in js binary. BUILD rule\n * can specify this value by \"--define goog.LOCALE=<locale_name>\" as JSCompiler\n * option.\n *\n * Take into account that the locale code format is important. You should use\n * the canonical Unicode format with hyphen as a delimiter. Language must be\n * lowercase, Language Script - Capitalized, Region - UPPERCASE.\n * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN.\n *\n * See more info about locale codes here:\n * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers\n *\n * For language codes you should use values defined by ISO 693-1. See it here\n * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from\n * this rule: the Hebrew language. For legacy reasons the old code (iw) should\n * be used instead of the new code (he), see http://wiki/Main/IIISynonyms.\n */\ngoog.define('goog.LOCALE', 'en'); // default to en\n\n\n/**\n * @define {boolean} Whether this code is running on trusted sites.\n *\n * On untrusted sites, several native functions can be defined or overridden by\n * external libraries like Prototype, Datejs, and JQuery and setting this flag\n * to false forces closure to use its own implementations when possible.\n *\n * If your JavaScript can be loaded by a third party site and you are wary about\n * relying on non-standard implementations, specify\n * \"--define goog.TRUSTED_SITE=false\" to the JSCompiler.\n */\ngoog.define('goog.TRUSTED_SITE', true);\n\n\n/**\n * @define {boolean} Whether a project is expected to be running in strict mode.\n *\n * This define can be used to trigger alternate implementations compatible with\n * running in EcmaScript Strict mode or warn about unavailable functionality.\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode\n */\ngoog.define('goog.STRICT_MODE_COMPATIBLE', false);\n\n\n/**\n * Creates object stubs for a namespace. The presence of one or more\n * goog.provide() calls indicate that the file defines the given\n * objects/namespaces. Provided objects must not be null or undefined.\n * Build tools also scan for provide/require statements\n * to discern dependencies, build dependency files (see deps.js), etc.\n * @see goog.require\n * @param {string} name Namespace provided by this file in the form\n * \"goog.package.part\".\n */\ngoog.provide = function(name) {\n if (!COMPILED) {\n // Ensure that the same namespace isn't provided twice.\n // A goog.module/goog.provide maps a goog.require to a specific file\n if (goog.isProvided_(name)) {\n throw Error('Namespace \"' + name + '\" already declared.');\n }\n delete goog.implicitNamespaces_[name];\n\n var namespace = name;\n while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) {\n if (goog.getObjectByName(namespace)) {\n break;\n }\n goog.implicitNamespaces_[namespace] = true;\n }\n }\n\n goog.exportPath_(name);\n};\n\n\n/**\n * Forward declares a symbol. This is an indication to the compiler that the\n * symbol may be used in the source yet is not required and may not be provided\n * in compilation.\n *\n * The most common usage of forward declaration is code that takes a type as a\n * function parameter but does not need to require it. By forward declaring\n * instead of requiring, no hard dependency is made, and (if not required\n * elsewhere) the namespace may never be required and thus, not be pulled\n * into the JavaScript binary. If it is required elsewhere, it will be type\n * checked as normal.\n *\n *\n * @param {string} name The namespace to forward declare in the form of\n * \"goog.package.part\".\n */\ngoog.forwardDeclare = function(name) {};\n\n\nif (!COMPILED) {\n\n /**\n * Check if the given name has been goog.provided. This will return false for\n * names that are available only as implicit namespaces.\n * @param {string} name name of the object to look for.\n * @return {boolean} Whether the name has been provided.\n * @private\n */\n goog.isProvided_ = function(name) {\n return (!goog.implicitNamespaces_[name] &&\n goog.isDefAndNotNull(goog.getObjectByName(name)));\n };\n\n /**\n * Namespaces implicitly defined by goog.provide. For example,\n * goog.provide('goog.events.Event') implicitly declares that 'goog' and\n * 'goog.events' must be namespaces.\n *\n * @type {Object.<string, (boolean|undefined)>}\n * @private\n */\n goog.implicitNamespaces_ = {};\n}\n\n\n/**\n * Returns an object based on its fully qualified external name. The object\n * is not found if null or undefined. If you are using a compilation pass that\n * renames property names beware that using this function will not find renamed\n * properties.\n *\n * @param {string} name The fully qualified name.\n * @param {Object=} opt_obj The object within which to look; default is\n * |goog.global|.\n * @return {?} The value (object or primitive) or, if not found, null.\n */\ngoog.getObjectByName = function(name, opt_obj) {\n var parts = name.split('.');\n var cur = opt_obj || goog.global;\n for (var part; part = parts.shift(); ) {\n if (goog.isDefAndNotNull(cur[part])) {\n cur = cur[part];\n } else {\n return null;\n }\n }\n return cur;\n};\n\n\n/**\n * Globalizes a whole namespace, such as goog or goog.lang.\n *\n * @param {Object} obj The namespace to globalize.\n * @param {Object=} opt_global The object to add the properties to.\n * @deprecated Properties may be explicitly exported to the global scope, but\n * this should no longer be done in bulk.\n */\ngoog.globalize = function(obj, opt_global) {\n var global = opt_global || goog.global;\n for (var x in obj) {\n global[x] = obj[x];\n }\n};\n\n\n/**\n * Adds a dependency from a file to the files it requires.\n * @param {string} relPath The path to the js file.\n * @param {Array} provides An array of strings with the names of the objects\n * this file provides.\n * @param {Array} requires An array of strings with the names of the objects\n * this file requires.\n */\ngoog.addDependency = function(relPath, provides, requires) {\n if (goog.DEPENDENCIES_ENABLED) {\n var provide, require;\n var path = relPath.replace(/\\\\/g, '/');\n var deps = goog.dependencies_;\n for (var i = 0; provide = provides[i]; i++) {\n deps.nameToPath[provide] = path;\n }\n for (var j = 0; require = requires[j]; j++) {\n if (!(path in deps.requires)) {\n deps.requires[path] = {};\n }\n deps.requires[path][require] = true;\n }\n }\n};\n\n\n\n\n// NOTE(nnaze): The debug DOM loader was included in base.js as an original way\n// to do \"debug-mode\" development. The dependency system can sometimes be\n// confusing, as can the debug DOM loader's asynchronous nature.\n//\n// With the DOM loader, a call to goog.require() is not blocking -- the script\n// will not load until some point after the current script. If a namespace is\n// needed at runtime, it needs to be defined in a previous script, or loaded via\n// require() with its registered dependencies.\n// User-defined namespaces may need their own deps file. See http://go/js_deps,\n// http://go/genjsdeps, or, externally, DepsWriter.\n// https://developers.google.com/closure/library/docs/depswriter\n//\n// Because of legacy clients, the DOM loader can't be easily removed from\n// base.js. Work is being done to make it disableable or replaceable for\n// different environments (DOM-less JavaScript interpreters like Rhino or V8,\n// for example). See bootstrap/ for more information.\n\n\n/**\n * @define {boolean} Whether to enable the debug loader.\n *\n * If enabled, a call to goog.require() will attempt to load the namespace by\n * appending a script tag to the DOM (if the namespace has been registered).\n *\n * If disabled, goog.require() will simply assert that the namespace has been\n * provided (and depend on the fact that some outside tool correctly ordered\n * the script).\n */\ngoog.define('goog.ENABLE_DEBUG_LOADER', true);\n\n\n/**\n * @param {string} msg\n * @private\n */\ngoog.logToConsole_ = function(msg) {\n if (goog.global.console) {\n goog.global.console['error'](msg);\n }\n};\n\n\n/**\n * Implements a system for the dynamic resolution of dependencies that works in\n * parallel with the BUILD system. Note that all calls to goog.require will be\n * stripped by the JSCompiler when the --closure_pass option is used.\n * @see goog.provide\n * @param {string} name Namespace to include (as was given in goog.provide()) in\n * the form \"goog.package.part\".\n * @return {?} If called within a goog.module file, the associated namespace or\n * module otherwise null.\n */\ngoog.require = function(name) {\n\n // If the object already exists we do not need do do anything.\n if (!COMPILED) {\n if (goog.isProvided_(name)) {\n return null;\n }\n\n if (goog.ENABLE_DEBUG_LOADER) {\n var path = goog.getPathFromDeps_(name);\n if (path) {\n goog.included_[path] = true;\n goog.writeScripts_();\n return null;\n }\n }\n\n var errorMessage = 'goog.require could not find: ' + name;\n goog.logToConsole_(errorMessage);\n\n throw Error(errorMessage);\n }\n};\n\n\n/**\n * Path for included scripts.\n * @type {string}\n */\ngoog.basePath = '';\n\n\n/**\n * A hook for overriding the base path.\n * @type {string|undefined}\n */\ngoog.global.CLOSURE_BASE_PATH;\n\n\n/**\n * Whether to load Closure's deps file automatically.\n * Shaka sets this to true since we are placing deps.js in a non-standard\n * location. Running Shaka in uncompiled mode will require loading deps.js\n * explicitly.\n * @type {boolean|undefined}\n */\ngoog.global.CLOSURE_NO_DEPS = true;\n\n\n/**\n * A function to import a single script. This is meant to be overridden when\n * Closure is being run in non-HTML contexts, such as web workers. It's defined\n * in the global scope so that it can be set before base.js is loaded, which\n * allows deps.js to be imported properly.\n *\n * The function is passed the script source, which is a relative URI. It should\n * return true if the script was imported, false otherwise.\n * @type {(function(string): boolean)|undefined}\n */\ngoog.global.CLOSURE_IMPORT_SCRIPT;\n\n\n/**\n * True if goog.dependencies_ is available.\n * @const {boolean}\n */\ngoog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;\n\n\nif (goog.DEPENDENCIES_ENABLED) {\n /**\n * Object used to keep track of urls that have already been added. This record\n * allows the prevention of circular dependencies.\n * @type {Object}\n * @private\n */\n goog.included_ = {};\n\n\n /**\n * This object is used to keep track of dependencies and other data that is\n * used for loading scripts.\n * @private\n * @type {Object}\n */\n goog.dependencies_ = {\n nameToPath: {}, // many to 1\n requires: {}, // 1 to many\n // Used when resolving dependencies to prevent us from visiting file twice.\n visited: {},\n written: {} // Used to keep track of script files we have written.\n };\n\n\n /**\n * Tries to detect whether is in the context of an HTML document.\n * @return {boolean} True if it looks like HTML document.\n * @private\n */\n goog.inHtmlDocument_ = function() {\n var doc = goog.global.document;\n return typeof doc != 'undefined' &&\n 'write' in doc; // XULDocument misses write.\n };\n\n\n /**\n * Tries to detect the base path of base.js script that bootstraps Closure.\n * @private\n */\n goog.findBasePath_ = function() {\n if (goog.global.CLOSURE_BASE_PATH) {\n goog.basePath = goog.global.CLOSURE_BASE_PATH;\n return;\n } else if (!goog.inHtmlDocument_()) {\n return;\n }\n var doc = goog.global.document;\n var scripts = doc.getElementsByTagName('script');\n // Search backwards since the current script is in almost all cases the one\n // that has base.js.\n for (var i = scripts.length - 1; i >= 0; --i) {\n var src = scripts[i].src;\n var qmark = src.lastIndexOf('?');\n var l = qmark == -1 ? src.length : qmark;\n if (src.substr(l - 7, 7) == 'base.js') {\n goog.basePath = src.substr(0, l - 7);\n return;\n }\n }\n };\n\n\n /**\n * Imports a script if, and only if, that script hasn't already been imported.\n * (Must be called at execution time)\n * @param {string} src Script source.\n * @param {string=} opt_sourceText The optionally source text to evaluate\n * @private\n */\n goog.importScript_ = function(src, opt_sourceText) {\n var importScript = goog.global.CLOSURE_IMPORT_SCRIPT ||\n goog.writeScriptTag_;\n if (importScript(src, opt_sourceText)) {\n goog.dependencies_.written[src] = true;\n }\n };\n\n\n /**\n * The default implementation of the import function. Writes a script tag to\n * import the script.\n *\n * @param {string} src The script url.\n * @param {string=} opt_sourceText The optionally source text to evaluate\n * @return {boolean} True if the script was imported, false otherwise.\n * @private\n */\n goog.writeScriptTag_ = function(src, opt_sourceText) {\n if (goog.inHtmlDocument_()) {\n var doc = goog.global.document;\n\n // If the user tries to require a new symbol after document load,\n // something has gone terribly wrong. Doing a document.write would\n // wipe out the page.\n if (doc.readyState == 'complete') {\n // Certain test frameworks load base.js multiple times, which tries\n // to write deps.js each time. If that happens, just fail silently.\n // These frameworks wipe the page between each load of base.js, so this\n // is OK.\n var isDeps = /\\bdeps.js$/.test(src);\n if (isDeps) {\n return false;\n } else {\n throw Error('Cannot write \"' + src + '\" after document load');\n }\n }\n\n if (opt_sourceText === undefined) {\n doc.write(\n '<script type=\"text/javascript\" src=\"' +\n src + '\"></' + 'script>');\n } else {\n doc.write(\n '<script type=\"text/javascript\">' +\n opt_sourceText + '</' + 'script>');\n }\n return true;\n } else {\n return false;\n }\n };\n\n\n /**\n * Resolves dependencies based on the dependencies added using addDependency\n * and calls importScript_ in the correct order.\n * @private\n */\n goog.writeScripts_ = function() {\n // The scripts we need to write this time.\n var scripts = [];\n var seenScript = {};\n var deps = goog.dependencies_;\n\n function visitNode(path) {\n if (path in deps.written) {\n return;\n }\n\n // We have already visited this one. We can get here if we have cyclic\n // dependencies.\n if (path in deps.visited) {\n if (!(path in seenScript)) {\n seenScript[path] = true;\n scripts.push(path);\n }\n return;\n }\n\n deps.visited[path] = true;\n\n if (path in deps.requires) {\n for (var requireName in deps.requires[path]) {\n // If the required name is defined, we assume that it was already\n // bootstrapped by other means.\n if (!goog.isProvided_(requireName)) {\n if (requireName in deps.nameToPath) {\n visitNode(deps.nameToPath[requireName]);\n } else {\n throw Error('Undefined nameToPath for ' + requireName);\n }\n }\n }\n }\n\n if (!(path in seenScript)) {\n seenScript[path] = true;\n scripts.push(path);\n }\n }\n\n for (var path in goog.included_) {\n if (!deps.written[path]) {\n visitNode(path);\n }\n }\n\n // record that we are going to load all these scripts.\n for (var i = 0; i < scripts.length; i++) {\n var path = scripts[i];\n goog.dependencies_.written[path] = true;\n }\n\n for (var i = 0; i < scripts.length; i++) {\n var path = scripts[i];\n if (path) {\n goog.importScript_(goog.basePath + path);\n }\n }\n };\n\n\n /**\n * Looks at the dependency rules and tries to determine the script file that\n * fulfills a particular rule.\n * @param {string} rule In the form goog.namespace.Class or project.script.\n * @return {?string} Url corresponding to the rule, or null.\n * @private\n */\n goog.getPathFromDeps_ = function(rule) {\n if (rule in goog.dependencies_.nameToPath) {\n return goog.dependencies_.nameToPath[rule];\n } else {\n return null;\n }\n };\n\n goog.findBasePath_();\n\n // Allow projects to manage the deps files themselves.\n if (!goog.global.CLOSURE_NO_DEPS) {\n goog.importScript_(goog.basePath + 'deps.js');\n }\n}\n\n\n\n//==============================================================================\n// Language Enhancements\n//==============================================================================\n\n\n/**\n * Returns true if the specified value is defined and not null.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is defined and not null.\n */\ngoog.isDefAndNotNull = function(val) {\n // Note that undefined == null.\n return val != null;\n};\n\n\n/**\n * Returns true if the specified value is a string.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is a string.\n */\ngoog.isString = function(val) {\n return typeof val == 'string';\n};\n\n\n/**\n * Exposes an unobfuscated global namespace path for the given object.\n * Note that fields of the exported object *will* be obfuscated, unless they are\n * exported in turn via this function or goog.exportProperty.\n *\n * Also handy for making public items that are defined in anonymous closures.\n *\n * ex. goog.exportSymbol('public.path.Foo', Foo);\n *\n * ex. goog.exportSymbol('public.path.Foo.staticFunction', Foo.staticFunction);\n * public.path.Foo.staticFunction();\n *\n * ex. goog.exportSymbol('public.path.Foo.prototype.myMethod',\n * Foo.prototype.myMethod);\n * new public.path.Foo().myMethod();\n *\n * @param {string} publicPath Unobfuscated name to export.\n * @param {*} object Object the name should point to.\n * @param {Object=} opt_objectToExportTo The object to add the path to; default\n * is goog.global.\n */\ngoog.exportSymbol = function(publicPath, object, opt_objectToExportTo) {\n goog.exportPath_(publicPath, object, opt_objectToExportTo);\n};\n\n\n/**\n * Exports a property unobfuscated into the object's namespace.\n * ex. goog.exportProperty(Foo, 'staticFunction', Foo.staticFunction);\n * ex. goog.exportProperty(Foo.prototype, 'myMethod', Foo.prototype.myMethod);\n * @param {Object} object Object whose static property is being exported.\n * @param {string} publicName Unobfuscated name to export.\n * @param {*} symbol Object the name should point to.\n */\ngoog.exportProperty = function(object, publicName, symbol) {\n object[publicName] = symbol;\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * Usage:\n * <pre>\n * function ParentClass(a, b) { }\n * ParentClass.prototype.foo = function(a) { };\n *\n * function ChildClass(a, b, c) {\n * ChildClass.base(this, 'constructor', a, b);\n * }\n * goog.inherits(ChildClass, ParentClass);\n *\n * var child = new ChildClass('a', 'b', 'see');\n * child.foo(); // This works.\n * </pre>\n *\n * @param {Function} childCtor Child class.\n * @param {Function} parentCtor Parent class.\n */\ngoog.inherits = function(childCtor, parentCtor) {\n /** @constructor */\n function tempCtor() {}\n tempCtor.prototype = parentCtor.prototype;\n childCtor.superClass_ = parentCtor.prototype;\n childCtor.prototype = new tempCtor();\n /** @override */\n childCtor.prototype.constructor = childCtor;\n\n /**\n * Calls superclass constructor/method.\n *\n * This function is only available if you use goog.inherits to\n * express inheritance relationships between classes.\n *\n * NOTE: This is a replacement for goog.base and for superClass_\n * property defined in childCtor.\n *\n * @param {!Object} me Should always be \"this\".\n * @param {string} methodName The method name to call. Calling\n * superclass constructor can be done with the special string\n * 'constructor'.\n * @param {...*} var_args The arguments to pass to superclass\n * method/constructor.\n * @return {*} The return value of the superclass method/constructor.\n */\n childCtor.base = function(me, methodName, var_args) {\n var args = Array.prototype.slice.call(arguments, 2);\n return parentCtor.prototype[methodName].apply(me, args);\n };\n};\n\n\n/*\n * To support uncompiled, strict mode bundles that use eval to divide source\n * like so:\n * eval('someSource;//# sourceUrl sourcefile.js');\n * We need to export the globally defined symbols \"goog\" and \"COMPILED\".\n * Exporting \"goog\" breaks the compiler optimizations, so we required that\n * be defined externally.\n * NOTE: We don't use goog.exportSymbol here because we don't want to trigger\n * extern generation when that compiler option is enabled.\n */\nif (!COMPILED) {\n goog.global['COMPILED'] = COMPILED;\n}\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/third_party/closure/goog/base.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastProxy');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.cast.CastSender');\ngoog.require('shaka.cast.CastUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.IDestroyable');\n\n\n\n/**\n * A proxy to switch between local and remote playback for Chromecast in a way\n * that is transparent to the app's controls.\n *\n * @constructor\n * @struct\n * @param {!HTMLMediaElement} video The local video element associated with the\n * local Player instance.\n * @param {!shaka.Player} player A local Player instance.\n * @param {string} receiverAppId The ID of the cast receiver application.\n * @implements {shaka.util.IDestroyable}\n * @extends {shaka.util.FakeEventTarget}\n * @export\n */\nshaka.cast.CastProxy = function(video, player, receiverAppId) {\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {HTMLMediaElement} */\n this.localVideo_ = video;\n\n /** @private {shaka.Player} */\n this.localPlayer_ = player;\n\n /** @private {Object} */\n this.videoProxy_ = null;\n\n /** @private {Object} */\n this.playerProxy_ = null;\n\n /** @private {shaka.util.FakeEventTarget} */\n this.videoEventTarget_ = null;\n\n /** @private {shaka.util.FakeEventTarget} */\n this.playerEventTarget_ = null;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = null;\n\n /** @private {shaka.cast.CastSender} */\n this.sender_ = new shaka.cast.CastSender(\n receiverAppId,\n this.onCastStatusChanged_.bind(this),\n this.onRemoteEvent_.bind(this),\n this.onResumeLocal_.bind(this),\n this.getInitState_.bind(this));\n\n this.init_();\n};\ngoog.inherits(shaka.cast.CastProxy, shaka.util.FakeEventTarget);\n\n\n/**\n * Destroys the proxy and the underlying local Player.\n *\n * @param {boolean=} opt_forceDisconnect If true, force the receiver app to shut\n * down by disconnecting. Does nothing if not connected.\n * @override\n * @export\n */\nshaka.cast.CastProxy.prototype.destroy = function(opt_forceDisconnect) {\n if (opt_forceDisconnect && this.sender_) {\n this.sender_.forceDisconnect();\n }\n\n var async = [\n this.eventManager_ ? this.eventManager_.destroy() : null,\n this.localPlayer_ ? this.localPlayer_.destroy() : null,\n this.sender_ ? this.sender_.destroy() : null\n ];\n\n this.localVideo_ = null;\n this.localPlayer_ = null;\n this.videoProxy_ = null;\n this.playerProxy_ = null;\n this.eventManager_ = null;\n this.sender_ = null;\n\n return Promise.all(async);\n};\n\n\n/**\n * @event shaka.cast.CastProxy.CastStatusChangedEvent\n * @description Fired when cast status changes. The status change will be\n * reflected in canCast() and isCasting().\n * @property {string} type\n * 'caststatuschanged'\n * @exportDoc\n */\n\n\n/**\n * Get a proxy for the video element that delegates to local and remote video\n * elements as appropriate.\n *\n * @suppress {invalidCasts} to cast proxy Objects to unrelated types\n * @return {HTMLMediaElement}\n * @export\n */\nshaka.cast.CastProxy.prototype.getVideo = function() {\n return /** @type {HTMLMediaElement} */(this.videoProxy_);\n};\n\n\n/**\n * Get a proxy for the Player that delegates to local and remote Player objects\n * as appropriate.\n *\n * @suppress {invalidCasts} to cast proxy Objects to unrelated types\n * @return {shaka.Player}\n * @export\n */\nshaka.cast.CastProxy.prototype.getPlayer = function() {\n return /** @type {shaka.Player} */(this.playerProxy_);\n};\n\n\n/**\n * @return {boolean} True if the cast API is available and there are receivers.\n * @export\n */\nshaka.cast.CastProxy.prototype.canCast = function() {\n return this.sender_ ?\n this.sender_.apiReady() && this.sender_.hasReceivers() :\n false;\n};\n\n\n/**\n * @return {boolean} True if we are currently casting.\n * @export\n */\nshaka.cast.CastProxy.prototype.isCasting = function() {\n return this.sender_ ? this.sender_.isCasting() : false;\n};\n\n\n/**\n * @return {string} The name of the Cast receiver device, if isCasting().\n * @export\n */\nshaka.cast.CastProxy.prototype.receiverName = function() {\n return this.sender_ ? this.sender_.receiverName() : '';\n};\n\n\n/**\n * @return {!Promise} Resolved when connected to a receiver. Rejected if the\n * connection fails or is canceled by the user.\n * @export\n */\nshaka.cast.CastProxy.prototype.cast = function() {\n var initState = this.getInitState_();\n\n // TODO: transfer manually-selected tracks?\n // TODO: transfer side-loaded text tracks?\n\n return this.sender_.cast(initState).then(function() {\n // Unload the local manifest when casting succeeds.\n return this.localPlayer_.unload();\n }.bind(this));\n};\n\n\n/**\n * Set application-specific data.\n *\n * @param {Object} appData Application-specific data to relay to the receiver.\n * @export\n */\nshaka.cast.CastProxy.prototype.setAppData = function(appData) {\n this.sender_.setAppData(appData);\n};\n\n\n/**\n * Show a dialog where user can choose to disconnect from the cast connection.\n * @export\n */\nshaka.cast.CastProxy.prototype.suggestDisconnect = function() {\n this.sender_.showDisconnectDialog();\n};\n\n\n/**\n * Force the receiver app to shut down by disconnecting.\n * @export\n */\nshaka.cast.CastProxy.prototype.forceDisconnect = function() {\n this.sender_.forceDisconnect();\n};\n\n\n/**\n * Initialize the Proxies and the Cast sender.\n * @private\n */\nshaka.cast.CastProxy.prototype.init_ = function() {\n this.sender_.init();\n\n this.eventManager_ = new shaka.util.EventManager();\n\n shaka.cast.CastUtils.VideoEvents.forEach(function(name) {\n this.eventManager_.listen(this.localVideo_, name,\n this.videoProxyLocalEvent_.bind(this));\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerEvents.forEach(function(name) {\n this.eventManager_.listen(this.localPlayer_, name,\n this.playerProxyLocalEvent_.bind(this));\n }.bind(this));\n\n // We would like to use Proxy here, but it is not supported on IE11 or Safari.\n this.videoProxy_ = {};\n for (var k in this.localVideo_) {\n Object.defineProperty(this.videoProxy_, k, {\n configurable: false,\n enumerable: true,\n get: this.videoProxyGet_.bind(this, k),\n set: this.videoProxySet_.bind(this, k)\n });\n }\n\n this.playerProxy_ = {};\n for (var k in /** @type {Object} */(this.localPlayer_)) {\n Object.defineProperty(this.playerProxy_, k, {\n configurable: false,\n enumerable: true,\n get: this.playerProxyGet_.bind(this, k)\n });\n }\n\n this.videoEventTarget_ = new shaka.util.FakeEventTarget();\n this.videoEventTarget_.dispatchTarget =\n /** @type {EventTarget} */(this.videoProxy_);\n\n this.playerEventTarget_ = new shaka.util.FakeEventTarget();\n this.playerEventTarget_.dispatchTarget =\n /** @type {EventTarget} */(this.playerProxy_);\n};\n\n\n/**\n * @return {shaka.cast.CastUtils.InitStateType} initState Video and player state\n * to be sent to the receiver.\n * @private\n */\nshaka.cast.CastProxy.prototype.getInitState_ = function() {\n var initState = {\n 'video': {},\n 'player': {},\n 'playerAfterLoad': {},\n 'manifest': this.localPlayer_.getManifestUri(),\n 'startTime': null\n };\n\n // Pause local playback before capturing state.\n this.localVideo_.pause();\n\n shaka.cast.CastUtils.VideoInitStateAttributes.forEach(function(name) {\n initState['video'][name] = this.localVideo_[name];\n }.bind(this));\n\n // If the video is still playing, set the startTime.\n // Has no effect if nothing is loaded.\n if (!this.localVideo_.ended) {\n initState['startTime'] = this.localVideo_.currentTime;\n }\n\n shaka.cast.CastUtils.PlayerInitState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = /** @type {Object} */(this.localPlayer_)[getter]();\n\n initState['player'][setter] = value;\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerInitAfterLoadState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = /** @type {Object} */(this.localPlayer_)[getter]();\n\n initState['playerAfterLoad'][setter] = value;\n }.bind(this));\n\n return initState;\n};\n\n\n/**\n * Dispatch an event to notify the app that the status has changed.\n * @private\n */\nshaka.cast.CastProxy.prototype.onCastStatusChanged_ = function() {\n var event = new shaka.util.FakeEvent('caststatuschanged');\n this.dispatchEvent(event);\n};\n\n\n/**\n * Transfer remote state back and resume local playback.\n * @private\n */\nshaka.cast.CastProxy.prototype.onResumeLocal_ = function() {\n // Transfer back the player state.\n shaka.cast.CastUtils.PlayerInitState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = this.sender_.get('player', getter)();\n /** @type {Object} */(this.localPlayer_)[setter](value);\n }.bind(this));\n\n // Get the most recent manifest URI and ended state.\n var manifestUri = this.sender_.get('player', 'getManifestUri')();\n var ended = this.sender_.get('video', 'ended');\n\n var manifestReady = Promise.resolve();\n var autoplay = this.localVideo_.autoplay;\n\n var startTime = null;\n\n // If the video is still playing, set the startTime.\n // Has no effect if nothing is loaded.\n if (!ended) {\n startTime = this.sender_.get('video', 'currentTime');\n }\n\n // Now load the manifest, if present.\n if (manifestUri) {\n // Don't autoplay the content until we finish setting up initial state.\n this.localVideo_.autoplay = false;\n manifestReady = this.localPlayer_.load(manifestUri, startTime);\n // Pass any errors through to the app.\n manifestReady.catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong error type!');\n var event = new shaka.util.FakeEvent('error', { 'detail': error });\n this.localPlayer_.dispatchEvent(event);\n }.bind(this));\n }\n\n // Get the video state into a temp variable since we will apply it async.\n var videoState = {};\n shaka.cast.CastUtils.VideoInitStateAttributes.forEach(function(name) {\n videoState[name] = this.sender_.get('video', name);\n }.bind(this));\n\n // Finally, take on video state and player's \"after load\" state.\n manifestReady.then(function() {\n shaka.cast.CastUtils.VideoInitStateAttributes.forEach(function(name) {\n this.localVideo_[name] = videoState[name];\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerInitAfterLoadState.forEach(function(pair) {\n var getter = pair[0];\n var setter = pair[1];\n var value = this.sender_.get('player', getter)();\n /** @type {Object} */(this.localPlayer_)[setter](value);\n }.bind(this));\n\n // Restore original autoplay setting.\n this.localVideo_.autoplay = autoplay;\n if (manifestUri) {\n // Resume playback with transferred state.\n this.localVideo_.play();\n }\n }.bind(this));\n};\n\n\n/**\n * @param {string} name\n * @return {?}\n * @private\n */\nshaka.cast.CastProxy.prototype.videoProxyGet_ = function(name) {\n if (name == 'addEventListener') {\n return this.videoEventTarget_.addEventListener.bind(\n this.videoEventTarget_);\n }\n if (name == 'removeEventListener') {\n return this.videoEventTarget_.removeEventListener.bind(\n this.videoEventTarget_);\n }\n\n // If we are casting, but the first update has not come in yet, use local\n // values, but not local methods.\n if (this.sender_.isCasting() && !this.sender_.hasRemoteProperties()) {\n var value = this.localVideo_[name];\n if (typeof value != 'function') {\n return value;\n }\n }\n\n // Use local values and methods if we are not casting.\n if (!this.sender_.isCasting()) {\n var value = this.localVideo_[name];\n if (typeof value == 'function') {\n value = value.bind(this.localVideo_);\n }\n return value;\n }\n\n return this.sender_.get('video', name);\n};\n\n\n/**\n * @param {string} name\n * @param {?} value\n * @private\n */\nshaka.cast.CastProxy.prototype.videoProxySet_ = function(name, value) {\n if (!this.sender_.isCasting()) {\n this.localVideo_[name] = value;\n return;\n }\n\n this.sender_.set('video', name, value);\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.cast.CastProxy.prototype.videoProxyLocalEvent_ = function(event) {\n if (this.sender_.isCasting()) {\n // Ignore any unexpected local events while casting. Events can still be\n // fired by the local video and Player when we unload() after the Cast\n // connection is complete.\n return;\n }\n\n // Convert this real Event into a FakeEvent for dispatch from our\n // FakeEventListener.\n var fakeEvent = new shaka.util.FakeEvent(event.type, event);\n this.videoEventTarget_.dispatchEvent(fakeEvent);\n};\n\n\n/**\n * @param {string} name\n * @return {?}\n * @private\n */\nshaka.cast.CastProxy.prototype.playerProxyGet_ = function(name) {\n if (name == 'addEventListener') {\n return this.playerEventTarget_.addEventListener.bind(\n this.playerEventTarget_);\n }\n if (name == 'removeEventListener') {\n return this.playerEventTarget_.removeEventListener.bind(\n this.playerEventTarget_);\n }\n\n if (name == 'getNetworkingEngine') {\n // Always returns a local instance, in case you need to make a request.\n // Issues a warning, in case you think you are making a remote request\n // or affecting remote filters.\n if (this.sender_.isCasting()) {\n shaka.log.warning('NOTE: getNetworkingEngine() is always local!');\n }\n return this.localPlayer_.getNetworkingEngine.bind(this.localPlayer_);\n }\n\n // If we are casting, but the first update has not come in yet, use local\n // getters, but not local methods.\n if (this.sender_.isCasting() && !this.sender_.hasRemoteProperties()) {\n if (shaka.cast.CastUtils.PlayerGetterMethods.indexOf(name) >= 0) {\n var value = /** @type {Object} */(this.localPlayer_)[name];\n goog.asserts.assert(typeof value == 'function', 'only methods on Player');\n return value.bind(this.localPlayer_);\n }\n }\n\n // Use local getters and methods if we are not casting.\n if (!this.sender_.isCasting()) {\n var value = /** @type {Object} */(this.localPlayer_)[name];\n goog.asserts.assert(typeof value == 'function', 'only methods on Player');\n return value.bind(this.localPlayer_);\n }\n\n return this.sender_.get('player', name);\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.cast.CastProxy.prototype.playerProxyLocalEvent_ = function(event) {\n if (this.sender_.isCasting()) {\n // Ignore any unexpected local events while casting.\n return;\n }\n\n this.playerEventTarget_.dispatchEvent(event);\n};\n\n\n/**\n * @param {string} targetName\n * @param {!shaka.util.FakeEvent} event\n * @private\n */\nshaka.cast.CastProxy.prototype.onRemoteEvent_ = function(targetName, event) {\n goog.asserts.assert(this.sender_.isCasting(),\n 'Should only receive remote events while casting');\n if (!this.sender_.isCasting()) {\n // Ignore any unexpected remote events.\n return;\n }\n\n if (targetName == 'video') {\n this.videoEventTarget_.dispatchEvent(event);\n } else if (targetName == 'player') {\n this.playerEventTarget_.dispatchEvent(event);\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_proxy.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.abr.Ewma');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Computes an exponentionally-weighted moving average.\n *\n * @param {number} halfLife About half of the estimated value will be from the\n * last |halfLife| samples by weight.\n * @struct\n * @constructor\n */\nshaka.abr.Ewma = function(halfLife) {\n goog.asserts.assert(halfLife > 0, 'expected halfLife to be positive');\n\n /**\n * Larger values of alpha expire historical data more slowly.\n * @private {number}\n */\n this.alpha_ = Math.exp(Math.log(0.5) / halfLife);\n\n /** @private {number} */\n this.estimate_ = 0;\n\n /** @private {number} */\n this.totalWeight_ = 0;\n};\n\n\n/**\n * Takes a sample.\n *\n * @param {number} weight\n * @param {number} value\n */\nshaka.abr.Ewma.prototype.sample = function(weight, value) {\n var adjAlpha = Math.pow(this.alpha_, weight);\n var newEstimate = value * (1 - adjAlpha) + adjAlpha * this.estimate_;\n\n if (!isNaN(newEstimate)) {\n this.estimate_ = newEstimate;\n this.totalWeight_ += weight;\n }\n};\n\n\n/**\n * @return {number}\n */\nshaka.abr.Ewma.prototype.getEstimate = function() {\n var zeroFactor = 1 - Math.pow(this.alpha_, this.totalWeight_);\n return this.estimate_ / zeroFactor;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/abr/ewma.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.abr.EwmaBandwidthEstimator');\n\ngoog.require('shaka.abr.Ewma');\n\n\n\n/**\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 * @constructor\n * @struct\n */\nshaka.abr.EwmaBandwidthEstimator = function() {\n /**\n * A fast-moving average.\n * Half of the estimate is based on the last 2 seconds of sample history.\n * @private {!shaka.abr.Ewma}\n */\n this.fast_ = new shaka.abr.Ewma(2);\n\n /**\n * A slow-moving average.\n * Half of the estimate is based on the last 5 seconds of sample history.\n * @private {!shaka.abr.Ewma}\n */\n this.slow_ = new shaka.abr.Ewma(5);\n\n /**\n * Number of bytes sampled.\n * @private {number}\n */\n this.bytesSampled_ = 0;\n\n /**\n * Initial estimate used when there is not enough data.\n * @see shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE\n * @private {number}\n */\n this.defaultEstimate_ = shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE;\n\n /**\n * Minimum number of bytes sampled before we trust the estimate. If we have\n * not sampled much data, our estimate may not be accurate enough to trust.\n * If bytesSampled_ is less than minTotalBytes_, we use defaultEstimate_.\n * This specific value is based on experimentation.\n *\n * @private {number}\n * @const\n */\n this.minTotalBytes_ = 128e3; // 128kB\n\n /**\n * Minimum number of bytes, under which samples are discarded. Our models do\n * not include latency information, so connection startup time (time to first\n * byte) is considered part of the download time. Because of this, we should\n * ignore very small downloads which would cause our estimate to be too low.\n * This specific value is based on experimentation.\n *\n * @private {number}\n * @const\n */\n this.minBytes_ = 16e3; // 16kB\n};\n\n\n/**\n * Contains the default estimate to use when there is not enough data.\n * This is a relatively safe default, since 3G cell connections are faster than\n * this. For slower connections, such as 2G, the default estimate may be too\n * high. This default can be changed at runtime using\n * {@link shaka.Player#configure} and {@link shakaExtern.AbrConfiguration}.\n * @const {number}\n */\nshaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE = 500e3; // 500kbps\n\n\n/**\n * Takes a bandwidth sample.\n *\n * @param {number} durationMs The amount of time, in milliseconds, for a\n * particular request.\n * @param {number} numBytes The total number of bytes transferred in that\n * request.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.sample = function(\n durationMs, numBytes) {\n if (numBytes < this.minBytes_) {\n return;\n }\n\n var bandwidth = 8000 * numBytes / durationMs;\n var weight = durationMs / 1000;\n\n this.bytesSampled_ += numBytes;\n this.fast_.sample(weight, bandwidth);\n this.slow_.sample(weight, bandwidth);\n};\n\n\n/**\n * Sets the default bandwidth estimate to use if there is not enough data.\n *\n * @param {number} estimate The default bandwidth estimate, in bit/sec.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.setDefaultEstimate = function(\n estimate) {\n this.defaultEstimate_ = estimate;\n};\n\n\n/**\n * Gets the current bandwidth estimate.\n *\n * @return {number} The bandwidth estimate in bits per second.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.getBandwidthEstimate = function() {\n if (this.bytesSampled_ < this.minTotalBytes_) {\n return this.defaultEstimate_;\n }\n\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};\n\n\n/**\n * @return {boolean} True if there is enough data to produce a meaningful\n * estimate.\n */\nshaka.abr.EwmaBandwidthEstimator.prototype.hasGoodEstimate = function() {\n return this.bytesSampled_ >= this.minTotalBytes_;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/abr/ewma_bandwidth_estimator.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.log');\n\n\n/**\n * @namespace shaka.log\n * @summary\n * A console logging framework which is compiled out for deployment. This is\n * only available when using the uncompiled version.\n * @exportDoc\n */\n\n\n/**\n * Log levels.\n * @enum {number}\n * @exportDoc\n */\nshaka.log.Level = {\n NONE: 0,\n ERROR: 1,\n WARNING: 2,\n INFO: 3,\n DEBUG: 4,\n V1: 5,\n V2: 6\n};\n\n\n/**\n * @define {number} the maximum log level.\n */\ngoog.define('shaka.log.MAX_LOG_LEVEL', 3);\n\n\n/** @type {function(*, ...*)} */\nshaka.log.error = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.warning = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.info = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.debug = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.v1 = function() {};\n\n\n/** @type {function(*, ...*)} */\nshaka.log.v2 = function() {};\n\n\n// IE8 has no console unless it is opened in advance.\n// IE9 console methods are not Functions and have no bind.\nif (window.console && window.console.log.bind) {\n if (!COMPILED) {\n /** @type {number} */\n shaka.log.currentLevel;\n\n /**\n * Change the log level. Useful for debugging in uncompiled mode.\n *\n * @param {number} level\n * @exportDoc\n */\n shaka.log.setLevel = function(level) {\n var nop = function() {};\n var log = shaka.log;\n var Level = shaka.log.Level;\n\n shaka.log.currentLevel = level;\n\n log.error = (level >= Level.ERROR) ? console.error.bind(console) : nop;\n log.warning = (level >= Level.WARNING) ? console.warn.bind(console) : nop;\n log.info = (level >= Level.INFO) ? console.info.bind(console) : nop;\n log.debug = (level >= Level.DEBUG) ? console.log.bind(console) : nop;\n log.v1 = (level >= Level.V1) ? console.debug.bind(console) : nop;\n log.v2 = (level >= Level.V2) ? console.debug.bind(console) : nop;\n };\n\n shaka.log.setLevel(shaka.log.MAX_LOG_LEVEL);\n } else {\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.ERROR) {\n shaka.log.error = console.error.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.WARNING) {\n shaka.log.warning = console.warn.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.INFO) {\n shaka.log.info = console.info.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.DEBUG) {\n shaka.log.debug = console.log.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.V1) {\n shaka.log.v1 = console.debug.bind(console);\n }\n if (shaka.log.MAX_LOG_LEVEL >= shaka.log.Level.V2) {\n shaka.log.v2 = console.debug.bind(console);\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/debug/log.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Error');\n\n\n\n/**\n * Creates a new Error.\n *\n * @param {shaka.util.Error.Severity} severity\n * @param {shaka.util.Error.Category} category\n * @param {shaka.util.Error.Code} code\n * @param {...*} var_args\n *\n * @constructor\n * @struct\n * @export\n * @extends {Error}\n */\nshaka.util.Error = function(severity, category, code, var_args) {\n this.severity = severity;\n this.category = category;\n this.code = code;\n this.data = Array.prototype.slice.call(arguments, 3);\n\n // This improves formatting of Errors in failure messages in the tests.\n if (!COMPILED) {\n var categoryName = 'UNKNOWN';\n var codeName = 'UNKNOWN';\n\n for (var k in shaka.util.Error.Category) {\n if (shaka.util.Error.Category[k] == this.category)\n categoryName = k;\n }\n for (var k in shaka.util.Error.Code) {\n if (shaka.util.Error.Code[k] == this.code)\n codeName = k;\n }\n\n /**\n * A human-readable version of the category and code.\n * <i>(Only available in uncompiled mode.)</i>\n *\n * @const {string}\n * @exportDoc\n */\n this.message = 'Shaka Error ' + categoryName + '.' + codeName +\n ' (' + this.data.toString() + ')';\n try {\n throw new Error(this.message);\n } catch (e) {\n /**\n * A stack-trace showing where the error occurred.\n * <i>(Only available in uncompiled mode.)</i>\n *\n * @const {string}\n * @exportDoc\n */\n this.stack = e.stack;\n }\n }\n};\n\n\n/**\n * @type {shaka.util.Error.Severity}\n * @expose\n */\nshaka.util.Error.prototype.severity;\n\n\n/**\n * @const {shaka.util.Error.Category}\n * @expose\n */\nshaka.util.Error.prototype.category;\n\n\n/**\n * @const {shaka.util.Error.Code}\n * @expose\n */\nshaka.util.Error.prototype.code;\n\n\n/**\n * @const {!Array.<*>}\n * @expose\n */\nshaka.util.Error.prototype.data;\n\n\n/**\n * @return {string}\n * @override\n */\nshaka.util.Error.prototype.toString = function() {\n return 'shaka.util.Error ' + JSON.stringify(this, null, ' ');\n};\n\n\n/**\n * @enum {number}\n * @export\n */\nshaka.util.Error.Severity = {\n /**\n * An error occurred, but the Player is attempting to recover from the error.\n *\n * If the Player cannot ultimately recover, it still may not throw a CRITICAL\n * error. For example, retrying for a media segment will never result in\n * a CRITICAL error (the Player will just retry forever).\n */\n 'RECOVERABLE': 1,\n\n /**\n * A critical error that the library cannot recover from. These usually cause\n * the Player to stop loading or updating. A new manifest must be loaded\n * to reset the library.\n */\n 'CRITICAL': 2\n};\n\n\n/**\n * @enum {number}\n * @export\n */\nshaka.util.Error.Category = {\n /** Errors from the network stack. */\n 'NETWORK': 1,\n\n /** Errors parsing text streams. */\n 'TEXT': 2,\n\n /** Errors parsing or processing audio or video streams. */\n 'MEDIA': 3,\n\n /** Errors parsing the Manifest. */\n 'MANIFEST': 4,\n\n /** Errors related to streaming. */\n 'STREAMING': 5,\n\n /** Errors related to DRM. */\n 'DRM': 6,\n\n /** Miscellaneous errors from the player. */\n 'PLAYER': 7,\n\n /** Errors related to cast. */\n 'CAST': 8,\n\n /** Errors in the database storage (offline). */\n 'STORAGE': 9\n};\n\n\n/**\n * @enum {number}\n * @export\n */\nshaka.util.Error.Code = {\n /**\n * A network request was made using an unsupported URI scheme.\n * <br> error.data[0] is the URI.\n */\n 'UNSUPPORTED_SCHEME': 1000,\n\n /**\n * An HTTP network request returned an HTTP status that indicated a failure.\n * <br> error.data[0] is the URI.\n * <br> error.data[1] is the status code.\n * <br> error.data[2] is the response text, or null if the response could not\n * be interpretted as text.\n * <br> error.data[3] is the map of response headers.\n */\n 'BAD_HTTP_STATUS': 1001,\n\n /**\n * An HTTP network request failed with an error, but not from the server.\n * <br> error.data[0] is the URI.\n */\n 'HTTP_ERROR': 1002,\n\n /**\n * A network request timed out.\n * <br> error.data[0] is the URI.\n */\n 'TIMEOUT': 1003,\n\n /**\n * A network request was made with a malformed data URI.\n * <br> error.data[0] is the URI.\n */\n 'MALFORMED_DATA_URI': 1004,\n\n /**\n * A network request was made with a data URI using an unknown encoding.\n * <br> error.data[0] is the URI.\n */\n 'UNKNOWN_DATA_URI_ENCODING': 1005,\n\n /**\n * A request filter threw an error.\n * <br> error.data[0] is the original error.\n */\n 'REQUEST_FILTER_ERROR': 1006,\n\n /**\n * A response filter threw an error.\n * <br> error.data[0] is the original error.\n */\n 'RESPONSE_FILTER_ERROR': 1007,\n\n\n /** The text parser failed to parse a text stream due to an invalid header. */\n 'INVALID_TEXT_HEADER': 2000,\n\n /** The text parser failed to parse a text stream due to an invalid cue. */\n 'INVALID_TEXT_CUE': 2001,\n\n // RETIRED: 'INVALID_TEXT_SETTINGS': 2002,\n\n /**\n * Was unable to detect the encoding of the response text. Suggest adding\n * byte-order-markings to the response data.\n */\n 'UNABLE_TO_DETECT_ENCODING': 2003,\n\n /** The response data contains invalid Unicode character encoding. */\n 'BAD_ENCODING': 2004,\n\n /**\n * The XML parser failed to parse an xml stream, or the XML lacks mandatory\n * elements for TTML.\n */\n 'INVALID_XML': 2005,\n\n // RETIRED: 'INVALID_TTML': 2006,\n\n /**\n * MP4 segment does not contain TTML.\n */\n 'INVALID_MP4_TTML': 2007,\n\n /**\n * MP4 segment does not contain VTT.\n */\n 'INVALID_MP4_VTT': 2008,\n\n\n /**\n * Some component tried to read past the end of a buffer. The segment index,\n * init segment, or PSSH may be malformed.\n */\n 'BUFFER_READ_OUT_OF_BOUNDS': 3000,\n\n /**\n * Some component tried to parse an integer that was too large to fit in a\n * JavaScript number without rounding error. JavaScript can only natively\n * represent integers up to 53 bits.\n */\n 'JS_INTEGER_OVERFLOW': 3001,\n\n /**\n * The EBML parser used to parse the WebM container encountered an integer,\n * ID, or other field larger than the maximum supported by the parser.\n */\n 'EBML_OVERFLOW': 3002,\n\n /**\n * The EBML parser used to parse the WebM container encountered a floating-\n * point field of a size not supported by the parser.\n */\n 'EBML_BAD_FLOATING_POINT_SIZE': 3003,\n\n /**\n * The MP4 SIDX parser found the wrong box type.\n * Either the segment index range is incorrect or the data is corrupt.\n */\n 'MP4_SIDX_WRONG_BOX_TYPE': 3004,\n\n /**\n * The MP4 SIDX parser encountered an invalid timescale.\n * The segment index data may be corrupt.\n */\n 'MP4_SIDX_INVALID_TIMESCALE': 3005,\n\n /** The MP4 SIDX parser encountered a type of SIDX that is not supported. */\n 'MP4_SIDX_TYPE_NOT_SUPPORTED': 3006,\n\n /**\n * The WebM Cues parser was unable to locate the Cues element.\n * The segment index data may be corrupt.\n */\n 'WEBM_CUES_ELEMENT_MISSING': 3007,\n\n /**\n * The WebM header parser was unable to locate the Ebml element.\n * The init segment data may be corrupt.\n */\n 'WEBM_EBML_HEADER_ELEMENT_MISSING': 3008,\n\n /**\n * The WebM header parser was unable to locate the Segment element.\n * The init segment data may be corrupt.\n */\n 'WEBM_SEGMENT_ELEMENT_MISSING': 3009,\n\n /**\n * The WebM header parser was unable to locate the Info element.\n * The init segment data may be corrupt.\n */\n 'WEBM_INFO_ELEMENT_MISSING': 3010,\n\n /**\n * The WebM header parser was unable to locate the Duration element.\n * The init segment data may be corrupt or may have been incorrectly encoded.\n * Shaka requires a duration in WebM DASH content.\n */\n 'WEBM_DURATION_ELEMENT_MISSING': 3011,\n\n /**\n * The WebM Cues parser was unable to locate the Cue Track Positions element.\n * The segment index data may be corrupt.\n */\n 'WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING': 3012,\n\n /**\n * The WebM Cues parser was unable to locate the Cue Time element.\n * The segment index data may be corrupt.\n */\n 'WEBM_CUE_TIME_ELEMENT_MISSING': 3013,\n\n /**\n * A MediaSource operation failed.\n * <br> error.data[0] is a MediaError code from the video element.\n */\n 'MEDIA_SOURCE_OPERATION_FAILED': 3014,\n\n /**\n * A MediaSource operation threw an exception.\n * <br> error.data[0] is the exception that was thrown.\n */\n 'MEDIA_SOURCE_OPERATION_THREW': 3015,\n\n /**\n * The video element reported an error.\n * <br> error.data[0] is a MediaError code from the video element.\n * <br> On Edge & IE, error.data[1] is a Microsoft extended error code in hex.\n */\n 'VIDEO_ERROR': 3016,\n\n /**\n * A MediaSource operation threw QuotaExceededError and recovery failed. The\n * content cannot be played correctly because the segments are too large for\n * the browser/platform. This may occur when attempting to play very high\n * quality, very high bitrate content on low-end devices.\n * <br> error.data[0] is the type of content which caused the error.\n */\n 'QUOTA_EXCEEDED_ERROR': 3017,\n\n\n /**\n * The Player was unable to guess the manifest type based on file extension\n * or MIME type. To fix, try one of the following:\n * <br><ul>\n * <li>Rename the manifest so that the URI ends in a well-known extension.\n * <li>Configure the server to send a recognizable Content-Type header.\n * <li>Configure the server to accept a HEAD request for the manifest.\n * </ul>\n * <br> error.data[0] is the manifest URI.\n */\n 'UNABLE_TO_GUESS_MANIFEST_TYPE': 4000,\n\n /** The DASH Manifest contained invalid XML markup. */\n 'DASH_INVALID_XML': 4001,\n\n /**\n * The DASH Manifest contained a Representation with insufficient segment\n * information.\n */\n 'DASH_NO_SEGMENT_INFO': 4002,\n\n /** The DASH Manifest contained an AdaptationSet with no Representations. */\n 'DASH_EMPTY_ADAPTATION_SET': 4003,\n\n /** The DASH Manifest contained an Period with no AdaptationSets. */\n 'DASH_EMPTY_PERIOD': 4004,\n\n /**\n * The DASH Manifest does not specify an init segment with a WebM container.\n */\n 'DASH_WEBM_MISSING_INIT': 4005,\n\n /** The DASH Manifest contained an unsupported container format. */\n 'DASH_UNSUPPORTED_CONTAINER': 4006,\n\n /** The embedded PSSH data has invalid encoding. */\n 'DASH_PSSH_BAD_ENCODING': 4007,\n\n /**\n * There is an AdaptationSet whose Representations do not have any common\n * key-systems.\n */\n 'DASH_NO_COMMON_KEY_SYSTEM': 4008,\n\n /** Having multiple key IDs per Representation is not supported. */\n 'DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED': 4009,\n\n /** The DASH Manifest specifies conflicting key IDs. */\n 'DASH_CONFLICTING_KEY_IDS': 4010,\n\n /**\n * The manifest contains a period with no playable streams.\n * Either the period was originally empty, or the streams within cannot be\n * played on this browser or platform.\n */\n 'UNPLAYABLE_PERIOD': 4011,\n\n /**\n * There exist some streams that could be decoded, but restrictions imposed\n * by the application or the key system prevent us from playing. This may\n * happen under the following conditions:\n * <ul>\n * <li>The application has given restrictions to the Player that restrict\n * at least one content type completely (e.g. no playable audio).\n * <li>The key system has imposed output restrictions that cannot be met\n * (such as HDCP) and there are no unrestricted alternatives.\n * </ul>\n */\n 'RESTRICTIONS_CANNOT_BE_MET': 4012,\n\n // RETIRED: 'INTERNAL_ERROR_KEY_STATUS': 4013,\n\n /**\n * No valid periods were found in the manifest. Please check that your\n * manifest is correct and free of typos.\n */\n 'NO_PERIODS': 4014,\n\n /**\n * HLS playlist doesn't start with a mandory #EXTM3U tag.\n */\n 'HLS_PLAYLIST_HEADER_MISSING': 4015,\n\n /**\n * HLS tag has an invalid name that doesn't start with '#EXT'\n */\n 'INVALID_HLS_TAG': 4016,\n\n /**\n * HLS playlist has both Master and Media/Segment tags.\n */\n 'HLS_INVALID_PLAYLIST_HIERARCHY': 4017,\n\n /**\n * A Representation has an id that is the same as another Representation in\n * the same Period. This makes manifest updates impossible since we cannot\n * map the updated Representation to the old one.\n */\n 'DASH_DUPLICATE_REPRESENTATION_ID': 4018,\n\n // RETIRED: 'HLS_MEDIA_INIT_SECTION_INFO_MISSING': 4019,\n\n /**\n * HLS manifest has several #EXT-X-MAP tags. We can only\n * support one at the moment.\n */\n 'HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND': 4020,\n\n /**\n * HLS parser was unable to guess mime type of a stream.\n * <br> error.data[0] is the stream file's extension.\n */\n 'HLS_COULD_NOT_GUESS_MIME_TYPE': 4021,\n\n /**\n * No Master Playlist has been provided. Master playlist provides\n * vital information about the streams (like codecs) that is\n * required for MediaSource. We don't support directly providing\n * a Media Playlist.\n */\n 'HLS_MASTER_PLAYLIST_NOT_PROVIDED': 4022,\n\n /**\n * One of the required attributes was not provided.\n * HLS manifest is invalid.\n * <br> error.data[0] is the missing attribute's name.\n */\n 'HLS_REQUIRED_ATTRIBUTE_MISSING': 4023,\n\n /**\n * One of the required tags was not provided.\n * HLS manifest is invalid.\n * <br> error.data[0] is the missing tag's name.\n */\n 'HLS_REQUIRED_TAG_MISSING': 4024,\n\n /**\n * HLS parser was unable to guess codecs of a stream.\n * <br> error.data[0] is the list of all codecs for the variant.\n */\n 'HLS_COULD_NOT_GUESS_CODECS': 4025,\n\n /**\n * HLS parser has encountered encrypted content with unsupported\n * KEYFORMAT attributes.\n */\n 'HLS_KEYFORMATS_NOT_SUPPORTED': 4026,\n\n\n // RETIRED: 'INCONSISTENT_BUFFER_STATE': 5000,\n // RETIRED: 'INVALID_SEGMENT_INDEX': 5001,\n // RETIRED: 'SEGMENT_DOES_NOT_EXIST': 5002,\n // RETIRED: 'CANNOT_SATISFY_BYTE_LIMIT': 5003,\n // RETIRED: 'BAD_SEGMENT': 5004,\n\n /**\n * The StreamingEngine called onChooseStreams() but the callback receiver\n * did not return the correct number or type of Streams.\n *\n * This can happen when there is multi-Period content where one Period is\n * video+audio and another is video-only or audio-only. We don't support this\n * case because it is incompatible with MSE. When the browser reaches the\n * transition, it will pause, waiting for the audio stream.\n */\n 'INVALID_STREAMS_CHOSEN': 5005,\n\n\n /**\n * The manifest indicated protected content, but the manifest parser was\n * unable to determine what key systems should be used.\n */\n 'NO_RECOGNIZED_KEY_SYSTEMS': 6000,\n\n /**\n * None of the requested key system configurations are available. This may\n * happen under the following conditions:\n * <ul>\n * <li> The key system is not supported.\n * <li> The key system does not support the features requested (e.g.\n * persistent state).\n * <li> A user prompt was shown and the user denied access.\n * <li> The key system is not available from unsecure contexts. (ie.\n requires HTTPS) See https://goo.gl/EEhZqT.\n * </ul>\n */\n 'REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE': 6001,\n\n /**\n * The browser found one of the requested key systems, but it failed to\n * create an instance of the CDM for some unknown reason.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_CREATE_CDM': 6002,\n\n /**\n * The browser found one of the requested key systems and created an instance\n * of the CDM, but it failed to attach the CDM to the video for some unknown\n * reason.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_ATTACH_TO_VIDEO': 6003,\n\n /**\n * The CDM rejected the server certificate supplied by the application.\n * The certificate may be malformed or in an unsupported format.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'INVALID_SERVER_CERTIFICATE': 6004,\n\n /**\n * The CDM refused to create a session for some unknown reason.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_CREATE_SESSION': 6005,\n\n /**\n * The CDM was unable to generate a license request for the init data it was\n * given. The init data may be malformed or in an unsupported format.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'FAILED_TO_GENERATE_LICENSE_REQUEST': 6006,\n\n /**\n * The license request failed. This could be a timeout, a network failure, or\n * a rejection by the server.\n * <br> error.data[0] is a shaka.util.Error from the networking engine.\n */\n 'LICENSE_REQUEST_FAILED': 6007,\n\n /**\n * The license response was rejected by the CDM. The server's response may be\n * invalid or malformed for this CDM.\n * <br> error.data[0] is an error message string from the browser.\n */\n 'LICENSE_RESPONSE_REJECTED': 6008,\n\n // RETIRED: 'NO_LICENSE_SERVER_SPECIFIED': 6009,\n\n /**\n * The manifest does not specify any DRM info, but the content is encrypted.\n * Either the manifest or the manifest parser are broken.\n */\n 'ENCRYPTED_CONTENT_WITHOUT_DRM_INFO': 6010,\n\n // RETIRED: 'WRONG_KEYS': 6011,\n\n /**\n * No license server was given for the key system signaled by the manifest.\n * A license server URI is required for every key system.\n */\n 'NO_LICENSE_SERVER_GIVEN': 6012,\n\n /**\n * A required offline session was removed. The content is not playable.\n */\n 'OFFLINE_SESSION_REMOVED': 6013,\n\n /**\n * The license has expired. This is triggered when playback is stalled on a\n * 'waitingforkeys' event and there are any expired keys in the key status map\n * of any active session.\n */\n 'EXPIRED': 6014,\n\n\n /**\n * The call to Player.load() was interrupted by a call to Player.unload()\n * or another call to Player.load().\n */\n 'LOAD_INTERRUPTED': 7000,\n\n\n /**\n * The Cast API is unavailable. This may be because of one of the following:\n * - The browser may not have Cast support\n * - The browser may be missing a necessary Cast extension\n * - The Cast sender library may not be loaded in your app\n */\n 'CAST_API_UNAVAILABLE': 8000,\n\n /**\n * No cast receivers are available at this time.\n */\n 'NO_CAST_RECEIVERS': 8001,\n\n /**\n * The library is already casting.\n */\n 'ALREADY_CASTING': 8002,\n\n /**\n * A Cast SDK error that we did not explicitly plan for has occurred.\n * Check data[0] and refer to the Cast SDK documentation for details.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'UNEXPECTED_CAST_ERROR': 8003,\n\n /**\n * The cast operation was canceled by the user.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'CAST_CANCELED_BY_USER': 8004,\n\n /**\n * The cast connection timed out.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'CAST_CONNECTION_TIMED_OUT': 8005,\n\n /**\n * The requested receiver app ID does not exist or is unavailable.\n * Check the requested app ID for typos.\n * <br> error.data[0] is an error object from the Cast SDK.\n */\n 'CAST_RECEIVER_APP_UNAVAILABLE': 8006,\n\n\n /**\n * Offline storage is not supported on this browser; it is required for\n * offline support.\n */\n 'STORAGE_NOT_SUPPORTED': 9000,\n\n /**\n * An unknown error occurred in the IndexedDB.\n * <br> On Firefox, one common source for UnknownError calls is reverting\n * Firefox to an old version. This makes the indexedDB storage inaccessible\n * for older versions. The only way to fix this is to delete the storage\n * data in your profile. See https://goo.gl/eKVPPe.\n * <br> error.data[0] is the error object.\n */\n 'INDEXED_DB_ERROR': 9001,\n\n /**\n * The operation was aborted. For example, by a call to destroy().\n */\n 'OPERATION_ABORTED': 9002,\n\n /**\n * The specified item was not found in the IndexedDB.\n * <br> error.data[0] is the offline URI.\n */\n 'REQUESTED_ITEM_NOT_FOUND': 9003,\n\n /**\n * A network request was made with a malformed offline URI.\n * <br> error.data[0] is the URI.\n */\n 'MALFORMED_OFFLINE_URI': 9004,\n\n /**\n * The specified content is live or in-progress.\n * Live and in-progress streams cannot be stored offline.\n * <br> error.data[0] is the URI.\n */\n 'CANNOT_STORE_LIVE_OFFLINE': 9005,\n\n /**\n * There is already a store operation in-progress, wait until it completes\n * before starting another.\n */\n 'STORE_ALREADY_IN_PROGRESS': 9006,\n\n /**\n * The specified manifest is encrypted but does not specify any init data.\n * Without init data specified in the manifest, the content will not be\n * playable offline.\n * <br> error.data[0] is the URI.\n */\n 'NO_INIT_DATA_FOR_OFFLINE': 9007,\n\n /**\n * shaka.offline.Storage was constructed with a Player proxy instead of a\n * local player instance. To fix this, use Player directly with Storage\n * instead of the results of CastProxy.prototype.getPlayer().\n */\n 'LOCAL_PLAYER_INSTANCE_REQUIRED': 9008\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/error.js","// Copyright 2006 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Class for parsing and formatting URIs.\n *\n * Use new goog.Uri(string) to parse a URI string.\n *\n * e.g: <code>var myUri = new goog.Uri(window.location);</code>\n *\n * Implements RFC 3986 for parsing/formatting URIs.\n * http://www.ietf.org/rfc/rfc3986.txt\n *\n * Some changes have been made to the interface (more like .NETs), though the\n * internal representation is now of un-encoded parts, this will change the\n * behavior slightly.\n *\n */\n\ngoog.provide('goog.Uri');\ngoog.provide('goog.Uri.QueryData');\n\ngoog.require('goog.uri.utils');\ngoog.require('goog.uri.utils.ComponentIndex');\n\n\n\n/**\n * This class contains setters and getters for the parts of the URI.\n * The <code>getXyz</code>/<code>setXyz</code> methods return the decoded part\n * -- so<code>new goog.Uri('/foo%20bar').getPath()</code> will return the\n * decoded path, <code>/foo bar</code>.\n *\n * Reserved characters (see RFC 3986 section 2.2) can be present in\n * their percent-encoded form in scheme, domain, and path URI components and\n * will not be auto-decoded. For example:\n * <code>new goog.Uri('rel%61tive/path%2fto/resource').getPath()</code> will\n * return <code>relative/path%2fto/resource</code>.\n *\n * The constructor accepts an optional unparsed, raw URI string. The parser\n * is relaxed, so special characters that aren't escaped but don't cause\n * ambiguities will not cause parse failures.\n *\n * All setters return <code>this</code> and so may be chained, a la\n * <code>new goog.Uri('/foo').setFragment('part').toString()</code>.\n *\n * @param {*=} opt_uri Optional string URI to parse, or if a goog.Uri is\n * passed, a clone is created.\n *\n * @constructor\n */\ngoog.Uri = function(opt_uri) {\n // Parse in the uri string\n var m;\n if (opt_uri instanceof goog.Uri) {\n this.setScheme(opt_uri.getScheme());\n this.setUserInfo(opt_uri.getUserInfo());\n this.setDomain(opt_uri.getDomain());\n this.setPort(opt_uri.getPort());\n this.setPath(opt_uri.getPath());\n this.setQueryData(opt_uri.getQueryData().clone());\n this.setFragment(opt_uri.getFragment());\n } else if (opt_uri && (m = goog.uri.utils.split(String(opt_uri)))) {\n // Set the parts -- decoding as we do so.\n // COMPATABILITY NOTE - In IE, unmatched fields may be empty strings,\n // whereas in other browsers they will be undefined.\n this.setScheme(m[goog.uri.utils.ComponentIndex.SCHEME] || '', true);\n this.setUserInfo(m[goog.uri.utils.ComponentIndex.USER_INFO] || '', true);\n this.setDomain(m[goog.uri.utils.ComponentIndex.DOMAIN] || '', true);\n this.setPort(m[goog.uri.utils.ComponentIndex.PORT]);\n this.setPath(m[goog.uri.utils.ComponentIndex.PATH] || '', true);\n this.setQueryData(m[goog.uri.utils.ComponentIndex.QUERY_DATA] || '', true);\n this.setFragment(m[goog.uri.utils.ComponentIndex.FRAGMENT] || '', true);\n } else {\n this.queryData_ = new goog.Uri.QueryData(null, null);\n }\n};\n\n\n/**\n * Scheme such as \"http\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.scheme_ = '';\n\n\n/**\n * User credentials in the form \"username:password\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.userInfo_ = '';\n\n\n/**\n * Domain part, e.g. \"www.google.com\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.domain_ = '';\n\n\n/**\n * Port, e.g. 8080.\n * @type {?number}\n * @private\n */\ngoog.Uri.prototype.port_ = null;\n\n\n/**\n * Path, e.g. \"/tests/img.png\".\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.path_ = '';\n\n\n/**\n * Object representing query data.\n * @type {!goog.Uri.QueryData}\n * @private\n */\ngoog.Uri.prototype.queryData_;\n\n\n/**\n * The fragment without the #.\n * @type {string}\n * @private\n */\ngoog.Uri.prototype.fragment_ = '';\n\n\n/**\n * @return {string} The string form of the url.\n * @override\n */\ngoog.Uri.prototype.toString = function() {\n var out = [];\n\n var scheme = this.getScheme();\n if (scheme) {\n out.push(goog.Uri.encodeSpecialChars_(\n scheme, goog.Uri.reDisallowedInSchemeOrUserInfo_, true), ':');\n }\n\n var domain = this.getDomain();\n if (domain) {\n out.push('//');\n\n var userInfo = this.getUserInfo();\n if (userInfo) {\n out.push(goog.Uri.encodeSpecialChars_(\n userInfo, goog.Uri.reDisallowedInSchemeOrUserInfo_, true), '@');\n }\n\n out.push(goog.Uri.removeDoubleEncoding_(encodeURIComponent(domain)));\n\n var port = this.getPort();\n if (port != null) {\n out.push(':', String(port));\n }\n }\n\n var path = this.getPath();\n if (path) {\n if (this.hasDomain() && path.charAt(0) != '/') {\n out.push('/');\n }\n out.push(goog.Uri.encodeSpecialChars_(\n path,\n path.charAt(0) == '/' ?\n goog.Uri.reDisallowedInAbsolutePath_ :\n goog.Uri.reDisallowedInRelativePath_,\n true));\n }\n\n var query = this.getEncodedQuery();\n if (query) {\n out.push('?', query);\n }\n\n var fragment = this.getFragment();\n if (fragment) {\n out.push('#', goog.Uri.encodeSpecialChars_(\n fragment, goog.Uri.reDisallowedInFragment_));\n }\n return out.join('');\n};\n\n\n/**\n * Resolves the given relative URI (a goog.Uri object), using the URI\n * represented by this instance as the base URI.\n *\n * There are several kinds of relative URIs:<br>\n * 1. foo - replaces the last part of the path, the whole query and fragment<br>\n * 2. /foo - replaces the the path, the query and fragment<br>\n * 3. //foo - replaces everything from the domain on. foo is a domain name<br>\n * 4. ?foo - replace the query and fragment<br>\n * 5. #foo - replace the fragment only\n *\n * Additionally, if relative URI has a non-empty path, all \"..\" and \".\"\n * segments will be resolved, as described in RFC 3986.\n *\n * @param {goog.Uri} relativeUri The relative URI to resolve.\n * @return {!goog.Uri} The resolved URI.\n */\ngoog.Uri.prototype.resolve = function(relativeUri) {\n\n var absoluteUri = this.clone();\n if (absoluteUri.scheme_ === 'data') {\n // Cannot have a relative URI to a data URI.\n absoluteUri = new goog.Uri();\n }\n\n // we satisfy these conditions by looking for the first part of relativeUri\n // that is not blank and applying defaults to the rest\n\n var overridden = relativeUri.hasScheme();\n\n if (overridden) {\n absoluteUri.setScheme(relativeUri.getScheme());\n } else {\n overridden = relativeUri.hasUserInfo();\n }\n\n if (overridden) {\n absoluteUri.setUserInfo(relativeUri.getUserInfo());\n } else {\n overridden = relativeUri.hasDomain();\n }\n\n if (overridden) {\n absoluteUri.setDomain(relativeUri.getDomain());\n } else {\n overridden = relativeUri.hasPort();\n }\n\n var path = relativeUri.getPath();\n if (overridden) {\n absoluteUri.setPort(relativeUri.getPort());\n } else {\n overridden = relativeUri.hasPath();\n if (overridden) {\n // resolve path properly\n if (path.charAt(0) != '/') {\n // path is relative\n if (this.hasDomain() && !this.hasPath()) {\n // RFC 3986, section 5.2.3, case 1\n path = '/' + path;\n } else {\n // RFC 3986, section 5.2.3, case 2\n var lastSlashIndex = absoluteUri.getPath().lastIndexOf('/');\n if (lastSlashIndex != -1) {\n path = absoluteUri.getPath().substr(0, lastSlashIndex + 1) + path;\n }\n }\n }\n path = goog.Uri.removeDotSegments(path);\n }\n }\n\n if (overridden) {\n absoluteUri.setPath(path);\n } else {\n overridden = relativeUri.hasQuery();\n }\n\n if (overridden) {\n absoluteUri.setQueryData(relativeUri.getQueryData().clone());\n } else {\n overridden = relativeUri.hasFragment();\n }\n\n if (overridden) {\n absoluteUri.setFragment(relativeUri.getFragment());\n }\n\n return absoluteUri;\n};\n\n\n/**\n * Clones the URI instance.\n * @return {!goog.Uri} New instance of the URI object.\n */\ngoog.Uri.prototype.clone = function() {\n return new goog.Uri(this);\n};\n\n\n/**\n * @return {string} The encoded scheme/protocol for the URI.\n */\ngoog.Uri.prototype.getScheme = function() {\n return this.scheme_;\n};\n\n\n/**\n * Sets the scheme/protocol.\n * @param {string} newScheme New scheme value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setScheme = function(newScheme, opt_decode) {\n this.scheme_ = opt_decode ? goog.Uri.decodeOrEmpty_(newScheme, true) :\n newScheme;\n\n // remove an : at the end of the scheme so somebody can pass in\n // window.location.protocol\n if (this.scheme_) {\n this.scheme_ = this.scheme_.replace(/:$/, '');\n }\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the scheme has been set.\n */\ngoog.Uri.prototype.hasScheme = function() {\n return !!this.scheme_;\n};\n\n\n/**\n * @return {string} The decoded user info.\n */\ngoog.Uri.prototype.getUserInfo = function() {\n return this.userInfo_;\n};\n\n\n/**\n * Sets the userInfo.\n * @param {string} newUserInfo New userInfo value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setUserInfo = function(newUserInfo, opt_decode) {\n this.userInfo_ = opt_decode ? goog.Uri.decodeOrEmpty_(newUserInfo) :\n newUserInfo;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the user info has been set.\n */\ngoog.Uri.prototype.hasUserInfo = function() {\n return !!this.userInfo_;\n};\n\n\n/**\n * @return {string} The decoded domain.\n */\ngoog.Uri.prototype.getDomain = function() {\n return this.domain_;\n};\n\n\n/**\n * Sets the domain.\n * @param {string} newDomain New domain value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setDomain = function(newDomain, opt_decode) {\n this.domain_ = opt_decode ? goog.Uri.decodeOrEmpty_(newDomain, true) :\n newDomain;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the domain has been set.\n */\ngoog.Uri.prototype.hasDomain = function() {\n return !!this.domain_;\n};\n\n\n/**\n * @return {?number} The port number.\n */\ngoog.Uri.prototype.getPort = function() {\n return this.port_;\n};\n\n\n/**\n * Sets the port number.\n * @param {*} newPort Port number. Will be explicitly casted to a number.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setPort = function(newPort) {\n if (newPort) {\n newPort = Number(newPort);\n if (isNaN(newPort) || newPort < 0) {\n throw Error('Bad port number ' + newPort);\n }\n this.port_ = newPort;\n } else {\n this.port_ = null;\n }\n\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the port has been set.\n */\ngoog.Uri.prototype.hasPort = function() {\n return this.port_ != null;\n};\n\n\n/**\n * @return {string} The decoded path.\n */\ngoog.Uri.prototype.getPath = function() {\n return this.path_;\n};\n\n\n/**\n * Sets the path.\n * @param {string} newPath New path value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setPath = function(newPath, opt_decode) {\n this.path_ = opt_decode ? goog.Uri.decodeOrEmpty_(newPath, true) : newPath;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the path has been set.\n */\ngoog.Uri.prototype.hasPath = function() {\n return !!this.path_;\n};\n\n\n/**\n * @return {boolean} Whether the query string has been set.\n */\ngoog.Uri.prototype.hasQuery = function() {\n return this.queryData_.toString() !== '';\n};\n\n\n/**\n * Sets the query data.\n * @param {goog.Uri.QueryData|string|undefined} queryData QueryData object.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * Applies only if queryData is a string.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setQueryData = function(queryData, opt_decode) {\n if (queryData instanceof goog.Uri.QueryData) {\n this.queryData_ = queryData;\n } else {\n if (!opt_decode) {\n // QueryData accepts encoded query string, so encode it if\n // opt_decode flag is not true.\n queryData = goog.Uri.encodeSpecialChars_(queryData,\n goog.Uri.reDisallowedInQuery_);\n }\n this.queryData_ = new goog.Uri.QueryData(queryData, null);\n }\n\n return this;\n};\n\n\n/**\n * @return {string} The encoded URI query, not including the ?.\n */\ngoog.Uri.prototype.getEncodedQuery = function() {\n return this.queryData_.toString();\n};\n\n\n/**\n * @return {string} The decoded URI query, not including the ?.\n */\ngoog.Uri.prototype.getDecodedQuery = function() {\n return this.queryData_.toDecodedString();\n};\n\n\n/**\n * Returns the query data.\n * @return {!goog.Uri.QueryData} QueryData object.\n */\ngoog.Uri.prototype.getQueryData = function() {\n return this.queryData_;\n};\n\n\n/**\n * @return {string} The URI fragment, not including the #.\n */\ngoog.Uri.prototype.getFragment = function() {\n return this.fragment_;\n};\n\n\n/**\n * Sets the URI fragment.\n * @param {string} newFragment New fragment value.\n * @param {boolean=} opt_decode Optional param for whether to decode new value.\n * @return {!goog.Uri} Reference to this URI object.\n */\ngoog.Uri.prototype.setFragment = function(newFragment, opt_decode) {\n this.fragment_ = opt_decode ? goog.Uri.decodeOrEmpty_(newFragment) :\n newFragment;\n return this;\n};\n\n\n/**\n * @return {boolean} Whether the URI has a fragment set.\n */\ngoog.Uri.prototype.hasFragment = function() {\n return !!this.fragment_;\n};\n\n\n//==============================================================================\n// Static members\n//==============================================================================\n\n\n/**\n * Removes dot segments in given path component, as described in\n * RFC 3986, section 5.2.4.\n *\n * @param {string} path A non-empty path component.\n * @return {string} Path component with removed dot segments.\n */\ngoog.Uri.removeDotSegments = function(path) {\n if (path == '..' || path == '.') {\n return '';\n\n } else if (path.indexOf('./') == -1 &&\n path.indexOf('/.') == -1) {\n // This optimization detects uris which do not contain dot-segments,\n // and as a consequence do not require any processing.\n return path;\n\n } else {\n var leadingSlash = (path.lastIndexOf('/', 0) == 0);\n var segments = path.split('/');\n var out = [];\n\n for (var pos = 0; pos < segments.length; ) {\n var segment = segments[pos++];\n\n if (segment == '.') {\n if (leadingSlash && pos == segments.length) {\n out.push('');\n }\n } else if (segment == '..') {\n if (out.length > 1 || out.length == 1 && out[0] != '') {\n out.pop();\n }\n if (leadingSlash && pos == segments.length) {\n out.push('');\n }\n } else {\n out.push(segment);\n leadingSlash = true;\n }\n }\n\n return out.join('/');\n }\n};\n\n\n/**\n * Decodes a value or returns the empty string if it isn't defined or empty.\n * @param {string|undefined} val Value to decode.\n * @param {boolean=} opt_preserveReserved If true, restricted characters will\n * not be decoded.\n * @return {string} Decoded value.\n * @private\n */\ngoog.Uri.decodeOrEmpty_ = function(val, opt_preserveReserved) {\n // Don't use UrlDecode() here because val is not a query parameter.\n if (!val) {\n return '';\n }\n\n return opt_preserveReserved ? decodeURI(val) : decodeURIComponent(val);\n};\n\n\n/**\n * If unescapedPart is non null, then escapes any characters in it that aren't\n * valid characters in a url and also escapes any special characters that\n * appear in extra.\n *\n * @param {*} unescapedPart The string to encode.\n * @param {RegExp} extra A character set of characters in [\\01-\\177].\n * @param {boolean=} opt_removeDoubleEncoding If true, remove double percent\n * encoding.\n * @return {?string} null iff unescapedPart == null.\n * @private\n */\ngoog.Uri.encodeSpecialChars_ = function(unescapedPart, extra,\n opt_removeDoubleEncoding) {\n if (goog.isString(unescapedPart)) {\n var encoded = encodeURI(unescapedPart).\n replace(extra, goog.Uri.encodeChar_);\n if (opt_removeDoubleEncoding) {\n // encodeURI double-escapes %XX sequences used to represent restricted\n // characters in some URI components, remove the double escaping here.\n encoded = goog.Uri.removeDoubleEncoding_(encoded);\n }\n return encoded;\n }\n return null;\n};\n\n\n/**\n * Converts a character in [\\01-\\177] to its unicode character equivalent.\n * @param {string} ch One character string.\n * @return {string} Encoded string.\n * @private\n */\ngoog.Uri.encodeChar_ = function(ch) {\n var n = ch.charCodeAt(0);\n return '%' + ((n >> 4) & 0xf).toString(16) + (n & 0xf).toString(16);\n};\n\n\n/**\n * Removes double percent-encoding from a string.\n * @param {string} doubleEncodedString String\n * @return {string} String with double encoding removed.\n * @private\n */\ngoog.Uri.removeDoubleEncoding_ = function(doubleEncodedString) {\n return doubleEncodedString.replace(/%25([0-9a-fA-F]{2})/g, '%$1');\n};\n\n\n/**\n * Regular expression for characters that are disallowed in the scheme or\n * userInfo part of the URI.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInSchemeOrUserInfo_ = /[#\\/\\?@]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in a relative path.\n * Colon is included due to RFC 3986 3.3.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInRelativePath_ = /[\\#\\?:]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in an absolute path.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInAbsolutePath_ = /[\\#\\?]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in the query.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInQuery_ = /[\\#\\?@]/g;\n\n\n/**\n * Regular expression for characters that are disallowed in the fragment.\n * @type {RegExp}\n * @private\n */\ngoog.Uri.reDisallowedInFragment_ = /#/g;\n\n\n\n/**\n * Class used to represent URI query parameters. It is essentially a hash of\n * name-value pairs, though a name can be present more than once.\n *\n * Has the same interface as the collections in goog.structs.\n *\n * @param {?string=} opt_query Optional encoded query string to parse into\n * the object.\n * @param {goog.Uri=} opt_uri Optional uri object that should have its\n * cache invalidated when this object updates. Deprecated -- this\n * is no longer required.\n * @constructor\n * @final\n */\ngoog.Uri.QueryData = function(opt_query, opt_uri) {\n /**\n * Encoded query string, or null if it requires computing from the key map.\n * @type {?string}\n * @private\n */\n this.encodedQuery_ = opt_query || null;\n};\n\n\n/**\n * If the underlying key map is not yet initialized, it parses the\n * query string and fills the map with parsed data.\n * @private\n */\ngoog.Uri.QueryData.prototype.ensureKeyMapInitialized_ = function() {\n if (!this.keyMap_) {\n this.keyMap_ = {};\n this.count_ = 0;\n\n if (this.encodedQuery_) {\n var pairs = this.encodedQuery_.split('&');\n for (var i = 0; i < pairs.length; i++) {\n var indexOfEquals = pairs[i].indexOf('=');\n var name = null;\n var value = null;\n if (indexOfEquals >= 0) {\n name = pairs[i].substring(0, indexOfEquals);\n value = pairs[i].substring(indexOfEquals + 1);\n } else {\n name = pairs[i];\n }\n name = decodeURIComponent(name.replace(/\\+/g, ' '));\n value = value || '';\n this.add(name, decodeURIComponent(value.replace(/\\+/g, ' ')));\n }\n }\n }\n};\n\n\n/**\n * The map containing name/value or name/array-of-values pairs.\n * May be null if it requires parsing from the query string.\n *\n * We need to use a Map because we cannot guarantee that the key names will\n * not be problematic for IE.\n *\n * @type {Object.<string, !Array.<string>>}\n * @private\n */\ngoog.Uri.QueryData.prototype.keyMap_ = null;\n\n\n/**\n * The number of params, or null if it requires computing.\n * @type {?number}\n * @private\n */\ngoog.Uri.QueryData.prototype.count_ = null;\n\n\n/**\n * @return {?number} The number of parameters.\n */\ngoog.Uri.QueryData.prototype.getCount = function() {\n this.ensureKeyMapInitialized_();\n return this.count_;\n};\n\n\n/**\n * Adds a key value pair.\n * @param {string} key Name.\n * @param {*} value Value.\n * @return {!goog.Uri.QueryData} Instance of this object.\n */\ngoog.Uri.QueryData.prototype.add = function(key, value) {\n this.ensureKeyMapInitialized_();\n // Invalidate the cache.\n this.encodedQuery_ = null;\n\n var values = this.keyMap_.hasOwnProperty(key) && this.keyMap_[key];\n if (!values) {\n this.keyMap_[key] = (values = []);\n }\n values.push(value);\n this.count_++;\n return this;\n};\n\n\n/**\n * @return {string} Encoded query string.\n * @override\n */\ngoog.Uri.QueryData.prototype.toString = function() {\n if (this.encodedQuery_) {\n return this.encodedQuery_;\n }\n\n if (!this.keyMap_) {\n return '';\n }\n\n var sb = [];\n\n for (var key in this.keyMap_) {\n var encodedKey = encodeURIComponent(key);\n var val = this.keyMap_[key];\n for (var j = 0; j < val.length; j++) {\n var param = encodedKey;\n // Ensure that null and undefined are encoded into the url as\n // literal strings.\n if (val[j] !== '') {\n param += '=' + encodeURIComponent(val[j]);\n }\n sb.push(param);\n }\n }\n\n return this.encodedQuery_ = sb.join('&');\n};\n\n\n/**\n * @return {string} Decoded query string.\n */\ngoog.Uri.QueryData.prototype.toDecodedString = function() {\n return goog.Uri.decodeOrEmpty_(this.toString());\n};\n\n\n/**\n * Clone the query data instance.\n * @return {!goog.Uri.QueryData} New instance of the QueryData object.\n */\ngoog.Uri.QueryData.prototype.clone = function() {\n var rv = new goog.Uri.QueryData();\n rv.encodedQuery_ = this.encodedQuery_;\n if (this.keyMap_) {\n var cloneMap = {};\n for (var key in this.keyMap_) {\n cloneMap[key] = this.keyMap_[key].concat();\n }\n rv.keyMap_ = cloneMap;\n rv.count_ = this.count_;\n }\n return rv;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/third_party/closure/goog/uri/uri.js","// Copyright 2008 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Simple utilities for splitting URI strings.\n *\n * Uses features of RFC 3986 for parsing/formatting URIs:\n * http://www.ietf.org/rfc/rfc3986.txt\n *\n * @author gboyer@google.com (Garrett Boyer) - The \"lightened\" design.\n * @author msamuel@google.com (Mike Samuel) - Domain knowledge and regexes.\n */\n\ngoog.provide('goog.uri.utils');\ngoog.provide('goog.uri.utils.ComponentIndex');\n\n\n/**\n * A regular expression for breaking a URI into its component parts.\n *\n * {@link http://www.ietf.org/rfc/rfc3986.txt} says in Appendix B\n * As the \"first-match-wins\" algorithm is identical to the \"greedy\"\n * disambiguation method used by POSIX regular expressions, it is natural and\n * commonplace to use a regular expression for parsing the potential five\n * components of a URI reference.\n *\n * The following line is the regular expression for breaking-down a\n * well-formed URI reference into its components.\n *\n * <pre>\n * ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\n * 12 3 4 5 6 7 8 9\n * </pre>\n *\n * The numbers in the second line above are only to assist readability; they\n * indicate the reference points for each subexpression (i.e., each paired\n * parenthesis). We refer to the value matched for subexpression <n> as $<n>.\n * For example, matching the above expression to\n * <pre>\n * http://www.ics.uci.edu/pub/ietf/uri/#Related\n * </pre>\n * results in the following subexpression matches:\n * <pre>\n * $1 = http:\n * $2 = http\n * $3 = //www.ics.uci.edu\n * $4 = www.ics.uci.edu\n * $5 = /pub/ietf/uri/\n * $6 = <undefined>\n * $7 = <undefined>\n * $8 = #Related\n * $9 = Related\n * </pre>\n * where <undefined> indicates that the component is not present, as is the\n * case for the query component in the above example. Therefore, we can\n * determine the value of the five components as\n * <pre>\n * scheme = $2\n * authority = $4\n * path = $5\n * query = $7\n * fragment = $9\n * </pre>\n *\n * The regular expression has been modified slightly to expose the\n * userInfo, domain, and port separately from the authority.\n * The modified version yields\n * <pre>\n * $1 = http scheme\n * $2 = <undefined> userInfo -\\\n * $3 = www.ics.uci.edu domain | authority\n * $4 = <undefined> port -/\n * $5 = /pub/ietf/uri/ path\n * $6 = <undefined> query without ?\n * $7 = Related fragment without #\n * </pre>\n * @type {!RegExp}\n * @private\n */\ngoog.uri.utils.splitRe_ = new RegExp(\n '^' +\n '(?:' +\n '([^:/?#.]+)' + // scheme - ignore special characters\n // used by other URL parts such as :,\n // ?, /, #, and .\n ':)?' +\n '(?://' +\n '(?:([^/?#]*)@)?' + // userInfo\n '([^/#?]*?)' + // domain\n '(?::([0-9]+))?' + // port\n '(?=[/#?]|$)' + // authority-terminating character\n ')?' +\n '([^?#]+)?' + // path\n '(?:\\\\?([^#]*))?' + // query\n '(?:#(.*))?' + // fragment\n '$');\n\n\n/**\n * The index of each URI component in the return value of goog.uri.utils.split.\n * @enum {number}\n */\ngoog.uri.utils.ComponentIndex = {\n SCHEME: 1,\n USER_INFO: 2,\n DOMAIN: 3,\n PORT: 4,\n PATH: 5,\n QUERY_DATA: 6,\n FRAGMENT: 7\n};\n\n\n/**\n * Splits a URI into its component parts.\n *\n * Each component can be accessed via the component indices; for example:\n * <pre>\n * goog.uri.utils.split(someStr)[goog.uri.utils.CompontentIndex.QUERY_DATA];\n * </pre>\n *\n * @param {string} uri The URI string to examine.\n * @return {!Array.<string|undefined>} Each component still URI-encoded.\n * Each component that is present will contain the encoded value, whereas\n * components that are not present will be undefined or empty, depending\n * on the browser's regular expression implementation. Never null, since\n * arbitrary strings may still look like path names.\n */\ngoog.uri.utils.split = function(uri) {\n // See @return comment -- never null.\n return /** @type {!Array.<string|undefined>} */ (\n uri.match(goog.uri.utils.splitRe_));\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/third_party/closure/goog/uri/utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Functional');\n\n\n/**\n * @namespace shaka.util.Functional\n * @summary A set of functional utility functions.\n */\n\n\n/**\n * Creates a promise chain that calls the given callback for each element in\n * the array in a catch of a promise.\n *\n * e.g.:\n * Promise.reject().catch(callback(array[0])).catch(callback(array[1]));\n *\n * @param {!Array.<ELEM>} array\n * @param {function(ELEM):!Promise.<RESULT>} callback\n * @return {!Promise.<RESULT>}\n * @template ELEM,RESULT\n */\nshaka.util.Functional.createFallbackPromiseChain = function(array, callback) {\n return array.reduce(function(callback, promise, elem) {\n return promise.catch(callback.bind(null, elem));\n }.bind(null, callback), Promise.reject());\n};\n\n\n/**\n * Returns the first array concatenated to the second; used to collapse an\n * array of arrays into a single array.\n *\n * @param {!Array.<T>} all\n * @param {!Array.<T>} part\n * @return {!Array.<T>}\n * @template T\n */\nshaka.util.Functional.collapseArrays = function(all, part) {\n return all.concat(part);\n};\n\n\n/**\n * A no-op function. Useful in promise chains.\n */\nshaka.util.Functional.noop = function() {};\n\n\n/**\n * Returns if the given value is not null; useful for filtering out null values.\n *\n * @param {T} value\n * @return {boolean}\n * @template T\n */\nshaka.util.Functional.isNotNull = function(value) {\n return value != null;\n};\n\n\n/**\n * Creates a function that returns whether the given value is equal to the given\n * value.\n *\n * @param {T} compare\n * @return {function(T):boolean}\n * @template T\n */\nshaka.util.Functional.isEqualFunc = function(compare) {\n return function(a) { return a == compare; };\n};\n\n\n/**\n * Creates a function that returns whether the given value is not equal to the\n * given value.\n *\n * @param {T} compare\n * @return {function(T):boolean}\n * @template T\n */\nshaka.util.Functional.isNotEqualFunc = function(compare) {\n return function(a) { return a != compare; };\n};\n\n\n/**\n * Used to filter out duplicates in an array.\n * Returns true the first time the element is encountered. Returns false\n * for all the subsequent encounters.\n *\n * @param {T} item\n * @param {number} position\n * @param {!Array.<T>} self\n * @return {boolean}\n * @template T\n * @example [1, 1, 2].filter(shaka.util.Functional.isNotDuplicate) -> [1, 2]\n */\nshaka.util.Functional.isNotDuplicate = function(item, position, self) {\n return self.indexOf(item) == position;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/functional.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.ManifestParserUtils');\n\ngoog.require('goog.Uri');\ngoog.require('shaka.util.Functional');\n\n\n/**\n * @namespace shaka.util.ManifestParserUtils\n * @summary Utility functions for manifest parsing.\n */\n\n\n/**\n * Resolves an array of relative URIs to the given base URIs. This will result\n * in M*N number of URIs.\n *\n * @param {!Array.<string>} baseUris\n * @param {!Array.<string>} relativeUris\n * @return {!Array.<string>}\n */\nshaka.util.ManifestParserUtils.resolveUris = function(baseUris, relativeUris) {\n var Functional = shaka.util.Functional;\n if (relativeUris.length == 0)\n return baseUris;\n\n var relativeAsGoog =\n relativeUris.map(function(uri) { return new goog.Uri(uri); });\n // Resolve each URI relative to each base URI, creating an Array of Arrays.\n // Then flatten the Arrays into a single Array.\n return baseUris.map(function(uri) { return new goog.Uri(uri); })\n .map(function(base) { return relativeAsGoog.map(base.resolve.bind(base)); })\n .reduce(Functional.collapseArrays, [])\n .map(function(uri) { return uri.toString(); });\n};\n\n\n/**\n * Creates a DrmInfo object from the given info.\n *\n * @param {string} keySystem\n * @param {Array.<shakaExtern.InitDataOverride>} initData\n * @return {shakaExtern.DrmInfo}\n */\nshaka.util.ManifestParserUtils.createDrmInfo = function(keySystem, initData) {\n return {\n keySystem: keySystem,\n licenseServerUri: '',\n distinctiveIdentifierRequired: false,\n persistentStateRequired: false,\n audioRobustness: '',\n videoRobustness: '',\n serverCertificate: null,\n initData: initData || [],\n keyIds: []\n };\n};\n\n\n/**\n * @enum {string}\n */\nshaka.util.ManifestParserUtils.ContentType = {\n VIDEO: 'video',\n AUDIO: 'audio',\n TEXT: 'text',\n APPLICATION: 'application'\n};\n\n\n/**\n * @enum {string}\n */\nshaka.util.ManifestParserUtils.TextStreamKind = {\n SUBTITLE: 'subtitle',\n CLOSED_CAPTION: 'caption'\n};\n\n\n/**\n * Specifies how tolerant the player is to inaccurate segment start times and\n * end times within a manifest. For example, gaps or overlaps between segments\n * in a SegmentTimeline which are greater than or equal to this value will\n * result in a warning message.\n *\n * @const {number}\n */\nshaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS = 1 / 15;\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/manifest_parser_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.ConfigUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\n\n\n/**\n * @param {!Object} destination\n * @param {!Object} source\n * @param {!Object} template supplies default values\n * @param {!Object} overrides\n * Supplies override type checking. When the current path matches the key in\n * this object, each sub-value must match the type in this object. If this\n * contains an Object, it is used as the template.\n * @param {string} path to this part of the config\n */\nshaka.util.ConfigUtils.mergeConfigObjects =\n function(destination, source, template, overrides, path) {\n goog.asserts.assert(destination, 'Destination config must not be null!');\n\n /**\n * @type {boolean}\n * If true, don't validate the keys in the next level.\n */\n var ignoreKeys = path in overrides;\n\n for (var k in source) {\n var subPath = path + '.' + k;\n var subTemplate = ignoreKeys ? overrides[path] : template[k];\n\n /**\n * @type {boolean}\n * If true, simply copy the object over and don't verify.\n */\n var copyObject = !!({\n '.abr.manager': true\n })[subPath] || !!({\n 'serverCertificate': true\n })[k];\n\n // The order of these checks is important.\n if (!ignoreKeys && !(k in destination)) {\n shaka.log.error('Invalid config, unrecognized key ' + subPath);\n } else if (source[k] === undefined) {\n // An explicit 'undefined' value causes the key to be deleted from the\n // destination config and replaced with a default from the template if\n // possible.\n if (subTemplate === undefined || ignoreKeys) {\n delete destination[k];\n } else {\n destination[k] = subTemplate;\n }\n } else if (copyObject) {\n destination[k] = source[k];\n } else if (typeof destination[k] == 'object' &&\n typeof source[k] == 'object') {\n shaka.util.ConfigUtils.mergeConfigObjects(\n destination[k], source[k], subTemplate, overrides, subPath);\n } else if (typeof source[k] != typeof subTemplate) {\n shaka.log.error('Invalid config, wrong type for ' + subPath);\n } else if (typeof destination[k] == 'function' &&\n destination[k].length != source[k].length) {\n shaka.log.warning(\n 'Invalid config, wrong number of arguments for ' + subPath);\n destination[k] = source[k];\n } else {\n destination[k] = source[k];\n }\n }\n};\n\n\n/**\n * Performs a deep clone of the given simple object. This does not copy\n * prototypes, custom properties (e.g. read-only), or multiple references to\n * the same object. This uses JSON to clone.\n *\n * @template T\n * @param {T} arg\n * @return {T}\n */\nshaka.util.ConfigUtils.cloneObject = function(arg) {\n return JSON.parse(JSON.stringify(arg));\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/config_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.PublicPromise');\n\n\n\n/**\n * A utility to create Promises with convenient public resolve and reject\n * methods.\n *\n * @constructor\n * @struct\n * @extends {Promise.<T>}\n * @return {Promise.<T>}\n * @template T\n */\nshaka.util.PublicPromise = function() {\n var resolvePromise;\n var rejectPromise;\n\n // Promise.call causes an error. It seems that inheriting from a native\n // Promise is not permitted by JavaScript interpreters.\n\n // The work-around is to construct a Promise object, modify it to look like\n // the compiler's picture of PublicPromise, then return it. The caller of\n // new PublicPromise will receive |promise| instead of |this|, and the\n // compiler will be aware of the additional properties |resolve| and\n // |reject|.\n\n var promise = new Promise(function(resolve, reject) {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n\n promise.resolve = resolvePromise;\n promise.reject = rejectPromise;\n\n return promise;\n};\n\n\n/** @type {function(T=)} */\nshaka.util.PublicPromise.prototype.resolve;\n\n\n/** @type {function(*=)} */\nshaka.util.PublicPromise.prototype.reject;\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/public_promise.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.net.NetworkingEngine');\n\ngoog.require('goog.Uri');\ngoog.require('goog.asserts');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * NetworkingEngine wraps all networking operations. This accepts plugins that\n * handle the actual request. A plugin is registered using registerScheme.\n * Each scheme has at most one plugin to handle the request.\n *\n * @param {function(number, number)=} opt_onSegmentDownloaded Called\n * when a segment is downloaded. Passed the duration, in milliseconds, that\n * the request took; and the total number of bytes transferred.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n * @export\n */\nshaka.net.NetworkingEngine = function(opt_onSegmentDownloaded) {\n /** @private {boolean} */\n this.destroyed_ = false;\n\n /** @private {!Array.<!Promise>} */\n this.requests_ = [];\n\n /** @private {!Array.<shakaExtern.RequestFilter>} */\n this.requestFilters_ = [];\n\n /** @private {!Array.<shakaExtern.ResponseFilter>} */\n this.responseFilters_ = [];\n\n /** @private {?function(number, number)} */\n this.onSegmentDownloaded_ = opt_onSegmentDownloaded || null;\n};\n\n\n/**\n * Request types. Allows a filter to decide which requests to read/alter.\n *\n * @enum {number}\n * @export\n */\nshaka.net.NetworkingEngine.RequestType = {\n 'MANIFEST': 0,\n 'SEGMENT': 1,\n 'LICENSE': 2,\n 'APP': 3\n};\n\n\n/**\n * Contains the scheme plugins.\n *\n * @private {!Object.<string, ?shakaExtern.SchemePlugin>}\n */\nshaka.net.NetworkingEngine.schemes_ = {};\n\n\n/**\n * Registers a scheme plugin. This plugin will handle all requests with the\n * given scheme. If a plugin with the same scheme already exists, it is\n * replaced.\n *\n * @param {string} scheme\n * @param {shakaExtern.SchemePlugin} plugin\n * @export\n */\nshaka.net.NetworkingEngine.registerScheme = function(scheme, plugin) {\n shaka.net.NetworkingEngine.schemes_[scheme] = plugin;\n};\n\n\n/**\n * Removes a scheme plugin.\n *\n * @param {string} scheme\n * @export\n */\nshaka.net.NetworkingEngine.unregisterScheme = function(scheme) {\n delete shaka.net.NetworkingEngine.schemes_[scheme];\n};\n\n\n/**\n * Registers a new request filter. All filters are applied in the order they\n * are registered.\n *\n * @param {shakaExtern.RequestFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.registerRequestFilter = function(filter) {\n this.requestFilters_.push(filter);\n};\n\n\n/**\n * Removes a request filter.\n *\n * @param {shakaExtern.RequestFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.unregisterRequestFilter =\n function(filter) {\n var filters = this.requestFilters_;\n var i = filters.indexOf(filter);\n if (i >= 0) {\n filters.splice(i, 1);\n }\n};\n\n\n/**\n * Clear all request filters.\n *\n * @export\n */\nshaka.net.NetworkingEngine.prototype.clearAllRequestFilters = function() {\n this.requestFilters_ = [];\n};\n\n\n/**\n * Registers a new response filter. All filters are applied in the order they\n * are registered.\n *\n * @param {shakaExtern.ResponseFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.registerResponseFilter = function(filter) {\n this.responseFilters_.push(filter);\n};\n\n\n/**\n * Removes a response filter.\n *\n * @param {shakaExtern.ResponseFilter} filter\n * @export\n */\nshaka.net.NetworkingEngine.prototype.unregisterResponseFilter =\n function(filter) {\n var filters = this.responseFilters_;\n var i = filters.indexOf(filter);\n if (i >= 0) {\n filters.splice(i, 1);\n }\n};\n\n\n/**\n * Clear all response filters.\n *\n * @export\n */\nshaka.net.NetworkingEngine.prototype.clearAllResponseFilters = function() {\n this.responseFilters_ = [];\n};\n\n\n/**\n * Gets a copy of the default retry parameters.\n *\n * @return {shakaExtern.RetryParameters}\n */\nshaka.net.NetworkingEngine.defaultRetryParameters = function() {\n // Use a function rather than a constant member so the calling code can\n // modify the values without affecting other call results.\n return {\n maxAttempts: 2,\n baseDelay: 1000,\n backoffFactor: 2,\n fuzzFactor: 0.5,\n timeout: 0\n };\n};\n\n\n/**\n * Makes a simple network request for the given URIs.\n *\n * @param {!Array.<string>} uris\n * @param {shakaExtern.RetryParameters} retryParams\n * @return {shakaExtern.Request}\n */\nshaka.net.NetworkingEngine.makeRequest = function(\n uris, retryParams) {\n return {\n uris: uris,\n method: 'GET',\n body: null,\n headers: {},\n allowCrossSiteCredentials: false,\n retryParameters: retryParams\n };\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.net.NetworkingEngine.prototype.destroy = function() {\n var Functional = shaka.util.Functional;\n this.destroyed_ = true;\n this.requestFilters_ = [];\n this.responseFilters_ = [];\n\n var cleanup = [];\n for (var i = 0; i < this.requests_.length; ++i) {\n cleanup.push(this.requests_[i].catch(Functional.noop));\n }\n return Promise.all(cleanup);\n};\n\n\n/**\n * Makes a network request and returns the resulting data.\n *\n * @param {shaka.net.NetworkingEngine.RequestType} type\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.net.NetworkingEngine.prototype.request = function(type, request) {\n var cloneObject = shaka.util.ConfigUtils.cloneObject;\n\n // New requests made after destroy is called are rejected.\n if (this.destroyed_)\n return Promise.reject();\n\n goog.asserts.assert(request.uris && request.uris.length,\n 'Request without URIs!');\n\n // If a request comes from outside the library, some parameters may be left\n // undefined. To make it easier for application developers, we will fill them\n // in with defaults if necessary.\n //\n // We clone retryParameters and uris so that if a filter modifies the request,\n // then it doesn't contaminate future requests.\n request.method = request.method || 'GET';\n request.headers = request.headers || {};\n request.retryParameters = request.retryParameters ?\n cloneObject(request.retryParameters) :\n shaka.net.NetworkingEngine.defaultRetryParameters();\n request.uris = cloneObject(request.uris);\n\n var filterStartMs = Date.now();\n\n // Send to the filter first, in-case they change the URI.\n var p = Promise.resolve();\n this.requestFilters_.forEach(function(requestFilter) {\n // Request filters are resolved sequentially.\n p = p.then(requestFilter.bind(null, type, request));\n });\n\n // Catch any errors thrown by request filters, and substitute\n // them with a Shaka-native error.\n p = p.catch(function(e) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.REQUEST_FILTER_ERROR, e);\n });\n\n // Send out the request, and get a response.\n // The entire code is inside a then clause; thus, if a filter\n // rejects or errors, the networking engine will never send.\n p = p.then(function() {\n var filterTimeMs = (Date.now() - filterStartMs);\n\n var retry = request.retryParameters || {};\n var maxAttempts = retry.maxAttempts || 1;\n var backoffFactor = retry.backoffFactor || 2.0;\n var delay = (retry.baseDelay == null ? 1000 : retry.baseDelay);\n\n var p = this.send_(type, request, 0, filterTimeMs);\n for (var i = 1; i < maxAttempts; i++) {\n var index = i % request.uris.length;\n p = p.catch(function(delay, index, err) {\n if (err && err.severity == shaka.util.Error.Severity.RECOVERABLE)\n return this.resend_(type, request, delay, index, filterTimeMs);\n throw err;\n }.bind(this, delay, index));\n delay *= backoffFactor;\n }\n\n return p;\n }.bind(this));\n\n // Add the request to the array.\n this.requests_.push(p);\n return p.then(function(response) {\n if (this.requests_.indexOf(p) >= 0) {\n this.requests_.splice(this.requests_.indexOf(p), 1);\n }\n if (this.onSegmentDownloaded_ && !response.fromCache &&\n type == shaka.net.NetworkingEngine.RequestType.SEGMENT) {\n this.onSegmentDownloaded_(response.timeMs, response.data.byteLength);\n }\n return response;\n }.bind(this)).catch(function(e) {\n // Ignore if using |Promise.reject()| to signal destroy.\n if (e) {\n goog.asserts.assert(e instanceof shaka.util.Error, 'Wrong error type');\n e.severity = shaka.util.Error.Severity.CRITICAL;\n }\n\n if (this.requests_.indexOf(p) >= 0) {\n this.requests_.splice(this.requests_.indexOf(p), 1);\n }\n return Promise.reject(e);\n }.bind(this));\n};\n\n\n/**\n * Sends the given request to the correct plugin. This does not handle retry.\n *\n * @param {shaka.net.NetworkingEngine.RequestType} type\n * @param {shakaExtern.Request} request\n * @param {number} index\n * @param {number} requestFilterTime\n * @return {!Promise.<shakaExtern.Response>}\n * @private\n */\nshaka.net.NetworkingEngine.prototype.send_ = function(\n type, request, index, requestFilterTime) {\n // Retries sent after destroy is called are rejected.\n if (this.destroyed_)\n return Promise.reject();\n\n var uri = new goog.Uri(request.uris[index]);\n var scheme = uri.getScheme();\n\n if (!scheme) {\n // If there is no scheme, infer one from the location.\n scheme = shaka.net.NetworkingEngine.getLocationProtocol_();\n goog.asserts.assert(scheme[scheme.length - 1] == ':',\n 'location.protocol expected to end with a colon!');\n // Drop the colon.\n scheme = scheme.slice(0, -1);\n\n // Override the original URI to make the scheme explicit.\n uri.setScheme(scheme);\n request.uris[index] = uri.toString();\n }\n\n var plugin = shaka.net.NetworkingEngine.schemes_[scheme];\n if (!plugin) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.UNSUPPORTED_SCHEME,\n uri));\n }\n\n var startTimeMs = Date.now();\n return plugin(request.uris[index], request, type).then(function(response) {\n if (response.timeMs == undefined)\n response.timeMs = Date.now() - startTimeMs;\n var filterStartMs = Date.now();\n\n var p = Promise.resolve();\n this.responseFilters_.forEach(function(responseFilter) {\n // Response filters are resolved sequentially.\n p = p.then(function() {\n return Promise.resolve(responseFilter(type, response));\n }.bind(this));\n });\n\n // Catch any errors thrown by response filters, and substitute\n // them with a Shaka-native error.\n p = p.catch(function(e) {\n var severity = shaka.util.Error.Severity.CRITICAL;\n if (e instanceof shaka.util.Error)\n severity = e.severity;\n\n throw new shaka.util.Error(\n severity,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.RESPONSE_FILTER_ERROR, e);\n });\n\n return p.then(function() {\n response.timeMs += Date.now() - filterStartMs;\n response.timeMs += requestFilterTime;\n\n return response;\n });\n }.bind(this));\n};\n\n\n/**\n * Resends the request after applying a delay. This does not handle retry.\n *\n * @param {shaka.net.NetworkingEngine.RequestType} type\n * @param {shakaExtern.Request} request\n * @param {number} delayMs The current base delay.\n * @param {number} index\n * @param {number} requestFilterTime\n * @return {!Promise.<shakaExtern.Response>}\n * @private\n */\nshaka.net.NetworkingEngine.prototype.resend_ =\n function(type, request, delayMs, index, requestFilterTime) {\n var p = new shaka.util.PublicPromise();\n\n // Fuzz the delay to avoid tons of clients hitting the server at once\n // after it recovers from whatever is causing it to fail.\n var retry = request.retryParameters || {};\n var fuzzFactor = (retry.fuzzFactor == null ? 0.5 : retry.fuzzFactor);\n var negToPosOne = (Math.random() * 2.0) - 1.0;\n var negToPosFuzzFactor = negToPosOne * fuzzFactor;\n var fuzzedDelay = delayMs * (1.0 + negToPosFuzzFactor);\n shaka.net.NetworkingEngine.setTimeout_(p.resolve, fuzzedDelay);\n\n return p.then(this.send_.bind(this, type, request, index, requestFilterTime));\n};\n\n\n/**\n * This is here only for testability. We can't mock location in our tests on\n * all browsers, so instead we mock this.\n *\n * @return {string} The value of location.protocol.\n * @private\n */\nshaka.net.NetworkingEngine.getLocationProtocol_ = function() {\n return location.protocol;\n};\n\n\n/**\n * This is here only for testability. Mocking global setTimeout can lead to\n * unintended interactions with other tests. So instead, we mock this.\n *\n * @param {Function} fn The callback to invoke when the timeout expires.\n * @param {number} timeoutMs The timeout in milliseconds.\n * @return {number} The timeout ID.\n * @private\n */\nshaka.net.NetworkingEngine.setTimeout_ = function(fn, timeoutMs) {\n return window.setTimeout(fn, timeoutMs);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/net/networking_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.ArrayUtils');\n\n\n/**\n * @namespace shaka.util.ArrayUtils\n * @summary Array utility functions.\n */\n\n\n/**\n * Remove duplicate entries from an array. Order N^2, so use with caution.\n * @param {!Array.<T>} array\n * @param {function(T, T): boolean=} opt_compareFn An optional function which\n * will be used to compare items in the array.\n * @return {!Array.<T>}\n * @template T\n */\nshaka.util.ArrayUtils.removeDuplicates = function(array, opt_compareFn) {\n var result = [];\n for (var i = 0; i < array.length; ++i) {\n var matchFound = false;\n for (var j = 0; j < result.length; ++j) {\n matchFound = opt_compareFn ? opt_compareFn(array[i], result[j]) :\n array[i] === result[j];\n if (matchFound) break;\n }\n if (!matchFound) {\n result.push(array[i]);\n }\n }\n return result;\n};\n\n\n/**\n * Find an item in an array. For use when comparison of entries via == will\n * not suffice.\n * @param {!Array.<T>} array\n * @param {T} value\n * @param {function(T, T): boolean} compareFn A function which will be used to\n * compare items in the array.\n * @return {number} The index, or -1 if not found.\n * @template T\n */\nshaka.util.ArrayUtils.indexOf = function(array, value, compareFn) {\n for (var i = 0; i < array.length; ++i) {\n if (compareFn(array[i], value)) {\n return i;\n }\n }\n return -1;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/array_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.MultiMap');\n\n\n\n/**\n * A simple multimap template.\n * @constructor\n * @struct\n * @template T\n */\nshaka.util.MultiMap = function() {\n /** @private {!Object.<string, !Array.<T>>} */\n this.map_ = {};\n};\n\n\n/**\n * Add a key, value pair to the map.\n * @param {string} key\n * @param {T} value\n */\nshaka.util.MultiMap.prototype.push = function(key, value) {\n if (this.map_.hasOwnProperty(key)) {\n this.map_[key].push(value);\n } else {\n this.map_[key] = [value];\n }\n};\n\n\n/**\n * Get a list of values by key.\n * @param {string} key\n * @return {Array.<T>} or null if no such key exists.\n */\nshaka.util.MultiMap.prototype.get = function(key) {\n var list = this.map_[key];\n // slice() clones the list so that it and the map can each be modified\n // without affecting the other.\n return list ? list.slice() : null;\n};\n\n\n/**\n * Get a list of all values.\n * @return {!Array.<T>}\n */\nshaka.util.MultiMap.prototype.getAll = function() {\n var list = [];\n for (var key in this.map_) {\n list.push.apply(list, this.map_[key]);\n }\n return list;\n};\n\n\n/**\n * Remove a specific value, if it exists.\n * @param {string} key\n * @param {T} value\n */\nshaka.util.MultiMap.prototype.remove = function(key, value) {\n var list = this.map_[key];\n if (!list) return;\n for (var i = 0; i < list.length; ++i) {\n if (list[i] == value) {\n list.splice(i, 1);\n --i;\n }\n }\n};\n\n\n/**\n * Clear all keys and values from the multimap.\n */\nshaka.util.MultiMap.prototype.clear = function() {\n this.map_ = {};\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/multi_map.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.EventManager');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.MultiMap');\n\n\n\n/**\n * Creates a new EventManager. An EventManager maintains a collection of \"event\n * bindings\" between event targets and event listeners.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n */\nshaka.util.EventManager = function() {\n /**\n * Maps an event type to an array of event bindings.\n * @private {shaka.util.MultiMap.<!shaka.util.EventManager.Binding_>}\n */\n this.bindingMap_ = new shaka.util.MultiMap();\n};\n\n\n/**\n * @typedef {function(!Event)}\n */\nshaka.util.EventManager.ListenerType;\n\n\n/**\n * Detaches all event listeners.\n * @override\n */\nshaka.util.EventManager.prototype.destroy = function() {\n this.removeAll();\n this.bindingMap_ = null;\n return Promise.resolve();\n};\n\n\n/**\n * Attaches an event listener to an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {shaka.util.EventManager.ListenerType} listener The event listener.\n */\nshaka.util.EventManager.prototype.listen = function(target, type, listener) {\n if (!this.bindingMap_) return;\n\n var binding = new shaka.util.EventManager.Binding_(target, type, listener);\n this.bindingMap_.push(type, binding);\n};\n\n\n/**\n * Attaches an event listener to an event target. The listener will be removed\n * when the first instance of the event is fired.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {shaka.util.EventManager.ListenerType} listener The event listener.\n */\nshaka.util.EventManager.prototype.listenOnce =\n function(target, type, listener) {\n // Install a shim listener that will stop listening after the first event.\n this.listen(target, type, function(event) {\n // Stop listening to this event.\n this.unlisten(target, type);\n // Call the original listener.\n listener(event);\n }.bind(this));\n};\n\n\n/**\n * Detaches an event listener from an event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n */\nshaka.util.EventManager.prototype.unlisten = function(target, type) {\n if (!this.bindingMap_) return;\n\n var list = this.bindingMap_.get(type) || [];\n\n for (var i = 0; i < list.length; ++i) {\n var binding = list[i];\n\n if (binding.target == target) {\n binding.unlisten();\n this.bindingMap_.remove(type, binding);\n }\n }\n};\n\n\n/**\n * Detaches all event listeners from all targets.\n */\nshaka.util.EventManager.prototype.removeAll = function() {\n if (!this.bindingMap_) return;\n\n var list = this.bindingMap_.getAll();\n\n for (var i = 0; i < list.length; ++i) {\n list[i].unlisten();\n }\n\n this.bindingMap_.clear();\n};\n\n\n\n/**\n * Creates a new Binding_ and attaches the event listener to the event target.\n * @param {EventTarget} target The event target.\n * @param {string} type The event type.\n * @param {shaka.util.EventManager.ListenerType} listener The event listener.\n * @constructor\n * @private\n */\nshaka.util.EventManager.Binding_ = function(target, type, listener) {\n /** @type {EventTarget} */\n this.target = target;\n\n /** @type {string} */\n this.type = type;\n\n /** @type {?shaka.util.EventManager.ListenerType} */\n this.listener = listener;\n\n this.target.addEventListener(type, listener, false);\n};\n\n\n/**\n * Detaches the event listener from the event target. This does nothing if the\n * event listener is already detached.\n */\nshaka.util.EventManager.Binding_.prototype.unlisten = function() {\n goog.asserts.assert(this.target, 'Missing target');\n this.target.removeEventListener(this.type, this.listener, false);\n\n this.target = null;\n this.listener = null;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/event_manager.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.MapUtils');\n\n\n/**\n * @namespace shaka.util.MapUtils\n * @summary A set of map/object utility functions.\n */\n\n\n/**\n * Returns true if the map is empty; otherwise, returns false.\n *\n * @param {Object.<KEY, VALUE>} object\n * @return {boolean}\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.empty = function(object) {\n return !object || Object.keys(object).length == 0;\n};\n\n\n/**\n * Gets the map's values.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @return {!Array.<VALUE>}\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.values = function(object) {\n return Object.keys(object).map(function(key) { return object[key]; });\n};\n\n\n/**\n * Converts the values in the given Map to a different value.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @param {function(VALUE, KEY=):OUTPUT} callback\n * @return {!Object.<KEY, OUTPUT>}\n * @template KEY,VALUE,OUTPUT\n */\nshaka.util.MapUtils.map = function(object, callback) {\n return Object.keys(object).reduce(function(ret, key) {\n var value = object[key];\n ret[key] = callback(value, key);\n return ret;\n }, {});\n};\n\n\n/**\n * Returns true if every entry matches the predicate.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @param {function(KEY, VALUE):boolean} callback\n * @return {boolean}\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.every = function(object, callback) {\n return Object.keys(object).every(function(key) {\n return callback(key, object[key]);\n });\n};\n\n\n/**\n * Invokes the callback for each entry in the map.\n *\n * @param {!Object.<KEY, VALUE>} object\n * @param {function(KEY, VALUE)} callback\n * @template KEY,VALUE\n */\nshaka.util.MapUtils.forEach = function(object, callback) {\n Object.keys(object).forEach(function(key) {\n callback(key, object[key]);\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/map_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.StringUtils');\n\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\n\n\n/**\n * @namespace shaka.util.StringUtils\n * @summary A set of string utility functions.\n * @exportDoc\n */\n\n\n/**\n * Creates a string from the given buffer as UTF-8 encoding.\n *\n * @param {?BufferSource} data\n * @return {string}\n * @throws {shaka.util.Error}\n * @export\n */\nshaka.util.StringUtils.fromUTF8 = function(data) {\n if (!data) return '';\n\n var uint8 = new Uint8Array(data);\n // If present, strip off the UTF-8 BOM.\n if (uint8[0] == 0xef && uint8[1] == 0xbb && uint8[2] == 0xbf) {\n uint8 = uint8.subarray(3);\n }\n\n // http://stackoverflow.com/a/13691499\n var utf8 = shaka.util.StringUtils.fromCharCode_(uint8);\n // This converts each character in the string to an escape sequence. If the\n // character is in the ASCII range, it is not converted; otherwise it is\n // converted to a URI escape sequence.\n // Example: '\\x67\\x35\\xe3\\x82\\xac' -> 'g#%E3%82%AC'\n var escaped = escape(utf8);\n // Decode the escaped sequence. This will interpret UTF-8 sequences into the\n // correct character.\n // Example: 'g#%E3%82%AC' -> 'g#€'\n try {\n return decodeURIComponent(escaped);\n } catch (e) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.BAD_ENCODING);\n }\n};\n\n\n/**\n * Creates a string from the given buffer as UTF-16 encoding.\n *\n * @param {?BufferSource} data\n * @param {boolean} littleEndian true to read little endian, false to read big.\n * @param {boolean=} opt_noThrow true to avoid throwing in cases where we may\n * expect invalid input. If noThrow is true and the data has an odd length,\n * it will be truncated.\n * @return {string}\n * @throws {shaka.util.Error}\n * @export\n */\nshaka.util.StringUtils.fromUTF16 = function(data, littleEndian, opt_noThrow) {\n if (!data) return '';\n\n if (!opt_noThrow && data.byteLength % 2 != 0) {\n shaka.log.error('Data has an incorrect length, must be even.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.BAD_ENCODING);\n }\n\n /** @type {ArrayBuffer} */\n var buffer;\n if (data instanceof ArrayBuffer) {\n buffer = data;\n } else {\n // Have to create a new buffer because the argument may be a smaller\n // view on a larger ArrayBuffer. We cannot use an ArrayBufferView in\n // a DataView.\n var temp = new Uint8Array(data.byteLength);\n temp.set(new Uint8Array(data));\n buffer = temp.buffer;\n }\n\n // Use a DataView to ensure correct endianness.\n var length = Math.floor(data.byteLength / 2);\n var arr = new Uint16Array(length);\n var dataView = new DataView(buffer);\n for (var i = 0; i < length; i++) {\n arr[i] = dataView.getUint16(i * 2, littleEndian);\n }\n return shaka.util.StringUtils.fromCharCode_(arr);\n};\n\n\n/**\n * Creates a string from the given buffer, auto-detecting the encoding that is\n * being used. If it cannot detect the encoding, it will throw an exception.\n *\n * @param {?BufferSource} data\n * @return {string}\n * @throws {shaka.util.Error}\n * @export\n */\nshaka.util.StringUtils.fromBytesAutoDetect = function(data) {\n var StringUtils = shaka.util.StringUtils;\n\n var uint8 = new Uint8Array(data);\n if (uint8[0] == 0xef && uint8[1] == 0xbb && uint8[2] == 0xbf)\n return StringUtils.fromUTF8(uint8);\n else if (uint8[0] == 0xfe && uint8[1] == 0xff)\n return StringUtils.fromUTF16(uint8.subarray(2), false /* littleEndian */);\n else if (uint8[0] == 0xff && uint8[1] == 0xfe)\n return StringUtils.fromUTF16(uint8.subarray(2), true /* littleEndian */);\n\n var isAscii = (function(arr, i) {\n // arr[i] >= ' ' && arr[i] <= '~';\n return arr.byteLength <= i || (arr[i] >= 0x20 && arr[i] <= 0x7e);\n }.bind(null, uint8));\n\n shaka.log.debug('Unable to find byte-order-mark, making an educated guess.');\n if (uint8[0] == 0 && uint8[2] == 0)\n return StringUtils.fromUTF16(data, false /* littleEndian */);\n else if (uint8[1] == 0 && uint8[3] == 0)\n return StringUtils.fromUTF16(data, true /* littleEndian */);\n else if (isAscii(0) && isAscii(1) && isAscii(2) && isAscii(3))\n return StringUtils.fromUTF8(data);\n\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.UNABLE_TO_DETECT_ENCODING);\n};\n\n\n/**\n * Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.\n *\n * @param {string} str\n * @return {!ArrayBuffer}\n * @export\n */\nshaka.util.StringUtils.toUTF8 = function(str) {\n // http://stackoverflow.com/a/13691499\n // Converts the given string to a URI encoded string. If a character falls\n // in the ASCII range, it is not converted; otherwise it will be converted to\n // a series of URI escape sequences according to UTF-8.\n // Example: 'g#€' -> 'g#%E3%82%AC'\n var encoded = encodeURIComponent(str);\n // Convert each escape sequence individually into a character. Each escape\n // sequence is interpreted as a code-point, so if an escape sequence happens\n // to be part of a multi-byte sequence, each byte will be converted to a\n // single character.\n // Example: 'g#%E3%82%AC' -> '\\x67\\x35\\xe3\\x82\\xac'\n var utf8 = unescape(encoded);\n\n var result = new Uint8Array(utf8.length);\n for (var i = 0; i < utf8.length; ++i) {\n result[i] = utf8.charCodeAt(i);\n }\n return result.buffer;\n};\n\n\n/**\n * Creates a new string from the given array of char codes.\n *\n * @param {!TypedArray} args\n * @return {string}\n * @private\n */\nshaka.util.StringUtils.fromCharCode_ = function(args) {\n var max = 16000;\n var ret = '';\n for (var i = 0; i < args.length; i += max) {\n var subArray = args.subarray(i, i + max);\n ret += String.fromCharCode.apply(null, subArray);\n }\n\n return ret;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/string_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Timer');\n\n\n\n/**\n * A simple cancelable timer.\n * @param {Function} callback\n * @constructor\n * @struct\n */\nshaka.util.Timer = function(callback) {\n /** @private {?number} */\n this.id_ = null;\n\n /** @private {Function} */\n this.callback_ = (function() {\n this.id_ = null;\n callback();\n }.bind(this));\n};\n\n\n/**\n * Cancel the timer, if it's running.\n */\nshaka.util.Timer.prototype.cancel = function() {\n if (this.id_ != null) {\n clearTimeout(this.id_);\n this.id_ = null;\n }\n};\n\n\n/**\n * Schedule the timer, canceling any previous scheduling.\n * @param {number} seconds\n */\nshaka.util.Timer.prototype.schedule = function(seconds) {\n this.cancel();\n this.id_ = setTimeout(this.callback_, seconds * 1000);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/timer.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * @namespace shaka.util.Uint8ArrayUtils\n * @summary A set of Uint8Array utility functions.\n * @exportDoc\n */\n\n\n/**\n * Convert a Uint8Array to a base64 string. The output will always use the\n * alternate encoding/alphabet also known as \"base64url\".\n * @param {!Uint8Array} arr\n * @param {boolean=} opt_padding If true, pad the output with equals signs.\n * Defaults to true.\n * @return {string}\n * @export\n */\nshaka.util.Uint8ArrayUtils.toBase64 = function(arr, opt_padding) {\n // btoa expects a \"raw string\" where each character is interpreted as a byte.\n var bytes = String.fromCharCode.apply(null, arr);\n var padding = (opt_padding == undefined) ? true : opt_padding;\n var base64 = window.btoa(bytes).replace(/\\+/g, '-').replace(/\\//g, '_');\n return padding ? base64 : base64.replace(/=*$/, '');\n};\n\n\n/**\n * Convert a base64 string to a Uint8Array. Accepts either the standard\n * alphabet or the alternate \"base64url\" alphabet.\n * @param {string} str\n * @return {!Uint8Array}\n * @export\n */\nshaka.util.Uint8ArrayUtils.fromBase64 = function(str) {\n // atob creates a \"raw string\" where each character is interpreted as a byte.\n var bytes = window.atob(str.replace(/-/g, '+').replace(/_/g, '/'));\n var result = new Uint8Array(bytes.length);\n for (var i = 0; i < bytes.length; ++i) {\n result[i] = bytes.charCodeAt(i);\n }\n return result;\n};\n\n\n/**\n * Convert a hex string to a Uint8Array.\n * @param {string} str\n * @return {!Uint8Array}\n * @export\n */\nshaka.util.Uint8ArrayUtils.fromHex = function(str) {\n var arr = new Uint8Array(str.length / 2);\n for (var i = 0; i < str.length; i += 2) {\n arr[i / 2] = window.parseInt(str.substr(i, 2), 16);\n }\n return arr;\n};\n\n\n/**\n * Convert a Uint8Array to a hex string.\n * @param {!Uint8Array} arr\n * @return {string}\n * @export\n */\nshaka.util.Uint8ArrayUtils.toHex = function(arr) {\n var hex = '';\n for (var i = 0; i < arr.length; ++i) {\n var value = arr[i].toString(16);\n if (value.length == 1) value = '0' + value;\n hex += value;\n }\n return hex;\n};\n\n\n/**\n * Compare two Uint8Arrays for equality.\n * @param {Uint8Array} arr1\n * @param {Uint8Array} arr2\n * @return {boolean}\n * @export\n */\nshaka.util.Uint8ArrayUtils.equal = function(arr1, arr2) {\n if (!arr1 && !arr2) return true;\n if (!arr1 || !arr2) return false;\n if (arr1.length != arr2.length) return false;\n for (var i = 0; i < arr1.length; ++i) {\n if (arr1[i] != arr2[i]) return false;\n }\n return true;\n};\n\n\n/**\n * Concatenate Uint8Arrays.\n * @param {...Uint8Array} var_args\n * @return {Uint8Array}\n * @export\n */\nshaka.util.Uint8ArrayUtils.concat = function(var_args) {\n var totalLength = 0;\n for (var i = 0; i < arguments.length; ++i) {\n totalLength += arguments[i].length;\n }\n\n var result = new Uint8Array(totalLength);\n var offset = 0;\n for (var i = 0; i < arguments.length; ++i) {\n result.set(arguments[i], offset);\n offset += arguments[i].length;\n }\n return result;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/uint8array_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.DrmEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.ArrayUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.Timer');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n\n/**\n * @constructor\n * @param {!shaka.net.NetworkingEngine} networkingEngine\n * @param {function(!shaka.util.Error)} onError Called when an error occurs.\n * @param {function(!Object.<string, string>)} onKeyStatus Called when key\n * status changes. Argument is a map of hex key IDs to statuses.\n * @param {function(string, number)} onExpirationUpdated\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.DrmEngine = function(\n networkingEngine, onError, onKeyStatus, onExpirationUpdated) {\n /** @private {Array.<string>} */\n this.supportedTypes_ = null;\n\n /** @private {MediaKeys} */\n this.mediaKeys_ = null;\n\n /** @private {HTMLMediaElement} */\n this.video_ = null;\n\n /** @private {boolean} */\n this.initialized_ = false;\n\n /** @private {?shakaExtern.DrmInfo} */\n this.currentDrmInfo_ = null;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {!Array.<shaka.media.DrmEngine.ActiveSession>} */\n this.activeSessions_ = [];\n\n /** @private {!Array.<string>} */\n this.offlineSessionIds_ = [];\n\n /** @private {!shaka.util.PublicPromise} */\n this.allSessionsLoaded_ = new shaka.util.PublicPromise();\n\n /** @private {shaka.net.NetworkingEngine} */\n this.networkingEngine_ = networkingEngine;\n\n /** @private {?shakaExtern.DrmConfiguration} */\n this.config_ = null;\n\n /** @private {?function(!shaka.util.Error)} */\n this.onError_ = (function(err) {\n this.allSessionsLoaded_.reject(err);\n onError(err);\n }.bind(this));\n\n /** @private {!Object.<string, string>} */\n this.keyStatusByKeyId_ = {};\n\n /** @private {?function(!Object.<string, string>)} */\n this.onKeyStatus_ = onKeyStatus;\n\n /** @private {?function(string, number)} */\n this.onExpirationUpdated_ = onExpirationUpdated;\n\n /** @private {shaka.util.Timer} */\n this.keyStatusTimer_ = new shaka.util.Timer(\n this.processKeyStatusChanges_.bind(this));\n\n /** @private {boolean} */\n this.destroyed_ = false;\n\n /** @private {boolean} */\n this.isOffline_ = false;\n\n /** @private {!Array.<!MediaKeyMessageEvent>} */\n this.mediaKeyMessageEvents_ = [];\n\n /** @private {boolean} */\n this.initialRequestsSent_ = false;\n\n /** @private {?number} */\n this.expirationInterval_ = setInterval(this.pollExpiration_.bind(this), 1000);\n\n // Add a catch to the Promise to avoid console logs about uncaught errors.\n this.allSessionsLoaded_.catch(function() {});\n};\n\n\n/**\n * @typedef {{\n * loaded: boolean,\n * initData: Uint8Array,\n * session: !MediaKeySession,\n * oldExpiration: number,\n * updatePromise: shaka.util.PublicPromise\n * }}\n *\n * @description A record to track sessions and suppress duplicate init data.\n * @property {boolean} loaded\n * True once the key status has been updated (to a non-pending state). This\n * does not mean the session is 'usable'.\n * @property {Uint8Array} initData\n * The init data used to create the session.\n * @property {!MediaKeySession} session\n * The session object.\n * @property {number} oldExpiration\n * The expiration of the session on the last check. This is used to fire\n * an event when it changes.\n * @property {shaka.util.PublicPromise} updatePromise\n * An optional Promise that will be resolved/rejected on the next update()\n * call. This is used to track the 'license-release' message when calling\n * remove().\n */\nshaka.media.DrmEngine.ActiveSession;\n\n\n/** @override */\nshaka.media.DrmEngine.prototype.destroy = function() {\n var Functional = shaka.util.Functional;\n this.destroyed_ = true;\n\n var async = this.activeSessions_.map(function(activeSession) {\n // Ignore any errors when closing the sessions. One such error would be\n // an invalid state error triggered by closing a session which has not\n // generated any key requests.\n // Chrome sometimes returns |undefined|: https://crbug.com/690664\n var p = activeSession.session.close() || Promise.resolve();\n return p.catch(Functional.noop);\n });\n this.allSessionsLoaded_.reject();\n\n if (this.eventManager_)\n async.push(this.eventManager_.destroy());\n\n if (this.video_) {\n goog.asserts.assert(!this.video_.src, 'video src must be removed first!');\n async.push(this.video_.setMediaKeys(null).catch(Functional.noop));\n }\n\n if (this.expirationInterval_) {\n clearInterval(this.expirationInterval_);\n this.expirationInterval_ = null;\n }\n\n if (this.keyStatusTimer_) {\n this.keyStatusTimer_.cancel();\n }\n this.keyStatusTimer_ = null;\n\n this.currentDrmInfo_ = null;\n this.supportedTypes_ = null;\n this.mediaKeys_ = null;\n this.video_ = null;\n this.eventManager_ = null;\n this.activeSessions_ = [];\n this.offlineSessionIds_ = [];\n this.networkingEngine_ = null; // We don't own it, don't destroy() it.\n this.config_ = null;\n this.onError_ = null;\n this.onExpirationUpdated_ = null;\n\n return Promise.all(async);\n};\n\n\n/**\n * Called by the Player to provide an updated configuration any time it changes.\n * Must be called at least once before init().\n *\n * @param {shakaExtern.DrmConfiguration} config\n */\nshaka.media.DrmEngine.prototype.configure = function(config) {\n this.config_ = config;\n};\n\n\n/**\n * Negotiate for a key system and set up MediaKeys.\n * @param {!shakaExtern.Manifest} manifest The manifest is read for MIME type\n * and DRM information to query EME. If the 'clearKeys' configuration is\n * used, the manifest will be modified to force the use of Clear Key.\n * @param {boolean} offline True if we are storing or loading offline content.\n * @return {!Promise} Resolved if/when a key system has been chosen.\n */\nshaka.media.DrmEngine.prototype.init = function(manifest, offline) {\n goog.asserts.assert(this.config_,\n 'DrmEngine configure() must be called before init()!');\n\n /** @type {!Object.<string, MediaKeySystemConfiguration>} */\n var configsByKeySystem = {};\n\n /** @type {!Array.<string>} */\n var keySystemsInOrder = [];\n\n // |isOffline_| determines what kind of session to create. The argument to\n // |prepareMediaKeyConfigs_| determines the kind of CDM to query for. So\n // we still need persistent state when we are loading offline sessions.\n this.isOffline_ = offline;\n this.offlineSessionIds_ = manifest.offlineSessionIds;\n this.prepareMediaKeyConfigs_(\n manifest, offline || manifest.offlineSessionIds.length > 0,\n configsByKeySystem, keySystemsInOrder);\n\n if (!keySystemsInOrder.length) {\n // Unencrypted.\n this.initialized_ = true;\n return Promise.resolve();\n }\n\n return this.queryMediaKeys_(configsByKeySystem, keySystemsInOrder);\n};\n\n\n/**\n * Attach MediaKeys to the video element and start processing events.\n * @param {HTMLMediaElement} video\n * @return {!Promise}\n */\nshaka.media.DrmEngine.prototype.attach = function(video) {\n if (!this.mediaKeys_) {\n // Unencrypted, or so we think. We listen for encrypted events in order to\n // warn when the stream is encrypted, even though the manifest does not know\n // it.\n // Don't complain about this twice, so just listenOnce().\n this.eventManager_.listenOnce(video, 'encrypted', function(event) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.ENCRYPTED_CONTENT_WITHOUT_DRM_INFO));\n }.bind(this));\n return Promise.resolve();\n }\n\n this.video_ = video;\n\n this.eventManager_.listenOnce(this.video_, 'play', this.onPlay_.bind(this));\n\n var setMediaKeys = this.video_.setMediaKeys(this.mediaKeys_);\n setMediaKeys = setMediaKeys.catch(function(exception) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_ATTACH_TO_VIDEO,\n exception.message));\n });\n\n var setServerCertificate = null;\n if (this.currentDrmInfo_.serverCertificate) {\n setServerCertificate = this.mediaKeys_.setServerCertificate(\n this.currentDrmInfo_.serverCertificate).then(function(supported) {\n if (!supported) {\n shaka.log.warning('Server certificates are not supported by the key' +\n ' system. The server certificate has been ignored.');\n }\n }).catch(function(exception) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.INVALID_SERVER_CERTIFICATE,\n exception.message));\n });\n }\n\n return Promise.all([setMediaKeys, setServerCertificate]).then(function() {\n if (this.destroyed_) return Promise.reject();\n\n this.createOrLoad();\n if (!this.currentDrmInfo_.initData.length &&\n !this.offlineSessionIds_.length) {\n // Explicit init data for any one stream or an offline session is\n // sufficient to suppress 'encrypted' events for all streams.\n var onEncrypted = /** @type {shaka.util.EventManager.ListenerType} */(\n this.onEncrypted_.bind(this));\n this.eventManager_.listen(this.video_, 'encrypted', onEncrypted);\n }\n }.bind(this)).catch(function(error) {\n if (this.destroyed_) return Promise.resolve(); // Ignore destruction errors\n return Promise.reject(error);\n }.bind(this));\n};\n\n\n/**\n * Removes the given offline sessions and deletes their data. Must call init()\n * before this. This will wait until the 'license-release' message is handled\n * and the resulting Promise will be rejected if there is an error with that.\n *\n * @param {!Array.<string>} sessions\n * @return {!Promise}\n */\nshaka.media.DrmEngine.prototype.removeSessions = function(sessions) {\n goog.asserts.assert(this.mediaKeys_ || !sessions.length,\n 'Must call init() before removeSessions');\n return Promise.all(sessions.map(function(sessionId) {\n return this.loadOfflineSession_(sessionId).then(function(session) {\n // This will be null on error, such as session not found.\n if (session) {\n var p = new shaka.util.PublicPromise();\n // TODO: Consider adding a timeout to get the 'message' event.\n // Note that the 'message' event will get raised after the remove()\n // promise resolves.\n\n for (var i = 0; i < this.activeSessions_.length; i++) {\n if (this.activeSessions_[i].session == session) {\n this.activeSessions_[i].updatePromise = p;\n break;\n }\n }\n return Promise.all([session.remove(), p]);\n }\n }.bind(this));\n }.bind(this)));\n};\n\n\n/**\n * Creates the sessions for the init data and waits for them to become ready.\n *\n * @return {!Promise}\n */\nshaka.media.DrmEngine.prototype.createOrLoad = function() {\n var initDatas = this.currentDrmInfo_ ? this.currentDrmInfo_.initData : [];\n initDatas.forEach(function(initDataOverride) {\n this.createTemporarySession_(\n initDataOverride.initDataType, initDataOverride.initData);\n }.bind(this));\n this.offlineSessionIds_.forEach(function(sessionId) {\n this.loadOfflineSession_(sessionId);\n }.bind(this));\n\n if (!initDatas.length && !this.offlineSessionIds_.length)\n this.allSessionsLoaded_.resolve();\n return this.allSessionsLoaded_;\n};\n\n\n/** @return {boolean} */\nshaka.media.DrmEngine.prototype.initialized = function() {\n return this.initialized_;\n};\n\n\n/** @return {string} */\nshaka.media.DrmEngine.prototype.keySystem = function() {\n return this.currentDrmInfo_ ? this.currentDrmInfo_.keySystem : '';\n};\n\n\n/**\n * Returns an array of the media types supported by the current key system.\n * These will be full mime types (e.g. 'video/webm; codecs=\"vp8\"').\n *\n * @return {Array.<string>}\n */\nshaka.media.DrmEngine.prototype.getSupportedTypes = function() {\n return this.supportedTypes_;\n};\n\n\n/**\n * Returns the ID of the sessions currently active.\n *\n * @return {!Array.<string>}\n */\nshaka.media.DrmEngine.prototype.getSessionIds = function() {\n return this.activeSessions_.map(function(session) {\n return session.session.sessionId;\n });\n};\n\n\n/**\n * Returns the next expiration time, or Infinity.\n * @return {number}\n */\nshaka.media.DrmEngine.prototype.getExpiration = function() {\n var expirations = this.activeSessions_.map(function(session) {\n var expiration = session.session.expiration;\n return isNaN(expiration) ? Infinity : expiration;\n });\n // This will equal Infinity if there are no entries.\n return Math.min.apply(Math, expirations);\n};\n\n\n/**\n * Returns the DrmInfo that was used to initialize the current key system.\n *\n * @return {?shakaExtern.DrmInfo}\n */\nshaka.media.DrmEngine.prototype.getDrmInfo = function() {\n return this.currentDrmInfo_;\n};\n\n\n/**\n * @param {!shakaExtern.Manifest} manifest\n * @param {boolean} offline True if we are storing or loading offline content.\n * @param {!Object.<string, MediaKeySystemConfiguration>} configsByKeySystem\n * (Output parameter.) A dictionary of configs, indexed by key system.\n * @param {!Array.<string>} keySystemsInOrder\n * (Output parameter.) A list of key systems in the order in which we\n * encounter them.\n * @see https://goo.gl/nwdYnY for MediaKeySystemConfiguration spec\n * @private\n */\nshaka.media.DrmEngine.prototype.prepareMediaKeyConfigs_ =\n function(manifest, offline, configsByKeySystem, keySystemsInOrder) {\n var clearKeyDrmInfo = this.configureClearKey_();\n\n manifest.periods.forEach(function(period) {\n period.variants.forEach(function(variant) {\n // clearKey config overrides manifest DrmInfo if present.\n // The manifest is modified so that filtering in Player still works.\n if (clearKeyDrmInfo) {\n variant.drmInfos = [clearKeyDrmInfo];\n }\n\n variant.drmInfos.forEach(function(drmInfo) {\n this.fillInDrmInfoDefaults_(drmInfo);\n\n // Chromecast has a variant of PlayReady that uses a different key\n // system ID. Since manifest parsers convert the standard PlayReady\n // UUID to the standard PlayReady key system ID, here we will switch\n // to the Chromecast version if we are running on that platform.\n // Note that this must come after fillInDrmInfoDefaults_, since the\n // player config uses the standard PlayReady ID for license server\n // configuration.\n if (window.cast && window.cast.__platform__) {\n if (drmInfo.keySystem == 'com.microsoft.playready') {\n drmInfo.keySystem = 'com.chromecast.playready';\n }\n }\n\n var config = configsByKeySystem[drmInfo.keySystem];\n if (!config) {\n config = {\n // ignore initDataTypes\n audioCapabilities: [],\n videoCapabilities: [],\n distinctiveIdentifier: 'optional',\n persistentState: offline ? 'required' : 'optional',\n sessionTypes: [offline ? 'persistent-license' : 'temporary'],\n label: drmInfo.keySystem,\n drmInfos: [] // tracked by us, ignored by EME\n };\n configsByKeySystem[drmInfo.keySystem] = config;\n keySystemsInOrder.push(drmInfo.keySystem);\n }\n\n config.drmInfos.push(drmInfo);\n\n if (drmInfo.distinctiveIdentifierRequired)\n config.distinctiveIdentifier = 'required';\n\n if (drmInfo.persistentStateRequired)\n config.persistentState = 'required';\n\n var streams = [];\n if (variant.video) streams.push(variant.video);\n if (variant.audio) streams.push(variant.audio);\n\n streams.forEach(function(stream) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n /** @type {!Array.<!MediaKeySystemMediaCapability>} */\n var capabilities = (stream.type == ContentType.VIDEO) ?\n config.videoCapabilities : config.audioCapabilities;\n /** @type {string} */\n var robustness = ((stream.type == ContentType.VIDEO) ?\n drmInfo.videoRobustness : drmInfo.audioRobustness) || '';\n\n var fullMimeType = stream.mimeType;\n if (stream.codecs) {\n fullMimeType += '; codecs=\"' + stream.codecs + '\"';\n }\n\n capabilities.push({\n robustness: robustness,\n contentType: fullMimeType\n });\n }.bind(this)); // streams.forEach (variant.video, variant.audio)\n }.bind(this)); // variant.drmInfos.forEach\n }.bind(this)); // periods.variants.forEach\n }.bind(this)); // manifest.perios.forEach\n};\n\n\n/**\n * @param {!Object.<string, MediaKeySystemConfiguration>} configsByKeySystem\n * A dictionary of configs, indexed by key system.\n * @param {!Array.<string>} keySystemsInOrder\n * A list of key systems in the order in which we should query them.\n * On a browser which supports multiple key systems, the order may indicate\n * a real preference for the application.\n * @return {!Promise} Resolved if/when a key system has been chosen.\n * @private\n */\nshaka.media.DrmEngine.prototype.queryMediaKeys_ =\n function(configsByKeySystem, keySystemsInOrder) {\n if (keySystemsInOrder.length == 1 && keySystemsInOrder[0] == '') {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.NO_RECOGNIZED_KEY_SYSTEMS));\n }\n\n // Wait to reject this initial Promise until we have built the entire chain.\n var instigator = new shaka.util.PublicPromise();\n var p = instigator;\n\n // Try key systems with configured license servers first. We only have to try\n // key systems without configured license servers for diagnostic reasons, so\n // that we can differentiate between \"none of these key systems are available\"\n // and \"some are available, but you did not configure them properly.\" The\n // former takes precedence.\n [true, false].forEach(function(shouldHaveLicenseServer) {\n keySystemsInOrder.forEach(function(keySystem) {\n var config = configsByKeySystem[keySystem];\n\n var hasLicenseServer = config.drmInfos.some(function(info) {\n return !!info.licenseServerUri;\n });\n if (hasLicenseServer != shouldHaveLicenseServer) return;\n\n // If there are no tracks of a type, these should be not present.\n // Otherwise the query will fail.\n if (config.audioCapabilities.length == 0) {\n delete config.audioCapabilities;\n }\n if (config.videoCapabilities.length == 0) {\n delete config.videoCapabilities;\n }\n\n p = p.catch(function() {\n if (this.destroyed_) return Promise.reject();\n return navigator.requestMediaKeySystemAccess(keySystem, [config]);\n }.bind(this));\n }.bind(this));\n }.bind(this));\n\n p = p.catch(function() {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE));\n });\n\n p = p.then(function(mediaKeySystemAccess) {\n if (this.destroyed_) return Promise.reject();\n\n // TODO: Remove once Edge has released a fix for https://goo.gl/qMeV7v\n var isEdge = navigator.userAgent.indexOf('Edge/') >= 0;\n\n // Store the capabilities of the key system.\n var realConfig = mediaKeySystemAccess.getConfiguration();\n var audioCaps = realConfig.audioCapabilities || [];\n var videoCaps = realConfig.videoCapabilities || [];\n var caps = audioCaps.concat(videoCaps);\n this.supportedTypes_ = caps.map(function(c) { return c.contentType; });\n if (isEdge) {\n // Edge 14 does not report correct capabilities. It will only report the\n // first MIME type even if the others are supported. To work around this,\n // set the supported types to null, which Player will use as a signal that\n // the information is not available.\n // See: https://goo.gl/qMeV7v\n this.supportedTypes_ = null;\n }\n goog.asserts.assert(!this.supportedTypes_ || this.supportedTypes_.length,\n 'We should get at least one supported MIME type');\n\n var originalConfig = configsByKeySystem[mediaKeySystemAccess.keySystem];\n this.createCurrentDrmInfo_(\n mediaKeySystemAccess.keySystem, originalConfig,\n originalConfig.drmInfos);\n\n if (!this.currentDrmInfo_.licenseServerUri) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.NO_LICENSE_SERVER_GIVEN));\n }\n\n return mediaKeySystemAccess.createMediaKeys();\n }.bind(this)).then(function(mediaKeys) {\n if (this.destroyed_) return Promise.reject();\n\n this.mediaKeys_ = mediaKeys;\n this.initialized_ = true;\n }.bind(this)).catch(function(exception) {\n if (this.destroyed_) return Promise.resolve(); // Ignore destruction errors\n\n // Don't rewrap a shaka.util.Error from earlier in the chain:\n this.currentDrmInfo_ = null;\n this.supportedTypes_ = null;\n if (exception instanceof shaka.util.Error) {\n return Promise.reject(exception);\n }\n\n // We failed to create MediaKeys. This generally shouldn't happen.\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_CDM,\n exception.message));\n }.bind(this));\n\n instigator.reject();\n return p;\n};\n\n\n/**\n * Use this.config_ to fill in missing values in drmInfo.\n * @param {shakaExtern.DrmInfo} drmInfo\n * @private\n */\nshaka.media.DrmEngine.prototype.fillInDrmInfoDefaults_ = function(drmInfo) {\n var keySystem = drmInfo.keySystem;\n\n if (!keySystem) {\n // This is a placeholder from the manifest parser for an unrecognized key\n // system. Skip this entry, to avoid logging nonsensical errors.\n return;\n }\n\n if (!drmInfo.licenseServerUri) {\n var server = this.config_.servers[keySystem];\n if (server) {\n drmInfo.licenseServerUri = server;\n } else {\n shaka.log.error('No license server configured for ' + keySystem);\n }\n }\n\n if (!drmInfo.keyIds) {\n drmInfo.keyIds = [];\n }\n\n var advanced = this.config_.advanced[keySystem];\n if (advanced) {\n if (!drmInfo.distinctiveIdentifierRequired) {\n drmInfo.distinctiveIdentifierRequired =\n advanced.distinctiveIdentifierRequired;\n }\n\n if (!drmInfo.persistentStateRequired) {\n drmInfo.persistentStateRequired = advanced.persistentStateRequired;\n }\n\n if (!drmInfo.videoRobustness) {\n drmInfo.videoRobustness = advanced.videoRobustness;\n }\n\n if (!drmInfo.audioRobustness) {\n drmInfo.audioRobustness = advanced.audioRobustness;\n }\n\n if (!drmInfo.serverCertificate) {\n drmInfo.serverCertificate = advanced.serverCertificate;\n }\n }\n};\n\n\n/**\n * Create a DrmInfo using configured clear keys.\n * The server URI will be a data URI which decodes to a clearkey license.\n * @return {?shakaExtern.DrmInfo} or null if clear keys are not configured.\n * @private\n * @see https://goo.gl/6nPdhF for the spec on the clearkey license format.\n */\nshaka.media.DrmEngine.prototype.configureClearKey_ = function() {\n var hasClearKeys = !shaka.util.MapUtils.empty(this.config_.clearKeys);\n if (!hasClearKeys) return null;\n\n var StringUtils = shaka.util.StringUtils;\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n var keys = [];\n var keyIds = [];\n\n for (var keyIdHex in this.config_.clearKeys) {\n var keyHex = this.config_.clearKeys[keyIdHex];\n\n var keyId = Uint8ArrayUtils.fromHex(keyIdHex);\n var key = Uint8ArrayUtils.fromHex(keyHex);\n var keyObj = {\n kty: 'oct',\n kid: Uint8ArrayUtils.toBase64(keyId, false),\n k: Uint8ArrayUtils.toBase64(key, false)\n };\n\n keys.push(keyObj);\n keyIds.push(keyObj.kid);\n }\n\n var jwkSet = {keys: keys};\n var license = JSON.stringify(jwkSet);\n\n // Use the keyids init data since is suggested by EME.\n // Suggestion: https://goo.gl/R72xp4\n // Format: https://goo.gl/75RCP6\n var initDataStr = JSON.stringify({'kids': keyIds});\n var initData = new Uint8Array(StringUtils.toUTF8(initDataStr));\n var initDatas = [{initData: initData, initDataType: 'keyids'}];\n\n return {\n keySystem: 'org.w3.clearkey',\n licenseServerUri: 'data:application/json;base64,' + window.btoa(license),\n distinctiveIdentifierRequired: false,\n persistentStateRequired: false,\n audioRobustness: '',\n videoRobustness: '',\n serverCertificate: null,\n initData: initDatas,\n keyIds: []\n };\n};\n\n\n/**\n * Creates a DrmInfo object describing the settings used to initialize the\n * engine.\n *\n * @param {string} keySystem\n * @param {MediaKeySystemConfiguration} config\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @private\n */\nshaka.media.DrmEngine.prototype.createCurrentDrmInfo_ = function(\n keySystem, config, drmInfos) {\n /** @type {!Array.<string>} */\n var licenseServers = [];\n\n /** @type {!Array.<!Uint8Array>} */\n var serverCerts = [];\n\n /** @type {!Array.<!shakaExtern.InitDataOverride>} */\n var initDatas = [];\n\n /** @type {!Array.<string>} */\n var keyIds = [];\n\n this.processDrmInfos_(drmInfos, licenseServers, serverCerts, initDatas,\n keyIds);\n\n if (serverCerts.length > 1) {\n shaka.log.warning('Multiple unique server certificates found! ' +\n 'Only the first will be used.');\n }\n\n if (licenseServers.length > 1) {\n shaka.log.warning('Multiple unique license server URIs found! ' +\n 'Only the first will be used.');\n }\n\n // TODO: This only works when all DrmInfo have the same robustness.\n var audioRobustness =\n config.audioCapabilities ? config.audioCapabilities[0].robustness : '';\n var videoRobustness =\n config.videoCapabilities ? config.videoCapabilities[0].robustness : '';\n this.currentDrmInfo_ = {\n keySystem: keySystem,\n licenseServerUri: licenseServers[0],\n distinctiveIdentifierRequired: (config.distinctiveIdentifier == 'required'),\n persistentStateRequired: (config.persistentState == 'required'),\n audioRobustness: audioRobustness,\n videoRobustness: videoRobustness,\n serverCertificate: serverCerts[0],\n initData: initDatas,\n keyIds: keyIds\n };\n};\n\n\n/**\n * Extract license server, server cert, and init data from DrmInfos, taking\n * care to eliminate duplicates.\n *\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @param {!Array.<string>} licenseServers\n * @param {!Array.<!Uint8Array>} serverCerts\n * @param {!Array.<!shakaExtern.InitDataOverride>} initDatas\n * @param {!Array.<string>} keyIds\n * @private\n */\nshaka.media.DrmEngine.prototype.processDrmInfos_ =\n function(drmInfos, licenseServers, serverCerts, initDatas, keyIds) {\n /**\n * @param {shakaExtern.InitDataOverride} a\n * @param {shakaExtern.InitDataOverride} b\n * @return {boolean}\n */\n function initDataOverrideEqual(a, b) {\n if (a.keyId && a.keyId == b.keyId) {\n // Two initDatas with the same keyId are considered to be the same,\n // unless that \"same keyId\" is null.\n return true;\n }\n return a.initDataType == b.initDataType &&\n shaka.util.Uint8ArrayUtils.equal(a.initData, b.initData);\n }\n\n drmInfos.forEach(function(drmInfo) {\n // Aliases:\n var ArrayUtils = shaka.util.ArrayUtils;\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n\n // Build an array of unique license servers.\n if (licenseServers.indexOf(drmInfo.licenseServerUri) == -1) {\n licenseServers.push(drmInfo.licenseServerUri);\n }\n\n // Build an array of unique server certs.\n if (drmInfo.serverCertificate) {\n if (ArrayUtils.indexOf(serverCerts, drmInfo.serverCertificate,\n Uint8ArrayUtils.equal) == -1) {\n serverCerts.push(drmInfo.serverCertificate);\n }\n }\n\n // Build an array of unique init datas.\n if (drmInfo.initData) {\n drmInfo.initData.forEach(function(initDataOverride) {\n if (ArrayUtils.indexOf(initDatas, initDataOverride,\n initDataOverrideEqual) == -1) {\n initDatas.push(initDataOverride);\n }\n });\n }\n\n if (drmInfo.keyIds) {\n for (var i = 0; i < drmInfo.keyIds.length; ++i) {\n if (keyIds.indexOf(drmInfo.keyIds[i]) == -1) {\n keyIds.push(drmInfo.keyIds[i]);\n }\n }\n }\n });\n};\n\n\n/**\n * @param {!MediaEncryptedEvent} event\n * @private\n */\nshaka.media.DrmEngine.prototype.onEncrypted_ = function(event) {\n // Aliases:\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n\n var initData = new Uint8Array(event.initData);\n\n // Suppress duplicate init data.\n // Note that some init data are extremely large and can't portably be used as\n // keys in a dictionary.\n for (var i = 0; i < this.activeSessions_.length; ++i) {\n if (Uint8ArrayUtils.equal(initData, this.activeSessions_[i].initData)) {\n shaka.log.debug('Ignoring duplicate init data.');\n return;\n }\n }\n\n this.createTemporarySession_(event.initDataType, initData);\n};\n\n\n/**\n * @param {string} sessionId\n * @return {!Promise.<MediaKeySession>}\n * @private\n */\nshaka.media.DrmEngine.prototype.loadOfflineSession_ = function(sessionId) {\n var session;\n try {\n session = this.mediaKeys_.createSession('persistent-license');\n } catch (exception) {\n var error = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_SESSION,\n exception.message);\n this.onError_(error);\n return Promise.reject(error);\n }\n\n this.eventManager_.listen(session, 'message',\n /** @type {shaka.util.EventManager.ListenerType} */(\n this.onSessionMessage_.bind(this)));\n this.eventManager_.listen(session, 'keystatuseschange',\n this.onKeyStatusesChange_.bind(this));\n\n var activeSession = {\n initData: null,\n session: session,\n loaded: false,\n oldExpiration: Infinity,\n updatePromise: null\n };\n this.activeSessions_.push(activeSession);\n\n return session.load(sessionId).then(function(present) {\n if (this.destroyed_) return;\n\n if (!present) {\n var i = this.activeSessions_.indexOf(activeSession);\n goog.asserts.assert(i >= 0, 'Session must be in the array');\n this.activeSessions_.splice(i, 1);\n\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.OFFLINE_SESSION_REMOVED));\n return;\n }\n\n // TODO: We should get a key status change event. Remove once Chrome CDM\n // is fixed.\n activeSession.loaded = true;\n if (this.activeSessions_.every(function(s) { return s.loaded; }))\n this.allSessionsLoaded_.resolve();\n\n return session;\n }.bind(this), function(error) {\n if (this.destroyed_) return;\n\n var i = this.activeSessions_.indexOf(activeSession);\n goog.asserts.assert(i >= 0, 'Session must be in the array');\n this.activeSessions_.splice(i, 1);\n\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_SESSION,\n error.message));\n }.bind(this));\n};\n\n\n/**\n * @param {string} initDataType\n * @param {!Uint8Array} initData\n * @private\n */\nshaka.media.DrmEngine.prototype.createTemporarySession_ =\n function(initDataType, initData) {\n var session;\n try {\n if (this.isOffline_) {\n session = this.mediaKeys_.createSession('persistent-license');\n } else {\n session = this.mediaKeys_.createSession();\n }\n } catch (exception) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_CREATE_SESSION,\n exception.message));\n return;\n }\n\n this.eventManager_.listen(session, 'message',\n /** @type {shaka.util.EventManager.ListenerType} */(\n this.onSessionMessage_.bind(this)));\n this.eventManager_.listen(session, 'keystatuseschange',\n this.onKeyStatusesChange_.bind(this));\n this.activeSessions_.push({\n initData: initData,\n session: session,\n loaded: false,\n oldExpiration: Infinity,\n updatePromise: null\n });\n\n session.generateRequest(initDataType, initData.buffer).catch(function(error) {\n if (this.destroyed_) return;\n\n for (var i = 0; i < this.activeSessions_.length; ++i) {\n if (this.activeSessions_[i].session == session) {\n this.activeSessions_.splice(i, 1);\n break;\n }\n }\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.FAILED_TO_GENERATE_LICENSE_REQUEST,\n error.message));\n }.bind(this));\n};\n\n\n/**\n * @param {!MediaKeyMessageEvent} event\n * @private\n */\nshaka.media.DrmEngine.prototype.onSessionMessage_ = function(event) {\n if (this.delayLicenseRequest_())\n this.mediaKeyMessageEvents_.push(event);\n else\n this.sendLicenseRequest_(event);\n};\n\n\n/**\n * @return {boolean}\n * @private\n */\nshaka.media.DrmEngine.prototype.delayLicenseRequest_ = function() {\n return (this.config_.delayLicenseRequestUntilPlayed &&\n this.video_.paused && !this.initialRequestsSent_);\n};\n\n\n/**\n * Sends a license request.\n * @param {!MediaKeyMessageEvent} event\n * @private\n */\nshaka.media.DrmEngine.prototype.sendLicenseRequest_ = function(event) {\n /** @type {!MediaKeySession} */\n var session = event.target;\n\n var updatePromise;\n for (var i = 0; i < this.activeSessions_.length; i++) {\n if (this.activeSessions_[i].session == session) {\n updatePromise = this.activeSessions_[i].updatePromise;\n break;\n }\n }\n\n var requestType = shaka.net.NetworkingEngine.RequestType.LICENSE;\n var request = shaka.net.NetworkingEngine.makeRequest(\n [this.currentDrmInfo_.licenseServerUri], this.config_.retryParameters);\n request.body = event.message;\n request.method = 'POST';\n // NOTE: allowCrossSiteCredentials can be set in a request filter.\n\n if (this.currentDrmInfo_.keySystem == 'com.microsoft.playready' ||\n this.currentDrmInfo_.keySystem == 'com.chromecast.playready') {\n this.unpackPlayReadyRequest_(request);\n }\n\n this.networkingEngine_.request(requestType, request)\n .then(function(response) {\n if (this.destroyed_) return Promise.reject();\n\n // Request succeeded, now pass the response to the CDM.\n return session.update(response.data).then(function() {\n if (updatePromise)\n updatePromise.resolve();\n });\n }.bind(this), function(error) {\n // Ignore destruction errors\n if (this.destroyed_) return Promise.resolve();\n\n // Request failed!\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong NetworkingEngine error type!');\n var shakaErr = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.LICENSE_REQUEST_FAILED,\n error);\n this.onError_(shakaErr);\n if (updatePromise)\n updatePromise.reject(shakaErr);\n }.bind(this)).catch(function(error) {\n // Ignore destruction errors\n if (this.destroyed_) return Promise.resolve();\n\n // Session update failed!\n var shakaErr = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.LICENSE_RESPONSE_REJECTED,\n error.message);\n this.onError_(shakaErr);\n if (updatePromise)\n updatePromise.reject(shakaErr);\n }.bind(this));\n};\n\n\n/**\n * Unpack PlayReady license requests. Modifies the request object.\n * @param {shakaExtern.Request} request\n * @private\n */\nshaka.media.DrmEngine.prototype.unpackPlayReadyRequest_ = function(request) {\n // On IE and Edge, the raw license message is UTF-16-encoded XML. We need to\n // unpack the Challenge element (base64-encoded string containing the actual\n // license request) and any HttpHeader elements (sent as request headers).\n\n // Example XML:\n\n // <PlayReadyKeyMessage type=\"LicenseAcquisition\">\n // <LicenseAcquisition Version=\"1\">\n // <Challenge encoding=\"base64encoded\">{Base64Data}</Challenge>\n // <HttpHeaders>\n // <HttpHeader>\n // <name>Content-Type</name>\n // <value>text/xml; charset=utf-8</value>\n // </HttpHeader>\n // <HttpHeader>\n // <name>SOAPAction</name>\n // <value>http://schemas.microsoft.com/DRM/etc/etc</value>\n // </HttpHeader>\n // </HttpHeaders>\n // </LicenseAcquisition>\n // </PlayReadyKeyMessage>\n\n var xml = shaka.util.StringUtils.fromUTF16(\n request.body, true /* littleEndian */, true /* noThrow */);\n if (xml.indexOf('PlayReadyKeyMessage') == -1) {\n // This does not appear to be a wrapped message as on IE and Edge. Some\n // clients do not need this unwrapping, so we will assume this is one of\n // them. Note that \"xml\" at this point probably looks like random garbage,\n // since we interpreted UTF-8 as UTF-16.\n shaka.log.debug('PlayReady request is already unwrapped.');\n request.headers['Content-Type'] = 'text/xml; charset=utf-8';\n return;\n }\n shaka.log.debug('Unwrapping PlayReady request.');\n var dom = new DOMParser().parseFromString(xml, 'application/xml');\n\n // Set request headers.\n var headers = dom.getElementsByTagName('HttpHeader');\n for (var i = 0; i < headers.length; ++i) {\n var name = headers[i].querySelector('name');\n var value = headers[i].querySelector('value');\n goog.asserts.assert(name && value, 'Malformed PlayReady headers!');\n request.headers[name.textContent] = value.textContent;\n }\n\n // Unpack the base64-encoded challenge.\n var challenge = dom.querySelector('Challenge');\n goog.asserts.assert(challenge, 'Malformed PlayReady challenge!');\n goog.asserts.assert(challenge.getAttribute('encoding') == 'base64encoded',\n 'Unexpected PlayReady challenge encoding!');\n request.body =\n shaka.util.Uint8ArrayUtils.fromBase64(challenge.textContent).buffer;\n};\n\n\n/**\n * @param {!Event} event\n * @private\n * @suppress {invalidCasts} to swap keyId and status\n */\nshaka.media.DrmEngine.prototype.onKeyStatusesChange_ = function(event) {\n var session = /** @type {!MediaKeySession} */(event.target);\n\n // Locate the session in the active sessions list.\n var i;\n for (i = 0; i < this.activeSessions_.length; ++i) {\n if (this.activeSessions_[i].session == session) {\n break;\n }\n }\n goog.asserts.assert(i < this.activeSessions_.length,\n 'Key status change for inactive session!');\n if (i == this.activeSessions_.length) return;\n\n var keyStatusMap = session.keyStatuses;\n var hasExpiredKeys = false;\n\n keyStatusMap.forEach(function(status, keyId) {\n // The spec has changed a few times on the exact order of arguments here.\n // As of 2016-06-30, Edge has the order reversed compared to the current\n // EME spec. Given the back and forth in the spec, it may not be the only\n // one. Try to detect this and compensate:\n if (typeof keyId == 'string') {\n var tmp = keyId;\n keyId = /** @type {ArrayBuffer} */(status);\n status = /** @type {string} */(tmp);\n }\n\n // Microsoft's implementation in Edge seems to present key IDs as\n // little-endian UUIDs, rather than big-endian or just plain array of bytes.\n // standard: 6e 5a 1d 26 - 27 57 - 47 d7 - 80 46 ea a5 d1 d3 4b 5a\n // on Edge: 26 1d 5a 6e - 57 27 - d7 47 - 80 46 ea a5 d1 d3 4b 5a\n // Bug filed: https://goo.gl/gnRSkJ\n\n // NOTE that we skip this if byteLength != 16. This is used for the IE11\n // and Edge 12 EME polyfill, which uses single-byte dummy key IDs.\n if (this.currentDrmInfo_.keySystem == 'com.microsoft.playready' &&\n keyId.byteLength == 16) {\n // Read out some fields in little-endian:\n var dataView = new DataView(keyId);\n var part0 = dataView.getUint32(0, true /* LE */);\n var part1 = dataView.getUint16(4, true /* LE */);\n var part2 = dataView.getUint16(6, true /* LE */);\n // Write it back in big-endian:\n dataView.setUint32(0, part0, false /* BE */);\n dataView.setUint16(4, part1, false /* BE */);\n dataView.setUint16(6, part2, false /* BE */);\n }\n\n // Microsoft's implementation in IE11 and Edge seems to never set key\n // status to 'usable'. It is stuck forever at 'status-pending'. In spite\n // of this, the keys do seem to be usable and content plays correctly.\n // Bug filed: https://goo.gl/fcXEy1\n if (this.currentDrmInfo_.keySystem == 'com.microsoft.playready' &&\n status == 'status-pending') {\n status = 'usable';\n }\n\n if (status != 'status-pending') {\n this.activeSessions_[i].loaded = true;\n if (this.activeSessions_.every(function(s) { return s.loaded; }))\n this.allSessionsLoaded_.resolve();\n }\n\n if (status == 'expired') {\n hasExpiredKeys = true;\n }\n\n var keyIdHex = shaka.util.Uint8ArrayUtils.toHex(new Uint8Array(keyId));\n\n this.keyStatusByKeyId_[keyIdHex] = status;\n }.bind(this));\n\n // If the session has expired, close it.\n // Some CDMs do not have sub-second time resolution, so the key status may\n // fire with hundreds of milliseconds left until the stated expiration time.\n var msUntilExpiration = session.expiration - Date.now();\n if (msUntilExpiration < 0 || (hasExpiredKeys && msUntilExpiration < 1000)) {\n // If this is part of a remove(), we don't want to close the session until\n // the update is complete. Otherwise, we will orphan the session.\n if (!this.activeSessions_[i].updatePromise) {\n shaka.log.debug('Session has expired', session);\n this.activeSessions_.splice(i, 1);\n session.close();\n }\n }\n\n // Batch up key status changes before checking them or notifying Player.\n // This handles cases where the statuses of multiple sessions are set\n // simultaneously by the browser before dispatching key status changes for\n // each of them. By batching these up, we only send one status change event\n // and at most one EXPIRED error on expiration.\n this.keyStatusTimer_.schedule(0.5);\n};\n\n\n/**\n * @private\n */\nshaka.media.DrmEngine.prototype.processKeyStatusChanges_ = function() {\n // If all keys are expired, fire an error.\n function isExpired(keyId, status) {\n return status == 'expired';\n }\n var MapUtils = shaka.util.MapUtils;\n // Note that every() is always true for an empty map,\n // but we shouldn't fire an error for a lack of key status info.\n var allExpired = !MapUtils.empty(this.keyStatusByKeyId_) &&\n MapUtils.every(this.keyStatusByKeyId_, isExpired);\n\n if (allExpired) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.DRM,\n shaka.util.Error.Code.EXPIRED));\n }\n\n this.onKeyStatus_(this.keyStatusByKeyId_);\n};\n\n\n/**\n * Returns true if the browser has recent EME APIs.\n *\n * @return {boolean}\n */\nshaka.media.DrmEngine.isBrowserSupported = function() {\n var basic =\n !!window.MediaKeys &&\n !!window.navigator &&\n !!window.navigator.requestMediaKeySystemAccess &&\n !!window.MediaKeySystemAccess &&\n !!window.MediaKeySystemAccess.prototype.getConfiguration;\n\n return basic;\n};\n\n\n/**\n * Returns a Promise to a map of EME support for well-known key systems.\n *\n * @return {!Promise.<!Object.<string, ?shakaExtern.DrmSupportType>>}\n */\nshaka.media.DrmEngine.probeSupport = function() {\n goog.asserts.assert(shaka.media.DrmEngine.isBrowserSupported(),\n 'Must have basic EME support');\n\n var tests = [];\n var testKeySystems = [\n 'org.w3.clearkey',\n 'com.widevine.alpha',\n 'com.microsoft.playready',\n 'com.apple.fps.2_0',\n 'com.apple.fps.1_0',\n 'com.apple.fps',\n 'com.adobe.primetime'\n ];\n\n var basicVideoCapabilities = [\n { contentType: 'video/mp4; codecs=\"avc1.42E01E\"' },\n { contentType: 'video/webm; codecs=\"vp8\"' }\n ];\n\n var basicConfig = {\n videoCapabilities: basicVideoCapabilities\n };\n var offlineConfig = {\n videoCapabilities: basicVideoCapabilities,\n persistentState: 'required',\n sessionTypes: ['persistent-license']\n };\n\n // Try the offline config first, then fall back to the basic config.\n var configs = [offlineConfig, basicConfig];\n\n var support = {};\n testKeySystems.forEach(function(keySystem) {\n var p = navigator.requestMediaKeySystemAccess(keySystem, configs)\n .then(function(access) {\n // Edge doesn't return supported session types, but current versions\n // do not support persistent-license. If sessionTypes is missing,\n // assume no support for persistent-license.\n // TODO: polyfill Edge to return known supported session types.\n // Edge bug: https://goo.gl/z0URJ0\n // Firefox does return supported session types, but will still let you\n // create a session even if the type is unsupported.\n // Firefox bug: https://goo.gl/lB4H3i\n var sessionTypes = access.getConfiguration().sessionTypes;\n var persistentState = sessionTypes ?\n sessionTypes.indexOf('persistent-license') >= 0 : false;\n support[keySystem] = {persistentState: persistentState};\n return access.createMediaKeys();\n }).catch(function() {\n // Either the request failed or createMediaKeys failed.\n // Either way, write null to the support object.\n support[keySystem] = null;\n });\n tests.push(p);\n });\n\n return Promise.all(tests).then(function() {\n return support;\n });\n};\n\n\n/**\n * @private\n */\nshaka.media.DrmEngine.prototype.onPlay_ = function() {\n for (var i = 0; i < this.mediaKeyMessageEvents_.length; i++) {\n this.sendLicenseRequest_(this.mediaKeyMessageEvents_[i]);\n }\n\n this.initialRequestsSent_ = true;\n this.mediaKeyMessageEvents_ = [];\n};\n\n\n/**\n * Checks if a variant is compatible with the key system.\n * @param {!shakaExtern.Variant} variant\n * @return {boolean}\n**/\nshaka.media.DrmEngine.prototype.isSupportedByKeySystem = function(variant) {\n var keySystem = this.keySystem();\n return variant.drmInfos.length == 0 ||\n variant.drmInfos.some(function(drmInfo) {\n return drmInfo.keySystem == keySystem;\n });\n};\n\n\n/**\n * Checks if two DrmInfos can be decrypted using the\n * same key system. Clear content is considered compatible\n * with every key system.\n *\n * @param {!Array.<!shakaExtern.DrmInfo>} drms1\n * @param {!Array.<!shakaExtern.DrmInfo>} drms2\n * @return {boolean}\n */\nshaka.media.DrmEngine.areDrmCompatible = function(drms1, drms2) {\n if (!drms1.length || !drms2.length) return true;\n\n return shaka.media.DrmEngine.getCommonDrmInfos(\n drms1, drms2).length > 0;\n};\n\n\n/**\n * Returns an array of drm infos that are present in both input arrays.\n * If one of the arrays is empty, returns the other one since clear\n * content is considered compatible with every drm info.\n *\n * @param {!Array.<!shakaExtern.DrmInfo>} drms1\n * @param {!Array.<!shakaExtern.DrmInfo>} drms2\n * @return {!Array.<!shakaExtern.DrmInfo>}\n */\nshaka.media.DrmEngine.getCommonDrmInfos = function(drms1, drms2) {\n if (!drms1.length) return drms2;\n if (!drms2.length) return drms1;\n\n var commonDrms = [];\n\n for (var i = 0; i < drms1.length; i++) {\n for (var j = 0; j < drms2.length; j++) {\n // This method is only called to compare drmInfos of a video\n // and an audio adaptations, so we shouldn't have to worry about\n // checking robustness.\n if (drms1[i].keySystem == drms2[j].keySystem) {\n var drm1 = drms1[i];\n var drm2 = drms2[j];\n var initData = [];\n initData = initData.concat(drm1.initData || []);\n initData = initData.concat(drm2.initData || []);\n var keyIds = [];\n keyIds = keyIds.concat(drm1.keyIds);\n keyIds = keyIds.concat(drm2.keyIds);\n var mergedDrm = {\n keySystem: drm1.keySystem,\n licenseServerUri: drm1.licenseServerUri || drm2.licenseServerUri,\n distinctiveIdentifierRequired: drm1.distinctiveIdentifierRequired ||\n drm2.distinctiveIdentifierRequired,\n persistentStateRequired: drm1.persistentStateRequired ||\n drm2.persistentStateRequired,\n videoRobustness: drm1.videoRobustness || drm2.videoRobustness,\n audioRobustness: drm1.audioRobustness || drm2.audioRobustness,\n serverCertificate: drm1.serverCertificate || drm2.serverCertificate,\n initData: initData,\n keyIds: keyIds\n };\n commonDrms.push(mergedDrm);\n break;\n }\n }\n }\n\n return commonDrms;\n};\n\n\n/**\n * Called in an interval timer to poll the expiration times of the sessions. We\n * don't get an event from EME when the expiration updates, so we poll it so we\n * can fire an event when it happens.\n * @private\n */\nshaka.media.DrmEngine.prototype.pollExpiration_ = function() {\n this.activeSessions_.forEach(function(session) {\n var old = session.oldExpiration;\n var new_ = session.session.expiration;\n if (isNaN(new_))\n new_ = Infinity;\n\n if (new_ != old) {\n this.onExpirationUpdated_(session.session.sessionId, new_);\n session.oldExpiration = new_;\n }\n }.bind(this));\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/drm_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.TextEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.IDestroyable');\n\n\n\n/**\n * Manages text parsers and cues.\n *\n * @struct\n * @constructor\n * @param {TextTrack} track\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.TextEngine = function(track) {\n /** @private {shakaExtern.TextParser} */\n this.parser_ = null;\n\n /** @private {TextTrack} */\n this.track_ = track;\n\n /** @private {number} */\n this.timestampOffset_ = 0;\n\n /** @private {number} */\n this.appendWindowEnd_ = Infinity;\n\n /** @private {?number} */\n this.bufferStart_ = null;\n\n /** @private {?number} */\n this.bufferEnd_ = null;\n};\n\n\n/** @private {!Object.<string, !shakaExtern.TextParserPlugin>} */\nshaka.media.TextEngine.parserMap_ = {};\n\n\n/**\n * @param {string} mimeType\n * @param {!shakaExtern.TextParserPlugin} plugin\n * @export\n */\nshaka.media.TextEngine.registerParser = function(mimeType, plugin) {\n // Assume that if the function is expecting no parameters, it must be\n // a stateful text parser factory. Otherwise, assume that it is a\n // stateless text parser.\n if (plugin.length == 0) {\n shaka.media.TextEngine.parserMap_[mimeType] = plugin;\n } else {\n shaka.log.warning('The use of stateless text parsers is deprecated.');\n shaka.media.TextEngine.parserMap_[mimeType] =\n shaka.media.TextEngine.TextParserWrapper_.bind(null, plugin);\n }\n};\n\n\n/**\n * @param {string} mimeType\n * @export\n */\nshaka.media.TextEngine.unregisterParser = function(mimeType) {\n delete shaka.media.TextEngine.parserMap_[mimeType];\n};\n\n\n/**\n * @param {string} mimeType\n * @return {boolean}\n */\nshaka.media.TextEngine.isTypeSupported = function(mimeType) {\n return !!shaka.media.TextEngine.parserMap_[mimeType];\n};\n\n\n/**\n * Creates a cue using the best platform-specific interface available.\n *\n * @param {number} startTime\n * @param {number} endTime\n * @param {string} payload\n * @return {TextTrackCue} or null if the parameters were invalid.\n * @export\n */\nshaka.media.TextEngine.makeCue = function(startTime, endTime, payload) {\n if (startTime >= endTime) {\n // IE/Edge will throw in this case.\n // See issue #501\n shaka.log.warning('Invalid cue times: ' + startTime + ' - ' + endTime);\n return null;\n }\n\n return new VTTCue(startTime, endTime, payload);\n};\n\n\n/** @override */\nshaka.media.TextEngine.prototype.destroy = function() {\n if (this.track_) {\n this.removeWhere_(function(cue) { return true; });\n }\n\n this.parser_ = null;\n this.track_ = null;\n\n return Promise.resolve();\n};\n\n\n/**\n * Initialize the parser. This can be called multiple times, but must be called\n * at least once before appendBuffer.\n *\n * @param {string} mimeType\n */\nshaka.media.TextEngine.prototype.initParser = function(mimeType) {\n var factory = shaka.media.TextEngine.parserMap_[mimeType];\n goog.asserts.assert(\n factory,\n 'Text type negotiation should have happened already');\n this.parser_ = new factory();\n};\n\n\n/**\n * @param {!ArrayBuffer} buffer\n * @param {?number} startTime\n * @param {?number} endTime\n * @return {!Promise}\n */\nshaka.media.TextEngine.prototype.appendBuffer =\n function(buffer, startTime, endTime) {\n goog.asserts.assert(this.parser_, 'The parser should already be initialized');\n\n // Start the operation asynchronously to avoid blocking the caller.\n return Promise.resolve().then(function() {\n // Check that TextEngine hasn't been destroyed.\n if (!this.track_) return;\n\n if (startTime == null || endTime == null) {\n this.parser_.parseInit(buffer);\n return;\n }\n\n /** @type {shakaExtern.TextParser.TimeContext} **/\n var time = {\n periodStart: this.timestampOffset_,\n segmentStart: startTime,\n segmentEnd: endTime\n };\n\n // Parse the buffer and add the new cues.\n var cues = this.parser_.parseMedia(buffer, time);\n\n for (var i = 0; i < cues.length; ++i) {\n if (cues[i].startTime >= this.appendWindowEnd_) break;\n this.track_.addCue(cues[i]);\n }\n\n // NOTE: We update the buffered range from the start and end times passed\n // down from the segment reference, not with the start and end times of the\n // parsed cues. This is important because some segments may contain no\n // cues, but we must still consider those ranges buffered.\n if (this.bufferStart_ == null) {\n this.bufferStart_ = startTime;\n } else {\n // We already had something in buffer, and we assume we are extending the\n // range from the end.\n goog.asserts.assert((startTime - this.bufferEnd_) <= 1,\n 'There should not be a gap in text references >1s');\n }\n this.bufferEnd_ = Math.min(endTime, this.appendWindowEnd_);\n }.bind(this));\n};\n\n\n/**\n * @param {number} start\n * @param {number} end\n * @return {!Promise}\n */\nshaka.media.TextEngine.prototype.remove = function(start, end) {\n // Start the operation asynchronously to avoid blocking the caller.\n return Promise.resolve().then(function() {\n // Check that TextEngine hasn't been destroyed.\n if (!this.track_) return;\n\n this.removeWhere_(function(cue) {\n if (cue.startTime >= end || cue.endTime <= start) {\n // Outside the remove range. Hang on to it.\n return false;\n }\n return true;\n });\n\n if (this.bufferStart_ == null) {\n goog.asserts.assert(this.bufferEnd_ == null,\n 'end must be null if start is null');\n } else {\n goog.asserts.assert(this.bufferEnd_ != null,\n 'end must be non-null if start is non-null');\n\n // Update buffered range.\n if (end <= this.bufferStart_ || start >= this.bufferEnd_) {\n // No intersection. Nothing was removed.\n } else if (start <= this.bufferStart_ && end >= this.bufferEnd_) {\n // We wiped out everything.\n goog.asserts.assert(\n this.track_.cues.length == 0, 'should be no cues left');\n this.bufferStart_ = this.bufferEnd_ = null;\n } else if (start <= this.bufferStart_ && end < this.bufferEnd_) {\n // We removed from the beginning of the range.\n this.bufferStart_ = end;\n } else if (start > this.bufferStart_ && end >= this.bufferEnd_) {\n // We removed from the end of the range.\n this.bufferEnd_ = start;\n } else {\n // We removed from the middle? StreamingEngine isn't supposed to.\n goog.asserts.assert(\n false, 'removal from the middle is not supported by TextEngine');\n }\n }\n }.bind(this));\n};\n\n\n/** @param {number} timestampOffset */\nshaka.media.TextEngine.prototype.setTimestampOffset =\n function(timestampOffset) {\n this.timestampOffset_ = timestampOffset;\n};\n\n\n/** @param {number} windowEnd */\nshaka.media.TextEngine.prototype.setAppendWindowEnd =\n function(windowEnd) {\n this.appendWindowEnd_ = windowEnd;\n};\n\n\n/**\n * @return {?number} Time in seconds of the beginning of the buffered range,\n * or null if nothing is buffered.\n */\nshaka.media.TextEngine.prototype.bufferStart = function() {\n return this.bufferStart_;\n};\n\n\n/**\n * @return {?number} Time in seconds of the end of the buffered range,\n * or null if nothing is buffered.\n */\nshaka.media.TextEngine.prototype.bufferEnd = function() {\n return this.bufferEnd_;\n};\n\n\n/**\n * @param {number} t A timestamp\n * @return {boolean}\n */\nshaka.media.TextEngine.prototype.isBuffered = function(t) {\n return t >= this.bufferStart_ && t < this.bufferEnd_;\n};\n\n\n/**\n * @param {number} t A timestamp\n * @return {number} Number of seconds ahead of 't' we have buffered\n */\nshaka.media.TextEngine.prototype.bufferedAheadOf = function(t) {\n if (this.bufferEnd_ == null || this.bufferEnd_ < t) return 0;\n\n goog.asserts.assert(\n this.bufferStart_ != null, 'start should not be null if end is not null');\n\n return this.bufferEnd_ - Math.max(t, this.bufferStart_);\n};\n\n\n/**\n * Remove all cues for which the matching function returns true.\n *\n * @param {function(!TextTrackCue):boolean} predicate\n * @private\n */\nshaka.media.TextEngine.prototype.removeWhere_ = function(predicate) {\n var cues = this.track_.cues;\n var removeMe = [];\n\n // Remove these in another loop to avoid mutating the TextTrackCueList\n // while iterating over it. This allows us to avoid making assumptions\n // about whether or not this.track_.remove() will alter that list.\n for (var i = 0; i < cues.length; ++i) {\n if (predicate(cues[i])) {\n removeMe.push(cues[i]);\n }\n }\n\n for (var i = 0; i < removeMe.length; ++i) {\n this.track_.removeCue(removeMe[i]);\n }\n};\n\n\n\n/**\n * @param {Function} parser\n * @constructor\n * @implements {shakaExtern.TextParser}\n * @private\n */\nshaka.media.TextEngine.TextParserWrapper_ = function(parser) {\n this.parser = parser;\n};\n\n\n/** @override **/\nshaka.media.TextEngine.TextParserWrapper_.prototype.parseInit = function(data) {\n this.parser(data, 0, null, null);\n};\n\n\n/** @override **/\nshaka.media.TextEngine.TextParserWrapper_.prototype.parseMedia = function(\n data, time) {\n return this.parser(data,\n time.periodStart,\n time.segmentStart,\n time.segmentEnd);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/text_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.TimeRangesUtils');\n\n\n/**\n * @namespace shaka.media.TimeRangesUtils\n * @summary A set of utility functions for dealing with TimeRanges objects.\n */\n\n\n/**\n * Gets the first timestamp in buffer.\n *\n * @param {TimeRanges} b\n * @return {?number} The first buffered timestamp, in seconds, if |buffered|\n * is non-empty; otherwise, return null.\n */\nshaka.media.TimeRangesUtils.bufferStart = function(b) {\n if (!b) return null;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return null;\n // Workaround Edge bug: https://goo.gl/BtxKgb\n if (b.length == 1 && b.start(0) < 0) return 0;\n return b.length ? b.start(0) : null;\n};\n\n\n/**\n * Gets the last timestamp in buffer.\n *\n * @param {TimeRanges} b\n * @return {?number} The last buffered timestamp, in seconds, if |buffered|\n * is non-empty; otherwise, return null.\n */\nshaka.media.TimeRangesUtils.bufferEnd = function(b) {\n if (!b) return null;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return null;\n return b.length ? b.end(b.length - 1) : null;\n};\n\n\n/**\n * Determines if the given time is inside a buffered range. This includes gaps,\n * meaning if the playhead is in a gap, it is considered buffered.\n *\n * @param {TimeRanges} b\n * @param {number} time\n * @return {boolean}\n */\nshaka.media.TimeRangesUtils.isBuffered = function(b, time) {\n if (!b || !b.length) return false;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return false;\n\n return time >= b.start(0) && time <= b.end(b.length - 1);\n};\n\n\n/**\n * Computes how far ahead of the given timestamp is buffered. To provide smooth\n * playback while jumping gaps, we don't include the gaps when calculating this.\n * This only includes the amount of content that is buffered.\n *\n * @param {TimeRanges} b\n * @param {number} time\n * @return {number} The number of seconds buffered, in seconds, ahead of the\n * given time.\n */\nshaka.media.TimeRangesUtils.bufferedAheadOf = function(b, time) {\n if (!b || !b.length) return 0;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return 0;\n\n // NOTE: On IE11, buffered ranges may show appended data before the associated\n // append operation is complete.\n\n // We calculate buffered amount by ONLY accounting for the content buffered\n // (i.e. we ignore the times of the gaps). We also buffer through all gaps.\n // So start at the end and add up all buffers until |time|.\n var result = 0;\n for (var i = b.length - 1; i >= 0 && b.end(i) > time; --i) {\n result += b.end(i) - Math.max(b.start(i), time);\n }\n\n return result;\n};\n\n\n/**\n * Determines if the given time is inside a gap between buffered ranges. If it\n * is, this returns the index of the buffer that is *ahead* of the gap.\n *\n * @param {TimeRanges} b\n * @param {number} time\n * @return {?number} The index of the buffer after the gap, or null if not in a\n * gap.\n */\nshaka.media.TimeRangesUtils.getGapIndex = function(b, time) {\n if (!b || !b.length) return null;\n // Workaround Safari bug: https://goo.gl/EDRCoZ\n if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) return null;\n\n // IE/Edge stops 0.5 seconds before a gap, so it needs a much larger\n // threshold, but we don't want to punish other browsers that stop closer.\n // See: https://goo.gl/cuAcYd\n var threshold = 0.1;\n if (/(Edge|Trident)\\//.test(navigator.userAgent))\n threshold = 0.5;\n\n for (var i = 0; i < b.length; i++) {\n if (b.start(i) > time && (i == 0 || b.end(i - 1) - time <= threshold)) {\n return i;\n }\n }\n\n return null;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/time_ranges_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.MediaSourceEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.media.TimeRangesUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * MediaSourceEngine wraps all operations on MediaSource and SourceBuffers.\n * All asynchronous operations return a Promise, and all operations are\n * internally synchronized and serialized as needed. Operations that can\n * be done in parallel will be done in parallel.\n *\n * @param {HTMLMediaElement} video The video element, used to read error codes\n * when MediaSource operations fail.\n * @param {MediaSource} mediaSource The MediaSource, which must be in the\n * 'open' state.\n * @param {TextTrack} textTrack The TextTrack to use for subtitles/captions.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.MediaSourceEngine = function(video, mediaSource, textTrack) {\n goog.asserts.assert(mediaSource.readyState == 'open',\n 'The MediaSource should be in the \\'open\\' state.');\n\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {MediaSource} */\n this.mediaSource_ = mediaSource;\n\n /** @private {TextTrack} */\n this.textTrack_ = textTrack;\n\n /** @private {!Object.<shaka.util.ManifestParserUtils.ContentType,\n SourceBuffer>} */\n this.sourceBuffers_ = {};\n\n /** @private {shaka.media.TextEngine} */\n this.textEngine_ = null;\n\n /**\n * @private {!Object.<string,\n * !Array.<shaka.media.MediaSourceEngine.Operation>>}\n */\n this.queues_ = {};\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {boolean} */\n this.destroyed_ = false;\n};\n\n\n/**\n * @typedef {{\n * start: function(),\n * p: !shaka.util.PublicPromise\n * }}\n *\n * @summary An operation in queue.\n * @property {function()} start\n * The function which starts the operation.\n * @property {!shaka.util.PublicPromise} p\n * The PublicPromise which is associated with this operation.\n */\nshaka.media.MediaSourceEngine.Operation;\n\n\n/**\n * Checks if a certain type is supported.\n *\n * @param {string} mimeType\n * @return {boolean}\n */\nshaka.media.MediaSourceEngine.isTypeSupported = function(mimeType) {\n return shaka.media.TextEngine.isTypeSupported(mimeType) ||\n MediaSource.isTypeSupported(mimeType);\n};\n\n\n/**\n * Returns true if the browser has the basic APIs we need.\n *\n * @return {boolean}\n */\nshaka.media.MediaSourceEngine.isBrowserSupported = function() {\n return !!window.MediaSource && !!window.MediaSource.isTypeSupported;\n};\n\n\n/**\n * Returns a map of MediaSource support for well-known types.\n *\n * @return {!Object.<string, boolean>}\n */\nshaka.media.MediaSourceEngine.probeSupport = function() {\n goog.asserts.assert(shaka.media.MediaSourceEngine.isBrowserSupported(),\n 'Requires basic support');\n var support = {};\n var testMimeTypes = [\n // MP4 types\n 'video/mp4; codecs=\"avc1.42E01E\"',\n 'video/mp4; codecs=\"avc3.42E01E\"',\n 'video/mp4; codecs=\"hvc1.1.6.L93.90\"',\n 'audio/mp4; codecs=\"mp4a.40.2\"',\n 'audio/mp4; codecs=\"ac-3\"',\n 'audio/mp4; codecs=\"ec-3\"',\n // WebM types\n 'video/webm; codecs=\"vp8\"',\n 'video/webm; codecs=\"vp9\"',\n 'video/webm; codecs=\"av1\"',\n 'audio/webm; codecs=\"vorbis\"',\n 'audio/webm; codecs=\"opus\"',\n // MPEG2 TS types (video/ is also used for audio: http://goo.gl/tYHXiS)\n 'video/mp2t; codecs=\"avc1.42E01E\"',\n 'video/mp2t; codecs=\"avc3.42E01E\"',\n 'video/mp2t; codecs=\"hvc1.1.6.L93.90\"',\n 'video/mp2t; codecs=\"mp4a.40.2\"',\n 'video/mp2t; codecs=\"ac-3\"',\n 'video/mp2t; codecs=\"ec-3\"',\n 'video/mp2t; codecs=\"mp4a.40.2\"',\n // WebVTT types\n 'text/vtt',\n 'application/mp4; codecs=\"wvtt\"',\n // TTML types\n 'application/ttml+xml',\n 'application/mp4; codecs=\"stpp\"'\n ];\n\n testMimeTypes.forEach(function(type) {\n support[type] = shaka.media.MediaSourceEngine.isTypeSupported(type);\n var basicType = type.split(';')[0];\n support[basicType] = support[basicType] || support[type];\n });\n\n return support;\n};\n\n\n/**\n * @override\n */\nshaka.media.MediaSourceEngine.prototype.destroy = function() {\n var Functional = shaka.util.Functional;\n this.destroyed_ = true;\n\n var cleanup = [];\n\n for (var contentType in this.queues_) {\n // Make a local copy of the queue and the first item.\n var q = this.queues_[contentType];\n var inProgress = q[0];\n\n // Drop everything else out of the queue.\n this.queues_[contentType] = q.slice(0, 1);\n\n // We will wait for this item to complete/fail.\n if (inProgress) {\n cleanup.push(inProgress.p.catch(Functional.noop));\n }\n\n // The rest will be rejected silently if possible.\n for (var i = 1; i < q.length; ++i) {\n q[i].p.catch(Functional.noop);\n q[i].p.reject();\n }\n }\n\n if (this.textEngine_) {\n cleanup.push(this.textEngine_.destroy());\n }\n\n return Promise.all(cleanup).then(function() {\n this.eventManager_.destroy();\n this.eventManager_ = null;\n this.video_ = null;\n this.mediaSource_ = null;\n this.textTrack_ = null;\n this.textEngine_ = null;\n this.sourceBuffers_ = {};\n if (!COMPILED) {\n for (var contentType in this.queues_) {\n goog.asserts.assert(\n this.queues_[contentType].length == 0,\n contentType + ' queue should be empty after destroy!');\n }\n }\n this.queues_ = {};\n }.bind(this));\n};\n\n\n/**\n * Initialize MediaSourceEngine.\n *\n * Note that it is not valid to call this multiple times, except to add or\n * reinitialize text streams.\n *\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType, string>}\n * typeConfig A map of content types to full MIME types.\n * For example: { 'audio': 'audio/webm; codecs=\"vorbis\"',\n * 'video': 'video/webm; codecs=\"vp9\"', 'text': 'text/vtt' }.\n * All types given must be supported.\n *\n * @throws InvalidAccessError if blank MIME types are given\n * @throws NotSupportedError if unsupported MIME types are given\n * @throws QuotaExceededError if the browser can't support that many buffers\n */\nshaka.media.MediaSourceEngine.prototype.init = function(typeConfig) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n for (var contentType in typeConfig) {\n var mimeType = typeConfig[contentType];\n goog.asserts.assert(\n shaka.media.MediaSourceEngine.isTypeSupported(mimeType),\n 'Type negotiation should happen before MediaSourceEngine.init!');\n\n if (contentType == ContentType.TEXT) {\n this.reinitText(mimeType);\n } else {\n var sourceBuffer = this.mediaSource_.addSourceBuffer(mimeType);\n this.eventManager_.listen(\n sourceBuffer, 'error', this.onError_.bind(this, contentType));\n this.eventManager_.listen(\n sourceBuffer, 'updateend', this.onUpdateEnd_.bind(this, contentType));\n this.sourceBuffers_[contentType] = sourceBuffer;\n this.queues_[contentType] = [];\n }\n }\n};\n\n\n/**\n * Reinitialize the TextEngine for a new text type.\n * @param {string} mimeType\n */\nshaka.media.MediaSourceEngine.prototype.reinitText = function(mimeType) {\n if (!this.textEngine_) {\n this.textEngine_ = new shaka.media.TextEngine(this.textTrack_);\n }\n this.textEngine_.initParser(mimeType);\n};\n\n\n/**\n * Gets the first timestamp in buffer for the given content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {?number} The timestamp in seconds, or null if nothing is buffered.\n */\nshaka.media.MediaSourceEngine.prototype.bufferStart = function(contentType) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.bufferStart();\n }\n return shaka.media.TimeRangesUtils.bufferStart(\n this.getBuffered_(contentType));\n};\n\n\n/**\n * Gets the last timestamp in buffer for the given content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {?number} The timestamp in seconds, or null if nothing is buffered.\n */\nshaka.media.MediaSourceEngine.prototype.bufferEnd = function(contentType) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.bufferEnd();\n }\n return shaka.media.TimeRangesUtils.bufferEnd(this.getBuffered_(contentType));\n};\n\n\n/**\n * Determines if the given time is inside the buffered range of the given\n * content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} time\n * @return {boolean}\n */\nshaka.media.MediaSourceEngine.prototype.isBuffered = function(\n contentType, time) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.isBuffered(time);\n } else {\n var buffered = this.getBuffered_(contentType);\n return shaka.media.TimeRangesUtils.isBuffered(buffered, time);\n }\n};\n\n\n/**\n * Computes how far ahead of the given timestamp is buffered for the given\n * content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} time\n * @return {number} The amount of time buffered ahead in seconds.\n */\nshaka.media.MediaSourceEngine.prototype.bufferedAheadOf =\n function(contentType, time) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.bufferedAheadOf(time);\n } else {\n var buffered = this.getBuffered_(contentType);\n return shaka.media.TimeRangesUtils.bufferedAheadOf(buffered, time);\n }\n};\n\n\n/**\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {TimeRanges} The buffered ranges for the given content type, or\n * null if the buffered ranges could not be obtained.\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.getBuffered_ = function(contentType) {\n try {\n return this.sourceBuffers_[contentType].buffered;\n } catch (exception) {\n // Note: previous MediaSource errors may cause access to |buffered| to\n // throw.\n shaka.log.error('failed to get buffered range for ' + contentType,\n exception);\n return null;\n }\n};\n\n\n/**\n * Enqueue an operation to append data to the SourceBuffer.\n * Start and end times are needed for TextEngine, but not for MediaSource.\n * Start and end times may be null for initialization segments, if present they\n * are relative to the presentation timeline.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {!ArrayBuffer} data\n * @param {?number} startTime\n * @param {?number} endTime\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.appendBuffer =\n function(contentType, data, startTime, endTime) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.appendBuffer(data, startTime, endTime);\n }\n return this.enqueueOperation_(\n contentType,\n this.append_.bind(this, contentType, data));\n};\n\n\n/**\n * Enqueue an operation to remove data from the SourceBuffer.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} startTime\n * @param {number} endTime\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.remove =\n function(contentType, startTime, endTime) {\n // On IE11, this operation would be permitted, but would have no effect!\n // See https://github.com/google/shaka-player/issues/251\n goog.asserts.assert(endTime < Number.MAX_VALUE,\n 'remove() with MAX_VALUE or Infinity is not IE-compatible!');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.remove(startTime, endTime);\n }\n return this.enqueueOperation_(\n contentType,\n this.remove_.bind(this, contentType, startTime, endTime));\n};\n\n\n/**\n * Enqueue an operation to clear the SourceBuffer.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.clear = function(contentType) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return this.textEngine_.remove(0, Infinity);\n }\n // Note that not all platforms allow clearing to Infinity.\n return this.enqueueOperation_(\n contentType,\n this.remove_.bind(this, contentType, 0, this.mediaSource_.duration));\n};\n\n\n/**\n * Enqueue an operation to flush the SourceBuffer.\n * This is a workaround for what we believe is a Chromecast bug.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.flush = function(contentType) {\n // Flush the pipeline. Necessary on Chromecast, even though we have removed\n // everything.\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n // Nothing to flush for text.\n return Promise.resolve();\n }\n return this.enqueueOperation_(\n contentType,\n this.flush_.bind(this, contentType));\n};\n\n\n/**\n * Sets the timestamp offset and append window end for the given content type.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} timestampOffset The timestamp offset. Segments which start\n * at time t will be inserted at time t + timestampOffset instead. This\n * value does not affect segments which have already been inserted.\n * @param {?number} appendWindowEnd The timestamp to set the append window end\n * to. Media beyond this value will be truncated.\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.setStreamProperties = function(\n contentType, timestampOffset, appendWindowEnd) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n this.textEngine_.setTimestampOffset(timestampOffset);\n if (appendWindowEnd != null)\n this.textEngine_.setAppendWindowEnd(appendWindowEnd);\n return Promise.resolve();\n }\n\n if (appendWindowEnd == null)\n appendWindowEnd = Infinity;\n\n return Promise.all([\n // Queue an abort() to help MSE splice together overlapping segments.\n // We set appendWindowEnd when we change periods in DASH content, and the\n // period transition may result in overlap.\n //\n // An abort() also helps with MPEG2-TS. When we append a TS segment, we\n // always enter a PARSING_MEDIA_SEGMENT state and we can't change the\n // timestamp offset. By calling abort(), we reset the state so we can\n // set it.\n //\n // Note that abort() resets both appendWindowStart and appendWindowEnd;\n // however, we don't use appendWindowStart.\n this.enqueueOperation_(\n contentType,\n this.abort_.bind(this, contentType)),\n this.enqueueOperation_(\n contentType,\n this.setTimestampOffset_.bind(this, contentType, timestampOffset)),\n this.enqueueOperation_(\n contentType,\n this.setAppendWindowEnd_.bind(this, contentType, appendWindowEnd))\n ]);\n};\n\n\n/**\n * @param {string=} opt_reason Valid reasons are 'network' and 'decode'.\n * @return {!Promise}\n * @see http://w3c.github.io/media-source/#idl-def-EndOfStreamError\n */\nshaka.media.MediaSourceEngine.prototype.endOfStream = function(opt_reason) {\n return this.enqueueBlockingOperation_(function() {\n // Chrome won't let me pass undefined, but it will let me omit the\n // argument. Firefox does not have this problem.\n // TODO: File a bug about this.\n if (opt_reason) {\n this.mediaSource_.endOfStream(opt_reason);\n } else {\n this.mediaSource_.endOfStream();\n }\n }.bind(this));\n};\n\n\n/**\n * We only support increasing duration at this time. Decreasing duration\n * causes the MSE removal algorithm to run, which results in an 'updateend'\n * event. Supporting this scenario would be complicated, and is not currently\n * needed.\n *\n * @param {number} duration\n * @return {!Promise}\n */\nshaka.media.MediaSourceEngine.prototype.setDuration = function(duration) {\n goog.asserts.assert(\n isNaN(this.mediaSource_.duration) ||\n this.mediaSource_.duration <= duration,\n 'duration cannot decrease: ' + this.mediaSource_.duration + ' -> ' +\n duration);\n return this.enqueueBlockingOperation_(function() {\n this.mediaSource_.duration = duration;\n }.bind(this));\n};\n\n\n/**\n * Get the current MediaSource duration.\n *\n * @return {number}\n */\nshaka.media.MediaSourceEngine.prototype.getDuration = function() {\n return this.mediaSource_.duration;\n};\n\n\n/**\n * Append data to the SourceBuffer.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {!ArrayBuffer} data\n * @throws QuotaExceededError if the browser's buffer is full\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.append_ =\n function(contentType, data) {\n // This will trigger an 'updateend' event.\n this.sourceBuffers_[contentType].appendBuffer(data);\n};\n\n\n/**\n * Remove data from the SourceBuffer.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} startTime\n * @param {number} endTime\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.remove_ =\n function(contentType, startTime, endTime) {\n if (endTime <= startTime) {\n // Ignore removal of inverted or empty ranges.\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n return;\n }\n\n // This will trigger an 'updateend' event.\n this.sourceBuffers_[contentType].remove(startTime, endTime);\n};\n\n\n/**\n * Call abort() on the SourceBuffer.\n * This resets MSE's last_decode_timestamp on all track buffers, which should\n * trigger the splicing logic for overlapping segments.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.abort_ = function(contentType) {\n // Save the append window end, which is reset on abort().\n var appendWindowEnd = this.sourceBuffers_[contentType].appendWindowEnd;\n\n // This will not trigger an 'updateend' event, since nothing is happening.\n // This is only to reset MSE internals, not to abort an actual operation.\n this.sourceBuffers_[contentType].abort();\n\n // Restore the append window end.\n this.sourceBuffers_[contentType].appendWindowEnd = appendWindowEnd;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * Nudge the playhead to force the media pipeline to be flushed.\n * This seems to be necessary on Chromecast to get new content to replace old\n * content.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.flush_ = function(contentType) {\n // Never use flush_ if there's data. It causes a hiccup in playback.\n goog.asserts.assert(\n this.video_.buffered.length == 0,\n 'MediaSourceEngine.flush_ should only be used after clearing all data!');\n\n // Seeking forces the pipeline to be flushed.\n this.video_.currentTime -= 0.001;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * Set the SourceBuffer's timestamp offset.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} timestampOffset\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.setTimestampOffset_ =\n function(contentType, timestampOffset) {\n this.sourceBuffers_[contentType].timestampOffset = timestampOffset;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * Set the SourceBuffer's append window end.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {number} appendWindowEnd\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.setAppendWindowEnd_ =\n function(contentType, appendWindowEnd) {\n var fudge = 1 / 25; // one frame, assuming a low framerate\n this.sourceBuffers_[contentType].appendWindowEnd = appendWindowEnd + fudge;\n\n // Fake 'updateend' event to resolve the operation.\n this.onUpdateEnd_(contentType);\n};\n\n\n/**\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {!Event} event\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.onError_ =\n function(contentType, event) {\n var operation = this.queues_[contentType][0];\n goog.asserts.assert(operation, 'Spurious error event!');\n goog.asserts.assert(!this.sourceBuffers_[contentType].updating,\n 'SourceBuffer should not be updating on error!');\n var code = this.video_.error ? this.video_.error.code : 0;\n operation.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_FAILED,\n code));\n // Do not pop from queue. An 'updateend' event will fire next, and to avoid\n // synchronizing these two event handlers, we will allow that one to pop from\n // the queue as normal. Note that because the operation has already been\n // rejected, the call to resolve() in the 'updateend' handler will have no\n // effect.\n};\n\n\n/**\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.onUpdateEnd_ = function(contentType) {\n var operation = this.queues_[contentType][0];\n goog.asserts.assert(operation, 'Spurious updateend event!');\n if (!operation) return;\n goog.asserts.assert(!this.sourceBuffers_[contentType].updating,\n 'SourceBuffer should not be updating on updateend!');\n operation.p.resolve();\n this.popFromQueue_(contentType);\n};\n\n\n/**\n * Enqueue an operation and start it if appropriate.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @param {function()} start\n * @return {!Promise}\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.enqueueOperation_ =\n function(contentType, start) {\n if (this.destroyed_) return Promise.reject();\n\n var operation = {\n start: start,\n p: new shaka.util.PublicPromise()\n };\n this.queues_[contentType].push(operation);\n\n if (this.queues_[contentType].length == 1) {\n try {\n operation.start();\n } catch (exception) {\n if (exception.name == 'QuotaExceededError') {\n operation.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR,\n contentType));\n } else {\n operation.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW,\n exception));\n }\n this.popFromQueue_(contentType);\n }\n }\n return operation.p;\n};\n\n\n/**\n * Enqueue an operation which must block all other operations on all\n * SourceBuffers.\n *\n * @param {function()} run\n * @return {!Promise}\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.enqueueBlockingOperation_ =\n function(run) {\n if (this.destroyed_) return Promise.reject();\n\n var allWaiters = [];\n\n // Enqueue a 'wait' operation onto each queue.\n // This operation signals its readiness when it starts.\n // When all wait operations are ready, the real operation takes place.\n for (var contentType in this.sourceBuffers_) {\n var ready = new shaka.util.PublicPromise();\n var operation = {\n start: function(ready) { ready.resolve(); }.bind(null, ready),\n p: ready\n };\n\n this.queues_[contentType].push(operation);\n allWaiters.push(ready);\n\n if (this.queues_[contentType].length == 1) {\n operation.start();\n }\n }\n\n // Return a Promise to the real operation, which waits to begin until there\n // are no other in-progress operations on any SourceBuffers.\n return Promise.all(allWaiters).then(function() {\n if (!COMPILED) {\n // If we did it correctly, nothing is updating.\n for (var contentType in this.sourceBuffers_) {\n goog.asserts.assert(\n this.sourceBuffers_[contentType].updating == false,\n 'SourceBuffers should not be updating after a blocking op!');\n }\n }\n\n var ret;\n // Run the real operation, which is synchronous.\n try {\n run();\n } catch (exception) {\n ret = Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW,\n exception));\n }\n\n // Unblock the queues.\n for (var contentType in this.sourceBuffers_) {\n this.popFromQueue_(contentType);\n }\n\n return ret;\n }.bind(this), function() {\n // One of the waiters failed, which means we've been destroyed.\n goog.asserts.assert(this.destroyed_, 'Should be destroyed by now');\n // We haven't popped from the queue. Canceled waiters have been removed by\n // destroy. What's left now should just be resolved waiters. In uncompiled\n // mode, we will maintain good hygiene and make sure the assert at the end\n // of destroy passes. In compiled mode, the queues are wiped in destroy.\n if (!COMPILED) {\n for (var contentType in this.sourceBuffers_) {\n if (this.queues_[contentType].length) {\n goog.asserts.assert(\n this.queues_[contentType].length == 1,\n 'Should be at most one item in queue!');\n goog.asserts.assert(\n allWaiters.indexOf(this.queues_[contentType][0].p) != -1,\n 'The item in queue should be one of our waiters!');\n this.queues_[contentType].shift();\n }\n }\n }\n return Promise.reject();\n }.bind(this));\n};\n\n\n/**\n * Pop from the front of the queue and start a new operation.\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * @private\n */\nshaka.media.MediaSourceEngine.prototype.popFromQueue_ = function(contentType) {\n // Remove the in-progress operation, which is now complete.\n this.queues_[contentType].shift();\n // Retrieve the next operation, if any, from the queue and start it.\n var next = this.queues_[contentType][0];\n if (next) {\n try {\n next.start();\n } catch (exception) {\n next.p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MEDIA_SOURCE_OPERATION_THREW,\n exception));\n this.popFromQueue_(contentType);\n }\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/media_source_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.LanguageUtils');\n\ngoog.require('goog.asserts');\n\n\n/**\n * @namespace shaka.util.LanguageUtils\n * @summary A set of language utility functions.\n */\n\n\n/**\n * Compares two language tags as defined by RFC 5646 and ISO 639. The\n * comparison takes sublanguages into account via the |fuzz| parameter.\n * The caller is expected to normalize the inputs first.\n *\n * @see shaka.util.LanguageUtils.normalize()\n * @see IETF RFC 5646\n * @see ISO 639\n *\n * @param {shaka.util.LanguageUtils.MatchType} fuzz What kind of match is\n * acceptable.\n * @param {string} preference The user's preferred language tag.\n * @param {string} candidate An available language tag.\n * @return {boolean}\n */\nshaka.util.LanguageUtils.match = function(fuzz, preference, candidate) {\n // Alias.\n var LanguageUtils = shaka.util.LanguageUtils;\n\n goog.asserts.assert(preference == LanguageUtils.normalize(preference),\n 'Language pref should be normalized first');\n goog.asserts.assert(candidate == LanguageUtils.normalize(candidate),\n 'Language candidate should be normalized first');\n\n if (candidate == preference) {\n return true;\n }\n\n if (fuzz >= shaka.util.LanguageUtils.MatchType.BASE_LANGUAGE_OKAY &&\n candidate == preference.split('-')[0]) {\n return true;\n }\n\n if (fuzz >= shaka.util.LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY &&\n candidate.split('-')[0] == preference.split('-')[0]) {\n return true;\n }\n\n return false;\n};\n\n\n/**\n * A match type for fuzzy-matching logic.\n *\n * @enum {number}\n */\nshaka.util.LanguageUtils.MatchType = {\n /** Accepts an exact match. */\n EXACT: 0,\n /** Accepts a less-specific version of the preferred sublanguage. */\n BASE_LANGUAGE_OKAY: 1,\n /** Accepts a different sublanguage of the preferred base language. */\n OTHER_SUB_LANGUAGE_OKAY: 2\n};\n\n\n/**\n * Normalize the language tag.\n *\n * RFC 5646 specifies that language tags are case insensitive and that the\n * shortest representation of the base language should always be used.\n * This will convert the tag to lower-case and map 3-letter codes (ISO 639-2)\n * to 2-letter codes (ISO 639-1) whenever possible.\n *\n * @param {string} lang\n * @return {string}\n *\n * @see IETF RFC 5646\n * @see ISO 639\n */\nshaka.util.LanguageUtils.normalize = function(lang) {\n var fields = lang.toLowerCase().split('-');\n var base = fields[0];\n var replacement = shaka.util.LanguageUtils.isoMap_[base];\n if (replacement) {\n fields[0] = replacement;\n }\n return fields.join('-');\n};\n\n\n/**\n * A map from 3-letter language codes (ISO 639-2) to 2-letter language codes\n * (ISO 639-1) for all languages which have both in the registry.\n *\n * @const {!Object.<string, string>}\n * @private\n */\nshaka.util.LanguageUtils.isoMap_ = {\n 'aar': 'aa', 'abk': 'ab', 'afr': 'af', 'aka': 'ak', 'alb': 'sq', 'amh': 'am',\n 'ara': 'ar', 'arg': 'an', 'arm': 'hy', 'asm': 'as', 'ava': 'av', 'ave': 'ae',\n 'aym': 'ay', 'aze': 'az', 'bak': 'ba', 'bam': 'bm', 'baq': 'eu', 'bel': 'be',\n 'ben': 'bn', 'bih': 'bh', 'bis': 'bi', 'bod': 'bo', 'bos': 'bs', 'bre': 'br',\n 'bul': 'bg', 'bur': 'my', 'cat': 'ca', 'ces': 'cs', 'cha': 'ch', 'che': 'ce',\n 'chi': 'zh', 'chu': 'cu', 'chv': 'cv', 'cor': 'kw', 'cos': 'co', 'cre': 'cr',\n 'cym': 'cy', 'cze': 'cs', 'dan': 'da', 'deu': 'de', 'div': 'dv', 'dut': 'nl',\n 'dzo': 'dz', 'ell': 'el', 'eng': 'en', 'epo': 'eo', 'est': 'et', 'eus': 'eu',\n 'ewe': 'ee', 'fao': 'fo', 'fas': 'fa', 'fij': 'fj', 'fin': 'fi', 'fra': 'fr',\n 'fre': 'fr', 'fry': 'fy', 'ful': 'ff', 'geo': 'ka', 'ger': 'de', 'gla': 'gd',\n 'gle': 'ga', 'glg': 'gl', 'glv': 'gv', 'gre': 'el', 'grn': 'gn', 'guj': 'gu',\n 'hat': 'ht', 'hau': 'ha', 'heb': 'he', 'her': 'hz', 'hin': 'hi', 'hmo': 'ho',\n 'hrv': 'hr', 'hun': 'hu', 'hye': 'hy', 'ibo': 'ig', 'ice': 'is', 'ido': 'io',\n 'iii': 'ii', 'iku': 'iu', 'ile': 'ie', 'ina': 'ia', 'ind': 'id', 'ipk': 'ik',\n 'isl': 'is', 'ita': 'it', 'jav': 'jv', 'jpn': 'ja', 'kal': 'kl', 'kan': 'kn',\n 'kas': 'ks', 'kat': 'ka', 'kau': 'kr', 'kaz': 'kk', 'khm': 'km', 'kik': 'ki',\n 'kin': 'rw', 'kir': 'ky', 'kom': 'kv', 'kon': 'kg', 'kor': 'ko', 'kua': 'kj',\n 'kur': 'ku', 'lao': 'lo', 'lat': 'la', 'lav': 'lv', 'lim': 'li', 'lin': 'ln',\n 'lit': 'lt', 'ltz': 'lb', 'lub': 'lu', 'lug': 'lg', 'mac': 'mk', 'mah': 'mh',\n 'mal': 'ml', 'mao': 'mi', 'mar': 'mr', 'may': 'ms', 'mkd': 'mk', 'mlg': 'mg',\n 'mlt': 'mt', 'mon': 'mn', 'mri': 'mi', 'msa': 'ms', 'mya': 'my', 'nau': 'na',\n 'nav': 'nv', 'nbl': 'nr', 'nde': 'nd', 'ndo': 'ng', 'nep': 'ne', 'nld': 'nl',\n 'nno': 'nn', 'nob': 'nb', 'nor': 'no', 'nya': 'ny', 'oci': 'oc', 'oji': 'oj',\n 'ori': 'or', 'orm': 'om', 'oss': 'os', 'pan': 'pa', 'per': 'fa', 'pli': 'pi',\n 'pol': 'pl', 'por': 'pt', 'pus': 'ps', 'que': 'qu', 'roh': 'rm', 'ron': 'ro',\n 'rum': 'ro', 'run': 'rn', 'rus': 'ru', 'sag': 'sg', 'san': 'sa', 'sin': 'si',\n 'slk': 'sk', 'slo': 'sk', 'slv': 'sl', 'sme': 'se', 'smo': 'sm', 'sna': 'sn',\n 'snd': 'sd', 'som': 'so', 'sot': 'st', 'spa': 'es', 'sqi': 'sq', 'srd': 'sc',\n 'srp': 'sr', 'ssw': 'ss', 'sun': 'su', 'swa': 'sw', 'swe': 'sv', 'tah': 'ty',\n 'tam': 'ta', 'tat': 'tt', 'tel': 'te', 'tgk': 'tg', 'tgl': 'tl', 'tha': 'th',\n 'tib': 'bo', 'tir': 'ti', 'ton': 'to', 'tsn': 'tn', 'tso': 'ts', 'tuk': 'tk',\n 'tur': 'tr', 'twi': 'tw', 'uig': 'ug', 'ukr': 'uk', 'urd': 'ur', 'uzb': 'uz',\n 'ven': 've', 'vie': 'vi', 'vol': 'vo', 'wel': 'cy', 'wln': 'wa', 'wol': 'wo',\n 'xho': 'xh', 'yid': 'yi', 'yor': 'yo', 'zha': 'za', 'zho': 'zh', 'zul': 'zu'\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/language_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.StreamUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.MediaSourceEngine');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.util.ArrayUtils');\ngoog.require('shaka.util.LanguageUtils');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n/**\n * @param {shakaExtern.Variant} variant\n * @param {shakaExtern.Restrictions} restrictions\n * Configured restrictions from the user.\n * @param {{width: number, height: number}} maxHwRes\n * The maximum resolution the hardware can handle.\n * This is applied separately from user restrictions because the setting\n * should not be easily replaced by the user's configuration.\n * @return {boolean}\n */\nshaka.util.StreamUtils.meetsRestrictions = function(\n variant, restrictions, maxHwRes) {\n var video = variant.video;\n if (video) {\n if (video.width < restrictions.minWidth ||\n video.width > restrictions.maxWidth || video.width > maxHwRes.width ||\n video.height < restrictions.minHeight ||\n video.height > restrictions.maxHeight ||\n video.height > maxHwRes.height ||\n (video.width * video.height) < restrictions.minPixels ||\n (video.width * video.height) > restrictions.maxPixels) {\n return false;\n }\n }\n\n if (variant.bandwidth < restrictions.minBandwidth ||\n variant.bandwidth > restrictions.maxBandwidth) {\n return false;\n }\n\n return true;\n};\n\n\n/**\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Restrictions} restrictions\n * @param {{width: number, height: number}} maxHwRes\n * @return {boolean} Whether the tracks changed.\n */\nshaka.util.StreamUtils.applyRestrictions =\n function(period, restrictions, maxHwRes) {\n var tracksChanged = false;\n\n period.variants.forEach(function(variant) {\n var originalAllowed = variant.allowedByApplication;\n variant.allowedByApplication = shaka.util.StreamUtils.meetsRestrictions(\n variant, restrictions, maxHwRes);\n\n if (originalAllowed != variant.allowedByApplication) {\n tracksChanged = true;\n }\n });\n\n return tracksChanged;\n};\n\n\n/**\n * Alters the given Period to filter out any unplayable streams.\n *\n * @param {shaka.media.DrmEngine} drmEngine\n * @param {!Object.<string, shakaExtern.Stream>} activeStreams\n * @param {shakaExtern.Period} period\n */\nshaka.util.StreamUtils.filterPeriod = function(\n drmEngine, activeStreams, period) {\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var activeVideo = activeStreams[ContentType.VIDEO];\n var activeAudio = activeStreams[ContentType.AUDIO];\n\n // Filter variants\n for (var i = 0; i < period.variants.length; ++i) {\n var variant = period.variants[i];\n if (!StreamUtils.variantIsCompatible_(\n variant, drmEngine, activeAudio, activeVideo)) {\n shaka.log.debug('Dropping Variant (not compatible with key system, ' +\n 'platform, or active Variant)', variant);\n period.variants.splice(i, 1);\n --i;\n continue;\n }\n }\n\n // Filter text streams\n for (var i = 0; i < period.textStreams.length; ++i) {\n var stream = period.textStreams[i];\n var fullMimeType = StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n if (!shaka.media.TextEngine.isTypeSupported(fullMimeType)) {\n shaka.log.debug('Dropping text stream. Is not supported by the ' +\n 'platform.', stream);\n period.textStreams.splice(i, 1);\n --i;\n }\n }\n};\n\n\n/**\n * Checks if a stream is compatible with the key system, platform,\n * and active stream.\n *\n * @param {?shakaExtern.Stream} stream\n * @param {shaka.media.DrmEngine} drmEngine\n * @param {?shakaExtern.Stream} activeStream\n * @return {boolean}\n * @private\n */\nshaka.util.StreamUtils.streamIsCompatible_ =\n function(stream, drmEngine, activeStream) {\n if (!stream) return true;\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n goog.asserts.assert(stream.type != ContentType.TEXT,\n 'Should not be called on a text stream!');\n\n var drmSupportedMimeTypes = null;\n if (drmEngine && drmEngine.initialized()) {\n drmSupportedMimeTypes = drmEngine.getSupportedTypes();\n }\n\n // Check if stream can be played by the platform\n var fullMimeType = shaka.util.StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n\n if (!shaka.media.MediaSourceEngine.isTypeSupported(fullMimeType))\n return false;\n\n // Check if stream can be handled by the key system.\n // There's no need to check that the stream is supported by the\n // chosen key system since the caller has already verified that.\n if (drmSupportedMimeTypes && stream.encrypted &&\n drmSupportedMimeTypes.indexOf(fullMimeType) < 0) {\n return false;\n }\n\n // Lastly, check if active stream can switch to the stream\n // Basic mime types and basic codecs need to match.\n // For example, we can't adapt between WebM and MP4,\n // nor can we adapt between mp4a.* to ec-3.\n // We can switch between text types on the fly,\n // so don't run this check on text.\n if (activeStream) {\n if (stream.mimeType != activeStream.mimeType ||\n stream.codecs.split('.')[0] != activeStream.codecs.split('.')[0]) {\n return false;\n }\n }\n\n return true;\n};\n\n\n/**\n * Checks if a variant is compatible with the key system, platform,\n * and active stream.\n *\n * @param {!shakaExtern.Variant} variant\n * @param {shaka.media.DrmEngine} drmEngine\n * @param {shakaExtern.Stream} activeAudio\n * @param {shakaExtern.Stream} activeVideo\n * @return {boolean}\n * @private\n */\nshaka.util.StreamUtils.variantIsCompatible_ =\n function(variant, drmEngine, activeAudio, activeVideo) {\n var StreamUtils = shaka.util.StreamUtils;\n if (drmEngine && drmEngine.initialized()) {\n if (!drmEngine.isSupportedByKeySystem(variant)) return false;\n }\n\n return StreamUtils.streamIsCompatible_(variant.audio,\n drmEngine,\n activeAudio) &&\n StreamUtils.streamIsCompatible_(variant.video, drmEngine, activeVideo);\n};\n\n\n/**\n * Gets an array of Track objects for the given Period\n *\n * @param {shakaExtern.Period} period\n * @param {?number} activeAudioId\n * @param {?number} activeVideoId\n * @return {!Array.<shakaExtern.Track>}\n */\nshaka.util.StreamUtils.getVariantTracks =\n function(period, activeAudioId, activeVideoId) {\n var StreamUtils = shaka.util.StreamUtils;\n var variants = StreamUtils.getPlayableVariants(period.variants);\n var label = null;\n var tracks = variants.map(function(variant) {\n var isActive;\n if (variant.video && variant.audio) {\n isActive = activeVideoId == variant.video.id &&\n activeAudioId == variant.audio.id;\n } else {\n isActive = (variant.video && activeVideoId == variant.video.id) ||\n (variant.audio && activeAudioId == variant.audio.id);\n }\n var codecs = '';\n if (variant.video) codecs += variant.video.codecs;\n if (variant.audio) {\n if (codecs != '') codecs += ', ';\n codecs += variant.audio.codecs;\n label = variant.audio.label;\n }\n\n var audioCodec = variant.audio ? variant.audio.codecs : null;\n var videoCodec = variant.video ? variant.video.codecs : null;\n var mimeType = null;\n if (variant.video) mimeType = variant.video.mimeType;\n else if (variant.audio) mimeType = variant.audio.mimeType;\n\n var kind = null;\n if (variant.audio) kind = variant.audio.kind;\n else if (variant.video) kind = variant.video.kind;\n\n var audioRoles = variant.audio ? variant.audio.roles : [];\n var videoRoles = variant.video ? variant.video.roles : [];\n var roles = shaka.util.ArrayUtils.removeDuplicates(\n audioRoles.concat(videoRoles));\n return {\n id: variant.id,\n active: isActive,\n type: 'variant',\n bandwidth: variant.bandwidth,\n language: variant.language,\n label: label,\n kind: kind || null,\n width: variant.video ? variant.video.width : null,\n height: variant.video ? variant.video.height : null,\n frameRate: variant.video ? variant.video.frameRate : undefined,\n mimeType: mimeType,\n codecs: codecs,\n audioCodec: audioCodec,\n videoCodec: videoCodec,\n primary: variant.primary,\n roles: roles,\n videoId: variant.video ? variant.video.id : null,\n audioId: variant.audio ? variant.audio.id : null\n };\n });\n\n return tracks;\n};\n\n\n/**\n * Gets an array of text Track objects for the given Period.\n *\n * @param {shakaExtern.Period} period\n * @param {?number} activeStreamId\n * @return {!Array.<shakaExtern.Track>}\n */\nshaka.util.StreamUtils.getTextTracks = function(period, activeStreamId) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n return period.textStreams.map(function(stream) {\n return {\n id: stream.id,\n active: activeStreamId == stream.id,\n type: ContentType.TEXT,\n language: stream.language,\n label: stream.label,\n kind: stream.kind,\n mimeType: stream.mimeType,\n codecs: stream.codecs || null,\n audioCodec: null,\n videoCodec: null,\n primary: stream.primary,\n roles: stream.roles\n };\n });\n};\n\n\n/**\n * Find the Variant for the given track.\n *\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Track} track\n * @return {?shakaExtern.Variant}\n */\nshaka.util.StreamUtils.findVariantForTrack = function(period, track) {\n for (var i = 0; i < period.variants.length; i++) {\n if (period.variants[i].id == track.id)\n return period.variants[i];\n }\n return null;\n};\n\n\n/**\n * Find the text stream for the given track.\n *\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Track} track\n * @return {?shakaExtern.Stream}\n */\nshaka.util.StreamUtils.findTextStreamForTrack = function(period, track) {\n for (var i = 0; i < period.textStreams.length; i++) {\n if (period.textStreams[i].id == track.id)\n return period.textStreams[i];\n }\n return null;\n};\n\n\n/**\n * Determines if the given variant is playable.\n * @param {!shakaExtern.Variant} variant\n * @return {boolean}\n */\nshaka.util.StreamUtils.isPlayable = function(variant) {\n return variant.allowedByApplication && variant.allowedByKeySystem;\n};\n\n\n/**\n * Filters out not playable variants.\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @return {!Array.<!shakaExtern.Variant>}\n */\nshaka.util.StreamUtils.getPlayableVariants = function(variants) {\n return variants.filter(function(variant) {\n return shaka.util.StreamUtils.isPlayable(variant);\n });\n};\n\n\n/**\n * Chooses variants according to the given config.\n *\n * @param {shakaExtern.Period} period\n * @param {string} preferredLanguage\n * @param {!Object=} opt_languageMatches\n * @param {string=} opt_role\n * @return {!Array.<!shakaExtern.Variant>}\n */\nshaka.util.StreamUtils.filterVariantsByRoleAndLanguage = function(\n period, preferredLanguage, opt_languageMatches, opt_role) {\n var LanguageUtils = shaka.util.LanguageUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var variants = shaka.util.StreamUtils.getPlayableVariants(period.variants);\n\n // Initially choose the first language in the list.\n /** @type {!Array.<!shakaExtern.Variant>} */\n var chosen = variants.filter(function(variant) {\n return variant.language == variants[0].language;\n });\n\n // Prefer primary variants.\n var primaryVariants = variants.filter(function(variant) {\n return variant.primary;\n });\n if (primaryVariants.length) chosen = primaryVariants;\n\n // Choose based on language preference. Favor exact matches, then\n // base matches, finally different subtags. Execute in reverse order so\n // the later steps override the previous ones.\n if (preferredLanguage) {\n var pref = LanguageUtils.normalize(preferredLanguage);\n [LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY,\n LanguageUtils.MatchType.BASE_LANGUAGE_OKAY,\n LanguageUtils.MatchType.EXACT]\n .forEach(function(matchType) {\n var betterLangMatchFound = false;\n variants.forEach(function(variant) {\n pref = LanguageUtils.normalize(pref);\n var lang = LanguageUtils.normalize(variant.language);\n if (LanguageUtils.match(matchType, pref, lang)) {\n if (betterLangMatchFound) {\n chosen.push(variant);\n } else {\n chosen = [variant];\n betterLangMatchFound = true;\n }\n if (opt_languageMatches) {\n opt_languageMatches[ContentType.AUDIO] = true;\n }\n }\n }); // forEach(variant)\n }); // forEach(matchType)\n } // if (preferredLanguage)\n\n // Choose based on role preference. If there's no exact match, return\n // what was chosen based on the language preference.\n var role = opt_role || '';\n if (role) {\n var chosenWithRoles = chosen.filter(function(variant) {\n return (variant.audio && (variant.audio.roles.indexOf(role) > - 1)) ||\n (variant.video && (variant.video.roles.indexOf(role) > - 1));\n });\n if (chosenWithRoles.length) return chosenWithRoles;\n else {\n shaka.log.warning(\n 'No exact match for the role is found. Returning the selection ' +\n 'based on language preference.');\n }\n }\n return chosen;\n};\n\n\n/**\n * Chooses text streams according to the given config.\n *\n * @param {shakaExtern.Period} period\n * @param {string} preferredLanguage\n * @param {!Object=} opt_languageMatches\n * @param {string=} opt_role\n * @return {!Array.<!shakaExtern.Stream>}\n */\nshaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage = function(\n period, preferredLanguage, opt_languageMatches, opt_role) {\n var LanguageUtils = shaka.util.LanguageUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var streams = period.textStreams;\n\n // Choose all the streams.\n /** @type {!Array.<!shakaExtern.Stream>} */\n var chosen = streams;\n\n // Prefer primary text streams.\n var primaryStreams = streams.filter(function(stream) {\n return stream.primary;\n });\n if (primaryStreams.length) chosen = primaryStreams;\n\n // Override based on language preference. Favor exact matches, then\n // base matches, finally different subtags. Execute in reverse order so\n // the later steps override the previous ones.\n if (preferredLanguage) {\n var pref = LanguageUtils.normalize(preferredLanguage);\n [LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY,\n LanguageUtils.MatchType.BASE_LANGUAGE_OKAY,\n LanguageUtils.MatchType.EXACT]\n .forEach(function(matchType) {\n var betterLangMatchFound = false;\n streams.forEach(function(stream) {\n var lang = LanguageUtils.normalize(stream.language);\n if (LanguageUtils.match(matchType, pref, lang)) {\n if (betterLangMatchFound) {\n chosen.push(stream);\n } else {\n chosen = [stream];\n betterLangMatchFound = true;\n }\n if (opt_languageMatches)\n opt_languageMatches[ContentType.TEXT] = true;\n }\n }); // forEach(stream)\n }); // forEach(matchType)\n } // if (preferredLanguage)\n // Choose based on role preference. If there's no exact match, return\n // what was chosen based on the language preference.\n var role = opt_role || '';\n if (role) {\n var chosenWithRoles = chosen.filter(function(stream) {\n return (stream && (stream.roles.indexOf(role) > - 1));\n });\n if (chosenWithRoles.length) return chosenWithRoles;\n else {\n shaka.log.warning(\n 'No exact match for the role is found. Returning the selection ' +\n 'based on language preference.');\n }\n }\n return chosen;\n};\n\n\n/**\n * Finds a Variant with given audio and video streams.\n * Returns null if none was found.\n *\n * @param {?shakaExtern.Stream} audio\n * @param {?shakaExtern.Stream} video\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @return {?shakaExtern.Variant}\n */\nshaka.util.StreamUtils.getVariantByStreams = function(audio, video, variants) {\n for (var i = 0; i < variants.length; i++) {\n if (variants[i].audio == audio && variants[i].video == video)\n return variants[i];\n }\n\n return null;\n};\n\n\n/**\n * Finds a Variant with the given video and audio streams, by stream ID.\n * Returns null if none were found.\n *\n * @param {?number} audioId\n * @param {?number} videoId\n * @param {!Array.<shakaExtern.Variant>} variants\n * @return {?shakaExtern.Variant}\n */\nshaka.util.StreamUtils.getVariantByStreamIds = function(\n audioId, videoId, variants) {\n function matchesId(id, stream) {\n if (id == null)\n return stream == null;\n else\n return stream.id == id;\n }\n\n for (var i = 0; i < variants.length; i++) {\n if (matchesId(audioId, variants[i].audio) &&\n matchesId(videoId, variants[i].video)) {\n return variants[i];\n }\n }\n\n return null;\n};\n\n\n/**\n * Takes a MIME type and optional codecs string and produces the full MIME type.\n *\n * @param {string} mimeType\n * @param {string=} opt_codecs\n * @return {string}\n */\nshaka.util.StreamUtils.getFullMimeType = function(mimeType, opt_codecs) {\n var fullMimeType = mimeType;\n if (opt_codecs) {\n fullMimeType += '; codecs=\"' + opt_codecs + '\"';\n }\n return fullMimeType;\n};\n\n\n/**\n * Gets the index of the Period that contains the given time.\n * @param {shakaExtern.Manifest} manifest\n * @param {number} time The time in seconds from the start of the presentation.\n * @return {number}\n */\nshaka.util.StreamUtils.findPeriodContainingTime = function(manifest, time) {\n for (var i = manifest.periods.length - 1; i > 0; --i) {\n var period = manifest.periods[i];\n if (time >= period.startTime)\n return i;\n }\n return 0;\n};\n\n\n/**\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.Stream} stream\n * @return {number} The index of the Period which contains |stream|, or -1 if\n * no Period contains |stream|.\n */\nshaka.util.StreamUtils.findPeriodContainingStream = function(manifest, stream) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n for (var periodIdx = 0; periodIdx < manifest.periods.length; ++periodIdx) {\n var period = manifest.periods[periodIdx];\n if (stream.type == ContentType.TEXT) {\n for (var j = 0; j < period.textStreams.length; ++j) {\n var textStream = period.textStreams[j];\n if (textStream == stream)\n return periodIdx;\n }\n } else {\n for (var j = 0; j < period.variants.length; ++j) {\n var variant = period.variants[j];\n if (variant.audio == stream || variant.video == stream ||\n (variant.video && variant.video.trickModeVideo == stream)) {\n return periodIdx;\n }\n }\n }\n }\n return -1;\n};\n\n\n/**\n * Gets the rebuffering goal from the manifest and configuration.\n *\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.StreamingConfiguration} config\n * @param {number} scaleFactor\n *\n * @return {number}\n */\nshaka.util.StreamUtils.getRebufferingGoal = function(\n manifest, config, scaleFactor) {\n return scaleFactor *\n Math.max(manifest.minBufferTime || 0, config.rebufferingGoal);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/stream_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.abr.SimpleAbrManager');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.abr.EwmaBandwidthEstimator');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * <p>\n * This defines the default ABR manager for the Player. An instance of this\n * class is used when no ABR manager is given.\n * </p>\n * <p>\n * The behavior of this class is to take throughput samples using\n * segmentDownloaded to estimate the current network bandwidth. Then it will\n * use that to choose the streams that best fit the current bandwidth. It will\n * always pick the highest bandwidth variant it thinks can be played.\n * </p>\n * <p>\n * After the initial choice (in chooseStreams), this class will call\n * switchCallback() when there is a better choice. switchCallback() will not\n * be called more than once per\n * ({@link shaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS}).\n * </p>\n * <p>\n * This does not adapt for text streams, it will always select the first one.\n * </p>\n *\n * @constructor\n * @struct\n * @implements {shakaExtern.AbrManager}\n * @export\n */\nshaka.abr.SimpleAbrManager = function() {\n /** @private {?shakaExtern.AbrManager.SwitchCallback} */\n this.switch_ = null;\n\n /** @private {boolean} */\n this.enabled_ = false;\n\n /** @private {shaka.abr.EwmaBandwidthEstimator} */\n this.bandwidthEstimator_ = new shaka.abr.EwmaBandwidthEstimator();\n\n /**\n * A filtered list of Variants to choose from.\n * @private {!Array.<!shakaExtern.Variant>}\n */\n this.variants_ = [];\n\n /**\n * A filtered list of text streams to choose from.\n * @private {!Array.<!shakaExtern.Stream>}\n */\n this.textStreams_ = [];\n\n /** @private {boolean} */\n this.startupComplete_ = false;\n\n /**\n * The last wall-clock time, in milliseconds, when Streams were chosen via\n * chooseStreams() or switch_().\n *\n * @private {?number}\n */\n this.lastTimeChosenMs_ = null;\n\n /** @private {shakaExtern.Restrictions} */\n this.restrictions_ = {\n minWidth: 0,\n maxWidth: Infinity,\n minHeight: 0,\n maxHeight: Infinity,\n minPixels: 0,\n maxPixels: Infinity,\n minBandwidth: 0,\n maxBandwidth: Infinity\n };\n};\n\n\n/**\n * The minimum amount of time that must pass between switches, in milliseconds.\n * This keeps us from changing too often and annoying the user.\n *\n * @const {number}\n */\nshaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS = 8000;\n\n\n/**\n * The fraction of the estimated bandwidth which we should try to use when\n * upgrading.\n *\n * @private\n * @const {number}\n */\nshaka.abr.SimpleAbrManager.BANDWIDTH_UPGRADE_TARGET_ = 0.85;\n\n\n/**\n * The largest fraction of the estimated bandwidth we should use. We should\n * downgrade to avoid this.\n *\n * @private\n * @const {number}\n */\nshaka.abr.SimpleAbrManager.BANDWIDTH_DOWNGRADE_TARGET_ = 0.95;\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.stop = function() {\n this.switch_ = null;\n this.enabled_ = false;\n this.variants_ = [];\n this.textStreams_ = [];\n this.lastTimeChosenMs_ = null;\n\n // Don't reset |startupComplete_|: if we've left the startup interval then we\n // can start using bandwidth estimates right away if init() is called again.\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.init = function(switchCallback) {\n this.switch_ = switchCallback;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.chooseStreams = function(\n mediaTypesToUpdate) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n // Choose streams for the specific types requested.\n var chosen = {};\n\n if (mediaTypesToUpdate.indexOf(ContentType.AUDIO) > -1 ||\n mediaTypesToUpdate.indexOf(ContentType.VIDEO) > -1) {\n // Choose a new Variant\n var variant = this.chooseVariant_(this.variants_);\n if (variant && variant.video)\n chosen[ContentType.VIDEO] = variant.video;\n\n if (variant && variant.audio)\n chosen[ContentType.AUDIO] = variant.audio;\n }\n\n if (mediaTypesToUpdate.indexOf(ContentType.TEXT) > -1) {\n // We don't adapt text, so just choose stream 0.\n chosen[ContentType.TEXT] = this.textStreams_[0];\n }\n\n this.lastTimeChosenMs_ = Date.now();\n return chosen;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.enable = function() {\n this.enabled_ = true;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.disable = function() {\n this.enabled_ = false;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.segmentDownloaded = function(\n deltaTimeMs, numBytes) {\n shaka.log.v2('Segment downloaded:',\n 'deltaTimeMs=' + deltaTimeMs,\n 'numBytes=' + numBytes);\n goog.asserts.assert(deltaTimeMs >= 0, 'expected a non-negative duration');\n this.bandwidthEstimator_.sample(deltaTimeMs, numBytes);\n\n if ((this.lastTimeChosenMs_ != null) && this.enabled_)\n this.suggestStreams_();\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.getBandwidthEstimate = function() {\n return this.bandwidthEstimator_.getBandwidthEstimate();\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setDefaultEstimate = function(estimate) {\n this.bandwidthEstimator_.setDefaultEstimate(estimate);\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setRestrictions = function(restrictions) {\n this.restrictions_ = restrictions;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setVariants = function(variants) {\n this.variants_ = variants;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.abr.SimpleAbrManager.prototype.setTextStreams = function(streams) {\n this.textStreams_ = streams;\n};\n\n\n/**\n * Calls switch_() with which Streams to switch to.\n *\n * @private\n */\nshaka.abr.SimpleAbrManager.prototype.suggestStreams_ = function() {\n shaka.log.v2('Suggesting Streams...');\n goog.asserts.assert(this.lastTimeChosenMs_ != null,\n 'lastTimeChosenMs_ should not be null');\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n if (!this.startupComplete_) {\n // Check if we've got enough data yet.\n if (!this.bandwidthEstimator_.hasGoodEstimate()) {\n shaka.log.v2('Still waiting for a good estimate...');\n return;\n }\n this.startupComplete_ = true;\n } else {\n // Check if we've left the switch interval.\n var now = Date.now();\n var delta = now - this.lastTimeChosenMs_;\n if (delta < shaka.abr.SimpleAbrManager.SWITCH_INTERVAL_MS) {\n shaka.log.v2('Still within switch interval...');\n return;\n }\n }\n\n var chosen = this.chooseStreams([ContentType.AUDIO, ContentType.VIDEO]);\n var currentBandwidthKbps =\n Math.round(this.bandwidthEstimator_.getBandwidthEstimate() / 1000.0);\n shaka.log.debug(\n 'Calling switch_(), bandwidth=' + currentBandwidthKbps + ' kbps');\n // If any of these chosen streams are already chosen, Player will filter them\n // out before passing the choices on to StreamingEngine.\n this.switch_(chosen);\n};\n\n\n/**\n * Chooses a Variant with an optimal bandwidth.\n *\n * @param {!Array.<shakaExtern.Variant>} variants\n * @return {shakaExtern.Variant}\n * @private\n */\nshaka.abr.SimpleAbrManager.prototype.chooseVariant_ = function(variants) {\n // Alias.\n var SimpleAbrManager = shaka.abr.SimpleAbrManager;\n\n // Get sorted Streams.\n var sortedVariants = SimpleAbrManager.filterAndSortVariants_(\n this.restrictions_, variants);\n var currentBandwidth = this.bandwidthEstimator_.getBandwidthEstimate();\n\n if (variants.length && !sortedVariants.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET);\n }\n\n // Start by assuming that we will use the first Stream.\n var chosen = sortedVariants[0];\n\n for (var i = 0; i < sortedVariants.length; ++i) {\n var variant = sortedVariants[i];\n var nextVariant = sortedVariants[i + 1] || {bandwidth: Infinity};\n\n var minBandwidth = variant.bandwidth /\n SimpleAbrManager.BANDWIDTH_DOWNGRADE_TARGET_;\n var maxBandwidth = nextVariant.bandwidth /\n SimpleAbrManager.BANDWIDTH_UPGRADE_TARGET_;\n shaka.log.v2('Bandwidth ranges:',\n (variant.bandwidth / 1e6).toFixed(3),\n (minBandwidth / 1e6).toFixed(3),\n (maxBandwidth / 1e6).toFixed(3));\n\n if (currentBandwidth >= minBandwidth && currentBandwidth <= maxBandwidth)\n chosen = variant;\n }\n\n return chosen;\n};\n\n\n/**\n * @param {shakaExtern.Restrictions} restrictions\n * @param {!Array.<shakaExtern.Variant>} variants\n * @return {!Array.<shakaExtern.Variant>} variants filtered according to\n * |restrictions| and sorted in ascending order of bandwidth.\n * @private\n */\nshaka.abr.SimpleAbrManager.filterAndSortVariants_ = function(\n restrictions, variants) {\n return variants\n .filter(function(variant) {\n return shaka.util.StreamUtils.meetsRestrictions(\n variant, restrictions,\n /* maxHwRes */ {width: Infinity, height: Infinity});\n })\n .sort(function(v1, v2) {\n return v1.bandwidth - v2.bandwidth;\n });\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/abr/simple_abr_manager.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.FakeEvent');\n\n\n\n/**\n * Create an Event work-alike object based on the dictionary.\n * The event should contain all of the same properties from the dict.\n *\n * @param {string} type\n * @param {Object=} opt_dict\n * @constructor\n * @extends {Event}\n */\nshaka.util.FakeEvent = function(type, opt_dict) {\n // Take properties from dict if present.\n var dict = opt_dict || {};\n for (var key in dict) {\n this[key] = dict[key];\n }\n\n\n // These Properties below cannot be set by dict. They are all provided for\n // compatibility with native events.\n\n /** @const {boolean} */\n this.bubbles = false;\n\n /** @type {boolean} */\n this.cancelable = false;\n\n /** @type {boolean} */\n this.defaultPrevented = false;\n\n /**\n * According to MDN, Chrome uses high-res timers instead of epoch time.\n * Follow suit so that timeStamps on FakeEvents use the same base as\n * on native Events.\n * @const {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp\n */\n this.timeStamp = window.performance && window.performance.now ?\n window.performance.now() : Date.now();\n\n /** @const {string} */\n this.type = type;\n\n /** @const {boolean} */\n this.isTrusted = false;\n\n /** @type {EventTarget} */\n this.currentTarget = null;\n\n /** @type {EventTarget} */\n this.target = null;\n\n\n /**\n * Non-standard property read by FakeEventTarget to stop processing listeners.\n * @type {boolean}\n */\n this.stopped = false;\n};\n\n\n/**\n * Prevents the default action of the event. Has no effect if the event isn't\n * cancellable.\n * @override\n */\nshaka.util.FakeEvent.prototype.preventDefault = function() {\n if (this.cancelable)\n this.defaultPrevented = true;\n};\n\n\n/**\n * Stops processing event listeners for this event. Provided for compatibility\n * with native Events.\n * @override\n */\nshaka.util.FakeEvent.prototype.stopImmediatePropagation = function() {\n this.stopped = true;\n};\n\n\n/**\n * Does nothing, since FakeEvents do not bubble. Provided for compatibility\n * with native Events.\n * @override\n */\nshaka.util.FakeEvent.prototype.stopPropagation = function() {};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/fake_event.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastUtils');\n\ngoog.require('shaka.util.FakeEvent');\n\n\n/**\n * @namespace shaka.cast.CastUtils\n * @summary A set of cast utility functions and variables shared between sender\n * and receiver.\n */\n\n\n/**\n * HTMLMediaElement events that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoEvents = [\n 'ended',\n 'play',\n 'playing',\n 'pause',\n 'pausing',\n 'ratechange',\n 'seeked',\n 'seeking',\n 'timeupdate',\n 'volumechange'\n];\n\n\n/**\n * HTMLMediaElement attributes that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoAttributes = [\n 'buffered',\n 'currentTime',\n 'duration',\n 'ended',\n 'loop',\n 'muted',\n 'paused',\n 'playbackRate',\n 'seeking',\n 'videoHeight',\n 'videoWidth',\n 'volume'\n];\n\n\n/**\n * HTMLMediaElement attributes that are transferred when casting begins.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoInitStateAttributes = [\n 'loop',\n 'playbackRate'\n];\n\n\n/**\n * HTMLMediaElement methods with no return value that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.VideoVoidMethods = [\n 'pause',\n 'play'\n];\n\n\n/**\n * Player events that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerEvents = [\n 'adaptation',\n 'buffering',\n 'emsg',\n 'error',\n 'loading',\n 'unloading',\n 'texttrackvisibility',\n 'timelineregionadded',\n 'timelineregionenter',\n 'timelineregionexit',\n 'trackschanged'\n];\n\n\n/**\n * Player getter methods that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerGetterMethods = [\n 'drmInfo',\n 'getAudioLanguages',\n 'getConfiguration',\n 'getExpiration',\n 'getManifestUri',\n 'getPlaybackRate',\n 'getPlayheadTimeAsDate',\n 'getTextLanguages',\n 'getTextTracks',\n 'getTracks',\n 'getStats',\n 'getVariantTracks',\n 'isBuffering',\n 'isInProgress',\n 'isLive',\n 'isTextTrackVisible',\n 'keySystem',\n 'seekRange'\n];\n\n\n/**\n * Player getter and setter methods that are used to transfer state when casting\n * begins.\n * @const {!Array.<!Array.<string>>}\n */\nshaka.cast.CastUtils.PlayerInitState = [\n ['getConfiguration', 'configure']\n];\n\n\n/**\n * Player getter and setter methods that are used to transfer state after\n * after load() is resolved.\n * @const {!Array.<!Array.<string>>}\n */\nshaka.cast.CastUtils.PlayerInitAfterLoadState = [\n ['isTextTrackVisible', 'setTextTrackVisibility']\n];\n\n\n/**\n * Player methods with no return value that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerVoidMethods = [\n 'addTextTrack',\n 'cancelTrickPlay',\n 'configure',\n 'resetConfiguration',\n 'selectAudioLanguage',\n 'selectTextLanguage',\n 'selectTextTrack',\n 'selectTrack',\n 'selectVariantTrack',\n 'setTextTrackVisibility',\n 'trickPlay'\n];\n\n\n/**\n * Player methods returning a Promise that are proxied while casting.\n * @const {!Array.<string>}\n */\nshaka.cast.CastUtils.PlayerPromiseMethods = [\n // The opt_manifestFactory method is not supported.\n 'load',\n 'unload'\n];\n\n\n/**\n * @typedef {{\n * video: Object,\n * player: Object,\n * manifest: ?string,\n * startTime: ?number\n * }}\n * @property {Object} video\n * Dictionary of video properties to be set.\n * @property {Object} player\n * Dictionary of player setters to be called.\n * @property {?string} manifest\n * The currently-selected manifest, if present.\n * @property {?number} startTime\n * The playback start time, if currently playing.\n */\nshaka.cast.CastUtils.InitStateType;\n\n\n/**\n * The namespace for Shaka messages on the cast bus.\n * @const {string}\n */\nshaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE = 'urn:x-cast:com.google.shaka.v2';\n\n\n/**\n * The namespace for generic messages on the cast bus.\n * @const {string}\n */\nshaka.cast.CastUtils.GENERIC_MESSAGE_NAMESPACE =\n 'urn:x-cast:com.google.cast.media';\n\n\n/**\n * Serialize as JSON, but specially encode things JSON will not otherwise\n * represent.\n * @param {?} thing\n * @return {string}\n */\nshaka.cast.CastUtils.serialize = function(thing) {\n return JSON.stringify(thing, function(key, value) {\n if (key == 'manager') {\n // ABR manager can't be serialized.\n return undefined;\n }\n if (typeof value == 'function') {\n // Functions can't be (safely) serialized.\n return undefined;\n }\n if (value instanceof Event || value instanceof shaka.util.FakeEvent) {\n // Events don't serialize to JSON well because of the DOM objects\n // and other complex objects they contain. So we strip these out.\n // Note that using Object.keys or JSON.stringify directly on the event\n // will not capture its properties. We must use a for loop.\n var simpleEvent = {};\n for (var eventKey in value) {\n var eventValue = value[eventKey];\n if (eventValue && typeof eventValue == 'object') {\n // Strip out non-null object types because they are complex and we\n // don't need them.\n } else if (eventKey in Event) {\n // Strip out keys that are found on Event itself because they are\n // class-level constants we don't need, like Event.MOUSEMOVE == 16.\n } else {\n simpleEvent[eventKey] = eventValue;\n }\n }\n return simpleEvent;\n }\n if (value instanceof TimeRanges) {\n // TimeRanges must be unpacked into plain data for serialization.\n return shaka.cast.CastUtils.unpackTimeRanges_(value);\n }\n if (typeof value == 'number') {\n // NaN and infinity cannot be represented directly in JSON.\n if (isNaN(value)) return 'NaN';\n if (isFinite(value)) return value;\n if (value < 0) return '-Infinity';\n return 'Infinity';\n }\n return value;\n });\n};\n\n\n/**\n * Deserialize JSON using our special encodings.\n * @param {string} str\n * @return {?}\n */\nshaka.cast.CastUtils.deserialize = function(str) {\n return JSON.parse(str, function(key, value) {\n if (value == 'NaN') {\n return NaN;\n } else if (value == '-Infinity') {\n return -Infinity;\n } else if (value == 'Infinity') {\n return Infinity;\n } else if (value && typeof value == 'object' &&\n value['__type__'] == 'TimeRanges') {\n // TimeRanges objects have been unpacked and sent as plain data.\n // Simulate the original TimeRanges object.\n return shaka.cast.CastUtils.simulateTimeRanges_(value);\n }\n return value;\n });\n};\n\n\n/**\n * @param {!TimeRanges} ranges\n * @return {Object}\n * @private\n */\nshaka.cast.CastUtils.unpackTimeRanges_ = function(ranges) {\n var obj = {\n '__type__': 'TimeRanges', // a signal to deserialize\n 'length': ranges.length,\n 'start': [],\n 'end': []\n };\n\n for (var i = 0; i < ranges.length; ++i) {\n obj['start'].push(ranges.start(i));\n obj['end'].push(ranges.end(i));\n }\n\n return obj;\n};\n\n\n/**\n * Creates a simulated TimeRanges object from data sent by the cast receiver.\n * @param {?} obj\n * @return {{\n * length: number,\n * start: function(number): number,\n * end: function(number): number\n * }}\n * @private\n */\nshaka.cast.CastUtils.simulateTimeRanges_ = function(obj) {\n return {\n length: obj.length,\n // NOTE: a more complete simulation would throw when |i| was out of range,\n // but for simplicity we will assume a well-behaved application that uses\n // length instead of catch to stop iterating.\n start: function(i) { return obj.start[i]; },\n end: function(i) { return obj.end[i]; }\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastSender');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.cast.CastUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * @constructor\n * @struct\n * @param {string} receiverAppId The ID of the cast receiver application.\n * @param {function()} onStatusChanged A callback invoked when the cast status\n * changes.\n * @param {function(string, !shaka.util.FakeEvent)} onRemoteEvent A callback\n * invoked with target name and event when a remote event is received.\n * @param {function()} onResumeLocal A callback invoked when the local player\n * should resume playback. Called before cached remote state is wiped.\n * @param {function()} onInitStateRequired A callback to get local player's.\n * state. Invoked when casting is initiated from Chrome's cast button.\n * @implements {shaka.util.IDestroyable}\n */\nshaka.cast.CastSender =\n function(receiverAppId, onStatusChanged, onRemoteEvent, onResumeLocal,\n onInitStateRequired) {\n /** @private {string} */\n this.receiverAppId_ = receiverAppId;\n\n /** @private {?function()} */\n this.onStatusChanged_ = onStatusChanged;\n\n /** @private {?function(string, !shaka.util.FakeEvent)} */\n this.onRemoteEvent_ = onRemoteEvent;\n\n /** @private {?function()} */\n this.onResumeLocal_ = onResumeLocal;\n\n /** @private {?function()} */\n this.onInitStateRequired_ = onInitStateRequired;\n\n /** @private {boolean} */\n this.apiReady_ = false;\n\n /** @private {boolean} */\n this.hasReceivers_ = false;\n\n /** @private {boolean} */\n this.isCasting_ = false;\n\n /** @private {string} */\n this.receiverName_ = '';\n\n /** @private {Object} */\n this.appData_ = null;\n\n /** @private {chrome.cast.Session} */\n this.session_ = null;\n\n /** @private {Object} */\n this.cachedProperties_ = {\n 'video': {},\n 'player': {}\n };\n\n /** @private {number} */\n this.nextAsyncCallId_ = 0;\n\n /** @private {Object.<string, !shaka.util.PublicPromise>} */\n this.asyncCallPromises_ = {};\n\n /** @private {shaka.util.PublicPromise} */\n this.castPromise_ = null;\n};\n\n\n/** @override */\nshaka.cast.CastSender.prototype.destroy = function() {\n this.rejectAllPromises_();\n if (this.session_) {\n this.session_.leave(function() {}, function() {});\n this.session_ = null;\n }\n\n this.onStatusChanged_ = null;\n this.onRemoteEvent_ = null;\n this.onResumeLocal_ = null;\n this.apiReady_ = false;\n this.hasReceivers_ = false;\n this.isCasting_ = false;\n this.appData_ = null;\n this.cachedProperties_ = null;\n this.asyncCallPromises_ = null;\n this.castPromise_ = null;\n\n return Promise.resolve();\n};\n\n\n/**\n * @return {boolean} True if the cast API is available.\n */\nshaka.cast.CastSender.prototype.apiReady = function() {\n return this.apiReady_;\n};\n\n\n/**\n * @return {boolean} True if there are receivers.\n */\nshaka.cast.CastSender.prototype.hasReceivers = function() {\n return this.hasReceivers_;\n};\n\n\n/**\n * @return {boolean} True if we are currently casting.\n */\nshaka.cast.CastSender.prototype.isCasting = function() {\n return this.isCasting_;\n};\n\n\n/**\n * @return {string} The name of the Cast receiver device, if isCasting().\n */\nshaka.cast.CastSender.prototype.receiverName = function() {\n return this.receiverName_;\n};\n\n\n/**\n * @return {boolean} True if we have a cache of remote properties from the\n * receiver.\n */\nshaka.cast.CastSender.prototype.hasRemoteProperties = function() {\n return Object.keys(this.cachedProperties_['video']).length != 0;\n};\n\n\n/**\n * Initialize the Cast API.\n */\nshaka.cast.CastSender.prototype.init = function() {\n // Check for the cast extension.\n if (!window.chrome || !chrome.cast || !chrome.cast.isAvailable) {\n // Not available yet, so wait to be notified if/when it is available.\n window.__onGCastApiAvailable = (function(loaded) {\n if (loaded) {\n this.init();\n }\n }).bind(this);\n return;\n }\n\n // The API is now available.\n delete window.__onGCastApiAvailable;\n this.apiReady_ = true;\n this.onStatusChanged_();\n\n var sessionRequest = new chrome.cast.SessionRequest(this.receiverAppId_);\n var apiConfig = new chrome.cast.ApiConfig(sessionRequest,\n this.onExistingSessionJoined_.bind(this),\n this.onReceiverStatusChanged_.bind(this),\n 'origin_scoped');\n\n // TODO: have never seen this fail. when would it and how should we react?\n chrome.cast.initialize(apiConfig,\n function() { shaka.log.debug('CastSender: init'); },\n function(error) { shaka.log.error('CastSender: init error', error); });\n};\n\n\n/**\n * Set application-specific data.\n *\n * @param {Object} appData Application-specific data to relay to the receiver.\n */\nshaka.cast.CastSender.prototype.setAppData = function(appData) {\n this.appData_ = appData;\n if (this.isCasting_) {\n this.sendMessage_({\n 'type': 'appData',\n 'appData': this.appData_\n });\n }\n};\n\n\n/**\n * @param {shaka.cast.CastUtils.InitStateType} initState Video and player state\n * to be sent to the receiver.\n * @return {!Promise} Resolved when connected to a receiver. Rejected if the\n * connection fails or is canceled by the user.\n */\nshaka.cast.CastSender.prototype.cast = function(initState) {\n if (!this.apiReady_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.CAST,\n shaka.util.Error.Code.CAST_API_UNAVAILABLE));\n }\n if (!this.hasReceivers_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.CAST,\n shaka.util.Error.Code.NO_CAST_RECEIVERS));\n }\n if (this.isCasting_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.CAST,\n shaka.util.Error.Code.ALREADY_CASTING));\n }\n\n this.castPromise_ = new shaka.util.PublicPromise();\n chrome.cast.requestSession(\n this.onSessionInitiated_.bind(this, initState),\n this.onConnectionError_.bind(this));\n return this.castPromise_;\n};\n\n\n/**\n * Shows user a cast dialog where they can choose to stop\n * casting. Relies on Chrome to perform disconnect if they do.\n * Doesn't do anything if not connected.\n */\nshaka.cast.CastSender.prototype.showDisconnectDialog = function() {\n if (!this.isCasting_) {\n return;\n }\n var initState = this.onInitStateRequired_();\n\n chrome.cast.requestSession(\n this.onSessionInitiated_.bind(this, initState),\n this.onConnectionError_.bind(this));\n};\n\n\n/**\n * Forces the receiver app to shut down by disconnecting. Does nothing if not\n * connected.\n */\nshaka.cast.CastSender.prototype.forceDisconnect = function() {\n if (!this.isCasting_) {\n return;\n }\n\n this.rejectAllPromises_();\n if (this.session_) {\n this.session_.stop(function() {}, function() {});\n this.session_ = null;\n }\n};\n\n\n/**\n * Getter for properties of remote objects.\n * @param {string} targetName\n * @param {string} property\n * @return {?}\n */\nshaka.cast.CastSender.prototype.get = function(targetName, property) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n if (targetName == 'video') {\n if (shaka.cast.CastUtils.VideoVoidMethods.indexOf(property) >= 0) {\n return this.remoteCall_.bind(this, targetName, property);\n }\n } else if (targetName == 'player') {\n if (shaka.cast.CastUtils.PlayerVoidMethods.indexOf(property) >= 0) {\n return this.remoteCall_.bind(this, targetName, property);\n }\n if (shaka.cast.CastUtils.PlayerPromiseMethods.indexOf(property) >= 0) {\n return this.remoteAsyncCall_.bind(this, targetName, property);\n }\n if (shaka.cast.CastUtils.PlayerGetterMethods.indexOf(property) >= 0) {\n return this.propertyGetter_.bind(this, targetName, property);\n }\n }\n\n return this.propertyGetter_(targetName, property);\n};\n\n\n/**\n * Setter for properties of remote objects.\n * @param {string} targetName\n * @param {string} property\n * @param {?} value\n */\nshaka.cast.CastSender.prototype.set = function(targetName, property, value) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n\n this.cachedProperties_[targetName][property] = value;\n this.sendMessage_({\n 'type': 'set',\n 'targetName': targetName,\n 'property': property,\n 'value': value\n });\n};\n\n\n/**\n * @param {shaka.cast.CastUtils.InitStateType} initState\n * @param {chrome.cast.Session} session\n * @private\n */\nshaka.cast.CastSender.prototype.onSessionInitiated_ =\n function(initState, session) {\n shaka.log.debug('CastSender: onSessionInitiated');\n this.onSessionCreated_(session);\n\n this.sendMessage_({\n 'type': 'init',\n 'initState': initState,\n 'appData': this.appData_\n });\n\n this.castPromise_.resolve();\n};\n\n\n/**\n * @param {chrome.cast.Error} error\n * @private\n */\nshaka.cast.CastSender.prototype.onConnectionError_ = function(error) {\n // Default error code:\n var code = shaka.util.Error.Code.UNEXPECTED_CAST_ERROR;\n\n switch (error.code) {\n case 'cancel':\n code = shaka.util.Error.Code.CAST_CANCELED_BY_USER;\n break;\n case 'timeout':\n code = shaka.util.Error.Code.CAST_CONNECTION_TIMED_OUT;\n break;\n case 'receiver_unavailable':\n code = shaka.util.Error.Code.CAST_RECEIVER_APP_UNAVAILABLE;\n break;\n }\n\n this.castPromise_.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.CAST,\n code,\n error));\n};\n\n\n/**\n * @param {string} targetName\n * @param {string} property\n * @return {?}\n * @private\n */\nshaka.cast.CastSender.prototype.propertyGetter_ =\n function(targetName, property) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n return this.cachedProperties_[targetName][property];\n};\n\n\n/**\n * @param {string} targetName\n * @param {string} methodName\n * @private\n */\nshaka.cast.CastSender.prototype.remoteCall_ =\n function(targetName, methodName) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n var args = Array.prototype.slice.call(arguments, 2);\n this.sendMessage_({\n 'type': 'call',\n 'targetName': targetName,\n 'methodName': methodName,\n 'args': args\n });\n};\n\n\n/**\n * @param {string} targetName\n * @param {string} methodName\n * @return {!Promise}\n * @private\n */\nshaka.cast.CastSender.prototype.remoteAsyncCall_ =\n function(targetName, methodName) {\n goog.asserts.assert(targetName == 'video' || targetName == 'player',\n 'Unexpected target name');\n var args = Array.prototype.slice.call(arguments, 2);\n\n var p = new shaka.util.PublicPromise();\n var id = this.nextAsyncCallId_.toString();\n this.nextAsyncCallId_++;\n this.asyncCallPromises_[id] = p;\n\n this.sendMessage_({\n 'type': 'asyncCall',\n 'targetName': targetName,\n 'methodName': methodName,\n 'args': args,\n 'id': id\n });\n return p;\n};\n\n\n/**\n * @param {chrome.cast.Session} session\n * @private\n */\nshaka.cast.CastSender.prototype.onExistingSessionJoined_ = function(session) {\n shaka.log.debug('CastSender: onExistingSessionJoined');\n\n var initState = this.onInitStateRequired_();\n\n this.castPromise_ = new shaka.util.PublicPromise();\n\n this.onSessionInitiated_(initState, session);\n};\n\n\n/**\n * @param {string} availability\n * @private\n */\nshaka.cast.CastSender.prototype.onReceiverStatusChanged_ =\n function(availability) {\n // The cast extension is telling us whether there are any cast receiver\n // devices available.\n shaka.log.debug('CastSender: receiver status', availability);\n this.hasReceivers_ = availability == 'available';\n this.onStatusChanged_();\n};\n\n\n/**\n * @param {chrome.cast.Session} session\n * @private\n */\nshaka.cast.CastSender.prototype.onSessionCreated_ = function(session) {\n this.session_ = session;\n this.session_.addUpdateListener(this.onConnectionStatusChanged_.bind(this));\n this.session_.addMessageListener(\n shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE,\n this.onMessageReceived_.bind(this));\n this.onConnectionStatusChanged_();\n};\n\n\n/**\n * @private\n */\nshaka.cast.CastSender.prototype.onConnectionStatusChanged_ = function() {\n var connected = this.session_ ? this.session_.status == 'connected' : false;\n shaka.log.debug('CastSender: connection status', connected);\n if (this.isCasting_ && !connected) {\n // Tell CastProxy to transfer state back to local player.\n this.onResumeLocal_();\n\n // Clear whatever we have cached.\n for (var targetName in this.cachedProperties_) {\n this.cachedProperties_[targetName] = {};\n }\n\n this.rejectAllPromises_();\n }\n\n this.isCasting_ = connected;\n this.receiverName_ = connected ? this.session_.receiver.friendlyName : '';\n this.onStatusChanged_();\n};\n\n\n/**\n * Reject any async call promises that are still pending.\n * @private\n */\nshaka.cast.CastSender.prototype.rejectAllPromises_ = function() {\n for (var id in this.asyncCallPromises_) {\n var p = this.asyncCallPromises_[id];\n delete this.asyncCallPromises_[id];\n\n // Reject pending async operations as if they were interrupted.\n // At the moment, load() is the only async operation we are worried\n // about.\n p.reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.PLAYER,\n shaka.util.Error.Code.LOAD_INTERRUPTED));\n }\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages are\n * read with quoted properties.\n * @param {string} namespace\n * @param {string} serialized\n * @private\n */\nshaka.cast.CastSender.prototype.onMessageReceived_ =\n function(namespace, serialized) {\n var message = shaka.cast.CastUtils.deserialize(serialized);\n shaka.log.v2('CastSender: message', message);\n\n switch (message['type']) {\n case 'event':\n var targetName = message['targetName'];\n var event = message['event'];\n var fakeEvent = new shaka.util.FakeEvent(event['type'], event);\n this.onRemoteEvent_(targetName, fakeEvent);\n break;\n case 'update':\n var update = message['update'];\n for (var targetName in update) {\n var target = this.cachedProperties_[targetName] || {};\n for (var property in update[targetName]) {\n target[property] = update[targetName][property];\n }\n }\n break;\n case 'asyncComplete':\n var id = message['id'];\n var error = message['error'];\n var p = this.asyncCallPromises_[id];\n delete this.asyncCallPromises_[id];\n\n goog.asserts.assert(p, 'Unexpected async id');\n if (!p) break;\n\n if (error) {\n // This is a hacky way to reconstruct the serialized error.\n var reconstructedError = new shaka.util.Error(\n error.severity, error.category, error.code);\n for (var k in error) {\n (/** @type {Object} */(reconstructedError))[k] = error[k];\n }\n p.reject(reconstructedError);\n } else {\n p.resolve();\n }\n break;\n }\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages passed\n * in here were created with quoted property names.\n * @param {!Object} message\n * @private\n */\nshaka.cast.CastSender.prototype.sendMessage_ = function(message) {\n var serialized = shaka.cast.CastUtils.serialize(message);\n // TODO: have never seen this fail. When would it and how should we react?\n this.session_.sendMessage(shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE,\n serialized,\n function() {}, // success callback\n shaka.log.error); // error callback\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_sender.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.FakeEventTarget');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.MultiMap');\n\n\n\n/**\n * A work-alike for EventTarget. Only DOM elements may be true EventTargets,\n * but this can be used as a base class to provide event dispatch to non-DOM\n * classes. Only FakeEvents should be dispatched.\n *\n * @struct\n * @constructor\n * @implements {EventTarget}\n * @exportInterface\n */\nshaka.util.FakeEventTarget = function() {\n /**\n * @private {!shaka.util.MultiMap.<shaka.util.FakeEventTarget.ListenerType>}\n */\n this.listeners_ = new shaka.util.MultiMap();\n\n /**\n * The target of all dispatched events. Defaults to |this|.\n * @type {EventTarget}\n */\n this.dispatchTarget = this;\n};\n\n\n/**\n * These are the listener types defined in the closure extern for EventTarget.\n * @typedef {EventListener|function(!Event):(boolean|undefined)}\n * @exportInterface\n */\nshaka.util.FakeEventTarget.ListenerType;\n\n\n/**\n * Add an event listener to this object.\n *\n * @param {string} type The event type to listen for.\n * @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or\n * listener object to invoke.\n * @param {(EventListenerOptions|boolean)=} opt_options Ignored.\n * @override\n * @exportInterface\n */\nshaka.util.FakeEventTarget.prototype.addEventListener =\n function(type, listener, opt_options) {\n this.listeners_.push(type, listener);\n};\n\n\n/**\n * Remove an event listener from this object.\n *\n * @param {string} type The event type for which you wish to remove a listener.\n * @param {shaka.util.FakeEventTarget.ListenerType} listener The callback or\n * listener object to remove.\n * @param {(EventListenerOptions|boolean)=} opt_options Ignored.\n * @override\n * @exportInterface\n */\nshaka.util.FakeEventTarget.prototype.removeEventListener =\n function(type, listener, opt_options) {\n this.listeners_.remove(type, listener);\n};\n\n\n/**\n * Dispatch an event from this object.\n *\n * @param {!Event} event The event to be dispatched from this object.\n * @return {boolean} True if the default action was prevented.\n * @override\n * @exportInterface\n */\nshaka.util.FakeEventTarget.prototype.dispatchEvent = function(event) {\n // In many browsers, it is complex to overwrite properties of actual Events.\n // Here we expect only to dispatch FakeEvents, which are simpler.\n goog.asserts.assert(event instanceof shaka.util.FakeEvent,\n 'FakeEventTarget can only dispatch FakeEvents!');\n\n var list = this.listeners_.get(event.type) || [];\n\n for (var i = 0; i < list.length; ++i) {\n // Do this every time, since events can be re-dispatched from handlers.\n event.target = this.dispatchTarget;\n event.currentTarget = this.dispatchTarget;\n\n var listener = list[i];\n try {\n if (listener.handleEvent) {\n listener.handleEvent(event);\n } else {\n listener.call(this, event);\n }\n } catch (exception) {\n // Exceptions during event handlers should not affect the caller,\n // but should appear on the console as uncaught, according to MDN:\n // http://goo.gl/N6Ff27\n shaka.log.error('Uncaught exception in event handler', exception);\n }\n\n if (event.stopped) {\n break;\n }\n }\n\n return event.defaultPrevented;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/fake_event_target.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.cast.CastReceiver');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.cast.CastUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.IDestroyable');\n\n\n\n/**\n * A receiver to communicate between the Chromecast-hosted player and the\n * sender application.\n *\n * @constructor\n * @struct\n * @param {!HTMLMediaElement} video The local video element associated with the\n * local Player instance.\n * @param {!shaka.Player} player A local Player instance.\n * @param {function(Object)=} opt_appDataCallback A callback to handle\n * application-specific data passed from the sender.\n * @param {function(string):string=} opt_contentIdCallback A callback to\n * retrieve manifest URI from the provided content id.\n * @implements {shaka.util.IDestroyable}\n * @extends {shaka.util.FakeEventTarget}\n * @export\n */\nshaka.cast.CastReceiver =\n function(video, player, opt_appDataCallback, opt_contentIdCallback) {\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {shaka.Player} */\n this.player_ = player;\n\n /** @private {Object} */\n this.targets_ = {\n 'video': video,\n 'player': player\n };\n\n /** @private {?function(Object)} */\n this.appDataCallback_ = opt_appDataCallback || function() {};\n\n /** @private {?function(string):string} */\n this.opt_contentIdCallback_ = opt_contentIdCallback ||\n /** @param {string} contentId\n @return {string} */\n function(contentId) { return contentId; };\n\n /** @private {boolean} */\n this.isConnected_ = false;\n\n /** @private {boolean} */\n this.isIdle_ = true;\n\n /** @private {cast.receiver.CastMessageBus} */\n this.shakaBus_ = null;\n\n /** @private {cast.receiver.CastMessageBus} */\n this.genericBus_ = null;\n\n /** @private {?number} */\n this.pollTimerId_ = null;\n\n this.init_();\n};\ngoog.inherits(shaka.cast.CastReceiver, shaka.util.FakeEventTarget);\n\n\n/**\n * @return {boolean} True if the cast API is available and there are receivers.\n * @export\n */\nshaka.cast.CastReceiver.prototype.isConnected = function() {\n return this.isConnected_;\n};\n\n\n/**\n * @return {boolean} True if the receiver is not currently doing loading or\n * playing anything.\n * @export\n */\nshaka.cast.CastReceiver.prototype.isIdle = function() {\n return this.isIdle_;\n};\n\n\n/**\n * Destroys the underlying Player, then terminates the cast receiver app.\n *\n * @override\n * @export\n */\nshaka.cast.CastReceiver.prototype.destroy = function() {\n var p = this.player_ ? this.player_.destroy() : Promise.resolve();\n\n if (this.pollTimerId_ != null) {\n window.clearTimeout(this.pollTimerId_);\n }\n\n this.video_ = null;\n this.player_ = null;\n this.targets_ = null;\n this.appDataCallback_ = null;\n this.isConnected_ = false;\n this.isIdle_ = true;\n this.shakaBus_ = null;\n this.genericBus_ = null;\n this.pollTimerId_ = null;\n\n return p.then(function() {\n var manager = cast.receiver.CastReceiverManager.getInstance();\n manager.stop();\n });\n};\n\n\n/** @private */\nshaka.cast.CastReceiver.prototype.init_ = function() {\n var manager = cast.receiver.CastReceiverManager.getInstance();\n manager.onSenderConnected = this.onSendersChanged_.bind(this);\n manager.onSenderDisconnected = this.onSendersChanged_.bind(this);\n manager.onSystemVolumeChanged = this.fakeVolumeChangeEvent_.bind(this);\n\n this.genericBus_ = manager.getCastMessageBus(\n shaka.cast.CastUtils.GENERIC_MESSAGE_NAMESPACE);\n this.genericBus_.onMessage = this.onGenericMessage_.bind(this);\n\n this.shakaBus_ = manager.getCastMessageBus(\n shaka.cast.CastUtils.SHAKA_MESSAGE_NAMESPACE);\n this.shakaBus_.onMessage = this.onShakaMessage_.bind(this);\n\n if (!COMPILED) {\n // Sometimes it is useful to load the receiver app in Chrome to work on the\n // UI. To avoid log spam caused by the SDK trying to connect to web sockets\n // that don't exist, in uncompiled mode we check if the hosting browser is a\n // Chromecast before starting the receiver manager. We wouldn't do browser\n // detection except for debugging, so only do this in uncompiled mode.\n var isChromecast = navigator.userAgent.indexOf('CrKey') >= 0;\n if (isChromecast) {\n manager.start();\n }\n } else {\n manager.start();\n }\n\n shaka.cast.CastUtils.VideoEvents.forEach(function(name) {\n this.video_.addEventListener(name, this.proxyEvent_.bind(this, 'video'));\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerEvents.forEach(function(name) {\n this.player_.addEventListener(name, this.proxyEvent_.bind(this, 'player'));\n }.bind(this));\n\n // In our tests, the original Chromecast seems to have trouble decoding above\n // 1080p. It would be a waste to select a higher res anyway, given that the\n // device only outputs 1080p to begin with.\n\n // Chromecast has an extension to query the device/display's resolution.\n if (cast.__platform__ && cast.__platform__.canDisplayType(\n 'video/mp4; codecs=\"avc1.640028\"; width=3840; height=2160')) {\n // The device & display can both do 4k. Assume a 4k limit.\n this.player_.setMaxHardwareResolution(3840, 2160);\n } else {\n // Chromecast has always been able to do 1080p. Assume a 1080p limit.\n this.player_.setMaxHardwareResolution(1920, 1080);\n }\n\n // Maintain idle state.\n this.player_.addEventListener('loading', function() {\n // No longer idle once loading. This allows us to show the spinner during\n // the initial buffering phase.\n this.isIdle_ = false;\n this.onCastStatusChanged_();\n }.bind(this));\n this.video_.addEventListener('playing', function() {\n // No longer idle once playing. This allows us to replay a video without\n // reloading.\n this.isIdle_ = false;\n this.onCastStatusChanged_();\n }.bind(this));\n this.video_.addEventListener('pause', function() {\n this.onCastStatusChanged_();\n }.bind(this));\n this.player_.addEventListener('unloading', function() {\n // Go idle when unloading content.\n this.isIdle_ = true;\n this.onCastStatusChanged_();\n }.bind(this));\n this.video_.addEventListener('ended', function() {\n // Go idle 5 seconds after 'ended', assuming we haven't started again or\n // been destroyed.\n window.setTimeout(function() {\n if (this.video_ && this.video_.ended) {\n this.isIdle_ = true;\n this.onCastStatusChanged_();\n }\n }.bind(this), 5000);\n }.bind(this));\n\n // Do not start polling until after the sender's 'init' message is handled.\n};\n\n\n/** @private */\nshaka.cast.CastReceiver.prototype.onSendersChanged_ = function() {\n var manager = cast.receiver.CastReceiverManager.getInstance();\n this.isConnected_ = manager.getSenders().length != 0;\n this.onCastStatusChanged_();\n};\n\n\n/**\n * Dispatch an event to notify the receiver app that the status has changed.\n * @private\n */\nshaka.cast.CastReceiver.prototype.onCastStatusChanged_ = function() {\n // Do this asynchronously so that synchronous changes to idle state (such as\n // Player calling unload() as part of load()) are coalesced before the event\n // goes out.\n Promise.resolve().then(function() {\n var event = new shaka.util.FakeEvent('caststatuschanged');\n this.dispatchEvent(event);\n this.sendMediaStatus_(0);\n }.bind(this));\n};\n\n\n/**\n * Take on initial state from the sender.\n * @param {shaka.cast.CastUtils.InitStateType} initState\n * @param {Object} appData\n * @private\n */\nshaka.cast.CastReceiver.prototype.initState_ = function(initState, appData) {\n // Take on player state first.\n for (var k in initState['player']) {\n var v = initState['player'][k];\n // All player state vars are setters to be called.\n /** @type {Object} */(this.player_)[k](v);\n }\n\n // Now process custom app data, which may add additional player configs:\n this.appDataCallback_(appData);\n\n var manifestReady = Promise.resolve();\n var autoplay = this.video_.autoplay;\n\n // Now load the manifest, if present.\n if (initState['manifest']) {\n // Don't autoplay the content until we finish setting up initial state.\n this.video_.autoplay = false;\n manifestReady = this.player_.load(\n initState['manifest'], initState['startTime']);\n // Pass any errors through to the app.\n manifestReady.catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong error type!');\n var event = new shaka.util.FakeEvent('error', { 'detail': error });\n this.player_.dispatchEvent(event);\n }.bind(this));\n }\n\n // Finally, take on video state and player's \"after load\" state.\n manifestReady.then(function() {\n for (var k in initState['video']) {\n var v = initState['video'][k];\n this.video_[k] = v;\n }\n\n for (var k in initState['playerAfterLoad']) {\n var v = initState['playerAfterLoad'][k];\n // All player state vars are setters to be called.\n /** @type {Object} */(this.player_)[k](v);\n }\n\n // Restore original autoplay setting.\n this.video_.autoplay = autoplay;\n if (initState['manifest']) {\n // Resume playback with transferred state.\n this.video_.play();\n // Notify generic controllers of the state change.\n this.sendMediaStatus_(0);\n }\n }.bind(this));\n};\n\n\n/**\n * @param {string} targetName\n * @param {!Event} event\n * @private\n */\nshaka.cast.CastReceiver.prototype.proxyEvent_ = function(targetName, event) {\n // Poll and send an update right before we send the event. Some events\n // indicate an attribute change, so that change should be visible when the\n // event is handled.\n this.pollAttributes_();\n\n this.sendMessage_({\n 'type': 'event',\n 'targetName': targetName,\n 'event': event\n }, this.shakaBus_);\n};\n\n\n/** @private */\nshaka.cast.CastReceiver.prototype.pollAttributes_ = function() {\n // The poll timer may have been pre-empted by an event.\n // To avoid polling too often, we clear it here.\n if (this.pollTimerId_ != null) {\n window.clearTimeout(this.pollTimerId_);\n }\n // Since we know the timer has been cleared, start a new one now.\n // This will be preempted by events, including 'timeupdate'.\n this.pollTimerId_ = window.setTimeout(this.pollAttributes_.bind(this), 500);\n\n var update = {\n 'video': {},\n 'player': {}\n };\n\n shaka.cast.CastUtils.VideoAttributes.forEach(function(name) {\n update['video'][name] = this.video_[name];\n }.bind(this));\n\n shaka.cast.CastUtils.PlayerGetterMethods.forEach(function(name) {\n update['player'][name] = /** @type {Object} */(this.player_)[name]();\n }.bind(this));\n\n // Volume attributes are tied to the system volume.\n var manager = cast.receiver.CastReceiverManager.getInstance();\n var systemVolume = manager.getSystemVolume();\n if (systemVolume) {\n update['video']['volume'] = systemVolume.level;\n update['video']['muted'] = systemVolume.muted;\n }\n\n this.sendMessage_({\n 'type': 'update',\n 'update': update\n }, this.shakaBus_);\n};\n\n\n/**\n * Dispatch a fake 'volumechange' event to mimic the video element, since volume\n * changes are routed to the system volume on the receiver.\n * @private\n */\nshaka.cast.CastReceiver.prototype.fakeVolumeChangeEvent_ = function() {\n // Volume attributes are tied to the system volume.\n var manager = cast.receiver.CastReceiverManager.getInstance();\n var systemVolume = manager.getSystemVolume();\n goog.asserts.assert(systemVolume, 'System volume should not be null!');\n\n if (systemVolume) {\n // Send an update message with just the latest volume level and muted state.\n this.sendMessage_({\n 'type': 'update',\n 'update': {\n 'video': {\n 'volume': systemVolume.level,\n 'muted': systemVolume.muted\n }\n }\n }, this.shakaBus_);\n }\n\n // Send another message with a 'volumechange' event to update the sender's UI.\n this.sendMessage_({\n 'type': 'event',\n 'targetName': 'video',\n 'event': {'type': 'volumechange'}\n }, this.shakaBus_);\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages are\n * read with quoted properties.\n * @param {cast.receiver.CastMessageBus.Event} event\n * @private\n */\nshaka.cast.CastReceiver.prototype.onShakaMessage_ = function(event) {\n var message = shaka.cast.CastUtils.deserialize(event.data);\n shaka.log.debug('CastReceiver: message', message);\n\n switch (message['type']) {\n case 'init':\n this.initState_(message['initState'], message['appData']);\n // The sender is supposed to reflect the cast system volume after\n // connecting. Using fakeVolumeChangeEvent_() would create a race on the\n // sender side, since it would have volume properties, but no others.\n // This would lead to hasRemoteProperties() being true, even though a\n // complete set had never been sent.\n // Now that we have init state, this is a good time for the first update\n // message anyway.\n this.pollAttributes_();\n break;\n case 'appData':\n this.appDataCallback_(message['appData']);\n break;\n case 'set':\n var targetName = message['targetName'];\n var property = message['property'];\n var value = message['value'];\n\n if (targetName == 'video') {\n // Volume attributes must be rerouted to the system.\n var manager = cast.receiver.CastReceiverManager.getInstance();\n if (property == 'volume') {\n manager.setSystemVolumeLevel(value);\n break;\n } else if (property == 'muted') {\n manager.setSystemVolumeMuted(value);\n break;\n }\n }\n\n this.targets_[targetName][property] = value;\n break;\n case 'call':\n var targetName = message['targetName'];\n var methodName = message['methodName'];\n var args = message['args'];\n var target = this.targets_[targetName];\n target[methodName].apply(target, args);\n break;\n case 'asyncCall':\n var targetName = message['targetName'];\n var methodName = message['methodName'];\n var args = message['args'];\n var id = message['id'];\n var senderId = event.senderId;\n var target = this.targets_[targetName];\n var p = target[methodName].apply(target, args);\n // Replies must go back to the specific sender who initiated, so that we\n // don't have to deal with conflicting IDs between senders.\n p.then(this.sendAsyncComplete_.bind(this, senderId, id, /* error */ null),\n this.sendAsyncComplete_.bind(this, senderId, id));\n break;\n }\n};\n\n\n/**\n * @param {cast.receiver.CastMessageBus.Event} event\n * @private\n */\nshaka.cast.CastReceiver.prototype.onGenericMessage_ = function(event) {\n var message = shaka.cast.CastUtils.deserialize(event.data);\n shaka.log.debug('CastReceiver: message', message);\n // TODO(ismena): error message on duplicate request id from the same sender\n switch (message['type']) {\n case 'PLAY':\n this.video_.play();\n // Notify generic controllers that the player state changed.\n // requestId=0 (the parameter) means that the message was not\n // triggered by a GET_STATUS request.\n this.sendMediaStatus_(0);\n break;\n case 'PAUSE':\n this.video_.pause();\n this.sendMediaStatus_(0);\n break;\n case 'SEEK':\n var currentTime = message['currentTime'];\n var resumeState = message['resumeState'];\n if (currentTime != null)\n this.video_.currentTime = Number(currentTime);\n if (resumeState && resumeState == 'PLAYBACK_START') {\n this.video_.play();\n this.sendMediaStatus_(0);\n } else if (resumeState && resumeState == 'PLAYBACK_PAUSE') {\n this.video_.pause();\n this.sendMediaStatus_(0);\n }\n break;\n case 'STOP':\n this.player_.unload().then(function() {\n this.sendMediaStatus_(0);\n }.bind(this));\n break;\n case 'GET_STATUS':\n // TODO(ismena): According to the SDK this is supposed to be a\n // unicast message to the sender that requested the status,\n // but it doesn't appear to be working.\n // Look into what's going on there and change this to be a\n // unicast.\n this.sendMediaStatus_(Number(message['requestId']));\n break;\n case 'VOLUME':\n var volumeObject = message['volume'];\n var level = volumeObject['level'];\n var muted = volumeObject['muted'];\n var oldVolumeLevel = this.video_.volume;\n var oldVolumeMuted = this.video_.muted;\n if (level != null)\n this.video_.volume = Number(level);\n if (muted != null)\n this.video_.muted = muted;\n // Notify generic controllers if the volume changed.\n if (oldVolumeLevel != this.video_.volume ||\n oldVolumeMuted != this.video_.muted) {\n this.sendMediaStatus_(0);\n }\n break;\n case 'LOAD':\n var mediaInfo = message['media'];\n var contentId = mediaInfo['contentId'];\n var currentTime = message['currentTime'];\n var manifestUri = this.opt_contentIdCallback_(contentId);\n var autoplay = message['autoplay'] || true;\n if (autoplay)\n this.video_.autoplay = true;\n this.player_.load(manifestUri, currentTime).then(function() {\n // Notify generic controllers that the media has changed.\n var media = {\n 'contentId': manifestUri,\n 'streamType': this.player_.isLive() ? 'LIVE' : 'BUFFERED',\n // TODO: Is there a use case when this would be required?\n // Sending an empty string for now since it's a mandatory\n // field.\n 'contentType': ''\n };\n this.sendMediaStatus_(0, media);\n }.bind(this)).catch(function(error) {\n // Load failed. Dispatch the error message to the sender.\n var type = 'LOAD_FAILED';\n if (error.category == shaka.util.Error.Category.PLAYER &&\n error.code == shaka.util.Error.Code.LOAD_INTERRUPTED) {\n type = 'LOAD_CANCELLED';\n }\n\n this.sendMessage_({\n 'requestId': Number(message['requestId']),\n 'type': type\n }, this.genericBus_);\n }.bind(this));\n break;\n default:\n shaka.log.warning(\n 'Unrecognized message type from the generic Chromecast controller!',\n message['type']);\n // Dispatch an error to the sender.\n this.sendMessage_({\n 'requestId': Number(message['requestId']),\n 'type': 'INVALID_REQUEST',\n 'reason': 'INVALID_COMMAND'\n }, this.genericBus_);\n break;\n }\n};\n\n\n/**\n * Tell the sender that the async operation is complete.\n * @param {string} senderId\n * @param {string} id\n * @param {shaka.util.Error} error\n * @private\n */\nshaka.cast.CastReceiver.prototype.sendAsyncComplete_ =\n function(senderId, id, error) {\n this.sendMessage_({\n 'type': 'asyncComplete',\n 'id': id,\n 'error': error\n }, this.shakaBus_, senderId);\n};\n\n\n/**\n * Since this method is in the compiled library, make sure all messages passed\n * in here were created with quoted property names.\n * @param {!Object} message\n * @param {cast.receiver.CastMessageBus} bus\n * @param {string=} opt_senderId\n * @private\n */\nshaka.cast.CastReceiver.prototype.sendMessage_ =\n function(message, bus, opt_senderId) {\n // Cuts log spam when debugging the receiver UI in Chrome.\n if (!this.isConnected_) return;\n\n var serialized = shaka.cast.CastUtils.serialize(message);\n if (opt_senderId) {\n bus.getCastChannel(opt_senderId).send(serialized);\n } else {\n bus.broadcast(serialized);\n }\n};\n\n\n/**\n * @return {string}\n * @private\n */\nshaka.cast.CastReceiver.prototype.getPlayState_ = function() {\n var playState = shaka.cast.CastReceiver.PLAY_STATE;\n if (this.isIdle_)\n return playState.IDLE;\n else if (this.player_.isBuffering())\n return playState.BUFFERING;\n else if (this.video_.paused)\n return playState.PAUSED;\n else\n return playState.PLAYING;\n};\n\n\n/**\n * @param {number} requestId\n * @param {Object=} opt_media\n * @private\n */\nshaka.cast.CastReceiver.prototype.sendMediaStatus_ =\n function(requestId, opt_media) {\n var mediaStatus = {\n // mediaSessionId is a unique ID for the playback of this specific session.\n // It's used to identify a specific instance of a playback.\n // We don't support multiple playbacks, so just return 0.\n 'mediaSessionId': 0,\n 'playbackRate': this.video_.playbackRate,\n 'playerState': this.getPlayState_(),\n 'currentTime': this.video_.currentTime,\n // supportedMediaCommands is a sum of all the flags of commands that the\n // player supports.\n // The list of comands with respective flags is:\n // 1 - Pause\n // 2 - Seek\n // 4 - Stream volume\n // 8 - Stream mute\n // 16 - Skip forward\n // 32 - Skip backward\n // We support pause, seek, volume and mute which gives a value of\n // 1+2+4+8=15\n 'supportedMediaCommands': 15,\n 'volume': {\n 'level': this.video_.volume,\n 'muted': this.video_.muted\n }\n };\n\n if (opt_media)\n mediaStatus['media'] = opt_media;\n\n var ret = {\n 'requestId': requestId,\n 'type': 'MEDIA_STATUS',\n 'status': [mediaStatus]\n };\n\n this.sendMessage_(ret, this.genericBus_);\n};\n\n\n/**\n * @enum {string}\n */\nshaka.cast.CastReceiver.PLAY_STATE = {\n IDLE: 'IDLE',\n PLAYING: 'PLAYING',\n BUFFERING: 'BUFFERING',\n PAUSED: 'PAUSED'\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/cast/cast_receiver.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.Player');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.abr.EwmaBandwidthEstimator');\ngoog.require('shaka.abr.SimpleAbrManager');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.MediaSourceEngine');\ngoog.require('shaka.media.Playhead');\ngoog.require('shaka.media.PlayheadObserver');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.media.StreamingEngine');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.CancelableChain');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * Construct a Player.\n *\n * @param {!HTMLMediaElement} video Any existing TextTracks attached to this\n * element that were not created by Shaka will be disabled. A new TextTrack\n * may be created to display captions or subtitles.\n * @param {function(shaka.Player)=} opt_dependencyInjector Optional callback\n * which is called to inject mocks into the Player. Used for testing.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n * @extends {shaka.util.FakeEventTarget}\n * @export\n */\nshaka.Player = function(video, opt_dependencyInjector) {\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {boolean} */\n this.destroyed_ = false;\n\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {TextTrack} */\n this.textTrack_ = null;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {shakaExtern.AbrManager} */\n this.defaultAbrManager_ = new shaka.abr.SimpleAbrManager();\n\n /** @private {shaka.net.NetworkingEngine} */\n this.networkingEngine_ = null;\n\n /** @private {shaka.media.DrmEngine} */\n this.drmEngine_ = null;\n\n /** @private {MediaSource} */\n this.mediaSource_ = null;\n\n /** @private {shaka.media.MediaSourceEngine} */\n this.mediaSourceEngine_ = null;\n\n /** @private {Promise} */\n this.mediaSourceOpen_ = null;\n\n /** @private {shaka.media.Playhead} */\n this.playhead_ = null;\n\n /** @private {shaka.media.PlayheadObserver} */\n this.playheadObserver_ = null;\n\n /** @private {shaka.media.StreamingEngine} */\n this.streamingEngine_ = null;\n\n /** @private {shakaExtern.ManifestParser} */\n this.parser_ = null;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = null;\n\n /** @private {?string} */\n this.manifestUri_ = null;\n\n /**\n * Contains an ID for use with creating streams. The manifest parser should\n * start with small IDs, so this starts with a large one.\n * @private {number}\n */\n this.nextExternalStreamId_ = 1e9;\n\n /** @private {!Array.<number>} */\n this.loadingTextStreamIds_ = [];\n\n /** @private {boolean} */\n this.buffering_ = false;\n\n /** @private {boolean} */\n this.switchingPeriods_ = true;\n\n /** @private {shaka.util.CancelableChain} */\n this.loadChain_ = null;\n\n /** @private {Promise} */\n this.unloadChain_ = null;\n\n /**\n * @private {!Object.<shaka.util.ManifestParserUtils.ContentType, {\n * stream: shakaExtern.Stream,\n * clearBuffer: boolean\n * }>}\n */\n this.deferredSwitches_ = {};\n\n /** @private {!Array.<shakaExtern.TimelineRegionInfo>} */\n this.pendingTimelineRegions_ = [];\n\n /**\n * A map of Period number to a map of content type to stream id.\n * @private {!Object.<number, !Object.<string, number>>}\n */\n this.activeStreamsByPeriod_ = {};\n\n /** @private {?shakaExtern.PlayerConfiguration} */\n this.config_ = this.defaultConfig_();\n\n /** @private {{width: number, height: number}} */\n this.maxHwRes_ = { width: Infinity, height: Infinity };\n\n /** @private {shakaExtern.Stats} */\n this.stats_ = this.getCleanStats_();\n\n /** @private {number} */\n this.lastTimeStatsUpdateTimestamp_ = 0;\n\n /** @private {string} */\n this.currentAudioLanguage_ = this.config_.preferredAudioLanguage;\n\n /** @private {string} */\n this.currentTextLanguage_ = this.config_.preferredTextLanguage;\n\n /** @private {string} */\n this.currentVariantRole_ = '';\n\n /** @private {string} */\n this.currentTextRole_ = '';\n\n if (opt_dependencyInjector)\n opt_dependencyInjector(this);\n\n this.networkingEngine_ = this.createNetworkingEngine();\n this.initialize_();\n};\ngoog.inherits(shaka.Player, shaka.util.FakeEventTarget);\n\n\n/**\n * After destruction, a Player object cannot be used again.\n *\n * @override\n * @export\n */\nshaka.Player.prototype.destroy = function() {\n this.destroyed_ = true;\n\n var cancelation = Promise.resolve();\n if (this.loadChain_) {\n // A load is in progress. Cancel it.\n cancelation = this.loadChain_.cancel(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.PLAYER,\n shaka.util.Error.Code.LOAD_INTERRUPTED));\n }\n\n return cancelation.then(function() {\n var p = Promise.all([\n // We need to destroy the current fields as well as waiting for an\n // existing unload to complete. It is fine to call destroyStreaming_ if\n // there is an unload since it resets the fields immediately.\n this.unloadChain_,\n this.destroyStreaming_(),\n this.eventManager_ ? this.eventManager_.destroy() : null,\n this.networkingEngine_ ? this.networkingEngine_.destroy() : null\n ]);\n\n this.video_ = null;\n this.textTrack_ = null;\n this.eventManager_ = null;\n this.defaultAbrManager_ = null;\n this.networkingEngine_ = null;\n this.config_ = null;\n\n return p;\n }.bind(this));\n};\n\n\n/**\n * @define {string} A version number taken from git at compile time.\n */\ngoog.define('GIT_VERSION', 'v2.1.4-debug');\n\n\n/**\n * @const {string}\n * @export\n */\nshaka.Player.version = GIT_VERSION;\n\n\n/**\n * @event shaka.Player.ErrorEvent\n * @description Fired when a playback error occurs.\n * @property {string} type\n * 'error'\n * @property {!shaka.util.Error} detail\n * An object which contains details on the error. The error's 'category' and\n * 'code' properties will identify the specific error that occured. In an\n * uncompiled build, you can also use the 'message' and 'stack' properties\n * to debug.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.EmsgEvent\n * @description Fired when a non-typical emsg is found in a segment.\n * @property {string} type\n * 'emsg'\n * @property {shakaExtern.EmsgInfo} detail\n * An object which contains the content of the emsg box.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TimelineRegionAdded\n * @description Fired when a media timeline region is added.\n * @property {string} type\n * 'timelineregionadded'\n * @property {shakaExtern.TimelineRegionInfo} detail\n * An object which contains a description of the region.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TimelineRegionEnter\n * @description Fired when the playhead enters a timeline region.\n * @property {string} type\n * 'timelineregionenter'\n * @property {shakaExtern.TimelineRegionInfo} detail\n * An object which contains a description of the region.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TimelineRegionExit\n * @description Fired when the playhead exits a timeline region.\n * @property {string} type\n * 'timelineregionexit'\n * @property {shakaExtern.TimelineregionInfo} detail\n * An object which contains a description of the region.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.BufferingEvent\n * @description Fired when the player's buffering state changes.\n * @property {string} type\n * 'buffering'\n * @property {boolean} buffering\n * True when the Player enters the buffering state.\n * False when the Player leaves the buffering state.\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.LoadingEvent\n * @description Fired when the player begins loading.\n * Used by the Cast receiver to determine idle state.\n * @property {string} type\n * 'loading'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.UnloadingEvent\n * @description Fired when the player unloads or fails to load.\n * Used by the Cast receiver to determine idle state.\n * @property {string} type\n * 'unloading'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TextTrackVisibilityEvent\n * @description Fired when text track visibility changes.\n * @property {string} type\n * 'texttrackvisibility'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.TracksChangedEvent\n * @description Fired when the list of tracks changes. For example, this will\n * happen when changing periods or when track restrictions change.\n * @property {string} type\n * 'trackschanged'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.AdaptationEvent\n * @description Fired when an automatic adaptation causes the active tracks\n * to change. Does not fire when the application calls selectVariantTrack()\n * selectTextTrack(), selectAudioLanguage() or selectTextLanguage().\n * @property {string} type\n * 'adaptation'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.ExpirationUpdatedEvent\n * @description Fired when there is a change in the expiration times of an\n * EME session.\n * @property {string} type\n * 'expirationupdated'\n * @exportDoc\n */\n\n\n/**\n * @event shaka.Player.LargeGapEvent\n * @description Fired when the playhead enters a large gap. If\n * |config.streaming.jumpLargeGaps| is set, the default action of this event\n * is to jump the gap; this can be prevented by calling preventDefault() on\n * the event object.\n * @property {string} type\n * 'largegap'\n * @property {number} currentTime\n * The current time of the playhead.\n * @property {number} gapSize\n * The size of the gap, in seconds.\n * @exportDoc\n */\n\n\n/** @private {!Object.<string, function():*>} */\nshaka.Player.supportPlugins_ = {};\n\n\n/**\n * Registers a plugin callback that will be called with support(). The\n * callback will return the value that will be stored in the return value from\n * support().\n *\n * @param {string} name\n * @param {function():*} callback\n * @export\n */\nshaka.Player.registerSupportPlugin = function(name, callback) {\n shaka.Player.supportPlugins_[name] = callback;\n};\n\n\n/**\n * Return whether the browser provides basic support. If this returns false,\n * Shaka Player cannot be used at all. In this case, do not construct a Player\n * instance and do not use the library.\n *\n * @return {boolean}\n * @export\n */\nshaka.Player.isBrowserSupported = function() {\n // Basic features needed for the library to be usable.\n var basic = !!window.Promise && !!window.Uint8Array &&\n !!Array.prototype.forEach;\n\n return basic &&\n shaka.media.MediaSourceEngine.isBrowserSupported() &&\n shaka.media.DrmEngine.isBrowserSupported();\n};\n\n\n/**\n * Probes the browser to determine what features are supported. This makes a\n * number of requests to EME/MSE/etc which may result in user prompts. This\n * should only be used for diagnostics.\n *\n * NOTE: This may show a request to the user for permission.\n *\n * @see https://goo.gl/ovYLvl\n * @return {!Promise.<shakaExtern.SupportType>}\n * @export\n */\nshaka.Player.probeSupport = function() {\n goog.asserts.assert(shaka.Player.isBrowserSupported(),\n 'Must have basic support');\n return shaka.media.DrmEngine.probeSupport().then(function(drm) {\n var manifest = shaka.media.ManifestParser.probeSupport();\n var media = shaka.media.MediaSourceEngine.probeSupport();\n var ret = {\n manifest: manifest,\n media: media,\n drm: drm\n };\n\n var plugins = shaka.Player.supportPlugins_;\n for (var name in plugins) {\n ret[name] = plugins[name]();\n }\n\n return ret;\n });\n};\n\n\n/**\n * Load a manifest.\n *\n * @param {string} manifestUri\n * @param {number=} opt_startTime Optional start time, in seconds, to begin\n * playback. Defaults to 0 for VOD and to the live edge for live.\n * @param {shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * Optional manifest parser factory to override auto-detection or use an\n * unregistered parser.\n * @return {!Promise} Resolved when the manifest has been loaded and playback\n * has begun; rejected when an error occurs or the call was interrupted by\n * destroy(), unload() or another call to load().\n * @export\n */\nshaka.Player.prototype.load = function(manifestUri, opt_startTime,\n opt_manifestParserFactory) {\n var unloadPromise = this.unload();\n var loadChain = new shaka.util.CancelableChain();\n this.loadChain_ = loadChain;\n this.dispatchEvent(new shaka.util.FakeEvent('loading'));\n\n var startTime = Date.now();\n\n return loadChain.then(function() {\n return unloadPromise;\n }).then(function() {\n // Not tracked in stats because it should be insignificant.\n // Logged in case it is not.\n shaka.log.debug('Unload latency:', (Date.now() - startTime) / 1000);\n\n this.stats_ = this.getCleanStats_();\n\n this.eventManager_.listen(this.video_, 'playing',\n this.updateState_.bind(this));\n this.eventManager_.listen(this.video_, 'pause',\n this.updateState_.bind(this));\n this.eventManager_.listen(this.video_, 'ended',\n this.updateState_.bind(this));\n\n goog.asserts.assert(this.networkingEngine_, 'Must not be destroyed');\n return shaka.media.ManifestParser.getFactory(\n manifestUri,\n this.networkingEngine_,\n this.config_.manifest.retryParameters,\n opt_manifestParserFactory);\n }.bind(this)).then(function(factory) {\n\n this.parser_ = new factory();\n this.parser_.configure(this.config_.manifest);\n goog.asserts.assert(this.networkingEngine_, 'Must not be destroyed');\n var playerInterface = {\n networkingEngine: this.networkingEngine_,\n filterPeriod: this.filterPeriod_.bind(this),\n onTimelineRegionAdded: this.onTimelineRegionAdded_.bind(this),\n onEvent: this.onEvent_.bind(this),\n onError: this.onError_.bind(this)\n };\n\n if (this.parser_.start.length > 2) {\n goog.asserts.assert(false, 'Old ManifestParser interface is deprecated');\n shaka.log.warning(\n 'The ManifestParser interface has changed. Please upgrade your ' +\n 'plugin to accept the PlayerInterface structure. See the ' +\n 'ManifestParser documentation for details.');\n // Use a string index here so the compiler doesn't complain about the\n // incorrect arguments.\n return this.parser_['start'](\n manifestUri, this.networkingEngine_, playerInterface.filterPeriod,\n playerInterface.onError, playerInterface.onEvent);\n }\n\n return this.parser_.start(manifestUri, playerInterface);\n }.bind(this)).then(function(manifest) {\n\n if (manifest.periods.length == 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.NO_PERIODS);\n }\n\n this.manifest_ = manifest;\n this.manifestUri_ = manifestUri;\n this.drmEngine_ = this.createDrmEngine();\n this.drmEngine_.configure(this.config_.drm);\n return this.drmEngine_.init(manifest, false /* isOffline */);\n }.bind(this)).then(function() {\n\n // Re-filter the manifest after DRM has been initialized.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n\n this.lastTimeStatsUpdateTimestamp_ = Date.now() / 1000;\n\n // Copy preferred languages from the config again, in case the config was\n // changed between construction and playback.\n this.currentAudioLanguage_ = this.config_.preferredAudioLanguage;\n this.currentTextLanguage_ = this.config_.preferredTextLanguage;\n\n // Wait for MediaSource to open before continuing.\n return Promise.all([\n this.drmEngine_.attach(this.video_),\n this.mediaSourceOpen_\n ]);\n }.bind(this)).then(function() {\n this.config_.abr.manager.init(this.switch_.bind(this));\n\n // MediaSource is open, so create the Playhead, MediaSourceEngine, and\n // StreamingEngine.\n this.playhead_ = this.createPlayhead(opt_startTime);\n this.playheadObserver_ = this.createPlayheadObserver();\n this.mediaSourceEngine_ = this.createMediaSourceEngine();\n\n this.streamingEngine_ = this.createStreamingEngine();\n this.streamingEngine_.configure(this.config_.streaming);\n\n // If the content is multi-codec and the browser can play more than one of\n // them, choose codecs now before we initialize streaming.\n this.chooseCodecsAndFilterManifest_();\n\n return this.streamingEngine_.init();\n }.bind(this)).then(function() {\n if (this.config_.streaming.startAtSegmentBoundary) {\n var time = this.adjustStartTime_(this.playhead_.getTime());\n this.playhead_.setStartTime(time);\n }\n\n // Re-filter the manifest after streams have been chosen.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n // Dispatch a 'trackschanged' event now that all initial filtering is done.\n this.onTracksChanged_();\n // Since the first streams just became active, send an adaptation event.\n this.onAdaptation_();\n\n // Now that we've filtered out variants that aren't compatible with the\n // active one, update abr manager with filtered variants for the current\n // period.\n var currentPeriod = this.streamingEngine_.getCurrentPeriod();\n var variants = shaka.util.StreamUtils.filterVariantsByRoleAndLanguage(\n currentPeriod, this.currentAudioLanguage_);\n this.config_.abr.manager.setVariants(variants);\n\n var hasPrimary = currentPeriod.variants.some(function(variant) {\n return variant.primary;\n });\n if (!this.currentAudioLanguage_ && !hasPrimary) {\n shaka.log.warning('No preferred audio language set. We will choose an ' +\n 'arbitrary language initially');\n }\n\n this.pendingTimelineRegions_.forEach(\n this.playheadObserver_.addTimelineRegion.bind(this.playheadObserver_));\n this.pendingTimelineRegions_ = [];\n\n // Wait for the 'loadeddata' event to measure load() latency.\n this.eventManager_.listenOnce(this.video_, 'loadeddata', function() {\n // Compute latency in seconds (Date.now() gives ms):\n var latency = (Date.now() - startTime) / 1000;\n this.stats_.loadLatency = latency;\n shaka.log.debug('Load latency:', latency);\n }.bind(this));\n\n this.loadChain_ = null;\n }.bind(this)).finalize().catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Wrong error type!');\n shaka.log.debug('load() failed:', error);\n\n // If we haven't started another load, clear the loadChain_ member.\n if (this.loadChain_ == loadChain) {\n this.loadChain_ = null;\n this.dispatchEvent(new shaka.util.FakeEvent('unloading'));\n }\n return Promise.reject(error);\n }.bind(this));\n};\n\n\n/**\n * In case of multiple usable codecs, choose one based on lowest average\n * bandwidth and filter out the rest.\n * @private\n */\nshaka.Player.prototype.chooseCodecsAndFilterManifest_ = function() {\n function variantCodecs(variant) {\n // Only consider the base of the codec string. For example, these should\n // both be considered the same codec: avc1.42c01e, avc1.4d401f\n var baseVideoCodec =\n variant.video ? variant.video.codecs.split('.')[0] : '';\n var baseAudioCodec =\n variant.audio ? variant.audio.codecs.split('.')[0] : '';\n return baseVideoCodec + '-' + baseAudioCodec;\n }\n\n // Organize variants into buckets by codecs.\n var variantsByCodecs = {};\n this.manifest_.periods.forEach(function(period) {\n period.variants.forEach(function(variant) {\n var codecs = variantCodecs(variant);\n if (!(codecs in variantsByCodecs)) {\n variantsByCodecs[codecs] = [];\n }\n variantsByCodecs[codecs].push(variant);\n });\n });\n\n // Compute the average bandwidth for each group of variants.\n // Choose the lowest-bandwidth codecs.\n var bestCodecs = null;\n var lowestAverageBandwidth = Infinity;\n shaka.util.MapUtils.forEach(variantsByCodecs, function(codecs, variants) {\n var sum = 0;\n var num = 0;\n variants.forEach(function(variant) {\n sum += variant.bandwidth;\n ++num;\n });\n var averageBandwidth = sum / num;\n shaka.log.debug('codecs', codecs, 'avg bandwidth', averageBandwidth);\n\n if (averageBandwidth < lowestAverageBandwidth) {\n bestCodecs = codecs;\n lowestAverageBandwidth = averageBandwidth;\n }\n });\n goog.asserts.assert(bestCodecs != null, 'Should have chosen codecs!');\n goog.asserts.assert(!isNaN(lowestAverageBandwidth),\n 'Bandwidth should be a number!');\n\n // Filter out any variants that don't match, forcing AbrManager to choose from\n // the most efficient variants possible.\n this.manifest_.periods.forEach(function(period) {\n period.variants = period.variants.filter(function(variant) {\n var codecs = variantCodecs(variant);\n if (codecs == bestCodecs) return true;\n\n shaka.log.debug('Dropping Variant (better codec available)', variant);\n return false;\n });\n });\n};\n\n\n/**\n * Creates a new instance of DrmEngine. This can be replaced by tests to\n * create fake instances instead.\n *\n * @return {!shaka.media.DrmEngine}\n */\nshaka.Player.prototype.createDrmEngine = function() {\n goog.asserts.assert(this.networkingEngine_, 'Must not be destroyed');\n return new shaka.media.DrmEngine(\n this.networkingEngine_,\n this.onError_.bind(this),\n this.onKeyStatus_.bind(this),\n this.onExpirationUpdated_.bind(this));\n};\n\n\n/**\n * Creates a new instance of NetworkingEngine. This can be replaced by tests\n * to create fake instances instead.\n *\n * @return {!shaka.net.NetworkingEngine}\n */\nshaka.Player.prototype.createNetworkingEngine = function() {\n return new shaka.net.NetworkingEngine(this.onSegmentDownloaded_.bind(this));\n};\n\n\n/**\n * Creates a new instance of Playhead. This can be replaced by tests to create\n * fake instances instead.\n *\n * @param {number=} opt_startTime\n * @return {!shaka.media.Playhead}\n */\nshaka.Player.prototype.createPlayhead = function(opt_startTime) {\n goog.asserts.assert(this.manifest_, 'Must have manifest');\n return new shaka.media.Playhead(\n this.video_, this.manifest_, this.config_.streaming,\n opt_startTime || null, this.onSeek_.bind(this), this.onEvent_.bind(this));\n};\n\n\n/**\n * Creates a new instance of PlayheadOvserver. This can be replaced by tests to\n * create fake instances instead.\n *\n * @return {!shaka.media.PlayheadObserver}\n */\nshaka.Player.prototype.createPlayheadObserver = function() {\n goog.asserts.assert(this.manifest_, 'Must have manifest');\n return new shaka.media.PlayheadObserver(\n this.video_, this.manifest_, this.config_.streaming,\n this.onBuffering_.bind(this), this.onEvent_.bind(this),\n this.onChangePeriod_.bind(this));\n};\n\n\n/**\n * Create and open MediaSource. Potentially slow.\n *\n * @return {!Promise}\n */\nshaka.Player.prototype.createMediaSource = function() {\n this.mediaSource_ = new MediaSource();\n var ret = new shaka.util.PublicPromise();\n this.eventManager_.listen(this.mediaSource_, 'sourceopen', ret.resolve);\n this.video_.src = window.URL.createObjectURL(this.mediaSource_);\n return ret;\n};\n\n\n/**\n * Creates a new instance of MediaSourceEngine. This can be replaced by tests\n * to create fake instances instead.\n *\n * @return {!shaka.media.MediaSourceEngine}\n */\nshaka.Player.prototype.createMediaSourceEngine = function() {\n return new shaka.media.MediaSourceEngine(\n this.video_, this.mediaSource_, this.textTrack_);\n};\n\n\n/**\n * Creates a new instance of StreamingEngine. This can be replaced by tests\n * to create fake instances instead.\n *\n * @return {!shaka.media.StreamingEngine}\n */\nshaka.Player.prototype.createStreamingEngine = function() {\n goog.asserts.assert(\n this.playhead_ && this.playheadObserver_ && this.mediaSourceEngine_ &&\n this.manifest_,\n 'Must not be destroyed');\n\n var playerInterface = {\n playhead: this.playhead_,\n mediaSourceEngine: this.mediaSourceEngine_,\n netEngine: this.networkingEngine_,\n onChooseStreams: this.onChooseStreams_.bind(this),\n onCanSwitch: this.canSwitch_.bind(this),\n onError: this.onError_.bind(this),\n onEvent: this.onEvent_.bind(this),\n onManifestUpdate: this.onManifestUpdate_.bind(this),\n onSegmentAppended: this.onSegmentAppended_.bind(this)\n };\n return new shaka.media.StreamingEngine(this.manifest_, playerInterface);\n};\n\n\n/**\n * Configure the Player instance.\n *\n * The config object passed in need not be complete. It will be merged with\n * the existing Player configuration.\n *\n * Config keys and types will be checked. If any problems with the config\n * object are found, errors will be reported through logs.\n *\n * @param {!Object} config This should follow the form of\n * {@link shakaExtern.PlayerConfiguration}, but you may omit any field you do\n * not wish to change.\n * @export\n */\nshaka.Player.prototype.configure = function(config) {\n goog.asserts.assert(this.config_, 'Config must not be null!');\n\n if (config.abr && config.abr.manager &&\n config.abr.manager != this.config_.abr.manager) {\n this.config_.abr.manager.stop();\n config.abr.manager.init(this.switch_.bind(this));\n }\n\n shaka.util.ConfigUtils.mergeConfigObjects(\n this.config_, config, this.defaultConfig_(), this.configOverrides_(), '');\n\n this.applyConfig_();\n};\n\n\n/**\n * Apply config changes.\n * @private\n */\nshaka.Player.prototype.applyConfig_ = function() {\n if (this.parser_) {\n this.parser_.configure(this.config_.manifest);\n }\n if (this.drmEngine_) {\n this.drmEngine_.configure(this.config_.drm);\n }\n if (this.streamingEngine_) {\n this.streamingEngine_.configure(this.config_.streaming);\n\n // Need to apply the restrictions to every period.\n try {\n // this.filterPeriod_() may throw.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n } catch (error) {\n this.onError_(error);\n }\n\n // May need to choose new streams.\n shaka.log.debug('Choosing new streams after changing configuration');\n var period = this.streamingEngine_.getCurrentPeriod();\n this.chooseStreamsAndSwitch_(period);\n }\n\n // Simply enable/disable ABR with each call, since multiple calls to these\n // methods have no effect.\n if (this.config_.abr.enabled && !this.switchingPeriods_) {\n this.config_.abr.manager.enable();\n } else {\n this.config_.abr.manager.disable();\n }\n\n this.config_.abr.manager.setDefaultEstimate(\n this.config_.abr.defaultBandwidthEstimate);\n this.config_.abr.manager.setRestrictions(this.config_.abr.restrictions);\n};\n\n\n/**\n * Return a copy of the current configuration. Modifications of the returned\n * value will not affect the Player's active configuration. You must call\n * player.configure() to make changes.\n *\n * @return {shakaExtern.PlayerConfiguration}\n * @export\n */\nshaka.Player.prototype.getConfiguration = function() {\n goog.asserts.assert(this.config_, 'Config must not be null!');\n\n var ret = this.defaultConfig_();\n shaka.util.ConfigUtils.mergeConfigObjects(\n ret, this.config_, this.defaultConfig_(), this.configOverrides_(), '');\n return ret;\n};\n\n\n/**\n * Reset configuration to default.\n * @export\n */\nshaka.Player.prototype.resetConfiguration = function() {\n var config = this.defaultConfig_();\n\n if (config.abr && config.abr.manager &&\n config.abr.manager != this.config_.abr.manager) {\n this.config_.abr.manager.stop();\n config.abr.manager.init(this.switch_.bind(this));\n }\n\n // Don't call mergeConfigObjects_(), since that would not reset open-ended\n // dictionaries like drm.servers.\n this.config_ = this.defaultConfig_();\n\n this.applyConfig_();\n};\n\n\n/**\n * @return {HTMLMediaElement} A reference to the HTML Media Element passed\n * in during initialization.\n * @export\n */\nshaka.Player.prototype.getMediaElement = function() {\n return this.video_;\n};\n\n\n/**\n * @return {shaka.net.NetworkingEngine} A reference to the Player's networking\n * engine. Applications may use this to make requests through Shaka's\n * networking plugins.\n * @export\n */\nshaka.Player.prototype.getNetworkingEngine = function() {\n return this.networkingEngine_;\n};\n\n\n/**\n * @return {?string} If a manifest is loaded, returns the manifest URI given in\n * the last call to load(). Otherwise, returns null.\n * @export\n */\nshaka.Player.prototype.getManifestUri = function() {\n return this.manifestUri_;\n};\n\n\n/**\n * @return {boolean} True if the current stream is live. False otherwise.\n * @export\n */\nshaka.Player.prototype.isLive = function() {\n return this.manifest_ ?\n this.manifest_.presentationTimeline.isLive() :\n false;\n};\n\n\n/**\n * @return {boolean} True if the current stream is in-progress VOD.\n * False otherwise.\n * @export\n */\nshaka.Player.prototype.isInProgress = function() {\n return this.manifest_ ?\n this.manifest_.presentationTimeline.isInProgress() :\n false;\n};\n\n\n/**\n * Get the seekable range for the current stream.\n * @return {{start: number, end: number}}\n * @export\n */\nshaka.Player.prototype.seekRange = function() {\n var start = 0;\n var end = 0;\n if (this.manifest_) {\n var timeline = this.manifest_.presentationTimeline;\n start = timeline.getSegmentAvailabilityStart();\n end = timeline.getSeekRangeEnd();\n }\n return {'start': start, 'end': end};\n};\n\n\n/**\n * Get the key system currently being used by EME. This returns the empty\n * string if not using EME.\n *\n * @return {string}\n * @export\n */\nshaka.Player.prototype.keySystem = function() {\n return this.drmEngine_ ? this.drmEngine_.keySystem() : '';\n};\n\n\n/**\n * Get the DrmInfo used to initialize EME. This returns null when not using\n * EME.\n *\n * @return {?shakaExtern.DrmInfo}\n * @export\n */\nshaka.Player.prototype.drmInfo = function() {\n return this.drmEngine_ ? this.drmEngine_.getDrmInfo() : null;\n};\n\n\n/**\n * The next known expiration time for any EME session. If the sessions never\n * expire, or there are no EME sessions, this returns Infinity.\n *\n * @return {number}\n * @export\n */\nshaka.Player.prototype.getExpiration = function() {\n return this.drmEngine_ ? this.drmEngine_.getExpiration() : Infinity;\n};\n\n\n/**\n * @return {boolean} True if the Player is in a buffering state.\n * @export\n */\nshaka.Player.prototype.isBuffering = function() {\n return this.buffering_;\n};\n\n\n/**\n * Unload the current manifest and make the Player available for re-use.\n *\n * @return {!Promise} Resolved when streaming has stopped and the previous\n * content, if any, has been unloaded.\n * @export\n */\nshaka.Player.prototype.unload = function() {\n if (this.destroyed_) return Promise.resolve();\n this.dispatchEvent(new shaka.util.FakeEvent('unloading'));\n\n var p = Promise.resolve();\n if (this.loadChain_) {\n // A load is in progress, cancel it.\n var interrupt = new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.PLAYER,\n shaka.util.Error.Code.LOAD_INTERRUPTED);\n p = this.loadChain_.cancel(interrupt);\n }\n\n return p.then(function() {\n // If there is an existing unload operation, use that.\n if (!this.unloadChain_) {\n this.unloadChain_ = this.resetStreaming_().then(function() {\n this.unloadChain_ = null;\n }.bind(this));\n }\n return this.unloadChain_;\n }.bind(this));\n};\n\n\n/**\n * Gets the current effective playback rate. If using trick play, it will\n * return the current trick play rate; otherwise, it will return the video\n * playback rate.\n * @return {number}\n * @export\n */\nshaka.Player.prototype.getPlaybackRate = function() {\n return this.playhead_ ? this.playhead_.getPlaybackRate() : 0;\n};\n\n\n/**\n * Skip through the content without playing. Simulated using repeated seeks.\n *\n * Trick play will be canceled automatically if the playhead hits the beginning\n * or end of the seekable range for the content.\n *\n * @param {number} rate The playback rate to simulate. For example, a rate of\n * 2.5 would result in 2.5 seconds of content being skipped every second.\n * To trick-play backward, use a negative rate.\n * @export\n */\nshaka.Player.prototype.trickPlay = function(rate) {\n shaka.log.debug('Trick play rate', rate);\n if (this.playhead_)\n this.playhead_.setPlaybackRate(rate);\n\n if (this.streamingEngine_)\n this.streamingEngine_.setTrickPlay(rate != 1);\n};\n\n\n/**\n * Cancel trick-play.\n * @export\n */\nshaka.Player.prototype.cancelTrickPlay = function() {\n shaka.log.debug('Trick play canceled');\n if (this.playhead_)\n this.playhead_.setPlaybackRate(1);\n\n if (this.streamingEngine_)\n this.streamingEngine_.setTrickPlay(false);\n};\n\n\n/**\n * Return a list of variant and text tracks available for the current Period.\n * If there are multiple Periods, then you must seek to the Period before\n * being able to switch.\n *\n * @return {!Array.<shakaExtern.Track>}\n * @export\n * @deprecated Use getVariantTracks() or getTextTracks()\n */\nshaka.Player.prototype.getTracks = function() {\n shaka.log.warning('shaka.Player.getTracks() is being deprecated and will ' +\n 'be removed in v2.2. Use getVariantTracks() to get a ' +\n 'list of variant tracks or getTextTracks() for text.');\n\n var tracks = this.getVariantTracks();\n return tracks.concat(this.getTextTracks());\n};\n\n\n/**\n * Select a specific track. For variant tracks, this disables adaptation.\n * Note that AdaptationEvents are not fired for manual track selections.\n *\n * @param {shakaExtern.Track} track\n * @param {boolean=} opt_clearBuffer\n * @export\n * @deprecated Use selectVariantTrack() or selectTextTrack()\n */\nshaka.Player.prototype.selectTrack = function(track, opt_clearBuffer) {\n shaka.log.warning('shaka.Player.selectTrack() is being deprecated and will ' +\n 'be removed in v2.2. Use selectVariantTrack() to select ' +\n 'a new variant track or selectTextTrack() for text.');\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (track.type == ContentType.TEXT) {\n this.selectTextTrack(track);\n } else {\n // Disable ABR for variant track changes.\n var config = {abr: {enabled: false}};\n this.configure(config);\n this.selectVariantTrack(track, opt_clearBuffer);\n }\n};\n\n\n/**\n * Return a list of variant tracks available for the current\n * Period. If there are multiple Periods, then you must seek to the Period\n * before being able to switch.\n *\n * @return {!Array.<shakaExtern.Track>}\n * @export\n */\nshaka.Player.prototype.getVariantTracks = function() {\n if (!this.manifest_)\n return [];\n this.assertCorrectActiveStreams_();\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var currentPeriod = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.playhead_.getTime());\n var activeStreams = this.activeStreamsByPeriod_[currentPeriod] || {};\n return shaka.util.StreamUtils.getVariantTracks(\n this.manifest_.periods[currentPeriod], activeStreams[ContentType.AUDIO],\n activeStreams[ContentType.VIDEO]);\n};\n\n\n/**\n * Return a list of text tracks available for the current\n * Period. If there are multiple Periods, then you must seek to the Period\n * before being able to switch.\n *\n * @return {!Array.<shakaExtern.Track>}\n * @export\n */\nshaka.Player.prototype.getTextTracks = function() {\n if (!this.manifest_)\n return [];\n this.assertCorrectActiveStreams_();\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var currentPeriod = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.playhead_.getTime());\n var activeStreams = this.activeStreamsByPeriod_[currentPeriod] || {};\n return shaka.util.StreamUtils\n .getTextTracks(\n this.manifest_.periods[currentPeriod],\n activeStreams[ContentType.TEXT])\n .filter(function(track) {\n // Don't show any tracks that are being loaded still.\n return this.loadingTextStreamIds_.indexOf(track.id) < 0;\n }.bind(this));\n};\n\n\n/**\n * Select a specific text track. Note that AdaptationEvents are not\n * fired for manual track selections.\n *\n * @param {shakaExtern.Track} track\n * @export\n */\nshaka.Player.prototype.selectTextTrack = function(track) {\n if (!this.streamingEngine_)\n return;\n\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var period = this.streamingEngine_.getCurrentPeriod();\n var stream = StreamUtils.findTextStreamForTrack(period, track);\n\n if (!stream) {\n shaka.log.error('Unable to find the track with id \"' + track.id +\n '\"; did we change Periods?');\n return;\n }\n\n this.addToSwitchHistory_(stream, /* fromAdaptation */ false);\n\n // Create empty object first and initialize the fields through\n // [] to allow field names to be expressions.\n var streamsToSwitch = {};\n streamsToSwitch[ContentType.TEXT] = stream;\n this.deferredSwitch_(streamsToSwitch, /* opt_clearBuffer */ true);\n};\n\n\n/**\n * Select a specific track. Note that AdaptationEvents are not fired for manual\n * track selections.\n *\n * @param {shakaExtern.Track} track\n * @param {boolean=} opt_clearBuffer\n * @export\n */\nshaka.Player.prototype.selectVariantTrack = function(track, opt_clearBuffer) {\n if (!this.streamingEngine_)\n return;\n\n if (this.config_.abr.enabled) {\n shaka.log.warning('Changing tracks while abr manager is enabled will ' +\n 'likely result in the selected track being overriden. ' +\n 'Consider disabling abr before calling ' +\n 'selectVariantTrack().');\n }\n\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var streamsToSwitch = {};\n\n var period = this.streamingEngine_.getCurrentPeriod();\n var variant = StreamUtils.findVariantForTrack(period, track);\n var activeStreams = this.streamingEngine_.getActiveStreams();\n if (variant) {\n // Double check that the track is allowed to be played.\n // The track list should only contain playable variants,\n // but if resctrictions change and selectVariantTrack()\n // is called before the track list is updated, we could\n // get a now-restricted variant.\n var variantIsPlayable = StreamUtils.isPlayable(variant);\n if (!variantIsPlayable) {\n shaka.log.error('Unable to switch to track with id \"' + track.id +\n '\" because it is restricted.');\n return;\n }\n\n if (variant.audio) {\n // Update active streams even if we're not switching\n // in case active streams haven't been set up yet.\n this.updateActiveStreams_(variant.audio);\n if (variant.audio != activeStreams[ContentType.AUDIO])\n streamsToSwitch[ContentType.AUDIO] = variant.audio;\n }\n if (variant.video) {\n this.updateActiveStreams_(variant.video);\n if (variant.video != activeStreams[ContentType.VIDEO])\n streamsToSwitch[ContentType.VIDEO] = variant.video;\n }\n }\n\n // Add entries to the history.\n shaka.util.MapUtils.values(streamsToSwitch).forEach(function(stream) {\n this.addToSwitchHistory_(stream, /* fromAdaptation */ false);\n }.bind(this));\n\n // Save current text stream to ensure that it doesn't get overridden\n // by a default one inside shaka.Player.configure()\n var currentTextStream = activeStreams[ContentType.TEXT];\n\n if (currentTextStream) {\n streamsToSwitch[ContentType.TEXT] = currentTextStream;\n }\n\n this.deferredSwitch_(streamsToSwitch, opt_clearBuffer);\n};\n\n\n/**\n * Return a list of audio languages available for the current\n * Period.\n *\n * @return {!Array.<string>}\n * @export\n */\nshaka.Player.prototype.getAudioLanguages = function() {\n if (!this.streamingEngine_) {\n return [];\n }\n\n var StreamUtils = shaka.util.StreamUtils;\n var period = this.streamingEngine_.getCurrentPeriod();\n var variants = StreamUtils.getPlayableVariants(period.variants);\n return variants.map(function(variant) {\n return variant.language;\n }).filter(shaka.util.Functional.isNotDuplicate);\n};\n\n\n/**\n * Return a list of text languages available for the current\n * Period.\n *\n * @return {!Array.<string>}\n * @export\n */\nshaka.Player.prototype.getTextLanguages = function() {\n if (!this.streamingEngine_) {\n return [];\n }\n\n var period = this.streamingEngine_.getCurrentPeriod();\n return period.textStreams.map(function(stream) {\n return stream.language;\n }).filter(shaka.util.Functional.isNotDuplicate);\n};\n\n\n/**\n * Sets currentAudioLanguage to the selected language and chooses\n * new variant in that language if need be.\n *\n * @param {!string} language\n * @param {string=} opt_role\n * @export\n */\nshaka.Player.prototype.selectAudioLanguage = function(language, opt_role) {\n if (!this.streamingEngine_) return;\n var period = this.streamingEngine_.getCurrentPeriod();\n this.currentAudioLanguage_ = language;\n this.currentVariantRole_ = opt_role || '';\n this.chooseStreamsAndSwitch_(period);\n};\n\n\n/**\n * Sets currentTextLanguage to the selected language and chooses\n * new text stream in that language if need be.\n *\n * @param {!string} language\n * @param {string=} opt_role\n * @export\n */\nshaka.Player.prototype.selectTextLanguage = function(language, opt_role) {\n if (!this.streamingEngine_) return;\n var period = this.streamingEngine_.getCurrentPeriod();\n this.currentTextLanguage_ = language;\n this.currentTextRole_ = opt_role || '';\n this.chooseStreamsAndSwitch_(period);\n};\n\n\n/**\n * @return {boolean} True if the current text track is visible.\n * @export\n */\nshaka.Player.prototype.isTextTrackVisible = function() {\n return this.textTrack_.mode == 'showing';\n};\n\n\n/**\n * Set the visibility of the current text track, if any.\n *\n * @param {boolean} on\n * @export\n */\nshaka.Player.prototype.setTextTrackVisibility = function(on) {\n this.textTrack_.mode = on ? 'showing' : 'hidden';\n this.onTextTrackVisibility_();\n};\n\n\n/**\n * Returns current playhead time as a Date.\n *\n * @return {Date}\n * @export\n */\nshaka.Player.prototype.getPlayheadTimeAsDate = function() {\n if (!this.manifest_) return null;\n goog.asserts.assert(this.isLive(),\n 'getPlayheadTimeInUTC should be called on a live stream!');\n var time =\n this.manifest_.presentationTimeline.getPresentationStartTime() * 1000 +\n this.video_.currentTime * 1000;\n\n return new Date(time);\n};\n\n\n/**\n * Return playback and adaptation stats.\n *\n * @return {shakaExtern.Stats}\n * @export\n */\nshaka.Player.prototype.getStats = function() {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n this.updateTimeStats_();\n this.updateState_();\n\n var video = null;\n var variant = null;\n var videoInfo = this.video_ && this.video_.getVideoPlaybackQuality ?\n this.video_.getVideoPlaybackQuality() : {};\n\n if (this.playhead_ && this.manifest_) {\n var periodIdx = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.playhead_.getTime());\n var period = this.manifest_.periods[periodIdx];\n var activeStreams = this.activeStreamsByPeriod_[periodIdx];\n\n variant = shaka.util.StreamUtils.getVariantByStreamIds(\n activeStreams[ContentType.AUDIO],\n activeStreams[ContentType.VIDEO],\n period.variants);\n\n video = variant.video || {};\n }\n\n if (!video) video = {};\n if (!variant) variant = {};\n\n // Clone the internal object so our state cannot be tampered with.\n var cloneObject = shaka.util.ConfigUtils.cloneObject;\n return {\n // Not tracked in this.stats_:\n width: video.width || 0,\n height: video.height || 0,\n streamBandwidth: variant.bandwidth || 0,\n decodedFrames: Number(videoInfo.totalVideoFrames),\n droppedFrames: Number(videoInfo.droppedVideoFrames),\n estimatedBandwidth: this.config_.abr.manager.getBandwidthEstimate(),\n\n loadLatency: this.stats_.loadLatency,\n playTime: this.stats_.playTime,\n bufferingTime: this.stats_.bufferingTime,\n // Deep-clone the objects as well as the arrays that contain them:\n switchHistory: cloneObject(this.stats_.switchHistory),\n stateHistory: cloneObject(this.stats_.stateHistory)\n };\n};\n\n\n/**\n * Adds the given text track to the current Period. Load() must resolve before\n * calling. The current Period or the presentation must have a duration. This\n * returns a Promise that will resolve when the track can be switched to and\n * will resolve with the track that was created.\n *\n * @param {string} uri\n * @param {string} language\n * @param {string} kind\n * @param {string} mime\n * @param {string=} opt_codec\n * @param {string=} opt_label\n * @return {!Promise.<shakaExtern.Track>}\n * @export\n */\nshaka.Player.prototype.addTextTrack = function(\n uri, language, kind, mime, opt_codec, opt_label) {\n if (!this.streamingEngine_) {\n shaka.log.error(\n 'Must call load() and wait for it to resolve before adding text ' +\n 'tracks.');\n return Promise.reject();\n }\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Get the Period duration.\n var period = this.streamingEngine_.getCurrentPeriod();\n /** @type {number} */\n var periodDuration;\n for (var i = 0; i < this.manifest_.periods.length; i++) {\n if (this.manifest_.periods[i] == period) {\n if (i == this.manifest_.periods.length - 1) {\n periodDuration = this.manifest_.presentationTimeline.getDuration() -\n period.startTime;\n if (periodDuration == Infinity) {\n shaka.log.error(\n 'The current Period or the presentation must have a duration ' +\n 'to add external text tracks.');\n return Promise.reject();\n }\n } else {\n var nextPeriod = this.manifest_.periods[i + 1];\n periodDuration = nextPeriod.startTime - period.startTime;\n }\n break;\n }\n }\n\n /** @type {shakaExtern.Stream} */\n var stream = {\n id: this.nextExternalStreamId_++,\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: function(time) { return 1; },\n getSegmentReference: function(ref) {\n if (ref != 1) return null;\n return new shaka.media.SegmentReference(\n 1, 0, periodDuration, function() { return [uri]; }, 0, null);\n },\n initSegmentReference: null,\n presentationTimeOffset: 0,\n mimeType: mime,\n codecs: opt_codec || '',\n kind: kind,\n encrypted: false,\n keyId: null,\n language: language,\n label: opt_label || null,\n type: ContentType.TEXT,\n primary: false,\n trickModeVideo: null,\n containsEmsgBoxes: false,\n roles: []\n };\n\n // Add the stream to the loading list to ensure it isn't switched to while it\n // is initializing.\n this.loadingTextStreamIds_.push(stream.id);\n period.textStreams.push(stream);\n\n return this.streamingEngine_.notifyNewTextStream(stream).then(function() {\n if (this.destroyed_) return;\n\n // If this was the first text stream, StreamingEngine will start streaming\n // it in notifyNewTextStream. So update the active stream.\n var curPeriodIdx = this.manifest_.periods.indexOf(period);\n var activeStreams = this.streamingEngine_.getActiveStreams();\n if (activeStreams[ContentType.TEXT]) {\n this.activeStreamsByPeriod_[curPeriodIdx][ContentType.TEXT] =\n activeStreams[ContentType.TEXT].id;\n }\n\n // Remove the stream from the loading list.\n this.loadingTextStreamIds_.splice(\n this.loadingTextStreamIds_.indexOf(stream.id), 1);\n\n shaka.log.debug('Choosing new streams after adding a text stream');\n this.chooseStreamsAndSwitch_(period);\n this.onTracksChanged_();\n\n return {\n id: stream.id,\n active: false,\n type: ContentType.TEXT,\n bandwidth: 0,\n language: language,\n label: opt_label || null,\n kind: kind,\n width: null,\n height: null\n };\n }.bind(this));\n};\n\n\n/**\n * Set the maximum resolution that the platform's hardware can handle.\n * This will be called automatically by shaka.cast.CastReceiver to enforce\n * limitations of the Chromecast hardware.\n *\n * @param {number} width\n * @param {number} height\n * @export\n */\nshaka.Player.prototype.setMaxHardwareResolution = function(width, height) {\n this.maxHwRes_.width = width;\n this.maxHwRes_.height = height;\n};\n\n\n/**\n * Initialize the Player.\n * @private\n */\nshaka.Player.prototype.initialize_ = function() {\n // Start the (potentially slow) process of opening MediaSource now.\n this.mediaSourceOpen_ = this.createMediaSource();\n\n // If the video element has TextTracks, disable them. If we see one that\n // was created by a previous instance of Shaka Player, reuse it.\n for (var i = 0; i < this.video_.textTracks.length; ++i) {\n var track = this.video_.textTracks[i];\n track.mode = 'disabled';\n\n if (track.label == shaka.Player.TextTrackLabel_) {\n this.textTrack_ = track;\n }\n }\n\n if (!this.textTrack_) {\n // As far as I can tell, there is no observable difference between setting\n // kind to 'subtitles' or 'captions' when creating the TextTrack object.\n // The individual text tracks from the manifest will still have their own\n // kinds which can be displayed in the app's UI.\n this.textTrack_ = this.video_.addTextTrack(\n 'subtitles', shaka.Player.TextTrackLabel_);\n }\n this.textTrack_.mode = 'hidden';\n\n // TODO: test that in all cases, the built-in CC controls in the video element\n // are toggling our TextTrack.\n\n // Listen for video errors.\n this.eventManager_.listen(this.video_, 'error',\n this.onVideoError_.bind(this));\n};\n\n\n/**\n * @param {!shakaExtern.Stream} stream\n * @param {boolean} fromAdaptation\n * @private\n */\nshaka.Player.prototype.addToSwitchHistory_ = function(stream, fromAdaptation) {\n this.stats_.switchHistory.push({\n timestamp: Date.now() / 1000,\n id: stream.id,\n type: stream.type,\n fromAdaptation: fromAdaptation\n });\n\n this.updateActiveStreams_(stream);\n};\n\n\n/**\n * @param {!shakaExtern.Stream} stream\n * @private\n */\nshaka.Player.prototype.updateActiveStreams_ = function(stream) {\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n var periodIndex =\n shaka.util.StreamUtils.findPeriodContainingStream(this.manifest_, stream);\n if (!this.activeStreamsByPeriod_[periodIndex])\n this.activeStreamsByPeriod_[periodIndex] = {};\n this.activeStreamsByPeriod_[periodIndex][stream.type] = stream.id;\n};\n\n\n/**\n * Destroy members responsible for streaming.\n *\n * @return {!Promise}\n * @private\n */\nshaka.Player.prototype.destroyStreaming_ = function() {\n if (this.eventManager_) {\n this.eventManager_.unlisten(this.mediaSource_, 'sourceopen');\n this.eventManager_.unlisten(this.video_, 'loadeddata');\n this.eventManager_.unlisten(this.video_, 'playing');\n this.eventManager_.unlisten(this.video_, 'pause');\n this.eventManager_.unlisten(this.video_, 'ended');\n }\n\n if (this.video_) {\n this.video_.removeAttribute('src');\n this.video_.load();\n }\n\n var p = Promise.all([\n this.config_ ? this.config_.abr.manager.stop() : null,\n this.drmEngine_ ? this.drmEngine_.destroy() : null,\n this.mediaSourceEngine_ ? this.mediaSourceEngine_.destroy() : null,\n this.playhead_ ? this.playhead_.destroy() : null,\n this.playheadObserver_ ? this.playheadObserver_.destroy() : null,\n this.streamingEngine_ ? this.streamingEngine_.destroy() : null,\n this.parser_ ? this.parser_.stop() : null\n ]);\n\n this.drmEngine_ = null;\n this.mediaSourceEngine_ = null;\n this.playhead_ = null;\n this.playheadObserver_ = null;\n this.streamingEngine_ = null;\n this.parser_ = null;\n this.manifest_ = null;\n this.manifestUri_ = null;\n this.mediaSourceOpen_ = null;\n this.mediaSource_ = null;\n this.pendingTimelineRegions_ = [];\n this.activeStreamsByPeriod_ = {};\n this.deferredSwitches_ = {};\n this.stats_ = this.getCleanStats_();\n\n return p;\n};\n\n\n/**\n * Reset the streaming system.\n * @return {!Promise}\n * @private\n */\nshaka.Player.prototype.resetStreaming_ = function() {\n if (!this.parser_) {\n // Nothing is playing, so this is effectively a no-op.\n return Promise.resolve();\n }\n\n // Destroy the streaming system before we recreate everything.\n return this.destroyStreaming_().then(function() {\n if (this.destroyed_) return;\n\n // Force an exit from the buffering state.\n this.onBuffering_(false);\n\n // Start the (potentially slow) process of opening MediaSource now.\n this.mediaSourceOpen_ = this.createMediaSource();\n }.bind(this));\n};\n\n\n/**\n * @const {string}\n * @private\n */\nshaka.Player.TextTrackLabel_ = 'Shaka Player TextTrack';\n\n\n/**\n * @return {!Object}\n * @private\n */\nshaka.Player.prototype.configOverrides_ = function() {\n return {\n '.drm.servers': '',\n '.drm.clearKeys': '',\n '.drm.advanced': {\n distinctiveIdentifierRequired: false,\n persistentStateRequired: false,\n videoRobustness: '',\n audioRobustness: '',\n serverCertificate: null\n }\n };\n};\n\n\n/**\n * @return {shakaExtern.PlayerConfiguration}\n * @private\n */\nshaka.Player.prototype.defaultConfig_ = function() {\n return {\n drm: {\n retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(),\n // These will all be verified by special cases in mergeConfigObjects_():\n servers: {}, // key is arbitrary key system ID, value must be string\n clearKeys: {}, // key is arbitrary key system ID, value must be string\n advanced: {}, // key is arbitrary key system ID, value is a record type\n delayLicenseRequestUntilPlayed: false\n },\n manifest: {\n retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(),\n dash: {\n customScheme: function(node) {\n // Reference node to keep closure from removing it.\n // If the argument is removed, it breaks our function length check\n // in mergeConfigObjects_().\n // TODO: Find a better solution if possible.\n // NOTE: Chrome App Content Security Policy prohibits usage of new\n // Function()\n\n if (node) return null;\n },\n clockSyncUri: '',\n ignoreDrmInfo: false\n },\n hls: {\n defaultTimeOffset: 0\n }\n },\n streaming: {\n retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(),\n infiniteRetriesForLiveStreams: true,\n rebufferingGoal: 2,\n bufferingGoal: 10,\n bufferBehind: 30,\n ignoreTextStreamFailures: false,\n startAtSegmentBoundary: false,\n smallGapLimit: 0.5,\n jumpLargeGaps: false\n },\n abr: {\n manager: this.defaultAbrManager_,\n enabled: true,\n defaultBandwidthEstimate:\n shaka.abr.EwmaBandwidthEstimator.DEFAULT_ESTIMATE,\n restrictions: {\n minWidth: 0,\n maxWidth: Infinity,\n minHeight: 0,\n maxHeight: Infinity,\n minPixels: 0,\n maxPixels: Infinity,\n minBandwidth: 0,\n maxBandwidth: Infinity\n }\n },\n preferredAudioLanguage: '',\n preferredTextLanguage: '',\n restrictions: {\n minWidth: 0,\n maxWidth: Infinity,\n minHeight: 0,\n maxHeight: Infinity,\n minPixels: 0,\n maxPixels: Infinity,\n minBandwidth: 0,\n maxBandwidth: Infinity\n }\n };\n};\n\n\n/**\n * @return {shakaExtern.Stats}\n * @private\n */\nshaka.Player.prototype.getCleanStats_ = function() {\n return {\n // These are not tracked in the private stats structure and are only here to\n // satisfy the compiler.\n width: NaN,\n height: NaN,\n streamBandwidth: NaN,\n decodedFrames: NaN,\n droppedFrames: NaN,\n estimatedBandwidth: NaN,\n\n // These are tracked in the private stats structure to avoid the need for\n // many private member variables.\n loadLatency: NaN,\n playTime: 0,\n bufferingTime: 0,\n switchHistory: [],\n stateHistory: []\n };\n};\n\n\n/**\n * @param {shakaExtern.Period} period\n * @private\n */\nshaka.Player.prototype.filterPeriod_ = function(period) {\n goog.asserts.assert(this.video_, 'Must not be destroyed');\n var StreamUtils = shaka.util.StreamUtils;\n\n var activeStreams =\n this.streamingEngine_ ? this.streamingEngine_.getActiveStreams() : {};\n StreamUtils.filterPeriod(this.drmEngine_, activeStreams, period);\n\n // Check for playable variants before restrictions to give a different error\n // if we have restricted all the tracks rather than there being none.\n var hasPlayableVariants =\n StreamUtils.getPlayableVariants(period.variants).length > 0;\n\n var tracksChanged = shaka.util.StreamUtils.applyRestrictions(\n period, this.config_.restrictions, this.maxHwRes_);\n if (tracksChanged && this.streamingEngine_ &&\n this.streamingEngine_.getCurrentPeriod() == period) {\n this.onTracksChanged_();\n }\n\n // Check for playable variants again. If the first check found variants, but\n // not the second, then all variants are restricted.\n var allVariantsRestricted =\n StreamUtils.getPlayableVariants(period.variants).length < 1;\n\n if (!hasPlayableVariants) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.UNPLAYABLE_PERIOD);\n } else if (allVariantsRestricted) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET);\n }\n};\n\n\n/**\n * Switches to the given streams, deferring switches if needed.\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType,\n shakaExtern.Stream>} streamsByType\n * @param {boolean=} opt_clearBuffer\n * @private\n */\nshaka.Player.prototype.deferredSwitch_ = function(\n streamsByType, opt_clearBuffer) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n for (var type in streamsByType) {\n var stream = streamsByType[type];\n var clearBuffer = opt_clearBuffer || false;\n // TODO: consider adding a cue replacement algorithm to TextEngine to remove\n // this special case for text:\n if (type == ContentType.TEXT) clearBuffer = true;\n if (this.switchingPeriods_) {\n this.deferredSwitches_[type] = {stream: stream, clearBuffer: clearBuffer};\n } else {\n this.streamingEngine_.switch(type, stream, clearBuffer);\n }\n }\n};\n\n\n/**\n * Verifies that the active streams according to the player match those in\n * StreamingEngine.\n * @private\n */\nshaka.Player.prototype.assertCorrectActiveStreams_ = function() {\n if (!this.streamingEngine_ || !this.manifest_ || COMPILED) return;\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var streamingActive = this.streamingEngine_.getActiveStreams();\n var mainStream =\n streamingActive[ContentType.VIDEO] || streamingActive[ContentType.AUDIO];\n if (!mainStream)\n return;\n\n var streamingPeriodIndex =\n StreamUtils.findPeriodContainingStream(this.manifest_, mainStream);\n var currentPeriodIndex =\n this.manifest_.periods.indexOf(this.streamingEngine_.getCurrentPeriod());\n if (streamingPeriodIndex < 0 || streamingPeriodIndex != currentPeriodIndex)\n return;\n\n var playerActive = this.activeStreamsByPeriod_[currentPeriodIndex] || {};\n for (var type in streamingActive) {\n var activeId = streamingActive[type].id;\n if (this.deferredSwitches_[type])\n activeId = this.deferredSwitches_[type].stream.id;\n goog.asserts.assert(activeId == playerActive[type],\n 'Inconsistent active stream');\n }\n};\n\n\n/** @private */\nshaka.Player.prototype.updateTimeStats_ = function() {\n // Only count while we're loaded.\n if (!this.manifest_)\n return;\n\n var now = Date.now() / 1000;\n if (this.buffering_)\n this.stats_.bufferingTime += (now - this.lastTimeStatsUpdateTimestamp_);\n else\n this.stats_.playTime += (now - this.lastTimeStatsUpdateTimestamp_);\n\n this.lastTimeStatsUpdateTimestamp_ = now;\n};\n\n\n/**\n * @param {number} time\n * @return {number}\n * @private\n */\nshaka.Player.prototype.adjustStartTime_ = function(time) {\n var activeStreams = this.streamingEngine_.getActiveStreams();\n var period = this.streamingEngine_.getCurrentPeriod();\n\n // This method is called after StreamingEngine.init resolves, this means that\n // all the active streams have had createSegmentIndex called.\n function getAdjustedTime(stream, time) {\n if (!stream) return null;\n var idx = stream.findSegmentPosition(time - period.startTime);\n if (idx == null) return null;\n var ref = stream.getSegmentReference(idx);\n if (!ref) return null;\n var refTime = ref.startTime + period.startTime;\n goog.asserts.assert(refTime <= time, 'Segment should start before time');\n return refTime;\n }\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var videoStartTime = getAdjustedTime(activeStreams[ContentType.VIDEO], time);\n var audioStartTime = getAdjustedTime(activeStreams[ContentType.AUDIO], time);\n\n // If we have both video and audio times, pick the larger one. If we picked\n // the smaller one, that one will download an entire segment to buffer the\n // difference.\n if (videoStartTime != null && audioStartTime != null)\n return Math.max(videoStartTime, audioStartTime);\n else if (videoStartTime != null)\n return videoStartTime;\n else if (audioStartTime != null)\n return audioStartTime;\n else\n return time;\n};\n\n\n/**\n * Callback from NetworkingEngine.\n *\n * @param {number} deltaTimeMs\n * @param {number} numBytes\n * @private\n */\nshaka.Player.prototype.onSegmentDownloaded_ = function(deltaTimeMs, numBytes) {\n this.config_.abr.manager.segmentDownloaded(deltaTimeMs, numBytes);\n};\n\n\n/**\n * Callback from PlayheadObserver.\n *\n * @param {boolean} buffering\n * @private\n */\nshaka.Player.prototype.onBuffering_ = function(buffering) {\n // Before setting |buffering_|, update the time spent in the previous state.\n this.updateTimeStats_();\n this.buffering_ = buffering;\n this.updateState_();\n\n if (this.playhead_)\n this.playhead_.setBuffering(buffering);\n\n var event = new shaka.util.FakeEvent('buffering', { 'buffering': buffering });\n this.dispatchEvent(event);\n};\n\n\n/**\n * Callback from PlayheadObserver.\n * @private\n */\nshaka.Player.prototype.onChangePeriod_ = function() {\n this.onTracksChanged_();\n};\n\n\n/**\n * Called from potential initiators of state change, or before returning stats\n * to the user.\n *\n * This method decides if state has actually changed, updates the last entry,\n * and adds a new one if needed.\n *\n * @private\n */\nshaka.Player.prototype.updateState_ = function() {\n if (this.destroyed_) return;\n\n var newState;\n if (this.buffering_) {\n newState = 'buffering';\n } else if (this.video_.ended) {\n newState = 'ended';\n } else if (this.video_.paused) {\n newState = 'paused';\n } else {\n newState = 'playing';\n }\n\n var now = Date.now() / 1000;\n if (this.stats_.stateHistory.length) {\n var lastIndex = this.stats_.stateHistory.length - 1;\n var lastEntry = this.stats_.stateHistory[lastIndex];\n lastEntry.duration = now - lastEntry.timestamp;\n\n if (newState == lastEntry.state) {\n // The state has not changed, so do not add anything to the history.\n return;\n }\n }\n\n this.stats_.stateHistory.push({\n timestamp: now,\n state: newState,\n duration: 0\n });\n};\n\n\n/**\n * Callback from Playhead.\n *\n * @private\n */\nshaka.Player.prototype.onSeek_ = function() {\n if (this.playheadObserver_)\n this.playheadObserver_.seeked();\n if (this.streamingEngine_)\n this.streamingEngine_.seeked();\n};\n\n\n/**\n * Chooses streams from the given Period.\n *\n * @param {!shakaExtern.Period} period\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @param {!Array.<!shakaExtern.Stream>} textStreams\n * @param {boolean=} opt_chooseAll If true, choose streams of every type.\n * @return {!Object.<string, !shakaExtern.Stream>} A map of stream types to\n * chosen streams.\n * @private\n */\nshaka.Player.prototype.chooseStreams_ =\n function(period, variants, textStreams, opt_chooseAll) {\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Issue an error if there are no playable variants\n if (!variants || variants.length < 1) {\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.RESTRICTIONS_CANNOT_BE_MET));\n return {};\n }\n\n // Update abr manager with newly filtered streams and variants.\n this.config_.abr.manager.setVariants(variants);\n this.config_.abr.manager.setTextStreams(textStreams);\n\n var needsUpdate = [];\n if (opt_chooseAll) {\n needsUpdate = [ContentType.VIDEO, ContentType.AUDIO];\n if (period.textStreams.length) needsUpdate.push(ContentType.TEXT);\n }\n\n // Check if any of the active streams is no longer available\n // or is using the wrong language.\n var activeStreams = this.streamingEngine_.getActiveStreams();\n // activePeriod may reasonably be null before StreamingEngine is streaming.\n var activePeriod = this.streamingEngine_.getActivePeriod();\n var activeVariant = shaka.util.StreamUtils.getVariantByStreams(\n activeStreams[ContentType.AUDIO],\n activeStreams[ContentType.VIDEO],\n activePeriod ? activePeriod.variants : period.variants);\n\n if (activeVariant) {\n if (!activeVariant.allowedByApplication ||\n !activeVariant.allowedByKeySystem) {\n needsUpdate.push(ContentType.AUDIO);\n needsUpdate.push(ContentType.VIDEO);\n }\n\n for (var type in activeStreams) {\n var stream = activeStreams[type];\n if (stream.type == ContentType.AUDIO &&\n stream.language != variants[0].language) {\n needsUpdate.push(type);\n } else if (stream.type == ContentType.TEXT && textStreams.length > 0 &&\n stream.language != textStreams[0].language) {\n needsUpdate.push(type);\n }\n }\n }\n\n needsUpdate = needsUpdate.filter(shaka.util.Functional.isNotDuplicate);\n\n if (needsUpdate.length > 0) {\n shaka.log.debug('Choosing new streams for', needsUpdate);\n var chosen = {};\n try {\n chosen = this.config_.abr.manager.chooseStreams(needsUpdate);\n } catch (err) {\n this.onError_(err);\n }\n\n return chosen;\n } else {\n shaka.log.debug('No new streams need to be chosen.');\n return {};\n }\n};\n\n\n/**\n * Chooses streams from the given Period and switches to them.\n * Called after a config change, a new text stream, or a key status event.\n *\n * @param {!shakaExtern.Period} period\n * @private\n */\nshaka.Player.prototype.chooseStreamsAndSwitch_ = function(period) {\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Create empty object first and initialize the fields through\n // [] to allow field names to be expressions.\n var languageMatches = {};\n languageMatches[ContentType.AUDIO] = false;\n languageMatches[ContentType.TEXT] = false;\n\n var variants = shaka.util.StreamUtils.filterVariantsByRoleAndLanguage(\n period, this.currentAudioLanguage_, languageMatches,\n this.currentVariantRole_);\n var textStreams = shaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage(\n period, this.currentTextLanguage_, languageMatches,\n this.currentTextRole_);\n\n // chooseStreams_ filters out choices which are already active.\n var chosen = this.chooseStreams_(period, variants, textStreams);\n\n for (var type in chosen) {\n this.addToSwitchHistory_(chosen[type], /* fromAdaptation */ true);\n }\n\n // Because we're running this after a config change (manual language change),\n // a new text stream, or a key status event, and because active streams have\n // been filtered out already, it is always okay to clear the buffer for what\n // remains.\n this.deferredSwitch_(chosen, /* opt_clearBuffer */ true);\n\n // Send an adaptation event so that the UI can show the new language/tracks.\n this.onAdaptation_();\n\n if (chosen[ContentType.TEXT]) {\n // If audio and text tracks have different languages, and the text track\n // matches the user's preference, then show the captions.\n if (chosen[ContentType.AUDIO] &&\n languageMatches[ContentType.TEXT] &&\n chosen[ContentType.TEXT].language !=\n chosen[ContentType.AUDIO].language) {\n this.textTrack_.mode = 'showing';\n this.onTextTrackVisibility_();\n }\n }\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @param {!shakaExtern.Period} period\n * @return {!Object.<string, !shakaExtern.Stream>} A map of stream types to\n * chosen streams.\n * @private\n */\nshaka.Player.prototype.onChooseStreams_ = function(period) {\n shaka.log.debug('onChooseStreams_', period);\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n\n // We are switching Periods, so the AbrManager will be disabled. But if we\n // want to abr.enabled, we do not want to call AbrManager.enable before\n // canSwitch_ is called.\n this.switchingPeriods_ = true;\n this.config_.abr.manager.disable();\n\n shaka.log.debug('Choosing new streams after period changed');\n var variants = shaka.util.StreamUtils.filterVariantsByRoleAndLanguage(\n period, this.currentAudioLanguage_, /* opt_languageMatches */ undefined,\n this.currentVariantRole_);\n\n var textStreams = shaka.util.StreamUtils.filterTextStreamsByRoleAndLanguage(\n period, this.currentTextLanguage_, /* opt_languageMatches */ undefined,\n this.currentTextRole_);\n\n shaka.log.v2('onChooseStreams_, variants and text streams: ',\n variants, textStreams);\n\n var chosen = this.chooseStreams_(\n period, variants, textStreams, /* opt_chooseAll */ true);\n shaka.log.v2('onChooseStreams_, chosen=', chosen);\n\n // Override the chosen streams with the ones picked in\n // selectVariant/TextTrack. NOTE: The apparent race between\n // selectVariant/TextTrack and period transition is handled by\n // StreamingEngine, which will re-request tracks for thetransition if any\n // of these deferred selections are from the wrong period.\n for (var type in this.deferredSwitches_) {\n // We are choosing initial tracks, so no segments from this Period have\n // been downloaded yet. Therefore, it is okay to ignore the .clearBuffer\n // member of this structure.\n chosen[type] = this.deferredSwitches_[type].stream;\n }\n this.deferredSwitches_ = {};\n\n for (var type in chosen) {\n this.addToSwitchHistory_(chosen[type], /* fromAdaptation */ true);\n }\n\n // Don't fire a tracks-changed event since we aren't inside the new Period\n // yet.\n\n return chosen;\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @private\n */\nshaka.Player.prototype.canSwitch_ = function() {\n shaka.log.debug('canSwitch_');\n this.switchingPeriods_ = false;\n if (this.config_.abr.enabled)\n this.config_.abr.manager.enable();\n\n // If we still have deferred switches, switch now.\n for (var type in this.deferredSwitches_) {\n var info = this.deferredSwitches_[type];\n this.streamingEngine_.switch(type, info.stream, info.clearBuffer);\n }\n this.deferredSwitches_ = {};\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @private\n */\nshaka.Player.prototype.onManifestUpdate_ = function() {\n if (this.parser_ && this.parser_.update)\n this.parser_.update();\n};\n\n\n/**\n * Callback from StreamingEngine.\n *\n * @private\n */\nshaka.Player.prototype.onSegmentAppended_ = function() {\n if (this.playhead_)\n this.playhead_.onSegmentAppended();\n};\n\n\n/**\n * Callback from AbrManager.\n *\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType,\n * !shakaExtern.Stream>} streamsByType\n * @param {boolean=} opt_clearBuffer\n * @private\n */\nshaka.Player.prototype.switch_ = function(streamsByType, opt_clearBuffer) {\n shaka.log.debug('switch_');\n goog.asserts.assert(this.config_.abr.enabled,\n 'AbrManager should not call switch while disabled!');\n goog.asserts.assert(!this.switchingPeriods_,\n 'AbrManager should not call switch while transitioning between Periods!');\n\n // We have adapted to a new stream, record it in the history. Only add if\n // we are actually switching the stream.\n var oldActive = this.streamingEngine_.getActiveStreams();\n for (var type in streamsByType) {\n var stream = streamsByType[type];\n if (oldActive[type] != stream) {\n this.addToSwitchHistory_(stream, /* fromAdaptation */ true);\n } else {\n // If it's the same, remove it from the map.\n // This allows us to avoid onAdaptation_() when nothing has changed.\n delete streamsByType[type];\n }\n }\n\n if (shaka.util.MapUtils.empty(streamsByType)) {\n // There's nothing to change.\n return;\n }\n\n if (!this.streamingEngine_) {\n // There's no way to change it.\n return;\n }\n\n for (var type in streamsByType) {\n var clearBuffer = opt_clearBuffer || false;\n this.streamingEngine_.switch(type, streamsByType[type], clearBuffer);\n }\n this.onAdaptation_();\n};\n\n\n/**\n * Dispatches a 'adaptation' event.\n * @private\n */\nshaka.Player.prototype.onAdaptation_ = function() {\n // In the next frame, dispatch a 'adaptation' event.\n // This gives StreamingEngine time to absorb the changes before the user\n // tries to query them.\n Promise.resolve().then(function() {\n if (this.destroyed_) return;\n var event = new shaka.util.FakeEvent('adaptation');\n this.dispatchEvent(event);\n }.bind(this));\n};\n\n\n/**\n * Dispatches a 'trackschanged' event.\n * @private\n */\nshaka.Player.prototype.onTracksChanged_ = function() {\n // In the next frame, dispatch a 'trackschanged' event.\n // This gives StreamingEngine time to absorb the changes before the user\n // tries to query them.\n Promise.resolve().then(function() {\n if (this.destroyed_) return;\n var event = new shaka.util.FakeEvent('trackschanged');\n this.dispatchEvent(event);\n }.bind(this));\n};\n\n\n/** @private */\nshaka.Player.prototype.onTextTrackVisibility_ = function() {\n var event = new shaka.util.FakeEvent('texttrackvisibility');\n this.dispatchEvent(event);\n};\n\n\n/**\n * @param {!shaka.util.Error} error\n * @private\n */\nshaka.Player.prototype.onError_ = function(error) {\n // Errors dispatched after destroy is called are irrelevant.\n if (this.destroyed_) return;\n\n goog.asserts.assert(error instanceof shaka.util.Error, 'Wrong error type!');\n\n var event = new shaka.util.FakeEvent('error', { 'detail': error });\n this.dispatchEvent(event);\n};\n\n\n/**\n * @param {shakaExtern.TimelineRegionInfo} region\n * @private\n */\nshaka.Player.prototype.onTimelineRegionAdded_ = function(region) {\n if (this.playheadObserver_) {\n this.playheadObserver_.addTimelineRegion(region);\n } else {\n this.pendingTimelineRegions_.push(region);\n }\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.Player.prototype.onEvent_ = function(event) {\n this.dispatchEvent(event);\n};\n\n\n/**\n * @param {!Event} event\n * @private\n */\nshaka.Player.prototype.onVideoError_ = function(event) {\n if (!this.video_.error) return;\n\n var code = this.video_.error.code;\n if (code == 1 /* MEDIA_ERR_ABORTED */) {\n // Ignore this error code, which should only occur when navigating away or\n // deliberately stopping playback of HTTP content.\n return;\n }\n\n // Extra error information from MS Edge and IE11:\n var extended = this.video_.error.msExtendedCode;\n if (extended) {\n // Convert to unsigned:\n if (extended < 0) {\n extended += Math.pow(2, 32);\n }\n // Format as hex:\n extended = extended.toString(16);\n }\n\n this.onError_(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.VIDEO_ERROR,\n code, extended));\n};\n\n\n/**\n * @param {!Object.<string, string>} keyStatusMap A map of hex key IDs to\n * statuses.\n * @private\n */\nshaka.Player.prototype.onKeyStatus_ = function(keyStatusMap) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n goog.asserts.assert(this.streamingEngine_, 'Should have been initialized.');\n // 'usable', 'released', 'output-downscaled', 'status-pending' are statuses\n // of the usable keys.\n // 'expired' status is being handled separately in DrmEngine.\n var restrictedStatuses = ['output-restricted', 'internal-error'];\n\n var period = this.streamingEngine_.getCurrentPeriod();\n var tracksChanged = false;\n\n period.variants.forEach(function(variant) {\n var streams = [];\n if (variant.audio) streams.push(variant.audio);\n if (variant.video) streams.push(variant.video);\n\n streams.forEach(function(stream) {\n var originalAllowed = variant.allowedByKeySystem;\n\n // Only update if we have a key ID for the stream. If the key isn't\n // present, then we don't have that key and it should be restricted.\n if (stream.keyId) {\n var keyStatus = keyStatusMap[stream.keyId];\n variant.allowedByKeySystem =\n !!keyStatus && restrictedStatuses.indexOf(keyStatus) < 0;\n }\n\n if (originalAllowed != variant.allowedByKeySystem) {\n tracksChanged = true;\n }\n });\n });\n\n var activeStreams = this.streamingEngine_.getActiveStreams();\n var activeVariant = shaka.util.StreamUtils.getVariantByStreams(\n activeStreams[ContentType.AUDIO], activeStreams[ContentType.VIDEO],\n period.variants);\n if (activeVariant && !activeVariant.allowedByKeySystem) {\n shaka.log.debug('Choosing new streams after key status changed');\n this.chooseStreamsAndSwitch_(period);\n }\n\n if (tracksChanged)\n this.onTracksChanged_();\n};\n\n\n/**\n * Callback from DrmEngine\n * @param {string} keyId\n * @param {number} expiration\n * @private\n */\nshaka.Player.prototype.onExpirationUpdated_ = function(keyId, expiration) {\n if (this.parser_ && this.parser_.onExpirationUpdated)\n this.parser_.onExpirationUpdated(keyId, expiration);\n\n var event = new shaka.util.FakeEvent('expirationupdated');\n this.dispatchEvent(event);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/player.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.XmlUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\n\n\n/**\n * @namespace shaka.util.XmlUtils\n * @summary A set of XML utility functions.\n */\n\n\n/**\n * Finds a child XML element.\n * @param {!Element} elem The parent XML element.\n * @param {string} name The child XML element's tag name.\n * @return {Element} The child XML element, or null if a child XML element does\n * not exist with the given tag name OR if there exists more than one\n * child XML element with the given tag name.\n */\nshaka.util.XmlUtils.findChild = function(elem, name) {\n var children = shaka.util.XmlUtils.findChildren(elem, name);\n if (children.length != 1)\n return null;\n return children[0];\n};\n\n\n/**\n * Finds child XML elements.\n * @param {!Element} elem The parent XML element.\n * @param {string} name The child XML element's tag name.\n * @return {!Array.<!Element>} The child XML elements.\n */\nshaka.util.XmlUtils.findChildren = function(elem, name) {\n return Array.prototype.filter.call(elem.childNodes, function(child) {\n goog.asserts.assert(\n child.tagName != name || child instanceof Element,\n 'child element should be an Element');\n return child.tagName == name;\n });\n};\n\n\n/**\n * Gets the text contents of a node.\n * @param {!Element} elem The XML element.\n * @return {?string} The text contents, or null if there are none.\n */\nshaka.util.XmlUtils.getContents = function(elem) {\n var contents = elem.firstChild;\n\n // check content\n if (!contents || contents.nodeType != Node.TEXT_NODE)\n return null;\n\n // read merged text content from all text nodes (fixes MSIE 11 bug)\n return elem.textContent.trim();\n};\n\n\n/**\n * Parses an attribute by its name.\n * @param {!Element} elem The XML element.\n * @param {string} name The attribute name.\n * @param {function(string): (T|null)} parseFunction A function that parses\n * the attribute.\n * @param {(T|null)=} opt_defaultValue The attribute's default value, if not\n * specified, the attibute's default value is null.\n * @return {(T|null)} The parsed attribute on success, or the attribute's\n * default value if the attribute does not exist or could not be parsed.\n * @template T\n */\nshaka.util.XmlUtils.parseAttr = function(\n elem, name, parseFunction, opt_defaultValue) {\n var parsedValue = null;\n\n var value = elem.getAttribute(name);\n if (value != null)\n parsedValue = parseFunction(value);\n\n if (parsedValue == null)\n return opt_defaultValue != undefined ? opt_defaultValue : null;\n\n return parsedValue;\n};\n\n\n/**\n * Parses an XML date string.\n * @param {string} dateString\n * @return {?number} The parsed date in seconds on success; otherwise, return\n * null.\n */\nshaka.util.XmlUtils.parseDate = function(dateString) {\n if (!dateString)\n return null;\n\n var result = Date.parse(dateString);\n return (!isNaN(result) ? Math.floor(result / 1000.0) : null);\n};\n\n\n/**\n * Parses an XML duration string.\n * Negative values are not supported. Years and months are treated as exactly\n * 365 and 30 days respectively.\n * @param {string} durationString The duration string, e.g., \"PT1H3M43.2S\",\n * which means 1 hour, 3 minutes, and 43.2 seconds.\n * @return {?number} The parsed duration in seconds on success; otherwise,\n * return null.\n * @see {@link http://www.datypic.com/sc/xsd/t-xsd_duration.html}\n */\nshaka.util.XmlUtils.parseDuration = function(durationString) {\n if (!durationString)\n return null;\n\n var re = '^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?' +\n '(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$';\n var matches = new RegExp(re).exec(durationString);\n\n if (!matches) {\n shaka.log.warning('Invalid duration string:', durationString);\n return null;\n }\n\n // Note: Number(null) == 0 but Number(undefined) == NaN.\n var years = Number(matches[1] || null);\n var months = Number(matches[2] || null);\n var days = Number(matches[3] || null);\n var hours = Number(matches[4] || null);\n var minutes = Number(matches[5] || null);\n var seconds = Number(matches[6] || null);\n\n // Assume a year always has 365 days and a month always has 30 days.\n var d = (60 * 60 * 24 * 365) * years +\n (60 * 60 * 24 * 30) * months +\n (60 * 60 * 24) * days +\n (60 * 60) * hours +\n 60 * minutes +\n seconds;\n return isFinite(d) ? d : null;\n};\n\n\n/**\n * Parses a range string.\n * @param {string} rangeString The range string, e.g., \"101-9213\".\n * @return {?{start: number, end: number}} The parsed range on success;\n * otherwise, return null.\n */\nshaka.util.XmlUtils.parseRange = function(rangeString) {\n var matches = /([0-9]+)-([0-9]+)/.exec(rangeString);\n\n if (!matches)\n return null;\n\n var start = Number(matches[1]);\n if (!isFinite(start))\n return null;\n\n var end = Number(matches[2]);\n if (!isFinite(end))\n return null;\n\n return {start: start, end: end};\n};\n\n\n/**\n * Parses an integer.\n * @param {string} intString The integer string.\n * @return {?number} The parsed integer on success; otherwise, return null.\n */\nshaka.util.XmlUtils.parseInt = function(intString) {\n var n = Number(intString);\n return (n % 1 === 0) ? n : null;\n};\n\n\n/**\n * Parses a positive integer.\n * @param {string} intString The integer string.\n * @return {?number} The parsed positive integer on success; otherwise,\n * return null.\n */\nshaka.util.XmlUtils.parsePositiveInt = function(intString) {\n var n = Number(intString);\n return (n % 1 === 0) && (n > 0) ? n : null;\n};\n\n\n/**\n * Parses a non-negative integer.\n * @param {string} intString The integer string.\n * @return {?number} The parsed non-negative integer on success; otherwise,\n * return null.\n */\nshaka.util.XmlUtils.parseNonNegativeInt = function(intString) {\n var n = Number(intString);\n return (n % 1 === 0) && (n >= 0) ? n : null;\n};\n\n\n/**\n * Parses a floating point number.\n * @param {string} floatString The floating point number string.\n * @return {?number} The parsed floating point number on success; otherwise,\n * return null. May return -Infinity or Infinity.\n */\nshaka.util.XmlUtils.parseFloat = function(floatString) {\n var n = Number(floatString);\n return !isNaN(n) ? n : null;\n};\n\n\n/**\n * Evaluate a division expressed as a string\n * @param {string} exprString\n * The expression to evaluate, e.g. \"200/2\". Can also be a single number\n * @return {?number} The evaluated expression as floating point number on\n * success; otherwise return null.\n */\nshaka.util.XmlUtils.evalDivision = function(exprString) {\n var res;\n var n;\n if (res = exprString.match(/^(\\d+)\\/(\\d+)$/)) {\n n = Number(res[1] / res[2]);\n } else {\n n = Number(exprString);\n }\n return !isNaN(n) ? n : null;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/xml_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.ContentProtection');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.Uint8ArrayUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.ContentProtection\n * @summary A set of functions for parsing and interpreting ContentProtection\n * elements.\n */\n\n\n/**\n * @typedef {{\n * defaultKeyId: ?string,\n * defaultInit: Array.<shakaExtern.InitDataOverride>,\n * drmInfos: !Array.<shakaExtern.DrmInfo>,\n * firstRepresentation: boolean\n * }}\n *\n * @description\n * Contains information about the ContentProtection elements found at the\n * AdaptationSet level.\n *\n * @property {?string} defaultKeyId\n * The default key ID to use. This is used by parseKeyIds as a default. This\n * can be null to indicate that there is no default.\n * @property {Array.<shakaExtern.InitDataOverride>} defaultInit\n * The default init data override. This can be null to indicate that there\n * is no default.\n * @property {!Array.<shakaExtern.DrmInfo>} drmInfos\n * The DrmInfo objects.\n * @property {boolean} firstRepresentation\n * True when first parsed; changed to false after the first call to\n * parseKeyIds. This is used to determine if a dummy key-system should be\n * overwritten; namely that the first representation can replace the dummy\n * from the AdaptationSet.\n */\nshaka.dash.ContentProtection.Context;\n\n\n/**\n * @typedef {{\n * node: !Element,\n * schemeUri: string,\n * keyId: ?string,\n * init: Array.<shakaExtern.InitDataOverride>\n * }}\n *\n * @description\n * The parsed result of a single ContentProtection element.\n *\n * @property {!Element} node\n * The ContentProtection XML element.\n * @property {string} schemeUri\n * The scheme URI.\n * @property {?string} keyId\n * The default key ID, if present.\n * @property {Array.<shakaExtern.InitDataOverride>} init\n * The init data, if present. If there is no init data, it will be null. If\n * this is non-null, there is at least one element.\n */\nshaka.dash.ContentProtection.Element;\n\n\n/**\n * A map of scheme URI to key system name.\n *\n * @const {!Object.<string, string>}\n * @private\n */\nshaka.dash.ContentProtection.defaultKeySystems_ = {\n 'urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b': 'org.w3.clearkey',\n 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed': 'com.widevine.alpha',\n 'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95': 'com.microsoft.playready',\n 'urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb': 'com.adobe.primetime'\n};\n\n\n/**\n * @const {string}\n * @private\n */\nshaka.dash.ContentProtection.MP4Protection_ =\n 'urn:mpeg:dash:mp4protection:2011';\n\n\n/**\n * Parses info from the ContentProtection elements at the AdaptationSet level.\n *\n * @param {!Array.<!Element>} elems\n * @param {shakaExtern.DashContentProtectionCallback} callback\n * @param {boolean} ignoreDrmInfo\n * @return {shaka.dash.ContentProtection.Context}\n */\nshaka.dash.ContentProtection.parseFromAdaptationSet = function(\n elems, callback, ignoreDrmInfo) {\n var ContentProtection = shaka.dash.ContentProtection;\n var Functional = shaka.util.Functional;\n var MapUtils = shaka.util.MapUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var parsed = ContentProtection.parseElements_(elems);\n /** @type {Array.<shakaExtern.InitDataOverride>} */\n var defaultInit = null;\n /** @type {?string} */\n var defaultKeyId = null;\n /** @type {!Array.<shakaExtern.DrmInfo>} */\n var drmInfos = [];\n var parsedNonCenc = [];\n\n // Get the default key ID; if there are multiple, they must all match.\n var keyIds = parsed.map(function(elem) { return elem.keyId; })\n .filter(Functional.isNotNull);\n if (keyIds.length > 0) {\n defaultKeyId = keyIds[0];\n if (keyIds.some(Functional.isNotEqualFunc(defaultKeyId))) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_CONFLICTING_KEY_IDS);\n }\n }\n\n if (!ignoreDrmInfo) {\n // Find the default key ID and init data. Create a new array of all the\n // non-CENC elements.\n parsedNonCenc = parsed.filter(function(elem) {\n if (elem.schemeUri == ContentProtection.MP4Protection_) {\n goog.asserts.assert(!elem.init || elem.init.length,\n 'Init data must be null or non-empty.');\n defaultInit = elem.init || defaultInit;\n return false;\n } else {\n return true;\n }\n });\n\n if (parsedNonCenc.length > 0) {\n drmInfos = ContentProtection.convertElements_(\n defaultInit, callback, parsedNonCenc);\n\n // If there are no drmInfos after parsing, then add a dummy entry.\n // This may be removed in parseKeyIds.\n if (drmInfos.length == 0) {\n drmInfos = [ManifestParserUtils.createDrmInfo('', defaultInit)];\n }\n }\n }\n\n // If there are only CENC element(s) or ignoreDrmInfo flag is set, assume all\n // key-systems are supported.\n if (parsed.length > 0 && (ignoreDrmInfo || !parsedNonCenc.length)) {\n var keySystems = ContentProtection.defaultKeySystems_;\n drmInfos =\n MapUtils.values(keySystems)\n .map(function(keySystem) {\n return ManifestParserUtils.createDrmInfo(keySystem, defaultInit);\n });\n }\n\n // attach the default keyId, if it exists, to every initData\n if (defaultKeyId) {\n drmInfos.forEach(function(drmInfo) {\n drmInfo.initData.forEach(function(initData) {\n initData.keyId = defaultKeyId;\n });\n });\n }\n\n return {\n defaultKeyId: defaultKeyId,\n defaultInit: defaultInit,\n drmInfos: drmInfos,\n firstRepresentation: true\n };\n};\n\n\n/**\n * Parses the given ContentProtection elements found at the Representation\n * level. This may update the |context|.\n *\n * @param {!Array.<!Element>} elems\n * @param {shakaExtern.DashContentProtectionCallback} callback\n * @param {shaka.dash.ContentProtection.Context} context\n * @param {boolean} ignoreDrmInfo\n * @return {?string} The parsed key ID\n */\nshaka.dash.ContentProtection.parseFromRepresentation = function(\n elems, callback, context, ignoreDrmInfo) {\n var ContentProtection = shaka.dash.ContentProtection;\n var repContext = ContentProtection.parseFromAdaptationSet(\n elems, callback, ignoreDrmInfo);\n\n if (context.firstRepresentation) {\n var asUnknown = context.drmInfos.length == 1 &&\n !context.drmInfos[0].keySystem;\n var asUnencrypted = context.drmInfos.length == 0;\n var repUnencrypted = repContext.drmInfos.length == 0;\n\n // There are two cases when we need to replace the |drmInfos| in the context\n // with those in the Representation:\n // * The AdaptationSet does not list any ContentProtection.\n // * The AdaptationSet only lists unknown key-systems.\n if (asUnencrypted || (asUnknown && !repUnencrypted)) {\n context.drmInfos = repContext.drmInfos;\n }\n context.firstRepresentation = false;\n } else if (repContext.drmInfos.length > 0) {\n // If this is not the first Representation, then we need to remove entries\n // from the context that do not appear in this Representation.\n context.drmInfos = context.drmInfos.filter(function(asInfo) {\n return repContext.drmInfos.some(function(repInfo) {\n return repInfo.keySystem == asInfo.keySystem;\n });\n });\n // If we have filtered out all key-systems, throw an error.\n if (context.drmInfos.length == 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_COMMON_KEY_SYSTEM);\n }\n }\n\n return repContext.defaultKeyId || context.defaultKeyId;\n};\n\n\n/**\n * Creates DrmInfo objects from the given element.\n *\n * @param {Array.<shakaExtern.InitDataOverride>} defaultInit\n * @param {shakaExtern.DashContentProtectionCallback} callback\n * @param {!Array.<shaka.dash.ContentProtection.Element>} elements\n * @return {!Array.<shakaExtern.DrmInfo>}\n * @private\n */\nshaka.dash.ContentProtection.convertElements_ = function(\n defaultInit, callback, elements) {\n var Functional = shaka.util.Functional;\n return elements.map(\n /**\n * @param {shaka.dash.ContentProtection.Element} element\n * @return {!Array.<shakaExtern.DrmInfo>}\n */\n function(element) {\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var ContentProtection = shaka.dash.ContentProtection;\n var keySystem = ContentProtection.defaultKeySystems_[element.schemeUri];\n if (keySystem) {\n goog.asserts.assert(!element.init || element.init.length,\n 'Init data must be null or non-empty.');\n var initData = element.init || defaultInit;\n return [ManifestParserUtils.createDrmInfo(keySystem, initData)];\n } else {\n goog.asserts.assert(\n callback, 'ContentProtection callback is required');\n return callback(element.node) || [];\n }\n }).reduce(Functional.collapseArrays, []);\n};\n\n\n/**\n * Parses the given ContentProtection elements. If there is an error, it\n * removes those elements.\n *\n * @param {!Array.<!Element>} elems\n * @return {!Array.<shaka.dash.ContentProtection.Element>}\n * @private\n */\nshaka.dash.ContentProtection.parseElements_ = function(elems) {\n var Functional = shaka.util.Functional;\n return elems.map(\n /**\n * @param {!Element} elem\n * @return {?shaka.dash.ContentProtection.Element}\n */\n function(elem) {\n /** @type {?string} */\n var schemeUri = elem.getAttribute('schemeIdUri');\n /** @type {?string} */\n var keyId = elem.getAttribute('cenc:default_KID');\n /** @type {!Array.<string>} */\n var psshs = shaka.util.XmlUtils.findChildren(elem, 'cenc:pssh')\n .map(shaka.util.XmlUtils.getContents);\n\n if (!schemeUri) {\n shaka.log.error('Missing required schemeIdUri attribute on',\n 'ContentProtection element', elem);\n return null;\n }\n\n schemeUri = schemeUri.toLowerCase();\n if (keyId) {\n keyId = keyId.replace(/-/g, '').toLowerCase();\n if (keyId.indexOf(' ') >= 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED);\n }\n }\n\n /** @type {!Array.<shakaExtern.InitDataOverride>} */\n var init = [];\n try {\n init = psshs.map(function(pssh) {\n /** @type {shakaExtern.InitDataOverride} */\n var ret = {\n initDataType: 'cenc',\n initData: shaka.util.Uint8ArrayUtils.fromBase64(pssh),\n keyId: null\n };\n return ret;\n });\n } catch (e) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_PSSH_BAD_ENCODING);\n }\n\n /** @type {shaka.dash.ContentProtection.Element} */\n var element = {\n node: elem,\n schemeUri: schemeUri,\n keyId: keyId,\n init: (init.length > 0 ? init : null)\n };\n return element;\n }).filter(Functional.isNotNull);\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/content_protection.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.MpdUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.MpdUtils\n * @summary MPD processing utility functions.\n */\n\n\n/**\n * @typedef {{\n * start: number,\n * unscaledStart: number,\n * end: number\n * }}\n *\n * @description\n * Defines a time range of a media segment. Times are in seconds.\n *\n * @property {number} start\n * The start time of the range.\n * @property {number} unscaledStart\n * The start time of the range in representation timescale units.\n * @property {number} end\n * The end time (exclusive) of the range.\n */\nshaka.dash.MpdUtils.TimeRange;\n\n\n/**\n * @typedef {{\n * timescale: number,\n * segmentDuration: ?number,\n * startNumber: number,\n * presentationTimeOffset: number,\n * unscaledPresentationTimeOffset: number,\n * timeline: Array.<shaka.dash.MpdUtils.TimeRange>\n * }}\n *\n * @description\n * Contains common information between SegmentList and SegmentTemplate items.\n *\n * @property {number} timescale\n * The time-scale of the representation.\n * @property {?number} segmentDuration\n * The duration of the segments in seconds, if given.\n * @property {number} startNumber\n * The start number of the segments; 1 or greater.\n * @property {number} presentationTimeOffset\n * The presentationTimeOffset of the representation, in seconds.\n * @property {number} unscaledPresentationTimeOffset\n * The presentationTimeOffset of the representation, in timescale units.\n * @property {Array.<shaka.dash.MpdUtils.TimeRange>} timeline\n * The timeline of the representation, if given. Times in seconds.\n */\nshaka.dash.MpdUtils.SegmentInfo;\n\n\n/**\n * Fills a SegmentTemplate URI template. This function does not validate the\n * resulting URI.\n *\n * @param {string} uriTemplate\n * @param {?string} representationId\n * @param {?number} number\n * @param {?number} bandwidth\n * @param {?number} time\n * @return {string} A URI string.\n * @see ISO/IEC 23009-1:2014 section 5.3.9.4.4\n */\nshaka.dash.MpdUtils.fillUriTemplate = function(\n uriTemplate, representationId, number, bandwidth, time) {\n if (time != null) {\n goog.asserts.assert(Math.abs(time - Math.round(time)) < 0.2,\n 'Calculated $Time$ values must be close to integers!');\n time = Math.round(time);\n }\n\n /** @type {!Object.<string, ?number|?string>} */\n var valueTable = {\n 'RepresentationID': representationId,\n 'Number': number,\n 'Bandwidth': bandwidth,\n 'Time': time\n };\n\n var re = /\\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)d)?\\$/g;\n var uri = uriTemplate.replace(re, function(match, name, widthString) {\n if (match == '$$') {\n return '$';\n }\n\n var value = valueTable[name];\n goog.asserts.assert(value !== undefined, 'Unrecognized identifier');\n\n // Note that |value| may be 0 or ''.\n if (value == null) {\n shaka.log.warning(\n 'URL template does not have an available substitution for identifier',\n '\"' + name + '\":',\n uriTemplate);\n return match;\n }\n\n if (name == 'RepresentationID' && widthString) {\n shaka.log.warning(\n 'URL template should not contain a width specifier for identifier',\n '\"RepresentationID\":',\n uriTemplate);\n widthString = undefined;\n }\n\n var valueString = value.toString();\n\n // Create padding string.\n var width = window.parseInt(widthString, 10) || 1;\n var paddingSize = Math.max(0, width - valueString.length);\n var padding = (new Array(paddingSize + 1)).join('0');\n\n return padding + valueString;\n });\n\n return uri;\n};\n\n\n/**\n * Expands a SegmentTimeline into an array-based timeline. The results are in\n * seconds.\n *\n * @param {!Element} segmentTimeline\n * @param {number} timescale\n * @param {number} presentationTimeOffset\n * @param {number} periodDuration The Period's duration in seconds.\n * Infinity indicates that the Period continues indefinitely.\n * @return {!Array.<shaka.dash.MpdUtils.TimeRange>}\n */\nshaka.dash.MpdUtils.createTimeline = function(\n segmentTimeline, timescale, presentationTimeOffset, periodDuration) {\n goog.asserts.assert(\n timescale > 0 && timescale < Infinity,\n 'timescale must be a positive, finite integer');\n goog.asserts.assert(periodDuration > 0,\n 'period duration must be a positive integer');\n\n // Alias.\n var XmlUtils = shaka.util.XmlUtils;\n\n var timePoints = XmlUtils.findChildren(segmentTimeline, 'S');\n\n /** @type {!Array.<shaka.dash.MpdUtils.TimeRange>} */\n var timeline = [];\n var lastEndTime = 0;\n\n for (var i = 0; i < timePoints.length; ++i) {\n var timePoint = timePoints[i];\n var t = XmlUtils.parseAttr(timePoint, 't', XmlUtils.parseNonNegativeInt);\n var d = XmlUtils.parseAttr(timePoint, 'd', XmlUtils.parseNonNegativeInt);\n var r = XmlUtils.parseAttr(timePoint, 'r', XmlUtils.parseInt);\n\n // Adjust start considering the presentation time offset\n if (t != null)\n t -= presentationTimeOffset;\n\n if (!d) {\n shaka.log.warning(\n '\"S\" element must have a duration:',\n 'ignoring the remaining \"S\" elements.',\n timePoint);\n return timeline;\n }\n\n var startTime = t != null ? t : lastEndTime;\n\n var repeat = r || 0;\n if (repeat < 0) {\n if (i + 1 < timePoints.length) {\n var nextTimePoint = timePoints[i + 1];\n var nextStartTime = XmlUtils.parseAttr(\n nextTimePoint, 't', XmlUtils.parseNonNegativeInt);\n if (nextStartTime == null) {\n shaka.log.warning(\n '\"S\" element cannot have a negative repeat',\n 'if the next \"S\" element does not have a valid start time:',\n 'ignoring the remaining \"S\" elements.',\n timePoint);\n return timeline;\n } else if (startTime >= nextStartTime) {\n shaka.log.warning(\n '\"S\" element cannot have a negative repeat',\n 'if its start time exceeds the next \"S\" element\\'s start time:',\n 'ignoring the remaining \"S\" elements.',\n timePoint);\n return timeline;\n }\n repeat = Math.ceil((nextStartTime - startTime) / d) - 1;\n } else {\n if (periodDuration == Infinity) {\n // The DASH spec. actually allows the last \"S\" element to have a\n // negative repeat value even when the Period has an infinite\n // duration. No one uses this feature and no one ever should, ever.\n shaka.log.warning(\n 'The last \"S\" element cannot have a negative repeat',\n 'if the Period has an infinite duration:',\n 'ignoring the last \"S\" element.',\n timePoint);\n return timeline;\n } else if (startTime / timescale >= periodDuration) {\n shaka.log.warning(\n 'The last \"S\" element cannot have a negative repeat',\n 'if its start time exceeds the Period\\'s duration:',\n 'igoring the last \"S\" element.',\n timePoint);\n return timeline;\n }\n repeat = Math.ceil((periodDuration * timescale - startTime) / d) - 1;\n }\n }\n\n // The end of the last segment may end before the start of the current\n // segment (a gap) or may end after the start of the current segment (an\n // overlap). If there is a gap/overlap then stretch/compress the end of\n // the last segment to the start of the current segment.\n //\n // Note: it is possible to move the start of the current segment to the\n // end of the last segment, but this would complicate the computation of\n // the $Time$ placeholder later on.\n if ((timeline.length > 0) && (startTime != lastEndTime)) {\n var delta = startTime - lastEndTime;\n\n if (Math.abs(delta / timescale) >=\n shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS) {\n shaka.log.warning(\n 'SegmentTimeline contains a large gap/overlap:',\n 'the content may have errors in it.',\n timePoint);\n }\n\n timeline[timeline.length - 1].end = startTime / timescale;\n }\n\n for (var j = 0; j <= repeat; ++j) {\n var endTime = startTime + d;\n var item = {\n start: startTime / timescale,\n end: endTime / timescale,\n unscaledStart: startTime\n };\n timeline.push(item);\n\n startTime = endTime;\n lastEndTime = endTime;\n }\n }\n\n return timeline;\n};\n\n\n/**\n * Parses common segment info for SegmentList and SegmentTemplate.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * Gets the element that contains the segment info.\n * @return {shaka.dash.MpdUtils.SegmentInfo}\n */\nshaka.dash.MpdUtils.parseSegmentInfo = function(context, callback) {\n goog.asserts.assert(\n callback(context.representation),\n 'There must be at least one element of the given type.');\n var MpdUtils = shaka.dash.MpdUtils;\n var XmlUtils = shaka.util.XmlUtils;\n\n var timescaleStr = MpdUtils.inheritAttribute(context, callback, 'timescale');\n var timescale = 1;\n if (timescaleStr) {\n timescale = XmlUtils.parsePositiveInt(timescaleStr) || 1;\n }\n\n var durationStr = MpdUtils.inheritAttribute(context, callback, 'duration');\n var segmentDuration = XmlUtils.parsePositiveInt(durationStr || '');\n if (segmentDuration) {\n segmentDuration /= timescale;\n }\n\n var startNumberStr =\n MpdUtils.inheritAttribute(context, callback, 'startNumber');\n var presentationTimeOffset =\n MpdUtils.inheritAttribute(context, callback, 'presentationTimeOffset');\n var startNumber = XmlUtils.parseNonNegativeInt(startNumberStr || '');\n if (startNumberStr == null || startNumber == null)\n startNumber = 1;\n\n var timelineNode =\n MpdUtils.inheritChild(context, callback, 'SegmentTimeline');\n /** @type {Array.<shaka.dash.MpdUtils.TimeRange>} */\n var timeline = null;\n if (timelineNode) {\n timeline = MpdUtils.createTimeline(\n timelineNode, timescale, Number(presentationTimeOffset),\n context.periodInfo.duration || Infinity);\n }\n\n var pto = (Number(presentationTimeOffset) / timescale) || 0;\n return {\n timescale: timescale,\n segmentDuration: segmentDuration,\n startNumber: startNumber,\n presentationTimeOffset: pto,\n unscaledPresentationTimeOffset: Number(presentationTimeOffset),\n timeline: timeline\n };\n};\n\n\n/**\n * Searches the inheritance for a Segment* with the given attribute.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * Gets the Element that contains the attribute to inherit.\n * @param {string} attribute\n * @return {?string}\n */\nshaka.dash.MpdUtils.inheritAttribute = function(context, callback, attribute) {\n var Functional = shaka.util.Functional;\n goog.asserts.assert(\n callback(context.representation),\n 'There must be at least one element of the given type');\n\n /** @type {!Array.<!Element>} */\n var nodes = [\n callback(context.representation),\n callback(context.adaptationSet),\n callback(context.period)\n ].filter(Functional.isNotNull);\n\n return nodes\n .map(function(s) { return s.getAttribute(attribute); })\n .reduce(function(all, part) { return all || part; });\n};\n\n\n/**\n * Searches the inheritance for a Segment* with the given child.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * Gets the Element that contains the child to inherit.\n * @param {string} child\n * @return {Element}\n */\nshaka.dash.MpdUtils.inheritChild = function(context, callback, child) {\n var Functional = shaka.util.Functional;\n goog.asserts.assert(\n callback(context.representation),\n 'There must be at least one element of the given type');\n\n /** @type {!Array.<!Element>} */\n var nodes = [\n callback(context.representation),\n callback(context.adaptationSet),\n callback(context.period)\n ].filter(Functional.isNotNull);\n\n var XmlUtils = shaka.util.XmlUtils;\n return nodes\n .map(function(s) { return XmlUtils.findChild(s, child); })\n .reduce(function(all, part) { return all || part; });\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/mpd_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.InitSegmentReference');\ngoog.provide('shaka.media.SegmentReference');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Creates an InitSegmentReference, which provides the location to an\n * initialization segment.\n *\n * @param {function():!Array.<string>} uris\n * A function that creates the URIs of the resource containing the segment.\n * @param {number} startByte The offset from the start of the resource to the\n * start of the segment.\n * @param {?number} endByte The offset from the start of the resource to the\n * end of the segment, inclusive. null indicates that the segment extends\n * to the end of the resource.\n *\n * @constructor\n * @struct\n * @export\n */\nshaka.media.InitSegmentReference = function(uris, startByte, endByte) {\n /** @type {function():!Array.<string>} */\n this.getUris = uris;\n\n /** @const {number} */\n this.startByte = startByte;\n\n /** @const {?number} */\n this.endByte = endByte;\n};\n\n\n\n/**\n * Creates a SegmentReference, which provides the start time, end time, and\n * location to a media segment.\n *\n * @param {number} position The segment's position within a particular Period.\n * The following should hold true between any two SegmentReferences from the\n * same Period, r1 and r2:\n * IF r2.position > r1.position THEN\n * [ (r2.startTime > r1.startTime) OR\n * (r2.startTime == r1.startTime AND r2.endTime >= r1.endTime) ]\n * @param {number} startTime The segment's start time in seconds, relative to\n * the start of a particular Period.\n * @param {number} endTime The segment's end time in seconds, relative to\n * the start of a particular Period. The segment ends the instant before\n * this time, so |endTime| must be strictly greater than |startTime|.\n * @param {function():!Array.<string>} uris\n * A function that creates the URIs of the resource containing the segment.\n * @param {number} startByte The offset from the start of the resource to the\n * start of the segment.\n * @param {?number} endByte The offset from the start of the resource to the\n * end of the segment, inclusive. null indicates that the segment extends\n * to the end of the resource.\n *\n * @constructor\n * @struct\n * @export\n */\nshaka.media.SegmentReference = function(\n position, startTime, endTime, uris, startByte, endByte) {\n goog.asserts.assert(startTime < endTime,\n 'startTime must be less than endTime');\n goog.asserts.assert((startByte < endByte) || (endByte == null),\n 'startByte must be < endByte');\n /** @const {number} */\n this.position = position;\n\n /** @const {number} */\n this.startTime = startTime;\n\n /** @const {number} */\n this.endTime = endTime;\n\n /** @type {function():!Array.<string>} */\n this.getUris = uris;\n\n /** @const {number} */\n this.startByte = startByte;\n\n /** @const {?number} */\n this.endByte = endByte;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/segment_reference.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.DataViewReader');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\n\n\n\n/**\n * Creates a DataViewReader, which abstracts a DataView object.\n *\n * @param {!DataView} dataView The DataView.\n * @param {shaka.util.DataViewReader.Endianness} endianness The endianness.\n *\n * @struct\n * @constructor\n * @export\n */\nshaka.util.DataViewReader = function(dataView, endianness) {\n /** @private {!DataView} */\n this.dataView_ = dataView;\n\n /** @private {boolean} */\n this.littleEndian_ =\n endianness == shaka.util.DataViewReader.Endianness.LITTLE_ENDIAN;\n\n /** @private {number} */\n this.position_ = 0;\n};\n\n\n/**\n * Endianness.\n * @enum {number}\n * @export\n */\nshaka.util.DataViewReader.Endianness = {\n BIG_ENDIAN: 0,\n LITTLE_ENDIAN: 1\n};\n\n\n/**\n * @return {boolean} True if the reader has more data, false otherwise.\n * @export\n */\nshaka.util.DataViewReader.prototype.hasMoreData = function() {\n return this.position_ < this.dataView_.byteLength;\n};\n\n\n/**\n * Gets the current byte position.\n * @return {number}\n * @export\n */\nshaka.util.DataViewReader.prototype.getPosition = function() {\n return this.position_;\n};\n\n\n/**\n * Gets the byte length of the DataView.\n * @return {number}\n * @export\n */\nshaka.util.DataViewReader.prototype.getLength = function() {\n return this.dataView_.byteLength;\n};\n\n\n/**\n * Reads an unsigned 8 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint8 = function() {\n try {\n var value = this.dataView_.getUint8(this.position_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 1;\n return value;\n};\n\n\n/**\n * Reads an unsigned 16 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint16 = function() {\n try {\n var value = this.dataView_.getUint16(this.position_, this.littleEndian_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 2;\n return value;\n};\n\n\n/**\n * Reads an unsigned 32 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint32 = function() {\n try {\n var value = this.dataView_.getUint32(this.position_, this.littleEndian_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 4;\n return value;\n};\n\n\n/**\n * Reads a signed 32 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readInt32 = function() {\n try {\n var value = this.dataView_.getInt32(this.position_, this.littleEndian_);\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n this.position_ += 4;\n return value;\n};\n\n\n/**\n * Reads an unsigned 64 bit integer, and advances the reader.\n * @return {number} The integer.\n * @throws {shaka.util.Error} when reading past the end of the data view or\n * when reading an integer too large to store accurately in JavaScript.\n * @export\n */\nshaka.util.DataViewReader.prototype.readUint64 = function() {\n var low, high;\n\n try {\n if (this.littleEndian_) {\n low = this.dataView_.getUint32(this.position_, true);\n high = this.dataView_.getUint32(this.position_ + 4, true);\n } else {\n high = this.dataView_.getUint32(this.position_, false);\n low = this.dataView_.getUint32(this.position_ + 4, false);\n }\n } catch (exception) {\n this.throwOutOfBounds_();\n }\n\n if (high > 0x1FFFFF) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.JS_INTEGER_OVERFLOW);\n }\n\n this.position_ += 8;\n\n // NOTE: This is subtle, but in JavaScript you can't shift left by 32 and get\n // the full range of 53-bit values possible. You must multiply by 2^32.\n return (high * Math.pow(2, 32)) + low;\n};\n\n\n/**\n * Reads the specified number of raw bytes.\n * @param {number} bytes The number of bytes to read.\n * @return {!Uint8Array}\n * @throws {shaka.util.Error} when reading past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.readBytes = function(bytes) {\n goog.asserts.assert(bytes > 0, 'Bad call to DataViewReader.readBytes');\n if (this.position_ + bytes > this.dataView_.byteLength) {\n this.throwOutOfBounds_();\n }\n var value = this.dataView_.buffer.slice(\n this.position_, this.position_ + bytes);\n this.position_ += bytes;\n return new Uint8Array(value);\n};\n\n\n/**\n * Skips the specified number of bytes.\n * @param {number} bytes The number of bytes to skip.\n * @throws {shaka.util.Error} when skipping past the end of the data view.\n * @export\n */\nshaka.util.DataViewReader.prototype.skip = function(bytes) {\n goog.asserts.assert(bytes >= 0, 'Bad call to DataViewReader.skip');\n if (this.position_ + bytes > this.dataView_.byteLength) {\n this.throwOutOfBounds_();\n }\n this.position_ += bytes;\n};\n\n\n/**\n * Keeps reading until it reaches a byte that equals to zero. The text is\n * assumed to be UTF-8.\n * @return {string}\n * @export\n */\nshaka.util.DataViewReader.prototype.readTerminatedString = function() {\n var start = this.position_;\n while (this.hasMoreData()) {\n var value = this.dataView_.getUint8(this.position_);\n if (value == 0) break;\n this.position_ += 1;\n }\n\n var ret = this.dataView_.buffer.slice(start, this.position_);\n // skip string termination\n this.position_ += 1;\n return shaka.util.StringUtils.fromUTF8(ret);\n};\n\n\n/**\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.util.DataViewReader.prototype.throwOutOfBounds_ = function() {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.BUFFER_READ_OUT_OF_BOUNDS);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/data_view_reader.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Mp4Parser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.DataViewReader');\n\n\n\n/**\n * Create a new MP4 Parser\n * @struct\n * @constructor\n * @export\n */\nshaka.util.Mp4Parser = function() {\n /**\n * @type {!Object.<number, shaka.util.Mp4Parser.BoxType_>}\n * @private\n */\n this.headers_ = [];\n\n /**\n * @type {!Object.<number, !shaka.util.Mp4Parser.CallbackType>}\n * @private\n */\n this.boxDefinitions_ = [];\n};\n\n\n/**\n * @typedef {{\n * parser: !shaka.util.Mp4Parser,\n * start: number,\n * size: number,\n * version: ?number,\n * flags: ?number,\n * reader: !shaka.util.DataViewReader\n * }}\n *\n * @property {!shaka.util.Mp4Parser} parser\n * The parser that parsed this box. The parser can be used to parse child\n * boxes where the configuration of the current parser is needed to parsed\n * other boxes.\n * @property {number} start\n * The start of this box (before the header) in the original buffer. This\n * start position is the absolute position.\n * @property {number} size\n * The size of this box (including the header).\n * @property {?number} version\n * The version for a full box, null for basic boxes.\n * @property {?number} flags\n * The flags for a full box, null for basic boxes.\n * @property {!shaka.util.DataViewReader} reader\n * The reader for this box is only for this box. Reading or not reading to\n * the end will have no affect on the parser reading other sibling boxes.\n * @exportInterface\n */\nshaka.util.Mp4Parser.ParsedBox;\n\n\n/**\n * @typedef {function(!shaka.util.Mp4Parser.ParsedBox)}\n * @exportInterface\n */\nshaka.util.Mp4Parser.CallbackType;\n\n\n/**\n * An enum used to track the type of box so that the correct values can be\n * read from the header.\n *\n * @enum {number}\n * @private\n */\nshaka.util.Mp4Parser.BoxType_ = {\n BASIC_BOX: 0,\n FULL_BOX: 1\n};\n\n\n/**\n * Delcare a box type as a Box.\n *\n * @param {string} type\n * @param {!shaka.util.Mp4Parser.CallbackType} definition\n * @return {!shaka.util.Mp4Parser}\n * @export\n */\nshaka.util.Mp4Parser.prototype.box = function(type, definition) {\n var typeCode = shaka.util.Mp4Parser.typeFromString_(type);\n this.headers_[typeCode] = shaka.util.Mp4Parser.BoxType_.BASIC_BOX;\n this.boxDefinitions_[typeCode] = definition;\n return this;\n};\n\n\n/**\n * Declare a box type as a Full Box.\n *\n * @param {string} type\n * @param {!shaka.util.Mp4Parser.CallbackType} definition\n * @return {!shaka.util.Mp4Parser}\n * @export\n */\nshaka.util.Mp4Parser.prototype.fullBox = function(type, definition) {\n var typeCode = shaka.util.Mp4Parser.typeFromString_(type);\n this.headers_[typeCode] = shaka.util.Mp4Parser.BoxType_.FULL_BOX;\n this.boxDefinitions_[typeCode] = definition;\n return this;\n};\n\n\n/**\n * Parse the given data using the added callbacks.\n *\n * @param {!ArrayBuffer} data\n * @export\n */\nshaka.util.Mp4Parser.prototype.parse = function(data) {\n var reader = new shaka.util.DataViewReader(\n new DataView(data),\n shaka.util.DataViewReader.Endianness.BIG_ENDIAN);\n\n while (reader.hasMoreData()) {\n this.parseNext(0, reader);\n }\n};\n\n\n/**\n * Parse the next box on the current level.\n *\n * @param {number} absStart The absolute start position in the original\n * byte array\n * @param {!shaka.util.DataViewReader} reader\n * @export\n */\nshaka.util.Mp4Parser.prototype.parseNext = function(absStart, reader) {\n var start = reader.getPosition();\n\n var size = reader.readUint32();\n var type = reader.readUint32();\n\n switch (size) {\n case 0:\n size = reader.getLength() - start;\n break;\n case 1:\n size = reader.readUint64();\n break;\n }\n\n var boxDefinition = this.boxDefinitions_[type];\n\n if (boxDefinition) {\n var version = null;\n var flags = null;\n\n if (this.headers_[type] == shaka.util.Mp4Parser.BoxType_.FULL_BOX) {\n var versionAndFlags = reader.readUint32();\n version = versionAndFlags >>> 24;\n flags = versionAndFlags & 0xFFFFFF;\n }\n\n // Read the whole payload so that the current level can be safely read\n // regardless of how the payload is parsed.\n var payloadSize = start + size - reader.getPosition();\n var payload = (payloadSize > 0) ?\n reader.readBytes(payloadSize).buffer :\n new ArrayBuffer(0);\n\n var payloadReader = new shaka.util.DataViewReader(\n new DataView(payload),\n shaka.util.DataViewReader.Endianness.BIG_ENDIAN);\n\n /** @type {shaka.util.Mp4Parser.ParsedBox } */\n var box = {\n parser: this,\n version: version,\n flags: flags,\n reader: payloadReader,\n size: size,\n start: start + absStart\n };\n\n boxDefinition(box);\n } else {\n // Move the read head to be at the end of the box.\n reader.skip(start + size - reader.getPosition());\n }\n};\n\n\n/**\n * A callback that tells the Mp4 parser to treat the body of a box as a series\n * of boxes. The number of boxes is limited by the size of the parent box.\n *\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @export\n */\nshaka.util.Mp4Parser.children = function(box) {\n while (box.reader.hasMoreData()) {\n box.parser.parseNext(box.start, box.reader);\n }\n};\n\n\n/**\n * A callback that tells the Mp4 parser to treat the body of a box as a sample\n * description. A sample description box has a fixed number of children. The\n * number of children is represented by a 4 byte unsigned integer. Each child\n * is a box.\n *\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @export\n */\nshaka.util.Mp4Parser.sampleDescription = function(box) {\n for (var count = box.reader.readUint32(); count > 0; count -= 1) {\n box.parser.parseNext(box.start, box.reader);\n }\n};\n\n\n/**\n * Create a callback that tells the Mp4 parser to treat the body of a box as a\n * binary blob and how to handle it.\n *\n * @param {!function(!Uint8Array)} callback\n * @return {!shaka.util.Mp4Parser.CallbackType}\n * @export\n */\nshaka.util.Mp4Parser.allData = function(callback) {\n return function(box) {\n var all = box.reader.getLength() - box.reader.getPosition();\n callback(box.reader.readBytes(all));\n };\n};\n\n\n/**\n * Convert an ascii string name to the integer type for a box.\n *\n * @param {string} name The name of the box. The name must be four\n * characters long.\n * @return {number}\n * @private\n */\nshaka.util.Mp4Parser.typeFromString_ = function(name) {\n goog.asserts.assert(\n name.length == 4,\n 'Mp4 box names must be 4 characters long');\n\n var code = 0;\n for (var i = 0; i < name.length; i++) {\n code = (code << 8) | name.charCodeAt(i);\n }\n return code;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/mp4_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Mp4SegmentIndexParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Mp4Parser');\n\n\n/**\n * Parses SegmentReferences from an ISO BMFF SIDX structure.\n * @param {!ArrayBuffer} sidxData The MP4's container's SIDX.\n * @param {number} sidxOffset The SIDX's offset, in bytes, from the start of\n * the MP4 container.\n * @param {!Array.<string>} uris The possible locations of the MP4 file that\n * contains the segments.\n * @param {number} presentationTimeOffset\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @throws {shaka.util.Error}\n */\nshaka.media.Mp4SegmentIndexParser = function(\n sidxData, sidxOffset, uris, presentationTimeOffset) {\n\n var Mp4SegmentIndexParser = shaka.media.Mp4SegmentIndexParser;\n\n var references;\n\n var parser = new shaka.util.Mp4Parser()\n .fullBox('sidx', function(box) {\n references = Mp4SegmentIndexParser.parseSIDX_(\n sidxOffset,\n presentationTimeOffset,\n uris,\n box);\n });\n\n if (sidxData) {\n parser.parse(sidxData);\n }\n\n if (references) {\n return references;\n } else {\n shaka.log.error('Invalid box type, expected \"sidx\".');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MP4_SIDX_WRONG_BOX_TYPE);\n }\n};\n\n\n/**\n * Parse a SIDX box from the given reader.\n *\n * @param {number} sidxOffset\n * @param {number} presentationTimeOffset\n * @param {!Array.<string>} uris The possible locations of the MP4 file that\n * contains the segments.\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.media.Mp4SegmentIndexParser.parseSIDX_ = function(\n sidxOffset,\n presentationTimeOffset,\n uris,\n box) {\n\n goog.asserts.assert(\n box.version != null,\n 'SIDX is a full box and should have a valid version.');\n\n var references = [];\n\n // Parse the SIDX structure.\n // Skip reference_ID (32 bits).\n box.reader.skip(4);\n\n var timescale = box.reader.readUint32();\n\n if (timescale == 0) {\n shaka.log.error('Invalid timescale.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MP4_SIDX_INVALID_TIMESCALE);\n }\n\n var earliestPresentationTime;\n var firstOffset;\n\n if (box.version == 0) {\n earliestPresentationTime = box.reader.readUint32();\n firstOffset = box.reader.readUint32();\n } else {\n earliestPresentationTime = box.reader.readUint64();\n firstOffset = box.reader.readUint64();\n }\n\n // Skip reserved (16 bits).\n box.reader.skip(2);\n\n // Add references.\n var referenceCount = box.reader.readUint16();\n\n // Substract the presentationTimeOffset\n var unscaledStartTime = earliestPresentationTime - presentationTimeOffset;\n var startByte = sidxOffset + box.size + firstOffset;\n\n for (var i = 0; i < referenceCount; i++) {\n // |chunk| is 1 bit for |referenceType|, and 31 bits for |referenceSize|.\n var chunk = box.reader.readUint32();\n var referenceType = (chunk & 0x80000000) >>> 31;\n var referenceSize = chunk & 0x7FFFFFFF;\n\n var subsegmentDuration = box.reader.readUint32();\n\n // Skipping 1 bit for |startsWithSap|, 3 bits for |sapType|, and 28 bits\n // for |sapDelta|.\n box.reader.skip(4);\n\n // If |referenceType| is 1 then the reference is to another SIDX.\n // We do not support this.\n if (referenceType == 1) {\n shaka.log.error('Heirarchical SIDXs are not supported.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.MP4_SIDX_TYPE_NOT_SUPPORTED);\n }\n\n references.push(\n new shaka.media.SegmentReference(\n references.length,\n unscaledStartTime / timescale,\n (unscaledStartTime + subsegmentDuration) / timescale,\n function() { return uris; },\n startByte,\n startByte + referenceSize - 1));\n\n unscaledStartTime += subsegmentDuration;\n startByte += referenceSize;\n }\n\n return references;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/mp4_segment_index_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.SegmentIndex');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n\n/**\n * Creates a SegmentIndex.\n *\n * @param {!Array.<!shaka.media.SegmentReference>} references The list of\n * SegmentReferences, which must be sorted first by their start times\n * (ascending) and second by their end times (ascending), and have\n * continuous, increasing positions.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n * @export\n */\nshaka.media.SegmentIndex = function(references) {\n if (!COMPILED) {\n shaka.media.SegmentIndex.assertCorrectReferences_(references);\n }\n\n /** @private {Array.<!shaka.media.SegmentReference>} */\n this.references_ = references;\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.media.SegmentIndex.prototype.destroy = function() {\n this.references_ = null;\n return Promise.resolve();\n};\n\n\n/**\n * Finds the position of the segment for the given time, in seconds, relative\n * to the start of a particular Period. Returns the position of the segment\n * with the largest end time if more than one segment is known for the given\n * time.\n *\n * @param {number} time\n * @return {?number} The position of the segment, or null\n * if the position of the segment could not be determined.\n * @export\n */\nshaka.media.SegmentIndex.prototype.find = function(time) {\n // For live streams, searching from the end is faster. For VOD, it balances\n // out either way. In both cases, references_.length is small enough that the\n // difference isn't huge.\n for (var i = this.references_.length - 1; i >= 0; --i) {\n var r = this.references_[i];\n // Note that a segment ends immediately before the end time.\n if ((time >= r.startTime) && (time < r.endTime)) {\n return r.position;\n }\n }\n if (this.references_.length && time < this.references_[0].startTime)\n return this.references_[0].position;\n\n return null;\n};\n\n\n/**\n * Gets the SegmentReference for the segment at the given position.\n *\n * @param {number} position The position of the segment.\n * @return {shaka.media.SegmentReference} The SegmentReference, or null if\n * no such SegmentReference exists.\n * @export\n */\nshaka.media.SegmentIndex.prototype.get = function(position) {\n if (this.references_.length == 0)\n return null;\n\n var index = position - this.references_[0].position;\n if (index < 0 || index >= this.references_.length)\n return null;\n\n return this.references_[index];\n};\n\n\n/**\n * Merges the given SegmentReferences. Supports extending the original\n * references only. Will not replace old references or interleave new ones.\n *\n * @param {!Array.<!shaka.media.SegmentReference>} references The list of\n * SegmentReferences, which must be sorted first by their start times\n * (ascending) and second by their end times (ascending), and have\n * continuous, increasing positions.\n * @export\n */\nshaka.media.SegmentIndex.prototype.merge = function(references) {\n if (!COMPILED) {\n shaka.media.SegmentIndex.assertCorrectReferences_(references);\n }\n\n var newReferences = [];\n var i = 0;\n var j = 0;\n\n while ((i < this.references_.length) && (j < references.length)) {\n var r1 = this.references_[i];\n var r2 = references[j];\n\n if (r1.startTime < r2.startTime) {\n newReferences.push(r1);\n i++;\n } else if (r1.startTime > r2.startTime) {\n // Drop the new reference if it would have to be interleaved with the\n // old one. Issue a warning, since this is not a supported update.\n shaka.log.warning('Refusing to rewrite original references on update!');\n j++;\n } else {\n // When period is changed, fitSegmentReference will expand the last\n // segment to the start of the next period. So, it is valid to have end\n // time updated to the last segment reference in a period\n if (Math.abs(r1.endTime - r2.endTime) > 0.1) {\n goog.asserts.assert(r2.endTime > r1.endTime &&\n i == this.references_.length - 1 &&\n j == references.length - 1,\n 'This should be an update of the last segment in a period');\n newReferences.push(r2);\n } else {\n // Drop the new reference if there's an old reference with the\n // same time.\n newReferences.push(r1);\n }\n i++;\n j++;\n }\n }\n\n while (i < this.references_.length) {\n newReferences.push(this.references_[i++]);\n }\n\n if (newReferences.length) {\n // The rest of these refs may need to be renumbered.\n var nextPosition = newReferences[newReferences.length - 1].position + 1;\n while (j < references.length) {\n var r = references[j++];\n var r2 = new shaka.media.SegmentReference(nextPosition++,\n r.startTime, r.endTime, r.getUris, r.startByte, r.endByte);\n newReferences.push(r2);\n }\n } else {\n newReferences = references;\n }\n\n if (!COMPILED) {\n shaka.media.SegmentIndex.assertCorrectReferences_(newReferences);\n }\n\n this.references_ = newReferences;\n};\n\n\n/**\n * Removes all SegmentReferences that end before the given time.\n *\n * @param {number} time The time in seconds.\n * @export\n */\nshaka.media.SegmentIndex.prototype.evict = function(time) {\n for (var i = 0; i < this.references_.length; ++i) {\n if (this.references_[i].endTime > time)\n break;\n }\n this.references_.splice(0, i);\n};\n\n\n/**\n * Expands the first SegmentReference so it begins at the start of its Period\n * if it already begins close to the start of its Period, and expands or\n * contracts the last SegmentReference so it ends at the end of its Period for\n * VOD presentations.\n *\n * @param {?number} periodDuration\n */\nshaka.media.SegmentIndex.prototype.fit = function(periodDuration) {\n if (this.references_.length == 0)\n return;\n\n /** @const {number} */\n var tolerance = shaka.util.ManifestParserUtils.GAP_OVERLAP_TOLERANCE_SECONDS;\n\n goog.asserts.assert(periodDuration != null,\n 'Period duration must be known for static content!');\n goog.asserts.assert(periodDuration != Infinity,\n 'Period duration must be finite for static content!');\n\n var lastReference = this.references_[this.references_.length - 1];\n\n // Sanity check.\n goog.asserts.assert(\n lastReference.startTime < periodDuration,\n 'lastReference cannot begin after the end of the Period');\n if (lastReference.startTime > periodDuration) return;\n\n // Log warning if necessary.\n if (lastReference.endTime <= periodDuration - tolerance) {\n shaka.log.warning(\n 'The last segment should not end before the end of the Period.',\n lastReference);\n } else if (lastReference.endTime >= periodDuration + tolerance) {\n shaka.log.warning(\n 'The last segment should not end after the end of the Period.',\n lastReference);\n }\n\n // Adjust the last SegmentReference.\n this.references_[this.references_.length - 1] =\n new shaka.media.SegmentReference(\n lastReference.position,\n lastReference.startTime, periodDuration,\n lastReference.getUris,\n lastReference.startByte, lastReference.endByte);\n};\n\n\nif (!COMPILED) {\n /**\n * Asserts that the given SegmentReferences are sorted and have continuous,\n * increasing positions.\n *\n * @param {!Array.<shaka.media.SegmentReference>} references\n * @private\n */\n shaka.media.SegmentIndex.assertCorrectReferences_ = function(references) {\n goog.asserts.assert(references.every(function(r2, i) {\n if (i == 0) return true;\n var r1 = references[i - 1];\n if (r2.position != r1.position + 1) return false;\n if (r1.startTime < r2.startTime) {\n return true;\n } else if (r1.startTime > r2.startTime) {\n return false;\n } else {\n if (r1.endTime <= r2.endTime) {\n return true;\n } else {\n return false;\n }\n }\n }), 'SegmentReferences are incorrect');\n };\n}\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/segment_index.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.EbmlElement');\ngoog.provide('shaka.util.EbmlParser');\n\ngoog.require('shaka.util.DataViewReader');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n\n/**\n * Creates an Extensible Binary Markup Language (EBML) parser.\n * @param {!DataView} dataView The EBML data.\n * @constructor\n * @struct\n */\nshaka.util.EbmlParser = function(dataView) {\n /** @private {!DataView} */\n this.dataView_ = dataView;\n\n /** @private {!shaka.util.DataViewReader} */\n this.reader_ = new shaka.util.DataViewReader(\n dataView,\n shaka.util.DataViewReader.Endianness.BIG_ENDIAN);\n\n // If not already constructed, build a list of EBML dynamic size constants.\n // This is not done at load-time to avoid exceptions on unsupported browsers.\n if (!shaka.util.EbmlParser.DYNAMIC_SIZES) {\n shaka.util.EbmlParser.DYNAMIC_SIZES = [\n new Uint8Array([0xff]),\n new Uint8Array([0x7f, 0xff]),\n new Uint8Array([0x3f, 0xff, 0xff]),\n new Uint8Array([0x1f, 0xff, 0xff, 0xff]),\n new Uint8Array([0x0f, 0xff, 0xff, 0xff, 0xff]),\n new Uint8Array([0x07, 0xff, 0xff, 0xff, 0xff, 0xff]),\n new Uint8Array([0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]),\n new Uint8Array([0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])\n ];\n }\n};\n\n\n/** @const {!Array.<!Uint8Array>} */\nshaka.util.EbmlParser.DYNAMIC_SIZES;\n\n\n/**\n * @return {boolean} True if the parser has more data, false otherwise.\n */\nshaka.util.EbmlParser.prototype.hasMoreData = function() {\n return this.reader_.hasMoreData();\n};\n\n\n/**\n * Parses an EBML element from the parser's current position, and advances\n * the parser.\n * @return {!shaka.util.EbmlElement} The EBML element.\n * @throws {shaka.util.Error}\n * @see http://matroska.org/technical/specs/rfc/index.html\n */\nshaka.util.EbmlParser.prototype.parseElement = function() {\n var id = this.parseId_();\n\n // Parse the element's size.\n var vint = this.parseVint_();\n var size;\n if (shaka.util.EbmlParser.isDynamicSizeValue_(vint)) {\n // If this has an unknown size, assume that it takes up the rest of the\n // data.\n size = this.dataView_.byteLength - this.reader_.getPosition();\n } else {\n size = shaka.util.EbmlParser.getVintValue_(vint);\n }\n\n // Note that if the element's size is larger than the buffer then we are\n // parsing a \"partial element\". This may occur if for example we are\n // parsing the beginning of some WebM container data, but our buffer does\n // not contain the entire WebM container data.\n var elementSize =\n this.reader_.getPosition() + size <= this.dataView_.byteLength ?\n size :\n this.dataView_.byteLength - this.reader_.getPosition();\n\n var dataView = new DataView(\n this.dataView_.buffer,\n this.dataView_.byteOffset + this.reader_.getPosition(), elementSize);\n\n this.reader_.skip(elementSize);\n\n return new shaka.util.EbmlElement(id, dataView);\n};\n\n\n/**\n * Parses an EBML ID from the parser's current position, and advances the\n * parser.\n * @throws {shaka.util.Error}\n * @return {number} The EBML ID.\n * @private\n */\nshaka.util.EbmlParser.prototype.parseId_ = function() {\n var vint = this.parseVint_();\n\n if (vint.length > 7) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_OVERFLOW);\n }\n\n var id = 0;\n for (var i = 0; i < vint.length; i++) {\n // Note that we cannot use << since |value| may exceed 32 bits.\n id = (256 * id) + vint[i];\n }\n\n return id;\n};\n\n\n/**\n * Parses a variable sized integer from the parser's current position, and\n * advances the parser.\n * For example:\n * 1 byte wide: 1xxx xxxx\n * 2 bytes wide: 01xx xxxx xxxx xxxx\n * 3 bytes wide: 001x xxxx xxxx xxxx xxxx xxxx\n * @throws {shaka.util.Error}\n * @return {!Uint8Array} The variable sized integer.\n * @private\n */\nshaka.util.EbmlParser.prototype.parseVint_ = function() {\n var firstByte = this.reader_.readUint8();\n var numBytes;\n\n // Determine the byte width of the variable sized integer.\n for (numBytes = 1; numBytes <= 8; numBytes++) {\n var mask = 0x1 << (8 - numBytes);\n if (firstByte & mask) {\n break;\n }\n }\n\n if (numBytes > 8) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_OVERFLOW);\n }\n\n var vint = new Uint8Array(numBytes);\n vint[0] = firstByte;\n\n // Include the remaining bytes.\n for (var i = 1; i < numBytes; i++) {\n vint[i] = this.reader_.readUint8();\n }\n\n return vint;\n};\n\n\n/**\n * Gets the value of a variable sized integer.\n * For example, the x's below are part of the vint's value.\n * 7-bit value: 1xxx xxxx\n * 14-bit value: 01xx xxxx xxxx xxxx\n * 21-bit value: 001x xxxx xxxx xxxx xxxx xxxx\n * @param {!Uint8Array} vint The variable sized integer.\n * @throws {shaka.util.Error}\n * @return {number} The value of the variable sized integer.\n * @private\n */\nshaka.util.EbmlParser.getVintValue_ = function(vint) {\n // If |vint| is 8 bytes wide then we must ensure that it does not have more\n // than 53 meaningful bits. For example, assume |vint| is 8 bytes wide,\n // so it has the following structure,\n // 0000 0001 | xxxx xxxx ...\n // Thus, the first 3 bits following the first byte of |vint| must be 0.\n if ((vint.length == 8) && (vint[1] & 0xe0)) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.JS_INTEGER_OVERFLOW);\n }\n\n // Mask out the first few bits of |vint|'s first byte to get the most\n // significant bits of |vint|'s value. If |vint| is 8 bytes wide then |value|\n // will be set to 0.\n var mask = 0x1 << (8 - vint.length);\n var value = vint[0] & (mask - 1);\n\n // Add the remaining bytes.\n for (var i = 1; i < vint.length; i++) {\n // Note that we cannot use << since |value| may exceed 32 bits.\n value = (256 * value) + vint[i];\n }\n\n return value;\n};\n\n\n/**\n * Checks if the given variable sized integer represents a dynamic size value.\n * @param {!Uint8Array} vint The variable sized integer.\n * @return {boolean} true if |vint| represents a dynamic size value,\n * false otherwise.\n * @private\n */\nshaka.util.EbmlParser.isDynamicSizeValue_ = function(vint) {\n var EbmlParser = shaka.util.EbmlParser;\n var uint8ArrayEqual = shaka.util.Uint8ArrayUtils.equal;\n\n for (var i = 0; i < EbmlParser.DYNAMIC_SIZES.length; i++) {\n if (uint8ArrayEqual(vint, EbmlParser.DYNAMIC_SIZES[i])) {\n return true;\n }\n }\n\n return false;\n};\n\n\n\n/**\n * Creates an EbmlElement.\n * @param {number} id The ID.\n * @param {!DataView} dataView The DataView.\n * @constructor\n */\nshaka.util.EbmlElement = function(id, dataView) {\n /** @type {number} */\n this.id = id;\n\n /** @private {!DataView} */\n this.dataView_ = dataView;\n};\n\n\n/**\n * Gets the element's offset from the beginning of the buffer.\n * @return {number}\n */\nshaka.util.EbmlElement.prototype.getOffset = function() {\n return this.dataView_.byteOffset;\n};\n\n\n/**\n * Interpret the element's data as a list of sub-elements.\n * @throws {shaka.util.Error}\n * @return {!shaka.util.EbmlParser} A parser over the sub-elements.\n */\nshaka.util.EbmlElement.prototype.createParser = function() {\n return new shaka.util.EbmlParser(this.dataView_);\n};\n\n\n/**\n * Interpret the element's data as an unsigned integer.\n * @throws {shaka.util.Error}\n * @return {number}\n */\nshaka.util.EbmlElement.prototype.getUint = function() {\n if (this.dataView_.byteLength > 8) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_OVERFLOW);\n }\n\n // Ensure we have at most 53 meaningful bits.\n if ((this.dataView_.byteLength == 8) && (this.dataView_.getUint8(0) & 0xe0)) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.JS_INTEGER_OVERFLOW);\n }\n\n var value = 0;\n\n for (var i = 0; i < this.dataView_.byteLength; i++) {\n var chunk = this.dataView_.getUint8(i);\n value = (256 * value) + chunk;\n }\n\n return value;\n};\n\n\n/**\n * Interpret the element's data as a floating point number (32 bits or 64 bits).\n * 80-bit floating point numbers are not supported.\n * @throws {shaka.util.Error}\n * @return {number}\n */\nshaka.util.EbmlElement.prototype.getFloat = function() {\n if (this.dataView_.byteLength == 4) {\n return this.dataView_.getFloat32(0);\n } else if (this.dataView_.byteLength == 8) {\n return this.dataView_.getFloat64(0);\n } else {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.EBML_BAD_FLOATING_POINT_SIZE);\n }\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/ebml_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.WebmSegmentIndexParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.EbmlElement');\ngoog.require('shaka.util.EbmlParser');\ngoog.require('shaka.util.Error');\n\n\n\n/**\n * Creates a WebM Cues element parser.\n *\n * @constructor\n * @struct\n */\nshaka.media.WebmSegmentIndexParser = function() {};\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.EBML_ID = 0x1a45dfa3;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.SEGMENT_ID = 0x18538067;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.INFO_ID = 0x1549a966;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.TIMECODE_SCALE_ID = 0x2ad7b1;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.DURATION_ID = 0x4489;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUES_ID = 0x1c53bb6b;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_POINT_ID = 0xbb;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_TIME_ID = 0xb3;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_TRACK_POSITIONS_ID = 0xb7;\n\n\n/** @const {number} */\nshaka.media.WebmSegmentIndexParser.CUE_CLUSTER_POSITION = 0xf1;\n\n\n/**\n * Parses SegmentReferences from a WebM container.\n * @param {!ArrayBuffer} cuesData The WebM container's \"Cueing Data\" section.\n * @param {!ArrayBuffer} initData The WebM container's headers.\n * @param {!Array.<string>} uris The possible locations of the WebM file that\n * contains the segments.\n * @param {number} presentationTimeOffset\n\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @throws {shaka.util.Error}\n * @see http://www.matroska.org/technical/specs/index.html\n * @see http://www.webmproject.org/docs/container/\n */\nshaka.media.WebmSegmentIndexParser.prototype.parse = function(\n cuesData, initData, uris, presentationTimeOffset) {\n var tuple = this.parseWebmContainer_(initData);\n var parser = new shaka.util.EbmlParser(new DataView(cuesData));\n var cuesElement = parser.parseElement();\n if (cuesElement.id != shaka.media.WebmSegmentIndexParser.CUES_ID) {\n shaka.log.error('Not a Cues element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_CUES_ELEMENT_MISSING);\n }\n\n return this.parseCues_(\n cuesElement, tuple.segmentOffset, tuple.timecodeScale, tuple.duration,\n uris, presentationTimeOffset);\n};\n\n\n/**\n * Parses a WebM container to get the segment's offset, timecode scale, and\n * duration.\n *\n * @param {!ArrayBuffer} initData\n * @return {{segmentOffset: number, timecodeScale: number, duration: number}}\n * The segment's offset in bytes, the segment's timecode scale in seconds,\n * and the duration in seconds.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseWebmContainer_ = function(\n initData) {\n var parser = new shaka.util.EbmlParser(new DataView(initData));\n\n // Check that the WebM container data starts with the EBML header, but\n // skip its contents.\n var ebmlElement = parser.parseElement();\n if (ebmlElement.id != shaka.media.WebmSegmentIndexParser.EBML_ID) {\n shaka.log.error('Not an EBML element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_EBML_HEADER_ELEMENT_MISSING);\n }\n\n var segmentElement = parser.parseElement();\n if (segmentElement.id != shaka.media.WebmSegmentIndexParser.SEGMENT_ID) {\n shaka.log.error('Not a Segment element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_SEGMENT_ELEMENT_MISSING);\n }\n\n // This value is used as the initial offset to the first referenced segment.\n var segmentOffset = segmentElement.getOffset();\n\n // Parse the Segment element to get the segment info.\n var segmentInfo = this.parseSegment_(segmentElement);\n return {\n segmentOffset: segmentOffset,\n timecodeScale: segmentInfo.timecodeScale,\n duration: segmentInfo.duration\n };\n};\n\n\n/**\n * Parses a WebM Info element to get the segment's timecode scale and duration.\n * @param {!shaka.util.EbmlElement} segmentElement\n * @return {{timecodeScale: number, duration: number}} The segment's timecode\n * scale in seconds and duration in seconds.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseSegment_ = function(\n segmentElement) {\n var parser = segmentElement.createParser();\n\n // Find the Info element.\n var infoElement = null;\n while (parser.hasMoreData()) {\n var elem = parser.parseElement();\n if (elem.id != shaka.media.WebmSegmentIndexParser.INFO_ID) {\n continue;\n }\n\n infoElement = elem;\n\n break;\n }\n\n if (!infoElement) {\n shaka.log.error('Not an Info element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_INFO_ELEMENT_MISSING);\n }\n\n return this.parseInfo_(infoElement);\n};\n\n\n/**\n * Parses a WebM Info element to get the segment's timecode scale and duration.\n * @param {!shaka.util.EbmlElement} infoElement\n * @return {{timecodeScale: number, duration: number}} The segment's timecode\n * scale in seconds and duration in seconds.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseInfo_ = function(\n infoElement) {\n var parser = infoElement.createParser();\n\n // The timecode scale factor in units of [nanoseconds / T], where [T] are the\n // units used to express all other time values in the WebM container. By\n // default it's assumed that [T] == [milliseconds].\n var timecodeScaleNanoseconds = 1000000;\n /** @type {?number} */\n var durationScale = null;\n\n while (parser.hasMoreData()) {\n var elem = parser.parseElement();\n if (elem.id == shaka.media.WebmSegmentIndexParser.TIMECODE_SCALE_ID) {\n timecodeScaleNanoseconds = elem.getUint();\n } else if (elem.id == shaka.media.WebmSegmentIndexParser.DURATION_ID) {\n durationScale = elem.getFloat();\n }\n }\n if (durationScale == null) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_DURATION_ELEMENT_MISSING);\n }\n\n // The timecode scale factor in units of [seconds / T].\n var timecodeScale = timecodeScaleNanoseconds / 1000000000;\n // The duration is stored in units of [T]\n var durationSeconds = durationScale * timecodeScale;\n\n return {timecodeScale: timecodeScale, duration: durationSeconds};\n};\n\n\n/**\n * Parses a WebM CuesElement.\n * @param {!shaka.util.EbmlElement} cuesElement\n * @param {number} segmentOffset\n * @param {number} timecodeScale\n * @param {number} duration\n * @param {!Array.<string>} uris\n * @param {number} presentationTimeOffset\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseCues_ = function(\n cuesElement, segmentOffset, timecodeScale, duration, uris,\n presentationTimeOffset) {\n var references = [];\n var getUris = function() { return uris; };\n\n var parser = cuesElement.createParser();\n\n var lastTime = -1;\n var lastOffset = -1;\n\n while (parser.hasMoreData()) {\n var elem = parser.parseElement();\n if (elem.id != shaka.media.WebmSegmentIndexParser.CUE_POINT_ID) {\n continue;\n }\n\n var tuple = this.parseCuePoint_(elem);\n if (!tuple) {\n continue;\n }\n\n // Substract presentationTimeOffset from unscalled time\n var currentTime = timecodeScale *\n (tuple.unscaledTime - presentationTimeOffset);\n var currentOffset = segmentOffset + tuple.relativeOffset;\n\n if (lastTime >= 0) {\n goog.asserts.assert(lastOffset >= 0, 'last offset cannot be 0');\n\n references.push(\n new shaka.media.SegmentReference(\n references.length,\n lastTime, currentTime,\n getUris,\n lastOffset, currentOffset - 1));\n }\n\n lastTime = currentTime;\n lastOffset = currentOffset;\n }\n\n if (lastTime >= 0) {\n goog.asserts.assert(lastOffset >= 0, 'last offset cannot be 0');\n\n references.push(\n new shaka.media.SegmentReference(\n references.length, lastTime, duration, getUris, lastOffset, null));\n }\n\n return references;\n};\n\n\n/**\n * Parses a WebM CuePointElement to get an \"unadjusted\" segment reference.\n * @param {shaka.util.EbmlElement} cuePointElement\n * @return {{unscaledTime: number, relativeOffset: number}} The referenced\n * segment's start time in units of [T] (see parseInfo_()), and the\n * referenced segment's offset in bytes, relative to a WebM Segment\n * element.\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.media.WebmSegmentIndexParser.prototype.parseCuePoint_ = function(\n cuePointElement) {\n var parser = cuePointElement.createParser();\n\n // Parse CueTime element.\n var cueTimeElement = parser.parseElement();\n if (cueTimeElement.id != shaka.media.WebmSegmentIndexParser.CUE_TIME_ID) {\n shaka.log.warning('Not a CueTime element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_CUE_TIME_ELEMENT_MISSING);\n }\n var unscaledTime = cueTimeElement.getUint();\n\n // Parse CueTrackPositions element.\n var cueTrackPositionsElement = parser.parseElement();\n if (cueTrackPositionsElement.id !=\n shaka.media.WebmSegmentIndexParser.CUE_TRACK_POSITIONS_ID) {\n shaka.log.warning('Not a CueTrackPositions element.');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MEDIA,\n shaka.util.Error.Code.WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING);\n }\n\n var cueTrackParser = cueTrackPositionsElement.createParser();\n var relativeOffset = 0;\n\n while (cueTrackParser.hasMoreData()) {\n var elem = cueTrackParser.parseElement();\n if (elem.id != shaka.media.WebmSegmentIndexParser.CUE_CLUSTER_POSITION) {\n continue;\n }\n\n relativeOffset = elem.getUint();\n break;\n }\n\n return { unscaledTime: unscaledTime, relativeOffset: relativeOffset };\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/webm_segment_index_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.SegmentBase');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.MpdUtils');\ngoog.require('shaka.log');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.Mp4SegmentIndexParser');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.WebmSegmentIndexParser');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.SegmentBase\n * @summary A set of functions for parsing SegmentBase elements.\n */\n\n\n/**\n * Creates an init segment reference from a Context object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {function(?shaka.dash.DashParser.InheritanceFrame):Element} callback\n * @return {shaka.media.InitSegmentReference}\n */\nshaka.dash.SegmentBase.createInitSegment = function(context, callback) {\n var MpdUtils = shaka.dash.MpdUtils;\n var XmlUtils = shaka.util.XmlUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var initialization =\n MpdUtils.inheritChild(context, callback, 'Initialization');\n if (!initialization)\n return null;\n\n var resolvedUris = context.representation.baseUris;\n var uri = initialization.getAttribute('sourceURL');\n if (uri) {\n resolvedUris =\n ManifestParserUtils.resolveUris(context.representation.baseUris, [uri]);\n }\n\n var startByte = 0;\n var endByte = null;\n var range = XmlUtils.parseAttr(initialization, 'range', XmlUtils.parseRange);\n if (range) {\n startByte = range.start;\n endByte = range.end;\n }\n\n var getUris = function() { return resolvedUris; };\n return new shaka.media.InitSegmentReference(getUris, startByte, endByte);\n};\n\n\n/**\n * Creates a new Stream object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @throws shaka.util.Error When there is a parsing error.\n * @return {shaka.dash.DashParser.StreamInfo}\n */\nshaka.dash.SegmentBase.createStream = function(context, requestInitSegment) {\n goog.asserts.assert(context.representation.segmentBase,\n 'Should only be called with SegmentBase');\n // Since SegmentBase does not need updates, simply treat any call as\n // the initial parse.\n var MpdUtils = shaka.dash.MpdUtils;\n var SegmentBase = shaka.dash.SegmentBase;\n\n var presentationTimeOffset = MpdUtils.inheritAttribute(\n context, SegmentBase.fromInheritance_, 'presentationTimeOffset');\n\n var init =\n SegmentBase.createInitSegment(context, SegmentBase.fromInheritance_);\n var index = SegmentBase.createSegmentIndex_(\n context, requestInitSegment, init, Number(presentationTimeOffset));\n\n return {\n createSegmentIndex: index.createSegmentIndex,\n findSegmentPosition: index.findSegmentPosition,\n getSegmentReference: index.getSegmentReference,\n initSegmentReference: init,\n presentationTimeOffset: Number(presentationTimeOffset) || 0\n };\n};\n\n\n/**\n * Creates segment index info for the given info.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {shaka.media.InitSegmentReference} init\n * @param {!Array.<string>} uris\n * @param {number} startByte\n * @param {?number} endByte\n * @param {string} containerType\n * @param {number} presentationTimeOffset\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n */\nshaka.dash.SegmentBase.createSegmentIndexFromUris = function(\n context, requestInitSegment, init, uris,\n startByte, endByte, containerType, presentationTimeOffset) {\n var presentationTimeline = context.presentationTimeline;\n var fitLast = !context.dynamic || !context.periodInfo.isLastPeriod;\n var periodStartTime = context.periodInfo.start;\n var periodDuration = context.periodInfo.duration;\n\n // Create a local variable to bind to so we can set to null to help the GC.\n var localRequest = requestInitSegment;\n var segmentIndex = null;\n var create = function() {\n var async = [\n localRequest(uris, startByte, endByte),\n containerType == 'webm' ?\n localRequest(init.getUris(), init.startByte, init.endByte) :\n null\n ];\n\n localRequest = null;\n return Promise.all(async).then(function(results) {\n var indexData = results[0];\n var initData = results[1] || null;\n var references = null;\n\n if (containerType == 'mp4') {\n references = shaka.media.Mp4SegmentIndexParser(\n indexData, startByte, uris, presentationTimeOffset);\n } else {\n goog.asserts.assert(initData, 'WebM requires init data');\n var parser = new shaka.media.WebmSegmentIndexParser();\n references = parser.parse(indexData, initData, uris,\n presentationTimeOffset);\n }\n\n presentationTimeline.notifySegments(periodStartTime, references);\n\n // Since containers are never updated, we don't need to store the\n // segmentIndex in the map.\n goog.asserts.assert(!segmentIndex,\n 'Should not call createSegmentIndex twice');\n\n segmentIndex = new shaka.media.SegmentIndex(references);\n if (fitLast)\n segmentIndex.fit(periodDuration);\n });\n };\n var get = function(i) {\n goog.asserts.assert(segmentIndex, 'Must call createSegmentIndex first');\n return segmentIndex.get(i);\n };\n var find = function(t) {\n goog.asserts.assert(segmentIndex, 'Must call createSegmentIndex first');\n return segmentIndex.find(t);\n };\n\n return {\n createSegmentIndex: create,\n findSegmentPosition: find,\n getSegmentReference: get\n };\n};\n\n\n/**\n * @param {?shaka.dash.DashParser.InheritanceFrame} frame\n * @return {Element}\n * @private\n */\nshaka.dash.SegmentBase.fromInheritance_ = function(frame) {\n return frame.segmentBase;\n};\n\n\n/**\n * Creates segment index info from a Context object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {shaka.media.InitSegmentReference} init\n * @param {number} presentationTimeOffset\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.SegmentBase.createSegmentIndex_ = function(\n context, requestInitSegment, init, presentationTimeOffset) {\n var MpdUtils = shaka.dash.MpdUtils;\n var SegmentBase = shaka.dash.SegmentBase;\n var XmlUtils = shaka.util.XmlUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var contentType = context.representation.contentType;\n var containerType = context.representation.mimeType.split('/')[1];\n if (contentType != ContentType.TEXT && containerType != 'mp4' &&\n containerType != 'webm') {\n shaka.log.error(\n 'SegmentBase specifies an unsupported container type.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_UNSUPPORTED_CONTAINER);\n }\n\n if ((containerType == 'webm') && !init) {\n shaka.log.error(\n 'SegmentBase does not contain sufficient segment information:',\n 'the SegmentBase uses a WebM container,',\n 'but does not contain an Initialization element.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_WEBM_MISSING_INIT);\n }\n\n var representationIndex = MpdUtils.inheritChild(\n context, SegmentBase.fromInheritance_, 'RepresentationIndex');\n var indexRangeElem = MpdUtils.inheritAttribute(\n context, SegmentBase.fromInheritance_, 'indexRange');\n\n var indexUris = context.representation.baseUris;\n var indexRange = XmlUtils.parseRange(indexRangeElem || '');\n if (representationIndex) {\n var representationUri = representationIndex.getAttribute('sourceURL');\n if (representationUri) {\n indexUris = ManifestParserUtils.resolveUris(\n context.representation.baseUris, [representationUri]);\n }\n\n indexRange = XmlUtils.parseAttr(\n representationIndex, 'range', XmlUtils.parseRange, indexRange);\n }\n\n if (!indexRange) {\n shaka.log.error(\n 'SegmentBase does not contain sufficient segment information:',\n 'the SegmentBase does not contain @indexRange',\n 'or a RepresentationIndex element.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n\n return shaka.dash.SegmentBase.createSegmentIndexFromUris(\n context, requestInitSegment, init, indexUris, indexRange.start,\n indexRange.end, containerType, presentationTimeOffset);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/segment_base.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.SegmentList');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.MpdUtils');\ngoog.require('shaka.dash.SegmentBase');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n/**\n * @namespace shaka.dash.SegmentList\n * @summary A set of functions for parsing SegmentList elements.\n */\n\n\n/**\n * Creates a new Stream object or updates the Stream in the manifest.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Object.<string, !shaka.media.SegmentIndex>} segmentIndexMap\n * @return {shaka.dash.DashParser.StreamInfo}\n */\nshaka.dash.SegmentList.createStream = function(context, segmentIndexMap) {\n goog.asserts.assert(context.representation.segmentList,\n 'Should only be called with SegmentList');\n var SegmentList = shaka.dash.SegmentList;\n\n var init = shaka.dash.SegmentBase.createInitSegment(\n context, SegmentList.fromInheritance_);\n var info = SegmentList.parseSegmentListInfo_(context);\n\n SegmentList.checkSegmentListInfo_(context, info);\n\n /** @type {shaka.media.SegmentIndex} */\n var segmentIndex = null;\n var id = null;\n if (context.period.id && context.representation.id) {\n // Only check/store the index if period and representation IDs are set.\n id = context.period.id + ',' + context.representation.id;\n segmentIndex = segmentIndexMap[id];\n }\n\n var references = SegmentList.createSegmentReferences_(\n context.periodInfo.duration, info.startNumber,\n context.representation.baseUris, info);\n\n if (segmentIndex) {\n segmentIndex.merge(references);\n var start = context.presentationTimeline.getSegmentAvailabilityStart();\n segmentIndex.evict(start - context.periodInfo.start);\n } else {\n context.presentationTimeline.notifySegments(\n context.periodInfo.start, references);\n segmentIndex = new shaka.media.SegmentIndex(references);\n if (id && context.dynamic)\n segmentIndexMap[id] = segmentIndex;\n }\n\n if (!context.dynamic || !context.periodInfo.isLastPeriod)\n segmentIndex.fit(context.periodInfo.duration);\n\n return {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex),\n initSegmentReference: init,\n presentationTimeOffset: info.presentationTimeOffset\n };\n};\n\n\n/**\n * @typedef {{\n * mediaUri: string,\n * start: number,\n * end: ?number\n * }}\n *\n * @property {string} mediaUri\n * The URI of the segment.\n * @property {number} start\n * The start byte of the segment.\n * @property {?number} end\n * The end byte of the segment, or null.\n */\nshaka.dash.SegmentList.MediaSegment;\n\n\n/**\n * @typedef {{\n * segmentDuration: ?number,\n * startTime: number,\n * startNumber: number,\n * presentationTimeOffset: number,\n * timeline: Array.<shaka.dash.MpdUtils.TimeRange>,\n * mediaSegments: !Array.<shaka.dash.SegmentList.MediaSegment>\n * }}\n * @private\n *\n * @description\n * Contains information about a SegmentList.\n *\n * @property {?number} segmentDuration\n * The duration of the segments, if given.\n * @property {number} startTime\n * The start time of the first segment, in seconds.\n * @property {number} startNumber\n * The start number of the segments; 1 or greater.\n * @property {number} presentationTimeOffset\n * The presentationTimeOffset of the representation, in seconds.\n * @property {Array.<shaka.dash.MpdUtils.TimeRange>} timeline\n * The timeline of the representation, if given. Times in seconds.\n * @property {!Array.<shaka.dash.SegmentList.MediaSegment>} mediaSegments\n * The URI and byte-ranges of the media segments.\n */\nshaka.dash.SegmentList.SegmentListInfo;\n\n\n/**\n * @param {?shaka.dash.DashParser.InheritanceFrame} frame\n * @return {Element}\n * @private\n */\nshaka.dash.SegmentList.fromInheritance_ = function(frame) {\n return frame.segmentList;\n};\n\n\n/**\n * Parses the SegmentList items to create an info object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {shaka.dash.SegmentList.SegmentListInfo}\n * @private\n */\nshaka.dash.SegmentList.parseSegmentListInfo_ = function(context) {\n var SegmentList = shaka.dash.SegmentList;\n var MpdUtils = shaka.dash.MpdUtils;\n\n var mediaSegments = SegmentList.parseMediaSegments_(context);\n var segmentInfo =\n MpdUtils.parseSegmentInfo(context, SegmentList.fromInheritance_);\n\n var startNumber = segmentInfo.startNumber;\n if (startNumber == 0) {\n shaka.log.warning('SegmentList@startNumber must be > 0');\n startNumber = 1;\n }\n\n var startTime = 0;\n if (segmentInfo.segmentDuration) {\n // See DASH sec. 5.3.9.5.3\n // Don't use presentationTimeOffset for @duration.\n startTime = segmentInfo.segmentDuration * (startNumber - 1);\n } else if (segmentInfo.timeline && segmentInfo.timeline.length > 0) {\n // The presentationTimeOffset was considered in timeline creation\n startTime = segmentInfo.timeline[0].start;\n }\n\n return {\n segmentDuration: segmentInfo.segmentDuration,\n startTime: startTime,\n startNumber: startNumber,\n presentationTimeOffset: segmentInfo.presentationTimeOffset,\n timeline: segmentInfo.timeline,\n mediaSegments: mediaSegments\n };\n};\n\n\n/**\n * Checks whether a SegmentListInfo object is valid.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentList.SegmentListInfo} info\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.SegmentList.checkSegmentListInfo_ = function(context, info) {\n if (!info.segmentDuration && !info.timeline &&\n info.mediaSegments.length > 1) {\n shaka.log.warning(\n 'SegmentList does not contain sufficient segment information:',\n 'the SegmentList specifies multiple segments,',\n 'but does not specify a segment duration or timeline.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n\n if (!info.segmentDuration && !context.periodInfo.duration && !info.timeline &&\n info.mediaSegments.length == 1) {\n shaka.log.warning(\n 'SegmentList does not contain sufficient segment information:',\n 'the SegmentList specifies one segment,',\n 'but does not specify a segment duration, period duration,',\n 'or timeline.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n\n if (info.timeline && info.timeline.length == 0) {\n shaka.log.warning(\n 'SegmentList does not contain sufficient segment information:',\n 'the SegmentList has an empty timeline.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n};\n\n\n/**\n * Creates an array of segment references for the given data.\n *\n * @param {?number} periodDuration in seconds.\n * @param {number} startNumber\n * @param {!Array.<string>} baseUris\n * @param {shaka.dash.SegmentList.SegmentListInfo} info\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.dash.SegmentList.createSegmentReferences_ = function(\n periodDuration, startNumber, baseUris, info) {\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var max = info.mediaSegments.length;\n if (info.timeline && info.timeline.length != info.mediaSegments.length) {\n max = Math.min(info.timeline.length, info.mediaSegments.length);\n shaka.log.warning(\n 'The number of items in the segment timeline and the number of segment',\n 'URLs do not match, truncating', info.mediaSegments.length, 'to', max);\n }\n\n /** @type {!Array.<!shaka.media.SegmentReference>} */\n var references = [];\n var prevEndTime = info.startTime;\n for (var i = 0; i < max; i++) {\n var segment = info.mediaSegments[i];\n var mediaUri = ManifestParserUtils.resolveUris(\n baseUris, [segment.mediaUri]);\n\n var startTime = prevEndTime;\n var endTime;\n\n if (info.segmentDuration != null) {\n endTime = startTime + info.segmentDuration;\n } else if (info.timeline) {\n // Ignore the timepoint start since they are continuous.\n endTime = info.timeline[i].end;\n } else {\n // If segmentDuration and timeline are null then there must\n // only be one segment.\n goog.asserts.assert(\n info.mediaSegments.length == 1 && periodDuration,\n 'There should only be one segment with a Period duration.');\n endTime = startTime + periodDuration;\n }\n\n var getUris = (function(uris) { return uris; }.bind(null, mediaUri));\n references.push(\n new shaka.media.SegmentReference(\n i + startNumber, startTime, endTime, getUris, segment.start,\n segment.end));\n prevEndTime = endTime;\n }\n\n return references;\n};\n\n\n/**\n * Parses the media URIs from the context.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {!Array.<shaka.dash.SegmentList.MediaSegment>}\n * @private\n */\nshaka.dash.SegmentList.parseMediaSegments_ = function(context) {\n var Functional = shaka.util.Functional;\n /** @type {!Array.<!Element>} */\n var segmentLists = [\n context.representation.segmentList,\n context.adaptationSet.segmentList,\n context.period.segmentList\n ].filter(Functional.isNotNull);\n\n var XmlUtils = shaka.util.XmlUtils;\n // Search each SegmentList for one with at least one SegmentURL element,\n // select the first one, and convert each SegmentURL element to a tuple.\n return segmentLists\n .map(function(node) { return XmlUtils.findChildren(node, 'SegmentURL'); })\n .reduce(function(all, part) { return all.length > 0 ? all : part; })\n .map(function(urlNode) {\n if (urlNode.getAttribute('indexRange') &&\n !context.indexRangeWarningGiven) {\n context.indexRangeWarningGiven = true;\n shaka.log.warning(\n 'We do not support the SegmentURL@indexRange attribute on ' +\n 'SegmentList. We only use the SegmentList@duration attribute ' +\n 'or SegmentTimeline, which must be accurate.');\n }\n\n var uri = urlNode.getAttribute('media');\n var range = XmlUtils.parseAttr(\n urlNode, 'mediaRange', XmlUtils.parseRange, {start: 0, end: null});\n return {mediaUri: uri, start: range.start, end: range.end};\n });\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/segment_list.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.SegmentTemplate');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.MpdUtils');\ngoog.require('shaka.dash.SegmentBase');\ngoog.require('shaka.log');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n/**\n * @namespace shaka.dash.SegmentTemplate\n * @summary A set of functions for parsing SegmentTemplate elements.\n */\n\n\n/**\n * Creates a new Stream object or updates the Stream in the manifest.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {!Object.<string, !shaka.media.SegmentIndex>} segmentIndexMap\n * @param {boolean} isUpdate True if the manifest is being updated.\n * @throws shaka.util.Error When there is a parsing error.\n * @return {shaka.dash.DashParser.StreamInfo}\n */\nshaka.dash.SegmentTemplate.createStream = function(\n context, requestInitSegment, segmentIndexMap, isUpdate) {\n goog.asserts.assert(context.representation.segmentTemplate,\n 'Should only be called with SegmentTemplate');\n var SegmentTemplate = shaka.dash.SegmentTemplate;\n\n var init = SegmentTemplate.createInitSegment_(context);\n var info = SegmentTemplate.parseSegmentTemplateInfo_(context);\n\n SegmentTemplate.checkSegmentTemplateInfo_(context, info);\n\n /** @type {?shaka.dash.DashParser.SegmentIndexFunctions} */\n var segmentIndexFunctions = null;\n if (info.indexTemplate) {\n segmentIndexFunctions = SegmentTemplate.createFromIndexTemplate_(\n context, requestInitSegment, init, info);\n } else if (info.segmentDuration) {\n if (!isUpdate) {\n context.presentationTimeline.notifyMaxSegmentDuration(\n info.segmentDuration);\n }\n segmentIndexFunctions = SegmentTemplate.createFromDuration_(context, info);\n } else {\n /** @type {shaka.media.SegmentIndex} */\n var segmentIndex = null;\n var id = null;\n if (context.period.id && context.representation.id) {\n // Only check/store the index if period and representation IDs are set.\n id = context.period.id + ',' + context.representation.id;\n segmentIndex = segmentIndexMap[id];\n }\n\n var references = SegmentTemplate.createFromTimeline_(context, info);\n\n if (segmentIndex) {\n segmentIndex.merge(references);\n var start = context.presentationTimeline.getSegmentAvailabilityStart();\n segmentIndex.evict(start - context.periodInfo.start);\n } else {\n context.presentationTimeline.notifySegments(\n context.periodInfo.start, references);\n segmentIndex = new shaka.media.SegmentIndex(references);\n if (id && context.dynamic)\n segmentIndexMap[id] = segmentIndex;\n }\n\n if (!context.dynamic || !context.periodInfo.isLastPeriod)\n segmentIndex.fit(context.periodInfo.duration);\n\n segmentIndexFunctions = {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex)\n };\n }\n\n return {\n createSegmentIndex: segmentIndexFunctions.createSegmentIndex,\n findSegmentPosition: segmentIndexFunctions.findSegmentPosition,\n getSegmentReference: segmentIndexFunctions.getSegmentReference,\n initSegmentReference: init,\n presentationTimeOffset: info.presentationTimeOffset\n };\n};\n\n\n/**\n * @typedef {{\n * timescale: number,\n * segmentDuration: ?number,\n * startNumber: number,\n * presentationTimeOffset: number,\n * unscaledPresentationTimeOffset: number,\n * timeline: Array.<shaka.dash.MpdUtils.TimeRange>,\n * mediaTemplate: ?string,\n * indexTemplate: ?string\n * }}\n * @private\n *\n * @description\n * Contains information about a SegmentTemplate.\n *\n * @property {number} timescale\n * The time-scale of the representation.\n * @property {?number} segmentDuration\n * The duration of the segments in seconds, if given.\n * @property {number} startNumber\n * The start number of the segments; 1 or greater.\n * @property {number} presentationTimeOffset\n * The presentationTimeOffset of the representation, in seconds.\n * @property {number} unscaledPresentationTimeOffset\n * The presentationTimeOffset of the representation, in timescale units.\n * @property {Array.<shaka.dash.MpdUtils.TimeRange>} timeline\n * The timeline of the representation, if given. Times in seconds.\n * @property {?string} mediaTemplate\n * The media URI template, if given.\n * @property {?string} indexTemplate\n * The index URI template, if given.\n */\nshaka.dash.SegmentTemplate.SegmentTemplateInfo;\n\n\n/**\n * @param {?shaka.dash.DashParser.InheritanceFrame} frame\n * @return {Element}\n * @private\n */\nshaka.dash.SegmentTemplate.fromInheritance_ = function(frame) {\n return frame.segmentTemplate;\n};\n\n\n/**\n * Parses a SegmentTemplate element into an info object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {shaka.dash.SegmentTemplate.SegmentTemplateInfo}\n * @private\n */\nshaka.dash.SegmentTemplate.parseSegmentTemplateInfo_ = function(context) {\n var SegmentTemplate = shaka.dash.SegmentTemplate;\n var MpdUtils = shaka.dash.MpdUtils;\n var segmentInfo =\n MpdUtils.parseSegmentInfo(context, SegmentTemplate.fromInheritance_);\n\n var media = MpdUtils.inheritAttribute(\n context, SegmentTemplate.fromInheritance_, 'media');\n var index = MpdUtils.inheritAttribute(\n context, SegmentTemplate.fromInheritance_, 'index');\n\n return {\n segmentDuration: segmentInfo.segmentDuration,\n timescale: segmentInfo.timescale,\n startNumber: segmentInfo.startNumber,\n presentationTimeOffset: segmentInfo.presentationTimeOffset,\n unscaledPresentationTimeOffset: segmentInfo.unscaledPresentationTimeOffset,\n timeline: segmentInfo.timeline,\n mediaTemplate: media,\n indexTemplate: index\n };\n};\n\n\n/**\n * Verifies a SegmentTemplate info object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.SegmentTemplate.checkSegmentTemplateInfo_ = function(context, info) {\n var n = 0;\n n += info.indexTemplate ? 1 : 0;\n n += info.timeline ? 1 : 0;\n n += info.segmentDuration ? 1 : 0;\n\n if (n == 0) {\n shaka.log.error(\n 'SegmentTemplate does not contain any segment information:',\n 'the SegmentTemplate must contain either an index URL template',\n 'a SegmentTimeline, or a segment duration.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n } else if (n != 1) {\n shaka.log.warning(\n 'SegmentTemplate containes multiple segment information sources:',\n 'the SegmentTemplate should only contain an index URL template,',\n 'a SegmentTimeline or a segment duration.',\n context.representation);\n if (info.indexTemplate) {\n shaka.log.info('Using the index URL template by default.');\n info.timeline = null;\n info.segmentDuration = null;\n } else {\n goog.asserts.assert(info.timeline, 'There should be a timeline');\n shaka.log.info('Using the SegmentTimeline by default.');\n info.segmentDuration = null;\n }\n }\n\n if (!info.indexTemplate && !info.mediaTemplate) {\n shaka.log.error(\n 'SegmentTemplate does not contain sufficient segment information:',\n 'the SegmentTemplate\\'s media URL template is missing.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_NO_SEGMENT_INFO);\n }\n};\n\n\n/**\n * Creates segment index functions from a index URL template.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.DashParser.RequestInitSegmentCallback} requestInitSegment\n * @param {shaka.media.InitSegmentReference} init\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @throws shaka.util.Error When there is a parsing error.\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n * @private\n */\nshaka.dash.SegmentTemplate.createFromIndexTemplate_ = function(\n context, requestInitSegment, init, info) {\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n // Determine the container type.\n var containerType = context.representation.mimeType.split('/')[1];\n if ((containerType != 'mp4') && (containerType != 'webm')) {\n shaka.log.error(\n 'SegmentTemplate specifies an unsupported container type.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_UNSUPPORTED_CONTAINER);\n }\n\n if ((containerType == 'webm') && !init) {\n shaka.log.error(\n 'SegmentTemplate does not contain sufficient segment information:',\n 'the SegmentTemplate uses a WebM container,',\n 'but does not contain an initialization URL template.',\n context.representation);\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_WEBM_MISSING_INIT);\n }\n\n goog.asserts.assert(info.indexTemplate, 'must be using index template');\n var filledTemplate = MpdUtils.fillUriTemplate(\n info.indexTemplate, context.representation.id,\n null, context.bandwidth || null, null);\n\n var resolvedUris = ManifestParserUtils.resolveUris(\n context.representation.baseUris, [filledTemplate]);\n\n return shaka.dash.SegmentBase.createSegmentIndexFromUris(\n context, requestInitSegment, init, resolvedUris, 0, null, containerType,\n info.presentationTimeOffset);\n};\n\n\n/**\n * Creates segment index functions from a segment duration.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @return {shaka.dash.DashParser.SegmentIndexFunctions}\n * @private\n */\nshaka.dash.SegmentTemplate.createFromDuration_ = function(context, info) {\n goog.asserts.assert(info.mediaTemplate,\n 'There should be a media template with duration');\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var periodDuration = context.periodInfo.duration;\n var segmentDuration = info.segmentDuration;\n var startNumber = info.startNumber;\n var timescale = info.timescale;\n\n var template = info.mediaTemplate;\n var bandwidth = context.bandwidth || null;\n var id = context.representation.id;\n var baseUris = context.representation.baseUris;\n\n var find = function(periodTime) {\n if (periodTime < 0)\n return null;\n else if (periodDuration && periodTime >= periodDuration)\n return null;\n\n return Math.floor(periodTime / segmentDuration);\n };\n var get = function(position) {\n var segmentStart = position * segmentDuration;\n\n // Do not construct segments references that should not exist.\n if (segmentStart < 0)\n return null;\n else if (periodDuration && segmentStart >= periodDuration)\n return null;\n\n var getUris = function() {\n var mediaUri = MpdUtils.fillUriTemplate(\n template, id, position + startNumber, bandwidth,\n segmentStart * timescale);\n return ManifestParserUtils.resolveUris(baseUris, [mediaUri]);\n };\n\n return new shaka.media.SegmentReference(\n position, segmentStart, segmentStart + segmentDuration, getUris, 0,\n null);\n };\n\n return {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: find,\n getSegmentReference: get\n };\n};\n\n\n/**\n * Creates segment references from a timeline.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.dash.SegmentTemplate.createFromTimeline_ = function(context, info) {\n goog.asserts.assert(info.mediaTemplate,\n 'There should be a media template with a timeline');\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n /** @type {!Array.<!shaka.media.SegmentReference>} */\n var references = [];\n for (var i = 0; i < info.timeline.length; i++) {\n var start = info.timeline[i].start;\n var unscaledStart = info.timeline[i].unscaledStart;\n var end = info.timeline[i].end;\n\n // Note: i = k - 1, where k indicates the k'th segment listed in the MPD.\n // (See section 5.3.9.5.3 of the DASH spec.)\n var segmentReplacement = i + info.startNumber;\n\n // Consider the presentation time offset in segment uri computation\n var timeReplacement = unscaledStart +\n info.unscaledPresentationTimeOffset;\n var createUris = (function(\n template, repId, bandwidth, baseUris, segmentId, time) {\n var mediaUri = MpdUtils.fillUriTemplate(\n template, repId, segmentId, bandwidth, time);\n return ManifestParserUtils.resolveUris(baseUris, [mediaUri])\n .map(function(g) { return g.toString(); });\n }.bind(null, info.mediaTemplate, context.representation.id,\n context.bandwidth || null, context.representation.baseUris,\n segmentReplacement, timeReplacement));\n\n references.push(new shaka.media.SegmentReference(\n segmentReplacement, start, end, createUris, 0, null));\n }\n\n return references;\n};\n\n\n/**\n * Creates an init segment reference from a context object.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @return {shaka.media.InitSegmentReference}\n * @private\n */\nshaka.dash.SegmentTemplate.createInitSegment_ = function(context) {\n var MpdUtils = shaka.dash.MpdUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var SegmentTemplate = shaka.dash.SegmentTemplate;\n\n var initialization = MpdUtils.inheritAttribute(\n context, SegmentTemplate.fromInheritance_, 'initialization');\n if (!initialization)\n return null;\n\n var repId = context.representation.id;\n var bandwidth = context.bandwidth || null;\n var baseUris = context.representation.baseUris;\n var getUris = function() {\n goog.asserts.assert(initialization, 'Should have returned earler');\n var filledTemplate = MpdUtils.fillUriTemplate(\n initialization, repId, null, bandwidth, null);\n var resolvedUris = ManifestParserUtils.resolveUris(\n baseUris, [filledTemplate]);\n return resolvedUris;\n };\n\n return new shaka.media.InitSegmentReference(getUris, 0, null);\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/segment_template.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.ManifestParser');\n\ngoog.require('goog.Uri');\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\n\n\n/**\n * @namespace shaka.media.ManifestParser\n * @summary An interface to register manifest parsers.\n * @exportDoc\n */\n\n\n/**\n * Contains the parser factory functions indexed by MIME type.\n *\n * @type {!Object.<string, shakaExtern.ManifestParser.Factory>}\n */\nshaka.media.ManifestParser.parsersByMime = {};\n\n\n/**\n * Contains the parser factory functions indexed by file extension.\n *\n * @type {!Object.<string, shakaExtern.ManifestParser.Factory>}\n */\nshaka.media.ManifestParser.parsersByExtension = {};\n\n\n/**\n * Registers a manifest parser by file extension.\n *\n * @param {string} extension The file extension of the manifest.\n * @param {shakaExtern.ManifestParser.Factory} parserFactory The factory\n * used to create parser instances.\n * @export\n */\nshaka.media.ManifestParser.registerParserByExtension = function(\n extension, parserFactory) {\n shaka.media.ManifestParser.parsersByExtension[extension] = parserFactory;\n};\n\n\n/**\n * Registers a manifest parser by MIME type.\n *\n * @param {string} mimeType The MIME type of the manifest.\n * @param {shakaExtern.ManifestParser.Factory} parserFactory The factory\n * used to create parser instances.\n * @export\n */\nshaka.media.ManifestParser.registerParserByMime = function(\n mimeType, parserFactory) {\n shaka.media.ManifestParser.parsersByMime[mimeType] = parserFactory;\n};\n\n\n/**\n * Returns a map of manifest support for well-known types.\n *\n * @return {!Object.<string, boolean>}\n */\nshaka.media.ManifestParser.probeSupport = function() {\n // Make sure all registered parsers are shown.\n var support = {};\n for (var type in shaka.media.ManifestParser.parsersByMime) {\n support[type] = true;\n }\n for (var type in shaka.media.ManifestParser.parsersByExtension) {\n support[type] = true;\n }\n\n // Make sure all well-known types are tested as well, just to show an explicit\n // false for things people might be expecting.\n var testMimeTypes = [\n // DASH\n 'application/dash+xml',\n // HLS\n 'application/x-mpegurl',\n 'application/vnd.apple.mpegurl',\n // SmoothStreaming\n 'application/vnd.ms-sstr+xml'\n ];\n var testExtensions = [\n // DASH\n 'mpd',\n // HLS\n 'm3u8',\n // SmoothStreaming\n 'ism'\n ];\n\n testMimeTypes.forEach(function(type) {\n support[type] = !!shaka.media.ManifestParser.parsersByMime[type];\n });\n testExtensions.forEach(function(type) {\n support[type] = !!shaka.media.ManifestParser.parsersByExtension[type];\n });\n\n return support;\n};\n\n\n/**\n * Finds a manifest parser factory to parse the given manifest.\n *\n * @param {string} manifestUri\n * @param {!shaka.net.NetworkingEngine} netEngine\n * @param {shakaExtern.RetryParameters} retryParams\n * @param {shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * @return {!Promise.<shakaExtern.ManifestParser.Factory>}\n */\nshaka.media.ManifestParser.getFactory = function(\n manifestUri, netEngine, retryParams, opt_manifestParserFactory) {\n var factory = opt_manifestParserFactory;\n var extension;\n\n if (!factory) {\n // Try to choose a manifest parser by file extension.\n var uriObj = new goog.Uri(manifestUri);\n var uriPieces = uriObj.getPath().split('/');\n var uriFilename = uriPieces.pop();\n var filenamePieces = uriFilename.split('.');\n // Only one piece means there is no extension.\n if (filenamePieces.length > 1) {\n extension = filenamePieces.pop().toLowerCase();\n factory = shaka.media.ManifestParser.parsersByExtension[extension];\n }\n }\n\n if (factory)\n return Promise.resolve(factory);\n\n // Try to choose a manifest parser by MIME type.\n var headRequest =\n shaka.net.NetworkingEngine.makeRequest([manifestUri], retryParams);\n headRequest.method = 'HEAD';\n var type = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n\n return netEngine.request(type, headRequest).then(\n function(response) {\n var mimeType = response.headers['content-type'];\n // https://goo.gl/yzKDRx says this header should always be available,\n // but just to be safe:\n if (mimeType) {\n mimeType = mimeType.toLowerCase();\n }\n factory = shaka.media.ManifestParser.parsersByMime[mimeType];\n if (!factory) {\n shaka.log.error(\n 'Unable to guess manifest type by file extension ' +\n 'or by MIME type.', extension, mimeType);\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.UNABLE_TO_GUESS_MANIFEST_TYPE,\n manifestUri));\n }\n return factory;\n }, function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Incorrect error type');\n shaka.log.error('HEAD request to guess manifest type failed!', error);\n error.severity = shaka.util.Error.Severity.CRITICAL;\n return Promise.reject(error);\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/manifest_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.PresentationTimeline');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.SegmentReference');\n\n\n\n/**\n * Creates a PresentationTimeline.\n *\n * @param {?number} presentationStartTime The wall-clock time, in seconds,\n * when the presentation started or will start. Only required for live.\n * @param {number} presentationDelay The delay to give the presentation, in\n * seconds. Only required for live.\n *\n * @see {shakaExtern.Manifest}\n * @see {@tutorial architecture}\n *\n * @constructor\n * @struct\n * @export\n */\nshaka.media.PresentationTimeline = function(\n presentationStartTime, presentationDelay) {\n /** @private {?number} */\n this.presentationStartTime_ = presentationStartTime;\n\n /** @private {number} */\n this.presentationDelay_ = presentationDelay;\n\n /** @private {number} */\n this.duration_ = Infinity;\n\n /** @private {number} */\n this.segmentAvailabilityDuration_ = Infinity;\n\n /** @private {?number} */\n this.maxSegmentDuration_ = 1;\n\n /** @private {number} */\n this.clockOffset_ = 0;\n\n /** @private {boolean} */\n this.static_ = true;\n};\n\n\n/**\n * @return {number} The presentation's duration in seconds.\n * Infinity indicates that the presentation continues indefinitely.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getDuration = function() {\n return this.duration_;\n};\n\n\n/**\n * Sets the presentation's duration.\n *\n * @param {number} duration The presentation's duration in seconds.\n * Infinity indicates that the presentation continues indefinitely.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setDuration = function(duration) {\n goog.asserts.assert(duration > 0, 'duration must be > 0');\n this.duration_ = duration;\n};\n\n\n/**\n * @return {?number} The presentation's start time in seconds.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getPresentationStartTime =\n function() {\n return this.presentationStartTime_;\n};\n\n\n/**\n * Sets the clock offset, which is the the difference between the client's clock\n * and the server's clock, in milliseconds (i.e., serverTime = Date.now() +\n * clockOffset).\n *\n * @param {number} offset The clock offset, in ms.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setClockOffset = function(offset) {\n this.clockOffset_ = offset;\n};\n\n\n/**\n * Sets the presentation's static flag.\n *\n * @param {boolean} isStatic If true, the presentation is static, meaning all\n * segments are available at once.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setStatic = function(isStatic) {\n // NOTE: the argument name is not \"static\" because that's a keyword in ES6\n this.static_ = isStatic;\n};\n\n\n/**\n * Gets the presentation's segment availability duration, which is the amount\n * of time, in seconds, that the start of a segment remains available after the\n * live-edge moves past the end of that segment. Infinity indicates that\n * segments remain available indefinitely. For example, if your live\n * presentation has a 5 minute DVR window and your segments are 10 seconds long\n * then the segment availability duration should be 4 minutes and 50 seconds.\n *\n * @return {number} The presentation's segment availability duration.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSegmentAvailabilityDuration =\n function() {\n return this.segmentAvailabilityDuration_;\n};\n\n\n/**\n * Sets the presentation's segment availability duration. The segment\n * availability duration should only be set for live.\n *\n * @param {number} segmentAvailabilityDuration The presentation's new segment\n * availability duration in seconds.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.setSegmentAvailabilityDuration =\n function(segmentAvailabilityDuration) {\n goog.asserts.assert(segmentAvailabilityDuration >= 0,\n 'segmentAvailabilityDuration must be >= 0');\n this.segmentAvailabilityDuration_ = segmentAvailabilityDuration;\n};\n\n\n/**\n * Gives PresentationTimeline a Stream's segments so it can size and position\n * the segment availability window, and account for missing segment\n * information. This function should be called once for each Stream (no more,\n * no less).\n *\n * @param {number} periodStartTime\n * @param {!Array.<!shaka.media.SegmentReference>} references\n * @export\n */\nshaka.media.PresentationTimeline.prototype.notifySegments = function(\n periodStartTime, references) {\n if (references.length == 0)\n return;\n\n this.maxSegmentDuration_ = references.reduce(\n function(max, r) { return Math.max(max, r.endTime - r.startTime); },\n this.maxSegmentDuration_);\n\n shaka.log.v1('notifySegments:',\n 'maxSegmentDuration=' + this.maxSegmentDuration_);\n};\n\n\n/**\n * Gives PresentationTimeline a Stream's maximum segment duration so it can\n * size and position the segment availability window. This function should be\n * called once for each Stream (no more, no less), but does not have to be\n * called if notifySegments() is called instead for a particular stream.\n *\n * @param {number} maxSegmentDuration The maximum segment duration for a\n * particular stream.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.notifyMaxSegmentDuration = function(\n maxSegmentDuration) {\n this.maxSegmentDuration_ = Math.max(\n this.maxSegmentDuration_, maxSegmentDuration);\n\n shaka.log.v1('notifyNewSegmentDuration:',\n 'maxSegmentDuration=' + this.maxSegmentDuration_);\n};\n\n\n/**\n * @return {boolean} True if the presentation is live; otherwise, return\n * false.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.isLive = function() {\n return this.duration_ == Infinity &&\n !this.static_;\n};\n\n\n/**\n * @return {boolean} True if the presentation is in progress (meaning not live,\n * but also not completely available); otherwise, return false.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.isInProgress = function() {\n return this.duration_ != Infinity &&\n !this.static_;\n};\n\n\n/**\n * Gets the presentation's current segment availability start time. Segments\n * ending at or before this time should be assumed to be unavailable.\n *\n * @return {number} The current segment availability start time, in seconds,\n * relative to the start of the presentation.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSegmentAvailabilityStart =\n function() {\n return this.getSafeAvailabilityStart(0 /* delay */);\n};\n\n\n/**\n * Gets the presentation's current segment availability start time, offset by\n * the given amount. This is used to ensure that we don't \"fall\" back out of\n * the availability window while we are buffering.\n *\n * @param {number} offset The offset to add to the start time.\n * @return {number} The current segment availability start time, in seconds,\n * relative to the start of the presentation.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSafeAvailabilityStart =\n function(offset) {\n if (this.segmentAvailabilityDuration_ == Infinity)\n return 0;\n\n var end = this.getSegmentAvailabilityEnd();\n var start = Math.min(end - this.segmentAvailabilityDuration_ + offset, end);\n return Math.max(0, start);\n};\n\n\n/**\n * Gets the presentation's current segment availability end time. Segments\n * starting after this time should be assumed to be unavailable.\n *\n * @return {number} The current segment availability end time, in seconds,\n * relative to the start of the presentation. Always returns the\n * presentation's duration for video-on-demand.\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSegmentAvailabilityEnd =\n function() {\n if (!this.isLive() && !this.isInProgress())\n return this.duration_;\n\n return Math.min(this.getLiveEdge_(), this.duration_);\n};\n\n\n/**\n * Gets the seek range end.\n *\n * @return {number}\n * @export\n */\nshaka.media.PresentationTimeline.prototype.getSeekRangeEnd = function() {\n var useDelay = this.isLive() || this.isInProgress();\n var delay = useDelay ? this.presentationDelay_ : 0;\n return Math.max(0, this.getSegmentAvailabilityEnd() - delay);\n};\n\n\n/**\n * @return {number} The current presentation time in seconds.\n * @private\n */\nshaka.media.PresentationTimeline.prototype.getLiveEdge_ = function() {\n goog.asserts.assert(this.presentationStartTime_ != null,\n 'Cannot compute timeline live edge without start time');\n var now = (Date.now() + this.clockOffset_) / 1000.0;\n return Math.max(\n 0, now - this.maxSegmentDuration_ - this.presentationStartTime_);\n};\n\n\nif (!COMPILED) {\n /**\n * Debug only: assert that the timeline parameters make sense for the type of\n * presentation (VOD, IPR, live).\n */\n shaka.media.PresentationTimeline.prototype.assertIsValid = function() {\n if (this.isLive()) {\n // Implied by isLive(): infinite and dynamic.\n // Live streams should have a start time.\n goog.asserts.assert(this.presentationStartTime_ != null,\n 'Detected as live stream, but does not match our model of live!');\n } else if (this.isInProgress()) {\n // Implied by isInProgress(): finite and dynamic.\n // IPR streams should have a start time, and segments should not expire.\n goog.asserts.assert(this.presentationStartTime_ != null &&\n this.segmentAvailabilityDuration_ == Infinity,\n 'Detected as IPR stream, but does not match our model of IPR!');\n } else { // VOD\n // VOD segments should not expire and the presentation should be finite\n // and static.\n goog.asserts.assert(this.segmentAvailabilityDuration_ == Infinity &&\n this.duration_ != Infinity &&\n this.static_,\n 'Detected as VOD stream, but does not match our model of VOD!');\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/presentation_timeline.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.dash.DashParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.dash.ContentProtection');\ngoog.require('shaka.dash.SegmentBase');\ngoog.require('shaka.dash.SegmentList');\ngoog.require('shaka.dash.SegmentTemplate');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.LanguageUtils');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.XmlUtils');\n\n\n\n/**\n * Creates a new DASH parser.\n *\n * @struct\n * @constructor\n * @implements {shakaExtern.ManifestParser}\n * @export\n */\nshaka.dash.DashParser = function() {\n /** @private {?shakaExtern.ManifestConfiguration} */\n this.config_ = null;\n\n /** @private {?shakaExtern.ManifestParser.PlayerInterface} */\n this.playerInterface_ = null;\n\n /** @private {!Array.<string>} */\n this.manifestUris_ = [];\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = null;\n\n /** @private {!Array.<string>} */\n this.periodIds_ = [];\n\n /** @private {number} */\n this.globalId_ = 1;\n\n /**\n * A map of IDs to SegmentIndex objects.\n * ID: Period@id,AdaptationSet@id,@Representation@id\n * e.g.: '1,5,23'\n * @private {!Object.<string, !shaka.media.SegmentIndex>}\n */\n this.segmentIndexMap_ = {};\n\n /**\n * The update period in seconds; or 0 for no updates.\n * @private {number}\n */\n this.updatePeriod_ = 0;\n\n /** @private {?number} */\n this.updateTimer_ = null;\n};\n\n\n/**\n * Contains the minimum amount of time, in seconds, between manifest update\n * requests.\n *\n * @private\n * @const {number}\n */\nshaka.dash.DashParser.MIN_UPDATE_PERIOD_ = 3;\n\n\n/**\n * The default MPD@suggestedPresentationDelay in seconds.\n *\n * @private\n * @const {number}\n */\nshaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_ = 10;\n\n\n/**\n * @typedef {\n * !function(!Array.<string>, ?number, ?number):!Promise.<!ArrayBuffer>\n * }\n */\nshaka.dash.DashParser.RequestInitSegmentCallback;\n\n\n/**\n * @typedef {{\n * segmentBase: Element,\n * segmentList: Element,\n * segmentTemplate: Element,\n * baseUris: !Array.<string>,\n * width: (number|undefined),\n * height: (number|undefined),\n * contentType: string,\n * mimeType: string,\n * codecs: string,\n * frameRate: (number|undefined),\n * containsEmsgBoxes: boolean,\n * id: string\n * }}\n *\n * @description\n * A collection of elements and properties which are inherited across levels\n * of a DASH manifest.\n *\n * @property {Element} segmentBase\n * The XML node for SegmentBase.\n * @property {Element} segmentList\n * The XML node for SegmentList.\n * @property {Element} segmentTemplate\n * The XML node for SegmentTemplate.\n * @property {!Array.<string>} baseUris\n * An array of absolute base URIs for the frame.\n * @property {(number|undefined)} width\n * The inherited width value.\n * @property {(number|undefined)} height\n * The inherited height value.\n * @property {string} contentType\n * The inherited media type.\n * @property {string} mimeType\n * The inherited MIME type value.\n * @property {string} codecs\n * The inherited codecs value.\n * @property {(number|undefined)} frameRate\n * The inherited framerate value.\n * @property {boolean} containsEmsgBoxes\n * Whether there are 'emsg' boxes.\n * @property {string} id\n * The ID of the element.\n */\nshaka.dash.DashParser.InheritanceFrame;\n\n\n/**\n * @typedef {{\n * dynamic: boolean,\n * presentationTimeline: !shaka.media.PresentationTimeline,\n * period: ?shaka.dash.DashParser.InheritanceFrame,\n * periodInfo: ?shaka.dash.DashParser.PeriodInfo,\n * adaptationSet: ?shaka.dash.DashParser.InheritanceFrame,\n * representation: ?shaka.dash.DashParser.InheritanceFrame,\n * bandwidth: (number|undefined),\n * indexRangeWarningGiven: boolean\n * }}\n *\n * @description\n * Contains context data for the streams.\n *\n * @property {boolean} dynamic\n * True if the MPD is dynamic (not all segments available at once)\n * @property {!shaka.media.PresentationTimeline} presentationTimeline\n * The PresentationTimeline.\n * @property {?shaka.dash.DashParser.InheritanceFrame} period\n * The inheritance from the Period element.\n * @property {?shaka.dash.DashParser.PeriodInfo} periodInfo\n * The Period info for the current Period.\n * @property {?shaka.dash.DashParser.InheritanceFrame} adaptationSet\n * The inheritance from the AdaptationSet element.\n * @property {?shaka.dash.DashParser.InheritanceFrame} representation\n * The inheritance from the Representation element.\n * @property {(number|undefined)} bandwidth\n * The bandwidth of the Representation.\n * @property {boolean} indexRangeWarningGiven\n * True if the warning about SegmentURL@indexRange has been printed.\n */\nshaka.dash.DashParser.Context;\n\n\n/**\n * @typedef {{\n * start: number,\n * duration: ?number,\n * node: !Element,\n * isLastPeriod: boolean\n * }}\n *\n * @description\n * Contains information about a Period element.\n *\n * @property {number} start\n * The start time of the period.\n * @property {?number} duration\n * The duration of the period; or null if the duration is not given. This\n * will be non-null for all periods except the last.\n * @property {!Element} node\n * The XML Node for the Period.\n * @property {boolean} isLastPeriod\n * Whether this Period is the last one in the manifest.\n */\nshaka.dash.DashParser.PeriodInfo;\n\n\n/**\n * @typedef {{\n * id: string,\n * contentType: ?string,\n * language: string,\n * main: boolean,\n * streams: !Array.<shakaExtern.Stream>,\n * drmInfos: !Array.<shakaExtern.DrmInfo>,\n * trickModeFor: ?string,\n * representationIds: !Array.<string>\n * }}\n *\n * @description\n * Contains information about an AdaptationSet element.\n *\n * @property {string} id\n * The unique ID of the adaptation set.\n * @property {?string} contentType\n * The content type of the AdaptationSet.\n * @property {string} language\n * The language of the AdaptationSet.\n * @property {boolean} main\n * Whether the AdaptationSet has the 'main' type.\n * @property {!Array.<shakaExtern.Stream>} streams\n * The streams this AdaptationSet contains.\n * @property {!Array.<shakaExtern.DrmInfo>} drmInfos\n * The DRM info for the AdaptationSet.\n * @property {?string} trickModeFor\n * If non-null, this AdaptationInfo represents trick mode tracks. This\n * property is the ID of the normal AdaptationSet these tracks should be\n * associated with.\n * @property {!Array.<string>} representationIds\n * An array of the IDs of the Representations this AdaptationSet contains.\n */\nshaka.dash.DashParser.AdaptationInfo;\n\n\n/**\n * @typedef {{\n * createSegmentIndex: shakaExtern.CreateSegmentIndexFunction,\n * findSegmentPosition: shakaExtern.FindSegmentPositionFunction,\n * getSegmentReference: shakaExtern.GetSegmentReferenceFunction\n * }}\n *\n * @description\n * Contains functions used to create and find segment references.\n *\n * @property {shakaExtern.CreateSegmentIndexFunction} createSegmentIndex\n * The createSegmentIndex function.\n * @property {shakaExtern.FindSegmentPositionFunction} findSegmentPosition\n * The findSegmentPosition function.\n * @property {shakaExtern.GetSegmentReferenceFunction} getSegmentReference\n * The getSegmentReference function.\n */\nshaka.dash.DashParser.SegmentIndexFunctions;\n\n\n/**\n * @typedef {{\n * createSegmentIndex: shakaExtern.CreateSegmentIndexFunction,\n * findSegmentPosition: shakaExtern.FindSegmentPositionFunction,\n * getSegmentReference: shakaExtern.GetSegmentReferenceFunction,\n * initSegmentReference: shaka.media.InitSegmentReference,\n * presentationTimeOffset: (number|undefined)\n * }}\n *\n * @description\n * Contains information about a Stream. This is passed from the createStream\n * methods.\n *\n * @property {shakaExtern.CreateSegmentIndexFunction} createSegmentIndex\n * The createSegmentIndex function for the stream.\n * @property {shakaExtern.FindSegmentPositionFunction} findSegmentPosition\n * The findSegmentPosition function for the stream.\n * @property {shakaExtern.GetSegmentReferenceFunction} getSegmentReference\n * The getSegmentReference function for the stream.\n * @property {shaka.media.InitSegmentReference} initSegmentReference\n * The init segment for the stream.\n * @property {(number|undefined)} presentationTimeOffset\n * The presentationTimeOffset for the stream.\n */\nshaka.dash.DashParser.StreamInfo;\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.configure = function(config) {\n goog.asserts.assert(config.dash != null,\n 'DashManifestConfiguration should not be null!');\n\n this.config_ = config;\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.start = function(uri, playerInterface) {\n goog.asserts.assert(this.config_, 'Must call configure() before start()!');\n this.manifestUris_ = [uri];\n this.playerInterface_ = playerInterface;\n return this.requestManifest_().then(function() {\n if (this.playerInterface_)\n this.setUpdateTimer_(0);\n return this.manifest_;\n }.bind(this));\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.stop = function() {\n this.playerInterface_ = null;\n this.config_ = null;\n\n this.manifestUris_ = [];\n this.manifest_ = null;\n this.periodIds_ = [];\n this.segmentIndexMap_ = {};\n if (this.updateTimer_ != null) {\n window.clearTimeout(this.updateTimer_);\n this.updateTimer_ = null;\n }\n\n return Promise.resolve();\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.update = function() {\n this.requestManifest_().catch(function(error) {\n if (!this.playerInterface_) return;\n this.playerInterface_.onError(error);\n }.bind(this));\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.dash.DashParser.prototype.onExpirationUpdated = function(\n sessionId, expiration) {\n // No-op\n};\n\n\n/**\n * Makes a network request for the manifest and parses the resulting data.\n *\n * @return {!Promise}\n * @private\n */\nshaka.dash.DashParser.prototype.requestManifest_ = function() {\n var requestType = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n var request = shaka.net.NetworkingEngine.makeRequest(\n this.manifestUris_, this.config_.retryParameters);\n return this.playerInterface_.networkingEngine.request(requestType, request)\n .then(function(response) {\n // Detect calls to stop().\n if (!this.playerInterface_)\n return;\n\n // This may throw; but it will result in a failed promise.\n return this.parseManifest_(response.data, response.uri);\n }.bind(this));\n};\n\n\n/**\n * Parses the manifest XML. This also handles updates and will update the\n * stored manifest.\n *\n * @param {!ArrayBuffer} data\n * @param {string} finalManifestUri The final manifest URI, which may\n * differ from this.manifestUri_ if there has been a redirect.\n * @return {!Promise}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parseManifest_ =\n function(data, finalManifestUri) {\n var Error = shaka.util.Error;\n var Functional = shaka.util.Functional;\n var XmlUtils = shaka.util.XmlUtils;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n\n var string = shaka.util.StringUtils.fromUTF8(data);\n var parser = new DOMParser();\n var xml = null;\n var mpd = null;\n\n try {\n xml = parser.parseFromString(string, 'text/xml');\n } catch (exception) {}\n if (xml) {\n // parseFromString returns a Document object. A Document is a Node but not\n // an Element, so it cannot be used in XmlUtils (technically it can but the\n // types don't match). The |documentElement| member defines the top-level\n // element in the document.\n if (xml.documentElement.tagName == 'MPD')\n mpd = xml.documentElement;\n }\n if (mpd && mpd.getElementsByTagName('parsererror').length > 0)\n mpd = null; // It had a parser error in it.\n if (!mpd) {\n throw new Error(\n Error.Severity.CRITICAL, Error.Category.MANIFEST,\n Error.Code.DASH_INVALID_XML);\n }\n\n // Get any Location elements. This will update the manifest location and\n // the base URI.\n /** @type {!Array.<string>} */\n var manifestBaseUris = [finalManifestUri];\n /** @type {!Array.<string>} */\n var locations = XmlUtils.findChildren(mpd, 'Location')\n .map(XmlUtils.getContents)\n .filter(Functional.isNotNull);\n if (locations.length > 0) {\n this.manifestUris_ = locations;\n manifestBaseUris = locations;\n }\n\n var uris = XmlUtils.findChildren(mpd, 'BaseURL').map(XmlUtils.getContents);\n var baseUris = ManifestParserUtils.resolveUris(manifestBaseUris, uris);\n\n var minBufferTime =\n XmlUtils.parseAttr(mpd, 'minBufferTime', XmlUtils.parseDuration);\n this.updatePeriod_ = /** @type {number} */ (XmlUtils.parseAttr(\n mpd, 'minimumUpdatePeriod', XmlUtils.parseDuration, -1));\n\n var presentationStartTime = XmlUtils.parseAttr(\n mpd, 'availabilityStartTime', XmlUtils.parseDate);\n var segmentAvailabilityDuration = XmlUtils.parseAttr(\n mpd, 'timeShiftBufferDepth', XmlUtils.parseDuration);\n var suggestedPresentationDelay = XmlUtils.parseAttr(\n mpd, 'suggestedPresentationDelay', XmlUtils.parseDuration);\n var maxSegmentDuration = XmlUtils.parseAttr(\n mpd, 'maxSegmentDuration', XmlUtils.parseDuration);\n var mpdType = mpd.getAttribute('type') || 'static';\n\n var presentationTimeline;\n if (this.manifest_) {\n presentationTimeline = this.manifest_.presentationTimeline;\n } else {\n // DASH IOP v3.0 suggests using a default delay between minBufferTime and\n // timeShiftBufferDepth. This is literally the range of all feasible\n // choices for the value. Nothing older than timeShiftBufferDepth is still\n // available, and anything less than minBufferTime will cause buffering\n // issues.\n //\n // We have decided that our default will be 1.5 * minBufferTime, or 10s,\n // whichever is larger. This is fairly conservative. Content providers\n // should provide a suggestedPresentationDelay whenever possible to optimize\n // the live streaming experience.\n var defaultPresentationDelay = Math.max(\n shaka.dash.DashParser.DEFAULT_SUGGESTED_PRESENTATION_DELAY_,\n minBufferTime * 1.5);\n var presentationDelay = suggestedPresentationDelay != null ?\n suggestedPresentationDelay : defaultPresentationDelay;\n presentationTimeline = new shaka.media.PresentationTimeline(\n presentationStartTime, presentationDelay);\n }\n\n /** @type {shaka.dash.DashParser.Context} */\n var context = {\n // Don't base on updatePeriod_ since emsg boxes can cause manifest updates.\n dynamic: mpdType != 'static',\n presentationTimeline: presentationTimeline,\n period: null,\n periodInfo: null,\n adaptationSet: null,\n representation: null,\n bandwidth: undefined,\n indexRangeWarningGiven: false\n };\n\n var periodsAndDuration = this.parsePeriods_(context, baseUris, mpd);\n var duration = periodsAndDuration.duration;\n var periods = periodsAndDuration.periods;\n\n presentationTimeline.setStatic(mpdType == 'static');\n presentationTimeline.setDuration(duration || Infinity);\n presentationTimeline.setSegmentAvailabilityDuration(\n segmentAvailabilityDuration != null ?\n segmentAvailabilityDuration :\n Infinity);\n // Use @maxSegmentDuration to override smaller, derived values.\n presentationTimeline.notifyMaxSegmentDuration(maxSegmentDuration || 1);\n if (!COMPILED) presentationTimeline.assertIsValid();\n\n if (this.manifest_) {\n // This is a manifest update, so we're done.\n return Promise.resolve();\n }\n\n // This is the first manifest parse, so we cannot return until we calculate\n // the clock offset.\n var timingElements = XmlUtils.findChildren(mpd, 'UTCTiming');\n\n var isLive = presentationTimeline.isLive();\n\n return this.parseUtcTiming_(\n baseUris, timingElements, isLive).then(function(offset) {\n // Detect calls to stop().\n if (!this.playerInterface_)\n return;\n\n presentationTimeline.setClockOffset(offset);\n\n this.manifest_ = {\n presentationTimeline: presentationTimeline,\n periods: periods,\n offlineSessionIds: [],\n minBufferTime: minBufferTime || 0\n };\n }.bind(this));\n};\n\n\n/**\n * Reads and parses the periods from the manifest. This first does some\n * partial parsing so the start and duration is available when parsing children.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Array.<string>} baseUris\n * @param {!Element} mpd\n * @return {{periods: !Array.<shakaExtern.Period>, duration: ?number}}\n * @private\n */\nshaka.dash.DashParser.prototype.parsePeriods_ = function(\n context, baseUris, mpd) {\n var Functional = shaka.util.Functional;\n var XmlUtils = shaka.util.XmlUtils;\n var presentationDuration = XmlUtils.parseAttr(\n mpd, 'mediaPresentationDuration', XmlUtils.parseDuration);\n\n var periods = [];\n var prevEnd = 0;\n var periodNodes = XmlUtils.findChildren(mpd, 'Period');\n for (var i = 0; i < periodNodes.length; i++) {\n var elem = periodNodes[i];\n var start = /** @type {number} */ (\n XmlUtils.parseAttr(elem, 'start', XmlUtils.parseDuration, prevEnd));\n var givenDuration =\n XmlUtils.parseAttr(elem, 'duration', XmlUtils.parseDuration);\n\n var periodDuration = null;\n if (i != periodNodes.length - 1) {\n // \"The difference between the start time of a Period and the start time\n // of the following Period is the duration of the media content\n // represented by this Period.\"\n var nextPeriod = periodNodes[i + 1];\n var nextStart =\n XmlUtils.parseAttr(nextPeriod, 'start', XmlUtils.parseDuration);\n if (nextStart != null)\n periodDuration = nextStart - start;\n } else if (presentationDuration != null) {\n // \"The Period extends until the Period.start of the next Period, or\n // until the end of the Media Presentation in the case of the last\n // Period.\"\n periodDuration = presentationDuration - start;\n }\n\n if (periodDuration && givenDuration && periodDuration != givenDuration) {\n shaka.log.warning('There is a gap/overlap between Periods', elem);\n }\n // Only use the @duration in the MPD if we can't calculate it. We should\n // favor the @start of the following Period. This ensures that there aren't\n // gaps between Periods.\n if (periodDuration == null)\n periodDuration = givenDuration;\n\n\n // Parse child nodes.\n var info = {\n start: start,\n duration: periodDuration,\n node: elem,\n isLastPeriod: periodDuration == null || i == periodNodes.length - 1\n };\n var period = this.parsePeriod_(context, baseUris, info);\n periods.push(period);\n\n // If there are any new periods, call the callback and add them to the\n // manifest. If this is the first parse, it will see all of them as new.\n var periodId = context.period.id;\n if (this.periodIds_.every(Functional.isNotEqualFunc(periodId))) {\n this.playerInterface_.filterPeriod(period);\n this.periodIds_.push(periodId);\n if (this.manifest_)\n this.manifest_.periods.push(period);\n }\n\n\n if (periodDuration == null) {\n if (i != periodNodes.length - 1) {\n // If the duration is still null and we aren't at the end, then we will\n // skip any remaining periods.\n shaka.log.warning(\n 'Skipping Period', i + 1, 'and any subsequent Periods:', 'Period',\n i + 1, 'does not have a valid start time.', periods[i + 1]);\n }\n\n // The duration is unknown, so the end is unknown.\n prevEnd = null;\n break;\n }\n\n prevEnd = start + periodDuration;\n }\n\n if (presentationDuration != null) {\n if (prevEnd != presentationDuration) {\n shaka.log.warning(\n '@mediaPresentationDuration does not match the total duration of all',\n 'Periods.');\n // Assume @mediaPresentationDuration is correct.\n }\n return {\n periods: periods,\n duration: presentationDuration\n };\n } else {\n return {\n periods: periods,\n duration: prevEnd\n };\n }\n};\n\n\n/**\n * Parses a Period XML element. Unlike the other parse methods, this is not\n * given the Node; it is given a PeriodInfo structure. Also, partial parsing\n * was done before this was called so start and duration are valid.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Array.<string>} baseUris\n * @param {shaka.dash.DashParser.PeriodInfo} periodInfo\n * @return {shakaExtern.Period}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parsePeriod_ = function(\n context, baseUris, periodInfo) {\n var Functional = shaka.util.Functional;\n var XmlUtils = shaka.util.XmlUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n context.period = this.createFrame_(periodInfo.node, null, baseUris);\n context.periodInfo = periodInfo;\n\n // If the period doesn't have an ID, give it one based on its start time.\n if (!context.period.id) {\n shaka.log.info(\n 'No Period ID given for Period with start time ' + periodInfo.start +\n ', Assigning a default');\n context.period.id = '__shaka_period_' + periodInfo.start;\n }\n\n var eventStreamNodes = XmlUtils.findChildren(periodInfo.node, 'EventStream');\n eventStreamNodes.forEach(\n this.parseEventStream_.bind(this, periodInfo.start, periodInfo.duration));\n\n var adaptationSetNodes =\n XmlUtils.findChildren(periodInfo.node, 'AdaptationSet');\n var adaptationSets = adaptationSetNodes\n .map(this.parseAdaptationSet_.bind(this, context))\n .filter(Functional.isNotNull);\n\n var representationIds = adaptationSets\n .map(function(as) { return as.representationIds; })\n .reduce(Functional.collapseArrays, []);\n var uniqueRepIds = representationIds.filter(Functional.isNotDuplicate);\n if (context.dynamic && representationIds.length != uniqueRepIds.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_DUPLICATE_REPRESENTATION_ID);\n }\n\n var normalAdaptationSets = adaptationSets\n .filter(function(as) { return !as.trickModeFor; });\n\n var trickModeAdaptationSets = adaptationSets\n .filter(function(as) { return as.trickModeFor; });\n\n // Attach trick mode tracks to normal tracks.\n trickModeAdaptationSets.forEach(function(trickModeSet) {\n // There may be multiple trick mode streams, but we do not currently\n // support that. Just choose one.\n var trickModeVideo = trickModeSet.streams[0];\n var targetId = trickModeSet.trickModeFor;\n normalAdaptationSets.forEach(function(normalSet) {\n if (normalSet.id == targetId) {\n normalSet.streams.forEach(function(stream) {\n stream.trickModeVideo = trickModeVideo;\n });\n }\n });\n });\n\n var videoSets = this.getSetsOfType_(normalAdaptationSets, ContentType.VIDEO);\n var audioSets = this.getSetsOfType_(normalAdaptationSets, ContentType.AUDIO);\n\n if (!videoSets.length && !audioSets.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_EMPTY_PERIOD);\n }\n\n // In case of audio-only or video-only content, we create an array of one item\n // containing a null. This way, the double-loop works for all kinds of\n // content.\n if (!audioSets.length) {\n audioSets = [null];\n }\n if (!videoSets.length) {\n videoSets = [null];\n }\n\n // TODO: Limit number of combinations. Come up with a heuristic\n // to decide which audio tracks to combine with which video tracks.\n var variants = [];\n for (var i = 0; i < audioSets.length; i++) {\n for (var j = 0; j < videoSets.length; j++) {\n var audioSet = audioSets[i];\n var videoSet = videoSets[j];\n this.createVariants_(audioSet, videoSet, variants);\n }\n }\n\n var textSets = this.getSetsOfType_(normalAdaptationSets, ContentType.TEXT);\n var textStreams = [];\n for (var i = 0; i < textSets.length; i++) {\n textStreams.push.apply(textStreams, textSets[i].streams);\n }\n\n return {\n startTime: periodInfo.start,\n textStreams: textStreams,\n variants: variants\n };\n};\n\n\n/**\n * @param {!Array.<!shaka.dash.DashParser.AdaptationInfo>} adaptationSets\n * @param {string} type\n * @return {!Array.<!shaka.dash.DashParser.AdaptationInfo>}\n * @private\n */\nshaka.dash.DashParser.prototype.getSetsOfType_ = function(\n adaptationSets, type) {\n return adaptationSets.filter(function(as) {\n return as.contentType == type;\n });\n};\n\n\n/**\n * Combines Streams into Variants\n *\n * @param {?shaka.dash.DashParser.AdaptationInfo} audio\n * @param {?shaka.dash.DashParser.AdaptationInfo} video\n * @param {!Array.<shakaExtern.Variant>} variants New variants are pushed onto\n * this array.\n * @private\n */\nshaka.dash.DashParser.prototype.createVariants_ =\n function(audio, video, variants) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Since both audio and video are of the same type, this assertion will catch\n // certain mistakes at runtime that the compiler would miss.\n goog.asserts.assert(!audio || audio.contentType == ContentType.AUDIO,\n 'Audio parameter mismatch!');\n goog.asserts.assert(!video || video.contentType == ContentType.VIDEO,\n 'Video parameter mismatch!');\n\n /** @type {number} */\n var bandwidth;\n /** @type {shakaExtern.Variant} */\n var variant;\n\n if (!audio && !video) {\n return;\n } else if (audio && video) {\n // Audio+video variants\n var DrmEngine = shaka.media.DrmEngine;\n if (DrmEngine.areDrmCompatible(audio.drmInfos, video.drmInfos)) {\n var drmInfos = DrmEngine.getCommonDrmInfos(audio.drmInfos,\n video.drmInfos);\n\n for (var i = 0; i < audio.streams.length; i++) {\n for (var j = 0; j < video.streams.length; j++) {\n // Explicit cast, followed by assertion. These should both be defined\n // in the case of DASH, but the type of Stream.bandwidth allows for\n // undefined in order to support HLS.\n bandwidth = /** @type {number} */(\n video.streams[j].bandwidth +\n audio.streams[i].bandwidth);\n goog.asserts.assert(bandwidth,\n 'Bandwidth must be defined and non-zero!');\n variant = {\n id: this.globalId_++,\n language: audio.language,\n primary: audio.main || video.main,\n audio: audio.streams[i],\n video: video.streams[j],\n bandwidth: bandwidth,\n drmInfos: drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n\n variants.push(variant);\n }\n }\n }\n } else {\n // Audio or video only variants\n var set = audio || video;\n for (var i = 0; i < set.streams.length; i++) {\n // Explicit cast, followed by assertion. These should both be defined\n // in the case of DASH, but the type allows for undefined in order to\n // support HLS.\n bandwidth = /** @type {number} */(set.streams[i].bandwidth);\n goog.asserts.assert(bandwidth,\n 'Bandwidth must be defined and non-zero!');\n variant = {\n id: this.globalId_++,\n language: set.language || 'und',\n primary: set.main,\n audio: audio ? set.streams[i] : null,\n video: video ? set.streams[i] : null,\n bandwidth: bandwidth,\n drmInfos: set.drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n\n variants.push(variant);\n }\n }\n};\n\n\n/**\n * Parses an AdaptationSet XML element.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {!Element} elem The AdaptationSet element.\n * @return {?shaka.dash.DashParser.AdaptationInfo}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parseAdaptationSet_ = function(context, elem) {\n var XmlUtils = shaka.util.XmlUtils;\n var Functional = shaka.util.Functional;\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var ContentType = ManifestParserUtils.ContentType;\n\n context.adaptationSet = this.createFrame_(elem, context.period, null);\n\n var main = false;\n var roleElements = XmlUtils.findChildren(elem, 'Role');\n var roleValues = roleElements.map(function(role) {\n return role.getAttribute('value');\n }).filter(Functional.isNotNull);\n\n // Default kind for text streams is 'subtitle' if unspecified in the manifest.\n var kind = undefined;\n if (context.adaptationSet.contentType == ManifestParserUtils.ContentType.TEXT)\n kind = ManifestParserUtils.TextStreamKind.SUBTITLE;\n\n for (var i = 0; i < roleElements.length; i++) {\n var scheme = roleElements[i].getAttribute('schemeIdUri');\n if (scheme == null || scheme == 'urn:mpeg:dash:role:2011') {\n // These only apply for the given scheme, but allow them to be specified\n // if there is no scheme specified.\n // See: DASH section 5.8.5.5\n var value = roleElements[i].getAttribute('value');\n switch (value) {\n case 'main':\n main = true;\n break;\n case 'caption':\n case 'subtitle':\n kind = value;\n break;\n }\n }\n }\n\n var essentialProperties = XmlUtils.findChildren(elem, 'EssentialProperty');\n // ID of real AdaptationSet if this is a trick mode set:\n var trickModeFor = null;\n var unrecognizedEssentialProperty = false;\n essentialProperties.forEach(function(prop) {\n var schemeId = prop.getAttribute('schemeIdUri');\n if (schemeId == 'http://dashif.org/guidelines/trickmode') {\n trickModeFor = prop.getAttribute('value');\n } else {\n unrecognizedEssentialProperty = true;\n }\n });\n\n // According to DASH spec (2014) section 5.8.4.8, \"the successful processing\n // of the descriptor is essential to properly use the information in the\n // parent element\". According to DASH IOP v3.3, section 3.3.4, \"if the scheme\n // or the value\" for EssentialProperty is not recognized, \"the DASH client\n // shall ignore the parent element.\"\n if (unrecognizedEssentialProperty) {\n // Stop parsing this AdaptationSet and let the caller filter out the nulls.\n return null;\n }\n\n var contentProtectionElems = XmlUtils.findChildren(elem, 'ContentProtection');\n var contentProtection = shaka.dash.ContentProtection.parseFromAdaptationSet(\n contentProtectionElems, this.config_.dash.customScheme,\n this.config_.dash.ignoreDrmInfo);\n\n var language =\n shaka.util.LanguageUtils.normalize(elem.getAttribute('lang') || 'und');\n\n // non-standard attribute(yet) supported by Kaltura\n var label = elem.getAttribute('label');\n\n // Parse Representations into Streams.\n var representations = XmlUtils.findChildren(elem, 'Representation');\n var streams = representations\n .map(this.parseRepresentation_.bind(this, context, contentProtection,\n kind, language, label, main, roleValues))\n .filter(function(s) { return !!s; });\n\n if (streams.length == 0) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.DASH_EMPTY_ADAPTATION_SET);\n }\n\n // If AdaptationSet's type is unknown or is ambiguously \"application\",\n // guess based on the information in the first stream. If the attributes\n // mimeType and codecs are split across levels, they will both be inherited\n // down to the stream level by this point, so the stream will have all the\n // necessary information.\n if (!context.adaptationSet.contentType ||\n context.adaptationSet.contentType == ContentType.APPLICATION) {\n var mimeType = streams[0].mimeType;\n var codecs = streams[0].codecs;\n context.adaptationSet.contentType =\n shaka.dash.DashParser.guessContentType_(mimeType, codecs);\n\n streams.forEach(function(stream) {\n stream.type = context.adaptationSet.contentType;\n });\n }\n\n streams.forEach(function(stream) {\n // Some DRM license providers require that we have a default\n // key ID from the manifest in the wrapped license request.\n // Thus, it should be put in drmInfo to be accessible to request filters.\n contentProtection.drmInfos.forEach(function(drmInfo) {\n if (stream.keyId) {\n drmInfo.keyIds.push(stream.keyId);\n }\n });\n });\n\n var repIds = representations\n .map(function(node) { return node.getAttribute('id'); })\n .filter(shaka.util.Functional.isNotNull);\n\n return {\n id: context.adaptationSet.id || ('__fake__' + this.globalId_++),\n contentType: context.adaptationSet.contentType,\n language: language,\n main: main,\n streams: streams,\n drmInfos: contentProtection.drmInfos,\n trickModeFor: trickModeFor,\n representationIds: repIds\n };\n};\n\n\n/**\n * Parses a Representation XML element.\n *\n * @param {shaka.dash.DashParser.Context} context\n * @param {shaka.dash.ContentProtection.Context} contentProtection\n * @param {(string|undefined)} kind\n * @param {string} language\n * @param {string} label\n * @param {boolean} isPrimary\n * @param {!Array.<string>} roles\n * @param {!Element} node\n * @return {?shakaExtern.Stream} The Stream, or null when there is a\n * non-critical parsing error.\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.dash.DashParser.prototype.parseRepresentation_ = function(\n context, contentProtection, kind, language, label, isPrimary, roles, node) {\n var XmlUtils = shaka.util.XmlUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n context.representation = this.createFrame_(node, context.adaptationSet, null);\n if (!this.verifyRepresentation_(context.representation)) {\n shaka.log.warning('Skipping Representation', context.representation);\n return null;\n }\n\n context.bandwidth =\n XmlUtils.parseAttr(node, 'bandwidth', XmlUtils.parsePositiveInt) ||\n undefined;\n\n /** @type {?shaka.dash.DashParser.StreamInfo} */\n var streamInfo;\n var requestInitSegment = this.requestInitSegment_.bind(this);\n if (context.representation.segmentBase) {\n streamInfo = shaka.dash.SegmentBase.createStream(\n context, requestInitSegment);\n } else if (context.representation.segmentList) {\n streamInfo = shaka.dash.SegmentList.createStream(\n context, this.segmentIndexMap_);\n } else if (context.representation.segmentTemplate) {\n streamInfo = shaka.dash.SegmentTemplate.createStream(\n context, requestInitSegment, this.segmentIndexMap_, !!this.manifest_);\n } else {\n goog.asserts.assert(\n context.representation.contentType == ContentType.TEXT ||\n context.representation.contentType == ContentType.APPLICATION,\n 'Must have Segment* with non-text streams.');\n\n var baseUris = context.representation.baseUris;\n var duration = context.periodInfo.duration || 0;\n streamInfo = {\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition:\n /** @return {?number} */ function(/** number */ time) {\n if (time >= 0 && time < duration)\n return 1;\n else\n return null;\n },\n getSegmentReference:\n /** @return {shaka.media.SegmentReference} */\n function(/** number */ ref) {\n if (ref != 1)\n return null;\n\n return new shaka.media.SegmentReference(\n 1, 0, duration, function() { return baseUris; }, 0, null);\n },\n initSegmentReference: null,\n presentationTimeOffset: 0\n };\n }\n\n var contentProtectionElems = XmlUtils.findChildren(node, 'ContentProtection');\n var keyId = shaka.dash.ContentProtection.parseFromRepresentation(\n contentProtectionElems, this.config_.dash.customScheme,\n contentProtection, this.config_.dash.ignoreDrmInfo);\n\n return {\n id: this.globalId_++,\n createSegmentIndex: streamInfo.createSegmentIndex,\n findSegmentPosition: streamInfo.findSegmentPosition,\n getSegmentReference: streamInfo.getSegmentReference,\n initSegmentReference: streamInfo.initSegmentReference,\n presentationTimeOffset: streamInfo.presentationTimeOffset,\n mimeType: context.representation.mimeType,\n codecs: context.representation.codecs,\n frameRate: context.representation.frameRate,\n bandwidth: context.bandwidth,\n width: context.representation.width,\n height: context.representation.height,\n kind: kind,\n encrypted: contentProtection.drmInfos.length > 0,\n keyId: keyId,\n language: language,\n label: label,\n type: context.adaptationSet.contentType,\n primary: isPrimary,\n trickModeVideo: null,\n containsEmsgBoxes: context.representation.containsEmsgBoxes,\n roles: roles\n };\n};\n\n\n/**\n * Called when the update timer ticks.\n *\n * @private\n */\nshaka.dash.DashParser.prototype.onUpdate_ = function() {\n goog.asserts.assert(this.updateTimer_, 'Should only be called by timer');\n goog.asserts.assert(this.updatePeriod_ >= 0,\n 'There should be an update period');\n\n shaka.log.info('Updating manifest...');\n\n this.updateTimer_ = null;\n var startTime = Date.now();\n\n this.requestManifest_().then(function() {\n // Detect a call to stop()\n if (!this.playerInterface_)\n return;\n\n // Ensure the next update occurs within |updatePeriod_| seconds by taking\n // into account the time it took to update the manifest.\n var endTime = Date.now();\n this.setUpdateTimer_((endTime - startTime) / 1000.0);\n }.bind(this)).catch(function(error) {\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Should only receive a Shaka error');\n\n // Try updating again, but ensure we haven't been destroyed.\n if (this.playerInterface_) {\n // We will retry updating, so override the severity of the error.\n error.severity = shaka.util.Error.Severity.RECOVERABLE;\n this.playerInterface_.onError(error);\n\n this.setUpdateTimer_(0);\n }\n }.bind(this));\n};\n\n\n/**\n * Sets the update timer. Does nothing if the manifest does not specify an\n * update period.\n *\n * @param {number} offset An offset, in seconds, to apply to the manifest's\n * update period.\n * @private\n */\nshaka.dash.DashParser.prototype.setUpdateTimer_ = function(offset) {\n // NOTE: An updatePeriod_ of -1 means the attribute was missing.\n // An attribute which is present and set to 0 should still result in periodic\n // updates. For more, see: https://github.com/google/shaka-player/issues/331\n if (this.updatePeriod_ < 0)\n return;\n goog.asserts.assert(this.updateTimer_ == null,\n 'Timer should not be already set');\n\n var period =\n Math.max(shaka.dash.DashParser.MIN_UPDATE_PERIOD_, this.updatePeriod_);\n var interval = Math.max(period - offset, 0);\n shaka.log.debug('updateInterval', interval);\n\n var callback = this.onUpdate_.bind(this);\n this.updateTimer_ = window.setTimeout(callback, 1000 * interval);\n};\n\n\n/**\n * Creates a new inheritance frame for the given element.\n *\n * @param {!Element} elem\n * @param {?shaka.dash.DashParser.InheritanceFrame} parent\n * @param {Array.<string>} baseUris\n * @return {shaka.dash.DashParser.InheritanceFrame}\n * @private\n */\nshaka.dash.DashParser.prototype.createFrame_ = function(\n elem, parent, baseUris) {\n goog.asserts.assert(parent || baseUris,\n 'Must provide either parent or baseUris');\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n var XmlUtils = shaka.util.XmlUtils;\n parent = parent || /** @type {shaka.dash.DashParser.InheritanceFrame} */ ({\n contentType: '',\n mimeType: '',\n codecs: '',\n containsEmsgBoxes: false,\n frameRate: undefined\n });\n baseUris = baseUris || parent.baseUris;\n\n var parseNumber = XmlUtils.parseNonNegativeInt;\n var evalDivision = XmlUtils.evalDivision;\n var uris = XmlUtils.findChildren(elem, 'BaseURL').map(XmlUtils.getContents);\n\n var contentType = elem.getAttribute('contentType') || parent.contentType;\n var mimeType = elem.getAttribute('mimeType') || parent.mimeType;\n var codecs = elem.getAttribute('codecs') || parent.codecs;\n var frameRate =\n XmlUtils.parseAttr(elem, 'frameRate', evalDivision) || parent.frameRate;\n var containsEmsgBoxes =\n !!XmlUtils.findChildren(elem, 'InbandEventStream').length;\n\n if (!contentType) {\n contentType = shaka.dash.DashParser.guessContentType_(mimeType, codecs);\n }\n\n return {\n baseUris: ManifestParserUtils.resolveUris(baseUris, uris),\n segmentBase: XmlUtils.findChild(elem, 'SegmentBase') || parent.segmentBase,\n segmentList: XmlUtils.findChild(elem, 'SegmentList') || parent.segmentList,\n segmentTemplate:\n XmlUtils.findChild(elem, 'SegmentTemplate') || parent.segmentTemplate,\n width: XmlUtils.parseAttr(elem, 'width', parseNumber) || parent.width,\n height: XmlUtils.parseAttr(elem, 'height', parseNumber) || parent.height,\n contentType: contentType,\n mimeType: mimeType,\n codecs: codecs,\n frameRate: frameRate,\n containsEmsgBoxes: containsEmsgBoxes || parent.containsEmsgBoxes,\n id: elem.getAttribute('id')\n };\n};\n\n\n/**\n * Verifies that a Representation has exactly one Segment* element. Prints\n * warnings if there is a problem.\n *\n * @param {shaka.dash.DashParser.InheritanceFrame} frame\n * @return {boolean} True if the Representation is usable; otherwise return\n * false.\n * @private\n */\nshaka.dash.DashParser.prototype.verifyRepresentation_ = function(frame) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var n = 0;\n n += frame.segmentBase ? 1 : 0;\n n += frame.segmentList ? 1 : 0;\n n += frame.segmentTemplate ? 1 : 0;\n\n if (n == 0) {\n // TODO: extend with the list of MIME types registered to TextEngine.\n if (frame.contentType == ContentType.TEXT ||\n frame.contentType == ContentType.APPLICATION) {\n return true;\n } else {\n shaka.log.warning(\n 'Representation does not contain a segment information source:',\n 'the Representation must contain one of SegmentBase, SegmentList,',\n 'SegmentTemplate, or explicitly indicate that it is \"text\".',\n frame);\n return false;\n }\n }\n\n if (n != 1) {\n shaka.log.warning(\n 'Representation contains multiple segment information sources:',\n 'the Representation should only contain one of SegmentBase,',\n 'SegmentList, or SegmentTemplate.',\n frame);\n if (frame.segmentBase) {\n shaka.log.info('Using SegmentBase by default.');\n frame.segmentList = null;\n frame.segmentTemplate = null;\n } else {\n goog.asserts.assert(frame.segmentList, 'There should be a SegmentList');\n shaka.log.info('Using SegmentList by default.');\n frame.segmentTemplate = null;\n }\n }\n\n return true;\n};\n\n\n/**\n * Makes a request to the given URI and calculates the clock offset.\n *\n * @param {!Array.<string>} baseUris\n * @param {string} uri\n * @param {string} method\n * @return {!Promise.<number>}\n * @private\n */\nshaka.dash.DashParser.prototype.requestForTiming_ =\n function(baseUris, uri, method) {\n var requestUris = shaka.util.ManifestParserUtils.resolveUris(baseUris, [uri]);\n var request = shaka.net.NetworkingEngine.makeRequest(\n requestUris, this.config_.retryParameters);\n request.method = method;\n var type = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n return this.playerInterface_.networkingEngine.request(type, request)\n .then(function(response) {\n var text;\n if (method == 'HEAD') {\n if (!response.headers || !response.headers['date']) return 0;\n\n text = response.headers['date'];\n } else {\n text = shaka.util.StringUtils.fromUTF8(response.data);\n }\n\n var date = Date.parse(text);\n return isNaN(date) ? 0 : (date - Date.now());\n });\n};\n\n\n/**\n * Parses an array of UTCTiming elements.\n *\n * @param {!Array.<string>} baseUris\n * @param {!Array.<!Element>} elems\n * @param {boolean} isLive\n * @return {!Promise.<number>}\n * @private\n */\nshaka.dash.DashParser.prototype.parseUtcTiming_ =\n function(baseUris, elems, isLive) {\n var schemesAndValues = elems.map(function(elem) {\n return {\n scheme: elem.getAttribute('schemeIdUri'),\n value: elem.getAttribute('value')\n };\n });\n\n // If there's nothing specified in the manifest, but we have a default from\n // the config, use that.\n var clockSyncUri = this.config_.dash.clockSyncUri;\n if (isLive && !schemesAndValues.length && clockSyncUri) {\n schemesAndValues.push({\n scheme: 'urn:mpeg:dash:utc:http-head:2014',\n value: clockSyncUri\n });\n }\n\n var Functional = shaka.util.Functional;\n return Functional.createFallbackPromiseChain(schemesAndValues, function(sv) {\n var scheme = sv.scheme;\n var value = sv.value;\n switch (scheme) {\n // See DASH IOP Guidelines Section 4.7\n // http://goo.gl/CQFNJT\n case 'urn:mpeg:dash:utc:http-head:2014':\n // Some old ISO23009-1 drafts used 2012.\n case 'urn:mpeg:dash:utc:http-head:2012':\n return this.requestForTiming_(baseUris, value, 'HEAD');\n case 'urn:mpeg:dash:utc:http-xsdate:2014':\n case 'urn:mpeg:dash:utc:http-iso:2014':\n case 'urn:mpeg:dash:utc:http-xsdate:2012':\n case 'urn:mpeg:dash:utc:http-iso:2012':\n return this.requestForTiming_(baseUris, value, 'GET');\n case 'urn:mpeg:dash:utc:direct:2014':\n case 'urn:mpeg:dash:utc:direct:2012':\n var date = Date.parse(value);\n return isNaN(date) ? 0 : (date - Date.now());\n\n case 'urn:mpeg:dash:utc:http-ntp:2014':\n case 'urn:mpeg:dash:utc:ntp:2014':\n case 'urn:mpeg:dash:utc:sntp:2014':\n shaka.log.warning('NTP UTCTiming scheme is not supported');\n return Promise.reject();\n default:\n shaka.log.warning(\n 'Unrecognized scheme in UTCTiming element', scheme);\n return Promise.reject();\n }\n }.bind(this)).catch(function() {\n if (isLive) {\n shaka.log.warning(\n 'A UTCTiming element should always be given in live manifests! ' +\n 'This content may not play on clients with bad clocks!');\n }\n return 0;\n });\n};\n\n\n/**\n * Parses an EventStream element.\n *\n * @param {number} periodStart\n * @param {?number} periodDuration\n * @param {!Element} elem\n * @private\n */\nshaka.dash.DashParser.prototype.parseEventStream_ = function(\n periodStart, periodDuration, elem) {\n var XmlUtils = shaka.util.XmlUtils;\n var parseNumber = XmlUtils.parseNonNegativeInt;\n\n var schemeIdUri = elem.getAttribute('schemeIdUri') || '';\n var value = elem.getAttribute('value') || '';\n var timescale = XmlUtils.parseAttr(elem, 'timescale', parseNumber) || 1;\n\n XmlUtils.findChildren(elem, 'Event').forEach(function(eventNode) {\n var presentationTime =\n XmlUtils.parseAttr(eventNode, 'presentationTime', parseNumber) || 0;\n var duration = XmlUtils.parseAttr(eventNode, 'duration', parseNumber) || 0;\n\n var startTime = presentationTime / timescale + periodStart;\n var endTime = startTime + (duration / timescale);\n if (periodDuration != null) {\n // An event should not go past the Period, even if the manifest says so.\n // See: Dash sec. 5.10.2.1\n startTime = Math.min(startTime, periodStart + periodDuration);\n endTime = Math.min(endTime, periodStart + periodDuration);\n }\n\n /** @type {shakaExtern.TimelineRegionInfo} */\n var region = {\n schemeIdUri: schemeIdUri,\n value: value,\n startTime: startTime,\n endTime: endTime,\n id: eventNode.getAttribute('id') || '',\n eventElement: eventNode\n };\n\n this.playerInterface_.onTimelineRegionAdded(region);\n }.bind(this));\n};\n\n\n/**\n * Makes a network request on behalf of SegmentBase.createStream.\n *\n * @param {!Array.<string>} uris\n * @param {?number} startByte\n * @param {?number} endByte\n * @return {!Promise.<!ArrayBuffer>}\n * @private\n */\nshaka.dash.DashParser.prototype.requestInitSegment_ = function(\n uris, startByte, endByte) {\n var requestType = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n var request = shaka.net.NetworkingEngine.makeRequest(\n uris, this.config_.retryParameters);\n if (startByte != null) {\n var end = (endByte != null ? endByte : '');\n request.headers['Range'] = 'bytes=' + startByte + '-' + end;\n }\n\n return this.playerInterface_.networkingEngine.request(requestType, request)\n .then(function(response) { return response.data; });\n};\n\n\n/**\n * Guess the content type based on MIME type and codecs.\n *\n * @param {string} mimeType\n * @param {string} codecs\n * @return {string}\n * @private\n */\nshaka.dash.DashParser.guessContentType_ = function(mimeType, codecs) {\n var fullMimeType = shaka.util.StreamUtils.getFullMimeType(mimeType, codecs);\n\n if (shaka.media.TextEngine.isTypeSupported(fullMimeType)) {\n // If it's supported by TextEngine, it's definitely text.\n // We don't check MediaSourceEngine, because that would report support\n // for platform-supported video and audio types as well.\n return shaka.util.ManifestParserUtils.ContentType.TEXT;\n }\n\n // Otherwise, just split the MIME type. This handles video and audio\n // types well.\n return mimeType.split('/')[0];\n};\n\n\nshaka.media.ManifestParser.registerParserByExtension(\n 'mpd', shaka.dash.DashParser);\nshaka.media.ManifestParser.registerParserByMime(\n 'application/dash+xml', shaka.dash.DashParser);\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/dash/dash_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.hls.Attribute');\ngoog.provide('shaka.hls.Playlist');\ngoog.provide('shaka.hls.PlaylistType');\ngoog.provide('shaka.hls.Segment');\ngoog.provide('shaka.hls.Tag');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Creates an HLS playlist object.\n *\n * @param {!string} uri\n * @param {!shaka.hls.PlaylistType} type\n * @param {!Array.<shaka.hls.Tag>} tags\n * @param {!Array.<shaka.hls.Segment>=} opt_segments\n *\n * @constructor\n * @struct\n */\nshaka.hls.Playlist = function(uri, type, tags, opt_segments) {\n /** @const {!string} */\n this.uri = uri;\n\n /** @const {shaka.hls.PlaylistType} */\n this.type = type;\n\n /** @const {!Array.<!shaka.hls.Tag>} */\n this.tags = tags;\n\n /** @const {Array.<!shaka.hls.Segment>} */\n this.segments = opt_segments || null;\n};\n\n\n/**\n * @enum {number}\n */\nshaka.hls.PlaylistType = {\n MASTER: 0,\n MEDIA: 1\n};\n\n\n\n/**\n * Creates an HLS tag object.\n *\n * @param {number} id\n * @param {!string} name\n * @param {!Array.<shaka.hls.Attribute>} attributes\n * @param {?string=} opt_value\n *\n * @constructor\n * @struct\n */\nshaka.hls.Tag = function(id, name, attributes, opt_value) {\n\n goog.asserts.assert(\n (attributes.length == 0 && opt_value) ||\n (attributes.length > 0 && !opt_value) ||\n (attributes.length == 0 && !opt_value),\n 'Tags can only take the form ' +\n '(1) <NAME>:<VALUE> ' +\n '(2) <NAME>:<ATTRIBUTE_LIST> ' +\n ' (3) <NAME>');\n\n /** @const {number} */\n this.id = id;\n\n /** @const {!string} */\n this.name = name;\n\n /** @const {Array.<shaka.hls.Attribute>} */\n this.attributes = attributes;\n\n /** @const {?string} */\n this.value = opt_value || null;\n};\n\n\n/**\n * Create the string representation of the tag.\n *\n * For the DRM system - the full tag needs to be passed down to the CDM. There\n * are two ways of doing this (1) save the original tag or (2) recreate the tag.\n * As with some cases (like in tests) the tag never existed in string form, it\n * is far easier to recreate the tag from the parsed form.\n *\n * @return {string}\n * @override\n */\nshaka.hls.Tag.prototype.toString = function() {\n\n /**\n * @param {shaka.hls.Attribute} attr\n * @return {!string}\n */\n var attr_to_str = function(attr) {\n return attr.name + '=\"' + attr.value + '\"';\n };\n\n\n // A valid tag can only follow 1 of 3 patterns.\n // 1) <NAME>:<VALUE>\n // 2) <NAME>:<ATTRIBUTE LIST>\n // 3) <NAME>\n\n if (this.value) {\n return '#' + this.name + ':' + this.value;\n }\n\n if (this.attributes.length > 0) {\n return '#' + this.name + ':' + this.attributes.map(attr_to_str).join(',');\n }\n\n return '#' + this.name;\n};\n\n\n\n/**\n * Creates an HLS attribute object.\n *\n * @param {!string} name\n * @param {!string} value\n *\n * @constructor\n * @struct\n */\nshaka.hls.Attribute = function(name, value) {\n /** @const {!string} */\n this.name = name;\n\n /** @const {!string} */\n this.value = value;\n};\n\n\n/**\n * Adds an attribute to an HLS Tag.\n *\n * @param {!shaka.hls.Attribute} attribute\n */\nshaka.hls.Tag.prototype.addAttribute = function(attribute) {\n this.attributes.push(attribute);\n};\n\n\n/**\n * Gets the first attribute of the tag with a specified name.\n *\n * @param {!string} name\n * @return {?shaka.hls.Attribute} attribute\n */\nshaka.hls.Tag.prototype.getAttribute = function(name) {\n var attributes = this.attributes.filter(function(attr) {\n return attr.name == name;\n });\n\n goog.asserts.assert(attributes.length < 2,\n 'A tag should not have multiple attributes ' +\n 'with the same name!');\n\n if (attributes.length)\n return attributes[0];\n else\n return null;\n};\n\n\n/**\n * Gets the value of the first attribute of the tag with a specified name.\n * If not found, returns an optional default value.\n *\n * @param {!string} name\n * @param {string=} opt_defaultValue\n * @return {?string}\n */\nshaka.hls.Tag.prototype.getAttributeValue = function(name, opt_defaultValue) {\n var defaultValue = opt_defaultValue || null;\n var attribute = this.getAttribute(name);\n return attribute ? attribute.value : defaultValue;\n};\n\n\n\n/**\n * Creates an HLS segment object.\n *\n * @param {!string} uri\n * @param {!Array.<shaka.hls.Tag>} tags\n *\n * @constructor\n * @struct\n */\nshaka.hls.Segment = function(uri, tags) {\n /** @const {!Array.<shaka.hls.Tag>} */\n this.tags = tags;\n\n /** @const {!string} */\n this.uri = uri;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/hls_classes.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.hls.Utils');\n\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n/**\n *\n * @param {!Array.<!shaka.hls.Tag>} tags\n * @param {!string} name\n * @return {!Array.<!shaka.hls.Tag>}\n */\nshaka.hls.Utils.filterTagsByName = function(tags, name) {\n return tags.filter(function(tag) {\n return tag.name == name;\n });\n};\n\n\n/**\n *\n * @param {!Array.<!shaka.hls.Tag>} tags\n * @param {!string} name\n * @return {?shaka.hls.Tag}\n */\nshaka.hls.Utils.getFirstTagWithName = function(tags, name) {\n var tagsWithName = shaka.hls.Utils.filterTagsByName(tags, name);\n if (!tagsWithName.length) return null;\n\n return tagsWithName[0];\n};\n\n\n/**\n * Expects an array of EXT-X-MEDIA tags. Returns the first tag that\n * has given media type and group id.\n *\n * @param {!Array.<!shaka.hls.Tag>} tags\n * @param {!string} type\n * @param {!string} groupId\n * @return {!Array<!shaka.hls.Tag>}\n */\nshaka.hls.Utils.findMediaTags = function(tags, type, groupId) {\n return tags.filter(function(tag) {\n var typeAttr = tag.getAttribute('TYPE');\n var groupIdAttr = tag.getAttribute('GROUP-ID');\n return typeAttr.value == type && groupIdAttr.value == groupId;\n });\n};\n\n\n/**\n * @param {!string} parentAbsoluteUri\n * @param {!string} uri\n * @return {!string}\n */\nshaka.hls.Utils.constructAbsoluteUri = function(parentAbsoluteUri, uri) {\n var uris = shaka.util.ManifestParserUtils.resolveUris(\n [parentAbsoluteUri], [uri]);\n\n return uris[0];\n};\n\n\n/**\n * Matches a string to an HLS comment format and returns the result.\n *\n * @param {!string} line\n * @return {boolean}\n */\nshaka.hls.Utils.isComment = function(line) {\n return /^#(?!EXT)/m.test(line);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/hls_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.TextParser');\n\ngoog.require('goog.asserts');\n\n\n\n/**\n * Reads elements from strings.\n *\n * @param {string} data\n * @constructor\n * @struct\n */\nshaka.util.TextParser = function(data) {\n /**\n * @const\n * @private {string}\n */\n this.data_ = data;\n\n /** @private {number} */\n this.position_ = 0;\n};\n\n\n/** @return {boolean} Whether it is at the end of the string. */\nshaka.util.TextParser.prototype.atEnd = function() {\n return this.position_ == this.data_.length;\n};\n\n\n/**\n * Reads a line from the parser. This will read but not return the newline.\n * Returns null at the end.\n *\n * @return {?string}\n */\nshaka.util.TextParser.prototype.readLine = function() {\n return this.readRegexReturnCapture_(/(.*?)(\\n|$)/gm, 1);\n};\n\n\n/**\n * Reads a word from the parser. This will not read or return any whitespace\n * before or after the word (including newlines). Returns null at the end.\n *\n * @return {?string}\n */\nshaka.util.TextParser.prototype.readWord = function() {\n return this.readRegexReturnCapture_(/[^ \\t\\n]*/gm, 0);\n};\n\n\n/**\n * Skips any continuous whitespace from the parser. Returns null at the end.\n */\nshaka.util.TextParser.prototype.skipWhitespace = function() {\n this.readRegex(/[ \\t]+/gm);\n};\n\n\n/**\n * Reads the given regular expression from the parser. This requires the match\n * to be at the current position; there is no need to include a head anchor.\n * This requires that the regex have the global flag to be set so that it can\n * set lastIndex to start the search at the current position. Returns null at\n * the end or if the regex does not match the current position.\n *\n * @param {!RegExp} regex\n * @return {Array.<string>}\n */\nshaka.util.TextParser.prototype.readRegex = function(regex) {\n var index = this.indexOf_(regex);\n if (this.atEnd() || index == null || index.position != this.position_)\n return null;\n\n this.position_ += index.length;\n return index.results;\n};\n\n\n/**\n * Reads a regex from the parser and returns the given capture.\n *\n * @param {!RegExp} regex\n * @param {number} index\n * @return {?string}\n * @private\n */\nshaka.util.TextParser.prototype.readRegexReturnCapture_ =\n function(regex, index) {\n if (this.atEnd())\n return null;\n\n var ret = this.readRegex(regex);\n if (!ret)\n return null;\n else\n return ret[index];\n};\n\n\n/**\n * Returns the index info about a regular expression match.\n *\n * @param {!RegExp} regex\n * @return {?{position: number, length: number, results: !Array.<string>}}\n * @private\n */\nshaka.util.TextParser.prototype.indexOf_ = function(regex) {\n // The global flag is required to use lastIndex.\n goog.asserts.assert(regex.global, 'global flag should be set');\n\n regex.lastIndex = this.position_;\n var results = regex.exec(this.data_);\n if (results == null)\n return null;\n else\n return {\n position: results.index,\n length: results[0].length,\n results: results\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.hls.ManifestTextParser');\n\ngoog.require('shaka.hls.Attribute');\ngoog.require('shaka.hls.Playlist');\ngoog.require('shaka.hls.PlaylistType');\ngoog.require('shaka.hls.Segment');\ngoog.require('shaka.hls.Tag');\ngoog.require('shaka.hls.Utils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.TextParser');\n\n\n\n/**\n * Creates a new ManifestTextParser.\n *\n * @constructor\n * @struct\n */\nshaka.hls.ManifestTextParser = function() {\n /** @private {number} */\n this.globalId_ = 0;\n};\n\n\n/**\n * @param {!ArrayBuffer} data\n * @param {!string} uri\n * @return {!shaka.hls.Playlist}\n * @throws {shaka.util.Error}\n */\nshaka.hls.ManifestTextParser.prototype.parsePlaylist = function(data, uri) {\n // Get the input as a string. Normalize newlines to \\n.\n var str = shaka.util.StringUtils.fromUTF8(data);\n str = str.replace(/\\r\\n|\\r(?=[^\\n]|$)/gm, '\\n').trim();\n\n var lines = str.split(/\\n+/m);\n\n if (!/^#EXTM3U($|[ \\t\\n])/m.test(lines[0])) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_PLAYLIST_HEADER_MISSING);\n }\n\n /** shaka.hls.PlaylistType */\n var playlistType = shaka.hls.PlaylistType.MASTER;\n\n /** {Array.<shaka.hls.Tag>} */\n var tags = [];\n var i = 1;\n while (i < lines.length) {\n // Skip comments\n if (shaka.hls.Utils.isComment(lines[i])) {\n i += 1;\n continue;\n }\n\n var tag = this.parseTag_(lines[i]);\n\n if (shaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS\n .indexOf(tag.name) >= 0) {\n playlistType = shaka.hls.PlaylistType.MEDIA;\n } else if (shaka.hls.ManifestTextParser.SEGMENT_TAGS\n .indexOf(tag.name) >= 0) {\n if (playlistType != shaka.hls.PlaylistType.MEDIA) {\n // Only media playlist should contain segment tags\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY);\n }\n\n var segmentsData = lines.splice(i, lines.length - i);\n var segments = this.parseSegments_(segmentsData);\n return new shaka.hls.Playlist(uri, playlistType, tags, segments);\n }\n\n tags.push(tag);\n i += 1;\n\n // EXT-X-STREAM-INF tag is followed by a uri of a media playlist.\n // Add uri to the tag object.\n if (tag.name == 'EXT-X-STREAM-INF') {\n var tagUri = new shaka.hls.Attribute('URI', lines[i]);\n tag.addAttribute(tagUri);\n i += 1;\n }\n }\n\n return new shaka.hls.Playlist(uri, playlistType, tags);\n};\n\n\n/**\n * Parses an array of strings into an HLS Segment objects.\n *\n * @param {!Array.<string>} lines\n * @return {!Array.<shaka.hls.Segment>}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.ManifestTextParser.prototype.parseSegments_ = function(lines) {\n var segments = [];\n var tags = [];\n lines.forEach(function(line) {\n if (/^(#EXT)/.test(line)) {\n var tag = this.parseTag_(line);\n tags.push(tag);\n } else if (shaka.hls.Utils.isComment(line)) {\n // Skip comments\n return;\n } else {\n var uri = line.trim();\n // Uri appears after all the tags describing the segment.\n var segment = new shaka.hls.Segment(uri, tags);\n segments.push(segment);\n tags = [];\n }\n }.bind(this));\n\n return segments;\n};\n\n\n/**\n * Parses a string into an HLS Tag object while tracking what id to use next.\n *\n * @param {!string} word\n * @return {!shaka.hls.Tag}\n * @throws {shaka.util.Error}\n * @private\n */\nshaka.hls.ManifestTextParser.prototype.parseTag_ = function(word) {\n return shaka.hls.ManifestTextParser.parseTag(this.globalId_++, word);\n};\n\n\n/**\n * Parses a string into an HLS Tag object.\n *\n * @param {number} id\n * @param {!string} word\n * @return {!shaka.hls.Tag}\n * @throws {shaka.util.Error}\n */\nshaka.hls.ManifestTextParser.parseTag = function(id, word) {\n /* HLS tags start with '#EXT'. A tag can have a set of attributes\n (#EXT-<tagname>:<attribute list>) or a value (#EXT-<tagname>:<value>).\n Attributes' format is 'AttributeName=AttributeValue'.\n The parsing logic goes like this:\n 1) Everything before ':' is a name (we ignore '#').\n 2) Everything after should be parsed as attributes if it contains '='.\n 3) Otherwise, this is a value.\n 4) If there is no \":\", it's a simple tag with no attributes and no value */\n var blocks = word.match(/^#(EXT[^:]*)(?::(.*))?$/);\n if (!blocks) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.INVALID_HLS_TAG);\n }\n var name = blocks[1];\n var data = blocks[2];\n var attributes = [];\n\n if (data && data.indexOf('=') >= 0) {\n var parser = new shaka.util.TextParser(data);\n var blockAttrs;\n\n // Regex:\n // 1. Key name ([1])\n // 2. Equals sign\n // 3. Either:\n // a. A quoted string (everything up to the next quote, [2])\n // b. An unquoted string\n // (everything up to the next comma or end of line, [3])\n // 4. Either:\n // a. A comma\n // b. End of line\n var regex = /([^=]+)=(?:\"([^\"]*)\"|([^\",]*))(?:,|$)/g;\n while (blockAttrs = parser.readRegex(regex)) {\n var attrName = blockAttrs[1];\n var attrValue = blockAttrs[2] || blockAttrs[3];\n var attribute = new shaka.hls.Attribute(attrName, attrValue);\n attributes.push(attribute);\n }\n } else if (data) {\n return new shaka.hls.Tag(id, name, attributes, data);\n }\n\n return new shaka.hls.Tag(id, name, attributes);\n};\n\n\n/**\n * HLS tags that only appear on Media Playlists.\n * Used to determine a playlist type.\n *\n * @const {!Array<!string>}\n */\nshaka.hls.ManifestTextParser.MEDIA_PLAYLIST_TAGS = [\n 'EXT-X-TARGETDURATION',\n 'EXT-X-MEDIA-SEQUENCE',\n 'EXT-X-DISCONTINUITY-SEQUENCE',\n 'EXT-X-PLAYLIST-TYPE',\n 'EXT-X-MAP',\n 'EXT-X-I-FRAMES-ONLY'\n];\n\n\n/**\n * HLS tags that only appear on Segments in a Media Playlists.\n * Used to determine the start of the segments info.\n *\n * @const {!Array<!string>}\n */\nshaka.hls.ManifestTextParser.SEGMENT_TAGS = [\n 'EXTINF',\n 'EXT-X-BYTERANGE',\n 'EXT-X-DISCONTINUITY',\n 'EXT-X-PROGRAM-DATE-TIME',\n 'EXT-X-KEY',\n 'EXT-X-DATERANGE'\n];\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/manifest_text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.net.DataUriPlugin');\n\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * @namespace\n * @summary A networking plugin to handle data URIs.\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs\n * @param {string} uri\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.net.DataUriPlugin = function(uri, request) {\n return new Promise(function(resolve, reject) {\n var parsed = shaka.net.DataUriPlugin.parse(uri);\n\n /** @type {shakaExtern.Response} */\n var response = {\n uri: uri,\n data: parsed.data,\n headers: {\n 'content-type': parsed.contentType\n }\n };\n\n resolve(response);\n });\n};\n\n\n/**\n * @param {string} uri\n * @return {{data: ArrayBuffer, contentType: string}}\n */\nshaka.net.DataUriPlugin.parse = function(uri) {\n // Extract the scheme.\n var parts = uri.split(':');\n if (parts.length < 2 || parts[0] != 'data') {\n shaka.log.error('Bad data URI, failed to parse scheme');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_DATA_URI,\n uri);\n }\n var path = parts.slice(1).join(':');\n\n // Extract the encoding and MIME type (required but can be empty).\n var infoAndData = path.split(',');\n if (infoAndData.length < 2) {\n shaka.log.error('Bad data URI, failed to extract encoding and MIME type');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_DATA_URI,\n uri);\n }\n var info = infoAndData[0];\n var dataStr = window.decodeURIComponent(infoAndData.slice(1).join(','));\n\n // Extract the encoding (optional).\n var typeAndEncoding = info.split(';');\n var encoding = null;\n if (typeAndEncoding.length > 1)\n encoding = typeAndEncoding[1];\n\n // Convert the data.\n /** @type {ArrayBuffer} */\n var data;\n if (encoding == 'base64') {\n data = shaka.util.Uint8ArrayUtils.fromBase64(dataStr).buffer;\n } else if (encoding) {\n shaka.log.error('Bad data URI, unknown encoding');\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.UNKNOWN_DATA_URI_ENCODING,\n uri);\n } else {\n data = shaka.util.StringUtils.toUTF8(dataStr);\n }\n\n return {data: data, contentType: typeAndEncoding[0]};\n};\n\n\nshaka.net.NetworkingEngine.registerScheme('data', shaka.net.DataUriPlugin);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/net/data_uri_plugin.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\ngoog.provide('shaka.hls.HlsParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.hls.ManifestTextParser');\ngoog.require('shaka.hls.Playlist');\ngoog.require('shaka.hls.PlaylistType');\ngoog.require('shaka.hls.Tag');\ngoog.require('shaka.hls.Utils');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.net.DataUriPlugin');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.ManifestParserUtils');\n\n\n\n/**\n * Creates a new HLS parser.\n *\n * @struct\n * @constructor\n * @implements {shakaExtern.ManifestParser}\n * @export\n */\nshaka.hls.HlsParser = function() {\n /** @private {?shakaExtern.ManifestParser.PlayerInterface} */\n this.playerInterface_ = null;\n\n /** @private {?shakaExtern.ManifestConfiguration} */\n this.config_ = null;\n\n /** @private {number} */\n this.globalId_ = 1;\n\n /** @private {!Object.<number, shaka.hls.HlsParser.StreamInfo>} */\n this.mediaTagsToStreamInfosMap_ = {};\n\n /** @private {!Object.<number, !shaka.media.SegmentIndex>} */\n this.streamsToIndexMap_ = {};\n\n /** @private {?shaka.media.PresentationTimeline} */\n this.presentationTimeline_ = null;\n\n /** @private {string} */\n this.manifestUri_ = '';\n\n /** @private {shaka.hls.ManifestTextParser} */\n this.manifestTextParser_ = new shaka.hls.ManifestTextParser();\n};\n\n\n/**\n * @typedef {{\n * stream: !shakaExtern.Stream,\n * segmentIndex: !shaka.media.SegmentIndex,\n * drmInfos: !Array.<shakaExtern.DrmInfo>\n * }}\n *\n * @description\n * Contains a stream and information about it.\n *\n * @property {!shakaExtern.Stream} stream\n * The Stream itself.\n * @property {!shaka.media.SegmentIndex} segmentIndex\n * SegmentIndex of the stream.\n * @property {!Array.<shakaExtern.DrmInfo>} drmInfos\n * DrmInfos of the stream. There may be multiple for multi-DRM content.\n */\nshaka.hls.HlsParser.StreamInfo;\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.configure = function(config) {\n this.config_ = config;\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.start = function(uri, playerInterface) {\n goog.asserts.assert(this.config_, 'Must call configure() before start()!');\n this.playerInterface_ = playerInterface;\n this.manifestUri_ = uri;\n return this.requestManifest_(uri).then(function(response) {\n return this.parseManifest_(response.data, uri);\n }.bind(this));\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.stop = function() {\n this.playerInterface_ = null;\n this.config_ = null;\n this.mediaTagsToStreamInfosMap_ = {};\n\n return Promise.resolve();\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.update = function() {\n // TODO: Implement support for live content.\n};\n\n\n/**\n * @override\n * @exportInterface\n */\nshaka.hls.HlsParser.prototype.onExpirationUpdated = function(\n sessionId, expiration) {\n // No-op\n};\n\n\n/**\n * Parses the manifest.\n *\n * @param {!ArrayBuffer} data\n * @param {string} uri\n * @return {!Promise.<!shakaExtern.Manifest>}\n * @throws shaka.util.Error When there is a parsing error.\n * @private\n */\nshaka.hls.HlsParser.prototype.parseManifest_ = function(data, uri) {\n var playlist = this.manifestTextParser_.parsePlaylist(data, uri);\n\n // We don't support directly providing a Media Playlist.\n // See error code for details.\n if (playlist.type != shaka.hls.PlaylistType.MASTER) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_MASTER_PLAYLIST_NOT_PROVIDED);\n }\n\n // TODO: Implement support for live content.\n this.presentationTimeline_ = new shaka.media.PresentationTimeline(null, 0);\n return this.createPeriod_(playlist).then(function(period) {\n // HLS has no notion of periods. We're treating the whole presentation as\n // one period.\n this.playerInterface_.filterPeriod(period);\n return {\n presentationTimeline: this.presentationTimeline_,\n periods: [period],\n offlineSessionIds: [],\n minBufferTime: 0\n };\n }.bind(this));\n};\n\n\n/**\n * Parses a playlist into a Period object.\n *\n * @param {!shaka.hls.Playlist} playlist\n * @return {!Promise.<!shakaExtern.Period>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createPeriod_ = function(playlist) {\n var Utils = shaka.hls.Utils;\n var Functional = shaka.util.Functional;\n var tags = playlist.tags;\n\n // Create Variants for every 'EXT-X-STREAM-INF' tag.\n var variantTags = Utils.filterTagsByName(tags, 'EXT-X-STREAM-INF');\n var variantsPromises = variantTags.map(function(tag) {\n return this.createVariantsForTag_(tag, playlist);\n }.bind(this));\n\n var mediaTags = Utils.filterTagsByName(playlist.tags, 'EXT-X-MEDIA');\n var textStreamTags = mediaTags.filter(function(tag) {\n var type = shaka.hls.HlsParser.getRequiredAttributeValue_(tag, 'TYPE');\n return type == 'SUBTITLES';\n }.bind(this));\n\n // TODO: CLOSED-CAPTIONS requires the parsing of CEA-608 from the video.\n var textStreamPromises = textStreamTags.map(function(tag) {\n return this.createTextStream_(tag, playlist);\n }.bind(this));\n\n return Promise.all(variantsPromises).then(function(allVariants) {\n return Promise.all(textStreamPromises).then(function(textStreams) {\n var variants = allVariants.reduce(Functional.collapseArrays, []);\n this.fitSegments_(variants);\n return {\n startTime: 0,\n variants: variants,\n textStreams: textStreams\n };\n }.bind(this));\n }.bind(this));\n};\n\n\n/**\n * @param {!shaka.hls.Tag} tag\n * @param {!shaka.hls.Playlist} playlist\n * @return {!Promise.<!Array.<!shakaExtern.Variant>>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createVariantsForTag_ = function(tag, playlist) {\n goog.asserts.assert(tag.name == 'EXT-X-STREAM-INF',\n 'Should only be called on variant tags!');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var HlsParser = shaka.hls.HlsParser;\n var Utils = shaka.hls.Utils;\n var bandwidth =\n Number(HlsParser.getRequiredAttributeValue_(tag, 'BANDWIDTH'));\n\n // These are the default codecs to assume if none are specified.\n //\n // The video codec is H.264, with baseline profile and level 3.0.\n // http://blog.pearce.org.nz/2013/11/what-does-h264avc1-codecs-parameters.html\n //\n // The audio codec is \"low-complexity\" AAC.\n var defaultCodecs = 'avc1.42E01E,mp4a.40.2';\n\n var codecs = tag.getAttributeValue('CODECS', defaultCodecs).split(',');\n var resolutionAttr = tag.getAttribute('RESOLUTION');\n var width = null;\n var height = null;\n var frameRate = tag.getAttributeValue('FRAME-RATE');\n\n if (resolutionAttr) {\n var resBlocks = resolutionAttr.value.split('x');\n width = resBlocks[0];\n height = resBlocks[1];\n }\n\n var timeOffset = this.getTimeOffset_(playlist);\n\n var mediaTags = Utils.filterTagsByName(playlist.tags, 'EXT-X-MEDIA');\n\n var audioGroupId = tag.getAttributeValue('AUDIO');\n var videoGroupId = tag.getAttributeValue('VIDEO');\n goog.asserts.assert(audioGroupId == null || videoGroupId == null,\n 'Unexpected: both video and audio described by media tags!');\n\n // Find any associated audio or video groups and create streams for them.\n if (audioGroupId) {\n mediaTags = Utils.findMediaTags(mediaTags, 'AUDIO', audioGroupId);\n } else if (videoGroupId) {\n mediaTags = Utils.findMediaTags(mediaTags, 'VIDEO', videoGroupId);\n }\n var promises = mediaTags.map(function(tag) {\n return this.createStreamInfoFromMediaTag_(tag, codecs, timeOffset);\n }.bind(this));\n\n var audioStreamInfos = [];\n var videoStreamInfos = [];\n\n return Promise.all(promises).then(function(data) {\n if (audioGroupId) {\n audioStreamInfos = data;\n } else if (videoGroupId) {\n videoStreamInfos = data;\n }\n\n // Make an educated guess about the stream type.\n shaka.log.debug('Guessing stream type for', tag.toString());\n var type;\n if (!audioStreamInfos.length && !videoStreamInfos.length) {\n // There are no associated streams. This is either an audio-only stream,\n // a video-only stream, or a multiplexed stream.\n\n if (codecs.length == 1) {\n // There is only one codec, so it shouldn't be multiplexed.\n if (resolutionAttr || frameRate) {\n // Assume video-only.\n shaka.log.debug('Guessing video-only.');\n type = ContentType.VIDEO;\n } else {\n // Assume audio-only.\n shaka.log.debug('Guessing audio-only.');\n type = ContentType.AUDIO;\n }\n } else {\n // There are multiple codecs, so assume multiplexed content.\n // Note that the default used when CODECS is missing assumes multiple\n // (and therefore multiplexed).\n // Recombine the codec strings into one so that MediaSource isn't\n // lied to later. (That would trigger an error in Chrome.)\n shaka.log.debug('Guessing multiplexed audio+video.');\n type = ContentType.VIDEO;\n codecs = [codecs.join(',')];\n }\n } else if (audioStreamInfos.length) {\n // There are associated audio streams. Assume this is video.\n shaka.log.debug('Guessing video.');\n type = ContentType.VIDEO;\n } else {\n // There are associated video streams. Assume this is audio.\n goog.asserts.assert(videoStreamInfos.length,\n 'No video streams! This should have been handled already!');\n shaka.log.debug('Guessing audio.');\n type = ContentType.AUDIO;\n }\n\n goog.asserts.assert(type, 'Type should have been set by now!');\n return this.createStreamInfoFromVariantTag_(tag, codecs, type, timeOffset);\n }.bind(this)).then(function(streamInfo) {\n goog.asserts.assert(streamInfo, 'We should have created a stream!');\n if (streamInfo.stream.type == ContentType.AUDIO) {\n audioStreamInfos = [streamInfo];\n } else {\n videoStreamInfos = [streamInfo];\n }\n\n return this.createVariants_(\n audioStreamInfos,\n videoStreamInfos,\n bandwidth,\n width,\n height,\n frameRate);\n }.bind(this));\n};\n\n\n/**\n * @param {!Array.<!shaka.hls.HlsParser.StreamInfo>} audioInfos\n * @param {!Array.<!shaka.hls.HlsParser.StreamInfo>} videoInfos\n * @param {number} bandwidth\n * @param {?string} width\n * @param {?string} height\n * @param {?string} frameRate\n * @return {!Array.<!shakaExtern.Variant>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createVariants_ =\n function(audioInfos, videoInfos, bandwidth, width, height, frameRate) {\n var DrmEngine = shaka.media.DrmEngine;\n\n videoInfos.forEach(function(info) {\n this.addVideoAttributes_(info.stream, width, height, frameRate);\n }.bind(this));\n\n // In case of audio-only or video-only content, we create an array of\n // one item containing a null. This way, the double-loop works for all\n // kinds of content.\n // NOTE: we currently don't have support for audio-only content.\n if (!audioInfos.length)\n audioInfos = [null];\n if (!videoInfos.length)\n videoInfos = [null];\n\n var variants = [];\n for (var i = 0; i < audioInfos.length; i++) {\n for (var j = 0; j < videoInfos.length; j++) {\n var audioStream = audioInfos[i] ? audioInfos[i].stream : null;\n var videoStream = videoInfos[j] ? videoInfos[j].stream : null;\n var audioDrmInfos = audioInfos[i] ? audioInfos[i].drmInfos : null;\n var videoDrmInfos = videoInfos[j] ? videoInfos[j].drmInfos : null;\n\n var drmInfos;\n if (audioStream && videoStream) {\n if (DrmEngine.areDrmCompatible(audioDrmInfos, videoDrmInfos)) {\n drmInfos = DrmEngine.getCommonDrmInfos(audioDrmInfos, videoDrmInfos);\n } else {\n shaka.log.warning('Incompatible DRM info in HLS variant. Skipping.');\n continue;\n }\n } else if (audioStream) {\n drmInfos = audioDrmInfos;\n } else if (videoStream) {\n drmInfos = videoDrmInfos;\n }\n\n variants.push(this.createVariant_(\n audioStream, videoStream, bandwidth, drmInfos));\n }\n }\n return variants;\n};\n\n\n/**\n * @param {shakaExtern.Stream} audio\n * @param {shakaExtern.Stream} video\n * @param {number} bandwidth\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @return {!shakaExtern.Variant}\n * @private\n */\nshaka.hls.HlsParser.prototype.createVariant_ =\n function(audio, video, bandwidth, drmInfos) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n // Since both audio and video are of the same type, this assertion will catch\n // certain mistakes at runtime that the compiler would miss.\n goog.asserts.assert(!audio || audio.type == ContentType.AUDIO,\n 'Audio parameter mismatch!');\n goog.asserts.assert(!video || video.type == ContentType.VIDEO,\n 'Video parameter mismatch!');\n\n return {\n id: this.globalId_++,\n language: audio ? audio.language : 'und',\n primary: (!!audio && audio.primary) || (!!video && video.primary),\n audio: audio,\n video: video,\n bandwidth: bandwidth,\n drmInfos: drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n};\n\n\n/**\n * Parses an EXT-X-MEDIA tag with TYPE=\"SUBTITLES\" into a text stream.\n *\n * @param {!shaka.hls.Tag} tag\n * @param {!shaka.hls.Playlist} playlist\n * @return {!Promise.<?shakaExtern.Stream>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createTextStream_ = function(tag, playlist) {\n goog.asserts.assert(tag.name == 'EXT-X-MEDIA',\n 'Should only be called on media tags!');\n\n var type = shaka.hls.HlsParser.getRequiredAttributeValue_(tag, 'TYPE');\n goog.asserts.assert(type == 'SUBTITLES',\n 'Should only be called on tags with TYPE=\"SUBTITLES\"!');\n\n var timeOffset = this.getTimeOffset_(playlist);\n return this.createStreamInfoFromMediaTag_(tag, [], timeOffset)\n .then(function(streamInfo) {\n return streamInfo.stream;\n });\n};\n\n\n/**\n * Parse EXT-X-MEDIA media tag into a Stream object.\n *\n * @param {shaka.hls.Tag} tag\n * @param {!Array.<!string>} allCodecs\n * @param {?number} timeOffset\n * @return {!Promise.<shaka.hls.HlsParser.StreamInfo>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createStreamInfoFromMediaTag_ =\n function(tag, allCodecs, timeOffset) {\n goog.asserts.assert(tag.name == 'EXT-X-MEDIA',\n 'Should only be called on media tags!');\n\n // Check if the stream has already been created as part of another Variant\n // and return it if it has.\n if (this.mediaTagsToStreamInfosMap_[tag.id]) {\n return Promise.resolve().then(function() {\n return this.mediaTagsToStreamInfosMap_[tag.id];\n }.bind(this));\n }\n\n var HlsParser = shaka.hls.HlsParser;\n var type = HlsParser.getRequiredAttributeValue_(tag, 'TYPE').toLowerCase();\n // Shaka recognizes content types 'audio', 'video' and 'text'.\n // HLS 'subtitles' type needs to be mapped to 'text'.\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (type == 'subtitles') type = ContentType.TEXT;\n\n var LanguageUtils = shaka.util.LanguageUtils;\n var language = LanguageUtils.normalize(/** @type {string} */(\n tag.getAttributeValue('LANGUAGE', 'und')));\n var label = tag.getAttributeValue('NAME');\n\n var defaultAttr = tag.getAttribute('DEFAULT');\n var autoselectAttr = tag.getAttribute('AUTOSELECT');\n // TODO: Should we take into account some of the currently ignored attributes:\n // FORCED, INSTREAM-ID, CHARACTERISTICS, CHANNELS?\n // Attribute descriptions:\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-4.3.4.1\n\n var uri = HlsParser.getRequiredAttributeValue_(tag, 'URI');\n var primary = !!defaultAttr || !!autoselectAttr;\n return this.createStreamInfo_(uri, allCodecs, type, timeOffset, language,\n primary, label).then(function(streamInfo) {\n this.mediaTagsToStreamInfosMap_[tag.id] = streamInfo;\n return streamInfo;\n }.bind(this));\n};\n\n\n/**\n * Parse EXT-X-STREAM-INF media tag into a Stream object.\n *\n * @param {!shaka.hls.Tag} tag\n * @param {!Array.<!string>} allCodecs\n * @param {!string} type\n * @param {?number} timeOffset\n * @return {!Promise.<shaka.hls.HlsParser.StreamInfo>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createStreamInfoFromVariantTag_ =\n function(tag, allCodecs, type, timeOffset) {\n goog.asserts.assert(tag.name == 'EXT-X-STREAM-INF',\n 'Should only be called on media tags!');\n\n var uri = shaka.hls.HlsParser.getRequiredAttributeValue_(tag, 'URI');\n return this.createStreamInfo_(uri, allCodecs, type, timeOffset,\n /* language */ 'und', /* primary */ false,\n /* label */ null);\n};\n\n\n/**\n * @param {!string} uri\n * @param {!Array.<!string>} allCodecs\n * @param {!string} type\n * @param {?number} timeOffset\n * @param {!string} language\n * @param {boolean} primary\n * @param {?string} label\n * @return {!Promise.<shaka.hls.HlsParser.StreamInfo>}\n * @throws shaka.util.Error\n * @private\n */\nshaka.hls.HlsParser.prototype.createStreamInfo_ =\n function(uri, allCodecs, type, timeOffset, language, primary, label) {\n var Utils = shaka.hls.Utils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var HlsParser = shaka.hls.HlsParser;\n uri = Utils.constructAbsoluteUri(this.manifestUri_, uri);\n\n return this.requestManifest_(uri).then(function(response) {\n var playlistData = response.data;\n var playlist = this.manifestTextParser_.parsePlaylist(playlistData,\n response.uri);\n if (playlist.type != shaka.hls.PlaylistType.MEDIA) {\n // EXT-X-MEDIA tags should point to media playlists.\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_INVALID_PLAYLIST_HIERARCHY);\n }\n\n goog.asserts.assert(playlist.segments != null,\n 'Media playlist should have segments!');\n\n // Time offset can be specified on either Master or Media Playlist.\n // If Media Playlist provides it's own value, use that.\n // Otherwise, use value from the Master Playlist. If no offset\n // has been provided it will default to\n // this.config_.hls.defaultTimeOffset.\n var mediaPlaylistTimeOffset = this.getTimeOffset_(playlist);\n timeOffset = mediaPlaylistTimeOffset || timeOffset;\n\n var initSegmentReference = null;\n if (type != ContentType.TEXT) {\n initSegmentReference = this.createInitSegmentReference_(playlist);\n }\n var mediaSequenceTag = Utils.getFirstTagWithName(playlist.tags,\n 'EXT-X-MEDIA-SEQUENCE');\n\n var startPosition = mediaSequenceTag ? Number(mediaSequenceTag.value) : 0;\n var segments = this.createSegments_(playlist, startPosition);\n\n this.presentationTimeline_.notifySegments(0, segments);\n var duration =\n segments[segments.length - 1].endTime - segments[0].startTime;\n var presentationDuration = this.presentationTimeline_.getDuration();\n if (presentationDuration == Infinity || presentationDuration < duration) {\n this.presentationTimeline_.setDuration(duration);\n }\n var codecs = this.guessCodecs_(type, allCodecs);\n\n var kind = undefined;\n\n var ManifestParserUtils = shaka.util.ManifestParserUtils;\n if (type == ManifestParserUtils.ContentType.TEXT)\n kind = ManifestParserUtils.TextStreamKind.SUBTITLE;\n // TODO: CLOSED-CAPTIONS requires the parsing of CEA-608 from the video.\n\n var segmentIndex = new shaka.media.SegmentIndex(segments);\n\n var drmTags = [];\n playlist.segments.forEach(function(segment) {\n var segmentKeyTags = Utils.filterTagsByName(segment.tags, 'EXT-X-KEY');\n drmTags.push.apply(drmTags, segmentKeyTags);\n });\n\n var encrypted = false;\n var drmInfos = [];\n var keyId = null;\n\n // TODO: may still need changes to support key rotation\n drmTags.forEach(function(drmTag) {\n var method = HlsParser.getRequiredAttributeValue_(drmTag, 'METHOD');\n if (method != 'NONE') {\n encrypted = true;\n\n var keyFormat =\n HlsParser.getRequiredAttributeValue_(drmTag, 'KEYFORMAT');\n var drmParser =\n shaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_[keyFormat];\n\n var drmInfo = drmParser ? drmParser(drmTag) : null;\n if (drmInfo) {\n if (drmInfo.keyIds.length) {\n keyId = drmInfo.keyIds[0];\n }\n drmInfos.push(drmInfo);\n } else {\n shaka.log.warning('Unsupported HLS KEYFORMAT', keyFormat);\n }\n }\n });\n\n if (encrypted && !drmInfos.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_KEYFORMATS_NOT_SUPPORTED);\n }\n\n return this.guessMimeType_(type, segments[0].getUris()[0])\n .then(function(mimeType) {\n var stream = {\n id: this.globalId_++,\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex),\n initSegmentReference: initSegmentReference,\n presentationTimeOffset: timeOffset || 0,\n mimeType: mimeType,\n codecs: codecs,\n kind: kind,\n encrypted: encrypted,\n keyId: keyId,\n language: language,\n label: label || null,\n type: type,\n primary: primary,\n // TODO: trick mode\n trickModeVideo: null,\n containsEmsgBoxes: false,\n frameRate: undefined,\n width: undefined,\n height: undefined,\n bandwidth: undefined,\n roles: []\n };\n\n this.streamsToIndexMap_[stream.id] = segmentIndex;\n\n return {\n stream: stream,\n segmentIndex: segmentIndex,\n drmInfos: drmInfos\n };\n }.bind(this));\n }.bind(this));\n\n};\n\n\n/**\n * @param {!shaka.hls.Playlist} playlist\n * @return {shaka.media.InitSegmentReference}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.createInitSegmentReference_ = function(playlist) {\n var Utils = shaka.hls.Utils;\n var mapTags = Utils.filterTagsByName(playlist.tags, 'EXT-X-MAP');\n // TODO: Support multiple map tags?\n // For now, we don't support multiple map tags and will throw an error.\n if (!mapTags.length) {\n return null;\n } else if (mapTags.length > 1) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND);\n }\n\n // Map tag example: #EXT-X-MAP:URI=\"main.mp4\",BYTERANGE=\"720@0\"\n var mapTag = mapTags[0];\n var initUri = shaka.hls.HlsParser.getRequiredAttributeValue_(mapTag, 'URI');\n var uri = Utils.constructAbsoluteUri(playlist.uri, initUri);\n var startByte = 0;\n var endByte = null;\n var byterange = mapTag.getAttributeValue('BYTERANGE');\n // If BYTERANGE attribute is not specified, the segment consists\n // of the entire resourse.\n if (byterange) {\n var blocks = byterange.split('@');\n var byteLength = Number(blocks[0]);\n startByte = Number(blocks[1]);\n endByte = startByte + byteLength - 1;\n }\n\n return new shaka.media.InitSegmentReference(function() { return [uri]; },\n startByte,\n endByte);\n};\n\n\n/**\n * Parses shaka.hls.Segment objects into shaka.media.SegmentReferences.\n *\n * @param {!shaka.hls.Playlist} playlist\n * @param {number} startPosition\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.hls.HlsParser.prototype.createSegments_ =\n function(playlist, startPosition) {\n var hlsSegments = playlist.segments;\n var segments = [];\n\n hlsSegments.forEach(function(segment) {\n var Utils = shaka.hls.Utils;\n var tags = segment.tags;\n var uri = Utils.constructAbsoluteUri(playlist.uri, segment.uri);\n\n // Start and end times\n var extinfTag = this.getRequiredTag_(tags, 'EXTINF');\n // EXTINF tag format is '#EXTINF:<duration>,[<title>]'.\n // We're interested in the duration part.\n var extinfValues = extinfTag.value.split(',');\n var duration = Number(extinfValues[0]);\n var startTime;\n var index = hlsSegments.indexOf(segment);\n if (index == 0) {\n startTime = 0;\n } else {\n startTime = segments[index - 1].endTime;\n }\n var endTime = startTime + duration;\n\n // StartByte and EndByte\n var startByte = 0;\n var endByte = null;\n var byterange = Utils.getFirstTagWithName(tags, 'EXT-X-BYTERANGE');\n // If BYTERANGE is not specified, the segment consists of the\n // entire resourse.\n if (byterange) {\n var blocks = byterange.value.split('@');\n var byteLength = Number(blocks[0]);\n if (blocks[1]) {\n startByte = Number(blocks[1]);\n } else {\n startByte = segments[index - 1].endByte;\n }\n endByte = startByte + byteLength - 1;\n\n // Last segment has endByte of null to indicate that it extends\n // to the end of the resource.\n if (index == hlsSegments.length - 1)\n endByte = null;\n }\n segments.push(new shaka.media.SegmentReference(startPosition + index,\n startTime,\n endTime,\n function() { return [uri]; },\n startByte,\n endByte));\n }.bind(this));\n\n return segments;\n};\n\n\n/**\n * Adjusts segment references of every stream of every variant to the\n * timeline of the presentation.\n * @param {!Array.<!shakaExtern.Variant>} variants\n * @private\n */\nshaka.hls.HlsParser.prototype.fitSegments_ = function(variants) {\n variants.forEach(function(variant) {\n var duration = this.presentationTimeline_.getDuration();\n var video = variant.video;\n var audio = variant.audio;\n if (video && this.streamsToIndexMap_[video.id]) {\n this.streamsToIndexMap_[video.id].fit(duration);\n }\n if (audio && this.streamsToIndexMap_[audio.id]) {\n this.streamsToIndexMap_[audio.id].fit(duration);\n }\n }.bind(this));\n};\n\n\n/**\n * Attempts to guess which codecs from the codecs list belong\n * to a given content type.\n *\n * @param {!string} contentType\n * @param {!Array.<!string>} codecs\n * @return {string}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.guessCodecs_ = function(contentType, codecs) {\n if (codecs.length == 1) {\n return codecs[0];\n }\n\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (contentType == ContentType.TEXT) {\n return '';\n }\n\n var HlsParser = shaka.hls.HlsParser;\n var formats = HlsParser.VIDEO_CODEC_FORMATS_;\n if (contentType == ContentType.AUDIO)\n formats = HlsParser.AUDIO_CODEC_FORMATS_;\n\n for (var i = 0; i < formats.length; i++) {\n for (var j = 0; j < codecs.length; j++) {\n if (formats[i].test(codecs[j].trim())) {\n return codecs[j].trim();\n }\n }\n }\n\n // Unable to guess codecs.\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_COULD_NOT_GUESS_CODECS,\n codecs);\n};\n\n\n/**\n * Attempts to guess stream's mime type based on content type and uri.\n *\n * @param {!string} contentType\n * @param {!string} uri\n * @return {!Promise.<!string>}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.guessMimeType_ = function(contentType, uri) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var blocks = uri.split('.');\n var extension = blocks[blocks.length - 1];\n\n if (contentType == ContentType.TEXT) {\n // HLS only supports vtt at the moment.\n return Promise.resolve('text/vtt');\n }\n\n var HlsParser = shaka.hls.HlsParser;\n var map = HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_;\n if (contentType == ContentType.VIDEO)\n map = HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_;\n\n var mimeType = map[extension];\n if (mimeType)\n return Promise.resolve(mimeType);\n\n // If unable to guess mime type, request a segment and try getting it\n // from the response.\n var headRequest = shaka.net.NetworkingEngine.makeRequest(\n [uri], this.config_.retryParameters);\n headRequest.method = 'HEAD';\n var requestType = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n return this.playerInterface_.networkingEngine.request(\n requestType, headRequest)\n .then(function(response) {\n var mimeType = response.headers['content-type'];\n if (!mimeType) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_COULD_NOT_GUESS_MIME_TYPE,\n extension);\n }\n\n return mimeType;\n });\n};\n\n\n/**\n * Get presentation time offset of the playlist if it has been specified.\n * Return null otherwise.\n *\n * @param {!shaka.hls.Playlist} playlist\n * @return {?number}\n * @private\n */\nshaka.hls.HlsParser.prototype.getTimeOffset_ = function(playlist) {\n var Utils = shaka.hls.Utils;\n var startTag = Utils.getFirstTagWithName(playlist.tags, 'EXT-X-START');\n // TODO: Should we respect the PRECISE flag?\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-4.3.5.2\n if (startTag)\n return Number(shaka.hls.HlsParser.getRequiredAttributeValue_(\n startTag, 'TIME-OFFSET'));\n\n return this.config_.hls.defaultTimeOffset;\n};\n\n\n/**\n * Find the attribute and returns its value.\n * Throws an error if attribute was not found.\n *\n * @param {shaka.hls.Tag} tag\n * @param {!string} attributeName\n * @return {!string}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.getRequiredAttributeValue_ =\n function(tag, attributeName) {\n var attribute = tag.getAttribute(attributeName);\n if (!attribute) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_REQUIRED_ATTRIBUTE_MISSING,\n attributeName);\n }\n\n return attribute.value;\n};\n\n\n/**\n * Returns a tag with a given name.\n * Throws an error if tag was not found.\n *\n * @param {!Array.<shaka.hls.Tag>} tags\n * @param {!string} tagName\n * @return {!shaka.hls.Tag}\n * @private\n * @throws {shaka.util.Error}\n */\nshaka.hls.HlsParser.prototype.getRequiredTag_ = function(tags, tagName) {\n var Utils = shaka.hls.Utils;\n var tag = Utils.getFirstTagWithName(tags, tagName);\n if (!tag) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.MANIFEST,\n shaka.util.Error.Code.HLS_REQUIRED_TAG_MISSING, tagName);\n }\n\n return tag;\n};\n\n\n/**\n * @param {shakaExtern.Stream} stream\n * @param {?string} width\n * @param {?string} height\n * @param {?string} frameRate\n * @private\n */\nshaka.hls.HlsParser.prototype.addVideoAttributes_ =\n function(stream, width, height, frameRate) {\n if (stream) {\n stream.width = Number(width) || undefined;\n stream.height = Number(height) || undefined;\n stream.frameRate = Number(frameRate) || undefined;\n }\n};\n\n\n/**\n * Makes a network request for the manifest and returns a Promise\n * with the resulting data.\n *\n * @param {!string} uri\n * @return {!Promise.<!shakaExtern.Response>}\n * @private\n */\nshaka.hls.HlsParser.prototype.requestManifest_ = function(uri) {\n var requestType = shaka.net.NetworkingEngine.RequestType.MANIFEST;\n var request = shaka.net.NetworkingEngine.makeRequest(\n [uri], this.config_.retryParameters);\n return this.playerInterface_.networkingEngine.request(requestType, request);\n};\n\n\n/**\n * A list of well-known video codecs formats.\n *\n * @const {!Array<!RegExp>}\n * @private\n */\nshaka.hls.HlsParser.VIDEO_CODEC_FORMATS_ = [\n /^(avc)/,\n /^(hvc)/,\n /^(vp[8-9])$/,\n /^(av1)$/,\n /^(mp4v)/\n];\n\n\n/**\n * A list of well-known audio codecs formats.\n *\n * @const {!Array<!RegExp>}\n * @private\n */\nshaka.hls.HlsParser.AUDIO_CODEC_FORMATS_ = [\n /^(vorbis)/,\n /^(opus)/,\n /^(mp4a)/,\n /^(ac-3)$/,\n /^(ec-3)$/\n];\n\n\n/**\n * @const {!Object<string, string>}\n * @private\n */\nshaka.hls.HlsParser.AUDIO_EXTENSIONS_TO_MIME_TYPES_ = {\n 'mp4': 'audio/mp4',\n 'm4s': 'audio/mp4',\n 'm4i': 'audio/mp4',\n 'm4a': 'audio/mp4',\n // mpeg2 ts aslo uses video/ for audio: http://goo.gl/tYHXiS\n 'ts': 'video/mp2t'\n};\n\n\n/**\n * @const {!Object<string, string>}\n * @private\n */\nshaka.hls.HlsParser.VIDEO_EXTENSIONS_TO_MIME_TYPES_ = {\n 'mp4': 'video/mp4',\n 'm4s': 'video/mp4',\n 'm4i': 'video/mp4',\n 'm4v': 'video/mp4',\n 'ts': 'video/mp2t'\n};\n\n\n/**\n * @typedef {function(!shaka.hls.Tag):?shakaExtern.DrmInfo}\n * @private\n */\nshaka.hls.HlsParser.DrmParser_;\n\n\n/**\n * @param {!shaka.hls.Tag} drmTag\n * @return {?shakaExtern.DrmInfo}\n * @private\n */\nshaka.hls.HlsParser.widevineDrmParser_ = function(drmTag) {\n var HlsParser = shaka.hls.HlsParser;\n var method = HlsParser.getRequiredAttributeValue_(drmTag, 'METHOD');\n if (method != 'SAMPLE-AES-CENC') {\n shaka.log.error(\n 'Widevine in HLS is only supported with SAMPLE-AES-CENC, not', method);\n return null;\n }\n\n var uri = HlsParser.getRequiredAttributeValue_(drmTag, 'URI');\n var parsedData = shaka.net.DataUriPlugin.parse(uri);\n\n // The data encoded in the URI is a PSSH box to be used as init data.\n var pssh = new Uint8Array(parsedData.data);\n var drmInfo = shaka.util.ManifestParserUtils.createDrmInfo(\n 'com.widevine.alpha', [\n {initDataType: 'cenc', initData: pssh}\n ]);\n\n var keyId = drmTag.getAttributeValue('KEYID');\n if (keyId) {\n // This value begins with '0x':\n goog.asserts.assert(keyId.substr(0, 2) == '0x',\n 'Incorrect KEYID format!');\n // But the output does not contain the '0x':\n drmInfo.keyIds = [keyId.substr(2).toLowerCase()];\n }\n return drmInfo;\n};\n\n\n/**\n * @const {!Object.<string, shaka.hls.HlsParser.DrmParser_>}\n * @private\n */\nshaka.hls.HlsParser.KEYFORMATS_TO_DRM_PARSERS_ = {\n /* TODO: https://github.com/google/shaka-player/issues/382\n 'com.apple.streamingkeydelivery':\n shaka.hls.HlsParser.fairplayDrmParser_,\n */\n 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed':\n shaka.hls.HlsParser.widevineDrmParser_\n};\n\n\nshaka.media.ManifestParser.registerParserByExtension(\n 'm3u8', shaka.hls.HlsParser);\nshaka.media.ManifestParser.registerParserByMime(\n 'application/x-mpegurl', shaka.hls.HlsParser);\nshaka.media.ManifestParser.registerParserByMime(\n 'application/vnd.apple.mpegurl', shaka.hls.HlsParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/hls/hls_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.TtmlTextParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\n\n\n\n/**\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.TtmlTextParser = function() {};\n\n\n/** @override */\nshaka.media.TtmlTextParser.prototype.parseInit = function(data) {\n goog.asserts.assert(false, 'TTML does not have init segments');\n};\n\n\n/** @override */\nshaka.media.TtmlTextParser.prototype.parseMedia = function(data, time) {\n var str = shaka.util.StringUtils.fromUTF8(data);\n var ret = [];\n var parser = new DOMParser();\n var xml = null;\n\n try {\n xml = parser.parseFromString(str, 'text/xml');\n } catch (exception) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_XML);\n }\n\n if (xml) {\n // Try to get the framerate, subFrameRate and frameRateMultiplier\n // if applicable\n var frameRate = null;\n var subFrameRate = null;\n var frameRateMultiplier = null;\n var tickRate = null;\n var spaceStyle = null;\n var tts = xml.getElementsByTagName('tt');\n var tt = tts[0];\n // TTML should always have tt element\n if (!tt) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_XML);\n } else {\n frameRate = tt.getAttribute('ttp:frameRate');\n subFrameRate = tt.getAttribute('ttp:subFrameRate');\n frameRateMultiplier = tt.getAttribute('ttp:frameRateMultiplier');\n tickRate = tt.getAttribute('ttp:tickRate');\n spaceStyle = tt.getAttribute('xml:space') || 'default';\n }\n\n if (spaceStyle != 'default' && spaceStyle != 'preserve') {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_XML);\n }\n var whitespaceTrim = spaceStyle == 'default';\n\n var rateInfo = new shaka.media.TtmlTextParser.RateInfo_(\n frameRate, subFrameRate, frameRateMultiplier, tickRate);\n\n var styles = shaka.media.TtmlTextParser.getLeafNodes_(\n tt.getElementsByTagName('styling')[0]);\n var regions = shaka.media.TtmlTextParser.getLeafNodes_(\n tt.getElementsByTagName('layout')[0]);\n var textNodes = shaka.media.TtmlTextParser.getLeafNodes_(\n tt.getElementsByTagName('body')[0]);\n\n for (var i = 0; i < textNodes.length; i++) {\n var cue = shaka.media.TtmlTextParser.parseCue_(textNodes[i],\n time.periodStart,\n rateInfo,\n styles,\n regions,\n whitespaceTrim);\n if (cue)\n ret.push(cue);\n }\n }\n\n return ret;\n};\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 00:00:40:07 (7 frames) or 00:00:40:07.1 (7 frames, 1 subframe)\n */\nshaka.media.TtmlTextParser.timeColonFormatFrames_ =\n /^(\\d{2,}):(\\d{2}):(\\d{2}):(\\d{2})\\.?(\\d+)?$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 00:00:40 or 00:40\n */\nshaka.media.TtmlTextParser.timeColonFormat_ =\n /^(?:(\\d{2,}):)?(\\d{2}):(\\d{2})$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * example 01:02:43.0345555 or 02:43.03\n */\nshaka.media.TtmlTextParser.timeColonFormatMilliseconds_ =\n /^(?:(\\d{2,}):)?(\\d{2}):(\\d{2}\\.\\d{2,})$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 75f or 75.5f\n */\nshaka.media.TtmlTextParser.timeFramesFormat_ = /^(\\d*\\.?\\d*)f$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 50t or 50.5t\n */\nshaka.media.TtmlTextParser.timeTickFormat_ = /^(\\d*\\.?\\d*)t$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 3.45h, 3m or 4.20s\n */\nshaka.media.TtmlTextParser.timeHMSFormat_ =\n /^(?:(\\d*\\.?\\d*)h)?(?:(\\d*\\.?\\d*)m)?(?:(\\d*\\.?\\d*)s)?(?:(\\d*\\.?\\d*)ms)?$/;\n\n\n/**\n * @const\n * @private {!RegExp}\n * @example 50% 10%\n */\nshaka.media.TtmlTextParser.percentValues_ = /^(\\d{1,2}|100)% (\\d{1,2}|100)%$/;\n\n\n/**\n * @const\n * @private {!Object}\n */\nshaka.media.TtmlTextParser.textAlignToLineAlign_ = {\n 'left': 'start',\n 'center': 'center',\n 'right': 'end',\n 'start': 'start',\n 'end': 'end'\n};\n\n\n/**\n * @const\n * @private {!Object}\n */\nshaka.media.TtmlTextParser.textAlignToPositionAlign_ = {\n 'left': 'line-left',\n 'center': 'center',\n 'right': 'line-right'\n};\n\n\n/**\n * Gets leaf nodes of the xml node tree. Ignores the text, br elements\n * and the spans positioned inside paragraphs\n *\n * @param {Element} element\n * @return {!Array.<!Element>}\n * @private\n */\nshaka.media.TtmlTextParser.getLeafNodes_ = function(element) {\n var result = [];\n if (!element)\n return result;\n\n var childNodes = element.childNodes;\n for (var i = 0; i < childNodes.length; i++) {\n // Currently we don't support styles applicable to span\n // elements, so they are ignored\n var isSpanChildOfP = childNodes[i].nodeName == 'span' &&\n element.nodeName == 'p';\n if (childNodes[i].nodeType == Node.ELEMENT_NODE &&\n childNodes[i].nodeName != 'br' && !isSpanChildOfP) {\n // Get the leafs the child might contain\n goog.asserts.assert(childNodes[i] instanceof Element,\n 'Node should be Element!');\n var leafChildren = shaka.media.TtmlTextParser.getLeafNodes_(\n /** @type {Element} */(childNodes[i]));\n goog.asserts.assert(leafChildren.length > 0,\n 'Only a null Element should return no leaves!');\n result = result.concat(leafChildren);\n }\n }\n\n // if no result at this point, the element itself must be a leaf\n if (!result.length) {\n result.push(element);\n }\n return result;\n};\n\n\n/**\n * Insert \\n where <br> tags are found\n *\n * @param {!Node} element\n * @param {boolean} whitespaceTrim\n * @private\n */\nshaka.media.TtmlTextParser.addNewLines_ = function(element, whitespaceTrim) {\n var childNodes = element.childNodes;\n\n for (var i = 0; i < childNodes.length; i++) {\n if (childNodes[i].nodeName == 'br' && i > 0) {\n childNodes[i - 1].textContent += '\\n';\n } else if (childNodes[i].childNodes.length > 0) {\n shaka.media.TtmlTextParser.addNewLines_(childNodes[i], whitespaceTrim);\n } else if (whitespaceTrim) {\n // Trim leading and trailing whitespace.\n var trimmed = childNodes[i].textContent.trim();\n // Collapse multiple spaces into one.\n trimmed = trimmed.replace(/\\s+/g, ' ');\n\n childNodes[i].textContent = trimmed;\n }\n }\n};\n\n\n/**\n * Parses an Element into a TextTrackCue or VTTCue.\n *\n * @param {!Element} cueElement\n * @param {number} offset\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {!Array.<!Element>} styles\n * @param {!Array.<!Element>} regions\n * @param {boolean} whitespaceTrim\n * @return {TextTrackCue}\n * @private\n */\nshaka.media.TtmlTextParser.parseCue_ = function(\n cueElement, offset, rateInfo, styles, regions, whitespaceTrim) {\n\n // Disregard empty elements:\n // TTML allows for empty elements like <div></div>.\n // If cueElement has neither time attributes, nor\n // non-whitespace text, don't try to make a cue out of it.\n if (!cueElement.hasAttribute('begin') &&\n !cueElement.hasAttribute('end') &&\n /^\\s*$/.test(cueElement.textContent))\n return null;\n\n shaka.media.TtmlTextParser.addNewLines_(cueElement, whitespaceTrim);\n\n // Get time\n var start = shaka.media.TtmlTextParser.parseTime_(\n cueElement.getAttribute('begin'), rateInfo);\n var end = shaka.media.TtmlTextParser.parseTime_(\n cueElement.getAttribute('end'), rateInfo);\n var duration = shaka.media.TtmlTextParser.parseTime_(\n cueElement.getAttribute('dur'), rateInfo);\n var payload = cueElement.textContent;\n\n if (end == null && duration != null)\n end = start + duration;\n\n if (start == null || end == null) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_TEXT_CUE);\n }\n\n start += offset;\n end += offset;\n\n var cue = shaka.media.TextEngine.makeCue(start, end, payload);\n if (!cue)\n return null;\n\n // Get other properties if available\n var region = shaka.media.TtmlTextParser.getElementFromCollection_(\n cueElement, 'region', regions);\n shaka.media.TtmlTextParser.addStyle_(cue, cueElement, region, styles);\n\n return cue;\n};\n\n\n/**\n * Adds applicable style properties to a cue.\n *\n * @param {!TextTrackCue} cue\n * @param {!Element} cueElement\n * @param {Element} region\n * @param {!Array.<!Element>} styles\n * @private\n */\nshaka.media.TtmlTextParser.addStyle_ = function(\n cue, cueElement, region, styles) {\n var TtmlTextParser = shaka.media.TtmlTextParser;\n var results = null;\n\n\n var extent = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:extent');\n if (extent) {\n results = TtmlTextParser.percentValues_.exec(extent);\n if (results != null) {\n // Use width value of the extent attribute for size.\n // Height value is ignored.\n cue.size = Number(results[1]);\n }\n }\n\n var writingMode = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:writingMode');\n var isVerticalText = true;\n if (writingMode == 'tb' || writingMode == 'tblr')\n cue.vertical = 'lr';\n else if (writingMode == 'tbrl')\n cue.vertical = 'rl';\n else\n isVerticalText = false;\n\n var origin = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:origin');\n if (origin) {\n results = TtmlTextParser.percentValues_.exec(origin);\n if (results != null) {\n // for vertical text use first coordinate of tts:origin\n // to represent line of the cue and second - for position.\n // Otherwise (horizontal), use them the other way around.\n if (isVerticalText) {\n cue.position = Number(results[2]);\n cue.line = Number(results[1]);\n } else {\n cue.position = Number(results[1]);\n cue.line = Number(results[2]);\n }\n // A boolean indicating whether the line is an integer\n // number of lines (using the line dimensions of the first\n // line of the cue), or whether it is a percentage of the\n // dimension of the video. The flag is set to true when lines\n // are counted, and false otherwise.\n cue.snapToLines = false;\n }\n }\n\n var align = TtmlTextParser.getStyleAttribute_(\n cueElement, region, styles, 'tts:textAlign');\n if (align) {\n cue.align = align;\n if (align == 'center') {\n if (cue.align != 'center') {\n // Workaround for a Chrome bug http://crbug.com/663797\n // Chrome does not support align = 'center'\n cue.align = 'middle';\n }\n cue.position = 'auto';\n }\n cue.positionAlign = TtmlTextParser.textAlignToPositionAlign_[align];\n cue.lineAlign = TtmlTextParser.textAlignToLineAlign_[align];\n }\n};\n\n\n/**\n * Finds a specified attribute on either the original cue element or its\n * associated region and returns the value if the attribute was found.\n *\n * @param {!Element} cueElement\n * @param {Element} region\n * @param {!Array.<!Element>} styles\n * @param {string} attribute\n * @return {?string}\n * @private\n */\nshaka.media.TtmlTextParser.getStyleAttribute_ = function(\n cueElement, region, styles, attribute) {\n\n // An attribute can be specified on region level or in a styling block\n // associated with the region or original element.\n var regionChildren = shaka.media.TtmlTextParser.getLeafNodes_(region);\n for (var i = 0; i < regionChildren.length; i++) {\n var attr = regionChildren[i].getAttribute(attribute);\n if (attr)\n return attr;\n }\n\n var getElementFromCollection_ =\n shaka.media.TtmlTextParser.getElementFromCollection_;\n var style = getElementFromCollection_(region, 'style', styles) ||\n getElementFromCollection_(cueElement, 'style', styles);\n if (style)\n return style.getAttribute(attribute);\n return null;\n};\n\n\n/**\n * Selects an item from |collection| whose id matches |attributeName|\n * from |element|.\n *\n * @param {Element} element\n * @param {string} attributeName\n * @param {!Array.<Element>} collection\n * @return {Element}\n * @private\n */\nshaka.media.TtmlTextParser.getElementFromCollection_ = function(\n element, attributeName, collection) {\n if (!element || collection.length < 1) {\n return null;\n }\n var item = null;\n var itemName = shaka.media.TtmlTextParser.getInheritedAttribute_(\n element, attributeName);\n if (itemName) {\n for (var i = 0; i < collection.length; i++) {\n if (collection[i].getAttribute('xml:id') == itemName) {\n item = collection[i];\n break;\n }\n }\n }\n\n return item;\n};\n\n\n/**\n * Traverses upwards from a given node until a given attribute is found.\n *\n * @param {!Element} element\n * @param {string} attributeName\n * @return {?string}\n * @private\n */\nshaka.media.TtmlTextParser.getInheritedAttribute_ = function(\n element, attributeName) {\n var ret = null;\n while (element) {\n ret = element.getAttribute(attributeName);\n if (ret) {\n break;\n }\n\n // Element.parentNode can lead to XMLDocument, which is not an Element and\n // has no getAttribute().\n var parentNode = element.parentNode;\n if (parentNode instanceof Element) {\n element = parentNode;\n } else {\n break;\n }\n }\n return ret;\n};\n\n\n/**\n * Parses a TTML time from the given word.\n *\n * @param {string} text\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseTime_ = function(text, rateInfo) {\n var ret = null;\n var TtmlTextParser = shaka.media.TtmlTextParser;\n\n if (TtmlTextParser.timeColonFormatFrames_.test(text)) {\n ret = TtmlTextParser.parseColonTimeWithFrames_(rateInfo, text);\n } else if (TtmlTextParser.timeColonFormat_.test(text)) {\n ret = TtmlTextParser.parseTimeFromRegex_(\n TtmlTextParser.timeColonFormat_, text);\n } else if (TtmlTextParser.timeColonFormatMilliseconds_.test(text)) {\n ret = TtmlTextParser.parseTimeFromRegex_(\n TtmlTextParser.timeColonFormatMilliseconds_, text);\n } else if (TtmlTextParser.timeFramesFormat_.test(text)) {\n ret = TtmlTextParser.parseFramesTime_(rateInfo, text);\n } else if (TtmlTextParser.timeTickFormat_.test(text)) {\n ret = TtmlTextParser.parseTickTime_(rateInfo, text);\n } else if (TtmlTextParser.timeHMSFormat_.test(text)) {\n ret = TtmlTextParser.parseTimeFromRegex_(\n TtmlTextParser.timeHMSFormat_, text);\n }\n\n return ret;\n};\n\n\n/**\n * Parses a TTML time in frame format\n *\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseFramesTime_ = function(rateInfo, text) {\n\n // 75f or 75.5f\n var results = shaka.media.TtmlTextParser.timeFramesFormat_.exec(text);\n var frames = Number(results[1]);\n\n return frames / rateInfo.frameRate;\n};\n\n\n/**\n * Parses a TTML time in tick format\n *\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseTickTime_ = function(rateInfo, text) {\n\n // 50t or 50.5t\n var results = shaka.media.TtmlTextParser.timeTickFormat_.exec(text);\n var ticks = Number(results[1]);\n\n return ticks / rateInfo.tickRate;\n};\n\n\n/**\n * Parses a TTML colon formatted time containing frames\n *\n * @param {!shaka.media.TtmlTextParser.RateInfo_} rateInfo\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseColonTimeWithFrames_ = function(\n rateInfo, text) {\n\n // 01:02:43:07 ('07' is frames) or 01:02:43:07.1 (subframes)\n var results = shaka.media.TtmlTextParser.timeColonFormatFrames_.exec(text);\n\n var hours = Number(results[1]);\n var minutes = Number(results[2]);\n var seconds = Number(results[3]);\n var frames = Number(results[4]);\n var subframes = Number(results[5]) || 0;\n\n frames += subframes / rateInfo.subFrameRate;\n seconds += frames / rateInfo.frameRate;\n\n return seconds + (minutes * 60) + (hours * 3600);\n};\n\n\n/**\n * Parses a TTML time with a given regex. Expects regex to be some\n * sort of a time-matcher to match hours, minutes, seconds and milliseconds\n *\n * @param {!RegExp} regex\n * @param {string} text\n * @return {?number}\n * @private\n */\nshaka.media.TtmlTextParser.parseTimeFromRegex_ = function(regex, text) {\n var results = regex.exec(text);\n if (results == null || results[0] == '')\n return null;\n // This capture is optional, but will still be in the array as undefined,\n // default to 0.\n var hours = Number(results[1]) || 0;\n var minutes = Number(results[2]) || 0;\n var seconds = Number(results[3]) || 0;\n var miliseconds = Number(results[4]) || 0;\n\n return (miliseconds / 1000) + seconds + (minutes * 60) + (hours * 3600);\n};\n\n\n\n/**\n * Contains information about frame/subframe rate\n * and frame rate multiplier for time in frame format.\n * ex. 01:02:03:04(4 frames) or 01:02:03:04.1(4 frames, 1 subframe)\n *\n * @param {?string} frameRate\n * @param {?string} subFrameRate\n * @param {?string} frameRateMultiplier\n * @param {?string} tickRate\n * @constructor\n * @struct\n * @private\n */\nshaka.media.TtmlTextParser.RateInfo_ = function(\n frameRate, subFrameRate, frameRateMultiplier, tickRate) {\n\n /**\n * @type {number}\n */\n this.frameRate = Number(frameRate) || 30;\n\n /**\n * @type {number}\n */\n this.subFrameRate = Number(subFrameRate) || 1;\n\n /**\n * @type {number}\n */\n this.tickRate = Number(tickRate);\n if (this.tickRate == 0) {\n if (frameRate)\n this.tickRate = this.frameRate * this.subFrameRate;\n else\n this.tickRate = 1;\n }\n\n if (frameRateMultiplier) {\n var multiplierResults = /^(\\d+) (\\d+)$/g.exec(frameRateMultiplier);\n if (multiplierResults) {\n var numerator = multiplierResults[1];\n var denominator = multiplierResults[2];\n var multiplierNum = numerator / denominator;\n this.frameRate *= multiplierNum;\n }\n }\n};\n\n\nshaka.media.TextEngine.registerParser(\n 'application/ttml+xml',\n shaka.media.TtmlTextParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/ttml_text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Mp4TtmlParser');\n\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.media.TtmlTextParser');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Mp4Parser');\n\n\n\n/**\n * @struct\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.Mp4TtmlParser = function() {\n /**\n * @type {!shakaExtern.TextParser}\n * @private\n */\n this.parser_ = new shaka.media.TtmlTextParser();\n};\n\n\n/** @override **/\nshaka.media.Mp4TtmlParser.prototype.parseInit = function(data) {\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var sawSTPP = false;\n\n new Mp4Parser()\n .box('moov', Mp4Parser.children)\n .box('trak', Mp4Parser.children)\n .box('mdia', Mp4Parser.children)\n .box('minf', Mp4Parser.children)\n .box('stbl', Mp4Parser.children)\n .fullBox('stsd', Mp4Parser.sampleDescription)\n .box('stpp', function(box) {\n sawSTPP = true;\n }).parse(data);\n\n if (!sawSTPP) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_TTML);\n }\n};\n\n\n/** @override **/\nshaka.media.Mp4TtmlParser.prototype.parseMedia = function(data, time) {\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var sawMDAT = false;\n var payload = [];\n\n new Mp4Parser()\n .box('mdat', Mp4Parser.allData(function(data) {\n sawMDAT = true;\n payload = this.parser_.parseMedia(data.buffer, time);\n }.bind(this))).parse(data);\n\n if (!sawMDAT) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_TTML);\n }\n\n return payload;\n};\n\n\nshaka.media.TextEngine.registerParser(\n 'application/mp4; codecs=\"stpp\"',\n shaka.media.Mp4TtmlParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/mp4_ttml_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.VttTextParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.TextParser');\n\n\n\n/**\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.VttTextParser = function() { };\n\n\n/** @override */\nshaka.media.VttTextParser.prototype.parseInit = function(data) {\n goog.asserts.assert(false, 'VTT does not have init segments');\n};\n\n\n/**\n * @override\n * @throws {shaka.util.Error}\n */\nshaka.media.VttTextParser.prototype.parseMedia = function(data, time) {\n var VttTextParser = shaka.media.VttTextParser;\n // Get the input as a string. Normalize newlines to \\n.\n var str = shaka.util.StringUtils.fromUTF8(data);\n str = str.replace(/\\r\\n|\\r(?=[^\\n]|$)/gm, '\\n');\n var blocks = str.split(/\\n{2,}/m);\n\n if (!/^WEBVTT($|[ \\t\\n])/m.test(blocks[0])) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_TEXT_HEADER);\n }\n\n var offset = time.segmentStart;\n // Parse X-TIMESTAMP-MAP metadata header if it's present to get\n // time offset information.\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5\n if (blocks[0].indexOf('X-TIMESTAMP-MAP') >= 0) {\n // 'X-TIMESTAMP-MAP' header is used in HLS to align text with\n // the rest of the media.\n // The header format is 'X-TIMESTAMP-MAP=MPEGTS:n,LOCAL:m'\n // (the attributes can go in any order)\n // where n is MPEG-2 time and m is cue time it maps to.\n // For example 'X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000'\n // means an offset of 10 seconds\n // 900000/MPEG_TIMESCALE - cue time.\n var cueTimeMatch =\n blocks[0].match(/LOCAL:((?:(\\d{1,}):)?(\\d{2}):(\\d{2})\\.(\\d{3}))/m);\n\n var mpegTimeMatch = blocks[0].match(/MPEGTS:(\\d+)/m);\n if (cueTimeMatch && mpegTimeMatch) {\n var parser = new shaka.util.TextParser(cueTimeMatch[1]);\n var cueTime = shaka.media.VttTextParser.parseTime_(parser);\n var mpegTime = Number(mpegTimeMatch[1]);\n var mpegTimescale = shaka.media.VttTextParser.MPEG_TIMESCALE_;\n // Apple-encoded HLS content uses absolute timestamps, so assume\n // the presence of the map tag means the content uses absolute\n // timestamps.\n offset = time.periodStart + (mpegTime / mpegTimescale - cueTime);\n }\n }\n\n var ret = [];\n for (var i = 1; i < blocks.length; i++) {\n var lines = blocks[i].split('\\n');\n var cue = VttTextParser.parseCue_(lines, offset);\n if (cue)\n ret.push(cue);\n }\n\n return ret;\n};\n\n\n/**\n * Parses a text block into a Cue object.\n *\n * @param {!Array.<string>} text\n * @param {number} timeOffset\n * @return {?TextTrackCue}\n * @private\n */\nshaka.media.VttTextParser.parseCue_ = function(text, timeOffset) {\n // Skip empty blocks.\n if (text.length == 1 && !text[0])\n return null;\n\n // Skip comment blocks.\n if (/^NOTE($|[ \\t])/.test(text[0]))\n return null;\n\n var id = null;\n var index = text[0].indexOf('-->');\n if (index < 0) {\n id = text[0];\n text.splice(0, 1);\n }\n\n // Parse the times.\n var parser = new shaka.util.TextParser(text[0]);\n var start = shaka.media.VttTextParser.parseTime_(parser);\n var expect = parser.readRegex(/[ \\t]+-->[ \\t]+/g);\n var end = shaka.media.VttTextParser.parseTime_(parser);\n\n if (start == null || expect == null || end == null) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_TEXT_CUE);\n }\n\n start += timeOffset;\n end += timeOffset;\n\n // Get the payload.\n var payload = text.slice(1).join('\\n').trim();\n\n var cue = shaka.media.TextEngine.makeCue(start, end, payload);\n if (!cue)\n return null;\n\n // Parse optional settings.\n parser.skipWhitespace();\n var word = parser.readWord();\n while (word) {\n if (!shaka.media.VttTextParser.parseSetting(cue, word)) {\n shaka.log.warning('VTT parser encountered an invalid VTT setting: ',\n word,\n ' The setting will be ignored.');\n }\n parser.skipWhitespace();\n word = parser.readWord();\n }\n\n if (id != null)\n cue.id = id;\n return cue;\n};\n\n\n/**\n * Parses a WebVTT setting from the given word.\n *\n * @param {!TextTrackCue} cue\n * @param {string} word\n * @return {boolean} True on success.\n */\nshaka.media.VttTextParser.parseSetting = function(cue, word) {\n // NOTE: positionAlign and lineAlign settings are not supported by Chrome\n // at the moment, so setting them will have no effect.\n // The bug on chromium to implement them:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=633690\n\n var results = null;\n if ((results = /^align:(start|middle|center|end|left|right)$/.exec(word))) {\n cue.align = results[1];\n if (results[1] == 'center' && cue.align != 'center') {\n // Workaround for a Chrome bug http://crbug.com/663797\n // Chrome does not support align = 'center'\n cue.position = 'auto';\n cue.align = 'middle';\n }\n } else if ((results = /^vertical:(lr|rl)$/.exec(word))) {\n cue.vertical = results[1];\n } else if ((results = /^size:(\\d{1,2}|100)%$/.exec(word))) {\n cue.size = Number(results[1]);\n }\n // There was a disagreement between a working draft and an editor draft of\n // the WebVTT spec. According to the former, optional position alignment\n // options are 'start', 'end' and 'center'. According to the latter -\n // 'line-left', 'center' and 'line-right'.\n // We are going to support both options for now.\n else if ((results =\n /^position:(\\d{1,2}|100)%(?:,(line-left|line-right|center|start|end))?$/\n .exec(word))) {\n cue.position = Number(results[1]);\n if (results[2])\n cue.positionAlign = results[2];\n } else if ((results =\n /^line:(\\d{1,2}|100)%(?:,(start|end|center))?$/.exec(word))) {\n cue.snapToLines = false;\n cue.line = Number(results[1]);\n if (results[2])\n cue.lineAlign = results[2];\n } else if ((results = /^line:(-?\\d+)(?:,(start|end|center))?$/.exec(word))) {\n cue.snapToLines = true;\n cue.line = Number(results[1]);\n if (results[2])\n cue.lineAlign = results[2];\n } else {\n return false;\n }\n\n return true;\n};\n\n\n/**\n * Parses a WebVTT time from the given parser.\n *\n * @param {!shaka.util.TextParser} parser\n * @return {?number}\n * @private\n */\nshaka.media.VttTextParser.parseTime_ = function(parser) {\n // 00:00.000 or 00:00:00.000 or 0:00:00.000\n var results = parser.readRegex(/(?:(\\d{1,}):)?(\\d{2}):(\\d{2})\\.(\\d{3})/g);\n if (results == null)\n return null;\n // This capture is optional, but will still be in the array as undefined,\n // default to 0.\n var hours = Number(results[1]) || 0;\n var minutes = Number(results[2]);\n var seconds = Number(results[3]);\n var miliseconds = Number(results[4]);\n if (minutes > 59 || seconds > 59)\n return null;\n\n return (miliseconds / 1000) + seconds + (minutes * 60) + (hours * 3600);\n};\n\n\n/**\n * @const {number}\n * @private\n */\nshaka.media.VttTextParser.MPEG_TIMESCALE_ = 90000;\n\nshaka.media.TextEngine.registerParser(\n 'text/vtt',\n shaka.media.VttTextParser);\n\nshaka.media.TextEngine.registerParser(\n 'text/vtt; codecs=\"vtt\"',\n shaka.media.VttTextParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/vtt_text_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Mp4VttParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TextEngine');\ngoog.require('shaka.media.VttTextParser');\ngoog.require('shaka.util.DataViewReader');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Mp4Parser');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.TextParser');\n\n\n\n/**\n * @struct\n * @constructor\n * @implements {shakaExtern.TextParser}\n */\nshaka.media.Mp4VttParser = function() {\n /**\n * The current time scale used by the VTT parser.\n *\n * @type {?number}\n * @private\n */\n this.timescale_ = null;\n};\n\n\n/** @override */\nshaka.media.Mp4VttParser.prototype.parseInit = function(data) {\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var sawWVTT = false;\n\n new Mp4Parser()\n .box('moov', Mp4Parser.children)\n .box('trak', Mp4Parser.children)\n .box('mdia', Mp4Parser.children)\n .fullBox('mdhd', function(box) {\n goog.asserts.assert(\n box.version == 0 || box.version == 1,\n 'MDHD version can only be 0 or 1');\n if (box.version == 0) {\n box.reader.skip(4); // skip \"creation_time\"\n box.reader.skip(4); // skip \"modification_time\"\n this.timescale_ = box.reader.readUint32();\n box.reader.skip(4); // skip \"duration\"\n } else {\n box.reader.skip(8); // skip \"creation_time\"\n box.reader.skip(8); // skip \"modification_time\"\n this.timescale_ = box.reader.readUint32();\n box.reader.skip(8); // skip \"duration\"\n }\n box.reader.skip(4); // skip \"pad\", \"language\", and \"pre-defined\"\n }.bind(this))\n .box('minf', Mp4Parser.children)\n .box('stbl', Mp4Parser.children)\n .fullBox('stsd', Mp4Parser.sampleDescription)\n .box('wvtt', function(box) {\n // A valid vtt init segment, no actual subtitles yet\n sawWVTT = true;\n }).parse(data);\n\n if (!this.timescale_) {\n // Missing timescale for VTT content. Should be located in the MDHD\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_VTT);\n }\n\n if (!sawWVTT) {\n // A WVTT box should have been seen (a valid vtt init segment with no\n // actual subtitles).\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_VTT);\n }\n};\n\n\n/** @override */\nshaka.media.Mp4VttParser.prototype.parseMedia = function(data, time) {\n var Mp4VttParser = shaka.media.Mp4VttParser;\n var Mp4Parser = shaka.util.Mp4Parser;\n\n var baseTime = 0;\n var presentations = [];\n var payloads = [];\n var cues = [];\n\n var sawTFDT = false;\n var sawTRUN = false;\n var sawMDAT = false;\n\n new Mp4Parser()\n .box('moof', Mp4Parser.children)\n .box('traf', Mp4Parser.children)\n .fullBox('tfdt', function(box) {\n sawTFDT = true;\n goog.asserts.assert(\n box.version == 0 || box.version == 1,\n 'TFDT version can only be 0 or 1');\n baseTime = (box.version == 0) ?\n box.reader.readUint32() :\n box.reader.readUint64();\n })\n .fullBox('trun', function(box) {\n sawTRUN = true;\n goog.asserts.assert(\n box.version != null,\n 'A TRUN box should have a valid version value');\n goog.asserts.assert(\n box.flags != null,\n 'A TRUN box should have a valid flags value');\n presentations = Mp4VttParser.parseTRUN_(\n box.version, box.flags, box.reader);\n })\n .box('vtte', function(box) {\n // VTTE are empty cues, so there is no need to do any more than insert\n // a place-holder. We must add something or else the ordering between\n // the payloads and presentation times would fall out of order.\n payloads.push(null);\n })\n .box('vttc', Mp4Parser.allData(function(data) {\n payloads.push(data.buffer);\n }))\n .box('mdat', function(box) {\n sawMDAT = true;\n Mp4Parser.children(box);\n }).parse(data);\n\n if (!sawMDAT && !sawTFDT && !sawTRUN) {\n // A required box is missing\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.TEXT,\n shaka.util.Error.Code.INVALID_MP4_VTT);\n }\n\n goog.asserts.assert(\n presentations.length == payloads.length,\n 'The number of presentations should equal the number of payloads');\n\n var currentTime = baseTime;\n\n for (var i = 0; i < presentations.length; i++) {\n var presentation = presentations[i];\n var payload = payloads[i];\n\n if (presentation.duration) {\n var startTime = presentation.timeOffset ?\n baseTime + presentation.timeOffset :\n currentTime;\n\n currentTime = startTime + presentation.duration;\n\n // The payload can be null as that would mean that it was a VTTE and\n // was only inserted to keep the presentation times in sync with the\n // payloads.\n if (payload) {\n cues.push(shaka.media.Mp4VttParser.parseVTTC_(\n payload,\n time.periodStart + startTime / this.timescale_,\n time.periodStart + currentTime / this.timescale_));\n }\n }\n }\n\n return cues;\n};\n\n\n/**\n * @typedef {{\n * duration: ?number,\n * timeOffset: ?number\n * }}\n *\n * @property {?number} duration\n * The length of the segment in timescale units.\n * @property {?number} timeOffset\n * The time since the start of the segment in timescale units. Time\n * offset is based of the start of the segment. If this value is\n * missing, the accumated durations preceeding this time segment will\n * be used to create the start time.\n */\nshaka.media.Mp4VttParser.TimeSegment;\n\n\n/**\n * @param {number} version\n * @param {number} flags\n * @param {!shaka.util.DataViewReader} reader\n * @return {!Array.<shaka.media.Mp4VttParser.TimeSegment>}\n * @private\n */\nshaka.media.Mp4VttParser.parseTRUN_ = function(version, flags, reader) {\n var sampleCount = reader.readUint32();\n\n // skip \"data_offset\" if present\n if (flags & 0x000001) { reader.skip(4); }\n\n // skip \"first_sample_flags\" if present\n if (flags & 0x000004) { reader.skip(4); }\n\n var samples = [];\n\n for (var sampleIndex = 0; sampleIndex < sampleCount; sampleIndex++) {\n\n /** @type {shaka.media.Mp4VttParser.TimeSegment} */\n var sample = {\n duration: null,\n timeOffset: null\n };\n\n // read \"sample duration\" if present\n if (flags & 0x000100) { sample.duration = reader.readUint32(); }\n\n // skip \"sample_size\" if present\n if (flags & 0x000200) { reader.skip(4); }\n\n // skip \"sample_flags\" if present\n if (flags & 0x000400) {reader.skip(4); }\n\n // read \"sample_time_offset\" if present\n if (flags & 0x000800) {\n sample.timeOffset = version == 0 ?\n reader.readUint32() :\n reader.readInt32();\n }\n\n samples.push(sample);\n }\n\n return samples;\n};\n\n\n/**\n * Parses a vttc box into a cue.\n *\n * @param {!ArrayBuffer} data\n * @param {number} startTime\n * @param {number} endTime\n * @return {TextTrackCue}\n * @private\n */\nshaka.media.Mp4VttParser.parseVTTC_ = function(data, startTime, endTime) {\n var payload;\n var id;\n var settings;\n\n new shaka.util.Mp4Parser()\n .box('payl', shaka.util.Mp4Parser.allData(function(data) {\n payload = shaka.util.StringUtils.fromUTF8(data);\n }))\n .box('iden', shaka.util.Mp4Parser.allData(function(data) {\n id = shaka.util.StringUtils.fromUTF8(data);\n }))\n .box('sttg', shaka.util.Mp4Parser.allData(function(data) {\n settings = shaka.util.StringUtils.fromUTF8(data);\n }))\n .parse(data);\n\n if (payload) {\n return shaka.media.Mp4VttParser.assembleCue_(payload,\n id,\n settings,\n startTime,\n endTime);\n } else {\n return null;\n }\n};\n\n\n/**\n * Take the individual components that make a cue and create a vttc cue.\n *\n * @param {string} payload\n * @param {?string} id\n * @param {?string} settings\n * @param {number} startTime\n * @param {number} endTime\n * @return {TextTrackCue}\n * @private\n */\nshaka.media.Mp4VttParser.assembleCue_ = function(payload,\n id,\n settings,\n startTime,\n endTime) {\n var cue = shaka.media.TextEngine.makeCue(\n startTime,\n endTime,\n payload);\n\n if (cue && id) {\n cue.id = id;\n }\n\n if (cue && settings) {\n var parser = new shaka.util.TextParser(settings);\n\n var word = parser.readWord();\n\n while (word) {\n\n if (!shaka.media.VttTextParser.parseSetting(cue, word)) {\n shaka.log.warning('VTT parser encountered an invalid VTT setting: ',\n word,\n ' The setting will be ignored.');\n }\n\n parser.skipWhitespace();\n word = parser.readWord();\n }\n }\n\n return cue;\n};\n\n\nshaka.media.TextEngine.registerParser(\n 'application/mp4; codecs=\"wvtt\"',\n shaka.media.Mp4VttParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/mp4_vtt_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.Playhead');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.TimeRangesUtils');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * Creates a Playhead, which manages the video's current time.\n *\n * The Playhead provides mechanisms for setting the presentation's start time,\n * restricting seeking to valid time ranges, and stopping playback for startup\n * and re- buffering.\n *\n * @param {HTMLMediaElement} video\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.StreamingConfiguration} config\n * @param {?number} startTime The playhead's initial position in seconds. If\n * null, defaults to the start of the presentation for VOD and the live-edge\n * for live.\n * @param {function()} onSeek Called when the user agent seeks to a time within\n * the presentation timeline.\n * @param {function(!Event)} onEvent Called when an event is raised to be sent\n * to the application.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.Playhead = function(\n video, manifest, config, startTime, onSeek, onEvent) {\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = manifest;\n\n /** @private {?shakaExtern.StreamingConfiguration} */\n this.config_ = config;\n\n /**\n * The playhead's initial position in seconds, or null if it should\n * automatically be calculated later.\n * @private {?number}\n */\n this.startTime_ = startTime;\n\n /** @private {?function()} */\n this.onSeek_ = onSeek;\n\n /** @private {?function(!Event)} */\n this.onEvent_ = onEvent;\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {boolean} */\n this.buffering_ = false;\n\n /** @private {number} */\n this.playbackRate_ = 1;\n\n /** @private {?number} */\n this.trickPlayIntervalId_ = null;\n\n /** @private {?number} */\n this.gapJumpIntervalId_ = null;\n\n /** @private {number} */\n this.prevReadyState_ = video.readyState;\n\n /** @private {boolean} */\n this.didFireLargeGap_ = false;\n\n /**\n * The wall-clock time (in milliseconds) that the stall occurred. This is\n * used to ensure we don't flush the pipeline too often.\n * @private {number}\n */\n this.stallWallTime_ = -1;\n\n /**\n * The playhead time where we think a stall occurred. When the ready state\n * says we don't have enough data and the playhead stops too long, we assume\n * we have stalled.\n * @private {number}\n */\n this.stallPlayheadTime_ = -1;\n\n /** @private {boolean} */\n this.hadSegmentAppended_ = false;\n\n\n // Check if the video has already loaded some metadata.\n if (video.readyState > 0) {\n this.onLoadedMetadata_();\n } else {\n this.eventManager_.listenOnce(\n video, 'loadedmetadata', this.onLoadedMetadata_.bind(this));\n }\n\n var pollGap = this.onPollGapJump_.bind(this);\n this.eventManager_.listen(video, 'ratechange', this.onRateChange_.bind(this));\n this.eventManager_.listen(video, 'waiting', pollGap);\n\n // We can't trust readyState or 'waiting' events on all platforms. So poll\n // the current time and if we are in a gap, jump it.\n // See: https://goo.gl/sbSHp9 and https://goo.gl/cuAcYd\n this.gapJumpIntervalId_ = setInterval(pollGap, 250);\n};\n\n\n/** @override */\nshaka.media.Playhead.prototype.destroy = function() {\n var p = this.eventManager_.destroy();\n this.eventManager_ = null;\n\n if (this.trickPlayIntervalId_ != null) {\n window.clearInterval(this.trickPlayIntervalId_);\n this.trickPlayIntervalId_ = null;\n }\n\n if (this.gapJumpIntervalId_ != null) {\n window.clearInterval(this.gapJumpIntervalId_);\n this.gapJumpIntervalId_ = null;\n }\n\n this.video_ = null;\n this.manifest_ = null;\n this.config_ = null;\n this.onSeek_ = null;\n this.onEvent_ = null;\n\n return p;\n};\n\n\n/** @param {number} startTime */\nshaka.media.Playhead.prototype.setStartTime = function(startTime) {\n if (this.video_.readyState > 0)\n this.video_.currentTime = this.clampTime_(startTime);\n else\n this.startTime_ = startTime;\n};\n\n\n/**\n * Gets the playhead's current (logical) position.\n *\n * @return {number}\n */\nshaka.media.Playhead.prototype.getTime = function() {\n if (this.video_.readyState > 0) {\n // Although we restrict the video's currentTime elsewhere, clamp it here to\n // ensure any timing issues (e.g., the user agent seeks and calls this\n // function before we receive the 'seeking' event) don't cause us to return\n // a time outside the segment availability window.\n return this.clampTime_(this.video_.currentTime);\n }\n\n return this.getStartTime_();\n};\n\n\n/**\n * Gets the playhead's initial position in seconds.\n *\n * @return {number}\n * @private\n */\nshaka.media.Playhead.prototype.getStartTime_ = function() {\n if (this.startTime_) {\n return this.clampTime_(this.startTime_);\n }\n\n var startTime;\n var timeline = this.manifest_.presentationTimeline;\n if (timeline.getDuration() < Infinity) {\n // If the presentation is VOD, or if the presentation is live but has\n // finished broadcasting, then start from the beginning.\n startTime = timeline.getSegmentAvailabilityStart();\n } else {\n // Otherwise, start near the live-edge.\n startTime = timeline.getSeekRangeEnd();\n }\n return startTime;\n};\n\n\n/**\n * Stops the playhead for buffering, or resumes the playhead after buffering.\n *\n * @param {boolean} buffering True to stop the playhead; false to allow it to\n * continue.\n */\nshaka.media.Playhead.prototype.setBuffering = function(buffering) {\n if (buffering != this.buffering_) {\n this.buffering_ = buffering;\n this.setPlaybackRate(this.playbackRate_);\n }\n};\n\n\n/**\n * Gets the current effective playback rate. This may be negative even if the\n * browser does not directly support rewinding.\n * @return {number}\n */\nshaka.media.Playhead.prototype.getPlaybackRate = function() {\n return this.playbackRate_;\n};\n\n\n/**\n * Sets the playback rate.\n * @param {number} rate\n */\nshaka.media.Playhead.prototype.setPlaybackRate = function(rate) {\n if (this.trickPlayIntervalId_ != null) {\n window.clearInterval(this.trickPlayIntervalId_);\n this.trickPlayIntervalId_ = null;\n }\n\n this.playbackRate_ = rate;\n // All major browsers support playback rates above zero. Only need fake\n // trick play for negative rates.\n this.video_.playbackRate = (this.buffering_ || rate < 0) ? 0 : rate;\n\n if (!this.buffering_ && rate < 0) {\n // Defer creating the timer until we stop buffering. This function will be\n // called again from setBuffering().\n this.trickPlayIntervalId_ = window.setInterval(function() {\n this.video_.currentTime += rate / 4;\n }.bind(this), 250);\n }\n};\n\n\n/**\n * Called when a segment is appended by StreamingEngine, but not when a clear is\n * pending. This means StreamingEngine will continue buffering forward from\n * what is buffered. So we know about any gaps before the start.\n */\nshaka.media.Playhead.prototype.onSegmentAppended = function() {\n this.hadSegmentAppended_ = true;\n this.onPollGapJump_();\n};\n\n\n/**\n * Handles a 'ratechange' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onRateChange_ = function() {\n // NOTE: This will not allow explicitly setting the playback rate to 0 while\n // the playback rate is negative. Pause will still work.\n var expectedRate =\n this.buffering_ || this.playbackRate_ < 0 ? 0 : this.playbackRate_;\n if (this.video_.playbackRate != expectedRate) {\n shaka.log.debug('Video playback rate changed to', this.video_.playbackRate);\n this.setPlaybackRate(this.video_.playbackRate);\n }\n};\n\n\n/**\n * Handles a 'loadedmetadata' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onLoadedMetadata_ = function() {\n // Move the real playhead to the start time.\n var targetTime = this.getStartTime_();\n if (Math.abs(this.video_.currentTime - targetTime) < 0.001) {\n this.eventManager_.listen(\n this.video_, 'seeking', this.onSeeking_.bind(this));\n this.eventManager_.listen(\n this.video_, 'playing', this.onPlaying_.bind(this));\n } else {\n this.eventManager_.listenOnce(\n this.video_, 'seeking', this.onSeekingToStartTime_.bind(this));\n this.video_.currentTime = targetTime;\n }\n};\n\n\n/**\n * Handles the 'seeking' event from the initial jump to the start time (if\n * there is one).\n *\n * @private\n */\nshaka.media.Playhead.prototype.onSeekingToStartTime_ = function() {\n goog.asserts.assert(this.video_.readyState > 0,\n 'readyState should be greater than 0');\n this.eventManager_.listen(this.video_, 'seeking', this.onSeeking_.bind(this));\n this.eventManager_.listen(this.video_, 'playing', this.onPlaying_.bind(this));\n};\n\n\n/**\n * Called on a recurring timer to check for gaps in the media. This is also\n * called in a 'waiting' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onPollGapJump_ = function() {\n if (this.video_.readyState == 0)\n return;\n\n // When the ready state changes, we have moved on, so we should fire the large\n // gap event if we see one.\n if (this.video_.readyState != this.prevReadyState_) {\n this.didFireLargeGap_ = false;\n this.prevReadyState_ = this.video_.readyState;\n }\n\n var smallGapLimit = this.config_.smallGapLimit;\n var currentTime = this.video_.currentTime;\n var buffered = this.video_.buffered;\n\n var gapIndex = shaka.media.TimeRangesUtils.getGapIndex(buffered, currentTime);\n\n // The current time is unbuffered or is too far from a gap.\n if (gapIndex == null) {\n if (this.video_.readyState < 3 && this.video_.playbackRate > 0) {\n // Some platforms/browsers can get stuck in the middle of a buffered range\n // (e.g. when seeking in a background tab). Flush the media pipeline to\n // help.\n //\n // Flush once we have stopped for more than 1 second inside a buffered\n // range. Note that Chromecast takes a few seconds to start playing\n // after any kind of seek, so wait 5 seconds between repeated flushes.\n if (this.stallPlayheadTime_ != currentTime) {\n this.stallPlayheadTime_ = currentTime;\n this.stallWallTime_ = Date.now();\n } else if (this.stallWallTime_ < Date.now() - 1000) {\n // Make the stall appear in the future so we don't flush for 5 seconds.\n this.stallWallTime_ = Date.now() + 5000;\n\n for (var i = 0; i < buffered.length; i++) {\n // Ignore the end of the buffered range since it may not play anymore\n // on all platforms.\n if (currentTime >= buffered.start(i) &&\n currentTime < buffered.end(i) - 0.5) {\n shaka.log.debug(\n 'Flushing media pipeline due to stall inside buffered range');\n this.video_.currentTime = this.video_.currentTime;\n break;\n }\n }\n }\n }\n return;\n }\n // If we are before the first buffered range, this could be an unbuffered\n // seek. So wait until a segment is appended so we are sure it is a gap.\n if (gapIndex == 0 && !this.hadSegmentAppended_)\n return;\n\n // StreamingEngine can buffer past the seek end, but still don't allow seeking\n // past it.\n var jumpTo = buffered.start(gapIndex);\n var seekEnd = this.manifest_.presentationTimeline.getSeekRangeEnd();\n if (jumpTo >= seekEnd)\n return;\n\n var jumpSize = jumpTo - currentTime;\n var isGapSmall = jumpSize <= smallGapLimit;\n var jumpLargeGap = false;\n\n if (!isGapSmall && !this.didFireLargeGap_) {\n this.didFireLargeGap_ = true;\n\n // Event firing is synchronous.\n var event = new shaka.util.FakeEvent(\n 'largegap', {'currentTime': currentTime, 'gapSize': jumpSize});\n event.cancelable = true;\n this.onEvent_(event);\n\n if (this.config_.jumpLargeGaps && !event.defaultPrevented)\n jumpLargeGap = true;\n else\n shaka.log.info('Ignoring large gap at', currentTime);\n }\n\n if (isGapSmall || jumpLargeGap) {\n if (gapIndex == 0) {\n shaka.log.info(\n 'Jumping forward', jumpSize,\n 'seconds because of gap before start time of', jumpTo);\n } else {\n shaka.log.info(\n 'Jumping forward', jumpSize, 'seconds because of gap starting at',\n buffered.end(gapIndex - 1), 'and ending at', jumpTo);\n }\n\n this.movePlayhead_(currentTime, jumpTo);\n }\n};\n\n\n/**\n * Handles a 'seeking' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onSeeking_ = function() {\n goog.asserts.assert(this.video_.readyState > 0,\n 'readyState should be greater than 0');\n\n this.hadSegmentAppended_ = false;\n var currentTime = this.video_.currentTime;\n var targetTime = this.reposition_(currentTime);\n\n if (Math.abs(targetTime - currentTime) > 0.001) {\n this.movePlayhead_(currentTime, targetTime);\n return;\n }\n\n shaka.log.v1('Seek to ' + currentTime);\n this.didFireLargeGap_ = false;\n this.onSeek_();\n};\n\n\n/**\n * Handles a 'playing' event.\n *\n * @private\n */\nshaka.media.Playhead.prototype.onPlaying_ = function() {\n goog.asserts.assert(this.video_.readyState > 0,\n 'readyState should be greater than 0');\n\n var currentTime = this.video_.currentTime;\n var targetTime = this.reposition_(currentTime);\n\n if (Math.abs(targetTime - currentTime) > 0.001)\n this.movePlayhead_(currentTime, targetTime);\n};\n\n\n/**\n * Computes a new playhead position that's within the presentation timeline.\n *\n * @param {number} currentTime\n * @return {number} The time to reposition the playhead to.\n * @private\n */\nshaka.media.Playhead.prototype.reposition_ = function(currentTime) {\n goog.asserts.assert(this.manifest_ && this.config_, 'Must not be destroyed');\n\n /** @type {function(number)} */\n var isBuffered =\n shaka.media.TimeRangesUtils.isBuffered.bind(null, this.video_.buffered);\n\n var rebufferingGoal = shaka.util.StreamUtils.getRebufferingGoal(\n this.manifest_, this.config_, 1 /* scaleFactor */);\n\n var timeline = this.manifest_.presentationTimeline;\n var start = timeline.getSafeAvailabilityStart(0);\n var end = timeline.getSegmentAvailabilityEnd();\n\n // With live content, the beginning of the availability window is moving\n // forward. This means we cannot seek to it since we will \"fall\" outside the\n // window while we buffer. So we define a \"safe\" region that is far enough\n // away. For VOD, |safe == start|.\n var safe = timeline.getSafeAvailabilityStart(rebufferingGoal);\n\n // These are the times to seek to rather than the exact destinations. When\n // we seek, we will get another event (after a slight delay) and these steps\n // will run again. So if we seeked directly to |start|, |start| would move\n // on the next call and we would loop forever.\n //\n // Offset by 5 seconds since Chromecast takes a few seconds to start playing\n // after a seek, even when buffered.\n var seekStart = timeline.getSafeAvailabilityStart(5);\n var seekSafe = timeline.getSafeAvailabilityStart(rebufferingGoal + 5);\n\n\n if (currentTime > end) {\n shaka.log.v1('Playhead past end.');\n return end;\n }\n\n if (currentTime < start) {\n if (isBuffered(seekStart)) {\n shaka.log.v1('Playhead before start & start is buffered');\n return seekStart;\n } else {\n shaka.log.v1('Playhead before start & start is unbuffered');\n return seekSafe;\n }\n }\n\n if (currentTime >= safe || isBuffered(currentTime)) {\n shaka.log.v1('Playhead in safe region or in buffered region.');\n return currentTime;\n } else {\n shaka.log.v1('Playhead outside safe region & in unbuffered region.');\n return seekSafe;\n }\n};\n\n\n/**\n * Moves the playhead to the target time, triggering a call to onSeeking_().\n *\n * @param {number} currentTime\n * @param {number} targetTime\n * @private\n */\nshaka.media.Playhead.prototype.movePlayhead_ = function(\n currentTime, targetTime) {\n shaka.log.debug('Moving playhead...',\n 'currentTime=' + currentTime,\n 'targetTime=' + targetTime);\n this.video_.currentTime = targetTime;\n\n // Sometimes, IE and Edge ignore re-seeks. Check every 100ms and try\n // again if need be, up to 10 tries.\n // Delay stats over 100 runs of a re-seeking integration test:\n // IE - 0ms - 47%\n // IE - 100ms - 63%\n // Edge - 0ms - 2%\n // Edge - 100ms - 40%\n // Edge - 200ms - 32%\n // Edge - 300ms - 24%\n // Edge - 400ms - 2%\n // Chrome - 0ms - 100%\n // TODO: File a bug on IE/Edge about this.\n var tries = 0;\n var recheck = (function() {\n if (!this.video_) return;\n if (tries++ >= 10) return;\n\n if (this.video_.currentTime == currentTime) {\n // Sigh. Try again.\n this.video_.currentTime = targetTime;\n setTimeout(recheck, 100);\n }\n }).bind(this);\n setTimeout(recheck, 100);\n};\n\n\n/**\n * Clamps the given time to the segment availability window.\n *\n * @param {number} time The time in seconds.\n * @return {number} The clamped time in seconds.\n * @private\n */\nshaka.media.Playhead.prototype.clampTime_ = function(time) {\n var start = this.manifest_.presentationTimeline.getSegmentAvailabilityStart();\n if (time < start) return start;\n\n var end = this.manifest_.presentationTimeline.getSegmentAvailabilityEnd();\n if (time > end) return end;\n\n return time;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/playhead.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.PlayheadObserver');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.media.TimeRangesUtils');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * This observes the current playhead position to raise events. This will only\n * observe the playhead, {@link shaka.media.Playhead} will modify it. This will:\n * <ul>\n * <li>Track buffering state and call |onBuffering|.</li>\n * <li>Track current Period and call |onChangePeriod|.</li>\n * <li>Track timeline regions and raise respective events.</li>\n * </ul>\n *\n * @param {HTMLMediaElement} video\n * @param {shakaExtern.Manifest} manifest\n * @param {shakaExtern.StreamingConfiguration} config\n * @param {function(boolean)} onBuffering Called and passed true when stopped\n * for buffering; called and passed false when proceeding after buffering.\n * If passed true, the callback should not set the video's playback rate.\n * @param {function(!Event)} onEvent Called when an event is raised to be sent\n * to the application.\n * @param {function()} onChangePeriod Called when the playhead moves to a\n * different Period.\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.PlayheadObserver = function(\n video, manifest, config, onBuffering, onEvent, onChangePeriod) {\n /** @private {HTMLMediaElement} */\n this.video_ = video;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = manifest;\n\n /** @private {?shakaExtern.StreamingConfiguration} */\n this.config_ = config;\n\n /** @private {?function(boolean)} */\n this.onBuffering_ = onBuffering;\n\n /** @private {?function(!Event)} */\n this.onEvent_ = onEvent;\n\n /** @private {?function()} */\n this.onChangePeriod_ = onChangePeriod;\n\n /** @private {!Array.<shaka.media.PlayheadObserver.TimelineRegion>} */\n this.timelineRegions_ = [];\n\n /** @private {shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @private {boolean} */\n this.buffering_ = false;\n\n /** @private {number} */\n this.curPeriodIndex_ = -1;\n\n /** @private {?number} */\n this.watchdogTimer_ = null;\n\n\n this.startWatchdogTimer_();\n};\n\n\n/**\n * The threshold for underflow, in seconds. If there is less than this amount\n * of data buffered, we will consider the player to be out of data.\n *\n * @private {number}\n * @const\n */\nshaka.media.PlayheadObserver.UNDERFLOW_THRESHOLD_ = 0.5;\n\n\n/**\n * A fudge factor used when comparing buffered ranges to the duration to\n * determine if we have buffered all available content.\n *\n * @private {number}\n * @const\n */\nshaka.media.PlayheadObserver.FUDGE_FACTOR_ = 0.1;\n\n\n/**\n * @enum {number}\n * @private\n */\nshaka.media.PlayheadObserver.RegionLocation_ = {\n FUTURE_REGION: 1,\n INSIDE: 2,\n PAST_REGION: 3\n};\n\n\n/**\n * @typedef {{\n * info: shakaExtern.TimelineRegionInfo,\n * status: shaka.media.PlayheadObserver.RegionLocation_\n * }}\n *\n * @property {shakaExtern.TimelineRegionInfo} info\n * The info for this timeline region.\n * @property {shaka.media.PlayheadObserver.RegionLocation_} status\n * This tracks where the region is relative to the playhead. This tracks\n * whether we are before or after the region so we can raise events if we pass\n * it.\n */\nshaka.media.PlayheadObserver.TimelineRegion;\n\n\n/** @override */\nshaka.media.PlayheadObserver.prototype.destroy = function() {\n var p = this.eventManager_ ? this.eventManager_.destroy() : Promise.resolve();\n\n this.eventManager_ = null;\n this.cancelWatchdogTimer_();\n\n this.video_ = null;\n this.manifest_ = null;\n this.config_ = null;\n this.onBuffering_ = null;\n this.onEvent_ = null;\n this.onChangePeriod_ = null;\n this.timelineRegions_ = [];\n\n return p;\n};\n\n\n/** Called when a seek completes. */\nshaka.media.PlayheadObserver.prototype.seeked = function() {\n this.timelineRegions_.forEach(\n this.updateTimelineRegion_.bind(this, /* isSeek */ true));\n};\n\n\n/**\n * Adds a new timeline region. Events will be raised whenever the playhead\n * enters or exits the given region. This method will raise a\n * 'timelineregionadded' event.\n * @param {shakaExtern.TimelineRegionInfo} regionInfo\n */\nshaka.media.PlayheadObserver.prototype.addTimelineRegion = function(\n regionInfo) {\n // Check there isn't an existing event with the same scheme ID and time range.\n // This ensures that the manifest parser doesn't need to also track which\n // events have already been added.\n var hasExistingRegion = this.timelineRegions_.some(function(existing) {\n return existing.info.schemeIdUri == regionInfo.schemeIdUri &&\n existing.info.startTime == regionInfo.startTime &&\n existing.info.endTime == regionInfo.endTime;\n });\n if (hasExistingRegion) return;\n\n var region = {\n info: regionInfo,\n status: shaka.media.PlayheadObserver.RegionLocation_.FUTURE_REGION\n };\n this.timelineRegions_.push(region);\n\n var cloneTimelineInfo_ = shaka.media.PlayheadObserver.cloneTimelineInfo_;\n var event = new shaka.util.FakeEvent(\n 'timelineregionadded', {detail: cloneTimelineInfo_(regionInfo)});\n this.onEvent_(event);\n\n // Pretend this is a seek so it will ignore if it should be PAST_REGION but\n // still fire an event if it should be INSIDE.\n this.updateTimelineRegion_(/* isSeek */ true, region);\n};\n\n\n/**\n * Clones the given TimelineRegionInfo so the app can modify it without\n * modifying our internal objects.\n * @param {shakaExtern.TimelineRegionInfo} source\n * @return {shakaExtern.TimelineRegionInfo}\n * @private\n */\nshaka.media.PlayheadObserver.cloneTimelineInfo_ = function(source) {\n var copy = shaka.util.ConfigUtils.cloneObject(source);\n // cloneObject uses JSON to clone, which won't copy the DOM element.\n copy.eventElement = source.eventElement;\n return copy;\n};\n\n\n/**\n * Updates the status of a timeline region and fires any enter/exit events.\n * @param {boolean} isSeek\n * @param {shaka.media.PlayheadObserver.TimelineRegion} region\n * @private\n */\nshaka.media.PlayheadObserver.prototype.updateTimelineRegion_ = function(\n isSeek, region) {\n var RegionLocation = shaka.media.PlayheadObserver.RegionLocation_;\n var cloneTimelineInfo_ = shaka.media.PlayheadObserver.cloneTimelineInfo_;\n\n // The events are fired when the playhead enters a region. We fire both\n // events when passing over a region and not seeking since the playhead was\n // in the region but left before we saw it. We don't fire both when seeking\n // since the playhead was never in the region.\n //\n // |--------------------------------------|\n // | From \\ To | FUTURE | INSIDE | PAST |\n // | FUTURE | | enter | both* |\n // | INSIDE | exit | | exit |\n // | PAST | both* | enter | |\n // |--------------------------------------|\n // * Only when not seeking.\n var newStatus = region.info.startTime > this.video_.currentTime ?\n RegionLocation.FUTURE_REGION :\n (region.info.endTime < this.video_.currentTime ?\n RegionLocation.PAST_REGION :\n RegionLocation.INSIDE);\n var wasInside = region.status == RegionLocation.INSIDE;\n var isInside = newStatus == RegionLocation.INSIDE;\n\n if (newStatus != region.status) {\n var passedRegion = !wasInside && !isInside;\n if (!(isSeek && passedRegion)) {\n if (!wasInside) {\n this.onEvent_(new shaka.util.FakeEvent(\n 'timelineregionenter',\n {'detail': cloneTimelineInfo_(region.info)}));\n }\n if (!isInside) {\n this.onEvent_(new shaka.util.FakeEvent(\n 'timelineregionexit', {'detail': cloneTimelineInfo_(region.info)}));\n }\n }\n region.status = newStatus;\n }\n};\n\n\n/**\n * Starts the watchdog timer.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.startWatchdogTimer_ = function() {\n this.cancelWatchdogTimer_();\n this.watchdogTimer_ =\n window.setTimeout(this.onWatchdogTimer_.bind(this), 250);\n};\n\n\n/**\n * Cancels the watchdog timer, if any.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.cancelWatchdogTimer_ = function() {\n if (this.watchdogTimer_) {\n window.clearTimeout(this.watchdogTimer_);\n this.watchdogTimer_ = null;\n }\n};\n\n\n/**\n * Called on a recurring timer to detect buffering events and Period changes.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.onWatchdogTimer_ = function() {\n this.watchdogTimer_ = null;\n this.startWatchdogTimer_();\n\n goog.asserts.assert(this.manifest_ && this.config_, 'Must not be destroyed');\n var newPeriod = shaka.util.StreamUtils.findPeriodContainingTime(\n this.manifest_, this.video_.currentTime);\n if (newPeriod != this.curPeriodIndex_) {\n // Ignore seek to start time, the first 'trackschanged' event is handled\n // during player.load().\n if (this.curPeriodIndex_ != -1)\n this.onChangePeriod_();\n this.curPeriodIndex_ = newPeriod;\n }\n\n // This uses an intersection of buffered ranges for both audio and video, so\n // it's an accurate way to determine if we are buffering or not.\n var bufferedAhead = shaka.media.TimeRangesUtils.bufferedAheadOf(\n this.video_.buffered, this.video_.currentTime);\n var bufferEnd = shaka.media.TimeRangesUtils.bufferEnd(this.video_.buffered);\n\n var fudgeFactor = shaka.media.PlayheadObserver.FUDGE_FACTOR_;\n var threshold = shaka.media.PlayheadObserver.UNDERFLOW_THRESHOLD_;\n\n var timeline = this.manifest_.presentationTimeline;\n var duration = timeline.getSegmentAvailabilityEnd() - fudgeFactor;\n\n var atEnd = (bufferEnd >= duration) || (this.video_.ended);\n if (!this.buffering_) {\n // If there are no buffered ranges but the playhead is at the end of\n // the video then we shouldn't enter a buffering state.\n if (!atEnd && bufferedAhead < threshold) {\n this.setBuffering_(true);\n }\n } else {\n var rebufferingGoal = shaka.util.StreamUtils.getRebufferingGoal(\n this.manifest_, this.config_, 1 /* scaleFactor */);\n if (atEnd || bufferedAhead >= rebufferingGoal) {\n this.setBuffering_(false);\n }\n }\n\n this.timelineRegions_.forEach(\n this.updateTimelineRegion_.bind(this, /* isSeek */ false));\n};\n\n\n/**\n * Stops the playhead for buffering, or resumes the playhead after buffering.\n *\n * @param {boolean} buffering True to stop the playhead; false to allow it to\n * continue.\n * @private\n */\nshaka.media.PlayheadObserver.prototype.setBuffering_ = function(buffering) {\n if (buffering != this.buffering_) {\n this.buffering_ = buffering;\n this.onBuffering_(buffering);\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/playhead_observer.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.media.StreamingEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.MediaSourceEngine');\ngoog.require('shaka.media.Playhead');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.MapUtils');\ngoog.require('shaka.util.Mp4Parser');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * Creates a StreamingEngine.\n *\n * The StreamingEngine is responsible for setting up the Manifest's Streams\n * (i.e., for calling each Stream's createSegmentIndex() function), for\n * downloading segments, for co-ordinating audio, video, and text buffering,\n * and for handling Period transitions. The StreamingEngine provides an\n * interface to switch between Streams, but it does not choose which Streams to\n * switch to.\n *\n * The StreamingEngine notifies its owner when it needs to buffer a new Period,\n * so its owner can choose which Streams within that Period to initially\n * buffer. Moreover, the StreamingEngine also notifies its owner when any\n * Stream within the current Period may be switched to, so its owner can switch\n * bitrates, resolutions, or languages.\n *\n * The StreamingEngine does not need to be notified about changes to the\n * Manifest's SegmentIndexes; however, it does need to be notified when new\n * Periods are added to the Manifest, so it can set up that Period's Streams.\n *\n * To start the StreamingEngine the owner must first call configure() followed\n * by init(). The StreamingEngine will then call onChooseStreams(p) when it\n * needs to buffer Period p; it will then switch to the Streams returned from\n * that function. The StreamingEngine will call onCanSwitch() when any\n * Stream within the current Period may be switched to.\n *\n * The owner must call seeked() each time the playhead moves to a new location\n * within the presentation timeline; however, the owner may forego calling\n * seeked() when the playhead moves outside the presentation timeline.\n *\n * @param {shakaExtern.Manifest} manifest\n * @param {shaka.media.StreamingEngine.PlayerInterface} playerInterface\n *\n * @constructor\n * @struct\n * @implements {shaka.util.IDestroyable}\n */\nshaka.media.StreamingEngine = function(manifest, playerInterface) {\n /** @private {?shaka.media.StreamingEngine.PlayerInterface} */\n this.playerInterface_ = playerInterface;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = manifest;\n\n /** @private {?shakaExtern.StreamingConfiguration} */\n this.config_ = null;\n\n /** @private {number} */\n this.bufferingGoalScale_ = 1;\n\n /** @private {Promise} */\n this.setupPeriodPromise_ = Promise.resolve();\n\n /**\n * Maps a Period's index to an object that indicates that either\n * 1. the Period has not been set up (undefined)\n * 2. the Period is being set up ([a PublicPromise, false]),\n * 3. the Period is set up (i.e., all Streams within the Period are set up)\n * and can be switched to ([a PublicPromise, true]).\n *\n * @private {Array.<?{promise: shaka.util.PublicPromise, resolved: boolean}>}\n */\n this.canSwitchPeriod_ = [];\n\n /**\n * Maps a Stream's ID to an object that indicates that either\n * 1. the Stream has not been set up (undefined)\n * 2. the Stream is being set up ([a Promise instance, false]),\n * 3. the Stream is set up and can be switched to\n * ([a Promise instance, true]).\n *\n * @private {Object.<number,\n * ?{promise: shaka.util.PublicPromise, resolved: boolean}>}\n */\n this.canSwitchStream_ = {};\n\n /**\n * Maps a content type, e.g., 'audio', 'video', or 'text', to a MediaState.\n *\n * @private {Object.<shaka.util.ManifestParserUtils.ContentType,\n !shaka.media.StreamingEngine.MediaState_>}\n */\n this.mediaStates_ = {};\n\n /**\n * Set to true once one segment of each content type has been buffered.\n *\n * @private {boolean}\n */\n this.startupComplete_ = false;\n\n /**\n * Set to true on fatal error. Interrupts fetchAndAppend_().\n *\n * @private {boolean}\n */\n this.fatalError_ = false;\n\n /** @private {boolean} */\n this.destroyed_ = false;\n};\n\n\n/**\n * @typedef {{\n * playhead: !shaka.media.Playhead,\n * mediaSourceEngine: !shaka.media.MediaSourceEngine,\n * netEngine: shaka.net.NetworkingEngine,\n * onChooseStreams: function(!shakaExtern.Period):\n * !Object.<shaka.util.ManifestParserUtils.ContentType,\n * shakaExtern.Stream>,\n * onCanSwitch: function(),\n * onError: function(!shaka.util.Error),\n * onEvent: function(!Event),\n * onManifestUpdate: function(),\n * onSegmentAppended: function(),\n * onInitialStreamsSetup: (function()|undefined),\n * onStartupComplete: (function()|undefined)}\n * }}\n *\n * @property {!shaka.media.Playhead} playhead\n * The Playhead. The caller retains ownership.\n * @property {!shaka.media.MediaSourceEngine} mediaSourceEngine\n * The MediaSourceEngine. The caller retains ownership.\n * @property {shaka.net.NetworkingEngine} netEngine\n * The NetworkingEngine instance to use. The caller retains ownership.\n * @property {function(!shakaExtern.Period):\n * !Object.<shaka.util.ManifestParserUtils.ContentType,\n * shakaExtern.Stream>} onChooseStreams\n * Called when the given Period needs to be buffered. The\n * StreamingEngine will switch to the Streams returned from this function.\n * The caller cannot call switch() directly until the StreamingEngine calls\n * onCanSwitch()\n * @property {function()} onCanSwitch\n * Called when any Stream within the current Period may be switched to.\n * @property {function(!shaka.util.Error)} onError\n * Called when an error occurs. If the error is recoverable (see\n * @link{shaka.util.Error}) then the caller may invoke either\n * StreamingEngine.switch() or StreamingEngine.seeked() to attempt recovery.\n * @property {function(!Event)} onEvent\n * Called when an event occurs that should be sent to the app.\n * @property {function()} onManifestUpdate\n * Called when an embedded 'emsg' box should trigger a manifest update.\n * @property {function()} onSegmentAppended\n * Called after a segment is successfully appended to a MediaSource.\n * @property {(function()|undefined)} onInitialStreamsSetup\n * Optional callback which is called when the initial set of Streams have been\n * setup. Intended to be used by tests.\n * @property {(function()|undefined)} onStartupComplete\n * Optional callback which is called when startup has completed. Intended to\n * be used by tests.\n */\nshaka.media.StreamingEngine.PlayerInterface;\n\n\n/**\n * @typedef {{\n * type: shaka.util.ManifestParserUtils.ContentType,\n * stream: shakaExtern.Stream,\n * lastStream: ?shakaExtern.Stream,\n * lastSegmentReference: shaka.media.SegmentReference,\n * restoreStreamAfterTrickPlay: ?shakaExtern.Stream,\n * needInitSegment: boolean,\n * needPeriodIndex: number,\n * endOfStream: boolean,\n * performingUpdate: boolean,\n * updateTimer: ?number,\n * waitingToClearBuffer: boolean,\n * waitingToFlushBuffer: boolean,\n * clearingBuffer: boolean,\n * recovering: boolean,\n * hasError: boolean,\n * resumeAt: number\n * }}\n *\n * @description\n * Contains the state of a logical stream, i.e., a sequence of segmented data\n * for a particular content type. At any given time there is a Stream object\n * associated with the state of the logical stream.\n *\n * @property {shaka.util.ManifestParserUtils.ContentType} type\n * The stream's content type, e.g., 'audio', 'video', or 'text'.\n * @property {shakaExtern.Stream} stream\n * The current Stream.\n * @property {?shakaExtern.Stream} lastStream\n * The Stream of the last segment that was appended.\n * @property {shaka.media.SegmentReference} lastSegmentReference\n * The SegmentReference of the last segment that was appended.\n * @property {?shakaExtern.Stream} restoreStreamAfterTrickPlay\n * The Stream to restore after trick play mode is turned off.\n * @property {boolean} needInitSegment\n * True indicates that |stream|'s init segment must be inserted before the\n * next media segment is appended.\n * @property {boolean} endOfStream\n * True indicates that the end of the buffer has hit the end of the\n * presentation.\n * @property {number} needPeriodIndex\n * The index of the Period which needs to be buffered.\n * @property {boolean} performingUpdate\n * True indicates that an update is in progress.\n * @property {?number} updateTimer\n * A non-null value indicates that an update is scheduled.\n * @property {boolean} waitingToClearBuffer\n * True indicates that the buffer must be cleared after the current update\n * finishes.\n * @property {boolean} waitingToFlushBuffer\n * True indicates that the buffer must be flushed after it is cleared.\n * @property {boolean} clearingBuffer\n * True indicates that the buffer is being cleared.\n * @property {boolean} recovering\n * True indicates that the last segment was not appended because it could not\n * fit in the buffer.\n * @property {boolean} hasError\n * True indicates that the stream has encountered an error and has stopped\n * updates.\n * @property {number} resumeAt\n * An override for the time to start performing updates at. If the playhead\n * is behind this time, update_() will still start fetching segments from\n * this time. If the playhead is ahead of the time, this field is ignored.\n */\nshaka.media.StreamingEngine.MediaState_;\n\n\n/**\n * The minimum number seconds that will remain buffered after evicting media.\n *\n * @const {number}\n */\nshaka.media.StreamingEngine.prototype.MIN_BUFFER_LENGTH = 2;\n\n\n/** @override */\nshaka.media.StreamingEngine.prototype.destroy = function() {\n for (var type in this.mediaStates_) {\n this.cancelUpdate_(this.mediaStates_[type]);\n }\n\n this.playerInterface_ = null;\n this.manifest_ = null;\n this.setupPeriodPromise_ = null;\n this.canSwitchPeriod_ = null;\n this.canSwitchStream_ = null;\n this.mediaStates_ = null;\n this.config_ = null;\n\n this.destroyed_ = true;\n\n return Promise.resolve();\n};\n\n\n/**\n * Called by the Player to provide an updated configuration any time it changes.\n * Will be called at least once before init().\n *\n * @param {shakaExtern.StreamingConfiguration} config\n */\nshaka.media.StreamingEngine.prototype.configure = function(config) {\n this.config_ = config;\n};\n\n\n/**\n * Initializes the StreamingEngine.\n *\n * After this function is called the StreamingEngine will call\n * onChooseStreams(p) when it needs to buffer Period p and onCanSwitch() when\n * any Stream within that Period may be switched to.\n *\n * After the StreamingEngine calls onChooseStreams(p) for the first time, it\n * will begin setting up the Streams returned from that function and\n * subsequently switch to them. However, the StreamingEngine will not begin\n * setting up any other Streams until at least one segment from each of the\n * initial set of Streams has been buffered (this reduces startup latency).\n * After the StreamingEngine completes this startup phase it will begin setting\n * up each Period's Streams (while buffering in parrallel).\n *\n * When the StreamingEngine needs to buffer the next Period it will have\n * already set up that Period's Streams. So, when the StreamingEngine calls\n * onChooseStreams(p) after the first time, the StreamingEngine will\n * immediately switch to the Streams returned from that function.\n *\n * @return {!Promise}\n */\nshaka.media.StreamingEngine.prototype.init = function() {\n var MapUtils = shaka.util.MapUtils;\n goog.asserts.assert(this.config_,\n 'StreamingEngine configure() must be called before init()!');\n\n // Determine which Period we must buffer.\n var playheadTime = this.playerInterface_.playhead.getTime();\n var needPeriodIndex = this.findPeriodContainingTime_(playheadTime);\n\n // Get the initial set of Streams.\n var streamsByType = this.playerInterface_.onChooseStreams(\n this.manifest_.periods[needPeriodIndex]);\n if (MapUtils.empty(streamsByType)) {\n shaka.log.error('init: no Streams chosen');\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STREAMING,\n shaka.util.Error.Code.INVALID_STREAMS_CHOSEN));\n }\n\n // Setup the initial set of Streams and then begin each update cycle. After\n // startup completes onUpdate_() will set up the remaining Periods.\n return this.initStreams_(streamsByType).then(function() {\n shaka.log.debug('init: completed initial Stream setup');\n\n // Subtlety: onInitialStreamsSetup() may call switch() or seeked(), so we\n // must schedule an update beforehand so |updateTimer| is set.\n if (this.playerInterface_ && this.playerInterface_.onInitialStreamsSetup) {\n shaka.log.v1('init: calling onInitialStreamsSetup()...');\n this.playerInterface_.onInitialStreamsSetup();\n }\n }.bind(this));\n};\n\n\n/**\n * Gets the current Period the stream is in. This Period may not be initialized\n * yet if canSwitch(period) has not been called yet.\n * @return {shakaExtern.Period}\n */\nshaka.media.StreamingEngine.prototype.getCurrentPeriod = function() {\n var playheadTime = this.playerInterface_.playhead.getTime();\n var needPeriodIndex = this.findPeriodContainingTime_(playheadTime);\n return this.manifest_.periods[needPeriodIndex];\n};\n\n\n/**\n * Gets the Period in which we are currently buffering. This may be different\n * from the Period which contains the Playhead.\n * @return {?shakaExtern.Period}\n */\nshaka.media.StreamingEngine.prototype.getActivePeriod = function() {\n goog.asserts.assert(this.mediaStates_, 'Must be initialized');\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var anyMediaState = this.mediaStates_[ContentType.VIDEO] ||\n this.mediaStates_[ContentType.AUDIO];\n return anyMediaState ?\n this.manifest_.periods[anyMediaState.needPeriodIndex] : null;\n};\n\n\n/**\n * Gets a map of all the active streams.\n * @return {!Object.<shaka.util.ManifestParserUtils.ContentType,\n * shakaExtern.Stream>}\n */\nshaka.media.StreamingEngine.prototype.getActiveStreams = function() {\n goog.asserts.assert(this.mediaStates_, 'Must be initialized');\n var MapUtils = shaka.util.MapUtils;\n return MapUtils.map(\n this.mediaStates_, function(state) {\n // Don't tell the caller about trick play streams. If we're in trick\n // play, return the stream we will go back to after we exit trick play.\n return state.restoreStreamAfterTrickPlay || state.stream;\n });\n};\n\n\n/**\n * Notifies StreamingEngine that a new text stream was added to the manifest.\n * This initializes the given stream. This returns a Promise that resolves when\n * the stream has been set up.\n *\n * @param {shakaExtern.Stream} stream\n * @return {!Promise}\n */\nshaka.media.StreamingEngine.prototype.notifyNewTextStream = function(stream) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n // Create empty object first and initialize the fields through\n // [] to allow field names to be expressions.\n /** @type {!Object.<string, shakaExtern.Stream>} */\n var streamsByType = {};\n streamsByType[ContentType.TEXT] = stream;\n return this.initStreams_(streamsByType);\n};\n\n\n/**\n * Set trick play on or off.\n * If trick play is on, related trick play streams will be used when possible.\n * @param {boolean} on\n */\nshaka.media.StreamingEngine.prototype.setTrickPlay = function(on) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var mediaState = this.mediaStates_[ContentType.VIDEO];\n if (!mediaState) return;\n\n var stream = mediaState.stream;\n if (!stream) return;\n\n shaka.log.debug('setTrickPlay', on);\n if (on) {\n var trickModeVideo = stream.trickModeVideo;\n if (!trickModeVideo) return; // Can't engage trick play.\n\n var normalVideo = mediaState.restoreStreamAfterTrickPlay;\n if (normalVideo) return; // Already in trick play.\n\n shaka.log.debug('Engaging trick mode stream', trickModeVideo);\n this.switch(ContentType.VIDEO, trickModeVideo, false);\n mediaState.restoreStreamAfterTrickPlay = stream;\n } else {\n var normalVideo = mediaState.restoreStreamAfterTrickPlay;\n if (!normalVideo) return;\n\n shaka.log.debug('Restoring non-trick-mode stream', normalVideo);\n mediaState.restoreStreamAfterTrickPlay = null;\n this.switch(ContentType.VIDEO, normalVideo, true);\n }\n};\n\n\n/**\n * Switches to the given Stream. |stream| may be from any Variant or any\n * Period.\n *\n * @param {shaka.util.ManifestParserUtils.ContentType} contentType\n * |stream|'s content type.\n * @param {shakaExtern.Stream} stream\n * @param {boolean} clearBuffer\n */\nshaka.media.StreamingEngine.prototype.switch = function(\n contentType, stream, clearBuffer) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var mediaState = this.mediaStates_[contentType];\n if (!mediaState && contentType == ContentType.TEXT &&\n this.config_.ignoreTextStreamFailures) {\n this.notifyNewTextStream(stream);\n return;\n }\n goog.asserts.assert(mediaState, 'switch: expected mediaState to exist');\n if (!mediaState) return;\n\n // If we are selecting a stream from a different Period, then we need to\n // handle a Period transition. Simply ignore the given stream, assuming that\n // Player will select the same track in onChooseStreams.\n var periodIndex = this.findPeriodContainingStream_(stream);\n if (clearBuffer && periodIndex != mediaState.needPeriodIndex) {\n shaka.log.debug('switch: switching to stream in another Period; clearing ' +\n 'buffer and changing Periods');\n // handlePeriodTransition_ will be called on the next update because the\n // current Period won't match the playhead Period.\n this.clearAllBuffers_();\n return;\n }\n\n if (mediaState.restoreStreamAfterTrickPlay) {\n shaka.log.debug('switch during trick play mode', stream);\n\n // Already in trick play mode, so stick with trick mode tracks if possible.\n if (stream.trickModeVideo) {\n // Use the trick mode stream, but revert to the new selection later.\n mediaState.restoreStreamAfterTrickPlay = stream;\n stream = stream.trickModeVideo;\n shaka.log.debug('switch found trick play stream', stream);\n } else {\n // No special trick mode video for this stream!\n mediaState.restoreStreamAfterTrickPlay = null;\n shaka.log.debug('switch found no special trick play stream');\n }\n }\n\n if (contentType == ContentType.TEXT) {\n // Mime types are allowed to change for text streams.\n // Reinitialize the text parser.\n var fullMimeType = shaka.util.StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n this.playerInterface_.mediaSourceEngine.reinitText(fullMimeType);\n }\n\n // Ensure the Period is ready.\n var canSwitchRecord = this.canSwitchPeriod_[periodIndex];\n goog.asserts.assert(\n canSwitchRecord && canSwitchRecord.resolved,\n 'switch: expected Period ' + periodIndex + ' to be ready');\n if (!canSwitchRecord || !canSwitchRecord.resolved) return;\n\n // Sanity check. If the Period is ready then the Stream should be ready too.\n canSwitchRecord = this.canSwitchStream_[stream.id];\n goog.asserts.assert(canSwitchRecord && canSwitchRecord.resolved,\n 'switch: expected Stream ' + stream.id + ' to be ready');\n if (!canSwitchRecord || !canSwitchRecord.resolved) return;\n\n if (mediaState.stream == stream) {\n var streamTag = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.debug('switch: Stream ' + streamTag + ' already active');\n return;\n }\n\n mediaState.stream = stream;\n mediaState.needInitSegment = true;\n\n var streamTag = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.debug('switch: switching to Stream ' + streamTag);\n\n if (clearBuffer) {\n if (mediaState.clearingBuffer) {\n // We are already going to clear the buffer, but make sure it is also\n // flushed.\n mediaState.waitingToFlushBuffer = true;\n } else if (mediaState.performingUpdate) {\n // We are performing an update, so we have to wait until it's finished.\n // onUpdate_() will call clearBuffer_() when the update has\n // finished.\n mediaState.waitingToClearBuffer = true;\n mediaState.waitingToFlushBuffer = true;\n } else {\n // Cancel the update timer, if any.\n this.cancelUpdate_(mediaState);\n // Clear right away.\n this.clearBuffer_(mediaState, /* flush */ true);\n }\n }\n};\n\n\n/**\n * Notifies the StreamingEngine that the playhead has moved to a valid time\n * within the presentation timeline.\n */\nshaka.media.StreamingEngine.prototype.seeked = function() {\n goog.asserts.assert(this.mediaStates_, 'Must not be destroyed');\n\n var playheadTime = this.playerInterface_.playhead.getTime();\n var isAllBuffered = Object.keys(this.mediaStates_).every(function(type) {\n return this.playerInterface_.mediaSourceEngine.isBuffered(\n type, playheadTime);\n }.bind(this));\n\n // Only treat as a buffered seek if every media state has a buffer. For\n // example, if we have buffered text but not video, we should still clear\n // every buffer so all media states need the same Period.\n if (isAllBuffered) {\n shaka.log.debug(\n '(all): seeked: buffered seek: playheadTime=' + playheadTime);\n return;\n }\n\n // This was an unbuffered seek (for at least one stream), clear all buffers.\n // Don't clear only some of the buffers because we can become stalled since\n // the media states are waiting for different Periods.\n shaka.log.debug('(all): seeked: unbuffered seek: clearing all buffers');\n this.clearAllBuffers_();\n};\n\n\n/**\n * Clears the buffer for every stream. Unlike clearBuffer_, this will handle\n * cases where a MediaState is performing an update. After this runs, every\n * MediaState will have a pending update.\n * @private\n */\nshaka.media.StreamingEngine.prototype.clearAllBuffers_ = function() {\n for (var type in this.mediaStates_) {\n var mediaState = this.mediaStates_[type];\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n if (mediaState.clearingBuffer) {\n // We're already clearing the buffer, so we don't need to clear the\n // buffer again.\n shaka.log.debug(logPrefix, 'clear: already clearing the buffer');\n continue;\n }\n\n if (mediaState.waitingToClearBuffer) {\n // May not be performing an update, but an update will still happen.\n // See: https://github.com/google/shaka-player/issues/334\n shaka.log.debug(logPrefix, 'clear: already waiting');\n continue;\n }\n\n if (mediaState.performingUpdate) {\n // We are performing an update, so we have to wait until it's finished.\n // onUpdate_() will call clearBuffer_() when the update has\n // finished.\n shaka.log.debug(logPrefix, 'clear: currently updating');\n mediaState.waitingToClearBuffer = true;\n continue;\n }\n\n if (this.playerInterface_.mediaSourceEngine.bufferStart(type) == null) {\n // Nothing buffered.\n shaka.log.debug(logPrefix, 'clear: nothing buffered');\n if (mediaState.updateTimer == null) {\n // Note: an update cycle stops when we buffer to the end of the\n // presentation or Period, or when we raise an error.\n this.scheduleUpdate_(mediaState, 0);\n }\n continue;\n }\n\n // An update may be scheduled, but we can just cancel it and clear the\n // buffer right away. Note: clearBuffer_() will schedule the next update.\n shaka.log.debug(logPrefix, 'clear: handling right now');\n this.cancelUpdate_(mediaState);\n this.clearBuffer_(mediaState, /* flush */ false);\n }\n};\n\n\n/**\n * Initializes the given streams and media states if required. This will\n * schedule updates for the given types.\n *\n * @param {!Object.<shaka.util.ManifestParserUtils.ContentType,\n shakaExtern.Stream>} streamsByType\n * @param {number=} opt_resumeAt\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.initStreams_ = function(\n streamsByType, opt_resumeAt) {\n var MapUtils = shaka.util.MapUtils;\n goog.asserts.assert(this.config_,\n 'StreamingEngine configure() must be called before init()!');\n\n // Determine which Period we must buffer.\n var playheadTime = this.playerInterface_.playhead.getTime();\n var needPeriodIndex = this.findPeriodContainingTime_(playheadTime);\n\n // Init MediaSourceEngine.\n var typeConfig = MapUtils.map(streamsByType, function(stream) {\n return shaka.util.StreamUtils.getFullMimeType(\n stream.mimeType, stream.codecs);\n });\n\n this.playerInterface_.mediaSourceEngine.init(typeConfig);\n this.setDuration_();\n\n // Setup the initial set of Streams and then begin each update cycle. After\n // startup completes onUpdate_() will set up the remaining Periods.\n var streams = MapUtils.values(streamsByType);\n return this.setupStreams_(streams).then(function() {\n if (this.destroyed_) return;\n\n for (var type in streamsByType) {\n var stream = streamsByType[type];\n if (!this.mediaStates_[type]) {\n this.mediaStates_[type] = {\n stream: stream,\n type: type,\n lastStream: null,\n lastSegmentReference: null,\n restoreStreamAfterTrickPlay: null,\n needInitSegment: true,\n needPeriodIndex: needPeriodIndex,\n endOfStream: false,\n performingUpdate: false,\n updateTimer: null,\n waitingToClearBuffer: false,\n waitingToFlushBuffer: false,\n clearingBuffer: false,\n recovering: false,\n hasError: false,\n resumeAt: opt_resumeAt || 0\n };\n this.scheduleUpdate_(this.mediaStates_[type], 0);\n }\n }\n }.bind(this));\n};\n\n\n/**\n * Sets up the given Period if necessary. Calls onError() if an error\n * occurs.\n *\n * @param {number} periodIndex The Period's index.\n * @return {!Promise} A Promise which is resolved when the given Period is\n * setup.\n * @private\n */\nshaka.media.StreamingEngine.prototype.setupPeriod_ = function(periodIndex) {\n var Functional = shaka.util.Functional;\n var canSwitchRecord = this.canSwitchPeriod_[periodIndex];\n if (canSwitchRecord) {\n shaka.log.debug(\n '(all) Period ' + periodIndex + ' is being or has been set up');\n goog.asserts.assert(canSwitchRecord.promise, 'promise must not be null');\n return canSwitchRecord.promise;\n }\n\n shaka.log.debug('(all) setting up Period ' + periodIndex);\n canSwitchRecord = {\n promise: new shaka.util.PublicPromise(),\n resolved: false\n };\n this.canSwitchPeriod_[periodIndex] = canSwitchRecord;\n\n var streams = this.manifest_.periods[periodIndex].variants\n .map(function(variant) {\n var result = [];\n if (variant.audio)\n result.push(variant.audio);\n if (variant.video)\n result.push(variant.video);\n if (variant.video && variant.video.trickModeVideo)\n result.push(variant.video.trickModeVideo);\n return result;\n })\n .reduce(Functional.collapseArrays, [])\n .filter(Functional.isNotDuplicate);\n\n // Add text streams\n streams.push.apply(streams, this.manifest_.periods[periodIndex].textStreams);\n\n // Serialize Period set up.\n this.setupPeriodPromise_ = this.setupPeriodPromise_.then(function() {\n if (this.destroyed_) return;\n return this.setupStreams_(streams);\n }.bind(this)).then(function() {\n if (this.destroyed_) return;\n this.canSwitchPeriod_[periodIndex].promise.resolve();\n this.canSwitchPeriod_[periodIndex].resolved = true;\n shaka.log.v1('(all) setup Period ' + periodIndex);\n }.bind(this)).catch(function(error) {\n if (this.destroyed_) return;\n this.canSwitchPeriod_[periodIndex].promise.reject();\n delete this.canSwitchPeriod_[periodIndex];\n shaka.log.warning('(all) failed to setup Period ' + periodIndex);\n this.playerInterface_.onError(error);\n // Don't stop other Periods from being set up.\n }.bind(this));\n\n return canSwitchRecord.promise;\n};\n\n\n/**\n * Sets up the given Streams if necessary. Does NOT call onError() if an\n * error occurs.\n *\n * @param {!Array.<!shakaExtern.Stream>} streams\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.setupStreams_ = function(streams) {\n // Make sure that all the streams have unique ids.\n // (Duplicate ids will cause the player to hang).\n var uniqueStreamIds = streams.map(function(s) { return s.id; })\n .filter(shaka.util.Functional.isNotDuplicate);\n\n goog.asserts.assert(uniqueStreamIds.length == streams.length,\n 'streams should have unique ids');\n // Parallelize Stream set up.\n var async = [];\n\n for (var i = 0; i < streams.length; ++i) {\n var stream = streams[i];\n var canSwitchRecord = this.canSwitchStream_[stream.id];\n\n if (canSwitchRecord) {\n shaka.log.debug(\n '(all) Stream ' + stream.id + ' is being or has been set up');\n async.push(canSwitchRecord.promise);\n } else {\n shaka.log.v1('(all) setting up Stream ' + stream.id);\n this.canSwitchStream_[stream.id] = {\n promise: new shaka.util.PublicPromise(),\n resolved: false\n };\n async.push(stream.createSegmentIndex());\n }\n }\n\n return Promise.all(async).then(function() {\n if (this.destroyed_) return;\n\n for (var i = 0; i < streams.length; ++i) {\n var stream = streams[i];\n var canSwitchRecord = this.canSwitchStream_[stream.id];\n if (!canSwitchRecord.resolved) {\n canSwitchRecord.promise.resolve();\n canSwitchRecord.resolved = true;\n shaka.log.v1('(all) setup Stream ' + stream.id);\n }\n }\n }.bind(this)).catch(function(error) {\n if (this.destroyed_) return;\n this.canSwitchStream_[stream.id].promise.reject();\n delete this.canSwitchStream_[stream.id];\n return Promise.reject(error);\n }.bind(this));\n};\n\n\n/**\n * Sets the MediaSource's duration.\n * @private\n */\nshaka.media.StreamingEngine.prototype.setDuration_ = function() {\n var duration = this.manifest_.presentationTimeline.getDuration();\n if (duration < Infinity) {\n this.playerInterface_.mediaSourceEngine.setDuration(duration);\n } else {\n // Not all platforms support infinite durations, so set a finite duration\n // so we can append segments and so the user agent can seek.\n this.playerInterface_.mediaSourceEngine.setDuration(Math.pow(2, 32));\n }\n};\n\n\n/**\n * Called when |mediaState|'s update timer has expired.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @private\n */\nshaka.media.StreamingEngine.prototype.onUpdate_ = function(mediaState) {\n var MapUtils = shaka.util.MapUtils;\n if (this.destroyed_) return;\n\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n // Sanity check.\n goog.asserts.assert(\n !mediaState.performingUpdate && (mediaState.updateTimer != null),\n logPrefix + ' unexpected call to onUpdate_()');\n if (mediaState.performingUpdate || (mediaState.updateTimer == null)) return;\n\n goog.asserts.assert(\n !mediaState.clearingBuffer,\n logPrefix + ' onUpdate_() should not be called when clearing the buffer');\n if (mediaState.clearingBuffer) return;\n\n mediaState.updateTimer = null;\n\n // Handle pending buffer clears.\n if (mediaState.waitingToClearBuffer) {\n // Note: clearBuffer_() will schedule the next update.\n shaka.log.debug(logPrefix, 'skipping update and clearing the buffer');\n this.clearBuffer_(mediaState, mediaState.waitingToFlushBuffer);\n return;\n }\n\n // Update the MediaState.\n try {\n var delay = this.update_(mediaState);\n if (delay != null) {\n this.scheduleUpdate_(mediaState, delay);\n mediaState.hasError = false;\n }\n } catch (error) {\n this.playerInterface_.onError(error);\n return;\n }\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n\n var mediaStates = MapUtils.values(this.mediaStates_);\n\n // Check if we've buffered to the end of the Period.\n this.handlePeriodTransition_(mediaState);\n\n // Check if we've buffered to the end of the presentation.\n if (mediaStates.every(function(ms) { return ms.endOfStream; })) {\n shaka.log.v1(logPrefix, 'calling endOfStream()...');\n this.playerInterface_.mediaSourceEngine.endOfStream().then(function() {\n // If the media segments don't reach the end, then we need to update the\n // timeline duration to match the final media duration to avoid buffering\n // forever at the end.\n var duration = this.playerInterface_.mediaSourceEngine.getDuration();\n this.manifest_.presentationTimeline.setDuration(duration);\n }.bind(this));\n }\n};\n\n\n/**\n * Updates the given MediaState.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @return {?number} The number of seconds to wait until updating again or\n * null if another update does not need to be scheduled.\n * @throws {!shaka.util.Error} if an error occurs.\n * @private\n */\nshaka.media.StreamingEngine.prototype.update_ = function(mediaState) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n // Compute how far we've buffered ahead of the playhead.\n var playheadTime = this.playerInterface_.playhead.getTime();\n\n // Get the next timestamp we need.\n var timeNeeded = this.getTimeNeeded_(mediaState, playheadTime);\n shaka.log.v2(logPrefix, 'timeNeeded=' + timeNeeded);\n mediaState.resumeAt = 0;\n\n var currentPeriodIndex = this.findPeriodContainingStream_(mediaState.stream);\n var needPeriodIndex = this.findPeriodContainingTime_(timeNeeded);\n\n // Get the amount of content we have buffered, accounting for drift. This\n // is only used to determine if we have meet the buffering goal. This should\n // be the same way that PlayheadObserver uses.\n var bufferedAhead = this.playerInterface_.mediaSourceEngine.bufferedAheadOf(\n mediaState.type, playheadTime);\n\n shaka.log.v2(logPrefix,\n 'update_:',\n 'playheadTime=' + playheadTime,\n 'bufferedAhead=' + bufferedAhead);\n\n var bufferingGoal = this.getBufferingGoal_();\n\n // Check if we've buffered to the end of the presentation.\n if (timeNeeded >= this.manifest_.presentationTimeline.getDuration()) {\n // We shouldn't rebuffer if the playhead is close to the end of the\n // presentation.\n shaka.log.debug(logPrefix, 'buffered to end of presentation');\n mediaState.endOfStream = true;\n return null;\n }\n mediaState.endOfStream = false;\n\n // Check if we've buffered to the end of the Period. This should be done\n // before checking segment availability because the new Period may become\n // available once it's switched to. Note that we don't use the non-existence\n // of SegmentReferences as an indicator to determine Period boundaries\n // because SegmentIndexes can provide SegmentReferences outside its Period.\n mediaState.needPeriodIndex = needPeriodIndex;\n if (needPeriodIndex != currentPeriodIndex) {\n shaka.log.debug(logPrefix,\n 'need Period ' + needPeriodIndex,\n 'playheadTime=' + playheadTime,\n 'timeNeeded=' + timeNeeded,\n 'currentPeriodIndex=' + currentPeriodIndex);\n return null;\n }\n\n // If we've buffered to the buffering goal then schedule an update.\n if (bufferedAhead >= bufferingGoal) {\n shaka.log.v2(logPrefix, 'buffering goal met');\n\n // Do not try to predict the next update. Just poll twice every second.\n // The playback rate can change at any time, so any prediction we make now\n // could be terribly invalid soon.\n return 0.5;\n }\n\n var bufferEnd =\n this.playerInterface_.mediaSourceEngine.bufferEnd(mediaState.type);\n var reference = this.getSegmentReferenceNeeded_(\n mediaState, playheadTime, bufferEnd, currentPeriodIndex);\n if (!reference) {\n // The segment could not be found, does not exist, or is not available. In\n // any case just try again... if the manifest is incomplete or is not being\n // updated then we'll idle forever; otherwise, we'll end up getting a\n // SegmentReference eventually.\n return 1;\n }\n\n this.fetchAndAppend_(mediaState, playheadTime, currentPeriodIndex, reference);\n return null;\n};\n\n\n/**\n * Computes buffering goal.\n *\n * @return {number}\n * @private\n */\nshaka.media.StreamingEngine.prototype.getBufferingGoal_ = function() {\n goog.asserts.assert(this.manifest_, 'manifest_ should not be null');\n goog.asserts.assert(this.config_, 'config_ should not be null');\n\n var rebufferingGoal = shaka.util.StreamUtils.getRebufferingGoal(\n this.manifest_, this.config_, this.bufferingGoalScale_);\n\n return Math.max(\n rebufferingGoal,\n this.bufferingGoalScale_ * this.config_.bufferingGoal);\n};\n\n\n/**\n * Gets the next timestamp needed. Returns the playhead's position if the\n * buffer is empty; otherwise, returns the time at which the last segment\n * appended ends.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @return {number} The next timestamp needed.\n * @throws {!shaka.util.Error} if the buffer is inconsistent with our\n * expectations.\n * @private\n */\nshaka.media.StreamingEngine.prototype.getTimeNeeded_ = function(\n mediaState, playheadTime) {\n // Get the next timestamp we need. We must use |lastSegmentReference|\n // to determine this and not the actual buffer for two reasons:\n // 1. actual segments end slightly before their advertised end times, so\n // the next timestamp we need is actually larger than |bufferEnd|; and\n // 2. there may be drift (the timestamps in the segments are ahead/behind\n // of the timestamps in the manifest), but we need drift free times when\n // comparing times against presentation and Period boundaries.\n if (!mediaState.lastStream || !mediaState.lastSegmentReference) {\n return Math.max(playheadTime, mediaState.resumeAt);\n }\n\n var lastPeriodIndex =\n this.findPeriodContainingStream_(mediaState.lastStream);\n var lastPeriod = this.manifest_.periods[lastPeriodIndex];\n return lastPeriod.startTime + mediaState.lastSegmentReference.endTime;\n};\n\n\n/**\n * Gets the SegmentReference of the next segment needed.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @param {?number} bufferEnd\n * @param {number} currentPeriodIndex\n * @return {shaka.media.SegmentReference} The SegmentReference of the\n * next segment needed, or null if a segment could not be found, does not\n * exist, or is not available.\n * @private\n */\nshaka.media.StreamingEngine.prototype.getSegmentReferenceNeeded_ = function(\n mediaState, playheadTime, bufferEnd, currentPeriodIndex) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n if (mediaState.lastSegmentReference &&\n mediaState.stream == mediaState.lastStream) {\n // Something is buffered from the same Stream.\n var position = mediaState.lastSegmentReference.position + 1;\n shaka.log.v2(logPrefix, 'next position known:', 'position=' + position);\n\n return this.getSegmentReferenceIfAvailable_(\n mediaState, currentPeriodIndex, position);\n }\n\n var position;\n\n if (mediaState.lastSegmentReference) {\n // Something is buffered from another Stream.\n goog.asserts.assert(mediaState.lastStream, 'lastStream should not be null');\n shaka.log.v1(logPrefix, 'next position unknown: another Stream buffered');\n var lastPeriodIndex =\n this.findPeriodContainingStream_(mediaState.lastStream);\n var lastPeriod = this.manifest_.periods[lastPeriodIndex];\n position = this.lookupSegmentPosition_(\n mediaState,\n lastPeriod.startTime + mediaState.lastSegmentReference.endTime,\n currentPeriodIndex);\n } else {\n // Either nothing is buffered, or we have cleared part of the buffer. If\n // we still have some buffered, use that time to find the segment, otherwise\n // start at the playhead time.\n goog.asserts.assert(!mediaState.lastStream, 'lastStream should be null');\n shaka.log.v1(logPrefix, 'next position unknown: nothing buffered');\n position = this.lookupSegmentPosition_(\n mediaState, bufferEnd || playheadTime, currentPeriodIndex);\n }\n\n if (position == null)\n return null;\n\n var reference = null;\n if (bufferEnd == null) {\n // If there's positive drift then we need to get the previous segment;\n // however, we don't actually know how much drift there is, so we must\n // unconditionally get the previous segment. If it turns out that there's\n // non-positive drift then we'll just end up buffering beind the playhead a\n // little more than we needed.\n var optimalPosition = Math.max(0, position - 1);\n reference = this.getSegmentReferenceIfAvailable_(\n mediaState, currentPeriodIndex, optimalPosition);\n }\n return reference ||\n this.getSegmentReferenceIfAvailable_(\n mediaState, currentPeriodIndex, position);\n};\n\n\n/**\n * Looks up the position of the segment containing the given timestamp.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} presentationTime The timestamp needed, relative to the\n * start of the presentation.\n * @param {number} currentPeriodIndex\n * @return {?number} A segment position, or null if a segment was not be found.\n * @private\n */\nshaka.media.StreamingEngine.prototype.lookupSegmentPosition_ = function(\n mediaState, presentationTime, currentPeriodIndex) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n shaka.log.debug(logPrefix,\n 'looking up segment:',\n 'presentationTime=' + presentationTime,\n 'currentPeriod.startTime=' + currentPeriod.startTime);\n\n var lookupTime = Math.max(0, presentationTime - currentPeriod.startTime);\n var position = mediaState.stream.findSegmentPosition(lookupTime);\n\n if (position == null) {\n shaka.log.warning(logPrefix,\n 'cannot find segment:',\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'lookupTime=' + lookupTime);\n }\n\n return position;\n};\n\n\n/**\n * Gets the SegmentReference at the given position if it's available.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} currentPeriodIndex\n * @param {number} position\n * @return {shaka.media.SegmentReference}\n *\n * @private\n */\nshaka.media.StreamingEngine.prototype.getSegmentReferenceIfAvailable_ =\n function(mediaState, currentPeriodIndex, position) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n var reference = mediaState.stream.getSegmentReference(position);\n if (!reference) {\n shaka.log.v1(logPrefix,\n 'segment does not exist:',\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'position=' + position);\n return null;\n }\n\n var timeline = this.manifest_.presentationTimeline;\n var availabilityStart = timeline.getSegmentAvailabilityStart();\n var availabilityEnd = timeline.getSegmentAvailabilityEnd();\n\n if ((currentPeriod.startTime + reference.endTime < availabilityStart) ||\n (currentPeriod.startTime + reference.startTime > availabilityEnd)) {\n shaka.log.v2(logPrefix,\n 'segment is not available:',\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'reference.startTime=' + reference.startTime,\n 'reference.endTime=' + reference.endTime,\n 'availabilityStart=' + availabilityStart,\n 'availabilityEnd=' + availabilityEnd);\n return null;\n }\n\n return reference;\n};\n\n\n/**\n * Fetches and appends the given segment; sets up the given MediaState's\n * associated SourceBuffer and evicts segments if either are required\n * beforehand. Schedules another update after completing successfully.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @param {number} currentPeriodIndex The index of the current Period.\n * @param {!shaka.media.SegmentReference} reference\n * @private\n */\nshaka.media.StreamingEngine.prototype.fetchAndAppend_ = function(\n mediaState, playheadTime, currentPeriodIndex, reference) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n shaka.log.v1(logPrefix,\n 'fetchAndAppend_:',\n 'playheadTime=' + playheadTime,\n 'currentPeriod.startTime=' + currentPeriod.startTime,\n 'reference.position=' + reference.position,\n 'reference.startTime=' + reference.startTime,\n 'reference.endTime=' + reference.endTime);\n\n // Subtlety: The playhead may move while asynchronous update operations are\n // in progress, so we should avoid calling playhead.getTime() in any\n // callbacks. Furthermore, switch() may be called at any time, so we should\n // also avoid using mediaState.stream or mediaState.needInitSegment in any\n // callbacks too.\n var stream = mediaState.stream;\n\n // Compute the append window end.\n var followingPeriod = this.manifest_.periods[currentPeriodIndex + 1];\n var appendWindowEnd = null;\n if (followingPeriod) {\n appendWindowEnd = followingPeriod.startTime;\n } else {\n appendWindowEnd = this.manifest_.presentationTimeline.getDuration();\n }\n goog.asserts.assert(\n (appendWindowEnd == null) || (reference.startTime <= appendWindowEnd),\n logPrefix + ' segment should start before append window end');\n\n var initSourceBuffer =\n this.initSourceBuffer_(mediaState, currentPeriodIndex, appendWindowEnd);\n\n mediaState.performingUpdate = true;\n\n // We may set |needInitSegment| to true in switch(), so set it to false here,\n // since we want it to remain true if switch() is called.\n mediaState.needInitSegment = false;\n\n shaka.log.v2(logPrefix, 'fetching segment');\n var fetchSegment = this.fetch_(reference);\n\n Promise.all([initSourceBuffer, fetchSegment]).then(function(results) {\n if (this.destroyed_ || this.fatalError_) return;\n return this.append_(mediaState,\n playheadTime,\n currentPeriod,\n stream,\n reference,\n results[1]);\n }.bind(this)).then(function() {\n if (this.destroyed_ || this.fatalError_) return;\n\n mediaState.performingUpdate = false;\n mediaState.recovering = false;\n\n if (!mediaState.waitingToClearBuffer)\n this.playerInterface_.onSegmentAppended();\n\n // Update right away.\n this.scheduleUpdate_(mediaState, 0);\n\n // Subtlety: handleStartup_() calls onStartupComplete() which may call\n // switch() or seeked(), so we must schedule an update beforehand so\n // |updateTimer| is set.\n this.handleStartup_(mediaState, stream);\n\n shaka.log.v1(logPrefix, 'finished fetch and append');\n }.bind(this)).catch(function(error) {\n if (this.destroyed_ || this.fatalError_) return;\n goog.asserts.assert(error instanceof shaka.util.Error,\n 'Should only receive a Shaka error');\n\n mediaState.performingUpdate = false;\n\n if (this.manifest_.presentationTimeline.isLive() &&\n this.config_.infiniteRetriesForLiveStreams &&\n (error.code == shaka.util.Error.Code.BAD_HTTP_STATUS ||\n error.code == shaka.util.Error.Code.HTTP_ERROR ||\n error.code == shaka.util.Error.Code.TIMEOUT)) {\n this.handleNetworkError_(mediaState, error);\n } else if (error.code == shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR) {\n this.handleQuotaExceeded_(mediaState, error);\n } else {\n shaka.log.error(logPrefix, 'failed fetch and append: code=' + error.code);\n if (mediaState.type == ContentType.TEXT &&\n this.config_.ignoreTextStreamFailures) {\n shaka.log.warning(logPrefix,\n 'Text stream failed to parse. Proceeding without it.');\n delete this.mediaStates_[ContentType.TEXT];\n } else {\n mediaState.hasError = true;\n error.severity = shaka.util.Error.Severity.CRITICAL;\n this.playerInterface_.onError(error);\n }\n }\n }.bind(this));\n};\n\n\n/**\n * Handles a network error.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {!shaka.util.Error} error\n * @private\n */\nshaka.media.StreamingEngine.prototype.handleNetworkError_ = function(\n mediaState, error) {\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n if (mediaState.type == ContentType.TEXT &&\n this.config_.ignoreTextStreamFailures &&\n error.code == shaka.util.Error.Code.BAD_HTTP_STATUS) {\n shaka.log.warning(logPrefix,\n 'Text stream failed to download. Proceeding without it.');\n delete this.mediaStates_[ContentType.TEXT];\n } else {\n error.severity = shaka.util.Error.Severity.RECOVERABLE;\n this.playerInterface_.onError(error);\n\n shaka.log.warning(logPrefix, 'Network error. Retrying...');\n this.scheduleUpdate_(mediaState, 4);\n }\n};\n\n\n/**\n * Handles a QUOTA_EXCEEDED_ERROR.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {!shaka.util.Error} error\n * @private\n */\nshaka.media.StreamingEngine.prototype.handleQuotaExceeded_ = function(\n mediaState, error) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n // The segment cannot fit into the SourceBuffer. Ideally, MediaSource would\n // have evicted old data to accommodate the segment; however, it may have\n // failed to do this if the segment is very large, or if it could not find\n // a suitable time range to remove.\n //\n // We can overcome the latter by trying to append the segment again;\n // however, to avoid continuous QuotaExceededErrors we must reduce the size\n // of the buffer going forward.\n //\n // If we've recently reduced the buffering goals, wait until the stream\n // which caused the first QuotaExceededError recovers. Doing this ensures\n // we don't reduce the buffering goals too quickly.\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n var mediaStates = shaka.util.MapUtils.values(this.mediaStates_);\n var waitingForAnotherStreamToRecover = mediaStates.some(function(ms) {\n return ms != mediaState && ms.recovering;\n });\n\n if (!waitingForAnotherStreamToRecover) {\n // Reduction schedule: 80%, 60%, 40%, 20%, 16%, 12%, 8%, 4%, fail.\n // Note: percentages are used for comparisons to avoid rounding errors.\n var percentBefore = Math.round(100 * this.bufferingGoalScale_);\n if (percentBefore > 20) {\n this.bufferingGoalScale_ -= 0.2;\n } else if (percentBefore > 4) {\n this.bufferingGoalScale_ -= 0.04;\n } else {\n shaka.log.error(\n logPrefix, 'MediaSource threw QuotaExceededError too many times');\n mediaState.hasError = true;\n this.fatalError_ = true;\n this.playerInterface_.onError(error);\n return;\n }\n var percentAfter = Math.round(100 * this.bufferingGoalScale_);\n shaka.log.warning(\n logPrefix,\n 'MediaSource threw QuotaExceededError:',\n 'reducing buffering goals by ' + (100 - percentAfter) + '%');\n mediaState.recovering = true;\n } else {\n shaka.log.debug(\n logPrefix,\n 'MediaSource threw QuotaExceededError:',\n 'waiting for another stream to recover...');\n }\n\n // QuotaExceededError gets thrown if evication didn't help to make room\n // for a segment. We want to wait for a while (4 seconds is just an\n // arbitrary number) before updating to give the playhead a chance to\n // advance, so we don't immidiately throw again.\n this.scheduleUpdate_(mediaState, 4);\n};\n\n\n/**\n * Sets the given MediaState's associated SourceBuffer's timestamp offset and\n * init segment if either are required. If an error occurs then neither the\n * timestamp offset or init segment are unset, since another call to switch()\n * will end up superseding them.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} currentPeriodIndex\n * @param {?number} appendWindowEnd\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.initSourceBuffer_ = function(\n mediaState, currentPeriodIndex, appendWindowEnd) {\n if (!mediaState.needInitSegment)\n return Promise.resolve();\n\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var currentPeriod = this.manifest_.periods[currentPeriodIndex];\n\n // If we need an init segment then the Stream switched, so we've either\n // changed bitrates, Periods, or both. If we've changed Periods then we must\n // set a new timestamp offset and append window end. Note that by setting\n // these values here, we avoid having to co-ordinate ongoing updates, which\n // we would have to do if we instead set them in switch().\n var timestampOffset =\n currentPeriod.startTime - mediaState.stream.presentationTimeOffset;\n shaka.log.v1(logPrefix, 'setting timestamp offset to ' + timestampOffset);\n shaka.log.v1(logPrefix, 'setting append window end to ' + appendWindowEnd);\n var setStreamProperties =\n this.playerInterface_.mediaSourceEngine.setStreamProperties(\n mediaState.type, timestampOffset, appendWindowEnd);\n\n if (!mediaState.stream.initSegmentReference) {\n // The Stream is self initializing.\n return setStreamProperties;\n }\n\n shaka.log.v1(logPrefix, 'fetching init segment');\n var fetchInit = this.fetch_(mediaState.stream.initSegmentReference);\n var appendInit = fetchInit.then(function(initSegment) {\n if (this.destroyed_) return;\n shaka.log.v1(logPrefix, 'appending init segment');\n\n return this.playerInterface_.mediaSourceEngine.appendBuffer(\n mediaState.type, initSegment, null /* startTime */, null /* endTime */);\n }.bind(this)).catch(function(error) {\n mediaState.needInitSegment = true;\n return Promise.reject(error);\n });\n\n return Promise.all([setStreamProperties, appendInit]);\n};\n\n\n/**\n * Appends the given segment and evicts content if required to append.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Stream} stream\n * @param {!shaka.media.SegmentReference} reference\n * @param {!ArrayBuffer} segment\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.append_ = function(\n mediaState, playheadTime, period, stream, reference, segment) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n if (stream.containsEmsgBoxes) {\n new shaka.util.Mp4Parser()\n .fullBox('emsg', this.parseEMSG_.bind(this, period, reference))\n .parse(segment);\n }\n\n return this.evict_(mediaState, playheadTime).then(function() {\n if (this.destroyed_) return;\n shaka.log.v1(logPrefix, 'appending media segment');\n\n return this.playerInterface_.mediaSourceEngine.appendBuffer(\n mediaState.type, segment, reference.startTime + period.startTime,\n reference.endTime + period.startTime);\n }.bind(this)).then(function() {\n if (this.destroyed_) return;\n shaka.log.v2(logPrefix, 'appended media segment');\n\n // We must use |stream| because switch() may have been called.\n mediaState.lastStream = stream;\n mediaState.lastSegmentReference = reference;\n\n return Promise.resolve();\n }.bind(this));\n};\n\n\n/**\n * Parse the EMSG box from a MP4 container.\n *\n * @param {!shakaExtern.Period} period\n * @param {!shaka.media.SegmentReference} reference\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @private\n */\nshaka.media.StreamingEngine.prototype.parseEMSG_ = function(\n period, reference, box) {\n\n var schemeId = box.reader.readTerminatedString();\n // read rest of the data and dispatch event to the application\n var value = box.reader.readTerminatedString();\n var timescale = box.reader.readUint32();\n var presentationTimeDelta = box.reader.readUint32();\n var eventDuration = box.reader.readUint32();\n var id = box.reader.readUint32();\n var messageData = box.reader.readBytes(\n box.reader.getLength() - box.reader.getPosition());\n\n var startTime = period.startTime + reference.startTime +\n (presentationTimeDelta / timescale);\n\n // See DASH sec. 5.10.4.1\n // A special scheme in DASH used to signal manifest updates.\n if (schemeId == 'urn:mpeg:dash:event:2012') {\n this.playerInterface_.onManifestUpdate();\n } else {\n /** @type {shakaExtern.EmsgInfo} */\n var emsg = {\n startTime: startTime,\n endTime: startTime + (eventDuration / timescale),\n schemeIdUri: schemeId,\n value: value,\n timescale: timescale,\n presentationTimeDelta: presentationTimeDelta,\n eventDuration: eventDuration,\n id: id,\n messageData: messageData\n };\n\n var event = new shaka.util.FakeEvent('emsg', {'detail': emsg});\n this.playerInterface_.onEvent(event);\n }\n};\n\n\n/**\n * Evicts media to meet the max buffer behind limit.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} playheadTime\n * @return {!Promise}\n * @private\n */\nshaka.media.StreamingEngine.prototype.evict_ = function(\n mediaState, playheadTime) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.v2(logPrefix, 'checking buffer length');\n\n var startTime =\n this.playerInterface_.mediaSourceEngine.bufferStart(mediaState.type);\n if (startTime == null) {\n shaka.log.v2(logPrefix,\n 'buffer behind okay because nothing buffered:',\n 'playheadTime=' + playheadTime,\n 'bufferBehind=' + this.config_.bufferBehind);\n return Promise.resolve();\n }\n var bufferedBehind = playheadTime - startTime;\n\n var overflow = bufferedBehind - this.config_.bufferBehind;\n if (overflow <= 0) {\n shaka.log.v2(logPrefix,\n 'buffer behind okay:',\n 'playheadTime=' + playheadTime,\n 'bufferedBehind=' + bufferedBehind,\n 'bufferBehind=' + this.config_.bufferBehind,\n 'underflow=' + (-overflow));\n return Promise.resolve();\n }\n\n shaka.log.v1(logPrefix,\n 'buffer behind too large:',\n 'playheadTime=' + playheadTime,\n 'bufferedBehind=' + bufferedBehind,\n 'bufferBehind=' + this.config_.bufferBehind,\n 'overflow=' + overflow);\n\n return this.playerInterface_.mediaSourceEngine.remove(\n mediaState.type, startTime, startTime + overflow).then(function() {\n if (this.destroyed_) return;\n shaka.log.v1(logPrefix, 'evicted ' + overflow + ' seconds');\n }.bind(this));\n};\n\n\n/**\n * Sets up all known Periods when startup completes; otherwise, does nothing.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState The last\n * MediaState updated.\n * @param {shakaExtern.Stream} stream\n * @private\n */\nshaka.media.StreamingEngine.prototype.handleStartup_ = function(\n mediaState, stream) {\n var Functional = shaka.util.Functional;\n var MapUtils = shaka.util.MapUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n if (this.startupComplete_)\n return;\n\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n var mediaStates = MapUtils.values(this.mediaStates_);\n this.startupComplete_ = mediaStates.every(function(ms) {\n // Startup completes once we have buffered at least one segment from each\n // MediaState, not counting text.\n if (ms.type == ContentType.TEXT) return true;\n return !ms.waitingToClearBuffer &&\n !ms.clearingBuffer &&\n ms.lastSegmentReference;\n });\n\n if (!this.startupComplete_)\n return;\n\n shaka.log.debug(logPrefix, 'startup complete');\n\n // We must use |stream| because switch() may have been called.\n var currentPeriodIndex = this.findPeriodContainingStream_(stream);\n\n goog.asserts.assert(\n mediaStates.every(function(ms) {\n // It is possible for one stream (usually text) to buffer the whole\n // Period and need the next one.\n return ms.needPeriodIndex == currentPeriodIndex ||\n ms.needPeriodIndex == currentPeriodIndex + 1;\n }),\n logPrefix + ' expected all MediaStates to need same Period');\n\n // Setup the current Period if necessary, which is likely since the current\n // Period is probably the initial one.\n if (!this.canSwitchPeriod_[currentPeriodIndex]) {\n this.setupPeriod_(currentPeriodIndex).then(function() {\n shaka.log.v1(logPrefix, 'calling onCanSwitch()...');\n this.playerInterface_.onCanSwitch();\n }.bind(this)).catch(Functional.noop);\n }\n\n // Now setup all known Periods.\n for (var i = 0; i < this.manifest_.periods.length; ++i) {\n this.setupPeriod_(i).catch(Functional.noop);\n }\n\n if (this.playerInterface_.onStartupComplete) {\n shaka.log.v1(logPrefix, 'calling onStartupComplete()...');\n this.playerInterface_.onStartupComplete();\n }\n};\n\n\n/**\n * Calls onChooseStreams() when necessary.\n *\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState The last\n * MediaState updated.\n * @private\n */\nshaka.media.StreamingEngine.prototype.handlePeriodTransition_ = function(\n mediaState) {\n var Functional = shaka.util.Functional;\n var MapUtils = shaka.util.MapUtils;\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var currentPeriodIndex = this.findPeriodContainingStream_(mediaState.stream);\n if (mediaState.needPeriodIndex == currentPeriodIndex)\n return;\n\n var needPeriodIndex = mediaState.needPeriodIndex;\n\n goog.asserts.assert(this.mediaStates_, 'must not be destroyed');\n var mediaStates = MapUtils.values(this.mediaStates_);\n\n // For a Period transition to work, all media states must need the same\n // Period. If a stream needs a different Period than the one it currently\n // has, it will try to transition or stop updates assuming that another stream\n // will handle it. This only works when all streams either need the same\n // Period or are still performing updates.\n goog.asserts.assert(\n mediaStates.every(function(ms) {\n return ms.needPeriodIndex == needPeriodIndex || ms.hasError ||\n !shaka.media.StreamingEngine.isIdle_(ms);\n }),\n 'All MediaStates should need the same Period or be performing updates.');\n\n // Only call onChooseStreams() when all MediaStates need the same Period.\n var needSamePeriod = mediaStates.every(function(ms) {\n return ms.needPeriodIndex == needPeriodIndex;\n });\n if (!needSamePeriod) {\n shaka.log.debug(\n logPrefix, 'not all MediaStates need Period ' + needPeriodIndex);\n return;\n }\n\n // Only call onChooseStreams() once per Period transition.\n var allAreIdle = mediaStates.every(shaka.media.StreamingEngine.isIdle_);\n if (!allAreIdle) {\n shaka.log.debug(\n logPrefix,\n 'all MediaStates need Period ' + needPeriodIndex + ', ' +\n 'but not all MediaStates are idle');\n return;\n }\n\n shaka.log.debug(logPrefix, 'all need Period ' + needPeriodIndex);\n\n // Ensure the Period which we need to buffer is setup and then call\n // onChooseStreams().\n this.setupPeriod_(needPeriodIndex).then(function() {\n if (this.destroyed_) return;\n\n // If we seek during a Period transition, we can start another transition.\n // So we need to verify that:\n // - We are still in need of the same Period.\n // - All streams are still idle.\n // - The current stream is not in the needed Period (another transition\n // handled it).\n var allReady = mediaStates.every(function(ms) {\n var isIdle = shaka.media.StreamingEngine.isIdle_(ms);\n var currentPeriodIndex = this.findPeriodContainingStream_(ms.stream);\n return isIdle && ms.needPeriodIndex == needPeriodIndex &&\n currentPeriodIndex != needPeriodIndex;\n }.bind(this));\n if (!allReady) {\n // TODO: Write unit tests for this case.\n shaka.log.debug(logPrefix, 'ignoring transition to Period',\n needPeriodIndex, 'since another is happening');\n return;\n }\n\n var needPeriod = this.manifest_.periods[needPeriodIndex];\n\n shaka.log.v1(logPrefix, 'calling onChooseStreams()...');\n var streamsByType = this.playerInterface_.onChooseStreams(needPeriod);\n\n // Vet |streamsByType| before switching.\n for (var type in this.mediaStates_) {\n if (streamsByType[type] || type == ContentType.TEXT) continue;\n\n shaka.log.error(logPrefix,\n 'invalid Streams chosen: missing ' + type + ' Stream');\n this.playerInterface_.onError(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STREAMING,\n shaka.util.Error.Code.INVALID_STREAMS_CHOSEN));\n return;\n }\n\n for (var type in streamsByType) {\n if (this.mediaStates_[type]) continue;\n if (type == ContentType.TEXT) {\n // initStreams_ will switch streams and schedule an update.\n this.initStreams_(\n {text: streamsByType[ContentType.TEXT]}, needPeriod.startTime);\n delete streamsByType[type];\n continue;\n }\n\n shaka.log.error(logPrefix,\n 'invalid Streams chosen: unusable ' + type + ' Stream');\n this.playerInterface_.onError(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STREAMING,\n shaka.util.Error.Code.INVALID_STREAMS_CHOSEN));\n return;\n }\n\n for (var type in this.mediaStates_) {\n var stream = streamsByType[type];\n if (stream) {\n this.switch(type, stream, /* clearBuffer */ false);\n this.scheduleUpdate_(this.mediaStates_[type], 0);\n } else {\n goog.asserts.assert(type == ContentType.TEXT, 'Invalid streams chosen');\n delete this.mediaStates_[type];\n }\n }\n\n // We've already set up the Period so call onCanSwitch() right now.\n shaka.log.v1(logPrefix, 'calling onCanSwitch()...');\n this.playerInterface_.onCanSwitch();\n }.bind(this)).catch(Functional.noop);\n};\n\n\n/**\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @return {boolean} True if the given MediaState is idle; otherwise, return\n * false.\n * @private\n */\nshaka.media.StreamingEngine.isIdle_ = function(mediaState) {\n return !mediaState.performingUpdate &&\n (mediaState.updateTimer == null) &&\n !mediaState.waitingToClearBuffer &&\n !mediaState.clearingBuffer;\n};\n\n\n/**\n * @param {number} time The time, in seconds, relative to the start of the\n * presentation.\n * @return {number} The index of the Period which starts after |time|\n * @private\n */\nshaka.media.StreamingEngine.prototype.findPeriodContainingTime_ = function(\n time) {\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n return shaka.util.StreamUtils.findPeriodContainingTime(this.manifest_, time);\n};\n\n\n/**\n * @param {!shakaExtern.Stream} stream\n * @return {number} The index of the Period which contains |stream|, or -1 if\n * no Period contains |stream|.\n * @private\n */\nshaka.media.StreamingEngine.prototype.findPeriodContainingStream_ = function(\n stream) {\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n return shaka.util.StreamUtils.findPeriodContainingStream(\n this.manifest_, stream);\n};\n\n\n/**\n * Fetches the given segment.\n *\n * @param {(!shaka.media.InitSegmentReference|!shaka.media.SegmentReference)}\n * reference\n *\n * @return {!Promise.<!ArrayBuffer>}\n * @private\n */\nshaka.media.StreamingEngine.prototype.fetch_ = function(reference) {\n var requestType = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n var request = shaka.net.NetworkingEngine.makeRequest(\n reference.getUris(), this.config_.retryParameters);\n\n // Set Range header. Note that some web servers don't accept Range headers,\n // so don't set one if it's not strictly required.\n if ((reference.startByte != 0) || (reference.endByte != null)) {\n var range = 'bytes=' + reference.startByte + '-';\n if (reference.endByte != null) range += reference.endByte;\n request.headers['Range'] = range;\n }\n\n shaka.log.v2('fetching: reference=' + reference);\n var p = this.playerInterface_.netEngine.request(requestType, request);\n return p.then(function(response) {\n return response.data;\n });\n};\n\n\n/**\n * Clears the buffer and schedules another update.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {boolean} flush\n * @private\n */\nshaka.media.StreamingEngine.prototype.clearBuffer_ =\n function(mediaState, flush) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n\n goog.asserts.assert(\n !mediaState.performingUpdate && (mediaState.updateTimer == null),\n logPrefix + ' unexpected call to clearBuffer_()');\n\n mediaState.waitingToClearBuffer = false;\n mediaState.waitingToFlushBuffer = false;\n mediaState.clearingBuffer = true;\n\n shaka.log.debug(logPrefix, 'clearing buffer');\n var p = this.playerInterface_.mediaSourceEngine.clear(mediaState.type);\n p.then(function() {\n if (!this.destroyed_ && flush) {\n return this.playerInterface_.mediaSourceEngine.flush(mediaState.type);\n }\n }.bind(this)).then(function() {\n if (this.destroyed_) return;\n shaka.log.debug(logPrefix, 'cleared buffer');\n mediaState.lastStream = null;\n mediaState.lastSegmentReference = null;\n mediaState.clearingBuffer = false;\n mediaState.endOfStream = false;\n this.scheduleUpdate_(mediaState, 0);\n }.bind(this));\n};\n\n\n/**\n * Schedules |mediaState|'s next update.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @param {number} delay The delay in seconds.\n * @private\n */\nshaka.media.StreamingEngine.prototype.scheduleUpdate_ = function(\n mediaState, delay) {\n var logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);\n shaka.log.v2(logPrefix, 'updating in ' + delay + ' seconds');\n goog.asserts.assert(mediaState.updateTimer == null,\n logPrefix + ' did not expect update to be scheduled');\n mediaState.updateTimer = window.setTimeout(\n this.onUpdate_.bind(this, mediaState), delay * 1000);\n};\n\n\n/**\n * Cancels |mediaState|'s next update if one exists.\n *\n * @param {!shaka.media.StreamingEngine.MediaState_} mediaState\n * @private\n */\nshaka.media.StreamingEngine.prototype.cancelUpdate_ = function(mediaState) {\n if (mediaState.updateTimer != null) {\n window.clearTimeout(mediaState.updateTimer);\n mediaState.updateTimer = null;\n }\n};\n\n\n/**\n * @param {shaka.media.StreamingEngine.MediaState_} mediaState\n * @return {string} A log prefix of the form ($CONTENT_TYPE:$STREAM_ID), e.g.,\n * \"(audio:5)\" or \"(video:hd)\".\n * @private\n */\nshaka.media.StreamingEngine.logPrefix_ = function(mediaState) {\n return '(' + mediaState.type + ':' + mediaState.stream.id + ')';\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/media/streaming_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.net.HttpPlugin');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.StringUtils');\n\n\n/**\n * @namespace\n * @summary A networking plugin to handle http and https URIs via XHR.\n * @param {string} uri\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.net.HttpPlugin = function(uri, request) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n\n xhr.open(request.method, uri, true);\n xhr.responseType = 'arraybuffer';\n xhr.timeout = request.retryParameters.timeout;\n xhr.withCredentials = request.allowCrossSiteCredentials;\n\n xhr.onload = function(event) {\n var target = event.target;\n goog.asserts.assert(target, 'XHR onload has no target!');\n\n var headers = target.getAllResponseHeaders().split('\\r\\n').reduce(\n function(all, part) {\n var header = part.split(': ');\n all[header[0].toLowerCase()] = header.slice(1).join(': ');\n return all;\n },\n {});\n if (target.status >= 200 && target.status <= 299 &&\n target.status != 202) {\n // Most 2xx HTTP codes are success cases.\n if (target.responseURL) {\n uri = target.responseURL;\n }\n /** @type {shakaExtern.Response} */\n var response = {\n uri: uri,\n data: target.response,\n headers: headers,\n fromCache: !!headers['x-shaka-from-cache']\n };\n resolve(response);\n } else {\n var responseText = null;\n try {\n responseText = shaka.util.StringUtils.fromBytesAutoDetect(\n target.response);\n } catch (exception) {}\n shaka.log.debug('HTTP error text:', responseText);\n\n var severity = target.status == 401 || target.status == 403 ?\n shaka.util.Error.Severity.CRITICAL :\n shaka.util.Error.Severity.RECOVERABLE;\n reject(new shaka.util.Error(\n severity,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.BAD_HTTP_STATUS,\n uri,\n target.status,\n responseText,\n headers));\n }\n };\n xhr.onerror = function(event) {\n reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.HTTP_ERROR,\n uri));\n };\n xhr.ontimeout = function(event) {\n reject(new shaka.util.Error(\n shaka.util.Error.Severity.RECOVERABLE,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.TIMEOUT,\n uri));\n };\n\n for (var k in request.headers) {\n xhr.setRequestHeader(k, request.headers[k]);\n }\n xhr.send(request.body);\n });\n};\n\n\nshaka.net.NetworkingEngine.registerScheme('http', shaka.net.HttpPlugin);\nshaka.net.NetworkingEngine.registerScheme('https', shaka.net.HttpPlugin);\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/net/http_plugin.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.DBEngine');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.offline.IStorageEngine');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.PublicPromise');\n\n\n\n/**\n * This manages all operations on an IndexedDB. This wraps all operations\n * in Promises. All Promises will resolve once the transaction has completed.\n * Depending on the browser, this may or may not be after the data is flushed\n * to disk. https://goo.gl/zMOeJc\n *\n * @struct\n * @constructor\n * @implements {shaka.offline.IStorageEngine}\n */\nshaka.offline.DBEngine = function() {\n goog.asserts.assert(\n shaka.offline.DBEngine.isSupported(),\n 'DBEngine should not be called when DBEngine is not supported');\n\n /** @private {IDBDatabase} */\n this.db_ = null;\n\n /** @private {!Array.<shaka.offline.DBEngine.Operation>} */\n this.operations_ = [];\n\n /** @private {!Object.<string, number>} */\n this.currentIdMap_ = {};\n};\n\n\n/**\n * @typedef {{\n * transaction: !IDBTransaction,\n * promise: !shaka.util.PublicPromise\n * }}\n *\n * @property {!IDBTransaction} transaction\n * The transaction that this operation is using.\n * @property {!shaka.util.PublicPromise} promise\n * The promise associated with the operation.\n */\nshaka.offline.DBEngine.Operation;\n\n\n/** @private {string} */\nshaka.offline.DBEngine.DB_NAME_ = 'shaka_offline_db';\n\n\n/** @private @const {number} */\nshaka.offline.DBEngine.DB_VERSION_ = 1;\n\n\n/**\n * Determines if the browsers supports IndexedDB.\n * @return {boolean}\n */\nshaka.offline.DBEngine.isSupported = function() {\n return window.indexedDB != null;\n};\n\n\n/**\n * Delete the database. There must be no open connections to the database.\n * @return {!Promise}\n */\nshaka.offline.DBEngine.deleteDatabase = function() {\n if (!window.indexedDB)\n return Promise.resolve();\n var request =\n window.indexedDB.deleteDatabase(shaka.offline.DBEngine.DB_NAME_);\n\n var p = new shaka.util.PublicPromise();\n request.onsuccess = function(event) {\n goog.asserts.assert(event.newVersion == null, 'Unexpected database update');\n p.resolve();\n };\n request.onerror = shaka.offline.DBEngine.onError_.bind(null, request, p);\n return p;\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.initialized = function() {\n return this.db_ != null;\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.init = function(storeMap, opt_retryCount) {\n goog.asserts.assert(!this.db_, 'Already initialized');\n\n return this.createConnection_(storeMap, opt_retryCount).then(function() {\n // For each store, get the next ID and store in the map.\n var stores = Object.keys(storeMap);\n return Promise.all(stores.map(function(store) {\n return this.getNextId_(store).then(function(id) {\n this.currentIdMap_[store] = id;\n }.bind(this));\n }.bind(this)));\n }.bind(this));\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.destroy = function() {\n return Promise.all(this.operations_.map(function(op) {\n try {\n // If the transaction is considered finished but has not called the\n // callbacks yet, it will still be in the list and this call will fail.\n // Simply ignore errors.\n op.transaction.abort();\n } catch (e) {}\n\n var Functional = shaka.util.Functional;\n return op.promise.catch(Functional.noop);\n })).then(function() {\n goog.asserts.assert(this.operations_.length == 0,\n 'All operations should have been closed');\n if (this.db_) {\n this.db_.close();\n this.db_ = null;\n }\n }.bind(this));\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.get = function(storeName, key) {\n var request;\n return this.createTransaction_(storeName, 'readonly', function(store) {\n request = store.get(key);\n }).then(function() { return request.result; });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.forEach = function(storeName, callback) {\n return this.createTransaction_(storeName, 'readonly', function(store) {\n var request = store.openCursor();\n request.onsuccess = function(event) {\n var cursor = event.target.result;\n if (cursor) {\n callback(cursor.value);\n cursor.continue();\n }\n };\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.insert = function(storeName, value) {\n return this.createTransaction_(storeName, 'readwrite', function(store) {\n store.put(value);\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.remove = function(storeName, key) {\n return this.createTransaction_(storeName, 'readwrite', function(store) {\n store.delete(key);\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.removeKeys = function(storeName,\n keys,\n opt_onKeyRemoved) {\n return this.createTransaction_(storeName, 'readwrite', function(store) {\n for (var i = 0; i < keys.length; i++) {\n var request = store.delete(keys[i]);\n request.onsuccess = opt_onKeyRemoved || function(event) { };\n }\n });\n};\n\n\n/** @override */\nshaka.offline.DBEngine.prototype.reserveId = function(storeName) {\n goog.asserts.assert(storeName in this.currentIdMap_,\n 'Store name must be passed to init()');\n return this.currentIdMap_[storeName]++;\n};\n\n\n/**\n * Gets the ID to start at.\n *\n * @param {string} storeName\n * @return {!Promise.<number>}\n * @private\n */\nshaka.offline.DBEngine.prototype.getNextId_ = function(storeName) {\n var id = 0;\n return this.createTransaction_(storeName, 'readonly', function(store) {\n var request = store.openCursor(null, 'prev');\n request.onsuccess = function(event) {\n var cursor = event.target.result;\n if (cursor) {\n id = cursor.key + 1;\n }\n };\n }).then(function() { return id; });\n};\n\n\n/**\n * Creates a new transaction for the given store name and calls |action| to\n * modify the store. The transaction will resolve or reject the promise\n * returned by this function.\n *\n * @param {string} storeName\n * @param {string} type\n * @param {!function(IDBObjectStore)} action\n *\n * @return {!Promise}\n * @private\n */\nshaka.offline.DBEngine.prototype.createTransaction_ = function(storeName,\n type,\n action) {\n\n goog.asserts.assert(this.db_, 'Must not be destroyed');\n goog.asserts.assert(type == 'readonly' || type == 'readwrite',\n 'Type must be \"readonly\" or \"readwrite\"');\n\n var op = {\n transaction: this.db_.transaction([storeName], type),\n promise: new shaka.util.PublicPromise()\n };\n\n op.transaction.oncomplete = (function(event) {\n this.closeOperation_(op);\n op.promise.resolve();\n }.bind(this));\n\n // We will see an onabort call via:\n // 1. request error -> transaction error -> transaction abort\n // 2. transaction commit fail -> transaction abort\n // As any transaction error will result in an abort, it is better to listen\n // for an abort so that we will catch all failed transaction operations.\n op.transaction.onabort = (function(event) {\n this.closeOperation_(op);\n shaka.offline.DBEngine.onError_(op.transaction, op.promise, event);\n }.bind(this));\n\n // We need to prevent default on the onerror event or else Firefox will\n // raise an error which will cause a karma failure. This will not stop the\n // onabort callback from firing.\n op.transaction.onerror = (function(event) {\n event.preventDefault();\n }.bind(this));\n\n var store = op.transaction.objectStore(storeName);\n action(store);\n\n this.operations_.push(op);\n\n return op.promise;\n};\n\n\n/**\n * Close an open operation.\n *\n * @param {!shaka.offline.DBEngine.Operation} op\n * @private\n */\nshaka.offline.DBEngine.prototype.closeOperation_ = function(op) {\n var i = this.operations_.indexOf(op);\n goog.asserts.assert(i >= 0, 'Operation must be in the list.');\n this.operations_.splice(i, 1);\n};\n\n\n/**\n * Creates a new connection to the database.\n *\n * On IE/Edge, it is possible for the database to not be deleted when the\n * success callback is fired. This means that when we delete the database and\n * immediately create a new connection, we will connect to the old database.\n * If this happens, we need to close the connection and retry.\n *\n * @see https://goo.gl/hOYJvN\n *\n * @param {!Object.<string, string>} storeMap\n * @param {number=} opt_retryCount\n * @return {!Promise}\n * @private\n */\nshaka.offline.DBEngine.prototype.createConnection_ = function(\n storeMap, opt_retryCount) {\n var DBEngine = shaka.offline.DBEngine;\n\n var indexedDB = window.indexedDB;\n var request = indexedDB.open(DBEngine.DB_NAME_, DBEngine.DB_VERSION_);\n\n var upgraded = false;\n var createPromise = new shaka.util.PublicPromise();\n request.onupgradeneeded = function(event) {\n upgraded = true;\n var db = event.target.result;\n goog.asserts.assert(event.oldVersion == 0,\n 'Must be upgrading from version 0');\n goog.asserts.assert(db.objectStoreNames.length == 0,\n 'Version 0 database should be empty');\n for (var name in storeMap) {\n db.createObjectStore(name, {keyPath: storeMap[name]});\n }\n };\n request.onsuccess = (function(event) {\n if (opt_retryCount && !upgraded) {\n event.target.result.close();\n\n shaka.log.info('Didn\\'t get an upgrade event... trying again.');\n setTimeout(function() {\n var p = this.createConnection_(storeMap, opt_retryCount - 1);\n p.then(createPromise.resolve, createPromise.reject);\n }.bind(this), 1000);\n return;\n }\n\n\n goog.asserts.assert(opt_retryCount == undefined || upgraded,\n 'Should get upgrade event');\n this.db_ = event.target.result;\n createPromise.resolve();\n }.bind(this));\n request.onerror = DBEngine.onError_.bind(null, request, createPromise);\n\n return createPromise;\n};\n\n\n/**\n * Rejects the given Promise using the error fromt the transaction.\n *\n * @param {!IDBTransaction|!IDBRequest} errorSource\n * @param {!shaka.util.PublicPromise} promise\n * @param {Event} event\n * @private\n */\nshaka.offline.DBEngine.onError_ = function(errorSource, promise, event) {\n\n if (errorSource.error) {\n promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.INDEXED_DB_ERROR, errorSource.error));\n } else {\n promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n\n // Firefox will raise an error which will cause a karma failure.\n event.preventDefault();\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/db_engine.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.DownloadManager');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.MapUtils');\n\n\n\n/**\n * This manages downloading segments and notifying the app of progress.\n *\n * @param {shaka.offline.IStorageEngine} storageEngine\n * @param {!shaka.net.NetworkingEngine} netEngine\n * @param {shakaExtern.RetryParameters} retryParams\n * @param {shakaExtern.OfflineConfiguration} config\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n */\nshaka.offline.DownloadManager = function(\n storageEngine, netEngine, retryParams, config) {\n /**\n * @private {!Object.<\n * string, !Array.<shaka.offline.DownloadManager.Segment>>}\n */\n this.segments_ = {};\n\n /**\n * The IDs of the segments that have been stored for an in-progress\n * download(). This is used to cleanup in destroy().\n * @private {!Array.<number>}\n */\n this.storedSegments_ = [];\n\n /** @private {?shakaExtern.OfflineConfiguration} */\n this.config_ = config;\n\n /** @private {shaka.offline.IStorageEngine} */\n this.storageEngine_ = storageEngine;\n\n /** @private {shaka.net.NetworkingEngine} */\n this.netEngine_ = netEngine;\n\n /** @private {?shakaExtern.RetryParameters} */\n this.retryParams_ = retryParams;\n\n /** @private {?shakaExtern.ManifestDB} */\n this.manifest_ = null;\n\n /** @private {Promise} */\n this.promise_ = null;\n\n /**\n * The total number of bytes for segments that include a byte range.\n * @private {number}\n */\n this.givenBytesTotal_ = 0;\n\n /**\n * The number of bytes downloaded for segments that include a byte range.\n * @private {number}\n */\n this.givenBytesDownloaded_ = 0;\n\n /**\n * The total number of bytes estimated based on bandwidth for segments that\n * do not include a byte range.\n * @private {number}\n */\n this.bandwidthBytesTotal_ = 0;\n\n /**\n * The estimated number of bytes downloaded for segments that do not have\n * a byte range.\n * @private {number}\n */\n this.bandwidthBytesDownloaded_ = 0;\n};\n\n\n/**\n * @typedef {{\n * uris: !Array.<string>,\n * startByte: number,\n * endByte: ?number,\n * bandwidthSize: number,\n * segmentDb: shakaExtern.SegmentDataDB\n * }}\n *\n * @property {!Array.<string>} uris\n * The URIs to download the segment.\n * @property {number} startByte\n * The byte index the segment starts at.\n * @property {?number} endByte\n * The byte index the segment ends at, if present.\n * @property {number} bandwidthSize\n * The size of the segment as estimated by the bandwidth and segment duration.\n * @property {shakaExtern.SegmentDataDB} segmentDb\n * The data to store in the database.\n */\nshaka.offline.DownloadManager.Segment;\n\n\n/** @override */\nshaka.offline.DownloadManager.prototype.destroy = function() {\n var storage = this.storageEngine_;\n var segments = this.storedSegments_;\n var p = this.promise_ || Promise.resolve();\n p = p.then(function() { return storage.removeKeys('segment', segments); });\n\n // Don't destroy() storageEngine since it is owned by Storage.\n\n this.segments_ = {};\n this.storedSegments_ = [];\n this.config_ = null;\n this.storageEngine_ = null;\n this.netEngine_ = null;\n this.retryParams_ = null;\n this.manifest_ = null;\n this.promise_ = null;\n return p;\n};\n\n\n/**\n * Adds a segment to the list to be downloaded.\n *\n * @param {string} type\n * @param {!shaka.media.SegmentReference|!shaka.media.InitSegmentReference} ref\n * @param {number} bandwidthSize\n * @param {shakaExtern.SegmentDataDB} segmentDb\n * The data to store in the database with the data. The |data| field of this\n * object will contain the downloaded data.\n */\nshaka.offline.DownloadManager.prototype.addSegment = function(\n type, ref, bandwidthSize, segmentDb) {\n this.segments_[type] = this.segments_[type] || [];\n this.segments_[type].push({\n uris: ref.getUris(),\n startByte: ref.startByte,\n endByte: ref.endByte,\n bandwidthSize: bandwidthSize,\n segmentDb: segmentDb\n });\n};\n\n\n/**\n * Downloads all the segments, stores them in the database, and stores the given\n * manifest object.\n *\n * @param {shakaExtern.ManifestDB} manifest\n * @return {!Promise}\n */\nshaka.offline.DownloadManager.prototype.downloadAndStore = function(manifest) {\n var MapUtils = shaka.util.MapUtils;\n // Calculate progress estimates.\n this.givenBytesTotal_ = 0;\n this.givenBytesDownloaded_ = 0;\n this.bandwidthBytesTotal_ = 0;\n this.bandwidthBytesDownloaded_ = 0;\n MapUtils.values(this.segments_).forEach(function(segments) {\n segments.forEach(function(segment) {\n if (segment.endByte != null)\n this.givenBytesTotal_ += (segment.endByte - segment.startByte + 1);\n else\n this.bandwidthBytesTotal_ += segment.bandwidthSize;\n }.bind(this));\n }.bind(this));\n\n this.manifest_ = manifest;\n // Will be updated as we download for segments without a byte-range.\n this.manifest_.size = this.givenBytesTotal_;\n\n // Create separate download chains for different content types. This will\n // allow audio and video to be downloaded in parallel.\n var async = MapUtils.values(this.segments_).map(function(segments) {\n var i = 0;\n var downloadNext = (function() {\n if (!this.config_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n if (i >= segments.length) return Promise.resolve();\n var segment = segments[i++];\n return this.downloadSegment_(segment).then(downloadNext);\n }.bind(this));\n return downloadNext();\n }.bind(this));\n this.segments_ = {};\n\n this.promise_ = Promise.all(async).then(function() {\n return this.storageEngine_.insert('manifest', manifest);\n }.bind(this)).then(function() {\n this.storedSegments_ = [];\n }.bind(this));\n return this.promise_;\n};\n\n\n/**\n * Downloads the given segment and calls the callback.\n *\n * @param {shaka.offline.DownloadManager.Segment} segment\n * @return {!Promise}\n * @private\n */\nshaka.offline.DownloadManager.prototype.downloadSegment_ = function(segment) {\n goog.asserts.assert(this.retryParams_, 'Must not be destroyed');\n var type = shaka.net.NetworkingEngine.RequestType.SEGMENT;\n var request =\n shaka.net.NetworkingEngine.makeRequest(segment.uris, this.retryParams_);\n if (segment.startByte != 0 || segment.endByte != null) {\n var end = segment.endByte == null ? '' : segment.endByte;\n request.headers['Range'] = 'bytes=' + segment.startByte + '-' + end;\n }\n\n var byteCount;\n return this.netEngine_.request(type, request)\n .then(function(response) {\n if (!this.manifest_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n byteCount = response.data.byteLength;\n\n this.storedSegments_.push(segment.segmentDb.key);\n segment.segmentDb.data = response.data;\n return this.storageEngine_.insert('segment', segment.segmentDb);\n }.bind(this))\n .then(function() {\n if (!this.manifest_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED));\n }\n if (segment.endByte == null) {\n // We didn't know the size, so it was an estimate.\n this.manifest_.size += byteCount;\n this.bandwidthBytesDownloaded_ += segment.bandwidthSize;\n } else {\n goog.asserts.assert(\n byteCount == (segment.endByte - segment.startByte + 1),\n 'Incorrect download size');\n this.givenBytesDownloaded_ += byteCount;\n }\n this.updateProgress_();\n }.bind(this));\n};\n\n\n/**\n * Calls the progress callback.\n * @private\n */\nshaka.offline.DownloadManager.prototype.updateProgress_ = function() {\n var progress = (this.givenBytesDownloaded_ + this.bandwidthBytesDownloaded_) /\n (this.givenBytesTotal_ + this.bandwidthBytesTotal_);\n\n goog.asserts.assert(this.manifest_, 'Must not be destroyed');\n var manifest = shaka.offline.OfflineUtils.getStoredContent(this.manifest_);\n this.config_.progressCallback(manifest, progress);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/download_manager.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.OfflineUtils');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.media.InitSegmentReference');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.media.SegmentIndex');\ngoog.require('shaka.media.SegmentReference');\ngoog.require('shaka.offline.DBEngine');\ngoog.require('shaka.offline.IStorageEngine');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\n\n\n/** @const {!Object.<string, string>} */\nshaka.offline.OfflineUtils.DB_SCHEME = {'manifest': 'key', 'segment': 'key'};\n\n\n/**\n * Converts the given database manifest to a storedContent structure.\n *\n * @param {shakaExtern.ManifestDB} manifest\n * @return {shakaExtern.StoredContent}\n */\nshaka.offline.OfflineUtils.getStoredContent = function(manifest) {\n goog.asserts.assert(manifest.periods.length > 0,\n 'Must be at least one Period.');\n\n // Reconstruct the first period to get the variants\n var timeline = new shaka.media.PresentationTimeline(null, 0);\n var period = shaka.offline.OfflineUtils.reconstructPeriod(\n manifest.periods[0], [], timeline);\n\n var tracks = shaka.util.StreamUtils.getVariantTracks(period, null, null);\n var textTracks = shaka.util.StreamUtils.getTextTracks(period, null);\n\n tracks.push.apply(tracks, textTracks);\n\n return {\n offlineUri: 'offline:' + manifest.key,\n originalManifestUri: manifest.originalManifestUri,\n duration: manifest.duration,\n size: manifest.size,\n expiration: manifest.expiration == undefined ? Infinity :\n manifest.expiration,\n tracks: tracks,\n appMetadata: manifest.appMetadata\n };\n};\n\n\n/**\n * Reconstructs a period object from the given database period.\n *\n * @param {shakaExtern.PeriodDB} period\n * @param {!Array.<shakaExtern.DrmInfo>} drmInfos\n * @param {shaka.media.PresentationTimeline} timeline\n * @return {shakaExtern.Period}\n */\nshaka.offline.OfflineUtils.reconstructPeriod = function(\n period, drmInfos, timeline) {\n var OfflineUtils = shaka.offline.OfflineUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var textStreamsDb = period.streams.filter(function(streamDb) {\n return streamDb.contentType == ContentType.TEXT;\n });\n\n var audioStreamsDb = period.streams.filter(function(streamDb) {\n return streamDb.contentType == ContentType.AUDIO;\n });\n\n var videoStreamsDb = period.streams.filter(function(streamDb) {\n return streamDb.contentType == ContentType.VIDEO;\n });\n\n var variants =\n OfflineUtils.createVariants_(audioStreamsDb, videoStreamsDb, drmInfos);\n var textStreams = textStreamsDb.map(OfflineUtils.createStream_);\n\n period.streams.forEach(function(streamDb) {\n var refs = OfflineUtils.getSegmentReferences_(streamDb);\n timeline.notifySegments(period.startTime, refs);\n });\n\n return {\n startTime: period.startTime,\n variants: variants,\n textStreams: textStreams\n };\n};\n\n\n/**\n * @param {!shakaExtern.StreamDB} streamDb\n * @return {!Array.<!shaka.media.SegmentReference>}\n * @private\n */\nshaka.offline.OfflineUtils.getSegmentReferences_ = function(streamDb) {\n return streamDb.segments.map(function(segment, i) {\n var getUris = function() { return [segment.uri]; };\n return new shaka.media.SegmentReference(\n i, segment.startTime, segment.endTime, getUris, 0, null);\n });\n};\n\n\n/**\n * Creates Variants from audio and video StreamDB collections.\n *\n * @param {!Array.<!shakaExtern.StreamDB>} audios\n * @param {!Array.<!shakaExtern.StreamDB>} videos\n * @param {!Array.<!shakaExtern.DrmInfo>} drmInfos\n * @return {!Array.<!shakaExtern.Variant>}\n * @private\n */\nshaka.offline.OfflineUtils.createVariants_ = function(\n audios, videos, drmInfos) {\n var variants = [];\n if (!audios.length && !videos.length) return variants;\n\n // Create a single null element so the double loop will work for audio-only or\n // video-only variants.\n if (!audios.length) {\n audios = [null];\n } else if (!videos.length) {\n videos = [null];\n }\n\n var OfflineUtils = shaka.offline.OfflineUtils;\n var id = 0;\n for (var i = 0; i < audios.length; i++) {\n for (var j = 0; j < videos.length; j++) {\n if (OfflineUtils.areCompatible_(audios[i], videos[j])) {\n var variant =\n OfflineUtils.createVariant_(audios[i], videos[j], drmInfos, id++);\n variants.push(variant);\n }\n }\n }\n\n return variants;\n};\n\n\n/**\n * Checks if two streams can be combined into a variant.\n *\n * @param {?shakaExtern.StreamDB} stream1\n * @param {?shakaExtern.StreamDB} stream2\n * @return {boolean}\n * @private\n */\nshaka.offline.OfflineUtils.areCompatible_ = function(stream1, stream2) {\n // Treat content that doesn't have variantIds as compatible\n // with anything for compatibility with content stored before\n // the variants were introduced.\n if (!stream1 || !stream2 || !stream1.variantIds || !stream2.variantIds)\n return true;\n\n for (var i = 0; i < stream1.variantIds.length; i++) {\n var containsId = stream2.variantIds.some(function(id) {\n return id == stream1.variantIds[i];\n });\n if (containsId) {\n return true;\n }\n }\n\n return false;\n};\n\n\n/**\n * Creates a Variant from an audio and a video StreamDBs.\n * If one of the streams is null, it creates a Variant from the other.\n *\n * @param {?shakaExtern.StreamDB} audio\n * @param {?shakaExtern.StreamDB} video\n * @param {!Array.<!shakaExtern.DrmInfo>} drmInfos\n * @param {number} id\n * @return {!shakaExtern.Variant}\n * @private\n */\nshaka.offline.OfflineUtils.createVariant_ = function(\n audio, video, drmInfos, id) {\n return {\n id: id,\n language: audio ? audio.language : '',\n // Use !! to get the compiler to use a boolean type. Otherwise it will\n // deduce the type as {boolean|shakaExtern.StreamDB} even though |audio|\n // will only be returned if it is falsy, so the type would be {boolean|null}\n primary: (!!audio && audio.primary) || (!!video && video.primary),\n audio: shaka.offline.OfflineUtils.createStream_(audio),\n video: shaka.offline.OfflineUtils.createStream_(video),\n bandwidth: 0,\n drmInfos: drmInfos,\n allowedByApplication: true,\n allowedByKeySystem: true\n };\n};\n\n\n/**\n * Creates a shakaExtern.Stream from a StreamDB.\n *\n * @param {?shakaExtern.StreamDB} streamDb\n * @return {?shakaExtern.Stream}\n * @private\n */\nshaka.offline.OfflineUtils.createStream_ = function(streamDb) {\n if (!streamDb) return null;\n\n var refs =\n shaka.offline.OfflineUtils.getSegmentReferences_(streamDb);\n\n var segmentIndex = new shaka.media.SegmentIndex(refs);\n\n var initRef = streamDb.initSegmentUri ?\n new shaka.media.InitSegmentReference(\n function() { return [streamDb.initSegmentUri]; }, 0, null) :\n null;\n return {\n id: streamDb.id,\n createSegmentIndex: Promise.resolve.bind(Promise),\n findSegmentPosition: segmentIndex.find.bind(segmentIndex),\n getSegmentReference: segmentIndex.get.bind(segmentIndex),\n initSegmentReference: initRef,\n presentationTimeOffset: streamDb.presentationTimeOffset,\n mimeType: streamDb.mimeType,\n codecs: streamDb.codecs,\n width: streamDb.width || undefined,\n height: streamDb.height || undefined,\n frameRate: streamDb.frameRate || undefined,\n kind: streamDb.kind,\n encrypted: streamDb.encrypted,\n keyId: streamDb.keyId,\n language: streamDb.language,\n label: streamDb.label || null,\n type: streamDb.contentType,\n primary: streamDb.primary,\n trickModeVideo: null,\n // TODO(modmaker): Store offline?\n containsEmsgBoxes: false,\n roles: []\n };\n};\n\n\n/**\n * Determines if this platform supports any form of storage engine.\n * @return {boolean}\n */\nshaka.offline.OfflineUtils.isStorageEngineSupported = function() {\n return shaka.offline.DBEngine.isSupported();\n};\n\n\n/**\n * Create a new instance of the supported storage engine. The created instance\n * will be uninitialized. If this platform does not support any storage\n * engines, this function will return null.\n * @return {shaka.offline.IStorageEngine}\n */\nshaka.offline.OfflineUtils.createStorageEngine = function() {\n return shaka.offline.DBEngine.isSupported() ?\n new shaka.offline.DBEngine() :\n null;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/offline_utils.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.OfflineManifestParser');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.media.PresentationTimeline');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.Error');\n\n\n\n/**\n * Creates a new offline manifest parser.\n * @struct\n * @constructor\n * @implements {shakaExtern.ManifestParser}\n */\nshaka.offline.OfflineManifestParser = function() {\n /** @private {number} */\n this.manifestId_ = -1;\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.configure = function(config) {\n // No-op\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.start =\n function(uri, playerInterface) {\n var parts = /^offline:([0-9]+)$/.exec(uri);\n if (!parts) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_OFFLINE_URI, uri));\n }\n var manifestId = Number(parts[1]);\n var storageEngine = shaka.offline.OfflineUtils.createStorageEngine();\n this.manifestId_ = manifestId;\n\n if (!storageEngine) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORAGE_NOT_SUPPORTED));\n }\n\n return storageEngine.init(shaka.offline.OfflineUtils.DB_SCHEME)\n .then(function() { return storageEngine.get('manifest', manifestId); })\n .then(function(manifest) {\n if (!manifest) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND, manifestId);\n }\n\n var OfflineManifestParser = shaka.offline.OfflineManifestParser;\n return OfflineManifestParser.reconstructManifest(manifest);\n })\n .then(\n function(ret) {\n return storageEngine.destroy().then(function() { return ret; });\n },\n function(err) {\n return storageEngine.destroy().then(function() { throw err; });\n });\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.stop = function() {\n return Promise.resolve();\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.update = function() {\n // No-op\n};\n\n\n/** @override */\nshaka.offline.OfflineManifestParser.prototype.onExpirationUpdated = function(\n sessionId, expiration) {\n var storageEngine = shaka.offline.OfflineUtils.createStorageEngine();\n goog.asserts.assert(storageEngine, 'Must support offline storage');\n\n storageEngine.init(shaka.offline.OfflineUtils.DB_SCHEME)\n .then(function() {\n return storageEngine.get('manifest', this.manifestId_);\n }.bind(this))\n .then(function(manifest) {\n if (!manifest) {\n // Manifest was deleted, ignore update.\n return;\n }\n if (manifest.sessionIds.indexOf(sessionId) < 0) {\n shaka.log.debug('Ignoring updated expiration for unknown session');\n return;\n }\n\n if (manifest.expiration == undefined ||\n manifest.expiration > expiration) {\n shaka.log.debug('Updating expiration for stored content');\n manifest.expiration = expiration;\n return storageEngine.insert('manifest', manifest);\n }\n })\n .catch(function(error) {\n shaka.log.error('Error updating offline manifest expiration', error);\n })\n .then(function() {\n return storageEngine.destroy();\n });\n};\n\n\n/**\n * Reconstructs a manifest object from the given database manifest.\n *\n * @param {shakaExtern.ManifestDB} manifest\n * @return {shakaExtern.Manifest}\n */\nshaka.offline.OfflineManifestParser.reconstructManifest = function(manifest) {\n var timeline = new shaka.media.PresentationTimeline(null, 0);\n timeline.setDuration(manifest.duration);\n var drmInfos = manifest.drmInfo ? [manifest.drmInfo] : [];\n return {\n presentationTimeline: timeline,\n minBufferTime: 10,\n offlineSessionIds: manifest.sessionIds,\n periods: manifest.periods.map(function(period) {\n return shaka.offline.OfflineUtils.reconstructPeriod(period,\n drmInfos,\n timeline);\n })\n };\n};\n\n\nshaka.media.ManifestParser.registerParserByMime(\n 'application/x-offline-manifest', shaka.offline.OfflineManifestParser);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/offline_manifest_parser.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.OfflineScheme');\n\ngoog.require('shaka.net.NetworkingEngine');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.Error');\n\n\n/**\n * @namespace\n * @summary A plugin that handles requests for offline content.\n * @param {string} uri\n * @param {shakaExtern.Request} request\n * @return {!Promise.<shakaExtern.Response>}\n * @export\n */\nshaka.offline.OfflineScheme = function(uri, request) {\n var manifestParts = /^offline:([0-9]+)$/.exec(uri);\n if (manifestParts) {\n /** @type {shakaExtern.Response} */\n var response = {\n uri: uri,\n data: new ArrayBuffer(0),\n headers: {'content-type': 'application/x-offline-manifest'}\n };\n return Promise.resolve(response);\n }\n\n var segmentParts = /^offline:[0-9]+\\/[0-9]+\\/([0-9]+)$/.exec(uri);\n if (segmentParts) {\n var segmentId = Number(segmentParts[1]);\n var scheme = shaka.offline.OfflineUtils.DB_SCHEME;\n var storageEngine = shaka.offline.OfflineUtils.createStorageEngine();\n\n if (!storageEngine) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORAGE_NOT_SUPPORTED));\n }\n\n return storageEngine.init(scheme)\n .then(function() { return storageEngine.get('segment', segmentId); })\n .then(function(segment) {\n return storageEngine.destroy().then(function() {\n if (!segment) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND, segmentId);\n }\n return {uri: uri, data: segment.data, headers: {}};\n });\n });\n }\n\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.NETWORK,\n shaka.util.Error.Code.MALFORMED_OFFLINE_URI, uri));\n};\n\n\nshaka.net.NetworkingEngine.registerScheme(\n 'offline', shaka.offline.OfflineScheme);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/offline_scheme.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.CancelableChain');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.util.Error');\n\n\n\n/**\n * A Promise-based abstraction that creates cancelable Promise chains.\n * When canceled, subsequent stages of the internal Promise chain will stop.\n * A canceled chain is rejected with a user-specified value.\n *\n * A CancelableChain only supports linear Promise chains. Chains which branch\n * (more than one then() handler chained to a particular stage) are not\n * supported. You will not be prevented from treating this as if branching\n * were supported, but everything will be serialized into a linear chain.\n * Be careful!\n *\n * @constructor\n * @struct\n */\nshaka.util.CancelableChain = function() {\n /** @private {!Promise} */\n this.promise_ = Promise.resolve();\n\n /** @private {boolean} */\n this.final_ = false;\n\n /** @private {boolean} */\n this.complete_ = false;\n\n /** @private {boolean} */\n this.canceled_ = false;\n\n /** @private {shaka.util.Error} */\n this.rejectionValue_;\n\n /** @private {function()} */\n this.onCancelComplete_;\n\n /** @private {!Promise} */\n this.cancelPromise_ = new Promise(function(resolve) {\n this.onCancelComplete_ = resolve;\n }.bind(this));\n};\n\n\n/**\n * @param {function(*)} callback\n * @return {!shaka.util.CancelableChain} the chain itself.\n */\nshaka.util.CancelableChain.prototype.then = function(callback) {\n goog.asserts.assert(!this.final_, 'Chain should not be final!');\n\n this.promise_ = this.promise_.then(callback).then(function(data) {\n if (this.canceled_) {\n this.onCancelComplete_();\n return Promise.reject(this.rejectionValue_);\n }\n return Promise.resolve(data);\n }.bind(this));\n return this;\n};\n\n\n/**\n * Finalize the chain.\n * Converts the chain into a simple Promise and stops accepting new stages.\n *\n * @return {!Promise}\n */\nshaka.util.CancelableChain.prototype.finalize = function() {\n if (!this.final_) {\n this.promise_ = this.promise_.then(function(data) {\n this.complete_ = true;\n return Promise.resolve(data);\n }.bind(this), function(error) {\n this.complete_ = true;\n if (this.canceled_) {\n this.onCancelComplete_();\n return Promise.reject(this.rejectionValue_);\n }\n\n return Promise.reject(error);\n }.bind(this));\n }\n this.final_ = true;\n return this.promise_;\n};\n\n\n/**\n * Cancel the Promise chain and reject with the given value.\n *\n * @param {!shaka.util.Error} reason\n * @return {!Promise} resolved when the cancelation has been processed by the\n * the chain and no more stages will execute. Note that this may be before\n * the owner of the finalized chain has seen the rejection.\n */\nshaka.util.CancelableChain.prototype.cancel = function(reason) {\n if (this.complete_) return Promise.resolve();\n\n this.canceled_ = true;\n this.rejectionValue_ = reason;\n return this.cancelPromise_;\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/cancelable_chain.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.offline.Storage');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.Player');\ngoog.require('shaka.log');\ngoog.require('shaka.media.DrmEngine');\ngoog.require('shaka.media.ManifestParser');\ngoog.require('shaka.offline.DownloadManager');\ngoog.require('shaka.offline.IStorageEngine');\ngoog.require('shaka.offline.OfflineManifestParser');\ngoog.require('shaka.offline.OfflineUtils');\ngoog.require('shaka.util.ConfigUtils');\ngoog.require('shaka.util.Error');\ngoog.require('shaka.util.Functional');\ngoog.require('shaka.util.IDestroyable');\ngoog.require('shaka.util.LanguageUtils');\ngoog.require('shaka.util.ManifestParserUtils');\ngoog.require('shaka.util.StreamUtils');\n\n\n\n/**\n * This manages persistent offline data including storage, listing, and deleting\n * stored manifests. Playback of offline manifests are done using Player\n * using the special URI (e.g. 'offline:12').\n *\n * First, check support() to see if offline is supported by the platform.\n * Second, configure() the storage object with callbacks to your application.\n * Third, call store(), remove(), or list() as needed.\n * When done, call destroy().\n *\n * @param {shaka.Player} player\n * The player instance to pull configuration data from.\n *\n * @struct\n * @constructor\n * @implements {shaka.util.IDestroyable}\n * @export\n */\nshaka.offline.Storage = function(player) {\n // It is an easy mistake to make to pass a Player proxy from CastProxy.\n // Rather than throw a vague exception later, throw an explicit and clear one\n // now.\n if (!player || player.constructor != shaka.Player) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.LOCAL_PLAYER_INSTANCE_REQUIRED);\n }\n\n /** @private {shaka.offline.IStorageEngine} */\n this.storageEngine_ = shaka.offline.OfflineUtils.createStorageEngine();\n\n /** @private {shaka.Player} */\n this.player_ = player;\n\n /** @private {?shakaExtern.OfflineConfiguration} */\n this.config_ = this.defaultConfig_();\n\n /** @private {shaka.media.DrmEngine} */\n this.drmEngine_ = null;\n\n /** @private {boolean} */\n this.storeInProgress_ = false;\n\n /** @private {Array.<shakaExtern.Track>} */\n this.firstPeriodTracks_ = null;\n\n /** @private {number} */\n this.manifestId_ = -1;\n\n /** @private {number} */\n this.duration_ = 0;\n\n /** @private {?shakaExtern.Manifest} */\n this.manifest_ = null;\n\n var netEngine = player.getNetworkingEngine();\n goog.asserts.assert(netEngine, 'Player must not be destroyed');\n\n /** @private {shaka.offline.DownloadManager} */\n this.downloadManager_ = new shaka.offline.DownloadManager(\n this.storageEngine_, netEngine,\n player.getConfiguration().streaming.retryParameters, this.config_);\n};\n\n\n/**\n * Gets whether offline storage is supported. Returns true if offline storage\n * is supported for clear content. Support for offline storage of encrypted\n * content will not be determined until storage is attempted.\n *\n * @return {boolean}\n * @export\n */\nshaka.offline.Storage.support = function() {\n return shaka.offline.OfflineUtils.isStorageEngineSupported();\n};\n\n\n/**\n * @override\n * @export\n */\nshaka.offline.Storage.prototype.destroy = function() {\n var storageEngine = this.storageEngine_;\n // Destroy the download manager first since it needs the StorageEngine to\n // clean up old segments.\n var ret = !this.downloadManager_ ?\n Promise.resolve() :\n this.downloadManager_.destroy()\n .catch(function() {})\n .then(function() {\n if (storageEngine) return storageEngine.destroy();\n });\n\n this.storageEngine_ = null;\n this.downloadManager_ = null;\n this.player_ = null;\n this.config_ = null;\n return ret;\n};\n\n\n/**\n * Sets configuration values for Storage. This is not associated with\n * Player.configure and will not change Player.\n *\n * There are two important callbacks configured here: one for download progress,\n * and one to decide which tracks to store.\n *\n * The default track selection callback will store the largest SD video track.\n * Provide your own callback to choose the tracks you want to store.\n *\n * @param {shakaExtern.OfflineConfiguration} config\n * @export\n */\nshaka.offline.Storage.prototype.configure = function(config) {\n goog.asserts.assert(this.config_, 'Must not be destroyed');\n shaka.util.ConfigUtils.mergeConfigObjects(\n this.config_, config, this.defaultConfig_(), {}, '');\n};\n\n\n/**\n * Stores the given manifest. If the content is encrypted, and encrypted\n * content cannot be stored on this platform, the Promise will be rejected with\n * error code 6001, REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE.\n *\n * @param {string} manifestUri The URI of the manifest to store.\n * @param {!Object} appMetadata An arbitrary object from the application that\n * will be stored along-side the offline content. Use this for any\n * application-specific metadata you need associated with the stored content.\n * For details on the data types that can be stored here, please refer to\n * https://goo.gl/h62coS\n * @param {!shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * @return {!Promise.<shakaExtern.StoredContent>} A Promise to a structure\n * representing what was stored. The \"offlineUri\" member is the URI that\n * should be given to Player.load() to play this piece of content offline.\n * The \"appMetadata\" member is the appMetadata argument you passed to store().\n * @export\n */\nshaka.offline.Storage.prototype.store = function(\n manifestUri, appMetadata, opt_manifestParserFactory) {\n if (this.storeInProgress_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORE_ALREADY_IN_PROGRESS));\n }\n this.storeInProgress_ = true;\n\n /** @type {shakaExtern.ManifestDB} */\n var manifestDb;\n\n var error = null;\n var onError = function(e) { error = e; };\n return this.initIfNeeded_()\n .then(function() {\n this.checkDestroyed_();\n return this.loadInternal(\n manifestUri, onError, opt_manifestParserFactory);\n }.bind(this)).then((\n /**\n * @param {{manifest: shakaExtern.Manifest,\n * drmEngine: !shaka.media.DrmEngine}} data\n * @return {!Promise}\n */\n function(data) {\n this.checkDestroyed_();\n this.manifest_ = data.manifest;\n this.drmEngine_ = data.drmEngine;\n\n if (this.manifest_.presentationTimeline.isLive() ||\n this.manifest_.presentationTimeline.isInProgress()) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.CANNOT_STORE_LIVE_OFFLINE, manifestUri);\n }\n\n // Re-filter now that DrmEngine is initialized.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n\n this.manifestId_ = this.storageEngine_.reserveId('manifest');\n this.duration_ = 0;\n manifestDb = this.createOfflineManifest_(manifestUri, appMetadata);\n return this.downloadManager_.downloadAndStore(manifestDb);\n })\n .bind(this))\n .then(function() {\n this.checkDestroyed_();\n // Throw any errors from the manifest parser or DrmEngine.\n if (error)\n throw error;\n\n return this.cleanup_();\n }.bind(this))\n .then(function() {\n return shaka.offline.OfflineUtils.getStoredContent(manifestDb);\n }.bind(this))\n .catch(function(err) {\n var Functional = shaka.util.Functional;\n return this.cleanup_().catch(Functional.noop).then(function() {\n throw err;\n });\n }.bind(this));\n};\n\n\n/**\n * Removes the given stored content.\n *\n * @param {shakaExtern.StoredContent} content\n * @return {!Promise}\n * @export\n */\nshaka.offline.Storage.prototype.remove = function(content) {\n var uri = content.offlineUri;\n var parts = /^offline:([0-9]+)$/.exec(uri);\n if (!parts) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.MALFORMED_OFFLINE_URI, uri));\n }\n\n var error = null;\n var onError = function(e) {\n // Ignore errors if the session was already removed.\n if (e.code != shaka.util.Error.Code.OFFLINE_SESSION_REMOVED)\n error = e;\n };\n\n /** @type {shakaExtern.ManifestDB} */\n var manifestDb;\n /** @type {!shaka.media.DrmEngine} */\n var drmEngine;\n var manifestId = Number(parts[1]);\n return this.initIfNeeded_().then(function() {\n this.checkDestroyed_();\n return this.storageEngine_.get('manifest', manifestId);\n }.bind(this)).then((\n /**\n * @param {?shakaExtern.ManifestDB} data\n * @return {!Promise}\n */\n function(data) {\n this.checkDestroyed_();\n if (!data) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.REQUESTED_ITEM_NOT_FOUND, uri);\n }\n manifestDb = data;\n var manifest =\n shaka.offline.OfflineManifestParser.reconstructManifest(manifestDb);\n var netEngine = this.player_.getNetworkingEngine();\n goog.asserts.assert(netEngine, 'Player must not be destroyed');\n drmEngine = new shaka.media.DrmEngine(\n netEngine, onError, function() {}, function() {});\n drmEngine.configure(this.player_.getConfiguration().drm);\n return drmEngine.init(manifest, true /* isOffline */);\n })\n .bind(this)).then(function() {\n return drmEngine.removeSessions(manifestDb.sessionIds);\n }.bind(this)).then(function() {\n return drmEngine.destroy();\n }.bind(this)).then(function() {\n this.checkDestroyed_();\n if (error) throw error;\n var Functional = shaka.util.Functional;\n // Get every segment for every stream in the manifest.\n /** @type {!Array.<number>} */\n var segments = manifestDb.periods.map(function(period) {\n return period.streams.map(function(stream) {\n var segments = stream.segments.map(function(segment) {\n var parts = /^offline:[0-9]+\\/[0-9]+\\/([0-9]+)$/.exec(segment.uri);\n goog.asserts.assert(parts, 'Invalid offline URI');\n return Number(parts[1]);\n });\n if (stream.initSegmentUri) {\n var parts = /^offline:[0-9]+\\/[0-9]+\\/([0-9]+)$/.exec(\n stream.initSegmentUri);\n goog.asserts.assert(parts, 'Invalid offline URI');\n segments.push(Number(parts[1]));\n }\n return segments;\n }).reduce(Functional.collapseArrays, []);\n }).reduce(Functional.collapseArrays, []);\n\n // Delete all the segments.\n var deleteCount = 0;\n var segmentCount = segments.length;\n var callback = this.config_.progressCallback;\n\n return this.storageEngine_.removeKeys('segment', segments, function() {\n deleteCount++;\n callback(content, deleteCount / segmentCount);\n });\n\n }.bind(this)).then(function() {\n this.checkDestroyed_();\n this.config_.progressCallback(content, 1);\n return this.storageEngine_.remove('manifest', manifestId);\n }.bind(this));\n};\n\n\n/**\n * Lists all the stored content available.\n *\n * @return {!Promise.<!Array.<shakaExtern.StoredContent>>} A Promise to an\n * array of structures representing all stored content. The \"offlineUri\"\n * member of the structure is the URI that should be given to Player.load()\n * to play this piece of content offline. The \"appMetadata\" member is the\n * appMetadata argument you passed to store().\n * @export\n */\nshaka.offline.Storage.prototype.list = function() {\n /** @type {!Array.<shakaExtern.StoredContent>} */\n var storedContents = [];\n return this.initIfNeeded_()\n .then(function() {\n this.checkDestroyed_();\n return this.storageEngine_.forEach(\n 'manifest', function(/** shakaExtern.ManifestDB */ manifest) {\n storedContents.push(\n shaka.offline.OfflineUtils.getStoredContent(manifest));\n });\n }.bind(this))\n .then(function() { return storedContents; });\n};\n\n\n/**\n * Loads the given manifest, parses it, and constructs the DrmEngine. This\n * stops the manifest parser. This may be replaced by tests.\n *\n * @param {string} manifestUri\n * @param {function(*)} onError\n * @param {!shakaExtern.ManifestParser.Factory=} opt_manifestParserFactory\n * @return {!Promise.<{\n * manifest: shakaExtern.Manifest,\n * drmEngine: !shaka.media.DrmEngine\n * }>}\n */\nshaka.offline.Storage.prototype.loadInternal = function(\n manifestUri, onError, opt_manifestParserFactory) {\n\n var netEngine = /** @type {!shaka.net.NetworkingEngine} */ (\n this.player_.getNetworkingEngine());\n var config = this.player_.getConfiguration();\n\n /** @type {shakaExtern.Manifest} */\n var manifest;\n /** @type {!shaka.media.DrmEngine} */\n var drmEngine;\n /** @type {!shakaExtern.ManifestParser} */\n var manifestParser;\n\n var onKeyStatusChange = function() {};\n return shaka.media.ManifestParser\n .getFactory(\n manifestUri, netEngine, config.manifest.retryParameters,\n opt_manifestParserFactory)\n .then(function(factory) {\n this.checkDestroyed_();\n manifestParser = new factory();\n manifestParser.configure(config.manifest);\n\n var playerInterface = {\n networkingEngine: netEngine,\n filterPeriod: this.filterPeriod_.bind(this),\n onTimelineRegionAdded: function() {},\n onEvent: function() {},\n onError: onError\n };\n return manifestParser.start(manifestUri, playerInterface);\n }.bind(this))\n .then(function(data) {\n this.checkDestroyed_();\n manifest = data;\n drmEngine = new shaka.media.DrmEngine(\n netEngine, onError, onKeyStatusChange, function() {});\n drmEngine.configure(config.drm);\n return drmEngine.init(manifest, true /* isOffline */);\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return this.createSegmentIndex_(manifest);\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return drmEngine.createOrLoad();\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return manifestParser.stop();\n }.bind(this))\n .then(function() {\n this.checkDestroyed_();\n return {manifest: manifest, drmEngine: drmEngine};\n }.bind(this))\n .catch(function(error) {\n if (manifestParser)\n return manifestParser.stop().then(function() { throw error; });\n else\n throw error;\n });\n};\n\n\n/**\n * The default track selection function.\n *\n * @param {!Array.<shakaExtern.Track>} tracks\n * @return {!Array.<shakaExtern.Track>}\n * @private\n */\nshaka.offline.Storage.prototype.defaultTrackSelect_ = function(tracks) {\n var LanguageUtils = shaka.util.LanguageUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n\n var selectedTracks = [];\n\n // Select variants with best language match.\n var audioLangPref = LanguageUtils.normalize(\n this.player_.getConfiguration().preferredAudioLanguage);\n var matchTypes = [\n LanguageUtils.MatchType.EXACT,\n LanguageUtils.MatchType.BASE_LANGUAGE_OKAY,\n LanguageUtils.MatchType.OTHER_SUB_LANGUAGE_OKAY\n ];\n var allVariantTracks =\n tracks.filter(function(track) { return track.type == 'variant'; });\n // For each match type, get the tracks that match the audio preference for\n // that match type.\n var tracksByMatchType = matchTypes.map(function(match) {\n return allVariantTracks.filter(function(track) {\n var lang = LanguageUtils.normalize(track.language);\n return LanguageUtils.match(match, audioLangPref, lang);\n });\n });\n\n // Find the best match type that has any matches.\n var variantTracks;\n for (var i = 0; i < tracksByMatchType.length; i++) {\n if (tracksByMatchType[i].length) {\n variantTracks = tracksByMatchType[i];\n break;\n }\n }\n\n // Fall back to \"primary\" audio tracks, if present.\n if (!variantTracks) {\n var primaryTracks = allVariantTracks.filter(function(track) {\n return track.primary;\n });\n if (primaryTracks.length)\n variantTracks = primaryTracks;\n }\n\n // Otherwise, there is no good way to choose the language, so we don't choose\n // a language at all.\n if (!variantTracks) {\n variantTracks = allVariantTracks;\n // Issue a warning, but only if the content has multiple languages.\n // Otherwise, this warning would just be noise.\n var languages = allVariantTracks\n .map(function(track) { return track.language; })\n .filter(shaka.util.Functional.isNotDuplicate);\n if (languages.length > 1) {\n shaka.log.warning('Could not choose a good audio track based on ' +\n 'language preferences or primary tracks. An ' +\n 'arbitrary language will be stored!');\n }\n }\n\n // From previously selected variants, choose the SD ones (height <= 480).\n var tracksByHeight = variantTracks.filter(function(track) {\n return track.height && track.height <= 480;\n });\n\n // If variants don't have video or no video with height <= 480 was\n // found, proceed with the previously selected tracks.\n if (tracksByHeight.length) {\n // Sort by resolution, then select all variants which match the height\n // of the highest SD res. There may be multiple audio bitrates for the\n // same video resolution.\n tracksByHeight.sort(function(a, b) { return b.height - a.height; });\n variantTracks = tracksByHeight.filter(function(track) {\n return track.height == tracksByHeight[0].height;\n });\n }\n\n // Now sort by bandwidth.\n variantTracks.sort(function(a, b) { return a.bandwidth - b.bandwidth; });\n\n // In case there are multiple matches at different audio bitrates, select the\n // middle bandwidth one.\n if (variantTracks.length)\n selectedTracks.push(variantTracks[Math.floor(variantTracks.length / 2)]);\n\n // Since this default callback is used primarily by our own demo app and by\n // app developers who haven't thought about which tracks they want, we should\n // select all text tracks, regardless of language. This makes for a better\n // demo for us, and does not rely on user preferences for the unconfigured\n // app.\n selectedTracks.push.apply(selectedTracks, tracks.filter(function(track) {\n return track.type == ContentType.TEXT;\n }));\n\n return selectedTracks;\n};\n\n\n/**\n * @return {shakaExtern.OfflineConfiguration}\n * @private\n */\nshaka.offline.Storage.prototype.defaultConfig_ = function() {\n return {\n trackSelectionCallback: this.defaultTrackSelect_.bind(this),\n progressCallback: function(storedContent, percent) {\n // Reference arguments to keep closure from removing it.\n // If the argument is removed, it breaks our function length check\n // in mergeConfigObjects_().\n // NOTE: Chrome App Content Security Policy prohibits usage of new\n // Function().\n if (storedContent || percent) return null;\n }\n };\n};\n\n\n/**\n * Initializes the IStorageEngine if it is not already.\n *\n * @return {!Promise}\n * @private\n */\nshaka.offline.Storage.prototype.initIfNeeded_ = function() {\n if (!this.storageEngine_) {\n return Promise.reject(new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.STORAGE_NOT_SUPPORTED));\n } else if (this.storageEngine_.initialized()) {\n return Promise.resolve();\n } else {\n var scheme = shaka.offline.OfflineUtils.DB_SCHEME;\n return this.storageEngine_.init(scheme);\n }\n};\n\n\n/**\n * @param {shakaExtern.Period} period\n * @private\n */\nshaka.offline.Storage.prototype.filterPeriod_ = function(period) {\n var StreamUtils = shaka.util.StreamUtils;\n var ContentType = shaka.util.ManifestParserUtils.ContentType;\n var activeStreams = {};\n if (this.firstPeriodTracks_) {\n var variantTracks = this.firstPeriodTracks_.filter(function(track) {\n return track.type == 'variant';\n });\n var variant = null;\n if (variantTracks.length)\n variant = StreamUtils.findVariantForTrack(period, variantTracks[0]);\n\n if (variant) {\n // Use the first variant as the container of \"active streams\". This\n // is then used to filter out the streams that are not compatible with it.\n // This ensures that in multi-Period content, all Periods have streams\n // with compatible MIME types.\n if (variant.video) activeStreams[ContentType.VIDEO] = variant.video;\n if (variant.audio) activeStreams[ContentType.AUDIO] = variant.audio;\n }\n }\n StreamUtils.filterPeriod(this.drmEngine_, activeStreams, period);\n StreamUtils.applyRestrictions(\n period, this.player_.getConfiguration().restrictions,\n /* maxHwRes */ { width: Infinity, height: Infinity });\n};\n\n\n/**\n * Cleans up the current store and destroys any objects. This object is still\n * usable after this.\n *\n * @return {!Promise}\n * @private\n */\nshaka.offline.Storage.prototype.cleanup_ = function() {\n var ret = this.drmEngine_ ? this.drmEngine_.destroy() : Promise.resolve();\n this.drmEngine_ = null;\n this.manifest_ = null;\n this.storeInProgress_ = false;\n this.firstPeriodTracks_ = null;\n this.manifestId_ = -1;\n return ret;\n};\n\n\n/**\n * Calls createSegmentIndex for all streams in the manifest.\n *\n * @param {shakaExtern.Manifest} manifest\n * @return {!Promise}\n * @private\n */\nshaka.offline.Storage.prototype.createSegmentIndex_ = function(manifest) {\n var Functional = shaka.util.Functional;\n var streams = manifest.periods\n .map(function(period) { return period.variants; })\n .reduce(Functional.collapseArrays, [])\n .map(function(variant) {\n var variantStreams = [];\n if (variant.audio) variantStreams.push(variant.audio);\n if (variant.video) variantStreams.push(variant.video);\n return variantStreams;\n })\n .reduce(Functional.collapseArrays, [])\n .filter(Functional.isNotDuplicate);\n\n var textStreams = manifest.periods\n .map(function(period) { return period.textStreams; })\n .reduce(Functional.collapseArrays, []);\n\n streams.push.apply(streams, textStreams);\n return Promise.all(\n streams.map(function(stream) { return stream.createSegmentIndex(); }));\n};\n\n\n/**\n * Creates an offline 'manifest' for the real manifest. This does not store\n * the segments yet, only adds them to the download manager through\n * createPeriod_.\n *\n * @param {string} originalManifestUri\n * @param {!Object} appMetadata\n * @return {shakaExtern.ManifestDB}\n * @private\n */\nshaka.offline.Storage.prototype.createOfflineManifest_ = function(\n originalManifestUri, appMetadata) {\n var periods = this.manifest_.periods.map(this.createPeriod_.bind(this));\n var drmInfo = this.drmEngine_.getDrmInfo();\n var sessions = this.drmEngine_.getSessionIds();\n if (drmInfo) {\n if (!sessions.length) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL, shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.NO_INIT_DATA_FOR_OFFLINE, originalManifestUri);\n }\n // Don't store init data since we have stored sessions.\n drmInfo.initData = [];\n }\n\n return {\n key: this.manifestId_,\n originalManifestUri: originalManifestUri,\n duration: this.duration_,\n size: 0,\n expiration: this.drmEngine_.getExpiration(),\n periods: periods,\n sessionIds: sessions,\n drmInfo: drmInfo,\n appMetadata: appMetadata\n };\n};\n\n\n/**\n * Converts a manifest Period to a database Period. This will use the current\n * configuration to get the tracks to use, then it will search each segment\n * index and add all the segments to the download manager through createStream_.\n *\n * @param {shakaExtern.Period} period\n * @return {shakaExtern.PeriodDB}\n * @private\n */\nshaka.offline.Storage.prototype.createPeriod_ = function(period) {\n var StreamUtils = shaka.util.StreamUtils;\n\n var variantTracks = StreamUtils.getVariantTracks(period, null, null);\n var textTracks = StreamUtils.getTextTracks(period, null);\n var allTracks = variantTracks.concat(textTracks);\n\n var chosenTracks = this.config_.trackSelectionCallback(allTracks);\n\n if (this.firstPeriodTracks_ == null) {\n this.firstPeriodTracks_ = chosenTracks;\n // Now that the first tracks are chosen, filter again. This ensures all\n // Periods have compatible content types.\n this.manifest_.periods.forEach(this.filterPeriod_.bind(this));\n }\n\n for (var i = chosenTracks.length - 1; i > 0; --i) {\n var foundSimilarTracks = false;\n for (var j = i - 1; j >= 0; --j) {\n if (chosenTracks[i].type == chosenTracks[j].type &&\n chosenTracks[i].kind == chosenTracks[j].kind &&\n chosenTracks[i].language == chosenTracks[j].language) {\n shaka.log.warning(\n 'Multiple tracks of the same type/kind/language given.');\n foundSimilarTracks = true;\n break;\n }\n }\n if (foundSimilarTracks) break;\n }\n\n var streams = [];\n\n for (var i = 0; i < chosenTracks.length; i++) {\n var variant = StreamUtils.findVariantForTrack(period, chosenTracks[i]);\n if (variant) {\n // Make a rough estimation of the streams' bandwidth so download manager\n // can track the progress of the download.\n var bandwidthEstimation;\n if (variant.audio) {\n // If the audio stream has already been added to the DB\n // as part of another variant, add the ID to the list.\n // Otherwise, add it to the DB.\n var stream = streams.filter(function(s) {\n return s.id == variant.audio.id;\n })[0];\n if (stream) {\n stream.variantIds.push(variant.id);\n } else {\n // If variant has both audio and video, roughly estimate them\n // both to be 1/2 of the variant's bandwidth.\n // If variant only has one stream, it's bandwidth equals to\n // the bandwidth of the variant.\n bandwidthEstimation =\n variant.video ? variant.bandwidth / 2 : variant.bandwidth;\n streams.push(this.createStream_(period,\n variant.audio,\n bandwidthEstimation,\n variant.id));\n }\n }\n if (variant.video) {\n var stream = streams.filter(function(s) {\n return s.id == variant.video.id;\n })[0];\n if (stream) {\n stream.variantIds.push(variant.id);\n } else {\n bandwidthEstimation =\n variant.audio ? variant.bandwidth / 2 : variant.bandwidth;\n streams.push(this.createStream_(period,\n variant.video,\n bandwidthEstimation,\n variant.id));\n }\n }\n } else {\n var textStream =\n StreamUtils.findTextStreamForTrack(period, chosenTracks[i]);\n goog.asserts.assert(\n textStream, 'Could not find track with id ' + chosenTracks[i].id);\n streams.push(this.createStream_(\n period, textStream, 0 /* estimatedStreamBandwidth */));\n }\n }\n\n return {\n startTime: period.startTime,\n streams: streams\n };\n};\n\n\n/**\n * Converts a manifest stream to a database stream. This will search the\n * segment index and add all the segments to the download manager.\n *\n * @param {shakaExtern.Period} period\n * @param {shakaExtern.Stream} stream\n * @param {number} estimatedStreamBandwidth\n * @param {number=} opt_variantId\n * @return {shakaExtern.StreamDB}\n * @private\n */\nshaka.offline.Storage.prototype.createStream_ = function(\n period, stream, estimatedStreamBandwidth, opt_variantId) {\n /** @type {!Array.<shakaExtern.SegmentDB>} */\n var segmentsDb = [];\n var startTime =\n this.manifest_.presentationTimeline.getSegmentAvailabilityStart();\n var endTime = startTime;\n var i = stream.findSegmentPosition(startTime);\n var ref = (i != null ? stream.getSegmentReference(i) : null);\n while (ref) {\n var id = this.storageEngine_.reserveId('segment');\n var bandwidthSize =\n (ref.endTime - ref.startTime) * estimatedStreamBandwidth / 8;\n\n /** @type {shakaExtern.SegmentDataDB} */\n var segmentDataDb = {\n key: id,\n data: null,\n manifestKey: this.manifestId_,\n streamNumber: stream.id,\n segmentNumber: id\n };\n this.downloadManager_.addSegment(\n stream.type, ref, bandwidthSize, segmentDataDb);\n\n segmentsDb.push({\n startTime: ref.startTime,\n endTime: ref.endTime,\n uri: 'offline:' + this.manifestId_ + '/' + stream.id + '/' + id\n });\n\n endTime = ref.endTime + period.startTime;\n ref = stream.getSegmentReference(++i);\n }\n\n this.duration_ = Math.max(this.duration_, (endTime - startTime));\n var initUri = null;\n if (stream.initSegmentReference) {\n var id = this.storageEngine_.reserveId('segment');\n initUri = 'offline:' + this.manifestId_ + '/' + stream.id + '/' + id;\n\n /** @type {shakaExtern.SegmentDataDB} */\n var initDataDb = {\n key: id,\n data: null,\n manifestKey: this.manifestId_,\n streamNumber: stream.id,\n segmentNumber: -1\n };\n\n this.downloadManager_.addSegment(\n stream.contentType, stream.initSegmentReference, 0, initDataDb);\n }\n\n var variantIds = [];\n if (opt_variantId != null) variantIds.push(opt_variantId);\n\n return {\n id: stream.id,\n primary: stream.primary,\n presentationTimeOffset: stream.presentationTimeOffset || 0,\n contentType: stream.type,\n mimeType: stream.mimeType,\n codecs: stream.codecs,\n frameRate: stream.frameRate,\n kind: stream.kind,\n language: stream.language,\n label: stream.label,\n width: stream.width || null,\n height: stream.height || null,\n initSegmentUri: initUri,\n encrypted: stream.encrypted,\n keyId: stream.keyId,\n segments: segmentsDb,\n variantIds: variantIds\n };\n};\n\n\n/**\n * Throws an error if the object is destroyed.\n * @private\n */\nshaka.offline.Storage.prototype.checkDestroyed_ = function() {\n if (!this.player_) {\n throw new shaka.util.Error(\n shaka.util.Error.Severity.CRITICAL,\n shaka.util.Error.Category.STORAGE,\n shaka.util.Error.Code.OPERATION_ABORTED);\n }\n};\n\n\nshaka.Player.registerSupportPlugin('offline', shaka.offline.Storage.support);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/offline/storage.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.installAll');\ngoog.provide('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill\n * @summary A one-stop installer for all polyfills.\n * @see http://enwp.org/polyfill\n * @exportDoc\n */\n\n\n/**\n * Install all polyfills.\n * @export\n */\nshaka.polyfill.installAll = function() {\n for (var i = 0; i < shaka.polyfill.polyfills_.length; ++i) {\n shaka.polyfill.polyfills_[i]();\n }\n};\n\n\n/**\n * Contains the polyfills that will be installed.\n * @private {!Array.<function()>}\n */\nshaka.polyfill.polyfills_ = [];\n\n\n/**\n * Registers a new polyfill to be installed.\n *\n * @param {function()} polyfill\n * @export\n */\nshaka.polyfill.register = function(polyfill) {\n shaka.polyfill.polyfills_.push(polyfill);\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/all.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.Fullscreen');\n\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.Fullscreen\n *\n * @summary A polyfill to unify fullscreen APIs across browsers.\n * Many browsers have prefixed fullscreen methods on Element and document.\n * See {@link http://goo.gl/n7TYl0 Using fullscreen mode} on MDN for more\n * information.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.Fullscreen.install = function() {\n if (!window.Document) {\n // Avoid errors on very old browsers.\n return;\n }\n\n var proto = Element.prototype;\n proto.requestFullscreen = proto.requestFullscreen ||\n proto.mozRequestFullScreen ||\n proto.msRequestFullscreen ||\n proto.webkitRequestFullscreen;\n\n proto = Document.prototype;\n proto.exitFullscreen = proto.exitFullscreen ||\n proto.mozCancelFullScreen ||\n proto.msExitFullscreen ||\n proto.webkitExitFullscreen;\n\n if (!('fullscreenElement' in document)) {\n Object.defineProperty(document, 'fullscreenElement', {\n get: function() {\n return document.mozFullScreenElement ||\n document.msFullscreenElement ||\n document.webkitFullscreenElement;\n }\n });\n Object.defineProperty(document, 'fullscreenEnabled', {\n get: function() {\n return document.mozFullScreenEnabled ||\n document.msFullscreenEnabled ||\n document.webkitFullscreenEnabled;\n }\n });\n }\n\n var proxy = shaka.polyfill.Fullscreen.proxyEvent_;\n document.addEventListener('webkitfullscreenchange', proxy);\n document.addEventListener('webkitfullscreenerror', proxy);\n document.addEventListener('mozfullscreenchange', proxy);\n document.addEventListener('mozfullscreenerror', proxy);\n document.addEventListener('MSFullscreenChange', proxy);\n document.addEventListener('MSFullscreenError', proxy);\n};\n\n\n/**\n * Proxy fullscreen events after changing their name.\n * @param {!Event} event\n * @private\n */\nshaka.polyfill.Fullscreen.proxyEvent_ = function(event) {\n var eventType = event.type.replace(/^(webkit|moz|MS)/, '').toLowerCase();\n\n var newEvent;\n // IE 11 does not have an Event constructor\n if (typeof(Event) === 'function') {\n newEvent = new Event(eventType, /** @type {EventInit} */(event));\n } else {\n newEvent = document.createEvent('Event');\n newEvent.initEvent(eventType, event.bubbles, event.cancelable);\n }\n\n event.target.dispatchEvent(newEvent);\n};\n\n\nshaka.polyfill.register(shaka.polyfill.Fullscreen.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/fullscreen.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.util.Pssh');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.Mp4Parser');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n\n/**\n * Parse a PSSH box and extract the system IDs.\n *\n * @param {!Uint8Array} psshBox\n * @constructor\n * @struct\n * @throws {shaka.util.Error} if a PSSH box is truncated or contains a size\n * field over 53 bits.\n */\nshaka.util.Pssh = function(psshBox) {\n /**\n * In hex.\n * @type {!Array.<string>}\n */\n this.systemIds = [];\n\n /**\n * In hex.\n * @type {!Array.<string>}\n */\n this.cencKeyIds = [];\n\n /*\n * Array of tuples that define the startIndex + size for each\n * discrete pssh within |psshBox|\n * */\n this.dataBoundaries = [];\n\n new shaka.util.Mp4Parser()\n .fullBox('pssh', this.parseBox_.bind(this)).parse(psshBox.buffer);\n\n if (this.dataBoundaries.length == 0) {\n shaka.log.warning('No pssh box found!');\n }\n};\n\n\n/**\n * @param {!shaka.util.Mp4Parser.ParsedBox} box\n * @private\n */\nshaka.util.Pssh.prototype.parseBox_ = function(box) {\n goog.asserts.assert(\n box.version != null,\n 'PSSH boxes are full boxes and must have a valid version');\n\n goog.asserts.assert(\n box.flags != null,\n 'PSSH boxes are full boxes and must have a valid flag');\n\n if (box.version > 1) {\n shaka.log.warning('Unrecognized PSSH version found!');\n return;\n }\n\n var systemId = shaka.util.Uint8ArrayUtils.toHex(box.reader.readBytes(16));\n var keyIds = [];\n if (box.version > 0) {\n var numKeyIds = box.reader.readUint32();\n for (var i = 0; i < numKeyIds; ++i) {\n var keyId = shaka.util.Uint8ArrayUtils.toHex(box.reader.readBytes(16));\n keyIds.push(keyId);\n }\n }\n\n var dataSize = box.reader.readUint32();\n box.reader.skip(dataSize); // Ignore the data section.\n\n // Now that everything has been succesfully parsed from this box,\n // update member variables.\n this.cencKeyIds.push.apply(this.cencKeyIds, keyIds);\n this.systemIds.push(systemId);\n this.dataBoundaries.push({\n start: box.start,\n end: box.start + box.size - 1\n });\n\n if (box.reader.getPosition() != box.reader.getLength()) {\n shaka.log.warning('Mismatch between box size and data size!');\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/util/pssh.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.PatchedMediaKeysMs');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.ArrayUtils');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.Pssh');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * Install a polyfill to implement {@link http://goo.gl/blgtZZ EME draft\n * 12 March 2015} on top of ms-prefixed\n * {@link http://www.w3.org/TR/2014/WD-encrypted-media-20140218/ EME v20140218}.\n */\nshaka.polyfill.PatchedMediaKeysMs.install = function() {\n shaka.log.debug('PatchedMediaKeysMs.install');\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n // Construct fake key ID. This is not done at load-time to avoid exceptions\n // on unsupported browsers. This particular fake key ID was suggested in\n // w3c/encrypted-media#32.\n PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_ = (new Uint8Array([0])).buffer;\n\n // Delete mediaKeys to work around strict mode compatibility issues.\n delete HTMLMediaElement.prototype['mediaKeys'];\n // Work around read-only declaration for mediaKeys by using a string.\n HTMLMediaElement.prototype['mediaKeys'] = null;\n HTMLMediaElement.prototype.setMediaKeys = PatchedMediaKeysMs.setMediaKeys;\n\n // Install patches\n window.MediaKeys = PatchedMediaKeysMs.MediaKeys;\n window.MediaKeySystemAccess = PatchedMediaKeysMs.MediaKeySystemAccess;\n navigator.requestMediaKeySystemAccess =\n PatchedMediaKeysMs.requestMediaKeySystemAccess;\n};\n\n\n/**\n * An implementation of navigator.requestMediaKeySystemAccess.\n * Retrieve a MediaKeySystemAccess object.\n *\n * @this {!Navigator}\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @return {!Promise.<!MediaKeySystemAccess>}\n */\nshaka.polyfill.PatchedMediaKeysMs.requestMediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysMs.requestMediaKeySystemAccess');\n goog.asserts.assert(this == navigator,\n 'bad \"this\" for requestMediaKeySystemAccess');\n\n // Alias.\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n try {\n var access = new PatchedMediaKeysMs.MediaKeySystemAccess(\n keySystem, supportedConfigurations);\n return Promise.resolve(/** @type {!MediaKeySystemAccess} */ (access));\n } catch (exception) {\n return Promise.reject(exception);\n }\n};\n\n\n\n/**\n * An implementation of MediaKeySystemAccess.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @implements {MediaKeySystemAccess}\n * @throws {Error} if the key system is not supported.\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySystemAccess');\n\n /** @type {string} */\n this.keySystem = keySystem;\n\n /** @private {!MediaKeySystemConfiguration} */\n this.configuration_;\n\n var allowPersistentState = true;\n\n var success = false;\n for (var i = 0; i < supportedConfigurations.length; ++i) {\n var cfg = supportedConfigurations[i];\n\n // Create a new config object and start adding in the pieces which we\n // find support for. We will return this from getConfiguration() if\n // asked.\n /** @type {!MediaKeySystemConfiguration} */\n var newCfg = {\n 'audioCapabilities': [],\n 'videoCapabilities': [],\n // It is technically against spec to return these as optional, but we\n // don't truly know their values from the prefixed API:\n 'persistentState': 'optional',\n 'distinctiveIdentifier': 'optional',\n // Pretend the requested init data types are supported, since we don't\n // really know that either:\n 'initDataTypes': cfg.initDataTypes,\n 'sessionTypes': ['temporary'],\n 'label': cfg.label\n };\n\n // PatchedMediaKeysMs tests for key system availability through\n // MSMediaKeys.isTypeSupported\n var ranAnyTests = false;\n if (cfg.audioCapabilities) {\n for (var j = 0; j < cfg.audioCapabilities.length; ++j) {\n var cap = cfg.audioCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n var contentType = cap.contentType.split(';')[0];\n if (MSMediaKeys.isTypeSupported(this.keySystem, contentType)) {\n newCfg.audioCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n if (cfg.videoCapabilities) {\n for (var j = 0; j < cfg.videoCapabilities.length; ++j) {\n var cap = cfg.videoCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n var contentType = cap.contentType.split(';')[0];\n if (MSMediaKeys.isTypeSupported(this.keySystem, contentType)) {\n newCfg.videoCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n\n if (!ranAnyTests) {\n // If no specific types were requested, we check all common types to find\n // out if the key system is present at all.\n success = MSMediaKeys.isTypeSupported(this.keySystem, 'video/mp4');\n }\n if (cfg.persistentState == 'required') {\n if (allowPersistentState) {\n newCfg.persistentState = 'required';\n newCfg.sessionTypes = ['persistent-license'];\n } else {\n success = false;\n }\n }\n\n if (success) {\n this.configuration_ = newCfg;\n return;\n }\n } // for each cfg in supportedConfigurations\n\n // As per the spec, this should be a DOMException, but\n // there is not a public constructor for this\n var unsupportedKeySystemError = new Error('Unsupported keySystem');\n unsupportedKeySystemError.name = 'NotSupportedError';\n unsupportedKeySystemError.code = DOMException.NOT_SUPPORTED_ERR;\n throw unsupportedKeySystemError;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.\n createMediaKeys = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySystemAccess.createMediaKeys');\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n var mediaKeys = new PatchedMediaKeysMs.MediaKeys(this.keySystem);\n return Promise.resolve(/** @type {!MediaKeys} */ (mediaKeys));\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySystemAccess.prototype.\n getConfiguration = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySystemAccess.getConfiguration');\n return this.configuration_;\n};\n\n\n/**\n * An implementation of HTMLMediaElement.prototype.setMediaKeys.\n * Attach a MediaKeys object to the media element.\n *\n * @this {!HTMLMediaElement}\n * @param {MediaKeys} mediaKeys\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysMs.setMediaKeys = function(mediaKeys) {\n shaka.log.debug('PatchedMediaKeysMs.setMediaKeys');\n goog.asserts.assert(this instanceof HTMLMediaElement,\n 'bad \"this\" for setMediaKeys');\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n var newMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysMs.MediaKeys} */ (\n mediaKeys);\n var oldMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysMs.MediaKeys} */ (\n this.mediaKeys);\n\n if (oldMediaKeys && oldMediaKeys != newMediaKeys) {\n goog.asserts.assert(oldMediaKeys instanceof PatchedMediaKeysMs.MediaKeys,\n 'non-polyfill instance of oldMediaKeys');\n // Have the old MediaKeys stop listening to events on the video tag.\n oldMediaKeys.setMedia(null);\n }\n\n delete this['mediaKeys']; // in case there is an existing getter\n this['mediaKeys'] = mediaKeys; // work around read-only declaration\n\n if (newMediaKeys) {\n goog.asserts.assert(newMediaKeys instanceof PatchedMediaKeysMs.MediaKeys,\n 'non-polyfill instance of newMediaKeys');\n return newMediaKeys.setMedia(this);\n }\n\n return Promise.resolve();\n};\n\n\n\n/**\n * An implementation of MediaKeys.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @implements {MediaKeys}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys = function(keySystem) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeys');\n\n /** @private {!MSMediaKeys} */\n this.nativeMediaKeys_ = new MSMediaKeys(keySystem);\n\n /** @private {!shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.\n createSession = function(opt_sessionType) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeys.createSession');\n\n var sessionType = opt_sessionType || 'temporary';\n // For now, only 'temporary' type is supported\n if (sessionType != 'temporary') {\n throw new TypeError('Session type ' + opt_sessionType +\n ' is unsupported on this platform.');\n }\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n return new PatchedMediaKeysMs.MediaKeySession(\n this.nativeMediaKeys_, sessionType);\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.\n setServerCertificate = function(serverCertificate) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeys.setServerCertificate');\n\n // There is no equivalent in PatchedMediaKeysMs, so return failure.\n return Promise.resolve(false);\n};\n\n\n/**\n * @param {HTMLMediaElement} media\n * @protected\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeys.prototype.\n setMedia = function(media) {\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n // Remove any old listeners.\n this.eventManager_.removeAll();\n\n // It is valid for media to be null, it's used to flag that event handlers\n // need to be cleaned up\n if (!media) {\n return Promise.resolve();\n }\n\n // Intercept and translate these prefixed EME events.\n this.eventManager_.listen(media, 'msneedkey',\n /** @type {shaka.util.EventManager.ListenerType} */\n (PatchedMediaKeysMs.onMsNeedKey_));\n\n var self = this;\n function setMediaKeysDeferred() {\n media.msSetMediaKeys(self.nativeMediaKeys_);\n media.removeEventListener('loadedmetadata', setMediaKeysDeferred);\n }\n\n // Wrap native HTMLMediaElement.msSetMediaKeys with Promise\n try {\n // IE11/Edge requires that readyState >=1 before mediaKeys can be set, so\n // check this and wait for loadedmetadata if we are not in the correct state\n if (media.readyState >= 1) {\n media.msSetMediaKeys(this.nativeMediaKeys_);\n } else {\n media.addEventListener('loadedmetadata', setMediaKeysDeferred);\n }\n\n return Promise.resolve();\n\n } catch (exception) {\n return Promise.reject(exception);\n }\n};\n\n\n\n/**\n * An implementation of MediaKeySession.\n *\n * @constructor\n * @struct\n * @param {MSMediaKeys} nativeMediaKeys\n * @param {string} sessionType\n * @implements {MediaKeySession}\n * @extends {shaka.util.FakeEventTarget}\n */\nshaka.polyfill.PatchedMediaKeysMs.\n MediaKeySession = function(nativeMediaKeys, sessionType) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession');\n shaka.util.FakeEventTarget.call(this);\n\n // Native MediaKeySession, which will be created in generateRequest\n /** @private {MSMediaKeySession} */\n this.nativeMediaKeySession_ = null;\n\n /** @private {MSMediaKeys} */\n this.nativeMediaKeys_ = nativeMediaKeys;\n\n // Promises that are resolved later\n /** @private {Promise} */\n this.generateRequestPromise_ = null;\n\n /** @private {Promise} */\n this.updatePromise_ = null;\n\n /** @private {!shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /** @type {string} */\n this.sessionId = '';\n\n /** @type {number} */\n this.expiration = NaN;\n\n /** @type {!shaka.util.PublicPromise} */\n this.closed = new shaka.util.PublicPromise();\n\n /** @type {!MediaKeyStatusMap} */\n this.keyStatuses =\n new shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap();\n};\ngoog.inherits(shaka.polyfill.PatchedMediaKeysMs.MediaKeySession,\n shaka.util.FakeEventTarget);\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n generateRequest = function(initDataType, initData) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.generateRequest');\n\n this.generateRequestPromise_ = new shaka.util.PublicPromise();\n\n try {\n // This EME spec version requires a MIME content type as the 1st param\n // to createSession, but doesn't seem to matter what the value is.\n\n // NOTE: IE11 takes either Uint8Array or ArrayBuffer, but Edge 12 only\n // accepts Uint8Array.\n this.nativeMediaKeySession_ = this.nativeMediaKeys_\n .createSession('video/mp4', new Uint8Array(initData), null);\n\n // Attach session event handlers here\n this.eventManager_.listen(this.nativeMediaKeySession_, 'mskeymessage',\n /** @type {shaka.util.EventManager.ListenerType} */\n (this.onMsKeyMessage_.bind(this)));\n this.eventManager_.listen(this.nativeMediaKeySession_, 'mskeyadded',\n /** @type {shaka.util.EventManager.ListenerType} */\n (this.onMsKeyAdded_.bind(this)));\n this.eventManager_.listen(this.nativeMediaKeySession_, 'mskeyerror',\n /** @type {shaka.util.EventManager.ListenerType} */\n (this.onMsKeyError_.bind(this)));\n\n this.updateKeyStatus_('status-pending');\n } catch (exception) {\n this.generateRequestPromise_.reject(exception);\n }\n\n return this.generateRequestPromise_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n load = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.load');\n\n return Promise.reject(new Error('MediaKeySession.load not yet supported'));\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n update = function(response) {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.update');\n\n this.updatePromise_ = new shaka.util.PublicPromise();\n\n try {\n // Pass through to the native session.\n // NOTE: IE11 takes either Uint8Array or ArrayBuffer, but Edge 12 only\n // accepts Uint8Array.\n this.nativeMediaKeySession_.update(new Uint8Array(response));\n } catch (exception) {\n this.updatePromise_.reject(exception);\n }\n\n return this.updatePromise_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n close = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.close');\n\n try {\n // Pass through to the native session\n // NOTE: IE seems to have spec discrepancy here - v2010218 should have\n // MediaKeySession.release, but actually uses \"close\". The next version\n // of the spec is the initial Promise based one, so it's not the target spec\n // either.\n this.nativeMediaKeySession_.close();\n\n this.closed.resolve();\n this.eventManager_.removeAll();\n } catch (exception) {\n this.closed.reject(exception);\n }\n\n return this.closed;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n remove = function() {\n shaka.log.debug('PatchedMediaKeysMs.MediaKeySession.remove');\n\n return Promise.reject(new Error('MediaKeySession.remove is only ' +\n 'applicable for persistent licenses, which are not supported on ' +\n 'this platform'));\n};\n\n\n/**\n * Handler for the native media elements msNeedKey event.\n *\n * @this {!HTMLMediaElement}\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.onMsNeedKey_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsNeedKey_', event);\n\n // Alias\n var PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;\n\n // NOTE: Because \"this\" is a real EventTarget, on IE, the event we dispatch\n // here must also be a real Event.\n var event2 = /** @type {!CustomEvent} */(document.createEvent('CustomEvent'));\n event2.initCustomEvent('encrypted', false, false, null);\n event2.initDataType = 'cenc';\n event2.initData = PatchedMediaKeysMs.NormaliseInitData_(event.initData);\n\n this.dispatchEvent(event2);\n};\n\n\n/**\n * Normalise the initData array. This is to apply browser specific work-arounds,\n * e.g. removing duplicates which appears to occur intermittently when the\n * native msneedkey event fires (i.e. event.initData contains dupes).\n *\n * @param {?Uint8Array} initData\n * @private\n * @return {?Uint8Array}\n */\nshaka.polyfill.PatchedMediaKeysMs.\n NormaliseInitData_ = function(initData) {\n if (!initData) {\n return initData;\n }\n\n var pssh = new shaka.util.Pssh(initData);\n\n // If there is only a single pssh, return the original array\n if (pssh.dataBoundaries.length <= 1) {\n return initData;\n }\n\n var unfilteredInitDatas = [];\n for (var i = 0; i < pssh.dataBoundaries.length; i++) {\n var currPssh = initData.subarray(\n pssh.dataBoundaries[i].start,\n pssh.dataBoundaries[i].end + 1); // end is exclusive, hence the +1\n\n unfilteredInitDatas.push(currPssh);\n }\n\n // Dedupe psshData\n var dedupedInitDatas = shaka.util.ArrayUtils.removeDuplicates(\n unfilteredInitDatas,\n shaka.polyfill.PatchedMediaKeysMs.compareInitDatas_);\n\n var targetLength = 0;\n for (var i = 0; i < dedupedInitDatas.length; i++) {\n targetLength += dedupedInitDatas[i].length;\n }\n\n // Concat array of Uint8Arrays back into a single Uint8Array\n var normalisedInitData = new Uint8Array(targetLength);\n var offset = 0;\n for (var i = 0; i < dedupedInitDatas.length; i++) {\n normalisedInitData.set(dedupedInitDatas[i], offset);\n offset += dedupedInitDatas[i].length;\n }\n\n return normalisedInitData;\n};\n\n\n/**\n * @param {!Uint8Array} initDataA\n * @param {!Uint8Array} initDataB\n * @return {boolean}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.compareInitDatas_ =\n function(initDataA, initDataB) {\n return shaka.util.Uint8ArrayUtils.equal(initDataA, initDataB);\n};\n\n\n/**\n * Handler for the native keymessage event on MSMediaKeySession.\n *\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n onMsKeyMessage_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsKeyMessage_', event);\n\n // We can now resolve this.generateRequestPromise (it should be non-null)\n goog.asserts.assert(this.generateRequestPromise_,\n 'generateRequestPromise_ not set in onMsKeyMessage_');\n if (this.generateRequestPromise_) {\n this.generateRequestPromise_.resolve();\n this.generateRequestPromise_ = null;\n }\n\n var isNew = this.keyStatuses.getStatus() == undefined;\n\n var event2 = new shaka.util.FakeEvent('message', {\n messageType: isNew ? 'licenserequest' : 'licenserenewal',\n message: event.message.buffer\n });\n\n this.dispatchEvent(event2);\n};\n\n\n/**\n * Handler for the native keyadded event on MSMediaKeySession.\n *\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n onMsKeyAdded_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsKeyAdded_', event);\n\n // PlayReady's concept of persistent licenses makes emulation difficult here.\n // A license policy can say that the license persists, which causes the CDM to\n // store it for use in a later session. The result is that in IE11, the CDM\n // fires 'mskeyadded' without ever firing 'mskeymessage'.\n if (this.generateRequestPromise_) {\n shaka.log.debug('Simulating completion for a PR persistent license.');\n goog.asserts.assert(!this.updatePromise_,\n 'updatePromise_ and generateRequestPromise_ set in onMsKeyAdded_');\n this.updateKeyStatus_('usable');\n this.generateRequestPromise_.resolve();\n this.generateRequestPromise_ = null;\n return;\n }\n\n // We can now resolve this.updatePromise (it should be non-null)\n goog.asserts.assert(this.updatePromise_,\n 'updatePromise_ not set in onMsKeyAdded_');\n if (this.updatePromise_) {\n this.updateKeyStatus_('usable');\n this.updatePromise_.resolve();\n this.updatePromise_ = null;\n }\n};\n\n\n/**\n * Handler for the native keyerror event on MSMediaKeySession.\n *\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n onMsKeyError_ = function(event) {\n shaka.log.debug('PatchedMediaKeysMs.onMsKeyError_', event);\n\n var error = new Error('EME PatchedMediaKeysMs key error');\n error.errorCode = this.nativeMediaKeySession_.error;\n\n if (this.generateRequestPromise_ != null) {\n this.generateRequestPromise_.reject(error);\n this.generateRequestPromise_ = null;\n } else if (this.updatePromise_ != null) {\n this.updatePromise_.reject(error);\n this.updatePromise_ = null;\n } else {\n /*\n Unexpected error - map native codes to standardised key statuses.\n Possible values of this.nativeMediaKeySession_.error.code\n\n MS_MEDIA_KEYERR_UNKNOWN = 1\n MS_MEDIA_KEYERR_CLIENT = 2\n MS_MEDIA_KEYERR_SERVICE = 3\n MS_MEDIA_KEYERR_OUTPUT = 4\n MS_MEDIA_KEYERR_HARDWARECHANGE = 5\n MS_MEDIA_KEYERR_DOMAIN = 6\n */\n\n switch (this.nativeMediaKeySession_.error.code) {\n case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:\n case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:\n this.updateKeyStatus_('output-not-allowed');\n default:\n this.updateKeyStatus_('internal-error');\n }\n }\n};\n\n\n/**\n * Update key status and dispatch a 'keystatuseschange' event.\n *\n * @param {string} status\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.\n updateKeyStatus_ = function(status) {\n this.keyStatuses.setStatus(status);\n var event = new shaka.util.FakeEvent('keystatuseschange');\n this.dispatchEvent(event);\n};\n\n\n\n/**\n * An implementation of MediaKeyStatusMap.\n * This fakes a map with a single key ID.\n *\n * @constructor\n * @struct\n * @implements {MediaKeyStatusMap}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap = function() {\n /**\n * @type {number}\n */\n this.size = 0;\n\n /**\n * @private {string|undefined}\n */\n this.status_ = undefined;\n};\n\n\n/**\n * @const {!ArrayBuffer}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_;\n\n\n/**\n * An internal method used by the session to set key status.\n * @param {string|undefined} status\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n setStatus = function(status) {\n this.size = status == undefined ? 0 : 1;\n this.status_ = status;\n};\n\n\n/**\n * An internal method used by the session to get key status.\n * @return {string|undefined}\n */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n getStatus = function() {\n return this.status_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n forEach = function(fn) {\n if (this.status_) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_;\n fn(this.status_, fakeKeyId);\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n get = function(keyId) {\n if (this.has(keyId)) {\n return this.status_;\n }\n return undefined;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n has = function(keyId) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.KEY_ID_;\n if (this.status_ &&\n shaka.util.Uint8ArrayUtils.equal(\n new Uint8Array(keyId), new Uint8Array(fakeKeyId))) {\n return true;\n }\n return false;\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n entries = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n keys = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype.\n values = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/patchedmediakeys_ms.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.PatchedMediaKeysNop');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\n\n\n/**\n * Install a polyfill to stub out {@link http://goo.gl/blgtZZ EME draft\n * 12 March 2015} on browsers without EME. All methods will fail.\n */\nshaka.polyfill.PatchedMediaKeysNop.install = function() {\n shaka.log.debug('PatchedMediaKeysNop.install');\n\n // Alias.\n var PatchedMediaKeysNop = shaka.polyfill.PatchedMediaKeysNop;\n\n // Install patches.\n navigator.requestMediaKeySystemAccess =\n PatchedMediaKeysNop.requestMediaKeySystemAccess;\n // Delete mediaKeys to work around strict mode compatibility issues.\n delete HTMLMediaElement.prototype['mediaKeys'];\n // Work around read-only declaration for mediaKeys by using a string.\n HTMLMediaElement.prototype['mediaKeys'] = null;\n HTMLMediaElement.prototype.setMediaKeys = PatchedMediaKeysNop.setMediaKeys;\n // These are not usable, but allow Player.isBrowserSupported to pass.\n window.MediaKeys = PatchedMediaKeysNop.MediaKeys;\n window.MediaKeySystemAccess = PatchedMediaKeysNop.MediaKeySystemAccess;\n};\n\n\n/**\n * An implementation of navigator.requestMediaKeySystemAccess.\n * Retrieve a MediaKeySystemAccess object.\n *\n * @this {!Navigator}\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @return {!Promise.<!MediaKeySystemAccess>}\n */\nshaka.polyfill.PatchedMediaKeysNop.requestMediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysNop.requestMediaKeySystemAccess');\n goog.asserts.assert(this == navigator,\n 'bad \"this\" for requestMediaKeySystemAccess');\n\n\n return Promise.reject(new Error(\n 'The key system specified is not supported.'));\n};\n\n\n/**\n * An implementation of HTMLMediaElement.prototype.setMediaKeys.\n * Attach a MediaKeys object to the media element.\n *\n * @this {!HTMLMediaElement}\n * @param {MediaKeys} mediaKeys\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysNop.setMediaKeys = function(mediaKeys) {\n shaka.log.debug('PatchedMediaKeysNop.setMediaKeys');\n goog.asserts.assert(this instanceof HTMLMediaElement,\n 'bad \"this\" for setMediaKeys');\n\n if (mediaKeys == null) {\n return Promise.resolve();\n }\n\n return Promise.reject(new Error('MediaKeys not supported.'));\n};\n\n\n\n/**\n * An unusable constructor for MediaKeys.\n * @constructor\n * @struct\n * @implements {MediaKeys}\n */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeys = function() {\n throw new TypeError('Illegal constructor.');\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.createSession =\n function() {};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeys.prototype.setServerCertificate =\n function() {};\n\n\n\n/**\n * An unusable constructor for MediaKeySystemAccess.\n * @constructor\n * @struct\n * @implements {MediaKeySystemAccess}\n */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess = function() {\n throw new TypeError('Illegal constructor.');\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.\n getConfiguration = function() {};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.\n createMediaKeys = function() {};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess.prototype.\n keySystem;\n\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/patchedmediakeys_nop.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.PatchedMediaKeysWebkit');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.util.EventManager');\ngoog.require('shaka.util.FakeEvent');\ngoog.require('shaka.util.FakeEventTarget');\ngoog.require('shaka.util.PublicPromise');\ngoog.require('shaka.util.StringUtils');\ngoog.require('shaka.util.Uint8ArrayUtils');\n\n\n/**\n * Store api prefix.\n *\n * @private {string}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.prefix_ = '';\n\n\n/**\n * Install a polyfill to implement {@link http://goo.gl/blgtZZ EME draft\n * 12 March 2015} on top of webkit-prefixed\n * {@link http://goo.gl/FSpoAo EME v0.1b}.\n *\n * @param {string} prefix\n */\nshaka.polyfill.PatchedMediaKeysWebkit.install = function(prefix) {\n shaka.log.debug('PatchedMediaKeysWebkit.install');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n PatchedMediaKeysWebkit.prefix_ = prefix;\n var prefixApi = PatchedMediaKeysWebkit.prefixApi_;\n\n goog.asserts.assert(\n HTMLMediaElement.prototype[prefixApi('generateKeyRequest')],\n 'PatchedMediaKeysWebkit APIs not available!');\n\n // Construct fake key ID. This is not done at load-time to avoid exceptions\n // on unsupported browsers. This particular fake key ID was suggested in\n // w3c/encrypted-media#32.\n PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_ =\n (new Uint8Array([0])).buffer;\n\n // Install patches.\n navigator.requestMediaKeySystemAccess =\n PatchedMediaKeysWebkit.requestMediaKeySystemAccess;\n // Delete mediaKeys to work around strict mode compatibility issues.\n delete HTMLMediaElement.prototype['mediaKeys'];\n // Work around read-only declaration for mediaKeys by using a string.\n HTMLMediaElement.prototype['mediaKeys'] = null;\n HTMLMediaElement.prototype.setMediaKeys = PatchedMediaKeysWebkit.setMediaKeys;\n window.MediaKeys = PatchedMediaKeysWebkit.MediaKeys;\n window.MediaKeySystemAccess = PatchedMediaKeysWebkit.MediaKeySystemAccess;\n};\n\n\n/**\n * Prefix api by stored prefix.\n *\n * @param {string} api\n * @return {string}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.prefixApi_ = function(api) {\n var prefix = shaka.polyfill.PatchedMediaKeysWebkit.prefix_;\n if (prefix) {\n return prefix + api.charAt(0).toUpperCase() + api.slice(1);\n }\n return api;\n};\n\n\n/**\n * An implementation of navigator.requestMediaKeySystemAccess.\n * Retrieve a MediaKeySystemAccess object.\n *\n * @this {!Navigator}\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @return {!Promise.<!MediaKeySystemAccess>}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.requestMediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysWebkit.requestMediaKeySystemAccess');\n goog.asserts.assert(this == navigator,\n 'bad \"this\" for requestMediaKeySystemAccess');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n try {\n var access = new PatchedMediaKeysWebkit.MediaKeySystemAccess(\n keySystem, supportedConfigurations);\n return Promise.resolve(/** @type {!MediaKeySystemAccess} */ (access));\n } catch (exception) {\n return Promise.reject(exception);\n }\n};\n\n\n/**\n * An implementation of HTMLMediaElement.prototype.setMediaKeys.\n * Attach a MediaKeys object to the media element.\n *\n * @this {!HTMLMediaElement}\n * @param {MediaKeys} mediaKeys\n * @return {!Promise}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.setMediaKeys = function(mediaKeys) {\n shaka.log.debug('PatchedMediaKeysWebkit.setMediaKeys');\n goog.asserts.assert(this instanceof HTMLMediaElement,\n 'bad \"this\" for setMediaKeys');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n\n var newMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys} */ (\n mediaKeys);\n var oldMediaKeys =\n /** @type {shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys} */ (\n this.mediaKeys);\n\n if (oldMediaKeys && oldMediaKeys != newMediaKeys) {\n goog.asserts.assert(\n oldMediaKeys instanceof PatchedMediaKeysWebkit.MediaKeys,\n 'non-polyfill instance of oldMediaKeys');\n // Have the old MediaKeys stop listening to events on the video tag.\n oldMediaKeys.setMedia(null);\n }\n\n delete this['mediaKeys']; // in case there is an existing getter\n this['mediaKeys'] = mediaKeys; // work around read-only declaration\n\n if (newMediaKeys) {\n goog.asserts.assert(\n newMediaKeys instanceof PatchedMediaKeysWebkit.MediaKeys,\n 'non-polyfill instance of newMediaKeys');\n newMediaKeys.setMedia(this);\n }\n\n return Promise.resolve();\n};\n\n\n/**\n * For some of this polyfill's implementation, we need to query a video element.\n * But for some embedded systems, it is memory-expensive to create multiple\n * video elements. Therefore, we check the document to see if we can borrow one\n * to query before we fall back to creating one temporarily.\n *\n * @return {!HTMLVideoElement}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.getVideoElement_ = function() {\n var videos = document.getElementsByTagName('video');\n var tmpVideo = videos.length ? videos[0] : document.createElement('video');\n return /** @type {!HTMLVideoElement} */(tmpVideo);\n};\n\n\n\n/**\n * An implementation of MediaKeySystemAccess.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @param {!Array.<!MediaKeySystemConfiguration>} supportedConfigurations\n * @implements {MediaKeySystemAccess}\n * @throws {Error} if the key system is not supported.\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess =\n function(keySystem, supportedConfigurations) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySystemAccess');\n\n /** @type {string} */\n this.keySystem = keySystem;\n\n /** @private {string} */\n this.internalKeySystem_ = keySystem;\n\n /** @private {!MediaKeySystemConfiguration} */\n this.configuration_;\n\n // This is only a guess, since we don't really know from the prefixed API.\n var allowPersistentState = true;\n\n if (keySystem == 'org.w3.clearkey') {\n // ClearKey's string must be prefixed in v0.1b.\n this.internalKeySystem_ = 'webkit-org.w3.clearkey';\n // ClearKey doesn't support persistence.\n allowPersistentState = false;\n }\n\n var success = false;\n var tmpVideo = shaka.polyfill.PatchedMediaKeysWebkit.getVideoElement_();\n for (var i = 0; i < supportedConfigurations.length; ++i) {\n var cfg = supportedConfigurations[i];\n\n // Create a new config object and start adding in the pieces which we\n // find support for. We will return this from getConfiguration() if\n // asked.\n /** @type {!MediaKeySystemConfiguration} */\n var newCfg = {\n 'audioCapabilities': [],\n 'videoCapabilities': [],\n // It is technically against spec to return these as optional, but we\n // don't truly know their values from the prefixed API:\n 'persistentState': 'optional',\n 'distinctiveIdentifier': 'optional',\n // Pretend the requested init data types are supported, since we don't\n // really know that either:\n 'initDataTypes': cfg.initDataTypes,\n 'sessionTypes': ['temporary'],\n 'label': cfg.label\n };\n\n // v0.1b tests for key system availability with an extra argument on\n // canPlayType.\n var ranAnyTests = false;\n if (cfg.audioCapabilities) {\n for (var j = 0; j < cfg.audioCapabilities.length; ++j) {\n var cap = cfg.audioCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n // In Chrome <= 40, if you ask about Widevine-encrypted audio support,\n // you get a false-negative when you specify codec information.\n // Work around this by stripping codec info for audio types.\n var contentType = cap.contentType.split(';')[0];\n if (tmpVideo.canPlayType(contentType, this.internalKeySystem_)) {\n newCfg.audioCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n if (cfg.videoCapabilities) {\n for (var j = 0; j < cfg.videoCapabilities.length; ++j) {\n var cap = cfg.videoCapabilities[j];\n if (cap.contentType) {\n ranAnyTests = true;\n if (tmpVideo.canPlayType(cap.contentType, this.internalKeySystem_)) {\n newCfg.videoCapabilities.push(cap);\n success = true;\n }\n }\n }\n }\n\n if (!ranAnyTests) {\n // If no specific types were requested, we check all common types to find\n // out if the key system is present at all.\n success = tmpVideo.canPlayType('video/mp4', this.internalKeySystem_) ||\n tmpVideo.canPlayType('video/webm', this.internalKeySystem_);\n }\n if (cfg.persistentState == 'required') {\n if (allowPersistentState) {\n newCfg.persistentState = 'required';\n newCfg.sessionTypes = ['persistent-license'];\n } else {\n success = false;\n }\n }\n\n if (success) {\n this.configuration_ = newCfg;\n return;\n }\n } // for each cfg in supportedConfigurations\n\n var message = 'Unsupported keySystem';\n if (keySystem == 'org.w3.clearkey' || keySystem == 'com.widevine.alpha') {\n message = 'None of the requested configurations were supported.';\n }\n var unsupportedError = new Error(message);\n unsupportedError.name = 'NotSupportedError';\n unsupportedError.code = DOMException.NOT_SUPPORTED_ERR;\n throw unsupportedError;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.\n createMediaKeys = function() {\n shaka.log.debug(\n 'PatchedMediaKeysWebkit.MediaKeySystemAccess.createMediaKeys');\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n var mediaKeys = new PatchedMediaKeysWebkit.MediaKeys(this.internalKeySystem_);\n return Promise.resolve(/** @type {!MediaKeys} */ (mediaKeys));\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySystemAccess.prototype.\n getConfiguration = function() {\n shaka.log.debug(\n 'PatchedMediaKeysWebkit.MediaKeySystemAccess.getConfiguration');\n return this.configuration_;\n};\n\n\n\n/**\n * An implementation of MediaKeys.\n *\n * @constructor\n * @struct\n * @param {string} keySystem\n * @implements {MediaKeys}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys = function(keySystem) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys');\n\n /** @private {string} */\n this.keySystem_ = keySystem;\n\n /** @private {HTMLMediaElement} */\n this.media_ = null;\n\n /** @private {!shaka.util.EventManager} */\n this.eventManager_ = new shaka.util.EventManager();\n\n /**\n * @private {!Array.<!shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession>}\n */\n this.newSessions_ = [];\n\n /**\n * @private {!Object.<string,\n * !shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession>}\n */\n this.sessionMap_ = {};\n};\n\n\n/**\n * @param {HTMLMediaElement} media\n * @protected\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setMedia =\n function(media) {\n this.media_ = media;\n\n // Remove any old listeners.\n this.eventManager_.removeAll();\n\n var prefix = shaka.polyfill.PatchedMediaKeysWebkit.prefix_;\n if (media) {\n // Intercept and translate these prefixed EME events.\n this.eventManager_.listen(media, prefix + 'needkey',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitNeedKey_.bind(this)));\n\n this.eventManager_.listen(media, prefix + 'keymessage',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitKeyMessage_.bind(this)));\n\n this.eventManager_.listen(media, prefix + 'keyadded',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitKeyAdded_.bind(this)));\n\n this.eventManager_.listen(media, prefix + 'keyerror',\n /** @type {shaka.util.EventManager.ListenerType} */ (\n this.onWebkitKeyError_.bind(this)));\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.createSession =\n function(opt_sessionType) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.createSession');\n\n var sessionType = opt_sessionType || 'temporary';\n // TODO: Consider adding support for persistent-release once Chrome has\n // implemented it natively. http://crbug.com/448888\n // This is a non-issue if we've deprecated the polyfill by then, since\n // prefixed EME is on its way out.\n if (sessionType != 'temporary' && sessionType != 'persistent-license') {\n throw new TypeError('Session type ' + opt_sessionType +\n ' is unsupported on this platform.');\n }\n\n // Alias.\n var PatchedMediaKeysWebkit = shaka.polyfill.PatchedMediaKeysWebkit;\n\n // Unprefixed EME allows for session creation without a video tag or src.\n // Prefixed EME requires both a valid HTMLMediaElement and a src.\n var media = this.media_ || /** @type {!HTMLMediaElement} */(\n document.createElement('video'));\n if (!media.src) media.src = 'about:blank';\n\n var session = new PatchedMediaKeysWebkit.MediaKeySession(\n media, this.keySystem_, sessionType);\n this.newSessions_.push(session);\n return session;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.setServerCertificate =\n function(serverCertificate) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.setServerCertificate');\n\n // There is no equivalent in v0.1b, so return failure.\n return Promise.resolve(false);\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitNeedKey_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitNeedKey_', event);\n goog.asserts.assert(this.media_, 'media_ not set in onWebkitNeedKey_');\n\n var event2 = document.createEvent('CustomEvent');\n event2.initCustomEvent('encrypted', false, false, null);\n\n // not used by v0.1b EME, but given a valid value\n event2.initDataType = 'webm';\n event2.initData = event.initData;\n\n this.media_.dispatchEvent(event2);\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyMessage_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitKeyMessage_', event);\n\n var session = this.findSession_(event.sessionId);\n if (!session) {\n shaka.log.error('Session not found', event.sessionId);\n return;\n }\n\n var isNew = session.keyStatuses.getStatus() == undefined;\n\n var event2 = new shaka.util.FakeEvent('message', {\n messageType: isNew ? 'licenserequest' : 'licenserenewal',\n message: event.message\n });\n\n session.generated();\n session.dispatchEvent(event2);\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyAdded_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitKeyAdded_', event);\n\n var session = this.findSession_(event.sessionId);\n goog.asserts.assert(session, 'unable to find session in onWebkitKeyAdded_');\n if (session) {\n session.ready();\n }\n};\n\n\n/**\n * @param {!MediaKeyEvent} event\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.onWebkitKeyError_ =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.onWebkitKeyError_', event);\n\n var session = this.findSession_(event.sessionId);\n goog.asserts.assert(session, 'unable to find session in onWebkitKeyError_');\n if (session) {\n session.handleError(event);\n }\n};\n\n\n/**\n * @param {string} sessionId\n * @return {shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeys.prototype.findSession_ =\n function(sessionId) {\n var session = this.sessionMap_[sessionId];\n if (session) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.findSession_', session);\n return session;\n }\n\n session = this.newSessions_.shift();\n if (session) {\n session.sessionId = sessionId;\n this.sessionMap_[sessionId] = session;\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeys.findSession_', session);\n return session;\n }\n\n return null;\n};\n\n\n\n/**\n * An implementation of MediaKeySession.\n *\n * @param {!HTMLMediaElement} media\n * @param {string} keySystem\n * @param {string} sessionType\n *\n * @constructor\n * @struct\n * @implements {MediaKeySession}\n * @extends {shaka.util.FakeEventTarget}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession =\n function(media, keySystem, sessionType) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession');\n shaka.util.FakeEventTarget.call(this);\n\n /** @private {!HTMLMediaElement} */\n this.media_ = media;\n\n /** @private {boolean} */\n this.initialized_ = false;\n\n /** @private {shaka.util.PublicPromise} */\n this.generatePromise_ = null;\n\n /** @private {shaka.util.PublicPromise} */\n this.updatePromise_ = null;\n\n /** @private {string} */\n this.keySystem_ = keySystem;\n\n /** @private {string} */\n this.type_ = sessionType;\n\n /** @type {string} */\n this.sessionId = '';\n\n /** @type {number} */\n this.expiration = NaN;\n\n /** @type {!shaka.util.PublicPromise} */\n this.closed = new shaka.util.PublicPromise();\n\n /** @type {!MediaKeyStatusMap} */\n this.keyStatuses =\n new shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap();\n};\ngoog.inherits(shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession,\n shaka.util.FakeEventTarget);\n\n\n/**\n * Signals that the license request has been generated. This resolves the\n * 'generateRequest' promise.\n *\n * @protected\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generated =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.generated');\n\n if (this.generatePromise_) {\n this.generatePromise_.resolve();\n this.generatePromise_ = null;\n }\n};\n\n\n/**\n * Signals that the session is 'ready', which is the terminology used in older\n * versions of EME. The new signal is to resolve the 'update' promise. This\n * translates between the two.\n *\n * @protected\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.ready =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.ready');\n\n this.updateKeyStatus_('usable');\n\n if (this.updatePromise_) {\n this.updatePromise_.resolve();\n }\n this.updatePromise_ = null;\n};\n\n\n/**\n * Either rejects a promise, or dispatches an error event, as appropriate.\n *\n * @param {!MediaKeyEvent} event\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.handleError =\n function(event) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.handleError', event);\n\n // This does not match the DOMException we get in current WD EME, but it will\n // at least provide some information which can be used to look into the\n // problem.\n var error = new Error('EME v0.1b key error');\n error.errorCode = event.errorCode;\n error.errorCode.systemCode = event.systemCode;\n\n // The presence or absence of sessionId indicates whether this corresponds to\n // generateRequest() or update().\n if (!event.sessionId && this.generatePromise_) {\n error.method = 'generateRequest';\n if (event.systemCode == 45) {\n error.message = 'Unsupported session type.';\n }\n this.generatePromise_.reject(error);\n this.generatePromise_ = null;\n } else if (event.sessionId && this.updatePromise_) {\n error.method = 'update';\n this.updatePromise_.reject(error);\n this.updatePromise_ = null;\n } else {\n // This mapping of key statuses is imperfect at best.\n var code = event.errorCode.code;\n var systemCode = event.systemCode;\n if (code == MediaKeyError['MEDIA_KEYERR_OUTPUT']) {\n this.updateKeyStatus_('output-restricted');\n } else if (systemCode == 1) {\n this.updateKeyStatus_('expired');\n } else {\n this.updateKeyStatus_('internal-error');\n }\n }\n};\n\n\n/**\n * Logic which is shared between generateRequest() and load(), both of which\n * are ultimately implemented with webkitGenerateKeyRequest in prefixed EME.\n *\n * @param {?BufferSource} initData\n * @param {?string} offlineSessionId\n * @return {!Promise}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.generate_ =\n function(initData, offlineSessionId) {\n if (this.initialized_) {\n return Promise.reject(new Error('The session is already initialized.'));\n }\n\n this.initialized_ = true;\n\n /** @type {!Uint8Array} */\n var mangledInitData;\n\n try {\n if (this.type_ == 'persistent-license') {\n var StringUtils = shaka.util.StringUtils;\n if (!offlineSessionId) {\n // Persisting the initial license.\n // Prefix the init data with a tag to indicate persistence.\n var prefix = StringUtils.toUTF8('PERSISTENT|');\n var result = new Uint8Array(prefix.byteLength + initData.byteLength);\n result.set(new Uint8Array(prefix), 0);\n result.set(new Uint8Array(initData), prefix.byteLength);\n mangledInitData = result;\n } else {\n // Loading a stored license.\n // Prefix the init data (which is really a session ID) with a tag to\n // indicate that we are loading a persisted session.\n mangledInitData = new Uint8Array(\n StringUtils.toUTF8('LOAD_SESSION|' + offlineSessionId));\n }\n } else {\n // Streaming.\n goog.asserts.assert(this.type_ == 'temporary',\n 'expected temporary session');\n goog.asserts.assert(!offlineSessionId,\n 'unexpected offline session ID');\n mangledInitData = new Uint8Array(initData);\n }\n\n goog.asserts.assert(mangledInitData,\n 'init data not set!');\n } catch (exception) {\n return Promise.reject(exception);\n }\n\n goog.asserts.assert(this.generatePromise_ == null,\n 'generatePromise_ should be null');\n this.generatePromise_ = new shaka.util.PublicPromise();\n\n // Because we are hacking media.src in createSession to better emulate\n // unprefixed EME's ability to create sessions and license requests without a\n // video tag, we can get ourselves into trouble. It seems that sometimes,\n // the setting of media.src hasn't been processed by some other thread, and\n // GKR can throw an exception. If this occurs, wait 10 ms and try again at\n // most once. This situation should only occur when init data is available\n // ahead of the 'needkey' event.\n\n var prefixApi = shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_;\n var generateKeyRequestName = prefixApi('generateKeyRequest');\n try {\n this.media_[generateKeyRequestName](this.keySystem_, mangledInitData);\n } catch (exception) {\n if (exception.name != 'InvalidStateError') {\n this.generatePromise_ = null;\n return Promise.reject(exception);\n }\n\n setTimeout(function() {\n try {\n this.media_[generateKeyRequestName](this.keySystem_, mangledInitData);\n } catch (exception) {\n this.generatePromise_.reject(exception);\n this.generatePromise_ = null;\n }\n }.bind(this), 10);\n }\n\n return this.generatePromise_;\n};\n\n\n/**\n * An internal version of update which defers new calls while old ones are in\n * progress.\n *\n * @param {!shaka.util.PublicPromise} promise The promise associated with this\n * call.\n * @param {?BufferSource} response\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update_ =\n function(promise, response) {\n if (this.updatePromise_) {\n // We already have an update in-progress, so defer this one until after the\n // old one is resolved. Execute this whether the original one succeeds or\n // fails.\n this.updatePromise_.then(\n this.update_.bind(this, promise, response)\n ).catch(\n this.update_.bind(this, promise, response)\n );\n return;\n }\n\n this.updatePromise_ = promise;\n\n var key;\n var keyId;\n\n if (this.keySystem_ == 'webkit-org.w3.clearkey') {\n // The current EME version of clearkey wants a structured JSON response.\n // The v0.1b version wants just a raw key. Parse the JSON response and\n // extract the key and key ID.\n var StringUtils = shaka.util.StringUtils;\n var Uint8ArrayUtils = shaka.util.Uint8ArrayUtils;\n var licenseString = StringUtils.fromUTF8(response);\n var jwkSet = /** @type {JWKSet} */ (JSON.parse(licenseString));\n var kty = jwkSet.keys[0].kty;\n if (kty != 'oct') {\n // Reject the promise.\n var error = new Error('Response is not a valid JSON Web Key Set.');\n this.updatePromise_.reject(error);\n this.updatePromise_ = null;\n }\n key = Uint8ArrayUtils.fromBase64(jwkSet.keys[0].k);\n keyId = Uint8ArrayUtils.fromBase64(jwkSet.keys[0].kid);\n } else {\n // The key ID is not required.\n key = new Uint8Array(response);\n keyId = null;\n }\n\n var prefixApi = shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_;\n var addKeyName = prefixApi('addKey');\n try {\n this.media_[addKeyName](this.keySystem_, key, keyId, this.sessionId);\n } catch (exception) {\n // Reject the promise.\n this.updatePromise_.reject(exception);\n this.updatePromise_ = null;\n }\n};\n\n\n/**\n * Update key status and dispatch a 'keystatuseschange' event.\n *\n * @param {string} status\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.\n updateKeyStatus_ = function(status) {\n this.keyStatuses.setStatus(status);\n var event = new shaka.util.FakeEvent('keystatuseschange');\n this.dispatchEvent(event);\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.\n generateRequest = function(initDataType, initData) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.generateRequest');\n return this.generate_(initData, null);\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.load =\n function(sessionId) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.load');\n if (this.type_ == 'persistent-license') {\n return this.generate_(null, sessionId);\n } else {\n return Promise.reject(new Error('Not a persistent session.'));\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.update =\n function(response) {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.update', response);\n goog.asserts.assert(this.sessionId, 'update without session ID');\n\n var nextUpdatePromise = new shaka.util.PublicPromise();\n this.update_(nextUpdatePromise, response);\n return nextUpdatePromise;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.close =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.close');\n\n // This will remove a persistent session, but it's also the only way to\n // free CDM resources on v0.1b.\n if (this.type_ != 'persistent-license') {\n // sessionId may reasonably be null if no key request has been generated\n // yet. Unprefixed EME will return a rejected promise in this case.\n // We will use the same error message that Chrome 41 uses in its EME\n // implementation.\n if (!this.sessionId) {\n this.closed.reject(new Error('The session is not callable.'));\n return this.closed;\n }\n\n // This may throw an exception, but we ignore it because we are only using\n // it to clean up resources in v0.1b. We still consider the session closed.\n // We can't let the exception propagate because MediaKeySession.close()\n // should not throw.\n var prefixApi = shaka.polyfill.PatchedMediaKeysWebkit.prefixApi_;\n var cancelKeyRequestName = prefixApi('cancelKeyRequest');\n try {\n this.media_[cancelKeyRequestName](this.keySystem_, this.sessionId);\n } catch (exception) {}\n }\n\n // Resolve the 'closed' promise and return it.\n this.closed.resolve();\n return this.closed;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession.prototype.remove =\n function() {\n shaka.log.debug('PatchedMediaKeysWebkit.MediaKeySession.remove');\n\n if (this.type_ != 'persistent-license') {\n return Promise.reject(new Error('Not a persistent session.'));\n }\n\n return this.close();\n};\n\n\n\n/**\n * An implementation of MediaKeyStatusMap.\n * This fakes a map with a single key ID.\n *\n * @constructor\n * @struct\n * @implements {MediaKeyStatusMap}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap = function() {\n /**\n * @type {number}\n */\n this.size = 0;\n\n /**\n * @private {string|undefined}\n */\n this.status_ = undefined;\n};\n\n\n/**\n * @const {!ArrayBuffer}\n * @private\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_;\n\n\n/**\n * An internal method used by the session to set key status.\n * @param {string|undefined} status\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.setStatus =\n function(status) {\n this.size = status == undefined ? 0 : 1;\n this.status_ = status;\n};\n\n\n/**\n * An internal method used by the session to get key status.\n * @return {string|undefined}\n */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.getStatus =\n function() {\n return this.status_;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.forEach =\n function(fn) {\n if (this.status_) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_;\n fn(this.status_, fakeKeyId);\n }\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.get =\n function(keyId) {\n if (this.has(keyId)) {\n return this.status_;\n }\n return undefined;\n};\n\n\n/** @override */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.has =\n function(keyId) {\n var fakeKeyId =\n shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.KEY_ID_;\n if (this.status_ &&\n shaka.util.Uint8ArrayUtils.equal(\n new Uint8Array(keyId), new Uint8Array(fakeKeyId))) {\n return true;\n }\n return false;\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.\n entries = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.\n keys = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n/** @suppress {missingReturn} */\nshaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype.\n values = function() {\n goog.asserts.assert(false, 'Not used! Provided only for compiler.');\n};\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/patchedmediakeys_webkit.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.MediaSource');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.MediaSource\n *\n * @summary A polyfill to patch MSE bugs.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.MediaSource.install = function() {\n shaka.log.debug('MediaSource.install');\n\n if (!window.MediaSource) {\n shaka.log.info('No MSE implementation available.');\n return;\n }\n\n // Detection is complicated by the fact that Safari does not expose\n // SourceBuffer on window. So we can't detect missing features by accessing\n // SourceBuffer.prototype. That is why we use navigator to detect Safari and\n // particular versions of it.\n var vendor = navigator.vendor;\n var version = navigator.appVersion;\n if (!vendor || !version || vendor.indexOf('Apple') < 0) {\n shaka.log.info('Using native MSE as-is.');\n return;\n }\n\n if (version.indexOf('Version/8') >= 0) {\n // Safari 8 does not implement appendWindowEnd. If we ignore the\n // incomplete MSE implementation, some content (especially multi-period)\n // will fail to play correctly. The best we can do is blacklist Safari 8.\n shaka.log.info('Blacklisting Safari 8 MSE.');\n shaka.polyfill.MediaSource.blacklist_();\n } else if (version.indexOf('Version/9') >= 0) {\n shaka.log.info('Patching Safari 9 MSE bugs.');\n // Safari 9 does not correctly implement abort() on SourceBuffer.\n // Calling abort() causes a decoder failure, rather than resetting the\n // decode timestamp as called for by the spec.\n // Bug filed: http://goo.gl/UZ2rPp\n shaka.polyfill.MediaSource.stubAbort_();\n } else if (version.indexOf('Version/10') >= 0) {\n shaka.log.info('Patching Safari 10 MSE bugs.');\n // Safari 10 does not correctly implement abort() on SourceBuffer.\n // Calling abort() before appending a segment causes that segment to be\n // incomplete in buffer.\n // Bug filed: https://goo.gl/rC3CLj\n shaka.polyfill.MediaSource.stubAbort_();\n // Safari 10 fires spurious 'updateend' events after endOfStream().\n // Bug filed: https://goo.gl/qCeTZr\n shaka.polyfill.MediaSource.patchEndOfStreamEvents_();\n } else {\n shaka.log.info('Using native MSE as-is.');\n }\n};\n\n\n/**\n * Blacklist the current browser by making MediaSourceEngine.isBrowserSupported\n * fail later.\n *\n * @private\n */\nshaka.polyfill.MediaSource.blacklist_ = function() {\n window['MediaSource'] = null;\n};\n\n\n/**\n * Stub out abort(). On some buggy MSE implementations, calling abort() causes\n * various problems.\n *\n * @private\n */\nshaka.polyfill.MediaSource.stubAbort_ = function() {\n var addSourceBuffer = MediaSource.prototype.addSourceBuffer;\n MediaSource.prototype.addSourceBuffer = function() {\n var sourceBuffer = addSourceBuffer.apply(this, arguments);\n sourceBuffer.abort = function() {}; // Stub out for buggy implementations.\n return sourceBuffer;\n };\n};\n\n\n/**\n * Patch endOfStream() to get rid of 'updateend' events that should not fire.\n * These extra events confuse MediaSourceEngine, which relies on correct events\n * to manage SourceBuffer state.\n *\n * @private\n */\nshaka.polyfill.MediaSource.patchEndOfStreamEvents_ = function() {\n var endOfStream = MediaSource.prototype.endOfStream;\n MediaSource.prototype.endOfStream = function() {\n // This bug manifests only when endOfStream() results in the truncation\n // of the MediaSource's duration. So first we must calculate what the\n // new duration will be.\n var newDuration = 0;\n for (var i = 0; i < this.sourceBuffers.length; ++i) {\n var buffer = this.sourceBuffers[i];\n var bufferEnd = buffer.buffered.end(buffer.buffered.length - 1);\n newDuration = Math.max(newDuration, bufferEnd);\n }\n\n // If the duration is going to be reduced, suppress the next 'updateend'\n // event on each SourceBuffer.\n if (!isNaN(this.duration) &&\n newDuration < this.duration) {\n this.ignoreUpdateEnd_ = true;\n for (var i = 0; i < this.sourceBuffers.length; ++i) {\n var buffer = this.sourceBuffers[i];\n buffer.eventSuppressed_ = false;\n }\n }\n\n return endOfStream.apply(this, arguments);\n };\n\n var addSourceBuffer = MediaSource.prototype.addSourceBuffer;\n MediaSource.prototype.addSourceBuffer = function() {\n // After adding a new source buffer, add an event listener to allow us to\n // suppress events.\n var sourceBuffer = addSourceBuffer.apply(this, arguments);\n sourceBuffer.mediaSource_ = this;\n sourceBuffer.addEventListener('updateend',\n shaka.polyfill.MediaSource.ignoreUpdateEnd_, false);\n\n if (!this.cleanUpHandlerInstalled_) {\n // If we haven't already, install an event listener to allow us to clean\n // up listeners when MediaSource is torn down.\n this.addEventListener('sourceclose',\n shaka.polyfill.MediaSource.cleanUpListeners_, false);\n this.cleanUpHandlerInstalled_ = true;\n }\n return sourceBuffer;\n };\n};\n\n\n/**\n * An event listener for 'updateend' which selectively suppresses the events.\n *\n * @see shaka.polyfill.MediaSource.patchEndOfStreamEvents_\n *\n * @param {Event} event\n * @private\n */\nshaka.polyfill.MediaSource.ignoreUpdateEnd_ = function(event) {\n var sourceBuffer = event.target;\n var mediaSource = sourceBuffer.mediaSource_;\n\n if (mediaSource.ignoreUpdateEnd_) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n sourceBuffer.eventSuppressed_ = true;\n\n for (var i = 0; i < mediaSource.sourceBuffers.length; ++i) {\n var buffer = mediaSource.sourceBuffers[i];\n if (buffer.eventSuppressed_ == false) {\n // More events need to be suppressed.\n return;\n }\n }\n\n // All events have been suppressed, all buffers are out of 'updating'\n // mode. Stop suppressing events.\n mediaSource.ignoreUpdateEnd_ = false;\n }\n};\n\n\n/**\n * An event listener for 'sourceclose' which cleans up listeners for 'updateend'\n * to avoid memory leaks.\n *\n * @see shaka.polyfill.MediaSource.patchEndOfStreamEvents_\n * @see shaka.polyfill.MediaSource.ignoreUpdateEnd_\n *\n * @param {Event} event\n * @private\n */\nshaka.polyfill.MediaSource.cleanUpListeners_ = function(event) {\n var mediaSource = event.target;\n for (var i = 0; i < mediaSource.sourceBuffers.length; ++i) {\n var buffer = mediaSource.sourceBuffers[i];\n buffer.removeEventListener('updateend',\n shaka.polyfill.MediaSource.ignoreUpdateEnd_, false);\n }\n mediaSource.removeEventListener('sourceclose',\n shaka.polyfill.MediaSource.cleanUpListeners_, false);\n};\n\n\nshaka.polyfill.register(shaka.polyfill.MediaSource.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/mediasource.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.Promise');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n\n/**\n * @summary A polyfill to implement Promises, primarily for IE.\n * Only partially supports thenables, but otherwise passes the A+ conformance\n * tests.\n * Note that Promise.all() and Promise.race() are not tested by that suite.\n *\n * @constructor\n * @struct\n * @param {function(function(*), function(*))=} opt_callback\n * @template T\n */\nshaka.polyfill.Promise = function(opt_callback) {\n /** @private {!Array.<shaka.polyfill.Promise.Child>} */\n this.thens_ = [];\n\n /** @private {!Array.<shaka.polyfill.Promise.Child>} */\n this.catches_ = [];\n\n /** @private {shaka.polyfill.Promise.State} */\n this.state_ = shaka.polyfill.Promise.State.PENDING;\n\n /** @private {*} */\n this.value_;\n\n // External callers must supply the callback. Internally, we may construct\n // child Promises without it, since we can directly access their resolve_ and\n // reject_ methods when convenient.\n if (opt_callback) {\n try {\n opt_callback(this.resolve_.bind(this), this.reject_.bind(this));\n } catch (e) {\n this.reject_(e);\n }\n }\n};\n\n\n/**\n * @typedef {{\n * promise: !shaka.polyfill.Promise,\n * callback: (function(*)|undefined)\n * }}\n *\n * @summary A child promise, used for chaining.\n * @description\n * Only exists in the context of a then or catch chain.\n * @property {!shaka.polyfill.Promise} promise\n * The child promise.\n * @property {(function(*)|undefined)} callback\n * The then or catch callback to be invoked as part of this chain.\n */\nshaka.polyfill.Promise.Child;\n\n\n/**\n * @enum {number}\n */\nshaka.polyfill.Promise.State = {\n PENDING: 0,\n RESOLVED: 1,\n REJECTED: 2\n};\n\n\n/**\n * Install the polyfill if needed.\n * @param {boolean=} opt_force If true, force the polyfill to be installed.\n * Used in some unit tests.\n */\nshaka.polyfill.Promise.install = function(opt_force) {\n // Decide on the best way to invoke a callback as soon as possible.\n // Precompute the setImmediate/clearImmediate convenience methods to avoid the\n // overhead of this switch every time a callback has to be invoked.\n if (window.setImmediate) {\n // For IE and node.js:\n shaka.polyfill.Promise.setImmediate_ = function(callback) {\n return window.setImmediate(callback);\n };\n shaka.polyfill.Promise.clearImmediate_ = function(id) {\n return window.clearImmediate(id);\n };\n } else {\n // For everyone else:\n shaka.polyfill.Promise.setImmediate_ = function(callback) {\n return window.setTimeout(callback, 0);\n };\n shaka.polyfill.Promise.clearImmediate_ = function(id) {\n return window.clearTimeout(id);\n };\n }\n\n if (window.Promise && !opt_force) {\n shaka.log.info('Using native Promises.');\n return;\n }\n\n shaka.log.info('Using Promises polyfill.');\n // Quoted to work around type-checking, since our then() signature doesn't\n // exactly match that of a native Promise.\n window['Promise'] = shaka.polyfill.Promise;\n\n // Explicitly installed because the compiler won't necessarily attach them\n // to the compiled constructor. Exporting them will only attach them to\n // their original namespace, which isn't the same as attaching them to the\n // constructor unless you also export the constructor.\n window['Promise'].resolve = shaka.polyfill.Promise.resolve;\n window['Promise'].reject = shaka.polyfill.Promise.reject;\n window['Promise'].all = shaka.polyfill.Promise.all;\n window['Promise'].race = shaka.polyfill.Promise.race;\n\n // These are manually exported as well, because allowing the compiler to\n // export them for us will cause the polyfill to end up in our generated\n // externs. Since nobody should be accessing this directly using the\n // shaka.polyfill namespace, it is okay not to @export these methods.\n window['Promise']['prototype']['then'] =\n shaka.polyfill.Promise.prototype.then;\n window['Promise']['prototype']['catch'] =\n shaka.polyfill.Promise.prototype.catch;\n};\n\n\n/**\n * Uninstall the polyfill. Used in some unit tests.\n */\nshaka.polyfill.Promise.uninstall = function() {\n // Do nothing if there is no native implementation.\n if (shaka.polyfill.Promise.nativePromise_) {\n shaka.log.info('Removing Promise polyfill.');\n window['Promise'] = shaka.polyfill.Promise.nativePromise_;\n shaka.polyfill.Promise.q_ = [];\n }\n};\n\n\n/**\n * @param {*} value\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.resolve = function(value) {\n var p = new shaka.polyfill.Promise();\n p.resolve_(undefined);\n return p.then(function() {\n return value;\n });\n};\n\n\n/**\n * @param {*} reason\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.reject = function(reason) {\n var p = new shaka.polyfill.Promise();\n p.reject_(reason);\n return p;\n};\n\n\n/**\n * @param {!Array.<!shaka.polyfill.Promise>} others\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.all = function(others) {\n var p = new shaka.polyfill.Promise();\n if (!others.length) {\n p.resolve_([]);\n return p;\n }\n\n // The array of results must be in the same order as the array of Promises\n // passed to all(). So we pre-allocate the array and keep a count of how\n // many have resolved. Only when all have resolved is the returned Promise\n // itself resolved.\n var count = 0;\n var values = new Array(others.length);\n var resolve = function(p, i, newValue) {\n goog.asserts.assert(p.state_ != shaka.polyfill.Promise.State.RESOLVED,\n 'Invalid Promise state in Promise.all');\n // If one of the Promises in the array was rejected, this Promise was\n // rejected and new values are ignored. In such a case, the values array\n // and its contents continue to be alive in memory until all of the Promises\n // in the array have completed.\n if (p.state_ == shaka.polyfill.Promise.State.PENDING) {\n values[i] = newValue;\n count++;\n if (count == values.length) {\n p.resolve_(values);\n }\n }\n };\n\n var reject = p.reject_.bind(p);\n for (var i = 0; i < others.length; ++i) {\n if (others[i] && others[i].then) {\n others[i].then(resolve.bind(null, p, i), reject);\n } else {\n resolve(p, i, others[i]);\n }\n }\n return p;\n};\n\n\n/**\n * @param {!Array.<!shaka.polyfill.Promise>} others\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.race = function(others) {\n var p = new shaka.polyfill.Promise();\n\n // The returned Promise is resolved or rejected as soon as one of the others\n // is.\n var resolve = p.resolve_.bind(p);\n var reject = p.reject_.bind(p);\n for (var i = 0; i < others.length; ++i) {\n if (others[i] && others[i].then) {\n others[i].then(resolve, reject);\n } else {\n resolve(others[i]);\n }\n }\n return p;\n};\n\n\n/**\n * @param {function(*)=} opt_successCallback\n * @param {function(*)=} opt_failCallback\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.prototype.then = function(opt_successCallback,\n opt_failCallback) {\n // then() returns a child Promise which is chained onto this one.\n var child = new shaka.polyfill.Promise();\n switch (this.state_) {\n case shaka.polyfill.Promise.State.RESOLVED:\n // This is already resolved, so we can chain to the child ASAP.\n this.schedule_(child, opt_successCallback);\n break;\n case shaka.polyfill.Promise.State.REJECTED:\n // This is already rejected, so we can chain to the child ASAP.\n this.schedule_(child, opt_failCallback);\n break;\n case shaka.polyfill.Promise.State.PENDING:\n // This is pending, so we have to track both callbacks and the child\n // in order to chain later.\n this.thens_.push({ promise: child, callback: opt_successCallback});\n this.catches_.push({ promise: child, callback: opt_failCallback});\n break;\n }\n\n return child;\n};\n\n\n/**\n * @param {function(*)=} opt_callback\n * @return {!shaka.polyfill.Promise}\n */\nshaka.polyfill.Promise.prototype.catch = function(opt_callback) {\n // Devolves into a two-argument call to 'then'.\n return this.then(undefined, opt_callback);\n};\n\n\n/**\n * @param {*} value\n * @private\n */\nshaka.polyfill.Promise.prototype.resolve_ = function(value) {\n // Ignore resolve calls if we aren't still pending.\n if (this.state_ == shaka.polyfill.Promise.State.PENDING) {\n this.value_ = value;\n this.state_ = shaka.polyfill.Promise.State.RESOLVED;\n // Schedule calls to all of the chained callbacks.\n for (var i = 0; i < this.thens_.length; ++i) {\n this.schedule_(this.thens_[i].promise, this.thens_[i].callback);\n }\n this.thens_ = [];\n this.catches_ = [];\n }\n};\n\n\n/**\n * @param {*} reason\n * @private\n */\nshaka.polyfill.Promise.prototype.reject_ = function(reason) {\n // Ignore reject calls if we aren't still pending.\n if (this.state_ == shaka.polyfill.Promise.State.PENDING) {\n this.value_ = reason;\n this.state_ = shaka.polyfill.Promise.State.REJECTED;\n // Schedule calls to all of the chained callbacks.\n for (var i = 0; i < this.catches_.length; ++i) {\n this.schedule_(this.catches_[i].promise, this.catches_[i].callback);\n }\n this.thens_ = [];\n this.catches_ = [];\n }\n};\n\n\n/**\n * @param {!shaka.polyfill.Promise} child\n * @param {function(*)|undefined} callback\n * @private\n */\nshaka.polyfill.Promise.prototype.schedule_ = function(child, callback) {\n goog.asserts.assert(this.state_ != shaka.polyfill.Promise.State.PENDING,\n 'Invalid Promise state in Promise.schedule_');\n var Promise = shaka.polyfill.Promise;\n\n var wrapper = function() {\n if (callback && typeof callback == 'function') {\n // Wrap around the callback. Exceptions thrown by the callback are\n // converted to failures.\n try {\n var value = callback(this.value_);\n } catch (exception) {\n child.reject_(exception);\n return;\n }\n\n // According to the spec, 'then' in a thenable may only be accessed once\n // and any thrown exceptions in the getter must cause the Promise chain\n // to fail.\n var then;\n try {\n then = value && value.then;\n } catch (exception) {\n child.reject_(exception);\n return;\n }\n\n if (value instanceof Promise) {\n // If the returned value is a Promise, we bind it's state to the child.\n if (value == child) {\n // Without this, a bad calling pattern can cause an infinite loop.\n child.reject_(new TypeError('Chaining cycle detected'));\n } else {\n value.then(child.resolve_.bind(child), child.reject_.bind(child));\n }\n } else if (then) {\n // If the returned value is thenable, chain it to the child.\n Promise.handleThenable_(value, then, child);\n } else {\n // If the returned value is not a Promise, the child is resolved with\n // that value.\n child.resolve_(value);\n }\n } else if (this.state_ == Promise.State.RESOLVED) {\n // No callback for this state, so just chain on down the line.\n child.resolve_(this.value_);\n } else {\n // No callback for this state, so just chain on down the line.\n child.reject_(this.value_);\n }\n };\n\n // Enqueue a call to the wrapper.\n Promise.q_.push(wrapper.bind(this));\n if (Promise.flushTimer_ == null) {\n Promise.flushTimer_ = Promise.setImmediate_(Promise.flush);\n }\n};\n\n\n/**\n * @param {!Object} thenable\n * @param {Function} then\n * @param {!shaka.polyfill.Promise} child\n * @private\n */\nshaka.polyfill.Promise.handleThenable_ = function(thenable, then, child) {\n var Promise = shaka.polyfill.Promise;\n try {\n var sealed = false;\n then.call(thenable, function(value) {\n if (sealed) return;\n sealed = true;\n\n var nextThen;\n try {\n nextThen = value && value.then;\n } catch (exception) {\n child.reject_(exception);\n return;\n }\n\n if (nextThen) {\n Promise.handleThenable_(value, nextThen, child);\n } else {\n child.resolve_(value);\n }\n }, child.reject_.bind(child));\n } catch (exception) {\n child.reject_(exception);\n }\n};\n\n\n/**\n * Flush the queue of callbacks.\n * Used directly by some unit tests.\n */\nshaka.polyfill.Promise.flush = function() {\n var Promise = shaka.polyfill.Promise;\n\n // Flush as long as we have callbacks. This means we can finish a chain more\n // quickly, since we avoid the overhead of multiple calls to setTimeout, each\n // of which has a minimum resolution of as much as 15ms on IE11.\n // This helps to fix the out-of-order task bug on IE:\n // https://github.com/google/shaka-player/issues/251#issuecomment-178146242\n while (Promise.q_.length) {\n // Callbacks may enqueue other callbacks, so clear the timer ID and swap the\n // queue before we do anything else.\n if (Promise.flushTimer_ != null) {\n Promise.clearImmediate_(Promise.flushTimer_);\n Promise.flushTimer_ = null;\n }\n var q = Promise.q_;\n Promise.q_ = [];\n\n for (var i = 0; i < q.length; ++i) {\n q[i]();\n }\n }\n};\n\n\n/**\n * @param {function()} callback\n * @return {number}\n * Schedule a callback as soon as possible.\n * Bound in shaka.polyfill.Promise.install() to a specific implementation.\n * @private\n */\nshaka.polyfill.Promise.setImmediate_ = function(callback) { return 0; };\n\n\n/**\n * @param {number} id\n * Clear a scheduled callback.\n * Bound in shaka.polyfill.Promise.install() to a specific implementation.\n * @private\n */\nshaka.polyfill.Promise.clearImmediate_ = function(id) {};\n\n\n/**\n * A timer ID to flush the queue.\n * @private {?number}\n */\nshaka.polyfill.Promise.flushTimer_ = null;\n\n\n/**\n * A queue of callbacks to be invoked ASAP in the next frame.\n * @private {!Array.<function()>}\n */\nshaka.polyfill.Promise.q_ = [];\n\n\n/** @private {?} */\nshaka.polyfill.Promise.nativePromise_ = window.Promise;\n\n\nshaka.polyfill.register(shaka.polyfill.Promise.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/promise.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.VideoPlaybackQuality');\n\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.VideoPlaybackQuality\n *\n * @summary A polyfill to provide MSE VideoPlaybackQuality metrics.\n * Many browsers do not yet provide this API, and Chrome currently provides\n * similar data through individual prefixed attributes on HTMLVideoElement.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.VideoPlaybackQuality.install = function() {\n if (!window.HTMLVideoElement) {\n // Avoid errors on very old browsers.\n return;\n }\n\n var proto = HTMLVideoElement.prototype;\n if (proto.getVideoPlaybackQuality) {\n // No polyfill needed.\n return;\n }\n\n if ('webkitDroppedFrameCount' in proto) {\n proto.getVideoPlaybackQuality =\n shaka.polyfill.VideoPlaybackQuality.webkit_;\n }\n};\n\n\n/**\n * @this {HTMLVideoElement}\n * @return {!VideoPlaybackQuality}\n * @private\n */\nshaka.polyfill.VideoPlaybackQuality.webkit_ = function() {\n return {\n 'droppedVideoFrames': this.webkitDroppedFrameCount,\n 'totalVideoFrames': this.webkitDecodedFrameCount,\n // Not provided by this polyfill:\n 'corruptedVideoFrames': 0,\n 'creationTime': NaN,\n 'totalFrameDelay': 0\n };\n};\n\n\nshaka.polyfill.register(shaka.polyfill.VideoPlaybackQuality.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/videoplaybackquality.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.VTTCue');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.VTTCue\n *\n * @summary A polyfill to provide VTTCue.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.VTTCue.install = function() {\n if (window.VTTCue) {\n shaka.log.info('Using native VTTCue.');\n return;\n }\n\n if (!window.TextTrackCue) {\n shaka.log.error('VTTCue not available.');\n return;\n }\n\n var constructorLength = TextTrackCue.length;\n if (constructorLength == 3) {\n shaka.log.info('Using VTTCue polyfill from 3 argument TextTrackCue.');\n window.VTTCue = shaka.polyfill.VTTCue.from3ArgsTextTrackCue_;\n } else if (constructorLength == 6) {\n shaka.log.info('Using VTTCue polyfill from 6 argument TextTrackCue.');\n window.VTTCue = shaka.polyfill.VTTCue.from6ArgsTextTrackCue_;\n } else if (shaka.polyfill.VTTCue.canUse3ArgsTextTrackCue_()) {\n shaka.log.info('Using VTTCue polyfill from 3 argument TextTrackCue.');\n window.VTTCue = shaka.polyfill.VTTCue.from3ArgsTextTrackCue_;\n }\n};\n\n\n/**\n * Draft spec TextTrackCue with 3 constructor arguments.\n * See {@link https://goo.gl/ZXBWZi W3C Working Draft 25 October 2012}.\n *\n * @param {number} startTime\n * @param {number} endTime\n * @param {string} text\n * @return {TextTrackCue}\n * @private\n */\nshaka.polyfill.VTTCue.from3ArgsTextTrackCue_ = function(startTime, endTime,\n text) {\n return new window.TextTrackCue(startTime, endTime, text);\n};\n\n\n/**\n * Draft spec TextTrackCue with 6 constructor arguments (5th & 6th are\n * optional).\n * See {@link https://goo.gl/AYFqUh W3C Working Draft 29 March 2012}.\n * Quoting the access to the TextTrackCue object to avoid the compiler\n * complaining.\n *\n * @param {number} startTime\n * @param {number} endTime\n * @param {string} text\n * @return {TextTrackCue}\n * @private\n */\nshaka.polyfill.VTTCue.from6ArgsTextTrackCue_ = function(startTime, endTime,\n text) {\n var id = startTime + '-' + endTime + '-' + text;\n return new window['TextTrackCue'](id, startTime, endTime, text);\n};\n\n\n/**\n * IE10, IE11 and Edge returns TextTrackCue.length = 0 although it accepts 3\n * constructor arguments.\n *\n * @return {boolean}\n * @private\n */\nshaka.polyfill.VTTCue.canUse3ArgsTextTrackCue_ = function() {\n try {\n return !!shaka.polyfill.VTTCue.from3ArgsTextTrackCue_(1, 2, '');\n } catch (error) {\n return false;\n }\n};\n\n\nshaka.polyfill.register(shaka.polyfill.VTTCue.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/vttcue.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.IndexedDB');\n\ngoog.require('goog.asserts');\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.IndexedDB\n *\n * @summary A polyfill to patch indexed db bugs.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.IndexedDB.install = function() {\n shaka.log.debug('IndexedDB.install');\n\n var agent = navigator.userAgent;\n if (agent && agent.indexOf('CrKey') >= 0) {\n shaka.log.debug('Removing IndexedDB from ChromeCast');\n delete window.indexedDB;\n goog.asserts.assert(\n !window.indexedDB, 'Failed to override window.indexedDB');\n }\n};\n\nshaka.polyfill.register(shaka.polyfill.IndexedDB.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/indexed_db.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\ngoog.provide('shaka.polyfill.MathRound');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n/**\n * @namespace shaka.polyfill.MathRound\n *\n * @summary A polyfill to patch math round bug on some browsers.\n */\n\n\n/**\n @const {number}\n @private\n */\nshaka.polyfill.MathRound.MAX_ACCURATE_INPUT_ = 0x10000000000000;\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.MathRound.install = function() {\n shaka.log.debug('mathRound.install');\n\n var testNumber = shaka.polyfill.MathRound.MAX_ACCURATE_INPUT_ + 1;\n if (Math.round(testNumber) != testNumber) {\n shaka.log.debug('polyfill Math.round');\n var original_mathRound = Math.round;\n Math.round = function(number) {\n var result = number;\n // https://stackoverflow.com/questions/12830742/javascript-math-round-bug-in-ie\n // Due to the precision of JavaScript numbers, the number must be integer\n if (number <= shaka.polyfill.MathRound.MAX_ACCURATE_INPUT_) {\n result = original_mathRound(number);\n }\n return result;\n };\n }\n};\n\nshaka.polyfill.register(shaka.polyfill.MathRound.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/mathround.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.MediaKeys');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.PatchedMediaKeysMs');\ngoog.require('shaka.polyfill.PatchedMediaKeysNop');\ngoog.require('shaka.polyfill.PatchedMediaKeysWebkit');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.MediaKeys\n *\n * @summary A polyfill to unify EME APIs across browser versions.\n *\n * The {@link https://w3c.github.io/encrypted-media/ EME spec} is still a\n * work-in-progress. As such, we need to provide a consistent API to the Shaka\n * Player. Until the spec is completely stable, the API provided by this\n * polyfill may lag behind the latest spec developments.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.MediaKeys.install = function() {\n shaka.log.debug('MediaKeys.install');\n\n if (!window.HTMLVideoElement) {\n // Avoid errors on very old browsers.\n return;\n }\n\n if (navigator.requestMediaKeySystemAccess &&\n MediaKeySystemAccess.prototype.getConfiguration) {\n shaka.log.info('Using native EME as-is.');\n } else if (HTMLMediaElement.prototype.webkitGenerateKeyRequest) {\n shaka.log.info('Using webkit-prefixed EME v0.1b');\n shaka.polyfill.PatchedMediaKeysWebkit.install('webkit');\n } else if (HTMLMediaElement.prototype.generateKeyRequest) {\n shaka.log.info('Using nonprefixed EME v0.1b');\n shaka.polyfill.PatchedMediaKeysWebkit.install('');\n } else if (window.MSMediaKeys) {\n shaka.log.info('Using ms-prefixed EME v20140218');\n shaka.polyfill.PatchedMediaKeysMs.install();\n } else {\n shaka.log.info('EME not available.');\n shaka.polyfill.PatchedMediaKeysNop.install();\n }\n};\n\n\nshaka.polyfill.register(shaka.polyfill.MediaKeys.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/mediakeys.js","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ngoog.provide('shaka.polyfill.VideoPlayPromise');\n\ngoog.require('shaka.log');\ngoog.require('shaka.polyfill.register');\n\n\n/**\n * @namespace shaka.polyfill.VideoPlayPromise\n *\n * @summary A polyfill to silence the play() Promise in HTML5 video.\n */\n\n\n/**\n * Install the polyfill if needed.\n */\nshaka.polyfill.VideoPlayPromise.install = function() {\n shaka.log.debug('VideoPlayPromise.install');\n\n if (window.HTMLMediaElement) {\n var originalPlay = HTMLMediaElement.prototype.play;\n HTMLMediaElement.prototype.play = function() {\n var p = originalPlay.apply(this, arguments);\n if (p) {\n // This browser is returning a Promise from play().\n // If the play() call fails or is interrupted, the Promise will be\n // rejected. Some apps, however, don't listen to this Promise,\n // especially since it is not available cross-browser. If the Promise\n // is rejected without anyone listening for the failure, an error will\n // appear in the JS console.\n // To avoid confusion over this innocuous \"error\", we will install a\n // catch handler on the Promise. This does not prevent the app from\n // also catching failures and handling them. It only prevents the\n // console message.\n p.catch(function() {});\n }\n return p;\n };\n }\n};\n\nshaka.polyfill.register(shaka.polyfill.VideoPlayPromise.install);\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/shaka-player/lib/polyfill/video_play_promise.js","//@flow\nimport * as Playkit from 'playkit-js';\nimport OvpProvider from 'playkit-js-providers/dist/ovpProvider';\nimport handleSessionId from './session-id'\n\n/**\n *\n * @param {Object} config - contains partnerId and entryID\n * @return {Promise<*>} - player promise\n */\nexport default function setup(config: Object): Promise<*> {\n let player = Playkit.playkit();\n player.addEventListener(player.Event.SOURCE_SELECTED, (event) => {\n handleSessionId(event.payload.selectedSource, player);\n });\n if (config) {\n let provider = new OvpProvider(config.partnerId);\n return provider.getConfig(config.entryID)\n .then(data => {\n player.configure(data);\n return Promise.resolve(player);\n }).catch(error => {\n return Promise.reject(error);\n });\n } else {\n return Promise.resolve(player);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./setup.js","//@flow\n/**\n * @return {string} - GUID\n * @private\n */\nfunction _generateGUID(): string {\n let S4 = () => {\n return (((1+Math.random())*0x10000)|0).toString(16).substring(1);\n };\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n}\n\n/**\n * @param {Object} selectedSource - selected source\n * @param {Player} player - player\n * @return {void}\n * @private\n */\nfunction _addSessionId(selectedSource: Object, player: Player): void {\n let delimiter = selectedSource.url.indexOf('?') === -1 ? '?' : '&';\n let primaryGUID = _generateGUID();\n let secondGUID = _generateGUID();\n let sessionId = primaryGUID + ':' + secondGUID;\n selectedSource.url += delimiter + 'playSessionId=' + sessionId;\n player.sessionId = sessionId;\n}\n\n/**\n * @param {Object} selectedSource - selected source\n * @param {string} sessionId - session id\n * @param {Player} player - player\n * @return {void}\n * @private\n */\nfunction _replaceSecondGUID(selectedSource: Object, sessionId: string, player: Player): void {\n let secondGUIDRegex = /:((?:[a-z0-9]|-)*)/i;\n let secondGUID = secondGUIDRegex.exec(sessionId);\n if (secondGUID && secondGUID[1]) {\n let newSessionId = sessionId.replace(secondGUID[1], _generateGUID());\n selectedSource.url = selectedSource.url.replace(sessionId, newSessionId);\n player.sessionId = newSessionId;\n }\n}\n\n/**\n * @param {Object} selectedSource - selected source\n * @param {Player} player - player\n * @return {void}\n * @public\n */\nfunction handleSessionId(selectedSource: Object = {}, player: Player): void {\n if (typeof selectedSource.url === 'string' && selectedSource.url.toLowerCase().indexOf('playmanifest/') !== -1) {\n let sessionIdRegex = /playSessionId=((?:[a-z0-9]|-|:)*)/i;\n let sessionId = sessionIdRegex.exec(selectedSource.url);\n if (sessionId && sessionId[1]) {\n _replaceSecondGUID(selectedSource, sessionId[1], player);\n } else {\n _addSessionId(selectedSource, player);\n }\n }\n}\n\nexport default handleSessionId\n\n\n\n// WEBPACK FOOTER //\n// ./session-id.js"],"sourceRoot":""} \ No newline at end of file diff --git a/src/index.html b/src/index.html index 8dfabd2fe..e5bbf3be0 100644 --- a/src/index.html +++ b/src/index.html @@ -9,11 +9,16 @@ <div id="root"></div> <script> window.setupPlayer = function () { - let ovpProvider = new KalturaPlayer.OvpProvider(2196781); - ovpProvider.getConfig("1_afvj3z0u").then((data) => { - window.player = KalturaPlayer.Playkit.playkit(data); - window.uiManager = new KalturaPlayer.PlaykitUI(player, data); + let config = { + partnerId: 2196781, entryID: '1_h14v9eug' + }; + KalturaPlayer.setup(config).then(player => { + window.player = player; + window.uiManager = new KalturaPlayer.PlaykitUI(player, player.config); uiManager.buildDefaultUI(); + player.play() + }).catch(error => { + console.error(error); }); }; </script> diff --git a/src/index.js b/src/index.js index 4270117cc..d6b7bf1ed 100644 --- a/src/index.js +++ b/src/index.js @@ -14,7 +14,8 @@ import '../node_modules/playkit-js-ui/src/styles/style.css'; import 'playkit-js-hls'; import 'playkit-js-dash'; +import setup from './setup' // TODO: Import plugins -export {Playkit, OvpProvider, PlaykitUI}; +export {Playkit, OvpProvider, PlaykitUI, setup}; diff --git a/src/session-id.js b/src/session-id.js new file mode 100644 index 000000000..e5a373536 --- /dev/null +++ b/src/session-id.js @@ -0,0 +1,63 @@ +//@flow +/** + * @return {string} - GUID + * @private + */ +function _generateGUID(): string { + let S4 = () => { + return (((1+Math.random())*0x10000)|0).toString(16).substring(1); + }; + return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()); +} + +/** + * @param {Object} selectedSource - selected source + * @param {Player} player - player + * @return {void} + * @private + */ +function _addSessionId(selectedSource: Object, player: Player): void { + let delimiter = selectedSource.url.indexOf('?') === -1 ? '?' : '&'; + let primaryGUID = _generateGUID(); + let secondGUID = _generateGUID(); + let sessionId = primaryGUID + ':' + secondGUID; + selectedSource.url += delimiter + 'playSessionId=' + sessionId; + player.sessionId = sessionId; +} + +/** + * @param {Object} selectedSource - selected source + * @param {string} sessionId - session id + * @param {Player} player - player + * @return {void} + * @private + */ +function _replaceSecondGUID(selectedSource: Object, sessionId: string, player: Player): void { + let secondGUIDRegex = /:((?:[a-z0-9]|-)*)/i; + let secondGUID = secondGUIDRegex.exec(sessionId); + if (secondGUID && secondGUID[1]) { + let newSessionId = sessionId.replace(secondGUID[1], _generateGUID()); + selectedSource.url = selectedSource.url.replace(sessionId, newSessionId); + player.sessionId = newSessionId; + } +} + +/** + * @param {Object} selectedSource - selected source + * @param {Player} player - player + * @return {void} + * @public + */ +function handleSessionId(selectedSource: Object = {}, player: Player): void { + if (typeof selectedSource.url === 'string' && selectedSource.url.toLowerCase().indexOf('playmanifest/') !== -1) { + let sessionIdRegex = /playSessionId=((?:[a-z0-9]|-|:)*)/i; + let sessionId = sessionIdRegex.exec(selectedSource.url); + if (sessionId && sessionId[1]) { + _replaceSecondGUID(selectedSource, sessionId[1], player); + } else { + _addSessionId(selectedSource, player); + } + } +} + +export default handleSessionId diff --git a/src/setup.js b/src/setup.js new file mode 100644 index 000000000..793d22418 --- /dev/null +++ b/src/setup.js @@ -0,0 +1,28 @@ +//@flow +import * as Playkit from 'playkit-js'; +import OvpProvider from 'playkit-js-providers/dist/ovpProvider'; +import handleSessionId from './session-id' + +/** + * + * @param {Object} config - contains partnerId and entryID + * @return {Promise<*>} - player promise + */ +export default function setup(config: Object): Promise<*> { + let player = Playkit.playkit(); + player.addEventListener(player.Event.SOURCE_SELECTED, (event) => { + handleSessionId(event.payload.selectedSource, player); + }); + if (config) { + let provider = new OvpProvider(config.partnerId); + return provider.getConfig(config.entryID) + .then(data => { + player.configure(data); + return Promise.resolve(player); + }).catch(error => { + return Promise.reject(error); + }); + } else { + return Promise.resolve(player); + } +} diff --git a/test/src/session-id.spec.js b/test/src/session-id.spec.js new file mode 100644 index 000000000..50427be3a --- /dev/null +++ b/test/src/session-id.spec.js @@ -0,0 +1,53 @@ +import handleSessionId from '../../src/session-id' + +describe('handleSessionId', function () { + + it('should add session id for playManifest source', function () { + let selectedSource = {url: 'a/b/c/playmanifest/source'}; + let player = {}; + handleSessionId(selectedSource, player); + selectedSource.url.should.be.equal('a/b/c/playmanifest/source?playSessionId=' + player.sessionId); + }); + + it('should add session id for playManifest source with query param', function () { + let selectedSource = {url: 'a/b/c/playmanifest/source?a'}; + let player = {}; + handleSessionId(selectedSource, player); + selectedSource.url.should.be.equal('a/b/c/playmanifest/source?a&playSessionId=' + player.sessionId); + }); + + it('should add session id for PLAYMANIFEST source', function () { + let selectedSource = {url: 'a/b/c/PLAYMANIFEST/source'}; + let player = {}; + handleSessionId(selectedSource, player); + selectedSource.url.should.be.equal('a/b/c/PLAYMANIFEST/source?playSessionId=' + player.sessionId); + }); + + it('should add session id for PLAYMANIFEST source with query param', function () { + let selectedSource = {url: 'a/b/c/PLAYMANIFEST/source?a'}; + let player = {}; + handleSessionId(selectedSource, player); + selectedSource.url.should.be.equal('a/b/c/PLAYMANIFEST/source?a&playSessionId=' + player.sessionId); + }); + + it('should not add session id for no playManifest source', function () { + let selectedSource = {url: 'a/b/c'}; + let player = {}; + handleSessionId(selectedSource, player); + selectedSource.url.should.be.equal('a/b/c'); + }); + + it('should replace the second GUID for existing session id as first query param', function () { + let selectedSource = {url: 'a/b/c/playmanifest/source?playSessionId=8a18888e-4110-d61b-5285-c601c51b70e3:b892a45b-23dc-7f3b-0ca1-5381a88e0c81&a'}; + let player = {}; + handleSessionId(selectedSource, player); + selectedSource.url.should.be.equal('a/b/c/playmanifest/source?playSessionId=8a18888e-4110-d61b-5285-c601c51b70e3' + player.sessionId.substr(player.sessionId.indexOf(':')) + '&a'); + }); + + it('should replace the second GUID for existing session id as second query param', function () { + let selectedSource = {url: 'a/b/c/playmanifest/source?a&playSessionId=8a18888e-4110-d61b-5285-c601c51b70e3:b892a45b-23dc-7f3b-0ca1-5381a88e0c81'}; + let player = {}; + handleSessionId(selectedSource, player); + selectedSource.url.should.be.equal('a/b/c/playmanifest/source?a&playSessionId=8a18888e-4110-d61b-5285-c601c51b70e3' + player.sessionId.substr(player.sessionId.indexOf(':'))); + }); +}); diff --git a/test/src/setup.spec.js b/test/src/setup.spec.js new file mode 100644 index 000000000..ccf59bf07 --- /dev/null +++ b/test/src/setup.spec.js @@ -0,0 +1,46 @@ +import setup from '../../src/setup' +import * as TestUtils from 'playkit-js/test/src/utils/test-utils' + +describe('setup', function () { + + let config, player; + + beforeEach(function () { + config = { + partnerId: 2196781, entryID: '1_h14v9eug' + }; + }); + + afterEach(function () { + player.destroy(); + TestUtils.removeVideoElementsFromTestPage(); + }); + + it('should create a full player', function (done) { + setup(config).then(p => { + player = p; + player.config.id.should.equal(config.entryID); + player.config.session.partnerID.should.equal(config.partnerId); + done(); + }); + }); + + it('should create an empty player', function (done) { + setup().then(p => { + player = p; + (!player.config.id).should.be.true; + done(); + }); + }); + + it('should decorate the selected source by session id', function (done) { + setup(config).then(p => { + player = p; + player.load(); + let sessionIdRegex = /playSessionId=((?:[a-z0-9]|-|:)*)/i; + player.config.session.id.should.exist; + sessionIdRegex.exec(player.src)[1].should.equal(player.config.session.id); + done(); + }); + }); +});